From 093aefdc034bf99c8cc46869aa828d3efad962e7 Mon Sep 17 00:00:00 2001 From: luoxiao Date: Tue, 26 Nov 2024 15:24:19 +0800 Subject: [PATCH] =?UTF-8?q?[fix]updateOverLayer=20featureProjection?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mapboxgl/web-map/WebMapViewModel.ts | 6 +++--- static/libs/iclient-mapboxgl/iclient-mapboxgl.min.js | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/mapboxgl/web-map/WebMapViewModel.ts b/src/mapboxgl/web-map/WebMapViewModel.ts index 538d3f4c..5aa7624c 100644 --- a/src/mapboxgl/web-map/WebMapViewModel.ts +++ b/src/mapboxgl/web-map/WebMapViewModel.ts @@ -110,7 +110,7 @@ interface MapHandler { setLayersVisible: (layers: Array>, visibility: 'visible' | 'none') => void; toggleLayerVisible: (layer: Record, visible: boolean) => void; echartsLayerResize: () => void; - updateOverlayLayer: (layerInfo: Record, features: any, mergeByField?: string) => void; + updateOverlayLayer: (layerInfo: Record, features: any, mergeByField?: string, featureProjection?: string) => void; copyLayer: (id: string, layerInfo: Record) => boolean; resize: (keepBounds: boolean) => void; setCRS: (crs: CRSOptions | string) => void; @@ -499,8 +499,8 @@ export default class WebMapViewModel extends Events { this.clean(); } - updateOverlayLayer(layerInfo: any, features: any, mergeByField?: string) { - this._handler.updateOverlayLayer(layerInfo, features, mergeByField); + updateOverlayLayer(layerInfo: any, features: any, mergeByField?: string, featureProjection?: string) { + this._handler.updateOverlayLayer(layerInfo, features, mergeByField, featureProjection); } copyLayer(id: string, layerInfo: Record) { diff --git a/static/libs/iclient-mapboxgl/iclient-mapboxgl.min.js b/static/libs/iclient-mapboxgl/iclient-mapboxgl.min.js index 7052288a..2053adf0 100644 --- a/static/libs/iclient-mapboxgl/iclient-mapboxgl.min.js +++ b/static/libs/iclient-mapboxgl/iclient-mapboxgl.min.js @@ -5,6 +5,4 @@ * license: Apache-2.0 * version: v11.3.0 * - */!function(){var t={6018:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(t,e){var r=t.nodes,n=t.edges,i=[],o={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach(function(t,e){o[t.id]=e,i.push([])}),n&&n.forEach(function(t){var r=t.source,n=t.target,a=o[r],s=o[n];!a&&0!==a||!s&&0!==s||(i[a][s]=1,e||(i[s][a]=1))}),i};e.default=r},6156:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"GADDIAsync",{enumerable:!0,get:function(){return n.GADDIAsync}}),Object.defineProperty(e,"connectedComponentAsync",{enumerable:!0,get:function(){return n.connectedComponentAsync}}),e.default=void 0,Object.defineProperty(e,"detectAllCyclesAsync",{enumerable:!0,get:function(){return n.detectAllCyclesAsync}}),Object.defineProperty(e,"detectAllDirectedCycleAsync",{enumerable:!0,get:function(){return n.detectAllDirectedCycleAsync}}),Object.defineProperty(e,"detectAllUndirectedCycleAsync",{enumerable:!0,get:function(){return n.detectAllUndirectedCycleAsync}}),Object.defineProperty(e,"detectCycleAsync",{enumerable:!0,get:function(){return n.detectCycleAsync}}),e.detectDirectedCycleAsync=void 0,Object.defineProperty(e,"dijkstraAsync",{enumerable:!0,get:function(){return n.dijkstraAsync}}),Object.defineProperty(e,"findAllPathAsync",{enumerable:!0,get:function(){return n.findAllPathAsync}}),Object.defineProperty(e,"findShortestPathAsync",{enumerable:!0,get:function(){return n.findShortestPathAsync}}),Object.defineProperty(e,"floydWarshallAsync",{enumerable:!0,get:function(){return n.floydWarshallAsync}}),Object.defineProperty(e,"getAdjMatrixAsync",{enumerable:!0,get:function(){return n.getAdjMatrixAsync}}),Object.defineProperty(e,"getDegreeAsync",{enumerable:!0,get:function(){return n.getDegreeAsync}}),Object.defineProperty(e,"getInDegreeAsync",{enumerable:!0,get:function(){return n.getInDegreeAsync}}),Object.defineProperty(e,"getNeighborsAsync",{enumerable:!0,get:function(){return n.getNeighborsAsync}}),Object.defineProperty(e,"getOutDegreeAsync",{enumerable:!0,get:function(){return n.getOutDegreeAsync}}),Object.defineProperty(e,"labelPropagationAsync",{enumerable:!0,get:function(){return n.labelPropagationAsync}}),Object.defineProperty(e,"louvainAsync",{enumerable:!0,get:function(){return n.louvainAsync}}),Object.defineProperty(e,"minimumSpanningTreeAsync",{enumerable:!0,get:function(){return n.minimumSpanningTreeAsync}}),Object.defineProperty(e,"pageRankAsync",{enumerable:!0,get:function(){return n.pageRankAsync}});var n=r(8305),i=n.detectCycleAsync;e.detectDirectedCycleAsync=i;var o={getAdjMatrixAsync:n.getAdjMatrixAsync,connectedComponentAsync:n.connectedComponentAsync,getDegreeAsync:n.getDegreeAsync,getInDegreeAsync:n.getInDegreeAsync,getOutDegreeAsync:n.getOutDegreeAsync,detectCycleAsync:n.detectCycleAsync,detectDirectedCycleAsync:i,detectAllCyclesAsync:n.detectAllCyclesAsync,detectAllDirectedCycleAsync:n.detectAllDirectedCycleAsync,detectAllUndirectedCycleAsync:n.detectAllUndirectedCycleAsync,dijkstraAsync:n.dijkstraAsync,findAllPathAsync:n.findAllPathAsync,findShortestPathAsync:n.findShortestPathAsync,floydWarshallAsync:n.floydWarshallAsync,labelPropagationAsync:n.labelPropagationAsync,louvainAsync:n.louvainAsync,minimumSpanningTreeAsync:n.minimumSpanningTreeAsync,pageRankAsync:n.pageRankAsync,getNeighborsAsync:n.getNeighborsAsync,GADDIAsync:n.GADDIAsync};e.default=o},5799:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(2500))&&n.__esModule?n:{default:n},o=r(5696);var a=function(t,e,r,n){void 0===n&&(n=!0);var a=function(t){void 0===t&&(t={});var e,r=t,n=function(){},i=(e={},function(t){var r=t.next;return!e[r]&&(e[r]=!0,!0)});return r.allowTraversal=t.allowTraversal||i,r.enter=t.enter||n,r.leave=t.leave||n,r}(r),s=new i.default,u=t.edges,l=void 0===u?[]:u;s.enqueue(e);for(var c="",f=function(){var t=s.dequeue();a.enter({current:t,previous:c}),(0,o.getNeighbors)(t,l,n?"target":void 0).forEach(function(e){a.allowTraversal({previous:c,current:t,next:e})&&s.enqueue(e)}),a.leave({current:t,previous:c}),c=t};!s.isEmpty();)f()};e.default=a},2111:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return e?o(t):i(t)},e.detectStrongConnectComponents=e.detectConnectedComponents=void 0;var n=r(5696),i=function(t){for(var e=t.nodes,r=void 0===e?[]:e,i=t.edges,o=void 0===i?[]:i,a=[],s={},u=[],l=function t(e){u.push(e),s[e.id]=!0;for(var i=(0,n.getNeighbors)(e.id,o),a=function(e){var n=i[e];if(!s[n]){var o=r.filter(function(t){return t.id===n});o.length>0&&t(o[0])}},l=0;l0;)h.push(u.pop());a.push(h)}}return a};e.detectConnectedComponents=i;var o=function(t){for(var e=t.nodes,r=void 0===e?[]:e,i=t.edges,o=void 0===i?[]:i,a=[],s={},u={},l={},c=[],f=0,h=function t(e){u[e.id]=f,l[e.id]=f,f+=1,a.push(e),s[e.id]=!0;for(var i=(0,n.getNeighbors)(e.id,o,"target").filter(function(t){return r.map(function(t){return t.id}).indexOf(t)>-1}),h=function(n){var o=i[n];if(u[o]||0===u[o])s[o]&&(l[e.id]=Math.min(l[e.id],u[o]));else{var a=r.filter(function(t){return t.id===o});a.length>0&&t(a[0]),l[e.id]=Math.min(l[e.id],l[o])}},p=0;p0;){var y=a.pop();if(s[y.id]=!1,d.push(y),y===e)break}d.length>0&&c.push(d)}},p=0,d=r;p0;)for(var g=p.pop(),v=g.id,m=(0,s.getNeighbors)(v,t.edges),b=function(n){var i,a=m[n],s=t.nodes.find(function(t){return t.id===a});if(a===v)o.push(((i={})[a]=g,i));else if(a in y){if(!y[v].has(s)){for(var u=!0,l=[s,g],c=d[v];y[a].size&&!y[a].has(c)&&(l.push(c),c!==d[c.id]);)c=d[c.id];if(l.push(c),e&&r?(u=!1,l.findIndex(function(t){return e.indexOf(t.id)>-1})>-1&&(u=!0)):e&&!r&&l.findIndex(function(t){return e.indexOf(t.id)>-1})>-1&&(u=!1),u){for(var f={},h=1;h-1)return f;n.push(a),i.add(a);for(var h=c[a.id],p=0;p0;){var r=e.pop();i.has(r)&&(i.delete(r),o[r.id].forEach(function(t){e.push(t)}),o[r.id].clear())}}(a);else for(p=0;p-1});v-1?y[g.id].push(c[b]):u.push(((i={})[g.id]=g,i))}}return{component:d,adjList:y,minIdx:a}},b=0;b=b}),x=(0,a.detectStrongConnectComponents)({nodes:A,edges:t.edges}).filter(function(t){return t.length>1});if(0===x.length)break;var w=m(x),_=w.minIdx,S=w.adjList,E=w.component;if(!(E.length>1))break;E.forEach(function(t){o[t.id]=new Set});var C=l[_];if(e&&r&&-1===e.indexOf(C.id))return u;f(C,C,S),b=_+1}return u};e.detectAllDirectedCycle=c;e.detectAllCycles=function(t,e,r,n){return void 0===n&&(n=!0),e?c(t,r,n):l(t,r,n)};var f=function(t){var e=null,r=t.nodes,n={},i={},a={},s={};(void 0===r?[]:r).forEach(function(t){i[t.id]=t});for(var u={enter:function(t){var r=t.current,o=t.previous;if(a[r]){e={};for(var s=r,u=o;u!==r;)e[s]=u,s=u,u=n[u];e[s]=u}else a[r]=r,delete i[r],n[r]=o},leave:function(t){var e=t.current;s[e]=e,delete a[e]},allowTraversal:function(t){var r=t.next;return!e&&!s[r]}};Object.keys(i).length;){var l=Object.keys(i)[0];(0,o.default)(t,l,u)}return e};e.default=f},8133:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r,i){void 0===i&&(i=!0);!function t(e,r,i,o,a){void 0===a&&(a=!0);o.enter({current:r,previous:i});var s=e.edges,u=void 0===s?[]:s;(0,n.getNeighbors)(r,u,a?"target":void 0).forEach(function(n){o.allowTraversal({previous:i,current:r,next:n})&&t(e,n,r,o,a)});o.leave({current:r,previous:i})}(t,e,"",function(t){void 0===t&&(t={});var e=t,r=function(){},n=(i={},function(t){var e=t.next;return!i[e]&&(i[e]=!0,!0)});var i;return e.allowTraversal=t.allowTraversal||n,e.enter=t.enter||r,e.leave=t.leave||r,e}(r),i)};var n=r(5696)},7606:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(1635),i=r(1359),o=r(5696),a=function(t,e,r,n){var i=t.nodes,a=void 0===i?[]:i,u=t.edges,l=void 0===u?[]:u,c=[],f={},h={},p={};a.forEach(function(t,r){var n=t.id;c.push(n),h[n]=1/0,n===e&&(h[n]=0)});for(var d=a.length,y=function(t){var e=function(t,e,r){for(var n,i=1/0,o=0;oh[e.id]+s?(h[a]=h[e.id]+s,p[a]=[e.id]):h[a]===h[e.id]+s&&p[a].push(e.id)})},g=0;g0&&c.length>0;){var p=c[c.length-1];if(p.length){var d=p.shift();if(d&&(u.push(d),l[d]=!0,h=n?(0,o.getNeighbors)(d,s,"target"):(0,o.getNeighbors)(d,s),c.push(h.filter(function(t){return!l[t]}))),u[u.length-1]===r){var y=u.map(function(t){return t});f.push(y),g=u.pop(),l[g]=!1,c.pop()}}else{var g=u.pop();l[g]=!1,c.pop()}}return f}},564:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(6018))&&n.__esModule?n:{default:n};var o=function(t,e){for(var r=(0,i.default)(t,e),n=[],o=r.length,a=0;an[a][u]+n[u][s]&&(n[a][s]=n[a][u]+n[u][s]);return n};e.default=o},9233:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(1359),i=r(9943),o=function(){function t(t,e,r,n,o){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:r||i.VACANT_NODE_LABEL,edgeLabel:n||i.VACANT_EDGE_LABEL,nodeLabel2:o||i.VACANT_NODE_LABEL}}return t.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},t.prototype.notEqualTo=function(t){return!this.equalTo(t)},t}(),a=function(){function t(){this.rmpath=[],this.dfsEdgeList=[]}return t.prototype.equalTo=function(t){var e=this.dfsEdgeList.length;if(e!==t.length)return!1;for(var r=0;r=0;e--){var r=this.dfsEdgeList[e],n=r.fromNode,i=r.toNode;nf||n.hasNode(o[c.to])||(e.labelv&&"break"!==m(b);b--);if(y){var A=t.findMinLabel(d);l.dfsEdgeList.push(new o(p,g,i.VACANT_NODE_LABEL,A.edgeLabel,i.VACANT_NODE_LABEL));var x=l.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[x]===l.dfsEdgeList[x]&&a(d[A.edgeLabel].projected)}var w={};y=!1;var _=0;c.forEach(function(e){var r=new s(e),i=t.findForwardPureEdges(n,r.edges[f[0]],h,r);i.length>0&&(y=!0,_=p,i.forEach(function(t){var r="".concat(t.label,"-").concat(u[t.to].label);w[r]||(w[r]={projected:[],edgeLabel:t.label,nodeLabel2:u[t.to].label}),w[r].projected.push({graphId:n.id,edge:t,preNode:e})}))});var S=f.length,E=function(e){if(y)return"break";var r=f[e];c.forEach(function(e){var i=new s(e),o=t.findForwardRmpathEdges(n,i.edges[r],h,i);o.length>0&&(y=!0,_=l.dfsEdgeList[r].fromNode,o.forEach(function(t){var r="".concat(t.label,"-").concat(u[t.to].label);w[r]||(w[r]={projected:[],edgeLabel:t.label,nodeLabel2:u[t.to].label}),w[r].projected.push({graphId:n.id,edge:t,preNode:e})}))})};for(b=0;b=0;h--){var p=e.findBackwardEdge(i,f.edges[n[h]],f.edges[n[0]],f);if(p){var d="".concat(e.dfsCode.dfsEdgeList[n[h]].fromNode,"-").concat(p.label);c[d]||(c[d]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[n[h]].fromNode,edgeLabel:p.label}),c[d].projected.push({graphId:t.graphId,edge:p,preNode:t})}}if(!(r>=e.maxNodeNum)){e.findForwardPureEdges(i,f.edges[n[0]],u,f).forEach(function(e){var r="".concat(a,"-").concat(e.label,"-").concat(o[e.to].label);l[r]||(l[r]={projected:[],fromNodeId:a,edgeLabel:e.label,nodeLabel2:o[e.to].label}),l[r].projected.push({graphId:t.graphId,edge:e,preNode:t})});var y=function(r){e.findForwardRmpathEdges(i,f.edges[n[r]],u,f).forEach(function(i){var a="".concat(e.dfsCode.dfsEdgeList[n[r]].fromNode,"-").concat(i.label,"-").concat(o[i.to].label);l[a]||(l[a]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[n[r]].fromNode,edgeLabel:i.label,nodeLabel2:o[i.to].label}),l[a].projected.push({graphId:t.graphId,edge:i,preNode:t})})};for(h=0;hi){var a=i;i=n,n=a}var c=t.label,f="".concat(r,"-").concat(n,"-").concat(c,"-").concat(i),h="".concat(n,"-").concat(c,"-").concat(i);if(!o[h]){var p=o[h]||0;p++,o[h]=p}s[f]={graphId:r,nodeLabel1:n,edgeLabel:c,nodeLabel2:i}})})}),Object.keys(i).forEach(function(t){if(!(i[t]e&&(s=e);var n=r[t.id].inDegree;u>n&&(u=n);var i=r[t.id].outDegree;l>i&&(l=i)}),t[e]={degree:s,inDegree:u,outDegree:l}),{minPatternNodeLabelDegree:s,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:l}},m=function(t,e,r,s,u,m,b){var A;if(void 0===r&&(r=!1),void 0===m&&(m="cluster"),void 0===b&&(b="cluster"),t&&t.nodes){var x=t.nodes.length;if(x){var w=(0,i.default)(t,r),_=(0,i.default)(e,r),S=y(t.nodes,w,r),E=y(e.nodes,_,r),C=p(t.nodes,m),k=C.nodeMap,I=C.nodeLabelMap,T=p(e.nodes,m),O=T.nodeMap,M=T.nodeLabelMap;d(t.edges,b,k);var P=d(e.edges,b,O).edgeLabelMap,L=[];null===_||void 0===_||_.forEach(function(t){L=L.concat(t)}),u||(u=Math.max.apply(Math,(0,n.__spreadArray)((0,n.__spreadArray)([],L,!1),[2],!1))),s||(s=u);var N=l(t,w,m,s),j=l(e,_,m,s),R=function(t,e,r,n,i){var o=Math.ceil(r/e),a={},s=0;return n.forEach(function(t,n){for(var u=0,l=0,c=t.nodeIdxs,f=t.neighborNum-1;u2*e)););if(p<2*e&&(a["".concat(n,"-").concat(h)]={start:n,end:h,distance:i[n][h]},u++,++s>=r))return a;if(++l>2*e)break}uq&&(q=r.length,Y=r,W=e,Q=t)});var X={},K={},J={},Z={},$={},tt={};Object.keys(M).forEach(function(n,i){$[n]=[],r&&(tt[n]=[]);var o=-1/0,a={};M[n].forEach(function(t){var e=E["".concat(Q.id,"-").concat(t.id)];if(e&&$[n].push(e),o$[n][l]){u=!0;break}if(u)return Y.splice(e,1),"continue";var c={};i.neighbors.forEach(function(t){var e=S["".concat(r.id,"-").concat(t.id)];c["".concat(r.id,"-").concat(t.id)]={start:k[r.id].idx,end:k[t.id].idx,distance:e}}),D=f(c,N,t,D);var p=[];Object.keys(c).forEach(function(t){if(V[t])p.push(V[t]);else{var e=D[t];V[t]=h(e,H,m,b),p.push(V[t])}}),p=p.sort(function(t,e){return e-t});var d=!1;for(l=0;l=0;l--)u(l)});var et=[];null===Y||void 0===Y||Y.forEach(function(n){for(var i=k[n.id].idx,o=c(t.nodes,w[i],i,m,u).neighbors,a=!1,s=o.length-1;s>=0;s--){if(o.length+1$[f][d])o.splice(s,1);else{if(r){var y="".concat(l.id,"-").concat(n.id),A=S[y];if(d=tt[f].length-1,A>tt[f][d]){o.splice(s,1);continue}}var x=V[h]?V[h]:g(t,n,l,k,p,N,H,m,b,V,D),_="".concat(Q.id,"-").concat(f);if(x=0&&"break"!==A(p);p--);if(g)return et.splice(n,1),"continue";i.edges=l;var x=(0,a.default)(i,i.nodes[0].id,!1).length;if(Object.keys(x).reverse().forEach(function(t){if(t!==i.nodes[0].id&&!g){if(x[t]===1/0){var e=u[t].node[m];if(s[e]--,s[e]nt[n][nt[n].length-1]){if(e=u[t].node[m],s[e]--,s[e]=0;S--){var E=i.nodes[S],C=u[E.id].degree,I=u[E.id].inDegree,T=u[E.id].outDegree,L=E[m],N=v(X,L,O,M),j=N.minPatternNodeLabelDegree,R=N.minPatternNodeLabelInDegree,D=N.minPatternNodeLabelOutDegree;if(r?C=0;B--){var F=l[B];if(!u[F.source]||!u[F.target]){l.splice(B,1);var z=F[b];if(c[z]--,u[F.source]&&(u[F.source].degree--,u[F.source].outDegree--),u[F.target]&&(u[F.target].degree--,u[F.target].inDegree--),P[z]&&c[z]=0&&"break"!==it(ot);ot--);var at=et.length,st=function(t){var e={};et[t].edges.forEach(function(t){var r="".concat(t.source,"-").concat(t.target,"-").concat(t.label);e[r]?e[r]++:e[r]=1});for(var r=function(t){var r={};et[t].edges.forEach(function(t){var e="".concat(t.source,"-").concat(t.target,"-").concat(t.label);r[e]?r[e]++:r[e]=1});var n=!0;Object.keys(r).length!==Object.keys(e).length?n=!1:Object.keys(e).forEach(function(t){r[t]!==e[t]&&(n=!1)}),n&&et.splice(t,1)},n=at-1;n>t;n--)r(n);at=et.length};for(ot=0;ot<=at-1;ot++)st(ot);return et}}};e.default=m},8683:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(6018))&&n.__esModule?n:{default:n},o=r(5696);var a=function(t,e,r,n){void 0===e&&(e=!1),void 0===r&&(r="weight"),void 0===n&&(n=1e3);var a=t.nodes,s=void 0===a?[]:a,u=t.edges,l=void 0===u?[]:u,c={},f={};s.forEach(function(t,e){var r=(0,o.uniqueId)();t.clusterId=r,c[r]={id:r,nodes:[t]},f[t.id]={node:t,idx:e}});var h=[],p={};(0,i.default)(t,e).forEach(function(t,e){var r=0,n=s[e].id;p[n]={},t.forEach(function(t,e){if(t){r+=t;var i=s[e].id;p[n][i]=t}}),h.push(r)});for(var d=0,y=function(){var t=!1;if(s.forEach(function(e){var r={};Object.keys(p[e.id]).forEach(function(t){var n=p[e.id][t],i=f[t].node.clusterId;r[i]||(r[i]=0),r[i]+=n});var n=-1/0,i=[];if(Object.keys(r).forEach(function(t){n=0&&i.splice(o,1),i&&i.length){t=!0;var a=c[e.clusterId],s=a.nodes.indexOf(e);a.nodes.splice(s,1);var u=Math.floor(Math.random()*i.length),l=c[i[u]];l.nodes.push(e),e.clusterId=l.id}}}),!t)return"break";d++};d0&&T>O&&T-OO&&(P=g.map(function(t){return{node:t,clusterId:t.clusterId}}),L=(0,n.clone)(_),O=T),N||M>100)break;M++,Object.keys(_).forEach(function(t){var e=0;m.forEach(function(n){var i=n.source,o=n.target,a=S[i].node.clusterId,s=S[o].node.clusterId;(a===t&&s!==t||s===t&&a!==t)&&(e+=n[r]||1)}),_[t].sumTot=e}),g.forEach(function(t,e){var n,i=_[t.clusterId],o=0,a=C[e]/(2*I),s=0,l=i.nodes;l.forEach(function(t){var r=S[t.id].idx;s+=E[e][r]||0});var f=s-i.sumTot*a,h=l.filter(function(e){return e.id!==t.id}),p=[];h.forEach(function(t,e){p[e]=b[t.originIndex]});var y=c(h,b)*d,g=k[t.id];if(Object.keys(g).forEach(function(r){var i=S[r].node.clusterId;if(i!==t.clusterId){var s=_[i],l=s.nodes;if(l&&l.length){var h=0;l.forEach(function(t){var r=S[t.id].idx;h+=E[e][r]||0});var p=h-s.sumTot*a,g=l.concat([t]),v=[];g.forEach(function(t,e){v[e]=b[t.originIndex]});var m=c(g,b)*d,A=p-f;u&&(A=p+m-(f+y)),A>o&&(o=A,n=s)}}}),o>0){n.nodes.push(t);var v=t.clusterId;t.clusterId=n.id;var A=i.nodes.indexOf(t);i.nodes.splice(A,1);var x=0,w=0;m.forEach(function(t){var e=t.source,i=t.target,o=S[e].node.clusterId,a=S[i].node.clusterId;(o===n.id&&a!==n.id||a===n.id&&o!==n.id)&&(x+=t[r]||1),(o===v&&a!==v||a===v&&o!==v)&&(w+=t[r]||1)}),n.sumTot=x,i.sumTot=w}})}var j={},R=0;Object.keys(L).forEach(function(t){var e=L[t];if(e.nodes&&e.nodes.length){var r=String(R+1);r!==t&&(e.id=r,e.nodes=e.nodes.map(function(t){return{id:t.id,clusterId:r}}),L[r]=e,j[t]=r,delete L[t],R++)}else delete L[t]}),P.forEach(function(t){var e=t.node,r=t.clusterId;e&&(e.clusterId=r,e.clusterId&&j[e.clusterId]&&(e.clusterId=j[e.clusterId]))});var D=[],B={};m.forEach(function(t){var e=t.source,n=t.target,i=t[r]||1,o=S[e].node.clusterId,a=S[n].node.clusterId;if(o&&a){var s="".concat(o,"---").concat(a);if(B[s])B[s].weight+=i,B[s].count++;else{var u={source:o,target:a,weight:i,count:1};B[s]=u,D.push(u)}}});var F=[];return Object.keys(L).forEach(function(t){F.push(L[t])}),{clusters:F,clusterEdges:D}};e.default=f},9324:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(r(8882)),i=a(r(4073)),o=r(5696);function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t,e){var r=[],n=t.nodes,a=void 0===n?[]:n,s=t.edges,u=void 0===s?[]:s;if(0===a.length)return r;var l=a[0],c=new Set;c.add(l);var f=new i.default(function(t,r){return e?t.weight-r.weight:0});for((0,o.getEdgesByNodeId)(l.id,u).forEach(function(t){f.insert(t)});!f.isEmpty();){var h=f.delMin(),p=h.source,d=h.target;c.has(p)&&c.has(d)||(r.push(h),c.has(p)||(c.add(p),(0,o.getEdgesByNodeId)(p,u).forEach(function(t){f.insert(t)})),c.has(d)||(c.add(d),(0,o.getEdgesByNodeId)(d,u).forEach(function(t){f.insert(t)})))}return r},u=function(t,e){var r=[],i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a;if(0===o.length)return r;var u=s.map(function(t){return t});e&&u.sort(function(t,e){return t.weight-e.weight});for(var l=new n.default(o.map(function(t){return t.id}));u.length>0;){var c=u.shift(),f=c.source,h=c.target;l.connected(f,h)||(r.push(c),l.union(f,h))}return r},l=function(t,e,r){return r?{prim:s,kruskal:u}[r](t,e):u(t,e)};e.default=l},2653:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(5240))&&n.__esModule?n:{default:n},o=r(5696);var a=function(t,e,r){"number"!=typeof e&&(e=1e-6),"number"!=typeof r&&(r=.85);for(var n,a=1,s=0,u=1e3,l=t.nodes,c=void 0===l?[]:l,f=t.edges,h=void 0===f?[]:f,p=c.length,d={},y={},g=0;g0&&a>e;){for(s=0,g=0;g0&&(n+=y[x]/w)}d[m]=r*n,s+=d[m]}}for(s=(1-s)/p,a=0,g=0;g0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var r=this.list[e];this.list[e]=this.list[t],this.list[t]=r,t=e,e=this.getParent(t)}},t.prototype.moveDown=function(t){var e,r=t,n=this.getLeft(t),i=this.getRight(t),o=this.list.length;null!==n&&n0?r=n:null!==i&&i0&&(r=i),t!==r&&(e=[this.list[r],this.list[t]],this.list[t]=e[0],this.list[r]=e[1],this.moveDown(r))},t}();e.default=n},7875:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.LinkedListNode=void 0;var r=function(t,e){return t===e},n=function(){function t(t,e){void 0===e&&(e=null),this.value=t,this.next=e}return t.prototype.toString=function(t){return t?t(this.value):"".concat(this.value)},t}();e.LinkedListNode=n;var i=function(){function t(t){void 0===t&&(t=r),this.head=null,this.tail=null,this.compare=t}return t.prototype.prepend=function(t){var e=new n(t,this.head);return this.head=e,this.tail||(this.tail=e),this},t.prototype.append=function(t){var e=new n(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},t.prototype.delete=function(t){if(!this.head)return null;for(var e=null;this.head&&this.compare(this.head.value,t);)e=this.head,this.head=this.head.next;var r=this.head;if(null!==r)for(;r.next;)this.compare(r.next.value,t)?(e=r.next,r.next=r.next.next):r=r.next;return this.compare(this.tail.value,t)&&(this.tail=r),e},t.prototype.find=function(t){var e=t.value,r=void 0===e?void 0:e,n=t.callback,i=void 0===n?void 0:n;if(!this.head)return null;for(var o=this.head;o;){if(i&&i(o.value))return o;if(void 0!==r&&this.compare(o.value,r))return o;o=o.next}return null},t.prototype.deleteTail=function(){var t=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,t;for(var e=this.head;e.next;)e.next.next?e=e.next:e.next=null;return this.tail=e,t},t.prototype.deleteHead=function(){if(!this.head)return null;var t=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),t},t.prototype.fromArray=function(t){var e=this;return t.forEach(function(t){return e.append(t)}),this},t.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},t.prototype.reverse=function(){for(var t=this.head,e=null,r=null;t;)r=t.next,t.next=e,e=t,t=r;this.tail=this.head,this.head=e},t.prototype.toString=function(t){return void 0===t&&(t=void 0),this.toArray().map(function(e){return e.toString(t)}).toString()},t}();e.default=i},2500:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(7875))&&n.__esModule?n:{default:n};var o=function(){function t(){this.linkedList=new i.default}return t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},t.prototype.enqueue=function(t){this.linkedList.append(t)},t.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toString=function(t){return this.linkedList.toString(t)},t}();e.default=o},8882:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(){function t(t){this.count=t.length,this.parent={};for(var e=0,r=t;e>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?k(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?k(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=g.exec(t))?new T(e[1],e[2],e[3],1):(e=v.exec(t))?new T(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=m.exec(t))?k(e[1],e[2],e[3],e[4]):(e=b.exec(t))?k(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=A.exec(t))?j(e[1],e[2]/100,e[3]/100,1):(e=x.exec(t))?j(e[1],e[2]/100,e[3]/100,e[4]):w.hasOwnProperty(t)?C(w[t]):"transparent"===t?new T(NaN,NaN,NaN,0):null}function C(t){return new T(t>>16&255,t>>8&255,255&t,1)}function k(t,e,r,n){return n<=0&&(t=e=r=NaN),new T(t,e,r,n)}function I(t,e,r,n){return 1===arguments.length?((i=t)instanceof f||(i=E(i)),i?new T((i=i.rgb()).r,i.g,i.b,i.opacity):new T):new T(t,e,r,null==n?1:n);var i}function T(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function O(){return"#".concat(N(this.r)).concat(N(this.g)).concat(N(this.b))}function M(){var t=P(this.opacity);return"".concat(1===t?"rgb(":"rgba(").concat(L(this.r),", ").concat(L(this.g),", ").concat(L(this.b)).concat(1===t?")":", ".concat(t,")"))}function P(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function L(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function N(t){return((t=L(t))<16?"0":"")+t.toString(16)}function j(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new D(t,e,r,n)}function R(t){if(t instanceof D)return new D(t.h,t.s,t.l,t.opacity);if(t instanceof f||(t=E(t)),!t)return new D;if(t instanceof D)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),o=Math.max(e,r,n),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(r-n)/s+6*(r0&&u<1?0:a,new D(a,s,u,t.opacity)}function D(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function B(t){return(t=(t||0)%360)<0?t+360:t}function F(t){return Math.max(0,Math.min(1,t||0))}function z(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function G(t,e,r,n,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*r+(1+3*t+3*o-3*a)*n+a*i)/6}l(f,E,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:_,formatHex:_,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return R(this).formatHsl()},formatRgb:S,toString:S}),l(T,I,c(f,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new T(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new T(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},clamp:function(){return new T(L(this.r),L(this.g),L(this.b),P(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:O,formatHex:O,formatHex8:function(){return"#".concat(N(this.r)).concat(N(this.g)).concat(N(this.b)).concat(N(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:M,toString:M})),l(D,function(t,e,r,n){return 1===arguments.length?R(t):new D(t,e,r,null==n?1:n)},c(f,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new D(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new D(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new T(z(t>=240?t-240:t+120,i,n),z(t,i,n),z(t<120?t+240:t-120,i,n),this.opacity)},clamp:function(){return new D(B(this.h),F(this.s),F(this.l),P(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=P(this.opacity);return"".concat(1===t?"hsl(":"hsla(").concat(B(this.h),", ").concat(100*F(this.s),"%, ").concat(100*F(this.l),"%").concat(1===t?")":", ".concat(t,")"))}}));var U=function(t){return function(){return t}};function H(t,e){return function(r){return t+r*e}}function V(t){return 1==(t=+t)?Q:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):U(isNaN(e)?r:e)}}function Q(t,e){var r=e-t;return r?H(t,r):U(isNaN(t)?e:t)}var Y=function t(e){var r=V(e);function n(t,e){var n=r((t=I(t)).r,(e=I(e)).r),i=r(t.g,e.g),o=r(t.b,e.b),a=Q(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return n.gamma=t,n}(1);function W(t){return function(e){var r,n,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(r=0;r=1?(r=1,e-1):Math.floor(r*e),i=t[n],o=t[n+1],a=n>0?t[n-1]:2*i-o,s=no&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(r=r[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,u.push({i:a,x:J(r,n)})),o=tt.lastIndex;return oh.length?(f=it.parsePathString(o[c]),h=it.parsePathString(i[c]),h=it.fillPathByDiff(h,f),h=it.formatPath(h,f),e.fromAttrs.path=h,e.toAttrs.path=f):e.pathFormatted||(f=it.parsePathString(o[c]),h=it.parsePathString(i[c]),h=it.formatPath(h,f),e.fromAttrs.path=h,e.toAttrs.path=f,e.pathFormatted=!0),n[c]=[];for(var p=0;p0){for(var o=n.animators.length-1;o>=0;o--)if((t=n.animators[o]).destroyed)n.removeAnimator(o);else{if(!t.isAnimatePaused())for(var a=(e=t.get("animations")).length-1;a>=0;a--)r=e[a],ut(t,r,i)&&(e.splice(a,1),!1,r.callback&&r.callback());0===e.length&&n.removeAnimator(o)}n.canvas.get("autoDraw")||n.canvas.draw()}})},t.prototype.addAnimator=function(t){this.animators.push(t)},t.prototype.removeAnimator=function(t){this.animators.splice(t,1)},t.prototype.isAnimating=function(){return!!this.animators.length},t.prototype.stop=function(){this.timer&&this.timer.stop()},t.prototype.stopAllAnimations=function(t){void 0===t&&(t=!0),this.animators.forEach(function(e){e.stopAnimate(t)}),this.animators=[],this.canvas.draw()},t.prototype.getTime=function(){return this.current},t}(),ct=r(7158),ft=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function ht(t,e,r){r.name=e,r.target=t,r.currentTarget=t,r.delegateTarget=t,t.emit(e,r)}function pt(t,e,r){if(r.bubbles){var n=void 0,i=!1;if("mouseenter"===e?(n=r.fromShape,i=!0):"mouseleave"===e&&(i=!0,n=r.toShape),t.isCanvas()&&i)return;if(n&&(0,a.pu)(t,n))return void(r.bubbles=!1);r.name=e,r.currentTarget=t,r.delegateTarget=t,t.emit(e,r)}}var dt=function(){function t(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(t){var r=t.type;e._triggerEvent(r,t)},this._onDocumentMove=function(t){if(e.canvas.get("el")!==t.target&&(e.dragging||e.currentShape)){var r=e._getPointInfo(t);e.dragging&&e._emitEvent("drag",t,r,e.draggingShape)}},this._onDocumentMouseUp=function(t){if(e.canvas.get("el")!==t.target&&e.dragging){var r=e._getPointInfo(t);e.draggingShape&&e._emitEvent("drop",t,r,null),e._emitEvent("dragend",t,r,e.draggingShape),e._afterDrag(e.draggingShape,r,t)}},this.canvas=t.canvas}return t.prototype.init=function(){this._bindEvents()},t.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");(0,a.__)(ft,function(r){e.addEventListener(r,t._eventCallback)}),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");(0,a.__)(ft,function(r){e.removeEventListener(r,t._eventCallback)}),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._getEventObj=function(t,e,r,n,i,o){var a=new ct.A(t,e);return a.fromShape=i,a.toShape=o,a.x=r.x,a.y=r.y,a.clientX=r.clientX,a.clientY=r.clientY,a.propagationPath.push(n),a},t.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},t.prototype._getPointInfo=function(t){var e=this.canvas,r=e.getClientByEvent(t),n=e.getPointByEvent(t);return{x:n.x,y:n.y,clientX:r.x,clientY:r.y}},t.prototype._triggerEvent=function(t,e){var r=this._getPointInfo(e),n=this._getShape(r,e),i=this["_on"+t],o=!1;if(i)i.call(this,r,n,e);else{var a=this.currentShape;"mouseenter"===t||"dragenter"===t||"mouseover"===t?(this._emitEvent(t,e,r,null,null,n),n&&this._emitEvent(t,e,r,n,null,n),"mouseenter"===t&&this.draggingShape&&this._emitEvent("dragenter",e,r,null)):"mouseleave"===t||"dragleave"===t||"mouseout"===t?(o=!0,a&&this._emitEvent(t,e,r,a,a,null),this._emitEvent(t,e,r,null,a,null),"mouseleave"===t&&this.draggingShape&&this._emitEvent("dragleave",e,r,null)):this._emitEvent(t,e,r,n,null,null)}if(o||(this.currentShape=n),n&&!n.get("destroyed")){var s=this.canvas;s.get("el").style.cursor=n.attr("cursor")||s.get("cursor")}},t.prototype._onmousedown=function(t,e,r){0===r.button&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=r.timeStamp),this._emitEvent("mousedown",r,t,e,null,null)},t.prototype._emitMouseoverEvents=function(t,e,r,n){var i=this.canvas.get("el");r!==n&&(r&&(this._emitEvent("mouseout",t,e,r,r,n),this._emitEvent("mouseleave",t,e,r,r,n),n&&!n.get("destroyed")||(i.style.cursor=this.canvas.get("cursor"))),n&&(this._emitEvent("mouseover",t,e,n,r,n),this._emitEvent("mouseenter",t,e,n,r,n)))},t.prototype._emitDragoverEvents=function(t,e,r,n,i){n?(n!==r&&(r&&this._emitEvent("dragleave",t,e,r,r,n),this._emitEvent("dragenter",t,e,n,r,n)),i||this._emitEvent("dragover",t,e,n)):r&&this._emitEvent("dragleave",t,e,r,r,n),i&&this._emitEvent("dragover",t,e,n)},t.prototype._afterDrag=function(t,e,r){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var n=this._getShape(e,r);n!==t&&this._emitMouseoverEvents(r,e,t,n),this.currentShape=n},t.prototype._onmouseup=function(t,e,r){if(0===r.button){var n=this.draggingShape;this.dragging?(n&&this._emitEvent("drop",r,t,e),this._emitEvent("dragend",r,t,n),this._afterDrag(n,t,r)):(this._emitEvent("mouseup",r,t,e),e===this.mousedownShape&&this._emitEvent("click",r,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},t.prototype._ondragover=function(t,e,r){r.preventDefault();var n=this.currentShape;this._emitDragoverEvents(r,t,n,e,!0)},t.prototype._onmousemove=function(t,e,r){var n=this.canvas,i=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(r,t,i,e,!1),this._emitEvent("drag",r,t,o);else{var a=this.mousedownPoint;if(a){var s=this.mousedownShape,u=r.timeStamp-this.mousedownTimeStamp,l=a.clientX-t.clientX,c=a.clientY-t.clientY;u>120||l*l+c*c>40?s&&s.get("draggable")?((o=this.mousedownShape).set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",r,t,o),this.mousedownShape=null,this.mousedownPoint=null):!s&&n.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",r,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(r,t,i,e),this._emitEvent("mousemove",r,t,e)):(this._emitMouseoverEvents(r,t,i,e),this._emitEvent("mousemove",r,t,e))}else this._emitMouseoverEvents(r,t,i,e),this._emitEvent("mousemove",r,t,e)}},t.prototype._emitEvent=function(t,e,r,n,i,o){var a=this._getEventObj(t,e,r,n,i,o);if(n){a.shape=n,ht(n,t,a);for(var s=n.getParent();s;)s.emitDelegation(t,a),a.propagationStopped||pt(s,t,a),a.propagationPath.push(s),s=s.getParent()}else{ht(this.canvas,t,a)}},t.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},t}(),yt=(0,i.o0)(),gt=yt&&"firefox"===yt.name,vt=function(t){function e(e){var r=t.call(this,e)||this;return r.initContainer(),r.initDom(),r.initEvents(),r.initTimeline(),r}return(0,n.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},e.prototype.initContainer=function(){var t=this.get("container");(0,a.Kg)(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t),this.get("container").appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new dt({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new lt(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,e){var r=this.get("el");a.Bd&&(r.style.width=t+"px",r.style.height=e+"px")},e.prototype.changeSize=function(t,e){this.setDOMSize(t,e),this.set("width",t),this.set("height",e),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var e=this.get("el");a.Bd&&e&&(e.style.cursor=t)},e.prototype.getPointByEvent=function(t){if(this.get("supportCSSTransform")){if(gt&&!(0,a.gD)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!(0,a.gD)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var e=this.getClientByEvent(t),r=e.x,n=e.y;return this.getPointByClient(r,n)},e.prototype.getClientByEvent=function(t){var e=t;return t.touches&&(e="touchend"===t.type?t.changedTouches[0]:t.touches[0]),{x:e.clientX,y:e.clientY}},e.prototype.getPointByClient=function(t,e){var r=this.get("el").getBoundingClientRect();return{x:t-r.left,y:e-r.top}},e.prototype.getClientByPoint=function(t,e){var r=this.get("el").getBoundingClientRect();return{x:t+r.left,y:e+r.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){this.get("eventController").destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),t.prototype.destroy.call(this))},e}(o.A)},3428:function(t,e,r){"use strict";var n=r(1635),i=r(8679),o=r(4389),a={},s="_INDEX";var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,n.__extends)(e,t),e.prototype.isCanvas=function(){return!1},e.prototype.getBBox=function(){var t=1/0,e=-1/0,r=1/0,n=-1/0,i=this.getChildren().filter(function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)});return i.length>0?(0,o.__)(i,function(i){var o=i.getBBox(),a=o.minX,s=o.maxX,u=o.minY,l=o.maxY;ae&&(e=s),un&&(n=l)}):(t=0,e=0,r=0,n=0),{x:t,y:r,minX:t,minY:r,maxX:e,maxY:n,width:e-t,height:n-r}},e.prototype.getCanvasBBox=function(){var t=1/0,e=-1/0,r=1/0,n=-1/0,i=this.getChildren().filter(function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)});return i.length>0?(0,o.__)(i,function(i){var o=i.getCanvasBBox(),a=o.minX,s=o.maxX,u=o.minY,l=o.maxY;ae&&(e=s),un&&(n=l)}):(t=0,e=0,r=0,n=0),{x:t,y:r,minX:t,minY:r,maxX:e,maxY:n,width:e-t,height:n-r}},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.children=[],e},e.prototype.onAttrChange=function(e,r,n){if(t.prototype.onAttrChange.call(this,e,r,n),"matrix"===e){var i=this.getTotalMatrix();this._applyChildrenMarix(i)}},e.prototype.applyMatrix=function(e){var r=this.getTotalMatrix();t.prototype.applyMatrix.call(this,e);var n=this.getTotalMatrix();n!==r&&this._applyChildrenMarix(n)},e.prototype._applyChildrenMarix=function(t){var e=this.getChildren();(0,o.__)(e,function(e){e.applyMatrix(t)})},e.prototype.addShape=function(){for(var t=[],e=0;e=0;a--){var s=t[a];if((0,o.OK)(s)&&(s.isGroup()?i=s.getShape(e,r,n):s.isHit(e,r)&&(i=s)),i)break}return i},e.prototype.add=function(t){var e=this.getCanvas(),r=this.getChildren(),n=this.get("timeline"),i=t.getParent();i&&function(t,e,r){void 0===r&&(r=!0),r?e.destroy():(e.set("parent",null),e.set("canvas",null)),(0,o.E6)(t.getChildren(),e)}(i,t,!1),t.set("parent",this),e&&function t(e,r){if(e.set("canvas",r),e.isGroup()){var n=e.get("children");n.length&&n.forEach(function(e){t(e,r)})}}(t,e),n&&function t(e,r){if(e.set("timeline",r),e.isGroup()){var n=e.get("children");n.length&&n.forEach(function(e){t(e,r)})}}(t,n),r.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var e=this.getTotalMatrix();e&&t.applyMatrix(e)},e.prototype.getChildren=function(){return this.get("children")||[]},e.prototype.sort=function(){var t,e=this.getChildren();(0,o.__)(e,function(t,e){return t[s]=e,t}),e.sort((t=function(t,e){return t.get("zIndex")-e.get("zIndex")},function(e,r){var n=t(e,r);return 0===n?e[s]-r[s]:n})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),e=t.length-1;e>=0;e--)t[e].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),t.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){return this.getChildren()[t]},e.prototype.getCount=function(){return this.getChildren().length},e.prototype.contain=function(t){return this.getChildren().indexOf(t)>-1},e.prototype.removeChild=function(t,e){void 0===e&&(e=!0),this.contain(t)&&t.remove(e)},e.prototype.findAll=function(t){var e=[],r=this.getChildren();return(0,o.__)(r,function(r){t(r)&&e.push(r),r.isGroup()&&(e=e.concat(r.findAll(t)))}),e},e.prototype.find=function(t){var e=null,r=this.getChildren();return(0,o.__)(r,function(r){if(t(r)?e=r:r.isGroup()&&(e=r.find(t)),e)return!1}),e},e.prototype.findById=function(t){return this.find(function(e){return e.get("id")===t})},e.prototype.findByClassName=function(t){return this.find(function(e){return e.get("className")===t})},e.prototype.findAllByName=function(t){return this.findAll(function(e){return e.get("name")===t})},e}(i.A);e.A=u},8679:function(t,e,r){"use strict";var n=r(1635),i=r(1359),o=r(5776),a=r(4389),s=r(1344),u=r(686),l=o.pd,c=["zIndex","capture","visible","type"],f=["repeat"];var h=function(t){function e(e){var r=t.call(this,e)||this;r.attrs={};var n=r.getDefaultAttrs();return(0,i.mix)(n,e.attrs),r.attrs=n,r.initAttrs(n),r.initAnimate(),r}return(0,n.__extends)(e,t),e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,e=[],r=0;r0?n=function(t,e){if(e.onFrame)return t;var r=e.startTime,n=e.delay,o=e.duration,a=Object.prototype.hasOwnProperty;return(0,i.each)(t,function(t){r+nt.delay&&(0,i.each)(e.toAttrs,function(e,r){a.call(t.toAttrs,r)&&(delete t.toAttrs[r],delete t.fromAttrs[r])})}),t}(n,A):r.addAnimator(this),n.push(A),this.set("animations",n),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var e=this;void 0===t&&(t=!0);var r=this.get("animations");(0,i.each)(r,function(r){t&&(r.onFrame?e.attr(r.onFrame(1)):e.attr(r.toAttrs)),r.callback&&r.callback()}),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),e=this.get("animations"),r=t.getTime();return(0,i.each)(e,function(t){t._paused=!0,t._pauseTime=r,t.pauseCallback&&t.pauseCallback()}),this.set("_pause",{isPaused:!0,pauseTime:r}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline").getTime(),e=this.get("animations"),r=this.get("_pause").pauseTime;return(0,i.each)(e,function(e){e.startTime=e.startTime+(t-r),e._paused=!1,e._pauseTime=null,e.resumeCallback&&e.resumeCallback()}),this.set("_pause",{isPaused:!1}),this.set("animations",e),this},e.prototype.emitDelegation=function(t,e){var r,n=this,o=e.propagationPath;this.getEvents();"mouseenter"===t?r=e.fromShape:"mouseleave"===t&&(r=e.toShape);for(var s=function(t){var s=o[t],l=s.get("name");if(l){if((s.isGroup()||s.isCanvas&&s.isCanvas())&&r&&(0,a.pu)(s,r))return"break";(0,i.isArray)(l)?(0,i.each)(l,function(t){n.emitDelegateEvent(s,t,e)}):u.emitDelegateEvent(s,l,e)}},u=this,l=0;l=t&&r.minY<=e&&r.maxY>=e},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(e){t.prototype.applyMatrix.call(this,e),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),e=this.getTotalMatrix(),r=t.minX,n=t.minY,i=t.maxX,a=t.maxY;if(e){var s=(0,o.$F)(e,[t.minX,t.minY]),u=(0,o.$F)(e,[t.maxX,t.minY]),l=(0,o.$F)(e,[t.minX,t.maxY]),c=(0,o.$F)(e,[t.maxX,t.maxY]);r=Math.min(s[0],u[0],l[0],c[0]),i=Math.max(s[0],u[0],l[0],c[0]),n=Math.min(s[1],u[1],l[1],c[1]),a=Math.max(s[1],u[1],l[1],c[1])}var f=this.attrs;if(f.shadowColor){var h=f.shadowBlur,p=void 0===h?0:h,d=f.shadowOffsetX,y=void 0===d?0:d,g=f.shadowOffsetY,v=void 0===g?0:g,m=r-p+y,b=i+p+y,A=n-p+v,x=a+p+v;r=Math.min(r,m),i=Math.max(i,b),n=Math.min(n,A),a=Math.max(a,x)}return{x:r,y:n,minX:r,minY:n,maxX:i,maxY:a,width:i-r,height:a-n}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,e){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,e){var r=this.get("startArrowShape"),n=this.get("endArrowShape"),i=[t,e,1],o=(i=this.invertFromMatrix(i))[0],a=i[1],s=this._isInBBox(o,a);if(this.isOnlyHitBox())return s;if(s&&!this.isClipped(o,a)){if(this.isInShape(o,a))return!0;if(r&&r.isHit(o,a))return!0;if(n&&n.isHit(o,a))return!0}return!1},e}(i.A);e.A=a},2867:function(t,e,r){"use strict";r.d(e,{i:function(){return W},f:function(){return q}});var n={};function i(t){return+t}function o(t){return t*t}function a(t){return t*(2-t)}function s(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function u(t){return t*t*t}function l(t){return--t*t*t+1}function c(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}r.r(n),r.d(n,{easeBack:function(){return G},easeBackIn:function(){return F},easeBackInOut:function(){return G},easeBackOut:function(){return z},easeBounce:function(){return D},easeBounceIn:function(){return R},easeBounceInOut:function(){return B},easeBounceOut:function(){return D},easeCircle:function(){return E},easeCircleIn:function(){return _},easeCircleInOut:function(){return E},easeCircleOut:function(){return S},easeCubic:function(){return c},easeCubicIn:function(){return u},easeCubicInOut:function(){return c},easeCubicOut:function(){return l},easeElastic:function(){return V},easeElasticIn:function(){return H},easeElasticInOut:function(){return Q},easeElasticOut:function(){return V},easeExp:function(){return w},easeExpIn:function(){return A},easeExpInOut:function(){return w},easeExpOut:function(){return x},easeLinear:function(){return i},easePoly:function(){return p},easePolyIn:function(){return f},easePolyInOut:function(){return p},easePolyOut:function(){return h},easeQuad:function(){return s},easeQuadIn:function(){return o},easeQuadInOut:function(){return s},easeQuadOut:function(){return a},easeSin:function(){return m},easeSinIn:function(){return g},easeSinInOut:function(){return m},easeSinOut:function(){return v}});var f=function t(e){function r(t){return Math.pow(t,e)}return e=+e,r.exponent=t,r}(3),h=function t(e){function r(t){return 1-Math.pow(1-t,e)}return e=+e,r.exponent=t,r}(3),p=function t(e){function r(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,r.exponent=t,r}(3),d=Math.PI,y=d/2;function g(t){return 1==+t?1:1-Math.cos(t*y)}function v(t){return Math.sin(t*y)}function m(t){return(1-Math.cos(d*t))/2}function b(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function A(t){return b(1-+t)}function x(t){return 1-b(t)}function w(t){return((t*=2)<=1?b(1-t):2-b(t-1))/2}function _(t){return 1-Math.sqrt(1-t*t)}function S(t){return Math.sqrt(1- --t*t)}function E(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var C=4/11,k=6/11,I=8/11,T=.75,O=9/11,M=10/11,P=.9375,L=21/22,N=63/64,j=1/C/C;function R(t){return 1-D(1-t)}function D(t){return(t=+t)Math.PI/2?Math.PI-l:l,c=c>Math.PI/2?Math.PI-c:c,{xExtra:Math.cos(u/2-l)*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(c-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}i("rect",a),i("image",a),i("circle",s),i("marker",s),i("polyline",function(t){for(var e=t.attr().points,r=[],n=[],i=0;i2&&(r.push([i].concat(s.splice(0,2))),u="l",i="m"===i?"l":"L"),"o"===u&&1===s.length&&r.push([i,s[0]]),"r"===u)r.push([i].concat(s));else for(;s.length>=e[u]&&(r.push([i].concat(s.splice(0,e[u]))),e[u]););return t}),r},u=function(t,e){for(var r=[],n=0,i=t.length;i-2*!e>n;n+=2){var o=[{x:+t[n-2],y:+t[n-1]},{x:+t[n],y:+t[n+1]},{x:+t[n+2],y:+t[n+3]},{x:+t[n+4],y:+t[n+5]}];e?n?i-4===n?o[3]={x:+t[0],y:+t[1]}:i-2===n&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[i-2],y:+t[i-1]}:i-4===n?o[3]=o[2]:n||(o[0]={x:+t[n],y:+t[n+1]}),r.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return r},l=function(t,e,r,n,i){var o=[];if(null===i&&null===n&&(n=r),t=+t,e=+e,r=+r,n=+n,null!==i){var a=Math.PI/180,s=t+r*Math.cos(-n*a),u=t+r*Math.cos(-i*a);o=[["M",s,e+r*Math.sin(-n*a)],["A",r,r,0,+(i-n>180),0,u,e+r*Math.sin(-i*a)]]}else o=[["M",t,e],["m",0,-n],["a",r,n,0,1,1,0,2*n],["a",r,n,0,1,1,0,-2*n],["z"]];return o},c=function(t){if(!(t=s(t))||!t.length)return[["M",0,0]];var e,r,n=[],i=0,o=0,a=0,c=0,f=0;"M"===t[0][0]&&(a=i=+t[0][1],c=o=+t[0][2],f++,n[0]=["M",i,o]);for(var h=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),p=void 0,d=void 0,y=f,g=t.length;y1&&(n*=w=Math.sqrt(w),i*=w);var _=n*n,S=i*i,E=(a===s?-1:1)*Math.sqrt(Math.abs((_*S-_*x*x-S*A*A)/(_*x*x+S*A*A)));d=E*n*x/i+(e+u)/2,y=E*-i*A/n+(r+l)/2,h=Math.asin(((r-y)/i).toFixed(9)),p=Math.asin(((l-y)/i).toFixed(9)),h=ep&&(h-=2*Math.PI),!s&&p>h&&(p-=2*Math.PI)}var C=p-h;if(Math.abs(C)>g){var k=p,I=u,T=l;p=h+g*(s&&p>h?1:-1),m=t(u=d+n*Math.cos(p),l=y+i*Math.sin(p),n,i,o,0,s,I,T,[p,k,d,y])}C=p-h;var O=Math.cos(h),M=Math.sin(h),P=Math.cos(p),L=Math.sin(p),N=Math.tan(C/4),j=4/3*n*N,R=4/3*i*N,D=[e,r],B=[e+j*M,r-R*O],F=[u+j*L,l-R*P],z=[u,l];if(B[0]=2*D[0]-B[0],B[1]=2*D[1]-B[1],c)return[B,F,z].concat(m);for(var G=[],U=0,H=(m=[B,F,z].concat(m).join().split(",")).length;U7){t[e].shift();for(var o=t[e];o.length;)s[e]="A",i&&(u[e]="A"),t.splice(e++,0,["C"].concat(o.splice(0,6)));t.splice(e,1),r=Math.max(n.length,i&&i.length||0)}},g=function(t,e,o,a,s){t&&e&&"M"===t[s][0]&&"M"!==e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),o.bx=0,o.by=0,o.x=t[s][1],o.y=t[s][2],r=Math.max(n.length,i&&i.length||0))};r=Math.max(n.length,i&&i.length||0);for(var v=0;v1?1:u<0?0:u)/2,c=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,p=0;p<12;p++){var d=l*c[p]+l,y=g(d,t,r,i,a),v=g(d,e,n,o,s),m=y*y+v*v;h+=f[p]*Math.sqrt(m)}return l*h},m=function(t,e,r,n,i,o,a,s){if(!(Math.max(t,r)Math.max(i,a)||Math.max(e,n)Math.max(o,s))){var u=(t-r)*(o-s)-(e-n)*(i-a);if(u){var l=((t*n-e*r)*(i-a)-(t-r)*(i*s-o*a))/u,c=((t*n-e*r)*(o-s)-(e-n)*(i*s-o*a))/u,f=+l.toFixed(2),h=+c.toFixed(2);if(!(f<+Math.min(t,r).toFixed(2)||f>+Math.max(t,r).toFixed(2)||f<+Math.min(i,a).toFixed(2)||f>+Math.max(i,a).toFixed(2)||h<+Math.min(e,n).toFixed(2)||h>+Math.max(e,n).toFixed(2)||h<+Math.min(o,s).toFixed(2)||h>+Math.max(o,s).toFixed(2)))return{x:l,y:c}}}},b=function(t,e,r){return e>=t.x&&e<=t.x+t.width&&r>=t.y&&r<=t.y+t.height},A=function(t,e,r,n,i){if(i)return[["M",+t+ +i,e],["l",r-2*i,0],["a",i,i,0,0,1,i,i],["l",0,n-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-r,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-n],["a",i,i,0,0,1,i,-i],["z"]];var o=[["M",t,e],["l",r,0],["l",0,n],["l",-r,0],["z"]];return o.parsePathArray=y,o},x=function(t,e,r,n){return null===t&&(t=e=r=n=0),null===e&&(e=t.y,r=t.width,n=t.height,t=t.x),{x:t,y:e,width:r,w:r,height:n,h:n,x2:t+r,y2:e+n,cx:t+r/2,cy:e+n/2,r1:Math.min(r,n)/2,r2:Math.max(r,n)/2,r0:Math.sqrt(r*r+n*n)/2,path:A(t,e,r,n),vb:[t,e,r,n].join(" ")}},w=function(t,e,r,i,o,a,s,u){(0,n.isArray)(t)||(t=[t,e,r,i,o,a,s,u]);var l=function(t,e,r,n,i,o,a,s){for(var u,l,c,f,h=[],p=[[],[]],d=0;d<2;++d)if(0===d?(l=6*t-12*r+6*i,u=-3*t+9*r-9*i+3*a,c=3*r-3*t):(l=6*e-12*n+6*o,u=-3*e+9*n-9*o+3*s,c=3*n-3*e),Math.abs(u)<1e-12){if(Math.abs(l)<1e-12)continue;(f=-c/l)>0&&f<1&&h.push(f)}else{var y=l*l-4*c*u,g=Math.sqrt(y);if(!(y<0)){var v=(-l+g)/(2*u);v>0&&v<1&&h.push(v);var m=(-l-g)/(2*u);m>0&&m<1&&h.push(m)}}for(var b,A=h.length,x=A;A--;)b=1-(f=h[A]),p[0][A]=b*b*b*t+3*b*b*f*r+3*b*f*f*i+f*f*f*a,p[1][A]=b*b*b*e+3*b*b*f*n+3*b*f*f*o+f*f*f*s;return p[0][x]=t,p[1][x]=e,p[0][x+1]=a,p[1][x+1]=s,p[0].length=p[1].length=x+2,{min:{x:Math.min.apply(0,p[0]),y:Math.min.apply(0,p[1])},max:{x:Math.max.apply(0,p[0]),y:Math.max.apply(0,p[1])}}}.apply(null,t);return x(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)},_=function(t,e,r,n,i,o,a,s,u){var l=1-u,c=Math.pow(l,3),f=Math.pow(l,2),h=u*u,p=h*u,d=t+2*u*(r-t)+h*(i-2*r+t),y=e+2*u*(n-e)+h*(o-2*n+e),g=r+2*u*(i-r)+h*(a-2*i+r),v=n+2*u*(o-n)+h*(s-2*o+n);return{x:c*t+3*f*u*r+3*l*u*u*i+p*a,y:c*e+3*f*u*n+3*l*u*u*o+p*s,m:{x:d,y:y},n:{x:g,y:v},start:{x:l*t+u*r,y:l*e+u*n},end:{x:l*i+u*a,y:l*o+u*s},alpha:90-180*Math.atan2(d-g,y-v)/Math.PI}},S=function(t,e,r){if(!function(t,e){return t=x(t),e=x(e),b(e,t.x,t.y)||b(e,t.x2,t.y)||b(e,t.x,t.y2)||b(e,t.x2,t.y2)||b(t,e.x,e.y)||b(t,e.x2,e.y)||b(t,e.x,e.y2)||b(t,e.x2,e.y2)||(t.xe.x||e.xt.x)&&(t.ye.y||e.yt.y)}(w(t),w(e)))return r?0:[];for(var n=~~(v.apply(0,t)/8),i=~~(v.apply(0,e)/8),o=[],a=[],s={},u=r?0:[],l=0;l=0&&E<=1&&C>=0&&C<=1&&(r?u+=1:u.push({x:S.x,y:S.y,t1:E,t2:C}))}}return u},E=function(t,e){return function(t,e,r){var n,i,o,a,s,u,l,c,f,h;t=p(t),e=p(e);for(var d=r?0:[],y=0,g=t.length;y=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e=e.concat(t[t.length-1])})}(t,e,r));else{var i=[].concat(t);"M"===i[0]&&(i[0]="L");for(var o=0;o<=r-1;o++)n.push(i)}return n},I=function(t,e){if(1===t.length)return t;var r=t.length-1,n=e.length-1,i=r/n,o=[];if(1===t.length&&"M"===t[0][0]){for(var a=0;a=0;u--)a=o[u].index,"add"===o[u].type?t.splice(a,0,[].concat(t[a])):t.splice(a,1)}var f=i-(n=t.length);if(n0)){t[n]=e[n];break}r=P(r,t[n-1],1)}t[n]=["Q"].concat(r.reduce(function(t,e){return t.concat(e)},[]));break;case"T":t[n]=["T"].concat(r[0]);break;case"C":if(r.length<3){if(!(n>0)){t[n]=e[n];break}r=P(r,t[n-1],2)}t[n]=["C"].concat(r.reduce(function(t,e){return t.concat(e)},[]));break;case"S":if(r.length<2){if(!(n>0)){t[n]=e[n];break}r=P(r,t[n-1],1)}t[n]=["S"].concat(r.reduce(function(t,e){return t.concat(e)},[]));break;default:t[n]=e[n]}return t}},8358:function(t,e,r){"use strict";r.d(e,{ei:function(){return s},lb:function(){return o},q_:function(){return a}});var n=r(4389),i=r(8204);function o(t,e,r){var i=1;return(0,n.Kg)(t)&&(i=t.split("\n").length),i>1?e*i+function(t,e){return e?e-t:.14*t}(e,r)*(i-1):e}function a(t,e){var r=(0,i.X)(),o=0;if((0,n.gD)(t)||""===t)return o;if(r.save(),r.font=e,(0,n.Kg)(t)&&t.includes("\n")){var a=t.split("\n");(0,n.__)(a,function(t){var e=r.measureText(t).width;o(r-t)*(r-t)+(n-e)*(n-e)?o(r,n,i,a):this.pointToLine(t,e,r,n,i,a)},pointToLine:function(t,e,r,n,i,o){var a=[r-t,n-e];if(c.exactEquals(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];c.normalize(s,s);var u=[i-t,o-e];return Math.abs(c.dot(u,s))},tangentAngle:function(t,e,r,n){return Math.atan2(n-e,r-t)}},h=1e-4;function p(t,e,r,n,i,a){var s,u=1/0,l=[r,n],c=20;a&&a>200&&(c=a/10);for(var f=1/c,p=f/10,d=0;d<=c;d++){var y=d*f,g=[i.apply(null,t.concat([y])),i.apply(null,e.concat([y]))];(A=o(l[0],l[1],g[0],g[1]))=0&&A=0?[i]:[]}function g(t,e,r,n){return 2*(1-n)*(e-t)+2*n*(r-e)}function v(t,e,r,n,i,o,a){var s=d(t,r,i,a),u=d(e,n,o,a),l=f.pointAt(t,e,r,n,a),c=f.pointAt(r,n,i,o,a);return[[t,e,l.x,l.y,s,u],[s,u,c.x,c.y,i,o]]}var m={box:function(t,e,r,n,i,o){var a=y(t,r,i)[0],u=y(e,n,o)[0],l=[t,i],c=[e,o];return void 0!==a&&l.push(d(t,r,i,a)),void 0!==u&&c.push(d(e,n,o,u)),s(l,c)},length:function(t,e,r,n,i,a){return function t(e,r,n,i,a,s,u){if(0===u)return(o(e,r,n,i)+o(n,i,a,s)+o(e,r,a,s))/2;var l=v(e,r,n,i,a,s,.5),c=l[0],f=l[1];return c.push(u-1),f.push(u-1),t.apply(null,c)+t.apply(null,f)}(t,e,r,n,i,a,3)},nearestPoint:function(t,e,r,n,i,o,a,s){return p([t,r,i],[e,n,o],a,s,d)},pointDistance:function(t,e,r,n,i,a,s,u){var l=this.nearestPoint(t,e,r,n,i,a,s,u);return o(l.x,l.y,s,u)},interpolationAt:d,pointAt:function(t,e,r,n,i,o,a){return{x:d(t,r,i,a),y:d(e,n,o,a)}},divide:function(t,e,r,n,i,o,a){return v(t,e,r,n,i,o,a)},tangentAngle:function(t,e,r,n,i,o,a){var s=g(t,r,i,a),u=g(e,n,o,a);return l(Math.atan2(u,s))}};function b(t,e,r,n,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*r*i*i*o+n*i*i*i}function A(t,e,r,n,i){var o=1-i;return 3*(o*o*(e-t)+2*o*i*(r-e)+i*i*(n-r))}function x(t,e,r,n){var i,o,s,u=-3*t+9*e-9*r+3*n,l=6*t-12*e+6*r,c=3*e-3*t,f=[];if(a(u,0))a(l,0)||(i=-c/l)>=0&&i<=1&&f.push(i);else{var h=l*l-4*u*c;a(h,0)?f.push(-l/(2*u)):h>0&&(o=(-l-(s=Math.sqrt(h)))/(2*u),(i=(-l+s)/(2*u))>=0&&i<=1&&f.push(i),o>=0&&o<=1&&f.push(o))}return f}function w(t,e,r,n,i,o,a,s,u){var l=b(t,r,i,a,u),c=b(e,n,o,s,u),h=f.pointAt(t,e,r,n,u),p=f.pointAt(r,n,i,o,u),d=f.pointAt(i,o,a,s,u),y=f.pointAt(h.x,h.y,p.x,p.y,u),g=f.pointAt(p.x,p.y,d.x,d.y,u);return[[t,e,h.x,h.y,y.x,y.y,l,c],[l,c,g.x,g.y,d.x,d.y,a,s]]}function _(t,e,r,n,i,a,s,u,l){if(0===l)return function(t,e){for(var r=0,n=t.length,i=0;i0?r:-1*r}var C=function(t,e,r,n,i,o){var a=r,s=n;if(0===a||0===s)return{x:t,y:e};for(var u,l,c=i-t,f=o-e,h=Math.abs(c),p=Math.abs(f),d=a*a,y=s*s,g=Math.PI/4,v=0;v<4;v++){u=a*Math.cos(g),l=s*Math.sin(g);var m=(d-y)*Math.pow(Math.cos(g),3)/a,b=(y-d)*Math.pow(Math.sin(g),3)/s,A=u-m,x=l-b,w=h-m,_=p-b,S=Math.hypot(x,A),C=Math.hypot(_,w);g+=S*Math.asin((A*_-x*w)/(S*C))/Math.sqrt(d+y-u*u-l*l),g=Math.min(Math.PI/2,Math.max(0,g))}return{x:t+E(u,c),y:e+E(l,f)}};function k(t,e,r,n,i,o){return r*Math.cos(i)*Math.cos(o)-n*Math.sin(i)*Math.sin(o)+t}function I(t,e,r,n,i,o){return r*Math.sin(i)*Math.cos(o)+n*Math.cos(i)*Math.sin(o)+e}function T(t,e,r){return{x:t*Math.cos(r),y:e*Math.sin(r)}}function O(t,e,r){var n=Math.cos(r),i=Math.sin(r);return[t*n-e*i,t*i+e*n]}var M={box:function(t,e,r,n,i,o,a){for(var s=function(t,e,r){return Math.atan(-e/t*Math.tan(r))}(r,n,i),u=1/0,l=-1/0,c=[o,a],f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var h=s+f;ol&&(l=p)}var d=function(t,e,r){return Math.atan(e/(t*Math.tan(r)))}(r,n,i),y=1/0,g=-1/0,v=[o,a];for(f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var m=d+f;og&&(g=b)}return{x:u,y:y,width:l-u,height:g-y}},length:function(t,e,r,n,i,o,a){},nearestPoint:function(t,e,r,n,i,o,a,s,u){var l=O(s-t,u-e,-i),c=l[0],f=l[1],h=C(0,0,r,n,c,f),p=function(t,e,r,n){return(Math.atan2(n*t,r*e)+2*Math.PI)%(2*Math.PI)}(r,n,h.x,h.y);pa&&(h=T(r,n,a));var d=O(h.x,h.y,i);return{x:d[0]+t,y:d[1]+e}},pointDistance:function(t,e,r,n,i,a,s,u,l){var c=this.nearestPoint(t,e,r,n,u,l);return o(c.x,c.y,u,l)},pointAt:function(t,e,r,n,i,o,a,s){var u=(a-o)*s+o;return{x:k(t,0,r,n,i,u),y:I(0,e,r,n,i,u)}},tangentAngle:function(t,e,r,n,i,o,a,s){var u=(a-o)*s+o,c=function(t,e,r,n,i,o,a,s){return-1*r*Math.cos(i)*Math.sin(s)-n*Math.sin(i)*Math.cos(s)}(0,0,r,n,i,0,0,u),f=function(t,e,r,n,i,o,a,s){return-1*r*Math.sin(i)*Math.sin(s)+n*Math.cos(i)*Math.cos(s)}(0,0,r,n,i,0,0,u);return l(Math.atan2(f,c))}};function P(t){for(var e=0,r=[],n=0;n1||e<0||t.length<2)return null;var r=P(t),n=r.segments,i=r.totalLength;if(0===i)return{x:t[0][0],y:t[0][1]};for(var o=0,a=null,s=0;s=o&&e<=o+h){var p=(e-o)/h;a=f.pointAt(l[0],l[1],c[0],c[1],p);break}o+=h}return a}function j(t,e){if(e>1||e<0||t.length<2)return 0;for(var r=P(t),n=r.segments,i=r.totalLength,o=0,a=0,s=0;s=o&&e<=o+f){a=Math.atan2(c[1]-l[1],c[0]-l[0]);break}o+=f}return a}function R(t,e,r){for(var n=1/0,i=0;i0&&void 0!==i[0]?i[0]:1,!this.dirty){t.next=6;break}return this.compiledBundle.context&&(e>1?this.compiledBundle.context.maxIteration=e:this.compiledBundle.context.maxIteration++),t.next=5,this.compile();case 5:this.dirty=!1;case 6:for(this.engine.beginFrame(),this.engine.clear({}),this.compiledBundle.context&&this.compiledBundle.context.uniforms.filter(function(t){return t.isReferer}).forEach(function(t){var e=t.data,r=t.name;n.model.confirmInput(e.model,r)}),r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r16)throw new Error("invalid data type ".concat(r));i[e]=function(){return t.data}}});var o=this.getOuputDataTexture(),a=o.textureWidth,s=o.texelCount;i.u_OutputTextureSize=[a,a],i.u_OutputTexelCount=s,this.context.output.textureSize=[a,a];var l={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(this.context.shader),uniforms:i,vert:ht,primitive:"triangle strip",count:4};this.computeCommand=this.reGl(l)}return c(t,[{key:"run",value:function(){var t=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use(function(){t.computeCommand()}),dt&&console.log("[".concat(this.entity,"]: output ").concat(this.getOuputDataTexture().id))}},{key:"readData",value:function(){var t=i(m().mark(function t(){var e,r,n,i,o,a,s,u,l=this;return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.reGl({framebuffer:this.texFBO})(function(){e=l.reGl.read()}),!e){t.next=6;break}if(r=this.getOuputDataTexture(),n=r.originalDataLength,i=r.elementsPerTexel,o=r.typedArrayConstructor,a=void 0===o?Float32Array:o,s=[],4!==i)for(u=0;u2&&void 0!==arguments[2]&&arguments[2];var r=this.context.uniforms.find(function(e){return e.name===t});if(r){var n=this.calcDataTexture(t,r.type,e),i=n.texture,o=n.data;this.textureCache[t].data=o,this.textureCache[t].texture=i}}},{key:"destroy",value:function(){}},{key:"swap",value:function(){if(this.swapOutputTextureName||this.createSwapOutputDataTexture(),this.compiledPingpong){var t=this.context.output.name;this.textureCache[t].id=this.getOuputDataTexture().id,this.textureCache[t].texture=this.getOuputDataTexture().texture}var e=this.outputTextureName;this.outputTextureName=this.swapOutputTextureName,this.swapOutputTextureName=e,dt&&console.log("[".concat(this.entity,"]: after swap, output ").concat(this.getOuputDataTexture().id))}},{key:"getOuputDataTexture",value:function(){return this.textureCache[this.outputTextureName]}},{key:"createSwapOutputDataTexture",value:function(){var t=this.cloneDataTexture(this.getOuputDataTexture());this.swapOutputTextureName="".concat(this.entity,"-swap"),this.textureCache[this.swapOutputTextureName]=t}},{key:"cloneDataTexture",value:function(t){var e=t.data,r=t.textureWidth;return ft(ft({},t),{},{id:pt++,texture:this.reGl.texture({width:r,height:r,data:e,type:"float"})})}},{key:"calcDataTexture",value:function(t,e,r){var n=1;e===w.Vector4FloatArray&&(n=4);for(var i=[],o=0;o0&&void 0!==arguments[0]?arguments[0]:{},r=new t;return r.setConfig(e),r.setEngine(new Et),r}}]),t}()},288:function(t,e,r){"use strict";r.r(e),r.d(e,{Graph:function(){return A},GraphWithEvent:function(){return k},algorithm:function(){return n},comparision:function(){return o},essence:function(){return i},generate:function(){return s}});var n={};r.r(n),r.d(n,{components:function(){return M},dfs:function(){return P},dijkstra:function(){return D},dijkstraAll:function(){return B},findCycles:function(){return z},floydWarshall:function(){return et},isAcyclic:function(){return J},postorder:function(){return Z},preorder:function(){return $},prim:function(){return O},tarjan:function(){return F},topsort:function(){return K}});var i={};r.r(i),r.d(i,{hasSelfLoop:function(){return gt},isGraph:function(){return pt},isNullGraph:function(){return yt},isSimpleGraph:function(){return dt}});var o={};r.r(o),r.d(o,{containAllSameEdges:function(){return ut},containAllSameNodes:function(){return st},containSameEdges:function(){return nt},containSameNodes:function(){return rt},getSameEdges:function(){return ot},getSameNodes:function(){return it},isGraphComplement:function(){return vt},isGraphContainsAnother:function(){return ct},isGraphOptionSame:function(){return at},isGraphSame:function(){return lt}});var a,s={};function u(t,e){var r=t.get(e)||0;t.set(e,r+1)}function l(t,e){var r=t.get(e);void 0!==r&&((r-=1)>0?t.set(e,r):t.delete(e))}function c(t,e,r,n){var i=String(e),o=String(r);if(!t&&i>o){var s=i;i=o,o=s}return i+a.EDGE_KEY_DELIM+o+a.EDGE_KEY_DELIM+(void 0===n?a.DEFAULT_EDGE_NAME:n)}function f(t,e,r,n){var i=String(e),o=String(r),a={v:e,w:r};if(!t&&i>o){var s=a.v;a.v=a.w,a.w=s}return void 0!==n&&(a.name=n),a}function h(t,e){return c(t,e.v,e.w,e.name)}function p(t){return"function"==typeof t}r.r(s),r.d(s,{getGraphComplement:function(){return mt}}),function(t){t.DEFAULT_EDGE_NAME="\0",t.GRAPH_NODE="\0",t.EDGE_KEY_DELIM=""}(a||(a={}));var d=function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:function(t){return t.nodes().map(function(e){var r={id:e,value:t.node(e),parent:t.parent(e)};return void 0===r.value&&delete r.value,void 0===r.parent&&delete r.parent,r})}(t),edges:function(t){return t.edges().map(function(e){var r=t.edge(e),n={v:e.v,w:e.w,value:r,name:e.name};return void 0===n.name&&delete n.name,void 0===n.value&&delete n.value,n})}(t),value:t.graph()};return void 0===e.value&&delete e.value,e};function y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function g(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=a.GRAPH_NODE,this.label=void 0,this.nodeCountNum=0,this.edgeCountNum=0,this.defaultNodeLabelFn=function(){},this.defaultEdgeLabelFn=function(){},this.parentMap=void 0,this.childrenMap=void 0,this.nodesLabelMap=new Map,this.inEdgesMap=new Map,this.outEdgesMap=new Map,this.predecessorsMap=new Map,this.successorsMap=new Map,this.edgesMap=new Map,this.edgesLabelsMap=new Map,this.isDirected=function(){return e.directed},this.isMultigraph=function(){return e.multigraph},this.isCompound=function(){return e.compound},this.setGraph=function(t){return e.label=t,e},this.graph=function(){return e.label},this.setDefaultNodeLabel=function(t){return p(t)?e.defaultNodeLabelFn=t:e.defaultNodeLabelFn=function(){return t},e},this.nodeCount=function(){return e.nodeCountNum},this.node=function(t){return e.nodesLabelMap.get(t)},this.nodes=function(){return Array.from(e.nodesLabelMap.keys())},this.sources=function(){return e.nodes().filter(function(t){var r;return!(null===(r=e.inEdgesMap.get(t))||void 0===r?void 0:r.size)})},this.sinks=function(){return e.nodes().filter(function(t){var r;return!(null===(r=e.outEdgesMap.get(t))||void 0===r?void 0:r.size)})},this.setNodes=function(t,r){return t.map(function(t){return e.setNode(t,r)}),e},this.hasNode=function(t){return e.nodesLabelMap.has(t)},this.checkCompound=function(){if(!e.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(t){if(e.isCompound()){var r,n=null===(r=e.parentMap)||void 0===r?void 0:r.get(t);if(n!==e.GRAPH_NODE)return n}},this.removeFromParentsChildList=function(t){var r=e.parentMap.get(t);e.childrenMap.get(r).delete(t)},this.setParent=function(t,r){var n,i;e.checkCompound();for(var o=void 0===r?e.GRAPH_NODE:r,a=e.parent(o);a;){if(t===a)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");a=e.parent(a)}r&&e.setNode(r),e.setNode(t),e.removeFromParentsChildList(t),null===(n=e.parentMap)||void 0===n||n.set(t,o);var s=e.childrenMap.get(o);return s.set(t,!0),null===(i=e.childrenMap)||void 0===i||i.set(o,s),e},this.children=function(t){var r=void 0===t?e.GRAPH_NODE:t;if(e.isCompound()){var n,i=null===(n=e.childrenMap)||void 0===n?void 0:n.get(r);return i?Array.from(i.keys()):void 0}return r===e.GRAPH_NODE?e.nodes():t&&e.hasNode(t)?[]:void 0},this.predecessors=function(t){var r=e.predecessorsMap.get(t);return r?Array.from(r.keys()):void 0},this.successors=function(t){var r=e.successorsMap.get(t);return r?Array.from(r.keys()):void 0},this.neighbors=function(t){var r;if(e.hasNode(t))return Array.from(new Set(null===(r=e.predecessors(t))||void 0===r?void 0:r.concat(e.successors(t))))},this.isLeaf=function(t){var r,n;return e.isDirected()?!(null===(n=e.successors(t))||void 0===n?void 0:n.length):!(null===(r=e.neighbors(t))||void 0===r?void 0:r.length)},this.filterNodes=function(r){var n=e.directed,i=e.multigraph,o=e.compound,a=new t({directed:n,multigraph:i,compound:o});if(a.setGraph(e.graph()),e.nodes().forEach(function(t){r(t)&&a.setNode(t,e.node(t))}),e.edges().forEach(function(t){a.hasNode(t.v)&&a.hasNode(t.w)&&a.setEdgeObj(t,e.edge(t))}),o){a.nodes().forEach(function(t){a.setParent(t,function(t){for(var r=e.parent(t);void 0!==r&&!a.hasNode(r);)r=e.parent(r);return r}(t))})}return a},this.setDefaultEdgeLabel=function(t){return p(t)?e.defaultEdgeLabelFn=t:e.defaultEdgeLabelFn=function(){return t},e},this.edgeCount=function(){return e.edgeCountNum},this.setEdgeObj=function(t,r){return e.setEdge(t.v,t.w,r,t.name)},this.setPath=function(t,r){return t.reduce(function(t,n){return e.setEdge(t,n,r),n}),e},this.edgeFromArgs=function(t,r,n){return e.edge({v:t,w:r,name:n})},this.edge=function(t){return e.edgesLabelsMap.get(h(e.isDirected(),t))},this.hasEdge=function(t,r,n){return e.edgesLabelsMap.has(h(e.isDirected(),{v:t,w:r,name:n}))},this.removeEdgeObj=function(t){var r=t.v,n=t.w,i=t.name;return e.removeEdge(r,n,i)},this.edges=function(){return Array.from(e.edgesMap.values())},this.inEdges=function(t,r){var n=e.inEdgesMap.get(t);if(n)return Array.from(n.values()).filter(function(t){return!r||t.v===r})},this.outEdges=function(t,r){var n=e.outEdgesMap.get(t);if(n)return Array.from(n.values()).filter(function(t){return!r||t.w===r})},this.nodeEdges=function(t,r){var n;if(e.hasNode(t))return null===(n=e.inEdges(t,r))||void 0===n?void 0:n.concat(e.outEdges(t,r))},this.toJSON=function(){return d(e)},this.nodeInDegree=function(t){var r=e.inEdgesMap.get(t);return r?r.size:0},this.nodeOutDegree=function(t){var r=e.outEdgesMap.get(t);return r?r.size:0},this.nodeDegree=function(t){return e.nodeInDegree(t)+e.nodeOutDegree(t)},this.source=function(t){return t.v},this.target=function(t){return t.w};var n=g(g({},b),r);this.compound=n.compound,this.directed=n.directed,this.multigraph=n.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}var e,r,n;return e=t,(r=[{key:"setNode",value:function(t,e){var r,n=this.nodesLabelMap,i=this.defaultNodeLabelFn,o=this.isCompound,a=this.parentMap,s=this.childrenMap,u=this.inEdgesMap,l=this.outEdgesMap,c=this.predecessorsMap,f=this.successorsMap;if(n.has(t))return void 0!==e&&n.set(t,e),this;(n.set(t,e||i(t)),o())&&(null===a||void 0===a||a.set(t,this.GRAPH_NODE),null===s||void 0===s||s.set(t,new Map),(null===s||void 0===s?void 0:s.has(this.GRAPH_NODE))||null===s||void 0===s||s.set(this.GRAPH_NODE,new Map),null===s||void 0===s||null===(r=s.get(this.GRAPH_NODE))||void 0===r||r.set(t,!0));return[u,l,c,f].forEach(function(e){return e.set(t,new Map)}),this.nodeCountNum+=1,this}},{key:"removeNode",value:function(t){var e=this;if(this.hasNode(t)){var r,n,i,o=function(t){e.removeEdge(t.v,t.w,t.name)},a=this.inEdgesMap,s=this.outEdgesMap,u=this.predecessorsMap,l=this.successorsMap,c=this.nodesLabelMap;if(this.isCompound())this.removeFromParentsChildList(t),null===(r=this.parentMap)||void 0===r||r.delete(t),null===(n=this.children(t))||void 0===n||n.forEach(function(t){return e.setParent(t)}),null===(i=this.childrenMap)||void 0===i||i.delete(t);var f=a.get(t),h=s.get(t);Array.from(f.values()).forEach(function(t){return o(t)}),Array.from(h.values()).forEach(function(t){return o(t)}),c.delete(t),a.delete(t),s.delete(t),u.delete(t),l.delete(t),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(t,e,r,n){var i,o,a=f(this.isDirected(),t,e,n),s=h(this.isDirected(),a),l=a.v,c=a.w;if(this.edgesLabelsMap.has(s))return this.edgesLabelsMap.set(s,r),this;if(void 0!==n&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(l),this.setNode(c),this.edgesLabelsMap.set(s,r||this.defaultEdgeLabelFn(l,c,n)),Object.freeze(a),this.edgesMap.set(s,a);var p=this.predecessorsMap.get(c),d=this.successorsMap.get(l);return u(p,l),u(d,c),null===(i=this.inEdgesMap.get(c))||void 0===i||i.set(s,a),null===(o=this.outEdgesMap.get(l))||void 0===o||o.set(s,a),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(t,e,r){var n=c(this.isDirected(),t,e,r);if(this.edgesMap.get(n)){var i=f(this.isDirected(),t,e,r),o=i.v,a=i.w;this.edgesLabelsMap.delete(n),this.edgesMap.delete(n);var s=this.predecessorsMap.get(a),u=this.successorsMap.get(o);l(s,o),l(u,a),this.inEdgesMap.get(a).delete(n),this.outEdgesMap.get(o).delete(n),this.edgeCountNum-=1}return this}}])&&m(e.prototype,r),n&&m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function x(t){"@babel/helpers - typeof";return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function w(t,e){for(var r=0;r-1&&this.eventPool[t].splice(r,1)}}},{key:"emitEvent",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n>1])||void 0===a?void 0:a.priority)e.arr[n].priority)throw new Error("New priority is greater than current priority.Key: ".concat(t," Old: + ").concat(e.arr[n].priority," New: ").concat(r));e.arr[n].priority=r,e.innerDecrease(n)}}),O=function(t,e){var r,n=new A,i=new Map,o=new T;function a(t){var n=t.v===r?t.w:t.v,a=o.priority(n);if(void 0!==a){var s=e(t);s0;){var u;if(r=o.removeMin(),i.has(r))n.setEdge(r,i.get(r));else{if(s)throw new Error("Input graph is not connected: "+t.graph());s=!0}null===(u=t.nodeEdges(r))||void 0===u||u.forEach(a)}return n},M=function(t){var e=new Set,r=[];return t.nodes().forEach(function(n){for(var i=[],o=[n];o.length>0;){var a,s,u=o.pop();e.has(u)||(e.add(u),i.push(u),null===(a=t.successors(u))||void 0===a||a.forEach(function(t){return o.push(t)}),null===(s=t.predecessors(u))||void 0===s||s.forEach(function(t){return o.push(t)}))}i.length&&r.push(i)}),r},P=function(t,e,r){var n=function(e){return t.isDirected()?t.successors(e):t.neighbors(e)},i=[],o=[];return(Array.isArray(e)?e:[e]).forEach(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);!function t(e,r,n,i,o,a){i.includes(r)||(i.push(r),n||a.push(r),o(r).forEach(function(r){return t(e,r,n,i,o,a)}),n&&a.push(r))}(t,e,"post"===r,o,n,i)}),i};function L(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return N(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return N(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function N(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&(i=s.removeMin(),!(o=a.get(i))||o.distance!==Number.POSITIVE_INFINITY);)n(i).forEach(u);var l={};return Array.from(a.entries()).forEach(function(t){var e=L(t,2),r=e[0],n=e[1];return l[String(r)]=n,l}),l},D=function(t,e,r,n){return R(t,e,r||j,n||function(e){return t.outEdges(e)})},B=function(t,e,r){var n={};return t.nodes().forEach(function(i){return n[String(i)]=D(t,i,e,r),n}),n},F=function(t){var e=0,r=[],n=new Map,i=[];return t.nodes().forEach(function(o){n.has(o)||function o(a){var s,u={onStack:!0,lowlink:e,index:e};if(n.set(a,u),e+=1,r.push(a),null===(s=t.successors(a))||void 0===s||s.forEach(function(t){var e;if(n.has(t)){if(null===(e=n.get(t))||void 0===e?void 0:e.onStack){var r=n.get(t);u.lowlink=Math.min(u.lowlink,r.index)}}else{o(t);var i=n.get(t);u.lowlink=Math.min(u.lowlink,i.lowlink)}}),u.lowlink===u.index){var l,c=[];do{l=r.pop(),n.get(l).onStack=!1,c.push(l)}while(a!==l);i.push(c)}}(o)}),i},z=function(t){return F(t).filter(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})};function G(t){"@babel/helpers - typeof";return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function U(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);ro&&(o=e.depth);var r=e.children,n=r.length,i=new function(t,e){void 0===t&&(t=0),void 0===e&&(e=[]);var r=this;r.x=r.y=0,r.leftChild=r.rightChild=null,r.height=0,r.children=e}(e.height,[]);return r.forEach(function(e,r){var o=t(e);i.children.push(o),0===r&&(i.leftChild=o),r===n-1&&(i.rightChild=o)}),i.originNode=e,i.isLeaf=e.isLeaf(),i}(t);return function t(e){if(e.isLeaf||0===e.children.length)e.drawingDepth=o;else{var r=e.children.map(function(e){return t(e)}),n=Math.min.apply(null,r);e.drawingDepth=n-1}return e.drawingDepth}(a),function t(n){n.x=n.drawingDepth*e.rankSep,n.isLeaf?(n.y=0,r&&(n.y=r.y+r.height+e.nodeSep,n.originNode.parent!==r.originNode.parent&&(n.y+=e.subTreeSep)),r=n):(n.children.forEach(function(e){t(e)}),n.y=(n.leftChild.y+n.rightChild.y)/2)}(a),function t(e,r,n){n?(r.x=e.x,r.y=e.y):(r.x=e.y,r.y=e.x),e.children.forEach(function(e,i){t(e,r.children[i],n)})}(a,t,e.isHorizontal),t}},8725:function(t,e,r){var n=r(4711),i=["LR","RL","TB","BT","H","V"],o=["LR","RL","H"],a=i[0];t.exports=function(t,e,r){var s=e.direction||a;if(e.isHorizontal=function(t){return o.indexOf(t)>-1}(s),s&&-1===i.indexOf(s))throw new TypeError("Invalid direction: "+s);if(s===i[0])r(t,e);else if(s===i[1])r(t,e),t.right2left();else if(s===i[2])r(t,e);else if(s===i[3])r(t,e),t.bottom2top();else if(s===i[4]||s===i[5]){var u=n(t,e),l=u.left,c=u.right;r(l,e),r(c,e),e.isHorizontal?l.right2left():l.bottom2top(),c.translate(l.x-c.x,l.y-c.y),t.x=l.x,t.y=c.y;var f=t.getBoundingBox();e.isHorizontal?f.top<0&&t.translate(0,-f.top):f.left<0&&t.translate(-f.left,0)}var h=e.fixedRoot;return void 0===h&&(h=!0),h&&t.translate(-(t.x+t.width/2+t.hgap),-(t.y+t.height/2+t.vgap)),t}},3848:function(t,e,r){var n=r(2394),i={getId:function(t){return t.id||t.name},getPreH:function(t){return t.preH||0},getPreV:function(t){return t.preV||0},getHGap:function(t){return t.hgap||18},getVGap:function(t){return t.vgap||18},getChildren:function(t){return t.children},getHeight:function(t){return t.height||36},getWidth:function(t){var e=t.label||" ";return t.width||18*e.split("").length}};function o(t,e){var r=this;if(r.vgap=r.hgap=0,t instanceof o)return t;r.data=t;var n=e.getHGap(t),i=e.getVGap(t);return r.preH=e.getPreH(t),r.preV=e.getPreV(t),r.width=e.getWidth(t),r.height=e.getHeight(t),r.width+=r.preH,r.height+=r.preV,r.id=e.getId(t),r.x=r.y=0,r.depth=0,r.children||(r.children=[]),r.addGap(n,i),r}n.assign(o.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(t,e){this.hgap+=t,this.vgap+=e,this.width+=2*t,this.height+=2*e},eachNode:function(t){for(var e,r=[this];e=r.shift();)t(e),r=e.children.concat(r)},DFTraverse:function(t){this.eachNode(t)},BFTraverse:function(t){for(var e,r=[this];e=r.shift();)t(e),r=r.concat(e.children)},getBoundingBox:function(){var t={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode(function(e){t.left=Math.min(t.left,e.x),t.top=Math.min(t.top,e.y),t.width=Math.max(t.width,e.x+e.width),t.height=Math.max(t.height,e.y+e.height)}),t},translate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.eachNode(function(r){r.x+=t,r.y+=e,r.x+=r.preH,r.y+=r.preV})},right2left:function(){var t=this.getBoundingBox();this.eachNode(function(e){e.x=e.x-2*(e.x-t.left)-e.width}),this.translate(t.width,0)},bottom2top:function(){var t=this.getBoundingBox();this.eachNode(function(e){e.y=e.y-2*(e.y-t.top)-e.height}),this.translate(0,t.height)}}),t.exports=function(t,e,r){void 0===e&&(e={});var a,s=new o(t,e=n.assign({},i,e)),u=[s];if(!r&&!t.collapsed)for(;a=u.shift();)if(!a.data.collapsed){var l=e.getChildren(a.data),c=l?l.length:0;if(a.children=new Array(c),l&&c)for(var f=0;ft.y?u:t.y}}else t.y=0}(t,o,e,r,i),o=t})}},6401:function(t,e,r){var n=r(2394);var i={getSubTreeSep:function(){return 0}};t.exports=function(t,e){void 0===e&&(e={}),e=n.assign({},i,e),t.parent={x:0,width:0,height:0,y:0},t.BFTraverse(function(t){t.x=t.parent.x+t.parent.width}),t.parent=null,function t(e,r){var n=0;return e.children.length?e.children.forEach(function(e){n+=t(e,r)}):n=e.height,e._subTreeSep=r.getSubTreeSep(e.data),e.totalHeight=Math.max(e.height,n)+2*e._subTreeSep,e.totalHeight}(t,e),t.startY=0,t.y=t.totalHeight/2-t.height/2,t.eachNode(function(t){var e=t.children,r=e.length;if(r){var n=e[0];if(n.startY=t.startY+t._subTreeSep,1===r)n.y=t.y+t.height/2-n.height/2;else{n.y=n.startY+n.totalHeight/2-n.height/2;for(var i=1;ie.height)e.y=i.y+a/2-e.height/2;else if(1!==r.length||e.height>s){var u=e.y+(e.height-a)/2-i.y;r.forEach(function(t){t.translate(0,u)})}else e.y=(i.y+i.height/2+o.y+o.height/2)/2-e.height/2}}(t)}},514:function(t){function e(t,e,r,n){void 0===n&&(n=[]);var i=this;i.w=t||0,i.h=e||0,i.y=r||0,i.x=0,i.c=n||[],i.cs=n.length,i.prelim=0,i.mod=0,i.shift=0,i.change=0,i.tl=null,i.tr=null,i.el=null,i.er=null,i.msel=0,i.mser=0}function r(t,e){!function t(e,r,n){n?e.y+=r:e.x+=r,e.children.forEach(function(e){t(e,r,n)})}(t,-function t(e,r){var n=r?e.y:e.x;return e.children.forEach(function(e){n=Math.min(t(e,r),n)}),n}(t,e),e)}e.fromNode=function(t,r){if(!t)return null;var n=[];return t.children.forEach(function(t){n.push(e.fromNode(t,r))}),r?new e(t.height,t.width,t.x,n):new e(t.width,t.height,t.y,n)},t.exports=function(t,n){void 0===n&&(n={});var i=n.isHorizontal;function o(t){0===t.cs?(t.el=t,t.er=t,t.msel=t.mser=0):(t.el=t.c[0].el,t.msel=t.c[0].msel,t.er=t.c[t.cs-1].er,t.mser=t.c[t.cs-1].mser)}function a(t,e,r){for(var n=t.c[e-1],i=n.mod,o=t.c[e],a=o.mod;null!==n&&null!==o;){c(n)>r.low&&(r=r.nxt);var f=i+n.prelim+n.w-(a+o.prelim);f>0&&(a+=f,s(t,e,r.index,f));var h=c(n),p=c(o);h<=p&&null!==(n=l(n))&&(i+=n.mod),h>=p&&null!==(o=u(o))&&(a+=o.mod)}!n&&o?function(t,e,r,n){var i=t.c[0].el;i.tl=r;var o=n-r.mod-t.c[0].msel;i.mod+=o,i.prelim-=o,t.c[0].el=t.c[e].el,t.c[0].msel=t.c[e].msel}(t,e,o,a):n&&!o&&function(t,e,r,n){var i=t.c[e].er;i.tr=r;var o=n-r.mod-t.c[e].mser;i.mod+=o,i.prelim-=o,t.c[e].er=t.c[e-1].er,t.c[e].mser=t.c[e-1].mser}(t,e,n,i)}function s(t,e,r,n){t.c[e].mod+=n,t.c[e].msel+=n,t.c[e].mser+=n,function(t,e,r,n){if(r!==e-1){var i=e-r;t.c[r+1].shift+=n/i,t.c[e].shift-=n/i,t.c[e].change-=n-n/i}}(t,e,r,n)}function u(t){return 0===t.cs?t.tl:t.c[0]}function l(t){return 0===t.cs?t.tr:t.c[t.cs-1]}function c(t){return t.y+t.h}function f(t,e,r){for(;null!==r&&t>=r.low;)r=r.nxt;return{low:t,index:e,nxt:r}}!function t(e,r,n){void 0===n&&(n=0),r?(e.x=n,n+=e.width):(e.y=n,n+=e.height),e.children.forEach(function(e){t(e,r,n)})}(t,i);var h=e.fromNode(t,i);return function t(e){if(0!==e.cs){t(e.c[0]);for(var r=f(c(e.c[0].el),0,null),n=1;nn?1:0}var u=function(t){function e(e){var r=t.call(this)||this;return r.radius=null,r.nodeSize=void 0,r.startRadius=null,r.endRadius=null,r.startAngle=0,r.endAngle=2*Math.PI,r.clockwise=!0,r.divisions=1,r.ordering=null,r.angleRatio=1,r.nodes=[],r.edges=[],r.nodeMap={},r.degrees=[],r.width=300,r.height=300,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},e.prototype.execute=function(){var t,e=this.nodes,r=this.edges,n=e.length;if(0!==n){this.width||"undefined"==typeof window||(this.width=window.innerWidth),this.height||"undefined"==typeof window||(this.height=window.innerHeight),this.center||(this.center=[this.width/2,this.height/2]);var i=this.center;if(1===n)return e[0].x=i[0],e[0].y=i[1],void(this.onLayoutEnd&&this.onLayoutEnd());var o=this.radius,s=this.startRadius,u=this.endRadius,l=this.divisions,c=this.startAngle,f=this.endAngle,h=this.angleRatio,p=this.ordering,d=this.clockwise,y=this.nodeSpacing,g=this.nodeSize,v=(f-c)/n,m={};e.forEach(function(t,e){m[t.id]=e}),this.nodeMap=m;var b=(0,a.getDegree)(e.length,m,r);if(this.degrees=b,y){var A=(0,a.getFuncByUnknownType)(10,y),x=(0,a.getFuncByUnknownType)(10,g),w=-1/0;e.forEach(function(t){var e=x(t);wthis.width?this.width/2:this.height/2;var S=v*h,E=[];E="topology"===p?this.topologyOrdering():"topology-directed"===p?this.topologyOrdering(!0):"degree"===p?this.degreeOrdering():e;for(var C=Math.ceil(n/l),k=0;k=0;_--)w(_);return{nodes:e,edges:r,combos:n,comboEdges:i}},e.prototype.getInnerGraphs=function(t){var e=this.comboTrees,r=this.nodeSize,n=this.edges,i=this.comboPadding,a=this.spacing,s={},c=this.innerLayout||new l.ConcentricLayout({type:"concentric",sortBy:"id"});return c.center=[0,0],c.preventOverlap=!0,c.nodeSpacing=a,(e||[]).forEach(function(e){(0,u.traverseTreeUp)(e,function(e){var a,l=(null===i||void 0===i?void 0:i(e))||10;if((0,u.isArray)(l)&&(l=Math.max.apply(Math,l)),null===(a=e.children)||void 0===a?void 0:a.length){var f=e.children.map(function(e){if("combo"===e.itemType)return s[e.id];var r=t[e.id]||{};return o(o({},r),e)}),h=f.map(function(t){return t.id}),p={nodes:f,edges:n.filter(function(t){return h.includes(t.source)&&h.includes(t.target)})},d=1/0;f.forEach(function(t){var e;t.size||(t.size=(null===(e=s[t.id])||void 0===e?void 0:e.size)||(null===r||void 0===r?void 0:r(t))||[30,30]),(0,u.isNumber)(t.size)&&(t.size=[t.size,t.size]),d>t.size[0]&&(d=t.size[0]),d>t.size[1]&&(d=t.size[1])}),c.layout(p);var y=(0,u.getLayoutBBox)(f),g=y.minX,v=y.minY,m=y.maxX,b=y.maxY,A={x:(m+g)/2,y:(b+v)/2};p.nodes.forEach(function(t){t.x-=A.x,t.y-=A.y});var x=Math.max(m-g,d)+2*l,w=Math.max(b-v,d)+2*l;s[e.id]={id:e.id,nodes:f,size:[x,w]}}else if("combo"===e.itemType){var _=l?[2*l,2*l]:[30,30];s[e.id]={id:e.id,nodes:[],size:_}}return!0})}),s},e.prototype.initVals=function(){var t,e,r=this.nodeSize,n=this.spacing;if(e=(0,u.isNumber)(n)?function(){return n}:(0,u.isFunction)(n)?n:function(){return 0},this.spacing=e,r)if((0,u.isFunction)(r))t=function(t){var n=r(t),i=e(t);return(0,u.isArray)(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+i)/2:((n||10)+i)/2};else if((0,u.isArray)(r)){var i=(r[0]>r[1]?r[0]:r[1])/2;t=function(t){return i+e(t)/2}}else{var o=r/2;t=function(t){return o+e(t)/2}}else t=function(t){var r=e(t);return t.size?(0,u.isArray)(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+r)/2:(0,u.isObject)(t.size)?((t.size.width>t.size.height?t.size.width:t.size.height)+r)/2:(t.size+r)/2:10+r/2};this.nodeSize=t;var a,s=this.comboPadding;a=(0,u.isNumber)(s)?function(){return s}:(0,u.isArray)(s)?function(){return Math.max.apply(null,s)}:(0,u.isFunction)(s)?s:function(){return 0},this.comboPadding=a},e.prototype.getType=function(){return"comboCombined"},e}(s.Base);e.ComboCombinedLayout=c},5773:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.ComboForceLayout=void 0;var o=r(8933),a=r(864),s=function(t){function e(e){var r=t.call(this)||this;return r.center=[0,0],r.maxIteration=100,r.gravity=10,r.comboGravity=10,r.linkDistance=10,r.alpha=1,r.alphaMin=.001,r.alphaDecay=1-Math.pow(r.alphaMin,1/300),r.alphaTarget=0,r.velocityDecay=.6,r.edgeStrength=.6,r.nodeStrength=30,r.preventOverlap=!1,r.preventNodeOverlap=!1,r.preventComboOverlap=!1,r.collideStrength=void 0,r.nodeCollideStrength=.5,r.comboCollideStrength=.5,r.comboSpacing=20,r.comboPadding=10,r.optimizeRangeFactor=1,r.onTick=function(){},r.onLayoutEnd=function(){},r.depthAttractiveForceScale=1,r.depthRepulsiveForceScale=2,r.nodes=[],r.edges=[],r.combos=[],r.comboTrees=[],r.width=300,r.height=300,r.bias=[],r.nodeMap={},r.oriComboMap={},r.indexMap={},r.comboMap={},r.previousLayouted=!1,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:100,center:[0,0],gravity:10,speed:1,comboGravity:30,preventOverlap:!1,preventComboOverlap:!0,preventNodeOverlap:!0,nodeSpacing:void 0,collideStrength:void 0,nodeCollideStrength:.5,comboCollideStrength:.5,comboSpacing:20,comboPadding:10,edgeStrength:.6,nodeStrength:30,linkDistance:10}},e.prototype.execute=function(){var t=this.nodes,e=this.center;if(this.comboTree={id:"comboTreeRoot",depth:-1,children:this.comboTrees},t&&0!==t.length){if(1===t.length)return t[0].x=e[0],t[0].y=e[1],void(this.onLayoutEnd&&this.onLayoutEnd());this.initVals(),this.run(),this.onLayoutEnd&&this.onLayoutEnd()}else this.onLayoutEnd&&this.onLayoutEnd()},e.prototype.run=function(){var t=this,e=t.nodes,r=t.previousLayouted?t.maxIteration/5:t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var n=t.center,i=t.velocityDecay,o=t.comboMap;t.previousLayouted||t.initPos(o);for(var s=function(r){var n=[];e.forEach(function(t,e){n[e]={x:0,y:0}}),t.applyCalculate(n),t.applyComboCenterForce(n),e.forEach(function(t,e){(0,a.isNumber)(t.x)&&(0,a.isNumber)(t.y)&&(t.x+=n[e].x*i,t.y+=n[e].y*i)}),t.alpha+=(t.alphaTarget-t.alpha)*t.alphaDecay,t.onTick()},u=0;ug[1]?g[0]:g[1])/2;d=function(t){return m}}else{var b=g/2;d=function(t){return b}}else d=function(t){return t.size?(0,a.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2:(0,a.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2:t.size/2:10};this.nodeSize=d;var A,x=this.comboSpacing;A=(0,a.isNumber)(x)?function(){return x}:(0,a.isFunction)(x)?x:function(){return 0},this.comboSpacing=A;var w,_=this.comboPadding;w=(0,a.isNumber)(_)?function(){return _}:(0,a.isArray)(_)?function(){return Math.max.apply(null,_)}:(0,a.isFunction)(_)?_:function(){return 0},this.comboPadding=w;var S,E=this.linkDistance;E||(E=10),S=(0,a.isNumber)(E)?function(t){return E}:E,this.linkDistance=S;var C,k=this.edgeStrength;k||(k=1),C=(0,a.isNumber)(k)?function(t){return k}:k,this.edgeStrength=C;var I,T=this.nodeStrength;T||(T=30),I=(0,a.isNumber)(T)?function(t){return T}:T,this.nodeStrength=I},e.prototype.initPos=function(t){this.nodes.forEach(function(e,r){var n=e.comboId,i=t[n];n&&i?(e.x=i.cx+100/(r+1),e.y=i.cy+100/(r+1)):(e.x=100/(r+1),e.y=100/(r+1))})},e.prototype.getComboMap=function(){var t=this,e=t.nodeMap,r=t.comboTrees,n=t.oriComboMap,i={};return(r||[]).forEach(function(r){var o=[];(0,a.traverseTreeUp)(r,function(r){if("node"===r.itemType)return!0;if(!n[r.id])return!0;if(void 0===i[r.id]){var s={id:r.id,name:r.id,cx:0,cy:0,count:0,depth:t.oriComboMap[r.id].depth||0,children:[]};i[r.id]=s}var u=r.children;u&&u.forEach(function(t){if(!i[t.id]&&!e[t.id])return!0;o.push(t)});var l=i[r.id];if(l.cx=0,l.cy=0,0===o.length){l.empty=!0;var c=n[r.id];l.cx=c.x,l.cy=c.y}return o.forEach(function(t){if(l.count++,"node"!==t.itemType){var r=i[t.id];return(0,a.isNumber)(r.cx)&&(l.cx+=r.cx),void((0,a.isNumber)(r.cy)&&(l.cy+=r.cy))}var n=e[t.id];n&&((0,a.isNumber)(n.x)&&(l.cx+=n.x),(0,a.isNumber)(n.y)&&(l.cy+=n.y))}),l.cx/=l.count||1,l.cy/=l.count||1,l.children=o,!0})}),i},e.prototype.applyComboCenterForce=function(t){var e=this.gravity,r=this.comboGravity||e,n=this.alpha,i=this.comboTrees,o=this.indexMap,s=this.nodeMap,u=this.comboMap;(i||[]).forEach(function(e){(0,a.traverseTreeUp)(e,function(e){if("node"===e.itemType)return!0;if(!u[e.id])return!0;var i=u[e.id],l=(i.depth+1)/10*.5,c=i.cx,f=i.cy;return i.cx=0,i.cy=0,i.children.forEach(function(e){if("node"!==e.itemType){var h=u[e.id];return h&&(0,a.isNumber)(h.cx)&&(i.cx+=h.cx),void(h&&(0,a.isNumber)(h.cy)&&(i.cy+=h.cy))}var p=s[e.id],d=p.x-c||.005,y=p.y-f||.005,g=Math.sqrt(d*d+y*y),v=o[p.id],m=r*n/g*l;t[v].x-=d*m,t[v].y-=y*m,(0,a.isNumber)(p.x)&&(i.cx+=p.x),(0,a.isNumber)(p.y)&&(i.cy+=p.y)}),i.cx/=i.count||1,i.cy/=i.count||1,!0})})},e.prototype.applyCalculate=function(t){var e=this.comboMap,r=this.nodes,n={};r.forEach(function(t,e){r.forEach(function(r,i){if(!(eo&&(l.minX=o),l.minY>a&&(l.minY=a),l.maxX1&&a.forEach(function(r,s){if("node"===r.itemType)return!1;var u=e[r.id];u&&a.forEach(function(a,l){if(s<=l)return!1;if("node"===a.itemType)return!1;var c=e[a.id];if(!c)return!1;var f=u.cx-c.cx||.005,h=u.cy-c.cy||.005,p=f*f+h*h,d=u.r||1,y=c.r||1,g=d+y,v=y*y,m=d*d;if(pi)){var v=e["".concat(p.id,"-").concat(r.id)],m=v.vx,b=v.vy,A=Math.log(Math.abs(r.depth-p.depth)/10)+1||1;A=A<1?1:A,r.comboId!==p.comboId&&(A+=1);var x=A?Math.pow(f,A):1,w=o(r)*a/y*x;if(t[d].x+=m*w,t[d].y+=b*w,d0){var e=Math.abs(v[0][r.sortBy]-t[r.sortBy]);r.maxLevelDiff&&e>=r.maxLevelDiff&&(v=[],g.push(v))}v.push(t)});var m=u+(h||r.minNodeSpacing);if(!r.preventOverlap){var b=g.length>0&&g[0].length>1,A=(Math.min(r.width,r.height)/2-m)/(g.length+(b?1:0));m=Math.min(m,A)}var x=0;if(g.forEach(function(t){var e=r.sweep;void 0===e&&(e=2*Math.PI-2*Math.PI/t.length);var n=t.dTheta=e/Math.max(1,t.length-1);if(t.length>1&&r.preventOverlap){var i=Math.cos(n)-Math.cos(0),o=Math.sin(n)-Math.sin(0),a=Math.sqrt(m*m/(i*i+o*o));x=Math.max(a,x)}t.r=x,x+=m}),r.equidistant){for(var w=0,_=0,S=0;Se.x&&(L=e.x),N>e.y&&(N=e.y)}),x.edges().forEach(function(t){var e;null===(e=x.edge(t).points)||void 0===e||e.forEach(function(t){L>t.x&&(L=t.x),N>t.y&&(N=t.y)})}),P[0]=d[0]-L,P[1]=d[1]-N}var j="LR"===h||"RL"===h;if(y){var R=this.focusNode,D=this.ranksep,B=this.getRadialPos,F=(0,s.isString)(R)?R:null===R||void 0===R?void 0:R.id,z=F?null===(n=x.node(F))||void 0===n?void 0:n._rank:0,G=[],U=j?"y":"x",H=j?"height":"width",V=1/0,Q=-1/0;x.nodes().forEach(function(t){var e=x.node(t);if(o.nodeMap[t]){var r=k(o.nodeMap[t]);if(0===z)G[e._rank]||(G[e._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),G[e._rank].nodes.push(t),G[e._rank].totalWidth+=2*r+e[H],G[e._rank].maxSizeQ&&(Q=s)}});var Y=D||50,W={},q=(Q-V)/.9,X=[.5*(V+Q-q),.5*(V+Q+q)],K=function(t,e,r,n){void 0===r&&(r=-1/0),void 0===n&&(n=[0,1]);var i=r;return t.forEach(function(t){var r=x.node(t);W[t]=e;var a=B(r[U],X,q,e,n),s=a.x,u=a.y;if(o.nodeMap[t]){o.nodeMap[t].x=s+P[0],o.nodeMap[t].y=u+P[1],o.nodeMap[t]._order=r._order;var l=C(o.nodeMap[t]);i=i})}:function(t,e,r){var n=Math.max(e.x,r.x),i=Math.min(e.x,r.x);return t.filter(function(t){return t.x<=n&&t.x>=i})};x.edges().forEach(function(t){var e,r=x.edge(t),n=A.findIndex(function(e){var r=(0,s.getEdgeTerminal)(e,"source"),n=(0,s.getEdgeTerminal)(e,"target");return r===t.v&&n===t.w});if(!(n<=-1)&&o.edgeLabelSpace&&o.controlPoints&&"loop"!==A[n].type){null===(e=null===r||void 0===r?void 0:r.points)||void 0===e||e.forEach(function(t){t.x+=P[0],t.y+=P[1]});var i=o.nodeMap[t.v],a=o.nodeMap[t.w];A[n].controlPoints=f(null===r||void 0===r?void 0:r.points,i,a,tt,j,et,rt)}})}return o.onLayoutEnd&&o.onLayoutEnd(),{nodes:u,edges:A}}},e.prototype.getRadialPos=function(t,e,r,n,i){void 0===i&&(i=[0,1]);var o=(t-e[0])/r,a=2*(o=o*(i[1]-i[0])+i[0])*Math.PI;return{x:Math.cos(a)*n,y:Math.sin(a)*n}},e.prototype.getType=function(){return"dagre"},e}(u.Base);e.DagreLayout=c;var f=function(t,e,r,n,i,o,a){var s=(null===t||void 0===t?void 0:t.slice(1,t.length-1))||[];if(e&&r){var u=e.x,l=e.y,c=r.x,f=r.y;if(i&&(u=e.y,l=e.x,c=r.y,f=r.x),f!==l&&u!==c){var h=n.indexOf(l),p=n[h+1];if(p){var d=s[0],y=i?{x:(l+p)/2,y:(null===d||void 0===d?void 0:d.y)||c}:{x:(null===d||void 0===d?void 0:d.x)||c,y:(l+p)/2};d&&!o(d,y)||s.unshift(y)}var g=n.indexOf(f),v=Math.abs(g-h);if(1===v)(s=a(s,e,r)).length||s.push(i?{x:(l+f)/2,y:u}:{x:u,y:(l+f)/2});else if(v>1){var m=n[g-1];if(m){var b=s[s.length-1],A=i?{x:(f+m)/2,y:(null===b||void 0===b?void 0:b.y)||c}:{x:(null===b||void 0===b?void 0:b.x)||u,y:(f+m)/2};b&&!o(b,A)||s.push(A)}}}}return s}},6006:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;rt.x&&(i=t.x),o>t.y&&(o=t.y)}),e.forEach(function(t){t.points.forEach(function(t){i>t.x&&(i=t.x),o>t.y&&(o=t.y)})}),n[0]=r[0]-i,n[1]=r[1]-o}return n},e.prototype.updateNodePosition=function(t,e){var r=this.combos,n=this.nodes,i=this.edges,o=this.anchorPoint,a=this.graphSettings,s=this.getBegin(t,e);t.forEach(function(t){var l,c=t.x,f=t.y,h=t.id,p=t.type,d=t.coreBox;if(p===u.HierarchyNodeType.META&&h!==u.ROOT_NAME){var y=r.findIndex(function(t){return t.id===h}),g=null===(l=null===a||void 0===a?void 0:a.subScene)||void 0===l?void 0:l.meta;r[y].offsetX=c+s[0],r[y].offsetY=f+s[1],r[y].fixSize=[d.width,d.height],r[y].fixCollapseSize=[d.width,d.height],t.expanded?r[y].padding=[null===g||void 0===g?void 0:g.paddingTop,null===g||void 0===g?void 0:g.paddingRight,null===g||void 0===g?void 0:g.paddingBottom,null===g||void 0===g?void 0:g.paddingLeft]:r[y].padding=[0,0,0,0]}else if(p===u.HierarchyNodeType.OP){y=n.findIndex(function(t){return t.id===h});if(n[y].x=c+s[0],n[y].y=f+s[1],o){var v=[],m=e.filter(function(t){return t.v===h}),b=e.filter(function(t){return t.w===h});m.length>0&&m.forEach(function(e){var r=e.points[0],n=(r.x-c)/t.width+.5,o=(r.y-f)/t.height+.5;v.push([n,o]),e.baseEdgeList.forEach(function(t){var e=i.find(function(e){return e.source===t.v&&e.target===t.w});e&&(e.sourceAnchor=v.length-1)})}),b.length>0&&b.forEach(function(e){var r=e.points[e.points.length-1],n=(r.x-c)/t.width+.5,o=(r.y-f)/t.height+.5;v.push([n,o]),e.baseEdgeList.forEach(function(t){var e=i.find(function(e){return e.source===t.v&&e.target===t.w});e&&(e.targetAnchor=v.length-1)})}),n[y].anchorPoints=v.length>0?v:n[y].anchorPoints||[]}}})},e.prototype.updateEdgePosition=function(t,e){var r=this,n=r.combos,i=r.edges,s=r.controlPoints,l=this.getBegin(t,e);s&&(n.forEach(function(t){t.inEdges=[],t.outEdges=[]}),i.forEach(function(e){var i,s,c,f,h=t.find(function(t){return t.id===e.source}),p=t.find(function(t){return t.id===e.target}),d=[],y=[];if(h&&p)y=(0,u.getEdges)(null===h||void 0===h?void 0:h.id,null===p||void 0===p?void 0:p.id,t);else if(!h||!p){var g=r.getNodePath(e.source),v=r.getNodePath(e.target),m=g.reverse().slice(h?0:1).find(function(e){return t.find(function(t){return t.id===e})}),b=v.reverse().slice(p?0:1).find(function(e){return t.find(function(t){return t.id===e})});h=t.find(function(t){return t.id===m}),p=t.find(function(t){return t.id===b}),y=(0,u.getEdges)(null===h||void 0===h?void 0:h.id,null===p||void 0===p?void 0:p.id,t,{v:e.source,w:e.target})}if(d=(d=y.reduce(function(t,e){return a(a([],t,!0),e.points.map(function(t){return o(o({},t),{x:t.x+l[0],y:t.y+l[1]})}),!0)},[])).slice(1,-1),e.controlPoints=d,(null===p||void 0===p?void 0:p.type)===u.NodeType.META){var A=n.findIndex(function(t){return t.id===(null===p||void 0===p?void 0:p.id)});if(!n[A]||(null===(i=n[A].inEdges)||void 0===i?void 0:i.some(function(t){return t.source===h.id&&t.target===p.id})))return;null===(s=n[A].inEdges)||void 0===s||s.push({source:h.id,target:p.id,controlPoints:d})}if((null===h||void 0===h?void 0:h.type)===u.NodeType.META){A=n.findIndex(function(t){return t.id===(null===h||void 0===h?void 0:h.id)});if(!n[A]||(null===(c=n[A].outEdges)||void 0===c?void 0:c.some(function(t){return t.source===h.id&&t.target===p.id})))return;null===(f=n[A].outEdges)||void 0===f||f.push({source:h.id,target:p.id,controlPoints:d})}}))},e.prototype.getType=function(){return"dagreCompound"},e.prototype.getDataByOrder=function(t){return t.every(function(t){return void 0!==t.layoutOrder})||t.forEach(function(t,e){t.layoutOrder=e}),t.sort(function(t,e){return t.layoutOrder-e.layoutOrder})},e}(s.Base);e.DagreCompoundLayout=c},4804:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Graph=void 0;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(r(288).Graph);e.Graph=o},2016:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(2731)),o=r(2929);e.default={layout:i.default,util:{time:o.time,notime:o.notime}}},9441:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(4818)),o=function(t){var e=[],r={},n={};return t.nodes().forEach(function i(o){var a;n[o]||(n[o]=!0,r[o]=!0,null===(a=t.outEdges(o))||void 0===a||a.forEach(function(t){r[t.w]?e.push(t):i(t.w)}),delete r[o])}),e};e.default={run:function(t){var e="greedy"===t.graph().acyclicer?(0,i.default)(t,function(t){return function(e){var r;return(null===(r=t.edge(e))||void 0===r?void 0:r.weight)||1}}(t)):o(t);null===e||void 0===e||e.forEach(function(e){var r=t.edge(e);t.removeEdgeObj(e),r.forwardName=e.name,r.reversed=!0,t.setEdge(e.w,e.v,r,"rev-".concat(Math.random()))})},undo:function(t){t.edges().forEach(function(e){var r=t.edge(e);if(r.reversed){t.removeEdgeObj(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}}},3868:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2929),i=function(t,e,r,i,o,a){var s={rank:a,borderType:e,width:0,height:0},u=o[e][a-1],l=(0,n.addDummyNode)(t,"border",s,r);o[e][a]=l,t.setParent(l,i),u&&t.setEdge(u,l,{weight:1})};e.default=function(t){var e;null===(e=t.children())||void 0===e||e.forEach(function(e){return function e(r){var n=t.children(r),o=t.node(r);if((null===n||void 0===n?void 0:n.length)&&n.forEach(function(t){return e(t)}),o.hasOwnProperty("minRank")){o.borderLeft=[],o.borderRight=[];for(var a=o.minRank,s=o.maxRank+1;a0;--s)if(n=e[s].dequeue()){i=i.concat(h(t,e,r,n,!0));break}}return i},h=function(t,e,r,n,i){var o,a,s=[];return null===(o=t.inEdges(n.v))||void 0===o||o.forEach(function(n){var o=t.edge(n),a=t.node(n.v);i&&s.push({v:n.v,w:n.w,in:0,out:0}),void 0===a.out&&(a.out=0),a.out-=o,d(e,r,a)}),null===(a=t.outEdges(n.v))||void 0===a||a.forEach(function(n){var i=t.edge(n),o=n.w,a=t.node(o);void 0===a.in&&(a.in=0),a.in-=i,d(e,r,a)}),t.removeNode(n.v),i?s:void 0},p=function(t,e){var r=new l,n=0,i=0;t.nodes().forEach(function(t){r.setNode(t,{v:t,in:0,out:0})}),t.edges().forEach(function(t){var o=r.edge(t)||0,a=(null===e||void 0===e?void 0:e(t))||1,s=o+a;r.setEdge(t.v,t.w,s),i=Math.max(i,r.node(t.v).out+=a),n=Math.max(n,r.node(t.w).in+=a)});for(var o=[],a=i+n+3,s=0;s0;)e%2&&(r+=u[e+1]),u[e=e-1>>1]+=t.weight;l+=t.weight*r}}),l};e.default=function(t,e){for(var r=0,n=1;n<(null===e||void 0===e?void 0:e.length);n+=1)r+=i(t,e[n-1],e[n]);return r}},1422:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(9987)),o=n(r(1100)),a=n(r(7611)),s=n(r(9285)),u=n(r(5959)),l=r(864),c=r(4804),f=r(2929),h=function(t,e,r){return e.map(function(e){return(0,a.default)(t,e,r)})},p=function(t,e,r,n){var i=new c.Graph;null===t||void 0===t||t.forEach(function(t){for(var o,a=t.graph().root,l=(0,u.default)(t,a,i,e,r,n),c=0;c<(null===(o=l.vs)||void 0===o?void 0:o.length);c++){var f=t.node(l.vs[c]);f&&(f.order=c)}(0,s.default)(t,i,l.vs)})},d=function(t,e){null===e||void 0===e||e.forEach(function(e){null===e||void 0===e||e.forEach(function(e,r){t.node(e).order=r})})};e.default=function(t,e){for(var r=(0,f.maxRank)(t),n=[],a=[],s=1;s-1;s--)a.push(s);var u=h(t,n,"inEdges"),c=h(t,a,"outEdges"),y=(0,i.default)(t);d(t,y);for(var g,v=Number.POSITIVE_INFINITY,m=(s=0,0);m<4;++s,++m)p(s%2?u:c,s%4>=2,!1,e),y=(0,f.buildLayerMatrix)(t),(b=(0,o.default)(t,y))=2,!0,e),y=(0,f.buildLayerMatrix)(t),(b=(0,o.default)(t,y))=e.barycenter)&&n(e,t)})(t);var e}),null===(r=o.out)||void 0===r||r.forEach(function(e){return(r=o,function(e){e.in.push(r),0==--e.indegree&&t.push(e)})(e);var r})};null===t||void 0===t?void 0:t.length;)o();var a=["vs","i","barycenter","weight"];return i.filter(function(t){return!t.merged}).map(function(t){var e={};return null===a||void 0===a||a.forEach(function(r){void 0!==t[r]&&(e[r]=t[r])}),e})},n=function(t,e){var r,n=0,i=0;t.weight&&(n+=t.barycenter*t.weight,i+=t.weight),e.weight&&(n+=e.barycenter*e.weight,i+=e.weight),t.vs=null===(r=e.vs)||void 0===r?void 0:r.concat(t.vs),t.barycenter=n/i,t.weight=i,t.i=Math.min(e.i,t.i),e.merged=!0};e.default=function(t,e){var n,i,o,a={};null===t||void 0===t||t.forEach(function(t,e){a[t.v]={i:e,indegree:0,in:[],out:[],vs:[t.v]};var r=a[t.v];void 0!==t.barycenter&&(r.barycenter=t.barycenter,r.weight=t.weight)}),null===(n=e.edges())||void 0===n||n.forEach(function(t){var e=a[t.v],r=a[t.w];void 0!==e&&void 0!==r&&(r.indegree++,e.out.push(a[t.w]))});var s=null===(o=(i=Object.values(a)).filter)||void 0===o?void 0:o.call(i,function(t){return!t.indegree});return r(s)}},5959:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(4561)),o=n(r(7396)),a=n(r(572)),s=function(t,e){null===t||void 0===t||t.forEach(function(t){var r,n=null===(r=t.vs)||void 0===r?void 0:r.map(function(t){return e[t]?e[t].vs:t});t.vs=n.flat()})},u=function(t,e){void 0!==t.barycenter?(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight):(t.barycenter=e.barycenter,t.weight=e.weight)};e.default=function t(e,r,n,l,c,f){var h,p,d,y,g=e.children(r),v=e.node(r),m=v?v.borderLeft:void 0,b=v?v.borderRight:void 0,A={};m&&(g=null===g||void 0===g?void 0:g.filter(function(t){return t!==m&&t!==b}));var x=(0,i.default)(e,g||[]);null===x||void 0===x||x.forEach(function(r){var i;if(null===(i=e.children(r.v))||void 0===i?void 0:i.length){var o=t(e,r.v,n,l,f);A[r.v]=o,o.hasOwnProperty("barycenter")&&u(r,o)}});var w=(0,o.default)(x,n);s(w,A),null===(h=w.filter(function(t){return t.vs.length>0}))||void 0===h||h.forEach(function(t){var r=e.node(t.vs[0]);r&&(t.fixorder=r.fixorder,t.order=r.order)});var _=(0,a.default)(w,l,c,f);if(m&&(_.vs=[m,_.vs,b].flat(),null===(p=e.predecessors(m))||void 0===p?void 0:p.length)){var S=e.node((null===(d=e.predecessors(m))||void 0===d?void 0:d[0])||""),E=e.node((null===(y=e.predecessors(b))||void 0===y?void 0:y[0])||"");_.hasOwnProperty("barycenter")||(_.barycenter=0,_.weight=0),_.barycenter=(_.barycenter*_.weight+S.order+E.order)/(_.weight+2),_.weight+=2}return _}},572:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2929),i=function(t,e,r){for(var n,i=r;e.length&&(n=e[e.length-1]).i<=i;)e.pop(),null===t||void 0===t||t.push(n.vs),i++;return i},o=function(t,e){return function(r,n){if(void 0!==r.fixorder&&void 0!==n.fixorder)return r.fixorder-n.fixorder;if(r.barycentern.barycenter)return 1;if(e&&void 0!==r.order&&void 0!==n.order){if(r.ordern.order)return 1}return t?n.i-r.i:r.i-n.i}};e.default=function(t,e,r,a){var s=(0,n.partition)(t,function(t){var e=t.hasOwnProperty("fixorder")&&!isNaN(t.fixorder);return a?!e&&t.hasOwnProperty("barycenter"):e||t.hasOwnProperty("barycenter")}),u=s.lhs,l=s.rhs.sort(function(t,e){return-t.i- -e.i}),c=[],f=0,h=0,p=0;null===u||void 0===u||u.sort(o(!!e,!!r)),p=i(c,l,p),null===u||void 0===u||u.forEach(function(t){var e;p+=null===(e=t.vs)||void 0===e?void 0:e.length,c.push(t.vs),f+=t.barycenter*t.weight,h+=t.weight,p=i(c,l,p)});var d={vs:c.flat()};return h&&(d.barycenter=f/h,d.weight=h),d}},8011:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e,r=function(t){var e,r={},n=0;return null===(e=t.children())||void 0===e||e.forEach(function e(i){var o,a=n;null===(o=t.children(i))||void 0===o||o.forEach(e),r[i]={low:a,lim:n++}}),r}(t);null===(e=t.graph().dummyChains)||void 0===e||e.forEach(function(e){var n,i,o=e,a=t.node(o),s=a.edgeObj;if(s)for(var u=function(t,e,r,n){var i,o,a=[],s=[],u=Math.min(e[r].low,e[n].low),l=Math.max(e[r].lim,e[n].lim);i=r;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>u||l>e[i].lim));for(o=i,i=n;i&&i!==o;)s.push(i),i=t.parent(i);return{lca:o,path:a.concat(s.reverse())}}(t,r,s.v,s.w),l=u.path,c=u.lca,f=0,h=l[f],p=!0;o!==s.w;){if(a=t.node(o),p){for(;h!==c&&(null===(n=t.node(h))||void 0===n?void 0:n.maxRank)s)&&(0,e.addConflict)(n,r,c)}))}.apply(void 0,r),i.set(o,!0))}return(null===r||void 0===r?void 0:r.length)&&r.reduce(function(e,r){var n,o=-1,a=0,s=new Map;return null===r||void 0===r||r.forEach(function(u,l){var c;if("border"===(null===(c=t.node(u))||void 0===c?void 0:c.dummy)){var f=t.predecessors(u)||[];f.length&&(n=t.node(f[0]).order,i([r,a,l,o,n],s),a=l,o=n)}i([r,a,r.length,n,e.length],s)}),r}),n};e.findOtherInnerSegmentNode=function(t,e){var r,n;if(null===(r=t.node(e))||void 0===r?void 0:r.dummy)return null===(n=t.predecessors(e))||void 0===n?void 0:n.find(function(e){return t.node(e).dummy})};e.addConflict=function(t,e,r){var n=e,i=r;if(n>i){var o=n;n=i,i=o}var a=t[n];a||(t[n]=a={}),a[i]=!0};e.hasConflict=function(t,e,r){var n=e;n>r&&(n=r);return!!t[n]};e.verticalAlignment=function(t,r,n,i){var o={},a={},s={};return null===r||void 0===r||r.forEach(function(t){null===t||void 0===t||t.forEach(function(t,e){o[t]=t,a[t]=t,s[t]=e})}),null===r||void 0===r||r.forEach(function(t){var r=-1;null===t||void 0===t||t.forEach(function(t){var u=i(t);if(u.length)for(var l=((u=u.sort(function(t,e){return s[t]-s[e]})).length-1)/2,c=Math.floor(l),f=Math.ceil(l);c<=f;++c){var h=u[c];a[t]===t&&ru.lim&&(l=u,c=!0);var f=e.edges().filter(function(e){return c===p(t,t.node(e.v),l)&&c!==p(t,t.node(e.w),l)});return(0,o.minBy)(f,function(t){return(0,i.slack)(e,t)})};e.exchangeEdges=function(t,r,n,i){var o=n.v,a=n.w;t.removeEdge(o,a),t.setEdge(i.v,i.w,{}),(0,e.initLowLimValues)(t),(0,e.initCutValues)(t,r),f(t,r)};var f=function(t,e){var r=t.nodes().find(function(t){var r;return!(null===(r=e.node(t))||void 0===r?void 0:r.parent)}),n=s(t,r);null===(n=null===n||void 0===n?void 0:n.slice(1))||void 0===n||n.forEach(function(r){var n=t.node(r).parent,i=e.edgeFromArgs(r,n),o=!1;i||(i=e.edgeFromArgs(n,r),o=!0),e.node(r).rank=e.node(n).rank+(o?i.minlen:-i.minlen)})},h=function(t,e,r){return t.hasEdge(e,r)},p=function(t,e,r){return r.low<=e.lim&&e.lim<=r.lim};e.default=function(t){var r=(0,o.simplify)(t);(0,i.longestPath)(r);var a,s,u=(0,n.feasibleTree)(r);for((0,e.initLowLimValues)(u),(0,e.initCutValues)(u,r);a=(0,e.leaveEdge)(u);)s=(0,e.enterEdge)(u,r,a),(0,e.exchangeEdges)(u,r,a,s)}},4166:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.slack=e.longestPathWithLayer=e.longestPath=void 0;var r=function(t){var e,r={};null===(e=t.sources())||void 0===e||e.forEach(function(e){return function e(n){var i,o,a=t.node(n);return a?r[n]?a.rank:(r[n]=!0,null===(i=t.outEdges(n))||void 0===i||i.forEach(function(r){var n=e(r.w)-t.edge(r).minlen;n&&(void 0===o||nMath.abs(a)*l?(s<0&&(l=-l),r=l*a/s,n=l):(a<0&&(u=-u),r=u,n=u*s/a),{x:i+r,y:o+n}):{x:0,y:0}};e.buildLayerMatrix=function(t){for(var r=[],n=(0,e.maxRank)(t)+1,i=0;ie)&&(e=i)}),e||(e=0),e};e.partition=function(t,e){var r={lhs:[],rhs:[]};return null===t||void 0===t||t.forEach(function(t){e(t)?r.lhs.push(t):r.rhs.push(t)}),r};e.time=function(t,e){var r=Date.now();try{return e()}finally{console.log("".concat(t," time: ").concat(Date.now()-r,"ms"))}};e.notime=function(t,e){return e()};e.minBy=function(t,e){return t.reduce(function(t,r){return e(t)>e(r)?r:t})}},4077:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r1){var e=n({},t);delete e.size,s.push(e)}});var h=[];i.forEach(function(t){var e=s.find(function(e){return e.id===t.source}),r=s.find(function(e){return e.id===t.target});e&&r&&h.push(t)});var p=new f.DagreLayout({type:"dagre",ranksep:e.nodeMinGap,nodesep:e.nodeMinGap}).layout({nodes:s,edges:h}).nodes;r.forEach(function(t){var e=(p||[]).find(function(e){return e.id===t.id});t.x=(null===e||void 0===e?void 0:e.x)||o/2,t.y=(null===e||void 0===e?void 0:e.y)||a/2});var d=JSON.parse(JSON.stringify(r)),y=JSON.parse(JSON.stringify(i)),g=u.forceSimulation().nodes(d).force("link",u.forceLink(y).id(function(t){return t.id}).distance(function(t){return h.find(function(e){return e.source===t.source&&e.target===t.target})?30:20})).force("charge",u.forceManyBody()).force("center",u.forceCenter(o/2,a/2)).force("x",u.forceX(o/2)).force("y",u.forceY(a/2)).alpha(.3).alphaDecay(.08).alphaMin(.001);return new Promise(function(t){g.on("end",function(){r.forEach(function(t){var e=d.find(function(e){return e.id===t.id});e&&(t.x=e.x,t.y=e.y)});var n=Math.min.apply(Math,r.map(function(t){return t.x})),s=Math.max.apply(Math,r.map(function(t){return t.x})),u=Math.min.apply(Math,r.map(function(t){return t.y})),f=Math.max.apply(Math,r.map(function(t){return t.y})),h=o/(s-n),p=a/(f-u);r.forEach(function(t){void 0!==t.x&&h<1&&(t.x=(t.x-n)*h),void 0!==t.y&&p<1&&(t.y=(t.y-u)*p)}),r.forEach(function(t){t.sizeTemp=t.size,t.size=[10,10]}),(0,c.default)(r,i),r.forEach(function(t){t.size=t.sizeTemp||[],delete t.sizeTemp}),(0,l.default)({nodes:r,edges:i},e),t()})})}},5791:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(2558));e.default=function(t,e){if(!t.nodes||0===t.nodes.length)return t;var r=e.width,n=e.height,o=e.nodeMinGap,a=1e4,s=1e4;t.nodes.forEach(function(t){var e=t.size[0]||50,r=t.size[1]||50;a=Math.min(e,a),s=Math.min(r,s)});var u=new i.default;u.init(r,n,{CELL_H:s,CELL_W:a}),t.nodes.forEach(function(t){var e=u.occupyNearest(t);e&&(e.node={id:t.id,size:t.size},t.x=e.x,t.y=e.y,t.dx=e.dx,t.dy=e.dy)});for(var l=0;la){for(var d=g=Math.ceil((c.size[0]+o)/a)-1,y=0;y-1&&!u.cells[h+y+1][p].node);y++)d--;u.insertColumn(h,d)}if(c.size[1]+o>s){var g;for(d=g=Math.ceil((c.size[1]+o)/s)-1,y=0;y-1&&!u.cells[h][p+y+1].node);y++)d--;u.insertRow(p,d)}}for(l=0;lt;n--)for(i=0;i=t&&(this.additionColumn[i]+=e);for(n=0;nt;n--)this.cells[i][n+e]=r(r({},this.cells[i][n]),{dx:i,dy:n+e,x:i*this.CELL_W,y:(n+e)*this.CELL_H}),this.cells[i][n]={dx:i,dy:n,x:i*this.CELL_W,y:n*this.CELL_H,occupied:!1,node:null};for(n=0;n=t&&(this.additionRow[n]+=e);for(i=0;ia?e:t,h=n>a?t:e,p=f.x-f.size[0]/2,d=f.y-f.size[1]/2,y=f.x+f.size[0]/2,g=f.y+f.size[1]/2,v=h.x-h.size[0]/2,m=h.y-h.size[1]/2,b=h.x+h.size[0]/2,A=h.y+h.size[1]/2,x=f.x,w=f.y,_=h.x,S=h.y,E=0,C=0;if(y>=v&&b>=p&&g>=m&&A>=d){0===(C=Math.sqrt(Math.pow(_-x,2)+Math.pow(S-w,2)))&&(C=1e-7),E=1*o/C*100+((yv?p:v))*((gm?d:m)),E*=i}else{var k=!1,I=function(t,e,r){var n=t.x-t.size[0]/2,i=t.y-t.size[1]/2,o=t.x+t.size[0]/2,a=t.y+t.size[1]/2,c=e.x-e.size[0]/2,f=e.y-e.size[1]/2,h=e.x+e.size[0]/2,p=e.y+e.size[1]/2,d=t.x,y=t.y,g=e.x,v=e.y,m=g-d,b=Math.atan2(m,v-y),A=0,x=0,w=0,_=0;b>s?(x=i-p,A=c-o,w=parseFloat(x?(x/Math.cos(b)).toFixed(2):A.toFixed(2)),_=parseFloat(A?(A/Math.sin(b)).toFixed(2):x.toFixed(2))):w=_=0(A=c-o)?parseFloat(x?(x/Math.cos(b)).toFixed(2):A.toFixed(2)):parseFloat(A?(A/Math.sin(b)).toFixed(2):x.toFixed(2)):b<-s?(x=i-p)>(A=-(h-n))?parseFloat(x?(x/Math.cos(b)).toFixed(2):A.toFixed(2)):parseFloat(A?(A/Math.sin(b)).toFixed(2):x.toFixed(2)):(x=f-a)>(A=Math.abs(m)>(o-n)/2?n-h:m)?parseFloat(x?(x/Math.cos(b)).toFixed(2):A.toFixed(2)):parseFloat(A&&0!==b?(A/Math.sin(b)).toFixed(2):x.toFixed(2));var S=parseFloat(b.toFixed(2)),E=r;return r&&(E=ur||o.y>n)&&(e+=1e12);for(var a=i+1;a150)&&!(c<30||c>150)||l*c<0){a=!1;break}if(l>70&&l<110&&!(c>70&&c<110)||l*c<0){a=!1;break}if((u.x-t.x)*(u.x-e.x)<0){a=!1;break}if((u.y-t.y)*(u.y-e.y)<0){a=!1;break}}return a}function b(t,e){for(var r=!1,n=1*f,i=1*h,o=[n,-n,0,0],a=[0,0,i,-i],s=0;sd?(l=g,r=!0):(u.x-=o[c],u.y-=a[c])}}return p>d&&(p*=y),r?v(t):0}function A(t,e){var i=0;(t.x<0||t.y<0||t.x+t.size[0]+20>r||t.y+t.size[1]+20>n)&&(i+=1e12);for(var o=0;o0&&!(++a>=50);){var s=b(t,e);0!==s&&(o=s),i=o-r,r=o,0===i?--n:n=20}return t.forEach(function(t){t.x=t.x-t.size[0]/2,t.y=t.y-t.size[1]/2}),{nodes:t,edges:e}}},7333:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forceNBody=void 0;var n=r(3487);function i(t){var e=0,r=0,n=0;if(t.length){for(var i=0;i<4;i++){(o=t[i])&&o.weight&&(e+=o.weight,r+=o.x*o.weight,n+=o.y*o.weight)}t.x=r/e,t.y=n/e,t.weight=e}else{var o=t;t.x=o.data.x,t.y=o.data.y,t.weight=o.data.weight}}e.forceNBody=function(t,e,r,a,s){var u=r/a,l=t.map(function(t,r){var n=e[t.id],i=n.data,o=n.x,a=n.y,s=n.size,l=i.layout.force.nodeStrength;return{x:o,y:a,size:s,index:r,vx:0,vy:0,weight:u*l}}),c=(0,n.quadtree)(l,function(t){return t.x},function(t){return t.y}).visitAfter(i);return l.forEach(function(t){!function(t,e){e.visit(function(e,r,n,i,a){return o(e,r,n,i,a,t)})}(t,c)}),l.map(function(r,n){var i=e[t[n].id].data.layout.force.mass,o=void 0===i?1:i;s[2*n]=r.vx/o,s[2*n+1]=r.vy/o}),s};var o=function(t,e,r,n,i,o){var a=o.x-t.x||.1,s=o.y-t.y||.1,u=n-e,l=a*a+s*s,c=Math.sqrt(l)*l;if(u*u*.811&&(o=(0,s.getAvgNodePosition)(l))}else o=void 0;return{x:null===o||void 0===o?void 0:o.x,y:null===o||void 0===o?void 0:o.y}}}}if(n){t||(t=this.getSameTypeLeafMap());var p={};Array.from(new Set(a.map(function(t,e){return t[i]}))).filter(function(t){return void 0!==t}).forEach(function(t){var e=a.filter(function(e){return e[i]===t}).map(function(t){return u[t.id]});p[t]=(0,s.getAvgNodePosition)(e)}),f={single:function(t){return c(t)},leaf:function(t){return c(t)},others:function(t){return c(t)},center:function(t,e,r){var n=p[t[i]];return{x:null===n||void 0===n?void 0:n.x,y:null===n||void 0===n?void 0:n.y}}}}this.centripetalOptions=o(o({},this.centripetalOptions),f);var d=this.centripetalOptions,y=d.leaf,g=d.single,v=d.others;y&&"function"!=typeof y&&(this.centripetalOptions.leaf=function(){return y}),g&&"function"!=typeof g&&(this.centripetalOptions.single=function(){return g}),v&&"function"!=typeof v&&(this.centripetalOptions.others=function(){return v})},e.prototype.updateCfg=function(t){t&&Object.assign(this,t)},e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t=this;t.stop();var e=t.nodes,r=t.edges,n=t.defSpringLen;if(t.judgingDistance=0,e&&0!==e.length){t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var i=t.center;if(1===e.length)return e[0].x=i[0],e[0].y=i[1],void t.onLayoutEnd([o({},e[0])]);t.degreesMap=(0,s.getDegreeMap)(e,r),t.propsGetMass?t.getMass=t.propsGetMass:t.getMass=function(e){var r=1;(0,s.isNumber)(e.mass)&&(r=e.mass);var n=t.degreesMap[e.id].all;return!n||n<5?r:5*n*r};var a,u=t.nodeSize;if(t.preventOverlap){var c,f=t.nodeSpacing;c=(0,s.isNumber)(f)?function(){return f}:(0,s.isFunction)(f)?f:function(){return 0},a=u?(0,s.isArray)(u)?function(t){return Math.max(u[0],u[1])+c(t)}:function(t){return u+c(t)}:function(t){return t.size?(0,s.isArray)(t.size)?Math.max(t.size[0],t.size[1])+c(t):(0,s.isObject)(t.size)?Math.max(t.size.width,t.size.height)+c(t):t.size+c(t):10+c(t)}}t.nodeSize=a,t.linkDistance=l(t.linkDistance,1),t.nodeStrength=l(t.nodeStrength,1),t.edgeStrength=l(t.edgeStrength,1);var h={},p={};e.forEach(function(e,n){(0,s.isNumber)(e.x)||(e.x=Math.random()*t.width),(0,s.isNumber)(e.y)||(e.y=Math.random()*t.height);var i=t.degreesMap[e.id];h[e.id]=o(o({},e),{data:o(o({},e.data),{size:t.nodeSize(e)||30,layout:{inDegree:i.in,outDegree:i.out,degree:i.all,tDegree:i.in,sDegree:i.out,force:{mass:t.getMass(e),nodeStrength:t.nodeStrength(e,r)}}})}),p[e.id]=n}),t.nodeMap=h,t.nodeIdxMap=p,t.edgeInfos=[],null===r||void 0===r||r.forEach(function(e){var r=h[e.source],i=h[e.target];r&&i?t.edgeInfos.push({edgeStrength:t.edgeStrength(e),linkDistance:n?n(o(o({},e),{source:r,target:i}),r,i):t.linkDistance(e,r,i)||1+(u(r)+u(r)||0)/2}):elf.edgeInfos.push({})}),this.getCentripetalOptions(),t.onLayoutEnd=t.onLayoutEnd||function(){},t.run()}else t.onLayoutEnd([])},e.prototype.run=function(){var t=this,e=t.maxIteration,r=t.nodes,n=t.edges,i=t.workerEnabled,o=t.minMovement,a=t.animate,s=t.nodeMap,u=t.height;if(t.currentMinY=0,t.currentMaxY=u,r){var l=[];if(r.forEach(function(t,e){l[2*e]=0,l[2*e+1]=0}),this.defSideCoe&&"function"==typeof this.defSideCoe){var c={};n.forEach(function(t){var e=t.source,r=t.target;c[e]=c[e]||[],c[e].push(t),c[r]=c[r]||[],c[r].push(t)}),this.relatedEdges=c}var f=e;if(i||!a){for(var h=0;(t.judgingDistance>o||h<1)&&h=f||t.judgingDistanceo){var c=o/l;s*=c,u*=c}e[2*a]=s,e[2*a+1]=u})},e.prototype.updatePosition=function(t,e){var r=this,n=r.nodes,i=r.distanceThresholdMode,o=r.nodeMap;if(null===n||void 0===n?void 0:n.length){var a=0;"max"===i?r.judgingDistance=-1/0:"min"===i&&(r.judgingDistance=1/0);var u=1/0,l=-1/0;n.forEach(function(n,c){var f=o[n.id];if((0,s.isNumber)(n.fx)&&(0,s.isNumber)(n.fy))return n.x=n.fx,n.y=n.fy,f.x=n.x,void(f.y=n.y);var h=t[2*c]*e,p=t[2*c+1]*e;n.x+=h,n.y+=p,f.x=n.x,f.y=n.y,n.yl&&(l=n.y);var d=Math.sqrt(h*h+p*p);switch(i){case"max":r.judgingDistanced&&(r.judgingDistance=d);break;default:a+=d}}),this.currentMinY=u,this.currentMaxY=l,i&&"mean"!==i||(r.judgingDistance=a/n.length)}else this.judgingDistance=0},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){this.stop(),this.tick=null,this.nodes=null,this.edges=null,this.destroyed=!0},e.prototype.getType=function(){return"force2"},e.prototype.getSameTypeLeafMap=function(){var t=this,e=t.nodeClusterBy,r=t.nodes,n=t.edges,i=t.nodeMap,o=t.degreesMap;if(null===r||void 0===r?void 0:r.length){var a={};return r.forEach(function(t,r){1===o[t.id].all&&(a[t.id]=(0,s.getCoreNodeAndRelativeLeafNodes)("leaf",t,n,e,o,i))}),a}},e}(a.Base);e.Force2Layout=c},5257:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.id=t.id||0,this.rx=t.rx,this.ry=t.ry,this.fx=0,this.fy=0,this.mass=t.mass,this.degree=t.degree,this.g=t.g||0}return t.prototype.distanceTo=function(t){var e=this.rx-t.rx,r=this.ry-t.ry;return Math.hypot(e,r)},t.prototype.setPos=function(t,e){this.rx=t,this.ry=e},t.prototype.resetForce=function(){this.fx=0,this.fy=0},t.prototype.addForce=function(t){var e=t.rx-this.rx,r=t.ry-this.ry,n=Math.hypot(e,r);n=n<1e-4?1e-4:n;var i=this.g*(this.degree+1)*(t.degree+1)/n;this.fx+=i*e/n,this.fy+=i*r/n},t.prototype.in=function(t){return t.contains(this.rx,this.ry)},t.prototype.add=function(e){var r=this.mass+e.mass;return new t({rx:(this.rx*this.mass+e.rx*e.mass)/r,ry:(this.ry*this.mass+e.ry*e.mass)/r,mass:r,degree:this.degree+e.degree})},t}();e.default=r},3209:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ForceAtlas2Layout=void 0;var a=r(8933),s=r(864),u=o(r(5257)),l=o(r(5138)),c=o(r(5490)),f=function(t){function e(e){var r=t.call(this)||this;return r.center=[0,0],r.width=300,r.height=300,r.nodes=[],r.edges=[],r.kr=5,r.kg=1,r.mode="normal",r.preventOverlap=!1,r.dissuadeHubs=!1,r.barnesHut=void 0,r.maxIteration=0,r.ks=.1,r.ksmax=10,r.tao=.1,r.onLayoutEnd=function(){},r.prune=void 0,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.execute=function(){var t=this.nodes,e=this.onLayoutEnd,r=this.prune,n=this.maxIteration;this.width||"undefined"==typeof window||(this.width=window.innerWidth),this.height||"undefined"==typeof window||(this.height=window.innerHeight);for(var i=[],o=t.length,a=0;a250&&(this.barnesHut=!0),void 0===this.prune&&o>100&&(this.prune=!0),0!==this.maxIteration||this.prune?0===this.maxIteration&&r&&(n=100,o<=200&&o>100?n=500:o>200&&(n=950),this.maxIteration=n):(n=250,o<=200&&o>100?n=1e3:o>200&&(n=1200),this.maxIteration=n),this.kr||(this.kr=50,o>100&&o<=500?this.kr=20:o>500&&(this.kr=1)),this.kg||(this.kg=20,o>100&&o<=500?this.kg=10:o>500&&(this.kg=1)),this.nodes=this.updateNodesByForces(i),e()},e.prototype.updateNodesByForces=function(t){for(var e=this.edges,r=this.maxIteration,n=this.nodes,i=e.filter(function(t){return(0,s.getEdgeTerminal)(t,"source")!==(0,s.getEdgeTerminal)(t,"target")}),o=n.length,a=i.length,u=[],l={},c={},f=[],h=0;h0;){for(v=0;v50||!l)?this.getOptRepGraForces(d,g,i):this.getRepGraForces(p,50,d,100,o,i);var b=this.updatePos(d,y,h,i);a=b.nodes,h=b.sg,p--,this.tick&&this.tick()}return a},e.prototype.getAttrForces=function(t,e,r,n,i,o,a,s){for(var u=this.nodes,l=this.preventOverlap,c=this.dissuadeHubs,f=this.mode,h=this.prune,p=0;p0&&(A=b,x=b),s[2*n[d.id]]+=A*m[0],s[2*n[g.id]]-=x*m[0],s[2*n[d.id]+1]+=A*m[1],s[2*n[g.id]+1]-=x*m[1]}}return s},e.prototype.getRepGraForces=function(t,e,r,n,i,o){for(var a=this.nodes,s=this.preventOverlap,u=this.kr,l=this.kg,c=this.center,f=this.prune,h=a.length,p=0;p0&&(v=u*(o[p]+1)*(o[d]+1)/g),r[2*p]-=v*y[0],r[2*d]+=v*y[0],r[2*p+1]-=v*y[1],r[2*d+1]+=v*y[1]}var m=[a[p].x-c[0],a[p].y-c[1]],b=Math.hypot(m[0],m[1]);m[0]=m[0]/b,m[1]=m[1]/b;var A=l*(o[p]+1);r[2*p]-=A*m[0],r[2*p+1]-=A*m[1]}return r},e.prototype.getOptRepGraForces=function(t,e,r){for(var n=this.nodes,i=this.kg,o=this.center,a=this.prune,s=n.length,u=9e10,f=-9e10,h=9e10,p=-9e10,d=0;d=f&&(f=n[d].x),n[d].x<=u&&(u=n[d].x),n[d].y>=p&&(p=n[d].y),n[d].y<=h&&(h=n[d].y));var y={xmid:(f+u)/2,ymid:(p+h)/2,length:Math.max(f-u,p-h),massCenter:o,mass:s},g=new l.default(y),v=new c.default(g);for(d=0;d1.5*A?1.5*A:r);for(y=0;y_?_:x)*t[2*y],E=x*t[2*y+1];i[y].x+=S,i[y].y+=E}return{nodes:i,sg:r}},e}(a.Base);e.ForceAtlas2Layout=f},5138:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.xmid=t.xmid,this.ymid=t.ymid,this.length=t.length,this.massCenter=t.massCenter||[0,0],this.mass=t.mass||1}return t.prototype.getLength=function(){return this.length},t.prototype.contains=function(t,e){var r=this.length/2;return t<=this.xmid+r&&t>=this.xmid-r&&e<=this.ymid+r&&e>=this.ymid-r},t.prototype.NW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.NE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.SW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t.prototype.SE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t}();e.default=r},5490:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,null!=t&&(this.quad=t)}return t.prototype.insert=function(e){null!=this.body?this._isExternal()?(this.quad&&(this.NW=new t(this.quad.NW()),this.NE=new t(this.quad.NE()),this.SW=new t(this.quad.SW()),this.SE=new t(this.quad.SE())),this._putBody(this.body),this._putBody(e),this.body=this.body.add(e)):(this.body=this.body.add(e),this._putBody(e)):this.body=e},t.prototype._putBody=function(t){this.quad&&(t.in(this.quad.NW())&&this.NW?this.NW.insert(t):t.in(this.quad.NE())&&this.NE?this.NE.insert(t):t.in(this.quad.SW())&&this.SW?this.SW.insert(t):t.in(this.quad.SE())&&this.SE&&this.SE.insert(t))},t.prototype._isExternal=function(){return null==this.NW&&null==this.NE&&null==this.SW&&null==this.SE},t.prototype.updateForce=function(t){null!=this.body&&t!==this.body&&(this._isExternal()?t.addForce(this.body):(this.quad?this.quad.getLength():0)/this.body.distanceTo(t)-1||(e[n]=t[n])}),e}),this.ticking=!1},e.prototype.execute=function(t){var e=this,r=e.nodes,n=e.edges;if(!e.ticking){var i=e.forceSimulation,o=e.alphaMin,a=e.alphaDecay,s=e.alpha;if(i){if(t)if(e.clustering&&e.clusterForce&&(e.clusterForce.nodes(r),e.clusterForce.links(n)),i.nodes(r),n&&e.edgeForce)e.edgeForce.links(n);else if(n&&!e.edgeForce){h=l.forceLink().id(function(t){return t.id}).links(n);e.edgeStrength&&h.strength(e.edgeStrength),e.linkDistance&&h.distance(e.linkDistance),e.edgeForce=h,i.force("link",h)}e.preventOverlap&&e.overlapProcess(i),i.alpha(s).restart(),this.ticking=!0}else try{var u=l.forceManyBody();if(e.nodeStrength&&u.strength(e.nodeStrength),i=l.forceSimulation().nodes(r),e.clustering){var f=(0,c.default)();f.centerX(e.center[0]).centerY(e.center[1]).template("force").strength(e.clusterFociStrength),n&&f.links(n),r&&f.nodes(r),f.forceLinkDistance(e.clusterEdgeDistance).forceLinkStrength(e.clusterEdgeStrength).forceCharge(e.clusterNodeStrength).forceNodeSize(e.clusterNodeSize),e.clusterForce=f,i.force("group",f)}if(i.force("center",l.forceCenter(e.center[0],e.center[1])).force("charge",u).alpha(s).alphaDecay(a).alphaMin(o),e.preventOverlap&&e.overlapProcess(i),n){var h=l.forceLink().id(function(t){return t.id}).links(n);e.edgeStrength&&h.strength(e.edgeStrength),e.linkDistance&&h.distance(e.linkDistance),e.edgeForce=h,i.force("link",h)}if(e.workerEnabled&&!y()&&(e.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),e.workerEnabled){i.stop();for(var d=function(t){var e=t.alphaMin(),r=t.alphaTarget(),n=t.alpha(),i=Math.log((e-r)/(n-r))/Math.log(1-t.alphaDecay());return Math.ceil(i)}(i),g=1;g<=d;g++)i.tick(),postMessage({nodes:r,currentTick:g,totalTicks:d,type:p.LAYOUT_MESSAGE.TICK},void 0);e.ticking=!1}else i.on("tick",function(){e.tick()}).on("end",function(){e.ticking=!1,e.onLayoutEnd&&e.onLayoutEnd()}),e.ticking=!0;e.forceSimulation=i,e.ticking=!0}catch(t){e.ticking=!1,console.warn(t)}}},e.prototype.overlapProcess=function(t){var e,r,n=this.nodeSize,i=this.nodeSpacing,o=this.collideStrength;if(r=(0,f.isNumber)(i)?function(){return i}:(0,f.isFunction)(i)?i:function(){return 0},n)if((0,f.isFunction)(n))e=function(t){return n(t)+r(t)};else if((0,f.isArray)(n)){var a=(n[0]>n[1]?n[0]:n[1])/2;e=function(t){return a+r(t)}}else if((0,f.isNumber)(n)){var s=n/2;e=function(t){return s+r(t)}}else e=function(){return 10};else e=function(t){return t.size?(0,f.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2+r(t):(0,f.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2+r(t):t.size/2+r(t):10+r(t)};t.force("collisionForce",l.forceCollide(e).strength(o))},e.prototype.updateCfg=function(t){this.ticking&&(this.forceSimulation.stop(),this.ticking=!1),this.forceSimulation=null,Object.assign(this,t)},e.prototype.destroy=function(){this.ticking&&(this.forceSimulation.stop(),this.ticking=!1),this.nodes=null,this.edges=null,this.destroyed=!0},e}(h.Base);function y(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}e.ForceLayout=d},574:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&("get"in i?e.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(5989),e)},6983:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.FruchtermanLayout=void 0;var o=r(8933),a=r(864),s=function(t){function e(e){var r=t.call(this)||this;return r.maxIteration=1e3,r.workerEnabled=!1,r.gravity=10,r.speed=5,r.clustering=!1,r.clusterGravity=10,r.nodes=[],r.edges=[],r.width=300,r.height=300,r.nodeMap={},r.nodeIdxMap={},r.onLayoutEnd=function(){},r.tick=function(){},r.animate=!0,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10,animate:!0}},e.prototype.execute=function(){var t,e,r=this,n=this.nodes;if(void 0!==this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval),n&&0!==n.length){this.width||"undefined"==typeof window||(this.width=window.innerWidth),this.height||"undefined"==typeof window||(this.height=window.innerHeight),this.center||(this.center=[this.width/2,this.height/2]);var i=this.center;if(1===n.length)return n[0].x=i[0],n[0].y=i[1],void(null===(e=this.onLayoutEnd)||void 0===e||e.call(this));var o={},s={};return n.forEach(function(t,e){(0,a.isNumber)(t.x)||(t.x=Math.random()*r.width),(0,a.isNumber)(t.y)||(t.y=Math.random()*r.height),o[t.id]=t,s[t.id]=e}),this.nodeMap=o,this.nodeIdxMap=s,this.run()}null===(t=this.onLayoutEnd)||void 0===t||t.call(this)},e.prototype.run=function(){var t,e=this,r=e.nodes;if(r){var n=e.edges,i=e.maxIteration,o=e.workerEnabled,a=e.clustering,s=e.animate,u={};if(a&&r.forEach(function(t){void 0===u[t.cluster]&&(u[t.cluster]={name:t.cluster,cx:0,cy:0,count:0})}),o||!s){for(var l=0;l=i&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval))},0)}return{nodes:r,edges:n}}},e.prototype.runOneStep=function(t){var e,r=this.nodes;if(r){var n=this.edges,i=this.center,o=this.gravity,s=this.speed,u=this.clustering,l=this.height*this.width,c=Math.sqrt(l)/10,f=l/(r.length+1),h=Math.sqrt(f),p=[];if(r.forEach(function(t,e){p[e]={x:0,y:0}}),this.applyCalculate(r,n,p,h,f),u){for(var d in t)t[d].cx=0,t[d].cy=0,t[d].count=0;for(var d in r.forEach(function(e){var r=t[e.cluster];(0,a.isNumber)(e.x)&&(r.cx+=e.x),(0,a.isNumber)(e.y)&&(r.cy+=e.y),r.count++}),t)t[d].cx/=t[d].count,t[d].cy/=t[d].count;var y=this.clusterGravity||o;r.forEach(function(e,r){if((0,a.isNumber)(e.x)&&(0,a.isNumber)(e.y)){var n=t[e.cluster],i=Math.sqrt((e.x-n.cx)*(e.x-n.cx)+(e.y-n.cy)*(e.y-n.cy)),o=h*y;p[r].x-=o*(e.x-n.cx)/i,p[r].y-=o*(e.y-n.cy)/i}})}r.forEach(function(t,e){if((0,a.isNumber)(t.x)&&(0,a.isNumber)(t.y)){var r=.01*h*o;p[e].x-=r*(t.x-i[0]),p[e].y-=r*(t.y-i[1])}}),r.forEach(function(t,e){if((0,a.isNumber)(t.fx)&&(0,a.isNumber)(t.fy))return t.x=t.fx,void(t.y=t.fy);if((0,a.isNumber)(t.x)&&(0,a.isNumber)(t.y)){var r=Math.sqrt(p[e].x*p[e].x+p[e].y*p[e].y);if(r>0){var n=Math.min(c*(s/800),r);t.x+=p[e].x/r*n,t.y+=p[e].y/r*n}}}),null===(e=this.tick)||void 0===e||e.call(this)}},e.prototype.applyCalculate=function(t,e,r,n,i){this.calRepulsive(t,r,i),e&&this.calAttractive(e,r,n)},e.prototype.calRepulsive=function(t,e,r){t.forEach(function(n,i){e[i]={x:0,y:0},t.forEach(function(t,o){if(i!==o&&(0,a.isNumber)(n.x)&&(0,a.isNumber)(t.x)&&(0,a.isNumber)(n.y)&&(0,a.isNumber)(t.y)){var s=n.x-t.x,u=n.y-t.y,l=s*s+u*u;if(0===l){l=1;var c=i>o?1:-1;s=.01*c,u=.01*c}var f=r/l;e[i].x+=s*f,e[i].y+=u*f}})})},e.prototype.calAttractive=function(t,e,r){var n=this;t.forEach(function(t){var i=(0,a.getEdgeTerminal)(t,"source"),o=(0,a.getEdgeTerminal)(t,"target");if(i&&o){var s=n.nodeIdxMap[i],u=n.nodeIdxMap[o];if(s!==u){var l=n.nodeMap[i],c=n.nodeMap[o];if((0,a.isNumber)(c.x)&&(0,a.isNumber)(l.x)&&(0,a.isNumber)(c.y)&&(0,a.isNumber)(l.y)){var f=c.x-l.x,h=c.y-l.y,p=Math.sqrt(f*f+h*h),d=p*p/r;e[u].x-=f/p*d,e[u].y-=h/p*d,e[s].x+=f/p*d,e[s].y+=h/p*d}}}})},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){this.stop(),this.tick=null,this.nodes=null,this.edges=null,this.destroyed=!0},e.prototype.getType=function(){return"fruchterman"},e}(o.Base);e.FruchtermanLayout=s},4600:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.GForceLayout=void 0;var o=r(8933),a=r(864),s=function(t,e){return t?(0,a.isNumber)(t)?function(e){return t}:t:function(t){return e||1}},u=function(t){function e(e){var r=t.call(this)||this;return r.maxIteration=500,r.workerEnabled=!1,r.edgeStrength=200,r.nodeStrength=1e3,r.coulombDisScale=.005,r.damping=.9,r.maxSpeed=1e3,r.minMovement=.5,r.interval=.02,r.factor=1,r.linkDistance=1,r.gravity=10,r.preventOverlap=!0,r.collideStrength=1,r.tick=function(){},r.nodes=[],r.edges=[],r.width=300,r.height=300,r.nodeMap={},r.nodeIdxMap={},r.animate=!0,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t,e,r=this,n=r.nodes;if(void 0!==r.timeInterval&&"undefined"!=typeof window&&window.clearInterval(r.timeInterval),n&&0!==n.length){r.width||"undefined"==typeof window||(r.width=window.innerWidth),r.height||"undefined"==typeof window||(r.height=window.innerHeight),r.center||(r.center=[r.width/2,r.height/2]);var i=r.center;if(1===n.length)return n[0].x=i[0],n[0].y=i[1],void(null===(e=r.onLayoutEnd)||void 0===e||e.call(r));var o={},u={};n.forEach(function(t,e){(0,a.isNumber)(t.x)||(t.x=Math.random()*r.width),(0,a.isNumber)(t.y)||(t.y=Math.random()*r.height),o[t.id]=t,u[t.id]=e}),r.nodeMap=o,r.nodeIdxMap=u,r.linkDistance=s(r.linkDistance,1),r.nodeStrength=s(r.nodeStrength,1),r.edgeStrength=s(r.edgeStrength,1);var l,c=r.nodeSize;if(r.preventOverlap){var f,h=r.nodeSpacing;f=(0,a.isNumber)(h)?function(){return h}:(0,a.isFunction)(h)?h:function(){return 0},l=c?(0,a.isArray)(c)?function(t){return Math.max(c[0],c[1])+f(t)}:function(t){return c+f(t)}:function(t){return t.size?(0,a.isArray)(t.size)?Math.max(t.size[0],t.size[1])+f(t):(0,a.isObject)(t.size)?Math.max(t.size.width,t.size.height)+f(t):t.size+f(t):10+f(t)}}r.nodeSize=l;var p=r.edges;r.degrees=(0,a.getDegree)(n.length,r.nodeIdxMap,p),r.getMass||(r.getMass=function(t){return t.mass||r.degrees[r.nodeIdxMap[t.id]].all||1}),r.run()}else null===(t=r.onLayoutEnd)||void 0===t||t.call(r)},e.prototype.run=function(){var t,e=this,r=e.maxIteration,n=e.nodes,i=e.workerEnabled,o=e.minMovement,a=e.animate;if(n)if(i||!a){for(var s=0;s=r&&(null===(i=e.onLayoutEnd)||void 0===i||i.call(e),window.clearInterval(e.timeInterval))}},0)}},e.prototype.reachMoveThreshold=function(t,e,r){var n=0;return t.forEach(function(t,r){var i=t.x-e[r].x,o=t.y-e[r].y;n+=Math.sqrt(i*i+o*o)}),(n/=t.length)=h)){var p=a.x-e.x,d=a.y-e.y;0===p&&0===d&&(p=.01*Math.random(),d=.01*Math.random());var y=p*p+d*d,g=Math.sqrt(y),v=(g+.1)*i,m=p/g,b=d/g,A=.5*(u(a)+u(e))*n/(v*v),x=r?r(e):1;if(t[2*c]+=m*A,t[2*c+1]+=b*A,t[2*h]-=m*A,t[2*h+1]-=b*A,o&&(l(a)+l(e))/2>g){var w=s*(u(a)+u(e))*.5/y;t[2*c]+=m*w/f,t[2*c+1]+=b*w/f,t[2*h]-=m*w/x,t[2*h+1]-=b*w/x}}})})},e.prototype.calAttractive=function(t,e){var r=this.nodeMap,n=this.nodeIdxMap,i=this.linkDistance,o=this.edgeStrength,s=this.nodeSize,u=this.getMass;e.forEach(function(e,l){var c=(0,a.getEdgeTerminal)(e,"source"),f=(0,a.getEdgeTerminal)(e,"target"),h=r[c],p=r[f],d=p.x-h.x,y=p.y-h.y;0===d&&0===y&&(d=.01*Math.random(),y=.01*Math.random());var g=Math.sqrt(d*d+y*y),v=d/g,m=y/g,b=((i(e,h,p)||1+(s(h)+s(p)||0)/2)-g)*o(e),A=n[c],x=n[f],w=u?u(h):1,_=u?u(p):1;t[2*A]-=v*b/w,t[2*A+1]-=m*b/w,t[2*x]+=v*b/_,t[2*x+1]+=m*b/_})},e.prototype.calGravity=function(t,e){for(var r=this.center,n=this.gravity,i=this.degrees,o=e.length,s=0;si.maxSpeed){var l=i.maxSpeed/u;a*=l,s*=l}e[2*n]=a,e[2*n+1]=s})},e.prototype.updatePosition=function(t,e,r){r.forEach(function(r,n){if((0,a.isNumber)(r.fx)&&(0,a.isNumber)(r.fy))return r.x=r.fx,void(r.y=r.fy);var i=t[2*n]*e,o=t[2*n+1]*e;r.x+=i,r.y+=o})},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){this.stop(),this.tick=null,this.nodes=null,this.edges=null,this.destroyed=!0},e.prototype.getType=function(){return"gForce"},e}(o.Base);e.GForceLayout=u},8834:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}u((n=n.apply(t,e||[])).next())})},a=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]t.cells)((A=t.small())-1)*(b=t.large())>=t.cells?t.small(A-1):(b-1)*A>=t.cells&&t.large(b-1);else for(;t.cols*t.rows=t.cells?t.large(b+1):t.small(A+1)}if(t.cellWidth=s/t.cols,t.cellHeight=u/t.rows,l&&(t.cellWidth=0,t.cellHeight=0),f||h){var x=(0,o.getFuncByUnknownType)(10,h),w=(0,o.getFuncByUnknownType)(30,p,!1);d.forEach(function(e){e.x&&e.y||(e.x=0,e.y=0);var r,n,i=w(e)||30;(0,o.isArray)(i)?(r=i[0],n=i[1]):(r=i,n=i);var a=void 0!==x?x(e):c,s=r+a,u=n+a;t.cellWidth=Math.max(t.cellWidth,s),t.cellHeight=Math.max(t.cellHeight,u)})}t.cellUsed={},t.row=0,t.col=0,t.id2manPos={};for(var _=0;_=t&&(this.col=0,this.row++)},e.prototype.getPos=function(t){var e,r,n=this.begin,i=this.cellWidth,o=this.cellHeight,a=this.id2manPos[t.id];if(a)e=a.col*i+i/2+n[0],r=a.row*o+o/2+n[1];else{for(;this.used(this.row,this.col);)this.moveToNextCell();e=this.col*i+i/2+n[0],r=this.row*o+o/2+n[1],this.use(this.row,this.col),this.moveToNextCell()}t.x=e,t.y=r},e.prototype.getType=function(){return"grid"},e}(r(8933).Base);e.GridLayout=a},9390:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&("get"in i?e.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.ERLayout=e.ForceAtlas2Layout=e.ComboCombinedLayout=e.ComboForceLayout=e.GForceGPULayout=e.FruchtermanGPULayout=e.FruchtermanLayout=e.MDSLayout=e.ConcentricLayout=e.RadialLayout=e.DagreCompoundLayout=e.DagreLayout=e.CircularLayout=e.ForceLayout=e.Force2Layout=e.GForceLayout=e.RandomLayout=e.GridLayout=e.Layouts=e.Layout=void 0;var o=r(7808);Object.defineProperty(e,"GridLayout",{enumerable:!0,get:function(){return o.GridLayout}});var a=r(1783);Object.defineProperty(e,"RandomLayout",{enumerable:!0,get:function(){return a.RandomLayout}});var s=r(4600);Object.defineProperty(e,"GForceLayout",{enumerable:!0,get:function(){return s.GForceLayout}});var u=r(8944);Object.defineProperty(e,"Force2Layout",{enumerable:!0,get:function(){return u.Force2Layout}});var l=r(574);Object.defineProperty(e,"ForceLayout",{enumerable:!0,get:function(){return l.ForceLayout}});var c=r(2381);Object.defineProperty(e,"CircularLayout",{enumerable:!0,get:function(){return c.CircularLayout}});var f=r(4855);Object.defineProperty(e,"DagreLayout",{enumerable:!0,get:function(){return f.DagreLayout}});var h=r(6006);Object.defineProperty(e,"DagreCompoundLayout",{enumerable:!0,get:function(){return h.DagreCompoundLayout}});var p=r(1884);Object.defineProperty(e,"RadialLayout",{enumerable:!0,get:function(){return p.RadialLayout}});var d=r(3080);Object.defineProperty(e,"ConcentricLayout",{enumerable:!0,get:function(){return d.ConcentricLayout}});var y=r(5084);Object.defineProperty(e,"MDSLayout",{enumerable:!0,get:function(){return y.MDSLayout}});var g=r(6983);Object.defineProperty(e,"FruchtermanLayout",{enumerable:!0,get:function(){return g.FruchtermanLayout}});var v=r(8834);Object.defineProperty(e,"FruchtermanGPULayout",{enumerable:!0,get:function(){return v.FruchtermanGPULayout}});var m=r(1011);Object.defineProperty(e,"GForceGPULayout",{enumerable:!0,get:function(){return m.GForceGPULayout}});var b=r(5773);Object.defineProperty(e,"ComboForceLayout",{enumerable:!0,get:function(){return b.ComboForceLayout}});var A=r(995);Object.defineProperty(e,"ComboCombinedLayout",{enumerable:!0,get:function(){return A.ComboCombinedLayout}});var x=r(3209);Object.defineProperty(e,"ForceAtlas2Layout",{enumerable:!0,get:function(){return x.ForceAtlas2Layout}});var w=r(6244);Object.defineProperty(e,"ERLayout",{enumerable:!0,get:function(){return w.ERLayout}});var _=r(2766);Object.defineProperty(e,"Layout",{enumerable:!0,get:function(){return _.Layout}}),Object.defineProperty(e,"Layouts",{enumerable:!0,get:function(){return _.Layouts}}),i(r(6451),e)},2766:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Layouts=e.Layout=void 0;var n=r(521),i=r(7808),o=r(1783),a=r(8944),s=r(4600),u=r(574),l=r(2381),c=r(4855),f=r(1884),h=r(3080),p=r(5084),d=r(6983),y=r(8834),g=r(1011),v=r(5773),m=r(995),b=r(3209),A=r(6244),x=r(6006),w=r(864),_=function(){function t(t){var e=(0,n.getLayoutByName)(t.type);this.layoutInstance=new e(t)}return t.prototype.layout=function(t){return this.layoutInstance.layout(t)},t.prototype.updateCfg=function(t){this.layoutInstance.updateCfg(t)},t.prototype.init=function(t){this.correctLayers(t.nodes),this.layoutInstance.init(t)},t.prototype.correctLayers=function(t){if(null===t||void 0===t?void 0:t.length){var e=1/0,r=[];if(t.forEach(function(t){(0,w.isString)(t.layer)&&(t.layer=parseInt(t.layer,10)),void 0===t.layer||isNaN(t.layer)||(r.push(t),t.layern[0]?n[0]:b-n[0],w=A-n[1]>n[1]?n[1]:A-n[1];0===x&&(x=b/2),0===w&&(w=A/2);var _=w>x?x:w,S=Math.max.apply(Math,m),E=[];m.forEach(function(e,r){t.unitRadius||(t.unitRadius=_/S),E[r]=e*t.unitRadius}),t.radii=E;var C=t.eIdealDisMatrix();t.eIdealDistances=C;var k=function(t){for(var e=t.length,r=t[0].length,n=[],i=0;iM[1]?M[0]:M[1])+L(t)}:function(t){return M+L(t)}:function(t){return t.size?(0,a.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+L(t):(0,a.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)+L(t):t.size+L(t):10+L(t)};var j={nodes:e,nodeSizeFunc:T,adjMatrix:y,positions:I,radii:E,height:A,width:b,strictRadial:P,focusID:d,iterations:t.maxPreventOverlapIteration||200,k:I.length/4.5},R=new l.default(j);I=R.layout()}return I.forEach(function(t,r){e[r].x=t[0]+n[0],e[r].y=t[1]+n[1]}),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:r}}t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){for(var t=this.maxIteration,e=this.positions||[],r=this.weights||[],n=this.eIdealDistances||[],i=this.radii||[],o=0;o<=t;o++){var a=o/t;this.oneIteration(a,e,i,n,r)}},e.prototype.oneIteration=function(t,e,r,n,i){var o=1-t,a=this.focusIndex;e.forEach(function(s,u){var l=c(s,[0,0]),f=0===l?0:1/l;if(u!==a){var h=0,p=0,d=0;e.forEach(function(t,e){if(u!==e){var r=c(s,t),o=0===r?0:1/r,a=n[e][u];d+=i[u][e],h+=i[u][e]*(t[0]+a*(s[0]-t[0])*o),p+=i[u][e]*(t[1]+a*(s[1]-t[1])*o)}});var y=0===r[u]?0:1/r[u];d*=o,d+=t*y*y,h*=o,h+=t*y*s[0]*f,s[0]=h/d,p*=o,p+=t*y*s[1]*f,s[1]=p/d}})},e.prototype.eIdealDisMatrix=function(){var t=this,e=t.nodes;if(!e)return[];var r=t.distances,n=t.linkDistance,i=t.radii||[],o=t.unitRadius||50,s=[];return r&&r.forEach(function(r,u){var l=[];r.forEach(function(r,s){if(u===s)l.push(0);else if(i[u]===i[s])if("data"===t.sortBy)l.push(r*(Math.abs(u-s)*t.sortStrength)/(i[u]/o));else if(t.sortBy){var c=e[u][t.sortBy]||0,f=e[s][t.sortBy]||0;(0,a.isString)(c)&&(c=c.charCodeAt(0)),(0,a.isString)(f)&&(f=f.charCodeAt(0)),l.push(r*(Math.abs(c-f)*t.sortStrength)/(i[u]/o))}else l.push(r*n/(i[u]/o));else{var h=(n+o)/2;l.push(r*h)}}),s.push(l)}),s},e.prototype.handleInfinity=function(t,e,r){for(var n=t.length,i=0;ir?t[e][n]:r);return r},e.prototype.getType=function(){return"radial"},e}(s.Base);e.RadialLayout=f},9088:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.disp=[],this.positions=t.positions,this.adjMatrix=t.adjMatrix,this.focusID=t.focusID,this.radii=t.radii,this.iterations=t.iterations||10,this.height=t.height||10,this.width=t.width||10,this.speed=t.speed||100,this.gravity=t.gravity||10,this.nodeSizeFunc=t.nodeSizeFunc,this.k=t.k||5,this.strictRadial=t.strictRadial,this.nodes=t.nodes}return t.prototype.layout=function(){var t=this.positions,e=[],r=this.iterations,n=this.width/10;this.maxDisplace=n,this.disp=e;for(var i=0;iu?1:-1;l=.01*h,c=.01*h}if(fMath.PI/2&&(c-=Math.PI/2,s*=-1,u*=-1);var f=Math.cos(c)*l;e.x=s*f,e.y=u*f});var a=this.radii;t.forEach(function(s,u){if(u!==i){var l=Math.sqrt(e[u].x*e[u].x+e[u].y*e[u].y);if(l>0&&u!==i){var c=Math.min(o*(r/800),l);if(s[0]+=e[u].x/l*c,s[1]+=e[u].y/l*c,n){var f=s[0]-t[i][0],h=s[1]-t[i][1],p=Math.sqrt(f*f+h*h);f=f/p*a[u],h=h/p*a[u],s[0]=t[i][0]+f,s[1]=t[i][1]+h}}}})},t}();e.default=r},1783:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.RandomLayout=void 0;var o=function(t){function e(e){var r=t.call(this)||this;return r.center=[0,0],r.width=300,r.height=300,r.nodes=[],r.edges=[],r.onLayoutEnd=function(){},r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},e.prototype.execute=function(){var t=this,e=t.nodes,r=t.center;return t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),e&&e.forEach(function(e){e.x=.9*(Math.random()-.5)*t.width+r[0],e.y=.9*(Math.random()-.5)*t.height+r[1]}),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:this.edges}},e.prototype.getType=function(){return"random"},e}(r(8933).Base);e.RandomLayout=o},6451:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},521:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.getLayoutByName=e.unRegisterLayout=e.registerLayout=void 0;var o=r(8933),a=r(864),s=new Map;e.registerLayout=function(t,e){if(s.get(t)&&console.warn("The layout with the name ".concat(t," exists already, it will be overridden")),(0,a.isObject)(e)){var r=function(t){function r(r){var n,i,o=n=t.call(this)||this,a={},s=Object.assign({},o.getDefaultCfg(),(null===(i=e.getDefaultCfg)||void 0===i?void 0:i.call(e))||{});return Object.assign(a,s,e,r),Object.keys(a).forEach(function(t){var e=a[t];o[t]=e}),n}return i(r,t),r}(o.Base);s.set(t,r)}else s.set(t,e);return s.get(t)};e.unRegisterLayout=function(t){s.has(t)&&s.delete(t)};e.getLayoutByName=function(t){return s.has(t)?s.get(t):null}},1049:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isArray=void 0,e.isArray=Array.isArray},8514:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getFuncByUnknownType=e.getFunc=e.isFunction=void 0;var n=r(864),i=r(9759);e.isFunction=function(t){return"function"==typeof t};e.getFunc=function(t,e,r){return r||((0,i.isNumber)(t)?function(){return t}:function(){return e})};e.getFuncByUnknownType=function(t,r,o){return void 0===o&&(o=!0),r||0===r?(0,e.isFunction)(r)?r:(0,i.isNumber)(r)?function(){return r}:(0,n.isArray)(r)?function(){if(o){var e=Math.max.apply(Math,r);return isNaN(e)?t:e}return r}:(0,n.isObject)(r)?function(){if(o){var e=Math.max(r.width,r.height);return isNaN(e)?t:e}return[r.width,r.height]}:function(){return t}:function(e){return e.size?(0,n.isArray)(e.size)?e.size[0]>e.size[1]?e.size[0]:e.size[1]:(0,n.isObject)(e.size)?e.size.width>e.size.height?e.size.width:e.size.height:e.size:t}}},2590:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arrayToTextureData=e.attributesToTextureData=e.buildTextureDataWithTwoEdgeAttr=e.buildTextureData=e.proccessToFunc=void 0;var n=r(864),i=r(6268);e.proccessToFunc=function(t,e){return t?(0,n.isNumber)(t)?function(){return t}:t:function(){return e||1}};e.buildTextureData=function(t,e){var r=[],n=[],o={},a=0;for(a=0;ae[n][o]+e[o][i]&&(e[n][i]=e[n][o]+e[o][i]);return e};e.getAdjMatrix=function(t,r){var n=t.nodes,i=t.edges,o=[],a={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(t,e){a[t.id]=e,o.push([])}),null===i||void 0===i||i.forEach(function(t){var n=(0,e.getEdgeTerminal)(t,"source"),i=(0,e.getEdgeTerminal)(t,"target"),s=a[n],u=a[i];void 0!==s&&void 0!==u&&(o[s][u]=1,r||(o[u][s]=1))}),o};e.scaleMatrix=function(t,e){var r=[];return t.forEach(function(t){var n=[];t.forEach(function(t){n.push(t*e)}),r.push(n)}),r};e.traverseTreeUp=function(t,e){"function"==typeof e&&function t(e,r){if(e&&e.children)for(var n=e.children.length-1;n>=0;n--)if(!t(e.children[n],r))return;return!!r(e)}(t,e)};e.getLayoutBBox=function(t){var e=1/0,r=1/0,o=-1/0,a=-1/0;return t.forEach(function(t){var s=t.size;(0,n.isArray)(s)?1===s.length&&(s=[s[0],s[0]]):(0,i.isNumber)(s)?s=[s,s]:(void 0===s||isNaN(s))&&(s=[30,30]);var u=[s[0]/2,s[1]/2],l=t.x-u[0],c=t.x+u[0],f=t.y-u[1],h=t.y+u[1];e>l&&(e=l),r>f&&(r=f),oi&&(n=r,a(1),++e),r[t]=o}function a(t){e=0,r=Object.create(null),t||(n=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==r[t]||void 0!==n[t]},get:function(t){var e=r[t];return void 0!==e?e:void 0!==(e=n[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==r[t]?r[t]=e:o(t,e)}}}(r),n},l=/rgba?\(([\s.,0-9]+)\)/;var c=u(function(t){if("#"===t[0]&&7===t.length)return t;var e;s||((e=document.createElement("i")).title="Web Colour Picker",e.style.display="none",document.body.appendChild(e),s=e),s.style.color=t;var r=document.defaultView.getComputedStyle(s,"").getPropertyValue("color");return r=o(l.exec(r)[1].split(/\s*,\s*/).map(function(t){return Number(t)}))},function(t){return t},256);function f(t,e,r,n){return t[n]+(e[n]-t[n])*r}function h(t){var e=("string"==typeof t?t.split("-"):t).map(function(t){return n(-1===t.indexOf("#")?c(t):t)});return function(t){return function(t,e){var r=isNaN(Number(e))||e<0?0:e>1?1:Number(e),n=t.length-1,i=Math.floor(n*r),a=n*r-i,s=t[i],u=i===n?s:t[i+1];return o([f(s,u,a,0),f(s,u,a,1),f(s,u,a,2)])}(e,t)}}var p=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,d=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,y=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function g(t){if(/^[r,R,L,l]{1}[\s]*\(/.test(t)){var e,r=void 0;if("l"===t[0]){var n=+(i=p.exec(t))[1]+90;r=i[2],e="linear-gradient("+n+"deg, "}else if("r"===t[0]){var i;e="radial-gradient(",r=(i=d.exec(t))[4]}var o=r.match(y);return o.forEach(function(t,r){var n=t.split(":");e+=n[1]+" "+100*Number(n[0])+"%",r!==o.length-1&&(e+=", ")}),e+=")"}return t}var v=r(9019);function m(t,e,r){var n=[0,0,0,0,0,0,0,0,0];return v.fromRotation(n,r),v.multiply(t,n,e)}function b(t,e,r){var n=[0,0,0,0,0,0,0,0,0];return v.fromScaling(n,r),v.multiply(t,n,e)}function A(t,e,r){return v.multiply(t,r,e)}function x(t,e){for(var r,n,i,o,a=t?[].concat(t):[1,0,0,0,1,0,0,0,1],s=0,u=e.length;s=0;return r?i?2*Math.PI-n:n:i?n:2*Math.PI-n}function E(t,e,r){return r?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t}function C(t,e){return void 0===e&&(e="off"),function(t,e){if("off"===e)return[].concat(t);var r="number"==typeof e&&e>=1?Math.pow(10,e):1;return t.map(function(t){var n=t.slice(1).map(Number).map(function(t){return e?Math.round(t*r)/r:Math.round(t)});return[t[0]].concat(n)})}(t,e).map(function(t){return t[0]+t.slice(1).join(" ")}).join("")}var k=r(1635),I={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function T(t,e,r){if(t[r].length>7){t[r].shift();for(var n=t[r],i=r;n.length;)e[r]="A",t.splice(i+=1,0,["C"].concat(n.splice(0,6)));t.splice(r,1)}}var O={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function M(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return O[e]===t.length-1&&"achlmqstvz".includes(e)})}function P(t){return M(t)&&t.every(function(t){var e=t[0];return e===e.toUpperCase()})}function L(t){return P(t)&&t.every(function(t){var e=t[0];return"ACLMQZ".includes(e)})}function N(t){for(var e=t.pathValue[t.segmentStart],r=e.toLowerCase(),n=t.data;n.length>=O[r]&&("m"===r&&n.length>2?(t.segments.push([e].concat(n.splice(0,2))),r="l",e="m"===e?"l":"L"):t.segments.push([e].concat(n.splice(0,O[r]))),O[r]););}function j(t){var e=t.index,r=t.pathValue,n=r.charCodeAt(e);return 48===n?(t.param=0,void(t.index+=1)):49===n?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+r[e]+'", expecting 0 or 1 at index '+e)}function R(t){return t>=48&&t<=57||43===t||45===t||46===t}function D(t){return t>=48&&t<=57}function B(t){var e,r=t.max,n=t.pathValue,i=t.index,o=i,a=!1,s=!1,u=!1,l=!1;if(o>=r)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(43!==(e=n.charCodeAt(o))&&45!==e||(o+=1,e=n.charCodeAt(o)),D(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=n.charCodeAt(o),a&&o=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function z(t){var e=t.max,r=t.pathValue,n=t.index,i=r.charCodeAt(n),o=O[r[n].toLowerCase()];if(t.segmentStart=n,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,F(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?B(t):j(t),t.err.length)return;t.data.push(t.param),F(t),t.index=t.max)break;if(!R(r.charCodeAt(t.index)))break}N(t)}else N(t);else t.err='[path-util]: Invalid path value "'+r[n]+'" is not a path command'}var G=function(){return function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}}();function U(t){if(M(t))return[].concat(t);var e=new G(t);for(F(e);e.index1&&(v*=C=Math.sqrt(C),m*=C);var k=v*v,I=m*m,T=(o===a?-1:1)*Math.sqrt(Math.abs((k*I-k*E*E-I*S*S)/(k*E*E+I*S*S)));p=T*v*E/m+(y+b)/2,d=T*-m*S/v+(g+A)/2,f=Math.asin(((g-d)/m*Math.pow(10,9)>>0)/Math.pow(10,9)),h=Math.asin(((A-d)/m*Math.pow(10,9)>>0)/Math.pow(10,9)),f=yh&&(f-=2*Math.PI),!a&&h>f&&(h-=2*Math.PI)}var O=h-f;if(Math.abs(O)>x){var M=h,P=b,L=A;h=f+x*(a&&h>f?1:-1),_=W(b=p+v*Math.cos(h),A=d+m*Math.sin(h),v,m,i,0,a,P,L,[h,M,p,d])}O=h-f;var N=Math.cos(f),j=Math.sin(f),R=Math.cos(h),D=Math.sin(h),B=Math.tan(O/4),F=4/3*v*B,z=4/3*m*B,G=[y,g],U=[y+F*j,g-z*N],H=[b+F*D,A-z*R],V=[b,A];if(U[0]=2*G[0]-U[0],U[1]=2*G[1]-U[1],l)return U.concat(H,V,_);for(var Q=[],q=0,X=(_=U.concat(H,V,_)).length;q=o)a={x:r,y:n};else{var s=q([t,e],[r,n],i/o);a={x:s[0],y:s[1]}}return{length:o,point:a,min:{x:Math.min(t,r),y:Math.min(e,n)},max:{x:Math.max(t,r),y:Math.max(e,n)}}}function nt(t,e){var r=t.x,n=t.y,i=e.x,o=e.y,a=r*i+n*o,s=Math.sqrt((Math.pow(r,2)+Math.pow(n,2))*(Math.pow(i,2)+Math.pow(o,2)));return(r*o-n*i<0?-1:1)*Math.acos(a/s)}function it(t,e,r,n,i,o,a,s,u,l){var c=Math.abs,f=Math.sin,h=Math.cos,p=Math.sqrt,d=Math.PI,y=c(r),g=c(n),v=(i%360+360)%360*(d/180);if(t===s&&e===u)return{x:t,y:e};if(0===y||0===g)return rt(t,e,s,u,l).point;var m=(t-s)/2,b=(e-u)/2,A={x:h(v)*m+f(v)*b,y:-f(v)*m+h(v)*b},x=Math.pow(A.x,2)/Math.pow(y,2)+Math.pow(A.y,2)/Math.pow(g,2);x>1&&(y*=p(x),g*=p(x));var w=(Math.pow(y,2)*Math.pow(g,2)-Math.pow(y,2)*Math.pow(A.y,2)-Math.pow(g,2)*Math.pow(A.x,2))/(Math.pow(y,2)*Math.pow(A.y,2)+Math.pow(g,2)*Math.pow(A.x,2));w=w<0?0:w;var _=(o!==a?1:-1)*p(w),S=_*(y*A.y/g),E=_*(-g*A.x/y),C=h(v)*S-f(v)*E+(t+s)/2,k=f(v)*S+h(v)*E+(e+u)/2,I={x:(A.x-S)/y,y:(A.y-E)/g},T=nt({x:1,y:0},I),O=nt(I,{x:(-A.x-S)/y,y:(-A.y-E)/g});!a&&O>0?O-=2*d:a&&O<0&&(O+=2*d);var M=T+(O%=2*d)*l,P=y*h(M),L=g*f(M);return{x:h(v)*P-f(v)*L+C,y:f(v)*P+h(v)*L+k}}function ot(t,e,r,n,i,o,a,s,u,l,c){var f,h=c.bbox,p=void 0===h||h,d=c.length,y=void 0===d||d,g=c.sampleSize,v=void 0===g?30:g,m="number"==typeof l,b=t,A=e,x=0,w=[b,A,x],_=[b,A],S={x:0,y:0},E=[{x:b,y:A}];m&&l<=0&&(S={x:b,y:A});for(var C=0;C<=v;C+=1){if(b=(f=it(t,e,r,n,i,o,a,s,u,C/v)).x,A=f.y,p&&E.push({x:b,y:A}),y&&(x+=et(_,[b,A])),_=[b,A],m&&x>=l&&l>w[2]){var k=(x-l)/(x-w[2]);S={x:_[0]*(1-k)+w[0]*k,y:_[1]*(1-k)+w[1]*k}}w=[b,A,x]}return m&&l>=x&&(S={x:s,y:u}),{length:x,point:S,min:{x:Math.min.apply(null,E.map(function(t){return t.x})),y:Math.min.apply(null,E.map(function(t){return t.y}))},max:{x:Math.max.apply(null,E.map(function(t){return t.x})),y:Math.max.apply(null,E.map(function(t){return t.y}))}}}function at(t,e,r,n,i,o,a,s,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*r+3*l*Math.pow(u,2)*i+Math.pow(u,3)*a,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*n+3*l*Math.pow(u,2)*o+Math.pow(u,3)*s}}function st(t,e,r,n,i,o,a,s,u,l){var c,f=l.bbox,h=void 0===f||f,p=l.length,d=void 0===p||p,y=l.sampleSize,g=void 0===y?10:y,v="number"==typeof u,m=t,b=e,A=0,x=[m,b,A],w=[m,b],_={x:0,y:0},S=[{x:m,y:b}];v&&u<=0&&(_={x:m,y:b});for(var E=0;E<=g;E+=1){if(m=(c=at(t,e,r,n,i,o,a,s,E/g)).x,b=c.y,h&&S.push({x:m,y:b}),d&&(A+=et(w,[m,b])),w=[m,b],v&&A>=u&&u>x[2]){var C=(A-u)/(A-x[2]);_={x:w[0]*(1-C)+x[0]*C,y:w[1]*(1-C)+x[1]*C}}x=[m,b,A]}return v&&u>=A&&(_={x:a,y:s}),{length:A,point:_,min:{x:Math.min.apply(null,S.map(function(t){return t.x})),y:Math.min.apply(null,S.map(function(t){return t.y}))},max:{x:Math.max.apply(null,S.map(function(t){return t.x})),y:Math.max.apply(null,S.map(function(t){return t.y}))}}}function ut(t,e,r,n,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*r+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*n+Math.pow(a,2)*o}}function lt(t,e,r,n,i,o,a,s){var u,l=s.bbox,c=void 0===l||l,f=s.length,h=void 0===f||f,p=s.sampleSize,d=void 0===p?10:p,y="number"==typeof a,g=t,v=e,m=0,b=[g,v,m],A=[g,v],x={x:0,y:0},w=[{x:g,y:v}];y&&a<=0&&(x={x:g,y:v});for(var _=0;_<=d;_+=1){if(g=(u=ut(t,e,r,n,i,o,_/d)).x,v=u.y,c&&w.push({x:g,y:v}),h&&(m+=et(A,[g,v])),A=[g,v],y&&m>=a&&a>b[2]){var S=(m-a)/(m-b[2]);x={x:A[0]*(1-S)+b[0]*S,y:A[1]*(1-S)+b[1]*S}}b=[g,v,m]}return y&&a>=m&&(x={x:i,y:o}),{length:m,point:x,min:{x:Math.min.apply(null,w.map(function(t){return t.x})),y:Math.min.apply(null,w.map(function(t){return t.y}))},max:{x:Math.max.apply(null,w.map(function(t){return t.x})),y:Math.max.apply(null,w.map(function(t){return t.y}))}}}function ct(t,e,r){for(var n,i,o,a,s,u,l,c,f,h=Q(t),p="number"==typeof e,d=[],y=0,g=0,v=0,m=0,b=[],A=[],x=0,w={x:0,y:0},_=w,S=w,E=w,C=0,k=0,I=h.length;k=e&&(E=S),A.push(_),b.push(w),C+=x,y=(u="Z"!==c?f.slice(-2):[v,m])[0],g=u[1];return p&&e>=C&&(E={x:y,y:g}),{length:C,point:E,min:{x:Math.min.apply(null,b.map(function(t){return t.x})),y:Math.min.apply(null,b.map(function(t){return t.y}))},max:{x:Math.max.apply(null,A.map(function(t){return t.x})),y:Math.max.apply(null,A.map(function(t){return t.y}))}}}function ft(t,e){if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var r=ct(t,void 0,(0,k.__assign)((0,k.__assign)({},e),{length:!1})),n=r.min,i=n.x,o=n.y,a=r.max,s=a.x,u=a.y,l=s-i,c=u-o;return{width:l,height:c,x:i,y:o,x2:s,y2:u,cx:i+l/2,cy:o+c/2,cz:Math.max(l,c)+Math.min(l,c)/2}}function ht(t,e){return ct(t,void 0,(0,k.__assign)((0,k.__assign)({},e),{bbox:!1,length:!0})).length}function pt(t,e){if(!t)return{length:0,x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var r=ct(t,void 0,(0,k.__assign)((0,k.__assign)({},e),{bbox:!0,length:!0})),n=r.length,i=r.min,o=i.x,a=i.y,s=r.max,u=s.x,l=s.y,c=u-o,f=l-a;return{length:n,width:c,height:f,x:o,y:a,x2:u,y2:l,cx:o+c/2,cy:a+f/2,cz:Math.max(c,f)+Math.min(c,f)/2}}function dt(t,e){var r=t.length-1,n=[],i=0,o=function(t){var e=t.length,r=e-1;return t.map(function(n,i){return t.map(function(n,o){var a,s=i+o;return 0===o||t[s]&&"M"===t[s][0]?(a=t[s],["M"].concat(a.slice(-2))):(s>=e&&(s-=r),t[s])})})}(t);return o.forEach(function(o,a){t.slice(1).forEach(function(n,o){i+=et(t[(a+o)%r].slice(-2),e[o%r].slice(-2))}),n[a]=i,i=0}),o[n.indexOf(Math.min.apply(null,n))]}function yt(t){var e=0,r=0,n=0;return J(t).map(function(t){var i;switch(t[0]){case"M":return e=t[1],r=t[2],0;default:var o=t.slice(1),a=o[0],s=o[1],u=o[2],l=o[3],c=o[4],f=o[5];return n=function(t,e,r,n,i,o,a,s){return 3*((s-e)*(r+i)-(a-t)*(n+o)+n*(t-i)-r*(e-o)+s*(i+t/3)-a*(o+e/3))/20}(e,r,a,s,u,l,c,f),i=t.slice(-2),e=i[0],r=i[1],n}}).reduce(function(t,e){return t+e},0)}function gt(t){return yt(t)>=0}function vt(t,e,r){return ct(t,e,(0,k.__assign)((0,k.__assign)({},r),{bbox:!1,length:!0})).point}function mt(t,e){for(var r,n,i,o,a=U(t),s=Q(a),u=ht(a),l=function(t){var r=t.x-e.x,n=t.y-e.y;return r*r+n*n},c=8,f=0,h=0,p=1/0,d=0;d<=u;d+=c)(f=l(r=vt(s,d))).5;)v=l(i=vt(s,y=h-c)),m=l(o=vt(s,g=h+c)),y>=0&&v=i)return s=i-(a=ht(n=r.slice(0,-1))),{segment:r[o],index:o,length:s,lengthAtSegment:a};for(var f=[];o>0;)u=n[o],s=i-(a=ht(n=n.slice(0,-1))),i=a,f.push({segment:u,index:o,length:s,lengthAtSegment:a}),o-=1;return f.find(function(t){return t.lengthAtSegment<=e})}(a,h);return{closest:n,distance:Math.sqrt(p),segment:b}}function bt(t,e){var r=mt(t,e).distance;return Math.abs(r)<.001}function At(t){return t.map(function(t,e,r){var n=e&&r[e-1].slice(-2).concat(t.slice(1)),i=e?st(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var r=t.slice(0,2),n=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=q(r,n,e),s=q(n,i,e),u=q(i,o,e),l=q(a,s,e),c=q(s,u,e),f=q(l,c,e);return[["C"].concat(a,l,f),["C"].concat(c,u,o)]}(n):[t,t]:[t],l:i}})}function xt(t,e,r){var n=At(t),i=At(e),o=n.length,a=i.length,s=n.filter(function(t){return t.l}).length,u=i.filter(function(t){return t.l}).length,l=n.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/s||0,c=i.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/u||0,f=r||Math.max(o,a),h=[l,c],p=[f-o,f-a],d=0,y=[n,i].map(function(t,e){return t.l===f?t.map(function(t){return t.s}):t.map(function(t,r){return d=r&&p[e]&&t.l>=h[e],p[e]-=d?1:0,d?t.ss:[t.s]}).flat()});return y[0].length===y[1].length?y:xt(y[0],y[1],f)}var wt=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},_t=function(t,e){return!!wt(t)&&t.indexOf(e)>-1},St=function(t,e){if(!wt(t))return t;for(var r=[],n=0;n-1;)Wt.call(t,o,1);return t},Kt=Array.prototype.splice,Jt=function(t,e){if(!wt(t))return[];for(var r=t?e.length:0,n=r-1;r--;){var i=void 0,o=e[r];r!==n&&o===i||(i=o,Kt.call(t,o,1))}return t},Zt=function(t,e,r){if(!Tt(t)&&!Dt(t))return t;var n=r;return Pt(t,function(t,r){n=e(n,t,r)}),n},$t=function(t,e){var r=[];if(!wt(t))return r;for(var n=-1,i=[],o=t.length;++ne[i])return 1;if(t[i]r?r:t},xe=function(t,e){var r=e.toString(),n=r.indexOf(".");if(-1===n)return Math.round(t);var i=r.substr(n+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))},we=function(t){return It(t,"Number")},_e=function(t){return we(t)&&t%1!=0},Se=function(t){return we(t)&&t%2==0},Ee=Number.isInteger?Number.isInteger:function(t){return we(t)&&t%1==0},Ce=function(t){return we(t)&&t<0},ke=1e-5;function Ie(t,e,r){return void 0===r&&(r=ke),Math.abs(t-e)0},Me=function(t,e){if(Tt(t)){for(var r,n=-1/0,i=0;in&&(r=o,n=s)}return r}},Pe=function(t,e){if(Tt(t)){for(var r,n=1/0,i=0;ie?(n&&(clearTimeout(n),n=null),s=l,a=t.apply(i,o),n||(i=o=null)):n||!1===r.trailing||(n=setTimeout(u,c)),a};return l.cancel=function(){clearTimeout(n),s=0,n=i=o=null},l},Rr=function(t){return wt(t)?Array.prototype.slice.call(t):[]},Dr={},Br=function(t){return Dr[t=t||"g"]?Dr[t]+=1:Dr[t]=1,t+Dr[t]},Fr=function(){},zr=function(t){return t};function Gr(t){return Ct(t)?0:wt(t)?t.length:Object.keys(t).length}var Ur=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var r=this.map[t];return void 0===r?e:r},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}(),Hr=1e-6;function Vr(t){return Math.abs(t)0!=Vr(s[1]-r)>0&&Vr(e-(r-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(n=!n)}return n}var Wr=function(t,e,r){return t>=e&&t<=r};function qr(t){for(var e=[],r=t.length,n=0;n1){var a=t[0],s=t[r-1];e.push({from:{x:s[0],y:s[1]},to:{x:a[0],y:a[1]}})}return e}function Xr(t,e){var r=!1;return t.forEach(function(t){if(function(t,e,r,n){var i=r.x-t.x,o=r.y-t.y,a=e.x-t.x,s=e.y-t.y,u=n.x-r.x,l=n.y-r.y,c=a*l-s*u,f=null;if(c*c>.001*(a*a+s*s)*(u*u+l*l)){var h=(i*l-o*u)/c,p=(i*s-o*a)/c;Wr(h,0,1)&&Wr(p,0,1)&&(f={x:t.x+h*a,y:t.y+h*s})}return f}(t.from,t.to,e.from,e.to))return r=!0,!1}),r}function Kr(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]});return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,r),maxY:Math.max.apply(null,r)}}function Jr(t,e){if(t.length<2||e.length<2)return!1;var r,n,i=Kr(t),o=Kr(e);if(r=i,(n=o).minX>r.maxX||n.maxXr.maxY||n.maxY1&&void 0!==arguments[1]?arguments[1]:{};if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");if(void 0!==r.output){if(!i(r.output))throw new TypeError("output option must be an array if specified");e=r.output}else e=new Array(t.length);var n=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var r=e.fromIndex,n=void 0===r?0:r,o=e.toIndex,a=void 0===o?t.length:o;if(n<0||n>=t.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=n||a>t.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[n],u=n+1;u1&&void 0!==arguments[1]?arguments[1]:{};if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var r=e.fromIndex,n=void 0===r?0:r,o=e.toIndex,a=void 0===o?t.length:o;if(n<0||n>=t.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=n||a>t.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[n],u=n+1;us&&(s=t[u]);return s}(t);if(n===o)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var a=r.min,s=void 0===a?r.autoMinMax?n:0:a,u=r.max,l=void 0===u?r.autoMinMax?o:1:u;if(s>=l)throw new RangeError("min option must be smaller than max option");for(var c=(l-s)/(o-n),f=0;f1&&void 0!==arguments[1]?arguments[1]:{},r=e.maxRows,n=void 0===r?15:r,i=e.maxColumns,o=void 0===i?10:i,u=e.maxNumSize,c=void 0===u?8:u;return"".concat(t.constructor.name," {\n").concat(a,"[\n").concat(s).concat(function(t,e,r,n){for(var i=t.rows,o=t.columns,a=Math.min(i,e),u=Math.min(o,r),c=[],f=0;fn)throw new RangeError("Row index out of range")}function h(t,e,r){var n=r?t.columns:t.columns-1;if(e<0||e>n)throw new RangeError("Column index out of range")}function p(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function d(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function y(t,e,r){return{row:g(t,e),column:v(t,r)}}function g(t,e){if("object"!==c(e))throw new TypeError("unexpected type for row indices");if(e.some(function(e){return e<0||e>=t.rows}))throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function v(t,e){if("object"!==c(e))throw new TypeError("unexpected type for column indices");if(e.some(function(e){return e<0||e>=t.columns}))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function m(t,e,r,n,i){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(A("startRow",e),A("endRow",r),A("startColumn",n),A("endColumn",i),e>r||n>i||e<0||e>=t.rows||r<0||r>=t.rows||n<0||n>=t.columns||i<0||i>=t.columns)throw new RangeError("Submatrix indices are out of range")}function b(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=[],n=0;nr?(i=!0,r=e):(n=!1,i=!0);t++}return n}},{key:"isReducedEchelonForm",value:function(){for(var t=0,e=0,r=-1,n=!0,i=!1;tr?(i=!0,r=e):(n=!1,i=!0);for(var o=e+1;ot.get(n,r)&&(n=i);if(0===t.get(n,r))r++;else{t.swapRows(e,n);for(var o=t.get(e,r),a=r;a=0;)if(0===t.maxRow(n))n--;else{for(var i=0,o=!1;i0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==E(t))throw new TypeError("options must be an object");var e=t.rows,r=void 0===e?1:e,n=t.columns,i=void 0===n?1:n;if(!Number.isInteger(r)||r<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(i)||i<=0)throw new TypeError("columns must be a positive integer");for(var o=new P(this.rows*r,this.columns*i),a=0;at&&(t=this.get(e,r));return t}},{key:"maxIndex",value:function(){for(var t=this.get(0,0),e=[0,0],r=0;rt&&(t=this.get(r,n),e[0]=r,e[1]=n);return e}},{key:"min",value:function(){for(var t=this.get(0,0),e=0;ee&&(e=this.get(t,r));return e}},{key:"maxRowIndex",value:function(t){f(this,t);for(var e=this.get(t,0),r=[t,0],n=1;ne&&(e=this.get(t,n),r[1]=n);return r}},{key:"minRow",value:function(t){f(this,t);for(var e=this.get(t,0),r=1;re&&(e=this.get(r,t));return e}},{key:"maxColumnIndex",value:function(t){h(this,t);for(var e=this.get(0,t),r=[0,t],n=1;ne&&(e=this.get(n,t),r[0]=n);return r}},{key:"minColumn",value:function(t){h(this,t);for(var e=this.get(0,t),r=1;r0&&void 0!==arguments[0]?arguments[0]:"frobenius",e=0;if("max"===t)return this.max();if("frobenius"===t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==E(t))throw new TypeError("options must be an object");var e=t.min,r=void 0===e?0:e,n=t.max,i=void 0===n?1:n;if(!Number.isFinite(r))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(r>=i)throw new RangeError("min must be smaller than max");for(var a=new P(this.rows,this.columns),s=0;s0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==E(t))throw new TypeError("options must be an object");var e=t.min,r=void 0===e?0:e,n=t.max,i=void 0===n?1:n;if(!Number.isFinite(r))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(r>=i)throw new RangeError("min must be smaller than max");for(var a=new P(this.rows,this.columns),s=0;s0&&void 0!==arguments[0]?arguments[0]:M,e=0;e0&&void 0!==arguments[0]?arguments[0]:M,e=0;er||e<0||e>=this.columns||r<0||r>=this.columns)throw new RangeError("Argument out of range");for(var n=new P(t.length,r-e+1),i=0;i=this.rows)throw new RangeError("Row index out of range: ".concat(t[i]));n.set(i,o-e,this.get(t[i],o))}return n}},{key:"subMatrixColumn",value:function(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r=this.rows-1),e>r||e<0||e>=this.rows||r<0||r>=this.rows)throw new RangeError("Argument out of range");for(var n=new P(r-e+1,t.length),i=0;i=this.columns)throw new RangeError("Column index out of range: ".concat(t[i]));n.set(o-e,i,this.get(o,t[i]))}return n}},{key:"setSubMatrix",value:function(t,e,r){m(this,e,e+(t=P.checkMatrix(t)).rows-1,r,r+t.columns-1);for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if("object"===E(t)&&(e=t,t=void 0),"object"!==E(e))throw new TypeError("options must be an object");var r=e,n=r.unbiased,i=void 0===n||n,o=r.mean,a=void 0===o?this.mean(t):o;if("boolean"!=typeof i)throw new TypeError("unbiased must be a boolean");switch(t){case"row":if(!Array.isArray(a))throw new TypeError("mean must be an array");return function(t,e,r){for(var n=t.rows,i=t.columns,o=[],a=0;a1&&void 0!==arguments[1]?arguments[1]:{};if("object"===E(t)&&(e=t,t=void 0),"object"!==E(e))throw new TypeError("options must be an object");var r=e.center,n=void 0===r?this.mean(t):r;switch(t){case"row":if(!Array.isArray(n))throw new TypeError("center must be an array");return function(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if("object"===E(t)&&(e=t,t=void 0),"object"!==E(e))throw new TypeError("options must be an object");var r=e.scale;switch(t){case"row":if(void 0===r)r=function(t){for(var e=[],r=0;r2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==E(r))throw new TypeError("options must be an object");for(var n=r.random,i=void 0===n?Math.random:n,o=new P(t,e),a=0;a2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==E(r))throw new TypeError("options must be an object");var n=r.min,i=void 0===n?0:n,o=r.max,a=void 0===o?1e3:o,s=r.random,u=void 0===s?Math.random:s;if(!Number.isInteger(i))throw new TypeError("min must be an integer");if(!Number.isInteger(a))throw new TypeError("max must be an integer");if(i>=a)throw new RangeError("min must be smaller than max");for(var l=a-i,c=new P(t,e),f=0;f0){if(n.data=[],!(Number.isInteger(r)&&r>0))throw new TypeError("nColumns must be a positive integer");for(var i=0;i>t);return this},t.prototype.signPropagatingRightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var r=0;r>t.get(r,n));return this},t.signPropagatingRightShift=function(t,r){return new e(t).signPropagatingRightShift(r)},t.prototype.rightShift=function(t){return"number"==typeof t?this.rightShiftS(t):this.rightShiftM(t)},t.prototype.rightShiftS=function(t){for(var e=0;e>>t);return this},t.prototype.rightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var r=0;r>>t.get(r,n));return this},t.rightShift=function(t,r){return new e(t).rightShift(r)},t.prototype.zeroFillRightShift=t.prototype.rightShift,t.prototype.zeroFillRightShiftS=t.prototype.rightShiftS,t.prototype.zeroFillRightShiftM=t.prototype.rightShiftM,t.zeroFillRightShift=t.rightShift,t.prototype.not=function(){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=n.rows,o=void 0===i?1:i;if(t.length%o!=0)throw new Error("the data length is not divisible by the number of rows");return(r=Zt(this,e)).rows=o,r.columns=t.length/o,r.data=t,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&te(t,e)}(e,O),r=e,(n=[{key:"set",value:function(t,e,r){var n=this._calculateIndex(t,e);return this.data[n]=r,this}},{key:"get",value:function(t,e){var r=this._calculateIndex(t,e);return this.data[r]}},{key:"_calculateIndex",value:function(t,e){return t*this.columns+e}}])&&Kt(r.prototype,n),i&&Kt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function re(t){"@babel/helpers - typeof";return(re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ne(t,e){for(var r=0;rMath.abs(l[o])&&(o=r);if(o!==n){for(i=0;i=0;i--){for(n=0;no?n.set(i,o,t.get(i,o)):i===o?n.set(i,o,1):n.set(i,o,0);return n}},{key:"upperTriangularMatrix",get:function(){for(var t=this.LU,e=t.rows,r=t.columns,n=new P(e,r),i=0;iMath.abs(e)?(r=e/t,Math.abs(t)*Math.sqrt(1+r*r)):0!==e?(r=t/e,Math.abs(e)*Math.sqrt(1+r*r)):0}function ye(t){"@babel/helpers - typeof";return(ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ge(t,e){for(var r=0;r=0;o--){for(i=0;i=0;r--){for(t=0;t1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n,i=(e=ue.checkMatrix(e)).rows,o=e.columns,a=r.computeLeftSingularVectors,s=void 0===a||a,u=r.computeRightSingularVectors,l=void 0===u||u,c=r.autoTranspose,f=void 0!==c&&c,h=Boolean(s),p=Boolean(l),d=!1;if(i=0;X--)if(0!==m[X]){for(var K=X+1;K=0;nt--){if(nt0;){var ft=void 0,ht=void 0;for(ft=Y-2;ft>=-1&&-1!==ft;ft--){var pt=Number.MIN_VALUE+ct*Math.abs(m[ft]+Math.abs(m[ft+1]));if(Math.abs(x[ft])<=pt||Number.isNaN(x[ft])){x[ft]=0;break}}if(ft===Y-2)ht=4;else{var dt=void 0;for(dt=Y-1;dt>=ft&&dt!==ft;dt--){var yt=(dt!==Y?Math.abs(x[dt]):0)+(dt!==ft+1?Math.abs(x[dt-1]):0);if(Math.abs(m[dt])<=ct*yt){m[dt]=0;break}}dt===ft?ht=3:dt===Y-1?ht=1:(ht=2,ft=dt)}switch(ft++,ht){case 1:var gt=x[Y-2];x[Y-2]=0;for(var vt=Y-2;vt>=ft;vt--){var mt=de(m[vt],gt),bt=m[vt]/mt,At=gt/mt;if(m[vt]=mt,vt!==ft&&(gt=-At*x[vt-1],x[vt-1]=bt*x[vt-1]),p)for(var xt=0;xt=m[ft+1]);){var Yt=m[ft];if(m[ft]=m[ft+1],m[ft+1]=Yt,p&&fte&&i.set(o,a,t.get(o,a)/this.s[a]);for(var s=this.U,u=s.rows,l=s.columns,c=new P(r,u),f=0;ft&&e++;return e}},{key:"diagonal",get:function(){return Array.from(this.s)}},{key:"threshold",get:function(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}},{key:"leftSingularVectors",get:function(){return this.U}},{key:"rightSingularVectors",get:function(){return this.V}},{key:"diagonalMatrix",get:function(){return P.diag(this.s)}}])&&Ae(t.prototype,e),r&&Ae(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function _e(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=ue.checkMatrix(t),e?new we(t).inverse():Se(t,P.eye(t.rows))}function Se(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t=ue.checkMatrix(t),e=ue.checkMatrix(e),r?new we(t).solve(e):t.isSquare()?new pe(t).solve(e):new me(t).solve(e)}function Ee(t){var e,r,n,i,o,a;if((t=P.checkMatrix(t)).isSquare())return 2===t.columns?(e=t.get(0,0),r=t.get(0,1),n=t.get(1,0),e*t.get(1,1)-r*n):3===t.columns?(i=new Nt(t,[1,2],[1,2]),o=new Nt(t,[1,2],[0,2]),a=new Nt(t,[1,2],[0,1]),e=t.get(0,0),r=t.get(0,1),n=t.get(0,2),e*Ee(i)-r*Ee(o)+n*Ee(a)):new pe(t).determinant;throw Error("determinant can only be calculated for a square matrix")}function Ce(t,e){for(var r=[],n=0;n3&&void 0!==arguments[3]?arguments[3]:1e-9;if(t>(arguments.length>4&&void 0!==arguments[4]?arguments[4]:1e-9))return new Array(e.rows+1).fill(0);for(var i=e.addRow(r,[0]),o=0;o1&&void 0!==arguments[1]?arguments[1]:{},r=e.thresholdValue,n=void 0===r?1e-9:r,i=e.thresholdError,o=void 0===i?1e-9:i,a=(t=P.checkMatrix(t)).rows,s=new P(a,a),u=0;u1&&void 0!==arguments[1]?arguments[1]:Number.EPSILON;t=P.checkMatrix(t);for(var r=new we(t,{autoTranspose:!0}),n=r.leftSingularVectors,i=r.rightSingularVectors,o=r.diagonal,a=0;ae?o[a]=1/o[a]:o[a]=0;return i.mmul(P.diag(o).mmul(n.transpose()))}function Oe(t){"@babel/helpers - typeof";return(Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Me(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t=new P(t);var n=!1;if("object"!==Oe(e)||P.isMatrix(e)||Array.isArray(e)?e=new P(e):(r=e,e=t,n=!0),t.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");var i=r.center;(void 0===i||i)&&(t=t.center("column"),n||(e=e.center("column")));for(var o=t.transpose().mmul(e),a=0;a1&&void 0!==arguments[1]?arguments[1]:t,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t=new P(t);var n=!1;if("object"!==Pe(e)||P.isMatrix(e)||Array.isArray(e)?e=new P(e):(r=e,e=t,n=!0),t.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");var i=r,o=i.center,a=void 0===o||o,s=i.scale,u=void 0===s||s;a&&(t.center("column"),n||e.center("column")),u&&(t.scale("column"),n||e.scale("column"));for(var l=t.standardDeviation("column",{unbiased:!0}),c=n?l:e.standardDeviation("column",{unbiased:!0}),f=t.transpose().mmul(e),h=0;h1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=r.assumeSymmetric,i=void 0!==n&&n;if(!(e=ue.checkMatrix(e)).isSquare())throw new Error("Matrix is not a square matrix");var o,a,s=e.columns,u=new P(s,s),l=new Float64Array(s),c=new Float64Array(s),f=e;if(i||e.isSymmetric()){for(o=0;o0;s--){for(f=0,a=0,l=0;l0&&(o=-o),e[s]=f*o,a-=i*o,r[s-1]=i-o,u=0;ul)do{for(i=r[l],f=(r[l+1]-i)/(2*e[l]),h=de(f,1),f<0&&(h=-h),r[l]=e[l]/(f+h),r[l+1]=e[l]*(f+h),p=r[l+1],o=i-r[l],a=l+2;a=l;a--)for(g=y,y=d,b=m,i=d*e[a],o=d*f,h=de(f,e[a]),e[a+1]=m*h,m=e[a]/h,f=(d=f/h)*r[a]-m*i,r[a+1]=o+m*(d*i+m*r[a]),u=0;uw*x);r[l]=r[l]+A,e[l]=0}for(a=0;a=l;s--)r[s]=e.get(s,l-1)/c,a+=r[s]*r[s];for(o=Math.sqrt(a),r[l]>0&&(o=-o),a-=r[l]*o,r[l]=r[l]-o,u=l;u=l;s--)i+=r[s]*e.get(s,u);for(i/=a,s=l;s<=f;s++)e.set(s,u,e.get(s,u)-i*r[s])}for(s=0;s<=f;s++){for(i=0,u=f;u>=l;u--)i+=r[u]*e.get(s,u);for(i/=a,u=l;u<=f;u++)e.set(s,u,e.get(s,u)-i*r[u])}r[l]=c*r[l],e.set(l,l-1,c*o)}}for(s=0;s=1;l--)if(0!==e.get(l,l-1)){for(s=l+1;s<=f;s++)r[s]=e.get(s,l-1);for(u=l;u<=f;u++){for(o=0,s=l;s<=f;s++)o+=r[s]*n.get(s,u);for(o=o/r[l]/e.get(l,l-1),s=l;s<=f;s++)n.set(s,u,n.get(s,u)+o*r[s])}}}(s,h,p,u),function(t,e,r,n,i){var o,a,s,u,l,c,f,h,p,d,y,g,v,m,b,A=t-1,x=t-1,w=Number.EPSILON,_=0,S=0,E=0,C=0,k=0,I=0,T=0,O=0;for(o=0;ox)&&(r[o]=i.get(o,o),e[o]=0),a=Math.max(o-1,0);a=0;){for(u=A;u>0&&(0===(I=Math.abs(i.get(u-1,u-1))+Math.abs(i.get(u,u)))&&(I=S),!(Math.abs(i.get(u,u-1))=0){for(T=E>=0?E+T:E-T,r[A-1]=h+T,r[A]=r[A-1],0!==T&&(r[A]=h-f/T),e[A-1]=0,e[A]=0,h=i.get(A,A-1),I=Math.abs(h)+Math.abs(T),E=h/I,C=T/I,k=Math.sqrt(E*E+C*C),E/=k,C/=k,a=A-1;a0){for(I=Math.sqrt(I),p=u&&(T=i.get(l,l),E=((k=h-T)*(I=p-T)-f)/i.get(l+1,l)+i.get(l,l+1),C=i.get(l+1,l+1)-T-k-I,k=i.get(l+2,l+1),I=Math.abs(E)+Math.abs(C)+Math.abs(k),E/=I,C/=I,k/=I,l!==u)&&!(Math.abs(i.get(l,l-1))*(Math.abs(C)+Math.abs(k))l+2&&i.set(o,o-3,0);for(s=l;s<=A-1&&(m=s!==A-1,s!==l&&(E=i.get(s,s-1),C=i.get(s+1,s-1),k=m?i.get(s+2,s-1):0,0!==(h=Math.abs(E)+Math.abs(C)+Math.abs(k))&&(E/=h,C/=h,k/=h)),0!==h);s++)if(I=Math.sqrt(E*E+C*C+k*k),E<0&&(I=-I),0!==I){for(s!==l?i.set(s,s-1,-I*h):u!==l&&i.set(s,s-1,-i.get(s,s-1)),h=(E+=I)/I,p=C/I,T=k/I,C/=E,k/=E,a=s;a=0;A--)if(E=r[A],0===(C=e[A]))for(u=A,i.set(A,A,1),o=A-1;o>=0;o--){for(f=i.get(o,o)-E,k=0,a=u;a<=A;a++)k+=i.get(o,a)*i.get(a,A);if(e[o]<0)T=f,I=k;else if(u=o,0===e[o]?i.set(o,A,0!==f?-k/f:-k/(w*S)):(h=i.get(o,o+1),p=i.get(o+1,o),C=(r[o]-E)*(r[o]-E)+e[o]*e[o],c=(h*I-T*k)/C,i.set(o,A,c),i.set(o+1,A,Math.abs(h)>Math.abs(T)?(-k-f*c)/h:(-I-p*c)/T)),c=Math.abs(i.get(o,A)),w*c*c>1)for(a=o;a<=A;a++)i.set(a,A,i.get(a,A)/c)}else if(C<0)for(u=A-1,Math.abs(i.get(A,A-1))>Math.abs(i.get(A-1,A))?(i.set(A-1,A-1,C/i.get(A,A-1)),i.set(A-1,A,-(i.get(A,A)-E)/i.get(A,A-1))):(b=Be(0,-i.get(A-1,A),i.get(A-1,A-1)-E,C),i.set(A-1,A-1,b[0]),i.set(A-1,A,b[1])),i.set(A,A-1,0),i.set(A,A,1),o=A-2;o>=0;o--){for(d=0,y=0,a=u;a<=A;a++)d+=i.get(o,a)*i.get(a,A-1),y+=i.get(o,a)*i.get(a,A);if(f=i.get(o,o)-E,e[o]<0)T=f,k=d,I=y;else if(u=o,0===e[o]?(b=Be(-d,-y,f,C),i.set(o,A-1,b[0]),i.set(o,A,b[1])):(h=i.get(o,o+1),p=i.get(o+1,o),g=(r[o]-E)*(r[o]-E)+e[o]*e[o]-C*C,v=2*(r[o]-E)*C,0===g&&0===v&&(g=w*S*(Math.abs(f)+Math.abs(C)+Math.abs(h)+Math.abs(p)+Math.abs(T))),b=Be(h*k-T*d+C*y,h*I-T*y-C*d,g,v),i.set(o,A-1,b[0]),i.set(o,A,b[1]),Math.abs(h)>Math.abs(T)+Math.abs(C)?(i.set(o+1,A-1,(-d-f*i.get(o,A-1)+C*i.get(o,A))/h),i.set(o+1,A,(-y-f*i.get(o,A)-C*i.get(o,A-1))/h)):(b=Be(-k-p*i.get(o,A-1),-I-p*i.get(o,A),T,C),i.set(o+1,A-1,b[0]),i.set(o+1,A,b[1]))),c=Math.max(Math.abs(i.get(o,A-1)),Math.abs(i.get(o,A))),w*c*c>1)for(a=o;a<=A;a++)i.set(a,A-1,i.get(a,A-1)/c),i.set(a,A,i.get(a,A)/c)}for(o=0;ox)for(a=o;a=0;a--)for(o=0;o<=x;o++){for(T=0,s=0;s<=Math.min(a,x);s++)T+=n.get(o,s)*i.get(s,a);n.set(o,a,T)}}}(s,c,l,u,h)}this.n=s,this.e=c,this.d=l,this.V=u},(e=[{key:"realEigenvalues",get:function(){return Array.from(this.d)}},{key:"imaginaryEigenvalues",get:function(){return Array.from(this.e)}},{key:"eigenvectorMatrix",get:function(){return this.V}},{key:"diagonalMatrix",get:function(){var t,e,r=this.n,n=this.e,i=this.d,o=new P(r,r);for(t=0;t0?o.set(t,t+1,n[t]):n[t]<0&&o.set(t,t-1,n[t])}return o}}])&&je(t.prototype,e),r&&je(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Be(t,e,r,n){var i,o;return Math.abs(r)>Math.abs(n)?[(t+(i=n/r)*e)/(o=r+i*n),(e-i*t)/o]:[((i=r/n)*t+e)/(o=n+i*r),(i*e-t)/o]}function Fe(t){"@babel/helpers - typeof";return(Fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ze(t,e){for(var r=0;r0,s.set(n,n,Math.sqrt(Math.max(l,0))),i=n+1;i=0;o--)for(i=0;i1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=ue.checkMatrix(e);var n,i=r.Y,o=r.scaleScores,a=void 0!==o&&o,s=r.maxIterations,u=void 0===s?1e3:s,l=r.terminationCriteria,c=void 0===l?1e-10:l;if(i){if(!(i=Array.isArray(i)&&"number"==typeof i[0]?P.columnVector(i):ue.checkMatrix(i)).isColumnVector()||i.rows!==e.rows)throw new Error("Y must be a column vector of length X.rows");n=i}else n=e.getColumnVector(0);for(var f,h,p,d,y=1,g=0;gc;g++)p=(p=e.transpose().mmul(n).div(n.transpose().mmul(n).get(0,0))).div(p.norm()),f=e.mmul(p).div(p.transpose().mmul(p).get(0,0)),g>0&&(y=f.clone().sub(d).pow(2).sum()),d=f.clone(),i?(h=(h=i.transpose().mmul(f).div(f.transpose().mmul(f).get(0,0))).div(h.norm()),n=i.mmul(h).div(h.transpose().mmul(h).get(0,0))):n=f;if(i){var v=e.transpose().mmul(f).div(f.transpose().mmul(f).get(0,0));v=v.div(v.norm());var m=e.clone().sub(f.clone().mmul(v.transpose())),b=n.transpose().mmul(f).div(f.transpose().mmul(f).get(0,0)),A=i.clone().sub(f.clone().mulS(b.get(0,0)).mmul(h.transpose()));this.t=f,this.p=v.transpose(),this.w=p.transpose(),this.q=h,this.u=n,this.s=f.transpose().mmul(f),this.xResidual=m,this.yResidual=A,this.betas=b}else this.w=p.transpose(),this.s=f.transpose().mmul(f).sqrt(),this.t=a?f.clone().div(this.s.get(0,0)):f,this.xResidual=e.sub(f.mmul(p.transpose()))})},5776:function(t,e,r){"use strict";r.d(e,{IW:function(){return o},LL:function(){return l},XA:function(){return a},g:function(){return s},pd:function(){return u}});var n=r(9019),i=r(4732);function o(t,e,r){var i=[0,0,0,0,0,0,0,0,0];return n.fromTranslation(i,r),n.multiply(t,i,e)}function a(t,e,r){var i=[0,0,0,0,0,0,0,0,0];return n.fromRotation(i,r),n.multiply(t,i,e)}function s(t,e,r){var i=[0,0,0,0,0,0,0,0,0];return n.fromScaling(i,r),n.multiply(t,i,e)}function u(t,e){for(var r,i,u,l=t?[].concat(t):[1,0,0,0,1,0,0,0,1],c=0,f=e.length;c=0;return r?o?2*Math.PI-n:n:o?n:2*Math.PI-n}},2596:function(t,e,r){"use strict";var n=r(621);function i(t,e,r){var i=[0,0,0,0,0,0,0,0,0];return n.mat3.fromTranslation(i,r),n.mat3.multiply(t,i,e)}function o(t,e,r){var i=[0,0,0,0,0,0,0,0,0];return n.mat3.fromRotation(i,r),n.mat3.multiply(t,i,e)}function a(t,e,r){var i=[0,0,0,0,0,0,0,0,0];return n.mat3.fromScaling(i,r),n.mat3.multiply(t,i,e)}function s(t,e){return t[0]*e[1]-e[0]*t[1]}e.pd=function(t,e){for(var r,s,u,l=t?[].concat(t):[1,0,0,0,1,0,0,0,1],c=0,f=e.length;c1){var i=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=i}(0,n.each)(t,function(e,r){isNaN(e)||(t[r]=+e)}),e[r]=t}),e):void 0},s=r(4732);var u=function(t,e,r){void 0===e&&(e=!1),void 0===r&&(r=[[0,0],[1,1]]);for(var n=!!e,i=[],o=0,a=t.length;o2&&(r.push([n].concat(o.splice(0,2))),a="l",n="m"===n?"l":"L"),"o"===a&&1===o.length&&r.push([n,o[0]]),"r"===a)r.push([n].concat(o));else for(;o.length>=e[a]&&(r.push([n].concat(o.splice(0,e[a]))),e[a]););return""}),r}var p=/[a-z]/;function d(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function y(t){var e=h(t);if(!e||!e.length)return[["M",0,0]];for(var r=!1,n=0;n=0){r=!0;break}}if(!r)return e;var o=[],a=0,s=0,u=0,l=0,c=0,f=e[0];"M"!==f[0]&&"m"!==f[0]||(u=a=+f[1],l=s=+f[2],c++,o[0]=["M",a,s]);n=c;for(var y=e.length;n1&&(r*=Math.sqrt(d),i*=Math.sqrt(d));var y=r*r*(p*p)+i*i*(h*h),g=y?Math.sqrt((r*r*(i*i)-y)/y):1;a===s&&(g*=-1),isNaN(g)&&(g=0);var A=i?g*r*p/i:0,x=r?g*-i*h/r:0,w=(u+c)/2+Math.cos(o)*A-Math.sin(o)*x,_=(l+f)/2+Math.sin(o)*A+Math.cos(o)*x,S=[(h-A)/r,(p-x)/i],E=[(-1*h-A)/r,(-1*p-x)/i],C=m([1,0],S),k=m(S,E);return v(S,E)<=-1&&(k=Math.PI),v(S,E)>=1&&(k=0),0===s&&k>0&&(k-=2*Math.PI),1===s&&k<0&&(k+=2*Math.PI),{cx:w,cy:_,rx:b(t,[c,f])?0:r,ry:b(t,[c,f])?0:i,startAngle:C,endAngle:C+k,xRotation:o,arcFlag:a,sweepFlag:s}}function x(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function w(t){for(var e=[],r=null,n=null,i=null,o=0,s=(t=a(t)).length,u=0;u0!=S(s[1]-r)>0&&S(e-(r-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(n=!n)}return n}var k=function(t,e,r){return t>=e&&t<=r};function I(t){for(var e=[],r=t.length,n=0;n1){var a=t[0],s=t[r-1];e.push({from:{x:s[0],y:s[1]},to:{x:a[0],y:a[1]}})}return e}function T(t,e){var r=!1;return(0,n.each)(t,function(t){if(function(t,e,r,n){var i=r.x-t.x,o=r.y-t.y,a=e.x-t.x,s=e.y-t.y,u=n.x-r.x,l=n.y-r.y,c=a*l-s*u,f=null;if(c*c>.001*(a*a+s*s)*(u*u+l*l)){var h=(i*l-o*u)/c,p=(i*s-o*a)/c;k(h,0,1)&&k(p,0,1)&&(f={x:t.x+h*a,y:t.y+h*s})}return f}(t.from,t.to,e.from,e.to))return r=!0,!1}),r}function O(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]});return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,r),maxY:Math.max.apply(null,r)}}function M(t,e){if(t.length<2||e.length<2)return!1;var r,i,o=O(t),a=O(e);if(r=o,(i=a).minX>r.maxX||i.maxXr.maxY||i.maxY-1},o=function(t,e){if(!n(t))return t;for(var r=[],i=0;i-1;)T.call(t,o,1);return t},P=Array.prototype.splice,L=function(t,e){if(!n(t))return[];for(var r=t?e.length:0,i=r-1;r--;){var o=void 0,a=e[r];r!==i&&a===o||(o=a,P.call(t,a,1))}return t},N=function(t,e,r){if(!f(t)&&!b(t))return t;var n=r;return d(t,function(t,r){n=e(n,t,r)}),n},j=function(t,e){var r=[];if(!n(t))return r;for(var i=-1,o=[],a=t.length;++ie[i])return 1;if(t[i]r?r:t},nt=function(t,e){var r=e.toString(),n=r.indexOf(".");if(-1===n)return Math.round(t);var i=r.substr(n+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))},it=function(t){return u(t,"Number")},ot=function(t){return it(t)&&t%1!=0},at=function(t){return it(t)&&t%2==0},st=Number.isInteger?Number.isInteger:function(t){return it(t)&&t%1==0},ut=function(t){return it(t)&&t<0},lt=1e-5;function ct(t,e,r){return void 0===r&&(r=lt),Math.abs(t-e)0},pt=function(t,e){if(f(t)){for(var r,n=-1/0,i=0;in&&(r=o,n=a)}return r}},dt=function(t,e){if(f(t)){for(var r,n=1/0,i=0;ie?(n&&(clearTimeout(n),n=null),s=l,a=t.apply(i,o),n||(i=o=null)):n||!1===r.trailing||(n=setTimeout(u,c)),a};return l.cancel=function(){clearTimeout(n),s=0,n=i=o=null},l},me=function(t){return n(t)?Array.prototype.slice.call(t):[]},be={},Ae=function(t){return be[t=t||"g"]?be[t]+=1:be[t]=1,t+be[t]},xe=function(){},we=function(t){return t};function _e(t){return c(t)?0:n(t)?t.length:Object.keys(t).length}var Se,Ee=r(1635),Ce=$t(function(t,e){void 0===e&&(e={});var r=e.fontSize,n=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return Se||(Se=document.createElement("canvas").getContext("2d")),Se.font=[o,a,i,r+"px",n].join(" "),Se.measureText(R(t)?t:"").width},function(t,e){return void 0===e&&(e={}),(0,Ee.__spreadArrays)([t],St(e)).join("")}),ke=function(t,e,r,n){void 0===n&&(n="...");var i,o,a=Ce(n,r),s=R(t)?t:Ct(t),u=e,l=[];if(Ce(t,r)<=e)return t;for(;i=s.substr(0,16),!((o=Ce(i,r))+a>u&&o>u);)if(l.push(i),u-=o,!(s=s.substr(16)))return l.join("");for(;i=s.substr(0,1),!((o=Ce(i,r))+a>u);)if(l.push(i),u-=o,!(s=s.substr(1)))return l.join("");return""+l.join("")+n},Ie=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var r=this.map[t];return void 0===r?e:r},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}()},5805:function(t,e,r){var n=r(3970),i={};for(var o in n)n.hasOwnProperty(o)&&(i[n[o]]=o);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var s in a)if(a.hasOwnProperty(s)){if(!("channels"in a[s]))throw new Error("missing channels property: "+s);if(!("labels"in a[s]))throw new Error("missing channel labels property: "+s);if(a[s].labels.length!==a[s].channels)throw new Error("channel and label counts mismatch: "+s);var u=a[s].channels,l=a[s].labels;delete a[s].channels,delete a[s].labels,Object.defineProperty(a[s],"channels",{value:u}),Object.defineProperty(a[s],"labels",{value:l})}a.rgb.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(n,i,o),s=Math.max(n,i,o),u=s-a;return s===a?e=0:n===s?e=(i-o)/u:i===s?e=2+(o-n)/u:o===s&&(e=4+(n-i)/u),(e=Math.min(60*e,360))<0&&(e+=360),r=(a+s)/2,[e,100*(s===a?0:r<=.5?u/(s+a):u/(2-s-a)),100*r]},a.rgb.hsv=function(t){var e,r,n,i,o,a=t[0]/255,s=t[1]/255,u=t[2]/255,l=Math.max(a,s,u),c=l-Math.min(a,s,u),f=function(t){return(l-t)/6/c+.5};return 0===c?i=o=0:(o=c/l,e=f(a),r=f(s),n=f(u),a===l?i=n-r:s===l?i=1/3+e-n:u===l&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*l]},a.rgb.hwb=function(t){var e=t[0],r=t[1],n=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(r,n))),100*(n=1-1/255*Math.max(e,Math.max(r,n)))]},a.rgb.cmyk=function(t){var e,r=t[0]/255,n=t[1]/255,i=t[2]/255;return[100*((1-r-(e=Math.min(1-r,1-n,1-i)))/(1-e)||0),100*((1-n-e)/(1-e)||0),100*((1-i-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var e=i[t];if(e)return e;var r,o,a,s=1/0;for(var u in n)if(n.hasOwnProperty(u)){var l=n[u],c=(o=t,a=l,Math.pow(o[0]-a[0],2)+Math.pow(o[1]-a[1],2)+Math.pow(o[2]-a[2],2));c.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*e+.7152*r+.0722*n),100*(.0193*e+.1192*r+.9505*n)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),r=e[0],n=e[1],i=e[2];return n/=100,i/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.hsl.rgb=function(t){var e,r,n,i,o,a=t[0]/360,s=t[1]/100,u=t[2]/100;if(0===s)return[o=255*u,o,o];e=2*u-(r=u<.5?u*(1+s):u+s-u*s),i=[0,0,0];for(var l=0;l<3;l++)(n=a+1/3*-(l-1))<0&&n++,n>1&&n--,o=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[l]=255*o;return i},a.hsl.hsv=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,i=r,o=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,i*=o<=1?o:2-o,[e,100*(0===n?2*i/(o+i):2*r/(n+r)),100*((n+r)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),a=255*n*(1-r),s=255*n*(1-r*o),u=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,u,a];case 1:return[s,n,a];case 2:return[a,n,u];case 3:return[a,s,n];case 4:return[u,a,n];case 5:return[n,a,s]}},a.hsv.hsl=function(t){var e,r,n,i=t[0],o=t[1]/100,a=t[2]/100,s=Math.max(a,.01);return n=(2-o)*a,r=o*s,[i,100*(r=(r/=(e=(2-o)*s)<=1?e:2-e)||0),100*(n/=2)]},a.hwb.rgb=function(t){var e,r,n,i,o,a,s,u=t[0]/360,l=t[1]/100,c=t[2]/100,f=l+c;switch(f>1&&(l/=f,c/=f),r=1-c,n=6*u-(e=Math.floor(6*u)),0!=(1&e)&&(n=1-n),i=l+n*(r-l),e){default:case 6:case 0:o=r,a=i,s=l;break;case 1:o=i,a=r,s=l;break;case 2:o=l,a=r,s=i;break;case 3:o=l,a=i,s=r;break;case 4:o=i,a=l,s=r;break;case 5:o=r,a=l,s=i}return[255*o,255*a,255*s]},a.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i))]},a.xyz.rgb=function(t){var e,r,n,i=t[0]/100,o=t[1]/100,a=t[2]/100;return r=-.9689*i+1.8758*o+.0415*a,n=.0557*i+-.204*o+1.057*a,e=(e=3.2406*i+-1.5372*o+-.4986*a)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(e=Math.min(Math.max(0,e),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},a.xyz.lab=function(t){var e=t[0],r=t[1],n=t[2];return r/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(e-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},a.lab.xyz=function(t){var e,r,n,i=t[0],o=t[1],a=t[2];e=o/500+(r=(i+16)/116),n=r-a/200;var s=Math.pow(r,3),u=Math.pow(e,3),l=Math.pow(n,3);return r=s>.008856?s:(r-16/116)/7.787,e=u>.008856?u:(e-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,[e*=95.047,r*=100,n*=108.883]},a.lab.lch=function(t){var e,r=t[0],n=t[1],i=t[2];return(e=360*Math.atan2(i,n)/2/Math.PI)<0&&(e+=360),[r,Math.sqrt(n*n+i*i),e]},a.lch.lab=function(t){var e,r=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[r,n*Math.cos(e),n*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],r=t[1],n=t[2],i=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(i=Math.round(i/50)))return 30;var o=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(e/255));return 2===i&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var r=.5*(1+~~(t>50));return[(1&e)*r*255,(e>>1&1)*r*255,(e>>2&1)*r*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var r;return t-=16,[Math.floor(t/36)/5*255,Math.floor((r=t%36)/6)/5*255,r%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var r=e[0];3===e[0].length&&(r=r.split("").map(function(t){return t+t}).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},a.rgb.hcg=function(t){var e,r,n=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.max(Math.max(n,i),o),s=Math.min(Math.min(n,i),o),u=a-s;return e=u<1?s/(1-u):0,r=u<=0?0:a===n?(i-o)/u%6:a===i?2+(o-n)/u:4+(n-i)/u+4,r/=6,[360*(r%=1),100*u,100*e]},a.hsl.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=1,i=0;return(n=r<.5?2*e*r:2*e*(1-r))<1&&(i=(r-.5*n)/(1-n)),[t[0],100*n,100*i]},a.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],100*n,100*i]},a.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100;if(0===r)return[255*n,255*n,255*n];var i,o=[0,0,0],a=e%1*6,s=a%1,u=1-s;switch(Math.floor(a)){case 0:o[0]=1,o[1]=s,o[2]=0;break;case 1:o[0]=u,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=s;break;case 3:o[0]=0,o[1]=u,o[2]=1;break;case 4:o[0]=s,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=u}return i=(1-r)*n,[255*(r*o[0]+i),255*(r*o[1]+i),255*(r*o[2]+i)]},a.hcg.hsv=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e),n=0;return r>0&&(n=e/r),[t[0],100*n,100*r]},a.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100*(1-e)+.5*e,n=0;return r>0&&r<.5?n=e/(2*r):r>=.5&&r<1&&(n=e/(2*(1-r))),[t[0],100*n,100*r]},a.hcg.hwb=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e);return[t[0],100*(r-e),100*(1-r)]},a.hwb.hcg=function(t){var e=t[1]/100,r=1-t[2]/100,n=r-e,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],100*n,100*i]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},2832:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(5805),o=r(3617),a={};Object.keys(i).forEach(function(t){a[t]={},Object.defineProperty(a[t],"channels",{value:i[t].channels}),Object.defineProperty(a[t],"labels",{value:i[t].labels});var e=o(t);Object.keys(e).forEach(function(r){var i=e[r];a[t][r]=function(t){var e=function(e){if(void 0===e||null===e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var r=t(e);if("object"===n(r))for(var i=r.length,o=0;o1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)})}),t.exports=a},3617:function(t,e,r){var n=r(5805);function i(t){var e=function(){for(var t={},e=Object.keys(n),r=e.length,i=0;i=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},u.to.keyword=function(t){return a[t.slice(0,3)]}},2630:function(t,e,r){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(1288),o=r(2832),a=[].slice,s=["keyword","gray","hex"],u={};Object.keys(o).forEach(function(t){u[a.call(o[t].labels).sort().join("")]=t});var l={};function c(t,e){if(!(this instanceof c))return new c(t,e);if(e&&e in s&&(e=null),e&&!(e in o))throw new Error("Unknown model: "+e);var r,n;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof c)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var f=i.get(t);if(null===f)throw new Error("Unable to parse color from string: "+t);this.model=f.model,n=o[this.model].channels,this.color=f.value.slice(0,n),this.valpha="number"==typeof f.value[n]?f.value[n]:1}else if(t.length){this.model=e||"rgb",n=o[this.model].channels;var h=a.call(t,0,n);this.color=p(h,n),this.valpha="number"==typeof t[n]?t[n]:1}else if("number"==typeof t)t&=16777215,this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var d=Object.keys(t);"alpha"in t&&(d.splice(d.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var y=d.sort().join("");if(!(y in u))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=u[y];var g=o[this.model].labels,v=[];for(r=0;rr?(e+.05)/(r+.05):(r+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return c.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),r=e.color[0];return r=(r=(r+t)%360)<0?360+r:r,e.color[0]=r,e},mix:function(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+n(t));var r=t.rgb(),i=this.rgb(),o=void 0===e?.5:e,a=2*o-1,s=r.alpha()-i.alpha(),u=((a*s==-1?a:(a+s)/(1+a*s))+1)/2,l=1-u;return c.rgb(u*r.red()+l*i.red(),u*r.green()+l*i.green(),u*r.blue()+l*i.blue(),r.alpha()*o+i.alpha()*(1-o))}},Object.keys(o).forEach(function(t){if(-1===s.indexOf(t)){var e=o[t].channels;c.prototype[t]=function(){if(this.model===t)return new c(this);if(arguments.length)return new c(arguments,t);var r,n="number"==typeof arguments[e]?e:this.valpha;return new c((r=o[this.model][t].raw(this.color),Array.isArray(r)?r:[r]).concat(n),t)},c[t]=function(r){return"number"==typeof r&&(r=p(a.call(arguments),e)),new c(r,t)}}}),t.exports=c},3472:function(t,e,r){"use strict";function n(t,e){var r,n=1;function i(){var i,o,a=r.length,s=0,u=0;for(i=0;ip+c||id+c||of.index){var h=p-s.x-s.vx,v=d-s.y-s.vy,m=h*h+v*v;mt.r&&(t.r=t[e].r)}function p(){if(e){var n,i,o=e.length;for(r=new Array(o),n=0;n=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a0)for(var r,n,i=new Array(r),o=0;o1?(null==r?u.delete(t):u.set(t,y(r)),e):u.get(t)},find:function(e,r,n){var i,o,a,s,u,l=0,c=t.length;for(null==n?n=1/0:n*=n,l=0;l1?(c.on(t,r),e):c.on(t)}}}function T(){var t,e,r,n,s,u=o(-30),l=1,c=1/0,f=.81;function h(r){var o,a=t.length,s=(0,i.A)(t,S,E).visitAfter(d);for(n=r,o=0;o=c)){(t.data!==e||t.next)&&(0===h&&(y+=(h=a(r))*h),0===p&&(y+=(p=a(r))*p),y=(o=(y+v)/2))?y=o:v=o,(c=r>=(a=(g+m)/2))?g=a:m=a,i=p,!(p=p[f=c<<1|l]))return i[f]=d,t;if(s=+t._x.call(null,p.data),u=+t._y.call(null,p.data),e===s&&r===u)return d.next=p,i?i[f]=d:t._root=d,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(l=e>=(o=(y+v)/2))?y=o:v=o,(c=r>=(a=(g+m)/2))?g=a:m=a}while((f=c<<1|l)==(h=(u>=a)<<1|s>=o));return i[h]=p,i[f]=d,t}function i(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i}function o(t){return t[0]}function a(t){return t[1]}function s(t,e,r){var n=new u(null==e?o:e,null==r?a:r,NaN,NaN,NaN,NaN);return null==t?n:n.addAll(t)}function u(t,e,r,n,i,o){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=o,this._root=void 0}function l(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}r.d(e,{A:function(){return s}});var c=s.prototype=u.prototype;c.copy=function(){var t,e,r=new u(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=l(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=l(e));return r},c.add=function(t){var e=+this._x.call(null,t),r=+this._y.call(null,t);return n(this.cover(e,r),e,r,t)},c.addAll=function(t){var e,r,i,o,a=t.length,s=new Array(a),u=new Array(a),l=1/0,c=1/0,f=-1/0,h=-1/0;for(r=0;rf&&(f=i),oh&&(h=o));if(l>f||c>h)return this;for(this.cover(l,c).cover(f,h),r=0;rt||t>=i||n>e||e>=o;)switch(s=(ep||(a=l.y0)>d||(s=l.x1)=m)<<1|t>=v)&&(l=y[y.length-1],y[y.length-1]=y[y.length-1-c],y[y.length-1-c]=l)}else{var b=t-+this._x.call(null,g.data),A=e-+this._y.call(null,g.data),x=b*b+A*A;if(x=(s=(d+g)/2))?d=s:g=s,(c=a>=(u=(y+v)/2))?y=u:v=u,e=p,!(p=p[f=c<<1|l]))return this;if(!p.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(r=e,h=f)}for(;p.data!==t;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):e?(i?e[f]=i:delete e[f],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(r?r[h]=p:this._root=p),this):(this._root=i,this)},c.removeAll=function(t){for(var e=0,r=t.length;e=0&&e._call.call(null,t),e=e._next;--a}()}finally{a=0,function(){var t,e,r=i,n=1/0;for(;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:i=e);o=t,x(n)}(),f=0}}function A(){var t=p.now(),e=t-c;e>l&&(h-=e,c=t)}function x(t){a||(s&&(s=clearTimeout(s)),t-f>24?(t<1/0&&(s=setTimeout(b,t-p.now()-h)),u&&(u=clearInterval(u))):(u||(c=p.now(),u=setInterval(A,l)),a=1,d(b)))}v.prototype=m.prototype={constructor:v,restart:function(t,e,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?y():+r)+(null==e?0:+e),this._next||o===this||(o?o._next=this:i=this,o=this),this._call=t,this._time=r,x()},stop:function(){this._call&&(this._call=null,this._time=1/0,x())}}},3963:function(t,e,r){"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=l(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function i(t){return function(t){if(Array.isArray(t))return c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e,r){return e=a(e),function(t,e){if(e&&("object"===y(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],a(t).constructor):e.apply(t,r))}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function u(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){if(t){if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g,a=JSON.parse(JSON.stringify(o)),s=(null===(t=null==i?void 0:i.graph)||void 0===t?void 0:t.meta)||{},u=(null===(e=null==i?void 0:i.subScene)||void 0===e?void 0:e.meta)||{},l=(null===(r=null==i?void 0:i.nodeSize)||void 0===r?void 0:r.meta)||{},c=(null===(n=null==i?void 0:i.nodeSize)||void 0===n?void 0:n.node)||{},f=a.nodeSize.bridge;return{graph:{meta:Object.assign(a.graph.meta,s)},subScene:{meta:Object.assign(a.subScene.meta,u)},nodeSize:{meta:Object.assign(a.nodeSize.meta,l),node:Object.assign(a.nodeSize.node,c),bridge:f}}}function m(t){return"◬".concat(t,"◬")}var b,A,x,w,_=m("ROOT"),S=m("BRIDGE_GRAPH");!function(t){t[t.META=0]="META",t[t.NODE=1]="NODE",t[t.BRIDGE=2]="BRIDGE"}(b||(b={})),function(t){t[t.INCLUDE=0]="INCLUDE",t[t.EXCLUDE=1]="EXCLUDE",t[t.UNSPECIFIED=2]="UNSPECIFIED"}(A||(A={})),function(t){t[t.META=0]="META",t[t.CORE=1]="CORE",t[t.BRIDGE=2]="BRIDGE"}(x||(x={})),function(t){t[t.META=0]="META",t[t.OP=1]="OP",t[t.SERIES=2]="SERIES"}(w||(w={}));var E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{};function C(t,e){return t(e={exports:{}},e.exports),e.exports}var k=function(t,e){return t===e||t!=t&&e!=e},I=function(t,e){for(var r=t.length;r--;)if(k(t[r][0],e))return r;return-1},T=Array.prototype.splice;function O(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1},O.prototype.set=function(t,e){var r=this.__data__,n=I(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var M,P=O,L="object"==y(E)&&E&&E.Object===Object&&E,N="object"==("undefined"==typeof self?"undefined":y(self))&&self&&self.Object===Object&&self,j=L||N||Function("return this")(),R=j.Symbol,D=Object.prototype,B=D.hasOwnProperty,F=D.toString,z=R?R.toStringTag:void 0,G=Object.prototype.toString,U=R?R.toStringTag:void 0,H=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":U&&U in Object(t)?function(t){var e=B.call(t,z),r=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=F.call(t);return n&&(e?t[z]=r:delete t[z]),i}(t):function(t){return G.call(t)}(t)},V=function(t){var e=y(t);return null!=t&&("object"==e||"function"==e)},Q=function(t){if(!V(t))return!1;var e=H(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},Y=j["__core-js_shared__"],W=(M=/[^.]+$/.exec(Y&&Y.keys&&Y.keys.IE_PROTO||""))?"Symbol(src)_1."+M:"",q=Function.prototype.toString,X=function(t){if(null!=t){try{return q.call(t)}catch(t){}try{return t+""}catch(t){}}return""},K=/^\[object .+?Constructor\]$/,J=Function.prototype,Z=Object.prototype,$=J.toString,tt=Z.hasOwnProperty,et=RegExp("^"+$.call(tt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=function(t){return!(!V(t)||function(t){return!!W&&W in t}(t))&&(Q(t)?et:K).test(X(t))},nt=function(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return rt(r)?r:void 0},it=nt(j,"Map"),ot=nt(Object,"create"),at=Object.prototype.hasOwnProperty,st=Object.prototype.hasOwnProperty;function ut(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991},Lt={};Lt["[object Float32Array]"]=Lt["[object Float64Array]"]=Lt["[object Int8Array]"]=Lt["[object Int16Array]"]=Lt["[object Int32Array]"]=Lt["[object Uint8Array]"]=Lt["[object Uint8ClampedArray]"]=Lt["[object Uint16Array]"]=Lt["[object Uint32Array]"]=!0,Lt["[object Arguments]"]=Lt["[object Array]"]=Lt["[object ArrayBuffer]"]=Lt["[object Boolean]"]=Lt["[object DataView]"]=Lt["[object Date]"]=Lt["[object Error]"]=Lt["[object Function]"]=Lt["[object Map]"]=Lt["[object Number]"]=Lt["[object Object]"]=Lt["[object RegExp]"]=Lt["[object Set]"]=Lt["[object String]"]=Lt["[object WeakMap]"]=!1;var Nt=function(t){return function(e){return t(e)}},jt=C(function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,i=n&&n.exports===r&&L.process,o=function(){try{return n&&n.require&&n.require("util").types||i&&i.binding&&i.binding("util")}catch(t){}}();t.exports=o}),Rt=jt&&jt.isTypedArray,Dt=Rt?Nt(Rt):function(t){return xt(t)&&Pt(t.length)&&!!Lt[H(t)]},Bt=Object.prototype.hasOwnProperty,Ft=function(t,e){var r=kt(t),n=!r&&Ct(t),i=!r&&!n&&Tt(t),o=!r&&!n&&!i&&Dt(t),a=r||n||i||o,s=a?function(t,e){for(var r=-1,n=Array(t);++rs))return!1;var l=o.get(t),c=o.get(e);if(l&&c)return l==e&&c==t;var f=-1,h=!0,p=2&r?new Ye:void 0;for(o.set(t,e),o.set(e,t);++f0&&n(u)?r>1?t(u,r-1,n,i,o):ie(o,u):i||(o[o.length]=u)}return o},on=Math.max,an=function(t,e,r){return e=on(void 0===e?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=on(n.length-e,0),a=Array(o);++i0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(sn),cn=function(t,e){return ln(an(t,e,Ge),t+"")},fn=function(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o-1},dn=function(t,e,r){for(var n=-1,i=null==t?0:t.length;++n=200){var l=e?null:yn(t);if(l)return Je(l);a=!1,i=qe,u=new Ye}else u=e?[]:s;t:for(;++no){var a=i;i=o,o=a}return i+""+o+""+(bn.isUndefined(n)?"\0":n)}function En(t,e){return Sn(t,e.v,e.w,e.name)}xn.prototype._nodeCount=0,xn.prototype._edgeCount=0,xn.prototype.isDirected=function(){return this._isDirected},xn.prototype.isMultigraph=function(){return this._isMultigraph},xn.prototype.isCompound=function(){return this._isCompound},xn.prototype.setGraph=function(t){return this._label=t,this},xn.prototype.graph=function(){return this._label},xn.prototype.setDefaultNodeLabel=function(t){return bn.isFunction(t)||(t=bn.constant(t)),this._defaultNodeLabelFn=t,this},xn.prototype.nodeCount=function(){return this._nodeCount},xn.prototype.nodes=function(){return bn.keys(this._nodes)},xn.prototype.sources=function(){var t=this;return bn.filter(this.nodes(),function(e){return bn.isEmpty(t._in[e])})},xn.prototype.sinks=function(){var t=this;return bn.filter(this.nodes(),function(e){return bn.isEmpty(t._out[e])})},xn.prototype.setNodes=function(t,e){var r=arguments,n=this;return bn.each(t,function(t){r.length>1?n.setNode(t,e):n.setNode(t)}),this},xn.prototype.setNode=function(t,e){return bn.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},xn.prototype.node=function(t){return this._nodes[t]},xn.prototype.hasNode=function(t){return bn.has(this._nodes,t)},xn.prototype.removeNode=function(t){var e=this;if(bn.has(this._nodes,t)){var r=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],bn.each(this.children(t),function(t){e.setParent(t)}),delete this._children[t]),bn.each(bn.keys(this._in[t]),r),delete this._in[t],delete this._preds[t],bn.each(bn.keys(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},xn.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(bn.isUndefined(e))e="\0";else{for(var r=e+="";!bn.isUndefined(r);r=this.parent(r))if(r===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},xn.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},xn.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},xn.prototype.children=function(t){if(bn.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return bn.keys(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}},xn.prototype.predecessors=function(t){var e=this._preds[t];if(e)return bn.keys(e)},xn.prototype.successors=function(t){var e=this._sucs[t];if(e)return bn.keys(e)},xn.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return bn.union(e,this.successors(t))},xn.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},xn.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var r=this;bn.each(this._nodes,function(r,n){t(n)&&e.setNode(n,r)}),bn.each(this._edgeObjs,function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,r.edge(t))});var n={};return this._isCompound&&bn.each(e.nodes(),function(t){e.setParent(t,function t(i){var o=r.parent(i);return void 0===o||e.hasNode(o)?(n[i]=o,o):o in n?n[o]:t(o)}(t))}),e},xn.prototype.setDefaultEdgeLabel=function(t){return bn.isFunction(t)||(t=bn.constant(t)),this._defaultEdgeLabelFn=t,this},xn.prototype.edgeCount=function(){return this._edgeCount},xn.prototype.edges=function(){return bn.values(this._edgeObjs)},xn.prototype.setPath=function(t,e){var r=this,n=arguments;return bn.reduce(t,function(t,i){return n.length>1?r.setEdge(t,i,e):r.setEdge(t,i),i}),this},xn.prototype.setEdge=function(){var t,e,r,n,i=!1,o=arguments[0];"object"==y(o)&&null!==o&&"v"in o?(t=o.v,e=o.w,r=o.name,2===arguments.length&&(n=arguments[1],i=!0)):(t=o,e=arguments[1],r=arguments[3],arguments.length>2&&(n=arguments[2],i=!0)),t=""+t,e=""+e,bn.isUndefined(r)||(r=""+r);var a=Sn(this._isDirected,t,e,r);if(bn.has(this._edgeLabels,a))return i&&(this._edgeLabels[a]=n),this;if(!bn.isUndefined(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[a]=i?n:this._defaultEdgeLabelFn(t,e,r);var s=function(t,e,r,n){var i=""+e,o=""+r;if(!t&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return n&&(s.name=n),s}(this._isDirected,t,e,r);return t=s.v,e=s.w,Object.freeze(s),this._edgeObjs[a]=s,wn(this._preds[e],t),wn(this._sucs[t],e),this._in[e][a]=s,this._out[t][a]=s,this._edgeCount++,this},xn.prototype.edge=function(t,e,r){var n=1===arguments.length?En(this._isDirected,arguments[0]):Sn(this._isDirected,t,e,r);return this._edgeLabels[n]},xn.prototype.hasEdge=function(t,e,r){var n=1===arguments.length?En(this._isDirected,arguments[0]):Sn(this._isDirected,t,e,r);return bn.has(this._edgeLabels,n)},xn.prototype.removeEdge=function(t,e,r){var n=1===arguments.length?En(this._isDirected,arguments[0]):Sn(this._isDirected,t,e,r),i=this._edgeObjs[n];return i&&(t=i.v,e=i.w,delete this._edgeLabels[n],delete this._edgeObjs[n],_n(this._preds[e],t),_n(this._sucs[t],e),delete this._in[e][n],delete this._out[t][n],this._edgeCount--),this},xn.prototype.inEdges=function(t,e){var r=this._in[t];if(r){var n=bn.values(r);return e?bn.filter(n,function(t){return t.v===e}):n}},xn.prototype.outEdges=function(t,e){var r=this._out[t];if(r){var n=bn.values(r);return e?bn.filter(n,function(t){return t.w===e}):n}},xn.prototype.nodeEdges=function(t,e){var r=this.inEdges(t,e);if(r)return r.concat(this.outEdges(t,e))};var Cn={Graph:An,version:"2.1.8"},kn={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:function(t){return bn.map(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return bn.isUndefined(r)||(i.value=r),bn.isUndefined(n)||(i.parent=n),i})}(t),edges:function(t){return bn.map(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return bn.isUndefined(e.name)||(n.name=e.name),bn.isUndefined(r)||(n.value=r),n})}(t)};return bn.isUndefined(t.graph())||(e.value=bn.clone(t.graph())),e},read:function(t){var e=new An(t.options).setGraph(t.value);return bn.each(t.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),bn.each(t.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}};var In=Tn;function Tn(){this._arr=[],this._keyIndices={}}Tn.prototype.size=function(){return this._arr.length},Tn.prototype.keys=function(){return this._arr.map(function(t){return t.key})},Tn.prototype.has=function(t){return bn.has(this._keyIndices,t)},Tn.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},Tn.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},Tn.prototype.add=function(t,e){var r=this._keyIndices;if(t=String(t),!bn.has(r,t)){var n=this._arr,i=n.length;return r[t]=i,n.push({key:t,priority:e}),this._decrease(i),!0}return!1},Tn.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},Tn.prototype.decrease=function(t,e){var r=this._keyIndices[t];if(e>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[r].priority+" New: "+e);this._arr[r].priority=e,this._decrease(r)},Tn.prototype._heapify=function(t){var e=this._arr,r=2*t,n=r+1,i=t;r>1].priority0&&(i=s.removeMin(),(o=a[i]).distance!==Number.POSITIVE_INFINITY);)n(i).forEach(u);return a}(t,String(e),r||Mn,n||function(e){return t.outEdges(e)})},Mn=bn.constant(1),Pn=function(t){var e=0,r=[],n={},i=[];function o(a){var s=n[a]={onStack:!0,lowlink:e,index:e++};if(r.push(a),t.successors(a).forEach(function(t){bn.has(n,t)?n[t].onStack&&(s.lowlink=Math.min(s.lowlink,n[t].index)):(o(t),s.lowlink=Math.min(s.lowlink,n[t].lowlink))}),s.lowlink===s.index){var u,l=[];do{u=r.pop(),n[u].onStack=!1,l.push(u)}while(a!==u);i.push(l)}}return t.nodes().forEach(function(t){bn.has(n,t)||o(t)}),i},Ln=bn.constant(1),Nn=jn;function jn(t){var e={},r={},n=[];if(bn.each(t.sinks(),function i(o){if(bn.has(r,o))throw new Rn;bn.has(e,o)||(r[o]=!0,e[o]=!0,bn.each(t.predecessors(o),i),delete r[o],n.push(o))}),bn.size(e)!==t.nodeCount())throw new Rn;return n}function Rn(){}jn.CycleException=Rn,Rn.prototype=new Error;var Dn=function(t,e,r){bn.isArray(e)||(e=[e]);var n=(t.isDirected()?t.successors:t.neighbors).bind(t),i=[],o={};return bn.each(e,function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);!function t(e,r,n,i,o,a){bn.has(i,r)||(i[r]=!0,n||a.push(r),bn.each(o(r),function(r){t(e,r,n,i,o,a)}),n&&a.push(r))}(t,e,"post"===r,o,n,i)}),i};var Bn,Fn={Graph:Cn.Graph,json:kn,alg:{components:function(t){var e,r={},n=[];function i(n){bn.has(r,n)||(r[n]=!0,e.push(n),bn.each(t.successors(n),i),bn.each(t.predecessors(n),i))}return bn.each(t.nodes(),function(t){e=[],i(t),e.length&&n.push(e)}),n},dijkstra:On,dijkstraAll:function(t,e,r){return bn.transform(t.nodes(),function(n,i){n[i]=On(t,i,e,r)},{})},findCycles:function(t){return bn.filter(Pn(t),function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})},floydWarshall:function(t,e,r){return function(t,e,r){var n={},i=t.nodes();return i.forEach(function(t){n[t]={},n[t][t]={distance:0},i.forEach(function(e){t!==e&&(n[t][e]={distance:Number.POSITIVE_INFINITY})}),r(t).forEach(function(r){var i=r.v===t?r.w:r.v,o=e(r);n[t][i]={distance:o,predecessor:t}})}),i.forEach(function(t){var e=n[t];i.forEach(function(r){var o=n[r];i.forEach(function(r){var n=o[t],i=e[r],a=o[r],s=n.distance+i.distance;s0;){if(r=o.removeMin(),bn.has(i,r))n.setEdge(r,i[r]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(r).forEach(a)}return n},tarjan:Pn,topsort:Nn},version:Cn.version};try{Bn=Fn}catch(g){}Bn||(Bn=window.graphlib);var zn,Gn=Bn,Un=function(t,e,r){if(!V(r))return!1;var n=y(e);return!!("number"==n?Yt(r)&&Mt(e,r.length):"string"==n&&e in r)&&k(r[e],t)},Hn=Object.prototype,Vn=Hn.hasOwnProperty,Qn=cn(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&Un(e[0],e[1],i)&&(n=1);++r-1?i[o?e[a]:a]:void 0}}(function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:function(t){var e=Jn(t),r=e%1;return e==e?r?e-r:e:0}(r);return i<0&&(i=Zn(n+i,0)),fn(t,Mr(e),i)}),ti=function(t){return null!=t&&t.length?nn(t,1):[]},ei=function(t,e,r){for(var n=-1,i=t.length;++ne},ni=function(t,e,r){(void 0!==r&&!k(t[e],r)||void 0===r&&!(e in t))&&vt(t,e,r)},ii=Function.prototype,oi=Object.prototype,ai=ii.toString,si=oi.hasOwnProperty,ui=ai.call(Object),li=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},ci=function(t,e,r,n,i,o,a){var s=li(t,r),u=li(e,r),l=a.get(u);if(l)ni(t,r,l);else{var c=o?o(s,u,r+"",t,e,a):void 0,f=void 0===c;if(f){var h=kt(u),p=!h&&Tt(u),d=!h&&!p&&Dt(u);c=u,h||p||d?kt(s)?c=s:gn(s)?c=Zt(s):p?(f=!1,c=Jt(u,!0)):d?(f=!1,c=Ce(u,!0)):c=[]:function(t){if(!xt(t)||"[object Object]"!=H(t))return!1;var e=oe(t);if(null===e)return!0;var r=si.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&ai.call(r)==ui}(u)||Ct(u)?(c=s,Ct(s)?c=function(t){return At(t,Kt(t))}(s):V(s)&&!Q(s)||(c=Oe(u))):f=!1}f&&(a.set(u,c),i(c,u,n,o,a),a.delete(u)),ni(t,r,c)}},fi=function(t){return cn(function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,a&&Un(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++ne||o&&a&&u&&!s&&!l||n&&a&&u||!r&&u||!i)return 1;if(!n&&!o&&!l&&t=s?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)})},xi=cn(function(t,e){if(null==t)return[];var r=e.length;return r>1&&Un(t,e[0],e[1])?e=[]:r>2&&Un(e[0],e[1],e[2])&&(e=[e[0]]),Ai(t,nn(e,1),[])}),wi=0;try{zn={cloneDeep:function(t){return Re(t,5)},constant:De,defaults:Qn,each:Ve,filter:Pr,find:$n,flatten:ti,forEach:He,forIn:function(t,e){return null==t?t:Be(t,Ue(e),Kt)},has:jr,isUndefined:Dr,last:function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0},map:Fr,mapValues:function(t,e){var r={};return e=Mr(e),Fe(t,function(t,n,i){vt(r,n,e(t,n,i))}),r},max:function(t){return t&&t.length?ei(t,Ge,ri):void 0},merge:fi,min:function(t){return t&&t.length?ei(t,Ge,hi):void 0},minBy:function(t,e){return t&&t.length?ei(t,Mr(e),hi):void 0},now:function(){return j.Date.now()},pick:yi,range:mi,reduce:Ur,sortBy:xi,uniqueId:function(t){var e=++wi;return xr(t)+e},values:mn,zipObject:function(t,e){return function(t,e,r){for(var n=-1,i=t.length,o=e.length,a={};++n0;--s)if(n=e[s].dequeue()){i=i.concat(Oi(t,e,r,n,!0));break}}return i}(r.graph,r.buckets,r.zeroIdx);return _i.flatten(_i.map(n,function(e){return t.outEdges(e.v,e.w)}),!0)}(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],r={},n={};return _i.forEach(t.nodes(),function i(o){_i.has(n,o)||(n[o]=!0,r[o]=!0,_i.forEach(t.outEdges(o),function(t){_i.has(r,t.w)?e.push(t):i(t.w)}),delete r[o])}),e}(t);_i.forEach(e,function(e){var r=t.edge(e);t.removeEdge(e),r.forwardName=e.name,r.reversed=!0,t.setEdge(e.w,e.v,r,_i.uniqueId("rev"))})},Li=function(t){_i.forEach(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})},Ni=Gn.Graph,ji={addDummyNode:Ri,simplify:function(t){var e=(new Ni).setGraph(t.graph());return _i.forEach(t.nodes(),function(r){e.setNode(r,t.node(r))}),_i.forEach(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e},asNonCompoundGraph:function(t){var e=new Ni({multigraph:t.isMultigraph()}).setGraph(t.graph());return _i.forEach(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),_i.forEach(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e},successorWeights:function(t){var e=_i.map(t.nodes(),function(e){var r={};return _i.forEach(t.outEdges(e),function(e){r[e.w]=(r[e.w]||0)+t.edge(e).weight}),r});return _i.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=_i.map(t.nodes(),function(e){var r={};return _i.forEach(t.inEdges(e),function(e){r[e.v]=(r[e.v]||0)+t.edge(e).weight}),r});return _i.zipObject(t.nodes(),e)},intersectRect:function(t,e){var r,n,i=t.x,o=t.y,a=e.x-i,s=e.y-o,u=t.width/2,l=t.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*u>Math.abs(a)*l?(s<0&&(l=-l),r=l*a/s,n=l):(a<0&&(u=-u),r=u,n=u*s/a),{x:i+r,y:o+n}},buildLayerMatrix:function(t){var e=_i.map(_i.range(Di(t)+1),function(){return[]});return _i.forEach(t.nodes(),function(r){var n=t.node(r),i=n.rank;_i.isUndefined(i)||(e[i][n.order]=r)}),e},normalizeRanks:function(t){var e=_i.min(_i.map(t.nodes(),function(e){return t.node(e).rank}));_i.forEach(t.nodes(),function(r){var n=t.node(r);_i.has(n,"rank")&&(n.rank-=e)})},removeEmptyRanks:function(t){var e=_i.min(_i.map(t.nodes(),function(e){return t.node(e).rank})),r=[];_i.forEach(t.nodes(),function(n){var i=t.node(n).rank-e;r[i]||(r[i]=[]),r[i].push(n)});var n=0,i=t.graph().nodeRankFactor;_i.forEach(r,function(e,r){_i.isUndefined(e)&&r%i!=0?--n:n&&_i.forEach(e,function(e){t.node(e).rank+=n})})},addBorderNode:function(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),Ri(t,"border",i,e)},maxRank:Di,partition:function(t,e){var r={lhs:[],rhs:[]};return _i.forEach(t,function(t){e(t)?r.lhs.push(t):r.rhs.push(t)}),r},time:function(t,e){var r=_i.now();try{return e()}finally{console.log(t+" time: "+(_i.now()-r)+"ms")}},notime:function(t,e){return e()}};function Ri(t,e,r,n){var i;do{i=_i.uniqueId(n)}while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function Di(t){return _i.max(_i.map(t.nodes(),function(e){var r=t.node(e).rank;if(!_i.isUndefined(r))return r}))}var Bi=function(t){t.graph().dummyChains=[],_i.forEach(t.edges(),function(e){!function(t,e){var r,n,i,o=e.v,a=t.node(o).rank,s=e.w,u=t.node(s).rank,l=e.name,c=t.edge(e),f=c.labelRank;if(u!==a+1){for(t.removeEdge(e),i=0,++a;aa.lim&&(s=a,u=!0);var l=_i.filter(e.edges(),function(e){return u===so(t,t.node(e.v),s)&&u!==so(t,t.node(e.w),s)});return _i.minBy(l,function(t){return qi(e,t)})}function ao(t,e,r,n){var i=r.v,o=r.w;t.removeEdge(i,o),t.setEdge(n.v,n.w,{}),no(t),eo(t,e),function(t,e){var r=_i.find(t.nodes(),function(t){return!e.node(t).parent}),n=Ki(t,r);n=n.slice(1),_i.forEach(n,function(r){var n=t.node(r).parent,i=e.edge(r,n),o=!1;i||(i=e.edge(n,r),o=!0),e.node(r).rank=e.node(n).rank+(o?i.minlen:-i.minlen)})}(t,e)}function so(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}to.initLowLimValues=no,to.initCutValues=eo,to.calcCutValue=ro,to.leaveEdge=io,to.enterEdge=oo,to.exchangeEdges=ao;var uo=zi,lo=uo;function co(t){$i(t)}var fo=function(t){var e=ji.addDummyNode(t,"root",{},"_root"),r=function(t){var e={};function r(n,i){var o=t.children(n);o&&o.length&&_i.forEach(o,function(t){r(t,i+1)}),e[n]=i}return _i.forEach(t.children(),function(t){r(t,1)}),e}(t),n=_i.max(_i.values(r))-1,i=2*n+1;t.graph().nestingRoot=e,_i.forEach(t.edges(),function(e){t.edge(e).minlen*=i});var o=function(t){return _i.reduce(t.edges(),function(e,r){return e+t.edge(r).weight},0)}(t)+1;_i.forEach(t.children(),function(a){!function t(e,r,n,i,o,a,s){var u=e.children(s);if(u.length){var l=ji.addBorderNode(e,"_bt"),c=ji.addBorderNode(e,"_bb"),f=e.node(s);e.setParent(l,s),f.borderTop=l,e.setParent(c,s),f.borderBottom=c,_i.forEach(u,function(u){t(e,r,n,i,o,a,u);var f=e.node(u),h=f.borderTop?f.borderTop:u,p=f.borderBottom?f.borderBottom:u,d=f.borderTop?i:2*i,y=h!==p?1:o-a[s]+1;e.setEdge(l,h,{weight:d,minlen:y,nestingEdge:!0}),e.setEdge(p,c,{weight:d,minlen:y,nestingEdge:!0})}),e.parent(s)||e.setEdge(r,l,{weight:0,minlen:o+a[s]})}else s!==r&&e.setEdge(r,s,{weight:0,minlen:n})}(t,e,i,o,n,r,a)}),t.graph().nodeRankFactor=i},ho=function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,_i.forEach(t.edges(),function(e){t.edge(e).nestingEdge&&t.removeEdge(e)})};function po(t,e,r,n,i,o){var a={width:0,height:0,rank:o,borderType:e},s=i[e][o-1],u=ji.addDummyNode(t,"border",a,r);i[e][o]=u,t.setParent(u,n),s&&t.setEdge(s,u,{weight:1})}var yo=function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||vo(t)},go=function(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){_i.forEach(t.nodes(),function(e){bo(t.node(e))}),_i.forEach(t.edges(),function(e){var r=t.edge(e);_i.forEach(r.points,bo),_i.has(r,"y")&&bo(r)})}(t),"lr"!==e&&"rl"!==e||(function(t){_i.forEach(t.nodes(),function(e){Ao(t.node(e))}),_i.forEach(t.edges(),function(e){var r=t.edge(e);_i.forEach(r.points,Ao),_i.has(r,"x")&&Ao(r)})}(t),vo(t))};function vo(t){_i.forEach(t.nodes(),function(e){mo(t.node(e))}),_i.forEach(t.edges(),function(e){mo(t.edge(e))})}function mo(t){var e=t.width;t.width=t.height,t.height=e}function bo(t){t.y=-t.y}function Ao(t){var e=t.x;t.x=t.y,t.y=e}var xo=function(t,e){for(var r=0,n=1;n0;)e%2&&(r+=s[e+1]),s[e=e-1>>1]+=t.weight;u+=t.weight*r})),u}function _o(t,e,r){for(var n;e.length&&(n=_i.last(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}var So=function t(e,r,n,i){var o=e.children(r),a=e.node(r),s=a?a.borderLeft:void 0,u=a?a.borderRight:void 0,l={};s&&(o=_i.filter(o,function(t){return t!==s&&t!==u}));var c=function(t,e){return _i.map(e,function(e){var r=t.inEdges(e);if(r.length){var n=_i.reduce(r,function(e,r){var n=t.edge(r),i=t.node(r.v);return{sum:e.sum+n.weight*i.order,weight:e.weight+n.weight}},{sum:0,weight:0});return{v:e,barycenter:n.sum/n.weight,weight:n.weight}}return{v:e}})}(e,o);_i.forEach(c,function(r){if(e.children(r.v).length){var o=t(e,r.v,n,i);l[r.v]=o,_i.has(o,"barycenter")&&(a=r,s=o,_i.isUndefined(a.barycenter)?(a.barycenter=s.barycenter,a.weight=s.weight):(a.barycenter=(a.barycenter*a.weight+s.barycenter*s.weight)/(a.weight+s.weight),a.weight+=s.weight))}var a,s});var f=function(t,e){var r={};return _i.forEach(t,function(t,e){var n=r[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};_i.isUndefined(t.barycenter)||(n.barycenter=t.barycenter,n.weight=t.weight)}),_i.forEach(e.edges(),function(t){var e=r[t.v],n=r[t.w];_i.isUndefined(e)||_i.isUndefined(n)||(n.indegree++,e.out.push(r[t.w]))}),function(t){var e=[];function r(t){return function(e){e.merged||(_i.isUndefined(e.barycenter)||_i.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&function(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function n(e){return function(r){r.in.push(e),0==--r.indegree&&t.push(r)}}for(;t.length;){var i=t.pop();e.push(i),_i.forEach(i.in.reverse(),r(i)),_i.forEach(i.out,n(i))}return _i.map(_i.filter(e,function(t){return!t.merged}),function(t){return _i.pick(t,["vs","i","barycenter","weight"])})}(_i.filter(r,function(t){return!t.indegree}))}(c,n);!function(t,e){_i.forEach(t,function(t){t.vs=_i.flatten(t.vs.map(function(t){return e[t]?e[t].vs:t}),!0)})}(f,l);var h=function(t,e){var r,n=ji.partition(t,function(t){return _i.has(t,"barycenter")}),i=n.lhs,o=_i.sortBy(n.rhs,function(t){return-t.i}),a=[],s=0,u=0,l=0;i.sort((r=!!e,function(t,e){return t.barycentere.barycenter?1:r?e.i-t.i:t.i-e.i})),l=_o(a,o,l),_i.forEach(i,function(t){l+=t.vs.length,a.push(t.vs),s+=t.barycenter*t.weight,u+=t.weight,l=_o(a,o,l)});var c={vs:_i.flatten(a,!0)};return u&&(c.barycenter=s/u,c.weight=u),c}(f,i);if(s&&(h.vs=_i.flatten([s,h.vs,u],!0),e.predecessors(s).length)){var p=e.node(e.predecessors(s)[0]),d=e.node(e.predecessors(u)[0]);_i.has(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+p.order+d.order)/(h.weight+2),h.weight+=2}return h},Eo=Gn.Graph,Co=function(t,e,r){var n=function(t){for(var e;t.hasNode(e=_i.uniqueId("_root")););return e}(t),i=new Eo({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(e){return t.node(e)});return _i.forEach(t.nodes(),function(o){var a=t.node(o),s=t.parent(o);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(i.setNode(o),i.setParent(o,s||n),_i.forEach(t[r](o),function(e){var r=e.v===o?e.w:e.v,n=i.edge(r,o),a=_i.isUndefined(n)?0:n.weight;i.setEdge(r,o,{weight:t.edge(e).weight+a})}),_i.has(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),i},ko=function(t,e,r){var n,i={};_i.forEach(r,function(r){for(var o,a,s=t.parent(r);s;){if((o=t.parent(s))?(a=i[o],i[o]=s):(a=n,n=s),a&&a!==s)return void e.setEdge(a,s);s=o}})},Io=Gn.Graph,To=function(t){var e=ji.maxRank(t),r=Oo(t,_i.range(1,e+1),"inEdges"),n=Oo(t,_i.range(e-1,-1,-1),"outEdges"),i=function(t){var e={},r=_i.filter(t.nodes(),function(e){return!t.children(e).length}),n=_i.max(_i.map(r,function(e){return t.node(e).rank})),i=_i.map(_i.range(n+1),function(){return[]});var o=_i.sortBy(r,function(e){return t.node(e).rank});return _i.forEach(o,function r(n){if(!_i.has(e,n)){e[n]=!0;var o=t.node(n);i[o.rank].push(n),_i.forEach(t.successors(n),r)}}),i}(t);Po(t,i);for(var o,a=Number.POSITIVE_INFINITY,s=0,u=0;u<4;++s,++u){Mo(s%2?r:n,s%4>=2),i=ji.buildLayerMatrix(t);var l=xo(t,i);lr){var n=e;e=r,r=n}var i=t[e];i||(t[e]=i={}),i[r]=!0}function jo(t,e,r){if(e>r){var n=e;e=r,r=n}return _i.has(t[e],r)}var Ro=function(t){var e,r=ji.buildLayerMatrix(t),n=_i.merge(function(t,e){var r={};return _i.reduce(e,function(e,n){var i=0,o=0,a=e.length,s=_i.last(n);return _i.forEach(n,function(e,u){var l=function(t,e){if(t.node(e).dummy)return _i.find(t.predecessors(e),function(e){return t.node(e).dummy})}(t,e),c=l?t.node(l).order:a;(l||e===s)&&(_i.forEach(n.slice(o,u+1),function(e){_i.forEach(t.predecessors(e),function(n){var o=t.node(n),a=o.order;!(aa)&&No(r,e,s)})})}return _i.reduce(e,function(e,r){var i,o=-1,a=0;return _i.forEach(r,function(s,u){if("border"===t.node(s).dummy){var l=t.predecessors(s);l.length&&(i=t.node(l[0]).order,n(r,a,u,o,i),a=u,o=i)}n(r,a,r.length,i,e.length)}),r}),r}(t,r)),i={};_i.forEach(["u","d"],function(o){e="u"===o?r:_i.values(r).reverse(),_i.forEach(["l","r"],function(r){"r"===r&&(e=_i.map(e,function(t){return _i.values(t).reverse()}));var a=("u"===o?t.predecessors:t.successors).bind(t),s=function(t,e,r,n){var i={},o={},a={};return _i.forEach(e,function(t){_i.forEach(t,function(t,e){i[t]=t,o[t]=t,a[t]=e})}),_i.forEach(e,function(t){var e=-1;_i.forEach(t,function(t){var s=n(t);if(s.length)for(var u=((s=_i.sortBy(s,function(t){return a[t]})).length-1)/2,l=Math.floor(u),c=Math.ceil(u);l<=c;++l){var f=s[l];o[t]===t&&eu||l>e[i].lim));for(o=i,i=n;(i=t.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(t,e,i.v,i.w),a=o.path,s=o.lca,u=0,l=a[u],c=!0;r!==i.w;){if(n=t.node(r),c){for(;(l=a[u])!==s&&t.node(l).maxRank1&&void 0!==arguments[1]?arguments[1]:{};d(this,t),this.attr=null,this.bridgeGraph=null,this.cardinality=0,this.depth=1,this.include=A.UNSPECIFIED,this.isGroupNode=!0,this.parentNode=null,this.type=b.META,this.path=[],this.name=e,this.metaGraph=sa(e,x.META,r)},[{key:"getFirstChild",value:function(){return this.metaGraph.node(this.metaGraph.nodes()[0])}},{key:"getChildren",value:function(){var t=this;return this.metaGraph.nodes().map(function(e){return t.metaGraph.node(e)})}},{key:"leaves",value:function(){for(var t,e=[],r=[this];r.length;){var n=r.shift();n.isGroupNode?(t=n.metaGraph).nodes().forEach(function(e){return r.push(t.node(e))}):e.push(n.name)}return e}}])}(),ia=function(){return h(function t(e,r){d(this,t),this.v=e,this.w=r,this.baseEdgeList=[],this.inbound=null,this.name=null},[{key:"addBaseEdge",value:function(t,e){this.baseEdgeList.push(t)}}])}();function oa(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new na(t,e)}function aa(t,e){return new ia(t,e)}function sa(t,e,r){var n=r||{},i=new $o.Graph(n);return i.setGraph({name:t,rankdir:n.rankdir,type:e,align:n.align}),i}var ua=function(){return h(function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d(this,t),this.graphOptions=e,this.index={},this.graphOptions.compound=!0,this.root=oa(_,this.graphOptions),this.index[_]=this.root},[{key:"getNodeMap",value:function(){return this.index}},{key:"node",value:function(t){return this.index[t]}},{key:"setNode",value:function(t,e){this.index[t]=e}},{key:"getBridgeGraph",value:function(t){var e=this,r=this.index[t];if(!r)throw Error("Could not find node in hierarchy: "+t);if(!("metaGraph"in r))return null;var n=r;if(n.bridgeGraph)return n.bridgeGraph;var i=sa(S,x.BRIDGE,this.graphOptions);if(n.bridgeGraph=i,!(r.parentNode&&"metaGraph"in r.parentNode))return i;var o=r.parentNode;return[o.metaGraph,this.getBridgeGraph(o.name)].forEach(function(r){r.edges().filter(function(e){return e.v===t||e.w===t}).forEach(function(n){var o=n.w===t;r.edge(n).baseEdgeList.forEach(function(r){var a=u(o?[r.w,n.v]:[r.v,n.w],2),s=a[0],l=a[1],c=e.getChildName(t,s),f={v:o?l:c,w:o?c:l},h=i.edge(f);h||((h=aa(f.v,f.w)).inbound=o,i.setEdge(f.v,f.w,h)),h.addBaseEdge(r,e)})})}),i}},{key:"getChildName",value:function(t,e){for(var r=this.index[e];r;){if(r.parentNode&&r.parentNode.name===t)return r.name;r=r.parentNode}throw Error("Could not find immediate child for descendant: "+e)}},{key:"getPredecessors",value:function(t){var e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!0)}},{key:"getSuccessors",value:function(t){var e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!1)}},{key:"getOneWayEdges",value:function(t,e){var r=[];if(!t.parentNode||!t.parentNode.isGroupNode)return r;var n=t.parentNode,i=n.metaGraph,o=this.getBridgeGraph(n.name);return la(i,t,e,r),la(o,t,e,r),r}}])}();function la(t,e,r,n){(r?t.inEdges(e.name):t.outEdges(e.name)).forEach(function(e){var r=t.edge(e);n.push(r)})}var ca=function(){return h(function t(e){d(this,t),this.hierarchy=e,this.index={},this.hasSubHierarchy={},this.root=new pa(this.hierarchy.root,this.hierarchy.graphOptions),this.index[e.root.name]=this.root,this.buildSubHierarchy(e.root.name),this.root.expanded=!0},[{key:"getRenderInfoNodes",value:function(){return Object.values(this.index)}},{key:"getSubHierarchy",value:function(){return this.hasSubHierarchy}},{key:"buildSubHierarchy",value:function(t){var e=this;if(!(t in this.hasSubHierarchy)){this.hasSubHierarchy[t]=!0;var r=this.index[t];if(r.node.type===b.META){var n=r,i=n.node.metaGraph,o=n.coreGraph;i.nodes().forEach(function(t){var r=e.getOrCreateRenderNodeByName(t);o.setNode(t,r)}),i.edges().forEach(function(t){var e=i.edge(t),r=new ha(e);o.setEdge(t.v,t.w,r)});var a=n.node.parentNode;if(a){var s=this.getRenderNodeByName(a.name),l=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n1&&void 0!==arguments[1]&&arguments[1];if(t.coreBox.width=t.width,t.coreBox.height=t.height,!e){var r="".concat(t.displayName).length;t.width=Math.max(t.coreBox.width,3*r)}}(t,e&&(0===t.node.type&&!!(null===(i=null===(n=null==e?void 0:e.nodeSize)||void 0===n?void 0:n.meta)||void 0===i?void 0:i.width)||1===t.node.type&&(!!(null===(a=null===(o=null==e?void 0:e.nodeSize)||void 0===o?void 0:o.node)||void 0===a?void 0:a.width)||!!f.width)||2===t.node.type&&!!(null===(u=null===(s=null==e?void 0:e.nodeSize)||void 0===s?void 0:s.bridge)||void 0===u?void 0:u.width)))}})}(t,e),t.node.type===b.META&&function(t,e){var r=v(e),n=r.subScene.meta;Object.assign(t,n);var i=r.graph.meta,o={nodesep:i.nodeSep,ranksep:i.rankSep,edgesep:i.edgeSep,align:i.align};Object.assign(t.coreBox,function(t,e){var r=e.ranksep,n=e.nodesep,i=e.edgesep,o=e.align;Object.assign(t.graph(),{ranksep:r,nodesep:n,edgesep:i,align:o});var a=[];if(t.nodes().forEach(function(e){t.node(e).node.type!==b.BRIDGE&&a.push(e)}),!a.length)return{width:0,height:0};ta(t);var s=1/0,u=1/0,l=-1/0,c=-1/0;return a.forEach(function(e){var r=t.node(e),n=.5*r.width,i=r.x-n,o=r.x+n;s=il?o:l;var a=.5*r.height,f=r.y-a,h=r.y+a;u=fc?h:c}),t.edges().forEach(function(e){var r=t.edge(e),n=t.node(r.metaEdge.v),i=t.node(r.metaEdge.w);if(3===r.points.length&&function(t){for(var e=ya(t[0],t[1]),r=1;r1)return!1;e=n}return!0}(r.points)){if(null!=n){var o=n.expanded?n.x:ga(n);r.points[0].x=o}if(null!=i){var a=i.expanded?i.x:ga(i);r.points[2].x=a}r.points=[r.points[0],r.points[1]]}var f=r.points[r.points.length-2];null!=i&&(r.points[r.points.length-1]=va(f,i));var h=r.points[1];null!=n&&(r.points[0]=va(h,n)),r.points.forEach(function(t){s=t.xl?t.x:l,u=t.yc?t.y:c})}),t.nodes().forEach(function(e){var r=t.node(e);r.x-=s,r.y-=u}),t.edges().forEach(function(e){t.edge(e).points.forEach(function(t){t.x-=s,t.y-=u})}),{width:l-s,height:c-u}}(t.coreGraph,o));var a=0;t.coreGraph.nodeCount()>0&&a++;var s=a<=1?0:a;t.coreBox.width+=s+s,t.coreBox.height=n.labelHeight+t.coreBox.height,t.width=t.coreBox.width+n.paddingLeft+n.paddingRight,t.height=t.paddingTop+t.coreBox.height+t.paddingBottom}(t,e)}function ya(t,e){var r=e.x-t.x,n=e.y-t.y;return 180*Math.atan(n/r)/Math.PI}function ga(t){return t.expanded?t.x:t.x-t.width/2+0+t.coreBox.width/2}function va(t,e){var r,n,i=e.expanded?e.x:ga(e),o=e.y,a=t.x-i,s=t.y-o,u=e.expanded?e.width:e.coreBox.width,l=e.expanded?e.height:e.coreBox.height;return Math.abs(s)*u/2>Math.abs(a)*l/2?(s<0&&(l=-l),r=0===s?0:l/2*a/s,n=l/2):(a<0&&(u=-u),r=u/2,n=0===a?0:u/2*s/a),{x:i+r,y:o+n}}function ma(t,e,r){var o,a,s,l,c=t.nodes.filter(function(t,e,r){return r.findIndex(function(e){return e.id===t.id})!==e}).map(function(t){return t.id});if(c.length)throw new Error("Duplicated ids found: ".concat(c.join(", ")));var f=function(t){var e={nodes:[]},r=t.compound,n=Object.keys(r||{}),o=new Map,a=function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(o.has(e))return o.get(e);for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:[];if(0===Object.keys(e).length)return i(new Set(o));var a,s=new Map(Object.keys(e).map(function(t){return[t,e[t]]})),l={},c=n(s);try{for(c.s();!(a=c.n()).done;){var f=u(a.value,2),h=f[0],p=f[1];r(h,s)?l[h]=p:o=o.concat(h,p)}}catch(t){c.e(t)}finally{c.f()}return t(l,o)}(t).filter(function(t){return e.includes(t)})}(t.compound||{},(null==e?void 0:e.expanded)||[]),p=function(t,e){return function(t){return new ca(t)}(function(t,e){var r=e.rankDirection,n=e.align,i=new ua({rankdir:r,align:n});return function(t,e){Object.keys(e.nodes).forEach(function(r){var n=e.nodes[r],i=n.path,o=t.root;o.depth=Math.max(i.length,o.depth);for(var a=0;a1&&void 0!==arguments[1]&&arguments[1],r=JSON.parse(JSON.stringify(t)),n={nodes:[r],edges:i(r.edges)};return r.nodes.forEach(function t(e){(0===e.type||1===e.type)&&n.nodes.push(e),0===e.type&&(n.edges=n.edges.concat(e.edges)),Array.isArray(e.nodes)&&e.nodes.forEach(t)}),e&&n.nodes.forEach(function(t){var e=n.nodes.find(function(e){return e.id===t.parentNodeName});if(e){var r=e.x-e.width/2+e.paddingLeft,i=e.y-e.height/2+e.labelHeight+e.paddingTop;e.id!==_&&(t.x+=r,t.y+=i),0===t.type&&t.edges.forEach(function(e){e.points.forEach(function(e){e.x+=t.x-t.width/2+t.paddingLeft,e.y+=t.y-t.height/2+t.labelHeight+t.paddingTop})})}}),n}function Aa(t,e,r,n){var o,a,s=[],u=(null===(o=r.find(function(e){return e.id===t}))||void 0===o?void 0:o.path)||[],l=(null===(a=r.find(function(t){return t.id===e}))||void 0===a?void 0:a.path)||[],c=[_].concat(i(u)).slice(0,u.length).reverse(),f=[_].concat(i(l)).slice(0,l.length);return c.forEach(function(i){var o=r.find(function(t){return t.id===i});s=s.concat(o.edges.filter(function(r){return r.baseEdgeList.some(function(r){return r.v===((null==n?void 0:n.v)||t)&&r.w===((null==n?void 0:n.w)||e)})}))}),f.filter(function(t){return!c.includes(t)}).forEach(function(i){var o=r.find(function(t){return t.id===i});s=s.concat(o.edges.filter(function(r){return r.baseEdgeList.some(function(r){return r.v===((null==n?void 0:n.v)||t)&&r.w===((null==n?void 0:n.w)||e)})}))}),s}function xa(t){var e,r=t.coreGraph.nodes().map(function(e){return t.coreGraph.node(e)});return Object.assign(Object.assign({},wa(t)),{expanded:t.expanded,nodes:t.expanded?(e=r,e.map(function(t){return t.node.type===b.META?xa(t):wa(t)})):[],edges:t.expanded?function(t){return t.coreGraph.edges().map(function(e){return{renderInfoEdge:t.coreGraph.edge(e),edge:e}}).filter(function(t){var e=t.renderInfoEdge;return e.metaEdge}).map(function(e){var r=e.edge,n=e.renderInfoEdge,i=function(t,e){var r=e.points.map(function(t){return Object.assign({},t)});if(e.adjoiningMetaEdge){var n=e.adjoiningMetaEdge.points,i=e.metaEdge.inbound,o=i?n[n.length-1]:n[0],a=r[i?0:r.length-1],s=t.x-t.width/2,u=t.y-t.height/2,l=o.x-s,c=o.y-u,f=-t.paddingLeft,h=-(t.paddingTop+t.labelHeight);a.x=l+f,a.y=c+h}return r}(t,n);return{adjoiningEdge:n.adjoiningMetaEdge?{w:n.adjoiningMetaEdge.metaEdge.w,v:n.adjoiningMetaEdge.metaEdge.v}:null,inbound:n.metaEdge.inbound,w:r.w,v:r.v,points:i,weight:n.weight,baseEdgeList:n.metaEdge.baseEdgeList,parentNodeName:t.node.name}})}(t):[]})}function wa(t){return{id:t.node.name,name:t.node.name,type:t.node.type,cardinality:t.node.cardinality,attr:t.attr,parentNodeName:t.node.parentNode?t.node.parentNode.name:null,coreBox:Object.assign({},t.coreBox),x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius,labelHeight:t.labelHeight,labelOffset:t.labelOffset,outboxWidth:t.outboxWidth,paddingLeft:t.paddingLeft,paddingTop:t.paddingTop,paddingRight:t.paddingRight,paddingBottom:t.paddingBottom,path:t.node.path}}},3950:function(t,e,r){"use strict";r.d(e,{o0:function(){return p}});var n=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i5&&"xml"===n)return d("InvalidXml","XML declaration allowed only at the start of the document.",g(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function s(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){var r=1;for(e+=8;e"===t[e]&&0===--r)break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e"===t[e+2]){e+=2;break}return e}e.validate=function(t,e){e=Object.assign({},i,e);var r,u=[],l=!1,f=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(var y=0;y"!==t[y]&&" "!==t[y]&&"\t"!==t[y]&&"\n"!==t[y]&&"\r"!==t[y];y++)b+=t[y];if("/"===(b=b.trim())[b.length-1]&&(b=b.substring(0,b.length-1),y--),r=b,!n.isName(r)){return d("InvalidTag",0===b.trim().length?"Invalid space after '<'.":"Tag '"+b+"' is an invalid name.",g(t,y))}var A=c(t,y);if(!1===A)return d("InvalidAttr","Attributes for '"+b+"' have open quote.",g(t,y));var x=A.value;if(y=A.index,"/"===x[x.length-1]){var w=y-x.length,_=h(x=x.substring(0,x.length-1),e);if(!0!==_)return d(_.err.code,_.err.msg,g(t,w+_.err.line));l=!0}else if(m){if(!A.tagClosed)return d("InvalidTag","Closing tag '"+b+"' doesn't have proper closing.",g(t,y));if(x.trim().length>0)return d("InvalidTag","Closing tag '"+b+"' can't have attributes or invalid starting.",g(t,v));var S=u.pop();if(b!==S.tagName){var E=g(t,S.tagStartPos);return d("InvalidTag","Expected closing tag '"+S.tagName+"' (opened in line "+E.line+", col "+E.col+") instead of closing tag '"+b+"'.",g(t,v))}0==u.length&&(f=!0)}else{var C=h(x,e);if(!0!==C)return d(C.err.code,C.err.msg,g(t,y-x.length+C.err.line));if(!0===f)return d("InvalidXml","Multiple possible root nodes found.",g(t,y));-1!==e.unpairedTags.indexOf(b)||u.push({tagName:b,tagStartPos:v}),l=!0}for(y++;y0)||d("InvalidXml","Invalid '"+JSON.stringify(u.map(function(t){return t.tagName}),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):d("InvalidXml","Start tag expected.",1)};var u='"',l="'";function c(t,e){for(var r="",n="",i=!1;e"===t[e]&&""===n){i=!0;break}r+=t[e]}return""===n&&{value:r,index:e,tagClosed:i}}var f=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function h(t,e){for(var r=n.getAllMatches(t,f),i={},o=0;o","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function s(t){this.options=Object.assign({},a,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=c),this.processTextOrObjNode=u,this.options.format?(this.indentate=l,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function u(t,e,r){var n=this.j2x(t,r+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,r):this.buildObjectNode(n.val,e,n.attrStr,r)}function l(t){return this.options.indentBy.repeat(t)}function c(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}s.prototype.build=function(t){return this.options.preserveOrder?o(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t=i({},this.options.arrayNodeName,t)),this.j2x(t,0).val)},s.prototype.j2x=function(t,e){var r="",i="";for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))if(void 0===t[o])this.isAttribute(o)&&(i+="");else if(null===t[o])this.isAttribute(o)?i+="":"?"===o[0]?i+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(t[o]instanceof Date)i+=this.buildTextValNode(t[o],o,"",e);else if("object"!==n(t[o])){var a=this.isAttribute(o);if(a)r+=this.buildAttrPairStr(a,""+t[o]);else if(o===this.options.textNodeName){var s=this.options.tagValueProcessor(o,""+t[o]);i+=this.replaceEntitiesValue(s)}else i+=this.buildTextValNode(t[o],o,"",e)}else if(Array.isArray(t[o])){for(var u=t[o].length,l="",c=0;c"+t+i},s.prototype.closeTag=function(t){var e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":">")+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(n)+"\x3c!--".concat(t,"--\x3e")+this.newLine;if("?"===e[0])return this.indentate(n)+"<"+e+r+"?"+this.tagEndChar;var i=this.options.tagValueProcessor(e,t);return""===(i=this.replaceEntitiesValue(i))?this.indentate(n)+"<"+e+r+this.closeTag(e)+this.tagEndChar:this.indentate(n)+"<"+e+r+">"+i+"0&&this.options.processEntities)for(var e=0;e0&&e.processEntities)for(var r=0;r0&&(s=e),function t(e,a,s,u){for(var l="",c=!1,f=0;f":l+=v+"/>":m&&0!==m.length||!a.suppressEmptyNode?m&&m.endsWith(">")?l+=v+">".concat(m).concat(u,""):(l+=v+">",m&&""!==u&&(m.includes("/>")||m.includes("")):l+=v+"/>",c=!0}else{var b=n(h[":@"],a),A="?xml"===p?"":u,x=h[p][0][a.textNodeName];x=0!==x.length?" "+x:"",l+=A+"<".concat(p).concat(x).concat(b,"?>"),c=!0}else l+=u+"\x3c!--".concat(h[p][0][a.textNodeName],"--\x3e"),c=!0;else c&&(l+=u),l+=""),c=!1;else{var w=h[p];i(d,a)||(w=o(w=a.tagValueProcessor(p,w),a)),c&&(l+=u),l+=w,c=!1}}}return l}(t,a,"",s)}},3214:function(t,e,r){function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r"===t[e]){if(p?"-"===t[e-1]&&"-"===t[e-2]&&(p=!1,i--):i--,0===i)break}else"["===t[e]?o=!0:t[e];else{if(o&&u(t,e)){var d=n(a(t,(e+=7)+1),3);entityName=d[0],val=d[1],e=d[2],-1===val.indexOf("&")&&(r[h(entityName)]={regx:RegExp("&".concat(entityName,";"),"g"),val:val})}else if(o&&l(t,e))e+=8;else if(o&&c(t,e))e+=8;else if(o&&f(t,e))e+=9;else{if(!s)throw new Error("Invalid DOCTYPE");p=!0}i++}if(0!==i)throw new Error("Unclosed DOCTYPE");return{entities:r,i:e}}},3070:function(t,e){var r={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,r){return t}};e.buildOptions=function(t){return Object.assign({},r,t)},e.defaultOptions=r},2246:function(t,e,r){"use strict";function n(t,e,r){return(e=a(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t){"@babel/helpers - typeof";return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){for(var r=0;r"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:function(t,e){return String.fromCharCode(Number.parseInt(e,10))}},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:function(t,e){return String.fromCharCode(Number.parseInt(e,16))}}},this.addExternalEntities=h,this.parseXml=v,this.parseTextData=p,this.resolveNameSpace=d,this.buildAttributesMap=g,this.isItStopNode=x,this.replaceEntitiesValue=b,this.readStopNodeData=S,this.saveTextToParentTag=A,this.addChild=m});function h(t){for(var e=Object.keys(t),r=0;r0)){s||(t=this.replaceEntitiesValue(t));var u=this.options.tagValueProcessor(e,t,r,o,a);return null===u||void 0===u?t:i(u)!==i(t)||u!==t?u:this.options.trimValues?E(t,this.options.parseTagValue,this.options.numberParseOptions):t.trim()===t?E(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function d(t){if(this.options.removeNSPrefix){var e=t.split(":"),r="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=r+e[1])}return t}var y=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function g(t,e,r){if(!this.options.ignoreAttributes&&"string"==typeof t){for(var n=s.getAllMatches(t,y),o=n.length,a={},u=0;u",a,"Closing Tag is not closed."),c=t.substring(a+2,s).trim();if(this.options.removeNSPrefix){var f=c.indexOf(":");-1!==f&&(c=c.substr(f+1))}this.options.transformTagName&&(c=this.options.transformTagName(c)),r&&(i=this.saveTextToParentTag(i,r,o));var h=o.substring(o.lastIndexOf(".")+1);if(c&&-1!==this.options.unpairedTags.indexOf(c))throw new Error("Unpaired tag can not be used as closing tag: "));var p=0;h&&-1!==this.options.unpairedTags.indexOf(h)?(p=o.lastIndexOf(".",o.lastIndexOf(".")-1),this.tagsNodeStack.pop()):p=o.lastIndexOf("."),o=o.substring(0,p),r=this.tagsNodeStack.pop(),i="",a=s}else if("?"===t[a+1]){var d=_(t,a,!1,"?>");if(!d)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,r,o),this.options.ignoreDeclaration&&"?xml"===d.tagName||this.options.ignorePiTags);else{var y=new u(d.tagName);y.add(this.options.textNodeName,""),d.tagName!==d.tagExp&&d.attrExpPresent&&(y[":@"]=this.buildAttributesMap(d.tagExp,o,d.tagName)),this.addChild(r,y,o)}a=d.closeIndex+1}else if("!--"===t.substr(a+1,3)){var g=w(t,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){var v=t.substring(a+4,g-2);i=this.saveTextToParentTag(i,r,o),r.add(this.options.commentPropName,[n({},this.options.textNodeName,v)])}a=g}else if("!D"===t.substr(a+1,2)){var m=l(t,a);this.docTypeEntities=m.entities,a=m.i}else if("!["===t.substr(a+1,2)){var b=w(t,"]]>",a,"CDATA is not closed.")-2,A=t.substring(a+9,b);i=this.saveTextToParentTag(i,r,o);var x=this.parseTextData(A,r.tagname,o,!0,!1,!0,!0);void 0==x&&(x=""),this.options.cdataPropName?r.add(this.options.cdataPropName,[n({},this.options.textNodeName,A)]):r.add(this.options.textNodeName,x),a=b+2}else{var S=_(t,a,this.options.removeNSPrefix),E=S.tagName,C=S.rawTagName,k=S.tagExp,I=S.attrExpPresent,T=S.closeIndex;this.options.transformTagName&&(E=this.options.transformTagName(E)),r&&i&&"!xml"!==r.tagname&&(i=this.saveTextToParentTag(i,r,o,!1));var O=r;if(O&&-1!==this.options.unpairedTags.indexOf(O.tagname)&&(r=this.tagsNodeStack.pop(),o=o.substring(0,o.lastIndexOf("."))),E!==e.tagname&&(o+=o?"."+E:E),this.isItStopNode(this.options.stopNodes,o,E)){var M="";if(k.length>0&&k.lastIndexOf("/")===k.length-1)a=S.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(E))a=S.closeIndex;else{var P=this.readStopNodeData(t,C,T+1);if(!P)throw new Error("Unexpected end of ".concat(C));a=P.i,M=P.tagContent}var L=new u(E);E!==k&&I&&(L[":@"]=this.buildAttributesMap(k,o,E)),M&&(M=this.parseTextData(M,E,o,!0,I,!0,!0)),o=o.substr(0,o.lastIndexOf(".")),L.add(this.options.textNodeName,M),this.addChild(r,L,o)}else{if(k.length>0&&k.lastIndexOf("/")===k.length-1){"/"===E[E.length-1]?(E=E.substr(0,E.length-1),o=o.substr(0,o.length-1),k=E):k=k.substr(0,k.length-1),this.options.transformTagName&&(E=this.options.transformTagName(E));var N=new u(E);E!==k&&I&&(N[":@"]=this.buildAttributesMap(k,o,E)),this.addChild(r,N,o),o=o.substr(0,o.lastIndexOf("."))}else{var j=new u(E);this.tagsNodeStack.push(r),E!==k&&I&&(j[":@"]=this.buildAttributesMap(k,o,E)),this.addChild(r,j,o),r=j}i="",a=T}}else i+=t[a]}return e.child};function m(t,e,r){var n=this.options.updateTag(e.tagname,r,e[":@"]);!1===n||("string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e))}var b=function(t){if(this.options.processEntities){for(var e in this.docTypeEntities){var r=this.docTypeEntities[e];t=t.replace(r.regx,r.val)}for(var n in this.lastEntities){var i=this.lastEntities[n];t=t.replace(i.regex,i.val)}if(this.options.htmlEntities)for(var o in this.htmlEntities){var a=this.htmlEntities[o];t=t.replace(a.regex,a.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function A(t,e,r,n){return t&&(void 0===n&&(n=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,r,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,n))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function x(t,e,r){var n="*."+r;for(var i in t){var o=t[i];if(n===o||e===o)return!0}return!1}function w(t,e,r,n){var i=t.indexOf(e,r);if(-1===i)throw new Error(n);return i+e.length-1}function _(t,e,r){var n=function(t,e){for(var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",i="",o=e;o3&&void 0!==arguments[3]?arguments[3]:">");if(n){var i=n.data,o=n.index,a=i.search(/\s/),s=i,u=!0;-1!==a&&(s=i.substring(0,a),i=i.substring(a+1).trimStart());var l=s;if(r){var c=s.indexOf(":");-1!==c&&(u=(s=s.substr(c+1))!==n.data.substr(c+1))}return{tagName:s,tagExp:i,closeIndex:o,attrExpPresent:u,rawTagName:l}}}function S(t,e,r){for(var n=r,i=1;r",r,"".concat(e," is not closed"));if(t.substring(r+2,o).trim()===e&&0===--i)return{tagContent:t.substring(n,r),i:o};r=o}else if("?"===t[r+1]){r=w(t,"?>",r+1,"StopNode is not closed.")}else if("!--"===t.substr(r+1,3)){r=w(t,"--\x3e",r+3,"StopNode is not closed.")}else if("!["===t.substr(r+1,2)){r=w(t,"]]>",r,"StopNode is not closed.")-2}else{var a=_(t,r,">");if(a)(a&&a.tagName)===e&&"/"!==a.tagExp[a.tagExp.length-1]&&i++,r=a.closeIndex}}function E(t,e,r){if(e&&"string"==typeof t){var n=t.trim();return"true"===n||"false"!==n&&c(t,r)}return s.isExist(t)?t:""}t.exports=f},5045:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r0&&(u[o.textNodeName]=s):void 0!==s&&(u[o.textNodeName]=s),u}(t,e)}},4670:function(t){"use strict";function e(t){"@babel/helpers - typeof";return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e,r){return(e=i(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function n(t,e){for(var r=0;r0?this.child.push(r(r({},t.tagname,t.child),":@",t[":@"])):this.child.push(r({},t.tagname,t.child))}}])&&n(t.prototype,e),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}();t.exports=o},1358:function(t){!function(e){"use strict";if(e.__disableNativeFetch||!e.fetch){s.prototype.append=function(t,e){t=o(t),e=a(e);var r=this.map[t];r||(r=[],this.map[t]=r),r.push(e)},s.prototype.delete=function(t){delete this.map[o(t)]},s.prototype.get=function(t){var e=this.map[o(t)];return e?e[0]:null},s.prototype.getAll=function(t){return this.map[o(t)]||[]},s.prototype.has=function(t){return this.map.hasOwnProperty(o(t))},s.prototype.set=function(t,e){this.map[o(t)]=[a(e)]},s.prototype.forEach=function(t,e){Object.getOwnPropertyNames(this.map).forEach(function(r){this.map[r].forEach(function(n){t.call(e,n,r,this)},this)},this)};var r={blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e},n=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.clone=function(){return new h(this)},f.call(h.prototype),f.call(d.prototype),d.prototype.clone=function(){return new d(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},d.error=function(){var t=new d(null,{status:0,statusText:""});return t.type="error",t};var i=[301,302,303,307,308];d.redirect=function(t,e){if(-1===i.indexOf(e))throw new RangeError("Invalid status code");return new d(null,{status:e,headers:{location:t}})},e.Headers=s,e.Request=h,e.Response=d,e.fetch=function(t,e){return new Promise(function(n,i){var o;o=h.prototype.isPrototypeOf(t)&&!e?t:new h(t,e);var a=new XMLHttpRequest;var u=!1;function l(){if(4===a.readyState){var t=1223===a.status?204:a.status;if(t<100||t>599){if(u)return;return u=!0,void i(new TypeError("Network request failed"))}var e={status:t,statusText:a.statusText,headers:function(t){var e=new s;return t.getAllResponseHeaders().trim().split("\n").forEach(function(t){var r=t.trim().split(":"),n=r.shift().trim(),i=r.join(":").trim();e.append(n,i)}),e}(a),url:"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0},r="response"in a?a.response:a.responseText;u||(u=!0,n(new d(r,e)))}}a.onreadystatechange=l,a.onload=l,a.onerror=function(){u||(u=!0,i(new TypeError("Network request failed")))},a.open(o.method,o.url,!0);try{"include"===o.credentials&&("withCredentials"in a?a.withCredentials=!0:console&&console.warn&&console.warn("withCredentials is not supported, you can ignore this warning"))}catch(t){console&&console.warn&&console.warn("set withCredentials error:"+t)}"responseType"in a&&r.blob&&(a.responseType="blob"),o.headers.forEach(function(t,e){a.setRequestHeader(e,t)}),a.send(void 0===o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0,t.exports&&(t.exports=e.fetch)}function o(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function s(t){this.map={},t instanceof s?t.forEach(function(t,e){this.append(e,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function u(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function l(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function c(t){var e=new FileReader;return e.readAsArrayBuffer(t),l(e)}function f(){return this.bodyUsed=!1,this._initBody=function(t,e){if(this._bodyInit=t,"string"==typeof t)this._bodyText=t;else if(r.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t,this._options=e;else if(r.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(t){if(!r.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t))throw new Error("unsupported BodyInit type")}else this._bodyText=""},r.blob?(this.blob=function(){var t=u(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(c)},this.text=function(){var t,e,r,n,i,o,a,s=u(this);if(s)return s;if(this._bodyBlob)return t=this._bodyBlob,e=this._options,r=new FileReader,n=e.headers.map["content-type"]?e.headers.map["content-type"].toString():"",i=/charset\=[0-9a-zA-Z\-\_]*;?/,o=t.type.match(i)||n.match(i),a=[t],o&&a.push(o[0].replace(/^charset\=/,"").replace(/;$/,"")),r.readAsText.apply(r,a),l(r);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var t=u(this);return t||Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function h(t,e){var r,i,o=(e=e||{}).body;if(h.prototype.isPrototypeOf(t)){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new s(t.headers)),this.method=t.method,this.mode=t.mode,o||(o=t._bodyInit,t.bodyUsed=!0)}else this.url=t;if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new s(e.headers)),this.method=(r=e.method||this.method||"GET",i=r.toUpperCase(),n.indexOf(i)>-1?i:r),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o,e)}function p(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}}),e}function d(t,e){e||(e={}),this._initBody(t,e),this.type="default",this.status=e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText,this.headers=e.headers instanceof s?e.headers:new s(e.headers),this.url=e.url||""}}("undefined"!=typeof self?self:this)},3678:function(t,e){var r,n,i;n=[e,t],void 0===(i="function"==typeof(r=function(t,e){"use strict";var r={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function n(t){try{delete window[t]}catch(e){window[t]=void 0}}function i(t){var e=document.getElementById(t);e&&document.getElementsByTagName("head")[0].removeChild(e)}e.exports=function(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=t,a=e.timeout||r.timeout,s=e.jsonpCallback||r.jsonpCallback,u=void 0;return new Promise(function(r,l){var c=e.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),f=s+"_"+c;window[c]=function(t){r({ok:!0,json:function(){return Promise.resolve(t)}}),u&&clearTimeout(u),i(f),n(c)},o+=-1===o.indexOf("?")?"?":"&";var h=document.createElement("script");h.setAttribute("src",""+o+s+"="+c),e.charset&&h.setAttribute("charset",e.charset),h.id=f,document.getElementsByTagName("head")[0].appendChild(h),u=setTimeout(function(){l(new Error("JSONP request to "+t+" timed out")),n(c),i(f),window[c]=function(){n(c)}},a),h.onerror=function(){l(new Error("JSONP request to "+t+" failed")),n(c),i(f),u&&clearTimeout(u)}})}})?r.apply(e,n):r)||(t.exports=i)},5629:function(t,e,r){"use strict";r.r(e),r.d(e,{ARRAY_TYPE:function(){return i},EPSILON:function(){return n},RANDOM:function(){return o},equals:function(){return l},setMatrixArrayType:function(){return a},toRadian:function(){return u}});var n=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,o=Math.random;function a(t){i=t}var s=Math.PI/180;function u(t){return t*s}function l(t,e){return Math.abs(t-e)<=n*Math.max(1,Math.abs(t),Math.abs(e))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},621:function(t,e,r){"use strict";r.r(e),r.d(e,{glMatrix:function(){return l},mat2:function(){return n},mat2d:function(){return i},mat3:function(){return st},mat4:function(){return o},quat:function(){return s},quat2:function(){return u},vec2:function(){return En},vec3:function(){return oe},vec4:function(){return a}});var n={};r.r(n),r.d(n,{LDU:function(){return k},add:function(){return I},adjoint:function(){return m},clone:function(){return f},copy:function(){return h},create:function(){return c},determinant:function(){return b},equals:function(){return M},exactEquals:function(){return O},frob:function(){return C},fromRotation:function(){return _},fromScaling:function(){return S},fromValues:function(){return d},identity:function(){return p},invert:function(){return v},mul:function(){return N},multiply:function(){return A},multiplyScalar:function(){return P},multiplyScalarAndAdd:function(){return L},rotate:function(){return x},scale:function(){return w},set:function(){return y},str:function(){return E},sub:function(){return j},subtract:function(){return T},transpose:function(){return g}});var i={};r.r(i),r.d(i,{add:function(){return $},clone:function(){return D},copy:function(){return B},create:function(){return R},determinant:function(){return H},equals:function(){return it},exactEquals:function(){return nt},frob:function(){return Z},fromRotation:function(){return q},fromScaling:function(){return X},fromTranslation:function(){return K},fromValues:function(){return z},identity:function(){return F},invert:function(){return U},mul:function(){return ot},multiply:function(){return V},multiplyScalar:function(){return et},multiplyScalarAndAdd:function(){return rt},rotate:function(){return Q},scale:function(){return Y},set:function(){return G},str:function(){return J},sub:function(){return at},subtract:function(){return tt},translate:function(){return W}});var o={};r.r(o),r.d(o,{add:function(){return Jt},adjoint:function(){return gt},clone:function(){return lt},copy:function(){return ct},create:function(){return ut},determinant:function(){return vt},equals:function(){return re},exactEquals:function(){return ee},frob:function(){return Kt},fromQuat:function(){return Bt},fromQuat2:function(){return Pt},fromRotation:function(){return kt},fromRotationTranslation:function(){return Mt},fromRotationTranslationScale:function(){return Rt},fromRotationTranslationScaleOrigin:function(){return Dt},fromScaling:function(){return Ct},fromTranslation:function(){return Et},fromValues:function(){return ft},fromXRotation:function(){return It},fromYRotation:function(){return Tt},fromZRotation:function(){return Ot},frustum:function(){return Ft},getRotation:function(){return jt},getScaling:function(){return Nt},getTranslation:function(){return Lt},identity:function(){return pt},invert:function(){return yt},lookAt:function(){return Wt},mul:function(){return ne},multiply:function(){return mt},multiplyScalar:function(){return $t},multiplyScalarAndAdd:function(){return te},ortho:function(){return Qt},orthoNO:function(){return Vt},orthoZO:function(){return Yt},perspective:function(){return Gt},perspectiveFromFieldOfView:function(){return Ht},perspectiveNO:function(){return zt},perspectiveZO:function(){return Ut},rotate:function(){return xt},rotateX:function(){return wt},rotateY:function(){return _t},rotateZ:function(){return St},scale:function(){return At},set:function(){return ht},str:function(){return Xt},sub:function(){return ie},subtract:function(){return Zt},targetTo:function(){return qt},translate:function(){return bt},transpose:function(){return dt}});var a={};r.r(a),r.d(a,{add:function(){return fe},ceil:function(){return ye},clone:function(){return se},copy:function(){return le},create:function(){return ae},cross:function(){return Oe},dist:function(){return He},distance:function(){return we},div:function(){return Ue},divide:function(){return de},dot:function(){return Te},equals:function(){return Be},exactEquals:function(){return De},floor:function(){return ge},forEach:function(){return We},fromValues:function(){return ue},inverse:function(){return ke},len:function(){return Qe},length:function(){return Se},lerp:function(){return Me},max:function(){return me},min:function(){return ve},mul:function(){return Ge},multiply:function(){return pe},negate:function(){return Ce},normalize:function(){return Ie},random:function(){return Pe},round:function(){return be},scale:function(){return Ae},scaleAndAdd:function(){return xe},set:function(){return ce},sqrDist:function(){return Ve},sqrLen:function(){return Ye},squaredDistance:function(){return _e},squaredLength:function(){return Ee},str:function(){return Re},sub:function(){return ze},subtract:function(){return he},transformMat4:function(){return Le},transformQuat:function(){return Ne},zero:function(){return je}});var s={};r.r(s),r.d(s,{add:function(){return Sr},calculateW:function(){return nr},clone:function(){return Ar},conjugate:function(){return cr},copy:function(){return wr},create:function(){return qe},dot:function(){return kr},equals:function(){return jr},exactEquals:function(){return Nr},exp:function(){return ir},fromEuler:function(){return hr},fromMat3:function(){return fr},fromValues:function(){return xr},getAngle:function(){return Ze},getAxisAngle:function(){return Je},identity:function(){return Xe},invert:function(){return lr},len:function(){return Or},length:function(){return Tr},lerp:function(){return Ir},ln:function(){return or},mul:function(){return Er},multiply:function(){return $e},normalize:function(){return Lr},pow:function(){return ar},random:function(){return ur},rotateX:function(){return tr},rotateY:function(){return er},rotateZ:function(){return rr},rotationTo:function(){return Rr},scale:function(){return Cr},set:function(){return _r},setAxes:function(){return Br},setAxisAngle:function(){return Ke},slerp:function(){return sr},sqlerp:function(){return Dr},sqrLen:function(){return Pr},squaredLength:function(){return Mr},str:function(){return pr}});var u={};r.r(u),r.d(u,{add:function(){return ln},clone:function(){return zr},conjugate:function(){return gn},copy:function(){return Wr},create:function(){return Fr},dot:function(){return pn},equals:function(){return Sn},exactEquals:function(){return _n},fromMat4:function(){return Yr},fromRotation:function(){return Qr},fromRotationTranslation:function(){return Hr},fromRotationTranslationValues:function(){return Ur},fromTranslation:function(){return Vr},fromValues:function(){return Gr},getDual:function(){return Jr},getReal:function(){return Kr},getTranslation:function(){return tn},identity:function(){return qr},invert:function(){return yn},len:function(){return mn},length:function(){return vn},lerp:function(){return dn},mul:function(){return fn},multiply:function(){return cn},normalize:function(){return xn},rotateAroundAxis:function(){return un},rotateByQuatAppend:function(){return an},rotateByQuatPrepend:function(){return sn},rotateX:function(){return rn},rotateY:function(){return nn},rotateZ:function(){return on},scale:function(){return hn},set:function(){return Xr},setDual:function(){return $r},setReal:function(){return Zr},sqrLen:function(){return An},squaredLength:function(){return bn},str:function(){return wn},translate:function(){return en}});var l=r(5629);function c(){var t=new l.ARRAY_TYPE(4);return l.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function f(t){var e=new l.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function h(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function p(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function d(t,e,r,n){var i=new l.ARRAY_TYPE(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function y(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function g(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function v(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*o-i*n;return a?(a=1/a,t[0]=o*a,t[1]=-n*a,t[2]=-i*a,t[3]=r*a,t):null}function m(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function b(t){return t[0]*t[3]-t[2]*t[1]}function A(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],l=r[2],c=r[3];return t[0]=n*s+o*u,t[1]=i*s+a*u,t[2]=n*l+o*c,t[3]=i*l+a*c,t}function x(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+o*s,t[1]=i*u+a*s,t[2]=n*-s+o*u,t[3]=i*-s+a*u,t}function w(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1];return t[0]=n*s,t[1]=i*s,t[2]=o*u,t[3]=a*u,t}function _(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function S(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function E(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function C(t){return Math.hypot(t[0],t[1],t[2],t[3])}function k(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function I(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function T(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function O(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function M(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-c)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}function P(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function L(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}var N=A,j=T;function R(){var t=new l.ARRAY_TYPE(6);return l.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function D(t){var e=new l.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function B(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function F(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function z(t,e,r,n,i,o){var a=new l.ARRAY_TYPE(6);return a[0]=t,a[1]=e,a[2]=r,a[3]=n,a[4]=i,a[5]=o,a}function G(t,e,r,n,i,o,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t}function U(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=r*o-n*i;return u?(u=1/u,t[0]=o*u,t[1]=-n*u,t[2]=-i*u,t[3]=r*u,t[4]=(i*s-o*a)*u,t[5]=(n*a-r*s)*u,t):null}function H(t){return t[0]*t[3]-t[1]*t[2]}function V(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=r[0],c=r[1],f=r[2],h=r[3],p=r[4],d=r[5];return t[0]=n*l+o*c,t[1]=i*l+a*c,t[2]=n*f+o*h,t[3]=i*f+a*h,t[4]=n*p+o*d+s,t[5]=i*p+a*d+u,t}function Q(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=Math.sin(r),c=Math.cos(r);return t[0]=n*c+o*l,t[1]=i*c+a*l,t[2]=n*-l+o*c,t[3]=i*-l+a*c,t[4]=s,t[5]=u,t}function Y(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=r[0],c=r[1];return t[0]=n*l,t[1]=i*l,t[2]=o*c,t[3]=a*c,t[4]=s,t[5]=u,t}function W(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=n*l+o*c+s,t[5]=i*l+a*c+u,t}function q(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function X(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function K(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function J(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function Z(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function $(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function tt(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function et(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function rt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function nt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function it(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=e[0],c=e[1],f=e[2],h=e[3],p=e[4],d=e[5];return Math.abs(r-u)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-c)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-f)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(o-h)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(a-p)<=l.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(s-d)<=l.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))}var ot=V,at=tt,st=r(9019);function ut(){var t=new l.ARRAY_TYPE(16);return l.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function lt(t){var e=new l.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function ct(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ft(t,e,r,n,i,o,a,s,u,c,f,h,p,d,y,g){var v=new l.ARRAY_TYPE(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=n,v[4]=i,v[5]=o,v[6]=a,v[7]=s,v[8]=u,v[9]=c,v[10]=f,v[11]=h,v[12]=p,v[13]=d,v[14]=y,v[15]=g,v}function ht(t,e,r,n,i,o,a,s,u,l,c,f,h,p,d,y,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=l,t[9]=c,t[10]=f,t[11]=h,t[12]=p,t[13]=d,t[14]=y,t[15]=g,t}function pt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function dt(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function yt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],f=e[9],h=e[10],p=e[11],d=e[12],y=e[13],g=e[14],v=e[15],m=r*s-n*a,b=r*u-i*a,A=r*l-o*a,x=n*u-i*s,w=n*l-o*s,_=i*l-o*u,S=c*y-f*d,E=c*g-h*d,C=c*v-p*d,k=f*g-h*y,I=f*v-p*y,T=h*v-p*g,O=m*T-b*I+A*k+x*C-w*E+_*S;return O?(O=1/O,t[0]=(s*T-u*I+l*k)*O,t[1]=(i*I-n*T-o*k)*O,t[2]=(y*_-g*w+v*x)*O,t[3]=(h*w-f*_-p*x)*O,t[4]=(u*C-a*T-l*E)*O,t[5]=(r*T-i*C+o*E)*O,t[6]=(g*A-d*_-v*b)*O,t[7]=(c*_-h*A+p*b)*O,t[8]=(a*I-s*C+l*S)*O,t[9]=(n*C-r*I-o*S)*O,t[10]=(d*w-y*A+v*m)*O,t[11]=(f*A-c*w-p*m)*O,t[12]=(s*E-a*k-u*S)*O,t[13]=(r*k-n*E+i*S)*O,t[14]=(y*b-d*x-g*m)*O,t[15]=(c*x-f*b+h*m)*O,t):null}function gt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],f=e[9],h=e[10],p=e[11],d=e[12],y=e[13],g=e[14],v=e[15];return t[0]=s*(h*v-p*g)-f*(u*v-l*g)+y*(u*p-l*h),t[1]=-(n*(h*v-p*g)-f*(i*v-o*g)+y*(i*p-o*h)),t[2]=n*(u*v-l*g)-s*(i*v-o*g)+y*(i*l-o*u),t[3]=-(n*(u*p-l*h)-s*(i*p-o*h)+f*(i*l-o*u)),t[4]=-(a*(h*v-p*g)-c*(u*v-l*g)+d*(u*p-l*h)),t[5]=r*(h*v-p*g)-c*(i*v-o*g)+d*(i*p-o*h),t[6]=-(r*(u*v-l*g)-a*(i*v-o*g)+d*(i*l-o*u)),t[7]=r*(u*p-l*h)-a*(i*p-o*h)+c*(i*l-o*u),t[8]=a*(f*v-p*y)-c*(s*v-l*y)+d*(s*p-l*f),t[9]=-(r*(f*v-p*y)-c*(n*v-o*y)+d*(n*p-o*f)),t[10]=r*(s*v-l*y)-a*(n*v-o*y)+d*(n*l-o*s),t[11]=-(r*(s*p-l*f)-a*(n*p-o*f)+c*(n*l-o*s)),t[12]=-(a*(f*g-h*y)-c*(s*g-u*y)+d*(s*h-u*f)),t[13]=r*(f*g-h*y)-c*(n*g-i*y)+d*(n*h-i*f),t[14]=-(r*(s*g-u*y)-a*(n*g-i*y)+d*(n*u-i*s)),t[15]=r*(s*h-u*f)-a*(n*h-i*f)+c*(n*u-i*s),t}function vt(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],l=t[8],c=t[9],f=t[10],h=t[11],p=t[12],d=t[13],y=t[14],g=t[15];return(e*a-r*o)*(f*g-h*y)-(e*s-n*o)*(c*g-h*d)+(e*u-i*o)*(c*y-f*d)+(r*s-n*a)*(l*g-h*p)-(r*u-i*a)*(l*y-f*p)+(n*u-i*s)*(l*d-c*p)}function mt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=e[8],h=e[9],p=e[10],d=e[11],y=e[12],g=e[13],v=e[14],m=e[15],b=r[0],A=r[1],x=r[2],w=r[3];return t[0]=b*n+A*s+x*f+w*y,t[1]=b*i+A*u+x*h+w*g,t[2]=b*o+A*l+x*p+w*v,t[3]=b*a+A*c+x*d+w*m,b=r[4],A=r[5],x=r[6],w=r[7],t[4]=b*n+A*s+x*f+w*y,t[5]=b*i+A*u+x*h+w*g,t[6]=b*o+A*l+x*p+w*v,t[7]=b*a+A*c+x*d+w*m,b=r[8],A=r[9],x=r[10],w=r[11],t[8]=b*n+A*s+x*f+w*y,t[9]=b*i+A*u+x*h+w*g,t[10]=b*o+A*l+x*p+w*v,t[11]=b*a+A*c+x*d+w*m,b=r[12],A=r[13],x=r[14],w=r[15],t[12]=b*n+A*s+x*f+w*y,t[13]=b*i+A*u+x*h+w*g,t[14]=b*o+A*l+x*p+w*v,t[15]=b*a+A*c+x*d+w*m,t}function bt(t,e,r){var n,i,o,a,s,u,l,c,f,h,p,d,y=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*y+e[4]*g+e[8]*v+e[12],t[13]=e[1]*y+e[5]*g+e[9]*v+e[13],t[14]=e[2]*y+e[6]*g+e[10]*v+e[14],t[15]=e[3]*y+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=e[8],h=e[9],p=e[10],d=e[11],t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=f,t[9]=h,t[10]=p,t[11]=d,t[12]=n*y+s*g+f*v+e[12],t[13]=i*y+u*g+h*v+e[13],t[14]=o*y+l*g+p*v+e[14],t[15]=a*y+c*g+d*v+e[15]),t}function At(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function xt(t,e,r,n){var i,o,a,s,u,c,f,h,p,d,y,g,v,m,b,A,x,w,_,S,E,C,k,I,T=n[0],O=n[1],M=n[2],P=Math.hypot(T,O,M);return P0?(r[0]=2*(s*a+f*n+u*o-c*i)/h,r[1]=2*(u*a+f*i+c*n-s*o)/h,r[2]=2*(c*a+f*o+s*i-u*n)/h):(r[0]=2*(s*a+f*n+u*o-c*i),r[1]=2*(u*a+f*i+c*n-s*o),r[2]=2*(c*a+f*o+s*i-u*n)),Mt(t,e,r),t}function Lt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Nt(t,e){var r=e[0],n=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],l=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,l,c),t}function jt(t,e){var r=new l.ARRAY_TYPE(3);Nt(r,e);var n=1/r[0],i=1/r[1],o=1/r[2],a=e[0]*n,s=e[1]*i,u=e[2]*o,c=e[4]*n,f=e[5]*i,h=e[6]*o,p=e[8]*n,d=e[9]*i,y=e[10]*o,g=a+f+y,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(h-d)/v,t[1]=(p-u)/v,t[2]=(s-c)/v):a>f&&a>y?(v=2*Math.sqrt(1+a-f-y),t[3]=(h-d)/v,t[0]=.25*v,t[1]=(s+c)/v,t[2]=(p+u)/v):f>y?(v=2*Math.sqrt(1+f-a-y),t[3]=(p-u)/v,t[0]=(s+c)/v,t[1]=.25*v,t[2]=(h+d)/v):(v=2*Math.sqrt(1+y-a-f),t[3]=(s-c)/v,t[0]=(p+u)/v,t[1]=(h+d)/v,t[2]=.25*v),t}function Rt(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,l=o+o,c=a+a,f=i*u,h=i*l,p=i*c,d=o*l,y=o*c,g=a*c,v=s*u,m=s*l,b=s*c,A=n[0],x=n[1],w=n[2];return t[0]=(1-(d+g))*A,t[1]=(h+b)*A,t[2]=(p-m)*A,t[3]=0,t[4]=(h-b)*x,t[5]=(1-(f+g))*x,t[6]=(y+v)*x,t[7]=0,t[8]=(p+m)*w,t[9]=(y-v)*w,t[10]=(1-(f+d))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Dt(t,e,r,n,i){var o=e[0],a=e[1],s=e[2],u=e[3],l=o+o,c=a+a,f=s+s,h=o*l,p=o*c,d=o*f,y=a*c,g=a*f,v=s*f,m=u*l,b=u*c,A=u*f,x=n[0],w=n[1],_=n[2],S=i[0],E=i[1],C=i[2],k=(1-(y+v))*x,I=(p+A)*x,T=(d-b)*x,O=(p-A)*w,M=(1-(h+v))*w,P=(g+m)*w,L=(d+b)*_,N=(g-m)*_,j=(1-(h+y))*_;return t[0]=k,t[1]=I,t[2]=T,t[3]=0,t[4]=O,t[5]=M,t[6]=P,t[7]=0,t[8]=L,t[9]=N,t[10]=j,t[11]=0,t[12]=r[0]+S-(k*S+O*E+L*C),t[13]=r[1]+E-(I*S+M*E+N*C),t[14]=r[2]+C-(T*S+P*E+j*C),t[15]=1,t}function Bt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,l=r*a,c=n*a,f=n*s,h=i*a,p=i*s,d=i*u,y=o*a,g=o*s,v=o*u;return t[0]=1-f-d,t[1]=c+v,t[2]=h-g,t[3]=0,t[4]=c-v,t[5]=1-l-d,t[6]=p+y,t[7]=0,t[8]=h+g,t[9]=p-y,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ft(t,e,r,n,i,o,a){var s=1/(r-e),u=1/(i-n),l=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*u,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t}function zt(t,e,r,n,i){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(n-i),t[10]=(i+n)*o,t[14]=2*i*n*o):(t[10]=-1,t[14]=-2*n),t}var Gt=zt;function Ut(t,e,r,n,i){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(n-i),t[10]=i*o,t[14]=i*n*o):(t[10]=-1,t[14]=-n),t}function Ht(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),l=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*l*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function Vt(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*l,t[15]=1,t}var Qt=Vt;function Yt(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=o*l,t[15]=1,t}function Wt(t,e,r,n){var i,o,a,s,u,c,f,h,p,d,y=e[0],g=e[1],v=e[2],m=n[0],b=n[1],A=n[2],x=r[0],w=r[1],_=r[2];return Math.abs(y-x)0&&(c*=p=1/Math.sqrt(p),f*=p,h*=p);var d=u*h-l*f,y=l*c-s*h,g=s*f-u*c;return(p=d*d+y*y+g*g)>0&&(d*=p=1/Math.sqrt(p),y*=p,g*=p),t[0]=d,t[1]=y,t[2]=g,t[3]=0,t[4]=f*g-h*y,t[5]=h*d-c*g,t[6]=c*y-f*d,t[7]=0,t[8]=c,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function Xt(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Kt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Jt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Zt(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function $t(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function te(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function ee(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function re(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],f=t[8],h=t[9],p=t[10],d=t[11],y=t[12],g=t[13],v=t[14],m=t[15],b=e[0],A=e[1],x=e[2],w=e[3],_=e[4],S=e[5],E=e[6],C=e[7],k=e[8],I=e[9],T=e[10],O=e[11],M=e[12],P=e[13],L=e[14],N=e[15];return Math.abs(r-b)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-A)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(A))&&Math.abs(i-x)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-w)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-_)<=l.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(s-S)<=l.EPSILON*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(u-E)<=l.EPSILON*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(c-C)<=l.EPSILON*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(f-k)<=l.EPSILON*Math.max(1,Math.abs(f),Math.abs(k))&&Math.abs(h-I)<=l.EPSILON*Math.max(1,Math.abs(h),Math.abs(I))&&Math.abs(p-T)<=l.EPSILON*Math.max(1,Math.abs(p),Math.abs(T))&&Math.abs(d-O)<=l.EPSILON*Math.max(1,Math.abs(d),Math.abs(O))&&Math.abs(y-M)<=l.EPSILON*Math.max(1,Math.abs(y),Math.abs(M))&&Math.abs(g-P)<=l.EPSILON*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(v-L)<=l.EPSILON*Math.max(1,Math.abs(v),Math.abs(L))&&Math.abs(m-N)<=l.EPSILON*Math.max(1,Math.abs(m),Math.abs(N))}var ne=mt,ie=Zt,oe=r(4995);function ae(){var t=new l.ARRAY_TYPE(4);return l.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function se(t){var e=new l.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function ue(t,e,r,n){var i=new l.ARRAY_TYPE(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function le(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function ce(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function fe(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function he(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function pe(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}function de(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}function ye(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function ge(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function ve(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}function me(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}function be(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function Ae(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function xe(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}function we(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.hypot(r,n,i,o)}function _e(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return r*r+n*n+i*i+o*o}function Se(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}function Ee(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function Ce(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function ke(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function Ie(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=o*a,t}function Te(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Oe(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],o=r[0]*n[2]-r[2]*n[0],a=r[0]*n[3]-r[3]*n[0],s=r[1]*n[2]-r[2]*n[1],u=r[1]*n[3]-r[3]*n[1],l=r[2]*n[3]-r[3]*n[2],c=e[0],f=e[1],h=e[2],p=e[3];return t[0]=f*l-h*u+p*s,t[1]=-c*l+h*a-p*o,t[2]=c*u-f*a+p*i,t[3]=-c*s+f*o-h*i,t}function Me(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t[3]=s+n*(r[3]-s),t}function Pe(t,e){var r,n,i,o,a,s;e=e||1;do{a=(r=2*l.RANDOM()-1)*r+(n=2*l.RANDOM()-1)*n}while(a>=1);do{s=(i=2*l.RANDOM()-1)*i+(o=2*l.RANDOM()-1)*o}while(s>=1);var u=Math.sqrt((1-a)/s);return t[0]=e*r,t[1]=e*n,t[2]=e*i*u,t[3]=e*o*u,t}function Le(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}function Ne(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2],l=r[3],c=l*n+s*o-u*i,f=l*i+u*n-a*o,h=l*o+a*i-s*n,p=-a*n-s*i-u*o;return t[0]=c*l+p*-a+f*-u-h*-s,t[1]=f*l+p*-s+h*-a-c*-u,t[2]=h*l+p*-u+c*-s-f*-a,t[3]=e[3],t}function je(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function Re(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function De(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function Be(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-c)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}var Fe,ze=he,Ge=pe,Ue=de,He=we,Ve=_e,Qe=Se,Ye=Ee,We=(Fe=ae(),function(t,e,r,n,i,o){var a,s;for(e||(e=4),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,a=r;al.EPSILON?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function Ze(t,e){var r=kr(t,e);return Math.acos(2*r*r-1)}function $e(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],l=r[2],c=r[3];return t[0]=n*c+a*s+i*l-o*u,t[1]=i*c+a*u+o*s-n*l,t[2]=o*c+a*l+n*u-i*s,t[3]=a*c-n*s-i*u-o*l,t}function tr(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+a*s,t[1]=i*u+o*s,t[2]=o*u-i*s,t[3]=a*u-n*s,t}function er(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u-o*s,t[1]=i*u+a*s,t[2]=o*u+n*s,t[3]=a*u-i*s,t}function rr(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+i*s,t[1]=i*u-n*s,t[2]=o*u+a*s,t[3]=a*u-o*s,t}function nr(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function ir(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=Math.sqrt(r*r+n*n+i*i),s=Math.exp(o),u=a>0?s*Math.sin(a)/a:0;return t[0]=r*u,t[1]=n*u,t[2]=i*u,t[3]=s*Math.cos(a),t}function or(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=Math.sqrt(r*r+n*n+i*i),s=a>0?Math.atan2(a,o)/a:0;return t[0]=r*s,t[1]=n*s,t[2]=i*s,t[3]=.5*Math.log(r*r+n*n+i*i+o*o),t}function ar(t,e,r){return or(t,e),Cr(t,t,r),ir(t,t),t}function sr(t,e,r,n){var i,o,a,s,u,c=e[0],f=e[1],h=e[2],p=e[3],d=r[0],y=r[1],g=r[2],v=r[3];return(o=c*d+f*y+h*g+p*v)<0&&(o=-o,d=-d,y=-y,g=-g,v=-v),1-o>l.EPSILON?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-n)*i)/a,u=Math.sin(n*i)/a):(s=1-n,u=n),t[0]=s*c+u*d,t[1]=s*f+u*y,t[2]=s*h+u*g,t[3]=s*p+u*v,t}function ur(t){var e=l.RANDOM(),r=l.RANDOM(),n=l.RANDOM(),i=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=o*Math.sin(2*Math.PI*n),t[3]=o*Math.cos(2*Math.PI*n),t}function lr(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o,s=a?1/a:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=o*s,t}function cr(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function fr(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*o+a]-e[3*a+o])*r,t[o]=(e[3*o+i]+e[3*i+o])*r,t[a]=(e[3*a+i]+e[3*i+a])*r}return t}function hr(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(r),u=Math.cos(r),l=Math.sin(n),c=Math.cos(n);return t[0]=o*u*c-a*s*l,t[1]=a*s*c+o*u*l,t[2]=a*u*l-o*s*c,t[3]=a*u*c+o*s*l,t}function pr(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var dr,yr,gr,vr,mr,br,Ar=se,xr=ue,wr=le,_r=ce,Sr=fe,Er=$e,Cr=Ae,kr=Te,Ir=Me,Tr=Se,Or=Tr,Mr=Ee,Pr=Mr,Lr=Ie,Nr=De,jr=Be,Rr=(dr=oe.create(),yr=oe.fromValues(1,0,0),gr=oe.fromValues(0,1,0),function(t,e,r){var n=oe.dot(e,r);return n<-.999999?(oe.cross(dr,yr,e),oe.len(dr)<1e-6&&oe.cross(dr,gr,e),oe.normalize(dr,dr),Ke(t,dr,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(oe.cross(dr,e,r),t[0]=dr[0],t[1]=dr[1],t[2]=dr[2],t[3]=1+n,Lr(t,t))}),Dr=(vr=qe(),mr=qe(),function(t,e,r,n,i,o){return sr(vr,e,i,o),sr(mr,r,n,o),sr(t,vr,mr,2*o*(1-o)),t}),Br=(br=st.create(),function(t,e,r,n){return br[0]=r[0],br[3]=r[1],br[6]=r[2],br[1]=n[0],br[4]=n[1],br[7]=n[2],br[2]=-e[0],br[5]=-e[1],br[8]=-e[2],Lr(t,fr(t,br))});function Fr(){var t=new l.ARRAY_TYPE(8);return l.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function zr(t){var e=new l.ARRAY_TYPE(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function Gr(t,e,r,n,i,o,a,s){var u=new l.ARRAY_TYPE(8);return u[0]=t,u[1]=e,u[2]=r,u[3]=n,u[4]=i,u[5]=o,u[6]=a,u[7]=s,u}function Ur(t,e,r,n,i,o,a){var s=new l.ARRAY_TYPE(8);s[0]=t,s[1]=e,s[2]=r,s[3]=n;var u=.5*i,c=.5*o,f=.5*a;return s[4]=u*n+c*r-f*e,s[5]=c*n+f*t-u*r,s[6]=f*n+u*e-c*t,s[7]=-u*t-c*e-f*r,s}function Hr(t,e,r){var n=.5*r[0],i=.5*r[1],o=.5*r[2],a=e[0],s=e[1],u=e[2],l=e[3];return t[0]=a,t[1]=s,t[2]=u,t[3]=l,t[4]=n*l+i*u-o*s,t[5]=i*l+o*a-n*u,t[6]=o*l+n*s-i*a,t[7]=-n*a-i*s-o*u,t}function Vr(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function Qr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Yr(t,e){var r=qe();jt(r,e);var n=new l.ARRAY_TYPE(3);return Lt(n,e),Hr(t,r,n),t}function Wr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function qr(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Xr(t,e,r,n,i,o,a,s,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t}var Kr=wr;function Jr(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var Zr=wr;function $r(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function tn(t,e){var r=e[4],n=e[5],i=e[6],o=e[7],a=-e[0],s=-e[1],u=-e[2],l=e[3];return t[0]=2*(r*l+o*a+n*u-i*s),t[1]=2*(n*l+o*s+i*a-r*u),t[2]=2*(i*l+o*u+r*s-n*a),t}function en(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=.5*r[0],u=.5*r[1],l=.5*r[2],c=e[4],f=e[5],h=e[6],p=e[7];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=a*s+i*l-o*u+c,t[5]=a*u+o*s-n*l+f,t[6]=a*l+n*u-i*s+h,t[7]=-n*s-i*u-o*l+p,t}function rn(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=s*a+c*n+u*o-l*i,h=u*a+c*i+l*n-s*o,p=l*a+c*o+s*i-u*n,d=c*a-s*n-u*i-l*o;return tr(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+d*n+h*o-p*i,t[5]=h*a+d*i+p*n-f*o,t[6]=p*a+d*o+f*i-h*n,t[7]=d*a-f*n-h*i-p*o,t}function nn(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=s*a+c*n+u*o-l*i,h=u*a+c*i+l*n-s*o,p=l*a+c*o+s*i-u*n,d=c*a-s*n-u*i-l*o;return er(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+d*n+h*o-p*i,t[5]=h*a+d*i+p*n-f*o,t[6]=p*a+d*o+f*i-h*n,t[7]=d*a-f*n-h*i-p*o,t}function on(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=s*a+c*n+u*o-l*i,h=u*a+c*i+l*n-s*o,p=l*a+c*o+s*i-u*n,d=c*a-s*n-u*i-l*o;return rr(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+d*n+h*o-p*i,t[5]=h*a+d*i+p*n-f*o,t[6]=p*a+d*o+f*i-h*n,t[7]=d*a-f*n-h*i-p*o,t}function an(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],l=e[2],c=e[3];return t[0]=s*a+c*n+u*o-l*i,t[1]=u*a+c*i+l*n-s*o,t[2]=l*a+c*o+s*i-u*n,t[3]=c*a-s*n-u*i-l*o,s=e[4],u=e[5],l=e[6],c=e[7],t[4]=s*a+c*n+u*o-l*i,t[5]=u*a+c*i+l*n-s*o,t[6]=l*a+c*o+s*i-u*n,t[7]=c*a-s*n-u*i-l*o,t}function sn(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],l=r[2],c=r[3];return t[0]=n*c+a*s+i*l-o*u,t[1]=i*c+a*u+o*s-n*l,t[2]=o*c+a*l+n*u-i*s,t[3]=a*c-n*s-i*u-o*l,s=r[4],u=r[5],l=r[6],c=r[7],t[4]=n*c+a*s+i*l-o*u,t[5]=i*c+a*u+o*s-n*l,t[6]=o*c+a*l+n*u-i*s,t[7]=a*c-n*s-i*u-o*l,t}function un(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,o=e[2]/r,a=e[3]/r,s=e[4],u=e[5],l=e[6],c=e[7],f=n*s+i*u+o*l+a*c;t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=(s-n*f)/r,t[5]=(u-i*f)/r,t[6]=(l-o*f)/r,t[7]=(c-a*f)/r}return t}function wn(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function _n(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function Sn(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],f=e[0],h=e[1],p=e[2],d=e[3],y=e[4],g=e[5],v=e[6],m=e[7];return Math.abs(r-f)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(n-h)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-p)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(o-d)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(a-y)<=l.EPSILON*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(s-g)<=l.EPSILON*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-v)<=l.EPSILON*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(c-m)<=l.EPSILON*Math.max(1,Math.abs(c),Math.abs(m))}var En=r(4732)},9019:function(t,e,r){"use strict";r.r(e),r.d(e,{add:function(){return I},adjoint:function(){return p},clone:function(){return a},copy:function(){return s},create:function(){return i},determinant:function(){return d},equals:function(){return L},exactEquals:function(){return P},frob:function(){return k},fromMat2d:function(){return w},fromMat4:function(){return o},fromQuat:function(){return _},fromRotation:function(){return A},fromScaling:function(){return x},fromTranslation:function(){return b},fromValues:function(){return u},identity:function(){return c},invert:function(){return h},mul:function(){return N},multiply:function(){return y},multiplyScalar:function(){return O},multiplyScalarAndAdd:function(){return M},normalFromMat4:function(){return S},projection:function(){return E},rotate:function(){return v},scale:function(){return m},set:function(){return l},str:function(){return C},sub:function(){return j},subtract:function(){return T},translate:function(){return g},transpose:function(){return f}});var n=r(5629);function i(){var t=new n.ARRAY_TYPE(9);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function a(t){var e=new n.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function u(t,e,r,i,o,a,s,u,l){var c=new n.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=r,c[3]=i,c[4]=o,c[5]=a,c[6]=s,c[7]=u,c[8]=l,c}function l(t,e,r,n,i,o,a,s,u,l){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=l,t}function c(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function f(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function h(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],f=c*a-s*l,h=-c*o+s*u,p=l*o-a*u,d=r*f+n*h+i*p;return d?(d=1/d,t[0]=f*d,t[1]=(-c*n+i*l)*d,t[2]=(s*n-i*a)*d,t[3]=h*d,t[4]=(c*r-i*u)*d,t[5]=(-s*r+i*o)*d,t[6]=p*d,t[7]=(-l*r+n*u)*d,t[8]=(a*r-n*o)*d,t):null}function p(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8];return t[0]=a*c-s*l,t[1]=i*l-n*c,t[2]=n*s-i*a,t[3]=s*u-o*c,t[4]=r*c-i*u,t[5]=i*o-r*s,t[6]=o*l-a*u,t[7]=n*u-r*l,t[8]=r*a-n*o,t}function d(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],l=t[8];return e*(l*o-a*u)+r*(-l*i+a*s)+n*(u*i-o*s)}function y(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=e[8],h=r[0],p=r[1],d=r[2],y=r[3],g=r[4],v=r[5],m=r[6],b=r[7],A=r[8];return t[0]=h*n+p*a+d*l,t[1]=h*i+p*s+d*c,t[2]=h*o+p*u+d*f,t[3]=y*n+g*a+v*l,t[4]=y*i+g*s+v*c,t[5]=y*o+g*u+v*f,t[6]=m*n+b*a+A*l,t[7]=m*i+b*s+A*c,t[8]=m*o+b*u+A*f,t}function g(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=e[8],h=r[0],p=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=h*n+p*a+l,t[7]=h*i+p*s+c,t[8]=h*o+p*u+f,t}function v(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=e[8],h=Math.sin(r),p=Math.cos(r);return t[0]=p*n+h*a,t[1]=p*i+h*s,t[2]=p*o+h*u,t[3]=p*a-h*n,t[4]=p*s-h*i,t[5]=p*u-h*o,t[6]=l,t[7]=c,t[8]=f,t}function m(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function b(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function A(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function x(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function w(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function _(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,l=r*a,c=n*a,f=n*s,h=i*a,p=i*s,d=i*u,y=o*a,g=o*s,v=o*u;return t[0]=1-f-d,t[3]=c-v,t[6]=h+g,t[1]=c+v,t[4]=1-l-d,t[7]=p-y,t[2]=h-g,t[5]=p+y,t[8]=1-l-f,t}function S(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],f=e[9],h=e[10],p=e[11],d=e[12],y=e[13],g=e[14],v=e[15],m=r*s-n*a,b=r*u-i*a,A=r*l-o*a,x=n*u-i*s,w=n*l-o*s,_=i*l-o*u,S=c*y-f*d,E=c*g-h*d,C=c*v-p*d,k=f*g-h*y,I=f*v-p*y,T=h*v-p*g,O=m*T-b*I+A*k+x*C-w*E+_*S;return O?(O=1/O,t[0]=(s*T-u*I+l*k)*O,t[1]=(u*C-a*T-l*E)*O,t[2]=(a*I-s*C+l*S)*O,t[3]=(i*I-n*T-o*k)*O,t[4]=(r*T-i*C+o*E)*O,t[5]=(n*C-r*I-o*S)*O,t[6]=(y*_-g*w+v*x)*O,t[7]=(g*A-d*_-v*b)*O,t[8]=(d*w-y*A+v*m)*O,t):null}function E(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function C(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function k(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function I(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function T(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function O(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function M(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function P(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function L(t,e){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],l=t[6],c=t[7],f=t[8],h=e[0],p=e[1],d=e[2],y=e[3],g=e[4],v=e[5],m=e[6],b=e[7],A=e[8];return Math.abs(r-h)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-p)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(o-d)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(a-y)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(s-g)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-v)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(l-m)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(m))&&Math.abs(c-b)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(f-A)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(A))}var N=y,j=T},4732:function(t,e,r){"use strict";r.r(e),r.d(e,{add:function(){return l},angle:function(){return R},ceil:function(){return p},clone:function(){return o},copy:function(){return s},create:function(){return i},cross:function(){return I},dist:function(){return Y},distance:function(){return A},div:function(){return Q},divide:function(){return h},dot:function(){return k},equals:function(){return z},exactEquals:function(){return F},floor:function(){return d},forEach:function(){return X},fromValues:function(){return a},inverse:function(){return E},len:function(){return U},length:function(){return w},lerp:function(){return T},max:function(){return g},min:function(){return y},mul:function(){return V},multiply:function(){return f},negate:function(){return S},normalize:function(){return C},random:function(){return O},rotate:function(){return j},round:function(){return v},scale:function(){return m},scaleAndAdd:function(){return b},set:function(){return u},sqrDist:function(){return W},sqrLen:function(){return q},squaredDistance:function(){return x},squaredLength:function(){return _},str:function(){return B},sub:function(){return H},subtract:function(){return c},transformMat2:function(){return M},transformMat2d:function(){return P},transformMat3:function(){return L},transformMat4:function(){return N},zero:function(){return D}});var n=r(5629);function i(){var t=new n.ARRAY_TYPE(2);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function o(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e}function a(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r}function s(t,e){return t[0]=e[0],t[1]=e[1],t}function u(t,e,r){return t[0]=e,t[1]=r,t}function l(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function f(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function h(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function p(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function d(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function y(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function g(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function v(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function m(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function b(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function A(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function x(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function w(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function _(t){var e=t[0],r=t[1];return e*e+r*r}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t}function E(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function C(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function k(t,e){return t[0]*e[0]+t[1]*e[1]}function I(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function T(t,e,r,n){var i=e[0],o=e[1];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t}function O(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function M(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function P(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function L(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function N(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function j(t,e,r,n){var i=e[0]-r[0],o=e[1]-r[1],a=Math.sin(n),s=Math.cos(n);return t[0]=i*s-o*a+r[0],t[1]=i*a+o*s+r[1],t}function R(t,e){var r=t[0],n=t[1],i=e[0],o=e[1],a=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+o*o),s=a&&(r*i+n*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function D(t){return t[0]=0,t[1]=0,t}function B(t){return"vec2("+t[0]+", "+t[1]+")"}function F(t,e){return t[0]===e[0]&&t[1]===e[1]}function z(t,e){var r=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(r-o)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-a)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))}var G,U=w,H=c,V=f,Q=h,Y=A,W=x,q=_,X=(G=i(),function(t,e,r,n,i,o){var a,s;for(e||(e=2),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,a=r;a0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function k(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function I(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t}function T(t,e,r,n){var i=e[0],o=e[1],a=e[2];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t}function O(t,e,r,n,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,l=a*(o-1),c=a*(3-2*o);return t[0]=e[0]*s+r[0]*u+n[0]*l+i[0]*c,t[1]=e[1]*s+r[1]*u+n[1]*l+i[1]*c,t[2]=e[2]*s+r[2]*u+n[2]*l+i[2]*c,t}function M(t,e,r,n,i,o){var a=1-o,s=a*a,u=o*o,l=s*a,c=3*o*s,f=3*u*a,h=u*o;return t[0]=e[0]*l+r[0]*c+n[0]*f+i[0]*h,t[1]=e[1]*l+r[1]*c+n[1]*f+i[1]*h,t[2]=e[2]*l+r[2]*c+n[2]*f+i[2]*h,t}function P(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,o=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*o,t[1]=Math.sin(r)*o,t[2]=i*e,t}function L(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return a=a||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/a,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,t}function N(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function j(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],l=e[2],c=i*l-o*u,f=o*s-n*l,h=n*u-i*s,p=i*h-o*f,d=o*c-n*h,y=n*f-i*c,g=2*a;return c*=g,f*=g,h*=g,p*=2,d*=2,y*=2,t[0]=s+c+p,t[1]=u+f+d,t[2]=l+h+y,t}function R(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function D(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function B(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function F(t,e){var r=t[0],n=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(o*o+a*a+s*s),l=u&&k(t,e)/u;return Math.acos(Math.min(Math.max(l,-1),1))}function z(t){return t[0]=0,t[1]=0,t[2]=0,t}function G(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function U(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function H(t,e){var r=t[0],i=t[1],o=t[2],a=e[0],s=e[1],u=e[2];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-u)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))}var V,Q=f,Y=h,W=p,q=x,X=w,K=a,J=_,Z=(V=i(),function(t,e,r,n,i,o){var a,s;for(e||(e=3),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,a=r;a=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},5611:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t=r.nmd(t);var i=200,o="__lodash_hash_undefined__",a=9007199254740991,s="[object Arguments]",u="[object Boolean]",l="[object Date]",c="[object Function]",f="[object GeneratorFunction]",h="[object Map]",p="[object Number]",d="[object Object]",y="[object RegExp]",g="[object Set]",v="[object String]",m="[object Symbol]",b="[object ArrayBuffer]",A="[object DataView]",x="[object Float32Array]",w="[object Float64Array]",_="[object Int8Array]",S="[object Int16Array]",E="[object Int32Array]",C="[object Uint8Array]",k="[object Uint8ClampedArray]",I="[object Uint16Array]",T="[object Uint32Array]",O=/\w*$/,M=/^\[object .+?Constructor\]$/,P=/^(?:0|[1-9]\d*)$/,L={};L[s]=L["[object Array]"]=L[b]=L[A]=L[u]=L[l]=L[x]=L[w]=L[_]=L[S]=L[E]=L[h]=L[p]=L[d]=L[y]=L[g]=L[v]=L[m]=L[C]=L[k]=L[I]=L[T]=!0,L["[object Error]"]=L[c]=L["[object WeakMap]"]=!1;var N="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,j="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,R=N||j||Function("return this")(),D="object"==n(e)&&e&&!e.nodeType&&e,B=D&&"object"==n(t)&&t&&!t.nodeType&&t,F=B&&B.exports===D;function z(t,e){return t.set(e[0],e[1]),t}function G(t,e){return t.add(e),t}function U(t,e,r,n){var i=-1,o=t?t.length:0;for(n&&o&&(r=t[++i]);++i-1},kt.prototype.set=function(t,e){var r=this.__data__,n=Pt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},It.prototype.clear=function(){this.__data__={hash:new Ct,map:new(dt||kt),string:new Ct}},It.prototype.delete=function(t){return Dt(this,t).delete(t)},It.prototype.get=function(t){return Dt(this,t).get(t)},It.prototype.has=function(t){return Dt(this,t).has(t)},It.prototype.set=function(t,e){return Dt(this,t).set(t,e),this},Tt.prototype.clear=function(){this.__data__=new kt},Tt.prototype.delete=function(t){return this.__data__.delete(t)},Tt.prototype.get=function(t){return this.__data__.get(t)},Tt.prototype.has=function(t){return this.__data__.has(t)},Tt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof kt){var n=r.__data__;if(!dt||n.length-1&&t%1==0&&t-1&&t%1==0&&t<=a}(t.length)&&!qt(t)}var Wt=ft||function(){return!1};function qt(t){var e=Xt(t)?et.call(t):"";return e==c||e==f}function Xt(t){var e=n(t);return!!t&&("object"==e||"function"==e)}function Kt(t){return Yt(t)?Ot(t):function(t){if(!Ut(t))return ht(t);var e=[];for(var r in Object(t))tt.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}t.exports=function(t){return Lt(t,!0,!0)}},1855:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i="Expected a function",o=NaN,a="[object Symbol]",s=/^\s+|\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=parseInt,h="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,p="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,d=h||p||Function("return this")(),y=Object.prototype.toString,g=Math.max,v=Math.min,m=function(){return d.Date.now()};function b(t){var e=n(t);return!!t&&("object"==e||"function"==e)}function A(t){return"symbol"==n(t)||function(t){return!!t&&"object"==n(t)}(t)&&y.call(t)==a}function x(t){if("number"==typeof t)return t;if(A(t))return o;if(b(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=b(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(s,"");var r=l.test(t);return r||c.test(t)?f(t.slice(2),r?2:8):u.test(t)?o:+t}t.exports=function(t,e,r){var n,o,a,s,u,l,c=0,f=!1,h=!1,p=!0;if("function"!=typeof t)throw new TypeError(i);function d(e){var r=n,i=o;return n=o=void 0,c=e,s=t.apply(i,r)}function y(t){var r=t-l;return void 0===l||r>=e||r<0||h&&t-c>=a}function A(){var t=m();if(y(t))return w(t);u=setTimeout(A,function(t){var r=e-(t-l);return h?v(r,a-(t-c)):r}(t))}function w(t){return u=void 0,p&&n?d(t):(n=o=void 0,s)}function _(){var t=m(),r=y(t);if(n=arguments,o=this,l=t,r){if(void 0===u)return function(t){return c=t,u=setTimeout(A,e),f?d(t):s}(l);if(h)return u=setTimeout(A,e),d(l)}return void 0===u&&(u=setTimeout(A,e)),s}return e=x(e)||0,b(r)&&(f=!!r.leading,a=(h="maxWait"in r)?g(x(r.maxWait)||0,e):a,p="trailing"in r?!!r.trailing:p),_.cancel=function(){void 0!==u&&clearTimeout(u),c=0,n=l=o=u=void 0},_.flush=function(){return void 0===u?s:w(m())},_}},311:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=200,o="__lodash_hash_undefined__",a=9007199254740991,s="[object Arguments]",u="[object Function]",l="[object GeneratorFunction]",c=/^\[object .+?Constructor\]$/,f="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,h="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,p=f||h||Function("return this")();function d(t,e){return!!(t?t.length:0)&&function(t,e,r){if(e!=e)return function(t,e,r,n){var i=t.length,o=r+(n?1:-1);for(;n?o--:++o-1}function y(t,e,r){for(var n=-1,i=t?t.length:0;++n=i&&(s=m,u=!1,e=new F(e));t:for(;++a-1},D.prototype.set=function(t,e){var r=this.__data__,n=z(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},B.prototype.clear=function(){this.__data__={hash:new R,map:new(N||D),string:new R}},B.prototype.delete=function(t){return H(this,t).delete(t)},B.prototype.get=function(t){return H(this,t).get(t)},B.prototype.has=function(t){return H(this,t).has(t)},B.prototype.set=function(t,e){return H(this,t).set(t,e),this},F.prototype.add=F.prototype.push=function(t){return this.__data__.set(t,o),this},F.prototype.has=function(t){return this.__data__.has(t)};var Y,W,q=(Y=function(t,e){return J(t)?G(t,function t(e,r,n,i,o){var a=-1,s=e.length;for(n||(n=Q),o||(o=[]);++a0&&n(u)?r>1?t(u,r-1,n,i,o):g(o,u):i||(o[o.length]=u)}return o}(e,1,J,!0)):[]},W=L(void 0===W?Y.length-1:W,0),function(){for(var t=arguments,e=-1,r=L(t.length-W,0),n=Array(r);++e-1&&t%1==0&&t<=a}(t.length)&&!Z(t)}function J(t){return function(t){return!!t&&"object"==n(t)}(t)&&K(t)}function Z(t){var e=$(t)?k.call(t):"";return e==u||e==l}function $(t){var e=n(t);return!!t&&("object"==e||"function"==e)}t.exports=q},8676:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i="Expected a function",o=NaN,a="[object Symbol]",s=/^\s+|\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=parseInt,h="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,p="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,d=h||p||Function("return this")(),y=Object.prototype.toString,g=Math.max,v=Math.min,m=function(){return d.Date.now()};function b(t,e,r){var n,o,a,s,u,l,c=0,f=!1,h=!1,p=!0;if("function"!=typeof t)throw new TypeError(i);function d(e){var r=n,i=o;return n=o=void 0,c=e,s=t.apply(i,r)}function y(t){var r=t-l;return void 0===l||r>=e||r<0||h&&t-c>=a}function b(){var t=m();if(y(t))return x(t);u=setTimeout(b,function(t){var r=e-(t-l);return h?v(r,a-(t-c)):r}(t))}function x(t){return u=void 0,p&&n?d(t):(n=o=void 0,s)}function _(){var t=m(),r=y(t);if(n=arguments,o=this,l=t,r){if(void 0===u)return function(t){return c=t,u=setTimeout(b,e),f?d(t):s}(l);if(h)return u=setTimeout(b,e),d(l)}return void 0===u&&(u=setTimeout(b,e)),s}return e=w(e)||0,A(r)&&(f=!!r.leading,a=(h="maxWait"in r)?g(w(r.maxWait)||0,e):a,p="trailing"in r?!!r.trailing:p),_.cancel=function(){void 0!==u&&clearTimeout(u),c=0,n=l=o=u=void 0},_.flush=function(){return void 0===u?s:x(m())},_}function A(t){var e=n(t);return!!t&&("object"==e||"function"==e)}function x(t){return"symbol"==n(t)||function(t){return!!t&&"object"==n(t)}(t)&&y.call(t)==a}function w(t){if("number"==typeof t)return t;if(x(t))return o;if(A(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=A(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(s,"");var r=l.test(t);return r||c.test(t)?f(t.slice(2),r?2:8):u.test(t)?o:+t}t.exports=function(t,e,r){var n=!0,o=!0;if("function"!=typeof t)throw new TypeError(i);return A(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),b(t,e,{leading:n,maxWait:e,trailing:o})}},8518:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=9007199254740991,o="[object Arguments]",a="[object Function]",s="[object GeneratorFunction]",u="[object Map]",l="[object Set]",c=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,h="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,p="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,d=h||p||Function("return this")();function y(t,e){return function(t,e){for(var r=-1,n=t?t.length:0,i=Array(n);++r-1&&t%1==0&&t-1&&t%1==0&&t<=i}(t.length)&&!q(t)}function q(t){var e=X(t)?E.call(t):"";return e==a||e==s}function X(t){var e=n(t);return!!t&&("object"==e||"function"==e)}var K,J=(K=function(t){return W(t)?F(t):G(t)},function(t){var e,r,n,i=H(t);return i==u?(e=t,r=-1,n=Array(e.size),e.forEach(function(t,e){n[++r]=[e,t]}),n):i==l?function(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=[t,t]}),r}(t):y(t,K(t))});t.exports=J},44:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t=r.nmd(t);var i=200,o="Expected a function",a="__lodash_hash_undefined__",s=1,u=2,l=1/0,c=9007199254740991,f="[object Arguments]",h="[object Array]",p="[object Boolean]",d="[object Date]",y="[object Error]",g="[object Function]",v="[object GeneratorFunction]",m="[object Map]",b="[object Number]",A="[object Object]",x="[object RegExp]",w="[object Set]",_="[object String]",S="[object Symbol]",E="[object ArrayBuffer]",C="[object DataView]",k=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,I=/^\w*$/,T=/^\./,O=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,M=/\\(\\)?/g,P=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,N={};N["[object Float32Array]"]=N["[object Float64Array]"]=N["[object Int8Array]"]=N["[object Int16Array]"]=N["[object Int32Array]"]=N["[object Uint8Array]"]=N["[object Uint8ClampedArray]"]=N["[object Uint16Array]"]=N["[object Uint32Array]"]=!0,N[f]=N[h]=N[E]=N[p]=N[C]=N[d]=N[y]=N[g]=N[m]=N[b]=N[A]=N[x]=N[w]=N[_]=N["[object WeakMap]"]=!1;var j="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,R="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,D=j||R||Function("return this")(),B="object"==n(e)&&e&&!e.nodeType&&e,F=B&&"object"==n(t)&&t&&!t.nodeType&&t,z=F&&F.exports===B&&j.process,G=function(){try{return z&&z.binding("util")}catch(t){}}(),U=G&&G.isTypedArray;function H(t,e){return!!(t?t.length:0)&&function(t,e,r){if(e!=e)return function(t,e,r,n){var i=t.length,o=r+(n?1:-1);for(;n?o--:++o-1}function V(t,e,r){for(var n=-1,i=t?t.length:0;++n-1},Tt.prototype.set=function(t,e){var r=this.__data__,n=Nt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Ot.prototype.clear=function(){this.__data__={hash:new It,map:new(yt||Tt),string:new It}},Ot.prototype.delete=function(t){return Vt(this,t).delete(t)},Ot.prototype.get=function(t){return Vt(this,t).get(t)},Ot.prototype.has=function(t){return Vt(this,t).has(t)},Ot.prototype.set=function(t,e){return Vt(this,t).set(t,e),this},Mt.prototype.add=Mt.prototype.push=function(t){return this.__data__.set(t,a),this},Mt.prototype.has=function(t){return this.__data__.has(t)},Pt.prototype.clear=function(){this.__data__=new Tt},Pt.prototype.delete=function(t){return this.__data__.delete(t)},Pt.prototype.get=function(t){return this.__data__.get(t)},Pt.prototype.has=function(t){return this.__data__.has(t)},Pt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Tt){var n=r.__data__;if(!yt||n.lengthl))return!1;var f=o.get(t);if(f&&o.get(e))return f==e;var h=-1,p=!0,d=i&s?new Mt:void 0;for(o.set(t,e),o.set(e,t);++h-1&&t%1==0&&t-1&&t%1==0&&t<=c}function se(t){var e=n(t);return!!t&&("object"==e||"function"==e)}function ue(t){return!!t&&"object"==n(t)}function le(t){return"symbol"==n(t)||ue(t)&&st.call(t)==S}var ce=U?function(t){return function(e){return t(e)}}(U):function(t){return ue(t)&&ae(t.length)&&!!N[st.call(t)]};function fe(t){return ie(t)?Lt(t):zt(t)}function he(t){return t}t.exports=function(t,e){return t&&t.length?function(t,e,r){var n=-1,o=H,a=t.length,s=!0,u=[],l=u;if(r)s=!1,o=V;else if(a>=i){var c=e?null:Ut(t);if(c)return K(c);s=!1,o=W,l=new Mt}else l=e?[]:u;t:for(;++n-1&&t%1==0&&t<=e}},7473:function(t,e,r){var n=r(522),i=r(9484),o="[object Number]";t.exports=function(t){return"number"==typeof t||i(t)&&n(t)==o}},9484:function(t){function e(t){"@babel/helpers - typeof";return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return null!=t&&"object"==e(t)}},6601:function(t,e,r){var n=r(522),i=r(7969),o=r(9484),a="[object Object]",s=Function.prototype,u=Object.prototype,l=s.toString,c=u.hasOwnProperty,f=l.call(Object);t.exports=function(t){if(!o(t)||n(t)!=a)return!1;var e=i(t);if(null===e)return!0;var r=c.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&l.call(r)==f}},2021:function(t,e,r){var n=r(6171),i=r(6683),o=r(4123),a=o&&o.isTypedArray,s=a?i(a):n;t.exports=s},7915:function(t,e,r){var n,i,o,a;function s(t){"@babel/helpers - typeof";return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t=r.nmd(t),window,a=function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==s(t)&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=32)}([function(t,e){t.exports={options:{usePureJavaScript:!1}}},function(t,e,r){(function(e){var n=r(0),i=r(35),o=t.exports=n.util=n.util||{};function a(t){if(8!==t&&16!==t&&24!==t&&32!==t)throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}function u(t){if(this.data="",this.read=0,"string"==typeof t)this.data=t;else if(o.isArrayBuffer(t)||o.isArrayBufferView(t))if("undefined"!=typeof Buffer&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch(t){for(var r=0;r15?(r=Date.now(),a(t)):(e.push(t),1===e.length&&i.setAttribute("a",n=!n))}}o.nextTick=o.setImmediate}(),o.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,o.globalScope=o.isNodejs?e:"undefined"==typeof self?window:self,o.isArray=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},o.isArrayBuffer=function(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer},o.isArrayBufferView=function(t){return t&&o.isArrayBuffer(t.buffer)&&void 0!==t.byteLength},o.ByteBuffer=u,o.ByteStringBuffer=u,o.ByteStringBuffer.prototype._optimizeConstructedString=function(t){this._constructedStringLength+=t,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},o.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},o.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},o.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))},o.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this},o.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this},o.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(o.encodeUtf8(t))},o.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},o.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},o.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},o.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255))},o.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))},o.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))},o.ByteStringBuffer.prototype.putInt=function(t,e){a(e);var r="";do{e-=8,r+=String.fromCharCode(t>>e&255)}while(e>0);return this.putBytes(r)},o.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e},o.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e},o.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},o.ByteStringBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},o.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)},o.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this},o.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},o.ByteStringBuffer.prototype.copy=function(){var t=o.createBuffer(this.data);return t.read=this.read,t},o.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},o.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},o.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this},o.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this},o.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this},o.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this},o.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this},o.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this},o.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this},o.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this},o.DataBuffer.prototype.putInt=function(t,e){a(e),this.accommodate(e/8);do{e-=8,this.data.setInt8(this.write++,t>>e&255)}while(e>0);return this},o.DataBuffer.prototype.putSignedInt=function(t,e){return a(e),this.accommodate(e/8),t<0&&(t+=2<0);return e},o.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e},o.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},o.DataBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},o.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)},o.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this},o.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},o.DataBuffer.prototype.copy=function(){return new o.DataBuffer(this)},o.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this},o.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},o.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this},o.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return r},o.xorBytes=function(t,e,r){for(var n="",i="",o="",a=0,s=0;r>0;--r,++a)i=t.charCodeAt(a)^e.charCodeAt(a),s>=10&&(n+=o,o="",s=0),o+=String.fromCharCode(i),++s;return n+o},o.hexToBytes=function(t){var e="",r=0;for(!0&t.length&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)};var l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],f="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";o.encode64=function(t,e){for(var r,n,i,o="",a="",s=0;s>2),o+=l.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=l.charAt((15&n)<<2|i>>6),o+=isNaN(i)?"=":l.charAt(63&i)),e&&o.length>e&&(a+=o.substr(0,e)+"\r\n",o=o.substr(e));return a+o},o.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e,r,n,i,o="",a=0;a>4),64!==n&&(o+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(o+=String.fromCharCode((3&n)<<6|i)));return o},o.encodeUtf8=function(t){return unescape(encodeURIComponent(t))},o.decodeUtf8=function(t){return decodeURIComponent(escape(t))},o.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:i.encode,decode:i.decode}},o.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)},o.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length));for(var i=r=r||0,o=0;o>2),o+=l.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=l.charAt((15&n)<<2|i>>6),o+=isNaN(i)?"=":l.charAt(63&i)),e&&o.length>e&&(a+=o.substr(0,e)+"\r\n",o=o.substr(e));return a+o},o.binary.base64.decode=function(t,e,r){var n,i,o,a,s=e;s||(s=new Uint8Array(3*Math.ceil(t.length/4))),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,l=r=r||0;u>4,64!==o&&(s[l++]=(15&i)<<4|o>>2,64!==a&&(s[l++]=(3&o)<<6|a));return e?l-r:s.subarray(0,l)},o.binary.base58.encode=function(t,e){return o.binary.baseN.encode(t,f,e)},o.binary.base58.decode=function(t,e){return o.binary.baseN.decode(t,f,e)},o.text={utf8:{},utf16:{}},o.text.utf8.encode=function(t,e,r){t=o.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length));for(var i=r=r||0,a=0;a0&&o.push(r),a=n.lastIndex;var s=e[0][1];switch(s){case"s":case"o":i");break;case"%":o.push("%");break;default:o.push("<%"+s+"?>")}}return o.push(t.substring(a)),o.join("")},o.formatNumber=function(t,e,r,n){var i=t,o=isNaN(e=Math.abs(e))?2:e,a=void 0===r?",":r,s=void 0===n?".":n,u=i<0?"-":"",l=parseInt(i=Math.abs(+i||0).toFixed(o),10)+"",c=l.length>3?l.length%3:0;return u+(c?l.substr(0,c)+s:"")+l.substr(c).replace(/(\d{3})(?=\d)/g,"$1"+s)+(o?a+Math.abs(i-l).toFixed(o).slice(2):"")},o.formatSize=function(t){return t>=1073741824?o.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?o.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?o.formatNumber(t/1024,0)+" KiB":o.formatNumber(t,0)+" bytes"},o.bytesFromIP=function(t){return-1!==t.indexOf(".")?o.bytesFromIPv4(t):-1!==t.indexOf(":")?o.bytesFromIPv6(t):null},o.bytesFromIPv4=function(t){if(4!==(t=t.split(".")).length)return null;for(var e=o.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1)):r.push({start:u,end:u})}e.push(a)}if(r.length>0){var l=r[n];l.end-l.start>0&&(e.splice(l.start,l.end-l.start+1,""),0===l.start&&e.unshift(""),7===l.end&&e.push(""))}return e.join(":")},o.estimateCores=function(t,e){if("function"==typeof t&&(e=t,t={}),t=t||{},"cores"in o&&!t.update)return e(null,o.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return o.cores=navigator.hardwareConcurrency,e(null,o.cores);if("undefined"==typeof Worker)return o.cores=1,e(null,o.cores);if("undefined"==typeof Blob)return o.cores=2,e(null,o.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(t){for(var e=Date.now(),r=e+4;Date.now()s.st&&i.sti.st&&s.ste){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(t,e,r,o,a){if(n.util.isArray(o)){for(var s=[],u=0;ur){if(a.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=e.length(),d.remaining=r,d.requested=p,d}p=r}var y=32==(32&u);if(y)if(f=[],void 0===p)for(;;){if(o(e,r,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),r-=2;break}s=e.length(),f.push(t(e,r,n+1,a)),r-=s-e.length()}else for(;p>0;)s=e.length(),f.push(t(e,p,n+1,a)),r-=s-e.length(),p-=s-e.length();if(void 0===f&&l===i.Class.UNIVERSAL&&c===i.Type.BITSTRING&&(h=e.bytes(p)),void 0===f&&a.decodeBitStrings&&l===i.Class.UNIVERSAL&&c===i.Type.BITSTRING&&p>1){var g=e.read,v=r,m=0;if(c===i.Type.BITSTRING&&(o(e,r,1),m=e.getByte(),r--),0===m)try{s=e.length();var b=t(e,r,n+1,{strict:!0,decodeBitStrings:!0}),A=s-e.length();r-=A,c==i.Type.BITSTRING&&A++;var x=b.tagClass;A!==p||x!==i.Class.UNIVERSAL&&x!==i.Class.CONTEXT_SPECIFIC||(f=[b])}catch(t){}void 0===f&&(e.read=g,r=v)}if(void 0===f){if(void 0===p){if(a.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");p=r}if(c===i.Type.BMPSTRING)for(f="";p>0;p-=2)o(e,r,2),f+=String.fromCharCode(e.getInt16()),r-=2;else f=e.getBytes(p),r-=p}var w=void 0===h?null:{bitStringContents:h};return i.create(l,c,y,f,w)}(t,t.length(),0,e);if(e.parseAllBytes&&0!==t.length()){var s=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw s.byteCount=r,s.remaining=t.length(),s}return a},i.toDer=function(t){var e=n.util.createBuffer(),r=t.tagClass|t.type,o=n.util.createBuffer(),a=!1;if("bitStringContents"in t&&(a=!0,t.original&&(a=i.equals(t,t.original))),a)o.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:o.putByte(0);for(var s=0;s1&&(0===t.value.charCodeAt(0)&&0==(128&t.value.charCodeAt(1))||255===t.value.charCodeAt(0)&&128==(128&t.value.charCodeAt(1)))?o.putBytes(t.value.substr(1)):o.putBytes(t.value);if(e.putByte(r),o.length()<=127)e.putByte(127&o.length());else{var u=o.length(),l="";do{l+=String.fromCharCode(255&u),u>>>=8}while(u>0);for(e.putByte(128|l.length),s=l.length-1;s>=0;--s)e.putByte(l.charCodeAt(s))}return e.putBuffer(o),e},i.oidToDer=function(t){var e,r,i,o,a=t.split("."),s=n.util.createBuffer();s.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var u=2;u>>=7,e||(o|=128),r.push(o),e=!1}while(i>0);for(var l=r.length-1;l>=0;--l)s.putByte(r[l])}return s},i.derToOid=function(t){var e;"string"==typeof t&&(t=n.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var i=0;t.length()>0;)i<<=7,128&(r=t.getByte())?i+=127&r:(e+="."+(i+r),i=0);return e},i.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),o=parseInt(t.substr(6,2),10),a=parseInt(t.substr(8,2),10),s=0;if(t.length>11){var u=t.charAt(10),l=10;"+"!==u&&"-"!==u&&(s=parseInt(t.substr(10,2),10),l+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(o,a,s,0),l&&("+"===(u=t.charAt(l))||"-"===u)){var c=60*parseInt(t.substr(l+1,2),10)+parseInt(t.substr(l+4,2),10);c*=6e4,"+"===u?e.setTime(+e-c):e.setTime(+e+c)}return e},i.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),a=parseInt(t.substr(10,2),10),s=parseInt(t.substr(12,2),10),u=0,l=0,c=!1;"Z"===t.charAt(t.length-1)&&(c=!0);var f=t.length-5,h=t.charAt(f);return"+"!==h&&"-"!==h||(l=60*parseInt(t.substr(f+1,2),10)+parseInt(t.substr(f+4,2),10),l*=6e4,"+"===h&&(l*=-1),c=!0),"."===t.charAt(14)&&(u=1e3*parseFloat(t.substr(14),10)),c?(e.setUTCFullYear(r,n,i),e.setUTCHours(o,a,s,u),e.setTime(+e+l)):(e.setFullYear(r,n,i),e.setHours(o,a,s,u)),e},i.dateToUtcTime=function(t){if("string"==typeof t)return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r},i.derToInteger=function(t){"string"==typeof t&&(t=n.util.createBuffer(t));var e=8*t.length();if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)},i.validate=function(t,e,r,o){var a=!1;if(t.tagClass!==e.tagClass&&void 0!==e.tagClass||t.type!==e.type&&void 0!==e.type)o&&(t.tagClass!==e.tagClass&&o.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+t.tagClass+'"'),t.type!==e.type&&o.push("["+e.name+'] Expected type "'+e.type+'", got "'+t.type+'"'));else if(t.constructed===e.constructed||void 0===e.constructed){if(a=!0,e.value&&n.util.isArray(e.value))for(var s=0,u=0;a&&u0&&(o+="\n");for(var s="",u=0;u1?o+="0x"+n.util.bytesToHex(t.value.slice(1)):o+="(none)",t.value.length>0){var h=t.value.charCodeAt(0);1==h?o+=" (1 unused bit shown)":h>1&&(o+=" ("+h+" unused bits shown)")}}else if(t.type===i.Type.OCTETSTRING)a.test(t.value)||(o+="("+t.value+") "),o+="0x"+n.util.bytesToHex(t.value);else if(t.type===i.Type.UTF8)try{o+=n.util.decodeUtf8(t.value)}catch(e){if("URI malformed"!==e.message)throw e;o+="0x"+n.util.bytesToHex(t.value)+" (malformed UTF8)"}else t.type===i.Type.PRINTABLESTRING||t.type===i.Type.IA5String?o+=t.value:a.test(t.value)?o+="0x"+n.util.bytesToHex(t.value):0===t.value.length?o+="[null]":o+=t.value}return o}},function(t,e,r){var n=r(0);t.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},function(t,e,r){var n=r(0);function i(t,e){n.cipher.registerAlgorithm(t,function(){return new n.aes.Algorithm(t,e)})}r(13),r(19),r(1),t.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(t,e,r,n){var i=d({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i},n.aes.createEncryptionCipher=function(t,e){return d({key:t,output:null,decrypt:!1,mode:e})},n.aes.startDecrypting=function(t,e,r,n){var i=d({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i},n.aes.createDecryptionCipher=function(t,e){return d({key:t,output:null,decrypt:!0,mode:e})},n.aes.Algorithm=function(t,e){c||f();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(t,e){return p(r._w,t,e,!1)},decrypt:function(t,e){return p(r._w,t,e,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e,r=t.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){e=r,r=n.util.createBuffer();for(var i=0;i>>=2,i=0;i>8^255&f^99,o[y]=f,a[f]=y,p=(h=t[f])<<24^f<<16^f<<8^f^h,d=((r=t[y])^(n=t[r])^(i=t[n]))<<24^(y^i)<<16^(y^n^i)<<8^y^r^i;for(var v=0;v<4;++v)u[v][y]=p,l[v][f]=d,p=p<<24|p>>>8,d=d<<24|d>>>8;0===y?y=g=1:(y=r^t[t[t[r^i]]],g^=t[t[g]])}}function h(t,e){for(var r,n=t.slice(0),i=1,a=n.length,u=4*(a+6+1),c=a;c>>16&255]<<24^o[r>>>8&255]<<16^o[255&r]<<8^o[r>>>24]^s[i]<<24,i++):a>6&&c%a==4&&(r=o[r>>>24]<<24^o[r>>>16&255]<<16^o[r>>>8&255]<<8^o[255&r]),n[c]=n[c-a]^r;if(e){for(var f,h=l[0],p=l[1],d=l[2],y=l[3],g=n.slice(0),v=(c=0,(u=n.length)-4);c>>24]]^p[o[f>>>16&255]]^d[o[f>>>8&255]]^y[o[255&f]];n=g}return n}function p(t,e,r,n){var i,s,c,f,h,p,d,y,g,v,m,b,A=t.length/4-1;n?(i=l[0],s=l[1],c=l[2],f=l[3],h=a):(i=u[0],s=u[1],c=u[2],f=u[3],h=o),p=e[0]^t[0],d=e[n?3:1]^t[1],y=e[2]^t[2],g=e[n?1:3]^t[3];for(var x=3,w=1;w>>24]^s[d>>>16&255]^c[y>>>8&255]^f[255&g]^t[++x],m=i[d>>>24]^s[y>>>16&255]^c[g>>>8&255]^f[255&p]^t[++x],b=i[y>>>24]^s[g>>>16&255]^c[p>>>8&255]^f[255&d]^t[++x],g=i[g>>>24]^s[p>>>16&255]^c[d>>>8&255]^f[255&y]^t[++x],p=v,d=m,y=b;r[0]=h[p>>>24]<<24^h[d>>>16&255]<<16^h[y>>>8&255]<<8^h[255&g]^t[++x],r[n?3:1]=h[d>>>24]<<24^h[y>>>16&255]<<16^h[g>>>8&255]<<8^h[255&p]^t[++x],r[2]=h[y>>>24]<<24^h[g>>>16&255]<<16^h[p>>>8&255]<<8^h[255&d]^t[++x],r[n?1:3]=h[g>>>24]<<24^h[p>>>16&255]<<16^h[d>>>8&255]<<8^h[255&y]^t[++x]}function d(t){var e,r="AES-"+((t=t||{}).mode||"CBC").toUpperCase(),i=(e=t.decrypt?n.cipher.createDecipher(r,t.key):n.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var o=null;r instanceof n.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=t,i.call(e,r)},e}},function(t,e,r){var n=r(0);n.pki=n.pki||{};var i=t.exports=n.pki.oids=n.oids=n.oids||{};function o(t,e){i[t]=e,i[e]=t}function a(t,e){i[t]=e}o("1.2.840.113549.1.1.1","rsaEncryption"),o("1.2.840.113549.1.1.4","md5WithRSAEncryption"),o("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),o("1.2.840.113549.1.1.7","RSAES-OAEP"),o("1.2.840.113549.1.1.8","mgf1"),o("1.2.840.113549.1.1.9","pSpecified"),o("1.2.840.113549.1.1.10","RSASSA-PSS"),o("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),o("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),o("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),o("1.3.101.112","EdDSA25519"),o("1.2.840.10040.4.3","dsa-with-sha1"),o("1.3.14.3.2.7","desCBC"),o("1.3.14.3.2.26","sha1"),o("1.3.14.3.2.29","sha1WithRSASignature"),o("2.16.840.1.101.3.4.2.1","sha256"),o("2.16.840.1.101.3.4.2.2","sha384"),o("2.16.840.1.101.3.4.2.3","sha512"),o("2.16.840.1.101.3.4.2.4","sha224"),o("2.16.840.1.101.3.4.2.5","sha512-224"),o("2.16.840.1.101.3.4.2.6","sha512-256"),o("1.2.840.113549.2.2","md2"),o("1.2.840.113549.2.5","md5"),o("1.2.840.113549.1.7.1","data"),o("1.2.840.113549.1.7.2","signedData"),o("1.2.840.113549.1.7.3","envelopedData"),o("1.2.840.113549.1.7.4","signedAndEnvelopedData"),o("1.2.840.113549.1.7.5","digestedData"),o("1.2.840.113549.1.7.6","encryptedData"),o("1.2.840.113549.1.9.1","emailAddress"),o("1.2.840.113549.1.9.2","unstructuredName"),o("1.2.840.113549.1.9.3","contentType"),o("1.2.840.113549.1.9.4","messageDigest"),o("1.2.840.113549.1.9.5","signingTime"),o("1.2.840.113549.1.9.6","counterSignature"),o("1.2.840.113549.1.9.7","challengePassword"),o("1.2.840.113549.1.9.8","unstructuredAddress"),o("1.2.840.113549.1.9.14","extensionRequest"),o("1.2.840.113549.1.9.20","friendlyName"),o("1.2.840.113549.1.9.21","localKeyId"),o("1.2.840.113549.1.9.22.1","x509Certificate"),o("1.2.840.113549.1.12.10.1.1","keyBag"),o("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),o("1.2.840.113549.1.12.10.1.3","certBag"),o("1.2.840.113549.1.12.10.1.4","crlBag"),o("1.2.840.113549.1.12.10.1.5","secretBag"),o("1.2.840.113549.1.12.10.1.6","safeContentsBag"),o("1.2.840.113549.1.5.13","pkcs5PBES2"),o("1.2.840.113549.1.5.12","pkcs5PBKDF2"),o("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),o("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),o("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),o("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),o("1.2.840.113549.2.7","hmacWithSHA1"),o("1.2.840.113549.2.8","hmacWithSHA224"),o("1.2.840.113549.2.9","hmacWithSHA256"),o("1.2.840.113549.2.10","hmacWithSHA384"),o("1.2.840.113549.2.11","hmacWithSHA512"),o("1.2.840.113549.3.7","des-EDE3-CBC"),o("2.16.840.1.101.3.4.1.2","aes128-CBC"),o("2.16.840.1.101.3.4.1.22","aes192-CBC"),o("2.16.840.1.101.3.4.1.42","aes256-CBC"),o("2.5.4.3","commonName"),o("2.5.4.4","surname"),o("2.5.4.5","serialNumber"),o("2.5.4.6","countryName"),o("2.5.4.7","localityName"),o("2.5.4.8","stateOrProvinceName"),o("2.5.4.9","streetAddress"),o("2.5.4.10","organizationName"),o("2.5.4.11","organizationalUnitName"),o("2.5.4.12","title"),o("2.5.4.13","description"),o("2.5.4.15","businessCategory"),o("2.5.4.17","postalCode"),o("2.5.4.42","givenName"),o("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),o("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),o("2.16.840.1.113730.1.1","nsCertType"),o("2.16.840.1.113730.1.13","nsComment"),a("2.5.29.1","authorityKeyIdentifier"),a("2.5.29.2","keyAttributes"),a("2.5.29.3","certificatePolicies"),a("2.5.29.4","keyUsageRestriction"),a("2.5.29.5","policyMapping"),a("2.5.29.6","subtreesConstraint"),a("2.5.29.7","subjectAltName"),a("2.5.29.8","issuerAltName"),a("2.5.29.9","subjectDirectoryAttributes"),a("2.5.29.10","basicConstraints"),a("2.5.29.11","nameConstraints"),a("2.5.29.12","policyConstraints"),a("2.5.29.13","basicConstraints"),o("2.5.29.14","subjectKeyIdentifier"),o("2.5.29.15","keyUsage"),a("2.5.29.16","privateKeyUsagePeriod"),o("2.5.29.17","subjectAltName"),o("2.5.29.18","issuerAltName"),o("2.5.29.19","basicConstraints"),a("2.5.29.20","cRLNumber"),a("2.5.29.21","cRLReason"),a("2.5.29.22","expirationDate"),a("2.5.29.23","instructionCode"),a("2.5.29.24","invalidityDate"),a("2.5.29.25","cRLDistributionPoints"),a("2.5.29.26","issuingDistributionPoint"),a("2.5.29.27","deltaCRLIndicator"),a("2.5.29.28","issuingDistributionPoint"),a("2.5.29.29","certificateIssuer"),a("2.5.29.30","nameConstraints"),o("2.5.29.31","cRLDistributionPoints"),o("2.5.29.32","certificatePolicies"),a("2.5.29.33","policyMappings"),a("2.5.29.34","policyConstraints"),o("2.5.29.35","authorityKeyIdentifier"),a("2.5.29.36","policyConstraints"),o("2.5.29.37","extKeyUsage"),a("2.5.29.46","freshestCRL"),a("2.5.29.54","inhibitAnyPolicy"),o("1.3.6.1.4.1.11129.2.4.2","timestampList"),o("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),o("1.3.6.1.5.5.7.3.1","serverAuth"),o("1.3.6.1.5.5.7.3.2","clientAuth"),o("1.3.6.1.5.5.7.3.3","codeSigning"),o("1.3.6.1.5.5.7.3.4","emailProtection"),o("1.3.6.1.5.5.7.3.8","timeStamping")},function(t,e,r){var n=r(0);r(1);var i=t.exports=n.pem=n.pem||{};function o(t){for(var e=t.name+": ",r=[],n=function(t,e){return" "+e},i=0;i65&&-1!==a){var s=e[a];","===s?(++a,e=e.substr(0,a)+"\r\n "+e.substr(a)):e=e.substr(0,a)+"\r\n"+s+e.substr(a+1),o=i-a-1,a=-1,++i}else" "!==e[i]&&"\t"!==e[i]&&","!==e[i]||(a=i);return e}function a(t){return t.replace(/^\s+/,"")}i.encode=function(t,e){e=e||{};var r,i="-----BEGIN "+t.type+"-----\r\n";if(t.procType&&(i+=o(r={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]})),t.contentDomain&&(i+=o(r={name:"Content-Domain",values:[t.contentDomain]})),t.dekInfo&&(r={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&r.values.push(t.dekInfo.parameters),i+=o(r)),t.headers)for(var a=0;ae.blockLength&&(e.start(),e.update(a.bytes()),a=e.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),l=a.length(),u=0;u>>0,u>>>0];for(var l=i.fullMessageLength.length-1;l>=0;--l)i.fullMessageLength[l]+=u[1],u[1]=u[0]+(i.fullMessageLength[l]/4294967296>>>0),i.fullMessageLength[l]=i.fullMessageLength[l]>>>0,u[0]=u[1]/4294967296>>>0;return e.putBytes(o),s(t,r,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(e.bytes());var u,l=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(o.substr(0,i.blockLength-l));for(var c=8*i.fullMessageLength[0],f=0;f>>0,a.putInt32(c>>>0),c=u>>>0;a.putInt32(c);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};s(h,r,a);var p=n.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p},i};var o=null,a=!1;function s(t,e,r){for(var n,i,o,a,s,u,l,c=r.length();c>=64;){for(i=t.h0,o=t.h1,a=t.h2,s=t.h3,u=t.h4,l=0;l<16;++l)n=r.getInt32(),e[l]=n,n=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;l<20;++l)n=(n=e[l-3]^e[l-8]^e[l-14]^e[l-16])<<1|n>>>31,e[l]=n,n=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;l<32;++l)n=(n=e[l-3]^e[l-8]^e[l-14]^e[l-16])<<1|n>>>31,e[l]=n,n=(i<<5|i>>>27)+(o^a^s)+u+1859775393+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;l<40;++l)n=(n=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|n>>>30,e[l]=n,n=(i<<5|i>>>27)+(o^a^s)+u+1859775393+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;l<60;++l)n=(n=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|n>>>30,e[l]=n,n=(i<<5|i>>>27)+(o&a|s&(o^a))+u+2400959708+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;l<80;++l)n=(n=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|n>>>30,e[l]=n,n=(i<<5|i>>>27)+(o^a^s)+u+3395469782+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+o|0,t.h2=t.h2+a|0,t.h3=t.h3+s|0,t.h4=t.h4+u|0,c-=64}}},function(t,e,r){var n=r(0);function i(t,e){n.cipher.registerAlgorithm(t,function(){return new n.des.Algorithm(t,e)})}r(13),r(19),r(1),t.exports=n.des=n.des||{},n.des.startEncrypting=function(t,e,r,n){var i=d({key:t,output:r,decrypt:!1,mode:n||(null===e?"ECB":"CBC")});return i.start(e),i},n.des.createEncryptionCipher=function(t,e){return d({key:t,output:null,decrypt:!1,mode:e})},n.des.startDecrypting=function(t,e,r,n){var i=d({key:t,output:r,decrypt:!0,mode:n||(null===e?"ECB":"CBC")});return i.start(e),i},n.des.createDecryptionCipher=function(t,e){return d({key:t,output:null,decrypt:!0,mode:e})},n.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(t,e){return p(r._keys,t,e,!1)},decrypt:function(t,e){return p(r._keys,t,e,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=n.util.createBuffer(t.key);if(0===this.name.indexOf("3DES")&&24!==e.length())throw new Error("Invalid Triple-DES key size: "+8*e.length());this._keys=function(t){for(var e,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],o=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],l=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],d=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=t.length()>8?3:1,v=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],b=0,A=0;A>>4^w))<<4,x^=e=65535&((w^=e)>>>-16^x),x^=(e=858993459&(x>>>2^(w^=e<<-16)))<<2,x^=e=65535&((w^=e)>>>-16^x),x^=(e=1431655765&(x>>>1^(w^=e<<-16)))<<1,x^=e=16711935&((w^=e)>>>8^x),e=(x^=(e=1431655765&(x>>>1^(w^=e<<8)))<<1)<<8|(w^=e)>>>20&240,x=w<<24|w<<8&16711680|w>>>8&65280|w>>>24&240,w=e;for(var _=0;_>>26,w=w<<2|w>>>26):(x=x<<1|x>>>27,w=w<<1|w>>>27);var S=r[(x&=-15)>>>28]|n[x>>>24&15]|i[x>>>20&15]|o[x>>>16&15]|a[x>>>12&15]|s[x>>>8&15]|u[x>>>4&15],E=l[(w&=-15)>>>28]|c[w>>>24&15]|f[w>>>20&15]|h[w>>>16&15]|p[w>>>12&15]|d[w>>>8&15]|y[w>>>4&15];e=65535&(E>>>16^S),v[b++]=S^e,v[b++]=E^e<<16}}return v}(e),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var o=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],a=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],s=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],l=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],c=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],f=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],h=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function p(t,e,r,n){var i,p,d=32===t.length?3:9;i=3===d?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=e[0],g=e[1];y^=(p=252645135&(y>>>4^g))<<4,y^=(p=65535&(y>>>16^(g^=p)))<<16,y^=p=858993459&((g^=p)>>>2^y),y^=p=16711935&((g^=p<<2)>>>8^y),y=(y^=(p=1431655765&(y>>>1^(g^=p<<8)))<<1)<<1|y>>>31,g=(g^=p)<<1|g>>>31;for(var v=0;v>>4|g<<28)^t[A+1];p=y,y=g,g=p^(a[x>>>24&63]|u[x>>>16&63]|c[x>>>8&63]|h[63&x]|o[w>>>24&63]|s[w>>>16&63]|l[w>>>8&63]|f[63&w])}p=y,y=g,g=p}g=g>>>1|g<<31,g^=p=1431655765&((y=y>>>1|y<<31)>>>1^g),g^=(p=16711935&(g>>>8^(y^=p<<1)))<<8,g^=(p=858993459&(g>>>2^(y^=p)))<<2,g^=p=65535&((y^=p)>>>16^g),g^=p=252645135&((y^=p<<16)>>>4^g),y^=p<<4,r[0]=y,r[1]=g}function d(t){var e,r="DES-"+((t=t||{}).mode||"CBC").toUpperCase(),i=(e=t.decrypt?n.cipher.createDecipher(r,t.key):n.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var o=null;r instanceof n.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=t,i.call(e,r)},e}},function(t,e,r){var n=r(0);if(r(3),r(12),r(6),r(26),r(27),r(2),r(1),void 0===i)var i=n.jsbn.BigInteger;var o=n.util.isNodejs?r(16):null,a=n.asn1,u=n.util;n.pki=n.pki||{},t.exports=n.pki.rsa=n.rsa=n.rsa||{};var l=n.pki,c=[6,4,2,4,2,4,6,2],f={name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},h={name:"RSAPrivateKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},p={name:"RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},d=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},y={name:"DigestInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:a.Class.UNIVERSAL,type:a.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},g=function(t){var e;if(!(t.algorithm in l.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}e=l.oids[t.algorithm];var n=a.oidToDer(e).getBytes(),i=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]),o=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]);o.value.push(a.create(a.Class.UNIVERSAL,a.Type.OID,!1,n)),o.value.push(a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,""));var s=a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(o),i.value.push(s),a.toDer(i).getBytes()},v=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);var o;e.dP||(e.dP=e.d.mod(e.p.subtract(i.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(i.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));do{o=new i(n.util.bytesToHex(n.random.getBytes(e.n.bitLength()/8)),16)}while(o.compareTo(e.n)>=0||!o.gcd(e.n).equals(i.ONE));for(var a=(t=t.multiply(o.modPow(e.e,e.n)).mod(e.n)).mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);a.compareTo(s)<0;)a=a.add(e.p);var u=a.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return u.multiply(o.modInverse(e.n)).mod(e.n)};function m(t,e,r){var i=n.util.createBuffer(),o=Math.ceil(e.n.bitLength()/8);if(t.length>o-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=t.length,a.max=o-11,a}i.putByte(0),i.putByte(r);var s,u=o-3-t.length;if(0===r||1===r){s=0===r?0:255;for(var l=0;l0;){var c=0,f=n.random.getBytes(u);for(l=0;l1;){if(255!==a.getByte()){--a.read;break}++l}else if(2===u)for(l=0;a.length()>1;){if(0===a.getByte()){--a.read;break}++l}if(0!==a.getByte()||l!==o-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function A(t,e,r){"function"==typeof e&&(r=e,e={});var o={algorithm:{name:(e=e||{}).algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};function a(){s(t.pBits,function(e,n){return e?r(e):(t.p=n,null!==t.q?u(e,t.q):void s(t.qBits,u))})}function s(t,e){n.prime.generateProbablePrime(t,o,e)}function u(e,n){if(e)return r(e);if(t.q=n,t.p.compareTo(t.q)<0){var o=t.p;t.p=t.q,t.q=o}if(0!==t.p.subtract(i.ONE).gcd(t.e).compareTo(i.ONE))return t.p=null,void a();if(0!==t.q.subtract(i.ONE).gcd(t.e).compareTo(i.ONE))return t.q=null,void s(t.qBits,u);if(t.p1=t.p.subtract(i.ONE),t.q1=t.q.subtract(i.ONE),t.phi=t.p1.multiply(t.q1),0!==t.phi.gcd(t.e).compareTo(i.ONE))return t.p=t.q=null,void a();if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits)return t.q=null,void s(t.qBits,u);var c=t.e.modInverse(t.phi);t.keys={privateKey:l.rsa.setPrivateKey(t.n,t.e,c,t.p,t.q,c.mod(t.p1),c.mod(t.q1),t.q.modInverse(t.p)),publicKey:l.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}"prng"in e&&(o.prng=e.prng),a()}function x(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=n.util.hexToBytes(e);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function w(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function _(t){return n.util.isNodejs&&"function"==typeof o[t]}function S(t){return void 0!==u.globalScope&&"object"==s(u.globalScope.crypto)&&"object"==s(u.globalScope.crypto.subtle)&&"function"==typeof u.globalScope.crypto.subtle[t]}function E(t){return void 0!==u.globalScope&&"object"==s(u.globalScope.msCrypto)&&"object"==s(u.globalScope.msCrypto.subtle)&&"function"==typeof u.globalScope.msCrypto.subtle[t]}function C(t){for(var e=n.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),i=0;i0;)c.putByte(0),--f;return c.putBytes(n.util.hexToBytes(l)),c.getBytes()},l.rsa.decrypt=function(t,e,r,o){var a=Math.ceil(e.n.bitLength()/8);if(t.length!==a){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=a,s}var u=new i(n.util.createBuffer(t).toHex(),16);if(u.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=v(u,e,r).toString(16),c=n.util.createBuffer(),f=a-Math.ceil(l.length/2);f>0;)c.putByte(0),--f;return c.putBytes(n.util.hexToBytes(l)),!1!==o?b(c.getBytes(),e,r):c.getBytes()},l.rsa.createKeyPairGenerationState=function(t,e,r){"string"==typeof t&&(t=parseInt(t,10)),t=t||2048;var o,a=(r=r||{}).prng||n.random,s={nextBytes:function(t){for(var e=a.getBytesSync(t.length),r=0;r>1,pBits:t-(t>>1),pqState:0,num:null,keys:null}).e.fromInt(o.eInt),o},l.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,o=0,a=function(t,e){return t|e},s=+new Date,u=0;null===t.keys&&(e<=0||uf?t.pqState=0:t.num.isProbablePrime(w(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(c[o++%8],0):2===t.pqState?t.pqState=0===t.num.subtract(i.ONE).gcd(t.e).compareTo(i.ONE)?3:0:3===t.pqState&&(t.pqState=0,null===t.p?t.p=t.num:t.q=t.num,null!==t.p&&null!==t.q&&++t.state,t.num=null)}else if(1===t.state)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(2===t.state)t.p1=t.p.subtract(i.ONE),t.q1=t.q.subtract(i.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(3===t.state)0===t.phi.gcd(t.e).compareTo(i.ONE)?++t.state:(t.p=null,t.q=null,t.state=0);else if(4===t.state)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(5===t.state){var p=t.e.modInverse(t.phi);t.keys={privateKey:l.rsa.setPrivateKey(t.n,t.e,p,t.p,t.q,p.mod(t.p1),p.mod(t.q1),t.q.modInverse(t.p)),publicKey:l.rsa.setPublicKey(t.n,t.e)}}u+=(n=+new Date)-s,s=n}return null!==t.keys},l.rsa.generateKeyPair=function(t,e,r,i){if(1===arguments.length?"object"==s(t)?(r=t,t=void 0):"function"==typeof t&&(i=t,t=void 0):2===arguments.length?"number"==typeof t?"function"==typeof e?(i=e,e=void 0):"number"!=typeof e&&(r=e,e=void 0):(r=t,i=e,t=void 0,e=void 0):3===arguments.length&&("number"==typeof e?"function"==typeof r&&(i=r,r=void 0):(i=r,r=e,e=void 0)),r=r||{},void 0===t&&(t=r.bits||2048),void 0===e&&(e=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(65537===e||3===e))if(i){if(_("generateKeyPair"))return o.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(t,e,r){if(t)return i(t);i(null,{privateKey:l.privateKeyFromPem(r),publicKey:l.publicKeyFromPem(e)})});if(S("generateKey")&&S("exportKey"))return u.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:C(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(t){return u.globalScope.crypto.subtle.exportKey("pkcs8",t.privateKey)}).then(void 0,function(t){i(t)}).then(function(t){if(t){var e=l.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(t)));i(null,{privateKey:e,publicKey:l.setRsaPublicKey(e.n,e.e)})}});if(E("generateKey")&&E("exportKey")){var c=u.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:C(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(t){var e=t.target.result,r=u.globalScope.msCrypto.subtle.exportKey("pkcs8",e.privateKey);r.oncomplete=function(t){var e=t.target.result,r=l.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(e)));i(null,{privateKey:r,publicKey:l.setRsaPublicKey(r.n,r.e)})},r.onerror=function(t){i(t)}},void(c.onerror=function(t){i(t)})}}else if(_("generateKeyPairSync")){var f=o.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:l.privateKeyFromPem(f.privateKey),publicKey:l.publicKeyFromPem(f.publicKey)}}var h=l.rsa.createKeyPairGenerationState(t,e,r);if(!i)return l.rsa.stepKeyPairGenerationState(h,0),h.keys;A(h,r,i)},l.setRsaPublicKey=l.rsa.setPublicKey=function(t,e){var r={n:t,e:e,encrypt:function(t,e,i){if("string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===e)e={encode:function(t,e,r){return m(t,e,2).getBytes()}};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={encode:function(t,e){return n.pkcs1.encode_rsa_oaep(e,t,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(e))e={encode:function(t){return t}};else if("string"==typeof e)throw new Error('Unsupported encryption scheme: "'+e+'".');var o=e.encode(t,r,!0);return l.rsa.encrypt(o,r,!0)},verify:function(t,e,i,o){"string"==typeof i?i=i.toUpperCase():void 0===i&&(i="RSASSA-PKCS1-V1_5"),void 0===o&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),"RSASSA-PKCS1-V1_5"===i?i={verify:function(t,e){e=b(e,r,!0);var i=a.fromDer(e,{parseAllBytes:o._parseAllDigestBytes}),s={},u=[];if(!a.validate(i,y,s,u))throw(l=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.")).errors=u,l;var l,c=a.derToOid(s.algorithmIdentifier);if(c!==n.oids.md2&&c!==n.oids.md5&&c!==n.oids.sha1&&c!==n.oids.sha224&&c!==n.oids.sha256&&c!==n.oids.sha384&&c!==n.oids.sha512&&c!==n.oids["sha512-224"]&&c!==n.oids["sha512-256"])throw(l=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.")).oid=c,l;if(!(c!==n.oids.md2&&c!==n.oids.md5||"parameters"in s))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return t===s.digest}}:"NONE"!==i&&"NULL"!==i&&null!==i||(i={verify:function(t,e){return t===b(e,r,!0)}});var s=l.rsa.decrypt(e,r,!0,!1);return i.verify(t,s,r.n.bitLength())}};return r},l.setRsaPrivateKey=l.rsa.setPrivateKey=function(t,e,r,i,o,a,s,u){var c={n:t,e:e,d:r,p:i,q:o,dP:a,dQ:s,qInv:u,decrypt:function(t,e,r){"string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5");var i=l.rsa.decrypt(t,c,!1,!1);if("RSAES-PKCS1-V1_5"===e)e={decode:b};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={decode:function(t,e){return n.pkcs1.decode_rsa_oaep(e,t,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(e))throw new Error('Unsupported encryption scheme: "'+e+'".');e={decode:function(t){return t}}}return e.decode(i,c,!1)},sign:function(t,e){var r=!1;"string"==typeof e&&(e=e.toUpperCase()),void 0===e||"RSASSA-PKCS1-V1_5"===e?(e={encode:g},r=1):"NONE"!==e&&"NULL"!==e&&null!==e||(e={encode:function(){return t}},r=1);var n=e.encode(t,c.n.bitLength());return l.rsa.encrypt(n,c,r)}};return c},l.wrapRsaPrivateKey=function(t){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(l.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(t).getBytes())])},l.privateKeyFromAsn1=function(t){var e,r,o,s,u,c,p,d,y={},g=[];if(a.validate(t,f,y,g)&&(t=a.fromDer(n.util.createBuffer(y.privateKey))),y={},g=[],!a.validate(t,h,y,g)){var v=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw v.errors=g,v}return e=n.util.createBuffer(y.privateKeyModulus).toHex(),r=n.util.createBuffer(y.privateKeyPublicExponent).toHex(),o=n.util.createBuffer(y.privateKeyPrivateExponent).toHex(),s=n.util.createBuffer(y.privateKeyPrime1).toHex(),u=n.util.createBuffer(y.privateKeyPrime2).toHex(),c=n.util.createBuffer(y.privateKeyExponent1).toHex(),p=n.util.createBuffer(y.privateKeyExponent2).toHex(),d=n.util.createBuffer(y.privateKeyCoefficient).toHex(),l.setRsaPrivateKey(new i(e,16),new i(r,16),new i(o,16),new i(s,16),new i(u,16),new i(c,16),new i(p,16),new i(d,16))},l.privateKeyToAsn1=l.privateKeyToRSAPrivateKey=function(t){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,x(t.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,x(t.e)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,x(t.d)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,x(t.p)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,x(t.q)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,x(t.dP)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,x(t.dQ)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,x(t.qInv))])},l.publicKeyFromAsn1=function(t){var e={},r=[];if(a.validate(t,d,e,r)){var o,s=a.derToOid(e.publicKeyOid);if(s!==l.oids.rsaEncryption)throw(o=new Error("Cannot read public key. Unknown OID.")).oid=s,o;t=e.rsaPublicKey}if(r=[],!a.validate(t,p,e,r))throw(o=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,o;var u=n.util.createBuffer(e.publicKeyModulus).toHex(),c=n.util.createBuffer(e.publicKeyExponent).toHex();return l.setRsaPublicKey(new i(u,16),new i(c,16))},l.publicKeyToAsn1=l.publicKeyToSubjectPublicKeyInfo=function(t){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(l.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.BITSTRING,!1,[l.publicKeyToRSAPublicKey(t)])])},l.publicKeyToRSAPublicKey=function(t){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,x(t.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,x(t.e))])}},function(t,e,r){var n,i=r(0);function o(t,e,r){this.data=[],null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function a(){return new o(null)}function s(t,e,r,n,i,o){for(var a=16383&e,s=e>>14;--o>=0;){var u=16383&this.data[t],l=this.data[t++]>>14,c=s*u+l*a;i=((u=a*u+((16383&c)<<14)+r.data[n]+i)>>28)+(c>>14)+s*l,r.data[n++]=268435455&u}return i}t.exports=i.jsbn=i.jsbn||{},i.jsbn.BigInteger=o,"undefined"==typeof navigator?(o.prototype.am=s,n=28):"Microsoft Internet Explorer"==navigator.appName?(o.prototype.am=function(t,e,r,n,i,o){for(var a=32767&e,s=e>>15;--o>=0;){var u=32767&this.data[t],l=this.data[t++]>>15,c=s*u+l*a;i=((u=a*u+((32767&c)<<15)+r.data[n]+(1073741823&i))>>>30)+(c>>>15)+s*l+(i>>>30),r.data[n++]=1073741823&u}return i},n=30):"Netscape"!=navigator.appName?(o.prototype.am=function(t,e,r,n,i,o){for(;--o>=0;){var a=e*this.data[t++]+r.data[n]+i;i=Math.floor(a/67108864),r.data[n++]=67108863&a}return i},n=26):(o.prototype.am=s,n=28),o.prototype.DB=n,o.prototype.DM=(1<>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function y(t){this.m=t}function g(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function w(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function _(){}function S(t){return t}function E(t){this.r2=a(),this.q3=a(),o.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}y.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},y.prototype.revert=function(t){return t},y.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},y.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},y.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},g.prototype.convert=function(t){var e=a();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(o.ZERO)>0&&this.m.subTo(e,e),e},g.prototype.revert=function(t){var e=a();return t.copyTo(e),this.reduce(e),e},g.prototype.reduce=function(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},g.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},g.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},o.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s},o.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0},o.prototype.fromString=function(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var n=t.length,i=!1,a=0;--n>=0;){var s=8==r?255&t[n]:h(t,n);s<0?"-"==t.charAt(n)&&(i=!0):(i=!1,0==a?this.data[this.t++]=s:a+r>this.DB?(this.data[this.t-1]|=(s&(1<>this.DB-a):this.data[this.t-1]|=s<=this.DB&&(a-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t},o.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s},o.prototype.drShiftTo=function(t,e){for(var r=t;r=0;--r)e.data[r+a+1]=this.data[r]>>i|s,s=(this.data[r]&o)<=0;--r)e.data[r]=0;e.data[a]=s,e.t=this.t+a+1,e.s=this.s,e.clamp()},o.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,o=(1<>n;for(var a=r+1;a>n;n>0&&(e.data[this.t-r-1]|=(this.s&o)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()},o.prototype.multiplyTo=function(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()},o.prototype.divRemTo=function(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(c,s),i.lShiftTo(c,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,h=s.data[f-1];if(0!=h){var p=h*(1<1?s.data[f-2]>>this.F2:0),y=this.FV/p,g=(1<=0&&(r.data[r.t++]=1,r.subTo(A,r)),o.ONE.dlShiftTo(f,A),A.subTo(s,s);s.t=0;){var x=r.data[--m]==h?this.DM:Math.floor(r.data[m]*y+(r.data[m-1]+v)*g);if((r.data[m]+=s.am(0,x,r,b,0,f))0&&r.rShiftTo(c,r),u<0&&o.ZERO.subTo(r,r)}}},o.prototype.invDigit=function(){if(this.t<1)return 0;var t=this.data[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},o.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},o.prototype.exp=function(t,e){if(t>4294967295||t<1)return o.ONE;var r=a(),n=a(),i=e.convert(this),s=d(t)-1;for(i.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,i,r);else{var u=r;r=n,n=u}return e.revert(r)},o.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<0)for(s>s)>0&&(i=!0,o=f(r));a>=0;)s>(s+=this.DB-e)):(r=this.data[a]>>(s-=e)&n,s<=0&&(s+=this.DB,--a)),r>0&&(i=!0),i&&(o+=f(r));return i?o:"0"},o.prototype.negate=function(){var t=a();return o.ZERO.subTo(this,t),t},o.prototype.abs=function(){return this.s<0?this.negate():this},o.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this.data[r]-t.data[r]))return e;return 0},o.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this.data[this.t-1]^this.s&this.DM)},o.prototype.mod=function(t){var e=a();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(o.ZERO)>0&&t.subTo(e,e),e},o.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new y(e):new g(e),this.exp(t,r)},o.ZERO=p(0),o.ONE=p(1),_.prototype.convert=S,_.prototype.revert=S,_.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},_.prototype.sqrTo=function(t,e){t.squareTo(e)},E.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=a();return t.copyTo(e),this.reduce(e),e},E.prototype.revert=function(t){return t},E.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},E.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},E.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var C=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],k=(1<<26)/C[C.length-1];o.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},o.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=p(r),i=a(),o=a(),s="";for(this.divRemTo(n,i,o);i.signum()>0;)s=(r+o.intValue()).toString(t).substr(1)+s,i.divRemTo(n,i,o);return o.intValue().toString(t)+s},o.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,a=0,s=0,u=0;u=r&&(this.dMultiply(n),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(e,a)),this.dAddOffset(s,0)),i&&o.ZERO.subTo(this,this)},o.prototype.fromNumber=function(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(o.ONE.shiftLeft(t-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(o.ONE.shiftLeft(t-1),this);else{var n=new Array,i=7&t;n.length=1+(t>>3),e.nextBytes(n),i>0?n[0]&=(1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()},o.prototype.dMultiply=function(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},o.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}},o.prototype.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n0)if(0==e)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r},o.prototype.millerRabin=function(t){var e=this.subtract(o.ONE),r=e.getLowestSetBit();if(r<=0)return!1;for(var n,i=e.shiftRight(r),a={nextBytes:function(t){for(var e=0;e=0);var u=n.modPow(i,this);if(0!=u.compareTo(o.ONE)&&0!=u.compareTo(e)){for(var l=1;l++>24},o.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},o.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},o.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<=0;)n<8?(r=(this.data[t]&(1<>(n+=this.DB-8)):(r=this.data[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},o.prototype.equals=function(t){return 0==this.compareTo(t)},o.prototype.min=function(t){return this.compareTo(t)<0?this:t},o.prototype.max=function(t){return this.compareTo(t)>0?this:t},o.prototype.and=function(t){var e=a();return this.bitwiseTo(t,v,e),e},o.prototype.or=function(t){var e=a();return this.bitwiseTo(t,m,e),e},o.prototype.xor=function(t){var e=a();return this.bitwiseTo(t,b,e),e},o.prototype.andNot=function(t){var e=a();return this.bitwiseTo(t,A,e),e},o.prototype.not=function(){for(var t=a(),e=0;e=this.t?0!=this.s:0!=(this.data[e]&1<1){var f=a();for(n.sqrTo(s[1],f);u<=c;)s[u]=a(),n.mulTo(f,s[u-2],s[u]),u+=2}var h,v,m=t.t-1,b=!0,A=a();for(i=d(t.data[m])-1;m>=0;){for(i>=l?h=t.data[m]>>i-l&c:(h=(t.data[m]&(1<0&&(h|=t.data[m-1]>>this.DB+i-l)),u=r;0==(1&h);)h>>=1,--u;if((i-=u)<0&&(i+=this.DB,--m),b)s[h].copyTo(o),b=!1;else{for(;u>1;)n.sqrTo(o,A),n.sqrTo(A,o),u-=2;u>0?n.sqrTo(o,A):(v=o,o=A,A=v),n.mulTo(A,s[h],o)}for(;m>=0&&0==(t.data[m]&1<=0?(r.subTo(n,r),e&&i.subTo(s,i),a.subTo(u,a)):(n.subTo(r,n),e&&s.subTo(i,s),u.subTo(a,u))}return 0!=n.compareTo(o.ONE)?o.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},o.prototype.pow=function(t){return this.exp(t,new _)},o.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return e;for(i0&&(e.rShiftTo(o,e),r.rShiftTo(o,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},o.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r.data[0]<=C[C.length-1]){for(e=0;e>>0,s>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=s[1],s[1]=s[0]+(i.fullMessageLength[u]/4294967296>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,s[0]=s[1]/4294967296>>>0;return e.putBytes(o),c(t,r,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(e.bytes());var s=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(o.substr(0,i.blockLength-s));for(var u,l=0,f=i.fullMessageLength.length-1;f>=0;--f)l=(u=8*i.fullMessageLength[f]+l)/4294967296>>>0,a.putInt32Le(u>>>0);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3};c(h,r,a);var p=n.util.createBuffer();return p.putInt32Le(h.h0),p.putInt32Le(h.h1),p.putInt32Le(h.h2),p.putInt32Le(h.h3),p},i};var o=null,a=null,s=null,u=null,l=!1;function c(t,e,r){for(var n,i,o,l,c,f,h,p=r.length();p>=64;){for(i=t.h0,o=t.h1,l=t.h2,c=t.h3,h=0;h<16;++h)e[h]=r.getInt32Le(),n=i+(c^o&(l^c))+u[h]+e[h],i=c,c=l,l=o,o+=n<<(f=s[h])|n>>>32-f;for(;h<32;++h)n=i+(l^c&(o^l))+u[h]+e[a[h]],i=c,c=l,l=o,o+=n<<(f=s[h])|n>>>32-f;for(;h<48;++h)n=i+(o^l^c)+u[h]+e[a[h]],i=c,c=l,l=o,o+=n<<(f=s[h])|n>>>32-f;for(;h<64;++h)n=i+(l^(o|~c))+u[h]+e[a[h]],i=c,c=l,l=o,o+=n<<(f=s[h])|n>>>32-f;t.h0=t.h0+i|0,t.h1=t.h1+o|0,t.h2=t.h2+l|0,t.h3=t.h3+c|0,p-=64}}},function(t,e,r){var n=r(0);r(8),r(4),r(1);var i,o=n.pkcs5=n.pkcs5||{};n.util.isNodejs&&!n.options.usePureJavaScript&&(i=r(16)),t.exports=n.pbkdf2=o.pbkdf2=function(t,e,r,o,a,u){if("function"==typeof a&&(u=a,a=null),n.util.isNodejs&&!n.options.usePureJavaScript&&i.pbkdf2&&(null===a||"object"!=s(a))&&(i.pbkdf2Sync.length>4||!a||"sha1"===a))return"string"!=typeof a&&(a="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),u?4===i.pbkdf2Sync.length?i.pbkdf2(t,e,r,o,function(t,e){if(t)return u(t);u(null,e.toString("binary"))}):i.pbkdf2(t,e,r,o,a,function(t,e){if(t)return u(t);u(null,e.toString("binary"))}):4===i.pbkdf2Sync.length?i.pbkdf2Sync(t,e,r,o).toString("binary"):i.pbkdf2Sync(t,e,r,o,a).toString("binary");if(null==a&&(a="sha1"),"string"==typeof a){if(!(a in n.md.algorithms))throw new Error("Unknown hash algorithm: "+a);a=n.md[a].create()}var l=a.digestLength;if(o>4294967295*l){var c=new Error("Derived key is too long.");if(u)return u(c);throw c}var f=Math.ceil(o/l),h=o-(f-1)*l,p=n.hmac.create();p.start(a,t);var d,y,g,v="";if(!u){for(var m=1;m<=f;++m){p.start(null,null),p.update(e),p.update(n.util.int32ToBytes(m)),d=g=p.digest().getBytes();for(var b=2;b<=r;++b)p.start(null,null),p.update(g),y=p.digest().getBytes(),d=n.util.xorBytes(d,y,l),g=y;v+=mf)return u(null,v);p.start(null,null),p.update(e),p.update(n.util.int32ToBytes(m)),d=g=p.digest().getBytes(),b=2,x()}function x(){if(b<=r)return p.start(null,null),p.update(g),y=p.digest().getBytes(),d=n.util.xorBytes(d,y,l),g=y,++b,n.util.setImmediate(x);v+=m128)throw new Error('Invalid "nsComment" content.');t.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,t.comment)}else if("subjectKeyIdentifier"===t.name&&e.cert){var p=e.cert.generateSubjectKeyIdentifier();t.subjectKeyIdentifier=p.toHex(),t.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,p.getBytes())}else if("authorityKeyIdentifier"===t.name&&e.cert){if(t.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),c=t.value.value,t.keyIdentifier){var d=!0===t.keyIdentifier?e.cert.generateSubjectKeyIdentifier().getBytes():t.keyIdentifier;c.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,d))}if(t.authorityCertIssuer){var y=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[m(!0===t.authorityCertIssuer?e.cert.issuer:t.authorityCertIssuer)])];c.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,y))}if(t.serialNumber){var g=n.util.hexToBytes(!0===t.serialNumber?e.cert.serialNumber:t.serialNumber);c.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,g))}}else if("cRLDistributionPoints"===t.name){t.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),c=t.value.value;var v,b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),A=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(h=0;h2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(f.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(u.validity.notBefore=f[0],u.validity.notAfter=f[1],u.tbsCertificate=r.tbsCertificate,e){u.md=g({signatureOid:u.signatureOid,type:"certificate"});var h=i.toDer(u.tbsCertificate);u.md.update(h.getBytes())}var p=n.md.sha1.create(),v=i.toDer(r.certIssuer);p.update(v.getBytes()),u.issuer.getField=function(t){return d(u.issuer,t)},u.issuer.addField=function(t){b([t]),u.issuer.attributes.push(t)},u.issuer.attributes=o.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(u.issuer.uniqueId=r.certIssuerUniqueId),u.issuer.hash=p.digest().toHex();var m=n.md.sha1.create(),A=i.toDer(r.certSubject);return m.update(A.getBytes()),u.subject.getField=function(t){return d(u.subject,t)},u.subject.addField=function(t){b([t]),u.subject.attributes.push(t)},u.subject.attributes=o.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(u.subject.uniqueId=r.certSubjectUniqueId),u.subject.hash=m.digest().toHex(),r.certExtensions?u.extensions=o.certificateExtensionsFromAsn1(r.certExtensions):u.extensions=[],u.publicKey=o.publicKeyFromAsn1(r.subjectPublicKeyInfo),u},o.certificateExtensionsFromAsn1=function(t){for(var e=[],r=0;r1&&(r=u.value.charCodeAt(1),o=u.value.length>2?u.value.charCodeAt(2):0),e.digitalSignature=128==(128&r),e.nonRepudiation=64==(64&r),e.keyEncipherment=32==(32&r),e.dataEncipherment=16==(16&r),e.keyAgreement=8==(8&r),e.keyCertSign=4==(4&r),e.cRLSign=2==(2&r),e.encipherOnly=1==(1&r),e.decipherOnly=128==(128&o)}else if("basicConstraints"===e.name){(u=i.fromDer(e.value)).value.length>0&&u.value[0].type===i.Type.BOOLEAN?e.cA=0!==u.value[0].value.charCodeAt(0):e.cA=!1;var s=null;u.value.length>0&&u.value[0].type===i.Type.INTEGER?s=u.value[0].value:u.value.length>1&&(s=u.value[1].value),null!==s&&(e.pathLenConstraint=i.derToInteger(s))}else if("extKeyUsage"===e.name)for(var u=i.fromDer(e.value),l=0;l1&&(r=u.value.charCodeAt(1)),e.client=128==(128&r),e.server=64==(64&r),e.email=32==(32&r),e.objsign=16==(16&r),e.reserved=8==(8&r),e.sslCA=4==(4&r),e.emailCA=2==(2&r),e.objCA=1==(1&r);else if("subjectAltName"===e.name||"issuerAltName"===e.name){var f;e.altNames=[],u=i.fromDer(e.value);for(var h=0;h=w&&t<_?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(t)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(t))}o.getTBSCertificate=function(t){var e=S(t.validity.notBefore),r=S(t.validity.notAfter),a=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.version).getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(t.serialNumber)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.siginfo.algorithmOid).getBytes()),x(t.siginfo.algorithmOid,t.siginfo.parameters)]),m(t.issuer),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[e,r]),m(t.subject),o.publicKeyToAsn1(t.publicKey)]);return t.issuer.uniqueId&&a.value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+t.issuer.uniqueId)])),t.subject.uniqueId&&a.value.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+t.subject.uniqueId)])),t.extensions.length>0&&a.value.push(o.certificateExtensionsToAsn1(t.extensions)),a},o.getCertificationRequestInfo=function(t){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.version).getBytes()),m(t.subject),o.publicKeyToAsn1(t.publicKey),function(t){var e=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===t.attributes.length)return e;for(var r=t.attributes,o=0;of.validity.notAfter)&&(l={message:"Certificate is not valid yet or has expired.",error:o.certificateError.certificate_expired,notBefore:f.validity.notBefore,notAfter:f.validity.notAfter,now:a}),null===l){if(null===(h=e[0]||t.getIssuer(f))&&f.isIssuer(f)&&(p=!0,h=f),h){var d=h;n.util.isArray(d)||(d=[d]);for(var y=!1;!y&&d.length>0;){h=d.shift();try{y=h.verify(f)}catch(t){}}y||(l={message:"Certificate signature is invalid.",error:o.certificateError.bad_certificate})}null!==l||h&&!p||t.hasCertificate(f)||(l={message:"Certificate is not trusted.",error:o.certificateError.unknown_ca})}if(null===l&&h&&!f.isIssuer(h)&&(l={message:"Certificate issuer is invalid.",error:o.certificateError.bad_certificate}),null===l)for(var g={keyUsage:!0,basicConstraints:!0},v=0;null===l&&vb.pathLenConstraint&&(l={message:"Certificate basicConstraints pathLenConstraint violated.",error:o.certificateError.bad_certificate})}var x=null===l||l.error,w=r.verify?r.verify(x,c,i):x;if(!0!==w)throw!0===x&&(l={message:"The application rejected the certificate.",error:o.certificateError.bad_certificate}),(w||0===w)&&("object"!=s(w)||n.util.isArray(w)?"string"==typeof w&&(l.error=w):(w.message&&(l.message=w.message),w.error&&(l.error=w.error))),l;l=null,u=!1,++c}while(e.length>0);return!0}},function(t,e,r){var n=r(0);r(2),r(1),(t.exports=n.pss=n.pss||{}).create=function(t){3===arguments.length&&(t={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var e,r=t.md,i=t.mgf,o=r.digestLength,a=t.salt||null;if("string"==typeof a&&(a=n.util.createBuffer(a)),"saltLength"in t)e=t.saltLength;else{if(null===a)throw new Error("Salt length not specified or specific salt not given.");e=a.length()}if(null!==a&&a.length()!==e)throw new Error("Given salt length does not match length of given salt.");var s=t.prng||n.random;return{encode:function(t,u){var l,c,f=u-1,h=Math.ceil(f/8),p=t.digest().getBytes();if(h>8*h-f&255;return(A=String.fromCharCode(A.charCodeAt(0)&~x)+A.substr(1))+y+String.fromCharCode(188)},verify:function(t,a,s){var u,l=s-1,c=Math.ceil(l/8);if(a=a.substr(-c),c>8*c-l&255;if(0!=(h.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var y=i.generate(p,f),g="";for(u=0;u4){var r=t;t=n.util.createBuffer();for(var i=0;i0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return!(n>this.blockSize<<2||(t.truncate(n),0))},i.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(t){if(null===t.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return!(n>this.blockSize<<2||(t.truncate(n),0))},i.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear(),i=0;i0)t.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear(),i=0;i0)t.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(0===t.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear(),i=0;i0)t.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear(),i=0;i0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}a(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e,r=n.util.createBuffer(t.iv);if(this._cipherLength=0,e="additionalData"in t?n.util.createBuffer(t.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in t?t.tagLength:128,this._tag=null,t.decrypt&&(this._tag=n.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(s(8*i)))}this._inBlock=this._j0.slice(0),a(this._inBlock),this._partialBytes=0,e=n.util.createBuffer(e),this._aDataLength=s(8*e.length());var o=e.length()%this.blockSize;for(o&&e.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];e.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()])},i.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear(),i=0;i0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),a(this._inBlock)},i.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),a(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i0;--n)e[n]=t[n]>>>1|(1&t[n-1])<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)},i.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=t[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];e[0]^=i[0],e[1]^=i[1],e[2]^=i[2],e[3]^=i[3]}return e},i.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)},i.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,o=new Array(i),a=0;a>>1,i=new Array(r);i[n]=t.slice(0);for(var o=n>>>1;o>0;)this.pow(i[2*o],i[o]=[]),o>>=1;for(o=2;o>1,s=a+(1&t.length),u=t.substr(0,s),l=t.substr(a,s),c=n.util.createBuffer(),f=n.hmac.create();r=e+r;var h=Math.ceil(i/16),p=Math.ceil(i/20);f.start("MD5",u);var d=n.util.createBuffer();c.putBytes(r);for(var y=0;y0&&(c.queue(t,c.createAlert(t,{level:c.Alert.Level.warning,description:c.Alert.Description.no_renegotiation})),c.flush(t)),t.process()},c.parseHelloMessage=function(t,e,r){var i=null,o=t.entity===c.ConnectionEnd.client;if(r<38)t.error(t,{message:o?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});else{var a=e.fragment,s=a.length();if(i={version:{major:a.getByte(),minor:a.getByte()},random:n.util.createBuffer(a.getBytes(32)),session_id:u(a,1),extensions:[]},o?(i.cipher_suite=a.getBytes(2),i.compression_method=a.getByte()):(i.cipher_suites=u(a,2),i.compression_methods=u(a,1)),(s=r-(s-a.length()))>0){for(var l=u(a,2);l.length()>0;)i.extensions.push({type:[l.getByte(),l.getByte()],data:u(l,2)});if(!o)for(var f=0;f0&&0===p.getByte();)t.session.extensions.server_name.serverNameList.push(u(p,2).getBytes())}}if(t.session.version&&(i.version.major!==t.session.version.major||i.version.minor!==t.session.version.minor))return t.error(t,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.protocol_version}});if(o)t.session.cipherSuite=c.getCipherSuite(i.cipher_suite);else for(var d=n.util.createBuffer(i.cipher_suites.bytes());d.length()>0&&(t.session.cipherSuite=c.getCipherSuite(d.getBytes(2)),null===t.session.cipherSuite););if(null===t.session.cipherSuite)return t.error(t,{message:"No cipher suites in common.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.handshake_failure},cipherSuite:n.util.bytesToHex(i.cipher_suite)});t.session.compressionMethod=o?i.compression_method:c.CompressionMethod.none}return i},c.createSecurityParameters=function(t,e){var r=t.entity===c.ConnectionEnd.client,n=e.random.bytes(),i=r?t.session.sp.client_random:n,o=r?n:c.createRandom().getBytes();t.session.sp={entity:t.entity,prf_algorithm:c.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:t.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:o}},c.handleServerHello=function(t,e,r){var n=c.parseHelloMessage(t,e,r);if(!t.fail){if(!(n.version.minor<=t.version.minor))return t.error(t,{message:"Incompatible TLS version.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.protocol_version}});t.version.minor=n.version.minor,t.session.version=t.version;var i=n.session_id.bytes();i.length>0&&i===t.session.id?(t.expect=y,t.session.resuming=!0,t.session.sp.server_random=n.random.bytes()):(t.expect=f,t.session.resuming=!1,c.createSecurityParameters(t,n)),t.session.id=i,t.process()}},c.handleClientHello=function(t,e,r){var i=c.parseHelloMessage(t,e,r);if(!t.fail){var o=i.session_id.bytes(),a=null;if(t.sessionCache&&(null===(a=t.sessionCache.getSession(o))?o="":(a.version.major!==i.version.major||a.version.minor>i.version.minor)&&(a=null,o="")),0===o.length&&(o=n.random.getBytes(32)),t.session.id=o,t.session.clientHelloVersion=i.version,t.session.sp={},a)t.version=t.session.version=a.version,t.session.sp=a.sp;else{for(var s,u=1;u0;)i=u(s.certificate_list,3),o=n.asn1.fromDer(i),i=n.pki.certificateFromAsn1(o,!0),l.push(i)}catch(e){return t.error(t,{message:"Could not parse certificate list.",cause:e,send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.bad_certificate}})}var f=t.entity===c.ConnectionEnd.client;!f&&!0!==t.verifyClient||0!==l.length?0===l.length?t.expect=f?h:A:(f?t.session.serverCertificate=l[0]:t.session.clientCertificate=l[0],c.verifyCertificateChain(t,l)&&(t.expect=f?h:A)):t.error(t,{message:f?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}}),t.process()},c.handleServerKeyExchange=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.unsupported_certificate}});t.expect=p,t.process()},c.handleClientKeyExchange=function(t,e,r){if(r<48)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.unsupported_certificate}});var i=e.fragment,o={enc_pre_master_secret:u(i,2).getBytes()},a=null;if(t.getPrivateKey)try{a=t.getPrivateKey(t,t.session.serverCertificate),a=n.pki.privateKeyFromPem(a)}catch(e){t.error(t,{message:"Could not get private key.",cause:e,send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}})}if(null===a)return t.error(t,{message:"No private key set.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}});try{var s=t.session.sp;s.pre_master_secret=a.decrypt(o.enc_pre_master_secret);var l=t.session.clientHelloVersion;if(l.major!==s.pre_master_secret.charCodeAt(0)||l.minor!==s.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(t){s.pre_master_secret=n.random.getBytes(48)}t.expect=w,null!==t.session.clientCertificate&&(t.expect=x),t.process()},c.handleCertificateRequest=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var n=e.fragment,i={certificate_types:u(n,1),certificate_authorities:u(n,2)};t.session.certificateRequest=i,t.expect=d,t.process()},c.handleCertificateVerify=function(t,e,r){if(r<2)return t.error(t,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var i=e.fragment;i.read-=4;var o=i.bytes();i.read+=4;var a={signature:u(i,2).getBytes()},s=n.util.createBuffer();s.putBuffer(t.session.md5.digest()),s.putBuffer(t.session.sha1.digest()),s=s.getBytes();try{if(!t.session.clientCertificate.publicKey.verify(s,a.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");t.session.md5.update(o),t.session.sha1.update(o)}catch(e){return t.error(t,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.handshake_failure}})}t.expect=w,t.process()},c.handleServerHelloDone=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.record_overflow}});if(null===t.serverCertificate){var i={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.insufficient_security}},o=t.verify(t,i.alert.description,0,[]);if(!0!==o)return(o||0===o)&&("object"!=s(o)||n.util.isArray(o)?"number"==typeof o&&(i.alert.description=o):(o.message&&(i.message=o.message),o.alert&&(i.alert.description=o.alert))),t.error(t,i)}null!==t.session.certificateRequest&&(e=c.createRecord(t,{type:c.ContentType.handshake,data:c.createCertificate(t)}),c.queue(t,e)),e=c.createRecord(t,{type:c.ContentType.handshake,data:c.createClientKeyExchange(t)}),c.queue(t,e),t.expect=m;var a=function(t,e){null!==t.session.certificateRequest&&null!==t.session.clientCertificate&&c.queue(t,c.createRecord(t,{type:c.ContentType.handshake,data:c.createCertificateVerify(t,e)})),c.queue(t,c.createRecord(t,{type:c.ContentType.change_cipher_spec,data:c.createChangeCipherSpec()})),t.state.pending=c.createConnectionState(t),t.state.current.write=t.state.pending.write,c.queue(t,c.createRecord(t,{type:c.ContentType.handshake,data:c.createFinished(t)})),t.expect=y,c.flush(t),t.process()};if(null===t.session.certificateRequest||null===t.session.clientCertificate)return a(t,null);c.getClientSignature(t,a)},c.handleChangeCipherSpec=function(t,e){if(1!==e.fragment.getByte())return t.error(t,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var r=t.entity===c.ConnectionEnd.client;(t.session.resuming&&r||!t.session.resuming&&!r)&&(t.state.pending=c.createConnectionState(t)),t.state.current.read=t.state.pending.read,(!t.session.resuming&&r||t.session.resuming&&!r)&&(t.state.pending=null),t.expect=r?g:_,t.process()},c.handleFinished=function(t,e,r){var o=e.fragment;o.read-=4;var a=o.bytes();o.read+=4;var s=e.fragment.getBytes();(o=n.util.createBuffer()).putBuffer(t.session.md5.digest()),o.putBuffer(t.session.sha1.digest());var u=t.entity===c.ConnectionEnd.client,l=u?"server finished":"client finished",f=t.session.sp;if((o=i(f.master_secret,l,o.getBytes(),12)).getBytes()!==s)return t.error(t,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.decrypt_error}});t.session.md5.update(a),t.session.sha1.update(a),(t.session.resuming&&u||!t.session.resuming&&!u)&&(c.queue(t,c.createRecord(t,{type:c.ContentType.change_cipher_spec,data:c.createChangeCipherSpec()})),t.state.current.write=t.state.pending.write,t.state.pending=null,c.queue(t,c.createRecord(t,{type:c.ContentType.handshake,data:c.createFinished(t)}))),t.expect=u?v:S,t.handshaking=!1,++t.handshakes,t.peerCertificate=u?t.session.serverCertificate:t.session.clientCertificate,c.flush(t),t.isConnected=!0,t.connected(t),t.process()},c.handleAlert=function(t,e){var r,n=e.fragment,i={level:n.getByte(),description:n.getByte()};switch(i.description){case c.Alert.Description.close_notify:r="Connection closed.";break;case c.Alert.Description.unexpected_message:r="Unexpected message.";break;case c.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case c.Alert.Description.decryption_failed:r="Decryption failed.";break;case c.Alert.Description.record_overflow:r="Record overflow.";break;case c.Alert.Description.decompression_failure:r="Decompression failed.";break;case c.Alert.Description.handshake_failure:r="Handshake failure.";break;case c.Alert.Description.bad_certificate:r="Bad certificate.";break;case c.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case c.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case c.Alert.Description.certificate_expired:r="Certificate expired.";break;case c.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case c.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case c.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case c.Alert.Description.access_denied:r="Access denied.";break;case c.Alert.Description.decode_error:r="Decode error.";break;case c.Alert.Description.decrypt_error:r="Decrypt error.";break;case c.Alert.Description.export_restriction:r="Export restriction.";break;case c.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case c.Alert.Description.insufficient_security:r="Insufficient security.";break;case c.Alert.Description.internal_error:r="Internal error.";break;case c.Alert.Description.user_canceled:r="User canceled.";break;case c.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(i.description===c.Alert.Description.close_notify)return t.close();t.error(t,{message:r,send:!1,origin:t.entity===c.ConnectionEnd.client?"server":"client",alert:i}),t.process()},c.handleHandshake=function(t,e){var r=e.fragment,i=r.getByte(),o=r.getInt24();if(o>r.length())return t.fragmented=e,e.fragment=n.util.createBuffer(),r.read-=4,t.process();t.fragmented=null,r.read-=4;var a=r.bytes(o+4);r.read+=4,i in F[t.entity][t.expect]?(t.entity!==c.ConnectionEnd.server||t.open||t.fail||(t.handshaking=!0,t.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:n.md.md5.create(),sha1:n.md.sha1.create()}),i!==c.HandshakeType.hello_request&&i!==c.HandshakeType.certificate_verify&&i!==c.HandshakeType.finished&&(t.session.md5.update(a),t.session.sha1.update(a)),F[t.entity][t.expect][i](t,e,o)):c.handleUnexpected(t,e)},c.handleApplicationData=function(t,e){t.data.putBuffer(e.fragment),t.dataReady(t),t.process()},c.handleHeartbeat=function(t,e){var r=e.fragment,i=r.getByte(),o=r.getInt16(),a=r.getBytes(o);if(i===c.HeartbeatMessageType.heartbeat_request){if(t.handshaking||o>a.length)return t.process();c.queue(t,c.createRecord(t,{type:c.ContentType.heartbeat,data:c.createHeartbeat(c.HeartbeatMessageType.heartbeat_response,a)})),c.flush(t)}else if(i===c.HeartbeatMessageType.heartbeat_response){if(a!==t.expectedHeartbeatPayload)return t.process();t.heartbeatReceived&&t.heartbeatReceived(t,n.util.createBuffer(a))}t.process()};var f=1,h=2,p=3,d=4,y=5,g=6,v=7,m=8,b=1,A=2,x=3,w=4,_=5,S=6,E=c.handleUnexpected,C=c.handleChangeCipherSpec,k=c.handleAlert,I=c.handleHandshake,T=c.handleApplicationData,O=c.handleHeartbeat,M=[];M[c.ConnectionEnd.client]=[[E,k,I,E,O],[E,k,I,E,O],[E,k,I,E,O],[E,k,I,E,O],[E,k,I,E,O],[C,k,E,E,O],[E,k,I,E,O],[E,k,I,T,O],[E,k,I,E,O]],M[c.ConnectionEnd.server]=[[E,k,I,E,O],[E,k,I,E,O],[E,k,I,E,O],[E,k,I,E,O],[C,k,E,E,O],[E,k,I,E,O],[E,k,I,T,O],[E,k,I,E,O]];var P=c.handleHelloRequest,L=c.handleServerHello,N=c.handleCertificate,j=c.handleServerKeyExchange,R=c.handleCertificateRequest,D=c.handleServerHelloDone,B=c.handleFinished,F=[];F[c.ConnectionEnd.client]=[[E,E,L,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E],[P,E,E,E,E,E,E,E,E,E,E,N,j,R,D,E,E,E,E,E,E],[P,E,E,E,E,E,E,E,E,E,E,E,j,R,D,E,E,E,E,E,E],[P,E,E,E,E,E,E,E,E,E,E,E,E,R,D,E,E,E,E,E,E],[P,E,E,E,E,E,E,E,E,E,E,E,E,E,D,E,E,E,E,E,E],[P,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E],[P,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,B],[P,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E],[P,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E]];var z=c.handleClientHello,G=c.handleClientKeyExchange,U=c.handleCertificateVerify;F[c.ConnectionEnd.server]=[[E,z,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E],[E,E,E,E,E,E,E,E,E,E,E,N,E,E,E,E,E,E,E,E,E],[E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,G,E,E,E,E],[E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,U,E,E,E,E,E],[E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E],[E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,B],[E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E],[E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E]],c.generateKeys=function(t,e){var r=i,n=e.client_random+e.server_random;t.session.resuming||(e.master_secret=r(e.pre_master_secret,"master secret",n,48).bytes(),e.pre_master_secret=null),n=e.server_random+e.client_random;var o=2*e.mac_key_length+2*e.enc_key_length,a=t.version.major===c.Versions.TLS_1_0.major&&t.version.minor===c.Versions.TLS_1_0.minor;a&&(o+=2*e.fixed_iv_length);var s=r(e.master_secret,"key expansion",n,o),u={client_write_MAC_key:s.getBytes(e.mac_key_length),server_write_MAC_key:s.getBytes(e.mac_key_length),client_write_key:s.getBytes(e.enc_key_length),server_write_key:s.getBytes(e.enc_key_length)};return a&&(u.client_write_IV=s.getBytes(e.fixed_iv_length),u.server_write_IV=s.getBytes(e.fixed_iv_length)),u},c.createConnectionState=function(t){var e=t.entity===c.ConnectionEnd.client,r=function(){var t={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(t){return!0},compressionState:null,compressFunction:function(t){return!0},updateSequenceNumber:function(){4294967295===t.sequenceNumber[1]?(t.sequenceNumber[1]=0,++t.sequenceNumber[0]):++t.sequenceNumber[1]}};return t},n={read:r(),write:r()};if(n.read.update=function(t,e){return n.read.cipherFunction(e,n.read)?n.read.compressFunction(t,e,n.read)||t.error(t,{message:"Could not decompress record.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.decompression_failure}}):t.error(t,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.bad_record_mac}}),!t.fail},n.write.update=function(t,e){return n.write.compressFunction(t,e,n.write)?n.write.cipherFunction(e,n.write)||t.error(t,{message:"Could not encrypt record.",send:!1,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}}):t.error(t,{message:"Could not compress record.",send:!1,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}}),!t.fail},t.session){var i=t.session.sp;switch(t.session.cipherSuite.initSecurityParameters(i),i.keys=c.generateKeys(t,i),n.read.macKey=e?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,n.write.macKey=e?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,t.session.cipherSuite.initConnectionState(n,t,i),i.compression_algorithm){case c.CompressionMethod.none:break;case c.CompressionMethod.deflate:n.read.compressFunction=a,n.write.compressFunction=o;break;default:throw new Error("Unsupported compression algorithm.")}}return n},c.createRandom=function(){var t=new Date,e=+t+6e4*t.getTimezoneOffset(),r=n.util.createBuffer();return r.putInt32(e),r.putBytes(n.random.getBytes(28)),r},c.createRecord=function(t,e){return e.data?{type:e.type,version:{major:t.version.major,minor:t.version.minor},length:e.data.length(),fragment:e.data}:null},c.createAlert=function(t,e){var r=n.util.createBuffer();return r.putByte(e.level),r.putByte(e.description),c.createRecord(t,{type:c.ContentType.alert,data:r})},c.createClientHello=function(t){t.session.clientHelloVersion={major:t.version.major,minor:t.version.minor};for(var e=n.util.createBuffer(),r=0;r0&&(d+=2);var y=t.session.id,g=y.length+1+2+4+28+2+o+1+s+d,v=n.util.createBuffer();return v.putByte(c.HandshakeType.client_hello),v.putInt24(g),v.putByte(t.version.major),v.putByte(t.version.minor),v.putBytes(t.session.sp.client_random),l(v,1,n.util.createBuffer(y)),l(v,2,e),l(v,1,a),d>0&&l(v,2,u),v},c.createServerHello=function(t){var e=t.session.id,r=e.length+1+2+4+28+2+1,i=n.util.createBuffer();return i.putByte(c.HandshakeType.server_hello),i.putInt24(r),i.putByte(t.version.major),i.putByte(t.version.minor),i.putBytes(t.session.sp.server_random),l(i,1,n.util.createBuffer(e)),i.putByte(t.session.cipherSuite.id[0]),i.putByte(t.session.cipherSuite.id[1]),i.putByte(t.session.compressionMethod),i},c.createCertificate=function(t){var e,r=t.entity===c.ConnectionEnd.client,i=null;t.getCertificate&&(e=r?t.session.certificateRequest:t.session.extensions.server_name.serverNameList,i=t.getCertificate(t,e));var o=n.util.createBuffer();if(null!==i)try{n.util.isArray(i)||(i=[i]);for(var a=null,s=0;sc.MaxFragment;)i.push(c.createRecord(t,{type:e.type,data:n.util.createBuffer(o.slice(0,c.MaxFragment))})),o=o.slice(c.MaxFragment);o.length>0&&i.push(c.createRecord(t,{type:e.type,data:n.util.createBuffer(o)}))}for(var a=0;a0&&(i=r.order[0]),null!==i&&i in r.cache)for(var o in e=r.cache[i],delete r.cache[i],r.order)if(r.order[o]===i){r.order.splice(o,1);break}return e},r.setSession=function(t,e){if(r.order.length===r.capacity){var i=r.order.shift();delete r.cache[i]}i=n.util.bytesToHex(t),r.order.push(i),r.cache[i]=e}}return r},c.createConnection=function(t){var e;e=t.caStore?n.util.isArray(t.caStore)?n.pki.createCaStore(t.caStore):t.caStore:n.pki.createCaStore();var r=t.cipherSuites||null;if(null===r)for(var i in r=[],c.CipherSuites)r.push(c.CipherSuites[i]);var o=t.server?c.ConnectionEnd.server:c.ConnectionEnd.client,a=t.sessionCache?c.createSessionCache(t.sessionCache):null,s={version:{major:c.Version.major,minor:c.Version.minor},entity:o,sessionId:t.sessionId,caStore:e,sessionCache:a,cipherSuites:r,connected:t.connected,virtualHost:t.virtualHost||null,verifyClient:t.verifyClient||!1,verify:t.verify||function(t,e,r,n){return e},verifyOptions:t.verifyOptions||{},getCertificate:t.getCertificate||null,getPrivateKey:t.getPrivateKey||null,getSignature:t.getSignature||null,input:n.util.createBuffer(),tlsData:n.util.createBuffer(),data:n.util.createBuffer(),tlsDataReady:t.tlsDataReady,dataReady:t.dataReady,heartbeatReceived:t.heartbeatReceived,closed:t.closed,error:function(e,r){r.origin=r.origin||(e.entity===c.ConnectionEnd.client?"client":"server"),r.send&&(c.queue(e,c.createAlert(e,r.alert)),c.flush(e));var n=!1!==r.fatal;n&&(e.fail=!0),t.error(e,r),n&&e.close(!1)},deflate:t.deflate||null,inflate:t.inflate||null,reset:function(t){s.version={major:c.Version.major,minor:c.Version.minor},s.record=null,s.session=null,s.peerCertificate=null,s.state={pending:null,current:null},s.expect=(s.entity,c.ConnectionEnd.client,0),s.fragmented=null,s.records=[],s.open=!1,s.handshakes=0,s.handshaking=!1,s.isConnected=!1,s.fail=!(t||void 0===t),s.input.clear(),s.tlsData.clear(),s.data.clear(),s.state.current=c.createConnectionState(s)}};return s.reset(),s.handshake=function(t){if(s.entity!==c.ConnectionEnd.client)s.error(s,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(s.handshaking)s.error(s,{message:"Handshake already in progress.",fatal:!1});else{s.fail&&!s.open&&0===s.handshakes&&(s.fail=!1),s.handshaking=!0;var e=null;(t=t||"").length>0&&(s.sessionCache&&(e=s.sessionCache.getSession(t)),null===e&&(t="")),0===t.length&&s.sessionCache&&null!==(e=s.sessionCache.getSession())&&(t=e.id),s.session={id:t,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:n.md.md5.create(),sha1:n.md.sha1.create()},e&&(s.version=e.version,s.session.sp=e.sp),s.session.sp.client_random=c.createRandom().getBytes(),s.open=!0,c.queue(s,c.createRecord(s,{type:c.ContentType.handshake,data:c.createClientHello(s)})),c.flush(s)}},s.process=function(t){var e=0;return t&&s.input.putBytes(t),s.fail||(null!==s.record&&s.record.ready&&s.record.fragment.isEmpty()&&(s.record=null),null===s.record&&(e=function(t){var e=0,r=t.input,i=r.length();if(i<5)e=5-i;else{t.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:n.util.createBuffer(),ready:!1};var o=t.record.version.major===t.version.major;o&&t.session&&t.session.version&&(o=t.record.version.minor===t.version.minor),o||t.error(t,{message:"Incompatible TLS version.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.protocol_version}})}return e}(s)),s.fail||null===s.record||s.record.ready||(e=function(t){var e=0,r=t.input,n=r.length();return n=0;u--)T>>=8,T+=E.at(u)+I.at(u),I.setAt(u,255&T);k.putBuffer(I)}A=k,f.putBuffer(_)}return f.truncate(f.length()-o),f},a.pbe.getCipher=function(t,e,r){switch(t){case a.oids.pkcs5PBES2:return a.pbe.getCipherForPBES2(t,e,r);case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case a.oids["pbewithSHAAnd40BitRC2-CBC"]:return a.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},a.pbe.getCipherForPBES2=function(t,e,r){var i,s={},u=[];if(!o.validate(e,l,s,u))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=u,i;if((t=o.derToOid(s.kdfOid))!==a.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=t,i.supportedOids=["pkcs5PBKDF2"],i;if((t=o.derToOid(s.encOid))!==a.oids["aes128-CBC"]&&t!==a.oids["aes192-CBC"]&&t!==a.oids["aes256-CBC"]&&t!==a.oids["des-EDE3-CBC"]&&t!==a.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=t,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var c,f,p=s.kdfSalt,d=n.util.createBuffer(s.kdfIterationCount);switch(d=d.getInt(d.length()<<3),a.oids[t]){case"aes128-CBC":c=16,f=n.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,f=n.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,f=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,f=n.des.createDecryptionCipher;break;case"desCBC":c=8,f=n.des.createDecryptionCipher}var y=h(s.prfOid),g=n.pkcs5.pbkdf2(r,p,d,c,y),v=s.encIv,m=f(g);return m.start(v),m},a.pbe.getCipherForPKCS12PBE=function(t,e,r){var i={},s=[];if(!o.validate(e,c,i,s))throw(y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,y;var u,l,f,p=n.util.createBuffer(i.salt),d=n.util.createBuffer(i.iterations);switch(d=d.getInt(d.length()<<3),t){case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,l=8,f=n.des.startDecrypting;break;case a.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,l=8,f=function(t,e){var r=n.rc2.createDecryptionCipher(t,40);return r.start(e,null),r};break;default:var y;throw(y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=t,y}var g=h(i.prfOid),v=a.pbe.generatePkcs12Key(r,p,1,d,u,g);return g.start(),f(v,a.pbe.generatePkcs12Key(r,p,2,d,l,g))},a.pbe.opensslDeriveBytes=function(t,e,r,i){if(null==i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===e&&(e="");for(var o=[f(i,t+e)],a=16,s=1;a>>0,s>>>0];for(var l=i.fullMessageLength.length-1;l>=0;--l)i.fullMessageLength[l]+=s[1],s[1]=s[0]+(i.fullMessageLength[l]/4294967296>>>0),i.fullMessageLength[l]=i.fullMessageLength[l]>>>0,s[0]=s[1]/4294967296>>>0;return e.putBytes(o),u(t,r,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(e.bytes());var s,l=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(o.substr(0,i.blockLength-l));for(var c=8*i.fullMessageLength[0],f=0;f>>0,a.putInt32(c>>>0),c=s>>>0;a.putInt32(c);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};u(h,r,a);var p=n.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p.putInt32(h.h5),p.putInt32(h.h6),p.putInt32(h.h7),p},i};var o=null,a=!1,s=null;function u(t,e,r){for(var n,i,o,a,u,l,c,f,h,p,d,y,g,v=r.length();v>=64;){for(u=0;u<16;++u)e[u]=r.getInt32();for(;u<64;++u)n=((n=e[u-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=e[u-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[u]=n+e[u-7]+i+e[u-16]|0;for(l=t.h0,c=t.h1,f=t.h2,h=t.h3,p=t.h4,d=t.h5,y=t.h6,g=t.h7,u=0;u<64;++u)o=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),a=l&c|f&(l^c),n=g+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(y^p&(d^y))+s[u]+e[u],g=y,y=d,d=p,p=h+n>>>0,h=f,f=c,c=l,l=n+(i=o+a)>>>0;t.h0=t.h0+l|0,t.h1=t.h1+c|0,t.h2=t.h2+f|0,t.h3=t.h3+h|0,t.h4=t.h4+p|0,t.h5=t.h5+d|0,t.h6=t.h6+y|0,t.h7=t.h7+g|0,v-=64}}},function(t,e,r){var n=r(0);r(1);var i=null;!n.util.isNodejs||n.options.usePureJavaScript||process.versions["node-webkit"]||(i=r(16)),(t.exports=n.prng=n.prng||{}).create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,o=new Array(32),a=0;a<32;++a)o[a]=r.create();function s(){if(e.pools[0].messageLength>=32)return u();var t=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(t)),u()}function u(){e.reseeds=4294967295===e.reseeds?0:e.reseeds+1;var t=e.plugin.md.create();t.update(e.keyBytes);for(var r=1,n=0;n<32;++n)e.reseeds%r==0&&(t.update(e.pools[n].digest().getBytes()),e.pools[n].start()),r<<=1;e.keyBytes=t.digest().getBytes(),t.start(),t.update(e.keyBytes);var i=t.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(i),e.generated=0}function l(t){var e=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(e=function(t){return i.getRandomValues(t)});var o=n.util.createBuffer();if(e)for(;o.length()>16)))<<16,h=4294967295&(c=(2147483647&(c+=l>>15))+(c>>31)),u=0;u<3;++u)f=h>>>(u<<3),f^=Math.floor(256*Math.random()),o.putByte(255&f);return o.getBytes(t)}return e.pools=o,e.pool=0,e.generate=function(t,r){if(!r)return e.generateSync(t);var i=e.plugin.cipher,o=e.plugin.increment,a=e.plugin.formatKey,s=e.plugin.formatSeed,l=n.util.createBuffer();e.key=null,function c(f){if(f)return r(f);if(l.length()>=t)return r(null,l.getBytes(t));if(e.generated>1048575&&(e.key=null),null===e.key)return n.util.nextTick(function(){!function(t){if(e.pools[0].messageLength>=32)return u(),t();var r=32-e.pools[0].messageLength<<5;e.seedFile(r,function(r,n){if(r)return t(r);e.collect(n),u(),t()})}(c)});var h=i(e.key,e.seed);e.generated+=h.length,l.putBytes(h),e.key=a(i(e.key,o(e.seed))),e.seed=s(i(e.key,e.seed)),n.util.setImmediate(c)}()},e.generateSync=function(t){var r=e.plugin.cipher,i=e.plugin.increment,o=e.plugin.formatKey,a=e.plugin.formatSeed;e.key=null;for(var u=n.util.createBuffer();u.length()1048575&&(e.key=null),null===e.key&&s();var l=r(e.key,e.seed);e.generated+=l.length,u.putBytes(l),e.key=o(r(e.key,i(e.seed))),e.seed=a(r(e.key,e.seed))}return u.getBytes(t)},i?(e.seedFile=function(t,e){i.randomBytes(t,function(t,r){if(t)return e(t);e(null,r.toString())})},e.seedFileSync=function(t){return i.randomBytes(t).toString()}):(e.seedFile=function(t,e){try{e(null,l(t))}catch(t){e(t)}},e.seedFileSync=l),e.collect=function(t){for(var r=t.length,n=0;n>i&255);e.collect(n)},e.registerWorker=function(t){t===self?e.seedFile=function(t,e){self.addEventListener("message",function t(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",t),e(n.forge.prng.err,n.forge.prng.bytes))}),self.postMessage({forge:{prng:{needed:t}}})}:t.addEventListener("message",function(r){var n=r.data;n.forge&&n.forge.prng&&e.seedFile(n.forge.prng.needed,function(e,r){t.postMessage({forge:{prng:{err:e,bytes:r}}})})})},e}},function(t,e,r){var n=r(0);r(1);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],o=[1,2,3,5],a=function(t,e){return t<>16-e},s=function(t,e){return(65535&t)>>e|t<<16-e&65535};t.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(t,e){"string"==typeof t&&(t=n.util.createBuffer(t)),e=e||128;var r,o=t,a=t.length(),s=e,u=Math.ceil(s/8),l=255>>(7&s);for(r=a;r<128;r++)o.putByte(i[o.at(r-1)+o.at(r-a)&255]);for(o.setAt(128-u,i[o.at(128-u)&l]),r=127-u;r>=0;r--)o.setAt(r,i[o.at(r+1)^o.at(r+u)]);return o};var u=function(t,e,r){var i,u,l,c,f=!1,h=null,p=null,d=null,y=[];for(t=n.rc2.expandKey(t,e),l=0;l<64;l++)y.push(t.getInt16Le());r?(i=function(t){for(l=0;l<4;l++)t[l]+=y[c]+(t[(l+3)%4]&t[(l+2)%4])+(~t[(l+3)%4]&t[(l+1)%4]),t[l]=a(t[l],o[l]),c++},u=function(t){for(l=0;l<4;l++)t[l]+=y[63&t[(l+3)%4]]}):(i=function(t){for(l=3;l>=0;l--)t[l]=s(t[l],o[l]),t[l]-=y[c]+(t[(l+3)%4]&t[(l+2)%4])+(~t[(l+3)%4]&t[(l+1)%4]),c--},u=function(t){for(l=3;l>=0;l--)t[l]-=y[63&t[(l+3)%4]]});var g=function(t){var e=[];for(l=0;l<4;l++){var n=h.getInt16Le();null!==d&&(r?n^=d.getInt16Le():d.putInt16Le(n)),e.push(65535&n)}c=r?0:63;for(var i=0;i=8;)g([[5,i],[1,u],[6,i],[1,u],[5,i]])},finish:function(t){var e=!0;if(r)if(t)e=t(8,h,!r);else{var n=8===h.length()?8:8-h.length();h.fillWithByte(n,n)}if(e&&(f=!0,v.update()),!r&&(e=0===h.length()))if(t)e=t(8,p,!r);else{var i=p.length(),o=p.at(i-1);o>i?e=!1:p.truncate(o)}return e}}};n.rc2.startEncrypting=function(t,e,r){var i=n.rc2.createEncryptionCipher(t,128);return i.start(e,r),i},n.rc2.createEncryptionCipher=function(t,e){return u(t,e,!0)},n.rc2.startDecrypting=function(t,e,r){var i=n.rc2.createDecryptionCipher(t,128);return i.start(e,r),i},n.rc2.createDecryptionCipher=function(t,e){return u(t,e,!1)}},function(t,e,r){var n=r(0);r(1),r(2),r(9);var i=t.exports=n.pkcs1=n.pkcs1||{};function o(t,e,r){r||(r=n.md.sha1.create());for(var i="",o=Math.ceil(e/r.digestLength),a=0;a>24&255,a>>16&255,a>>8&255,255&a);r.start(),r.update(t+s),i+=r.digest().getBytes()}return i.substring(0,e)}i.encode_rsa_oaep=function(t,e,r){var i,a,s,u;"string"==typeof r?(i=r,a=arguments[3]||void 0,s=arguments[4]||void 0):r&&(i=r.label||void 0,a=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),s?s.start():s=n.md.sha1.create(),u||(u=s);var l=Math.ceil(t.n.bitLength()/8),c=l-2*s.digestLength-2;if(e.length>c)throw(y=new Error("RSAES-OAEP input message length is too long.")).length=e.length,y.maxLength=c,y;i||(i=""),s.update(i,"raw");for(var f=s.digest(),h="",p=c-e.length,d=0;dt&&(a=u(t,e));var p=a.toString(16);i.target.postMessage({hex:p,workLoad:c}),a.dAddOffset(f,0)}}}p()}(t,e,i,o):s(t,e,i,o)}(t,l,o.options,i);throw new Error("Invalid prime generation algorithm: "+o.name)}}function s(t,e,r,o){var a=u(t,e),s=function(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}(a.bitLength());"millerRabinTests"in r&&(s=r.millerRabinTests);var l=10;"maxBlockTime"in r&&(l=r.maxBlockTime),function t(e,r,o,a,s,l,c){var f=+new Date;do{if(e.bitLength()>r&&(e=u(r,o)),e.isProbablePrime(s))return c(null,e);e.dAddOffset(i[a++%8],0)}while(l<0||+new Date-f=0&&i.push(s):i.push(s))}return i}function p(t){if(t.composed||t.constructed){for(var e=n.util.createBuffer(),r=0;r0&&(u=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,f));var h=[],p=[];null!==e&&(p=n.util.isArray(e)?e:[e]);for(var d=[],y=0;y0){var b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,d),A=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(b).getBytes())])]);h.push(A)}var x=null;if(null!==t){var w=o.wrapRsaPrivateKey(o.privateKeyToAsn1(t));x=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[w]),u]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[o.encryptPrivateKeyInfo(w,r,s)]),u]);var _=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[x]),S=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(_).getBytes())])]);h.push(S)}var E,C=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,h);if(s.useMac){var k=n.md.sha1.create(),I=new n.util.ByteBuffer(n.random.getBytes(s.saltSize)),T=s.count,O=(t=a.generateKey(r,I,3,T,20),n.hmac.create());O.start(k,t),O.update(i.toDer(C).getBytes());var M=O.getMac();E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,M.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,I.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(T).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(C).getBytes())])]),E])},a.generateKey=n.pbe.generatePkcs12Key},function(t,e,r){var n=r(0);r(3),r(1);var i=n.asn1,o=t.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=o;var a={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};o.contentInfoValidator=a;var s={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};o.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(s)},o.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(s)};var u={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};o.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},a,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[u]}]},o.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},function(t,e,r){var n=r(0);r(1),n.mgf=n.mgf||{},(t.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(t){return{generate:function(e,r){for(var i=new n.util.ByteBuffer,o=Math.ceil(r/t.digestLength),a=0;a>>0,a>>>0];for(var s=p.fullMessageLength.length-1;s>=0;--s)p.fullMessageLength[s]+=a[1],a[1]=a[0]+(p.fullMessageLength[s]/4294967296>>>0),p.fullMessageLength[s]=p.fullMessageLength[s]>>>0,a[0]=a[1]/4294967296>>>0;return i.putBytes(t),c(r,o,i),(i.read>2048||0===i.length())&&i.compact(),p},p.digest=function(){var e=n.util.createBuffer();e.putBytes(i.bytes());var s,u=p.fullMessageLength[p.fullMessageLength.length-1]+p.messageLengthSize&p.blockLength-1;e.putBytes(a.substr(0,p.blockLength-u));for(var l=8*p.fullMessageLength[0],f=0;f>>0,e.putInt32(l>>>0),l=s>>>0;e.putInt32(l);var h=new Array(r.length);for(f=0;f=128;){for(O=0;O<16;++O)e[O][0]=r.getInt32()>>>0,e[O][1]=r.getInt32()>>>0;for(;O<80;++O)n=(((M=(L=e[O-2])[0])>>>19|(P=L[1])<<13)^(P>>>29|M<<3)^M>>>6)>>>0,i=((M<<13|P>>>19)^(P<<3|M>>>29)^(M<<26|P>>>6))>>>0,o=(((M=(j=e[O-15])[0])>>>1|(P=j[1])<<31)^(M>>>8|P<<24)^M>>>7)>>>0,a=((M<<31|P>>>1)^(M<<24|P>>>8)^(M<<25|P>>>7))>>>0,N=e[O-7],R=e[O-16],P=i+N[1]+a+R[1],e[O][0]=n+N[0]+o+R[0]+(P/4294967296>>>0)>>>0,e[O][1]=P>>>0;for(d=t[0][0],y=t[0][1],g=t[1][0],v=t[1][1],m=t[2][0],b=t[2][1],A=t[3][0],x=t[3][1],w=t[4][0],_=t[4][1],S=t[5][0],E=t[5][1],C=t[6][0],k=t[6][1],I=t[7][0],T=t[7][1],O=0;O<80;++O)c=((w>>>14|_<<18)^(w>>>18|_<<14)^(_>>>9|w<<23))>>>0,f=(C^w&(S^C))>>>0,s=((d>>>28|y<<4)^(y>>>2|d<<30)^(y>>>7|d<<25))>>>0,l=((d<<4|y>>>28)^(y<<30|d>>>2)^(y<<25|d>>>7))>>>0,h=(d&g|m&(d^g))>>>0,p=(y&v|b&(y^v))>>>0,P=T+(((w<<18|_>>>14)^(w<<14|_>>>18)^(_<<23|w>>>9))>>>0)+((k^_&(E^k))>>>0)+u[O][1]+e[O][1],n=I+c+f+u[O][0]+e[O][0]+(P/4294967296>>>0)>>>0,i=P>>>0,o=s+h+((P=l+p)/4294967296>>>0)>>>0,a=P>>>0,I=C,T=k,C=S,k=E,S=w,E=_,w=A+n+((P=x+i)/4294967296>>>0)>>>0,_=P>>>0,A=m,x=b,m=g,b=v,g=d,v=y,d=n+o+((P=i+a)/4294967296>>>0)>>>0,y=P>>>0;P=t[0][1]+y,t[0][0]=t[0][0]+d+(P/4294967296>>>0)>>>0,t[0][1]=P>>>0,P=t[1][1]+v,t[1][0]=t[1][0]+g+(P/4294967296>>>0)>>>0,t[1][1]=P>>>0,P=t[2][1]+b,t[2][0]=t[2][0]+m+(P/4294967296>>>0)>>>0,t[2][1]=P>>>0,P=t[3][1]+x,t[3][0]=t[3][0]+A+(P/4294967296>>>0)>>>0,t[3][1]=P>>>0,P=t[4][1]+_,t[4][0]=t[4][0]+w+(P/4294967296>>>0)>>>0,t[4][1]=P>>>0,P=t[5][1]+E,t[5][0]=t[5][0]+S+(P/4294967296>>>0)>>>0,t[5][1]=P>>>0,P=t[6][1]+k,t[6][0]=t[6][0]+C+(P/4294967296>>>0)>>>0,t[6][1]=P>>>0,P=t[7][1]+T,t[7][0]=t[7][0]+I+(P/4294967296>>>0)>>>0,t[7][1]=P>>>0,D-=128}}},function(t,e,r){t.exports=r(33)},function(t,e,r){t.exports=r(0),r(5),r(36),r(3),r(13),r(10),r(38),r(8),r(40),r(41),r(42),r(30),r(15),r(7),r(26),r(28),r(43),r(21),r(27),r(24),r(18),r(2),r(25),r(44),r(20),r(1)},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==("undefined"==typeof window?"undefined":s(window))&&(r=window)}t.exports=r},function(t,e){var r={};t.exports=r;var n={};r.encode=function(t,e,r){if("string"!=typeof e)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(t instanceof Uint8Array){var i=0,o=e.length,a=e.charAt(0),s=[0];for(i=0;i0;)s.push(l%o),l=l/o|0}for(i=0;0===t[i]&&i=0;--i)n+=e[s[i]]}else n=function(t,e){var r=0,n=e.length,i=e.charAt(0),o=[0];for(r=0;r0;)o.push(s%n),s=s/n|0}var u="";for(r=0;0===t.at(r)&&r=0;--r)u+=e[o[r]];return u}(t,e);if(r){var c=new RegExp(".{1,"+r+"}","g");n=n.match(c).join("\r\n")}return n},r.decode=function(t,e){if("string"!=typeof t)throw new TypeError('"input" must be a string.');if("string"!=typeof e)throw new TypeError('"alphabet" must be a string.');var r=n[e];if(!r){r=n[e]=[];for(var i=0;i>=8;for(;c>0;)s.push(255&c),c>>=8}for(var f=0;t[f]===a&&f=i.Versions.TLS_1_1.minor&&u.output.putBytes(r),u.update(t.fragment),u.finish(s)&&(t.fragment=u.output,t.length=t.fragment.length(),o=!0),o}function s(t,e,r){if(!r){var n=t-e.length()%t;e.fillWithByte(n-1,n)}return!0}function u(t,e,r){var n=!0;if(r){for(var i=e.length(),o=e.last(),a=i-1-o;a=s?(t.fragment=a.output.getBytes(c-s),l=a.output.getBytes(s)):t.fragment=a.output.getBytes(),t.fragment=n.util.createBuffer(t.fragment),t.length=t.fragment.length();var f=e.macFunction(e.macKey,e.sequenceNumber,t);return e.updateSequenceNumber(),function(t,e,r){var i=n.hmac.create();return i.start("SHA1",t),i.update(e),e=i.digest().getBytes(),i.start(null,null),i.update(r),e===(r=i.digest().getBytes())}(e.macKey,l,f)&&o}i.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(t){t.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,t.cipher_type=i.CipherType.block,t.enc_key_length=16,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=i.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},initConnectionState:o},i.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(t){t.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,t.cipher_type=i.CipherType.block,t.enc_key_length=32,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=i.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},initConnectionState:o}},function(t,e,r){var n=r(0);r(30),t.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},function(t,e,r){var n=r(0);r(12),r(2),r(31),r(1);var i=r(39),o=i.publicKeyValidator,a=i.privateKeyValidator;if(void 0===s)var s=n.jsbn.BigInteger;var u=n.util.ByteBuffer,l="undefined"==typeof Buffer?Uint8Array:Buffer;n.pki=n.pki||{},t.exports=n.pki.ed25519=n.ed25519=n.ed25519||{};var c=n.ed25519;function f(t){var e=t.message;if(e instanceof Uint8Array||e instanceof l)return e;var r=t.encoding;if(void 0===e){if(!t.md)throw new TypeError('"options.message" or "options.md" not specified.');e=t.md.digest().getBytes(),r="binary"}if("string"==typeof e&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof e){if("undefined"!=typeof Buffer)return Buffer.from(e,r);e=new u(e,r)}else if(!(e instanceof u))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new l(e.length()),i=0;i=0;--r)B(n,n),1!==r&&F(n,n,e);for(r=0;r<16;++r)t[r]=n[r]}(r,r),F(r,r,i),F(r,r,o),F(r,r,o),F(t[0],r,o),B(n,t[0]),F(n,n,o),k(n,i)&&F(t[0],t[0],b),B(n,t[0]),F(n,n,o),k(n,i)?-1:(T(t[0])===e[31]>>7&&D(t[0],h,t[0]),F(t[3],t[0],t[1]),0)}(s,n))return-1;for(i=0;i=0};var h=j(),p=j([1]),d=j([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=j([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),g=j([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),v=j([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),m=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),b=j([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function A(t,e){var r=n.md.sha512.create(),i=new u(t);r.update(i.getBytes(e),"binary");var o=r.digest().getBytes();if("undefined"!=typeof Buffer)return Buffer.from(o,"binary");for(var a=new l(c.constants.HASH_BYTE_LENGTH),s=0;s<64;++s)a[s]=o.charCodeAt(s);return a}function x(t,e){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i>8,e[i]-=256*r;e[i]+=r,e[n]=0}for(r=0,i=0;i<32;++i)e[i]+=r-(e[31]>>4)*m[i],r=e[i]>>8,e[i]&=255;for(i=0;i<32;++i)e[i]-=r*m[i];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,t[n]=255&e[n]}function w(t){for(var e=new Float64Array(64),r=0;r<64;++r)e[r]=t[r],t[r]=0;x(t,e)}function _(t,e){var r=j(),n=j(),i=j(),o=j(),a=j(),s=j(),u=j(),l=j(),c=j();D(r,t[1],t[0]),D(c,e[1],e[0]),F(r,r,c),R(n,t[0],t[1]),R(c,e[0],e[1]),F(n,n,c),F(i,t[3],e[3]),F(i,i,y),F(o,t[2],e[2]),R(o,o,o),D(a,n,r),D(s,o,i),R(u,o,i),R(l,n,r),F(t[0],a,s),F(t[1],l,u),F(t[2],u,s),F(t[3],a,l)}function S(t,e,r){for(var n=0;n<4;++n)N(t[n],e[n],r)}function E(t,e){var r=j(),n=j(),i=j();!function(t,e){var r,n=j();for(r=0;r<16;++r)n[r]=e[r];for(r=253;r>=0;--r)B(n,n),2!==r&&4!==r&&F(n,n,e);for(r=0;r<16;++r)t[r]=n[r]}(i,e[2]),F(r,e[0],i),F(n,e[1],i),C(t,n),t[31]^=T(r)<<7}function C(t,e){var r,n,i,o=j(),a=j();for(r=0;r<16;++r)a[r]=e[r];for(L(a),L(a),L(a),n=0;n<2;++n){for(o[0]=a[0]-65517,r=1;r<15;++r)o[r]=a[r]-65535-(o[r-1]>>16&1),o[r-1]&=65535;o[15]=a[15]-32767-(o[14]>>16&1),i=o[15]>>16&1,o[14]&=65535,N(a,o,1-i)}for(r=0;r<16;r++)t[2*r]=255&a[r],t[2*r+1]=a[r]>>8}function k(t,e){var r=new l(32),n=new l(32);return C(r,t),C(n,e),I(r,0,n,0)}function I(t,e,r,n){return function(t,e,r,n,i){var o,a=0;for(o=0;o<32;++o)a|=t[e+o]^r[n+o];return(1&a-1>>>8)-1}(t,e,r,n)}function T(t){var e=new l(32);return C(e,t),1&e[0]}function O(t,e,r){var n,i;for(P(t[0],h),P(t[1],p),P(t[2],p),P(t[3],h),i=255;i>=0;--i)S(t,e,n=r[i/8|0]>>(7&i)&1),_(e,t),_(t,t),S(t,e,n)}function M(t,e){var r=[j(),j(),j(),j()];P(r[0],g),P(r[1],v),P(r[2],p),F(r[3],g,v),O(t,r,e)}function P(t,e){var r;for(r=0;r<16;r++)t[r]=0|e[r]}function L(t){var e,r,n=1;for(e=0;e<16;++e)r=t[e]+n+65535,n=Math.floor(r/65536),t[e]=r-65536*n;t[0]+=n-1+37*(n-1)}function N(t,e,r){for(var n,i=~(r-1),o=0;o<16;++o)n=i&(t[o]^e[o]),t[o]^=n,e[o]^=n}function j(t){var e,r=new Float64Array(16);if(t)for(e=0;e0&&(a=n.util.fillString(String.fromCharCode(0),u)+a),{encapsulation:e.encrypt(a,"NONE"),key:t.generate(a,o)}},decrypt:function(e,r,n){var i=e.decrypt(r,"NONE");return t.generate(i,n)}}},n.kem.kdf1=function(t,e){o(this,t,0,e||t.digestLength)},n.kem.kdf2=function(t,e){o(this,t,1,e||t.digestLength)}},function(t,e,r){var n=r(0);r(1),t.exports=n.log=n.log||{},n.log.levels=["none","error","warning","info","debug","verbose","max"];var i={},o=[],a=null;n.log.LEVEL_LOCKED=2,n.log.NO_LEVEL_CHECK=4,n.log.INTERPOLATE=8;for(var s=0;s0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),o=0;o=r&&a0&&a.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,e)),o.length>0&&a.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,o)),a.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,t.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.type).getBytes()),a])},addSigner:function(e){var r=e.issuer,i=e.serialNumber;if(e.certificate){var o=e.certificate;"string"==typeof o&&(o=n.pki.certificateFromPem(o)),r=o.issuer.attributes,i=o.serialNumber}var a=e.key;if(!a)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof a&&(a=n.pki.privateKeyFromPem(a));var s=e.digestAlgorithm||n.pki.oids.sha1;switch(s){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+s)}var u=e.authenticatedAttributes||[];if(u.length>0){for(var l=!1,c=!1,f=0;f="8"&&(r="00"+r);var i=n.util.hexToBytes(r);t.putInt32(i.length),t.putBytes(i)}function a(t,e){t.putInt32(e.length),t.putString(e)}function s(){for(var t=n.md.sha1.create(),e=arguments.length,r=0;re?1:0}return function(r,n,i,o,a){!function e(r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),f=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1),h=Math.max(i,Math.floor(n-u*c/s+f)),p=Math.min(o,Math.floor(n+(s-u)*c/s+f));e(r,n,h,p,a)}var d=r[n],y=i,g=o;for(t(r,i,n),a(r[o],d)>0&&t(r,i,o);y0;)g--}0===a(r[i],d)?t(r,i,g):t(r,++g,o),g<=n&&(i=g+1),n<=g&&(o=g-1)}}(r,n,i||0,o||r.length-1,a||e)}},"object"===a(e)?t.exports=o():void 0===(i="function"==typeof(n=o)?n.call(e,r,e,t):n)||(t.exports=i)},833:function(t,e,r){"use strict";t.exports=i,t.exports.default=i;var n=r(1089);function i(t,e){if(!(this instanceof i))return new i(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function o(t,e,r){if(!r)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,e,r,i,o){for(var a,s=[e,r];s.length;)(r=s.pop())-(e=s.pop())<=i||(a=e+Math.ceil((r-e)/i/2)*i,n(t,a,e,r,o),s.push(e,a,a,r))}i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,r=[],n=this.toBBox;if(!d(t,e))return r;for(var i,o,a,s,u=[];e;){for(i=0,o=e.children.length;i=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var o=this._chooseSplitIndex(r,i,n),s=y(r.children.splice(o,r.children.length-o));s.height=r.height,s.leaf=r.leaf,a(r,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(r,s)},_splitRoot:function(t,e){this.data=y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,r){var n,i,o,a,u,l,c,h,p,d,y,g,v,m;for(l=c=1/0,n=e;n<=r-e;n++)i=s(t,0,n,this.toBBox),o=s(t,n,r,this.toBBox),p=i,d=o,void 0,void 0,void 0,void 0,y=Math.max(p.minX,d.minX),g=Math.max(p.minY,d.minY),v=Math.min(p.maxX,d.maxX),m=Math.min(p.maxY,d.maxY),a=Math.max(0,v-y)*Math.max(0,m-g),u=f(i)+f(o),a=e;i--)o=t.children[i],u(c,t.leaf?a(o):o),f+=h(c);return f},_adjustParentBBoxes:function(t,e,r){for(var n=r;n>=0;n--)u(e[n],t)},_condense:function(t){for(var e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children).splice(e.indexOf(t[r]),1):this.clear():a(t[r],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},7058:function(t,e,r){var n,i,o;function a(t){"@babel/helpers - typeof";return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}o=function(){"use strict";var t=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray},e=function(t,e){for(var r=Object.keys(e),n=0;n=0&&(0|t)===t||n("invalid parameter type, ("+t+")"+o(e)+". must be a nonnegative integer")},oneOf:u,shaderError:function(t,e,n,o,a){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var s=t.getShaderInfoLog(e),u=o===t.FRAGMENT_SHADER?"fragment":"vertex";b(n,"string",u+" shader source must be a string",a);var l=g(n,a),f=function(t){var e=[];return t.split("\n").forEach(function(t){if(!(t.length<5)){var r=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(t);r?e.push(new p(0|r[1],0|r[2],r[3].trim())):t.length>0&&e.push(new p("unknown",0,t))}}),e}(s);!function(t,e){e.forEach(function(e){var r=t[e.file];if(r){var n=r.index[e.line];if(n)return n.errors.push(e),void(r.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)})}(l,f),Object.keys(l).forEach(function(t){var e=l[t];if(e.hasErrors){var n=[""],i=[""];o("file number "+t+": "+e.name+"\n","color:red;text-decoration:underline;font-weight:bold"),e.lines.forEach(function(t){if(t.errors.length>0){o(c(t.number,4)+"| ","background-color:yellow; font-weight:bold"),o(t.line+r,"color:red; background-color:yellow; font-weight:bold");var e=0;t.errors.forEach(function(n){var i=n.message,a=/^\s*'(.*)'\s*:\s*(.*)$/.exec(i);if(a){var s=a[1];switch(i=a[2],s){case"assign":s="="}e=Math.max(t.line.indexOf(s,e),0)}else e=0;o(c("| ",6)),o(c("^^^",e+3)+r,"font-weight:bold"),o(c("| ",6)),o(i+r,"font-weight:bold")}),o(c("| ",6)+r)}else o(c(t.number,4)+"| "),o(t.line+r,"color:red")}),"undefined"==typeof document||window.chrome?console.log(n.join("")):(i[0]=n.join("%c"),console.log.apply(console,i))}function o(t,e){n.push(t),i.push(e||"")}}),i.raise("Error compiling "+u+" shader, "+l[0].name)}},linkError:function(t,e,n,o,a){if(!t.getProgramParameter(e,t.LINK_STATUS)){var s=t.getProgramInfoLog(e),u=g(n,a),l='Error linking program with vertex shader, "'+g(o,a)[0].name+'", and fragment shader "'+u[0].name+'"';"undefined"!=typeof document?console.log("%c"+l+r+"%c"+s,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(l+r+s),i.raise(l)}},callSite:y,saveCommandRef:v,saveDrawInfo:function(t,e,r,n){function i(t){return t?n.id(t):0}function o(t,e){Object.keys(e).forEach(function(e){t[n.id(e)]=!0})}v(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var a=t._uniformSet={};o(a,e.static),o(a,e.dynamic);var s=t._attributeSet={};o(s,r.static),o(s,r.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic},framebufferFormat:function(t,e,r){t.texture?u(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):u(t.renderbuffer._renderbuffer.format,r,"unsupported renderbuffer format for attachment")},guessCommand:d,texture2D:function(t,e,r){var n,o=e.width,a=e.height,s=e.channels;i(o>0&&o<=r.maxTextureSize&&a>0&&a<=r.maxTextureSize,"invalid texture shape"),t.wrapS===A&&t.wrapT===A||i(L(o)&&L(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==o&&1!==a&&i(t.minFilter!==w&&t.minFilter!==S&&t.minFilter!==_&&t.minFilter!==E,"min filter requires mipmap"):(i(L(o)&&L(a),"texture must be a square power of 2 to support mipmapping"),i(e.mipmask===(o<<1)-1,"missing or incomplete mipmap data")),e.type===C&&(r.extensions.indexOf("oes_texture_float_linear")<0&&i(t.minFilter===x&&t.magFilter===x,"filter not supported, must enable oes_texture_float_linear"),i(!t.genMipmaps,"mipmap generation not supported with float textures"));var u=e.images;for(n=0;n<16;++n)if(u[n]){var l=o>>n,c=a>>n;i(e.mipmask&1<0&&o<=n.maxTextureSize&&a>0&&a<=n.maxTextureSize,"invalid texture shape"),i(o===a,"cube map must be square"),i(e.wrapS===A&&e.wrapT===A,"wrap mode not supported by cube map");for(var u=0;u>f,d=a>>f;i(l.mipmask&1<1&&r===n&&('"'===r||"'"===r))return['"'+z(e.substr(1,e.length-2))+'"'];var i=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e);if(i)return t(e.substr(0,i.index)).concat(t(i[1])).concat(t(e.substr(i.index+i[0].length)));var o=e.split(".");if(1===o.length)return['"'+z(e)+'"'];for(var a=[],s=0;s0,"invalid pixel ratio"))):i=(o=u).canvas:N.raise("invalid arguments to regl"),r&&("canvas"===r.nodeName.toLowerCase()?i=r:n=r),!o){if(!i){N("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var g=function(t,r,n){var i,o=document.createElement("canvas");function a(){var r=window.innerWidth,i=window.innerHeight;if(t!==document.body){var a=t.getBoundingClientRect();r=a.right-a.left,i=a.bottom-a.top}o.width=n*r,o.height=n*i,e(o.style,{width:r+"px",height:i+"px"})}return e(o.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(o),t===document.body&&(o.style.position="absolute",e(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver(function(){setTimeout(a)})).observe(t):window.addEventListener("resize",a,!1),a(),{canvas:o,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",a),t.removeChild(o)}}}(n||document.body,0,h);if(!g)return null;i=g.canvas,y=g.onDestroy}void 0===l.premultipliedAlpha&&(l.premultipliedAlpha=!0),o=function(t,e){function r(r){try{return t.getContext(r,e)}catch(t){return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}(i,l)}return o?{gl:o,canvas:i,container:n,extensions:c,optionalExtensions:f,pixelRatio:h,profile:p,onDone:d,onDestroy:y}:(y(),d("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function q(t,e){for(var r=Array(t),n=0;n65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}function nt(){var t=q(8,function(){return[]});function e(e){var r=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),n=t[rt(r)>>2];return n.length>0?n.pop():new ArrayBuffer(r)}function r(e){t[rt(e.byteLength)>>2].push(e)}return{alloc:e,free:r,allocType:function(t,r){var n=null;switch(t){case X:n=new Int8Array(e(r),0,r);break;case K:n=new Uint8Array(e(r),0,r);break;case J:n=new Int16Array(e(2*r),0,r);break;case Z:n=new Uint16Array(e(2*r),0,r);break;case $:n=new Int32Array(e(4*r),0,r);break;case tt:n=new Uint32Array(e(4*r),0,r);break;case et:n=new Float32Array(e(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){r(t.buffer)}}}var it=nt();it.zero=nt();var ot=function(t,e){var r=1;e.ext_texture_filter_anisotropic&&(r=t.getParameter(34047));var n=1,i=1;e.webgl_draw_buffers&&(n=t.getParameter(34852),i=t.getParameter(36063));var o=!!e.oes_texture_float;if(o){var a=t.createTexture();t.bindTexture(3553,a),t.texImage2D(3553,0,6408,1,1,0,6408,5126,null);var s=t.createFramebuffer();if(t.bindFramebuffer(36160,s),t.framebufferTexture2D(36160,36064,3553,a,0),t.bindTexture(3553,null),36053!==t.checkFramebufferStatus(36160))o=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var u=it.allocType(5126,4);t.readPixels(0,0,1,1,6408,5126,u),t.getError()?o=!1:(t.deleteFramebuffer(s),t.deleteTexture(a),o=1===u[0]),it.freeType(u)}}var l=!0;if(!("undefined"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)))){var c=t.createTexture(),f=it.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,c),t.texImage2D(34069,0,6408,3,3,0,6408,5121,f),it.freeType(f),t.bindTexture(34067,null),t.deleteTexture(c),l=!t.getError()}return{colorBits:[t.getParameter(3410),t.getParameter(3411),t.getParameter(3412),t.getParameter(3413)],depthBits:t.getParameter(3414),stencilBits:t.getParameter(3415),subpixelBits:t.getParameter(3408),extensions:Object.keys(e).filter(function(t){return!!e[t]}),maxAnisotropic:r,maxDrawbuffers:n,maxColorAttachments:i,pointSizeDims:t.getParameter(33901),lineWidthDims:t.getParameter(33902),maxViewportDims:t.getParameter(3386),maxCombinedTextureUnits:t.getParameter(35661),maxCubeMapSize:t.getParameter(34076),maxRenderbufferSize:t.getParameter(34024),maxTextureUnits:t.getParameter(34930),maxTextureSize:t.getParameter(3379),maxAttributes:t.getParameter(34921),maxVertexUniforms:t.getParameter(36347),maxVertexTextureUnits:t.getParameter(35660),maxVaryingVectors:t.getParameter(36348),maxFragmentUniforms:t.getParameter(36349),glsl:t.getParameter(35724),renderer:t.getParameter(7937),vendor:t.getParameter(7936),version:t.getParameter(7938),readFloat:o,npotTextureCube:l}};function at(e){return!!e&&"object"===a(e)&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||t(e.data))}var st=function(t){return Object.keys(t).map(function(e){return t[e]})},ut={shape:function(t){for(var e=[],r=t;r.length;r=r[0])e.push(r.length);return e},flatten:function(t,e,r,n){var i=1;if(e.length)for(var o=0;o>>31<<15,o=(n<<1>>>24)-127,a=n>>13&1023;if(o<-24)e[r]=i;else if(o<-14){var s=-14-o;e[r]=i+(a+1024>>s)}else e[r]=o>15?i+31744:i+(o+15<<10)+a}return e}function zt(e){return Array.isArray(e)||t(e)}var Gt=function(t){return!(t&t-1||!t)},Ut=34467,Ht=3553,Vt=34067,Qt=34069,Yt=6408,Wt=6406,qt=6407,Xt=6409,Kt=6410,Jt=32854,Zt=32855,$t=36194,te=32819,ee=32820,re=33635,ne=34042,ie=6402,oe=34041,ae=35904,se=35906,ue=36193,le=33776,ce=33777,fe=33778,he=33779,pe=35986,de=35987,ye=34798,ge=35840,ve=35841,me=35842,be=35843,Ae=36196,xe=5121,we=5123,_e=5125,Se=5126,Ee=10242,Ce=10243,ke=10497,Ie=33071,Te=33648,Oe=10240,Me=10241,Pe=9728,Le=9729,Ne=9984,je=9985,Re=9986,De=9987,Be=33170,Fe=4352,ze=4353,Ge=4354,Ue=34046,He=3317,Ve=37440,Qe=37441,Ye=37443,We=37444,qe=33984,Xe=[Ne,Re,je,De],Ke=[0,Xt,Kt,qt,Yt],Je={};function Ze(t){return"[object "+t+"]"}Je[Xt]=Je[Wt]=Je[ie]=1,Je[oe]=Je[Kt]=2,Je[qt]=Je[ae]=3,Je[Yt]=Je[se]=4;var $e=Ze("HTMLCanvasElement"),tr=Ze("OffscreenCanvas"),er=Ze("CanvasRenderingContext2D"),rr=Ze("ImageBitmap"),nr=Ze("HTMLImageElement"),ir=Ze("HTMLVideoElement"),or=Object.keys(ct).concat([$e,tr,er,rr,nr,ir]),ar=[];ar[xe]=1,ar[Se]=4,ar[ue]=2,ar[we]=2,ar[_e]=4;var sr=[];function ur(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function lr(t){return!!Array.isArray(t)&&!(0===t.length||!zt(t[0]))}function cr(t){return Object.prototype.toString.call(t)}function fr(t){return cr(t)===$e}function hr(t){return cr(t)===tr}function pr(t){if(!t)return!1;var e=cr(t);return or.indexOf(e)>=0||(ur(t)||lr(t)||at(t))}function dr(t){return 0|ct[Object.prototype.toString.call(t)]}function yr(t,e){return it.allocType(t.type===ue?Se:t.type,e)}function gr(t,e){t.type===ue?(t.data=Ft(e),it.freeType(e)):t.data=e}function vr(t,e,r,n,i,o){var a;if(a=void 0!==sr[t]?sr[t]:Je[t]*ar[e],o&&(a*=6),i){for(var s=0,u=r;u>=1;)s+=a*u*u,u/=2;return s}return a*r*n}function mr(r,n,i,o,s,u,l){var c={"don't care":Fe,"dont care":Fe,nice:Ge,fast:ze},f={repeat:ke,clamp:Ie,mirror:Te},h={nearest:Pe,linear:Le},p=e({mipmap:De,"nearest mipmap nearest":Ne,"linear mipmap nearest":je,"nearest mipmap linear":Re,"linear mipmap linear":De},h),d={none:0,browser:We},y={uint8:xe,rgba4:te,rgb565:re,"rgb5 a1":ee},g={alpha:Wt,luminance:Xt,"luminance alpha":Kt,rgb:qt,rgba:Yt,rgba4:Jt,"rgb5 a1":Zt,rgb565:$t},v={};n.ext_srgb&&(g.srgb=ae,g.srgba=se),n.oes_texture_float&&(y.float32=y.float=Se),n.oes_texture_half_float&&(y.float16=y["half float"]=ue),n.webgl_depth_texture&&(e(g,{depth:ie,"depth stencil":oe}),e(y,{uint16:we,uint32:_e,"depth stencil":ne})),n.webgl_compressed_texture_s3tc&&e(v,{"rgb s3tc dxt1":le,"rgba s3tc dxt1":ce,"rgba s3tc dxt3":fe,"rgba s3tc dxt5":he}),n.webgl_compressed_texture_atc&&e(v,{"rgb atc":pe,"rgba atc explicit alpha":de,"rgba atc interpolated alpha":ye}),n.webgl_compressed_texture_pvrtc&&e(v,{"rgb pvrtc 4bppv1":ge,"rgb pvrtc 2bppv1":ve,"rgba pvrtc 4bppv1":me,"rgba pvrtc 2bppv1":be}),n.webgl_compressed_texture_etc1&&(v["rgb etc1"]=Ae);var m=Array.prototype.slice.call(r.getParameter(Ut));Object.keys(v).forEach(function(t){var e=v[t];m.indexOf(e)>=0&&(g[t]=e)});var b=Object.keys(g);i.textureFormats=b;var A=[];Object.keys(g).forEach(function(t){var e=g[t];A[e]=t});var x=[];Object.keys(y).forEach(function(t){var e=y[t];x[e]=t});var w=[];Object.keys(h).forEach(function(t){var e=h[t];w[e]=t});var _=[];Object.keys(p).forEach(function(t){var e=p[t];_[e]=t});var S=[];Object.keys(f).forEach(function(t){var e=f[t];S[e]=t});var E=b.reduce(function(t,e){var r=g[e];return r===Xt||r===Wt||r===Xt||r===Kt||r===ie||r===oe||n.ext_srgb&&(r===ae||r===se)?t[r]=r:r===Zt||e.indexOf("rgba")>=0?t[r]=Yt:t[r]=qt,t},{});function C(){this.internalformat=Yt,this.format=Yt,this.type=xe,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=We,this.width=0,this.height=0,this.channels=0}function k(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function I(t,e){if("object"===a(e)&&e){if("premultiplyAlpha"in e&&(N.type(e.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(N.type(e.flipY,"boolean","invalid texture flip"),t.flipY=e.flipY),"alignment"in e&&(N.oneOf(e.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=e.alignment),"colorSpace"in e&&(N.parameter(e.colorSpace,d,"invalid colorSpace"),t.colorSpace=d[e.colorSpace]),"type"in e){var r=e.type;N(n.oes_texture_float||!("float"===r||"float32"===r),"you must enable the OES_texture_float extension in order to use floating point textures."),N(n.oes_texture_half_float||!("half float"===r||"float16"===r),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),N(n.webgl_depth_texture||!("uint16"===r||"uint32"===r||"depth stencil"===r),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),N.parameter(r,y,"invalid texture type"),t.type=y[r]}var o=t.width,s=t.height,u=t.channels,l=!1;"shape"in e?(N(Array.isArray(e.shape)&&e.shape.length>=2,"shape must be an array"),o=e.shape[0],s=e.shape[1],3===e.shape.length&&(u=e.shape[2],N(u>0&&u<=4,"invalid number of channels"),l=!0),N(o>=0&&o<=i.maxTextureSize,"invalid width"),N(s>=0&&s<=i.maxTextureSize,"invalid height")):("radius"in e&&(o=s=e.radius,N(o>=0&&o<=i.maxTextureSize,"invalid radius")),"width"in e&&(o=e.width,N(o>=0&&o<=i.maxTextureSize,"invalid width")),"height"in e&&(s=e.height,N(s>=0&&s<=i.maxTextureSize,"invalid height")),"channels"in e&&(u=e.channels,N(u>0&&u<=4,"invalid number of channels"),l=!0)),t.width=0|o,t.height=0|s,t.channels=0|u;var c=!1;if("format"in e){var f=e.format;N(n.webgl_depth_texture||!("depth"===f||"depth stencil"===f),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),N.parameter(f,g,"invalid texture format");var h=t.internalformat=g[f];t.format=E[h],f in y&&("type"in e||(t.type=y[f])),f in v&&(t.compressed=!0),c=!0}!l&&c?t.channels=Je[t.format]:l&&!c?t.channels!==Ke[t.format]&&(t.format=t.internalformat=Ke[t.channels]):c&&l&&N(t.channels===Je[t.format],"number of channels inconsistent with specified format")}}function T(t){r.pixelStorei(Ve,t.flipY),r.pixelStorei(Qe,t.premultiplyAlpha),r.pixelStorei(Ye,t.colorSpace),r.pixelStorei(He,t.unpackAlignment)}function O(){C.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function M(e,r){var n=null;if(pr(r)?n=r:r&&(N.type(r,"object","invalid pixel data type"),I(e,r),"x"in r&&(e.xOffset=0|r.x),"y"in r&&(e.yOffset=0|r.y),pr(r.data)&&(n=r.data)),N(!e.compressed||n instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),r.copy){N(!n,"can not specify copy and data field for the same texture");var o=s.viewportWidth,a=s.viewportHeight;e.width=e.width||o-e.xOffset,e.height=e.height||a-e.yOffset,e.needsCopy=!0,N(e.xOffset>=0&&e.xOffset=0&&e.yOffset0&&e.width<=o&&e.height>0&&e.height<=a,"copy texture read out of bounds")}else if(n){if(t(n))e.channels=e.channels||4,e.data=n,"type"in r||e.type!==xe||(e.type=dr(n));else if(ur(n))e.channels=e.channels||4,function(t,e){var r=e.length;switch(t.type){case xe:case we:case _e:case Se:var n=it.allocType(t.type,r);n.set(e),t.data=n;break;case ue:t.data=Ft(e);break;default:N.raise("unsupported texture type, must specify a typed array")}}(e,n),e.alignment=1,e.needsFree=!0;else if(at(n)){var u=n.data;Array.isArray(u)||e.type!==xe||(e.type=dr(u));var l,c,f,h,p,d,y=n.shape,g=n.stride;3===y.length?(f=y[2],d=g[2]):(N(2===y.length,"invalid ndarray pixel data, must be 2 or 3D"),f=1,d=1),l=y[0],c=y[1],h=g[0],p=g[1],e.alignment=1,e.width=l,e.height=c,e.channels=f,e.format=e.internalformat=Ke[f],e.needsFree=!0,function(t,e,r,n,i,o){for(var a=t.width,s=t.height,u=t.channels,l=yr(t,a*s*u),c=0,f=0;f=0,"oes_texture_float extension not enabled"):e.type===ue&&N(i.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function P(t,e,n){var i=t.element,a=t.data,s=t.internalformat,u=t.format,l=t.type,c=t.width,f=t.height;T(t),i?r.texImage2D(e,n,u,u,l,i):t.compressed?r.compressedTexImage2D(e,n,s,c,f,0,a):t.needsCopy?(o(),r.copyTexImage2D(e,n,u,t.xOffset,t.yOffset,c,f,0)):r.texImage2D(e,n,u,c,f,0,u,l,a||null)}function L(t,e,n,i,a){var s=t.element,u=t.data,l=t.internalformat,c=t.format,f=t.type,h=t.width,p=t.height;T(t),s?r.texSubImage2D(e,a,n,i,c,f,s):t.compressed?r.compressedTexSubImage2D(e,a,n,i,l,h,p,u):t.needsCopy?(o(),r.copyTexSubImage2D(e,a,n,i,t.xOffset,t.yOffset,h,p)):r.texSubImage2D(e,a,n,i,h,p,c,f,u)}var j=[];function R(){return j.pop()||new O}function D(t){t.needsFree&&it.freeType(t.data),O.call(t),j.push(t)}function B(t,e,r){var n=t.images[0]=R();t.mipmask=1,n.width=t.width=e,n.height=t.height=r,n.channels=t.channels=4}function F(t,e){var r=null;if(pr(e))k(r=t.images[0]=R(),t),M(r,e),t.mipmask=1;else if(I(t,e),Array.isArray(e.mipmap))for(var n=e.mipmap,i=0;i>=i,r.height>>=i,M(r,n[i]),t.mipmask|=1<=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var n=e.mag;N.parameter(n,h),t.magFilter=h[n]}var o=t.wrapS,s=t.wrapT;if("wrap"in e){var u=e.wrap;"string"==typeof u?(N.parameter(u,f),o=s=f[u]):Array.isArray(u)&&(N.parameter(u[0],f),N.parameter(u[1],f),o=f[u[0]],s=f[u[1]])}else{if("wrapS"in e){var l=e.wrapS;N.parameter(l,f),o=f[l]}if("wrapT"in e){var d=e.wrapT;N.parameter(d,f),s=f[d]}}if(t.wrapS=o,t.wrapT=s,"anisotropic"in e){var y=e.anisotropic;N("number"==typeof y&&y>=1&&y<=i.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var g=!1;switch(a(e.mipmap)){case"string":N.parameter(e.mipmap,c,"invalid mipmap hint"),t.mipmapHint=c[e.mipmap],t.genMipmaps=!0,g=!0;break;case"boolean":g=t.genMipmaps=e.mipmap;break;case"object":N(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,g=!0;break;default:N.raise("invalid mipmap type")}!g||"min"in e||(t.minFilter=Ne)}}function Y(t,e){r.texParameteri(e,Me,t.minFilter),r.texParameteri(e,Oe,t.magFilter),r.texParameteri(e,Ee,t.wrapS),r.texParameteri(e,Ce,t.wrapT),n.ext_texture_filter_anisotropic&&r.texParameteri(e,Ue,t.anisotropic),t.genMipmaps&&(r.hint(Be,t.mipmapHint),r.generateMipmap(e))}var W=0,q={},X=i.maxTextureUnits,K=Array(X).map(function(){return null});function J(t){C.call(this),this.mipmask=0,this.internalformat=Yt,this.id=W++,this.refCount=1,this.target=t,this.texture=r.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new V,l.profile&&(this.stats={size:0})}function Z(t){r.activeTexture(qe),r.bindTexture(t.target,t.texture)}function $(){var t=K[0];t?r.bindTexture(t.target,t.texture):r.bindTexture(Ht,null)}function tt(t){var e=t.texture;N(e,"must not double destroy texture");var n=t.unit,i=t.target;n>=0&&(r.activeTexture(qe+n),r.bindTexture(i,null),K[n]=null),r.deleteTexture(e),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete q[t.id],u.textureCount--}return e(J.prototype,{bind:function(){this.bindCount+=1;var t=this.unit;if(t<0){for(var e=0;e0)continue;n.unit=-1}K[e]=this,t=e;break}t>=X&&N.raise("insufficient number of texture units"),l.profile&&u.maxTextureUnits>u)-a,l.height=l.height||(n.height>>u)-s,N(n.type===l.type&&n.format===l.format&&n.internalformat===l.internalformat,"incompatible format for texture.subimage"),N(a>=0&&s>=0&&a+l.width<=n.width&&s+l.height<=n.height,"texture.subimage write out of bounds"),N(n.mipmask&1<>s;++s){var u=i>>s,c=a>>s;if(!u||!c)break;r.texImage2D(Ht,s,n.format,u,c,0,n.format,n.type,null)}return $(),l.profile&&(n.stats.size=vr(n.internalformat,n.type,i,a,!1,!1)),o},o._reglType="texture2d",o._texture=n,l.profile&&(o.stats=n.stats),o.destroy=function(){n.decRef()},o},createCube:function(t,e,n,o,s,c){var f=new J(Vt);q[f.id]=f,u.cubeCount++;var h=new Array(6);function p(t,e,r,n,o,s){var u,c=f.texInfo;for(V.call(c),u=0;u<6;++u)h[u]=U();if("number"!=typeof t&&t)if("object"===a(t))if(e)F(h[0],t),F(h[1],e),F(h[2],r),F(h[3],n),F(h[4],o),F(h[5],s);else if(Q(c,t),I(f,t),"faces"in t){var d=t.faces;for(N(Array.isArray(d)&&6===d.length,"cube faces must be a length 6 array"),u=0;u<6;++u)N("object"===a(d[u])&&!!d[u],"invalid input for cube map face"),k(h[u],f),F(h[u],d[u])}else for(u=0;u<6;++u)F(h[u],t);else N.raise("invalid arguments to cube map");else{var y=0|t||1;for(u=0;u<6;++u)B(h[u],y,y)}for(k(f,h[0]),i.npotTextureCube||N(Gt(f.width)&&Gt(f.height),"your browser does not support non power or two texture dimensions"),c.genMipmaps?f.mipmask=(h[0].width<<1)-1:f.mipmask=h[0].mipmask,N.textureCube(f,c,h,i),f.internalformat=h[0].internalformat,p.width=h[0].width,p.height=h[0].height,Z(f),u=0;u<6;++u)z(h[u],Qt+u);for(Y(c,Vt),$(),l.profile&&(f.stats.size=vr(f.internalformat,f.type,p.width,p.height,c.genMipmaps,!0)),p.format=A[f.internalformat],p.type=x[f.type],p.mag=w[c.magFilter],p.min=_[c.minFilter],p.wrapS=S[c.wrapS],p.wrapT=S[c.wrapT],u=0;u<6;++u)H(h[u]);return p}return p(t,e,n,o,s,c),p.subimage=function(t,e,r,n,i){N(!!e,"must specify image data"),N("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var o=0|r,a=0|n,s=0|i,u=R();return k(u,f),u.width=0,u.height=0,M(u,e),u.width=u.width||(f.width>>s)-o,u.height=u.height||(f.height>>s)-a,N(f.type===u.type&&f.format===u.format&&f.internalformat===u.internalformat,"incompatible format for texture.subimage"),N(o>=0&&a>=0&&o+u.width<=f.width&&a+u.height<=f.height,"texture.subimage write out of bounds"),N(f.mipmask&1<>i;++i)r.texImage2D(Qt+n,i,f.format,e>>i,e>>i,0,f.format,f.type,null);return $(),l.profile&&(f.stats.size=vr(f.internalformat,f.type,p.width,p.height,!1,!0)),p}},p._reglType="textureCube",p._texture=f,l.profile&&(p.stats=f.stats),p.destroy=function(){f.decRef()},p},clear:function(){for(var t=0;t>e,t.height>>e,0,t.internalformat,t.type,null);else for(var n=0;n<6;++n)r.texImage2D(Qt+n,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);Y(t.texInfo,t.target)})},refresh:function(){for(var t=0;t=2,"invalid renderbuffer shape"),u=0|d[0],l=0|d[1]}else"radius"in p&&(u=l=0|p.radius),"width"in p&&(u=0|p.width),"height"in p&&(l=0|p.height);"format"in p&&(N.parameter(p.format,o,"invalid renderbuffer format"),c=o[p.format])}else"number"==typeof e?(u=0|e,l="number"==typeof n?0|n:u):e?N.raise("invalid arguments to renderbuffer constructor"):u=l=1;if(N(u>0&&l>0&&u<=r.maxRenderbufferSize&&l<=r.maxRenderbufferSize,"invalid renderbuffer size"),u!==f.width||l!==f.height||c!==f.format)return h.width=f.width=u,h.height=f.height=l,f.format=c,t.bindRenderbuffer(br,f.renderbuffer),t.renderbufferStorage(br,c,u,l),N(0===t.getError(),"invalid render buffer format"),i.profile&&(f.stats.size=wr(f.format,f.width,f.height)),h.format=s[f.format],h}return l[f.id]=f,n.renderbufferCount++,h(e,u),h.resize=function(e,n){var o=0|e,a=0|n||o;return o===f.width&&a===f.height?h:(N(o>0&&a>0&&o<=r.maxRenderbufferSize&&a<=r.maxRenderbufferSize,"invalid renderbuffer size"),h.width=f.width=o,h.height=f.height=a,t.bindRenderbuffer(br,f.renderbuffer),t.renderbufferStorage(br,f.format,o,a),N(0===t.getError(),"invalid render buffer format"),i.profile&&(f.stats.size=wr(f.format,f.width,f.height)),h)},h._reglType="renderbuffer",h._renderbuffer=f,i.profile&&(h.stats=f.stats),h.destroy=function(){f.decRef()},h},clear:function(){st(l).forEach(f)},restore:function(){st(l).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(br,e.renderbuffer),t.renderbufferStorage(br,e.format,e.width,e.height)}),t.bindRenderbuffer(br,null)}}},Sr=36160,Er=36161,Cr=3553,kr=34069,Ir=36064,Tr=36096,Or=36128,Mr=33306,Pr=36053,Lr=6402,Nr=[6407,6408],jr=[];jr[6408]=4,jr[6407]=3;var Rr=[];Rr[5121]=1,Rr[5126]=4,Rr[36193]=2;var Dr=33189,Br=36168,Fr=34041,zr=[32854,32855,36194,35907,34842,34843,34836],Gr={};Gr[Pr]="complete",Gr[36054]="incomplete attachment",Gr[36057]="incomplete dimensions",Gr[36055]="incomplete, missing attachment",Gr[36061]="unsupported";var Ur=5126,Hr=34962;function Vr(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=Ur,this.offset=0,this.stride=0,this.divisor=0}var Qr=35632,Yr=35633,Wr=35718,qr=35721;function Xr(t,r,n,i){var o={},a={};function s(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function u(t,e){for(var r=0;r1)for(var v=0;vt&&(t=e.stats.uniformsCount)}),t},n.getMaxAttributesCount=function(){var t=0;return f.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);st(o).forEach(e),o={},st(a).forEach(e),a={},f.forEach(function(e){t.deleteProgram(e.program)}),f.length=0,c={},n.shaderCount=0},program:function(r,s,u,l){N.command(r>=0,"missing vertex shader",u),N.command(s>=0,"missing fragment shader",u);var d=c[s];d||(d=c[s]={});var y=d[r];if(y&&(y.refCount++,!l))return y;var g=new function(t,e){this.id=h++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,i.profile&&(this.stats={uniformsCount:0,attributesCount:0})}(s,r);return n.shaderCount++,p(g,u,l),y||(d[r]=g),f.push(g),e(g,{destroy:function(){if(g.refCount--,g.refCount<=0){t.deleteProgram(g.program);var e=f.indexOf(g);f.splice(e,1),n.shaderCount--}d[g.vertId].refCount<=0&&(t.deleteShader(a[g.vertId]),delete a[g.vertId],delete c[g.fragId][g.vertId]),Object.keys(c[g.fragId]).length||(t.deleteShader(o[g.fragId]),delete o[g.fragId],delete c[g.fragId])}})},restore:function(){o={},a={};for(var t=0;t=0&&c=0&&f0&&h+c<=i.framebufferWidth,"invalid width for read pixels"),N(p>0&&p+f<=i.framebufferHeight,"invalid height for read pixels"),n();var y=h*p*4;return d||(l===Jr?d=new Uint8Array(y):l===$r&&(d=d||new Float32Array(y))),N.isTypedArray(d,"data buffer for regl.read() must be a typedarray"),N(d.byteLength>=y,"data buffer for regl.read() too small"),e.pixelStorei(Zr,4),e.readPixels(c,f,h,p,Kr,l,d),d}return function(t){return t&&"framebuffer"in t?function(t){var e;return r.setFBO({framebuffer:t.framebuffer},function(){e=u(t)}),e}(t):u(t)}}function en(t){return Array.prototype.slice.call(t)}function rn(t){return en(t).join("")}var nn="xyzw".split(""),on=5121,an=1,sn=2,un=0,ln=1,cn=2,fn=3,hn=4,pn=5,dn=6,yn="dither",gn="blend.enable",vn="blend.color",mn="blend.equation",bn="blend.func",An="depth.enable",xn="depth.func",wn="depth.range",_n="depth.mask",Sn="colorMask",En="cull.enable",Cn="cull.face",kn="frontFace",In="lineWidth",Tn="polygonOffset.enable",On="polygonOffset.offset",Mn="sample.alpha",Pn="sample.enable",Ln="sample.coverage",Nn="stencil.enable",jn="stencil.mask",Rn="stencil.func",Dn="stencil.opFront",Bn="stencil.opBack",Fn="scissor.enable",zn="scissor.box",Gn="viewport",Un="profile",Hn="framebuffer",Vn="vert",Qn="frag",Yn="elements",Wn="primitive",qn="count",Xn="offset",Kn="instances",Jn="vao",Zn=Hn+"Width",$n=Hn+"Height",ti=Gn+"Width",ei=Gn+"Height",ri="drawingBufferWidth",ni="drawingBufferHeight",ii=[bn,mn,Rn,Dn,Bn,Ln,Gn,zn,On],oi=34962,ai=34963,si=3553,ui=34067,li=2884,ci=3042,fi=3024,hi=2960,pi=2929,di=3089,yi=32823,gi=32926,vi=32928,mi=5126,bi=35664,Ai=35665,xi=35666,wi=5124,_i=35667,Si=35668,Ei=35669,Ci=35670,ki=35671,Ii=35672,Ti=35673,Oi=35674,Mi=35675,Pi=35676,Li=35678,Ni=35680,ji=4,Ri=1028,Di=1029,Bi=2304,Fi=2305,zi=32775,Gi=32776,Ui=519,Hi=7680,Vi=0,Qi=1,Yi=32774,Wi=513,qi=36160,Xi=36064,Ki={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Ji=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Zi={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},$i={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},to={frag:35632,vert:35633},eo={cw:Bi,ccw:Fi};function ro(e){return Array.isArray(e)||t(e)||at(e)}function no(t){return t.sort(function(t,e){return t===Gn?-1:e===Gn?1:t=1,n>=2,e)}if(r===hn){var i=t.data;return new io(i.thisDep,i.contextDep,i.propDep,e)}if(r===pn)return new io(!1,!1,!1,e);if(r===dn){for(var o=!1,a=!1,s=!1,u=0;u=1&&(a=!0),c>=2&&(s=!0)}else l.type===hn&&(o=o||l.data.thisDep,a=a||l.data.contextDep,s=s||l.data.propDep)}return new io(o,a,s,e)}return new io(r===fn,r===cn,r===ln,e)}var uo=new io(!1,!1,!1,function(){});function lo(t,r,n,i,o,s,u,l,c,f,h,p,d,y,g){var v=f.Record,m={add:32774,subtract:32778,"reverse subtract":32779};n.ext_blend_minmax&&(m.min=zi,m.max=Gi);var b=n.angle_instanced_arrays,A=n.webgl_draw_buffers,x={dirty:!0,profile:g.profile},w={},_=[],S={},E={};function C(t){return t.replace(".","_")}function k(t,e,r){var n=C(t);_.push(t),w[n]=x[n]=!!r,S[n]=e}function I(t,e,r){var n=C(t);_.push(t),Array.isArray(r)?(x[n]=r.slice(),w[n]=r.slice()):x[n]=w[n]=r,E[n]=e}k(yn,fi),k(gn,ci),I(vn,"blendColor",[0,0,0,0]),I(mn,"blendEquationSeparate",[Yi,Yi]),I(bn,"blendFuncSeparate",[Qi,Vi,Qi,Vi]),k(An,pi,!0),I(xn,"depthFunc",Wi),I(wn,"depthRange",[0,1]),I(_n,"depthMask",!0),I(Sn,Sn,[!0,!0,!0,!0]),k(En,li),I(Cn,"cullFace",Di),I(kn,kn,Fi),I(In,In,1),k(Tn,yi),I(On,"polygonOffset",[0,0]),k(Mn,gi),k(Pn,vi),I(Ln,"sampleCoverage",[1,!1]),k(Nn,hi),I(jn,"stencilMask",-1),I(Rn,"stencilFunc",[Ui,0,-1]),I(Dn,"stencilOpSeparate",[Ri,Hi,Hi,Hi]),I(Bn,"stencilOpSeparate",[Di,Hi,Hi,Hi]),k(Fn,di),I(zn,"scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),I(Gn,Gn,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var T={gl:t,context:d,strings:r,next:w,current:x,draw:p,elements:s,buffer:o,shader:h,attributes:f.state,vao:f,uniforms:c,framebuffer:l,extensions:n,timer:y,isBufferArgs:ro},O={primTypes:_t,compareFuncs:Zi,blendFuncs:Ki,blendEquations:m,stencilOps:$i,glTypes:ft,orientationType:eo};N.optional(function(){T.isArrayLike=zt}),A&&(O.backBuffer=[Di],O.drawBuffer=q(i.maxDrawbuffers,function(t){return 0===t?[0]:q(t,function(t){return Xi+t})}));var M=0;function P(){var t=function(){var t=0,r=[],n=[];function i(){var r=[],n=[];return e(function(){r.push.apply(r,en(arguments))},{def:function(){var e="v"+t++;return n.push(e),arguments.length>0&&(r.push(e,"="),r.push.apply(r,en(arguments)),r.push(";")),e},toString:function(){return rn([n.length>0?"var "+n.join(",")+";":"",rn(r)])}})}function o(){var t=i(),r=i(),n=t.toString,o=r.toString;function a(e,n){r(e,n,"=",t.def(e,n),";")}return e(function(){t.apply(t,en(arguments))},{def:t.def,entry:t,exit:r,save:a,set:function(e,r,n){a(e,r),t(e,r,"=",n,";")},toString:function(){return n()+o()}})}var a=i(),s={};return{global:a,link:function(e){for(var i=0;i=0,'unknown parameter "'+e+'"',p.commandStr)})}e(d),e(y)});var g=function(t,e){var r=t.static;if("string"==typeof r[Qn]&&"string"==typeof r[Vn]){if(Object.keys(e.dynamic).length>0)return null;var n=e.static,i=Object.keys(n);if(i.length>0&&"number"==typeof n[i[0]]){for(var o=[],a=0;a=0,"invalid "+t,r.commandStr)):u=!1,"height"in o?(s=0|o.height,N.command(s>=0,"invalid "+t,r.commandStr)):u=!1,new io(!u&&e&&e.thisDep,!u&&e&&e.contextDep,!u&&e&&e.propDep,function(t,e){var r=t.shared.context,n=a;"width"in o||(n=e.def(r,".",Zn,"-",l));var i=s;return"height"in o||(i=e.def(r,".",$n,"-",c)),[l,c,n,i]})}if(t in i){var f=i[t],h=so(f,function(e,r){var n=e.invoke(r,f);N.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)});var i=e.shared.context,o=r.def(n,".x|0"),a=r.def(n,".y|0"),s=r.def('"width" in ',n,"?",n,".width|0:","(",i,".",Zn,"-",o,")"),u=r.def('"height" in ',n,"?",n,".height|0:","(",i,".",$n,"-",a,")");return N.optional(function(){e.assert(r,s+">=0&&"+u+">=0","invalid "+t)}),[o,a,s,u]});return e&&(h.thisDep=h.thisDep||e.thisDep,h.contextDep=h.contextDep||e.contextDep,h.propDep=h.propDep||e.propDep),h}return e?new io(e.thisDep,e.contextDep,e.propDep,function(t,e){var r=t.shared.context;return[0,0,e.def(r,".",Zn),e.def(r,".",$n)]}):null}var a=o(Gn);if(a){var s=a;a=new io(a.thisDep,a.contextDep,a.propDep,function(t,e){var r=s.append(t,e),n=t.shared.context;return e.set(n,"."+ti,r[2]),e.set(n,"."+ei,r[3]),r})}return{viewport:a,scissor_box:o(zn)}}(t,A,p),w=function(t,e){var r=t.static,n=t.dynamic,i=function(){if(Yn in r){var t=r[Yn];ro(t)?t=s.getElements(s.create(t,!0)):t&&(t=s.getElements(t),N.command(t,"invalid elements",e.commandStr));var i=ao(function(e,r){if(t){var n=e.link(t);return e.ELEMENTS=n,n}return e.ELEMENTS=null,null});return i.value=t,i}if(Yn in n){var o=n[Yn];return so(o,function(t,e){var r=t.shared,n=r.isBufferArgs,i=r.elements,a=t.invoke(e,o),s=e.def("null"),u=e.def(n,"(",a,")"),l=t.cond(u).then(s,"=",i,".createStream(",a,");").else(s,"=",i,".getElements(",a,");");return N.optional(function(){t.assert(l.else,"!"+a+"||"+s,"invalid elements")}),e.entry(l),e.exit(t.cond(u).then(i,".destroyStream(",s,");")),t.ELEMENTS=s,s})}return null}();function o(t,o){if(t in r){var a=0|r[t];return N.command(!o||a>=0,"invalid "+t,e.commandStr),ao(function(t,e){return o&&(t.OFFSET=a),a})}if(t in n){var s=n[t];return so(s,function(e,r){var n=e.invoke(r,s);return o&&(e.OFFSET=n,N.optional(function(){e.assert(r,n+">=0","invalid "+t)})),n})}return o&&i?ao(function(t,e){return t.OFFSET="0",0}):null}var a=o(Xn,!0);return{elements:i,primitive:function(){if(Wn in r){var t=r[Wn];return N.commandParameter(t,_t,"invalid primitve",e.commandStr),ao(function(e,r){return _t[t]})}if(Wn in n){var o=n[Wn];return so(o,function(t,e){var r=t.constants.primTypes,n=t.invoke(e,o);return N.optional(function(){t.assert(e,n+" in "+r,"invalid primitive, must be one of "+Object.keys(_t))}),e.def(r,"[",n,"]")})}return i?oo(i)?i.value?ao(function(t,e){return e.def(t.ELEMENTS,".primType")}):ao(function(){return ji}):new io(i.thisDep,i.contextDep,i.propDep,function(t,e){var r=t.ELEMENTS;return e.def(r,"?",r,".primType:",ji)}):null}(),count:function(){if(qn in r){var t=0|r[qn];return N.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),ao(function(){return t})}if(qn in n){var o=n[qn];return so(o,function(t,e){var r=t.invoke(e,o);return N.optional(function(){t.assert(e,"typeof "+r+'==="number"&&'+r+">=0&&"+r+"===("+r+"|0)","invalid vertex count")}),r})}if(i){if(oo(i)){if(i)return a?new io(a.thisDep,a.contextDep,a.propDep,function(t,e){var r=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return N.optional(function(){t.assert(e,r+">=0","invalid vertex offset/element buffer too small")}),r}):ao(function(t,e){return e.def(t.ELEMENTS,".vertCount")});var s=ao(function(){return-1});return N.optional(function(){s.MISSING=!0}),s}var u=new io(i.thisDep||a.thisDep,i.contextDep||a.contextDep,i.propDep||a.propDep,function(t,e){var r=t.ELEMENTS;return t.OFFSET?e.def(r,"?",r,".vertCount-",t.OFFSET,":-1"):e.def(r,"?",r,".vertCount:-1")});return N.optional(function(){u.DYNAMIC=!0}),u}return null}(),instances:o(Kn,!1),offset:a}}(t,p),S=function(t,e){var r=t.static,n=t.dynamic,o={};return _.forEach(function(t){var s=C(t);function u(e,i){if(t in r){var a=e(r[t]);o[s]=ao(function(){return a})}else if(t in n){var u=n[t];o[s]=so(u,function(t,e){return i(t,e,t.invoke(e,u))})}}switch(t){case En:case gn:case yn:case Nn:case An:case Fn:case Tn:case Mn:case Pn:case _n:return u(function(r){return N.commandType(r,"boolean",t,e.commandStr),r},function(e,r,n){return N.optional(function(){e.assert(r,"typeof "+n+'==="boolean"',"invalid flag "+t,e.commandStr)}),n});case xn:return u(function(r){return N.commandParameter(r,Zi,"invalid "+t,e.commandStr),Zi[r]},function(e,r,n){var i=e.constants.compareFuncs;return N.optional(function(){e.assert(r,n+" in "+i,"invalid "+t+", must be one of "+Object.keys(Zi))}),r.def(i,"[",n,"]")});case wn:return u(function(t){return N.command(zt(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t},function(t,e,r){return N.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===2&&typeof "+r+'[0]==="number"&&typeof '+r+'[1]==="number"&&'+r+"[0]<="+r+"[1]","depth range must be a 2d array")}),[e.def("+",r,"[0]"),e.def("+",r,"[1]")]});case bn:return u(function(t){N.commandType(t,"object","blend.func",e.commandStr);var r="srcRGB"in t?t.srcRGB:t.src,n="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,o="dstAlpha"in t?t.dstAlpha:t.dst;return N.commandParameter(r,Ki,s+".srcRGB",e.commandStr),N.commandParameter(n,Ki,s+".srcAlpha",e.commandStr),N.commandParameter(i,Ki,s+".dstRGB",e.commandStr),N.commandParameter(o,Ki,s+".dstAlpha",e.commandStr),N.command(-1===Ji.indexOf(r+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+r+", "+i+")",e.commandStr),[Ki[r],Ki[i],Ki[n],Ki[o]]},function(e,r,n){var i=e.constants.blendFuncs;function o(o,a){var s=r.def('"',o,a,'" in ',n,"?",n,".",o,a,":",n,".",o);return N.optional(function(){e.assert(r,s+" in "+i,"invalid "+t+"."+o+a+", must be one of "+Object.keys(Ki))}),s}N.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid blend func, must be an object")});var a=o("src","RGB"),s=o("dst","RGB");N.optional(function(){var t=e.constants.invalidBlendCombinations;e.assert(r,t+".indexOf("+a+'+", "+'+s+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var u=r.def(i,"[",a,"]"),l=r.def(i,"[",o("src","Alpha"),"]");return[u,r.def(i,"[",s,"]"),l,r.def(i,"[",o("dst","Alpha"),"]")]});case mn:return u(function(r){return"string"==typeof r?(N.commandParameter(r,m,"invalid "+t,e.commandStr),[m[r],m[r]]):"object"===a(r)?(N.commandParameter(r.rgb,m,t+".rgb",e.commandStr),N.commandParameter(r.alpha,m,t+".alpha",e.commandStr),[m[r.rgb],m[r.alpha]]):void N.commandRaise("invalid blend.equation",e.commandStr)},function(e,r,n){var i=e.constants.blendEquations,o=r.def(),a=r.def(),s=e.cond("typeof ",n,'==="string"');return N.optional(function(){function r(t,r,n){e.assert(t,n+" in "+i,"invalid "+r+", must be one of "+Object.keys(m))}r(s.then,t,n),e.assert(s.else,n+"&&typeof "+n+'==="object"',"invalid "+t),r(s.else,t+".rgb",n+".rgb"),r(s.else,t+".alpha",n+".alpha")}),s.then(o,"=",a,"=",i,"[",n,"];"),s.else(o,"=",i,"[",n,".rgb];",a,"=",i,"[",n,".alpha];"),r(s),[o,a]});case vn:return u(function(t){return N.command(zt(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),q(4,function(e){return+t[e]})},function(t,e,r){return N.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===4","blend.color must be a 4d array")}),q(4,function(t){return e.def("+",r,"[",t,"]")})});case jn:return u(function(t){return N.commandType(t,"number",s,e.commandStr),0|t},function(t,e,r){return N.optional(function(){t.assert(e,"typeof "+r+'==="number"',"invalid stencil.mask")}),e.def(r,"|0")});case Rn:return u(function(r){N.commandType(r,"object",s,e.commandStr);var n=r.cmp||"keep",i=r.ref||0,o="mask"in r?r.mask:-1;return N.commandParameter(n,Zi,t+".cmp",e.commandStr),N.commandType(i,"number",t+".ref",e.commandStr),N.commandType(o,"number",t+".mask",e.commandStr),[Zi[n],i,o]},function(t,e,r){var n=t.constants.compareFuncs;return N.optional(function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(r+"&&typeof ",r,'==="object"'),i('!("cmp" in ',r,")||(",r,".cmp in ",n,")")}),[e.def('"cmp" in ',r,"?",n,"[",r,".cmp]",":",Hi),e.def(r,".ref|0"),e.def('"mask" in ',r,"?",r,".mask|0:-1")]});case Dn:case Bn:return u(function(r){N.commandType(r,"object",s,e.commandStr);var n=r.fail||"keep",i=r.zfail||"keep",o=r.zpass||"keep";return N.commandParameter(n,$i,t+".fail",e.commandStr),N.commandParameter(i,$i,t+".zfail",e.commandStr),N.commandParameter(o,$i,t+".zpass",e.commandStr),[t===Bn?Di:Ri,$i[n],$i[i],$i[o]]},function(e,r,n){var i=e.constants.stencilOps;function o(o){return N.optional(function(){e.assert(r,'!("'+o+'" in '+n+")||("+n+"."+o+" in "+i+")","invalid "+t+"."+o+", must be one of "+Object.keys($i))}),r.def('"',o,'" in ',n,"?",i,"[",n,".",o,"]:",Hi)}return N.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)}),[t===Bn?Di:Ri,o("fail"),o("zfail"),o("zpass")]});case On:return u(function(t){N.commandType(t,"object",s,e.commandStr);var r=0|t.factor,n=0|t.units;return N.commandType(r,"number",s+".factor",e.commandStr),N.commandType(n,"number",s+".units",e.commandStr),[r,n]},function(e,r,n){return N.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)}),[r.def(n,".factor|0"),r.def(n,".units|0")]});case Cn:return u(function(t){var r=0;return"front"===t?r=Ri:"back"===t&&(r=Di),N.command(!!r,s,e.commandStr),r},function(t,e,r){return N.optional(function(){t.assert(e,r+'==="front"||'+r+'==="back"',"invalid cull.face")}),e.def(r,'==="front"?',Ri,":",Di)});case In:return u(function(t){return N.command("number"==typeof t&&t>=i.lineWidthDims[0]&&t<=i.lineWidthDims[1],"invalid line width, must be a positive number between "+i.lineWidthDims[0]+" and "+i.lineWidthDims[1],e.commandStr),t},function(t,e,r){return N.optional(function(){t.assert(e,"typeof "+r+'==="number"&&'+r+">="+i.lineWidthDims[0]+"&&"+r+"<="+i.lineWidthDims[1],"invalid line width")}),r});case kn:return u(function(t){return N.commandParameter(t,eo,s,e.commandStr),eo[t]},function(t,e,r){return N.optional(function(){t.assert(e,r+'==="cw"||'+r+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),e.def(r+'==="cw"?'+Bi+":"+Fi)});case Sn:return u(function(t){return N.command(zt(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map(function(t){return!!t})},function(t,e,r){return N.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===4","invalid color.mask")}),q(4,function(t){return"!!"+r+"["+t+"]"})});case Ln:return u(function(t){N.command("object"===a(t)&&t,s,e.commandStr);var r="value"in t?t.value:1,n=!!t.invert;return N.command("number"==typeof r&&r>=0&&r<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[r,n]},function(t,e,r){return N.optional(function(){t.assert(e,r+"&&typeof "+r+'==="object"',"invalid sample.coverage")}),[e.def('"value" in ',r,"?+",r,".value:1"),e.def("!!",r,".invert")]})}}),o}(t,p),E=function(t,e,n){var i=t.static,o=t.dynamic;function a(t){if(t in i){var e=r.id(i[t]);N.optional(function(){h.shader(to[t],e,N.guessCommand())});var n=ao(function(){return e});return n.id=e,n}if(t in o){var a=o[t];return so(a,function(e,r){var n=e.invoke(r,a),i=r.def(e.shared.strings,".id(",n,")");return N.optional(function(){r(e.shared.shader,".shader(",to[t],",",i,",",e.command,");")}),i})}return null}var s,u=a(Qn),l=a(Vn),c=null;return oo(u)&&oo(l)?(c=h.program(l.id,u.id,null,n),s=ao(function(t,e){return t.link(c)})):s=new io(u&&u.thisDep||l&&l.thisDep,u&&u.contextDep||l&&l.contextDep,u&&u.propDep||l&&l.propDep,function(t,e){var r,n=t.shared.shader;r=u?u.append(t,e):e.def(n,".",Qn);var i=n+".program("+(l?l.append(t,e):e.def(n,".",Vn))+","+r;return N.optional(function(){i+=","+t.command}),e.def(i+")")}),{frag:u,vert:l,progVar:s,program:c}}(t,0,g);function k(t){var e=x[t];e&&(S[t]=e)}k(Gn),k(C(zn));var I=Object.keys(S).length>0,T={framebuffer:A,draw:w,shader:E,state:S,dirty:I,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(T.profile=function(t){var e,r=t.static,n=t.dynamic;if(Un in r){var i=!!r[Un];(e=ao(function(t,e){return i})).enable=i}else if(Un in n){var o=n[Un];e=so(o,function(t,e){return t.invoke(e,o)})}return e}(t),T.uniforms=function(t,e){var r=t.static,n=t.dynamic,i={};return Object.keys(r).forEach(function(t){var n,o=r[t];if("number"==typeof o||"boolean"==typeof o)n=ao(function(){return o});else if("function"==typeof o){var a=o._reglType;"texture2d"===a||"textureCube"===a?n=ao(function(t){return t.link(o)}):"framebuffer"===a||"framebufferCube"===a?(N.command(o.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),n=ao(function(t){return t.link(o.color[0])})):N.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else zt(o)?n=ao(function(e){return e.global.def("[",q(o.length,function(r){return N.command("number"==typeof o[r]||"boolean"==typeof o[r],"invalid uniform "+t,e.commandStr),o[r]}),"]")}):N.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);n.value=o,i[t]=n}),Object.keys(n).forEach(function(t){var e=n[t];i[t]=so(e,function(t,r){return t.invoke(r,e)})}),i}(u,p),T.drawVAO=T.scopeVAO=function(t,e){var r=t.static,n=t.dynamic;if(Jn in r){var i=r[Jn];return null!==i&&null===f.getVAO(i)&&(i=f.createVAO(i)),ao(function(t){return t.link(f.getVAO(i))})}if(Jn in n){var o=n[Jn];return so(o,function(t,e){var r=t.invoke(e,o);return e.def(t.shared.vao+".getVAO("+r+")")})}return null}(t),!T.drawVAO&&E.program&&!g&&n.angle_instanced_arrays){var O=!0,M=E.program.attributes.map(function(t){var r=e.static[t];return O=O&&!!r,r});if(O&&M.length>0){var P=f.getVAO(f.createVAO(M));T.drawVAO=new io(null,null,null,function(t,e){return t.link(P)}),T.useVAO=!0}}return g?T.useVAO=!0:T.attributes=function(t,e){var n=t.static,i=t.dynamic,s={};return Object.keys(n).forEach(function(t){var i=n[t],u=r.id(t),l=new v;if(ro(i))l.state=an,l.buffer=o.getBuffer(o.create(i,oi,!1,!0)),l.type=0;else{var c=o.getBuffer(i);if(c)l.state=an,l.buffer=c,l.type=0;else if(N.command("object"===a(i)&&i,"invalid data for attribute "+t,e.commandStr),"constant"in i){var f=i.constant;l.buffer="null",l.state=sn,"number"==typeof f?l.x=f:(N.command(zt(f)&&f.length>0&&f.length<=4,"invalid constant for attribute "+t,e.commandStr),nn.forEach(function(t,e){e=0,'invalid offset for attribute "'+t+'"',e.commandStr);var p=0|i.stride;N.command(p>=0&&p<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',e.commandStr);var d=0|i.size;N.command(!("size"in i)||d>0&&d<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',e.commandStr);var y=!!i.normalized,g=0;"type"in i&&(N.commandParameter(i.type,ft,"invalid type for attribute "+t,e.commandStr),g=ft[i.type]);var m=0|i.divisor;"divisor"in i&&(N.command(0===m||b,'cannot specify divisor for attribute "'+t+'", instancing not supported',e.commandStr),N.command(m>=0,'invalid divisor for attribute "'+t+'"',e.commandStr)),N.optional(function(){var r=e.commandStr,n=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(i).forEach(function(e){N.command(n.indexOf(e)>=0,'unknown parameter "'+e+'" for attribute pointer "'+t+'" (valid parameters are '+n+")",r)})}),l.buffer=c,l.state=an,l.size=d,l.normalized=y,l.type=g||c.dtype,l.offset=h,l.stride=p,l.divisor=m}}s[t]=ao(function(t,e){var r=t.attribCache;if(u in r)return r[u];var n={isStream:!1};return Object.keys(l).forEach(function(t){n[t]=l[t]}),l.buffer&&(n.buffer=t.link(l.buffer),n.type=n.type||n.buffer+".dtype"),r[u]=n,n})}),Object.keys(i).forEach(function(t){var e=i[t];s[t]=so(e,function(r,n){var i=r.invoke(n,e),o=r.shared,a=r.constants,s=o.isBufferArgs,u=o.buffer;N.optional(function(){r.assert(n,i+"&&(typeof "+i+'==="object"||typeof '+i+'==="function")&&('+s+"("+i+")||"+u+".getBuffer("+i+")||"+u+".getBuffer("+i+".buffer)||"+s+"("+i+'.buffer)||("constant" in '+i+"&&(typeof "+i+'.constant==="number"||'+o.isArrayLike+"("+i+".constant))))",'invalid dynamic attribute "'+t+'"')});var l={isStream:n.def(!1)},c=new v;c.state=an,Object.keys(c).forEach(function(t){l[t]=n.def(""+c[t])});var f=l.buffer,h=l.type;function p(t){n(l[t],"=",i,".",t,"|0;")}return n("if(",s,"(",i,")){",l.isStream,"=true;",f,"=",u,".createStream(",oi,",",i,");",h,"=",f,".dtype;","}else{",f,"=",u,".getBuffer(",i,");","if(",f,"){",h,"=",f,".dtype;",'}else if("constant" in ',i,"){",l.state,"=",sn,";","if(typeof "+i+'.constant === "number"){',l[nn[0]],"=",i,".constant;",nn.slice(1).map(function(t){return l[t]}).join("="),"=0;","}else{",nn.map(function(t,e){return l[t]+"="+i+".constant.length>"+e+"?"+i+".constant["+e+"]:0;"}).join(""),"}}else{","if(",s,"(",i,".buffer)){",f,"=",u,".createStream(",oi,",",i,".buffer);","}else{",f,"=",u,".getBuffer(",i,".buffer);","}",h,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",f,".dtype;",l.normalized,"=!!",i,".normalized;"),p("size"),p("offset"),p("stride"),p("divisor"),n("}}"),n.exit("if(",l.isStream,"){",u,".destroyStream(",f,");","}"),l})}),s}(e,p),T.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r=e[t];n[t]=ao(function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)})}),Object.keys(r).forEach(function(t){var e=r[t];n[t]=so(e,function(t,r){return t.invoke(r,e)})}),n}(c),T}function j(t,e,r){var n=t.shared.context,i=t.scope();Object.keys(r).forEach(function(o){e.save(n,"."+o);var a=r[o].append(t,e);Array.isArray(a)?i(n,".",o,"=[",a.join(),"];"):i(n,".",o,"=",a,";")}),e(i)}function R(t,e,r,n){var i,o=t.shared,a=o.gl,s=o.framebuffer;A&&(i=e.def(o.extensions,".webgl_draw_buffers"));var u,l=t.constants,c=l.drawBuffer,f=l.backBuffer;u=r?r.append(t,e):e.def(s,".next"),n||e("if(",u,"!==",s,".cur){"),e("if(",u,"){",a,".bindFramebuffer(",qi,",",u,".framebuffer);"),A&&e(i,".drawBuffersWEBGL(",c,"[",u,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",qi,",null);"),A&&e(i,".drawBuffersWEBGL(",f,");"),e("}",s,".cur=",u,";"),n||e("}")}function D(t,e,r){var n=t.shared,i=n.gl,o=t.current,a=t.next,s=n.current,u=n.next,l=t.cond(s,".dirty");_.forEach(function(e){var n,c,f=C(e);if(!(f in r.state))if(f in a){n=a[f],c=o[f];var h=q(x[f].length,function(t){return l.def(n,"[",t,"]")});l(t.cond(h.map(function(t,e){return t+"!=="+c+"["+e+"]"}).join("||")).then(i,".",E[f],"(",h,");",h.map(function(t,e){return c+"["+e+"]="+t}).join(";"),";"))}else{n=l.def(u,".",f);var p=t.cond(n,"!==",s,".",f);l(p),f in S?p(t.cond(n).then(i,".enable(",S[f],");").else(i,".disable(",S[f],");"),s,".",f,"=",n,";"):p(i,".",E[f],"(",n,");",s,".",f,"=",n,";")}}),0===Object.keys(r.state).length&&l(s,".dirty=false;"),e(l)}function B(t,e,r,n){var i=t.shared,o=t.current,a=i.current,s=i.gl;no(Object.keys(r)).forEach(function(i){var u=r[i];if(!n||n(u)){var l=u.append(t,e);if(S[i]){var c=S[i];oo(u)?e(s,l?".enable(":".disable(",c,");"):e(t.cond(l).then(s,".enable(",c,");").else(s,".disable(",c,");")),e(a,".",i,"=",l,";")}else if(zt(l)){var f=o[i];e(s,".",E[i],"(",l,");",l.map(function(t,e){return f+"["+e+"]="+t}).join(";"),";")}else e(s,".",E[i],"(",l,");",a,".",i,"=",l,";")}})}function F(t,e){b&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function z(t,e,r,n,i){var o,a,s,u=t.shared,l=t.stats,c=u.current,f=u.timer,h=r.profile;function p(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function d(t){t(o=e.def(),"=",p(),";"),"string"==typeof i?t(l,".count+=",i,";"):t(l,".count++;"),y&&(n?t(a=e.def(),"=",f,".getNumPendingQueries();"):t(f,".beginQuery(",l,");"))}function g(t){t(l,".cpuTime+=",p(),"-",o,";"),y&&(n?t(f,".pushScopeStats(",a,",",f,".getNumPendingQueries(),",l,");"):t(f,".endQuery();"))}function v(t){var r=e.def(c,".profile");e(c,".profile=",t,";"),e.exit(c,".profile=",r,";")}if(h){if(oo(h))return void(h.enable?(d(e),g(e.exit),v("true")):v("false"));v(s=h.append(t,e))}else s=e.def(c,".profile");var m=t.block();d(m),e("if(",s,"){",m,"}");var b=t.block();g(b),e.exit("if(",s,"){",b,"}")}function G(t,e,r,n,i){var o=t.shared;n.forEach(function(n){var a,s=n.name,u=r.attributes[s];if(u){if(!i(u))return;a=u.append(t,e)}else{if(!i(uo))return;var l=t.scopeAttrib(s);N.optional(function(){t.assert(e,l+".state","missing attribute "+s)}),a={},Object.keys(new v).forEach(function(t){a[t]=e.def(l,".",t)})}!function(r,n,i){var a=o.gl,s=e.def(r,".location"),u=e.def(o.attributes,"[",s,"]"),l=i.state,c=i.buffer,f=[i.x,i.y,i.z,i.w],h=["buffer","normalized","offset","stride"];function p(){e("if(!",u,".buffer){",a,".enableVertexAttribArray(",s,");}");var r,o=i.type;if(r=i.size?e.def(i.size,"||",n):n,e("if(",u,".type!==",o,"||",u,".size!==",r,"||",h.map(function(t){return u+"."+t+"!=="+i[t]}).join("||"),"){",a,".bindBuffer(",oi,",",c,".buffer);",a,".vertexAttribPointer(",[s,r,o,i.normalized,i.stride,i.offset],");",u,".type=",o,";",u,".size=",r,";",h.map(function(t){return u+"."+t+"="+i[t]+";"}).join(""),"}"),b){var l=i.divisor;e("if(",u,".divisor!==",l,"){",t.instancing,".vertexAttribDivisorANGLE(",[s,l],");",u,".divisor=",l,";}")}}function d(){e("if(",u,".buffer){",a,".disableVertexAttribArray(",s,");",u,".buffer=null;","}if(",nn.map(function(t,e){return u+"."+t+"!=="+f[e]}).join("||"),"){",a,".vertexAttrib4f(",s,",",f,");",nn.map(function(t,e){return u+"."+t+"="+f[e]+";"}).join(""),"}")}l===an?p():l===sn?d():(e("if(",l,"===",an,"){"),p(),e("}else{"),d(),e("}"))}(t.link(n),function(t){switch(t){case bi:case _i:case ki:return 2;case Ai:case Si:case Ii:return 3;case xi:case Ei:case Ti:return 4;default:return 1}}(n.info.type),a)})}function H(t,e,n,i,o){for(var a,s=t.shared,u=s.gl,l=0;l1?e(q(A,function(t){return Array.isArray(c)?c[t]:c+"["+t+"]"})):(N(!Array.isArray(c),"uniform value must not be an array"),e(c));e(");")}}function V(t,e,r,n){var i=t.shared,o=i.gl,a=i.draw,s=n.draw;var u=function(){var i,u=s.elements,l=e;return u?((u.contextDep&&n.contextDynamic||u.propDep)&&(l=r),i=u.append(t,l)):i=l.def(a,".",Yn),i&&l("if("+i+")"+o+".bindBuffer("+ai+","+i+".buffer.buffer);"),i}();function l(i){var o=s[i];return o?o.contextDep&&n.contextDynamic||o.propDep?o.append(t,r):o.append(t,e):e.def(a,".",i)}var c,f,h=l(Wn),p=l(Xn),d=function(){var i,o=s.count,u=e;return o?((o.contextDep&&n.contextDynamic||o.propDep)&&(u=r),i=o.append(t,u),N.optional(function(){o.MISSING&&t.assert(e,"false","missing vertex count"),o.DYNAMIC&&t.assert(u,i+">=0","missing vertex count")})):(i=u.def(a,".",qn),N.optional(function(){t.assert(u,i+">=0","missing vertex count")})),i}();if("number"==typeof d){if(0===d)return}else r("if(",d,"){"),r.exit("}");b&&(c=l(Kn),f=t.instancing);var y=u+".type",g=s.elements&&oo(s.elements);function v(){function t(){r(f,".drawElementsInstancedANGLE(",[h,d,y,p+"<<(("+y+"-"+on+")>>1)",c],");")}function e(){r(f,".drawArraysInstancedANGLE(",[h,p,d,c],");")}u?g?t():(r("if(",u,"){"),t(),r("}else{"),e(),r("}")):e()}function m(){function t(){r(o+".drawElements("+[h,d,y,p+"<<(("+y+"-"+on+")>>1)"]+");")}function e(){r(o+".drawArrays("+[h,p,d]+");")}u?g?t():(r("if(",u,"){"),t(),r("}else{"),e(),r("}")):e()}b&&("number"!=typeof c||c>=0)?"string"==typeof c?(r("if(",c,">0){"),v(),r("}else if(",c,"<0){"),m(),r("}")):v():m()}function Q(t,e,r,n,i){var o=P(),a=o.proc("body",i);return N.optional(function(){o.commandStr=e.commandStr,o.command=o.link(e.commandStr)}),b&&(o.instancing=a.def(o.shared.extensions,".angle_instanced_arrays")),t(o,a,r,n),o.compile().body}function Y(t,e,r,n){F(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),G(t,e,r,n.attributes,function(){return!0})),H(t,e,r,n.uniforms,function(){return!0}),V(t,e,e,r)}function W(t,e,r,n){function i(){return!0}t.batchId="a1",F(t,e),G(t,e,r,n.attributes,i),H(t,e,r,n.uniforms,i),V(t,e,e,r)}function X(t,e,r,n){F(t,e);var i=r.contextDep,o=e.def(),a=e.def();t.shared.props=a,t.batchId=o;var s=t.scope(),u=t.scope();function l(t){return t.contextDep&&i||t.propDep}function c(t){return!l(t)}if(e(s.entry,"for(",o,"=0;",o,"<","a1",";++",o,"){",a,"=","a0","[",o,"];",u,"}",s.exit),r.needsContext&&j(t,u,r.context),r.needsFramebuffer&&R(t,u,r.framebuffer),B(t,u,r.state,l),r.profile&&l(r.profile)&&z(t,u,r,!1,!0),n)r.useVAO?r.drawVAO?l(r.drawVAO)?u(t.shared.vao,".setVAO(",r.drawVAO.append(t,u),");"):s(t.shared.vao,".setVAO(",r.drawVAO.append(t,s),");"):s(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(s(t.shared.vao,".setVAO(null);"),G(t,s,r,n.attributes,c),G(t,u,r,n.attributes,l)),H(t,s,r,n.uniforms,c),H(t,u,r,n.uniforms,l),V(t,s,u,r);else{var f=t.global.def("{}"),h=r.shader.progVar.append(t,u),p=u.def(h,".id"),d=u.def(f,"[",p,"]");u(t.shared.gl,".useProgram(",h,".program);","if(!",d,"){",d,"=",f,"[",p,"]=",t.link(function(e){return Q(W,t,r,e,2)}),"(",h,");}",d,".call(this,a0[",o,"],",o,");")}}function K(t,e,r){var n=e.static[r];if(n&&function(t){if("object"===a(t)&&!zt(t)){for(var e=Object.keys(t),r=0;r0&&r(t.shared.current,".dirty=true;")}(s,u),function(t,e){var n=t.proc("scope",3);t.batchId="a2";var i=t.shared,o=i.current;function a(r){var o=e.shader[r];o&&n.set(i.shader,"."+r,o.append(t,n))}j(t,n,e.context),e.framebuffer&&e.framebuffer.append(t,n),no(Object.keys(e.state)).forEach(function(r){var o=e.state[r].append(t,n);zt(o)?o.forEach(function(e,i){n.set(t.next[r],"["+i+"]",e)}):n.set(i.next,"."+r,o)}),z(t,n,e,!0,!0),[Yn,Xn,qn,Kn,Wn].forEach(function(r){var o=e.draw[r];o&&n.set(i.draw,"."+r,""+o.append(t,n))}),Object.keys(e.uniforms).forEach(function(o){var a=e.uniforms[o].append(t,n);Array.isArray(a)&&(a="["+a.join()+"]"),n.set(i.uniforms,"["+r.id(o)+"]",a)}),Object.keys(e.attributes).forEach(function(r){var i=e.attributes[r].append(t,n),o=t.scopeAttrib(r);Object.keys(new v).forEach(function(t){n.set(o,"."+t,i[t])})}),e.scopeVAO&&n.set(i.vao,".targetVAO",e.scopeVAO.append(t,n)),a(Vn),a(Qn),Object.keys(e.state).length>0&&(n(o,".dirty=true;"),n.exit(o,".dirty=true;")),n("a1(",t.shared.context,",a0,",t.batchId,");")}(s,u),function(t,e){var r=t.proc("batch",2);t.batchId="0",F(t,r);var n=!1,i=!0;Object.keys(e.context).forEach(function(t){n=n||e.context[t].propDep}),n||(j(t,r,e.context),i=!1);var o=e.framebuffer,a=!1;function s(t){return t.contextDep&&n||t.propDep}o?(o.propDep?n=a=!0:o.contextDep&&n&&(a=!0),a||R(t,r,o)):R(t,r,null),e.state.viewport&&e.state.viewport.propDep&&(n=!0),D(t,r,e),B(t,r,e.state,function(t){return!s(t)}),e.profile&&s(e.profile)||z(t,r,e,!1,"a1"),e.contextDep=n,e.needsContext=i,e.needsFramebuffer=a;var u=e.shader.progVar;if(u.contextDep&&n||u.propDep)X(t,r,e,null);else{var l=u.append(t,r);if(r(t.shared.gl,".useProgram(",l,".program);"),e.shader.program)X(t,r,e,e.shader.program);else{r(t.shared.vao,".setVAO(null);");var c=t.global.def("{}"),f=r.def(l,".id"),h=r.def(c,"[",f,"]");r(t.cond(h).then(h,".call(this,a0,a1);").else(h,"=",c,"[",f,"]=",t.link(function(r){return Q(X,t,e,r,2)}),"(",l,");",h,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&r(t.shared.current,".dirty=true;")}(s,u),e(s.compile(),{destroy:function(){u.shader.program.destroy()}})}}}var co=34918,fo=34919,ho=35007,po=function(t,e){if(!e.ext_disjoint_timer_query)return null;var r=[];function n(t){r.push(t)}var i=[];var o=[];function a(t){o.push(t)}var s=[];function u(t,e,r){var n=o.pop()||new function(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null};n.startQueryIndex=t,n.endQueryIndex=e,n.sum=0,n.stats=r,s.push(n)}var l=[],c=[];return{beginQuery:function(t){var n=r.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(ho,n),i.push(n),u(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(ho)},pushScopeStats:u,update:function(){var t,r,o=i.length;if(0!==o){c.length=Math.max(c.length,o+1),l.length=Math.max(l.length,o+1),l[0]=0,c[0]=0;var u=0;for(t=0,r=0;r0)if(Array.isArray(r[0])){s=dt(r);for(var c=1,f=1;f0)if("number"==typeof e[0]){var o=it.allocType(h.dtype,e.length);xt(o,e),d(o,i),it.freeType(o)}else if(Array.isArray(e[0])||t(e[0])){n=dt(e);var a=pt(e,n,h.dtype);d(a,i),it.freeType(a)}else N.raise("invalid buffer data")}else if(at(e)){n=e.shape;var s=e.stride,u=0,l=0,c=0,f=0;1===n.length?(u=n[0],l=1,c=s[0],f=0):2===n.length?(u=n[0],l=n[1],c=s[0],f=s[1]):N.raise("invalid shape");var y=Array.isArray(e.data)?h.dtype:At(e.data),g=it.allocType(y,u*l);wt(g,e.data,u,l,c,f,e.offset),d(g,i),it.freeType(g)}else N.raise("invalid data for buffer subdata");return p},n.profile&&(p.stats=h.stats),p.destroy=function(){f(h)},p},createStream:function(t,e){var r=u.pop();return r||(r=new s(t)),r.bind(),c(r,e,gt,0,1,!1),r},destroyStream:function(t){u.push(t)},clear:function(){st(a).forEach(f),u.forEach(f)},getBuffer:function(t){return t&&t._buffer instanceof s?t._buffer:null},restore:function(){st(a).forEach(function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)})},_initBuffer:c}}(i,h,n,function(t){return x.destroyBuffer(t)}),x=function(e,r,n,i,o){for(var a=n.maxAttributes,s=new Array(a),u=0;u0,"must specify at least one attribute");var i={},u=n.attributes;u.length=e.length;for(var l=0;l=p.byteLength?c.subdata(p):(c.destroy(),n.buffers[l]=null)),n.buffers[l]||(c=n.buffers[l]=o.create(f,Hr,!1,!0)),h.buffer=o.getBuffer(c),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1,i[l]=1):o.getBuffer(f)?(h.buffer=o.getBuffer(f),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1):o.getBuffer(f.buffer)?(h.buffer=o.getBuffer(f.buffer),h.size=0|(+f.size||h.buffer.dimension),h.normalized=!!f.normalized||!1,"type"in f?(N.parameter(f.type,ft,"invalid buffer type"),h.type=ft[f.type]):h.type=h.buffer.dtype,h.offset=0|(f.offset||0),h.stride=0|(f.stride||0),h.divisor=0|(f.divisor||0),h.state=1,N(h.size>=1&&h.size<=4,"size must be between 1 and 4"),N(h.offset>=0,"invalid offset"),N(h.stride>=0&&h.stride<=255,"stride must be between 0 and 255"),N(h.divisor>=0,"divisor must be positive"),N(!h.divisor||!!r.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in f?(N(l>0,"first attribute must not be a constant"),h.x=+f.x||0,h.y=+f.y||0,h.z=+f.z||0,h.w=+f.w||0,h.state=2):N(!1,"invalid attribute spec for location "+l)}for(var d=0;d>=1:f===Pt&&(p>>=2)),i.vertCount=p;var d=s;if(s<0){d=Ct;var y=i.buffer.dimension;1===y&&(d=St),2===y&&(d=Et),3===y&&(d=Ct)}i.primType=d}function f(t){i.elementsCount--,N(null!==t.buffer,"must not double destroy elements"),delete o[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(e,r){var o=n.create(null,Lt,!0),a=new u(o._buffer);function l(e){if(e)if("number"==typeof e)o(e),a.primType=Ct,a.vertCount=0|e,a.type=It;else{var r=null,n=jt,i=-1,u=-1,f=0,h=0;Array.isArray(e)||t(e)||at(e)?r=e:(N.type(e,"object","invalid arguments for elements"),"data"in e&&(r=e.data,N(Array.isArray(r)||t(r)||at(r),"invalid data for element buffer")),"usage"in e&&(N.parameter(e.usage,ht,"invalid element buffer usage"),n=ht[e.usage]),"primitive"in e&&(N.parameter(e.primitive,_t,"invalid element buffer primitive"),i=_t[e.primitive]),"count"in e&&(N("number"==typeof e.count&&e.count>=0,"invalid vertex count for elements"),u=0|e.count),"type"in e&&(N.parameter(e.type,s,"invalid buffer type"),h=s[e.type]),"length"in e?f=0|e.length:(f=u,h===Ot||h===Tt?f*=2:h!==Pt&&h!==Mt||(f*=4))),c(a,r,n,i,u,f,h)}else o(),a.primType=Ct,a.vertCount=0,a.type=It;return l}return i.elementsCount++,l(e),l._reglType="elements",l._elements=a,l.subdata=function(t,e){return o.subdata(t,e),l},l.destroy=function(){f(a)},l},createStream:function(t){var e=l.pop();return e||(e=new u(n.create(null,Lt,!0,!1)._buffer)),c(e,t,Nt,-1,-1,0,0),e},destroyStream:function(t){l.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof u?t._elements:null},clear:function(){st(o).forEach(f)}}}(i,p,A,h),_=Xr(i,f,h,n),S=mr(i,p,b,function(){k.procs.poll()},m,h,n),E=_r(i,p,b,h,n),C=function(t,r,n,i,o,s){var u={cur:null,next:null,dirty:!1,setFBO:null},l=["rgba"],c=["rgba4","rgb565","rgb5 a1"];r.ext_srgb&&c.push("srgba"),r.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),r.webgl_color_buffer_float&&c.push("rgba32f");var f=["uint8"];function h(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=0,i=0;e?(n=e.width,i=e.height):r&&(n=r.width,i=r.height),this.width=n,this.height=i}function p(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function d(t,e,r){if(t)if(t.texture){var n=t.texture._texture,i=Math.max(1,n.width),o=Math.max(1,n.height);N(i===e&&o===r,"inconsistent width/height for supplied texture"),n.refCount+=1}else{var a=t.renderbuffer._renderbuffer;N(a.width===e&&a.height===r,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function y(e,r){r&&(r.texture?t.framebufferTexture2D(Sr,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(Sr,e,Er,r.renderbuffer._renderbuffer.renderbuffer))}function g(t){var e=Cr,r=null,n=null,i=t;"object"===a(t)&&(i=t.data,"target"in t&&(e=0|t.target)),N.type(i,"function","invalid attachment data");var o=i._reglType;return"texture2d"===o?(r=i,N(e===Cr)):"textureCube"===o?(r=i,N(e>=kr&&e=2,"invalid shape for framebuffer"),s=M[0],h=M[1]}else"radius"in O&&(s=h=O.radius),"width"in O&&(s=O.width),"height"in O&&(h=O.height);("color"in O||"colors"in O)&&(b=O.color||O.colors,Array.isArray(b)&&N(1===b.length||r.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in O&&(S=0|O.colorCount,N(S>0,"invalid color buffer count")),"colorTexture"in O&&(A=!!O.colorTexture,x="rgba4"),"colorType"in O&&(w=O.colorType,A?(N(r.oes_texture_float||!("float"===w||"float32"===w),"you must enable OES_texture_float in order to use floating point framebuffer objects"),N(r.oes_texture_half_float||!("half float"===w||"float16"===w),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===w||"float16"===w?(N(r.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),x="rgba16f"):"float"!==w&&"float32"!==w||(N(r.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),x="rgba32f"),N.oneOf(w,f,"invalid color type")),"colorFormat"in O&&(x=O.colorFormat,l.indexOf(x)>=0?A=!0:c.indexOf(x)>=0?A=!1:A?N.oneOf(O.colorFormat,l,"invalid color format for texture"):N.oneOf(O.colorFormat,c,"invalid color format for renderbuffer"))),("depthTexture"in O||"depthStencilTexture"in O)&&(T=!(!O.depthTexture&&!O.depthStencilTexture),N(!T||r.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in O&&("boolean"==typeof O.depth?p=O.depth:(C=O.depth,y=!1)),"stencil"in O&&("boolean"==typeof O.stencil?y=O.stencil:(k=O.stencil,p=!1)),"depthStencil"in O&&("boolean"==typeof O.depthStencil?p=y=O.depthStencil:(I=O.depthStencil,p=!1,y=!1))}else s=h=1;var P=null,L=null,j=null,R=null;if(Array.isArray(b))P=b.map(g);else if(b)P=[g(b)];else for(P=new Array(S),i=0;i=0||P[i].renderbuffer&&zr.indexOf(P[i].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+i+" is invalid"),P[i]&&P[i].texture){var B=jr[P[i].texture._texture.format]*Rr[P[i].texture._texture.type];null===D?D=B:N(D===B,"all color attachments much have the same number of bits per pixel.")}return d(L,s,h),N(!L||L.texture&&L.texture._texture.format===Lr||L.renderbuffer&&L.renderbuffer._renderbuffer.format===Dr,"invalid depth attachment for framebuffer object"),d(j,s,h),N(!j||j.renderbuffer&&j.renderbuffer._renderbuffer.format===Br,"invalid stencil attachment for framebuffer object"),d(R,s,h),N(!R||R.texture&&R.texture._texture.format===Fr||R.renderbuffer&&R.renderbuffer._renderbuffer.format===Fr,"invalid depth-stencil attachment for framebuffer object"),_(o),o.width=s,o.height=h,o.colorAttachments=P,o.depthAttachment=L,o.stencilAttachment=j,o.depthStencilAttachment=R,a.color=P.map(m),a.depth=m(L),a.stencil=m(j),a.depthStencil=m(R),a.width=o.width,a.height=o.height,E(o),a}return s.framebufferCount++,a(t,i),e(a,{resize:function(t,e){N(u.next!==o,"can not resize a framebuffer which is currently in use");var r=Math.max(0|t,1),n=Math.max(0|e||r,1);if(r===o.width&&n===o.height)return a;for(var i=o.colorAttachments,s=0;s=2,"invalid shape for framebuffer"),N(m[0]===m[1],"cube framebuffer must be square"),h=m[0]}else"radius"in v&&(h=0|v.radius),"width"in v?(h=0|v.width,"height"in v&&N(v.height===h,"must be square")):"height"in v&&(h=0|v.height);("color"in v||"colors"in v)&&(p=v.color||v.colors,Array.isArray(p)&&N(1===p.length||r.webgl_draw_buffers,"multiple render targets not supported")),p||("colorCount"in v&&(g=0|v.colorCount,N(g>0,"invalid color buffer count")),"colorType"in v&&(N.oneOf(v.colorType,f,"invalid color type"),y=v.colorType),"colorFormat"in v&&(d=v.colorFormat,N.oneOf(v.colorFormat,l,"invalid color format for texture"))),"depth"in v&&(c.depth=v.depth),"stencil"in v&&(c.stencil=v.stencil),"depthStencil"in v&&(c.depthStencil=v.depthStencil)}else h=1;if(p)if(Array.isArray(p))for(s=[],n=0;n0&&(c.depth=o[0].depth,c.stencil=o[0].stencil,c.depthStencil=o[0].depthStencil),o[n]?o[n](c):o[n]=C(c)}return e(a,{width:h,height:h,color:s})}return a(t),e(a,{faces:o,resize:function(t){var e,r=0|t;if(N(r>0&&r<=n.maxCubeMapSize,"invalid radius for cube fbo"),r===a.width)return a;var i=a.color;for(e=0;e=0;--t){var e=M[t];e&&e(m,null,0)}i.flush(),d&&d.update()}function B(){!R&&M.length>0&&(R=H.next(D))}function F(){R&&(H.cancel(D),R=null)}function z(t){t.preventDefault(),s=!0,F(),P.forEach(function(t){t()})}function G(t){i.getError(),s=!1,u.restore(),_.restore(),A.restore(),S.restore(),E.restore(),C.restore(),x.restore(),d&&d.restore(),k.procs.refresh(),B(),L.forEach(function(t){t()})}function Q(t){function r(t,e){var r={},n={};return Object.keys(t).forEach(function(i){var o=t[i];if(U.isDynamic(o))n[i]=U.unbox(o,i);else{if(e&&Array.isArray(o))for(var a=0;a0)return f.call(this,function(t){for(;p.length=0,"cannot cancel a frame twice"),M[e]=function t(){var e=So(M,t);M[e]=M[M.length-1],M.length-=1,M.length<=0&&F()}}}}function K(){var t=T.viewport,e=T.scissor_box;t[0]=t[1]=e[0]=e[1]=0,m.viewportWidth=m.framebufferWidth=m.drawingBufferWidth=t[2]=e[2]=i.drawingBufferWidth,m.viewportHeight=m.framebufferHeight=m.drawingBufferHeight=t[3]=e[3]=i.drawingBufferHeight}function J(){m.tick+=1,m.time=$(),K(),k.procs.poll()}function Z(){S.refresh(),K(),k.procs.refresh(),d&&d.update()}function $(){return(V()-y)/1e3}Z();var tt=e(Q,{clear:function(t){if(N("object"===a(t)&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var r=0;r<6;++r)Y(e({framebuffer:t.framebuffer.faces[r]},t),q);else Y(t,q);else q(0,t)},prop:U.define.bind(null,xo),context:U.define.bind(null,wo),this:U.define.bind(null,_o),draw:Q({}),buffer:function(t){return A.create(t,mo,!1,!1)},elements:function(t){return w.create(t,!1)},texture:S.create2D,cube:S.createCube,renderbuffer:E.create,framebuffer:C.create,framebufferCube:C.createCube,vao:x.createVAO,attributes:o,frame:X,on:function(t,e){var r;switch(N.type(e,"function","listener callback must be a function"),t){case"frame":return X(e);case"lost":r=P;break;case"restore":r=L;break;case"destroy":r=j;break;default:N.raise("invalid event, must be one of frame,lost,restore,destroy")}return r.push(e),{cancel:function(){for(var t=0;t=0},read:I,destroy:function(){M.length=0,F(),O&&(O.removeEventListener(bo,z),O.removeEventListener(Ao,G)),_.clear(),C.clear(),E.clear(),S.clear(),w.clear(),A.clear(),x.clear(),d&&d.clear(),j.forEach(function(t){t()})},_gl:i,_refresh:Z,poll:function(){J(),d&&d.update()},now:$,stats:h});return n.onDone(null,tt),tt}},"object"===a(e)?t.exports=o():void 0===(i="function"==typeof(n=o)?n.call(e,r,e,t):n)||(t.exports=i)},7742:function(t,e,r){"use strict";var n=r(1897),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],r=0,a=t.length;r1&&void 0!==arguments[1]?arguments[1]:{};if(i=Object.assign({},n,i),!t||"string"!=typeof t)return t;var o=t.trim();if(void 0!==i.skipLike&&i.skipLike.test(o))return t;if(i.hex&&e.test(o))return Number.parseInt(o,16);var a=r.exec(o);if(a){var s=a[1],u=a[2],l=function(t){return t&&-1!==t.indexOf(".")?("."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1)),t):t}(a[3]),c=a[4]||a[6];if(!i.leadingZeros&&u.length>0&&s&&"."!==o[2])return t;if(!i.leadingZeros&&u.length>0&&!s&&"."!==o[1])return t;var f=Number(o),h=""+f;return-1!==h.search(/[eE]/)?i.eNotation?f:t:c?i.eNotation?f:t:-1!==o.indexOf(".")?"0"===h&&""===l?f:h===l?f:s&&h==="-"+l?f:t:u?l===h?f:s+l===h?f:t:o===h?f:o===s+h?f:t}return t}},5400:function(t,e,r){var n,i;function o(t){"@babel/helpers - typeof";return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t=r.nmd(t),function(a,s){"use strict";"object"===o(t)&&t.exports?t.exports=s():void 0===(i="function"==typeof(n=s)?n.call(e,r,e,t):n)||(t.exports=i)}(0,function(t){"use strict";var e=t&&t.IPv6;return{best:function(t){var e,r,n=t.toLowerCase().split(":"),i=n.length,o=8;for(""===n[0]&&""===n[1]&&""===n[2]?(n.shift(),n.shift()):""===n[0]&&""===n[1]?n.shift():""===n[i-1]&&""===n[i-2]&&n.pop(),-1!==n[(i=n.length)-1].indexOf(".")&&(o=7),e=0;e1;s++)r.splice(0,1);n[a]=r.join("")}var u=-1,l=0,c=0,f=-1,h=!1;for(a=0;al&&(u=f,l=c)):"0"===n[a]&&(h=!0,f=a,c=1);c>l&&(u=f,l=c),l>1&&n.splice(u,l,""),i=n.length;var p="";for(""===n[0]&&(p=":"),a=0;a=t.length-1)return!1;var n=t.lastIndexOf(".",e-1);if(n<=0||n>=e-1)return!1;var i=r.list[t.slice(e+1)];return!!i&&i.indexOf(" "+t.slice(n+1,e)+" ")>=0},is:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return!1;if(t.lastIndexOf(".",e-1)>=0)return!1;var n=r.list[t.slice(e+1)];return!!n&&n.indexOf(" "+t.slice(0,e)+" ")>=0},get:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return null;var n=t.lastIndexOf(".",e-1);if(n<=0||n>=e-1)return null;var i=r.list[t.slice(e+1)];return i?i.indexOf(" "+t.slice(n+1,e)+" ")<0?null:t.slice(n+1):null},noConflict:function(){return t.SecondLevelDomains===this&&(t.SecondLevelDomains=e),this}};return r})},7411:function(t,e,r){var n,i,o;function a(t){"@babel/helpers - typeof";return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t=r.nmd(t),function(s,u){"use strict";"object"===a(t)&&t.exports?t.exports=u(r(9018),r(5400),r(2714)):(i=[r(9018),r(5400),r(2714)],void 0===(o="function"==typeof(n=u)?n.apply(e,i):n)||(t.exports=o))}(0,function(t,e,r,n){"use strict";var i=n&&n.URI;function o(t,e){var r=arguments.length>=1,n=arguments.length>=2;if(!(this instanceof o))return r?n?new o(t,e):new o(t):new o;if(void 0===t){if(r)throw new TypeError("undefined is not a valid argument for URI");t="undefined"!=typeof location?location.href+"":""}if(null===t&&r)throw new TypeError("null is not a valid argument for URI");return this.href(t),void 0!==e?this.absoluteTo(e):this}o.version="1.19.11";var s=o.prototype,u=Object.prototype.hasOwnProperty;function l(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(t){return void 0===t?"Undefined":String(Object.prototype.toString.call(t)).slice(8,-1)}function f(t){return"Array"===c(t)}function h(t,e){var r,n,i={};if("RegExp"===c(e))i=null;else if(f(e))for(r=0,n=e.length;r]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},o.getDomAttribute=function(t){if(t&&t.nodeName){var e=t.nodeName.toLowerCase();if("input"!==e||"image"===t.type)return o.domAttributes[e]}},o.encode=v,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=v,o.decode=decodeURIComponent},o.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},o.encodeQuery=function(t,e){var r=o.encode(t+"");return void 0===e&&(e=o.escapeQuerySpace),e?r.replace(/%20/g,"+"):r},o.decodeQuery=function(t,e){t+="",void 0===e&&(e=o.escapeQuerySpace);try{return o.decode(e?t.replace(/\+/g,"%20"):t)}catch(e){return t}};var m,b={encode:"encode",decode:"decode"},A=function(t,e){return function(r){try{return o[e](r+"").replace(o.characters[t][e].expression,function(r){return o.characters[t][e].map[r]})}catch(t){return r}}};for(m in b)o[m+"PathSegment"]=A("pathname",b[m]),o[m+"UrnPathSegment"]=A("urnpath",b[m]);var x=function(t,e,r){return function(n){var i;i=r?function(t){return o[e](o[r](t))}:o[e];for(var a=(n+"").split(t),s=0,u=a.length;s-1&&(e.fragment=t.substring(r+1)||null,t=t.substring(0,r)),(r=t.indexOf("?"))>-1&&(e.query=t.substring(r+1)||null,t=t.substring(0,r)),"//"===(t=(t=t.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).substring(0,2)?(e.protocol=null,t=t.substring(2),t=o.parseAuthority(t,e)):(r=t.indexOf(":"))>-1&&(e.protocol=t.substring(0,r)||null,e.protocol&&!e.protocol.match(o.protocol_expression)?e.protocol=void 0:"//"===t.substring(r+1,r+3).replace(/\\/g,"/")?(t=t.substring(r+3),t=o.parseAuthority(t,e)):(t=t.substring(r+1),e.urn=!0)),e.path=t,e},o.parseHost=function(t,e){t||(t="");var r,n,i=(t=t.replace(/\\/g,"/")).indexOf("/");if(-1===i&&(i=t.length),"["===t.charAt(0))r=t.indexOf("]"),e.hostname=t.substring(1,r)||null,e.port=t.substring(r+2,i)||null,"/"===e.port&&(e.port=null);else{var a=t.indexOf(":"),s=t.indexOf("/"),u=t.indexOf(":",a+1);-1!==u&&(-1===s||u-1?i:t.length-1);return a>-1&&(-1===i||a-1?p.slice(0,d)+p.slice(d).replace(a,""):p.replace(a,"")).length<=l[0].length||r.ignore&&r.ignore.test(p))){var v=e(p,c,h=c+p.length,t);void 0!==v?(v=String(v),t=t.slice(0,c)+v+t.slice(h),n.lastIndex=c+v.length):n.lastIndex=h}}return n.lastIndex=0,t},o.ensureValidHostname=function(e,r){var n=!!e,i=!1;if(!!r&&(i=p(o.hostProtocols,r)),i&&!n)throw new TypeError("Hostname cannot be empty, if protocol is "+r);if(e&&e.match(o.invalid_hostname_characters)){if(!t)throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(t.toASCII(e).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(t){if(t){var e=Number(t);if(!(/^[0-9]+$/.test(e)&&e>0&&e<65536))throw new TypeError('Port "'+t+'" is not a valid port')}},o.noConflict=function(t){if(t){var e={URI:this.noConflict()};return n.URITemplate&&"function"==typeof n.URITemplate.noConflict&&(e.URITemplate=n.URITemplate.noConflict()),n.IPv6&&"function"==typeof n.IPv6.noConflict&&(e.IPv6=n.IPv6.noConflict()),n.SecondLevelDomains&&"function"==typeof n.SecondLevelDomains.noConflict&&(e.SecondLevelDomains=n.SecondLevelDomains.noConflict()),e}return n.URI===this&&(n.URI=i),this},s.build=function(t){return!0===t?this._deferred_build=!0:(void 0===t||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new o(this)},s.valueOf=s.toString=function(){return this.build(!1)._string},s.protocol=w("protocol"),s.username=w("username"),s.password=w("password"),s.hostname=w("hostname"),s.port=w("port"),s.query=_("query","?"),s.fragment=_("fragment","#"),s.search=function(t,e){var r=this.query(t,e);return"string"==typeof r&&r.length?"?"+r:r},s.hash=function(t,e){var r=this.fragment(t,e);return"string"==typeof r&&r.length?"#"+r:r},s.pathname=function(t,e){if(void 0===t||!0===t){var r=this._parts.path||(this._parts.hostname?"/":"");return t?(this._parts.urn?o.decodeUrnPath:o.decodePath)(r):r}return this._parts.urn?this._parts.path=t?o.recodeUrnPath(t):"":this._parts.path=t?o.recodePath(t):"/",this.build(!e),this},s.path=s.pathname,s.href=function(t,e){var r;if(void 0===t)return this.toString();this._string="",this._parts=o._parts();var n=t instanceof o,i="object"===a(t)&&(t.hostname||t.path||t.pathname);t.nodeName&&(t=t[o.getDomAttribute(t)]||"",i=!1);if(!n&&i&&void 0!==t.pathname&&(t=t.toString()),"string"==typeof t||t instanceof String)this._parts=o.parse(String(t),this._parts);else{if(!n&&!i)throw new TypeError("invalid input");var s=n?t._parts:t;for(r in s)"query"!==r&&u.call(this._parts,r)&&(this._parts[r]=s[r]);s.query&&this.query(s.query,!1)}return this.build(!e),this},s.is=function(t){var e=!1,n=!1,i=!1,a=!1,s=!1,u=!1,l=!1,c=!this._parts.urn;switch(this._parts.hostname&&(c=!1,n=o.ip4_expression.test(this._parts.hostname),i=o.ip6_expression.test(this._parts.hostname),s=(a=!(e=n||i))&&r&&r.has(this._parts.hostname),u=a&&o.idn_expression.test(this._parts.hostname),l=a&&o.punycode_expression.test(this._parts.hostname)),t.toLowerCase()){case"relative":return c;case"absolute":return!c;case"domain":case"name":return a;case"sld":return s;case"ip":return e;case"ip4":case"ipv4":case"inet4":return n;case"ip6":case"ipv6":case"inet6":return i;case"idn":return u;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return l}return null};var S=s.protocol,E=s.port,C=s.hostname;s.protocol=function(t,e){if(t&&!(t=t.replace(/:(\/\/)?$/,"")).match(o.protocol_expression))throw new TypeError('Protocol "'+t+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return S.call(this,t,e)},s.scheme=s.protocol,s.port=function(t,e){return this._parts.urn?void 0===t?"":this:(void 0!==t&&(0===t&&(t=null),t&&(":"===(t+="").charAt(0)&&(t=t.substring(1)),o.ensureValidPort(t))),E.call(this,t,e))},s.hostname=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0!==t){var r={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==o.parseHost(t,r))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');t=r.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(t,this._parts.protocol)}return C.call(this,t,e)},s.origin=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){var r=this.protocol();return this.authority()?(r?r+"://":"")+this.authority():""}var n=o(t);return this.protocol(n.protocol()).authority(n.authority()).build(!e),this},s.host=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?o.buildHost(this._parts):"";if("/"!==o.parseHost(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},s.authority=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?o.buildAuthority(this._parts):"";if("/"!==o.parseAuthority(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},s.userinfo=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){var r=o.buildUserinfo(this._parts);return r?r.substring(0,r.length-1):r}return"@"!==t[t.length-1]&&(t+="@"),o.parseUserinfo(t,this._parts),this.build(!e),this},s.resource=function(t,e){var r;return void 0===t?this.path()+this.search()+this.hash():(r=o.parse(t),this._parts.path=r.path,this._parts.query=r.query,this._parts.fragment=r.fragment,this.build(!e),this)},s.subdomain=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,r)||""}var n=this._parts.hostname.length-this.domain().length,i=this._parts.hostname.substring(0,n),a=new RegExp("^"+l(i));if(t&&"."!==t.charAt(t.length-1)&&(t+="."),-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");return t&&o.ensureValidHostname(t,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(a,t),this.build(!e),this},s.domain=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.match(/\./g);if(r&&r.length<2)return this._parts.hostname;var n=this._parts.hostname.length-this.tld(e).length-1;return n=this._parts.hostname.lastIndexOf(".",n-1)+1,this._parts.hostname.substring(n)||""}if(!t)throw new TypeError("cannot set domain empty");if(-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(t,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=t;else{var i=new RegExp(l(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(i,t)}return this.build(!e),this},s.tld=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.lastIndexOf("."),i=this._parts.hostname.substring(n+1);return!0!==e&&r&&r.list[i.toLowerCase()]&&r.get(this._parts.hostname)||i}var o;if(!t)throw new TypeError("cannot set TLD empty");if(t.match(/[^a-zA-Z0-9-]/)){if(!r||!r.is(t))throw new TypeError('TLD "'+t+'" contains characters other than [A-Z0-9]');o=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(o,t)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");o=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(o,t)}return this.build(!e),this},s.directory=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t||!0===t){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var r=this._parts.path.length-this.filename().length-1,n=this._parts.path.substring(0,r)||(this._parts.hostname?"/":"");return t?o.decodePath(n):n}var i=this._parts.path.length-this.filename().length,a=this._parts.path.substring(0,i),s=new RegExp("^"+l(a));return this.is("relative")||(t||(t="/"),"/"!==t.charAt(0)&&(t="/"+t)),t&&"/"!==t.charAt(t.length-1)&&(t+="/"),t=o.recodePath(t),this._parts.path=this._parts.path.replace(s,t),this.build(!e),this},s.filename=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("string"!=typeof t){if(!this._parts.path||"/"===this._parts.path)return"";var r=this._parts.path.lastIndexOf("/"),n=this._parts.path.substring(r+1);return t?o.decodePathSegment(n):n}var i=!1;"/"===t.charAt(0)&&(t=t.substring(1)),t.match(/\.?\//)&&(i=!0);var a=new RegExp(l(this.filename())+"$");return t=o.recodePath(t),this._parts.path=this._parts.path.replace(a,t),i?this.normalizePath(e):this.build(!e),this},s.suffix=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t||!0===t){if(!this._parts.path||"/"===this._parts.path)return"";var r,n,i=this.filename(),a=i.lastIndexOf(".");return-1===a?"":(r=i.substring(a+1),n=/^[a-z0-9%]+$/i.test(r)?r:"",t?o.decodePathSegment(n):n)}"."===t.charAt(0)&&(t=t.substring(1));var s,u=this.suffix();if(u)s=t?new RegExp(l(u)+"$"):new RegExp(l("."+u)+"$");else{if(!t)return this;this._parts.path+="."+o.recodePath(t)}return s&&(t=o.recodePath(t),this._parts.path=this._parts.path.replace(s,t)),this.build(!e),this},s.segment=function(t,e,r){var n=this._parts.urn?":":"/",i=this.path(),o="/"===i.substring(0,1),a=i.split(n);if(void 0!==t&&"number"!=typeof t&&(r=e,e=t,t=void 0),void 0!==t&&"number"!=typeof t)throw new Error('Bad segment "'+t+'", must be 0-based integer');if(o&&a.shift(),t<0&&(t=Math.max(a.length+t,0)),void 0===e)return void 0===t?a:a[t];if(null===t||void 0===a[t])if(f(e)){a=[];for(var s=0,u=e.length;s= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=h-p,E=Math.floor,C=String.fromCharCode;function k(t){throw new RangeError(_[t])}function I(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function T(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+I((t=t.replace(w,".")).split("."),e).join(".")}function O(t){for(var e,r,n=[],i=0,o=t.length;i=55296&&e<=56319&&i65535&&(e+=C((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=C(t)}).join("")}function P(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function L(t,e,r){var n=0;for(t=r?E(t/g):t>>1,t+=E(t/e);t>S*d>>1;n+=h)t=E(t/S);return E(n+(S+1)*t/(t+y))}function N(t){var e,r,n,i,o,a,s,u,l,c,y,g=[],A=t.length,x=0,w=m,_=v;for((r=t.lastIndexOf(b))<0&&(r=0),n=0;n=128&&k("not-basic"),g.push(t.charCodeAt(n));for(i=r>0?r+1:0;i=A&&k("invalid-input"),((u=(y=t.charCodeAt(i++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:h)>=h||u>E((f-x)/a))&&k("overflow"),x+=u*a,!(u<(l=s<=_?p:s>=_+d?d:s-_));s+=h)a>E(f/(c=h-l))&&k("overflow"),a*=c;_=L(x-o,e=g.length+1,0==o),E(x/e)>f-w&&k("overflow"),w+=E(x/e),x%=e,g.splice(x++,0,w)}return M(g)}function j(t){var e,r,n,i,o,a,s,u,l,c,y,g,A,x,w,_=[];for(g=(t=O(t)).length,e=m,r=0,o=v,a=0;a=e&&yE((f-r)/(A=n+1))&&k("overflow"),r+=(s-e)*A,e=s,a=0;af&&k("overflow"),y==e){for(u=r,l=h;!(u<(c=l<=o?p:l>=o+d?d:l-o));l+=h)w=u-c,x=h-c,_.push(C(P(c+w%x,0))),u=E(w/x);_.push(C(P(u,0))),o=L(r,A,n==i),r=0,++n}++r,++e}return _.join("")}if(l={version:"1.3.2",ucs2:{decode:O,encode:M},decode:N,encode:j,toASCII:function(t){return T(t,function(t){return x.test(t)?"xn--"+j(t):t})},toUnicode:function(t){return T(t,function(t){return A.test(t)?N(t.slice(4).toLowerCase()):t})}},"object"==i(r.amdO)&&r.amdO)void 0===(n=function(){return l}.call(e,r,e,t))||(t.exports=n);else if(a&&s)if(t.exports==a)s.exports=l;else for(c in l)l.hasOwnProperty(c)&&(a[c]=l[c]);else o.punycode=l}(this)},4539:function(){"use strict"},9556:function(t,e,r){"use strict";var n={};r.r(n),r.d(n,{GADDI:function(){return c_},Stack:function(){return f_},breadthFirstSearch:function(){return rw},connectedComponent:function(){return ow},cosineSimilarity:function(){return Nw},default:function(){return p_},depthFirstSearch:function(){return cw},detectAllCycles:function(){return pw},detectAllDirectedCycle:function(){return hw},detectAllUndirectedCycle:function(){return fw},detectCycle:function(){return dw},detectDirectedCycle:function(){return h_},dijkstra:function(){return yw},findAllPath:function(){return bw},findShortestPath:function(){return mw},floydWarshall:function(){return Aw},getAdjMatrix:function(){return qx},getDegree:function(){return sw},getInDegree:function(){return uw},getNeighbors:function(){return $x},getOutDegree:function(){return lw},iLouvain:function(){return Ow},kCore:function(){return Mw},kMeans:function(){return Lw},labelPropagation:function(){return xw},louvain:function(){return Tw},minimumSpanningTree:function(){return Gw},nodesCosineSimilarity:function(){return jw},pageRank:function(){return Uw}});var i={};r.r(i),r.d(i,{Line:function(){return z_},applyMatrix:function(){return S_},compare:function(){return m_},distance:function(){return k_},floydWarshall:function(){return T_},fractionToLine:function(){return V_},getAdjMatrix:function(){return O_},getBBoxBoundLine:function(){return G_},getCircleCenterByPoints:function(){return C_},getCircleIntersectByPoint:function(){return w_},getDegree:function(){return j_},getEllipseIntersectByPoint:function(){return __},getLineIntersect:function(){return A_},getPointsCenter:function(){return Q_},getRectIntersectByPoint:function(){return x_},intersectBBox:function(){return B_},invertMatrix:function(){return E_},isPointInPolygon:function(){return D_},isPointsOverlap:function(){return q_},isPolygonsIntersect:function(){return F_},itemIntersectByLine:function(){return H_},lerp:function(){return J_},lerpArray:function(){return Z_},move:function(){return P_},pointLineDistance:function(){return K_},pointLineSquareDist:function(){return W_},pointRectSquareDist:function(){return X_},rotate:function(){return N_},scale:function(){return L_},scaleMatrix:function(){return I_},squareDist:function(){return Y_},translate:function(){return M_}});var o={};r.r(o),r.d(o,{cloneBesidesImg:function(){return _S},getAnimateCfgWithCallback:function(){return SS},getBBox:function(){return fS},getComboBBox:function(){return xS},getLabelPosition:function(){return pS},getLetterWidth:function(){return gS},getLoopCfgs:function(){return hS},getTextSize:function(){return vS},plainCombosToTrees:function(){return bS},reconstructTree:function(){return AS},shouldRefreshEdge:function(){return wS},traverseTree:function(){return dS},traverseTreeUp:function(){return yS},truncateLabelByLength:function(){return mS}});var a={};r.r(a),r.d(a,{calculationItemsBBox:function(){return NS},cloneEvent:function(){return MS},formatPadding:function(){return OS},isNaN:function(){return LS},isViewportChanged:function(){return PS},processParallelEdges:function(){return jS},uniqueId:function(){return TS}});var s={};r.r(s),r.d(s,{getClosedSpline:function(){return lE},getControlPoint:function(){return aE},getSpline:function(){return oE},getStarPath:function(){return yE},paddedHull:function(){return dE},pathToPoints:function(){return uE},pointsToPolygon:function(){return sE},roundedHull:function(){return pE}});var u={};r.r(u),r.d(u,{defaultSubjectColors:function(){return VE}});var l={};r.r(l),r.d(l,{isForce:function(){return QE}});var c={};r.r(c),r.d(c,{Base:function(){return RC},Circle:function(){return DC},Ellipse:function(){return FC},Image:function(){return GC},Line:function(){return VC},Marker:function(){return YC},Path:function(){return rk},Polygon:function(){return ik},Polyline:function(){return ok},Rect:function(){return ak},Text:function(){return sk}});var f={};r.r(f),r.d(f,{Canvas:function(){return ck},Group:function(){return jC},Shape:function(){return c},getArcParams:function(){return yC},version:function(){return fk}});var h={};r.r(h),r.d(h,{Base:function(){return wk},Circle:function(){return _k},Dom:function(){return Sk},Ellipse:function(){return Ek},Image:function(){return Ck},Line:function(){return kk},Marker:function(){return Ok},Path:function(){return Mk},Polygon:function(){return Pk},Polyline:function(){return Lk},Rect:function(){return Nk},Text:function(){return Fk}});var p={};r.r(p),r.d(p,{Canvas:function(){return nI},Group:function(){return xk},Shape:function(){return h},version:function(){return iI}});var d={};r.r(d),r.d(d,{getColorSetsBySubjectColors:function(){return aT},getColorsWithSubjectColor:function(){return oT},mixColor:function(){return iT}});var y={};r.r(y),r.d(y,{arrayToTextureData:function(){return _T},attributesToTextureData:function(){return wT},buildTextureData:function(){return bT},buildTextureDataWithOneEdgeAttr:function(){return AT},buildTextureDataWithTwoEdgeAttr:function(){return xT},proccessToFunc:function(){return mT},radialLayout:function(){return ST}});var g={};r.r(g),r.d(g,{gpuDetector:function(){return ET}});var v={};r.r(v),r.d(v,{getBrowserName:function(){return CT}});var m={};r.r(m),r.d(m,{assign:function(){return eM},default:function(){return xM},defaultI18n:function(){return oM},format:function(){return bM},parse:function(){return AM},setGlobalDateI18n:function(){return sM},setGlobalDateMasks:function(){return mM}});var b={};r.r(b),r.d(b,{Arc:function(){return yD},DataMarker:function(){return mD},DataRegion:function(){return bD},Html:function(){return CD},Image:function(){return vD},Line:function(){return pD},Region:function(){return gD},RegionFilter:function(){return AD},Shape:function(){return xD},Text:function(){return dD}});var A={};r.r(A),r.d(A,{ellipsisHead:function(){return MD},ellipsisMiddle:function(){return LD},ellipsisTail:function(){return PD},getDefault:function(){return OD}});var x={};r.r(x),r.d(x,{equidistance:function(){return UD},equidistanceWithReverseBoth:function(){return HD},getDefault:function(){return BD},reserveBoth:function(){return GD},reserveFirst:function(){return FD},reserveLast:function(){return zD}});var w={};r.r(w),r.d(w,{fixedAngle:function(){return YD},getDefault:function(){return QD},unfixedAngle:function(){return WD}});var _={};r.r(_),r.d(_,{autoEllipsis:function(){return A},autoHide:function(){return x},autoRotate:function(){return w}});var S={};r.r(S),r.d(S,{Base:function(){return JD},Circle:function(){return $D},Html:function(){return eB},Line:function(){return ZD}});var E={};r.r(E),r.d(E,{CONTAINER_CLASS:function(){return hB},CROSSHAIR_X:function(){return bB},CROSSHAIR_Y:function(){return AB},LIST_CLASS:function(){return dB},LIST_ITEM_CLASS:function(){return yB},MARKER_CLASS:function(){return gB},NAME_CLASS:function(){return mB},TITLE_CLASS:function(){return pB},VALUE_CLASS:function(){return vB}});var C={};r.r(C),r.d(C,{Action:function(){return kF},BRUSH_FILTER_EVENTS:function(){return xQ},Chart:function(){return fG},ComponentController:function(){return hG},Coordinate:function(){return OR},DIRECTION:function(){return Mj},ELEMENT_RANGE_HIGHLIGHT_EVENTS:function(){return DV},Element:function(){return wG},Event:function(){return rG},Facet:function(){return _F},Geometry:function(){return FG},GeometryLabel:function(){return qG},Interaction:function(){return dz},InteractionAction:function(){return kF},LAYER:function(){return Oj},Scale:function(){return qO},TooltipController:function(){return pG},Util:function(){return yU},VERSION:function(){return dU},VIEW_LIFE_CIRCLE:function(){return Nj},View:function(){return cG},getActionClass:function(){return OF},getAnimation:function(){return yG},getEngine:function(){return Vj},getFacet:function(){return EF},getGeometryLabel:function(){return EG},getGeometryLabelLayout:function(){return kG},getInteraction:function(){return Sz},getShapeFactory:function(){return NG},getTheme:function(){return Gz},registerAction:function(){return MF},registerAnimation:function(){return gG},registerComponentController:function(){return tG},registerEngine:function(){return Qj},registerFacet:function(){return CF},registerGeometry:function(){return lG},registerGeometryLabel:function(){return CG},registerGeometryLabelLayout:function(){return IG},registerInteraction:function(){return Ez},registerShape:function(){return LG},registerShapeFactory:function(){return PG},registerTheme:function(){return Uz}});var k=r(3331),I=r.n(k),T={values:[],set:function(t){return this.values=t,this.values},add:function(t){return this.values.push(t),this.values}},O=(r(5246),r(1358),r(3678)),M=r.n(O);function P(t){"@babel/helpers - typeof";return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function L(t,e){for(var r=0;r0&&(r=parseFloat(t.toPrecision(e))),r},format:function(t,e,r,n){e=void 0!==e?e:0,r=void 0!==r?r:D.thousandsSeparator,n=void 0!==n?n:D.decimalSeparator,null!=e&&(t=parseFloat(t.toFixed(e)));var i=t.toString().split(".");1===i.length&&null==e&&(e=0);var o,a=i[0];if(r)for(var s=/(-?[0-9]+)([0-9]{3})/;s.test(a);)a=a.replace(s,"$1"+r+"$2");if(0==e)o=a;else{var u=i.length>1?i[1]:"0";null!=e&&(u+=new Array(e-u.length+1).join("0")),o=a+n+u}return o}};Number.prototype.limitSigDigs||(Number.prototype.limitSigDigs=function(t){return D.limitSigDigs(this,t)});var B={bind:function(t,e){var r=Array.prototype.slice.apply(arguments,[2]);return function(){var n=r.concat(Array.prototype.slice.apply(arguments,[0]));return t.apply(e,n)}},bindAsEventListener:function(t,e){return function(r){return t.call(e,r||window.event)}},False:function(){return!1},True:function(){return!0},Void:function(){}},F={filter:function(t,e,r){var n=[];if(Array.prototype.filter)n=t.filter(e,r);else{var i=t.length;if("function"!=typeof e)throw new TypeError;for(var o=0;o-1||i.indexOf("trident")>-1&&i.indexOf("rv")>-1?(e="msie",t=i.match(/msie ([\d.]+)/)||i.match(/rv:([\d.]+)/)):i.indexOf("chrome")>-1?(e="chrome",t=i.match(/chrome\/([\d.]+)/)):i.indexOf("firefox")>-1?(e="firefox",t=i.match(/firefox\/([\d.]+)/)):i.indexOf("opera")>-1?(e="opera",t=i.match(/version\/([\d.]+)/)):i.indexOf("safari")>-1&&(e="safari",t=i.match(/version\/([\d.]+)/)),r=t?t[1]:"",i.indexOf("ipad")>-1||i.indexOf("ipod")>-1||i.indexOf("iphone")>-1?n="apple":i.indexOf("android")>-1&&(r=(t=i.match(/version\/([\d.]+)/))?t[1]:"",n="android"),{name:e,version:r,device:n}}(),J=(W=!0,q=K,document.createElement("canvas").getContext?("firefox"===q.name&&parseFloat(q.version)<5&&(W=!1),"safari"===q.name&&parseFloat(q.version)<4&&(W=!1),"opera"===q.name&&parseFloat(q.version)<10&&(W=!1),"msie"===q.name&&parseFloat(q.version)<9&&(W=!1)):W=!1,W),Z=-1===(X=navigator.userAgent.toLowerCase()).indexOf("webkit")&&-1!==X.indexOf("gecko"),$={assign:function(t){for(var e=0;e=0;r--)t[r]===e&&t.splice(r,1);return t},indexOf:function(t,e){if(null==t)return-1;if("function"==typeof t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r=0&&parseFloat(s)<1?(t.style.filter="alpha(opacity="+100*s+")",t.style.opacity=s):1===parseFloat(s)&&(t.style.filter="",t.style.opacity="")},applyDefaults:function(t,e){t=t||{};var r="function"==typeof window.Event&&e instanceof window.Event;for(var n in e)(void 0===t[n]||!r&&e.hasOwnProperty&&e.hasOwnProperty(n)&&!t.hasOwnProperty(n))&&(t[n]=e[n]);return!r&&e&&e.hasOwnProperty&&e.hasOwnProperty("toString")&&!t.hasOwnProperty("toString")&&(t.toString=e.toString),t},getParameterString:function(t){var e=[];for(var r in t){var n,i=t[r];if(null!=i&&"function"!=typeof i)n=Array.isArray(i)||"[object Object]"===i.toString()?encodeURIComponent(JSON.stringify(i)):encodeURIComponent(i),e.push(encodeURIComponent(r)+"="+n)}return e.join("&")},urlAppend:function(t,e){var r=t;if(e){0===e.indexOf("?")&&(e=e.substring(1));var n=(t+" ").split(/[?&]/);r+=" "===n.pop()?e:n.length?"&"+e:"?"+e}return r},urlPathAppend:function(t,e){var r=t;if(!e)return r;0===e.indexOf("/")&&(e=e.substring(1));var n=t.split("?");return n[0].indexOf("/",n[0].length-1)<0&&(n[0]+="/"),r="".concat(n[0]).concat(e).concat(n.length>1?"?".concat(n[1]):"")},DEFAULT_PRECISION:14,toFloat:function(t,e){return null==e&&(e=$.DEFAULT_PRECISION),"number"!=typeof t&&(t=parseFloat(t)),0===e?t:parseFloat(t.toPrecision(e))},rad:function(t){return t*Math.PI/180},getParameters:function(t){t=null===t||void 0===t?window.location.href:t;var e="";if(R.contains(t,"?")){var r=t.indexOf("?")+1,n=R.contains(t,"#")?t.indexOf("#"):t.length;e=t.substring(r,n)}for(var i={},o=e.split(/[&;]/),a=0,s=o.length;a1?1/t:t},getResolutionFromScale:function(t,e){var r;t&&(null==e&&(e="degrees"),r=1/($.normalizeScale(t)*tt[e]*96));return r},getScaleFromResolution:function(t,e){return null==e&&(e="degrees"),t*tt[e]*96},getBrowser:function(){return K},isSupportCanvas:J,supportCanvas:function(){return $.isSupportCanvas},isInTheSameDomain:function(t){return!t||(-1===t.indexOf("//")||$.isSameDomain(t,document.location.toString()))},isSameDomain:function(t,e){return new(Q())(t).normalize().origin()===new(Q())(e).normalize().origin()},calculateDpi:function(t,e,r,n,i){if(t&&e&&r){var o,a=t.getWidth(),s=t.getHeight(),u=e.w,l=e.h;if(i=i||6378137,"degree"===(n=n||"degrees").toLowerCase()||"degrees"===n.toLowerCase()||"dd"===n.toLowerCase()){var c=a/u,f=s/l;o=254/(c>f?c:f)/r/(2*Math.PI*i/360)/1e4}else{o=254/(a/u)/r/1e4}return o}},toJSON:function(t){var e=t;if(null==e)return null;switch(e.constructor){case String:return e=(e=(e=(e=(e=(e=(e='"'+e.replace(/(["\\])/g,"\\$1")+'"').replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace("<","<")).replace(">",">")).replace(/%/g,"%25")).replace(/&/g,"%26");case Array:for(var r="",n=0,i=e.length;n0?"{"+u.join(",")+"}":"{}"}return e.toString()}},getResolutionFromScaleDpi:function(t,e,r,n){return n=n||6378137,r=r||"",t>0&&e>0?(t=$.normalizeScale(t),"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/e/t/(2*Math.PI*n/360)/1e4:254/e/t/1e4):-1},getScaleFromResolutionDpi:function(t,e,r,n){return n=n||6378137,r=r||"",t>0&&e>0?"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/e/t/(2*Math.PI*n/360)/1e4:254/e/t/1e4:-1},transformResult:function(t){return t.responseText&&"string"==typeof t.responseText&&(t=JSON.parse(t.responseText)),t},copyAttributes:function(t,e){if(t=t||{},e)for(var r in e){var n=e[r];void 0!==n&&"CLASS_NAME"!==r&&"function"!=typeof n&&(t[r]=n)}return t},copyAttributesWithClip:function(t,e,r){if(t=t||{},e)for(var n in e){var i=!1;if(r&&r.length)for(var o=0,a=r.length;o=0&&o<=1&&i<=1&&o>=0?new H.Point(t.x+i*(e.x-t.x),t.y+i*(e.y-t.y)):"No Intersection";else if(0==s&&0==u){var c=Math.max(t.y,e.y),f=Math.min(t.y,e.y),h=Math.max(t.x,e.x),p=Math.min(t.x,e.x);a=(r.y>=f&&r.y<=c||n.y>=f&&n.y<=c)&&r.x>=p&&r.x<=h||n.x>=p&&n.x<=h?"Coincident":"Parallel"}else a="Parallel";return a},getTextBounds:function(t,e,r){document.body.appendChild(r),r.style.width="auto",r.style.height="auto",t.fontSize&&(r.style.fontSize=t.fontSize),t.fontFamily&&(r.style.fontFamily=t.fontFamily),t.fontWeight&&(r.style.fontWeight=t.fontWeight),r.style.position="relative",r.style.visibility="hidden",r.style.display="inline-block",r.innerHTML=e;var n=r.clientWidth,i=r.clientHeight;return document.body.removeChild(r),{textWidth:n,textHeight:i}},convertPath:function(t,e){return e?t.replace(/\{([\w-\.]+)\}/g,function(t,r){var n;return n=e.hasOwnProperty(r)?function(t){if(void 0==t||null==t)return"";if(t instanceof Date)return t.toJSON();if(function(t){if("string"!=typeof t&&"object"!==Y(t))return!1;try{var e=t.toString();return"[object Object]"===e||"[object Array]"===e}catch(t){return!1}}(t))return JSON.stringify(t);return t.toString()}(e[r]):t,encodeURIComponent(n)}):t}},tt={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};tt.in=tt.inches,tt.degrees=tt.dd,tt.nmi=1852*tt.m;var et=.0254000508001016;$.extend(tt,{Inch:tt.inches,Meter:39.37,Foot:12,IFoot:11.999976,ClarkeFoot:11.999868327581488,SearsFoot:11.999955194477684,GoldCoastFoot:11.999964589846002,IInch:.9999979999999999,MicroInch:999998e-9,Mil:9.99998e-7,Centimeter:.3937,Kilometer:39370,Yard:36,SearsYard:35.99986558343306,IndianYard:35.99987015540864,IndianYd37:35.999740205100004,IndianYd62:35.999880755999996,IndianYd75:35.999868945,IndianFoot:11.9999567087,IndianFt37:11.9999134017,IndianFt62:11.999960252000001,IndianFt75:11.999956315,Mile:63360,IYard:35.999928,IMile:63359.87328,NautM:72913.24,"Lat-66":4367838.370169282,"Lat-83":4367954.152606599,Decimeter:3.9370000000000003,Millimeter:.03937,Dekameter:393.7,Decameter:393.7,Hectometer:3937,GermanMeter:39.370535294205006,CaGrid:39.359685060000004,ClarkeChain:791.991309620512,GunterChain:792.0000000000001,BenoitChain:791.9977268035781,SearsChain:791.9970428354235,ClarkeLink:7.91991309620512,GunterLink:7.920000000000001,BenoitLink:7.919977268035781,SearsLink:7.919970428354236,Rod:198.00000000000014,IntnlChain:791.998416,IntnlLink:7.91998416,Perch:198.00000000000014,Pole:198.00000000000014,Furlong:7919.999999999997,Rood:148.75036777426,CapeFoot:11.999868185255002,Brealey:14763.75,ModAmFt:12.000458400000001,Fathom:71.999856,"NautM-UK":72959.85408,"50kilometers":1968500,"150kilometers":5905500}),$.extend(tt,{mm:tt.Meter/1e3,cm:tt.Meter/100,dm:100*tt.Meter,km:1e3*tt.Meter,kmi:tt.nmi,fath:tt.Fathom,ch:tt.IntnlChain,link:tt.IntnlLink,"us-in":tt.inches,"us-ft":tt.Foot,"us-yd":tt.Yard,"us-ch":tt.GunterChain,"us-mi":tt.Mile,"ind-yd":tt.IndianYd37,"ind-ft":tt.IndianFt37,"ind-ch":791.9942845122}),tt.degree=tt.dd,tt.meter=tt.m,tt.foot=tt.ft,tt.inch=tt.inches,tt.mile=tt.mi,tt.kilometer=tt.km,tt.yard=tt.yd;var rt,nt,it=window.fetch,ot={limitLength:1500,queryKeys:[],queryValues:[],supermap_callbacks:{},addQueryStrings:function(t){for(var e in t){this.queryKeys.push(e),"string"!=typeof t[e]&&(t[e]=$.toJSON(t[e]));var r=encodeURIComponent(t[e]);this.queryValues.push(r)}},issue:function(t){for(var e=this,r=e.getUid(),n=t.url,i=[],o=n,a=0,s=e.queryKeys?e.queryKeys.length:0,u=0;u=e.limitLength){if(0==a)return!1;i.push(o),o=n,a=0,u--}else if(o.length+e.queryKeys[u].length+2+e.queryValues[u].length>e.limitLength)for(var l=e.queryValues[u];l.length>0;){var c=e.limitLength-o.length-e.queryKeys[u].length-2;o.indexOf("?")>-1?o+="&":o+="?";var f=l.substring(0,c);"%"===f.substring(c-1,c)?(c-=1,f=l.substring(0,c)):"%"===f.substring(c-2,c-1)&&(c-=2,f=l.substring(0,c)),o+=e.queryKeys[u]+"="+f,l=l.substring(c),f.length>0&&(i.push(o),o=n,a=0)}else a++,o.indexOf("?")>-1?o+="&":o+="?",o+=e.queryKeys[u]+"="+e.queryValues[u];return i.push(o),e.send(i,"SuperMapJSONPCallbacks_"+r,t&&t.proxy)},getUid:function(){return 1e3*(new Date).getTime()+Math.floor(1e17*Math.random())},send:function(t,e,r){var n=t.length;if(n>0)return new Promise(function(i){for(var o=(new Date).getTime(),a=0;a-1?s+="&":s+="?",s+="sectionCount="+n,s+="§ionIndex="+a,s+="&jsonpUserID="+o,r&&(s=decodeURIComponent(s),s=r+encodeURIComponent(s)),M()(s,{jsonpCallbackFunction:e,timeout:3e4}).then(function(t){i(t.json())})}})},GET:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings(t.params),this.issue(t)},POST:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:t.data}),this.issue(t)},PUT:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:t.data}),this.issue(t)},DELETE:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:t.data}),this.issue(t)}},at=function(){return void 0!=rt?rt:window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest},st=function(){return nt||45e3},ut={commit:function(t,e,r,n){switch(t=t?t.toUpperCase():t){case"GET":return this.get(e,r,n);case"POST":return this.post(e,r,n);case"PUT":return this.put(e,r,n);case"DELETE":return this.delete(e,r,n);default:return this.get(e,r,n)}},supportDirectRequest:function(t,e){return!!$.isInTheSameDomain(t)||(void 0!=e.crossOrigin?e.crossOrigin:at()||e.proxy)},get:function(t,e,r){r=r||{};if(t=$.urlAppend(t,this._getParameterString(e||{})),t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){var n={url:t=t.replace(".json",".jsonp"),data:e};return ot.GET(n)}return this.urlIsLong(t)?this._postSimulatie("GET",t.substring(0,t.indexOf("?")),e,r):this._fetch(t,e,r,"GET")},delete:function(t,e,r){r=r||{};if(t=$.urlAppend(t,this._getParameterString(e||{})),t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){t=t.replace(".json",".jsonp");var n={url:t+="&_method=DELETE",data:e};return ot.DELETE(n)}return this.urlIsLong(t)?this._postSimulatie("DELETE",t.substring(0,t.indexOf("?")),e,r):this._fetch(t,e,r,"DELETE")},post:function(t,e,r){if(r=r||{},t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){t=t.replace(".json",".jsonp");var n={url:$.urlAppend(t,"_method=POST"),data:e};return ot.POST(n)}return this._fetch(t,e,r,"POST")},put:function(t,e,r){if(r=r||{},t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){t=t.replace(".json",".jsonp");var n={url:t+="&_method=PUT",data:e};return ot.PUT(n)}return this._fetch(t,e,r,"PUT")},urlIsLong:function(t){for(var e=0,r=null,n=0,i=t.length;n-1?"&":"?")+"_method="+t,"string"!=typeof r&&(r=JSON.stringify(r)),this.post(e,r,n)},_processUrl:function(t,e){if(this._isMVTRequest(t))return t;if(-1===t.indexOf(".json")&&!e.withoutFormatSuffix)if(t.indexOf("?")<0)t+=".json";else{var r=t.split("?");2===r.length&&(t=r[0]+".json?"+r[1])}return e&&e.proxy&&("function"==typeof e.proxy?t=e.proxy(t):(t=decodeURIComponent(t),t=e.proxy+encodeURIComponent(t))),t},_fetch:function(t,e,r,n){return(r=r||{}).headers=r.headers||{},r.headers["Content-Type"]||FormData.prototype.isPrototypeOf(e)||(r.headers["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8"),r.timeout?this._timeout(r.timeout,it(t,{method:n,headers:r.headers,body:"PUT"===n||"POST"===n?e:void 0,credentials:this._getWithCredentials(r),mode:"cors",timeout:st()}).then(function(t){return t})):it(t,{method:n,body:"PUT"===n||"POST"===n?e:void 0,headers:r.headers,credentials:this._getWithCredentials(r),mode:"cors",timeout:st()}).then(function(t){return t})},_getWithCredentials:function(t){return!0===t.withCredentials?"include":!1===t.withCredentials?"omit":"same-origin"},_fetchJsonp:function(t,e){return e=e||{},M()(t,{method:"GET",timeout:e.timeout}).then(function(t){return t})},_timeout:function(t,e){return new Promise(function(r,n){setTimeout(function(){n(new Error("timeout"))},t),e.then(r,n)})},_getParameterString:function(t){var e=[];for(var r in t){var n,i=t[r];if(null!=i&&"function"!=typeof i)n=Array.isArray(i)||"[object Object]"===i.toString()?encodeURIComponent(JSON.stringify(i)):encodeURIComponent(i),e.push(encodeURIComponent(r)+"="+n)}return e.join("&")},_isMVTRequest:function(t){return t.indexOf(".mvt")>-1||t.indexOf(".pbf")>-1}},lt=r(7915);function ct(t,e){t&&-1===t.indexOf("BEGIN PUBLIC KEY")&&(t="-----BEGIN PUBLIC KEY-----\n".concat(t,"\n-----END PUBLIC KEY-----"));var r=lt.pki.publicKeyFromPem(t),n={md:lt.md.sha256.create(),mgf1:{md:lt.md.sha1.create()}},i=r.encrypt(e,"RSA-OAEP",n);return!!i&&window.btoa(i)}function ft(t,e,r){r=lt.util.encodeUtf8(r);var n=lt.cipher.createCipher("AES-GCM",t);if(n.start({iv:e,additionalData:"",tagLength:128}),n.update(lt.util.createBuffer(r)),n.finish()){var i=n.output,o=n.mode.tag;return window.btoa(i.data+o.data)}return!1}function ht(t){for(var e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",r="",n=t;n>0;--n)r+=e[Math.floor(Math.random()*e.length)];return r}function pt(t){"@babel/helpers - typeof";return(pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dt(){dt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new O(n||[]);return i(a,"_invoke",{value:C(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",g={};function v(){}function m(){}function b(){}var A={};l(A,a,function(){return this});var x=Object.getPrototypeOf,w=x&&x(x(M([])));w&&w!==r&&n.call(w,a)&&(A=w);var _=b.prototype=v.prototype=Object.create(A);function S(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function E(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==pt(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function C(e,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function yt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return gt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gt(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r 1 ? 1 : y;},toY:function(y){return (0.5-y)*"+s+"+"+o+";}}"],{type:"text/javascript"}))}},{key:"getPaintProperty",value:function(t,r){var n=this.overlayLayersManager[t];return n?n.getPaintProperty?n.getPaintProperty(r):void 0:e.getPaintProperty.call(this,t,r)}},{key:"getLayoutProperty",value:function(t,r){var n=this.overlayLayersManager[t];return n?n.getLayoutProperty?n.getLayoutProperty(r):void 0:e.getLayoutProperty.call(this,t,r)}},{key:"getFilter",value:function(t,r,n){var i=this.overlayLayersManager[t];return i?i.getFilter?i.getFilter(r,n):void 0:e.getFilter.call(this,t,r,n)}},{key:"setFilter",value:function(t,r,n){var i=this.overlayLayersManager[t];return i?(i.setFilter&&i.setFilter(r,n),this):e.setFilter.call(this,t,r,n)}},{key:"on",value:function(t,e,r){return this._eventsModeHandler({type:t,layerId:e,listener:r,mode:"on"})}},{key:"once",value:function(t,e,r){return this._eventsModeHandler({type:t,layerId:e,listener:r,mode:"once"})}},{key:"off",value:function(t,e,r){return this._eventsModeHandler({type:t,layerId:e,listener:r,mode:"off"})}},{key:"queryRenderedFeatures",value:function(t,r){var n,i=this,o=Object.keys(this.overlayLayersManager);r&&r.layers&&(o=r.layers.filter(function(t){return i.overlayLayersManager[t]}),n=r.layers.filter(function(t){return!i.overlayLayersManager[t]}));var a=t||[[0,0],[this.transform.width,this.transform.height]],s=r||{};delete s.layers;var u=o.reduce(function(t,e){var r=i.overlayLayersManager[e];return r.query&&r.queryRenderedFeatures&&r.queryRenderedFeatures(a,s,function(e){t=t.concat(e)}),t},[]);return e.queryRenderedFeatures.call(this,t,Ot(Ot({},r),{},{layers:n})).concat(u)}},{key:"querySourceFeatures",value:function(t,r){var n=Object.values(this.overlayLayersManager).find(function(e){return e.sourceId===t&&e instanceof kt});return n?n.query?n.querySourceFeatures(r):void 0:e.querySourceFeatures.call(this,t,r)}},{key:"getSource",value:function(t){var r=Object.values(this.overlayLayersManager).find(function(e){return e.sourceId===t&&e instanceof kt});return r?r.getSource():e.getSource.call(this,t)}},{key:"removeSource",value:function(t){var r=Object.values(this.overlayLayersManager).find(function(e){return e.sourceId===t&&e instanceof kt});return r?r.removeSource():e.removeSource.call(this,t)}},{key:"isSourceLoaded",value:function(t){var r=Object.values(this.overlayLayersManager).find(function(e){return e.sourceId===t&&e instanceof kt});return r?r.isSourceLoaded():e.isSourceLoaded.call(this,t)}},{key:"_eventsModeHandler",value:function(t){var r=this,n=t.type,i=t.layerId,o=t.listener,a=t.mode,s=[];o&&(s=s.concat(i)),s.forEach(function(t){var e=r.overlayLayersManager[t]||{};e.interaction&&e[a]&&e.events.includes(n)&&e[a](n,o||i)});var u=o&&s.filter(function(t){return!r.overlayLayersManager[t]});if(u&&!u.length)return this;var l=u&&"string"!=typeof i?u:i;return e[a].call(this,n,l,o)}},{key:"_moveToHandler",value:function(e,r){var n,i=document.getElementById(e);r&&((n=document.getElementById(r))||t.Evented.prototype.fire("error",{error:new Error('Layer with id "'.concat(r,'" does not exist on this document.'))})),i&&(n?n.parentNode.insertBefore(i,n):i.parentNode.appendChild(i))}}])&&Nt(i.prototype,o),a&&Nt(i,a),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,o,a}()}function zt(t){"@babel/helpers - typeof";return(zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gt(t,e){for(var r=0;r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function Wt(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}var qt,Xt;I().VectorTileSource&&void 0===I().VectorTileSource.prototype.beforeLoadBak&&(I().VectorTileSource.prototype.beforeLoadBak=I().VectorTileSource.prototype.beforeLoad,I().VectorTileSource.prototype.beforeLoad=(qt=Yt().mark(function t(e,r){var n,i;return Yt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r&&r.tiles&&r.tiles[0],!T.values.includes(e)||!n){t.next=6;break}return t.next=4,wt(n);case 4:(i=t.sent)&&(this.decryptOptions={key:i.serviceKey,algorithm:i.algorithm});case 6:this.beforeLoadBak(e,r);case 7:case"end":return t.stop()}},t,this)}),Xt=function(){var t=this,e=arguments;return new Promise(function(r,n){var i=qt.apply(t,e);function o(t){Wt(i,r,n,o,a,"next",t)}function a(t){Wt(i,r,n,o,a,"throw",t)}o(void 0)})},function(t,e){return Xt.apply(this,arguments)})),I().Map.prototype._inherit||(I().Map=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Ht(this,e,[t])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qt(t,e)}(e,Ft(I())),r=e,n&&Gt(r.prototype,n),i&&Gt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}(), -// 防止引入多个 iclient-mapboxgl 导致死循环 -I().Map.prototype._inherit=!0);function Kt(t){"@babel/helpers - typeof";return(Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jt(t,e){for(var r=0;r";return this._container.innerHTML=a?""+s+"":s,this._createStyleSheet(),this._container}},{key:"_createStyleSheet",value:function(){var t=document.createElement("style");t.type="text/css",t.innerHTML=".iclient-logo{margin:0 !important;}.iclient-logo a{border: none;display: block;height:31px;}.iclient-logo img{border: none;white-space: nowrap}",document.getElementsByTagName("head")[0].appendChild(t)}},{key:"_extend",value:function(t){for(var e=0;et.right;)e.lon-=t.getWidth()}return e}},{key:"destroy",value:function(){this.lon=null,this.lat=null}}])&&le(e.prototype,r),n&&le(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function he(t){"@babel/helpers - typeof";return(he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pe(t,e){for(var r=0;rthis.right)&&(this.right=r.right),(null==this.top||r.top>this.top)&&(this.top=r.top))}}},{key:"containsLonLat",value:function(t,e){"boolean"==typeof e&&(e={inclusive:e}),e=e||{};var r=this.contains(t.lon,t.lat,e.inclusive),n=e.worldBounds;if(n&&!r){var i=n.getWidth(),o=(n.left+n.right)/2,a=Math.round((t.lon-o)/i);r=this.containsLonLat({lon:t.lon-a*i,lat:t.lat},{inclusive:e.inclusive})}return r}},{key:"containsPixel",value:function(t,e){return this.contains(t.x,t.y,e)}},{key:"contains",value:function(t,e,r){if(null==r&&(r=!0),null==t||null==e)return!1;var n=!1;return n=r?t>=this.left&&t<=this.right&&e>=this.bottom&&e<=this.top:t>this.left&&tthis.bottom&&e=r.bottom&&t.bottom<=r.top||r.bottom>=t.bottom&&r.bottom<=t.top,a=t.top>=r.bottom&&t.top<=r.top||r.top>t.bottom&&r.top=r.left&&t.left<=r.right||r.left>=t.left&&r.left<=t.right,u=t.right>=r.left&&t.right<=r.right||r.right>=t.left&&r.right<=t.right;n=(o||a)&&(s||u)}if(e.worldBounds&&!n){var l=e.worldBounds,c=l.getWidth(),f=!l.containsBounds(r),h=!l.containsBounds(t);f&&!h?(t=t.add(-c,0),n=r.intersectsBounds(t,{inclusive:e.inclusive})):h&&!f&&(r=r.add(-c,0),n=t.intersectsBounds(r,{inclusive:e.inclusive}))}return n}},{key:"containsBounds",value:function(t,e,r){null==e&&(e=!1),null==r&&(r=!0);var n=this.contains(t.left,t.bottom,r),i=this.contains(t.right,t.bottom,r),o=this.contains(t.left,t.top,r),a=this.contains(t.right,t.top,r);return e?n||i||o||a:n&&i&&o&&a}},{key:"determineQuadrant",value:function(t){var e="",r=this.getCenterLonLat();return e+=t.lat=t.right&&i.right>t.right;)i=i.add(-o,0);var a=i.left+r;at.left&&i.right-n>t.right&&(i=i.add(-o,0))}return i}},{key:"toServerJSONObject",value:function(){return{rightTop:{x:this.right,y:this.top},leftBottom:{x:this.left,y:this.bottom},left:this.left,right:this.right,top:this.top,bottom:this.bottom}}},{key:"destroy",value:function(){this.left=null,this.right=null,this.top=null,this.bottom=null,this.centerLonLat=null}}])&&pe(e.prototype,r),n&&pe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function ge(t){"@babel/helpers - typeof";return(ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ve(t,e){for(var r=0;r-1)){if(null!=e&&e=0;--r)e=this.removeComponent(t[r])||e;return e}},{key:"removeComponent",value:function(t){return $.removeItem(this.components,t),this.clearBounds(),!0}},{key:"getArea",value:function(){for(var t=0,e=0,r=this.components.length;e=1?1:v)<=-1?-1:v,c=180*Math.acos(v)/Math.PI,a=(c=i.x==r.x?e.x>r.x&&n.x>r.x||e.xh*e.x+p&&n.y>h*n.x+p||e.yr.y?n.xr.x&&(s=!1):i.xh*n.x+p&&(s=!1):i.x>r.x?n.y>r.y&&(s=!1):n.y=0?180*Math.atan(m)/Math.PI:Math.abs(180*Math.atan(m)/Math.PI)+90,A=Math.abs(e.y);r.y==A&&A==i.y&&r.x=0?m>=0?l+=u:l=180-(l-90)+u:l=m>0?l-180+u:90-l+u:x>=0?m>=0?l-=u:l=180-(l-90)-u:l=m>=0?l-180-u:90-l-u,l=l*Math.PI/180;var _=e.x+o*Math.cos(l),S=e.y+o*Math.sin(l);f.push(new _e(_,S))}f.push(i)}return f}},{key:"createLineEPS",value:function(t){var r=[],n=t.length;if(n<2)return t;for(var i=0;i2;return r&&Ke(Je(e.prototype),"removeComponent",this).apply(this,arguments),r}},{key:"getSortedSegments",value:function(){for(var t,e,r=this.components.length-1,n=new Array(r),i=0;i3;if(r){this.components.pop(),ir(or(e.prototype),"removeComponent",this).apply(this,arguments);var n=this.components[0];ir(or(e.prototype),"addComponent",this).apply(this,[n])}return r}},{key:"getArea",value:function(){var t=0;if(this.components&&this.components.length>2){for(var e=0,r=0,n=this.components.length;r0){t+=Math.abs(this.components[0].getArea());for(var e=1,r=this.components.length;e0&&r.push(","),r.push(this.writeNewline(),this.writeIndent(),e));return this.level-=1,r.push(this.writeNewline(),this.writeIndent(),"]"),r.join("")},string:function(t){var e={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(t)?'"'+t.replace(/([\x00-\x1f\\"])/g,function(t,r){var n=e[r];return n||(n=r.charCodeAt(),"\\u00"+Math.floor(n/16).toString(16)+(n%16).toString(16))})+'"':'"'+t+'"'},number:function(t){return isFinite(t)?String(t):"null"},boolean:function(t){return String(t)},date:function(t){function e(t){return t<10?"0"+t:t}return'"'+t.getFullYear()+"-"+e(t.getMonth()+1)+"-"+e(t.getDate())+"T"+e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())+'"'}},r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&zr(t,e)}(e,Nr),r=e,(n=[{key:"read",value:function(t,e){var r;if(this.nativeJSON)try{r=JSON.parse(t,e)}catch(e){return{data:t}}return this.keepData&&(this.data=r),r}},{key:"write",value:function(t,e){this.pretty=!!e;var r=null,n=jr(t);if(this.serialize[n])try{r=!this.pretty&&this.nativeJSON?JSON.stringify(t):this.serialize[n].apply(this,[t])}catch(t){}return r}},{key:"writeIndent",value:function(){var t=[];if(this.pretty)for(var e=0;e0))return null;for(var a=0,s=0,u=[];a0){t+='"points":[';for(var r=0,n=this.components.length;rt[o]){var a=t[o];t[o]=t[i],t[i]=a;var s=e[o];if(e[o]=e[i],e[i]=s,r&&r.length>0){var u=r[o];r[o]=r[i],r[i]=u}if(n&&n.length>0){var l=n[o];n[o]=n[i],n[i]=l}}}}],(r=[{key:"destroy",value:function(){var t=this;t.id=null,t.style=null,t.parts=null,t.partTopo=null,t.points=null,t.type=null,t.prjCoordSys=null}},{key:"toGeometry",value:function(){var t=this;switch(t.type.toUpperCase()){case kn.POINT:return t.toGeoPoint();case kn.LINE:return t.toGeoLine();case kn.LINEM:return t.toGeoLinem();case kn.REGION:return t.toGeoRegion();case kn.POINTEPS:return t.toGeoPoint();case kn.LINEEPS:return t.toGeoLineEPS();case kn.REGIONEPS:return t.toGeoRegionEPS();case kn.GEOCOMPOUND:return t.transformGeoCompound()}}},{key:"toGeoPoint",value:function(){var t=this.parts||[],e=this.points||[],r=t.length;if(r>0){if(1===r)return new _e(e[0].x,e[0].y);for(var n=[],i=0;i0){if(1===r){for(var n=[],i=0;i0){if(1===s){for(t=0,r=[];t=0;b--)if(v[m]=-1,f[b].containsBounds(f[m])){h[m]=-1*h[b],h[m]<0&&(v[m]=b);break}for(var A=0;A0?o.push(c[A]):(o[v[A]].components=o[v[A]].components.concat(c[A].components),o.push(""))}else{o=new Array;for(var x=0;x0&&o.length>0&&(o[o.length-1].components=o[o.length-1].components.concat(u),u=[]),o.push(c[x])),x==i-1){var w=o.length;if(w)o[w-1].components=o[w-1].components.concat(u);else for(var _=0,S=u.length;_=0;A--)if(m[b]=-1,h[A].containsBounds(h[b])){p[b]=-1*p[A],p[b]<0&&(m[b]=A);break}for(var x=0;x0?a.push(f[x]):(a[m[x]].components=a[m[x]].components.concat(f[x].components),a.push(""))}else{a=new Array;for(var w=0;w0&&a.length>0&&(a[a.length-1].components=a[a.length-1].components.concat(l),l=[]),a.push(f[w])),w==i-1){var _=a.length;if(_)a[_-1].components=a[_-1].components.concat(l);else for(var S=0,E=l.length;S-1||(e[n]=t[n]);return e}}])&&bi(r.prototype,n),i&&bi(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Ci(t){return"string"==typeof t&&t.constructor===String}function ki(t){return"[object Array]"===Object.prototype.toString.call(t)}function Ii(t){return"[object Object]"===Object.prototype.toString.call(t)}function Ti(t){return ki(t)&&2===t.length&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90}var Oi=JSON.parse('[{"name":"克拉玛依市","coord":[85.01486759299489,45.406422237230046]},{"name":"昌吉回族自治州","coord":[88.7154624754753,44.26991024636568]},{"name":"石河子市","coord":[86.0208600035924,44.239045558096805]},{"name":"霍林郭勒市","coord":[114.73479243733115,44.16058374713977]},{"name":"本溪市","coord":[124.64357865201586,41.177197783134275]},{"name":"嘉峪关市","coord":[98.16891560537093,39.76279786284264]},{"name":"莱芜市","coord":[117.65723565456207,36.27916499211527]},{"name":"神农架林区","coord":[110.48296222218153,31.581260143666697]},{"name":"天门市","coord":[113.00615321481195,30.64105781887143]},{"name":"鄂州市","coord":[114.94764081970385,30.325634953844585]},{"name":"潜江市","coord":[112.70703817700621,30.349210666019893]},{"name":"仙桃市","coord":[113.34688900729822,30.315951161935402]},{"name":"萍乡市","coord":[113.88072263074415,27.47193090553213]},{"name":"台湾省","coord":[120.14338943402045,23.596002465926095]},{"name":"东莞市","coord":[113.89443658529342,22.897826158636448]},{"name":"中山市","coord":[113.37118387764659,22.501478858616522]},{"name":"珠海市","coord":[113.21799258934986,22.23782602992192]},{"name":"北海市","coord":[109.18248083043899,21.695773689750148]},{"name":"香港","coord":[114.20689279508653,22.36016760139811]},{"name":"舟山市","coord":[122.22514712841459,30.338633120695956]},{"name":"克孜勒苏柯尔克孜","coord":[74.62910472637343,39.59886016069875]},{"name":"喀什地区","coord":[77.19899922143753,37.85462871211595]},{"name":"阿克苏地区","coord":[81.43930290016381,41.067304799230456]},{"name":"和田地区","coord":[80.69780509160952,36.95287032287055]},{"name":"阿里地区","coord":[82.536487505389,32.69566569631762]},{"name":"日喀则地区","coord":[86.5996831353606,29.54861754814263]},{"name":"那曲地区","coord":[88.32523292667608,33.20600450932715]},{"name":"玉树藏族自治州","coord":[95.2107128446203,33.90320387919257]},{"name":"迪庆藏族自治州","coord":[99.42465312188943,28.052797714348895]},{"name":"怒江傈傈族自治州","coord":[98.85737910439825,26.98345757528851]},{"name":"大理白族自治州","coord":[99.93934374816013,25.684737357453045]},{"name":"德宏傣族景颇族自","coord":[98.13830877778075,24.593421919561205]},{"name":"保山市","coord":[99.19031013453166,24.979380341662]},{"name":"临沧市","coord":[99.62483778975081,24.058807858948214]},{"name":"普洱市","coord":[100.94440267992684,23.44121660743221]},{"name":"西双版纳傣族自治","coord":[100.86105801845994,21.882475641324206]},{"name":"拉萨市","coord":[91.3684790613129,30.14176592960237]},{"name":"山南地区","coord":[92.11665242621062,28.33000201578789]},{"name":"林芝地区","coord":[94.9307847458166,29.125110156601963]},{"name":"昌都地区","coord":[97.33912235873476,30.48520825551814]},{"name":"丽江市","coord":[100.65713436205135,26.96190318191959]},{"name":"攀枝花市","coord":[101.73355913301131,26.714486678752795]},{"name":"凉山彝族自治州","coord":[102.08678551422615,27.683020519860396]},{"name":"楚雄彝族自治州","coord":[101.68264761198458,25.369603845264024]},{"name":"红河哈尼族彝族自","coord":[102.95101719613119,23.624860095239875]},{"name":"文山壮族苗族自治","coord":[104.8708359910614,23.579587266862504]},{"name":"百色市","coord":[106.69546907589859,23.98220841166522]},{"name":"崇左市","coord":[107.3277087317123,22.49769755349952]},{"name":"防城港市","coord":[107.88939931155171,21.94550204069006]},{"name":"南宁市","coord":[108.67078983716917,23.12207641861882]},{"name":"钦州市","coord":[108.8532307305186,22.157690108421384]},{"name":"玉林市","coord":[110.26918466489103,22.391823643610415]},{"name":"湛江市","coord":[109.93033457863683,21.086751055633457]},{"name":"茂名市","coord":[110.80336192333934,22.069184739040775]},{"name":"阳江市","coord":[111.70471342186183,22.108751366417575]},{"name":"江门市","coord":[112.53715618649149,22.297368082806777]},{"name":"广州市","coord":[113.4949302208309,23.28359314707863]},{"name":"清远市","coord":[113.10957368131268,24.334444053233856]},{"name":"肇庆市","coord":[112.11117530204233,23.60241158796112]},{"name":"梧州市","coord":[111.01709510772797,23.518132876753846]},{"name":"贺州市","coord":[111.50423061842756,24.4095096817199]},{"name":"桂林市","coord":[110.44046163393094,25.353966673735407]},{"name":"柳州市","coord":[109.34854449214147,24.972408051485047]},{"name":"河池市","coord":[107.81191841865586,24.649291651298164]},{"name":"黔东南苗族侗族自","coord":[108.39952601614591,26.429286420465576]},{"name":"贵阳市","coord":[106.59784062851153,26.797907456479816]},{"name":"安顺市","coord":[105.76161265300635,25.988644902171018]},{"name":"黔西南布依族苗族","coord":[105.5954078788574,25.404850939549405]},{"name":"曲靖市","coord":[103.9164335632742,25.697243690315265]},{"name":"六盘水市","coord":[104.77723228072432,26.15402255629164]},{"name":"毕节地区","coord":[105.03867422931839,27.077913968069666]},{"name":"昭通市","coord":[104.29730513046874,27.62418247971078]},{"name":"宜宾市","coord":[104.76748901448207,28.553501804266475]},{"name":"乐山市","coord":[103.56027669102787,29.160754519210577]},{"name":"自贡市","coord":[104.63272827056402,29.273152614922402]},{"name":"内江市","coord":[104.82644562304716,29.61272653799929]},{"name":"遵义市","coord":[106.82413636302059,28.191847588570702]},{"name":"达州市","coord":[107.59704170009518,31.32138258839703]},{"name":"遂宁市","coord":[105.48979445433736,30.677687821242678]},{"name":"广安市","coord":[106.56708164098042,30.43500706741521]},{"name":"泸州市","coord":[105.42591761727707,28.50277238478137]},{"name":"资阳市","coord":[104.97995126874034,30.154251886139654]},{"name":"雅安市","coord":[102.69931299964517,29.892630706195035]},{"name":"眉山市","coord":[104.07052881858888,29.894202166560405]},{"name":"甘孜藏族自治州","coord":[100.50721042614238,30.975216556269658]},{"name":"果洛藏族自治州","coord":[99.30775565051923,34.03539865224808]},{"name":"海南藏族自治州","coord":[100.39969108016373,35.90048272566899]},{"name":"黄南藏族自治州","coord":[101.5360706381689,35.10286360841902]},{"name":"赣南藏族自治州","coord":[102.97083885806067,34.326752803339026]},{"name":"陇南市","coord":[105.24780098912132,33.57031117443431]},{"name":"天水市","coord":[105.53503634660417,34.62320421368087]},{"name":"定西市","coord":[104.58787768541339,35.08900966621695]},{"name":"临夏回族自治州","coord":[103.2612870434902,35.591577124455235]},{"name":"西宁市","coord":[101.57680657999033,36.84800271717157]},{"name":"海东地区","coord":[102.30909850729282,36.287400615025646]},{"name":"海北藏族自治州","coord":[100.27122484450717,37.892557516083826]},{"name":"金昌市","coord":[102.02244049169511,38.497330414886164]},{"name":"酒泉市","coord":[95.94486678270127,40.56891536586272]},{"name":"海西蒙古族藏族自","coord":[94.67143298050689,36.022725148503724]},{"name":"巴音郭楞蒙古自治","coord":[88.18116214759745,39.556478810319916]},{"name":"哈密地区","coord":[93.84302392518026,42.95015211178875]},{"name":"叶鲁番地区","coord":[89.82035217277885,42.399368632283505]},{"name":"乌鲁木齐市","coord":[88.00048109561487,43.549986370786]},{"name":"阿勒泰地区","coord":[88.11213933257655,47.05593413019629]},{"name":"博尔塔拉蒙古自治","coord":[82.26402238163408,44.671135542630864]},{"name":"伊犁哈萨克自治州","coord":[82.80778717477179,43.53783381365267]},{"name":"阿拉善盟","coord":[103.29923966842289,40.10955801781495]},{"name":"武威市","coord":[102.73362058791429,37.94211141321436]},{"name":"兰州市","coord":[103.73793563506032,36.27379827886003]},{"name":"中卫市","coord":[105.6943786030716,37.20654236148948]},{"name":"银川市","coord":[106.20022174140034,38.52103167597483]},{"name":"石嘴山市","coord":[106.41544011793628,38.84054137571417]},{"name":"乌海市","coord":[106.8984175998405,39.54616572239788]},{"name":"鄂尔多斯市","coord":[108.43285571424619,39.24036799350715]},{"name":"巴彦淖尔市","coord":[107.45840392808307,41.30159860424196]},{"name":"包头市","coord":[110.46472193224272,41.48017783644221]},{"name":"呼和浩特市","coord":[111.48365173603975,40.498363056149884]},{"name":"乌兰察布市","coord":[112.61568977597707,41.75789561273154]},{"name":"大同市","coord":[113.7107192749083,39.898956799744184]},{"name":"朔州市","coord":[112.65428748167508,39.681772914701924]},{"name":"忻州市","coord":[112.36127575589583,38.88990233614568]},{"name":"榆林市","coord":[109.68473112169593,38.19921027134876]},{"name":"延安市","coord":[109.52425222161318,36.406522726136814]},{"name":"庆阳市","coord":[107.73052193155061,36.183821532624464]},{"name":"固原市","coord":[106.20191575442442,36.11634909496382]},{"name":"白银市","coord":[104.68634478137065,36.51582865625868]},{"name":"宝鸡市","coord":[107.33534779230747,34.3387216485855]},{"name":"汉中市","coord":[107.03534754266246,33.00142998064871]},{"name":"广元市","coord":[105.92928137563939,32.21872447205537]},{"name":"巴中市","coord":[107.03422410306194,31.99874720836291]},{"name":"南充市","coord":[106.32964805032347,31.156657700184095]},{"name":"绵阳市","coord":[104.58949560201106,31.88628780630976]},{"name":"德阳市","coord":[104.41542984932845,31.110558133718676]},{"name":"成都市","coord":[103.8852290010473,30.777258040348634]},{"name":"阿坝藏族羌族自治","coord":[102.26209319552814,32.45725845387284]},{"name":"安康市","coord":[109.14236501848015,32.77467694678074]},{"name":"十堰市","coord":[110.39934083416314,32.376209039347906]},{"name":"襄阳市","coord":[111.97539147094662,31.93399822417465]},{"name":"宜昌市","coord":[111.22204852395754,30.772457669035354]},{"name":"恩施市","coord":[109.42158366502872,30.260366574390105]},{"name":"张家界市","coord":[110.59760006538717,29.330107409240718]},{"name":"吉首市","coord":[109.72176899848378,28.681903937242495]},{"name":"铜仁地区","coord":[108.54247523485463,28.11736237519646]},{"name":"重庆市","coord":[107.86007108564992,30.186253395053196]},{"name":"怀化市","coord":[109.94325166787243,27.43919084801186]},{"name":"益阳市","coord":[112.43060358108062,28.75127294553697]},{"name":"娄底市","coord":[111.41891416951897,27.696312460064604]},{"name":"常德市","coord":[111.72571610131646,29.27189463838195]},{"name":"荆州市","coord":[112.65896596965268,30.05161542755362]},{"name":"荆门市","coord":[112.6586855902184,31.01267124474617]},{"name":"岳阳市","coord":[113.2595036144316,29.106247116930163]},{"name":"长沙市","coord":[113.15415586456598,28.222934680488425]},{"name":"湘潭市","coord":[112.51092596317824,27.69881544105668]},{"name":"株州市","coord":[113.49665538546823,27.03993794610501]},{"name":"衡阳市","coord":[112.48849636578527,26.783613569970782]},{"name":"邵阳市","coord":[110.6723832117475,26.81652287086792]},{"name":"永州市","coord":[111.8565364154186,25.768488267811968]},{"name":"韶关市","coord":[113.53420325850979,24.69848878771937]},{"name":"惠州市","coord":[114.32029589634925,23.25504544231892]},{"name":"佛山市","coord":[112.95925897403649,23.10116677189257]},{"name":"云浮市","coord":[111.78042514904234,22.840400494105687]},{"name":"深圳市","coord":[114.13138648919008,22.649563063468342]},{"name":"汕尾市","coord":[115.57412892884373,23.06989642104901]},{"name":"河源市","coord":[114.89746229844398,23.97971937124767]},{"name":"揭阳市","coord":[116.04290004239446,23.304802704715357]},{"name":"汕头市","coord":[116.7008461897183,23.35898625947344]},{"name":"潮州市","coord":[116.75405548481658,23.854381508863064]},{"name":"梅州市","coord":[116.13719397345734,24.15633544812716]},{"name":"漳州市","coord":[117.38279760543345,24.41111215459575]},{"name":"厦门市","coord":[118.04275971554665,24.675908246507944]},{"name":"龙岩市","coord":[116.69341144552507,25.20284542644492]},{"name":"泉州市","coord":[118.12035864630246,25.22984144365049]},{"name":"莆田市","coord":[118.82439690138142,25.439653480972687]},{"name":"福州市","coord":[119.1608285845262,25.99117532466728]},{"name":"三明市","coord":[117.51188176216434,26.318292906961602]},{"name":"南平市","coord":[118.16153136678187,27.306303151805437]},{"name":"抚州市","coord":[116.3455359885574,27.487043655935366]},{"name":"鹰潭市","coord":[117.01082360702333,28.241253742969946]},{"name":"吉安市","coord":[114.91377151807418,26.957486660664525]},{"name":"赣州市","coord":[115.046455717572,25.81565075681663]},{"name":"郴州市","coord":[113.1544526703492,25.871927095452524]},{"name":"新余市","coord":[114.94161795877827,27.79044654578371]},{"name":"宜春市","coord":[115.04574494880995,28.306428044943356]},{"name":"南昌市","coord":[115.9963824234495,28.664803351584705]},{"name":"九江市","coord":[115.53225905704193,29.362905920276297]},{"name":"上饶市","coord":[117.8595355766598,28.765755150094634]},{"name":"景德镇市","coord":[117.25387030721845,29.33426823662448]},{"name":"黄山市","coord":[117.85476357809696,29.969632034273722]},{"name":"池州市","coord":[117.34517113140791,30.208089337922335]},{"name":"铜陵市","coord":[117.93160431300694,30.926442655001676]},{"name":"安庆市","coord":[116.54307680610799,30.524265461641296]},{"name":"黄石市","coord":[115.02354597728443,29.924060229331015]},{"name":"咸宁市","coord":[114.26967602231792,29.652174021136048]},{"name":"黄冈市","coord":[115.2859016705373,30.65856897065683]},{"name":"武汉市","coord":[114.34552076948799,30.68836237966767]},{"name":"随州市","coord":[113.3850627838818,31.87891659924412]},{"name":"信阳市","coord":[114.81374730587638,32.0309685135914]},{"name":"驻马店市","coord":[114.07756451509235,32.896720987266114]},{"name":"商洛市","coord":[109.82044421310393,33.77403373563189]},{"name":"西安市","coord":[109.11839808451401,34.225257215515896]},{"name":"渭南市","coord":[109.75732444226935,35.025913644359306]},{"name":"铜川市","coord":[108.98695328111377,35.19235092947735]},{"name":"咸阳市","coord":[108.36398776446165,34.84311348287181]},{"name":"三门峡市","coord":[110.80049688104964,34.31818709571671]},{"name":"运城市","coord":[111.1736679525165,35.19010372283576]},{"name":"洛阳市","coord":[111.87577573098216,34.33379926109848]},{"name":"平顶山市","coord":[112.80931281928427,33.759895800153096]},{"name":"漯河市","coord":[113.83505724178012,33.70034266174508]},{"name":"许昌市","coord":[113.78762484088509,34.051835688452435]},{"name":"郑州市","coord":[113.49619951867594,34.61181797865449]},{"name":"焦作市","coord":[113.13404280173008,35.134167097471625]},{"name":"晋城市","coord":[112.7495732073233,35.63186423091449]},{"name":"长治市","coord":[112.85900842873183,36.45872910742828]},{"name":"临汾市","coord":[111.49379787924448,36.22810800777857]},{"name":"太原市","coord":[112.15628804033796,37.91704444063036]},{"name":"吕梁市","coord":[111.31901105774872,37.712740463356496]},{"name":"晋中市","coord":[113.08199599739676,37.36532613794343]},{"name":"邯郸市","coord":[114.41824047234618,36.530119932543315]},{"name":"安阳市","coord":[113.88883283163116,35.7797611183252]},{"name":"鹤壁市","coord":[114.3654094911545,35.75770487428472]},{"name":"新乡市","coord":[113.9184107718167,35.348471214026716]},{"name":"开封市","coord":[114.52801677500626,34.61371216679872]},{"name":"周口市","coord":[114.88509782391864,33.69999759722657]},{"name":"阜阳市","coord":[115.44595951398213,32.98060371610532]},{"name":"淮南市","coord":[116.68941991880993,32.79972275772595]},{"name":"蚌埠市","coord":[117.38594715783302,33.106729536033896]},{"name":"淮北市","coord":[116.69651711889378,33.69527529383458]},{"name":"宿州市","coord":[117.30175405886838,33.943330421260015]},{"name":"亳州市","coord":[116.12410804185097,33.46769392946132]},{"name":"商丘市","coord":[115.59575176872548,34.28339840831147]},{"name":"菏泽市","coord":[115.53631974831816,35.197319393220624]},{"name":"濮阳市","coord":[115.3070485514902,35.775883510964334]},{"name":"聊城市","coord":[115.8870069012884,36.40529594548765]},{"name":"邢台市","coord":[114.74259008644859,37.251396750084155]},{"name":"石家庄市","coord":[114.56923838363613,38.13141710980106]},{"name":"阳泉市","coord":[113.39216149668508,38.09075470547468]},{"name":"保定市","coord":[115.261524468934,39.09118520781398]},{"name":"衡水市","coord":[115.8182936677897,37.715661598187154]},{"name":"德州市","coord":[116.4582273790399,37.19372347888644]},{"name":"沧州市","coord":[116.76192710911863,38.20240042039232]},{"name":"廊坊市","coord":[116.50410772133856,39.27896741763884]},{"name":"天津市","coord":[117.31988934444873,39.37154482470619]},{"name":"北京市","coord":[116.59734730757869,40.237112944270976]},{"name":"张家口市","coord":[115.1823606483226,40.83732566607167]},{"name":"唐山市","coord":[117.8693184261954,39.71862889477249]},{"name":"秦皇岛市","coord":[119.30467355367742,39.990574652162564]},{"name":"承德市","coord":[117.16275671911026,41.36623845548547]},{"name":"葫芦岛市","coord":[119.9342336210531,40.5628822626519]},{"name":"朝阳市","coord":[120.11853493535794,41.471852354885755]},{"name":"赤峰市","coord":[118.50943546234379,43.25452976059767]},{"name":"锦州市","coord":[121.5167549323861,41.45933087433065]},{"name":"营口市","coord":[122.58571915054674,40.42093503997384]},{"name":"丹东市","coord":[124.33549382902183,40.46369290272115]},{"name":"辽阳市","coord":[123.34064798039414,41.152331397771356]},{"name":"盘锦市","coord":[122.06718005354679,41.05573599862555]},{"name":"阜新市","coord":[121.93889757908204,42.27641773244204]},{"name":"鞍山市","coord":[122.78904432242356,40.77781183142038]},{"name":"沈阳市","coord":[122.99508899709724,42.1162195010079]},{"name":"铁岭市","coord":[124.23100515588399,42.72666083611828]},{"name":"扶顺市","coord":[124.46027188217573,41.82955407638859]},{"name":"通辽市","coord":[122.0729370657937,43.90889130864869]},{"name":"兴安盟","coord":[120.79456431092532,45.92003249442161]},{"name":"白城市","coord":[123.10619907715235,45.25475749267784]},{"name":"齐齐哈尔市","coord":[124.5462214659102,47.55395009317394]},{"name":"大兴安岭地区","coord":[124.50992855161529,52.18438447846694]},{"name":"黑河市","coord":[127.14721400335922,49.25080134026901]},{"name":"大庆市","coord":[124.40329830095243,46.401048760966745]},{"name":"绥化市","coord":[126.5214484055605,46.76992452194825]},{"name":"松原市","coord":[124.21244334807682,44.75779381338502]},{"name":"四平市","coord":[124.27839350328821,43.52139065090318]},{"name":"通化市","coord":[125.67392830706305,41.91771808663852]},{"name":"辽源市","coord":[125.33529527643432,42.758340204944986]},{"name":"吉林市","coord":[126.83350281902375,43.60730120049175]},{"name":"长春市","coord":[125.53597875970374,44.24624314701737]},{"name":"白山市","coord":[127.16780160322108,42.093893880305075]},{"name":"哈尔滨市","coord":[127.39125008786029,45.36200668820575]},{"name":"鹤岗市","coord":[130.4703811258197,47.66520688940109]},{"name":"伊春市","coord":[128.91240831703635,47.93833794565277]},{"name":"七台河市","coord":[131.2677920224311,45.945099776108584]},{"name":"鸡西市","coord":[132.38059153660274,45.722934218318535]},{"name":"双鸭山市","coord":[132.3184817002743,46.65813679030265]},{"name":"佳木斯市","coord":[132.26174446608726,47.17569713691394]},{"name":"呼伦贝尔市","coord":[122.3210739998419,50.18176996070858]},{"name":"孝感市","coord":[113.83749892135485,31.11757234692128]},{"name":"贵港市","coord":[110.07354588052804,23.380735604767374]},{"name":"黔南布依族苗族自","coord":[107.30931767543106,26.2976919432269]},{"name":"宁德市","coord":[119.52482556634342,27.013151692716413]},{"name":"温州市","coord":[120.30037042732202,27.8699145504001]},{"name":"台州市","coord":[120.88886782713843,28.670799172772313]},{"name":"丽水市","coord":[119.56796851966463,28.170268394477755]},{"name":"衢州市","coord":[118.79479802644406,28.865874397158763]},{"name":"金华市","coord":[119.99381920686633,29.093455548185744]},{"name":"绍兴市","coord":[120.46546691682343,29.69382513836818]},{"name":"宁波市","coord":[121.42142987830871,29.70001162878972]},{"name":"杭州市","coord":[119.4405685790891,29.87218307296989]},{"name":"宣城市","coord":[118.68748382914703,30.628143499626418]},{"name":"湖州市","coord":[119.98261306633574,30.7945175862809]},{"name":"嘉兴市","coord":[120.83889215988998,30.67538495499343]},{"name":"上海市","coord":[121.37534147322967,31.25628247908459]},{"name":"苏州市","coord":[120.6906182622391,31.381280695137775]},{"name":"无锡市","coord":[120.32182300914366,31.54113306724517]},{"name":"常州市","coord":[119.61953292830165,31.611878565375576]},{"name":"南京市","coord":[118.71890548838064,31.910863187910323]},{"name":"镇江市","coord":[119.42349332902813,31.97942313430778]},{"name":"合肥市","coord":[117.30651975617157,31.79407863049138]},{"name":"六安市","coord":[116.24668220575353,31.820846193819513]},{"name":"滁州市","coord":[117.88422385307969,32.51792621904418]},{"name":"泰州市","coord":[120.03124303305091,32.56503102346783]},{"name":"南通市","coord":[120.85599446760912,32.18496706099728]},{"name":"盐城市","coord":[120.01812490612667,33.54219948734023]},{"name":"淮安市","coord":[119.0749424205415,33.39203631772854]},{"name":"宿迁市","coord":[118.45404943216346,33.666258719120265]},{"name":"徐州市","coord":[117.77482249295966,34.30847766157078]},{"name":"济宁市","coord":[116.74147276546373,35.27488504351119]},{"name":"枣庄市","coord":[117.43359942491492,34.884162021736]},{"name":"连云港市","coord":[119.01553213785074,34.54316517587849]},{"name":"临沂市","coord":[118.31478835349617,35.28173079028279]},{"name":"日照市","coord":[119.14265350444272,35.54479073199592]},{"name":"青岛市","coord":[120.27779044405756,36.3464117375903]},{"name":"威海市","coord":[122.12963327195605,37.13879077904251]},{"name":"烟台市","coord":[120.7689567423966,37.19772002195597]},{"name":"潍坊市","coord":[119.02178548592039,36.49292234053931]},{"name":"淄博市","coord":[117.92936024367185,36.60871347163638]},{"name":"泰安市","coord":[116.93810893944303,36.0423330118612]},{"name":"济南市","coord":[117.34560282551296,36.769574973846304]},{"name":"东营市","coord":[118.4915054457184,37.52194690335787]},{"name":"滨州市","coord":[117.67610299757533,37.4439597758601]},{"name":"昆明市","coord":[102.93100245594789,25.481300763922075]},{"name":"玉溪市","coord":[102.23080854291823,24.156168324611663]},{"name":"塔城地区","coord":[83.60908162840168,45.3721852373893]},{"name":"张掖市","coord":[100.47710030600572,38.704239320458385]},{"name":"南阳市","coord":[112.1400670951149,33.03033276715801]},{"name":"扬州市","coord":[119.48949608990988,32.80956776339646]},{"name":"延边朝鲜族自治州","coord":[129.3577692895626,43.24968794080283]},{"name":"牡丹江市","coord":[129.87240796405672,44.7073040108322]},{"name":"澳门","coord":[113.56289691515346,22.14602596262204]},{"name":"吴忠市","coord":[106.76894508116403,37.72566765880316]},{"name":"来宾市","coord":[109.25592217010114,23.86346274681084]},{"name":"平凉市","coord":[107.0708132782897,35.30329631658711]},{"name":"马鞍山市","coord":[118.27245878467022,31.657727937739004]},{"name":"芜湖市","coord":[118.32992684415504,31.081688223101658]},{"name":"澄迈县","coord":[110.04198076060266,19.694955078668105]},{"name":"保亭黎族苗族自治","coord":[109.6055304964257,18.6101488675304]},{"name":"乐东黎族自治县","coord":[109.04051999525574,18.643137437909203]},{"name":"儋州市","coord":[109.3431358337404,19.550974957403195]},{"name":"定安县","coord":[110.38744429685676,19.47557074114284]},{"name":"屯昌县","coord":[110.00574767630334,19.367175093044388]},{"name":"白沙黎族自治县","coord":[109.36860737761768,19.214416393082217]},{"name":"琼中黎族苗族自治","coord":[109.86691465937548,19.073671135862682]},{"name":"东方市","coord":[108.86903802405428,19.017352815445214]},{"name":"昌江黎族自治县","coord":[108.9686431884767,19.182594167127824]},{"name":"海口市","coord":[110.420654296875,19.806565564640795]},{"name":"济源市","coord":[112.38051465474433,35.07958362422394]},{"name":"五指山市","coord":[109.53595187364496,18.832908264613966]},{"name":"大连市","coord":[121.96662235866603,39.444150542439914]},{"name":"文昌市三沙市","coord":[110.81828537536748,19.756501444162936]},{"name":"三亚市","coord":[109.38424600793707,18.39186315877128]},{"name":"万宁市","coord":[110.28485046979574,18.860240588635115]},{"name":"陵水黎族自治县","coord":[109.95577603229562,18.594712684620465]},{"name":"临高县","coord":[109.71915395436967,19.79420403032508]},{"name":"琼海市","coord":[110.41650700703043,19.22315873149372]}]'),Mi=JSON.parse('[{"name":"黑龙江省","coord":[127.64559817675396,48.48668098449708]},{"name":"内蒙古自治区","coord":[118.34519572208615,45.370218276977525]},{"name":"新疆维吾尔自治区","coord":[87.13479065593184,41.75497055053711]},{"name":"吉林省","coord":[126.12985278813787,43.57983207702637]},{"name":"辽宁省","coord":[124.02494773936439,41.105743408203125]},{"name":"甘肃省","coord":[102.87785725633012,37.69582366943361]},{"name":"河北省","coord":[115.66327227481898,39.33383178710938]},{"name":"北京市","coord":[116.62199343603638,40.25053787231445]},{"name":"山西省","coord":[112.45180235808988,37.666561126708984]},{"name":"天津市","coord":[117.35711842642581,39.406789779663086]},{"name":"陕西省","coord":[109.56294003056632,35.64754199981689]},{"name":"宁夏回族自治区","coord":[105.96110877640074,37.3081169128418]},{"name":"青海省","coord":[96.07301048277901,35.44417190551758]},{"name":"山东省","coord":[118.03833752951093,36.29800605773925]},{"name":"西藏自治区","coord":[87.47361520439412,31.6703872680664]},{"name":"河南省","coord":[113.07832397097275,33.87751102447509]},{"name":"江苏省","coord":[119.93926538201052,32.945452690124505]},{"name":"安徽省","coord":[117.15146765881019,32.024482727050774]},{"name":"四川省","coord":[102.28998890142759,30.182161331176758]},{"name":"湖北省","coord":[112.87798261431585,31.157071113586426]},{"name":"重庆市","coord":[107.870126637831,30.188085556030266]},{"name":"上海市","coord":[121.42561166015514,31.276043891906745]},{"name":"浙江省","coord":[119.75337092707514,29.175934791564945]},{"name":"湖南省","coord":[111.52770282777405,27.38110256195069]},{"name":"江西省","coord":[115.51091280655628,27.283511161804206]},{"name":"云南省","coord":[101.27053825991308,25.19783210754396]},{"name":"贵州省","coord":[106.49672346773299,26.92267990112305]},{"name":"福建省","coord":[117.9976766946587,25.939599990844727]},{"name":"广西壮族自治区","coord":[108.98706831086302,23.891559600830078]},{"name":"台湾省","coord":[120.82468432537434,23.602651596069336]},{"name":"香港特别行政区","coord":[114.21036850371561,22.374858856201172]},{"name":"海南省","coord":[109.62792940960824,19.163116455078125]},{"name":"广东省","coord":[113.32127888266032,22.873867034912106]},{"name":"澳门特别行政区","coord":[113.56819996291901,22.160347992976]}]');function Pi(t){"@babel/helpers - typeof";return(Pi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Li(t){return function(t){if(Array.isArray(t))return Ni(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Ni(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ni(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ni(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:"type",r=[],n=0;n0){var o=Ui(i,e);r.push.apply(r,Li(o))}}else r.push(t[n])}return r}function Hi(t,e){var r=t.type,n=t.tiles;return"raster"===r&&(r===e.type&&n&&e.tiles&&(n[0].includes(e.tiles[0])||e.tiles[0].includes(n[0])))}function Vi(t){return t.layerInfo&&t.layerInfo.id?t.layerInfo.id:t.metadata&&t.metadata.SM_Layer_Id?t.metadata.SM_Layer_Id:t.sourceLayer||t.source||t.id}function Qi(t,e,r){var n=r.some(function(t){return t.id===e})?[e]:[];return t&&n.push.apply(n,Li(t)),Array.from(new Set(n)).filter(function(t){return!!t})}function Yi(t,e,r){var n=Qi(t,e,r);return r.find(function(t){return t.id===n[0]})}var Wi={toSuperMapGeometry:function(t){if(t&&t.type)return(new Ei).read(t,"FeatureCollection")[0].geometry},toSuperMapBounds:function(t){return ki(t)?new ye(t[0],t[1],t[2],t[3]):t instanceof I().LngLatBounds?new ye(t.getWest(),t.getSouth(),t.getEast(),t.getNorth()):t},toSuperMapPoint:function(t){return ki(t)?new _e(t[0],t[1]):t.lng&&t.lat?new _e(t.lng,t.lat):new _e(t.geometry.coordinates[0],t.geometry.coordinates[1])},toSuperMapPolygon:function(t){var e=t.getWest(),r=t.getEast(),n=t.getSouth(),i=t.getNorth();return new dr([new sr([new _e(e,n),new _e(r,n),new _e(r,i),new _e(e,i)])])},isArray:ki,toGeoJSON:function(t){if(t)return(new Ei).toGeoJSON(t)},toProcessingParam:function(t){var e={};if(t.length<1)e="";else{for(var r=[],n=0;n1e-7;a++)e=1,o+=s=Math.PI/2-2*Math.atan(i*e)-o;return new(I().LngLat)(t[0]*r/n,o*r)},transformUrl:function(t){var e=t.url,r=t.server,n=t.excludePortalProxyUrl,i=t.credentialValue,o=t.credentialKey,a=-1===e.indexOf(".json")?"".concat(e,".json"):e,s="getUrlResource.json?url=";if(n&&r.indexOf(s)>-1){var u=r.split(s);u.length>1&&(a=u[0]+s+a)}return i&&o&&(a+="?"+o+"="+i),a}};function qi(t){"@babel/helpers - typeof";return(qi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xi(t,e){for(var r=0;r1&&(r=parseFloat(r)*l),n.labelAlign&&"cm"!==n.labelAlign)switch(n.labelAlign){case"lt":u.x+=e/2,u.y+=r/2;break;case"lm":u.x+=e/2;break;case"lb":u.x+=e/2,u.y-=r/2;break;case"ct":u.y+=r/2;break;case"cb":u.y-=r/2;break;case"rt":u.x-=e/2,u.y+=r/2;break;case"rm":u.x-=e/2;break;case"rb":u.x-=e/2,u.y-=r/2}return this.bsInfo.h=r,this.bsInfo.w=e,i=u.x-parseFloat(e)/2,o=u.y+parseFloat(r)/2,s=u.x+parseFloat(e)/2,a=u.y-parseFloat(r)/2,new ye(i,o,s,a)}},{key:"getLabelPxBoundsByText",value:function(t,e){var r,n,i,o,a=this.getLabelPxSize(e),s=$.cloneObject(t);if(e.labelAlign&&"cm"!==e.labelAlign)switch(e.labelAlign){case"lt":s.x+=a.w/2,s.y+=a.h/2;break;case"lm":s.x+=a.w/2;break;case"lb":s.x+=a.w/2,s.y-=a.h/2;break;case"ct":s.y+=a.h/2;break;case"cb":s.y-=a.h/2;break;case"rt":s.x-=a.w/2,s.y+=a.h/2;break;case"rm":s.x-=a.w/2;break;case"rb":s.x-=a.w/2,s.y-=a.h/2}return this.bsInfo.h=a.h,this.bsInfo.w=a.w,r=s.x-a.w/2,n=s.y+a.h/2,o=e.fontStyle&&"italic"===e.fontStyle?s.x+a.w/2+parseInt(parseFloat(e.fontSize)/2):s.x+a.w/2,i=s.y-a.h/2,new ye(r,n,o,i)}},{key:"getLabelPxSize",value:function(t){var e,r,n,i,o=parseFloat(t.strokeWidth);e=t.label||this.text,r=t.fontSize?parseFloat(t.fontSize):parseFloat("12px");var a=e.split("\n"),s=a.length;i=s>1?r*s+s+o+.2*r:r+o+.2*r+1,n=0,this.labelWTmp&&n255?r++:n++;return e.cnC=r,e.enC=n,e.textC=t.length,e}}])&&Xi(r.prototype,n),i&&Xi(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function ro(t){"@babel/helpers - typeof";return(ro="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function no(t,e){for(var r=0;r1&&(t=new _e(e[0],e[1])),new Or(t,this.attributes)}}])&&so(t.prototype,e),r&&so(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function co(t){"@babel/helpers - typeof";return(co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fo(t,e){for(var r=0;ro&&(o=t+s+100,n.width=o,r=!0),e+u>a&&(a=e+u+100,n.height=a,r=!0),t<-s&&(o+=s=100*Math.ceil(-t/100),n.width=o,r=!0),e<-u&&(a+=u=100*Math.ceil(-e/100),n.height=a,r=!0),r&&i.translate(s,u)}},{key:"getPixelOffset",value:function(){return{x:this._offsetX,y:this._offsetY}}},{key:"indexOf",value:function(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r3&&(e=Array.prototype.slice.call(e,1));for(var n=this._handlers[t],i=n.length,o=0;o4&&(e=Array.prototype.slice.call(e,1,e.length-1));for(var n=e[e.length-1],i=this._handlers[t],o=i.length,a=0;a-this.EPSILON&&tthis.EPSILON||t<-this.EPSILON}},{key:"cubicAt",value:function(t,e,r,n,i){var o=1-i;return o*o*(o*t+3*i*e)+i*i*(i*n+3*o*r)}},{key:"cubicDerivativeAt",value:function(t,e,r,n,i){var o=1-i;return 3*(((e-t)*o+2*(r-e)*i)*o+(n-r)*i*i)}},{key:"cubicRootAt",value:function(t,e,r,n,i,o){var a=n+3*(e-r)-t,s=3*(r-2*e+t),u=3*(e-t),l=t-i,c=s*s-3*a*u,f=s*u-9*a*l,h=u*u-3*s*l,p=0;if(this.isAroundZero(c)&&this.isAroundZero(f))if(this.isAroundZero(s))o[0]=0;else{var d=-u/s;d>=0&&d<=1&&(o[p++]=d)}else{var y=f*f-4*c*h;if(this.isAroundZero(y)){var g=f/c,v=-s/a+g,m=-g/2;v>=0&&v<=1&&(o[p++]=v),m>=0&&m<=1&&(o[p++]=m)}else if(y>0){var b=Math.sqrt(y),A=c*s+1.5*a*(-f+b),x=c*s+1.5*a*(-f-b),w=(-s-((A=A<0?-Math.pow(-A,this.ONE_THIRD):Math.pow(A,this.ONE_THIRD))+(x=x<0?-Math.pow(-x,this.ONE_THIRD):Math.pow(x,this.ONE_THIRD))))/(3*a);w>=0&&w<=1&&(o[p++]=w)}else{var _=(2*c*s-3*a*f)/(2*Math.sqrt(c*c*c)),S=Math.acos(_)/3,E=Math.sqrt(c),C=Math.cos(S),k=(-s-2*E*C)/(3*a),I=(-s+E*(C+this.THREE_SQRT*Math.sin(S)))/(3*a),T=(-s+E*(C-this.THREE_SQRT*Math.sin(S)))/(3*a);k>=0&&k<=1&&(o[p++]=k),I>=0&&I<=1&&(o[p++]=I),T>=0&&T<=1&&(o[p++]=T)}}return p}},{key:"cubicExtrema",value:function(t,e,r,n,i){var o=6*r-12*e+6*t,a=9*e+3*n-3*t-9*r,s=3*e-3*t,u=0;if(this.isAroundZero(a)){if(this.isNotAroundZero(o)){var l=-s/o;l>=0&&l<=1&&(i[u++]=l)}}else{var c=o*o-4*a*s;if(this.isAroundZero(c))i[0]=-o/(2*a);else if(c>0){var f=Math.sqrt(c),h=(-o+f)/(2*a),p=(-o-f)/(2*a);h>=0&&h<=1&&(i[u++]=h),p>=0&&p<=1&&(i[u++]=p)}}return u}},{key:"cubicSubdivide",value:function(t,e,r,n,i,o){var a=(e-t)*i+t,s=(r-e)*i+e,u=(n-r)*i+r,l=(s-a)*i+a,c=(u-s)*i+s,f=(c-l)*i+l;o[0]=t,o[1]=a,o[2]=l,o[3]=f,o[4]=f,o[5]=c,o[6]=u,o[7]=n}},{key:"cubicProjectPoint",value:function(t,e,r,n,i,o,a,s,u,l,c){var f,h=this.vector.create(),p=this.vector.create(),d=this.vector.create(),y=.005,g=1/0;h[0]=u,h[1]=l;for(var v=0;v<1;v+=.05){p[0]=this.cubicAt(t,r,i,a,v),p[1]=this.cubicAt(e,n,o,s,v);var m=this.vector.distSquare(h,p);m=0&&w=0&&l<=1&&(i[u++]=l)}}else{var c=a*a-4*o*s;if(this.isAroundZero(c)){var f=-a/(2*o);f>=0&&f<=1&&(i[u++]=f)}else if(c>0){var h=Math.sqrt(c),p=(-a+h)/(2*o),d=(-a-h)/(2*o);p>=0&&p<=1&&(i[u++]=p),d>=0&&d<=1&&(i[u++]=d)}}return u}},{key:"quadraticExtremum",value:function(t,e,r){var n=t+r-2*e;return 0===n?.5:(t-e)/n}},{key:"quadraticProjectPoint",value:function(t,e,r,n,i,o,a,s,u){var l,c=this.vector.create(),f=this.vector.create(),h=this.vector.create(),p=.005,d=1/0;c[0]=a,c[1]=s;for(var y=0;y<1;y+=.05){f[0]=this.quadraticAt(t,r,i,y),f[1]=this.quadraticAt(e,n,o,y);var g=this.vector.distSquare(c,f);g=0&&A0){for(var m=this.isInsidePolygon(e.pointList,g,v),b=t.holePolygonPointLists,A=!1,x=0,w=b.length;xe+s&&a>n+s||at+s&&o>r+s||oe+f&&c>n+f&&c>o+f&&c>s+f||ct+f&&l>r+f&&l>i+f&&l>a+f||le+l&&u>n+l&&u>o+l||ut+l&&s>r+l&&s>i+l||sr||f+c=l)return!0;if(o){var h=n;n=this.normalizeRadian(i),i=this.normalizeRadian(h)}else n=this.normalizeRadian(n),i=this.normalizeRadian(i);n>i&&(i+=l);var p=Math.atan2(u,s);return p<0&&(p+=l),p>=n&&p<=i||p+l>=n&&p+l<=i}},{key:"isInsideBrokenLine",value:function(t,e,r,n){for(var i=Math.max(e,10),o=0,a=t.length-1;or*r}},{key:"isInsideRect",value:function(t,e,r,n,i,o){return i>=t&&i<=t+r&&o>=e&&o<=e+n}},{key:"isInsideCircle",value:function(t,e,r,n,i){return(n-t)*(n-t)+(i-e)*(i-e)e&&o>n||oi?ne&&l>n&&l>o&&l>s||l1&&this.swapExtrema(),d=c.cubicAt(e,n,o,s,h[0]),v>1&&(y=c.cubicAt(e,n,o,s,h[1]))),2==v?be&&s>n&&s>o||s=0&&f<=1){for(var h=0,p=u.quadraticAt(e,n,o,f),d=0;da||(l[d]a?0:or||s<-r)return 0;var c=Math.sqrt(r*r-s*s);if(u[0]=-c,u[1]=c,Math.abs(n-i)>=l){n=0,i=l;var f=o?1:-1;return a>=u[0]+t&&a<=u[1]+t?f:0}if(o){var h=n;n=this.normalizeRadian(i),i=this.normalizeRadian(h)}else n=this.normalizeRadian(n),i=this.normalizeRadian(i);n>i&&(i+=l);for(var p=0,d=0;d<2;d++){var y=u[d];if(y+t>a){var g=Math.atan2(s,y),v=o?1:-1;g<0&&(g=l+g),(g>=n&&g<=i||g+l>=n&&g+l<=i)&&(g>Math.PI/2&&g<1.5*Math.PI&&(v=-v),p+=v)}}return p}},{key:"isInsidePath",value:function(t,e,r,n,i){for(var o=0,a=0,s=0,u=0,l=0,c=!0,f=!0,h="stroke"===(r=r||"fill")||"both"===r,p="fill"===r||"both"===r,d=0;d0&&(p&&(o+=this.windingLine(a,s,u,l,n,i)),0!==o))return!0;u=g[g.length-2],l=g[g.length-1],c=!1,f&&"A"!==y.command&&(f=!1,a=u,s=l)}switch(y.command){case"M":a=g[0],s=g[1];break;case"L":if(h&&this.isInsideLine(a,s,g[0],g[1],e,n,i))return!0;p&&(o+=this.windingLine(a,s,g[0],g[1],n,i)),a=g[0],s=g[1];break;case"C":if(h&&this.isInsideCubicStroke(a,s,g[0],g[1],g[2],g[3],g[4],g[5],e,n,i))return!0;p&&(o+=this.windingCubic(a,s,g[0],g[1],g[2],g[3],g[4],g[5],n,i)),a=g[4],s=g[5];break;case"Q":if(h&&this.isInsideQuadraticStroke(a,s,g[0],g[1],g[2],g[3],e,n,i))return!0;p&&(o+=this.windingQuadratic(a,s,g[0],g[1],g[2],g[3],n,i)),a=g[2],s=g[3];break;case"A":var v=g[0],m=g[1],b=g[2],A=g[3],x=g[4],w=g[5],_=Math.cos(x)*b+v,S=Math.sin(x)*A+m;f?(f=!1,u=_,l=S):o+=this.windingLine(a,s,_,S);var E=(n-v)*A/b+v;if(h&&this.isInsideArcStroke(v,m,A,x,x+w,1-g[7],e,E,i))return!0;p&&(o+=this.windingArc(v,m,A,x,x+w,1-g[7],E,i)),a=Math.cos(x+w)*b+v,s=Math.sin(x+w)*A+m;break;case"z":if(h&&this.isInsideLine(a,s,u,l,e,n,i))return!0;c=!0}}return p&&(o+=this.windingLine(a,s,u,l,n,i)),0!==o}},{key:"getTextWidth",value:function(t,e){var r=t+":"+e;if(this._textWidthCache[r])return this._textWidthCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),e&&(this._ctx.font=e);for(var n=0,i=0,o=(t=(t+"").split("\n")).length;ithis.TEXT_CACHE_MAX&&(this._textWidthCacheCounter=0,this._textWidthCache={}),n}},{key:"getTextHeight",value:function(t,e){var r=t+":"+e;if(this._textHeightCache[r])return this._textHeightCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),e&&(this._ctx.font=e),t=(t+"").split("\n");var n=(this._ctx.measureText("ZH").width+2)*t.length;return this._ctx.restore(),this._textHeightCache[r]=n,++this._textHeightCacheCounter>this.TEXT_CACHE_MAX&&(this._textHeightCacheCounter=0,this._textHeightCache={}),n}}])&&Io(t.prototype,e),r&&Io(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Mo(t){"@babel/helpers - typeof";return(Mo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Po(t,e){for(var r=0;r1)for(var i=0,o=n-1;i1?Math.ceil(t):t}),e.indexOf("hex")>-1)return"#"+((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1);if(e.indexOf("hs")>-1){var r=this.map(t.slice(1,3),function(t){return t+"%"});t[1]=r[0],t[2]=r[1]}return e.indexOf("a")>-1?(3===t.length&&t.push(1),t[3]=this.adjust(t[3],[0,1]),e+"("+t.slice(0,4).join(",")+")"):e+"("+t.slice(0,3).join(",")+")"}}},{key:"toArray",value:function(t){(t=this.trim(t)).indexOf("rgba")<0&&(t=this.toRGBA(t));var e=[],r=0;return t.replace(/[\d.]+/g,function(t){r<3?t|=0:t=+t,e[r++]=t}),e}},{key:"convert",value:function(t,e){if(!this.isCalculableColor(t))return t;var r=this.getData(t),n=r[3];return void 0===n&&(n=1),t.indexOf("hsb")>-1?r=this._HSV_2_RGB(r):t.indexOf("hsl")>-1&&(r=this._HSL_2_RGB(r)),e.indexOf("hsb")>-1||e.indexOf("hsv")>-1?r=this._RGB_2_HSB(r):e.indexOf("hsl")>-1&&(r=this._RGB_2_HSL(r)),r[3]=n,this.toColor(r,e)}},{key:"toRGBA",value:function(t){return this.convert(t,"rgba")}},{key:"toRGB",value:function(t){return this.convert(t,"rgb")}},{key:"toHex",value:function(t){return this.convert(t,"hex")}},{key:"toHSVA",value:function(t){return this.convert(t,"hsva")}},{key:"toHSV",value:function(t){return this.convert(t,"hsv")}},{key:"toHSBA",value:function(t){return this.convert(t,"hsba")}},{key:"toHSB",value:function(t){return this.convert(t,"hsb")}},{key:"toHSLA",value:function(t){return this.convert(t,"hsla")}},{key:"toHSL",value:function(t){return this.convert(t,"hsl")}},{key:"toName",value:function(t){for(var e in this._nameColors)if(this.toHex(this._nameColors[e])===this.toHex(t))return e;return null}},{key:"trim",value:function(t){return String(t).replace(/\s+/g,"")}},{key:"normalize",value:function(t){if(this._nameColors[t]&&(t=this._nameColors[t]),t=(t=this.trim(t)).replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(t)){var e=(3840&(t=parseInt(t.slice(1),16)))<<8,r=(240&t)<<4,n=15&t;t="#"+((1<<24)+(e<<4)+e+(r<<4)+r+(n<<4)+n).toString(16).slice(1)}return t}},{key:"lift",value:function(t,e){if(!this.isCalculableColor(t))return t;var r=e>0?1:-1;void 0===e&&(e=0),e=Math.abs(e)>1?1:Math.abs(e),t=this.toRGB(t);for(var n=this.getData(t),i=0;i<3;i++)n[i]=1===r?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0;return"rgb("+n.join(",")+")"}},{key:"reverse",value:function(t){if(!this.isCalculableColor(t))return t;var e=this.getData(this.toRGBA(t));return e=this.map(e,function(t){return 255-t}),this.toColor(e,"rgb")}},{key:"mix",value:function(t,e,r){if(!this.isCalculableColor(t)||!this.isCalculableColor(e))return t;void 0===r&&(r=.5);for(var n=2*(r=1-this.adjust(r,[0,1]))-1,i=this.getData(this.toRGBA(t)),o=this.getData(this.toRGBA(e)),a=i[3]-o[3],s=((n*a==-1?n:(n+a)/(1+n*a))+1)/2,u=1-s,l=[],c=0;c<3;c++)l[c]=i[c]*s+o[c]*u;var f=i[3]*r+o[3]*(1-r);return f=Math.max(0,Math.min(1,f)),1===i[3]&&1===o[3]?this.toColor(l,"rgb"):(l[3]=f,this.toColor(l,"rgba"))}},{key:"random",value:function(){return"#"+Math.random().toString(16).slice(2,8)}},{key:"getData",value:function(e){var r,n,i=(e=this.normalize(e)).match(this.colorRegExp);if(null===i)throw new Error("The color format error");var o,a=[];if(i[2])o=[(r=i[2].replace("#","").split(""))[0]+r[1],r[2]+r[3],r[4]+r[5]],a=this.map(o,function(e){return t.prototype.adjust.call(this,parseInt(e,16),[0,255])});else if(i[4]){var s=i[4].split(",");n=s[3],o=s.slice(0,3),a=this.map(o,function(e){return e=Math.floor(e.indexOf("%")>0?2.55*parseInt(e,0):e),t.prototype.adjust.call(this,e,[0,255])}),void 0!==n&&a.push(this.adjust(parseFloat(n),[0,1]))}else if(i[5]||i[6]){var u=(i[5]||i[6]).split(","),l=parseInt(u[0],0)/360,c=u[1],f=u[2];n=u[3],(a=this.map([c,f],function(e){return t.prototype.adjust.call(this,parseFloat(e)/100,[0,1])})).unshift(l),void 0!==n&&a.push(this.adjust(parseFloat(n),[0,1]))}return a}},{key:"alpha",value:function(t,e){if(!this.isCalculableColor(t))return t;null===e&&(e=1);var r=this.getData(this.toRGBA(t));return r[3]=this.adjust(Number(e).toFixed(4),[0,1]),this.toColor(r,"rgba")}},{key:"map",value:function(t,e){if("function"!=typeof e)throw new TypeError;for(var r=t?t.length:0,n=0;n=e[1]&&(t=e[1]),t}},{key:"isCalculableColor",value:function(t){return t instanceof Array||"string"==typeof t}},{key:"_HSV_2_RGB",value:function(t){var e,r,n,i=t[0],o=t[1],a=t[2];if(0===o)e=255*a,r=255*a,n=255*a;else{var s=6*i;6===s&&(s=0);var u=0|s,l=a*(1-o),c=a*(1-o*(s-u)),f=a*(1-o*(1-(s-u))),h=0,p=0,d=0;0===u?(h=a,p=f,d=l):1===u?(h=c,p=a,d=l):2===u?(h=l,p=a,d=f):3===u?(h=l,p=c,d=a):4===u?(h=f,p=l,d=a):(h=a,p=l,d=c),e=255*h,r=255*p,n=255*d}return[e,r,n]}},{key:"_HSL_2_RGB",value:function(t){var e,r,n,i=t[0],o=t[1],a=t[2];if(0===o)e=255*a,r=255*a,n=255*a;else{var s,u=2*a-(s=a<.5?a*(1+o):a+o-o*a);e=255*this._HUE_2_RGB(u,s,i+1/3),r=255*this._HUE_2_RGB(u,s,i),n=255*this._HUE_2_RGB(u,s,i-1/3)}return[e,r,n]}},{key:"_HUE_2_RGB",value:function(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?t+6*(e-t)*r:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}},{key:"_RGB_2_HSB",value:function(t){var e,r,n=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(n,i,o),s=Math.max(n,i,o),u=s-a,l=s;if(0===u)e=0,r=0;else{r=u/s;var c=((s-n)/6+u/2)/u,f=((s-i)/6+u/2)/u,h=((s-o)/6+u/2)/u;n===s?e=h-f:i===s?e=1/3+c-h:o===s&&(e=2/3+f-c),e<0&&(e+=1),e>1&&(e-=1)}return[e*=360,r*=100,l*=100]}},{key:"_RGB_2_HSL",value:function(t){var e,r,n=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(n,i,o),s=Math.max(n,i,o),u=s-a,l=(s+a)/2;if(0===u)e=0,r=0;else{r=l<.5?u/(s+a):u/(2-s-a);var c=((s-n)/6+u/2)/u,f=((s-i)/6+u/2)/u,h=((s-o)/6+u/2)/u;n===s?e=h-f:i===s?e=1/3+c-h:o===s&&(e=2/3+f-c),e<0&&(e+=1),e>1&&(e-=1)}return[e*=360,r*=100,l*=100]}}])&&Po(e.prototype,r),n&&Po(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function jo(t){"@babel/helpers - typeof";return(jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ro(t,e){for(var r=0;ri&&(i=u[0]),u[1]a&&(a=u[1])}e[0]=n,e[1]=o,r[0]=i,r[1]=a}}},{key:"cubeBezier",value:function(t,e,r,n,i,o){var a=new Co,s=[];a.cubicExtrema(t[0],e[0],r[0],n[0],s);for(var u=0;ui&&!o?i+=2*Math.PI:nn&&(f[0]=Math.cos(p)*r+t,f[1]=Math.sin(p)*r+e,u.min(a,f,a),u.max(s,f,s))}}])&&Ro(t.prototype,e),r&&Ro(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Fo(t){"@babel/helpers - typeof";return(Fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zo(t,e){for(var r=0;r=200&&i.status<300||304===i.status?e&&e(i.responseText):r&&r(),i.onreadystatechange=new Function,i=null)},i.send(null)}}])&&qo(t.prototype,e),r&&qo(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Jo(t){"@babel/helpers - typeof";return(Jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zo(t,e){for(var r=0;r1)for(var e in arguments)console.log(arguments[e])}},(e=[{key:"destory",value:function(){return!0}}])&&ra(t.prototype,e),r&&ra(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function oa(t){"@babel/helpers - typeof";return(oa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function aa(t,e){for(var r=0;ra-2?a-1:p+1][0]+o[0],e[p>a-2?a-1:p+1][1]+o[1]],m=[e[p>a-3?a-1:p+2][0]+o[0],e[p>a-3?a-1:p+2][1]+o[1]]);var b=d*d,A=d*b;s.push([x(y[0],g[0],v[0],m[0],d,b,A),x(y[1],g[1],v[1],m[1],d,b,A)])}return s;function x(t,e,r,n,i,o,a){var s=.5*(r-t),u=.5*(n-e);return(2*(e-r)+s+u)*a+(-3*(e-r)-2*s-u)*o+s*i+e}}},{key:"SUtil_dashedLineTo",value:function(t,e,r,n,i,o,a){var s=[5,5];if(o="number"!=typeof o?5:o,t.setLineDash)return s[0]=o,s[1]=o,a&&a instanceof Array?t.setLineDash(a):t.setLineDash(s),t.moveTo(e,r),void t.lineTo(n,i);var u=n-e,l=i-r,c=Math.floor(Math.sqrt(u*u+l*l)/o);u/=c,l/=c;for(var f=!0,h=0;h-5e-5&&t<5e-5}ga.Util_vector.sub(e,t,this.position),n(e[0])&&n(e[1])||(ga.Util_vector.normalize(e,e),r[2]=e[0]*this.scale[1],r[3]=e[1]*this.scale[1],r[0]=e[1]*this.scale[0],r[1]=-e[0]*this.scale[0],r[4]=this.position[0],r[5]=this.position[1],this.decomposeTransform())})},(e=[{key:"destroy",value:function(){this.position=null,this.rotation=null,this.scale=null,this.needLocalTransform=null,this.needTransform=null}},{key:"updateNeedTransform",value:function(){function t(t){return t>5e-5||t<-5e-5}this.needLocalTransform=t(this.rotation[0])||t(this.position[0])||t(this.position[1])||t(this.scale[0]-1)||t(this.scale[1]-1)}},{key:"updateTransform",value:function(){if(this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform,this.needTransform){var t=[0,0],e=this.transform||ga.Util_matrix.create();if(ga.Util_matrix.identity(e),this.needLocalTransform){if(i(this.scale[0])||i(this.scale[1])){t[0]=-this.scale[2]||0,t[1]=-this.scale[3]||0;var r=i(t[0])||i(t[1]);r&&ga.Util_matrix.translate(e,e,t),ga.Util_matrix.scale(e,e,this.scale),r&&(t[0]=-t[0],t[1]=-t[1],ga.Util_matrix.translate(e,e,t))}if(this.rotation instanceof Array){if(0!==this.rotation[0]){t[0]=-this.rotation[1]||0,t[1]=-this.rotation[2]||0;var n=i(t[0])||i(t[1]);n&&ga.Util_matrix.translate(e,e,t),ga.Util_matrix.rotate(e,e,this.rotation[0]),n&&(t[0]=-t[0],t[1]=-t[1],ga.Util_matrix.translate(e,e,t))}}else 0!=+this.rotation&&ga.Util_matrix.rotate(e,e,this.rotation);(i(this.position[0])||i(this.position[1]))&&ga.Util_matrix.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?ga.Util_matrix.mul(this.transform,this.parent.transform,this.transform):ga.Util_matrix.copy(this.transform,this.parent.transform))}function i(t){return t>5e-5||t<-5e-5}}},{key:"setTransform",value:function(t){if(this.needTransform){var e=this.transform;t.transform(e[0],e[1],e[2],e[3],e[4],e[5])}}},{key:"decomposeTransform",value:function(){if(this.transform){var t=this.transform,e=t[0]*t[0]+t[1]*t[1],r=this.position,n=this.scale,i=this.rotation;a(e-1)&&(e=Math.sqrt(e));var o=t[2]*t[2]+t[3]*t[3];a(o-1)&&(o=Math.sqrt(o)),r[0]=t[4],r[1]=t[5],n[0]=e,n[1]=o,n[2]=n[3]=0,i[0]=Math.atan2(-t[1]/o,t[0]/e),i[1]=i[2]=0}function a(t){return t>5e-5||t<-5e-5}}}])&&ma(t.prototype,e),r&&ma(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function xa(t){"@babel/helpers - typeof";return(xa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function wa(t,e){for(var r=0;r0}},{key:"addRoot",value:function(t){t instanceof Ia&&t.addChildrenToStorage(this),this.addToMap(t),this._roots.push(t)}},{key:"delRoot",value:function(t){if(void 0===t){for(var e=0;e=0&&(this.delFromMap(o.id),this._roots.splice(a,1),o instanceof Ia&&o.delChildrenFromStorage(this))}}},{key:"addToMap",value:function(t){return t instanceof Ia&&(t._storage=this),t.modSelf(),this._elements[t.id]=t,this}},{key:"get",value:function(t){return this._elements[t]}},{key:"delFromMap",value:function(t){var e=this._elements[t];return e&&(delete this._elements[t],e instanceof Ia&&(e._storage=null)),this}},{key:"dispose",value:function(){this._elements=null,this._roots=null,this._hoverElements=null}}])&&Oa(e.prototype,r),n&&Oa(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function La(t){"@babel/helpers - typeof";return(La="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Na(t,e){for(var r=0;r1},isLeftClick:function(t){return t.which&&1===t.which||t.button&&1===t.button},isRightClick:function(t){return t.which&&3===t.which||t.button&&2===t.button},stop:function(t,e){e||(t.preventDefault?t.preventDefault():t.returnValue=!1),t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},findElement:function(t,e){for(var r=Qa.element(t);r.parentNode&&(!r.tagName||r.tagName.toUpperCase()!=e.toUpperCase());)r=r.parentNode;return r},observe:function(t,e,r,n){var i=$.getElement(t);if(n=n||!1,"keypress"===e&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||i.attachEvent)&&(e="keydown"),this.observers||(this.observers={}),!i._eventCacheID){var o="eventCacheID_";i.id&&(o=i.id+"_"+o),i._eventCacheID=$.createUniqueID(o)}var a=i._eventCacheID;this.observers[a]||(this.observers[a]=[]),this.observers[a].push({element:i,name:e,observer:r,useCapture:n}),i.addEventListener?"mousewheel"===e?i.addEventListener(e,r,{useCapture:n,passive:!1}):i.addEventListener(e,r,n):i.attachEvent&&i.attachEvent("on"+e,r)},stopObservingElement:function(t){var e=$.getElement(t)._eventCacheID;this._removeElementObservers(Qa.observers[e])},_removeElementObservers:function(t){if(t)for(var e=t.length-1;e>=0;e--){var r=t[e],n=new Array(r.element,r.name,r.observer,r.useCapture);Qa.stopObserving.apply(this,n)}},stopObserving:function(t,e,r,n){n=n||!1;var i=$.getElement(t),o=i._eventCacheID;"keypress"===e&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||i.detachEvent)&&(e="keydown");var a=!1,s=Qa.observers[o];if(s)for(var u=0;!a&&u0&&(this.setCtxGlobalAlpha(t,"stroke",r),t.stroke()),this.setCtxGlobalAlpha(t,"reset",r);break;case"stroke":this.setCtxGlobalAlpha(t,"stroke",r),r.lineWidth>0&&t.stroke(),this.setCtxGlobalAlpha(t,"reset",r);break;default:this.setCtxGlobalAlpha(t,"fill",r),t.fill(),this.setCtxGlobalAlpha(t,"reset",r)}this.drawText(t,r,this.style),this.afterBrush(t)}},{key:"beforeBrush",value:function(t,e){var r=this.style;return this.brushTypeOnly&&(r.brushType=this.brushTypeOnly),e&&(r=this.getHighlightStyle(r,this.highlightStyle||{},this.brushTypeOnly)),"stroke"==this.brushTypeOnly&&(r.strokeColor=r.strokeColor||r.color),t.save(),this.doClip(t),this.setContext(t,r),this.setTransform(t),r}},{key:"afterBrush",value:function(t){t.restore()}},{key:"setContext",value:function(t,e){for(var r=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]],n=0,i=r.length;n=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height&&ga.Util_area.isInside(this,this.style,t,e)}},{key:"drawText",value:function(t,r,n){if(void 0!==r.text&&!1!==r.text){var i=r.textColor||r.color||r.strokeColor;t.fillStyle=i;var o,a,s,u,l=10,c=r.textPosition||this.textPosition||"top",f=[];switch(f=this.refOriginalPosition&&2===this.refOriginalPosition.length?this.refOriginalPosition:[0,0],c){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var h=(n||r).__rect||this.getRect(n||r);switch(c){case"inside":s=h.x+h.width/2,u=h.y+h.height/2,o="center",a="middle","stroke"!=r.brushType&&i==r.color&&(t.fillStyle="#fff");break;case"left":s=h.x-l,u=h.y+h.height/2,o="end",a="middle";break;case"right":s=h.x+h.width+l,u=h.y+h.height/2,o="start",a="middle";break;case"top":s=h.x+h.width/2,u=h.y-l,o="center",a="bottom";break;case"bottom":s=h.x+h.width/2,u=h.y+h.height+l,o="center",a="top"}}break;case"start":case"end":var p=0,d=0,y=0,g=0;if(void 0!==r.pointList){var v=r.pointList;if(v.length<2)return;var m=v.length;switch(c){case"start":p=v[0][0]+f[0],d=v[1][0]+f[0],y=v[0][1]+f[1],g=v[1][1]+f[1];break;case"end":p=v[m-2][0]+f[0],d=v[m-1][0]+f[0],y=v[m-2][1]+f[1],g=v[m-1][1]+f[1]}}else p=r.xStart+f[0]||0,d=r.xEnd+f[0]||0,y=r.yStart+f[1]||0,g=r.yEnd+f[1]||0;switch(c){case"start":o=p0&&t>this._zlevelList[0]){for(i=0;it);i++);n=this._layers[this._zlevelList[i]]}this._zlevelList.splice(i+1,0,t),e=new Is($.createUniqueID("_levelLayer_"+t),this);var o=n?n.dom:this._bgDom;o.nextSibling?o.parentNode.insertBefore(e.dom,o.nextSibling):o.parentNode.appendChild(e.dom),e.initContext(),this._layers[t]=e,this._layerConfig[t]&&(new po).merge(e,this._layerConfig[t],!0),e.updateTransform()}return e}},{key:"getLayers",value:function(){return this._layers}},{key:"_updateLayerStatus",value:function(t){var e=this._layers,r={};for(var n in e)"hover"!==n&&(r[n]=e[n].elCount,e[n].elCount=0);for(var i=0;i0?1.1:1/1.1,r=this.painter.getLayers(),n=!1;for(var i in r)if("hover"!==i){var o=r[i],a=o.position;if(o.zoomable){o.__zoom=o.__zoom||1;var s=o.__zoom;s*=e,e=(s=Math.max(Math.min(o.maxZoom,s),o.minZoom))/o.__zoom,o.__zoom=s,a[0]-=(this._mouseX-a[0])*(e-1),a[1]-=(this._mouseY-a[1])*(e-1),o.scale[0]*=e,o.scale[1]*=e,o.dirty=!0,n=!0}}n&&this.painter.refresh(),this._dispatchAgency(this._lastHover,ta.EVENT.MOUSEWHEEL,t),this._mousemoveHandler(t)},mousemove:function(t){this._clickThreshold++,t=this._zrenderEventFixed(t),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=ga.Util_event.getX(t),this._mouseY=ga.Util_event.getY(t);var e=this._mouseX-this._lastX,r=this._mouseY-this._lastY;this._processDragStart(t),this._hasfound=0,this._event=t,this._iterateAndFindHover(),this._hasfound||((!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)&&(this._processOutShape(t),this._processDragLeave(t)),this._lastHover=null,this.storage.delHover(),this.painter.clearHover());var n="";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,e,r),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var i=this.painter.getLayers(),o=!1;for(var a in i)if("hover"!==a){var s=i[a];s.panable&&(n="move",s.position[0]+=e,s.position[1]+=r,o=!0,s.dirty=!0)}o&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?n="move":this._hasfound&&this._lastHover.clickable&&(n="pointer"),this.root.style.cursor=n,this._dispatchAgency(this._lastHover,ta.EVENT.MOUSEMOVE,t),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(t){var e=(t=this._zrenderEventFixed(t)).toElement||t.relatedTarget;if(e!=this.root)for(;e&&9!=e.nodeType;){if(e==this.root)return void this._mousemoveHandler(t);e=e.parentNode}t.zrenderX=this._lastX,t.zrenderY=this._lastY,this.root.style.cursor="",this._isMouseDown=0,this._processOutShape(t),this._processDrop(t),this._processDragEnd(t),this.painter.refreshHover(),this.dispatch(ta.EVENT.GLOBALOUT,t)},mousedown:function(t){if(this._clickThreshold=0,2==this._lastDownButton)return this._lastDownButton=t.button,void(this._mouseDownTarget=null);this._lastMouseDownMoment=new Date,t=this._zrenderEventFixed(t),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,ta.EVENT.MOUSEDOWN,t),this._lastDownButton=t.button},mouseup:function(t){t=this._zrenderEventFixed(t),this.root.style.cursor="",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,ta.EVENT.MOUSEUP,t),this._processDrop(t),this._processDragEnd(t)},touchstart:function(t){t=this._zrenderEventFixed(t,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(t),this._mousedownHandler(t)},touchmove:function(t){t=this._zrenderEventFixed(t,!0),this._mousemoveHandler(t),this._isDragging&&ga.Util_event.stop(t)},touchend:function(t){t=this._zrenderEventFixed(t,!0),this._mouseupHandler(t);var e=new Date;e-this._lastTouchMoment=0;i--){var o=r[i];if(void 0!==o.zlevel&&(t=this.painter.getLayer(o.zlevel,t),n[0]=this._mouseX,n[1]=this._mouseY,t.needTransform&&(ga.Util_matrix.invert(e,t.transform),ga.Util_vector.applyTransform(n,n,e))),this._findHover(o,n[0],n[1]))break}}},{key:"_mobildFindFixed",value:function(t){var e=[{x:10},{x:-20},{x:10,y:10},{y:-20}];this._lastHover=null,this._mouseX=t.zrenderX,this._mouseY=t.zrenderY,this._event=t,this._iterateAndFindHover();for(var r=0;!this._lastHover&&r=0&&this._clips.splice(e,1)}},{key:"_update",value:function(){for(var t=(new Date).getTime(),e=t-this._time,r=this._clips,n=r.length,i=[],o=[],a=0;a=0&&!(y[A]<=a);A--);A=Math.min(A,l-2)}else{for(A=C;Aa);A++);A=Math.min(A-1,l-2)}C=A,k=a;var s=y[A+1]-y[A];if(0!==s){var c,d;for(x=(a-y[A])/s,o?(_=g[A],w=g[0===A?A:A-1],S=g[A>l-2?l-1:A+1],E=g[A>l-3?l-1:A+2],f?Zs._catmullRomInterpolateArray(w,_,S,E,x,x*x,x*x*x,n(t,u),p):(c=h?Zs.rgba2String(I):Zs._catmullRomInterpolate(w,_,S,E,x,x*x,x*x*x),r(t,u,c))):f?Zs._interpolateArray(g[A],g[A+1],x,n(t,u),p):(h?(Zs._interpolateArray(g[A],g[A+1],x,I,1),d=Zs.rgba2String(I)):d=Zs._interpolateNumber(g[A],g[A+1],x),r(t,u,d)),A=0;A=0;e--)t[e].destroy()}}},{key:"setVisibility",value:function(t){t!==this.visibility&&(this.visibility=t,this.display(t),this.redrawThematicFeatures(this.map.getBounds()))}},{key:"display",value:function(t){this.div.style.display=t?"block":"none"}},{key:"setOpacity",value:function(t){if(t!==this.opacity){this.opacity=t;var e=this.div;$.modifyDOMElement(e,null,null,null,null,null,null,t),null!==this.map&&I().Evented.prototype.fire("changelayer",{layer:this,property:"opacity"})}}},{key:"addFeatures",value:function(t){}},{key:"removeFeatures",value:function(t){var e=this;if(t){if(t===e.features)return e.removeAllFeatures();$.isArray(t)||"function"==typeof t||(t=[t]);for(var r=[],n=0;n=r.left&&a.x<=r.right&&a.y>=r.top&&a.y<=r.bottom){n=!0;break}}return n}},{key:"clearCache",value:function(){this.cache={},this.charts=[]}},{key:"removeFeatures",value:function(t){this.clearCache(),Au(xu(e.prototype),"removeFeatures",this).call(this,t)}},{key:"removeAllFeatures",value:function(){this.clearCache(),Au(xu(e.prototype),"removeAllFeatures",this).call(this)}},{key:"redraw",value:function(){return this.clearCache(),!!this.renderer&&(this.redrawThematicFeatures(this.map.getBounds()),!0)}},{key:"clear",value:function(){this.renderer&&(this.renderer.clearAll(),this.renderer.refresh()),this.removeAllFeatures(),this.clearCache()}}])&&vu(r.prototype,n),i&&vu(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Su(t){"@babel/helpers - typeof";return(Su="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Eu(t,e){for(var r=0;rn&&(n=u[0]),u[1]i&&(i=u[1]))}return t.__rect={x:e,y:r,width:n-e,height:i-r},t.__rect}},{key:"getRectNoRotation",value:function(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,r=this.refOriginalPosition,n=ga.Util_area.getTextHeight("ZH",t.textFont),i=ga.Util_area.getTextWidth(t.text,t.textFont),o=ga.Util_area.getTextHeight(t.text,t.textFont),a=t.x+r[0];"end"==t.textAlign||"right"==t.textAlign?a-=i:"center"==t.textAlign&&(a-=i/2),e="top"==t.textBaseline?t.y+r[1]:"bottom"==t.textBaseline?t.y+r[1]-o:t.y+r[1]-o/2;var s,u=!1;if(t.maxWidth){var l=parseInt(t.maxWidth);l-1&&(i+=!0===u?n/3*(i/s):n/3));return{x:a,y:e,width:i,height:o}}},{key:"getTextBackground",value:function(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;if(!e&&t.__textBackground)return t.__textBackground;var n=this.getRectNoRotation(t),i=t.x+r[0],o=t.y+r[1],a=[];if(t.textRotation&&0!==t.textRotation){var s=t.textRotation,u=this.getRotatedLocation(n.x,n.y,i,o,s),l=this.getRotatedLocation(n.x+n.width,n.y,i,o,s),c=this.getRotatedLocation(n.x+n.width,n.y+n.height,i,o,s),f=this.getRotatedLocation(n.x,n.y+n.height,i,o,s);a.push(u),a.push(l),a.push(c),a.push(f)}else{var h=[n.x,n.y],p=[n.x+n.width,n.y],d=[n.x+n.width,n.y+n.height],y=[n.x,n.y+n.height];a.push(h),a.push(p),a.push(d),a.push(y)}return t.__textBackground=a,t.__textBackground}},{key:"getRotatedLocation",value:function(t,e,r,n,i){var o,a,s=new Array;return e=-e,n=-n,i=-i,o=(t-r)*Math.cos(i/180*Math.PI)-(e-n)*Math.sin(i/180*Math.PI)+r,a=(t-r)*Math.sin(i/180*Math.PI)+(e-n)*Math.cos(i/180*Math.PI)+n,s[0]=o,s[1]=-a,s}}])&&Wl(r.prototype,n),i&&Wl(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function tc(t){"@babel/helpers - typeof";return(tc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ec(t,e){for(var r=0;r0&&("stroke"==r.brushType||"both"==r.brushType)&&(n||(t.beginPath(),this.buildPath(t,r)),this.setCtxGlobalAlpha(t,"stroke",r),t.stroke(),this.setCtxGlobalAlpha(t,"reset",r)),this.drawText(t,r,this.style);var i=$.cloneObject(r);if(i.pointList&&this.holePolygonPointLists&&this.holePolygonPointLists.length>0)for(var o=this.holePolygonPointLists,a=o.length,s=0;s0&&("stroke"==i.brushType||"both"==i.brushType)?(n||(t.beginPath(),this.buildPath(t,i)),t.globalCompositeOperation="source-over",this.setCtxGlobalAlpha(t,"stroke",i),t.stroke(),this.setCtxGlobalAlpha(t,"reset",i)):t.globalCompositeOperation="source-over"}t.restore()}},{key:"buildPath",value:function(t,e){e.showShadow&&(t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY),this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,n=e.pointList;if(!(n.length<2))if(e.smooth&&"spline"!==e.smooth){var i,o,a,s=ga.SUtil_smoothBezier(n,e.smooth,!0,e.smoothConstraint,r);t.moveTo(n[0][0]+r[0],n[0][1]+r[1]);for(var u=n.length,l=0;lo&&(o=u[l][0]+r[0]),u[l][1]+r[1]s&&(s=u[l][1]+r[1]);return n="stroke"==t.brushType||"fill"==t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(i-n/2),y:Math.round(a-n/2),width:o-i+n,height:s-a+n},t.__rect}}])&&lc(r.prototype,n),i&&lc(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function gc(t){"@babel/helpers - typeof";return(gc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vc(t,e){for(var r=0;rc&&(r*=c/(a=r+n),n*=c/a),i+o>c&&(i*=c/(a=i+o),o*=c/a),n+i>f&&(n*=f/(a=n+i),i*=f/a),r+o>f&&(r*=f/(a=r+o),o*=f/a),t.moveTo(u+r,l),t.lineTo(u+c-n,l),0!==n&&t.quadraticCurveTo(u+c,l,u+c,l+n),t.lineTo(u+c,l+f-i),0!==i&&t.quadraticCurveTo(u+c,l+f,u+c-i,l+f),t.lineTo(u+o,l+f),0!==o&&t.quadraticCurveTo(u,l+f,u,l+f-o),t.lineTo(u,l+r),0!==r&&t.quadraticCurveTo(u,l,u+r,l)}},{key:"buildPath",value:function(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;e.radius?this._buildRadiusPath(t,e):(t.moveTo(e.x+r[0],e.y+r[1]),t.lineTo(e.x+r[0]+e.width,e.y+r[1]),t.lineTo(e.x+r[0]+e.width,e.y+r[1]+e.height),t.lineTo(e.x+r[0],e.y+r[1]+e.height),t.lineTo(e.x+r[0],e.y+r[1])),t.closePath()}},{key:"getRect",value:function(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,r=this.refOriginalPosition;return t.__rect?t.__rect:(e="stroke"==t.brushType||"fill"==t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(t.x+r[0]-e/2),y:Math.round(t.y+r[1]-e/2),width:t.width+e,height:t.height+e},t.__rect)}}])&&Ec(r.prototype,n),i&&Ec(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Pc(t){"@babel/helpers - typeof";return(Pc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lc(t,e){for(var r=0;r1?ga.Util_computeBoundingBox.arc(a,s,u,c,f,!h,r,i):(r[0]=i[0]=a,r[1]=i[1]=s),ga.Util_computeBoundingBox.arc(a,s,l,c,f,!h,n,o),ga.Util_vector.min(r,r,n),ga.Util_vector.max(i,i,o),t.__rect={x:r[0],y:r[1],width:i[0]-r[0],height:i[1]-r[1]},t.__rect}}])&&Lc(r.prototype,n),i&&Lc(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function zc(t){"@babel/helpers - typeof";return(zc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gc(t,e){for(var r=0;r=15){var h=parseInt(o.axis3DParameter),p=[i[0]-h,i[1]+h];o.axisUseArrow?(c.push([p[0]+1.5,p[1]-7.5]),c.push([p[0]-1,p[1]+1]),c.push([p[0]+7.5,p[1]-1.5]),f.push([p[0],p[1]])):f.push([p[0],p[1]]),f.push([i[0],i[1]])}f.push([i[2]+5,i[1]])}else{var d=Math.abs(i[1]-i[3])/l,y=i[3];f.push([i[0],y-5]);for(var g=0;g=15){var m=parseInt(o.axis3DParameter),b=[i[0]-m,i[1]+m];o.axisUseArrow?(c.push([b[0]+1.5,b[1]-7.5]),c.push([b[0]-1,b[1]+1]),c.push([b[0]+7.5,b[1]-1.5]),f.push([b[0],b[1]])):f.push([b[0],b[1]]),f.push([i[0],i[1]])}f.push([i[2]+5,i[1]])}if(o.axisUseArrow){var A=[[i[2]+5,i[1]+4],[i[2]+13,i[1]],[i[2]+5,i[1]-4]],x=[[i[0]-4,i[3]-5],[i[0],i[3]-13],[i[0]+4,i[3]-5]],w=new Ju(A);w.style={fillColor:"#008acd"},$.copyAttributesWithClip(w.style,o.axisStyle),s.push(t.createShape(w));var _=new Ju(x);if(_.style={fillColor:"#008acd"},$.copyAttributesWithClip(_.style,o.axisStyle),s.push(t.createShape(_)),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){var S=new Ju(c);S.style={fillColor:"#008acd"},$.copyAttributesWithClip(S.style,o.axisStyle),s.push(t.createShape(S))}}var E=new Hu(f);E.style={strokeLinecap:"butt",strokeLineJoin:"round",strokeColor:"#008acd",strokeWidth:1},o.axisStyle&&$.copyAttributesWithClip(E.style,o.axisStyle),E.clickable=!1,E.hoverable=!1;var C=[t.createShape(E)],k=[];if(o.axisYLabels&&o.axisYLabels.length&&o.axisYLabels.length>0){var I=o.axisYLabels,T=I.length,O=[0,0];if(o.axisYLabelsOffset&&o.axisYLabelsOffset.length&&(O=o.axisYLabelsOffset),1==T){var M=new xl(i[0]-5+O[0],i[3]+O[1],I[0]);M.style={labelAlign:"right"},o.axisYLabelsStyle&&$.copyAttributesWithClip(M.style,o.axisYLabelsStyle),M.clickable=!1,M.hoverable=!1,k.push(t.createShape(M))}else for(var P=i[3],L=Math.abs(i[1]-i[3])/(T-1),N=0;N0){var D=o.axisXLabels,B=D.length,F=[0,0];if(o.axisXLabelsOffset&&o.axisXLabelsOffset.length&&(F=o.axisXLabelsOffset),n&&n.xPositions&&n.xPositions.length&&n.xPositions.length==B)for(var z=n.xPositions,G=0;G=0&&r[i]&&$.copyAttributesWithClip(a,r[i]),n&&n.length&&void 0!==o)for(var s=n,u=s.length,l=parseFloat(o),c=0;c0){var l=o[o.length-1];if(Math.abs(l[0]-n[0])<=a&&Math.abs(l[1]-n[1])<=a)continue}o.push(n)}if(o.length<2)return null;var c=new Object;(c=$.copyAttributesWithClip(c,this.style,["pointList"])).pointList=o;var f=new _c({style:c,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(f.highlightStyle=this.highlightStyle),f.refOriginalPosition=this.location,f.refDataID=this.data.id,f.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&$.copyAttributesWithClip(f,this.shapeOptions),this.shapes.push(f)}},{key:"multiPointToTF",value:function(t){for(var e=t.components,r=[],n=[],i=this.location,o=[],a=this.nodesClipPixel,s=0;s0){var l=o[o.length-1];if(Math.abs(l[0]-n[0])<=a&&Math.abs(l[1]-n[1])<=a)continue}o.push(n);var c=new Object;c.r=6,(c=$.copyAttributesWithClip(c,this.style)).x=n[0],c.y=n[1];var f=new Ql({style:c,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(f.highlightStyle=this.highlightStyle),f.refOriginalPosition=i,f.refDataID=this.data.id,f.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&$.copyAttributesWithClip(f,this.shapeOptions),this.shapes.push(f)}}},{key:"multiLineStringToTF",value:function(t){for(var e=t.components,r=0;r0){var h=o[o.length-1];if(Math.abs(h[0]-n[0])<=u&&Math.abs(h[1]-n[1])<=u)continue}o.push(n)}}else{a=[];for(var p=0;p0){var d=a[a.length-1];if(Math.abs(d[0]-n[0])<=u&&Math.abs(d[1]-n[1])<=u)continue}a.push(n)}}a.length<2||s.push(a)}if(!(o.length<2)){var y={};(y=$.copyAttributesWithClip(y,this.style,["pointList"])).pointList=o;var g=new yc({style:y,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(g.highlightStyle=this.highlightStyle),g.refOriginalPosition=this.location,g.refDataID=this.data.id,g.isHoverByRefDataID=this.isMultiHover,s.length>0&&(g.holePolygonPointLists=s),this.shapeOptions&&$.copyAttributesWithClip(g,this.shapeOptions),this.shapes.push(g)}}},{key:"rectangleToTF",value:function(t){var e=this.location,r=new fe(t.x,t.y),n=this.layer.map.getResolution(),i=this.getLocalXY(r),o=new Object;o.r=6,(o=$.copyAttributesWithClip(o,this.style)).x=i[0]-e[0],o.y=i[1]-e[1]-2*t.width/n,o.width=t.width/n,o.height=t.height/n;var a=new Mc({style:o,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(a.highlightStyle=this.highlightStyle),a.refOriginalPosition=e,a.refDataID=this.data.id,a.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&$.copyAttributesWithClip(a,this.shapeOptions),this.shapes.push(a)}},{key:"geoTextToTF",value:function(t){var e=this.location,r=this.getLocalXY(t),n=new Object;n.r=6,(n=$.copyAttributesWithClip(n,this.style,["x","y","text"])).x=r[0]-e[0],n.y=r[1]-e[1],n.text=t.text;var i=new $l({style:n,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(i.highlightStyle=this.highlightStyle),i.refOriginalPosition=e,i.refDataID=this.data.id,i.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&$.copyAttributesWithClip(i,this.shapeOptions),this.shapes.push(i)}},{key:"updateAndAddShapes",value:function(){var t=this.getLocalXY(this.lonlat);this.location=t;for(var e=this.layer.renderer,r=0,n=this.shapes.length;rs){var h=o[0];o.splice(0,1),delete i[h]}}}if(this.renderer.render(),r&&this.isHoverAble&&this.isMultiHover){var p=this.getShapesByFeatureID(r);this.renderer.updateHoverShapes(p)}}},{key:"createThematicFeature",value:function(t){var e=$.copyAttributesWithClip(this.style);t.style&&!0===this.isAllowFeatureStyle&&(e=$.copyAttributesWithClip(t.style));var r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=Hc.transformStyle(this.highlightStyle);for(var n=new Zc(t,this,Hc.transformStyle(e),r),i=0;i0&&0==this.labelFeatures.length)for(var r=this.setLabelsStyle(this.features),n=0,i=r.length;n=0&&d.x<=f.x&&d.y>=0&&d.y<=f.y){if(r.style.minZoomLevel>-1&&l<=r.style.minZoomLevel)continue;if(r.style.maxZoomLevel>-1&&l>r.style.maxZoomLevel)continue;var y=null;r.isStyleChange?(r.isStyleChange=null,y=this.calculateLabelBounds(r,d)):y=r.geometry.bsInfo.w&&r.geometry.bsInfo.h?this.calculateLabelBounds2(r,d):this.calculateLabelBounds(r,d);var g=new ye(0,f.y,f.x,0),v=y.length;if(this.isAvoid){var m=this.getAvoidInfo(g,y);if(m){if("left"===m.aspectW){r.style.labelXOffset+=m.offsetX;for(var b=0;b=i[u].start&&a=i[u].start&&as&&(s=r,u="top")}if(e.y>t.bottom){var n=Math.abs(e.y-t.bottom);n>s&&(s=n,u="bottom")}if(e.xa&&(a=i,l="left")}if(e.x>t.right){var o=Math.abs(e.x-t.right);o>a&&(a=o,l="right")}}}}},{key:"isQuadrilateralOverLap",value:function(t,e){var r=t.length,n=e.length;if(5!==r||5!==n)return null;for(var i=!1,o=0;ot-n&&r.time-1?e=1:["degrees","deg","degree","dd"].indexOf(t.toLocaleLowerCase())>-1?e=2*Math.PI*6378137/360:t===Mn.KILOMETER?e=1e3:t===Mn.INCH?e=.025399999918:t===Mn.FOOT&&(e=.3048),e},kf={SquareFoot:10.763910417,SquareKiloMeter:1e-6,SquareMeter:1,SquareMile:3.86e-7,SquareYard:1.195990046};function If(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[-180,180],i=n[1],o=n[0],a=i-o;return t===i&&e?t:t===o&&r?t:0===((t-o)%a+a)%a&&e?i:((t-o)%a+a)%a+o}function Tf(t){var e=parseInt(t),r=parseInt(60*(t-e)),n=parseInt(60*(60*(t-e)-r));return r=0===parseInt(r/10)?"0".concat(r):r,n=0===parseInt(n/10)?"0".concat(n):n,"".concat(e,"°").concat(r,"'").concat(n)}function Of(t,e,r){return 1/(t*e*(1/.0254)*Cf(r))}function Mf(t){"@babel/helpers - typeof";return(Mf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pf(t,e){for(var r=0;rthis.mapVOptions.maxZoom)}},{key:"_getResolution",value:function(){var t=this.map.getBounds(),e=(t.getEast()-t.getWest())/this.map.getCanvas().getBoundingClientRect().width;return Cf("DEGREE")*e}},{key:"_getCenterPixel",value:function(){return this.map.project(new(I().LngLat)(0,0))}},{key:"addData",value:function(t,e){this.renderer.addData(t,e)}},{key:"update",value:function(t){this.renderer.update(t)}},{key:"getData",value:function(){return this.renderer&&(this.dataSet=this.renderer.getData()),this.dataSet}},{key:"removeData",value:function(t){this.renderer&&this.renderer.removeData(t)}},{key:"clearData",value:function(){this.renderer.clearData()}},{key:"show",value:function(){return this.renderer&&this.renderer.show(),this}},{key:"hide",value:function(){return this.renderer&&this.renderer.hide(),this}},{key:"getTopLeft",value:function(){var t,e=this.map;e&&(t=e.getBounds().getNorthWest());return t}},{key:"bindEvent",value:function(){var t=this.map;this.mapVOptions.methods&&(this.mapVOptions.methods.click&&t.on("click",this.renderer.clickEvent),this.mapVOptions.methods.mousemove&&t.on("mousemove",this.renderer.mousemoveEvent))}},{key:"unbindEvent",value:function(){var t=this.map;this.mapvOptions.methods&&(this.mapvOptions.methods.click&&t.off("click",this.clickEvent),this.mapvOptions.methods.mousemove&&t.off("mousemove",this.mousemoveEvent))}},{key:"setVisibility",value:function(t){t!==this.visibility&&(this.visibility=t,t?this.show():this.hide())}},{key:"setZIndex",value:function(t){this.renderer.setZIndex(t)}}])&&Pf(t.prototype,e),r&&Pf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function jf(t){"@babel/helpers - typeof";return(jf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rf(t,e){for(var r=0;r",a="
"+(e._createLegendElement.call(e)||"")+"
";this._container.innerHTML=o+a}return e._appendLegendCSSStyle(),this._container},r.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map=void 0},new r}},{key:"_createLegendElement",value:function(){}},{key:"_addLayer",value:function(){var t=this.getLayerStyleOptions(),e=this.id?this.id:"theme3DLayer",r=this.sourceId=e+"Source";this.map.getSource(r)?(this.map.removeSource(r),this.map.addSource(r,{type:"geojson",data:this.data})):this.map.addSource(r,{type:"geojson",data:this.data}),this.map.addLayer({id:e,type:"fill-extrusion",source:r,paint:t}),this.map.moveLayer(e)}},{key:"_addHighLightLayer",value:function(){if(this.map){var t=this.map;t.addLayer({id:this._highlightLayerId,type:"fill-extrusion",source:this.sourceId,paint:this.getHighlightStyleOptions(),filter:["in","$id",""]}),this._selectFeatureId=null,t.on("mousemove",this.id,this._onMouseMove.bind(this)),t.on("mouseout",this.id,this._onMouseMove.bind(this))}}},{key:"_onMouseMove",value:function(t){var e=this,r=this.map,n=r.queryRenderedFeatures(t.point,{layers:[e.id]});if(e.highlight&&e.highlight.callback&&e.highlight.callback(n,t),!n||n.length<1)return e._clearHighlight.call(e),void(e._selectFeatureId=null);var i=n[0].id;e._selectFeatureId!==i&&(e._selectFeatureId=i,r.setFilter(e._highlightLayerId,["==","$id",e._selectFeatureId]))}},{key:"_clearHighlight",value:function(){this.map&&this.map.setFilter(this._highlightLayerId,["in","$id",""])}},{key:"_appendLegendCSSStyle",value:function(){var t=document.createElement("style");t.type="text/css";t.innerHTML="\n .legend {\n display: inline-block;\n border-radius: 2px;\n -moz-border-radius: 2px;\n -webkit-border-radius: 2px;\n font-size: 12px;\n color: rgba(0, 0, 0, 0.8);\n background-color: rgb(255, 255, 255);\n }\n .legend-light {\n color: rgba(0, 0, 0, 0.8);\n background-color: rgb(255, 255, 255);\n box-shadow: 0px 0px 6px #bbbbbb;\n -moz-box-shadow: 0px 6px 10px #bbbbbb;\n -webkit-box-shadow: 0px 0px 6px #bbbbbb;\n }\n .legend-dark {\n color: rgba(255, 255, 255, 0.8);\n background-color: rgb(64, 64, 64);\n }\n .legend .legend-title {\n min-height: 14px;\n max-width: 500px;\n padding:6px 10px;\n }\n .legend-light .legend-title {\n color: rgba(0, 0, 0, 0.8);\n }\n .legend-dark .legend-title {\n color: rgba(255, 255, 255, 0.8);\n }\n .legend-content{\n padding:6px 10px;\n }\n "+this._legendCSSStyle(),document.getElementsByTagName("head")[0].appendChild(t)}},{key:"_legendCSSStyle",value:function(){return"\n .legend ul {\n padding: 0;\n margin: 0 16px;\n height: 100%;\n display: block;\n list-style: none;\n }\n\n .legend li {\n vertical-align: middle;\n }\n\n .legend li span:first-child {\n vertical-align: middle;\n }\n\n .legend li span:last-child {\n line-height: 28px;\n max-width: 200px;\n vertical-align: middle;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n -ms-text-overflow: ellipsis;\n }\n\n .legend-vertical li {\n height: 28px;\n }\n\n .legend-vertical li span:first-child {\n display: inline-block;\n width: 60px;\n height: 100%;\n }\n\n .legend-vertical li span:last-child {\n display: inline-block;\n margin-left: 16px;\n height: 100%;\n }\n\n .legend-horizontal li {\n height: 56px;\n float: left;\n }\n\n .legend-horizontal li span:first-child {\n display: block;\n width: 100%;\n height: 50%;\n }\n\n .legend-horizontal li span:last-child {\n display: block;\n vertical-align: middle;\n width: 60px;\n height: 50%;\n text-align: center;\n }\n "}},{key:"_extend",value:function(t){for(var e=0;e";for(t=0;t "+i;else i=i+"-"+this._getWrapperText(this.colorStops[t+1][0]);r+="
  • "+i+"
  • "}return r+=""}},{key:"_getWrapperText",value:function(t){var e=t*(null==this.legendRatio?1:parseFloat(this.legendRatio)),r=parseFloat(e);return r%1e6<=1e6?r.toString():parseInt(r/1e3)+"k"}}])&&zf(r.prototype,n),i&&zf(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Yf(t){"@babel/helpers - typeof";return(Yf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wf(t,e){for(var r=0;r0&&r.attributes){var n=this.themeField,i=r.attributes,o=this.styleGroups,a=!1,s=null;for(var u in i)if(n===u){a=!0,s=i[u];break}if(a)for(var l=0,c=o.length;l=o[l].start&&s"+n+""}return t+=""}}])&&sh(r.prototype,n),i&&sh(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function ph(t){"@babel/helpers - typeof";return(ph="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dh(t,e){for(var r=0;r0&&r.attributes){var n=this.themeField,i=r.attributes,o=this.styleGroups,a=!1,s=null;for(var u in i)if(n===u){a=!0,s=i[u];break}if(a)for(var l=0,c=o.length;l0&&void 0!==arguments[0]?arguments[0]:null;if(!t||0===t.length||t===this.graphics)return this.graphics.length=0,this.layer.props.data&&(this.layer.props.data.length=0),void this.update();$.isArray(t)||(t=[t]);for(var e=t.length-1;e>=0;e--){var r=t[e],n=$.indexOf(this.graphics,r);-1!==n&&this.graphics.splice(n,1)}this.update()}},{key:"update",value:function(){if("Awaiting state"!==this.layer.lifecycle){this.layer.setChangeFlags({dataChanged:!0,propsChanged:!0,viewportChanged:!0,updateTriggersChanged:!0});var t=this.getState(),e=parseInt(this.canvas.style.width),r=parseInt(this.canvas.style.height);t.width=e,t.height=r,this.layer.setState(t)}}},{key:"clear",value:function(){this.removeGraphics(),this.deckGL.finalize()}},{key:"remove",value:function(){this.mapOptions.targetElement.removeChild(this.canvas)}},{key:"destroy",value:function(){this.remove(),this.clear()}},{key:"moveTo",value:function(t,e){var r=document.getElementById(this.id);if(e=void 0===e||e){var n=document.getElementById(t);r&&n&&n.parentNode.insertBefore(r,n)}else{var i=document.getElementById(t);if(r){if(i.nextSibling)return void i.parentNode.insertBefore(r,i.nextSibling);i.parentNode.appendChild(r)}}}},{key:"setVisibility",value:function(t){this.canvas&&t!==this.visibility&&(this.visibility=t,this.canvas.style.display=t?"block":"none")}},{key:"draw",value:function(){var t=this.getState(),e={};for(var r in t)e[r]=t[r];var n=parseInt(this.canvas.style.width),i=parseInt(this.canvas.style.height);e.width=n,e.height=i,e.layers=[this.layer],e.canvas=this.canvas,this.deckGL.setProps(e)}},{key:"_initContainer",value:function(){this.canvas=this._createCanvas(this.mapOptions.mapElement),this.mapOptions.targetElement.appendChild(this.canvas)}},{key:"_createCanvas",value:function(t){var e=document.createElement("canvas");return this.id&&(e.id=this.id),e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.cursor="",e.width=parseInt(t.style.width),e.height=parseInt(t.style.height),e.style.width=t.style.width,e.style.height=t.style.height,e}},{key:"getState",value:function(){var t=this.functions.getMapState();return function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:null;this.renderer&&this.renderer.removeGraphics(t)}},{key:"clear",value:function(){this.renderer&&this.renderer.clear()}},{key:"remove",value:function(){this.renderer&&this.renderer.remove()}},{key:"moveTo",value:function(t,e){this.renderer.moveTo(t,e)}},{key:"setVisibility",value:function(t){this.renderer.setVisibility(t)}},{key:"getState",value:function(){return this.renderer.getState()}},{key:"getMapState",value:function(){var t={},e=this.map.getCenter(),r={longitude:e.lng,latitude:e.lat,zoom:this.map.getZoom(),maxZoom:this.map.getMaxZoom(),pitch:this.map.getPitch(),bearing:this.map.getBearing()};for(var n in r)t[n]=r[n];return this.map.getCRS&&this.map.getCRS()!==I().CRS.EPSG3857&&(t.coordinateSystem=this.coordinateSystem,t.isGeographicCoordinateSystem=this.isGeographicCoordinateSystem),t}}])&&kh(t.prototype,e),r&&kh(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),Oh=function(){try{return THREE}catch(t){return{}}}();function Mh(t,e,r){if(t===r||t===e)return t;var n=r-e;return((t-e)%n+n)%n+e}function Ph(t){return t*Math.PI/180}var Lh={matrix:[1,-1,0,0],projection:{R:6378137,minZoom:0,maxZoom:22,nativeMaxZoom:19,RAD:Math.PI/180,METERS_PER_DEGREE:6378137*Math.PI/180,MAX_LATITUDE:85.0511287798,project:function(t){var e=this.RAD,r=this.METERS_PER_DEGREE,n=this.MAX_LATITUDE,i=t instanceof Array?{lng:t[0],lat:t[1]}:{lng:t.lng,lat:t.lat},o=i.lng,a=Math.max(Math.min(n,i.lat),-n);return{x:o*r,y:(0===a?0:Math.log(Math.tan((90+a)*e/2))/e)*r}},unproject:function(t){var e,r=t.x,n=t.y,i=this.RAD,o=this.METERS_PER_DEGREE;return 0===n?e=0:(e=n/o,e=(2*Math.atan(Math.exp(e*i))-Math.PI/2)/i),{lng:Mh(r/o,-180,180),lat:Mh(e,-this.MAX_LATITUDE,this.MAX_LATITUDE)}},locate:function(t,e,r){if(!t)return null;if(e=e||0,r=r||0,!e&&!r)return t;var n=t.lng;if(0!==e){var i=Math.abs(e),o=Ph(t.lng);n=Mh(180*(o+=2*Math.sqrt(Math.pow(Math.sin(i/(2*this.R)),2)/Math.pow(Math.cos(o),2))*(i>0?1:-1))/Math.PI,-180,180)}var a=t.lat;if(0!==r){var s=Math.abs(r),u=Ph(t.lat);a=Mh(180*(u+=2*Math.sin(s/(2*this.R))*(s>0?1:-1))/Math.PI,-90,90)}return{lng:n,lat:a}},getResolution:function(t){if(!this.resolutions){for(var e=[],r=12756274*Math.PI,n=0;n<=this.maxZoom;n++)e[n]=r/(256*Math.pow(2,n));this.resolutions=e}var i=0|t,o=this.resolutions.length;i=i<0?0:i>o-1?o-1:i;var a=this.resolutions[i];return(0|t)!==t&&i!==o-1?a+(this.resolutions[i+1]-a)*(t-i):a}},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},lngLatToPoint:function(t,e){var r=this.project(t);return this.transform(r,this.projection.getResolution(e))},locate:function(t,e,r){return this.projection.locate(t,e,r)},transform:function(t,e){return{x:this.matrix[0]*(t.x-this.matrix[2])/e,y:this.matrix[1]*(t.y-this.matrix[3])/e}}};function Nh(t){"@babel/helpers - typeof";return(Nh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jh(t,e){for(var r=0;r=0;e--)t.children[e]instanceof Oh.Mesh&&t.remove(t.children[e]);return this}},{key:"clearAll",value:function(t){var e=this.scene;if(!e)return this;for(var r=e.children.length-1;r>=0;r--)!t&&e.children[r]instanceof Oh.Camera||e.remove(e.children[r]);return this}},{key:"setPosition",value:function(t,e){if(!t||!e)return this;var r=this.lngLatToPosition(e);return t.position.set(r.x,r.y,r.z),this}},{key:"lngLatToPosition",value:function(t){var e=Lh.projection.nativeMaxZoom,r=Lh.lngLatToPoint(t,e);return new Uh(r.x,r.y,-0)}},{key:"distanceToThreeVector3",value:function(t,e,r){var n=this.map,i=r||n.getCenter(),o=Lh.projection.nativeMaxZoom,a=Lh.locate(i,t,e),s=Lh.lngLatToPoint(i,o),u=Lh.lngLatToPoint(a,o),l=Math.abs(u.x-s.x)*Math.sign(t),c=Math.abs(u.y-s.y)*Math.sign(e);return new Uh(l,c,0)}},{key:"removeDuplicatedCoordinates",value:function(t){function e(t,e){return t[0]===e[0]&&t[1]===e[1]}for(var r=[].concat(t),n=r.length-1;n>=1;n--)e(r[n],r[n-1])&&r.splice(n,1);return e(r[0],r[r.length-1])&&r.splice(r.length-1,1),r}},{key:"getCoordinatesCenter",value:function(t){for(var e=0,r=0,n=0,i=0,o=t.length;i0?this.convertFastToPixelPoints(t):this.canvasContext.clearRect(0,0,this.maxWidth,this.maxWidth)}},{key:"convertFastToPixelPoints",value:function(t){var e,r,n,i,o,a,s,u=[],l=t.getEast()-t.getWest(),c=t.getNorth()-t.getSouth(),f=this.mapElement;i=l/f.width>c/f.height?l/f.width:c/f.height,this.useRadius=this.useGeoUnit?parseInt(this.radius/i):this.radius;for(var h=0;h0&&this.maxWidth>0))return!1;var r=this.canvasContext;r.setTransform(1,0,0,1,0,0),this.canvasContext.clearRect(0,0,this.maxWidth,this.maxHeight),this.drawCircle(this.useRadius),this.createGradient();for(var n=0;nt.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:this.options;(t=t||{}).strokeStyle=Object.assign({},jp,t.strokeStyle||{}),t.lngLabelStyle=Object.assign({},Np,t.lngLabelStyle||{}),t.latLabelStyle=Object.assign({},Np,t.latLabelStyle||{}),this.options=Object.assign({},Rp,t,{extent:this.getDefaultExtent(t.extent),wrapX:t.wrapX}),this.oldExtent=this.options.extent,this._calcInterval(),this.isRotate=!1,this.visible=this.options.visible,this.features=this._getGraticuleFeatures()}},{key:"_createCanvas",value:function(){if(!this.canvas){var t=this.mapElement;this.canvas=document.createElement("canvas"),this.canvas.id=this.canvasId,this.canvas.style.position="absolute",this.canvas.style.top="0px",this.canvas.style.left="0px";var e=("undefined"==typeof window?{}:window).devicePixelRatio||1;this.canvas.width=parseInt(t.style.width)*e,this.canvas.height=parseInt(t.style.height)*e,this.canvas.style.width=t.style.width,this.canvas.style.height=t.style.height,this.canvas.globalAlpha=this.options.opacity,this.targetElement.appendChild(this.canvas)}}},{key:"_drawCanvas",value:function(){this.canvas||this._createCanvas(),this.setVisibility(),this._reset()}},{key:"_resizeCallback",value:function(){this.targetElement&&this.targetElement.removeChild(this.canvas),this.canvas=null,this._drawCanvas()}},{key:"_reset",value:function(){this._updateRotate(),this._updateExtent(),this._calcInterval(),this._drawLabel()}},{key:"_updateRotate",value:function(){var t=this.getMapStateByKey("getBearing");this.isRotate=t>-180&&t<=-90||t>=90&&t<180}},{key:"_updateExtent",value:function(){if(this.options.wrapX&&!this.oldExtent){var t=this.getMapStateByKey("getBounds"),e=t._ne,r=t._sw;this.options.extent=[r.lng,r.lat,e.lng,e.lat]}}},{key:"_calcInterval",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.interval;"function"==typeof t?(t=t(this.map),this._currLngInterval=t,this._currLatInterval=t):(this._currLngInterval=t,this._currLatInterval=t)}},{key:"_formatLat",value:function(t){return this.options.latFormatTickLabel?this.options.latLabelFormatter(t):t<0?Tf(-1*t)+"S":t>0?Tf(t)+"N":""+Tf(t)}},{key:"_formatLng",value:function(t){return this.options.lngLabelFormatter?this.options.lngLabelFormatter(t):(t=If(t))>0&&t<=180?Tf(t)+"E":t<0&&t>=-180?Tf(-1*t)+"W":""+Tf(t)}},{key:"_parsePxToInt",value:function(t){t.length>2&&"p"===t.charAt(t.length-2)&&(t=t.substr(0,t.length-2));try{return parseInt(t,10)}catch(t){console.log(t)}return 0}},{key:"_drawLabel",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.visible,r=this.canvas,n=r.getContext("2d");if(e&&this.options.showLabel){if(this.mapElement){this._currLngInterval&&this._currLatInterval||this._calcInterval(),n.clearRect(0,0,r.width,r.height);var i=this.options,o=i.lngLabelStyle,a=i.latLabelStyle,s=this._getGridiculePoints(),u=s.lngPoints,l=s.latPonits;u.forEach(function(e){t._drawLng(n,e[0],e[1],e[2],o)}),l.forEach(function(e){t._drawLat(n,e[0],e[1],e[2],a)})}}else n.clearRect(0,0,r.width,r.height)}},{key:"_drawLat",value:function(t,e,r,n,i){t=this._setLabelStyle(t,i);var o=this.canvas.width,a=12;try{var s=t.font.split(" ")[0];a=this._parsePxToInt(s)}catch(t){console.log(t)}if(!n){var u=e;e=r,r=this.getMapStateByKey("project",[u,e])}var l=this._formatLat(e),c=t.measureText(l).width;t.strokeText(l,(n?o:r.x)-c,(n?r:r.y)+a/2),t.fillText(l,(n?o:r.x)-c,(n?r:r.y)+a/2)}},{key:"_drawLng",value:function(t,e,r,n,i){t=this._setLabelStyle(t,i);var o=this.canvas.height;if(!n){var a=r;r=this.getMapStateByKey("project",[e,a])}var s=this._formatLng(e),u=t.measureText(s).width;t.strokeText(s,(n?r:r.x)-u/2,n?o:r.y),t.fillText(s,(n?r:r.x)-u/2,n?o:r.y)}},{key:"_getLatPoints",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-180,180],r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.features;if(i){if(this.options.wrapX&&-180===e[0]&&180===e[1])return[];var o=[];return i.forEach(function(i){var a=i.geometry.coordinates[0][1];if(i.geometry.coordinates[1][1]===a){var s="number"==typeof n?n:e[1];t.isRotate&&(s="number"==typeof r?r:e[0]),t.options.wrapX&&(o=o.concat(t._getWrapPoints(s,a,[s,s]))),o.push([s,a])}}),o}}},{key:"_getLngPoints",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-90,90],r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.features;if(i){var o="number"==typeof r?r:e[0];this.isRotate&&(o="number"==typeof n?n:e[1]);var a=[];return i.forEach(function(e){var r=e.geometry.coordinates[0][0];e.geometry.coordinates[1][0]===r&&(a.push([r,o]),t.options.wrapX&&(a=a.concat(t._getWrapPoints(r,o))))}),a}}},{key:"_getWrapPoints",value:function(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.oldExtent,n=[],i=this.getMapStateByKey("getBounds"),o=i._ne,a=i._sw,s=r.length>2?r[2]:r[1];t>=a.lng;){var u=If(t,180===s,-180===r[0]);(!r||u>=r[0]&&u<=s)&&n.push([t,e]),t-=360}for(;t<=o.lng;){var l=If(t,180===s,-180===r[0]);(!r||l>=r[0]&&l<=s)&&n.push([t,e]),t+=360}return n}},{key:"_getGridiculePoints",value:function(){var t=this._getEdgeLat(),e=this._getEdgeLng(),r=this._getRange(),n=r.latRange,i=r.lngRange,o=r.firstLat,a=r.firstLng,s=r.lastLat,u=r.lastLng;return{latPonits:this._getUniquePoint(this._getLatPoints(i,a,u),t,1),lngPoints:this._getUniquePoint(this._getLngPoints(n,o,s),e,0)}}},{key:"_getEdgeLat",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._currLatInterval,r=[],n=[],i=this.canvas.width,o=this.canvas.height,a=this._getRange().extent,s=this.getMapStateByKey("getBounds")._ne;if(this.options.wrapX&&If(s.lng)>a[2])return[];for(var u=this._countDecimals(e),l=0;l<=o;l++){var c=this.getMapStateByKey("unproject",[i,l]),f=If(c.lng);(this.options.wrapX?f>=a[0]&&f<=a[2]:c.lng>=a[0]&&c.lng<=a[2])&&c.lat>=a[1]&&c.lat<=a[3]&&(r.push([c.lat,l]),n.push(c.lat),void 0===t&&c.lat.toFixed(u)%e==0&&(t=Number(c.lat.toFixed(u))))}var h=this._getIntersectRange(t,n,r,e),p=h.first,d=h.last,y=h.coordinates,g=h.points;t=Math.min(Math.max(p,-90),90);var v=Math.max(Math.min(Math.round(d),90),-90);return-90!==t||-90!==v?this._getClosestCoordinate(t,v,y,g,e):[]}},{key:"_getEdgeLng",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._currLngInterval,r=[],n=[],i=this.canvas.width,o=this.canvas.height,a=this.options.extent,s=this._countDecimals(e),u=this.getMapStateByKey("getBounds")._sw;if(this.options.wrapX&&If(u.lat)>a[3])return[];for(var l=0;l<=i;l++){var c=this.getMapStateByKey("unproject",[l,o]),f=If(c.lng);(this.options.wrapX?f>=a[0]&&f<=a[2]:c.lng>=a[0]&&c.lng<=a[2])&&c.lat>=a[1]&&c.lat<=a[3]&&(r.push([c.lng,l]),n.push(c.lng),void 0===t&&c.lng.toFixed(s)%e==0&&(t=Number(c.lng.toFixed(s))))}var h=this._getIntersectRange(t,n,r,e),p=h.first,d=h.last,y=h.coordinates,g=h.points;return t=p,this._getClosestCoordinate(t,d,y,g,e)}},{key:"_getIntersectRange",value:function(t,e,r,n){var i=e[e.length-1];if(t>i){i=t,e.reverse(),r.reverse();for(var o=this._countDecimals(n),a=0;a<=e.length;a++){var s=e[a];if(s.toFixed(o)%n==0){t=Number(s.toFixed(o));break}}}return{first:t,last:i,coordinates:e,points:r}}},{key:"_getClosestCoordinate",value:function(t,e,r,n,i){for(var o=[],a=t;a<=e;){var s=this._getClosestNumberIndex(a,r),u=n[s];o.push([Math.round(u[0]),u[1],!0]),a+=i,r=r.slice(s),n=n.slice(s)}return o}},{key:"_getClosestNumberIndex",value:function(t,e){for(var r=0,n=Number.MAX_VALUE,i=0;i2&&void 0!==arguments[2]?arguments[2]:0;if(this.options.wrapX)return t.concat(e);if(!e||0===e.length)return t;var n=e,i=this.canvas.width,o=this.canvas.height;for(var a in t){var s=this.getMapStateByKey("project",t[a]),u=n.findIndex(function(e){return e[0]===t[a][r]});u<=-1?n.push(t[a]):s&&s.x>=0&&s.x<=i&&s.y>=0&&s.y<=o&&(n[u]=t[a])}return n}},{key:"_countDecimals",value:function(t){return Math.floor(t)!==t&&t.toString().split(".")[1].length||0}},{key:"_getGraticuleFeatures",value:function(){var t=this._currLngInterval||10,e=this._currLatInterval||10,r=[],n=this._getRange(),i=n.latRange,o=n.lngRange,a=n.firstLat,s=n.firstLng,u=n.lastLat,l=n.lastLng;this.options.wrapX&&!this.oldExtent&&(i=[-90,90],o=[-180,180],a=s=u=l=null),"number"==typeof s&&r.unshift(this._makeLineFeature(this._makeLineCoords(s,i,a,u))),"number"==typeof l&&r.unshift(this._makeLineFeature(this._makeLineCoords(l,i,a,u)));for(var c=o[0];c<=o[1];c+=t)r.unshift(this._makeLineFeature(this._makeLineCoords(c,i,a,u)));"number"==typeof a&&r.unshift(this._makeLineFeature(this._makeLineCoords(a,o,s,l,"lat"))),"number"==typeof u&&r.unshift(this._makeLineFeature(this._makeLineCoords(u,o,s,l,"lat")));for(var f=i[0];f<=i[1];f+=e)r.unshift(this._makeLineFeature(this._makeLineCoords(f,o,s,l,"lat")));return r}},{key:"_getRange",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.extent&&Op(this.options.extent);t&&0!==t.length||(t=this.getDefaultExtent());var e={};if((t=t.map(function(t){return Number(t.toFixed(6))}))[1]%this._currLatInterval!=0){e.firstLat=t[1];var r=Math.ceil(t[1]/this._currLatInterval);t[1]=r*this._currLatInterval}if(t[3]%this._currLatInterval!=0){e.lastLat=t[3];var n=Math.floor(t[3]/this._currLatInterval);t[3]=n*this._currLatInterval}if(t[0]%this._currLngInterval!=0){e.firstLng=t[0];var i=Math.ceil(t[0]/this._currLngInterval);t[0]=i*this._currLngInterval}if(t[2]%this._currLngInterval!=0){e.lastLng=t[2];var o=Math.floor(t[2]/this._currLngInterval);t[2]=o*this._currLngInterval}return Object.assign({latRange:[t[1],t[3]],lngRange:[t[0],t[2]],extent:t},e)}},{key:"_makeLineCoords",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[-90,90],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"lng";t="lng"===i?this._lngFix(t):t,r="number"==typeof r?r:e[0],n="number"==typeof n?n:e[1];for(var o=Math.abs(r-n),a=[],s=r;s<=n;s+=o)"lng"===i?a.push([t,s]):a.push([s,t]);return a}},{key:"_makeLineFeature",value:function(t){return{type:"Feature",geometry:{type:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"LineString",coordinates:t}}}},{key:"_lngFix",value:function(t){return t>=180?180:t<=-180?-180:t}},{key:"_transformStrokeStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.strokeStyle;if(!t||"string"==typeof t)return{paint:{"line-color":t||"rgba(0,0,0,0.2)"}};var e={visibility:this.visible?"visible":"none","line-join":t.lineJoin||"round","line-cap":t.lineCap||"round"},r={"line-color":t.lineColor||"rgba(0,0,0,0.2)","line-width":t.lineWidth||1,"line-offset":t.lineDashOffset||0,"line-translate-anchor":"viewport","line-opacity":t.lineOpacity||1};return t.lineWidth&&("function"==typeof t.lineWidth?r["line-width"]=t.lineWidth(this.map):r["line-width"]=t.lineWidth),t.lindDasharray&&("function"==typeof t.lindDasharray?r["line-dasharray"]=t.lindDasharray(this.map):r["line-dasharray"]=t.lindDasharray),{layout:e,paint:r}}},{key:"_setLabelStyle",value:function(t,e){return e.textColor&&(t.fillStyle=e.textColor),e.textSize&&(t.font=e.textSize+" "+(e.textFont||["Calibri","sans-serif"]).join(",")),e.textHaloColor&&(t.strokeStyle=e.textHaloColor,t.lineWidth=e.textHaloWidth||1),e.textAnchor&&(t.textBaseline=this._getTxetBaseline(e.textAnchor),t.textAligin=this._getTxetAlign(e.textAligin)),t}},{key:"_getTxetBaseline",value:function(t){if(!t)return"bottom";var e=t.split("-");return e.includes("bottom")?"bottom":e.includes("top")?"top":e.includes("center")?"middle":void 0}},{key:"_getTxetAlign",value:function(t){if(!t)return"center";var e=t.split("-");return e.includes("left")?"left":e.includes("right")?"right":e.includes("center")?"center":void 0}}])&&Pp(t.prototype,e),r&&Pp(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Bp(t){"@babel/helpers - typeof";return(Bp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Fp(t,e){for(var r=0;r=this.options.minZoom&&e<=this.options.maxZoom,this.renderer&&(this.renderer.visible=this.visible),this.map.getLayer(this.sourceId)&&this.map.setLayoutProperty(this.sourceId,"visibility",this.visible?"visible":"none"),this.renderer&&this.renderer._drawLabel()}},{key:"setMinZoom",value:function(t){this.options.minZoom=t,this.setVisibility()}},{key:"setMaxZoom",value:function(t){this.options.maxZoom=t,this.setVisibility()}},{key:"setShowLabel",value:function(t){this.options.showLabel=t,this.renderer._drawLabel()}},{key:"setExtent",value:function(t){this.options.extent=this.getDefaultExtent(t,this.map),this.renderer.setExtent(t)}},{key:"setStrokeStyle",value:function(t){if(this.map&&this.map.getLayer(this.sourceId)){this.options.strokeStyle=t;var e=this.renderer._transformStrokeStyle(t),r=e.layout,n=e.paint;for(var i in r)this.map.setLayoutProperty(this.sourceId,i,r[i]);for(var o in n)this.map.setPaintProperty(this.sourceId,o,n[o])}}},{key:"setLngLabelStyle",value:function(t){this.options.lngLabelStyle=t,this.renderer._drawLabel()}},{key:"setLatLabelStyle",value:function(t){this.options.latLabelStyle=t,this.renderer._drawLabel()}},{key:"setIntervals",value:function(t){this.renderer&&this.renderer.setIntervals(t)}},{key:"getDefaultExtent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.map,r=(e.getCRS&&e.getCRS()||{}).lngLatExtent;if(r||(r=[-180,-85.05119,180,85.05119]),!t||0===t.length)return r;var n=I().LngLatBounds.convert(t),i=n._sw,o=n._ne;return t=[i.lng,i.lat,o.lng,o.lat],t=[Math.max(r[0],t[0]),Math.max(r[1],t[1]),Math.min(r[2],t[2]),Math.min(r[3],t[3])]}},{key:"addGraticuleLayer",value:function(){if(!this.map.getSource(this.sourceId)){var t={type:"geojson",data:{type:"FeatureCollection",features:this.renderer.features}};this.map.addSource(this.sourceId,t)}if(!this.map.getLayer(this.sourceId)){var e=Object.assign({id:this.sourceId,type:"line",source:this.sourceId},this.renderer._transformStrokeStyle());this.map.addLayer(e)}}},{key:"_getLatPoints",value:function(t,e,r,n){return this.renderer._getLatPoints(t,e,r,n)}},{key:"_bindEvent",value:function(){this.map.on("styledata",this.styleDataEevent),this.map.on("resize",this.resizeEvent),this.map.on("zoomend",this.zoomendEvent)}},{key:"_unbindEvent",value:function(){this.map.off("styledata",this.styleDataEevent),this.map.off("resize",this.resizeEvent),this.map.off("zoomend",this.zoomendEvent)}},{key:"_setLayerTop",value:function(){var t=this,e=this.map;if(e){var r=e.getStyle&&e.getStyle().layers;r&&r.length&&r.findIndex(function(e){return e.id===t.sourceId})!==r.length-1&&e.getLayer(this.sourceId)&&(e.removeLayer(this.sourceId),this.addGraticuleLayer())}}},{key:"updateGraticuleLayer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.renderer.features;if(this.map.getSource(this.sourceId)){var e={type:"FeatureCollection",features:t};this.map.getSource(this.sourceId).setData(e)}this.addGraticuleLayer()}}])&&Fp(t.prototype,e),r&&Fp(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(Gp||(Gp={}));var Yp,Wp=new Int32Array(2),qp=new Float32Array(Wp.buffer),Xp=new Float64Array(Wp.buffer),Kp=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0];function Jp(t){"@babel/helpers - typeof";return(Jp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zp(t,e){for(var r=0;r>24}},{key:"readUint8",value:function(t){return this.bytes_[t]}},{key:"readInt16",value:function(t){return this.readUint16(t)<<16>>16}},{key:"readUint16",value:function(t){return this.bytes_[t]|this.bytes_[t+1]<<8}},{key:"readInt32",value:function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}},{key:"readUint32",value:function(t){return this.readInt32(t)>>>0}},{key:"readInt64",value:function(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<>8}},{key:"writeUint16",value:function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}},{key:"writeInt32",value:function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}},{key:"writeUint32",value:function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}},{key:"writeInt64",value:function(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))}},{key:"writeUint64",value:function(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))}},{key:"writeFloat32",value:function(t,e){qp[0]=e,this.writeInt32(t,Wp[0])}},{key:"writeFloat64",value:function(t,e){Xp[0]=e,this.writeInt32(t,Wp[Kp?0:1]),this.writeInt32(t+4,Wp[Kp?1:0])}},{key:"getBufferIdentifier",value:function(){if(this.bytes_.length=0;r--)t.addInt32(e[r]);return t.endVector()}},{key:"startEndsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"addXy",value:function(t,e){t.addFieldOffset(1,e,0)}},{key:"createXyVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startXyVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addZ",value:function(t,e){t.addFieldOffset(2,e,0)}},{key:"createZVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startZVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addM",value:function(t,e){t.addFieldOffset(3,e,0)}},{key:"createMVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startMVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addT",value:function(t,e){t.addFieldOffset(4,e,0)}},{key:"createTVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startTVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addTm",value:function(t,e){t.addFieldOffset(5,e,0)}},{key:"createTmVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addInt64(e[r]);return t.endVector()}},{key:"startTmVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addType",value:function(t,e){t.addFieldInt8(6,e,Gp.Unknown)}},{key:"addParts",value:function(t,e){t.addFieldOffset(7,e,0)}},{key:"createPartsVector",value:function(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}},{key:"startPartsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"endGeometry",value:function(t){return t.endObject()}},{key:"createGeometry",value:function(e,r,n,i,o,a,s,u,l){return t.startGeometry(e),t.addEnds(e,r),t.addXy(e,n),t.addZ(e,i),t.addM(e,o),t.addT(e,a),t.addTm(e,s),t.addType(e,u),t.addParts(e,l),t.endGeometry(e)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"ends",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}},{key:"endsLength",value:function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"endsArray",value:function(){var t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"xy",value:function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"xyLength",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"xyArray",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"z",value:function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"zLength",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"zArray",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"m",value:function(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"mLength",value:function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"mArray",value:function(){var t=this.bb.__offset(this.bb_pos,10);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"t",value:function(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"tLength",value:function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"tArray",value:function(){var t=this.bb.__offset(this.bb_pos,12);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"tm",value:function(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):BigInt(0)}},{key:"tmLength",value:function(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"type",value:function(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):Gp.Unknown}},{key:"parts",value:function(e,r){var n=this.bb.__offset(this.bb_pos,18);return n?(r||new t).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*e),this.bb):null}},{key:"partsLength",value:function(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}}])&&rd(e.prototype,r),n&&rd(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function ad(t,e){for(var r=[],n=0;n>1]),r.push(i)}return r}function sd(t,e,r){if(!r||0===r.length)return[ad(t,e)];var n,i=0,o=Array.from(r).map(function(e){return t.slice(i,i=e<<1)});return e&&(i=0,n=Array.from(r).map(function(t){return e.slice(i,i=t)})),o.map(function(t,e){return ad(t,n?n[e]:void 0)})}function ud(t,e){var r=e;if(r===Gp.Unknown&&(r=t.type()),r===Gp.GeometryCollection){for(var n=[],i=0;i=0;r--)t.addInt8(e[r]);return t.endVector()}},{key:"startPropertiesVector",value:function(t,e){t.startVector(1,e,1)}},{key:"addColumns",value:function(t,e){t.addFieldOffset(2,e,0)}},{key:"createColumnsVector",value:function(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}},{key:"startColumnsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"endFeature",value:function(t){return t.endObject()}},{key:"finishFeatureBuffer",value:function(t,e){t.finish(e)}},{key:"finishSizePrefixedFeatureBuffer",value:function(t,e){t.finish(e,void 0,!0)}},{key:"createFeature",value:function(e,r,n,i){return t.startFeature(e),t.addGeometry(e,r),t.addProperties(e,n),t.addColumns(e,i),t.endFeature(e)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"geometry",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new od).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}},{key:"properties",value:function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}},{key:"propertiesLength",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"propertiesArray",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"columns",value:function(t,e){var r=this.bb.__offset(this.bb_pos,8);return r?(e||new hd).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}},{key:"columnsLength",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}}])&&dd(e.prototype,r),n&&dd(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}(),vd=(new TextEncoder,new TextDecoder);function md(t,e){var r={};if(!e||0===e.length)return r;var n=t.propertiesArray();if(!n)return r;for(var i=new DataView(n.buffer,n.byteOffset),o=t.propertiesLength(),a=0;a0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:function(t,e){if(!t.length)return e;if(!e.length)return t;var r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}(e,r.value)}})},xd.prototype.slice=function(t){if((t|=0)<0)throw new Error("invalid length");var e=this,r=this._array.length-this._index;if(this._index+t<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=t));var n=new Uint8Array(t);return n.set(this._array.subarray(this._index)),function i(){return e._source.read().then(function(o){return o.done?(e._array=Ad,e._index=0,r>0?n.subarray(0,r):null):r+o.value.length>=t?(e._array=o.value,e._index=t-r,n.set(o.value.subarray(0,t-r),r),n):(n.set(o.value,r),r+=o.value.length,i())})}()},xd.prototype.cancel=function(){return this._source.cancel()};var Ed=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bb=null,this.bb_pos=0}return e=t,n=[{key:"getRootAsCrs",value:function(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}},{key:"getSizePrefixedRootAsCrs",value:function(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}},{key:"startCrs",value:function(t){t.startObject(6)}},{key:"addOrg",value:function(t,e){t.addFieldOffset(0,e,0)}},{key:"addCode",value:function(t,e){t.addFieldInt32(1,e,0)}},{key:"addName",value:function(t,e){t.addFieldOffset(2,e,0)}},{key:"addDescription",value:function(t,e){t.addFieldOffset(3,e,0)}},{key:"addWkt",value:function(t,e){t.addFieldOffset(4,e,0)}},{key:"addCodeString",value:function(t,e){t.addFieldOffset(5,e,0)}},{key:"endCrs",value:function(t){return t.endObject()}},{key:"createCrs",value:function(e,r,n,i,o,a,s){return t.startCrs(e),t.addOrg(e,r),t.addCode(e,n),t.addName(e,i),t.addDescription(e,o),t.addWkt(e,a),t.addCodeString(e,s),t.endCrs(e)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"org",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"code",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}},{key:"name",value:function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"description",value:function(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"wkt",value:function(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"codeString",value:function(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}}])&&_d(e.prototype,r),n&&_d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function Cd(t){"@babel/helpers - typeof";return(Cd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kd(t,e){for(var r=0;r=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startEnvelopeVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addGeometryType",value:function(t,e){t.addFieldInt8(2,e,Gp.Unknown)}},{key:"addHasZ",value:function(t,e){t.addFieldInt8(3,+e,0)}},{key:"addHasM",value:function(t,e){t.addFieldInt8(4,+e,0)}},{key:"addHasT",value:function(t,e){t.addFieldInt8(5,+e,0)}},{key:"addHasTm",value:function(t,e){t.addFieldInt8(6,+e,0)}},{key:"addColumns",value:function(t,e){t.addFieldOffset(7,e,0)}},{key:"createColumnsVector",value:function(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}},{key:"startColumnsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"addFeaturesCount",value:function(t,e){t.addFieldInt64(8,e,BigInt("0"))}},{key:"addIndexNodeSize",value:function(t,e){t.addFieldInt16(9,e,16)}},{key:"addCrs",value:function(t,e){t.addFieldOffset(10,e,0)}},{key:"addTitle",value:function(t,e){t.addFieldOffset(11,e,0)}},{key:"addDescription",value:function(t,e){t.addFieldOffset(12,e,0)}},{key:"addMetadata",value:function(t,e){t.addFieldOffset(13,e,0)}},{key:"endHeader",value:function(t){return t.endObject()}},{key:"finishHeaderBuffer",value:function(t,e){t.finish(e)}},{key:"finishSizePrefixedHeaderBuffer",value:function(t,e){t.finish(e,void 0,!0)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"name",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"envelope",value:function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"envelopeLength",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"envelopeArray",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"geometryType",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):Gp.Unknown}},{key:"hasZ",value:function(){var t=this.bb.__offset(this.bb_pos,10);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"hasM",value:function(){var t=this.bb.__offset(this.bb_pos,12);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"hasT",value:function(){var t=this.bb.__offset(this.bb_pos,14);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"hasTm",value:function(){var t=this.bb.__offset(this.bb_pos,16);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"columns",value:function(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new hd).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}},{key:"columnsLength",value:function(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"featuresCount",value:function(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint64(this.bb_pos+t):BigInt("0")}},{key:"indexNodeSize",value:function(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readUint16(this.bb_pos+t):16}},{key:"crs",value:function(t){var e=this.bb.__offset(this.bb_pos,24);return e?(t||new Ed).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}},{key:"title",value:function(t){var e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"description",value:function(t){var e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"metadata",value:function(t){var e=this.bb.__offset(this.bb_pos,30);return e?this.bb.__string(this.bb_pos+e,t):null}}])&&kd(e.prototype,r),n&&kd(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function Od(t){for(var e=Td.getRootAsHeader(t),r=e.featuresCount(),n=e.indexNodeSize(),i=[],o=0;o0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function jd(t){return this instanceof jd?(this.v=t,this):new jd(t)}function Rd(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(t,e||[]),o=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(t){i[t]&&(n[t]=function(e){return new Promise(function(r,n){o.push([t,e,r,n])>1||s(t,e)})})}function s(t,e){try{(r=i[t](e)).value instanceof jd?Promise.resolve(r.value.v).then(u,l):c(o[0][2],r)}catch(t){c(o[0][3],t)}var r}function u(t){s("next",t)}function l(t){s("throw",t)}function c(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}var Dd=function(t){function e(e){var r=t.call(this,e)||this;return Object.defineProperty(r,"name",{value:"RepeaterOverflowError",enumerable:!1}),"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(r,r.constructor.prototype):r.__proto__=r.constructor.prototype,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r,r.constructor),r}return function(t,e){function r(){this.constructor=t}Md(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e}(Error);(function(){function t(t){if(t<0)throw new RangeError("Capacity may not be less than 0");this._c=t,this._q=[]}Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return this._q.length>=this._c},enumerable:!1,configurable:!0}),t.prototype.add=function(t){if(this.full)throw new Error("Buffer full");this._q.push(t)},t.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()}})(),function(){function t(t){if(t<1)throw new RangeError("Capacity may not be less than 1");this._c=t,this._q=[]}Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.add=function(t){for(;this._q.length>=this._c;)this._q.shift();this._q.push(t)},t.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()}}(),function(){function t(t){if(t<1)throw new RangeError("Capacity may not be less than 1");this._c=t,this._q=[]}Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.add=function(t){this._q.length=Ud;return Promise.resolve(e).then(function(e){return!r&&t.state>=Hd?Yd(t).then(function(t){return{value:t,done:!0}}):{value:e,done:r}})}function qd(t,e){var r,n;if(!(t.state>=Gd))if(t.state=Gd,t.onnext(),t.onstop(),null==t.err&&(t.err=e),0!==t.pushes.length||void 0!==t.buffer&&!t.buffer.empty)try{for(var i=Nd(t.pushes),o=i.next();!o.done;o=i.next()){o.value.resolve()}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}else Xd(t)}function Xd(t){var e,r;if(!(t.state>=Ud)){t.state=Hd||(t.state=zd)){t.state=zd;var e=function(t,e){if(Bd(e),t.pushes.length>=Vd)throw new Dd("No more than "+Vd+" pending calls to push are allowed on a single repeater.");if(t.state>=Gd)return Promise.resolve(void 0);var r,n=void 0===t.pending?Promise.resolve(e):t.pending.then(function(){return e});n=n.catch(function(e){t.state=Vd)throw new Dd("No more than "+Vd+" pending calls to next are allowed on a single repeater.");if(e.state<=Fd&&Jd(e),e.onnext(t),void 0!==e.buffer&&!e.buffer.empty){var r=Wd(e,e.buffer.remove());if(e.pushes.length){var n=e.pushes.shift();e.buffer.add(n.value),e.onnext=n.resolve}return r}if(e.pushes.length){var i=e.pushes.shift();return e.onnext=i.resolve,Wd(e,i.value)}return e.state>=Gd?(Xd(e),Wd(e,Yd(e))):new Promise(function(r){return e.nexts.push({resolve:r,value:t})})},t.prototype.return=function(t){Bd(t);var e=Zd.get(this);if(void 0===e)throw new Error("WeakMap error");return Xd(e),e.execution=Promise.resolve(e.execution).then(function(){return t}),Wd(e,Yd(e))},t.prototype.throw=function(t){var e=Zd.get(this);if(void 0===e)throw new Error("WeakMap error");return e.state<=Fd||e.state>=Gd||void 0!==e.buffer&&!e.buffer.empty?(Xd(e),null==e.err&&(e.err=t),Wd(e,Yd(e))):this.next(Promise.reject(t))},t.prototype[Symbol.asyncIterator]=function(){return this},t.race=ey,t.merge=ry,t.zip=ny,t.latest=iy,t}();function ty(t,e){var r,n,i=[],o=function(t){null!=t&&"function"==typeof t[Symbol.asyncIterator]?i.push(t[Symbol.asyncIterator]()):null!=t&&"function"==typeof t[Symbol.iterator]?i.push(t[Symbol.iterator]()):i.push(function(){return Rd(this,arguments,function(){return Ld(this,function(r){switch(r.label){case 0:return e.yieldValues?[4,jd(t)]:[3,3];case 1:return[4,r.sent()];case 2:r.sent(),r.label=3;case 3:return e.returnValues?[4,jd(t)]:[3,5];case 4:return[2,r.sent()];case 5:return[2]}})})}())};try{for(var a=Nd(t),s=a.next();!s.done;s=a.next()){o(s.value)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}function ey(t){var e=this,r=ty(t,{returnValues:!0});return new $d(function(t,n){return Pd(e,void 0,void 0,function(){var e,i,o,a,s,u;return Ld(this,function(l){switch(l.label){case 0:if(!r.length)return n(),[2];i=!1,n.then(function(){e(),i=!0}),l.label=1;case 1:l.trys.push([1,,5,7]),a=void 0,s=0,u=function(){var i,u,l,c,f,h;return Ld(this,function(p){switch(p.label){case 0:i=s;try{for(f=void 0,u=Nd(r),l=u.next();!l.done;l=u.next())c=l.value,Promise.resolve(c.next()).then(function(t){t.done?(n(),void 0===o&&(o=t)):s===i&&(s++,e(t))},function(t){return n(t)})}catch(t){f={error:t}}finally{try{l&&!l.done&&(h=u.return)&&h.call(u)}finally{if(f)throw f.error}}return[4,new Promise(function(t){return e=t})];case 1:return void 0===(a=p.sent())?[3,3]:[4,t(a.value)];case 2:p.sent(),p.label=3;case 3:return[2]}})},l.label=2;case 2:return i?[3,4]:[5,u()];case 3:return l.sent(),[3,2];case 4:return[2,o&&o.value];case 5:return n(),[4,Promise.race(r.map(function(t){return t.return&&t.return()}))];case 6:return l.sent(),[7];case 7:return[2]}})})})}function ry(t){var e=this,r=ty(t,{yieldValues:!0});return new $d(function(t,n){return Pd(e,void 0,void 0,function(){var e,i,o,a=this;return Ld(this,function(s){switch(s.label){case 0:if(!r.length)return n(),[2];e=[],i=!1,n.then(function(){var t,r;i=!0;try{for(var n=Nd(e),o=n.next();!o.done;o=n.next()){(0,o.value)()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}),s.label=1;case 1:return s.trys.push([1,,3,4]),[4,Promise.all(r.map(function(r,s){return Pd(a,void 0,void 0,function(){var a;return Ld(this,function(u){switch(u.label){case 0:u.trys.push([0,,6,9]),u.label=1;case 1:return i?[3,5]:(Promise.resolve(r.next()).then(function(t){return e[s](t)},function(t){return n(t)}),[4,new Promise(function(t){e[s]=t})]);case 2:return void 0===(a=u.sent())?[3,4]:a.done?(o=a,[2]):[4,t(a.value)];case 3:u.sent(),u.label=4;case 4:return[3,1];case 5:return[3,9];case 6:return r.return?[4,r.return()]:[3,8];case 7:u.sent(),u.label=8;case 8:return[7];case 9:return[2]}})})}))];case 2:return s.sent(),[2,o&&o.value];case 3:return n(),[7];case 4:return[2]}})})})}function ny(t){var e=this,r=ty(t,{returnValues:!0});return new $d(function(t,n){return Pd(e,void 0,void 0,function(){var e,i,o,a;return Ld(this,function(s){switch(s.label){case 0:if(!r.length)return n(),[2,[]];i=!1,n.then(function(){e(),i=!0}),s.label=1;case 1:s.trys.push([1,,6,8]),s.label=2;case 2:return i?[3,5]:(Promise.all(r.map(function(t){return t.next()})).then(function(t){return e(t)},function(t){return n(t)}),[4,new Promise(function(t){return e=t})]);case 3:return void 0===(o=s.sent())?[2]:(a=o.map(function(t){return t.value}),o.some(function(t){return t.done})?[2,a]:[4,t(a)]);case 4:return s.sent(),[3,2];case 5:return[3,8];case 6:return n(),[4,Promise.all(r.map(function(t){return t.return&&t.return()}))];case 7:return s.sent(),[7];case 8:return[2]}})})})}function iy(t){var e=this,r=ty(t,{yieldValues:!0,returnValues:!0});return new $d(function(t,n){return Pd(e,void 0,void 0,function(){var e,i,o,a,s,u=this;return Ld(this,function(l){switch(l.label){case 0:if(!r.length)return n(),[2,[]];i=[],o=!1,n.then(function(){var t,r;e();try{for(var n=Nd(i),a=n.next();!a.done;a=n.next()){(0,a.value)()}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}o=!0}),l.label=1;case 1:return l.trys.push([1,,5,7]),Promise.all(r.map(function(t){return t.next()})).then(function(t){return e(t)},function(t){return n(t)}),[4,new Promise(function(t){return e=t})];case 2:return void 0===(a=l.sent())?[2]:(s=a.map(function(t){return t.value}),a.every(function(t){return t.done})?[2,s]:[4,t(s.slice())]);case 3:return l.sent(),[4,Promise.all(r.map(function(e,r){return Pd(u,void 0,void 0,function(){var u;return Ld(this,function(l){switch(l.label){case 0:if(a[r].done)return[2,a[r].value];l.label=1;case 1:return o?[3,4]:(Promise.resolve(e.next()).then(function(t){return i[r](t)},function(t){return n(t)}),[4,new Promise(function(t){return i[r]=t})]);case 2:return void 0===(u=l.sent())?[2,a[r].value]:u.done?[2,u.value]:(s[r]=u.value,[4,t(s.slice())]);case 3:return l.sent(),[3,1];case 4:return[2]}})})}))];case 4:return[2,l.sent()];case 5:return n(),[4,Promise.all(r.map(function(t){return t.return&&t.return()}))];case 6:return l.sent(),[7];case 7:return[2]}})})})}function oy(t){"@babel/helpers - typeof";return(oy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ay(t,e){for(var r=0;rt)){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function my(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return by(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return by(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function by(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rthis.nodes[1]),this.nodes[1]=t}},{key:"toString",value:function(){return"[NodeRange level: ".concat(this._level,", nodes: ").concat(this.nodes[0],"-").concat(this.nodes[1],"]")}}])&&xy(t.prototype,e),r&&xy(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),a=n.minX,s=n.minY,u=n.maxX,l=n.maxY,yy.info("tree items: ".concat(e,", nodeSize: ").concat(r)),c=ky(e,r),f=c[0][0],void 0,y=c.length-1,h=new o([0,1],y),p=[h],yy.debug("starting stream search with queue: ".concat(p,", numItems: ").concat(e,", nodeSize: ").concat(r,", levelBounds: ").concat(c)),d=vy().mark(function t(){var n,h,d,y,g,v,m,b,A;return vy().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=p.shift(),yy.debug("popped node: ".concat(n,", queueLength: ").concat(p.length)),h=n.startNodeIdx(),d=h>=f,y=function(){var t=my(c[n.level()],2)[1],e=Math.min(n.endNodeIdx()+r,t);return d&&em.getFloat64(c+16,!0))){t.next=8;break}return t.abrupt("return",0);case 8:if(!(s>m.getFloat64(c+24,!0))){t.next=10;break}return t.abrupt("return",0);case 10:if(y=m.getBigUint64(c+32,!0),!d){t.next=18;break}return g=y,v=function(){if(r ").concat(A)),w.extendEndNodeIdx(Number(A)),t.abrupt("return",0);case 25:void 0,void 0,S=n.level()-1,E=[Number(A),Number(A)+1],_=new o(E,S),void 0!==w&&w.level()==_.level()?yy.info("Same level, but too far away. Pushing new request for nodeIdx: ".concat(A," rather than merging with distant ").concat(w)):yy.info("Pushing new level for ".concat(_," onto queue with nearestNodeRange: ").concat(w," since there's not already a range for this level.")),p.push(_);case 28:case"end":return t.stop()}var S,E},t)}),A=h;case 12:if(!(A=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Ny(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||jy(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jy(t,e){if(t){if("string"==typeof t)return Ry(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ry(t,e):void 0}}function Ry(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function By(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function Fy(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){By(o,n,i,a,s,"next",t)}function s(t){By(o,n,i,a,s,"throw",t)}a(void 0)})}}function zy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gy(t,e){for(var r=0;rcy.global.extraRequestThreshold()&&(yy.info("Pushing new feature batch, since gap ".concat(b," was too large")),a.push(s),s=[]),s.push([y,v]);case 23:u=!1,r.next=9;break;case 26:r.next=32;break;case 28:r.prev=28,r.t0=r.catch(7),l=!0,c=r.t0;case 32:if(r.prev=32,r.prev=33,!u||null==f.return){r.next=37;break}return r.next=37,Yy(f.return());case 37:if(r.prev=37,!l){r.next=40;break}throw c;case 40:return r.finish(37);case 41:return r.finish(32);case 42:return e.headerClient.logUsage("header+index"),s.length>0&&a.push(s),A=a.flatMap(function(t){return e.readFeatureBatch(t,e.nocache)}),r.delegateYield(Wy(Xy($d.merge(A))),"t1",46);case 46:case"end":return r.stop()}},r,null,[[7,28,32,42],[33,,37,41]])}))()}},{key:"lengthBeforeTree",value:function(){return Oy.length+My+this.headerLength}},{key:"lengthBeforeFeatures",value:function(){return this.lengthBeforeTree()+this.indexLength}},{key:"buildFeatureClient",value:function(t){return new Zy(this.headerClient.httpClient,t)}},{key:"readFeatureBatch",value:function(t,e){var r=this;return Vy(Dy().mark(function n(){var i,o,a,s,u,l,c,f,h,p,d,y;return Dy().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:i=Ny(t[0],1),o=i[0],a=Ny(t[t.length-1],2),s=a[0],u=a[1],l=s+u-o,c=r.buildFeatureClient(e),f=l,h=Ly(t),n.prev=8,h.s();case 10:if((p=h.n()).done){n.next=19;break}return d=Ny(p.value,1),y=d[0],n.next=14,Yy(r.readFeature(c,y,f));case 14:return n.next=16,n.sent;case 16:f=0;case 17:n.next=10;break;case 19:n.next=24;break;case 21:n.prev=21,n.t0=n.catch(8),h.e(n.t0);case 24:return n.prev=24,h.f(),n.finish(24);case 27:c.logUsage("feature");case 28:case"end":return n.stop()}},n,null,[[8,21,24,27]])}))()}},{key:"readFeature",value:function(){var t=Fy(Dy().mark(function t(e,r,n){var i,o,a,s,u,l,c;return Dy().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=r+this.lengthBeforeFeatures(),t.next=3,e.getRange(i,4,n,"feature length");case 3:return a=t.sent,o=new DataView(a).getUint32(0,!0),t.next=7,e.getRange(i+4,o,n,"feature data");case 7:return s=t.sent,u=new Uint8Array(s),(l=new Uint8Array(o+My)).set(u,My),(c=new td(l)).setPosition(My),t.abrupt("return",gd.getRootAsFeature(c));case 14:case"end":return t.stop()}},t,this)}));return function(e,r,n){return t.apply(this,arguments)}}()}],[{key:"open",value:function(){var e=Fy(Dy().mark(function e(r,n){var i,o,a,s,u,l,c,f,h,p,d;return Dy().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=2024,o=new Zy(r,n),a=function(){var t,e=0;for(t=0;t<3;t++){e+=Math.pow(16,t)*Ey}return e}(),s=i+a,yy.debug("fetching header. minReqLength: ".concat(s," (assumedHeaderLength: ").concat(i,", assumedIndexLength: ").concat(a,")")),e.t0=Uint8Array,e.next=8,o.getRange(0,8,s,"header");case 8:if(e.t1=e.sent,(u=new e.t0(e.t1)).subarray(0,3).every(function(t,e){return Oy[e]===t})){e.next=13;break}throw yy.error("bytes: ".concat(u," != ").concat(Oy)),new Error("Not a FlatGeobuf file");case 13:return yy.debug("magic bytes look good"),e.next=16,o.getRange(8,4,s,"header");case 16:if(c=e.sent,!((l=new DataView(c).getUint32(0,!0))>10485760||l<8)){e.next=21;break}throw new Error("Invalid header size");case 21:return yy.debug("headerLength: ".concat(l)),e.next=24,o.getRange(12,l,s,"header");case 24:return f=e.sent,h=new td(new Uint8Array(f)),p=Od(h),d=Cy(p.featuresCount,p.indexNodeSize),yy.debug("completed: opening http reader"),e.abrupt("return",new t(o,p,l,d,n));case 30:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()}])}(),Zy=function(){return Uy(function t(e,r){if(zy(this,t),this.bytesEverUsed=0,this.bytesEverFetched=0,this.buffer=new ArrayBuffer(0),this.head=0,"string"==typeof e)this.httpClient=new $y(e,r);else{if(!(e instanceof $y))throw new Error("Unknown source ");this.httpClient=e}},[{key:"getRange",value:function(){var t=Fy(Dy().mark(function t(e,r,n,i){var o,a,s;return Dy().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.bytesEverUsed+=r,o=e-this.head,a=o+r,!(o>=0&&a<=this.buffer.byteLength)){t.next=5;break}return t.abrupt("return",this.buffer.slice(o,a));case 5:return s=Math.max(r,n),this.bytesEverFetched+=s,yy.debug("requesting for new Range: ".concat(e,"-").concat(e+s-1)),t.next=10,this.httpClient.getRange(e,s,i);case 10:return this.buffer=t.sent,this.head=e,t.abrupt("return",this.buffer.slice(0,r));case 13:case"end":return t.stop()}},t,this)}));return function(e,r,n,i){return t.apply(this,arguments)}}()},{key:"logUsage",value:function(t){var e=t.split(" ")[0],r=this.bytesEverUsed,n=this.bytesEverFetched,i=(100*r/n).toFixed(2);yy.info("".concat(e," bytes used/requested: ").concat(r," / ").concat(n," = ").concat(i,"%"))}}])}(),$y=function(){return Uy(function t(e,r){zy(this,t),this.requestsEverMade=0,this.bytesEverRequested=0,this.url=e,this.nocache=r},[{key:"getRange",value:function(){var t=Fy(Dy().mark(function t(e,r,n){var i,o,a;return Dy().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.requestsEverMade+=1,this.bytesEverRequested+=r,i="bytes=".concat(e,"-").concat(e+r-1),yy.info("request: #".concat(this.requestsEverMade,", purpose: ").concat(n,"), bytes: (this_request: ").concat(r,", ever: ").concat(this.bytesEverRequested,"), Range: ").concat(i)),o={Range:i},this.nocache&&(o["Cache-Control"]="no-cache, no-store"),t.next=8,fetch(this.url,{headers:o});case 8:return a=t.sent,t.abrupt("return",a.arrayBuffer());case 10:case"end":return t.stop()}},t,this)}));return function(e,r,n){return t.apply(this,arguments)}}()}])}();function tg(t){"@babel/helpers - typeof";return(tg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function eg(){eg=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new O(n||[]);return i(a,"_invoke",{value:C(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",g={};function v(){}function m(){}function b(){}var A={};l(A,a,function(){return this});var x=Object.getPrototypeOf,w=x&&x(x(M([])));w&&w!==r&&n.call(w,a)&&(A=w);var _=b.prototype=v.prototype=Object.create(A);function S(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function E(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==tg(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function C(e,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function rg(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function ng(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){rg(o,n,i,a,s,"next",t)}function s(t){rg(o,n,i,a,s,"throw",t)}a(void 0)})}}function ig(t){var e,r,n,i=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(e=t[r]))return e.call(t);if(n&&null!=(e=t[n]))return new og(e.call(t));r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function og(t){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var e=t.done;return Promise.resolve(t.value).then(function(t){return{value:t,done:e}})}return(og=function(t){this.s=t,this.n=t.next}).prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(t){var r=this.s.return;return void 0===r?Promise.resolve({value:t,done:!0}):e(r.apply(this.s,arguments))},throw:function(t){var r=this.s.return;return void 0===r?Promise.reject(t):e(r.apply(this.s,arguments))}},new og(t)}function ag(t){return new lg(t,0)}function sg(t){return function(){return new ug(t.apply(this,arguments))}}function ug(t){var e,r;function n(e,r){try{var o=t[e](r),a=o.value,s=a instanceof lg;Promise.resolve(s?a.v:a).then(function(r){if(s){var u="return"===e?"return":"next";if(!a.k||r.done)return n(u,r);r=t[u](r).value}i(o.done?"return":"normal",r)},function(t){n("throw",t)})}catch(t){i("throw",t)}}function i(t,i){switch(t){case"return":e.resolve({value:i,done:!0});break;case"throw":e.reject(i);break;default:e.resolve({value:i,done:!1})}(e=e.next)?n(e.key,e.arg):r=null}this._invoke=function(t,i){return new Promise(function(o,a){var s={key:t,arg:i,resolve:o,reject:a,next:null};r?r=r.next=s:(e=r=s,n(t,i))})},"function"!=typeof t.return&&(this.return=void 0)}function lg(t,e){this.v=t,this.k=e}function cg(){return(cg=sg(eg().mark(function t(e,r,n){var i,o,a,s,u,l,c,f,h,p;return eg().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i="function"==typeof(d=e).slice?d:new xd("function"==typeof d.read?d:d.getReader()),o=function(){var t=ng(eg().mark(function t(e){return eg().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.slice(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),t.t0=Uint8Array,t.next=5,ag(o(8,"magic bytes"));case 5:if(t.t1=t.sent,(a=new t.t0(t.t1)).subarray(0,3).every(function(t,e){return Oy[e]===t})){t.next=9;break}throw new Error("Not a FlatGeobuf file");case 9:return t.t2=Uint8Array,t.next=12,ag(o(4,"header length"));case 12:return t.t3=t.sent,a=new t.t2(t.t3),s=new td(a),u=s.readUint32(0),t.t4=Uint8Array,t.next=19,ag(o(u,"header data"));case 19:if(t.t5=t.sent,a=new t.t4(t.t5),s=new td(a),l=Od(s),n&&n(l),c=l.indexNodeSize,f=l.featuresCount,!(c>0)){t.next=29;break}return h=Cy(f,c),t.next=29,ag(o(h,"entire index, w/o rect"));case 29:return t.next=31,ag(hg(o,l,r));case 31:if(!(p=t.sent)){t.next=36;break}return t.next=34,p;case 34:t.next=29;break;case 36:case"end":return t.stop()}var d},t)}))).apply(this,arguments)}function fg(){return(fg=sg(function(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return eg().mark(function o(){var a,s,u,l,c,f,h;return eg().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,ag(Jy.open(t,i));case 2:a=o.sent,yy.debug("opened reader"),n&&n(a.header),s=!1,u=!1,o.prev=7,c=ig(a.selectBbox(e));case 9:return o.next=11,ag(c.next());case 11:if(!(s=!(f=o.sent).done)){o.next=18;break}return h=f.value,o.next=15,r(h,a.header);case 15:s=!1,o.next=9;break;case 18:o.next=24;break;case 20:o.prev=20,o.t0=o.catch(7),u=!0,l=o.t0;case 24:if(o.prev=24,o.prev=25,!s||null==c.return){o.next=29;break}return o.next=29,ag(c.return());case 29:if(o.prev=29,!u){o.next=32;break}throw l;case 32:return o.finish(29);case 33:return o.finish(24);case 34:case"end":return o.stop()}},o,null,[[7,20,24,34],[25,,29,33]])})()})).apply(this,arguments)}function hg(t,e,r){return pg.apply(this,arguments)}function pg(){return(pg=ng(eg().mark(function t(e,r,n){var i,o,a,s,u;return eg().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=Uint8Array,t.next=3,e(4,"feature length");case 3:if(t.t1=t.sent,0!==(i=new t.t0(t.t1)).byteLength){t.next=7;break}return t.abrupt("return");case 7:return o=new td(i),a=o.readUint32(0),t.t2=Uint8Array,t.next=12,e(a,"feature data");case 12:return t.t3=t.sent,i=new t.t2(t.t3),(s=new Uint8Array(a+4)).set(i,4),(o=new td(s)).setPosition(My),u=gd.getRootAsFeature(o),t.abrupt("return",n(u,r));case 20:case"end":return t.stop()}},t)}))).apply(this,arguments)}function dg(t,e){return{type:"FeatureCollection",features:function(t,e,r){if(!t.subarray(0,3).every(function(t,e){return Oy[e]===t}))throw new Error("Not a FlatGeobuf file");var n=new td(t),i=n.readUint32(Oy.length);n.setPosition(Oy.length+My);var o=Od(n);r&&r(o);var a=Oy.length+My+i,s=o.indexNodeSize,u=o.featuresCount;s>0&&(a+=Cy(u,s));for(var l=[];a3&&void 0!==arguments[3]&&arguments[3])}function vg(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return t instanceof Uint8Array?dg(t,r):t instanceof ReadableStream?yg(t,r):gg(t,e,r,n)}ug.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},ug.prototype.next=function(t){return this._invoke("next",t)},ug.prototype.throw=function(t){return this._invoke("throw",t)},ug.prototype.return=function(t){return this._invoke("return",t)};var mg=r(833),bg=r.n(mg);function Ag(t){"@babel/helpers - typeof";return(Ag="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function xg(){xg=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new O(n||[]);return i(a,"_invoke",{value:C(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",g={};function v(){}function m(){}function b(){}var A={};l(A,a,function(){return this});var x=Object.getPrototypeOf,w=x&&x(x(M([])));w&&w!==r&&n.call(w,a)&&(A=w);var _=b.prototype=v.prototype=Object.create(A);function S(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function E(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Ag(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function C(e,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function wg(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function _g(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){wg(o,n,i,a,s,"next",t)}function s(t){wg(o,n,i,a,s,"throw",t)}a(void 0)})}}function Sg(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=e.layerID?e.layerID:$.createUniqueID("FGBLayer_"),this.layerId=this.id+"outer",this.sourceId=this.layerId,this.options=e,this.strategy=e.strategy||"bbox",this.url=e.url,this.layerType="",this.extent=e.extent,this.init()},(e=[{key:"init",value:function(){"bbox"===this.strategy&&(this.loadedExtentsRtree_=new(bg()))}},{key:"iterateFeatures",value:function(){var t=_g(xg().mark(function t(e){var r,n,i,o,a,s,u;return xg().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r={type:"FeatureCollection",features:[]},n=!1,i=!1,t.prev=3,a=Cg(e);case 5:return t.next=7,a.next();case 7:if(!(n=!(s=t.sent).done)){t.next=15;break}u=s.value,this.options.featureLoader&&"function"==typeof this.options.featureLoader&&(u=this.options.featureLoader(u)),this.layerType||(this.layerType=Ig[u.geometry.type]),r.features.push(u);case 12:n=!1,t.next=5;break;case 15:t.next=21;break;case 17:t.prev=17,t.t0=t.catch(3),i=!0,o=t.t0;case 21:if(t.prev=21,t.prev=22,!n||null==a.return){t.next=26;break}return t.next=26,a.return();case 26:if(t.prev=26,!i){t.next=29;break}throw o;case 29:return t.finish(26);case 30:return t.finish(21);case 31:return t.abrupt("return",r);case 32:case"end":return t.stop()}},t,this,[[3,17,21,31],[22,,26,30]])}));return function(e){return t.apply(this,arguments)}}()},{key:"_loadData",value:function(){var t=_g(xg().mark(function t(e){var r,n,i=this;return xg().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]},e.length){t.next=7;break}return t.next=4,this._getStream(this.url);case 4:r=t.sent,t.next=9;break;case 7:n.value={extent:e.slice()},this.loadedExtentsRtree_.insert(n);case 9:return t.next=11,vg(r&&r.body||this.url,n,function(t){i.layerType=Ig[t.geometryType]});case 11:return t.abrupt("return",t.sent);case 12:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"_getStream",value:function(){var t=_g(xg().mark(function t(e){return xg().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ut.get(e,{},{withoutFormatSuffix:!0}).then(function(t){return t});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()},{key:"_containsExtent",value:function(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}},{key:"_getInExtent",value:function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.loadedExtentsRtree_.search(e).map(function(t){return t.value})}},{key:"_forEachInExtent",value:function(t,e){return this._forEach(this._getInExtent(t),e)}},{key:"_forEach",value:function(t,e){for(var r,n=0,i=t.length;n=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function Pg(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function Lg(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){Pg(o,n,i,a,s,"next",t)}function s(t){Pg(o,n,i,a,s,"throw",t)}a(void 0)})}}function Ng(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=e.layerID?e.layerID:$.createUniqueID("FGBLayer_"),this.layerId=this.id+"outer",this._sourceId=this.layerId,this.options=e,this.strategy=e.strategy||"bbox",this.url=e.url,this.layerType="",this.extent=e.extent,this.overlay=!0,this.type="custom",this.renderingMode="3d",this._updateFeaturesFn=this._updateFeatures.bind(this)},(e=[{key:"onAdd",value:function(t){this.map=t;var e,r,n,i=[];if("bbox"===this.strategy){var o=this.map.getBounds().toArray();i=[o[0][0],o[0][1],o[1][0],o[1][1]],this.map.on("moveend",this._updateFeaturesFn)}if(this.extent){var a=(e=this.extent,n=[],function(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}(e,r=i)&&(e[0]>r[0]?n[0]=e[0]:n[0]=r[0],e[1]>r[1]?n[1]=e[1]:n[1]=r[1],e[2]0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=e,this.url=e.url,this.layerId=e.id,this.autoplay=void 0===e.autoplay||e.autoplay,this.loop=void 0===e.loop||e.loop},(e=[{key:"_createVideoElement",value:function(){var t=document.createElement("video");t.id=this.layerId,t.className="video-js",t.style.position="fixed",t.style.left="-300%",t.setAttribute("crossorigin","anonymous"),document.body.appendChild(t)}},{key:"createVideo",value:function(){this._createVideoElement();var t=this._getVideoOptions();return this.video=Fg()(this.layerId,t,function(){}),this.video}},{key:"_getVideoOptions",value:function(){if(this.url){var t={autoplay:this.autoplay,muted:!0,loop:this.loop};return this.url.includes("mp4")?t.sources=[{src:this.url,type:"video/mp4"}]:this.url.includes("flv")?t={loop:this.loop,autoplay:this.autoplay,muted:!0,techOrder:["html5","flvjs"],flvjs:{mediaDataSource:{isLive:!0,cors:!0,withCredentials:!1}},sources:[{src:this.url,type:"video/x-flv"}]}:this.url.includes("m3u8")&&(t.sources=[{src:this.url}]),t}}},{key:"getVideoDomId",value:function(){if(this.url){var t;if(this.url.includes("flv")){var e=document.querySelector("#".concat(this.layerId));t="".concat(this.layerId,"_flvjs_api"),e.style.position="fixed",e.style.left="-200%"}else t=this.video.el_.firstChild.id;return t}}}])&&Gg(t.prototype,e),r&&Gg(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),Vg=function(){try{return turf}catch(t){return{}}}();function Qg(t){"@babel/helpers - typeof";return(Qg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yg(t,e){for(var r=0;r=this.text.length)return;t=this.text[this.place++]}switch(this.state){case _v:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},Tv.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(kv.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},Tv.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=_v)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=_v,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},Tv.prototype.number=function(t){if(!Iv.test(t)){if(kv.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},Tv.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},Tv.prototype.keyword=function(t){if(Cv.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=_v)}if(!kv.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},Tv.prototype.neutral=function(t){if(Ev.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(Iv.test(t))return this.word=t,void(this.state=3);if(!kv.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},Tv.prototype.output=function(){for(;this.place0?90:-90)):(t.lat0=Nv(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(i),i}function Rv(t){var e=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?Rv[t]=xv(arguments[1]):Rv[t]=jv(arguments[1]):Rv[t]=r}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?Rv.apply(e,t):Rv(t)});if("string"==typeof t){if(t in Rv)return Rv[t]}else"EPSG"in t?Rv["EPSG:"+t.EPSG]=t:"ESRI"in t?Rv["ESRI:"+t.ESRI]=t:"IAU2000"in t?Rv["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(Rv);var Dv=Rv;var Bv=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var Fv=["3857","900913","3785","102113"];var zv=function(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in Dv}(t))return Dv[t];if(function(t){return Bv.some(function(e){return t.indexOf(e)>-1})}(t)){var e=jv(t);if(function(t){var e=Av(t,"authority");if(e){var r=Av(e,"epsg");return r&&Fv.indexOf(r)>-1}}(e))return Dv["EPSG:3857"];var r=function(t){var e=Av(t,"extension");if(e)return Av(e,"proj4")}(e);return r?xv(r):e}return function(t){return"+"===t[0]}(t)?xv(t):void 0};function Gv(t,e){var r,n;if(t=t||{},!e)return t;for(n in e)void 0!==(r=e[n])&&(t[n]=r);return t}function Uv(t,e,r){var n=t*e;return r/Math.sqrt(1-n*n)}function Hv(t){return t<0?-1:1}function Vv(t){return Math.abs(t)<=gv?t:t-Hv(t)*yv}function Qv(t,e,r){var n=t*r,i=.5*t;return n=Math.pow((1-n)/(1+n),i),Math.tan(.5*(sv-e))/n}function Yv(t,e){for(var r,n,i=.5*t,o=sv-2*Math.atan(e),a=0;a<=15;a++)if(r=t*Math.sin(o),o+=n=sv-2*Math.atan(e*Math.pow((1-r)/(1+r),i))-o,Math.abs(n)<=1e-10)return o;return-9999}function Wv(t){return t}var qv=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Uv(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,r,n=t.x,i=t.y;if(i*pv>90&&i*pv<-90&&n*pv>180&&n*pv<-180)return null;if(Math.abs(Math.abs(i)-sv)<=fv)return null;if(this.sphere)e=this.x0+this.a*this.k0*Vv(n-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(dv+.5*i));else{var o=Math.sin(i),a=Qv(this.e,i,o);e=this.x0+this.a*this.k0*Vv(n-this.long0),r=this.y0-this.a*this.k0*Math.log(a)}return t.x=e,t.y=r,t},inverse:function(t){var e,r,n=t.x-this.x0,i=t.y-this.y0;if(this.sphere)r=sv-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var o=Math.exp(-i/(this.a*this.k0));if(-9999===(r=Yv(this.e,o)))return null}return e=Vv(this.long0+n/(this.a*this.k0)),t.x=e,t.y=r,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:Wv,inverse:Wv,names:["longlat","identity"]}],Xv={},Kv=[];function Jv(t,e){var r=Kv.length;return t.names?(Kv[r]=t,t.names.forEach(function(t){Xv[t.toLowerCase()]=r}),this):(console.log(e),!0)}var Zv={start:function(){qv.forEach(Jv)},add:Jv,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==Xv[e]&&Kv[Xv[e]]?Kv[Xv[e]]:void 0}},$v={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},tm=$v.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};$v.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var em={};em.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},em.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},em.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},em.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},em.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},em.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},em.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},em.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},em.militargeographische_institut={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},em.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},em.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},em.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},em.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},em.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},em.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},em.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},em.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},em.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var rm=function(t,e,r,n,i,o,a){var s={};return s.datum_type=void 0===t||"none"===t?rv:ev,e&&(s.datum_params=e.map(parseFloat),0===s.datum_params[0]&&0===s.datum_params[1]&&0===s.datum_params[2]||(s.datum_type=Zg),s.datum_params.length>3&&(0===s.datum_params[3]&&0===s.datum_params[4]&&0===s.datum_params[5]&&0===s.datum_params[6]||(s.datum_type=$g,s.datum_params[3]*=av,s.datum_params[4]*=av,s.datum_params[5]*=av,s.datum_params[6]=s.datum_params[6]/1e6+1))),a&&(s.datum_type=tv,s.grids=a),s.a=r,s.b=n,s.es=i,s.ep2=o,s},nm={};function im(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:nm[t]||null,isNull:!1}}function om(t){return t/3600*Math.PI/180}function am(t,e,r){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,r)))}function sm(t){return t.map(function(t){return[om(t.longitudeShift),om(t.latitudeShift)]})}function um(t,e,r){return{name:am(t,e+8,e+16).trim(),parent:am(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,r),upperLatitude:t.getFloat64(e+88,r),lowerLongitude:t.getFloat64(e+104,r),upperLongitude:t.getFloat64(e+120,r),latitudeInterval:t.getFloat64(e+136,r),longitudeInterval:t.getFloat64(e+152,r),gridNodeCount:t.getInt32(e+168,r)}}function lm(t,e,r,n){for(var i=e+176,o=[],a=0;a-1.001*sv)u=-sv;else if(u>sv&&u<1.001*sv)u=sv;else{if(u<-sv)return{x:-1/0,y:-1/0,z:t.z};if(u>sv)return{x:1/0,y:1/0,z:t.z}}return s>Math.PI&&(s-=2*Math.PI),i=Math.sin(u),a=Math.cos(u),o=i*i,{x:((n=r/Math.sqrt(1-e*o))+l)*a*Math.cos(s),y:(n+l)*a*Math.sin(s),z:(n*(1-e)+l)*i}}function pm(t,e,r,n){var i,o,a,s,u,l,c,f,h,p,d,y,g,v,m,b=t.x,A=t.y,x=t.z?t.z:0;if(i=Math.sqrt(b*b+A*A),o=Math.sqrt(b*b+A*A+x*x),i/r<1e-12){if(v=0,o/r<1e-12)return sv,m=-n,{x:t.x,y:t.y,z:t.z}}else v=Math.atan2(A,b);a=x/o,f=(s=i/o)*(1-e)*(u=1/Math.sqrt(1-e*(2-e)*s*s)),h=a*u,g=0;do{g++,l=e*(c=r/Math.sqrt(1-e*h*h))/(c+(m=i*f+x*h-c*(1-e*h*h))),y=(d=a*(u=1/Math.sqrt(1-l*(2-l)*s*s)))*f-(p=s*(1-l)*u)*h,f=p,h=d}while(y*y>1e-24&&g<30);return{x:v,y:Math.atan(d/Math.abs(p)),z:m}}function dm(t){return t===Zg||t===$g}function ym(t,e,r){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(t.datum_type===Zg?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type!==$g||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return r;if(t.datum_type===rv||e.datum_type===rv)return r;var n=t.a,i=t.es;if(t.datum_type===tv){if(0!==gm(t,!1,r))return;n=nv,i=ov}var o=e.a,a=e.b,s=e.es;if(e.datum_type===tv&&(o=nv,a=iv,s=ov),i===s&&n===o&&!dm(t.datum_type)&&!dm(e.datum_type))return r;if((r=hm(r,i,n),dm(t.datum_type)&&(r=function(t,e,r){if(e===Zg)return{x:t.x+r[0],y:t.y+r[1],z:t.z+r[2]};if(e===$g){var n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],l=r[6];return{x:l*(t.x-u*t.y+s*t.z)+n,y:l*(u*t.x+t.y-a*t.z)+i,z:l*(-s*t.x+a*t.y+t.z)+o}}}(r,t.datum_type,t.datum_params)),dm(e.datum_type)&&(r=function(t,e,r){if(e===Zg)return{x:t.x-r[0],y:t.y-r[1],z:t.z-r[2]};if(e===$g){var n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],l=r[6],c=(t.x-n)/l,f=(t.y-i)/l,h=(t.z-o)/l;return{x:c+u*f-s*h,y:-u*c+f+a*h,z:s*c-a*f+h}}}(r,e.datum_type,e.datum_params)),r=pm(r,s,o,a),e.datum_type===tv)&&0!==gm(e,!0,r))return;return r}function gm(t,e,r){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var n={x:-r.x,y:r.y},i={x:Number.NaN,y:Number.NaN},o=[];t:for(var a=0;an.y||p>n.x||g1e-12&&Math.abs(a.y)>1e-12);if(u<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=Vv(o.x+r.ll[0]),n.y=o.y+r.ll[1]}else isNaN(o.x)||(n.x=t.x+o.x,n.y=t.y+o.y);return n}function mm(t,e){var r,n={x:t.x/e.del[0],y:t.y/e.del[1]},i=Math.floor(n.x),o=Math.floor(n.y),a=n.x-1*i,s=n.y-1*o,u={x:Number.NaN,y:Number.NaN};if(i<0||i>=e.lim[0])return u;if(o<0||o>=e.lim[1])return u;r=o*e.lim[0]+i;var l=e.cvs[r][0],c=e.cvs[r][1];r++;var f=e.cvs[r][0],h=e.cvs[r][1];r+=e.lim[0];var p=e.cvs[r][0],d=e.cvs[r][1];r--;var y=e.cvs[r][0],g=e.cvs[r][1],v=a*s,m=a*(1-s),b=(1-a)*(1-s),A=(1-a)*s;return u.x=b*l+m*f+A*y+v*p,u.y=b*c+m*h+A*g+v*d,u}function bm(t,e,r){var n,i,o,a=r.x,s=r.y,u=r.z||0,l={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==r.z)switch(0===o?(n=a,i=-1!=="ew".indexOf(t.axis[o])?"x":"y"):1===o?(n=s,i=-1!=="ns".indexOf(t.axis[o])?"y":"x"):(n=u,i="z"),t.axis[o]){case"e":l[i]=n;break;case"w":l[i]=-n;break;case"n":l[i]=n;break;case"s":l[i]=-n;break;case"u":void 0!==r[i]&&(l.z=n);break;case"d":void 0!==r[i]&&(l.z=-n);break;default:return null}return l}function Am(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function xm(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function wm(t,e,r,n){var i,o=void 0!==(r=Array.isArray(r)?Am(r):{x:r.x,y:r.y,z:r.z,m:r.m}).z;if(function(t){xm(t.x),xm(t.y)}(r),t.datum&&e.datum&&function(t,e){return(t.datum.datum_type===Zg||t.datum.datum_type===$g||t.datum.datum_type===tv)&&"WGS84"!==e.datumCode||(e.datum.datum_type===Zg||e.datum.datum_type===$g||e.datum.datum_type===tv)&&"WGS84"!==t.datumCode}(t,e)&&(r=wm(t,i=new fm("WGS84"),r,n),t=i),n&&"enu"!==t.axis&&(r=bm(t,!1,r)),"longlat"===t.projName)r={x:r.x*hv,y:r.y*hv,z:r.z||0};else if(t.to_meter&&(r={x:r.x*t.to_meter,y:r.y*t.to_meter,z:r.z||0}),!(r=t.inverse(r)))return;if(t.from_greenwich&&(r.x+=t.from_greenwich),r=ym(t.datum,e.datum,r))return e.from_greenwich&&(r={x:r.x-e.from_greenwich,y:r.y,z:r.z||0}),"longlat"===e.projName?r={x:r.x*pv,y:r.y*pv,z:r.z||0}:(r=e.forward(r),e.to_meter&&(r={x:r.x/e.to_meter,y:r.y/e.to_meter,z:r.z||0})),n&&"enu"!==e.axis?bm(e,!0,r):(r&&!o&&delete r.z,r)}var _m=fm("WGS84");function Sm(t,e,r,n){var i,o,a;return Array.isArray(r)?(i=wm(t,e,r,n)||{x:NaN,y:NaN},r.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof i.z?[i.x,i.y,i.z].concat(r.splice(3)):[i.x,i.y,r[2]].concat(r.splice(3)):[i.x,i.y].concat(r.splice(2)):[i.x,i.y]):(o=wm(t,e,r,n),2===(a=Object.keys(r)).length?o:(a.forEach(function(n){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===n||"y"===n||"z"===n)return}else if("x"===n||"y"===n)return;o[n]=r[n]}),o))}function Em(t){return t instanceof fm?t:t.oProj?t.oProj:fm(t)}var Cm=function(t,e,r){t=Em(t);var n,i=!1;return void 0===e?(e=t,t=_m,i=!0):(void 0!==e.x||Array.isArray(e))&&(r=e,e=t,t=_m,i=!0),e=Em(e),r?Sm(t,e,r):(n={forward:function(r,n){return Sm(t,e,r,n)},inverse:function(r,n){return Sm(e,t,r,n)}},i&&(n.oProj=e),n)},km=6,Im="AJSAJS",Tm="AFAFAF",Om=65,Mm=73,Pm=79,Lm=86,Nm=90,jm={forward:Rm,inverse:function(t){var e=zm(Um(t.toUpperCase()));if(e.lat&&e.lon)return[e.lon,e.lat,e.lon,e.lat];return[e.left,e.bottom,e.right,e.top]},toPoint:Dm};function Rm(t,e){return e=e||5,function(t,e){var r="00000"+t.easting,n="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(p=t.easting,d=t.northing,y=t.zoneNumber,g=Gm(y),v=Math.floor(p/1e5),m=Math.floor(d/1e5)%20,i=v,o=m,a=g,s=a-1,u=Im.charCodeAt(s),l=Tm.charCodeAt(s),c=u+i-1,f=l+o,h=!1,c>Nm&&(c=c-Nm+Om-1,h=!0),(c===Mm||uMm||(c>Mm||uPm||(c>Pm||uNm&&(c=c-Nm+Om-1),f>Lm?(f=f-Lm+Om-1,h=!0):h=!1,(f===Mm||lMm||(f>Mm||lPm||(f>Pm||lLm&&(f=f-Lm+Om-1),String.fromCharCode(c)+String.fromCharCode(f))+r.substr(r.length-5,e)+n.substr(n.length-5,e);var i,o,a,s,u,l,c,f,h;var p,d,y,g,v,m}(function(t){var e,r,n,i,o,a,s,u=t.lat,l=t.lon,c=6378137,f=Bm(u),h=Bm(l);s=Math.floor((l+180)/6)+1,180===l&&(s=60);u>=56&&u<64&&l>=3&&l<12&&(s=32);u>=72&&u<84&&(l>=0&&l<9?s=31:l>=9&&l<21?s=33:l>=21&&l<33?s=35:l>=33&&l<42&&(s=37));a=Bm(6*(s-1)-180+3),.006739496752268451,e=c/Math.sqrt(1-.00669438*Math.sin(f)*Math.sin(f)),r=Math.tan(f)*Math.tan(f),n=.006739496752268451*Math.cos(f)*Math.cos(f),i=Math.cos(f)*(h-a),o=c*(.9983242984503243*f-.002514607064228144*Math.sin(2*f)+2639046602129982e-21*Math.sin(4*f)-3.418046101696858e-9*Math.sin(6*f));var p=.9996*e*(i+(1-r+n)*i*i*i/6+(5-18*r+r*r+72*n-.39089081163157013)*i*i*i*i*i/120)+5e5,d=.9996*(o+e*Math.tan(f)*(i*i/2+(5-r+9*n+4*n*n)*i*i*i*i/24+(61-58*r+r*r+600*n-2.2240339282485886)*i*i*i*i*i*i/720));u<0&&(d+=1e7);return{northing:Math.round(d),easting:Math.round(p),zoneNumber:s,zoneLetter:function(t){var e="Z";84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C");return e}(u)}}({lat:t[1],lon:t[0]}),e)}function Dm(t){var e=zm(Um(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Bm(t){return t*(Math.PI/180)}function Fm(t){return t/Math.PI*180}function zm(t){var e=t.northing,r=t.easting,n=t.zoneLetter,i=t.zoneNumber;if(i<0||i>60)return null;var o,a,s,u,l,c,f,h,p=6378137,d=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),y=r-5e5,g=e;n<"N"&&(g-=1e7),c=6*(i-1)-180+3,h=(f=g/.9996/6367449.145945056)+(3*d/2-27*d*d*d/32)*Math.sin(2*f)+(21*d*d/16-55*d*d*d*d/32)*Math.sin(4*f)+151*d*d*d/96*Math.sin(6*f),o=p/Math.sqrt(1-.00669438*Math.sin(h)*Math.sin(h)),a=Math.tan(h)*Math.tan(h),s=.006739496752268451*Math.cos(h)*Math.cos(h),u=.99330562*p/Math.pow(1-.00669438*Math.sin(h)*Math.sin(h),1.5),l=y/(.9996*o);var v=h-o*Math.tan(h)/u*(l*l/2-(5+3*a+10*s-4*s*s-.06065547077041606)*l*l*l*l/24+(61+90*a+298*s+45*a*a-1.6983531815716497-3*s*s)*l*l*l*l*l*l/720);v=Fm(v);var m,b=(l-(1+2*a+s)*l*l*l/6+(5-2*s+28*a-3*s*s+.05391597401814761+24*a*a)*l*l*l*l*l/120)/Math.cos(h);if(b=c+Fm(b),t.accuracy){var A=zm({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});m={top:A.lat,right:A.lon,bottom:v,left:b}}else m={lat:v,lon:b};return m}function Gm(t){var e=t%km;return 0===e&&(e=km),e}function Um(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,r=t.length,n=null,i="",o=0;!/[A-Z]/.test(e=t.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+t;i+=e,o++}var a=parseInt(i,10);if(0===o||o+3>r)throw"MGRSPoint bad conversion from: "+t;var s=t.charAt(o++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+t;n=t.substring(o,o+=2);for(var u=Gm(a),l=function(t,e){var r=Im.charCodeAt(e-1),n=1e5,i=!1;for(;r!==t.charCodeAt(0);){if(++r===Mm&&r++,r===Pm&&r++,r>Nm){if(i)throw"Bad character: "+t;r=Om,i=!0}n+=1e5}return n}(n.charAt(0),u),c=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var r=Tm.charCodeAt(e-1),n=0,i=!1;for(;r!==t.charCodeAt(0);){if(++r===Mm&&r++,r===Pm&&r++,r>Lm){if(i)throw"Bad character: "+t;r=Om,i=!0}n+=1e5}return n}(n.charAt(1),u);c0&&(h=1e5/Math.pow(10,y),p=t.substring(o,o+y),g=parseFloat(p)*h,d=t.substring(o+y),v=parseFloat(d)*h),{easting:g+l,northing:v+c,zoneLetter:s,zoneNumber:a,accuracy:h}}function Hm(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function Vm(t,e,r){if(!(this instanceof Vm))return new Vm(t,e,r);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var n=t.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=t,this.y=e,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Vm.fromMGRS=function(t){return new Vm(Dm(t))},Vm.prototype.toMGRS=function(t){return Rm([this.x,this.y],t)};var Qm=Vm,Ym=1,Wm=.25,qm=.046875,Xm=.01953125,Km=.01068115234375,Jm=.75,Zm=.46875,$m=.013020833333333334,tb=.007120768229166667,eb=.3645833333333333,rb=.005696614583333333,nb=.3076171875;function ib(t){var e=[];e[0]=Ym-t*(Wm+t*(qm+t*(Xm+t*Km))),e[1]=t*(Jm-t*(qm+t*(Xm+t*Km)));var r=t*t;return e[2]=r*(Zm-t*($m+t*tb)),r*=t,e[3]=r*(eb-t*rb),e[4]=r*t*nb,e}function ob(t,e,r,n){return r*=e,e*=e,n[0]*t-r*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))}var ab=20;function sb(t,e,r){for(var n=1/(1-e),i=t,o=ab;o;--o){var a=Math.sin(i),s=1-e*a*a;if(i-=s=(ob(i,a,Math.cos(i),r)-t)*(s*Math.sqrt(s))*n,Math.abs(s)fv?Math.tan(o):0,d=Math.pow(p,2),y=Math.pow(d,2);e=1-this.es*Math.pow(s,2),l/=Math.sqrt(e);var g=ob(o,s,u,this.en);r=this.a*(this.k0*l*(1+c/6*(1-d+f+c/20*(5-18*d+y+14*f-58*d*f+c/42*(61+179*y-y*d-479*d)))))+this.x0,n=this.a*(this.k0*(g-this.ml0+s*a*l/2*(1+c/12*(5-d+9*f+4*h+c/30*(61+y-58*d+270*f-330*d*f+c/56*(1385+543*y-y*d-3111*d))))))+this.y0}else{var v=u*Math.sin(a);if(Math.abs(Math.abs(v)-1)=1){if(v-1>fv)return 93;n=0}else n=Math.acos(n);o<0&&(n=-n),n=this.a*this.k0*(n-this.lat0)+this.y0}return t.x=r,t.y=n,t},inverse:function(t){var e,r,n,i,o=(t.x-this.x0)*(1/this.a),a=(t.y-this.y0)*(1/this.a);if(this.es)if(r=sb(e=this.ml0+a/this.k0,this.es,this.en),Math.abs(r)fv?Math.tan(r):0,c=this.ep2*Math.pow(u,2),f=Math.pow(c,2),h=Math.pow(l,2),p=Math.pow(h,2);e=1-this.es*Math.pow(s,2);var d=o*Math.sqrt(e)/this.k0,y=Math.pow(d,2);n=r-(e*=l)*y/(1-this.es)*.5*(1-y/12*(5+3*h-9*c*h+c-4*f-y/30*(61+90*h-252*c*h+45*p+46*c-y/56*(1385+3633*h+4095*p+1574*p*h)))),i=Vv(this.long0+d*(1-y/6*(1+2*h+c-y/20*(5+28*h+24*p+8*c*h+6*c-y/42*(61+662*h+1320*p+720*p*h))))/u)}else n=sv*Hv(a),i=0;else{var g=Math.exp(o/this.k0),v=.5*(g-1/g),m=this.lat0+a/this.k0,b=Math.cos(m);e=Math.sqrt((1-Math.pow(b,2))/(1+Math.pow(v,2))),n=Math.asin(e),a<0&&(n=-n),i=0===v&&0===b?0:Vv(Math.atan2(v,b)+this.long0)}return t.x=i,t.y=n,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function lb(t){var e=Math.exp(t);return e=(e-1/e)/2}function cb(t,e){t=Math.abs(t),e=Math.abs(e);var r=Math.max(t,e),n=Math.min(t,e)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}function fb(t){var e=Math.abs(t);return e=function(t){var e=1+t,r=e-1;return 0===r?t:t*Math.log(e)/r}(e*(1+e/(cb(1,e)+1))),t<0?-e:e}function hb(t,e){for(var r,n=2*Math.cos(2*e),i=t.length-1,o=t[i],a=0;--i>=0;)r=n*o-a+t[i],a=o,o=r;return e+r*Math.sin(2*e)}function pb(t,e,r){for(var n,i,o=Math.sin(e),a=Math.cos(e),s=lb(r),u=function(t){var e=Math.exp(t);return e=(e+1/e)/2}(r),l=2*a*u,c=-2*o*s,f=t.length-1,h=t[f],p=0,d=0,y=0;--f>=0;)n=d,i=p,h=l*(d=h)-n-c*(p=y)+t[f],y=c*d-i+l*p;return[(l=o*u)*h-(c=a*s)*y,l*y+c*h]}var db={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(ub.init.apply(this),this.forward=ub.forward,this.inverse=ub.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),r=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),r*=e,this.cgb[1]=r*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),r*=e,this.cgb[2]=r*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=r*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),r*=e,this.cgb[3]=r*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=r*(1237/630+e*(e*(-24832/14175)-2.4)),r*=e,this.cgb[4]=r*(4174/315+e*(-144838/6237)),this.cbg[4]=r*(-734/315+e*(109598/31185)),r*=e,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+r*(.25+r*(1/64+r/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=r*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=r*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),r*=e,this.utg[2]=r*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=r*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),r*=e,this.utg[3]=r*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=r*(49561/161280+e*(-179/168+e*(6601661/7257600))),r*=e,this.utg[4]=r*(-4583/161280+e*(108847/3991680)),this.gtu[4]=r*(34729/80640+e*(-3418889/1995840)),r*=e,this.utg[5]=-.03233083094085698*r,this.gtu[5]=.6650675310896665*r;var n=hb(this.cbg,this.lat0);this.Zb=-this.Qn*(n+function(t,e){for(var r,n=2*Math.cos(e),i=t.length-1,o=t[i],a=0;--i>=0;)r=n*o-a+t[i],a=o,o=r;return Math.sin(e)*r}(this.gtu,2*n))},forward:function(t){var e=Vv(t.x-this.long0),r=t.y;r=hb(this.cbg,r);var n=Math.sin(r),i=Math.cos(r),o=Math.sin(e),a=Math.cos(e);r=Math.atan2(n,a*i),e=Math.atan2(o*i,cb(n,i*a)),e=fb(Math.tan(e));var s,u,l=pb(this.gtu,2*r,2*e);return r+=l[0],e+=l[1],Math.abs(e)<=2.623395162778?(s=this.a*(this.Qn*e)+this.x0,u=this.a*(this.Qn*r+this.Zb)+this.y0):(s=1/0,u=1/0),t.x=s,t.y=u,t},inverse:function(t){var e,r,n=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);if(i=(i-this.Zb)/this.Qn,n/=this.Qn,Math.abs(n)<=2.623395162778){var o=pb(this.utg,2*i,2*n);i+=o[0],n+=o[1],n=Math.atan(lb(n));var a=Math.sin(i),s=Math.cos(i),u=Math.sin(n),l=Math.cos(n);i=Math.atan2(a*l,cb(u,l*s)),e=Vv((n=Math.atan2(u,l*s))+this.long0),r=hb(this.cgb,i)}else e=1/0,r=1/0;return t.x=e,t.y=r,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]};var yb={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(Vv(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*hv,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,db.init.apply(this),this.forward=db.forward,this.inverse=db.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function gb(t,e){return Math.pow((1-t)/(1+t),e)}var vb=20;var mb={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+dv)/(Math.pow(Math.tan(.5*this.lat0+dv),this.C)*gb(this.e*t,this.ratexp))},forward:function(t){var e=t.x,r=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+dv),this.C)*gb(this.e*Math.sin(r),this.ratexp))-sv,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,r=t.y,n=Math.pow(Math.tan(.5*r+dv)/this.K,1/this.C),i=vb;i>0&&(r=2*Math.atan(n*gb(this.e*Math.sin(t.y),-.5*this.e))-sv,!(Math.abs(r-t.y)<1e-14));--i)t.y=r;return i?(t.x=e,t.y=r,t):null},names:["gauss"]};var bb={init:function(){mb.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,r,n,i;return t.x=Vv(t.x-this.long0),mb.forward.apply(this,[t]),e=Math.sin(t.y),r=Math.cos(t.y),n=Math.cos(t.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*r*n),t.x=i*r*Math.sin(t.x),t.y=i*(this.cosc0*e-this.sinc0*r*n),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,r,n,i,o;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,o=cb(t.x,t.y)){var a=2*Math.atan2(o,this.R2);e=Math.sin(a),r=Math.cos(a),i=Math.asin(r*this.sinc0+t.y*e*this.cosc0/o),n=Math.atan2(t.x*e,o*this.cosc0*r-t.y*this.sinc0*e)}else i=this.phic0,n=0;return t.x=n,t.y=i,mb.inverse.apply(this,[t]),t.x=Vv(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var Ab={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=fv&&(this.k0=.5*(1+Hv(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=fv&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=fv&&Math.abs(Math.cos(this.lat_ts))>fv&&(this.k0=.5*this.cons*Uv(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Qv(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Uv(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-sv,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,r,n,i,o,a,s=t.x,u=t.y,l=Math.sin(u),c=Math.cos(u),f=Vv(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=fv&&Math.abs(u+this.lat0)<=fv?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*l+this.coslat0*c*Math.cos(f)),t.x=this.a*e*c*Math.sin(f)+this.x0,t.y=this.a*e*(this.coslat0*l-this.sinlat0*c*Math.cos(f))+this.y0,t):(r=2*Math.atan(this.ssfn_(u,l,this.e))-sv,i=Math.cos(r),n=Math.sin(r),Math.abs(this.coslat0)<=fv?(o=Qv(this.e,u*this.con,this.con*l),a=2*this.a*this.k0*o/this.cons,t.x=this.x0+a*Math.sin(s-this.long0),t.y=this.y0-this.con*a*Math.cos(s-this.long0),t):(Math.abs(this.sinlat0)0?Vv(this.long0+Math.atan2(t.x,-1*t.y)):Vv(this.long0+Math.atan2(t.x,t.y)):Vv(this.long0+Math.atan2(t.x*Math.sin(s),a*this.coslat0*Math.cos(s)-t.y*this.sinlat0*Math.sin(s))),t.x=e,t.y=r,t)}if(Math.abs(this.coslat0)<=fv){if(a<=fv)return r=this.lat0,e=this.long0,t.x=e,t.y=r,t;t.x*=this.con,t.y*=this.con,n=a*this.cons/(2*this.a*this.k0),r=this.con*Yv(this.e,n),e=this.con*Vv(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else i=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,a<=fv?o=this.X0:(o=Math.asin(Math.cos(i)*this.sinX0+t.y*Math.sin(i)*this.cosX0/a),e=Vv(this.long0+Math.atan2(t.x*Math.sin(i),a*this.cosX0*Math.cos(i)-t.y*this.sinX0*Math.sin(i)))),r=-1*Yv(this.e,Math.tan(.5*(sv+o)));return t.x=e,t.y=r,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],ssfn_:function(t,e,r){return e*=r,Math.tan(.5*(sv+t))*Math.pow((1-e)/(1+e),.5*r)}};var xb={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),r=this.a,n=1/this.rf,i=2*n-Math.pow(n,2),o=this.e=Math.sqrt(i);this.R=this.k0*r*Math.sqrt(1-i)/(1-i*Math.pow(e,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+t/2)),u=Math.log((1+o*e)/(1-o*e));this.K=a-this.alpha*s+this.alpha*o/2*u},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),n=-this.alpha*(e+r)+this.K,i=2*(Math.atan(Math.exp(n))-Math.PI/4),o=this.alpha*(t.x-this.lambda0),a=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(o))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(o));return t.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,t.x=this.R*a+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,r=t.y-this.y0,n=e/this.R,i=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(n)),a=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+a/this.alpha,u=0,l=o,c=-1e3,f=0;Math.abs(l-c)>1e-7;){if(++f>20)return;u=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),c=l,l=2*Math.atan(Math.exp(u))-Math.PI/2}return t.x=s,t.y=l,t},names:["somerc"]},wb=1e-7;var _b={init:function(){var t,e,r,n,i,o,a,s,u,l,c,f,h,p=0,d=0,y=0,g=0,v=0,m=0,b=0;this.no_off=(h="object"==typeof(f=this).PROJECTION?Object.keys(f.PROJECTION)[0]:f.PROJECTION,"no_uoff"in f||"no_off"in f||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(h)),this.no_rot="no_rot"in this;var A=!1;"alpha"in this&&(A=!0);var x=!1;if("rectified_grid_angle"in this&&(x=!0),A&&(b=this.alpha),x&&(p=this.rectified_grid_angle*hv),A||x)d=this.longc;else if(y=this.long1,v=this.lat1,g=this.long2,m=this.lat2,Math.abs(v-m)<=wb||(t=Math.abs(v))<=wb||Math.abs(t-sv)<=wb||Math.abs(Math.abs(this.lat0)-sv)<=wb||Math.abs(Math.abs(m)-sv)<=wb)throw new Error;var w=1-this.es;e=Math.sqrt(w),Math.abs(this.lat0)>fv?(s=Math.sin(this.lat0),r=Math.cos(this.lat0),t=1-this.es*s*s,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/w),this.A=this.B*this.k0*e/t,(i=(n=this.B*e/(r*Math.sqrt(t)))*n-1)<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=n,this.E*=Math.pow(Qv(this.e,this.lat0,s),this.B)):(this.B=1/e,this.A=this.k0,this.E=n=i=1),A||x?(A?(c=Math.asin(Math.sin(b)/n),x||(p=b)):(c=p,b=Math.asin(n*Math.sin(c))),this.lam0=d-Math.asin(.5*(i-1/i)*Math.tan(c))/this.B):(o=Math.pow(Qv(this.e,v,Math.sin(v)),this.B),a=Math.pow(Qv(this.e,m,Math.sin(m)),this.B),i=this.E/o,u=(a-o)/(a+o),l=((l=this.E*this.E)-a*o)/(l+a*o),(t=y-g)<-Math.pi?g-=yv:t>Math.pi&&(g+=yv),this.lam0=Vv(.5*(y+g)-Math.atan(l*Math.tan(.5*this.B*(y-g))/u)/this.B),c=Math.atan(2*Math.sin(this.B*Vv(y-this.lam0))/(i-1/i)),p=b=Math.asin(n*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(p),this.cosrot=Math.cos(p),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(b))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(dv-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(dv+i))},forward:function(t){var e,r,n,i,o,a,s,u,l={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-sv)>fv){if(e=.5*((o=this.E/Math.pow(Qv(this.e,t.y,Math.sin(t.y)),this.B))-(a=1/o)),r=.5*(o+a),i=Math.sin(this.B*t.x),n=(e*this.singam-i*this.cosgam)/r,Math.abs(Math.abs(n)-1)0?this.v_pole_n:this.v_pole_s,s=this.ArB*t.y;return this.no_rot?(l.x=s,l.y=u):(s-=this.u_0,l.x=u*this.cosrot+s*this.sinrot,l.y=s*this.cosrot-u*this.sinrot),l.x=this.a*l.x+this.x0,l.y=this.a*l.y+this.y0,l},inverse:function(t){var e,r,n,i,o,a,s,u={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(r=t.y,e=t.x):(r=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),i=.5*((n=Math.exp(-this.BrA*r))-1/n),o=.5*(n+1/n),s=((a=Math.sin(this.BrA*e))*this.cosgam+i*this.singam)/o,Math.abs(Math.abs(s)-1)fv?this.ns=Math.log(n/s)/Math.log(i/u):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=n/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,r=t.y;Math.abs(2*Math.abs(r)-Math.PI)<=fv&&(r=Hv(r)*(sv-2*fv));var n,i,o=Math.abs(Math.abs(r)-sv);if(o>fv)n=Qv(this.e,r,Math.sin(r)),i=this.a*this.f0*Math.pow(n,this.ns);else{if((o=r*this.ns)<=0)return null;i=0}var a=this.ns*Vv(e-this.long0);return t.x=this.k0*(i*Math.sin(a))+this.x0,t.y=this.k0*(this.rh-i*Math.cos(a))+this.y0,t},inverse:function(t){var e,r,n,i,o,a=(t.x-this.x0)/this.k0,s=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(a*a+s*s),r=1):(e=-Math.sqrt(a*a+s*s),r=-1);var u=0;if(0!==e&&(u=Math.atan2(r*a,r*s)),0!==e||this.ns>0){if(r=1/this.ns,n=Math.pow(e/(this.a*this.f0),r),-9999===(i=Yv(this.e,n)))return null}else i=-sv;return o=Vv(u/this.ns+this.long0),t.x=o,t.y=i,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};var Eb={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,r,n,i,o,a,s,u=t.x,l=t.y,c=Vv(u-this.long0);return e=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/e)-this.s45),n=-c*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),o=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(i)),a=this.n*o,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),t.y=s*Math.cos(a)/1,t.x=s*Math.sin(a)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,r,n,i,o,a,s,u=t.x;t.x=t.y,t.y=u,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),i=Math.atan2(t.y,t.x)/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),r=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(e)),t.x=this.long0-r/this.alfa,a=e,s=0;var l=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-t.y)<1e-10&&(s=1),a=t.y,l+=1}while(0===s&&l<15);return l>=15?null:t},names:["Krovak","krovak"]};function Cb(t,e,r,n,i){return t*i-e*Math.sin(2*i)+r*Math.sin(4*i)-n*Math.sin(6*i)}function kb(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function Ib(t){return.375*t*(1+.25*t*(1+.46875*t))}function Tb(t){return.05859375*t*t*(1+.75*t)}function Ob(t){return t*t*t*(35/3072)}function Mb(t,e,r){var n=e*r;return t/Math.sqrt(1-n*n)}function Pb(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(r=t*e)*r)-.5/t*Math.log((1-r)/(1+r))):2*e}var Rb=.3333333333333333,Db=.17222222222222222,Bb=.10257936507936508,Fb=.06388888888888888,zb=.0664021164021164,Gb=.016415012942191543;var Ub={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-sv)0)switch(this.qp=jb(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,r=[];return r[0]=t*Rb,e=t*t,r[0]+=e*Db,r[1]=e*Fb,e*=t,r[0]+=e*Bb,r[1]+=e*zb,r[2]=e*Gb,r}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=jb(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,r,n,i,o,a,s,u,l,c,f=t.x,h=t.y;if(f=Vv(f-this.long0),this.sphere){if(o=Math.sin(h),c=Math.cos(h),n=Math.cos(f),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+c*n:1+this.sinph0*o+this.cosph0*c*n)<=fv)return null;e=(r=Math.sqrt(2/r))*c*Math.sin(f),r*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*c*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(h+this.lat0)=0?(e=(l=Math.sqrt(a))*i,r=n*(this.mode===this.S_POLE?l:-l)):e=r=0}}return t.x=this.a*e+this.x0,t.y=this.a*r+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,r,n,i,o,a,s,u,l,c,f=t.x/this.a,h=t.y/this.a;if(this.sphere){var p,d=0,y=0;if((r=.5*(p=Math.sqrt(f*f+h*h)))>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(y=Math.sin(r),d=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(p)<=fv?0:Math.asin(h*y/p),f*=y,h=d*p;break;case this.OBLIQ:r=Math.abs(p)<=fv?this.lat0:Math.asin(d*this.sinph0+h*y*this.cosph0/p),f*=y*this.cosph0,h=(d-Math.sin(r)*this.sinph0)*p;break;case this.N_POLE:h=-h,r=sv-r;break;case this.S_POLE:r-=sv}e=0!==h||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(f,h):0}else{if(s=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(f/=this.dd,h*=this.dd,(a=Math.sqrt(f*f+h*h))1&&(t=t>1?1:-1),Math.asin(t)}var Vb={init:function(){Math.abs(this.lat1+this.lat2)fv?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,r=t.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var n=jb(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,o=this.ns0*Vv(e-this.long0),a=i*Math.sin(o)+this.x0,s=this.rh-i*Math.cos(o)+this.y0;return t.x=a,t.y=s,t},inverse:function(t){var e,r,n,i,o,a;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),n=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),n=-1),i=0,0!==e&&(i=Math.atan2(n*t.x,n*t.y)),n=e*this.ns0/this.a,this.sphere?a=Math.asin((this.c-n*n)/(2*this.ns0)):(r=(this.c-n*n)/this.ns0,a=this.phi1z(this.e3,r)),o=Vv(i/this.ns0+this.long0),t.x=o,t.y=a,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var r,n,i,o,a,s=Hb(.5*e);if(t0||Math.abs(o)<=fv?(a=this.x0+1*this.a*r*Math.sin(n)/o,s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*i)/o):(a=this.x0+this.infinity_dist*r*Math.sin(n),s=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*r*i)),t.x=a,t.y=s,t},inverse:function(t){var e,r,n,i,o,a;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(i=Math.atan2(e,this.rc),r=Math.sin(i),a=Hb((n=Math.cos(i))*this.sin_p14+t.y*r*this.cos_p14/e),o=Math.atan2(t.x*r,e*this.cos_p14*n-t.y*this.sin_p14*r),o=Vv(this.long0+o)):(a=this.phic0,o=0),t.x=o,t.y=a,t},names:["gnom"]};var Yb={init:function(){this.sphere||(this.k0=Uv(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,r,n=t.x,i=t.y,o=Vv(n-this.long0);if(this.sphere)e=this.x0+this.a*o*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var a=jb(this.e,Math.sin(i));e=this.x0+this.a*this.k0*o,r=this.y0+this.a*a*.5/this.k0}return t.x=e,t.y=r,t},inverse:function(t){var e,r;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=Vv(this.long0+t.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(r=function(t,e){var r=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-r)<1e-6)return e<0?-1*sv:sv;for(var n,i,o,a,s=Math.asin(.5*e),u=0;u<30;u++)if(i=Math.sin(s),o=Math.cos(s),a=t*i,s+=n=Math.pow(1-a*a,2)/(2*o)*(e/(1-t*t)-i/(1-a*a)+.5/t*Math.log((1-a)/(1+a))),Math.abs(n)<=1e-10)return s;return NaN}(this.e,2*t.y*this.k0/this.a),e=Vv(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=r,t},names:["cea"]};var Wb={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,r=t.y,n=Vv(e-this.long0),i=Pb(r-this.lat0);return t.x=this.x0+this.a*n*this.rc,t.y=this.y0+this.a*i,t},inverse:function(t){var e=t.x,r=t.y;return t.x=Vv(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=Pb(this.lat0+(r-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},qb=20;var Xb={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=kb(this.es),this.e1=Ib(this.es),this.e2=Tb(this.es),this.e3=Ob(this.es),this.ml0=this.a*Cb(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,r,n,i=t.x,o=t.y,a=Vv(i-this.long0);if(n=a*Math.sin(o),this.sphere)Math.abs(o)<=fv?(e=this.a*a,r=-1*this.a*this.lat0):(e=this.a*Math.sin(n)/Math.tan(o),r=this.a*(Pb(o-this.lat0)+(1-Math.cos(n))/Math.tan(o)));else if(Math.abs(o)<=fv)e=this.a*a,r=-1*this.ml0;else{var s=Mb(this.a,this.e,Math.sin(o))/Math.tan(o);e=s*Math.sin(n),r=this.a*Cb(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+s*(1-Math.cos(n))}return t.x=e+this.x0,t.y=r+this.y0,t},inverse:function(t){var e,r,n,i,o,a,s,u,l;if(n=t.x-this.x0,i=t.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=fv)e=Vv(n/this.a+this.long0),r=0;else{var c;for(a=this.lat0+i/this.a,s=n*n/this.a/this.a+a*a,u=a,o=qb;o;--o)if(u+=l=-1*(a*(u*(c=Math.tan(u))+1)-u-.5*(u*u+s)*c)/((u-a)/c-1),Math.abs(l)<=fv){r=u;break}e=Vv(this.long0+Math.asin(n*Math.tan(u)/this.a)/Math.sin(r))}else if(Math.abs(i+this.ml0)<=fv)r=0,e=Vv(this.long0+n/this.a);else{var f,h,p,d,y;for(a=(this.ml0+i)/this.a,s=n*n/this.a/this.a+a*a,u=a,o=qb;o;--o)if(y=this.e*Math.sin(u),f=Math.sqrt(1-y*y)*Math.tan(u),h=this.a*Cb(this.e0,this.e1,this.e2,this.e3,u),p=this.e0-2*this.e1*Math.cos(2*u)+4*this.e2*Math.cos(4*u)-6*this.e3*Math.cos(6*u),u-=l=(a*(f*(d=h/this.a)+1)-d-.5*f*(d*d+s))/(this.es*Math.sin(2*u)*(d*d+s-2*a*d)/(4*f)+(a-d)*(f*p-2/Math.sin(2*u))-p),Math.abs(l)<=fv){r=u;break}f=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),e=Vv(this.long0+Math.asin(n*f/this.a)/Math.sin(r))}return t.x=e,t.y=r,t},names:["Polyconic","poly"]};var Kb={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,r=t.x,n=t.y-this.lat0,i=r-this.long0,o=n/av*1e-5,a=i,s=1,u=0;for(e=1;e<=10;e++)s*=o,u+=this.A[e]*s;var l,c=u,f=a,h=1,p=0,d=0,y=0;for(e=1;e<=6;e++)l=p*c+h*f,h=h*c-p*f,p=l,d=d+this.B_re[e]*h-this.B_im[e]*p,y=y+this.B_im[e]*h+this.B_re[e]*p;return t.x=y*this.a+this.x0,t.y=d*this.a+this.y0,t},inverse:function(t){var e,r,n=t.x,i=t.y,o=n-this.x0,a=(i-this.y0)/this.a,s=o/this.a,u=1,l=0,c=0,f=0;for(e=1;e<=6;e++)r=l*a+u*s,u=u*a-l*s,l=r,c=c+this.C_re[e]*u-this.C_im[e]*l,f=f+this.C_im[e]*u+this.C_re[e]*l;for(var h=0;h.999999999999&&(r=.999999999999),e=Math.asin(r);var n=Vv(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),r=(2*e+Math.sin(2*e))/Math.PI,Math.abs(r)>1&&(r=1);var i=Math.asin(r);return t.x=n,t.y=i,t},names:["Mollweide","moll"]};var eA={init:function(){Math.abs(this.lat1+this.lat2)=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var o=0;return 0!==r&&(o=Math.atan2(e*t.x,e*t.y)),this.sphere?(i=Vv(this.long0+o/this.ns),n=Pb(this.g-r/this.a),t.x=i,t.y=n,t):(n=Lb(this.g-r/this.a,this.e0,this.e1,this.e2,this.e3),i=Vv(this.long0+o/this.ns),t.x=i,t.y=n,t)},names:["Equidistant_Conic","eqdc"]};var rA={init:function(){this.R=this.a},forward:function(t){var e,r,n=t.x,i=t.y,o=Vv(n-this.long0);Math.abs(i)<=fv&&(e=this.x0+this.R*o,r=this.y0);var a=Hb(2*Math.abs(i/Math.PI));(Math.abs(o)<=fv||Math.abs(Math.abs(i)-sv)<=fv)&&(e=this.x0,r=i>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var s=.5*Math.abs(Math.PI/o-o/Math.PI),u=s*s,l=Math.sin(a),c=Math.cos(a),f=c/(l+c-1),h=f*f,p=f*(2/l-1),d=p*p,y=Math.PI*this.R*(s*(f-d)+Math.sqrt(u*(f-d)*(f-d)-(d+u)*(h-d)))/(d+u);o<0&&(y=-y),e=this.x0+y;var g=u+f;return y=Math.PI*this.R*(p*g-s*Math.sqrt((d+u)*(u+1)-g*g))/(d+u),r=i>=0?this.y0+y:this.y0-y,t.x=e,t.y=r,t},inverse:function(t){var e,r,n,i,o,a,s,u,l,c,f,h;return t.x-=this.x0,t.y-=this.y0,f=Math.PI*this.R,o=(n=t.x/f)*n+(i=t.y/f)*i,f=3*(i*i/(u=-2*(a=-Math.abs(i)*(1+o))+1+2*i*i+o*o)+(2*(s=a-2*i*i+n*n)*s*s/u/u/u-9*a*s/u/u)/27)/(l=(a-s*s/3/u)/u)/(c=2*Math.sqrt(-l/3)),Math.abs(f)>1&&(f=f>=0?1:-1),h=Math.acos(f)/3,r=t.y>=0?(-c*Math.cos(h+Math.PI/3)-s/3/u)*Math.PI:-(-c*Math.cos(h+Math.PI/3)-s/3/u)*Math.PI,e=Math.abs(n)2*sv*this.a)return;return r=e/this.a,n=Math.sin(r),i=Math.cos(r),o=this.long0,Math.abs(e)<=fv?a=this.lat0:(a=Hb(i*this.sin_p12+t.y*n*this.cos_p12/e),s=Math.abs(this.lat0)-sv,o=Math.abs(s)<=fv?this.lat0>=0?Vv(this.long0+Math.atan2(t.x,-t.y)):Vv(this.long0-Math.atan2(-t.x,t.y)):Vv(this.long0+Math.atan2(t.x*n,e*this.cos_p12*i-t.y*this.sin_p12*n))),t.x=o,t.y=a,t}return u=kb(this.es),l=Ib(this.es),c=Tb(this.es),f=Ob(this.es),Math.abs(this.sin_p12-1)<=fv?(a=Lb(((h=this.a*Cb(u,l,c,f,sv))-(e=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,u,l,c,f),o=Vv(this.long0+Math.atan2(t.x,-1*t.y)),t.x=o,t.y=a,t):Math.abs(this.sin_p12+1)<=fv?(h=this.a*Cb(u,l,c,f,sv),a=Lb(((e=Math.sqrt(t.x*t.x+t.y*t.y))-h)/this.a,u,l,c,f),o=Vv(this.long0+Math.atan2(t.x,t.y)),t.x=o,t.y=a,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),y=Math.atan2(t.x,t.y),p=Mb(this.a,this.e,this.sin_p12),g=Math.cos(y),m=-(v=this.e*this.cos_p12*g)*v/(1-this.es),b=3*this.es*(1-m)*this.sin_p12*this.cos_p12*g/(1-this.es),w=1-m*(x=(A=e/p)-m*(1+m)*Math.pow(A,3)/6-b*(1+3*m)*Math.pow(A,4)/24)*x/2-A*x*x*x/6,d=Math.asin(this.sin_p12*Math.cos(x)+this.cos_p12*Math.sin(x)*g),o=Vv(this.long0+Math.asin(Math.sin(y)*Math.sin(x)/Math.cos(d))),_=Math.sin(d),a=Math.atan2((_-this.es*w*this.sin_p12)*Math.tan(d),_*(1-this.es)),t.x=o,t.y=a,t)},names:["Azimuthal_Equidistant","aeqd"]};var iA={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,r,n,i,o,a,s,u=t.x,l=t.y;return n=Vv(u-this.long0),e=Math.sin(l),r=Math.cos(l),i=Math.cos(n),((o=this.sin_p14*e+this.cos_p14*r*i)>0||Math.abs(o)<=fv)&&(a=1*this.a*r*Math.sin(n),s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*i)),t.x=a,t.y=s,t},inverse:function(t){var e,r,n,i,o,a,s;return t.x-=this.x0,t.y-=this.y0,r=Hb((e=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),n=Math.sin(r),i=Math.cos(r),a=this.long0,Math.abs(e)<=fv?(s=this.lat0,t.x=a,t.y=s,t):(s=Hb(i*this.sin_p14+t.y*n*this.cos_p14/e),o=Math.abs(this.lat0)-sv,Math.abs(o)<=fv?(a=this.lat0>=0?Vv(this.long0+Math.atan2(t.x,-t.y)):Vv(this.long0-Math.atan2(-t.x,t.y)),t.x=a,t.y=s,t):(a=Vv(this.long0+Math.atan2(t.x*n,e*this.cos_p14*i-t.y*this.sin_p14*n)),t.x=a,t.y=s,t))},names:["ortho"]},oA={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},aA={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function sA(t,e,r,n){var i;return tdv&&i<=sv+dv?(n.value=aA.AREA_1,i-=sv):i>sv+dv||i<=-(sv+dv)?(n.value=aA.AREA_2,i=i>=0?i-gv:i+gv):(n.value=aA.AREA_3,i+=sv)),i}function uA(t,e){var r=t+e;return r<-gv?r+=yv:r>+gv&&(r-=yv),r}var lA={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=sv-dv/2?this.face=oA.TOP:this.lat0<=-(sv-dv/2)?this.face=oA.BOTTOM:Math.abs(this.long0)<=dv?this.face=oA.FRONT:Math.abs(this.long0)<=sv+dv?this.face=this.long0>0?oA.RIGHT:oA.LEFT:this.face=oA.BACK,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,r,n,i,o,a,s={x:0,y:0},u={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,r=t.x,this.face===oA.TOP)i=sv-e,r>=dv&&r<=sv+dv?(u.value=aA.AREA_0,n=r-sv):r>sv+dv||r<=-(sv+dv)?(u.value=aA.AREA_1,n=r>0?r-gv:r+gv):r>-(sv+dv)&&r<=-dv?(u.value=aA.AREA_2,n=r+sv):(u.value=aA.AREA_3,n=r);else if(this.face===oA.BOTTOM)i=sv+e,r>=dv&&r<=sv+dv?(u.value=aA.AREA_0,n=-r+sv):r=-dv?(u.value=aA.AREA_1,n=-r):r<-dv&&r>=-(sv+dv)?(u.value=aA.AREA_2,n=-r-sv):(u.value=aA.AREA_3,n=r>0?-r+gv:-r-gv);else{var l,c,f,h,p,d;this.face===oA.RIGHT?r=uA(r,+sv):this.face===oA.BACK?r=uA(r,+gv):this.face===oA.LEFT&&(r=uA(r,-sv)),h=Math.sin(e),p=Math.cos(e),d=Math.sin(r),l=p*Math.cos(r),c=p*d,f=h,this.face===oA.FRONT?n=sA(i=Math.acos(l),f,c,u):this.face===oA.RIGHT?n=sA(i=Math.acos(c),f,-l,u):this.face===oA.BACK?n=sA(i=Math.acos(-l),f,-c,u):this.face===oA.LEFT?n=sA(i=Math.acos(-c),f,l,u):(i=n=0,u.value=aA.AREA_0)}return a=Math.atan(12/gv*(n+Math.acos(Math.sin(n)*Math.cos(dv))-sv)),o=Math.sqrt((1-Math.cos(i))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(n))))),u.value===aA.AREA_1?a+=sv:u.value===aA.AREA_2?a+=gv:u.value===aA.AREA_3&&(a+=1.5*gv),s.x=o*Math.cos(a),s.y=o*Math.sin(a),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,t.x=s.x,t.y=s.y,t},inverse:function(t){var e,r,n,i,o,a,s,u,l,c,f,h,p={lam:0,phi:0},d={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,r=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?d.value=aA.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(d.value=aA.AREA_1,e-=sv):t.x<0&&-t.x>=Math.abs(t.y)?(d.value=aA.AREA_2,e=e<0?e+gv:e-gv):(d.value=aA.AREA_3,e+=sv),l=gv/12*Math.tan(e),o=Math.sin(l)/(Math.cos(l)-1/Math.sqrt(2)),a=Math.atan(o),(s=1-(n=Math.cos(e))*n*(i=Math.tan(r))*i*(1-Math.cos(Math.atan(1/Math.cos(a)))))<-1?s=-1:s>1&&(s=1),this.face===oA.TOP)u=Math.acos(s),p.phi=sv-u,d.value===aA.AREA_0?p.lam=a+sv:d.value===aA.AREA_1?p.lam=a<0?a+gv:a-gv:d.value===aA.AREA_2?p.lam=a-sv:p.lam=a;else if(this.face===oA.BOTTOM)u=Math.acos(s),p.phi=u-sv,d.value===aA.AREA_0?p.lam=-a+sv:d.value===aA.AREA_1?p.lam=-a:d.value===aA.AREA_2?p.lam=-a-sv:p.lam=a<0?-a-gv:-a+gv;else{var y,g,v;l=(y=s)*y,g=(l+=(v=l>=1?0:Math.sqrt(1-l)*Math.sin(a))*v)>=1?0:Math.sqrt(1-l),d.value===aA.AREA_1?(l=g,g=-v,v=l):d.value===aA.AREA_2?(g=-g,v=-v):d.value===aA.AREA_3&&(l=g,g=v,v=-l),this.face===oA.RIGHT?(l=y,y=-g,g=l):this.face===oA.BACK?(y=-y,g=-g):this.face===oA.LEFT&&(l=y,y=g,g=-l),p.phi=Math.acos(-v)-sv,p.lam=Math.atan2(g,y),this.face===oA.RIGHT?p.lam=uA(p.lam,-sv):this.face===oA.BACK?p.lam=uA(p.lam,-gv):this.face===oA.LEFT&&(p.lam=uA(p.lam,+sv))}return 0!==this.es&&(c=p.phi<0?1:0,f=Math.tan(p.phi),h=this.b/Math.sqrt(f*f+this.one_minus_f_squared),p.phi=Math.atan(Math.sqrt(this.a*this.a-h*h)/(this.one_minus_f*h)),c&&(p.phi=-p.phi)),p.lam+=this.long0,t.x=p.lam,t.y=p.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},cA=[[1,2.2199e-17,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],fA=[[-5.20417e-18,.0124,1.21431e-18,-8.45284e-11],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],hA=.8487,pA=1.3523,dA=pv/5,yA=1/dA,gA=18,vA=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},mA=function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])};var bA={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=Vv(t.x-this.long0),r=Math.abs(t.y),n=Math.floor(r*dA);n<0?n=0:n>=gA&&(n=gA-1),r=pv*(r-yA*n);var i={x:vA(cA[n],r)*e,y:vA(fA[n],r)};return t.y<0&&(i.y=-i.y),i.x=i.x*this.a*hA+this.x0,i.y=i.y*this.a*pA+this.y0,i},inverse:function(t){var e={x:(t.x-this.x0)/(this.a*hA),y:Math.abs(t.y-this.y0)/(this.a*pA)};if(e.y>=1)e.x/=cA[gA][0],e.y=t.y<0?-sv:sv;else{var r=Math.floor(e.y*gA);for(r<0?r=0:r>=gA&&(r=gA-1);;)if(fA[r][0]>e.y)--r;else{if(!(fA[r+1][0]<=e.y))break;++r}var n=fA[r],i=5*(e.y-n[0])/(fA[r+1][0]-n[0]);i=function(t,e,r,n){for(var i=e;n;--n){var o=t(i);if(i-=o,Math.abs(o)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,r,n,i,o=t.x,a=t.y;if(o-=this.long0,"ellipse"===this.shape){a=Math.atan(this.radius_p2*Math.tan(a));var s=this.radius_p/cb(this.radius_p*Math.cos(a),Math.sin(a));if(r=s*Math.cos(o)*Math.cos(a),n=s*Math.sin(o)*Math.cos(a),i=s*Math.sin(a),(this.radius_g-r)*r-n*n-i*i*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(n/cb(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(n/e),t.y=this.radius_g_1*Math.atan(i/cb(n,e)))}else"sphere"===this.shape&&(e=Math.cos(a),r=Math.cos(o)*e,n=Math.sin(o)*e,i=Math.sin(a),e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(n/cb(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(n/e),t.y=this.radius_g_1*Math.atan(i/cb(n,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,r,n,i,o=-1,a=0,s=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*cb(1,s)):(a=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*cb(1,a));var u=s/this.radius_p;if(e=a*a+u*u+o*o,(n=(r=2*this.radius_g*o)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-r-Math.sqrt(n))/(2*e),o=this.radius_g+i*o,a*=i,s*=i,t.x=Math.atan2(a,o),t.y=Math.atan(s*Math.cos(t.x)/o),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+s*s)):(a=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+a*a)),e=a*a+s*s+o*o,(n=(r=2*this.radius_g*o)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-r-Math.sqrt(n))/(2*e),o=this.radius_g+i*o,a*=i,s*=i,t.x=Math.atan2(a,o),t.y=Math.atan(s*Math.cos(t.x)/o)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]},EA=1.340264,CA=-.081106,kA=893e-6,IA=.003796,TA=Math.sqrt(3)/2;var OA={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0},forward:function(t){var e=Vv(t.x-this.long0),r=t.y,n=Math.asin(TA*Math.sin(r)),i=n*n,o=i*i*i;return t.x=e*Math.cos(n)/(TA*(EA+3*CA*i+o*(7*kA+9*IA*i))),t.y=n*(EA+CA*i+o*(kA+IA*i)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var e,r,n,i,o=t.y;for(i=0;i<12&&(o-=n=(o*(EA+CA*(e=o*o)+(r=e*e*e)*(kA+IA*e))-t.y)/(EA+3*CA*e+r*(7*kA+9*IA*e)),!(Math.abs(n)<1e-9));++i);return r=(e=o*o)*e*e,t.x=TA*t.x*(EA+3*CA*e+r*(7*kA+9*IA*e))/Math.cos(o),t.y=Math.asin(Math.sin(o)/TA),t.x=Vv(t.x+this.long0),t},names:["eqearth","Equal Earth","Equal_Earth"]};Cm.defaultDatum="WGS84",Cm.Proj=fm,Cm.WGS84=new Cm.Proj("WGS84"),Cm.Point=Qm,Cm.toPoint=Am,Cm.defs=Dv,Cm.nadgrid=function(t,e){var r=new DataView(e),n=function(t){var e=t.getInt32(8,!1);return 11!==e&&(11!==(e=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(r),i=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:am(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(r,n),o={header:i,subgrids:function(t,e,r){for(var n=176,i=[],o=0;ot.length)&&(e=t.length);for(var r=0,n=new Array(e);r=e[0]&&t[0]<=e[2]&&t[1]>=e[1]&&t[1]<=e[3]}},{key:"moveLayer",value:function(t){this.map.moveLayer(this.layerId,t)}},{key:"setVisibility",value:function(t){var e=t?"visible":"none";this.map.setLayoutProperty(this.layerId,"visibility",e)}}])&&jA(r.prototype,n),i&&jA(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function GA(t){"@babel/helpers - typeof";return(GA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function UA(t,e){for(var r=0;r0?(r.totalTimes--,r.ajaxPolling(t)):r._commit(t)}},{key:"ajaxPolling",value:function(t){var e=this,r=t.url,n=/^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;return e.index=parseInt(Math.random()*e.length),e.url=e.urls[e.index],r=r.replace(n,n.exec(e.url)[0]),t.url=r,t.isInTheSameDomain=$.isInTheSameDomain(r),e._commit(t)}},{key:"calculatePollingTimes",value:function(){var t=this;t.times?t.totalTimes>t.POLLING_TIMES?t.times>t.POLLING_TIMES?t.totalTimes=t.POLLING_TIMES:t.totalTimes=t.times:t.timest.POLLING_TIMES&&(t.totalTimes=t.POLLING_TIMES),t.totalTimes--}},{key:"isServiceSupportPolling",value:function(){return!("SuperMap.REST.ThemeService"===this.CLASS_NAME||"SuperMap.REST.EditFeaturesService"===this.CLASS_NAME)}},{key:"transformResult",value:function(t,e){return{result:t=$.transformResult(t),options:e}}},{key:"transformErrorResult",value:function(t,e){return{error:(t=$.transformResult(t)).error||t,options:e}}},{key:"serviceProcessCompleted",value:function(t,e){t=this.transformResult(t).result,this.events.triggerEvent("processCompleted",{result:t,options:e})}},{key:"serviceProcessFailed",value:function(t,e){var r=(t=this.transformErrorResult(t).error).error||t;this.events.triggerEvent("processFailed",{error:r,options:e})}},{key:"_returnContent",value:function(t){return t.scope.format!==En.FGB&&!!t.scope.returnContent}},{key:"supportDataFormat",value:function(t){return this.dataFormat().includes(t)}},{key:"dataFormat",value:function(){return[En.GEOJSON,En.ISERVER]}},{key:"_commit",value:function(t){var e=this;if("POST"===t.method||"PUT"===t.method||"PATCH"===t.method)if(t.params&&(t.url=$.urlAppend(t.url,$.getParameterString(t.params||{}))),"object"!==ex(t.data)||t.data instanceof FormData)t.params=t.data;else try{t.params=$.toJSON(t.data)}catch(t){console.log("不是json对象")}return ut.commit(t.method,t.url,t.params,{headers:t.headers,withoutFormatSuffix:t.withoutFormatSuffix,withCredentials:t.withCredentials,crossOrigin:t.crossOrigin,timeout:t.async?0:null,proxy:t.proxy}).then(function(t){return t.text?t.text():t.json?t.json():t}).then(function(e){var r=e;return"string"==typeof e&&(r=(new Gr).read(e)),(!r||r.error||r.code>=300&&304!==r.code)&&(r=r&&r.error?{error:r.error}:{error:r}),r&&t.scope.format===En.FGB&&(r.newResourceLocation=r.newResourceLocation.replace(".json","")+".fgb"),r}).catch(function(t){return{error:t}}).then(function(r){var n={object:e};if(r.error){var i="processFailed";if(e.events&&e.events.listeners[i]&&e.events.listeners[i].length){var o=t.failure&&(t.scope?B.bind(t.failure,t.scope):t.failure);o?o(r,t):e.serviceProcessFailed(r,t)}else(n=$A($A({},n),e.transformErrorResult(r,t))).type=i,t.failure&&t.failure(n)}else{var a="processCompleted";if(e.events&&e.events.listeners[a]&&e.events.listeners[a].length){var s=t.success&&(t.scope?B.bind(t.success,t.scope):t.success);s?s(r,t):e.serviceProcessCompleted(r,t)}else r.succeed=void 0==r.succeed||r.succeed,(n=$A($A({},n),e.transformResult(r,t))).type=a,t.success&&t.success(n)}return n})}}])&&rx(t.prototype,e),r&&rx(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function ox(t){"@babel/helpers - typeof";return(ox="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ax(){ax=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new O(n||[]);return i(a,"_invoke",{value:C(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",g={};function v(){}function m(){}function b(){}var A={};l(A,a,function(){return this});var x=Object.getPrototypeOf,w=x&&x(x(M([])));w&&w!==r&&n.call(w,a)&&(A=w);var _=b.prototype=v.prototype=Object.create(A);function S(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function E(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==ox(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function C(e,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function sx(t){return function(t){if(Array.isArray(t))return ux(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return ux(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ux(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ux(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function bx(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function Ax(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:"id";return kx()(t,e)}function Rx(t){return t.hasOwnProperty("start")&&t.hasOwnProperty("end")}function Dx(t,e,r){var n=t.id,i=t.properties,o=t.lables,a=e?function(t,e){if(!e)return{};for(var r=t.id,n=t.labels,i=e.filter(function(t){return"entity"===t.type}),o=0;o0&&t(o[0])}},u=0;u0;)f.push(s.pop());o.push(f)}}return o},iw=function(t){for(var e=t.nodes,r=void 0===e?[]:e,n=t.edges,i=void 0===n?[]:n,o=[],a={},s={},u={},l=[],c=0,f=function t(e){s[e.id]=c,u[e.id]=c,c+=1,o.push(e),a[e.id]=!0;for(var n=$x(e.id,i,"target").filter(function(t){return r.map(function(t){return t.id}).indexOf(t)>-1}),f=function(i){var o=n[i];if(s[o]||0===s[o])a[o]&&(u[e.id]=Math.min(u[e.id],s[o]));else{var l=r.filter(function(t){return t.id===o});l.length>0&&t(l[0]),u[e.id]=Math.min(u[e.id],u[o])}},h=0;h0;){var d=o.pop();if(a[d.id]=!1,p.push(d),d===e)break}p.length>0&&l.push(p)}},h=0,p=r;h0;)for(var d=f.pop(),y=d.id,g=$x(y,t.edges),v=function(n){var i,a=g[n],s=t.nodes.find(function(t){return t.id===a});if(a===y)o.push(((i={})[a]=d,i));else if(a in p){if(!p[y].has(s)){for(var u=!0,l=[s,d],c=h[y];p[a].size&&!p[a].has(c)&&(l.push(c),c!==h[c.id]);)c=h[c.id];if(l.push(c),e&&r?(u=!1,l.findIndex(function(t){return e.indexOf(t.id)>-1})>-1&&(u=!0)):e&&!r&&l.findIndex(function(t){return e.indexOf(t.id)>-1})>-1&&(u=!1),u){for(var v={},m=1;m-1)return f;n.push(u),i.add(u);for(var h=c[u.id],p=0;p0;){var r=e.pop();i.has(r)&&(i.delete(r),o[r.id].forEach(function(t){e.push(t)}),o[r.id].clear())}}(u);else for(p=0;p-1});g-1?d[y.id].push(u[m]):a.push(((i={})[y.id]=y,i))}}return{component:p,adjList:d,minIdx:s}},v=0;v=v}),b=iw({nodes:m,edges:t.edges}).filter(function(t){return t.length>1});if(0===b.length)break;var A=g(b),x=A.minIdx,w=A.adjList,_=A.component;if(!(_.length>1))break;_.forEach(function(t){o[t.id]=new Set});var S=s[x];if(e&&r&&-1===e.indexOf(S.id))return a;l(S,S,w),v=x+1}return a},pw=function(t,e,r,n){return void 0===n&&(n=!0),e?hw(t,r,n):fw(t,r,n)},dw=function(t){var e=null,r=t.nodes,n={},i={},o={},a={};(void 0===r?[]:r).forEach(function(t){i[t.id]=t});for(var s={enter:function(t){var r=t.current,a=t.previous;if(o[r]){e={};for(var s=r,u=a;u!==r;)e[s]=u,s=u,u=n[u];e[s]=u}else o[r]=r,delete i[r],n[r]=a},leave:function(t){var e=t.current;a[e]=e,delete o[e]},allowTraversal:function(t){var r=t.next;return!e&&!a[r]}};Object.keys(i).length;)cw(t,Object.keys(i)[0],s);return e},yw=function(t,e,r,n){var i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a,u=[],l={},c={},f={};o.forEach(function(t,r){var n=t.id;u.push(n),c[n]=1/0,n===e&&(c[n]=0)});for(var h=o.length,p=function(t){var e=function(t,e,r){for(var n,i=1/0,o=0;oc[e.id]+s?(c[a]=c[e.id]+s,f[a]=[e.id]):c[a]===c[e.id]+s&&f[a].push(e.id)})},d=0;d0&&l.length>0;){var h=l[l.length-1];if(h.length){var p=h.shift();if(p&&(s.push(p),u[p]=!0,f=n?$x(p,a,"target"):$x(p,a),l.push(f.filter(function(t){return!u[t]}))),s[s.length-1]===r){var d=s.map(function(t){return t});c.push(d);y=s.pop();u[y]=!1,l.pop()}}else{var y=s.pop();u[y]=!1,l.pop()}}return c},Aw=function(t,e){for(var r=qx(t,e),n=[],i=r.length,o=0;on[o][s]+n[s][a]&&(n[o][a]=n[o][s]+n[s][a]);return n},xw=function(t,e,r,n){void 0===e&&(e=!1),void 0===r&&(r="weight"),void 0===n&&(n=1e3);var i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a,u={},l={};o.forEach(function(t,e){var r=ew();t.clusterId=r,u[r]={id:r,nodes:[t]},l[t.id]={node:t,idx:e}});var c=[],f={};qx(t,e).forEach(function(t,e){var r=0,n=o[e].id;f[n]={},t.forEach(function(t,e){if(t){r+=t;var i=o[e].id;f[n][i]=t}}),c.push(r)});for(var h=0,p=function(){var t=!1;if(o.forEach(function(e){var r={};Object.keys(f[e.id]).forEach(function(t){var n=f[e.id][t],i=l[t].node.clusterId;r[i]||(r[i]=0),r[i]+=n});var n=-1/0,i=[];if(Object.keys(r).forEach(function(t){n=0&&i.splice(o,1),i&&i.length){t=!0;var a=u[e.clusterId],s=a.nodes.indexOf(e);a.nodes.splice(s,1);var c=Math.floor(Math.random()*i.length),h=u[i[c]];h.nodes.push(e),e.clusterId=h.id}}}),!t)return"break";h++};h0&&_>S&&_-SS&&(C=c.map(function(t){return{node:t,clusterId:t.clusterId}}),k=(0,Ux.clone)(v),S=_),I||E>100)break;E++,Object.keys(v).forEach(function(t){var e=0;h.forEach(function(n){var i=n.source,o=n.target,a=m[i].node.clusterId,s=m[o].node.clusterId;(a===t&&s!==t||s===t&&a!==t)&&(e+=n[r]||1)}),v[t].sumTot=e}),c.forEach(function(t,e){var n,o=v[t.clusterId],a=0,s=A[e]/(2*w),l=0,c=o.nodes;c.forEach(function(t){var r=m[t.id].idx;l+=b[e][r]||0});var f=l-o.sumTot*s,d=c.filter(function(e){return e.id!==t.id}),y=[];d.forEach(function(t,e){y[e]=p[t.originIndex]});var g=Iw(d,p)*u,_=x[t.id];if(Object.keys(_).forEach(function(r){var o=m[r].node.clusterId;if(o!==t.clusterId){var l=v[o],c=l.nodes;if(c&&c.length){var h=0;c.forEach(function(t){var r=m[t.id].idx;h+=b[e][r]||0});var d=h-l.sumTot*s,y=c.concat([t]),A=[];y.forEach(function(t,e){A[e]=p[t.originIndex]});var x=Iw(y,p)*u,w=d-f;i&&(w=d+x-(f+g)),w>a&&(a=w,n=l)}}}),a>0){n.nodes.push(t);var S=t.clusterId;t.clusterId=n.id;var E=o.nodes.indexOf(t);o.nodes.splice(E,1);var C=0,k=0;h.forEach(function(t){var e=t.source,i=t.target,o=m[e].node.clusterId,a=m[i].node.clusterId;(o===n.id&&a!==n.id||a===n.id&&o!==n.id)&&(C+=t[r]||1),(o===S&&a!==S||a===S&&o!==S)&&(k+=t[r]||1)}),n.sumTot=C,o.sumTot=k}})}var T={},O=0;Object.keys(k).forEach(function(t){var e=k[t];if(e.nodes&&e.nodes.length){var r=String(O+1);r!==t&&(e.id=r,e.nodes=e.nodes.map(function(t){return{id:t.id,clusterId:r}}),k[r]=e,T[t]=r,delete k[t],O++)}else delete k[t]}),C.forEach(function(t){var e=t.node,r=t.clusterId;e&&(e.clusterId=r,e.clusterId&&T[e.clusterId]&&(e.clusterId=T[e.clusterId]))});var M=[],P={};h.forEach(function(t){var e=t.source,n=t.target,i=t[r]||1,o=m[e].node.clusterId,a=m[n].node.clusterId;if(o&&a){var s="".concat(o,"---").concat(a);if(P[s])P[s].weight+=i,P[s].count++;else{var u={source:o,target:a,weight:i,count:1};P[s]=u,M.push(u)}}});var L=[];return Object.keys(k).forEach(function(t){L.push(k[t])}),{clusters:L,clusterEdges:M}},Ow=function(t,e,r,n,i,o,a,s){return void 0===e&&(e=!1),void 0===r&&(r="weight"),void 0===n&&(n=1e-4),void 0===i&&(i=void 0),void 0===o&&(o=[]),void 0===a&&(a=["id"]),void 0===s&&(s=1),Tw(t,e,r,n,!0,i,o,a,s)},Mw=function(t,e){var r;void 0===e&&(e=1);for(var n=(0,Ux.clone)(t),i=n.nodes,o=void 0===i?[]:i,a=n.edges,s=void 0===a?[]:a,u=function(){var t=sw({nodes:o,edges:s}),n=Object.keys(t);n.sort(function(e,r){var n,i;return(null===(n=t[e])||void 0===n?void 0:n.degree)-(null===(i=t[r])||void 0===i?void 0:i.degree)});var i=n[0];if(!o.length||(null===(r=t[i])||void 0===r?void 0:r.degree)>=e)return"break";var a=o.findIndex(function(t){return t.id===i});o.splice(a,1),s=s.filter(function(t){return!(t.source===i||t.target===i)})};"break"!==u(););return{nodes:o,edges:s}},Pw=function(t,e,r){var n=[];switch(t){case vw.EuclideanDistance:n=e[r];break;default:n=[]}return n},Lw=function(t,e,r,n,i,o){void 0===e&&(e=3),void 0===r&&(r=void 0),void 0===n&&(n=[]),void 0===i&&(i=["id"]),void 0===o&&(o=vw.EuclideanDistance);var a=t.nodes,s=void 0===a?[]:a,u=t.edges,l=void 0===u?[]:u,c={clusters:[{id:"0",nodes:s}],clusterEdges:[]};if(o===vw.EuclideanDistance&&!s.every(function(t){return t.hasOwnProperty(r)}))return c;var f=[],h=[];if(o===vw.EuclideanDistance&&(f=_w(s,r),h=Ew(f,n,i)),!h.length)return c;for(var p=(0,Ux.uniq)(h.map(function(t){return t.join("")})),d=Math.min(e,s.length,p.length),y=0;yA&&!g.find(function(e){return(0,Ux.isEqual)(e,Pw(o,h,s[t].originIndex))})&&(A=i,x=t)}},_=0;_=0;T--)m[Number(s[y].clusterId)][T].id===s[y].id&&m[Number(s[y].clusterId)].splice(T,1);s[y].clusterId=String(E),m[E].push(s[y])}}var O=!1;for(y=0;y=1e3)break}var N=[],j={};return l.forEach(function(t){var e,r,n=t.source,i=t.target,o=null===(e=s.find(function(t){return t.id===n}))||void 0===e?void 0:e.clusterId,a=null===(r=s.find(function(t){return t.id===i}))||void 0===r?void 0:r.clusterId,u="".concat(o,"---").concat(a);if(j[u])j[u].count++;else{var l={source:o,target:a,count:1};j[u]=l,N.push(l)}}),{clusters:m,clusterEdges:N}},Nw=function(t,e){var r=new ww(e),n=r.norm2(),i=new ww(t),o=i.norm2(),a=r.dot(i),s=n*o,u=s?a/s:0;return u},jw=function(t,e,r,n,i){void 0===t&&(t=[]),void 0===r&&(r=void 0),void 0===n&&(n=[]),void 0===i&&(i=[]);var o=(0,Ux.clone)(t.filter(function(t){return t.id!==e.id})),a=t.findIndex(function(t){return t.id===e.id}),s=_w(t,r),u=Ew(s,n,i),l=u[a],c=[];return o.forEach(function(t,r){if(t.id!==e.id){var n=u[r],i=Nw(n,l);c.push(i),t.cosineSimilarity=i}}),o.sort(function(t,e){return e.cosineSimilarity-t.cosineSimilarity}),{allCosineSimilarity:c,similarNodes:o}},Rw=function(){function t(t){this.count=t.length,this.parent={};for(var e=0,r=t;e0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var r=this.list[e];this.list[e]=this.list[t],this.list[t]=r,t=e,e=this.getParent(t)}},t.prototype.moveDown=function(t){var e,r=t,n=this.getLeft(t),i=this.getRight(t),o=this.list.length;null!==n&&n0?r=n:null!==i&&i0&&(r=i),t!==r&&(e=[this.list[r],this.list[t]],this.list[t]=e[0],this.list[r]=e[1],this.moveDown(r))},t}(),Fw=function(t,e){var r=[],n=t.nodes,i=void 0===n?[]:n,o=t.edges,a=void 0===o?[]:o;if(0===i.length)return r;var s=i[0],u=new Set;u.add(s);var l=new Bw(function(t,r){return e?t.weight-r.weight:0});for(tw(s.id,a).forEach(function(t){l.insert(t)});!l.isEmpty();){var c=l.delMin(),f=c.source,h=c.target;u.has(f)&&u.has(h)||(r.push(c),u.has(f)||(u.add(f),tw(f,a).forEach(function(t){l.insert(t)})),u.has(h)||(u.add(h),tw(h,a).forEach(function(t){l.insert(t)})))}return r},zw=function(t,e){var r=[],n=t.nodes,i=void 0===n?[]:n,o=t.edges,a=void 0===o?[]:o;if(0===i.length)return r;var s=a.map(function(t){return t});e&&s.sort(function(t,e){return t.weight-e.weight});for(var u=new Rw(i.map(function(t){return t.id}));s.length>0;){var l=s.shift(),c=l.source,f=l.target;u.connected(c,f)||(r.push(l),u.union(c,f))}return r},Gw=function(t,e,r){return r?{prim:Fw,kruskal:zw}[r](t,e):zw(t,e)},Uw=function(t,e,r){"number"!=typeof e&&(e=1e-6),"number"!=typeof r&&(r=.85);for(var n,i=1,o=0,a=1e3,s=t.nodes,u=void 0===s?[]:s,l=t.edges,c=void 0===l?[]:l,f=u.length,h={},p={},d=0;d0&&i>e;){for(o=0,d=0;d0&&(n+=p[b]/A)}h[g]=r*n,o+=h[g]}}for(o=(1-o)/f,i=0,d=0;d=0;e--){var r=this.dfsEdgeList[e],n=r.fromNode,i=r.toNode;nf||n.hasNode(o[c.to])||(e.labeld&&"break"!==y(g);g--);if(h){var v=t.findMinLabel(f);o.dfsEdgeList.push(new Kw(c,p,Yw,v.edgeLabel,Yw));var m=o.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[m]===o.dfsEdgeList[m]&&a(f[v.edgeLabel].projected)}var b={};h=!1;var A=0;s.forEach(function(e){var r=new Zw(e),o=t.findForwardPureEdges(n,r.edges[u[0]],l,r);o.length>0&&(h=!0,A=c,o.forEach(function(t){var r="".concat(t.label,"-").concat(i[t.to].label);b[r]||(b[r]={projected:[],edgeLabel:t.label,nodeLabel2:i[t.to].label}),b[r].projected.push({graphId:n.id,edge:t,preNode:e})}))});var x=u.length,w=function(e){if(h)return"break";var r=u[e];s.forEach(function(e){var a=new Zw(e),s=t.findForwardRmpathEdges(n,a.edges[r],l,a);s.length>0&&(h=!0,A=o.dfsEdgeList[r].fromNode,s.forEach(function(t){var r="".concat(t.label,"-").concat(i[t.to].label);b[r]||(b[r]={projected:[],edgeLabel:t.label,nodeLabel2:i[t.to].label}),b[r].projected.push({graphId:n.id,edge:t,preNode:e})}))})};for(g=0;g=0;f--){var h=e.findBackwardEdge(u,c.edges[n[f]],c.edges[n[0]],c);if(h){var p="".concat(e.dfsCode.dfsEdgeList[n[f]].fromNode,"-").concat(h.label);s[p]||(s[p]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[n[f]].fromNode,edgeLabel:h.label}),s[p].projected.push({graphId:t.graphId,edge:h,preNode:t})}}if(!(r>=e.maxNodeNum)){e.findForwardPureEdges(u,c.edges[n[0]],o,c).forEach(function(e){var r="".concat(i,"-").concat(e.label,"-").concat(l[e.to].label);a[r]||(a[r]={projected:[],fromNodeId:i,edgeLabel:e.label,nodeLabel2:l[e.to].label}),a[r].projected.push({graphId:t.graphId,edge:e,preNode:t})});var d=function(r){e.findForwardRmpathEdges(u,c.edges[n[r]],o,c).forEach(function(i){var o="".concat(e.dfsCode.dfsEdgeList[n[r]].fromNode,"-").concat(i.label,"-").concat(l[i.to].label);a[o]||(a[o]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[n[r]].fromNode,edgeLabel:i.label,nodeLabel2:l[i.to].label}),a[o].projected.push({graphId:t.graphId,edge:i,preNode:t})})};for(f=0;fi){var a=i;i=n,n=a}var c=t.label,f="".concat(r,"-").concat(n,"-").concat(c,"-").concat(i),h="".concat(n,"-").concat(c,"-").concat(i);if(!o[h]){var p=o[h]||0;p++,o[h]=p}s[f]={graphId:r,nodeLabel1:n,edgeLabel:c,nodeLabel2:i}})})}),Object.keys(i).forEach(function(t){if(!(i[t]e&&(s=e);var n=r[t.id].inDegree;u>n&&(u=n);var i=r[t.id].outDegree;l>i&&(l=i)}),t[e]={degree:s,inDegree:u,outDegree:l}),{minPatternNodeLabelDegree:s,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:l}},c_=function(t,e,r,n,i,o,a){var s;if(void 0===r&&(r=!1),void 0===o&&(o="cluster"),void 0===a&&(a="cluster"),t&&t.nodes){var u=t.nodes.length;if(u){var l=Aw(t,r),c=Aw(e,r),f=s_(t.nodes,l,r),h=s_(e.nodes,c,r),p=o_(t.nodes,o),d=p.nodeMap,y=p.nodeLabelMap,g=o_(e.nodes,o),v=g.nodeMap,m=g.nodeLabelMap;a_(t.edges,a,d);var b=a_(e.edges,a,v).edgeLabelMap,A=[];null===c||void 0===c||c.forEach(function(t){A=A.concat(t)}),i||(i=Math.max.apply(Math,(0,Gx.__spreadArray)((0,Gx.__spreadArray)([],A,!1),[2],!1))),n||(n=i);var x=e_(t,l,o,n),w=e_(e,c,o,n),_=function(t,e,r,n,i){var o=Math.ceil(r/e),a={},s=0;return n.forEach(function(t,n){for(var u=0,l=0,c=t.nodeIdxs,f=t.neighborNum-1;u2*e)););if(p<2*e&&(a["".concat(n,"-").concat(h)]={start:n,end:h,distance:i[n][h]},u++,++s>=r))return a;if(++l>2*e)break}uN&&(N=r.length,P=r,L=e,M=t)});var j={},R={},D={},B={},F={},z={};Object.keys(m).forEach(function(n,i){F[n]=[],r&&(z[n]=[]);var s=-1/0,u={};m[n].forEach(function(t){var e=h["".concat(M.id,"-").concat(t.id)];if(e&&F[n].push(e),sF[n][h]){c=!0;break}if(c)return P.splice(e,1),"continue";var p={};i.neighbors.forEach(function(t){var e=f["".concat(r.id,"-").concat(t.id)];p["".concat(r.id,"-").concat(t.id)]={start:d[r.id].idx,end:d[t.id].idx,distance:e}}),S=n_(p,x,t,S);var y=[];Object.keys(p).forEach(function(t){if(O[t])y.push(O[t]);else{var e=S[t];O[t]=i_(e,T,o,a),y.push(O[t])}}),y=y.sort(function(t,e){return e-t});var g=!1;for(h=0;h=0;p--)c(p)});var G=[];null===P||void 0===P||P.forEach(function(n){for(var s=d[n.id].idx,u=r_(t.nodes,l[s],s,o,i).neighbors,c=!1,h=u.length-1;h>=0;h--){if(u.length+1F[y][A])u.splice(h,1);else{if(r){var w="".concat(p.id,"-").concat(n.id),_=f[w];if(A=z[y].length-1,_>z[y][A]){u.splice(h,1);continue}}var E=O[g]?O[g]:u_(t,n,p,d,b,x,T,o,a,O,S),C="".concat(M.id,"-").concat(y);if(E=0&&"break"!==w(y);y--);if(x)return G.splice(n,1),"continue";i.edges=c;var _=yw(i,i.nodes[0].id,!1).length;if(Object.keys(_).reverse().forEach(function(t){if(t!==i.nodes[0].id&&!x){if(_[t]===1/0){var e=l[t].node[o];if(u[e]--,u[e]H[n][H[n].length-1]){if(e=l[t].node[o],u[e]--,u[e]=0;C--){var k=i.nodes[C],I=l[k.id].degree,T=l[k.id].inDegree,O=l[k.id].outDegree,P=k[o],L=l_(j,P,v,m),N=L.minPatternNodeLabelDegree,R=L.minPatternNodeLabelInDegree,D=L.minPatternNodeLabelOutDegree;if(r?I=0;B--){var F=c[B];if(!l[F.source]||!l[F.target]){c.splice(B,1);var z=F[a];if(f[z]--,l[F.source]&&(l[F.source].degree--,l[F.source].outDegree--),l[F.target]&&(l[F.target].degree--,l[F.target].inDegree--),b[z]&&f[z]=0&&"break"!==V(Q);Q--);var Y=G.length,W=function(t){var e={};G[t].edges.forEach(function(t){var r="".concat(t.source,"-").concat(t.target,"-").concat(t.label);e[r]?e[r]++:e[r]=1});for(var r=function(t){var r={};G[t].edges.forEach(function(t){var e="".concat(t.source,"-").concat(t.target,"-").concat(t.label);r[e]?r[e]++:r[e]=1});var n=!0;Object.keys(r).length!==Object.keys(e).length?n=!1:Object.keys(e).forEach(function(t){r[t]!==e[t]&&(n=!1)}),n&&G.splice(t,1)},n=Y-1;n>t;n--)r(n);Y=G.length};for(Q=0;Q<=Y-1;Q++)W(Q);return G}}},f_=function(){function t(t){void 0===t&&(t=10),this.linkedList=new Jx,this.maxStep=t}return Object.defineProperty(t.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},t.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},t.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},t.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toArray=function(){return this.linkedList.toArray().map(function(t){return t.value})},t.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},t}(),h_=dw,p_={getAdjMatrix:qx,breadthFirstSearch:rw,connectedComponent:ow,getDegree:sw,getInDegree:uw,getOutDegree:lw,detectCycle:dw,detectDirectedCycle:h_,detectAllCycles:pw,detectAllDirectedCycle:hw,detectAllUndirectedCycle:fw,depthFirstSearch:cw,dijkstra:yw,findAllPath:bw,findShortestPath:mw,floydWarshall:Aw,labelPropagation:xw,louvain:Tw,iLouvain:Ow,kCore:Mw,kMeans:Lw,cosineSimilarity:Nw,nodesCosineSimilarity:jw,minimumSpanningTree:Gw,pageRank:Uw,getNeighbors:$x,Stack:f_,GADDI:c_},d_=r(4995),y_=r(9019),g_=r(4732),v_=Wx.pd,m_=function(t){return function(e,r){return e[t]-r[t]}},b_=function(t,e,r){return t>=e&&t<=r},A_=function(t,e,r,n){var i=r.x-t.x,o=r.y-t.y,a=e.x-t.x,s=e.y-t.y,u=n.x-r.x,l=n.y-r.y,c=a*l-s*u,f=1/c;if(c*c>1e-4*(a*a+s*s)*(u*u+l*l)){var h=(i*l-o*u)*f,p=(i*s-o*a)*f;return b_(h,0,1)&&b_(p,0,1)?{x:t.x+h*a,y:t.y+h*s}:null}return null},x_=function(t,e){var r=t.x,n=t.y,i=t.width,o=t.height,a=[],s={x:r+i/2,y:n+o/2};a.push({x:r,y:n}),a.push({x:r+i,y:n}),a.push({x:r+i,y:n+o}),a.push({x:r,y:n+o}),a.push({x:r,y:n});for(var u=null,l=1;le[n][o]+e[o][i]&&(e[n][i]=e[n][o]+e[o][i]);return e},O_=function(t,e){var r=t.nodes,n=t.edges,i=[],o={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach(function(t,e){o[t.id]=e;i.push([])}),n&&n.forEach(function(t){var r=t.source,n=t.target,a=o[r],s=o[n];i[a][s]=1,e||(i[s][a]=1)}),i},M_=function(t,e){t.translate(e.x,e.y)},P_=function(t,e,r,n){void 0===n&&(n={duration:500});var i=t.getMatrix();i||(i=[1,0,0,0,1,0,0,0,1]);var o=t.getCanvasBBox(),a=e.x-o.minX,s=e.y-o.minY;if(r){var u=a*i[0],l=s*i[4],c=0,f=0,h=0,p=0;t.animate(function(t){return i=v_(i,[["t",(h=u*t)-c,(p=l*t)-f]]),c=h,f=p,{matrix:i}},n)}else{var d=v_(i,[["t",a,s]]);t.setMatrix(d)}},L_=function(t,e){var r=t.getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]);var n=e;(0,Ux.isArray)(e)||(n=[e,e]),(0,Ux.isArray)(e)&&1===e.length&&(n=[e[0],e[0]]),r=v_(r,[["s",n[0],n[1]]]),t.setMatrix(r)},N_=function(t,e){var r=t.getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]),r=v_(r,[["r",e]]),t.setMatrix(r)},j_=function(t,e,r){for(var n=[],i=0;i0!=a(l[1]-r)>0&&a(e-(r-u[1])*(u[0]-l[0])/(u[1]-l[1])-u[0])<0&&(n=!n)}return n},B_=function(t,e){return!(e.minX>t.maxX||e.maxXt.maxY||e.maxY1){var a=t[0],s=t[r-1];e.push({from:{x:s[0],y:s[1]},to:{x:a[0],y:a[1]}})}return e};if(t.length<2||e.length<2)return!1;var i=r(t),o=r(e);if(!B_(i,o))return!1;var a=!1;if((0,Ux.each)(e,function(e){if(D_(t,e[0],e[1]))return a=!0,!1}),a)return!0;if((0,Ux.each)(t,function(t){if(D_(e,t[0],t[1]))return a=!0,!1}),a)return!0;var s=n(t),u=n(e),l=!1;return(0,Ux.each)(u,function(t){if(function(t,e){var r=!1;return(0,Ux.each)(t,function(t){if(A_(t.from,t.to,e.from,e.to))return r=!0,!1}),r}(s,t))return l=!0,!1}),l},z_=function(){function t(t,e,r,n){this.x1=t,this.y1=e,this.x2=r,this.y2=n}return t.prototype.getBBox=function(){var t=Math.min(this.x1,this.x2),e=Math.min(this.y1,this.y2),r=Math.max(this.x1,this.x2),n=Math.max(this.y1,this.y2);return{x:t,y:e,minX:t,minY:e,maxX:r,maxY:n,width:r-t,height:n-e}},t}(),G_=function(t,e){return{top:[t.minX,t.minY,t.maxX,t.minY],left:[t.minX,t.minY,t.minX,t.maxY],bottom:[t.minX,t.maxY,t.maxX,t.maxY],right:[t.maxX,t.minY,t.maxX,t.maxY]}[e]},U_=function(t,e){var r=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),n=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),i=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(i){var o=r/i,a=n/i;if(o>=0&&o<=1&&a>=0&&a<=1)return o}return Number.POSITIVE_INFINITY},H_=function(t,e){for(var r=["top","left","bottom","right"],n=t.getBBox(),i=0,o=[],a=0;a<4;a++){var s=G_(n,r[a]),u=s[0],l=s[1],c=s[2],f=s[3];o[a]=A_({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},{x:u,y:l},{x:c,y:f}),o[a]&&(i+=1)}return[o,i]},V_=function(t,e){for(var r=["top","left","bottom","right"],n=t.getBBox(),i=Number.POSITIVE_INFINITY,o=0,a=0;a<4;a++){var s=G_(n,r[a]),u=s[0],l=s[1],c=s[2],f=s[3],h=U_(e,new z_(u,l,c,f));(h=Math.abs(h-.5))>=0&&h<=1&&(o+=1,i=h0){for(var n=0,i=t;ne.x+e.width,i=t.y>e.y+e.height,o=t.y":.604998779296875,"/":.5,"?":.53699951171875},aS=Math.PI,sS=Math.sin,uS=Math.cos,lS=sS(aS/8),cS=uS(aS/8),fS=function(t,e){var r=t.getBBox(),n={x:r.minX,y:r.minY},i={x:r.maxX,y:r.maxY};if(e){var o=e.getMatrix();o||(o=[1,0,0,0,1,0,0,0,1]),n=S_(n,o),i=S_(i,o)}var a=n.x,s=n.y,u=i.x,l=i.y;return{x:a,y:s,minX:a,minY:s,maxX:u,maxY:l,width:u-a,height:l-s}},hS=function(t){var e=t.sourceNode||t.targetNode,r=e.get("group").getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]);var n=e.getKeyShape(),i=n.getBBox(),o=t.loopCfg||{},a=o.dist||2*Math.max(i.width,i.height),s=o.position||iS.defaultLoopPosition,u=[(i.minX+i.maxX)/2+r[6],(i.minY+i.maxY)/2+r[7]],l=[t.startPoint.x,t.startPoint.y],c=[t.endPoint.x,t.endPoint.y],f=i.height/2,h=i.width/2,p=f,d=f,y=p*lS,g=p*cS,v=d*lS,m=d*cS,b=n.get("type"),A=Math.min(f/2,h/2),x=Math.min(f,h),w=(null===o||void 0===o?void 0:o.pointPadding)?Math.min(x,null===o||void 0===o?void 0:o.pointPadding):A;if(l[0]===c[0]&&l[1]===c[1]){switch(s){case"top":"circle"===b?(l=[u[0]-y,u[1]-g],c=[u[0]+v,u[1]-m]):(l=[u[0]-w,u[1]-f],c=[u[0]+w,u[1]-f]);break;case"top-right":p=f,d=h,"circle"===b?(l=[u[0]+(y=p*lS),u[1]-(g=p*cS)],c=[u[0]+(m=d*cS),u[1]-(v=d*lS)]):(l=[u[0]+h-w,u[1]-f],c=[u[0]+h,u[1]-f+w]);break;case"right":p=h,d=h,"circle"===b?(l=[u[0]+(g=p*cS),u[1]-(y=p*lS)],c=[u[0]+(m=d*cS),u[1]+(v=d*lS)]):(l=[u[0]+h,u[1]-w],c=[u[0]+h,u[1]+w]);break;case"bottom-right":p=h,d=f,"circle"===b?(l=[u[0]+(g=p*cS),u[1]+(y=p*lS)],c=[u[0]+(v=d*lS),u[1]+(m=d*cS)]):(l=[u[0]+h,u[1]+f-w],c=[u[0]+h-w,u[1]+f]);break;case"bottom":p=f,d=f,"circle"===b?(l=[u[0]+(y=p*lS),u[1]+(g=p*cS)],c=[u[0]-(v=d*lS),u[1]+(m=d*cS)]):(l=[u[0]-w,u[1]+f],c=[u[0]+w,u[1]+f]);break;case"bottom-left":p=f,d=h,"circle"===b?(l=[u[0]-(y=p*lS),u[1]+(g=p*cS)],c=[u[0]-(m=d*cS),u[1]+(v=d*lS)]):(l=[u[0]-h,u[1]+f-w],c=[u[0]-h+w,u[1]+f]);break;case"left":p=h,d=h,"circle"===b?(l=[u[0]-(g=p*cS),u[1]+(y=p*lS)],c=[u[0]-(m=d*cS),u[1]-(v=d*lS)]):(l=[u[0]-h,u[1]-w],c=[u[0]-h,u[1]+w]);break;case"top-left":p=h,d=f,"circle"===b?(l=[u[0]-(g=p*cS),u[1]-(y=p*lS)],c=[u[0]-(v=d*lS),u[1]-(m=d*cS)]):(l=[u[0]-h+w,u[1]-f],c=[u[0]-h,u[1]-f+w]);break;default:l=[u[0]-(y=(p=h)*lS),u[1]-(g=p*cS)],c=[u[0]+(v=(d=h)*lS),u[1]-(m=d*cS)]}if(!1===o.clockwise){var _=[l[0],l[1]];l=[c[0],c[1]],c=[_[0],_[1]]}}var S=[l[0]-u[0],l[1]-u[1]],E=(p+a)/p,C=(d+a)/d;!1===o.clockwise&&(E=(d+a)/d,C=(p+a)/p);var k=g_.scale([0,0],S,E),I=[u[0]+k[0],u[1]+k[1]],T=[c[0]-u[0],c[1]-u[1]],O=g_.scale([0,0],T,C),M=[u[0]+O[0],u[1]+O[1]];return t.startPoint={x:l[0],y:l[1]},t.endPoint={x:c[0],y:c[1]},t.controlPoints=[{x:I[0],y:I[1]},{x:M[0],y:M[1]}],t},pS=function(t,e,r,n,i){var o=[],a=null===t||void 0===t?void 0:t.getPoint(e);if(!a)return{x:0,y:0,angle:0};if(e<1e-4)o=t.getStartTangent().reverse();else if(e>.9999)o=t.getEndTangent();else{var s=null===t||void 0===t?void 0:t.getPoint(e+1e-4);o.push([a.x,a.y]),o.push([s.x,s.y])}var u=Math.atan2(o[1][1]-o[0][1],o[1][0]-o[0][0]);if(u<0&&(u+=2*aS),r&&(a.x+=uS(u)*r,a.y+=sS(u)*r),n){var l=u-aS/2;u>.5*aS&&u<1.5*aS&&(l-=aS),a.x+=uS(l)*n,a.y+=sS(l)*n}var c={x:a.x,y:a.y,angle:u};return i?(u>.5*aS&&u<1.5*aS&&(u-=aS),(0,Gx.__assign)({rotate:u},c)):c},dS=function(t,e){"function"==typeof e&&function t(e,r,n,i){if(!1===i(e,r,n))return!1;if(e&&e.children)for(var o=e.children.length-1;o>=0;o--)if(!t(e.children[o],e,o,i))return!1;return!0}(t,null,-1,e)},yS=function(t,e){"function"==typeof e&&function t(e,r,n,i){if(e&&e.children)for(var o=e.children.length-1;o>=0;o--)if(!t(e.children[o],e,o,i))return;return!1!==i(e,r,n)}(t,null,-1,e)},gS=function(t,e){return e*(oS[t]||1)},vS=function(t,e){var r=0,n=new RegExp("[一-龥]+");return t.split("").forEach(function(t){n.test(t)?r+=e:r+=gS(t,e)}),[r,e]},mS=function(t,e){return"number"!=typeof e||e<=0||e>=t.length?t:t.substring(0,e)+"..."},bS=function(t,e){var r=[],n={},i={};t.forEach(function(t){i[t.id]=t}),t.forEach(function(t,e){var o=(0,Ux.clone)(t);o.itemType="combo",o.children=void 0,o.parentId===o.id?(console.warn("The parentId for combo ".concat(o.id," can not be the same as the combo's id")),delete o.parentId):o.parentId&&!i[o.parentId]&&(console.warn("The parent combo for combo ".concat(o.id," does not exist!")),delete o.parentId);var a=n[o.id];if(a){if(o.children=a.children,n[o.id]=o,!(a=o).parentId)return void r.push(a);var s=n[a.parentId];if(s)s.children?s.children.push(o):s.children=[o];else{var u={id:a.parentId,children:[a]};n[a.parentId]=u,n[o.id]=o}}else if((0,Ux.isString)(t.parentId)){var l=n[t.parentId];if(l)l.children?l.children.push(o):l.children=[o],n[o.id]=o;else{var c={id:t.parentId,children:[o]};n[c.id]=c,n[o.id]=o}}else r.push(o),n[o.id]=o});var o={};(e||[]).forEach(function(t){o[t.id]=t;var e=n[t.comboId];if(e){var r={id:t.id,comboId:t.comboId};e.children?e.children.push(r):e.children=[r],r.itemType="node",n[t.id]=r}});var a=0;return r.forEach(function(t){t.depth=a+10,dS(t,function(t){var e,r=n[t.id].itemType;e="node"===r?n[t.comboId]:n[t.parentId],t.depth=e&&"node"===r?a+1:a+10,a-1&&o.splice(l,1),s||(i={id:e,itemType:"node",comboId:r},a[e]={children:void 0}),e){var c=!1;if(r){var f=0;(t||[]).forEach(function(t){c||dS(t,function(t){return r!==t.id||(c=!0,t.children?t.children.push(i):t.children=[i],f=t.depth,"node"===i.itemType?i.depth=f+2:i.depth=f+1,!1)})})}else r&&c||"node"===i.itemType||t.push(i);var h=i.depth;dS(i,function(t){return"node"===t.itemType?h+=2:h+=1,t.depth=h,!0})}return t},xS=function(t,e,r){var n={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,x:void 0,y:void 0,width:void 0,height:void 0,centerX:void 0,centerY:void 0};if(!t||0===t.length){var i=(null===r||void 0===r?void 0:r.getModel())||{},o=i.x,a=i.y,s=i.fixSize,u=i.collapsed,l=i.fixCollapseSize,c=u?l:s,f=(0,Ux.isArray)(c)?c:[c,c],h=f[0],p=f[1],d=[h/2,p/2];return{minX:o-d[0],minY:a-d[1],maxX:o+d[0],maxY:a+d[1],x:o,y:a,width:h,height:p}}return t.forEach(function(t){var r=e.findById(t.id);if(r&&r.isVisible()){r.set("bboxCanvasCache",void 0);var i=r.getCanvasBBox();i.x&&n.minX>i.minX&&(n.minX=i.minX),i.y&&n.minY>i.minY&&(n.minY=i.minY),i.x&&n.maxXr&&(r=l),c>i&&(i=c)}return{x:Math.floor(e),y:Math.floor(n),width:Math.ceil(r)-Math.floor(e),height:Math.ceil(i)-Math.floor(n),minX:e,minY:n,maxX:r,maxY:i}},jS=function(t,e,r,n,i){void 0===e&&(e=15),void 0===r&&(r="quadratic"),void 0===n&&(n=void 0),void 0===i&&(i=void 0);for(var o=t.length,a=2*e,s=["top","top-right","right","bottom-right","bottom","bottom-left","left","top-left"],u={},l=[],c={},f=0;fn.get("optimizeThreshold")){var a=1/0,s=1/0,u=-1/0,l=-1/0;o.forEach(function(t){var e=t.getModel(),r=e.x,n=e.y;a>r&&(a=r),s>n&&(s=n),up&&(d=p,console.warn("fitview failed, ratio out of range, ratio: %f",a,"graph maxzoom has been used instead"));var y=(0,RS.pd)(f,[["t",-i.x,-i.y],["s",d,d],["t",i.x,i.y]]),g=SS({animateCfg:r,callback:function(){t.setMatrix(y),u.emit("viewportchange",{action:"translate",matrix:f}),u.emit("viewportchange",{action:"zoom",matrix:y})}});t.stopAnimate(),t.setMatrix(e),t.animate(function(t){return{matrix:Z_(e,y,t)}},g)}else{var v=SS({animateCfg:r,callback:function(){u.emit("viewportchange",{action:"translate",matrix:f})}});t.animate(function(t){return{matrix:Z_(e,f,t)}},v)}}},t.prototype.fitView=function(t,e){var r,n=this.graph,i=this.getFormatPadding(),o=n.get("width"),a=n.get("height"),s=n.get("group"),u=s.getMatrix()||[1,0,0,0,1,0,0,0,1];s.resetMatrix();var l=n.getNodes();if(l.length>n.get("optimizeThreshold")){var c=1/0,f=1/0,h=-1/0,p=-1/0;l.forEach(function(t){var e=t.getModel(),r=e.x,n=e.y;c>r&&(c=r),f>n&&(f=n),hv&&(m=v),t)this.animatedFitView(s,u,e,r,d,y,m,!0);else{var b=d.x-y.x,A=d.y-y.y;if(LS(b)||LS(A))return;n.translate(b,A),n.zoom(m,d)||console.warn("zoom failed, ratio out of range, ratio: %f",m)}}},t.prototype.fitViewByRules=function(t,e,r){var n,i=t.onlyOutOfViewPort,o=void 0!==i&&i,a=t.direction,s=void 0===a?"both":a,u=t.ratioRule,l=void 0===u?"min":u,c=this.graph,f=this.getFormatPadding(),h=c.get("width"),p=c.get("height"),d=c.get("group"),y=d.getMatrix()||[1,0,0,0,1,0,0,0,1];d.resetMatrix();var g=c.getNodes();if(g.length>c.get("optimizeThreshold")){var v=1/0,m=1/0,b=-1/0,A=-1/0;g.forEach(function(t){var e=t.getModel(),r=e.x,n=e.y;v>r&&(v=r),m>n&&(m=n),bc.maxX&&(c.maxX=p.maxX),p.maxY>c.maxY&&(c.maxY=p.maxY)}if(c.x=c.minX,c.y=c.minY,c.width=c.maxX-c.minX,c.height=c.maxY-c.minY,0!==c.width&&0!==c.height){var d=this.getViewCenter(),y={x:c.x+c.width/2,y:c.y+c.height/2},g=(a-o[1]-o[3])/c.width,v=(s-o[0]-o[2])/c.height,m=g;g>v&&(m=v),r?this.animatedFitView(u,l,n,c,d,y,m,e):(i.translate(d.x-y.x,d.y-y.y),e&&!i.zoom(m,d)&&console.warn("zoom failed, ratio out of range, ratio: %f",m))}}},t.prototype.changeSize=function(t,e){var r=this.graph;if(!(0,Ux.isNumber)(t)||!(0,Ux.isNumber)(e))throw Error("invalid canvas width & height, please make sure width & height type is number");r.set({width:t,height:e}),r.get("canvas").changeSize(t,e),r.get("plugins").forEach(function(t){t.get("gridContainer")&&t.positionInit()})},t.prototype.destroy=function(){this.graph=null,this.destroyed=!1},t}();function BS(t){"@babel/helpers - typeof";return(BS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function FS(t){if("string"!=typeof t)return t;var e=function(t){if("string"!=typeof t)return t;try{return JSON.parse(t.trim())}catch(e){return t.trim()}},r=e(t);if("string"!=typeof r)return r;for(var n=function(t){return t[t.length-1]},i=t.trim(),o=[],a=[],s=function(){for(var t=[],e=0;en.width&&(n.width=c.width+c.x),c.height+c.y>n.height&&(n.height=c.height+c.y)}}}return t.bbox=function(t,e,r){var n,i,o=t.attrs,a=void 0===o?{}:o,s={x:e.x||0,y:e.y||0,width:r.width||0,height:r.height||0};switch(t.type){case"maker":case"circle":a.r&&(i=2*a.r,n=2*a.r);break;case"text":a.text&&(i=vS(a.text,a.fontSize||12)[0],n=16,s.y+=n,s.height=n,s.width=i,t.attrs=(0,Gx.__assign)({fontSize:12,fill:"#000"},a));break;default:a.width&&(i=a.width),a.height&&(n=a.height)}return n>=0&&(s.height=n),i>=0&&(s.width=i),a.marginTop&&(s.y+=a.marginTop),a.marginLeft&&(s.x+=a.marginLeft),s}(t,e,n),t.attrs=(0,Gx.__assign)((0,Gx.__assign)({},t.attrs),t.bbox),t}function HS(t){var e={},r=function(e){var r="function"==typeof t?t(e):t,n=GS(r)(e),i=document.createElement("div");i.innerHTML=n;var o=US(function t(e,r){var n={},i=e.getAttributeNames&&e.getAttributeNames()||[],o=e.children&&Array.from(e.children).map(function(e){return t(e,r)}),a={},s=e.tagName?e.tagName.toLowerCase():"group";return"text"===s&&(n.text=e.innerText),a.type=s,"img"===s&&(a.type="image"),Array.from(i).forEach(function(t){var r=zS(t),i=e.getAttribute(t);try{if("style"===r||"attrs"===r){var o=FS(i);n=(0,Gx.__assign)((0,Gx.__assign)({},n),o)}else a[r]=FS(i)}catch(t){if("style"===r)throw t;a[r]=i}}),a.attrs=n,r&&r.style&&a.name&&"object"===BS(r.style[a.name])&&(a.attrs=(0,Gx.__assign)((0,Gx.__assign)({},a.attrs),r.style[a.name])),r&&r.style&&a.keyshape&&(a.attrs=(0,Gx.__assign)((0,Gx.__assign)({},a.attrs),r.style)),o.length&&(a.children=o),a}(i.children[0],e));return i.remove(),o};return{draw:function(t,n){var i=r(t),o=n;return function t(e){var r=e.attrs,i=void 0===r?{}:r,a=e.bbox,s=e.type,u=e.children,l=(0,Gx.__rest)(e,["attrs","bbox","type","children"]);if("group"!==e.type){var c=n.addShape(e.type,(0,Gx.__assign)({attrs:i,origin:{bbox:a,type:s,children:u}},l));e.keyshape&&(o=c)}e.children&&e.children.forEach(function(e){return t(e)})}(i),e[t.id]=[i],o},update:function(t,n){e[t.id]||(e[t.id]=[]);var i=n.getContainer(),o=i.get("children"),a=r(t),s=function t(e){var r;"group"!==e.type&&i.addShape(e.type,{attrs:e.attrs}),(null===(r=e.children)||void 0===r?void 0:r.length)&&e.children.map(function(e){return t(e)})},u=function t(e){var r,n=o.find(function(t){return t.attrs.key===e.attrs.key});n&&i.removeChild(n),(null===(r=e.children)||void 0===r?void 0:r.length)&&e.children.map(function(e){return t(e)})};!function t(e){var r=e.key;if("group"!==e.type){var i=o.find(function(t){return t.attrs.key===r});switch(e.action){case"change":if(i){var a=e.val.keyshape?n.getOriginStyle():{};i.attr((0,Gx.__assign)((0,Gx.__assign)({},a),e.val.attrs))}break;case"add":s(e.val);break;case"delete":u(e.val);break;case"restructure":u(e.formerTarget),s(e.nowTarget)}}e.children&&e.children.forEach(function(e){return t(e)})}(function t(e,r){var n,i,o,a,s=(e||{}).type,u=((null===r||void 0===r?void 0:r.attrs)||{}).key;if(u&&e&&(e.attrs.key=u),!e&&r)return{action:"delete",val:r,type:s,key:u};if(e&&!r)return{action:"add",val:e,type:s};if(!e&&!r)return{action:"same",type:s};var l=[];if((null===(n=e.children)||void 0===n?void 0:n.length)>0||(null===(i=r.children)||void 0===i?void 0:i.length)>0)for(var c=Math.max(null===(o=e.children)||void 0===o?void 0:o.length,null===(a=r.children)||void 0===a?void 0:a.length),f=r.children||[],h=e.children||[],p=0;p-1)return;r.push(i)}else s>-1&&r.splice(s,1)}else if((0,Ux.isString)(e)){var u=r.filter(function(t){return t.includes(o)});u.length>0&&this.clearStates(u),(a=a.filter(function(t){return!t.includes(o)})).push(i),this.set("states",a)}if(n){var l=this.get("model").type;n.setState(l,t,e,this)}},t.prototype.clearStates=function(t){var e=this,r=e.getStates(),n=e.get("shapeFactory"),i=e.get("model").type;t||(t=r),(0,Ux.isString)(t)&&(t=[t]);var o=r.filter(function(e){return-1===t.indexOf(e)});e.set("states",o),t.forEach(function(t){n.setState(i,t,!1,e)})},t.prototype.setOptimize=function(t){this.optimize=t},t.prototype.getContainer=function(){return this.get("group")},t.prototype.getKeyShape=function(){return this.get("keyShape")},t.prototype.getModel=function(){return this.get("model")},t.prototype.getType=function(){return this.get("type")},t.prototype.getID=function(){return this.get("id")},t.prototype.isItem=function(){return!0},t.prototype.getStates=function(){return this.get("states")},t.prototype.hasState=function(t){return this.getStates().indexOf(t)>=0},t.prototype.refresh=function(t){var e=this.get("model");this.updatePosition(e),this.updateShape(t),this.afterUpdate(),this.clearCache()},t.prototype.getUpdateType=function(t){},t.prototype.update=function(t,e){void 0===e&&(e=void 0);var r=this.get("model");if("move"===e)this.updatePosition(t);else{var n=r.visible,i=t.visible;n!==i&&void 0!==i&&this.changeVisibility(i);var o={x:r.x,y:r.y};t.x=isNaN(+t.x)?r.x:+t.x,t.y=isNaN(+t.y)?r.y:+t.y;var a=this.get("styles");if(t.stateStyles){var s=t.stateStyles;(0,Ux.mix)(a,s),delete t.stateStyles}Object.assign(r,t),o.x===t.x&&o.y===t.y||this.updatePosition(t),this.updateShape(e)}this.afterUpdate(),this.clearCache()},t.prototype.updateShape=function(t){var e=this.get("shapeFactory"),r=this.get("model"),n=r.type;if(e.shouldUpdate(n)&&n===this.get("currentShape")){var i=this.getShapeCfg(r,t);e.baseUpdate(n,i,this,t),"move"!==t&&this.setOriginStyle()}else this.draw();this.restoreStates(e,n)},t.prototype.updatePosition=function(t){var e=this.get("model"),r=isNaN(+t.x)?+e.x:+t.x,n=isNaN(+t.y)?+e.y:+t.y,i=this.get("group");if(isNaN(r)||isNaN(n))return!1;e.x=r,e.y=n;var o=i.getMatrix();return(!o||o[6]!==r||o[7]!==n)&&(i.resetMatrix(),M_(i,{x:r,y:n}),this.clearCache(),!0)},t.prototype.getBBox=function(){var t=this.get("bboxCache");return t||(t=this.calculateBBox(),this.set("bboxCache",t)),t},t.prototype.getCanvasBBox=function(){var t=this.get("bboxCanvasCache");return t||(t=this.calculateCanvasBBox(),this.set("bboxCanvasCache",t)),t},t.prototype.toFront=function(){this.get("group").toFront()},t.prototype.toBack=function(){this.get("group").toBack()},t.prototype.show=function(){this.changeVisibility(!0)},t.prototype.hide=function(){this.changeVisibility(!1)},t.prototype.changeVisibility=function(t){var e=this.get("group");t?e.show():e.hide(),this.set("visible",t)},t.prototype.isVisible=function(){return this.get("visible")},t.prototype.enableCapture=function(t){var e=this.get("group");e&&e.set("capture",t)},t.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),e=this.get("group");t&&e.stopAnimate(),e.shapeMap={},this.clearCache(),e.remove(),this._cfg=null,this.destroyed=!0}},t}(),JS={source:"start",target:"end"},ZS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){return{type:"edge",sourceNode:null,targetNode:null,startPoint:null,endPoint:null,linkCenter:!1}},e.prototype.setEnd=function(t,e){var r=JS[t]+"Point",n=t+"Node",i=this.get(n);i&&!i.destroyed&&i.removeEdge(this),(0,Ux.isPlainObject)(e)?(this.set(r,e),this.set(n,null)):e&&(e.addEdge(this),this.set(n,e),this.set(r,null))},e.prototype.getLinkPoint=function(t,e,r){var n=JS[t]+"Point",i=t+"Node",o=this.get(n);if(!o){var a=this.get(i),s=t+"Anchor",u=this.getPrePoint(t,r),l=e[s];(0,Ux.isNil)(l)||(o=a.getLinkPointByAnchor(l)),o=o||a.getLinkPoint(u),(0,Ux.isNil)(o.index)||this.set("".concat(t,"AnchorIndex"),o.index)}return o},e.prototype.getPrePoint=function(t,e){if(e&&e.length)return e["source"===t?0:e.length-1];var r="source"===t?"target":"source";return this.getEndPoint(r)},e.prototype.getEndPoint=function(t){var e=t+"Node",r=JS[t]+"Point",n=this.get(e);return n&&!n.destroyed?n.get("model"):this.get(r)},e.prototype.getControlPointsByCenter=function(t){var e=this.getEndPoint("source"),r=this.getEndPoint("target"),n=this.get("shapeFactory"),i=t.type;return n.getControlPoints(i,{startPoint:e,endPoint:r})},e.prototype.getEndCenter=function(t){var e=t+"Node",r=JS[t]+"Point",n=this.get(e);if(n){var i=n.getBBox();return{x:i.centerX,y:i.centerY}}return this.get(r)},e.prototype.init=function(){t.prototype.init.call(this),this.setSource(this.get("source")),this.setTarget(this.get("target"))},e.prototype.getShapeCfg=function(e,r){var n=this.get("linkCenter"),i=(null===r||void 0===r?void 0:r.includes("move"))?e:t.prototype.getShapeCfg.call(this,e);if(n)i.startPoint=this.getEndCenter("source"),i.endPoint=this.getEndCenter("target");else{var o=i.controlPoints||this.getControlPointsByCenter(i);i.startPoint=this.getLinkPoint("source",e,o),i.endPoint=this.getLinkPoint("target",e,o)}return i.sourceNode=this.get("sourceNode"),i.targetNode=this.get("targetNode"),i},e.prototype.getModel=function(){var t=this.get("model"),e=this.get("source".concat("Node")),r=this.get("target".concat("Node"));return e?delete t["source".concat("Node")]:t.source=this.get("start".concat("Point")),r?delete t["target".concat("Node")]:t.target=this.get("end".concat("Point")),(0,Ux.isString)(t.source)||(0,Ux.isPlainObject)(t.source)||(t.source=t.source.getID()),(0,Ux.isString)(t.target)||(0,Ux.isPlainObject)(t.target)||(t.target=t.target.getID()),t},e.prototype.setSource=function(t){this.setEnd("source",t),this.set("source",t)},e.prototype.setTarget=function(t){this.setEnd("target",t),this.set("target",t)},e.prototype.getSource=function(){return this.get("source")},e.prototype.getTarget=function(){return this.get("target")},e.prototype.updatePosition=function(){return!1},e.prototype.update=function(t,e){void 0===e&&(e=void 0);var r=this.get("model"),n=r.visible,i=t.visible;n!==i&&void 0!==i&&this.changeVisibility(i);var o=this.get("source"),a=this.get("target");if(o&&!o.destroyed&&a&&!a.destroyed){var s=this.get("styles");if(t.stateStyles){var u=t.stateStyles;(0,Ux.mix)(s,u),delete t.stateStyles}Object.assign(r,t),this.updateShape(e),this.afterUpdate(),this.clearCache()}},e.prototype.destroy=function(){var e=this.get("source".concat("Node")),r=this.get("target".concat("Node"));e&&!e.destroyed&&e.removeEdge(this),r&&!r.destroyed&&r.removeEdge(this),t.prototype.destroy.call(this)},e}(KS),$S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getNearestPoint=function(t,e){for(var r=0,n=t[0],i=k_(t[0],e),o=0;o-1&&e.splice(r,1)},e.prototype.clearCache=function(){this.set("bboxCache",null),this.set("anchorPointsCache",null)},e.prototype.getUpdateType=function(t){var e,r,n,i,o;if(t){var a=!(0,Ux.isNil)(t.x),s=!(0,Ux.isNil)(t.y),u=Object.keys(t);return 1===u.length&&(a||s)||2===u.length&&a&&s?"move":(0,Ux.isNumber)(t.x)||(0,Ux.isNumber)(t.y)||t.type||t.anchorPoints||t.size||(null===t||void 0===t?void 0:t.style)&&((null===(e=null===t||void 0===t?void 0:t.style)||void 0===e?void 0:e.r)||(null===(r=null===t||void 0===t?void 0:t.style)||void 0===r?void 0:r.width)||(null===(n=null===t||void 0===t?void 0:t.style)||void 0===n?void 0:n.height)||(null===(i=null===t||void 0===t?void 0:t.style)||void 0===i?void 0:i.rx)||(null===(o=null===t||void 0===t?void 0:t.style)||void 0===o?void 0:o.ry))?"bbox|label":u.includes("label")||u.includes("labelCfg")?"style|label":"style"}},e.prototype.setState=function(e,r){var n=this;this.optimize?t.prototype.setState.call(this,e,r):this.runWithBBoxAffected(function(){return t.prototype.setState.call(n,e,r)})},e.prototype.clearStates=function(e){var r=this;this.optimize?t.prototype.clearStates.call(this,e):this.runWithBBoxAffected(function(){return t.prototype.clearStates.call(r,e)})},e.prototype.runWithBBoxAffected=function(t){var e=["r","width","height","rx","ry","lineWidth"],r=this.getKeyShape().attr(),n={};Object.keys(this.getKeyShape().attr()).forEach(function(t){e.includes(t)&&(n[t]=r[t])}),t();for(var i=this.getKeyShape().attr(),o=0;o-1&&(e.splice(r,1),!0)}},e.prototype.removeNode=function(t){if(t){var e=this.getNodes(),r=e.indexOf(t);return r>-1&&(e.splice(r,1),!0)}},e.prototype.getUpdateType=function(t){},e.prototype.getBBox=function(){return this.set("bboxCanvasCache",null),this.calculateCanvasBBox()},e.prototype.clearCache=function(){this.set("bboxCache",null),this.set("bboxCanvasCache",null),this.set("anchorPointsCache",null)},e.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),e=this.get("group");t&&e.stopAnimate(),e.shapeMap={},this.clearCache(),this.set("sizeCache",null),this.set("bbox",null),e.remove(),this._cfg=null,this.destroyed=!0}},e}($S),eE=function(){function t(t){var e=this;this.edgeToBeUpdateMap={},this.throttleRefresh=(0,Ux.throttle)(function(t){var r=e.graph;if(r&&!r.get("destroyed")){var n=e.edgeToBeUpdateMap;if(n){var i=Object.values(n);i.length&&(i.forEach(function(t){var e=t.edge;if(e&&!e.destroyed){var r=e.getSource(),n=e.getTarget();r&&!r.destroyed&&n&&!n.destroyed&&e.refresh(t.updateType)}}),e.edgeToBeUpdateMap={})}}},16,{trailing:!0,leading:!0}),this.graph=t,this.destroyed=!1}return t.prototype.addItem=function(t,e){var r=this.graph,n="vedge"===t?"edge":t,i=r.get("".concat(n,"Group"))||r.get("group"),o=(0,Ux.upperFirst)(n),a=null,s=r.get(n+(0,Ux.upperFirst)("stateStyles"))||{},u=r.get("default"+o);e.stateStyles&&(s=e.stateStyles),u&&(0,Ux.each)(u,function(t,r){(0,Ux.isObject)(t)&&!(0,Ux.isArray)(t)?e[r]=(0,Ux.deepMix)({},t,e[r]):(0,Ux.isArray)(t)?e[r]=e[r]||(0,Ux.clone)(u[r]):e[r]=e[r]||u[r]});var l=r.get(n+"Mapper");if(l){var c=l(e);c.stateStyles&&(s=c.stateStyles,delete c.stateStyles),(0,Ux.each)(c,function(t,r){(0,Ux.isObject)(t)&&!(0,Ux.isArray)(t)?e[r]=(0,Ux.deepMix)({},e[r],t):e[r]=c[r]||e[r]})}if(r.emit("beforeadditem",{type:t,model:e}),"edge"===t||"vedge"===t){var f=void 0,h=void 0;if(f=e.source,h=e.target,f&&(0,Ux.isString)(f)&&(f=r.findById(f)),h&&(0,Ux.isString)(h)&&(h=r.findById(h)),!f||!h)return void console.warn("The source or target node of edge ".concat(e.id," does not exist!"));f.getType&&"combo"===f.getType()&&(e.isComboEdge=!0),h.getType&&"combo"===h.getType()&&(e.isComboEdge=!0),a=new ZS({model:e,source:f,target:h,styles:s,linkCenter:r.get("linkCenter"),group:i.addGroup()})}else if("node"===t)a=new $S({model:e,styles:s,group:i.addGroup()});else if("combo"===t){var p=e.children,d=xS(p,r),y=void 0,g=void 0;if(isNaN(d.x)?isNaN(e.x)&&(y=100*Math.random()):y=d.x,isNaN(d.y)?isNaN(e.y)&&(g=100*Math.random()):g=d.y,isNaN(e.x)||isNaN(e.y))e.x=y,e.y=g;else{var v=e.x-y,m=e.y-g;this.updateComboSucceeds(e.id,v,m,p)}var b=i.addGroup();b.setZIndex(e.depth),a=new tE({model:e,styles:s,animate:r.get("animate"),bbox:e.collapsed?xS([],r):d,group:b}),e.collapsed||"circle"!==a.getKeyShape().get("type")||(d.width=Math.hypot(d.height,d.width),d.height=d.width,a.set("bbox",d),a.refresh());var A=a.getModel();(p||[]).forEach(function(t){var e=r.findById(t.id);a.addChild(e),t.depth=A.depth+2})}if(a)return a.setOptimize(r.getNodes().length>r.get("optimizeThreshold")),r.get("".concat(t,"s")).push(a),r.get("itemMap")[a.get("id")]=a,r.emit("afteradditem",{item:a,model:e}),a},t.prototype.updateItem=function(t,e){var r,n,i=this,o=this.graph;if((0,Ux.isString)(t)&&(t=o.findById(t)),t&&!t.destroyed){var a="";t.getType&&(a=t.getType());var s=o.get(a+"Mapper"),u=t.getModel(),l=u.x,c=u.y,f=t.getUpdateType(e);if(s){var h=s((0,Ux.deepMix)({},u,e)),p=(0,Ux.deepMix)({},u,h,e);h.stateStyles&&(t.set("styles",p.stateStyles),delete p.stateStyles),(0,Ux.each)(p,function(t,r){e[r]=t})}else(0,Ux.each)(e,function(t,r){u[r]&&(0,Ux.isObject)(t)&&!(0,Ux.isArray)(t)&&(e[r]=(0,Gx.__assign)((0,Gx.__assign)({},u[r]),e[r]))});if(o.emit("beforeupdateitem",{item:t,cfg:e}),"edge"===a){if(e.source){var d=e.source;(0,Ux.isString)(d)&&(d=o.findById(d)),t.setSource(d)}if(e.target){var y=e.target;(0,Ux.isString)(y)&&(y=o.findById(y)),t.setTarget(y)}t.update(e)}else if("node"===a){t.update(e,f);var g=t.getEdges();"move"===f?(0,Ux.each)(g,function(t){i.edgeToBeUpdateMap[t.getID()]={edge:t,updateType:f},i.throttleRefresh()}):(null===f||void 0===f?void 0:f.includes("bbox"))&&(0,Ux.each)(g,function(t){t.refresh(f)})}else if("combo"===a){if(t.update(e,f),!isNaN(e.x)||!isNaN(e.y)){var v=e.x-l||0,m=e.y-c||0;this.updateComboSucceeds(u.id,v,m)}var b=t.getEdges();if(((null===f||void 0===f?void 0:f.includes("bbox"))||"move"===f)&&"combo"===a){var A=t.get("shapeFactory"),x=u.type||"circle";(void 0===u.animate||void 0===e.animate?null===(n=null===(r=A[x])||void 0===r?void 0:r.options)||void 0===n?void 0:n.animate:u.animate||e.animate)?setTimeout(function(){if(t&&!t.destroyed){var e=t.getKeyShape();e&&!e.destroyed&&(0,Ux.each)(b,function(t){t&&!t.destroyed&&t.refresh()})}},201):(0,Ux.each)(b,function(t){t.refresh()})}}t.setOptimize(o.getNodes().length>o.get("optimizeThreshold")),o.emit("afterupdateitem",{item:t,cfg:e})}},t.prototype.updateCombo=function(t,e,r){var n,i,o=this,a=this.graph;if((0,Ux.isString)(t)&&(t=a.findById(t)),t&&!t.destroyed){var s=t.getModel(),u=xS(e,a,t),l=u.x,c=u.y;t.set("bbox",u);var f=l,h=c;r?(f=isNaN(s.x)?l:s.x,h=isNaN(s.y)?c:s.y):(f=isNaN(l)?s.x:l,h=isNaN(c)?s.y:c),t.update({x:f,y:h});var p=t.get("shapeFactory"),d=s.type||"circle";(void 0===s.animate?null===(i=null===(n=p[d])||void 0===n?void 0:n.options)||void 0===i?void 0:i.animate:s.animate)?setTimeout(function(){if(t&&!t.destroyed){var e=t.getKeyShape();e&&!e.destroyed&&(t.getShapeCfg(s),o.updateComboEdges(t))}},201):this.updateComboEdges(t)}},t.prototype.updateComboEdges=function(t){for(var e,r,n=t.getEdges()||[],i=0;i-1&&o.splice(a,1),"edge"===i){var s=r.get("v".concat(i,"s")),u=s.indexOf(t);u>-1&&s.splice(u,1)}var l=t.get("id");delete r.get("itemMap")[l];var c=r.get("comboTrees"),f=t.get("id");if("node"===i){var h=t.getModel().comboId;if(c&&h){var p=c,d=!1;c.forEach(function(t){d||dS(t,function(t){if(t.id===f&&p){var e=p.indexOf(t);return p.splice(e,1),d=!0,!1}return p=t.children,!0})})}for(var y=(b=t.getEdges()).length-1;y>=0;y--)r.removeItem(b[y],!1);h&&r.updateCombo(h)}else if("combo"===i){var g,v=t.getModel().parentId,m=!1;(c||[]).forEach(function(t){m||dS(t,function(t){return t.id!==f||(g=t,m=!0,!1)})}),g.removed=!0,g&&g.children&&g.children.forEach(function(t){e.removeItem(t.id)});var b;for(y=(b=t.getEdges()).length;y>=0;y--)r.removeItem(b[y],!1);v&&r.updateCombo(v)}t.destroy(),r.emit("afterremoveitem",{item:n,type:i})}},t.prototype.setItemState=function(t,e,r){var n=this.graph,i=e;(0,Ux.isString)(r)&&(i="".concat(e,":").concat(r)),t.hasState(i)===r&&r||(0,Ux.isString)(r)&&t.hasState(i)||(n.emit("beforeitemstatechange",{item:t,state:i,enabled:r}),t.setState(e,r),n.autoPaint(),n.emit("afteritemstatechange",{item:t,state:i,enabled:r}))},t.prototype.priorityState=function(t,e){var r=this.graph,n=t;(0,Ux.isString)(t)&&(n=r.findById(t)),this.setItemState(n,e,!1),this.setItemState(n,e,!0)},t.prototype.clearItemStates=function(t,e){var r=this.graph;(0,Ux.isString)(t)&&(t=r.findById(t)),r.emit("beforeitemstatesclear",{item:t,states:e}),t.clearStates(e),r.emit("afteritemstatesclear",{item:t,states:e})},t.prototype.refreshItem=function(t){var e=this.graph;(0,Ux.isString)(t)&&(t=e.findById(t)),e.emit("beforeitemrefresh",{item:t}),t.refresh(),e.emit("afteritemrefresh",{item:t})},t.prototype.addCombos=function(t,e){var r=this,n=this.graph;(t||[]).forEach(function(t){yS(t,function(t){var n;return e.forEach(function(e){e.id===t.id&&(e.children=t.children,e.depth=t.depth,n=e)}),n&&r.addItem("combo",n),!0})});var i=n.get("comboGroup");i&&i.sort()},t.prototype.changeItemVisibility=function(t,e){var r=this,n=this.graph;if((0,Ux.isString)(t)&&(t=n.findById(t)),t){if(n.emit("beforeitemvisibilitychange",{item:t,visible:e}),t.changeVisibility(e),t.getType&&"node"===t.getType()){var i=t.getEdges();(0,Ux.each)(i,function(t){(!e||t.get("source").isVisible()&&t.get("target").isVisible())&&r.changeItemVisibility(t,e)})}else if(t.getType&&"combo"===t.getType()){var o=n.get("comboTrees"),a=t.get("id"),s=[],u=!1;(o||[]).forEach(function(t){u||t.children&&0!==t.children.length&&dS(t,function(t){return t.id!==a||(s=t.children,u=!0,!1)})}),s&&(!e||e&&!t.getModel().collapsed)&&s.forEach(function(t){var i=n.findById(t.id);r.changeItemVisibility(i,e)});i=t.getEdges();(0,Ux.each)(i,function(t){(!e||t.get("source").isVisible()&&t.get("target").isVisible())&&r.changeItemVisibility(t,e)})}return n.emit("afteritemvisibilitychange",{item:t,visible:e}),t}console.warn("The item to be shown or hidden does not exist!")},t.prototype.destroy=function(){this.graph=null,this.destroyed=!0},t}(),rE=function(){function t(t){this.graph=t,this.destroyed=!1}return t.prototype.updateState=function(t,e,r){var n=this.graph.get("states"),i=e;(0,Ux.isString)(r)&&(i="".concat(e,":").concat(r)),n[i]||(n[i]=[]),r?n[i].push(t):n[i]=n[i].filter(function(e){return e!==t}),this.graph.set("states",n),this.graph.emit("graphstatechange",{states:n})},t.prototype.updateStates=function(t,e,r){var n=this.graph.get("states");((0,Ux.isString)(e)?[e]:e).forEach(function(e){var i=e;n[i]||(n[i]=[]),(0,Ux.isString)(r)&&(i="".concat(e,":").concat(r)),r?n[i].push(t):n[i]=n[i].filter(function(e){return e!==t})}),this.graph.set("states",n),this.graph.emit("graphstatechange",{states:e})},t.prototype.destroy=function(){this.graph=null,this.destroyed=!0},t}(),nE=r(3823),iE=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,function(t,r){if("\\"===t.charAt(0))return t.slice(1);var n=e[r];return 0===n&&(n="0"),n||""}):t},oE=function(t){var e=[];if(t.length<2)throw new Error("point length must largn than 2, now it's ".concat(t.length));for(var r=0,n=t;r0?s-1:o-1,l=g_.normalize([0,0],g_.add([0,0],a[u].v,g_.scale([0,0],a[s].v,-1)));a[s].p=g_.add([0,0],a[s].p,g_.scale([0,0],l,e))}return a.map(function(t){var e=t.p;return{x:e[0],y:e[1]}})}var yE=function(t,e){for(var r=[],n=0;n<5;n++){var i=Math.cos((18+72*n)/180*Math.PI)*t,o=Math.sin((18+72*n)/180*Math.PI)*t,a=Math.cos((54+72*n)/180*Math.PI)*e,s=Math.sin((54+72*n)/180*Math.PI)*e;0===n?r.push(["M",i,-o]):r.push(["L",i,-o]),r.push(["L",a,-s])}return r.push(["Z"]),r},gE=function(t,e,r){return(t.y-r.y)*(e.x-r.x)-(t.x-r.x)*(e.y-r.y)},vE=function(t){var e=t.map(function(t){return{x:t.getModel().x,y:t.getModel().y}});e.sort(function(t,e){return t.x===e.x?t.y-e.y:t.x-e.x});for(var r={},n=e.length-1;n>=0;n--){var i=e[n],o=i.x,a=i.y;r["".concat(o,"-").concat(a)]&&e.splice(n,1),r["".concat(o,"-").concat(a)]=!0}if(1===e.length)return e;var s=[];for(n=0;n=2&&gE(s[s.length-2],s[s.length-1],e[n])<=0;)s.pop();s.push(e[n])}var u=[];for(n=e.length-1;n>=0;n--){for(;u.length>=2&&gE(u[u.length-2],u[u.length-1],e[n])<=0;)u.pop();u.push(e[n])}return u.pop(),s.pop(),s.concat(u)},mE={maxRoutingIterations:100,maxMarchingIterations:100,pixelGroupSize:2,edgeR0:10,edgeR1:10,nodeR0:5,nodeR1:10,morphBuffer:5,threshold:.001,skip:16,nodeInfluenceFactor:1,edgeInfluenceFactor:1,negativeNodeInfluenceFactor:-.5};function bE(t,e,r){var n=!1,i=function(t,r){return e.cells[t+r*e.width]},o=function(t,e){var n=0;return i(t-1,e-1)>=r&&(n+=1),i(t,e-1)>r&&(n+=2),i(t-1,e)>r&&(n+=4),i(t,e)>r&&(n+=8),n},a=function(r,n){for(var i,a,s=r,u=n,l=0;l-1){if(t[0].x===s&&t[0].y===u)return!0}else t.push({x:s,y:u});var c=o(s,u);switch(c){case-1:return console.warn("Marched out of bounds"),!0;case 0:case 3:case 2:case 7:s++;break;case 12:case 14:case 4:s--;break;case 6:0===i&&(-1===a?s-=1:s+=1);break;case 1:case 13:case 5:u--;break;case 9:1===i&&(0===a?u-=1:u+=1);break;case 10:case 8:case 11:u++;break;default:return console.warn("Marching squares invalid state: ".concat(c)),!0}}};this.march=function(){for(var t=0;tr&&15!==o(t,s)&&(n=a(t,s));return n}}var AE=function(t,e,r){var n=null,i=Number.POSITIVE_INFINITY;return e.forEach(function(e){var o={x:t.getModel().x,y:t.getModel().y},a={x:e.getModel().x,y:e.getModel().y},s=Y_(o,a),u=new z_(o.x,o.y,a.x,a.y),l=r.reduce(function(t,e){return V_(e,u)>0?t+1:t},0);s*Math.pow(l+1,2)=0&&i=1;)h=EE(r,c/=1.5,f,s),p=u(h,o)||u(h,i),d=l(h,e);!h||p||s&&d||(o.push(new z_(t.x1,t.y1,h.x,h.y)),o.push(new z_(h.x,h.y,t.x2,t.y2)),a=!0)};h(!0),a||h(!1)}}a||i.push(t),s+=1};!a&&o.length;)c()}for(;o.length;)i.push(o.pop());return i};var _E=function(t,e,r){var n=Object.assign(mE,r),i=Q_(t.map(function(t){return{x:t.getModel().x,y:t.getModel().y}})),o=[],a=[];(t=t.sort(function(t,e){return Y_({x:t.getModel().x,y:t.getModel().y},i)-Y_({x:e.getModel().x,y:e.getModel().y},i)})).forEach(function(t){(function(t,e,r,n,i){var o=AE(t,r,e);if(null===o)return[];var a=new z_(t.getModel().x,t.getModel().y,o.getModel().x,o.getModel().y);return function(t){for(var r=[];t.length>0;){var n=t.pop();if(0===t.length){r.push(n);break}var i=t.pop(),o=new z_(n.x1,n.y1,i.x2,i.y2);xE(e,o)?(r.push(n),t.push(i)):t.push(o)}return r}(wE(a,e,n,i))})(t,e,o,n.maxRoutingIterations,n.morphBuffer).forEach(function(t){a.push(t)}),o.push(t)});for(var s,u,l,c,f,h=function(t,e,r){var n={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,width:0,height:0,x:0,y:0},i=[];t.forEach(function(t){i.push(t.getBBox())}),e.forEach(function(t){i.push(t.getBBox())});for(var o=0,a=i;on.maxX?s.maxX:n.maxX)+r,n.maxY=(s.maxY>n.maxY?s.maxY:n.maxY)+r}return n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.x=n.minX,n.y=n.minY,n}(t,a,n.nodeR0),p=(s=h.width,u=h.height,l=n.pixelGroupSize,c=Math.ceil(s/l),f=Math.ceil(u/l),{cells:new Float32Array(Math.max(0,c*f)).fill(0),width:c,height:f}),d=[],y=[],g=0;g1)for(m=Math.floor(v.length/n.skip);m<3&&n.skip>1;)n.skip-=1,m=Math.floor(v.length/n.skip);for(var b=0,A=0;A0))break;n.nonMemberInfluenceFactor*=.8}}return y};function SE(t,e,r,n,i,o){function a(t,e){var r=Math.floor((t-e)/o.pixelGroupSize);return r<0?0:r}function s(t,e){return t*o.pixelGroupSize+e}var u=(o.nodeR0-o.nodeR1)*(o.nodeR0-o.nodeR1),l=(o.edgeR0-o.edgeR1)*(o.edgeR0-o.edgeR1),c=function(t,e){return[Math.min(a(t.minX,e+n.minX),i.width),Math.min(a(t.minY,e+n.minY),i.height),Math.min(a(t.maxX,-e+n.minX),i.width),Math.min(a(t.maxY,-e+n.minY),i.height)]},f=function(t,e){for(var r=t.getBBox(),a=c(r,o.nodeR1),u=a[0],l=a[1],f=a[2],h=a[3],p=l;pu.y?n?l.topLeft:l.bottomRight:n?l.topRight:l.bottomLeft:a.ys.x?n?l.topLeft:l.bottomRight:n?l.bottomLeft:l.topRight:o.x0?this.cfg.padding+t:10+t,this.cfg.bubbleCfg={nodeR0:this.padding-t,nodeR1:this.padding-t,morphBuffer:this.padding-t}},t.prototype.setType=function(){this.type=this.cfg.type,this.members.length<3&&(this.type="round-convex"),"round-convex"!==this.type&&"smooth-convex"!==this.type&&"bubble"!==this.type&&(console.warn("The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default."),this.type="round-convex")},t.prototype.calcPath=function(t,e){var r,n,i;switch(this.type){case"round-convex":i=pE((r=vE(t)).map(function(t){return[t.x,t.y]}),this.padding),n=(0,nE.EA)(i);break;case"smooth-convex":2===(r=vE(t)).length?(i=pE(r.map(function(t){return[t.x,t.y]}),this.padding),n=(0,nE.EA)(i)):r.length>2&&(i=dE(r.map(function(t){return[t.x,t.y]}),this.padding),n=lE(i));break;case"bubble":n=(r=_E(t,e,this.cfg.bubbleCfg)).length>=2&&lE(r)}return n},t.prototype.render=function(){this.group.addShape("path",{attrs:(0,Gx.__assign)({path:this.path},this.cfg.style),id:this.id,name:this.cfg.id,capture:!1}),this.group.toBack()},t.prototype.addMember=function(t){if(t){(0,Ux.isString)(t)&&(t=this.graph.findById(t)),this.members.push(t);var e=this.nonMembers.indexOf(t);return e>-1&&this.nonMembers.splice(e,1),this.updateData(this.members,this.nonMembers),!0}},t.prototype.addNonMember=function(t){if(t){(0,Ux.isString)(t)&&(t=this.graph.findById(t)),this.nonMembers.push(t);var e=this.members.indexOf(t);return e>-1&&this.members.splice(e,1),this.updateData(this.members,this.nonMembers),!0}},t.prototype.removeMember=function(t){if(t){(0,Ux.isString)(t)&&(t=this.graph.findById(t));var e=this.members.indexOf(t);return e>-1&&(this.members.splice(e,1),this.updateData(this.members,this.nonMembers),!0)}},t.prototype.removeNonMember=function(t){if(t){(0,Ux.isString)(t)&&(t=this.graph.findById(t));var e=this.nonMembers.indexOf(t);return e>-1&&(this.nonMembers.splice(e,1),this.updateData(this.members,this.nonMembers),!0)}},t.prototype.updateData=function(t,e){var r=this;this.group.findById(this.id).remove(),t&&(this.members=t.map(function(t){return(0,Ux.isString)(t)?r.graph.findById(t):t})),e&&(this.nonMembers=e.map(function(t){return(0,Ux.isString)(t)?r.graph.findById(t):t})),this.path=this.calcPath(this.members,this.nonMembers),this.render()},t.prototype.updateStyle=function(t){this.group.findById(this.id).attr((0,Gx.__assign)({},t))},t.prototype.updateCfg=function(t){var e=this;this.cfg=(0,Ux.deepMix)(this.cfg,t),this.id=this.cfg.id,this.group=this.cfg.group,t.members&&(this.members=this.cfg.members.map(function(t){return(0,Ux.isString)(t)?e.graph.findById(t):t})),t.nonMembers&&(this.nonMembers=this.cfg.nonMembers.map(function(t){return(0,Ux.isString)(t)?e.graph.findById(t):t})),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()},t.prototype.contain=function(t){var e,r,n=this,i=(e=(0,Ux.isString)(t)?this.graph.findById(t):t).getKeyShape();if("path"===e.get("type"))r=uE(i.attr("path"));else{var o=i.getCanvasBBox();r=[[o.minX,o.minY],[o.maxX,o.minY],[o.maxX,o.maxY],[o.minX,o.maxY]]}return r=r.map(function(t){var e=n.graph.getPointByCanvas(t[0],t[1]);return[e.x,e.y]}),F_(r,uE(this.path))},t.prototype.destroy=function(){this.group.remove(),this.cfg=null},t}(),kE=Wx.pd,IE=function(t){function e(e){var r=t.call(this)||this;return r.sortCombos=(0,Ux.debounce)(function(){var t=r.get("comboSorted");if(r&&!r.destroyed&&!t){r.set("comboSorted",!0);var e=[],n={};(r.get("comboTrees")||[]).forEach(function(t){dS(t,function(t){return e[t.depth]?e[t.depth].push(t.id):e[t.depth]=[t.id],n[t.id]=t.depth,!0})}),(r.getEdges().concat(r.get("vedges"))||[]).forEach(function(t){var r=t.getModel(),i=n[r.source]||0,o=n[r.target]||0,a=Math.max(i,o);e[a]?e[a].push(r.id):e[a]=[r.id]}),e.forEach(function(t){if(t&&t.length)for(var e=t.length-1;e>=0;e--){var n=r.findById(t[e]);n&&n.toFront()}})}},500,!1),r.cfg=(0,Ux.deepMix)(r.getDefaultCfg(),e),r.init(),r.animating=!1,r.destroyed=!1,r.cfg.enabledStack&&(r.undoStack=new f_(r.cfg.maxStep),r.redoStack=new f_(r.cfg.maxStep)),r}return(0,Gx.__extends)(e,t),e.prototype.init=function(){this.initCanvas();var t=new DS(this),e=new CS(this),r=new eE(this),n=new rE(this);this.set({viewController:t,modeController:e,itemController:r,stateController:n}),this.initLayoutController(),this.initEventController(),this.initGroups(),this.initPlugins()},e.prototype.initGroups=function(){var t=this.get("canvas");if(t){var e=(t.get("el")||{}).id,r=void 0===e?"g6":e,n=t.addGroup({id:"".concat(r,"-root"),className:iS.rootContainerClassName});if(this.get("groupByTypes")){var i=n.addGroup({id:"".concat(r,"-edge"),className:iS.edgeContainerClassName}),o=n.addGroup({id:"".concat(r,"-node"),className:iS.nodeContainerClassName}),a=n.addGroup({id:"".concat(r,"-combo"),className:iS.comboContainerClassName});a.toBack(),this.set({nodeGroup:o,edgeGroup:i,comboGroup:a})}var s=n.addGroup({id:"".concat(r,"-delegate"),className:iS.delegateContainerClassName});this.set({delegateGroup:s}),this.set("group",n)}},e.prototype.getDefaultCfg=function(){return{container:void 0,width:void 0,height:void 0,renderer:"canvas",modes:{},plugins:[],data:{},fitViewPadding:10,minZoom:.02,maxZoom:10,event:!0,groupByTypes:!0,directed:!1,autoPaint:!0,nodes:[],edges:[],combos:[],vedges:[],itemMap:{},linkCenter:!1,defaultNode:{},defaultEdge:{},nodeStateStyles:{},edgeStateStyles:{},states:{},animate:!1,animateCfg:{onFrame:void 0,duration:500,easing:"easeLinear"},callback:void 0,enabledStack:!1,maxStep:10,tooltips:[],optimizeThreshold:1e3}},e.prototype.set=function(t,e){return(0,Ux.isPlainObject)(t)?this.cfg=(0,Gx.__assign)((0,Gx.__assign)({},this.cfg),t):this.cfg[t]=e,"enabledStack"!==t||!e||this.undoStack||this.redoStack||(this.undoStack=new f_(this.cfg.maxStep),this.redoStack=new f_(this.cfg.maxStep)),this},e.prototype.get=function(t){var e;return null===(e=this.cfg)||void 0===e?void 0:e[t]},e.prototype.getGroup=function(){return this.get("group")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.getMinZoom=function(){return this.get("minZoom")},e.prototype.setMinZoom=function(t){return this.set("minZoom",t)},e.prototype.getMaxZoom=function(){return this.get("maxZoom")},e.prototype.setMaxZoom=function(t){return this.set("maxZoom",t)},e.prototype.getWidth=function(){return this.get("width")},e.prototype.getHeight=function(){return this.get("height")},e.prototype.clearItemStates=function(t,e){(0,Ux.isString)(t)&&(t=this.findById(t));var r=this.get("itemController");e||(e=t.get("states")),r.clearItemStates(t,e),this.get("stateController").updateStates(t,e,!1)},e.prototype.node=function(t){"function"==typeof t&&this.set("nodeMapper",t)},e.prototype.edge=function(t){"function"==typeof t&&this.set("edgeMapper",t)},e.prototype.combo=function(t){"function"==typeof t&&this.set("comboMapper",t)},e.prototype.findById=function(t){return this.get("itemMap")[t]},e.prototype.find=function(t,e){var r,n=this.get("".concat(t,"s"));return(0,Ux.each)(n,function(t,n){if(e(t,n))return r=t}),r},e.prototype.findAll=function(t,e){var r=[];return(0,Ux.each)(this.get("".concat(t,"s")),function(t,n){e(t,n)&&r.push(t)}),r},e.prototype.findAllByState=function(t,e,r){return r?this.findAll(t,function(t){return t.hasState(e)&&r(t)}):this.findAll(t,function(t){return t.hasState(e)})},e.prototype.translate=function(t,e,r,n){var i=this,o=this.get("group"),a=(0,Ux.clone)(o.getMatrix());if(a||(a=[1,0,0,0,1,0,0,0,1]),r){var s=SS({animateCfg:n,callback:function(){return i.emit("viewportchange",{action:"translate",matrix:o.getMatrix()})}});P_(o,{x:o.getCanvasBBox().x+t,y:o.getCanvasBBox().y+e},r,s||{duration:500,easing:"easeCubic"})}else a=kE(a,[["t",t,e]]),o.setMatrix(a),this.emit("viewportchange",{action:"translate",matrix:a}),this.autoPaint()},e.prototype.moveTo=function(t,e,r,n){var i=this.get("group");P_(i,{x:t,y:e},r,n||{duration:500,easing:"easeCubic"}),this.emit("viewportchange",{action:"move",matrix:i.getMatrix()})},e.prototype.fitView=function(t,e,r,n){t&&this.set("fitViewPadding",t);var i=this.get("viewController");e?i.fitViewByRules(e,r,n):i.fitView(r,n),this.autoPaint()},e.prototype.fitCenter=function(t,e){this.get("viewController").fitCenter(t,e),this.autoPaint()},e.prototype.addBehaviors=function(t,e){return this.get("modeController").manipulateBehaviors(t,e,!0),this},e.prototype.removeBehaviors=function(t,e){return this.get("modeController").manipulateBehaviors(t,e,!1),this},e.prototype.updateBehavior=function(t,e,r){return this.get("modeController").updateBehavior(t,e,r),this},e.prototype.zoom=function(t,e,r,n){var i=this,o=this.get("group"),a=(0,Ux.clone)(o.getMatrix())||[1,0,0,0,1,0,0,0,1],s=this.get("minZoom"),u=this.get("maxZoom"),l=this.getZoom()||1,c=l*t,f=t,h=!1;if(s&&cu&&(f=u/l,h=!0),a=kE(a,e?[["t",-e.x,-e.y],["s",f,f],["t",e.x,e.y]]:[["s",f,f]]),r){var p=(0,Ux.clone)(o.getMatrix());p||(p=[1,0,0,0,1,0,0,0,1]);var d=p[0],y=d*f,g=SS({animateCfg:n,callback:function(){return i.emit("viewportchange",{action:"zoom",matrix:o.getMatrix()})}});o.animate(function(t){if(1===t)p=a;else{var r=J_(d,y,t)/p[0];p=kE(p,e?[["t",-e.x,-e.y],["s",r,r],["t",e.x,e.y]]:[["s",r,r]])}return{matrix:p}},g)}else o.setMatrix(a),this.emit("viewportchange",{action:"zoom",matrix:a}),this.autoPaint();return!h},e.prototype.zoomTo=function(t,e,r,n){var i=t/this.getZoom();return this.zoom(i,e,r,n)},e.prototype.focusItem=function(t,e,r){var n=this.get("viewController"),i=!1;e?i=!0:void 0===e&&(i=this.get("animate"));var o={};r?o=r:void 0===r&&(o=this.get("animateCfg")),n.focus(t,i,o),this.autoPaint()},e.prototype.focusItems=function(t,e,r,n){this.get("viewController").focusItems(t,e,r,n)},e.prototype.autoPaint=function(){this.get("autoPaint")&&this.paint()},e.prototype.paint=function(){this.emit("beforepaint"),this.get("canvas").draw(),this.emit("afterpaint")},e.prototype.getPointByClient=function(t,e){return this.get("viewController").getPointByClient(t,e)},e.prototype.getClientByPoint=function(t,e){return this.get("viewController").getClientByPoint(t,e)},e.prototype.getPointByCanvas=function(t,e){return this.get("viewController").getPointByCanvas(t,e)},e.prototype.getCanvasByPoint=function(t,e){return this.get("viewController").getCanvasByPoint(t,e)},e.prototype.getGraphCenterPoint=function(){var t=this.get("group").getCanvasBBox();return{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}},e.prototype.getViewPortCenterPoint=function(){return this.getPointByCanvas(this.get("width")/2,this.get("height")/2)},e.prototype.showItem=function(t,e){void 0===e&&(e=!0);var r=this.get("itemController").changeItemVisibility(t,!0);if(e&&this.get("enabledStack")){var n=r.getID(),i={},o={};switch(r.getType()){case"node":i.nodes=[{id:n,visible:!1}],o.nodes=[{id:n,visible:!0}];break;case"edge":i.nodes=[{id:n,visible:!1}],o.edges=[{id:n,visible:!0}];break;case"combo":i.nodes=[{id:n,visible:!1}],o.combos=[{id:n,visible:!0}]}this.pushStack("visible",{before:i,after:o})}},e.prototype.hideItem=function(t,e){void 0===e&&(e=!0);var r=this.get("itemController").changeItemVisibility(t,!1);if(e&&this.get("enabledStack")){var n=r.getID(),i={},o={};switch(r.getType()){case"node":i.nodes=[{id:n,visible:!0}],o.nodes=[{id:n,visible:!1}];break;case"edge":i.nodes=[{id:n,visible:!0}],o.edges=[{id:n,visible:!1}];break;case"combo":i.nodes=[{id:n,visible:!0}],o.combos=[{id:n,visible:!1}]}this.pushStack("visible",{before:i,after:o})}},e.prototype.refreshItem=function(t){this.get("itemController").refreshItem(t)},e.prototype.setAutoPaint=function(t){this.set("autoPaint",t),this.get("canvas").set("autoDraw",t)},e.prototype.remove=function(t,e){void 0===e&&(e=!0),this.removeItem(t,e)},e.prototype.removeItem=function(t,e){void 0===e&&(e=!0);var r=t;if((0,Ux.isString)(t)&&(r=this.findById(t)),!r&&(0,Ux.isString)(t))console.warn("The item ".concat(t," to be removed does not exist!"));else if(r){var n="";if(r.getType&&(n=r.getType()),e&&this.get("enabledStack")){var i=(0,Gx.__assign)((0,Gx.__assign)({},r.getModel()),{itemType:n}),o={};switch(n){case"node":o.nodes=[i],o.edges=[];for(var a=r.getEdges(),s=a.length-1;s>=0;s--)o.edges.push((0,Gx.__assign)((0,Gx.__assign)({},a[s].getModel()),{itemType:"edge"}));break;case"edge":o.edges=[i];break;case"combo":o.combos=[i]}this.pushStack("delete",{before:o,after:{}})}if("node"===n)r.getModel().comboId&&this.updateComboTree(r,void 0,!1);if(this.get("itemController").removeItem(r),"combo"===n){var u=AS(this.get("comboTrees"));this.set("comboTrees",u)}}},e.prototype.innerAddItem=function(t,e,r){if(!function(t,e){if("node"===t||"combo"===t){if(e.id&&!(0,Ux.isString)(e.id))return console.warn("G6 Warning Tips: missing 'id' property, or the 'id' %c".concat(e.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1}else if(!("edge"!==t||e.source&&e.target))return console.warn("G6 Warning Tips: missing 'source' or 'target' for the edge."),!1;return!0}(t,e))return!1;if(!e.id||!this.findById(e.id)){var n,i=this.get("comboTrees")||[];if("combo"===t){var o=this.get("itemMap"),a=!1;if(i.forEach(function(i){a||yS(i,function(i){if(e.parentId===i.id){a=!0;var s=(0,Gx.__assign)({id:e.id,depth:i.depth+2},e);i.children?i.children.push(s):i.children=[s],e.depth=s.depth,n=r.addItem(t,e)}var u=o[i.id];return a&&u&&u.getType&&"combo"===u.getType()&&r.updateCombo(u,i.children),!0})}),!a){var s=(0,Gx.__assign)({id:e.id,depth:0},e);e.depth=s.depth,i.push(s),n=r.addItem(t,e)}this.set("comboTrees",i),e.collapsed&&(this.collapseCombo(n,!1),this.updateCombo(n))}else if("node"===t&&(0,Ux.isString)(e.comboId)&&i){var u;(u=this.findById(e.comboId))&&u.getType&&"combo"!==u.getType()&&console.warn("'".concat(e.comboId,"' is not a id of a combo in the graph, the node will be added without combo.")),n=r.addItem(t,e);var l=this.get("itemMap"),c=!1,f=!1;i.forEach(function(t){f||c||yS(t,function(t){if(t.id===e.id)return f=!0,!1;if(e.comboId===t.id&&!f){c=!0;var n=(0,Ux.clone)(e);n.itemType="node",t.children?t.children.push(n):t.children=[n],n.depth=t.depth+1}return c&&l[t.id].getType&&"combo"===l[t.id].getType()&&r.updateCombo(l[t.id],t.children),!0})})}else n=r.addItem(t,e);if("node"===t&&e.comboId||"combo"===t&&e.parentId)(u=this.findById(e.comboId||e.parentId))&&u.getType&&"combo"===u.getType()&&u.addChild(n);return n}console.warn("This item exists already. Be sure the id %c".concat(e.id,"%c is unique."),"font-size: 20px; color: red;","")},e.prototype.addItem=function(t,e,r,n){void 0===r&&(r=!0),void 0===n&&(n=!0);var i=this.get("comboSorted");this.set("comboSorted",i&&!n);var o=this.get("itemController"),a=this.innerAddItem(t,e,o);if(!1===a||!0===a)return a;var s=this.get("combos");if(s&&s.length>0&&this.sortCombos(),this.autoPaint(),r&&this.get("enabledStack")){var u=(0,Gx.__assign)((0,Gx.__assign)({},a.getModel()),{itemType:t}),l={};switch(t){case"node":l.nodes=[u];break;case"edge":l.edges=[u];break;case"combo":l.combos=[u]}this.pushStack("add",{before:{},after:l})}return a},e.prototype.addItems=function(t,e,r){void 0===t&&(t=[]),void 0===e&&(e=!0),void 0===r&&(r=!0);var n=this.get("comboSorted");this.set("comboSorted",n&&!r);for(var i=this.get("itemController"),o=[],a=0;a0&&this.sortCombos()}if(this.autoPaint(),e&&this.get("enabledStack")){var l={nodes:[],edges:[],combos:[]};for(a=0;a=0;p--)h[p].destroyed&&h.splice(p,1);c&&(i.addCombos(c),this.get("groupByTypes")||this.sortCombos()),this.diffItems("edge",l,o.edges),(0,Ux.each)(u,function(t,e){(!t.getType||"node"!==t.getType()&&"combo"!==t.getType())&&l.edges.indexOf(t)<0&&(delete u[e],i.remove(t,!1))}),(this.get("comboTrees")||[]).forEach(function(t){yS(t,function(t){return"combo"===n.findById(t.id).getType()&&t.collapsed&&n.collapseCombo(t.id,!1),!0})}),this.set({nodes:l.nodes,edges:l.edges});var d=(this.get("layout")||{}).relayoutAtChangeData,y=void 0===d||d,g=this.get("layoutController");return y&&g&&(g.changeData(function(){setTimeout(function(){var t;null===(t=i.getCombos())||void 0===t||t.forEach(function(t){t.set("animate",!0)})},0)}),i.get("animate")&&!g.getLayoutType()?(i.positionsAnimate(),null===(r=i.getCombos())||void 0===r||r.forEach(function(t){return t.set("animate",!0)})):i.autoPaint()),setTimeout(function(){a.set("localRefresh",s)},16),this.set("data",o),this.emit("afterchangedata"),this},e.prototype.addCombos=function(t){var e=this.get("comboTrees");this.get("itemController").addCombos(e,t)},e.prototype.createCombo=function(t,e,r){var n=this;void 0===r&&(r=!0);var i=this.get("itemController");this.set("comboSorted",!1);var o,a="";if(t){if((0,Ux.isString)(t))a=t,o={id:t};else{if(!(a=t.id))return void console.warn("Create combo failed. Please assign a unique string id for the adding combo.");o=t}var s=r&&this.get("enabledStack"),u={nodes:[],combos:[]};s&&e.forEach(function(t){var e=n.findById(t),r=e.getType();if("node"===r||"combo"===r){var i=e.getModel();u["".concat(r,"s")].push({id:t,parentId:"node"===r?i.comboId:i.parentId})}});var l=this.get("comboTrees"),c=new Set(e),f=new Map;l&&(l.forEach(function(t){yS(t,function(t,e,r){if(c.has(t.id)){if(e){var o=n.findById(e.id),a=n.findById(t.id);e.children.splice(r,1),o.removeChild(a),i.updateCombo(o,e.children)}"combo"===t.itemType&&f.set(t.id,t)}return!0})}),l=l.filter(function(t){return!c.has(t.id)}),this.set("comboTrees",l));var h={nodes:[],combos:[]},p=e.map(function(t){var e=n.findById(t),r=e.getModel(),i="";e.getType&&(i=e.getType());var o=f.get(t)||{id:e.getID(),itemType:i};return"combo"===i?(o.parentId=a,r.parentId=a):"node"===i&&(o.comboId=a,r.comboId=a),s&&h["".concat(i,"s")].push({id:r.id,parentId:a}),o});o.children=p,this.addItem("combo",o,!1),this.set("comboSorted",!1),l&&(l.forEach(function(t){dS(t,function(t){return t.id!==a||(t.itemType="combo",t.children=p,!1)})}),this.sortCombos()),s&&(h.combos.push(o),this.pushStack("createCombo",{before:u,after:h}));var d=this.findById(a);!d.getModel().parentId&&d.getChildren().combos.length&&this.updateComboTree(d,void 0,!1),setTimeout(function(){d.set("animate",!0)},0)}},e.prototype.uncombo=function(t,e){var r,n,i=this;void 0===e&&(e=!0);var o=t;if((0,Ux.isString)(t)&&(o=this.findById(t)),!o||o.getType&&"combo"!==o.getType())console.warn("The item is not a combo!");else{var a=o.getModel(),s=o.getModel().parentId,u=this.get("comboTrees");u||(u=[]);var l,c=this.get("itemMap"),f=o.get("id"),h=[],p=this.get("combos"),d=this.findById(s),y=e&&this.get("enabledStack"),g={};if(y&&((g=(0,Ux.clone)(a)).children=[]),u.forEach(function(t){l||yS(t,function(t){var e;if(t.id===f){l=t,o.getEdges().map(function(t){return t.getID()}).forEach(function(t){i.removeItem(t,!1)});var r=p.indexOf(o);p.splice(r,1),delete c[f];var n=(0,Ux.clone)(o.getModel());o.destroy(),i.emit("afterremoveitem",{item:n,type:"combo"})}return!s||!l||t.id!==s||(d.removeCombo(o),-1!==(r=(h=t.children).indexOf(l))&&h.splice(r,1),null===(e=l.children)||void 0===e||e.forEach(function(t){var e=i.findById(t.id),r=e.getModel();e.getType&&"combo"===e.getType()?(t.parentId=s,delete t.comboId,r.parentId=s,delete r.comboId):e.getType&&"node"===e.getType()&&(t.comboId=s,r.comboId=s),d.addChild(e),h.push(t)}),i.updateCombo(d),!1)})}),!s&&l){var v=u.indexOf(l);u.splice(v,1),null===(r=l.children)||void 0===r||r.forEach(function(t){t.parentId=void 0;var e=i.findById(t.id).getModel();delete e.parentId,delete e.comboId,"node"!==t.itemType&&u.push(t)})}if(y){var m={nodes:[],combos:[]},b={nodes:[],combos:[]};null===(n=l.children)||void 0===n||n.forEach(function(t){var e=i.findById(t.id).getType();"node"!==e&&"combo"!==e||(m["".concat(e,"s")].push({id:t.id,parentId:f}),b["".concat(e,"s")].push({id:t.id,parentId:s}))}),m.combos.push(g),this.pushStack("uncombo",{before:m,after:b})}}},e.prototype.updateCombos=function(t){var e=this;void 0===t&&(t=!1);var r=this.get("comboTrees"),n=this.get("itemController"),i=this.get("itemMap");(r||[]).forEach(function(r){yS(r,function(r){var o;if(!r)return!0;var a=i[r.id];if("combo"===(null===(o=null===a||void 0===a?void 0:a.getType)||void 0===o?void 0:o.call(a))){var s=(0,Gx.__spreadArray)([],a.getStates(),!0);(0,Ux.each)(s,function(t){return e.setItemState(a,t,!1)}),n.updateCombo(a,r.children,t),(0,Ux.each)(s,function(t){return e.setItemState(a,t,!0)})}return!0})}),this.sortCombos()},e.prototype.updateCombo=function(t){var e,r=this,n=t;if((0,Ux.isString)(t)&&(n=this.findById(t)),!n||n.getType&&"combo"!==n.getType())console.warn("The item to be updated is not a combo!");else{e=n.get("id");var i=this.get("comboTrees"),o=this.get("itemController"),a=this.get("itemMap");(i||[]).forEach(function(t){yS(t,function(t){if(!t)return!0;var n=a[t.id];if(e===t.id&&n&&n.getType&&"combo"===n.getType()){var i=(0,Gx.__spreadArray)([],n.getStates(),!0);(0,Ux.each)(i,function(t){n.getStateStyle(t)&&r.setItemState(n,t,!1)}),o.updateCombo(n,t.children),(0,Ux.each)(i,function(t){n.getStateStyle(t)&&r.setItemState(n,t,!0)}),e&&(e=t.parentId)}return!0})})}},e.prototype.updateComboTree=function(t,e,r){void 0===r&&(r=!0);var n;this.set("comboSorted",!1);var i,o=(n=(0,Ux.isString)(t)?this.findById(t):t).getModel(),a=o.comboId||o.parentId,s="";if(n.getType&&(s=n.getType()),e&&"combo"===s){var u,l=!0;if((this.get("comboTrees")||[]).forEach(function(t){u||dS(t,function(t){if(!u)return t.id===n.getID()&&(u=t),!0})}),dS(u,function(t){return t.id!==e||(l=!1,!1)}),!l)return void console.warn("Failed to update the combo tree! The parentId points to a descendant of the combo!")}if(r&&this.get("enabledStack")){var c={},f={};"combo"===s?(c.combos=[{id:o.id,parentId:o.parentId}],f.combos=[{id:o.id,parentId:e}]):"node"===s&&(c.nodes=[{id:o.id,parentId:o.comboId}],f.nodes=[{id:o.id,parentId:e}]),this.pushStack("updateComboTree",{before:c,after:f})}if(o.parentId||o.comboId){var h=this.findById(o.parentId||o.comboId);h&&h.removeChild(n)}("combo"===s?o.parentId=e:"node"===s&&(o.comboId=e),e)&&((i=this.findById(e))&&i.addChild(n));a&&((i=this.findById(a))&&i.removeChild(n));var p=AS(this.get("comboTrees"),o.id,e);this.set("comboTrees",p),this.updateCombos()},e.prototype.save=function(){var t=[],e=[],r=[];return(0,Ux.each)(this.get("nodes"),function(e){t.push(e.getModel())}),(0,Ux.each)(this.get("edges"),function(t){e.push(t.getModel())}),(0,Ux.each)(this.get("combos"),function(t){r.push(t.getModel())}),{nodes:t,edges:e,combos:r}},e.prototype.changeSize=function(t,e){return this.get("viewController").changeSize(t,e),this},e.prototype.refresh=function(){if(this.emit("beforegraphrefresh"),this.get("animate"))this.positionsAnimate();else{var t=this.get("nodes"),e=this.get("edges"),r=this.get("edges");(0,Ux.each)(t,function(t){t.refresh()}),(0,Ux.each)(e,function(t){t.refresh()}),(0,Ux.each)(r,function(t){t.refresh()})}this.emit("aftergraphrefresh"),this.autoPaint()},e.prototype.getNodes=function(){return this.get("nodes")},e.prototype.getEdges=function(){return this.get("edges")},e.prototype.getCombos=function(){return this.get("combos")},e.prototype.getComboChildren=function(t){if((0,Ux.isString)(t)&&(t=this.findById(t)),t&&(!t.getType||"combo"===t.getType()))return t.getChildren();console.warn("The combo does not exist!")},e.prototype.positionsAnimate=function(t){var e=this;e.emit("beforeanimate");var r=e.get("animateCfg"),n=r.onFrame,i=t?e.getNodes().concat(e.getCombos()):e.getNodes(),o=i.map(function(t){var e=t.getModel();return{id:e.id,x:e.x,y:e.y}});e.stopAnimate();var a=e.get("canvas");e.animating=!0,setTimeout(function(){a.animate(function(r){(0,Ux.each)(o,function(t){var i=e.findById(t.id);if(i&&!i.destroyed){var o=i.get("originAttrs"),a=i.get("model"),s=i.getContainer().getMatrix();if(void 0!==o&&null!==o||(s&&(o={x:s[6],y:s[7]}),i.set("originAttrs",o||0)),n){var u=n(i,r,t,o||{x:0,y:0});i.set("model",Object.assign(a,u))}else o?(a.x=o.x+(t.x-o.x)*r,a.y=o.y+(t.y-o.y)*r):(a.x=t.x,a.y=t.y)}}),e.refreshPositions(t)},{duration:r.duration,easing:r.easing,callback:function(){(0,Ux.each)(i,function(t){t.set("originAttrs",null)}),r.callback&&r.callback(),e.emit("afteranimate"),e.animating=!1}})},0)},e.prototype.refreshPositions=function(t){this.emit("beforegraphrefreshposition");var e,r=this.get("nodes"),n=this.get("edges"),i=this.get("vedges"),o=this.get("combos"),a={},s=function(t){(0,Ux.each)(t,function(t){e=t.getModel();var r=t.get("originAttrs");if(!r||e.x!==r.x||e.y!==r.y){var n=t.updatePosition({x:e.x,y:e.y});a[e.id]=n,e.comboId&&(a[e.comboId]=a[e.comboId]||n),e.parentId&&(a[e.parentId]=a[e.parentId]||n)}})};s(o),s(r),o&&0!==o.length&&(t?(s(o),this.updateCombos()):this.updateCombos()),(0,Ux.each)(n,function(t){var e=t.getSource().getModel(),r=t.getTarget();if(!(0,Ux.isPlainObject)(r)){var n=r.getModel();(a[e.id]||a[n.id]||t.getModel().isComboEdge)&&t.refresh()}}),(0,Ux.each)(i,function(t){t.refresh()}),this.emit("aftergraphrefreshposition"),this.autoPaint()},e.prototype.stopAnimate=function(){var t=this.get("canvas").cfg.timeline;t&&t.stopAllAnimations()},e.prototype.isAnimating=function(){return this.animating},e.prototype.getZoom=function(){var t=this.get("group").getMatrix();return t?t[0]:1},e.prototype.getCurrentMode=function(){return this.get("modeController").getMode()},e.prototype.setMode=function(t){return this.get("modeController").setMode(t),this},e.prototype.clear=function(t){var e;return void 0===t&&(t=!1),null===(e=this.get("canvas"))||void 0===e||e.clear(),this.initGroups(),this.set({itemMap:{},nodes:[],edges:[],vedges:[],groups:[],combos:[],comboTrees:[]}),t||this.emit("afterrender"),this},e.prototype.updateLayout=function(t,e,r,n){var i=this;void 0===t&&(t={}),void 0===n&&(n=!0);var o=this.get("layoutController");if((0,Ux.isString)(t)&&(t={type:t}),e){var a=r;a||(a="begin"===e?{x:0,y:0}:{x:this.getWidth()/2,y:this.getHeight()/2}),a=this.getPointByCanvas(a.x,a.y);var s=["force","gForce","fruchterman","force2"];s.includes(t.type)||!t.type&&s.includes(null===o||void 0===o?void 0:o.layoutType)?t.center=[a.x,a.y]:this.once("afterlayout",function(t){var r=i.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];a.x=a.x*r[0]+r[6],a.y=a.y*r[0]+r[7];var n=i.getGroup().getCanvasBBox(),o=n.minX,s=n.maxX,u=n.minY,l={x:(o+s)/2,y:(u+n.maxY)/2};"begin"===e&&(l.x=o,l.y=u),i.translate(a.x-l.x,a.y-l.y)})}var u=(0,Gx.__assign)({},this.get("layout")),l={};Object.assign(l,u,t),t.pipes&&!t.type?delete l.type:!t.pipes&&l.type&&delete l.pipes,this.set("layout",l),o&&(o.isLayoutTypeSame(l)&&l.gpuEnabled===u.gpuEnabled?o.updateLayoutCfg(l):o.changeLayout(l),n&&this.get("enabledStack")&&this.pushStack("layout",{before:u,after:l}))},e.prototype.destroyLayout=function(){var t=this.get("layoutController");null===t||void 0===t||t.destroyLayout()},e.prototype.layout=function(){var t,e=this.get("layoutController"),r=this.get("layout");r&&e&&(r.workerEnabled?e.layout():(null===(t=e.layoutMethods)||void 0===t?void 0:t.length)?e.relayout(!0):e.layout())},e.prototype.collapseCombo=function(t,e){var r=this;if(void 0===e&&(e=!0),!this.destroyed)if((0,Ux.isString)(t)&&(t=this.findById(t)),t){this.emit("beforecollapseexpandcombo",{action:"collapse",item:t});var n=t.getModel();this.get("itemController").collapseCombo(t,e),n.collapsed=!0;var i=this.getEdges().concat(this.get("vedges")),o=[],a=!1;(this.get("comboTrees")||[]).forEach(function(t){a||dS(t,function(t){if(a&&t.depth<=n.depth)return!1;if(n.id===t.id&&(a=!0),a){var e=r.findById(t.id);e&&e.getType&&"combo"===e.getType()&&(o=(o=o.concat(e.getNodes())).concat(e.getCombos()))}return!0})});var s={};i.forEach(function(t){var e=t.getModel(),i=e.isVEdge,a=e.size,u=void 0===a?1:a;if(!t.isVisible()||i){var l,c=t.getSource(),f=t.getTarget(),h=null;if(c.getModel().id===n.id||o.includes(c)&&!o.includes(f)?(h=f,l=!1):(f.getModel().id===n.id||!o.includes(c)&&o.includes(f))&&(h=c,l=!0),h){if(i)return void r.removeItem(t,!1);for(var p=h.getModel();!h.isVisible();){var d=p.parentId,y=p.comboId,g=d||y;if(!(h=r.findById(g))||!g)return;p=h.getModel()}var v=p.id,m=l?{source:v,target:n.id,size:u,isVEdge:!0}:{source:n.id,target:v,size:u,isVEdge:!0},b="".concat(m.source,"-").concat(m.target);if(s[b])return void(s[b].size+=u);s[b]=m}}}),this.addItems(Object.values(s).map(function(t){return{type:"vedge",model:t}}),!1),this.emit("aftercollapseexpandcombo",{action:"collapse",item:t})}else console.warn("The combo to be collapsed does not exist!")},e.prototype.expandCombo=function(t,e){var r=this;if(void 0===e&&(e=!0),(0,Ux.isString)(t)&&(t=this.findById(t)),!t||t.getType&&"combo"!==t.getType())console.warn("The combo to be collapsed does not exist!");else{this.emit("beforecollapseexpandcombo",{action:"expand",item:t});var n=t.getModel();this.get("itemController").expandCombo(t,e),n.collapsed=!1;var i=this.getEdges().concat(this.get("vedges")),o=[],a=!1;(this.get("comboTrees")||[]).forEach(function(t){a||dS(t,function(t){if(a&&t.depth<=n.depth)return!1;if(n.id===t.id&&(a=!0),a){var e=r.findById(t.id);e&&e.getType&&"combo"===e.getType()&&(o=(o=o.concat(e.getNodes())).concat(e.getCombos()))}return!0})});var s={};i.forEach(function(t){if(!t.isVisible()||t.getModel().isVEdge){var e,i=t.getSource(),a=t.getTarget(),u=i.get("id"),l=a.get("id"),c=null;if(u===n.id||o.includes(i)&&!o.includes(a)?(c=a,e=!1):l===n.id||!o.includes(i)&&o.includes(a)?(c=i,e=!0):o.includes(i)&&o.includes(a)&&i.isVisible()&&a.isVisible()&&t.show(),c){var f=t.getModel(),h=f.isVEdge,p=f.size,d=void 0===p?1:p;if(h)return void r.removeItem(t,!1);for(var y=c.getModel();!c.isVisible();){var g=y.parentId,v=y.comboId,m=g||v;if(!(c=r.findById(m))||!m)return;y=c.getModel()}for(var b=y.id,A=e?a:i,x=A.getModel();!A.isVisible();){var w=x.parentId,_=x.comboId,S=w||_;if(!(A=r.findById(S))||!S)return;if(x.comboId===n.id||x.parentId===n.id)break;x=A.getModel()}var E=x.id;if(b){var C=e?{source:b,target:E,isVEdge:!0,size:d}:{source:E,target:b,isVEdge:!0,size:d},k="".concat(C.source,"-").concat(C.target);if(s[k])return void(s[k].size+=d);s[k]=C}}}}),this.addItems(Object.values(s).map(function(t){return{type:"vedge",model:t}}),!1),this.emit("aftercollapseexpandcombo",{action:"expand",item:t})}},e.prototype.collapseExpandCombo=function(t,e){if(void 0===e&&(e=!0),(0,Ux.isString)(t)&&(t=this.findById(t)),t&&(!t.getType||"combo"===t.getType())){for(var r=t.getModel(),n=this.findById(r.parentId);n;){var i=n.getModel();if(i.collapsed)return console.warn("Fail to expand the combo since it's ancestor combo is collapsed."),void(n=void 0);n=this.findById(i.parentId)}r.collapsed?this.expandCombo(t,e):this.collapseCombo(t,e),this.updateCombo(t)}},e.prototype.getNeighbors=function(t,e){var r=t;return(0,Ux.isString)(t)&&(r=this.findById(t)),r.getNeighbors(e)},e.prototype.getNodeDegree=function(t,e,r){void 0===e&&(e=void 0),void 0===r&&(r=!1);var n=t;(0,Ux.isString)(t)&&(n=this.findById(t));var i=this.get("degrees");i&&!r||(i=sw(this.save()),this.set("degrees",i));var o=i[n.getID()],a=0;if(!o)return 0;switch(e){case"in":a=o.inDegree;break;case"out":a=o.outDegree;break;case"all":a=o;break;default:a=o.degree}return a},e.prototype.getUndoStack=function(){return this.undoStack},e.prototype.getRedoStack=function(){return this.redoStack},e.prototype.getStackData=function(){return this.get("enabledStack")?{undoStack:this.undoStack.toArray(),redoStack:this.redoStack.toArray()}:null},e.prototype.clearStack=function(){this.get("enabledStack")&&(this.undoStack.clear(),this.redoStack.clear(),this.emit("stackchange",{undoStack:this.undoStack,redoStack:this.redoStack}))},e.prototype.pushStack=function(t,e,r){if(void 0===t&&(t="update"),void 0===r&&(r="undo"),this.get("enabledStack")){var n=e?(0,Ux.clone)(e):{before:{},after:(0,Ux.clone)(this.save())};"redo"===r?this.redoStack.push({action:t,data:n}):this.undoStack.push({action:t,data:n}),this.emit("stackchange",{action:t,stackType:r,undoStack:this.undoStack,redoStack:this.redoStack})}else console.warn("请先启用 undo & redo 功能,在实例化 Graph 时候配置 enabledStack: true !")},e.prototype.getAdjMatrix=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=this.get("directed"));var r=this.get("adjMatrix");return r&&t||(r=qx(this.save(),e),this.set("adjMatrix",r)),r},e.prototype.getShortestPathMatrix=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=this.get("directed"));var r=this.get("adjMatrix"),n=this.get("shortestPathMatrix");return r&&t||(r=qx(this.save(),e),this.set("adjMatrix",r)),n&&t||(n=Aw(this.save(),e),this.set("shortestPathMatrix",n)),n},e.prototype.on=function(e,r,n){return t.prototype.on.call(this,e,r,n)},e.prototype.destroy=function(){var t,e,r,n,i;this.emit("beforedestroy"),this.clear(),this.clearStack(),null===(t=this.get("itemController"))||void 0===t||t.destroy(),null===(e=this.get("modeController"))||void 0===e||e.destroy(),null===(r=this.get("viewController"))||void 0===r||r.destroy(),null===(n=this.get("stateController"))||void 0===n||n.destroy(),null===(i=this.get("canvas"))||void 0===i||i.destroy(),this.cfg=null,this.destroyed=!0,this.redoStack=null,this.undoStack=null,this.emit("afterdestroy")},e.prototype.createHull=function(t){if(t.members&&!(t.members.length<1)){var e=this.get("hullGroup"),r=this.get("hullMap");if(r||(r={},this.set("hullMap",r)),e&&!e.get("destroyed")||((e=this.get("group").addGroup({id:"hullGroup"})).toBack(),this.set("hullGroup",e)),r[t.id])return console.warn("Existed hull id."),r[t.id];var n=e.addGroup({id:"".concat(t.id,"-container")}),i=new CE(this,(0,Gx.__assign)((0,Gx.__assign)({},t),{group:n}));return r[i.id]=i,i}console.warn("Create hull failed! The members is empty.")},e.prototype.getHulls=function(){return this.get("hullMap")},e.prototype.getHullById=function(t){return this.get("hullMap")[t]},e.prototype.removeHull=function(t){var e,r;r=(0,Ux.isString)(t)?this.getHullById(t):t,null===(e=this.get("hullMap"))||void 0===e||delete e[r.id],r.destroy()},e.prototype.removeHulls=function(){var t=this.getHulls();t&&Object.keys(t).length&&(Object.keys(t).forEach(function(e){t[e].destroy()}),this.set("hullMap",{}))},e}(Yx.A);function TE(t){"@babel/helpers - typeof";return(TE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var OE=Wx.pd,ME=["startArrow","endArrow"],PE={lineWidth:1,stroke:void 0,fill:void 0,lineAppendWidth:1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,x:0,y:0,r:10,width:20,height:20,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},LE={edge:{lineWidth:1,stroke:"#000",lineDash:void 0,startArrow:!1,endArrow:!1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},node:PE,combo:PE},NE={options:{labelCfg:{style:{fontFamily:iS.windowFontFamily}},descriptionCfg:{style:{fontFamily:iS.windowFontFamily}}},itemType:"",type:"",getCustomConfig:function(t){return{}},getOptions:function(t,e){return"move"===e||(null===e||void 0===e?void 0:e.includes("bbox"))?t:(0,Ux.deepMix)({},this.options,this.getCustomConfig(t)||{},t)},draw:function(t,e){e.shapeMap={},this.mergeStyle=this.getOptions(t);var r=this.drawShape(t,e);if(r.set("className",this.itemType+"-shape"),e.shapeMap[this.itemType+"-shape"]=r,t.label){var n=this.drawLabel(t,e);n.set("className",this.itemType+"-label"),e.shapeMap[this.itemType+"-label"]=n}return r},afterDraw:function(t,e,r){},drawShape:function(t,e){return null},drawLabel:function(t,e){var r=(this.mergeStyle||this.getOptions(t)||{}).labelCfg||{},n=this.getLabelStyle(t,r,e),i=n.rotate;delete n.rotate;var o=e.addShape("text",{attrs:n,draggable:!0,className:"text-shape",name:"text-shape",labelRelated:!0});if(e.shapeMap["text-shape"]=o,!isNaN(i)&&""!==i){var a=o.getBBox(),s=[1,0,0,0,1,0,0,0,1];if(n.rotateCenter)switch(n.rotateCenter){case"center":s=OE(s,[["t",-a.width/2,-a.height/2],["r",i],["t",a.width/2,a.height/2]]);break;case"lefttop":s=OE(s,[["t",-n.x,-n.y],["r",i],["t",n.x,n.y]]);break;case"leftcenter":s=OE(s,[["t",-n.x,-n.y-a.height/2],["r",i],["t",n.x,n.y+a.height/2]]);break;default:s=OE(s,[["t",-a.width/2,-a.height/2],["r",i],["t",a.width/2,a.height/2]])}else s=OE(s,[["t",-n.x,-n.y-a.height/2],["r",i],["t",n.x,n.y+a.height/2]]);o.setMatrix(s)}if(n.background){var u=this.drawLabelBg(t,e,o),l=this.itemType+"-label-bg";u.set("classname",l),e.shapeMap[l]=u,o.toFront()}return o},drawLabelBg:function(t,e,r){var n=this.options.labelCfg,i=(0,Ux.mix)({},n,t.labelCfg),o=this.getLabelBgStyleByPosition(r,i),a=e.addShape("rect",{name:"text-bg-shape",attrs:o,labelRelated:!0});return e.shapeMap["text-bg-shape"]=a,a},getLabelStyleByPosition:function(t,e,r){return{text:t.label}},getLabelBgStyleByPosition:function(t,e){return{}},getLabelStyle:function(t,e,r){var n=this.getLabelStyleByPosition(t,e,r),i="".concat(this.itemType,"Label"),o=iS[i]?iS[i].style:null;return(0,Gx.__assign)((0,Gx.__assign)((0,Gx.__assign)({},o),n),e.style)},getShapeStyle:function(t){return t.style},update:function(t,e,r){this.updateShapeStyle(t,e,r),this.updateLabel(t,e,r)},updateShapeStyle:function(t,e,r){var n,i=e.getContainer(),o=e.getKeyShape(),a=(0,Ux.mix)({},o.attr(),t.style),s=function(t){var e,r=a[t];if((0,Ux.isPlainObject)(r)){var s=(null===(n=i.shapeMap)||void 0===n?void 0:n[t])||i.find(function(e){return e.get("name")===t});null===s||void 0===s||s.attr(r)}else o.attr(((e={})[t]=r,e))};for(var u in a)s(u)},updateLabel:function(t,e,r){var n,i,o=e.getContainer(),a=(this.mergeStyle||this.getOptions({},r)||{}).labelCfg,s=void 0===a?{}:a,u=this.itemType+"-label",l=o.shapeMap[u]||o.find(function(t){return t.get("className")===u}),c=this.itemType+"-label-bg",f=o.shapeMap[c]||o.find(function(t){return t.get("className")===c});if(l&&void 0===t.label&&(o.removeChild(l),delete o.shapeMap[u],f&&(o.removeChild(f),delete o.shapeMap[c])),t.label||""===t.label)if(l){(!r||"bbox|label"===r||"edge"===this.itemType&&"style"!==r)&&(s=(0,Ux.deepMix)(s,t.labelCfg));var h=this.getLabelStyleByPosition(t,s,o),p=null===(n=t.labelCfg)||void 0===n?void 0:n.style,d=(0,Gx.__assign)((0,Gx.__assign)({},h),p),y=d.rotate;if(delete d.rotate,isNaN(y)||""===y)1!==(null===(i=l.getMatrix())||void 0===i?void 0:i[4])&&l.resetMatrix(),l.attr(d);else{var g=[1,0,0,0,1,0,0,0,1];g=OE(g,[["t",-d.x,-d.y],["r",y],["t",d.x,d.y]]),d.matrix=g,l.attr(d)}if(f)if(d.background){var v=this.getLabelBgStyleByPosition(l,s);f.attr(v)}else o.removeChild(f);else d.background&&((f=this.drawLabelBg(t,o,l)).set("classname",c),o.shapeMap[c]=f,l.toFront())}else{var m=this.drawLabel(t,o);m.set("className",u),o.shapeMap[u]=m}},afterUpdate:function(t,e){},setState:function(t,e,r){var n,i,o,a=r.get("keyShape");if(a&&!a.destroyed){var s=r.getType(),u=(0,Ux.isBoolean)(e)?t:"".concat(t,":").concat(e),l=this.getStateStyle(u,r),c=r.getStateStyle(u);if(c||l){var f=(0,Ux.mix)({},c||l),h=r.getContainer(),p={x:1,y:1,cx:1,cy:1,matrix:1};if("combo"===s&&(p.r=1,p.width=1,p.height=1),e){var d=function(t){var e,r=f[t];if((0,Ux.isPlainObject)(r)&&!ME.includes(t)){var n=(null===(o=h.shapeMap)||void 0===o?void 0:o[t])||h.find(function(e){return e.get("name")===t});null===n||void 0===n||n.attr(r)}else a.attr(((e={})[t]=r,e))};for(var y in f)d(y)}else{var g=_S(r.getCurrentStatesStyle()),v=r.getModel(),m=(0,Ux.mix)({},v.style,_S(r.getOriginStyle())),b=a.get("name"),A=a.attr(),x={};Object.keys(A).forEach(function(t){if("img"!==t){var e=A[t];e&&"object"===TE(e)?x[t]=(0,Ux.clone)(e):x[t]=e}});var w={},_=function(t){var e=f[t];if((0,Ux.isPlainObject)(e)&&!ME.includes(t)){var r=h.shapeMap[t]||h.find(function(e){return e.get("name")===t});if(r){var n=_S(r.attr());(0,Ux.each)(e,function(e,i){if(t===b&&x[i]&&!p[i]){delete x[i];var o=m[t][i]||LE[s][i];a.attr(i,o)}else if(n[i]||0===n[i]){delete n[i];var u=m[t][i]||LE[s][i];r.attr(i,u)}}),w[t]=n}}else if(x[t]&&!p[t]){delete x[t];var i=m[t]||(m[b]?m[b][t]:void 0)||LE[s][t];a.attr(t,i)}};for(var S in f)_(S);for(var y in b?w[b]=x:(0,Ux.mix)(w,x),g)if(!p[y]){var E=g[y];(0,Ux.isPlainObject)(E)&&!ME.includes(y)||(b?((0,Ux.mix)(m[b],((i={})[y]=E,i)),delete m[y]):(0,Ux.mix)(m,((n={})[y]=E,n)),delete g[y])}var C={};(0,Ux.deepMix)(C,m,w,g);var k=!1,I=function(t){var e,r,n=C[t];if((0,Ux.isPlainObject)(n)&&!ME.includes(t)){var i=h.shapeMap[t]||h.find(function(e){return e.get("name")===t});i&&(("text"===i.get("type")||i.get("labelRelated"))&&(delete n.x,delete n.y,delete n.matrix),t===b&&("combo"===s&&(delete n.r,delete n.width,delete n.height),k=!0),i.attr(n))}else if(!k){var o=n||LE[s][t];"combo"===s?b||a.attr(((e={})[t]=o,e)):a.attr(((r={})[t]=o,r))}};for(var T in C)I(T)}}}},getStateStyle:function(t,e){var r=e.getModel(),n=e.getType(),i=this.getOptions(r),o=i.stateStyles,a=i.style,s=void 0===a?{}:a,u=r.stateStyles?r.stateStyles[t]:o&&o[t];return"combo"===n?(0,Ux.clone)(u):(0,Ux.mix)({},s,u)},getControlPoints:function(t){return t.controlPoints},getAnchorPoints:function(t){var e,r;return(null===t||void 0===t?void 0:t.anchorPoints)||(null===(e=this.getCustomConfig(t))||void 0===e?void 0:e.anchorPoints)||(null===(r=this.options)||void 0===r?void 0:r.anchorPoints)}},jE={itemType:"node",shapeType:"single-node",labelPosition:"center",offset:iS.nodeLabel.offset,getSize:function(t){var e,r=(null===(e=this.mergeStyle)||void 0===e?void 0:e.size)||t.size||this.getOptions({}).size||iS.defaultNode.size;return(0,Ux.isArray)(r)&&1===r.length&&(r=[r[0],r[0]]),(0,Ux.isArray)(r)||(r=[r,r]),r},getLabelStyleByPosition:function(t,e){var r=e.maxLength,n=t.label;r&&(n=mS(n,r));var i=e.position||this.labelPosition;if("center"===i)return{x:0,y:0,text:n,textBaseline:"middle",textAlign:"center"};var o=e.offset;(0,Ux.isNil)(o)&&(o=this.offset);var a,s=this.getSize(t);switch(i){case"top":a={x:0,y:-s[1]/2-o,textBaseline:"bottom",textAlign:"center"};break;case"bottom":a={x:0,y:s[1]/2+o,textBaseline:"top",textAlign:"center"};break;case"left":a={x:-s[0]/2-o,y:0,textBaseline:"middle",textAlign:"right"};break;default:a={x:s[0]/2+o,y:0,textBaseline:"middle",textAlign:"left"}}return a.text=n,a},getLabelBgStyleByPosition:function(t,e){var r;if(!t)return{};var n=null===(r=e.style)||void 0===r?void 0:r.background;if(!n)return{};var i=t.getBBox(),o=OS(n.padding),a=i.width+o[1]+o[3],s=i.height+o[0]+o[2];return(0,Gx.__assign)((0,Gx.__assign)({x:i.minX-o[3],y:i.minY-o[0]},n),{width:a,height:s})},drawShape:function(t,e){var r=this.shapeType,n=this.getShapeStyle(t),i=e.addShape(r,{attrs:n,draggable:!0,name:"node-shape"});return e.shapeMap["node-shape"]=i,i},updateLinkPoints:function(t,e){var r,n=(this.mergeStyle||this.getOptions(t)).linkPoints,i=e.shapeMap["link-point-left"]||e.find(function(t){return"link-point-left"===t.get("className")}),o=e.shapeMap["link-point-right"]||e.find(function(t){return"link-point-right"===t.get("className")}),a=e.shapeMap["link-point-top"]||e.find(function(t){return"link-point-top"===t.get("className")}),s=e.shapeMap["link-point-bottom"]||e.find(function(t){return"link-point-bottom"===t.get("className")});i&&(r=i.attr()),o&&!r&&(r=o.attr()),a&&!r&&(r=a.attr()),s&&!r&&(r=s.attr()),r||(r=n);var u=(0,Ux.mix)({},r,t.linkPoints),l=u.fill,c=u.stroke,f=u.lineWidth,h=u.size/2;h||(h=u.r);var p=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},d=p.left,y=p.right,g=p.top,v=p.bottom,m=this.getSize(t),b=m[0],A=m[1],x={r:h,fill:l,stroke:c,lineWidth:f};if(i)d||void 0===d?i.attr((0,Gx.__assign)((0,Gx.__assign)({},x),{x:-b/2,y:0})):(i.remove(),delete e.shapeMap["link-point-left"]);else if(d){var w="link-point-left";e.shapeMap[w]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},x),{x:-b/2,y:0}),className:w,name:w,isAnchorPoint:!0})}if(o)y||void 0===y||(o.remove(),delete e.shapeMap["link-point-right"]),o.attr((0,Gx.__assign)((0,Gx.__assign)({},x),{x:b/2,y:0}));else if(y){var _="link-point-right";e.shapeMap[_]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},x),{x:b/2,y:0}),className:_,name:_,isAnchorPoint:!0})}if(a)g||void 0===g||(a.remove(),delete e.shapeMap["link-point-top"]),a.attr((0,Gx.__assign)((0,Gx.__assign)({},x),{x:0,y:-A/2}));else if(g){var S="link-point-top";e.shapeMap[S]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},x),{x:0,y:-A/2}),className:S,name:S,isAnchorPoint:!0})}if(s)v||void 0===v?s.attr((0,Gx.__assign)((0,Gx.__assign)({},x),{x:0,y:A/2})):(s.remove(),delete e.shapeMap["link-point-bottom"]);else if(v){var E="link-point-bottom";e.shapeMap[E]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},x),{x:0,y:A/2}),className:E,name:E,isAnchorPoint:!0})}},updateShape:function(t,e,r,n,i){e.get("keyShape").attr((0,Gx.__assign)({},r)),this.updateLabel(t,e,i),n&&this.updateIcon(t,e)},updateIcon:function(t,e){var r=this,n=e.getContainer(),i=(this.mergeStyle||this.getOptions(t)).icon,o=t.icon?t.icon:{show:void 0,text:void 0},a=o.show,s=o.text,u=n.shapeMap["".concat(this.type,"-icon")]||n.find(function(t){return t.get("name")==="".concat(r.type,"-icon")});if(u)if(a||void 0===a){var l=(0,Ux.mix)({},u.attr(),i),c=l.width,f=void 0===c?20:c,h=l.height,p=void 0===h?20:h;("iconfont"===l.fontFamily||l.hasOwnProperty("text"))&&(f=0,p=0),u.attr((0,Gx.__assign)((0,Gx.__assign)({},l),{x:-f/2,y:-p/2}))}else u.remove(),delete n.shapeMap["".concat(this.type,"-icon")];else if(a){var d="".concat(this.type,"-icon");if(s)n.shapeMap[d]=n.addShape("text",{attrs:(0,Gx.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:d,name:d});else{f=i.width,p=i.height;n.shapeMap[d]=n.addShape("image",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},i),{x:-f/2,y:-p/2}),className:d,name:d})}var y=n.shapeMap["node-label"]||n.find(function(t){return"node-label"===t.get("name")});y&&y.toFront()}}},RE=(0,Gx.__assign)((0,Gx.__assign)({},NE),jE);XS.registerNode("single-node",RE);var DE={itemType:"edge",labelPosition:"center",refX:0,refY:0,labelAutoRotate:!1,options:{size:iS.defaultEdge.size,style:{x:0,y:0,stroke:iS.defaultEdge.style.stroke,lineAppendWidth:iS.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:iS.edgeLabel.style.fill,fontSize:iS.edgeLabel.style.fontSize,fontFamily:iS.windowFontFamily}},stateStyles:(0,Gx.__assign)({},iS.edgeStateStyles)},getPath:function(t){var e=[];return(0,Ux.each)(t,function(t,r){0===r?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])}),e},getShapeStyle:function(t){var e=this.options.style,r={stroke:t.color},n=(0,Ux.mix)({},e,r,t.style),i=t.size||iS.defaultEdge.size,o=(t=this.getPathPoints(t)).startPoint,a=t.endPoint,s=this.getControlPoints(t),u=[o];s&&(u=u.concat(s)),u.push(a);var l=this.getPath(u);return(0,Ux.mix)({},iS.defaultEdge.style,{stroke:iS.defaultEdge.color,lineWidth:i,path:l},n)},updateShapeStyle:function(t,e,r){var n,i=e.getContainer(),o=(null===(n=e.getKeyShape)||void 0===n?void 0:n.call(e))||i.shapeMap["edge-shape"],a=t.size,s=(t=this.getPathPoints(t)).startPoint,u=t.endPoint,l=this.getControlPoints(t),c=[s];l&&(c=c.concat(l)),c.push(u);var f=o.attr(),h=t.style||{};void 0===h.stroke&&(h.stroke=t.color);var p=t.sourceNode,d=t.targetNode,y={radius:h.radius};l||(y={source:p,target:d,offset:h.offset,radius:h.radius});var g=this.getPath(c,y),v={};"move"===r?v={path:g}:(f.endArrow&&!1===h.endArrow&&(t.style.endArrow={path:""}),f.startArrow&&!1===h.startArrow&&(t.style.startArrow={path:""}),void 0===(v=(0,Gx.__assign)({},t.style)).lineWidth&&(v.lineWidth=((0,Ux.isNumber)(a)?a:null===a||void 0===a?void 0:a[0])||f.lineWidth),void 0===v.path&&(v.path=g),void 0===v.stroke&&(v.stroke=f.stroke||t.color)),o&&o.attr(v)},getLabelStyleByPosition:function(t,e,r){var n,i=e.position||this.labelPosition,o={},a=null===r||void 0===r?void 0:r.shapeMap["edge-shape"];n="start"===i?0:"end"===i?1:.5;var s,u=e.refX||this.refX,l=e.refY||this.refY;if(t.startPoint.x===t.endPoint.x&&t.startPoint.y===t.endPoint.y)return o.x=t.startPoint.x+u,o.y=t.startPoint.y+l,o.text=t.label,o;s=(0,Ux.isNil)(e.autoRotate)?this.labelAutoRotate:e.autoRotate;var c=pS(a,n,u,l,s);return o.x=c.x,o.y=c.y,o.rotate=c.rotate,o.textAlign=this._getTextAlign(i,c.angle),o.text=t.label,o},getLabelBgStyleByPosition:function(t,e){if(!t)return{};var r=t.getBBox(),n=e.style&&e.style.background;if(!n)return{};var i=n.padding,o=r.width+i[1]+i[3],a=r.height+i[0]+i[2],s=(0,Gx.__assign)((0,Gx.__assign)({},n),{width:o,height:a,x:r.minX-i[3],y:r.minY-i[0],matrix:[1,0,0,0,1,0,0,0,1]});return((0,Ux.isNil)(e.autoRotate)?this.labelAutoRotate:e.autoRotate)&&(s.matrix=t.attr("matrix")||[1,0,0,0,1,0,0,0,1]),s},_getTextAlign:function(t,e){var r="center";return e?(e%=2*Math.PI,"center"!==t&&(r=e>=0&&e<=Math.PI/2||e>=1.5*Math.PI&&e<2*Math.PI?t:function(t){var e=t;return"start"===t?e="end":"end"===t&&(e="start"),e}(t)),r):t},getControlPoints:function(t){return t.controlPoints},getPathPoints:function(t){return t},drawShape:function(t,e){var r=this.getShapeStyle(t),n=e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:r});return e.shapeMap["edge-shape"]=n,n},drawLabel:function(t,e){var r=this.options.labelCfg,n=(0,Ux.deepMix)({},r,t.labelCfg),i=this.getLabelStyle(t,n,e),o=i.rotate;delete i.rotate;var a=e.addShape("text",{attrs:i,name:"text-shape",labelRelated:!0,draggable:!0});if(e.shapeMap["text-shape"]=a,isNaN(o)||""===o||a.rotateAtStart(o),i.background){var s=this.drawLabelBg(t,e,a,i,o),u=this.itemType+"-label-bg";s.set("classname",u),e.shapeMap[u]=s,a.toFront()}return a},drawLabelBg:function(t,e,r,n,i){var o=this.options.labelCfg,a=(0,Ux.deepMix)({},o,t.labelCfg),s=this.getLabelBgStyleByPosition(r,a),u=e.addShape("rect",{name:"text-bg-shape",attrs:s,labelRelated:!0});return e.shapeMap["text-bg-shape"]=u,u}},BE=(0,Gx.__assign)((0,Gx.__assign)({},NE),DE);XS.registerEdge("single-edge",BE),XS.registerEdge("line",{getControlPoints:function(){}},"single-edge"),XS.registerEdge("spline",{getPath:function(t){return oE(t)}},"single-edge"),XS.registerEdge("arc",{curveOffset:20,clockwise:1,getControlPoints:function(t){var e,r,n=t.startPoint,i=t.endPoint,o=(n.x+i.x)/2,a=(n.y+i.y)/2;if(void 0!==t.controlPoints){if(r=t.controlPoints[0],e=C_(n,r,i),n.x<=i.x&&n.y>i.y?this.clockwise=e.x>r.x?0:1:n.x<=i.x&&n.yr.x?1:0:n.x>i.x&&n.y<=i.y?this.clockwise=e.y=t&&i<=t+r&&o>=e&&o<=e+n}function iC(t,e){return!(e.minX>t.maxX||e.maxXt.maxY||e.maxY=0&&a<.5*Math.PI?(n={x:u.minX,y:u.minY},i={x:u.maxX,y:u.maxY}):.5*Math.PI<=a&&a1&&(r*=Math.sqrt(p),n*=Math.sqrt(p));var d=r*r*(h*h)+n*n*(f*f),y=d?Math.sqrt((r*r*(n*n)-d)/d):1;o===a&&(y*=-1),isNaN(y)&&(y=0);var g=n?y*r*h/n:0,v=r?y*-n*f/r:0,m=(s+l)/2+Math.cos(i)*g-Math.sin(i)*v,b=(u+c)/2+Math.sin(i)*g+Math.cos(i)*v,A=[(f-g)/r,(h-v)/n],x=[(-1*f-g)/r,(-1*h-v)/n],w=dC([1,0],A),_=dC(A,x);return pC(A,x)<=-1&&(_=Math.PI),pC(A,x)>=1&&(_=0),0===a&&_>0&&(_-=2*Math.PI),1===a&&_<0&&(_+=2*Math.PI),{cx:m,cy:b,rx:oC(t,[l,c])?0:r,ry:oC(t,[l,c])?0:n,startAngle:w,endAngle:w+_,xRotation:i,arcFlag:o,sweepFlag:a}}function gC(t){"@babel/helpers - typeof";return(gC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var vC=Math.sin,mC=Math.cos,bC=Math.atan2,AC=Math.PI;function xC(t,e,r,n,i,o,a){var s=e.stroke,u=e.lineWidth,l=bC(n-o,r-i),c=new rk({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*mC(AC/6)+","+10*vC(AC/6)+" L0,0 L"+10*mC(AC/6)+",-"+10*vC(AC/6),stroke:s,lineWidth:u}});c.translate(i,o),c.rotateAtPoint(i,o,l),t.set(a?"startArrowShape":"endArrowShape",c)}function wC(t,e,r,n,i,o,a){var s=e.startArrow,u=e.endArrow,l=e.stroke,c=e.lineWidth,f=a?s:u,h=f.d,p=f.fill,d=f.stroke,y=f.lineWidth,g=(0,Gx.__rest)(f,["d","fill","stroke","lineWidth"]),v=bC(n-o,r-i);h&&(i-=mC(v)*h,o-=vC(v)*h);var m=new rk({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:(0,Gx.__assign)((0,Gx.__assign)({},g),{stroke:d||l,lineWidth:y||c,fill:p})});m.translate(i,o),m.rotateAtPoint(i,o,v),t.set(a?"startArrowShape":"endArrowShape",m)}function _C(t,e,r,n,i){var o=bC(n-e,r-t);return{dx:mC(o)*i,dy:vC(o)*i}}function SC(t,e,r,n,i,o){"object"===gC(e.startArrow)?wC(t,e,r,n,i,o,!0):e.startArrow?xC(t,e,r,n,i,o,!0):t.set("startArrowShape",null)}function EC(t,e,r,n,i,o){"object"===gC(e.endArrow)?wC(t,e,r,n,i,o,!1):e.endArrow?xC(t,e,r,n,i,o,!1):t.set("startArrowShape",null)}var CC={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"};function kC(t,e){var r=e.attr();for(var n in r){var i=r[n],o=CC[n]?CC[n]:n;"matrix"===o&&i?t.transform(i[0],i[1],i[3],i[4],i[6],i[7]):"lineDash"===o&&t.setLineDash?(0,Ux.isArray)(i)&&t.setLineDash(i):("strokeStyle"===o||"fillStyle"===o?i=fC(t,e,i):"globalAlpha"===o&&(i*=t.globalAlpha),t[o]=i)}}function IC(t,e,r){for(var n=0;nA?b:A,C=b>A?1:b/A,k=b>A?A/b:1;e.translate(v,m),e.rotate(_),e.scale(C,k),e.arc(0,0,E,x,w,1-S),e.scale(1/C,1/k),e.rotate(-_),e.translate(-v,-m)}break;case"Z":e.closePath()}if("Z"===h)s=u;else{var I=f.length;s=[f[I-2],f[I-1]]}}}}function LC(t,e){var r=t.get("canvas");r&&("remove"===e&&(t._cacheCanvasBBox=t.get("cacheCanvasBBox")),t.get("hasChanged")||(t.set("hasChanged",!0),t.cfg.parent&&t.cfg.parent.get("hasChanged")||(r.refreshElement(t,e,r),r.get("autoDraw")&&r.draw())))}function NC(t){var e,r,n;if(t.destroyed)e=t._cacheCanvasBBox;else{var i=t.get("cacheCanvasBBox"),o=i&&!(!i.width||!i.height),a=t.getCanvasBBox(),s=a&&!(!a.width||!a.height);o&&s?(n=a,e=(r=i)&&n?{minX:Math.min(r.minX,n.minX),minY:Math.min(r.minY,n.minY),maxX:Math.max(r.maxX,n.maxX),maxY:Math.max(r.maxY,n.maxY)}:r||n):o?e=i:s&&(e=a)}return e}var jC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.onCanvasChange=function(t){LC(this,t)},e.prototype.getShapeBase=function(){return c},e.prototype.getGroupBase=function(){return e},e.prototype._applyClip=function(t,e){e&&(t.save(),kC(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,e=[],r=[];(0,Ux.each)(t,function(t){var n=t.cfg.cacheCanvasBBox;n&&t.cfg.isInView&&(e.push(n.minX,n.maxX),r.push(n.minY,n.maxY))});var n=null;if(e.length){var i=(0,Ux.min)(e),o=(0,Ux.max)(e),a=(0,Ux.min)(r),s=(0,Ux.max)(r);n={minX:i,minY:a,x:i,y:a,maxX:o,maxY:s,width:o-i,height:s-a};var u=this.cfg.canvas;if(u){var l=u.getViewRange();this.set("isInView",iC(n,l))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",n)},e.prototype.draw=function(t,e){var r=this.cfg.children,n=!e||this.cfg.refresh;r.length&&n&&(t.save(),kC(t,this),this._applyClip(t,this.getClip()),IC(t,r,e),t.restore(),this.cacheCanvasBBox()),this.cfg.refresh=null,this.set("hasChanged",!1)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("hasChanged",!1)},e}(kS.AbstractGroup),RC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.getShapeBase=function(){return c},e.prototype.getGroupBase=function(){return jC},e.prototype.onCanvasChange=function(t){LC(this,t)},e.prototype.calculateBBox=function(){var t=this.get("type"),e=this.getHitLineWidth(),r=(0,kS.getBBoxMethod)(t)(this),n=e/2,i=r.x-n,o=r.y-n,a=r.x+r.width+n,s=r.y+r.height+n;return{x:i,minX:i,y:o,minY:o,width:r.width+e,height:r.height+e,maxX:a,maxY:s}},e.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},e.prototype.isStroke=function(){return!!this.attrs.stroke},e.prototype._applyClip=function(t,e){e&&(t.save(),kC(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.draw=function(t,e){var r=this.cfg.clipShape;if(e){if(!1===this.cfg.refresh)return void this.set("hasChanged",!1);if(!iC(e,this.getCanvasBBox()))return this.set("hasChanged",!1),void(this.cfg.isInView&&this._afterDraw())}t.save(),kC(t,this),this._applyClip(t,r),this.drawPath(t),t.restore(),this._afterDraw()},e.prototype.getCanvasViewBox=function(){var t=this.cfg.canvas;return t?t.getViewRange():null},e.prototype.cacheCanvasBBox=function(){var t=this.getCanvasViewBox();if(t){var e=this.getCanvasBBox(),r=iC(e,t);this.set("isInView",r),r?this.set("cacheCanvasBBox",e):this.set("cacheCanvasBBox",null)}},e.prototype._afterDraw=function(){this.cacheCanvasBBox(),this.set("hasChanged",!1),this.set("refresh",null)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("isInView",null),this.set("hasChanged",!1)},e.prototype.drawPath=function(t){this.createPath(t),this.strokeAndFill(t),this.afterDrawPath(t)},e.prototype.fill=function(t){t.fill()},e.prototype.stroke=function(t){t.stroke()},e.prototype.strokeAndFill=function(t){var e=this.attrs,r=e.lineWidth,n=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isFill()&&((0,Ux.isNil)(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=n)),this.isStroke()&&r>0&&((0,Ux.isNil)(i)||1===i||(t.globalAlpha=i),this.stroke(t)),this.afterDrawPath(t)},e.prototype.createPath=function(t){},e.prototype.afterDrawPath=function(t){},e.prototype.isInShape=function(t,e){var r=this.isStroke(),n=this.isFill(),i=this.getHitLineWidth();return this.isInStrokeOrPath(t,e,r,n,i)},e.prototype.isInStrokeOrPath=function(t,e,r,n,i){return!1},e.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},e}(kS.AbstractShape),DC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{x:0,y:0,r:0})},e.prototype.isInStrokeOrPath=function(t,e,r,n,i){var o=this.attr(),a=o.x,s=o.y,u=o.r,l=i/2,c=rC(a,s,t,e);return n&&r?c<=u+l:n?c<=u:!!r&&(c>=u-l&&c<=u+l)},e.prototype.createPath=function(t){var e=this.attr(),r=e.x,n=e.y,i=e.r;t.beginPath(),t.arc(r,n,i,0,2*Math.PI,!1),t.closePath()},e}(RC);function BC(t,e,r,n){return t/(r*r)+e/(n*n)}var FC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{x:0,y:0,rx:0,ry:0})},e.prototype.isInStrokeOrPath=function(t,e,r,n,i){var o=this.attr(),a=i/2,s=o.x,u=o.y,l=o.rx,c=o.ry,f=(t-s)*(t-s),h=(e-u)*(e-u);return n&&r?BC(f,h,l+a,c+a)<=1:n?BC(f,h,l,c)<=1:!!r&&(BC(f,h,l-a,c-a)>=1&&BC(f,h,l+a,c+a)<=1)},e.prototype.createPath=function(t){var e=this.attr(),r=e.x,n=e.y,i=e.rx,o=e.ry;if(t.beginPath(),t.ellipse)t.ellipse(r,n,i,o,0,0,2*Math.PI,!1);else{var a=i>o?i:o,s=i>o?1:i/o,u=i>o?o/i:1;t.save(),t.translate(r,n),t.scale(s,u),t.arc(0,0,a,0,2*Math.PI),t.restore(),t.closePath()}},e}(RC);function zC(t){return t instanceof HTMLElement&&(0,Ux.isString)(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase()}var GC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{x:0,y:0,width:0,height:0})},e.prototype.initAttrs=function(t){this._setImage(t.img)},e.prototype.isStroke=function(){return!1},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._afterLoading=function(){if(!0===this.get("toDraw")){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},e.prototype._setImage=function(t){var e=this,r=this.attrs;if((0,Ux.isString)(t)){var n=new Image;n.onload=function(){if(e.destroyed)return!1;e.attr("img",n),e.set("loading",!1),e._afterLoading();var t=e.get("callback");t&&t.call(e)},n.crossOrigin="Anonymous",n.src=t,this.set("loading",!0)}else t instanceof Image?(r.width||(r.width=t.width),r.height||(r.height=t.height)):zC(t)&&(r.width||(r.width=Number(t.getAttribute("width"))),r.height||(r.height,Number(t.getAttribute("height"))))},e.prototype.onAttrChange=function(e,r,n){t.prototype.onAttrChange.call(this,e,r,n),"img"===e&&this._setImage(r)},e.prototype.createPath=function(t){if(this.get("loading"))return this.set("toDraw",!0),void this.set("context",t);var e=this.attr(),r=e.x,n=e.y,i=e.width,o=e.height,a=e.sx,s=e.sy,u=e.swidth,l=e.sheight,c=e.img;(c instanceof Image||zC(c))&&((0,Ux.isNil)(a)||(0,Ux.isNil)(s)||(0,Ux.isNil)(u)||(0,Ux.isNil)(l)?t.drawImage(c,r,n,i,o):t.drawImage(c,a,s,u,l,r,n,i,o))},e}(RC),UC=r(9590);function HC(t,e,r,n,i,o,a){var s=Math.min(t,r),u=Math.max(t,r),l=Math.min(e,n),c=Math.max(e,n),f=i/2;return o>=s-f&&o<=u+f&&a>=l-f&&a<=c+f&&UC.N1.pointToLine(t,e,r,n,o,a)<=i/2}var VC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(e,r,n){t.prototype.onAttrChange.call(this,e,r,n),this.setArrow()},e.prototype.setArrow=function(){var t=this.attr(),e=t.x1,r=t.y1,n=t.x2,i=t.y2,o=t.startArrow,a=t.endArrow;o&&SC(this,t,n,i,e,r),a&&EC(this,t,e,r,n,i)},e.prototype.isInStrokeOrPath=function(t,e,r,n,i){if(!r||!i)return!1;var o=this.attr();return HC(o.x1,o.y1,o.x2,o.y2,i,t,e)},e.prototype.createPath=function(t){var e=this.attr(),r=e.x1,n=e.y1,i=e.x2,o=e.y2,a=e.startArrow,s=e.endArrow,u={dx:0,dy:0},l={dx:0,dy:0};a&&a.d&&(u=_C(r,n,i,o,e.startArrow.d)),s&&s.d&&(l=_C(r,n,i,o,e.endArrow.d)),t.beginPath(),t.moveTo(r+u.dx,n+u.dy),t.lineTo(i-l.dx,o-l.dy)},e.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),r=this.get("endArrowShape");e&&e.draw(t),r&&r.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,r=t.y1,n=t.x2,i=t.y2;return UC.N1.length(e,r,n,i)},e.prototype.getPoint=function(t){var e=this.attr(),r=e.x1,n=e.y1,i=e.x2,o=e.y2;return UC.N1.pointAt(r,n,i,o,t)},e}(RC),QC={circle:function(t,e,r){return[["M",t-r,e],["A",r,r,0,1,0,t+r,e],["A",r,r,0,1,0,t-r,e]]},square:function(t,e,r){return[["M",t-r,e-r],["L",t+r,e-r],["L",t+r,e+r],["L",t-r,e+r],["Z"]]},diamond:function(t,e,r){return[["M",t-r,e],["L",t,e-r],["L",t+r,e],["L",t,e+r],["Z"]]},triangle:function(t,e,r){var n=r*Math.sin(1/3*Math.PI);return[["M",t-r,e+n],["L",t,e-n],["L",t+r,e+n],["Z"]]},"triangle-down":function(t,e,r){var n=r*Math.sin(1/3*Math.PI);return[["M",t-r,e-n],["L",t+r,e-n],["L",t,e+n],["Z"]]}},YC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.initAttrs=function(t){this._resetParamsCache()},e.prototype._resetParamsCache=function(){this.set("paramsCache",{})},e.prototype.onAttrChange=function(e,r,n){t.prototype.onAttrChange.call(this,e,r,n),-1!==["symbol","x","y","r","radius"].indexOf(e)&&this._resetParamsCache()},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._getR=function(t){return(0,Ux.isNil)(t.r)?t.radius:t.r},e.prototype._getPath=function(){var t,r,n=this.attr(),i=n.x,o=n.y,a=n.symbol||"circle",s=this._getR(n);if((0,Ux.isFunction)(a))r=(t=a)(i,o,s),r=(0,nE.$j)(r);else{if(!(t=e.Symbols[a]))return console.warn(a+" marker is not supported."),null;r=t(i,o,s)}return r},e.prototype.createPath=function(t){PC(this,t,{path:this._getPath()},this.get("paramsCache"))},e.Symbols=QC,e}(RC);function WC(t,e,r){var n=(0,kS.getOffScreenContext)();return t.createPath(n),n.isPointInPath(e,r)}var qC=1e-6;function XC(t){return Math.abs(t)0!=XC(s[1]-r)>0&&XC(e-(r-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(n=!n)}return n}function ZC(t,e,r,n,i,o,a,s){var u=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI);if(ui)return!1;var l={x:t+r*Math.cos(u),y:e+r*Math.sin(u)};return rC(l.x,l.y,a,s)<=o/2}var $C=Wx.pd;var tk=(0,Gx.__assign)({hasArc:function(t){for(var e=!1,r=t.length,n=0;n0&&n.push(i),{polygons:r,polylines:n}},isPointInStroke:function(t,e,r,n,i){for(var o=!1,a=e/2,s=0;sv?g:v,_=$C(null,[["t",-d,-y],["r",-A],["s",1/(g>v?1:g/v),1/(g>v?v/g:1)]]);d_.transformMat3(x,x,_),o=ZC(0,0,w,m,b,e,x[0],x[1])}if(o)break}}return o}},kS.PathUtil);function ek(t,e,r){for(var n=!1,i=0;i=n[0]&&t<=n[1]&&(e=(t-n[0])/(n[1]-n[0]),r=i)});var o=i[r];if((0,Ux.isNil)(o)||(0,Ux.isNil)(r))return null;var a=o.length,s=i[r+1];return UC.lw.pointAt(o[a-2],o[a-1],s[1],s[2],s[3],s[4],s[5],s[6],e)},e.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",tk.pathToCurve(t))},e.prototype._setTcache=function(){var t,e,r,n,i=0,o=0,a=[],s=this.get("curve");s&&((0,Ux.each)(s,function(t,e){r=s[e+1],n=t.length,r&&(i+=UC.lw.length(t[n-2],t[n-1],r[1],r[2],r[3],r[4],r[5],r[6])||0)}),this.set("totalLength",i),0!==i?((0,Ux.each)(s,function(u,l){r=s[l+1],n=u.length,r&&((t=[])[0]=o/i,e=UC.lw.length(u[n-2],u[n-1],r[1],r[2],r[3],r[4],r[5],r[6]),o+=e||0,t[1]=o/i,a.push(t))}),this.set("tCache",a)):this.set("tCache",[]))},e.prototype.getStartTangent=function(){var t,e=this.getSegments();if(e.length>1){var r=e[0].currentPoint,n=e[1].currentPoint,i=e[1].startTangent;t=[],i?(t.push([r[0]-i[0],r[1]-i[1]]),t.push([r[0],r[1]])):(t.push([n[0],n[1]]),t.push([r[0],r[1]]))}return t},e.prototype.getEndTangent=function(){var t,e=this.getSegments(),r=e.length;if(r>1){var n=e[r-2].currentPoint,i=e[r-1].currentPoint,o=e[r-1].endTangent;t=[],o?(t.push([i[0]-o[0],i[1]-o[1]]),t.push([i[0],i[1]])):(t.push([n[0],n[1]]),t.push([i[0],i[1]]))}return t},e}(RC);function nk(t,e,r,n,i){var o=t.length;if(o<2)return!1;for(var a=0;a=n[0]&&t<=n[1]&&(e=(t-n[0])/(n[1]-n[0]),r=i)}),UC.N1.pointAt(n[r][0],n[r][1],n[r+1][0],n[r+1][1],e)},e.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var e=this.getTotalLength();if(!(e<=0)){var r,n,i=0,o=[];(0,Ux.each)(t,function(a,s){t[s+1]&&((r=[])[0]=i/e,n=UC.N1.length(a[0],a[1],t[s+1][0],t[s+1][1]),i+=n,r[1]=i/e,o.push(r))}),this.set("tCache",o)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,r=[];return r.push([t[e-1][0],t[e-1][1]]),r.push([t[e][0],t[e][1]]),r},e}(RC);var ak=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.isInStrokeOrPath=function(t,e,r,n,i){var o=this.attr(),a=o.x,s=o.y,u=o.width,l=o.height,c=o.radius;if(c){var f=!1;return r&&(f=function(t,e,r,n,i,o,a,s){return HC(t+i,e,t+r-i,e,o,a,s)||HC(t+r,e+i,t+r,e+n-i,o,a,s)||HC(t+r-i,e+n,t+i,e+n,o,a,s)||HC(t,e+n-i,t,e+i,o,a,s)||ZC(t+r-i,e+i,i,1.5*Math.PI,2*Math.PI,o,a,s)||ZC(t+r-i,e+n-i,i,0,.5*Math.PI,o,a,s)||ZC(t+i,e+n-i,i,.5*Math.PI,Math.PI,o,a,s)||ZC(t+i,e+i,i,Math.PI,1.5*Math.PI,o,a,s)}(a,s,u,l,c,i,t,e)),!f&&n&&(f=WC(this,t,e)),f}var h=i/2;return n&&r?nC(a-h,s-h,u+h,l+h,t,e):n?nC(a,s,u,l,t,e):r?function(t,e,r,n,i,o,a){var s=i/2;return nC(t-s,e-s,r,i,o,a)||nC(t+r-s,e-s,i,n,o,a)||nC(t+s,e+n-s,r,i,o,a)||nC(t-s,e+s,i,n,o,a)}(a,s,u,l,i,t,e):void 0},e.prototype.createPath=function(t){var e=this.attr(),r=e.x,n=e.y,i=e.width,o=e.height,a=e.radius;if(t.beginPath(),0===a)t.rect(r,n,i,o);else{var s=function(t){var e=0,r=0,n=0,i=0;return(0,Ux.isArray)(t)?1===t.length?e=r=n=i=t[0]:2===t.length?(e=n=t[0],r=i=t[1]):3===t.length?(e=t[0],r=i=t[1],n=t[2]):(e=t[0],r=t[1],n=t[2],i=t[3]):e=r=n=i=t,[e,r,n,i]}(a),u=s[0],l=s[1],c=s[2],f=s[3];t.moveTo(r+u,n),t.lineTo(r+i-l,n),0!==l&&t.arc(r+i-l,n+l,l,-Math.PI/2,0),t.lineTo(r+i,n+o-c),0!==c&&t.arc(r+i-c,n+o-c,c,0,Math.PI/2),t.lineTo(r+f,n+o),0!==f&&t.arc(r+f,n+o-f,f,Math.PI/2,Math.PI),t.lineTo(r,n+u),0!==u&&t.arc(r+u,n+u,u,Math.PI,1.5*Math.PI),t.closePath()}},e}(RC),sk=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.isOnlyHitBox=function(){return!0},e.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},e.prototype._assembleFont=function(){var t=this.attrs;t.font=(0,kS.assembleFont)(t)},e.prototype._setText=function(t){var e=null;(0,Ux.isString)(t)&&-1!==t.indexOf("\n")&&(e=t.split("\n")),this.set("textArr",e)},e.prototype.onAttrChange=function(e,r,n){t.prototype.onAttrChange.call(this,e,r,n),e.startsWith("font")&&this._assembleFont(),"text"===e&&this._setText(r)},e.prototype._getSpaceingY=function(){var t=this.attrs,e=t.lineHeight,r=1*t.fontSize;return e?e-r:.14*r},e.prototype._drawTextArr=function(t,e,r){var n,i=this.attrs,o=i.textBaseline,a=i.x,s=i.y,u=1*i.fontSize,l=this._getSpaceingY(),c=(0,kS.getTextHeight)(i.text,i.fontSize,i.lineHeight);(0,Ux.each)(e,function(e,i){n=s+i*(l+u)-c+u,"middle"===o&&(n+=c-u-(c-u)/2),"top"===o&&(n+=c-u),(0,Ux.isNil)(e)||(r?t.fillText(e,a,n):t.strokeText(e,a,n))})},e.prototype._drawText=function(t,e){var r=this.attr(),n=r.x,i=r.y,o=this.get("textArr");if(o)this._drawTextArr(t,o,e);else{var a=r.text;(0,Ux.isNil)(a)||(e?t.fillText(a,n,i):t.strokeText(a,n,i))}},e.prototype.strokeAndFill=function(t){var e=this.attrs,r=e.lineWidth,n=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isStroke()&&r>0&&((0,Ux.isNil)(i)||1===i||(t.globalAlpha=n),this.stroke(t)),this.isFill()&&((0,Ux.isNil)(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=n)),this.afterDrawPath(t)},e.prototype.fill=function(t){this._drawText(t,!0)},e.prototype.stroke=function(t){this._drawText(t,!1)},e}(RC);function uk(t,e,r){var n=t.getTotalMatrix();if(n){var i=function(t,e){if(e){var r=(0,kS.invert)(e);return(0,kS.multiplyVec2)(r,t)}return t}([e,r,1],n);return[i[0],i[1]]}return[e,r]}function lk(t,e,r){if(t.isCanvas&&t.isCanvas())return!0;if(!(0,kS.isAllowCapture)(t)||!1===t.cfg.isInView)return!1;if(t.cfg.clipShape){var n=uk(t,e,r),i=n[0],o=n[1];if(t.isClipped(i,o))return!1}var a=t.cfg.cacheCanvasBBox||t.getCanvasBBox();return e>=a.minX&&e<=a.maxX&&r>=a.minY&&r<=a.maxY}var ck=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.renderer="canvas",e.autoDraw=!0,e.localRefresh=!0,e.refreshElements=[],e.clipView=!0,e.quickHit=!1,e},e.prototype.onCanvasChange=function(t){"attr"!==t&&"sort"!==t&&"changeSize"!==t||(this.set("refreshElements",[this]),this.draw())},e.prototype.getShapeBase=function(){return c},e.prototype.getGroupBase=function(){return jC},e.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||(window?window.devicePixelRatio:1);return t>=1?Math.ceil(t):1},e.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},e.prototype.createDom=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return this.set("context",e),t},e.prototype.setDOMSize=function(e,r){t.prototype.setDOMSize.call(this,e,r);var n=this.get("context"),i=this.get("el"),o=this.getPixelRatio();i.width=o*e,i.height=o*r,o>1&&n.scale(o,o)},e.prototype.clear=function(){t.prototype.clear.call(this),this._clearFrame();var e=this.get("context"),r=this.get("el");e.clearRect(0,0,r.width,r.height)},e.prototype.getShape=function(e,r){return this.get("quickHit")?function t(e,r,n){if(!lk(e,r,n))return null;for(var i=null,o=e.getChildren(),a=o.length-1;a>=0;a--){var s=o[a];if(s.isGroup())i=t(s,r,n);else if(lk(s,r,n)){var u=s,l=uk(s,r,n),c=l[0],f=l[1];u.isInShape(c,f)&&(i=s)}if(i)break}return i}(this,e,r):t.prototype.getShape.call(this,e,r,null)},e.prototype._getRefreshRegion=function(){var t,e=this.get("refreshElements"),r=this.getViewRange();e.length&&e[0]===this?t=r:(t=function(t){if(!t.length)return null;var e=[],r=[],n=[],i=[];return(0,Ux.each)(t,function(t){var o=NC(t);o&&(e.push(o.minX),r.push(o.minY),n.push(o.maxX),i.push(o.maxY))}),{minX:(0,Ux.min)(e),minY:(0,Ux.min)(r),maxX:(0,Ux.max)(n),maxY:(0,Ux.max)(i)}}(e))&&(t.minX=Math.floor(t.minX),t.minY=Math.floor(t.minY),t.maxX=Math.ceil(t.maxX),t.maxY=Math.ceil(t.maxY),t.maxY+=1,this.get("clipView")&&(t=function(t,e){return t&&e&&iC(t,e)?{minX:Math.max(t.minX,e.minX),minY:Math.max(t.minY,e.minY),maxX:Math.min(t.maxX,e.maxX),maxY:Math.min(t.maxY,e.maxY)}:null}(t,r)));return t},e.prototype.refreshElement=function(t){this.get("refreshElements").push(t)},e.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&((0,Ux.clearAnimationFrame)(t),this.set("drawFrame",null),this.set("refreshElements",[]))},e.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},e.prototype._drawAll=function(){var t=this.get("context"),e=this.get("el"),r=this.getChildren();t.clearRect(0,0,e.width,e.height),kC(t,this),IC(t,r),this.set("refreshElements",[])},e.prototype._drawRegion=function(){var t=this.get("context"),e=this.get("refreshElements"),r=this.getChildren(),n=this._getRefreshRegion();n?(t.clearRect(n.minX,n.minY,n.maxX-n.minX,n.maxY-n.minY),t.save(),t.beginPath(),t.rect(n.minX,n.minY,n.maxX-n.minX,n.maxY-n.minY),t.clip(),kC(t,this),TC(this,r,n),IC(t,r,n),t.restore()):e.length&&function t(e){for(var r=0;re)r.insertBefore(t,i);else if(o0&&(e?"stroke"in r?this._setColor(t,"stroke",o):"strokeStyle"in r&&this._setColor(t,"stroke",a):this._setColor(t,"stroke",o||a),u&&c.setAttribute(pk.strokeOpacity,u),l&&c.setAttribute(pk.lineWidth,l))},e.prototype._setColor=function(t,e,r){var n=this.get("el");if(r)if(r=r.trim(),/^[r,R,L,l]{1}[\s]*\(/.test(r))(i=t.find("gradient",r))||(i=t.addGradient(r)),n.setAttribute(pk[e],"url(#"+i+")");else if(/^[p,P]{1}[\s]*\(/.test(r)){var i;(i=t.find("pattern",r))||(i=t.addPattern(r)),n.setAttribute(pk[e],"url(#"+i+")")}else n.setAttribute(pk[e],r);else n.setAttribute(pk[e],"none")},e.prototype.shadow=function(t,e){var r=this.attr(),n=e||r,i=n.shadowOffsetX,o=n.shadowOffsetY,a=n.shadowBlur,s=n.shadowColor;(i||o||a||s)&&function(t,e){var r=t.cfg.el,n=t.attr(),i={dx:n.shadowOffsetX,dy:n.shadowOffsetY,blur:n.shadowBlur,color:n.shadowColor};if(i.dx||i.dy||i.blur||i.color){var o=e.find("filter",i);o||(o=e.addShadow(i)),r.setAttribute("filter","url(#"+o+")")}else r.removeAttribute("filter")}(this,t)},e.prototype.transform=function(t){var e=this.attr();(t||e).matrix&&vk(this)},e.prototype.isInShape=function(t,e){return this.isPointInPath(t,e)},e.prototype.isPointInPath=function(t,e){var r=this.get("el"),n=this.get("canvas").get("el").getBoundingClientRect(),i=t+n.left,o=e+n.top,a=document.elementFromPoint(i,o);return!(!a||!a.isEqualNode(r))},e.prototype.getHitLineWidth=function(){var t=this.attrs,e=t.lineWidth,r=t.lineAppendWidth;return this.isStroke()?e+r:0},e}(kS.AbstractShape),_k=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="circle",e.canFill=!0,e.canStroke=!0,e}return(0,Gx.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{x:0,y:0,r:0})},e.prototype.createPath=function(t,e){var r=this.attr(),n=this.get("el");(0,Ux.each)(e||r,function(t,e){"x"===e||"y"===e?n.setAttribute("c"+e,t):pk[e]&&n.setAttribute(pk[e],t)})},e}(wk),Sk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dom",e.canFill=!1,e.canStroke=!1,e}return(0,Gx.__extends)(e,t),e.prototype.createPath=function(t,e){var r=this.attr(),n=this.get("el");if((0,Ux.each)(e||r,function(t,e){pk[e]&&n.setAttribute(pk[e],t)}),"function"==typeof r.html){var i=r.html.call(this,r);if(i instanceof Element||i instanceof HTMLDocument){for(var o=n.childNodes,a=o.length-1;a>=0;a--)n.removeChild(o[a]);n.appendChild(i)}else n.innerHTML=i}else n.innerHTML=r.html},e}(wk),Ek=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="ellipse",e.canFill=!0,e.canStroke=!0,e}return(0,Gx.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{x:0,y:0,rx:0,ry:0})},e.prototype.createPath=function(t,e){var r=this.attr(),n=this.get("el");(0,Ux.each)(e||r,function(t,e){"x"===e||"y"===e?n.setAttribute("c"+e,t):pk[e]&&n.setAttribute(pk[e],t)})},e}(wk),Ck=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="image",e.canFill=!1,e.canStroke=!1,e}return(0,Gx.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{x:0,y:0,width:0,height:0})},e.prototype.createPath=function(t,e){var r=this,n=this.attr(),i=this.get("el");(0,Ux.each)(e||n,function(t,e){"img"===e?r._setImage(n.img):pk[e]&&i.setAttribute(pk[e],t)})},e.prototype.setAttr=function(t,e){this.attrs[t]=e,"img"===t&&this._setImage(e)},e.prototype._setImage=function(t){var e=this.attr(),r=this.get("el");if((0,Ux.isString)(t))r.setAttribute("href",t);else if(t instanceof window.Image)e.width||(r.setAttribute("width",t.width),this.attr("width",t.width)),e.height||(r.setAttribute("height",t.height),this.attr("height",t.height)),r.setAttribute("href",t.src);else if(t instanceof HTMLElement&&(0,Ux.isString)(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase())r.setAttribute("href",t.toDataURL());else if(t instanceof ImageData){var n=document.createElement("canvas");n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.getContext("2d").putImageData(t,0,0),e.width||(r.setAttribute("width",""+t.width),this.attr("width",t.width)),e.height||(r.setAttribute("height",""+t.height),this.attr("height",t.height)),r.setAttribute("href",n.toDataURL())}},e}(wk),kk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="line",e.canFill=!1,e.canStroke=!0,e}return(0,Gx.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,e){var r=this.attr(),n=this.get("el");(0,Ux.each)(e||r,function(e,i){if("startArrow"===i||"endArrow"===i)if(e){var o=(0,Ux.isObject)(e)?t.addArrow(r,pk[i]):t.getDefaultArrow(r,pk[i]);n.setAttribute(pk[i],"url(#"+o+")")}else n.removeAttribute(pk[i]);else pk[i]&&n.setAttribute(pk[i],e)})},e.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,r=t.y1,n=t.x2,i=t.y2;return UC.N1.length(e,r,n,i)},e.prototype.getPoint=function(t){var e=this.attr(),r=e.x1,n=e.y1,i=e.x2,o=e.y2;return UC.N1.pointAt(r,n,i,o,t)},e}(wk),Ik={circle:function(t,e,r){return[["M",t,e],["m",-r,0],["a",r,r,0,1,0,2*r,0],["a",r,r,0,1,0,2*-r,0]]},square:function(t,e,r){return[["M",t-r,e-r],["L",t+r,e-r],["L",t+r,e+r],["L",t-r,e+r],["Z"]]},diamond:function(t,e,r){return[["M",t-r,e],["L",t,e-r],["L",t+r,e],["L",t,e+r],["Z"]]},triangle:function(t,e,r){var n=r*Math.sin(1/3*Math.PI);return[["M",t-r,e+n],["L",t,e-n],["L",t+r,e+n],["z"]]},triangleDown:function(t,e,r){var n=r*Math.sin(1/3*Math.PI);return[["M",t-r,e-n],["L",t+r,e-n],["L",t,e+n],["Z"]]}},Tk={get:function(t){return Ik[t]},register:function(t,e){Ik[t]=e},remove:function(t){delete Ik[t]},getAll:function(){return Ik}},Ok=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="marker",e.canFill=!0,e.canStroke=!0,e}return(0,Gx.__extends)(e,t),e.prototype.createPath=function(t){this.get("el").setAttribute("d",this._assembleMarker())},e.prototype._assembleMarker=function(){var t=this._getPath();return(0,Ux.isArray)(t)?t.map(function(t){return t.join(" ")}).join(""):t},e.prototype._getPath=function(){var t,e=this.attr(),r=e.x,n=e.y,i=e.r||e.radius,o=e.symbol||"circle";return(t=(0,Ux.isFunction)(o)?o:Tk.get(o))?t(r,n,i):(console.warn(t+" symbol is not exist."),null)},e.symbolsFactory=Tk,e}(wk),Mk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="path",e.canFill=!0,e.canStroke=!0,e}return(0,Gx.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,e){var r=this,n=this.attr(),i=this.get("el");(0,Ux.each)(e||n,function(e,o){if("path"===o&&(0,Ux.isArray)(e))i.setAttribute("d",r._formatPath(e));else if("startArrow"===o||"endArrow"===o)if(e){var a=(0,Ux.isObject)(e)?t.addArrow(n,pk[o]):t.getDefaultArrow(n,pk[o]);i.setAttribute(pk[o],"url(#"+a+")")}else i.removeAttribute(pk[o]);else pk[o]&&i.setAttribute(pk[o],e)})},e.prototype._formatPath=function(t){var e=t.map(function(t){return t.join(" ")}).join("");return~e.indexOf("NaN")?"":e},e.prototype.getTotalLength=function(){var t=this.get("el");return t?t.getTotalLength():null},e.prototype.getPoint=function(t){var e=this.get("el"),r=this.getTotalLength();if(0===r)return null;var n=e?e.getPointAtLength(t*r):null;return n?{x:n.x,y:n.y}:null},e}(wk),Pk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="polygon",e.canFill=!0,e.canStroke=!0,e}return(0,Gx.__extends)(e,t),e.prototype.createPath=function(t,e){var r=this.attr(),n=this.get("el");(0,Ux.each)(e||r,function(t,e){"points"===e&&(0,Ux.isArray)(t)&&t.length>=2?n.setAttribute("points",t.map(function(t){return t[0]+","+t[1]}).join(" ")):pk[e]&&n.setAttribute(pk[e],t)})},e}(wk),Lk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="polyline",e.canFill=!0,e.canStroke=!0,e}return(0,Gx.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{startArrow:!1,endArrow:!1})},e.prototype.onAttrChange=function(e,r,n){t.prototype.onAttrChange.call(this,e,r,n),-1!==["points"].indexOf(e)&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.createPath=function(t,e){var r=this.attr(),n=this.get("el");(0,Ux.each)(e||r,function(t,e){"points"===e&&(0,Ux.isArray)(t)&&t.length>=2?n.setAttribute("points",t.map(function(t){return t[0]+","+t[1]}).join(" ")):pk[e]&&n.setAttribute(pk[e],t)})},e.prototype.getTotalLength=function(){var t=this.attr().points,e=this.get("totalLength");return(0,Ux.isNil)(e)?(this.set("totalLength",UC.Ro.length(t)),this.get("totalLength")):e},e.prototype.getPoint=function(t){var e,r,n=this.attr().points,i=this.get("tCache");return i||(this._setTcache(),i=this.get("tCache")),(0,Ux.each)(i,function(n,i){t>=n[0]&&t<=n[1]&&(e=(t-n[0])/(n[1]-n[0]),r=i)}),UC.N1.pointAt(n[r][0],n[r][1],n[r+1][0],n[r+1][1],e)},e.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var e=this.getTotalLength();if(!(e<=0)){var r,n,i=0,o=[];(0,Ux.each)(t,function(a,s){t[s+1]&&((r=[])[0]=i/e,n=UC.N1.length(a[0],a[1],t[s+1][0],t[s+1][1]),i+=n,r[1]=i/e,o.push(r))}),this.set("tCache",o)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,r=[];return r.push([t[e-1][0],t[e-1][1]]),r.push([t[e][0],t[e][1]]),r},e}(wk);var Nk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="rect",e.canFill=!0,e.canStroke=!0,e}return(0,Gx.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.createPath=function(t,e){var r=this,n=this.attr(),i=this.get("el"),o=!1,a=["x","y","width","height","radius"];(0,Ux.each)(e||n,function(t,e){-1===a.indexOf(e)||o?-1===a.indexOf(e)&&pk[e]&&i.setAttribute(pk[e],t):(i.setAttribute("d",r._assembleRect(n)),o=!0)})},e.prototype._assembleRect=function(t){var e=t.x,r=t.y,n=t.width,i=t.height,o=t.radius;if(!o)return"M "+e+","+r+" l "+n+",0 l 0,"+i+" l"+-n+" 0 z";var a=function(t){var e=0,r=0,n=0,i=0;return(0,Ux.isArray)(t)?1===t.length?e=r=n=i=t[0]:2===t.length?(e=n=t[0],r=i=t[1]):3===t.length?(e=t[0],r=i=t[1],n=t[2]):(e=t[0],r=t[1],n=t[2],i=t[3]):e=r=n=i=t,{r1:e,r2:r,r3:n,r4:i}}(o);return(0,Ux.isArray)(o)?1===o.length?a.r1=a.r2=a.r3=a.r4=o[0]:2===o.length?(a.r1=a.r3=o[0],a.r2=a.r4=o[1]):3===o.length?(a.r1=o[0],a.r2=a.r4=o[1],a.r3=o[2]):(a.r1=o[0],a.r2=o[1],a.r3=o[2],a.r4=o[3]):a.r1=a.r2=a.r3=a.r4=o,[["M "+(e+a.r1)+","+r],["l "+(n-a.r1-a.r2)+",0"],["a "+a.r2+","+a.r2+",0,0,1,"+a.r2+","+a.r2],["l 0,"+(i-a.r2-a.r3)],["a "+a.r3+","+a.r3+",0,0,1,"+-a.r3+","+a.r3],["l "+(a.r3+a.r4-n)+",0"],["a "+a.r4+","+a.r4+",0,0,1,"+-a.r4+","+-a.r4],["l 0,"+(a.r4+a.r1-i)],["a "+a.r1+","+a.r1+",0,0,1,"+a.r1+","+-a.r1],["z"]].join(" ")},e}(wk),jk=r(3950),Rk={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},Dk={top:"text-before-edge",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",hanging:"hanging"},Bk={left:"left",start:"left",center:"middle",right:"end",end:"end"},Fk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="text",e.canFill=!0,e.canStroke=!0,e}return(0,Gx.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.createPath=function(t,e){var r=this,n=this.attr(),i=this.get("el");this._setFont(),(0,Ux.each)(e||n,function(t,e){"text"===e?r._setText(""+t):"matrix"===e&&t?vk(r):pk[e]&&i.setAttribute(pk[e],t)}),i.setAttribute("paint-order","stroke"),i.setAttribute("style","stroke-linecap:butt; stroke-linejoin:miter;")},e.prototype._setFont=function(){var t=this.get("el"),e=this.attr(),r=e.textBaseline,n=e.textAlign,i=(0,jk.o0)();i&&"firefox"===i.name?t.setAttribute("dominant-baseline",Dk[r]||"alphabetic"):t.setAttribute("alignment-baseline",Rk[r]||"baseline"),t.setAttribute("text-anchor",Bk[n]||"left")},e.prototype._setText=function(t){var e=this.get("el"),r=this.attr(),n=r.x,i=r.textBaseline,o=void 0===i?"bottom":i;if(t)if(~t.indexOf("\n")){var a=t.split("\n"),s=a.length-1,u="";(0,Ux.each)(a,function(t,e){0===e?"alphabetic"===o?u+=''+t+"":"top"===o?u+=''+t+"":"middle"===o?u+=''+t+"":"bottom"===o?u+=''+t+"":"hanging"===o&&(u+=''+t+""):u+=''+t+""}),e.innerHTML=u}else e.innerHTML=t;else e.innerHTML=""},e}(wk),zk=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Gk=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Uk=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function Hk(t){var e=t.match(Uk);if(!e)return"";var r="";return e.sort(function(t,e){return t=t.split(":"),e=e.split(":"),Number(t[0])-Number(e[0])}),(0,Ux.each)(e,function(t){t=t.split(":"),r+=''}),r}var Vk,Qk,Yk,Wk,qk=function(){function t(t){this.cfg={};var e,r,n,i,o,a,s,u=null,l=(0,Ux.uniqueId)("gradient_");return"l"===t.toLowerCase()[0]?function(t,e){var r,n,i=zk.exec(t),o=(0,Ux.mod)((0,Ux.toRadian)(parseFloat(i[1])),2*Math.PI),a=i[2];o>=0&&o<.5*Math.PI?(r={x:0,y:0},n={x:1,y:1}):.5*Math.PI<=o&&o';e.innerHTML=r},t}(),Zk=function(){function t(t,e){this.cfg={};var r=dk("marker"),n=(0,Ux.uniqueId)("marker_");r.setAttribute("id",n);var i=dk("path");i.setAttribute("stroke",t.stroke||"none"),i.setAttribute("fill",t.fill||"none"),r.appendChild(i),r.setAttribute("overflow","visible"),r.setAttribute("orient","auto-start-reverse"),this.el=r,this.child=i,this.id=n;var o=t["marker-start"===e?"startArrow":"endArrow"];return this.stroke=t.stroke||"#000",!0===o?this._setDefaultPath(e,i):(this.cfg=o,this._setMarker(t.lineWidth,i)),this}return t.prototype.match=function(){return!1},t.prototype._setDefaultPath=function(t,e){var r=this.el;e.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),r.setAttribute("refX",""+10*Math.cos(Math.PI/6)),r.setAttribute("refY","5")},t.prototype._setMarker=function(t,e){var r=this.el,n=this.cfg.path,i=this.cfg.d;(0,Ux.isArray)(n)&&(n=n.map(function(t){return t.join(" ")}).join("")),e.setAttribute("d",n),r.appendChild(e),i&&r.setAttribute("refX",""+i/t)},t.prototype.update=function(t){var e=this.child;e.attr?e.attr("fill",t):e.setAttribute("fill",t)},t}(),$k=function(){function t(t){this.type="clip",this.cfg={};var e=dk("clipPath");this.el=e,this.id=(0,Ux.uniqueId)("clip_"),e.id=this.id;var r=t.cfg.el;return e.appendChild(r),this.cfg=t,this}return t.prototype.match=function(){return!1},t.prototype.remove=function(){var t=this.el;t.parentNode.removeChild(t)},t}(),tI=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,eI=function(){function t(t){this.cfg={};var e=dk("pattern");e.setAttribute("patternUnits","userSpaceOnUse");var r=dk("image");e.appendChild(r);var n=(0,Ux.uniqueId)("pattern_");e.id=n,this.el=e,this.id=n,this.cfg=t;var i=tI.exec(t)[2];r.setAttribute("href",i);var o=new Image;function a(){e.setAttribute("width",""+o.width),e.setAttribute("height",""+o.height)}return i.match(/^data:/i)||(o.crossOrigin="Anonymous"),o.src=i,o.complete?a():(o.onload=a,o.src=o.src),this}return t.prototype.match=function(t,e){return this.cfg===e},t}(),rI=function(){function t(t){var e=dk("defs"),r=(0,Ux.uniqueId)("defs_");e.id=r,t.appendChild(e),this.children=[],this.defaultArrow={},this.el=e,this.canvas=t}return t.prototype.find=function(t,e){for(var r=this.children,n=null,i=0;i]*>/,Wk={tr:document.createElement("tbody"),tbody:Vk,thead:Vk,tfoot:Vk,td:Qk,th:Qk,"*":document.createElement("div")});var e=Yk.test(t)&&RegExp.$1;e&&e in Wk||(e="*");var r=Wk[e];t="string"==typeof t?t.replace(/(^\s*)|(\s*$)/g,""):t,r.innerHTML=""+t;var n=r.childNodes[0];return n&&r.contains(n)&&r.removeChild(n),n}var aI=r(2630),sI=r.n(aI);function uI(t){"@babel/helpers - typeof";return(uI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var lI=/^\s+/,cI=/\s+$/;function fI(t,e){if(t=t||"",e=e||{},t instanceof fI)return t;if(!(this instanceof fI))return new fI(t,e);var r=function(t){var e={r:0,g:0,b:0},r=1,n=null,i=null,o=null,a=!1,s=!1;"string"==typeof t&&(t=function(t){t=t.replace(lI,"").replace(cI,"").toLowerCase();var e,r=!1;if(II[t])t=II[t],r=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=GI.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=GI.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=GI.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=GI.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=GI.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=GI.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=GI.hex8.exec(t))return{r:LI(e[1]),g:LI(e[2]),b:LI(e[3]),a:DI(e[4]),format:r?"name":"hex8"};if(e=GI.hex6.exec(t))return{r:LI(e[1]),g:LI(e[2]),b:LI(e[3]),format:r?"name":"hex"};if(e=GI.hex4.exec(t))return{r:LI(e[1]+""+e[1]),g:LI(e[2]+""+e[2]),b:LI(e[3]+""+e[3]),a:DI(e[4]+""+e[4]),format:r?"name":"hex8"};if(e=GI.hex3.exec(t))return{r:LI(e[1]+""+e[1]),g:LI(e[2]+""+e[2]),b:LI(e[3]+""+e[3]),format:r?"name":"hex"};return!1}(t));"object"==uI(t)&&(UI(t.r)&&UI(t.g)&&UI(t.b)?(u=t.r,l=t.g,c=t.b,e={r:255*MI(u,255),g:255*MI(l,255),b:255*MI(c,255)},a=!0,s="%"===String(t.r).substr(-1)?"prgb":"rgb"):UI(t.h)&&UI(t.s)&&UI(t.v)?(n=jI(t.s),i=jI(t.v),e=function(t,e,r){t=6*MI(t,360),e=MI(e,100),r=MI(r,100);var n=Math.floor(t),i=t-n,o=r*(1-e),a=r*(1-i*e),s=r*(1-(1-i)*e),u=n%6;return{r:255*[r,a,o,o,s,r][u],g:255*[s,r,r,a,o,o][u],b:255*[o,o,s,r,r,a][u]}}(t.h,n,i),a=!0,s="hsv"):UI(t.h)&&UI(t.s)&&UI(t.l)&&(n=jI(t.s),o=jI(t.l),e=function(t,e,r){var n,i,o;function a(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=MI(t,360),e=MI(e,100),r=MI(r,100),0===e)n=i=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,u=2*r-s;n=a(u,s,t+1/3),i=a(u,s,t),o=a(u,s,t-1/3)}return{r:255*n,g:255*i,b:255*o}}(t.h,n,o),a=!0,s="hsl"),t.hasOwnProperty("a")&&(r=t.a));var u,l,c;return r=OI(r),{ok:a,format:t.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}function hI(t,e,r){t=MI(t,255),e=MI(e,255),r=MI(r,255);var n,i,o=Math.max(t,e,r),a=Math.min(t,e,r),s=(o+a)/2;if(o==a)n=i=0;else{var u=o-a;switch(i=s>.5?u/(2-o-a):u/(o+a),o){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,o.push(fI(n));return o}function kI(t,e){e=e||6;for(var r=fI(t).toHsv(),n=r.h,i=r.s,o=r.v,a=[],s=1/e;e--;)a.push(fI({h:n,s:i,v:o})),o=(o+s)%1;return a}fI.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,n=this.toRgb();return t=n.r/255,e=n.g/255,r=n.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=OI(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=pI(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=pI(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=hI(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=hI(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return dI(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[NI(Math.round(t).toString(16)),NI(Math.round(e).toString(16)),NI(Math.round(r).toString(16)),NI(RI(n))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*MI(this._r,255))+"%",g:Math.round(100*MI(this._g,255))+"%",b:Math.round(100*MI(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*MI(this._r,255))+"%, "+Math.round(100*MI(this._g,255))+"%, "+Math.round(100*MI(this._b,255))+"%)":"rgba("+Math.round(100*MI(this._r,255))+"%, "+Math.round(100*MI(this._g,255))+"%, "+Math.round(100*MI(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(TI[dI(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+yI(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=fI(t);r="#"+yI(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return fI(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(bI,arguments)},brighten:function(){return this._applyModification(AI,arguments)},darken:function(){return this._applyModification(xI,arguments)},desaturate:function(){return this._applyModification(gI,arguments)},saturate:function(){return this._applyModification(vI,arguments)},greyscale:function(){return this._applyModification(mI,arguments)},spin:function(){return this._applyModification(wI,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(CI,arguments)},complement:function(){return this._applyCombination(_I,arguments)},monochromatic:function(){return this._applyCombination(kI,arguments)},splitcomplement:function(){return this._applyCombination(EI,arguments)},triad:function(){return this._applyCombination(SI,[3])},tetrad:function(){return this._applyCombination(SI,[4])}},fI.fromRatio=function(t,e){if("object"==uI(t)){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:jI(t[n]));t=r}return fI(t,e)},fI.equals=function(t,e){return!(!t||!e)&&fI(t).toRgbString()==fI(e).toRgbString()},fI.random=function(){return fI.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},fI.mix=function(t,e,r){r=0===r?0:r||50;var n=fI(t).toRgb(),i=fI(e).toRgb(),o=r/100;return fI({r:(i.r-n.r)*o+n.r,g:(i.g-n.g)*o+n.g,b:(i.b-n.b)*o+n.b,a:(i.a-n.a)*o+n.a})},fI.readability=function(t,e){var r=fI(t),n=fI(e);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},fI.isReadable=function(t,e,r){var n,i,o=fI.readability(t,e);switch(i=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},fI.mostReadable=function(t,e,r){var n,i,o,a,s=null,u=0;i=(r=r||{}).includeFallbackColors,o=r.level,a=r.size;for(var l=0;lu&&(u=n,s=fI(e[l]));return fI.isReadable(t,s,{level:o,size:a})||!i?s:(r.includeFallbackColors=!1,fI.mostReadable(t,["#fff","#000"],r))};var II=fI.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},TI=fI.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(II);function OI(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function MI(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var r=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function PI(t){return Math.min(1,Math.max(0,t))}function LI(t){return parseInt(t,16)}function NI(t){return 1==t.length?"0"+t:""+t}function jI(t){return t<=1&&(t=100*t+"%"),t}function RI(t){return Math.round(255*parseFloat(t)).toString(16)}function DI(t){return LI(t)/255}var BI,FI,zI,GI=(FI="[\\s|\\(]+("+(BI="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+BI+")[,|\\s]+("+BI+")\\s*\\)?",zI="[\\s|\\(]+("+BI+")[,|\\s]+("+BI+")[,|\\s]+("+BI+")[,|\\s]+("+BI+")\\s*\\)?",{CSS_UNIT:new RegExp(BI),rgb:new RegExp("rgb"+FI),rgba:new RegExp("rgba"+zI),hsl:new RegExp("hsl"+FI),hsla:new RegExp("hsla"+zI),hsv:new RegExp("hsv"+FI),hsva:new RegExp("hsva"+zI),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function UI(t){return!!GI.CSS_UNIT.exec(t)}var HI=2,VI=.16,QI=.05,YI=.05,WI=.15,qI=5,XI=4,KI=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function JI(t,e,r){var n;return(n=Math.round(t.h)>=60&&Math.round(t.h)<=240?r?Math.round(t.h)-HI*e:Math.round(t.h)+HI*e:r?Math.round(t.h)+HI*e:Math.round(t.h)-HI*e)<0?n+=360:n>=360&&(n-=360),n}function ZI(t,e,r){return 0===t.h&&0===t.s?t.s:((n=r?t.s-VI*e:e===XI?t.s+VI:t.s+QI*e)>1&&(n=1),r&&e===qI&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2)));var n}function $I(t,e,r){var n;return(n=r?t.v+YI*e:t.v-WI*e)>1&&(n=1),Number(n.toFixed(2))}function tT(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[],n=fI(t),i=qI;i>0;i-=1){var o=n.toHsv(),a=fI({h:JI(o,i,!0),s:ZI(o,i,!0),v:$I(o,i,!0)}).toHexString();r.push(a)}r.push(n.toHexString());for(var s=1;s<=XI;s+=1){var u=n.toHsv(),l=fI({h:JI(u,s),s:ZI(u,s),v:$I(u,s)}).toHexString();r.push(l)}return"dark"===e.theme?KI.map(function(t){var n=t.index,i=t.opacity;return fI.mix(e.backgroundColor||"#141414",r[n],100*i).toHexString()}):r}var eT={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},rT={},nT={};Object.keys(eT).forEach(function(t){rT[t]=tT(eT[t]),rT[t].primary=rT[t][5],nT[t]=tT(eT[t],{theme:"dark",backgroundColor:"#141414"}),nT[t].primary=nT[t][5]});rT.red,rT.volcano,rT.gold,rT.orange,rT.yellow,rT.lime,rT.green,rT.cyan,rT.blue,rT.geekblue,rT.purple,rT.magenta,rT.grey;var iT=function(t,e,r){var n=sI()(t),i=sI()(e);return sI()([(1-r)*n.red()+r*i.red(),(1-r)*n.green()+r*i.green(),(1-r)*n.blue()+r*i.blue()]).rgb()},oT=function(t,e,r,n){return void 0===e&&(e="#fff"),void 0===r&&(r="default"),void 0===n&&(n="rgb(150, 150, 150)"),"default"===r?function(t,e,r){void 0===e&&(e="#fff"),void 0===r&&(r="rgb(150, 150, 150)");var n=iT(e,t,.05).rgb().toString(),i=iT(e,t,.1).rgb().toString(),o=iT(e,t,.2).rgb().toString(),a=iT(e,t,.4).rgb().toString(),s=iT(e,r,.02).rgb().toString(),u=iT(e,r,.05).rgb().toString(),l=iT(e,r,.1).rgb().toString(),c=iT(e,r,.2).rgb().toString(),f=iT(e,r,.3).rgb().toString(),h=tT(t,{theme:"default",backgroundColor:e}),p=sI()(t).hex().toLowerCase(),d=h.indexOf(p),y=t;return-1!==d&&(y=h[d+1]),{mainStroke:t,mainFill:i,activeStroke:t,activeFill:n,inactiveStroke:a,inactiveFill:n,selectedStroke:t,selectedFill:e,highlightStroke:y,highlightFill:o,disableStroke:f,disableFill:u,edgeMainStroke:f,edgeActiveStroke:t,edgeInactiveStroke:c,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:l,comboMainStroke:f,comboMainFill:s,comboActiveStroke:t,comboActiveFill:n,comboInactiveStroke:f,comboInactiveFill:s,comboSelectedStroke:t,comboSelectedFill:s,comboHighlightStroke:y,comboHighlightFill:s,comboDisableStroke:c,comboDisableFill:u}}(t,e,"rgb(150, 150, 150)"):function(t,e,r){void 0===e&&(e="#fff"),void 0===r&&(r="#777");var n=iT(e,t,.2).rgb().toString(),i=iT(e,t,.3).rgb().toString(),o=iT(e,t,.6).rgb().toString(),a=iT(e,t,.8).rgb().toString(),s=iT(e,r,.2).rgb().toString(),u=iT(e,r,.25).rgb().toString(),l=iT(e,r,.3).rgb().toString(),c=iT(e,r,.4).rgb().toString(),f=iT(e,r,.5).rgb().toString(),h=tT(t,{theme:"dark",backgroundColor:e}),p=sI()(t).hex().toLowerCase(),d=h.indexOf(p),y=t;return-1!==d&&(y=h[d+1]),{mainStroke:a,mainFill:n,activeStroke:t,activeFill:i,inactiveStroke:a,inactiveFill:n,selectedStroke:t,selectedFill:n,highlightStroke:t,highlightFill:o,disableStroke:f,disableFill:u,edgeMainStroke:r,edgeActiveStroke:t,edgeInactiveStroke:r,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:l,comboMainStroke:c,comboMainFill:u,comboActiveStroke:t,comboActiveFill:s,comboInactiveStroke:c,comboInactiveFill:u,comboSelectedStroke:t,comboSelectedFill:s,comboHighlightStroke:y,comboHighlightFill:u,comboDisableStroke:c,comboDisableFill:s}}(t,e,"#777")},aT=function(t,e,r,n){void 0===e&&(e="#fff"),void 0===r&&(r="default"),void 0===n&&(n="rgb(150, 150, 150)");var i=[];return t.forEach(function(t){i.push(oT(t,e,r,n))}),i},sT=oT("rgb(95, 149, 255)","rgb(255, 255, 255)"),uT={version:"0.8.23",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:sT.mainStroke,fill:sT.mainFill},size:20,color:sT.mainStroke,linkPoints:{size:8,lineWidth:1,fill:sT.activeFill,stroke:sT.activeStroke}},nodeStateStyles:{active:{fill:sT.activeFill,stroke:sT.activeStroke,lineWidth:2,shadowColor:sT.mainStroke,shadowBlur:10},selected:{fill:sT.selectedFill,stroke:sT.selectedStroke,lineWidth:4,shadowColor:sT.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:sT.highlightFill,stroke:sT.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:sT.inactiveFill,stroke:sT.inactiveStroke,lineWidth:1},disable:{fill:sT.disableFill,stroke:sT.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:"rgb(0, 0, 0)",textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:sT.edgeMainStroke,lineAppendWidth:2},color:sT.edgeMainStroke},edgeStateStyles:{active:{stroke:sT.edgeActiveStroke,lineWidth:1},selected:{stroke:sT.edgeSelectedStroke,lineWidth:2,shadowColor:sT.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:sT.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:sT.edgeInactiveStroke,lineWidth:1},disable:{stroke:sT.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:"rgb(0, 0, 0)",textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:sT.comboMainFill,lineWidth:1,stroke:sT.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:sT.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:sT.comboActiveStroke,lineWidth:1,fill:sT.comboActiveFill},selected:{stroke:sT.comboSelectedStroke,lineWidth:2,fill:sT.comboSelectedFill,shadowColor:sT.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:sT.comboHighlightStroke,lineWidth:2,fill:sT.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:sT.comboInactiveStroke,fill:sT.comboInactiveFill,lineWidth:1},disable:{stroke:sT.comboDisableStroke,fill:sT.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},textWaterMarkerConfig:{width:150,height:100,compatible:!1,text:{x:0,y:60,lineHeight:20,rotate:20,fontSize:14,fontFamily:"Microsoft YaHei",fill:"rgba(0, 0, 0, 0.1)",baseline:"Middle"}},imageWaterMarkerConfig:{width:150,height:130,compatible:!1,image:{x:0,y:0,width:30,height:20,rotate:0}},waterMarkerImage:"https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg"},lT=function t(e,r){var n;e.isGroup()&&r.isGroup()&&(null===(n=e.get("children"))||void 0===n||n.forEach(function(e,n){var i=r.get("children")[n];t(e,i)}));var i=e.get("type"),o=r.get("type");if("image"===i&&"image"===o){var a=e.get("clipShape");a&&r.setClip({type:a.get("type"),attrs:a.attr()})}};function cT(t,e,r){if(t){if("function"==typeof t.addEventListener)return t.addEventListener(e,r,!1),{remove:function(){t.removeEventListener(e,r,!1)}};if("function"==typeof t.attachEvent)return t.attachEvent("on"+e,r),{remove:function(){t.detachEvent("on"+e,r)}}}}var fT=WE.cloneEvent,hT=WE.isViewportChanged,pT=function(t){function e(e){var r=t.call(this,e)||this;return r.extendEvents=[],r.dragging=!1,r.mousedown=!1,r.preItem=null,r.destroy(),r.graph=e,r.destroyed=!1,r.initEvents(),r}return(0,Gx.__extends)(e,t),e.prototype.initEvents=function(){var t=this.graph,e=this.extendEvents,r=void 0===e?[]:e,n=t.get("canvas"),i=n.get("el"),o=(0,Ux.wrapBehavior)(this,"onCanvasEvents"),a=(0,Ux.wrapBehavior)(this,"onExtendEvents"),s=(0,Ux.wrapBehavior)(this,"onWheelEvent");n.off("*").on("*",o),this.canvasHandler=o,r.push(cT(i,"wheel",s)),"undefined"!=typeof window&&(r.push(cT(window,"keydown",a)),r.push(cT(window,"keyup",a)),r.push(cT(window,"focus",a))),this.resetHandler&&t.off("afterchangedata",this.resetHandler),this.resetHandler=(0,Ux.wrapBehavior)(this,"resetStatus"),t.on("afterchangedata",this.resetHandler)},e.getItemRoot=function(t){for(;t&&!t.get("item");)t=t.get("parent");return t},e.prototype.onCanvasEvents=function(t){var r=this,n=this.graph,i=n.get("canvas"),o=t.target,a=t.type;switch(a){case"drag":this.onCanvasEvents(Object.assign({},t,{type:"mousemove"}));break;case"dragend":this.onCanvasEvents(Object.assign({},t,{type:"mouseup"}));break;case"mousedown":this.mousedown=!0;break;case"mouseup":setTimeout(function(){return r.mousedown=!1});break;case"click":if(!this.mousedown)return}t.canvasX=t.x,t.canvasY=t.y;var s={x:t.canvasX,y:t.canvasY},u=n.get("group").getMatrix();if(u||(u=[1,0,0,0,1,0,0,0,1]),hT(u)&&(s=n.getPointByClient(t.clientX,t.clientY)),t.x=s.x,t.y=s.y,t.currentTarget=n,o===i)return"mousemove"!==a&&"mouseleave"!==a||this.handleMouseMove(t,"canvas"),t.target=i,t.item=null,n.emit(a,t),void n.emit("canvas:".concat(a),t);var l=e.getItemRoot(o);if(l){var c=l.get("item");if(!c.destroyed){var f=c.getType();if(t.target=o,t.item=c,t.canvasX===t.x&&t.canvasY===t.y){var h=n.getCanvasByPoint(t.x,t.y);t.canvasX=h.x,t.canvasY=h.y}t.name&&!t.name.includes(":")?(n.emit("".concat(f,":").concat(a),t),n.emit(a,t)):t.name&&n.emit(t.name,t),"dragstart"===a&&(this.dragging=!0),"dragend"===a&&(this.dragging=!1),"mousemove"===a&&this.handleMouseMove(t,f)}}else n.emit(a,t)},e.prototype.onExtendEvents=function(t){this.graph.emit(t.type,t)},e.prototype.onWheelEvent=function(t){(0,Ux.isNil)(t.wheelDelta)&&(t.wheelDelta=-t.detail),this.graph.emit("wheel",t)},e.prototype.handleMouseMove=function(t,e){var r=this.graph,n=this.preItem,i=r.get("canvas"),o=t.target===i?null:t.item;t=fT(t),n&&n!==o&&!n.destroyed&&(t.item=n,this.emitCustomEvent(n.getType(),"mouseleave",t),this.dragging&&this.emitCustomEvent(n.getType(),"dragleave",t)),o&&n!==o&&(t.item=o,this.emitCustomEvent(e,"mouseenter",t),this.dragging&&this.emitCustomEvent(e,"dragenter",t)),this.preItem=o},e.prototype.emitCustomEvent=function(t,e,r){r.type=e,this.graph.emit("".concat(t,":").concat(e),r)},e.prototype.resetStatus=function(){this.mousedown=!1,this.dragging=!1,this.preItem=null},e.prototype.destroy=function(){var t=this.graph,e=this.canvasHandler,r=this.extendEvents;t.get("canvas").off("*",e),(0,Ux.each)(r,function(t){t.remove()}),this.resetStatus(),this.extendEvents.length=0,this.canvasHandler=null,this.resetHandler=null,this.destroyed=!0},e}(XE),dT=r(9015),yT=r(6144),gT=r.n(yT),vT=WE.traverseTree,mT=function(t,e){return t?(0,Ux.isNumber)(t)?function(e){return t}:t:function(t){return e||1}},bT=function(t,e){var r=[],n=[],i={},o=0;for(o=0;o=0&&(o="x",i="y");var a=0;vT(t,function(t){return a++,t.x>n.x&&(n.x=t.x),t.xn.y&&(n.y=t.y),t.yWebGL.
    ','Find out how to get it here.'].join("\n"):['Your browser does not seem to support WebGL.
    ','Find out how to get it here.'].join("\n")),t},addGetWebGLMessage:function(e){var r=void 0!==(e=e||{}).parent?e.parent:document.body,n=void 0!==e.id?e.id:"oldie",i=t().getWebGLErrorMessage();i.id=n,r.appendChild(i)}}},CT=function(){var t=navigator.userAgent.toLowerCase();return t.indexOf("firefox")>-1?"firefox":t.indexOf("safari")>-1?"safari":t.indexOf("opr")>-1?"opera":t.indexOf("chrome")>-1?"chrome":t.indexOf("trident")>-1?"ie 11":t.indexOf("ie")>-1?"ie":"unknown"},kT=(0,Gx.__assign)((0,Gx.__assign)((0,Gx.__assign)((0,Gx.__assign)((0,Gx.__assign)({},WE),d),y),g),v),IT=kT.radialLayout,TT=function(){function t(t){this.type=t.type,this.radial=t.radial,this.config=t}return t.prototype.init=function(t){var e=this;this.data=t,this.radial?this.layoutMethod=function(t){var r=gT()[e.type](t,e.config);return IT(r),r}:this.layoutMethod=function(t){return gT()[e.type](t,e.config)}},t.prototype.execute=function(){return this.layoutMethod(this.data,this.config)},t.prototype.layout=function(t){return this.init(t),this.execute()},t}();(0,dT.registerLayout)("grid",dT.GridLayout),(0,dT.registerLayout)("random",dT.RandomLayout),(0,dT.registerLayout)("force",dT.ForceLayout),(0,dT.registerLayout)("circular",dT.CircularLayout),(0,dT.registerLayout)("dagre",dT.DagreLayout),(0,dT.registerLayout)("dagreCompound",dT.DagreCompoundLayout),(0,dT.registerLayout)("radial",dT.RadialLayout),(0,dT.registerLayout)("concentric",dT.ConcentricLayout),(0,dT.registerLayout)("mds",dT.MDSLayout),(0,dT.registerLayout)("fruchterman",dT.FruchtermanLayout),(0,dT.registerLayout)("fruchterman-gpu",dT.FruchtermanGPULayout),(0,dT.registerLayout)("gForce",dT.GForceLayout),(0,dT.registerLayout)("force2",dT.Force2Layout),(0,dT.registerLayout)("gForce-gpu",dT.GForceGPULayout),(0,dT.registerLayout)("comboForce",dT.ComboForceLayout),(0,dT.registerLayout)("comboCombined",dT.ComboCombinedLayout),(0,dT.registerLayout)("forceAtlas2",dT.ForceAtlas2Layout);var OT=function(){return function(t,e){var r=t.toString(),n=new Blob(["importScripts('".concat(e,"');(").concat(r,")()")],{type:"text/javascript"});return new Worker(URL.createObjectURL(n))}}(),MT=function(t){return void 0===t&&(t="https://unpkg.com/@antv/layout@0.3.23/dist/layout.min.js"),new OT(function(){var t={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};layout.registerLayout("grid",layout.GridLayout),layout.registerLayout("random",layout.RandomLayout),layout.registerLayout("force",layout.ForceLayout),layout.registerLayout("force2",layout.Force2Layout),layout.registerLayout("circular",layout.CircularLayout),layout.registerLayout("dagre",layout.DagreLayout),layout.registerLayout("dagreCompound",layout.DagreCompoundLayout),layout.registerLayout("radial",layout.RadialLayout),layout.registerLayout("concentric",layout.ConcentricLayout),layout.registerLayout("mds",layout.MDSLayout),layout.registerLayout("fruchterman",layout.FruchtermanLayout),layout.registerLayout("fruchterman-gpu",layout.FruchtermanGPULayout),layout.registerLayout("gForce",layout.GForceLayout),layout.registerLayout("gForce-gpu",layout.GForceGPULayout),layout.registerLayout("comboForce",layout.ComboForceLayout),layout.registerLayout("comboCombined",layout.ComboCombinedLayout),layout.registerLayout("forceAtlas2",layout.ForceAtlas2Layout),onmessage=function(e){(function(e){var r=e.data.type;return r===t.RUN||r===t.GPURUN})(e)&&function(e){var r=this;switch(e.data.type){case t.RUN:var n,i=e.data,o=i.nodes,a=i.edges,s=i.layoutCfg,u=(p=void 0===s?{}:s).type;if(!(l=layout.getLayoutByName(u))){this.postMessage({type:t.ERROR,message:"layout ".concat(u," not found")});break}p.onLayoutEnd=function(){r.postMessage({type:t.END,nodes:o}),null===n||void 0===n||n.destroy()},(n=new l(p)).init({nodes:o,edges:a}),n.execute();break;case t.GPURUN:var l,c=e.data,f=c.nodes,h=(a=c.edges,c.layoutCfg),p=void 0===h?{}:h,d=c.canvas;if(u=p.type,!(l=layout.getLayoutByName(u))){this.postMessage({type:t.ERROR,message:"layout ".concat(u," not found")});break}if("gpu"!==u.split("-")[1]){this.postMessage({type:t.ERROR,message:"layout ".concat(u," does not support GPU")});break}var y=new l(p);y.init({nodes:f,edges:a}),y.executeWithWorker(d,this)}}(e)}},t)},PT="LAYOUT_RUN",LT="LAYOUT_END",NT="LAYOUT_ERROR",jT="LAYOUT_TICK",RT="GPU_LAYOUT_RUN",DT="GPU_LAYOUT_END";function BT(t){"@babel/helpers - typeof";return(BT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var FT=function(t){return setTimeout(t,16)},zT=function(t){return clearTimeout(t)},GT=function(t){return("undefined"!=typeof window&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame)||FT)(t)},UT=function(t){return("undefined"!=typeof window&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame)||zT)(t)},HT=["fruchterman","gForce"],VT=["force","grid","circular"],QT=function(t){function e(e){var r=t.call(this,e)||this;return r.graph=e,r.layoutCfg=e.get("layout")||{},r.layoutType=r.getLayoutType(),r.worker=null,r.workerData={},r.initLayout(),r}return(0,Gx.__extends)(e,t),e.prototype.initLayout=function(){},e.prototype.getWorker=function(){return this.worker?this.worker:("undefined"==typeof Worker?(console.warn("Web worker is not supported in current browser."),this.worker=null):this.worker=MT(this.layoutCfg.workerScriptURL),this.worker)},e.prototype.stopWorker=function(){var t=this.workerData;this.worker&&(this.worker.terminate(),this.worker=null,t.requestId&&(UT(t.requestId),t.requestId=null),t.requestId2&&(UT(t.requestId2),t.requestId2=null))},e.prototype.execLayoutMethod=function(t,e){var r=this;return new Promise(function(n,i){return(0,Gx.__awaiter)(r,void 0,void 0,function(){var r,o,a,s,u,l,c,f,h;return(0,Gx.__generator)(this,function(p){switch(p.label){case 0:if(!(r=this.graph)||r.get("destroyed"))return[2];o=t.type,t.onLayoutEnd=function(){r.emit("aftersublayout",{type:o}),n()},o&&this.isGPU&&(WT(o)?o="".concat(o,"-gpu"):console.warn("The '".concat(o,"' layout does not support GPU calculation for now, it will run in CPU."))),WE.isForce(o)?(a=t.onTick,s=t.animate,u=void 0===s&&("force"===o||"force2"===o),f=function(){a&&a(),(s||u)&&r.refreshPositions()},t.tick=f):"comboForce"!==o&&"comboCombined"!==o||(t.comboTrees=r.get("comboTrees")),!1;try{l=new dT.Layouts[o](t),this.layoutMethods[e]&&this.layoutMethods[e].destroy(),this.layoutMethods[e]=l}catch(t){console.warn("The layout method: '".concat(o,"' does not exist! Please specify it first.")),i()}return l.enableTick&&(c=t.onTick,f=function(){c&&c(),r.refreshPositions()},l.tick=f),function(t,e){var r;if(!(null===(r=null===t||void 0===t?void 0:t.nodes)||void 0===r?void 0:r.length))return;t.nodes.forEach(function(t){t.layoutOrder=e})}(h=this.filterLayoutData(this.data,t),e),l.init(h),r.emit("beforesublayout",{type:o}),[4,l.execute()];case 1:return p.sent(),l.isCustomLayout&&t.onLayoutEnd&&t.onLayoutEnd(),[2]}})})})},e.prototype.updateLayoutMethod=function(t,e){var r=this;return new Promise(function(n,i){return(0,Gx.__awaiter)(r,void 0,void 0,function(){var r,i,o,a,s,u,l;return(0,Gx.__generator)(this,function(c){switch(c.label){case 0:return r=this.graph,i=null===e||void 0===e?void 0:e.type,e.onLayoutEnd=function(){r.emit("aftersublayout",{type:i}),n()},WE.isForce(i)&&(o=e.onTick,a=e.animate,s=void 0===a&&("force"===i||"force2"===i),u=function(){null===o||void 0===o||o(),(a||s)&&r.refreshPositions()},e.tick=u),l=this.filterLayoutData(this.data,e),t.init(l),t.updateCfg(e),r.emit("beforesublayout",{type:i}),[4,t.execute()];case 1:return c.sent(),t.isCustomLayout&&e.onLayoutEnd&&e.onLayoutEnd(),[2]}})})})},e.prototype.layout=function(t){var e,r=this,n=this.graph;if(n&&!n.get("destroyed")){this.data=this.setDataFromGraph();var i=this.data,o=i.nodes,a=i.hiddenNodes;if(!o)return!1;var s=n.get("width"),u=n.get("height"),l={};Object.assign(l,{width:s,height:u,center:[s/2,u/2]},this.layoutCfg),this.layoutCfg=l;var c=l.type,f=!1;null===(e=this.layoutMethods)||void 0===e||e.forEach(function(t){var e;return f=!!(null===(e=t.nodes)||void 0===e?void 0:e.length)||f});var h=this.destoryLayoutMethods();n.emit("beforelayout");var p=Promise.resolve();f&&c&&1===(null===h||void 0===h?void 0:h.length)&&h[0]===c?this.tweakInit():p=this.initPositions(l.center,o),this.initPositions(l.center,a).then(),this.isGPU=qT(l,c);var d=l.onLayoutEnd,y=l.layoutEndFormatted,g=l.adjust;if(y||(l.layoutEndFormatted=!0,l.onAllLayoutEnd=function(){return(0,Gx.__awaiter)(r,void 0,void 0,function(){return(0,Gx.__generator)(this,function(t){switch(t.label){case 0:return d&&d(o),this.refreshLayout(),g&&l.pipes?[4,this.adjustPipesBox(this.data,g)]:[3,2];case 1:t.sent(),this.refreshLayout(),t.label=2;case 2:return n.emit("afterlayout"),[2]}})})}),this.stopWorker(),l.workerEnabled&&this.layoutWithWorker(this.data,t))return!0;var v=!1;return l.type?(v=!0,p=p.then(function(){return(0,Gx.__awaiter)(r,void 0,void 0,function(){return(0,Gx.__generator)(this,function(t){switch(t.label){case 0:return[4,this.execLayoutMethod(l,0)];case 1:return[2,t.sent()]}})})})):l.pipes&&(v=!0,l.pipes.forEach(function(t,e){p=p.then(function(){return(0,Gx.__awaiter)(r,void 0,void 0,function(){return(0,Gx.__generator)(this,function(r){switch(r.label){case 0:return[4,this.execLayoutMethod(t,e)];case 1:return[2,r.sent()]}})})})})),v?p.then(function(){l.onAllLayoutEnd&&l.onAllLayoutEnd(),t&&t()}).catch(function(t){console.warn("graph layout failed,",t)}):(n.refreshPositions(),null===t||void 0===t||t()),!1}},e.prototype.tweakInit=function(){var t=this.data,e=this.graph,r=t.nodes,n=t.edges;if(null===r||void 0===r?void 0:r.length){var i={};r.forEach(function(t){var e=t.x,r=t.y;isNaN(e)||isNaN(r)||(i[t.id]={x:e,y:r},t.mass=t.mass||2)}),n.forEach(function(t){var e=t.source,r=t.target,n=i[e],o=i[r];!n&&o?i[e]={x:o.x+80*(Math.random()-.5),y:o.y+80*(Math.random()-.5)}:!o&&n&&(i[r]={x:n.x+80*(Math.random()-.5),y:n.y+80*(Math.random()-.5)})});var o=e.get("width"),a=e.get("height");r.forEach(function(t){var e=i[t.id]||{x:o/2+20*(Math.random()-.5),y:a/2+20*(Math.random()-.5)};t.x=e.x,t.y=e.y})}},e.prototype.initWithPreset=function(t,e){var r=this;return new Promise(function(n,i){return(0,Gx.__awaiter)(r,void 0,void 0,function(){var r,i,o,a,s,u,l;return(0,Gx.__generator)(this,function(c){switch(c.label){case 0:return i=(r=this).layoutCfg,o=r.data,(null===(a=i.preset)||void 0===a?void 0:a.type)&&dT.Layouts[null===a||void 0===a?void 0:a.type]?(s=qT(a,a.type),u=s?"".concat(a.type,"-gpu"):a.type,l=new dT.Layouts[u](a),delete i.preset,l.init(o),[4,l.execute()]):(null===e||void 0===e||e(),n(),[2,!1]);case 1:return c.sent(),null===t||void 0===t||t(),n(),[2,!0]}})})})},e.prototype.layoutWithWorker=function(t,e){var r=this,n=this.layoutCfg,i=this.graph,o=this.getWorker(),a=this.workerData;if(!o)return!1;a.requestId=null,a.requestId2=null,a.currentTick=null,a.currentTickData=null,i.emit("beforelayout");var s=Promise.resolve(),u=!1;if(n.type)u=!0,s=s.then(function(){return r.runWebworker(o,t,n)});else if(n.pipes){u=!0;for(var l=function(e){s=s.then(function(){return r.runWebworker(o,t,e)})},c=0,f=n.pipes;c'),u=r?r.backgroundColor:void 0,l=r?r.padding:void 0;l?(0,Ux.isNumber)(l)&&(l=[l,l,l,l]):l=[0,0,0,0];var c=i+l[0]+l[2],f=o+l[1]+l[3],h={container:s,height:c,width:f,quickHit:!0},p="svg"===a?new nI(h):new ck(h),d=this.get("group").clone(),y=(0,Ux.clone)(d.getMatrix());y||(y=[1,0,0,0,1,0,0,0,1]);var g=(n.maxX+n.minX)/2,v=(n.maxY+n.minY)/2;y=XT(y,[["t",-g,-v],["t",o/2+l[3],i/2+l[0]]]),d.resetMatrix(),d.setMatrix(y),p.add(d);var m=p.get("el"),b="";e||(e="image/png"),setTimeout(function(){if("svg"===a){var r=m.cloneNode(!0),n=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),i=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",n);i.replaceChild(r,i.documentElement);var o=(new XMLSerializer).serializeToString(i);b="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(o))}else{var s=void 0,l=m.getContext("2d"),h=void 0;if(u){var p="undefined"!=typeof window?window.devicePixelRatio:1;try{s=l.getImageData(0,0,f*p,c*p),h=l.globalCompositeOperation,l.globalCompositeOperation="destination-over",l.fillStyle=u,l.fillRect(0,0,f,c)}catch(t){console.error("Download image failed. Out of memory at ImageData creation")}}b=m.toDataURL(e),u&&(l.clearRect(0,0,f,c),l.putImageData(s,0,0),l.globalCompositeOperation=h)}t&&t(b)},16)},e.prototype.downloadFullImage=function(t,e,r){var n=this,i=this.get("group").getCanvasBBox(),o=i.height,a=i.width,s=this.get("renderer"),u=oI('
    '),l=document.querySelector(".g6-graph-watermarker"),c=r?r.backgroundColor:void 0,f=r?r.padding:void 0;f?(0,Ux.isNumber)(f)&&(f=[f,f,f,f]):f=[0,0,0,0];var h=o+f[0]+f[2],p=a+f[1]+f[3];if(l){var d=this.get("graphWaterMarker").cfg||{},y=d.width,g=d.height;h=Math.ceil(h/g)*g,p=Math.ceil(p/y)*y}var v,m,b={container:u,height:h,width:p},A="svg"===s?new nI(b):new ck(b),x=this.get("group"),w=(m=(v=x).clone(),lT(v,m),m),_=(0,Ux.clone)(w.getMatrix());_||(_=[1,0,0,0,1,0,0,0,1]);var S=(i.maxX+i.minX)/2,E=(i.maxY+i.minY)/2;_=XT(_,[["t",-S,-E],["t",a/2+f[3],o/2+f[0]]]),w.resetMatrix(),w.setMatrix(_),A.add(w);var C=A.get("el");e||(e="image/png"),this.asyncToDataUrl(e,c,function(r){var i=document.createElement("a"),o=(t||"graph")+("svg"===s?".svg":".".concat(e.split("/")[1]));n.dataURLToImage(r,s,i,o);var a=document.createEvent("MouseEvents");a.initEvent("click",!1,!1),i.dispatchEvent(a)},p,h,C)},e.prototype.downloadImage=function(t,e,r){var n=this;this.stopAnimate();var i=this.get("canvas").getRenderer();e||(e="image/png");var o=(t||"graph")+("svg"===i?".svg":".".concat(e.split("/")[1])),a=document.createElement("a");this.asyncToDataUrl(e,r,function(t){n.dataURLToImage(t,i,a,o);var e=document.createEvent("MouseEvents");e.initEvent("click",!1,!1),a.dispatchEvent(e)})},e.prototype.dataURLToImage=function(t,e,r,n){if(t&&"data:"!==t){if("undefined"!=typeof window)if(window.Blob&&window.URL&&"svg"!==e){var i=t.split(","),o="";if(i&&i.length>0){var a=i[0].match(/:(.*?);/);a&&a.length>=2&&(o=a[1])}for(var s=atob(i[1]),u=s.length,l=new Uint8Array(u);u--;)l[u]=s.charCodeAt(u);var c=new Blob([l],{type:o});window.navigator.msSaveBlob?window.navigator.msSaveBlob(c,n):r.addEventListener("click",function(){r.download=n,r.href=window.URL.createObjectURL(c)})}else r.addEventListener("click",function(){r.download=n,r.href=t})}else console.error("Download image failed. The graph is too large or there is invalid attribute values in graph items")},e.prototype.addPlugin=function(t){t.destroyed||(this.get("plugins").push(t),t.initPlugin(this))},e.prototype.removePlugin=function(t){var e=this.get("plugins"),r=e.indexOf(t);r>=0&&(t.destroyPlugin(),e.splice(r,1))},e.prototype.setImageWaterMarker=function(t,e){void 0===t&&(t=uT.waterMarkerImage);var r=this.get("container");(0,Ux.isString)(r)&&(r=document.getElementById(r)),r.style.position||(r.style.position="relative");var n=this.get("graphWaterMarker"),i=(0,Ux.deepMix)({},uT.imageWaterMarkerConfig,e),o=i.width,a=i.height,s=i.compatible,u=i.image;if(!t){var l=s?r:document.querySelector(".g6-graph-watermarker");return l&&(l.style.cssText=void 0),void(n&&n.clear())}if(n)n.clear();else{var c={container:r,width:o,height:a,capture:!1},f=this.get("pixelRatio");f&&(c.pixelRatio=f,window.devicePixelRatio=f),n=new ck(c),this.set("graphWaterMarker",n)}n.get("el").style.display="none";var h=n.get("context"),p=u.rotate,d=u.x,y=u.y;h.rotate(-p*Math.PI/180);var g=new Image;g.crossOrigin="anonymous",g.src=t,g.onload=function(){if(h.drawImage(g,d,y,u.width,u.height),h.rotate(p*Math.PI/180),s)r.style.cssText="background-image: url(".concat(n.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var t=document.querySelector(".g6-graph-watermarker");t||((t=document.createElement("div")).className="g6-graph-watermarker"),t.className="g6-graph-watermarker",n.destroyed||(t.style.cssText="background-image: url(".concat(n.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:-1;"),r.appendChild(t))}}},e.prototype.setTextWaterMarker=function(t,e){var r=this.get("container");(0,Ux.isString)(r)&&(r=document.getElementById(r)),r.style.position||(r.style.position="relative");var n=this.get("graphWaterMarker"),i=(0,Ux.deepMix)({},uT.textWaterMarkerConfig,e),o=i.width,a=i.height,s=i.compatible,u=i.text;if(!(null===t||void 0===t?void 0:t.length)){var l=s?r:document.querySelector(".g6-graph-watermarker");return l&&(l.style.cssText=void 0),void(n&&n.clear())}if(n)n.clear();else{var c={container:r,width:o,height:a,capture:!1},f=this.get("pixelRatio");f&&(c.pixelRatio=f,window.devicePixelRatio=f),n=new ck(c),this.set("graphWaterMarker",n)}n.get("el").style.display="none";var h=n.get("context"),p=u.rotate,d=u.fill,y=u.fontFamily,g=u.fontSize,v=u.baseline,m=u.x,b=u.y,A=u.lineHeight;h.rotate(-p*Math.PI/180),h.font="".concat(g,"px ").concat(y),h.fillStyle=d,h.textBaseline=v;for(var x=(0,Ux.isString)(t)?[t]:t,w=x.length-1;w>=0;w--)h.fillText(x[w],m,b+w*A);if(h.rotate(p*Math.PI/180),s)r.style.cssText="background-image: url(".concat(n.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var _=document.querySelector(".g6-graph-watermarker");_||((_=document.createElement("div")).className="g6-graph-watermarker"),_.style.cssText="background-image: url(".concat(n.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:99;"),r.appendChild(_)}},e.prototype.destroy=function(){var e,r,n,i;(0,Ux.each)(this.get("plugins"),function(t){t.destroyPlugin()});var o=this.get("tooltips");if(o)for(var a=0;a0)for(var l=u.length-1;l>=0;l--){var c=u[l].getModel();-1===e.indexOfChild(t.children||[],c.id)&&(i.innerRemoveChild(c.id,{x:t.x,y:t.y},n),u.splice(l,1))}o.get("originAttrs")&&(a=o.get("originAttrs").x,s=o.get("originAttrs").y);var f=o.getModel();n&&o.set("originAttrs",{x:f.x,y:f.y}),o.set("model",Object.assign(f,t.data)),a===t.x&&s===t.y||o.updatePosition({x:t.x,y:t.y})}else i.innerAddChild(t,r,n)},e.prototype.innerRemoveChild=function(t,e,r){var n=this,i=n.findById(t);if(i)if((0,Ux.each)(i.get("children"),function(t){n.innerRemoveChild(t.getModel().id,e,r)}),r){var o=i.getModel();i.set("to",e),i.set("originAttrs",{x:o.x,y:o.y}),n.get("removeList").push(i)}else n.removeItem(i,!1)},e.prototype.changeData=function(t,e){void 0===e&&(e=!0);var r=this;this.getNodes().map(function(t){return r.clearItemStates(t)}),this.getEdges().map(function(t){return r.clearItemStates(t)}),e&&this.get("enabledStack")&&this.pushStack("changedata",{before:r.get("originData"),after:t||r.get("data")}),t?(r.data(t),r.render(!1)):r.layout(this.get("fitView"))},e.prototype.changeLayout=function(t){console.warn("Please call updateLayout instead of changeLayout. changeLayout will be discarded soon");this.updateLayout(t)},e.prototype.updateLayout=function(t,e,r,n){void 0===n&&(n=!0);if(t){if(n&&this.get("enabledStack")&&this.pushStack("layout",{before:this.get("layout"),after:t}),this.set("layout",t),this.set("layoutMethod",this.getLayout()),this.layout(),e){var i=r;i||(i="begin"===e?{x:0,y:0}:{x:this.getWidth()/2,y:this.getHeight()/2}),i=this.getPointByCanvas(i.x,i.y);var o=this.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];i.x=i.x*o[0]+o[6],i.y=i.y*o[0]+o[7];var a=this.getGroup().getCanvasBBox(),s=a.minX,u=a.maxX,l=a.minY,c={x:(s+u)/2,y:(l+a.maxY)/2};"begin"===e&&(c.x=s,c.y=l),this.translate(i.x-c.x,i.y-c.y)}}else console.warn("layout cannot be null")},e.prototype.refreshLayout=function(t){console.warn("Please call layout instead of refreshLayout. refreshLayout will be discarded soon");this.layout(t)},e.prototype.layout=function(t){var e=this,r=this.get("data"),n=this.get("layoutMethod"),i=this.get("layout"),o=r;if(null===i||void 0===i?void 0:i.excludeInvisibles){r=(0,Ux.clone)(this.get("data"));var a={};tO(r,function(t){var r=t.children;if(!(null===r||void 0===r?void 0:r.length))return!0;for(var n=r.length-1;n>=0;n--){var i=e.findById(r[n].id);(i?!i.isVisible():!1===r[n].visible)&&(a[t.id]=a[t.id]||[],a[t.id].push({idx:n,child:r.splice(n,1)[0]}))}}),o=n?n(r,this.get("layout")):r,tO(o,function(t){var e=a[t.id];if(null===e||void 0===e?void 0:e.length)for(var r=e.length-1;r>=0;r--){var n=e[r],i=n.idx,o=n.child;t.children.splice(i,0,o)}})}else o=n?n(r,this.get("layout")):r;var s=this.get("animate");(this.emit("beforerefreshlayout",{data:r,layoutData:o}),this.emit("beforelayout"),this.innerUpdateChild(o,void 0,s),t)&&this.get("viewController").fitView();s?this.layoutAnimate(o):(this.refresh(),this.paint()),this.emit("afterrefreshlayout",{data:r,layoutData:o}),this.emit("afterlayout")},e.prototype.addChild=function(t,e,r){void 0===r&&(r=!0);this.emit("beforeaddchild",{model:t,parent:e}),(0,Ux.isString)(e)||(e=e.get("id"));var n=this.findDataById(e);n&&(n.children||(n.children=[]),n.children.push(t),this.findById(e).refresh(),this.changeData(void 0,r))},e.prototype.updateChildren=function(t,e,r){void 0===r&&(r=!0);var n=this.findById(e);e&&n?(this.findDataById(e).children=t,n.refresh(),this.changeData(void 0,r)):console.warn("Update children failed! There is no node with id '".concat(e,"'"))},e.prototype.updateChild=function(t,r,n){void 0===n&&(n=!0);if(r&&this.findById(r)){var i=this.findDataById(r),o=this.findById(t.id);if(i.children||(i.children=[]),o){var a=e.indexOfChild(i.children,t.id);a>-1&&(i.children[a]=t)}else i.children.push(t);var s=this.findById(r);null===s||void 0===s||s.refresh(),this.changeData(void 0,n)}else this.changeData(t,n)},e.prototype.removeChild=function(t,r){void 0===r&&(r=!0);var n,i=this.findById(t);if((n=i?null===i||void 0===i?void 0:i.get("parent"):this.getNodes().find(function(e){return!!(e.getModel().children||[]).find(function(e){return e.id===t})}))&&!n.destroyed){var o=n.get("id"),a=this.findDataById(o),s=a&&a.children||[],u=e.indexOfChild(s,t);s.splice(u,1),n.refresh()}this.changeData(void 0,r)},e.prototype.findDataById=function(t,e){var r=this;if(e||(e=r.get("data")),t===e.id)return e;var n=null;return(0,Ux.each)(e.children||[],function(e){return e.id===t?(n=e,!1):!(n=r.findDataById(t,e))&&void 0}),n},e.prototype.layoutAnimate=function(t,e){var r=this,n=this.get("animateCfg");r.emit("beforeanimate",{data:t}),r.getEdges().forEach(function(t){var e=t.get("model");e.sourceAnchor||(e.sourceAnchor=t.get("sourceAnchorIndex"))}),this.get("canvas").animate(function(n){tO(t,function(i){var o=r.findById(i.id);if(o){var a=o.get("originAttrs"),s=o.get("model");if(a||(a={x:s.x,y:s.y},o.set("originAttrs",a)),e){var u=e(o,n,a,t);o.set("model",Object.assign(s,u))}else s.x=a.x+(i.x-a.x)*n,s.y=a.y+(i.y-a.y)*n}return!0}),(0,Ux.each)(r.get("removeList"),function(t){var e=t.getModel(),r=t.get("originAttrs"),i=t.get("to");e.x=r.x+(i.x-r.x)*n,e.y=r.y+(i.y-r.y)*n}),r.refreshPositions()},{duration:n.duration,easing:n.ease,callback:function(){(0,Ux.each)(r.getNodes(),function(t){t.set("originAttrs",null)}),(0,Ux.each)(r.get("removeList"),function(t){r.removeItem(t,!1)}),r.set("removeList",[]),n.callback&&n.callback(),r.emit("afteranimate",{data:t})},delay:n.delay})},e.prototype.stopLayoutAnimate=function(){this.get("canvas").stopAnimate(),this.emit("layoutanimateend",{data:this.get("data")}),this.layoutAnimating=!1},e.prototype.isLayoutAnimating=function(){return this.layoutAnimating},e.prototype.render=function(t){void 0===t&&(t=!0);var e=this.get("data");if(!e||!(0,Ux.isObject)(e)||!Object.keys(e).length)throw new Error("data must be defined first");this.clear(),t&&this.get("enabledStack")&&this.clearStack(),this.emit("beforerender"),this.layout(this.get("fitView")),this.emit("afterrender")},e.prototype.save=function(){return this.get("data")},e.prototype.data=function(e){t.prototype.data.call(this,e),this.set("originData",ZT(e))},e}(KT);function rO(t,e){if(t)for(var r in e)e.hasOwnProperty(r)&&(t.style[r]=e[r]);return t}var nO=function(){function t(t){this._cfgs=(0,Ux.deepMix)(this.getDefaultCfgs(),t),this._events={},this.destroyed=!1}return t.prototype.getDefaultCfgs=function(){return{}},t.prototype.initPlugin=function(t){var e=this;e.set("graph",t);var r=e.getEvents(),n={};(0,Ux.each)(r,function(r,i){var o=(0,Ux.wrapBehavior)(e,r);n[i]=o,t.on(i,o)}),this._events=n,this.init()},t.prototype.getEvents=function(){return{}},t.prototype.get=function(t){var e;return null===(e=this._cfgs)||void 0===e?void 0:e[t]},t.prototype.set=function(t,e){this._cfgs[t]=e},t.prototype.destroy=function(){},t.prototype.destroyPlugin=function(){this.destroy();var t=this.get("graph"),e=this._events;(0,Ux.each)(e,function(e,r){t.off(r,e)}),this._events=null,this._cfgs=null,this.destroyed=!0},t}(),iO=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),oO="url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2UwZTBlMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=)",aO=function(t){function e(e){return t.call(this,e)||this}return iO(e,t),e.prototype.getDefaultCfgs=function(){return{img:oO,follow:!0}},e.prototype.init=function(){var t=this.get("graph"),e=t.get("container"),r=t.get("canvas").get("el"),n=this.get("img")||oO;n.includes("url(")||(n='url("'.concat(n,'")'));var i=oI("
    "),o=oI(""));this.set("container",i),this.set("gridContainer",o),this.positionInit(),i.appendChild(o),e.insertBefore(i,r)},e.prototype.positionInit=function(){var t=this.get("graph"),e=t.get("minZoom"),r=t.get("width"),n=t.get("height");rO(this.get("container"),{width:"".concat(r,"px"),height:"".concat(n,"px")});var i=80*r/e,o=80*n/e;rO(this.get("gridContainer"),{width:"".concat(i,"px"),height:"".concat(o,"px"),left:"-".concat(i/2,"px"),top:"-".concat(o/2,"px")})},e.prototype.getEvents=function(){return{viewportchange:"updateGrid"}},e.prototype.updateGrid=function(t){var e=this.get("gridContainer"),r=t.matrix;r||(r=[1,0,0,0,1,0,0,0,1]);var n=this.get("follow");rO(e,{transform:"matrix(".concat(r[0],", ").concat(r[1],", ").concat(r[3],", ").concat(r[4],", ").concat(n?r[6]:"0",", ").concat(n?r[7]:"0",")")})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t=this.get("graph").get("container"),e=this.get("container");t.removeChild(e)},e}(nO),sO=r(3448),uO=r.n(sO),lO=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();"undefined"!=typeof document&&uO()("\n .g6-component-contextmenu {\n border: 1px solid #e2e2e2;\n border-radius: 4px;\n font-size: 12px;\n color: #545454;\n background-color: rgba(255, 255, 255, 0.9);\n padding: 10px 8px;\n box-shadow: rgb(174, 174, 174) 0px 0px 10px;\n }\n .g6-contextmenu-ul {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n");var cO=function(t){function e(e){return t.call(this,e)||this}return lO(e,t),e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,handleMenuClick:void 0,getContent:function(t){return"\n
      \n
    • 菜单项1
    • \n
    • 菜单项2
    • \n
    \n "},shouldBegin:function(t){return!0},onHide:function(){return!0},itemTypes:["node","edge","combo"],trigger:"contextmenu"}},e.prototype.getEvents=function(){return"click"===this.get("trigger")?{click:"onMenuShow",touchend:"onMenuShow"}:{contextmenu:"onMenuShow"}},e.prototype.init=function(){var t=this.get("className"),e=oI("
    "));rO(e,{top:"0px",position:"absolute",visibility:"hidden"});var r=this.get("container");r||(r=this.get("graph").get("container")),(0,Ux.isString)(r)&&(r=document.getElementById(r)),r.appendChild(e),this.set("menu",e)},e.prototype.onMenuShow=function(t){var e=this;t.preventDefault();var r=this.get("itemTypes");if(t.item){if(t.item&&t.item.getType&&-1===r.indexOf(t.item.getType()))return void e.onMenuHide()}else if(-1===r.indexOf("canvas"))return void e.onMenuHide();if(this.get("shouldBegin")(t)){var n=this.get("menu"),i=this.get("getContent"),o=this.get("graph"),a=i(t,o);(0,Ux.isString)(a)?n.innerHTML=a:n.innerHTML=a.outerHTML,this.removeMenuEventListener();var s=this.get("handleMenuClick");if(s){var u=function(e){s(e.target,t.item,o)};this.set("handleMenuClickWrapper",u),n.addEventListener("click",u)}var l=o.get("width"),c=o.get("height"),f=n.getBoundingClientRect(),h=this.get("offsetX")||0,p=this.get("offsetY")||0,d=o.getContainer().offsetTop,y=o.getContainer().offsetLeft,g=t.canvasX+y+h,v=t.canvasY+d+p;g+f.width>l&&(g=t.canvasX-f.width-h+y),v+f.height>c&&(v=t.canvasY-f.height-p+d),v<0&&(v=0),rO(n,{top:"".concat(v,"px"),left:"".concat(g,"px"),visibility:"visible"});var m="click"===this.get("trigger"),b=function(t){m?m=!1:e.onMenuHide()};document.body.addEventListener("click",b),this.set("handler",b)}},e.prototype.removeMenuEventListener=function(){var t=this.get("handleMenuClickWrapper"),e=this.get("handler");t&&(this.get("menu").removeEventListener("click",t),this.set("handleMenuClickWrapper",null));e&&document.body.removeEventListener("click",e)},e.prototype.onMenuHide=function(){var t=this.get("menu");t&&rO(t,{visibility:"hidden"}),this.removeMenuEventListener()},e.prototype.destroy=function(){var t=this.get("menu");if(this.removeMenuEventListener(),t){var e=this.get("container");e||(e=this.get("graph").get("container")),(0,Ux.isString)(e)&&(e=document.getElementById(e)),e.removeChild(t)}},e}(nO),fO=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hO=function(){return(hO=Object.assign||function(t){for(var e,r=1,n=arguments.length;r-1,a=navigator.userAgent.toLowerCase().indexOf("safari")>-1,s=oI("\n ")),u=0,l=0,c=!1,f=0,h=0,p=0,d=0,y=0,g=0,v=a||o?"mousedown":"dragstart";s.addEventListener(v,function(i){var o,a;if(i.dataTransfer){var v=new Image;v.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' %3E%3Cpath /%3E%3C/svg%3E",null===(a=(o=i.dataTransfer).setDragImage)||void 0===a||a.call(o,v,0,0);try{i.dataTransfer.setData("text/html","view-port-minimap")}catch(t){i.dataTransfer.setData("text","view-port-minimap")}}if(e.refresh=!1,i.target===s){var m=s.style;f=parseInt(m.left,10),h=parseInt(m.top,10),p=parseInt(m.width,10),d=parseInt(m.height,10),p>r[0]||d>r[1]||(g=n.getZoom(),y=t.get("ratio"),c=!0,u=i.clientX,l=i.clientY)}},!1);var m=function(t){if(c&&!(0,Ux.isNil)(t.clientX)&&!(0,Ux.isNil)(t.clientY)){var e=u-t.clientX,i=l-t.clientY;(f-e<0||f-e+p>=r[0])&&(e=0),(h-i<0||h-i+d>=r[1])&&(i=0),h-=i,rO(s,{left:"".concat(f-=e,"px"),top:"".concat(h,"px")}),n.translate(e*g/y,i*g/y),u=t.clientX,l=t.clientY}};a||o||s.addEventListener("drag",m,!1);var b=function(){c=!1,e.refresh=!0},A=a||o?"mouseup":"dragend";s.addEventListener(A,b,!1),i.addEventListener("mouseleave",b),i.addEventListener("mouseup",b),(a||o)&&i.addEventListener("mousemove",m,!1),this.set("viewport",s),i.appendChild(s)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),e=this.get("totaldx"),r=this.get("totaldy"),n=this.get("graph"),i=this.get("size"),o=n.get("canvas").get("el"),a=n.get("width")||o.scrollWidth||500,s=n.get("height")||o.scrollHeight||500,u=n.getPointByCanvas(0,0),l=n.getPointByCanvas(a,s),c=this.get("viewport");c||this.initViewport();var f=(l.x-u.x)*t,h=(l.y-u.y)*t,p=u.x*t+e,d=u.y*t+r,y=p+f,g=d+h;p<0&&(f+=p,p=0),y>i[0]&&(f-=y-i[0]),d<0&&(h+=d,d=0),g>i[1]&&(h-=g-i[1]),this.set("ratio",t),rO(c,{left:"".concat(p,"px"),top:"".concat(d,"px"),width:"".concat(f,"px"),height:"".concat(h,"px")})}},e.prototype.updateGraphShapes=function(){var t,e=this._cfgs.graph,r=this.get("canvas"),n=e.get("group");n.destroyed||(r.clear(),this.get("hideEdge")?(t=r.addGroup(),n.get("children").forEach(function(e){e.get("id").includes("-edge")||t.add(e.clone())})):((t=n.clone()).resetMatrix(),r.add(t)),"svg"===e.get("renderer")&&this.updateVisible(t))},e.prototype.updateVisible=function(t){var e=this;if(t.isGroup()||t.get("visible")){var r=t.get("children");if(!r||!r.length)return;r.forEach(function(t){t.get("visible")||t.hide(),e.updateVisible(t)})}else t.hide()},e.prototype.updateKeyShapes=function(){var t=this,e=this._cfgs.graph,r=this.get("canvas"),n=r.get("children")[0]||r.addGroup();this.get("hideEdge")||(0,Ux.each)(e.getEdges(),function(e){t.updateOneEdgeKeyShape(e,n)}),(0,Ux.each)(e.getNodes(),function(e){t.updateOneNodeKeyShape(e,n)});var i=e.getCombos();if(i&&i.length){var o=n.find(function(t){return"comboGroup"===t.get("name")})||n.addGroup({name:"comboGroup"});setTimeout(function(){t.destroyed||((0,Ux.each)(i,function(e){t.updateOneComboKeyShape(e,o)}),null===o||void 0===o||o.sort(),null===o||void 0===o||o.toBack(),t.updateCanvas())},250)}this.clearDestroyedShapes()},e.prototype.updateOneComboKeyShape=function(t,e){if(!this.destroyed){var r=this.get("itemMap")||{},n=r[t.get("id")],i=t.getBBox(),o=t.get("keyShape").clone(),a=o.attr(),s={x:i.centerX,y:i.centerY};n?s=Object.assign(a,s):(n=o,e.add(n));var u=n.get("type");"rect"!==u&&"image"!==u||(s.x=i.minX,s.y=i.minY),n.attr(s),t.isVisible()?n.show():n.hide(),n.exist=!0;var l=t.getModel().depth;isNaN(l)||n.set("zIndex",l),r[t.get("id")]=n,this.set("itemMap",r)}},e.prototype.updateOneNodeKeyShape=function(t,e){var r=this.get("itemMap")||{},n=r[t.get("id")],i=t.getBBox(),o=t.get("keyShape").clone(),a=o.attr(),s={x:i.centerX,y:i.centerY};n?(s=Object.assign(a,s),n.toFront()):(n=o,e.add(n));var u=n.get("type");"rect"!==u&&"image"!==u||(s.x=i.minX,s.y=i.minY),n.attr(s),t.isVisible()?n.show():n.hide(),n.exist=!0;var l=t.getModel().depth;isNaN(l)||n.set("zIndex",l),r[t.get("id")]=n,this.set("itemMap",r)},e.prototype.updateDelegateShapes=function(){var t=this,e=this._cfgs.graph,r=this.get("canvas"),n=r.get("children")[0]||r.addGroup();this.get("hideEdge")||(0,Ux.each)(e.getEdges(),function(e){t.updateOneEdgeKeyShape(e,n)}),(0,Ux.each)(e.getNodes(),function(e){t.updateOneNodeDelegateShape(e,n)});var i=e.getCombos();if(i&&i.length){var o=n.find(function(t){return"comboGroup"===t.get("name")})||n.addGroup({name:"comboGroup"});setTimeout(function(){t.destroyed||((0,Ux.each)(i,function(e){t.updateOneComboKeyShape(e,o)}),null===o||void 0===o||o.sort(),null===o||void 0===o||o.toBack(),t.updateCanvas())},250)}this.clearDestroyedShapes()},e.prototype.clearDestroyedShapes=function(){var t=this.get("itemMap")||{},e=Object.keys(t);if(e&&0!==e.length)for(var r=e.length-1;r>=0;r--){var n=t[e[r]],i=n.exist;n.exist=!1,i||(n.remove(),delete t[e[r]])}},e.prototype.updateOneEdgeKeyShape=function(t,e){var r=this.get("itemMap")||{},n=r[t.get("id")];if(n){var i=t.get("keyShape").attr("path");n.attr("path",i)}else n=t.get("keyShape").clone(),e.add(n);t.isVisible()?n.show():n.hide(),n.exist=!0,r[t.get("id")]=n,this.set("itemMap",r)},e.prototype.updateOneNodeDelegateShape=function(t,e){var r=this.get("delegateStyle"),n=this.get("itemMap")||{},i=n[t.get("id")],o=t.getBBox();if(i){var a={x:o.minX,y:o.minY,width:o.width,height:o.height};i.attr(a),i.toFront()}else i=e.addShape("rect",{attrs:hO({x:o.minX,y:o.minY,width:o.width,height:o.height},r),name:"minimap-node-shape"});t.isVisible()?i.show():i.hide(),i.exist=!0,n[t.get("id")]=i,this.set("itemMap",n)},e.prototype.init=function(){this.initContainer(),this.get("graph").on("afterupdateitem",this.handleUpdateCanvas),this.get("graph").on("afteritemstatechange",this.handleUpdateCanvas),this.get("graph").on("afteradditem",this.handleUpdateCanvas),this.get("graph").on("afterremoveitem",this.handleUpdateCanvas),this.get("graph").on("afterrender",this.handleUpdateCanvas),this.get("graph").on("afterlayout",this.handleUpdateCanvas)},e.prototype.initContainer=function(){var t=this.get("graph"),e=this.get("size"),r=this.get("className"),n=this.get("container"),i=oI("
    "));(0,Ux.isString)(n)&&(n=document.getElementById(n)),n?n.appendChild(i):t.get("container").appendChild(i),this.set("container",i);var o,a=oI('
    ');i.appendChild(a),a.addEventListener("dragenter",function(t){t.preventDefault()}),a.addEventListener("dragover",function(t){t.preventDefault()}),o="svg"===t.get("renderer")?new nI({container:a,width:e[0],height:e[1]}):new ck({container:a,width:e[0],height:e[1]}),this.set("canvas",o),this.updateCanvas()},e.prototype.updateCanvas=function(){if(!this.destroyed&&this.get("refresh")){var t=this.get("graph");if(!t.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var e=this.get("size"),r=this.get("canvas"),n=this.get("type"),i=this.get("padding");if(!r.destroyed){switch(n){case"default":this.updateGraphShapes();break;case"keyShape":this.updateKeyShapes();break;case"delegate":this.updateDelegateShapes()}var o=r.get("children")[0];if(o){o.resetMatrix();var a=o.getCanvasBBox(),s=t.get("canvas").getCanvasBBox(),u=t.getZoom()||1,l=s.width/u,c=s.height/u;Number.isFinite(a.width)&&(l=pO(a.width,l),c=pO(a.height,c)),l+=2*i,c+=2*i;var f=Math.min(e[0]/l,e[1]/c),h=[1,0,0,0,1,0,0,0,1],p=0,d=0;Number.isFinite(a.minX)&&(p=-a.minX),Number.isFinite(a.minY)&&(d=-a.minY);var y=(e[0]-(l-2*i)*f)/2,g=(e[1]-(c-2*i)*f)/2;h=dO(h,[["t",p,d],["s",f,f],["t",y,g]]),o.setMatrix(h),this.set("ratio",f),this.set("totaldx",y+p*f),this.set("totaldy",g+d*f),this.set("dx",y),this.set("dy",g),this.updateViewport()}}}}},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t;null===(t=this.get("canvas"))||void 0===t||t.destroy();var e=this.get("container");(null===e||void 0===e?void 0:e.parentNode)&&e.parentNode.removeChild(e)},e}(nO),gO=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function vO(t,e,r){var n=t.x-e.x,i=t.y-e.y;return!r||Math.abs(n)>r||Math.abs(i)>r?Math.sqrt(n*n+i*i):r}function mO(t,e){var r=(e.source.y-e.target.y)/(e.source.x-e.target.x),n=(r*r*e.source.x+r*(t.y-e.source.y)+t.x)/(r*r+1);return{x:n,y:r*(n-e.source.x)+e.source.y}}var bO=function(t){function e(e){return t.call(this,e)||this}return gO(e,t),e.prototype.getDefaultCfgs=function(){return{edgeBundles:[],edgePoints:[],K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:.6666667,bundleThreshold:.6,eps:1e-6,onLayoutEnd:function(){},onTick:function(){}}},e.prototype.init=function(){var t=this.get("graph"),e=this.get("onTick");this.set("tick",function(){e&&e(),t.refreshPositions()})},e.prototype.bundling=function(t){var e=this;if(e.set("data",t),!e.isTicking()){var r=t.edges||[],n={},i=!1;if((t.nodes||[]).forEach(function(t){null!==t.x&&null!==!t.y&&void 0!==t.x&&void 0!==!t.y||(i=!0),n[t.id]=t}),i)throw new Error("please layout the graph or assign x and y for nodes first");e.set("nodeIdMap",n);var o=e.get("divisions"),a=e.get("divRate"),s=e.divideEdges(o);e.set("edgePoints",s);var u=e.getEdgeBundles();e.set("edgeBundles",u);for(var l=e.get("cycles"),c=e.get("iterations"),f=e.get("iterRate"),h=e.get("lambda"),p=0;pc;){var n=c/r,a={x:i[o][e-1].x,y:i[o][e-1].y};a.x+=n*(t.x-i[o][e-1].x),a.y+=n*(t.y-i[o][e-1].y),f.push(a),r-=c,c=l}c-=r}}),f.push({x:u.x,y:u.y}),i[o]=f}}),i},e.prototype.getEdgeLength=function(t){var e=0;return t.forEach(function(r,n){0!==n&&(e+=vO(r,t[n-1]))}),e},e.prototype.getEdgeBundles=function(){var t=this,e=t.get("data").edges||[],r=t.get("bundleThreshold"),n=t.get("nodeIdMap"),i=t.get("edgeBundles");return i||(i=[]),e.forEach(function(t,e){i[e]&&void 0!==i[e]||(i[e]=[])}),e.forEach(function(o,a){var s=n[o.source],u=n[o.target];e.forEach(function(e,o){if(!(o<=a)){var l=n[e.source],c=n[e.target];t.getBundleScore({source:s,target:u},{source:l,target:c})>=r&&(i[a].push(o),i[o].push(a))}})}),i},e.prototype.getBundleScore=function(t,e){return t.vx=t.target.x-t.source.x,t.vy=t.target.y-t.source.y,e.vx=e.target.x-e.source.x,e.vy=e.target.y-e.source.y,t.length=vO({x:t.source.x,y:t.source.y},{x:t.target.x,y:t.target.y}),e.length=vO({x:e.source.x,y:e.source.y},{x:e.target.x,y:e.target.y}),this.getAngleScore(t,e)*this.getScaleScore(t,e)*this.getPositionScore(t,e)*this.getVisibilityScore(t,e)},e.prototype.getAngleScore=function(t,e){return function(t,e){return t.x*e.x+t.y*e.y}({x:t.vx,y:t.vy},{x:e.vx,y:e.vy})/(t.length*e.length)},e.prototype.getScaleScore=function(t,e){var r=(t.length+e.length)/2;return 2/(r/Math.min(t.length,e.length)+Math.max(t.length,e.length)/r)},e.prototype.getPositionScore=function(t,e){var r=(t.length+e.length)/2;return r/(r+vO({x:(t.source.x+t.target.x)/2,y:(t.source.y+t.target.y)/2},{x:(e.source.x+e.target.x)/2,y:(e.source.y+e.target.y)/2}))},e.prototype.getVisibilityScore=function(t,e){var r=this.getEdgeVisibility(t,e),n=this.getEdgeVisibility(e,t);return rr||Math.abs(a.y)>r){var s=1/vO(i[n][t],i[e][t]);o.x+=a.x*s,o.y+=a.y*s}}),o},e.prototype.isTicking=function(){return this.get("ticking")},e.prototype.getSimulation=function(){return this.get("forceSimulation")},e.prototype.destroy=function(){this.get("ticking")&&this.getSimulation().stop(),t.prototype.destroy.call(this)},e}(nO),AO=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xO=function(){return(xO=Object.assign||function(t){for(var e,r=1,n=arguments.length;r(o||r.get("height"))&&e>1||s<(a||.05*r.get("height"))&&e<1)&&(e=1),s*=e,this.set("r",s),this.set("r2",s*s);var u=this.get("d");this.set("molecularParam",(u+1)*s),this.set("delegateCenterDiff",void 0),this.magnify(t,i)}},e.prototype.scaleRByDrag=function(t){if(t){var e,r=this.get("dragPrePos"),n=this.get("graph"),i=n.getPointByClient(t.clientX,t.clientY);e=t.x-r.x<0?.95:1/.95;var o=this.get("maxR"),a=this.get("minR"),s=this.get("r");(s>(o||n.get("height"))&&e>1||s<(a||.05*n.get("height"))&&e<1)&&(e=1),s*=e,this.set("r",s),this.set("r2",s*s);var u=this.get("d");this.set("molecularParam",(u+1)*s),this.magnify(t,i),this.set("dragPrePos",{x:t.x,y:t.y})}},e.prototype.scaleDByWheel=function(t){if(t||t.originalEvent){t.preventDefault&&t.preventDefault();var e=0;e=t.originalEvent.wheelDelta<0?-.1:.1;var r=this.get("d")+e,n=this.get("maxD"),i=this.get("minD");if(ri){this.set("d",r);var o=this.get("r");this.set("molecularParam",(r+1)*o);var a=this.get("delegate"),s=a?{x:a.attr("x"),y:a.attr("y")}:void 0;this.set("delegateCenterDiff",void 0),this.magnify(t,s)}}},e.prototype.scaleDByDrag=function(t){var e=this.get("dragPrePos"),r=t.x-e.x>0?.1:-.1,n=this.get("d")+r,i=this.get("maxD"),o=this.get("minD");if(no){this.set("d",n);var a=this.get("r");this.set("molecularParam",(n+1)*a),this.magnify(t)}this.set("dragPrePos",{x:t.x,y:t.y})},e.prototype.magnify=function(t,e){this.restoreCache();var r=this.get("graph"),n=this.get("cachedMagnifiedModels"),i=this.get("cachedOriginPositions"),o=this.get("showLabel"),a=this.get("r"),s=this.get("r2"),u=this.get("d"),l=this.get("molecularParam"),c=r.getNodes(),f=c.length,h=e?{x:e.x,y:e.y}:{x:t.x,y:t.y};!this.get("dragging")||"mousemove"!==this.get("trigger")&&"click"!==this.get("trigger")||(h=this.get("cacheCenter"));var p=this.get("delegateCenterDiff");p&&(h.x+=p.x,h.y+=p.y),this.updateDelegate(h,a);for(var d=0;d\n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n \n '},zoomSensitivity:2}},e.prototype.init=function(){var t=this,e=this.get("graph"),r=this.get("getContent")(e),n=r;(0,Ux.isString)(r)&&(n=oI(r));var i=this.get("className");n.setAttribute("class",i||"g6-component-toolbar");var o=this.get("container");o||(o=this.get("graph").get("container")),(0,Ux.isString)(o)&&(o=document.getElementById(o)),o.appendChild(n),this.set("toolBar",n);var a=this.get("handleClick");n.addEventListener("click",function(r){var n=function(t){if(!t)return[];if(t.composedPath)return t.composedPath();for(var e=[],r=t.target;r;){if(e.push(r),"HTML"===r.tagName)return e.push(document,window),e;r=r.parentElement}return e}(r).filter(function(t){return"LI"===t.nodeName});if(0!==n.length){var i=n[0].getAttribute("code");i&&(a?a(i,e):t.handleDefaultOperator(i))}});var s=this.get("position");s&&rO(n,{top:"".concat(s.y,"px"),left:"".concat(s.x,"px")}),this.bindUndoRedo()},e.prototype.bindUndoRedo=function(){var t=this.get("graph"),e=document.querySelector('.g6-component-toolbar li[code="undo"]'),r=document.querySelector('.g6-component-toolbar li[code="undo"] svg'),n=document.querySelector('.g6-component-toolbar li[code="redo"]'),i=document.querySelector('.g6-component-toolbar li[code="redo"] svg');e&&r&&n&&i&&(e.setAttribute("style","cursor: not-allowed"),r.setAttribute("style","opacity: 0.4"),n.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4"),t.on("stackchange",function(t){var o=t.undoStack,a=t.redoStack,s=o.length,u=a.length;0===s?(e.setAttribute("style","cursor: not-allowed"),r.setAttribute("style","opacity: 0.4")):(e.removeAttribute("style"),r.removeAttribute("style")),0===u?(n.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4")):(n.removeAttribute("style"),i.removeAttribute("style"))}))},e.prototype.undo=function(){var t=this.get("graph"),e=t.getUndoStack();if(e&&0!==e.length){var r=e.pop();if(r){var n=r.action;t.pushStack(n,(0,Ux.clone)(r.data),"redo");var i=r.data.before;if("add"===n&&(i=r.data.after),!i)return;switch(n){case"visible":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){var r=t.findById(e.id);e.visible?t.showItem(r,!1):t.hideItem(r,!1)})});break;case"render":case"update":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){var r=t.findById(e.id);delete e.id,t.updateItem(r,e,!1),"combo"===r.getType()&&t.updateCombo(r)})});break;case"changedata":t.changeData(i,!1);break;case"delete":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){var r=e.itemType;delete e.itemType,t.addItem(r,e,!1)})});break;case"add":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){t.removeItem(e.id,!1)})});break;case"updateComboTree":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){t.updateComboTree(e.id,e.parentId,!1)})});break;case"createCombo":var o=r.data.after.combos,a=o[o.length-1];Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){t.updateComboTree(e.id,e.parentId,!1)})}),t.removeItem(a.id,!1);break;case"uncombo":var s=i.combos[i.combos.length-1],u=i.nodes.concat(i.combos).map(function(t){return t.id}).filter(function(t){return t!==s.id});t.createCombo(s,u,!1);break;case"layout":t.updateLayout(i,void 0,void 0,!1)}}}},e.prototype.redo=function(){var t=this.get("graph"),e=t.getRedoStack();if(e&&0!==e.length){var r=e.pop();if(r){var n=r.action,i=r.data.after;if(t.pushStack(n,(0,Ux.clone)(r.data)),"delete"===n&&(i=r.data.before),!i)return;switch(n){case"visible":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){var r=t.findById(e.id);e.visible?t.showItem(r,!1):t.hideItem(r,!1)})});break;case"render":case"update":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){var r=t.findById(e.id);delete e.id,t.updateItem(r,e,!1),"combo"===r.getType()&&t.updateCombo(r)})});break;case"changedata":t.changeData(i,!1);break;case"delete":i.edges&&i.edges.forEach(function(e){t.removeItem(e.id,!1)}),i.nodes&&i.nodes.forEach(function(e){t.removeItem(e.id,!1)}),i.combos&&i.combos.forEach(function(e){t.removeItem(e.id,!1)});break;case"add":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){var r=e.itemType;delete e.itemType,t.addItem(r,e,!1)})});break;case"updateComboTree":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){t.updateComboTree(e.id,e.parentId,!1)})});break;case"createCombo":var o=i.combos[i.combos.length-1];t.createCombo(o,o.children.map(function(t){return t.id}),!1);break;case"uncombo":var a=r.data.before.combos,s=a[a.length-1];t.uncombo(s.id,!1);break;case"layout":t.updateLayout(i,void 0,void 0,!1)}}}},e.prototype.zoomOut=function(){var t=this.get("graph"),e=t.getZoom(),r=1/(1-.05*this.get("zoomSensitivity"));r*e>(this.get("maxZoom")||t.get("maxZoom"))||t.zoomTo(e*r)},e.prototype.zoomIn=function(){var t=this.get("graph"),e=t.getZoom(),r=1-.05*this.get("zoomSensitivity");r*e<(this.get("minZoom")||t.get("minZoom"))||t.zoomTo(e*r)},e.prototype.realZoom=function(){this.get("graph").zoomTo(1)},e.prototype.autoZoom=function(){this.get("graph").fitView([20,20])},e.prototype.handleDefaultOperator=function(t){switch(t){case"redo":this.redo();break;case"undo":this.undo();break;case"zoomOut":this.zoomOut();break;case"zoomIn":this.zoomIn();break;case"realZoom":this.realZoom();break;case"autoZoom":this.autoZoom()}},e.prototype.destroy=function(){var t=this.get("toolBar");if(t){var e=this.get("container");e||(e=this.get("graph").get("container")),(0,Ux.isString)(e)&&(e=document.getElementById(e)),e.removeChild(t)}var r=this.get("handleClick");r&&t.removeEventListener("click",r)},e}(nO),CO=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();"undefined"!=typeof document&&uO()("\n .g6-component-tooltip {\n border: 1px solid #e2e2e2;\n border-radius: 4px;\n font-size: 12px;\n color: #545454;\n background-color: rgba(255, 255, 255, 0.9);\n padding: 10px 8px;\n box-shadow: rgb(174, 174, 174) 0px 0px 10px;\n }\n .tooltip-type {\n padding: 0;\n margin: 0;\n }\n .tooltip-id {\n color: #531dab;\n }\n");var kO=function(t){function e(e){return t.call(this,e)||this}return CO(e,t),e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,getContent:function(t){return"\n

    类型:".concat(t.item.getType(),"

    \n ID:").concat(t.item.getID(),"\n ")},shouldBegin:function(t){return!0},itemTypes:["node","edge","combo"],trigger:"mouseenter",fixToNode:void 0}},e.prototype.getEvents=function(){return"click"===this.get("trigger")?{"node:click":"onClick","edge:click":"onClick","combo:click":"onClick","canvas:click":"onMouseLeave",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave",drag:"onMouseLeave"}:{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove","edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove","combo:mouseenter":"onMouseEnter","combo:mouseleave":"onMouseLeave","combo:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave","node:drag":"onMouseLeave"}},e.prototype.init=function(){var t=this,e=t.get("className")||"g6-component-tooltip",r=oI("
    ")),n=t.get("container");n||(n=t.get("graph").get("container")),(0,Ux.isString)(n)&&(n=document.getElementById(n)),rO(r,{position:"absolute",visibility:"hidden",display:"none"}),n.appendChild(r),"click"!==t.get("trigger")&&(r.addEventListener("mouseenter",function(t){rO(r,{visibility:"visible",display:"unset"})}),r.addEventListener("mouseleave",function(e){t.hideTooltip()})),t.set("tooltip",r)},e.prototype.onClick=function(t){var e=this.get("itemTypes");if(!t.item||!t.item.getType||-1!==e.indexOf(t.item.getType())){var r=t.item,n=this.get("graph");this.currentTarget===r?(this.currentTarget=null,this.hideTooltip(),n.emit("tooltipchange",{item:t.item,action:"hide"})):(this.currentTarget=r,this.showTooltip(t),n.emit("tooltipchange",{item:t.item,action:"show"}))}},e.prototype.onMouseEnter=function(t){var e=this.get("itemTypes");if(!t.item||!t.item.getType||-1!==e.indexOf(t.item.getType())){var r=t.item,n=this.get("graph");this.currentTarget=r,this.showTooltip(t),n.emit("tooltipchange",{item:t.item,action:"show"})}},e.prototype.onMouseMove=function(t){var e=this.get("itemTypes");t.item&&t.item.getType&&-1===e.indexOf(t.item.getType())||this.currentTarget&&t.item===this.currentTarget&&this.showTooltip(t)},e.prototype.onMouseLeave=function(){this.hideTooltip(),this.get("graph").emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null},e.prototype.clearContainer=function(){var t=this.get("tooltip");t&&(t.innerHTML="")},e.prototype.showTooltip=function(t){if(t.item){var e=this.get("itemTypes");if(!t.item.getType||-1!==e.indexOf(t.item.getType())){var r=this.get("tooltip"),n=this.get("getContent")(t);(0,Ux.isString)(n)?r.innerHTML=n:(this.clearContainer(),r.appendChild(n)),this.updatePosition(t)}}},e.prototype.hideTooltip=function(){var t=this.get("tooltip");t&&rO(t,{visibility:"hidden",display:"none"})},e.prototype.updatePosition=function(t){var e=this.get("shouldBegin"),r=this.get("tooltip");if(e(t)){var n=this.get("graph"),i=n.get("width"),o=n.get("height"),a=this.get("offsetX")||0,s=this.get("offsetY")||0,u=n.getPointByClient(t.clientX,t.clientY),l=this.get("fixToNode"),c=t.item;if(c.getType&&"node"===c.getType()&&l&&(0,Ux.isArray)(l)&&l.length>=2){var f=c.getBBox();u={x:f.minX+f.width*l[0],y:f.minY+f.height*l[1]}}var h=n.getCanvasByPoint(u.x,u.y),p=h.x,d=h.y,y=n.getContainer(),g={x:p+y.offsetLeft+a,y:d+y.offsetTop+s};rO(r,{visibility:"visible",display:"unset"});var v=r.getBoundingClientRect();p+v.width+a>i&&(g.x-=v.width+a),d+v.height+s>o&&(g.y-=v.height+s,g.y<0&&(g.y=0)),rO(r,{left:"".concat(g.x,"px"),top:"".concat(g.y,"px")})}else rO(r,{visibility:"hidden",display:"none"})},e.prototype.hide=function(){this.onMouseLeave()},e.prototype.destroy=function(){var t=this.get("tooltip");if(t){var e=this.get("container");e||(e=this.get("graph").get("container")),(0,Ux.isString)(e)&&(e=document.getElementById(e)),e.removeChild(t)}},e}(nO),IO=function(){function t(t){var e=t.x,r=void 0===e?0:e,n=t.y,i=void 0===n?0:n,o=t.container,a=t.text,s=t.padding,u=void 0===s?[4,4,4,4]:s,l=t.className,c=void 0===l?"g6-component-timebar-tooltip":l,f=t.backgroundColor,h=void 0===f?"#000":f,p=t.textColor,d=void 0===p?"#fff":p,y=t.opacity,g=void 0===y?.8:y,v=t.fontSize,m=void 0===v?12:v;this.container=o,this.className=c,this.backgroundColor=h,this.textColor=d,this.x=r,this.y=i,this.text=a,this.padding=u,this.opacity=g,this.fontSize=m,this.render()}return t.prototype.render=function(){var t=this.className,e=(this.x,this.y,this.backgroundColor),r=this.textColor,n=this.text,i=this.padding,o=this.opacity,a=this.fontSize,s=this.container,u=oI("
    '));(0,Ux.isString)(s)&&(s=document.getElementById(s)),s.appendChild(u),this.parentHeight=s.offsetHeight,this.parentWidth=s.offsetWidth,rO(u,{visibility:"hidden",top:0,left:0});var l=oI("\n
    "));l.innerHTML=n,u.appendChild(l),this.backgroundDOM=l;var c=oI("
    "));u.appendChild(c),this.arrowDOM=c,this.container=u},t.prototype.show=function(t){var e=t.text,r=t.x;t.y,t.clientX,t.clientY;this.backgroundDOM.innerHTML=e;var n=this.backgroundDOM.offsetWidth,i=this.backgroundDOM.offsetHeight,o=this.arrowDOM.offsetWidth,a=this.arrowDOM.offsetHeight;rO(this.container,{top:"".concat(-i-a,"px"),left:"".concat(r,"px"),visibility:"visible"}),rO(this.backgroundDOM,{marginLeft:"".concat(-n/2,"px")}),rO(this.arrowDOM,{marginLeft:"".concat(-o/2,"px"),top:"".concat(i,"px")});var s=r-n/2,u=r+n/2;s<0?rO(this.backgroundDOM,{marginLeft:"".concat(-n/2-s,"px")}):u>this.parentWidth&&rO(this.backgroundDOM,{marginLeft:"".concat(-n/2-u+this.parentWidth+12,"px")})},t.prototype.hide=function(){rO(this.container,{top:0,left:0,visibility:"hidden"})},t}(),TO=function(){return(TO=Object.assign||function(t){for(var e,r=1,n=arguments.length;rr&&(o=r,i=e)})}i=e.originalEvent.deltaY>0?Math.max(0,i-1):Math.min(t.speedAxisY.length-1,i+1);var a=t.speedAxisY[i]-n;r=PO(r,[["t",0,a]]),t.speedPoint.setMatrix(r),t.currentSpeed=t.speedAxisY.length-i,t.speedText.attr("text","".concat(t.currentSpeed,".0X")),t.group.emit("timebarConfigChanged",{speed:t.currentSpeed,type:t.currentType})}),this.toggleGroup&&this.toggleGroup.on("toggle-model:click",function(e){var r,n,i=e.target.get("isChecked");i?(t.checkedIcon.hide(),t.checkedText.attr("text",(null===(n=t.controllerCfg)||void 0===n?void 0:n.timePointControllerText)||"单一时间"),t.currentType=FO.RANGE):(t.checkedIcon.show(),t.checkedText.attr("text",(null===(r=t.controllerCfg)||void 0===r?void 0:r.timeRangeControllerText)||"时间范围"),t.currentType=FO.SINGLE),e.target.set("isChecked",!i),t.group.emit("timebarConfigChanged",{type:t.currentType,speed:t.currentSpeed})})},t.prototype.destroy=function(){this.speedGroup.off("speed-rect:click"),this.toggleGroup&&(this.toggleGroup.off("toggle-model:click"),this.toggleGroup.destroy()),this.speedGroup.destroy()},t}(),GO=function(){return(GO=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=b&&n<=A?l:c,a=g.addShape("rect",{attrs:GO({x:i+n*(y+2),y:i,width:y,height:p},o),draggable:!0,name:"tick-rect-".concat(n)}),s=g.addShape("rect",{attrs:{x:i+n*y+2*(2*n-1)/2,y:i,width:0===n||n===d-1?y+1:y+2,height:p,fill:"#fff",opacity:0},draggable:!0,name:"pick-rect-".concat(n)});s.toFront();var h,w=a.getBBox(),_=(w.minX+w.maxX)/2;if(v.push({rect:a,pickRect:s,value:e.date,x:_,y:w.minY}),u?(h=u(e),!(0,Ux.isString)(h)&&h&&(h=e.date)):n%Math.round(d/10)==0&&(h=e.date),h){m.push(h);var S=w.maxY+2*i;g.addShape("line",{attrs:{stroke:"#BFBFBF",x1:_,y1:S,x2:_,y2:S+4},name:"tick-line"});var E=S+4+i,C=g.addShape("text",{attrs:GO({fill:"#8c8c8c",stroke:"#fff",lineWidth:1,x:_,y:E,textAlign:"center",text:h,textBaseline:"top",fontSize:10,fontFamily:t.fontFamily||"Arial, sans-serif"},f),capture:!1,name:"tick-label"}),k=C.getBBox();if(k.maxX>r?C.attr("textAlign","right"):k.minX<0&&C.attr("textAlign","left"),(0,Ux.isNumber)(x)&&10!==m.length){var I=UO([1,0,0,0,1,0,0,0,1],[["t",-_,-E],["r",x],["t",_-5,E+2]]);C.attr({textAlign:"left",matrix:I})}1===m.length?C.attr({textAlign:"left"}):10===m.length&&C.attr({textAlign:"right"})}}),this.tickRects=v;var w=this.group;this.currentSpeed=1,this.controllerBtnGroup=new zO(GO({group:w,x:this.x,y:this.y+n+5,width:r,height:40,hideTimeTypeController:!0,speed:this.currentSpeed,fontFamily:this.fontFamily||"Arial, sans-serif"},this.controllerCfg))},t.prototype.initEvent=function(){var t=this,e=this.sliceGroup;e.on("click",function(e){var r=e.target;if("rect"===r.get("type")&&r.get("name")){var n=parseInt(r.get("name").split("-")[2],10);if(!isNaN(n)){var i=t.tickRects,o=t.unselectedTickStyle;i.forEach(function(t){t.rect.attr(o)});var a=t.selectedTickStyle;i[n].rect.attr(a),t.startTickRectId=n,t.endTickRectId=n;var s=n/i.length;t.graph.emit("valuechange",{value:[s,s]})}}}),e.on("dragstart",function(e){var r=t.tickRects,n=t.unselectedTickStyle;r.forEach(function(t){t.rect.attr(n)});var i=e.target,o=parseInt(i.get("name").split("-")[2],10),a=t.selectedTickStyle;r[o].rect.attr(a),t.startTickRectId=o;var s=o/r.length;t.graph.emit("valuechange",{value:[s,s]}),t.dragging=!0}),e.on("dragover",function(e){if(t.dragging&&"rect"===e.target.get("type")){for(var r=parseInt(e.target.get("name").split("-")[2],10),n=t.startTickRectId,i=t.tickRects,o=t.selectedTickStyle,a=t.unselectedTickStyle,s=0;s=n&&s<=r?o:a;i[s].rect.attr(u)}var l=i.length;t.endTickRectId=r;var c=n/l,f=r/l;t.graph.emit("valuechange",{value:[c,f]})}}),e.on("drop",function(e){if(t.dragging&&(t.dragging=!1,"rect"===e.target.get("type"))){var r=t.startTickRectId,n=parseInt(e.target.get("name").split("-")[2],10);if(!(n0?this.endTickRectId++:(e[this.endTickRectId].rect.attr(n),this.endTickRectId--),o!==this.startTickRectId)this.endTickRectIdthis.max?NaN:this.values[n]},e.prototype.getText=function(e){for(var r=[],n=1;n1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(qO),KO=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,JO="[^\\s]+",ZO=/\[([^]*?)\]/gm;function $O(t,e){for(var r=[],n=0,i=t.length;n-1?n:null}};function eM(t){for(var e=[],r=1;r3?0:(t-t%10!=10?1:0)*t%10]}},aM=eM({},oM),sM=function(t){return aM=eM(aM,t)},uM=function(t){return t.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},lM=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length0?"-":"+")+lM(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+lM(Math.floor(Math.abs(e)/60),2)+":"+lM(Math.abs(e)%60,2)}},fM=function(t){return+t-1},hM=[null,"\\d\\d?"],pM=[null,JO],dM=["isPm",JO,function(t,e){var r=t.toLowerCase();return r===e.amPm[0]?0:r===e.amPm[1]?1:null}],yM=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(t){var e=(t+"").match(/([+-]|\d\d)/gi);if(e){var r=60*+e[1]+parseInt(e[2],10);return"+"===e[0]?r:-r}return 0}],gM={D:["day","\\d\\d?"],DD:["day","\\d\\d"],Do:["day","\\d\\d?"+JO,function(t){return parseInt(t,10)}],M:["month","\\d\\d?",fM],MM:["month","\\d\\d",fM],YY:["year","\\d\\d",function(t){var e=+(""+(new Date).getFullYear()).substr(0,2);return+(""+(+t>68?e-1:e)+t)}],h:["hour","\\d\\d?",void 0,"isPm"],hh:["hour","\\d\\d",void 0,"isPm"],H:["hour","\\d\\d?"],HH:["hour","\\d\\d"],m:["minute","\\d\\d?"],mm:["minute","\\d\\d"],s:["second","\\d\\d?"],ss:["second","\\d\\d"],YYYY:["year","\\d{4}"],S:["millisecond","\\d",function(t){return 100*+t}],SS:["millisecond","\\d\\d",function(t){return 10*+t}],SSS:["millisecond","\\d{3}"],d:hM,dd:hM,ddd:pM,dddd:pM,MMM:["month",JO,tM("monthNamesShort")],MMMM:["month",JO,tM("monthNames")],a:dM,A:dM,ZZ:yM,Z:yM},vM={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},mM=function(t){return eM(vM,t)},bM=function(t,e,r){if(void 0===e&&(e=vM.default),void 0===r&&(r={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var n=[];e=(e=vM[e]||e).replace(ZO,function(t,e){return n.push(e),"@@@"});var i=eM(eM({},aM),r);return(e=e.replace(KO,function(e){return cM[e](t,i)})).replace(/@@@/g,function(){return n.shift()})};function AM(t,e,r){if(void 0===r&&(r={}),"string"!=typeof e)throw new Error("Invalid format in fecha parse");if(e=vM[e]||e,t.length>1e3)return null;var n={year:(new Date).getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},i=[],o=[],a=e.replace(ZO,function(t,e){return o.push(uM(e)),"@@@"}),s={},u={};a=uM(a).replace(KO,function(t){var e=gM[t],r=e[0],n=e[1],o=e[3];if(s[r])throw new Error("Invalid format. "+r+" specified twice in format");return s[r]=!0,o&&(u[o]=!0),i.push(e),"("+n+")"}),Object.keys(u).forEach(function(t){if(!s[t])throw new Error("Invalid format. "+t+" is required in specified format")}),a=a.replace(/@@@/g,function(){return o.shift()});var l=t.match(new RegExp(a,"i"));if(!l)return null;for(var c,f=eM(eM({},aM),r),h=1;h11||n.month<0||n.day>31||n.day<1||n.hour>23||n.hour<0||n.minute>59||n.minute<0||n.second>59||n.second<0)return null;return c}var xM={format:bM,parse:AM,defaultI18n:oM,setGlobalDateI18n:sM,setGlobalDateMasks:mM};var wM="format";function _M(t,e){return(m[wM]||xM[wM])(t,e)}function SM(t){return(0,Ux.isString)(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),(0,Ux.isDate)(t)&&(t=t.getTime()),t}var EM=1e3,CM=60*EM,kM=60*CM,IM=24*kM,TM=31*IM,OM=365*IM,MM=[["HH:mm:ss",EM],["HH:mm:ss",10*EM],["HH:mm:ss",30*EM],["HH:mm",CM],["HH:mm",10*CM],["HH:mm",30*CM],["HH",kM],["HH",6*kM],["HH",12*kM],["YYYY-MM-DD",IM],["YYYY-MM-DD",4*IM],["YYYY-WW",7*IM],["YYYY-MM",TM],["YYYY-MM",4*TM],["YYYY-MM",6*TM],["YYYY",380*IM]];function PM(t,e,r){var n,i=(n=function(t){return t[1]},function(t,e,r,i){for(var o=(0,Ux.isNil)(r)?0:r,a=(0,Ux.isNil)(i)?t.length:i;o>>1;n(t[s])>e?a=s:o=s+1}return o})(MM,(e-t)/r)-1,o=MM[i];return i<0?o=MM[0]:i>=MM.length&&(o=(0,Ux.last)(MM)),o}var LM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="timeCat",e}return(0,Gx.__extends)(e,t),e.prototype.translate=function(t){t=SM(t);var e=this.values.indexOf(t);return-1===e&&(e=(0,Ux.isNumber)(t)&&t-1){var n=this.values[r],i=this.formatter;return n=i?i(n,e):_M(n,this.mask)}return t},e.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},e.prototype.setDomain=function(){var e=this.values;(0,Ux.each)(e,function(t,r){e[r]=SM(t)}),e.sort(function(t,e){return t-e}),t.prototype.setDomain.call(this)},e}(XO),NM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isContinuous=!0,e}return(0,Gx.__extends)(e,t),e.prototype.scale=function(t){if((0,Ux.isNil)(t))return NaN;var e=this.rangeMin(),r=this.rangeMax();return this.max===this.min?e:e+this.getScalePercent(t)*(r-e)},e.prototype.init=function(){t.prototype.init.call(this);var e=this.ticks,r=(0,Ux.head)(e),n=(0,Ux.last)(e);rthis.max&&(this.max=n),(0,Ux.isNil)(this.minLimit)||(this.min=r),(0,Ux.isNil)(this.maxLimit)||(this.max=n)},e.prototype.setDomain=function(){var t=(0,Ux.getRange)(this.values),e=t.min,r=t.max;(0,Ux.isNil)(this.min)&&(this.min=e),(0,Ux.isNil)(this.max)&&(this.max=r),this.min>this.max&&(this.min=e,this.max=r)},e.prototype.calculateTicks=function(){var e=this,r=t.prototype.calculateTicks.call(this);return this.nice||(r=(0,Ux.filter)(r,function(t){return t>=e.min&&t<=e.max})),r},e.prototype.getScalePercent=function(t){var e=this.max,r=this.min;return(t-r)/(e-r)},e.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},e}(qO),jM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="linear",e.isLinear=!0,e}return(0,Gx.__extends)(e,t),e.prototype.invert=function(t){var e=this.getInvertPercent(t);return this.min+e*(this.max-this.min)},e.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},e}(NM);function RM(t,e){var r=Math.E;return e>=0?Math.pow(r,Math.log(e)/t):-1*Math.pow(r,Math.log(-e)/t)}function DM(t,e){return 1===t?1:Math.log(e)/Math.log(t)}function BM(t,e,r){(0,Ux.isNil)(r)&&(r=Math.max.apply(null,t));var n=r;return(0,Ux.each)(t,function(t){t>0&&t1&&(n=1),n}var FM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e}return(0,Gx.__extends)(e,t),e.prototype.invert=function(t){var e,r=this.base,n=DM(r,this.max),i=this.rangeMin(),o=this.rangeMax()-i,a=this.positiveMin;if(a){if(0===t)return 0;var s=1/(n-(e=DM(r,a/r)))*o;if(t=0?1:-1;return Math.pow(o,r)*a},e.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},e.prototype.getScalePercent=function(t){var e=this.max,r=this.min;if(e===r)return 0;var n=this.exponent;return(RM(n,t)-RM(n,r))/(RM(n,e)-RM(n,r))},e}(NM),GM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="time",e}return(0,Gx.__extends)(e,t),e.prototype.getText=function(t,e){var r=this.translate(t),n=this.formatter;return n?n(r,e):_M(r,this.mask)},e.prototype.scale=function(e){var r=e;return((0,Ux.isString)(r)||(0,Ux.isDate)(r))&&(r=this.translate(r)),t.prototype.scale.call(this,r)},e.prototype.translate=function(t){return SM(t)},e.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},e.prototype.setDomain=function(){var t=this.values,e=this.getConfig("min"),r=this.getConfig("max");if((0,Ux.isNil)(e)&&(0,Ux.isNumber)(e)||(this.min=this.translate(this.min)),(0,Ux.isNil)(r)&&(0,Ux.isNumber)(r)||(this.max=this.translate(this.max)),t&&t.length){var n=[],i=1/0,o=i,a=0;(0,Ux.each)(t,function(t){var e=SM(t);if(isNaN(e))throw new TypeError("Invalid Time: "+t+" in time scale!");i>e?(o=i,i=e):o>e&&(o=e),a1&&(this.minTickInterval=o-i),(0,Ux.isNil)(e)&&(this.min=i),(0,Ux.isNil)(r)&&(this.max=a)}},e}(jM),UM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantize",e}return(0,Gx.__extends)(e,t),e.prototype.invert=function(t){var e=this.ticks,r=e.length,n=this.getInvertPercent(t),i=Math.floor(n*(r-1));if(i>=r-1)return(0,Ux.last)(e);if(i<0)return(0,Ux.head)(e);var o=e[i],a=i/(r-1);return o+(n-a)/((i+1)/(r-1)-a)*(e[i+1]-o)},e.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},e.prototype.calculateTicks=function(){var e=t.prototype.calculateTicks.call(this);return this.nice||((0,Ux.last)(e)!==this.max&&e.push(this.max),(0,Ux.head)(e)!==this.min&&e.unshift(this.min)),e},e.prototype.getScalePercent=function(t){var e=this.ticks;if(t<(0,Ux.head)(e))return 0;if(t>(0,Ux.last)(e))return 1;var r=0;return(0,Ux.each)(e,function(e,n){if(!(t>=e))return!1;r=n}),r/(e.length-1)},e}(NM),HM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantile",e}return(0,Gx.__extends)(e,t),e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(UM),VM={};function QM(t){return VM[t]}function YM(t,e){if(QM(t))throw new Error("type '"+t+"' existed.");VM[t]=e}var WM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="identity",e.isIdentity=!0,e}return(0,Gx.__extends)(e,t),e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&(0,Ux.isNumber)(t)?t:this.range[0]},e.prototype.invert=function(t){var e=this.range;return te[1]?NaN:this.values[0]},e}(qO);function qM(t){var e=t.values,r=t.tickInterval,n=t.tickCount,i=t.showLast;if((0,Ux.isNumber)(r)){var o=(0,Ux.filter)(e,function(t,e){return e%r==0}),a=(0,Ux.last)(e);return i&&(0,Ux.last)(o)!==a&&o.push(a),o}var s=e.length,u=t.min,l=t.max;if((0,Ux.isNil)(u)&&(u=0),(0,Ux.isNil)(l)&&(l=e.length-1),!(0,Ux.isNumber)(n)||n>=s)return e.slice(u,l+1);if(n<=0||l<=0)return[];for(var c=1===n?s:Math.floor(s/(n-1)),f=[],h=u,p=0;p=l);p++)h=Math.min(u+p*c,l),p===n-1&&i?f.push(e[l]):f.push(e[h]);return f}var XM=Math.sqrt(50),KM=Math.sqrt(10),JM=Math.sqrt(2),ZM=function(){function t(){this._domain=[0,1]}return t.prototype.domain=function(t){return t?(this._domain=Array.from(t,Number),this):this._domain.slice()},t.prototype.nice=function(t){var e,r;void 0===t&&(t=5);var n,i=this._domain.slice(),o=0,a=this._domain.length-1,s=this._domain[o],u=this._domain[a];return u0?n=$M(s=Math.floor(s/n)*n,u=Math.ceil(u/n)*n,t):n<0&&(n=$M(s=Math.ceil(s*n)/n,u=Math.floor(u*n)/n,t)),n>0?(i[o]=Math.floor(s/n)*n,i[a]=Math.ceil(u/n)*n,this.domain(i)):n<0&&(i[o]=Math.ceil(s*n)/n,i[a]=Math.floor(u*n)/n,this.domain(i)),this},t.prototype.ticks=function(t){return void 0===t&&(t=5),function(t,e,r){var n,i,o,a,s=-1;if(r=+r,(t=+t)==(e=+e)&&r>0)return[t];(n=e0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++s=0?(o>=XM?10:o>=KM?5:o>=JM?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=XM?10:o>=KM?5:o>=JM?2:1)}function tP(t,e,r){return("ceil"===r?Math.ceil(t/e):"floor"===r?Math.floor(t/e):Math.round(t/e))*e}function eP(t,e,r){var n=tP(t,r,"floor"),i=tP(e,r,"ceil");n=(0,Ux.fixedBase)(n,r),i=(0,Ux.fixedBase)(i,r);for(var o=[],a=Math.max((i-n)/(Math.pow(2,12)-1),r),s=n;s<=i;s+=a){var u=(0,Ux.fixedBase)(s,a);o.push(u)}return{min:n,max:i,ticks:o}}function rP(t,e,r){var n,i=t.minLimit,o=t.maxLimit,a=t.min,s=t.max,u=t.tickCount,l=void 0===u?5:u,c=(0,Ux.isNil)(i)?(0,Ux.isNil)(e)?a:e:i,f=(0,Ux.isNil)(o)?(0,Ux.isNil)(r)?s:r:o;if(c>f&&(f=(n=[c,f])[0],c=n[1]),l<=2)return[c,f];for(var h=(f-c)/(l-1),p=[],d=0;d=0&&(u=1),1-s/(a-1)-r+u}function sP(t,e,r){var n=(0,Ux.size)(e);return 1-(0,Ux.indexOf)(e,t)/(n-1)-r+1}function uP(t,e,r,n,i,o){var a=(t-1)/(o-i),s=(e-1)/(Math.max(o,n)-Math.min(r,i));return 2-Math.max(a/s,s/a)}function lP(t,e){return t>=e?2-(t-1)/(e-1):1}function cP(t,e,r,n){var i=e-t;return 1-.5*(Math.pow(e-n,2)+Math.pow(t-r,2))/Math.pow(.1*i,2)}function fP(t,e,r){var n=e-t;if(r>n){var i=(r-n)/2;return 1-Math.pow(i,2)/Math.pow(.1*n,2)}return 1}function hP(t,e,r,n,i,o){void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=iP),void 0===o&&(o=[.25,.2,.5,.05]);var a=r<0?0:Math.round(r);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!a)return{min:0,max:0,ticks:[]};if(e-t<1e-15||1===a)return{min:t,max:e,ticks:[t]};if(e-t>1e148){var s=(e-t)/(x=r||5);return{min:t,max:e,ticks:Array(x).fill(null).map(function(e,r){return nP(t+s*r)})}}for(var u={score:-2,lmin:0,lmax:0,lstep:0},l=1;l<1/0;){for(var c=0;cu.score&&(!n||_<=t&&S>=e)&&(u.lmin=_,u.lmax=S,u.lstep=E,u.score=T)}g+=1}p+=1}}l+=1}var O=nP(u.lmax),M=nP(u.lmin),P=nP(u.lstep),L=Math.floor(function(t){return Math.round(1e12*t)/1e12}((O-M)/P))+1,N=new Array(L);N[0]=nP(M);for(c=1;c1&&(i*=Math.ceil(a)),n&&iOM)for(var u=yP(r),l=Math.ceil(o/OM),c=s;c<=u+l;c+=l)a.push(gP(c));else if(o>TM){var f=Math.ceil(o/TM),h=vP(e),p=function(t,e){var r=yP(t),n=yP(e),i=vP(t);return 12*(n-r)+(vP(e)-i)%12}(e,r);for(c=0;c<=p+f;c+=f)a.push(mP(s,c+h))}else if(o>IM){var d=(b=new Date(e)).getFullYear(),y=b.getMonth(),g=b.getDate(),v=Math.ceil(o/IM),m=function(t,e){return Math.ceil((e-t)/IM)}(e,r);for(c=0;ckM){d=(b=new Date(e)).getFullYear(),y=b.getMonth(),v=b.getDate();var b,A=b.getHours(),x=Math.ceil(o/kM),w=function(t,e){return Math.ceil((e-t)/kM)}(e,r);for(c=0;c<=w+x;c+=x)a.push(new Date(d,y,v,A+c).getTime())}else if(o>CM){var _=function(t,e){return Math.ceil((e-t)/6e4)}(e,r),S=Math.ceil(o/CM);for(c=0;c<=_+S;c+=S)a.push(e+c*CM)}else{var E=o;E=512&&console.warn("Notice: current ticks length("+a.length+') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is '+o+") is too small, increase the value to solve the problem!"),a}),WO("log",function(t){var e,r=t.base,n=t.tickCount,i=t.min,o=t.max,a=t.values,s=DM(r,o);if(i>0)e=Math.floor(DM(r,i));else{var u=BM(a,r,o);e=Math.floor(DM(r,u))}for(var l=s-e,c=Math.ceil(l/n),f=[],h=e;h=0?1:-1;return Math.pow(t,e)*r})}),WO("quantile",function(t){var e=t.tickCount,r=t.values;if(!r||!r.length)return[];for(var n=r.slice().sort(function(t,e){return t-e}),i=[],o=0;op?(s.show(),l.show(),p=c.minX+c.width+10):(s.hide(),l.hide()),s}),this.controllerBtnGroup=new zO(PP({group:this.group,x:this.x,y:this.y+r+25,width:e,height:35},this.controllerCfg)),this.updateStartEnd(0),this.updateUI(),o.move(this.x,this.y),this.bindEvents(),this.currentMode===FO.SINGLE&&(this.minHandlerShape.hide(),this.foregroundShape.hide(),this.minTextShape.hide())},t.prototype.bindEvents=function(){var t=this,e=this.group.find(function(t){return"minHandlerShape"===t.get("name")});e&&(e.on("minHandlerShape-handler:mousedown",this.onMouseDown(this.minHandlerShape)),e.on("minHandlerShape-handler:touchstart",this.onMouseDown(this.minHandlerShape)));var r=this.group.find(function(t){return"maxHandlerShape"===t.get("name")});r&&(r.on("maxHandlerShape-handler:mousedown",this.onMouseDown(this.maxHandlerShape)),r.on("maxHandlerShape-handler:touchstart",this.onMouseDown(this.maxHandlerShape))),this.foregroundShape.on("mousedown",this.onMouseDown(this.foregroundShape)),this.foregroundShape.on("touchstart",this.onMouseDown(this.foregroundShape)),this.group.on("".concat("playPauseBtn",":click"),function(){t.isPlay=!t.isPlay,t.currentHandler=t.maxHandlerShape,t.changePlayStatus()}),this.group.on("".concat("nextStepBtn",":click"),function(){t.currentHandler=t.maxHandlerShape,t.updateStartEnd(.01),t.updateUI()}),this.group.on("".concat("preStepBtn",":click"),function(){t.currentHandler=t.maxHandlerShape,t.updateStartEnd(-.01),t.updateUI()}),this.group.on("timebarConfigChanged",function(e){var r=e.type,n=e.speed;t.currentSpeed=n,t.currentMode=r,r===FO.SINGLE?(t.minHandlerShape.hide(),t.foregroundShape.hide(),t.minTextShape.hide()):r===FO.RANGE&&(t.minHandlerShape.show(),t.foregroundShape.show(),t.minTextShape.show())})},t.prototype.adjustTickIndex=function(t){for(var e=0;e1&&(this.start=1),this.end>1&&(this.end=1),this.end<0&&(this.end=0);var e=this.x+this.start*this.width,r=this.x+this.end*this.width;this.foregroundShape.attr("x",e),this.foregroundShape.attr("width",r-e);var n=(0,Ux.get)(this.handlerStyle,"width",2);this.setText(this.minText,this.maxText);var i=this.dodgeText([e,r]),o=i[0],a=i[1];this.minHandlerShape.setX(e-n/2),(0,Ux.each)(o,function(e,r){return t.minTextShape.attr(r,e)}),this.maxHandlerShape.setX(r-n/2),(0,Ux.each)(a,function(e,r){return t.maxTextShape.attr(r,e)}),this.currentMode===FO.RANGE?this.graph.emit("valuechange",{value:[this.start,this.end].sort()}):this.currentMode===FO.SINGLE&&this.graph.emit("valuechange",{value:[this.end,this.end]})},t.prototype.dodgeText=function(t){var e,r,n=(0,Ux.get)(this.handlerStyle,"width",2),i=this.minTextShape,o=this.maxTextShape,a=t[0],s=t[1],u=!1;a>s&&(a=(e=[s,a])[0],s=e[1],i=(r=[o,i])[0],o=r[1],u=!0);var l=i.getBBox(),c=o.getBBox(),f=null,h=null;return"trend"===this.timeBarType?(f=a-l.widththis.x+this.width?{x:s-n/2-2,textAlign:"right"}:{x:s+n/2+2,textAlign:"left"}):"simple"===this.timeBarType&&(f=i.attr("x")>l.width?{x:a,textAlign:"center"}:{x:a,textAlign:"left"},h=o.attr("x")>this.width-c.width?{x:s,textAlign:"right"}:{x:s,textAlign:"center"}),u?[h,f]:[f,h]},t.prototype.startPlay=function(){var t=this;return"undefined"!=typeof window?window.requestAnimationFrame(function(){var e=t,r=e.ticks,n=e.width,i=t.currentSpeed,o=n/r.length/(1e3*(10-i)/60),a=t.adjustOffsetRange(o/t.width);t.updateStartEnd(a),t.updateUI(),t.isPlay&&(t.playHandler=t.startPlay())}):void 0},t.prototype.changePlayStatus=function(t){void 0===t&&(t=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit("timebarstartplay",null)):this.playHandler&&("undefined"!=typeof window&&window.cancelAnimationFrame(this.playHandler),t&&this.graph.emit("timebarendplay",null))},t.prototype.destory=function(){this.graph.off("valuechange",function(){});var t=this.group,e=t.find(function(t){return"minHandlerShape"===t.get("name")});e&&(e.off("minHandlerShape-handler:mousedown"),e.off("minHandlerShape-handler:touchstart"),e.destroy());var r=t.find(function(t){return"maxHandlerShape"===t.get("name")});r&&(r.off("maxHandlerShape-handler:mousedown"),r.off("maxHandlerShape-handler:touchstart"),r.destroy()),this.foregroundShape.off("mousedown"),this.foregroundShape.off("touchstart"),this.foregroundShape.destroy(),t.off("".concat("playPauseBtn",":click")),t.off("".concat("nextStepBtn",":click")),t.off("".concat("preStepBtn",":click")),t.off("timebarConfigChanged"),t.destroy(),this.trendComponent&&this.trendComponent.destory()},t}(),UP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),HP=function(){return(HP=Object.assign||function(t){for(var e,r=1,n=arguments.length;r")),{position:"relative"}),a)&&this.get("graph").get("container").appendChild(t);this.set("timeBarContainer",t),e="SVG"===r.get("renderer")?new nI({container:t,width:i,height:o}):new ck({container:t,width:i,height:o}),this.get("containerCSS")&&rO(t,this.get("containerCSS")),this.set("canvas",e)},e.prototype.init=function(){this.initContainer();var t=this.get("canvas").addGroup({name:"timebar-group"});this.set("timeBarGroup",t),this.renderTrend(),this.initEvent();var e="undefined"!=typeof window&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif";this.set("fontFamily",e)},e.prototype.play=function(){this.togglePlay(!0)},e.prototype.pause=function(){this.togglePlay(!1)},e.prototype.togglePlay=function(t){var e=this.get("timebar");e&&(e.isPlay=!!t,e.changePlayStatus())},e.prototype.renderTrend=function(){var t=this,e=this._cfgs,r=e.width,n=e.x,i=e.y,o=e.padding,a=e.type,s=e.trend,u=e.slider,l=e.controllerCfg,c=e.textStyle,f=e.tick,h=e.backgroundStyle,p=e.foregroundStyle,d=s.data,y=VP(s,["data"]),g=r-2*o,v="trend"===a?26:4,m=this.get("graph"),b=this.get("timeBarGroup"),A=this.get("canvas"),x=null;if("trend"===a||"simple"===a){var w=this.get("getValue");x=new GP(HP(HP({graph:m,canvas:A,group:b,type:a,x:n+o,y:"trend"===a?i+o:i+o+15,width:g,height:v,padding:o,backgroundStyle:h,foregroundStyle:p,trendCfg:HP(HP({},y),{data:d.map(function(t){return(null===w||void 0===w?void 0:w(t))||t.value})})},u),{tick:{ticks:d,tickLabelFormatter:f.tickLabelFormatter,tickLabelStyle:f.tickLabelStyle,tickLineStyle:f.tickLineStyle},handlerStyle:HP(HP({},u.handlerStyle),{height:u.height||v}),controllerCfg:l,textStyle:c}))}else"tick"===a&&(x=new QO(HP({graph:m,canvas:A,group:b,x:n+o,y:i+o,width:r,height:42,padding:2,controllerCfg:l},f)));var _=function e(){var r=t.get("timebar");r.draggingHandler=!1,r.isPlay&&(r.isPlay=!1,r.currentHandler=r.maxHandlerShape,r.changePlayStatus()),document.removeEventListener("mouseup",e)};A.on("mousedown",function(t){"maxHandlerShape-handler"!==t.target.get("name")&&"minHandlerShape-handler"!==t.target.get("name")&&t.target!==x.foregroundShape||document.addEventListener("mouseup",_)}),this.set("timebar",x)},e.prototype.filterData=function(t){var e,r=t.value;if(!r){r=[];var n=this._cfgs.type;n&&"trend"!==n&&"simple"!==n?"tick"===n&&(r[0]=this._cfgs.tick.start,r[1]=this._cfgs.tick.end):(r[0]=this._cfgs.slider.start,r[1]=this._cfgs.slider.end)}var i=null,o=this._cfgs.type;if("trend"===o||"simple"===o?i=this._cfgs.trend.data:"tick"===o&&(i=this._cfgs.tick.data),i&&0!==i.length){var a=this.get("rangeChange"),s=this.get("graph"),u=Math.round(i.length*r[0]),l=Math.round(i.length*r[1]);l=l>=i.length?i.length-1:l,u=u>=i.length?i.length-1:u;var c=null===(e=this._cfgs.tick)||void 0===e?void 0:e.tickLabelFormatter,f=c?c(i[u]):i[u].date,h=c?c(i[l]):i[l].date;if("tick"!==o)this.get("timebar").setText(f,h);if(a)a(s,f,h);else{(!this.cacheGraphData||this.cacheGraphData.nodes&&0===this.cacheGraphData.nodes.length)&&(this.cacheGraphData=s.get("data"));var p=this.get("filterItemTypes"),d=this.get("changeData"),y=this.get("getDate"),g=this.get("shouldIgnore"),v=i[u].date,m=i[l].date;if(d||void 0===d){var b=this.cacheGraphData.nodes,A=this.cacheGraphData.edges,x={},w={};s.getNodes().forEach(function(t){return x[t.getID()]=!0}),s.getEdges().forEach(function(t){return w[t.getID()]=!0}),p.includes("node")&&(null===b||void 0===b||b.forEach(function(t){var e=+((null===y||void 0===y?void 0:y(t))||t.date),r=e>=v&&e<=m||(null===g||void 0===g?void 0:g("node",t,{min:v,max:m})),n=x[t.id];n&&!r?(s.removeItem(t.id),x[t.id]=!1):!n&&r&&(s.addItem("node",t),x[t.id]=!0)}),null===A||void 0===A||A.forEach(function(t){var e=x[t.source]&&x[t.target]||(null===g||void 0===g?void 0:g("edge",t,{min:v,max:m})),r=!!s.findById(t.id);r&&!e?(s.removeItem(t.id),w[t.id]=!1):!r&&e?(s.addItem("edge",t),w[t.id]=!0):r||(w[t.id]=!1)})),(this.get("filterEdge")||p.includes("edge"))&&(null===A||void 0===A||A.filter(function(t){var e=+((null===y||void 0===y?void 0:y(t))||t.date),r=e>=v&&e<=m||(null===g||void 0===g?void 0:g("edge",t,{min:v,max:m})),n=x[t.source]&&x[t.target],i=r&&n,o=w[t.id];o&&!i?(w[t.id]=!1,s.removeItem(t.id)):!o&&i&&(w[t.id]=!0,s.addItem("edge",t))}))}else p.includes("node")&&s.getNodes().forEach(function(t){var e=t.getModel();if(null===g||void 0===g||!g("node",e,{min:v,max:m})){var r=+((null===y||void 0===y?void 0:y(e))||e.date);rm?s.hideItem(t):s.showItem(t)}}),(this.get("filterEdge")||p.includes("edge"))&&s.getEdges().forEach(function(t){var e=t.getModel();if(null===g||void 0===g||!g("edge",e,{min:i[u].date,max:i[l].date})){var r=+((null===y||void 0===y?void 0:y(e))||e.date);if(ri[l].date)s.hideItem(t);else{var n=t.getSource().isVisible(),o=t.getTarget().isVisible();n&&o&&s.showItem(t)}}})}}else console.warn("请配置 TimeBar 组件的数据")},e.prototype.initEvent=function(){var t=this.get("graph");t.on("afterchangedata",this.changeData),t.on("afterrender",this.afterrenderListener),t.on("valuechange",this.valueChangeListener)},e.prototype.destroy=function(){var e=this.get("graph");e.off("afterchangedata",this.changeData),e.off("afterrender",this.afterrenderListener),e.off("valuechange",this.valueChangeListener);var r=this.get("timebar");r&&r.destory&&r.destory(),t.prototype.destroy.call(this);var n=this.get("timeBarContainer");if(n){var i=this.get("container");i||(i=this.get("graph").get("container")),(0,Ux.isString)(i)&&(i=document.getElementById(i)),i===n&&(i=i.parentElement),i.removeChild(n)}},e}(nO),YP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),WP=WE.applyMatrix;var qP=function(t){function e(e){return t.call(this,e)||this}return YP(e,t),e.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-minimap",viewportClassName:"g6-minimap-viewport",width:200,delegateStyle:{fill:"#40a9ff",stroke:"#096dd9"},refresh:!0}},e.prototype.getEvents=function(){return{beforepaint:"updateViewport",beforeanimate:"disableRefresh",afteranimate:"enableRefresh",viewportchange:"disableOneRefresh"}},e.prototype.disableRefresh=function(){this.set("refresh",!1)},e.prototype.enableRefresh=function(){this.set("refresh",!0),this.updateCanvas()},e.prototype.disableOneRefresh=function(){this.set("viewportChange",!0)},e.prototype.initViewport=function(){var t=this,e=this._cfgs,r=e.graph;if(!this.destroyed){var n=this.get("container");(0,Ux.isString)(n)&&(n=document.getElementById(n));var i=oI("
    ")),o=0,a=0,s=!1,u=0,l=0,c=0,f=0,h=0,p=0;n.addEventListener("mousedown",function(n){if(e.refresh=!1,n.target===i){var u=i.style;c=parseInt(u.width,10),f=parseInt(u.height,10);var l=t.get("width"),d=t.get("height");c>l||f>d||(p=r.getZoom(),h=t.get("ratio"),s=!0,o=n.clientX,a=n.clientY)}},!1),n.addEventListener("mousemove",function(e){if(s&&!(0,Ux.isNil)(e.clientX)&&!(0,Ux.isNil)(e.clientY)){var n=t.get("width"),d=t.get("height"),y=i.style;u=parseInt(y.left,10),l=parseInt(y.top,10),c=parseInt(y.width,10),f=parseInt(y.height,10);var g=o-e.clientX,v=a-e.clientY;u-g<0?g=u:u-g+c>=n&&(g=0),l-v<0?v=l:l-v+f>=d&&(v=0),l-=v,rO(i,{left:"".concat(u-=g,"px"),top:"".concat(l,"px")}),r.translate(g*p/h,v*p/h),o=e.clientX,a=e.clientY}},!1),n.addEventListener("mouseleave",function(){s=!1,e.refresh=!0},!1),n.addEventListener("mouseup",function(){s=!1,e.refresh=!0},!1),this.set("viewport",i),n.appendChild(i)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),e=this.get("width"),r=this.get("height"),n=this.get("graph"),i=n.get("width"),o=i/n.get("height"),a=n.getGroup(),s=a.getCanvasBBox(),u=[(s.minX+s.maxX)/2,(s.minY+s.maxY)/2],l=[s.maxX-s.minX,s.maxY-s.minY],c={centerX:u[0],centerY:u[1],width:0,height:0,minX:0,minY:0};s[0]/s[1]>o?(c.width=l[0],c.height=c.width/o):(c.height=l[1],c.width=c.height*o),c.minX=u[0]-c.width/2,c.minY=u[1]-c.height/2;var f=a.getMatrix();f||(f=[1,0,0,0,1,0,0,0,1]);var h=y_.invert([1,0,0,0,1,0,0,0,1],f),p=WP({x:c.minX,y:c.minY},h),d=n.getCanvasByPoint(p.x,p.y),y=this.get("viewport");y||this.initViewport();var g=i/c.width,v=g*e,m=g*r,b=e*-d.x/c.width,A=r*-d.y/c.height,x=b+v,w=A+m;b<0&&(v+=b,b=0),x>e&&(v-=x-e),A<0&&(m+=A,A=0),w>r&&(m-=w-r),this.set("ratio",t),rO(y,{left:"".concat(b,"px"),top:"".concat(A,"px"),width:"".concat(v,"px"),height:"".concat(m,"px")})}},e.prototype.init=function(){this.initContainer()},e.prototype.initContainer=function(){var t=this.get("graph"),e=t.get("width"),r=t.get("height")/e,n=this.get("className"),i=this.get("container"),o=this.get("width"),a=this.get("height");o||a||(o=200),o?(a=r*o,this.set("height",a)):(o=1/r*a,this.set("width",o));var s=oI("
    "));(0,Ux.isString)(i)&&(i=document.getElementById(i)),i?i.appendChild(s):t.get("container").appendChild(s),this.set("container",s);var u=oI('
    ');s.appendChild(u);var l=oI('');u.appendChild(l),this.set("containerDOM",u),this.set("containerSpan",l);var c=oI(''));this.set("imgDOM",c),this.updateImgSize(),l.appendChild(c),this.updateCanvas()},e.prototype.updateImgSize=function(){var t=this.get("imgDOM"),e=this.get("width"),r=this.get("height");t.onload=function(){var n=function(t,e){var r,n;if(t.naturalWidth)r=t.naturalWidth,n=t.naturalHeight;else{var i=new Image;i.src=t.src,i.onload=function(){e&&e(i.width,i.height)}}return[r,n]}(t);n[0]>n[1]?t.width=e:t.height=r}},e.prototype.updateCanvas=function(){if(this.get("refresh")){var t=this.get("graph");if(!t.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var e=this.get("width")/t.get("canvas").getCanvasBBox().width;this.set("ratio",e),this.updateViewport()}}},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateGraphImg=function(t){this.get("imgDOM").remove(),this.set("graphImg",t);var e=oI(''));this.set("imgDOM",e),e.src=t,this.updateImgSize(),this.get("containerSpan").appendChild(e),this.updateCanvas()},e.prototype.destroy=function(){var t=this.get("container");t.parentNode.removeChild(t)},e}(nO),XP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),KP=function(){return(KP=Object.assign||function(t){for(var e,r=1,n=arguments.length;r(i||r.get("height"))&&e>1||a<(o||.05*r.get("height"))&&e<1)&&(e=1),a*=e,this.set("r",a),this.filter(t)}},e.prototype.filter=function(t){var e=this.get("graph"),r=e.getNodes(),n={},i=this.get("r"),o=this.get("type"),a={x:t.x,y:t.y};this.updateDelegate(a,i);var s=this.get("shouldShow"),u=this.get("vShapes");u&&u.forEach(function(t){t.remove(),t.destroy()}),u=[],r.forEach(function(t){var e=t.getModel(),r=e.x,o=e.y;JP({x:r,y:o},a)
    ");n.appendChild(i),this.set("container",i);var o=this.render();rO(i,this.getContainerPos(o)),this.bindEvents()},e.prototype.getContainerPos=function(t){void 0===t&&(t=[0,0]);var e=this.get("graph"),r=this.get("offsetX"),n=this.get("offsetY"),i=this.get("margin"),o=this.get("position").split("-"),a={top:0,right:1,bottom:2,left:3},s={left:(e.getWidth()-t[0])/2+0,top:(e.getHeight()-t[1])/2+0};return o.forEach(function(r){var n=i[a[r]],o=r;switch(r){case"top":case"left":n+=0;break;case"bottom":n=e.getHeight()-t[1]-n+0,o="top";break;default:n=e.getWidth()-t[0]-n+0,o="left"}s[o]=n}),s.top+=n+e.getContainer().offsetTop,s.left+=r+e.getContainer().offsetLeft,Object.keys(s).forEach(function(t){s[t]="".concat(s[t],"px")}),s},e.prototype.bindEvents=function(){var t=this,e=t.get("filter");if(e&&e.enable){var r=e.trigger||"click";aL.includes(r)||(console.warn("Trigger for legend filterling must be 'click' or 'mouseenter', 'click' will take effect by default."),r="click");var n=t.get("legendCanvas");"mouseenter"===r?(n.on("node-container:mouseenter",function(e){return t.filterData(e)}),n.on("node-container:mouseleave",function(e){t.clearFilter(),t.clearActiveLegend()})):(n.on("node-container:click",function(e){return t.filterData(e)}),n.on("click",function(e){e.target&&e.target.isCanvas&&e.target.isCanvas()&&(t.clearFilter(),t.clearActiveLegend())}))}},e.prototype.changeData=function(t){this.set("data",t);var e=this.render();rO(this.get("container"),this.getContainerPos(e))},e.prototype.activateLegend=function(t){var e=this.get("filter");(null===e||void 0===e?void 0:e.multiple)||this.clearActiveLegend();var r=t.get("parent");r.get("active")?(r.set("active",!1),this.findLegendItemsByState("active").length&&r.set("inactive",!0)):(r.set("inactive",!1),r.set("active",!0)),this.findLegendItemsByState("active").length?this.findLegendItemsByState("active","all",!1).forEach(function(t){t.set("inactive",!0)}):this.clearActiveLegend();var n=(null===e||void 0===e?void 0:e.legendStateStyles)||{},i=(null===n||void 0===n?void 0:n.inactive)||{opacity:.5,"text-shape":{opacity:.5}},o=i["text-shape"]||{};this.findLegendItemsByState("inactive").forEach(function(t){var e=t.get("children"),r=e[0],n=e[1];r.attr(oL(oL({},r.get("oriAttrs")),i)),n.attr(oL(oL({},n.get("oriAttrs")),o))});var a=(null===n||void 0===n?void 0:n.active)||{stroke:"#000",lineWidth:2,"text-shape":{fontWeight:"bold"}},s=a["text-shape"]||{};this.findLegendItemsByState("active").forEach(function(t){var e=t.get("children"),r=e[0],n=e[1];r.attr(oL(oL({},r.get("oriAttrs")),a)),n.attr(oL(oL({},n.get("oriAttrs")),s))})},e.prototype.findLegendItemsByState=function(t,e,r){void 0===e&&(e="all"),void 0===r&&(r=!0);var n=this.get("legendCanvas").find(function(t){return"root"===t.get("name")}),i=n.find(function(t){return"node-group"===t.get("name")}),o=n.find(function(t){return"edge-group"===t.get("name")});return"node"===e?i.get("children").filter(function(e){return!!e.get(t)===r}):"edge"===e?o.get("children").filter(function(e){return!!e.get(t)===r}):i.get("children").filter(function(e){return!!e.get(t)===r}).concat(o.get("children").filter(function(e){return!!e.get(t)===r}))},e.prototype.clearActiveLegend=function(){var t=this.get("legendCanvas").find(function(t){return"root"===t.get("name")});[t.find(function(t){return"node-group"===t.get("name")}),t.find(function(t){return"edge-group"===t.get("name")})].forEach(function(t){t.get("children").forEach(function(t){t.set("active",!1),t.set("inactive",!1);var e=t.get("children"),r=e[0],n=e[1];r.attr(r.get("oriAttrs")),n.attr(n.get("oriAttrs"))})})},e.prototype.filterData=function(t){var e=this.get("filter"),r=null===e||void 0===e?void 0:e.filterFunctions;if(e&&r){var n=this.get("legendCanvas"),i=this.get("graph"),o=e.graphActiveState||"active",a=e.graphInactiveState||"inactive",s=e.multiple;this.clearFilter(),s||this.clearActiveLegend(),this.activateLegend(t.target);var u=n.find(function(t){return"root"===t.get("name")}),l=u.find(function(t){return"node-group"===t.get("name")}),c=u.find(function(t){return"edge-group"===t.get("name")}),f=l.get("children").filter(function(t){return t.get("active")}),h=c.get("children").filter(function(t){return t.get("active")}),p=0,d=["getNodes","getEdges"];d.forEach(function(t){i[t]().forEach(function(e){var n=!1;("getNodes"===t?f:h).forEach(function(t){var i=r[t.get("id")];n=n||i(e.getModel())}),n?(i.setItemState(e,a,!1),i.setItemState(e,o,!0),p++):(i.setItemState(e,o,!1),i.setItemState(e,a,!0))})}),p||d.forEach(function(t){i[t]().forEach(function(t){i.clearItemStates(t,[a])})})}},e.prototype.clearFilter=function(){var t=this.get("graph"),e=this.get("filter");if(e){var r=e.graphActiveState||"active",n=e.graphInactiveState||"inactive";t.getNodes().forEach(function(e){t.clearItemStates(e,[r,n])}),t.getEdges().forEach(function(e){t.clearItemStates(e,[r,n])})}},e.prototype.render=function(){var t=this;this.processData();var e=this.get("legendCanvas");e?e.clear():e=new ck({container:this.get("container"),width:200,height:200});var r=e.addGroup({name:"root"}),n=r.addGroup({name:"node-group"}),i=r.addGroup({name:"edge-group"});this.set("legendCanvas",e);var o=this.get("itemsData"),a=[n,i];["nodes","edges"].forEach(function(e,r){o[e].forEach(function(n){var i,o,s=a[r].addGroup({id:n.id,name:"node-container"}),u=n.type,l=t.getShapeSize(n),c=l.width,f=l.height,h=l.r,p=t.getStyle(e.substr(0,4),n);switch(n.type){case"circle":o={r:h,x:0,y:0};break;case"rect":o={width:c,height:f,x:-c/2,y:-f/2};break;case"ellipse":o={rx:c,ry:f,x:0,y:0},u="ellipse";break;case"line":o={x1:-c/2,y1:0,x2:c/2,y2:0},u="line";break;case"quadratic":o={path:[["M",-c/2,0],["Q",0,c/2,c/2,0]]},u="path";break;case"cubic":o={path:[["M",-c/2,0],["C",-c/6,c/2,c/6,-c/2,c/2,0]]},u="path";break;case"diamond":o={path:[["M",0,-f],["L",c,0],["L",0,f],["L",-c,0],["Z"]]},u="path";break;case"triangle":o={path:[["M",-c,f],["L",0,-f],["L",c,f],["Z"]]},u="path";break;case"star":o={path:WE.getStarPath(3*h,1.2*h)},u="path";break;default:o={r:h,x:0,y:0}}var d=s.addShape(u,{attrs:oL(oL({},o),p),name:"".concat(n.type,"-node-keyShape"),oriAttrs:oL({opacity:1},p)});if(n.label){var y=d.getBBox(),g=(null===(i=n.labelCfg)||void 0===i?void 0:i.style)||{},v=oL({textAlign:"begin",fontSize:12,textBaseline:"middle",fill:"#000",opacity:1,fontWeight:"normal"},g);s.addShape("text",{attrs:oL({x:y.maxX+4,y:0,text:n.label},v),className:"legend-label",name:"".concat(n.type,"-node-text"),oriAttrs:v})}})});var s,u=this.get("padding"),l=r.find(function(t){return"title-container"===t.get("name")}),c={height:0,maxY:0,width:0};if(this.get("title")){l||(l=r.addGroup({name:"title-container"}));var f={fontSize:20,fontFamily:"Arial",fontWeight:300,textBaseline:"top",textAlign:"center",fill:"#000",x:0,y:u[0]},h=this.get("titleConfig")||{},p=Object.assign(f,h.style||{});s=l.addShape("text",{attrs:oL({text:this.get("title")},p)}),c=l.getCanvasBBox(),l.setMatrix([1,0,0,0,1,0,h.offsetX,h.offsetY,1])}this.layoutItems();var d=r.getCanvasBBox(),y=n.getCanvasBBox(),g=y.minX<0?Math.abs(y.minX)+u[3]:u[3],v=c.maxYl.max&&(l.max=o[0]),p>c&&(c=p),t.setMatrix([1,0,0,0,1,0,d,y,1])});var f=l.max-l.min,h={min:0,max:-1/0},p=s.getCanvasBBox();o[0]=0,o[1]="vertical"===n?p.maxX+e:p.maxY+r,u.get("children").forEach(function(t,i){0===i&&(h.min=o[0]);var a=t.get("children")[0],s=t.getCanvasBBox(),u=a.getBBox(),l=u.width,c=u.height,f=0,p=0;"vertical"===n?(f=o[1],p=o[0],o[0]=p+s.height+r,t.setMatrix([1,0,0,0,1,0,0,p+c/2,1])):(f=o[0],p=o[1],o[0]=f+s.width+e,t.setMatrix([1,0,0,0,1,0,f+l/2,0,1])),o[0]>h.max&&(h.max=o[0])});var d=h.max-h.min;if(i&&""!==i&&"left"!==i){var y=f-d,g="center"===i?Math.abs(y)/2:Math.abs(y);(y<0?s:u).get("children").forEach(function(t){var e=t.getMatrix()||[1,0,0,0,1,0,0,0,1];"vertical"===n?e[7]+=g:e[6]+=g,t.setMatrix(e)})}},e.prototype.processData=function(){var t=this.get("data"),e={nodes:[],edges:[]};t.nodes&&(t.nodes.sort(function(t,e){return t.order-e.order}),t.nodes.forEach(function(t){var r,n,i,o,a,s=t.size||[(null===(r=t.style)||void 0===r?void 0:r.width)||(null===(n=t.style)||void 0===n?void 0:n.r)||8,(null===(i=t.style)||void 0===i?void 0:i.height)||(null===(o=t.style)||void 0===o?void 0:o.r)||8],u=(null===(a=t.labelCfg)||void 0===a?void 0:a.style)||{};e.nodes.push({id:t.id||(0,Ux.uniqueId)(),type:t.type||"circle",style:oL({},t.style),order:t.order,label:t.label,itemType:"node",size:s,labelCfg:{position:"right",style:oL({fontFamily:"Arial"},u)}})})),t.edges&&(t.edges.sort(function(t,e){return t.order-e.order}),t.edges.forEach(function(t){var r,n,i=t.type||"line";"cubic-horizontal"===t.type&&(i="cubic");var o=(null===(r=t.labelCfg)||void 0===r?void 0:r.style)||{},a=t.size||[(null===(n=t.style)||void 0===n?void 0:n.width)||8,1];e.edges.push({id:t.id||(0,Ux.uniqueId)(),type:i,size:a,style:oL({lineWidth:(0,Ux.isArray)(a)?a[1]:1},t.style),order:t.order,label:t.label,itemType:"edge",labelCfg:{position:"right",style:oL({fontFamily:"Arial"},o)}})})),this.set("itemsData",e)},e.prototype.getContainer=function(){return this.get("container")},e.prototype.formatArray=function(t){var e=this.get(t);if((0,Ux.isNumber)(e))this.set(t,[e,e,e,e]);else if((0,Ux.isArray)(e))switch(e.length){case 0:this.set(t,[0,0,0,0]);break;case 1:this.set(t,[e[0],e[0],e[0],e[0]]);break;case 2:this.set(t,[e[0],e[1],e[0],e[1]]);break;case 3:this.set(t,[e[0],e[1],e[2],e[1]])}return this.get(t)},e.prototype.getShapeSize=function(t){var e,r,n;return t.size&&((0,Ux.isArray)(t.size)?(e=t.size[0],r=t.size[1]||t.size[0],n=t.size[0]/2):(0,Ux.isNumber)(t.size)&&(e=t.size,r=t.size,n=t.size/2)),t.style&&(t.style.width&&(e=t.style.width),t.style.height&&(r=t.style.height),t.style.r&&(n=t.style.r)),n||(n=5),e||(e=n),r||(r=n),{width:e,height:r,r:n}},e.prototype.getStyle=function(t,e){return oL(oL({},"node"===t?{fill:"#ccc",lineWidth:0}:{stroke:"#000",lineWidth:1}),e.style||{})},e.prototype.destroy=function(){var t=this.get("legendCanvas");null===t||void 0===t||t.destroy();var e=this.get("graph").get("container"),r=this.get("container");e.removeChild(r)},e}(nO),uL=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),lL=function(){return(lL=Object.assign||function(t){for(var e,r=1,n=arguments.length;r+

    ":"

    -

    ",c=e?"":"

    ".concat(a,"

    "),f=e?"".concat(u,"px"):"".concat(u,"px ").concat(u,"px 0 0");return'
    \n \n

    ").concat(i,"

    \n ").concat(l,"\n ").concat("

    x

    ","\n
    \n ").concat(c,"\n ")}},e.prototype.init=function(){var t=this;if(!t.destroyed){var e=t.get("graph").getContainer(),r=t.get("container");this.get("containerCfg")?(r=this.createContainer(),e.appendChild(r)):r=e,this.set("container",r);var n=e.getBoundingClientRect(),i=new ck({container:e,width:n.right-n.left,height:n.bottom-n.top});rO(i.get("el"),{position:"absolute",top:0,left:0,pointerEvents:"none"}),window.addEventListener("resize",(0,Ux.debounce)(function(){return t.resizeCanvas(t)},100));var o=i.addGroup({id:"annotation-link-group"});t.set("linkGroup",o),t.set("canvas",i),t.get("getTitle")||t.set("getTitle",function(t){var e,r=(null===(e=null===t||void 0===t?void 0:t.getModel)||void 0===e?void 0:e.call(t))||{},n=r.label,i=r.id;return n||i||"-"}),t.get("getContent")||t.set("getContent",function(t){var e,r;if(!t)return"-";var n=(null===(e=t.getModel)||void 0===e?void 0:e.call(t))||{},i=n.label,o=n.id,a=null===(r=t.getType)||void 0===r?void 0:r.call(t),s=a?"".concat(a,": "):"";return"".concat(s).concat(i||o||"")});var a=t.get("defaultData");a&&this.readData(a)}},e.prototype.createContainer=function(){var t=this;if(!this.destroyed){var e=this.get("containerCfg"),r=this.get("graph"),n=r.getContainer(),i=n.getBoundingClientRect(),o=i.left,a=i.right,s=i.top,u=i.bottom-s,l=a-o,c=e.position,f=void 0===c?"top":c,h=e.offsetX,p=void 0===h?0:h,d=e.offsetY,y=void 0===d?0:d,g=cL(e,["position","offsetX","offsetY"]),v=e.height,m=void 0===v?"fit-content":v,b=e.width,A=void 0===b?r.getWidth():b;"100%"===m&&(m=u),"100%"===A&&(A=l);var x="unset",w="unset",_={};switch(f){case"right":x="".concat(u,"px"),(_={top:0,right:0}).right+=o+p,_.top+=s+y;break;case"bottom":w="".concat(l,"px"),(_={bottom:0,left:0}).left+=o+p,_.bottom+=s+y;break;case"top":w="".concat(l,"px");case"left":x="".concat(u,"px");default:(_={top:0,left:0}).left+=o+p,_.top+=s+y}Object.keys(_).forEach(function(t){_[t]="".concat(_[t],"px")});var S=oI("
    "));return rO(S,lL(lL({position:"absolute",display:"top"===f||"bottom"===f?"inline-flex":"unset",width:(0,Ux.isNumber)(A)?"".concat(A,"px"):A,height:(0,Ux.isNumber)(m)?"".concat(m,"px"):m,maxHeight:x,maxWidth:w,overflow:"scroll"},_),g)),n.appendChild(S),S.addEventListener("scroll",function(e){t.updateLinks()}),S}},e.prototype.resizeCanvas=function(t){clearTimeout(t.resizeTimer),t.resizeTimer=setTimeout(function(){if(t&&!t.destroyed){var e=t.get("container").getBoundingClientRect(),r=e.right-e.left,n=e.bottom-e.top;t.get("canvas").changeSize(r,n),t.updateOutsideCards(t)}},250)},e.prototype.updateOutsideCards=function(t){var e=t||this,r=e.get("cardInfoMap")||{},n=e.get("graph"),i=n.getPointByCanvas(0,0),o=n.getPointByCanvas(n.getWidth(),n.getHeight()),a=n.getClientByPoint(i.x,i.y),s=a.x,u=a.y,l=n.getClientByPoint(o.x,o.y),c=l.x,f=l.y;Object.values(r).forEach(function(t){var e=t.card;if(e){var r=e.style,n=pL(r.left),i=pL(r.top),o=e.getBoundingClientRect(),a=o.width,l=o.height,h=n,p=i;n+a>c-s&&(h=c-s-a),n<0&&(h=0),i+l>f-u&&(p=f-u-l),i<0&&(p=0),rO(e,{left:"".concat(h,"px"),top:"".concat(p,"px")})}}),e.updateLinks()},e.prototype.showAnnotation=function(t){if(!this.destroyed){var e=t.item;this.toggleAnnotation(e)}},e.prototype.hideCards=function(){var t=this;if(!t.destroyed){var e=t.get("cardInfoMap")||{};Object.keys(e).forEach(function(e){t.hideCard(e)})}},e.prototype.toggleAnnotation=function(t,e){var r,n;void 0===e&&(e={});if(!this.destroyed){var i=this.get("cardInfoMap")||{},o=this.get("graph"),a=this.get("container"),s=this.get("containerCfg"),u=Object.assign({},this.get("cardCfg")||{},e),l=u.minHeight,c=u.minWidth,f=u.width,h=u.height,p=u.collapsed,d=void 0!==p&&p,y=u.x,g=u.y,v=u.title,m=u.content,b=u.maxTitleLength,A=u.defaultBegin,x=cL(u,["minHeight","minWidth","width","height","collapsed","x","y","title","content","maxTitleLength","defaultBegin"]),w=this.get("linkGroup"),_=this.get("rows")||[[]],S=null===(r=t.isCanvas)||void 0===r?void 0:r.call(t),E=S?"canvas-annotation":t.getID(),C=i[E]||{},k=C.card,I=C.link,T=C.x,O=C.y,M=C.title,P=C.content,L=this.get("getTitle"),N=this.get("getContent"),j=this.get("getContentPlaceholder")||function(){return""},R=this.get("getTitlePlaceHolder")||function(){return""},D=j(t),B=R(t),F=oI(this.getDOMContent(lL({itemId:E,collapsed:d,title:(null===(n=M||v||(null===L||void 0===L?void 0:L(t)))||void 0===n?void 0:n.substr(0,b))||B,content:P||m||(null===N||void 0===N?void 0:N(t))||D},x))),z=(0,Ux.isNumber)(l)?"".concat(l,"px"):l;rO(F,{minHeight:d?"unset":z,minWidth:(0,Ux.isNumber)(c)?"".concat(c,"px"):c,height:h,width:f});var G,U=!!k;if(U?(null===I||void 0===I||I.remove(!0),a.replaceChild(F,k)):a.appendChild(F),!s){if(G=a.getBoundingClientRect()||{},void 0!==y&&void 0!==g)T=y,O=g;else if(!U&&!S){var H=G.top,V=A||{},Q=V.left,Y=V.right,W=void 0===Y?16:Y,q=V.top,X=void 0===q?8:q,K=V.bottom,J=W,Z=X;isNaN(Q)||(J=a.scrollWidth-Q),isNaN(K)||(Z=a.scrollHeight-K);var $=(0,Ux.isNumber)(c)?c:100;T=a.scrollWidth-F.scrollWidth-(_.length-1)*$-J;var tt=_[_.length-1],et=(tt[tt.length-1]||{}).bbox;O=(null===et||void 0===et?void 0:et.bottom)-H||Z}rO(F,{position:"absolute",left:"".concat(T,"px"),top:"".concat(O,"px"),cusor:s?"unset":"move"})}this.bindListener(F,E);var rt=F.getBoundingClientRect();if(!S){var nt=hL(t,rt,o,this.get("canvas")),it=this.get("linkStyle");I=w.addShape("path",{attrs:lL({lineWidth:1,lineDash:[5,5],stroke:"#ccc",path:nt},it)})}if(i[E]=lL(lL({},i[E]||{}),{id:E,collapsed:d,card:F,link:I,x:T,y:O,cardBBox:rt,content:P||m,title:M||v,contentPlaceholder:D,titlePlaceholder:B,isCanvas:S}),this.set("cardInfoMap",i),s)this.updateCardPositionsInConatainer(),this.updateLinks();else{var ot=!isNaN(y)&&!isNaN(g);if(!U&&!S&&!ot){var at=G.bottom,st=void 0===at?0:at;H=G.top;_[_.length-1].push({id:E,bbox:rt}),rt.top>st-H-rt.height-16&&_.push([]),this.set("rows",_)}}this.updateCardSize(E);var ut=this.get("onAnnotationChange");null===ut||void 0===ut||ut(i[E],U?"update":"create")}},e.prototype.updateCardPositionsInConatainer=function(){if(!this.destroyed){var t=this.get("cardInfoMap");if(t){var e=this.get("container"),r=this.get("containerCfg").position,n=e.getBoundingClientRect().width,i=getComputedStyle(e),o=pL(i.paddingLeft)+pL(i.paddingRight);n-=o,Object.values(t).forEach(function(t){var e=t.card,i=e.getBoundingClientRect().width;switch(r){case"right":rO(e,{marginLeft:n?"".concat(n-i,"px"):"0px"});break;case"top":case"bottom":rO(e,{marginLeft:"8px"})}})}}},e.prototype.handleExpandCollapseCard=function(t){if(!this.destroyed){var e=this.get("graph"),r=this.get("cardInfoMap");if(r){var n=r[t].collapsed,i=e.findById(t);if(i)"hide"!==this.get("cardCfg").collapseType||n?this.toggleAnnotation(i,{collapsed:!n}):this.hideCard(t),r[t]=lL(lL({},r[t]),{collapsed:!n})}}},e.prototype.hideCard=function(t){if(!this.destroyed){var e=this.get("cardInfoMap");if(e&&e[t]){var r=e[t],n=r.card,i=r.link;rO(n,{display:"none"}),null===i||void 0===i||i.hide(),this.get("onAnnotationChange")(e[t],"hide")}}},e.prototype.removeCard=function(t){if(!this.destroyed){var e=this.get("cardInfoMap");if(e){var r=e[t],n=r.card,i=r.link;this.get("container").removeChild(n),null===i||void 0===i||i.remove(!0),delete e[t],this.get("onAnnotationChange")(r,"remove")}}},e.prototype.bindListener=function(t,e){var r=this;if(!this.destroyed){t.addEventListener("mousemove",function(t){var n;if("g6-annotation-collapse"===t.target.className?n="collapse":"g6-annotation-expand"===t.target.className?n="expand":"g6-annotation-close"===t.target.className&&(n="close"),n){var i=r.get("cardCfg").onMouseEnterIcon;(void 0===i?function(){}:i)(t,e,n)}}),t.addEventListener("mouseout",function(t){var n;if("g6-annotation-collapse"===t.target.className?n="collapse":"g6-annotation-expand"===t.target.className?n="expand":"g6-annotation-close"===t.target.className&&(n="close"),n){var i=r.get("cardCfg").onMouseLeaveIcon;(void 0===i?function(){}:i)(t,e,n)}}),t.addEventListener("mouseenter",function(t){var n=r.get("cardInfoMap");if(n){var i=r.get("graph"),o=i.findById(e);if(o){var a=r.get("itemHighlightState");i.setItemState(o,a,!0)}var s=n[e].link;if(s){var u=r.get("linkHighlightStyle")||{};s.attr(u)}}}),t.addEventListener("mouseleave",function(t){var n=r.get("cardInfoMap");if(n){var i=r.get("graph"),o=i.findById(e);if(o){var a=r.get("itemHighlightState");i.setItemState(o,a,!1)}var s=n[e].link;if(s){var u=r.get("linkHighlightStyle")||{};Object.keys(u).forEach(function(t){s.attr(t,void 0),s.attr(t,void 0)});var l=r.get("linkStyle");s.attr(l)}}}),t.addEventListener("click",function(t){var n=(r.get("cardCfg")||{}).onClickIcon;if("g6-annotation-collapse"===t.target.className||"g6-annotation-expand"===t.target.className)"hide"===r.get("cardCfg").collapseType?r.hideCard(e):r.handleExpandCollapseCard(e),null===n||void 0===n||n(t,e,"g6-annotation-collapse"===t.target.className?"collapse":"expand");else if("g6-annotation-close"===t.target.className){"remove"===r.get("cardCfg").closeType?r.removeCard(e):r.hideCard(e),null===n||void 0===n||n(t,e,"close")}}),this.get("editable")&&t.addEventListener("dblclick",function(t){var n=r.get("cardInfoMap"),i=(r.get("cardCfg")||{}).maxTitleLength,o=void 0===i?20:i;if(n){var a=t.target,s=a.className;if("g6-annotation-title"===s||"g6-annotation-content"===s){var u="g6-annotation-title"===s?a.getBoundingClientRect():a.parentNode.getBoundingClientRect(),l=u.width,c=u.height,f=getComputedStyle(a),h=oI("<".concat("g6-annotation-title"===s?"input":"textarea",' class="').concat(s,'-input" type="textarea" style="width:').concat(l,"px; height: ").concat(c,'px; min-width: 16px;"/>')),p=oI('
    '));p.appendChild(h),a.parentNode.replaceChild(p,a);var d=n[e],y=d.contentPlaceholder,g=d.titlePlaceholder,v=d.content,m=d.title,b=v;"g6-annotation-title"===s?(h.name="title",h.maxLength=o,b=m):h.name="content",b?(h.innerHTML=a.innerHTML,h.value=a.innerHTML):h.placeholder="g6-annotation-title"===s?g:y,h.focus(),h.addEventListener("blur",function(t){h.value&&(a.innerHTML=h.value,d[h.name||"title"]=h.value),p.parentNode.replaceChild(a,p),r.updateCardSize(e);var n=r.get("onAnnotationChange");null===n||void 0===n||n(d,"update")})}}});var n=["g6-annotation-title","g6-annotation-content","g6-annotation-title-input","g6-annotation-content-input"];t.draggable=!0,t.addEventListener("dragstart",function(e){var i=e.target.className;if(!n.includes(i)){var o=t.style;r.set("dragging",{card:t,x:e.clientX,y:e.clientY,left:pL(o.left),top:pL(o.top)})}}),t.addEventListener("drag",function(t){t.preventDefault();var n=r.get("cardInfoMap");if(n){var i=t.clientX,o=t.clientY,a=r.get("dragging");if(!isNaN(i)&&!isNaN(o)&&a){var s=a.x,u=a.y,l=a.left,c=a.top,f=a.card,h=i-s,p=o-u;l+=h,c+=p;var d=r.get("graph"),y=d.getPointByCanvas(0,0),g=d.getPointByCanvas(d.getWidth(),d.getHeight()),v=d.getClientByPoint(y.x,y.y),m=v.x,b=v.y,A=d.getClientByPoint(g.x,g.y),x=A.x,w=A.y,_=f.getBoundingClientRect(),S=_.right-_.left,E=_.bottom-_.top;(l>x-m-S&&h>0||l<0&&h<0)&&(l-=h),(c>w-b-E&&p>0||c<0&&p<0)&&(c-=p),rO(f,{left:"".concat(l,"px"),top:"".concat(c,"px"),visibility:"hidden"}),s=i,u=o;var C=(n[e]||{}).link;if(C){var k=d.findById(e);C.attr("path",hL(k,_,d,r.get("canvas")))}r.set("dragging",{x:s,y:u,left:l,top:c,card:f})}}});t.addEventListener("dragend",function(t){var n=r.get("cardInfoMap");if(n){var i=r.get("dragging");if(i){var o=i.left,a=i.top,s=i.card;n[e].x=o,n[e].y=a,rO(s,{visibility:"visible"}),r.set("dragging",!1);var u=r.get("rows");null===u||void 0===u||u.forEach(function(t){for(var r=t.length-1;r>=0;r--)t[r].id===e&&t.splice(r,1)});var l=r.get("onAnnotationChange");null===l||void 0===l||l(n[e],"update")}}})}},e.prototype.updateCardSize=function(t){var e=this.get("cardInfoMap");if(e){var r=e[t].card,n=r.getBoundingClientRect().width,i=r.getElementsByClassName("g6-annotation-title")[0];if(i){var o=getComputedStyle(i),a=pL(o.marginLeft),s=i.getBoundingClientRect().width;rO(i,{marginRight:"".concat(n-a-24-16-s,"px")})}}},e.prototype.updateLink=function(t){var e=t.item;if(e){var r=this.get("cardInfoMap");if(r){var n=this.get("canvas"),i=this.get("graph"),o=r[e.getID()]||{},a=o.link,s=o.card;if(a){var u=hL(e,s.getBoundingClientRect(),i,n);a.attr("path",u)}}}},e.prototype.updateLinks=function(){var t=this;if(!this.destroyed){var e=this.get("cardInfoMap");if(e){var r=this.get("graph");Object.values(e).forEach(function(e){var n=e.id,i=r.findById(n);t.updateLink({item:i})})}}},e.prototype.onGraphDataChange=function(){var t=this,e=this.get("cardInfoMap");if(e){var r=this.get("graph");Object.values(e).forEach(function(e){var n=e.id,i=e.card,o=e.isCanvas;if(i&&!o&&"none"!==i.style.display){var a=r.findById(n);a&&a.isVisible()?t.toggleAnnotation(a):t.hideCard(n)}})}},e.prototype.onGraphItemVisibilityChange=function(t){var e=t.item,r=t.visible;if(e&&!e.destroyed){var n=this.get("cardInfoMap");if(n){var i=e.getID();n[i]&&(r||this.hideCard(i))}}},e.prototype.saveData=function(t){void 0===t&&(t=!1);var e=this.get("cardInfoMap");if(e){var r=this.get("graph"),n=this.get("getTitle"),i=this.get("getContent"),o=[];return Object.values(e).forEach(function(e){var a=e.title,s=e.content,u=e.x,l=e.y,c=e.id,f=e.collapsed,h=e.card;if(!h||"none"!==h.style.display||t){var p=r.findById(c)||r.get("canvas");o.push({id:c,x:u,y:l,collapsed:f,title:a||(null===n||void 0===n?void 0:n(p)),content:s||(null===i||void 0===i?void 0:i(p)),visible:h&&"none"!==h.style.display})}}),o}},e.prototype.readData=function(t){var e=this,r=this.get("graph");t.forEach(function(t){var n=t.id,i=t.x,o=t.y,a=t.title,s=t.content,u=t.collapsed,l=t.visible,c=r.findById(n);if(c||"canvas-annotation"!==n||(c=r.get("canvas")),!c){var f=e.get("cardInfoMap")||{};return f[n]=t,void e.set("cardInfoMap",f)}e.toggleAnnotation(c,{x:i,y:o,title:a,content:s,collapsed:u}),l||e.hideCard(n)})},e.prototype.clear=function(){var t=this.get("cardInfoMap");if(t){var e=this.get("container");Object.values(t).forEach(function(t){var r=t.card,n=t.link;e.removeChild(r),null===n||void 0===n||n.remove(!0)}),this.set("cardInfoMap",{})}},e.prototype.destroy=function(){var t;this.clear(),null===(t=this.get("canvas"))||void 0===t||t.destroy();var e=this.get("graph");e&&!e.destroyed&&(this.get("containerCfg")&&e.getContainer().removeChild(this.get("container")),this.destroyed=!0)},e}(nO),hL=function(t,e,r,n){var i,o;if("edge"===t.getType())o=[t.getKeyShape().getPoint(.5)];else{var a=null===(i=t.getKeyShape)||void 0===i?void 0:i.call(t).getBBox(),s=a.minX,u=a.minY,l=a.maxX,c=a.maxY,f=t.getModel(),h=f.x,p=f.y;o={left:{x:s+=h,y:((u+=p)+(c+=p))/2},right:{x:l+=h,y:(u+c)/2},top:{x:(s+l)/2,y:u},bottom:{x:(s+l)/2,y:c}}}Object.keys(o).forEach(function(t){var e=o[t],i=e.x,a=e.y,s=r.getClientByPoint(i,a);o[t]=n.getPointByClient(s.x,s.y)});var d=e.top,y=void 0===d?0:d,g=e.left,v=void 0===g?0:g,m=e.right,b=void 0===m?0:m,A=e.bottom,x=void 0===A?0:A,w={left:n.getPointByClient(v,(y+x)/2),right:n.getPointByClient(b,(y+x)/2),top:n.getPointByClient((v+b)/2,y),bottom:n.getPointByClient((v+b)/2,x)};return function(t,e){var r,n,i=1/0;Object.keys(t).forEach(function(o){var a=t[o];Object.keys(e).forEach(function(t){var o=e[t],s=a.x-o.x,u=a.y-o.y,l=s*s+u*u;i>l&&(i=l,r=a,n=o)})});var o=WE.getControlPoint(r,n,.5,20);return[["M",r.x,r.y],["Q",o.x,o.y,n.x,n.y]]}(o,w)},pL=function(t){return Number(t.replace(/\s+|px/gi,""))||0},dL={PluginBase:nO,Menu:cO,Grid:aO,Minimap:yO,Bundling:bO,ToolBar:EO,Tooltip:kO,Fisheye:_O,TimeBar:QP,ImageMinimap:qP,EdgeFilterLens:$P,SnapLine:nL,Legend:sL,Annotation:fL};KE("circle",{options:{size:tC.defaultNode.size,style:{x:0,y:0,stroke:tC.defaultNode.style.stroke,fill:tC.defaultNode.style.fill,lineWidth:tC.defaultNode.style.lineWidth},labelCfg:{style:{fill:tC.nodeLabel.style.fill,fontSize:tC.nodeLabel.style.fontSize,fontFamily:tC.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:tC.defaultNode.linkPoints.size,lineWidth:tC.defaultNode.linkPoints.lineWidth,fill:tC.defaultNode.linkPoints.fill,stroke:tC.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,Gx.__assign)({},tC.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=void 0===r?{}:r,i=this.getShapeStyle(t),o=(0,Ux.deepMix)({},n,t.icon),a="".concat(this.type,"-keyShape"),s=e.addShape("circle",{attrs:i,className:a,name:a,draggable:!0});e.shapeMap[a]=s;var u=o.width,l=o.height,c=o.show,f=o.text;if(c){var h="".concat(this.type,"-icon");e.shapeMap[h]=f?e.addShape("text",{attrs:(0,Gx.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:h,name:h,draggable:!0}):e.addShape("image",{attrs:(0,Gx.__assign)({x:-u/2,y:-l/2},o),className:h,name:h,draggable:!0})}return this.drawLinkPoints(t,e),s},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints;if(r){var n=r||{},i=n.top,o=n.left,a=n.right,s=n.bottom,u=n.size,l=n.r,c=(0,Gx.__rest)(n,["top","left","right","bottom","size","r"]),f=this.getSize(t)[0]/2;if(o){var h="link-point-left";e.shapeMap[h]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:-f,y:0,r:u/2||l||5}),className:h,name:h,isAnchorPoint:!0})}if(a){var p="link-point-right";e.shapeMap[p]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:f,y:0,r:u/2||l||5}),className:p,name:p,isAnchorPoint:!0})}if(i){var d="link-point-top";e.shapeMap[d]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:0,y:-f,r:u/2||l||5}),className:d,name:d,isAnchorPoint:!0})}if(s){var y="link-point-bottom";e.shapeMap[y]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:0,y:f,r:u/2||l||5}),className:y,name:y,isAnchorPoint:!0})}}},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Ux.deepMix)({},e,r),i=this.getSize(t)[0]/2;return(0,Gx.__assign)({x:0,y:0,r:i},n)},update:function(t,e,r){var n=e.getContainer(),i=this.getSize(t),o=(0,Gx.__assign)({},t.style);void 0===t.style.stroke&&t.color&&(o.stroke=t.color),void 0!==t.style.r||isNaN(i[0])||(o.r=i[0]/2),this.updateShape(t,e,o,!0,r),this.updateLinkPoints(t,n)}},"single-node"),KE("rect",{options:{size:[100,30],style:{radius:0,stroke:tC.defaultNode.style.stroke,fill:tC.defaultNode.style.fill,lineWidth:tC.defaultNode.style.lineWidth},labelCfg:{style:{fill:tC.nodeLabel.style.fill,fontSize:tC.nodeLabel.style.fontSize,fontFamily:tC.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:tC.defaultNode.linkPoints.size,lineWidth:tC.defaultNode.linkPoints.lineWidth,fill:tC.defaultNode.linkPoints.fill,stroke:tC.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},anchorPoints:[[0,.5],[1,.5]],stateStyles:(0,Gx.__assign)({},tC.nodeStateStyles)},shapeType:"rect",labelPosition:"center",drawShape:function(t,e){var r=this.getShapeStyle(t),n=e.addShape("rect",{attrs:r,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return e.shapeMap["".concat(this.type,"-keyShape")]=n,this.drawLinkPoints(t,e),n},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=void 0===r?{}:r,i=n.top,o=n.left,a=n.right,s=n.bottom,u=n.size,l=n.r,c=(0,Gx.__rest)(n,["top","left","right","bottom","size","r"]),f=this.getSize(t),h=f[0],p=f[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:-h/2,y:0,r:u/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:h/2,y:0,r:u/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:0,y:-p/2,r:u/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:0,y:p/2,r:u/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Ux.mix)({},e,r),i=this.getSize(t),o=n.width||i[0],a=n.height||i[1];return(0,Gx.__assign)({x:-o/2,y:-a/2,width:o,height:a},n)},update:function(t,e,r){var n=e.getContainer(),i=this.getOptions({}).style,o=this.getSize(t),a=e.get("keyShape");t.size||(o[0]=a.attr("width")||i.width,o[1]=a.attr("height")||i.height);var s={stroke:t.color,x:-o[0]/2,y:-o[1]/2,width:o[0],height:o[1]},u=(0,Ux.mix)({},i,a.attr(),s);u=(0,Ux.mix)(u,t.style),this.updateShape(t,e,u,!1,r),this.updateLinkPoints(t,n)}},"single-node"),KE("ellipse",{options:{size:[80,40],style:{x:0,y:0,stroke:tC.defaultNode.style.stroke,fill:tC.defaultNode.style.fill,lineWidth:tC.defaultNode.style.lineWidth},labelCfg:{style:{fill:tC.nodeLabel.style.fill,fontSize:tC.nodeLabel.style.fontSize,fontFamily:tC.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:tC.defaultNode.linkPoints.size,lineWidth:tC.defaultNode.linkPoints.lineWidth,fill:tC.defaultNode.linkPoints.fill,stroke:tC.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,Gx.__assign)({},tC.nodeStateStyles)},shapeType:"ellipse",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=void 0===r?{}:r,i=this.getShapeStyle(t),o=e.addShape("ellipse",{attrs:i,className:"ellipse-keyShape",name:"ellipse-keyShape",draggable:!0});e.shapeMap["ellipse-keyShape"]=o;var a=n.width,s=n.height,u=n.show,l=n.text;return u&&(e.shapeMap["".concat(this.type,"-icon")]=l?e.addShape("text",{attrs:(0,Gx.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.addShape("image",{attrs:(0,Gx.__assign)({x:-a/2,y:-s/2},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=void 0===r?{}:r,i=n.top,o=n.left,a=n.right,s=n.bottom,u=n.size,l=n.r,c=(0,Gx.__rest)(n,["top","left","right","bottom","size","r"]),f=this.getSize(t),h=f[0]/2,p=f[1]/2;o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:-h,y:0,r:u/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:h,y:0,r:u/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:0,y:-p,r:u/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:0,y:p,r:u/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Ux.mix)({},e,r),i=this.getSize(t),o=i[0]/2,a=i[1]/2;return(0,Gx.__assign)({x:0,y:0,rx:o,ry:a},n)},update:function(t,e,r){var n=e.getContainer(),i=this.getOptions({}).style,o=this.getSize(t),a={stroke:t.color,rx:o[0]/2,ry:o[1]/2},s=e.get("keyShape"),u=(0,Ux.mix)({},i,s.attr(),a);u=(0,Ux.mix)(u,t.style),this.updateShape(t,e,u,!0,r),this.updateLinkPoints(t,n)}},"single-node"),KE("diamond",{options:{size:[80,80],style:{stroke:tC.defaultNode.style.stroke,fill:tC.defaultNode.style.fill,lineWidth:tC.defaultNode.style.lineWidth},labelCfg:{style:{fill:tC.nodeLabel.style.fill,fontSize:tC.nodeLabel.style.fontSize,fontFamily:tC.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:tC.defaultNode.linkPoints.size,lineWidth:tC.defaultNode.linkPoints.lineWidth,fill:tC.defaultNode.linkPoints.fill,stroke:tC.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,Gx.__assign)({},tC.nodeStateStyles)},shapeType:"diamond",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=void 0===r?{}:r,i=this.getShapeStyle(t),o=e.addShape("path",{attrs:i,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=o;var a=n.width,s=n.height,u=n.show,l=n.text;return u&&(e.shapeMap["".concat(this.type,"-icon")]=l?e.addShape("text",{attrs:(0,Gx.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.addShape("image",{attrs:(0,Gx.__assign)({x:-a/2,y:-s/2},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=void 0===r?{}:r,i=n.top,o=n.left,a=n.right,s=n.bottom,u=n.size,l=n.r,c=(0,Gx.__rest)(n,["top","left","right","bottom","size","r"]),f=this.getSize(t),h=f[0],p=f[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:-h/2,y:0,r:u/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:h/2,y:0,r:u/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:0,y:-p/2,r:u/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:0,y:p/2,r:u/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getPath:function(t){var e=this.getSize(t),r=e[0],n=e[1];return[["M",0,-n/2],["L",r/2,0],["L",0,n/2],["L",-r/2,0],["Z"]]},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Ux.mix)({},e,r),i=this.getPath(t);return(0,Gx.__assign)({path:i},n)},update:function(t,e,r){var n=e.getContainer(),i=this.getOptions({}).style,o=this.getPath(t),a={stroke:t.color,path:o},s=e.get("keyShape"),u=(0,Ux.mix)({},i,s.attr(),a);u=(0,Ux.mix)(u,t.style),this.updateShape(t,e,u,!0,r),this.updateLinkPoints(t,n)}},"single-node"),KE("triangle",{options:{size:40,direction:"up",style:{stroke:tC.defaultNode.style.stroke,fill:tC.defaultNode.style.fill,lineWidth:tC.defaultNode.style.lineWidth},labelCfg:{style:{fill:tC.nodeLabel.style.fill,fontSize:tC.nodeLabel.style.fontSize},offset:15},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:tC.defaultNode.linkPoints.size,lineWidth:tC.defaultNode.linkPoints.lineWidth,fill:tC.defaultNode.linkPoints.fill,stroke:tC.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20,offset:6},stateStyles:(0,Gx.__assign)({},tC.nodeStateStyles)},shapeType:"triangle",labelPosition:"bottom",drawShape:function(t,e){var r=this.mergeStyle||this.getOptions(t),n=r.icon,i=void 0===n?{}:n,o=r.direction,a=this.getShapeStyle(t),s=t.direction||o,u=e.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=u;var l=i.width,c=i.height,f=i.show,h=i.offset,p=i.text;if(f)if(p)e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:(0,Gx.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0});else{var d=-l/2,y=-c/2;"up"!==s&&"down"!==s||(y+=h),"left"!==s&&"right"!==s||(d+=h),e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:(0,Gx.__assign)({x:d,y:y},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})}return this.drawLinkPoints(t,e),u},drawLinkPoints:function(t,e){var r=this.mergeStyle||this.getOptions(t),n=r.linkPoints,i=void 0===n?{}:n,o=r.direction,a=t.direction||o,s=i.top,u=i.left,l=i.right,c=i.bottom,f=i.size,h=i.r,p=(0,Gx.__rest)(i,["top","left","right","bottom","size","r"]),d=this.getSize(t)[0];if(u){var y=null,g=d*Math.sin(1/3*Math.PI),v=d*Math.sin(1/3*Math.PI);"up"===a?y=[-v,g]:"down"===a?y=[-v,-g]:"left"===a&&(y=[-v,v-g]),y&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},p),{x:y[0],y:y[1],r:f/2||h||5}),className:"link-point-left",name:"link-point-left"}))}if(l){var m=null;g=d*Math.sin(1/3*Math.PI),v=d*Math.sin(1/3*Math.PI);"up"===a?m=[v,g]:"down"===a?m=[v,-g]:"right"===a&&(m=[v,v-g]),m&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},p),{x:m[0],y:m[1],r:f/2||h||5}),className:"link-point-right",name:"link-point-right"}))}if(s){var b=null;g=d*Math.sin(1/3*Math.PI),v=d*Math.sin(1/3*Math.PI);"up"===a?b=[v-g,-g]:"left"===a?b=[v,-g]:"right"===a&&(b=[-v,-g]),b&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},p),{x:b[0],y:b[1],r:f/2||h||5}),className:"link-point-top",name:"link-point-top"}))}if(c){var A=null;g=d*Math.sin(1/3*Math.PI),v=d*Math.sin(1/3*Math.PI);"down"===a?A=[-v+g,g]:"left"===a?A=[v,g]:"right"===a&&(A=[-v,g]),A&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},p),{x:A[0],y:A[1],r:f/2||h||5}),className:"link-point-bottom",name:"link-point-bottom"}))}},getPath:function(t){var e=(this.mergeStyle||this.getOptions(t)).direction,r=t.direction||e,n=this.getSize(t)[0],i=n*Math.sin(1/3*Math.PI),o=n*Math.sin(1/3*Math.PI),a=[["M",-o,i],["L",0,-i],["L",o,i],["Z"]];return"down"===r?a=[["M",-o,-i],["L",o,-i],["L",0,i],["Z"]]:"left"===r?a=[["M",-o,o-i],["L",o,-o],["L",o,o],["Z"]]:"right"===r&&(a=[["M",o,o-i],["L",-o,o],["L",-o,-o],["Z"]]),a},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Ux.mix)({},e,r),i=this.getPath(t);return(0,Gx.__assign)({path:i},n)},update:function(t,e,r){var n=e.getContainer(),i=this.getOptions({}).style,o=this.getPath(t),a={stroke:t.color,path:o},s=e.get("keyShape"),u=(0,Ux.mix)({},i,s.attr(),a);u=(0,Ux.mix)(u,t.style),this.updateShape(t,e,u,!0,r),this.updateLinkPoints(t,n)},updateLinkPoints:function(t,e){var r=this.getOptions({}),n=r.linkPoints,i=r.direction,o=t.direction||i,a=e.shapeMap["link-point-left"]||e.find(function(t){return"link-point-left"===t.get("className")}),s=e.shapeMap["link-point-right"]||e.find(function(t){return"link-point-right"===t.get("className")}),u=e.shapeMap["link-point-top"]||e.find(function(t){return"link-point-top"===t.get("className")}),l=e.shapeMap["link-point-bottom"]||e.find(function(t){return"link-point-bottom"===t.get("className")}),c=n,f=a||s||u||l;f&&(c=f.attr());var h=(0,Ux.mix)({},c,t.linkPoints),p=h.fill,d=h.stroke,y=h.lineWidth,g=h.size/2;g||(g=h.r);var v=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},m=v.left,b=v.right,A=v.top,x=v.bottom,w=this.getSize(t)[0],_={r:g,fill:p,stroke:d,lineWidth:y},S=null,E=w*Math.sin(1/3*Math.PI),C=w*Math.sin(1/3*Math.PI);"up"===o?S=[-C,E]:"down"===o?S=[-C,-E]:"left"===o&&(S=[-C,C-E]),S&&(a?m||void 0===m?a.attr((0,Gx.__assign)((0,Gx.__assign)({},_),{x:S[0],y:S[1]})):(a.remove(),delete e.shapeMap["link-point-left"]):m&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},_),{x:S[0],y:S[1]}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})));var k=null;"up"===o?k=[C,E]:"down"===o?k=[C,-E]:"right"===o&&(k=[C,C-E]),k&&(s?b||void 0===b?s.attr((0,Gx.__assign)((0,Gx.__assign)({},_),{x:k[0],y:k[1]})):(s.remove(),delete e.shapeMap["link-point-right"]):b&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},_),{x:k[0],y:k[1]}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})));var I=null;"up"===o?I=[C-E,-E]:"left"===o?I=[C,-E]:"right"===o&&(I=[-C,-E]),I&&(u?A||void 0===A?u.attr((0,Gx.__assign)((0,Gx.__assign)({},_),{x:I[0],y:I[1]})):(u.remove(),delete e.shapeMap["link-point-top"]):A&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},_),{x:I[0],y:I[1]}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})));var T=null;"down"===o?T=[-C+E,E]:"left"===o?T=[C,E]:"right"===o&&(T=[-C,E]),T&&(l?x||void 0===x?l.attr((0,Gx.__assign)((0,Gx.__assign)({},_),{x:T[0],y:T[1]})):(l.remove(),delete e.shapeMap["link-point-bottom"]):x&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},_),{x:T[0],y:T[1]}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})))}},"single-node"),KE("modelRect",{options:{size:[185,70],style:{radius:5,stroke:"#69c0ff",fill:"#ffffff",lineWidth:tC.defaultNode.style.lineWidth,fillOpacity:1},labelCfg:{style:{fill:"#595959",fontSize:14,fontFamily:tC.windowFontFamily},offset:30},descriptionCfg:{style:{fontSize:12,fill:"#bfbfbf",fontFamily:tC.windowFontFamily},paddingTop:0},preRect:{show:!0,width:4,fill:"#40a9ff",radius:2},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:10,lineWidth:1,fill:"#72CC4A",stroke:"#72CC4A"},logoIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg",width:16,height:16,offset:0},stateIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg",width:16,height:16,offset:-5},anchorPoints:[[0,.5],[1,.5]]},shapeType:"modelRect",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).preRect,n=void 0===r?{}:r,i=this.getShapeStyle(t),o=this.getSize(t),a=o[0],s=o[1],u=e.addShape("rect",{attrs:i,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=u;var l=n.show,c=(0,Gx.__rest)(n,["show"]);return l&&(e.shapeMap["pre-rect"]=e.addShape("rect",{attrs:(0,Gx.__assign)({x:-a/2,y:-s/2,height:s},c),className:"pre-rect",name:"pre-rect",draggable:!0})),this.drawLogoIcon(t,e),this.drawStateIcon(t,e),this.drawLinkPoints(t,e),u},drawLogoIcon:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).logoIcon,n=void 0===r?{}:r,i=this.getSize(t)[0];if(n.show){var o=n.width,a=n.height,s=n.x,u=n.y,l=n.offset,c=n.text,f=(0,Gx.__rest)(n,["width","height","x","y","offset","text"]);e.shapeMap["rect-logo-icon"]=c?e.addShape("text",{attrs:(0,Gx.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},f),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0}):e.addShape("image",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},f),{x:s||-i/2+o+l,y:u||-a/2,width:o,height:a}),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0})}},drawStateIcon:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).stateIcon,n=void 0===r?{}:r,i=this.getSize(t)[0];if(n.show){var o=n.width,a=n.height,s=n.x,u=n.y,l=n.offset,c=n.text,f=(0,Gx.__rest)(n,["width","height","x","y","offset","text"]);e.shapeMap["rect-state-icon"]=c?e.addShape("text",{attrs:(0,Gx.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},f),className:"rect-state-icon",name:"rect-state-icon",draggable:!0}):e.addShape("image",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},f),{x:s||i/2-o+l,y:u||-a/2,width:o,height:a}),className:"rect-state-icon",name:"rect-state-icon",draggable:!0})}},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=void 0===r?{}:r,i=n.top,o=n.left,a=n.right,s=n.bottom,u=n.size,l=n.r,c=(0,Gx.__rest)(n,["top","left","right","bottom","size","r"]),f=this.getSize(t),h=f[0],p=f[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:-h/2,y:0,r:u/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:h/2,y:0,r:u/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:0,y:-p/2,r:u/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},c),{x:0,y:p/2,r:u/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},drawLabel:function(t,e){var r=this.getOptions(t),n=r.labelCfg,i=void 0===n?{}:n,o=r.logoIcon,a=void 0===o?{}:o,s=r.descriptionCfg,u=void 0===s?{}:s,l=this.getSize(t)[0],c=null,f=a.show,h=a.width,p=-l/2+i.offset;f&&(p=-l/2+h+i.offset);var d=i.style,y=u.style,g=u.paddingTop;return(0,Ux.isString)(t.description)?(c=e.addShape("text",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},d),{x:p,y:-5,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),e.shapeMap["text-shape"]=c,e.shapeMap["rect-description"]=e.addShape("text",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},y),{x:p,y:17+(g||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0})):(c=e.addShape("text",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},d),{x:p,y:7,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),e.shapeMap["text-shape"]=c),c},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Ux.mix)({},e,r),i=this.getSize(t),o=n.width||i[0],a=n.height||i[1];return(0,Gx.__assign)({x:-o/2,y:-a/2,width:o,height:a},n)},update:function(t,e){var r=this.mergeStyle||this.getOptions(t),n=r.style,i=void 0===n?{}:n,o=r.labelCfg,a=void 0===o?{}:o,s=r.descriptionCfg,u=void 0===s?{}:s,l=this.getSize(t),c=l[0],f=l[1];e.get("keyShape").attr((0,Gx.__assign)((0,Gx.__assign)({},i),{x:-c/2,y:-f/2,width:c,height:f}));var h=e.getContainer(),p=h.shapeMap["rect-logo-icon"]||h.find(function(t){return"rect-logo-icon"===t.get("className")}),d=p?p.attr():{},y=(0,Ux.mix)({},d,t.logoIcon),g=y.width;void 0===g&&(g=this.options.logoIcon.width);var v=t.logoIcon?t.logoIcon.show:void 0,m=a.offset,b=-c/2+g+m;v||void 0===v||(b=-c/2+m);var A=h.shapeMap["node-label"]||h.find(function(t){return"node-label"===t.get("className")}),x=h.shapeMap["rect-description"]||h.find(function(t){return"rect-description"===t.get("className")});if(t.label)if(A){var w=t.labelCfg?t.labelCfg.style:{},_=(0,Ux.mix)({},A.attr(),w);t.label&&(_.text=t.label),_.x=b,(0,Ux.isString)(t.description)&&(_.y=-5),x&&(x.resetMatrix(),x.attr({x:b})),A.resetMatrix(),A.attr(_)}else h.shapeMap["node-label"]=h.addShape("text",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},a.style),{x:b,y:t.description?-5:7,text:t.label}),className:"node-label",name:"node-label",draggable:!0,labelRelated:!0});if((0,Ux.isString)(t.description)){var S=u.paddingTop;if(x){w=t.descriptionCfg?t.descriptionCfg.style:{};var E=(0,Ux.mix)({},x.attr(),w);(0,Ux.isString)(t.description)&&(E.text=t.description),E.x=b,x.resetMatrix(),x.attr((0,Gx.__assign)((0,Gx.__assign)({},E),{y:17+(S||0)}))}else h.shapeMap["rect-description"]=h.addShape("text",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},u.style),{x:b,y:17+(S||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0})}var C=h.shapeMap["pre-rect"]||h.find(function(t){return"pre-rect"===t.get("className")});if(C&&!C.destroyed){var k=(0,Ux.mix)({},C.attr(),t.preRect);C.attr((0,Gx.__assign)((0,Gx.__assign)({},k),{x:-c/2,y:-f/2,height:f}))}if(p&&!p.destroyed)if(v||void 0===v){var I=y.width,T=y.height,O=y.x,M=y.y,P=y.offset,L=(0,Gx.__rest)(y,["width","height","x","y","offset"]);p.attr((0,Gx.__assign)((0,Gx.__assign)({},L),{x:O||-c/2+I+P,y:M||-T/2,width:I,height:T}))}else p.remove(),delete h.shapeMap["pre-rect"];else v&&this.drawLogoIcon(t,h);var N=h.shapeMap["rect-state-icon"]||h.find(function(t){return"rect-state-icon"===t.get("className")}),j=N?N.attr():{},R=(0,Ux.mix)({},j,t.stateIcon);if(N){R.show||void 0===R.show||(N.remove(),delete h.shapeMap["rect-state-icon"]);var D=R.width,B=(T=R.height,O=R.x,M=R.y,R.offset),F=(0,Gx.__rest)(R,["width","height","x","y","offset"]);N.attr((0,Gx.__assign)((0,Gx.__assign)({},F),{x:O||c/2-D+B,y:M||-T/2,width:D,height:T}))}else R.show&&this.drawStateIcon(t,h);this.updateLinkPoints(t,h)},getOptions:function(t,e){return"move"===e?t:(0,Ux.deepMix)({},this.options,this.getCustomConfig(t)||{},t)}},"single-node"),KE("star",{options:{size:60,style:{stroke:tC.defaultNode.style.stroke,fill:tC.defaultNode.style.fill,lineWidth:tC.defaultNode.style.lineWidth},labelCfg:{style:{fill:tC.nodeLabel.style.fill,fontSize:tC.nodeLabel.style.fontSize,fontFamily:tC.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:tC.defaultNode.linkPoints.size,lineWidth:tC.defaultNode.linkPoints.lineWidth,fill:tC.defaultNode.linkPoints.fill,stroke:tC.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,Gx.__assign)({},tC.nodeStateStyles)},shapeType:"star",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=void 0===r?{}:r,i=this.getShapeStyle(t),o=e.addShape("path",{attrs:i,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=o;var a=n.width,s=n.height,u=n.show,l=n.text;return u&&(e.shapeMap["".concat(this.type,"-icon")]=l?e.addShape("text",{attrs:(0,Gx.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.addShape("image",{attrs:(0,Gx.__assign)({x:-a/2,y:-s/2},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=void 0===r?{}:r,i=n.top,o=n.left,a=n.right,s=n.leftBottom,u=n.rightBottom,l=n.size,c=n.r,f=(0,Gx.__rest)(n,["top","left","right","leftBottom","rightBottom","size","r"]),h=this.getSize(t)[0];if(a){var p=Math.cos(.1*Math.PI)*h,d=Math.sin(.1*Math.PI)*h;e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},f),{x:p,y:-d,r:l/2||c||5}),className:"link-point-right",name:"link-point-right"})}if(i){p=Math.cos(.5*Math.PI)*h,d=Math.sin(.5*Math.PI)*h;e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},f),{x:p,y:-d,r:l/2||c||5}),className:"link-point-top",name:"link-point-top"})}if(o){p=Math.cos(.9*Math.PI)*h,d=Math.sin(.9*Math.PI)*h;e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},f),{x:p,y:-d,r:l/2||c||5}),className:"link-point-left",name:"link-point-left"})}if(s){p=Math.cos(1.3*Math.PI)*h,d=Math.sin(1.3*Math.PI)*h;e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},f),{x:p,y:-d,r:l/2||c||5}),className:"link-point-left-bottom",name:"link-point-left-bottom"})}if(u){p=Math.cos(1.7*Math.PI)*h,d=Math.sin(1.7*Math.PI)*h;e.shapeMap["link-point-right-bottom"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},f),{x:p,y:-d,r:l/2||c||5}),className:"link-point-right-bottom",name:"link-point-right-bottom"})}},getPath:function(t){var e=this.getSize(t)[0],r=3*e/8,n=t.innerR||r;return WE.getStarPath(e,n)},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Ux.mix)({},e,r),i=this.getPath(t);return(0,Gx.__assign)({path:i},n)},update:function(t,e,r){var n=e.getContainer(),i=this.getOptions({}).style,o=this.getPath(t),a={stroke:t.color,path:o},s=e.get("keyShape"),u=(0,Ux.mix)({},i,s.attr(),a);u=(0,Ux.mix)(u,t.style),this.updateShape(t,e,u,!0,r),this.updateLinkPoints(t,n)},updateLinkPoints:function(t,e){var r=this.getOptions({}).linkPoints,n=e.shapeMap["link-point-left"]||e.find(function(t){return"link-point-left"===t.get("className")}),i=e.shapeMap["link-point-right"]||e.find(function(t){return"link-point-right"===t.get("className")}),o=e.shapeMap["link-point-top"]||e.find(function(t){return"link-point-top"===t.get("className")}),a=e.shapeMap["link-point-left-bottom"]||e.find(function(t){return"link-point-left-bottom"===t.get("className")}),s=e.shapeMap["link-point-left-bottom"]||e.find(function(t){return"link-point-right-bottom"===t.get("className")}),u=r,l=n||i||o||a||s;l&&(u=l.attr());var c=(0,Ux.mix)({},u,t.linkPoints),f=c.fill,h=c.stroke,p=c.lineWidth,d=c.size/2;d||(d=c.r);var y=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,leftBottom:void 0,rightBottom:void 0},g=y.left,v=y.right,m=y.top,b=y.leftBottom,A=y.rightBottom,x=this.getSize(t)[0],w={r:d,fill:f,stroke:h,lineWidth:p},_=Math.cos(.1*Math.PI)*x,S=Math.sin(.1*Math.PI)*x;i?v||void 0===v?i.attr((0,Gx.__assign)((0,Gx.__assign)({},w),{x:_,y:-S})):(i.remove(),delete e.shapeMap["link-point-right"]):v&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},w),{x:_,y:-S}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),_=Math.cos(.5*Math.PI)*x,S=Math.sin(.5*Math.PI)*x,o?m||void 0===m?o.attr((0,Gx.__assign)((0,Gx.__assign)({},w),{x:_,y:-S})):(o.remove(),delete e.shapeMap["link-point-top"]):m&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},w),{x:_,y:-S}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),_=Math.cos(.9*Math.PI)*x,S=Math.sin(.9*Math.PI)*x,n?g||void 0===g?n.attr((0,Gx.__assign)((0,Gx.__assign)({},w),{x:_,y:-S})):(n.remove(),delete e.shapeMap["link-point-left"]):g&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},w),{x:_,y:-S}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),_=Math.cos(1.3*Math.PI)*x,S=Math.sin(1.3*Math.PI)*x,a?b||void 0===b?a.attr((0,Gx.__assign)((0,Gx.__assign)({},w),{x:_,y:-S})):(a.remove(),delete e.shapeMap["link-point-left-bottom"]):b&&(e.shapeMap["link-point-left-bottom"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},w),{x:_,y:-S}),className:"link-point-left-bottom",name:"link-point-left-bottom",isAnchorPoint:!0})),_=Math.cos(1.7*Math.PI)*x,S=Math.sin(1.7*Math.PI)*x,s?A||void 0===A?s.attr((0,Gx.__assign)((0,Gx.__assign)({},w),{x:_,y:-S})):(s.remove(),delete e.shapeMap["link-point-right-bottom"]):A&&(e.shapeMap["link-point-right-bottom"]=e.addShape("circle",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},w),{x:_,y:-S}),className:"link-point-right-bottom",name:"link-point-right-bottom",isAnchorPoint:!0}))}},"single-node");var yL=WE.defaultSubjectColors;KE("donut",{options:{size:tC.defaultNode.size,style:{x:0,y:0,stroke:tC.defaultNode.style.stroke,fill:tC.defaultNode.style.fill,lineWidth:tC.defaultNode.style.lineWidth},labelCfg:{style:{fill:tC.nodeLabel.style.fill,fontSize:tC.nodeLabel.style.fontSize,fontFamily:tC.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:tC.defaultNode.linkPoints.size,lineWidth:tC.defaultNode.linkPoints.lineWidth,fill:tC.defaultNode.linkPoints.fill,stroke:tC.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,Gx.__assign)({},tC.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=void 0===r?{}:r,i=this.getShapeStyle(t),o=(0,Ux.deepMix)({},n,t.icon),a=e.addShape("circle",{attrs:i,className:"".concat(this.type,"-keyShape"),draggable:!0,name:"".concat(this.type,"-keyShape")});e.shapeMap["".concat(this.type,"-keyShape")]=a;var s=o.width,u=o.height,l=o.show,c=o.text;return l&&(e.shapeMap["".concat(this.type,"-icon")]=c?e.addShape("text",{attrs:(0,Gx.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.addShape("image",{attrs:(0,Gx.__assign)({x:-s/2,y:-u/2},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),gL(t,e,a),this.drawLinkPoints(t,e),a},updateShape:function(t,e,r,n,i){var o=e.get("keyShape");o.attr((0,Gx.__assign)({},r)),mL(t,e,o),this.updateLabel(t,e,i),n&&this.updateIcon(t,e)}},"circle");var gL=function(t,e,r){var n=t.donutAttrs,i=void 0===n?{}:n,o=t.donutColorMap,a=void 0===o?{}:o,s=Object.keys(i).length;if(i&&s>1){var u=bL(i,a),l=u.configs,c=u.totalValue;if(c){var f=AL(r),h=f.lineWidth,p=f.arcR,d=[p,0],y=0;if(1===s)return void vL(e,{arcR:p,arcBegin:d,beginAngle:y,config:l[0],fanIndex:0,lineWidth:h,totalValue:c,drawWhole:!0});for(var g=0;g.999)r=[o,1e-4],i=1;else{var v=g*Math.PI*2;n=s+v,r=[o*Math.cos(n),-o*Math.sin(n)],i=v>Math.PI?1:0}var m={path:[["M",a[0],a[1]],["A",o,o,0,i,0,r[0],r[1]]],stroke:u.color||(null===y||void 0===y?void 0:y.attr("stroke"))||yL[l%yL.length],lineWidth:c};return y?y.attr(m):t.shapeMap["".concat("fan-shape-").concat(l)]=t.addShape("path",{attrs:m,name:"".concat("fan-shape-").concat(l),draggable:!0}),{beginAngle:n,arcBegin:r,shape:t.shapeMap["".concat("fan-shape-").concat(l)],shouldEnd:p||g>.999}},mL=function(t,e,r){var n=t.donutAttrs,i=t.donutColorMap,o=void 0===i?{}:i,a={},s=e.getContainer();if(n){var u=bL(n,o),l=u.configs,c=u.totalValue;if(c)for(var f=AL(r),h=f.lineWidth,p=f.arcR,d=[p,0],y=0,g=0;g=0;n--){var i=t[n];i.id="".concat(i.x,"|||").concat(i.y),r[i.id]||(r[i.id]=i,e.push(i))}return e},_L=function(t){return wL(t)},SL=function(t,e){return t.width||t.height?{centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}:t},EL=function(t,e,r){var n=function(t,e){var r=Math.abs(t.x-e.centerX),n=Math.abs(t.y-e.centerY);return 0===r&&0===n?0:r/e.width>n/e.height}(e,t);if(0===n){var i=t.centerX,o=t.centerY;return r.ye.x?i=t.maxX:r.xt.centerX?t.maxX:t.minX,y:e.y}:{x:e.x,y:e.y>t.centerY?t.maxY:t.minY}},CL=function(t,e){var r=Math.min(t.minX,e.minX),n=Math.min(t.minY,e.minY),i=Math.max(t.maxX,e.maxX),o=Math.max(t.maxY,e.maxY);return{centerX:(r+i)/2,centerY:(n+o)/2,minX:r,minY:n,maxX:i,maxY:o,height:o-n,width:i-r}},kL=function(t){return[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.maxY}]},IL=function(t,e){var r=t.x,n=t.y;return re.maxX||ne.maxY},TL=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},OL=function(t,e,r,n,i){return TL(t,e)+TL(t,r)+function(t,e){var r=0;return e.forEach(function(e){e&&(t.x===e.x&&(r+=-2),t.y===e.y&&(r+=-2))}),r}(t,[e,r,n,i])},ML=function t(e,r,n,i,o){void 0===o&&(o=0),e.unshift(r[i]),n[i]&&n[i]!==i&&o<=100&&t(e,r,n,n[i],o+1)},PL=function(t,e,r,n){var i=r.x-t.x,o=r.y-t.y,a=n.x-t.x,s=n.y-t.y,u=r.x-e.x,l=r.y-e.y,c=n.x-e.x,f=n.y-e.y;return(i*s-o*a)*(u*f-l*c)<=0&&(i*l-o*u)*(a*f-s*c)<=0},LL=function(t,e,r){if(r.width||r.height){var n=kL(r),i=n[0],o=n[1],a=n[2],s=n[3];return PL(t,e,i,o)||PL(t,e,i,s)||PL(t,e,o,a)||PL(t,e,a,s)}return!1},NL=function(t,e,r,n){var i=[];return t.forEach(function(t){if(t!==e&&(t.x===e.x||t.y===e.y)){if(LL(t,e,r)||LL(t,e,n))return;i.push(t)}}),wL(i)},jL=function(t,e){var r=[],n=t[0];return r.push("M".concat(n.x," ").concat(n.y)),t.forEach(function(n,i){var o=t[i+1],a=t[i+2];if(o&&a)if(function(t,e,r){return!(t.x===e.x&&e.x===r.x||t.y===e.y&&e.y===r.y)}(n,o,a)){var s=function(t,e,r,n){var i=TL(t,e),o=TL(r,e);return it.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]}(t,e.x).concat(function(t,e){return et.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]}(t,e.y))}(t,_).filter(function(t){return IL(t,y)&&IL(t,g)}))}),[{x:v.x,y:m.y},{x:m.x,y:v.y}].forEach(function(t){IL(t,y)&&IL(t,g)&&w.push(t)}),w.unshift(v),w.push(m);var S=function(t,e,r,n,i,o,a){var s,u=[],l=((s={})[e.id]=e,s),c={},f={},h={};f[e.id]=0,h[e.id]=OL(e,r,e);var p=new DL;p.add({id:e.id,value:h[e.id]});var d,y={};for(t.forEach(function(t){y[t.id]=t});Object.keys(l).length;){var g=p.minId(!1);if(!g)break;if((d=l[g])===r){var v=[];return ML(v,y,c,r.id),v}delete l[d.id],p.remove(d.id),u.push(d);var m=NL(t,d,n,i);m.forEach(function(t){if(-1===u.indexOf(t)){var n=t.id;l[n]||(l[n]=t);var i=h[d.id]+TL(d,t);f[n]&&i>=f[n]?p.add({id:n,value:h[n]}):(c[n]=d.id,f[n]=i,h[n]=f[n]+OL(t,r,e,o,a),p.add({id:n,value:h[n]}))}})}return[e,r]}(w=wL(w),v,m,o,a,t,e);return S.unshift(t),S.push(e),_L(S)},DL=function(){function t(){this.arr=[],this.map={},this.arr=[],this.map={}}return t.prototype._innerAdd=function(t,e){for(var r=[0,e-1];r[1]-r[0]>1;){var n=Math.floor((r[0]+r[1])/2);if(this.arr[n].value>t.value)r[1]=n;else{if(!(this.arr[n].value=0;e--)this.map[this.arr[e].id]?t=this.arr[e].id:this.arr.splice(e,1);return t},t.prototype._findFirstId=function(){for(;this.arr.length;){var t=this.arr.shift();if(this.map[t.id])return t.id}},t.prototype.minId=function(t){return t?this._clearAndGetMinId():this._findFirstId()},t}(),BL={offset:20,maxAllowedDirectionChange:Math.PI/2,maximumLoops:2e3,gridSize:10,directions:[{stepX:1,stepY:0},{stepX:-1,stepY:0},{stepX:0,stepY:1},{stepX:0,stepY:-1}],get penalties(){return{0:0,45:this.gridSize/2,90:this.gridSize/2}},distFunc:function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},fallbackRoute:function(t,e,r,n,i){return _L(RL(t,e,r,n,i.offset))}},FL=(Math.PI,function(t,e){var r=Math.round(Math.abs(t/e));return r<0?0:(t<0?-1:1)*r}),zL=function(t,e){var r=e.x-t.x,n=e.y-t.y;return r||n?Math.atan2(n,r):0},GL=function(t,e){var r=Math.abs(t-e);return r>Math.PI?2*Math.PI-r:r},UL=function(t,e,r){for(var n=1/0,i=0,o=e.length;iu.minX&&e.xu.minY&&e.y0&&k>0;){var O=m.minId((k+1)%30==0);if(!O)break;if(x=p[O],T["".concat(x.x,"|||").concat(x.y)])return QL(x,y,l,e,t,c,s);delete p[x.id],m.remove(x.id),d[x.id]=!0;for(b=0;bo.maxAllowedDirectionChange||u[M])){p[M]||(p[M]=_);var P=a[C];S=o.distFunc(x,_)+(isNaN(P)?s:P),E=g[x.id]+S;var L=g[M];L&&E>=L||(y[M]=x,g[M]=E,v[M]=E+UL(_,h,o.distFunc),m.add({id:M,value:v[M]}))}}k-=1}return o.fallbackRoute(t,e,r,n,o)};JE("polyline",{options:{color:tC.defaultEdge.color,size:tC.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:tC.defaultEdge.style.stroke,lineAppendWidth:tC.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:tC.edgeLabel.style.fill,fontSize:tC.edgeLabel.style.fontSize,fontFamily:tC.windowFontFamily}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:(0,Gx.__assign)({},tC.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(t,e){var r=this.getShapeStyle(t);0===r.radius&&delete r.radius;var n=e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:r});return e.shapeMap["edge-shape"]=n,n},getShapeStyle:function(t){var e=this.options.style,r={stroke:t.color},n=(0,Ux.mix)({},e,r,t.style);t=this.getPathPoints(t),this.radius=n.radius,this.offset=n.offset;var i=t.startPoint,o=t.endPoint,a=this.getControlPoints(t),s=[i];a&&(s=s.concat(a)),s.push(o);var u=t.sourceNode,l=t.targetNode,c=n.radius,f=this.options.routeCfg,h=(0,Ux.mix)({},f,t.routeCfg);h.offset=n.offset;var p=this.getPath(s,u,l,c,h,!Boolean(a));return((0,Ux.isArray)(p)&&p.length<=1||(0,Ux.isString)(p)&&-1===p.indexOf("L"))&&(p="M0 0, L0 0"),(isNaN(i.x)||isNaN(i.y)||isNaN(o.x)||isNaN(o.y))&&(p="M0 0, L0 0"),(0,Ux.mix)({},tC.defaultEdge.style,n,{lineWidth:t.size,path:p})},updateShapeStyle:function(t,e){var r=e.getContainer();if(e.isVisible()){var n={stroke:t.color},i=r.shapeMap["edge-shape"]||r.find(function(t){return"edge-shape"===t.get("className")})||e.getKeyShape(),o=t.size,a=(t=this.getPathPoints(t)).startPoint,s=t.endPoint,u=this.getControlPoints(t),l=[a];u&&(l=l.concat(u)),l.push(s);var c=i.attr(),f=(0,Ux.mix)({},n,c,t.style),h=t.sourceNode,p=t.targetNode,d=f.radius,y=this.options.routeCfg,g=(0,Ux.mix)({},y,t.routeCfg);g.offset=f.offset;var v=this.getPath(l,h,p,d,g,!Boolean(u));((0,Ux.isArray)(v)&&v.length<=1||(0,Ux.isString)(v)&&-1===v.indexOf("L"))&&(v="M0 0, L0 0"),(isNaN(a.x)||isNaN(a.y)||isNaN(s.x)||isNaN(s.y))&&(v="M0 0, L0 0"),c.endArrow&&!1===f.endArrow&&(t.style.endArrow={path:""}),c.startArrow&&!1===f.startArrow&&(t.style.startArrow={path:""});var m=(0,Ux.mix)(n,i.attr(),{lineWidth:o,path:v},t.style);i&&i.attr(m)}},getPath:function(t,e,r,n,i,o){var a=i.offset,s=i.obstacles,u=i.simple;if(!a||t.length>2||!1===o){if(n)return jL(t,n);var l=[];return(0,Ux.each)(t,function(t,e){0===e?l.push(["M",t.x,t.y]):l.push(["L",t.x,t.y])}),l}!1===u||(null===s||void 0===s?void 0:s.length)||(u=!0);var c=u?RL(t[t.length-1],t[0],r,e,a):YL(t[0],t[t.length-1],e,r,i);return c&&c.length?n?jL(c,n):(c=function(t){if(!(null===t||void 0===t?void 0:t.length))return t;for(var e=t[t.length-1],r={x:e.x,y:e.y},n=[e],i=[e],o=t.length-2;o>=0;o--){var a,s=t[o];s.x===r.x?n.push(s):(n=[s],r.x=s.x),s.y===r.y?i.push(s):(i=[s],r.y=s.y),n.length>2?(a=t.indexOf(n[1]))>-1&&t.splice(a,1):i.length>2&&(a=t.indexOf(i[1]))>-1&&t.splice(a,1)}return t}(c),WE.pointsToPolygon(c)):"M0 0, L0 0"}},"single-edge");var WL=kT.cloneEvent,qL=kT.isNaN,XL=Math.abs,KL=["shift","ctrl","alt","control"],JL={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,scalableRange:0,allowDragOnItem:!1}},getEvents:function(){return{mousedown:"onMouseDown",drag:"onDragMove",dragend:"onMouseUp","canvas:click":"onMouseUp",keyup:"onKeyUp",focus:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onMouseUp"}},updateViewport:function(t){var e=this.origin,r=+t.clientX,n=+t.clientY;if(!qL(r)&&!qL(n)){var i=r-e.x,o=n-e.y;"x"===this.get("direction")?o=0:"y"===this.get("direction")&&(i=0),this.origin={x:r,y:n};var a=this.graph.get("width"),s=this.graph.get("height"),u=this.graph.get("canvas").getCanvasBBox(),l=this.scalableRange,c=this.scalableRange;l<1&&l>-1&&(l*=a,c*=s),(u.minX<=a+l&&u.minX+i>a+l||u.maxX+l>=0&&u.maxX+l+i<0)&&(i=0),(u.minY<=s+c&&u.minY+o>s+c||u.maxY+c>=0&&u.maxY+c+o<0)&&(o=0),this.graph.translate(i,o)}},onTouchStart:function(t){var e=t.originalEvent.touches,r=e[0],n=e[1];r&&n||(t.preventDefault(),this.mousedown=!0,this.onDragStart(t))},onMouseDown:function(t){this.mousedown=!0},onDragMove:function(t){this.mousedown&&(this.dragstart?this.onDrag(t):(this.dragstart=!0,this.onDragStart(t)))},onDragStart:function(t){var e=t.originalEvent;if((!e||"touchstart"===t.name||0===e.button)&&("touchstart"===t.name||"undefined"==typeof window||!window.event||window.event.buttons||window.event.button)&&this.shouldBegin(t,this)&&!this.keydown&&this.allowDrag(t)){if(this.origin={x:t.clientX,y:t.clientY},this.dragging=!1,this.enableOptimize){for(var r=this.graph,n=r.getEdges(),i=0,o=n.length;is)for(var h=n.getNodes(),p=0,d=h.length;p-1?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.keydown=!1,this.origin=null,this.dragging=!1,this.dragbegin=!1},allowDrag:function(t){var e,r,n=t.target,i=n&&n.isCanvas&&n.isCanvas();if((0,Ux.isBoolean)(this.allowDragOnItem)&&!this.allowDragOnItem&&!i)return!1;if((0,Ux.isObject)(this.allowDragOnItem)){var o=this.allowDragOnItem,a=o.node,s=o.edge,u=o.combo,l=null===(r=null===(e=t.item)||void 0===e?void 0:e.getType)||void 0===r?void 0:r.call(e);if(!a&&"node"===l)return!1;if(!s&&"edge"===l)return!1;if(!u&&"combo"===l)return!1}return!0}},ZL={getDefaultCfg:function(){return{updateEdge:!0,delegateStyle:{},enableDelegate:!1,onlyChangeComboSize:!1,comboActiveState:"",selectedState:"selected",enableOptimize:!1,enableDebounce:!1,enableStack:!0}},getEvents:function(){return{"node:mousedown":"onMouseDown",drag:"onDragMove",dragend:"onDragEnd","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave","combo:drop":"onDropCombo","node:drop":"onDropNode","canvas:drop":"onDropCanvas",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onDragEnd",afterchangedata:"onDragEnd"}},validationCombo:function(t){return!(!this.origin||!t||t.destroyed)&&"combo"===t.getType()},onTouchStart:function(t){if(t.item){try{var e=t.originalEvent.touches,r=e[0],n=e[1];if(r&&n)return;t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.mousedown={item:t.item,target:t.target,origin:{x:t.x,y:t.y}},this.dragstart=!0,this.onDragStart(t)}},onTouchMove:function(t){try{var e=t.originalEvent.touches,r=e[0],n=e[1];if(r&&n)return void this.onDragEnd(t);t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.onDrag(t)},onMouseDown:function(t){this.mousedown={item:t.item,target:t.target,origin:{x:t.x,y:t.y}},"undefined"==typeof window||this.windowEventBinded||(this.windowEventBinded=!0,document.body.addEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.addEventListener("mouseup",this.onDragEnd.bind(this)))},onDragMove:function(t){var e,r;"node"===(null===(r=null===(e=t.item)||void 0===e?void 0:e.getType)||void 0===r?void 0:r.call(e))?this.mousedown&&(this.dragstart?this.onDrag((0,Gx.__assign)((0,Gx.__assign)({},t),this.mousedown)):(this.dragstart=!0,this.onDragStart(t))):this.onDragEnd()},onDragStart:function(t){var e=this;if(this.currentShouldEnd=!0,this.shouldBegin((0,Gx.__assign)((0,Gx.__assign)({},t),this.mousedown),this)){var r=this.mousedown,n=r.item,i=r.target;if(n&&!n.destroyed&&!n.hasLocked()){if(n.getContainer().set("capture",!1),this.cachedCaptureItems||(this.cachedCaptureItems=[]),this.cachedCaptureItems.push(n),i)if(i.get("isAnchorPoint"))return;var o=this.graph;this.targets=[],this.targetCombo=null;var a=o.findAllByState("node",this.selectedState),s=n.get("id");if(0===a.filter(function(t){var e=t.get("id");return s===e}).length?this.targets.push(n):a.length>1?a.forEach(function(t){t.hasLocked()||e.targets.push(t)}):this.targets.push(n),this.graph.get("enabledStack")&&this.enableStack){var u=[];this.targets.forEach(function(t){var e=t.getModel(),r=e.x,n=e.y,i=e.id;u.push({x:r,y:n,id:i})}),this.set("beforeDragNodes",u)}this.hidenEdge={},this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(t){t.getEdges().forEach(function(t){t.isVisible()&&(e.hidenEdge[t.getID()]=!0,t.hide())})}),this.origin=this.mousedown.origin,this.point={},this.originPoint={}}}},onDrag:function(t){var e=this;if(this.mousedown&&this.origin&&this.shouldUpdate(t,this))if(this.get("enableDelegate"))this.updateDelegate(t);else if(this.enableDebounce)this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos});else{var r={};this.targets.map(function(n){e.update(n,t);var i=n.getModel().comboId;i&&(r[i]=e.graph.findById(i))}),this.onlyChangeComboSize&&this.updateParentCombos()}},onDragEnd:function(t){var e,r=this;if(this.mousedown=!1,this.dragstart=!1,"undefined"!=typeof window&&this.windowEventBinded&&(this.windowEventBinded=!1,document.body.removeEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.removeEventListener("mouseup",this.onDragEnd.bind(this))),this.origin){null===(e=this.cachedCaptureItems)||void 0===e||e.forEach(function(t){t.getContainer().set("capture",!0)}),this.cachedCaptureItems=[],this.delegateRect&&(this.delegateRect.remove(),this.delegateRect=null),this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(t){t.getEdges().forEach(function(t){r.hidenEdge[t.getID()]&&t.show(),t.refresh()})}),this.hidenEdge={};var n=this.graph;if(n.get("enabledStack")&&this.enableStack){var i={before:{nodes:[],edges:[],combos:[]},after:{nodes:[],edges:[],combos:[]}};this.get("beforeDragNodes").forEach(function(t){i.before.nodes.push(t)}),this.targets.forEach(function(t){var e=t.getModel(),r=e.x,n=e.y,o=e.id;i.after.nodes.push({x:r,y:n,id:o})}),n.pushStack("update",(0,Ux.clone)(i))}n.emit("dragnodeend",{items:this.targets,targetItem:null}),this.point={},this.origin=null,this.originPoint={},this.targets.length=0,this.targetCombo=null}},onDropCombo:function(t){var e=t.item;if(this.currentShouldEnd=this.shouldEnd(t,e,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd&&this.validationCombo(e)){var r=this.graph;if(this.comboActiveState&&r.setItemState(e,this.comboActiveState,!1),this.targetCombo=e,this.onlyChangeComboSize)r.updateCombos();else{var n=e.getModel();this.targets.map(function(t){t.getModel().comboId!==n.id&&r.updateComboTree(t,n.id)}),r.updateCombo(e)}r.emit("dragnodeend",{items:this.targets,targetItem:this.targetCombo})}},onDropCanvas:function(t){var e=this.graph;this.currentShouldEnd=this.shouldEnd(t,void 0,this),this.updatePositions(t,!this.currentShouldEnd),this.targets&&0!==this.targets.length&&this.currentShouldEnd&&(this.onlyChangeComboSize?this.updateParentCombos():this.targets.map(function(t){t.getModel().comboId&&e.updateComboTree(t)}))},onDropNode:function(t){if(this.targets&&0!==this.targets.length){var e=t.item,r=this.graph,n=e.getModel().comboId,i=n?r.findById(n):void 0;if(this.currentShouldEnd=this.shouldEnd(t,i,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd){if(this.onlyChangeComboSize)this.updateParentCombos();else if(n){var o=r.findById(n);this.comboActiveState&&r.setItemState(o,this.comboActiveState,!1),this.targets.map(function(t){var e=t.getModel();n!==e.comboId&&r.updateComboTree(t,n)}),r.updateCombo(o)}else this.targets.map(function(t){t.getModel().comboId&&r.updateComboTree(t)});r.emit("dragnodeend",{items:this.targets,targetItem:e})}}},onDragEnter:function(t){var e=t.item;if(this.validationCombo(e)){var r=this.graph;this.comboActiveState&&r.setItemState(e,this.comboActiveState,!0)}},onDragLeave:function(t){var e=t.item;if(this.validationCombo(e)){var r=this.graph;this.comboActiveState&&r.setItemState(e,this.comboActiveState,!1)}},updatePositions:function(t,e){var r=this;this.targets&&0!==this.targets.length&&(this.get("enableDelegate")?this.enableDebounce?this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos}):e||this.targets.map(function(e){return r.update(e,t)}):this.targets.map(function(n){return r.update(n,t,e)}))},update:function(t,e,r){var n=this.origin,i=t.get("model"),o=t.get("id");this.point[o]||(this.point[o]={x:i.x||0,y:i.y||0});var a=e.x-n.x+this.point[o].x,s=e.y-n.y+this.point[o].y;r&&(a+=n.x-e.x,s+=n.y-e.y);var u={x:a,y:s};this.get("updateEdge")?this.graph.updateItem(t,u,!1):t.updatePosition(u)},debounceUpdate:(0,Ux.debounce)(function(t){var e=t.targets,r=t.graph,n=t.point,i=t.origin,o=t.evt,a=t.updateEdge,s=t.onlyChangeComboSize,u=t.updateParentCombos;e.map(function(t){var e=t.get("model"),s=t.get("id");n[s]||(n[s]={x:e.x||0,y:e.y||0});var u={x:o.x-i.x+n[s].x,y:o.y-i.y+n[s].y};a?r.updateItem(t,u,!1):t.updatePosition(u)}),s&&u(r,e)},50,!0),updateDelegate:function(t){var e=this.graph;if(this.delegateRect){var r=t.x-this.origin.x+this.originPoint.minX,n=t.y-this.origin.y+this.originPoint.minY;this.delegateRect.attr({x:r,y:n})}else{var i=e.get("group"),o=(0,Ux.deepMix)({},uT.delegateStyle,this.delegateStyle),a=this.calculationGroupPosition(t),s=a.x,u=a.y,l=a.width,c=a.height,f=a.minX,h=a.minY;this.originPoint={x:s,y:u,width:l,height:c,minX:f,minY:h},this.delegateRect=i.addShape("rect",{attrs:(0,Gx.__assign)({width:l,height:c,x:s,y:u},o),name:"rect-delegate-shape"}),this.delegate=this.delegateRect,this.delegateRect.set("capture",!1)}},calculationGroupPosition:function(t){var e=this.targets;0===e.length&&e.push(t.item);for(var r=1/0,n=-1/0,i=1/0,o=-1/0,a=0;an&&(n=c),f>o&&(o=f)}return{x:Math.floor(r),y:Math.floor(i),width:Math.ceil(n)-Math.floor(r),height:Math.ceil(o)-Math.floor(i),minX:r,minY:i}},updateParentCombos:function(t,e){var r=t||this.graph,n=e||this.targets,i={};null===n||void 0===n||n.forEach(function(t){var e=t.getModel().comboId;e&&(i[e]=r.findById(e))}),Object.values(i).forEach(function(t){t&&r.updateCombo(t)})}},$L=null,tN={getDefaultCfg:function(){return{trigger:"mouseenter",activeState:"active",inactiveState:"inactive",resetSelected:!1,shouldClearStatusOnSecond:!1,shouldUpdate:function(){return!0}}},getEvents:function(){return"mouseenter"===this.get("trigger")?{"node:mouseenter":"setAllItemStates","combo:mouseenter":"setAllItemStates","node:mouseleave":"clearActiveState","combo:mouseleave":"clearActiveState"}:{"node:click":"setAllItemStates","combo:click":"setAllItemStates","canvas:click":"clearActiveState","node:touchstart":"setOnTouchStart","combo:touchstart":"setOnTouchStart","canvas:touchstart":"clearOnTouchStart"}},setOnTouchStart:function(t){try{var e=t.originalEvent.touches,r=e[0],n=e[1];if(r&&n)return;t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.setAllItemStates(t)},clearOnTouchStart:function(t){try{var e=t.originalEvent.touches,r=e[0],n=e[1];if(r&&n)return;t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.clearActiveState(t)},setAllItemStates:function(t){clearTimeout(this.timer),this.throttleSetAllItemStates(t,this)},clearActiveState:function(t){var e=this;this.shouldClearStatusOnSecond&&($L=null),this.timer=setTimeout(function(){e.throttleClearActiveState(t,e)},50)},throttleSetAllItemStates:(0,Ux.throttle)(function(t,e){var r=t.item,n=e.graph;if(n&&!n.destroyed&&(e.item=r,e.shouldUpdate(t.item,{event:t,action:"activate"},e))){var i=e.shouldClearStatusOnSecond,o=r.getModel().id;if($L===o&&i)return e.throttleClearActiveState(t,e),void($L=null);for(var a=e.activeState,s=e.inactiveState,u=n.getNodes(),l=n.getCombos(),c=n.getEdges(),f=n.get("vedges"),h=u.length,p=l.length,d=c.length,y=f.length,g=e.inactiveItems||{},v=e.activeItems||{},m=0;m-1||(this.trigger="shift",console.warn("Behavior brush-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),"drag"===this.trigger?{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates"}:{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates",keyup:"onKeyUp",keydown:"onKeyDown"}},onMouseDown:function(t){var e=t.item,r=this.brush,n=this.selectOnCombo,i="combo"===(null===e||void 0===e?void 0:e.getType());i&&!n||!i&&e||("drag"===this.trigger||this.keydown)&&(this.selectedNodes&&0!==this.selectedNodes.length&&this.clearStates(),r||(r=this.createBrush()),this.originPoint={x:t.canvasX,y:t.canvasY},r.attr({width:0,height:0}),r.show(),this.dragging=!0)},onMouseMove:function(t){this.dragging&&("drag"===this.trigger||this.keydown)&&this.updateBrush(t)},onMouseUp:function(t){this.graph;(this.brush||this.dragging)&&("drag"===this.trigger||this.keydown)&&(this.brush.remove(!0),this.brush=null,this.getSelectedNodes(t),this.dragging=!1)},clearStates:function(){var t=this.graph,e=this.selectedState,r=t.findAllByState("node",e),n=t.findAllByState("edge",e),i=t.findAllByState("combo",e);r.forEach(function(r){return t.setItemState(r,e,!1)}),n.forEach(function(r){return t.setItemState(r,e,!1)}),i.forEach(function(r){return t.setItemState(r,e,!1)}),this.selectedNodes=[],this.selectedEdges=[],this.selectedCombos=[],this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges,this.selectedCombos),t.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})},isBBoxCenterInRect:function(t,e,r,n,i){var o=t.getBBox();return o.centerX>=e&&o.centerX<=r&&o.centerY>=n&&o.centerY<=i},getSelectedNodes:function(t){var e=this,r=this.graph,n=this.originPoint,i=this.shouldUpdate,o=this.isBBoxCenterInRect,a=this.selectedState,s={x:t.x,y:t.y},u=r.getPointByCanvas(n.x,n.y),l=eN(s.x,u.x),c=rN(s.x,u.x),f=eN(s.y,u.y),h=rN(s.y,u.y),p=[],d=[];r.getNodes().forEach(function(t){if(t.isVisible()&&o(t,l,c,f,h)&&i(t,"select",e)){p.push(t);var n=t.getModel();d.push(n.id),r.setItemState(t,a,!0)}});var y=[];this.includeEdges&&p.forEach(function(t){t.getOutEdges().forEach(function(t){if(t.isVisible()){var n=t.getModel(),o=n.source,a=n.target;d.includes(o)&&d.includes(a)&&i(t,"select",e)&&(y.push(t),r.setItemState(t,e.selectedState,!0))}})});var g=[];this.includeCombos&&r.getCombos().forEach(function(t){if(t.isVisible()&&o(t,l,c,f,h)&&i(t,"select",e)){g.push(t);var n=t.getModel();d.push(n.id),r.setItemState(t,a,!0)}}),this.selectedEdges=y,this.selectedNodes=p,this.selectedCombos=g,this.onSelect&&this.onSelect(p,y,g),r.emit("nodeselectchange",{selectedItems:{nodes:p,edges:y,combos:g},select:!0})},createBrush:function(){var t=this.graph.get("canvas").addShape("rect",{attrs:this.brushStyle,capture:!1,name:"brush-shape"});return this.brush=t,this.delegate=t,t},updateBrush:function(t){var e=this.originPoint;this.brush.attr({width:nN(t.canvasX-e.x),height:nN(t.canvasY-e.y),x:eN(t.canvasX,e.x),y:eN(t.canvasY,e.y)})},onKeyDown:function(t){var e=t.key;if(e){var r=this.trigger.toLowerCase(),n=e.toLowerCase();this.keydown=n===r||"control"===n&&"ctrl"===r||"ctrl"===n&&"control"===r}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.keydown=!1}},aN=["shift","ctrl","alt","control"],sN={getDefaultCfg:function(){return{multiple:!0,trigger:"shift",selectedState:"selected",selectNode:!0,selectEdge:!1,selectCombo:!0}},getEvents:function(){return aN.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="shift",console.warn("Behavior click-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),this.multiple?{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick",keyup:"onKeyUp",keydown:"onKeyDown"}:{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick"}},onClick:function(t){var e=this,r=t.item;if(r&&!r.destroyed){var n=r.getType(),i=e.graph,o=e.keydown,a=e.multiple,s=e.shouldUpdate;if((0,e.shouldBegin)(t,e)){if(!o||!a){var u=i.findAllByState("node",e.selectedState).concat(i.findAllByState("edge",e.selectedState)).concat(i.findAllByState("combo",e.selectedState));(0,Ux.each)(u,function(t){t!==r&&i.setItemState(t,e.selectedState,!1)})}if(function(){switch(n){case"node":return e.selectNode;case"edge":return e.selectEdge;case"combo":return e.selectCombo;default:return!1}}())if(r.hasState(e.selectedState)){s(t,e)&&i.setItemState(r,e.selectedState,!1);l=i.findAllByState("node",e.selectedState),c=i.findAllByState("edge",e.selectedState),f=i.findAllByState("combo",e.selectedState);i.emit("nodeselectchange",{target:r,selectedItems:{nodes:l,edges:c,combos:f},select:!1})}else{s(t,e)&&i.setItemState(r,e.selectedState,!0);l=i.findAllByState("node",e.selectedState),c=i.findAllByState("edge",e.selectedState),f=i.findAllByState("combo",e.selectedState);i.emit("nodeselectchange",{target:r,selectedItems:{nodes:l,edges:c,combos:f},select:!0})}else{var l=i.findAllByState("node",e.selectedState),c=i.findAllByState("edge",e.selectedState),f=i.findAllByState("combo",e.selectedState);i.emit("nodeselectchange",{selectedItems:{nodes:l,edges:c,combos:f},select:!1})}}}},onCanvasClick:function(t){var e=this,r=this.graph;if((0,this.shouldBegin)(t,this)){var n=r.findAllByState("node",this.selectedState);(0,Ux.each)(n,function(t){r.setItemState(t,e.selectedState,!1)});var i=r.findAllByState("edge",this.selectedState);(0,Ux.each)(i,function(t){r.setItemState(t,e.selectedState,!1)});var o=r.findAllByState("combo",this.selectedState);(0,Ux.each)(o,function(t){r.setItemState(t,e.selectedState,!1)}),r.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})}},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.trigger.toLowerCase()||"control"===e.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.keydown=!1}},uN=Wx.pd,lN={getDefaultCfg:function(){return this.isFireFox="firefox"===CT(),{sensitivity:2,minZoom:void 0,maxZoom:void 0,enableOptimize:!1,optimizeZoom:.1,fixSelectedItems:{fixAll:!1,fixLineWidth:!1,fixLabel:!1,fixState:"selected"},animate:!1,animateCfg:{duration:500}}},getEvents:function(){var t=this.fixSelectedItems;return t.fixState||(t.fixState="selected"),t.fixAll&&(t.fixLineWidth=!0,t.fixLabel=!0),{wheel:"onWheel",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd"}},onTouchStart:function(t){var e=t.originalEvent.touches,r=e[0],n=e[1];t.preventDefault(),n&&(this.shouldBegin&&!this.shouldBegin(t,this)||(this.startPoint={pageX:r.pageX,pageY:r.pageY},this.moveable=!0,n&&(this.endPoint={pageX:n.pageX,pageY:n.pageY}),this.originScale=this.graph.getZoom()||this.currentScale||1))},onTouchMove:function(t){if(this.moveable){t.preventDefault();var e=t.originalEvent.touches,r=e[0],n=e[1];if(n){this.endPoint||(this.endPoint={pageX:n.pageX,pageY:n.pageY});var i=function(t,e){return Math.hypot(e.x-t.x,e.y-t.y)},o=i({x:r.pageX,y:r.pageY},{x:n.pageX,y:n.pageY})/i({x:this.startPoint.pageX,y:this.startPoint.pageY},{x:this.endPoint.pageX,y:this.endPoint.pageY}),a=this.originScale*o;this.currentScale=a;var s=this.get("minZoom")||this.graph.get("minZoom");if(!(a>(this.get("maxZoom")||this.graph.get("maxZoom"))||a0||t.wheelDelta<0?1-.05*o:1/(1-.05*o):t.wheelDelta<0?1-.05*o:1/(1-.05*o));var u=this.get("minZoom")||r.get("minZoom"),l=this.get("maxZoom")||r.get("maxZoom");if(s>l?s=l:sr/2?u-=c.width:u+=this.offset,l>n/2?l-=c.height:l+=this.offset;var f="".concat(u,"px"),h="".concat(l,"px");rO(this.container,{left:f,top:h,visibility:"visible"})}else rO(i,{visibility:"hidden"})},createTooltip:function(t){var e=t.get("el");e.style.position="relative";var r=oI('
    '));return e.parentNode.appendChild(r),rO(r,{position:"absolute",visibility:"visible"}),this.width=t.get("width"),this.height=t.get("height"),this.container=r,this.graph.get("tooltips").push(r),r}},fN=(0,Gx.__assign)({getDefaultCfg:function(){return{item:"node",offset:12,formatText:function(t){return t.label}}},getEvents:function(){return{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},cN),hN=(0,Gx.__assign)({getDefaultCfg:function(){return{item:"edge",offset:12,formatText:function(t){return"source: ".concat(t.source," target: ").concat(t.target)}}},getEvents:function(){return{"edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},cN),pN=["click","dblclick"],dN={getDefaultCfg:function(){return{trigger:"click",onChange:function(){}}},getEvents:function(){var t,e;return pN.includes(this.trigger)?e=this.trigger:(e="click",console.warn("Behavior collapse-expand 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),(t={})["node:".concat(e)]="onNodeClick",t.touchstart="onNodeClick",t},onNodeClick:function(t){var e=this;if("click"===this.trigger){if(this.timer)return clearTimeout(this.timer),void(this.timer=0);this.timer=setTimeout(function(){e.toggle(t),clearTimeout(e.timer),e.timer=0},200)}else this.toggle(t)},toggle:function(t){var e=t.item;if(e){var r=this.graph.findDataById(e.get("id"));if(r){var n=r.children;if(n&&0!==n.length){var i=!r.collapsed;this.shouldBegin(t,i,this)&&(r.collapsed=i,e.getModel().collapsed=i,this.graph.emit("itemcollapsed",{item:t.item,collapsed:i}),this.shouldUpdate(t,i,this)&&(this.onChange(e,i,this),this.graph.layout()))}}}}},yN=kT.calculationItemsBBox,gN={getDefaultCfg:function(){return{enableDelegate:!1,delegateStyle:{},onlyChangeComboSize:!1,activeState:"",selectedState:"selected",enableStack:!0}},getEvents:function(){return{"combo:mousedown":"onMouseDown","combo:dragstart":"onDragStart","combo:drag":"onDrag","combo:dragend":"onDragEnd","combo:drop":"onDrop","node:drop":"onNodeDrop","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave"}},validationCombo:function(t){var e=t.item;return!(!e||e.destroyed)&&(!!this.shouldUpdate(t,this)&&"combo"===e.getType())},onMouseDown:function(t){this.origin={x:t.x,y:t.y}},onDragStart:function(t){var e=this,r=this.graph,n=t.item;if(this.currentShouldEnd=!0,this.validationCombo(t)){this.targets=[];var i=r.findAllByState("combo",this.selectedState),o=n.get("id");0===i.filter(function(t){var e=t.get("id");return o===e}).length?this.targets.push(n):this.targets=i;var a=[];this.targets.forEach(function(t){var e=t.getModel(),r=e.x,n=e.y,i=e.id;a.push({x:r,y:n,id:i})}),this.set("beforeDragItems",a),this.activeState&&this.targets.map(function(t){var n=t.getModel();if(n.parentId){var i=r.findById(n.parentId);i&&r.setItemState(i,e.activeState,!0)}}),this.point={},this.originPoint={},this.currentItemChildCombos=[],function t(e,r){if(!1!==r(e)&&e){var n=e.get("combos");if(0===n.length)return!1;(0,Ux.each)(n,function(e){t(e,r)})}}(n,function(t){if(t.destroyed)return!1;var r=t.getModel();return e.currentItemChildCombos.push(r.id),!0})}},onDrag:function(t){var e=this;if(this.origin&&this.validationCombo(t))if(this.enableDelegate)this.updateDelegate(t);else{if(this.activeState){var r=this.graph,n=t.item,i=n.getModel(),o=r.getCombos(),a=n.getBBox(),s=a.centerX,u=a.centerY,l=a.width;o.filter(function(t){var r=t.getModel();return i.parentId,r.id!==i.id&&!e.currentItemChildCombos.includes(r.id)}).map(function(t){var n=t.getBBox(),i=n.centerX,o=n.centerY,a=n.width,c=s-i,f=u-o,h=2*Math.sqrt(c*c+f*f);l+a-h>.8*l?r.setItemState(t,e.activeState,!0):r.setItemState(t,e.activeState,!1)})}(0,Ux.each)(this.targets,function(r){e.updateCombo(r,t)}),this.onlyChangeComboSize&&this.updateParentCombos()}},updatePositions:function(t,e){var r=this;(this.enableDelegate||e)&&(0,Ux.each)(this.targets,function(n){r.updateCombo(n,t,e)})},onDrop:function(t){var e=this,r=t.item;if(this.currentShouldEnd=this.shouldEnd(t,r,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd&&r&&this.targets&&!r.destroyed){var n=this.graph,i=r.getModel();this.targets.map(function(t){t.getModel().parentId!==i.id?(e.activeState&&n.setItemState(r,e.activeState,!1),e.onlyChangeComboSize?n.updateCombo(t):n.updateComboTree(t,i.id,!1)):n.updateCombo(r)}),this.end(r,t),this.endComparison=!0}},onNodeDrop:function(t){var e=this;if(this.targets&&0!==this.targets.length){var r=this.graph,n=t.item.getModel().comboId,i=n?r.findById(n):void 0;if(this.currentShouldEnd=this.shouldEnd(t,i,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd){var o;if(n){if(this.activeState){var a=r.findById(n);r.setItemState(a,this.activeState,!1)}this.targets.map(function(t){e.onlyChangeComboSize?r.updateCombo(t):n!==t.getID()&&(o=r.findById(n),n!==t.getModel().parentId&&r.updateComboTree(t,n,!1))})}else this.targets.map(function(t){e.onlyChangeComboSize?r.updateCombo(t):t.getModel().comboId&&r.updateComboTree(t,void 0,!1)});this.endComparison=!0,this.end(o,t)}}},onDragEnter:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,r=this.graph;this.activeState&&r.setItemState(e,this.activeState,!0)}},onDragLeave:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,r=this.graph;this.activeState&&r.setItemState(e,this.activeState,!1)}},onDragEnd:function(t){if(this.targets&&0!==this.targets.length){var e=t.item;this.currentShouldEnd&&this.updatePositions(t);var r=this.getParentCombo(e.getModel().parentId),n=this.graph;r&&this.activeState&&n.setItemState(r,this.activeState,!1),this.end(void 0,t)}},end:function(t,e){var r=this;if(this.origin){var n=this.graph;if(this.delegateShape)n.get("delegateGroup").clear(),this.delegateShape=null;if(t&&this.activeState&&n.setItemState(t,this.activeState,!1),!t){var i=n.get("enabledStack")&&this.enableStack,o={before:{nodes:[],edges:[],combos:[].concat(this.get("beforeDragItems"))},after:{nodes:[],edges:[],combos:[]}};this.targets.map(function(t){if(r.onlyChangeComboSize){n.updateCombo(t);var e=t.getModel(),a=e.x,s=e.y,u=e.id;o.after.combos.push({x:a,y:s,id:u}),n.pushStack("update",o)}else n.updateComboTree(t,void 0,i)})}this.point=[],this.origin=null,this.originPoint=null,this.targets.length=0}},traverse:function(t,e,r){var n=this;if(void 0===r&&(r={}),!1!==e(t,r)&&t){var i=t.get("combos");(0,Ux.each)(i,function(t){n.traverse(t,e,r)});var o=t.get("nodes");(0,Ux.each)(o,function(t){n.traverse(t,e,r)})}},updateCombo:function(t,e,r){this.updateSingleItem(t,e,r);var n={};this.traverse(t,function(t,e){return!t.destroyed&&(t.getEdges().forEach(function(t){return e[t.getID()]=t}),!0)},n),Object.values(n).forEach(function(t){return t.refresh()})},updateSingleItem:function(t,e,r){var n=this.origin,i=this.graph,o=t.getModel(),a=t.get("id");this.point[a]||(this.point[a]={x:o.x,y:o.y});var s=e.x-n.x+this.point[a].x,u=e.y-n.y+this.point[a].y;r&&(s+=n.x-e.x,u+=n.y-e.y),i.updateItem(t,{x:s,y:u},!1)},getParentCombo:function(t){var e=this.graph;if(t){var r=e.findById(t);if(r)return r}},updateDelegate:function(t){var e=this.graph;if(this.delegateShape){var r=t.x-this.origin.x+this.originPoint.minX,n=t.y-this.origin.y+this.originPoint.minY;this.delegateShape.attr({x:r,y:n})}else{var i=e.get("delegateGroup"),o=null,a=(o=this.targets.length>1?yN(this.targets):this.targets[0].getBBox()).x,s=o.y,u=o.width,l=o.height,c=o.minX,f=o.minY;this.originPoint={x:a,y:s,width:u,height:l,minX:c,minY:f};var h=(0,Gx.__assign)((0,Gx.__assign)({},uT.delegateStyle),this.delegateStyle);this.delegateShape=i.addShape("rect",{attrs:(0,Gx.__assign)({width:o.width,height:o.height,x:o.x,y:o.y},h),name:"combo-delegate-shape"}),this.delegateShape.set("capture",!1),this.delegate=this.delegateShape}},updateParentCombos:function(){var t=this.graph,e=this.targets,r={};null===e||void 0===e||e.forEach(function(e){var n=e.getModel().parentId;n&&(r[n]=t.findById(n))}),Object.values(r).forEach(function(e){e&&t.updateCombo(e)})}},vN=["click","dblclick"],mN={getDefaultCfg:function(){return{trigger:"dblclick",relayout:!0}},getEvents:function(){var t,e;return vN.includes(this.trigger)?e=this.trigger:(e="dblclick",console.warn("Behavior collapse-expand-group 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),(t={})["combo:".concat(e)]="onComboClick",t},onComboClick:function(t){var e=t.item,r=this.graph,n=this.relayout;if(e&&!e.destroyed&&"combo"===e.getType()){var i=e.getModel().id;i&&(r.collapseExpandCombo(i),n&&r.get("layout")?r.layout():r.refreshPositions())}}},bN=kT.isPolygonsIntersect,AN=kT.pathToPoints,xN=["drag","shift","ctrl","alt","control"],wN=["click","drag"],_N=["shift","ctrl","control","alt","meta",void 0],SN=["shift","ctrl","alt","control"],EN=["shift","ctrl","alt","control","meta"],CN={"drag-canvas":JL,"zoom-canvas":lN,"drag-node":ZL,"activate-relations":tN,"brush-select":oN,"click-select":sN,"lasso-select":{getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},shouldDeselect:void 0,selectedState:"selected",trigger:"shift",includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return xN.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="shift",console.warn("Behavior lasso-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),"drag"===this.trigger?{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd","canvas:click":"clearStates"}:{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd",keyup:"onKeyUp",keydown:"onKeyDown","canvas:click":"clearStates"}},onDragStart:function(t){var e=this.lasso;t.item||("drag"===this.trigger||this.keydown)&&(this.selectedNodes&&0!==this.selectedNodes.length&&this.clearStates("dragstart"),e||(e=this.createLasso()),this.dragging=!0,this.originPoint={x:t.x,y:t.y},this.points.push(this.originPoint),e.show())},onDragMove:function(t){this.dragging&&("drag"===this.trigger||this.keydown)&&(this.points.push({x:t.x,y:t.y}),this.updateLasso(t))},onDragEnd:function(t){(this.lasso||this.dragging)&&("drag"===this.trigger||this.keydown)&&(this.points.push(this.originPoint),this.getSelectedItems(),this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1)},getLassoPath:function(){var t=this.points,e=[];return t.length&&(t.forEach(function(t,r){0===r?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])}),e.push(["L",t[0].x,t[0].y])),e},clearStates:function(t){void 0===t&&(t="canvas:click");var e=this.graph,r=this.selectedState,n=this.shouldDeselect,i=e.findAllByState("node",r),o=e.findAllByState("edge",r);n&&!n({action:t,nodes:i,edges:o})||(i.forEach(function(t){return e.setItemState(t,r,!1)}),o.forEach(function(t){return e.setItemState(t,r,!1)})),this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),this.selectedNodes=[],this.selectedEdges=[],e.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedItems:function(){var t=this,e=this.graph,r=this.shouldUpdate,n=this.points.map(function(t){return[e.getCanvasByPoint(t.x,t.y).x,e.getCanvasByPoint(t.x,t.y).y]}),i=this.selectedState,o=[],a=[];e.getNodes().forEach(function(s){if(s.isVisible()&&function(t,e){var r,n=t.getKeyShape();if("path"===t.get("type"))r=AN(n.attr("path"));else{var i=n.getCanvasBBox();r=[[i.minX,i.minY],[i.maxX,i.minY],[i.maxX,i.maxY],[i.minX,i.maxY]]}return bN(e,r)}(s,n)&&r(s,"select",t)){o.push(s);var u=s.getModel();a.push(u.id),e.setItemState(s,i,!0)}});var s=[];this.includeEdges&&o.forEach(function(n){n.getOutEdges().forEach(function(n){if(n.isVisible()){var i=n.getModel(),o=i.source,u=i.target;a.includes(o)&&a.includes(u)&&r(n,"select",t)&&(s.push(n),e.setItemState(n,t.selectedState,!0))}})}),this.selectedEdges=s,this.selectedNodes=o,this.onSelect&&this.onSelect(o,s),e.emit("nodeselectchange",{selectedItems:{nodes:o,edges:s},select:!0})},createLasso:function(){var t=this.graph.get("delegateGroup").addShape("path",{attrs:(0,Gx.__assign)({path:[]},this.delegateStyle),capture:!1,name:"lasso-shape"});return this.lasso=t,this.delegate=t,this.points=[],t},updateLasso:function(t){this.lasso.attr({path:this.getLassoPath()})},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.trigger.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.lasso&&(this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1),this.keydown=!1}},tooltip:fN,"edge-tooltip":hN,"collapse-expand":dN,"drag-combo":gN,"collapse-expand-combo":mN,"create-edge":{getDefaultCfg:function(){return{trigger:"click",key:void 0,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var t;return wN.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="click",console.warn("Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'")),this.key&&-1===_N.indexOf(this.key.toLowerCase())&&(this.trigger=void 0,console.warn("Behavior create-edge 的 key 参数不合法,请输入 'shift','ctrl','alt','control',或 undefined")),"drag"===this.trigger?t={"node:dragstart":"onClick","combo:dragstart":"onClick",drag:"updateEndPoint","node:drop":"onClick","combo:drop":"onClick",dragend:"onDragEnd"}:"click"===this.trigger&&(t={"node:click":"onClick",mousemove:"updateEndPoint","edge:click":"cancelCreating","canvas:click":"cancelCreating","combo:click":"onClick"}),this.key&&(t.keydown="onKeyDown",t.keyup="onKeyUp"),t},onDragEnd:function(t){if(!this.key||this.keydown){var e=t.item;e&&e.getID()!==this.source&&"node"===e.getType()||this.cancelCreating({item:this.edge,x:t.x,y:t.y})}},onClick:function(t){if(!this.key||this.keydown){var e=t.item,r=this.graph,n=e.getModel(),i=this.getEdgeConfig;if(this.addingEdge&&this.edge){if(!this.shouldEnd(t,this))return;var o=void 0;o=i&&(0,Ux.isFunction)(i)?i({source:this.source,target:n.id},this):this.edgeConfig;var a=(0,Gx.__assign)({target:n.id},o);if(this.source===n.id&&(a.type="loop"),r.emit("beforecreateedge",{}),r.updateItem(this.edge,a,!1),r.get("enabledStack")){var s=(0,Gx.__assign)((0,Gx.__assign)({},this.edge.getModel()),{itemType:"edge"}),u={};u.edges=[s],r.pushStack("add",{before:{},after:u})}r.emit("aftercreateedge",{edge:this.edge}),this.edge.getKeyShape().set("capture",!0),this.edge=null,this.addingEdge=!1}else{if(!this.shouldBegin(t,this))return;o=void 0;o=i&&(0,Ux.isFunction)(i)?i({source:n.id,target:n.id},this):this.edgeConfig,this.edge=r.addItem("edge",(0,Gx.__assign)({source:n.id,target:n.id},o),!1),this.source=n.id,this.addingEdge=!0,this.edge.getKeyShape().set("capture",!1)}}},updateEndPoint:function(t){if(!this.key||this.keydown){this.edge&&this.edge.destroyed&&this.cancelCreating({item:this.edge});var e={x:t.x,y:t.y};this.graph.findById(this.source)?this.addingEdge&&this.edge&&this.graph.updateItem(this.edge,{target:e},!1):this.addingEdge=!1}},cancelCreating:function(t){var e,r;if(!this.key||this.keydown){var n=this.graph,i=t.item;return this.addingEdge&&(this.edge===i||(null===(r=null===(e=t.target)||void 0===e?void 0:e.isCanvas)||void 0===r?void 0:r.call(e)))?(this.edge&&!this.edge.destroyed&&n.removeItem(this.edge,!1),this.edge=null,void(this.addingEdge=!1)):void 0}},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.key.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.addingEdge&&this.edge&&(this.graph.removeItem(this.edge,!1),this.addingEdge=!1,this.edge=null),this.keydown=!1}},"shortcuts-call":{getDefaultCfg:function(){return{trigger:"ctrl",combinedKey:"1",functionName:"fitView",functionParams:[]}},getEvents:function(){return SN.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="ctrl",console.warn("Behavior shortcuts-fit-view 的 trigger 参数 '".concat(this.trigger,"' 不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'"))),this.combinedKey===this.trigger&&(this.combinedKey=void 0),{keyup:"onKeyUp",keydown:"onKeyDown"}},onKeyDown:function(t){var e=t.key;if(e){var r=this.trigger.toLowerCase(),n=e.toLowerCase();this.triggerKeydown||(this.triggerKeydown=n===r||"control"===n&&"ctrl"===r||"ctrl"===n&&"control"===r);var i=this.graph;if(!i[this.functionName])return console.warn("Behavior shortcuts-fit-view 的 functionName 参数 '".concat(this.functionName,"' 不合法,它不是 Graph 的一个函数名")),{};if(!this.triggerKeydown||this.combinedKey){var o=this.combinedKey.toLowerCase();this.triggerKeydown&&(n===o||"control"===n&&"ctrl"===o||"ctrl"===n&&"control"===o)&&(this.functionParams&&this.functionParams.length?i[this.functionName].apply(i,this.functionParams):i[this.functionName]())}else this.functionParams&&this.functionParams.length?i[this.functionName].apply(i,this.functionParams):i[this.functionName]()}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.triggerKeydown=!1}},"scroll-canvas":{getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,zoomKey:"ctrl",scalableRange:0,allowDragOnItem:!0}},getEvents:function(){return this.zoomKey&&-1!==EN.indexOf(this.zoomKey)||(this.zoomKey="ctrl"),{wheel:"onWheel"}},onWheel:function(t){var e=this;if(this.allowDrag(t)){var r=this.graph,n=Array.isArray(this.zoomKey)?[].concat(this.zoomKey):[this.zoomKey];if(n.includes("control")&&n.push("ctrl"),n.some(function(e){return t["".concat(e,"Key")]})){var i=r.get("canvas").getPointByClient(t.clientX,t.clientY),o=r.getZoom();t.wheelDelta>0?o+=.05*o:o-=.05*o,r.zoomTo(o,{x:i.x,y:i.y})}else{var a=t.deltaX||t.movementX,s=t.deltaY||t.movementY;!s&&navigator.userAgent.indexOf("Firefox")>-1&&(s=125*-t.wheelDelta/3);var u=this.graph.get("width"),l=this.graph.get("height"),c=this.graph.get("canvas").getCanvasBBox(),f=this.scalableRange,h=this.scalableRange;f<1&&f>-1&&(f*=u,h*=l);var p=c.minX,d=c.maxX,y=c.minY,g=c.maxY;a>0?d<-f?a=0:d-a<-f&&(a=d+f):a<0&&(p>u+f?a=0:p-a>u+f&&(a=p-(u+f))),s>0?g<-h?s=0:g-s<-h&&(s=g+h):s<0&&(y>l+h?s=0:y-s>l+h&&(s=y-(l+h))),"x"===this.get("direction")?s=0:"y"===this.get("direction")&&(a=0),r.translate(-a,-s)}if(t.preventDefault(),this.get("enableOptimize")){var v=this.get("optimizeZoom"),m=this.get("optimized"),b=r.getNodes(),A=r.getEdges(),x=b.length,w=A.length;if(!m){for(var _=0;_t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:this.hoverColor;return{stroke:t,shadowColor:t,shadowBlur:5,endArrow:{path:"M 0,0 L 4,2 L 4,-2 Z",fill:t}}}},{key:"_getDefaultNodeHighlightStyle",value:function(){return{lineWidth:3,stroke:arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.hoverColor}}},{key:"_getContextMenu",value:function(){var t=this;return new jN.Menu({shouldBegin:function(t){return!!(t.target&&t.target.isCanvas&&t.target.isCanvas())||!!t.item},getContent:function(e){var r=e.item;if(!(e.target&&e.target.isCanvas&&e.target.isCanvas())&&r){var n=r.getType(),i=r.getModel();return n&&i&&"node"===n?t.isCollpased(i.id)?"
      \n
    • 展开
    • \n
    ":"
      \n
    • 折叠
    • \n
    ":void 0}},handleMenuClick:function(e,r){switch(e.id.split("-")[0]){case"hide":t.hideItem(r);break;case"expand":t.expandNode(r);break;case"collapse":t.collapseNode(r);break;case"show":t.showItem(r)}},offsetX:26,offsetY:0,itemTypes:["node"]})}},{key:"_getGraphConfig",value:function(t){var e=this,r={speed:150,maxIteration:30,tick:DN()(this.refreshPositions.bind(this),150)},n={type:"fruchterman",gravity:5},i={},o={type:"line",style:{endArrow:{path:"M 0,0 L 4,2 L 4,-2 Z",fill:"#e0e0e0"},lineWidth:.5},labelCfg:{autoRotate:!0,style:{fontSize:4,fill:"#333"}}},a={default:["drag-canvas","zoom-canvas","drag-node"]},s=this._getContextMenu(),u=[new jN.ToolBar,s];if(!t)return this._setToolBarStyle(),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"knowledgeGraph",s=document.querySelector("#".concat(t));return{container:t,width:s.scrollWidth,height:s.scrollHeight,plugins:u,modes:a,layout:UN(UN({},n),r),defaultNode:i,defaultEdge:o,nodeStateStyles:{hover:e._getDefaultNodeHighlightStyle(),actived:e._getDefaultNodeHighlightStyle()},edgeStateStyles:{hover:e._getDefaultEdgeHighlightStyle(),actived:e._getDefaultEdgeHighlightStyle()}}}();t.container=t.container||"knowledgeGraph";var l="string"==typeof t.container?document.querySelector("#".concat(t.container)):t.container;t.width=t.width||l.scrollWidth,t.height=t.height||l.scrollHeight,t.layout=UN(UN(UN({},n),t.layout||{}),!1!==t.animate?r:{}),t.defaultNode=UN(UN({},i),t.defaultNode||{}),t.defaultEdge=UN(UN({},o),t.defaultEdge||{}),t.modes={default:[]},!1!==t.dragCanvas&&t.modes.default.push("drag-canvas"),!1!==t.zoomCanvas&&t.modes.default.push("zoom-canvas"),!1!==t.dragNode&&t.modes.default.push("drag-node");var c=UN(UN({},this._getDefaultNodeHighlightStyle()),t.nodeHighlightStyle||{}),f=UN(UN({},this._getDefaultEdgeHighlightStyle()),t.edgeHighlightStyle||{});return t.nodeStateStyles={hover:c,actived:c},t.edgeStateStyles={hover:f,actived:f},!1!==t.showToolBar&&(t.plugins=[new jN.ToolBar],this._setToolBarStyle()),!1!==t.showContextMenu&&(t.plugins=[].concat(FN(t.plugins||[]),[s]),this._setToolBarStyle()),t}},{key:"changeSize",value:function(t,e){return this.graph.changeSize(t,e)}},{key:"autoResize",value:function(){var t=this,e=this.getContainer();window.addEventListener("resize",function(){var r=e.scrollWidth,n=e.scrollHeight;t.graph.changeSize(r,n),t.graph.refresh()})}},{key:"zoom",value:function(t,e,r,n){this.graph.zoom(t,e,r,n)}},{key:"zoomTo",value:function(t,e,r,n){this.graph.zoomTo(t,e,r,n)}},{key:"fitView",value:function(t,e,r,n){this.graph.fitView(t,e,r,n)}},{key:"fitCenter",value:function(t,e){this.graph.fitCenter(t,e)}},{key:"getGraphCenterPoint",value:function(){return this.graph.getGraphCenterPoint()}},{key:"getViewPortCenterPoint",value:function(){return this.graph.getViewPortCenterPoint()}},{key:"getZoom",value:function(){return this.graph.getZoom()}},{key:"getMinZoom",value:function(){return this.graph.getMinZoom()}},{key:"setMinZoom",value:function(t){this.graph.setMinZoom(t)}},{key:"getMaxZoom",value:function(){return this.graph.getMaxZoom()}},{key:"setMaxZoom",value:function(t){this.graph.setMaxZoom(t)}},{key:"getWidth",value:function(){return this.graph.getWidth()}},{key:"getHeight",value:function(){return this.graph.getHeight()}},{key:"setCenter",value:function(t){var e=this.graph.getWidth()/2,r=this.graph.getHeight()/2,n=this.graph.getCanvasByPoint(t.x,t.y);this.graph.translate(e-n.x,r-n.y)}},{key:"_setToolBarStyle",value:function(){uO()("\n .g6-component-toolbar li[code='redo'],\n .g6-component-toolbar li[code='undo'],\n .g6-component-toolbar li[code='realZoom'] {\n display: none;\n }\n .g6-component-contextmenu {\n position: absolute;\n z-index: 2;\n list-style-type: none;\n border-radius: 6px;\n font-size: 14px;\n width: fit-content;\n transition: opacity .2s;\n text-align: center;\n box-shadow: 0 5px 18px 0 rgba(0, 0, 0, 0.6);\n border: 0px;\n }\n .g6-component-contextmenu ul {\n padding-left: 0px;\n margin: 0;\n }\n .g6-component-contextmenu li {\n cursor: pointer;\n list-style-type: none;\n list-style: none;\n margin-left: 0;\n line-height: 38px;\n padding: 0px 35px;\n }\n .g6-component-contextmenu li:hover {\n color: #333;\n background: #aaaaaa45;\n }\n ")}},{key:"highlightNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph,e=null;t.on("node:mouseenter",function(r){var n=r.item;t.setAutoPaint(!1),e&&t.clearItemStates(e,"hover"),t.setItemState(n,"hover",!0),e=n,t.paint(),t.setAutoPaint(!0)}),t.on("node:mouseleave",function(){t.setAutoPaint(!1),e&&(t.clearItemStates(e,"hover"),e=null),t.paint(),t.setAutoPaint(!0)})}},{key:"highlightEdge",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph,e=null;t.on("edge:mouseenter",function(r){var n=r.item;t.setAutoPaint(!1),e&&t.clearItemStates(e,"hover"),t.setItemState(n,"hover",!0),e=n,t.paint(),t.setAutoPaint(!0)}),t.on("edge:mouseleave",function(){t.setAutoPaint(!1),e&&(t.clearItemStates(e,"hover"),e=null),t.paint(),t.setAutoPaint(!0)})}},{key:"setData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;this.data?e.changeData(t):e.data(t),this.data=t}},{key:"render",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).render()}},{key:"updateGraph",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;this.data=t,e.changeData(t)}},{key:"refresh",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).refresh()}},{key:"getContainer",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).getContainer()}},{key:"getCanvas",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).get("canvas")}},{key:"getNodes",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).getNodes()}},{key:"getEdges",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).getEdges()}},{key:"getNeighbors",value:function(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).getNeighbors(t,e)}},{key:"findById",value:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph).findById(t)}},{key:"find",value:function(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).find(t,e)}},{key:"findAll",value:function(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).findAll(t,e)}},{key:"getEdgesByNode",value:function(t){return t.getEdges()}},{key:"getInEdges",value:function(t){return t.getInEdges()}},{key:"getOutEdges",value:function(t){return t.getOutEdges()}},{key:"getSourceByEdge",value:function(t){return t.getSource()}},{key:"getTargetByEdge",value:function(t){return t.getTarget()}},{key:"expandNode",value:function(t){var e=t.getModel().id;this._expandCollapseNode(this.collpasedData[e],"show"),delete this.collpasedData[e]}},{key:"collapseNode",value:function(t){var e=t.getModel().id,r=[];this._collapseFunc(t,r),this.collpasedData[e]=r,this._expandCollapseNode(r)}},{key:"isCollpased",value:function(t){return!!this.collpasedData[t]}},{key:"_collapseFunc",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=this.getNeighbors(t,"target"),n=this.getNeighbors(t,"source"),i=0;i1&&void 0!==arguments[1]?arguments[1]:"hide";t&&t.forEach(function(t){"hide"===r?e.hideItem(t.id):(e.showItem(t.id),e.isCollpased(t.id)&&delete e.collpasedData[t.id]),t.children&&e._expandCollapseNode(t.children,r)})}},{key:"showItem",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).showItem(t,e)}},{key:"hideItem",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).hideItem(t,e)}},{key:"show",value:function(t){t.show()}},{key:"hide",value:function(t){t.hide()}},{key:"changeVisibility",value:function(t,e){t.changeVisibility(e)}},{key:"isVisible",value:function(t){return t.isVisible()}},{key:"getModel",value:function(t){return t.getModel()}},{key:"addItem",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).addItem(t,e)}},{key:"removeItem",value:function(t){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph).removeItem(t)}},{key:"updateItem",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).updateItem(t,e)}},{key:"refreshItem",value:function(t){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph).refreshItem(t)}},{key:"refreshPositions",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).refreshPositions()}},{key:"on",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).on(t,e)}},{key:"off",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).off(t,e)}},{key:"toDataURL",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).toDataURL(t,e)}},{key:"bindNodeDefaultDragEvent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t.on("node:dragstart",function(t){WN(t)}),t.on("node:drag",function(t){WN(t)}),t.on("node:dragend",function(t){t.item.get("model").fx=null,t.item.get("model").fy=null})}},{key:"stopDefaultEventPropagation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t.on("click",function(t){t.stopPropagation()}),t.on("mousedown",function(t){t.stopPropagation()}),t.on("mouseover",function(t){t.stopPropagation()}),t.on("mouseout",function(t){t.stopPropagation()})}},{key:"clear",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).clear()}},{key:"destroy",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).destroy()}}])&&VN(t.prototype,e),r&&VN(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function WN(t){var e=t.item.get("model");return e.fx=t.x,e.fy=t.y,e.x=t.x,e.y=t.y,e}var qN=r(5611),XN=r.n(qN);function KN(t){"@babel/helpers - typeof";return(KN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function JN(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"G6";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.graph=null,this.config=XN()(e),this.graphRender=null,this.type=r,this.createGraphRender(this.type),this.config=this.graphRender._getGraphConfig(this.config),this.createGraph(this.config),this.CLASS_NAME="SuperMap.KnowledgeGraph"},r=[{key:"dataFromGraphMap",value:function(t,e){return Nx(t,e)}},{key:"dataFromKnowledgeGraphQuery",value:function(t){return Nx(t)}}],(e=[{key:"_handleNodes",value:function(t,e){var r=this;t.filter(function(t){return""!==t}).forEach(function(t){var n=r.findById(t);e(n,"node")})}},{key:"_handleEdges",value:function(t,e){var r=this;t.filter(function(t){return""!==t}).forEach(function(t){var n=r.find("edge",function(e){return e.get("model").edgeId==t});e(n,"edge")})}},{key:"highlight",value:function(t){var e=t.nodeIDs,r=void 0===e?[]:e,n=t.edgeIDs,i=void 0===n?[]:n,o=this.graph,a=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"node";if(e){var n=t[r+"StateStyles"];n&&o.updateItem(e,{style:e.style,stateStyles:{actived:n}}),o.setItemState(e,"actived",!0),o.paint(),o.setAutoPaint(!0)}};this._handleNodes(r,a),this._handleEdges(i,a)}},{key:"clearHighlight",value:function(t){var e=this.graph,r=function(t){t&&(e.clearItemStates(t,"actived"),e.paint(),e.setAutoPaint(!0))};if(e.setAutoPaint(!1),!t)return e.getNodes().forEach(function(t){r(t)}),void e.getEdges().forEach(function(t){r(t)});var n=t.nodeIDs,i=void 0===n?[]:n,o=t.edgeIDs,a=void 0===o?[]:o;this._handleNodes(i,r),this._handleEdges(a,r)}},{key:"handleNodeStatus",value:function(t){var e=t.expand,r=t.collapse,n=t.hidden;this.expandNodes(e),this.collapseNodes(r),this.hideNodes(n)}},{key:"expandNodes",value:function(t){var e=this;t&&t.forEach(function(t){e.expandNode(t+"")})}},{key:"collapseNodes",value:function(t){var e=this;t&&t.forEach(function(t){e.collapseNode(t+"")})}},{key:"hideNodes",value:function(t){var e=this;t&&t.forEach(function(t){e.hideItem(t+"")})}},{key:"createGraphRender",value:function(t){"G6"===t&&(this.graphRender=new YN)}},{key:"createGraph",value:function(t){var e=this.initGraph(t);return this.graph=e,this.autoResize(),e}},{key:"getGraph",value:function(){return this.graph}},{key:"autoResize",value:function(){this.config&&!1!==this.config.autoResize&&this.graphRender.autoResize()}},{key:"zoom",value:function(t,e,r,n){this.graphRender.zoom(t,e,r,n)}},{key:"zoomTo",value:function(t,e,r,n){this.graphRender.zoomTo(t,e,r,n)}},{key:"fitView",value:function(t,e,r,n){this.graphRender.fitView(t,e,r,n)}},{key:"fitCenter",value:function(t,e){this.graphRender.fitCenter(t,e)}},{key:"getGraphCenterPoint",value:function(){return this.graphRender.getGraphCenterPoint()}},{key:"getViewPortCenterPoint",value:function(){return this.graphRender.getViewPortCenterPoint()}},{key:"getZoom",value:function(){return this.graphRender.getZoom()}},{key:"getMinZoom",value:function(){return this.graphRender.getMinZoom()}},{key:"setMinZoom",value:function(t){this.graphRender.setMinZoom(t)}},{key:"getMaxZoom",value:function(){return this.graphRender.getMaxZoom()}},{key:"setMaxZoom",value:function(t){this.graphRender.setMaxZoom(t)}},{key:"getWidth",value:function(){return this.graphRender.getWidth()}},{key:"getHeight",value:function(){return this.graphRender.getHeight()}},{key:"initGraph",value:function(t){var e=this,r=this.graphRender.initGraph(t);this.graph=r;return this.graph.on("afterlayout",function(){void 0!==e.config.zoom&&e.zoom(e.config.zoom),void 0!==e.config.center&&e.graphRender.setCenter({x:e.config.center[0],y:e.config.center[1]})}),r}},{key:"setData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;t=t||{nodes:[],edges:[]},this.config&&this.config.nodeLabelMaxWidth&&(t.nodes=this.nodeLabelOpenEllipsis(this.config.nodeLabelMaxWidth,t.nodes)),this.graphRender.setData(t,e),this.render(e),this.data=t}},{key:"render",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t&&this.graphRender.render(t)}},{key:"updateGraph",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;e&&this.graphRender.updateGraph(t,e)}},{key:"refresh",value:function(){return this.graphRender.refresh()}},{key:"changeSize",value:function(t,e){return this.graphRender.changeSize(t,e)}},{key:"resize",value:function(t,e){this.graphRender.changeSize(t,e),this.graphRender.refresh()}},{key:"getContainer",value:function(){return this.graphRender.getContainer()}},{key:"getCanvas",value:function(){return this.graphRender.getCanvas()}},{key:"getNodes",value:function(){return this.graphRender.getNodes()}},{key:"getEdges",value:function(){return this.graphRender.getEdges()}},{key:"getNeighbors",value:function(t,e){return this.graphRender.getNeighbors(t,e)}},{key:"findById",value:function(t){return this.graphRender.findById(t)}},{key:"find",value:function(t,e){return this.graphRender.find(t,e)}},{key:"findAll",value:function(t,e){return this.graphRender.findAll(t,e)}},{key:"getEdgesByNode",value:function(t){return this.graphRender.getEdgesByNode(t)}},{key:"getInEdges",value:function(t){return this.graphRender.getInEdges(t)}},{key:"getOutEdges",value:function(t){return this.graphRender.getOutEdges(t)}},{key:"getSourceByEdge",value:function(t){return this.graphRender.getSourceByEdge(t)}},{key:"getTargetByEdge",value:function(t){return this.graphRender.getTargetByEdge(t)}},{key:"expandNode",value:function(t){var e=this.findById(t);e&&this.graphRender.expandNode(e)}},{key:"collapseNode",value:function(t){var e=this.findById(t);e&&this.graphRender.collapseNode(e)}},{key:"showItem",value:function(t,e){this.graphRender.showItem(t,e)}},{key:"hideItem",value:function(t,e){this.graphRender.hideItem(t,e)}},{key:"show",value:function(t){this.graphRender.show(t)}},{key:"hide",value:function(t){this.graphRender.hide(t)}},{key:"changeVisibility",value:function(t,e){this.graphRender.changeVisibility(t,e)}},{key:"isVisible",value:function(t){return this.graphRender.isVisible(t)}},{key:"getModel",value:function(t){return this.graphRender.getModel(t)}},{key:"addItem",value:function(t,e){return this.graphRender.addItem(t,e)}},{key:"removeItem",value:function(t){return this.graphRender.removeItem(t)}},{key:"updateItem",value:function(t,e){return this.graphRender.updateItem(t,e)}},{key:"refreshItem",value:function(t){return this.graphRender.refreshItem(t)}},{key:"refreshPositions",value:function(){return this.graphRender.refreshPositions()}},{key:"on",value:function(t,e){this.graphRender.on(t,e)}},{key:"off",value:function(t,e){this.graphRender.off(t,e)}},{key:"toDataURL",value:function(t,e){this.graphRender.toDataURL(t,e)}},{key:"nodeLabelOpenEllipsis",value:function(t,e){var r=this;return e?t?e.map(function(e){var n=e.labelCfg&&e.labelCfg.fontSize||r.defaultNode&&r.defaultNode.labelCfg&&r.defaultNode.labelCfg.fontSize||14;return e.label=function(t,e,r){var n=1*r;e*=1.6;if(function(t){for(var e=0,r=0;r0&&t.charCodeAt(r)<128?e++:e+=2;return e}(t)*n>e){var i=Math.floor((e-20)/n),o=t.substring(0,i);return(t.substring(i).length+"…".length)*n>e?o+"\n"+t.substring(i,i+i-2)+"…":0==t.substring(i).length?o:o+"\n"+t.substring(i)}return t}(e.label,t,n),e}):e:[]}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t&&t.clear()}},{key:"destroy",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t&&t.destroy()}}])&&JN(t.prototype,e),r&&JN(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function tj(t){"@babel/helpers - typeof";return(tj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ej(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function rj(){rj=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new O(n||[]);return i(a,"_invoke",{value:C(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",g={};function v(){}function m(){}function b(){}var A={};l(A,a,function(){return this});var x=Object.getPrototypeOf,w=x&&x(x(M([])));w&&w!==r&&n.call(w,a)&&(A=w);var _=b.prototype=v.prototype=Object.create(A);function S(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function E(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==tj(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function C(e,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function nj(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function ij(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);rh.length?i:h}if(!i.length){var p=[[0,0],[this.map.transform.width-1,this.map.transform.height-1]];this.queryRenderedFeatures(p,{layerCapture:!1},function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];i=t})}return i}},{key:"setSelectedDatas",value:function(t){this.selectedDatas=t instanceof Array?t:[t]}},{key:"_formatListenType",value:function(t){switch(t){case"mouseover":return"mouseenter";case"mouseleave":return"mouseout";default:return t}}},{key:"_transformFilterValues",value:function(t){for(var e=t.fields,r=t.values,n=t.selectedDatas,i=arguments.length,o=new Array(i>1?i-1:0),a=1;at[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]=0},t.prototype.getAdjustRange=function(t,e,r){var n,i,o=this.yField,a=r.indexOf(e),s=r.length;return!o&&this.isAdjust("y")?(n=0,i=1):s>1?(n=r[0===a?0:a-1],i=r[a===s-1?s-1:a+1],0!==a?n+=(e-n)/2:n-=(i-e)/2,a!==s-1?i-=(i-e)/2:i+=(e-r[s-2])/2):(n=0===e?0:e-.5,i=0===e?1:e+.5),{pre:n,next:i}},t.prototype.adjustData=function(t,e){var r=this,n=this.getDimValues(e);Ux.each(t,function(t,e){Ux.each(n,function(n,i){r.adjustDim(i,n,t,e)})})},t.prototype.groupData=function(t,e){return Ux.each(t,function(t){void 0===t[e]&&(t[e]=0)}),Ux.groupBy(t,e)},t.prototype.adjustDim=function(t,e,r,n){},t.prototype.getDimValues=function(t){var e=this.xField,r=this.yField,n=Ux.assign({},this.dimValuesMap),i=[];if(e&&this.isAdjust("x")&&i.push(e),r&&this.isAdjust("y")&&i.push(r),i.forEach(function(e){n&&n[e]||(n[e]=Ux.valuesOfKey(t,e).sort(function(t,e){return t-e}))}),!r&&this.isAdjust("y")){n.y=[0,1]}return n},t}(),Zj={},$j=function(t){return Zj[t.toLowerCase()]},tR=function(t,e){if($j(t))throw new Error("Adjust type '"+t+"' existed.");Zj[t.toLowerCase()]=e};var eR=function(t,e){return(eR=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function rR(t,e){function r(){this.constructor=t}eR(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var nR=function(){return(nR=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=0)n=u+this.getIntervalOnlyOffset(r,e);else if(!Ux.isNil(s)&&Ux.isNil(a)&&s>=0){n=u+this.getDodgeOnlyOffset(r,e)}else if(!Ux.isNil(a)&&!Ux.isNil(s)&&a>=0&&s>=0){n=u+this.getIntervalAndDodgeOffset(r,e)}else{var f=c*i/r,h=o*f;n=(u+l)/2+(.5*(c-r*f-(r-1)*h)+((e+1)*f+e*h)-.5*f-.5*c)}return n},e.prototype.getIntervalOnlyOffset=function(t,e){var r=this,n=r.defaultSize,i=r.intervalPadding,o=r.xDimensionLegenth,a=r.groupNum,s=r.dodgeRatio,u=r.maxColumnWidth,l=r.minColumnWidth,c=r.columnWidthRatio,f=i/o,h=(1-(a-1)*f)/a*s/(t-1),p=((1-f*(a-1))/a-h*(t-1))/t;if(p=Ux.isNil(c)?p:1/a/t*c,!Ux.isNil(u)){var d=u/o;p=Math.min(p,d)}if(!Ux.isNil(l)){var y=l/o;p=Math.max(p,y)}return((.5+e)*(p=n?n/o:p)+e*(h=((1-(a-1)*f)/a-t*p)/(t-1))+.5*f)*a-f/2},e.prototype.getDodgeOnlyOffset=function(t,e){var r=this,n=r.defaultSize,i=r.dodgePadding,o=r.xDimensionLegenth,a=r.groupNum,s=r.marginRatio,u=r.maxColumnWidth,l=r.minColumnWidth,c=r.columnWidthRatio,f=i/o,h=1*s/(a-1),p=((1-h*(a-1))/a-f*(t-1))/t;if(p=c?1/a/t*c:p,!Ux.isNil(u)){var d=u/o;p=Math.min(p,d)}if(!Ux.isNil(l)){var y=l/o;p=Math.max(p,y)}return((.5+e)*(p=n?n/o:p)+e*f+.5*(h=(1-(p*t+f*(t-1))*a)/(a-1)))*a-h/2},e.prototype.getIntervalAndDodgeOffset=function(t,e){var r=this.intervalPadding,n=this.dodgePadding,i=this.xDimensionLegenth,o=this.groupNum,a=r/i,s=n/i;return((.5+e)*(((1-a*(o-1))/o-s*(t-1))/t)+e*s+.5*a)*o-a/2},e.prototype.getDistribution=function(t){var e=this.adjustDataArray,r=this.cacheMap,n=r[t];return n||(n={},Ux.each(e,function(e,r){var i=Ux.valuesOfKey(e,t);i.length||i.push(0),Ux.each(i,function(t){n[t]||(n[t]=[]),n[t].push(r)})}),r[t]=n),n},e}(Jj);var oR=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rR(e,t),e.prototype.process=function(t){var e=Ux.clone(t),r=Ux.flatten(e);return this.adjustData(e,r),e},e.prototype.adjustDim=function(t,e,r){var n=this,i=this.groupData(r,t);return Ux.each(i,function(r,i){return n.adjustGroup(r,t,parseFloat(i),e)})},e.prototype.getAdjustOffset=function(t){var e,r=t.pre,n=t.next,i=.05*(n-r);return(n-i-(e=r+i))*Math.random()+e},e.prototype.adjustGroup=function(t,e,r,n){var i=this,o=this.getAdjustRange(e,r,n);return Ux.each(t,function(t){t[e]=i.getAdjustOffset(o)}),t},e}(Jj),aR=Ux.Cache,sR=function(t){function e(e){var r=t.call(this,e)||this,n=e.adjustNames,i=void 0===n?["y"]:n,o=e.height,a=void 0===o?NaN:o,s=e.size,u=void 0===s?10:s,l=e.reverseOrder,c=void 0!==l&&l;return r.adjustNames=i,r.height=a,r.size=u,r.reverseOrder=c,r}return rR(e,t),e.prototype.process=function(t){var e=this.yField,r=this.reverseOrder,n=e?this.processStack(t):this.processOneDimStack(t);return r?this.reverse(n):n},e.prototype.reverse=function(t){return t.slice(0).reverse()},e.prototype.processStack=function(t){var e=this.xField,r=this.yField,n=this.reverseOrder?this.reverse(t):t,i=new aR,o=new aR;return n.map(function(t){return t.map(function(t){var n,a=Ux.get(t,e,0),s=Ux.get(t,[r]),u=a.toString();if(s=Ux.isArray(s)?s[1]:s,!Ux.isNil(s)){var l=s>=0?i:o;l.has(u)||l.set(u,0);var c=l.get(u),f=s+c;return l.set(u,f),nR(nR({},t),((n={})[r]=[c,f],n))}return t})})},e.prototype.processOneDimStack=function(t){var e=this,r=this.xField,n=this.height,i=this.reverseOrder?this.reverse(t):t,o=new aR;return i.map(function(t){return t.map(function(t){var i,a=e.size,s=t[r],u=2*a/n;o.has(s)||o.set(s,u/2);var l=o.get(s);return o.set(s,l+u),nR(nR({},t),((i={}).y=l,i))})})},e}(Jj),uR=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rR(e,t),e.prototype.process=function(t){var e=Ux.flatten(t),r=this.xField,n=this.yField,i=this.getXValuesMaxMap(e),o=Math.max.apply(Math,Object.keys(i).map(function(t){return i[t]}));return Ux.map(t,function(t){return Ux.map(t,function(t){var e,a,s=t[n],u=t[r];if(Ux.isArray(s)){var l=(o-i[u])/2;return nR(nR({},t),((e={})[n]=Ux.map(s,function(t){return l+t}),e))}var c=(o-s)/2;return nR(nR({},t),((a={})[n]=[c,s+c],a))})})},e.prototype.getXValuesMaxMap=function(t){var e=this,r=this.xField,n=this.yField,i=Ux.groupBy(t,function(t){return t[r]});return Ux.mapValues(i,function(t){return e.getDimMaxValue(t,n)})},e.prototype.getDimMaxValue=function(t,e){var r=Ux.map(t,function(t){return Ux.get(t,e,[])}),n=Ux.flatten(r);return Math.max.apply(Math,n)},e}(Jj);tR("Dodge",iR),tR("Jitter",oR),tR("Stack",sR),tR("Symmetric",uR);var lR=function(t,e){return(0,Ux.isString)(e)?e:t.invert(t.scale(e))},cR=function(){function t(t){this.names=[],this.scales=[],this.linear=!1,this.values=[],this.callback=function(){return[]},this._parseCfg(t)}return t.prototype.mapping=function(){for(var t=this,e=[],r=0;r1?1:Number(e),n=t.length-1,i=Math.floor(n*r),o=n*r-i,a=t[i],s=i===n?a:t[i+1];return gR([yR(a,s,o,0),yR(a,s,o,1),yR(a,s,o,2)])}(r,t)}},toRGB:(0,Ux.memoize)(AR),toCSSGradient:function(t){if(/^[r,R,L,l]{1}[\s]*\(/.test(t)){var e,r=void 0;if("l"===t[0]){var n=+(i=hR.exec(t))[1]+90;r=i[2],e="linear-gradient("+n+"deg, "}else if("r"===t[0]){var i;e="radial-gradient(",r=(i=pR.exec(t))[4]}var o=r.match(dR);return(0,Ux.each)(o,function(t,r){var n=t.split(":");e+=n[1]+" "+100*n[0]+"%",r!==o.length-1&&(e+=", ")}),e+=")"}return t}},wR=function(t){function e(e){var r=t.call(this,e)||this;return r.type="color",r.names=["color"],(0,Ux.isString)(r.values)&&(r.linear=!0),r.gradient=xR.gradient(r.values),r}return(0,Gx.__extends)(e,t),e.prototype.getLinearValue=function(t){return this.gradient(t)},e}(cR),_R=function(t){function e(e){var r=t.call(this,e)||this;return r.type="opacity",r.names=["opacity"],r}return(0,Gx.__extends)(e,t),e}(cR),SR=function(t){function e(e){var r=t.call(this,e)||this;return r.names=["x","y"],r.type="position",r}return(0,Gx.__extends)(e,t),e.prototype.mapping=function(t,e){var r=this.scales,n=r[0],i=r[1];return(0,Ux.isNil)(t)||(0,Ux.isNil)(e)?[]:[(0,Ux.isArray)(t)?t.map(function(t){return n.scale(t)}):n.scale(t),(0,Ux.isArray)(e)?e.map(function(t){return i.scale(t)}):i.scale(e)]},e}(cR),ER=function(t){function e(e){var r=t.call(this,e)||this;return r.type="shape",r.names=["shape"],r}return(0,Gx.__extends)(e,t),e.prototype.getLinearValue=function(t){var e=Math.round((this.values.length-1)*t);return this.values[e]},e}(cR),CR=function(t){function e(e){var r=t.call(this,e)||this;return r.type="size",r.names=["size"],r}return(0,Gx.__extends)(e,t),e}(cR),kR={},IR=function(t){return kR[t.toLowerCase()]},TR=function(t,e){if(IR(t))throw new Error("Attribute type '".concat(t,"' existed."));kR[t.toLowerCase()]=e};TR("Color",wR),TR("Opacity",_R),TR("Position",SR),TR("Shape",ER),TR("Size",CR);var OR=function(){function t(t){this.type="coordinate",this.isRect=!1,this.isHelix=!1,this.isPolar=!1,this.isReflectX=!1,this.isReflectY=!1;var e=t.start,r=t.end,n=t.matrix,i=void 0===n?[1,0,0,0,1,0,0,0,1]:n,o=t.isTransposed,a=void 0!==o&&o;this.start=e,this.end=r,this.matrix=i,this.originalMatrix=(0,Gx.__spreadArray)([],i),this.isTransposed=a}return t.prototype.initial=function(){this.center={x:(this.start.x+this.end.x)/2,y:(this.start.y+this.end.y)/2},this.width=Math.abs(this.end.x-this.start.x),this.height=Math.abs(this.end.y-this.start.y)},t.prototype.update=function(t){(0,Ux.assign)(this,t),this.initial()},t.prototype.convertDim=function(t,e){var r,n=this[e],i=n.start,o=n.end;return this.isReflect(e)&&(i=(r=[o,i])[0],o=r[1]),i+t*(o-i)},t.prototype.invertDim=function(t,e){var r,n=this[e],i=n.start,o=n.end;return this.isReflect(e)&&(i=(r=[o,i])[0],o=r[1]),(t-i)/(o-i)},t.prototype.applyMatrix=function(t,e,r){void 0===r&&(r=0);var n=this.matrix,i=[t,e,r];return d_.transformMat3(i,i,n),i},t.prototype.invertMatrix=function(t,e,r){void 0===r&&(r=0);var n=this.matrix,i=y_.invert([0,0,0,0,0,0,0,0,0],n),o=[t,e,r];return i&&d_.transformMat3(o,o,i),o},t.prototype.convert=function(t){var e=this.convertPoint(t),r=e.x,n=e.y,i=this.applyMatrix(r,n,1);return{x:i[0],y:i[1]}},t.prototype.invert=function(t){var e=this.invertMatrix(t.x,t.y,1);return this.invertPoint({x:e[0],y:e[1]})},t.prototype.rotate=function(t){var e=this.matrix,r=this.center;return Wx.IW(e,e,[-r.x,-r.y]),Wx.XA(e,e,t),Wx.IW(e,e,[r.x,r.y]),this},t.prototype.reflect=function(t){return"x"===t?this.isReflectX=!this.isReflectX:this.isReflectY=!this.isReflectY,this},t.prototype.scale=function(t,e){var r=this.matrix,n=this.center;return Wx.IW(r,r,[-n.x,-n.y]),Wx.g(r,r,[t,e]),Wx.IW(r,r,[n.x,n.y]),this},t.prototype.translate=function(t,e){var r=this.matrix;return Wx.IW(r,r,[t,e]),this},t.prototype.transpose=function(){return this.isTransposed=!this.isTransposed,this},t.prototype.getCenter=function(){return this.center},t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.getRadius=function(){return this.radius},t.prototype.isReflect=function(t){return"x"===t?this.isReflectX:this.isReflectY},t.prototype.resetMatrix=function(t){this.matrix=t||(0,Gx.__spreadArray)([],this.originalMatrix)},t}(),MR=function(t){function e(e){var r=t.call(this,e)||this;return r.isRect=!0,r.type="cartesian",r.initial(),r}return(0,Gx.__extends)(e,t),e.prototype.initial=function(){t.prototype.initial.call(this);var e=this.start,r=this.end;this.x={start:e.x,end:r.x},this.y={start:e.y,end:r.y}},e.prototype.convertPoint=function(t){var e,r=t.x,n=t.y;return this.isTransposed&&(r=(e=[n,r])[0],n=e[1]),{x:this.convertDim(r,"x"),y:this.convertDim(n,"y")}},e.prototype.invertPoint=function(t){var e,r=this.invertDim(t.x,"x"),n=this.invertDim(t.y,"y");return this.isTransposed&&(r=(e=[n,r])[0],n=e[1]),{x:r,y:n}},e}(OR),PR=function(t){function e(e){var r=t.call(this,e)||this;r.isHelix=!0,r.type="helix";var n=e.startAngle,i=void 0===n?1.25*Math.PI:n,o=e.endAngle,a=void 0===o?7.25*Math.PI:o,s=e.innerRadius,u=void 0===s?0:s,l=e.radius;return r.startAngle=i,r.endAngle=a,r.innerRadius=u,r.radius=l,r.initial(),r}return(0,Gx.__extends)(e,t),e.prototype.initial=function(){t.prototype.initial.call(this);var e=(this.endAngle-this.startAngle)/(2*Math.PI)+1,r=Math.min(this.width,this.height)/2;this.radius&&this.radius>=0&&this.radius<=1&&(r*=this.radius),this.d=Math.floor(r*(1-this.innerRadius)/e),this.a=this.d/(2*Math.PI),this.x={start:this.startAngle,end:this.endAngle},this.y={start:this.innerRadius*r,end:this.innerRadius*r+.99*this.d}},e.prototype.convertPoint=function(t){var e,r=t.x,n=t.y;this.isTransposed&&(r=(e=[n,r])[0],n=e[1]);var i=this.convertDim(r,"x"),o=this.a*i,a=this.convertDim(n,"y");return{x:this.center.x+Math.cos(i)*(o+a),y:this.center.y+Math.sin(i)*(o+a)}},e.prototype.invertPoint=function(t){var e,r=this.d+this.y.start,n=g_.subtract([0,0],[t.x,t.y],[this.center.x,this.center.y]),i=Wx.LL(n,[1,0],!0),o=i*this.a;g_.length(n)this.width/n?(e=this.width/n,this.circleCenter={x:this.center.x-(.5-o)*this.width,y:this.center.y-(.5-a)*e*i}):(e=this.height/i,this.circleCenter={x:this.center.x-(.5-o)*e*n,y:this.center.y-(.5-a)*this.height}),this.polarRadius=this.radius,this.radius?this.radius>0&&this.radius<=1?this.polarRadius=e*this.radius:(this.radius<=0||this.radius>e)&&(this.polarRadius=e):this.polarRadius=e,this.x={start:this.startAngle,end:this.endAngle},this.y={start:this.innerRadius*this.polarRadius,end:this.polarRadius}},e.prototype.getRadius=function(){return this.polarRadius},e.prototype.convertPoint=function(t){var e,r=this.getCenter(),n=t.x,i=t.y;return this.isTransposed&&(n=(e=[i,n])[0],i=e[1]),n=this.convertDim(n,"x"),i=this.convertDim(i,"y"),{x:r.x+Math.cos(n)*i,y:r.y+Math.sin(n)*i}},e.prototype.invertPoint=function(t){var e,r=this.getCenter(),n=[t.x-r.x,t.y-r.y],i=this.startAngle,o=this.endAngle;this.isReflect("x")&&(i=(e=[o,i])[0],o=e[1]);var a=[1,0,0,0,1,0,0,0,1];Wx.XA(a,a,i);var s=[1,0,0];d_.transformMat3(s,s,a);var u=[s[0],s[1]],l=Wx.LL(u,n,o0?f:-f;var h=this.invertDim(c,"y"),p={x:0,y:0};return p.x=this.isTransposed?h:f,p.y=this.isTransposed?f:h,p},e.prototype.getCenter=function(){return this.circleCenter},e.prototype.getOneBox=function(){var t=this.startAngle,e=this.endAngle;if(Math.abs(e-t)>=2*Math.PI)return{minX:-1,maxX:1,minY:-1,maxY:1};for(var r=[0,Math.cos(t),Math.cos(e)],n=[0,Math.sin(t),Math.sin(e)],i=Math.min(t,e);i=0;r--)t.removeChild(e[r])}function QR(t){var e=t.start,r=t.end,n=Math.min(e.x,r.x),i=Math.min(e.y,r.y),o=Math.max(e.x,r.x),a=Math.max(e.y,r.y);return{x:n,y:i,minX:n,minY:i,maxX:o,maxY:a,width:o-n,height:a-i}}function YR(t,e,r,n){var i=t+r,o=e+n;return{x:t,y:e,width:r,height:n,minX:t,minY:e,maxX:isNaN(i)?0:i,maxY:isNaN(o)?0:o}}function WR(t,e,r){return(1-r)*t+e*r}function qR(t,e,r){return{x:t.x+Math.cos(r)*e,y:t.y+Math.sin(r)*e}}var XR=function(t,e,r){return void 0===r&&(r=Math.pow(Number.EPSILON,.5)),[t,e].includes(1/0)?Math.abs(t)===Math.abs(e):Math.abs(t-e)0?(0,Ux.each)(h,function(t){if(t.get("visible")){if(t.isGroup()&&0===t.get("children").length)return!0;var e=KR(t),r=t.applyToMatrix([e.minX,e.minY,1]),n=t.applyToMatrix([e.minX,e.maxY,1]),i=t.applyToMatrix([e.maxX,e.minY,1]),o=t.applyToMatrix([e.maxX,e.maxY,1]),a=Math.min(r[0],n[0],i[0],o[0]),s=Math.max(r[0],n[0],i[0],o[0]),h=Math.min(r[1],n[1],i[1],o[1]),p=Math.max(r[1],n[1],i[1],o[1]);al&&(l=s),hf&&(f=p)}}):(u=0,l=0,c=0,f=0),e=YR(u,c,l-u,f-c)}else e=t.getBBox();return s?(r=e,n=s,i=Math.max(r.minX,n.minX),o=Math.max(r.minY,n.minY),YR(i,o,Math.min(r.maxX,n.maxX)-i,Math.min(r.maxY,n.maxY)-o)):e}function JR(t){return t+"px"}function ZR(t,e,r,n){var i,o,a,s,u=n/(i=t,a=(o=e).x-i.x,s=o.y-i.y,Math.sqrt(a*a+s*s)),l=0;return"start"===r?l=0-u:"end"===r&&(l=1+u),{x:WR(t.x,e.x,l),y:WR(t.y,e.y,l)}}var $R={none:[],point:["x","y"],region:["start","end"],points:["points"],circle:["center","radius","startAngle","endAngle"]},tD=function(t){function e(e){var r=t.call(this,e)||this;return r.initCfg(),r}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){return{id:"",name:"",type:"",locationType:"none",offsetX:0,offsetY:0,animate:!1,capture:!0,updateAutoRender:!1,animateOption:{appear:null,update:{duration:400,easing:"easeQuadInOut"},enter:{duration:400,easing:"easeQuadInOut"},leave:{duration:350,easing:"easeQuadIn"}},events:null,defaultCfg:{},visible:!0}},e.prototype.clear=function(){},e.prototype.update=function(t){var e=this,r=this.get("defaultCfg")||{};(0,Ux.each)(t,function(t,n){var i=t;e.get(n)!==t&&((0,Ux.isObject)(t)&&r[n]&&(i=(0,Ux.deepMix)({},r[n],t)),e.set(n,i))}),this.updateInner(t),this.afterUpdate(t)},e.prototype.updateInner=function(t){},e.prototype.afterUpdate=function(t){(0,Ux.hasKey)(t,"visible")&&(t.visible?this.show():this.hide()),(0,Ux.hasKey)(t,"capture")&&this.setCapture(t.capture)},e.prototype.getLayoutBBox=function(){return this.getBBox()},e.prototype.getLocationType=function(){return this.get("locationType")},e.prototype.getOffset=function(){return{offsetX:this.get("offsetX"),offsetY:this.get("offsetY")}},e.prototype.setOffset=function(t,e){this.update({offsetX:t,offsetY:e})},e.prototype.setLocation=function(t){var e=(0,Gx.__assign)({},t);this.update(e)},e.prototype.getLocation=function(){var t=this,e={},r=this.get("locationType"),n=$R[r];return(0,Ux.each)(n,function(r){e[r]=t.get(r)}),e},e.prototype.isList=function(){return!1},e.prototype.isSlider=function(){return!1},e.prototype.init=function(){},e.prototype.initCfg=function(){var t=this,e=this.get("defaultCfg");(0,Ux.each)(e,function(e,r){var n=t.get(r);if((0,Ux.isObject)(n)){var i=(0,Ux.deepMix)({},e,n);t.set(r,i)}})},e}(kS.Base),eD=["visible","tip","delegateObject"],rD=["container","group","shapesMap","isRegister","isUpdating","destroyed"],nD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{container:null,shapesMap:{},group:null,capture:!0,isRegister:!1,isUpdating:!1,isInit:!0})},e.prototype.remove=function(){this.clear(),this.get("group").remove()},e.prototype.clear=function(){this.get("group").clear(),this.set("shapesMap",{}),this.clearOffScreenCache(),this.set("isInit",!0)},e.prototype.getChildComponentById=function(t){var e=this.getElementById(t);return e&&e.get("component")},e.prototype.getElementById=function(t){return this.get("shapesMap")[t]},e.prototype.getElementByLocalId=function(t){var e=this.getElementId(t);return this.getElementById(e)},e.prototype.getElementsByName=function(t){var e=[];return(0,Ux.each)(this.get("shapesMap"),function(r){r.get("name")===t&&e.push(r)}),e},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateInner=function(t){this.offScreenRender(),this.get("updateAutoRender")&&this.render()},e.prototype.render=function(){var t=this.get("offScreenGroup");t||(t=this.offScreenRender());var e=this.get("group");this.updateElements(t,e),this.deleteElements(),this.applyOffset(),this.get("eventInitted")||(this.initEvent(),this.set("eventInitted",!0)),this.set("isInit",!1)},e.prototype.show=function(){this.get("group").show(),this.set("visible",!0)},e.prototype.hide=function(){this.get("group").hide(),this.set("visible",!1)},e.prototype.setCapture=function(t){this.get("group").set("capture",t),this.set("capture",t)},e.prototype.destroy=function(){this.removeEvent(),this.remove(),t.prototype.destroy.call(this)},e.prototype.getBBox=function(){return this.get("group").getCanvasBBox()},e.prototype.getLayoutBBox=function(){var t=this.get("group"),e=this.getInnerLayoutBBox(),r=t.getTotalMatrix();return r&&(e=function(t,e){var r=zR(t,[e.minX,e.minY]),n=zR(t,[e.maxX,e.minY]),i=zR(t,[e.minX,e.maxY]),o=zR(t,[e.maxX,e.maxY]),a=Math.min(r[0],n[0],i[0],o[0]),s=Math.max(r[0],n[0],i[0],o[0]),u=Math.min(r[1],n[1],i[1],o[1]),l=Math.max(r[1],n[1],i[1],o[1]);return{x:a,y:u,minX:a,minY:u,maxX:s,maxY:l,width:s-a,height:l-u}}(r,e)),e},e.prototype.on=function(t,e,r){return this.get("group").on(t,e,r),this},e.prototype.off=function(t,e){var r=this.get("group");return r&&r.off(t,e),this},e.prototype.emit=function(t,e){this.get("group").emit(t,e)},e.prototype.init=function(){t.prototype.init.call(this),this.get("group")||this.initGroup(),this.offScreenRender()},e.prototype.getInnerLayoutBBox=function(){return this.get("offScreenBBox")||this.get("group").getBBox()},e.prototype.delegateEmit=function(t,e){var r=this.get("group");e.target=r,r.emit(t,e),RR(r,t,e)},e.prototype.createOffScreenGroup=function(){return new(this.get("group").getGroupBase())({delegateObject:this.getDelegateObject()})},e.prototype.applyOffset=function(){var t=this.get("offsetX"),e=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t,y:e})},e.prototype.initGroup=function(){var t=this.get("container");this.set("group",t.addGroup({id:this.get("id"),name:this.get("name"),capture:this.get("capture"),visible:this.get("visible"),isComponent:!0,component:this,delegateObject:this.getDelegateObject()}))},e.prototype.offScreenRender=function(){this.clearOffScreenCache();var t=this.createOffScreenGroup();return this.renderInner(t),this.set("offScreenGroup",t),this.set("offScreenBBox",KR(t)),t},e.prototype.addGroup=function(t,e){this.appendDelegateObject(t,e);var r=t.addGroup(e);return this.get("isRegister")&&this.registerElement(r),r},e.prototype.addShape=function(t,e){this.appendDelegateObject(t,e);var r=t.addShape(e);return this.get("isRegister")&&this.registerElement(r),r},e.prototype.addComponent=function(t,e){var r=e.id,n=e.component,i=(0,Gx.__rest)(e,["id","component"]),o=new n((0,Gx.__assign)((0,Gx.__assign)({},i),{id:r,container:t,updateAutoRender:this.get("updateAutoRender")}));return o.init(),o.render(),this.get("isRegister")&&this.registerElement(o.get("group")),o},e.prototype.initEvent=function(){},e.prototype.removeEvent=function(){this.get("group").off()},e.prototype.getElementId=function(t){return this.get("id")+"-"+this.get("name")+"-"+t},e.prototype.registerElement=function(t){var e=t.get("id");this.get("shapesMap")[e]=t},e.prototype.unregisterElement=function(t){var e=t.get("id");delete this.get("shapesMap")[e]},e.prototype.moveElementTo=function(t,e){var r=FR(e);t.attr("matrix",r)},e.prototype.addAnimation=function(t,e,r){var n=e.attr("opacity");(0,Ux.isNil)(n)&&(n=1),e.attr("opacity",0),e.animate({opacity:n},r)},e.prototype.removeAnimation=function(t,e,r){e.animate({opacity:0},r)},e.prototype.updateAnimation=function(t,e,r,n){e.animate(r,n)},e.prototype.updateElements=function(t,e){var r,n=this,i=this.get("animate"),o=this.get("animateOption"),a=t.getChildren().slice(0);(0,Ux.each)(a,function(t){var a=t.get("id"),s=n.getElementById(a),u=t.get("name");if(s)if(t.get("isComponent")){var l=t.get("component"),c=s.get("component"),f=(0,Ux.pick)(l.cfg,(0,Ux.difference)((0,Ux.keys)(l.cfg),rD));c.update(f),s.set("update_status","update")}else{var h=n.getReplaceAttrs(s,t);i&&o.update?n.updateAnimation(u,s,h,o.update):s.attr(h),t.isGroup()&&n.updateElements(t,s),(0,Ux.each)(eD,function(e){s.set(e,t.get(e))}),function(t,e){if(t.getClip()||e.getClip()){var r=e.getClip();if(r){var n={type:r.get("type"),attrs:r.attr()};t.setClip(n)}else t.setClip(null)}}(s,t),r=s,s.set("update_status","update")}else{e.add(t);var p=e.getChildren();if(p.splice(p.length-1,1),r){var d=p.indexOf(r);p.splice(d+1,0,t)}else p.unshift(t);if(n.registerElement(t),t.set("update_status","add"),t.get("isComponent"))(l=t.get("component")).set("container",e);else t.isGroup()&&n.registerNewGroup(t);if(r=t,i){var y=n.get("isInit")?o.appear:o.enter;y&&n.addAnimation(u,t,y)}}})},e.prototype.clearUpdateStatus=function(t){var e=t.getChildren();(0,Ux.each)(e,function(t){t.set("update_status",null)})},e.prototype.clearOffScreenCache=function(){var t=this.get("offScreenGroup");t&&t.destroy(),this.set("offScreenGroup",null),this.set("offScreenBBox",null)},e.prototype.getDelegateObject=function(){var t;return(t={})[this.get("name")]=this,t.component=this,t},e.prototype.appendDelegateObject=function(t,e){var r=t.get("delegateObject");e.delegateObject||(e.delegateObject={}),(0,Ux.mix)(e.delegateObject,r)},e.prototype.getReplaceAttrs=function(t,e){var r=t.attr(),n=e.attr();return(0,Ux.each)(r,function(t,e){void 0===n[e]&&(n[e]=void 0)}),n},e.prototype.registerNewGroup=function(t){var e=this,r=t.getChildren();(0,Ux.each)(r,function(t){e.registerElement(t),t.set("update_status","add"),t.isGroup()&&e.registerNewGroup(t)})},e.prototype.deleteElements=function(){var t=this,e=this.get("shapesMap"),r=[];(0,Ux.each)(e,function(t,e){!t.get("update_status")||t.destroyed?r.push([e,t]):t.set("update_status",null)});var n=this.get("animate"),i=this.get("animateOption");(0,Ux.each)(r,function(r){var o=r[0],a=r[1];if(!a.destroyed){var s=a.get("name");if(n&&i.leave){var u=(0,Ux.mix)({callback:function(){t.removeElement(a)}},i.leave);t.removeAnimation(s,a,u)}else t.removeElement(a)}delete e[o]})},e.prototype.removeElement=function(t){if(t.get("isGroup")){var e=t.get("component");e&&e.destroy()}t.remove()},e}(tD),iD="…";function oD(t,e){return t.charCodeAt(e)>0&&t.charCodeAt(e)<128?1:2}var aD="…",sD=2,uD=400;function lD(t){if(t.length>uD)return function(t){for(var e=t.map(function(t){var e=t.attr("text");return(0,Ux.isNil)(e)?"":""+e}),r=0,n=0,i=0;i=19968&&s<=40869?2:1}o>r&&(r=o,n=i)}return t[n].getBBox().width}(t);var e=0;return(0,Ux.each)(t,function(t){var r=t.getBBox().width;e=0?function(t,e,r){void 0===r&&(r="tail");var n=t.length,i="";if("tail"===r){for(var o=0,a=0;o1||n<0)&&(n=1),{x:WR(t.x,e.x,n),y:WR(t.y,e.y,n)}},e.prototype.renderLabel=function(t){var e=this.get("text"),r=this.get("start"),n=this.get("end"),i=e.position,o=e.content,a=e.style,s=e.offsetX,u=e.offsetY,l=e.autoRotate,c=e.maxLength,f=e.autoEllipsis,h=e.ellipsisPosition,p=e.background,d=e.isVertical,y=void 0!==d&&d,g=this.getLabelPoint(r,n,i),v=g.x+s,m=g.y+u,b={id:this.getElementId("line-text"),name:"annotation-line-text",x:v,y:m,content:o,style:a,maxLength:c,autoEllipsis:f,ellipsisPosition:h,background:p,isVertical:y};if(l){var A=[n.x-r.x,n.y-r.y];b.rotate=Math.atan2(A[1],A[0])}fD(t,b)},e}(nD),dD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{name:"annotation",type:"text",locationType:"point",x:0,y:0,content:"",rotate:null,style:{},background:null,maxLength:null,autoEllipsis:!0,isVertical:!1,ellipsisPosition:"tail",defaultCfg:{style:{fill:hD.textColor,fontSize:12,textAlign:"center",textBaseline:"middle",fontFamily:hD.fontFamily}}})},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},e.prototype.renderInner=function(t){var e=this.getLocation(),r=e.x,n=e.y,i=this.get("content"),o=this.get("style");fD(t,{id:this.getElementId("text"),name:this.get("name")+"-text",x:r,y:n,content:i,style:o,maxLength:this.get("maxLength"),autoEllipsis:this.get("autoEllipsis"),isVertical:this.get("isVertical"),ellipsisPosition:this.get("ellipsisPosition"),background:this.get("background"),rotate:this.get("rotate")})},e.prototype.resetLocation=function(){var t=this.getElementByLocalId("text-group");if(t){var e=this.getLocation(),r=e.x,n=e.y,i=this.get("rotate");UR(t,r,n),GR(t,i,r,n)}},e}(nD),yD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{name:"annotation",type:"arc",locationType:"circle",center:null,radius:100,startAngle:-Math.PI/2,endAngle:3*Math.PI/2,style:{stroke:"#999",lineWidth:1}})},e.prototype.renderInner=function(t){this.renderArc(t)},e.prototype.getArcPath=function(){var t=this.getLocation(),e=t.center,r=t.radius,n=t.startAngle,i=t.endAngle,o=qR(e,r,n),a=qR(e,r,i),s=i-n>Math.PI?1:0,u=[["M",o.x,o.y]];if(i-n==2*Math.PI){var l=qR(e,r,n+Math.PI);u.push(["A",r,r,0,s,1,l.x,l.y]),u.push(["A",r,r,0,s,1,a.x,a.y])}else u.push(["A",r,r,0,s,1,a.x,a.y]);return u},e.prototype.renderArc=function(t){var e=this.getArcPath(),r=this.get("style");this.addShape(t,{type:"path",id:this.getElementId("arc"),name:"annotation-arc",attrs:(0,Gx.__assign)({path:e},r)})},e}(nD),gD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{name:"annotation",type:"region",locationType:"region",start:null,end:null,style:{},defaultCfg:{style:{lineWidth:0,fill:hD.regionColor,opacity:.4}}})},e.prototype.renderInner=function(t){this.renderRegion(t)},e.prototype.renderRegion=function(t){var e=this.get("start"),r=this.get("end"),n=this.get("style"),i=QR({start:e,end:r});this.addShape(t,{type:"rect",id:this.getElementId("region"),name:"annotation-region",attrs:(0,Gx.__assign)({x:i.x,y:i.y,width:i.width,height:i.height},n)})},e}(nD),vD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{name:"annotation",type:"image",locationType:"region",start:null,end:null,src:null,style:{}})},e.prototype.renderInner=function(t){this.renderImage(t)},e.prototype.getImageAttrs=function(){var t=this.get("start"),e=this.get("end"),r=this.get("style"),n=QR({start:t,end:e}),i=this.get("src");return(0,Gx.__assign)({x:n.x,y:n.y,img:i,width:n.width,height:n.height},r)},e.prototype.renderImage=function(t){this.addShape(t,{type:"image",id:this.getElementId("image"),name:"annotation-image",attrs:this.getImageAttrs()})},e}(nD),mD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{name:"annotation",type:"dataMarker",locationType:"point",x:0,y:0,point:{},line:{},text:{},direction:"upward",autoAdjust:!0,coordinateBBox:null,defaultCfg:{point:{display:!0,style:{r:3,fill:"#FFFFFF",stroke:"#1890FF",lineWidth:2}},line:{display:!0,length:20,style:{stroke:hD.lineColor,lineWidth:1}},text:{content:"",display:!0,style:{fill:hD.textColor,opacity:.65,fontSize:12,textAlign:"start",fontFamily:hD.fontFamily}}}})},e.prototype.renderInner=function(t){(0,Ux.get)(this.get("line"),"display")&&this.renderLine(t),(0,Ux.get)(this.get("text"),"display")&&this.renderText(t),(0,Ux.get)(this.get("point"),"display")&&this.renderPoint(t),this.get("autoAdjust")&&this.autoAdjust(t)},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x")+this.get("offsetX"),y:this.get("y")+this.get("offsetY")})},e.prototype.renderPoint=function(t){var e=this.getShapeAttrs().point;this.addShape(t,{type:"circle",id:this.getElementId("point"),name:"annotation-point",attrs:e})},e.prototype.renderLine=function(t){var e=this.getShapeAttrs().line;this.addShape(t,{type:"path",id:this.getElementId("line"),name:"annotation-line",attrs:e})},e.prototype.renderText=function(t){var e=this.getShapeAttrs().text,r=e.x,n=e.y,i=e.text,o=(0,Gx.__rest)(e,["x","y","text"]),a=this.get("text"),s=a.background,u=a.maxLength,l=a.autoEllipsis,c=a.isVertival,f=a.ellipsisPosition;fD(t,{x:r,y:n,id:this.getElementId("text"),name:"annotation-text",content:i,style:o,background:s,maxLength:u,autoEllipsis:l,isVertival:c,ellipsisPosition:f})},e.prototype.autoAdjust=function(t){var e=this.get("direction"),r=this.get("x"),n=this.get("y"),i=(0,Ux.get)(this.get("line"),"length",0),o=this.get("coordinateBBox"),a=t.getBBox(),s=a.minX,u=a.maxX,l=a.minY,c=a.maxY,f=t.findById(this.getElementId("text-group")),h=t.findById(this.getElementId("text")),p=t.findById(this.getElementId("line"));if(o&&f){var d=f.attr("x"),y=f.attr("y"),g=h.getCanvasBBox(),v=g.width,m=g.height,b=0,A=0;if(r+s<=o.minX)if("leftward"===e)b=1;else{var x=o.minX-(r+s);d=f.attr("x")+x}else if(r+u>=o.maxX)if("rightward"===e)b=-1;else{x=r+u-o.maxX;d=f.attr("x")-x}if(b&&(p&&p.attr("path",[["M",0,0],["L",i*b,0]]),d=(i+2+v)*b),n+l<=o.minY)if("upward"===e)A=1;else{x=o.minY-(n+l);y=f.attr("y")+x}else if(n+c>=o.maxY)if("downward"===e)A=-1;else{x=n+c-o.maxY;y=f.attr("y")-x}A&&(p&&p.attr("path",[["M",0,0],["L",0,i*A]]),y=(i+2+m)*A),d===f.attr("x")&&y===f.attr("y")||UR(f,d,y)}},e.prototype.getShapeAttrs=function(){var t=(0,Ux.get)(this.get("line"),"display"),e=(0,Ux.get)(this.get("point"),"style",{}),r=(0,Ux.get)(this.get("line"),"style",{}),n=(0,Ux.get)(this.get("text"),"style",{}),i=this.get("direction"),o=t?(0,Ux.get)(this.get("line"),"length",0):0,a=0,s=0,u="top",l="start";switch(i){case"upward":s=-1,u="bottom";break;case"downward":s=1,u="top";break;case"leftward":a=-1,l="end";break;case"rightward":a=1,l="start"}return{point:(0,Gx.__assign)({x:0,y:0},e),line:(0,Gx.__assign)({path:[["M",0,0],["L",o*a,o*s]]},r),text:(0,Gx.__assign)({x:(o+2)*a,y:(o+2)*s,text:(0,Ux.get)(this.get("text"),"content",""),textBaseline:u,textAlign:l},n)}},e}(nD),bD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{name:"annotation",type:"dataRegion",locationType:"points",points:[],lineLength:0,region:{},text:{},defaultCfg:{region:{style:{lineWidth:0,fill:hD.regionColor,opacity:.4}},text:{content:"",style:{textAlign:"center",textBaseline:"bottom",fontSize:12,fill:hD.textColor,fontFamily:hD.fontFamily}}}})},e.prototype.renderInner=function(t){var e=(0,Ux.get)(this.get("region"),"style",{}),r=((0,Ux.get)(this.get("text"),"style",{}),this.get("lineLength")||0),n=this.get("points");if(n.length){var i=function(t){var e=t.map(function(t){return t.x}),r=t.map(function(t){return t.y}),n=Math.min.apply(Math,e),i=Math.min.apply(Math,r),o=Math.max.apply(Math,e),a=Math.max.apply(Math,r);return{x:n,y:i,minX:n,minY:i,maxX:o,maxY:a,width:o-n,height:a-i}}(n),o=[];o.push(["M",n[0].x,i.minY-r]),n.forEach(function(t){o.push(["L",t.x,t.y])}),o.push(["L",n[n.length-1].x,n[n.length-1].y-r]),this.addShape(t,{type:"path",id:this.getElementId("region"),name:"annotation-region",attrs:(0,Gx.__assign)({path:o},e)}),fD(t,(0,Gx.__assign)({id:this.getElementId("text"),name:"annotation-text",x:(i.minX+i.maxX)/2,y:i.minY-r},this.get("text")))}},e}(nD),AD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{name:"annotation",type:"regionFilter",locationType:"region",start:null,end:null,color:null,shape:[]})},e.prototype.renderInner=function(t){var e=this,r=this.get("start"),n=this.get("end"),i=this.addGroup(t,{id:this.getElementId("region-filter"),capture:!1});(0,Ux.each)(this.get("shapes"),function(t,r){var n=t.get("type"),o=(0,Ux.clone)(t.attr());e.adjustShapeAttrs(o),e.addShape(i,{id:e.getElementId("shape-"+n+"-"+r),capture:!1,type:n,attrs:o})});var o=QR({start:r,end:n});i.setClip({type:"rect",attrs:{x:o.minX,y:o.minY,width:o.width,height:o.height}})},e.prototype.adjustShapeAttrs=function(t){var e=this.get("color");t.fill&&(t.fill=t.fillStyle=e),t.stroke=t.strokeStyle=e},e}(nD),xD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{name:"annotation",type:"shape",draw:Ux.noop})},e.prototype.renderInner=function(t){var e=this.get("render");(0,Ux.isFunction)(e)&&e(t)},e}(nD);function wD(t,e,r){var n;try{n=window.getComputedStyle?window.getComputedStyle(t,null)[e]:t.style[e]}catch(t){}finally{n=void 0===n?r:n}return n}function _D(t,e){var r=function(t,e){var r=wD(t,"width",e);return"auto"===r&&(r=t.offsetWidth),parseFloat(r)}(t,e),n=parseFloat(wD(t,"borderLeftWidth"))||0,i=parseFloat(wD(t,"paddingLeft"))||0,o=parseFloat(wD(t,"paddingRight"))||0,a=parseFloat(wD(t,"borderRightWidth"))||0,s=parseFloat(wD(t,"marginRight"))||0;return r+n+a+i+o+(parseFloat(wD(t,"marginLeft"))||0)+s}function SD(t,e){var r=function(t,e){var r=wD(t,"height",e);return"auto"===r&&(r=t.offsetHeight),parseFloat(r)}(t,e),n=parseFloat(wD(t,"borderTopWidth"))||0,i=parseFloat(wD(t,"paddingTop"))||0,o=parseFloat(wD(t,"paddingBottom"))||0;return r+n+(parseFloat(wD(t,"borderBottomWidth"))||0)+i+o+(parseFloat(wD(t,"marginTop"))||0)+(parseFloat(wD(t,"marginBottom"))||0)}var ED=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{container:null,containerTpl:"
    ",updateAutoRender:!0,containerClassName:"",parent:null})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.show=function(){this.get("container").style.display="",this.set("visible",!0)},e.prototype.hide=function(){this.get("container").style.display="none",this.set("visible",!1)},e.prototype.setCapture=function(t){var e=this.getContainer(),r=t?"auto":"none";e.style.pointerEvents=r,this.set("capture",t)},e.prototype.getBBox=function(){var t=this.getContainer();return YR(parseFloat(t.style.left)||0,parseFloat(t.style.top)||0,t.clientWidth,t.clientHeight)},e.prototype.clear=function(){VR(this.get("container"))},e.prototype.destroy=function(){this.removeEvent(),this.removeDom(),t.prototype.destroy.call(this)},e.prototype.init=function(){t.prototype.init.call(this),this.initContainer(),this.initDom(),this.resetStyles(),this.applyStyles(),this.initEvent(),this.initCapture(),this.initVisible()},e.prototype.initCapture=function(){this.setCapture(this.get("capture"))},e.prototype.initVisible=function(){this.get("visible")?this.show():this.hide()},e.prototype.initDom=function(){},e.prototype.initContainer=function(){var t=this.get("container");if((0,Ux.isNil)(t)){t=this.createDom();var e=this.get("parent");(0,Ux.isString)(e)&&(e=document.getElementById(e),this.set("parent",e)),e.appendChild(t),this.get("containerId")&&t.setAttribute("id",this.get("containerId")),this.set("container",t)}else(0,Ux.isString)(t)&&(t=document.getElementById(t),this.set("container",t));this.get("parent")||this.set("parent",t.parentNode)},e.prototype.resetStyles=function(){var t=this.get("domStyles"),e=this.get("defaultStyles");t=t?(0,Ux.deepMix)({},e,t):e,this.set("domStyles",t)},e.prototype.applyStyles=function(){var t=this.get("domStyles");if(t){var e=this.getContainer();this.applyChildrenStyles(e,t);var r,n=this.get("containerClassName");if(n&&(r=n,e.className.match(new RegExp("(\\s|^)"+r+"(\\s|$)"))))rO(e,t[n])}},e.prototype.applyChildrenStyles=function(t,e){(0,Ux.each)(e,function(e,r){var n=t.getElementsByClassName(r);(0,Ux.each)(n,function(t){rO(t,e)})})},e.prototype.applyStyle=function(t,e){rO(e,this.get("domStyles")[t])},e.prototype.createDom=function(){return oI(this.get("containerTpl"))},e.prototype.initEvent=function(){},e.prototype.removeDom=function(){var t=this.get("container");t&&t.parentNode&&t.parentNode.removeChild(t)},e.prototype.removeEvent=function(){},e.prototype.updateInner=function(t){(0,Ux.hasKey)(t,"domStyles")&&(this.resetStyles(),this.applyStyles()),this.resetPosition()},e.prototype.resetPosition=function(){},e}(tD),CD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{name:"annotation",type:"html",locationType:"point",x:0,y:0,containerTpl:'
    ',alignX:"left",alignY:"top",html:"",zIndex:7})},e.prototype.render=function(){var t=this.getContainer(),e=this.get("html");VR(t);var r=(0,Ux.isFunction)(e)?e(t):e;if((0,Ux.isElement)(r))t.appendChild(r);else if((0,Ux.isString)(r)||(0,Ux.isNumber)(r)){var n=oI(""+r);n&&t.appendChild(n)}this.resetPosition()},e.prototype.resetPosition=function(){var t=this.getContainer(),e=this.getLocation(),r=e.x,n=e.y,i=this.get("alignX"),o=this.get("alignY"),a=this.get("offsetX"),s=this.get("offsetY"),u=_D(t),l=SD(t),c={x:r,y:n};"middle"===i?c.x-=Math.round(u/2):"right"===i&&(c.x-=Math.round(u)),"middle"===o?c.y-=Math.round(l/2):"bottom"===o&&(c.y-=Math.round(l)),a&&(c.x+=a),s&&(c.y+=s),rO(t,{position:"absolute",left:c.x+"px",top:c.y+"px",zIndex:this.get("zIndex")})},e}(ED);function kD(t,e,r){var n=e+"Style",i=null;return(0,Ux.each)(r,function(e,r){t[r]&&e[n]&&(i||(i={}),(0,Ux.mix)(i,e[n]))}),i}var ID=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{name:"axis",ticks:[],line:{},tickLine:{},subTickLine:null,title:null,label:{},verticalFactor:1,verticalLimitLength:null,overlapOrder:["autoRotate","autoEllipsis","autoHide"],tickStates:{},optimize:{},defaultCfg:{line:{style:{lineWidth:1,stroke:hD.lineColor}},tickLine:{style:{lineWidth:1,stroke:hD.lineColor},alignTick:!0,length:5,displayWithLabel:!0},subTickLine:{style:{lineWidth:1,stroke:hD.lineColor},count:4,length:2},label:{autoRotate:!0,autoHide:!1,autoEllipsis:!1,style:{fontSize:12,fill:hD.textColor,fontFamily:hD.fontFamily,fontWeight:"normal"},offset:10,offsetX:0,offsetY:0},title:{autoRotate:!0,spacing:5,position:"center",style:{fontSize:12,fill:hD.textColor,textBaseline:"middle",fontFamily:hD.fontFamily,textAlign:"center"},iconStyle:{fill:hD.descriptionIconFill,stroke:hD.descriptionIconStroke},description:""},tickStates:{active:{labelStyle:{fontWeight:500},tickLineStyle:{lineWidth:2}},inactive:{labelStyle:{fill:hD.uncheckedColor}}},optimize:{enable:!0,threshold:400}},theme:{}})},e.prototype.renderInner=function(t){this.get("line")&&this.drawLine(t),this.drawTicks(t),this.get("title")&&this.drawTitle(t)},e.prototype.isList=function(){return!0},e.prototype.getItems=function(){return this.get("ticks")},e.prototype.setItems=function(t){this.update({ticks:t})},e.prototype.updateItem=function(t,e){(0,Ux.mix)(t,e),this.clear(),this.render()},e.prototype.clearItems=function(){var t=this.getElementByLocalId("label-group");t&&t.clear()},e.prototype.setItemState=function(t,e,r){t[e]=r,this.updateTickStates(t)},e.prototype.hasState=function(t,e){return!!t[e]},e.prototype.getItemStates=function(t){var e=this.get("tickStates"),r=[];return(0,Ux.each)(e,function(e,n){t[n]&&r.push(n)}),r},e.prototype.clearItemsState=function(t){var e=this,r=this.getItemsByState(t);(0,Ux.each)(r,function(r){e.setItemState(r,t,!1)})},e.prototype.getItemsByState=function(t){var e=this,r=this.getItems();return(0,Ux.filter)(r,function(r){return e.hasState(r,t)})},e.prototype.getSidePoint=function(t,e){var r=this.getSideVector(e,t);return{x:t.x+r[0],y:t.y+r[1]}},e.prototype.getTextAnchor=function(t){var e;return(0,Ux.isNumberEqual)(t[0],0)?e="center":t[0]>0?e="start":t[0]<0&&(e="end"),e},e.prototype.getTextBaseline=function(t){var e;return(0,Ux.isNumberEqual)(t[1],0)?e="middle":t[1]>0?e="top":t[1]<0&&(e="bottom"),e},e.prototype.processOverlap=function(t){},e.prototype.drawLine=function(t){var e=this.getLinePath(),r=this.get("line");this.addShape(t,{type:"path",id:this.getElementId("line"),name:"axis-line",attrs:(0,Ux.mix)({path:e},r.style)})},e.prototype.getTickLineItems=function(t){var e=this,r=[],n=this.get("tickLine"),i=n.alignTick,o=n.length,a=1;return t.length>=2&&(a=t[1].value-t[0].value),(0,Ux.each)(t,function(t){var n=t.point;i||(n=e.getTickPoint(t.value-a/2));var s=e.getSidePoint(n,o);r.push({startPoint:n,tickValue:t.value,endPoint:s,tickId:t.id,id:"tickline-"+t.id})}),r},e.prototype.getSubTickLineItems=function(t){var e=[],r=this.get("subTickLine"),n=r.count,i=t.length;if(i>=2)for(var o=0;o0){var r=(0,Ux.size)(e);if(r>t.threshold){var n=Math.ceil(r/t.threshold),i=e.filter(function(t,e){return e%n==0});this.set("ticks",i),this.set("originalTicks",e)}}},e.prototype.getLabelAttrs=function(t,e,r){var n=this.get("label"),i=n.offset,o=n.offsetX,a=n.offsetY,s=n.rotate,u=n.formatter,l=this.getSidePoint(t.point,i),c=this.getSideVector(i,l),f=u?u(t.name,t,e):t.name,h=n.style;h=(0,Ux.isFunction)(h)?(0,Ux.get)(this.get("theme"),["label","style"],{}):h;var p=(0,Ux.mix)({x:l.x+o,y:l.y+a,text:f,textAlign:this.getTextAnchor(c),textBaseline:this.getTextBaseline(c)},h);return s&&(p.matrix=BR(l,s)),p},e.prototype.drawLabels=function(t){var e=this,r=this.get("ticks"),n=this.addGroup(t,{name:"axis-label-group",id:this.getElementId("label-group")});(0,Ux.each)(r,function(t,i){e.addShape(n,{type:"text",name:"axis-label",id:e.getElementId("label-"+t.id),attrs:e.getLabelAttrs(t,i,r),delegateObject:{tick:t,item:t,index:i}})}),this.processOverlap(n);var i=n.getChildren(),o=(0,Ux.get)(this.get("theme"),["label","style"],{}),a=this.get("label"),s=a.style,u=a.formatter;if((0,Ux.isFunction)(s)){var l=i.map(function(t){return(0,Ux.get)(t.get("delegateObject"),"tick")});(0,Ux.each)(i,function(t,e){var r=t.get("delegateObject").tick,n=u?u(r.name,r,e):r.name,i=(0,Ux.mix)({},o,s(n,e,l));t.attr(i)})}},e.prototype.getTitleAttrs=function(){var t=this.get("title"),e=t.style,r=t.position,n=t.offset,i=t.spacing,o=void 0===i?0:i,a=t.autoRotate,s=e.fontSize,u=.5;"start"===r?u=0:"end"===r&&(u=1);var l=this.getTickPoint(u),c=this.getSidePoint(l,n||o+s/2),f=(0,Ux.mix)({x:c.x,y:c.y,text:t.text},e),h=t.rotate,p=h;if((0,Ux.isNil)(h)&&a){var d=this.getAxisVector(l);p=Wx.LL(d,[1,0],!0)}if(p){var y=BR(c,p);f.matrix=y}return f},e.prototype.drawTitle=function(t){var e,r=this.getTitleAttrs(),n=this.addShape(t,{type:"text",id:this.getElementId("title"),name:"axis-title",attrs:r});(null===(e=this.get("title"))||void 0===e?void 0:e.description)&&this.drawDescriptionIcon(t,n,r.matrix)},e.prototype.drawDescriptionIcon=function(t,e,r){var n=this.addGroup(t,{name:"axis-description",id:this.getElementById("description")}),i=e.getBBox(),o=i.maxX,a=i.maxY,s=i.height,u=this.get("title").iconStyle,l=s/2,c=l/6,f=o+4,h=a-s/2,p=[f+l,h-l],d=p[0],y=p[1],g=[d+l,y+l],v=g[0],m=g[1],b=[d,m+l],A=b[0],x=b[1],w=[f,y+l],_=w[0],S=w[1],E=[f+l,h-s/4],C=E[0],k=E[1],I=[C,k+c],T=I[0],O=I[1],M=[T,O+c],P=M[0],L=M[1],N=[P,L+3*l/4],j=N[0],R=N[1];this.addShape(n,{type:"path",id:this.getElementId("title-description-icon"),name:"axis-title-description-icon",attrs:(0,Gx.__assign)({path:[["M",d,y],["A",l,l,0,0,1,v,m],["A",l,l,0,0,1,A,x],["A",l,l,0,0,1,_,S],["A",l,l,0,0,1,d,y],["M",C,k],["L",T,O],["M",P,L],["L",j,R]],lineWidth:c,matrix:r},u)}),this.addShape(n,{type:"rect",id:this.getElementId("title-description-rect"),name:"axis-title-description-rect",attrs:{x:f,y:h-s/2,width:s,height:s,stroke:"#000",fill:"#000",opacity:0,matrix:r,cursor:"pointer"}})},e.prototype.applyTickStates=function(t,e){if(this.getItemStates(t).length){var r=this.get("tickStates"),n=this.getElementId("label-"+t.id),i=e.findById(n);if(i){var o=kD(t,"label",r);o&&i.attr(o)}var a=this.getElementId("tickline-"+t.id),s=e.findById(a);if(s){var u=kD(t,"tickLine",r);u&&s.attr(u)}}},e.prototype.updateTickStates=function(t){var e=this.getItemStates(t),r=this.get("tickStates"),n=this.get("label"),i=this.getElementByLocalId("label-"+t.id),o=this.get("tickLine"),a=this.getElementByLocalId("tickline-"+t.id);if(e.length){if(i){var s=kD(t,"label",r);s&&i.attr(s)}if(a){var u=kD(t,"tickLine",r);u&&a.attr(u)}}else i&&i.attr(n.style),a&&a.attr(o.style)},e}(nD);function TD(t,e,r,n){var i=e.getChildren(),o=!1;return(0,Ux.each)(i,function(e){var i=cD(t,e,r,n);o=o||i}),o}function OD(){return PD}function MD(t,e,r){return TD(t,e,r,"head")}function PD(t,e,r){return TD(t,e,r,"tail")}function LD(t,e,r){return TD(t,e,r,"middle")}function ND(t){var e,r;return(function(t){var e=t.attr("matrix");return e&&1!==e[0]}(t)?(e=t.attr("matrix"),r=[0,0,0],d_.transformMat3(r,[1,0,0],e),Math.atan2(r[1],r[0])):0)%360}function jD(t,e,r,n){var i=!1,o=ND(e),a=t?Math.abs(r.attr("y")-e.attr("y")):Math.abs(r.attr("x")-e.attr("x")),s=(t?r.attr("y")>e.attr("y"):r.attr("x")>e.attr("x"))?e.getBBox():r.getBBox();if(t){var u=Math.abs(Math.cos(o));i=XR(u,0,Math.PI/180)?s.width+n>a:s.height/u+n>a}else{u=Math.abs(Math.sin(o));i=XR(u,0,Math.PI/180)?s.width+n>a:s.height/u+n>a}return i}function RD(t,e,r,n){var i=(null===n||void 0===n?void 0:n.minGap)||0,o=e.getChildren().slice().filter(function(t){return t.get("visible")});if(!o.length)return!1;var a=!1;r&&o.reverse();for(var s=o.length,u=o[0],l=1;l1){h=Math.ceil(h);for(var d=0;d2){var a=i[0],s=i[i.length-1];a.get("visible")||(a.show(),RD(t,e,!1,n)&&(o=!0)),s.get("visible")||(s.show(),RD(t,e,!0,n)&&(o=!0))}return o}function VD(t,e,r,n){var i=e.getChildren();if(!i.length)return!1;if(!t&&i.length<2)return!1;var o=lD(i),a=!1;t?a=!!r&&o>r:a=o>Math.abs(i[1].attr("x")-i[0].attr("x"));a&&function(t,e){(0,Ux.each)(t,function(t){var r=BR({x:t.attr("x"),y:t.attr("y")},e);t.attr("matrix",r)})}(i,n(r,o));return a}function QD(){return YD}function YD(t,e,r,n){return VD(t,e,r,function(){return(0,Ux.isNumber)(n)?n:t?hD.verticalAxisRotate:hD.horizontalAxisRotate})}function WD(t,e,r){return VD(t,e,r,function(e,r){if(!e)return t?hD.verticalAxisRotate:hD.horizontalAxisRotate;if(t)return-Math.acos(e/r);var n=0;return e>r?n=Math.PI/4:(n=Math.asin(e/r))>Math.PI/4&&(n=Math.PI/4),n})}var qD,XD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{type:"line",locationType:"region",start:null,end:null})},e.prototype.getLinePath=function(){var t=this.get("start"),e=this.get("end"),r=[];return r.push(["M",t.x,t.y]),r.push(["L",e.x,e.y]),r},e.prototype.getInnerLayoutBBox=function(){var e=this.get("start"),r=this.get("end"),n=t.prototype.getInnerLayoutBBox.call(this),i=Math.min(e.x,r.x,n.x),o=Math.min(e.y,r.y,n.y),a=Math.max(e.x,r.x,n.maxX),s=Math.max(e.y,r.y,n.maxY);return{x:i,y:o,minX:i,minY:o,maxX:a,maxY:s,width:a-i,height:s-o}},e.prototype.isVertical=function(){var t=this.get("start"),e=this.get("end");return(0,Ux.isNumberEqual)(t.x,e.x)},e.prototype.isHorizontal=function(){var t=this.get("start"),e=this.get("end");return(0,Ux.isNumberEqual)(t.y,e.y)},e.prototype.getTickPoint=function(t){var e=this.get("start"),r=this.get("end"),n=r.x-e.x,i=r.y-e.y;return{x:e.x+n*t,y:e.y+i*t}},e.prototype.getSideVector=function(t){var e=this.getAxisVector(),r=g_.normalize([0,0],e),n=this.get("verticalFactor"),i=[r[1],-1*r[0]];return g_.scale([0,0],i,t*n)},e.prototype.getAxisVector=function(){var t=this.get("start"),e=this.get("end");return[e.x-t.x,e.y-t.y]},e.prototype.processOverlap=function(t){var e=this,r=this.isVertical(),n=this.isHorizontal();if(r||n){var i=this.get("label"),o=this.get("title"),a=this.get("verticalLimitLength"),s=i.offset,u=a,l=0,c=0;o&&(l=o.style.fontSize,c=o.spacing),u&&(u=u-s-c-l);var f=this.get("overlapOrder");if((0,Ux.each)(f,function(r){i[r]&&e.canProcessOverlap(r)&&e.autoProcessOverlap(r,i[r],t,u)}),o&&(0,Ux.isNil)(o.offset)){var h=t.getCanvasBBox(),p=r?h.width:h.height;o.offset=s+p+c+l/2}}},e.prototype.canProcessOverlap=function(t){var e=this.get("label");return"autoRotate"!==t||(0,Ux.isNil)(e.rotate)},e.prototype.autoProcessOverlap=function(t,e,r,n){var i=this,o=this.isVertical(),a=!1,s=_[t];if(!0===e){this.get("label");a=s.getDefault()(o,r,n)}else if((0,Ux.isFunction)(e))a=e(o,r,n);else if((0,Ux.isObject)(e)){var u=e;s[u.type]&&(a=s[u.type](o,r,n,u.cfg))}else s[e]&&(a=s[e](o,r,n));if("autoRotate"===t){if(a){var l=r.getChildren(),c=this.get("verticalFactor");(0,Ux.each)(l,function(t){if("center"===t.attr("textAlign")){var e=c>0?"end":"start";t.attr("textAlign",e)}})}}else if("autoHide"===t){var f=r.getChildren().slice(0);(0,Ux.each)(f,function(t){t.get("visible")||(i.get("isRegister")&&i.unregisterElement(t),t.remove())})}},e}(ID),KD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{type:"circle",locationType:"circle",center:null,radius:null,startAngle:-Math.PI/2,endAngle:3*Math.PI/2})},e.prototype.getLinePath=function(){var t=this.get("center"),e=t.x,r=t.y,n=this.get("radius"),i=n,o=this.get("startAngle"),a=this.get("endAngle"),s=[];if(Math.abs(a-o)===2*Math.PI)s=[["M",e,r-i],["A",n,i,0,1,1,e,r+i],["A",n,i,0,1,1,e,r-i],["Z"]];else{var u=this.getCirclePoint(o),l=this.getCirclePoint(a),c=Math.abs(a-o)>Math.PI?1:0,f=o>a?0:1;s=[["M",e,r],["L",u.x,u.y],["A",n,i,0,c,f,l.x,l.y],["L",e,r]]}return s},e.prototype.getTickPoint=function(t){var e=this.get("startAngle"),r=e+(this.get("endAngle")-e)*t;return this.getCirclePoint(r)},e.prototype.getSideVector=function(t,e){var r=this.get("center"),n=[e.x-r.x,e.y-r.y],i=this.get("verticalFactor"),o=g_.length(n);return g_.scale(n,n,i*t/o),n},e.prototype.getAxisVector=function(t){var e=this.get("center"),r=[t.x-e.x,t.y-e.y];return[r[1],-1*r[0]]},e.prototype.getCirclePoint=function(t,e){var r=this.get("center");return e=e||this.get("radius"),{x:r.x+Math.cos(t)*e,y:r.y+Math.sin(t)*e}},e.prototype.canProcessOverlap=function(t){var e=this.get("label");return"autoRotate"!==t||(0,Ux.isNil)(e.rotate)},e.prototype.processOverlap=function(t){var e=this,r=this.get("label"),n=this.get("title"),i=this.get("verticalLimitLength"),o=r.offset,a=i,s=0,u=0;n&&(s=n.style.fontSize,u=n.spacing),a&&(a=a-o-u-s);var l=this.get("overlapOrder");if((0,Ux.each)(l,function(n){r[n]&&e.canProcessOverlap(n)&&e.autoProcessOverlap(n,r[n],t,a)}),n&&(0,Ux.isNil)(n.offset)){var c=t.getCanvasBBox().height;n.offset=o+c+u+s/2}},e.prototype.autoProcessOverlap=function(t,e,r,n){var i=this,o=!1,a=_[t];if(n>0)if(!0===e)o=a.getDefault()(!1,r,n);else if((0,Ux.isFunction)(e))o=e(!1,r,n);else if((0,Ux.isObject)(e)){var s=e;a[s.type]&&(o=a[s.type](!1,r,n,s.cfg))}else a[e]&&(o=a[e](!1,r,n));if("autoRotate"===t){if(o){var u=r.getChildren(),l=this.get("verticalFactor");(0,Ux.each)(u,function(t){if("center"===t.attr("textAlign")){var e=l>0?"end":"start";t.attr("textAlign",e)}})}}else if("autoHide"===t){var c=r.getChildren().slice(0);(0,Ux.each)(c,function(t){t.get("visible")||(i.get("isRegister")&&i.unregisterElement(t),t.remove())})}},e}(ID),JD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{name:"crosshair",type:"base",line:{},text:null,textBackground:{},capture:!1,defaultCfg:{line:{style:{lineWidth:1,stroke:hD.lineColor}},text:{position:"start",offset:10,autoRotate:!1,content:null,style:{fill:hD.textColor,textAlign:"center",textBaseline:"middle",fontFamily:hD.fontFamily}},textBackground:{padding:5,style:{stroke:hD.lineColor}}}})},e.prototype.renderInner=function(t){this.get("line")&&this.renderLine(t),this.get("text")&&(this.renderText(t),this.renderBackground(t))},e.prototype.renderText=function(t){var e=this.get("text"),r=e.style,n=e.autoRotate,i=e.content;if(!(0,Ux.isNil)(i)){var o=this.getTextPoint(),a=null;if(n)a=BR(o,this.getRotateAngle());this.addShape(t,{type:"text",name:"crosshair-text",id:this.getElementId("text"),attrs:(0,Gx.__assign)((0,Gx.__assign)((0,Gx.__assign)({},o),{text:i,matrix:a}),r)})}},e.prototype.renderLine=function(t){var e=this.getLinePath(),r=this.get("line").style;this.addShape(t,{type:"path",name:"crosshair-line",id:this.getElementId("line"),attrs:(0,Gx.__assign)({path:e},r)})},e.prototype.renderBackground=function(t){var e=this.getElementId("text"),r=t.findById(e),n=this.get("textBackground");if(n&&r){var i=r.getBBox(),o=HR(n.padding),a=n.style;this.addShape(t,{type:"rect",name:"crosshair-text-background",id:this.getElementId("text-background"),attrs:(0,Gx.__assign)({x:i.x-o[3],y:i.y-o[0],width:i.width+o[1]+o[3],height:i.height+o[0]+o[2],matrix:r.attr("matrix")},a)}).toBack()}},e}(nD),ZD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{type:"line",locationType:"region",start:null,end:null})},e.prototype.getRotateAngle=function(){var t=this.getLocation(),e=t.start,r=t.end,n=this.get("text").position,i=Math.atan2(r.y-e.y,r.x-e.x);return"start"===n?i-Math.PI/2:i+Math.PI/2},e.prototype.getTextPoint=function(){var t=this.getLocation(),e=t.start,r=t.end,n=this.get("text");return ZR(e,r,n.position,n.offset)},e.prototype.getLinePath=function(){var t=this.getLocation(),e=t.start,r=t.end;return[["M",e.x,e.y],["L",r.x,r.y]]},e}(JD),$D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{type:"circle",locationType:"circle",center:null,radius:100,startAngle:-Math.PI/2,endAngle:3*Math.PI/2})},e.prototype.getRotateAngle=function(){var t=this.getLocation(),e=t.startAngle,r=t.endAngle;return"start"===this.get("text").position?e+Math.PI/2:r-Math.PI/2},e.prototype.getTextPoint=function(){var t=this.get("text"),e=t.position,r=t.offset,n=this.getLocation(),i=n.center,o=n.radius,a=n.startAngle,s=n.endAngle,u="start"===e?a:s,l=this.getRotateAngle()-Math.PI,c=qR(i,o,u),f=Math.cos(l)*r,h=Math.sin(l)*r;return{x:c.x+f,y:c.y+h}},e.prototype.getLinePath=function(){var t=this.getLocation(),e=t.center,r=t.radius,n=t.startAngle,i=t.endAngle,o=null;if(i-n==2*Math.PI){var a=e.x,s=e.y;o=[["M",a,s-r],["A",r,r,0,1,1,a,s+r],["A",r,r,0,1,1,a,s-r],["Z"]]}else{var u=qR(e,r,n),l=qR(e,r,i),c=Math.abs(i-n)>Math.PI?1:0,f=n>i?0:1;o=[["M",u.x,u.y],["A",r,r,0,c,f,l.x,l.y]]}return o},e}(JD),tB=((qD={})["g2-crosshair"]={position:"relative"},qD["g2-crosshair-line"]={position:"absolute",backgroundColor:"rgba(0, 0, 0, 0.25)"},qD["g2-crosshair-text"]={position:"absolute",color:hD.textColor,fontFamily:hD.fontFamily},qD),eB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{name:"crosshair",type:"html",locationType:"region",start:{x:0,y:0},end:{x:0,y:0},capture:!1,text:null,containerTpl:'
    ',crosshairTpl:'
    ',textTpl:'{content}',domStyles:null,containerClassName:"g2-crosshair",defaultStyles:tB,defaultCfg:{text:{position:"start",content:null,align:"center",offset:10}}})},e.prototype.render=function(){this.resetText(),this.resetPosition()},e.prototype.initCrossHair=function(){var t=this.getContainer(),e=oI(this.get("crosshairTpl"));t.appendChild(e),this.applyStyle("g2-crosshair-line",e),this.set("crosshairEl",e)},e.prototype.getTextPoint=function(){var t=this.getLocation(),e=t.start,r=t.end,n=this.get("text");return ZR(e,r,n.position,n.offset)},e.prototype.resetText=function(){var t=this.get("text"),e=this.get("textEl");if(t){var r=t.content;if(!e){var n=this.getContainer();e=oI((0,Ux.substitute)(this.get("textTpl"),t)),n.appendChild(e),this.applyStyle("g2-crosshair-text",e),this.set("textEl",e)}e.innerHTML=r}else e&&e.remove()},e.prototype.isVertical=function(t,e){return t.x===e.x},e.prototype.resetPosition=function(){var t=this.get("crosshairEl");t||(this.initCrossHair(),t=this.get("crosshairEl"));var e=this.get("start"),r=this.get("end"),n=Math.min(e.x,r.x),i=Math.min(e.y,r.y);this.isVertical(e,r)?rO(t,{width:"1px",height:JR(Math.abs(r.y-e.y))}):rO(t,{height:"1px",width:JR(Math.abs(r.x-e.x))}),rO(t,{top:JR(i),left:JR(n)}),this.alignText()},e.prototype.alignText=function(){var t=this.get("textEl");if(t){var e=this.get("text").align,r=t.clientWidth,n=this.getTextPoint();switch(e){case"center":n.x=n.x-r/2;break;case"right":n.x=n.x-r}rO(t,{top:JR(n.y),left:JR(n.x)})}},e.prototype.updateInner=function(e){(0,Ux.hasKey)(e,"text")&&this.resetText(),t.prototype.updateInner.call(this,e)},e}(ED),rB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{name:"grid",line:{},alternateColor:null,capture:!1,items:[],closed:!1,defaultCfg:{line:{type:"line",style:{lineWidth:1,stroke:hD.lineColor}}}})},e.prototype.getLineType=function(){return(this.get("line")||this.get("defaultCfg").line).type},e.prototype.renderInner=function(t){this.drawGrid(t)},e.prototype.getAlternatePath=function(t,e){var r=this.getGridPath(t),n=e.slice(0).reverse(),i=this.getGridPath(n,!0);return this.get("closed")?r=r.concat(i):(i[0][0]="L",(r=r.concat(i)).push(["Z"])),r},e.prototype.getPathStyle=function(){return this.get("line").style},e.prototype.drawGrid=function(t){var e=this,r=this.get("line"),n=this.get("items"),i=this.get("alternateColor"),o=null;(0,Ux.each)(n,function(a,s){var u=a.id||s;if(r){var l=e.getPathStyle();l=(0,Ux.isFunction)(l)?l(a,s,n):l;var c=e.getElementId("line-"+u),f=e.getGridPath(a.points);e.addShape(t,{type:"path",name:"grid-line",id:c,attrs:(0,Ux.mix)({path:f},l)})}if(i&&s>0){var h=e.getElementId("region-"+u),p=s%2==0;if((0,Ux.isString)(i))p&&e.drawAlternateRegion(h,t,o.points,a.points,i);else{var d=p?i[1]:i[0];e.drawAlternateRegion(h,t,o.points,a.points,d)}}o=a})},e.prototype.drawAlternateRegion=function(t,e,r,n,i){var o=this.getAlternatePath(r,n);this.addShape(e,{type:"path",id:t,name:"grid-region",attrs:{path:o,fill:i}})},e}(nD);var nB,iB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{type:"circle",center:null,closed:!0})},e.prototype.getGridPath=function(t,e){var r,n,i,o,a,s,u=this.getLineType(),l=this.get("closed"),c=[];if(t.length)if("circle"===u){var f=this.get("center"),h=t[0],p=(r=f.x,n=f.y,i=h.x,o=h.y,a=i-r,s=o-n,Math.sqrt(a*a+s*s)),d=e?0:1;l?(c.push(["M",f.x,f.y-p]),c.push(["A",p,p,0,0,d,f.x,f.y+p]),c.push(["A",p,p,0,0,d,f.x,f.y-p]),c.push(["Z"])):(0,Ux.each)(t,function(t,e){0===e?c.push(["M",t.x,t.y]):c.push(["A",p,p,0,0,d,t.x,t.y])})}else(0,Ux.each)(t,function(t,e){0===e?c.push(["M",t.x,t.y]):c.push(["L",t.x,t.y])}),l&&c.push(["Z"]);return c},e}(rB),oB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{type:"line"})},e.prototype.getGridPath=function(t){var e=[];return(0,Ux.each)(t,function(t,r){0===r?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])}),e},e}(rB),aB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{name:"legend",layout:"horizontal",locationType:"point",x:0,y:0,offsetX:0,offsetY:0,title:null,background:null})},e.prototype.getLayoutBBox=function(){var e=t.prototype.getLayoutBBox.call(this),r=this.get("maxWidth"),n=this.get("maxHeight"),i=e.width,o=e.height;return r&&(i=Math.min(i,r)),n&&(o=Math.min(o,n)),YR(e.minX,e.minY,i,o)},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},e.prototype.resetLocation=function(){var t=this.get("x"),e=this.get("y"),r=this.get("offsetX"),n=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t+r,y:e+n})},e.prototype.applyOffset=function(){this.resetLocation()},e.prototype.getDrawPoint=function(){return this.get("currentPoint")},e.prototype.setDrawPoint=function(t){return this.set("currentPoint",t)},e.prototype.renderInner=function(t){this.resetDraw(),this.get("title")&&this.drawTitle(t),this.drawLegendContent(t),this.get("background")&&this.drawBackground(t)},e.prototype.drawBackground=function(t){var e=this.get("background"),r=t.getBBox(),n=HR(e.padding),i=(0,Gx.__assign)({x:0,y:0,width:r.width+n[1]+n[3],height:r.height+n[0]+n[2]},e.style);this.addShape(t,{type:"rect",id:this.getElementId("background"),name:"legend-background",attrs:i}).toBack()},e.prototype.drawTitle=function(t){var e=this.get("currentPoint"),r=this.get("title"),n=r.spacing,i=r.style,o=r.text,a=this.addShape(t,{type:"text",id:this.getElementId("title"),name:"legend-title",attrs:(0,Gx.__assign)({text:o,x:e.x,y:e.y},i)}).getBBox();this.set("currentPoint",{x:e.x,y:a.maxY+n})},e.prototype.resetDraw=function(){var t=this.get("background"),e={x:0,y:0};if(t){var r=HR(t.padding);e.x=r[3],e.y=r[0]}this.set("currentPoint",e)},e}(nD),sB={marker:{style:{inactiveFill:"#000",inactiveOpacity:.45,fill:"#000",opacity:1,size:12}},text:{style:{fill:"#ccc",fontSize:12}}},uB={fill:hD.textColor,fontSize:12,textAlign:"start",textBaseline:"middle",fontFamily:hD.fontFamily,fontWeight:"normal",lineHeight:12},lB={right:90*Math.PI/180,left:270*Math.PI/180,up:0,down:180*Math.PI/180},cB=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.currentPageIndex=1,e.totalPagesCnt=1,e.pageWidth=0,e.pageHeight=0,e.startX=0,e.startY=0,e.onNavigationBack=function(){var t=e.getElementByLocalId("item-group");if(e.currentPageIndex>1){e.currentPageIndex-=1,e.updateNavigation();var r=e.getCurrentNavigationMatrix();e.get("animate")?t.animate({matrix:r},100):t.attr({matrix:r})}},e.onNavigationAfter=function(){var t=e.getElementByLocalId("item-group");if(e.currentPageIndexd&&(d=m),"horizontal"===f?(y&&ys}(t,y))&&(1===g&&(v=y.x+c,r.moveElementTo(p,{x:_,y:y.y+f/2-d.height/2-d.minY})),g+=1,y.x=n,y.y+=w),r.moveElementTo(t,y),t.getParent().setClip({type:"rect",attrs:{x:y.x,y:y.y,width:i+c,height:f}}),y.x+=i+c})}else{(0,Ux.each)(a,function(t){var e=t.getBBox();e.width>m&&(m=e.width)}),b=m,m+=c,s&&(m=Math.min(s,m),b=Math.min(s,b)),this.pageWidth=m,this.pageHeight=u-Math.max(d.height,f+A);var S=Math.floor(this.pageHeight/(f+A));(0,Ux.each)(a,function(t,e){0!==e&&e%S==0&&(g+=1,y.x+=m,y.y=i),r.moveElementTo(t,y),t.getParent().setClip({type:"rect",attrs:{x:y.x,y:y.y,width:m,height:f}}),y.y+=f+A}),this.totalPagesCnt=g,this.moveElementTo(p,{x:n+b/2-d.width/2-d.minX,y:u-d.height-d.minY})}this.pageHeight&&this.pageWidth&&e.getParent().setClip({type:"rect",attrs:{x:this.startX,y:this.startY,width:this.pageWidth,height:this.pageHeight}}),"horizontal"===o&&this.get("maxRow")?this.totalPagesCnt=Math.ceil(g/this.get("maxRow")):this.totalPagesCnt=g,this.currentPageIndex>this.totalPagesCnt&&(this.currentPageIndex=1),this.updateNavigation(p),e.attr("matrix",this.getCurrentNavigationMatrix())},e.prototype.drawNavigation=function(t,e,r,n){var i={x:0,y:0},o=this.addGroup(t,{id:this.getElementId("navigation-group"),name:"legend-navigation"}),a=(0,Ux.get)(n.marker,"style",{}),s=a.size,u=void 0===s?12:s,l=(0,Gx.__rest)(a,["size"]),c=this.drawArrow(o,i,"navigation-arrow-left","horizontal"===e?"up":"left",u,l);c.on("click",this.onNavigationBack);var f=c.getBBox();i.x+=f.width+2;var h=this.addShape(o,{type:"text",id:this.getElementId("navigation-text"),name:"navigation-text",attrs:(0,Gx.__assign)({x:i.x,y:i.y+u/2,text:r,textBaseline:"middle"},(0,Ux.get)(n.text,"style"))}).getBBox();return i.x+=h.width+2,this.drawArrow(o,i,"navigation-arrow-right","horizontal"===e?"down":"right",u,l).on("click",this.onNavigationAfter),o},e.prototype.updateNavigation=function(t){var e=(0,Ux.deepMix)({},sB,this.get("pageNavigator")).marker.style,r=e.fill,n=e.opacity,i=e.inactiveFill,o=e.inactiveOpacity,a=this.currentPageIndex+"/"+this.totalPagesCnt,s=t?t.getChildren()[1]:this.getElementByLocalId("navigation-text"),u=t?t.findById(this.getElementId("navigation-arrow-left")):this.getElementByLocalId("navigation-arrow-left"),l=t?t.findById(this.getElementId("navigation-arrow-right")):this.getElementByLocalId("navigation-arrow-right");s.attr("text",a),u.attr("opacity",1===this.currentPageIndex?o:n),u.attr("fill",1===this.currentPageIndex?i:r),u.attr("cursor",1===this.currentPageIndex?"not-allowed":"pointer"),l.attr("opacity",this.currentPageIndex===this.totalPagesCnt?o:n),l.attr("fill",this.currentPageIndex===this.totalPagesCnt?i:r),l.attr("cursor",this.currentPageIndex===this.totalPagesCnt?"not-allowed":"pointer");var c=u.getBBox().maxX+2;s.attr("x",c),c+=s.getBBox().width+2,this.updateArrowPath(l,{x:c,y:0})},e.prototype.drawArrow=function(t,e,r,n,i,o){var a=e.x,s=e.y,u=this.addShape(t,{type:"path",id:this.getElementId(r),name:r,attrs:(0,Gx.__assign)({size:i,direction:n,path:[["M",a+i/2,s],["L",a,s+i],["L",a+i,s+i],["Z"]],cursor:"pointer"},o)});return u.attr("matrix",BR({x:a+i/2,y:s+i/2},lB[n])),u},e.prototype.updateArrowPath=function(t,e){var r=e.x,n=e.y,i=t.attr(),o=i.size,a=i.direction,s=BR({x:r+o/2,y:n+o/2},lB[a]);t.attr("path",[["M",r+o/2,n],["L",r,n+o],["L",r+o,n+o],["Z"]]),t.attr("matrix",s)},e.prototype.getCurrentNavigationMatrix=function(){var t=this.currentPageIndex,e=this.pageWidth,r=this.pageHeight;return FR("horizontal"===this.get("layout")?{x:0,y:r*(1-t)}:{x:e*(1-t),y:0})},e.prototype.applyItemStates=function(t,e){if(this.getItemStates(t).length>0){var r=e.getChildren(),n=this.get("itemStates");(0,Ux.each)(r,function(e){var r=e.get("name").split("-")[2],i=kD(t,r,n);i&&(e.attr(i),"marker"!==r||e.get("isStroke")&&e.get("isFill")||(e.get("isStroke")&&e.attr("fill",null),e.get("isFill")&&e.attr("stroke",null)))})}},e.prototype.getLimitItemWidth=function(){var t=this.get("itemWidth"),e=this.get("maxItemWidth");return e?t&&(e=t<=e?t:e):t&&(e=t),e},e}(aB),fB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{type:"continue",min:0,max:100,value:null,colors:[],track:{},rail:{},label:{},handler:{},slidable:!0,tip:null,step:null,maxWidth:null,maxHeight:null,defaultCfg:{label:{align:"rail",spacing:5,formatter:null,style:{fontSize:12,fill:hD.textColor,textBaseline:"middle",fontFamily:hD.fontFamily}},handler:{size:10,style:{fill:"#fff",stroke:"#333"}},track:{},rail:{type:"color",size:20,defaultLength:100,style:{fill:"#DCDEE2"}},title:{spacing:5,style:{fill:hD.textColor,fontSize:12,textAlign:"start",textBaseline:"top"}}}})},e.prototype.isSlider=function(){return!0},e.prototype.getValue=function(){return this.getCurrentValue()},e.prototype.getRange=function(){return{min:this.get("min"),max:this.get("max")}},e.prototype.setRange=function(t,e){this.update({min:t,max:e})},e.prototype.setValue=function(t){var e=this.getValue();this.set("value",t);var r=this.get("group");this.resetTrackClip(),this.get("slidable")&&this.resetHandlers(r),this.delegateEmit("valuechanged",{originValue:e,value:t})},e.prototype.initEvent=function(){var t=this.get("group");this.bindSliderEvent(t),this.bindRailEvent(t),this.bindTrackEvent(t)},e.prototype.drawLegendContent=function(t){this.drawRail(t),this.drawLabels(t),this.fixedElements(t),this.resetTrack(t),this.resetTrackClip(t),this.get("slidable")&&this.resetHandlers(t)},e.prototype.bindSliderEvent=function(t){this.bindHandlersEvent(t)},e.prototype.bindHandlersEvent=function(t){var e=this;t.on("legend-handler-min:drag",function(t){var r=e.getValueByCanvasPoint(t.x,t.y),n=e.getCurrentValue()[1];nr&&(n=r),e.setValue([n,r])})},e.prototype.bindRailEvent=function(t){},e.prototype.bindTrackEvent=function(t){var e=this,r=null;t.on("legend-track:dragstart",function(t){r={x:t.x,y:t.y}}),t.on("legend-track:drag",function(t){if(r){var n=e.getValueByCanvasPoint(r.x,r.y),i=e.getValueByCanvasPoint(t.x,t.y),o=e.getCurrentValue(),a=o[1]-o[0],s=e.getRange(),u=i-n;u<0?o[0]+u>s.min?e.setValue([o[0]+u,o[1]+u]):e.setValue([s.min,s.min+a]):u>0&&(u>0&&o[1]+ui&&(u=i),u0&&this.changeRailLength(n,i,r[i]-l)}},e.prototype.changeRailLength=function(t,e,r){var n,i=t.getBBox();n="height"===e?this.getRailPath(i.x,i.y,i.width,r):this.getRailPath(i.x,i.y,r,i.height),t.attr("path",n)},e.prototype.changeRailPosition=function(t,e,r){var n=t.getBBox(),i=this.getRailPath(e,r,n.width,n.height);t.attr("path",i)},e.prototype.fixedHorizontal=function(t,e,r,n){var i=this.get("label"),o=i.align,a=i.spacing,s=r.getBBox(),u=t.getBBox(),l=e.getBBox(),c=s.height;this.fitRailLength(u,l,s,r),s=r.getBBox(),"rail"===o?(t.attr({x:n.x,y:n.y+c/2}),this.changeRailPosition(r,n.x+u.width+a,n.y),e.attr({x:n.x+u.width+s.width+2*a,y:n.y+c/2})):"top"===o?(t.attr({x:n.x,y:n.y}),e.attr({x:n.x+s.width,y:n.y}),this.changeRailPosition(r,n.x,n.y+u.height+a)):(this.changeRailPosition(r,n.x,n.y),t.attr({x:n.x,y:n.y+s.height+a}),e.attr({x:n.x+s.width,y:n.y+s.height+a}))},e.prototype.fixedVertail=function(t,e,r,n){var i=this.get("label"),o=i.align,a=i.spacing,s=r.getBBox(),u=t.getBBox(),l=e.getBBox();if(this.fitRailLength(u,l,s,r),s=r.getBBox(),"rail"===o)t.attr({x:n.x,y:n.y}),this.changeRailPosition(r,n.x,n.y+u.height+a),e.attr({x:n.x,y:n.y+u.height+s.height+2*a});else if("right"===o)t.attr({x:n.x+s.width+a,y:n.y}),this.changeRailPosition(r,n.x,n.y),e.attr({x:n.x+s.width+a,y:n.y+s.height});else{var c=Math.max(u.width,l.width);t.attr({x:n.x,y:n.y}),this.changeRailPosition(r,n.x+c+a,n.y),e.attr({x:n.x,y:n.y+s.height})}},e}(aB),hB="g2-tooltip",pB="g2-tooltip-title",dB="g2-tooltip-list",yB="g2-tooltip-list-item",gB="g2-tooltip-marker",vB="g2-tooltip-value",mB="g2-tooltip-name",bB="g2-tooltip-crosshair-x",AB="g2-tooltip-crosshair-y",xB=((nB={})[""+hB]={position:"absolute",visibility:"visible",zIndex:8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)",backgroundColor:"rgba(255, 255, 255, 0.9)",boxShadow:"0px 0px 10px #aeaeae",borderRadius:"3px",color:"rgb(87, 87, 87)",fontSize:"12px",fontFamily:hD.fontFamily,lineHeight:"20px",padding:"10px 10px 6px 10px"},nB[""+pB]={marginBottom:"4px"},nB[""+dB]={margin:"0px",listStyleType:"none",padding:"0px"},nB[""+yB]={listStyleType:"none",marginBottom:"4px"},nB[""+gB]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},nB[""+vB]={display:"inline-block",float:"right",marginLeft:"30px"},nB[""+bB]={position:"absolute",width:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},nB[""+AB]={position:"absolute",height:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},nB);var wB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{name:"tooltip",type:"html",x:0,y:0,items:[],customContent:null,containerTpl:'
      ',itemTpl:'
    • \n \n {name}:\n {value}\n
    • ',xCrosshairTpl:'
      ',yCrosshairTpl:'
      ',title:null,showTitle:!0,region:null,crosshairsRegion:null,containerClassName:hB,crosshairs:null,offset:10,position:"right",domStyles:null,defaultStyles:xB})},e.prototype.render=function(){this.get("customContent")?this.renderCustomContent():(this.resetTitle(),this.renderItems()),this.resetPosition()},e.prototype.clear=function(){this.clearCrosshairs(),this.setTitle(""),this.clearItemDoms()},e.prototype.show=function(){var t=this.getContainer();t&&!this.destroyed&&(this.set("visible",!0),rO(t,{visibility:"visible"}),this.setCrossHairsVisible(!0))},e.prototype.hide=function(){var t=this.getContainer();t&&!this.destroyed&&(this.set("visible",!1),rO(t,{visibility:"hidden"}),this.setCrossHairsVisible(!1))},e.prototype.getLocation=function(){return{x:this.get("x"),y:this.get("y")}},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetPosition()},e.prototype.setCrossHairsVisible=function(t){var e=t?"":"none",r=this.get("xCrosshairDom"),n=this.get("yCrosshairDom");r&&rO(r,{display:e}),n&&rO(n,{display:e})},e.prototype.initContainer=function(){if(t.prototype.initContainer.call(this),this.get("customContent")){this.get("container")&&this.get("container").remove();var e=this.getHtmlContentNode();this.get("parent").appendChild(e),this.set("container",e),this.resetStyles(),this.applyStyles()}},e.prototype.updateInner=function(e){var r,n,i;this.get("customContent")?this.renderCustomContent():(r=e,n=["title","showTitle"],i=!1,(0,Ux.each)(n,function(t){if((0,Ux.hasKey)(r,t))return i=!0,!1}),i&&this.resetTitle(),(0,Ux.hasKey)(e,"items")&&this.renderItems()),t.prototype.updateInner.call(this,e)},e.prototype.initDom=function(){this.cacheDoms()},e.prototype.removeDom=function(){t.prototype.removeDom.call(this),this.clearCrosshairs()},e.prototype.resetPosition=function(){var t,e=this.get("x"),r=this.get("y"),n=this.get("offset"),i=this.getOffset(),o=i.offsetX,a=i.offsetY,s=this.get("position"),u=this.get("region"),l=this.getContainer(),c=this.getBBox(),f=c.width,h=c.height;u&&(t=QR(u));var p=function(t,e,r,n,i,o,a){var s=function(t,e,r,n,i,o){var a=t,s=e;switch(o){case"left":a=t-n-r,s=e-i/2;break;case"right":a=t+r,s=e-i/2;break;case"top":a=t-n/2,s=e-i-r;break;case"bottom":a=t-n/2,s=e+r;break;default:a=t+r,s=e-i-r}return{x:a,y:s}}(t,e,r,n,i,o);if(a){var u=function(t,e,r,n,i){return{left:ti.x+i.width,top:ei.y+i.height}}(s.x,s.y,n,i,a);"auto"===o?(u.right&&(s.x=Math.max(0,t-n-r)),u.top&&(s.y=Math.max(0,e-i-r))):"top"===o||"bottom"===o?(u.left&&(s.x=a.x),u.right&&(s.x=a.x+a.width-n),"top"===o&&u.top&&(s.y=e+r),"bottom"===o&&u.bottom&&(s.y=e-i-r)):(u.top&&(s.y=a.y),u.bottom&&(s.y=a.y+a.height-i),"left"===o&&u.left&&(s.x=t+r),"right"===o&&u.right&&(s.x=t-n-r))}return s}(e,r,n,f,h,s,t);rO(l,{left:JR(p.x+o),top:JR(p.y+a)}),this.resetCrosshairs()},e.prototype.renderCustomContent=function(){var t=this.getHtmlContentNode(),e=this.get("parent"),r=this.get("container");r&&r.parentNode===e?e.replaceChild(t,r):e.appendChild(t),this.set("container",t),this.resetStyles(),this.applyStyles()},e.prototype.getHtmlContentNode=function(){var t,e=this.get("customContent");if(e){var r=e(this.get("title"),this.get("items"));t=(0,Ux.isElement)(r)?r:oI(r)}return t},e.prototype.cacheDoms=function(){var t=this.getContainer(),e=t.getElementsByClassName(pB)[0],r=t.getElementsByClassName(dB)[0];this.set("titleDom",e),this.set("listDom",r)},e.prototype.resetTitle=function(){var t=this.get("title");this.get("showTitle")&&t?this.setTitle(t):this.setTitle("")},e.prototype.setTitle=function(t){var e=this.get("titleDom");e&&(e.innerText=t)},e.prototype.resetCrosshairs=function(){var t=this.get("crosshairsRegion"),e=this.get("crosshairs");if(t&&e){var r=QR(t),n=this.get("xCrosshairDom"),i=this.get("yCrosshairDom");"x"===e?(this.resetCrosshair("x",r),i&&(i.remove(),this.set("yCrosshairDom",null))):"y"===e?(this.resetCrosshair("y",r),n&&(n.remove(),this.set("xCrosshairDom",null))):(this.resetCrosshair("x",r),this.resetCrosshair("y",r)),this.setCrossHairsVisible(this.get("visible"))}else this.clearCrosshairs()},e.prototype.resetCrosshair=function(t,e){var r=this.checkCrosshair(t),n=this.get(t);rO(r,"x"===t?{left:JR(n),top:JR(e.y),height:JR(e.height)}:{top:JR(n),left:JR(e.x),width:JR(e.width)})},e.prototype.checkCrosshair=function(t){var e=t+"CrosshairDom",r=t+"CrosshairTpl",n="CROSSHAIR_"+t.toUpperCase(),i=E[n],o=this.get(e),a=this.get("parent");return o||(o=oI(this.get(r)),this.applyStyle(i,o),a.appendChild(o),this.set(e,o)),o},e.prototype.renderItems=function(){this.clearItemDoms();var t=this.get("items"),e=this.get("itemTpl"),r=this.get("listDom");r&&((0,Ux.each)(t,function(t){var n=xR.toCSSGradient(t.color),i=(0,Gx.__assign)((0,Gx.__assign)({},t),{color:n}),o=oI((0,Ux.substitute)(e,i));r.appendChild(o)}),this.applyChildrenStyles(r,this.get("domStyles")))},e.prototype.clearItemDoms=function(){this.get("listDom")&&VR(this.get("listDom"))},e.prototype.clearCrosshairs=function(){var t=this.get("xCrosshairDom"),e=this.get("yCrosshairDom");t&&t.remove(),e&&e.remove(),this.set("xCrosshairDom",null),this.set("yCrosshairDom",null)},e}(ED),_B={opacity:0},SB={stroke:"#C5C5C5",strokeOpacity:.85},EB={fill:"#CACED4",opacity:.85};function CB(t){return function(t){return(0,Ux.map)(t,function(t,e){return[0===e?"M":"L",t[0],t[1]]})}(t)}function kB(t,e,r,n){void 0===n&&(n=!0);var i=new jM({values:t}),o=new XO({values:(0,Ux.map)(t,function(t,e){return e})}),a=(0,Ux.map)(t,function(t,n){return[o.scale(n)*e,r-i.scale(t)*r]});return n?function(t){if(t.length<=2)return CB(t);var e=[];(0,Ux.each)(t,function(t){(0,Ux.isEqual)(t,e.slice(e.length-2))||e.push(t[0],t[1])});var r=(0,nE.iR)(e,!1),n=(0,Ux.head)(t),i=n[0],o=n[1];return r.unshift(["M",i,o]),r}(a):CB(a)}function IB(t,e,r,n){var i=(0,Gx.__spreadArrays)(t),o=function(t,e){var r=new jM({values:t}),n=r.max<0?r.max:Math.max(0,r.min);return e-r.scale(n)*e}(n,r);return i.push(["L",e,o]),i.push(["L",0,o]),i.push(["Z"]),i}var TB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{name:"trend",x:0,y:0,width:200,height:16,smooth:!0,isArea:!1,data:[],backgroundStyle:_B,lineStyle:SB,areaStyle:EB})},e.prototype.renderInner=function(t){var e=this.cfg,r=e.width,n=e.height,i=e.data,o=e.smooth,a=e.isArea,s=e.backgroundStyle,u=e.lineStyle,l=e.areaStyle;this.addShape(t,{id:this.getElementId("background"),type:"rect",attrs:(0,Gx.__assign)({x:0,y:0,width:r,height:n},s)});var c=kB(i,r,n,o);if(this.addShape(t,{id:this.getElementId("line"),type:"path",attrs:(0,Gx.__assign)({path:c},u)}),a){var f=IB(c,r,n,i);this.addShape(t,{id:this.getElementId("area"),type:"path",attrs:(0,Gx.__assign)({path:f},l)})}},e.prototype.applyOffset=function(){var t=this.cfg,e=t.x,r=t.y;this.moveElementTo(this.get("group"),{x:e,y:r})},e}(nD),OB={fill:"#F7F7F7",stroke:"#BFBFBF",radius:2,opacity:1,cursor:"ew-resize",highLightFill:"#FFF"},MB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{name:"handler",x:0,y:0,width:10,height:24,style:OB})},e.prototype.renderInner=function(t){var e=this.cfg,r=e.width,n=e.height,i=e.style,o=i.fill,a=i.stroke,s=i.radius,u=i.opacity,l=i.cursor;this.addShape(t,{type:"rect",id:this.getElementId("background"),attrs:{x:0,y:0,width:r,height:n,fill:o,stroke:a,radius:s,opacity:u,cursor:l}});var c=1/3*r,f=2/3*r,h=.25*n,p=.75*n;this.addShape(t,{id:this.getElementId("line-left"),type:"line",attrs:{x1:c,y1:h,x2:c,y2:p,stroke:a,cursor:l}}),this.addShape(t,{id:this.getElementId("line-right"),type:"line",attrs:{x1:f,y1:h,x2:f,y2:p,stroke:a,cursor:l}})},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.bindEvents=function(){var t=this;this.get("group").on("mouseenter",function(){var e=t.get("style").highLightFill;t.getElementByLocalId("background").attr("fill",e),t.draw()}),this.get("group").on("mouseleave",function(){var e=t.get("style").fill;t.getElementByLocalId("background").attr("fill",e),t.draw()})},e.prototype.draw=function(){var t=this.get("container").get("canvas");t&&t.draw()},e}(nD),PB={fill:"#416180",opacity:.05},LB={fill:"#5B8FF9",opacity:.15,cursor:"move"},NB={width:10,height:24},jB={textBaseline:"middle",fill:"#000",opacity:.45},RB="sliderchange",DB=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.onMouseDown=function(t){return function(r){e.currentTarget=t;var n=r.originalEvent;n.stopPropagation(),n.preventDefault(),e.prevX=(0,Ux.get)(n,"touches.0.pageX",n.pageX),e.prevY=(0,Ux.get)(n,"touches.0.pageY",n.pageY);var i=e.getContainerDOM();i.addEventListener("mousemove",e.onMouseMove),i.addEventListener("mouseup",e.onMouseUp),i.addEventListener("mouseleave",e.onMouseUp),i.addEventListener("touchmove",e.onMouseMove),i.addEventListener("touchend",e.onMouseUp),i.addEventListener("touchcancel",e.onMouseUp)}},e.onMouseMove=function(t){var r=e.cfg.width,n=[e.get("start"),e.get("end")];t.stopPropagation(),t.preventDefault();var i=(0,Ux.get)(t,"touches.0.pageX",t.pageX),o=(0,Ux.get)(t,"touches.0.pageY",t.pageY),a=i-e.prevX,s=e.adjustOffsetRange(a/r);e.updateStartEnd(s),e.updateUI(e.getElementByLocalId("foreground"),e.getElementByLocalId("minText"),e.getElementByLocalId("maxText")),e.prevX=i,e.prevY=o,e.draw(),e.emit(RB,[e.get("start"),e.get("end")].sort()),e.delegateEmit("valuechanged",{originValue:n,value:[e.get("start"),e.get("end")]})},e.onMouseUp=function(){e.currentTarget&&(e.currentTarget=void 0);var t=e.getContainerDOM();t&&(t.removeEventListener("mousemove",e.onMouseMove),t.removeEventListener("mouseup",e.onMouseUp),t.removeEventListener("mouseleave",e.onMouseUp),t.removeEventListener("touchmove",e.onMouseMove),t.removeEventListener("touchend",e.onMouseUp),t.removeEventListener("touchcancel",e.onMouseUp))},e}return(0,Gx.__extends)(e,t),e.prototype.setRange=function(t,e){this.set("minLimit",t),this.set("maxLimit",e);var r=this.get("start"),n=this.get("end"),i=(0,Ux.clamp)(r,t,e),o=(0,Ux.clamp)(n,t,e);this.get("isInit")||r===i&&n===o||this.setValue([i,o])},e.prototype.getRange=function(){return{min:this.get("minLimit")||0,max:this.get("maxLimit")||1}},e.prototype.setValue=function(t){var e=this.getRange();if((0,Ux.isArray)(t)&&2===t.length){var r=[this.get("start"),this.get("end")];this.update({start:(0,Ux.clamp)(t[0],e.min,e.max),end:(0,Ux.clamp)(t[1],e.min,e.max)}),this.get("updateAutoRender")||this.render(),this.delegateEmit("valuechanged",{originValue:r,value:t})}},e.prototype.getValue=function(){return[this.get("start"),this.get("end")]},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{name:"slider",x:0,y:0,width:100,height:16,backgroundStyle:{},foregroundStyle:{},handlerStyle:{},textStyle:{},defaultCfg:{backgroundStyle:PB,foregroundStyle:LB,handlerStyle:NB,textStyle:jB}})},e.prototype.update=function(e){var r=e.start,n=e.end,i=(0,Gx.__assign)({},e);(0,Ux.isNil)(r)||(i.start=(0,Ux.clamp)(r,0,1)),(0,Ux.isNil)(n)||(i.end=(0,Ux.clamp)(n,0,1)),t.prototype.update.call(this,i),this.minHandler=this.getChildComponentById(this.getElementId("minHandler")),this.maxHandler=this.getChildComponentById(this.getElementId("maxHandler")),this.trend=this.getChildComponentById(this.getElementId("trend"))},e.prototype.init=function(){this.set("start",(0,Ux.clamp)(this.get("start"),0,1)),this.set("end",(0,Ux.clamp)(this.get("end"),0,1)),t.prototype.init.call(this)},e.prototype.render=function(){t.prototype.render.call(this),this.updateUI(this.getElementByLocalId("foreground"),this.getElementByLocalId("minText"),this.getElementByLocalId("maxText"))},e.prototype.renderInner=function(t){var e=this.cfg,r=(e.start,e.end,e.width),n=e.height,i=e.trendCfg,o=void 0===i?{}:i,a=e.minText,s=e.maxText,u=e.backgroundStyle,l=void 0===u?{}:u,c=e.foregroundStyle,f=void 0===c?{}:c,h=e.textStyle,p=void 0===h?{}:h,d=(0,Ux.deepMix)({},OB,this.cfg.handlerStyle);(0,Ux.size)((0,Ux.get)(o,"data"))&&(this.trend=this.addComponent(t,(0,Gx.__assign)({component:TB,id:this.getElementId("trend"),x:0,y:0,width:r,height:n},o))),this.addShape(t,{id:this.getElementId("background"),type:"rect",attrs:(0,Gx.__assign)({x:0,y:0,width:r,height:n},l)});this.addShape(t,{id:this.getElementId("minText"),type:"text",attrs:(0,Gx.__assign)({y:n/2,textAlign:"right",text:a,silent:!1},p)}),this.addShape(t,{id:this.getElementId("maxText"),type:"text",attrs:(0,Gx.__assign)({y:n/2,textAlign:"left",text:s,silent:!1},p)}),this.addShape(t,{id:this.getElementId("foreground"),name:"foreground",type:"rect",attrs:(0,Gx.__assign)({y:0,height:n},f)});var y=(0,Ux.get)(d,"width",10),g=(0,Ux.get)(d,"height",24);this.minHandler=this.addComponent(t,{component:MB,id:this.getElementId("minHandler"),name:"handler-min",x:0,y:(n-g)/2,width:y,height:g,cursor:"ew-resize",style:d}),this.maxHandler=this.addComponent(t,{component:MB,id:this.getElementId("maxHandler"),name:"handler-max",x:0,y:(n-g)/2,width:y,height:g,cursor:"ew-resize",style:d})},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.updateUI=function(t,e,r){var n=this.cfg,i=n.start,o=n.end,a=n.width,s=n.minText,u=n.maxText,l=n.handlerStyle,c=n.height,f=i*a,h=o*a;this.trend&&(this.trend.update({width:a,height:c}),this.get("updateAutoRender")||this.trend.render()),t.attr("x",f),t.attr("width",h-f);var p=(0,Ux.get)(l,"width",10);e.attr("text",s),r.attr("text",u);var d=this._dodgeText([f,h],e,r),y=d[0],g=d[1];this.minHandler&&(this.minHandler.update({x:f-p/2}),this.get("updateAutoRender")||this.minHandler.render()),(0,Ux.each)(y,function(t,r){return e.attr(r,t)}),this.maxHandler&&(this.maxHandler.update({x:h-p/2}),this.get("updateAutoRender")||this.maxHandler.render()),(0,Ux.each)(g,function(t,e){return r.attr(e,t)})},e.prototype.bindEvents=function(){var t=this.get("group");t.on("handler-min:mousedown",this.onMouseDown("minHandler")),t.on("handler-min:touchstart",this.onMouseDown("minHandler")),t.on("handler-max:mousedown",this.onMouseDown("maxHandler")),t.on("handler-max:touchstart",this.onMouseDown("maxHandler"));var e=t.findById(this.getElementId("foreground"));e.on("mousedown",this.onMouseDown("foreground")),e.on("touchstart",this.onMouseDown("foreground"))},e.prototype.adjustOffsetRange=function(t){var e=this.cfg,r=e.start,n=e.end;switch(this.currentTarget){case"minHandler":var i=0-r,o=1-r;return Math.min(o,Math.max(i,t));case"maxHandler":i=0-n,o=1-n;return Math.min(o,Math.max(i,t));case"foreground":i=0-r,o=1-n;return Math.min(o,Math.max(i,t))}},e.prototype.updateStartEnd=function(t){var e=this.cfg,r=e.start,n=e.end;switch(this.currentTarget){case"minHandler":r+=t;break;case"maxHandler":n+=t;break;case"foreground":r+=t,n+=t}this.set("start",r),this.set("end",n)},e.prototype._dodgeText=function(t,e,r){var n,i,o=this.cfg,a=o.handlerStyle,s=o.width,u=(0,Ux.get)(a,"width",10),l=t[0],c=t[1],f=!1;l>c&&(l=(n=[c,l])[0],c=n[1],e=(i=[r,e])[0],r=i[1],f=!0);var h=e.getBBox(),p=r.getBBox(),d=h.width>l-2?{x:l+u/2+2,textAlign:"left"}:{x:l-u/2-2,textAlign:"right"},y=p.width>s-c-2?{x:c-u/2-2,textAlign:"right"}:{x:c+u/2+2,textAlign:"left"};return f?[y,d]:[d,y]},e.prototype.draw=function(){var t=this.get("container"),e=t&&t.get("canvas");e&&e.draw()},e.prototype.getContainerDOM=function(){var t=this.get("container"),e=t&&t.get("canvas");return e&&e.get("container")},e}(nD),BB={default:{trackColor:"rgba(0,0,0,0)",thumbColor:"rgba(0,0,0,0.15)",size:8,lineCap:"round"},hover:{thumbColor:"rgba(0,0,0,0.2)"}},FB=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.clearEvents=Ux.noop,e.onStartEvent=function(t){return function(r){e.isMobile=t,r.originalEvent.preventDefault();var n=t?(0,Ux.get)(r.originalEvent,"touches.0.clientX"):r.clientX,i=t?(0,Ux.get)(r.originalEvent,"touches.0.clientY"):r.clientY;e.startPos=e.cfg.isHorizontal?n:i,e.bindLaterEvent()}},e.bindLaterEvent=function(){var t=e.getContainerDOM(),r=[];r=e.isMobile?[cT(t,"touchmove",e.onMouseMove),cT(t,"touchend",e.onMouseUp),cT(t,"touchcancel",e.onMouseUp)]:[cT(t,"mousemove",e.onMouseMove),cT(t,"mouseup",e.onMouseUp),cT(t,"mouseleave",e.onMouseUp)],e.clearEvents=function(){r.forEach(function(t){t.remove()})}},e.onMouseMove=function(t){var r=e.cfg,n=r.isHorizontal,i=r.thumbOffset;t.preventDefault();var o=e.isMobile?(0,Ux.get)(t,"touches.0.clientX"):t.clientX,a=e.isMobile?(0,Ux.get)(t,"touches.0.clientY"):t.clientY,s=n?o:a,u=s-e.startPos;e.startPos=s,e.updateThumbOffset(i+u)},e.onMouseUp=function(t){t.preventDefault(),e.clearEvents()},e.onTrackClick=function(t){var r=e.cfg,n=r.isHorizontal,i=r.x,o=r.y,a=r.thumbLen,s=e.getContainerDOM().getBoundingClientRect(),u=t.clientX,l=t.clientY,c=n?u-s.left-i-a/2:l-s.top-o-a/2,f=e.validateRange(c);e.updateThumbOffset(f)},e.onThumbMouseOver=function(){var t=e.cfg.theme.hover.thumbColor;e.getElementByLocalId("thumb").attr("stroke",t),e.draw()},e.onThumbMouseOut=function(){var t=e.cfg.theme.default.thumbColor;e.getElementByLocalId("thumb").attr("stroke",t),e.draw()},e}return(0,Gx.__extends)(e,t),e.prototype.setRange=function(t,e){this.set("minLimit",t),this.set("maxLimit",e);var r=this.getValue(),n=(0,Ux.clamp)(r,t,e);r===n||this.get("isInit")||this.setValue(n)},e.prototype.getRange=function(){return{min:this.get("minLimit")||0,max:this.get("maxLimit")||1}},e.prototype.setValue=function(t){var e=this.getRange(),r=this.getValue();this.update({thumbOffset:(this.get("trackLen")-this.get("thumbLen"))*(0,Ux.clamp)(t,e.min,e.max)}),this.delegateEmit("valuechange",{originalValue:r,value:this.getValue()})},e.prototype.getValue=function(){return(0,Ux.clamp)(this.get("thumbOffset")/(this.get("trackLen")-this.get("thumbLen")),0,1)},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gx.__assign)((0,Gx.__assign)({},e),{name:"scrollbar",isHorizontal:!0,minThumbLen:20,thumbOffset:0,theme:BB})},e.prototype.renderInner=function(t){this.renderTrackShape(t),this.renderThumbShape(t)},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.renderTrackShape=function(t){var e=this.cfg,r=e.trackLen,n=e.theme,i=void 0===n?{default:{}}:n,o=(0,Ux.deepMix)({},BB,i).default,a=o.lineCap,s=o.trackColor,u=o.size,l=(0,Ux.get)(this.cfg,"size",u),c=this.get("isHorizontal")?{x1:0+l/2,y1:l/2,x2:r-l/2,y2:l/2,lineWidth:l,stroke:s,lineCap:a}:{x1:l/2,y1:0+l/2,x2:l/2,y2:r-l/2,lineWidth:l,stroke:s,lineCap:a};return this.addShape(t,{id:this.getElementId("track"),name:"track",type:"line",attrs:c})},e.prototype.renderThumbShape=function(t){var e=this.cfg,r=e.thumbOffset,n=e.thumbLen,i=e.theme,o=(0,Ux.deepMix)({},BB,i).default,a=o.size,s=o.lineCap,u=o.thumbColor,l=(0,Ux.get)(this.cfg,"size",a),c=this.get("isHorizontal")?{x1:r+l/2,y1:l/2,x2:r+n-l/2,y2:l/2,lineWidth:l,stroke:u,lineCap:s,cursor:"default"}:{x1:l/2,y1:r+l/2,x2:l/2,y2:r+n-l/2,lineWidth:l,stroke:u,lineCap:s,cursor:"default"};return this.addShape(t,{id:this.getElementId("thumb"),name:"thumb",type:"line",attrs:c})},e.prototype.bindEvents=function(){var t=this.get("group");t.on("mousedown",this.onStartEvent(!1)),t.on("mouseup",this.onMouseUp),t.on("touchstart",this.onStartEvent(!0)),t.on("touchend",this.onMouseUp),t.findById(this.getElementId("track")).on("click",this.onTrackClick);var e=t.findById(this.getElementId("thumb"));e.on("mouseover",this.onThumbMouseOver),e.on("mouseout",this.onThumbMouseOut)},e.prototype.getContainerDOM=function(){var t=this.get("container"),e=t&&t.get("canvas");return e&&e.get("container")},e.prototype.validateRange=function(t){var e=this.cfg,r=e.thumbLen,n=e.trackLen,i=t;return t+r>n?i=n-r:t+rt.x?t.x:e,r=rt.y?t.y:n,i=i=n&&t<=i}function rF(t,e){return"object"===tF(t)&&e.forEach(function(e){delete t[e]}),t}function nF(t,e,r){var n,i;void 0===e&&(e=[]),void 0===r&&(r=new Map);try{for(var o=(0,Gx.__values)(t),a=o.next();!a.done;a=o.next()){var s=a.value;r.has(s)||(e.push(s),r.set(s,!0))}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return e}var iF=function(){function t(t,e,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),this.x=t,this.y=e,this.height=n,this.width=r}return t.fromRange=function(e,r,n,i){return new t(e,r,n-e,i-r)},t.fromObject=function(e){return new t(e.minX,e.minY,e.width,e.height)},Object.defineProperty(t.prototype,"minX",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxX",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minY",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxY",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tl",{get:function(){return{x:this.x,y:this.y}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tr",{get:function(){return{x:this.maxX,y:this.y}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bl",{get:function(){return{x:this.x,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"br",{get:function(){return{x:this.maxX,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return{x:this.x+this.width/2,y:this.minY}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return{x:this.maxX,y:this.y+this.height/2}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return{x:this.x+this.width/2,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return{x:this.minX,y:this.y+this.height/2}},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height},t.prototype.contains=function(t){return t.minX>=this.minX&&t.maxX<=this.maxX&&t.minY>=this.minY&&t.maxY<=this.maxY},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.add=function(){for(var t=[],e=0;et.minX&&this.minYt.minY},t.prototype.size=function(){return this.width*this.height},t.prototype.isPointIn=function(t){return t.x>=this.minX&&t.x<=this.maxX&&t.y>=this.minY&&t.y<=this.maxY},t}();function oF(t){if(t.isPolar&&!t.isTransposed)return(t.endAngle-t.startAngle)*t.getRadius();var e=t.convert({x:0,y:0}),r=t.convert({x:1,y:0});return Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2))}function aF(t,e){var r=t.getCenter();return Math.sqrt(Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2))}function sF(t,e){var r=t.getCenter();return Math.atan2(e.y-r.y,e.x-r.x)}function uF(t,e){void 0===e&&(e=0);var r,n=t.start,i=t.end,o=t.getWidth(),a=t.getHeight();if(t.isPolar){var s=t.startAngle,u=t.endAngle,l=t.getCenter(),c=t.getRadius();return{type:"path",startState:{path:KB(l.x,l.y,c+e,s,s)},endState:function(t){var r=(u-s)*t+s;return{path:KB(l.x,l.y,c+e,s,r)}},attrs:{path:KB(l.x,l.y,c+e,s,u)}}}return r=t.isTransposed?{height:a+2*e}:{width:o+2*e},{type:"rect",startState:{x:n.x-e,y:i.y-e,width:t.isTransposed?o+2*e:0,height:t.isTransposed?0:a+2*e},endState:r,attrs:{x:n.x-e,y:i.y-e,width:o+2*e,height:a+2*e}}}var lF=/^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]+)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/;function cF(t,e,r,n){return void 0===e&&(e={}),e.type?e.type:"identity"!==t.type&&Fj.includes(r)&&["interval"].includes(n)?"cat":t.isCategory?"cat":t.type}function fF(t,e,r){var n=e||[];if((0,Ux.isNumber)(t)||(0,Ux.isNil)((0,Ux.firstValue)(n,t))&&(0,Ux.isEmpty)(r))return new(QM("identity"))({field:t.toString(),values:[t]});var i=(0,Ux.valuesOfKey)(n,t);return new(QM((0,Ux.get)(r,"type",function(t){var e="linear";return lF.test(t)?e="timeCat":(0,Ux.isString)(t)&&(e="cat"),e}(i[0]))))((0,Gx.__assign)({field:t,values:i},r))}function hF(t){return t.alias||t.field}function pF(t,e,r){var n,i=t.values.length;if(1===i)n=[.5,1];else{var o=0;n=function(t){if(t.isPolar){var e=t.startAngle;return t.endAngle-e==2*Math.PI}return!1}(e)?e.isTransposed?[(o=1/i*(0,Ux.get)(r,"widthRatio.multiplePie",1/1.3))/2,1-o/2]:[0,1-1/i]:[o=1/i/2,1-o]}return n}function dF(t,e){var r={start:{x:0,y:0},end:{x:0,y:0}};t.isRect?r=function(t){var e,r;switch(t){case Mj.TOP:e={x:0,y:1},r={x:1,y:1};break;case Mj.RIGHT:e={x:1,y:0},r={x:1,y:1};break;case Mj.BOTTOM:e={x:0,y:0},r={x:1,y:0};break;case Mj.LEFT:e={x:0,y:0},r={x:0,y:1};break;default:e=r={x:0,y:0}}return{start:e,end:r}}(e):t.isPolar&&(r=function(t){var e,r;return t.isTransposed?(e={x:0,y:0},r={x:1,y:0}):(e={x:0,y:0},r={x:0,y:1}),{start:e,end:r}}(t));var n=r.start,i=r.end;return{start:t.convert(n),end:t.convert(i)}}function yF(t){var e=t.start,r=t.end;return e.x===r.x}function gF(t,e){var r=t.start,n=t.end;return yF(t)?(r.y-n.y)*(e.x-r.x)>0?1:-1:(n.x-r.x)*(r.y-e.y)>0?-1:1}function vF(t,e){var r=(0,Ux.get)(t,["components","axis"],{});return(0,Ux.deepMix)({},(0,Ux.get)(r,["common"],{}),(0,Ux.deepMix)({},(0,Ux.get)(r,[e],{})))}function mF(t,e,r){var n=(0,Ux.get)(t,["components","axis"],{});return(0,Ux.deepMix)({},(0,Ux.get)(n,["common","title"],{}),(0,Ux.deepMix)({},(0,Ux.get)(n,[e,"title"],{})),r)}function bF(t){var e=t.x,r=t.y,n=t.circleCenter,i=r.start>r.end,o=t.isTransposed?t.convert({x:i?0:1,y:0}):t.convert({x:0,y:i?0:1}),a=[o.x-n.x,o.y-n.y],s=[1,0],u=o.y>n.y?g_.angle(a,s):-1*g_.angle(a,s),l=u+(e.end-e.start);return{center:n,radius:Math.sqrt(Math.pow(o.x-n.x,2)+Math.pow(o.y-n.y,2)),startAngle:u,endAngle:l}}function AF(t,e){return(0,Ux.isBoolean)(t)?!1!==t&&{}:(0,Ux.get)(t,[e])}function xF(t,e){return(0,Ux.get)(t,"position",e)}function wF(t,e){return(0,Ux.get)(e,["title","text"],hF(t))}var _F=function(){function t(t,e){this.destroyed=!1,this.facets=[],this.view=t,this.cfg=(0,Ux.deepMix)({},this.getDefaultCfg(),e)}return t.prototype.init=function(){this.container||(this.container=this.createContainer());var t=this.view.getData();this.facets=this.generateFacets(t)},t.prototype.render=function(){this.renderViews()},t.prototype.update=function(){},t.prototype.clear=function(){this.clearFacetViews()},t.prototype.destroy=function(){this.clear(),this.container&&(this.container.remove(!0),this.container=void 0),this.destroyed=!0,this.view=void 0,this.facets=[]},t.prototype.facetToView=function(t){var e=t.region,r=t.data,n=t.padding,i=void 0===n?this.cfg.padding:n,o=this.view.createView({region:e,padding:i});o.data(r||[]),t.view=o,this.beforeEachView(o,t);var a=this.cfg.eachView;return a&&a(o,t),this.afterEachView(o,t),o},t.prototype.createContainer=function(){return this.view.getLayer(Oj.FORE).addGroup()},t.prototype.renderViews=function(){this.createFacetViews()},t.prototype.createFacetViews=function(){var t=this;return this.facets.map(function(e){return t.facetToView(e)})},t.prototype.clearFacetViews=function(){var t=this;(0,Ux.each)(this.facets,function(e){e.view&&(t.view.removeView(e.view),e.view=void 0)})},t.prototype.parseSpacing=function(){var t=this.view.viewBBox,e=t.width,r=t.height;return this.cfg.spacing.map(function(t,n){return(0,Ux.isNumber)(t)?t/(0===n?e:r):parseFloat(t)/100})},t.prototype.getFieldValues=function(t,e){var r=[],n={};return(0,Ux.each)(t,function(t){var i=t[e];(0,Ux.isNil)(i)||n[i]||(r.push(i),n[i]=!0)}),r},t.prototype.getRegion=function(t,e,r,n){var i=(0,Gx.__read)(this.parseSpacing(),2),o=i[0],a=i[1],s=(1+o)/(0===e?1:e)-o,u=(1+a)/(0===t?1:t)-a,l={x:(s+o)*r,y:(u+a)*n};return{start:l,end:{x:l.x+s,y:l.y+u}}},t.prototype.getDefaultCfg=function(){return{eachView:void 0,showTitle:!0,spacing:[0,0],padding:10,fields:[]}},t.prototype.getDefaultTitleCfg=function(){return{style:{fontSize:14,fill:"#666",fontFamily:this.view.getTheme().fontFamily}}},t.prototype.processAxis=function(t,e){var r=t.getOptions(),n=r.coordinate,i=t.geometries;if("rect"===(0,Ux.get)(n,"type","rect")&&i.length){(0,Ux.isNil)(r.axes)&&(r.axes={});var o=r.axes,a=(0,Gx.__read)(i[0].getXYFields(),2),s=a[0],u=a[1],l=AF(o,s),c=AF(o,u);!1!==l&&(r.axes[s]=this.getXAxisOption(s,o,l,e)),!1!==c&&(r.axes[u]=this.getYAxisOption(u,o,c,e))}},t.prototype.getFacetDataFilter=function(t){return function(e){return(0,Ux.every)(t,function(t){var r=t.field,n=t.value;return!(!(0,Ux.isNil)(n)&&r)||e[r]===n})}},t}(),SF={},EF=function(t){return SF[(0,Ux.lowerCase)(t)]},CF=function(t,e){SF[(0,Ux.lowerCase)(t)]=e},kF=function(){function t(t,e){this.context=t,this.cfg=e,t.addAction(this)}return t.prototype.applyCfg=function(t){(0,Ux.assign)(this,t)},t.prototype.init=function(){this.applyCfg(this.cfg)},t.prototype.destroy=function(){this.context.removeAction(this),this.context=null},t}(),IF=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.execute=function(){this.callback&&this.callback(this.context)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.callback=null},e}(kF),TF={};function OF(t){var e=TF[t];return(0,Ux.get)(e,"ActionClass")}function MF(t,e,r){TF[t]={ActionClass:e,cfg:r}}function PF(t,e){for(var r=[t[0]],n=1,i=t.length;n=a[l]?1:0,h=c>Math.PI?1:0,p=r.convert(s),d=aF(r,p);if(d>=.5)if(c===2*Math.PI){var y={x:(s.x+a.x)/2,y:(s.y+a.y)/2},g=r.convert(y);u.push(["A",d,d,0,h,f,g.x,g.y]),u.push(["A",d,d,0,h,f,p.x,p.y])}else u.push(["A",d,d,0,h,f,p.x,p.y]);return u}(r,n,t)):o.push(PF(a,t));break;case"a":o.push(LF(a,t));break;case"z":default:o.push(a)}}),function(t){(0,Ux.each)(t,function(e,r){if("a"===e[0].toLowerCase()){var n=t[r-1],i=t[r+1];i&&"a"===i[0].toLowerCase()?n&&"l"===n[0].toLowerCase()&&(n[0]="M"):n&&"a"===n[0].toLowerCase()&&i&&"l"===i[0].toLowerCase()&&(i[0]="M")}})}(o),o}function FF(t,e){return GF(t.event.target,e)}function zF(t,e){var r=t.getCanvasBBox(),n=r.width,i=r.height;return n>0&&i>0&&(n>=e||i>=e)}function GF(t,e){var r=t.getCanvasBBox();return zF(t,e)?r:null}function UF(t,e){return t.event.maskShapes.map(function(t){return GF(t,e)}).filter(function(t){return!!t})}function HF(t,e){return zF(t,e)?t.attr("path"):null}function VF(t){var e,r=t.event.target;return r&&(e=r.get("element")),e}function QF(t){var e,r=t.event.target;return r&&(e=r.get("delegateObject")),e}function YF(t){var e=t.event.gEvent;return!(e&&e.fromShape&&e.toShape&&e.fromShape.get("element")===e.toShape.get("element"))}function WF(t){return t&&t.component&&t.component.isList()}function qF(t){return t&&t.component&&t.component.isSlider()}function XF(t){var e=t.event.target;return e&&"mask"===(null===e||void 0===e?void 0:e.get("name"))||KF(t)}function KF(t){var e;return"multi-mask"===(null===(e=t.event.target)||void 0===e?void 0:e.get("name"))}function JF(t,e){var r=t.event.target;if(KF(t))return function(t,e){if("path"===t.event.target.get("type")){var r=function(t,e){return t.event.maskShapes.map(function(t){return HF(t,e)})}(t,e);return r.length>0?r.flatMap(function(e){return oz(t.view,e)}):null}var n=UF(t,e);if(n.length>0)return n.flatMap(function(e){return nz(t.view,e)});return null}(t,e);if("path"===r.get("type")){var n=function(t,e){return HF(t.event.target,e)}(t,e);if(!n)return;return oz(t.view,n)}var i=FF(t,e);return i?nz(t.view,i):null}function ZF(t,e,r){if(KF(t))return function(t,e,r){var n=UF(t,r);if(n.length>0)return n.flatMap(function(r){return $F(r,t,e)});return null}(t,e,r);var n=FF(t,r);return n?$F(n,t,e):null}function $F(t,e,r){var n=e.view,i=cz(n,r,{x:t.x,y:t.y}),o=cz(n,r,{x:t.maxX,y:t.maxY});return nz(r,{minX:i.x,minY:i.y,maxX:o.x,maxY:o.y})}function tz(t){var e=t.geometries,r=[];return(0,Ux.each)(e,function(t){var e=t.elements;r=r.concat(e)}),t.views&&t.views.length&&(0,Ux.each)(t.views,function(t){r=r.concat(tz(t))}),r}function ez(t,e){var r=t.geometries,n=[];return(0,Ux.each)(r,function(t){var r=t.getElementsBy(function(t){return t.hasState(e)});n=n.concat(r)}),n}function rz(t,e){var r=t.getModel().data;return(0,Ux.isArray)(r)?r[0][e]:r[e]}function nz(t,e){var r=tz(t),n=[];return(0,Ux.each)(r,function(t){var r,i,o=t.shape.getCanvasBBox();r=e,(i=o).minX>r.maxX||i.maxXr.maxY||i.maxY=e.x&&t.y<=e.y&&t.maxY>e.y}function lz(t){var e=t.parent,r=null;return e&&(r=e.views.filter(function(e){return e!==t})),r}function cz(t,e,r){var n=function(t,e){return t.getCoordinate().invert(e)}(t,r);return e.getCoordinate().convert(n)}function fz(t,e,r,n){var i=!1;return(0,Ux.each)(t,function(t){if(t[r]===e[r]&&t[n]===e[n])return i=!0,!1}),i}function hz(t,e){var r=t.getScaleByField(e);return!r&&t.views&&(0,Ux.each)(t.views,function(t){if(r=hz(t,e))return!1}),r}var pz=function(){function t(t){this.actions=[],this.event=null,this.cacheMap={},this.view=t}return t.prototype.cache=function(){for(var t=[],e=0;e=0&&e.splice(r,1)},t.prototype.getCurrentPoint=function(){var t=this.event;return t?t.target instanceof HTMLElement?this.view.getCanvas().getPointByClient(t.clientX,t.clientY):{x:t.x,y:t.y}:null},t.prototype.getCurrentShape=function(){return(0,Ux.get)(this.event,["gEvent","shape"])},t.prototype.isInPlot=function(){var t=this.getCurrentPoint();return!!t&&this.view.isPointInPlot(t)},t.prototype.isInShape=function(t){var e=this.getCurrentShape();return!!e&&e.get("name")===t},t.prototype.isInComponent=function(t){var e=az(this.view),r=this.getCurrentPoint();return!!r&&!!e.find(function(e){var n=e.getBBox();return t?e.get("name")===t&&uz(n,r):uz(n,r)})},t.prototype.destroy=function(){(0,Ux.each)(this.actions.slice(),function(t){t.destroy()}),this.view=null,this.event=null,this.actions=null,this.cacheMap=null},t}(),dz=function(){function t(t,e){this.view=t,this.cfg=e}return t.prototype.init=function(){this.initEvents()},t.prototype.initEvents=function(){},t.prototype.clearEvents=function(){},t.prototype.destroy=function(){this.clearEvents()},t}();function yz(t,e,r){var n=t.split(":"),i=n[0],o=e.getAction(i)||function(t,e){var r=TF[t],n=null;return r&&((n=new(0,r.ActionClass)(e,r.cfg)).name=t,n.init()),n}(i,e);if(!o)throw new Error("There is no action named ".concat(i));return{action:o,methodName:n[1],arg:r}}function gz(t){var e=t.action,r=t.methodName,n=t.arg;if(!e[r])throw new Error("Action(".concat(e.name,") doesn't have a method called ").concat(r));e[r](n)}var vz="start",mz="showEnable",bz="end",Az="rollback",xz="processing",wz=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.callbackCaches={},n.emitCaches={},n.steps=r,n}return(0,Gx.__extends)(e,t),e.prototype.init=function(){this.initContext(),t.prototype.init.call(this)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.steps=null,this.context&&(this.context.destroy(),this.context=null),this.callbackCaches=null,this.view=null},e.prototype.initEvents=function(){var t=this;(0,Ux.each)(this.steps,function(e,r){(0,Ux.each)(e,function(e){var n=t.getActionCallback(r,e);n&&t.bindEvent(e.trigger,n)})})},e.prototype.clearEvents=function(){var t=this;(0,Ux.each)(this.steps,function(e,r){(0,Ux.each)(e,function(e){var n=t.getActionCallback(r,e);n&&t.offEvent(e.trigger,n)})})},e.prototype.initContext=function(){var t=this.view,e=new pz(t);this.context=e;var r=this.steps;(0,Ux.each)(r,function(t){(0,Ux.each)(t,function(t){if((0,Ux.isFunction)(t.action))t.actionObject={action:function(t,e){var r=new IF(e);return r.callback=t,r.name="callback",r}(t.action,e),methodName:"execute"};else if((0,Ux.isString)(t.action))t.actionObject=yz(t.action,e,t.arg);else if((0,Ux.isArray)(t.action)){var r=t.action,n=(0,Ux.isArray)(t.arg)?t.arg:[t.arg];t.actionObject=[],(0,Ux.each)(r,function(r,i){t.actionObject.push(yz(r,e,n[i]))})}})})},e.prototype.isAllowStep=function(t){var e=this.currentStepName,r=this.steps;if(e===t)return!0;if(t===mz)return!0;if(t===xz)return e===vz;if(t===vz)return e!==xz;if(t===bz)return e===xz||e===vz;if(t===Az){if(r[bz])return e===bz;if(e===vz)return!0}return!1},e.prototype.isAllowExecute=function(t,e){if(this.isAllowStep(t)){var r=this.getKey(t,e);return(!e.once||!this.emitCaches[r])&&(!e.isEnable||e.isEnable(this.context))}return!1},e.prototype.enterStep=function(t){this.currentStepName=t,this.emitCaches={}},e.prototype.afterExecute=function(t,e){t!==mz&&this.currentStepName!==t&&this.enterStep(t);var r=this.getKey(t,e);this.emitCaches[r]=!0},e.prototype.getKey=function(t,e){return t+e.trigger+e.action},e.prototype.getActionCallback=function(t,e){var r=this,n=this.context,i=this.callbackCaches,o=e.actionObject;if(e.action&&o){var a=this.getKey(t,e);if(!i[a]){var s=function(i){n.event=i,r.isAllowExecute(t,e)?((0,Ux.isArray)(o)?(0,Ux.each)(o,function(t){n.event=i,gz(t)}):(n.event=i,gz(o)),r.afterExecute(t,e),e.callback&&(n.event=i,e.callback(n))):n.event=null};e.debounce?i[a]=(0,Ux.debounce)(s,e.debounce.wait,e.debounce.immediate):e.throttle?i[a]=(0,Ux.throttle)(s,e.throttle.wait,{leading:e.throttle.leading,trailing:e.throttle.trailing}):i[a]=s}return i[a]}return null},e.prototype.bindEvent=function(t,e){var r=t.split(":");"window"===r[0]?window.addEventListener(r[1],e):"document"===r[0]?document.addEventListener(r[1],e):this.view.on(t,e)},e.prototype.offEvent=function(t,e){var r=t.split(":");"window"===r[0]?window.removeEventListener(r[1],e):"document"===r[0]?document.removeEventListener(r[1],e):this.view.off(t,e)},e}(dz),_z={};function Sz(t){return _z[(0,Ux.lowerCase)(t)]}function Ez(t,e){_z[(0,Ux.lowerCase)(t)]=e}function Cz(t){var e,r={point:{default:{fill:t.pointFillColor,r:t.pointSize,stroke:t.pointBorderColor,lineWidth:t.pointBorder,fillOpacity:t.pointFillOpacity},active:{stroke:t.pointActiveBorderColor,lineWidth:t.pointActiveBorder},selected:{stroke:t.pointSelectedBorderColor,lineWidth:t.pointSelectedBorder},inactive:{fillOpacity:t.pointInactiveFillOpacity,strokeOpacity:t.pointInactiveBorderOpacity}},hollowPoint:{default:{fill:t.hollowPointFillColor,lineWidth:t.hollowPointBorder,stroke:t.hollowPointBorderColor,strokeOpacity:t.hollowPointBorderOpacity,r:t.hollowPointSize},active:{stroke:t.hollowPointActiveBorderColor,strokeOpacity:t.hollowPointActiveBorderOpacity},selected:{lineWidth:t.hollowPointSelectedBorder,stroke:t.hollowPointSelectedBorderColor,strokeOpacity:t.hollowPointSelectedBorderOpacity},inactive:{strokeOpacity:t.hollowPointInactiveBorderOpacity}},area:{default:{fill:t.areaFillColor,fillOpacity:t.areaFillOpacity,stroke:null},active:{fillOpacity:t.areaActiveFillOpacity},selected:{fillOpacity:t.areaSelectedFillOpacity},inactive:{fillOpacity:t.areaInactiveFillOpacity}},hollowArea:{default:{fill:null,stroke:t.hollowAreaBorderColor,lineWidth:t.hollowAreaBorder,strokeOpacity:t.hollowAreaBorderOpacity},active:{fill:null,lineWidth:t.hollowAreaActiveBorder},selected:{fill:null,lineWidth:t.hollowAreaSelectedBorder},inactive:{strokeOpacity:t.hollowAreaInactiveBorderOpacity}},interval:{default:{fill:t.intervalFillColor,fillOpacity:t.intervalFillOpacity},active:{stroke:t.intervalActiveBorderColor,lineWidth:t.intervalActiveBorder},selected:{stroke:t.intervalSelectedBorderColor,lineWidth:t.intervalSelectedBorder},inactive:{fillOpacity:t.intervalInactiveFillOpacity,strokeOpacity:t.intervalInactiveBorderOpacity}},hollowInterval:{default:{fill:t.hollowIntervalFillColor,stroke:t.hollowIntervalBorderColor,lineWidth:t.hollowIntervalBorder,strokeOpacity:t.hollowIntervalBorderOpacity},active:{stroke:t.hollowIntervalActiveBorderColor,lineWidth:t.hollowIntervalActiveBorder,strokeOpacity:t.hollowIntervalActiveBorderOpacity},selected:{stroke:t.hollowIntervalSelectedBorderColor,lineWidth:t.hollowIntervalSelectedBorder,strokeOpacity:t.hollowIntervalSelectedBorderOpacity},inactive:{stroke:t.hollowIntervalInactiveBorderColor,lineWidth:t.hollowIntervalInactiveBorder,strokeOpacity:t.hollowIntervalInactiveBorderOpacity}},line:{default:{stroke:t.lineBorderColor,lineWidth:t.lineBorder,strokeOpacity:t.lineBorderOpacity,fill:null,lineAppendWidth:10,lineCap:"round",lineJoin:"round"},active:{lineWidth:t.lineActiveBorder},selected:{lineWidth:t.lineSelectedBorder},inactive:{strokeOpacity:t.lineInactiveBorderOpacity}}},n=function(t){return{title:{autoRotate:!0,position:"center",spacing:t.axisTitleSpacing,style:{fill:t.axisTitleTextFillColor,fontSize:t.axisTitleTextFontSize,lineHeight:t.axisTitleTextLineHeight,textBaseline:"middle",fontFamily:t.fontFamily},iconStyle:{fill:t.axisDescriptionIconFillColor}},label:{autoRotate:!1,autoEllipsis:!1,autoHide:{type:"equidistance",cfg:{minGap:6}},offset:t.axisLabelOffset,style:{fill:t.axisLabelFillColor,fontSize:t.axisLabelFontSize,lineHeight:t.axisLabelLineHeight,fontFamily:t.fontFamily}},line:{style:{lineWidth:t.axisLineBorder,stroke:t.axisLineBorderColor}},grid:{line:{type:"line",style:{stroke:t.axisGridBorderColor,lineWidth:t.axisGridBorder,lineDash:t.axisGridLineDash}},alignTick:!0,animate:!0},tickLine:{style:{lineWidth:t.axisTickLineBorder,stroke:t.axisTickLineBorderColor},alignTick:!0,length:t.axisTickLineLength},subTickLine:null,animate:!0}}(t),i=function(t){return{title:null,marker:{symbol:"circle",spacing:t.legendMarkerSpacing,style:{r:t.legendCircleMarkerSize,fill:t.legendMarkerColor}},itemName:{spacing:5,style:{fill:t.legendItemNameFillColor,fontFamily:t.fontFamily,fontSize:t.legendItemNameFontSize,lineHeight:t.legendItemNameLineHeight,fontWeight:t.legendItemNameFontWeight,textAlign:"start",textBaseline:"middle"}},itemStates:{active:{nameStyle:{opacity:.8}},unchecked:{nameStyle:{fill:"#D8D8D8"},markerStyle:{fill:"#D8D8D8",stroke:"#D8D8D8"}},inactive:{nameStyle:{fill:"#D8D8D8"},markerStyle:{opacity:.2}}},flipPage:!0,pageNavigator:{marker:{style:{size:t.legendPageNavigatorMarkerSize,inactiveFill:t.legendPageNavigatorMarkerInactiveFillColor,inactiveOpacity:t.legendPageNavigatorMarkerInactiveFillOpacity,fill:t.legendPageNavigatorMarkerFillColor,opacity:t.legendPageNavigatorMarkerFillOpacity}},text:{style:{fill:t.legendPageNavigatorTextFillColor,fontSize:t.legendPageNavigatorTextFontSize}}},animate:!1,maxItemWidth:200,itemSpacing:t.legendItemSpacing,itemMarginBottom:t.legendItemMarginBottom,padding:t.legendPadding}}(t);return{background:t.backgroundColor,defaultColor:t.brandColor,subColor:t.subColor,semanticRed:t.paletteSemanticRed,semanticGreen:t.paletteSemanticGreen,padding:"auto",fontFamily:t.fontFamily,columnWidthRatio:.5,maxColumnWidth:null,minColumnWidth:null,roseWidthRatio:.9999999,multiplePieWidthRatio:1/1.3,colors10:t.paletteQualitative10,colors20:t.paletteQualitative20,sequenceColors:t.paletteSequence,shapes:{point:["hollow-circle","hollow-square","hollow-bowtie","hollow-diamond","hollow-hexagon","hollow-triangle","hollow-triangle-down","circle","square","bowtie","diamond","hexagon","triangle","triangle-down","cross","tick","plus","hyphen","line"],line:["line","dash","dot","smooth"],area:["area","smooth","line","smooth-line"],interval:["rect","hollow-rect","line","tick"]},sizes:[1,10],geometries:{interval:{rect:{default:{style:r.interval.default},active:{style:r.interval.active},inactive:{style:r.interval.inactive},selected:{style:function(t){var e=t.geometry.coordinate;if(e.isPolar&&e.isTransposed){var n=ZB(t.getModel(),e),i=(n.startAngle+n.endAngle)/2,o=7.5*Math.cos(i),a=7.5*Math.sin(i);return{matrix:Wx.pd(null,[["t",o,a]])}}return r.interval.selected}}},"hollow-rect":{default:{style:r.hollowInterval.default},active:{style:r.hollowInterval.active},inactive:{style:r.hollowInterval.inactive},selected:{style:r.hollowInterval.selected}},line:{default:{style:r.hollowInterval.default},active:{style:r.hollowInterval.active},inactive:{style:r.hollowInterval.inactive},selected:{style:r.hollowInterval.selected}},tick:{default:{style:r.hollowInterval.default},active:{style:r.hollowInterval.active},inactive:{style:r.hollowInterval.inactive},selected:{style:r.hollowInterval.selected}},funnel:{default:{style:r.interval.default},active:{style:r.interval.active},inactive:{style:r.interval.inactive},selected:{style:r.interval.selected}},pyramid:{default:{style:r.interval.default},active:{style:r.interval.active},inactive:{style:r.interval.inactive},selected:{style:r.interval.selected}}},line:{line:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},dot:{default:{style:(0,Gx.__assign)((0,Gx.__assign)({},r.line.default),{lineCap:null,lineDash:[1,1]})},active:{style:(0,Gx.__assign)((0,Gx.__assign)({},r.line.active),{lineCap:null,lineDash:[1,1]})},inactive:{style:(0,Gx.__assign)((0,Gx.__assign)({},r.line.inactive),{lineCap:null,lineDash:[1,1]})},selected:{style:(0,Gx.__assign)((0,Gx.__assign)({},r.line.selected),{lineCap:null,lineDash:[1,1]})}},dash:{default:{style:(0,Gx.__assign)((0,Gx.__assign)({},r.line.default),{lineCap:null,lineDash:[5.5,1]})},active:{style:(0,Gx.__assign)((0,Gx.__assign)({},r.line.active),{lineCap:null,lineDash:[5.5,1]})},inactive:{style:(0,Gx.__assign)((0,Gx.__assign)({},r.line.inactive),{lineCap:null,lineDash:[5.5,1]})},selected:{style:(0,Gx.__assign)((0,Gx.__assign)({},r.line.selected),{lineCap:null,lineDash:[5.5,1]})}},smooth:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},hv:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},vh:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},hvh:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},vhv:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}}},polygon:{polygon:{default:{style:r.interval.default},active:{style:r.interval.active},inactive:{style:r.interval.inactive},selected:{style:r.interval.selected}}},point:{circle:{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},square:{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},bowtie:{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},diamond:{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},hexagon:{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},triangle:{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},"triangle-down":{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},"hollow-circle":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},"hollow-square":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},"hollow-bowtie":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},"hollow-diamond":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},"hollow-hexagon":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},"hollow-triangle":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},"hollow-triangle-down":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},cross:{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},tick:{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},plus:{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},hyphen:{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},line:{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}}},area:{area:{default:{style:r.area.default},active:{style:r.area.active},inactive:{style:r.area.inactive},selected:{style:r.area.selected}},smooth:{default:{style:r.area.default},active:{style:r.area.active},inactive:{style:r.area.inactive},selected:{style:r.area.selected}},line:{default:{style:r.hollowArea.default},active:{style:r.hollowArea.active},inactive:{style:r.hollowArea.inactive},selected:{style:r.hollowArea.selected}},"smooth-line":{default:{style:r.hollowArea.default},active:{style:r.hollowArea.active},inactive:{style:r.hollowArea.inactive},selected:{style:r.hollowArea.selected}}},schema:{candle:{default:{style:r.hollowInterval.default},active:{style:r.hollowInterval.active},inactive:{style:r.hollowInterval.inactive},selected:{style:r.hollowInterval.selected}},box:{default:{style:r.hollowInterval.default},active:{style:r.hollowInterval.active},inactive:{style:r.hollowInterval.inactive},selected:{style:r.hollowInterval.selected}}},edge:{line:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},vhv:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},smooth:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},arc:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}}},violin:{violin:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},smooth:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},hollow:{default:{style:r.hollowArea.default},active:{style:r.hollowArea.active},inactive:{style:r.hollowArea.inactive},selected:{style:r.hollowArea.selected}},"hollow-smooth":{default:{style:r.hollowArea.default},active:{style:r.hollowArea.active},inactive:{style:r.hollowArea.inactive},selected:{style:r.hollowArea.selected}}}},components:{axis:{common:n,top:{position:"top",grid:null,title:null,verticalLimitLength:.5},bottom:{position:"bottom",grid:null,title:null,verticalLimitLength:.5},left:{position:"left",title:null,line:null,tickLine:null,verticalLimitLength:1/3},right:{position:"right",title:null,line:null,tickLine:null,verticalLimitLength:1/3},circle:{title:null,grid:(0,Ux.deepMix)({},n.grid,{line:{type:"line"}})},radius:{title:null,grid:(0,Ux.deepMix)({},n.grid,{line:{type:"circle"}})}},legend:{common:i,right:{layout:"vertical",padding:t.legendVerticalPadding},left:{layout:"vertical",padding:t.legendVerticalPadding},top:{layout:"horizontal",padding:t.legendHorizontalPadding},bottom:{layout:"horizontal",padding:t.legendHorizontalPadding},continuous:{title:null,background:null,track:{},rail:{type:"color",size:t.sliderRailHeight,defaultLength:t.sliderRailWidth,style:{fill:t.sliderRailFillColor,stroke:t.sliderRailBorderColor,lineWidth:t.sliderRailBorder}},label:{align:"rail",spacing:4,formatter:null,style:{fill:t.sliderLabelTextFillColor,fontSize:t.sliderLabelTextFontSize,lineHeight:t.sliderLabelTextLineHeight,textBaseline:"middle",fontFamily:t.fontFamily}},handler:{size:t.sliderHandlerWidth,style:{fill:t.sliderHandlerFillColor,stroke:t.sliderHandlerBorderColor}},slidable:!0,padding:i.padding}},tooltip:{showContent:!0,follow:!0,showCrosshairs:!1,showMarkers:!0,shared:!1,enterable:!1,position:"auto",marker:{symbol:"circle",stroke:"#fff",shadowBlur:10,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(0,0,0,0.09)",lineWidth:2,r:4},crosshairs:{line:{style:{stroke:t.tooltipCrosshairsBorderColor,lineWidth:t.tooltipCrosshairsBorder}},text:null,textBackground:{padding:2,style:{fill:"rgba(0, 0, 0, 0.25)",lineWidth:0,stroke:null}},follow:!1},domStyles:(e={},e["".concat(hB)]={position:"absolute",visibility:"hidden",zIndex:8,transition:"left 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s, top 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s",backgroundColor:t.tooltipContainerFillColor,opacity:t.tooltipContainerFillOpacity,boxShadow:t.tooltipContainerShadow,borderRadius:"".concat(t.tooltipContainerBorderRadius,"px"),color:t.tooltipTextFillColor,fontSize:"".concat(t.tooltipTextFontSize,"px"),fontFamily:t.fontFamily,lineHeight:"".concat(t.tooltipTextLineHeight,"px"),padding:"0 12px 0 12px"},e["".concat(pB)]={marginBottom:"12px",marginTop:"12px"},e["".concat(dB)]={margin:0,listStyleType:"none",padding:0},e["".concat(yB)]={listStyleType:"none",padding:0,marginBottom:"12px",marginTop:"12px",marginLeft:0,marginRight:0},e["".concat(gB)]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},e["".concat(vB)]={display:"inline-block",float:"right",marginLeft:"30px"},e)},annotation:{arc:{style:{stroke:t.annotationArcBorderColor,lineWidth:t.annotationArcBorder},animate:!0},line:{style:{stroke:t.annotationLineBorderColor,lineDash:t.annotationLineDash,lineWidth:t.annotationLineBorder},text:{position:"start",autoRotate:!0,style:{fill:t.annotationTextFillColor,stroke:t.annotationTextBorderColor,lineWidth:t.annotationTextBorder,fontSize:t.annotationTextFontSize,textAlign:"start",fontFamily:t.fontFamily,textBaseline:"bottom"}},animate:!0},text:{style:{fill:t.annotationTextFillColor,stroke:t.annotationTextBorderColor,lineWidth:t.annotationTextBorder,fontSize:t.annotationTextFontSize,textBaseline:"middle",textAlign:"start",fontFamily:t.fontFamily},animate:!0},region:{top:!1,style:{lineWidth:t.annotationRegionBorder,stroke:t.annotationRegionBorderColor,fill:t.annotationRegionFillColor,fillOpacity:t.annotationRegionFillOpacity},animate:!0},image:{top:!1,animate:!0},dataMarker:{top:!0,point:{style:{r:3,stroke:t.brandColor,lineWidth:2}},line:{style:{stroke:t.annotationLineBorderColor,lineWidth:t.annotationLineBorder},length:t.annotationDataMarkerLineLength},text:{style:{textAlign:"start",fill:t.annotationTextFillColor,stroke:t.annotationTextBorderColor,lineWidth:t.annotationTextBorder,fontSize:t.annotationTextFontSize,fontFamily:t.fontFamily}},direction:"upward",autoAdjust:!0,animate:!0},dataRegion:{style:{region:{fill:t.annotationRegionFillColor,fillOpacity:t.annotationRegionFillOpacity},text:{textAlign:"center",textBaseline:"bottom",fill:t.annotationTextFillColor,stroke:t.annotationTextBorderColor,lineWidth:t.annotationTextBorder,fontSize:t.annotationTextFontSize,fontFamily:t.fontFamily}},animate:!0}},slider:{common:{padding:[8,8,8,8],backgroundStyle:{fill:t.cSliderBackgroundFillColor,opacity:t.cSliderBackgroundFillOpacity},foregroundStyle:{fill:t.cSliderForegroundFillColor,opacity:t.cSliderForegroundFillOpacity},handlerStyle:{width:t.cSliderHandlerWidth,height:t.cSliderHandlerHeight,fill:t.cSliderHandlerFillColor,opacity:t.cSliderHandlerFillOpacity,stroke:t.cSliderHandlerBorderColor,lineWidth:t.cSliderHandlerBorder,radius:t.cSliderHandlerBorderRadius,highLightFill:t.cSliderHandlerHighlightFillColor},textStyle:{fill:t.cSliderTextFillColor,opacity:t.cSliderTextFillOpacity,fontSize:t.cSliderTextFontSize,lineHeight:t.cSliderTextLineHeight,fontWeight:t.cSliderTextFontWeight,stroke:t.cSliderTextBorderColor,lineWidth:t.cSliderTextBorder}}},scrollbar:{common:{padding:[8,8,8,8]},default:{style:{trackColor:t.scrollbarTrackFillColor,thumbColor:t.scrollbarThumbFillColor}},hover:{style:{thumbColor:t.scrollbarThumbHighlightFillColor}}}},labels:{offset:12,style:{fill:t.labelFillColor,fontSize:t.labelFontSize,fontFamily:t.fontFamily,stroke:t.labelBorderColor,lineWidth:t.labelBorder},fillColorDark:t.labelFillColorDark,fillColorLight:t.labelFillColorLight,autoRotate:!0},innerLabels:{style:{fill:t.innerLabelFillColor,fontSize:t.innerLabelFontSize,fontFamily:t.fontFamily,stroke:t.innerLabelBorderColor,lineWidth:t.innerLabelBorder},autoRotate:!0},overflowLabels:{style:{fill:t.overflowLabelFillColor,fontSize:t.overflowLabelFontSize,fontFamily:t.fontFamily,stroke:t.overflowLabelBorderColor,lineWidth:t.overflowLabelBorder}},pieLabels:{labelHeight:14,offset:10,labelLine:{style:{lineWidth:t.labelLineBorder}},autoRotate:!0}}}var kz="#000",Iz="#595959",Tz="#8C8C8C",Oz="#BFBFBF",Mz="#D9D9D9",Pz="#F0F0F0",Lz="#FFFFFF",Nz="#D9D9D9",jz=["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],Rz=["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"],Dz=["#B8E1FF","#9AC5FF","#7DAAFF","#5B8FF9","#3D76DD","#085EC0","#0047A5","#00318A","#001D70"],Bz=function(t){void 0===t&&(t={});var e=t.paletteQualitative10,r=void 0===e?jz:e,n=t.paletteQualitative20,i=void 0===n?Rz:n,o=t.brandColor,a=void 0===o?r[0]:o,s={backgroundColor:"transparent",brandColor:a,subColor:"rgba(0,0,0,0.05)",paletteQualitative10:r,paletteQualitative20:i,paletteSemanticRed:"#F4664A",paletteSemanticGreen:"#30BF78",paletteSemanticYellow:"#FAAD14",paletteSequence:Dz,fontFamily:'"Segoe UI", Roboto, "Helvetica Neue", Arial,\n "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",\n "Noto Color Emoji"',axisLineBorderColor:Oz,axisLineBorder:1,axisLineDash:null,axisTitleTextFillColor:Iz,axisTitleTextFontSize:12,axisTitleTextLineHeight:12,axisTitleTextFontWeight:"normal",axisTitleSpacing:12,axisDescriptionIconFillColor:Nz,axisTickLineBorderColor:Oz,axisTickLineLength:4,axisTickLineBorder:1,axisSubTickLineBorderColor:Mz,axisSubTickLineLength:2,axisSubTickLineBorder:1,axisLabelFillColor:Tz,axisLabelFontSize:12,axisLabelLineHeight:12,axisLabelFontWeight:"normal",axisLabelOffset:8,axisGridBorderColor:Mz,axisGridBorder:1,axisGridLineDash:null,legendTitleTextFillColor:Tz,legendTitleTextFontSize:12,legendTitleTextLineHeight:21,legendTitleTextFontWeight:"normal",legendMarkerColor:a,legendMarkerSpacing:8,legendMarkerSize:4,legendCircleMarkerSize:4,legendSquareMarkerSize:4,legendLineMarkerSize:5,legendItemNameFillColor:Iz,legendItemNameFontSize:12,legendItemNameLineHeight:12,legendItemNameFontWeight:"normal",legendItemSpacing:24,legendItemMarginBottom:12,legendPadding:[8,8,8,8],legendHorizontalPadding:[8,0,8,0],legendVerticalPadding:[0,8,0,8],legendPageNavigatorMarkerSize:12,legendPageNavigatorMarkerInactiveFillColor:kz,legendPageNavigatorMarkerInactiveFillOpacity:.45,legendPageNavigatorMarkerFillColor:kz,legendPageNavigatorMarkerFillOpacity:1,legendPageNavigatorTextFillColor:Tz,legendPageNavigatorTextFontSize:12,sliderRailFillColor:Mz,sliderRailBorder:0,sliderRailBorderColor:null,sliderRailWidth:100,sliderRailHeight:12,sliderLabelTextFillColor:Tz,sliderLabelTextFontSize:12,sliderLabelTextLineHeight:12,sliderLabelTextFontWeight:"normal",sliderHandlerFillColor:Pz,sliderHandlerWidth:10,sliderHandlerHeight:14,sliderHandlerBorder:1,sliderHandlerBorderColor:Oz,annotationArcBorderColor:Mz,annotationArcBorder:1,annotationLineBorderColor:Oz,annotationLineBorder:1,annotationLineDash:null,annotationTextFillColor:Iz,annotationTextFontSize:12,annotationTextLineHeight:12,annotationTextFontWeight:"normal",annotationTextBorderColor:null,annotationTextBorder:0,annotationRegionFillColor:kz,annotationRegionFillOpacity:.06,annotationRegionBorder:0,annotationRegionBorderColor:null,annotationDataMarkerLineLength:16,tooltipCrosshairsBorderColor:Oz,tooltipCrosshairsBorder:1,tooltipCrosshairsLineDash:null,tooltipContainerFillColor:"rgb(255, 255, 255)",tooltipContainerFillOpacity:.95,tooltipContainerShadow:"0px 0px 10px #aeaeae",tooltipContainerBorderRadius:3,tooltipTextFillColor:Iz,tooltipTextFontSize:12,tooltipTextLineHeight:12,tooltipTextFontWeight:"bold",labelFillColor:Iz,labelFillColorDark:"#2c3542",labelFillColorLight:"#ffffff",labelFontSize:12,labelLineHeight:12,labelFontWeight:"normal",labelBorderColor:null,labelBorder:0,innerLabelFillColor:Lz,innerLabelFontSize:12,innerLabelLineHeight:12,innerLabelFontWeight:"normal",innerLabelBorderColor:null,innerLabelBorder:0,overflowLabelFillColor:Iz,overflowLabelFontSize:12,overflowLabelLineHeight:12,overflowLabelFontWeight:"normal",overflowLabelBorderColor:Lz,overflowLabelBorder:1,labelLineBorder:1,labelLineBorderColor:Oz,cSliderRailHieght:16,cSliderBackgroundFillColor:"#416180",cSliderBackgroundFillOpacity:.05,cSliderForegroundFillColor:"#5B8FF9",cSliderForegroundFillOpacity:.15,cSliderHandlerHeight:24,cSliderHandlerWidth:10,cSliderHandlerFillColor:"#F7F7F7",cSliderHandlerFillOpacity:1,cSliderHandlerHighlightFillColor:"#FFF",cSliderHandlerBorderColor:"#BFBFBF",cSliderHandlerBorder:1,cSliderHandlerBorderRadius:2,cSliderTextFillColor:"#000",cSliderTextFillOpacity:.45,cSliderTextFontSize:12,cSliderTextLineHeight:12,cSliderTextFontWeight:"normal",cSliderTextBorderColor:null,cSliderTextBorder:0,scrollbarTrackFillColor:"rgba(0,0,0,0)",scrollbarThumbFillColor:"rgba(0,0,0,0.15)",scrollbarThumbHighlightFillColor:"rgba(0,0,0,0.2)",pointFillColor:a,pointFillOpacity:.95,pointSize:4,pointBorder:1,pointBorderColor:Lz,pointBorderOpacity:1,pointActiveBorderColor:kz,pointSelectedBorder:2,pointSelectedBorderColor:kz,pointInactiveFillOpacity:.3,pointInactiveBorderOpacity:.3,hollowPointSize:4,hollowPointBorder:1,hollowPointBorderColor:a,hollowPointBorderOpacity:.95,hollowPointFillColor:Lz,hollowPointActiveBorder:1,hollowPointActiveBorderColor:kz,hollowPointActiveBorderOpacity:1,hollowPointSelectedBorder:2,hollowPointSelectedBorderColor:kz,hollowPointSelectedBorderOpacity:1,hollowPointInactiveBorderOpacity:.3,lineBorder:2,lineBorderColor:a,lineBorderOpacity:1,lineActiveBorder:3,lineSelectedBorder:3,lineInactiveBorderOpacity:.3,areaFillColor:a,areaFillOpacity:.25,areaActiveFillColor:a,areaActiveFillOpacity:.5,areaSelectedFillColor:a,areaSelectedFillOpacity:.5,areaInactiveFillOpacity:.3,hollowAreaBorderColor:a,hollowAreaBorder:2,hollowAreaBorderOpacity:1,hollowAreaActiveBorder:3,hollowAreaActiveBorderColor:kz,hollowAreaSelectedBorder:3,hollowAreaSelectedBorderColor:kz,hollowAreaInactiveBorderOpacity:.3,intervalFillColor:a,intervalFillOpacity:.95,intervalActiveBorder:1,intervalActiveBorderColor:kz,intervalActiveBorderOpacity:1,intervalSelectedBorder:2,intervalSelectedBorderColor:kz,intervalSelectedBorderOpacity:1,intervalInactiveBorderOpacity:.3,intervalInactiveFillOpacity:.3,hollowIntervalBorder:2,hollowIntervalBorderColor:a,hollowIntervalBorderOpacity:1,hollowIntervalFillColor:Lz,hollowIntervalActiveBorder:2,hollowIntervalActiveBorderColor:kz,hollowIntervalSelectedBorder:3,hollowIntervalSelectedBorderColor:kz,hollowIntervalSelectedBorderOpacity:1,hollowIntervalInactiveBorderOpacity:.3};return(0,Gx.__assign)((0,Gx.__assign)({},s),t)};Bz();function Fz(t){var e=t.styleSheet,r=void 0===e?{}:e,n=(0,Gx.__rest)(t,["styleSheet"]),i=Bz(r);return(0,Ux.deepMix)({},Cz(i),n)}var zz={default:Fz({})};function Gz(t){return(0,Ux.get)(zz,(0,Ux.lowerCase)(t),zz.default)}function Uz(t,e){zz[(0,Ux.lowerCase)(t)]=Fz(e)}function Hz(t,e,r){var n=r.translate(t),i=r.translate(e);return(0,Ux.isNumberEqual)(n,i)}function Vz(t,e,r){var n=r.coordinate,i=r.getYScale(),o=i.field,a=n.invert(e),s=i.invert(a.y);return(0,Ux.find)(t,function(t){var e=t[zj];return e[o][0]<=s&&e[o][1]>=s})||t[t.length-1]}var Qz=(0,Ux.memoize)(function(t){if(t.isCategory)return 1;for(var e=t.values,r=e.length,n=t.translate(e[0]),i=n,o=0;oi&&(i=s)}return(i-n)/(r-1)});function Yz(t){var e,r,n,i=function(t){var e=(0,Ux.values)(t.attributes);return(0,Ux.filter)(e,function(t){return(0,Ux.contains)(Fj,t.type)})}(t);try{for(var o=(0,Gx.__values)(i),a=o.next();!a.done;a=o.next()){var s=a.value,u=s.getScale(s.type);if(u&&u.isLinear)if("cat"!==cF(u,(0,Ux.get)(t.scaleDefs,u.field),s.type,t.type)){n=u;break}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}var l=t.getXScale(),c=t.getYScale();return n||c||l}function Wz(t,e,r){if(0===e.length)return null;var n=r.type,i=r.getXScale(),o=r.getYScale(),a=i.field,s=o.field,u=null;if("heatmap"===n||"point"===n){for(var l=r.coordinate.invert(t),c=i.invert(l.x),f=o.invert(l.y),h=1/0,p=0;p(1+o)/2&&(s=a),n.translate(n.invert(s))}(t,r),A=v[zj][a],x=v[zj][s],w=m[zj][a],_=o.isLinear&&(0,Ux.isArray)(x);if((0,Ux.isArray)(A)){for(p=0;p=b){if(!_){u=T;break}(0,Ux.isArray)(u)||(u=[]),u.push(T)}}(0,Ux.isArray)(u)&&(u=Vz(u,t,r))}else{var S=void 0;if(i.isLinear||"timeCat"===i.type){if((b>i.translate(w)||bi.max||bMath.abs(i.translate(S[zj][a])-b)&&(m=S)}var O=Qz(r.getXScale());return!u&&Math.abs(i.translate(m[zj][a])-b)<=O/2&&(u=m),u}function qz(t,e,r,n){var i,o;void 0===r&&(r=""),void 0===n&&(n=!1);var a,s=t[zj],u=function(t,e,r){var n=e.getAttribute("position").getFields(),i=e.scales,o=(0,Ux.isFunction)(r)||!r?n[0]:r,a=i[o],s=a?a.getText(t[o]):t[o]||o;return(0,Ux.isFunction)(r)?r(s,t):s}(s,e,r),l=e.tooltipOption,c=e.theme.defaultColor,f=[];function h(e,r){if(n||!(0,Ux.isNil)(r)&&""!==r){var i={title:u,data:s,mappingData:t,name:e,value:r,color:t.color||c,marker:!0};f.push(i)}}if((0,Ux.isObject)(l)){var p=l.fields,d=l.callback;if(d){var y=p.map(function(e){return t[zj][e]}),g=d.apply(void 0,(0,Gx.__spreadArray)([],(0,Gx.__read)(y),!1)),v=(0,Gx.__assign)({data:t[zj],mappingData:t,title:u,color:t.color||c,marker:!0},g);f.push(v)}else{var m=e.scales;try{for(var b=(0,Gx.__values)(p),A=b.next();!A.done;A=b.next()){var x=A.value;if(!(0,Ux.isNil)(s[x])){var w=m[x];h(hF(w),a=w.getText(s[x]))}}}catch(t){i={error:t}}finally{try{A&&!A.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}}}else{var _=Yz(e);a=function(t,e){var r=t[e.field];return(0,Ux.isArray)(r)?r.map(function(t){return e.getText(t)}).join("-"):e.getText(r)}(s,_),h(function(t,e){var r,n=e.getGroupScales();if(n.length&&(r=n[0]),r){var i=r.field;return r.getText(t[i])}return hF(Yz(e))}(s,e),a)}return f}function Xz(t,e,r,n){var i,o,a=n.showNil,s=[],u=t.dataArray;if(!(0,Ux.isEmpty)(u)){t.sort(u);try{for(var l=(0,Gx.__values)(u),c=l.next();!c.done;c=l.next()){var f=Wz(e,c.value,t);if(f){var h=t.getElementId(f),p=t.elementsMap[h];if("heatmap"===t.type||p.visible){var d=qz(f,t,r,a);d.length&&s.push(d)}}}}catch(t){i={error:t}}finally{try{c&&!c.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}}return s}function Kz(t,e,r,n){var i=n.showNil,o=[],a=t.container.getShape(e.x,e.y);if(a&&a.get("visible")&&a.get("origin")){var s=qz(a.get("origin").mappingData,t,r,i);s.length&&o.push(s)}return o}function Jz(t,e,r){var n,i,o=[],a=t.geometries,s=r.shared,u=r.title,l=r.reversed;try{for(var c=(0,Gx.__values)(a),f=c.next();!f.done;f=c.next()){var h=f.value;if(h.visible&&!1!==h.tooltipOption){var p=h.type,d=void 0;(d=["point","edge","polygon"].includes(p)?Kz(h,e,u,r):["area","line","path","heatmap"].includes(p)?Xz(h,e,u,r):!1!==s?Xz(h,e,u,r):Kz(h,e,u,r)).length&&(l&&d.reverse(),o.push(d))}}}catch(t){n={error:t}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}return o}function Zz(t){void 0===t&&(t=0);var e=(0,Ux.isArray)(t)?t:[t];switch(e.length){case 0:e=[0,0,0,0];break;case 1:e=new Array(4).fill(e[0]);break;case 2:e=(0,Gx.__spreadArray)((0,Gx.__spreadArray)([],(0,Gx.__read)(e),!1),(0,Gx.__read)(e),!1);break;case 3:e=(0,Gx.__spreadArray)((0,Gx.__spreadArray)([],(0,Gx.__read)(e),!1),[e[1]],!1);break;default:e=e.slice(0,4)}return e}var $z={};function tG(t,e){$z[t]=e}var eG=function(){function t(t){this.option=this.wrapperOption(t)}return t.prototype.update=function(t){return this.option=this.wrapperOption(t),this},t.prototype.hasAction=function(t){var e=this.option.actions;return(0,Ux.some)(e,function(e){return e[0]===t})},t.prototype.create=function(t,e){var r=this.option,n=r.type,i=r.cfg,o="theta"===n,a=(0,Gx.__assign)({start:t,end:e},i),s=function(t){return NR[t.toLowerCase()]}(o?"polar":n);return this.coordinate=new s(a),this.coordinate.type=n,o&&(this.hasAction("transpose")||this.transpose()),this.execActions(),this.coordinate},t.prototype.adjust=function(t,e){return this.coordinate.update({start:t,end:e}),this.coordinate.resetMatrix(),this.execActions(["scale","rotate","translate"]),this.coordinate},t.prototype.rotate=function(t){return this.option.actions.push(["rotate",t]),this},t.prototype.reflect=function(t){return this.option.actions.push(["reflect",t]),this},t.prototype.scale=function(t,e){return this.option.actions.push(["scale",t,e]),this},t.prototype.transpose=function(){return this.option.actions.push(["transpose"]),this},t.prototype.getOption=function(){return this.option},t.prototype.getCoordinate=function(){return this.coordinate},t.prototype.wrapperOption=function(t){return(0,Gx.__assign)({type:"rect",actions:[],cfg:{}},t)},t.prototype.execActions=function(t){var e=this,r=this.option.actions;(0,Ux.each)(r,function(r){var n,i=(0,Gx.__read)(r),o=i[0],a=i.slice(1);(!!(0,Ux.isNil)(t)||t.includes(o))&&(n=e.coordinate)[o].apply(n,(0,Gx.__spreadArray)([],(0,Gx.__read)(a),!1))})},t}(),rG=function(){function t(t,e,r){this.view=t,this.gEvent=e,this.data=r,this.type=e.type}return t.fromData=function(e,r,n){return new t(e,new kS.Event(r,{}),n)},Object.defineProperty(t.prototype,"target",{get:function(){return this.gEvent.target},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"event",{get:function(){return this.gEvent.originalEvent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.gEvent.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.gEvent.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clientX",{get:function(){return this.gEvent.clientX},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clientY",{get:function(){return this.gEvent.clientY},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return"[Event (type=".concat(this.type,")]")},t.prototype.clone=function(){return new t(this.view,this.gEvent,this.data)},t}();function nG(t){var e=t.getController("axis"),r=t.getController("legend"),n=t.getController("annotation");[e,t.getController("slider"),t.getController("scrollbar"),r,n].forEach(function(t){t&&t.layout()})}var iG=function(){function t(){this.scales=new Map,this.syncScales=new Map}return t.prototype.createScale=function(t,e,r,n){var i=r,o=this.getScaleMeta(n);if(0===e.length&&o){var a=o.scale,s={type:a.type};a.isCategory&&(s.values=a.values),i=(0,Ux.deepMix)(s,o.scaleDef,r)}var u=fF(t,e,i);return this.cacheScale(u,r,n),u},t.prototype.sync=function(t,e){var r=this;this.syncScales.forEach(function(n,i){var o=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER,s=[];(0,Ux.each)(n,function(t){var e=r.getScale(t);a=(0,Ux.isNumber)(e.max)?Math.max(a,e.max):a,o=(0,Ux.isNumber)(e.min)?Math.min(o,e.min):o,(0,Ux.each)(e.values,function(t){s.includes(t)||s.push(t)})}),(0,Ux.each)(n,function(n){var i=r.getScale(n);if(i.isContinuous)i.change({min:o,max:a,values:s});else if(i.isCategory){var u=i.range,l=r.getScaleMeta(n);s&&!(0,Ux.get)(l,["scaleDef","range"])&&(u=pF((0,Ux.deepMix)({},i,{values:s}),t,e)),i.change({values:s,range:u})}})})},t.prototype.cacheScale=function(t,e,r){var n=this.getScaleMeta(r);n&&n.scale.type===t.type?(!function(t,e){if("identity"!==t.type&&"identity"!==e.type){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);t.change(r)}}(n.scale,t),n.scaleDef=e):(n={key:r,scale:t,scaleDef:e},this.scales.set(r,n));var i=this.getSyncKey(n);if(n.syncKey=i,this.removeFromSyncScales(r),i){var o=this.syncScales.get(i);o||(o=[],this.syncScales.set(i,o)),o.push(r)}},t.prototype.getScale=function(t){var e=this.getScaleMeta(t);if(!e){var r=(0,Ux.last)(t.split("-")),n=this.syncScales.get(r);n&&n.length&&(e=this.getScaleMeta(n[0]))}return e&&e.scale},t.prototype.deleteScale=function(t){var e=this.getScaleMeta(t);if(e){var r=e.syncKey,n=this.syncScales.get(r);if(n&&n.length){var i=n.indexOf(t);-1!==i&&n.splice(i,1)}}this.scales.delete(t)},t.prototype.clear=function(){this.scales.clear(),this.syncScales.clear()},t.prototype.removeFromSyncScales=function(t){var e=this;this.syncScales.forEach(function(r,n){var i=r.indexOf(t);if(-1!==i)return r.splice(i,1),0===r.length&&e.syncScales.delete(n),!1})},t.prototype.getSyncKey=function(t){var e=t.scale,r=t.scaleDef,n=e.field,i=(0,Ux.get)(r,["sync"]);return!0===i?n:!1===i?void 0:i},t.prototype.getScaleMeta=function(t){return this.scales.get(t)},t}(),oG=function(){function t(t,e,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),this.top=t,this.right=e,this.bottom=r,this.left=n}return t.instance=function(e,r,n,i){return void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===i&&(i=0),new t(e,r,n,i)},t.prototype.max=function(t){var e=(0,Gx.__read)(t,4),r=e[0],n=e[1],i=e[2],o=e[3];return this.top=Math.max(this.top,r),this.right=Math.max(this.right,n),this.bottom=Math.max(this.bottom,i),this.left=Math.max(this.left,o),this},t.prototype.shrink=function(t){var e=(0,Gx.__read)(t,4),r=e[0],n=e[1],i=e[2],o=e[3];return this.top+=r,this.right+=n,this.bottom+=i,this.left+=o,this},t.prototype.inc=function(t,e){var r=t.width,n=t.height;switch(e){case Mj.TOP:case Mj.TOP_LEFT:case Mj.TOP_RIGHT:this.top+=n;break;case Mj.RIGHT:case Mj.RIGHT_TOP:case Mj.RIGHT_BOTTOM:this.right+=r;break;case Mj.BOTTOM:case Mj.BOTTOM_LEFT:case Mj.BOTTOM_RIGHT:this.bottom+=n;break;case Mj.LEFT:case Mj.LEFT_TOP:case Mj.LEFT_BOTTOM:this.left+=r}return this},t.prototype.getPadding=function(){return[this.top,this.right,this.bottom,this.left]},t.prototype.clone=function(){return new(t.bind.apply(t,(0,Gx.__spreadArray)([void 0],(0,Gx.__read)(this.getPadding()),!1)))},t}();function aG(t){var e=t.padding;if(!function(t){return!(0,Ux.isNumber)(t)&&!(0,Ux.isArray)(t)}(e))return new(oG.bind.apply(oG,(0,Gx.__spreadArray)([void 0],(0,Gx.__read)(Zz(e)),!1)));var r=t.viewBBox,n=new oG,i=[],o=[],a=[];return(0,Ux.each)(t.getComponents(),function(t){var e=t.type;e===Pj.AXIS?i.push(t):[Pj.LEGEND,Pj.SLIDER,Pj.SCROLLBAR].includes(e)?o.push(t):e!==Pj.GRID&&e!==Pj.TOOLTIP&&a.push(t)}),(0,Ux.each)(i,function(t){var e=t.component.getLayoutBBox(),i=new iF(e.x,e.y,e.width,e.height).exceed(r);n.max(i)}),(0,Ux.each)(o,function(t){var e=t.component,r=t.direction,i=e.getLayoutBBox(),o=e.get("padding"),a=new iF(i.x,i.y,i.width,i.height).expand(o);n.inc(a,r)}),(0,Ux.each)(a,function(t){var e=t.component,r=t.direction,i=e.getLayoutBBox(),o=new iF(i.x,i.y,i.width,i.height);n.inc(o,r)}),n}function sG(t,e,r){var n=r.instance();e.forEach(function(t){t.autoPadding=n.max(t.autoPadding.getPadding())})}var uG=function(t){function e(e){var r=t.call(this,{visible:e.visible})||this;r.views=[],r.geometries=[],r.controllers=[],r.interactions={},r.limitInPlot=!1,r.options={data:[],animate:!0},r.usedControllers=Object.keys($z),r.scalePool=new iG,r.layoutFunc=nG,r.isPreMouseInPlot=!1,r.isDataChanged=!1,r.isCoordinateChanged=!1,r.createdScaleKeys=new Map,r.onCanvasEvent=function(t){var e=t.name;if(!e.includes(":")){var n=r.createViewEvent(t);r.doPlotEvent(n),r.emit(e,n)}},r.onDelegateEvents=function(t){var e=t.name;if(e.includes(":")){var n=r.createViewEvent(t);r.emit(e,n)}};var n=e.id,i=void 0===n?(0,Ux.uniqueId)("view"):n,o=e.parent,a=e.canvas,s=e.backgroundGroup,u=e.middleGroup,l=e.foregroundGroup,c=e.region,f=void 0===c?{start:{x:0,y:0},end:{x:1,y:1}}:c,h=e.padding,p=e.appendPadding,d=e.theme,y=e.options,g=e.limitInPlot,v=e.syncViewPadding;return r.parent=o,r.canvas=a,r.backgroundGroup=s,r.middleGroup=u,r.foregroundGroup=l,r.region=f,r.padding=h,r.appendPadding=p,r.options=(0,Gx.__assign)((0,Gx.__assign)({},r.options),y),r.limitInPlot=g,r.id=i,r.syncViewPadding=v,r.themeObject=(0,Ux.isObject)(d)?(0,Ux.deepMix)({},Gz("default"),Fz(d)):Gz(d),r.init(),r}return(0,Gx.__extends)(e,t),e.prototype.setLayout=function(t){this.layoutFunc=t},e.prototype.init=function(){this.calculateViewBBox(),this.initEvents(),this.initComponentController(),this.initOptions()},e.prototype.render=function(t,e){void 0===t&&(t=!1),this.emit(Nj.BEFORE_RENDER,rG.fromData(this,Nj.BEFORE_RENDER,e)),this.paint(t),this.emit(Nj.AFTER_RENDER,rG.fromData(this,Nj.AFTER_RENDER,e)),!1===this.visible&&this.changeVisible(!1)},e.prototype.clear=function(){var t=this;this.emit(Nj.BEFORE_CLEAR),this.filteredData=[],this.coordinateInstance=void 0,this.isDataChanged=!1,this.isCoordinateChanged=!1;for(var e=this.geometries,r=0;r
      ');E.appendChild(C);var k=Wj(E,s,i,o),I=new(Vj(f).Canvas)((0,Gx.__assign)({container:C,pixelRatio:h,localRefresh:d,supportCSSTransform:m},k));return(r=t.call(this,{parent:null,canvas:I,backgroundGroup:I.addGroup({zIndex:Bj.BG}),middleGroup:I.addGroup({zIndex:Bj.MID}),foregroundGroup:I.addGroup({zIndex:Bj.FORE}),padding:u,appendPadding:l,visible:g,options:x,limitInPlot:w,theme:_,syncViewPadding:S})||this).onResize=(0,Ux.debounce)(function(){r.forceFit()},300),r.ele=E,r.canvas=I,r.width=k.width,r.height=k.height,r.autoFit=s,r.localRefresh=d,r.renderer=f,r.wrapperElement=C,r.updateCanvasStyle(),r.bindAutoFit(),r.initDefaultInteractions(A),r}return(0,Gx.__extends)(e,t),e.prototype.initDefaultInteractions=function(t){var e=this;(0,Ux.each)(t,function(t){e.interaction(t)})},e.prototype.aria=function(t){!1===t?this.ele.removeAttribute("aria-label"):this.ele.setAttribute("aria-label",t.label)},e.prototype.changeSize=function(t,e){return this.width===t&&this.height===e?this:(this.emit(Nj.BEFORE_CHANGE_SIZE),this.width=t,this.height=e,this.canvas.changeSize(t,e),this.render(!0),this.emit(Nj.AFTER_CHANGE_SIZE),this)},e.prototype.clear=function(){t.prototype.clear.call(this),this.aria(!1)},e.prototype.destroy=function(){var e,r;t.prototype.destroy.call(this),this.unbindAutoFit(),this.canvas.destroy(),e=this.wrapperElement,(r=e.parentNode)&&r.removeChild(e),this.wrapperElement=null},e.prototype.changeVisible=function(e){return t.prototype.changeVisible.call(this,e),this.wrapperElement.style.display=e?"":"none",this},e.prototype.forceFit=function(){if(!this.destroyed){var t=Wj(this.ele,!0,this.width,this.height),e=t.width,r=t.height;this.changeSize(e,r)}},e.prototype.updateCanvasStyle=function(){rO(this.canvas.get("el"),{display:"inline-block",verticalAlign:"middle"})},e.prototype.bindAutoFit=function(){this.autoFit&&window.addEventListener("resize",this.onResize)},e.prototype.unbindAutoFit=function(){this.autoFit&&window.removeEventListener("resize",this.onResize)},e}(cG),hG=function(){function t(t){this.visible=!0,this.components=[],this.view=t}return t.prototype.clear=function(t){(0,Ux.each)(this.components,function(t){t.component.destroy()}),this.components=[]},t.prototype.destroy=function(){this.clear()},t.prototype.getComponents=function(){return this.components},t.prototype.changeVisible=function(t){this.visible!==t&&(this.components.forEach(function(e){t?e.component.show():e.component.hide()}),this.visible=t)},t}();var pG=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isLocked=!1,e}return(0,Gx.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"tooltip"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.isVisible=function(){return!1!==this.view.getOptions().tooltip},e.prototype.render=function(){},e.prototype.showTooltip=function(t){if(this.point=t,this.isVisible()){var e=this.view,r=this.getTooltipItems(t);if(r.length){var n=this.getTitle(r),i={x:r[0].x,y:r[0].y};e.emit("tooltip:show",rG.fromData(e,"tooltip:show",(0,Gx.__assign)({items:r,title:n},t)));var o=this.getTooltipCfg(),a=o.follow,s=o.showMarkers,u=o.showCrosshairs,l=o.showContent,c=o.marker,f=this.items,h=this.title;if((0,Ux.isEqual)(h,n)&&(0,Ux.isEqual)(f,r)?(this.tooltip&&a&&(this.tooltip.update(t),this.tooltip.show()),this.tooltipMarkersGroup&&this.tooltipMarkersGroup.show()):(e.emit("tooltip:change",rG.fromData(e,"tooltip:change",(0,Gx.__assign)({items:r,title:n},t))),((0,Ux.isFunction)(l)?l(r):l)&&(this.tooltip||this.renderTooltip(),this.tooltip.update((0,Ux.mix)({},o,{items:this.getItemsAfterProcess(r),title:n},a?t:{})),this.tooltip.show()),s&&this.renderTooltipMarkers(r,c)),this.items=r,this.title=n,u){var p=(0,Ux.get)(o,["crosshairs","follow"],!1);this.renderCrosshairs(p?t:i,o)}}else this.hideTooltip()}},e.prototype.hideTooltip=function(){if(this.getTooltipCfg().follow){var t=this.tooltipMarkersGroup;t&&t.hide();var e=this.xCrosshair,r=this.yCrosshair;e&&e.hide(),r&&r.hide();var n=this.tooltip;n&&n.hide(),this.view.emit("tooltip:hide",rG.fromData(this.view,"tooltip:hide",{})),this.point=null}else this.point=null},e.prototype.lockTooltip=function(){this.isLocked=!0,this.tooltip&&this.tooltip.setCapture(!0)},e.prototype.unlockTooltip=function(){this.isLocked=!1;var t=this.getTooltipCfg();this.tooltip&&this.tooltip.setCapture(t.capture)},e.prototype.isTooltipLocked=function(){return this.isLocked},e.prototype.clear=function(){var t=this.tooltip,e=this.xCrosshair,r=this.yCrosshair,n=this.tooltipMarkersGroup;t&&(t.hide(),t.clear()),e&&e.clear(),r&&r.clear(),n&&n.clear(),(null===t||void 0===t?void 0:t.get("customContent"))&&(this.tooltip.destroy(),this.tooltip=null),this.title=null,this.items=null},e.prototype.destroy=function(){this.tooltip&&this.tooltip.destroy(),this.xCrosshair&&this.xCrosshair.destroy(),this.yCrosshair&&this.yCrosshair.destroy(),this.guideGroup&&this.guideGroup.remove(!0),this.reset()},e.prototype.reset=function(){this.items=null,this.title=null,this.tooltipMarkersGroup=null,this.tooltipCrosshairsGroup=null,this.xCrosshair=null,this.yCrosshair=null,this.tooltip=null,this.guideGroup=null,this.isLocked=!1,this.point=null},e.prototype.changeVisible=function(t){if(this.visible!==t){var e=this.tooltip,r=this.tooltipMarkersGroup,n=this.xCrosshair,i=this.yCrosshair;t?(e&&e.show(),r&&r.show(),n&&n.show(),i&&i.show()):(e&&e.hide(),r&&r.hide(),n&&n.hide(),i&&i.hide()),this.visible=t}},e.prototype.getTooltipItems=function(t){var e,r,n,i,o,a,s=this.findItemsFromView(this.view,t);if(s.length){s=(0,Ux.flatten)(s);try{for(var u=(0,Gx.__values)(s),l=u.next();!l.done;l=u.next()){var c=l.value;try{for(var f=(n=void 0,(0,Gx.__values)(c)),h=f.next();!h.done;h=f.next()){var p=h.value,d=p.mappingData,y=d.x,g=d.y;p.x=(0,Ux.isArray)(y)?y[y.length-1]:y,p.y=(0,Ux.isArray)(g)?g[g.length-1]:g}}catch(t){n={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}if(!1===this.getTooltipCfg().shared&&s.length>1){var v=s[0],m=Math.abs(t.y-v[0].y);try{for(var b=(0,Gx.__values)(s),A=b.next();!A.done;A=b.next()){var x=A.value,w=Math.abs(t.y-x[0].y);w<=m&&(v=x,m=w)}}catch(t){o={error:t}}finally{try{A&&!A.done&&(a=b.return)&&a.call(b)}finally{if(o)throw o.error}}s=[v]}return function(t){for(var e=[],r=function(r){var n=t[r];(0,Ux.find)(e,function(t){return t.color===n.color&&t.name===n.name&&t.value===n.value&&t.title===n.title})||e.push(n)},n=0;n'+n+"":n}})},e.prototype.getTitle=function(t){var e=t[0].title||t[0].name;return this.title=e,e},e.prototype.renderTooltip=function(){var t=this.view.getCanvas(),e={start:{x:0,y:0},end:{x:t.get("width"),y:t.get("height")}},r=this.getTooltipCfg(),n=new YB((0,Gx.__assign)((0,Gx.__assign)({parent:t.get("el").parentNode,region:e},r),{visible:!1,crosshairs:null}));n.init(),this.tooltip=n},e.prototype.renderTooltipMarkers=function(t,e){var r,n,i=this.getTooltipMarkersGroup(),o=this.view.getRootView(),a=o.limitInPlot;try{for(var s=(0,Gx.__values)(t),u=s.next();!u.done;u=s.next()){var l=u.value,c=l.x,f=l.y;if(a||(null===i||void 0===i?void 0:i.getClip())){var h=uF(o.getCoordinate()),p=h.type,d=h.attrs;null===i||void 0===i||i.setClip({type:p,attrs:d})}else null===i||void 0===i||i.setClip(void 0);var y=this.view.getTheme(),g=(0,Ux.get)(y,["components","tooltip","marker"],{}),v=(0,Gx.__assign)((0,Gx.__assign)({fill:l.color,symbol:"circle",shadowColor:l.color},(0,Ux.isFunction)(e)?(0,Gx.__assign)((0,Gx.__assign)({},g),e(l)):e),{x:c,y:f});i.addShape("marker",{attrs:v})}}catch(t){r={error:t}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}},e.prototype.renderCrosshairs=function(t,e){var r=(0,Ux.get)(e,["crosshairs","type"],"x");"x"===r?(this.yCrosshair&&this.yCrosshair.hide(),this.renderXCrosshairs(t,e)):"y"===r?(this.xCrosshair&&this.xCrosshair.hide(),this.renderYCrosshairs(t,e)):"xy"===r&&(this.renderXCrosshairs(t,e),this.renderYCrosshairs(t,e))},e.prototype.renderXCrosshairs=function(t,e){var r,n,i=this.getViewWithGeometry(this.view).getCoordinate();if(i.isRect)i.isTransposed?(r={x:i.start.x,y:t.y},n={x:i.end.x,y:t.y}):(r={x:t.x,y:i.end.y},n={x:t.x,y:i.start.y});else{var o=sF(i,t),a=i.getCenter(),s=i.getRadius();n=XB(a.x,a.y,s,o),r=a}var u=(0,Ux.deepMix)({start:r,end:n,container:this.getTooltipCrosshairsGroup()},(0,Ux.get)(e,"crosshairs",{}),this.getCrosshairsText("x",t,e));delete u.type;var l=this.xCrosshair;l?l.update(u):(l=new ZD(u)).init(),l.render(),l.show(),this.xCrosshair=l},e.prototype.renderYCrosshairs=function(t,e){var r,n,i=this.getViewWithGeometry(this.view).getCoordinate();if(i.isRect){var o=void 0,a=void 0;i.isTransposed?(o={x:t.x,y:i.end.y},a={x:t.x,y:i.start.y}):(o={x:i.start.x,y:t.y},a={x:i.end.x,y:t.y}),r={start:o,end:a},n="Line"}else r={center:i.getCenter(),radius:aF(i,t),startAngle:i.startAngle,endAngle:i.endAngle},n="Circle";delete(r=(0,Ux.deepMix)({container:this.getTooltipCrosshairsGroup()},r,(0,Ux.get)(e,"crosshairs",{}),this.getCrosshairsText("y",t,e))).type;var s=this.yCrosshair;s?i.isRect&&"circle"===s.get("type")||!i.isRect&&"line"===s.get("type")?(s=new S[n](r)).init():s.update(r):(s=new S[n](r)).init(),s.render(),s.show(),this.yCrosshair=s},e.prototype.getCrosshairsText=function(t,e,r){var n=(0,Ux.get)(r,["crosshairs","text"]),i=(0,Ux.get)(r,["crosshairs","follow"]),o=this.items;if(n){var a=this.getViewWithGeometry(this.view),s=o[0],u=a.getXScale(),l=a.getYScales()[0],c=void 0,f=void 0;if(i){var h=this.view.getCoordinate().invert(e);c=u.invert(h.x),f=l.invert(h.y)}else c=s.data[u.field],f=s.data[l.field];var p="x"===t?c:f;return(0,Ux.isFunction)(n)?n=n(t,p,o,e):n.content=p,{text:n}}},e.prototype.getGuideGroup=function(){if(!this.guideGroup){var t=this.view.foregroundGroup;this.guideGroup=t.addGroup({name:"tooltipGuide",capture:!1})}return this.guideGroup},e.prototype.getTooltipMarkersGroup=function(){var t=this.tooltipMarkersGroup;return t&&!t.destroyed?(t.clear(),t.show()):((t=this.getGuideGroup().addGroup({name:"tooltipMarkersGroup"})).toFront(),this.tooltipMarkersGroup=t),t},e.prototype.getTooltipCrosshairsGroup=function(){var t=this.tooltipCrosshairsGroup;return t||((t=this.getGuideGroup().addGroup({name:"tooltipCrosshairsGroup",capture:!1})).toBack(),this.tooltipCrosshairsGroup=t),t},e.prototype.findItemsFromView=function(t,e){var r,n;if(!1===t.getOptions().tooltip)return[];var i=Jz(t,e,this.getTooltipCfg());try{for(var o=(0,Gx.__values)(t.views),a=o.next();!a.done;a=o.next()){var s=a.value;i=i.concat(this.findItemsFromView(s,e))}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},e.prototype.getViewWithGeometry=function(t){var e=this;return t.geometries.length?t:(0,Ux.find)(t.views,function(t){return e.getViewWithGeometry(t)})},e.prototype.getItemsAfterProcess=function(t){var e=this.getTooltipCfg().customItems;return(e||function(t){return t})(t)},e}(hG),dG={};function yG(t){return dG[t.toLowerCase()]}function gG(t,e){dG[t.toLowerCase()]=e}var vG={appear:{duration:450,easing:"easeQuadOut"},update:{duration:400,easing:"easeQuadInOut"},enter:{duration:400,easing:"easeQuadInOut"},leave:{duration:350,easing:"easeQuadIn"}},mG={interval:function(t){return{enter:{animation:t.isRect?t.isTransposed?"scale-in-x":"scale-in-y":"fade-in"},update:{animation:t.isPolar&&t.isTransposed?"sector-path-update":null},leave:{animation:"fade-out"}}},line:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},path:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},point:{appear:{animation:"zoom-in"},enter:{animation:"zoom-in"},leave:{animation:"zoom-out"}},area:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},polygon:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},schema:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},edge:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},label:{appear:{animation:"fade-in",delay:450},enter:{animation:"fade-in"},update:{animation:"position-update"},leave:{animation:"fade-out"}}},bG={line:function(){return{animation:"wave-in"}},area:function(){return{animation:"wave-in"}},path:function(){return{animation:"fade-in"}},interval:function(t){var e;return t.isRect?e=t.isTransposed?"grow-in-x":"grow-in-y":(e="grow-in-xy",t.isPolar&&t.isTransposed&&(e="wave-in")),{animation:e}},schema:function(t){return{animation:t.isRect?t.isTransposed?"grow-in-x":"grow-in-y":"grow-in-xy"}},polygon:function(){return{animation:"fade-in",duration:500}},edge:function(){return{animation:"fade-in"}}};function AG(t,e,r){var n=mG[t];return n&&((0,Ux.isFunction)(n)&&(n=n(e)),n=(0,Ux.deepMix)({},vG,n),r)?n[r]:n}function xG(t,e,r){var n=(0,Ux.get)(t.get("origin"),"data",zj),i=e.animation,o=function(t,e){return{delay:(0,Ux.isFunction)(t.delay)?t.delay(e):t.delay,easing:(0,Ux.isFunction)(t.easing)?t.easing(e):t.easing,duration:(0,Ux.isFunction)(t.duration)?t.duration(e):t.duration,callback:t.callback,repeat:t.repeat}}(e,n);if(i){var a=yG(i);a&&a(t,o,r)}else t.animate(r.toAttrs,o)}var wG=function(t){function e(e){var r=t.call(this,e)||this;r.labelShape=[],r.states=[];var n=e.shapeFactory,i=e.container,o=e.offscreenGroup,a=e.elementIndex,s=e.visible,u=void 0===s||s;return r.shapeFactory=n,r.container=i,r.offscreenGroup=o,r.visible=u,r.elementIndex=a,r}return(0,Gx.__extends)(e,t),e.prototype.draw=function(t,e){void 0===e&&(e=!1),this.model=t,this.data=t.data,this.shapeType=this.getShapeType(t),this.drawShape(t,e),!1===this.visible&&this.changeVisible(!1)},e.prototype.update=function(t){var e=this.shapeFactory,r=this.shape;if(r){this.model=t,this.data=t.data,this.shapeType=this.getShapeType(t),this.setShapeInfo(r,t);var n=this.getOffscreenGroup(),i=e.drawShape(this.shapeType,t,n);i.cfg.data=this.data,i.cfg.origin=t,i.cfg.element=this,this.syncShapeStyle(r,i,this.getStates(),this.getAnimateCfg("update"))}},e.prototype.destroy=function(){var e=this.shapeFactory,r=this.shape;if(r){var n=this.getAnimateCfg("leave");n?xG(r,n,{coordinate:e.coordinate,toAttrs:(0,Gx.__assign)({},r.attr())}):r.remove(!0)}this.states=[],this.shapeFactory=void 0,this.container=void 0,this.shape=void 0,this.animate=void 0,this.geometry=void 0,this.labelShape=[],this.model=void 0,this.data=void 0,this.offscreenGroup=void 0,this.statesStyle=void 0,t.prototype.destroy.call(this)},e.prototype.changeVisible=function(e){t.prototype.changeVisible.call(this,e),e?(this.shape&&this.shape.show(),this.labelShape&&this.labelShape.forEach(function(t){t.show()})):(this.shape&&this.shape.hide(),this.labelShape&&this.labelShape.forEach(function(t){t.hide()}))},e.prototype.setState=function(t,e){var r=this,n=r.states,i=r.shapeFactory,o=r.model,a=r.shape,s=r.shapeType,u=n.indexOf(t);if(e){if(u>-1)return;n.push(t),"active"!==t&&"selected"!==t||null===a||void 0===a||a.toFront()}else{if(-1===u)return;if(n.splice(u,1),"active"===t||"selected"===t){var l=this.geometry,c=l.sortZIndex,f=l.zIndexReversed?this.geometry.elements.length-this.elementIndex:this.elementIndex;c?a.setZIndex(f):a.set("zIndex",f)}}var h=i.drawShape(s,o,this.getOffscreenGroup());n.length?this.syncShapeStyle(a,h,n,null):this.syncShapeStyle(a,h,["reset"],null),h.remove(!0);var p={state:t,stateStatus:e,element:this,target:this.container};this.container.emit("statechange",p),RR(this.shape,"statechange",p)},e.prototype.clearStates=function(){var t=this,e=this.states;(0,Ux.each)(e,function(e){t.setState(e,!1)}),this.states=[]},e.prototype.hasState=function(t){return this.states.includes(t)},e.prototype.getStates=function(){return this.states},e.prototype.getData=function(){return this.data},e.prototype.getModel=function(){return this.model},e.prototype.getBBox=function(){var t=this.shape,e=this.labelShape,r={x:0,y:0,minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};return t&&(r=t.getCanvasBBox()),e&&e.forEach(function(t){var e=t.getCanvasBBox();r.x=Math.min(e.x,r.x),r.y=Math.min(e.y,r.y),r.minX=Math.min(e.minX,r.minX),r.minY=Math.min(e.minY,r.minY),r.maxX=Math.max(e.maxX,r.maxX),r.maxY=Math.max(e.maxY,r.maxY)}),r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r},e.prototype.getStatesStyle=function(){if(!this.statesStyle){var t=this.shapeType,e=this.geometry,r=this.shapeFactory,n=e.stateOption,i=r.defaultShapeType,o=r.theme[t]||r.theme[i];this.statesStyle=(0,Ux.deepMix)({},o,n)}return this.statesStyle},e.prototype.getStateStyle=function(t,e){var r=this.getStatesStyle(),n=(0,Ux.get)(r,[t,"style"],{}),i=n[e]||n;return(0,Ux.isFunction)(i)?i(this):i},e.prototype.getAnimateCfg=function(t){var e=this,r=this.animate;if(r){var n=r[t];return n?(0,Gx.__assign)((0,Gx.__assign)({},n),{callback:function(){var t;(0,Ux.isFunction)(n.callback)&&n.callback(),null===(t=e.geometry)||void 0===t||t.emit(jj.AFTER_DRAW_ANIMATE)}}):n}return null},e.prototype.drawShape=function(t,e){var r;void 0===e&&(e=!1);var n=this.shapeFactory,i=this.container,o=this.shapeType;if(this.shape=n.drawShape(o,t,i),this.shape){this.setShapeInfo(this.shape,t);var a=this.shape.cfg.name;a?(0,Ux.isString)(a)&&(this.shape.cfg.name=["element",a]):this.shape.cfg.name=["element",this.shapeFactory.geometryType];var s=e?"enter":"appear",u=this.getAnimateCfg(s);u&&(null===(r=this.geometry)||void 0===r||r.emit(jj.BEFORE_DRAW_ANIMATE),xG(this.shape,u,{coordinate:n.coordinate,toAttrs:(0,Gx.__assign)({},this.shape.attr())}))}},e.prototype.getOffscreenGroup=function(){if(!this.offscreenGroup){var t=this.container.getGroupBase();this.offscreenGroup=new t({})}return this.offscreenGroup},e.prototype.setShapeInfo=function(t,e){var r=this;(t.cfg.origin=e,t.cfg.element=this,t.isGroup())&&t.get("children").forEach(function(t){r.setShapeInfo(t,e)})},e.prototype.syncShapeStyle=function(t,e,r,n,i){var o,a=this;if(void 0===r&&(r=[]),void 0===i&&(i=0),t&&e){var s=t.get("clipShape"),u=e.get("clipShape");if(this.syncShapeStyle(s,u,r,n),t.isGroup())for(var l=t.get("children"),c=e.get("children"),f=0;f=0?e:r<=0?r:0},e.prototype.createAttrOption=function(t,e,r){if((0,Ux.isNil)(e)||(0,Ux.isObject)(e))(0,Ux.isObject)(e)&&(0,Ux.isEqual)(Object.keys(e),["values"])?(0,Ux.set)(this.attributeOption,t,{fields:e.values}):(0,Ux.set)(this.attributeOption,t,e);else{var n={};(0,Ux.isNumber)(e)?n.values=[e]:n.fields=RG(e),r&&((0,Ux.isFunction)(r)?n.callback=r:n.values=r),(0,Ux.set)(this.attributeOption,t,n)}},e.prototype.initAttributes=function(){var t=this,e=this.attributes,r=this.attributeOption,n=this.theme,i=this.shapeType;this.groupScales=[];var o={},a=function(a){if(r.hasOwnProperty(a)){var s=r[a];if(!s)return{value:void 0};var u=(0,Gx.__assign)({},s),l=u.callback,c=u.values,f=u.fields,h=(void 0===f?[]:f).map(function(e){var r=t.scales[e];!o[e]&&Fj.includes(a)&&("cat"===cF(r,(0,Ux.get)(t.scaleDefs,e),a,t.type)&&(t.groupScales.push(r),o[e]=!0));return r});u.scales=h,"position"!==a&&1===h.length&&"identity"===h[0].type?u.values=h[0].values:l||c||("size"===a?u.values=n.sizes:"shape"===a?u.values=n.shapes[i]||[]:"color"===a&&(h.length?u.values=h[0].values.length<=10?n.colors10:n.colors20:u.values=n.colors10));var p=IR(a);e[a]=new p(u)}};for(var s in r){var u=a(s);if("object"===BG(u))return u.value}},e.prototype.processData=function(t){var e,r;this.hasSorted=!1;for(var n=this.getAttribute("position").scales.filter(function(t){return t.isCategory}),i=this.groupData(t),o=[],a=0,s=i.length;ao&&(o=l)}var c=this.scaleDefs,f={};it.max&&!(0,Ux.get)(c,[n,"max"])&&(f.max=o),t.change(f)},e.prototype.beforeMapping=function(t){var e=t;if(this.sortable&&this.sort(e),this.generatePoints)for(var r=0,n=e.length;r1)for(var c=0;c0})}var YG=function(){function t(t){this.shapesMap={};var e=t.layout,r=t.container;this.layout=e,this.container=r}return t.prototype.render=function(t,e,r){return void 0===r&&(r=!1),(0,Gx.__awaiter)(this,void 0,void 0,function(){var n,i,o,a,s,u,l,c,f=this;return(0,Gx.__generator)(this,function(h){switch(h.label){case 0:if(n={},i=this.createOffscreenGroup(),!t.length)return[3,2];try{for(o=(0,Gx.__values)(t),a=o.next();!a.done;a=o.next())(s=a.value)&&(n[s.id]=this.renderLabel(s,i))}catch(t){l={error:t}}finally{try{a&&!a.done&&(c=o.return)&&c.call(o)}finally{if(l)throw l.error}}return[4,this.doLayout(t,e,n)];case 1:h.sent(),this.renderLabelLine(t,n),this.renderLabelBackground(t,n),this.adjustLabel(t,n),h.label=2;case 2:return u=this.shapesMap,(0,Ux.each)(n,function(t,e){if(t.destroyed)delete n[e];else{if(u[e]){var i=t.get("data"),o=t.get("origin"),a=t.get("coordinate"),s=t.get("animateCfg"),l=u[e];!function t(e,r,n){var i=n.data,o=n.origin,a=n.animateCfg,s=n.coordinate,u=(0,Ux.get)(a,"update");e.set("data",i),e.set("origin",o),e.set("animateCfg",a),e.set("coordinate",s),e.set("visible",r.get("visible")),(e.getChildren()||[]).forEach(function(l,c){var f=r.getChildByIndex(c);if(f){l.set("data",i),l.set("origin",o),l.set("animateCfg",a),l.set("coordinate",s);var h=$B(l,f);u?xG(l,u,{toAttrs:h,coordinate:s}):l.attr(h),f.isGroup()&&t(l,f,n)}else e.removeChild(l),l.remove(!0)}),(0,Ux.each)(r.getChildren(),function(t,r){(0,Ux.isArray)(e.getChildren())&&r>=e.getCount()&&(t.destroyed||e.add(t))})}(l,n[e],{data:i,origin:o,animateCfg:s,coordinate:a}),n[e]=l}else{if(f.container.destroyed)return;f.container.add(t);var c=(0,Ux.get)(t.get("animateCfg"),r?"enter":"appear");c&&xG(t,c,{toAttrs:(0,Gx.__assign)({},t.attr()),coordinate:t.get("coordinate")})}delete u[e]}}),(0,Ux.each)(u,function(t){var e=(0,Ux.get)(t.get("animateCfg"),"leave");e?xG(t,e,{toAttrs:null,coordinate:t.get("coordinate")}):t.remove(!0)}),this.shapesMap=n,i.destroy(),[2]}})})},t.prototype.clear=function(){this.container.clear(),this.shapesMap={}},t.prototype.destroy=function(){this.container.destroy(),this.shapesMap=null},t.prototype.renderLabel=function(t,e){var r,n=t.id,i=t.elementId,o=t.data,a=t.mappingData,s=t.coordinate,u=t.animate,l=t.content,c={id:n,elementId:i,capture:t.capture,data:o,origin:(0,Gx.__assign)((0,Gx.__assign)({},a),{data:a[zj]}),coordinate:s},f=e.addGroup((0,Gx.__assign)({name:"label",animateCfg:!1!==this.animate&&null!==u&&!1!==u&&(0,Ux.deepMix)({},this.animate,u)},c));if(l.isGroup&&l.isGroup()||l.isShape&&l.isShape()){var h=l.getCanvasBBox(),p=h.width,d=h.height,y=(0,Ux.get)(t,"textAlign","left"),g=t.x,v=t.y-d/2;"center"===y?g-=p/2:"right"!==y&&"end"!==y||(g-=p),GG(l,g,v),r=l,f.add(l)}else{var m=(0,Ux.get)(t,["style","fill"]);r=f.addShape("text",(0,Gx.__assign)({attrs:(0,Gx.__assign)((0,Gx.__assign)({x:t.x,y:t.y,textAlign:t.textAlign,textBaseline:(0,Ux.get)(t,"textBaseline","middle"),text:t.content},t.style),{fill:(0,Ux.isNull)(m)?t.color:m})},c))}return t.rotate&&UG(r,t.rotate),f},t.prototype.doLayout=function(t,e,r){return(0,Gx.__awaiter)(this,void 0,void 0,function(){var n,i=this;return(0,Gx.__generator)(this,function(o){switch(o.label){case 0:return this.layout?(n=(0,Ux.isArray)(this.layout)?this.layout:[this.layout],[4,Promise.all(n.map(function(n){var o=kG((0,Ux.get)(n,"type",""));if(o){var a=[],s=[];return(0,Ux.each)(r,function(t,r){a.push(t),s.push(e[t.get("elementId")])}),o(t,a,s,i.region,n.cfg)}}))]):[3,2];case 1:o.sent(),o.label=2;case 2:return[2]}})})},t.prototype.renderLabelLine=function(t,e){(0,Ux.each)(t,function(t){var r=(0,Ux.get)(t,"coordinate");if(t&&r){var n=r.getCenter(),i=r.getRadius();if(t.labelLine){var o=(0,Ux.get)(t,"labelLine",{}),a=t.id,s=o.path;if(!s){var u=XB(n.x,n.y,i,t.angle);s=[["M",u.x,u.y],["L",t.x,t.y]]}var l=e[a];l.destroyed||l.addShape("path",{capture:!1,attrs:(0,Gx.__assign)({path:s,stroke:t.color?t.color:(0,Ux.get)(t,["style","fill"],"#000"),fill:null},o.style),id:a,origin:t.mappingData,data:t.data,coordinate:t.coordinate})}}})},t.prototype.renderLabelBackground=function(t,e){(0,Ux.each)(t,function(t){var r=(0,Ux.get)(t,"coordinate"),n=(0,Ux.get)(t,"background");if(n&&r){var i=t.id,o=e[i];if(!o.destroyed){var a=o.getChildren()[0];if(a){var s=VG(o,t,n.padding),u=s.rotation,l=(0,Gx.__rest)(s,["rotation"]),c=o.addShape("rect",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},l),n.style||{}),id:i,origin:t.mappingData,data:t.data,coordinate:t.coordinate});if(c.setZIndex(-1),u){var f=a.getMatrix();c.setMatrix(f)}}}}})},t.prototype.createOffscreenGroup=function(){return new(this.container.getGroupBase())({})},t.prototype.adjustLabel=function(t,e){(0,Ux.each)(t,function(t){if(t){var r=t.id,n=e[r];if(!n.destroyed){var i=n.findAll(function(t){return"path"!==t.get("type")});(0,Ux.each)(i,function(e){e&&(t.offsetX&&e.attr("x",e.attr("x")+t.offsetX),t.offsetY&&e.attr("y",e.attr("y")+t.offsetY))})}}})},t}();function WG(t){var e=0;return(0,Ux.each)(t,function(t){e+=t}),e/t.length}var qG=function(){function t(t){this.geometry=t}return t.prototype.getLabelItems=function(t){var e=this,r=[],n=this.getLabelCfgs(t);return(0,Ux.each)(t,function(t,i){var o=n[i];if(!o||(0,Ux.isNil)(t.x)||(0,Ux.isNil)(t.y))r.push(null);else{var a=(0,Ux.isArray)(o.content)?o.content:[o.content];o.content=a;var s=a.length;(0,Ux.each)(a,function(n,i){if((0,Ux.isNil)(n)||""===n)r.push(null);else{var a=(0,Gx.__assign)((0,Gx.__assign)({},o),e.getLabelPoint(o,t,i));a.textAlign||(a.textAlign=e.getLabelAlign(a,i,s)),a.offset<=0&&(a.labelLine=null),r.push(a)}})}}),r},t.prototype.render=function(t,e){return void 0===e&&(e=!1),(0,Gx.__awaiter)(this,void 0,void 0,function(){var r,n,i;return(0,Gx.__generator)(this,function(o){switch(o.label){case 0:return r=this.getLabelItems(t),n=this.getLabelsRenderer(),i=this.getGeometryShapes(),[4,n.render(r,i,e)];case 1:return o.sent(),[2]}})})},t.prototype.clear=function(){var t=this.labelsRenderer;t&&t.clear()},t.prototype.destroy=function(){var t=this.labelsRenderer;t&&t.destroy(),this.labelsRenderer=null},t.prototype.getCoordinate=function(){return this.geometry.coordinate},t.prototype.getDefaultLabelCfg=function(t,e){var r=this.geometry,n=r.type,i=r.theme;return"polygon"===n||"interval"===n&&"middle"===e||t<0&&!["line","point","path"].includes(n)?(0,Ux.get)(i,"innerLabels",{}):(0,Ux.get)(i,"labels",{})},t.prototype.getThemedLabelCfg=function(t){var e=this.geometry,r=this.getDefaultLabelCfg(),n=e.type,i=e.theme;return"polygon"===n||t.offset<0&&!["line","point","path"].includes(n)?(0,Ux.deepMix)({},r,i.innerLabels,t):(0,Ux.deepMix)({},r,i.labels,t)},t.prototype.setLabelPosition=function(t,e,r,n){},t.prototype.getLabelOffset=function(t){var e=this.getCoordinate(),r=this.getOffsetVector(t);return e.isTransposed?r[0]:r[1]},t.prototype.getLabelOffsetPoint=function(t,e,r){var n=t.offset,i=this.getCoordinate().isTransposed,o=i?"x":"y",a=i?1:-1,s={x:0,y:0};return s[o]=e>0||1===r?n*a:n*a*-1,s},t.prototype.getLabelPoint=function(t,e,r){var n=this.getCoordinate(),i=t.content.length;function o(e,r,n){void 0===n&&(n=!1);var i=e;return(0,Ux.isArray)(i)&&(i=1===t.content.length?n?WG(i):i.length<=2?i[e.length-1]:WG(i):i[r]),i}var a={content:t.content[r],x:0,y:0,start:{x:0,y:0},color:"#fff"},s=(0,Ux.isArray)(e.shape)?e.shape[0]:e.shape,u="funnel"===s||"pyramid"===s;if("polygon"===this.geometry.type){var l=function(t,e){if((0,Ux.isNumber)(t)&&(0,Ux.isNumber)(e))return[t,e];if(e=e,WB(t=t)||WB(e))return[qB(t),qB(e)];for(var r,n,i=-1,o=0,a=0,s=t.length-1,u=0;++i1&&0===e&&("right"===n?n="left":"left"===n&&(n="right"))}return n},t.prototype.getLabelId=function(t){var e=this.geometry,r=e.type,n=e.getXScale(),i=e.getYScale(),o=t[zj],a=e.getElementId(t);return"line"===r||"area"===r?a+=" ".concat(o[n.field]):"path"===r&&(a+=" ".concat(o[n.field],"-").concat(o[i.field])),a},t.prototype.getLabelsRenderer=function(){var t=this.geometry,e=t.labelsContainer,r=t.labelOption,n=t.canvasRegion,i=t.animateOption,o=this.geometry.coordinate,a=this.labelsRenderer;return a||(a=new YG({container:e,layout:(0,Ux.get)(r,["cfg","layout"],{type:this.defaultLayout})}),this.labelsRenderer=a),a.region=n,a.animate=!!i&&AG("label",o),a},t.prototype.getLabelCfgs=function(t){var e=this,r=this.geometry,n=r.labelOption,i=r.scales,o=r.coordinate,a=n,s=a.fields,u=a.callback,l=a.cfg,c=s.map(function(t){return i[t]}),f=[];return(0,Ux.each)(t,function(t,r){var n,i=t[zj],a=e.getLabelText(i,c);if(u){var h=s.map(function(t){return i[t]});if(n=u.apply(void 0,(0,Gx.__spreadArray)([],(0,Gx.__read)(h),!1)),(0,Ux.isNil)(n))return void f.push(null)}var p=(0,Gx.__assign)((0,Gx.__assign)({id:e.getLabelId(t),elementId:e.geometry.getElementId(t),data:i,mappingData:t,coordinate:o},l),n);(0,Ux.isFunction)(p.position)&&(p.position=p.position(i,t,r));var d=e.getLabelOffset(p.offset||0),y=e.getDefaultLabelCfg(d,p.position);(p=(0,Ux.deepMix)({},y,p)).offset=e.getLabelOffset(p.offset||0);var g=p.content;(0,Ux.isFunction)(g)?p.content=g(i,t,r):(0,Ux.isUndefined)(g)&&(p.content=a[0]),f.push(p)}),f},t.prototype.getLabelText=function(t,e){var r=[];return(0,Ux.each)(e,function(e){var n=t[e.field];n=(0,Ux.isArray)(n)?n.map(function(t){return e.getText(t)}):e.getText(n),(0,Ux.isNil)(n)||""===n?r.push(null):r.push(n)}),r},t.prototype.getOffsetVector=function(t){void 0===t&&(t=0);var e=this.getCoordinate(),r=0;return(0,Ux.isNumber)(t)&&(r=t),e.isTransposed?e.applyMatrix(r,0):e.applyMatrix(0,r)},t.prototype.getGeometryShapes=function(){var t=this.geometry,e={};return(0,Ux.each)(t.elementsMap,function(t,r){e[r]=t.shape}),(0,Ux.each)(t.getOffscreenGroup().getChildren(),function(r){var n=t.getElementId(r.get("origin").mappingData);e[n]=r}),e},t}();function XG(t,e,r){if(!t)return r;var n;if(t.callback&&t.callback.length>1){var i=Array(t.callback.length-1).fill("");n=t.mapping.apply(t,(0,Gx.__spreadArray)([e],(0,Gx.__read)(i),!1)).join("")}else n=t.mapping(e).join("");return n||r}var KG={hexagon:function(t,e,r){var n=r/2*Math.sqrt(3);return[["M",t,e-r],["L",t+n,e-r/2],["L",t+n,e+r/2],["L",t,e+r],["L",t-n,e+r/2],["L",t-n,e-r/2],["Z"]]},bowtie:function(t,e,r){var n=r-1.5;return[["M",t-r,e-n],["L",t+r,e+n],["L",t+r,e-n],["L",t-r,e+n],["Z"]]},cross:function(t,e,r){return[["M",t-r,e-r],["L",t+r,e+r],["M",t+r,e-r],["L",t-r,e+r]]},tick:function(t,e,r){return[["M",t-r/2,e-r],["L",t+r/2,e-r],["M",t,e-r],["L",t,e+r],["M",t-r/2,e+r],["L",t+r/2,e+r]]},plus:function(t,e,r){return[["M",t-r,e],["L",t+r,e],["M",t,e-r],["L",t,e+r]]},hyphen:function(t,e,r){return[["M",t-r,e],["L",t+r,e]]},line:function(t,e,r){return[["M",t,e-r],["L",t,e+r]]}},JG=["line","cross","tick","plus","hyphen"];function ZG(t){var e=t.symbol;(0,Ux.isString)(e)&&KG[e]&&(t.symbol=KG[e])}function $G(t){return t.startsWith(Mj.LEFT)||t.startsWith(Mj.RIGHT)?"vertical":"horizontal"}function tU(t,e,r,n,i){var o=r.getScale(r.type);if(o.isCategory){var a=o.field,s=e.getAttribute("color"),u=e.getAttribute("shape"),l=t.getTheme().defaultColor,c=e.coordinate.isPolar;return o.getTicks().map(function(r,f){var h,p=r.text,d=r.value,y=p,g=o.invert(d),v=0===t.filterFieldData(a,[(h={},h[a]=g,h)]).length;(0,Ux.each)(t.views,function(t){var e;t.filterFieldData(a,[(e={},e[a]=g,e)]).length||(v=!0)});var m,b,A=XG(s,g,l),x=XG(u,g,"point"),w=e.getShapeMarker(x,{color:A,isInPolar:c}),_=i;return(0,Ux.isFunction)(_)&&(_=_(y,f,(0,Gx.__assign)({name:y,value:g},(0,Ux.deepMix)({},n,w)))),function(t,e){var r=t.symbol;if((0,Ux.isString)(r)&&-1!==JG.indexOf(r)){var n=(0,Ux.get)(t,"style",{}),i=(0,Ux.get)(n,"lineWidth",1),o=n.stroke||n.fill||e;t.style=(0,Ux.deepMix)({},t.style,{lineWidth:i,stroke:o,fill:null})}}(w=(0,Ux.deepMix)({},n,w,rF((0,Gx.__assign)({},_),["style"])),A),_&&_.style&&(w.style=(m=w.style,b=_.style,(0,Ux.isFunction)(b)?b(m):(0,Ux.deepMix)({},m,b))),ZG(w),{id:g,name:y,value:g,marker:w,unchecked:v}})}return[]}function eU(t,e){var r=(0,Ux.get)(t,["components","legend"],{});return(0,Ux.deepMix)({},(0,Ux.get)(r,["common"],{}),(0,Ux.deepMix)({},(0,Ux.get)(r,[e],{})))}function rU(t){return!t&&(null===t||void 0===t||isNaN(t))}function nU(t){if((0,Ux.isArray)(t))return rU(t[1].y);var e=t.y;return(0,Ux.isArray)(e)?rU(e[0]):rU(e)}function iU(t,e,r){if(void 0===e&&(e=!1),void 0===r&&(r=!0),!t.length||1===t.length&&!r)return[];if(e){for(var n=[],i=0,o=t.length;i0&&(l[0][0]="L")),o=o.concat(l)}),o.push(["Z"])}return o}function MU(t,e,r,n,i){for(var o=sU(t,e,!e,"lineWidth"),a=t.connectNulls,s=t.isInCircle,u=iU(t.points,a,t.showSinglePoint),l=[],c=0,f=u.length;cn&&(n=i),i=e[0]}));var p=this.scales[f];try{for(var d=(0,Gx.__values)(t),y=d.next();!y.done;y=d.next()){var g=y.value,v=this.getDrawCfg(g),m=v.x,b=v.y,A=p.scale(g[zj][f]);this.drawGrayScaleBlurredCircle(m-s.x,b-u.y,r+n,A,h)}}catch(t){i={error:t}}finally{try{y&&!y.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}var x=h.getImageData(0,0,l,c);this.clearShadowCanvasCtx(),this.colorize(x),h.putImageData(x,0,0);var w=this.getImageShape();w.attr("x",s.x),w.attr("y",u.y),w.attr("width",l),w.attr("height",c),w.attr("img",h.canvas),w.set("origin",this.getShapeInfo(t))},e.prototype.getDefaultSize=function(){var t=this.getAttribute("position"),e=this.coordinate;return Math.min(e.getWidth()/(4*t.scales[0].ticks.length),e.getHeight()/(4*t.scales[1].ticks.length))},e.prototype.clearShadowCanvasCtx=function(){var t=this.getShadowCanvasCtx();t.clearRect(0,0,t.canvas.width,t.canvas.height)},e.prototype.getShadowCanvasCtx=function(){var t=this.shadowCanvas;return t||(t=document.createElement("canvas"),this.shadowCanvas=t),t.width=this.coordinate.getWidth(),t.height=this.coordinate.getHeight(),t.getContext("2d")},e.prototype.getGrayScaleBlurredCanvas=function(){return this.grayScaleBlurredCanvas||(this.grayScaleBlurredCanvas=document.createElement("canvas")),this.grayScaleBlurredCanvas},e.prototype.drawGrayScaleBlurredCircle=function(t,e,r,n,i){var o=this.getGrayScaleBlurredCanvas();i.globalAlpha=n,i.drawImage(o,t-r,e-r)},e.prototype.colorize=function(t){for(var e=this.getAttribute("color"),r=t.data,n=this.paletteCache,i=3;ie&&(n=e-(r=r?e/(1+n/r):0)),i+o>e&&(o=e-(i=i?e/(1+o/i):0)),[r||0,n||0,i||0,o||0]}function FU(t,e,r){var n=[];if(r.isRect){var i=r.isTransposed?{x:r.start.x,y:e[0].y}:{x:e[0].x,y:r.start.y},o=r.isTransposed?{x:r.end.x,y:e[2].y}:{x:e[3].x,y:r.end.y},a=(0,Ux.get)(t,["background","style","radius"]);if(a){var s=r.isTransposed?Math.abs(e[0].y-e[2].y):e[2].x-e[1].x,u=r.isTransposed?r.getWidth():r.getHeight(),l=(0,Gx.__read)(BU(a,Math.min(s,u)),4),c=l[0],f=l[1],h=l[2],p=l[3],d=r.isTransposed&&r.isReflect("y"),y=d?0:1,g=function(t){return d?-t:t};n.push(["M",i.x,o.y+g(c)]),0!==c&&n.push(["A",c,c,0,0,y,i.x+c,o.y]),n.push(["L",o.x-f,o.y]),0!==f&&n.push(["A",f,f,0,0,y,o.x,o.y+g(f)]),n.push(["L",o.x,i.y-g(h)]),0!==h&&n.push(["A",h,h,0,0,y,o.x-h,i.y]),n.push(["L",i.x+p,i.y]),0!==p&&n.push(["A",p,p,0,0,y,i.x,i.y-g(p)])}else n.push(["M",i.x,i.y]),n.push(["L",o.x,i.y]),n.push(["L",o.x,o.y]),n.push(["L",i.x,o.y]),n.push(["L",i.x,i.y]);n.push(["z"])}if(r.isPolar){var v=r.getCenter(),m=ZB(t,r),b=m.startAngle,A=m.endAngle;if("theta"===r.type||r.isTransposed){var x=function(t){return Math.pow(t,2)};c=Math.sqrt(x(v.x-e[0].x)+x(v.y-e[0].y)),f=Math.sqrt(x(v.x-e[2].x)+x(v.y-e[2].y));n=KB(v.x,v.y,c,r.startAngle,r.endAngle,f)}else n=KB(v.x,v.y,r.getRadius(),b,A)}return n}function zU(t,e,r){var n=[];return(0,Ux.isNil)(e)?r?n.push(["M",t[0].x,t[0].y],["L",t[1].x,t[1].y],["L",(t[2].x+t[3].x)/2,(t[2].y+t[3].y)/2],["Z"]):n.push(["M",t[0].x,t[0].y],["L",t[1].x,t[1].y],["L",t[2].x,t[2].y],["L",t[3].x,t[3].y],["Z"]):n.push(["M",t[0].x,t[0].y],["L",t[1].x,t[1].y],["L",e[1].x,e[1].y],["L",e[0].x,e[0].y],["Z"]),n}function GU(t,e){return[e,t]}PG("interval",{defaultShapeType:"rect",getDefaultPoints:function(t){return RU(t)}});LG("interval","rect",{draw:function(t,e){var r,n=sU(t,!1,!0),i=e,o=null===t||void 0===t?void 0:t.background;if(o){i=e.addGroup({name:"interval-group"});var a=uU(t),s=FU(t,this.parsePoints(t.points),this.coordinate);i.addShape("path",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},a),{path:s}),capture:!1,zIndex:-1,name:"element-background"})}r=n.radius&&this.coordinate.isRect?function(t,e,r){var n,i,o,a,s,u,l,c=(0,Gx.__read)((0,Gx.__spreadArray)([],(0,Gx.__read)(t),!1),4),f=c[0],h=c[1],p=c[2],d=c[3],y=(0,Gx.__read)("number"==typeof r?Array(4).fill(r):r,4),g=y[0],v=y[1],m=y[2],b=y[3];e.isTransposed&&(h=(n=(0,Gx.__read)(GU(h,d),2))[0],d=n[1]),e.isReflect("y")&&(f=(i=(0,Gx.__read)(GU(f,h),2))[0],h=i[1],p=(o=(0,Gx.__read)(GU(p,d),2))[0],d=o[1]),e.isReflect("x")&&(f=(a=(0,Gx.__read)(GU(f,d),2))[0],d=a[1],h=(s=(0,Gx.__read)(GU(h,p),2))[0],p=s[1]);var A=[],x=function(t){return Math.abs(t)};return g=(u=(0,Gx.__read)(BU([g,v,m,b],Math.min(x(d.x-f.x),x(h.y-f.y))).map(function(t){return x(t)}),4))[0],v=u[1],m=u[2],b=u[3],e.isTransposed&&(g=(l=(0,Gx.__read)([b,g,v,m],4))[0],v=l[1],m=l[2],b=l[3]),f.y1){i.sort();var y=function(t,e){var r=t.length,n=t;(0,Ux.isString)(n[0])&&(n=t.map(function(t){return e.translate(t)}));for(var i=n[1]-n[0],o=2;oa&&(i=a)}return i}(i,n);a=(n.max-n.min)/y,i.length>a&&(a=i.length)}var g=n.range,v=1/a,m=1;(r.isPolar?m=r.isTransposed&&a>1?p:d:(n.isLinear&&(v*=g[1]-g[0]),m=h),!(0,Ux.isNil)(u)&&u>=0)?v=(1-(a-1)*(u/s))/a:v*=m;if(t.getAdjust("dodge")){var b=function(t,e){if(e){var r=(0,Ux.flatten)(t);return(0,Ux.valuesOfKey)(r,e).length}return t.length}(o,t.getAdjust("dodge").dodgeBy);if(!(0,Ux.isNil)(l)&&l>=0)v=(v-l/s*(b-1))/b;else!(0,Ux.isNil)(u)&&u>=0?(v*=m,v/=b):v/=b;v=v>=0?v:0}if(!(0,Ux.isNil)(c)&&c>=0){var A=c/s;v>A&&(v=A)}if(!(0,Ux.isNil)(f)&&f>=0){var x=f/s;v0&&!(0,Ux.get)(i,[o,"min"])&&n.change({min:0}),s<=0&&!(0,Ux.get)(i,[o,"max"])&&n.change({max:0}))}},e.prototype.getDrawCfg=function(e){var r=t.prototype.getDrawCfg.call(this,e);return r.background=this.background,r},e}(FG),VU=function(t){function e(e){var r=t.call(this,e)||this;r.type="line";var n=e.sortable,i=void 0!==n&&n;return r.sortable=i,r}return(0,Gx.__extends)(e,t),e}(TU),QU=["circle","square","bowtie","diamond","hexagon","triangle","triangle-down"];function YU(t,e,r,n,i){var o,a,s=sU(e,i,!i,"r"),u=t.parsePoints(e.points),l=u[0];if(e.isStack)l=u[1];else if(u.length>1){var c=r.addGroup();try{for(var f=(0,Gx.__values)(u),h=f.next();!h.done;h=f.next()){var p=h.value;c.addShape({type:"marker",attrs:(0,Gx.__assign)((0,Gx.__assign)((0,Gx.__assign)({},s),{symbol:KG[n]||n}),p)})}}catch(t){o={error:t}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}return c}return r.addShape({type:"marker",attrs:(0,Gx.__assign)((0,Gx.__assign)((0,Gx.__assign)({},s),{symbol:KG[n]||n}),l)})}PG("point",{defaultShapeType:"hollow-circle",getDefaultPoints:function(t){return lU(t)}});(0,Ux.each)(QU,function(t){LG("point","hollow-".concat(t),{draw:function(e,r){return YU(this,e,r,t,!0)},getMarker:function(e){var r=e.color;return{symbol:KG[t]||t,style:{r:4.5,stroke:r,fill:null}}}})});var WU=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="point",e.shapeType="point",e.generatePoints=!0,e}return(0,Gx.__extends)(e,t),e.prototype.getDrawCfg=function(e){var r=t.prototype.getDrawCfg.call(this,e);return(0,Gx.__assign)((0,Gx.__assign)({},r),{isStack:!!this.getAdjust("stack")})},e}(FG);PG("polygon",{defaultShapeType:"polygon",getDefaultPoints:function(t){var e=[];return(0,Ux.each)(t.x,function(r,n){var i=t.y[n];e.push({x:r,y:i})}),e}});LG("polygon","polygon",{draw:function(t,e){if(!(0,Ux.isEmpty)(t.points)){var r=sU(t,!0,!0),n=this.parsePath(function(t){for(var e=t[0],r=1,n=[["M",e.x,e.y]];r2?"weight":"normal";if(t.isInCircle){var a={x:0,y:1};return"normal"===o?r=function(t,e,r){var n=ZU(e,r),i=[["M",t.x,t.y]];return i.push(n),i}(i[0],i[1],a):(n.fill=n.stroke,r=function(t,e){var r=ZU(t[1],e),n=ZU(t[3],e),i=[["M",t[0].x,t[0].y]];return i.push(n),i.push(["L",t[3].x,t[3].y]),i.push(["L",t[2].x,t[2].y]),i.push(r),i.push(["L",t[1].x,t[1].y]),i.push(["L",t[0].x,t[0].y]),i.push(["Z"]),i}(i,a)),r=this.parsePath(r),e.addShape("path",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},n),{path:r})})}if("normal"===o)return r=JB(((i=this.parsePoints(i))[1].x+i[0].x)/2,i[0].y,Math.abs(i[1].x-i[0].x)/2,Math.PI,2*Math.PI),e.addShape("path",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},n),{path:r})});var s=JU(i[1],i[3]),u=JU(i[2],i[0]);return r=[["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],s,["L",i[3].x,i[3].y],["L",i[2].x,i[2].y],u,["Z"]],r=this.parsePath(r),n.fill=n.stroke,e.addShape("path",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},n),{path:r})})},getMarker:function(t){return{symbol:"circle",style:{r:4.5,fill:t.color}}}}),LG("edge","smooth",{draw:function(t,e){var r=sU(t,!0,!1,"lineWidth"),n=t.points,i=this.parsePath(function(t,e){var r=JU(t,e),n=[["M",t.x,t.y]];return n.push(r),n}(n[0],n[1]));return e.addShape("path",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},r),{path:i})})},getMarker:function(t){return{symbol:"circle",style:{r:4.5,fill:t.color}}}});var $U=1/3;LG("edge","vhv",{draw:function(t,e){var r=sU(t,!0,!1,"lineWidth"),n=t.points,i=this.parsePath(function(t,e){var r=[];r.push({x:t.x,y:t.y*(1-$U)+e.y*$U}),r.push({x:e.x,y:t.y*(1-$U)+e.y*$U}),r.push(e);var n=[["M",t.x,t.y]];return(0,Ux.each)(r,function(t){n.push(["L",t.x,t.y])}),n}(n[0],n[1]));return e.addShape("path",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},r),{path:i})})},getMarker:function(t){return{symbol:"circle",style:{r:4.5,fill:t.color}}}}),LG("interval","funnel",{getPoints:function(t){return t.size=2*t.size,RU(t)},draw:function(t,e){var r=sU(t,!1,!0),n=this.parsePath(zU(t.points,t.nextPoints,!1));return e.addShape("path",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},r),{path:n}),name:"interval"})},getMarker:function(t){return{symbol:"square",style:{r:4,fill:t.color}}}}),LG("interval","hollow-rect",{draw:function(t,e){var r=sU(t,!0,!1),n=e,i=null===t||void 0===t?void 0:t.background;if(i){n=e.addGroup();var o=uU(t),a=FU(t,this.parsePoints(t.points),this.coordinate);n.addShape("path",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},o),{path:a}),capture:!1,zIndex:-1,name:"element-background"})}var s=this.parsePath(DU(t.points)),u=n.addShape("path",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},r),{path:s}),name:"interval"});return i?n:u},getMarker:function(t){var e=t.color;return t.isInPolar?{symbol:"circle",style:{r:4.5,stroke:e,fill:null}}:{symbol:"square",style:{r:4,stroke:e,fill:null}}}}),LG("interval","line",{getPoints:function(t){return r=(e=t).x,n=e.y,i=e.y0,(0,Ux.isArray)(n)?n.map(function(t,e){return{x:(0,Ux.isArray)(r)?r[e]:r,y:t}}):[{x:r,y:i},{x:r,y:n}];var e,r,n,i},draw:function(t,e){var r=sU(t,!0,!1,"lineWidth"),n=rF((0,Gx.__assign)({},r),["fill"]),i=this.parsePath(DU(t.points,!1));return e.addShape("path",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},n),{path:i}),name:"interval"})},getMarker:function(t){return{symbol:function(t,e,r){return[["M",t,e-r],["L",t,e+r]]},style:{r:5,stroke:t.color}}}}),LG("interval","pyramid",{getPoints:function(t){return t.size=2*t.size,RU(t)},draw:function(t,e){var r=sU(t,!1,!0),n=this.parsePath(zU(t.points,t.nextPoints,!0));return e.addShape("path",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},r),{path:n}),name:"interval"})},getMarker:function(t){return{symbol:"square",style:{r:4,fill:t.color}}}}),LG("interval","tick",{getPoints:function(t){return function(t){var e,r,n,i=t.x,o=t.y,a=t.y0,s=t.size;(0,Ux.isArray)(o)?(r=(e=(0,Gx.__read)(o,2))[0],n=e[1]):(r=a,n=o);var u=i+s/2,l=i-s/2;return[{x:i,y:r},{x:i,y:n},{x:l,y:r},{x:u,y:r},{x:l,y:n},{x:u,y:n}]}(t)},draw:function(t,e){var r,n=sU(t,!0,!1),i=this.parsePath([["M",(r=t.points)[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["M",r[4].x,r[4].y],["L",r[5].x,r[5].y]]);return e.addShape("path",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},n),{path:i}),name:"interval"})},getMarker:function(t){return{symbol:function(t,e,r){return[["M",t-r/2,e-r],["L",t+r/2,e-r],["M",t,e-r],["L",t,e+r],["M",t-r/2,e+r],["L",t+r/2,e+r]]},style:{r:5,stroke:t.color}}}});var tH=function(t,e,r){var n,i=t.x,o=t.y,a=e.x,s=e.y;switch(r){case"hv":n=[{x:a,y:o}];break;case"vh":n=[{x:i,y:s}];break;case"hvh":var u=(a+i)/2;n=[{x:u,y:o},{x:u,y:s}];break;case"vhv":var l=(o+s)/2;n=[{x:i,y:l},{x:a,y:l}]}return n};function eH(t,e){var r=iU(t.points,t.connectNulls,t.showSinglePoint),n=[];return(0,Ux.each)(r,function(t){var r=function(t,e){var r=[];return(0,Ux.each)(t,function(n,i){var o=t[i+1];if(r.push(n),o){var a=tH(n,o,e);r=r.concat(a)}}),r}(t,e);n=n.concat(r.map(function(t,e){return 0===e?["M",t.x,t.y]:["L",t.x,t.y]}))}),(0,Gx.__assign)((0,Gx.__assign)({},sU(t,!0,!1,"lineWidth")),{path:n})}function rH(t){var e=(0,Ux.isArray)(t)?t:[t],r=e[0],n=e[e.length-1],i=e.length>1?e[1]:r;return{min:r,max:n,min1:i,max1:e.length>3?e[3]:n,median:e.length>2?e[2]:i}}function nH(t,e,r){var n,i=r/2;if((0,Ux.isArray)(e)){var o=rH(e),a=o.min,s=o.max,u=o.median,l=o.min1,c=t-i,f=t+i;n=[[c,s],[f,s],[t,s],[t,h=o.max1],[c,l],[c,h],[f,h],[f,l],[t,l],[t,a],[c,a],[f,a],[c,u],[f,u]]}else{e=(0,Ux.isNil)(e)?.5:e;var h,p=rH(t),d=(a=p.min,s=p.max,u=p.median,e-i),y=e+i;n=[[a,d],[a,y],[a,e],[l=p.min1,e],[l,d],[l,y],[h=p.max1,y],[h,d],[h,e],[s,e],[s,d],[s,y],[u,d],[u,y]]}return n.map(function(t){return{x:t[0],y:t[1]}})}function iH(t){var e=((0,Ux.isArray)(t)?t:[t]).sort(function(t,e){return e-t});return function(t,e,r){if((0,Ux.isString)(t))return t.padEnd(e,r);if((0,Ux.isArray)(t)){var n=t.length;if(n1){var s=e.addGroup();try{for(var u=(0,Gx.__values)(o),l=u.next();!l.done;l=u.next()){var c=l.value;s.addShape("image",{attrs:{x:c.x-i/2,y:c.y-i,width:i,height:i,img:t.shape[1]}})}}catch(t){r={error:t}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return s}return e.addShape("image",{attrs:{x:a.x-i/2,y:a.y-i,width:i,height:i,img:t.shape[1]}})},getMarker:function(t){return{symbol:"circle",style:{r:4.5,fill:t.color}}}}),(0,Ux.each)(QU,function(t){LG("point",t,{draw:function(e,r){return YU(this,e,r,t,!1)},getMarker:function(e){var r=e.color;return{symbol:KG[t]||t,style:{r:4.5,fill:r}}}})}),LG("schema","box",{getPoints:function(t){return nH(t.x,t.y,t.size)},draw:function(t,e){var r,n=sU(t,!0,!1),i=this.parsePath([["M",(r=t.points)[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["M",r[4].x,r[4].y],["L",r[5].x,r[5].y],["L",r[6].x,r[6].y],["L",r[7].x,r[7].y],["L",r[4].x,r[4].y],["Z"],["M",r[8].x,r[8].y],["L",r[9].x,r[9].y],["M",r[10].x,r[10].y],["L",r[11].x,r[11].y],["M",r[12].x,r[12].y],["L",r[13].x,r[13].y]]);return e.addShape("path",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},n),{path:i,name:"schema"})})},getMarker:function(t){return{symbol:function(t,e,r){var n=nH(t,[e-6,e-3,e,e+3,e+6],r);return[["M",n[0].x+1,n[0].y],["L",n[1].x-1,n[1].y],["M",n[2].x,n[2].y],["L",n[3].x,n[3].y],["M",n[4].x,n[4].y],["L",n[5].x,n[5].y],["L",n[6].x,n[6].y],["L",n[7].x,n[7].y],["L",n[4].x,n[4].y],["Z"],["M",n[8].x,n[8].y],["L",n[9].x,n[9].y],["M",n[10].x+1,n[10].y],["L",n[11].x-1,n[11].y],["M",n[12].x,n[12].y],["L",n[13].x,n[13].y]]},style:{r:6,lineWidth:1,stroke:t.color}}}}),LG("schema","candle",{getPoints:function(t){return oH(t.x,t.y,t.size)},draw:function(t,e){var r,n=sU(t,!0,!0),i=this.parsePath([["M",(r=t.points)[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["L",r[4].x,r[4].y],["L",r[5].x,r[5].y],["Z"],["M",r[6].x,r[6].y],["L",r[7].x,r[7].y]]);return e.addShape("path",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},n),{path:i,name:"schema"})})},getMarker:function(t){var e=t.color;return{symbol:function(t,e,r){var n=oH(t,[e+7.5,e+3,e-3,e-7.5],r);return[["M",n[0].x,n[0].y],["L",n[1].x,n[1].y],["M",n[2].x,n[2].y],["L",n[3].x,n[3].y],["L",n[4].x,n[4].y],["L",n[5].x,n[5].y],["Z"],["M",n[6].x,n[6].y],["L",n[7].x,n[7].y]]},style:{lineWidth:1,stroke:e,fill:e,r:6}}}}),LG("polygon","square",{draw:function(t,e){if(!(0,Ux.isEmpty)(t.points)){var r=sU(t,!0,!0),n=this.parsePoints(t.points);return e.addShape("rect",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},r),function(t,e){var r=Math.abs(t[0].x-t[2].x),n=Math.abs(t[0].y-t[2].y),i=Math.min(r,n);return e&&(i=(0,Ux.clamp)(e,0,Math.min(r,n))),i/=2,{x:(t[0].x+t[2].x)/2-i,y:(t[0].y+t[2].y)/2-i,width:2*i,height:2*i}}(n,t.size)),name:"polygon"})}},getMarker:function(t){return{symbol:"square",style:{r:4,fill:t.color}}}}),LG("violin","smooth",{draw:function(t,e){var r=sU(t,!0,!0),n=this.parsePath(aU(t.points));return e.addShape("path",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},r),{path:n})})},getMarker:function(t){return{symbol:"circle",style:{stroke:null,r:4,fill:t.color}}}}),LG("violin","hollow",{draw:function(t,e){var r=sU(t,!0,!1),n=this.parsePath(oU(t.points));return e.addShape("path",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},r),{path:n})})},getMarker:function(t){return{symbol:"circle",style:{r:4,fill:null,stroke:t.color}}}}),LG("violin","hollow-smooth",{draw:function(t,e){var r=sU(t,!0,!1),n=this.parsePath(aU(t.points));return e.addShape("path",{attrs:(0,Gx.__assign)((0,Gx.__assign)({},r),{path:n})})},getMarker:function(t){return{symbol:"circle",style:{r:4,fill:null,stroke:t.color}}}});var aH=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getLabelValueDir=function(t){var e=t.points;return e[0].y<=e[2].y?1:-1},e.prototype.getLabelOffsetPoint=function(e,r,n,i){var o,a=t.prototype.getLabelOffsetPoint.call(this,e,r,n),s=this.getCoordinate(),u=s.isTransposed?"x":"y",l=this.getLabelValueDir(e.mappingData);return a=(0,Gx.__assign)((0,Gx.__assign)({},a),((o={})[u]=a[u]*l,o)),s.isReflect("x")&&(a=(0,Gx.__assign)((0,Gx.__assign)({},a),{x:-1*a.x})),s.isReflect("y")&&(a=(0,Gx.__assign)((0,Gx.__assign)({},a),{y:-1*a.y})),a},e.prototype.getThemedLabelCfg=function(t){var e=this.geometry,r=this.getDefaultLabelCfg(),n=e.theme;return(0,Ux.deepMix)({},r,n.labels,"middle"===t.position?{offset:0}:{},t)},e.prototype.setLabelPosition=function(t,e,r,n){var i,o,a,s,u=this.getCoordinate(),l=u.isTransposed,c=e.points,f=u.convert(c[0]),h=u.convert(c[2]),p=this.getLabelValueDir(e),d=(0,Ux.isArray)(e.shape)?e.shape[0]:e.shape;if("funnel"===d||"pyramid"===d){var y=(0,Ux.get)(e,"nextPoints"),g=(0,Ux.get)(e,"points");if(y){var v=u.convert(g[0]),m=u.convert(g[1]),b=u.convert(y[0]),A=u.convert(y[1]);l?(i=Math.min(b.y,v.y),a=Math.max(b.y,v.y),o=(m.x+A.x)/2,s=(v.x+b.x)/2):(i=Math.min((m.y+A.y)/2,(v.y+b.y)/2),a=Math.max((m.y+A.y)/2,(v.y+b.y)/2),o=A.x,s=v.x)}else i=Math.min(h.y,f.y),a=Math.max(h.y,f.y),o=h.x,s=f.x}else i=Math.min(h.y,f.y),a=Math.max(h.y,f.y),o=h.x,s=f.x;switch(n){case"right":t.x=o,t.y=(i+a)/2,t.textAlign=(0,Ux.get)(t,"textAlign",p>0?"left":"right");break;case"left":t.x=s,t.y=(i+a)/2,t.textAlign=(0,Ux.get)(t,"textAlign",p>0?"left":"right");break;case"bottom":l&&(t.x=(o+s)/2),t.y=a,t.textAlign=(0,Ux.get)(t,"textAlign","center"),t.textBaseline=(0,Ux.get)(t,"textBaseline",p>0?"bottom":"top");break;case"middle":l&&(t.x=(o+s)/2),t.y=(i+a)/2,t.textAlign=(0,Ux.get)(t,"textAlign","center"),t.textBaseline=(0,Ux.get)(t,"textBaseline","middle");break;case"top":l&&(t.x=(o+s)/2),t.y=i,t.textAlign=(0,Ux.get)(t,"textAlign","center"),t.textBaseline=(0,Ux.get)(t,"textBaseline",p>0?"bottom":"top")}},e}(qG),sH=Math.PI/2,uH=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getLabelOffset=function(t){var e=this.getCoordinate(),r=0;if((0,Ux.isNumber)(t))r=t;else if((0,Ux.isString)(t)&&-1!==t.indexOf("%")){var n=e.getRadius();e.innerRadius>0&&(n*=1-e.innerRadius),r=.01*parseFloat(t)*n}return r},e.prototype.getLabelItems=function(e){var r=t.prototype.getLabelItems.call(this,e),n=this.geometry.getYScale();return(0,Ux.map)(r,function(t){if(t&&n){var e=n.scale((0,Ux.get)(t.data,n.field));return(0,Gx.__assign)((0,Gx.__assign)({},t),{percent:e})}return t})},e.prototype.getLabelAlign=function(t){var e,r=this.getCoordinate();if(t.labelEmit)e=t.angle<=Math.PI/2&&t.angle>=-Math.PI/2?"left":"right";else if(r.isTransposed){var n=r.getCenter(),i=t.offset;e=Math.abs(t.x-n.x)<1?"center":t.angle>Math.PI||t.angle<=0?i>0?"left":"right":i>0?"right":"left"}else e="center";return e},e.prototype.getLabelPoint=function(t,e,r){var n,i=1,o=t.content[r];this.isToMiddle(e)?n=this.getMiddlePoint(e.points):(1===t.content.length&&0===r?r=1:0===r&&(i=-1),n=this.getArcPoint(e,r));var a=t.offset*i,s=this.getPointAngle(n),u=t.labelEmit,l=this.getCirclePoint(s,a,n,u);return 0===l.r?l.content="":(l.content=o,l.angle=s,l.color=e.color),l.rotate=t.autoRotate?this.getLabelRotate(s,a,u):t.rotate,l.start={x:n.x,y:n.y},l},e.prototype.getArcPoint=function(t,e){return void 0===e&&(e=0),(0,Ux.isArray)(t.x)||(0,Ux.isArray)(t.y)?{x:(0,Ux.isArray)(t.x)?t.x[e]:t.x,y:(0,Ux.isArray)(t.y)?t.y[e]:t.y}:{x:t.x,y:t.y}},e.prototype.getPointAngle=function(t){return sF(this.getCoordinate(),t)},e.prototype.getCirclePoint=function(t,e,r,n){var i=this.getCoordinate(),o=i.getCenter(),a=aF(i,r);if(0===a)return(0,Gx.__assign)((0,Gx.__assign)({},o),{r:a});var s=t;i.isTransposed&&a>e&&!n?s=t+2*Math.asin(e/(2*a)):a+=e;return{x:o.x+a*Math.cos(s),y:o.y+a*Math.sin(s),r:a}},e.prototype.getLabelRotate=function(t,e,r){var n=t+sH;return r&&(n-=sH),n&&(n>sH?n-=Math.PI:n<-sH&&(n+=Math.PI)),n},e.prototype.getMiddlePoint=function(t){var e=this.getCoordinate(),r=t.length,n={x:0,y:0};return(0,Ux.each)(t,function(t){n.x+=t.x,n.y+=t.y}),n.x/=r,n.y/=r,n=e.convert(n)},e.prototype.isToMiddle=function(t){return t.x.length>2},e}(qG),lH=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.defaultLayout="distribute",e}return(0,Gx.__extends)(e,t),e.prototype.getDefaultLabelCfg=function(e,r){var n=t.prototype.getDefaultLabelCfg.call(this,e,r);return(0,Ux.deepMix)({},n,(0,Ux.get)(this.geometry.theme,"pieLabels",{}))},e.prototype.getLabelOffset=function(e){return t.prototype.getLabelOffset.call(this,e)||0},e.prototype.getLabelRotate=function(t,e,r){var n;return e<0&&((n=t)>Math.PI/2&&(n-=Math.PI),n<-Math.PI/2&&(n+=Math.PI)),n},e.prototype.getLabelAlign=function(t){var e,r=this.getCoordinate().getCenter();return e=t.angle<=Math.PI/2&&t.x>=r.x?"left":"right",t.offset<=0&&(e="right"===e?"left":"right"),e},e.prototype.getArcPoint=function(t){return t},e.prototype.getPointAngle=function(t){var e,r=this.getCoordinate(),n={x:(0,Ux.isArray)(t.x)?t.x[0]:t.x,y:t.y[0]},i={x:(0,Ux.isArray)(t.x)?t.x[1]:t.x,y:t.y[1]},o=sF(r,n);if(t.points&&t.points[0].y===t.points[1].y)e=o;else{var a=sF(r,i);o>=a&&(a+=2*Math.PI),e=o+(a-o)/2}return e},e.prototype.getCirclePoint=function(t,e){var r=this.getCoordinate(),n=r.getCenter(),i=r.getRadius()+e;return(0,Gx.__assign)((0,Gx.__assign)({},XB(n.x,n.y,i,t)),{angle:t,r:i})},e}(uH),cH=4;function fH(t,e,r){var n=t.filter(function(t){return!t.invisible});n.sort(function(t,e){return t.y-e.y});var i,o=!0,a=r.minY,s=r.maxY,u=Math.abs(a-s),l=0,c=Number.MIN_VALUE,f=n.map(function(t){return t.y>l&&(l=t.y),t.yu&&(u=l-a);o;)for(f.forEach(function(t){var e=(Math.min.apply(c,t.targets)+Math.max.apply(c,t.targets))/2;t.pos=Math.min(Math.max(c,e-t.size/2),u-t.size),t.pos=Math.max(0,t.pos)}),o=!1,i=f.length;i--;)if(i>0){var h=f[i-1],p=f[i];h.pos+h.size>p.pos&&(h.size+=p.size,h.targets=h.targets.concat(p.targets),h.pos+h.size>u&&(h.pos=u-h.size),f.splice(i,1),o=!0)}i=0,f.forEach(function(t){var r=a+e/2;t.targets.forEach(function(){n[i].y=t.pos+r,r+=e,i++})})}var hH=4;var pH=4,dH=4,yH=4;var gH=100,vH=function(){function t(t){void 0===t&&(t={}),this.bitmap={};var e=t.xGap,r=void 0===e?1:e,n=t.yGap,i=void 0===n?8:n;this.xGap=r,this.yGap=i}return t.prototype.hasGap=function(t){for(var e=!0,r=this.bitmap,n=Math.round(t.minX),i=Math.round(t.maxX),o=Math.round(t.minY),a=Math.round(t.maxY),s=n;s<=i;s+=1)if(r[s]){if(s===n||s===i){for(var u=o;u<=a;u++)if(r[s][u]){e=!1;break}}else if(r[s][o]||r[s][a]){e=!1;break}}else r[s]={};return e},t.prototype.fillGap=function(t){for(var e=this.bitmap,r=Math.round(t.minX),n=Math.round(t.maxX),i=Math.round(t.minY),o=Math.round(t.maxY),a=r;a<=n;a+=1)e[a]||(e[a]={});for(a=r;a<=n;a+=this.xGap){for(var s=i;s<=o;s+=this.yGap)e[a][s]=!0;e[a][o]=!0}if(1!==this.yGap)for(a=i;a<=o;a+=1)e[r][a]=!0,e[n][a]=!0;if(1!==this.xGap)for(a=r;a<=n;a+=1)e[a][i]=!0,e[a][o]=!0},t.prototype.destroy=function(){this.bitmap={}},t}();function mH(t,e,r,n){var i=t.getCanvasBBox(),o=i.width,a=i.height,s={x:e,y:r,textAlign:"center"};switch(n){case 0:s.y-=a+1,s.x+=1,s.textAlign="left";break;case 1:s.y-=a+1,s.x-=1,s.textAlign="right";break;case 2:s.y+=a+1,s.x-=1,s.textAlign="right";break;case 3:s.y+=a+1,s.x+=1,s.textAlign="left";break;case 5:s.y-=2*a+2;break;case 6:s.y+=2*a+2;break;case 7:s.x+=o+1,s.textAlign="left";break;case 8:s.x-=o+1,s.textAlign="right"}return t.attr(s),t.getCanvasBBox()}function bH(t){if(t.length>4)return[];var e=function(t,e){return[e.x-t.x,e.y-t.y]};return[e(t[0],t[1]),e(t[1],t[2])]}function AH(t,e,r){void 0===e&&(e=0),void 0===r&&(r={x:0,y:0});var n=t.x,i=t.y;return{x:(n-r.x)*Math.cos(-e)+(i-r.y)*Math.sin(-e)+r.x,y:(r.x-n)*Math.sin(-e)+(i-r.y)*Math.cos(-e)+r.y}}function xH(t){var e=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],r=t.rotation;return r?[AH(e[0],r,e[0]),AH(e[1],r,e[0]),AH(e[2],r,e[0]),AH(e[3],r,e[0])]:e}function wH(t,e){if(t.length>4)return{min:0,max:0};var r=[];return t.forEach(function(t){var n,i;r.push((n=[t.x,t.y],i=e,(n[0]||0)*(i[0]||0)+(n[1]||0)*(i[1]||0)+(n[2]||0)*(i[2]||0)))}),{min:Math.min.apply(Math,(0,Gx.__spreadArray)([],(0,Gx.__read)(r),!1)),max:Math.max.apply(Math,(0,Gx.__spreadArray)([],(0,Gx.__read)(r),!1))}}function _H(t,e){return t.max>e.min&&t.mint.x+t.width+r||e.x+e.widtht.y+t.height+r||e.y+e.height4)return[];var e=function(t,e){return[e.x-t.x,e.y-t.y]};return[e(t[0],t[1]),e(t[1],t[2])]}function e(t,e,r){void 0===e&&(e=0),void 0===r&&(r={x:0,y:0});var n=t.x,i=t.y;return{x:(n-r.x)*Math.cos(-e)+(i-r.y)*Math.sin(-e)+r.x,y:(r.x-n)*Math.sin(-e)+(i-r.y)*Math.cos(-e)+r.y}}function r(t){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],n=t.rotation;return n?[e(r[0],n,r[0]),e(r[1],n,r[0]),e(r[2],n,r[0]),e(r[3],n,r[0])]:r}function n(t,e){if(t.length>4)return{min:0,max:0};var r=[];return t.forEach(function(t){var n,i;r.push((n=[t.x,t.y],i=e,(n[0]||0)*(i[0]||0)+(n[1]||0)*(i[1]||0)+(n[2]||0)*(i[2]||0)))}),{min:Math.min.apply(null,r),max:Math.max.apply(null,r)}}function i(t,e){return t.max>e.min&&t.mint.x+t.width+r||e.x+e.widtht.y+t.height+r||e.y+e.height=o.height:a.width>=o.width}(t,e,i)})}function jH(t,e,r){return t.some(function(t){return r(t,e)})}function RH(t,e){return jH(t,e,function(t,e){var r,n,i,o=HG(t),a=HG(e);return r=o.getCanvasBBox(),n=a.getCanvasBBox(),void 0===(i=2)&&(i=0),Math.max(0,Math.min(r.x+r.width+i,n.x+n.width+i)-Math.max(r.x-i,n.x-i))*Math.max(0,Math.min(r.y+r.height+i,n.y+n.height+i)-Math.max(r.y-i,n.y-i))>0})}function DH(t,e,r){return t.some(function(t){return r(t,e)})}function BH(t,e){return DH(t,e,function(t,e){var r,n,i,o=HG(t),a=HG(e);return r=o.getCanvasBBox(),n=a.getCanvasBBox(),void 0===(i=2)&&(i=0),Math.max(0,Math.min(r.x+r.width+i,n.x+n.width+i)-Math.max(r.x-i,n.x-i))*Math.max(0,Math.min(r.y+r.height+i,n.y+n.height+i)-Math.max(r.y-i,n.y-i))>0})}function FH(){return MH||(MH=document.createElement("canvas").getContext("2d")),MH}var zH=(0,Ux.memoize)(function(t,e){void 0===e&&(e={});var r=e.fontSize,n=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant,s=FH();return s.font=[o,a,i,"".concat(r,"px"),n].join(" "),s.measureText((0,Ux.isString)(t)?t:"").width},function(t,e){return void 0===e&&(e={}),(0,Gx.__spreadArray)([t],(0,Gx.__read)((0,Ux.values)(e)),!1).join("")}),GH=function(t,e,r){var n,i=zH("...",r);n=(0,Ux.isString)(t)?t:(0,Ux.toString)(t);var o,a,s=e,u=[];if(zH(t,r)<=e)return t;for(;o=n.substr(0,16),!((a=zH(o,r))+i>s&&a>s);)if(u.push(o),s-=a,!(n=n.substr(16)))return u.join("");for(;o=n.substr(0,1),!((a=zH(o,r))+i>s);)if(u.push(o),s-=a,!(n=n.substr(1)))return u.join("");return"".concat(u.join(""),"...")};function UH(t,e,r,n,i){var o,a,s=r.start,u=r.end,l=r.getWidth(),c=r.getHeight();"y"===i?(o=s.x+l/2,a=n.ys.x?n.x:s.x,a=s.y+c/2):"xy"===i&&(r.isPolar?(o=r.getCenter().x,a=r.getCenter().y):(o=(s.x+u.x)/2,a=(s.y+u.y)/2));var f=function(t,e,r){var n,i=(0,Gx.__read)(e,2),o=i[0],a=i[1];return t.applyToMatrix([o,a,1]),"x"===r?(t.setMatrix(Wx.pd(t.getMatrix(),[["t",-o,-a],["s",.01,1],["t",o,a]])),n=Wx.pd(t.getMatrix(),[["t",-o,-a],["s",100,1],["t",o,a]])):"y"===r?(t.setMatrix(Wx.pd(t.getMatrix(),[["t",-o,-a],["s",1,.01],["t",o,a]])),n=Wx.pd(t.getMatrix(),[["t",-o,-a],["s",1,100],["t",o,a]])):"xy"===r&&(t.setMatrix(Wx.pd(t.getMatrix(),[["t",-o,-a],["s",.01,.01],["t",o,a]])),n=Wx.pd(t.getMatrix(),[["t",-o,-a],["s",100,100],["t",o,a]])),n}(t,[o,a],i);t.animate({matrix:f},e)}function HH(t,e){var r,n=yC(t,e),i=n.startAngle,o=n.endAngle;return!(0,Ux.isNumberEqual)(i,.5*-Math.PI)&&i<.5*-Math.PI&&(i+=2*Math.PI),!(0,Ux.isNumberEqual)(o,.5*-Math.PI)&&o<.5*-Math.PI&&(o+=2*Math.PI),0===e[5]&&(i=(r=(0,Gx.__read)([o,i],2))[0],o=r[1]),(0,Ux.isNumberEqual)(i,1.5*Math.PI)&&(i=-.5*Math.PI),(0,Ux.isNumberEqual)(o,-.5*Math.PI)&&!(0,Ux.isNumberEqual)(i,o)&&(o=1.5*Math.PI),{startAngle:i,endAngle:o}}function VH(t){var e;return"M"===t[0]||"L"===t[0]?e=[t[1],t[2]]:"a"!==t[0]&&"A"!==t[0]&&"C"!==t[0]||(e=[t[t.length-2],t[t.length-1]]),e}function QH(t){var e,r,n,i=t.filter(function(t){return"A"===t[0]||"a"===t[0]});if(0===i.length)return{startAngle:0,endAngle:0,radius:0,innerRadius:0};var o=i[0],a=i.length>1?i[1]:i[0],s=t.indexOf(o),u=t.indexOf(a),l=VH(t[s-1]),c=VH(t[u-1]),f=HH(l,o),h=f.startAngle,p=f.endAngle,d=HH(c,a),y=d.startAngle,g=d.endAngle;(0,Ux.isNumberEqual)(h,y)&&(0,Ux.isNumberEqual)(p,g)?(r=h,n=p):(r=Math.min(h,y),n=Math.max(p,g));var v=o[1],m=i[i.length-1][1];return v=0;a--){var s=this.getFacetsByLevel(t,a);try{for(var u=(e=void 0,(0,Gx.__values)(s)),l=u.next();!l.done;l=u.next()){var c=l.value;this.isLeaf(c)||(c.originColIndex=c.columnIndex,c.columnIndex=this.getRegionIndex(c.children),c.columnValuesLength=i.length)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}}},e.prototype.getFacetsByLevel=function(t,e){var r=[];return t.forEach(function(t){t.rowIndex===e&&r.push(t)}),r},e.prototype.getRegionIndex=function(t){var e=t[0];return(t[t.length-1].columnIndex-e.columnIndex)/2+e.columnIndex},e.prototype.isLeaf=function(t){return!t.children||!t.children.length},e.prototype.getRows=function(){return this.cfg.fields.length+1},e.prototype.getChildFacets=function(t,e,r){var n=this,i=this.cfg.fields;if(!(i.length=r){var i=n.parsePosition([t[s],t[a.field]]);i&&f.push(i)}if(t[s]===c)return!1}),f},e.prototype.parsePercentPosition=function(t){var e=parseFloat(t[0])/100,r=parseFloat(t[1])/100,n=this.view.getCoordinate(),i=n.start,o=n.end,a=Math.min(i.x,o.x),s=Math.min(i.y,o.y);return{x:n.getWidth()*e+a,y:n.getHeight()*r+s}},e.prototype.getCoordinateBBox=function(){var t=this.view.getCoordinate(),e=t.start,r=t.end,n=t.getWidth(),i=t.getHeight(),o={x:Math.min(e.x,r.x),y:Math.min(e.y,r.y)};return{x:o.x,y:o.y,minX:o.x,minY:o.y,maxX:o.x+n,maxY:o.y+i,width:n,height:i}},e.prototype.getAnnotationCfg=function(t,e,r){var n=this,i=this.view.getCoordinate(),o=this.view.getCanvas(),a={};if((0,Ux.isNil)(e))return null;var s=e.start,u=e.end,l=e.position,c=this.parsePosition(s),f=this.parsePosition(u),h=this.parsePosition(l);if(!(!["arc","image","line","region","regionFilter"].includes(t)||c&&f))return null;if(["text","dataMarker","html"].includes(t)&&!h)return null;if("arc"===t){var p=e,d=(p.start,p.end,(0,Gx.__rest)(p,["start","end"])),y=sF(i,c),g=sF(i,f);y>g&&(g=2*Math.PI+g),a=(0,Gx.__assign)((0,Gx.__assign)({},d),{center:i.getCenter(),radius:aF(i,c),startAngle:y,endAngle:g})}else if("image"===t){var v=e;v.start,v.end,d=(0,Gx.__rest)(v,["start","end"]);a=(0,Gx.__assign)((0,Gx.__assign)({},d),{start:c,end:f,src:e.src})}else if("line"===t){var m=e;m.start,m.end,d=(0,Gx.__rest)(m,["start","end"]);a=(0,Gx.__assign)((0,Gx.__assign)({},d),{start:c,end:f,text:(0,Ux.get)(e,"text",null)})}else if("region"===t){var b=e;b.start,b.end,d=(0,Gx.__rest)(b,["start","end"]);a=(0,Gx.__assign)((0,Gx.__assign)({},d),{start:c,end:f})}else if("text"===t){var A=this.view.getData(),x=e,w=(x.position,x.content),_=(d=(0,Gx.__rest)(x,["position","content"]),w);(0,Ux.isFunction)(w)&&(_=w(A)),a=(0,Gx.__assign)((0,Gx.__assign)((0,Gx.__assign)({},h),d),{content:_})}else if("dataMarker"===t){var S=e,E=(S.position,S.point),C=S.line,k=S.text,I=S.autoAdjust,T=S.direction;d=(0,Gx.__rest)(S,["position","point","line","text","autoAdjust","direction"]);a=(0,Gx.__assign)((0,Gx.__assign)((0,Gx.__assign)({},d),h),{coordinateBBox:this.getCoordinateBBox(),point:E,line:C,text:k,autoAdjust:I,direction:T})}else if("dataRegion"===t){var O=e,M=O.start,P=O.end,L=O.region,N=(k=O.text,O.lineLength);d=(0,Gx.__rest)(O,["start","end","region","text","lineLength"]);a=(0,Gx.__assign)((0,Gx.__assign)({},d),{points:this.getRegionPoints(M,P),region:L,text:k,lineLength:N})}else if("regionFilter"===t){var j=e,R=(j.start,j.end,j.apply),D=j.color,B=(d=(0,Gx.__rest)(j,["start","end","apply","color"]),this.view.geometries),F=[],z=function t(e){e&&(e.isGroup()?e.getChildren().forEach(function(e){return t(e)}):F.push(e))};(0,Ux.each)(B,function(t){R?(0,Ux.contains)(R,t.type)&&(0,Ux.each)(t.elements,function(t){z(t.shape)}):(0,Ux.each)(t.elements,function(t){z(t.shape)})}),a=(0,Gx.__assign)((0,Gx.__assign)({},d),{color:D,shapes:F,start:c,end:f})}else if("shape"===t){var G=e,U=G.render,H=(0,Gx.__rest)(G,["render"]);a=(0,Gx.__assign)((0,Gx.__assign)({},H),{render:function(t){if((0,Ux.isFunction)(e.render))return U(t,n.view,{parsePosition:n.parsePosition.bind(n)})}})}else if("html"===t){var V=e,Q=V.html;V.position,H=(0,Gx.__rest)(V,["html","position"]);a=(0,Gx.__assign)((0,Gx.__assign)((0,Gx.__assign)({},H),h),{parent:o.get("el").parentNode,html:function(t){return(0,Ux.isFunction)(Q)?Q(t,n.view):Q}})}var Y=(0,Ux.deepMix)({},r,(0,Gx.__assign)((0,Gx.__assign)({},a),{top:e.top,style:e.style,offsetX:e.offsetX,offsetY:e.offsetY}));return"html"!==t&&(Y.container=this.getComponentContainer(Y)),Y.animate=this.view.getOptions().animate&&Y.animate&&(0,Ux.get)(e,"animate",Y.animate),Y.animateOption=(0,Ux.deepMix)({},vG,Y.animateOption,e.animateOption),Y},e.prototype.isTop=function(t){return(0,Ux.get)(t,"top",!0)},e.prototype.getComponentContainer=function(t){return this.isTop(t)?this.foregroundContainer:this.backgroundContainer},e.prototype.getAnnotationTheme=function(t){return(0,Ux.get)(this.view.getTheme(),["components","annotation",t],{})},e.prototype.updateOrCreate=function(t){var e=this.cache.get(this.getCacheKey(t));if(e){var r=t.type,n=this.getAnnotationTheme(r),i=this.getAnnotationCfg(r,t,n);i&&rF(i,["container"]),e.component.update((0,Gx.__assign)((0,Gx.__assign)({},i||{}),{visible:!!i})),(0,Ux.includes)(nV,t.type)&&e.component.render()}else(e=this.createAnnotation(t))&&(e.component.init(),(0,Ux.includes)(nV,t.type)&&e.component.render());return e},e.prototype.syncCache=function(t){var e=this,r=new Map(this.cache);return t.forEach(function(t,e){r.set(e,t)}),r.forEach(function(t,n){(0,Ux.find)(e.option,function(t){return n===e.getCacheKey(t)})||(t.component.destroy(),r.delete(n))}),r},e.prototype.getCacheKey=function(t){return t},e}(hG);function oV(t,e){var r=(0,Ux.deepMix)({},(0,Ux.get)(t,["components","axis","common"]),(0,Ux.get)(t,["components","axis",e]));return(0,Ux.get)(r,["grid"],{})}function aV(t,e,r,n){var i=[],o=e.getTicks();return t.isPolar&&o.push({value:1,text:"",tickValue:""}),o.reduce(function(e,o,a){var s=o.value;if(n)i.push({points:[t.convert("y"===r?{x:0,y:s}:{x:s,y:0}),t.convert("y"===r?{x:1,y:s}:{x:s,y:1})]});else if(a){var u=(e.value+s)/2;i.push({points:[t.convert("y"===r?{x:0,y:u}:{x:u,y:0}),t.convert("y"===r?{x:1,y:u}:{x:u,y:1})]})}return o},o[0]),i}function sV(t,e,r,n,i){var o=e.values.length,a=[],s=r.getTicks();return s.reduce(function(e,r){var s=e?e.value:r.value,u=r.value,l=(s+u)/2;return"x"===i?a.push({points:[t.convert({x:n?u:l,y:0}),t.convert({x:n?u:l,y:1})]}):a.push({points:(0,Ux.map)(Array(o+1),function(e,r){return t.convert({x:r/o,y:n?u:l})})}),r},s[0]),a}function uV(t,e){var r=(0,Ux.get)(e,"grid");if(null===r)return!1;var n=(0,Ux.get)(t,"grid");return!(void 0===r&&null===n)}var lV=["container"],cV=(0,Gx.__assign)((0,Gx.__assign)({},vG),{appear:null}),fV=function(t){function e(e){var r=t.call(this,e)||this;return r.cache=new Map,r.gridContainer=r.view.getLayer(Oj.BG).addGroup(),r.gridForeContainer=r.view.getLayer(Oj.FORE).addGroup(),r.axisContainer=r.view.getLayer(Oj.BG).addGroup(),r.axisForeContainer=r.view.getLayer(Oj.FORE).addGroup(),r}return(0,Gx.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"axis"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.render=function(){this.update()},e.prototype.layout=function(){var t=this,e=this.view.getCoordinate();(0,Ux.each)(this.getComponents(),function(r){var n,i=r.component,o=r.direction,a=r.type,s=r.extra,u=s.dim,l=s.scale,c=s.alignTick;if(a===Pj.AXIS)e.isPolar?"x"===u?n=e.isTransposed?dF(e,o):bF(e):"y"===u&&(n=e.isTransposed?bF(e):dF(e,o)):n=dF(e,o);else if(a===Pj.GRID)if(e.isPolar){n={items:e.isTransposed?"x"===u?sV(e,t.view.getYScales()[0],l,c,u):aV(e,l,u,c):"x"===u?aV(e,l,u,c):sV(e,t.view.getXScale(),l,c,u),center:t.view.getCoordinate().getCenter()}}else n={items:aV(e,l,u,c)};i.update(n)})},e.prototype.update=function(){this.option=this.view.getOptions().axes;var t=new Map;this.updateXAxes(t),this.updateYAxes(t);var e=new Map;this.cache.forEach(function(r,n){t.has(n)?e.set(n,r):r.component.destroy()}),this.cache=e},e.prototype.clear=function(){t.prototype.clear.call(this),this.cache.clear(),this.gridContainer.clear(),this.gridForeContainer.clear(),this.axisContainer.clear(),this.axisForeContainer.clear()},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.gridContainer.remove(!0),this.gridForeContainer.remove(!0),this.axisContainer.remove(!0),this.axisForeContainer.remove(!0)},e.prototype.getComponents=function(){var t=[];return this.cache.forEach(function(e){t.push(e)}),t},e.prototype.updateXAxes=function(t){var e=this.view.getXScale();if(e&&!e.isIdentity){var r=AF(this.option,e.field);if(!1!==r){var n=xF(r,Mj.BOTTOM),i=Oj.BG,o=this.view.getCoordinate(),a=this.getId("axis",e.field),s=this.getId("grid",e.field);if(o.isRect){if(u=this.cache.get(a))rF(c=this.getLineAxisCfg(e,r,n),lV),u.component.update(c),t.set(a,u);else u=this.createLineAxis(e,r,i,n,"x"),this.cache.set(a,u),t.set(a,u);if(l=this.cache.get(s))rF(c=this.getLineGridCfg(e,r,n,"x"),lV),l.component.update(c),t.set(s,l);else(l=this.createLineGrid(e,r,i,n,"x"))&&(this.cache.set(s,l),t.set(s,l))}else if(o.isPolar){var u,l;if(u=this.cache.get(a)){rF(c=o.isTransposed?this.getLineAxisCfg(e,r,Mj.RADIUS):this.getCircleAxisCfg(e,r,n),lV),u.component.update(c),t.set(a,u)}else{if(o.isTransposed){if((0,Ux.isUndefined)(r))return;u=this.createLineAxis(e,r,i,Mj.RADIUS,"x")}else u=this.createCircleAxis(e,r,i,n,"x");this.cache.set(a,u),t.set(a,u)}if(l=this.cache.get(s)){var c;rF(c=o.isTransposed?this.getCircleGridCfg(e,r,Mj.RADIUS,"x"):this.getLineGridCfg(e,r,Mj.CIRCLE,"x"),lV),l.component.update(c),t.set(s,l)}else{if(o.isTransposed){if((0,Ux.isUndefined)(r))return;l=this.createCircleGrid(e,r,i,Mj.RADIUS,"x")}else l=this.createLineGrid(e,r,i,Mj.CIRCLE,"x");l&&(this.cache.set(s,l),t.set(s,l))}}}}},e.prototype.updateYAxes=function(t){var e=this,r=this.view.getYScales();(0,Ux.each)(r,function(r,n){if(r&&!r.isIdentity){var i=r.field,o=AF(e.option,i);if(!1!==o){var a=Oj.BG,s=e.getId("axis",i),u=e.getId("grid",i),l=e.view.getCoordinate();if(l.isRect){var c=xF(o,0===n?Mj.LEFT:Mj.RIGHT);if(f=e.cache.get(s))rF(p=e.getLineAxisCfg(r,o,c),lV),f.component.update(p),t.set(s,f);else f=e.createLineAxis(r,o,a,c,"y"),e.cache.set(s,f),t.set(s,f);if(h=e.cache.get(u))rF(p=e.getLineGridCfg(r,o,c,"y"),lV),h.component.update(p),t.set(u,h);else(h=e.createLineGrid(r,o,a,c,"y"))&&(e.cache.set(u,h),t.set(u,h))}else if(l.isPolar){var f,h;if(f=e.cache.get(s)){rF(p=l.isTransposed?e.getCircleAxisCfg(r,o,Mj.CIRCLE):e.getLineAxisCfg(r,o,Mj.RADIUS),lV),f.component.update(p),t.set(s,f)}else{if(l.isTransposed){if((0,Ux.isUndefined)(o))return;f=e.createCircleAxis(r,o,a,Mj.CIRCLE,"y")}else f=e.createLineAxis(r,o,a,Mj.RADIUS,"y");e.cache.set(s,f),t.set(s,f)}if(h=e.cache.get(u)){var p;rF(p=l.isTransposed?e.getLineGridCfg(r,o,Mj.CIRCLE,"y"):e.getCircleGridCfg(r,o,Mj.RADIUS,"y"),lV),h.component.update(p),t.set(u,h)}else{if(l.isTransposed){if((0,Ux.isUndefined)(o))return;h=e.createLineGrid(r,o,a,Mj.CIRCLE,"y")}else h=e.createCircleGrid(r,o,a,Mj.RADIUS,"y");h&&(e.cache.set(u,h),t.set(u,h))}}}}})},e.prototype.createLineAxis=function(t,e,r,n,i){var o={component:new zB(this.getLineAxisCfg(t,e,n)),layer:r,direction:n===Mj.RADIUS?Mj.NONE:n,type:Pj.AXIS,extra:{dim:i,scale:t}};return o.component.set("field",t.field),o.component.init(),o},e.prototype.createLineGrid=function(t,e,r,n,i){var o=this.getLineGridCfg(t,e,n,i);if(o){var a={component:new UB(o),layer:r,direction:Mj.NONE,type:Pj.GRID,extra:{dim:i,scale:t,alignTick:(0,Ux.get)(o,"alignTick",!0)}};return a.component.init(),a}},e.prototype.createCircleAxis=function(t,e,r,n,i){var o={component:new GB(this.getCircleAxisCfg(t,e,n)),layer:r,direction:n,type:Pj.AXIS,extra:{dim:i,scale:t}};return o.component.set("field",t.field),o.component.init(),o},e.prototype.createCircleGrid=function(t,e,r,n,i){var o=this.getCircleGridCfg(t,e,n,i);if(o){var a={component:new HB(o),layer:r,direction:Mj.NONE,type:Pj.GRID,extra:{dim:i,scale:t,alignTick:(0,Ux.get)(o,"alignTick",!0)}};return a.component.init(),a}},e.prototype.getLineAxisCfg=function(t,e,r){var n=(0,Ux.get)(e,["top"])?this.axisForeContainer:this.axisContainer,i=this.view.getCoordinate(),o=dF(i,r),a=wF(t,e),s=vF(this.view.getTheme(),r),u=(0,Ux.get)(e,["title"])?(0,Ux.deepMix)({title:{style:{text:a}}},{title:mF(this.view.getTheme(),r,e.title)},e):e,l=(0,Ux.deepMix)((0,Gx.__assign)((0,Gx.__assign)({container:n},o),{ticks:t.getTicks().map(function(t){return{id:"".concat(t.tickValue),name:t.text,value:t.value}}),verticalFactor:i.isPolar?-1*gF(o,i.getCenter()):gF(o,i.getCenter()),theme:s}),s,u),c=this.getAnimateCfg(l),f=c.animate,h=c.animateOption;l.animateOption=h,l.animate=f;var p=yF(o),d=(0,Ux.get)(l,"verticalLimitLength",p?1/3:.5);if(d<=1){var y=this.view.getCanvas().get("width"),g=this.view.getCanvas().get("height");l.verticalLimitLength=d*(p?y:g)}return l},e.prototype.getLineGridCfg=function(t,e,r,n){if(uV(vF(this.view.getTheme(),r),e)){var i=oV(this.view.getTheme(),r),o=(0,Ux.deepMix)({container:(0,Ux.get)(e,["top"])?this.gridForeContainer:this.gridContainer},i,(0,Ux.get)(e,"grid"),this.getAnimateCfg(e));return o.items=aV(this.view.getCoordinate(),t,n,(0,Ux.get)(o,"alignTick",!0)),o}},e.prototype.getCircleAxisCfg=function(t,e,r){var n=(0,Ux.get)(e,["top"])?this.axisForeContainer:this.axisContainer,i=this.view.getCoordinate(),o=t.getTicks().map(function(t){return{id:"".concat(t.tickValue),name:t.text,value:t.value}});t.isCategory||Math.abs(i.endAngle-i.startAngle)!==2*Math.PI||o.length&&(o[o.length-1].name="");var a=wF(t,e),s=vF(this.view.getTheme(),Mj.CIRCLE),u=(0,Ux.get)(e,["title"])?(0,Ux.deepMix)({title:{style:{text:a}}},{title:mF(this.view.getTheme(),r,e.title)},e):e,l=(0,Ux.deepMix)((0,Gx.__assign)((0,Gx.__assign)({container:n},bF(this.view.getCoordinate())),{ticks:o,verticalFactor:1,theme:s}),s,u),c=this.getAnimateCfg(l),f=c.animate,h=c.animateOption;return l.animate=f,l.animateOption=h,l},e.prototype.getCircleGridCfg=function(t,e,r,n){if(uV(vF(this.view.getTheme(),r),e)){var i=oV(this.view.getTheme(),Mj.RADIUS),o=(0,Ux.deepMix)({container:(0,Ux.get)(e,["top"])?this.gridForeContainer:this.gridContainer,center:this.view.getCoordinate().getCenter()},i,(0,Ux.get)(e,"grid"),this.getAnimateCfg(e)),a=(0,Ux.get)(o,"alignTick",!0),s="x"===n?this.view.getYScales()[0]:this.view.getXScale();return o.items=sV(this.view.getCoordinate(),s,t,a,n),o}},e.prototype.getId=function(t,e){var r=this.view.getCoordinate();return"".concat(t,"-").concat(e,"-").concat(r.type)},e.prototype.getAnimateCfg=function(t){return{animate:this.view.getOptions().animate&&(0,Ux.get)(t,"animate"),animateOption:t&&t.animateOption?(0,Ux.deepMix)({},cV,t.animateOption):cV}},e}(hG);function hV(t,e,r){return r===Mj.TOP?[t.minX+t.width/2-e.width/2,t.minY]:r===Mj.BOTTOM?[t.minX+t.width/2-e.width/2,t.maxY-e.height]:r===Mj.LEFT?[t.minX,t.minY+t.height/2-e.height/2]:r===Mj.RIGHT?[t.maxX-e.width,t.minY+t.height/2-e.height/2]:r===Mj.TOP_LEFT||r===Mj.LEFT_TOP?[t.tl.x,t.tl.y]:r===Mj.TOP_RIGHT||r===Mj.RIGHT_TOP?[t.tr.x-e.width,t.tr.y]:r===Mj.BOTTOM_LEFT||r===Mj.LEFT_BOTTOM?[t.bl.x,t.bl.y-e.height]:r===Mj.BOTTOM_RIGHT||r===Mj.RIGHT_BOTTOM?[t.br.x-e.width,t.br.y-e.height]:[0,0]}function pV(t,e){return(0,Ux.isBoolean)(t)?!1!==t&&{}:(0,Ux.get)(t,[e],t)}function dV(t){return(0,Ux.get)(t,"position",Mj.BOTTOM)}var yV=function(t){function e(e){var r=t.call(this,e)||this;return r.container=r.view.getLayer(Oj.FORE).addGroup(),r}return(0,Gx.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"legend"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.render=function(){this.update()},e.prototype.layout=function(){var t=this;this.layoutBBox=this.view.viewBBox,(0,Ux.each)(this.components,function(e){var r=e.component,n=e.direction,i=$G(n),o=r.get("maxWidthRatio"),a=r.get("maxHeightRatio"),s=t.getCategoryLegendSizeCfg(i,o,a),u=r.get("maxWidth"),l=r.get("maxHeight");r.update({maxWidth:Math.min(s.maxWidth,u||0),maxHeight:Math.min(s.maxHeight,l||0)});var c=r.get("padding"),f=r.getLayoutBBox(),h=new iF(f.x,f.y,f.width,f.height).expand(c),p=(0,Gx.__read)(hV(t.view.viewBBox,h,n),2),d=p[0],y=p[1],g=(0,Gx.__read)(hV(t.layoutBBox,h,n),2),v=g[0],m=g[1],b=0,A=0;n.startsWith("top")||n.startsWith("bottom")?(b=d,A=m):(b=v,A=y),r.setLocation({x:b+c[3],y:A+c[0]}),t.layoutBBox=t.layoutBBox.cut(h,n)})},e.prototype.update=function(){var t=this;this.option=this.view.getOptions().legends;var e={};if((0,Ux.get)(this.option,"custom")){var r="global-custom",n=this.getComponentById(r);if(n){var i=this.getCategoryCfg(void 0,void 0,void 0,this.option,!0);rF(i,["container"]),n.component.update(i),e[r]=!0}else{var o=this.createCustomLegend(void 0,void 0,void 0,this.option);if(o){o.init();var a=Oj.FORE,s=dV(this.option);this.components.push({id:r,component:o,layer:a,direction:s,type:Pj.LEGEND,extra:void 0}),e[r]=!0}}}else this.loopLegends(function(r,n,i){var o=t.getId(i.field),a=t.getComponentById(o);if(a){var s=void 0,u=pV(t.option,i.field);!1!==u&&((0,Ux.get)(u,"custom")?s=t.getCategoryCfg(r,n,i,u,!0):i.isLinear?s=t.getContinuousCfg(r,n,i,u):i.isCategory&&(s=t.getCategoryCfg(r,n,i,u))),s&&(rF(s,["container"]),a.direction=dV(u),a.component.update(s),e[o]=!0)}else{var l=t.createFieldLegend(r,n,i);l&&(l.component.init(),t.components.push(l),e[o]=!0)}});var u=[];(0,Ux.each)(this.getComponents(),function(t){e[t.id]?u.push(t):t.component.destroy()}),this.components=u},e.prototype.clear=function(){t.prototype.clear.call(this),this.container.clear()},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.container.remove(!0)},e.prototype.getGeometries=function(t){var e=this,r=t.geometries;return(0,Ux.each)(t.views,function(t){r=r.concat(e.getGeometries(t))}),r},e.prototype.loopLegends=function(t){if(this.view.getRootView()===this.view){var e=this.getGeometries(this.view),r={};(0,Ux.each)(e,function(e){var n=e.getGroupAttributes();(0,Ux.each)(n,function(n){var i=n.getScale(n.type);i&&"identity"!==i.type&&!r[i.field]&&(t(e,n,i),r[i.field]=!0)})})}},e.prototype.createFieldLegend=function(t,e,r){var n,i=pV(this.option,r.field),o=Oj.FORE,a=dV(i);if(!1!==i&&((0,Ux.get)(i,"custom")?n=this.createCustomLegend(t,e,r,i):r.isLinear?n=this.createContinuousLegend(t,e,r,i):r.isCategory&&(n=this.createCategoryLegend(t,e,r,i))),n)return n.set("field",r.field),{id:this.getId(r.field),component:n,layer:o,direction:a,type:Pj.LEGEND,extra:{scale:r}}},e.prototype.createCustomLegend=function(t,e,r,n){var i=this.getCategoryCfg(t,e,r,n,!0);return new VB(i)},e.prototype.createContinuousLegend=function(t,e,r,n){var i=this.getContinuousCfg(t,e,r,rF(n,["value"]));return new QB(i)},e.prototype.createCategoryLegend=function(t,e,r,n){var i=this.getCategoryCfg(t,e,r,n);return new VB(i)},e.prototype.getContinuousCfg=function(t,e,r,n){var i=r.getTicks(),o=(0,Ux.find)(i,function(t){return 0===t.value}),a=(0,Ux.find)(i,function(t){return 1===t.value}),s=i.map(function(t){var n=t.value,i=t.tickValue,o=e.mapping(r.invert(n)).join("");return{value:i,attrValue:o,color:o,scaleValue:n}});o||s.push({value:r.min,attrValue:e.mapping(r.invert(0)).join(""),color:e.mapping(r.invert(0)).join(""),scaleValue:0}),a||s.push({value:r.max,attrValue:e.mapping(r.invert(1)).join(""),color:e.mapping(r.invert(1)).join(""),scaleValue:1}),s.sort(function(t,e){return t.value-e.value});var u={min:(0,Ux.head)(s).value,max:(0,Ux.last)(s).value,colors:[],rail:{type:e.type},track:{}};"size"===e.type&&(u.track={style:{fill:"size"===e.type?this.view.getTheme().defaultColor:void 0}}),"color"===e.type&&(u.colors=s.map(function(t){return t.attrValue}));var l=this.container,c=$G(dV(n)),f=(0,Ux.get)(n,"title");return f&&(f=(0,Ux.deepMix)({text:hF(r)},f)),u.container=l,u.layout=c,u.title=f,u.animateOption=vG,this.mergeLegendCfg(u,n,"continuous")},e.prototype.getCategoryCfg=function(t,e,r,n,i){var o=this.container,a=(0,Ux.get)(n,"position",Mj.BOTTOM),s=eU(this.view.getTheme(),a),u=(0,Ux.get)(s,["marker"]),l=(0,Ux.get)(n,"marker"),c=$G(a),f=(0,Ux.get)(s,["pageNavigator"]),h=(0,Ux.get)(n,"pageNavigator"),p=i?function(t,e,r){return r.map(function(r,n){var i=e;(0,Ux.isFunction)(i)&&(i=i(r.name,n,(0,Ux.deepMix)({},t,r)));var o=(0,Ux.isFunction)(r.marker)?r.marker(r.name,n,(0,Ux.deepMix)({},t,r)):r.marker,a=(0,Ux.deepMix)({},t,i,o);return ZG(a),r.marker=a,r})}(u,l,n.items):tU(this.view,t,e,u,l),d=(0,Ux.get)(n,"title");d&&(d=(0,Ux.deepMix)({text:r?hF(r):""},d));var y=(0,Ux.get)(n,"maxWidthRatio"),g=(0,Ux.get)(n,"maxHeightRatio"),v=this.getCategoryLegendSizeCfg(c,y,g);v.container=o,v.layout=c,v.items=p,v.title=d,v.animateOption=vG,v.pageNavigator=(0,Ux.deepMix)({},f,h);var m=this.mergeLegendCfg(v,n,a);m.reversed&&m.items.reverse();var b=(0,Ux.get)(m,"maxItemWidth");return b&&b<=1&&(m.maxItemWidth=this.view.viewBBox.width*b),m},e.prototype.mergeLegendCfg=function(t,e,r){var n=r.split("-")[0],i=eU(this.view.getTheme(),n);return(0,Ux.deepMix)({},i,t,e)},e.prototype.getId=function(t){return"".concat(this.name,"-").concat(t)},e.prototype.getComponentById=function(t){return(0,Ux.find)(this.components,function(e){return e.id===t})},e.prototype.getCategoryLegendSizeCfg=function(t,e,r){void 0===e&&(e=.25),void 0===r&&(r=.25);var n=this.view.viewBBox,i=n.width,o=n.height;return"vertical"===t?{maxWidth:i*e,maxHeight:o}:{maxWidth:i,maxHeight:o*r}},e}(hG),gV=function(t){function e(e){var r=t.call(this,e)||this;return r.onChangeFn=Ux.noop,r.resetMeasure=function(){r.clear()},r.onValueChange=function(t){var e=(0,Gx.__read)(t,2),n=e[0],i=e[1];r.start=n,r.end=i,r.changeViewData(n,i)},r.container=r.view.getLayer(Oj.FORE).addGroup(),r.onChangeFn=(0,Ux.throttle)(r.onValueChange,20,{leading:!0}),r.width=0,r.view.on(Nj.BEFORE_CHANGE_DATA,r.resetMeasure),r.view.on(Nj.BEFORE_CHANGE_SIZE,r.resetMeasure),r}return(0,Gx.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"slider"},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.view.off(Nj.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(Nj.BEFORE_CHANGE_SIZE,this.resetMeasure)},e.prototype.init=function(){},e.prototype.render=function(){this.option=this.view.getOptions().slider;var t=this.getSliderCfg(),e=t.start,r=t.end;(0,Ux.isNil)(this.start)&&(this.start=e,this.end=r);var n=this.view.getOptions().data;this.option&&!(0,Ux.isEmpty)(n)?this.slider?this.slider=this.updateSlider():(this.slider=this.createSlider(),this.slider.component.on("sliderchange",this.onChangeFn)):this.slider&&(this.slider.component.destroy(),this.slider=void 0)},e.prototype.layout=function(){var t=this;if(this.option&&!this.width&&(this.measureSlider(),setTimeout(function(){t.view.destroyed||t.changeViewData(t.start,t.end)},0)),this.slider){var e=this.view.coordinateBBox.width,r=this.slider.component.get("padding"),n=(0,Gx.__read)(r,4),i=n[0],o=(n[1],n[2],n[3]),a=this.slider.component.getLayoutBBox(),s=new iF(a.x,a.y,Math.min(a.width,e),a.height).expand(r),u=this.getMinMaxText(this.start,this.end),l=u.minText,c=u.maxText,f=(0,Gx.__read)(hV(this.view.viewBBox,s,Mj.BOTTOM),2),h=(f[0],f[1]),p=(0,Gx.__read)(hV(this.view.coordinateBBox,s,Mj.BOTTOM),2),d=p[0];p[1];this.slider.component.update((0,Gx.__assign)((0,Gx.__assign)({},this.getSliderCfg()),{x:d+o,y:h+i,width:this.width,start:this.start,end:this.end,minText:l,maxText:c})),this.view.viewBBox=this.view.viewBBox.cut(s,Mj.BOTTOM)}},e.prototype.update=function(){this.render()},e.prototype.createSlider=function(){var t=this.getSliderCfg(),e=new DB((0,Gx.__assign)({container:this.container},t));return e.init(),{component:e,layer:Oj.FORE,direction:Mj.BOTTOM,type:Pj.SLIDER}},e.prototype.updateSlider=function(){var t=this.getSliderCfg();if(this.width){var e=this.getMinMaxText(this.start,this.end),r=e.minText,n=e.maxText;t=(0,Gx.__assign)((0,Gx.__assign)({},t),{width:this.width,start:this.start,end:this.end,minText:r,maxText:n})}return this.slider.component.update(t),this.slider},e.prototype.measureSlider=function(){var t=this.getSliderCfg().width;this.width=t},e.prototype.getSliderCfg=function(){var t={height:16,start:0,end:1,minText:"",maxText:"",x:0,y:0,width:this.view.coordinateBBox.width};if((0,Ux.isObject)(this.option)){var e=(0,Gx.__assign)({data:this.getData()},(0,Ux.get)(this.option,"trendCfg",{}));t=(0,Ux.deepMix)({},t,this.getThemeOptions(),this.option),t=(0,Gx.__assign)((0,Gx.__assign)({},t),{trendCfg:e})}return t.start=(0,Ux.clamp)(Math.min((0,Ux.isNil)(t.start)?0:t.start,(0,Ux.isNil)(t.end)?1:t.end),0,1),t.end=(0,Ux.clamp)(Math.max((0,Ux.isNil)(t.start)?0:t.start,(0,Ux.isNil)(t.end)?1:t.end),0,1),t},e.prototype.getData=function(){var t=this.view.getOptions().data,e=(0,Gx.__read)(this.view.getYScales(),1)[0],r=this.view.getGroupScales();if(r.length){var n=r[0],i=n.field,o=n.ticks;return t.reduce(function(t,r){return r[i]===o[0]&&t.push(r[e.field]),t},[])}return t.map(function(t){return t[e.field]||0})},e.prototype.getThemeOptions=function(){var t=this.view.getTheme();return(0,Ux.get)(t,["components","slider","common"],{})},e.prototype.getMinMaxText=function(t,e){var r=this.view.getOptions().data,n=this.view.getXScale(),i=(0,Ux.valuesOfKey)(r,n.field);n.isLinear&&(i=i.sort());var o=i,a=(0,Ux.size)(r);if(!n||!a)return{};var s=(0,Ux.size)(o),u=Math.round(t*(s-1)),l=Math.round(e*(s-1)),c=(0,Ux.get)(o,[u]),f=(0,Ux.get)(o,[l]),h=this.getSliderCfg().formatter;return h&&(c=h(c,r[u],u),f=h(f,r[l],l)),{minText:c,maxText:f}},e.prototype.changeViewData=function(t,e){var r=this.view.getOptions().data,n=this.view.getXScale(),i=(0,Ux.size)(r);if(n&&i){var o=(0,Ux.valuesOfKey)(r,n.field),a=this.view.getXScale().isLinear?o.sort(function(t,e){return Number(t)-Number(e)}):o,s=a,u=(0,Ux.size)(s),l=Math.round(t*(u-1)),c=Math.round(e*(u-1));this.view.filter(n.field,function(t,e){var r=s.indexOf(t);return!(r>-1)||eF(r,l,c)}),this.view.render(!0)}},e.prototype.getComponents=function(){return this.slider?[this.slider]:[]},e.prototype.clear=function(){this.slider&&(this.slider.component.destroy(),this.slider=void 0),this.width=0,this.start=void 0,this.end=void 0},e}(hG),vV=function(t){function e(e){var r=t.call(this,e)||this;return r.onChangeFn=Ux.noop,r.resetMeasure=function(){r.clear()},r.onValueChange=function(t){var e=t.ratio,n=r.getValidScrollbarCfg().animate;r.ratio=(0,Ux.clamp)(e,0,1);var i=r.view.getOptions().animate;n||r.view.animate(!1),r.changeViewData(r.getScrollRange(),!0),r.view.animate(i)},r.container=r.view.getLayer(Oj.FORE).addGroup(),r.onChangeFn=(0,Ux.throttle)(r.onValueChange,20,{leading:!0}),r.trackLen=0,r.thumbLen=0,r.ratio=0,r.view.on(Nj.BEFORE_CHANGE_DATA,r.resetMeasure),r.view.on(Nj.BEFORE_CHANGE_SIZE,r.resetMeasure),r}return(0,Gx.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"scrollbar"},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.view.off(Nj.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(Nj.BEFORE_CHANGE_SIZE,this.resetMeasure)},e.prototype.init=function(){},e.prototype.render=function(){this.option=this.view.getOptions().scrollbar,this.option?this.scrollbar?this.scrollbar=this.updateScrollbar():(this.scrollbar=this.createScrollbar(),this.scrollbar.component.on("scrollchange",this.onChangeFn)):this.scrollbar&&(this.scrollbar.component.destroy(),this.scrollbar=void 0)},e.prototype.layout=function(){var t=this;if(this.option&&!this.trackLen&&(this.measureScrollbar(),setTimeout(function(){t.view.destroyed||t.changeViewData(t.getScrollRange(),!0)})),this.scrollbar){var e=this.view.coordinateBBox.width,r=this.scrollbar.component.get("padding"),n=this.scrollbar.component.getLayoutBBox(),i=new iF(n.x,n.y,Math.min(n.width,e),n.height).expand(r),o=this.getScrollbarComponentCfg(),a=void 0,s=void 0;if(o.isHorizontal){var u=(0,Gx.__read)(hV(this.view.viewBBox,i,Mj.BOTTOM),2),l=(u[0],u[1]),c=(0,Gx.__read)(hV(this.view.coordinateBBox,i,Mj.BOTTOM),2),f=c[0];c[1];a=f,s=l}else{var h=(0,Gx.__read)(hV(this.view.viewBBox,i,Mj.RIGHT),2),p=(h[0],l=h[1],(0,Gx.__read)(hV(this.view.viewBBox,i,Mj.RIGHT),2));f=p[0],p[1];a=f,s=l}a+=r[3],s+=r[0],this.trackLen?this.scrollbar.component.update((0,Gx.__assign)((0,Gx.__assign)({},o),{x:a,y:s,trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio})):this.scrollbar.component.update((0,Gx.__assign)((0,Gx.__assign)({},o),{x:a,y:s})),this.view.viewBBox=this.view.viewBBox.cut(i,o.isHorizontal?Mj.BOTTOM:Mj.RIGHT)}},e.prototype.update=function(){this.render()},e.prototype.getComponents=function(){return this.scrollbar?[this.scrollbar]:[]},e.prototype.clear=function(){this.scrollbar&&(this.scrollbar.component.destroy(),this.scrollbar=void 0),this.trackLen=0,this.thumbLen=0,this.ratio=0,this.cnt=0,this.step=0,this.data=void 0,this.xScaleCfg=void 0,this.yScalesCfg=[]},e.prototype.setValue=function(t){this.onValueChange({ratio:t})},e.prototype.getValue=function(){return this.ratio},e.prototype.getThemeOptions=function(){var t=this.view.getTheme();return(0,Ux.get)(t,["components","scrollbar","common"],{})},e.prototype.getScrollbarTheme=function(t){var e=(0,Ux.get)(this.view.getTheme(),["components","scrollbar"]),r=t||{},n=r.thumbHighlightColor,i=(0,Gx.__rest)(r,["thumbHighlightColor"]);return{default:(0,Ux.deepMix)({},(0,Ux.get)(e,["default","style"],{}),i),hover:(0,Ux.deepMix)({},(0,Ux.get)(e,["hover","style"],{}),{thumbColor:n})}},e.prototype.measureScrollbar=function(){var t=this.view.getXScale(),e=this.view.getYScales().slice();this.data=this.getScrollbarData(),this.step=this.getStep(),this.cnt=this.getCnt();var r=this.getScrollbarComponentCfg(),n=r.trackLen,i=r.thumbLen;this.trackLen=n,this.thumbLen=i,this.xScaleCfg={field:t.field,values:t.values||[]},this.yScalesCfg=e},e.prototype.getScrollRange=function(){var t=Math.floor((this.cnt-this.step)*(0,Ux.clamp)(this.ratio,0,1));return[t,Math.min(t+this.step-1,this.cnt-1)]},e.prototype.changeViewData=function(t,e){var r=this,n=(0,Gx.__read)(t,2),i=n[0],o=n[1],a="vertical"!==this.getValidScrollbarCfg().type,s=(0,Ux.valuesOfKey)(this.data,this.xScaleCfg.field),u=this.view.getXScale().isLinear?s.sort(function(t,e){return Number(t)-Number(e)}):s,l=a?u:u.reverse();this.yScalesCfg.forEach(function(t){r.view.scale(t.field,{formatter:t.formatter,type:t.type,min:t.min,max:t.max,tickMethod:t.tickMethod})}),this.view.filter(this.xScaleCfg.field,function(t){var e=l.indexOf(t);return!(e>-1)||eF(e,i,o)}),this.view.render(!0)},e.prototype.createScrollbar=function(){var t="vertical"!==this.getValidScrollbarCfg().type,e=new FB((0,Gx.__assign)((0,Gx.__assign)({container:this.container},this.getScrollbarComponentCfg()),{x:0,y:0}));return e.init(),{component:e,layer:Oj.FORE,direction:t?Mj.BOTTOM:Mj.RIGHT,type:Pj.SCROLLBAR}},e.prototype.updateScrollbar=function(){var t=this.getScrollbarComponentCfg(),e=this.trackLen?(0,Gx.__assign)((0,Gx.__assign)({},t),{trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio}):(0,Gx.__assign)({},t);return this.scrollbar.component.update(e),this.scrollbar},e.prototype.getStep=function(){if(this.step)return this.step;var t=this.view.coordinateBBox,e=this.getValidScrollbarCfg(),r=e.type,n=e.categorySize,i="vertical"!==r;return Math.floor((i?t.width:t.height)/n)},e.prototype.getCnt=function(){if(this.cnt)return this.cnt;var t=this.view.getXScale(),e=this.getScrollbarData(),r=(0,Ux.valuesOfKey)(e,t.field);return(0,Ux.size)(r)},e.prototype.getScrollbarComponentCfg=function(){var t=this.view,e=t.coordinateBBox,r=t.viewBBox,n=this.getValidScrollbarCfg(),i=n.type,o=n.padding,a=n.width,s=n.height,u=n.style,l="vertical"!==i,c=(0,Gx.__read)(o,4),f=c[0],h=c[1],p=c[2],d=c[3],y=l?{x:e.minX+d,y:r.maxY-s-p}:{x:r.maxX-a-h,y:e.minY+f},g=this.getStep(),v=this.getCnt(),m=l?e.width-d-h:e.height-f-p,b=Math.max(m*(0,Ux.clamp)(g/v,0,1),20);return(0,Gx.__assign)((0,Gx.__assign)({},this.getThemeOptions()),{x:y.x,y:y.y,size:l?s:a,isHorizontal:l,trackLen:m,thumbLen:b,thumbOffset:0,theme:this.getScrollbarTheme(u)})},e.prototype.getValidScrollbarCfg=function(){var t={type:"horizontal",categorySize:32,width:8,height:8,padding:[0,0,0,0],animate:!0,style:{}};return(0,Ux.isObject)(this.option)&&(t=(0,Gx.__assign)((0,Gx.__assign)({},t),this.option)),(0,Ux.isObject)(this.option)&&this.option.padding||(t.padding=(t.type,[0,0,0,0])),t},e.prototype.getScrollbarData=function(){var t=this.view.getCoordinate(),e=this.getValidScrollbarCfg(),r=this.view.getOptions().data||[];return t.isReflect("y")&&"vertical"===e.type&&(r=(0,Gx.__spreadArray)([],(0,Gx.__read)(r),!1).reverse()),r},e}(hG),mV={fill:"#CCD6EC",opacity:.3};function bV(t,e,r){var n,i,o,a,s,u,l=function(t,e,r){var n,i,o=Jz(t,e,r);try{for(var a=(0,Gx.__values)(t.views),s=a.next();!s.done;s=a.next()){var u=s.value;o=o.concat(Jz(u,e,r))}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return o}(t,e,r);if(l.length){l=(0,Ux.flatten)(l);try{for(var c=(0,Gx.__values)(l),f=c.next();!f.done;f=c.next()){var h=f.value;try{for(var p=(o=void 0,(0,Gx.__values)(h)),d=p.next();!d.done;d=p.next()){var y=d.value,g=y.mappingData,v=g.x,m=g.y;y.x=(0,Ux.isArray)(v)?v[v.length-1]:v,y.y=(0,Ux.isArray)(m)?m[m.length-1]:m}}catch(t){o={error:t}}finally{try{d&&!d.done&&(a=p.return)&&a.call(p)}finally{if(o)throw o.error}}}}catch(t){n={error:t}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}if(!1===r.shared&&l.length>1){var b=l[0],A=Math.abs(e.y-b[0].y);try{for(var x=(0,Gx.__values)(l),w=x.next();!w.done;w=x.next()){var _=w.value,S=Math.abs(e.y-_[0].y);S<=A&&(b=_,A=S)}}catch(t){s={error:t}}finally{try{w&&!w.done&&(u=x.return)&&u.call(x)}finally{if(s)throw s.error}}l=[b]}return(0,Ux.uniq)((0,Ux.flatten)(l))}return[]}var AV=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.show=function(t){var e=this.context.view,r=this.context.event,n=e.getController("tooltip").getTooltipCfg(),i=bV(e,{x:r.x,y:r.y},n);if(!(0,Ux.isEqual)(i,this.items)&&(this.items=i,i.length)){var o=e.getXScale().field,a=i[0].data[o],s=[],u=e.geometries;if((0,Ux.each)(u,function(t){if("interval"===t.type||"schema"===t.type){var e=t.getElementsBy(function(t){return t.getData()[o]===a});s=s.concat(e)}}),s.length){var l=e.getCoordinate(),c=s[0].shape.getCanvasBBox(),f=s[0].shape.getCanvasBBox(),h=c;(0,Ux.each)(s,function(t){var e=t.shape.getCanvasBBox();l.isTransposed?(e.minYf.maxY&&(f=e)):(e.minXf.maxX&&(f=e)),h.x=Math.min(e.minX,h.minX),h.y=Math.min(e.minY,h.minY),h.width=Math.max(e.maxX,h.maxX)-h.x,h.height=Math.max(e.maxY,h.maxY)-h.y});var p=e.backgroundGroup,d=e.coordinateBBox,y=void 0;if(l.isRect){var g=e.getXScale(),v=t||{},m=v.appendRatio,b=v.appendWidth;(0,Ux.isNil)(b)&&(m=(0,Ux.isNil)(m)?g.isLinear?0:.25:m,b=l.isTransposed?m*f.height:m*c.width);var A=void 0,x=void 0,w=void 0,_=void 0;l.isTransposed?(A=d.minX,x=Math.min(f.minY,c.minY)-b,w=d.width,_=h.height+2*b):(A=Math.min(c.minX,f.minX)-b,x=d.minY,w=h.width+2*b,_=d.height),y=[["M",A,x],["L",A+w,x],["L",A+w,x+_],["L",A,x+_],["Z"]]}else{var S=(0,Ux.head)(s),E=(0,Ux.last)(s),C=ZB(S.getModel(),l).startAngle,k=ZB(E.getModel(),l).endAngle,I=l.getCenter(),T=l.getRadius(),O=l.innerRadius*T;y=KB(I.x,I.y,T,C,k,O)}if(this.regionPath)this.regionPath.attr("path",y),this.regionPath.show();else{var M=(0,Ux.get)(t,"style",mV);this.regionPath=p.addShape({type:"path",name:"active-region",capture:!1,attrs:(0,Gx.__assign)((0,Gx.__assign)({},M),{path:y})})}}}},e.prototype.hide=function(){this.regionPath&&this.regionPath.hide(),this.items=null},e.prototype.destroy=function(){this.hide(),this.regionPath&&this.regionPath.remove(!0),t.prototype.destroy.call(this)},e}(kF),xV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeStamp=0,e}return(0,Gx.__extends)(e,t),e.prototype.show=function(){var t=this.context,e=t.event,r=t.view;if(!r.isTooltipLocked()){var n=this.timeStamp,i=+new Date;if(i-n>(0,Ux.get)(t.view.getOptions(),"tooltip.showDelay",16)){var o=this.location,a={x:e.x,y:e.y};o&&(0,Ux.isEqual)(o,a)||this.showTooltip(r,a),this.timeStamp=i,this.location=a}}},e.prototype.hide=function(){var t=this.context.view,e=t.getController("tooltip"),r=this.context.event,n=r.clientX,i=r.clientY;e.isCursorEntered({x:n,y:i})||t.isTooltipLocked()||(this.hideTooltip(t),this.location=null)},e.prototype.showTooltip=function(t,e){t.showTooltip(e)},e.prototype.hideTooltip=function(t){t.hideTooltip()},e}(kF),wV=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.showTooltip=function(t,e){var r=lz(t);(0,Ux.each)(r,function(r){var n=cz(t,r,e);r.showTooltip(n)})},e.prototype.hideTooltip=function(t){var e=lz(t);(0,Ux.each)(e,function(t){t.hideTooltip()})},e}(xV),_V=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeStamp=0,e}return(0,Gx.__extends)(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.show=function(){var t=this.context.event,e=this.timeStamp,r=+new Date;if(r-e>16){var n=this.location,i={x:t.x,y:t.y};n&&(0,Ux.isEqual)(n,i)||this.showTooltip(i),this.timeStamp=r,this.location=i}},e.prototype.hide=function(){this.hideTooltip(),this.location=null},e.prototype.showTooltip=function(t){var e=this.context,r=e.event.target;if(r&&r.get("tip")){if(this.tooltip){var n=e.view.canvas,i={start:{x:0,y:0},end:{x:n.get("width"),y:n.get("height")}};this.tooltip.set("region",i)}else this.renderTooltip();var o=r.get("tip");this.tooltip.update((0,Gx.__assign)({title:o},t)),this.tooltip.show()}},e.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,e=this.context.view,r=e.canvas,n={start:{x:0,y:0},end:{x:r.get("width"),y:r.get("height")}},i=e.getTheme(),o=(0,Ux.get)(i,["components","tooltip","domStyles"],{}),a=new YB({parent:r.get("el").parentNode,region:n,visible:!1,crosshairs:null,domStyles:(0,Gx.__assign)({},(0,Ux.deepMix)({},o,(t={},t[hB]={"max-width":"50%"},t[pB]={"word-break":"break-all"},t)))});a.init(),a.setCapture(!1),this.tooltip=a},e}(kF),SV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="",e}return(0,Gx.__extends)(e,t),e.prototype.hasState=function(t){return t.hasState(this.stateName)},e.prototype.setElementState=function(t,e){t.setState(this.stateName,e)},e.prototype.setState=function(){this.setStateEnable(!0)},e.prototype.clear=function(){var t=this.context.view;this.clearViewState(t)},e.prototype.clearViewState=function(t){var e=this,r=ez(t,this.stateName);(0,Ux.each)(r,function(t){e.setElementState(t,!1)})},e}(kF);function EV(t){return(0,Ux.get)(t.get("delegateObject"),"item")}var CV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ignoreListItemStates=["unchecked"],e}return(0,Gx.__extends)(e,t),e.prototype.isItemIgnore=function(t,e){return!!this.ignoreListItemStates.filter(function(r){return e.hasState(t,r)}).length},e.prototype.setStateByComponent=function(t,e,r){var n=this.context.view,i=t.get("field"),o=tz(n);this.setElementsStateByItem(o,i,e,r)},e.prototype.setStateByElement=function(t,e){this.setElementState(t,e)},e.prototype.isMathItem=function(t,e,r){var n=hz(this.context.view,e),i=rz(t,e);return!(0,Ux.isNil)(i)&&r.name===n.getText(i)},e.prototype.setElementsStateByItem=function(t,e,r,n){var i=this;(0,Ux.each)(t,function(t){i.isMathItem(t,e,r)&&t.setState(i.stateName,n)})},e.prototype.setStateEnable=function(t){var e=VF(this.context);if(e)YF(this.context)&&this.setStateByElement(e,t);else{var r=QF(this.context);if(WF(r)){var n=r.item,i=r.component;if(n&&i&&!this.isItemIgnore(n,i)){var o=this.context.event.gEvent;if(o&&o.fromShape&&o.toShape&&EV(o.fromShape)===EV(o.toShape))return;this.setStateByComponent(i,n,t)}}}},e.prototype.toggle=function(){var t=VF(this.context);if(t){var e=t.hasState(this.stateName);this.setElementState(t,!e)}},e.prototype.reset=function(){this.setStateEnable(!1)},e}(SV),kV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="active",e}return(0,Gx.__extends)(e,t),e.prototype.active=function(){this.setState()},e}(CV),IV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.cache={},e}return(0,Gx.__extends)(e,t),e.prototype.getColorScale=function(t,e){var r=e.geometry.getAttribute("color");return r?t.getScaleByField(r.getFields()[0]):null},e.prototype.getLinkPath=function(t,e){var r=this.context.view.getCoordinate().isTransposed,n=t.shape.getCanvasBBox(),i=e.shape.getCanvasBBox();return r?[["M",n.minX,n.minY],["L",i.minX,i.maxY],["L",i.maxX,i.maxY],["L",n.maxX,n.minY],["Z"]]:[["M",n.maxX,n.minY],["L",i.minX,i.minY],["L",i.minX,i.maxY],["L",n.maxX,n.maxY],["Z"]]},e.prototype.addLinkShape=function(t,e,r,n){var i={opacity:.4,fill:e.shape.attr("fill")};t.addShape({type:"path",attrs:(0,Gx.__assign)((0,Gx.__assign)({},(0,Ux.deepMix)({},i,(0,Ux.isFunction)(n)?n(i,e):n)),{path:this.getLinkPath(e,r)})})},e.prototype.linkByElement=function(t,e){var r=this,n=this.context.view,i=this.getColorScale(n,t);if(i){var o=rz(t,i.field);if(!this.cache[o]){var a=function(t,e,r){return tz(t).filter(function(t){return rz(t,e)===r})}(n,i.field,o),s=this.linkGroup.addGroup();this.cache[o]=s;var u=a.length;(0,Ux.each)(a,function(t,n){if(n=0},e)},e}(TV),VV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="active",e}return(0,Gx.__extends)(e,t),e.prototype.highlight=function(){this.setState()},e.prototype.setElementState=function(t,e){RV(tz(this.context.view),function(e){return t===e},e)},e.prototype.clear=function(){jV(this.context.view)},e}(MV),QV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="selected",e}return(0,Gx.__extends)(e,t),e.prototype.selected=function(){this.setState()},e}(TV),YV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="selected",e}return(0,Gx.__extends)(e,t),e.prototype.selected=function(){this.setState()},e}(CV),WV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="selected",e}return(0,Gx.__extends)(e,t),e.prototype.selected=function(){this.setState()},e}(MV),qV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="",e.ignoreItemStates=[],e}return(0,Gx.__extends)(e,t),e.prototype.getTriggerListInfo=function(){var t=QF(this.context),e=null;return WF(t)&&(e={item:t.item,list:t.component}),e},e.prototype.getAllowComponents=function(){var t=this,e=az(this.context.view),r=[];return(0,Ux.each)(e,function(e){e.isList()&&t.allowSetStateByElement(e)&&r.push(e)}),r},e.prototype.hasState=function(t,e){return t.hasState(e,this.stateName)},e.prototype.clearAllComponentsState=function(){var t=this,e=this.getAllowComponents();(0,Ux.each)(e,function(e){e.clearItemsState(t.stateName)})},e.prototype.allowSetStateByElement=function(t){var e=t.get("field");if(!e)return!1;if(this.cfg&&this.cfg.componentNames){var r=t.get("name");if(-1===this.cfg.componentNames.indexOf(r))return!1}var n=hz(this.context.view,e);return n&&n.isCategory},e.prototype.allowSetStateByItem=function(t,e){var r=this.ignoreItemStates;return!r.length||0===r.filter(function(r){return e.hasState(t,r)}).length},e.prototype.setStateByElement=function(t,e,r){var n=t.get("field"),i=hz(this.context.view,n),o=rz(e,n),a=i.getText(o);this.setItemsState(t,a,r)},e.prototype.setStateEnable=function(t){var e=this,r=VF(this.context);if(r){var n=this.getAllowComponents();(0,Ux.each)(n,function(n){e.setStateByElement(n,r,t)})}else{var i=QF(this.context);if(WF(i)){var o=i.item,a=i.component;this.allowSetStateByElement(a)&&this.allowSetStateByItem(o,a)&&this.setItemState(a,o,t)}}},e.prototype.setItemsState=function(t,e,r){var n=this,i=t.getItems();(0,Ux.each)(i,function(i){i.name===e&&n.setItemState(t,i,r)})},e.prototype.setItemState=function(t,e,r){t.setItemState(e,this.stateName,r)},e.prototype.setState=function(){this.setStateEnable(!0)},e.prototype.reset=function(){this.setStateEnable(!1)},e.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var e=t.list,r=t.item,n=this.hasState(e,r);this.setItemState(e,r,!n)}},e.prototype.clear=function(){var t=this.getTriggerListInfo();t?t.list.clearItemsState(this.stateName):this.clearAllComponentsState()},e}(kF),XV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="active",e}return(0,Gx.__extends)(e,t),e.prototype.active=function(){this.setState()},e}(qV),KV="inactive",JV="active";var ZV="active",$V=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName=ZV,e.ignoreItemStates=["unchecked"],e}return(0,Gx.__extends)(e,t),e.prototype.setItemsState=function(t,e,r){this.setHighlightBy(t,function(t){return t.name===e},r)},e.prototype.setItemState=function(t,e,r){t.getItems();this.setHighlightBy(t,function(t){return t===e},r)},e.prototype.setHighlightBy=function(t,e,r){var n=t.getItems();if(r)(0,Ux.each)(n,function(r){e(r)?(t.hasState(r,"inactive")&&t.setItemState(r,"inactive",!1),t.setItemState(r,ZV,!0)):t.hasState(r,ZV)||t.setItemState(r,"inactive",!0)});else{var i=t.getItemsByState(ZV),o=!0;(0,Ux.each)(i,function(t){if(!e(t))return o=!1,!1}),o?this.clear():(0,Ux.each)(n,function(r){e(r)&&(t.hasState(r,ZV)&&t.setItemState(r,ZV,!1),t.setItemState(r,"inactive",!0))})}},e.prototype.highlight=function(){this.setState()},e.prototype.clear=function(){var t,e,r=this.getTriggerListInfo();if(r)t=r.list,e=t.getItems(),(0,Ux.each)(e,function(e){t.hasState(e,JV)&&t.setItemState(e,JV,!1),t.hasState(e,KV)&&t.setItemState(e,KV,!1)});else{var n=this.getAllowComponents();(0,Ux.each)(n,function(t){t.clearItemsState(ZV),t.clearItemsState("inactive")})}},e}(qV),tQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="selected",e}return(0,Gx.__extends)(e,t),e.prototype.selected=function(){this.setState()},e}(qV),eQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="unchecked",e}return(0,Gx.__extends)(e,t),e.prototype.unchecked=function(){this.setState()},e}(qV),rQ="checked",nQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName=rQ,e}return(0,Gx.__extends)(e,t),e.prototype.setItemState=function(t,e,r){this.setCheckedBy(t,function(t){return t===e},r)},e.prototype.setCheckedBy=function(t,e,r){var n=t.getItems();r&&(0,Ux.each)(n,function(r){e(r)?(t.hasState(r,"unchecked")&&t.setItemState(r,"unchecked",!1),t.setItemState(r,rQ,!0)):t.hasState(r,rQ)||t.setItemState(r,"unchecked",!0)})},e.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var e=t.list,r=t.item;!(0,Ux.some)(e.getItems(),function(t){return e.hasState(t,"unchecked")})||e.hasState(r,"unchecked")?this.setItemState(e,r,!0):this.reset()}},e.prototype.checked=function(){this.setState()},e.prototype.reset=function(){var t=this.getAllowComponents();(0,Ux.each)(t,function(t){t.clearItemsState(rQ),t.clearItemsState("unchecked")})},e}(qV),iQ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.toggle=function(){var t,e,r,n,i,o,a,s,u=this.getTriggerListInfo();if(null===u||void 0===u?void 0:u.item){var l=u.list,c=u.item,f=l.getItems(),h=f.filter(function(t){return!l.hasState(t,"unchecked")}),p=f.filter(function(t){return l.hasState(t,"unchecked")}),d=h[0];if(f.length===h.length)try{for(var y=(0,Gx.__values)(f),g=y.next();!g.done;g=y.next()){var v=g.value;l.setItemState(v,"unchecked",v.id!==c.id)}}catch(e){t={error:e}}finally{try{g&&!g.done&&(e=y.return)&&e.call(y)}finally{if(t)throw t.error}}else if(f.length-p.length==1)if(d.id===c.id)try{for(var m=(0,Gx.__values)(f),b=m.next();!b.done;b=m.next()){v=b.value;l.setItemState(v,"unchecked",!1)}}catch(t){r={error:t}}finally{try{b&&!b.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}else try{for(var A=(0,Gx.__values)(f),x=A.next();!x.done;x=A.next()){v=x.value;l.setItemState(v,"unchecked",v.id!==c.id)}}catch(t){i={error:t}}finally{try{x&&!x.done&&(o=A.return)&&o.call(A)}finally{if(i)throw i.error}}else try{for(var w=(0,Gx.__values)(f),_=w.next();!_.done;_=w.next()){v=_.value;l.setItemState(v,"unchecked",v.id!==c.id)}}catch(t){a={error:t}}finally{try{_&&!_.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}}},e}(qV),oQ="legend-radio-tip",aQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeStamp=0,e}return(0,Gx.__extends)(e,t),e.prototype.show=function(){var t=this.getTriggerListInfo();if(null===t||void 0===t?void 0:t.item){var e=t.list,r=t.item;e.setItemState(r,"showRadio",!0)}},e.prototype.hide=function(){var t=this.getTriggerListInfo();if(null===t||void 0===t?void 0:t.item){var e=t.list,r=t.item;e.setItemState(r,"showRadio",!1)}},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.showTip=function(){var t=this.context.event,e=this.timeStamp,r=+new Date,n=this.context.event.target;if(r-e>16&&"legend-item-radio"===n.get("name")){var i=this.location,o={x:t.x,y:t.y};this.timeStamp=r,this.location=o,i&&(0,Ux.isEqual)(i,o)||this.showTooltip(o)}},e.prototype.hideTip=function(){this.hideTooltip(),this.location=null},e.prototype.showTooltip=function(t){var e=this.context,r=e.event.target;if(r&&r.get("tip")){this.tooltip||this.renderTooltip();var n=e.view.getCanvas().get("el").getBoundingClientRect(),i=n.x,o=n.y;this.tooltip.update((0,Gx.__assign)((0,Gx.__assign)({title:r.get("tip")},t),{x:t.x+i,y:t.y+o})),this.tooltip.show()}},e.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,e=((t={})[hB]={padding:"6px 8px",transform:"translate(-50%, -80%)",background:"rgba(0,0,0,0.75)",color:"#fff","border-radius":"2px","z-index":100},t[pB]={"font-size":"12px","line-height":"14px","margin-bottom":0,"word-break":"break-all"},t);document.getElementById(oQ)&&document.body.removeChild(document.getElementById(oQ));var r=new YB({parent:document.body,region:null,visible:!1,crosshairs:null,domStyles:e,containerId:oQ});r.init(),r.setCapture(!1),this.tooltip=r},e}(qV),sQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.maskShape=null,e.points=[],e.starting=!1,e.moving=!1,e.preMovePoint=null,e.shapeType="path",e}return(0,Gx.__extends)(e,t),e.prototype.getCurrentPoint=function(){var t=this.context.event;return{x:t.x,y:t.y}},e.prototype.emitEvent=function(t){var e="mask:".concat(t),r=this.context.view,n=this.context.event;r.emit(e,{target:this.maskShape,shape:this.maskShape,points:this.points,x:n.x,y:n.y})},e.prototype.createMask=function(){var t=this.context.view,e=this.getMaskAttrs();return t.foregroundGroup.addShape({type:this.shapeType,name:"mask",draggable:!0,attrs:(0,Gx.__assign)({fill:"#C5D4EB",opacity:.3},e)})},e.prototype.getMaskPath=function(){return[]},e.prototype.show=function(){this.maskShape&&(this.maskShape.show(),this.emitEvent("show"))},e.prototype.start=function(t){this.starting=!0,this.moving=!1,this.points=[this.getCurrentPoint()],this.maskShape||(this.maskShape=this.createMask(),this.maskShape.set("capture",!1)),this.updateMask(null===t||void 0===t?void 0:t.maskStyle),this.emitEvent("start")},e.prototype.moveStart=function(){this.moving=!0,this.preMovePoint=this.getCurrentPoint()},e.prototype.move=function(){if(this.moving&&this.maskShape){var t=this.getCurrentPoint(),e=this.preMovePoint,r=t.x-e.x,n=t.y-e.y,i=this.points;(0,Ux.each)(i,function(t){t.x+=r,t.y+=n}),this.updateMask(),this.emitEvent("change"),this.preMovePoint=t}},e.prototype.updateMask=function(t){var e=(0,Ux.deepMix)({},this.getMaskAttrs(),t);this.maskShape.attr(e)},e.prototype.moveEnd=function(){this.moving=!1,this.preMovePoint=null},e.prototype.end=function(){this.starting=!1,this.emitEvent("end"),this.maskShape&&this.maskShape.set("capture",!0)},e.prototype.hide=function(){this.maskShape&&(this.maskShape.hide(),this.emitEvent("hide"))},e.prototype.resize=function(){this.starting&&this.maskShape&&(this.points.push(this.getCurrentPoint()),this.updateMask(),this.emitEvent("change"))},e.prototype.destroy=function(){this.points=[],this.maskShape&&this.maskShape.remove(),this.maskShape=null,this.preMovePoint=null,t.prototype.destroy.call(this)},e}(kF);function uQ(t){var e=(0,Ux.last)(t),r=0,n=0,i=0;if(t.length){var o=t[0];r=sz(o,e)/2,n=(e.x+o.x)/2,i=(e.y+o.y)/2}return{x:n,y:i,r:r}}var lQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shapeType="circle",e}return(0,Gx.__extends)(e,t),e.prototype.getMaskAttrs=function(){return uQ(this.points)},e}(sQ);function cQ(t){return{start:(0,Ux.head)(t),end:(0,Ux.last)(t)}}function fQ(t,e){return{x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),width:Math.abs(e.x-t.x),height:Math.abs(e.y-t.y)}}var hQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shapeType="rect",e}return(0,Gx.__extends)(e,t),e.prototype.getRegion=function(){return cQ(this.points)},e.prototype.getMaskAttrs=function(){var t=this.getRegion();return fQ(t.start,t.end)},e}(sQ);function pQ(t){t.x=(0,Ux.clamp)(t.x,0,1),t.y=(0,Ux.clamp)(t.y,0,1)}function dQ(t,e,r,n){var i=null,o=null,a=n.invert((0,Ux.head)(t)),s=n.invert((0,Ux.last)(t));return r&&(pQ(a),pQ(s)),"x"===e?(i=n.convert({x:a.x,y:0}),o=n.convert({x:s.x,y:1})):(i=n.convert({x:0,y:a.y}),o=n.convert({x:1,y:s.y})),{start:i,end:o}}var yQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dim="x",e.inPlot=!0,e}return(0,Gx.__extends)(e,t),e.prototype.getRegion=function(){var t=this.context.view.getCoordinate();return dQ(this.points,this.dim,this.inPlot,t)},e}(hQ);function gQ(t){var e=[];return t.length&&((0,Ux.each)(t,function(t,r){0===r?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])}),e.push(["L",t[0].x,t[0].y])),e}function vQ(t){return{path:gQ(t)}}var mQ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getMaskPath=function(){return gQ(this.points)},e.prototype.getMaskAttrs=function(){return vQ(this.points)},e.prototype.addPoint=function(){this.resize()},e}(sQ);function bQ(t){return function(t,e){if(t.length<=2)return RF(t,!1);var r=t[0],n=[];(0,Ux.each)(t,function(t){n.push(t.x),n.push(t.y)});var i=jF(n,e,null);return i.unshift(["M",r.x,r.y]),i}(t,!0)}function AQ(t){return{path:bQ(t)}}var xQ,wQ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.getMaskPath=function(){return bQ(this.points)},e.prototype.getMaskAttrs=function(){return AQ(this.points)},e}(mQ),_Q=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.maskShapes=[],e.starting=!1,e.moving=!1,e.recordPoints=null,e.preMovePoint=null,e.shapeType="path",e.maskType="multi-mask",e}return(0,Gx.__extends)(e,t),e.prototype.getCurrentPoint=function(){var t=this.context.event;return{x:t.x,y:t.y}},e.prototype.emitEvent=function(t){var e="".concat(this.maskType,":").concat(t),r=this.context.view,n=this.context.event,i={type:this.shapeType,name:this.maskType,get:function(t){return i.hasOwnProperty(t)?i[t]:void 0}};r.emit(e,{target:i,maskShapes:this.maskShapes,multiPoints:this.recordPoints,x:n.x,y:n.y})},e.prototype.createMask=function(t){var e=this.context.view,r=this.recordPoints[t],n=this.getMaskAttrs(r),i=e.foregroundGroup.addShape({type:this.shapeType,name:"mask",draggable:!0,attrs:(0,Gx.__assign)({fill:"#C5D4EB",opacity:.3},n)});this.maskShapes.push(i)},e.prototype.getMaskPath=function(t){return[]},e.prototype.show=function(){this.maskShapes.length>0&&(this.maskShapes.forEach(function(t){return t.show()}),this.emitEvent("show"))},e.prototype.start=function(t){this.recordPointStart(),this.starting=!0,this.moving=!1;var e=this.recordPoints.length-1;this.createMask(e),this.updateShapesCapture(!1),this.updateMask(null===t||void 0===t?void 0:t.maskStyle),this.emitEvent("start")},e.prototype.moveStart=function(){this.moving=!0,this.preMovePoint=this.getCurrentPoint(),this.updateShapesCapture(!1)},e.prototype.move=function(){if(this.moving&&0!==this.maskShapes.length){var t=this.getCurrentPoint(),e=this.preMovePoint,r=t.x-e.x,n=t.y-e.y,i=this.getCurMaskShapeIndex();i>-1&&(this.recordPoints[i].forEach(function(t){t.x+=r,t.y+=n}),this.updateMask(),this.emitEvent("change"),this.preMovePoint=t)}},e.prototype.updateMask=function(t){var e=this;this.recordPoints.forEach(function(r,n){var i=(0,Ux.deepMix)({},e.getMaskAttrs(r),t);e.maskShapes[n].attr(i)})},e.prototype.resize=function(){this.starting&&this.maskShapes.length>0&&(this.recordPointContinue(),this.updateMask(),this.emitEvent("change"))},e.prototype.moveEnd=function(){this.moving=!1,this.preMovePoint=null,this.updateShapesCapture(!0)},e.prototype.end=function(){this.starting=!1,this.emitEvent("end"),this.updateShapesCapture(!0)},e.prototype.hide=function(){this.maskShapes.length>0&&(this.maskShapes.forEach(function(t){return t.hide()}),this.emitEvent("hide"))},e.prototype.remove=function(){var t=this.getCurMaskShapeIndex();t>-1&&(this.recordPoints.splice(t,1),this.maskShapes[t].remove(),this.maskShapes.splice(t,1),this.preMovePoint=null,this.updateShapesCapture(!0),this.emitEvent("change"))},e.prototype.clearAll=function(){this.recordPointClear(),this.maskShapes.forEach(function(t){return t.remove()}),this.maskShapes=[],this.preMovePoint=null},e.prototype.clear=function(){var t=this.getCurMaskShapeIndex();-1===t?(this.recordPointClear(),this.maskShapes.forEach(function(t){return t.remove()}),this.maskShapes=[],this.emitEvent("clearAll")):(this.recordPoints.splice(t,1),this.maskShapes[t].remove(),this.maskShapes.splice(t,1),this.preMovePoint=null,this.emitEvent("clearSingle")),this.preMovePoint=null},e.prototype.destroy=function(){this.clear(),t.prototype.destroy.call(this)},e.prototype.getRecordPoints=function(){var t;return(0,Gx.__spreadArray)([],(0,Gx.__read)(null!==(t=this.recordPoints)&&void 0!==t?t:[]),!1)},e.prototype.recordPointStart=function(){var t=this.getRecordPoints(),e=this.getCurrentPoint();this.recordPoints=(0,Gx.__spreadArray)((0,Gx.__spreadArray)([],(0,Gx.__read)(t),!1),[[e]],!1)},e.prototype.recordPointContinue=function(){var t=this.getRecordPoints(),e=this.getCurrentPoint(),r=t.splice(-1,1)[0]||[];r.push(e),this.recordPoints=(0,Gx.__spreadArray)((0,Gx.__spreadArray)([],(0,Gx.__read)(t),!1),[r],!1)},e.prototype.recordPointClear=function(){this.recordPoints=[]},e.prototype.updateShapesCapture=function(t){this.maskShapes.forEach(function(e){return e.set("capture",t)})},e.prototype.getCurMaskShapeIndex=function(){var t=this.getCurrentPoint();return this.maskShapes.findIndex(function(e){var r=e.attrs,n=r.width,i=r.height,o=r.r;return!(0===n||0===i||0===o)&&e.isHit(t.x,t.y)})},e}(kF),SQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shapeType="rect",e}return(0,Gx.__extends)(e,t),e.prototype.getRegion=function(t){return cQ(t)},e.prototype.getMaskAttrs=function(t){var e=this.getRegion(t);return fQ(e.start,e.end)},e}(_Q),EQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dim="x",e.inPlot=!0,e}return(0,Gx.__extends)(e,t),e.prototype.getRegion=function(t){var e=this.context.view.getCoordinate();return dQ(t,this.dim,this.inPlot,e)},e}(SQ),CQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shapeType="circle",e.getMaskAttrs=uQ,e}return(0,Gx.__extends)(e,t),e}(_Q),kQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.getMaskPath=gQ,e.getMaskAttrs=vQ,e}return(0,Gx.__extends)(e,t),e.prototype.addPoint=function(){this.resize()},e}(_Q),IQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.getMaskPath=bQ,e.getMaskAttrs=AQ,e}return(0,Gx.__extends)(e,t),e}(kQ),TQ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.setCursor=function(t){this.context.view.getCanvas().setCursor(t)},e.prototype.default=function(){this.setCursor("default")},e.prototype.pointer=function(){this.setCursor("pointer")},e.prototype.move=function(){this.setCursor("move")},e.prototype.crosshair=function(){this.setCursor("crosshair")},e.prototype.wait=function(){this.setCursor("wait")},e.prototype.help=function(){this.setCursor("help")},e.prototype.text=function(){this.setCursor("text")},e.prototype.eResize=function(){this.setCursor("e-resize")},e.prototype.wResize=function(){this.setCursor("w-resize")},e.prototype.nResize=function(){this.setCursor("n-resize")},e.prototype.sResize=function(){this.setCursor("s-resize")},e.prototype.neResize=function(){this.setCursor("ne-resize")},e.prototype.nwResize=function(){this.setCursor("nw-resize")},e.prototype.seResize=function(){this.setCursor("se-resize")},e.prototype.swResize=function(){this.setCursor("sw-resize")},e.prototype.nsResize=function(){this.setCursor("ns-resize")},e.prototype.ewResize=function(){this.setCursor("ew-resize")},e.prototype.zoomIn=function(){this.setCursor("zoom-in")},e.prototype.zoomOut=function(){this.setCursor("zoom-out")},e}(kF),OQ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.filterView=function(t,e,r){var n=this;t.getScaleByField(e)&&t.filter(e,r),t.views&&t.views.length&&(0,Ux.each)(t.views,function(t){n.filterView(t,e,r)})},e.prototype.filter=function(){var t=QF(this.context);if(t){var e=this.context.view,r=t.component,n=r.get("field");if(WF(t)){if(n){var i=r.getItemsByState("unchecked"),o=hz(e,n),a=i.map(function(t){return t.name});a.length?this.filterView(e,n,function(t){var e=o.getText(t);return!a.includes(e)}):this.filterView(e,n,null),e.render(!0)}}else if(qF(t)){var s=r.getValue(),u=(0,Gx.__read)(s,2),l=u[0],c=u[1];this.filterView(e,n,function(t){return t>=l&&t<=c}),e.render(!0)}}},e}(kF);function MQ(t,e,r,n){var i=Math.min(r[e],n[e]),o=Math.max(r[e],n[e]),a=(0,Gx.__read)(t.range,2),s=a[0],u=a[1];if(iu&&(o=u),i===u&&o===u)return null;var l=t.invert(i),c=t.invert(o);if(t.isCategory){var f=t.values.indexOf(l),h=t.values.indexOf(c),p=t.values.slice(f,h+1);return function(t){return p.includes(t)}}return function(t){return t>=l&&t<=c}}!function(t){t.FILTER="brush-filter-processing",t.RESET="brush-filter-reset",t.BEFORE_FILTER="brush-filter:beforefilter",t.AFTER_FILTER="brush-filter:afterfilter",t.BEFORE_RESET="brush-filter:beforereset",t.AFTER_RESET="brush-filter:afterreset"}(xQ||(xQ={}));var PQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dims=["x","y"],e.startPoint=null,e.isStarted=!1,e}return(0,Gx.__extends)(e,t),e.prototype.hasDim=function(t){return this.dims.includes(t)},e.prototype.start=function(){var t=this.context;this.isStarted=!0,this.startPoint=t.getCurrentPoint()},e.prototype.filter=function(){var t,e;if(XF(this.context)){var r=this.context.event.target.getCanvasBBox();t={x:r.x,y:r.y},e={x:r.maxX,y:r.maxY}}else{if(!this.isStarted)return;t=this.startPoint,e=this.context.getCurrentPoint()}if(!(Math.abs(t.x-e.x)<5||Math.abs(t.x-e.y)<5)){var n=this.context,i=n.view,o={view:i,event:n.event,dims:this.dims};i.emit(xQ.BEFORE_FILTER,rG.fromData(i,xQ.BEFORE_FILTER,o));var a=i.getCoordinate(),s=a.invert(e),u=a.invert(t);if(this.hasDim("x")){var l=i.getXScale(),c=MQ(l,"x",s,u);this.filterView(i,l.field,c)}if(this.hasDim("y")){var f=i.getYScales()[0];c=MQ(f,"y",s,u);this.filterView(i,f.field,c)}this.reRender(i,{source:xQ.FILTER}),i.emit(xQ.AFTER_FILTER,rG.fromData(i,xQ.AFTER_FILTER,o))}},e.prototype.end=function(){this.isStarted=!1},e.prototype.reset=function(){var t=this.context.view;if(t.emit(xQ.BEFORE_RESET,rG.fromData(t,xQ.BEFORE_RESET,{})),this.isStarted=!1,this.hasDim("x")){var e=t.getXScale();this.filterView(t,e.field,null)}if(this.hasDim("y")){var r=t.getYScales()[0];this.filterView(t,r.field,null)}this.reRender(t,{source:xQ.RESET}),t.emit(xQ.AFTER_RESET,rG.fromData(t,xQ.AFTER_RESET,{}))},e.prototype.filterView=function(t,e,r){t.filter(e,r)},e.prototype.reRender=function(t,e){t.render(!0,e)},e}(kF),LQ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.filterView=function(t,e,r){var n=lz(t);(0,Ux.each)(n,function(t){t.filter(e,r)})},e.prototype.reRender=function(t){var e=lz(t);(0,Ux.each)(e,function(t){t.render(!0)})},e}(PQ),NQ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.filter=function(){var t=QF(this.context),e=this.context.view,r=tz(e);if(XF(this.context)){var n=JF(this.context,10);n&&(0,Ux.each)(r,function(t){n.includes(t)?t.show():t.hide()})}else if(t){var i=t.component,o=i.get("field");if(WF(t)){if(o){var a=i.getItemsByState("unchecked"),s=hz(e,o),u=a.map(function(t){return t.name});(0,Ux.each)(r,function(t){var e=rz(t,o),r=s.getText(e);u.indexOf(r)>=0?t.hide():t.show()})}}else if(qF(t)){var l=i.getValue(),c=(0,Gx.__read)(l,2),f=c[0],h=c[1];(0,Ux.each)(r,function(t){var e=rz(t,o);e>=f&&e<=h?t.show():t.hide()})}}},e.prototype.clear=function(){var t=tz(this.context.view);(0,Ux.each)(t,function(t){t.show()})},e.prototype.reset=function(){this.clear()},e}(kF),jQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.byRecord=!1,e}return(0,Gx.__extends)(e,t),e.prototype.filter=function(){XF(this.context)&&(this.byRecord?this.filterByRecord():this.filterByBBox())},e.prototype.filterByRecord=function(){var t=this.context.view,e=JF(this.context,10);if(e){var r=t.getXScale().field,n=t.getYScales()[0].field,i=e.map(function(t){return t.getModel().data}),o=lz(t);(0,Ux.each)(o,function(t){var e=tz(t);(0,Ux.each)(e,function(t){var e=t.getModel().data;fz(i,e,r,n)?t.show():t.hide()})})}},e.prototype.filterByBBox=function(){var t=this,e=lz(this.context.view);(0,Ux.each)(e,function(e){var r=ZF(t.context,e,10),n=tz(e);r&&(0,Ux.each)(n,function(t){r.includes(t)?t.show():t.hide()})})},e.prototype.reset=function(){var t=lz(this.context.view);(0,Ux.each)(t,function(t){var e=tz(t);(0,Ux.each)(e,function(t){t.show()})})},e}(kF),RQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.buttonGroup=null,e.buttonCfg={name:"button",text:"button",textStyle:{x:0,y:0,fontSize:12,fill:"#333333",cursor:"pointer"},padding:[8,10],style:{fill:"#f7f7f7",stroke:"#cccccc",cursor:"pointer"},activeStyle:{fill:"#e6e6e6"}},e}return(0,Gx.__extends)(e,t),e.prototype.getButtonCfg=function(){return(0,Ux.deepMix)(this.buttonCfg,this.cfg)},e.prototype.drawButton=function(){var t=this.getButtonCfg(),e=this.context.view.foregroundGroup.addGroup({name:t.name}),r=e.addShape({type:"text",name:"button-text",attrs:(0,Gx.__assign)({text:t.text},t.textStyle)}).getBBox(),n=Zz(t.padding),i=e.addShape({type:"rect",name:"button-rect",attrs:(0,Gx.__assign)({x:r.x-n[3],y:r.y-n[0],width:r.width+n[1]+n[3],height:r.height+n[0]+n[2]},t.style)});i.toBack(),e.on("mouseenter",function(){i.attr(t.activeStyle)}),e.on("mouseleave",function(){i.attr(t.style)}),this.buttonGroup=e},e.prototype.resetPosition=function(){var t=this.context.view.getCoordinate().convert({x:1,y:1}),e=this.buttonGroup,r=e.getBBox(),n=Wx.pd(null,[["t",t.x-r.width-10,t.y+r.height+5]]);e.setMatrix(n)},e.prototype.show=function(){this.buttonGroup||this.drawButton(),this.resetPosition(),this.buttonGroup.show()},e.prototype.hide=function(){this.buttonGroup&&this.buttonGroup.hide()},e.prototype.destroy=function(){var e=this.buttonGroup;e&&e.remove(),t.prototype.destroy.call(this)},e}(kF),DQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.starting=!1,e.dragStart=!1,e}return(0,Gx.__extends)(e,t),e.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint()},e.prototype.drag=function(){if(this.startPoint){var t=this.context.getCurrentPoint(),e=this.context.view,r=this.context.event;this.dragStart?e.emit("drag",{target:r.target,x:r.x,y:r.y}):sz(t,this.startPoint)>4&&(e.emit("dragstart",{target:r.target,x:r.x,y:r.y}),this.dragStart=!0)}},e.prototype.end=function(){if(this.dragStart){var t=this.context.view,e=this.context.event;t.emit("dragend",{target:e.target,x:e.x,y:e.y})}this.starting=!1,this.dragStart=!1},e}(kF),BQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.starting=!1,e.isMoving=!1,e.startPoint=null,e.startMatrix=null,e}return(0,Gx.__extends)(e,t),e.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint(),this.startMatrix=this.context.view.middleGroup.getMatrix()},e.prototype.move=function(){if(this.starting){var t=this.startPoint,e=this.context.getCurrentPoint();if(sz(t,e)>5&&!this.isMoving&&(this.isMoving=!0),this.isMoving){var r=this.context.view,n=Wx.pd(this.startMatrix,[["t",e.x-t.x,e.y-t.y]]);r.backgroundGroup.setMatrix(n),r.foregroundGroup.setMatrix(n),r.middleGroup.setMatrix(n)}}},e.prototype.end=function(){this.isMoving&&(this.isMoving=!1),this.startMatrix=null,this.starting=!1,this.startPoint=null},e.prototype.reset=function(){this.starting=!1,this.startPoint=null,this.isMoving=!1;var t=this.context.view;t.backgroundGroup.resetMatrix(),t.foregroundGroup.resetMatrix(),t.middleGroup.resetMatrix(),this.isMoving=!1},e}(kF),FQ="x",zQ="y",GQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dims=[FQ,zQ],e.cfgFields=["dims"],e.cacheScaleDefs={},e}return(0,Gx.__extends)(e,t),e.prototype.hasDim=function(t){return this.dims.includes(t)},e.prototype.getScale=function(t){var e=this.context.view;return"x"===t?e.getXScale():e.getYScales()[0]},e.prototype.resetDim=function(t){var e=this.context.view;if(this.hasDim(t)&&this.cacheScaleDefs[t]){var r=this.getScale(t);e.scale(r.field,this.cacheScaleDefs[t]),this.cacheScaleDefs[t]=null}},e.prototype.reset=function(){this.resetDim(FQ),this.resetDim(zQ),this.context.view.render(!0)},e}(kF),UQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.startPoint=null,e.starting=!1,e.startCache={},e}return(0,Gx.__extends)(e,t),e.prototype.start=function(){var t=this;this.startPoint=this.context.getCurrentPoint(),this.starting=!0;var e=this.dims;(0,Ux.each)(e,function(e){var r=t.getScale(e),n=r.min,i=r.max,o=r.values;t.startCache[e]={min:n,max:i,values:o}})},e.prototype.end=function(){this.startPoint=null,this.starting=!1,this.startCache={}},e.prototype.translate=function(){var t=this;if(this.starting){var e=this.startPoint,r=this.context.view.getCoordinate(),n=this.context.getCurrentPoint(),i=r.invert(e),o=r.invert(n),a=o.x-i.x,s=o.y-i.y,u=this.context.view,l=this.dims;(0,Ux.each)(l,function(e){t.translateDim(e,{x:-1*a,y:-1*s})}),u.render(!0)}},e.prototype.translateDim=function(t,e){if(this.hasDim(t)){var r=this.getScale(t);r.isLinear&&this.translateLinear(t,r,e)}},e.prototype.translateLinear=function(t,e,r){var n=this.context.view,i=this.startCache[t],o=i.min,a=i.max,s=a-o,u=r[t]*s;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:e.nice,min:o,max:a}),n.scale(e.field,{nice:!1,min:o+u,max:a+u})},e.prototype.reset=function(){t.prototype.reset.call(this),this.startPoint=null,this.starting=!1},e}(GQ),HQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.zoomRatio=.05,e}return(0,Gx.__extends)(e,t),e.prototype.zoomIn=function(){this.zoom(this.zoomRatio)},e.prototype.zoom=function(t){var e=this,r=this.dims;(0,Ux.each)(r,function(r){e.zoomDim(r,t)}),this.context.view.render(!0)},e.prototype.zoomOut=function(){this.zoom(-1*this.zoomRatio)},e.prototype.zoomDim=function(t,e){if(this.hasDim(t)){var r=this.getScale(t);r.isLinear&&this.zoomLinear(t,r,e)}},e.prototype.zoomLinear=function(t,e,r){var n=this.context.view;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:e.nice,min:e.min,max:e.max});var i=this.cacheScaleDefs[t],o=i.max-i.min,a=e.min,s=e.max,u=r*o,l=a-u,c=s+u,f=(c-l)/o;c>l&&f<100&&f>.01&&n.scale(e.field,{nice:!1,min:a-u,max:s+u})},e}(GQ);var VQ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.scroll=function(t){var e=this.context,r=e.view,n=e.event;if(r.getOptions().scrollbar){var i=(null===t||void 0===t?void 0:t.wheelDelta)||1,o=r.getController("scrollbar"),a=r.getXScale(),s=r.getOptions().data,u=(0,Ux.size)((0,Ux.valuesOfKey)(s,a.field)),l=(0,Ux.size)(a.values),c=o.getValue(),f=Math.floor((u-l)*c)+(function(t){return t.gEvent.originalEvent.deltaY>0}(n)?i:-i),h=i/(u-l)/1e4,p=(0,Ux.clamp)(f/(u-l)+h,0,1);o.setValue(p)}},e}(kF),QQ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gx.__extends)(e,t),e.prototype.show=function(){var t=this.context,e=QF(t).axis.cfg.title,r=e.description,n=e.text,i=e.descriptionTooltipStyle,o=t.event,a=o.x,s=o.y;this.tooltip||this.renderTooltip(),this.tooltip.update({title:n||"",customContent:function(){return'\n
      \n
      \n 字段说明:').concat(r,"\n
      \n
      \n ")},x:a,y:s}),this.tooltip.show()},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.hide=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,e=this.context.view.canvas,r={start:{x:0,y:0},end:{x:e.get("width"),y:e.get("height")}},n=new YB({parent:e.get("el").parentNode,region:r,visible:!1,containerId:"aixs-description-tooltip",domStyles:(0,Gx.__assign)({},(0,Ux.deepMix)({},(t={},t[hB]={"max-width":"50%",padding:"10px","line-height":"15px","font-size":"12px",color:"rgba(0, 0, 0, .65)"},t[pB]={"word-break":"break-all","margin-bottom":"3px"},t)))});n.init(),n.setCapture(!1),this.tooltip=n},e}(kF);function YQ(t){return t.isInPlot()}function WQ(t){return t.gEvent.preventDefault(),t.gEvent.originalEvent.deltaY>0}Uz("dark",Cz(IU)),Qj("canvas",f),Qj("svg",p),lG("Polygon",qU),lG("Interval",HU),lG("Schema",XU),lG("Path",TU),lG("Point",WU),lG("Line",VU),lG("Area",LU),lG("Edge",NU),lG("Heatmap",jU),lG("Violin",KU),CG("base",qG),CG("interval",aH),CG("pie",lH),CG("polar",uH),IG("overlap",function(t,e,r,n){var i=new vH;(0,Ux.each)(e,function(t){for(var e=t.find(function(t){return"text"===t.get("type")}),r=e.attr(),n=r.x,o=r.y,a=!1,s=0;s<=8;s++){var u=mH(e,n,o,s);if(i.hasGap(u)){i.fillGap(u),a=!0;break}}a||t.remove(!0)}),i.destroy()}),IG("distribute",function(t,e,r,n){if(t.length&&e.length){var i=t[0]?t[0].offset:0,o=e[0].get("coordinate"),a=o.getRadius(),s=o.getCenter();if(i>0){var u=2*(a+i)+28,l={start:o.start,end:o.end},c=[[],[]];t.forEach(function(t){t&&("right"===t.textAlign?c[0].push(t):c[1].push(t))}),c.forEach(function(t,r){var n=u/14;t.length>n&&(t.sort(function(t,e){return e["..percent"]-t["..percent"]}),t.splice(n,t.length-n)),t.sort(function(t,e){return t.y-e.y}),function(t,e,r,n,i,o){var a,s,u,l=!0,c=n.start,f=n.end,h=Math.min(c.y,f.y),p=Math.abs(c.y-f.y),d=0,y=Number.MIN_VALUE,g=e.map(function(t){return t.y>d&&(d=t.y),t.yp&&(p=d-h);l;)for(g.forEach(function(t){var e=(Math.min.apply(y,t.targets)+Math.max.apply(y,t.targets))/2;t.pos=Math.min(Math.max(y,e-t.size/2),p-t.size)}),l=!1,u=g.length;u--;)if(u>0){var v=g[u-1],m=g[u];v.pos+v.size>m.pos&&(v.size+=m.size,v.targets=v.targets.concat(m.targets),v.pos+v.size>p&&(v.pos=p-v.size),g.splice(u,1),l=!0)}u=0,g.forEach(function(t){var n=h+r/2;t.targets.forEach(function(){e[u].y=t.pos+n,n+=r,u++})});var b={};try{for(var A=(0,Gx.__values)(t),x=A.next();!x.done;x=A.next()){var w=x.value;b[w.get("id")]=w}}catch(t){a={error:t}}finally{try{x&&!x.done&&(s=A.return)&&s.call(A)}finally{if(a)throw a.error}}e.forEach(function(t){var e=t.r*t.r,r=Math.pow(Math.abs(t.y-i.y),2);if(ei.maxX||n.maxY>i.maxY)&&t.remove(!0)})}),IG("limit-in-canvas",function(t,e,r,n){(0,Ux.each)(e,function(t){var e=n.minX,r=n.minY,i=n.maxX,o=n.maxY,a=t.getCanvasBBox(),s=a.minX,u=a.minY,l=a.maxX,c=a.maxY,f=a.x,h=a.y,p=a.width,d=a.height,y=f,g=h;(si?y=i-p:l>i&&(y-=l-i),u>o?g=o-d:c>o&&(g-=c-o),y===f&&g===h||GG(t,y-f,g-h)})}),IG("limit-in-plot",function(t,e,r,n,i){if(!(e.length<=0)){var o=(null===i||void 0===i?void 0:i.direction)||["top","right","bottom","left"],a=(null===i||void 0===i?void 0:i.action)||"translate",s=(null===i||void 0===i?void 0:i.margin)||0,u=e[0].get("coordinate");if(u){var l=function(t,e){void 0===e&&(e=0);var r=t.start,n=t.end,i=t.getWidth(),o=t.getHeight(),a=Math.min(r.x,n.x),s=Math.min(r.y,n.y);return iF.fromRange(a-e,s-e,a+i+e,s+o+e)}(u,s),c=l.minX,f=l.minY,h=l.maxX,p=l.maxY;(0,Ux.each)(e,function(t){var e=t.getCanvasBBox(),r=e.minX,n=e.minY,i=e.maxX,s=e.maxY,u=e.x,l=e.y,d=e.width,y=e.height,g=u,v=l;if(o.indexOf("left")>=0&&(r=0&&(n=0&&(r>h?g=h-d:i>h&&(g-=i-h)),o.indexOf("bottom")>=0&&(n>p?v=p-y:s>p&&(v-=s-p)),g!==u||v!==l){var m=g-u;"translate"===a?GG(t,m,v-l):"ellipsis"===a?t.findAll(function(t){return"text"===t.get("type")}).forEach(function(t){var e=(0,Ux.pick)(t.attr(),["fontSize","fontFamily","fontWeight","fontStyle","fontVariant"]),r=t.getCanvasBBox(),n=GH(t.attr("text"),r.width-Math.abs(m),e);t.attr("text",n)}):t.hide()}})}}}),IG("pie-outer",function(t,e,r,n){var i,o,a=(0,Ux.filter)(t,function(t){return!(0,Ux.isNil)(t)}),s=e[0]&&e[0].get("coordinate");if(s){var u=s.getCenter(),l=s.getRadius(),c={};try{for(var f=(0,Gx.__values)(e),h=f.next();!h.done;h=f.next()){var p=h.value;c[p.get("id")]=p}}catch(t){i={error:t}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}var d=(0,Ux.get)(a[0],"labelHeight",14),y=(0,Ux.get)(a[0],"offset",0);if(!(y<=0)){var g=(0,Ux.groupBy)(a,function(t){return t.xr&&(t.sort(function(t,e){return e.percent-t.percent}),(0,Ux.each)(t,function(t,e){e+1>r&&(c[t.id].set("visible",!1),t.invisible=!0)})),fH(t,d,x)}),(0,Ux.each)(g,function(t,e){(0,Ux.each)(t,function(t){var r="right"===e,n=c[t.id].getChildByIndex(0);if(n){var i=l+y,o=t.y-u.y,a=Math.pow(i,2),f=Math.pow(o,2),h=a-f>0?a-f:0,p=Math.sqrt(h),d=Math.abs(Math.cos(t.angle)*i);t.x=r?u.x+Math.max(p,d):u.x-Math.max(p,d)}n&&(n.attr("y",t.y),n.attr("x",t.x)),function(t,e){var r=e.getCenter(),n=e.getRadius();if(t&&t.labelLine){var i=t.angle,o=t.offset,a=XB(r.x,r.y,n,i),s=t.x+(0,Ux.get)(t,"offsetX",0)*(Math.cos(i)>0?1:-1),u=t.y+(0,Ux.get)(t,"offsetY",0)*(Math.sin(i)>0?1:-1),l={x:s-Math.cos(i)*hH,y:u-Math.sin(i)*hH},c=t.labelLine.smooth,f=[],h=l.x-r.x,p=l.y-r.y,d=Math.atan(p/h);if(h<0&&(d+=Math.PI),!1===c){(0,Ux.isObject)(t.labelLine)||(t.labelLine={});var y=0;(i<0&&i>-Math.PI/2||i>1.5*Math.PI)&&l.y>a.y&&(y=1),i>=0&&ia.y&&(y=1),i>=Math.PI/2&&il.y&&(y=1),(i<-Math.PI/2||i>=Math.PI&&i<1.5*Math.PI)&&a.y>l.y&&(y=1);var g=o/2>4?4:Math.max(o/2-1,0),v=XB(r.x,r.y,n+g,i),m=XB(r.x,r.y,n+o/2,d);f.push("M ".concat(a.x," ").concat(a.y)),f.push("L ".concat(v.x," ").concat(v.y)),f.push("A ".concat(r.x," ").concat(r.y," 0 ").concat(0," ").concat(y," ").concat(m.x," ").concat(m.y)),f.push("L ".concat(l.x," ").concat(l.y))}else{v=XB(r.x,r.y,n+(o/2>4?4:Math.max(o/2-1,0)),i);var b=a.xMath.pow(Math.E,-16)&&f.push.apply(f,["C",l.x+4*b,l.y,2*v.x-a.x,2*v.y-a.y,a.x,a.y]),f.push("L ".concat(a.x," ").concat(a.y))}t.labelLine.path=f.join(" ")}}(t,s)})})}}}),IG("adjust-color",function(t,e,r){if(0!==r.length){var n=r[0].get("element").geometry.theme,i=n.labels||{},o=i.fillColorLight,a=i.fillColorDark;r.forEach(function(t,r){var i=e[r].find(function(t){return"text"===t.get("type")}),s=iF.fromObject(t.getBBox()),u=iF.fromObject(i.getCanvasBBox()),l=!s.contains(u),c=t.attr("fill"),f=LH(c);l?i.attr(n.overflowLabels.style):f?o&&i.attr("fill",o):a&&i.attr("fill",a)})}}),IG("interval-adjust-position",function(t,e,r){var n;if(0!==r.length){var i=null===(n=r[0])||void 0===n?void 0:n.get("element"),o=null===i||void 0===i?void 0:i.geometry;o&&"interval"===o.type&&NH(o,e,r)&&r.forEach(function(t,r){var n=e[r];!function(t,e,r){var n=t.coordinate,i=iF.fromObject(r.getBBox()),o=HG(e);n.isTransposed?o.attr({x:i.minX+i.width/2,textAlign:"center"}):o.attr({y:i.minY+i.height/2,textBaseline:"middle"})}(o,n,t)})}}),IG("interval-hide-overlap",function(t,e,r){var n;if(0!==r.length){var i=null===(n=r[0])||void 0===n?void 0:n.get("element"),o=null===i||void 0===i?void 0:i.geometry;if(o&&"interval"===o.type){var a,s=function(t){var e=[],r=Math.max(Math.floor(t.length/500),1);return(0,Ux.each)(t,function(t,n){n%r==0?e.push(t):t.set("visible",!1)}),e}(e),u=(0,Gx.__read)(o.getXYFields(),1)[0],l=[],c=[],f=(0,Ux.groupBy)(s,function(t){return t.get("data")[u]}),h=(0,Ux.uniq)((0,Ux.map)(s,function(t){return t.get("data")[u]}));s.forEach(function(t){t.set("visible",!0)});var p=function(t){t&&(t.length&&c.push(t.pop()),c.push.apply(c,(0,Gx.__spreadArray)([],(0,Gx.__read)(t),!1)))};for((0,Ux.size)(h)>0&&(a=h.shift(),p(f[a])),(0,Ux.size)(h)>0&&(a=h.pop(),p(f[a])),(0,Ux.each)(h.reverse(),function(t){p(f[t])});c.length>0;){var d=c.shift();d.get("visible")&&(QG(d,l)?d.set("visible",!1):l.push(d))}}}}),IG("point-adjust-position",function(t,e,r,n,i){var o,a;if(0!==r.length){var s=null===(o=r[0])||void 0===o?void 0:o.get("element"),u=null===s||void 0===s?void 0:s.geometry;if(u&&"point"===u.type){var l=(0,Gx.__read)(u.getXYFields(),2),c=l[0],f=l[1],h=(0,Ux.groupBy)(e,function(t){return t.get("data")[c]}),p=[],d=i&&i.offset||(null===(a=t[0])||void 0===a?void 0:a.offset)||12;(0,Ux.map)((0,Ux.keys)(h).reverse(),function(t){for(var e=function(t,e){var r=t.getXYFields()[1],n=[],i=e.sort(function(t,e){return t.get("data")[r]-t.get("data")[r]});return i.length>0&&n.push(i.shift()),i.length>0&&n.push(i.pop()),n.push.apply(n,(0,Gx.__spreadArray)([],(0,Gx.__read)(i),!1)),n}(u,h[t]);e.length;){var r=e.shift(),n=HG(r);if(jH(p,r,function(t,e){return t.get("data")[c]===e.get("data")[c]&&t.get("data")[f]===e.get("data")[f]}))n.set("visible",!1);else{var i=!1;RH(p,r)&&(n.attr("y",n.attr("y")+2*d),i=RH(p,r)),i?n.set("visible",!1):p.push(r)}}})}}}),IG("pie-spider",function(t,e,r,n){var i,o,a=e[0]&&e[0].get("coordinate");if(a){var s=a.getCenter(),u=a.getRadius(),l={};try{for(var c=(0,Gx.__values)(e),f=c.next();!f.done;f=c.next()){var h=f.value;l[h.get("id")]=h}}catch(t){i={error:t}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}var p=(0,Ux.get)(t[0],"labelHeight",14),d=Math.max((0,Ux.get)(t[0],"offset",0),pH);(0,Ux.each)(t,function(t){if(t&&(0,Ux.get)(l,[t.id])){var e=t.x>s.x||t.x===s.x&&t.y>s.y,r=(0,Ux.isNil)(t.offsetX)?dH:t.offsetX,n=XB(s.x,s.y,u+pH,t.angle),i=d+r;t.x=s.x+(e?1:-1)*(u+i),t.y=n.y}});var y=a.start,g=a.end,v=(0,Ux.groupBy)(t,function(t){return t.xm&&(m=Math.min(e,Math.abs(y.y-g.y)))});var b={minX:y.x,maxX:g.x,minY:s.y-m/2,maxY:s.y+m/2};(0,Ux.each)(v,function(t,e){var r=m/p;t.length>r&&(t.sort(function(t,e){return e.percent-t.percent}),(0,Ux.each)(t,function(t,e){e>r&&(l[t.id].set("visible",!1),t.invisible=!0)})),fH(t,p,b)});var A=b.minY,x=b.maxY;(0,Ux.each)(v,function(t,e){var r="right"===e;(0,Ux.each)(t,function(t){var e=(0,Ux.get)(l,t&&[t.id]);if(e)if(t.yx)e.set("visible",!1);else{var n=e.getChildByIndex(0),i=n.getCanvasBBox(),o=r?i.x:i.maxX,s=i.y+i.height/2;GG(n,t.x-o,t.y-s),t.labelLine&&function(t,e,r){var n,i=e.getCenter(),o=e.getRadius(),a={x:t.x-(r?yH:-yH),y:t.y},s=XB(i.x,i.y,o+pH,t.angle),u={x:a.x,y:a.y},l={x:s.x,y:s.y},c=XB(i.x,i.y,o,t.angle);if(a.y!==s.y){var f=r?4:-4;u.y=a.y,t.angle<0&&t.angle>=-Math.PI/2&&(u.x=Math.max(s.x,a.x-f),a.y0&&t.angles.y?l.y=u.y:(l.y=s.y,l.x=Math.max(l.x,u.x-f))),t.angle>Math.PI/2&&(u.x=Math.min(s.x,a.x-f),a.y>s.y?l.y=u.y:(l.y=s.y,l.x=Math.min(l.x,u.x-f))),t.angle<-Math.PI/2&&(u.x=Math.min(s.x,a.x-f),a.y0&&n.push(i.shift()),i.length>0&&n.push(i.pop()),n.push.apply(n,(0,Gx.__spreadArray)([],(0,Gx.__read)(i),!1)),n}(u,h[t]);e.length;){var r=e.shift(),n=HG(r);if(DH(p,r,function(t,e){return t.get("data")[c]===e.get("data")[c]&&t.get("data")[f]===e.get("data")[f]}))n.set("visible",!1);else{var i=!1;BH(p,r)&&(n.attr("y",n.attr("y")+2*d),i=BH(p,r)),i?n.set("visible",!1):p.push(r)}}})}}}),gG("fade-in",function(t,e,r){var n={fillOpacity:(0,Ux.isNil)(t.attr("fillOpacity"))?1:t.attr("fillOpacity"),strokeOpacity:(0,Ux.isNil)(t.attr("strokeOpacity"))?1:t.attr("strokeOpacity"),opacity:(0,Ux.isNil)(t.attr("opacity"))?1:t.attr("opacity")};t.attr({fillOpacity:0,strokeOpacity:0,opacity:0}),t.animate(n,e)}),gG("fade-out",function(t,e,r){var n=e.easing,i=e.duration,o=e.delay;t.animate({fillOpacity:0,strokeOpacity:0,opacity:0},i,n,function(){t.remove(!0)},o)}),gG("grow-in-x",function(t,e,r){UH(t,e,r.coordinate,r.minYPoint,"x")}),gG("grow-in-xy",function(t,e,r){UH(t,e,r.coordinate,r.minYPoint,"xy")}),gG("grow-in-y",function(t,e,r){UH(t,e,r.coordinate,r.minYPoint,"y")}),gG("scale-in-x",function(t,e,r){var n=t.getBBox(),i=t.get("origin").mappingData.points,o=i[0].y-i[1].y>0?n.maxX:n.minX,a=(n.minY+n.maxY)/2;t.applyToMatrix([o,a,1]);var s=Wx.pd(t.getMatrix(),[["t",-o,-a],["s",.01,1],["t",o,a]]);t.setMatrix(s),t.animate({matrix:Wx.pd(t.getMatrix(),[["t",-o,-a],["s",100,1],["t",o,a]])},e)}),gG("scale-in-y",function(t,e,r){var n=t.getBBox(),i=t.get("origin").mappingData,o=(n.minX+n.maxX)/2,a=i.points,s=a[0].y-a[1].y<=0?n.maxY:n.minY;t.applyToMatrix([o,s,1]);var u=Wx.pd(t.getMatrix(),[["t",-o,-s],["s",1,.01],["t",o,s]]);t.setMatrix(u),t.animate({matrix:Wx.pd(t.getMatrix(),[["t",-o,-s],["s",1,100],["t",o,s]])},e)}),gG("wave-in",function(t,e,r){var n=uF(r.coordinate,20),i=n.type,o=n.startState,a=n.endState,s=t.setClip({type:i,attrs:o});r.toAttrs&&t.attr(r.toAttrs),s.animate(a,(0,Gx.__assign)((0,Gx.__assign)({},e),{callback:function(){t&&!t.get("destroyed")&&t.set("clipShape",null),s.remove(!0),(0,Ux.isFunction)(e.callback)&&e.callback()}}))}),gG("zoom-in",function(t,e,r){YH(t,e,"zoomIn")}),gG("zoom-out",function(t,e,r){YH(t,e,"zoomOut")}),gG("position-update",function(t,e,r){var n=r.toAttrs,i=n.x,o=n.y;delete n.x,delete n.y,t.attr(n),t.animate({x:i,y:o},e)}),gG("sector-path-update",function(t,e,r){var n=r.toAttrs,i=r.coordinate,o=n.path||[],a=o.map(function(t){return t[0]});if(!(o.length<1)){var s=QH(o),u=s.startAngle,l=s.endAngle,c=s.radius,f=s.innerRadius,h=QH(t.attr("path")),p=h.startAngle,d=h.endAngle,y=i.getCenter(),g=u-p,v=l-d;0!==g||0!==v?t.animate(function(t){var e=p+t*g,r=d+t*v;return(0,Gx.__assign)((0,Gx.__assign)({},n),{path:(0,Ux.isEqual)(a,["M","A","A","Z"])?JB(y.x,y.y,c,e,r):KB(y.x,y.y,c,e,r,f)})},(0,Gx.__assign)((0,Gx.__assign)({},e),{callback:function(){t.attr("path",o),(0,Ux.isFunction)(e.callback)&&e.callback()}})):t.attr(n)}}),gG("path-in",function(t,e,r){var n=t.getTotalLength();t.attr("lineDash",[n]),t.animate(function(t){return{lineDashOffset:(1-t)*n}},e)}),CF("rect",$H),CF("mirror",ZH),CF("list",KH),CF("matrix",JH),CF("circle",XH),CF("tree",tV),tG("axis",fV),tG("legend",yV),tG("tooltip",pG),tG("annotation",iV),tG("slider",gV),tG("scrollbar",vV),MF("tooltip",xV),MF("sibling-tooltip",wV),MF("ellipsis-text",_V),MF("element-active",kV),MF("element-single-active",PV),MF("element-range-active",OV),MF("element-highlight",zV),MF("element-highlight-by-x",UV),MF("element-highlight-by-color",GV),MF("element-single-highlight",VV),MF("element-range-highlight",HV),MF("element-sibling-highlight",HV,{effectSiblings:!0,effectByRecord:!0}),MF("element-selected",YV),MF("element-single-selected",WV),MF("element-range-selected",QV),MF("element-link-by-color",IV),MF("active-region",AV),MF("list-active",XV),MF("list-selected",tQ),MF("list-highlight",$V),MF("list-unchecked",eQ),MF("list-checked",nQ),MF("list-focus",iQ),MF("list-radio",aQ),MF("legend-item-highlight",$V,{componentNames:["legend"]}),MF("axis-label-highlight",$V,{componentNames:["axis"]}),MF("axis-description",QQ),MF("rect-mask",hQ),MF("x-rect-mask",yQ,{dim:"x"}),MF("y-rect-mask",yQ,{dim:"y"}),MF("circle-mask",lQ),MF("path-mask",mQ),MF("smooth-path-mask",wQ),MF("rect-multi-mask",SQ),MF("x-rect-multi-mask",EQ,{dim:"x"}),MF("y-rect-multi-mask",EQ,{dim:"y"}),MF("circle-multi-mask",CQ),MF("path-multi-mask",kQ),MF("smooth-path-multi-mask",IQ),MF("cursor",TQ),MF("data-filter",OQ),MF("brush",PQ),MF("brush-x",PQ,{dims:["x"]}),MF("brush-y",PQ,{dims:["y"]}),MF("sibling-filter",LQ),MF("sibling-x-filter",LQ,{dims:"x"}),MF("sibling-y-filter",LQ,{dims:"y"}),MF("element-filter",NQ),MF("element-sibling-filter",jQ),MF("element-sibling-filter-record",jQ,{byRecord:!0}),MF("view-drag",DQ),MF("view-move",BQ),MF("scale-translate",UQ),MF("scale-zoom",HQ),MF("reset-button",RQ,{name:"reset-button",text:"reset"}),MF("mousewheel-scroll",VQ),Ez("tooltip",{start:[{trigger:"plot:mousemove",action:"tooltip:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"plot:touchmove",action:"tooltip:show",throttle:{wait:50,leading:!0,trailing:!1}}],end:[{trigger:"plot:mouseleave",action:"tooltip:hide"},{trigger:"plot:leave",action:"tooltip:hide"},{trigger:"plot:touchend",action:"tooltip:hide"}]}),Ez("ellipsis-text",{start:[{trigger:"legend-item-name:mousemove",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"legend-item-name:touchstart",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"axis-label:mousemove",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"axis-label:touchstart",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}}],end:[{trigger:"legend-item-name:mouseleave",action:"ellipsis-text:hide"},{trigger:"legend-item-name:touchend",action:"ellipsis-text:hide"},{trigger:"axis-label:mouseleave",action:"ellipsis-text:hide"},{trigger:"axis-label:mouseout",action:"ellipsis-text:hide"},{trigger:"axis-label:touchend",action:"ellipsis-text:hide"}]}),Ez("element-active",{start:[{trigger:"element:mouseenter",action:"element-active:active"}],end:[{trigger:"element:mouseleave",action:"element-active:reset"}]}),Ez("element-selected",{start:[{trigger:"element:click",action:"element-selected:toggle"}]}),Ez("element-highlight",{start:[{trigger:"element:mouseenter",action:"element-highlight:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight:reset"}]}),Ez("element-highlight-by-x",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-x:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-x:reset"}]}),Ez("element-highlight-by-color",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-color:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-color:reset"}]}),Ez("legend-active",{start:[{trigger:"legend-item:mouseenter",action:["list-active:active","element-active:active"]}],end:[{trigger:"legend-item:mouseleave",action:["list-active:reset","element-active:reset"]}]}),Ez("legend-highlight",{start:[{trigger:"legend-item:mouseenter",action:["legend-item-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"legend-item:mouseleave",action:["legend-item-highlight:reset","element-highlight:reset"]}]}),Ez("axis-label-highlight",{start:[{trigger:"axis-label:mouseenter",action:["axis-label-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"axis-label:mouseleave",action:["axis-label-highlight:reset","element-highlight:reset"]}]}),Ez("element-list-highlight",{start:[{trigger:"element:mouseenter",action:["list-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"element:mouseleave",action:["list-highlight:reset","element-highlight:reset"]}]}),Ez("element-range-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"mask:mouseenter",action:"cursor:move"},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"plot:mousedown",isEnable:function(t){return!t.isInShape("mask")},action:["rect-mask:start","rect-mask:show"]},{trigger:"mask:dragstart",action:["rect-mask:moveStart"]}],processing:[{trigger:"plot:mousemove",action:["rect-mask:resize"]},{trigger:"mask:drag",action:["rect-mask:move"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["rect-mask:end"]},{trigger:"mask:dragend",action:["rect-mask:moveEnd"]},{trigger:"document:mouseup",isEnable:function(t){return!t.isInPlot()},action:["element-range-highlight:clear","rect-mask:end","rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["element-range-highlight:clear","rect-mask:hide"]}]}),Ez("brush",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:YQ,action:["brush:start","rect-mask:start","rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:YQ,action:["rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:YQ,action:["brush:filter","brush:end","rect-mask:end","rect-mask:hide","reset-button:show"]}],rollback:[{trigger:"reset-button:click",action:["brush:reset","reset-button:hide","cursor:crosshair"]}]}),Ez("brush-visible",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"plot:mousedown",action:["rect-mask:start","rect-mask:show"]}],processing:[{trigger:"plot:mousemove",action:["rect-mask:resize"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["rect-mask:end","rect-mask:hide","element-filter:filter","element-range-highlight:clear"]}],rollback:[{trigger:"dblclick",action:["element-filter:clear"]}]}),Ez("brush-x",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:YQ,action:["brush-x:start","x-rect-mask:start","x-rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:YQ,action:["x-rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:YQ,action:["brush-x:filter","brush-x:end","x-rect-mask:end","x-rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["brush-x:reset"]}]}),Ez("element-path-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:YQ,action:"path-mask:start"},{trigger:"mousedown",isEnable:YQ,action:"path-mask:show"}],processing:[{trigger:"mousemove",action:"path-mask:addPoint"}],end:[{trigger:"mouseup",action:"path-mask:end"}],rollback:[{trigger:"dblclick",action:"path-mask:hide"}]}),Ez("brush-x-multi",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"mask:mouseenter",action:"cursor:move"},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"mousedown",isEnable:YQ,action:["x-rect-multi-mask:start","x-rect-multi-mask:show"]},{trigger:"mask:dragstart",action:["x-rect-multi-mask:moveStart"]}],processing:[{trigger:"mousemove",isEnable:function(t){return!KF(t)},action:["x-rect-multi-mask:resize"]},{trigger:"multi-mask:change",action:"element-range-highlight:highlight"},{trigger:"mask:drag",action:["x-rect-multi-mask:move"]}],end:[{trigger:"mouseup",action:["x-rect-multi-mask:end"]},{trigger:"mask:dragend",action:["x-rect-multi-mask:moveEnd"]}],rollback:[{trigger:"dblclick",action:["x-rect-multi-mask:clear","cursor:crosshair"]},{trigger:"multi-mask:clearAll",action:["element-range-highlight:clear"]},{trigger:"multi-mask:clearSingle",action:["element-range-highlight:highlight"]}]}),Ez("element-single-selected",{start:[{trigger:"element:click",action:"element-single-selected:toggle"}]}),Ez("legend-filter",{showEnable:[{trigger:"legend-item:mouseenter",action:["cursor:pointer","list-radio:show"]},{trigger:"legend-item:mouseleave",action:["cursor:default","list-radio:hide"]}],start:[{trigger:"legend-item:click",isEnable:function(t){return!t.isInShape("legend-item-radio")},action:["legend-item-highlight:reset","element-highlight:reset","list-unchecked:toggle","data-filter:filter","list-radio:show"]},{trigger:"legend-item-radio:mouseenter",action:["list-radio:showTip"]},{trigger:"legend-item-radio:mouseleave",action:["list-radio:hideTip"]},{trigger:"legend-item-radio:click",action:["list-focus:toggle","data-filter:filter","list-radio:show"]}]}),Ez("continuous-filter",{start:[{trigger:"legend:valuechanged",action:"data-filter:filter"}]}),Ez("continuous-visible-filter",{start:[{trigger:"legend:valuechanged",action:"element-filter:filter"}]}),Ez("legend-visible-filter",{showEnable:[{trigger:"legend-item:mouseenter",action:"cursor:pointer"},{trigger:"legend-item:mouseleave",action:"cursor:default"}],start:[{trigger:"legend-item:click",action:["legend-item-highlight:reset","element-highlight:reset","list-unchecked:toggle","element-filter:filter"]}]}),Ez("active-region",{start:[{trigger:"plot:mousemove",action:"active-region:show"}],end:[{trigger:"plot:mouseleave",action:"active-region:hide"}]}),Ez("axis-description",{start:[{trigger:"axis-description:mousemove",action:"axis-description:show"}],end:[{trigger:"axis-description:mouseleave",action:"axis-description:hide"}]}),Ez("view-zoom",{start:[{trigger:"plot:mousewheel",isEnable:function(t){return WQ(t.event)},action:"scale-zoom:zoomOut",throttle:{wait:100,leading:!0,trailing:!1}},{trigger:"plot:mousewheel",isEnable:function(t){return!WQ(t.event)},action:"scale-zoom:zoomIn",throttle:{wait:100,leading:!0,trailing:!1}}]}),Ez("sibling-tooltip",{start:[{trigger:"plot:mousemove",action:"sibling-tooltip:show"}],end:[{trigger:"plot:mouseleave",action:"sibling-tooltip:hide"}]}),Ez("plot-mousewheel-scroll",{start:[{trigger:"plot:mousewheel",action:"mousewheel-scroll:scroll"}]});var qQ={colorRegExp:null,_nameColors:null,initialize:function(){this.colorRegExp=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,this._nameColors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"}},toColor:function(t,e){if(e=e||"rgb",t&&(3===t.length||4===t.length)){if(t=this.map(t,function(t){return t>1?Math.ceil(t):t}),e.indexOf("hex")>-1)return"#"+((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1);if(e.indexOf("hs")>-1){var r=this.map(t.slice(1,3),function(t){return t+"%"});t[1]=r[0],t[2]=r[1]}return e.indexOf("a")>-1?(3===t.length&&t.push(1),t[3]=this.adjust(t[3],[0,1]),e+"("+t.slice(0,4).join(",")+")"):e+"("+t.slice(0,3).join(",")+")"}},convert:function(t,e){if(!this.isCalculableColor(t))return t;var r=this.getData(t),n=r[3];return void 0===n&&(n=1),t.indexOf("hsb")>-1?r=this._HSV_2_RGB(r):t.indexOf("hsl")>-1&&(r=this._HSL_2_RGB(r)),r[3]=n,this.toColor(r,e)},toRGBA:function(t){return this.convert(t,"rgba")},trim:function(t){return String(t).replace(/\s+/g,"")},normalize:function(t){if(this._nameColors[t]&&(t=this._nameColors[t]),t=(t=this.trim(t)).replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(t)){var e=(3840&(t=parseInt(t.slice(1),16)))<<8,r=(240&t)<<4,n=15&t;t="#"+((1<<24)+(e<<4)+e+(r<<4)+r+(n<<4)+n).toString(16).slice(1)}return t},getData:function(t){var e,r,n=(t=this.normalize(t)).match(this.colorRegExp);if(null===n)throw new Error("The color format error");var i,o=[];if(n[2])i=[(e=n[2].replace("#","").split(""))[0]+e[1],e[2]+e[3],e[4]+e[5]],o=this.map(i,function(t){return qQ.adjust.call(this,parseInt(t,16),[0,255])});else if(n[4]){var a=n[4].split(",");r=a[3],i=a.slice(0,3),o=this.map(i,function(t){return t=Math.floor(t.indexOf("%")>0?2.55*parseInt(t,0):t),qQ.adjust.call(this,t,[0,255])}),void 0!==r&&o.push(this.adjust(parseFloat(r),[0,1]))}else if(n[5]||n[6]){var s=(n[5]||n[6]).split(","),u=parseInt(s[0],0)/360,l=s[1],c=s[2];r=s[3],(o=this.map([l,c],function(t){return qQ.adjust.call(this,parseFloat(t)/100,[0,1])})).unshift(u),void 0!==r&&o.push(this.adjust(parseFloat(r),[0,1]))}return o},map:function(t,e){if("function"!=typeof e)throw new TypeError;for(var r=t?t.length:0,n=0;n=e[1]&&(t=e[1]),t},isCalculableColor:function(t){return t instanceof Array||"string"==typeof t},_HSV_2_RGB:function(t){var e,r,n,i=t[0],o=t[1],a=t[2];if(0===o)e=255*a,r=255*a,n=255*a;else{var s=6*i;6===s&&(s=0);var u=0|s,l=a*(1-o),c=a*(1-o*(s-u)),f=a*(1-o*(1-(s-u))),h=0,p=0,d=0;0===u?(h=a,p=f,d=l):1===u?(h=c,p=a,d=l):2===u?(h=l,p=a,d=f):3===u?(h=l,p=c,d=a):4===u?(h=f,p=l,d=a):(h=a,p=l,d=c),e=255*h,r=255*p,n=255*d}return[e,r,n]},_HSL_2_RGB:function(t){var e,r,n,i=t[0],o=t[1],a=t[2];if(0===o)e=255*a,r=255*a,n=255*a;else{var s,u=2*a-(s=a<.5?a*(1+o):a+o-o*a);e=255*this._HUE_2_RGB(u,s,i+1/3),r=255*this._HUE_2_RGB(u,s,i),n=255*this._HUE_2_RGB(u,s,i-1/3)}return[e,r,n]},_HUE_2_RGB:function(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?t+6*(e-t)*r:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}};qQ.initialize();var XQ=qQ,KQ=r(1855),JQ=r.n(KQ);function ZQ(t){"@babel/helpers - typeof";return(ZQ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $Q(t,e){for(var r=0;r=e)if("RANGE"===r)for(i=0;i=0&&this.getSqrtInterval(t,r):"logarithm"===e?this.getMin(t)>0&&this.getGeometricProgression(t,r):void 0}},{key:"getSum",value:function(t){return this.getInstance(t).sum()}},{key:"getMax",value:function(t){return this.getInstance(t).max()}},{key:"getMin",value:function(t){return this.getInstance(t).min()}},{key:"getMean",value:function(t){return this.getInstance(t).mean()}},{key:"getMedian",value:function(t){return this.getInstance(t).median()}},{key:"getTimes",value:function(t){return t.length}},{key:"getEqInterval",value:function(t,e){return this.getInstance(t).getClassEqInterval(e)}},{key:"getJenks",value:function(t,e){return this.getInstance(t).getClassJenks(e)}},{key:"getSqrtInterval",value:function(t,e){return t=t.map(function(t){return Math.sqrt(t)}),this.getInstance(t).getClassEqInterval(e).map(function(t){return t*t})}},{key:"getGeometricProgression",value:function(t,e){return this.getInstance(t).getClassGeometricProgression(e)}}],(e=null)&&iY(t.prototype,e),r&&iY(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function sY(t){if(!t)throw new Error("No GeoJSON coords provided");if(!t||0===t.length)return null;var e=t.length,r=new Float64Array(t.flat()),n=window.Module._malloc(2*e*8);window.Module.HEAPF64.set(r,n/8);var i=window.Module._UGCWasm_Geometry_CreatePoint2DsFromBuffer(n,e);return window.Module._free(n),i}function uY(t){if(!t)throw new Error("No GeoJSON coords provided");if(!t||0===t.length)return null;var e=t.length,r=new Float64Array(t),n=window.Module._malloc(8*e);window.Module.HEAPF64.set(r,n/8);var i=window.Module._UGCWasm_Helper_CreateDoubleArray(n,e);return window.Module._free(n),i}function lY(t){var e=window.Module._UGCWasm_Helper_GetDoubleArrayLength(t),r=window.Module._malloc(8*e);window.Module._UGCWasm_Helper_GetBufferFromDoubleArray(t,r);for(var n=new Float64Array(window.Module.HEAPF64.buffer,r,e),i=[],o=0;o1)for(var o=1;o1)for(var l=1;l2&&void 0!==arguments[2]?arguments[2]:1e-6,n=fY(t),i=fY(e);return 1===this.module._UGCWasm_Geometrist_IsIdentical(n,i,r)}},{key:"hasIntersection",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-6,n=fY(t),i=fY(e);return 1===this.module._UGCWasm_Geometrist_HasIntersection(n,i,r)}},{key:"hasTouch",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-6,n=fY(t),i=fY(e);return 1===this.module._UGCWasm_Geometrist_HasTouch(n,i,r)}},{key:"resample",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e-6,r=fY(t);return{type:"Feature",geometry:cY(this.module._UGCWasm_Geometrist_Resample(r,e))}}},{key:"isParallel",value:function(t,e,r,n,i,o,a,s){return 1===this.module._UGCWasm_Geometrist_IsParallel(t,e,r,n,i,o,a,s)}},{key:"computePerpendicularPosition",value:function(t,e,r,n,i,o){var a=this.module._UGCWasm_Helper_CreateDoubleArray(0,2);return this.module._UGCWasm_Geometrist_ComputePerpendicularPosition(t,e,r,n,i,o,a),a=lY(a)}},{key:"isPointOnLine",value:function(t,e,r,n,i,o){var a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return 1===this.module._UGCWasm_Geometrist_IsPointOnLine(t,e,r,n,i,o,a)}},{key:"isProjectOnLineSegment",value:function(t,e,r,n,i,o){return 1===this.module._UGCWasm_Geometrist_IsProjectOnLineSegment(t,e,r,n,i,o)}},{key:"distanceToLineSegment",value:function(t,e,r,n,i,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Mn.DEGREE,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:Mn.DEGREE,u=this.module._UGCWasm_Geometrist_DistanceToLineSegment(t,e,r,n,i,o);return s!==Mn.DEGREE?u*Cf(a)/Cf(s):u}},{key:"nearestPointToVertex",value:function(t,e,r){if("LineString"!==xY(r))throw new Error("only feature type is LineString supported");var n=this.module._UGCWasm_Helper_CreateDoubleArray(0,2),i=fY(r);return this.module._UGCWasm_Geometrist_NearestPointToVertex(t,e,i,n),n=lY(n)}},{key:"computeConcaveHullPoints",value:function(t,e,r){if(!Array.isArray(e)){var n=hY(t);r=e,t=n.xList,e=n.yList}var i=uY(t),o=uY(e);return{type:"Feature",geometry:cY(this.module._UGCWasm_Geometrist_ComputeConcaveHullPoints(i,o,t.length,r))}}},{key:"isSegmentIntersect",value:function(t,e,r,n,i,o,a,s){return 1===this.module._UGCWasm_Geometrist_IsSegmentIntersect(t,e,r,n,i,o,a,s)}},{key:"isIntersectRegionWithRect",value:function(t,e,r,n,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1e-6,a=fY(t);return 0!==this.module._UGCWasm_Geometrist_isIntersectRegionWithRect(a,e,r,n,i,o)}},{key:"isOnSameSide",value:function(t,e,r,n,i,o,a,s){return 1===this.module._UGCWasm_Geometrist_IsOnSameSide(t,e,r,n,i,o,a,s)}},{key:"isRight",value:function(t,e,r,n,i,o){return 1===this.module._UGCWasm_Geometrist_IsRight(t,e,r,n,i,o)}},{key:"isLeft",value:function(t,e,r,n,i,o){return 1===this.module._UGCWasm_Geometrist_IsLeft(t,e,r,n,i,o)}},{key:"computeGeodesicArea",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ri.SQUAREMETER;if(!function(t){if(t&&t.geometry&&t.geometry.type){var e=t.geometry.type;if("Point"===e)return Ti(t.geometry.coordinates);if("LineString"===e)return Ti(t.geometry.coordinates[0]);if("Polygon"===e||"MultiLineString"===e)return Ti(t.geometry.coordinates[0][0])}}(t))throw new Error("coordinates is invalid latlng");if("Polygon"!==xY(t))throw new Error("only feature type is Polygon supported");var r=fY(t),n=this.module._UGCWasm_Geometry_NewUGPrjCoordSys(4326),i=this.module._UGCWasm_Geometrist_ComputeGeodesicArea(r,n);return e!==ri.SQUAREMETER?i*kf[e]:i}},{key:"smooth",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if("LineString"!==xY(t))throw new Error("only feature type is LineString supported");var r=fY(t);return{type:"Feature",geometry:cY(this.module._UGCWasm_Geometrist_Smooth(r,e))}}},{key:"computeGeodesicDistance",value:function(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Mn.METER;if(!Array.isArray(e)){var o=hY(t),a=o.xList,s=o.yList;i=n||Mn.METER,n=r,r=e,t=a,e=s}if(!Ti([t[0],e[0]]))throw new Error("coordinates is invalid latlng");var u=uY(t),l=uY(e),c=this.module._UGCWasm_Geometrist_ComputeGeodesicDistance(u,l,r,n);return i!==Mn.METER?c/Cf(i):c}},{key:"computeParallel",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mn.DEGREE,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Mn.DEGREE;if("LineString"!==xY(t))throw new Error("only feature type is LineString supported");n!==Mn.DEGREE&&(e=e*Cf(n)/Cf(r));var i=fY(t);return{type:"Feature",geometry:cY(this.module._UGCWasm_Geometrist_ComputeParallel(i,e))}}},{key:"computeConvexHullPoints",value:function(t,e){if(!Array.isArray(e)){var r=hY(t);t=r.xList,e=r.yList}var n=uY(t),i=uY(e);return{type:"Feature",geometry:cY(this.module._UGCWasm_Geometrist_ComputeConvexHullPoints(n,i,t.length))}}}])&&yY(r.prototype,n),i&&yY(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function xY(t){return"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}function wY(t,e,r){r.defs(t)||(e?r.defs(t,e):console.error("".concat(t," not define")))}function _Y(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:MA;if("[object Object]"!==Object.prototype.toString.call(arguments[0]))wY(t,e,r);else{var n=arguments[0];for(var i in n)wY(i,n[i],r)}}function SY(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:MA;if(!e.defs(t)){var r={"EPSG:3857":'PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],AUTHORITY["EPSG","3857"]]',"EPSG:4326":'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],AXIS["Easting", "EAST"],AXIS["Northing", "NORTH"],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]',"EPSG:4490":'GEOGCS["China Geodetic Coordinate System 2000", DATUM["China 2000", SPHEROID["CGCS2000", 6378137.0, 298.257222101, AUTHORITY["EPSG","1024"]], AUTHORITY["EPSG","1043"]], PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree", 0.017453292519943295], AXIS["Geodetic latitude", NORTH], AXIS["Geodetic longitude", EAST], AUTHORITY["EPSG","4490"]]'};r[t]&&_Y(t,r[t])}return e.defs(t)}function EY(t){if("string"!=typeof t)return"";if(0===t.indexOf("EPSG"))return t;var e=t.lastIndexOf("AUTHORITY")+10,r=t.indexOf("]",e)-1;return e>0&&r>0?"EPSG:".concat(t.substring(e,r).split(",")[1].substr(1)):""}function CY(t){var e=t.coordinates,r=t.sourceProjection,n=t.destProjection,i=void 0===n?"EPSG:4326":n,o=t.proj4,a=void 0===o?MA:o;try{return a(r,i,e)}catch(t){throw"".concat(t," is not defined")}}function kY(t,e){var r=t.replace(/^EPSG:/,""),n=Fi(e);return ut.get("".concat(n,"epsgcodes/").concat(r,".json"),null).then(function(t){return t.json()}).then(function(t){return t.wkt}).catch(function(t){console.error(t)})}function IY(t){"@babel/helpers - typeof";return(IY="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function TY(){TY=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new O(n||[]);return i(a,"_invoke",{value:C(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",g={};function v(){}function m(){}function b(){}var A={};l(A,a,function(){return this});var x=Object.getPrototypeOf,w=x&&x(x(M([])));w&&w!==r&&n.call(w,a)&&(A=w);var _=b.prototype=v.prototype=Object.create(A);function S(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function E(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==IY(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function C(e,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function OY(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=FY(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function MY(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function PY(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r0}function rW(t,e){if(t){var r,n=UY(r=t)||GY(r)||FY(r)||BY(),i=n[0],o=n.slice(1).filter(function(t){var e=DY(t,2)[1];return!["$type","$id"].includes(e)}),a=Array.from(new Set(function t(e){var r=[];var n,i=OY(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o instanceof Array&&o[1]&&"string"==typeof o[1])r.push(o[1]);else if(o instanceof Array){var a=t(o);a&&a.length>0&&r.push.apply(r,RY(a))}}}catch(t){i.e(t)}finally{i.f()}return r}(o))),s=e([i].concat(RY(o))),u=s.filter.bind(s);return{field:a,values:function(){for(var t=arguments.length,e=new Array(t),r=0;r=0}function m(t,e){return v(t,e)?PY(PY({},e),{},{withCredentials:!0}):PY(PY({},e),{},{withCredentials:void 0})}function b(t,e){return A.apply(this,arguments)}function A(){return(A=jY(TY().mark(function t(e,r){var n,i,o,a,u,l,c,f,h,d,y,v,b;return TY().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.url,i=e.dataSourceName,o=e.datasetName,a=e.credential,u={datasetNames:[i+":"+o],getFeatureMode:"SQL",targetEpsgCode:"4326",queryParameter:{name:o+"@"+i}},l="".concat(n.split("featureResults")[0],"datasources/").concat(i,"/datasets/").concat(o),c=m(l,r),t.next=6,p(l,a,c);case 6:return f=t.sent,h=f.fieldNames,d=f.fieldTypes,y=s(n,a),t.next=12,ut.post(y,JSON.stringify(u),c);case 12:return v=t.sent,t.next=15,v.json();case 15:return b=t.sent,t.abrupt("return",{type:"FeatureCollection",features:g((b||{}).features||[],h,d)});case 17:case"end":return t.stop()}},t)}))).apply(this,arguments)}function x(t,e){return ut.get(t,null,e).then(function(t){return t.json()}).then(function(t){if(!1===t.succeed)throw t.error.errorMsg;return t})}function w(t,e){return _.apply(this,arguments)}function _(){return(_=jY(TY().mark(function t(e,r){var n,i,o,a,s;return TY().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,x(e,r);case 2:if(n=t.sent,o=(i=n||{}).features,a=i.links,!(s=(void 0===a?[]:a).find(function(t){return"next"===t.rel}))){t.next=13;break}return t.t0=o,t.next=9,w(s.href,r);case 9:return t.t1=t.sent,t.abrupt("return",t.t0.concat.call(t.t0,t.t1));case 13:return t.abrupt("return",o);case 14:case"end":return t.stop()}},t)}))).apply(this,arguments)}function S(t,e){return E.apply(this,arguments)}function E(){return(E=jY(TY().mark(function t(e,r){var n,i;return TY().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="".concat(r.server,"web/datas/").concat(e,"/structureddata/ogc-features/collections/all/items.json?limit=10000&offset=0"),t.next=3,w(n,r);case 3:return i=t.sent,t.abrupt("return",{type:"FeatureCollection",features:i});case 5:case"end":return t.stop()}},t)}))).apply(this,arguments)}function k(t,e,r){if(t===e)return r;if("EPSG:4214"===t&&"EPSG:4326"===e&&180===r[0]){var n=CY({coordinates:r,sourceProjection:t,destProjection:e,proj4:a});return n[0]=180,n}return CY({coordinates:r,sourceProjection:t,destProjection:e,proj4:a})}function I(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"EPSG:4326";if(t&&t.length&&e)return e===r?t:t.map(function(t){var n=function(t,e,r){if("MultiPolygon"===r.type){var n=r.coordinates;return{type:r.type,coordinates:n.map(function(r){return r.map(function(r){return r.map(function(r){return k(t,e,r)})})})}}if("Polygon"===r.type||"MultiLineString"===r.type){var i=r.coordinates;return{type:r.type,coordinates:i.map(function(r){return r.map(function(r){return k(t,e,r)})})}}if("MultiPoint"===r.type||"LineString"===r.type){var o=r.coordinates;return{type:r.type,coordinates:o.map(function(r){return k(t,e,r)})}}if("Point"===r.type)return{type:r.type,coordinates:k(t,e,r.coordinates)}}(e,r,t.geometry),i=PY({},t);return n&&Object.assign(i,{geometry:n}),i})}function T(t,e){return O.apply(this,arguments)}function O(){return(O=jY(TY().mark(function t(e,r){var n,i,o,s,u,l;return TY().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,S(e.dataId,r);case 2:return n=t.sent,t.next=5,ut.get("".concat(r.server,"web/datas/").concat(e.dataId,"/structureddata.json"),null,r);case 5:return i=t.sent,t.next=8,i.json();case 8:if(o=t.sent,"EPSG:4326"===(s="EPSG:".concat(o.epsgCode))){t.next=18;break}if(SY(s,a)){t.next=16;break}return t.next=14,kY(s,r.server);case 14:u=t.sent,_Y(s,u,a);case 16:(l=I(n.features,s))&&(n.features=l);case 18:return t.abrupt("return",n);case 19:case"end":return t.stop()}},t)}))).apply(this,arguments)}function M(t){return{type:"json",x:t.originX,y:t.originY,x1:t.destinationX,y1:t.destinationY}}function P(t){var e=t.clusterField,r=t.clusterMethod,n=t.clusterRadius;return[{type:t.clusterType,field:e,method:r&&{avg:"mean"}[r]||r,size:n}]}function L(t,e,r){return N.apply(this,arguments)}function N(){return(N=jY(TY().mark(function t(e,r,n){var i,o,a,s,u,l;return TY().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.data,o=e.od,a=e.cluster,!i||"FeatureCollection"!==i.type){t.next=3;break}return t.abrupt("return",{data:i});case 3:if(s={"supermap-rest-data":b,"supermap-structured-data":T},u=o&&M(e),l=a&&P(e),t.t0=s[i.type],!t.t0){t.next=11;break}return t.next=10,s[i.type](e.data,n);case 10:t.t0=t.sent;case 11:return t.t1=t.t0,t.t2=u,t.t3=l,t.abrupt("return",{data:t.t1,parser:t.t2,transforms:t.t3});case 15:case"end":return t.stop()}},t)}))).apply(this,arguments)}function j(t,e,r){var n={data:((t||{}).tiles||[])[0],parser:{type:"mvt",extent:t.bounds,sourceLayer:e}};return v(n.data,r)&&Object.assign(n.parser,{requestParameters:{credentials:"include"}}),n}function R(t,e,r){var n=t.type,i={vector:j,geojson:L};return i[n]&&i[n](t,e,r)}function D(t){var r=t.type,n=t.id,i=t.minzoom,o=t.maxzoom,a=t.layout,s=t.paint,u=t.filter,l=t.source;return{id:n,options:{type:r,name:t.id,sourceLayer:t["source-layer"],source:l,layout:a,paint:s,filter:u,minZoom:i,maxZoom:o,visible:"none"!==a.visibility},filter:rW(u,e)}}function B(t){var e=t.value,i=t.property,o=t.multiple,a=t.map;if(!r.isExpression(e))return{values:o?e*o:e};var s={interpolate:function(t){return t.value._styleExpression.expression.input.args[0].args[0].evaluate(t.value._styleExpression._evaluator)},match:function(t){return t.value._styleExpression.expression.input.args[0].evaluate(t.value._styleExpression._evaluator)},case:function(t){var e=t.value._styleExpression.expression.branches[0][0];return e&&e.args?e.args[0].lhs.args[0].args[0].evaluate(t.value._styleExpression._evaluator):e.lhs.args[0].evaluate()}},u=n[{size:"paint_circle",color:"paint_circle",shape:"layout_symbol"}[i]][{size:"circle-radius",color:"circle-color",shape:"icon-image"}[i]],l=r.createPropertyExpression(e,u),c=s[e[0]]&&s[e[0]](l),f=l.value.evaluate.bind(l.value);return{field:c,values:function(t){var e={properties:LY({},c,t),type:"point"},r=f({zoom:a.getZoom()},e);return"shape"===i?r.toString():o?r*o:r}}}function F(t,e){return LY(LY(LY(LY(LY(LY(LY(LY({},"".concat(t,"-dasharray"),"dashArray"),"".concat(t,"-opacity"),"opacity"),"".concat(t,"-pattern-color"),"textureColor"),"".concat(t,"-pattern-opacity"),"opacity"),"".concat(t,"-pattern-interval"),"iconStep"),"".concat(t,"-pattern-blend"),"textureBlend"),"".concat(t,"-segment"),"segmentNumber"),"".concat(t,"-pattern-rotate"),"textureRotate")[e]}function z(t,e){return LY(LY(LY({},"".concat(t,"-animate-duration"),"duration"),"".concat(t,"-animate-interval"),"interval"),"".concat(t,"-animate-trailLength"),"trailLength")[e]}function G(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n1&&!function(t){return 2===t.length&&1===t[0]&&0===t[1]}(t)?"dash":"solid"}function Y(t,e,r){var n=t.paint,i=t.layout,o=n["circle-color"]||"#EE4D5A",a=n["circle-radius"]||30,s=n["circle-opacity"],u=i["circle-animate-speed"],l=i["circle-animate-rings"];return PY(PY({},D(t)),{},{type:VY.point,source:e,color:B({value:o,property:"color",map:r}),size:B({value:a,property:"size",multiple:2,map:r}),shape:{values:"circle"},style:{opacity:s},animate:{enable:!0,speed:u,rings:l}})}function W(t,e,r){var n=t.paint,i=t.layout,o=n["radar-color"]||"#EE4D5A",a=n["radar-radius"]||30,s=n["radar-opacity"],u=i["radar-animate-speed"];return PY(PY({},D(t)),{},{type:VY.point,source:e,color:B({value:o,property:"color",map:r}),size:B({value:a,property:"size",map:r}),shape:{values:"radar"},style:{opacity:s,speed:u},animate:{enable:!0}})}function q(t,e,r){var n=t.paint,i=t.layout,o=i["line-curve-shape"]||i["line-curve-extrusion-shape"],a="arc3d"===o?"line-curve-extrusion":"line-curve",s=n["".concat(a,"-color")]||"#ff6b34",u=n["".concat(a,"-width")]||1,l=n["".concat(a,"-dasharray")],c=n["".concat(a,"-pattern")],f=PY(PY({},D(t)),{},{type:VY.line,source:{data:e.data.features.map(function(t){return t.properties}),parser:e.parser},color:B({value:s,property:"color",map:r}),size:B({value:u,property:"size",map:r}),shape:{values:o},style:{lineType:Q(l)}});for(var h in n){var p=F(a,h);p&&Object.assign(f.style||{},LY({},p,n[h]))}for(var d in i){var y=F(a,d);y&&Object.assign(f.style||{},LY({},y,i[d]));var g=z(a,d);g&&(f.animate||(f.animate={}),Object.assign(f.animate,LY({},g,i[d])))}return c&&(f.texture={values:c},Object.assign(f.style||{},{lineTexture:!0})),f}function X(t,e,r){var n=t.paint,i=t.layout,o=n["point-extrusion-color"]||"#EE4D5A",a=n["point-extrusion-width"]||12,s=n["point-extrusion-length"]||12,u=n["point-extrusion-height"]||12,l=n["point-extrusion-opacity"],c=n["point-extrusion-source-color"],f=n["point-extrusion-target-color"],h=n["point-extrusion-opacity-linear-direction"],p=i["point-extrusion-shape"]||"cylinder";return PY(PY({},D(t)),{},{type:VY.point,source:e,color:B({value:o,property:"color",map:r}),size:G(r,{value:a,multiple:.5},{value:s,multiple:.5},{value:u}),shape:B({value:p,property:"shape",map:r}),style:{opacity:l,sourceColor:c,targetColor:f,opacityLinear:{enable:!!h,dir:h}}})}function K(t,e,r){var n=t.paint,i=t.layout,o=n["line-extrusion-color"]||"#ff6b34",a=n["line-extrusion-width"]||12,s=n["line-extrusion-base"]||0,u=n["line-extrusion-dasharray"],l=n["line-extrusion-pattern"],c=PY(PY({},D(t)),{},{type:VY.line,source:e,color:B({value:o,property:"color",map:r}),size:G(r,{value:a,multiple:tW},{value:s}),shape:{values:"line"},style:{lineType:Q(u)}});for(var f in n){var h=QY[f];h&&Object.assign(c.style||{},LY({},h,n[f]))}for(var p in i){var d=QY[p];d&&Object.assign(c.style||{},LY({},d,i[p]));var y=YY[p];y&&(c.animate||(c.animate={}),Object.assign(c.animate,LY({},y,i[p])))}return l&&(c.texture={values:l},Object.assign(c.style||{},{lineTexture:!0})),c}function J(t,e){var r=t.paint,n=t.layout,i=r["chart-background-color"],o=r["chart-width"],a=r["chart-height"],s={grid:r["chart-xAxis-grid"],label:r["chart-xAxis-label"],line:r["chart-xAxis-line"]},u={grid:r["chart-yAxis-grid"],label:r["chart-yAxis-label"],line:r["chart-yAxis-line"]},l=n["chart-type"],c=n["chart-attribute-color"],f="line"===l&&c.length>0&&{values:c[0][1]};return PY(PY({},D(t)),{},{type:VY.point,id:t.id,source:e,layerType:WY.MarkerLayer,chartType:l,fields:{values:"bar"===l?U(c):function(t){return t.map(function(t){return DY(t,1)[0]})}(c)},width:{values:o},height:{values:a},background:{values:i},xAxis:{values:s},yAxis:{values:u},color:f})}function Z(t,e){var r=t.paint,n=t.layout,i=r["chart-radius"],o=r["chart-inner-radius"],a=n["chart-type"],s=n["chart-attribute-color"];return PY(PY({},D(t)),{},{type:VY.point,id:t.id,source:e,layerType:WY.MarkerLayer,chartType:a,fields:{values:U(s)},radius:{values:i},innerRadius:{values:o}})}function $(t,e,r){var n=t.paint,i=t.layout,o=n["heatmap-color"]||"#EE4D5A",a=n["heatmap-opacity"],s=i["heatmap-shape"],u=i["heatmap-rotate"],l=i["heatmap-coverage"];return PY(PY({},D(t)),{},{type:VY.heatmap,id:t.id,source:e,shape:{values:s},color:B({value:o,property:"color",map:r}),style:{opacity:a,coverage:l,angle:u}})}function tt(t,e,r){var n=t.paint,i=t.layout,o=n["heatmap-extrusion-color"]||"#EE4D5A",a=n["heatmap-extrusion-opacity"],s=n["heatmap-extrusion-height"],u=i["heatmap-extrusion-shape"],l=i["heatmap-extrusion-rotate"],c=i["heatmap-extrusion-coverage"];return PY(PY({},D(t)),{},{type:VY.heatmap,id:t.id,source:e,shape:{values:u},size:B({value:s,property:"size",map:r}),color:B({value:o,property:"color",map:r}),style:{opacity:a,coverage:c,angle:l}})}function et(t,e){var i=t.paint,o=i["heatmap-extrusion-color"],a=i["heatmap-extrusion-opacity"],s=i["heatmap-extrusion-intensity"],u=i["heatmap-extrusion-radius"],l=i["heatmap-extrusion-weight"];return PY(PY({},D(t)),{},{type:VY.heatmap,id:t.id,source:e,size:{field:l,values:[0,1]},shape:{values:"heatmap3D"},style:{rampColors:function(t){var e=n.paint_heatmap["heatmap-color"],i=r.createPropertyExpression(t,e);return{positions:i.value._styleExpression.expression.labels,colors:i.value._styleExpression.expression.outputs.map(function(t){return t.value})}}(o),opacity:a,intensity:s,radius:u}})}function rt(t,e,r,n){var i=t.paint,o=t.layout,a=o["text-field"].split("{")[1].split("}")[0],s={};return Object.keys(function(t,e){var r={};for(var n in t)e.includes(n)||(r[n]=t[n]);return t}(qY,["text-color","text-size","text-field"])).forEach(function(e){var r,n=(t[(r=e,XY.includes(r)?"layout":"paint")]||{})[e];void 0!==n&&(s[qY[e]]=n)}),PY(PY({},D(t)),{},{type:VY.point,id:t.id,source:e,color:B({value:i["text-color"],property:"color",map:n}),size:B({value:o["text-size"],property:"size",map:n}),shape:{field:a,values:"text"},style:s})}function nt(t){return it.apply(this,arguments)}function it(){return(it=jY(TY().mark(function t(e){var r,n,i,o,a,s,u,l,c,f,h,p;return TY().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=e.layers,n=e.sources,i=e.map,o=e.options,a=[],s=OY(r),t.prev=3,s.s();case 5:if((u=s.n()).done){t.next=23;break}return l=u.value,t.prev=7,c=n[l.source],f=LY(LY(LY(LY(LY(LY(LY(LY(LY(LY({},HY.animatePoint,Y),HY.radarPoint,W),HY.od,q),HY.column,X),HY.line,K),HY.bar,J),HY.pie,Z),HY.heatGrid,$),HY.heat3DGrid,tt),HY.heat3D,et),t.next=12,R(c,l["source-layer"],o);case 12:h=t.sent,p=H(l),a.push(f[p]&&f[p](l,h,i)||rt(l,h,(l||{}).visible,i)),t.next=21;break;case 17:t.prev=17,t.t0=t.catch(7),console.error(t.t0),o.emitterEvent("layercreatefailed",{error:t.t0,map:i,layer:l});case 21:t.next=5;break;case 23:t.next=28;break;case 25:t.prev=25,t.t1=t.catch(3),s.e(t.t1);case 28:return t.prev=28,s.f(),t.finish(28);case 31:return t.abrupt("return",a);case 32:case"end":return t.stop()}},t,null,[[3,25,28,31],[7,17]])}))).apply(this,arguments)}function ot(t){return at.apply(this,arguments)}function at(){return(at=jY(TY().mark(function t(e){return TY().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(t){e.getL7Scene().then(function(e){t(e)})}));case 1:case"end":return t.stop()}},t)}))).apply(this,arguments)}function st(t,e){if(e){var r=document.createElement("canvas");r.width=e.width,r.height=e.height;var n=r.getContext("2d");if(n)return n.drawImage(e,0,0),n.getImageData(t.x,t.y,t.width,t.height)}}function lt(t){var e=DY(XQ.getData(XQ.toRGBA(t)),4);return{r:e[0],g:e[1],b:e[2],a:e[3]}}function ct(t,e){return ft.apply(this,arguments)}function ft(){return(ft=jY(TY().mark(function t(e,r){var n,i,o,a,s,u,l,c,f,h,p,d,y;return TY().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ht(e);case 2:if(n=t.sent,i=r.color,o=r.rotate,a=document.createElement("canvas"),s=a.getContext("2d"),a.width=n.width,a.height=n.height,s.translate(a.width/2,a.height/2),0!==o&&s.rotate(o*Math.PI/180),s.drawImage(n,-n.width/2,-n.height/2),i){for(u=s.getImageData(0,0,a.width,a.height),l=u.data,c=lt(i),f=c.r,h=c.g,p=c.b,d=c.a,y=0;y1&&!t.includes("/sprite@2x")?function(t){var e=t.split("/"),r=e.slice(-1)[0];if(!r)return t;var n=r.replace("sprite","sprite@2x");return e.splice(e.length-1,1,n),e.join("/")}(t):t}(r)+".png";return n&&(i+="?token=".concat(n)),i}function vt(t,e){return new Promise(function(r){var n=gt(t),i=new XMLHttpRequest,o=new Image;o.crossOrigin="",i.responseType="blob",i.open("get",n,!0),i.withCredentials=e.withCredentials,i.setRequestHeader("accept","image/webp,*/*"),i.onreadystatechange=function(){4===i.readyState&&200===i.status&&(o.src=URL.createObjectURL(i.response),o.onload=function(){r(o)},o.onerror=function(){r(null)})},i.send(null)})}function mt(t,e,r){return bt.apply(this,arguments)}function bt(){return(bt=jY(TY().mark(function t(e,r,n){var i;return TY().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,vt(e,n);case 2:if(i=t.sent){t.next=5;break}return t.abrupt("return");case 5:return t.abrupt("return",st(r,i));case 6:case"end":return t.stop()}},t)}))).apply(this,arguments)}function At(t){return xt.apply(this,arguments)}function xt(){return(xt=jY(TY().mark(function t(e){var r,n,i,o,a,s,u,l,c,f,h,p,d,y,g,v;return TY().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=e.layers,n=e.sprite,i=e.spriteJson,o=e.scene,a=e.options,s=+new Date,u=0;case 3:if(!(u2&&void 0!==arguments[2]&&arguments[2],n=[],i=e.properties,o=0;return r&&t.forEach(function(t){var e=i?i[t]:0;o+=e}),t.forEach(function(t){var e=i?i[t]:0,a={x:t,y:e};r&&(a.percent=e/o),n.push(a)}),n}function Ct(t,e,r,n){if(!C){throw console.error("G2 is not define"),new Error("G2 is not define")}var i=new fG({container:t,width:e,height:r,autoFit:!0});return i.legend(!1),i.data(n),i}function kt(t,e){return new o.Marker({element:t}).setLnglat(e)}function It(t,e){var r=wt.getMarkerLayer(t);r&&(e.removeMarkerLayer(r),wt.removeMarkerLayer(t))}function Tt(t,e){var r=t.source,n=t.id,i=t.chartType,a=r.data;t.filter&&(a=function(t,e){var r=t.features,n=e.field,i=e.values;return{type:"FeatureCollection",features:r.filter(function(t){var e=n.map(function(e){return(t.properties||{})[e]});return i.apply(void 0,RY(e))})}}(r.data,t.filter)),It(n,e);var s=[];if(i===$Y.bar){var u=t.fields,l=t.width,c=t.height,f=t.background,h=t.xAxis,p=t.yAxis,d={width:l.values,height:c.values,background:f.values,xAxis:h.values,yAxis:p.values};s=function(t,e,r){var n=e.width,i=e.height,o=e.background,a=e.xAxis,s=e.yAxis,u=r.features,l=Object.keys(t),c=Object.values(t),f=_t(a),h=_t(s),p=document.createElement("div");return p.style.backgroundColor=o,u.map(function(t){var e=p.cloneNode(),r=St(t),o=Et(l,t),a=Ct(e,n,i,o);return a.axis("x",f),a.axis("y",h),a.interval().position("x*y").color("x",c),a.render(),kt(e,r)})}(u.values,d,a)}if(i===$Y.line){var y=t.color,g=t.fields,v=t.width,m=t.height,b=t.background,A=t.xAxis,x=t.yAxis,w={width:v.values,height:m.values,background:b.values,xAxis:A.values,yAxis:x.values,color:y.values};s=function(t,e,r){var n=e.color,i=e.width,o=e.height,a=e.background,s=e.xAxis,u=e.yAxis,l=r.features,c=_t(s),f=_t(u),h=document.createElement("div");return h.style.background=a,l.map(function(e){var r=h.cloneNode(),a=St(e),s=Et(t,e),u=Ct(r,i,o,s);return u.axis("x",c),u.axis("y",f),u.line().position("x*y").color(n),u.render(),kt(r,a)})}(g.values,w,a)}if(i===$Y.pie){var _=t.fields,S=t.radius,E=t.innerRadius,C={radius:S.values,innerRadius:E.values};s=function(t,e,r){var n=r.features,i=Object.keys(t),o=Object.values(t),a=e.radius,s=e.innerRadius,u=document.createElement("div");return n.map(function(t){var e=u.cloneNode(),r=St(t),n=Et(i,t,!0),l=Ct(e,a,a,n);return l.coord("theta",{innerRadius:s}),l.interval().adjust("stack").position("percent").color("x",o).shape("sliceShape"),l.render(),kt(e,r)})}(_.values,C,a)}var k=function(t){var e=new o.MarkerLayer;return t.forEach(function(t){e.addMarker(t)}),e}(s);return e.addMarkerLayer(k),wt.setMarkerLayer(n,k),k}function Ot(t,e){var r=LY(LY(LY(LY({},VY.line,"LineLayer"),VY.point,"PointLayer"),VY.polygon,"PolygonLayer"),VY.heatmap,"HeatmapLayer"),n=t.source||{},o=e.promoteId;o||(o=e.tiles&&e.tiles[0].includes("/structureddata/")?"smpid":void 0);var a=new i({type:r[t.type],options:PY(PY({},t.options),{},{layerID:(t.options||{}).name,featureId:o})}),s=a.getL7Layer(),u={},l=t.shape||{};if(n.parser&&(u.parser=t.source.parser),n.transforms&&(u.transforms=t.source.transforms),s.source(n.data,u),l.field?s.shape(l.field,l.values):s.shape(l.values),t.texture&&s.texture(t.texture.values),t.size&&(t.size.field?s.size(t.size.field,t.size.values):s.size(t.size.values)),t.color&&(t.color.field?s.color(t.color.field,t.color.values):s.color(t.color.values)),t.style&&s.style(t.style),t.animate&&s.animate(t.animate),t.filter){var c=JQ()(function(){a.reRender()},500);s.filter(t.filter.field,function(){var e,r=(e=t.filter).values.apply(e,arguments);return r&&c(),r})}return a}return{addL7Layers:function(t){return jY(TY().mark(function e(){var r,n,i,o,a,s,u,l,c,f,h,p,d;return TY().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.map,n=t.webMapInfo,i=t.l7Layers,o=t.spriteDatas,a=t.options,s=n.layers,u=n.sources,l=n.sprite,e.next=4,nt({layers:i,sources:u,map:r,options:Object.assign({withoutFormatSuffix:!0},a)});case 4:return c=e.sent,e.next=7,ot(r);case 7:if(f=e.sent,!(Object.keys(o).length>0)){e.next=18;break}return e.prev=9,e.next=12,At({layers:c.filter(function(t){return!!t.texture}),spriteJson:o,sprite:l,scene:f,options:a});case 12:e.next=18;break;case 14:e.prev=14,e.t0=e.catch(9),console.error(e.t0),a.emitterEvent("layercreatefailed",{error:e.t0,map:r});case 18:h=OY(c),e.prev=19,d=TY().mark(function t(){var e,n,i,o,a;return TY().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=p.value,n=s.findIndex(function(t){return t.id===e.id}),i=s.slice(n+1).find(function(t){return!eW(t)}),e.layerType===WY.MarkerLayer?(o=e,!1!==(e.options||{}).visible&&Tt(o,f),wt.setSceneChartLayer(e.id,o)):(a=Ot(e,u[s[n].source]),r.getLayer(a.id)||r.addLayer(a,i&&i.id));case 4:case"end":return t.stop()}},t)}),h.s();case 22:if((p=h.n()).done){e.next=26;break}return e.delegateYield(d(),"t1",24);case 24:e.next=22;break;case 26:e.next=31;break;case 28:e.prev=28,e.t2=e.catch(19),h.e(e.t2);case 31:return e.prev=31,h.f(),e.finish(31);case 34:case"end":return e.stop()}},e,null,[[9,14],[19,28,31,34]])}))()},isL7Layer:eW,getL7MarkerLayers:function(){return wt.markerLayers},removeL7MarkerLayer:It}}function iW(t){return function(t){if(Array.isArray(t))return xW(t)}(t)||oW(t)||AW(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oW(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function aW(t,e){return uW(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||AW(t,e)||sW()}function sW(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function uW(t){if(Array.isArray(t))return t}function lW(t,e){for(var r=0;r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function AW(t,e){if(t){if("string"==typeof t)return xW(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xW(t,e):void 0}}function xW(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r`.",required:!0},import:{id:{type:"string",doc:"Unique import name.",required:!0},url:{type:"string",doc:"The URL of the style.",required:!0},config:{type:"config",doc:"Configuration values for the imported style's options."},data:{type:"$root",doc:"The inlined style that must correspond to the contents of the specified URL."}},config:{"*":{type:"*",doc:"Value of the imported style's configuration option."}},schema:{"*":{type:"option",doc:"Specification of a configuration option."}},option:{default:{type:"*",doc:"Default configuration value for this option.",required:!0},type:{type:"enum",doc:"The type this value is coerced to after evaluating the expression. If unspecified, the result is returned as is and is not validated.",values:{string:{doc:"The result will be coerced to a string."},number:{doc:"The result will be coerced to a number."},boolean:{doc:"The result will be coerced to a boolean."},color:{doc:"The result will be coerced to a color."}}},array:{type:"boolean",doc:"If true, this option is returned as an array"},minValue:{type:"number",doc:"If this option is a number, this specifies the minimum allowed value. Values lower than this will be clamped to the minimum value."},maxValue:{type:"number",doc:"If this option is a number, this specifies the maximum allowed value. Values higher than this will be clamped to the maximum value."},stepValue:{type:"number",doc:"If this option is a number, this specifies the increment between allowed values. Values will be rounded towards the nearest allowed value."},values:{type:"array",value:"*",doc:"If this option is specified, the result must be one of the given values. Otherwise, the default value is used instead."},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."}},models:{"*":{type:"model",doc:"A URL to a model resource. Supported protocols are `http:`, `https:`, and `mapbox://`."}},"light-3d":{id:{type:"string",doc:"Unique light name.",required:!0},properties:{type:"properties",doc:"Properties of the light."},type:{type:"enum",doc:"Type of the light to be added",values:{ambient:{doc:"An indirect light affecting all objects in the map adding a constant amount of light on them. It has no explicit direction and cannot cast shadows.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},directional:{doc:"A light that has a direction and is located at infinite distance, so its rays are parallel. It simulates the sun light and can cast shadows.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},flat:{doc:"A global directional light source which is only applied on 3D and hillshade layers. Using this type disables other light sources.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}}}},properties:["properties_light_directional","properties_light_ambient","properties_light_flat"],properties_light_directional:{direction:{type:"array",default:[210,30],minimum:[0,0],maximum:[360,90],length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Direction of the light source specified as [a azimuthal angle, p polar angle] where a indicates the azimuthal angle of the light relative to north (in degrees and proceeding clockwise), and p indicates polar angle of the light (from 0°, directly above, to 180°, directly below).",example:[90,40],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color of the directional light.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"A multiplier for the color of the directional light.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"cast-shadows":{type:"boolean",default:!1,doc:"Enable/Disable shadow casting for this light",transition:!1,expression:{interpolated:!1},"property-type":"data-constant","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"shadow-intensity":{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},doc:"Determines the shadow strength, affecting the shadow receiver surfaces final color. Values near 0.0 reduce the shadow contribution to the final color. Values near to 1.0 make occluded surfaces receive almost no directional light. Designed to be used mostly for transitioning between values 0 and 1.",transition:!0,"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}},properties_light_ambient:{color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color of the ambient light.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"A multiplier for the color of the ambient light.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}},properties_light_flat:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`. If specified as a string for a vector tile source, the same property is used across all its source layers. If specified as an object only specified source layers will have id overriden, others will fallback to original feature id"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_array:{type:{required:!0,type:"enum",values:{"raster-array":{doc:"A raster array source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},rasterLayers:{type:"*",doc:"Contains the description of the raster data layers and the bands contained within the tiles."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!1,type:"string",doc:"URL that points to an image. If the URL is not specified, the image is expected to be loaded directly during runtime."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs. Note: When using globe projection, the image will be centered at the North or South Pole in the respective hemisphere if the average latitude value exceeds 85 degrees or falls below -85 degrees.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_model:{type:{required:!0,type:"enum",values:{model:{doc:"A collection of 3D models"},"batched-model":{doc:"A collection of 3D models with anchor data"}},doc:"Type of model source to be added. From single models to represent 2D layers to 3D tiled models covering a wide area."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create batched model tiles. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which batched-model tiles are available"},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},"raster-particle":{doc:"Particle animation driven by textures such as wind maps.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}}},model:{doc:"A 3D model","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},slot:{doc:"Marks the position of a slot.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background` and `slot`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector and raster-array sources; prohibited for all other source types, including GeoJSON sources."},slot:{type:"string",doc:"The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:'An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `["feature-state", ...]` expression is not supported in filter expressions. The `["pitch"]` and `["distance-from-center"]` expressions are supported only for filter expressions on the symbol layer.'},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_model:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"},"model-id":{type:"string",default:"",doc:"Model to render.","property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!1,requires:[{source:["geojson","vector"]}]}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"},"fill-extrusion-edge-radius":{type:"number",private:!0,default:0,minimum:0,maximum:1,doc:"Radius of a fill extrusion edge in meters. If not zero, rounds extrusion edges for a smoother appearance.","sdk-support":{"basic functionality":{js:"3.0.0",android:"10.7.0",ios:"10.7.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-z-elevate":{type:"boolean",default:!1,doc:"Position symbol on buildings (both fill extrusions and models) rooftops. In order to have minimal impact on performance, this is supported only when `fill-extrusion-height` is not zoom-dependent and remains unchanged. For fading in buildings when zooming in, fill-extrusion-vertical-scale should be used and symbols would raise with building rooftops. Symbols are sorted by elevation, except in cases when `viewport-y` sorting or `symbol-sort-key` are applied.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},requires:[{"symbol-placement":["point"]},{"symbol-z-order":["auto"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"2.3.0",android:"10.0.0",ios:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},"layout_raster-particle":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_symbol:{type:"boolean",doc:'Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",doc:'Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",doc:'Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",doc:'Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",doc:'Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",doc:'Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},config:{doc:"Retrieves the configuration value for the given option.",group:"Lookup","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0",android:"10.0.0",ios:"10.0.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0",android:"10.0.0",ios:"10.0.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},match:{doc:'Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `["get", "building_type"]`). Each label must be unique, and must be either:\n - a single literal value; or\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `["c", "b"]`).\n\nThe input matches if any of the values in the array matches using strict equality, similar to the `"in"` operator.\nIf the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first valid value is obtained. Invalid values are `null` and [`'image'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0"}}},image:{doc:"Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`'format'`](#types-format) expression. A [`'coalesce'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `'image'` argument. To implement crossfading between two images within a symbol layer using the [`icon-image-cross-fade`](/mapbox-gl-js/style-spec/layers/#paint-symbol-icon-image-cross-fade) attribute, include a second image as the second argument in the `'image'` expression.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `unit` argument specifies a [simple ECMAScript unit](https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier) to use for unit-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0",android:"8.4.0",ios:"5.4.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a [`boolean`](#types-boolean), the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a [`color`](#color), it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. If the input is an [`\'image\'`](#types-image) expression, `\'to-string\'` returns the image name. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},hsl:{doc:"Creates a color value from hue (range 0-360), saturation and lightness components (range 0-100), and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"2.12.1",android:"10.11.0",ios:"10.11.0"}}},hsla:{doc:"Creates a color value from hue (range 0-360), saturation and lightness components (range 0-100), and an alpha component (range 0-1). If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"2.12.1",android:"10.11.0",ios:"10.11.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns `null` if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},length:{doc:"Returns the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},properties:{doc:'Returns the feature properties object. Note that in some cases, it may be more efficient to use `["get", "property_name"]` directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns `null` if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0",android:"10.0.0",ios:"10.0.0"}}},"geometry-type":{doc:"Returns the feature's geometry type: `Point`, `LineString` or `Polygon`. `Multi*` feature types return the singular forms.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},id:{doc:"Returns the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},zoom:{doc:'Returns the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Camera","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},pitch:{doc:'Returns the current pitch in degrees. `["pitch"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0",android:"10.9.0",ios:"10.9.0"}}},"distance-from-center":{doc:'Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `["distance-from-center"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0",android:"10.9.0",ios:"10.9.0"}}},"measure-light":{doc:"Returns a requested property of the light configuration based on the supplied options. Currently the only supported option is `brightness` which returns the global brightness value of the lights on a scale of 0 to 1, where 0 means total darkness and 1 means full brightness. This expression works only with 3D light, i.e. when `lights` root property is defined.",group:"Lookup","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"heatmap-density":{doc:"Returns the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"line-progress":{doc:"Returns the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0"}}},"sky-radial-progress":{doc:"Returns the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},accumulated:{doc:"Returns the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0",android:"8.4.0",ios:"5.5.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{js:"3.0.0",android:"9.2.0",ios:"5.9.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0",ios:"4.1.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},"raster-value":{doc:"Returns the raster value of a pixel computed via `raster-color-mix`. Can only be used in the `raster-color` property.",group:"Raster Colorization","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"raster-particle-speed":{doc:"Returns the length of the particle velocity vector. Can only be used in the `raster-particle-color` property.",group:"Raster Particle Animation","sdk-support":{"basic functionality":{js:"3.3.0",android:"",ios:""}}},random:{doc:"Returns a random value in the specified range (first two input numbers) based on a supplied seed (third input). The seed can be an expression or a constant number or string value.",group:"Math","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},doc:"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",example:[.5,10],"sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"The color of the atmosphere region immediately below the horizon and within the `range` and above the horizon and within `horizon-blend`. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},"high-color":{type:"color","property-type":"data-constant",default:"#245cdf",expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"The color of the atmosphere region above the horizon, `high-color` extends further above the horizon than the `color` property and its spread can be controlled with `horizon-blend`. The opacity can be set to `0` to remove the high atmosphere color contribution.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"space-color":{type:"color","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"The color of the region above the horizon and after the end of the `horizon-blend` contribution. The opacity can be set to `0` to have a transparent background.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,.2,7,.1],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the atmosphere to the color of space. A value of zero leaves a sharp transition from atmosphere to space. Increasing the value blends the color of atmosphere into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},"star-intensity":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],5,.35,6,0],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"A value controlling the star intensity where `0` will show no stars and `1` will show stars at their maximum intensity.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"vertical-range":{type:"array",default:[0,0],minimum:0,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},doc:"An array of two number values, specifying the vertical range, measured in meters, over which the fog should gradually fade out. When both parameters are set to zero, the fog will be rendered without any vertical constraints.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}},camera:{"camera-projection":{doc:"Camera projection describes how 3D world geometry get projected into 2D screen",type:"enum",values:{perspective:{doc:"linear projection where distant objects appear smaller than closer objects. Lines that are parallel seem to converge towards a vanishing point"},orthographic:{doc:"Projection where objects are of the same scale regardless of whether they are far away or near to the camera. Parallel lines remains parallel and there is no vanishing point."}},transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},default:"perspective","property-type":"data-constant"}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}}},projection:{name:{type:"enum",values:{albers:{doc:"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},equalEarth:{doc:"An Equal Earth projection."},equirectangular:{doc:"An Equirectangular projection. This projection is very similar to the Plate Carrée projection."},lambertConformalConic:{doc:"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},mercator:{doc:"The Mercator projection is the default projection."},naturalEarth:{doc:"A Natural Earth projection."},winkelTripel:{doc:"A Winkel Tripel projection."},globe:{doc:"A globe projection."}},default:"mercator",doc:"The name of the projection to be used for rendering the map.",required:!0,"sdk-support":{"basic functionality":{js:"2.6.0",ios:"10.5.0",android:"10.5.0"}}},center:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-180,-90],maximum:[180,90],transition:!1,doc:"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].",example:[-96,37.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-90,-90],maximum:[90,90],transition:!1,doc:"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).",example:[29.5,45.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}}},terrain:{source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.",requires:["source"],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky","paint_model"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",android:"7.0.0",ios:"4.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant",type:"number",private:!0,default:0,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Controls the intensity of shading near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.","sdk-support":{"basic functionality":{js:"3.0.0",android:"10.7.0",ios:"10.7.0"}}},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant",type:"number",private:!0,default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings. This property works only with legacy light. When 3D lights are enabled `fill-extrusion-ambient-occlusion-wall-radius` and `fill-extrusion-ambient-occlusion-ground-radius` are used instead.",requires:["fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"10.7.0",ios:"10.7.0"}}},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant",type:"number",default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings.",requires:["lights","fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant",type:"number",default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The extent of the ambient occlusion effect on the ground beneath the extruded buildings in meters.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant",type:"number",default:.69,minimum:0,maximum:1,doc:"Provides a control to futher fine-tune the look of the ambient occlusion on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-color":{"property-type":"data-constant",type:"color",default:"#ffffff",doc:"The color of the flood light effect on the walls of the extruded buildings.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["zoom","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant",type:"number",default:0,minimum:0,maximum:1,doc:"The intensity of the flood light color.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["zoom","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven",type:"number",units:"meters",default:0,minimum:0,doc:"The extent of the flood light effect on the walls of the extruded buildings in meters.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["feature","feature-state"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven",type:"number",units:"meters",default:0,doc:"The extent of the flood light effect on the ground beneath the extruded buildings in meters.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["feature","feature-state"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant",type:"number",default:.69,minimum:0,maximum:1,doc:"Provides a control to futher fine-tune the look of the flood light on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-vertical-scale":{"property-type":"data-constant",type:"number",default:1,minimum:0,doc:"A global multiplier that can be used to scale base, height, AO, and flood light of the fill extrusions.",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-rounded-roof":{"property-type":"data-constant",type:"boolean",default:!0,doc:"Indicates whether top edges should be rounded when fill-extrusion-edge-radius has a value greater than 0. If false, rounded edges are only applied to the sides. Default is true.",requires:["fill-extrusion-edge-radius"],transition:!1,"sdk-support":{"basic functionality":{js:"3.0.0",android:"10.10.0",ios:"10.10.0"}},expression:{interpolated:!1,parameters:["zoom"]}},"fill-extrusion-cutoff-fade-range":{type:"number",default:0,minimum:0,maximum:1,doc:"This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. Fade out is implemented by scaling down and removing buildings in the fade range in a staggered fashion. Opacity is not changed. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map's height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.",transition:!1,expression:{interpolated:!1},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!1,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{type:"color",doc:'A gradient used to color a line feature at various distances along its length. Defined using a `step` or `interpolate` expression which outputs a color for each corresponding `line-progress` input value. `line-progress` is a percentage of the line feature\'s total length as measured on the webmercator projected coordinate plane (a `number` between `0` and `1`). Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',example:["interpolate",["linear"],["line-progress"],0,"blue",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{type:"array",value:"number",doc:"The line part between [trim-start, trim-end] will be marked as transparent to make a route vanishing effect. The line trim-off offset is based on the whole line range [0.0, 1.0].",length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:[{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"2.9.0",android:"10.5.0",ios:"10.5.0"}},"property-type":"constant"},"line-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{type:"number",private:!0,doc:"The width of the line border. A value of zero means no border.",default:0,minimum:0,transition:!0,"sdk-support":{"basic functionality":{js:"3.0.0",android:"10.9.0",ios:"10.9.0"},"data-driven styling":{js:"3.0.0",android:"10.9.0",ios:"10.9.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{type:"color",private:!0,doc:"The color of the line border. If line-border-width is greater than zero and the alpha value of this color is 0 (default), the color for the border will be selected automatically based on the line color.",default:"rgba(0, 0, 0, 0)",transition:!0,"sdk-support":{"basic functionality":{js:"3.0.0",android:"10.9.0",ios:"10.9.0"},"data-driven styling":{js:"3.0.0",android:"10.9.0",ios:"10.9.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{type:"number",default:1,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-driven"},"text-emissive-strength":{type:"number",default:1,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{type:"number","property-type":"data-driven",default:0,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},requires:["icon-image"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},doc:"Controls the transition progress between the image variants of icon-image. Zero means the first variant is used, one is the second, and in between they are blended together.",transition:!0},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{type:"number",default:1,minimum:0,maximum:1,transition:!0,units:"intensity",doc:"Controls saturation level of the symbol icon. With the default value of 1 the icon color is preserved while with a value of 0 it is fully desaturated and looks black and white.","sdk-support":{"basic functionality":{js:"3.1.0",android:"11.1.0",ios:"11.1.0"}},expression:{interpolated:!1},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-color":{type:"color",doc:'Defines a color map by which to colorize a raster layer, parameterized by the `["raster-value"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `raster-color-range`.',transition:!1,"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{type:"array",default:[.2126,.7152,.0722,0],length:4,value:"number","property-type":"data-constant",transition:!0,requires:["raster-color"],expression:{interpolated:!0,parameters:["zoom"]},doc:"When `raster-color` is active, specifies the combination of source RGB channels used to compute the raster value. Computed using the equation `mix.r * src.r + mix.g * src.g + mix.b * src.b + mix.a`. The first three components specify the mix of source red, green, and blue channels, respectively. The fourth component serves as a constant offset and is *not* multipled by source alpha. Source alpha is instead carried through and applied as opacity to the colorized result. Default value corresponds to RGB luminosity.",example:[.2126,.7152,.0722,0],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"raster-color-range":{type:"array",length:2,value:"number","property-type":"data-constant",transition:!0,requires:["raster-color"],expression:{interpolated:!0,parameters:["zoom"]},doc:"When `raster-color` is active, specifies the range over which `raster-color` is tabulated. Units correspond to the computed raster value via `raster-color-mix`. For `rasterarray` sources, if `raster-color-range` is unspecified, the source's stated data range is used.",example:[.5,10],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{type:"string",required:!1,"property-type":"data-constant",transition:!1,requires:[{source:"raster-array"}],doc:"Displayed band of raster array source layer. Defaults to the first band if not set.",example:"band-name","sdk-support":{"basic functionality":{js:"3.1.0",android:"11.1.0",ios:"11.1.0"}}},"raster-elevation":{type:"number",doc:"Specifies an uniform elevation from the ground, in meters.",default:0,minimum:0,transition:!0,"sdk-support":{"basic functionality":{js:"3.1.0",android:"11.2.0",ios:"11.2.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},"paint_raster-particle":{"raster-particle-array-band":{type:"string",required:!1,"property-type":"data-constant",transition:!1,doc:"Displayed band of raster array source layer",example:"band-name","sdk-support":{"basic functionality":{js:"",android:"",ios:""}}},"raster-particle-count":{type:"number",doc:"Defines the amount of particles per tile.",default:512,minimum:1,transition:!1,"sdk-support":{"basic functionality":{js:"",android:"",ios:""}},"property-type":"data-constant"},"raster-particle-color":{type:"color",doc:'Defines a color map by which to colorize a raster particle layer, parameterized by the `["raster-particle-speed"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `raster-particle-max-speed`.',transition:!1,"sdk-support":{"basic functionality":{js:"",android:"",ios:""},"data-driven styling":{}},expression:{interpolated:!0,parameters:["raster-particle-speed"]},"property-type":"color-ramp"},"raster-particle-max-speed":{type:"number",doc:"Defines the maximum speed for particles. Velocities with magnitudes equal to or exceeding this value are clamped to the max value.",default:1,minimum:1,transition:!1,"sdk-support":{"basic functionality":{js:"",android:"",ios:""}},"property-type":"data-constant"},"raster-particle-speed-factor":{type:"number",doc:"Defines a coefficient for the speed of particles’ motion.",default:.2,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"",android:"",ios:""}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-particle-fade-opacity-factor":{type:"number",doc:"Defines defines the opacity coefficient applied to the faded particles in each frame. In practice, this property controls the length of the particle tail.",default:.98,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"",android:"",ios:""}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-particle-reset-rate-factor":{type:"number",doc:"Defines a coefficient for a time period at which particles will restart at a random position, to avoid degeneration (empty areas without particles).",default:.8,minimum:0,maximum:1,transition:!1,"sdk-support":{"basic functionality":{js:"",android:"",ios:""}},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map` and no 3d lights enabled. If `hillshade-illumination-anchor` is set to `map` and 3d lights enabled, the direction from 3d lights is used instead.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_model:{"model-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the model layer.",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"},"model-rotation":{type:"array",value:"number",length:3,default:[0,0,0],period:360,units:"degrees","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0,doc:"The rotation of the model in euler angles [lon, lat, z]."},"model-scale":{type:"array",value:"number",length:3,default:[1,1,1],doc:"The scale of the model. Expressions that are zoom-dependent are not supported if using GeoJSON or vector tile as the model layer source.","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-translation":{type:"array",value:"number",length:3,default:[0,0,0],"property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0,doc:"The translation of the model in meters in form of [longitudal, latitudal, altitude] offsets."},"model-color":{type:"color",default:"#ffffff",doc:"The tint color of the model layer. model-color-mix-intensity (defaults to 0) defines tint(mix) intensity - this means that, this color is not used unless model-color-mix-intensity gets value greater than 0. Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source.","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","measure-light","zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-color-mix-intensity":{type:"number","property-type":"data-driven",default:0,minimum:0,maximum:1,doc:"Intensity of model-color (on a scale from 0 to 1) in color mix with original 3D model's colors. Higher number will present a higher model-color contribution in mix. Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source.",expression:{interpolated:!0,parameters:["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-type":{type:"enum",values:{"common-3d":{doc:"Integrated to 3D scene, using depth testing, along with terrain, fill-extrusions and custom layer."},"location-indicator":{doc:"Displayed over other 3D content, occluded by terrain."}},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},default:"common-3d",doc:"Defines rendering behavior of model in respect to other 3D scene objects.","property-type":"data-constant"},"model-cast-shadows":{type:"boolean",default:!0,doc:"Enable/Disable shadow casting for this layer",transition:!1,expression:{interpolated:!1},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"},"model-receive-shadows":{type:"boolean",default:!0,doc:"Enable/Disable shadow receiving for this layer",transition:!1,expression:{interpolated:!1},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"},"model-ambient-occlusion-intensity":{type:"number",default:1,minimum:0,maximum:1,doc:"Intensity of the ambient occlusion if present in the 3D model.",expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant",transition:!0},"model-emissive-strength":{type:"number","property-type":"data-driven",default:0,minimum:0,maximum:5,units:"intensity",doc:"Strength of the emission. There is no emission for value 0. For value 1.0, only emissive component (no shading) is displayed and values above 1.0 produce light contribution to surrounding area, for some of the parts (e.g. doors). Expressions that depend on measure-light are only supported as a global layer value (and not for each feature) when using GeoJSON or vector tile as the model layer source.",expression:{interpolated:!0,parameters:["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-roughness":{type:"number",default:1,minimum:0,maximum:1,doc:"Material roughness. Material is fully smooth for value 0, and fully rough for value 1. Affects only layers using batched-model source.","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-height-based-emissive-strength-multiplier":{type:"array",default:[1,1,1,1,0],length:5,value:"number",doc:"Emissive strength multiplier along model height (gradient begin, gradient end, value at begin, value at end, gradient curve power (logarithmic scale, curve power = pow(10, val)).","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-cutoff-fade-range":{type:"number",default:0,minimum:0,maximum:1,doc:"This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. The automatic cutoff range is calculated according to the minimum required zoom level of the source and layer. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map's height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.",transition:!1,expression:{interpolated:!1},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}};function SW(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:[];hW(this,t),this.parent=e,this.bindings={};var n,i=bW(r);try{for(i.s();!(n=i.n()).done;){var o=aW(n.value,2),a=o[0],s=o[1];this.bindings[a]=s}}catch(t){i.e(t)}finally{i.f()}}return cW(t,[{key:"concat",value:function(e){return new t(this,e)}},{key:"get",value:function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error("".concat(t," not found in scope."))}},{key:"has",value:function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}])}(),kW={kind:"null"},IW={kind:"number"},TW={kind:"string"},OW={kind:"boolean"},MW={kind:"color"},PW={kind:"object"},LW={kind:"value"},NW={kind:"collator"},jW={kind:"formatted"},RW={kind:"resolvedImage"};function DW(t,e){return{kind:"array",itemType:t,N:e}}function BW(t){if("array"===t.kind){var e=BW(t.itemType);return"number"==typeof t.N?"array<".concat(e,", ").concat(t.N,">"):"value"===t.itemType.kind?"array":"array<".concat(e,">")}return t.kind}var FW=[kW,IW,TW,OW,MW,jW,PW,DW(LW),RW];function zW(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!zW(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=FW;r255?255:t}function WW(t){return t<0?0:t>1?1:t}function qW(t){return"%"===t[t.length-1]?YW(parseFloat(t)/100*255):YW(parseInt(t))}function XW(t){return"%"===t[t.length-1]?WW(parseFloat(t)/100):WW(parseFloat(t))}function KW(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{VW={}.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in QW)return QW[r].slice();if("#"===r[0])return 4===r.length?(e=parseInt(r.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===r.length&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var n=r.indexOf("("),i=r.indexOf(")");if(-1!==n&&i+1===r.length){var o=r.substr(0,n),a=r.substr(n+1,i-(n+1)).split(","),s=1;switch(o){case"rgba":if(4!==a.length)return null;s=XW(a.pop());case"rgb":return 3!==a.length?null:[qW(a[0]),qW(a[1]),qW(a[2]),s];case"hsla":if(4!==a.length)return null;s=XW(a.pop());case"hsl":if(3!==a.length)return null;var u=(parseFloat(a[0])%360+360)%360/360,l=XW(a[1]),c=XW(a[2]),f=c<=.5?c*(l+1):c+l-c*l,h=2*c-f;return[YW(255*KW(h,f,u+1/3)),YW(255*KW(h,f,u)),YW(255*KW(h,f,u-1/3)),s];default:return null}}return null}}catch(vEt){}var JW=function(){function t(e,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;hW(this,t),this.r=e,this.g=r,this.b=n,this.a=i}return cW(t,[{key:"toString",value:function(){var t=aW(this.toArray(),4),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba(".concat(Math.round(e),",").concat(Math.round(r),",").concat(Math.round(n),",").concat(i,")")}},{key:"toArray",value:function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*r/n,n]}},{key:"toArray01",value:function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[t/n,e/n,r/n,n]}},{key:"toArray01Scaled",value:function(t){var e=this.r,r=this.g,n=this.b,i=this.a;return 0===i?[0,0,0]:[e/i*t,r/i*t,n/i*t]}},{key:"toArray01PremultipliedAlpha",value:function(){return[this.r,this.g,this.b,this.a]}},{key:"toArray01Linear",value:function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[Math.pow(t/n,2.2),Math.pow(e/n,2.2),Math.pow(r/n,2.2),n]}}],[{key:"parse",value:function(e){if(e){if(e instanceof t)return e;if("string"==typeof e){var r=VW(e);if(r)return new t(r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3])}}}}])}();JW.black=new JW(0,0,0,1),JW.white=new JW(1,1,1,1),JW.transparent=new JW(0,0,0,0),JW.red=new JW(1,0,0,1),JW.blue=new JW(0,0,1,1);var ZW=JW,$W=function(){return cW(function t(e,r,n){hW(this,t),this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})},[{key:"compare",value:function(t,e){return this.collator.compare(t,e)}},{key:"resolvedLocale",value:function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}])}(),tq=cW(function t(e,r,n,i,o){hW(this,t),this.text=e.normalize?e.normalize():e,this.image=r,this.scale=n,this.fontStack=i,this.textColor=o}),eq=function(){function t(e){hW(this,t),this.sections=e}return cW(t,[{key:"isEmpty",value:function(){return 0===this.sections.length||!this.sections.some(function(t){return 0!==t.text.length||t.image&&0!==t.image.namePrimary.length})}},{key:"toString",value:function(){return 0===this.sections.length?"":this.sections.map(function(t){return t.text}).join("")}},{key:"serialize",value:function(){var t,e=["format"],r=bW(this.sections);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.image)e.push(["image",n.image.namePrimary]);else{e.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),e.push(i)}}}catch(t){r.e(t)}finally{r.f()}return e}}],[{key:"fromString",value:function(e){return new t([new tq(e,null,null,null,null)])}},{key:"factory",value:function(e){return e instanceof t?e:t.fromString(e)}}])}(),rq=function(){function t(e){hW(this,t),this.namePrimary=e.namePrimary,e.nameSecondary&&(this.nameSecondary=e.nameSecondary),this.available=e.available}return cW(t,[{key:"toString",value:function(){return this.nameSecondary?"[".concat(this.namePrimary,",").concat(this.nameSecondary,"]"):this.namePrimary}},{key:"serialize",value:function(){return this.nameSecondary?["image",this.namePrimary,this.nameSecondary]:["image",this.namePrimary]}}],[{key:"fromString",value:function(e,r){return e?new t({namePrimary:e,nameSecondary:r,available:!1}):null}}])}();function nq(t,e,r,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value [".concat([t,e,r,n].join(", "),"]: 'a' must be between 0 and 1."):"Invalid rgba value [".concat(("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", "),"]: 'r', 'g', and 'b' must be between 0 and 255.")}function iq(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof ZW)return!0;if(t instanceof $W)return!0;if(t instanceof eq)return!0;if(t instanceof rq)return!0;if(Array.isArray(t)){var e,r=bW(t);try{for(r.s();!(e=r.n()).done;){if(!iq(e.value))return!1}}catch(t){r.e(t)}finally{r.f()}return!0}if("object"===wW(t)){for(var n in t)if(!iq(t[n]))return!1;return!0}return!1}function oq(t){if(null===t)return kW;if("string"==typeof t)return TW;if("boolean"==typeof t)return OW;if("number"==typeof t)return IW;if(t instanceof ZW)return MW;if(t instanceof $W)return NW;if(t instanceof eq)return jW;if(t instanceof rq)return RW;if(Array.isArray(t)){var e,r,n=t.length,i=bW(t);try{for(i.s();!(r=i.n()).done;){var o=oq(r.value);if(e){if(e===o)continue;e=LW;break}e=o}}catch(t){i.e(t)}finally{i.f()}return DW(e||LW,n)}return PW}function aq(t){var e=wW(t);return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof ZW||t instanceof eq||t instanceof rq?t.toString():JSON.stringify(t)}var sq=function(){function t(e,r){hW(this,t),this.type=e,this.value=r}return cW(t,[{key:"evaluate",value:function(){return this.value}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof ZW?["rgba"].concat(this.value.toArray()):this.value instanceof eq?this.value.serialize():this.value}}],[{key:"parse",value:function(e,r){if(2!==e.length)return r.error("'literal' expression requires exactly one argument, but found ".concat(e.length-1," instead."));if(!iq(e[1]))return r.error("invalid value");var n=e[1],i=oq(n),o=r.expectedType;return"array"!==i.kind||0!==i.N||!o||"array"!==o.kind||"number"==typeof o.N&&0!==o.N||(i=o),new t(i,n)}}])}(),uq=function(){return cW(function t(e){hW(this,t),this.name="ExpressionEvaluationError",this.message=e},[{key:"toJSON",value:function(){return this.message}}])}(),lq={string:TW,number:IW,boolean:OW,object:PW},cq=function(){function t(e,r){hW(this,t),this.type=e,this.args=r}return cW(t,[{key:"evaluate",value:function(t){for(var e=0;e1)&&e.push(n)}}return e.concat(this.args.map(function(t){return t.serialize()}))}}],[{key:"parse",value:function(e,r){if(e.length<2)return r.error("Expected at least one argument.");var n,i=1,o=e[0];if("array"===o){var a,s;if(e.length>2){var u=e[1];if("string"!=typeof u||!(u in lq)||"object"===u)return r.error('The item type argument of "array" must be one of string, number, boolean',1);a=lq[u],i++}else a=LW;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);s=e[2],i++}n=DW(a,s)}else n=lq[o];for(var l=[];i-1,e.nameSecondary&&e.available&&t.availableImages&&(e.available=t.availableImages.indexOf(e.nameSecondary)>-1)),e}},{key:"eachChild",value:function(t){t(this.inputPrimary),this.inputSecondary&&t(this.inputSecondary)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return this.inputSecondary?["image",this.inputPrimary.serialize(),this.inputSecondary.serialize()]:["image",this.inputPrimary.serialize()]}}],[{key:"parse",value:function(e,r){if(e.length<2)return r.error("Expected two or more arguments.");var n=r.parse(e[1],1,TW);if(!n)return r.error("No image name provided.");if(2===e.length)return new t(n);var i=r.parse(e[2],1,TW);return i?new t(n,i):r.error("Secondary image variant is not a string.")}}])}();function pq(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":wW(t)}var dq={"to-boolean":OW,"to-color":MW,"to-number":IW,"to-string":TW},yq=function(){function t(e,r){hW(this,t),this.type=e,this.args=r}return cW(t,[{key:"evaluate",value:function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){var e,r,n,i=bW(this.args);try{for(i.s();!(n=i.n()).done;){if(r=null,(e=n.value.evaluate(t))instanceof ZW)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value ".concat(JSON.stringify(e),": expected an array containing either three or four numeric values."):nq(e[0],e[1],e[2],e[3])))return new ZW(e[0]/255,e[1]/255,e[2]/255,e[3])}}catch(t){i.e(t)}finally{i.f()}throw new uq(r||"Could not parse color from value '".concat("string"==typeof e?e:String(JSON.stringify(e)),"'"))}if("number"===this.type.kind){var a,s=null,u=bW(this.args);try{for(u.s();!(a=u.n()).done;){if(null===(s=a.value.evaluate(t)))return 0;var l=Number(s);if(!isNaN(l))return l}}catch(t){u.e(t)}finally{u.f()}throw new uq("Could not convert ".concat(JSON.stringify(s)," to number."))}return"formatted"===this.type.kind?eq.fromString(aq(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?rq.fromString(aq(this.args[0].evaluate(t))):"array"===this.type.kind?this.args.map(function(e){return e.evaluate(t)}):aq(this.args[0].evaluate(t))}},{key:"eachChild",value:function(t){this.args.forEach(t)}},{key:"outputDefined",value:function(){return this.args.every(function(t){return t.outputDefined()})}},{key:"serialize",value:function(){if("formatted"===this.type.kind)return new fq([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new hq(this.args[0]).serialize();var t="array"===this.type.kind?[]:["to-".concat(this.type.kind)];return this.eachChild(function(e){t.push(e.serialize())}),t}}],[{key:"parse",value:function(e,r){if(e.length<2)return r.error("Expected at least one argument.");var n=e[0],i=[],o=kW;if("to-array"===n){if(!Array.isArray(e[1]))return null;var a=e[1].length;if(r.expectedType){if("array"!==r.expectedType.kind)return r.error("Expected ".concat(r.expectedType.kind," but found array."));o=DW(r.expectedType.itemType,a)}else{if(!(a>0&&iq(e[1][0])))return null;o=DW(oq(e[1][0]),a)}for(var s=0;sn;){if(i-n>600){var a=i-n+1,s=r-n+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1),f=Math.max(n,Math.floor(r-s*l/a+c)),h=Math.min(i,Math.floor(r+(a-s)*l/a+c));t(e,r,f,h,o)}var p=e[r],d=n,y=i;for(wq(e,n,r),o(e[i],p)>0&&wq(e,n,i);d0;)y--}0===o(e[n],p)?wq(e,n,y):wq(e,++y,i),y<=r&&(n=y+1),r<=y&&(i=y-1)}}(t,e,r||0,n||t.length-1,i||_q)}function wq(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function _q(t,e){return te?1:0}function Sq(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;i=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function Iq(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Tq(t,e){for(var r,n,i,o,a,s,u,l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=!1,f=0,h=e.length;f0&&f<0||c<0&&f>0}function Mq(t,e,r,n){var i,o,a=[e[0]-t[0],e[1]-t[1]],s=[n[0]-r[0],n[1]-r[1]];return 0!=(i=s)[0]*(o=a)[1]-i[1]*o[0]&&!(!Oq(t,e,r,n)||!Oq(r,n,t,e))}var Pq=8192;function Lq(t,e){var r,n=(180+t[0])/360,i=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),o=Math.pow(2,e.z);return[Math.round(n*o*Pq),Math.round(i*o*Pq)]}function Nq(t,e){for(var r=0;rr[2]){var i=.5*n,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===o&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}Cq(e,t)}function Gq(t,e,r,n){var i=Math.pow(2,n.z)*Pq,o=[n.x*Pq,n.y*Pq],a=[];if(!t)return a;var s,u=bW(t);try{for(u.s();!(s=u.n()).done;){var l,c=bW(s.value);try{for(c.s();!(l=c.n()).done;){var f=l.value,h=[f.x+o[0],f.y+o[1]];zq(h,e,r,i),a.push(h)}}catch(t){c.e(t)}finally{c.f()}}}catch(t){u.e(t)}finally{u.f()}return a}function Uq(t,e,r,n){var i=Math.pow(2,n.z)*Pq,o=[n.x*Pq,n.y*Pq],a=[];if(!t)return a;var s,u,l=bW(t);try{for(l.s();!(s=l.n()).done;){var c,f=[],h=bW(s.value);try{for(h.s();!(c=h.n()).done;){var p=c.value,d=[p.x+o[0],p.y+o[1]];Cq(e,d),f.push(d)}}catch(t){h.e(t)}finally{h.f()}a.push(f)}}catch(t){l.e(t)}finally{l.f()}if(e[2]-e[0]<=i/2){(u=e)[0]=u[1]=1/0,u[2]=u[3]=-1/0;var y,g=bW(a);try{for(g.s();!(y=g.n()).done;){var v,m=bW(y.value);try{for(m.s();!(v=m.n()).done;){zq(v.value,e,r,i)}}catch(t){m.e(t)}finally{m.f()}}}catch(t){g.e(t)}finally{g.f()}}return a}var Hq=function(){function t(e,r){hW(this,t),this.type=OW,this.geojson=e,this.geometries=r}return cW(t,[{key:"evaluate",value:function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(!i)return!1;if("Polygon"===e.type){var o=Bq(e.coordinates,n,i),a=Gq(t.geometry(),r,n,i);if(!kq(r,n))return!1;var s,u=bW(a);try{for(u.s();!(s=u.n()).done;)if(!Tq(s.value,o))return!1}catch(t){u.e(t)}finally{u.f()}}if("MultiPolygon"===e.type){var l=Fq(e.coordinates,n,i),c=Gq(t.geometry(),r,n,i);if(!kq(r,n))return!1;var f,h=bW(c);try{for(h.s();!(f=h.n()).done;)if(!Nq(f.value,l))return!1}catch(t){h.e(t)}finally{h.f()}}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(!i)return!1;if("Polygon"===e.type){var o=Bq(e.coordinates,n,i),a=Uq(t.geometry(),r,n,i);if(!kq(r,n))return!1;var s,u=bW(a);try{for(u.s();!(s=u.n()).done;)if(!Rq(s.value,o))return!1}catch(t){u.e(t)}finally{u.f()}}if("MultiPolygon"===e.type){var l=Fq(e.coordinates,n,i),c=Uq(t.geometry(),r,n,i);if(!kq(r,n))return!1;var f,h=bW(c);try{for(h.s();!(f=h.n()).done;)if(!Dq(f.value,l))return!1}catch(t){h.e(t)}finally{h.f()}}return!0}(t,this.geometries)}return!1}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return["within",this.geojson]}}],[{key:"parse",value:function(e,r){if(2!==e.length)return r.error("'within' expression requires exactly one argument, but found ".concat(e.length-1," instead."));if(iq(e[1])){var n=e[1];if("FeatureCollection"===n.type)for(var i=0;ie)return Jq(i,o,(e-(r-a))/a)}return t[t.length-1]}},{key:"pointToSegmentDistance",value:function(t,e,r){var n=aW(e,2),i=n[0],o=n[1],a=Zq(r[0]-i)*this.kx,s=(r[1]-o)*this.ky,u=0;return 0===a&&0===s||((u=(Zq(t[0]-i)*this.kx*a+(t[1]-o)*this.ky*s)/(a*a+s*s))>1?(i=r[0],o=r[1]):u>0&&(i+=a/this.kx*u,o+=s/this.ky*u)),a=Zq(t[0]-i)*this.kx,s=(t[1]-o)*this.ky,Math.sqrt(a*a+s*s)}},{key:"pointOnLine",value:function(t,e){for(var r,n,i,o,a=1/0,s=0;s1?(u=t[s+1][0],l=t[s+1][1]):h>0&&(u+=c/this.kx*h,l+=f/this.ky*h));var p=(c=Zq(e[0]-u)*this.kx)*c+(f=(e[1]-l)*this.ky)*f;pi.index||n.index===i.index&&n.t>i.t){var o=n;n=i,i=o}var a=[n.point],s=n.index+1,u=i.index;!Kq(r[s],a[0])&&s<=u&&a.push(r[s]);for(var l=s+1;l<=u;l++)a.push(r[l]);return Kq(r[u],i.point)||a.push(i.point),a}},{key:"lineSliceAlong",value:function(t,e,r){for(var n=0,i=[],o=0;ot&&0===i.length&&i.push(Jq(a,s,(t-(n-u))/u)),n>=e)return i.push(Jq(a,s,(e-(n-u))/u)),i;n>t&&i.push(s)}return i}},{key:"bufferPoint",value:function(t,e){var r=e/this.ky,n=e/this.kx;return[t[0]-n,t[1]-r,t[0]+n,t[1]+r]}},{key:"bufferBBox",value:function(t,e){var r=e/this.ky,n=e/this.kx;return[t[0]-n,t[1]-r,t[2]+n,t[3]+r]}},{key:"insideBBox",value:function(t,e){return Zq(t[0]-e[0])>=0&&Zq(t[0]-e[2])<=0&&t[1]>=e[1]&&t[1]<=e[3]}}],[{key:"fromTile",value:function(e,r,n){var i=Math.PI*(1-2*(e+.5)/Math.pow(2,r));return new t(Math.atan(.5*(Math.exp(i)-Math.exp(-i)))/qq,n)}},{key:"units",get:function(){return Vq}}])}();function Kq(t,e){return t[0]===e[0]&&t[1]===e[1]}function Jq(t,e,r){var n=Zq(e[0]-t[0]),i=e[1]-t[1];return[t[0]+n*r,t[1]+i*r]}function Zq(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}function $q(t,e){this.x=t,this.y=e}$q.prototype={clone:function(){return new $q(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),o=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},$q.convert=function(t){return t instanceof $q?t:Array.isArray(t)?new $q(t[0],t[1]):t};var tX=function(){return cW(function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eX;if(hW(this,t),this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)},[{key:"push",value:function(t){this.data.push(t),this.length++,this._up(this.length-1)}},{key:"pop",value:function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}}},{key:"peek",value:function(){return this.data[0]}},{key:"_up",value:function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n}},{key:"_down",value:function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i}}])}();function eX(t,e){return te?1:0}var rX=8192;function nX(t,e){return e.dist-t.dist}var iX=100,oX=50;function aX(t){var e=[1/0,1/0,-1/0,-1/0];if(e.length!==t.length)return!1;for(var r=0;r=t[0]&&t[1]t[1])return[null,null];var r=sX(t);if(e){if(2===r)return[t,null];var n=Math.floor(r/2);return[[t[0],t[0]+n],[t[0]+n,t[1]]]}if(1===r)return[t,null];var i=Math.floor(r/2)-1;return[[t[0],t[0]+i],[t[0]+i+1,t[1]]]}function cX(t,e){var r=[1/0,1/0,-1/0,-1/0];if(!uX(e,t.length))return r;for(var n=e[0];n<=e[1];++n)Cq(r,t[n]);return r}function fX(t){for(var e=[1/0,1/0,-1/0,-1/0],r=0;re[2]&&(n=t[0]-e[2]),t[1]>e[3]&&(i=t[1]-e[3]),t[3]3&&void 0!==arguments[3]?arguments[3]:1/0,i=fX(t),o=fX(e);if(n!==1/0&&hX(i,o,r)>=n)return n;if(kq(i,o)){if(wX(t,e))return 0}else if(wX(e,t))return 0;var a,s=n,u=bW(t);try{for(u.s();!(a=u.n()).done;)for(var l=a.value,c=0,f=l.length,h=f-1;c4&&void 0!==arguments[4]?arguments[4]:1/0,o=Math.min(n.distance(t[0],r[0][0]),i);if(0===o)return o;for(var a={dist:0,range1:[0,t.length-1],range2:[0,0]},s=new tX([a],nX),u=e?oX:iX,l=fX(r);s.length;){var c=s.pop();if(!(c.dist>=o)){var f=c.range1;if(sX(f)<=u){if(!uX(f,t.length))return NaN;if(e){var h=xX(t,f,r,n);if(0===(o=Math.min(o,h)))return o}else for(var p=f[0];p<=f[1];++p){var d=AX(t[p],r,n);if(0===(o=Math.min(o,d)))return o}}else{var y=lX(f,e);if(null!==y[0]){var g=hX(cX(t,y[0]),l,n);g5&&void 0!==arguments[5]?arguments[5]:1/0,a=Math.min(o,i.distance(t[0],r[0]));if(0===a)return a;for(var s={dist:0,range1:[0,t.length-1],range2:[0,r.length-1]},u=new tX([s],nX),l=e?oX:iX,c=n?oX:iX;u.length;){var f=u.pop();if(!(f.dist>=a)){var h=f.range1,p=f.range2;if(sX(h)<=l&&sX(p)<=c){if(!uX(h,t.length)||!uX(p,r.length))return NaN;if(e&&n?a=Math.min(a,mX(t,h,r,p,i)):e||n?e&&!n?a=Math.min(a,gX(r,p,t,h,i)):!e&&n&&(a=Math.min(a,gX(t,h,r,p,i))):a=Math.min(a,bX(t,h,r,p,i)),0===a)return a}else{var d=lX(h,e),y=lX(p,n);SX(u,a,i,t,r,d[0],y[0]),SX(u,a,i,t,r,d[0],y[1]),SX(u,a,i,t,r,d[1],y[0]),SX(u,a,i,t,r,d[1],y[1])}}}return a}function kX(t,e,r,n){var i,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,a=cX(t,[0,t.length-1]),s=bW(r);try{for(s.s();!(i=s.n()).done;){var u=i.value;if(!(o!==1/0&&hX(a,cX(u,[0,u.length-1]),n)>=o)&&0===(o=Math.min(o,CX(t,e,u,!0,n,o))))return o}}catch(t){s.e(t)}finally{s.f()}return o}function IX(t,e,r,n){var i,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,a=cX(t,[0,t.length-1]),s=bW(r);try{for(s.s();!(i=s.n()).done;){var u=i.value;if(!(o!==1/0&&hX(a,fX(u),n)>=o)){var l=EX(t,e,u,n,o);if(isNaN(l))return l;if(0===(o=Math.min(o,l)))return o}}}catch(t){s.e(t)}finally{s.f()}return o}function TX(t,e,r){var n,i=[],o=bW(function(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a1)for(var u=0;ur&&(t=r),t}var NX=function(){function t(e,r,n){hW(this,t),this.type=e,this.key=r,this.scope=n}return cW(t,[{key:"evaluate",value:function(t){var e=[this.key,this.scope,t.scope].filter(Boolean).join(""),r=t.getConfig(e);if(!r)return null;var n=r.type,i=r.value,o=r.values,a=r.minValue,s=r.maxValue,u=r.stepValue,l=r.default.evaluate(t),c=l;if(i){var f=t.scope;t.scope=(f||"").split("").slice(1).join(""),c=i.evaluate(t),t.scope=f}return n&&(c=PX(n,c)),void 0===c||void 0===a&&void 0===s&&void 0===u||("number"==typeof c?c=LX(c,a,s,u):Array.isArray(c)&&(c=c.map(function(t){return"number"==typeof t?LX(t,a,s,u):t}))),void 0!==i&&void 0!==c&&o&&!o.includes(c)&&(c=l,n&&(c=PX(n,c))),(n&&n!==this.type||void 0!==c&&oq(c)!==this.type)&&(c=PX(this.type.kind,c)),c}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var t=["config",this.key];return this.scope&&t.concat(this.key),t}}],[{key:"parse",value:function(e,r){var n=r.expectedType;if(null!==n&&void 0!==n||(n=LW),e.length<2||e.length>3)return r.error("Invalid number of arguments for 'config' expression.");var i=r.parse(e[1],1);if(!(i instanceof sq))return r.error("Key name of 'config' expression must be a string literal.");if(e.length>=3){var o=r.parse(e[2],2);return o instanceof sq?new t(n,aq(i.value),aq(o.value)):r.error("Scope of 'config' expression must be a string literal.")}return new t(n,aq(i.value))}}])}();function jX(t){if(t instanceof bq){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof Hq)return!1;if(t instanceof MX)return!1;var e=!0;return t.eachChild(function(t){e&&!jX(t)&&(e=!1)}),e}function RX(t){if(t instanceof bq&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild(function(t){e&&!RX(t)&&(e=!1)}),e}function DX(t){if(t instanceof NX)return!1;var e=!0;return t.eachChild(function(t){e&&!DX(t)&&(e=!1)}),e}function BX(t,e){if(t instanceof bq&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild(function(t){r&&!BX(t,e)&&(r=!1)}),r}var FX=function(){function t(e,r){hW(this,t),this.type=r.type,this.name=e,this.boundExpression=r}return cW(t,[{key:"evaluate",value:function(t){return this.boundExpression.evaluate(t)}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["var",this.name]}}],[{key:"parse",value:function(e,r){if(2!==e.length||"string"!=typeof e[1])return r.error("'var' expression requires exactly one string literal argument.");var n=e[1];return r.scope.has(n)?new t(n,r.scope.get(n)):r.error('Unknown variable "'.concat(n,'". Make sure "').concat(n,'" has been bound in an enclosing "let" expression before using it.'),1)}}])}(),zX=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new CW,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0;hW(this,t),this.registry=e,this.path=r,this.key=r.map(function(t){return"[".concat(t,"]")}).join(""),this.scope=i,this.errors=o,this.expectedType=n,this._scope=a,this.options=s}return cW(t,[{key:"parse",value:function(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return e||r?this.concat(e,r,n)._parse(t,i):this._parse(t,i)}},{key:"_parse",value:function(t,e){function r(t,e,r){return"assert"===r?new cq(e,[t]):"coerce"===r?new yq(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n="string"==typeof t[0]?this.registry[t[0]]:void 0;if(n){var i=n.parse(t,this);if(!i)return null;if(this.expectedType){var o=this.expectedType,a=i.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==a.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(o,a))return null}else i=r(i,o,e.typeAnnotation||"coerce");else i=r(i,o,e.typeAnnotation||"assert")}if(!(i instanceof sq)&&"resolvedImage"!==i.type.kind&&function t(e){if(e instanceof FX)return t(e.boundExpression);if(e instanceof bq&&"error"===e.name)return!1;if(e instanceof Aq)return!1;if(e instanceof Hq)return!1;if(e instanceof MX)return!1;if(e instanceof NX)return!1;var r=e instanceof yq||e instanceof cq;var n=!0;e.eachChild(function(e){n=r?n&&t(e):n&&e instanceof sq});if(!n)return!1;return jX(e)&&BX(e,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])}(i)){var s=new vq(this._scope,this.options);try{i=new sq(i.type,i.evaluate(s))}catch(t){return this.error(t.message),null}}return i}return yq.parse(["to-array",t],this)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"===wW(t)?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found ".concat(wW(t)," instead."))}},{key:"concat",value:function(e,r,n){var i="number"==typeof e?this.path.concat(e):this.path,o=n?this.scope.concat(n):this.scope;return new t(this.registry,i,r||null,o,this.errors,this._scope,this.options)}},{key:"error",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;ne))throw new uq("Input is not a number.");a=s-1}return 0}var UX=function(){function t(e,r,n){hW(this,t),this.type=e,this.input=r,this.labels=[],this.outputs=[];var i,o=bW(n);try{for(o.s();!(i=o.n()).done;){var a=aW(i.value,2),s=a[0],u=a[1];this.labels.push(s),this.outputs.push(u)}}catch(t){o.e(t)}finally{o.f()}}return cW(t,[{key:"evaluate",value:function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[GX(e,n)].evaluate(t)}},{key:"eachChild",value:function(t){t(this.input);var e,r=bW(this.outputs);try{for(r.s();!(e=r.n()).done;){t(e.value)}}catch(t){r.e(t)}finally{r.f()}}},{key:"outputDefined",value:function(){return this.outputs.every(function(t){return t.outputDefined()})}},{key:"serialize",value:function(){for(var t=["step",this.input.serialize()],e=0;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}],[{key:"parse",value:function(e,r){if(e.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");var n=r.parse(e[1],1,IW);if(!n)return null;var i=[],o=null;r.expectedType&&"value"!==r.expectedType.kind&&(o=r.expectedType);for(var a=1;a=s)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var f=r.parse(u,c,o);if(!f)return null;o=o||f.type,i.push([s,f])}return new t(o,n,i)}}])}(),HX=VX;function VX(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=n}VX.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)i?a=r:s=r,r=.5*(s-a)+a;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var QX=HW(HX);function YX(t,e,r){return t*(1-r)+e*r}var WX=Object.freeze({__proto__:null,array:function(t,e,r){return t.map(function(t,n){return YX(t,e[n],r)})},color:function(t,e,r){return new ZW(YX(t.r,e.r,r),YX(t.g,e.g,r),YX(t.b,e.b,r),YX(t.a,e.a,r))},number:YX}),qX=.95047,XX=1,KX=1.08883,JX=4/29,ZX=6/29,$X=3*ZX*ZX,tK=ZX*ZX*ZX,eK=Math.PI/180,rK=180/Math.PI;function nK(t){return t>tK?Math.pow(t,1/3):t/$X+JX}function iK(t){return t>ZX?t*t*t:$X*(t-JX)}function oK(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function aK(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function sK(t){var e=aK(t.r),r=aK(t.g),n=aK(t.b),i=nK((.4124564*e+.3575761*r+.1804375*n)/qX),o=nK((.2126729*e+.7151522*r+.072175*n)/XX);return{l:116*o-16,a:500*(i-o),b:200*(o-nK((.0193339*e+.119192*r+.9503041*n)/KX)),alpha:t.a}}function uK(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=XX*iK(e),r=qX*iK(r),n=KX*iK(n),new ZW(oK(3.2404542*r-1.5371385*e-.4985314*n),oK(-.969266*r+1.8760108*e+.041556*n),oK(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}var lK={forward:sK,reverse:uK,interpolate:function(t,e,r){return{l:YX(t.l,e.l,r),a:YX(t.a,e.a,r),b:YX(t.b,e.b,r),alpha:YX(t.alpha,e.alpha,r)}}},cK={forward:function(t){var e=sK(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*rK;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*eK,r=t.c;return uK({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:function(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}(t.h,e.h,r),c:YX(t.c,e.c,r),l:YX(t.l,e.l,r),alpha:YX(t.alpha,e.alpha,r)}}},fK=Object.freeze({__proto__:null,hcl:cK,lab:lK});function hK(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}var pK=function(){function t(e,r,n,i,o){hW(this,t),this.type=e,this.operator=r,this.interpolation=n,this.input=i,this.labels=[],this.outputs=[];var a,s=bW(o);try{for(s.s();!(a=s.n()).done;){var u=aW(a.value,2),l=u[0],c=u[1];this.labels.push(l),this.outputs.push(c)}}catch(t){s.e(t)}finally{s.f()}}return cW(t,[{key:"evaluate",value:function(e){var r=this.labels,n=this.outputs;if(1===r.length)return n[0].evaluate(e);var i=this.input.evaluate(e);if(i<=r[0])return n[0].evaluate(e);var o=r.length;if(i>=r[o-1])return n[o-1].evaluate(e);var a=GX(r,i),s=r[a],u=r[a+1],l=t.interpolationFactor(this.interpolation,i,s,u),c=n[a].evaluate(e),f=n[a+1].evaluate(e);return"interpolate"===this.operator?WX[this.type.kind.toLowerCase()](c,f,l):"interpolate-hcl"===this.operator?cK.reverse(cK.interpolate(cK.forward(c),cK.forward(f),l)):lK.reverse(lK.interpolate(lK.forward(c),lK.forward(f),l))}},{key:"eachChild",value:function(t){t(this.input);var e,r=bW(this.outputs);try{for(r.s();!(e=r.n()).done;){t(e.value)}}catch(t){r.e(t)}finally{r.f()}}},{key:"outputDefined",value:function(){return this.outputs.every(function(t){return t.outputDefined()})}},{key:"serialize",value:function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r1}))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:c}}if(e.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(!(s=r.parse(s,2,IW)))return null;var f=[],h=null;"interpolate-hcl"===o||"interpolate-lab"===o?h=MW:r.expectedType&&"value"!==r.expectedType.kind&&(h=r.expectedType);for(var p=0;p=d)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',g);var m=r.parse(y,v,h);if(!m)return null;h=h||m.type,f.push([d,m])}return"number"===h.kind||"color"===h.kind||"array"===h.kind&&"number"===h.itemType.kind&&"number"==typeof h.N?new t(h,o,a,s,f):r.error("Type ".concat(BW(h)," is not interpolatable."))}}])}(),dK=function(){function t(e,r){hW(this,t),this.type=e,this.args=r}return cW(t,[{key:"evaluate",value:function(t){var e,r,n=null,i=0,o=bW(this.args);try{for(o.s();!(r=o.n()).done;){if(i++,(n=r.value.evaluate(t))&&n instanceof rq&&!n.available&&(e||(e=n),n=null,i===this.args.length))return e;if(null!==n)break}}catch(t){o.e(t)}finally{o.f()}return n}},{key:"eachChild",value:function(t){this.args.forEach(t)}},{key:"outputDefined",value:function(){return this.args.every(function(t){return t.outputDefined()})}},{key:"serialize",value:function(){var t=["coalesce"];return this.eachChild(function(e){t.push(e.serialize())}),t}}],[{key:"parse",value:function(e,r){if(e.length<2)return r.error("Expectected at least one argument.");var n=null,i=r.expectedType;i&&"value"!==i.kind&&(n=i);var o,a=[],s=bW(e.slice(1));try{for(s.s();!(o=s.n()).done;){var u=o.value,l=r.parse(u,1+a.length,n,void 0,{typeAnnotation:"omit"});if(!l)return null;n=n||l.type,a.push(l)}}catch(t){s.e(t)}finally{s.f()}return new t(i&&a.some(function(t){return zW(i,t.type)})?LW:n,a)}}])}(),yK=function(){function t(e,r){hW(this,t),this.type=r.type,this.bindings=[].concat(e),this.result=r}return cW(t,[{key:"evaluate",value:function(t){return this.result.evaluate(t)}},{key:"eachChild",value:function(t){var e,r=bW(this.bindings);try{for(r.s();!(e=r.n()).done;){t(e.value[1])}}catch(t){r.e(t)}finally{r.f()}t(this.result)}},{key:"outputDefined",value:function(){return this.result.outputDefined()}},{key:"serialize",value:function(){var t,e=["let"],r=bW(this.bindings);try{for(r.s();!(t=r.n()).done;){var n=aW(t.value,2),i=n[0],o=n[1];e.push(i,o.serialize())}}catch(t){r.e(t)}finally{r.f()}return e.push(this.result.serialize()),e}}],[{key:"parse",value:function(e,r){if(e.length<4)return r.error("Expected at least 3 arguments, but found ".concat(e.length-1," instead."));for(var n=[],i=1;i=r.length)throw new uq("Array index out of bounds: ".concat(e," > ").concat(r.length-1,"."));if(e!==Math.floor(e))throw new uq("Array index must be an integer, but found ".concat(e," instead."));return r[e]}},{key:"eachChild",value:function(t){t(this.index),t(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["at",this.index.serialize(),this.input.serialize()]}}],[{key:"parse",value:function(e,r){if(3!==e.length)return r.error("Expected 2 arguments, but found ".concat(e.length-1," instead."));var n=r.parse(e[1],1,IW),i=r.parse(e[2],2,DW(r.expectedType||LW));return n&&i?new t(i.type.itemType,n,i):null}}])}(),vK=function(){function t(e,r){hW(this,t),this.type=OW,this.needle=e,this.haystack=r}return cW(t,[{key:"evaluate",value:function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(null==r)return!1;if(!UW(e,["boolean","string","number","null"]))throw new uq("Expected first argument to be of type boolean, string, number or null, but found ".concat(BW(oq(e))," instead."));if(!UW(r,["string","array"]))throw new uq("Expected second argument to be of type array or string, but found ".concat(BW(oq(r))," instead."));return r.indexOf(e)>=0}},{key:"eachChild",value:function(t){t(this.needle),t(this.haystack)}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return["in",this.needle.serialize(),this.haystack.serialize()]}}],[{key:"parse",value:function(e,r){if(3!==e.length)return r.error("Expected 2 arguments, but found ".concat(e.length-1," instead."));var n=r.parse(e[1],1,LW),i=r.parse(e[2],2,LW);return n&&i?GW(n.type,[OW,TW,IW,kW,LW])?new t(n,i):r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(BW(n.type)," instead")):null}}])}(),mK=function(){function t(e,r,n){hW(this,t),this.type=IW,this.needle=e,this.haystack=r,this.fromIndex=n}return cW(t,[{key:"evaluate",value:function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!UW(e,["boolean","string","number","null"]))throw new uq("Expected first argument to be of type boolean, string, number or null, but found ".concat(BW(oq(e))," instead."));if(!UW(r,["string","array"]))throw new uq("Expected second argument to be of type array or string, but found ".concat(BW(oq(r))," instead."));if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)}},{key:"eachChild",value:function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}],[{key:"parse",value:function(e,r){if(e.length<=2||e.length>=5)return r.error("Expected 3 or 4 arguments, but found ".concat(e.length-1," instead."));var n=r.parse(e[1],1,LW),i=r.parse(e[2],2,LW);if(!n||!i)return null;if(!GW(n.type,[OW,TW,IW,kW,LW]))return r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(BW(n.type)," instead"));if(4===e.length){var o=r.parse(e[3],3,IW);return o?new t(n,i,o):null}return new t(n,i)}}])}(),bK=function(){function t(e,r,n,i,o,a){hW(this,t),this.inputType=e,this.type=r,this.input=n,this.cases=i,this.outputs=o,this.otherwise=a}return cW(t,[{key:"evaluate",value:function(t){var e=this.input.evaluate(t);return(oq(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}},{key:"eachChild",value:function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}},{key:"outputDefined",value:function(){return this.outputs.every(function(t){return t.outputDefined()})&&this.otherwise.outputDefined()}},{key:"serialize",value:function(){var t,e=this,r=["match",this.input.serialize()],n=[],i={},o=bW(Object.keys(this.cases).sort());try{for(o.s();!(t=o.n()).done;){var a=t.value,s=i[this.cases[a]];void 0===s?(i[this.cases[a]]=n.length,n.push([this.cases[a],[a]])):n[s][1].push(a)}}catch(t){o.e(t)}finally{o.f()}for(var u=function(t){return"number"===e.inputType.kind?Number(t):t},l=0,c=n;lNumber.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if("number"==typeof p&&Math.floor(p)!==p)return c.error("Numeric branch labels must be integer values.");if(n){if(c.checkSubtype(n,oq(p)))return null}else n=oq(p);if(void 0!==o[String(p)])return c.error("Branch labels must be unique.");o[String(p)]=a.length}}catch(t){h.e(t)}finally{h.f()}var d=r.parse(l,s,i);if(!d)return null;i=i||d.type,a.push(d)}var y=r.parse(e[1],1,LW);if(!y)return null;var g=r.parse(e[e.length-1],e.length-1,i);return g?"value"!==y.type.kind&&r.concat(1).checkSubtype(n,y.type)?null:new t(n,i,y,o,a,g):null}}])}(),AK=function(){function t(e,r,n){hW(this,t),this.type=e,this.branches=r,this.otherwise=n}return cW(t,[{key:"evaluate",value:function(t){var e,r=bW(this.branches);try{for(r.s();!(e=r.n()).done;){var n=aW(e.value,2),i=n[0],o=n[1];if(i.evaluate(t))return o.evaluate(t)}}catch(t){r.e(t)}finally{r.f()}return this.otherwise.evaluate(t)}},{key:"eachChild",value:function(t){var e,r=bW(this.branches);try{for(r.s();!(e=r.n()).done;){var n=aW(e.value,2),i=n[0],o=n[1];t(i),t(o)}}catch(t){r.e(t)}finally{r.f()}t(this.otherwise)}},{key:"outputDefined",value:function(){return this.branches.every(function(t){var e=aW(t,2);e[0];return e[1].outputDefined()})&&this.otherwise.outputDefined()}},{key:"serialize",value:function(){var t=["case"];return this.eachChild(function(e){t.push(e.serialize())}),t}}],[{key:"parse",value:function(e,r){if(e.length<4)return r.error("Expected at least 3 arguments, but found only ".concat(e.length-1,"."));if(e.length%2!=0)return r.error("Expected an odd number of arguments.");var n;r.expectedType&&"value"!==r.expectedType.kind&&(n=r.expectedType);for(var i=[],o=1;o=5)return r.error("Expected 3 or 4 arguments, but found ".concat(e.length-1," instead."));var n=r.parse(e[1],1,LW),i=r.parse(e[2],2,IW);if(!n||!i)return null;if(!GW(n.type,[DW(LW),TW,LW]))return r.error("Expected first argument to be of type array or string, but found ".concat(BW(n.type)," instead"));if(4===e.length){var o=r.parse(e[3],3,IW);return o?new t(n.type,n,i,o):null}return new t(n.type,n,i)}}])}();function wK(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function _K(t,e,r,n){return 0===n.compare(e,r)}function SK(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){hW(this,i),this.type=OW,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return cW(i,[{key:"evaluate",value:function(i){var o=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=oq(o),u=oq(a);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new uq('Expected arguments for "'.concat(t,'" to be (string, string) or (number, number), but found (').concat(s.kind,", ").concat(u.kind,") instead."))}if(this.collator&&!n&&this.hasUntypedArgument){var l=oq(o),c=oq(a);if("string"!==l.kind||"string"!==c.kind)return e(i,o,a)}return this.collator?r(i,o,a,this.collator.evaluate(i)):e(i,o,a)}},{key:"eachChild",value:function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){var e=[t];return this.eachChild(function(t){e.push(t.serialize())}),e}}],[{key:"parse",value:function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],o=e.parse(t[1],1,LW);if(!o)return null;if(!wK(r,o.type))return e.concat(1).error('"'.concat(r,"\" comparisons are not supported for type '").concat(BW(o.type),"'."));var a=e.parse(t[2],2,LW);if(!a)return null;if(!wK(r,a.type))return e.concat(2).error('"'.concat(r,"\" comparisons are not supported for type '").concat(BW(a.type),"'."));if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '".concat(BW(o.type),"' and '").concat(BW(a.type),"'."));n&&("value"===o.type.kind&&"value"!==a.type.kind?o=new cq(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new cq(o.type,[a])));var s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,NW)))return null}return new i(o,a,s)}}])}()}var EK=SK("==",function(t,e,r){return e===r},_K),CK=SK("!=",function(t,e,r){return e!==r},function(t,e,r,n){return!_K(0,e,r,n)}),kK=SK("<",function(t,e,r){return e",function(t,e,r){return e>r},function(t,e,r,n){return n.compare(e,r)>0}),TK=SK("<=",function(t,e,r){return e<=r},function(t,e,r,n){return n.compare(e,r)<=0}),OK=SK(">=",function(t,e,r){return e>=r},function(t,e,r,n){return n.compare(e,r)>=0}),MK=function(){function t(e,r,n,i,o,a){hW(this,t),this.type=TW,this.number=e,this.locale=r,this.currency=n,this.unit=i,this.minFractionDigits=o,this.maxFractionDigits=a}return cW(t,[{key:"evaluate",value:function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}},{key:"eachChild",value:function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.unit&&(t.unit=this.unit.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}],[{key:"parse",value:function(e,r){if(3!==e.length)return r.error("Expected two arguments.");var n=r.parse(e[1],1,IW);if(!n)return null;var i=e[2];if("object"!==wW(i)||Array.isArray(i))return r.error("NumberFormat options argument must be an object.");var o=null;if(i.locale&&!(o=r.parse(i.locale,1,TW)))return null;var a=null;if(i.currency&&!(a=r.parse(i.currency,1,TW)))return null;var s=null;if(i.unit&&!(s=r.parse(i.unit,1,TW)))return null;var u=null;if(i["min-fraction-digits"]&&!(u=r.parse(i["min-fraction-digits"],1,IW)))return null;var l=null;return i["max-fraction-digits"]&&!(l=r.parse(i["max-fraction-digits"],1,IW))?null:new t(n,o,a,s,u,l)}}])}();var PK={"==":EK,"!=":CK,">":IK,"<":kK,">=":OK,"<=":TK,array:cq,at:gK,boolean:cq,case:AK,coalesce:dK,collator:Aq,format:fq,image:hq,in:vK,"index-of":mK,interpolate:pK,"interpolate-hcl":pK,"interpolate-lab":pK,length:function(){function t(e){hW(this,t),this.type=IW,this.input=e}return cW(t,[{key:"evaluate",value:function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new uq("Expected value to be of type string or array, but found ".concat(BW(oq(e))," instead."))}},{key:"eachChild",value:function(t){t(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var t=["length"];return this.eachChild(function(e){t.push(e.serialize())}),t}}],[{key:"parse",value:function(e,r){if(2!==e.length)return r.error("Expected 1 argument, but found ".concat(e.length-1," instead."));var n=r.parse(e[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?r.error("Expected argument of type string or array, but found ".concat(BW(n.type)," instead.")):new t(n):null}}])}(),let:yK,literal:sq,match:bK,number:cq,"number-format":MK,object:cq,slice:xK,step:UX,string:cq,"to-boolean":yq,"to-color":yq,"to-number":yq,"to-string":yq,var:FX,within:Hq,distance:MX,config:NX};function LK(t,e){var r=aW(e,4),n=r[0],i=r[1],o=r[2],a=r[3];n=n.evaluate(t),i=i.evaluate(t),o=o.evaluate(t);var s=a?a.evaluate(t):1,u=nq(n,i,o,s);if(u)throw new uq(u);return new ZW(n/255*s,i/255*s,o/255*s,s)}function NK(t,e){var r=aW(e,4),n=r[0],i=r[1],o=r[2],a=r[3];n=n.evaluate(t),i=i.evaluate(t),o=o.evaluate(t);var s=a?a.evaluate(t):1,u=function(t,e,r,n){return"number"==typeof t&&t>=0&&t<=360?"number"==typeof e&&e>=0&&e<=100&&"number"==typeof r&&r>=0&&r<=100?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid hsla value [".concat([t,e,r,n].join(", "),"]: 'a' must be between 0 and 1."):"Invalid hsla value [".concat(("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", "),"]: 's', and 'l' must be between 0 and 100."):"Invalid hsla value [".concat(("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", "),"]: 'h' must be between 0 and 360.")}(n,i,o,s);if(u)throw new uq(u);var l="hsla(".concat(n,", ").concat(i,"%, ").concat(o,"%, ").concat(s,")"),c=ZW.parse(l);if(!c)throw new uq("Failed to parse HSLA color: ".concat(l));return c}function jK(t,e){return t in e}function RK(t,e){var r=e[t];return void 0===r?null:r}function DK(t){return{type:t}}bq.register(PK,{error:[{kind:"error"},[TW],function(t,e){var r=aW(e,1)[0];throw new uq(r.evaluate(t))}],typeof:[TW,[LW],function(t,e){return BW(oq(aW(e,1)[0].evaluate(t)))}],"to-rgba":[DW(IW,4),[MW],function(t,e){return aW(e,1)[0].evaluate(t).toArray()}],rgb:[MW,[IW,IW,IW],LK],rgba:[MW,[IW,IW,IW,IW],LK],hsl:[MW,[IW,IW,IW],NK],hsla:[MW,[IW,IW,IW,IW],NK],has:{type:OW,overloads:[[[TW],function(t,e){return jK(aW(e,1)[0].evaluate(t),t.properties())}],[[TW,PW],function(t,e){var r=aW(e,2),n=r[0],i=r[1];return jK(n.evaluate(t),i.evaluate(t))}]]},get:{type:LW,overloads:[[[TW],function(t,e){return RK(aW(e,1)[0].evaluate(t),t.properties())}],[[TW,PW],function(t,e){var r=aW(e,2),n=r[0],i=r[1];return RK(n.evaluate(t),i.evaluate(t))}]]},"feature-state":[LW,[TW],function(t,e){return RK(aW(e,1)[0].evaluate(t),t.featureState||{})}],properties:[PW,[],function(t){return t.properties()}],"geometry-type":[TW,[],function(t){return t.geometryType()}],id:[LW,[],function(t){return t.id()}],zoom:[IW,[],function(t){return t.globals.zoom}],pitch:[IW,[],function(t){return t.globals.pitch||0}],"distance-from-center":[IW,[],function(t){return t.distanceFromCenter()}],"measure-light":[IW,[TW],function(t,e){var r=aW(e,1)[0];return t.measureLight(r.evaluate(t))}],"heatmap-density":[IW,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[IW,[],function(t){return t.globals.lineProgress||0}],"raster-value":[IW,[],function(t){return t.globals.rasterValue||0}],"raster-particle-speed":[IW,[],function(t){return t.globals.rasterParticleSpeed||0}],"sky-radial-progress":[IW,[],function(t){return t.globals.skyRadialProgress||0}],accumulated:[LW,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[IW,DK(IW),function(t,e){var r,n=0,i=bW(e);try{for(i.s();!(r=i.n()).done;){n+=r.value.evaluate(t)}}catch(t){i.e(t)}finally{i.f()}return n}],"*":[IW,DK(IW),function(t,e){var r,n=1,i=bW(e);try{for(i.s();!(r=i.n()).done;){n*=r.value.evaluate(t)}}catch(t){i.e(t)}finally{i.f()}return n}],"-":{type:IW,overloads:[[[IW,IW],function(t,e){var r=aW(e,2),n=r[0],i=r[1];return n.evaluate(t)-i.evaluate(t)}],[[IW],function(t,e){return-aW(e,1)[0].evaluate(t)}]]},"/":[IW,[IW,IW],function(t,e){var r=aW(e,2),n=r[0],i=r[1];return n.evaluate(t)/i.evaluate(t)}],"%":[IW,[IW,IW],function(t,e){var r=aW(e,2),n=r[0],i=r[1];return n.evaluate(t)%i.evaluate(t)}],ln2:[IW,[],function(){return Math.LN2}],pi:[IW,[],function(){return Math.PI}],e:[IW,[],function(){return Math.E}],"^":[IW,[IW,IW],function(t,e){var r=aW(e,2),n=r[0],i=r[1];return Math.pow(n.evaluate(t),i.evaluate(t))}],sqrt:[IW,[IW],function(t,e){var r=aW(e,1)[0];return Math.sqrt(r.evaluate(t))}],log10:[IW,[IW],function(t,e){var r=aW(e,1)[0];return Math.log(r.evaluate(t))/Math.LN10}],ln:[IW,[IW],function(t,e){var r=aW(e,1)[0];return Math.log(r.evaluate(t))}],log2:[IW,[IW],function(t,e){var r=aW(e,1)[0];return Math.log(r.evaluate(t))/Math.LN2}],sin:[IW,[IW],function(t,e){var r=aW(e,1)[0];return Math.sin(r.evaluate(t))}],cos:[IW,[IW],function(t,e){var r=aW(e,1)[0];return Math.cos(r.evaluate(t))}],tan:[IW,[IW],function(t,e){var r=aW(e,1)[0];return Math.tan(r.evaluate(t))}],asin:[IW,[IW],function(t,e){var r=aW(e,1)[0];return Math.asin(r.evaluate(t))}],acos:[IW,[IW],function(t,e){var r=aW(e,1)[0];return Math.acos(r.evaluate(t))}],atan:[IW,[IW],function(t,e){var r=aW(e,1)[0];return Math.atan(r.evaluate(t))}],min:[IW,DK(IW),function(t,e){return Math.min.apply(Math,iW(e.map(function(e){return e.evaluate(t)})))}],max:[IW,DK(IW),function(t,e){return Math.max.apply(Math,iW(e.map(function(e){return e.evaluate(t)})))}],abs:[IW,[IW],function(t,e){var r=aW(e,1)[0];return Math.abs(r.evaluate(t))}],round:[IW,[IW],function(t,e){var r=aW(e,1)[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[IW,[IW],function(t,e){var r=aW(e,1)[0];return Math.floor(r.evaluate(t))}],ceil:[IW,[IW],function(t,e){var r=aW(e,1)[0];return Math.ceil(r.evaluate(t))}],"filter-==":[OW,[TW,LW],function(t,e){var r=aW(e,2),n=r[0],i=r[1];return t.properties()[n.value]===i.value}],"filter-id-==":[OW,[LW],function(t,e){var r=aW(e,1)[0];return t.id()===r.value}],"filter-type-==":[OW,[TW],function(t,e){var r=aW(e,1)[0];return t.geometryType()===r.value}],"filter-<":[OW,[TW,LW],function(t,e){var r=aW(e,2),n=r[0],i=r[1],o=t.properties()[n.value],a=i.value;return wW(o)===wW(a)&&o":[OW,[TW,LW],function(t,e){var r=aW(e,2),n=r[0],i=r[1],o=t.properties()[n.value],a=i.value;return wW(o)===wW(a)&&o>a}],"filter-id->":[OW,[LW],function(t,e){var r=aW(e,1)[0],n=t.id(),i=r.value;return wW(n)===wW(i)&&n>i}],"filter-<=":[OW,[TW,LW],function(t,e){var r=aW(e,2),n=r[0],i=r[1],o=t.properties()[n.value],a=i.value;return wW(o)===wW(a)&&o<=a}],"filter-id-<=":[OW,[LW],function(t,e){var r=aW(e,1)[0],n=t.id(),i=r.value;return wW(n)===wW(i)&&n<=i}],"filter->=":[OW,[TW,LW],function(t,e){var r=aW(e,2),n=r[0],i=r[1],o=t.properties()[n.value],a=i.value;return wW(o)===wW(a)&&o>=a}],"filter-id->=":[OW,[LW],function(t,e){var r=aW(e,1)[0],n=t.id(),i=r.value;return wW(n)===wW(i)&&n>=i}],"filter-has":[OW,[LW],function(t,e){return aW(e,1)[0].value in t.properties()}],"filter-has-id":[OW,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[OW,[DW(TW)],function(t,e){return aW(e,1)[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[OW,[DW(LW)],function(t,e){return aW(e,1)[0].value.indexOf(t.id())>=0}],"filter-in-small":[OW,[TW,DW(LW)],function(t,e){var r=aW(e,2),n=r[0];return r[1].value.indexOf(t.properties()[n.value])>=0}],"filter-in-large":[OW,[TW,DW(LW)],function(t,e){var r=aW(e,2),n=r[0],i=r[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[n.value],i.value,0,i.value.length-1)}],all:{type:OW,overloads:[[[OW,OW],function(t,e){var r=aW(e,2),n=r[0],i=r[1];return n.evaluate(t)&&i.evaluate(t)}],[DK(OW),function(t,e){var r,n=bW(e);try{for(n.s();!(r=n.n()).done;){if(!r.value.evaluate(t))return!1}}catch(t){n.e(t)}finally{n.f()}return!0}]]},any:{type:OW,overloads:[[[OW,OW],function(t,e){var r=aW(e,2),n=r[0],i=r[1];return n.evaluate(t)||i.evaluate(t)}],[DK(OW),function(t,e){var r,n=bW(e);try{for(n.s();!(r=n.n()).done;){if(r.value.evaluate(t))return!0}}catch(t){n.e(t)}finally{n.f()}return!1}]]},"!":[OW,[OW],function(t,e){return!aW(e,1)[0].evaluate(t)}],"is-supported-script":[OW,[TW],function(t,e){var r=aW(e,1)[0],n=t.globals&&t.globals.isSupportedScript;return!n||n(r.evaluate(t))}],upcase:[TW,[TW],function(t,e){return aW(e,1)[0].evaluate(t).toUpperCase()}],downcase:[TW,[TW],function(t,e){return aW(e,1)[0].evaluate(t).toLowerCase()}],concat:[TW,DK(LW),function(t,e){return e.map(function(e){return aq(e.evaluate(t))}).join("")}],"resolved-locale":[TW,[NW],function(t,e){return aW(e,1)[0].evaluate(t).resolvedLocale()}],random:[IW,[IW,IW,LW],function(t,e){var r,n,i=aW(e.map(function(e){return e.evaluate(t)}),3),o=i[0],a=i[1],s=i[2];if(o>a)return o;if(o===a)return o;if("string"==typeof s)r=function(t){var e=0;if(0===t.length)return e;for(var r=0;r>>15,1|n);return(((t=t+Math.imul(t^t>>>7,61|t)^t)^t>>>14)>>>0)/4294967296})()*(a-o)}]});var BK=PK;function FK(t){return{result:"success",value:t}}function zK(t){return{result:"error",value:t}}function GK(t,e){return!!t&&!!t.parameters&&t.parameters.indexOf(e)>-1}function UK(t){return"data-driven"===t["property-type"]}function HK(t){return GK(t.expression,"measure-light")}function VK(t){return GK(t.expression,"zoom")}function QK(t){return!!t.expression&&t.expression.interpolated}function YK(t){return"object"===wW(t)&&null!==t&&!Array.isArray(t)}function WK(t){return t}function qK(t,e){var r,n,i,o="color"===e.type,a=t.stops&&"object"===wW(t.stops[0][0]),s=a||void 0!==t.property,u=a||!s,l=t.type||(QK(e)?"exponential":"interval");if(o&&((t=SW({},t)).stops&&(t.stops=t.stops.map(function(t){return[t[0],ZW.parse(t[1])]})),t.default?t.default=ZW.parse(t.default):t.default=ZW.parse(e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!fK[t.colorSpace])throw new Error("Unknown color space: ".concat(t.colorSpace));if("exponential"===l)r=ZK;else if("interval"===l)r=JK;else if("categorical"===l){r=KK,n=Object.create(null);var c,f=bW(t.stops);try{for(f.s();!(c=f.n()).done;){var h=c.value;n[h[0]]=h[1]}}catch(t){f.e(t)}finally{f.f()}i=wW(t.stops[0][0])}else{if("identity"!==l)throw new Error('Unknown function type "'.concat(l,'"'));r=$K}if(a){for(var p={},d=[],y=0;y=t.stops[n-1][0])return t.stops[n-1][1];var i=GX(t.stops.map(function(t){return t[0]}),r);return t.stops[i][1]}function ZK(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==pq(r))return XK(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var o=GX(t.stops.map(function(t){return t[0]}),r),a=function(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=WX[e.type]||WK;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=fK[t.colorSpace];l=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=arguments.length,e=new Array(t),r=0;r0&&"string"==typeof t[0]&&t[0]in BK}function rJ(t,e,r,n){var i=new zX(BK,[],e?function(t){var e={color:MW,string:TW,number:IW,enum:TW,boolean:OW,formatted:jW,resolvedImage:RW};if("array"===t.type)return DW(e[t.value]||LW,t.length);return e[t.type]}(e):void 0,void 0,void 0,r,n),o=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return o?FK(new tJ(o,e,r,n)):zK(i.errors)}var nJ=function(){return cW(function t(e,r,n){hW(this,t),this.kind=e,this._styleExpression=r,this.isLightConstant=n,this.isStateDependent="constant"!==e&&!RX(r.expression),this.isConfigDependent=!DX(r.expression)},[{key:"evaluateWithoutErrorHandling",value:function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)}},{key:"evaluate",value:function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)}}])}(),iJ=function(){return cW(function t(e,r,n,i,o){hW(this,t),this.kind=e,this.zoomStops=n,this._styleExpression=r,this.isStateDependent="camera"!==e&&!RX(r.expression),this.isLightConstant=o,this.isConfigDependent=!DX(r.expression),this.interpolationType=i},[{key:"evaluateWithoutErrorHandling",value:function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)}},{key:"evaluate",value:function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)}},{key:"interpolationFactor",value:function(t,e,r){return this.interpolationType?pK.interpolationFactor(this.interpolationType,t,e,r):0}}])}();function oJ(t,e,r,n){if("error"===(t=rJ(t,e,r,n)).result)return t;var i=t.value.expression,o=jX(i);if(!o&&!UK(e))return zK([new EW("","data expressions not supported")]);var a=BX(i,["zoom","pitch","distance-from-center"]);if(!a&&!VK(e))return zK([new EW("","zoom expressions not supported")]);var s=BX(i,["measure-light"]);if(!s&&!HK(e))return zK([new EW("","measure-light expression not supported")]);var u=e.expression&&e.expression.relaxZoomRestriction,l=function t(e){var r=null;if(e instanceof yK)r=t(e.result);else if(e instanceof dK){var n,i=bW(e.args);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(r=t(o))break}}catch(t){i.e(t)}finally{i.f()}}else(e instanceof UX||e instanceof pK)&&e.input instanceof bq&&"zoom"===e.input.name&&(r=e);if(r instanceof EW)return r;e.eachChild(function(e){var n=t(e);n instanceof EW?r=n:r&&n&&r!==n&&(r=new EW("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))});return r}(i);if(!(l||a||u))return zK([new EW("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')]);if(l instanceof EW)return zK([l]);if(l instanceof pK&&!QK(e))return zK([new EW("",'"interpolate" expressions cannot be used with this property')]);if(!l)return FK(new nJ(o?"constant":"source",t.value,s));var c=l instanceof pK?l.interpolation:void 0;return FK(new iJ(o?"camera":"composite",t.value,l.labels,c,s))}var aJ=function(){function t(e,r){hW(this,t),this._parameters=e,this._specification=r,SW(this,qK(this._parameters,this._specification))}return cW(t,null,[{key:"deserialize",value:function(e){return new t(e._parameters,e._specification)}},{key:"serialize",value:function(t){return{_parameters:t._parameters,_specification:t._specification}}}])}();function sJ(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function uJ(t){if(Array.isArray(t))return t.map(uJ);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=uJ(t[r]);return e}return sJ(t)}function lJ(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":var e,r=bW(t.slice(1));try{for(r.s();!(e=r.n()).done;){var n=e.value;if(!lJ(n)&&"boolean"!=typeof n)return!1}}catch(t){r.e(t)}finally{r.f()}return!0;default:return!0}}function cJ(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill";if(null===t||void 0===t)return{filter:function(){return!0},needGeometry:!1,needFeature:!1};lJ(t)||(t=dJ(t));var r=t,n=!0;try{n=function(t){if(!fJ(t))return t;var e=uJ(t);return function t(e){var r=!1,n=[];if("case"===e[0]){for(var i=1;i",">=","<","<=","to-boolean"]);function pJ(t,e){return te?1:0}function dJ(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?yJ(t[1],t[2],"=="):"!="===r?mJ(yJ(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?yJ(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(dJ))):"all"===r?["all"].concat(t.slice(1).map(dJ)):"none"===r?["all"].concat(t.slice(1).map(dJ).map(mJ)):"in"===r?gJ(t[1],t.slice(2)):"!in"===r?mJ(gJ(t[1],t.slice(2))):"has"===r?vJ(t[1]):"!has"!==r||mJ(vJ(t[1]))}function yJ(t,e,r){switch(t){case"$type":return["filter-type-".concat(r),e];case"$id":return["filter-id-".concat(r),e];default:return["filter-".concat(r),t,e]}}function gJ(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(function(t){return wW(t)!==wW(e[0])})?["filter-in-large",t,["literal",e.sort(pJ)]]:["filter-in-small",t,["literal",e]]}}function vJ(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function mJ(t){return["!",t]}var bJ={};!function(t){var e=function(){var t=function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r},e=[1,12],r=[1,13],n=[1,9],i=[1,10],o=[1,11],a=[1,14],s=[1,15],u=[14,18,22,24],l=[18,22],c=[22,24],f={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,r,n,i,o,a){var s=o.length-1;switch(i){case 1:this.$=new String(t.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(t),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=o[s-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=o[s-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[o[s-2],o[s]];break;case 16:this.$={},this.$[o[s][0]]=o[s][1];break;case 17:this.$=o[s-2],o[s-2][o[s][0]]=o[s][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[o[s]];break;case 21:this.$=o[s-2],o[s-2].push(o[s])}},table:[{3:5,4:e,5:6,6:r,7:3,8:n,9:4,10:i,11:o,12:1,13:2,15:7,16:8,17:a,23:s},{1:[3]},{14:[1,16]},t(u,[2,7]),t(u,[2,8]),t(u,[2,9]),t(u,[2,10]),t(u,[2,11]),t(u,[2,12]),t(u,[2,3]),t(u,[2,4]),t(u,[2,5]),t([14,18,21,22,24],[2,1]),t(u,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:r,7:3,8:n,9:4,10:i,11:o,13:23,15:7,16:8,17:a,23:s,24:[1,21],25:22},{1:[2,6]},t(u,[2,13]),{18:[1,24],22:[1,25]},t(l,[2,16]),{21:[1,26]},t(u,[2,18]),{22:[1,28],24:[1,27]},t(c,[2,20]),t(u,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:r,7:3,8:n,9:4,10:i,11:o,13:30,15:7,16:8,17:a,23:s},t(u,[2,19]),{3:5,4:e,5:6,6:r,7:3,8:n,9:4,10:i,11:o,13:31,15:7,16:8,17:a,23:s},t(l,[2,17]),t(l,[2,15]),t(c,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=this,r=[0],n=[null],i=[],o=this.table,a="",s=0,u=0,l=1,c=i.slice.call(arguments,1),f=Object.create(this.lexer),h={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(h.yy[p]=this.yy[p]);f.setInput(t,h.yy),h.yy.lexer=f,h.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var d=f.yylloc;i.push(d);var y=f.options&&f.options.ranges;"function"==typeof h.yy.parseError?this.parseError=h.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var g,v,m,b,A,x,w,_,S,E={};;){if(v=r[r.length-1],this.defaultActions[v]?m=this.defaultActions[v]:(null!==g&&void 0!==g||(S=void 0,"number"!=typeof(S=f.lex()||l)&&(S=e.symbols_[S]||S),g=S),m=o[v]&&o[v][g]),void 0===m||!m.length||!m[0]){var C="";for(A in _=[],o[v])this.terminals_[A]&&A>2&&_.push("'"+this.terminals_[A]+"'");C=f.showPosition?"Parse error on line "+(s+1)+":\n"+f.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.terminals_[g]||g)+"'":"Parse error on line "+(s+1)+": Unexpected "+(g==l?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(C,{text:f.match,token:this.terminals_[g]||g,line:f.yylineno,loc:d,expected:_})}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(m[0]){case 1:r.push(g),n.push(f.yytext),i.push(f.yylloc),r.push(m[1]),g=null,u=f.yyleng,a=f.yytext,s=f.yylineno,d=f.yylloc;break;case 2:if(x=this.productions_[m[1]][1],E.$=n[n.length-x],E._$={first_line:i[i.length-(x||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(x||1)].first_column,last_column:i[i.length-1].last_column},y&&(E._$.range=[i[i.length-(x||1)].range[0],i[i.length-1].range[1]]),void 0!==(b=this.performAction.apply(E,[a,u,s,h.yy,m[1],n,i].concat(c))))return b;x&&(r=r.slice(0,-1*x*2),n=n.slice(0,-1*x),i=i.slice(0,-1*x)),r.push(this.productions_[m[1]][0]),n.push(E.$),i.push(E._$),w=o[r[r.length-2]][r[r.length-1]],r.push(w);break;case 3:return!0}}return!0}},h={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var o in i)this[o]=i[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),o=0;oe[0].length)){if(e=r,n=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[o])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,r,n){switch(r){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function p(){this.yy={}}return f.lexer=h,p.prototype=f,f.Parser=p,new p}();t.parser=e,t.Parser=e.Parser,t.parse=function(){return e.parse.apply(e,arguments)}}(bJ);new Set(["vector","raster","raster-dem","raster-array","model","batched-model"]);var AJ={StyleExpression:tJ,isExpression:eJ,isExpressionFilter:lJ,createExpression:rJ,createPropertyExpression:oJ,normalizePropertyExpression:function(t,e,r,n){if(YK(t))return new aJ(t,e);if(eJ(t)||Array.isArray(t)&&t.length>0){var i=oJ(t,e,r,n);if("error"===i.result)throw new Error(i.value.map(function(t){return"".concat(t.key,": ").concat(t.message)}).join(", "));return i.value}var o=t;return"string"==typeof t&&"color"===e.type&&(o=ZW.parse(t)),{kind:"constant",isConfigDependent:!1,evaluate:function(){return o}}},ZoomConstantExpression:nJ,ZoomDependentExpression:iJ,StylePropertyFunction:aJ};function xJ(t){"@babel/helpers - typeof";return(xJ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function wJ(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return _J(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _J(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _J(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r0}function fZ(t){var e=function(t){var e,r,n=t.paint,i=void 0===n?{}:n,o=t.layout,a=void 0===o?{}:o,s=Object.keys(i).concat(Object.keys(a)),u=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=oZ(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(lZ);try{var l=function(){var t=r.value,n=s.some(function(e){return e.startsWith(t.prefix)});if(n)return e=t.type,1};for(u.s();!(r=u.n()).done&&!l(););}catch(t){u.e(t)}finally{u.f()}return e||uZ.symbol}(t);return sZ(sZ(sZ({},uZ.symbol,{type:"layout",name:"icon-image"}),uZ.line,{type:"paint",name:"line-pattern"}),uZ.fill,{type:"paint",name:"fill-pattern"})[e]}var hZ=["array","boolean","collator","format","literal","number","object","string","to-boolean","to-color","to-number","to-string","typeof","feature-state","geometry-type","id","line-progress","properties","at","get","has","length","!","!=","<","<=","==",">",">=","all","any","case","match","coalesce","interpolate","interpolate-hcl","interpolate-lab","step","let","var","concat","downcase","is-supported-script","resolved-locale","upcase","rgb","rgba","-","*","/","%","^","+","abs","acos","asin","atan","ceil","cos","e","floor","ln","ln2","log10","log2","max","min","pi","round","sin","sqrt","tan","zoom","heatmap-density"];function pZ(t){if(t&&t.length>0){var e=iZ(t,1)[0];return"string"==typeof e&&hZ.includes(e)}return!1}function dZ(t){return Object.keys(t).every(function(e){return!pZ(t[e])})}function yZ(t){return(cZ(t)?t:[t]).every(function(t){return dZ(t.paint||{})&&dZ(t.layout||{})})}var gZ=function(t){return["background-color","background-color-transition","background-pattern","background-pattern-transition","background-opacity","background-opacity-transition","fill-antialias","fill-opacity","fill-opacity-transition","fill-color","fill-color-transition","fill-outline-color","fill-outline-color-transition","fill-translate","fill-translate-transition","fill-translate-anchor","fill-pattern","fill-pattern-transition","fill-extrusion-opacity","fill-extrusion-opacity-transition","fill-extrusion-color","fill-extrusion-color-transition","fill-extrusion-translate","fill-extrusion-translate-transition","fill-extrusion-translate-anchor","fill-extrusion-pattern","fill-extrusion-pattern-transition","fill-extrusion-height","fill-extrusion-height-transition","fill-extrusion-base","fill-extrusion-base-transition","fill-extrusion-vertical-gradient","line-opacity","line-opacity-transition","line-color","line-color-transition","line-translate","line-translate-transition","line-translate-anchor","line-width","line-width-transition","line-gap-width","line-gap-width-transition","line-offset","line-offset-transition","line-blur","line-blur-transition","line-dasharray","line-dasharray-transition","line-pattern","line-pattern-transition","line-gradient","icon-opacity","icon-opacity-transition","icon-color","icon-color-transition","icon-halo-color","icon-halo-color-transition","icon-halo-width","icon-halo-width-transition","icon-halo-blur","icon-halo-blur-transition","icon-translate","icon-translate-transition","icon-translate-anchor","text-opacity","text-opacity-transition","text-color","text-color-transition","text-halo-color","text-halo-color-transition","text-halo-width","text-halo-width-transition","text-halo-blur","text-halo-blur-transition","text-translate","text-translate-transition","text-translate-anchor","raster-opacity","raster-opacity-transition","raster-hue-rotate","raster-hue-rotate-transition","raster-brightness-min","raster-brightness-min-transition","raster-brightness-max","raster-brightness-max-transition","raster-saturation","raster-saturation-transition","raster-contrast","raster-contrast-transition","raster-fade-duration","raster-resampling","circle-sort-key","circle-radius","circle-radius-transition","circle-color","circle-color-transition","circle-blur","circle-blur-transition","circle-opacity","circle-opacity-transition","circle-translate","circle-translate-transition","circle-translate-anchor","circle-pitch-scale","circle-pitch-alignment","circle-stroke-width","circle-stroke-width-transition","circle-stroke-color","circle-stroke-color-transition","circle-stroke-opacity","circle-stroke-opacity-transition","heatmap-radius","heatmap-radius-transition","heatmap-weight","heatmap-intensity","heatmap-intensity-transition","heatmap-color","heatmap-opacity","heatmap-opacity-transition","hillshade-illumination-direction","hillshade-illumination-anchor","hillshade-exaggeration","hillshade-exaggeration-transition","hillshade-shadow-color","hillshade-shadow-color-transition","hillshade-highlight-color","hillshade-highlight-color-transition","hillshade-accent-color","hillshade-accent-color-transition"].includes(t)};function vZ(t){"@babel/helpers - typeof";return(vZ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mZ(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function bZ(t){for(var e=1;e0}},{key:"removeSymbol",value:function(t){this.symbolManager.removeSymbol(t)}},{key:"getSymbol",value:function(t){return this.symbolManager.getSymbol(t)}},{key:"getLayerIds",value:function(t){return this.compositeSymbolRender.getLayerIds(t)||[]}},{key:"getLayerId",value:function(t){return this.compositeSymbolRender.getLayerId(t)}},{key:"removeLayerId",value:function(t){return this.compositeSymbolRender.removeLayerId(t)}},{key:"getLayer",value:function(t){var e=this.map.getLayerBySymbolBak(t),r=this.getLayerSymbol(t);if(e)return r?bZ(bZ({},e),{},{symbol:r}):e;var n=this.getLayerIds(t);if(n[0]){var i=this.map.getLayerBySymbolBak(n[0]);return i&&bZ(bZ({},i),{},{symbol:r,id:t})}}},{key:"removeLayer",value:function(t){var e=this,r=this.getLayerIds(t);r.length>0?(r.forEach(function(t){return e.map.style.removeLayer(t)}),this.removeLayerId(t)):this.map.style.removeLayer(t)}},{key:"getStyle",value:function(){var t=this,e=this.map.style.serialize();return this.hasSymbol()&&(e.layers=e.layers.reduce(function(e,r){var n=t.getLayerId(r.id);return n?!e.find(function(t){return t.id===n})&&e.push(bZ(bZ({},r),{},{symbol:t.getLayerSymbol(n),id:n})):t.getLayerSymbol(r.id)?e.push(bZ(bZ({},r),{},{symbol:t.getLayerSymbol(r.id)})):e.push(r),e},[])),e}},{key:"getFirstLayerId",value:function(t){return this.getLayerIds(t)[0]}},{key:"moveLayer",value:function(t,e){var r=this,n=this.getLayerIds(t),i=e&&this.map.style.getLayer(e),o=i&&i.id||e&&this.getFirstLayerId(e);n.length>0?n.forEach(function(t){return r.map.style.moveLayer(t,o)}):this.map.style.moveLayer(t,o)}},{key:"setFilter",value:function(t,e,r){var n=this;if(pZ(this.getLayerSymbol(t))){var i=this.getFirstLayerId(t);this.map.style.setFilter(i,e,r);var o=this.getLayerSymbol(t);this.setSymbol(t,o)}else{var a=this.getLayerIds(t);a.length>0?a.forEach(function(t){return n.map.style.setFilter(t,e,r)}):this.map.style.setFilter(t,e,r)}}},{key:"getFilter",value:function(t){var e=this.getFirstLayerId(t);if(this.map.style.getLayer(e))return this.map.style.getFilter(e)}},{key:"setLayerZoomRange",value:function(t,e,r){var n=this,i=this.getLayerIds(t);i.length>0?i.forEach(function(t){return n.map.style.setLayerZoomRange(t,e,r)}):this.map.style.setLayerZoomRange(t,e,r)}},{key:"setPaintProperty",value:function(t,e,r,n){var i=this,o=this.getLayerIds(t);o.length>0?o.forEach(function(t){return i.map.style.setPaintProperty(t,e,r,n)}):this.map.style.setPaintProperty(t,e,r,n)}},{key:"getPaintProperty",value:function(t,e){var r=this.getFirstLayerId(t);return this.map.style.getPaintProperty(r,e)}},{key:"setLayoutProperty",value:function(t,e,r,n){var i=this,o=this.getLayerIds(t);o.length>0?o.forEach(function(t){return i.map.style.setLayoutProperty(t,e,r,n)}):this.map.style.setLayoutProperty(t,e,r,n)}},{key:"getLayoutProperty",value:function(t,e){var r=this.getFirstLayerId(t);return this.map.style.getLayoutProperty(r,e)}},{key:"updateLayerSymbol",value:function(t){var e=this;Object.keys(this._layerSymbols).forEach(function(r){var n=e._layerSymbols[r];n.includes(t)&&e.setSymbol(r,n)})}},{key:"updateSymbol",value:function(t,e){return this.getSymbol(t)?yZ(e)?(this.symbolManager.addSymbol(t,e),void this.updateLayerSymbol(t)):this.map.fire("error",{error:new Error("Symbol is not supported expressions.")}):this.map.fire("error",{error:new Error('Symbol "'.concat(t,'" could not be loaded. Please make sure you have added the symbol with map.addSymbol().'))})}},{key:"setSymbolProperty",value:function(t,e,r,n){var i=this.getSymbol(t);if(!i)return this.map.fire("error",{error:new Error('Symbol "'.concat(t,'" could not be loaded. Please make sure you have added the symbol with map.addSymbol().'))});if(pZ(n))return this.map.fire("error",{error:new Error("Symbol value is not supported expressions.")});var o=gZ(r)?"paint":"layout";if(i.length>0){var a=i[e];if(!a)return this.map.fire("error",{error:new Error("symbol[".concat(e,"] does not exist."))});a[o]||(a[o]={}),Object.assign(a[o],AZ({},r,n))}else i[o]||(i[o]={}),Object.assign(i[o],AZ({},r,n));this.symbolManager.addSymbol(t,i),this.updateLayerSymbol(t)}},{key:"getSymbolProperty",value:function(t,e,r){var n=this.getSymbol(t);if(n){var i=gZ(r)?"paint":"layout";return n.length>0?n[e]&&n[e][i]&&n[e][i][r]:n[i]&&n[i][r]}this.map.fire("error",{error:new Error('Symbol "'.concat(t,'" could not be loaded. Please make sure you have added the symbol with map.addSymbol().'))})}}])&&xZ(t.prototype,e),r&&xZ(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function SZ(t){"@babel/helpers - typeof";return(SZ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function EZ(){EZ=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new O(n||[]);return i(a,"_invoke",{value:C(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",g={};function v(){}function m(){}function b(){}var A={};l(A,a,function(){return this});var x=Object.getPrototypeOf,w=x&&x(x(M([])));w&&w!==r&&n.call(w,a)&&(A=w);var _=b.prototype=v.prototype=Object.create(A);function S(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function E(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==SZ(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function C(e,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function CZ(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function kZ(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){CZ(o,n,i,a,s,"next",t)}function s(t){CZ(o,n,i,a,s,"throw",t)}a(void 0)})}}var IZ=function(){var t=function(t){return I().Map.prototype.symbolHandler||(I().Map.prototype.symbolHandler=new _Z(t)),I().Map.prototype.symbolHandler._update(t)};function e(){return(e=kZ(EZ().mark(function t(e,r){var n,i,o,a,s,u;return EZ().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="".concat(r.basePath,"/").concat(e,"/").concat(e),t.next=4,ut.get("".concat(n,".json")).then(function(t){return t.ok?t.json():null}).catch(function(){return null});case 4:if(i=t.sent){t.next=7;break}return t.abrupt("return",null);case 7:if(o=i.paint||{},a=i.layout||{},s=o["fill-pattern"]||o["line-pattern"]||a["icon-image"],t.t0=s,!t.t0){t.next=15;break}return t.next=14,new Promise(function(t){var e=new Image;e.src="".concat(n,".png"),e.onload=function(r){t(r?e:null)},e.onerror=function(){t(null)}});case 14:t.t0=t.sent;case 15:return u=t.t0,t.abrupt("return",{value:i,image:u});case 17:case"end":return t.stop()}},t)}))).apply(this,arguments)}function r(r,n){return function(t,r){return e.apply(this,arguments)}(r,n).then(function(e){if(!e)return null;var r=e.value,i=e.image;return i&&t(n).addSymbolImageToMap(r,i),r})}void 0===I().Map.prototype.addLayerBySymbolBak&&(I().Map.prototype.addLayerBySymbolBak=I().Map.prototype.addLayer,I().Map.prototype.addLayer=function(e,r){var n=t(this);if(!(n.getLayerIds(e.id).length>0))return e.symbol?(n.addLayer(e,r),this):(this.addLayerBySymbolBak(e,r),this);this.fire("error",{error:new Error("A layer with this id already exists.")})}),void 0===I().Map.prototype.getLayerBySymbolBak&&(I().Map.prototype.getLayerBySymbolBak=I().Map.prototype.getLayer,I().Map.prototype.getLayer=function(e){return t(this).getLayer(e)}),void 0===I().Map.prototype.moveLayerBySymbolBak&&(I().Map.prototype.moveLayerBySymbolBak=I().Map.prototype.moveLayer,I().Map.prototype.moveLayer=function(e,r){return!this.style.getLayer(e)||r&&!this.style.getLayer(r)?(t(this).moveLayer(e,r),this._update(!0)):this.moveLayerBySymbolBak(e,r)}),void 0===I().Map.prototype.removeLayerBySymbolBak&&(I().Map.prototype.removeLayerBySymbolBak=I().Map.prototype.removeLayer,I().Map.prototype.removeLayer=function(e){return this.style.getLayer(e)?this.removeLayerBySymbolBak(e):t(this).removeLayer(e)}),void 0===I().Map.prototype.setLayoutPropertyBySymbolBak&&(I().Map.prototype.setLayoutPropertyBySymbolBak=I().Map.prototype.setLayoutProperty,I().Map.prototype.setLayoutProperty=function(e,r,n,i){return this.overlayLayersManager[e]||this.style.getLayer(e)?this.setLayoutPropertyBySymbolBak(e,r,n,i):(t(this).setLayoutProperty(e,r,n,i),this._update(!0))}),I().Map.prototype.setSymbol=function(e,r){t(this).setSymbol(e,r)},I().Map.prototype.setStyleBak||(I().Map.prototype.setStyleBak=I().Map.prototype.setStyle,I().Map.prototype.setStyle=function(t,e){var r=this;return this.setStyleBak(t,e),this.style&&this.style.once("style.load",function(){t.layers.filter(function(t){return t.symbol}).forEach(function(t){r.setSymbol(t.id,t.symbol)})}),this}),I().Map.prototype.loadSymbol=(n=kZ(EZ().mark(function t(e,n){var i,o,a,s,u,l,c=this;return EZ().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("string"!=typeof e){t.next=9;break}return t.next=3,r(e,this);case 3:i=t.sent,o=null,i||(o="Symbol ".concat(e," is not exists")),n(o,i),t.next=21;break;case 9:if(!$.isArray(e)){t.next=20;break}return a=e.map(function(t){return r(t,c)}),t.next=13,Promise.all(a);case 13:s=t.sent,u=null,(l=e.filter(function(t,e){return!s[e]})).length>0&&(u="Symbol ".concat(l.join(",")," is not exists")),n(u,s),t.next=21;break;case 20:n({message:"Symbol id must be a string or string[]."});case 21:case"end":return t.stop()}},t,this)})),function(t,e){return n.apply(this,arguments)}),I().Map.prototype.addSymbol=function(e,r){t(this).addSymbol(e,r)},I().Map.prototype.getSymbol=function(e){return t(this).getSymbol(e)},I().Map.prototype.hasSymbol=function(t){return t?!!this.getSymbol(t):(this.fire("error",{error:new Error("Missing required symbol id")}),!1)},I().Map.prototype.removeSymbol=function(e){t(this).removeSymbol(e)},I().Map.prototype.updateSymbol=function(e,r){t(this).updateSymbol(e,r)},I().Map.prototype.setSymbolProperty=function(e,r,n,i){t(this).setSymbolProperty(e,r,n,i)},I().Map.prototype.getSymbolProperty=function(e,r,n){return t(this).getSymbolProperty(e,r,n)},I().Map.prototype.getStyle=function(){if(this.style)return t(this).getStyle()},I().Map.prototype.setFilter=function(e,r,n){return this.style.getLayer(e)?(this.style.setFilter(e,r,n),this._update(!0)):(t(this).setFilter(e,r,n),this._update(!0))},I().Map.prototype.getFilter=function(e){return this.style.getLayer(e)?this.style.getFilter(e):t(this).getFilter(e)},I().Map.prototype.setLayerZoomRange=function(e,r,n){return this.style.getLayer(e)?(this.style.setLayerZoomRange(e,r,n),this._update(!0)):(t(this).setLayerZoomRange(e,r,n),this._update(!0))},I().Map.prototype.setPaintProperty=function(e,r,n,i){return this.style.getLayer(e)?(this.style.setPaintProperty(e,r,n,i),this._update(!0)):(t(this).setPaintProperty(e,r,n,i),this._update(!0))},I().Map.prototype.getPaintProperty=function(e,r){return this.style.getLayer(e)?this.style.getPaintProperty(e,r):t(this).getPaintProperty(e,r)},I().Map.prototype.getLayoutProperty=function(e,r){return this.style.getLayer(e)?this.style.getLayoutProperty(e,r):t(this).getLayoutProperty(e,r)},void 0===I().Map.prototype.onBak&&(I().Map.prototype.onBak=I().Map.prototype.on,I().Map.prototype.on=function(e,r,n){var i=this;return void 0===n||this.style.getLayer(r)?this.onBak(e,r,n):(t(this).getLayerIds(r).forEach(function(t){return i.onBak(e,t,n)}),this)}),void 0===I().Map.prototype.onceBak&&(I().Map.prototype.onceBak=I().Map.prototype.once,I().Map.prototype.once=function(e,r,n){var i=this;return void 0===n||this.style.getLayer(r)?this.onceBak(e,r,n):(t(this).getLayerIds(r).forEach(function(t){return i.onceBak(e,t,n)}),this)}),void 0===I().Map.prototype.offBak&&(I().Map.prototype.offBak=I().Map.prototype.off,I().Map.prototype.off=function(e,r,n){var i=this;return void 0===n||this.style.getLayer(r)?this.offBak(e,r,n):(t(this).getLayerIds(r).forEach(function(t){return i.offBak(e,t,n)}),this)});var n};function TZ(t){"@babel/helpers - typeof";return(TZ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function OZ(t,e){for(var r=0;r=0){var e=JSON.parse(t.data);return t.filterParam=e,t.eventType="setFilterParamSucceeded",void this.events.triggerEvent("setFilterParamSucceeded",t)}var r=JSON.parse(t.data);t.featureResult=r,t.eventType="messageSucceeded",this.events.triggerEvent("messageSucceeded",t)}},{key:"_connect",value:function(t){return t=JA.appendCredential(t),"WebSocket"in window?new WebSocket(t):"MozWebSocket"in window?new(0,window.MozWebSocket)(t):(console.log("no WebSocket"),null)}}])&&J$(r.prototype,n),i&&J$(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function n0(t){"@babel/helpers - typeof";return(n0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i0(t,e){for(var r=0;r=0&&n.toIndex>=0&&!i&&(n.url=$.urlAppend(n.url,"fromIndex=".concat(n.fromIndex,"&toIndex=").concat(n.toIndex))),n.returnContent&&(t.returnCountOnly||t.returnDatasetInfoOnly||t.returnFeaturesOnly||console.warn("recommend set returnFeaturesOnly config to true to imporve performance. if need get Total amount and Dataset information. FeatureService provide getFeaturesCount and getFeaturesDatasetInfo method"),t.returnCountOnly&&(n.url=$.urlAppend(n.url,"returnCountOnly="+t.returnCountOnly)),t.returnDatasetInfoOnly&&(n.url=$.urlAppend(n.url,"returnDatasetInfoOnly="+t.returnDatasetInfoOnly)),t.returnFeaturesOnly&&(n.url=$.urlAppend(n.url,"returnFeaturesOnly="+t.returnFeaturesOnly))),r=n.getJsonParameters(t),n.request({method:"POST",data:r,scope:n,success:e,failure:e})}}},{key:"transformResult",value:function(t,e){t=$.transformResult(t);var r=new Ei;(this.format===En.GEOJSON&&t.features&&(t.features=r.toGeoJSON(t.features)),this.returnFeaturesOnly&&Array.isArray(t))&&(t={succeed:t.succeed,features:r.toGeoJSON(t)});return{result:t,options:e}}},{key:"dataFormat",value:function(){return[En.GEOJSON,En.ISERVER,En.FGB]}}])&&h1(r.prototype,n),i&&h1(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function b1(t){"@babel/helpers - typeof";return(b1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function A1(t,e){for(var r=0;r0;)t.fields.pop();t.fields=null}}}])&&I1(r.prototype,n),i&&I1(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function j1(t){"@babel/helpers - typeof";return(j1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function R1(t,e){for(var r=0;r0;)t.fields.pop();t.fields=null}t.attributeFilter=null,t.spatialQueryMode=null,t.getFeatureMode=null}}])&&a2(r.prototype,n),i&&a2(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function p2(t){"@babel/helpers - typeof";return(p2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d2(t,e){for(var r=0;r0;)t.fields.pop();t.fields=null}t.geometry&&(t.geometry.destroy(),t.geometry=null)}}])&&w2(r.prototype,n),i&&w2(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function T2(t){"@babel/helpers - typeof";return(T2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function O2(t,e){for(var r=0;r0;)t.fields.pop();t.fields=null}t.attributeFilter=null,t.spatialQueryMode=null,t.getFeatureMode=null,t.orderBy=null}}])&&B2(r.prototype,n),i&&B2(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Q2(t){"@babel/helpers - typeof";return(Q2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Y2(t,e){for(var r=0;r0)for(var r in t.items)t.items[r].destroy(),t.items[r]=null;t.items=null}t.defaultStyle&&(t.defaultStyle.destroy(),t.defaultStyle=null)}},{key:"toServerJSONObject",value:function(){var t={};if((t=$.copyAttributes(t,this)).defaultStyle&&t.defaultStyle.toServerJSONObject&&(t.defaultStyle=t.defaultStyle.toServerJSONObject()),t.items){for(var e=[],r=t.items.length,n=0;n0)for(var r in t.items)t.items[r].destroy(),t.items[r]=null;t.items=null}t.rangeExpression=null,t.rangeMode=null,t.rangeParameter=null,t.colorGradientType=null}}])&&U6(r.prototype,n),i&&U6(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function X6(t){"@babel/helpers - typeof";return(X6="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function K6(t,e){for(var r=0;r0?t[0].subLayers.layers:null)?r.length:0,this.handleLayers(n,r),{result:t[0],options:e}}},{key:"handleLayers",value:function(t,e){var r;if(t)for(var n=0;n0)this.handleLayers(e[n].subLayers.layers.length,e[n].subLayers.layers);else switch(e[n].ugcLayerType){case"THEME":(r=new O8).fromJson(e[n]),e[n]=r;break;case"GRID":(r=new U8).fromJson(e[n]),e[n]=r;break;case"IMAGE":(r=new K8).fromJson(e[n]),e[n]=r;break;case"VECTOR":(r=new i7).fromJson(e[n]),e[n]=r}}}}])&&a7(r.prototype,n),i&&a7(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function p7(t){"@babel/helpers - typeof";return(p7="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d7(t,e){for(var r=0;r0&&(n+='"subLayers":'+t.toJSON()),n+=',"visible":true,',n+='"name":"'+this.getMapName(this.mapUrl)+'"',n+="}]",r.request({method:"PUT",data:n,scope:r,success:e,failure:e})}}},{key:"createTempLayerComplete",value:function(t,e){return e=e.result?e.result:e,(e=$.transformResult(e)).succeed&&(this.lastparams.resourceID=e.newResourceID),this.processAsync(this.lastparams,t)}},{key:"getMapName",value:function(t){var e=t;"/"===e.charAt(e.length-1)&&(e=e.substr(0,e.length-1));var r=e.lastIndexOf("/");return e.substring(r+1,e.length)}},{key:"transformResult",value:function(t,e){return null!=(t=$.transformResult(t))&&null!=this.lastparams&&null!=this.lastparams.resourceID&&(t.newResourceID=this.lastparams.resourceID),{result:t,options:e}}}])&&U7(r.prototype,n),i&&U7(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function X7(t){"@babel/helpers - typeof";return(X7="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function K7(t,e){for(var r=0;r=200&&t.code<300||0==t.code||304===t.code,n=t.code&&r;return!t.code||n?{result:t,options:e}:{error:t,options:e}}}])&&s9(r.prototype,n),i&&s9(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function d9(t){"@babel/helpers - typeof";return(d9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function y9(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[i].x+',"y":'+e[i].y+"}";else if(!0===t)for(var o=0;o0&&(r+=","),r+=e[o];return r+="]"}}])&&ktt(r.prototype,n),i&&ktt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Ntt(t){"@babel/helpers - typeof";return(Ntt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jtt(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[i].x+',"y":'+e[i].y+"}";else if(!0===t)for(var o=0;o0&&(r+=","),r+=e[o];return r+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.facilityPathList)return t;var e=new Ei;return t.facilityPathList.map(function(t){return t.route&&(t.route=e.toGeoJSON(t.route)),t.pathGuideItems&&(t.pathGuideItems=e.toGeoJSON(t.pathGuideItems)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures)),t}),t}}])&&wet(r.prototype,n),i&&wet(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Oet(t){"@babel/helpers - typeof";return(Oet="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Met(t,e){for(var r=0;r0&&(e+=","),e+=$.toJSON(t[n]);return e+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t)return null;var e=new Ei;return t.demandResults&&(t.demandResults=e.toGeoJSON(t.demandResults)),t.supplyResults&&(t.supplyResults=e.toGeoJSON(t.supplyResults)),t}}])&&jet(r.prototype,n),i&&jet(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Uet(t){"@babel/helpers - typeof";return(Uet="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Het(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[i].x+',"y":'+e[i].y+"}";else if(!0===t)for(var o=0;o0&&(r+=","),r+=e[o];return r+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.pathList)return null;var e=new Ei;return t.pathList.map(function(t){return t.route&&(t.route=e.toGeoJSON(t.route)),t.pathGuideItems&&(t.pathGuideItems=e.toGeoJSON(t.pathGuideItems)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures)),t}),t}}])&&Wet(r.prototype,n),i&&Wet(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function trt(t){"@babel/helpers - typeof";return(trt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ert(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[i].x+',"y":'+e[i].y+"}";else if(!0===t)for(var o=0;o0&&(r+=","),r+=e[o];return r+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.pathList||t.pathList.length<1)return null;var e=new Ei;return t.pathList.forEach(function(t){t.route&&(t.route=e.toGeoJSON(t.route)),t.pathGuideItems&&(t.pathGuideItems=e.toGeoJSON(t.pathGuideItems)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures))}),t}}])&&ort(r.prototype,n),i&&ort(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function hrt(t){"@babel/helpers - typeof";return(hrt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function prt(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[i].x+',"y":'+e[i].y+"}";else if(!0===t)for(var o=0;o0&&(r+=","),r+=e[o];return r+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.serviceAreaList)return t;var e=new Ei;return t.serviceAreaList.map(function(t){return t.serviceRegion&&(t.serviceRegion=e.toGeoJSON(t.serviceRegion)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures)),t.routes&&(t.routes=e.toGeoJSON(t.routes)),t}),t}}])&&vrt(r.prototype,n),i&&vrt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Srt(t){"@babel/helpers - typeof";return(Srt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ert(t,e){for(var r=0;r0&&(e+=","),e+='{"x":'+i[r].x+',"y":'+i[r].y+"}";o+=e+="]"}else if(!0===t.isAnalyzeById){for(var a="[",s=t.nodes,u=s.length,l=0;l0&&(a+=","),a+=s[l];o+=a+="]"}return o}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.tspPathList)return null;var e=new Ei;return t.tspPathList.forEach(function(t){t.route&&(t.route=e.toGeoJSON(t.route)),t.pathGuideItems&&(t.pathGuideItems=e.toGeoJSON(t.pathGuideItems)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures))}),t}}])&&Trt(r.prototype,n),i&&Trt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Rrt(t){"@babel/helpers - typeof";return(Rrt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Drt(t,e){for(var r=0;r0)for(var e in t.items)t.items[e].destroy(),t.items[e]=null;t.items=null}t.numericPrecision=null,t.rangeMode=null,t.rangeCount=null,t.colorGradientType=null}}])&&Aot(t.prototype,e),r&&Aot(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function _ot(t){"@babel/helpers - typeof";return(_ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sot(t,e){for(var r=0;r=0;t--)this.points[t].destroy();this.points=null}}}])&&Ddt(r.prototype,n),i&&Ddt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Vdt(t){"@babel/helpers - typeof";return(Vdt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qdt(t,e){for(var r=0;r0&&(1===i.length?r+="'displayFilter':\""+i[0]+'",':r+="'displayFilter':\""+i[a]+'",'),(o=t.displayOrderBy)&&o.length>0&&(1===o.length?r+="'displayOrderBy':'"+o[0]+"',":r+="'displayOrderBy':'"+o[a]+"',"),(e=t.fieldValuesDisplayFilter)&&(r+="'fieldValuesDisplayFilter':"+$.toJSON(e)+","),t.joinItems&&t.joinItems.length>0&&t.joinItems[a]&&(r+="'joinItems':["+$.toJSON(t.joinItems[a])+"],"),t.datasetNames&&t.dataSourceNames){var u=t.datasetNames[a]?a:t.datasetNames.length-1,l=t.dataSourceNames[a]?a:t.dataSourceNames.length-1;r+="'datasetInfo': {'name': '"+t.datasetNames[u]+"','dataSourceName': '"+t.dataSourceNames[l]+"'}},"}else r+="},"}t.themes&&t.themes.length>0&&(r=r.substring(0,r.length-1)),r+="]},";var c=this.url.split("/");return r+="'name': '"+c[c.length-2]+"'}]"}}])&&igt(r.prototype,n),i&&igt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function fgt(t){"@babel/helpers - typeof";return(fgt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hgt(t,e){for(var r=0;r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function pvt(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function dvt(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){pvt(o,n,i,a,s,"next",t)}function s(t){pvt(o,n,i,a,s,"throw",t)}a(void 0)})}}function yvt(t,e){for(var r=0;r0&&i.push(","),r=e[o].geometry,i.push(this.extractGeometry(r));return n&&i.push(")"),i.join("")}},{key:"extractGeometry",value:function(t){var e=t.CLASS_NAME.split(".")[2].toLowerCase();return this.extract[e]?("collection"===e?"GEOMETRYCOLLECTION":e.toUpperCase())+"("+this.extract[e].apply(this,[t])+")":null}}])&&lmt(r.prototype,n),i&&lmt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function ymt(t){"@babel/helpers - typeof";return(ymt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gmt(t,e){for(var r=0;r=0?e.speed:1,this.frequency=e.speed&&e.frequency>=0?e.frequency:1e3,this.startTime=e.startTime&&null!=e.startTime?e.startTime:0,this.endTime=e.endTime&&null!=e.endTime&&e.endTime>=r.startTime?e.endTime:+new Date,this.repeat=void 0===e.repeat||e.repeat,this.reverse=void 0!==e.reverse&&e.reverse,this.currentTime=null,this.oldTime=null,this.running=!1,this.EVENT_TYPES=["start","pause","stop"],r.events=new Xa(this,null,this.EVENT_TYPES),r.speed=Number(r.speed),r.frequency=Number(r.frequency),r.startTime=Number(r.startTime),r.endTime=Number(r.endTime),r.startTime=Date.parse(new Date(r.startTime)),r.endTime=Date.parse(new Date(r.endTime)),r.currentTime=r.startTime,this.CLASS_NAME="SuperMap.TimeControlBase"},(e=[{key:"updateOptions",value:function(t){var e=this;(t=t||{}).speed&&t.speed>=0&&(e.speed=t.speed,e.speed=Number(e.speed)),t.speed&&t.frequency>=0&&(e.frequency=t.frequency,e.frequency=Number(e.frequency)),t.startTime&&null!=t.startTime&&(e.startTime=t.startTime,e.startTime=Date.parse(new Date(e.startTime))),t.endTime&&null!=t.endTime&&t.endTime>=e.startTime&&(e.endTime=t.endTime,e.endTime=Date.parse(new Date(e.endTime))),null!=t.repeat&&(e.repeat=t.repeat),null!=t.reverse&&(e.reverse=t.reverse)}},{key:"start",value:function(){var t=this;t.running||(t.running=!0,t.tick(),t.events.triggerEvent("start",t.currentTime))}},{key:"pause",value:function(){this.running=!1,this.events.triggerEvent("pause",this.currentTime)}},{key:"stop",value:function(){var t=this;t.currentTime=t.startTime,t.running&&(t.running=!1),t.events.triggerEvent("stop",t.currentTime)}},{key:"toggle",value:function(){this.running?this.pause():this.start()}},{key:"setSpeed",value:function(t){return t>=0&&(this.speed=t,!0)}},{key:"getSpeed",value:function(){return this.speed}},{key:"setFrequency",value:function(t){return t>=0&&(this.frequency=t,!0)}},{key:"getFrequency",value:function(){return this.frequency}},{key:"setStartTime",value:function(t){var e=this;return!((t=Date.parse(new Date(t)))>e.endTime)&&(e.startTime=t,e.currentTime=e.endTime&&(e.currentTime=e.startTime,e.tick()),!0)}},{key:"getEndTime",value:function(){return this.endTime}},{key:"setCurrentTime",value:function(t){var e=this;return e.currentTime=Date.parse(new Date(e.currentTime)),t>=e.startTime&&t<=e.endTime&&(e.currentTime=t,e.startTime=e.currentTime,e.tick(),!0)}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"setRepeat",value:function(t){this.repeat=t}},{key:"getRepeat",value:function(){return this.repeat}},{key:"setReverse",value:function(t){this.reverse=t}},{key:"getReverse",value:function(){return this.reverse}},{key:"getRunning",value:function(){return this.running}},{key:"destroy",value:function(){var t=this;t.speed=null,t.frequency=null,t.startTime=null,t.endTime=null,t.currentTime=null,t.repeat=null,t.running=!1,t.reverse=null}},{key:"tick",value:function(){}}])&&gmt(t.prototype,e),r&&gmt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function bmt(t){"@babel/helpers - typeof";return(bmt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Amt(t,e){for(var r=0;r=t.endTime&&(t.currentTime=t.endTime)}}}])&&Amt(r.prototype,n),i&&Amt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function kmt(t){"@babel/helpers - typeof";return(kmt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Imt(t,e){for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:{headers:this.headers,crossOrigin:this.crossOrigin,withCredentials:this.withCredentials};return e=JA.appendCredential(e),ut.commit(t,e,r,n).then(function(t){return t.json()})}}])&&Hmt(t.prototype,e),r&&Hmt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Ymt(t){"@babel/helpers - typeof";return(Ymt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wmt(t,e){for(var r=0;r0)for(var r in t.items)t.items[r].destroy(),t.items[r]=null;t.items=null}t.reverseColor=null,t.rangeMode=null,t.rangeParameter=null,t.colorGradientType=null}}])&&Kxt(r.prototype,n),i&&Kxt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function nwt(t){"@babel/helpers - typeof";return(nwt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function iwt(t,e){for(var r=0;r0)for(var r in t.items)t.items[r].destroy(),t.items[r]=null;t.items=null}t.defaultcolor&&(t.defaultcolor.destroy(),t.defaultcolor=null)}},{key:"toServerJSONObject",value:function(){var t={};if((t=$.copyAttributes(t,this)).defaultcolor&&t.defaultcolor.toServerJSONObject&&(t.defaultcolor=t.defaultcolor.toServerJSONObject()),t.items){for(var e=[],r=t.items.length,n=0;n0&&(t=t.substring(0,t.length-1)),"{"+t+"}"}return null}}])&&Awt(t.prototype,e),r&&Awt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function _wt(t){"@babel/helpers - typeof";return(_wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Swt(t,e){for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:{};return e=JA.appendCredential(e),n.crossOrigin=this.options.crossOrigin,n.headers=this.options.headers,ut.commit(t,e,r,n).then(function(t){return t.json()})}}])&&SSt(t.prototype,e),r&&SSt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function kSt(t){"@babel/helpers - typeof";return(kSt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ISt(t,e){for(var r=0;r=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}var cEt=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,fEt=function(t){return cEt.exec(t).slice(1)};function hEt(){for(var t="",e=!1,r=arguments.length-1;r>=-1&&!e;r--){var n=r>=0?arguments[r]:"/";if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");n&&(t=n+"/"+t,e="/"===n.charAt(0))}return(e?"/":"")+(t=lEt(xEt(t.split("/"),function(t){return!!t}),!e).join("/"))||"."}function pEt(t){var e=dEt(t),r="/"===wEt(t,-1);return(t=lEt(xEt(t.split("/"),function(t){return!!t}),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t}function dEt(t){return"/"===t.charAt(0)}function yEt(){return pEt(xEt(Array.prototype.slice.call(arguments,0),function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))}function gEt(t,e){function r(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=hEt(t).substr(1),e=hEt(e).substr(1);for(var n=r(t.split("/")),i=r(e.split("/")),o=Math.min(n.length,i.length),a=o,s=0;s1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),t.exports=e,process.on("uncaughtException",function(t){if(!("unwind"===t||t instanceof T||t.context instanceof T))throw t}),e.inspect=function(){return"[Emscripten Module object]"}}else(o||a)&&(a?u=self.location.href:"undefined"!=typeof document&&document.currentScript&&(u=document.currentScript.src),u=0!==u.indexOf("blob:")?u.substr(0,u.replace(/[?#].*/,"").lastIndexOf("/")+1):"",r=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},a&&(n=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}));e.print||console.log.bind(console);var f,h,p=e.printErr||console.error.bind(console);Object.assign(e,i),i=null,e.arguments&&e.arguments,e.thisProgram&&e.thisProgram,e.quit&&e.quit,e.wasmBinary&&(f=e.wasmBinary),"object"!=("undefined"==typeof WebAssembly?"undefined":nEt(WebAssembly))&&w("no native wasm support detected");var d,y=!1;function g(){var t=h.buffer;e.HEAP8=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAPU8=d=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAP32=new Int32Array(t),e.HEAPU32=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var v=[],m=[],b=[],A=0,x=null;function w(t){throw e.onAbort&&e.onAbort(t),p(t="Aborted("+t+")"),y=!0,t+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(t)}var _,S,E="data:application/octet-stream;base64,",C=function(t){return t.startsWith(E)},k=function(t){return t.startsWith("file://")};function I(t){return Promise.resolve().then(function(){return function(t){if(t==_&&f)return new Uint8Array(f);var e=function(t){if(C(t))return function(t){if(void 0!==s&&s){var e=Buffer.from(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.length)}for(var r=atob(t),n=new Uint8Array(r.length),i=0;i0;)t.shift()(e)};e.noExitRuntime;var M,P=function(t){var e=(t-h.buffer.byteLength+65535)/65536;try{return h.grow(e),g(),1}catch(t){}},L={b:function(){w("")},a:function(t){var e=d.length,r=2147483648;if((t>>>=0)>r)return!1;for(var n,i,o=1;o<=4;o*=2){var a=e*(1+.2/o);a=Math.min(a,t+100663296);var s=Math.min(r,(n=Math.max(t,a))+((i=65536)-n%i)%i);if(P(s))return!0}return!1}},N=function(){var t={a:L};function r(t,r){var n;return N=t.exports,h=N.c,g(),n=N.d,m.unshift(n),function(t){if(A--,e.monitorRunDependencies&&e.monitorRunDependencies(A),0==A&&x){var r=x;x=null,r()}}(),N}if(A++,e.monitorRunDependencies&&e.monitorRunDependencies(A),e.instantiateWasm)try{return e.instantiateWasm(t,r)}catch(t){return p("Module.instantiateWasm callback failed with error: ".concat(t)),!1}return function(t,e,r,n){(function(t,e,r){I(t).then(function(t){return WebAssembly.instantiate(t,e)}).then(function(t){return t}).then(r,function(t){p("failed to asynchronously prepare wasm: ".concat(t)),w(t)})})(e,r,n)}(0,_,t,function(t){r(t.instance)}),{}}();function j(){function t(){M||(M=!0,e.calledRun=!0,y||(O(m),e.onRuntimeInitialized&&e.onRuntimeInitialized(),function(){if(e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)t=e.postRun.shift(),b.unshift(t);var t;O(b)}()))}A>0||(function(){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)t=e.preRun.shift(),v.unshift(t);var t;O(v)}(),A>0||(e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),t()},1)):t()))}if(e._UGCWasm_CipherAES_New=function(t,r,n){return(e._UGCWasm_CipherAES_New=N.e)(t,r,n)},e._UGCWasm_CipherAES_Encrypt=function(t,r,n){return(e._UGCWasm_CipherAES_Encrypt=N.f)(t,r,n)},e._UGCWasm_CipherAES_Decrypt=function(t,r,n){return(e._UGCWasm_CipherAES_Decrypt=N.g)(t,r,n)},e._malloc=function(t){return(e._malloc=N.i)(t)},e._free=function(t){return(e._free=N.j)(t)},x=function t(){M||j(),M||(x=t)},e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();return j(),e}();t.exports=r}(sEt);var SEt=oEt(sEt.exports);function EEt(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:256;return t.byteLength<=e?t:t.subarray(0,e)}(n,e.decodeSize),o=t.Module;if(e.decrypt)r=EEt(e.decrypt({key:e.key,bytes:i}),n);else{var a=function(t){var e;return kEt[t]?e=kEt[t]:(e=function(t){return function(t){try{for(var e=atob(t),r=e.length,n=Math.ceil(r/32),i=new Array(n),o=0;o1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),t.exports=e,process.on("uncaughtException",function(t){if(!("unwind"===t||t instanceof T||t.context instanceof T))throw t}),e.inspect=function(){return"[Emscripten Module object]"}}else(o||a)&&(a?u=self.location.href:"undefined"!=typeof document&&document.currentScript&&(u=document.currentScript.src),u=0!==u.indexOf("blob:")?u.substr(0,u.replace(/[?#].*/,"").lastIndexOf("/")+1):"",r=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},a&&(n=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}));e.print||console.log.bind(console);var f,h,p=e.printErr||console.error.bind(console);Object.assign(e,i),i=null,e.arguments&&e.arguments,e.thisProgram&&e.thisProgram,e.quit&&e.quit,e.wasmBinary&&(f=e.wasmBinary),"object"!=("undefined"==typeof WebAssembly?"undefined":nEt(WebAssembly))&&w("no native wasm support detected");var d,y=!1;function g(){var t=h.buffer;e.HEAP8=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAPU8=d=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAP32=new Int32Array(t),e.HEAPU32=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var v=[],m=[],b=[],A=0,x=null;function w(t){throw e.onAbort&&e.onAbort(t),p(t="Aborted("+t+")"),y=!0,t+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(t)}var _,S,E="data:application/octet-stream;base64,",C=function(t){return t.startsWith(E)},k=function(t){return t.startsWith("file://")};function I(t,e,r){return function(t){return Promise.resolve().then(function(){return function(t){if(t==_&&f)return new Uint8Array(f);var e=function(t){if(C(t))return function(t){if(void 0!==s&&s){var e=Buffer.from(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.length)}for(var r=atob(t),n=new Uint8Array(r.length),i=0;i0;)t.shift()(e)};e.noExitRuntime;var M,P=function(t){var e=(t-h.buffer.byteLength+65535)/65536;try{return h.grow(e),g(),1}catch(t){}},L={a:function(){w("")},c:function(t,e,r){return d.copyWithin(t,e,e+r)},b:function(t){var e=d.length,r=2147483648;if((t>>>=0)>r)return!1;for(var n,i,o=1;o<=4;o*=2){var a=e*(1+.2/o);a=Math.min(a,t+100663296);var s=Math.min(r,(n=Math.max(t,a))+((i=65536)-n%i)%i);if(P(s))return!0}return!1}},N=function(){var t={a:L};function r(t,r){var n;return N=t.exports,h=N.d,g(),n=N.e,m.unshift(n),function(t){if(A--,e.monitorRunDependencies&&e.monitorRunDependencies(A),0==A&&x){var r=x;x=null,r()}}(),N}if(A++,e.monitorRunDependencies&&e.monitorRunDependencies(A),e.instantiateWasm)try{return e.instantiateWasm(t,r)}catch(t){return p("Module.instantiateWasm callback failed with error: ".concat(t)),!1}return I(_,t,function(t){r(t.instance)}),{}}();function j(){function t(){M||(M=!0,e.calledRun=!0,y||(O(m),e.onRuntimeInitialized&&e.onRuntimeInitialized(),function(){if(e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)t=e.postRun.shift(),b.unshift(t);var t;O(b)}()))}A>0||(function(){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)t=e.preRun.shift(),v.unshift(t);var t;O(v)}(),A>0||(e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),t()},1)):t()))}if(e._UGCWasm_CipherSM4_New=function(t,r,n){return(e._UGCWasm_CipherSM4_New=N.f)(t,r,n)},e._UGCWasm_CipherSM4_Encrypt=function(t,r,n){return(e._UGCWasm_CipherSM4_Encrypt=N.g)(t,r,n)},e._UGCWasm_CipherSM4_Decrypt=function(t,r,n){return(e._UGCWasm_CipherSM4_Decrypt=N.h)(t,r,n)},e._UGCWasm_CipherSM4_Delete=function(t){return(e._UGCWasm_CipherSM4_Delete=N.i)(t)},e._malloc=function(t){return(e._malloc=N.k)(t)},e._free=function(t){return(e._free=N.l)(t)},x=function t(){M||j(),M||(x=t)},e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();return j(),e}();t.exports=r}(IEt);var TEt=oEt(IEt.exports);function OEt(t){"@babel/helpers - typeof";return(OEt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function MEt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function PEt(t,e,r){var n;return(e="symbol"==OEt(n=function(t,e){if("object"!=OEt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=OEt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"))?n:n+"")in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function LEt(t){return function(t){if(Array.isArray(t))return NEt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return NEt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return NEt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function NEt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);re.geoFence.radius&&(e.outOfGeoFence&&e.outOfGeoFence(t),e.events.triggerEvent("outOfGeoFence",{data:t})),r})}},{key:"_distance",value:function(t,e,r,n){return Math.sqrt((t-r)*(t-r)+(e-n)*(e-n))}},{key:"_getMeterPerMapUnit",value:function(t){var e;return"meter"===t?e=1:"degree"===t&&(e=2*Math.PI*6378137/360),e}}])&&REt(t.prototype,e),r&&REt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),FEt=r(8518),zEt=r.n(FEt);function GEt(t){"@babel/helpers - typeof";return(GEt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function UEt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function HEt(t,e){for(var r=0;rl&&(u[i]=u[i].slice(n-l),l=n)}function y(t){var e,o,a,s;if(t instanceof Function)return t.call(c.parsers);if("string"==typeof t)e=r.charAt(n)===t?t:null,o=1,d();else{if(d(),!(e=t.exec(u[i])))return null;o=e[0].length}if(e){var f=n+=o;for(s=n+u[i].length-o;n=0&&"\n"!==n.charAt(a);a--)t.column++;return new Error([t.filename,t.line,t.column,t.message].join(";"))}return this.env=e=e||{},this.env.filename=this.env.filename||null,this.env.inputs=this.env.inputs||{},c={parse:function(o){var a,c=null;if(n=i=l=s=0,u=[],r=o.replace(/\r\n/g,"\n"),e.filename&&(f.env.inputs[e.filename]=r),u=function(t){for(var e,n,i,o,a=0,s=/(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,u=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,l=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,f=0,h=t[0],p=0;p0?"missing closing `}`":"missing opening `{`"}),t.map(function(t){return t.join("")})}([[]]),c)throw g(c);var h=function(t,e){var r=t.specificity,n=e.specificity;return r[0]!=n[0]?n[0]-r[0]:r[1]!=n[1]?n[1]-r[1]:r[2]!=n[2]?n[2]-r[2]:n[3]-r[3]};return(a=new t.Tree.Ruleset([],y(this.parsers.primary))).root=!0,a.toList=function(t){t.error=function(e){t.errors||(t.errors=new Error("")),t.errors.message?t.errors.message+="\n"+g(e).message:t.errors.message=g(e).message},t.frames=t.frames||[];var e=this.flatten([],[],t);return e.sort(h),e},a},parsers:{primary:function(){for(var t,e=[];(t=y(this.rule)||y(this.ruleset)||y(this.comment))||y(/^[\s\n]+/)||(t=y(this.invalid));)t&&e.push(t);return e},invalid:function(){var e=y(/^[^;\n]*[;\n]/);if(e)return new t.Tree.Invalid(e,a)},comment:function(){var e;if("/"===r.charAt(n))return"/"===r.charAt(n+1)?new t.Tree.Comment(y(/^\/\/.*/),!0):(e=y(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))?new t.Tree.Comment(e):void 0},entities:{quoted:function(){if('"'===r.charAt(n)||"'"===r.charAt(n)){var e=y(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);return e?new t.Tree.Quoted(e[1]||e[2]):void 0}},field:function(){if(y("[")){var e=y(/(^[^\]]+)/);if(y("]"))return e?new t.Tree.Field(e[1]):void 0}},comparison:function(){var t=y(/^=~|=|!=|<=|>=|<|>/);if(t)return t},keyword:function(){var e=y(/^[A-Za-z\u4e00-\u9fa5-]+[A-Za-z-0-9\u4e00-\u9fa5_]*/);if(e)return new t.Tree.Keyword(e)},call:function(){var e,r;if(e=/^([\w\-]+|%)\(/.exec(u[i])){if("url"===(e=e[1]))return null;n+=e.length;if(y("("),r=y(this.entities.arguments),y(")"))return e?new t.Tree.Call(e,r,n):void 0}},arguments:function(){for(var t,e=[];t=y(this.expression);){e.push(t);if(!y(","))break}return e},literal:function(){return y(this.entities.dimension)||y(this.entities.keywordcolor)||y(this.entities.hexcolor)||y(this.entities.quoted)},url:function(){var e;if("u"===r.charAt(n)&&y(/^url\(/)){e=y(this.entities.quoted)||y(this.entities.variable)||y(/^[\-\w%@_match\/.&=:;#+?~]+/)||"";return y(")")?new t.Tree.URL(void 0!==e.value||e instanceof t.Tree.Variable?e:new t.Tree.Quoted(e)):new t.Tree.Invalid(e,a,"Missing closing ) in URL.")}},variable:function(){var i,o=n;if("@"===r.charAt(n)&&(i=y(/^@[\w-]+/)))return new t.Tree.Variable(i,o,e.filename)},hexcolor:function(){var e;if("#"===r.charAt(n)&&(e=y(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new t.Tree.Color(e[1])},keywordcolor:function(){var e=u[i].match(/^[a-z]+/);if(e&&e[0]in t.Tree.Reference.data.colors)return new t.Tree.Color(t.Tree.Reference.data.colors[y(/^[a-z]+/)])},dimension:function(){var e=r.charCodeAt(n);if(!(e>57||e<45||47===e)){var i=y(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/);return i?new t.Tree.Dimension(i[1],i[2],a):void 0}}},variable:function(){var t;if("@"===r.charAt(n)&&(t=y(/^(@[\w-]+)\s*:/)))return t[1]},entity:function(){var t=y(this.entities.call)||y(this.entities.literal),e=y(this.entities.field)||y(this.entities.variable),r=y(this.entities.url)||y(this.entities.keyword);return t||e||r},end:function(){var t;return y(";")||("string"==typeof(t="}")?r.charAt(n)===t:!!t.test(u[i]))},element:function(){var e=y(/^(?:[.#][\w\u4e00-\u9fa5\-]+|\*|Map)/);if(e)return new t.Tree.Element(e)},attachment:function(){var t=y(/^::([\w\-]+(?:\/[\w\-]+)*)/);if(t)return t[1]},selector:function(){for(var e,i,o,s,u,l=[],c=new t.Tree.Filterset,f=[],h=0,p=0;(o=y(this.element))||(u=y(this.zoom))||(s=y(this.filter))||(e=y(this.attachment));){if(h++,o)l.push(o);else if(u)f.push(u),p++;else if(s){var d=c.add(s);if(d)throw g({message:d,index:n-1});p++}else{if(i)throw g({message:"Encountered second attachment name.",index:n-1});i=e}var v=r.charAt(n);if("{"===v||"}"===v||";"===v||","===v)break}if(h)return new t.Tree.Selector(c,f,l,i,p,a)},filter:function(){h();var r,n,i;if(y("[")&&(r=y(/^[a-zA-Z0-9\-_]+/)||y(this.entities.quoted)||y(this.entities.variable)||y(this.entities.keyword)||y(this.entities.field))&&(r instanceof t.Tree.Quoted&&(r=new t.Tree.Field(r.toString())),(n=y(this.entities.comparison))&&(i=y(this.entities.quoted)||y(this.entities.variable)||y(this.entities.dimension)||y(this.entities.keyword)||y(this.entities.field)))){if(!y("]"))throw g({message:"Missing closing ] of filter.",index:a-1});return r.is||(r=new t.Tree.Field(r)),new t.Tree.Filter(r,n,i,a,e.filename)}},zoom:function(){h();var e,r;if(y(/^\[\s*zoom/g)&&(e=y(this.entities.comparison))&&(r=y(this.entities.variable)||y(this.entities.dimension))&&y("]"))return new t.Tree.Zoom(e,r,a);p()},block:function(){var t;if(y("{")&&(t=y(this.primary))&&y("}"))return t},ruleset:function(){var e,r,n=[];for(h();e=y(this.selector);){for(n.push(e);y(this.comment););if(!y(","))break;for(;y(this.comment););}if(e)for(;y(this.comment););if(n.length>0&&(r=y(this.block))){if(1===n.length&&n[0].elements.length&&"Map"===n[0].elements[0].value){var i=new t.Tree.Ruleset(n,r);return i.isMap=!0,i}return new t.Tree.Ruleset(n,r)}p()},rule:function(){var i,o,u=r.charAt(n);if(h(),"."!==u&&"#"!==u&&(i=y(this.variable)||y(this.property))){if((o=y(this.value))&&y(this.end))return new t.Tree.Rule(i,o,a,e.filename);s=n,p()}},font:function(){for(var e,r=[],n=[];e=y(this.entity);)n.push(e);if(r.push(new t.Tree.Expression(n)),y(","))for(;(e=y(this.expression))&&(r.push(e),y(",")););return new t.Tree.Value(r)},value:function(){for(var e,r=[];(e=y(this.expression))&&(r.push(e),y(",")););return r.length>1?new t.Tree.Value(r.map(function(t){return t.value[0]})):1===r.length?new t.Tree.Value(r):void 0},sub:function(){var t;if(y("(")&&(t=y(this.expression))&&y(")"))return t},multiplication:function(){var e,r,n,i;if(e=y(this.operand)){for(;(n=y("/")||y("*")||y("%"))&&(r=y(this.operand));)i=new t.Tree.Operation(n,[i||e,r],a);return i||e}},addition:function(){var e,i,o,s;if(e=y(this.multiplication)){for(;(o=y(/^[-+]\s+/)||" "!=r.charAt(n-1)&&(y("+")||y("-")))&&(i=y(this.multiplication));)s=new t.Tree.Operation(o,[s||e,i],a);return s||e}},operand:function(){return y(this.sub)||y(this.entity)},expression:function(){for(var e,r=[];e=y(this.addition)||y(this.entity);)r.push(e);if(r.length>0)return new t.Tree.Expression(r)},property:function(){var t=y(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/);if(t)return t[1]}}}}},{key:"parse",value:function(t){var e=this.parser;return this.ruleSet=e.parse(t)}},{key:"toShaders",value:function(){if(this.ruleSet){var t=this.ruleSet;if(t){var e=t.toList(this.env);e.reverse();var r={},n=[];this._toShaders(r,n,e);for(var i=[],o={},a=0,s=e.length;a=0){if(!e.featureFilter){var o=i+n.length,a=r.indexOf(")",o+1),s="featureId&&(featureId"+r.substring(o,a)+")";Object.defineProperty(e,"featureFilter",{configurable:!0,enumerable:!1,value:function(t){return!!s}})}return{property:p,getValue:Function("attributes","zoom","seftFilter","var _value = null; var isExcute=typeof seftFilter=='function'?sefgFilter():seftFilter;if(isExcute){"+r+";} return _value; ")}}return{property:p,getValue:Function("attributes","zoom","var _value = null;"+r+"; return _value; ")}}(c[p],f);Object.defineProperty(f,"attachment",{configurable:!0,enumerable:!1,value:l}),Object.defineProperty(f,"elements",{configurable:!0,enumerable:!1,value:u.elements}),i.push(f),o[n[a]]=!0}Object.defineProperty(f,"zoom",{configurable:!0,enumerable:!1,value:u.zoom})}return i}}return null}},{key:"_toShaders",value:function(e,r,n){for(var i=0,o=n.length;i= minzoom - 1e-6 and scale < maxzoom + 1e-6"},maxzoom:{"default-value":"1.79769e+308",type:"float","default-meaning":"The layer will be visible at the maximum possible scale",doc:"The maximum scale denominator that this layer will be visible at. The default is the numeric limit of the C++ double type, which may vary slightly by system, but is likely a massive number like 1.79769e+308 and ensures that this layer will always be visible unless the value is reduced. A layer's visibility is determined by whether its status is true and if the Map scale >= minzoom - 1e-6 and scale < maxzoom + 1e-6"},queryable:{"default-value":!1,type:"boolean","default-meaning":"The layer will not be available for the direct querying of data values",doc:"This property was added for GetFeatureInfo/WMS compatibility and is rarely used. It is off by default meaning that in a WMS context the layer will not be able to be queried unless the property is explicitly set to true"},"clear-label-cache":{"default-value":!1,type:"boolean","default-meaning":"The renderer's collision detector cache (used for avoiding duplicate labels and overlapping markers) will not be cleared immediately before processing this layer",doc:"This property, by default off, can be enabled to allow a user to clear the collision detector cache before a given layer is processed. This may be desirable to ensure that a given layers data shows up on the map even if it normally would not because of collisions with previously rendered labels or markers"},"group-by":{"default-value":"",type:"string","default-meaning":"No special layer grouping will be used during rendering",doc:"https://github.com/mapnik/mapnik/wiki/Grouped-rendering"},"buffer-size":{"default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:"Extra tolerance around the Layer extent (in pixels) used to when querying and (potentially) clipping the layer data during rendering"},"maximum-extent":{"default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query this specific layer data during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Layer."}},symbolizers:{"*":{"image-filters":{css:"image-filters","default-value":"none","default-meaning":"no filters",type:"functions",functions:[["agg-stack-blur",2],["emboss",0],["blur",0],["gray",0],["sobel",0],["edge-detect",0],["x-gradient",0],["y-gradient",0],["invert",0],["sharpen",0]],doc:"A list of image filters."},"comp-op":{css:"comp-op","default-value":"src-over","default-meaning":"add the current layer on top of other layers",doc:"Composite operation. This defines how this layer should behave relative to layers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]},opacity:{css:"opacity",type:"float",doc:"An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer)","default-value":1,"default-meaning":"no separate buffer will be used and no alpha will be applied to the style after rendering"}},map:{"background-color":{css:"background-color","default-value":"none","default-meaning":"transparent",type:"color",doc:"Map Background color"},"background-image":{css:"background-image",type:"uri","default-value":"","default-meaning":"transparent",doc:"An image that is repeated below all features on a map as a background.",description:"Map Background image"},srs:{css:"srs",type:"string","default-value":"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs","default-meaning":"The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space",doc:"Map spatial reference (proj4 string)"},"buffer-size":{css:"buffer-size","default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:'Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges".'},"maximum-extent":{css:"","default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query all layers during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Map."},base:{css:"base","default-value":"","default-meaning":"This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.",type:"string",doc:"Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet."},"paths-from-xml":{css:"","default-value":!0,"default-meaning":"Paths read from XML will be interpreted from the location of the XML",type:"boolean",doc:"value to control whether paths in the XML will be interpreted from the location of the XML or from the working directory of the program that calls load_map()"},"minimum-version":{css:"","default-value":"none","default-meaning":"Mapnik version will not be detected and no error will be thrown about compatibility",type:"string",doc:"The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"},"font-directory":{css:"font-directory",type:"uri","default-value":"none","default-meaning":"No map-specific fonts will be registered",doc:"Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered)."}},polygon:{fill:{css:"polygon-fill",type:"color","default-value":"rgba(128,128,128,1)","default-meaning":"gray and fully opaque (alpha = 1), same as rgb(128,128,128)",doc:"Fill color to assign to a polygon"},"fill-opacity":{css:"polygon-opacity",type:"float",doc:"The opacity of the polygon","default-value":1,"default-meaning":"opaque"},gamma:{css:"polygon-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon edges"},"gamma-method":{css:"polygon-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},clip:{css:"polygon-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},line:{stroke:{css:"line-color","default-value":"rgba(0,0,0,1)",type:"color","default-meaning":"black and fully opaque (alpha = 1), same as rgb(0,0,0)",doc:"The color of a drawn line"},"stroke-width":{css:"line-width","default-value":1,type:"float",doc:"The width of a line in pixels"},"stroke-opacity":{css:"line-opacity","default-value":1,type:"float","default-meaning":"opaque",doc:"The opacity of a line"},"stroke-linejoin":{css:"line-join","default-value":"miter",type:["miter","round","bevel"],doc:"The behavior of lines when joining"},"stroke-linecap":{css:"line-cap","default-value":"butt",type:["butt","round","square"],doc:"The display of line endings"},"stroke-gamma":{css:"line-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of stroke line"},"stroke-gamma-method":{css:"line-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},"stroke-dasharray":{css:"line-dasharray",type:"numbers",doc:"A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns.","default-value":"none","default-meaning":"solid line"},"stroke-dashoffset":{css:"line-dash-offset",type:"numbers",doc:"valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled)","default-value":"none","default-meaning":"solid line"},"stroke-miterlimit":{css:"line-miterlimit",type:"float",doc:"The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts.","default-value":4,"default-meaning":"Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )'"},clip:{css:"line-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},offset:{css:"line-offset",type:"float","default-value":0,"default-meaning":"no offset",doc:"Offsets a line a number of pixels parallel to its actual path. Postive values move the line left, negative values move it right (relative to the directionality of the line)."},rasterizer:{css:"line-rasterizer",type:["full","fast"],"default-value":"full",doc:"Exposes an alternate AGG rendering method that sacrifices some accuracy for speed."},"geometry-transform":{css:"line-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},markers:{file:{css:"marker-file",doc:"An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse.","default-value":"","default-meaning":"An ellipse or circle, if width equals height",type:"uri"},opacity:{css:"marker-opacity",doc:"The overall opacity of the marker, if set, overrides both the opacity of both the fill and stroke","default-value":1,"default-meaning":"The stroke-opacity and fill-opacity will be used",type:"float"},"fill-opacity":{css:"marker-fill-opacity",doc:"The fill opacity of the marker","default-value":1,"default-meaning":"opaque",type:"float"},stroke:{css:"marker-line-color",doc:"The color of the stroke around a marker shape.","default-value":"black",type:"color"},"stroke-width":{css:"marker-line-width",doc:"The width of the stroke around a marker shape, in pixels. This is positioned on the boundary, so high values can cover the area itself.",type:"float"},"stroke-opacity":{css:"marker-line-opacity","default-value":1,"default-meaning":"opaque",doc:"The opacity of a line",type:"float"},placement:{css:"marker-placement",type:["point","line","interior"],"default-value":"point","default-meaning":"Place markers at the center point (centroid) of the geometry",doc:"Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior"},"multi-policy":{css:"marker-multi-policy",type:["each","whole","largest"],"default-value":"each","default-meaning":"If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each",doc:"A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default)."},"marker-type":{css:"marker-type",type:["arrow","ellipse"],"default-value":"ellipse",doc:"The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width)"},width:{css:"marker-width","default-value":10,doc:"The width of the marker, if using one of the default types.",type:"expression"},height:{css:"marker-height","default-value":10,doc:"The height of the marker, if using one of the default types.",type:"expression"},fill:{css:"marker-fill","default-value":"blue",doc:"The color of the area of the marker.",type:"color"},"allow-overlap":{css:"marker-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping markers are shown or hidden.","default-meaning":"Do not allow makers to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"marker-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},spacing:{css:"marker-spacing",doc:"Space between repeated labels","default-value":100,type:"float"},"max-error":{css:"marker-max-error",type:"float","default-value":.2,doc:"The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers."},transform:{css:"marker-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},clip:{css:"marker-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"marker-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"marker-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"marker-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},shield:{name:{css:"shield-name",type:"expression",serialization:"content",doc:'Value to use for a shield"s text label. Data columns are specified using brackets like [column_name]'},file:{css:"shield-file",required:!0,type:"uri","default-value":"none",doc:"Image file to render behind the shield text"},"face-name":{css:"shield-face-name",type:"string",validate:"font",doc:"Font name and style to use for the shield text","default-value":"",required:!0},"unlock-image":{css:"shield-unlock-image",type:"boolean",doc:"This parameter should be set to true if you are trying to position text beside rather than on top of the shield image","default-value":!1,"default-meaning":"text alignment relative to the shield image uses the center of the image as the anchor for text positioning."},size:{css:"shield-size",type:"float",doc:"The size of the shield text in pixels"},fill:{css:"shield-fill",type:"color",doc:"The color of the shield text"},placement:{css:"shield-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons."},"avoid-edges":{css:"shield-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.",type:"boolean","default-value":!1},"allow-overlap":{css:"shield-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping shields are shown or hidden.","default-meaning":"Do not allow shields to overlap with other map elements already placed."},"minimum-distance":{css:"shield-min-distance",type:"float","default-value":0,doc:"Minimum distance to the next shield symbol, not necessarily the same shield."},spacing:{css:"shield-spacing",type:"float","default-value":0,doc:"The spacing between repeated occurrences of the same shield on a line"},"minimum-padding":{css:"shield-min-padding","default-value":0,doc:"Determines the minimum amount of padding that a shield gets relative to other shields",type:"float"},"wrap-width":{css:"shield-wrap-width",type:"unsigned","default-value":0,doc:"Length of a chunk of text in characters before wrapping text"},"wrap-before":{css:"shield-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"shield-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long names."},"halo-fill":{css:"shield-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"shield-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},"character-spacing":{css:"shield-character-spacing",type:"unsigned","default-value":0,doc:"Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."},"line-spacing":{css:"shield-line-spacing",doc:"Vertical spacing between lines of multiline labels (in pixels)",type:"unsigned"},dx:{css:"shield-text-dx",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"shield-text-dy",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"shield-dx":{css:"shield-dx",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},"shield-dy":{css:"shield-dy",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},opacity:{css:"shield-opacity",type:"float",doc:"(Default 1.0) - opacity of the image used for the shield","default-value":1},"text-opacity":{css:"shield-text-opacity",type:"float",doc:"(Default 1.0) - opacity of the text placed on top of the shield","default-value":1},"horizontal-alignment":{css:"shield-horizontal-alignment",type:["left","middle","right","auto"],doc:"The shield's horizontal alignment from its centerpoint","default-value":"auto"},"vertical-alignment":{css:"shield-vertical-alignment",type:["top","middle","bottom","auto"],doc:"The shield's vertical alignment from its centerpoint","default-value":"middle"},"text-transform":{css:"shield-text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"justify-alignment":{css:"shield-justify-alignment",type:["left","center","right","auto"],doc:"Define how text in a shield's label is justified","default-value":"auto"},clip:{css:"shield-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"shield-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"line-pattern":{file:{css:"line-pattern-file",type:"uri","default-value":"none",required:!0,doc:"An image file to be repeated and warped along a line"},clip:{css:"line-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"line-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"polygon-pattern":{file:{css:"polygon-pattern-file",type:"uri","default-value":"none",required:!0,doc:"Image to use as a repeated pattern fill within a polygon"},alignment:{css:"polygon-pattern-alignment",type:["local","global"],"default-value":"local",doc:"Specify whether to align pattern fills to the layer or to the map."},gamma:{css:"polygon-pattern-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon pattern edges"},opacity:{css:"polygon-pattern-opacity",type:"float",doc:"(Default 1.0) - Apply an opacity level to the image used for the pattern","default-value":1,"default-meaning":"The image is rendered without modifications"},clip:{css:"polygon-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},raster:{opacity:{css:"raster-opacity","default-value":1,"default-meaning":"opaque",type:"float",doc:"The opacity of the raster symbolizer on top of other symbolizers."},"filter-factor":{css:"raster-filter-factor","default-value":-1,"default-meaning":"Allow the datasource to choose appropriate downscaling.",type:"float",doc:"This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed."},scaling:{css:"raster-scaling",type:["near","fast","bilinear","bilinear8","bicubic","spline16","spline36","hanning","hamming","hermite","kaiser","quadric","catrom","gaussian","bessel","mitchell","sinc","lanczos","blackman"],"default-value":"near",doc:"The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality."},"mesh-size":{css:"raster-mesh-size","default-value":16,"default-meaning":"Reprojection mesh will be 1/16 of the resolution of the source image",type:"unsigned",doc:"A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion."},"comp-op":{css:"raster-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},point:{file:{css:"point-file",type:"uri",required:!1,"default-value":"none",doc:"Image file to represent a point"},"allow-overlap":{css:"point-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping points are shown or hidden.","default-meaning":"Do not allow points to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"point-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},opacity:{css:"point-opacity",type:"float","default-value":1,"default-meaning":"Fully opaque",doc:"A value from 0 to 1 to control the opacity of the point"},placement:{css:"point-placement",type:["centroid","interior"],doc:"How this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon.","default-value":"centroid"},transform:{css:"point-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},"comp-op":{css:"point-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},text:{name:{css:"text-name",type:"expression",required:!0,"default-value":"",serialization:"content",doc:"Value to use for a text label. Data columns are specified using brackets like [column_name]"},"face-name":{css:"text-face-name",type:"string",validate:"font",doc:"Font name and style to render a label in",required:!0},size:{css:"text-size",type:"float","default-value":10,doc:"Text size in pixels"},"text-ratio":{css:"text-ratio",doc:"Define the amount of text (of the total) present on successive lines when wrapping occurs","default-value":0,type:"unsigned"},"wrap-width":{css:"text-wrap-width",doc:"Length of a chunk of text in characters before wrapping text","default-value":0,type:"unsigned"},"wrap-before":{css:"text-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"text-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long text."},spacing:{css:"text-spacing",type:"unsigned",doc:"Distance between repeated text labels on a line (aka. label-spacing)"},"character-spacing":{css:"text-character-spacing",type:"float","default-value":0,doc:"Horizontal spacing adjustment between characters in pixels"},"line-spacing":{css:"text-line-spacing","default-value":0,type:"unsigned",doc:"Vertical spacing adjustment between lines in pixels"},"label-position-tolerance":{css:"text-label-position-tolerance","default-value":0,type:"unsigned",doc:"Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line)"},"max-char-angle-delta":{css:"text-max-char-angle-delta",type:"float","default-value":"22.5",doc:"The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners."},fill:{css:"text-fill",doc:"Specifies the color for the text","default-value":"#000000",type:"color"},opacity:{css:"text-opacity",doc:"A number from 0 to 1 specifying the opacity for the text","default-value":1,"default-meaning":"Fully opaque",type:"float"},"halo-fill":{css:"text-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"text-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},dx:{css:"text-dx",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"text-dy",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"vertical-alignment":{css:"text-vertical-alignment",type:["top","middle","bottom","auto"],doc:"Position of label relative to point position.","default-value":"auto","default-meaning":'Default affected by value of dy; "bottom" for dy>0, "top" for dy<0.'},"avoid-edges":{css:"text-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.","default-value":!1,type:"boolean"},"minimum-distance":{css:"text-min-distance",doc:"Minimum permitted distance to the next text symbolizer.",type:"float"},"minimum-padding":{css:"text-min-padding",doc:"Determines the minimum amount of padding that a text symbolizer gets relative to other text",type:"float"},"minimum-path-length":{css:"text-min-path-length",type:"float","default-value":0,"default-meaning":"place labels on all paths",doc:"Place labels only on paths longer than this value."},"allow-overlap":{css:"text-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping text is shown or hidden.","default-meaning":"Do not allow text to overlap with other text - overlapping markers will not be shown."},orientation:{css:"text-orientation",type:"expression",doc:"Rotate the text."},placement:{css:"text-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"Control the style of placement of a point versus the geometry it is attached to."},"placement-type":{css:"text-placement-type",doc:'Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off.',type:["dummy","simple"],"default-value":"dummy"},placements:{css:"text-placements",type:"string","default-value":"",doc:'If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is `text-placements: "E,NE,SE,W,NW,SW";` '},"text-transform":{css:"text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"horizontal-alignment":{css:"text-horizontal-alignment",type:["left","middle","right","auto"],doc:"The text's horizontal alignment from its centerpoint","default-value":"auto"},"justify-alignment":{css:"text-align",type:["left","right","center","auto"],doc:"Define how text is justified","default-value":"auto","default-meaning":"Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives"},clip:{css:"text-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"text-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},building:{fill:{css:"building-fill","default-value":"#FFFFFF",doc:"The color of the buildings walls.",type:"color"},"fill-opacity":{css:"building-fill-opacity",type:"float",doc:"The opacity of the building as a whole, including all walls.","default-value":1},height:{css:"building-height",doc:"The height of the building in pixels.",type:"expression","default-value":"0"}}},colors:{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50],transparent:[0,0,0,0]},filter:{value:["true","false","null","point","linestring","polygon","collection"]}};function qEt(t){"@babel/helpers - typeof";return(qEt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function XEt(t,e){for(var r=0;r1&&(e=arguments[1]),arguments.length>2&&(r=arguments[2]),{is:"tag",val:t,color:e,mode:r,toString:function(n){return'\n\t"}}},hsl:function(t,e,r){return this.hsla(t,e,r,1)},hsla:function(t,e,r,n){if([t=this.number(t)%360/360,e=this.number(e),r=this.number(r),n=this.number(n)].some(isNaN))return null;var i=r<=.5?r*(e+1):r+e-r*e,o=2*r-i;return this.rgba(255*a(t+1/3),255*a(t),255*a(t-1/3),n);function a(t){return 6*(t=t<0?t+1:t>1?t-1:t)<1?o+(i-o)*t*6:2*t<1?i:3*t<2?o+(i-o)*(2/3-t)*6:o}},hue:function(t){return"toHSL"in t?new YEt.Tree.Dimension(Math.round(t.toHSL().h)):null},saturation:function(t){return"toHSL"in t?new YEt.Tree.Dimension(Math.round(100*t.toHSL().s),"%"):null},lightness:function(t){return"toHSL"in t?new YEt.Tree.Dimension(Math.round(100*t.toHSL().l),"%"):null},alpha:function(t){return"toHSL"in t?new YEt.Tree.Dimension(t.toHSL().a):null},saturate:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.s+=e.value/100,r.s=this.clamp(r.s),this.hsla_simple(r)},desaturate:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.s-=e.value/100,r.s=this.clamp(r.s),this.hsla_simple(r)},lighten:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.l+=e.value/100,r.l=this.clamp(r.l),this.hsla_simple(r)},darken:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.l-=e.value/100,r.l=this.clamp(r.l),this.hsla_simple(r)},fadein:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.a+=e.value/100,r.a=this.clamp(r.a),this.hsla_simple(r)},fadeout:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.a-=e.value/100,r.a=this.clamp(r.a),this.hsla_simple(r)},spin:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL(),n=(r.h+e.value)%360;return r.h=n<0?360+n:n,this.hsla_simple(r)},replace:function(t,e,r){return"field"===t.is?t.toString+".replace("+e.toString()+", "+r.toString()+")":t.replace(e,r)},mix:function(t,e,r){var n=r.value/100,i=2*n-1,o=t.toHSL().a-e.toHSL().a,a=((i*o==-1?i:(i+o)/(1+i*o))+1)/2,s=1-a,u=[t.rgb[0]*a+e.rgb[0]*s,t.rgb[1]*a+e.rgb[1]*s,t.rgb[2]*a+e.rgb[2]*s],l=t.alpha*n+e.alpha*(1-n);return new YEt.Tree.Color(u,l)},greyscale:function(t){return this.desaturate(t,new YEt.Tree.Dimension(100))},"%":function(t){for(var e=Array.prototype.slice.call(arguments,1),r=t.value,n=0;n.5?l/(2-a-s):l/(a+s),a){case r:t=(n-i)/l+(n=0){if(!t.ppi)return t.error({message:"ppi is not set, so metric units can't be used",index:this.index}),{is:"undefined",value:"undefined"};this.value=this.value/this.densities[this.unit]*t.ppi,this.unit="px"}return this}},{key:"toColor",value:function(){return new YEt.Tree.Color([this.value,this.value,this.value])}},{key:"round",value:function(){return this.value=Math.round(this.value),this}},{key:"toString",value:function(){return this.value.toString()}},{key:"operate",value:function(t,e,r){return"%"===this.unit&&"%"!==r.unit?(t.error({message:"If two operands differ, the first must not be %",index:this.index}),{is:"undefined",value:"undefined"}):"%"!==this.unit&&"%"===r.unit?"*"===e||"/"===e||"%"===e?(t.error({message:"Percent values can only be added or subtracted from other values",index:this.index}),{is:"undefined",value:"undefined"}):new YEt.Tree.Dimension(YEt.Tree.operate(e,this.value,this.value*r.value*.01),this.unit):new YEt.Tree.Dimension(YEt.Tree.operate(e,this.value,r.value),this.unit||r.unit)}}])}(),YEt.Tree.Element=function(){return VEt(function t(e){UEt(this,t),this.value=e.trim(),"#"===this.value[0]&&(this.type="id",this.clean=this.value.replace(/^#/,"")),"."===this.value[0]&&(this.type="class",this.clean=this.value.replace(/^\./,"")),-1!==this.value.indexOf("*")&&(this.type="wildcard")},[{key:"specificity",value:function(){return["id"===this.type?1:0,"class"===this.type?1:0]}},{key:"toString",value:function(){return this.value}}])}(),YEt.Tree.Expression=function(){return VEt(function t(e){UEt(this,t),this.is="expression",this.value=e},[{key:"ev",value:function(t){return this.value.length>1?new YEt.Tree.Expression(this.value.map(function(e){return e.ev(t)})):this.value[0].ev(t)}},{key:"toString",value:function(t){return this.value.map(function(e){return e.toString(t)}).join(" ")}}])}(),YEt.Tree.Field=function(){return VEt(function t(e){UEt(this,t),this.is="field",this.value=e||""},[{key:"toString",value:function(){return'["'+this.value.toUpperCase()+'"]'}},{key:"ev",value:function(){return this}}])}(),YEt.Tree.Filter=function(){return VEt(function t(e,r,n,i,o){UEt(this,t),this.ops={"<":[" < ","numeric"],">":[" > ","numeric"],"=":[" = ","both"],"!=":[" != ","both"],"<=":[" <= ","numeric"],">=":[" >= ","numeric"],"=~":[".match(","string",")"]},this.key=e,this.op=r,this.val=n,this.index=i,this.filename=o,this.id=this.key+this.op+this.val},[{key:"ev",value:function(t){return this.key=this.key.ev(t),this.val=this.val.ev(t),this}},{key:"toString",value:function(){return"["+this.id+"]"}}])}(),YEt.Tree.Filterset=function(){return VEt(function t(){UEt(this,t),this.filters={}},[{key:"toJS",value:function(t){function e(t){var e=t.op;"="===e&&(e="==");var r=t.val;void 0!==t._val&&(r=t._val.toString(!0)),t.key&&"scale"===t.key.value?r=+r:"string"!=typeof r&&"object"!==GEt(r)||(r="'"+r+"'");var n="attributes";return n+"&&"+n+t.key+"&&"+n+t.key+" "+e+r}var r=[];for(var n in this.filters)r.push(e(this.filters[n]));return r.join(" && ")}},{key:"toString",value:function(){var t=[];for(var e in this.filters)t.push(this.filters[e].id);return t.sort().join("\t")}},{key:"ev",value:function(t){for(var e in this.filters)this.filters[e].ev(t);return this}},{key:"clone",value:function(){var t=new YEt.Tree.Filterset;for(var e in this.filters)t.filters[e]=this.filters[e];return t}},{key:"cloneWith",value:function(t){var e=[];for(var r in t.filters){var n=this.addable(t.filters[r]);if(!1===n)return!1;!0===n&&e.push(t.filters[r])}if(!e.length)return null;var i=new YEt.Tree.Filterset;for(r in this.filters)i.filters[r]=this.filters[r];for(;r=e.shift();)i.add(r);return i}},{key:"addable",value:function(t){var e=t.key.toString(),r=t.val.toString();switch(r.match(/^[0-9]+(\.[0-9]*)?_match/)&&(r=parseFloat(r)),t.op){case"=":return void 0!==this.filters[e+"="]?this.filters[e+"="].val.toString()==r&&null:void 0===this.filters[e+"!="+r]&&(!(void 0!==this.filters[e+">"]&&this.filters[e+">"].val>=r)&&(!(void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r)&&(!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>r)&&!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].val"]&&this.filters[e+">"].val>=r?null:void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r?null:void 0!==this.filters[e+">="]&&this.filters[e+">="].val>r?null:!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].val":return e+"="in this.filters?!(this.filters[e+"="].val<=r)&&null:!(void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r)&&(!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].val<=r)&&(void 0!==this.filters[e+">"]&&this.filters[e+">"].val>=r?null:!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>r)||null));case">=":return void 0!==this.filters[e+"="]?!(this.filters[e+"="].val"]&&this.filters[e+">"].val>=r?null:!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>=r)||null));case"<":return void 0!==this.filters[e+"="]?!(this.filters[e+"="].val>=r)&&null:!(void 0!==this.filters[e+">"]&&this.filters[e+">"].val>=r)&&(!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>=r)&&(void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r?null:!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].valr)&&null:!(void 0!==this.filters[e+">"]&&this.filters[e+">"].val>=r)&&(!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>r)&&(void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r?null:!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].val<=r)||null))}}},{key:"conflict",value:function(t){var e=t.key.toString(),r=t.val.toString();return isNaN(parseFloat(r))||(r=parseFloat(r)),("="===t.op&&void 0!==this.filters[e+"="]&&r!=this.filters[e+"="].val.toString()||"!="===t.op&&void 0!==this.filters[e+"="]&&r==this.filters[e+"="].val.toString()||"="===t.op&&void 0!==this.filters[e+"!="]&&r===this.filters[e+"!="].val.toString())&&t.toString()+" added to "+this.toString()+" produces an invalid filter"}},{key:"add",value:function(t,e){var r,n=t.key.toString(),i=t.op,o=this.conflict(t);if(o)return o;if("="===i){for(var a in this.filters)this.filters[a].key===n&&delete this.filters[a];this.filters[n+"="]=t}else if("!="===i)this.filters[n+"!="+t.val]=t;else if("=~"===i)this.filters[n+"=~"+t.val]=t;else if(">"===i){for(var s in this.filters)this.filters[s].key===n&&this.filters[s].val<=t.val&&delete this.filters[s];this.filters[n+">"]=t}else if(">="===i){for(var u in this.filters)r=+this.filters[u].val.toString(),this.filters[u].key===n&&r",this.filters[n+">"]=t):this.filters[n+">="]=t}else if("<"===i){for(var l in this.filters)r=+this.filters[l].val.toString(),this.filters[l].key===n&&r>=t.val&&delete this.filters[l];this.filters[n+"<"]=t}else if("<="===i){for(var c in this.filters)r=+this.filters[c].val.toString(),this.filters[c].key===n&&r>t.val&&delete this.filters[c];void 0!==this.filters[n+"!="+t.val]?(delete this.filters[n+"!="+t.val],t.op="<",this.filters[n+"<"]=t):this.filters[n+"<="]=t}}}])}(),YEt.Tree.Fontset=VEt(function t(e,r){UEt(this,t),this.fonts=r,this.name="fontset-"+e.effects.length}),YEt.Tree.Invalid=function(){return VEt(function t(e,r,n){UEt(this,t),this.is="invalid",this.chunk=e,this.index=r,this.type="syntax",this.message=n||"Invalid code: "+this.chunk},[{key:"ev",value:function(t){return t.error({chunk:this.chunk,index:this.index,type:"syntax",message:this.message||"Invalid code: "+this.chunk}),{is:"undefined"}}}])}(),YEt.Tree.Keyword=function(){return VEt(function t(e){UEt(this,t),this.value=e;var r={transparent:"color",true:"boolean",false:"boolean"};this.is=r[e]?r[e]:"keyword"},[{key:"ev",value:function(){return this}},{key:"toString",value:function(){return this.value}}])}(),YEt.Tree.Literal=function(){return VEt(function t(e){UEt(this,t),this.value=e||"",this.is="field"},[{key:"toString",value:function(){return this.value}},{key:"ev",value:function(){return this}}])}(),YEt.Tree.Operation=function(){return VEt(function t(e,r,n){UEt(this,t),this.is="operation",this.op=e.trim(),this.operands=r,this.index=n},[{key:"ev",value:function(t){var e,r=this.operands[0].ev(t),n=this.operands[1].ev(t);return"undefined"===r.is||"undefined"===n.is?{is:"undefined",value:"undefined"}:(r instanceof YEt.Tree.Dimension&&n instanceof YEt.Tree.Color&&("*"===this.op||"+"===this.op?(e=n,n=r,r=e):t.error({name:"OperationError",message:"Can't substract or divide a color from a number",index:this.index})),r instanceof YEt.Tree.Quoted&&n instanceof YEt.Tree.Quoted&&"+"!==this.op?(t.error({message:"Can't subtract, divide, or multiply strings.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):r instanceof YEt.Tree.Field||n instanceof YEt.Tree.Field||r instanceof YEt.Tree.Literal||n instanceof YEt.Tree.Literal?"color"===r.is||"color"===n.is?(t.error({message:"Can't subtract, divide, or multiply colors in expressions.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):new YEt.Tree.Literal(r.ev(t).toString(!0)+this.op+n.ev(t).toString(!0)):void 0===r.operate?(t.error({message:"Cannot do math with type "+r.is+".",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):r.operate(t,this.op,n))}}])}(),YEt.Tree.Quoted=function(){return VEt(function t(e){UEt(this,t),this.is="string",this.value=e||""},[{key:"toString",value:function(t){var e=this.value.replace(/&/g,"&"),r=e.replace(/\'/g,"\\'").replace(/\"/g,""").replace(//g,">");return!0===t?"'"+r+"'":e}},{key:"ev",value:function(){return this}},{key:"operate",value:function(t,e,r){return new YEt.Tree.Quoted(YEt.Tree.operate(e,this.toString(),r.toString(this.contains_field)))}}])}(),YEt.Tree.Reference={_validateValue:{font:function(t,e){return!t.validation_data||!t.validation_data.fonts||-1!=t.validation_data.fonts.indexOf(e)}},setData:function(t){this.data=t,this.selector_cache=function(t){var e={};for(var r in t.symbolizers)for(var n in t.symbolizers[r])t.symbolizers[r][n].hasOwnProperty("css")&&(e[t.symbolizers[r][n].css]=[t.symbolizers[r][n],r,n]);return e}(t),this.mapnikFunctions=function(t){var e={};for(var r in t.symbolizers)for(var n in t.symbolizers[r])if("functions"===t.symbolizers[r][n].type)for(var i=0;i1?Array.prototype.push.apply(r,n.find(new YEt.Tree.Selector(null,null,t.elements.slice(1)),e)):r.push(n);break}}),this._lookups[n]=r)}},{key:"evZooms",value:function(t){for(var e=0;eYEt.Tree.Zoom.maxZoom||e<0)&&t.error({message:"Only zoom levels between 0 and "+YEt.Tree.Zoom.maxZoom+" supported.",index:this.index}),this.op){case"=":return this.zoom="zoom && zoom === "+e,this;case">":this.zoom="zoom && zoom > "+e;break;case">=":this.zoom="zoom && zoom >= "+e;break;case"<":this.zoom="zoom && zoom < "+e;break;case"<=":this.zoom="zoom && zoom <= "+e}return this}},{key:"toString",value:function(){for(var t="",e=0;e<=YEt.Tree.Zoom.maxZoom;e++)t+=this.zoom&1<=l[2]||l[1]<=l[3])&&(this.DVBOrigonPoint=[l[0],l[3]],this.DVBWidth=Math.abs(l[2]-l[0]),this.DVBHeight=Math.abs(l[1]-l[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-a[0],this.DVBOrigonPoint[1]-a[1]],!0)}},{key:"resetLocation",value:function(t){t&&(this.lonlat=t);var e=this.getLocalXY(this.lonlat);e[0]+=this.XOffset,e[1]+=this.YOffset,this.location=e;var r=this.width,n=this.height,i=this.location;return this.chartBounds=new ye(i[0]-r/2,i[1]+n/2,i[0]+r/2,i[1]-n/2),this.resetLinearGradient(),i}},{key:"resetLinearGradient",value:function(){}},{key:"shapesConvertToRelativeCoordinate",value:function(){for(var t=this.shapes,e=this.location,r=0,n=t.length;r=0?n.push(parseFloat(i[a].toString()).toFixed(r)):n.push(parseFloat(i[a].toString()))}catch(t){throw new Error("not a number")}return n.length===e.length&&n};var pCt=function(t){function e(t,r,n,i,o){var a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(a=lCt(this,e,[t,r,n,i,o])).CLASS_NAME="SuperMap.Feature.Theme.Bar",a}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hCt(t,e)}(e,oCt),r=e,(n=[{key:"destroy",value:function(){cCt(fCt(e.prototype),"destroy",this).call(this)}},{key:"assembleShapes",value:function(){var t={showShadow:!0,shadowBlur:8,shadowColor:"rgba(100,100,100,0.8)",shadowOffsetX:2,shadowOffsetY:2},e=this.setting;if(e.barLinearGradient||(e.barLinearGradient=[["#00FF00","#00CD00"],["#00CCFF","#5E87A2"],["#00FF66","#669985"],["#CCFF00","#94A25E"],["#FF9900","#A2945E"]]),e.dataViewBoxParameter||(void 0===e.useAxis||e.useAxis?e.dataViewBoxParameter=[45,15,15,15]:e.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var r=this.DVBCodomain;this.DVBUnitValue=(r[1]-r[0])/this.DVBHeight;var n=this.dataViewBox,i=this.dataValues;if(!(i.length<1)){for(var o=0,a=i.length;or[1])return;var s=this.calculateXShapeInfo();if(s){var u=s.xPositions,l=s.width;(void 0===e.useBackground||e.useBackground)&&this.shapes.push(Hc.Background(this.shapeFactory,this.chartBox,e)),(void 0===e.useAxis||e.useAxis)&&(this.shapes=this.shapes.concat(Hc.GraphAxis(this.shapeFactory,n,e,s)));for(var c=0;c=e.length&&(r%=e.length);var u=e[r][0],l=e[r][1],c=(new No).getLinearGradient(a,0,s,0,[[0,u],[1,l]]);i.style.color=c}}}}])&&sCt(r.prototype,n),i&&sCt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function dCt(t){"@babel/helpers - typeof";return(dCt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yCt(t,e){for(var r=0;re[1])return;var a=this.calculateXShapeInfo();if(a){var s=a.xPositions,u=a.width;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(Hc.Background(this.shapeFactory,this.chartBox,t)),(!t.axis3DParameter||isNaN(t.axis3DParameter)||t.axis3DParameter<15)&&(t.axis3DParameter=20),(void 0===t.useAxis||t.useAxis)&&(this.shapes=this.shapes.concat(Hc.GraphAxis(this.shapeFactory,r,t,a)));for(var l=t.bar3DParameter&&!isNaN(t.bar3DParameter)?t.bar3DParameter:10,c=0;c=s[2]||s[1]<=s[3])&&(this.DVBOrigonPoint=[s[0],s[3]],this.DVBWidth=Math.abs(s[2]-s[0]),this.DVBHeight=Math.abs(s[1]-s[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-i[0],this.DVBOrigonPoint[1]-i[1]],!0)}}])&&_Ct(r.prototype,n),i&&_Ct(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function OCt(t){"@babel/helpers - typeof";return(OCt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function MCt(t,e){for(var r=0;r0?this.DVBUnitValue=t.maxR/(i[1]-i[0]):this.DVBUnitValue=t.maxR;var o=this.DVBUnitValue,a=n[0]*o+t.minR;if(this.width=2*a,this.height=2*a,this.initBaseParameter()&&(!i||!(n[0]i[1]))){var s=this.DVBCenterPoint,u=new Dl(s[0],s[1],a);u.style=Hc.ShapeStyleTool(null,t.circleStyle,null,null,0),void 0!==t.fillColor?u.style.fillColor=t.fillColor:u.style.fillColor="#ff9277",u.highlightStyle=Hc.ShapeStyleTool(null,t.circleHoverStyle),void 0!==t.circleHoverAble&&(u.hoverable=t.circleHoverAble),void 0!==t.circleClickAble&&(u.clickable=t.circleClickAble),u.refDataID=this.data.id,u.dataInfo={field:this.fields[0],r:a,value:n[0]},this.shapes.push(this.shapeFactory.createShape(u)),this.shapesConvertToRelativeCoordinate()}}}])&&MCt(r.prototype,n),i&&MCt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function BCt(t){"@babel/helpers - typeof";return(BCt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function FCt(t,e){for(var r=0;rr[1])return null;a=u[f],s=e[1]-(i[f]-r[0])/n;var p=new ju(a,s);p.style=Hc.ShapeStyleTool({fillColor:"#ee9900"},t.pointStyle,t.pointStyleByFields,t.pointStyleByCodomain,f,i[f]),p.highlightStyle=Hc.ShapeStyleTool(null,t.pointHoverStyle),void 0!==t.pointHoverAble&&(p.hoverable=t.pointHoverAble),void 0!==t.pointClickAble&&(p.clickable=t.pointClickAble),p.refDataID=this.data.id,p.dataInfo={field:this.fields[f],value:i[f]},c.push(this.shapeFactory.createShape(p));var d=[a,s];l.push(d)}var y=new Hu(l);y.style=Hc.ShapeStyleTool({strokeColor:"#ee9900"},t.lineStyle),y.clickable=!1,y.hoverable=!1;var g=this.shapeFactory.createShape(y);this.shapes.push(g),this.shapes=this.shapes.concat(c),this.shapesConvertToRelativeCoordinate()}}}}},{key:"calculateXShapeInfo",value:function(){var t,e=this.dataViewBox,r=this.setting,n=this.dataValues.length;if(n<1)return null;var i=[],o=this.DVBWidth,a=0;if(r.xShapeBlank&&r.xShapeBlank.length&&2==r.xShapeBlank.length){var s=o-((t=r.xShapeBlank)[0]+t[1]);if(s<=n)return null;a=s/(n-1)}else t=[a=o/(n+1),a,a];for(var u=0,l=0;ln[1])return;for(var o=0,a=0;a=360&&(c=359.9999999);var y=new pl(u[0],u[1],h,l,c);if(void 0===t.sectorStyleByFields){var g=p%e.length;y.style=Hc.ShapeStyleTool(null,t.sectorStyle,e,null,g)}else y.style=Hc.ShapeStyleTool(null,t.sectorStyle,t.sectorStyleByFields,t.sectorStyleByCodomain,p,r[p]);y.highlightStyle=Hc.ShapeStyleTool(null,t.sectorHoverStyle),void 0!==t.sectorHoverAble&&(y.hoverable=t.sectorHoverAble),void 0!==t.sectorClickAble&&(y.clickable=t.sectorClickAble),y.refDataID=this.data.id,y.dataInfo={field:this.fields[p],value:r[p]},this.shapes.push(this.shapeFactory.createShape(y)),l=c}this.shapesConvertToRelativeCoordinate()}}}}])&&WCt(r.prototype,n),i&&WCt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function tkt(t){"@babel/helpers - typeof";return(tkt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ekt(t,e){for(var r=0;rr[1])return null;a=u[l],s=e[1]-(i[l]-r[0])/n;var f=new ju(a,s);f.style=Hc.ShapeStyleTool({fillColor:"#ee9900"},t.pointStyle,t.pointStyleByFields,t.pointStyleByCodomain,l,i[l]),f.highlightStyle=Hc.ShapeStyleTool(null,t.pointHoverStyle),void 0!==t.pointHoverAble&&(f.hoverable=t.pointHoverAble),void 0!==t.pointClickAble&&(f.clickable=t.pointClickAble),f.refDataID=this.data.id,f.dataInfo={field:this.fields[l],value:i[l]},this.shapes.push(this.shapeFactory.createShape(f))}this.shapesConvertToRelativeCoordinate()}}}},{key:"calculateXShapeInfo",value:function(){var t,e=this.dataViewBox,r=this.setting,n=this.dataValues.length;if(n<1)return null;var i=[],o=this.DVBWidth,a=0;if(r.xShapeBlank&&r.xShapeBlank.length&&2==r.xShapeBlank.length){var s=o-((t=r.xShapeBlank)[0]+t[1]);if(s<=n)return null;a=s/(n-1)}else t=[a=o/(n+1),a,a];for(var u=0,l=0;ln[1])return;for(var o=0,a=0;a=0&&e.innerRingRadius1&&void 0!==arguments[1]?arguments[1]:"warring";"success"===e?(this.icon.setAttribute("class","supermapol-icons-message-success"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-green")):"failure"===e?(this.icon.setAttribute("class","supermapol-icons-message-failure"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-red")):"warring"===e&&(this.icon.setAttribute("class","supermapol-icons-message-warning"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-orange")),this.messageBox.innerHTML=t,this.messageBoxContainer.hidden=!1}}])&&xkt(t.prototype,e),r&&xkt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),Skt=function(){try{return echarts}catch(t){return{}}}(),Ekt={"en-US":{title_dataFlowService:"Data Flow Service",title_distributedAnalysis:"Distributed Analysis",title_clientComputing:"Client Computing",title_dataServiceQuery:"Data Service Query",title_searchCity:"Search city",title_searchLayer:" Search layer",text_input_value_inputDataFlowUrl:"Please enter the data stream service address such as: ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe",text_displayFeaturesInfo:"Display feature information",text_subscribe:"subscribe",text_cancelSubscribe:"unsubscribe",text_densityAnalysis:"Density Analysis",text_CalculateTheValuePerUnitArea:"Calculate the value per unit area within the neighborhood shape",text_option_selectDataset:"Please select a dataset",text_label_dataset:"Dataset",text_option_simplePointDensityAnalysis:"Simple point density analysis",text_option_nuclearDensityAnalysis:"Nuclear density analysis",text_label_analyticalMethod:"Analytical method",text_option_quadrilateral:"Quadrilateral",text_option_hexagon:"hexagon",text_label_meshType:"Mesh type",text_option_notSet:"Not set",text_label_weightField:"Weight field",text_label_gridSizeInMeters:"Grid size",text_label_searchRadius:"Search radius",text_label_queryRange:"Scope of analysis",text_label_areaUnit:"Area unit",text_option_equidistantSegmentation:"Equidistant segmentation",text_option_logarithm:"Logarithm",text_option_equalCountingSegment:"Equal counting segment",text_option_squareRootSegmentation:"Square root segmentation",text_label_thematicMapSegmentationMode:"Thematic map segmentation mode",text_label_thematicMapSegmentationParameters:"Thematic map segmentation parameters",text_option_greenOrangePurpleGradient:"Green orange purple gradient",text_option_greenOrangeRedGradient:"Green orange red gradient",text_option_rainbowGradient:"Rainbow gradient",text_option_spectralGradient:"Spectral gradient",text_option_terrainGradient:"Terrain gradient",text_label_thematicMapColorGradientMode:"Thematic map color gradient mode",text_label_resultLayerName:"Result layer name",text_chooseFile:"Open File",text_isoline:"Isoline",text_extractDiscreteValue:"Extract discrete value generation curve",text_buffer:"Buffer",text_specifyTheDistance:"Specify the distance to create the surrounding area",text_label_analysisLayer:"Analysis layer",text_label_extractField:"Extract field",text_label_extractedValue:"Extracted value",text_label_distanceAttenuation:"Distance attenuation",text_label_gridSize:"gridSize",text_label_bufferRadius:"Buffer radius",text_label_defaultkilometers:"Default 10 kilometers",text_label_kilometer:"kilometer",text_label_unit:"unit",text_retainOriginal:"Retain original object field",text_mergeBuffer:"Merge buffer",text_label_color:"Color",text_label_buffer:"[Buffer]",text_label_isolines:"[Isolines]",text_label_queryRangeTips:"The default is the full range of input data. Example: -74.050, 40.650, -73.850, 40.850",text_label_queryModel:"Query mode",text_label_IDArrayOfFeatures:"ID array of features",text_label_maxFeatures:"The maximum number of features that can be returned",text_label_bufferDistance:"Buffer distance",text_label_queryRange1:"Query range",text_label_spatialQueryMode:"Spatial query mode",text_label_featureFilter:"Feature filter",text_label_geometricObject:"Geometric object",text_label_queryMode:"Query mode",text_label_searchTips:"Search for city locations or layer features",text_label_chooseSearchLayers:"Select a query layer",text_loadSearchCriteria:"Load search criteria",text_saveSearchCriteria:"Save search criteria",btn_analyze:"Analyze",btn_analyzing:"Analyzing",btn_emptyTheAnalysisLayer:"Empty the analysis layer",btn_cancelAnalysis:"Cancel",btn_query:"Query",btn_querying:"Querying",btn_emptyTheRresultLayer:"Clear all result layers","msg_dataReturnedIsEmpty.":"The request is successful and the data returned by the query is empty.",msg_dataFlowServiceHasBeenSubscribed:"The data stream service has been subscribed to.",msg_inputDataFlowUrlFirst:"Please enter the data stream service address first.",msg_datasetOrMethodUnsupport:"This dataset does not support this analysis type. Please reselect the dataset.",msg_selectDataset:"Please select a data set!",msg_setTheWeightField:"Please set the weight field!",msg_theFieldNotSupportAnalysis:"The field you currently select does not support analysis!",msg_resultIsEmpty:"The result of the analysis is empty!",msg_openFileFail:"Failed to open file!",msg_fileTypeUnsupported:"File format is not supported!",msg_fileSizeExceeded:"File size exceeded! The file size should not exceed 10M!",msg_dataInWrongGeoJSONFormat:"Wrong data format! Non standard GEOJSON format data!",msg_dataInWrongFormat:"Wrong data format! Non standard EXCEL, CSV or GEOJSON format data!",msg_searchKeywords:"Search keywords cannot be empty. Please enter your search criteria.",msg_searchGeocodeField:"Did not match the address matching service data!",msg_cityGeocodeField:"The address matching service of the current city is not configured.",msg_getFeatureField:"No related vector features found!",msg_dataflowservicesubscribed:"The data stream service has been subscribed to.",msg_subscribesucceeded:"The data stream service subscription was successful.",msg_crsunsupport:"Does not support the coordinate system of the current map",msg_tilematrixsetunsupport:"Incoming TileMatrixSet is not supported",msg_jsonResolveFiled:"JSON format parsing failure!",msg_requestContentFiled:"Failed to request data through iportal!",msg_getdatafailed:"Failed to get data!"},"zh-CN":{title_dataFlowService:"数据流服务",title_distributedAnalysis:"分布式分析",title_clientComputing:"客户端计算",title_dataServiceQuery:"数据服务查询",title_searchCity:"搜索城市",title_searchLayer:"搜索图层",text_input_value_inputDataFlowUrl:"请输入数据流服务地址如:ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe",text_displayFeaturesInfo:"显示要素信息",text_subscribe:"订阅",text_cancelSubscribe:"取消订阅",text_densityAnalysis:"密度分析",text_CalculateTheValuePerUnitArea:"计算点指定邻域形状内的每单位面积量值",text_option_selectDataset:"请选择数据集",text_label_dataset:"数据集",text_option_simplePointDensityAnalysis:"简单点密度分析",text_option_nuclearDensityAnalysis:"核密度分析",text_label_analyticalMethod:"分析方法",text_option_quadrilateral:"四边形",text_option_hexagon:"六边形",text_label_meshType:"网格面类型",text_option_notSet:"未设置",text_label_weightField:"权重字段",text_label_gridSizeInMeters:"网格大小",text_label_searchRadius:"搜索半径",text_label_queryRange:"分析范围",text_label_areaUnit:"面积单位",text_option_equidistantSegmentation:"等距离分段",text_option_logarithm:"对数",text_option_equalCountingSegment:"等计数分段",text_option_squareRootSegmentation:"平方根分段",text_label_thematicMapSegmentationMode:"专题图分段模式",text_label_thematicMapSegmentationParameters:"专题图分段参数",text_option_greenOrangePurpleGradient:"绿橙紫渐变",text_option_greenOrangeRedGradient:"绿橙红渐变",text_option_rainbowGradient:"彩虹渐变",text_option_spectralGradient:"光谱渐变",text_option_terrainGradient:"地形渐变",text_label_thematicMapColorGradientMode:"专题图颜色渐变模式",text_label_resultLayerName:"结果图层名称",text_chooseFile:"选择文件",text_isoline:"等值线",text_extractDiscreteValue:"提取离散值生成曲线",text_buffer:"缓冲区",text_specifyTheDistance:"指定距离创建周边区域",text_label_analysisLayer:"分析图层",text_label_extractField:"提取字段",text_label_extractedValue:"提取值",text_label_distanceAttenuation:"距离衰减",text_label_gridSize:"栅格大小",text_label_bufferRadius:"缓冲半径",text_label_defaultkilometers:"默认10千米",text_option_kilometer:"千米",text_label_unit:"单位",text_retainOriginal:"保留原对象字段属性",text_mergeBuffer:"合并缓冲区",text_label_color:"颜色",text_label_buffer:"[缓冲区]",text_label_isolines:"[等值线]",text_label_queryRangeTips:"默认为输入数据的全幅范围。范例:-74.050,40.650,-73.850,40.850",text_label_IDArrayOfFeatures:"要素 ID 数组",text_label_maxFeatures:"最多可返回的要素数量",text_label_bufferDistance:"缓冲区距离",text_label_queryRange1:"查询范围",text_label_spatialQueryMode:"空间查询模式",text_label_featureFilter:"要素过滤器",text_label_geometricObject:"几何对象",text_label_queryMode:"查询模式",text_label_searchTips:"搜索城市地点或图层要素",text_label_chooseSearchLayers:"选择查询图层",text_loadSearchCriteria:"加载搜索条件",text_saveSearchCriteria:"保存搜索条件",btn_analyze:"分析",btn_analyzing:"分析中",btn_emptyTheAnalysisLayer:"清空分析图层",btn_cancelAnalysis:"取消",btn_query:"查询",btn_querying:"查询中",btn_emptyTheRresultLayer:"清除所有结果图层",msg_dataFlowServiceHasBeenSubscribed:"已订阅该数据流服务。",msg_inputDataFlowUrlFirst:"请先输入数据流服务地址。",msg_datasetOrMethodUnsupport:"该数据集不支持本分析类型,请重新选择数据集",msg_selectDataset:"请选择数据集!",msg_setTheWeightField:"请设置权重字段!",msg_theFieldNotSupportAnalysis:"您当前选择的字段不支持分析!",msg_resultIsEmpty:"分析的结果为空!",msg_dataReturnedIsEmpty:"请求成功,查询返回的数据为空。",msg_openFileFail:"打开文件失败!",msg_fileTypeUnsupported:"不支持该文件格式!",msg_fileSizeExceeded:"文件大小超限!文件大小不得超过 10M!",msg_dataInWrongGeoJSONFormat:"数据格式错误!非标准的 GEOJSON 格式数据!",msg_dataInWrongFormat:"数据格式错误!非标准的 EXCEL, CSV 或 GEOJSON 格式数据!",msg_searchKeywords:"搜索关键字不能为空,请输入搜索条件。",msg_searchGeocodeField:"未匹配到地址匹配服务数据!",msg_cityGeocodeField:"未配置当前城市的地址匹配服务。",msg_getFeatureField:"未查找到相关矢量要素!",msg_dataflowservicesubscribed:"已订阅该数据流服务。",msg_subscribesucceeded:"数据流服务订阅成功。",msg_crsunsupport:"不支持当前地图的坐标系",msg_tilematrixsetunsupport:"不支持传入的TileMatrixSet",msg_jsonResolveFiled:"json格式解析失败!",msg_requestContentFiled:"通过iportal请求数据失败!",msg_getdatafailed:"获取数据失败!"},code:null,defaultCode:"en-US",getCode:function(){return Ekt.code||Ekt.setCode(),Ekt.code},setCode:function(){var t=this.getLanguageFromCookie();t||(t=Ekt.defaultCode,t="Netscape"===navigator.appName?navigator.language:navigator.browserLanguage),0===t.indexOf("zh")&&(t="zh-CN"),0===t.indexOf("en")&&(t="en-US"),Ekt.code=t},getLanguageFromCookie:function(){for(var t=document.cookie.split(";"),e=0;e0){var a=o.SheetNames[0],s=Ckt.utils.sheet_to_csv(o.Sheets[a]);e&&e.call(n,s)}}catch(t){r&&r.call(n,t)}},i.onerror=function(t){r&&r.call(n,t)},this.rABF&&i.readAsArrayBuffer(t.file)},processDataToGeoJson:function(t,e,r,n,i){var o=null;if("EXCEL"===t||"CSV"===t)o=this.processExcelDataToGeoJson(e),r&&r.call(i,o);else if("JSON"===t||"GEOJSON"===t){var a=e;"string"==typeof a&&(a=JSON.parse(a)),"ISERVER"===a.type?o=a.data.recordsets[0].features:"FeatureCollection"===a.type?o=a:n&&n.call(i,Ekt.i18n("msg_dataInWrongGeoJSONFormat")),r&&r.call(i,o)}else n&&n.call(i,Ekt.i18n("msg_dataInWrongFormat"))},processExcelDataToGeoJson:function(t){for(var e=this.string2Csv(t),r=e.colTitles,n=-1,i=-1,o=0,a=r.length;o0?(n.dataItemServices.forEach(function(n){if("RESTDATA"===n.serviceType&&"PUBLISHED"===n.serviceStatus)i=n;else{if("RESTMAP"!==n.serviceType||"PUBLISHED"!==n.serviceStatus)return void r.getDatafromContent(t,e);i=n}}),i&&r.getDatafromRest(i.serviceType,i.address,e)):r.getDatafromContent(t,e):r._fireFailedEvent(n)}).catch(function(t){console.log(t),r._fireFailedEvent(t)})}},{key:"getDatafromContent",value:function(t,e){var r=this,n={result:{}},i=this;t+="/content.json?pageSize=9999999¤tPage=1",ut.get(t,null,{withCredentials:this.datasets.withCredentials}).then(function(t){return t.json()}).then(function(t){if(!1!==t.succeed){if(t.type){if("JSON"===t.type||"GEOJSON"===t.type){if(t.content=JSON.parse(t.content.trim()),!t.content.features)return void console.log(Ekt.i18n("msg_jsonResolveFiled"));var o=r._formatGeoJSON(t.content);n.result.features={type:t.content.type,features:o}}else if("EXCEL"===t.type||"CSV"===t.type){var a=r._excelData2Feature(t.content);n.result.features={type:"FeatureCollection",features:a}}e(n,"content")}}else i._fireFailedEvent(t)},this).catch(function(t){console.log(t),i._fireFailedEvent(t)})}},{key:"getDatafromRest",value:function(t,e,r){var n=this,i=this.datasets.withCredentials;if("RESTDATA"===t){var o,a,s="".concat(e,"/data/datasources");ut.get(s,null,{withCredentials:i}).then(function(t){return t.json()}).then(function(t){o=t.datasourceNames[0],s="".concat(e,"/data/datasources/").concat(o,"/datasets"),ut.get(s,null,{withCredentials:i}).then(function(t){return t.json()}).then(function(t){return a=t.datasetNames[0],n.getDatafromRestData("".concat(e,"/data"),[o+":"+a],r),[o+":"+a]}).catch(function(t){n._fireFailedEvent(t)})}).catch(function(t){n._fireFailedEvent(t)})}else{var u,l,c,f="".concat(e,"/maps");ut.get(f,null,{withCredentials:i}).then(function(t){return t.json()}).then(function(t){u=t[0].name,c=t[0].path,f=f="".concat(e,"/maps/").concat(u,"/layers"),ut.get(f,null,{withCredentials:i}).then(function(t){return t.json()}).then(function(t){return l=t[0].subLayers.layers[0].caption,n.getDatafromRestMap(l,c,r),l}).catch(function(t){n._fireFailedEvent(t)})}).catch(function(t){n._fireFailedEvent(t)})}}},{key:"getDatafromRestData",value:function(t,e,r){var n=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"SmID>0",this._getFeatureBySQL(t,e,this.datasets.queryInfo,function(t){r(t,"RESTDATA")},function(t){console.log(t),n._fireFailedEvent(t)})}},{key:"getDatafromRestMap",value:function(t,e,r){var n=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"smid=1",this._queryFeatureBySQL(e,t,this.datasets.queryInfo,null,null,function(t){r(t,"RESTMAP")},function(t){console.log(t),n._fireFailedEvent(t)})}},{key:"_getFeatureBySQL",value:function(t,e,r,n,i){var o,a,s={name:e.join().replace(":","@")};Object.assign(s,r),o=new w1(s),a=new K1({queryParameter:o,datasetNames:e,fromIndex:0,toIndex:1e5,returnContent:!0}),new i2(t).processAsync(a,function(t){"processCompleted"===t.type?n&&n(t):i&&i(t)})}},{key:"_queryFeatureBySQL",value:function(t,e,r,n,i,o,a,s,u,l){var c,f,h={name:e};Object.assign(h,r),c=new w1(h),n&&(c.fields=n);var p={queryParams:[c]};l&&(p.queryOption=In.ATTRIBUTE),s&&(p.startRecord=s),u&&(p.expectCount=u),i&&(p.prjCoordSys={epsgCode:i}),f=new Iut(p),this._queryBySQL(t,f,function(t){"processCompleted"===t.type?o(t):a(t)})}},{key:"_queryBySQL",value:function(t,e,r,n){new Rut(t,{format:this._processFormat(n)}).processAsync(e,r)}},{key:"_processFormat",value:function(t){return t||En.GEOJSON}},{key:"_formatGeoJSON",value:function(t){var e=t.features;return e.forEach(function(t,e){t.properties.index=e}),e}},{key:"_excelData2Feature",value:function(t){for(var e=t.colTitles,r=-1,n=-1,i=0,o=e.length;i=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Nkt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&t.forEach(function(t){t.xAxis&&e.xField.push({field:t.xAxis.field,name:t.xAxis.name}),t.yAxis&&e.yField.push({field:t.yAxis.field,name:t.yAxis.name})})}},{key:"getDatasetInfo",value:function(t){var e=this;this.createChart=t,this.datasets&&this._checkUrl(this.datasets.url)&&(this.chartModel=new Mkt(this.datasets),"iServer"===this.datasets.type?this.chartModel.getDatasetInfo(this._getDatasetInfoSuccess.bind(this)):"iPortal"===this.datasets.type&&this.chartModel.getDataInfoByIptl(this._getDataInfoSuccess.bind(this)),this.chartModel.events.on({getdatafailed:function(t){e.events.triggerEvent("getdatafailed",t)}}))}},{key:"_getDatasetInfoSuccess",value:function(t){var e=this.datasets.url,r=e.indexOf("rest");if(r>0){var n=e.indexOf("/",r+5),i=e.substring(r+5,n),o=e.substring(0,r+4)+"/data";if("maps"===i){var a=e.indexOf("/",n+1),s=e.substring(n+1,a);o=e.substring(0,r+4)+"/maps/"+s,t.result.dataUrl=o,this._getLayerFeatures(t)}else"data"===i&&(t.result.dataUrl=o,this._getDataFeatures(t))}}},{key:"_getDataInfoSuccess",value:function(t,e){"RESTMAP"===e?this._getChartDatasFromLayer(t):this._getChartDatas(t)}},{key:"_getDataFeatures",value:function(t){this.chartModel.getDataFeatures(t,this._getChartDatas.bind(this))}},{key:"_getLayerFeatures",value:function(t){this.chartModel.getLayerFeatures(t,this._getChartDatasFromLayer.bind(this))}},{key:"_getChartDatas",value:function(t){if(t){this.features=t.result.features;var e=this.features.features,r={};if(e.length){var n=e[0],i=[],o=[];for(var a in n.properties)i.push(a),o.push(this._getDataType(n.properties[a]));for(var s in r={features:e,fieldCaptions:i,fieldTypes:o,fieldValues:[]},o){var u=[];for(var l in e){var c=e[l],f=r.fieldCaptions[s],h=c.properties[f];u.push(h)}r.fieldValues.push(u)}this.createChart(r)}}}},{key:"_getChartDatasFromLayer",value:function(t){if(t.result.recordsets){var e=t.result.recordsets[0],r=e.features.features;this.features=e.features;var n={};if(r.length){for(var i in(n={features:e.features,fieldCaptions:e.fieldCaptions,fieldTypes:e.fieldTypes,fieldValues:[]}).fieldCaptions){var o=[];for(var a in r){var s=r[a],u=n.fieldCaptions[i],l=s.properties[u];o.push(l)}n.fieldValues.push(o)}this.createChart(n)}}}},{key:"_createChartOptions",value:function(t){return this.calculatedData=this._createChartDatas(t),this.updateChartOptions(this.chartType)}},{key:"changeType",value:function(t){if(t!==this.chartType)return this.chartType=t,this.updateChartOptions(this.chartType)}},{key:"updateData",value:function(t,e,r){this.updateChart=r,this.xField=[],this.yField=[],this._initXYField(e),t.type=t.type||"iServer",t.withCredentials=t.withCredentials||!1,this.datasets=t,this.getDatasetInfo(this._updateDataSuccess.bind(this))}},{key:"_updateDataSuccess",value:function(t){var e=this._createChartOptions(t);this.updateChart(e)}},{key:"updateChartOptions",value:function(t,e){if(this.calculatedData){var r=this.grid,n=this._createChartSeries(this.calculatedData,t),i=[];for(var o in this.calculatedData.XData)i.push({value:this.calculatedData.XData[o].fieldsData});var a={type:"category",name:this.xField[0].name||"X",data:i,nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},s={type:"value",name:this.yFieldName||"Y",data:{},nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},u={formatter:"{b0}: {c0}"},l="#404a59";return e&&(e.grid&&(r=e.grid),e.tooltip&&(u=e.tooltip),e.backgroundColor&&(l=e.backgroundColor)),{backgroundColor:l,grid:r,series:n,xAxis:a,yAxis:s,tooltip:u}}}},{key:"_createChartDatas",value:function(t){var e=0,r=[],n=t.fieldCaptions,i=this;n.forEach(function(t,r){i.xField[0]&&t===i.xField[0].field&&(e=r)}),this.yFieldName="",this.yField.forEach(function(t,e){0!==e&&(i.yFieldName=i.yFieldName+","),i.yFieldName=i.yFieldName+t.name,n.forEach(function(e,n){e===t.field&&r.push(n)})});var o=this._getAttrData(t,e),a=[];if(r.length>0)r.forEach(function(e){var r=[];for(var n in t.fieldValues[e])r.push({value:t.fieldValues[e][n]});a.push(r)});else{for(var s=[],u=[],l=o.length,c=0;c0;t--)this.header.removeChild(this.header.children[t]),this.content.removeChild(this.content.children[t])}},{key:"_changeTabsPage",value:function(t){for(var e=t.target.index,r=0;r0;e--)this.content.removeChild(this.content.children[e-1]);var r=this.config[t];for(var n in r)this._createCityItem(n,r[n])}},{key:"_createCityItem",value:function(t,e){var r=document.createElement("div"),n=document.createElement("div");n.setAttribute("class","component-citytabpag__py-key"),n.innerHTML=t,r.appendChild(n);var i=document.createElement("div");i.setAttribute("class","component-citytabpag__content");for(var o=0;o0&&this.appendTabs(t),this.rootContainer=e}},{key:"setTabs",value:function(t){this.removeAllTabs(),this.appendTabs(t)}},{key:"appendTabs",value:function(t){for(var e=0;e0;t--)this.navTabsTitle.removeChild(this.navTabsTitle.children[t]),this.navTabsContent.removeChild(this.navTabsContent.children[t])}},{key:"_changeTabsPage",value:function(t){for(var e=t.target.index,r=0;r=0;t--)this.content.removeChild(this.content.children[t])}},{key:"setPageLink",value:function(t){this.pageNumberLis=[],this.currentPageNumberLis=[],this.clearPageLink(),this._createPageLi(t),this._appendPageLink()}},{key:"_createPageLi",value:function(t){for(var e=0;e1;t--)this.link.removeChild(this.link.children[t])}},{key:"_createLink",value:function(t){for(var e=0;e<4;e++){var r=document.createElement("li");r.setAttribute("class","disable");var n=document.createElement("span");r.appendChild(n),0===e?(n.id="first",n.setAttribute("class","supermapol-icons-first")):1===e?(n.id="prev",n.setAttribute("class","supermapol-icons-prev")):2===e?(n.id="next",n.setAttribute("class","supermapol-icons-next")):3===e&&(n.id="last",n.setAttribute("class","supermapol-icons-last")),t.appendChild(r)}}},{key:"_changePageEvent",value:function(t){var e=t.target;if("disable"!==e.parentElement.classList[0]){var r;if(e.id)r=e.id;else{if(!Number(e.innerHTML))return;r=Number(e.innerHTML)}this._prePageNum(r),this.clearPageLink(),this._appendPageLink()}}},{key:"_changeDisableState",value:function(){this.link.children[0].setAttribute("class",""),this.link.children[1].setAttribute("class",""),this.link.children[this.link.children.length-1].setAttribute("class",""),this.link.children[this.link.children.length-2].setAttribute("class",""),1===this.currentPage&&(this.link.children[0].setAttribute("class","disable"),this.link.children[1].setAttribute("class","disable")),this.currentPage===this.pageNumberLis.length&&(this.link.children[this.link.children.length-1].setAttribute("class","disable"),this.link.children[this.link.children.length-2].setAttribute("class","disable"))}},{key:"_prePageNum",value:function(t){var e=[];if(this.currentPage="first"===t?1:"last"===t?this.pageNumberLis.length:"prev"===t?this.currentPage-1:"next"===t?this.currentPage+1:t,this.pageNumberLis.length<=5)for(var r=0;r=this.pageNumberLis.length-3)for(var i=this.pageNumberLis.length-5;i0&&(this.currentPageNumberLis=e)}}])&&XIt(r.prototype,n),i&&XIt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}(),eTt=function(){try{return canvg}catch(t){return{}}}(),rTt=r.n(eTt);function nTt(t,e,r){if(null!==t)for(var n,i,o,a,s,u,l,c,f=0,h=0,p=t.type,d="FeatureCollection"===p,y="Feature"===p,g=d?t.features.length:1,v=0;vt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function fTt(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function hTt(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){fTt(o,n,i,a,s,"next",t)}function s(t){fTt(o,n,i,a,s,"throw",t)}a(void 0)})}}function pTt(t){"@babel/helpers - typeof";return(pTt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dTt(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),"string"==typeof e||"number"==typeof e?this.mapId=e:null!==e&&"object"===pTt(e)&&(this.mapInfo=e),this.serverUrl=r.serverUrl||"https://www.supermapol.com",this.credentialKey=r.credentialKey,this.credentialValue=r.credentialValue,this.tiandituKey=r.tiandituKey||"",this.withCredentials=r.withCredentials||!1,this.excludePortalProxyUrl=r.excludePortalProxyUrl,this.iportalServiceProxyUrl=r.iportalServiceProxyUrlPrefix,this.proxy=r.proxy,this.proxyOptions={data:"apps/viewer/getUrlResource.json?url=",image:"apps/viewer/getUrlResource.png?url="}},(e=[{key:"setMapId",value:function(t){"string"==typeof t||"number"==typeof t?(this.mapId=t,this.mapInfo=null):null!==t&&"object"===pTt(t)&&(this.mapInfo=t,this.mapId="")}},{key:"setServerUrl",value:function(t){this.serverUrl=t}},{key:"setWithCredentials",value:function(t){this.withCredentials=t}},{key:"setProxy",value:function(t){this.proxy=t}},{key:"handleServerUrl",value:function(t){var e=Fi(t);return this.serverUrl=e,e}},{key:"getMapInfo",value:function(){var t=hTt(cTt().mark(function t(){var e,r=this;return cTt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.mapId||!this.mapInfo){t.next=2;break}return t.abrupt("return",new Promise(function(t){t(r.mapInfo)}));case 2:return e=this._handleMapUrl(),t.prev=3,t.next=6,this.getiPortalServiceProxy();case 6:return t.abrupt("return",new Promise(function(t,n){ut.get(e,null,{withCredentials:r.withCredentials}).then(function(t){return t.json()}).then(function(e){if(e&&!1===e.succeed){var r={message:e&&e.error&&e.error.errorMsg};n(r)}else e.mapParams={title:e.title,description:e.description},t(e)}).catch(function(t){n(t)})}));case 9:return t.prev=9,t.t0=t.catch(3),t.abrupt("return",Promise.reject(t.t0));case 12:case"end":return t.stop()}},t,this,[[3,9]])}));return function(){return t.apply(this,arguments)}}()},{key:"getiPortalServiceProxy",value:function(){var t=this;return new Promise(function(e,r){ut.get("".concat(t.serverUrl,"web/config/portal.json"),{scope:["serviceProxy"]}).then(function(t){return t.json()}).then(function(n){if(n&&n.serviceProxy){var i=n.serviceProxy;i.enable&&(i.proxyServerRootUrl?t.iportalServiceProxyUrl=i.proxyServerRootUrl:i.port&&i.rootUrlPostfix&&(t.iportalServiceProxyUrl="".concat(i.port,"/").concat(i.rootUrlPostfix)),t.serverUrl.indexOf(t.iportalServiceProxyUrl)>-1&&(t.iportalServiceProxyUrl="")),e(i)}else r("serviceProxyFailed")}).catch(function(t){r(t)})})}},{key:"getLayerFeatures",value:function(t,e,r){var n;switch(t){case"hosted":n=this._getFeaturesFromHosted(e,r);break;case"rest_data":n=this._getFeaturesFromRestData(e,r);break;case"rest_map":n=this._getFeaturesFromRestMap(e);break;case"dataflow":n=this._getFeaturesFromDataflow(e);break;case"user_data":n=this._getFeaturesFromUserData(e)}return n}},{key:"getWmsInfo",value:function(t){var e=this;return new Promise(function(r){var n=e.handleProxy(),i=$.urlAppend(t.url,"REQUEST=GetCapabilities&SERVICE=WMS");ut.get(i,null,{withCredentials:e.handleWithCredentials(n,t.url,!1),withoutFormatSuffix:!0,proxy:n}).then(function(t){return t.text()}).then(function(t){var e=new sTt.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"@_"}).parse(t),n=e.WMT_MS_Capabilities||e.WMS_Capabilities,i=n.Capability.Layer.LatLonBoundingBox,o=null;i&&(o=[+i["@_minx"],+i["@_miny"],+i["@_maxx"],+i["@_maxy"]]);var a=n.Capability.Layer.EX_GeographicBoundingBox;a&&(o=[+a.westBoundLongitude,+a.southBoundLatitude,+a.eastBoundLongitude,+a.northBoundLatitude]),r({version:n["@_version"],bounds:o})})})}},{key:"getMapBoxStyle",value:function(t){return new Promise(function(e,r){ut.get(t).then(function(t){return t.json()}).then(function(t){e(t)}).catch(function(t){r(t)})})}},{key:"getWmtsInfo",value:function(t,e){var r=this;return new Promise(function(n,i){var o,a=!1,s=22,u=0,l="",c="",f="",h=r.handleProxy(),p=$.urlAppend(t.url,"REQUEST=GetCapabilities&SERVICE=WMTS&VERSION=1.0.0");p=r.handleParentRes(p),ut.get(p,null,{withCredentials:r.handleWithCredentials(h,t.url,!1),withoutFormatSuffix:!0,proxy:h}).then(function(t){return t.text()}).then(function(i){var h=["Layer","TileMatrixSet","ows:Operation","ows:Get","ResourceURL","Style"],p=new sTt.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"@_",isArray:function(t){if(-1!==h.indexOf(t))return!0}}).parse(i).Capabilities,d=p.Contents,y=p["ows:OperationsMetadata"];if(y){var g=y["ows:Operation"];Array.isArray(g)||(g=[g]);var v=g.find(function(t){return"GetTile"===t["@_name"]});if(v){var m=v["ows:DCP"]["ows:HTTP"]["ows:Get"];Array.isArray(m)||(m=[m]);var b=m.find(function(t){return"KVP"===t["ows:Constraint"]["ows:AllowedValues"]["ows:Value"]});b&&(f=b["@_xlink:href"])}}for(var A=d.TileMatrixSet,x=0;x0)break}var M=Object.keys(w).map(function(t){return+t});if(s=M.length>0?Math.max.apply(Math,uTt(M)):void 0,u=M.length>0?Math.min.apply(Math,uTt(M)):void 0,0===M.length)throw Error("TileMatrixSetNotSuppport");a=!0}break}var P=d.Layer&&d.Layer.find(function(e){return e["ows:Identifier"]===t.layer});if(P){var L=P.Style;if(l=Array.isArray(P.Style)?L[0]["ows:Identifier"]?L[0]["ows:Identifier"]:"":L["ows:Identifier"]?L["ows:Identifier"]:"",P["ows:WGS84BoundingBox"]){var N=P["ows:WGS84BoundingBox"]["ows:LowerCorner"].split(" "),j=P["ows:WGS84BoundingBox"]["ows:UpperCorner"].split(" ");o=[parseFloat(N[0]),parseFloat(N[1]),parseFloat(j[0]),parseFloat(j[1])]}var R=P.ResourceURL;Array.isArray(R)||(R=[R]);var D=R.find(function(t){return"tile"===t["@_resourceType"]});D&&(c=D["@_template"])}n({isMatched:a,matchMaxZoom:s,matchMinZoom:u,style:l,bounds:o,restResourceURL:c,kvpResourceUrl:f})}).catch(function(t){i(t)})})}},{key:"_getFeaturesFromHosted",value:function(t,e){var r=t.dataSource,n=t.layerType,i=r?r.serverId:t.serverId;return i?"MARKER"===n||r&&(!r.accessType||"DIRECT"===r.accessType)?this._getDataFromIportal(i,t):this._getDataFromHosted({layer:t,serverId:i,baseProjection:e}):new Promise(function(t){t({type:"noServerId"})})}},{key:"_getFeaturesFromRestData",value:function(t,e){var r,n=this,i=t.dataSource;return new Promise(function(o,a){n._getFeatureBySQL(i.url,[decodeURIComponent(i.dataSourceName)||t.name],function(t){t.result.features?(r=n.parseGeoJsonData2Feature({allDatas:{features:t.result.features.features}}),o({type:"feature",features:r})):a("features must be valid")},function(t){a(t)},e)})}},{key:"_getFeaturesFromRestMap",value:function(t){var e=this;return new Promise(function(r,n){e._queryFeatureBySQL(t.dataSource.url,t.dataSource.layerName,function(i){var o=i&&i.result.recordsets,a=o&&o[0],s=a.fields;if(a&&s){var u=[];for(var l in s){var c=s[l];0===c.indexOf("Sm")&&"SmID"!==c||u.push(c)}e._getFeatures(u,t,function(t){r({type:"feature",features:t})},function(t){n(t)})}},function(t){n(t)},"smid=1")})}},{key:"_getFeaturesFromUserData",value:function(t){var e=this,r=t.dataSource;return new Promise(function(t,n){var i=e.handleProxy(),o=e.handleParentRes(r.url);ut.get(o,null,{withCredentials:e.handleWithCredentials(i,o,e.withCredentials),proxy:i,withoutFormatSuffix:!0}).then(function(t){return t.json()}).then(function(r){var n;n=r&&r instanceof Object&&"FeatureCollection"===r.type?r.features:r,n=e.parseGeoJsonData2Feature({allDatas:{features:n}}),t({type:"feature",features:n})}).catch(function(t){n(t)})})}},{key:"_queryFeatureBySQL",value:function(t,e,r,n,i,o,a,s,u,l){var c=this._getQueryFeaturesParam(e,i,o,a,s,u,l),f=this.handleProxy(),h=this.handleParentRes(t);new Rut(h,{proxy:f,withCredentials:this.handleWithCredentials(f,t,!1),eventListeners:{processCompleted:function(t){r&&r(t)},processFailed:function(t){n&&n(t)}}}).processAsync(c)}},{key:"_getFeatures",value:function(t,e,r,n){var i=this,o=e.dataSource;this._queryFeatureBySQL(o.url,o.layerName,function(t){var e=t.result.recordsets[0].features.features,n=i.parseGeoJsonData2Feature({allDatas:{features:e}});r(n)},function(t){n(t)},null,t)}},{key:"_getQueryFeaturesParam",value:function(t,e,r,n,i,o,a){var s=new w1({name:t,attributeFilter:e});r&&(s.fields=r);var u={queryParams:[s]};return a&&(u.queryOption=In.ATTRIBUTE),i&&(u.startRecord=i),o&&(u.expectCount=o),n&&(u.prjCoordSys={epsgCode:n}),new Iut(u)}},{key:"_getFeaturesFromDataflow",value:function(t){var e=this;return new Promise(function(r,n){e._getDataflowInfo(t,function(){r({type:"dataflow"})},function(t){n(t)})})}},{key:"_getDataflowInfo",value:function(t,e,r){var n,i=t.url,o="".concat(i,".json");t.credential&&t.credential.token&&(n=t.credential.token,o+="?token=".concat(n));var a=this.handleProxy();o=this.handleParentRes(o),ut.get(o,null,{proxy:a,withCredentials:this.handleWithCredentials(a,o,!1)}).then(function(t){return t.json()}).then(function(n){n?(n.featureMetaData&&(t.featureType=n.featureMetaData.featureType.toUpperCase(),t.dataSource={dataTypes:{}},n.featureMetaData.fieldInfos&&n.featureMetaData.fieldInfos.length>0&&n.featureMetaData.fieldInfos.forEach(function(e){var r=e.name.trim();"TEXT"===e.type?t.dataSource.dataTypes[r]="STRING":["DOUBLE","INT","FLOAT","LONG","SHORT"].includes(e.type)?t.dataSource.dataTypes[r]="NUMBER":t.dataSource.dataTypes[r]="UNKNOWN"})),t.wsUrl=n.urls[0].url,t.name=n.urls[0].url.split("iserver/services/")[1].split("/dataflow")[0],e()):r()}).catch(function(){r()})}},{key:"getDatasourceType",value:function(t){var e,r=t.dataSource,n=t.layerType;return r&&"SAMPLE_DATA"===r.type?r.type:(r&&r.serverId||"MARKER"===n||"HOSTED_TILE"===n?e="hosted":"ZXY_TILE"===n||"SUPERMAP_REST"===n||"TILE"===n||"WMS"===n||"WMTS"===n||"MAPBOXSTYLE"===n?e="tile":r&&"REST_DATA"===r.type?e="rest_data":r&&"REST_MAP"===r.type&&r.url?e="rest_map":"DATAFLOW_POINT_TRACK"===n||"DATAFLOW_HEAT"===n?e="dataflow":r&&"USER_DATA"===r.type&&(e="user_data"),e)}},{key:"getFeatureProperties",value:function(t){var e=[];return t&&t.length&&t.forEach(function(t){var r=t.properties;r&&e.push(r)}),e}},{key:"parseGeoJsonData2Feature",value:function(t){for(var e=t.allDatas.features,r=[],n=0,i=e.length;n0){var u=s[0].name,l=s[0].type.toUpperCase();e._getDataService(n,u).then(function(n){var s=n.dataItemServices;0===s.length&&a("noDataServices");var c={layer:r,dataItemServices:s,datasetName:u,featureType:l,resolve:t,reject:a,baseProjection:i};if(o){var f=s.filter(function(t){return t&&"RESTDATA"===t.serviceType})[0];e._isMvt(f.address,u,i).then(function(t){e._getServiceInfoFromLayer(c,t)}).catch(function(){e._getServiceInfoFromLayer(c)})}else e._getServiceInfoFromLayer(c)})}else a("resultIsEmpty")}).catch(function(t){a(t)})})}},{key:"_isMvt",value:function(t,e,r){return this._getDatasetsInfo(t,e).then(function(t){return t.epsgCode==r.split("EPSG:")[1]?ut.get("".concat(t.url,"/tilefeature.mvt")).then(function(t){return t.json()}).then(function(e){return t.isMvt=e.error&&400===e.error.code,t}).catch(function(){return t}):t})}},{key:"_getServiceInfoFromLayer",value:function(t,e){var r=this,n=t.layer,i=t.dataItemServices,o=t.datasetName,a=t.featureType,s=t.resolve,u=t.reject,l=t.baseProjection,c=e?!e.isMvt:"HOSTED_TILE"===n.layerType,f=!1;i.forEach(function(t){f||(t&&c&&"RESTMAP"===t.serviceType?(f=!0,r._getTileLayerInfo(t.address,l).then(function(t){s({type:"restMap",restMaps:t})})):t&&!c&&"RESTDATA"===t.serviceType&&(e&&e.isMvt?s({type:"mvt",info:e,featureType:a}):(f=!0,r._getDatasources(t.address).then(function(e){n.dataSource.dataSourceName=e+":"+o,n.dataSource.url="".concat(t.address,"/data"),r._getFeatureBySQL(n.dataSource.url,[n.dataSource.dataSourceName||n.name],function(t){var e=r.parseGeoJsonData2Feature({allDatas:{features:t.result.features.features}});s({type:"feature",features:e})},function(t){u(t)})},function(t){u(t)}))))},this),f||u("noService")}},{key:"_getDatasetsInfo",value:function(t,e){var r=this;return this._getDatasources(t).then(function(n){var i="".concat(t,"/data/datasources/").concat(n,"/datasets/").concat(e),o=r.handleProxy();return i=r.handleParentRes(i),ut.get(i,null,{withCredentials:r.handleWithCredentials(o,i,!1),proxy:o}).then(function(t){return t.json()}).then(function(t){return{epsgCode:t.datasetInfo.prjCoordSys.epsgCode,bounds:t.datasetInfo.bounds,datasourceName:n,datasetName:e,url:i}})})}},{key:"_getDatasources",value:function(t){var e=this.handleProxy(),r="".concat(t,"/data/datasources.json");return r=this.handleParentRes(r),ut.get(r,null,{withCredentials:this.handleWithCredentials(e,r,!1),proxy:e}).then(function(t){return t.json()}).then(function(t){if(401===t.code)throw Error(t.errorMsg);return t.datasourceNames[0]})}},{key:"_getDataService",value:function(t,e){var r=this.handleProxy(),n="".concat(this.serverUrl,"web/datas/").concat(t,".json");return n=this.handleParentRes(n),ut.get(n,null,{withCredentials:this.handleWithCredentials(r,n,this.withCredentials),proxy:r}).then(function(t){return t.json()}).then(function(r){return r.fileId=t,r.datasetName=e,r})}},{key:"_checkUploadToRelationship",value:function(t){var e=this.handleProxy(),r="".concat(this.serverUrl,"web/datas/").concat(t,"/datasets.json");return r=this.handleParentRes(r),ut.get(r,null,{withCredentials:this.handleWithCredentials(e,r,this.withCredentials),proxy:e}).then(function(t){return t.json()}).then(function(t){return t})}},{key:"_handleMapUrl",value:function(){var t=this.serverUrl+"web/maps/"+this.mapId+"/map";this.credentialValue&&this.credentialKey&&(t+="?"+this.credentialKey+"="+this.credentialValue);var e="getUrlResource.json?url=";if(this.excludePortalProxyUrl&&this.serverUrl.indexOf(e)>-1){var r=this.serverUrl.split(e);r.length>1&&(t=r[0]+e+this.serverUrl+"web/maps/"+this.mapId+"/map.json")}return t=-1===t.indexOf(".json")?"".concat(t,".json"):t}},{key:"handleProxy",value:function(t){if(!this.proxy)return null;var e=this.proxyOptions[t||"data"],r=this.serverUrl+e;return"string"==typeof this.proxy&&(r=this.proxy),r}},{key:"handleWithCredentials",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.withCredentials;return e&&e.includes("https://www.supermapol.com")?"":!(!t||!t.startsWith(this.serverUrl)||e&&!e.startsWith(t))||(!!(e&&this.iportalServiceProxyUrl&&e.indexOf(this.iportalServiceProxyUrl)>=0)||r)}},{key:"isIportalResourceUrl",value:function(t){return t.startsWith(this.serverUrl)||this.iportalServiceProxyUrl&&t.indexOf(this.iportalServiceProxyUrl)>=0}},{key:"handleParentRes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.mapId,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"MAP";return this.isIportalResourceUrl(t)?$.urlAppend(t,"parentResType=".concat(r,"&parentResId=").concat(e)):t}},{key:"_formatGeoJSON",value:function(t){var e=t.features;return e.forEach(function(t,e){t.properties.index=e}),e}},{key:"_excelData2Feature",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.colTitles,n=r.indexOf(e.xField),i=r.indexOf(e.yField);if(i<0||n<0)for(var o=0,a=r.length;o2&&void 0!==arguments[2]?arguments[2]:1e-5;return Math.abs(+t-+e)<=r}}])&&dTt(t.prototype,e),r&&dTt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function ATt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function xTt(){xTt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new O(n||[]);return i(a,"_invoke",{value:C(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",g={};function v(){}function m(){}function b(){}var A={};l(A,a,function(){return this});var x=Object.getPrototypeOf,w=x&&x(x(M([])));w&&w!==r&&n.call(w,a)&&(A=w);var _=b.prototype=v.prototype=Object.create(A);function S(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function E(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==_Tt(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function C(e,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function wTt(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function _Tt(t){"@babel/helpers - typeof";return(_Tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function STt(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:Xa,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"triggerEvent";return function(r){function n(t,e,r){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),(i=CTt(this,n)).serverUrl=e.serverUrl||"https://www.supermapol.com",i.credentialValue=e.credentialValue,i.credentialKey=e.credentialKey,i.tiandituKey=e.tiandituKey||"",i.googleMapsAPIKey=e.googleMapsAPIKey||"",i.bingMapsKey=e.bingMapsKey||"",i.googleMapsLanguage=e.googleMapsLanguage||"zh-CN",i.withCredentials=e.withCredentials||!1,i.proxy=e.proxy,i.target=e.target||"map",i.excluortalProxyUrl=e.excludePortalProxyUrl,i.isSuperMapOnline=e.isSuperMapOnline,i.ignoreBaseProjection=e.ignoreBaseProjection,i.specifiedProj4=e.proj4,i.echartslayer=[],i.canvgsV=[],i.webMapService=new bTt(t,e),i.mapOptions=r,i.eventTypes=["mapcreatefailed","layercreatefailed"],i.mapId=t,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ITt(t,e)}(n,t),i=n,(o=[{key:"_initWebMap",value:function(){throw new Error("_initWebMap is not implemented")}},{key:"_getMapInfo",value:function(){throw new Error("_getMapInfo is not implemented")}},{key:"_createMap",value:function(){throw new Error("_createMap is not implemented")}},{key:"_initBaseLayer",value:function(){throw new Error("_initBaseLayer is not implemented")}},{key:"_initOverlayLayer",value:function(){throw new Error("_initOverlayLayer is not implemented")}},{key:"_addLayerSucceeded",value:function(){throw new Error("_addLayerSucceeded is not implemented")}},{key:"_unproject",value:function(){throw new Error("_unproject is not implemented")}},{key:"clean",value:function(){throw new Error("clean is not implemented")}},{key:"echartsLayerResize",value:function(){this.echartslayer.forEach(function(t){t.chart.resize()})}},{key:"setMapId",value:function(t){var e=this;"string"==typeof t||"number"==typeof t?(this.mapId=t,this.webMapInfo=null):null!==t&&"object"===_Tt(t)&&(this.webMapInfo=t,this.mapId=""),this.webMapService.setMapId(t),t&&setTimeout(function(){e._initWebMap()},0)}},{key:"setServerUrl",value:function(t){this.serverUrl=t,this.webMapService.setServerUrl(t)}},{key:"setWithCredentials",value:function(t){this.withCredentials=t,this.webMapService.setWithCredentials(t)}},{key:"setProxy",value:function(t){this.proxy=t,this.webMapService.setProxy(t)}},{key:"setZoom",value:function(t){this.map&&(this.mapOptions.zoom=t,t!==+this.map.getZoom().toFixed(2)&&(t||0===t)&&this.map.setZoom(t,{from:"setZoom"}))}},{key:"setMaxBounds",value:function(t){this.map&&(this.mapOptions.maxBounds=t,t&&this.map.setMaxBounds(t))}},{key:"setMinZoom",value:function(t){this.map&&(this.mapOptions.minZoom=t,(t||0===t)&&this.map.setMinZoom(t))}},{key:"setMaxZoom",value:function(t){this.map&&(this.mapOptions.maxZoom=t,(t||0===t)&&this.map.setMaxZoom(t))}},{key:"initWebMap",value:function(){if(this.clean(),this.serverUrl=this.serverUrl&&this.webMapService.handleServerUrl(this.serverUrl),this.webMapInfo){var t=this.webMapInfo;return t.mapParams={title:this.webMapInfo.title,description:this.webMapInfo.description},this.mapParams=t.mapParams,void this._getMapInfo(t)}this.mapId&&this.serverUrl?(this._taskID=new Date,this.getMapInfo(this._taskID)):this._createMap()}},{key:"getMapInfo",value:function(t){var e=this;this.serverUrl=this.serverUrl&&this.webMapService.handleServerUrl(this.serverUrl),this.webMapService.getMapInfo().then(function(r){e._taskID===t&&(e.mapParams=r.mapParams,e._getMapInfo(r,t))},function(t){throw t}).catch(function(t){e._fire("mapcreatefailed",{error:t}),console.log(t)})}},{key:"getBaseLayerType",value:function(t){var e=t.layerType;switch((e.indexOf("TIANDITU_VEC")>-1||e.indexOf("TIANDITU_IMG")>-1||e.indexOf("TIANDITU_TER")>-1)&&(e="TIANDITU"),e){case"TILE":case"SUPERMAP_REST":return"TILE";case"CLOUD":case"CLOUD_BLACK":return"CLOUD";case"OSM":case"JAPAN_ORT":case"JAPAN_RELIEF":case"JAPAN_PALE":case"JAPAN_STD":case"GOOGLE_CN":case"GOOGLE":return"XYZ";default:return e}}},{key:"getMapurls",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{CLOUD:t.CLOUD||"http://t2.dituhui.com/FileService/image?map=quanguo&type=web&x={x}&y={y}&z={z}",CLOUD_BLACK:t.CLOUD_BLACK||"http://t3.dituhui.com/MapService/getGdp?x={x}&y={y}&z={z}",OSM:t.OSM||"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png",GOOGLE:"https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i{z}!2i{x}!3i{y}!4i256!2m3!1e0!2sm!3i540264686!3m12!2s{googleMapsLanguage}!3sUS!5e18!12m4!1e68!2m2!1sset!2sRoadmap!12m3!1e37!2m1!1ssmartmaps!4e0&key={googleMapsAPIKey}",GOOGLE_CN:"https://mt{0-3}.google.com/vt/lyrs=m&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}",JAPAN_STD:"https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png",JAPAN_PALE:"https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png",JAPAN_RELIEF:"https://cyberjapandata.gsi.go.jp/xyz/relief/{z}/{x}/{y}.png",JAPAN_ORT:"https://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg"}}},{key:"getLayerFeatures",value:function(t,e,r){var n=this,i=this.webMapService.getLayerFeatures(r,t,this.baseProjection);i&&i.then(function(){var r,i=(r=xTt().mark(function r(i){var o;return xTt().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!n.mapId||n._taskID===e){r.next=2;break}return r.abrupt("return");case 2:if(!i||!t.projection){r.next=8;break}if(SY(t.projection,n.specifiedProj4)){r.next=8;break}return r.next=6,kY(t.projection.split(":")[1],n.serverUrl);case 6:(o=r.sent)&&_Y(t.projection,o,n.specifiedProj4);case 8:n._getLayerFeaturesSucceeded(i,t);case 9:case"end":return r.stop()}},r)}),function(){var t=this,e=arguments;return new Promise(function(n,i){var o=r.apply(t,e);function a(t){wTt(o,n,i,a,s,"next",t)}function s(t){wTt(o,n,i,a,s,"throw",t)}a(void 0)})});return function(t){return i.apply(this,arguments)}}(),function(t){throw new Error(t)}).catch(function(e){n._addLayerSucceeded(),n._fire("layercreatefailed",{error:e,layer:t,map:n.map}),console.log(e)})}},{key:"setFeatureInfo",value:function(t){var e,r=t.dv_v5_markerInfo;if(!r||!r.dataViz_title)return r;e=r;var n=t.properties;for(var i in e)n[i]&&(e[i]=n[i],delete n[i]);return e}},{key:"getRankStyleGroup",value:function(t,e,r){var n=[],i=[],o=r.style,a=r.themeSetting,s=a.segmentMethod,u=a.segmentCount,l=a.customSettings,c=r.themeSetting.minRadius,f=r.themeSetting.maxRadius,h=a.colors,p=o.fillColor;e.forEach(function(e){var r=e.properties[t];null==r||""===r||isNaN(+r)||n.push(Number(r))});try{i=aY.getArraySegments(n,s,u)}catch(t){console.log(t)}for(var d=0;d0&&(_=l[E]&&l[E].color?l[E].color:S[E]||p,o.fillColor=_),v.push({radius:w,color:_,start:m,end:b,style:o});return v}return!1}},{key:"createRankStyleSource",value:function(t,e){var r=t.themeSetting.themeField,n=this.getRankStyleGroup(r,e,t);return!!n&&{parameters:t,styleGroups:n}}},{key:"getRestMapLayerInfo",value:function(t,e){var r=t.bounds,n=t.coordUnit,i=t.visibleScales,o=t.url;return e.layerType="TILE",e.orginEpsgCode=this.baseProjection,e.units=n&&n.toLowerCase(),e.extent=[r.left,r.bottom,r.right,r.top],e.visibleScales=i,e.url=o,e.sourceType="TILE",e}},{key:"handleLayerFeatures",value:function(t,e){var r=e.layerType,n=e.style,i=e.themeSetting,o=e.filterCondition;return(n||i)&&o&&"RANGE"!==r&&"UNIQUE"!==r&&"RANK_SYMBOL"!==r&&(t=this.getFilterFeatures(o,t)),t}},{key:"getFilterFeatures",value:function(t,e){if(!t)return e;for(var r=this.replaceFilterCharacter(t),n=[],i=0;i0&&n.push(o)}return n}},{key:"replaceFilterCharacter",value:function(t){return t=t.replace(/=/g,"==").replace(/AND|and/g,"&&").replace(/or|OR/g,"||").replace(/<==/g,"<=").replace(/>==/g,">=")}},{key:"getParseSpecialCharacter",value:function(){var t={};return["(",")","(",")",",",","].forEach(function(e,r){t[e]="$".concat(r)}),t}},{key:"parseSpecialCharacter",value:function(t){var e=this.getParseSpecialCharacter();for(var r in e)for(var n=e[r],i=new RegExp("\\".concat(r),"g");i.test(t);)t=t.replace(i,n);return t}},{key:"parseCondition",value:function(t,e){var r=this,n=t;return t.replace(/&|\||>|<|=|!/g," ").split(" ").filter(function(t){return t}).forEach(function(t){var i=e.find(function(e){return e===t});if(r.startsWithNumber(t)&&i&&(n=n.replace(i,"$"+i)),i){var o=r.parseSpecialCharacter(i);n=n.replace(i,o)}}),n}},{key:"parseConditionFeature",value:function(t){var e={};for(var r in t){var n=r;this.startsWithNumber(r)&&(n="$"+r),e[n=this.parseSpecialCharacter(n)]=t[r]}return e}},{key:"startsWithNumber",value:function(t){return/^\d/.test(t)}},{key:"getEchartsLayerOptions",value:function(t,e,r){var n=this.webMapService.getFeatureProperties(e),i=function(t,e){var r=[];if(e&&e.length){var n,i,o=t.from,a=t.to;if("XY_FIELD"===o.type&&o.xField&&o.yField&&a.xField&&a.yField)e.forEach(function(t){var e=t[o.xField],s=t[o.yField],u=t[a.xField],l=t[a.yField];e&&s&&u&&l&&(n=[t[o.xField],t[o.yField]],i=[t[a.xField],t[a.yField]],r.push({coords:[n,i]}))});else if("PLACE_FIELD"===o.type&&o.field&&a.field){var s=Mi.concat(Oi);e.forEach(function(t){var e=t[o.field],u=t[a.field];n=s.find(function(t){return Bi(t.name,e)}),i=s.find(function(t){return Bi(t.name,u)}),n&&i&&r.push({coords:[n.coord,i.coord]})})}}return r}(t,n),o=this._createPointsData(i,t,n);return this._createOptions(t,i,o,r)}},{key:"getEchartsLayerById",value:function(t){return this.echartslayer.find(function(e){return e.id===t})}},{key:"getDashStyle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"array";if(!t)return"array"===r?[]:"";var n,i=e;switch(t){case"solid":n=[];break;case"dot":n=[1,4*i];break;case"dash":n=[4*i,4*i];break;case"dashrailway":n=[8*i,12*i];break;case"dashdot":n=[4*i,4*i,1*i,4*i];break;case"longdash":n=[8*i,4*i];break;case"longdashdot":n=[8*i,4*i,1,4*i];break;default:n=$.isArray(t)?t:(t=R.trim(t).replace(/\s+/g,",")).replace(/\[|\]/gi,"").split(",")}return n="array"===r?n:n.join(",")}},{key:"getCanvasFromSVG",value:function(t,e,r){var n=this,i=document.createElement("canvas");if(i.id="dataviz-canvas-".concat((new Date).getTime()),i.style.display="none",e.appendChild(i),t){var o=(window.canvg||{}).default?window.canvg.default:rTt(),a=i.getContext("2d");o.from(a,t,{ignoreMouse:!0,ignoreAnimation:!0,forceRedraw:function(){return!1}}).then(function(t){t.start(),n.canvgsV.push(t),i.width>300||i.height>300||r(i)})}else r(i)}},{key:"stopCanvg",value:function(){this.canvgsV.forEach(function(t){return t.stop()}),this.canvgsV=[]}},{key:"getRangeStyleGroup",value:function(t,e){var r,n=t.featureType,i=t.style,o=t.themeSetting,a=o.customSettings,s=o.themeField,u=o.segmentCount,l=o.segmentMethod,c=o.colors,f=[];e.forEach(function(t){if(r=t.properties){var e=r[s];(e||0===e)&&!isNaN(+e)&&f.push(parseFloat(e))}},this);var h=f&&f.length&&aY.getArraySegments(f,l,u);if(h){var p=u;r&&h[0]===h[r.length-1]&&(p=1,h.length=2);for(var d=0;dl&&i>0||"\n"===t[i]?(e=t[i],f++,n=!0):(e=o,c=a)}n?h.push(l):h.push(c)},this);for(var p=0;p=l){c=l;break}d>c&&(c=d)}return c+=a,e=f*o+a-6,s.width=c,s.height=e,r.fillStyle=u,r.fillRect(0,0,c,e),r.lineWidth=n.borderWidth,r.strokeStyle=n.borderColor,r.strokeRect(0,0,c,e),{width:c,height:e}}},{key:"_drawTextWithCanvas",value:function(t){var e=t.context,r=t.canvas,n=t.style,i=Number(n.font.replace(/[^0-9]/gi,""))+3,o=n.text.split("\r\n");e.font=n.font;var a=this._drawTextRectAndGetSize({context:e,style:n,textArray:o,lineHeight:i,doublePadding:16,canvas:r}),s=8;o.forEach(function(t,r){0!==r&&(s+=i),e.font=n.font;var o,u=n.textAlign,l=a.width-16;switch(u){case"center":o=l/2;break;case"right":o=l;break;default:o=8}for(var c=t.split(""),f="",h=n.fillColor,p=n.maxWidth-16,d=0;dp&&d>0||"\n"===c[d]?(e.fillStyle=h,e.textAlign=u,e.textBaseline="top",e.fillText(f,o,s),f=c[d],s+=i):f=y}e.fillStyle=h,e.textAlign=u,e.textBaseline="top",e.fillText(f,o,s)},this)}},{key:"handleSvgColor",value:function(t,e){var r=t.fillColor,n=t.fillOpacity,i=t.strokeColor,o=t.strokeOpacity,a=t.strokeWidth,s=e.getContext("2d");t.text?this._drawTextWithCanvas({context:s,canvas:e,style:t}):(r&&(s.fillStyle=rY.getColorWithOpacity(r,n),s.fill()),(i||a)&&(s.strokeStyle=rY.getColorWithOpacity(i,o),s.lineWidth=a,s.stroke()))}},{key:"_createPointsData",value:function(t,e,r){var n=[],i=e.labelSetting;if(!i.show||!t.length)return n;var o=[],a=[];return t.forEach(function(t,e){var n=t.coords,s=n[0],u=n[1],l=r[e][i.from],c=r[e][i.to];!o.find(function(t){return t.value[0]===s[0]&&t.value[1]===s[1]})&&o.push({name:l,value:s}),!a.find(function(t){return t.value[0]===u[0]&&t.value[1]===u[1]})&&a.push({name:c,value:u})}),n=o.concat(a)}},{key:"_createOptions",value:function(t,e,r,n){var i,o=this._createLineSeries(t,e,n);if(r&&r.length){var a=this._createPointSeries(t,r,n);i=o.concat(a)}else i=o.slice();return{series:i,animation:!1}}},{key:"_createPointSeries",value:function(t,e,r){var n=t.lineSetting,i=t.animationSetting,o=t.labelSetting,a=[{name:"point-series",coordinateSystem:r,zlevel:2,label:{normal:{show:o.show,position:"right",formatter:"{b}",color:o.color,fontFamily:o.fontFamily}},itemStyle:{normal:{color:n.color||o.color}},data:e}];return i.show?(a[0].type="effectScatter",a[0].rippleEffect={brushType:"stroke"}):a[0].type="scatter",a}},{key:"_createLineSeries",value:function(t,e,r){var n=t.lineSetting,i=t.animationSetting,o=[{name:"line-series",coordinateSystem:r,type:"lines",zlevel:1,effect:{show:i.show,constantSpeed:i.constantSpeed,trailLength:0,symbol:i.symbol,symbolSize:i.symbolSize},lineStyle:{normal:{color:n.color,type:n.type,width:n.width,opacity:n.opacity,curveness:n.curveness}},data:e}];return e.length>=TTt&&(o[0].large=!0,o[0].largeThreshold=100,o[0].blendMode="lighter"),o}},{key:"_getLayerFeaturesSucceeded",value:function(t,e){switch(t.type){case"feature":this._initOverlayLayer(e,t.features);break;case"restMap":e.layerType="restMap",this._initOverlayLayer(e,t.restMaps);break;case"mvt":e.layerType="mvt",this._initOverlayLayer(e,t);break;case"dataflow":case"noServerId":this._initOverlayLayer(e)}}},{key:"_fire",value:function(t,r){this[e]&&this[e](t,r)}}])&&STt(i.prototype,o),a&&STt(i,a),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,o,a}()}function MTt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function PTt(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{layerFilter:function(){return!0}},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{style:{version:8,sources:{},layers:[]}};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e=DTt(this,n),"string"==typeof t||"number"==typeof t?e.mapId=t:null!==t&&"object"===NTt(t)&&(e.webMapInfo=t),e.mapId||i.center||i.zoom||(i.center=[0,0],i.zoom=0),r.map&&(e.map=r.map),e.options=Object.assign({},r),delete e.options.map,e._setServer(r.server||"https://www.supermapol.com"),e.options.target=r.target||"map",e.options.withCredentials=r.withCredentials||!1,e.mapOptions=i,e.webMapService=new bTt(t,e.options),e.eventTypes=["mapinitialized","mapcreatesucceeded","addlayerssucceeded","mapcreatefailed","getmapfailed","layercreatefailed","getlayersfailed","baidumapnotsupport","layerorsourcenameduplicated","dataflowfeatureupdated","projectionnotmatch","layeraddchanged","layerupdatechanged","mapbeforeremove"],e._cacheCleanLayers=[],e._mapInitializedHandler=e._mapInitializedHandler.bind(e),e._mapCreateSucceededHandler=e._mapCreateSucceededHandler.bind(e),e._addLayerChangedHandler=e._addLayerChangedHandler.bind(e),e._initWebMap(!e.map),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&FTt(t,e)}(n,t),i=n,(o=[{key:"resize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.map&&this.map.resize(),this._handler&&this._handler.echartsLayerResize();var e=window.getComputedStyle(document.getElementById(this.options.target)),r=this.mapOptions.bounds;if(t&&this.map&&r&&e){var n=this._getResizedZoom(r,e);n!==this.map.getZoom()&&this.map&&this.map.setZoom(n)}}},{key:"setCRS",value:function(t){if(this.map&&(this.mapOptions.crs=t,this.mapOptions.crs)){if(this.map.getCRS("string"==typeof t?t:t.epsgCode))return;t.epsgCode?(this.mapOptions.crs=new r.CRS(this.mapOptions.crs.epsgCode,this.mapOptions.crs.WKT,this.mapOptions.crs.extent,this.mapOptions.crs.unit),this.map.setCRS(this.mapOptions.crs)):this.map.setCRS(r.CRS.get(t))}}},{key:"setCenter",value:function(t){if(this.map&&this._centerValid(t)){this.mapOptions.center=t;var e=this.map.getCenter(),r=e.lng,n=e.lat;t[0]===+r.toFixed(4)&&t[1]===+n.toFixed(4)||this.map.setCenter(t,{from:"setCenter"})}}},{key:"setRenderWorldCopies",value:function(t){this.map&&(this.mapOptions.renderWorldCopies=t,this.map.setRenderWorldCopies(t))}},{key:"setBearing",value:function(t){this.map&&(this.mapOptions.bearing=t,t!==+this.map.getBearing().toFixed(2)&&(t||0===t)&&this.map.setBearing(t))}},{key:"setPitch",value:function(t){this.map&&(this.mapOptions.pitch=t,t!==+this.map.getPitch().toFixed(2)&&(t||0===t)&&this.map.setPitch(t))}},{key:"setStyle",value:function(t){this.map&&(this.mapOptions.style=t,this._initWebMap())}},{key:"setRasterTileSize",value:function(t){var e=this;if(this.map&&!(t<=0)){var r=this.map.getStyle().sources;Object.keys(r).forEach(function(n){"raster"===r[n].type&&"iserver"===r[n].rasterSource&&e._updateRasterSource(n,{tileSize:t})})}}},{key:"setMaxBounds",value:function(t){this.map&&(this.mapOptions.maxBounds=t,t&&this.map.setMaxBounds(t))}},{key:"setMinZoom",value:function(t){this.map&&(this.mapOptions.minZoom=t,(t||0===t)&&this.map.setMinZoom(t))}},{key:"setMaxZoom",value:function(t){this.map&&(this.mapOptions.maxZoom=t,(t||0===t)&&this.map.setMaxZoom(t))}},{key:"setWebMapOptions",value:function(t){this.setServerUrl(t.server),this._createWebMap()}},{key:"setMapOptions",value:function(t){var e=t.center,r=t.zoom,n=t.maxBounds,i=t.minZoom,o=t.maxZoom,a=t.isWorldCopy,s=t.bearing,u=t.pitch;e&&e.length&&this.setCenter(e),r&&this.setZoom(r),n&&this.setMaxBounds(n),i&&this.setMinZoom(i),o&&this.setMaxZoom(o),a&&this.setRenderWorldCopies(a),s&&this.setBearing(s),u&&this.setPitch(u)}},{key:"getLayers",value:function(){return this._handler&&this._handler.getLayers()||[]}},{key:"getLegends",value:function(){return this._handler&&this._handler.getLegends()||[]}},{key:"getLayerCatalog",value:function(){return this._handler&&this._handler.getLayerCatalog()||[]}},{key:"setLayersVisible",value:function(){var t;this._handler&&(t=this._handler).setLayersVisible.apply(t,arguments)}},{key:"toggleLayerVisible",value:function(){var t;this._handler&&(t=this._handler).toggleLayerVisible.apply(t,arguments)}},{key:"getWebMapType",value:function(){return this.type}},{key:"rectifyLayersOrder",value:function(){var t;this._handler&&(t=this._handler).rectifyLayersOrder.apply(t,arguments)}},{key:"updateOverlayLayer",value:function(){var t;this._handler&&(t=this._handler).updateOverlayLayer.apply(t,arguments)}},{key:"copyLayer",value:function(){var t;return this._handler&&(t=this._handler).copyLayer.apply(t,arguments)}},{key:"clean",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.map&&(t&&this._fire("mapbeforeremove",{map:this.map}),this._handler&&(this._handler.clean(t),this._handler=null),this.map=null,this.mapOptions&&(this.mapId||this.webMapInfo)&&(this.mapOptions.center=null,this.mapOptions.zoom=null))}},{key:"cleanLayers",value:function(){if(this.map){var t=this._cacheCleanLayers.filter(function(t){return!t.reused});this._handler&&this._handler.cleanLayers(t),this._cacheCleanLayers=[],this.clean(!1)}}},{key:"_initWebMap",value:function(){var t=this;if((!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.clean(),this.webMapInfo){var e=this.webMapInfo;return e.mapParams={title:this.webMapInfo.title,description:this.webMapInfo.description},this.mapParams=e.mapParams,void Promise.resolve().then(function(){t._getMapInfo(e)}).catch(function(e){t._fire("mapcreatefailed",{error:e})})}this.mapId&&this.options.serverUrl?(this._taskID=new Date,this.getMapInfo(this._taskID)):Promise.resolve().then(function(){t._createMap("MapStyle")}).catch(function(e){t._fire("mapcreatefailed",{error:e})})}},{key:"setZoom",value:function(t){this.map&&(this.mapOptions.zoom=t,t!==+this.map.getZoom().toFixed(2)&&(t||0===t)&&this.map.setZoom(t,{from:"setZoom"}))}},{key:"setServerUrl",value:function(t){this._setServer(t),this.webMapService.setServerUrl(this.options.serverUrl)}},{key:"setWithCredentials",value:function(t){this.options.withCredentials=t,this.webMapService.setWithCredentials(t)}},{key:"setProxy",value:function(t){this.options.proxy=t,this.webMapService.setProxy(t)}},{key:"setMapId",value:function(t){var e=this;"string"==typeof t||"number"==typeof t?(this.mapId=t,this.webMapInfo=null):null!==t&&"object"===NTt(t)&&(this.webMapInfo=t,this.mapId=""),this.webMapService.setMapId(t),t&&setTimeout(function(){e._initWebMap()},0)}},{key:"getMapInfo",value:function(t){var e=this;this.webMapService.getMapInfo().then(function(r){e._taskID===t&&(e.mapParams=r.mapParams,e._getMapInfo(r))},function(t){throw t}).catch(function(t){e._fire("mapcreatefailed",{error:t}),console.log(t)})}},{key:"_createWebMapFactory",value:function(){throw new Error("_createWebMapFactory is not implemented")}},{key:"_mapInitializedHandler",value:function(t){var e=t.map;this.map=e,this._fire("mapinitialized",{map:this.map})}},{key:"_mapCreateSucceededHandler",value:function(t){this.mapParams=t.mapparams,this._cacheCleanLayers=t.layers,this._fire("mapcreatesucceeded",t)}},{key:"_addLayerChangedHandler",value:function(t){this._cacheCleanLayers=t.layers,this.fire("layeraddchanged",t)}},{key:"_getMapInfo",value:function(t){var e=+t.version.split(".")[0]>=3?"WebMap3":"WebMap2";this._createMap(e,t)}},{key:"_createMap",value:function(t,e){var r=this,n=PTt(PTt({},this.options),{},{iportalServiceProxyUrlPrefix:this.webMapService.iportalServiceProxyUrl}),i=PTt(PTt({},this.eventTypes.reduce(function(t,e){return t[e]=function(t){r._fire(e,t)},t},{})),{},{mapinitialized:this._mapInitializedHandler,mapcreatesucceeded:this._mapCreateSucceededHandler,layeraddchanged:this._addLayerChangedHandler}),o=XN()(this.mapOptions),a=this._createWebMapFactory(t),s=this.mapId||this.webMapInfo;for(var u in this._handler=new a(s,n,o),i)this._handler.on(u,i[u]);var l={},c=this.options.layerFilter;e&&(l=PTt(PTt({},e),{},{layers:"function"==typeof c?e.layers.filter(c):e.layers})),this.type=t,this._handler.initializeMap(l,this.map)}},{key:"_updateRasterSource",value:function(t,e){if(t){var r=this.map.getSource(t);Object.assign(r,e),this.map.style.sourceCaches[t].clearTiles(),this.map.style.sourceCaches[t].update(this.map.transform),this.map.triggerRepaint()}}},{key:"_getResizedZoom",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:512,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:zTt,i=e.width,o=e.height,a=Math.abs(t.getEast()-t.getWest()),s=Math.abs(this._getBoundsRadian(t.getSouth())-this._getBoundsRadian(t.getNorth())),u=+Math.log2(n/(a/parseInt(i)*r)).toFixed(2),l=+Math.log2(n/(s/parseInt(o)*r)).toFixed(2);return u<=l?u:l}},{key:"_getBoundsRadian",value:function(t){return 180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360))}},{key:"_centerValid",value:function(t){return!(!t||!(t.length>0||NTt(t)===r.LngLat||t.lng))}},{key:"_getWebMapInstance",value:function(){return this._handler}},{key:"_setServer",value:function(t){this.options.server=Fi(t),this.options.serverUrl=this.options.server}},{key:"_fire",value:function(t,e){var r=this;([["mapcreatesucceeded","addlayerssucceeded"],["mapcreatefailed","getmapfailed"],["layercreatefailed","getlayersfailed"]].find(function(e){return e.includes(t)})||[t]).forEach(function(t){r.fire(t,e)})}}])&&jTt(i.prototype,o),a&&jTt(i,a),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,o,a}()}function UTt(t){"@babel/helpers - typeof";return(UTt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function HTt(t){return function(t){if(Array.isArray(t))return VTt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return VTt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return VTt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function VTt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function XTt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=rOt(this,e)).map=r.map,t.layers=r.layers||[],t.appendLayers=r.appendLayers||!1,t.unexpectedSourceNames=["tdt-search-","tdt-route-","smmeasure","mapbox-gl-draw","maplibre-gl-draw",/tracklayer-\d+-line/,/graticuleLayer_\d+_line/],t.uniqueId=+new Date,t.layersVisibleMap=new Map,t.eventTypes=["layerupdatechanged"],t._styleDataUpdatedHandler=t._styleDataUpdatedHandler.bind(t),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&iOt(t,e)}(e,Xa),r=e,(n=[{key:"setLayers",value:function(t){this.layers=t}},{key:"createLayerCatalogs",value:function(){throw new Error("createLayerCatalogs is not implemented")}},{key:"getSelfLayerIds",value:function(){throw new Error("getSelfLayerIds is not implemented")}},{key:"initLayers",value:function(){throw new Error("initLayers is not implemented")}},{key:"createAppreciableLayers",value:function(){var t=this.initLayers();return this._initAppreciableLayers(t)}},{key:"getLayerCatalog",value:function(){var t=this.createLayerCatalogs();return this._updateLayerCatalogsVisible(t),this._updateImmutableOrderLayers(t)}},{key:"getLayers",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.createAppreciableLayers();return t&&this.removeLayerExtralFields(e),this._updateImmutableOrderLayers(e,!0)}},{key:"getSelfLayers",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getLayers(),e=this.getSelfLayerIds();return t.filter(function(t){return t.renderLayers.some(function(t){return e.some(function(e){return e===t})})})}},{key:"toggleLayerVisible",value:function(t,e){var r=e?"visible":"none";if("group"===t.type){var n=this._getLayerVisibleId(t);this.layersVisibleMap.set(n,e);var i=Ui(t.children);i.length?this.setLayersVisible(i,r):this.map.style.fire("data",{dataType:"style"})}else this.setLayersVisible([t],r)}},{key:"setLayersVisible",value:function(t,e){var r=this;t.forEach(function(t){var n=r._getLayerVisibleId(t);if(r.layersVisibleMap.set(n,"visible"===e),t.CLASS_INSTANCE&&t.CLASS_INSTANCE.show&&t.CLASS_INSTANCE.hide)return"visible"===e?t.CLASS_INSTANCE.show():t.CLASS_INSTANCE.hide(),void r.map.style.fire("data",{dataType:"style"});t.renderLayers.forEach(function(n){("L7Layer"!==t.CLASS_NAME||r.map.getLayer(n))&&r.map.setLayoutProperty(n,"visibility",e)})})}},{key:"concatExpectLayers",value:function(t,e,r){var n=r.filter(function(t){return!e.some(function(e){return e===t.id})});return this._filterExpectedLayers(t.concat(n))}},{key:"destroy",value:function(){this.map.off("styledata",this._styleDataUpdatedHandler)}},{key:"initDatas",value:function(){this.map&&(this._styleDataUpdatedHandler(),this._registerMapEvent())}},{key:"removeLayerExtralFields",value:function(t){t.forEach(function(t){delete t.metadata})}},{key:"_initAppreciableLayers",value:function(t){var e=this;return t.reduce(function(t,r){var n=Vi(r),i=t.find(function(t){return t.id===n});i||(i=e._createCommonFields(r,n),t.push(i));var o=i.renderLayers.concat(r.layerInfo?r.layerInfo.renderLayers:r.id);return i.renderLayers=Array.from(new Set(o)),t},[])}},{key:"_initSourceList",value:function(t){var e=this;return t.slice().reverse().reduce(function(t,r){var n=r.renderSource.sourceLayer?"".concat(r.renderSource.id,"_").concat(e.uniqueId):r.id,i=r.metadata.SM_Layer_Title||(r.renderSource.sourceLayer?r.renderSource.id:r.title),o=t.find(function(t){return t.id===n});if(!o){var a=new WTt(ZTt(ZTt({},r),{},{id:n,title:i}));t.push(a),o=a}return o.addLayer(r),t},[])}},{key:"_filterExpectedLayers",value:function(t){var e=this;return t.filter(function(t){return e._excludeLayer(t)})}},{key:"_excludeSource",value:function(t){for(var e=0;e0){var o=this._findLayerCatalog(i.children,e);if(o)return o}}}catch(t){n.e(t)}finally{n.f()}return null}},{key:"_getLayerVisibleId",value:function(t){return"".concat(t.type,"-").concat(t.id)}},{key:"_getLayerVisible",value:function(t){var e=this._getLayerVisibleId(t);return this.layersVisibleMap.has(e)?this.layersVisibleMap.get(e):t.visible}},{key:"_updateLayerCatalogsVisible",value:function(t){var e,r=qTt(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;n.visible=this._getLayerVisible(n),"group"===n.type&&this._updateLayerCatalogsVisible(n.children)}}catch(t){r.e(t)}finally{r.f()}}},{key:"_registerMapEvent",value:function(){this.map.on("styledata",this._styleDataUpdatedHandler)}},{key:"_styleDataUpdatedHandler",value:function(){var t=this.getLayers();this.triggerEvent("layerupdatechanged",{layers:t,relevantLayers:this.getSelfLayers(t),layerCatalog:this.getLayerCatalog()})}},{key:"_updateImmutableOrderLayers",value:function(t,e){var r=t.filter(function(t){return t.layerOrder&&"top"===t.layerOrder.toLowerCase()}),n=r.filter(function(t){return"MIGRATION"===t.type}),i=r.filter(function(t){return"MIGRATION"!==t.type});r=n.concat(i);var o=t.filter(function(t){return t.layerOrder&&"bottom"===t.layerOrder.toLowerCase()}),a=t.filter(function(t){return!t.layerOrder||"auto"===t.layerOrder.toLowerCase()});return e?o.concat(a,r):r.concat(a,o)}}])&&tOt(r.prototype,n),i&&tOt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function aOt(t){"@babel/helpers - typeof";return(aOt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sOt(t){return function(t){if(Array.isArray(t))return uOt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return uOt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uOt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uOt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=dOt(this,e,[r])).initDatas(),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&gOt(t,e)}(e,oOt),r=e,(n=[{key:"createLayerCatalogs",value:function(){var t=this.getLayers(!1);return this._initSourceList(t)}},{key:"getSelfLayerIds",value:function(){return this.layers.reduce(function(t,e){return t.concat(e.renderLayers)},[])}},{key:"initLayers",value:function(){var t=this,e=this._getAllLayersOnMap(),r=e;this.appendLayers&&(r=e.filter(function(e){return t.layers.some(function(r){return t._isBelongToMapJSON(r,e)})}));var n=[],i=[];return this.layers.forEach(function(e){var o=r.filter(function(r){return t._isBelongToMapJSON(e,r)}),a=o.find(function(t){return t.id===e.id});if(o.length>0){if(a)n.push(cOt(cOt({},a),{},{layerInfo:cOt(cOt({},e),{},{dataSource:e.dataSource||e.serverId&&{serverId:e.serverId}})}));else{var s=o.map(function(t){var r=Object.assign({},t);return r.metadata=Object.assign({},r.metadata,{SM_Layer_Title:e.name}),r});n.push.apply(n,sOt(s))}i.push.apply(i,sOt(e.renderLayers))}}),this.concatExpectLayers(n,i,r)}},{key:"_isBelongToMapJSON",value:function(t,e){return t.renderLayers&&t.renderLayers.some(function(t){return t===e.id})}}])&&hOt(r.prototype,n),i&&hOt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function mOt(t){"@babel/helpers - typeof";return(mOt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bOt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function AOt(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function IOt(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function TOt(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){IOt(o,n,i,a,s,"next",t)}function s(t){IOt(o,n,i,a,s,"throw",t)}a(void 0)})}}function OOt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function MOt(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{layerFilter:function(){return!0}},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{style:{version:8,sources:{},layers:[]}};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=jOt(this,i,[t,r,n]),"string"!=typeof t&&"number"!=typeof t||(e.mapId=t),e._centerValid(n.center)&&(e.center=n.center),e.zoom=n.zoom,e.renderWorldCopies=n.renderWorldCopies,e.bounds=n.bounds,e.bearing=n.bearing,e.pitch=n.pitch,e.rasterTileSize=n.rasterTileSize||256,e.layerFilter=r.layerFilter,e.checkSameLayer=r.checkSameLayer,e._taskID=new Date,e._cacheLayerId=new Map,e._layerTimerList=[],e._appendLayers=!1,e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&BOt(t,e)}(i,t),o=i,(a=[{key:"initializeMap",value:function(t,e){e&&(this._appendLayers=!0,this.map=e),this._getMapInfo(t,this._taskID)}},{key:"cleanLayers",value:function(t){ROt(DOt(i.prototype),"cleanLayers",this).call(this,t),this.echartslayer.forEach(function(t){t.remove(),t.features=null,t.id=""})}},{key:"clean",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.map&&(this._sourceListModel&&(this._sourceListModel.destroy(),this._sourceListModel=null),this.stopCanvg(),t&&this.map.remove(),this.map=null,this._legendList=[],this.center=null,this.zoom=null,this._dataflowService&&(this._dataflowService.off("messageSucceeded",this._handleDataflowFeaturesCallback),this._dataflowService.off("subscribesucceeded",this._initDataflowLayerCallback)),this._unprojectProjection=null,this._cacheLayerId=new Map),this._layerTimerList.length&&(this._layerTimerList.forEach(function(t){clearInterval(t)}),this._layerTimerList=[])}},{key:"_initWebMap",value:function(){}},{key:"_loadLayers",value:function(t,e){var r=this;if(this.map){if(this.map.getCRS().epsgCode!==this.baseProjection&&!this.ignoreBaseProjection)return void this.fire("projectionnotmatch",{});this._handleLayerInfo(t,e)}else setTimeout(function(){r._createMap(t),r.map.on("load",function(){r._handleLayerInfo(t,e)})},0)}},{key:"_setCRS",value:function(t,e,r){if(!n.CRS.get(t)){var i=new n.CRS(t,e,r,r[2]>180?"meter":"degree");n.CRS.set(i)}}},{key:"_getMapInfo",value:function(t,e){var r=this;this._mapInfo=t;var i,o,a=t.projection;this.baseProjection=EY(a);var s=SY(this.baseProjection,this.specifiedProj4);if(s&&(o=s),n.CRS.get(this.baseProjection))this._defineProj4(a),i=[t.extent.leftBottom.x,t.extent.leftBottom.y,t.extent.rightTop.x,t.extent.rightTop.y],this._setCRS(this.baseProjection,o,i),this._loadLayers(t,e);else if(t.baseLayer&&"MAPBOXSTYLE"===t.baseLayer.layerType){var u=t.baseLayer.dataSource.url;u.indexOf("/restjsr/")>-1&&!/\/style\.json$/.test(u)&&(u+="/style.json"),this.webMapService.getMapBoxStyle(u).then(function(n){i=n&&n.metadata&&n.metadata.indexbounds?n.metadata.indexbounds:[t.extent.leftBottom.x,t.extent.leftBottom.y,t.extent.rightTop.x,t.extent.rightTop.y],r._defineProj4(a),r._setCRS(r.baseProjection,o,i),r._loadLayers(t,e)})}else if(t.baseLayer&&"TILE"===t.baseLayer.layerType)this.getEpsgCodeWKT("".concat(t.baseLayer.url,"/prjCoordSys.wkt"),{withoutFormatSuffix:!0,withCredentials:this.webMapService.handleWithCredentials("",t.baseLayer.url,!1)}).then(function(n){o||(o=n),r.getBounds("".concat(t.baseLayer.url,".json"),{withoutFormatSuffix:!0,withCredentials:r.webMapService.handleWithCredentials("",t.baseLayer.url,!1)}).then(function(n){i=n&&n.bounds?[n.bounds.leftBottom.x,n.bounds.leftBottom.y,n.bounds.rightTop.x,n.bounds.rightTop.y]:[t.extent.leftBottom.x,t.extent.leftBottom.y,t.extent.rightTop.x,t.extent.rightTop.y],r._defineProj4(o,a),r._setCRS(r.baseProjection,o,i),r._loadLayers(t,e)})});else{var l=new Error("Unsupported coordinate system!");console.log(l),this.fire("mapcreatefailed",{error:l})}}},{key:"_handleLayerInfo",value:function(t,e){var r=this;t=this._setLayerID(t),this._mapInfo=t,this.layerAdded=0,this.expectLayerLen=0;var n=t,i=n.layers,o=n.grid;if(this._setExpectLayerLen(t),0===this.expectLayerLen&&this._sendMapToUser(0,0),this._shouldLoadBaseLayer(t,this.layerFilter)&&this._initBaseLayer(t,function(){r._addLayerSucceeded()}),i&&0!==i.length){var a=i;"function"==typeof this.layerFilter&&(a=i.filter(this.layerFilter)),this._initOverlayLayers(a,e)}o&&o.graticule&&this._initGraticuleLayer(o.graticule)}},{key:"_setExpectLayerLen",value:function(t){this._shouldLoadBaseLayer(t,this.layerFilter)&&this.expectLayerLen++;var e=t.layers;e&&e.length>0&&("function"==typeof this.layerFilter&&(e=e.filter(this.layerFilter)),this.expectLayerLen+=e.length),t.grid&&t.grid.graticule&&this.expectLayerLen++}},{key:"_shouldLoadBaseLayer",value:function(t,e){var r=t.baseLayer;return!!r&&("function"!=typeof e||e(r))}},{key:"_createMap",value:function(t){var e=this,i=this._getLabelFontFamily(t),o=this._getMapCenter(t),a=t.level||0,s=this.mapOptions,u=s.bounds,l=s.minZoom,c=s.maxZoom,f=this.mapOptions.interactive;if(isNaN(l)&&(l=t.minScale?this._transformScaleToZoom(t.minScale,n.CRS.get(this.baseProjection)):0),isNaN(c)&&(c=t.maxScale?this._transformScaleToZoom(t.maxScale,n.CRS.get(this.baseProjection)):22),t.visibleExtent&&4===t.visibleExtent.length&&!u&&(u=[this._unproject([t.visibleExtent[0],t.visibleExtent[1]]),this._unproject([t.visibleExtent[2],t.visibleExtent[3]])]),l>c){var h=[c,l];l=h[0],c=h[1]}u||(a+=t.minScale&&t.maxScale?Math.min(this._transformScaleToZoom(t.minScale,n.CRS.get(this.baseProjection)),this._transformScaleToZoom(t.maxScale,n.CRS.get(this.baseProjection))):+Math.log2(this._getResolution(n.CRS.get(this.baseProjection).getExtent())/this._getResolution(t.extent)).toFixed(2)),this.map=new r(MOt(MOt({},this.mapOptions),{},{container:this.target,center:this.center||o,zoom:this.zoom||a,minZoom:l,maxZoom:c,bearing:this.bearing||0,pitch:this.pitch||0,bounds:u,interactive:void 0===f||f,style:{version:8,sources:{},layers:[]},crs:this.baseProjection,localIdeographFontFamily:i||"",renderWorldCopies:this.renderWorldCopies||!1,transformRequest:function(t,r){if("Tile"===r){e.isSuperMapOnline&&0===t.indexOf("http://")&&(t="https://www.supermapol.com/apps/viewer/getUrlResource.png?url=".concat(encodeURIComponent(t))),e.webMapService.isIportalResourceUrl(t)&&(t=e.webMapService.handleParentRes(t));var n=e.webMapService.handleProxy("image");return{url:t,credentials:e.webMapService.handleWithCredentials(n,t,!1)?"include":void 0}}return{url:t}},fadeDuration:0})),this.fire("mapinitialized",{map:this.map})}},{key:"_createMVTBaseLayer",value:function(t,e){var r=this,n=t.dataSource.url;n.indexOf("/restjsr/")>-1&&!/\/style\.json$/.test(n)&&(n+="/style.json"),this.webMapService.getMapBoxStyle(n).then(function(n){if(Object.keys(n.sources).some(function(t){return r.map.getSource(t)}))return r.fire("layerorsourcenameduplicated",{}),void(e&&e());n.layers.forEach(function(e){e.layout&&(e.layout.visibility=r._getVisibility(t.visible))}),r.map.addStyle(n);var i=[];n.layers.forEach(function(t){"background"!==t.type&&i.push(t.id)}),r._setCacheLayer({parentLayerId:t.layerID||t.name,subRenderLayers:i.map(function(t){return{layerId:t}})}),e&&e()},function(t){throw e&&e(),new Error(t)}).catch(function(e){r.fire("layercreatefailed",{error:e,layer:t,map:r.map})})}},{key:"_initBaseLayer",value:function(t,e){var r,n=t.baseLayer||t,i=this.getBaseLayerType(n),o=this.getMapurls();switch(this.baseLayerProxy=this.webMapService.handleProxy("image"),i){case"TIANDITU":this.baseLayerProxy=null,this._createTiandituLayer(t,e);break;case"BING":this.baseLayerProxy=null,this._createBingLayer(n.layerID||n.name,n,e);break;case"WMS":this._createWMSLayer(n,e);break;case"WMTS":this._createWMTSLayer(n,e);break;case"TILE":this._createDynamicTiledLayer(n,e);break;case"ZXY_TILE":this._createZXYLayer(n,e);break;case"CLOUD":case"XYZ":r=o[n.layerType].replace("{googleMapsLanguage}",this.googleMapsLanguage).replace("{googleMapsAPIKey}",this.googleMapsAPIKey),this._createXYZLayer(n,r,e);break;case"BAIDU":this.fire("baidumapnotsupport",{}),e&&e();break;case"MAPBOXSTYLE":this._createMVTBaseLayer(n,e)}}},{key:"_initOverlayLayers",value:function(t,e){var r=this;this.expectLayerLen>0&&t.forEach(function(t){var n=r.webMapService.getDatasourceType(t);if("SAMPLE_DATA"===n)return r._addLayerSucceeded(),void r.fire("layercreatefailed",{error:"SAMPLE DATA is not supported",layer:t,map:r.map});if(t.visibleScale){var i=t.visibleScale,o=i.minScale,a=i.maxScale,s=r.map.getCRS();t.minzoom=Math.max(r._transformScaleToZoom(o,s),0),t.maxzoom=Math.min(24,r._transformScaleToZoom(a,s)+1e-7)}"tile"===n?(t.autoUpdateTime&&r._layerTimerList.push(setInterval(function(){r._initBaseLayer(t)},t.autoUpdateTime)),r._initBaseLayer(t,function(){r._addLayerSucceeded()})):(r.getLayerFeatures(t,e,n),t.autoUpdateTime&&r._layerTimerList.push(setInterval(function(){r.getLayerFeatures(t,e,n)},t.autoUpdateTime)))},this)}},{key:"_initOverlayLayer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=t.layerID,i=t.layerType,o=t.visible,a=t.style,s=t.featureType,u=t.projection;t.visible=o?"visible":"none",e=Gi({sourceId:n,features:e,mergeByField:r,map:this.map}),"restMap"!==i?"mvt"!==i?(e&&e[0]&&e[0].geometry&&"Polygon"===e[0].geometry.type&&(e=this._handleMultyPolygon(e)),e&&u&&"EPSG:4326"!==u&&t.dataSource&&"REST_DATA"!==t.dataSource.type&&(this._unprojectProjection=this._defineProj4(u),e=this.transformFeatures(e)),e=this.handleLayerFeatures(e,t),"VECTOR"===i?"POINT"===s?"SYMBOL_POINT"===a.type?this._createSymbolLayer(t,e):this._createGraphicLayer(t,e):(this._createVectorLayer(t,e),this._addLayerSucceeded({layerInfo:t,features:e})):"UNIQUE"===i?this._createUniqueLayer(t,e):"RANGE"===i?this._createRangeLayer(t,e):"HEAT"===i?this._createHeatLayer(t,e):"MARKER"===i?this._createMarkerLayer(t,e):"MIGRATION"===i?this._createMigrationLayer(t,e):"RANK_SYMBOL"===i?this._createRankSymbolLayer(t,e):this._isDataflowLayer(i)&&this._createDataflowLayer(t)):this._createMvtLayer(e.info,t,e.featureType):this._createRestMapLayer(e,t)}},{key:"_initGraticuleLayer",value:function(t){var e=this._createGraticuleOptions(t),r=new n.supermap.GraticuleLayer(e);this._setGraticuleDash(e.strokeStyle,r),this._graticuleLayer=r,this.map.addLayer(r),this._setCacheLayer({parentLayerId:r.id,subRenderLayers:[{layerId:r.id},{layerId:r.sourceId}],metadata:{SM_Layer_Order:"Top"}}),this._addLayerSucceeded()}},{key:"_createGraticuleOptions",value:function(t){var e=t.extent,r=t.lonLabelStyle,n=t.latLabelStyle,i=t.strokeColor,o=t.lineDash,a=t.strokeWidth,s=t.interval,u={lineColor:i,lindDasharray:o,lineWidth:a};return r={textFont:r.fontFamily.split(","),textSize:r.fontSize,textAnchor:n.textBaseline,textColor:r.fill,textHaloColor:r.outlineColor,textHaloWidth:r.outlineWidth},n={textFont:n.fontFamily.split(","),textSize:n.fontSize,textAnchor:n.textBaseline,textColor:n.fill,textHaloColor:n.outlineColor,textHaloWidth:n.outlineWidth},e=e||this.map.getCRS().extent,{minZoom:1,strokeStyle:u,extent:e=[this._unproject([e[0],e[1]]),this._unproject([e[2],e[3]])],interval:s&&s[0],lngLabelStyle:r,latLabelStyle:n,layerID:"graticuleLayer_".concat(+new Date)}}},{key:"_setGraticuleDash",value:function(t,e){var r=this;this.map.on("zoomend",function(){r.map.getZoom()<3?e.setStrokeStyle(MOt(MOt({},t),{},{lineOpacity:.5,lineWidth:t.lineWidth/2,lindDasharray:[.1,3]})):e.setStrokeStyle(t)})}},{key:"_createTiandituLayer",value:function(t,e){var r=this._getTiandituUrl(t),n=t.baseLayer,i=n.labelLayerVisible,o=n.name,a=n.visible,s=Boolean(i),u=r.labelUrl,l=r.tiandituUrl,c=FOt.TIANDITU;this._addBaselayer({url:l,layerID:o,visibility:a,bounds:c}),s&&this._addBaselayer({url:u,layerID:this._getTdtLabelLayerName(o),parentLayerId:o,visibility:a,bounds:c}),e&&e()}},{key:"_createWMTSLayer",value:function(t,e){var r=this;this.webMapService.getWmtsInfo(t,this.map.getCRS().epsgCode).then(function(n){var i=t.layerID||t.name;if(n.isMatched){var o=r._getWMTSUrl(Object.assign({},t,n));r._addBaselayer({url:[o],layerID:i,visibility:t.visible,minzoom:n.matchMinZoom,maxzoom:n.matchMaxZoom,isIserver:!1,bounds:n.bounds}),e&&e()}},function(t){throw e&&e(),new Error(t)}).catch(function(e){r.fire("layercreatefailed",{error:e,layer:t,map:r.map})})}},{key:"_createBingLayer",value:function(){var t=TOt(kOt().mark(function t(e,r,n){var i,o,a,s;return kOt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i="https://dev.virtualearth.net/REST/v1/Imagery/Metadata/RoadOnDemand?uriScheme=https&include=ImageryProviders&key=".concat(this.bingMapsKey,"&c=zh-cn"),t.next=3,this._fetchRequest(i,"json",{withoutFormatSuffix:!0});case 3:if(200===(o=t.sent).statusCode&&1===o.resourceSets.length&&1===o.resourceSets[0].resources.length){t.next=6;break}return t.abrupt("return");case 6:a=o.resourceSets[0].resources[0],s=a.imageUrlSubdomains.map(function(t){return a.imageUrl.replace("{subdomain}",t)}),this._addBaselayer({url:s,layerID:e,visibility:r.visible,bounds:FOt.BING}),n&&n();case 10:case"end":return t.stop()}},t,this)}));return function(e,r,n){return t.apply(this,arguments)}}()},{key:"_createXYZLayer",value:function(t,e,r){var n=[];if("OSM"===t.layerType){for(var i=e.match(/\w\-\w/g)[0],o=i[0],a=i[2],s="",u=97;u<123;u++)s+=String.fromCharCode(u);for(var l=s.split(""),c=l.indexOf(o),f=l.indexOf(a),h=l.slice(c,f+1),p=0;p1&&void 0!==arguments[1]?arguments[1]:"1.1.1",r=t.url,n={service:"WMS",request:"GetMap",layers:null!==t.layers&&"object"===_Ot(t.layers)?t.layers.join(","):t.layers||"0",styles:"",format:"image/png",transparent:"true",version:e,width:256,height:256};return"1.3.0"===e?(n.bbox="EPSG:4326"===this.baseProjection?"{bbox-wms-1.3.0}":"{bbox-epsg-3857}",n.crs=this.baseProjection):(n.bbox="{bbox-epsg-3857}",n.srs=this.baseProjection),$.urlAppend(r,this._getParamString(n,r))}},{key:"_setLayerID",value:function(t){var e=this,r={},n=t.baseLayer,i=t.layers,o=void 0===i?[]:i;if(!this.checkSameLayer){var a=this._generateUniqueLayerId({layerId:n.name,repeatIndex:0});n.title=n.name,n.name=a.newId}var s=o.map(function(t){return t.name}),u=o.map(function(t,i){t.name in r||(r[t.name]=n.name===t.name?1:0);var o=s.indexOf(t.name),a=s.lastIndexOf(t.name);i>o&&i<=a&&(r[t.name]=r[t.name]+1);var u=r[t.name]?"".concat(t.name,"-").concat(r[t.name]):t.name;if(!e.checkSameLayer||"raster"!==t.layerType){var l=e._generateUniqueLayerId({layerId:u,repeatIndex:r[t.name],layerType:t.layerType}),c=l.newId,f=l.newIndex;r[t.name]=f,u=c}return Object.assign(t,{layerID:u})});return t.layers=u,t.baseLayer=n,t}},{key:"_generateUniqueLayerId",value:function(t){var e=t.layerId,r=t.repeatIndex,n=t.layerType;return this.map.getLayer(e)?(r++,e=e.match(/-\d+&/gi)?e.replace(/\d+$/gi,r):"".concat(e,"-").concat(r),this._generateUniqueLayerId(MOt(MOt({},t),{},{layerId:e,repeatIndex:r}))):this._isDataflowLayer(n)?{newId:"".concat(e,"_").concat(+new Date),newIndex:r+1}:{newId:e,newIndex:r}}},{key:"_createRestMapLayer",value:function(t,e){var r=this;t.forEach(function(t){e=r.getRestMapLayerInfo(t,e),r._initBaseLayer(e)}),this._addLayerSucceeded()}},{key:"_addLayerSucceeded",value:function(t){(((t||{}).layerInfo||{}).labelStyle||{}).labelField&&"DATAFLOW_POINT_TRACK"!==t.layerInfo.layerType&&this._addLabelLayer(t.layerInfo,t.features,!1),this.layerAdded++,this._sendMapToUser(this.layerAdded,this.expectLayerLen)}},{key:"_createDataflowLayer",value:function(t){var e=new n.supermap.DataFlowService(t.wsUrl).initSubscribe();this._handleDataflowFeaturesCallback=this._handleDataflowFeatures.bind(this,t),this._initDataflowLayerCallback=this._initDataflowLayer.bind(this,t),e.on("subscribesucceeded",this._initDataflowLayerCallback),e.on("messageSucceeded",this._handleDataflowFeaturesCallback),this._dataflowService=e}},{key:"_initDataflowLayer",value:function(){this._addLayerSucceeded()}},{key:"_handleDataflowFeatures",value:function(t,e){var r=[JSON.parse(e.data)];if(this.fire("dataflowfeatureupdated",{features:r,identifyField:t.identifyField,layerID:t.layerID}),"EPSG:4326"!==t.projection&&(r=this.transformFeatures(r)),t.filterCondition){var n=this.replaceFilterCharacter(t.filterCondition),i=r[0].properties||{};n=this.parseCondition(n,Object.keys(i));var o=this.parseConditionFeature(i),a="select * from json where ("+n+")",s=window.jsonsql.query(a,{attributes:o});s&&s.length>0&&this._addDataflowLayer(t,r[0])}else this._addDataflowLayer(t,r[0])}},{key:"_getDataFlowRotateStyle",value:function(t,e,r){var n=["match",["get",r]];return t.forEach(function(t){var i;if((i=void 0!==e&&"未设置"!==e&&"None"!==e?t.properties[e]:0)>360||i<0)return null;n.push(t.properties[r],parseInt(i))}),n.push(0),n}},{key:"_addDataflowLayer",value:function(){var t=TOt(kOt().mark(function t(e,r){var n,i,o,a,s,u;return kOt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.layerID,"DATAFLOW_HEAT"!==e.layerType){t.next=5;break}this.map.getSource(n)?this._updateDataFlowFeature(n,r,e):this._createHeatLayer(e,[r],!1),t.next=20;break;case 5:if(i=e.pointStyle,e.style=i,this.map.getSource(n)){t.next=17;break}if(o=this._getDataFlowRotateStyle([r],e.directionField,e.identifyField),!["BASIC_POINT","SVG_POINT","IMAGE_POINT"].includes(i.type)){t.next=14;break}return t.next=12,this._createGraphicLayer(e,[r],null,o,!1);case 12:t.next=15;break;case 14:this._createSymbolLayer(e,[r],null,o,!1);case 15:t.next=18;break;case 17:this._updateDataFlowFeature(n,r,e,"point");case 18:e.labelStyle&&e.visible&&(a=this._getSymbolLabelLayerName(n),this.map.getSource(a)?this._updateDataFlowFeature(a,r,e):this._addLabelLayer(e,[r],!0)),e.lineStyle&&e.visible&&(this.map.getSource(n+"-line")?this._updateDataFlowFeature(n+"-line",r,e,"line"):(s=r.geometry.coordinates,u={type:"Feature",properties:r.properties,geometry:{type:"LineString",coordinates:[s]}},this._createVectorLayer({style:e.lineStyle,featureType:"LINE",visible:"visible",layerID:n+"-line",parentLayerId:n},[u])));case 20:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"_updateDataFlowFeature",value:function(t,e,r,n){var i=r.identifyField,o=r.maxPointCount,a=r.directionField,s=XN()(this.map.getSource(t)._data.features),u=!1;if(s.forEach(function(t,r){if(t.properties[i]===e.properties[i])if(u=!0,"line"===n){var a=t.geometry.coordinates;a.push(e.geometry.coordinates),o&&a.length>o&&a.splice(0,a.length-o),s[r].geometry.coordinates=a}else s[r]=e}),u||("line"===n?s.push({type:"Feature",properties:e.properties,geometry:{type:"LineString",coordinates:[e.geometry.coordinates]}}):s.push(e)),this.map.getSource(t).setData({type:"FeatureCollection",features:s}),"point"===n){var l=r.pointStyle.type,c=this._getDataFlowRotateStyle(s,a,i);["SVG_POINT","IMAGE_POINT"].includes(l)?this.map.setLayoutProperty(t,"icon-rotate",c):"SYMBOL_POINT"===l&&this.map.setLayoutProperty(t,"text-rotate",c)}}},{key:"_createMigrationLayer",value:function(t,e){var r=t.layerID,n=t.layerType,i=this.getEchartsLayerOptions(t,e,"GLMap");i.GLMap={roam:!0};var o=new window.EchartsLayer(this.map);o.chart.setOption(i),o.id=r,o.features=e,this.echartslayer.push(o),this._addLayer({id:r,type:n,setLayoutProperty:function(t,e){"visibility"===t&&(o.chart._dom.style.display="visible"===e?"block":"none")},metadata:{SM_Layer_Order:"top"}}),this._addLayerSucceeded({layerInfo:t,features:e})}},{key:"_createRankSymbolLayer",value:function(t,e){var r=t.minzoom,n=t.maxzoom,i=t.themeSetting.themeField,o=t.themeSetting.colors,a=t.style,s=t.featureType,u=this.createRankStyleSource(t,e).styleGroups;e=this.getFilterFeatures(t.filterCondition,e);for(var l=["match",["get","index"]],c=["match",["get","index"]],f=0;f0&&(a.fillColor=c),"SYMBOL_POINT"===a.type)this._createSymbolLayer(t,e,l);else if(["SVG_POINT","IMAGE_POINT"].includes(a.type))this._createGraphicLayer(t,e,l);else{var g={type:"geojson",data:{type:"FeatureCollection",features:e}},v={layout:{visibility:t.visible},style:this._transformStyleToMapBoxGl(t.style,s,l,"circle-radius")},m=t.layerID;this._addOverlayToMap({type:s,source:g,layerID:m,layerStyle:v,minzoom:r,maxzoom:n}),this._addLayerSucceeded({layerInfo:t,features:e})}}},{key:"_addTextBackgroundImage",value:function(t){if(!t[3])return"";for(var e=new Uint8Array(1600),r=0;r<20;r++)for(var n=0;n<20;n++){var i=4*(20*n+r);e[i+0]=t[0],e[i+1]=t[1],e[i+2]=t[2],e[i+3]=255*t[3]}var o="text-background-".concat(t.join("-"));return this.map.hasImage(o)||this.map.addImage(o,{width:20,height:20,data:e},{stretchX:[[0,20]],stretchY:[[0,20]],content:[0,0,20,20]}),o}},{key:"_addLabelLayer",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this._getSymbolLabelLayerName(t.layerID);if(!this.map.getLayer(n)){var i=t.labelStyle,o=e[0]&&e[0].properties,a=i.labelField.replace(/{(.+)}/g,"$1");if(o&&o[a]){var s=i.backgroundFill,u=void 0===s?[255,255,255,0]:s,l=i.fontFamily,c=t.minzoom,f=t.maxzoom,h=parseFloat(i.fontSize||14),p="";"line"!==i.placement&&(p=this._addTextBackgroundImage(u)),u="rgba(".concat(u.join(","),")");var d="rgba(255,255,255,0)";i.outlineColor&&i.outlineWidth>0&&(d=i.outlineColor);var y=(i.outlineWidth||0)/2,g=i.textAlign||"center";i.textBaseline&&"middle"!==i.textBaseline&&(g="".concat(i.textBaseline).concat("center"===g?"":"-".concat(g)));var v="POINT"===t.featureType?[i.offsetX/h||0,i.offsetY/h||0]:[0,0],m={"text-field":"{".concat(i.labelField,"}"),"text-size":h,"text-offset":v,"text-font":l?[l]:["DIN Offc Pro Italic","Arial Unicode MS Regular"],"symbol-placement":"line"===i.placement?"POLYGON"===t.featureType?"line":"line-center":"point","text-max-angle":"POLYGON"===t.featureType?40:30,"symbol-spacing":"POLYGON"===t.featureType?200:50,"text-anchor":g,"text-line-height":1.2,visibility:t.visible};p&&Object.assign(m,{"icon-image":p,"icon-allow-overlap":!0,"icon-text-fit":"both","icon-text-fit-padding":[2,4,2,4]}),this._addLayer({id:n,type:"symbol",source:this.map.getSource(t.layerID)&&!r?t.layerID:{type:"geojson",data:{type:"FeatureCollection",features:e}},paint:{"text-color":i.fill,"text-halo-color":d,"text-halo-width":y},layout:m,minzoom:c||0,maxzoom:f||22},t.layerID)}}}},{key:"_createSymbolLayer",value:function(t,e,r,n){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5?arguments[5]:void 0;document.getElementById("".concat(this.target)).classList.add("supermapol-icons-map");var a=t.layerID,s=t.minzoom,u=t.maxzoom,l=t.style,c=l.unicode,f=String.fromCharCode(parseInt(c.replace(/^&#x/,""),16)),h=r||(Array.isArray(l.fontSize)?l.fontSize:l.fontSize&&parseFloat(l.fontSize)||12),p=Array.isArray(l.rotation)?l.rotation:180*(l.rotation||0)/Math.PI;this.map.getSource(a)||this.map.addSource(a,{type:"geojson",data:{type:"FeatureCollection",features:[]}});var d={id:a,type:"symbol",source:a,paint:{"text-color":Array.isArray(l.fillColor)?l.fillColor:rY.getColorWithOpacity(l.fillColor,l.fillOpacity),"text-halo-color":Array.isArray(l.strokeColor)?l.strokeColor:rY.getColorWithOpacity(l.strokeColor||"rgba(0,0,0,0)",l.strokeOpacity),"text-halo-width":l.strokeWidth||0},layout:{"text-field":f,"text-size":h,"text-font":["supermapol-icons"],"text-rotate":n||p||0,"text-offset":Array.isArray(l.offsetX)?l.offsetX:[l.offsetX/2||0,l.offsetY/2||0],"text-allow-overlap":!0,visibility:t.visible},minzoom:s||0,maxzoom:u||22};o&&(d.filter=o),this._addLayer(d),this.map.getSource(a).setData({type:"FeatureCollection",features:e}),i&&this._addLayerSucceeded({layerInfo:t,features:e})}},{key:"_createGraphicLayer",value:function(){var t=TOt(kOt().mark(function t(e,r,n,i){var o,a,s=this,u=arguments;return kOt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=!(u.length>4&&void 0!==u[4])||u[4],a=u.length>5?u[5]:void 0,t.abrupt("return",new Promise(function(t){var u=e.layerID,l=e.minzoom,c=e.maxzoom,f=e.style,h={type:"geojson",data:{type:"FeatureCollection",features:r}};s.map.getSource(u)?s.map.getSource(u).setData(h.data):s.map.addSource(u,h);var p="imageIcon-".concat(u);if("IMAGE_POINT"===f.type){var d=f.imageInfo;s.map.loadImage(d.url,function(h,d){if(h)console.error(h);else{var y=2*Number.parseFloat((f.radius/d.width).toFixed(2));!s.map.hasImage(p)&&s.map.addImage(p,d);var g={id:u,type:"symbol",source:u,layout:{"icon-image":p,"icon-anchor":"bottom-right","icon-size":n||y,"icon-allow-overlap":!0,visibility:e.visible,"icon-offset":[f.offsetX*d.width||0,f.offsetY*d.height||0],"icon-rotate":i||180*(e.style.rotation||0)/Math.PI},minzoom:l||0,maxzoom:c||22};a&&(g.filter=a),s._addLayer(g),o&&s._addLayerSucceeded({layerInfo:e,features:r}),t()}})}else if("SVG_POINT"===f.type){var y=f.url;s._svgDiv||(s._svgDiv=document.createElement("div"),document.body.appendChild(s._svgDiv)),s.getCanvasFromSVG(y,s._svgDiv,function(h){var p=h.toDataURL("img/png");p&&s.map.loadImage(p,function(p,d){p&&console.log(p);var g=2*Number.parseFloat((f.radius/h.width).toFixed(2));n&&Array.isArray(n)&&(n=n.map(function(t,e){return"number"==typeof t&&e%2==1?t/h.width*2:t})),!s.map.hasImage(y)&&s.map.addImage(y,d,{sdf:!0});var v={id:u,type:"symbol",source:u,layout:{"icon-image":y,"icon-size":n||g,"icon-anchor":"bottom-right",visibility:e.visible,"icon-offset":[f.offsetX*h.width||0,f.offsetY*h.height||0],"icon-allow-overlap":!0,"icon-rotate":i||180*(e.style.rotation||0)/Math.PI},paint:{"icon-color":f.fillColor},minzoom:l||0,maxzoom:c||22};a&&(v.filter=a),s._addLayer(v),o&&s._addLayerSucceeded({layerInfo:e,features:r}),t()})})}else{var g={style:s._transformStyleToMapBoxGl(f,e.featureType),layout:{visibility:e.visible}};s._addOverlayToMap({type:"POINT",source:u,layerID:u,layerStyle:g,minzoom:l,maxzoom:c}),o&&s._addLayerSucceeded({layerInfo:e,features:r}),t()}}));case 3:case"end":return t.stop()}},t)}));return function(e,r,n,i){return t.apply(this,arguments)}}()},{key:"_createUniqueLayer",value:function(){var t=TOt(kOt().mark(function t(e,r){var n,i,o,a,s,u,l,c,f,h,p,d,y,g,v,m,b,A,x,w,_,S,E,C,k,I,T,O,M,P,L,N,j,R,D,B,F,z,G,U,H,V,Q,Y,W,q,X,K,J,Z,$,tt,et,rt,nt=this;return kOt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n={unicode:function(t){var e=t.unicode;return String.fromCharCode(parseInt(e.replace(/^&#x/,""),16))},fontSize:function(t){var e=t.fontSize;return e?parseFloat(e):12},rotation:function(t){return 180*(t.rotation||0)/Math.PI},fillColor:function(t){var e=t.fillColor,r=t.fillOpacity;return rY.getColorWithOpacity(e,r)},strokeColor:function(t){var e=t.strokeColor,r=t.strokeOpacity;return rY.getColorWithOpacity(e||"rgba(0,0,0,0)",r)},strokeWidth:function(t){return t.strokeWidth||0},offsetX:function(t){var e=t.offsetX,r=t.offsetY;return[e/2||0,r/2||0]}},i={unicode:"",fontSize:12,rotation:0,strokeColor:"rgba(0,0,0,0)",fillColor:"rgba(0,0,0,0)",strokeWidth:0,offsetX:[0,0]},o=this.getUniqueStyleGroup(e,r),r=this.getFilterFeatures(e.filterCondition,r),a=e.layerID,s=e.minzoom,u=e.maxzoom,l=e.style,c=o[0].themeField,f=e.featureType,h=e.style,p={},d={},o.forEach(function(t){d[t.value]=t}),r.forEach(function(t){var e=t.properties,r=d[e[c]];if(r){var i=r.style;for(var o in i)if(Object.prototype.hasOwnProperty.call(i,o)){var a=i[o];a!==h[o]&&(p[o]||(p[o]=["match",["get","index"]]),p[o].push(e.index,n[o]?n[o](i):a))}}}),t.t0=kOt().keys(p);case 13:if((t.t1=t.t0()).done){t.next=27;break}if(y=t.t1.value,!Object.prototype.hasOwnProperty.call(p,y)){t.next=25;break}if(g=p[y],Array.isArray(g)){t.next=19;break}return t.abrupt("continue",13);case 19:v=h[y]||i[y],m=POt({},y,v),"fillColor"===y&&(p.fillOpacity=1,m.fillOpacity=isNaN(h.fillOpacity)?1:h.fillOpacity),"strokeColor"===y&&(p.strokeOpacity=1,m.strokeOpacity=isNaN(h.strokeOpacity)?1:h.strokeOpacity),b=n[y],g.push(void 0===v?null:b&&b(m)||v);case 25:t.next=13;break;case 27:if(this._initLegendConfigInfo(e,o),A={type:"geojson",data:{type:"FeatureCollection",features:r}},x=a,this.map.getSource(x)?this.map.getSource(x).setData(A.data):this.map.addSource(x,A),w=e.visible,_=function(t){var e=t.type,r=t.sourceID,n=t.layerID,i=t.parentLayerId,o=t.beforeId,a=t.style,s=t.minzoom,u=t.maxzoom,l=t.filter,c={style:nt._transformStyleToMapBoxGl(MOt({},a),e),layout:{visibility:w}};nt._addOverlayToMap({type:e,source:r,layerID:n,parentLayerId:i,beforeId:o,layerStyle:c,minzoom:s,maxzoom:u,filter:l})},!["POLYGON","LINE"].includes(f)){t.next=43;break}if(S=p.lineDash,E=["all"],C=!1,k="",S&&S.length>1){for(delete p.lineDash,I=S[1],T="POLYGON"===f?a+"-strokeLine":a,O=2;O1&&_({type:"LINE",sourceID:x,layerID:T,parentLayerId:a,style:MOt(MOt(MOt({},l),p),{},{lineDash:S[S.length]}),minzoom:s,maxzoom:u,filter:E}),C=!0}"LINE"!==f||C||_({type:"LINE",sourceID:x,layerID:a,style:MOt(MOt({},l),p),minzoom:s,maxzoom:u,filter:E}),"POLYGON"===f&&(_({type:"POLYGON",sourceID:x,layerID:a,beforeId:k,style:MOt(MOt({},l),p),minzoom:s,maxzoom:u}),k&&this.map.moveLayer(a,k),C||_({type:"LINE",sourceID:x,layerID:a+"-strokeLine",parentLayerId:a,style:MOt(MOt({},l),p),minzoom:s,maxzoom:u,filter:E})),t.next=80;break;case 43:if(L=["all"],N=p.unicode){for(j=p.className||[],delete p.unicode,delete p.classname,R="".concat(a,"-additional-symbol"),D=["any"],B=2;B1&&(z.filter=D),this._addLayer(z,a)}if(G=p.imageInfo||[],U=p.url||[],!(G.length>0||U.length>0)){t.next=66;break}for(delete p.imageInfo,delete p.url,H=[],V=G.length>0?[G[0],G[1]]:[],Q=U.length>0?[U[0],U[1]]:[],Y=["any"],W=["any"],q=2;q1){for(var l=["match",["get","index"]],c=2;c1){for(var y=["match",["get","index"]],g=2;g1?L:void 0),t.next=80;break;case 72:if("IMAGE_POINT"!==l.type&&"SVG_POINT"!==l.type){t.next=79;break}return(rt=MOt({},e)).style=MOt(MOt(MOt({},l),p),{},{type:l.type}),t.next=77,this._createGraphicLayer(rt,r,"","",!1,L.length>1?L:void 0);case 77:t.next=80;break;case 79:_({type:"POINT",sourceID:x,layerID:a,style:MOt(MOt({},l),p),minzoom:s,maxzoom:u,filter:L.length>1?L:void 0});case 80:this._addLayerSucceeded({layerInfo:e,features:r});case 81:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"_getWMTSUrl",value:function(t){if("REST"===t.requestEncoding&&t.restResourceURL)return t.restResourceURL.replace("{Style}",t.style||"").replace("{TileMatrixSet}",t.tileMatrixSet).replace("{TileRow}","{y}").replace("{TileCol}","{x}").replace("{TileMatrix}","{z}");var e={service:"WMTS",request:"GetTile",version:"1.0.0",style:t.style||"",layer:t.layer,tilematrixSet:t.tileMatrixSet,format:"image/png",tilematrix:"{z}",tilerow:"{y}",tilecol:"{x}"};return $.urlAppend(t.kvpResourceUrl,this._getParamString(e,t.kvpResourceUrl))}},{key:"_createMarkerLayer",value:function(t,e){var r=this,n=t.minzoom,i=t.maxzoom,o=t.layerID,a={};(e=e||[]).forEach(function(t,e){var n=t.dv_v5_markerStyle,i=t.geometry.type.toUpperCase();"POINT"===i&&n.text&&(i="TEXT");var s=0===e?o:o+"-"+i+"-"+e;"POINT"===i&&n.src&&-1===n.src.indexOf("http://")&&-1===n.src.indexOf("https://")&&(n.src=r.serverUrl+n.src),a[s]||(a[s]={src:n.src,defaultStyle:n,geomType:i})});var s=function(t,e){var n=e.src,i=e.defaultStyle,o=e.geomType;return new Promise(function(e){n||"TEXT"===o?n&&n.indexOf("svg")<0&&(n.startsWith("http://")||n.startsWith("https://"))?r.map.loadImage(n,function(i,o){if(i)return console.log(i),void e(i);!r.map.hasImage(n)&&r.map.addImage(n,o),e(POt({},t,n))}):(r._svgDiv||(r._svgDiv=document.createElement("div"),document.body.appendChild(r._svgDiv)),r.getCanvasFromSVG(n,r._svgDiv,function(o){r.handleSvgColor(i,o);var a=o.toDataURL("img/png");r.map.loadImage(a,function(i,o){if(i)return console.log(i),void e(i);var s=n||a;!r.map.hasImage(s)&&r.map.addImage(s,o),e(POt({},t,s))})})):e(POt({},t,void 0))})},u=[];for(var l in a)u.push(s(l,a[l]));Promise.all(u).then(function(a){for(var s=0;s2&&void 0!==arguments[2])||arguments[2],i=t.minzoom,o=t.maxzoom,a=t.themeSetting,s={gradient:a.colors.slice(),radius:parseInt(a.radius)},u=a.customSettings;for(var l in u)s.gradient[l]=u[l];var c=["interpolate",["linear"],["heatmap-density"]],f=[.1,.3,.5,.7,1];s.gradient.forEach(function(t,e){c.push(f[e]),0===e&&(t=n.supermap.Util.hexToRgba(t,0)),1===e&&(t=n.supermap.Util.hexToRgba(t,.5)),c.push(t)}),this._initLegendConfigInfo(t,c);var h={"heatmap-color":c,"heatmap-radius":3*a.radius,"heatmap-intensity":2.8};if(a.weight&&e.length>=4){var p=[];e.forEach(function(t){t.properties[a.weight]=+t.properties[a.weight],p.push(t.properties[a.weight])});var d=aY.getMax(p),y=aY.getMin(p);h["heatmap-weight"]=["interpolate",["linear"],["get",a.weight],y,0,d,1]}this._addLayer({id:t.layerID,type:"heatmap",source:{type:"geojson",data:{type:"FeatureCollection",features:e}},paint:h,layout:{visibility:t.visible},minzoom:i||0,maxzoom:o||22}),r&&this._addLayerSucceeded({layerInfo:t,features:e})}},{key:"_createRangeLayer",value:function(t,e){var r=t.themeSetting.themeField,n=t.featureType,i=t.minzoom,o=t.maxzoom,a=t.style,s=this.getRangeStyleGroup(t,e),u=["match",["get","index"]],l=(e=this.getFilterFeatures(t.filterCondition,e)).filter(function(t){var e=parseFloat(t.properties[r]);if(!e&&0!==e)return!1;if(s)for(var n=0;n-1;a--){var s=n[a],u=this._getSymbolLabelLayerName(s);this.map.getLayer(u)&&o.push(u)}o.reverse().forEach(function(t){r.map.moveLayer(t)})}},{key:"_getParamString",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=[];for(var i in t)n.push((r?i.toUpperCase():i)+"="+t[i]);return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")}},{key:"_transformStyleToMapBoxGl",value:function(t,e,r,n){var i={};"POINT"!==t.type&&"BASIC_POINT"!==t.type&&"POINT"!==e||"LINE"===e?["LINE","LINESTRING","MULTILINESTRING"].includes(e)?i={strokeWidth:"line-width",strokeColor:"line-color",strokeOpacity:"line-opacity"}:["REGION","POLYGON","MULTIPOLYGON"].includes(e)&&(i={fillColor:"fill-color",fillOpacity:"fill-opacity"}):i={fillColor:"circle-color",strokeWidth:"circle-stroke-width",fillOpacity:"circle-opacity",radius:"circle-radius",strokeColor:"circle-stroke-color",strokeOpacity:"circle-stroke-opacity"};var o={};for(var a in t)i[a]&&(o[i[a]]=t[a]);if(r&&(n?o[n]=r:o["circle-color"]?o["circle-color"]=r:o["line-color"]?o["line-color"]=r:o["fill-color"]=r),t.lineDash&&!o["line-dasharray"]&&(Array.isArray(t.lineDash)?o["line-dasharray"]=t.lineDash:"solid"!==t.lineDash&&"LINE"===e&&(o["line-dasharray"]=this.getDashStyle(t.lineDash))),t.lineDash&&!o["circle-translate"])if(Array.isArray(t.circleTranslate))o["circle-translate"]=t.circleTranslate;else if("POINT"===t.type||"BASIC_POINT"===t.type||"POINT"===e){var s=t.offsetX||0,u=t.offsetY||0;o["circle-translate"]=[s*t.radius,u*t.radius]}return o}},{key:"_addOverlayToMap",value:function(t){var e=t.type,r=t.source,n=t.layerID,i=t.parentLayerId,o=t.beforeId,a=t.layerStyle,s=t.minzoom,u=t.maxzoom,l=t.filter,c={POINT:"circle",LINE:"line",POLYGON:"fill"}[e];if("circle"===c||"line"===c||"fill"===c){var f={id:n,type:c,source:r,paint:a.style,layout:a.layout||{},minzoom:s||0,maxzoom:u||22};l&&(f.filter=l),this._addLayer(f,i,o)}}},{key:"_addBaselayer",value:function(t){var e=t.url,r=t.layerID,n=t.parentLayerId,i=t.visibility,o=void 0===i||i,a=t.minzoom,s=void 0===a?0:a,u=t.maxzoom,l=void 0===u?22:u,c=t.isIserver,f=void 0!==c&&c,h=t.bounds,p={type:"raster",tiles:e,minzoom:s||0,maxzoom:l||22,tileSize:f?this.rasterTileSize:256,rasterSource:f?"iserver":"",prjCoordSys:f&&!this.isOnlineBaseLayer(e[0],this.baseProjection)&&+this.baseProjection.split(":")[1]>0?{epsgCode:this.baseProjection.split(":")[1]}:"",proxy:this.baseLayerProxy};h&&(p.bounds=h);var d=p;!this.map.getSource(r)||this.map.getLayer(r)&&this.checkSameLayer&&this._isSameRasterLayer(r,p)||(d="".concat(r,"_").concat(+new Date),this.map.addSource(d,p)),this._addLayer({id:r,type:"raster",source:d,minzoom:s||0,maxzoom:l||22,layout:{visibility:this._getVisibility(o)}},n),this.baseLayerProxy=null}},{key:"_addStrokeLineForPoly",value:function(t){var e=t.style,r=t.source,n=t.layerID,i=t.parentLayerId,o=t.visible,a=t.minzoom,s=t.maxzoom,u={style:this._transformStyleToMapBoxGl(e,"LINE"),layout:{visibility:o}};this._addOverlayToMap({type:"LINE",source:r,layerID:n,parentLayerId:i,layerStyle:u,minzoom:a,maxzoom:s})}},{key:"_initLegendConfigInfo",value:function(t,e){var r=this,n={layerId:t.layerID,layerTitle:t.layerID,themeField:"HEAT"===t.layerType?t.themeSetting.weight:t.themeSetting.themeField,styleGroup:e},i=function(t,e){var n={style:{shape:r._getShape(e.featureType),type:r._getType(t.style.type)}};return r._addProps(n,t),n};switch(t.layerType){case"UNIQUE":n.styleGroup=n.styleGroup.map(function(e){return MOt({fieldValue:e.value},i(e,t))});break;case"RANGE":case"RANK_SYMBOL":n.styleGroup=n.styleGroup.map(function(e){return MOt({start:e.start,end:e.end},i(e,t))});break;case"HEAT":n.styleGroup=[{style:{shape:"POINT",type:"style",colors:this._heatColorToGradient(n.styleGroup)}}]}var o=this._legendList.findIndex(function(e){return e.layerId===t.layerID});o>-1?this._legendList.splice(o,1,n):this._legendList.push(n)}},{key:"_heatColorToGradient",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[];return t.forEach(function(r,n){n>5&&n%2==0&&e.push({value:r,key:6===n?0:t[n-1]})}),e}},{key:"_getType",value:function(t){return["IMAGE_POINT","SVG_POINT"].includes(t)?"image":"style"}},{key:"_getShape",value:function(t){return"POLYGON"===t?"FILL":t}},{key:"_addProps",value:function(t,e){if("POINT"===t.style.shape){if(Object.assign(t.style,{color:e.style.fillColor||e.color,opacity:e.style.fillOpacity,fontSize:2*e.radius||e.style.fontSize||"14px"}),"image"===t.style.type)return void Object.assign(t.style,{url:(e.style.imageInfo||{}).url||e.style.url});if(e.style.className)return void Object.assign(t.style,{icon:e.style.className})}"LINE"!==t.style.shape?"FILL"===t.style.shape&&Object.assign(t.style,{backgroundColor:e.style.fillColor||e.color,opacity:e.style.fillOpacity,outlineColor:e.style.strokeColor,width:20,height:20}):Object.assign(t.style,{width:20,lineStyles:[{color:e.color,lineDash:[],lineOffset:0,lineWidth:2,opacity:e.style.strokeOpacity||1}]})}},{key:"_createMvtLayer",value:function(t,e,r){var i=this._getDataVectorTileStyle(r),o=this._transformStyleToMapBoxGl(i,r),a=t.url+"/tileFeature.mvt",s=n.CRS.get(this.baseProjection).getOrigin(),u=e.minzoom,l=e.maxzoom;a+="?&returnAttributes=true&width=512&height=512&x={x}&y={y}&scale={scale}&origin={x:".concat(s[0],",y:").concat(s[1],"}"),this._addLayer({id:e.layerID,type:i.mbglType,source:{type:"vector",tiles:[a],proxy:this.webMapService.handleProxy("image")},"source-layer":"".concat(t.datasetName,"@").concat(t.datasourceName),paint:o,layout:{visibility:e.visible?"visible":"none"},minzoom:u||0,maxzoom:l||22}),this._addLayerSucceeded()}},{key:"_getDataVectorTileStyle",value:function(t){var e={radius:8,fillColor:"#EE4D5A",fillOpacity:.9,strokeColor:"#ffffff",strokeWidth:1,strokeOpacity:1,lineDash:"solid",type:"BASIC_POINT",mbglType:"circle"};return["LINE","LINESTRING","MULTILINESTRING"].includes(t)?(e.strokeColor="#4CC8A3",e.strokeWidth=2,e.mbglType="line"):["REGION","POLYGON","MULTIPOLYGON"].includes(t)&&(e.fillColor="#826DBA",e.mbglType="fill"),e}},{key:"_unproject",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this._unprojectProjection||this.baseProjection;if("EPSG:4326"===r)return t;var n=CY({coordinates:t,sourceProjection:r,proj4:this.specifiedProj4}),i=SY(r,this.specifiedProj4);return e&&i.axis&&0===i.axis.indexOf("ne")&&n.reverse(),n}},{key:"_getMapCenter",value:function(t){var e=t.center&&[t.center.x,t.center.y];return e||(e=[0,0]),e=this._unproject(e,!1),e=new n.LngLat(e[0],e[1])}},{key:"_getLabelFontFamily",value:function(t){var e=["sans-serif"],r=t.layers;return r&&r.length>0&&r.forEach(function(t){t.labelStyle&&e.push(t.labelStyle.fontFamily)},this),e.push("supermapol-icons"),e.join(",")}},{key:"_getTiandituUrl",value:function(t){for(var e=/t0/gi,r={tiandituUrl:[],labelUrl:[]},n=t.baseLayer.layerType.split("_")[1].toLowerCase(),i=Boolean(t.baseLayer.labelLayerVisible),o=this.tiandituKey||t.baseLayer.tk,a="https://t0.tianditu.gov.cn/{layer}_{proj}/wmts?tk=".concat(o),s=a,u="EPSG:4326"===this.baseProjection?"c":"w",l={service:"WMTS",request:"GetTile",style:"default",version:"1.0.0",layer:n,tilematrixSet:u,format:"tiles",width:256,height:256},c=(a+=this._getParamString(l,a)+"&tilematrix={z}&tilerow={y}&tilecol={x}").replace("{layer}",n).replace("{proj}",u),f=[],h=0;h<8;h++)f.push(c.replace(e,"t".concat(h)));if(r.tiandituUrl=f,i){var p={vec:"cva",ter:"cta",img:"cia"}[n];l.layer=p,s=(s+=this._getParamString(l,s)+"&tilematrix={z}&tilerow={y}&tilecol={x}").replace("{layer}",p).replace("{proj}",u);for(var d=[],y=0;y<8;y++)d.push(s.replace(e,"t".concat(y)));r.labelUrl=d}return r}},{key:"_defineProj4",value:function(t,e){var r=EY(t),n=/^EPSG:/,i=r&&t.match(n)?SY(r,this.specifiedProj4):t;return!r&&e&&e.match(n)&&(r=e),_Y(r,i,this.specifiedProj4),r}},{key:"_fetchRequest",value:function(t,e,r){return ut.get(t,null,r).then(function(t){return t[e]()}).then(function(t){return t}).catch(function(t){console.log(t)})}},{key:"getEpsgCodeWKT",value:function(t,e){if(t)return this._fetchRequest(t,"text",e)}},{key:"getBounds",value:function(t,e){if(t)return this._fetchRequest(t,"json",e)}},{key:"_addLayer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.id,r=arguments.length>2?arguments[2]:void 0,n=t.id;if(this.map.getLayer(n))return this.checkSameLayer&&this._isSameRasterLayer(n,t.source)?void this._setCacheLayer({layerInfo:t,parentLayerId:e,id:n,reused:!0,beforeId:r}):void this._updateLayer(t);var i=Object.assign({},t);i.metadata=Object.assign({},i.metadata,{SM_Layer_Id:e}),this.map.addLayer(i),this._setCacheLayer({layerInfo:t,parentLayerId:e,id:n,beforeId:r})}},{key:"_setCacheLayer",value:function(t){var e=t.parentLayerId,r=t.layerInfo,n=t.reused,i=void 0!==n&&n,o=t.beforeId,a=t.subRenderLayers,s=t.metadata,u=a||[{layerId:r.id,reused:i}];if(this._cacheLayerId.has(e)){var l,c=this._cacheLayerId.get(e),f=-1;o&&(f=c.renderLayers.findIndex(function(t){return t.layerId===o}));var h=f<0?c.renderLayers.length:f;(l=c.renderLayers).splice.apply(l,[h,0].concat(wOt(u)))}else{var p=Object.assign({},s||r&&r.metadata,{SM_Layer_Id:e});this._cacheLayerId.set(e,{renderLayers:u,metadata:p})}if(this.addLayersSucceededLen&&this._cacheLayerId.size<=this.expectLayerLen){this._changeSourceListModel();var d=this.getLayers(),y=this.getSelfAppreciableLayers(d),g=this._findTopLayerBeforeId(y);this.rectifyLayersOrder(y,g),this.fire("layeraddchanged",this._getSelfAppreciableLayers(d))}}},{key:"_findTopLayerBeforeId",value:function(t){var e=this,r=t.filter(function(t){return!t.reused}).reduce(function(t,e){return t.concat(e.renderLayers)},[]),n=r.find(function(t){return e.map.style._layers[t]});if(n){var i,o=this.map.getStyle().layers,a=o.findIndex(function(t){return t.id===n}),s=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=EOt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(o.filter(function(t){return!r.some(function(e){return e===t.id})}).map(function(t){return t.id}));try{var u,l=function(){var t=i.value;if(o.findIndex(function(e){return e.id===t})>a)return{v:t}};for(s.s();!(i=s.n()).done;)if(u=l())return u.v}catch(t){s.e(t)}finally{s.f()}}}},{key:"_changeSourceListModel",value:function(){var t=this,e=[],r=[this._mapInfo.baseLayer].concat(this._mapInfo.layers);if(this._graticuleLayer){var n=this._graticuleLayer,i=n.id,o=n.visible;r.push({layerID:i,visible:o,name:"GraticuleLayer"})}if(r.forEach(function(r){var n=r.layerID||r.name,i=void 0===r.visible||"visible"===r.visible||!0===r.visible,o=t._cacheLayerId.get(n);if(o){var a=o.renderLayers.map(function(t){return t.layerId});if(!a.length)return;e.push(MOt(MOt(MOt({},r),o),{},{id:n,visible:i,renderLayers:a,reused:o.renderLayers.some(function(t){return t.reused})}))}}),!this._sourceListModel)return this._sourceListModel=new vOt({map:this.map,layers:e,appendLayers:this._appendLayers}),void this._sourceListModel.on({layerupdatechanged:function(e){t.fire("layerupdatechanged",e)}});this._sourceListModel.setLayers(e)}},{key:"_getSelfAppreciableLayers",value:function(t){return{layers:this.getSelfAppreciableLayers(t),allLoaded:this._cacheLayerId.size===this.expectLayerLen}}},{key:"_isSameRasterLayer",value:function(t,e){return Hi(e,this.map.getSource(t))}},{key:"_centerValid",value:function(t){return!(!t||!(t.length>0||_Ot(t)===n.LngLat||t.lng))}},{key:"_getResolution",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:512;return t.leftBottom&&t.rightTop?Math.max(t.rightTop.x-t.leftBottom.x,t.rightTop.y-t.leftBottom.y)/e:Math.max(t[2]-t[0],t[3]-t[1])/e}},{key:"_transformScaleToZoom",value:function(t,e){var r=e.getExtent(),n=e.unit,i=1/$.getScaleFromResolutionDpi((r[2]-r[0])/512,96,n),o=t.split(":")[1];return Math.min(24,+Math.log2(i/+o).toFixed(2))}},{key:"_updateLayer",value:function(t){var e=this,r=t.id,n=t.paint,i=t.source,o=i.type,a=i.tiles,s=i.data,u=i.proxy,l=this.map.getSource(r);l&&("geojson"===o||"geojson"===l.type?(Object.keys(n).forEach(function(t){e.map.setPaintProperty(r,t,n[t])}),s&&l.setData(s)):"raster"===o&&this._updateRasterSource(r,{proxy:u,tiles:a}))}},{key:"_updateRasterSource",value:function(t,e){if(t){var r=this.map.getSource(t);Object.assign(r,e),this.map.style.sourceCaches[t].clearTiles(),this.map.style.sourceCaches[t].update(this.map.transform),this.map.triggerRepaint()}}},{key:"updateOverlayLayer",value:function(t,e,r){var n=this._mapInfo.layers.find(function(e){return e.layerID===t.id});if(e)this._initOverlayLayer(n,e,r);else{var i=this.webMapService.getDatasourceType(n);this.getLayerFeatures(n,this._taskID,i)}}},{key:"isOnlineBaseLayer",value:function(t,e){return t.startsWith("https://maptiles.supermapol.com/iserver/services/map_China/rest/maps/China_Dark")&&"EPSG:3857"===e}},{key:"_handleMultyPolygon",value:function(t){var e=this;return t.forEach(function(t){if("Polygon"===t.geometry.type){var r=t.geometry.coordinates;if(r.length>1){for(var n=[[r[0]]],i=1;i0?n[n.length-1].push(r[i]):n.push([r[i]]))}t.geometry.coordinates=n,t.geometry.type="MultiPolygon"}}}),t}},{key:"signedArea",value:function(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;it.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=WOt(this,e,[r]))._mapInfo=r.mapInfo,t._layerCatalog=r.mapInfo.metadata.layerCatalog,t._mapResourceInfo=r.mapResourceInfo,t._l7LayerUtil=r.l7LayerUtil,t._legendList=r.legendList,t._immutableTopOrderLayers=["chart","point-extrusion"];var n=t._generateLayers();return t.setLayers(n),t.initDatas(),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&XOt(t,e)}(e,oOt),r=e,(n=[{key:"createLayerCatalogs",value:function(){var t=this.getLayers(!1),e=this._createSourceCatalogs(this._layerCatalog,t),r=this.getSelfLayers(),n=t.filter(function(t){return!r.some(function(e){return e.id===t.id})});return this._initSourceList(n).concat(e)}},{key:"getSelfLayerIds",value:function(){return this.layers.reduce(function(t,e){return t.concat(e.layerInfo.renderLayers)},[])}},{key:"initLayers",value:function(){var t=this,e=this._getAllLayersOnMap();this.appendLayers&&(e=[]);var r=this.layers.map(function(e){var r=Object.assign({},e);return e["source-layer"]&&(r.sourceLayer=e["source-layer"]),t._pickLayerFields(r)}),n=this.layers.reduce(function(t,e){return t.concat(e.layerInfo.renderLayers)},[]);return this.concatExpectLayers(r,n,e)}},{key:"_createSourceCatalogs",value:function(t,e){var r=this;return t.map(function(t){var n,i=t.id,o=t.title,a=void 0===o?i:o,s=t.type,u=t.visible,l=t.children,c=t.parts;if("group"===s)n={children:r._createSourceCatalogs(l,e),id:i,title:a,type:s,visible:u};else{var f=Qi(c,i,r._mapInfo.layers),h=e.find(function(t){return t.id===f[0]});r.removeLayerExtralFields([h]),n=Object.assign({},h)}return n})}},{key:"_generateLayers",value:function(){var t=this,e=this._mapResourceInfo,r=e.catalogs,n=void 0===r?[]:r,i=e.datas,o=void 0===i?[]:i,a=Ui(n,"catalogType"),s=Ui(this._mapInfo.metadata.layerCatalog),u=this._l7LayerUtil.getL7MarkerLayers(),l=s.map(function(e){var r=Qi(e.parts,e.id,t._mapInfo.layers),n=Yi(e.parts,e.id,t._mapInfo.layers),i={id:n.id,title:e.title,renderLayers:r,reused:n.metadata&&n.metadata.reused},s=(a.find(function(t){return t.id===e.id})||{}).msDatasetId,l={};if(s){var c,f=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=HOt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(o);try{for(f.s();!(c=f.n()).done;){var h=c.value,p=h.datasets&&h.datasets.find(function(t){return t.msDatasetId===s});if(p){if(l={serverId:p.datasetId,type:h.sourceType},"REST_DATA"===h.sourceType){var d=UOt(h.url.split("/rest/data/datasources/"),2),y=d[0],g=d[1];l.url="".concat(y,"/rest/data"),l.dataSourceName="".concat(g,":").concat(p.datasetName),delete l.serverId}break}}}catch(t){f.e(t)}finally{f.f()}}var v=t.map.getSource(n.source);if(!Object.keys(l).length&&v&&"vector"===v.type){var m=t._mapInfo.sources[n.source]||v;if(m.tiles&&m.tiles[0].includes("/rest/maps/")){var b=UOt(m.tiles[0].split("/rest/maps/"),2),A=b[0],x=UOt(b[1].split("/tileFeature"),1)[0];l.url="".concat(A,"/rest/maps"),l.mapName=x,l.type="REST_MAP"}}i.dataSource=l,t._l7LayerUtil.isL7Layer(n)&&(i.CLASS_NAME="L7Layer"),u[n.id]&&(i.CLASS_INSTANCE=u[n.id]);var w=t._legendList.filter(function(t){return t.layerId===n.id}).map(function(t){return t.themeField}).filter(function(t){return!!t}),_=Array.from(new Set(w));return _.length>0&&(i.themeSetting={themeField:_}),t._immutableTopOrderLayers.some(function(t){return t===n.type})&&(i.metadata=Object.assign({},n.metadata,{SM_Layer_Order:"top"})),Object.assign({},n,{layerInfo:i})});return l.reverse(),l}}])&&QOt(r.prototype,n),i&&QOt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function JOt(t){return function(t){if(Array.isArray(t))return tMt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||$Ot(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ZOt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=$Ot(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function $Ot(t,e){if(t){if("string"==typeof t)return tMt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?tMt(t,e):void 0}}function tMt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function rMt(t){"@babel/helpers - typeof";return(rMt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nMt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function iMt(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(r=uMt(this,a)).mapId=t,r.options=e,r.mapOptions=n,r._mapResourceInfo={},r._relatedInfo=e.relatedInfo||{},r._sprite="",r._spriteDatas={},r._appendLayers=!1,r._baseProjection="",r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fMt(t,e)}(a,t),s=a,(u=[{key:"initializeMap",value:function(t,e){if(this._mapInfo=t,this._setBaseProjection()){if(e){this._appendLayers=!0,this.map=e;var r=this._mapInfo.sprite;return r&&(this._sprite=r,this.map.addStyle({sprite:r})),void this._initLayers()}this._createMap()}}},{key:"cleanLayers",value:function(t){lMt(cMt(a.prototype),"cleanLayers",this).call(this,t);var e=o.getL7MarkerLayers();for(var r in e)o.removeL7MarkerLayer(r,this.map.$l7scene)}},{key:"clean",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.map){if(this._sourceListModel&&(this._sourceListModel.destroy(),this._sourceListModel=null),t){var e=this.map.$l7scene;e&&e.removeAllLayer(),this.map.remove()}this.map=null,this._legendList=[],this._mapResourceInfo={},this._sprite="",this._spriteDatas={},this.mapOptions={},this.options={}}}},{key:"copyLayer",value:function(){var t=aMt(eMt().mark(function t(e){var r,n,i,a,s,u=arguments;return eMt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=u.length>1&&void 0!==u[1]?u[1]:{},(n=this._mapInfo.layers.find(function(t){return t.id===e}))&&!this._getLayerOnMap(r.id)){t.next=4;break}return t.abrupt("return");case 4:if(i=r.id||"".concat(n.id,"_copy"),a=iMt(iMt(iMt({},n),r),{},{id:i}),!o.isL7Layer(a)){t.next=12;break}return s=[a],t.next=10,o.addL7Layers({map:this.map,webMapInfo:iMt(iMt({},this._mapInfo),{},{layers:s,sources:this._mapInfo.sources}),l7Layers:s,spriteDatas:this._spriteDatas,options:this.options});case 10:t.next=14;break;case 12:"object"===rMt(a.source)&&(this.map.addSource(a.id,a.source),a.source=a.id),this.map.addLayer(a);case 14:return t.abrupt("return",a);case 15:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"updateOverlayLayer",value:function(t,e,r){if("geojson"===t.renderSource.type){var n=t.renderSource.id,i={type:"FeatureCollection",features:e=Gi({sourceId:n,features:e,mergeByField:r,map:this.map})};this.map.getSource(n).setData(i)}}},{key:"_createMap",value:function(){var t=this,e=this._mapInfo,i=e.name,o=void 0===i?"":i,a=e.center,s=void 0===a?new n.LngLat(0,0):a,u=e.zoom,l=void 0===u?0:u,c=e.bearing,f=void 0===c?0:c,h=e.pitch,p=void 0===h?0:h,d=e.minzoom,y=e.maxzoom,g=e.sprite,v=void 0===g?"":g;s=this.mapOptions.center||s,l=this.mapOptions.zoom||l,f=this.mapOptions.bearing||f,p=this.mapOptions.pitch||p;var m=this._getLabelFontFamily(),b=iMt(iMt({transformRequest:function(e,r){var n={url:e};return"Tile"===r&&t.options.iportalServiceProxyUrl&&e.indexOf(t.options.iportalServiceProxyUrl)>=0&&(n.credentials="include"),n}},this.mapOptions),{},{container:this.options.target,crs:this._baseProjection,center:s,zoom:l,style:{sprite:v,name:o,version:8,sources:{},layers:[]},minZoom:d,maxZoom:y,bearing:f,pitch:p,localIdeographFontFamily:m||""});this.map=new r(b),this._sprite=v,this.fire("mapinitialized",{map:this.map}),this.map.on("load",function(){t._initLayers()})}},{key:"_setBaseProjection",value:function(){var t=this._mapInfo.crs,e=t;if("object"===rMt(t)){if(e=t.name,!n.CRS){var r="The EPSG code ".concat(e," needs to include ").concat(i,"-enhance.js. Refer to the example: https://iclient.supermap.io/examples/").concat(i.replace("-",""),"/editor.html#mvtVectorTile_2362");return this.fire("mapcreatefailed",{error:r}),void console.error(r)}this._setCRS(t)}return this._baseProjection=e,this._baseProjection}},{key:"_setCRS",value:function(t){var e=t.name,r=t.wkt,i=t.extent;if(!n.CRS.get(e)){var o=new n.CRS(e,r,i,i[2]>180?"meter":"degree");n.CRS.set(o)}}},{key:"_initLayers",value:function(){var t=aMt(eMt().mark(function t(){var e=this;return eMt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.map.getCRS||this.map.getCRS().epsgCode===this._baseProjection){t.next=3;break}return this.fire("projectionnotmatch"),t.abrupt("return");case 3:return t.next=5,this._getSpriteDatas();case 5:if("[object Object]"!==Object.prototype.toString.call(this.mapId)){t.next=11;break}return this.mapParams={title:this._mapInfo.name,description:this._relatedInfo.description},this._relatedInfo.projectInfo&&(this._mapResourceInfo=JSON.parse(this._relatedInfo.projectInfo)),this._createMapRelatedInfo(),this._addLayersToMap(),t.abrupt("return");case 11:this._getMapRelatedInfo().then(function(t){e.mapParams={title:e._mapInfo.name,description:t.description},e._mapResourceInfo=JSON.parse(t.projectInfo),e._createMapRelatedInfo(),e._addLayersToMap()}).catch(function(t){e.fire("mapcreatefailed",{error:t}),console.error(t)});case 12:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"_createMapRelatedInfo",value:function(){var t=this._mapInfo.glyphs;for(var e in t)this.map.style.addGlyphs(e,t[e])}},{key:"_getMapRelatedInfo",value:function(){var t=function(t){var e=t.url,r=t.server,n=t.excludePortalProxyUrl,i=t.credentialValue,o=t.credentialKey,a=-1===e.indexOf(".json")?"".concat(e,".json"):e,s="getUrlResource.json?url=";if(n&&r.indexOf(s)>-1){var u=r.split(s);u.length>1&&(a=u[0]+s+a)}return i&&o&&(a+="?"+o+"="+i),a}(Object.assign({url:"".concat(this.options.server,"web/maps/").concat(this.mapId)},this.options));return ut.get(t,null,{withCredentials:this.options.withCredentials}).then(function(t){return t.json()})}},{key:"_addLayersToMap",value:function(){var t=aMt(eMt().mark(function t(){var e,r,n,i,a,s,u=this;return eMt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e=this._setUniqueId(this._mapInfo,this._mapResourceInfo),r=e.sources,n=e.layers,i=e.layerCatalog,a=e.catalogs,Object.assign(this._mapInfo,{sources:r,layers:n,metadata:Object.assign(this._mapInfo.metadata,{layerCatalog:i})}),Object.assign(this._mapResourceInfo,{catalogs:a}),n.filter(function(t){return!o.isL7Layer(t)}).forEach(function(t){t.metadata&&t.metadata.reused||(t.source&&!u.map.getSource(t.source)&&u.map.addSource(t.source,r[t.source]),"symbol"===t.type&&0===t.layout["text-z-offset"]&&delete t.layout["text-z-offset"],u.map.addLayer(t))}),!((s=n.filter(function(t){return o.isL7Layer(t)})).length>0)){t.next=10;break}return t.next=10,o.addL7Layers({map:this.map,webMapInfo:iMt(iMt({},this._mapInfo),{},{layers:n,sources:r}),l7Layers:s,spriteDatas:this._spriteDatas,options:iMt(iMt({},this.options),{},{emitterEvent:this.fire.bind(this)})});case 10:this._createLegendInfo(),this._sendMapToUser(),t.next=18;break;case 14:t.prev=14,t.t0=t.catch(0),this.fire("mapcreatefailed",{error:t.t0,map:this.map}),console.error(t.t0);case 18:case"end":return t.stop()}},t,this,[[0,14]])}));return function(){return t.apply(this,arguments)}}()},{key:"_setUniqueId",value:function(t,e){var r=this._handleUnSupportedLayers(t),n=JSON.parse(JSON.stringify(t.layers)).filter(function(t){return!r.includes(t.id)}),i={},o={},a=[],s="_".concat(+new Date);for(var u in t.sources){var l=u;this.map.getSource(u)&&(l=u+s),o[l]=u,i[l]=t.sources[u];var c,f=ZOt(n);try{for(f.s();!(c=f.n()).done;){var h=c.value;h.source===u&&(h.source=l)}}catch(t){f.e(t)}finally{f.f()}}var p,d=ZOt(n);try{for(d.s();!(p=d.n()).done;){var y=p.value,g=y.id,v=this._getLayerOnMap(y.id);if(v)if(this.options.checkSameLayer&&Hi(i[y.source],this.map.getSource(v.source)))y.metadata=y.metadata||{},y.metadata.reused=!0,y.source=o[y.source];else{var m=y.id+s;y.id=m}a.push({originId:g,renderId:y.id,id:g})}}catch(t){d.e(t)}finally{d.f()}var b=JSON.parse(JSON.stringify(t.metadata.layerCatalog),"parts");this._updateLayerCatalogsId({loopData:JSON.parse(JSON.stringify(b)),catalogs:b,layerIdMapList:a,unspportedLayers:r});var A=JSON.parse(JSON.stringify(e.catalogs||[]));return this._updateLayerCatalogsId({loopData:JSON.parse(JSON.stringify(A)),catalogs:A,layerIdMapList:a,catalogTypeField:"catalogType",layerIdsField:"layersContent",unspportedLayers:r}),{sources:i,layers:n,layerCatalog:b,catalogs:A}}},{key:"_getLayerOnMap",value:function(t){var e=this.map.overlayLayersManager[t];if(e)return e;var r=o.getL7MarkerLayers()[t];return r||this.map.getLayer(t)}},{key:"_findLayerCatalog",value:function(t,e){var r,n=ZOt(t);try{for(n.s();!(r=n.n()).done;){var i=r.value;if(i.id===e)return i;if(i.children){var o=this._findLayerCatalog(i.children,e);if(o)return o}}}catch(t){n.e(t)}finally{n.f()}return null}},{key:"_deleteLayerCatalog",value:function(t,e){for(var r=0;r0&&e.forEach(function(e){var r=e.layout&&e.layout["text-font"]||[];t.push.apply(t,JOt(r))}),t.join(",")}},{key:"_getSpriteDatas",value:function(){var t=this,e=this._sprite;if(e){var r=[];return"string"==typeof e?r.push(e):"object"===rMt(e)&&Object.keys(e).forEach(function(t){r.push(e[t])}),Promise.all(r.map(function(e){return t._getSpriteData(e)})).then(function(e){e.forEach(function(e){t._spriteDatas=iMt(iMt({},t._spriteDatas),e)})})}}},{key:"_getSpriteData",value:function(t){var e=t.replace(/.+(web\/maps\/.+)/,"".concat(this.options.server,"$1"));return ut.get(e,null,{withCredentials:this.options.withCredentials}).then(function(t){return t.json()})}},{key:"_createLegendInfo",value:function(){var t,e=this,r=this._mapResourceInfo.catalogs,n=ZOt(Ui(void 0===r?[]:r,"catalogType"));try{var i=function(){var r,n=t.value,i=n.visualization||{},o=i.renderer,a=i.label;if(!o)return 1;var s,u=Yi(n.layersContent,n.id,e._mapInfo.layers),l=e._mapInfo.sources[u.source];"clusterField"in l&&(s=l.clusterField);var c=Object.assign({},u,{title:n.title,themeField:s}),f=e._parseRendererStyleData(o);a&&(f.push(iMt(iMt({},a),{},{type:"text"})),a.symbolsContent&&a.symbolsContent.value.symbolId&&f.push(iMt(iMt({},a),{},{type:"symbol"}))),f[0].textField&&f[0].textField.value&&f.push(iMt(iMt({},f[0]),{},{type:"text"}));var h=f.reduce(function(t,r){var n=e._createLayerLegendList(c,r);return n&&t.push.apply(t,JOt(n)),t},[]);(r=e._legendList).push.apply(r,JOt(h))};for(n.s();!(t=n.n()).done;)i()}catch(t){n.e(t)}finally{n.f()}}},{key:"_getAliasKey",value:function(t,e){return"isoline3D"===t&&"dashArray"===e?"lineDasharray":e}},{key:"_transStyleKeys",value:function(t,e){var r=this;return e.map(function(e){return r._getAliasKey(t,e)})}},{key:"_transStyleSetting",value:function(t,e){for(var r in e){var n=this._getAliasKey(t,r);n!==r&&(e[n]=e[r])}}},{key:"_getLegendSimpleStyle",value:function(t,e){var r={};e&&e.filter(function(e){return t[e]&&"simple"===t[e].type}).forEach(function(e){("outlineColor"!==e||(t.antialias||{}).value)&&(r[e]=(t[e]||{}).value)});return r}},{key:"_getLegendRenderType",value:function(t){switch(t){case"text":return dMt.TEXT;case"circle":case"symbol":case"column":return dMt.POINT;case"heatGrid":case"heatHexagon":case"heat3DGrid":case"heat3DHexagon":return dMt.BUILTINSYMBOL;case"line":case"isoline3D":return dMt.LINE;case"fill":return dMt.FILL;case"fillExtrusion":return dMt.FILLEXTRUSION;case"animatePoint":return dMt.ANIMATEPOINT;case"line3D":case"animateLine":return dMt.ANIMATELINE;case"radarPoint":return dMt.RADARPOINT}}},{key:"_getLegendShape",value:function(t,e){switch(t){case"text":return yMt.TEXT;case"circle":case"symbol":return yMt.POINT;case"column":return{cylinder:yMt.POINT,triangleColumn:yMt.TRIANGLE,squareColumn:yMt.RECTANGLE,hexagonColumn:yMt.HEXAGON}[e.shape.value]||yMt.POINT;case"heatHexagon":case"heat3DHexagon":return yMt.HEXAGON;case"line":case"isoline3D":return yMt.LINE;case"fill":case"heatGrid":case"heat3DGrid":case"fillExtrusion":return yMt.RECTANGLE;case"animatePoint":return yMt.ANIMATEPOINT;case"animateLine":case"line3D":return yMt.ANIMATELINE;case"radarPoint":return yMt.RADARPOINT;case"heat":case"heat3D":return yMt.LINEGRADIENT}}},{key:"_isShowLegendSingleItem",value:function(t,e){return 0===t.length||1===t.length&&"color"===t[0]&&e}},{key:"_isWebsymbolById",value:function(t){return["line-","polygon-","point-"].some(function(e){return t&&t.startsWith(e)})}},{key:"_getSymbolSDFStatus",value:function(t,e){return!this._isWebsymbolById(t)&&(!!this._getIconById(t)||(e[t]&&e[t].sdf||!1))}},{key:"_isAllPicturePoint",value:function(t,e){var r=this;return"simple"===t.type?!this._getSymbolSDFStatus(t.value.symbolId,e):[].concat(JOt(t.values),[{value:t.defaultValue}]).filter(function(t){return t.value.symbolId}).every(function(t){return!r._getSymbolSDFStatus(t.value.symbolId,e)})}},{key:"_isAllPictureSymbolSaved",value:function(t,e,r){var n=this;return!!e&&("point"===t?this._isAllPicturePoint(e,r):"simple"===e.type?!!this._getImageIdFromValue(e.value.style,wMt[t]).length:e.values.map(function(t){return t.value}).concat(e.defaultValue).every(function(e){return!!n._getImageIdFromValue(e.style,wMt[t]).length}))}},{key:"_getDataDrivenStyleKeys",value:function(t,e,r){return(hMt({},dMt.TEXT,mMt)[t]||e).filter(function(t){return r[t]&&"simple"!==r[t].type})}},{key:"_createLayerLegendList",value:function(t,e){var r=this,n=t.id,i=t.title,o={themeField:t.themeField||e.field,layerId:n,layerTitle:i},a=e.type||t.type,s=this._getLegendRenderType(a),u=this._getLegendShape(a,e);if(["heat","heat3D"].includes(a)){var l=this._heatColorToGradient((t.paint||{})[{heat:"heatmap-color",heat3D:"heatmap-extrusion-color"}[a]]);return[iMt(iMt({},o),{},{styleGroup:[{style:{type:CMt.STYLE,shape:u,colors:l}}]})]}var c=bMt[s];if(c){var f=this._transStyleKeys(a,c);this._transStyleSetting(a,e);var h=this._getLegendSimpleStyle(e,f),p=this._parseLegendtyle({legendRenderType:s,customValue:h}),d=this._getDataDrivenStyleKeys(s,f,e);if(s===dMt.ANIMATELINE){var y="replace"===e.textureBlend.value,g=!(!e.symbolsContent.value||!e.symbolsContent.value.symbolId);y&&g&&(d=d.filter(function(t){return"color"!==t}))}else{var v=_Mt[t.type];this._isAllPictureSymbolSaved(v,e.symbolsContent,this._spriteDatas)&&(d=d.filter(function(t){return"color"!==t}))}var m=e.color&&e.color.interpolateInfo&&"linear"===e.color.interpolateInfo.type,b=[];return this._isShowLegendSingleItem(d,m)&&b.push(iMt(iMt({},o),{},{styleGroup:[{fieldValue:i||n,style:iMt(iMt({},p),{},{shape:u})}]})),b.concat(d.map(function(t){var n=e[t],i=r._getSettingStyle(t,n.defaultValue,h),a=[],l=r._getSettingCustom(n),c=r._getSettingInterpolateInfo(n),f={legendRenderType:s,styleField:t,subStyleSetting:n,simpleStyle:h,defaultSetting:i,custom:l,interpolateInfo:c,shape:u};switch(r._getLegendStyleType({styleField:t,currentType:n.type,custom:l,interpolateInfo:c})){case xMt.LINEAR:a=r._parseLinearStyle(f);break;case xMt.RANGE:a=r._parseRangeStyle(f);break;case xMt.UNIQUE:a=r._parseUniqueStyle(f)}return iMt(iMt({},o),{},{themeField:(n.field||[])[0],styleField:t,styleGroup:a})}))}}},{key:"_heatColorToGradient",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[];return t.forEach(function(r,n){n>5&&n%2==0&&e.push({value:r,key:6===n?0:t[n-1]})}),e}},{key:"_getSettingCustom",value:function(t){var e=t.value,r=t.values;return this._isLinear(t)?e:r}},{key:"_getSettingInterpolateInfo",value:function(t){var e=t.interpolateInfo,r=void 0===e?{}:e;return this._isLinear(t)?{type:"linear"}:r}},{key:"_isLinear",value:function(t){return"linear"===t.type}},{key:"_getLegendStyleType",value:function(t){var e=t.styleField,r=t.currentType,n=t.custom,i=t.interpolateInfo;return["unique","linear"].includes(r)?this._isColorAttr(e)&&"linear"===i.type&&n.length>1?xMt.LINEAR:xMt.UNIQUE:xMt.RANGE}},{key:"_isColorAttr",value:function(t){return["color","textColor","outlineColor","textHaloColor"].includes(t)}},{key:"_parseLinearStyle",value:function(t){var e=t.shape,r=t.custom;return[{styleField:null,style:{type:CMt.STYLE,shape:e,colors:r}}]}},{key:"_parseUniqueStyle",value:function(t){var e=this,r=t.legendRenderType,n=t.styleField,i=t.simpleStyle,o=t.defaultSetting,a=t.custom,s=t.interpolateInfo,u=t.shape,l=a.map(function(t){var o=e._getSettingStyle(n,t.value,i),a=e._parseLegendtyle({legendRenderType:r,customValue:o});return{fieldValue:t.key,style:iMt(iMt({},a),{},{shape:u})}});if(!s.type||"custom"===s.type){var c=this._parseLegendtyle({legendRenderType:r,customValue:o});l.push({fieldValue:null,style:iMt(iMt({},c),{},{shape:u})})}return l}},{key:"_parseRangeStyle",value:function(t){var e=this,r=t.legendRenderType,n=t.styleField,i=t.simpleStyle,o=t.defaultSetting,a=t.custom,s=t.shape,u=a.map(function(t){var o=e._getSettingStyle(n,t.value,i),a=e._parseLegendtyle({legendRenderType:r,customValue:o});return{start:t.start,end:t.end,style:iMt(iMt({},a),{},{shape:s})}}),l=this._parseLegendtyle({legendRenderType:r,customValue:o});return u.push({start:null,end:null,style:iMt(iMt({},l),{},{shape:s})}),u}},{key:"_getSettingStyle",value:function(t,e,r){var n=Object.assign({},r);return n[t]=e,n}},{key:"_parseLegendtyle",value:function(t){var e=this,r=t.legendRenderType,n=t.customValue,i=iMt({},vMt[r]);Object.keys(i).forEach(function(t){var e=n[gMt[t]||t];([dMt.FILL,dMt.FILLEXTRUSION].includes(r)||e)&&(i[t]=e)});var o=n.symbolsContent||{},a=o.symbolId,s=void 0===a?AMt[r]:a,u=o.style;switch(r){case dMt.TEXT:return iMt({type:CMt.STYLE,icon:"supermapol-icons-text-layer"},i);case dMt.POINT:return"BASE"===(this._getIconById(s)?"BASE":"SERVICE")?iMt({type:CMt.STYLE},i):this._getSpriteStyle(s,i);case dMt.BUILTINSYMBOL:return iMt({type:CMt.STYLE},i);case dMt.ANIMATEPOINT:case dMt.RADARPOINT:return iMt({type:CMt.STYLE},i);case dMt.LINE:case dMt.ANIMATELINE:u=u||[];var l=Object.assign({},n);delete l.symbolsContent;var c=iMt(iMt({type:CMt.STYLE},l),{},{width:SMt}),f=iMt({},vMt.LINE),h=u instanceof Array?u:[u],p=h.some(function(t){return!!e._getImageIdByLegendType(t,r)}),d=h[0];if(p){var y=this._getImageIdByLegendType(d,r),g=iMt(iMt(iMt({},i),l),{},{height:i.width,width:SMt});return r===dMt.ANIMATELINE&&"replace"===l.textureBlend&&(g.backgroundColor="transparent"),this._getSpriteStyle(y,g)}if(!n.symbolsContent||r===dMt.ANIMATELINE&&!p)return iMt(iMt({},c),{},{height:n.width||f.height,lineWidth:n.width||f.width,color:n.color||f.backgroundColor});if(n.symbolsContent){var v=this._getLineWidth(h),m=h.map(function(t){return e._transformLineStyle({oldWidth:v,symbol:t,defaultStyle:f,customValue:n})});return iMt(iMt({},c),{},{lineStyles:m})}return;case dMt.FILL:case dMt.FILLEXTRUSION:var b=i.backgroundColor,A=((u||{}).paint||{})["fill-color"],x=iMt({},vMt.FILL);return b||Object.assign(i,{backgroundColor:A}),Object.keys(i).forEach(function(t){["backgroundColor","width","height","opacity"].includes(t)&&!i[t]&&(i[t]=x[t])}),i.outlineColor&&Object.assign(i,{outline:x.outline,marginLeft:"1px"}),this._spriteDatas[s]?this._getSpriteStyle(s,iMt(iMt({},i),{},{backgroundColor:"transparent"})):iMt({type:CMt.STYLE},i)}}},{key:"_getIconById",value:function(t){if("image"!==(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"svg")){return[{id:"circle",name:"circle"}].find(function(e){return e.id===t})}}},{key:"_getImageIdFromValue",value:function(t,e){var r=Array.isArray(t)?t:[t],n={symbol:"icon-image",line:"line-pattern",fill:"fill-pattern","fill-extrusion":"fill-pattern"}[e];return"symbol"===e?r.map(function(t){return t.layout&&t.layout[n]}).filter(function(t){return t}):r.map(function(t){return t.paint&&t.paint[n]}).filter(function(t){return t})}},{key:"_getImageIdByLegendType",value:function(t,e){var r={ANIMATELINE:wMt.point,LINE:wMt.line}[e],n=t.paint||{};return r===wMt.line?n["line-pattern"]:r===wMt.polygon?n["fill-pattern"]:(t.layout||{})["icon-image"]}},{key:"_getSpriteStyle",value:function(t,e){if(this._spriteDatas[t]){var r=this._spriteDatas[t];if(r.width&&r.height)return iMt(iMt({type:CMt.IMAGE,sprite:r},e),{},{url:"string"==typeof this._sprite?"".concat(this._sprite,".png"):""})}}},{key:"_transformLineStyle",value:function(t){var e,r=t.oldWidth,n=t.symbol,i=t.defaultStyle,o=t.customValue,a=n.paint,s=void 0===a?{}:a;return void 0!==o.height&&(e=this._updateSingleStyleByWidth(r,o.height,n)),{lineWidth:((e||{}).paint||{})[EMt]||s[EMt]||i.height,opacity:o.opacity||s["line-opacity"]||i.opacity,color:o.color||s["line-color"]||i.backgroundColor,lineDash:s["line-dasharray"]||[],lineOffset:s["line-offset"]||0}}},{key:"_updateSingleStyleByWidth",value:function(t,e,r){if(t===e)return r;var n=(r||{}).paint||{};if(0===t)return{paint:Object.assign({},n,{"line-width":Number(e.toFixed(2))})};var i=e/t,o=n["line-width"],a=n["line-offset"]||0,s=n["line-dasharray"]||[],u=this._updateDash(s,i);return{paint:Object.assign({},n,{"line-width":Number((o*i).toFixed(2)),"line-offset":Number((a*i).toFixed(2)),"line-dasharray":u&&u.map(function(t){return Number(t.toFixed(2))})})}}},{key:"_updateDash",value:function(t,e){if(t&&0!==t.length)return t.map(function(t){return t/e})}},{key:"_getLineWidth",value:function(t){return t instanceof Array?this._getWholeWidth(t):(t.paint||{})[EMt]||0}},{key:"_getWholeWidth",value:function(t){var e,r;return t.forEach(function(t){var n=(t||{}).paint||{},i=n["line-width"],o=n["line-offset"]||0,a=o+i/2,s=o-i/2;(a>e||void 0===e)&&(e=a),(s=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function OMt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:function(){return jMt(function t(){DMt(this,t)})}();return function(e){function r(){var t;return DMt(this,r),(t=MMt(this,r))._sourceListModel=null,t._legendList=[],t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&LMt(t,e)}(r,t),jMt(r,[{key:"initializeMap",value:function(){throw new Error("initializeMap is not implemented")}},{key:"clean",value:function(){throw new Error("clean is not implemented")}},{key:"getLayerCatalog",value:function(){return this._sourceListModel&&this._sourceListModel.getLayerCatalog()||[]}},{key:"getLayers",value:function(){return this._sourceListModel&&this._sourceListModel.getLayers()||[]}},{key:"getLegends",value:function(){return this._legendList}},{key:"getSelfAppreciableLayers",value:function(){var t;return this._sourceListModel&&(t=this._sourceListModel).getSelfLayers.apply(t,arguments)||[]}},{key:"setLayersVisible",value:function(){var t;this._sourceListModel&&(t=this._sourceListModel).setLayersVisible.apply(t,arguments)}},{key:"toggleLayerVisible",value:function(){var t;this._sourceListModel&&(t=this._sourceListModel).toggleLayerVisible.apply(t,arguments)}},{key:"rectifyLayersOrder",value:function(t,e){for(var r=this,n=t.filter(function(t){return!t.reused}).reduce(function(t,e){return t.concat(e.renderLayers)},[]).filter(function(t){return!!r.map.getLayer(t)}),i=n.length-1;i>-1;i--){var o=n[i],a=n.slice(i+1),s=a.find(function(t){return r.map.style._layers[t]});a.length||(s=e),this.map.moveLayer(o,s)}return n}},{key:"echartsLayerResize",value:function(){}},{key:"updateOverlayLayer",value:function(){}},{key:"copyLayer",value:function(){}},{key:"cleanLayers",value:function(t){var e,r=this,n=[],i=TMt(t);try{var o=function(){var t=e.value;t.renderLayers.forEach(function(e){var i=r.map.getLayer(e);i&&(r.map.removeLayer(e),!t.l7Layer&&i.source&&"string"==typeof i.source&&n.push(i.source))}),r.map.getSource(t.renderSource.id)&&!t.l7Layer&&n.push(t.renderSource.id)};for(i.s();!(e=i.n()).done;)o()}catch(t){i.e(t)}finally{i.f()}Array.from(new Set(n)).forEach(function(t){r.map.removeSource(t)})}}])}()}function FMt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return zMt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zMt(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function zMt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=WMt(this,i)).options=r,e.mapOptions=n,e.webMapService=new bTt(t,r),e._layerIdRenameMapList=[],e._appendLayers=!1,e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&XMt(t,e)}(i,t),o=i,(a=[{key:"initializeMap",value:function(t,e){var i=this;if(e)return this._appendLayers=!0,this.map=e,void this._addLayersToMap();this.mapOptions.container=this.options.target,"object"===VMt(this.mapOptions.crs)&&this.mapOptions.crs.epsgCode&&(this.mapOptions.crs=new n.CRS(this.mapOptions.crs.epsgCode,this.mapOptions.crs.WKT,this.mapOptions.crs.extent,this.mapOptions.crs.unit)),this.mapOptions.transformRequest||(this.mapOptions.transformRequest=function(t,e){var r="";if("string"==typeof i.options.proxy){var n="data";"Tile"===e&&(n="image"),r=i.webMapService.handleProxy(n)}return{url:r?"".concat(r).concat(encodeURIComponent(t)):t,credentials:i.webMapService.handleWithCredentials(r,t,i.options.withCredentials||!1)?"include":void 0}}),this.mapOptions.center=this.mapOptions.center||[0,0],this.mapOptions.zoom=this.mapOptions.zoom||0;var o=0;Object.prototype.hasOwnProperty.call(this.mapOptions,"fadeDuration")&&(o=this.mapOptions.fadeDuration),this.map=new r(UMt(UMt({},this.mapOptions),{},{fadeDuration:o})),this.fire("mapinitialized",{map:this.map}),this.map.on("load",function(){i._sendMapToUser()})}},{key:"clean",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.map&&(this._sourceListModel&&(this._sourceListModel.destroy(),this._sourceListModel=null),t&&this.map.remove(),this.map=null)}},{key:"_addLayersToMap",value:function(){var t=this,e=this._setUniqueId(this.mapOptions.style),r=e.sources,n=e.layers,i=e.layerIdMapList;n.forEach(function(e){var n=i.find(function(t){return t.renderId===e.id});n&&n.reused||(e.source&&!t.map.getSource(e.source)&&t.map.addSource(e.source,r[e.source]),t.map.addLayer(e))}),Object.assign(this.mapOptions.style,{layers:n,sources:r}),this._layerIdRenameMapList=i,this._sendMapToUser()}},{key:"_setUniqueId",value:function(t){var e=JSON.parse(JSON.stringify(t.layers)),r={},n={},i=[],o="_".concat(+new Date);for(var a in t.sources){var s=a;this.map.getSource(a)&&(s=a+o),n[s]=a,r[s]=t.sources[a];var u,l=FMt(e);try{for(l.s();!(u=l.n()).done;){var c=u.value;c.source===a&&(c.source=s)}}catch(t){l.e(t)}finally{l.f()}}var f,h=FMt(e);try{for(h.s();!(f=h.n()).done;){var p=f.value,d=p.id,y=void 0,g=this.map.getLayer(p.id);if(g)if(this.options.checkSameLayer&&Hi(r[p.source],this.map.getStyle().sources[g.source]))y=!0,p.source=n[p.source];else{var v=p.id+o;p.id=v}i.push({originId:d,renderId:p.id,reused:y})}}catch(t){h.e(t)}finally{h.f()}return{sources:r,layers:e,layerIdMapList:i}}},{key:"_generateAppreciableLayers",value:function(){var t=this;return this.mapOptions.style.layers.reduce(function(e,r){var n=Vi(r["source-layer"]?r:UMt(UMt({},r),{},{layerInfo:{id:r.id}})),i=e.find(function(t){return t.id===n});if(i)i.renderLayers.push(r.id);else{var o=t._layerIdRenameMapList.find(function(t){return t.renderId===r.id});e.push(UMt(UMt({},r),{},{id:n,name:o&&o.originId,renderLayers:[r.id],reused:o&&o.reused}))}return e},[])}},{key:"_sendMapToUser",value:function(){var t=this,e=this._generateAppreciableLayers();this._sourceListModel=new vOt({map:this.map,layers:e,appendLayers:this._appendLayers}),this._sourceListModel.on({layerupdatechanged:function(e){t.fire("layerupdatechanged",e)}}),this.fire("mapcreatesucceeded",{map:this.map,mapparams:{title:this.mapOptions.name,description:""},layers:this.getSelfAppreciableLayers()})}}])&&QMt(o.prototype,a),s&&QMt(o,s),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,a,s}()}var JMt=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8],"doc":"Style specification version number. Must be 8.","example":8},"fragment":{"type":"boolean","doc":"Indicates that a style is a fragment style.","example":true},"name":{"type":"string","doc":"A human-readable name for the style.","example":"Bright"},"metadata":{"type":"*","doc":"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like \'mapbox:\'."},"center":{"type":"array","value":"number","doc":"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).","example":[-73.9749,40.7736]},"zoom":{"type":"number","doc":"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).","example":12.5},"bearing":{"type":"number","default":0,"period":360,"units":"degrees","doc":"Default bearing, in degrees. The bearing is the compass direction that is \\"up\\"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).","example":29},"pitch":{"type":"number","default":0,"units":"degrees","doc":"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).","example":50},"light":{"type":"light","doc":"The global light source. Note: This API is deprecated. Prefer using `flat` light type instead in the `lights` API.","example":{"anchor":"viewport","color":"white","intensity":0.4}},"lights":{"required":false,"type":"array","value":"light-3d","doc":"Array of light sources affecting the whole map and the default for 3D style, mutually exclusive with the light property","example":[{"id":"environment","type":"ambient","properties":{"color":"rgba(255.0, 0.0, 0.0, 1.0)","intensity":0.4}},{"id":"sun_light","type":"directional","properties":{"color":"rgba(255.0, 0.0, 0.0, 1.0)","intensity":0.4,"direction":[200,40],"cast-shadows":true,"shadow-intensity":0.2}}],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"terrain":{"type":"terrain","optional":true,"doc":"A global modifier that elevates layers and markers based on a DEM data source."},"fog":{"type":"fog","doc":"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features. Note: fog is renamed to atmosphere in the Android and iOS SDKs and planned to be changed in GL-JS v.3.0.0."},"camera":{"type":"camera","doc":"Global setting to control additional camera intrinsics parameters, e.g. projection type (perspective / orthographic)."},"imports":{"type":"array","value":"import","doc":"Imports other styles into this style.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"schema":{"type":"schema","doc":"Definition of the schema for configuration options.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"sources":{"required":true,"type":"sources","doc":"Data source specifications.","example":{"mapbox-streets":{"type":"vector","url":"mapbox://mapbox.mapbox-streets-v6"}}},"sprite":{"type":"string","doc":"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).","example":"mapbox://sprites/mapbox/bright-v8"},"glyphs":{"type":"string","doc":"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).","default":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf","example":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},"transition":{"type":"transition","doc":"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style\'s `transition` property.","example":{"duration":300,"delay":0}},"projection":{"type":"projection","doc":"The projection the map should be rendered in. Supported projections are Mercator, Globe, Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Natural Earth, and Winkel Tripel. Terrain, sky and fog are supported by only Mercator and globe. CustomLayerInterface is not supported outside of Mercator.","example":{"name":"albers","center":[-154,50],"parallels":[55,65]}},"layers":{"required":true,"type":"array","value":"layer","doc":"Layers will be drawn in the order of this array.","example":[{"id":"water","source":"mapbox-streets","source-layer":"water","type":"fill","paint":{"fill-color":"#00ffff"}}]},"models":{"type":"models","doc":"Specification of models used in the style.","example":{"spruce1-lod0":"asset://spruce1-lod0.glb","spruce1-lod1":"asset://spruce1-lod1.glb","spruce1-lod2":"asset://spruce1-lod2.glb"}}},"model":{"type":"string","doc":"A URL to a model resource. Supported protocols are `http:`, `https:`, and `mapbox://`.","required":true},"import":{"id":{"type":"string","doc":"Unique import name.","required":true},"url":{"type":"string","doc":"The URL of the style.","required":true},"config":{"type":"config","doc":"Configuration values for the imported style\'s options."},"data":{"type":"$root","doc":"The inlined style that must correspond to the contents of the specified URL."}},"config":{"*":{"type":"*","doc":"Value of the imported style\'s configuration option."}},"schema":{"*":{"type":"option","doc":"Specification of a configuration option."}},"option":{"default":{"type":"*","doc":"Default configuration value for this option.","required":true},"type":{"type":"enum","doc":"The type this value is coerced to after evaluating the expression. If unspecified, the result is returned as is and is not validated.","values":{"string":{"doc":"The result will be coerced to a string."},"number":{"doc":"The result will be coerced to a number."},"boolean":{"doc":"The result will be coerced to a boolean."},"color":{"doc":"The result will be coerced to a color."}}},"array":{"type":"boolean","doc":"If true, this option is returned as an array"},"minValue":{"type":"number","doc":"If this option is a number, this specifies the minimum allowed value. Values lower than this will be clamped to the minimum value."},"maxValue":{"type":"number","doc":"If this option is a number, this specifies the maximum allowed value. Values higher than this will be clamped to the maximum value."},"stepValue":{"type":"number","doc":"If this option is a number, this specifies the increment between allowed values. Values will be rounded towards the nearest allowed value."},"values":{"type":"array","value":"*","doc":"If this option is specified, the result must be one of the given values. Otherwise, the default value is used instead."},"metadata":{"type":"*","doc":"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like \'mapbox:\'."}},"models":{"*":{"type":"model","doc":"A URL to a model resource. Supported protocols are `http:`, `https:`, and `mapbox://`."}},"light-3d":{"id":{"type":"string","doc":"Unique light name.","required":true},"properties":{"type":"properties","doc":"Properties of the light."},"type":{"type":"enum","doc":"Type of the light to be added","values":{"ambient":{"doc":"An indirect light affecting all objects in the map adding a constant amount of light on them. It has no explicit direction and cannot cast shadows.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"directional":{"doc":"A light that has a direction and is located at infinite distance, so its rays are parallel. It simulates the sun light and can cast shadows.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"flat":{"doc":"A global directional light source which is only applied on 3D and hillshade layers. Using this type disables other light sources.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}}}},"properties":["properties_light_directional","properties_light_ambient","properties_light_flat"],"properties_light_directional":{"direction":{"type":"array","default":[210,30],"minimum":[0,0],"maximum":[360,90],"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"Direction of the light source specified as [a azimuthal angle, p polar angle] where a indicates the azimuthal angle of the light relative to north (in degrees and proceeding clockwise), and p indicates polar angle of the light (from 0°, directly above, to 180°, directly below).","example":[90,40],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Color of the directional light.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"A multiplier for the color of the directional light.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"cast-shadows":{"type":"boolean","default":false,"doc":"Enable/Disable shadow casting for this light","transition":false,"expression":{"interpolated":false},"property-type":"data-constant","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"shadow-intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"Determines the shadow strength, affecting the shadow receiver surfaces final color. Values near 0.0 reduce the shadow contribution to the final color. Values near to 1.0 make occluded surfaces receive almost no directional light. Designed to be used mostly for transitioning between values 0 and 1.","transition":true,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}},"properties_light_ambient":{"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Color of the ambient light.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"A multiplier for the color of the ambient light.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}},"properties_light_flat":{"anchor":{"type":"enum","default":"viewport","values":{"map":{"doc":"The position of the light source is aligned to the rotation of the map."},"viewport":{"doc":"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"doc":"Whether extruded geometries are lit relative to the map or viewport.","example":"map","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).","example":[1.5,90,80],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}},"sources":{"*":{"type":"source","doc":"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},"source":["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":{"doc":"A vector tile source."}},"doc":"The type of the source."},"url":{"type":"string","doc":"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129],"doc":"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},"scheme":{"type":"enum","values":{"xyz":{"doc":"Slippy map tilenames scheme."},"tms":{"doc":"OSGeo spec scheme."}},"default":"xyz","doc":"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which tiles are available, as in the TileJSON spec."},"maxzoom":{"type":"number","default":22,"doc":"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"promoteId":{"type":"promoteId","doc":"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`. If specified as a string for a vector tile source, the same property is used across all its source layers. If specified as an object only specified source layers will have id overriden, others will fallback to original feature id"},"volatile":{"type":"boolean","default":false,"doc":"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{"android":"9.3.0","ios":"5.10.0"}}},"*":{"type":"*","doc":"Other keys to configure the data source."}},"source_raster":{"type":{"required":true,"type":"enum","values":{"raster":{"doc":"A raster tile source."}},"doc":"The type of the source."},"url":{"type":"string","doc":"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129],"doc":"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which tiles are available, as in the TileJSON spec."},"maxzoom":{"type":"number","default":22,"doc":"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"tileSize":{"type":"number","default":512,"units":"pixels","doc":"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},"scheme":{"type":"enum","values":{"xyz":{"doc":"Slippy map tilenames scheme."},"tms":{"doc":"OSGeo spec scheme."}},"default":"xyz","doc":"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"volatile":{"type":"boolean","default":false,"doc":"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{"android":"9.3.0","ios":"5.10.0"}}},"*":{"type":"*","doc":"Other keys to configure the data source."}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":{"doc":"A RGB-encoded raster DEM source"}},"doc":"The type of the source."},"url":{"type":"string","doc":"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129],"doc":"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which tiles are available, as in the TileJSON spec."},"maxzoom":{"type":"number","default":22,"doc":"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"tileSize":{"type":"number","default":512,"units":"pixels","doc":"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"encoding":{"type":"enum","values":{"terrarium":{"doc":"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},"mapbox":{"doc":"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},"default":"mapbox","doc":"The encoding used by this source. Mapbox Terrain RGB is used by default"},"volatile":{"type":"boolean","default":false,"doc":"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{"android":"9.3.0","ios":"5.10.0"}}},"*":{"type":"*","doc":"Other keys to configure the data source."}},"source_raster_array":{"type":{"required":true,"type":"enum","values":{"raster-array":{"doc":"A raster array source"}},"doc":"The type of the source."},"url":{"type":"string","doc":"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129],"doc":"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which tiles are available, as in the TileJSON spec."},"maxzoom":{"type":"number","default":22,"doc":"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"tileSize":{"type":"number","default":512,"units":"pixels","doc":"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"rasterLayers":{"type":"*","doc":"Contains the description of the raster data layers and the bands contained within the tiles."},"volatile":{"type":"boolean","default":false,"doc":"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{"android":"9.3.0","ios":"5.10.0"}}},"*":{"type":"*","doc":"Other keys to configure the data source."}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{"doc":"A GeoJSON data source."}},"doc":"The data type of the GeoJSON source."},"data":{"type":"*","doc":"A URL to a GeoJSON file, or inline GeoJSON."},"maxzoom":{"type":"number","default":18,"doc":"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0,"doc":"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},"filter":{"type":"*","doc":"An expression for filtering features prior to processing them for rendering."},"tolerance":{"type":"number","default":0.375,"doc":"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},"cluster":{"type":"boolean","default":false,"doc":"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\\n * `cluster` Is `true` if the point is a cluster \\n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\\n * `point_count` Number of original points grouped into this cluster\\n * `point_count_abbreviated` An abbreviated point count"},"clusterRadius":{"type":"number","default":50,"minimum":0,"doc":"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},"clusterMaxZoom":{"type":"number","doc":"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},"clusterMinPoints":{"type":"number","doc":"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},"clusterProperties":{"type":"*","doc":"An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{\\"property_name\\": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `\\"+\\"` or `\\"max\\"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\\n\\nExample: `{\\"sum\\": [\\"+\\", [\\"get\\", \\"scalerank\\"]]}`.\\n\\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `[\\"accumulated\\"]` value, e.g.:\\n`{\\"sum\\": [[\\"+\\", [\\"accumulated\\"], [\\"get\\", \\"sum\\"]], [\\"get\\", \\"scalerank\\"]]}`"},"lineMetrics":{"type":"boolean","default":false,"doc":"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},"generateId":{"type":"boolean","default":false,"doc":"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},"promoteId":{"type":"promoteId","doc":"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`."}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{"doc":"A video data source."}},"doc":"The data type of the video source."},"urls":{"required":true,"type":"array","value":"string","doc":"URLs to video content in order of preferred format."},"coordinates":{"required":true,"doc":"Corners of video specified in longitude, latitude pairs.","type":"array","length":4,"value":{"type":"array","length":2,"value":"number","doc":"A single longitude, latitude pair."}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{"doc":"An image data source."}},"doc":"The data type of the image source."},"url":{"required":false,"type":"string","doc":"URL that points to an image. If the URL is not specified, the image is expected to be loaded directly during runtime."},"coordinates":{"required":true,"doc":"Corners of image specified in longitude, latitude pairs. Note: When using globe projection, the image will be centered at the North or South Pole in the respective hemisphere if the average latitude value exceeds 85 degrees or falls below -85 degrees.","type":"array","length":4,"value":{"type":"array","length":2,"value":"number","doc":"A single longitude, latitude pair."}}},"source_model":{"type":{"required":true,"type":"enum","values":{"model":{"doc":"A collection of 3D models"},"batched-model":{"doc":"A collection of 3D models with anchor data"}},"doc":"Type of model source to be added. From single models to represent 2D layers to 3D tiled models covering a wide area."},"maxzoom":{"type":"number","default":18,"doc":"Maximum zoom level at which to create batched model tiles. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which batched-model tiles are available"},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec."}},"layer":{"id":{"type":"string","doc":"Unique layer name.","required":true},"type":{"type":"enum","values":{"fill":{"doc":"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"line":{"doc":"A stroked line.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"symbol":{"doc":"An icon or a text label.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"circle":{"doc":"A filled circle.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"heatmap":{"doc":"A heatmap.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"fill-extrusion":{"doc":"An extruded (3D) polygon.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}},"raster":{"doc":"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"raster-particle":{"doc":"Particle animation driven by textures such as wind maps.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0","macos":"0.1.0"}}},"hillshade":{"doc":"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}}},"model":{"doc":"A 3D model","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"background":{"doc":"The background color or pattern of the map.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"sky":{"doc":"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}}},"slot":{"doc":"Marks the position of a slot.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}},"doc":"Rendering type of this layer.","required":true},"metadata":{"type":"*","doc":"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like \'mapbox:\'."},"source":{"type":"string","doc":"Name of a source description to be used for this layer. Required for all layer types except `background` and `slot`."},"source-layer":{"type":"string","doc":"Layer to use from a vector tile source. Required for vector and raster-array sources; prohibited for all other source types, including GeoJSON sources."},"slot":{"type":"string","doc":"The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"minzoom":{"type":"number","minimum":0,"maximum":24,"doc":"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},"maxzoom":{"type":"number","minimum":0,"maximum":24,"doc":"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},"filter":{"type":"filter","doc":"An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `[\\"feature-state\\", ...]` expression is not supported in filter expressions. The `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions are supported only for filter expressions on the symbol layer."},"layout":{"type":"layout","doc":"Layout properties for the layer."},"paint":{"type":"paint","doc":"Default paint properties for this layer."}},"layout":["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_model":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"},"model-id":{"type":"string","default":"","doc":"Model to render.","property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":false,"requires":[{"source":["geojson","vector"]}]}},"layout_fill":{"fill-sort-key":{"type":"number","doc":"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{"js":"1.2.0","android":"9.1.0","ios":"5.8.0"},"data-driven styling":{"js":"1.2.0","android":"9.1.0","ios":"5.8.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_circle":{"circle-sort-key":{"type":"number","doc":"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{"js":"1.2.0","android":"9.2.0","ios":"5.9.0"},"data-driven styling":{"js":"1.2.0","android":"9.2.0","ios":"5.9.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"doc":"Radius of a fill extrusion edge in meters. If not zero, rounds extrusion edges for a smoother appearance.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.7.0","ios":"10.7.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{"doc":"A cap with a squared-off end which is drawn to the exact endpoint of the line."},"round":{"doc":"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line\'s width and centered on the endpoint of the line."},"square":{"doc":"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line\'s width."}},"default":"butt","doc":"The display of line endings.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"2.3.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{"doc":"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line\'s width."},"round":{"doc":"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line\'s width and centered on the endpoint of the line."},"miter":{"doc":"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},"default":"miter","doc":"The display of lines when joining.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"doc":"Used to automatically convert miter joins to bevel joins for sharp angles.","requires":[{"line-join":"miter"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"doc":"Used to automatically convert round joins to miter joins for shallow angles.","requires":[{"line-join":"round"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","doc":"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{"js":"1.2.0","android":"9.1.0","ios":"5.8.0"},"data-driven styling":{"js":"1.2.0","android":"9.1.0","ios":"5.8.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":{"doc":"The label is placed at the point where the geometry is located."},"line":{"doc":"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{"doc":"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},"default":"point","doc":"Label placement relative to its geometry.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"`line-center` value":{"js":"0.47.0","android":"6.4.0","ios":"4.3.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","doc":"Distance between two symbol anchors.","requires":[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"doc":"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don\'t have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","doc":"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{"js":"0.53.0","android":"7.4.0","ios":"4.11.0"},"data-driven styling":{"js":"0.53.0","android":"7.4.0","ios":"4.11.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{"doc":"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{"doc":"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"source":{"doc":"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},"default":"auto","doc":"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{"js":"0.49.0","android":"6.6.0","ios":"4.5.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-z-elevate":{"type":"boolean","default":false,"doc":"Position symbol on buildings (both fill extrusions and models) rooftops. In order to have minimal impact on performance, this is supported only when `fill-extrusion-height` is not zoom-dependent and remains unchanged. For fading in buildings when zooming in, fill-extrusion-vertical-scale should be used and symbols would raise with building rooftops. Symbols are sorted by elevation, except in cases when `viewport-y` sorting or `symbol-sort-key` are applied.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"requires":[{"symbol-placement":["point"]},{"symbol-z-order":["auto"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"doc":"If true, the icon will be visible even if it collides with other previously drawn symbols.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"doc":"If true, other symbols can be visible even if they collide with the icon.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"doc":"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.","requires":["icon-image","text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{"doc":"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},"viewport":{"doc":"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},"auto":{"doc":"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},"default":"auto","doc":"In combination with `symbol-placement`, determines the rotation behavior of icons.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"`auto` value":{"js":"0.25.0","android":"4.2.0","ios":"3.4.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"units":"factor of the original icon size","doc":"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{"type":"enum","values":{"none":{"doc":"The icon is displayed at its intrinsic aspect ratio."},"width":{"doc":"The icon is scaled in the x-dimension to fit the width of the text."},"height":{"doc":"The icon is scaled in the y-dimension to fit the height of the text."},"both":{"doc":"The icon is scaled in both x- and y-dimensions."}},"default":"none","doc":"Scales the icon to fit around the associated text.","requires":["icon-image","text-field"],"sdk-support":{"basic functionality":{"js":"0.21.0","android":"4.2.0","ios":"3.4.0"},"stretchable icons":{"js":"1.6.0","android":"9.2.0","ios":"5.8.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"units":"pixels","doc":"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.","requires":["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{"js":"0.21.0","android":"4.2.0","ios":"3.4.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-image":{"type":"resolvedImage","doc":"Name of image in sprite to use for drawing an image background.","tokens":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","doc":"Rotates the icon clockwise.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.21.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","doc":"Size of the additional area around the icon bounding box used for detecting symbol collisions.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"doc":"If true, the icon may be flipped to prevent it from being rendered upside-down.","requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"doc":"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{"type":"enum","values":{"center":{"doc":"The center of the icon is placed closest to the anchor."},"left":{"doc":"The left side of the icon is placed closest to the anchor."},"right":{"doc":"The right side of the icon is placed closest to the anchor."},"top":{"doc":"The top of the icon is placed closest to the anchor."},"bottom":{"doc":"The bottom of the icon is placed closest to the anchor."},"top-left":{"doc":"The top left corner of the icon is placed closest to the anchor."},"top-right":{"doc":"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{"doc":"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{"doc":"The bottom right corner of the icon is placed closest to the anchor."}},"default":"center","doc":"Part of the icon placed closest to the anchor.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"},"data-driven styling":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{"doc":"The icon is aligned to the plane of the map."},"viewport":{"doc":"The icon is aligned to the plane of the viewport."},"auto":{"doc":"Automatically matches the value of `icon-rotation-alignment`."}},"default":"auto","doc":"Orientation of icon when map is pitched.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{"doc":"The text is aligned to the plane of the map."},"viewport":{"doc":"The text is aligned to the plane of the viewport."},"auto":{"doc":"Automatically matches the value of `text-rotation-alignment`."}},"default":"auto","doc":"Orientation of text when map is pitched.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.21.0","android":"4.2.0","ios":"3.4.0"},"`auto` value":{"js":"0.25.0","android":"4.2.0","ios":"3.4.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{"doc":"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},"viewport":{"doc":"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},"auto":{"doc":"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},"default":"auto","doc":"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"`auto` value":{"js":"0.25.0","android":"4.2.0","ios":"3.4.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"doc":"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"doc":"Font stack to use for displaying text.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","doc":"Font size.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","doc":"The maximum line width for text wrapping.","requires":["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","doc":"Text leading value for multi-line text.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"2.3.0","android":"10.0.0","ios":"10.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","doc":"Text tracking amount.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{"doc":"The text is aligned towards the anchor position."},"left":{"doc":"The text is aligned to the left."},"center":{"doc":"The text is centered."},"right":{"doc":"The text is aligned to the right."}},"default":"center","doc":"Text justification options.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"},"auto":{"js":"0.54.0","android":"7.4.0","ios":"4.10.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","units":"ems","default":0,"doc":"Radial offset of text, in the direction of the symbol\'s anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{"js":"0.54.0","android":"7.4.0","ios":"4.10.0"},"data-driven styling":{"js":"0.54.0","android":"7.4.0","ios":"4.10.0"}},"requires":["text-field"],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":{"doc":"The center of the text is placed closest to the anchor."},"left":{"doc":"The left side of the text is placed closest to the anchor."},"right":{"doc":"The right side of the text is placed closest to the anchor."},"top":{"doc":"The top of the text is placed closest to the anchor."},"bottom":{"doc":"The bottom of the text is placed closest to the anchor."},"top-left":{"doc":"The top left corner of the text is placed closest to the anchor."},"top-right":{"doc":"The top right corner of the text is placed closest to the anchor."},"bottom-left":{"doc":"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{"doc":"The bottom right corner of the text is placed closest to the anchor."}},"requires":["text-field",{"symbol-placement":["point"]}],"doc":"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{"js":"0.54.0","android":"7.4.0","ios":"4.10.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":{"doc":"The center of the text is placed closest to the anchor."},"left":{"doc":"The left side of the text is placed closest to the anchor."},"right":{"doc":"The right side of the text is placed closest to the anchor."},"top":{"doc":"The top of the text is placed closest to the anchor."},"bottom":{"doc":"The bottom of the text is placed closest to the anchor."},"top-left":{"doc":"The top left corner of the text is placed closest to the anchor."},"top-right":{"doc":"The top right corner of the text is placed closest to the anchor."},"bottom-left":{"doc":"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{"doc":"The bottom right corner of the text is placed closest to the anchor."}},"default":"center","doc":"Part of the text placed closest to the anchor.","requires":["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"units":"degrees","doc":"Maximum angle change between adjacent characters.","requires":["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{"doc":"If a text\'s language supports horizontal writing mode, symbols would be laid out horizontally."},"vertical":{"doc":"If a text\'s language supports vertical writing mode, symbols would be laid out vertically."}},"doc":"The property allows control over a symbol\'s orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single \'vertical\' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either [\'horizontal\', \'vertical\'] or [\'vertical\', \'horizontal\'], the order doesn\'t affect the placement.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"1.3.0","android":"8.3.0","ios":"5.3.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","doc":"Rotates the text clockwise.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","doc":"Size of the additional area around the text bounding box used for detecting symbol collisions.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"doc":"If true, the text may be flipped vertically to prevent it from being rendered upside-down.","requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{"doc":"The text is not altered."},"uppercase":{"doc":"Forces all letters to be displayed in uppercase."},"lowercase":{"doc":"Forces all letters to be displayed in lowercase."}},"default":"none","doc":"Specifies how to capitalize text, similar to the CSS `text-transform` property.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","doc":"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.","value":"number","units":"ems","length":2,"default":[0,0],"requires":["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"doc":"If true, the text will be visible even if it collides with other previously drawn symbols.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"doc":"If true, other symbols can be visible even if they collide with the text.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"doc":"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.","requires":["text-field","icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_raster-particle":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"filter":{"type":"array","value":"*","doc":"A filter selects specific features from a layer."},"filter_symbol":{"type":"boolean","doc":"Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","doc":"Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","doc":"Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","doc":"Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","doc":"Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","doc":"Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{"doc":"`[\\"==\\", key, value]` equality: `feature[key] = value`"},"!=":{"doc":"`[\\"!=\\", key, value]` inequality: `feature[key] ≠ value`"},">":{"doc":"`[\\">\\", key, value]` greater than: `feature[key] > value`"},">=":{"doc":"`[\\">=\\", key, value]` greater than or equal: `feature[key] ≥ value`"},"<":{"doc":"`[\\"<\\", key, value]` less than: `feature[key] < value`"},"<=":{"doc":"`[\\"<=\\", key, value]` less than or equal: `feature[key] ≤ value`"},"in":{"doc":"`[\\"in\\", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`"},"!in":{"doc":"`[\\"!in\\", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`"},"all":{"doc":"`[\\"all\\", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`"},"any":{"doc":"`[\\"any\\", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`"},"none":{"doc":"`[\\"none\\", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`"},"has":{"doc":"`[\\"has\\", key]` `feature[key]` exists"},"!has":{"doc":"`[\\"!has\\", key]` `feature[key]` does not exist"}},"doc":"The filter operator."},"geometry_type":{"type":"enum","values":{"Point":{"doc":"Filter to point geometries."},"LineString":{"doc":"Filter to line geometries."},"Polygon":{"doc":"Filter to polygon geometries."}},"doc":"The geometry type for the filter to select."},"function":{"expression":{"type":"expression","doc":"An expression."},"stops":{"type":"array","doc":"An array of stops.","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0,"doc":"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},"property":{"type":"string","doc":"The name of a feature property to use as the function input.","default":"$zoom"},"type":{"type":"enum","values":{"identity":{"doc":"Return the input value as the output value."},"exponential":{"doc":"Generate an output by interpolating between stops just less than and just greater than the function input."},"interval":{"doc":"Return the output value of the stop just less than the function input."},"categorical":{"doc":"Return the output value of the stop equal to the function input."}},"doc":"The interpolation strategy to use in function evaluation.","default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":{"doc":"Use the RGB color space to interpolate color values"},"lab":{"doc":"Use the LAB color space to interpolate color values."},"hcl":{"doc":"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},"doc":"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.","default":"rgb"},"default":{"type":"*","required":false,"doc":"A value to serve as a fallback function result when a value isn\'t otherwise available. It is used in the following circumstances:\\n* In categorical functions, when the feature value does not match any of the stop domain values.\\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\\nIf no default is provided, the style property\'s default is used in these circumstances."}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2,"doc":"Zoom level and value pair."},"expression":{"type":"array","value":"*","minimum":1,"doc":"An expression defines a function that can be used for data-driven style properties or feature filters."},"expression_name":{"doc":"","type":"enum","values":{"let":{"doc":"Binds expressions to named variables, which can then be referenced in the result expression using [\\"var\\", \\"variable_name\\"].","group":"Variable binding","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"var":{"doc":"References variable bound using \\"let\\".","group":"Variable binding","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"config":{"doc":"Retrieves the configuration value for the given option.","group":"Lookup","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"literal":{"doc":"Provides a literal array or object value.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"array":{"doc":"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"at":{"doc":"Retrieves an item from an array.","group":"Lookup","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"in":{"doc":"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).","group":"Lookup","sdk-support":{"basic functionality":{"js":"1.6.0","android":"9.1.0","ios":"5.8.0"}}},"index-of":{"doc":"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.","group":"Lookup","sdk-support":{"basic functionality":{"js":"1.10.0","android":"10.0.0","ios":"10.0.0"}}},"slice":{"doc":"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.","group":"Lookup","sdk-support":{"basic functionality":{"js":"1.10.0","android":"10.0.0","ios":"10.0.0"}}},"case":{"doc":"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"match":{"doc":"Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `[\\"get\\", \\"building_type\\"]`). Each label must be unique, and must be either:\\n - a single literal value; or\\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `[\\"c\\", \\"b\\"]`).\\n\\nThe input matches if any of the values in the array matches using strict equality, similar to the `\\"in\\"` operator.\\nIf the input type does not match the type of the labels, the result will be the fallback value.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"coalesce":{"doc":"Evaluates each expression in turn until the first valid value is obtained. Invalid values are `null` and [`\'image\'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"step":{"doc":"Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values (\\"stops\\"). The `input` may be any numeric expression (e.g., `[\\"get\\", \\"population\\"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.","group":"Ramps, scales, curves","sdk-support":{"basic functionality":{"js":"0.42.0","android":"6.0.0","ios":"4.0.0"}}},"interpolate":{"doc":"Produces continuous, smooth results by interpolating between pairs of input and output values (\\"stops\\"). The `input` may be any numeric expression (e.g., `[\\"get\\", \\"population\\"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array`, or `color`.\\n\\nInterpolation types:\\n- `[\\"linear\\"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\\n- `[\\"exponential\\", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\\n- `[\\"cubic-bezier\\", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.","group":"Ramps, scales, curves","sdk-support":{"basic functionality":{"js":"0.42.0","android":"6.0.0","ios":"4.0.0"}}},"interpolate-hcl":{"doc":"Produces continuous, smooth results by interpolating between pairs of input and output values (\\"stops\\"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.","group":"Ramps, scales, curves","sdk-support":{"basic functionality":{"js":"0.49.0"}}},"interpolate-lab":{"doc":"Produces continuous, smooth results by interpolating between pairs of input and output values (\\"stops\\"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.","group":"Ramps, scales, curves","sdk-support":{"basic functionality":{"js":"0.49.0"}}},"ln2":{"doc":"Returns mathematical constant ln(2).","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"pi":{"doc":"Returns the mathematical constant pi.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"e":{"doc":"Returns the mathematical constant e.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"typeof":{"doc":"Returns a string describing the type of the given value.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"string":{"doc":"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"number":{"doc":"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"boolean":{"doc":"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"object":{"doc":"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"collator":{"doc":"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.","group":"Types","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"format":{"doc":"Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\\n- `\\"text-font\\"`: Overrides the font stack specified by the root layout property.\\n- `\\"text-color\\"`: Overrides the color specified by the root paint property.\\n- `\\"font-scale\\"`: Applies a scaling factor on `text-size` as specified by the root layout property.","group":"Types","sdk-support":{"basic functionality":{"js":"0.48.0","android":"6.7.0","ios":"4.6.0"},"text-font":{"js":"0.48.0","android":"6.7.0","ios":"4.6.0"},"font-scale":{"js":"0.48.0","android":"6.7.0","ios":"4.6.0"},"text-color":{"js":"1.3.0","android":"7.3.0","ios":"4.10.0"},"image":{"js":"1.6.0","android":"8.6.0","ios":"5.7.0"}}},"image":{"doc":"Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`\'format\'`](#types-format) expression. A [`\'coalesce\'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `\'image\'` argument. To implement crossfading between two images within a symbol layer using the [`icon-image-cross-fade`](/mapbox-gl-js/style-spec/layers/#paint-symbol-icon-image-cross-fade) attribute, include a second image as the second argument in the `\'image\'` expression.","group":"Types","sdk-support":{"basic functionality":{"js":"1.4.0","android":"8.6.0","ios":"5.7.0"}}},"number-format":{"doc":"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `unit` argument specifies a [simple ECMAScript unit](https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier) to use for unit-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.","group":"Types","sdk-support":{"basic functionality":{"js":"0.54.0","android":"8.4.0","ios":"5.4.0"}}},"to-string":{"doc":"Converts the input value to a string. If the input is `null`, the result is `\\"\\"`. If the input is a [`boolean`](#types-boolean), the result is `\\"true\\"` or `\\"false\\"`. If the input is a number, it is converted to a string as specified by the [\\"NumberToString\\" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a [`color`](#color), it is converted to a string of the form `\\"rgba(r,g,b,a)\\"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. If the input is an [`\'image\'`](#types-image) expression, `\'to-string\'` returns the image name. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"to-number":{"doc":"Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the [\\"ToNumber Applied to the String Type\\" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"to-boolean":{"doc":"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"to-rgba":{"doc":"Returns a four-element array containing the input color\'s red, green, blue, and alpha components, in that order.","group":"Color","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"to-color":{"doc":"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"rgb":{"doc":"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.","group":"Color","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"rgba":{"doc":"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.","group":"Color","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"hsl":{"doc":"Creates a color value from hue (range 0-360), saturation and lightness components (range 0-100), and an alpha component of 1. If any component is out of range, the expression is an error.","group":"Color","sdk-support":{"basic functionality":{"js":"2.12.1","android":"10.11.0","ios":"10.11.0"}}},"hsla":{"doc":"Creates a color value from hue (range 0-360), saturation and lightness components (range 0-100), and an alpha component (range 0-1). If any component is out of range, the expression is an error.","group":"Color","sdk-support":{"basic functionality":{"js":"2.12.1","android":"10.11.0","ios":"10.11.0"}}},"get":{"doc":"Retrieves a property value from the current feature\'s properties, or from another object if a second argument is provided. Returns `null` if the requested property is missing.","group":"Lookup","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"has":{"doc":"Tests for the presence of an property value in the current feature\'s properties, or from another object if a second argument is provided.","group":"Lookup","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"length":{"doc":"Returns the length of an array or string.","group":"Lookup","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"properties":{"doc":"Returns the feature properties object. Note that in some cases, it may be more efficient to use `[\\"get\\", \\"property_name\\"]` directly.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"feature-state":{"doc":"Retrieves a property value from the current feature\'s state. Returns `null` if the requested property is not present on the feature\'s state. A feature\'s state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\\"feature-state\\"] can only be used with paint properties that support data-driven styling.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.46.0","android":"10.0.0","ios":"10.0.0"}}},"geometry-type":{"doc":"Returns the feature\'s geometry type: `Point`, `LineString` or `Polygon`. `Multi*` feature types return the singular forms.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"id":{"doc":"Returns the feature\'s id, if it has one.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"zoom":{"doc":"Returns the current zoom level. Note that in style layout and paint properties, [\\"zoom\\"] may only appear as the input to a top-level \\"step\\" or \\"interpolate\\" expression.","group":"Camera","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"pitch":{"doc":"Returns the current pitch in degrees. `[\\"pitch\\"]` may only be used in the `filter` expression for a `symbol` layer.","group":"Camera","sdk-support":{"basic functionality":{"js":"2.6.0","android":"10.9.0","ios":"10.9.0"}}},"distance-from-center":{"doc":"Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `[\\"distance-from-center\\"]` may only be used in the `filter` expression for a `symbol` layer.","group":"Camera","sdk-support":{"basic functionality":{"js":"2.6.0","android":"10.9.0","ios":"10.9.0"}}},"measure-light":{"doc":"Returns a requested property of the light configuration based on the supplied options. Currently the only supported option is `brightness` which returns the global brightness value of the lights on a scale of 0 to 1, where 0 means total darkness and 1 means full brightness. This expression works only with 3D light, i.e. when `lights` root property is defined.","group":"Lookup","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"heatmap-density":{"doc":"Returns the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.","group":"Heatmap","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"line-progress":{"doc":"Returns the progress along a gradient line. Can only be used in the `line-gradient` property.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.5.0","ios":"4.6.0"}}},"sky-radial-progress":{"doc":"Returns the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.","group":"sky","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}}},"accumulated":{"doc":"Returns the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.53.0","android":"8.4.0","ios":"5.5.0"}}},"+":{"doc":"Returns the sum of the inputs.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"*":{"doc":"Returns the product of the inputs.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"-":{"doc":"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"/":{"doc":"Returns the result of floating point division of the first input by the second.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"%":{"doc":"Returns the remainder after integer division of the first input by the second.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"^":{"doc":"Returns the result of raising the first input to the power specified by the second.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"sqrt":{"doc":"Returns the square root of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.42.0","android":"6.0.0","ios":"4.0.0"}}},"log10":{"doc":"Returns the base-ten logarithm of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"ln":{"doc":"Returns the natural logarithm of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"log2":{"doc":"Returns the base-two logarithm of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"sin":{"doc":"Returns the sine of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"cos":{"doc":"Returns the cosine of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"tan":{"doc":"Returns the tangent of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"asin":{"doc":"Returns the arcsine of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"acos":{"doc":"Returns the arccosine of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"atan":{"doc":"Returns the arctangent of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"min":{"doc":"Returns the minimum value of the inputs.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"max":{"doc":"Returns the maximum value of the inputs.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"round":{"doc":"Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `[\\"round\\", -1.5]` evaluates to -2.","group":"Math","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.0.0","ios":"4.0.0"}}},"abs":{"doc":"Returns the absolute value of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.0.0","ios":"4.0.0"}}},"ceil":{"doc":"Returns the smallest integer that is greater than or equal to the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.0.0","ios":"4.0.0"}}},"floor":{"doc":"Returns the largest integer that is less than or equal to the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.0.0","ios":"4.0.0"}}},"distance":{"doc":"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.","group":"Math","sdk-support":{"basic functionality":{"js":"3.0.0","android":"9.2.0","ios":"5.9.0"}}},"==":{"doc":"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"!=":{"doc":"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},">":{"doc":"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"<":{"doc":"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},">=":{"doc":"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"<=":{"doc":"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"all":{"doc":"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"any":{"doc":"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"!":{"doc":"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"within":{"doc":"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line\'s endpoint is on the boundary.","group":"Decision","sdk-support":{"basic functionality":{"js":"1.9.0","android":"9.1.0","ios":"5.8.0"}}},"is-supported-script":{"doc":"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).","group":"String","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.6.0","ios":"4.1.0"}}},"upcase":{"doc":"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.","group":"String","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"downcase":{"doc":"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.","group":"String","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"concat":{"doc":"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.","group":"String","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"resolved-locale":{"doc":"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.","group":"String","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"raster-value":{"doc":"Returns the raster value of a pixel computed via `raster-color-mix`. Can only be used in the `raster-color` property.","group":"Raster Colorization","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"raster-particle-speed":{"doc":"Returns the length of the particle velocity vector. Can only be used in the `raster-particle-color` property.","group":"Raster Particle Animation","sdk-support":{"basic functionality":{"js":"3.3.0","android":"","ios":""}}},"random":{"doc":"Returns a random value in the specified range (first two input numbers) based on a supplied seed (third input). The seed can be an expression or a constant number or string value.","group":"Math","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}}},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"doc":"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.","example":[0.5,10],"sdk-support":{"basic functionality":{"js":"2.3.0","android":"10.6.0","ios":"10.6.0"}}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"The color of the atmosphere region immediately below the horizon and within the `range` and above the horizon and within `horizon-blend`. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{"js":"2.3.0","android":"10.6.0","ios":"10.6.0"}}},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"The color of the atmosphere region above the horizon, `high-color` extends further above the horizon than the `color` property and its spread can be controlled with `horizon-blend`. The opacity can be set to `0` to remove the high atmosphere color contribution.","sdk-support":{"basic functionality":{"js":"2.9.0","android":"10.6.0","ios":"10.6.0"}}},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"The color of the region above the horizon and after the end of the `horizon-blend` contribution. The opacity can be set to `0` to have a transparent background.","sdk-support":{"basic functionality":{"js":"2.9.0","android":"10.6.0","ios":"10.6.0"}}},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"Horizon blend applies a smooth fade from the color of the atmosphere to the color of space. A value of zero leaves a sharp transition from atmosphere to space. Increasing the value blends the color of atmosphere into increasingly high angles of the sky.","sdk-support":{"basic functionality":{"js":"2.3.0","android":"10.6.0","ios":"10.6.0"}}},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"A value controlling the star intensity where `0` will show no stars and `1` will show stars at their maximum intensity.","sdk-support":{"basic functionality":{"js":"2.9.0","android":"10.6.0","ios":"10.6.0"}}},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"doc":"An array of two number values, specifying the vertical range, measured in meters, over which the fog should gradually fade out. When both parameters are set to zero, the fog will be rendered without any vertical constraints.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}},"camera":{"camera-projection":{"doc":"Camera projection describes how 3D world geometry get projected into 2D screen","type":"enum","values":{"perspective":{"doc":"linear projection where distant objects appear smaller than closer objects. Lines that are parallel seem to converge towards a vanishing point"},"orthographic":{"doc":"Projection where objects are of the same scale regardless of whether they are far away or near to the camera. Parallel lines remains parallel and there is no vanishing point."}},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"default":"perspective","property-type":"data-constant"}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{"doc":"The position of the light source is aligned to the rotation of the map."},"viewport":{"doc":"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"doc":"Whether extruded geometries are lit relative to the map or viewport.","example":"map","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).","example":[1.5,90,80],"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}}},"projection":{"name":{"type":"enum","values":{"albers":{"doc":"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},"equalEarth":{"doc":"An Equal Earth projection."},"equirectangular":{"doc":"An Equirectangular projection. This projection is very similar to the Plate Carrée projection."},"lambertConformalConic":{"doc":"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},"mercator":{"doc":"The Mercator projection is the default projection."},"naturalEarth":{"doc":"A Natural Earth projection."},"winkelTripel":{"doc":"A Winkel Tripel projection."},"globe":{"doc":"A globe projection."}},"default":"mercator","doc":"The name of the projection to be used for rendering the map.","required":true,"sdk-support":{"basic functionality":{"js":"2.6.0","ios":"10.5.0","android":"10.5.0"}}},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"doc":"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].","example":[-96,37.5],"requires":[{"name":["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{"js":"2.6.0"}}},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"doc":"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).","example":[29.5,45.5],"requires":[{"name":["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{"js":"2.6.0"}}}},"terrain":{"source":{"type":"string","doc":"Name of a source of `raster_dem` type to be used for terrain elevation.","required":true,"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}}},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.","requires":["source"],"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}}}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"doc":"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.","transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.21.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","doc":"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color\'s opacity will not affect the opacity of the 1px stroke, if it is used.","transition":true,"requires":[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.19.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","doc":"The outline color of the fill. Matches the value of `fill-color` if unspecified.","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.19.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{"doc":"The fill is translated relative to the map."},"viewport":{"doc":"The fill is translated relative to the viewport."}},"doc":"Controls the frame of reference for `fill-translate`.","default":"map","requires":["fill-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":false,"doc":"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.49.0","android":"6.5.0","ios":"4.4.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.","transition":true,"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","doc":"The base color of the extruded fill. The extrusion\'s surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"data-driven styling":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"The geometry\'s offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{"doc":"The fill extrusion is translated relative to the map."},"viewport":{"doc":"The fill extrusion is translated relative to the viewport."}},"doc":"Controls the frame of reference for `fill-extrusion-translate`.","default":"map","requires":["fill-extrusion-translate"],"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"doc":"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"data-driven styling":{"js":"0.49.0","android":"6.5.0","ios":"4.4.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","doc":"The height with which to extrude this layer.","transition":true,"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"data-driven styling":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","doc":"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.","transition":true,"requires":["fill-extrusion-height"],"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"data-driven styling":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"doc":"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.","transition":false,"sdk-support":{"basic functionality":{"js":"0.50.0","android":"7.0.0","ios":"4.7.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Controls the intensity of shading near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.7.0","ios":"10.7.0"}}},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings. This property works only with legacy light. When 3D lights are enabled `fill-extrusion-ambient-occlusion-wall-radius` and `fill-extrusion-ambient-occlusion-ground-radius` are used instead.","requires":["fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.7.0","ios":"10.7.0"}}},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings.","requires":["lights","fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"The extent of the ambient occlusion effect on the ground beneath the extruded buildings in meters.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant","type":"number","default":0.69,"minimum":0,"maximum":1,"doc":"Provides a control to futher fine-tune the look of the ambient occlusion on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-color":{"property-type":"data-constant","type":"color","default":"#ffffff","doc":"The color of the flood light effect on the walls of the extruded buildings.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant","type":"number","default":0,"minimum":0,"maximum":1,"doc":"The intensity of the flood light color.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","units":"meters","default":0,"minimum":0,"doc":"The extent of the flood light effect on the walls of the extruded buildings in meters.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","units":"meters","default":0,"doc":"The extent of the flood light effect on the ground beneath the extruded buildings in meters.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant","type":"number","default":0.69,"minimum":0,"maximum":1,"doc":"Provides a control to futher fine-tune the look of the flood light on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-vertical-scale":{"property-type":"data-constant","type":"number","default":1,"minimum":0,"doc":"A global multiplier that can be used to scale base, height, AO, and flood light of the fill extrusions.","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-rounded-roof":{"property-type":"data-constant","type":"boolean","default":true,"doc":"Indicates whether top edges should be rounded when fill-extrusion-edge-radius has a value greater than 0. If false, rounded edges are only applied to the sides. Default is true.","requires":["fill-extrusion-edge-radius"],"transition":false,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.10.0","ios":"10.10.0"}},"expression":{"interpolated":false,"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"doc":"This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. Fade out is implemented by scaling down and removing buildings in the fade range in a staggered fashion. Opacity is not changed. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map\'s height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.","transition":false,"expression":{"interpolated":false},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","doc":"The opacity at which the line will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","doc":"The color with which the line will be drawn.","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.23.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{"doc":"The line is translated relative to the map."},"viewport":{"doc":"The line is translated relative to the viewport."}},"doc":"Controls the frame of reference for `line-translate`.","default":"map","requires":["line-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","doc":"Stroke thickness.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"doc":"Draws a line casing outside of a line\'s actual path. Value indicates the width of the inner gap.","transition":true,"units":"pixels","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"doc":"The line\'s offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.","transition":true,"units":"pixels","sdk-support":{"basic functionality":{"js":"0.12.1","android":"3.0.0","ios":"3.1.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","doc":"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won\'t render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"2.3.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"doc":"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.49.0","android":"6.5.0","ios":"4.4.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","doc":"A gradient used to color a line feature at various distances along its length. Defined using a `step` or `interpolate` expression which outputs a color for each corresponding `line-progress` input value. `line-progress` is a percentage of the line feature\'s total length as measured on the webmercator projected coordinate plane (a `number` between `0` and `1`). Can only be used with GeoJSON sources that specify `\\"lineMetrics\\": true`.","example":["interpolate",["linear"],["line-progress"],0,"blue",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.5.0","ios":"4.4.0"},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","doc":"The line part between [trim-start, trim-end] will be marked as transparent to make a route vanishing effect. The line trim-off offset is based on the whole line range [0.0, 1.0].","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"sdk-support":{"basic functionality":{"js":"2.9.0","android":"10.5.0","ios":"10.5.0"}},"property-type":"constant"},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{"type":"number","private":true,"doc":"The width of the line border. A value of zero means no border.","default":0,"minimum":0,"transition":true,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.9.0","ios":"10.9.0"},"data-driven styling":{"js":"3.0.0","android":"10.9.0","ios":"10.9.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","private":true,"doc":"The color of the line border. If line-border-width is greater than zero and the alpha value of this color is 0 (default), the color for the border will be selected automatically based on the line color.","default":"rgba(0, 0, 0, 0)","transition":true,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.9.0","ios":"10.9.0"},"data-driven styling":{"js":"3.0.0","android":"10.9.0","ios":"10.9.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","doc":"Circle radius.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.18.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","doc":"The fill color of the circle.","transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.18.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"doc":"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.","transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.20.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","doc":"The opacity at which the circle will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.20.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{"doc":"The circle is translated relative to the map."},"viewport":{"doc":"The circle is translated relative to the viewport."}},"doc":"Controls the frame of reference for `circle-translate`.","default":"map","requires":["circle-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{"doc":"Circles are scaled according to their apparent distance to the camera."},"viewport":{"doc":"Circles are not scaled."}},"default":"map","doc":"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{"js":"0.21.0","android":"4.2.0","ios":"3.4.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{"doc":"The circle is aligned to the plane of the map."},"viewport":{"doc":"The circle is aligned to the plane of the viewport."}},"default":"viewport","doc":"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"The width of the circle\'s stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","doc":"The stroke color of the circle.","transition":true,"sdk-support":{"basic functionality":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","doc":"The opacity of the circle\'s stroke.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","doc":"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"data-driven styling":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"doc":"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"data-driven styling":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"doc":"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"doc":"Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `[\\"heatmap-density\\"]` as input.","transition":false,"sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","doc":"The global opacity at which the heatmap layer will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"doc":"The opacity at which the icon will be drawn.","type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"doc":"The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"doc":"The color of the icon\'s halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"Distance of halo to the icon outline.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"Fade out the halo towards the outside.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"Distance that the icon\'s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{"doc":"Icons are translated relative to the map."},"viewport":{"doc":"Icons are translated relative to the viewport."}},"doc":"Controls the frame of reference for `icon-translate`.","default":"map","requires":["icon-image","icon-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"doc":"Controls the transition progress between the image variants of icon-image. Zero means the first variant is used, one is the second, and in between they are blended together.","transition":true},"text-opacity":{"type":"number","doc":"The opacity at which the text will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","doc":"The color with which the text will be drawn.","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"doc":"The color of the text\'s halo, which helps it stand out from backgrounds.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"The halo\'s fadeout distance towards the outside.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"Distance that the text\'s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{"doc":"The text is translated relative to the map."},"viewport":{"doc":"The text is translated relative to the viewport."}},"doc":"Controls the frame of reference for `text-translate`.","default":"map","requires":["text-field","text-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"units":"intensity","doc":"Controls saturation level of the symbol icon. With the default value of 1 the icon color is preserved while with a value of 0 it is fully desaturated and looks black and white.","sdk-support":{"basic functionality":{"js":"3.1.0","android":"11.1.0","ios":"11.1.0"}},"expression":{"interpolated":false},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","doc":"The opacity at which the image will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-color":{"type":"color","doc":"Defines a color map by which to colorize a raster layer, parameterized by the `[\\"raster-value\\"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `raster-color-range`.","transition":false,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","property-type":"data-constant","transition":true,"requires":["raster-color"],"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"When `raster-color` is active, specifies the combination of source RGB channels used to compute the raster value. Computed using the equation `mix.r * src.r + mix.g * src.g + mix.b * src.b + mix.a`. The first three components specify the mix of source red, green, and blue channels, respectively. The fourth component serves as a constant offset and is *not* multipled by source alpha. Source alpha is instead carried through and applied as opacity to the colorized result. Default value corresponds to RGB luminosity.","example":[0.2126,0.7152,0.0722,0],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"raster-color-range":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":true,"requires":["raster-color"],"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"When `raster-color` is active, specifies the range over which `raster-color` is tabulated. Units correspond to the computed raster value via `raster-color-mix`. For `rasterarray` sources, if `raster-color-range` is unspecified, the source\'s stated data range is used.","example":[0.5,10],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","doc":"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","doc":"Increase or reduce the brightness of the image. The value is the minimum brightness.","default":0,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","doc":"Increase or reduce the brightness of the image. The value is the maximum brightness.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","doc":"Increase or reduce the saturation of the image.","default":0,"minimum":-1,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","doc":"Increase or reduce the contrast of the image.","default":0,"minimum":-1,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","doc":"The resampling/interpolation method to use for overscaling, also known as texture magnification filter","values":{"linear":{"doc":"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},"nearest":{"doc":"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},"default":"linear","sdk-support":{"basic functionality":{"js":"0.47.0","android":"6.3.0","ios":"4.2.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","doc":"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{"type":"string","required":false,"property-type":"data-constant","transition":false,"requires":[{"source":"raster-array"}],"doc":"Displayed band of raster array source layer. Defaults to the first band if not set.","example":"band-name","sdk-support":{"basic functionality":{"js":"3.1.0","android":"11.1.0","ios":"11.1.0"}}},"raster-elevation":{"type":"number","doc":"Specifies an uniform elevation from the ground, in meters.","default":0,"minimum":0,"transition":true,"sdk-support":{"basic functionality":{"js":"3.1.0","android":"11.2.0","ios":"11.2.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string","required":false,"property-type":"data-constant","transition":false,"doc":"Displayed band of raster array source layer","example":"band-name","sdk-support":{"basic functionality":{"js":"","android":"","ios":""}}},"raster-particle-count":{"type":"number","doc":"Defines the amount of particles per tile.","default":512,"minimum":1,"transition":false,"sdk-support":{"basic functionality":{"js":"","android":"","ios":""}},"property-type":"data-constant"},"raster-particle-color":{"type":"color","doc":"Defines a color map by which to colorize a raster particle layer, parameterized by the `[\\"raster-particle-speed\\"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `raster-particle-max-speed`.","transition":false,"sdk-support":{"basic functionality":{"js":"","android":"","ios":""},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["raster-particle-speed"]},"property-type":"color-ramp"},"raster-particle-max-speed":{"type":"number","doc":"Defines the maximum speed for particles. Velocities with magnitudes equal to or exceeding this value are clamped to the max value.","default":1,"minimum":1,"transition":false,"sdk-support":{"basic functionality":{"js":"","android":"","ios":""}},"property-type":"data-constant"},"raster-particle-speed-factor":{"type":"number","doc":"Defines a coefficient for the speed of particles’ motion.","default":0.2,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"","android":"","ios":""}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-fade-opacity-factor":{"type":"number","doc":"Defines defines the opacity coefficient applied to the faded particles in each frame. In practice, this property controls the length of the particle tail.","default":0.98,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"","android":"","ios":""}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-reset-rate-factor":{"type":"number","doc":"Defines a coefficient for a time period at which particles will restart at a random position, to avoid degeneration (empty areas without particles).","default":0.8,"minimum":0,"maximum":1,"transition":false,"sdk-support":{"basic functionality":{"js":"","android":"","ios":""}},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"doc":"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map` and no 3d lights enabled. If `hillshade-illumination-anchor` is set to `map` and 3d lights enabled, the direction from 3d lights is used instead.","transition":false,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{"doc":"The hillshade illumination is relative to the north direction."},"viewport":{"doc":"The hillshade illumination is relative to the top of the viewport."}},"default":"viewport","doc":"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","doc":"Intensity of the hillshade","default":0.5,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","doc":"The shading color of areas that face away from the light source.","transition":true,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","doc":"The shading color of areas that faces towards the light source.","transition":true,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","doc":"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.","transition":true,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","doc":"The color with which the background will be drawn.","transition":true,"requires":[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"doc":"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity at which the background will be drawn.","transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{"doc":"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},"atmosphere":{"doc":"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},"default":"atmosphere","doc":"The type of the sky","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"doc":"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"doc":"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"doc":"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"doc":"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"doc":"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.","transition":false,"requires":[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","doc":"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.","transition":false,"requires":[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","doc":"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.","transition":false,"requires":[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity of the entire sky layer.","transition":true,"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity of the model layer.","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"units":"degrees","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true,"doc":"The rotation of the model in euler angles [lon, lat, z]."},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"doc":"The scale of the model. Expressions that are zoom-dependent are not supported if using GeoJSON or vector tile as the model layer source.","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true,"doc":"The translation of the model in meters in form of [longitudal, latitudal, altitude] offsets."},"model-color":{"type":"color","default":"#ffffff","doc":"The tint color of the model layer. model-color-mix-intensity (defaults to 0) defines tint(mix) intensity - this means that, this color is not used unless model-color-mix-intensity gets value greater than 0. Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source.","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"doc":"Intensity of model-color (on a scale from 0 to 1) in color mix with original 3D model\'s colors. Higher number will present a higher model-color contribution in mix. Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source.","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-type":{"type":"enum","values":{"common-3d":{"doc":"Integrated to 3D scene, using depth testing, along with terrain, fill-extrusions and custom layer."},"location-indicator":{"doc":"Displayed over other 3D content, occluded by terrain."}},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"default":"common-3d","doc":"Defines rendering behavior of model in respect to other 3D scene objects.","property-type":"data-constant"},"model-cast-shadows":{"type":"boolean","default":true,"doc":"Enable/Disable shadow casting for this layer","transition":false,"expression":{"interpolated":false},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"},"model-receive-shadows":{"type":"boolean","default":true,"doc":"Enable/Disable shadow receiving for this layer","transition":false,"expression":{"interpolated":false},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"Intensity of the ambient occlusion if present in the 3D model.","expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant","transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"units":"intensity","doc":"Strength of the emission. There is no emission for value 0. For value 1.0, only emissive component (no shading) is displayed and values above 1.0 produce light contribution to surrounding area, for some of the parts (e.g. doors). Expressions that depend on measure-light are only supported as a global layer value (and not for each feature) when using GeoJSON or vector tile as the model layer source.","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"Material roughness. Material is fully smooth for value 0, and fully rough for value 1. Affects only layers using batched-model source.","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","doc":"Emissive strength multiplier along model height (gradient begin, gradient end, value at begin, value at end, gradient curve power (logarithmic scale, curve power = pow(10, val)).","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"doc":"This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. The automatic cutoff range is calculated according to the minimum required zoom level of the source and layer. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map\'s height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.","transition":false,"expression":{"interpolated":false},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"}},"transition":{"duration":{"type":"number","default":300,"minimum":0,"units":"milliseconds","doc":"Time allotted for transitions to complete."},"delay":{"type":"number","default":0,"minimum":0,"units":"milliseconds","doc":"Length of time before a transition begins."}},"property-type":{"data-driven":{"type":"property-type","doc":"Property is interpolable and can be represented using a property expression."},"color-ramp":{"type":"property-type","doc":"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{"type":"property-type","doc":"Property is interpolable but cannot be represented using a property expression."},"constant":{"type":"property-type","doc":"Property is constant across all zoom levels and property values."}},"promoteId":{"*":{"type":"string","doc":"A name of a feature property to use as ID for feature state."}}}');function ZMt(t){"@babel/helpers - typeof";return(ZMt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $Mt(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,r=Array.isArray(t)&&t.filter(function(t){return t.metaData.tileType===e.tileType||xPt(t.metaData.prjCoordSys)===xPt(e.prjCoordSys)});return r&&r[0]&&r[0].metaData}function SPt(t,e){var r=t.scale,n=t.dpi,i=t.coordUnit,o=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:22,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:512,n=[],i=Math.abs(t.left-t.right)/r,o=0;oMath.abs(t-e[i])&&(r=Math.abs(t-e[i]),n=i);return n}(Of(r,n,i),o)}function EPt(t){"@babel/helpers - typeof";return(EPt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function CPt(){CPt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new O(n||[]);return i(a,"_invoke",{value:C(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",g={};function v(){}function m(){}function b(){}var A={};l(A,a,function(){return this});var x=Object.getPrototypeOf,w=x&&x(x(M([])));w&&w!==r&&n.call(w,a)&&(A=w);var _=b.prototype=v.prototype=Object.create(A);function S(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function E(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==EPt(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function C(e,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function kPt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function IPt(t){for(var e=1;e=1&&(this.beforeLayerId=t.getStyle().layers[0].id),t.addLayer({id:this.id,type:"raster",source:this.id},this.beforeLayerId),this.map.fitBounds([e[1],e[3]]),this._afterAddVideoLayer()}}},{key:"_afterAddVideoLayer",value:function(){this.autoplay&&this.map.getSource(this.id).play(),this.fire("loaded",{originCoordsRightBottom:this.originCoordsRightBottom,originCoordsLeftTop:this.originCoordsLeftTop,videoWidth:this.videoWidth,videoHeight:this.videoHeight})}},{key:"_calcCoords",value:function(t){var e=this,r=t.width,n=t.height,i=t.videoHeight,o=t.videoWidth||this.videoWidth,a=i||this.videoHeight,s=o/r,u=a/n,l=Math.min(s,u),c=r/2,f=n/2,h=o/l/2,p=a/l/2,d=[[c-h,f-p],[c+h,f-p],[c+h,f+p],[c-h,f+p]].map(function(t){return e.map.unproject(t)});return this.originCoordsLeftTop=d[0],this.originCoordsRightBottom=d[2],d}},{key:"play",value:function(){this.video.play()}},{key:"pause",value:function(){this.video.pause()}},{key:"remove",value:function(){this.id&&(this.map.removeLayer(this.id),this.map.removeSource(this.id),document.body.removeChild(document.getElementById(this.id)))}}])&&FPt(r.prototype,n),i&&FPt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function QPt(t){return function(t){if(Array.isArray(t))return YPt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return YPt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return YPt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function YPt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function oLt(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function aLt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function sLt(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},r=new bPt(I9,t,e);return r.getMapInfo((n=MPt(CPt().mark(function n(i,o,a){var s,u,l,c,f,h;return CPt().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,"processCompleted"!==i.type){n.next=15;break}if(s=i.result,u=s.dynamicProjection,l=s.prjCoordSys,c=l.epsgCode,!APt(l.type)){n.next=6;break}return a(new Error("mapbox-gl cannot support plane coordinate system.")),n.abrupt("return");case 6:if(3857===c||u||I().CRS){n.next=9;break}return a(new Error("The EPSG code ".concat(c," needs to include mapbox-gl-enhance.js. Refer to the example: https://iclient.supermap.io/examples/mapboxgl/editor.html#mvtVectorTile_2362"))),n.abrupt("return");case 9:return n.next=11,RPt(t,i.result,IPt(IPt({},e),{},{initMapService:r}));case 11:return f=n.sent,(h=new(I().Map)(f)).loaded()?o({map:h}):h.on("load",function(){o({map:h})}),n.abrupt("return");case 15:a(new Error("Fetch mapService is failed.")),n.next=21;break;case 18:n.prev=18,n.t0=n.catch(0),a(n.t0);case 21:case"end":return n.stop()}},n,null,[[0,18]])})),function(t,e,r){return n.apply(this,arguments)}));var n},I().supermap.Graphic=RJ,I().supermap.map.getDefaultVectorTileStyle=function(t,e){e=e||{};var r={};r.version=e.version||8,r.layers=e.layers||[],r.light=e.light||{anchor:"viewport",color:"#fcf6ef",intensity:.5,position:[1.15,201,20]};var n={version:r.version,sources:{"vector-tiles":{type:"vector",tiles:[t]}},layers:r.layers,light:r.light};return null!=e.sprite&&(n.sprite=e.sprite),null!=e.glyphs&&(n.glyphs=e.glyphs),n},I().supermap.map.setBackground=function(t,e){e&&t&&t.addLayer({id:"background",type:"background",paint:{"background-color":e}},"background")},I().supermap.map.setPaintProperty=function(t,e,r,n,i,o){if(e&&t){"[object Array]"!==Object.prototype.toString.call(e)&&(e=[e]);for(var a=0;at.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function y(t,e,r){return(e=I(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function g(){return(g="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=v(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(null,arguments)}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function m(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&E(t,e)}function b(t,e,r,n){r&&Object.defineProperty(t,e,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(n):void 0})}function A(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(A=function(){return!!t})()}function x(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function w(t){for(var e=1;e=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;O(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function E(t,e){return(E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function C(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||O(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||O(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(t){var e=function(t,e){if("object"!=f(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==f(e)?e:e+""}function T(t){return(T="function"==typeof Symbol&&"symbol"==f(Symbol.iterator)?function(t){return f(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":f(t)})(t)}function O(t,e){if(t){if("string"==typeof t)return i(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}function M(t){var e="function"==typeof Map?new Map:void 0;return(M=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return function(t,e,r){if(A())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&E(i,r.prototype),i}(t,arguments,v(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),E(r,t)})(t)}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var P,L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{};function N(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function j(t,e){return t(e={exports:{}},e.exports),e.exports}!function(t){!function(e){var r="object"==f(L)?L:"object"==("undefined"==typeof self?"undefined":f(self))?self:"object"==f(this)?this:Function("return this;")(),n=i(t);function i(t,e){return function(r,n){"function"!=typeof t[r]&&Object.defineProperty(t,r,{configurable:!0,writable:!0,value:n}),e&&e(r,n)}}void 0===r.Reflect?r.Reflect=t:n=i(r.Reflect,n),function(t){var e=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,n=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,u={create:o?function(){return P(Object.create(null))}:a?function(){return P({__proto__:null})}:function(){return P({})},has:s?function(t,r){return e.call(t,r)}:function(t,e){return e in t},get:s?function(t,r){return e.call(t,r)?t[r]:void 0}:function(t,e){return t[e]}},l=Object.getPrototypeOf(Function),c="object"==("undefined"==typeof process?"undefined":f(process))&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,h=c||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],r=function(){function t(t,e,r){this._index=0,this._keys=t,this._values=e,this._selector=r}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var r=this._find(t,!0);return this._values[r]=e,this},e.prototype.delete=function(e){var r=this._find(e,!1);if(r>=0){for(var n=this._keys.length,i=r+1;i=0;--r){var n=(0,t[r])(e);if(!x(n)&&!w(n)){if(!k(n))throw new TypeError;e=n}}return e}(t,e)}if(!E(t))throw new TypeError;if(!_(e))throw new TypeError;if(!_(n)&&!x(n)&&!w(n))throw new TypeError;return w(n)&&(n=void 0),function(t,e,r,n){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,r,n);if(!x(o)&&!w(o)){if(!_(o))throw new TypeError;n=o}}return n}(t,e,r=S(r),n)}),t("metadata",function(t,e){return function(r,n){if(!_(r))throw new TypeError;if(!x(n)&&!function(t){switch(A(n)){case 3:case 4:return!0;default:return!1}}())throw new TypeError;m(t,e,r,n)}}),t("defineMetadata",function(t,e,r,n){if(!_(r))throw new TypeError;return x(n)||(n=S(n)),m(t,e,r,n)}),t("hasMetadata",function(t,e,r){if(!_(e))throw new TypeError;return x(r)||(r=S(r)),function t(e,r,n){if(g(e,r,n))return!0;var i=M(r);return!w(i)&&t(e,i,n)}(t,e,r)}),t("hasOwnMetadata",function(t,e,r){if(!_(e))throw new TypeError;return x(r)||(r=S(r)),g(t,e,r)}),t("getMetadata",function(t,e,r){if(!_(e))throw new TypeError;return x(r)||(r=S(r)),function t(e,r,n){if(g(e,r,n))return v(e,r,n);var i=M(r);return w(i)?void 0:t(e,i,n)}(t,e,r)}),t("getOwnMetadata",function(t,e,r){if(!_(e))throw new TypeError;return x(r)||(r=S(r)),v(t,e,r)}),t("getMetadataKeys",function(t,e){if(!_(t))throw new TypeError;return x(e)||(e=S(e)),function t(e,r){var n=b(e,r),i=M(e);if(null===i)return n;var o=t(i,r);if(o.length<=0)return n;if(n.length<=0)return o;for(var a=new p,s=[],u=0,l=n;u0)return!0;var i=d.get(e);return i.delete(r),i.size>0||d.delete(e),!0})}(n)}()}(P||(P={}));var R=j(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,n,i,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new function(t,e,r){this.fn=t,this.context=e,this.once=r||!1}(n,i||t,o),s=r?r+e:e;return t._events[s]?t._events[s].fn?t._events[s]=[t._events[s],a]:t._events[s].push(a):(t._events[s]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,a=new Array(o);i= than the number of constructor arguments of its base class."},e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",e.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class",e.POST_CONSTRUCT_ERROR=function(){for(var t=[],e=0;e0,p=f.length>n.length,d=function(t,e,r,n,o){for(var a=[],s=0;s0?u:t(e,i)}return 0}});N(tt),tt.getFunctionName,tt.getBaseClassDependencyCount,tt.getDependencies;var et=j(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var r=function(){function t(t,e,r,n,i){this.id=z.id(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=r,this.target=i,this.childRequests=[],this.bindings=Array.isArray(n)?n:[n],this.requestScope=null===r?new Map:null}return t.prototype.addChildRequest=function(e,r,n){var i=new t(e,this.parentContext,this,r,n);return this.childRequests.push(i),i},t}();e.Request=r});N(et),et.Request;var rt=j(function(t,e){function r(t){return t._bindingDictionary}function n(t,e,r,n,o){var a,s=i(r.container,o.serviceIdentifier);return s.length===V.BindingCount.NoBindingsAvailable&&r.container.options.autoBindInjectable&&"function"==typeof o.serviceIdentifier&&t.getConstructorMetadata(o.serviceIdentifier).compilerGeneratedMetadata&&(r.container.bind(o.serviceIdentifier).toSelf(),s=i(r.container,o.serviceIdentifier)),a=e?s:s.filter(function(t){var e=new et.Request(t.serviceIdentifier,r,n,t,o);return t.constraint(e)}),function(t,e,r,n){switch(e.length){case V.BindingCount.NoBindingsAvailable:if(r.isOptional())return e;var o=Y.getServiceIdentifierAsString(t),a=U.NOT_REGISTERED;throw a+=Y.listMetadataForTarget(o,r),a+=Y.listRegisteredBindingsForServiceIdentifier(n,o,i),new Error(a);case V.BindingCount.OnlyOneBindingAvailable:if(!r.isArray())return e;case V.BindingCount.MultipleBindingsAvailable:default:if(r.isArray())return e;throw o=Y.getServiceIdentifierAsString(t),a=U.AMBIGUOUS_MATCH+" "+o,a+=Y.listRegisteredBindingsForServiceIdentifier(n,o,i),new Error(a)}}(o.serviceIdentifier,a,o,r.container),a}function i(t,e){var n=[],o=r(t);return o.hasKey(e)?n=o.get(e):null!==t.parent&&(n=i(t.parent,e)),n}Object.defineProperty(e,"__esModule",{value:!0}),e.getBindingDictionary=e.createMockRequest=e.plan=void 0,e.getBindingDictionary=r,e.plan=function(t,e,r,i,o,a,s,u){void 0===u&&(u=!1);var l=new W.Context(e),c=function(t,e,r,n,i,o){var a=t?B.MULTI_INJECT_TAG:B.INJECT_TAG,s=new q.Metadata(a,r),u=new $.Target(e,n,r,s);if(void 0!==i){var l=new q.Metadata(i,o);u.metadata.push(l)}return u}(r,i,o,"",a,s);try{return function t(e,r,i,o,a,s){var u,l;if(null===a){u=n(e,r,o,null,s),l=new et.Request(i,o,null,u,s);var c=new X.Plan(o,l);o.addPlan(c)}else u=n(e,r,o,a,s),l=a.addChildRequest(s.serviceIdentifier,u,s);u.forEach(function(r){var n=null;if(s.isArray())n=l.addChildRequest(r.serviceIdentifier,r,s);else{if(r.cache)return;n=l}if(r.type===F.BindingTypeEnum.Instance&&null!==r.implementationType){var i=tt.getDependencies(e,r.implementationType);if(!o.container.options.skipBaseClassChecks){var a=tt.getBaseClassDependencyCount(e,r.implementationType);if(i.length0?(o=e.filter(function(t){return null!==t.target&&t.target.type===F.TargetTypeEnum.ConstructorArgument}).map(n),a=function(t,e,r){var n=e.filter(function(t){return null!==t.target&&t.target.type===F.TargetTypeEnum.ClassProperty}),i=n.map(r);return n.forEach(function(e,r){var n;n=e.target.name.value();var o=i[r];t[n]=o}),t}(a=new((i=t).bind.apply(i,r([void 0],o))),e,n)):a=new t;return function(t,e){if(Reflect.hasMetadata(B.POST_CONSTRUCT,t)){var r=Reflect.getMetadata(B.POST_CONSTRUCT,t);try{e[r.value]()}catch(e){throw new Error(U.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,a),a}});N(nt),nt.resolveInstance;var it=j(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.resolve=void 0;var r=function t(e,r,n){try{return n()}catch(t){throw Q.isStackOverflowExeption(t)?new Error(U.CIRCULAR_DEPENDENCY_IN_FACTORY(e,r.toString())):t}};e.resolve=function(t){return function t(e){return function(n){n.parentContext.setCurrentRequest(n);var i=n.bindings,o=n.childRequests,a=n.target&&n.target.isArray(),s=!(n.parentRequest&&n.parentRequest.target&&n.target&&n.parentRequest.target.matchesArray(n.target.serviceIdentifier));if(a&&s)return o.map(function(r){return t(e)(r)});var u=null;if(!n.target.isOptional()||0!==i.length){var l=i[0],c=l.scope===F.BindingScopeEnum.Singleton,f=l.scope===F.BindingScopeEnum.Request;if(c&&l.activated)return l.cache;if(f&&null!==e&&e.has(l.id))return e.get(l.id);if(l.type===F.BindingTypeEnum.ConstantValue)u=l.cache,l.activated=!0;else if(l.type===F.BindingTypeEnum.Function)u=l.cache,l.activated=!0;else if(l.type===F.BindingTypeEnum.Constructor)u=l.implementationType;else if(l.type===F.BindingTypeEnum.DynamicValue&&null!==l.dynamicValue)u=r("toDynamicValue",l.serviceIdentifier,function(){return l.dynamicValue(n.parentContext)});else if(l.type===F.BindingTypeEnum.Factory&&null!==l.factory)u=r("toFactory",l.serviceIdentifier,function(){return l.factory(n.parentContext)});else if(l.type===F.BindingTypeEnum.Provider&&null!==l.provider)u=r("toProvider",l.serviceIdentifier,function(){return l.provider(n.parentContext)});else{if(l.type!==F.BindingTypeEnum.Instance||null===l.implementationType){var h=Y.getServiceIdentifierAsString(n.serviceIdentifier);throw new Error(U.INVALID_BINDING_TYPE+" "+h)}u=nt.resolveInstance(l.implementationType,o,t(e))}return"function"==typeof l.onActivation&&(u=l.onActivation(n.parentContext,u)),c&&(l.cache=u,l.activated=!0),f&&null!==e&&!e.has(l.id)&&e.set(l.id,u),u}}}(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}});N(it),it.resolve;var ot=j(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=void 0;e.traverseAncerstors=function t(e,r){var n=e.parentRequest;return null!==n&&(!!r(n)||t(n,r))};var r=function(t){return function(e){var r=function(r){return null!==r&&null!==r.target&&r.target.matchesTag(t)(e)};return r.metaData=new q.Metadata(t,e),r}};e.taggedConstraint=r;var n=r(B.NAMED_TAG);e.namedConstraint=n,e.typeConstraint=function(t){return function(e){var r=null;if(null!==e){if(r=e.bindings[0],"string"==typeof t)return r.serviceIdentifier===t;var n=e.bindings[0].implementationType;return t===n}return!1}}});N(ot),ot.typeConstraint,ot.namedConstraint,ot.taggedConstraint,ot.traverseAncerstors;var at=j(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenSyntax=void 0;var r=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new st.BindingOnSyntax(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=ot.namedConstraint(t),new st.BindingOnSyntax(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t.target&&!t.target.isNamed()&&!t.target.isTagged()},new st.BindingOnSyntax(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=ot.taggedConstraint(t)(e),new st.BindingOnSyntax(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return ot.typeConstraint(t)(e.parentRequest)},new st.BindingOnSyntax(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return ot.namedConstraint(t)(e.parentRequest)},new st.BindingOnSyntax(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(r){return ot.taggedConstraint(t)(e)(r.parentRequest)},new st.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return ot.traverseAncerstors(e,ot.typeConstraint(t))},new st.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return!ot.traverseAncerstors(e,ot.typeConstraint(t))},new st.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return ot.traverseAncerstors(e,ot.namedConstraint(t))},new st.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return!ot.traverseAncerstors(e,ot.namedConstraint(t))},new st.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(r){return ot.traverseAncerstors(r,ot.taggedConstraint(t)(e))},new st.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(r){return!ot.traverseAncerstors(r,ot.taggedConstraint(t)(e))},new st.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return ot.traverseAncerstors(e,t)},new st.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return!ot.traverseAncerstors(e,t)},new st.BindingOnSyntax(this._binding)},t}();e.BindingWhenSyntax=r});N(at),at.BindingWhenSyntax;var st=j(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingOnSyntax=void 0;var r=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new at.BindingWhenSyntax(this._binding)},t}();e.BindingOnSyntax=r});N(st),st.BindingOnSyntax;var ut=j(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenOnSyntax=void 0;var r=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new at.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new st.BindingOnSyntax(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingWhenOnSyntax=r});N(ut),ut.BindingWhenOnSyntax;var lt=j(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var r=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=F.BindingScopeEnum.Request,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=F.BindingScopeEnum.Singleton,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=F.BindingScopeEnum.Transient,new ut.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=r});N(lt),lt.BindingInSyntax;var ct=j(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var r=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new at.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new st.BindingOnSyntax(this._binding),this._bindingInSyntax=new lt.BindingInSyntax(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingInWhenOnSyntax=r});N(ct),ct.BindingInWhenOnSyntax;var ft=j(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var r=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=F.BindingTypeEnum.Instance,this._binding.implementationType=t,new ct.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+U.INVALID_TO_SELF_VALUE);var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=F.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=F.BindingScopeEnum.Singleton,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=F.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new ct.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=F.BindingTypeEnum.Constructor,this._binding.implementationType=t,this._binding.scope=F.BindingScopeEnum.Singleton,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=F.BindingTypeEnum.Factory,this._binding.factory=t,this._binding.scope=F.BindingScopeEnum.Singleton,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(U.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=F.BindingTypeEnum.Function,this._binding.scope=F.BindingScopeEnum.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=F.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=F.BindingScopeEnum.Singleton,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=F.BindingTypeEnum.Provider,this._binding.provider=t,this._binding.scope=F.BindingScopeEnum.Singleton,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue(function(e){return e.container.get(t)})},t}();e.BindingToSyntax=r});N(ft),ft.BindingToSyntax;var ht=j(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerSnapshot=void 0;var r=function(){function t(){}return t.of=function(e,r){var n=new t;return n.bindings=e,n.middleware=r,n},t}();e.ContainerSnapshot=r});N(ht),ht.ContainerSnapshot;var pt=j(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var r=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(U.NULL_ARGUMENT);if(null==e)throw new Error(U.NULL_ARGUMENT);var r=this._map.get(t);void 0!==r?(r.push(e),this._map.set(t,r)):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(U.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(U.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(U.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(U.KEY_NOT_FOUND)},t.prototype.removeByCondition=function(t){var e=this;this._map.forEach(function(r,n){var i=r.filter(function(e){return!t(e)});i.length>0?e._map.set(n,i):e._map.delete(n)})},t.prototype.hasKey=function(t){if(null==t)throw new Error(U.NULL_ARGUMENT);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach(function(t,r){t.forEach(function(t){return e.add(r,t.clone())})}),e},t.prototype.traverse=function(t){this._map.forEach(function(e,r){t(r,e)})},t}();e.Lookup=r});N(pt),pt.Lookup;var dt=j(function(t,e){var r=L&&L.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}u((n=n.apply(t,e||[])).next())})},n=L&&L.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]"),IRendererService:Symbol.for("IRendererService"),IShaderModuleService:Symbol.for("IShaderModuleService"),IIconService:Symbol.for("IIconService"),IFontService:Symbol.for("IFontService"),IInteractionService:Symbol.for("IInteractionService"),IPickingService:Symbol.for("IPickingService"),IControlService:Symbol.for("IControlService"),IStyleAttributeService:Symbol.for("IStyleAttributeService"),ILayer:Symbol.for("ILayer"),ILayerPlugin:Symbol.for("ILayerPlugin"),INormalPass:Symbol.for("INormalPass"),IPostProcessor:Symbol.for("IPostProcessor"),IPostProcessingPass:Symbol.for("IPostProcessingPass"),IFactoryPostProcessingPass:Symbol.for("Factory"),IFactoryNormalPass:Symbol.for("Factory"),IMultiPassRenderer:Symbol.for("IMultiPassRenderer"),SceneID:Symbol.for("SceneID"),MapConfig:Symbol.for("MapConfig")},Rt=function(t){return t&&t.Math===Math&&t},Dt=Rt("object"==("undefined"==typeof globalThis?"undefined":f(globalThis))&&globalThis)||Rt("object"==("undefined"==typeof window?"undefined":f(window))&&window)||Rt("object"==("undefined"==typeof self?"undefined":f(self))&&self)||Rt("object"==f(L)&&L)||Rt("object"==f(L)&&L)||function(){return this}()||Function("return this")(),Bt=function(t){try{return!!t()}catch(t){return!0}},Ft=!Bt(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}),zt=!Bt(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}),Gt=Function.prototype.call,Ut=zt?Gt.bind(Gt):function(){return Gt.apply(Gt,arguments)},Ht={}.propertyIsEnumerable,Vt=Object.getOwnPropertyDescriptor,Qt={f:Vt&&!Ht.call({1:2},1)?function(t){var e=Vt(this,t);return!!e&&e.enumerable}:Ht},Yt=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},Wt=Function.prototype,qt=Wt.call,Xt=zt&&Wt.bind.bind(qt,qt),Kt=zt?Xt:function(t){return function(){return qt.apply(t,arguments)}},Jt=Kt({}.toString),Zt=Kt("".slice),$t=function(t){return Zt(Jt(t),8,-1)},te=Object,ee=Kt("".split),re=Bt(function(){return!te("z").propertyIsEnumerable(0)})?function(t){return"String"===$t(t)?ee(t,""):te(t)}:te,ne=function(t){return null==t},ie=TypeError,oe=function(t){if(ne(t))throw new ie("Can't call method on "+t);return t},ae=function(t){return re(oe(t))},se="object"==("undefined"==typeof document?"undefined":f(document))&&document.all,ue=void 0===se&&void 0!==se?function(t){return"function"==typeof t||t===se}:function(t){return"function"==typeof t},le=function(t){return"object"==f(t)?null!==t:ue(t)},ce=function(t,e){return arguments.length<2?function(t){return ue(t)?t:void 0}(Dt[t]):Dt[t]&&Dt[t][e]},fe=Kt({}.isPrototypeOf),he="undefined"!=typeof navigator&&String(navigator.userAgent)||"",pe=Dt.process,de=Dt.Deno,ye=pe&&pe.versions||de&&de.version,ge=ye&&ye.v8;ge&&(Lt=(Pt=ge.split("."))[0]>0&&Pt[0]<4?1:+(Pt[0]+Pt[1])),!Lt&&he&&(!(Pt=he.match(/Edge\/(\d+)/))||Pt[1]>=74)&&(Pt=he.match(/Chrome\/(\d+)/))&&(Lt=+Pt[1]);var ve=Lt,me=Dt.String,be=!!Object.getOwnPropertySymbols&&!Bt(function(){var t=Symbol("symbol detection");return!me(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&ve&&ve<41}),Ae=be&&!Symbol.sham&&"symbol"==f(Symbol.iterator),xe=Object,we=Ae?function(t){return"symbol"==f(t)}:function(t){var e=ce("Symbol");return ue(e)&&fe(e.prototype,xe(t))},_e=String,Se=function(t){try{return _e(t)}catch(t){return"Object"}},Ee=TypeError,Ce=function(t){if(ue(t))return t;throw new Ee(Se(t)+" is not a function")},ke=function(t,e){var r=t[e];return ne(r)?void 0:Ce(r)},Ie=TypeError,Te=Object.defineProperty,Oe=function(t,e){try{Te(Dt,t,{value:e,configurable:!0,writable:!0})}catch(r){Dt[t]=e}return e},Me=j(function(t){var e=t.exports=Dt["__core-js_shared__"]||Oe("__core-js_shared__",{});(e.versions||(e.versions=[])).push({version:"3.37.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"})}),Pe=function(t,e){return Me[t]||(Me[t]=e||{})},Le=Object,Ne=function(t){return Le(oe(t))},je=Kt({}.hasOwnProperty),Re=Object.hasOwn||function(t,e){return je(Ne(t),e)},De=0,Be=Math.random(),Fe=Kt(1..toString),ze=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Fe(++De+Be,36)},Ge=Dt.Symbol,Ue=Pe("wks"),He=Ae?Ge.for||Ge:Ge&&Ge.withoutSetter||ze,Ve=function(t){return Re(Ue,t)||(Ue[t]=be&&Re(Ge,t)?Ge[t]:He("Symbol."+t)),Ue[t]},Qe=TypeError,Ye=Ve("toPrimitive"),We=function(t,e){if(!le(t)||we(t))return t;var r,n=ke(t,Ye);if(n){if(void 0===e&&(e="default"),r=Ut(n,t,e),!le(r)||we(r))return r;throw new Qe("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var r,n;if("string"===e&&ue(r=t.toString)&&!le(n=Ut(r,t)))return n;if(ue(r=t.valueOf)&&!le(n=Ut(r,t)))return n;if("string"!==e&&ue(r=t.toString)&&!le(n=Ut(r,t)))return n;throw new Ie("Can't convert object to primitive value")}(t,e)},qe=function(t){var e=We(t,"string");return we(e)?e:e+""},Xe=Dt.document,Ke=le(Xe)&&le(Xe.createElement),Je=function(t){return Ke?Xe.createElement(t):{}},Ze=!Ft&&!Bt(function(){return 7!==Object.defineProperty(Je("div"),"a",{get:function(){return 7}}).a}),$e=Object.getOwnPropertyDescriptor,tr={f:Ft?$e:function(t,e){if(t=ae(t),e=qe(e),Ze)try{return $e(t,e)}catch(t){}if(Re(t,e))return Yt(!Ut(Qt.f,t,e),t[e])}},er=Ft&&Bt(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),rr=String,nr=TypeError,ir=function(t){if(le(t))return t;throw new nr(rr(t)+" is not an object")},or=TypeError,ar=Object.defineProperty,sr=Object.getOwnPropertyDescriptor,ur={f:Ft?er?function(t,e,r){if(ir(t),e=qe(e),ir(r),"function"==typeof t&&"prototype"===e&&"value"in r&&"writable"in r&&!r.writable){var n=sr(t,e);n&&n.writable&&(t[e]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return ar(t,e,r)}:ar:function(t,e,r){if(ir(t),e=qe(e),ir(r),Ze)try{return ar(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new or("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},lr=Ft?function(t,e,r){return ur.f(t,e,Yt(1,r))}:function(t,e,r){return t[e]=r,t},cr=Function.prototype,fr=Ft&&Object.getOwnPropertyDescriptor,hr=Re(cr,"name"),pr={EXISTS:hr,PROPER:hr&&"something"===function(){}.name,CONFIGURABLE:hr&&(!Ft||Ft&&fr(cr,"name").configurable)},dr=Kt(Function.toString);ue(Me.inspectSource)||(Me.inspectSource=function(t){return dr(t)});var yr,gr,vr,mr=Me.inspectSource,br=Dt.WeakMap,Ar=ue(br)&&/native code/.test(String(br)),xr=Pe("keys"),wr=function(t){return xr[t]||(xr[t]=ze(t))},_r={},Sr=Dt.TypeError,Er=Dt.WeakMap;if(Ar||Me.state){var Cr=Me.state||(Me.state=new Er);Cr.get=Cr.get,Cr.has=Cr.has,Cr.set=Cr.set,yr=function(t,e){if(Cr.has(t))throw new Sr("Object already initialized");return e.facade=t,Cr.set(t,e),e},gr=function(t){return Cr.get(t)||{}},vr=function(t){return Cr.has(t)}}else{var kr=wr("state");_r[kr]=!0,yr=function(t,e){if(Re(t,kr))throw new Sr("Object already initialized");return e.facade=t,lr(t,kr,e),e},gr=function(t){return Re(t,kr)?t[kr]:{}},vr=function(t){return Re(t,kr)}}var Ir={set:yr,get:gr,has:vr,enforce:function(t){return vr(t)?gr(t):yr(t,{})},getterFor:function(t){return function(e){var r;if(!le(e)||(r=gr(e)).type!==t)throw new Sr("Incompatible receiver, "+t+" required");return r}}},Tr=j(function(t){var e=pr.CONFIGURABLE,r=Ir.enforce,n=Ir.get,i=String,o=Object.defineProperty,a=Kt("".slice),s=Kt("".replace),u=Kt([].join),l=Ft&&!Bt(function(){return 8!==o(function(){},"length",{value:8}).length}),c=String(String).split("String"),f=t.exports=function(t,n,f){"Symbol("===a(i(n),0,7)&&(n="["+s(i(n),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),f&&f.getter&&(n="get "+n),f&&f.setter&&(n="set "+n),(!Re(t,"name")||e&&t.name!==n)&&(Ft?o(t,"name",{value:n,configurable:!0}):t.name=n),l&&f&&Re(f,"arity")&&t.length!==f.arity&&o(t,"length",{value:f.arity});try{f&&Re(f,"constructor")&&f.constructor?Ft&&o(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var h=r(t);return Re(h,"source")||(h.source=u(c,"string"==typeof n?n:"")),t};Function.prototype.toString=f(function(){return ue(this)&&n(this).source||mr(this)},"toString")}),Or=function(t,e,r,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:e;if(ue(r)&&Tr(r,o,n),n.global)i?t[e]=r:Oe(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch(t){}i?t[e]=r:ur.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},Mr=Math.ceil,Pr=Math.floor,Lr=Math.trunc||function(t){var e=+t;return(e>0?Pr:Mr)(e)},Nr=function(t){var e=+t;return e!=e||0===e?0:Lr(e)},jr=Math.max,Rr=Math.min,Dr=function(t,e){var r=Nr(t);return r<0?jr(r+e,0):Rr(r,e)},Br=Math.min,Fr=function(t){var e=Nr(t);return e>0?Br(e,9007199254740991):0},zr=function(t){return Fr(t.length)},Gr=function(t){return function(e,r,n){var i=ae(e),o=zr(i);if(0===o)return!t&&-1;var a,s=Dr(n,o);if(t&&r!=r){for(;o>s;)if((a=i[s++])!=a)return!0}else for(;o>s;s++)if((t||s in i)&&i[s]===r)return t||s||0;return!t&&-1}},Ur={includes:Gr(!0),indexOf:Gr(!1)},Hr=Ur.indexOf,Vr=Kt([].push),Qr=function(t,e){var r,n=ae(t),i=0,o=[];for(r in n)!Re(_r,r)&&Re(n,r)&&Vr(o,r);for(;e.length>i;)Re(n,r=e[i++])&&(~Hr(o,r)||Vr(o,r));return o},Yr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Wr=Yr.concat("length","prototype"),qr={f:Object.getOwnPropertyNames||function(t){return Qr(t,Wr)}},Xr={f:Object.getOwnPropertySymbols},Kr=Kt([].concat),Jr=ce("Reflect","ownKeys")||function(t){var e=qr.f(ir(t)),r=Xr.f;return r?Kr(e,r(t)):e},Zr=function(t,e,r){for(var n=Jr(e),i=ur.f,o=tr.f,a=0;a9007199254740991)throw cn("Maximum allowed index exceeded");return t},hn=function(t,e,r){Ft?ur.f(t,e,Yt(0,r)):t[e]=r},pn={};pn[Ve("toStringTag")]="z";var dn="[object z]"===String(pn),yn=Ve("toStringTag"),gn=Object,vn="Arguments"===$t(function(){return arguments}()),mn=dn?$t:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=gn(t),yn))?r:vn?$t(e):"Object"===(n=$t(e))&&ue(e.callee)?"Arguments":n},bn=function(){},An=ce("Reflect","construct"),xn=/^\s*(?:class|function)\b/,wn=Kt(xn.exec),_n=!xn.test(bn),Sn=function(t){if(!ue(t))return!1;try{return An(bn,[],t),!0}catch(t){return!1}},En=function(t){if(!ue(t))return!1;switch(mn(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _n||!!wn(xn,mr(t))}catch(t){return!0}};En.sham=!0;var Cn=!An||Bt(function(){var t;return Sn(Sn.call)||!Sn(Object)||!Sn(function(){t=!0})||t})?En:Sn,kn=Ve("species"),In=Array,Tn=function(t,e){return new(function(t){var e;return ln(t)&&(e=t.constructor,(Cn(e)&&(e===In||ln(e.prototype))||le(e)&&null===(e=e[kn]))&&(e=void 0)),void 0===e?In:e}(t))(0===e?0:e)},On=Ve("species"),Mn=function(t){return ve>=51||!Bt(function(){var e=[];return(e.constructor={})[On]=function(){return{foo:1}},1!==e[t](Boolean).foo})},Pn=Ve("isConcatSpreadable"),Ln=function(t){if(!le(t))return!1;var e=t[Pn];return void 0!==e?!!e:ln(t)},Nn=!(ve>=51||!Bt(function(){var t=[];return t[Pn]=!1,t.concat()[0]!==t}))||!Mn("concat");un({target:"Array",proto:!0,arity:1,forced:Nn},{concat:function(t){var e,r,n,i,o,a=Ne(this),s=Tn(a,0),u=0;for(e=-1,n=arguments.length;ea;)ur.f(t,r=i[a++],n[r]);return t}},Bn=ce("document","documentElement"),Fn=wr("IE_PROTO"),zn=function(){},Gn=function(t){return"