@mapgis/webclient-cesium-plugin 17.2.2 → 17.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,16 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@mapgis/webclient-common"));else if("function"==typeof define&&define.amd)define(["@mapgis/webclient-common"],t);else{var i="object"==typeof exports?t(require("@mapgis/webclient-common")):t(e["@mapgis/webclient-common"]);for(var r in i)("object"==typeof exports?exports:e)[r]=i[r]}}(window,function(__WEBPACK_EXTERNAL_MODULE__0__){return function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=16)}([function(e,t){e.exports=__WEBPACK_EXTERNAL_MODULE__0__},function(module,__webpack_exports__,__webpack_require__){"use strict";var _mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__),_DynamicLabelsUtil__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(2);function convertTextSymbolOptions(e,t){const i={};t=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(t,{});const r=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(t.layerOpacity,1);let n={};if(e){n=e instanceof _mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.Symbol?e.toJSON():e;const t=(n=JSON.parse(JSON.stringify(n))).font||{};let{verticalAlignment:a,horizontalAlignment:o}=e;const{textWraps:s,rotated:l,textDecorationUnderlineWidth:h,textDecorationUnderlineColor:c,textDecorationThroughlineColor:u,textDecorationThroughlineWidth:d,textShadowColor:p,textShadowBlur:f,textExtraIcon:m,backgroundColor:y,backgroundImage:g}=e;switch(a){case"middle":a="center";break;case"top":a="above";break;case"bottom":a="below";break;default:a="center"}switch(o){case"center":o="center";break;case"left":o="left";break;case"right":o="right";break;default:o="center"}i.labelPlacement=`${a}-${o}`,n.textWraps=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(s,!0),l||(n.angle=0),(0!==h&&c||"underline"===t.decoration)&&(n.showTextDecorationUnderline=!0),(0!==d&&u||"line-through"===t.decoration)&&(n.showTextDecorationThroughline=!0),p&&0!==f&&(n.showTextShadow=!0),void 0!==n.letterSpacing&&(n.letterSpacing+="px"),["color","haloColor","backgroundColor","borderLineColor","textDecorationUnderlineColor","textDecorationThroughlineColor","textShadowColor"].forEach(e=>{if(n[e]){const t=_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.Color.fromColor(n[e]);t.alpha*=r,n[e]=t.toCssRGBAString()}}),y||g?(n.showBackground=!0,n.backgroundImage=g,n.backgroundColor=y):(n.showBackground=!1,n.backgroundColor="rgba(0,0,0,0)"),m&&(n.showTextExtraIcon=!0,n.textExtraIcon=e.textExtraIcon,n.textExtraIconAnchor=e.textExtraIconAnchor,n.textExtraIconSize=e.textExtraIconSize),n.yoffset*=-1}return i.symbol=n,i}class CesiumPluginUtil{static convertColorToRgb(e){return e instanceof _mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.Color?Cesium.Color.fromCssColorString(e.toCssRGBAString()):"string"==typeof e?Cesium.Color.fromCssColorString(e):(e=new _mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.Color,Cesium.Color.fromCssColorString(e.toCssRGBAString()))}static convertTextSymbolToLabelNoteStyle(e,t){const i=convertTextSymbolOptions(e,t);return _DynamicLabelsUtil__WEBPACK_IMPORTED_MODULE_1__.a.parseNoteOptions("Point",i)}static convertLabelClassToLabelNoteStyle(e){const{symbol:t}=e,i=e.extendOptions,r=convertTextSymbolOptions(t);r.minScale=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(i.minScale,e.minScale),r.maxScale=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(i.maxScale,e.maxScale),e.labelPlacement&&(r.labelPlacement=e.labelPlacement),r.repeatLabel=e.repeatLabel,r.repeatLabelDistance=e.repeatLabelDistance,r.repeatStartRate=e.repeatStartRate,r.repeatEndRate=e.repeatEndRate,r.lineLabelSpread=e.lineLabelSpread,r.labelPositionAlong=e.labelPositionAlong,r.skeletonLineStartRate=e.skeletonLineStartRate,r.skeletonLineEndRate=e.skeletonLineEndRate,r.groundScale=e.groundScale;const n=e.elevationInfo,{mode:a,offset:o,featureExpressionInfo:s,unit:l}=n;let h=1;"mile"===l?h=1609.34:"kilometers"===l&&(h=1e3),r.labelHeight=o*h;let c=0;return"OnTheGround"===a?c=1:"RelativeToGround"===a&&(c=2),r.heightReference=c,Object.entries(i).forEach(e=>{r[e[0]]=e[1]}),r}static parseExpression(feature,expression){if(!expression)return"";const excuteStr=expression.replace(/\$feature/g,"feature.attributes");try{const v=eval(excuteStr);return v}catch(e){_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.Log.info("字段表达式输入值非法")}return""}static toCartesian3Position(e,t){let i;return i="degrees"===t?Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]):Cesium.Cartesian3.fromRadians(e[0],e[1],e[2])}static createBillboardOptions(e,t){(t=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(t,{})).heightReference=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(t.heightReference,Cesium.HeightReference.NONE);const i=t.graphic,r=i._feature.symbol;let n,a={position:e,image:n=i._canvas?i._canvas:r.url,color:new Cesium.Color(1,1,1,i._layerOpacity),width:r.size||r.width,height:r.size||r.height,pixelOffset:new Cesium.Cartesian2(r.xoffset,-1*r.yoffset),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,heightReference:t.heightReference};return a=Object.assign(a,r.extendOptions)}static calcRhumbArcCenter(e,t){const i=Cesium.Cartesian3.fromDegrees(e[0],e[1]),r=Cesium.Cartesian3.fromDegrees(t[0],t[1]),n=Cesium.Ellipsoid.WGS84;e=n.cartesianToCartographic(i),t=n.cartesianToCartographic(r);const a=new Cesium.EllipsoidRhumbLine(e,t,n),o=a.surfaceDistance/2,s=a.interpolateUsingSurfaceDistance(o,t),l=Cesium.Math.toDegrees(s.longitude),h=Cesium.Math.toDegrees(s.latitude);if(void 0!==e[2]&&void 0!==t[2]){return[l,h,((e[2]?e[2]:0)+(t[2]?t[2]:0))/2]}return[l,h]}static calcCartesianArcCenter(e,t){const i=Cesium.Cartesian3.fromDegrees(e[0],e[1]),r=Cesium.Cartesian3.fromDegrees(t[0],t[1]),n=Cesium.Ellipsoid.WGS84;e=n.cartesianToCartographic(i),t=n.cartesianToCartographic(r);const a=new Cesium.EllipsoidGeodesic;a.setEndPoints(e,t);const o=a.surfaceDistance/2,s=a.interpolateUsingSurfaceDistance(o,t),l=Cesium.Math.toDegrees(s.longitude),h=Cesium.Math.toDegrees(s.latitude);if(void 0!==e[2]&&void 0!==t[2]){return[l,h,((e[2]?e[2]:0)+(t[2]?t[2]:0))/2]}return[l,h]}}__webpack_exports__.a=CesiumPluginUtil},function(e,t,i){"use strict";function r(e,t,i,r,n,a,o,s,l,h,c,u,d){var p=!1,g=!1;if(0===l?g=!0:1===l?p=!0:(p=!0,g=!0),f(t)){var v=t.split("/"),b=v[1],_=v[2];if(v.length>4)_=v.slice(2,v.length-1).join("/");var w=n,x=T=parseInt(c.fontSize);e.textBaseline="middle";var C=e.measureText(b).width,S=e.measureText(_).width,M=C>S?C:S,k=T/2;p&&(e.strokeText(b,w+M/2-C/2,x-k),e.strokeText(_,w+M/2-S/2,x+k)),g&&(e.fillText(b,w+M/2-C/2,x-k),e.fillText(_,w+M/2-S/2,x+k));return e.strokeStyle=e.fillStyle,e.beginPath(),e.moveTo(w,x),e.lineTo(w+M,x),e.lineWidth=1,e.stroke(),e.closePath(),{width:M*d,height:u.height}}if(m(t)){var T,I=t,O=0,E=`${T=parseInt(c.fontSize)}px ${c.fontFamily}`,L=`${.666*T}px ${c.fontFamily}`,P=(w=n,x=T/2/d+T/2+a,0);e.textBaseline="middle";k=T/3;for(var R=I.split("#"),j=R[0],A=1;A<R.length;A++){var z=R[A];if(/^[-+=]$/.test(z[0]))break;j+="#"+z}if(j.length>0){y(e,j,w,x,E,g,p);var D=e.measureText(j).width;w+=D,O+=D}var V=[];(R=(I=I.slice(j.length)).split("#")).shift();for(A=0;A<R.length;A++)if(A>0&&/^[-+=]$/.test(R[A][0]))V.push(R[A]);else{var N=V.pop();Cesium.defined(N)||(N="");var G=0===A?"":"#";V.push(N+G+R[A])}R=V;for(A=0;A<R.length;A++){var F=R[A],B=F[0],q=F.substring(1);if("+"===B)y(e,q,w,x-k,L,g,p),P=P>(U=e.measureText(q).width)?P:U;else if("-"===B){var U;y(e,q,w,x+k,L,g,p),P=P>(U=e.measureText(q).width)?P:U}else if("="===B){y(e,q,w+=P,x,E,g,p),w+=s=e.measureText(q).width,O+=s}z=R[A+1];if(Cesium.defined(z))"="===z[0]&&(O+=P);else"+"!==B&&"-"!==B||(O+=P)}return{width:O*d,height:u.height}}var W=e.measureText(t).width,H=o+a,Y=parseInt(h);if(W<i||-1===r)p&&e.strokeText(t,n,H),g&&e.fillText(t,n,H);else{var X=t.split(""),J=0,$=0,K=n,Z=a+o,Q=0;for(A=0;A<X.length;A++){q=X[A];var ee=e.measureText(q).width;J+ee-Y===s&&(ee-=Y),J+=ee,$=ee,Q<=r&&(J<=s?K=n+J-$:($=0,J=ee,K=n,Z=o*((Q+=1)+1)+a),p&&e.strokeText(q,K,Z),g&&e.fillText(q,K,Z))}}}function n(e,t){var i=void 0!==t?t:{},n=f(e),a=m(e),s=Cesium.defaultValue(i.textWraps,!0),h=Cesium.defaultValue(i.lineWidth,80),c=Cesium.defaultValue(i.lineMaxNum,3),u=0;i.drawStyles&&i.drawStyles.haloSize&&(u=i.drawStyles.haloSize);var d=Cesium.defaultValue(i.showBackground,!1),p=5,y=5;Cesium.defined(i.backgroundPadding)&&(Array.isArray(i.backgroundPadding)?(p=i.backgroundPadding[0],y=i.backgroundPadding[1]):(p=i.backgroundPadding,y=i.backgroundPadding));var g=i.backgroundImage,v=Cesium.defaultValue(i.backgroundColor,"rgba(42,42,42,0.8)");d||(p=0,y=0),(!s||n||a)&&(c=-1);var b=Cesium.defaultValue(i.fontStyleOptions,{}),_=new o(b),w=Cesium.defaultValue(i.lineHeight,Cesium.defaultValue(parseInt(_.fontSize)),20),x=l(e,_,h,c,w,i.letterSpacing),C=document.createElement("canvas"),S=C.getContext("2d"),M=e,k=i.textDefinition<=1?1:i.textDefinition,T=0;_.fontStyle&&"normal"!==_.fontStyle&&(T=.5);var I=p+u,O=y+u,E=x.right+T*parseInt(_.fontSize)+2*I,L=x.bottom+2*O;S.save(),S.font=`${b.fontSize} ${b.fontFamily}`,n?(E=S.measureText(M).width,L=2*parseInt(_.fontSize)):a&&(E=S.measureText(M).width,L+=.3*parseInt(_.fontSize)),S.restore();var P=[0,0],R=[0,0],j=Cesium.defaultValue(i.showTextExtraIcon,!1),A=Cesium.defaultValue(i.textExtraIconSize,20),z=Cesium.defaultValue(i.textExtraIcon,"");if(j)switch(i.textExtraIconAnchor){case"top":P=[0,A],R=[E/2-A/2,0],E+=0,L+=A;break;case"left":P=[A,0],R=[0,L/2-A/2],E+=A,L+=0;break;case"right":P=[0,0],R=[E,L/2-A/2],E+=A,L+=0;break;case"bottom":P=[0,0],R=[E/2-A/2,L],E+=0,L+=A;break;default:P=[0,A],R=[E/2-A/2,0],E+=0,L+=A}var D=E*k,V=L*k;C.width=D,C.height=V,S.scale(k,k),document.body.appendChild(C),S.save(),d&&("function"==typeof g?g(S,P[0],P[1],E,L):g?S.drawImage(g,P[0],P[1],E,L):(S.fillStyle=v,S.fillRect(P[0],P[1],E,L))),S.restore(),j&&z&&(S.save(),S.drawImage(z,R[0],R[1],A,A),S.restore()),S.save(),C.style.letterSpacing=i.letterSpacing,S.font=_.font,S.textBaseline="bottom";var N=Cesium.defaultValue(i.drawStyles,{}),G=Cesium.defaultValue(i.drawMode,0);S.fillStyle=N.color,S.strokeStyle=N.haloColor,S.lineWidth=N.haloSize,Cesium.defaultValue(i.showTextShadow,!1)&&(S.shadowOffsetX=i.textShadowOffsetX,S.shadowOffsetY=i.textShadowOffsetY,S.shadowColor=i.textShadowColor,S.shadowBlur=i.textShadowBlur);var F=r(S,M,h,c,I+P[0],O+P[1],w,x.right,G,i.letterSpacing,_,C,k);if(S.restore(),function(e,t,i,r,n,a,o,s){for(var l=a/o,h=Cesium.defaultValue(s.showTextDecorationUnderline,!1),c=Cesium.defaultValue(s.textDecorationUnderlineColor,"rgba(0,0,0,1)"),u=Cesium.defaultValue(s.textDecorationUnderlineWidth,1),d=Cesium.defaultValue(s.showTextDecorationThroughline,!1),p=Cesium.defaultValue(s.textDecorationThroughlineColor,"rgba(0,0,0,1)"),f=Cesium.defaultValue(s.textDecorationThroughlineWidth,1),m=(i-n-a)/2+n,y=0;y<l;y++)g(e,t,m,o),m+=o;function g(e,t,i,n){e.save(),d&&(e.beginPath(),e.lineWidth=f,e.strokeStyle=p,e.moveTo(r,i+n/2),e.lineTo(t+r,i+n/2),e.stroke()),e.restore(),e.save(),h&&(e.beginPath(),e.lineWidth=u,e.strokeStyle=c,e.moveTo(r,i+n),e.lineTo(t+r,i+n),e.stroke()),e.restore()}}(S,x.right,L,P[0],P[1],x.bottom,w,i),document.body.removeChild(C),Cesium.defined(F)){var B=document.createElement("canvas");B.width=F.width,B.height=F.height,B.getContext("2d").drawImage(C,0,0),C=B}return C}function a(e,t,i){var r=a.canvas||(a.canvas=document.createElement("canvas")),n=r.getContext("2d"),o=0;return n.font=t,i&&(r.style.letterSpacing=i.letterSpacing,o=(e.split("").length-1)*parseFloat(i.letterSpacing)),n.measureText(e).width+o}function o(e){var t=Cesium.defaultValue(e.fontStyle,"normal"),i=Cesium.defaultValue(e.fontVariant,"normal"),r=Cesium.defaultValue(e.fontWeight,"normal"),n=Cesium.defaultValue(e.fontSize,"15px"),a=Cesium.defaultValue(e.fontFamily,"simHei"),o=t+" "+i+" "+r+" "+n+" "+a;this.font=o,this.fontStyle=t,this.fontVariant=i,this.fontWeight=r,this.fontSize=n,this.fontFamily=a}function s(e,t,i,r,n){if(!e)return"";var o,s,l=e.split(""),h=[],c=0,u=0;for(o=0;o<l.length;o++)if(u+=a(s=l[o],t.font),h.push(s),u>i){if(u=0,(c+=1)===r){h[h.length-1]="..";break}h.push("\n")}return"\n"===h[h.length-1]&&h.splice(h.length-1,1),h.toString().replace(/,/g,"")}function l(e,t,i,r,n,o){var s=a(e,t.font,{letterSpacing:o}),l=s/i,h=Math.ceil(l);if(-1===r||s<i)return{top:0,left:0,right:s,bottom:n};var c=0;return c=h<=r?h*n:r*n,{top:0,left:0,right:function(e,t,i,r){for(var n=e.split(""),a=parseInt(r),o=0,s=0;s<n.length;s++){var l=i(n[s]);if(!(o+l+a<=t)){o-=a;break}o+=l+a}return o}(e,i,function(e){return a(e,t.font,{letterSpacing:o})},o),bottom:c}}function h(e){var t=Cesium.defaultValue(e,{}),i=Cesium.defaultValue(t.symbol,{}),r=Cesium.defaultValue(i.font,{}),n=Cesium.defaultValue(t.pointDetail,t),a=Cesium.defaultValue(t.lineDetail,t),o=Cesium.defaultValue(t.polygonDetail,t);return{symbol:{color:Cesium.defaultValue(i.color,"rgba(0,0,0,1)"),haloColor:Cesium.defaultValue(i.haloColor,"rgba(255,255,255,0.5)"),haloSize:Cesium.defaultValue(i.haloSize,0),lineHeight:Cesium.defaultValue(i.lineHeight,1.1),lineWidth:Cesium.defaultValue(i.lineWidth,80),lineMaxNum:Cesium.defaultValue(i.lineMaxNum,3),textWraps:Cesium.defaultValue(i.textWraps,!1),letterSpacing:Cesium.defaultValue(i.letterSpacing,"0px"),xoffset:Cesium.defaultValue(i.xoffset,0),yoffset:Cesium.defaultValue(i.yoffset,0),angle:Cesium.defaultValue(i.angle,0),font:{size:Cesium.defaultValue(r.size,20),family:Cesium.defaultValue(r.family,"simHei"),weight:Cesium.defaultValue(r.weight,"normal"),style:Cesium.defaultValue(r.style,"normal")},showBackground:Cesium.defaultValue(i.showBackground,!1),backgroundColor:Cesium.defaultValue(i.backgroundColor,"rgba(42,42,42,0.8)"),backgroundPadding:Cesium.defaultValue(i.backgroundPadding,5),backgroundImage:Cesium.defaultValue(i.backgroundImage,void 0),showTextExtraIcon:Cesium.defaultValue(i.showTextExtraIcon,!1),textExtraIcon:Cesium.defaultValue(i.textExtraIcon,void 0),textExtraIconAnchor:Cesium.defaultValue(i.textExtraIconAnchor,"top"),textExtraIconSize:Cesium.defaultValue(i.textExtraIconSize,void 0),showTextDecorationUnderline:Cesium.defaultValue(i.showTextDecorationUnderline,!1),textDecorationUnderlineColor:Cesium.defaultValue(i.textDecorationUnderlineColor,Cesium.defaultValue(i.color,"rgba(255,255,255,1)")),textDecorationUnderlineWidth:Cesium.defaultValue(i.textDecorationUnderlineWidth,1),showTextDecorationThroughline:Cesium.defaultValue(i.showTextDecorationThroughline,!1),textDecorationThroughlineColor:Cesium.defaultValue(i.textDecorationThroughlineColor,Cesium.defaultValue(i.color,"rgba(255,255,255,1)")),textDecorationThroughlineWidth:Cesium.defaultValue(i.textDecorationThroughlineWidth,1),showTextShadow:Cesium.defaultValue(i.showTextShadow,!1),textShadowOffsetX:Cesium.defaultValue(i.textShadowOffsetX,1),textShadowOffsetY:Cesium.defaultValue(i.textShadowOffsetY,1),textShadowColor:Cesium.defaultValue(i.textShadowColor,"#cccccc"),textShadowBlur:Cesium.defaultValue(i.textShadowBlur,2)},maxScale:Cesium.defaultValue(t.maxScale,void 0),minScale:Cesium.defaultValue(t.minScale,void 0),scaleByDistance:Cesium.defaultValue(t.scaleByDistance,void 0),distanceDisplayCondition:Cesium.defaultValue(t.distanceDisplayCondition,void 0),heightReference:Cesium.defaultValue(t.heightReference,void 0),disableDepthTestDistance:Cesium.defaultValue(t.disableDepthTestDistance,void 0),pixelOffsetScaleByDistance:Cesium.defaultValue(t.pixelOffsetScaleByDistance,void 0),translucencyByDistance:Cesium.defaultValue(t.translucencyByDistance,void 0),cstyle:Cesium.defaultValue(t.style,void 0),cshow:Cesium.defaultValue(t.show,!0),cposition:Cesium.defaultValue(t.position,void 0),ctext:Cesium.defaultValue(t.text,void 0),cfont:Cesium.defaultValue(t.font,void 0),cfillColor:Cesium.defaultValue(t.fillColor,void 0),coutlineColor:Cesium.defaultValue(t.outlineColor,void 0),coutlineWidth:Cesium.defaultValue(t.outlineWidth,void 0),cshowBackground:Cesium.defaultValue(t.showBackground,void 0),cbackgroundColor:Cesium.defaultValue(t.backgroundColor,void 0),cbackgroundPadding:Cesium.defaultValue(t.backgroundPadding,void 0),cpixelOffset:Cesium.defaultValue(t.pixelOffset,void 0),ceyeOffset:Cesium.defaultValue(t.eyeOffset,void 0),chorizontalOrigin:Cesium.defaultValue(t.horizontalOrigin,void 0),cverticalOrigin:Cesium.defaultValue(t.verticalOrigin,void 0),cscale:Cesium.defaultValue(t.scale,1),renderMode:Cesium.defaultValue(t.renderMode,"canvas"),groundScale:Cesium.defaultValue(t.groundScale,20),labelHeight:Cesium.defaultValue(t.labelHeight,0),repeatLabel:Cesium.defaultValue(t.repeatLabel,!0),repeatLabelDistance:Cesium.defaultValue(t.repeatLabelDistance,6e3),repeatStartRate:Cesium.defaultValue(t.repeatStartRate,.3),repeatEndRate:Cesium.defaultValue(t.repeatEndRate,.7),pointDetail:{labelPlacement:Cesium.defaultValue(n.labelPlacement,"above-center"),currentAttributeName:Cesium.defaultValue(n.currentAttributeName,"n")},lineDetail:{labelPlacement:Cesium.defaultValue(a.labelPlacement,"above-line"),lineLabelSpread:Cesium.defaultValue(a.lineLabelSpread,"auto-spread"),labelPositionAlong:Cesium.defaultValue(a.labelPositionAlong,"middle"),currentAttributeName:Cesium.defaultValue(a.currentAttributeName,"ln")},polygonDetail:{labelPlacement:Cesium.defaultValue(o.labelPlacement,"skeleton"),currentAttributeName:Cesium.defaultValue(o.currentAttributeName,"name"),skeletonLineStartRate:Cesium.defaultValue(o.skeletonLineStartRate,.4),skeletonLineEndRate:Cesium.defaultValue(o.skeletonLineEndRate,.6)}}}function c(e,t){var i=t.symbol;e.symbol=i,e.renderMode=t.renderMode;var r=i.font,n={};n.fontStyle=r.style,n.fontVariant="normal",n.fontWeight=r.weight,n.fontSize=r.size+"px",n.fontFamily=r.family,e.fontStyleOptions=n,e.lineWidth=i.lineWidth,e.lineHeight=Math.max(i.lineHeight,1.1)*r.size,e.letterSpacing=i.letterSpacing;var a={},o=t.cstyle;a.color=i.color,a.haloColor=i.haloColor,a.haloSize=i.haloSize,void 0===o&&(a.color&&"none"!==a.color&&(o=0),a.haloColor&&"none"!==a.haloColor&&0!==a.haloSize&&(o=0===o?2:1),void 0===o&&(o=0)),e.drawStyles=a,e.drawMode=o,e.rotated=Cesium.defaultValue(i.rotated,!1),e.angle=Cesium.defaultValue(i.angle,0),e.showBackground=i.showBackground,e.backgroundColor=i.backgroundColor,e.backgroundPadding=i.backgroundPadding,e.backgroundImage=i.backgroundImage,e.showTextExtraIcon=i.showTextExtraIcon,e.textExtraIcon=i.textExtraIcon,e.textExtraIconAnchor=i.textExtraIconAnchor,e.textExtraIconSize=Cesium.defaultValue(i.textExtraIconSize,r.size),e.showTextDecorationUnderline=i.showTextDecorationUnderline,e.textDecorationUnderlineColor=i.textDecorationUnderlineColor,e.textDecorationUnderlineWidth=i.textDecorationUnderlineWidth,e.showTextDecorationThroughline=i.showTextDecorationThroughline,e.textDecorationThroughlineColor=i.textDecorationThroughlineColor,e.textDecorationThroughlineWidth=i.textDecorationThroughlineWidth,e.showTextShadow=i.showTextShadow,e.textShadowOffsetX=i.textShadowOffsetX,e.textShadowOffsetY=i.textShadowOffsetY,e.textShadowColor=i.textShadowColor,e.textShadowBlur=i.textShadowBlur,e.verticalAlignment=i.verticalAlignment,e.horizontalAlignment=i.horizontalAlignment,e.defaultText=i.text,e.xoffset=i.xoffset,e.yoffset=i.yoffset,e.textWraps=i.textWraps,e.lineMaxNum=i.lineMaxNum,e.labelHeight=t.labelHeight,e.maxScale=t.maxScale,e.minScale=t.minScale,e.scaleByDistance=t.scaleByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightReference=t.heightReference,e.disableDepthTestDistance=t.disableDepthTestDistance,e.pixelOffsetScaleByDistance=t.pixelOffsetScaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.cshow=t.cshow,e.cposition=t.cposition,e.ctext=t.ctext,e.cfont=t.cfont,e.cfillColor=t.cfillColor,e.coutlineColor=t.coutlineColor,e.coutlineWidth=t.coutlineWidth,e.cshowBackground=t.cshowBackground,e.cbackgroundColor=t.cbackgroundColor,e.cbackgroundPadding=t.cbackgroundPadding,e.cpixelOffset=t.cpixelOffset,e.ceyeOffset=t.ceyeOffset,e.chorizontalOrigin=t.chorizontalOrigin,e.cverticalOrigin=t.cverticalOrigin,e.cscale=t.cscale,e.groundScale=t.groundScale,e.repeatLabel=t.repeatLabel,e.repeatLabelDistance=t.repeatLabelDistance,e.repeatStartRate=t.repeatStartRate,e.repeatEndRate=t.repeatEndRate;e.textDefinition=2}function u(e){var t={},i=h(e);c(t,i);for(var r=i.pointDetail;t.angle<0;)t.angle+=360;for(;t.angle>360;)t.angle-=360;t.currentAttributeName=r.currentAttributeName;var n=0,a=0;if(t.labelPlacement=Cesium.defaultValue(r.labelPlacement,"above-center"),"angle"===t.labelPlacement)n=0,a=0;else if("labels-layer"===t.labelPlacement)n=1,a=1;else switch(t.labelPlacement){case"center-center":n=0,a=0;break;case"center-left":n=-1,a=0;break;case"center-right":n=1,a=0;break;case"above-center":n=0,a=1;break;case"below-center":n=0,a=-1;break;case"above-left":n=-1,a=1;break;case"above-right":n=1,a=1;break;case"below-left":n=-1,a=-1;break;case"below-right":n=1,a=-1;break;default:n=0,a=0}return t.positionOffsetXRate=n,t.positionOffsetYRate=a,t}function d(e){var t={},i=h(e);c(t,i);var r=i.lineDetail;t.currentAttributeName=r.currentAttributeName,t.lineLabelSpread=r.lineLabelSpread,t.labelPositionAlong=r.labelPositionAlong,t.repeat=r.repeat,t.angle=0;var n=0,a=0;switch(t.type=Cesium.defaultValue(r.labelPlacement,"on-line"),t.type){case"on-line":n=0,a=0,t.xoffset=0,t.yoffset=0;break;case"above-line":n=0,a=1;break;case"below-line":n=0,a=-1;break;default:n=0,a=0,t.xoffset=0,t.yoffset=0}return t.positionOffsetXRate=n,t.positionOffsetYRate=a,t}function p(e){var t={},i=h(e);c(t,i),t.rotated=!1,t.angle=0;var r=i.polygonDetail;t.currentAttributeName=r.currentAttributeName,t.skeletonLineStartRate=r.skeletonLineStartRate,t.skeletonLineEndRate=r.skeletonLineEndRate;return t.positionOffsetXRate=0,t.positionOffsetYRate=1,t.type=r.labelPlacement,t}function f(e){var t=!1,i=e.charAt(0),r=e.charAt(e.length-1);if("/"===i&&"/"===r){var n=e.match(/\//g);n&&n.length>=3&&(t=!0)}return t}function m(e){var t=!1;return(e.includes("#+")||e.includes("#-"))&&(t=!0),t}function y(e,t,i,r,n,a,o){e.font=n,o&&e.strokeText(t,i,r),a&&e.fillText(t,i,r)}var g={drawText:r,createNoteCanvas:n,getTextWidth:a,calcNoteBounds:l,parseLabelsOption:h,FontStyleOptions:o,parseNoteOptions:function(e,t){if("Point"===e)return u(t);if("Line"===e)return d(t);if("Polygon"===e)return p(t);throw new Error("要素类型不匹配,无法解析注记选项!")},parsePointOptions:u,parseLineOptions:d,parsePolygonOptions:p,calcWrapsDetailText:s,createNoteBillBoardOptions:function(e,t,i,r){var a=n(t,r),o=r.positionOffsetXRate,s=r.positionOffsetYRate,l=r.textDefinition,h=r.scaleByDistance,c=r.distanceDisplayCondition;c=void 0===c?[r.maxScale,r.minScale].some(function(e){return void 0===e})?void 0:new Cesium.DistanceDisplayCondition(r.maxScale,r.minScale):r.distanceDisplayCondition;var u,d=r.heightReference||Cesium.HeightReference.NONE,p=r.disableDepthTestDistance||0,f=r.pixelOffsetScaleByDistance,m=r.translucencyByDistance,y=r.cshow,g=r.cposition,v=r.cpixelOffset,b=r.ceyeOffset,_=r.chorizontalOrigin,w=r.cverticalOrigin,x=r.cscale,C=r.xoffset,S=r.yoffset,M=r.angle,k=Cesium.Cartographic.fromCartesian(i);k.height=k.height+r.labelHeight,u=Cesium.Cartographic.toCartesian(k);var T=M/180*Math.PI,I=0,O=0;if("labels-layer"===r.type){var E=a.width;I=E/2*Math.cos(T),O=E/2*Math.sin(T)}return v&&(v=new Cesium.Cartesian2(v.x+I,v.y-O)),{show:y,image:a,position:g||u,id:e,pixelOffset:v||new Cesium.Cartesian2(C+I,S-O),eyeOffset:b,horizontalOrigin:_||o,verticalOrigin:w||s,rotation:T,scaleByDistance:h,scale:1/l*x,distanceDisplayCondition:c,heightReference:d,disableDepthTestDistance:p,pixelOffsetScaleByDistance:f,translucencyByDistance:m}},createLabelOptions:function(e,t,i,r){var n,a=r.positionOffsetXRate,l=r.positionOffsetYRate,h=r.xoffset,c=r.yoffset,u=r.angle,d=r.drawStyles,p=r.scaleByDistance,f=r.distanceDisplayCondition;f=void 0===f?[r.maxScale,r.minScale].some(function(e){return void 0===e})?void 0:new Cesium.DistanceDisplayCondition(r.maxScale,r.minScale):r.distanceDisplayCondition;var m=r.heightReference||Cesium.HeightReference.NONE,y=r.disableDepthTestDistance||0,g=r.pixelOffsetScaleByDistance,v=r.translucencyByDistance,b=r.cshow,_=r.cposition,w=r.ctext,x=r.cfont,C=r.cfillColor,S=r.coutlineColor,M=r.coutlineWidth,k=r.cshowBackground,T=r.cbackgroundColor,I=r.cbackgroundPadding,O=r.cpixelOffset,E=r.ceyeOffset,L=r.chorizontalOrigin,P=r.cverticalOrigin,R=r.cscale;n=0===r.drawMode?Cesium.LabelStyle.FILL:(r.drawMode,Cesium.LabelStyle.FILL_AND_OUTLINE);var j=new o(r.fontStyleOptions),A=t;r.textWraps&&(A=s(t,j,r.lineWidth,r.lineMaxNum));var z=Cesium.defaultValue(k,Cesium.defaultValue(r.showBackground,!1)),D=5,V=5;Cesium.defined(r.backgroundPadding)&&(Array.isArray(r.backgroundPadding)?(D=r.backgroundPadding[0],V=r.backgroundPadding[1]):(D=r.backgroundPadding,V=r.backgroundPadding));var N,G=Cesium.defaultValue(r.backgroundColor,"rgba(42,42,42,0.8)"),F=Cesium.Cartographic.fromCartesian(i);F.height=F.height+r.labelHeight,N=Cesium.Cartographic.toCartesian(F);var B=u/180*Math.PI;return{show:b,text:w||A,font:x||j.font,position:_||N,id:e,pixelOffset:O||new Cesium.Cartesian2(h,c),eyeOffset:E,horizontalOrigin:L||a,verticalOrigin:P||l,rotation:B,scaleByDistance:p,fillColor:C||Cesium.Color.fromCssColorString(d.color),outlineColor:S||Cesium.Color.fromCssColorString(d.haloColor),outlineWidth:M||0!==d.haloSize?d.haloSize:void 0,style:n,scale:R,showBackground:z,backgroundColor:T||Cesium.Color.fromCssColorString(G),backgroundPadding:I||new Cesium.Cartesian2(D,V),distanceDisplayCondition:f,heightReference:m,disableDepthTestDistance:y,pixelOffsetScaleByDistance:g,translucencyByDistance:v}},createGroundOptions:function(e,t,i,r){var a,o=n(t,r),s=r.positionOffsetXRate,l=r.positionOffsetYRate,h=r.textDefinition,c=r.groundScale,u=r.cscale,d=r.angle,p=new Image;p.src=o.toDataURL("image/png");var f,m=o.width?o.width*u*c:100,y=o.height?o.height*u*c:100,g=[new Cesium.Cartesian3(0,0,0),new Cesium.Cartesian3(m,0,0),new Cesium.Cartesian3(m,y,0),new Cesium.Cartesian3(0,y,0)],v=Cesium.Matrix4.IDENTITY.clone(),b=Cesium.Transforms.eastNorthUpToFixedFrame(i);1===s?Cesium.Matrix4.multiply(v,Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0,0,0)),v):-1===s?Cesium.Matrix4.multiply(v,Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(-m,0,0)),v):Cesium.Matrix4.multiply(v,Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(-m/2,0,0)),v),v=1===l?Cesium.Matrix4.multiply(v,Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0,-y,0)),v):-1===l?Cesium.Matrix4.multiply(v,Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0,0,0)),v):Cesium.Matrix4.multiply(v,Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0,-y/2,0)),v),Cesium.Matrix4.multiply(v,Cesium.Matrix4.fromScale(new Cesium.Cartesian3(1/h,1/h,1)),v),f=g.map(function(e){var t=Cesium.Matrix4.multiplyByPoint(b,Cesium.Matrix4.multiplyByPoint(v,e,v),new Cesium.Cartesian3),i=Cesium.Cartographic.fromCartesian(t);return Cesium.Cartographic.toCartesian(i)});var _=new Cesium.RectangleGeometry({rectangle:Cesium.Rectangle.fromCartesianArray(f),rotation:d*Math.PI/180,stRotation:d*Math.PI/180,height:1}),w=new Cesium.GeometryInstance({id:Cesium.createGuid(),geometry:_});return(a=new Cesium.GroundPrimitive({geometryInstances:w,asynchronous:!0,classificationType:Cesium.ClassificationType.TERRAIN,appearance:new Cesium.MaterialAppearance({material:new Cesium.Material({type:"MapGISLabelGround",fabric:{materials:{SwipeMaterial:{type:"MaskMaterial"},ImageMaterial:{type:"Image",uniforms:{image:p}}},components:{markCull:"SwipeMaterial.markCull",diffuse:"ImageMaterial.diffuse",alpha:"ImageMaterial.alpha"}}})}),swipeEnabled:r.swipeEnabled,swipeInverse:r.swipeInverse}))._cacheGroundRect=_.rectangle,a}};t.a=g},function(e,t,i){"use strict";(function(e,r){i.d(t,"a",function(){return X}),i.d(t,"b",function(){return Ji}),i.d(t,"c",function(){return pi}),i.d(t,"d",function(){return $i});var n={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},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.",example:{anchor:"viewport",color:"white",intensity:.4}},sources:{required:!0,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).",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}},layers:{required:!0,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"}}]}},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_geojson","source_video","source_image"],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://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},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 `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers."},"*":{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://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},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."},"*":{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://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},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"},"*":{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."},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)."},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 `{<sourceLayer>: <propertyName>}`."}},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:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},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",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.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",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",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",macos:"0.7.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",macos:"0.1.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`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},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:"A 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."},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_hillshade","layout_background"],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",macos:"0.1.0"}},"property-type":"constant"}},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",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.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",macos:"0.1.0"}},"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",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.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",macos:"0.1.0"}},"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",macos:"0.7.0"}},"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",macos:"0.5.0"}},"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",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"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",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.1.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",macos:"0.1.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",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.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",macos:"0.1.0"}},"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",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.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",macos:"0.1.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",macos:"0.1.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",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.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",macos:"0.12.0"}},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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.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",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",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",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.6.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",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.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",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.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.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.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",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.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",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.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",macos:"0.14.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",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.1.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 with point placement would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols with point placement 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. The order of elements in an array define priority order for the placement of an orientation variant.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.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",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.0"}},"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",macos:"0.1.0"}},"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",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},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'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.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"}}},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"}}},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",macos:"0.7.0"}}},match:{doc:'Selects the output whose label value matches the input value, or the fallback value if no match is found. The input can be any expression (e.g. `["get", "building_type"]`). Each label must be either:\n - a single literal value; or\n - an array of literal values, whose values must be all strings or all numbers (e.g. `[100, 101]` or `["c", "b"]`). The input matches if any of the values in the array matches, similar to the `"in"` operator.\nEach label must be unique. If 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",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.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",macos:"0.7.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<number>`, 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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.9.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",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns an `image` type for use in `icon-image`, `*-pattern` entries and as a section in the `format` expression. If set, the `image` argument will check that the requested image exists in the style and will return either the resolved image name or `null`, depending on whether or not the image 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.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.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 `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"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a 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, 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. 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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.0"}}},length:{doc:"Gets 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",macos:"0.7.0"}}},properties:{doc:'Gets 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",macos:"0.7.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"}}},"geometry-type":{doc:"Gets the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Gets 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",macos:"0.7.0"}}},zoom:{doc:'Gets 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:"Zoom","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"heatmap-density":{doc:"Gets 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",macos:"0.7.0"}}},"line-progress":{doc:"Gets 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",macos:"0.12.0"}}},accumulated:{doc:"Gets 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"}}},"+":{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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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":{android:"9.2.0",ios:"5.9.0",macos:"0.16.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.15.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"}}},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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.9.0"}}}}},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",macos:"0.5.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",macos:"0.5.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",macos:"0.5.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",macos:"0.5.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],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",macos:"0.1.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",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.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",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,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",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"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",macos:"0.5.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",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.5.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",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,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",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-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",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,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",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},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",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.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",macos:"0.1.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",macos:"0.2.1"}},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",macos:"0.6.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",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.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",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.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",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"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",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.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",macos:"0.9.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",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"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`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"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",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"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",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"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",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,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",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"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",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"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."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It 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."}}};var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{};function o(e,t){return e(t={exports:{}},t.exports),t.exports}var s=o(function(e,t){!function(i){var r=t&&!t.nodeType&&t,n=e&&!e.nodeType&&e,o="object"==typeof a&&a;o.global!==o&&o.window!==o&&o.self!==o||(i=o);var s,l,h=2147483647,c=36,u=1,d=26,p=38,f=700,m=72,y=128,g="-",v=/^xn--/,b=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=c-u,C=Math.floor,S=String.fromCharCode;function M(e){throw RangeError(w[e])}function k(e,t){for(var i=e.length,r=[];i--;)r[i]=t(e[i]);return r}function T(e,t){var i=e.split("@"),r="";return i.length>1&&(r=i[0]+"@",e=i[1]),r+k((e=e.replace(_,".")).split("."),t).join(".")}function I(e){for(var t,i,r=[],n=0,a=e.length;n<a;)(t=e.charCodeAt(n++))>=55296&&t<=56319&&n<a?56320==(64512&(i=e.charCodeAt(n++)))?r.push(((1023&t)<<10)+(1023&i)+65536):(r.push(t),n--):r.push(t);return r}function O(e){return k(e,function(e){var t="";return e>65535&&(t+=S((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=S(e)}).join("")}function E(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:c}function L(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function P(e,t,i){var r=0;for(e=i?C(e/f):e>>1,e+=C(e/t);e>x*d>>1;r+=c)e=C(e/x);return C(r+(x+1)*e/(e+p))}function R(e){var t,i,r,n,a,o,s,l,p,f,v=[],b=e.length,_=0,w=y,x=m;for((i=e.lastIndexOf(g))<0&&(i=0),r=0;r<i;++r)e.charCodeAt(r)>=128&&M("not-basic"),v.push(e.charCodeAt(r));for(n=i>0?i+1:0;n<b;){for(a=_,o=1,s=c;n>=b&&M("invalid-input"),((l=E(e.charCodeAt(n++)))>=c||l>C((h-_)/o))&&M("overflow"),_+=l*o,!(l<(p=s<=x?u:s>=x+d?d:s-x));s+=c)o>C(h/(f=c-p))&&M("overflow"),o*=f;x=P(_-a,t=v.length+1,0==a),C(_/t)>h-w&&M("overflow"),w+=C(_/t),_%=t,v.splice(_++,0,w)}return O(v)}function j(e){var t,i,r,n,a,o,s,l,p,f,v,b,_,w,x,k=[];for(b=(e=I(e)).length,t=y,i=0,a=m,o=0;o<b;++o)(v=e[o])<128&&k.push(S(v));for(r=n=k.length,n&&k.push(g);r<b;){for(s=h,o=0;o<b;++o)(v=e[o])>=t&&v<s&&(s=v);for(s-t>C((h-i)/(_=r+1))&&M("overflow"),i+=(s-t)*_,t=s,o=0;o<b;++o)if((v=e[o])<t&&++i>h&&M("overflow"),v==t){for(l=i,p=c;!(l<(f=p<=a?u:p>=a+d?d:p-a));p+=c)x=l-f,w=c-f,k.push(S(L(f+x%w,0))),l=C(x/w);k.push(S(L(l,0))),a=P(i,_,r==n),i=0,++r}++i,++t}return k.join("")}if(s={version:"1.3.2",ucs2:{decode:I,encode:O},decode:R,encode:j,toASCII:function(e){return T(e,function(e){return b.test(e)?"xn--"+j(e):e})},toUnicode:function(e){return T(e,function(e){return v.test(e)?R(e.slice(4).toLowerCase()):e})}},r&&n)if(e.exports==r)n.exports=s;else for(l in s)s.hasOwnProperty(l)&&(r[l]=s[l]);else i.punycode=s}(a)}),l={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}};function h(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var c=function(e,t,i,r){t=t||"&",i=i||"=";var n={};if("string"!=typeof e||0===e.length)return n;var a=/\+/g;e=e.split(t);var o=1e3;r&&"number"==typeof r.maxKeys&&(o=r.maxKeys);var s=e.length;o>0&&s>o&&(s=o);for(var l=0;l<s;++l){var c,u,d,p,f=e[l].replace(a,"%20"),m=f.indexOf(i);m>=0?(c=f.substr(0,m),u=f.substr(m+1)):(c=f,u=""),d=decodeURIComponent(c),p=decodeURIComponent(u),h(n,d)?Array.isArray(n[d])?n[d].push(p):n[d]=[n[d],p]:n[d]=p}return n},u=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},d=function(e,t,i,r){return t=t||"&",i=i||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(r){var n=encodeURIComponent(u(r))+i;return Array.isArray(e[r])?e[r].map(function(e){return n+encodeURIComponent(u(e))}).join(t):n+encodeURIComponent(u(e[r]))}).join(t):r?encodeURIComponent(u(r))+i+encodeURIComponent(u(e)):""},p=o(function(e,t){t.decode=t.parse=c,t.encode=t.stringify=d});p.decode,p.parse,p.encode,p.stringify;function f(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var m=/^([a-z0-9.+-]+:)/i,y=/:[0-9]*$/,g=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,v=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),b=["'"].concat(v),_=["%","/","?",";","#"].concat(b),w=["/","?","#"],x=/^[+a-z0-9A-Z_-]{0,63}$/,C=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,S={javascript:!0,"javascript:":!0},M={javascript:!0,"javascript:":!0},k={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function T(e,t,i){if(e&&l.isObject(e)&&e instanceof f)return e;var r=new f;return r.parse(e,t,i),r}f.prototype.parse=function(e,t,i){if(!l.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),n=-1!==r&&r<e.indexOf("#")?"?":"#",a=e.split(n);a[0]=a[0].replace(/\\/g,"/");var o=e=a.join(n);if(o=o.trim(),!i&&1===e.split("#").length){var h=g.exec(o);if(h)return this.path=o,this.href=o,this.pathname=h[1],h[2]?(this.search=h[2],this.query=t?p.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var c=m.exec(o);if(c){var u=(c=c[0]).toLowerCase();this.protocol=u,o=o.substr(c.length)}if(i||c||o.match(/^\/\/[^@\/]+@[^@\/]+/)){var d="//"===o.substr(0,2);!d||c&&M[c]||(o=o.substr(2),this.slashes=!0)}if(!M[c]&&(d||c&&!k[c])){for(var f,y,v=-1,T=0;T<w.length;T++){-1!==(I=o.indexOf(w[T]))&&(-1===v||I<v)&&(v=I)}-1!==(y=-1===v?o.lastIndexOf("@"):o.lastIndexOf("@",v))&&(f=o.slice(0,y),o=o.slice(y+1),this.auth=decodeURIComponent(f)),v=-1;for(T=0;T<_.length;T++){var I;-1!==(I=o.indexOf(_[T]))&&(-1===v||I<v)&&(v=I)}-1===v&&(v=o.length),this.host=o.slice(0,v),o=o.slice(v),this.parseHost(),this.hostname=this.hostname||"";var O="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!O)for(var E=this.hostname.split(/\./),L=(T=0,E.length);T<L;T++){var P=E[T];if(P&&!P.match(x)){for(var R="",j=0,A=P.length;j<A;j++)P.charCodeAt(j)>127?R+="x":R+=P[j];if(!R.match(x)){var z=E.slice(0,T),D=E.slice(T+1),V=P.match(C);V&&(z.push(V[1]),D.unshift(V[2])),D.length&&(o="/"+D.join(".")+o),this.hostname=z.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=s.toASCII(this.hostname));var N=this.port?":"+this.port:"",G=this.hostname||"";this.host=G+N,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!S[u])for(T=0,L=b.length;T<L;T++){var F=b[T];if(-1!==o.indexOf(F)){var B=encodeURIComponent(F);B===F&&(B=escape(F)),o=o.split(F).join(B)}}var q=o.indexOf("#");-1!==q&&(this.hash=o.substr(q),o=o.slice(0,q));var U=o.indexOf("?");if(-1!==U?(this.search=o.substr(U),this.query=o.substr(U+1),t&&(this.query=p.parse(this.query)),o=o.slice(0,U)):t&&(this.search="",this.query={}),o&&(this.pathname=o),k[u]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){N=this.pathname||"";var W=this.search||"";this.path=N+W}return this.href=this.format(),this},f.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",i=this.pathname||"",r=this.hash||"",n=!1,a="";this.host?n=e+this.host:this.hostname&&(n=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&l.isObject(this.query)&&Object.keys(this.query).length&&(a=p.stringify(this.query));var o=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||k[t])&&!1!==n?(n="//"+(n||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):n||(n=""),r&&"#"!==r.charAt(0)&&(r="#"+r),o&&"?"!==o.charAt(0)&&(o="?"+o),t+n+(i=i.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(o=o.replace("#","%23"))+r},f.prototype.resolve=function(e){return this.resolveObject(T(e,!1,!0)).format()},f.prototype.resolveObject=function(e){if(l.isString(e)){var t=new f;t.parse(e,!1,!0),e=t}for(var i=new f,r=Object.keys(this),n=0;n<r.length;n++){var a=r[n];i[a]=this[a]}if(i.hash=e.hash,""===e.href)return i.href=i.format(),i;if(e.slashes&&!e.protocol){for(var o=Object.keys(e),s=0;s<o.length;s++){var h=o[s];"protocol"!==h&&(i[h]=e[h])}return k[i.protocol]&&i.hostname&&!i.pathname&&(i.path=i.pathname="/"),i.href=i.format(),i}if(e.protocol&&e.protocol!==i.protocol){if(!k[e.protocol]){for(var c=Object.keys(e),u=0;u<c.length;u++){var d=c[u];i[d]=e[d]}return i.href=i.format(),i}if(i.protocol=e.protocol,e.host||M[e.protocol])i.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),i.pathname=p.join("/")}if(i.search=e.search,i.query=e.query,i.host=e.host||"",i.auth=e.auth,i.hostname=e.hostname||e.host,i.port=e.port,i.pathname||i.search){var m=i.pathname||"",y=i.search||"";i.path=m+y}return i.slashes=i.slashes||e.slashes,i.href=i.format(),i}var g=i.pathname&&"/"===i.pathname.charAt(0),v=e.host||e.pathname&&"/"===e.pathname.charAt(0),b=v||g||i.host&&e.pathname,_=b,w=i.pathname&&i.pathname.split("/")||[],x=(p=e.pathname&&e.pathname.split("/")||[],i.protocol&&!k[i.protocol]);if(x&&(i.hostname="",i.port=null,i.host&&(""===w[0]?w[0]=i.host:w.unshift(i.host)),i.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),b=b&&(""===p[0]||""===w[0])),v)i.host=e.host||""===e.host?e.host:i.host,i.hostname=e.hostname||""===e.hostname?e.hostname:i.hostname,i.search=e.search,i.query=e.query,w=p;else if(p.length)w||(w=[]),w.pop(),w=w.concat(p),i.search=e.search,i.query=e.query;else if(!l.isNullOrUndefined(e.search)){if(x)i.hostname=i.host=w.shift(),(O=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=O.shift(),i.host=i.hostname=O.shift());return i.search=e.search,i.query=e.query,l.isNull(i.pathname)&&l.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!w.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var C=w.slice(-1)[0],S=(i.host||e.host||w.length>1)&&("."===C||".."===C)||""===C,T=0,I=w.length;I>=0;I--)"."===(C=w[I])?w.splice(I,1):".."===C?(w.splice(I,1),T++):T&&(w.splice(I,1),T--);if(!b&&!_)for(;T--;T)w.unshift("..");!b||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),S&&"/"!==w.join("/").substr(-1)&&w.push("");var O,E=""===w[0]||w[0]&&"/"===w[0].charAt(0);x&&(i.hostname=i.host=E?"":w.length?w.shift():"",(O=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=O.shift(),i.host=i.hostname=O.shift()));return(b=b||i.host&&w.length)&&!E&&w.unshift(""),w.length?i.pathname=w.join("/"):(i.pathname=null,i.path=null),l.isNull(i.pathname)&&l.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=e.auth||i.auth,i.slashes=i.slashes||e.slashes,i.href=i.format(),i},f.prototype.parseHost=function(){var e=this.host,t=y.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};function I(e){for(var t=[],i=arguments.length-1;i-- >0;)t[i]=arguments[i+1];for(var r=0,n=t;r<n.length;r+=1){var a=n[r];for(var o in a)e[o]=a[o]}return e}var O=function(e){function t(t,i){e.call(this,i),this.message=i,this.key=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error),E=function(e,t){void 0===t&&(t=[]),this.parent=e,this.bindings={};for(var i=0,r=t;i<r.length;i+=1){var n=r[i],a=n[0],o=n[1];this.bindings[a]=o}};E.prototype.concat=function(e){return new E(this,e)},E.prototype.get=function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(e+" not found in scope.")},E.prototype.has=function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)};var L={kind:"null"},P={kind:"number"},R={kind:"string"},j={kind:"boolean"},A={kind:"color"},z={kind:"object"},D={kind:"value"},V={kind:"collator"},N={kind:"formatted"},G={kind:"resolvedImage"};function F(e,t){return{kind:"array",itemType:e,N:t}}function B(e){if("array"===e.kind){var t=B(e.itemType);return"number"==typeof e.N?"array<"+t+", "+e.N+">":"value"===e.itemType.kind?"array":"array<"+t+">"}return e.kind}var q=[L,P,R,j,A,N,z,F(D),G];function U(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!U(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(var i=0,r=q;i<r.length;i+=1){if(!U(r[i],t))return null}}return"Expected "+B(e)+" but found "+B(t)+" instead."}function W(e,t){return t.some(function(t){return t.kind===e.kind})}function H(e,t){return t.some(function(t){return"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e})}var Y=o(function(e,t){var i={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function r(e){return(e=Math.round(e))<0?0:e>255?255:e}function n(e){return e<0?0:e>1?1:e}function a(e){return"%"===e[e.length-1]?r(parseFloat(e)/100*255):r(parseInt(e))}function o(e){return"%"===e[e.length-1]?n(parseFloat(e)/100):n(parseFloat(e))}function s(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}try{t.parseCSSColor=function(e){var t,n=e.replace(/ /g,"").toLowerCase();if(n in i)return i[n].slice();if("#"===n[0])return 4===n.length?(t=parseInt(n.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===n.length&&(t=parseInt(n.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var l=n.indexOf("("),h=n.indexOf(")");if(-1!==l&&h+1===n.length){var c=n.substr(0,l),u=n.substr(l+1,h-(l+1)).split(","),d=1;switch(c){case"rgba":if(4!==u.length)return null;d=o(u.pop());case"rgb":return 3!==u.length?null:[a(u[0]),a(u[1]),a(u[2]),d];case"hsla":if(4!==u.length)return null;d=o(u.pop());case"hsl":if(3!==u.length)return null;var p=(parseFloat(u[0])%360+360)%360/360,f=o(u[1]),m=o(u[2]),y=m<=.5?m*(f+1):m+f-m*f,g=2*m-y;return[r(255*s(g,y,p+1/3)),r(255*s(g,y,p)),r(255*s(g,y,p-1/3)),d];default:return null}}return null}}catch(e){}}).parseCSSColor,X=function(e,t,i,r){void 0===r&&(r=1),this.r=e,this.g=t,this.b=i,this.a=r};X.parse=function(e){if(e){if(e instanceof X)return e;if("string"==typeof e){var t=Y(e);if(t)return new X(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},X.prototype.toString=function(){var e=this.toArray(),t=e[0],i=e[1],r=e[2],n=e[3];return"rgba("+Math.round(t)+","+Math.round(i)+","+Math.round(r)+","+n+")"},X.prototype.toArray=function(){var e=this.r,t=this.g,i=this.b,r=this.a;return 0===r?[0,0,0,0]:[255*e/r,255*t/r,255*i/r,r]},X.black=new X(0,0,0,1),X.white=new X(1,1,1,1),X.transparent=new X(0,0,0,0),X.red=new X(1,0,0,1);var J=function(e,t,i){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};J.prototype.compare=function(e,t){return this.collator.compare(e,t)},J.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var $=function(e,t,i,r,n){this.text=e,this.image=t,this.scale=i,this.fontStack=r,this.textColor=n},K=function(e){this.sections=e};K.fromString=function(e){return new K([new $(e,null,null,null,null)])},K.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some(function(e){return 0!==e.text.length||e.image&&0!==e.image.name.length})},K.factory=function(e){return e instanceof K?e:K.fromString(e)},K.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map(function(e){return e.text}).join("")},K.prototype.serialize=function(){for(var e=["format"],t=0,i=this.sections;t<i.length;t+=1){var r=i[t];if(r.image)e.push(["image",r.image.name]);else{e.push(r.text);var n={};r.fontStack&&(n["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(n["font-scale"]=r.scale),r.textColor&&(n["text-color"]=["rgba"].concat(r.textColor.toArray())),e.push(n)}}return e};var Z=function(e){this.name=e.name,this.available=e.available};function Q(e,t,i,r){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value ["+[e,t,i,r].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof r?[e,t,i,r]:[e,t,i]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ee(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof X)return!0;if(e instanceof J)return!0;if(e instanceof K)return!0;if(e instanceof Z)return!0;if(Array.isArray(e)){for(var t=0,i=e;t<i.length;t+=1){if(!ee(i[t]))return!1}return!0}if("object"==typeof e){for(var r in e)if(!ee(e[r]))return!1;return!0}return!1}function te(e){if(null===e)return L;if("string"==typeof e)return R;if("boolean"==typeof e)return j;if("number"==typeof e)return P;if(e instanceof X)return A;if(e instanceof J)return V;if(e instanceof K)return N;if(e instanceof Z)return G;if(Array.isArray(e)){for(var t,i=e.length,r=0,n=e;r<n.length;r+=1){var a=te(n[r]);if(t){if(t===a)continue;t=D;break}t=a}return F(t||D,i)}return z}function ie(e){var t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof X||e instanceof K||e instanceof Z?e.toString():JSON.stringify(e)}Z.prototype.toString=function(){return this.name},Z.fromString=function(e){return e?new Z({name:e,available:!1}):null},Z.prototype.serialize=function(){return["image",this.name]};var re=function(e,t){this.type=e,this.value=t};re.parse=function(e,t){if(2!==e.length)return t.error("'literal' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(!ee(e[1]))return t.error("invalid value");var i=e[1],r=te(i),n=t.expectedType;return"array"!==r.kind||0!==r.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(r=n),new re(r,i)},re.prototype.evaluate=function(){return this.value},re.prototype.eachChild=function(){},re.prototype.outputDefined=function(){return!0},re.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof X?["rgba"].concat(this.value.toArray()):this.value instanceof K?this.value.serialize():this.value};var ne=function(e){this.name="ExpressionEvaluationError",this.message=e};ne.prototype.toJSON=function(){return this.message};var ae={string:R,number:P,boolean:j,object:z},oe=function(e,t){this.type=e,this.args=t};oe.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var i,r=1,n=e[0];if("array"===n){var a,o;if(e.length>2){var s=e[1];if("string"!=typeof s||!(s in ae)||"object"===s)return t.error('The item type argument of "array" must be one of string, number, boolean',1);a=ae[s],r++}else a=D;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],r++}i=F(a,o)}else i=ae[n];for(var l=[];r<e.length;r++){var h=t.parse(e[r],r,D);if(!h)return null;l.push(h)}return new oe(i,l)},oe.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var i=this.args[t].evaluate(e);if(!U(this.type,te(i)))return i;if(t===this.args.length-1)throw new ne("Expected value to be of type "+B(this.type)+", but found "+B(te(i))+" instead.")}return null},oe.prototype.eachChild=function(e){this.args.forEach(e)},oe.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},oe.prototype.serialize=function(){var e=this.type,t=[e.kind];if("array"===e.kind){var i=e.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){t.push(i.kind);var r=e.N;("number"==typeof r||this.args.length>1)&&t.push(r)}}return t.concat(this.args.map(function(e){return e.serialize()}))};var se=function(e){this.type=N,this.sections=e};se.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var i=e[1];if(!Array.isArray(i)&&"object"==typeof i)return t.error("First argument must be an image or text section.");for(var r=[],n=!1,a=1;a<=e.length-1;++a){var o=e[a];if(n&&"object"==typeof o&&!Array.isArray(o)){n=!1;var s=null;if(o["font-scale"]&&!(s=t.parse(o["font-scale"],1,P)))return null;var l=null;if(o["text-font"]&&!(l=t.parse(o["text-font"],1,F(R))))return null;var h=null;if(o["text-color"]&&!(h=t.parse(o["text-color"],1,A)))return null;var c=r[r.length-1];c.scale=s,c.font=l,c.textColor=h}else{var u=t.parse(e[a],1,D);if(!u)return null;var d=u.type.kind;if("string"!==d&&"value"!==d&&"null"!==d&&"resolvedImage"!==d)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,r.push({content:u,scale:null,font:null,textColor:null})}}return new se(r)},se.prototype.evaluate=function(e){return new K(this.sections.map(function(t){var i=t.content.evaluate(e);return te(i)===G?new $("",i,null,null,null):new $(ie(i),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)}))},se.prototype.eachChild=function(e){for(var t=0,i=this.sections;t<i.length;t+=1){var r=i[t];e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}},se.prototype.outputDefined=function(){return!1},se.prototype.serialize=function(){for(var e=["format"],t=0,i=this.sections;t<i.length;t+=1){var r=i[t];e.push(r.content.serialize());var n={};r.scale&&(n["font-scale"]=r.scale.serialize()),r.font&&(n["text-font"]=r.font.serialize()),r.textColor&&(n["text-color"]=r.textColor.serialize()),e.push(n)}return e};var le=function(e){this.type=G,this.input=e};le.parse=function(e,t){if(2!==e.length)return t.error("Expected two arguments.");var i=t.parse(e[1],1,R);return i?new le(i):t.error("No image name provided.")},le.prototype.evaluate=function(e){var t=this.input.evaluate(e),i=Z.fromString(t);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(t)>-1),i},le.prototype.eachChild=function(e){e(this.input)},le.prototype.outputDefined=function(){return!1},le.prototype.serialize=function(){return["image",this.input.serialize()]};var he={"to-boolean":j,"to-color":A,"to-number":P,"to-string":R},ce=function(e,t){this.type=e,this.args=t};ce.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var i=e[0];if(("to-boolean"===i||"to-string"===i)&&2!==e.length)return t.error("Expected one argument.");for(var r=he[i],n=[],a=1;a<e.length;a++){var o=t.parse(e[a],a,D);if(!o)return null;n.push(o)}return new ce(r,n)},ce.prototype.evaluate=function(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){for(var t,i,r=0,n=this.args;r<n.length;r+=1){if(i=null,(t=n[r].evaluate(e))instanceof X)return t;if("string"==typeof t){var a=e.parseColor(t);if(a)return a}else if(Array.isArray(t)&&!(i=t.length<3||t.length>4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":Q(t[0],t[1],t[2],t[3])))return new X(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new ne(i||"Could not parse color from value '"+("string"==typeof t?t:String(JSON.stringify(t)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s<l.length;s+=1){if(null===(o=l[s].evaluate(e)))return 0;var h=Number(o);if(!isNaN(h))return h}throw new ne("Could not convert "+JSON.stringify(o)+" to number.")}return"formatted"===this.type.kind?K.fromString(ie(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?Z.fromString(ie(this.args[0].evaluate(e))):ie(this.args[0].evaluate(e))},ce.prototype.eachChild=function(e){this.args.forEach(e)},ce.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},ce.prototype.serialize=function(){if("formatted"===this.type.kind)return new se([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new le(this.args[0]).serialize();var e=["to-"+this.type.kind];return this.eachChild(function(t){e.push(t.serialize())}),e};var ue=["Unknown","Point","LineString","Polygon"],de=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};de.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},de.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?ue[this.feature.type]:this.feature.type:null},de.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},de.prototype.canonicalID=function(){return this.canonical},de.prototype.properties=function(){return this.feature&&this.feature.properties||{}},de.prototype.parseColor=function(e){var t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=X.parse(e)),t};var pe=function(e,t,i,r){this.name=e,this.type=t,this._evaluate=i,this.args=r};pe.prototype.evaluate=function(e){return this._evaluate(e,this.args)},pe.prototype.eachChild=function(e){this.args.forEach(e)},pe.prototype.outputDefined=function(){return!1},pe.prototype.serialize=function(){return[this.name].concat(this.args.map(function(e){return e.serialize()}))},pe.parse=function(e,t){var i,r=e[0],n=pe.definitions[r];if(!n)return t.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0);for(var a=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=o.filter(function(t){var i=t[0];return!Array.isArray(i)||i.length===e.length-1}),l=null,h=0,c=s;h<c.length;h+=1){var u=c[h],d=u[0],p=u[1];l=new Ve(t.registry,t.path,null,t.scope);for(var f=[],m=!1,y=1;y<e.length;y++){var g=e[y],v=Array.isArray(d)?d[y-1]:d.type,b=l.parse(g,1+f.length,v);if(!b){m=!0;break}f.push(b)}if(!m)if(Array.isArray(d)&&d.length!==f.length)l.error("Expected "+d.length+" arguments, but found "+f.length+" instead.");else{for(var _=0;_<f.length;_++){var w=Array.isArray(d)?d[_]:d.type,x=f[_];l.concat(_+1).checkSubtype(w,x.type)}if(0===l.errors.length)return new pe(r,a,p,f)}}if(1===s.length)(i=t.errors).push.apply(i,l.errors);else{for(var C=(s.length?s:o).map(function(e){return function(e){return Array.isArray(e)?"("+e.map(B).join(", ")+")":"("+B(e.type)+"...)"}(e[0])}).join(" | "),S=[],M=1;M<e.length;M++){var k=t.parse(e[M],1+S.length);if(!k)return null;S.push(B(k.type))}t.error("Expected arguments of type "+C+", but found ("+S.join(", ")+") instead.")}return null},pe.register=function(e,t){for(var i in pe.definitions=t,t)e[i]=pe};var fe=function(e,t,i){this.type=V,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=t};fe.parse=function(e,t){if(2!==e.length)return t.error("Expected one argument.");var i=e[1];if("object"!=typeof i||Array.isArray(i))return t.error("Collator options argument must be an object.");var r=t.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,j);if(!r)return null;var n=t.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,j);if(!n)return null;var a=null;return i.locale&&!(a=t.parse(i.locale,1,R))?null:new fe(r,n,a)},fe.prototype.evaluate=function(e){return new J(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},fe.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},fe.prototype.outputDefined=function(){return!1},fe.prototype.serialize=function(){var e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]};var me=8192;function ye(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function ge(e,t){return!(e[0]<=t[0])&&(!(e[2]>=t[2])&&(!(e[1]<=t[1])&&!(e[3]>=t[3])))}function ve(e,t){var i=function(e){return(180+e)/360}(e[0]),r=function(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}(e[1]),n=Math.pow(2,t.z);return[Math.round(i*n*me),Math.round(r*n*me)]}function be(e,t,i){var r=e[0]-t[0],n=e[1]-t[1],a=e[0]-i[0],o=e[1]-i[1];return r*o-a*n==0&&r*a<=0&&n*o<=0}function _e(e,t,i){return t[1]>e[1]!=i[1]>e[1]&&e[0]<(i[0]-t[0])*(e[1]-t[1])/(i[1]-t[1])+t[0]}function we(e,t){for(var i=!1,r=0,n=t.length;r<n;r++)for(var a=t[r],o=0,s=a.length;o<s-1;o++){if(be(e,a[o],a[o+1]))return!1;_e(e,a[o],a[o+1])&&(i=!i)}return i}function xe(e,t){for(var i=0;i<t.length;i++)if(we(e,t[i]))return!0;return!1}function Ce(e,t,i,r){var n=e[0]-i[0],a=e[1]-i[1],o=t[0]-i[0],s=t[1]-i[1],l=r[0]-i[0],h=r[1]-i[1],c=n*h-l*a,u=o*h-l*s;return c>0&&u<0||c<0&&u>0}function Se(e,t,i,r){var n=[t[0]-e[0],t[1]-e[1]];return 0!==function(e,t){return e[0]*t[1]-e[1]*t[0]}([r[0]-i[0],r[1]-i[1]],n)&&!(!Ce(e,t,i,r)||!Ce(i,r,e,t))}function Me(e,t,i){for(var r=0,n=i;r<n.length;r+=1)for(var a=n[r],o=0;o<a.length-1;++o)if(Se(e,t,a[o],a[o+1]))return!0;return!1}function ke(e,t){for(var i=0;i<e.length;++i)if(!we(e[i],t))return!1;for(var r=0;r<e.length-1;++r)if(Me(e[r],e[r+1],t))return!1;return!0}function Te(e,t){for(var i=0;i<t.length;i++)if(ke(e,t[i]))return!0;return!1}function Ie(e,t,i){for(var r=[],n=0;n<e.length;n++){for(var a=[],o=0;o<e[n].length;o++){var s=ve(e[n][o],i);ye(t,s),a.push(s)}r.push(a)}return r}function Oe(e,t,i){for(var r=[],n=0;n<e.length;n++){var a=Ie(e[n],t,i);r.push(a)}return r}function Ee(e,t,i,r){if(e[0]<i[0]||e[0]>i[2]){var n=.5*r,a=e[0]-i[0]>n?-r:i[0]-e[0]>n?r:0;0===a&&(a=e[0]-i[2]>n?-r:i[2]-e[0]>n?r:0),e[0]+=a}ye(t,e)}function Le(e,t,i,r){for(var n=Math.pow(2,r.z)*me,a=[r.x*me,r.y*me],o=[],s=0,l=e;s<l.length;s+=1)for(var h=0,c=l[s];h<c.length;h+=1){var u=c[h],d=[u.x+a[0],u.y+a[1]];Ee(d,t,i,n),o.push(d)}return o}function Pe(e,t,i,r){for(var n=Math.pow(2,r.z)*me,a=[r.x*me,r.y*me],o=[],s=0,l=e;s<l.length;s+=1){for(var h=[],c=0,u=l[s];c<u.length;c+=1){var d=u[c],p=[d.x+a[0],d.y+a[1]];ye(t,p),h.push(p)}o.push(h)}if(t[2]-t[0]<=n/2){!function(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}(t);for(var f=0,m=o;f<m.length;f+=1)for(var y=0,g=m[f];y<g.length;y+=1){Ee(g[y],t,i,n)}}return o}var Re=function(e,t){this.type=j,this.geojson=e,this.geometries=t};function je(e){if(e instanceof pe){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof Re)return!1;var t=!0;return e.eachChild(function(e){t&&!je(e)&&(t=!1)}),t}function Ae(e){if(e instanceof pe&&"feature-state"===e.name)return!1;var t=!0;return e.eachChild(function(e){t&&!Ae(e)&&(t=!1)}),t}function ze(e,t){if(e instanceof pe&&t.indexOf(e.name)>=0)return!1;var i=!0;return e.eachChild(function(e){i&&!ze(e,t)&&(i=!1)}),i}Re.parse=function(e,t){if(2!==e.length)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(ee(e[1])){var i=e[1];if("FeatureCollection"===i.type)for(var r=0;r<i.features.length;++r){var n=i.features[r].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new Re(i,i.features[r].geometry)}else if("Feature"===i.type){var a=i.geometry.type;if("Polygon"===a||"MultiPolygon"===a)return new Re(i,i.geometry)}else if("Polygon"===i.type||"MultiPolygon"===i.type)return new Re(i,i)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Re.prototype.evaluate=function(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){var i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){var a=Ie(t.coordinates,r,n),o=Le(e.geometry(),i,r,n);if(!ge(i,r))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!we(l[s],a))return!1}if("MultiPolygon"===t.type){var h=Oe(t.coordinates,r,n),c=Le(e.geometry(),i,r,n);if(!ge(i,r))return!1;for(var u=0,d=c;u<d.length;u+=1)if(!xe(d[u],h))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){var i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){var a=Ie(t.coordinates,r,n),o=Pe(e.geometry(),i,r,n);if(!ge(i,r))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!ke(l[s],a))return!1}if("MultiPolygon"===t.type){var h=Oe(t.coordinates,r,n),c=Pe(e.geometry(),i,r,n);if(!ge(i,r))return!1;for(var u=0,d=c;u<d.length;u+=1)if(!Te(d[u],h))return!1}return!0}(e,this.geometries)}return!1},Re.prototype.eachChild=function(){},Re.prototype.outputDefined=function(){return!0},Re.prototype.serialize=function(){return["within",this.geojson]};var De=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};De.parse=function(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");var i=e[1];return t.scope.has(i)?new De(i,t.scope.get(i)):t.error('Unknown variable "'+i+'". Make sure "'+i+'" has been bound in an enclosing "let" expression before using it.',1)},De.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},De.prototype.eachChild=function(){},De.prototype.outputDefined=function(){return!1},De.prototype.serialize=function(){return["var",this.name]};var Ve=function(e,t,i,r,n){void 0===t&&(t=[]),void 0===r&&(r=new E),void 0===n&&(n=[]),this.registry=e,this.path=t,this.key=t.map(function(e){return"["+e+"]"}).join(""),this.scope=r,this.errors=n,this.expectedType=i};function Ne(e,t){for(var i,r,n=e.length-1,a=0,o=n,s=0;a<=o;)if(i=e[s=Math.floor((a+o)/2)],r=e[s+1],i<=t){if(s===n||t<r)return s;a=s+1}else{if(!(i>t))throw new ne("Input is not a number.");o=s-1}return 0}Ve.prototype.parse=function(e,t,i,r,n){return void 0===n&&(n={}),t?this.concat(t,i,r)._parse(e,n):this._parse(e,n)},Ve.prototype._parse=function(e,t){function i(e,t,i){return"assert"===i?new oe(t,[e]):"coerce"===i?new ce(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var r=e[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[r];if(n){var a=n.parse(e,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=i(a,o,t.typeAnnotation||"coerce");else a=i(a,o,t.typeAnnotation||"assert")}if(!(a instanceof re)&&"resolvedImage"!==a.type.kind&&function e(t){if(t instanceof De)return e(t.boundExpression);if(t instanceof pe&&"error"===t.name)return!1;if(t instanceof fe)return!1;if(t instanceof Re)return!1;var i=t instanceof ce||t instanceof oe;var r=!0;t.eachChild(function(t){r=i?r&&e(t):r&&t instanceof re});if(!r)return!1;return je(t)&&ze(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(a)){var l=new de;try{a=new re(a.type,a.evaluate(l))}catch(e){return this.error(e.message),null}}return a}return this.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof e+" instead.")},Ve.prototype.concat=function(e,t,i){var r="number"==typeof e?this.path.concat(e):this.path,n=i?this.scope.concat(i):this.scope;return new Ve(this.registry,r,t||null,n,this.errors)},Ve.prototype.error=function(e){for(var t=[],i=arguments.length-1;i-- >0;)t[i]=arguments[i+1];var r=""+this.key+t.map(function(e){return"["+e+"]"}).join("");this.errors.push(new O(r,e))},Ve.prototype.checkSubtype=function(e,t){var i=U(e,t);return i&&this.error(i),i};var Ge=function(e,t,i){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var r=0,n=i;r<n.length;r+=1){var a=n[r],o=a[0],s=a[1];this.labels.push(o),this.outputs.push(s)}};Ge.parse=function(e,t){if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");var i=t.parse(e[1],1,P);if(!i)return null;var r=[],n=null;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(var a=1;a<e.length;a+=2){var o=1===a?-1/0:e[a],s=e[a+1],l=a,h=a+1;if("number"!=typeof o)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(r.length&&r[r.length-1][0]>=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=t.parse(s,h,n);if(!c)return null;n=n||c.type,r.push([o,c])}return new Ge(n,i,r)},Ge.prototype.evaluate=function(e){var t=this.labels,i=this.outputs;if(1===t.length)return i[0].evaluate(e);var r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);var n=t.length;return r>=t[n-1]?i[n-1].evaluate(e):i[Ne(t,r)].evaluate(e)},Ge.prototype.eachChild=function(e){e(this.input);for(var t=0,i=this.outputs;t<i.length;t+=1){e(i[t])}},Ge.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})},Ge.prototype.serialize=function(){for(var e=["step",this.input.serialize()],t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var Fe=Be;function Be(e,t,i,r){this.cx=3*e,this.bx=3*(i-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(r-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=i,this.p2y=r}function qe(e,t,i){return e*(1-i)+t*i}Be.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},Be.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},Be.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},Be.prototype.solveCurveX=function(e,t){var i,r,n,a,o;for(void 0===t&&(t=1e-6),n=e,o=0;o<8;o++){if(a=this.sampleCurveX(n)-e,Math.abs(a)<t)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=a/s}if(r=1,(n=e)<(i=0))return i;if(n>r)return r;for(;i<r;){if(a=this.sampleCurveX(n),Math.abs(a-e)<t)return n;e>a?i=n:r=n,n=.5*(r-i)+i}return n},Be.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var Ue=Object.freeze({__proto__:null,number:qe,color:function(e,t,i){return new X(qe(e.r,t.r,i),qe(e.g,t.g,i),qe(e.b,t.b,i),qe(e.a,t.a,i))},array:function(e,t,i){return e.map(function(e,r){return qe(e,t[r],i)})}}),We=.95047,He=1,Ye=1.08883,Xe=4/29,Je=6/29,$e=3*Je*Je,Ke=Je*Je*Je,Ze=Math.PI/180,Qe=180/Math.PI;function et(e){return e>Ke?Math.pow(e,1/3):e/$e+Xe}function tt(e){return e>Je?e*e*e:$e*(e-Xe)}function it(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function rt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function nt(e){var t=rt(e.r),i=rt(e.g),r=rt(e.b),n=et((.4124564*t+.3575761*i+.1804375*r)/We),a=et((.2126729*t+.7151522*i+.072175*r)/He);return{l:116*a-16,a:500*(n-a),b:200*(a-et((.0193339*t+.119192*i+.9503041*r)/Ye)),alpha:e.a}}function at(e){var t=(e.l+16)/116,i=isNaN(e.a)?t:t+e.a/500,r=isNaN(e.b)?t:t-e.b/200;return t=He*tt(t),i=We*tt(i),r=Ye*tt(r),new X(it(3.2404542*i-1.5371385*t-.4985314*r),it(-.969266*i+1.8760108*t+.041556*r),it(.0556434*i-.2040259*t+1.0572252*r),e.alpha)}var ot={forward:nt,reverse:at,interpolate:function(e,t,i){return{l:qe(e.l,t.l,i),a:qe(e.a,t.a,i),b:qe(e.b,t.b,i),alpha:qe(e.alpha,t.alpha,i)}}},st={forward:function(e){var t=nt(e),i=t.l,r=t.a,n=t.b,a=Math.atan2(n,r)*Qe;return{h:a<0?a+360:a,c:Math.sqrt(r*r+n*n),l:i,alpha:e.a}},reverse:function(e){var t=e.h*Ze,i=e.c;return at({l:e.l,a:Math.cos(t)*i,b:Math.sin(t)*i,alpha:e.alpha})},interpolate:function(e,t,i){return{h:function(e,t,i){var r=t-e;return e+i*(r>180||r<-180?r-360*Math.round(r/360):r)}(e.h,t.h,i),c:qe(e.c,t.c,i),l:qe(e.l,t.l,i),alpha:qe(e.alpha,t.alpha,i)}}},lt=Object.freeze({__proto__:null,lab:ot,hcl:st}),ht=function(e,t,i,r,n){this.type=e,this.operator=t,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(var a=0,o=n;a<o.length;a+=1){var s=o[a],l=s[0],h=s[1];this.labels.push(l),this.outputs.push(h)}};function ct(e,t,i,r){var n=r-i,a=e-i;return 0===n?0:1===t?a/n:(Math.pow(t,a)-1)/(Math.pow(t,n)-1)}ht.interpolationFactor=function(e,t,i,r){var n=0;if("exponential"===e.name)n=ct(t,e.base,i,r);else if("linear"===e.name)n=ct(t,1,i,r);else if("cubic-bezier"===e.name){var a=e.controlPoints;n=new Fe(a[0],a[1],a[2],a[3]).solve(ct(t,1,i,r))}return n},ht.parse=function(e,t){var i=e[0],r=e[1],n=e[2],a=e.slice(3);if(!Array.isArray(r)||0===r.length)return t.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){var o=r[1];if("number"!=typeof o)return t.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:o}}else{if("cubic-bezier"!==r[0])return t.error("Unknown interpolation type "+String(r[0]),1,0);var s=r.slice(1);if(4!==s.length||s.some(function(e){return"number"!=typeof e||e<0||e>1}))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:s}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(n=t.parse(n,2,P)))return null;var l=[],h=null;"interpolate-hcl"===i||"interpolate-lab"===i?h=A:t.expectedType&&"value"!==t.expectedType.kind&&(h=t.expectedType);for(var c=0;c<a.length;c+=2){var u=a[c],d=a[c+1],p=c+3,f=c+4;if("number"!=typeof u)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(l.length&&l[l.length-1][0]>=u)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var m=t.parse(d,f,h);if(!m)return null;h=h||m.type,l.push([u,m])}return"number"===h.kind||"color"===h.kind||"array"===h.kind&&"number"===h.itemType.kind&&"number"==typeof h.N?new ht(h,i,r,n,l):t.error("Type "+B(h)+" is not interpolatable.")},ht.prototype.evaluate=function(e){var t=this.labels,i=this.outputs;if(1===t.length)return i[0].evaluate(e);var r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);var n=t.length;if(r>=t[n-1])return i[n-1].evaluate(e);var a=Ne(t,r),o=t[a],s=t[a+1],l=ht.interpolationFactor(this.interpolation,r,o,s),h=i[a].evaluate(e),c=i[a+1].evaluate(e);return"interpolate"===this.operator?Ue[this.type.kind.toLowerCase()](h,c,l):"interpolate-hcl"===this.operator?st.reverse(st.interpolate(st.forward(h),st.forward(c),l)):ot.reverse(ot.interpolate(ot.forward(h),ot.forward(c),l))},ht.prototype.eachChild=function(e){e(this.input);for(var t=0,i=this.outputs;t<i.length;t+=1){e(i[t])}},ht.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})},ht.prototype.serialize=function(){var e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var t=[this.operator,e,this.input.serialize()],i=0;i<this.labels.length;i++)t.push(this.labels[i],this.outputs[i].serialize());return t};var ut=function(e,t){this.type=e,this.args=t};ut.parse=function(e,t){if(e.length<2)return t.error("Expectected at least one argument.");var i=null,r=t.expectedType;r&&"value"!==r.kind&&(i=r);for(var n=[],a=0,o=e.slice(1);a<o.length;a+=1){var s=o[a],l=t.parse(s,1+n.length,i,void 0,{typeAnnotation:"omit"});if(!l)return null;i=i||l.type,n.push(l)}var h=r&&n.some(function(e){return U(r,e.type)});return new ut(h?D:i,n)},ut.prototype.evaluate=function(e){for(var t,i=null,r=0,n=0,a=this.args;n<a.length;n+=1){if(r++,(i=a[n].evaluate(e))&&i instanceof Z&&!i.available&&(t||(t=i.name),i=null,r===this.args.length&&(i=t)),null!==i)break}return i},ut.prototype.eachChild=function(e){this.args.forEach(e)},ut.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},ut.prototype.serialize=function(){var e=["coalesce"];return this.eachChild(function(t){e.push(t.serialize())}),e};var dt=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};dt.prototype.evaluate=function(e){return this.result.evaluate(e)},dt.prototype.eachChild=function(e){for(var t=0,i=this.bindings;t<i.length;t+=1){e(i[t][1])}e(this.result)},dt.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found "+(e.length-1)+" instead.");for(var i=[],r=1;r<e.length-1;r+=2){var n=e[r];if("string"!=typeof n)return t.error("Expected string, but found "+typeof n+" instead.",r);if(/[^a-zA-Z0-9_]/.test(n))return t.error("Variable names must contain only alphanumeric characters or '_'.",r);var a=t.parse(e[r+1],r+1);if(!a)return null;i.push([n,a])}var o=t.parse(e[e.length-1],e.length-1,t.expectedType,i);return o?new dt(i,o):null},dt.prototype.outputDefined=function(){return this.result.outputDefined()},dt.prototype.serialize=function(){for(var e=["let"],t=0,i=this.bindings;t<i.length;t+=1){var r=i[t],n=r[0],a=r[1];e.push(n,a.serialize())}return e.push(this.result.serialize()),e};var pt=function(e,t,i){this.type=e,this.index=t,this.input=i};pt.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var i=t.parse(e[1],1,P),r=t.parse(e[2],2,F(t.expectedType||D));if(!i||!r)return null;var n=r.type;return new pt(n.itemType,i,r)},pt.prototype.evaluate=function(e){var t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0)throw new ne("Array index out of bounds: "+t+" < 0.");if(t>=i.length)throw new ne("Array index out of bounds: "+t+" > "+(i.length-1)+".");if(t!==Math.floor(t))throw new ne("Array index must be an integer, but found "+t+" instead.");return i[t]},pt.prototype.eachChild=function(e){e(this.index),e(this.input)},pt.prototype.outputDefined=function(){return!1},pt.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var ft=function(e,t){this.type=j,this.needle=e,this.haystack=t};ft.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var i=t.parse(e[1],1,D),r=t.parse(e[2],2,D);return i&&r?W(i.type,[j,R,P,L,D])?new ft(i,r):t.error("Expected first argument to be of type boolean, string, number or null, but found "+B(i.type)+" instead"):null},ft.prototype.evaluate=function(e){var t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!H(t,["boolean","string","number","null"]))throw new ne("Expected first argument to be of type boolean, string, number or null, but found "+B(te(t))+" instead.");if(!H(i,["string","array"]))throw new ne("Expected second argument to be of type array or string, but found "+B(te(i))+" instead.");return i.indexOf(t)>=0},ft.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},ft.prototype.outputDefined=function(){return!0},ft.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var mt=function(e,t,i){this.type=P,this.needle=e,this.haystack=t,this.fromIndex=i};mt.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var i=t.parse(e[1],1,D),r=t.parse(e[2],2,D);if(!i||!r)return null;if(!W(i.type,[j,R,P,L,D]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+B(i.type)+" instead");if(4===e.length){var n=t.parse(e[3],3,P);return n?new mt(i,r,n):null}return new mt(i,r)},mt.prototype.evaluate=function(e){var t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!H(t,["boolean","string","number","null"]))throw new ne("Expected first argument to be of type boolean, string, number or null, but found "+B(te(t))+" instead.");if(!H(i,["string","array"]))throw new ne("Expected second argument to be of type array or string, but found "+B(te(i))+" instead.");if(this.fromIndex){var r=this.fromIndex.evaluate(e);return i.indexOf(t,r)}return i.indexOf(t)},mt.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},mt.prototype.outputDefined=function(){return!1},mt.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var yt=function(e,t,i,r,n,a){this.inputType=e,this.type=t,this.input=i,this.cases=r,this.outputs=n,this.otherwise=a};yt.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!=1)return t.error("Expected an even number of arguments.");var i,r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);for(var n={},a=[],o=2;o<e.length-1;o+=2){var s=e[o],l=e[o+1];Array.isArray(s)||(s=[s]);var h=t.concat(o);if(0===s.length)return h.error("Expected at least one branch label.");for(var c=0,u=s;c<u.length;c+=1){var d=u[c];if("number"!=typeof d&&"string"!=typeof d)return h.error("Branch labels must be numbers or strings.");if("number"==typeof d&&Math.abs(d)>Number.MAX_SAFE_INTEGER)return h.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof d&&Math.floor(d)!==d)return h.error("Numeric branch labels must be integer values.");if(i){if(h.checkSubtype(i,te(d)))return null}else i=te(d);if(void 0!==n[String(d)])return h.error("Branch labels must be unique.");n[String(d)]=a.length}var p=t.parse(l,o,r);if(!p)return null;r=r||p.type,a.push(p)}var f=t.parse(e[1],1,D);if(!f)return null;var m=t.parse(e[e.length-1],e.length-1,r);return m?"value"!==f.type.kind&&t.concat(1).checkSubtype(i,f.type)?null:new yt(i,r,f,n,a,m):null},yt.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(te(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},yt.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},yt.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})&&this.otherwise.outputDefined()},yt.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],i=[],r={},n=0,a=Object.keys(this.cases).sort();n<a.length;n+=1){var o=a[n];void 0===(u=r[this.cases[o]])?(r[this.cases[o]]=i.length,i.push([this.cases[o],[o]])):i[u][1].push(o)}for(var s=function(t){return"number"===e.inputType.kind?Number(t):t},l=0,h=i;l<h.length;l+=1){var c=h[l],u=c[0],d=c[1];1===d.length?t.push(s(d[0])):t.push(d.map(s)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var gt=function(e,t,i){this.type=e,this.branches=t,this.otherwise=i};gt.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found only "+(e.length-1)+".");if(e.length%2!=0)return t.error("Expected an odd number of arguments.");var i;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);for(var r=[],n=1;n<e.length-1;n+=2){var a=t.parse(e[n],n,j);if(!a)return null;var o=t.parse(e[n+1],n+1,i);if(!o)return null;r.push([a,o]),i=i||o.type}var s=t.parse(e[e.length-1],e.length-1,i);return s?new gt(i,r,s):null},gt.prototype.evaluate=function(e){for(var t=0,i=this.branches;t<i.length;t+=1){var r=i[t],n=r[0],a=r[1];if(n.evaluate(e))return a.evaluate(e)}return this.otherwise.evaluate(e)},gt.prototype.eachChild=function(e){for(var t=0,i=this.branches;t<i.length;t+=1){var r=i[t],n=r[0],a=r[1];e(n),e(a)}e(this.otherwise)},gt.prototype.outputDefined=function(){return this.branches.every(function(e){e[0];return e[1].outputDefined()})&&this.otherwise.outputDefined()},gt.prototype.serialize=function(){var e=["case"];return this.eachChild(function(t){e.push(t.serialize())}),e};var vt=function(e,t,i,r){this.type=e,this.input=t,this.beginIndex=i,this.endIndex=r};function bt(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function _t(e,t,i,r){return 0===r.compare(t,i)}function wt(e,t,i){var r="=="!==e&&"!="!==e;return function(){function n(e,t,i){this.type=j,this.lhs=e,this.rhs=t,this.collator=i,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}return n.parse=function(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");var i=e[0],a=t.parse(e[1],1,D);if(!a)return null;if(!bt(i,a.type))return t.concat(1).error('"'+i+"\" comparisons are not supported for type '"+B(a.type)+"'.");var o=t.parse(e[2],2,D);if(!o)return null;if(!bt(i,o.type))return t.concat(2).error('"'+i+"\" comparisons are not supported for type '"+B(o.type)+"'.");if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot compare types '"+B(a.type)+"' and '"+B(o.type)+"'.");r&&("value"===a.type.kind&&"value"!==o.type.kind?a=new oe(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new oe(a.type,[o])));var s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(s=t.parse(e[3],3,V)))return null}return new n(a,o,s)},n.prototype.evaluate=function(n){var a=this.lhs.evaluate(n),o=this.rhs.evaluate(n);if(r&&this.hasUntypedArgument){var s=te(a),l=te(o);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new ne('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!r&&this.hasUntypedArgument){var h=te(a),c=te(o);if("string"!==h.kind||"string"!==c.kind)return t(n,a,o)}return this.collator?i(n,a,o,this.collator.evaluate(n)):t(n,a,o)},n.prototype.eachChild=function(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)},n.prototype.outputDefined=function(){return!0},n.prototype.serialize=function(){var t=[e];return this.eachChild(function(e){t.push(e.serialize())}),t},n}()}vt.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var i=t.parse(e[1],1,D),r=t.parse(e[2],2,P);if(!i||!r)return null;if(!W(i.type,[F(D),R,D]))return t.error("Expected first argument to be of type array or string, but found "+B(i.type)+" instead");if(4===e.length){var n=t.parse(e[3],3,P);return n?new vt(i.type,i,r,n):null}return new vt(i.type,i,r)},vt.prototype.evaluate=function(e){var t=this.input.evaluate(e),i=this.beginIndex.evaluate(e);if(!H(t,["string","array"]))throw new ne("Expected first argument to be of type array or string, but found "+B(te(t))+" instead.");if(this.endIndex){var r=this.endIndex.evaluate(e);return t.slice(i,r)}return t.slice(i)},vt.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},vt.prototype.outputDefined=function(){return!1},vt.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var xt=wt("==",function(e,t,i){return t===i},_t),Ct=wt("!=",function(e,t,i){return t!==i},function(e,t,i,r){return!_t(0,t,i,r)}),St=wt("<",function(e,t,i){return t<i},function(e,t,i,r){return r.compare(t,i)<0}),Mt=wt(">",function(e,t,i){return t>i},function(e,t,i,r){return r.compare(t,i)>0}),kt=wt("<=",function(e,t,i){return t<=i},function(e,t,i,r){return r.compare(t,i)<=0}),Tt=wt(">=",function(e,t,i){return t>=i},function(e,t,i,r){return r.compare(t,i)>=0}),It=function(e,t,i,r,n){this.type=R,this.number=e,this.locale=t,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=n};It.parse=function(e,t){if(3!==e.length)return t.error("Expected two arguments.");var i=t.parse(e[1],1,P);if(!i)return null;var r=e[2];if("object"!=typeof r||Array.isArray(r))return t.error("NumberFormat options argument must be an object.");var n=null;if(r.locale&&!(n=t.parse(r.locale,1,R)))return null;var a=null;if(r.currency&&!(a=t.parse(r.currency,1,R)))return null;var o=null;if(r["min-fraction-digits"]&&!(o=t.parse(r["min-fraction-digits"],1,P)))return null;var s=null;return r["max-fraction-digits"]&&!(s=t.parse(r["max-fraction-digits"],1,P))?null:new It(i,n,a,o,s)},It.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},It.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},It.prototype.outputDefined=function(){return!1},It.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var Ot=function(e){this.type=P,this.input=e};Ot.parse=function(e,t){if(2!==e.length)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var i=t.parse(e[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?t.error("Expected argument of type string or array, but found "+B(i.type)+" instead."):new Ot(i):null},Ot.prototype.evaluate=function(e){var t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new ne("Expected value to be of type string or array, but found "+B(te(t))+" instead.")},Ot.prototype.eachChild=function(e){e(this.input)},Ot.prototype.outputDefined=function(){return!1},Ot.prototype.serialize=function(){var e=["length"];return this.eachChild(function(t){e.push(t.serialize())}),e};var Et={"==":xt,"!=":Ct,">":Mt,"<":St,">=":Tt,"<=":kt,array:oe,at:pt,boolean:oe,case:gt,coalesce:ut,collator:fe,format:se,image:le,in:ft,"index-of":mt,interpolate:ht,"interpolate-hcl":ht,"interpolate-lab":ht,length:Ot,let:dt,literal:re,match:yt,number:oe,"number-format":It,object:oe,slice:vt,step:Ge,string:oe,"to-boolean":ce,"to-color":ce,"to-number":ce,"to-string":ce,var:De,within:Re};function Lt(e,t){var i=t[0],r=t[1],n=t[2],a=t[3];i=i.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);var o=a?a.evaluate(e):1,s=Q(i,r,n,o);if(s)throw new ne(s);return new X(i/255*o,r/255*o,n/255*o,o)}function Pt(e,t){return e in t}function Rt(e,t){var i=t[e];return void 0===i?null:i}function jt(e){return{type:e}}function At(e){return{result:"success",value:e}}function zt(e){return{result:"error",value:e}}function Dt(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function Vt(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function Nt(e){return!!e.expression&&e.expression.interpolated}function Gt(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function Ft(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Bt(e){return e}function qt(e,t){var i,r,n,a="color"===t.type,o=e.stops&&"object"==typeof e.stops[0][0],s=o||void 0!==e.property,l=o||!s,h=e.type||(Nt(t)?"exponential":"interval");if(a&&((e=I({},e)).stops&&(e.stops=e.stops.map(function(e){return[e[0],X.parse(e[1])]})),e.default?e.default=X.parse(e.default):e.default=X.parse(t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!lt[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===h)i=Yt;else if("interval"===h)i=Ht;else if("categorical"===h){i=Wt,r=Object.create(null);for(var c=0,u=e.stops;c<u.length;c+=1){var d=u[c];r[d[0]]=d[1]}n=typeof e.stops[0][0]}else{if("identity"!==h)throw new Error('Unknown function type "'+h+'"');i=Xt}if(o){for(var p={},f=[],m=0;m<e.stops.length;m++){var y=e.stops[m],g=y[0].zoom;void 0===p[g]&&(p[g]={zoom:g,type:e.type,property:e.property,default:e.default,stops:[]},f.push(g)),p[g].stops.push([y[0].value,y[1]])}for(var v=[],b=0,_=f;b<_.length;b+=1){var w=_[b];v.push([p[w].zoom,qt(p[w],t)])}var x={name:"linear"};return{kind:"composite",interpolationType:x,interpolationFactor:ht.interpolationFactor.bind(void 0,x),zoomStops:v.map(function(e){return e[0]}),evaluate:function(i,r){var n=i.zoom;return Yt({stops:v,base:e.base},t,n).evaluate(n,r)}}}if(l){var C="exponential"===h?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:C,interpolationFactor:ht.interpolationFactor.bind(void 0,C),zoomStops:e.stops.map(function(e){return e[0]}),evaluate:function(a){var o=a.zoom;return i(e,t,o,r,n)}}}return{kind:"source",evaluate:function(a,o){var s=o&&o.properties?o.properties[e.property]:void 0;return void 0===s?Ut(e.default,t.default):i(e,t,s,r,n)}}}function Ut(e,t,i){return void 0!==e?e:void 0!==t?t:void 0!==i?i:void 0}function Wt(e,t,i,r,n){return Ut(typeof i===n?r[i]:void 0,e.default,t.default)}function Ht(e,t,i){if("number"!==Gt(i))return Ut(e.default,t.default);var r=e.stops.length;if(1===r)return e.stops[0][1];if(i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[r-1][0])return e.stops[r-1][1];var n=Ne(e.stops.map(function(e){return e[0]}),i);return e.stops[n][1]}function Yt(e,t,i){var r=void 0!==e.base?e.base:1;if("number"!==Gt(i))return Ut(e.default,t.default);var n=e.stops.length;if(1===n)return e.stops[0][1];if(i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[n-1][0])return e.stops[n-1][1];var a=Ne(e.stops.map(function(e){return e[0]}),i),o=function(e,t,i,r){var n=r-i,a=e-i;return 0===n?0:1===t?a/n:(Math.pow(t,a)-1)/(Math.pow(t,n)-1)}(i,r,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],l=e.stops[a+1][1],h=Ue[t.type]||Bt;if(e.colorSpace&&"rgb"!==e.colorSpace){var c=lt[e.colorSpace];h=function(e,t){return c.reverse(c.interpolate(c.forward(e),c.forward(t),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var i=s.evaluate.apply(void 0,e),r=l.evaluate.apply(void 0,e);if(void 0!==i&&void 0!==r)return h(i,r,o)}}:h(s,l,o)}function Xt(e,t,i){return"color"===t.type?i=X.parse(i):"formatted"===t.type?i=K.fromString(i.toString()):"resolvedImage"===t.type?i=Z.fromString(i.toString()):Gt(i)===t.type||"enum"===t.type&&t.values[i]||(i=void 0),Ut(i,e.default,t.default)}pe.register(Et,{error:[{kind:"error"},[R],function(e,t){var i=t[0];throw new ne(i.evaluate(e))}],typeof:[R,[D],function(e,t){return B(te(t[0].evaluate(e)))}],"to-rgba":[F(P,4),[A],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[A,[P,P,P],Lt],rgba:[A,[P,P,P,P],Lt],has:{type:j,overloads:[[[R],function(e,t){return Pt(t[0].evaluate(e),e.properties())}],[[R,z],function(e,t){var i=t[0],r=t[1];return Pt(i.evaluate(e),r.evaluate(e))}]]},get:{type:D,overloads:[[[R],function(e,t){return Rt(t[0].evaluate(e),e.properties())}],[[R,z],function(e,t){var i=t[0],r=t[1];return Rt(i.evaluate(e),r.evaluate(e))}]]},"feature-state":[D,[R],function(e,t){return Rt(t[0].evaluate(e),e.featureState||{})}],properties:[z,[],function(e){return e.properties()}],"geometry-type":[R,[],function(e){return e.geometryType()}],id:[D,[],function(e){return e.id()}],zoom:[P,[],function(e){return e.globals.zoom}],"heatmap-density":[P,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[P,[],function(e){return e.globals.lineProgress||0}],accumulated:[D,[],function(e){return void 0===e.globals.accumulated?null:e.globals.accumulated}],"+":[P,jt(P),function(e,t){for(var i=0,r=0,n=t;r<n.length;r+=1){i+=n[r].evaluate(e)}return i}],"*":[P,jt(P),function(e,t){for(var i=1,r=0,n=t;r<n.length;r+=1){i*=n[r].evaluate(e)}return i}],"-":{type:P,overloads:[[[P,P],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)-r.evaluate(e)}],[[P],function(e,t){return-t[0].evaluate(e)}]]},"/":[P,[P,P],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)/r.evaluate(e)}],"%":[P,[P,P],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)%r.evaluate(e)}],ln2:[P,[],function(){return Math.LN2}],pi:[P,[],function(){return Math.PI}],e:[P,[],function(){return Math.E}],"^":[P,[P,P],function(e,t){var i=t[0],r=t[1];return Math.pow(i.evaluate(e),r.evaluate(e))}],sqrt:[P,[P],function(e,t){var i=t[0];return Math.sqrt(i.evaluate(e))}],log10:[P,[P],function(e,t){var i=t[0];return Math.log(i.evaluate(e))/Math.LN10}],ln:[P,[P],function(e,t){var i=t[0];return Math.log(i.evaluate(e))}],log2:[P,[P],function(e,t){var i=t[0];return Math.log(i.evaluate(e))/Math.LN2}],sin:[P,[P],function(e,t){var i=t[0];return Math.sin(i.evaluate(e))}],cos:[P,[P],function(e,t){var i=t[0];return Math.cos(i.evaluate(e))}],tan:[P,[P],function(e,t){var i=t[0];return Math.tan(i.evaluate(e))}],asin:[P,[P],function(e,t){var i=t[0];return Math.asin(i.evaluate(e))}],acos:[P,[P],function(e,t){var i=t[0];return Math.acos(i.evaluate(e))}],atan:[P,[P],function(e,t){var i=t[0];return Math.atan(i.evaluate(e))}],min:[P,jt(P),function(e,t){return Math.min.apply(Math,t.map(function(t){return t.evaluate(e)}))}],max:[P,jt(P),function(e,t){return Math.max.apply(Math,t.map(function(t){return t.evaluate(e)}))}],abs:[P,[P],function(e,t){var i=t[0];return Math.abs(i.evaluate(e))}],round:[P,[P],function(e,t){var i=t[0].evaluate(e);return i<0?-Math.round(-i):Math.round(i)}],floor:[P,[P],function(e,t){var i=t[0];return Math.floor(i.evaluate(e))}],ceil:[P,[P],function(e,t){var i=t[0];return Math.ceil(i.evaluate(e))}],"filter-==":[j,[R,D],function(e,t){var i=t[0],r=t[1];return e.properties()[i.value]===r.value}],"filter-id-==":[j,[D],function(e,t){var i=t[0];return e.id()===i.value}],"filter-type-==":[j,[R],function(e,t){var i=t[0];return e.geometryType()===i.value}],"filter-<":[j,[R,D],function(e,t){var i=t[0],r=t[1],n=e.properties()[i.value],a=r.value;return typeof n==typeof a&&n<a}],"filter-id-<":[j,[D],function(e,t){var i=t[0],r=e.id(),n=i.value;return typeof r==typeof n&&r<n}],"filter->":[j,[R,D],function(e,t){var i=t[0],r=t[1],n=e.properties()[i.value],a=r.value;return typeof n==typeof a&&n>a}],"filter-id->":[j,[D],function(e,t){var i=t[0],r=e.id(),n=i.value;return typeof r==typeof n&&r>n}],"filter-<=":[j,[R,D],function(e,t){var i=t[0],r=t[1],n=e.properties()[i.value],a=r.value;return typeof n==typeof a&&n<=a}],"filter-id-<=":[j,[D],function(e,t){var i=t[0],r=e.id(),n=i.value;return typeof r==typeof n&&r<=n}],"filter->=":[j,[R,D],function(e,t){var i=t[0],r=t[1],n=e.properties()[i.value],a=r.value;return typeof n==typeof a&&n>=a}],"filter-id->=":[j,[D],function(e,t){var i=t[0],r=e.id(),n=i.value;return typeof r==typeof n&&r>=n}],"filter-has":[j,[D],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[j,[],function(e){return null!==e.id()&&void 0!==e.id()}],"filter-type-in":[j,[F(R)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[j,[F(D)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[j,[R,F(D)],function(e,t){var i=t[0];return t[1].value.indexOf(e.properties()[i.value])>=0}],"filter-in-large":[j,[R,F(D)],function(e,t){var i=t[0],r=t[1];return function(e,t,i,r){for(;i<=r;){var n=i+r>>1;if(t[n]===e)return!0;t[n]>e?r=n-1:i=n+1}return!1}(e.properties()[i.value],r.value,0,r.value.length-1)}],all:{type:j,overloads:[[[j,j],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)&&r.evaluate(e)}],[jt(j),function(e,t){for(var i=0,r=t;i<r.length;i+=1){if(!r[i].evaluate(e))return!1}return!0}]]},any:{type:j,overloads:[[[j,j],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)||r.evaluate(e)}],[jt(j),function(e,t){for(var i=0,r=t;i<r.length;i+=1){if(r[i].evaluate(e))return!0}return!1}]]},"!":[j,[j],function(e,t){return!t[0].evaluate(e)}],"is-supported-script":[j,[R],function(e,t){var i=t[0],r=e.globals&&e.globals.isSupportedScript;return!r||r(i.evaluate(e))}],upcase:[R,[R],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[R,[R],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[R,jt(D),function(e,t){return t.map(function(t){return ie(t.evaluate(e))}).join("")}],"resolved-locale":[R,[V],function(e,t){return t[0].evaluate(e).resolvedLocale()}]});var Jt=function(e,t){this.expression=e,this._warningHistory={},this._evaluator=new de,this._defaultValue=t?function(e){return"color"===e.type&&Ft(e.default)?new X(0,0,0,0):"color"===e.type?X.parse(e.default)||null:void 0===e.default?null:e.default}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null};function $t(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Et}function Kt(e,t){var i=new Ve(Et,[],t?function(e){var t={color:A,string:R,number:P,enum:R,boolean:j,formatted:N,resolvedImage:G};if("array"===e.type)return F(t[e.value]||D,e.length);return t[e.type]}(t):void 0),r=i.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return r?At(new Jt(r,t)):zt(i.errors)}Jt.prototype.evaluateWithoutErrorHandling=function(e,t,i,r,n,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},Jt.prototype.evaluate=function(e,t,i,r,n,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null===o||void 0===o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new ne("Expected value to be one of "+Object.keys(this._enumValues).map(function(e){return JSON.stringify(e)}).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}};var Zt=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Ae(t.expression)};Zt.prototype.evaluateWithoutErrorHandling=function(e,t,i,r,n,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,n,a)},Zt.prototype.evaluate=function(e,t,i,r,n,a){return this._styleExpression.evaluate(e,t,i,r,n,a)};var Qt=function(e,t,i,r){this.kind=e,this.zoomStops=i,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Ae(t.expression),this.interpolationType=r};function ei(e,t){if("error"===(e=Kt(e,t)).result)return e;var i=e.value.expression,r=je(i);if(!r&&!Dt(t))return zt([new O("","data expressions not supported")]);var n=ze(i,["zoom"]);if(!n&&!Vt(t))return zt([new O("","zoom expressions not supported")]);var a=function e(t){var i=null;if(t instanceof dt)i=e(t.result);else if(t instanceof ut)for(var r=0,n=t.args;r<n.length;r+=1){var a=n[r];if(i=e(a))break}else(t instanceof Ge||t instanceof ht)&&t.input instanceof pe&&"zoom"===t.input.name&&(i=t);if(i instanceof O)return i;t.eachChild(function(t){var r=e(t);r instanceof O?i=r:!i&&r?i=new O("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):i&&r&&i!==r&&(i=new O("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))});return i}(i);if(!a&&!n)return zt([new O("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof O)return zt([a]);if(a instanceof ht&&!Nt(t))return zt([new O("",'"interpolate" expressions cannot be used with this property')]);if(!a)return At(new Zt(r?"constant":"source",e.value));var o=a instanceof ht?a.interpolation:void 0;return At(new Qt(r?"camera":"composite",e.value,a.labels,o))}Qt.prototype.evaluateWithoutErrorHandling=function(e,t,i,r,n,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,n,a)},Qt.prototype.evaluate=function(e,t,i,r,n,a){return this._styleExpression.evaluate(e,t,i,r,n,a)},Qt.prototype.interpolationFactor=function(e,t,i){return this.interpolationType?ht.interpolationFactor(this.interpolationType,e,t,i):0};var ti=function(e,t){this._parameters=e,this._specification=t,I(this,qt(this._parameters,this._specification))};function ii(e){return"object"==typeof e?["literal",e]:e}function ri(e,t){var i=e.stops;if(!i)return function(e,t){var i=["get",e.property];if(void 0===e.default)return"string"===t.type?["string",i]:i;if("enum"===t.type)return["match",i,Object.keys(t.values),i,e.default];var r=["color"===t.type?"to-color":t.type,i,ii(e.default)];return"array"===t.type&&r.splice(1,0,t.value,t.length||null),r}(e,t);var r=i&&"object"==typeof i[0][0],n=r||void 0!==e.property,a=r||!n;return i=i.map(function(e){return!n&&t.tokens&&"string"==typeof e[1]?[e[0],ci(e[1])]:[e[0],ii(e[1])]}),r?function(e,t,i){for(var r={},n={},a=[],o=0;o<i.length;o++){var s=i[o],l=s[0].zoom;void 0===r[l]&&(r[l]={zoom:l,type:e.type,property:e.property,default:e.default},n[l]=[],a.push(l)),n[l].push([s[0].value,s[1]])}if("exponential"===hi({},t)){for(var h=[ni(e),["linear"],["zoom"]],c=0,u=a;c<u.length;c+=1){var d=u[c],p=oi(r[d],t,n[d]);li(h,d,p,!1)}return h}for(var f=["step",["zoom"]],m=0,y=a;m<y.length;m+=1){var g=y[m],v=oi(r[g],t,n[g]);li(f,g,v,!0)}return si(f),f}(e,t,i):a?function(e,t,i,r){void 0===r&&(r=["zoom"]);var n,a=hi(e,t),o=!1;if("interval"===a)n=["step",r],o=!0;else{if("exponential"!==a)throw new Error('Unknown zoom function type "'+a+'"');var s=void 0!==e.base?e.base:1;n=[ni(e),1===s?["linear"]:["exponential",s],r]}for(var l=0,h=i;l<h.length;l+=1){var c=h[l];li(n,c[0],c[1],o)}return si(n),n}(e,t,i):oi(e,t,i)}function ni(e){switch(e.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function ai(e,t){return void 0!==e?e:void 0!==t?t:void 0}function oi(e,t,i){var r=hi(e,t),n=["get",e.property];if("categorical"===r&&"boolean"==typeof i[0][0]){for(var a=["case"],o=0,s=i;o<s.length;o+=1){var l=s[o];a.push(["==",n,l[0]],l[1])}return a.push(ii(ai(e.default,t.default))),a}if("categorical"===r){for(var h=["match",n],c=0,u=i;c<u.length;c+=1){var d=u[c];li(h,d[0],d[1],!1)}return h.push(ii(ai(e.default,t.default))),h}if("interval"===r){for(var p=["step",["number",n]],f=0,m=i;f<m.length;f+=1){var y=m[f];li(p,y[0],y[1],!0)}return si(p),void 0===e.default?p:["case",["==",["typeof",n],"number"],p,ii(e.default)]}if("exponential"===r){for(var g=void 0!==e.base?e.base:1,v=[ni(e),1===g?["linear"]:["exponential",g],["number",n]],b=0,_=i;b<_.length;b+=1){var w=_[b];li(v,w[0],w[1],!1)}return void 0===e.default?v:["case",["==",["typeof",n],"number"],v,ii(e.default)]}throw new Error("Unknown property function type "+r)}function si(e){"step"===e[0]&&3===e.length&&(e.push(0),e.push(e[3]))}function li(e,t,i,r){e.length>3&&t===e[e.length-2]||(r&&2===e.length||e.push(t),e.push(i))}function hi(e,t){return e.type?e.type:t.expression.interpolated?"exponential":"interval"}function ci(e){for(var t=["concat"],i=/{([^{}]+)}/g,r=0,n=i.exec(e);null!==n;n=i.exec(e)){var a=e.slice(r,i.lastIndex-n[0].length);r=i.lastIndex,a.length>0&&t.push(a),t.push(["get",n[1]])}if(1===t.length)return e;if(r<e.length)t.push(e.slice(r));else if(2===t.length)return["to-string",t[1]];return t}function ui(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,i=e.slice(1);t<i.length;t+=1){var r=i[t];if(!ui(r)&&"boolean"!=typeof r)return!1}return!0;default:return!0}}ti.deserialize=function(e){return new ti(e._parameters,e._specification)},ti.serialize=function(e){return{_parameters:e._parameters,_specification:e._specification}};var di={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function pi(e){if(null===e||void 0===e)return{filter:function(){return!0},needGeometry:!1};ui(e)||(e=mi(e));var t=Kt(e,di);if("error"===t.result)throw new Error(t.value.map(function(e){return e.key+": "+e.message}).join(", "));return{filter:function(e,i,r){return t.value.evaluate(e,i,{},r)},needGeometry:function e(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var i=1;i<t.length;i++)if(e(t[i]))return!0;return!1}(e)}}function fi(e,t){return e<t?-1:e>t?1:0}function mi(e){if(!e)return!0;var t=e[0];return e.length<=1?"any"!==t:"=="===t?yi(e[1],e[2],"=="):"!="===t?bi(yi(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?yi(e[1],e[2],t):"any"===t?function(e){return["any"].concat(e.map(mi))}(e.slice(1)):"all"===t?["all"].concat(e.slice(1).map(mi)):"none"===t?["all"].concat(e.slice(1).map(mi).map(bi)):"in"===t?gi(e[1],e.slice(2)):"!in"===t?bi(gi(e[1],e.slice(2))):"has"===t?vi(e[1]):"!has"===t?bi(vi(e[1])):"within"!==t||e}function yi(e,t,i){switch(e){case"$type":return["filter-type-"+i,t];case"$id":return["filter-id-"+i,t];default:return["filter-"+i,e,t]}}function gi(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(function(e){return typeof e!=typeof t[0]})?["filter-in-large",e,["literal",t.sort(fi)]]:["filter-in-small",e,["literal",t]]}}function vi(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function bi(e){return["!",e]}var _i=function(e,t,i,r){this.message=(e?e+": ":"")+i,r&&(this.identifier=r),null!==t&&void 0!==t&&t.__line__&&(this.line=t.__line__)},wi=function(e){this.error=e,this.message=e.message;var t=e.message.match(/line (\d+)/);this.line=t?parseInt(t[1],10):0};function xi(e){var t=e.key,i=e.value;return i?[new _i(t,i,"constants have been deprecated as of v8")]:[]}function Ci(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Si(e){if(Array.isArray(e))return e.map(Si);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){var t={};for(var i in e)t[i]=Si(e[i]);return t}return Ci(e)}function Mi(e){var t=e.key,i=e.value,r=e.valueSpec||{},n=e.objectElementValidators||{},a=e.style,o=e.styleSpec,s=[],l=Gt(i);if("object"!==l)return[new _i(t,i,"object expected, "+l+" found")];for(var h in i){var c=h.split(".")[0],u=r[c]||r["*"],d=void 0;if(n[c])d=n[c];else if(r[c])d=Fi;else if(n["*"])d=n["*"];else{if(!r["*"]){s.push(new _i(t,i[h],'unknown property "'+h+'"'));continue}d=Fi}s=s.concat(d({key:(t?t+".":t)+h,value:i[h],valueSpec:u,style:a,styleSpec:o,object:i,objectKey:h},i))}for(var p in r)n[p]||r[p].required&&void 0===r[p].default&&void 0===i[p]&&s.push(new _i(t,i,'missing required property "'+p+'"'));return s}function ki(e){var t=e.value,i=e.valueSpec,r=e.style,n=e.styleSpec,a=e.key,o=e.arrayElementValidator||Fi;if("array"!==Gt(t))return[new _i(a,t,"array expected, "+Gt(t)+" found")];if(i.length&&t.length!==i.length)return[new _i(a,t,"array length "+i.length+" expected, length "+t.length+" found")];if(i["min-length"]&&t.length<i["min-length"])return[new _i(a,t,"array length at least "+i["min-length"]+" expected, length "+t.length+" found")];var s={type:i.value,values:i.values};n.$version<7&&(s.function=i.function),"object"===Gt(i.value)&&(s=i.value);for(var l=[],h=0;h<t.length;h++)l=l.concat(o({array:t,arrayIndex:h,value:t[h],valueSpec:s,style:r,styleSpec:n,key:a+"["+h+"]"}));return l}function Ti(e){var t=e.key,i=e.value,r=e.valueSpec,n=Gt(i);return"number"===n&&i!=i&&(n="NaN"),"number"!==n?[new _i(t,i,"number expected, "+n+" found")]:"minimum"in r&&i<r.minimum?[new _i(t,i,i+" is less than the minimum value "+r.minimum)]:"maximum"in r&&i>r.maximum?[new _i(t,i,i+" is greater than the maximum value "+r.maximum)]:[]}function Ii(e){var t,i,r,n=e.valueSpec,a=Ci(e.value.type),o={},s="categorical"!==a&&void 0===e.value.property,l=!s,h="array"===Gt(e.value.stops)&&"array"===Gt(e.value.stops[0])&&"object"===Gt(e.value.stops[0][0]),c=Mi({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===a)return[new _i(e.key,e.value,'identity function may not have a "stops" property')];var t=[],i=e.value;t=t.concat(ki({key:e.key,value:i,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:u})),"array"===Gt(i)&&0===i.length&&t.push(new _i(e.key,i,"array must have at least one stop"));return t},default:function(e){return Fi({key:e.key,value:e.value,valueSpec:n,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===a&&s&&c.push(new _i(e.key,e.value,'missing required property "property"')),"identity"===a||e.value.stops||c.push(new _i(e.key,e.value,'missing required property "stops"')),"exponential"===a&&e.valueSpec.expression&&!Nt(e.valueSpec)&&c.push(new _i(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!Dt(e.valueSpec)?c.push(new _i(e.key,e.value,"property functions not supported")):s&&!Vt(e.valueSpec)&&c.push(new _i(e.key,e.value,"zoom functions not supported"))),"categorical"!==a&&!h||void 0!==e.value.property||c.push(new _i(e.key,e.value,'"property" property is required')),c;function u(e){var t=[],a=e.value,s=e.key;if("array"!==Gt(a))return[new _i(s,a,"array expected, "+Gt(a)+" found")];if(2!==a.length)return[new _i(s,a,"array length 2 expected, length "+a.length+" found")];if(h){if("object"!==Gt(a[0]))return[new _i(s,a,"object expected, "+Gt(a[0])+" found")];if(void 0===a[0].zoom)return[new _i(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new _i(s,a,"object stop key must have value")];if(r&&r>Ci(a[0].zoom))return[new _i(s,a[0].zoom,"stop zoom values must appear in ascending order")];Ci(a[0].zoom)!==r&&(r=Ci(a[0].zoom),i=void 0,o={}),t=t.concat(Mi({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:Ti,value:d}}))}else t=t.concat(d({key:s+"[0]",value:a[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},a));return $t(Si(a[1]))?t.concat([new _i(s+"[1]",a[1],"expressions are not allowed in function stops.")]):t.concat(Fi({key:s+"[1]",value:a[1],valueSpec:n,style:e.style,styleSpec:e.styleSpec}))}function d(e,r){var s=Gt(e.value),l=Ci(e.value),h=null!==e.value?e.value:r;if(t){if(s!==t)return[new _i(e.key,h,s+" stop domain type must match previous stop domain type "+t)]}else t=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new _i(e.key,h,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var c="number expected, "+s+" found";return Dt(n)&&void 0===a&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new _i(e.key,h,c)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==i&&l<i?[new _i(e.key,h,"stop domain values must appear in ascending order")]:(i=l,"categorical"===a&&l in o?[new _i(e.key,h,"stop domain values must be unique")]:(o[l]=!0,[])):[new _i(e.key,h,"integer expected, found "+l)]}}function Oi(e){var t=("property"===e.expressionContext?ei:Kt)(Si(e.value),e.valueSpec);if("error"===t.result)return t.value.map(function(t){return new _i(""+e.key+t.key,e.value,t.message)});var i=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!i.outputDefined())return[new _i(e.key,e.value,'Invalid data expression for "'+e.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===e.expressionContext&&"layout"===e.propertyType&&!Ae(i))return[new _i(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!Ae(i))return[new _i(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!ze(i,["zoom","feature-state"]))return[new _i(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!je(i))return[new _i(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ei(e){var t=e.key,i=e.value,r=e.valueSpec,n=[];return Array.isArray(r.values)?-1===r.values.indexOf(Ci(i))&&n.push(new _i(t,i,"expected one of ["+r.values.join(", ")+"], "+JSON.stringify(i)+" found")):-1===Object.keys(r.values).indexOf(Ci(i))&&n.push(new _i(t,i,"expected one of ["+Object.keys(r.values).join(", ")+"], "+JSON.stringify(i)+" found")),n}function Li(e){return ui(Si(e.value))?Oi(I({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function e(t){var i=t.value;var r=t.key;if("array"!==Gt(i))return[new _i(r,i,"array expected, "+Gt(i)+" found")];var n=t.styleSpec;var a;var o=[];if(i.length<1)return[new _i(r,i,"filter array must have at least 1 element")];o=o.concat(Ei({key:r+"[0]",value:i[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec}));switch(Ci(i[0])){case"<":case"<=":case">":case">=":i.length>=2&&"$type"===Ci(i[1])&&o.push(new _i(r,i,'"$type" cannot be use with operator "'+i[0]+'"'));case"==":case"!=":3!==i.length&&o.push(new _i(r,i,'filter array for operator "'+i[0]+'" must have 3 elements'));case"in":case"!in":i.length>=2&&"string"!==(a=Gt(i[1]))&&o.push(new _i(r+"[1]",i[1],"string expected, "+a+" found"));for(var s=2;s<i.length;s++)a=Gt(i[s]),"$type"===Ci(i[1])?o=o.concat(Ei({key:r+"["+s+"]",value:i[s],valueSpec:n.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==a&&"number"!==a&&"boolean"!==a&&o.push(new _i(r+"["+s+"]",i[s],"string, number, or boolean expected, "+a+" found"));break;case"any":case"all":case"none":for(var l=1;l<i.length;l++)o=o.concat(e({key:r+"["+l+"]",value:i[l],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":a=Gt(i[1]),2!==i.length?o.push(new _i(r,i,'filter array for "'+i[0]+'" operator must have 2 elements')):"string"!==a&&o.push(new _i(r+"[1]",i[1],"string expected, "+a+" found"));break;case"within":a=Gt(i[1]),2!==i.length?o.push(new _i(r,i,'filter array for "'+i[0]+'" operator must have 2 elements')):"object"!==a&&o.push(new _i(r+"[1]",i[1],"object expected, "+a+" found"))}return o}(e)}function Pi(e,t){var i=e.key,r=e.style,n=e.styleSpec,a=e.value,o=e.objectKey,s=n[t+"_"+e.layerType];if(!s)return[];var l=o.match(/^(.*)-transition$/);if("paint"===t&&l&&s[l[1]]&&s[l[1]].transition)return Fi({key:i,value:a,valueSpec:n.transition,style:r,styleSpec:n});var h,c=e.valueSpec||s[o];if(!c)return[new _i(i,a,'unknown property "'+o+'"')];if("string"===Gt(a)&&Dt(c)&&!c.tokens&&(h=/^{([^}]+)}$/.exec(a)))return[new _i(i,a,'"'+o+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(h[1])+" }`.")];var u=[];return"symbol"===e.layerType&&("text-field"===o&&r&&!r.glyphs&&u.push(new _i(i,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&Ft(Si(a))&&"identity"===Ci(a.type)&&u.push(new _i(i,a,'"text-font" does not support identity functions'))),u.concat(Fi({key:e.key,value:a,valueSpec:c,style:r,styleSpec:n,expressionContext:"property",propertyType:t,propertyKey:o}))}function Ri(e){return Pi(e,"paint")}function ji(e){return Pi(e,"layout")}function Ai(e){var t=[],i=e.value,r=e.key,n=e.style,a=e.styleSpec;i.type||i.ref||t.push(new _i(r,i,'either "type" or "ref" is required'));var o,s=Ci(i.type),l=Ci(i.ref);if(i.id)for(var h=Ci(i.id),c=0;c<e.arrayIndex;c++){var u=n.layers[c];Ci(u.id)===h&&t.push(new _i(r,i.id,'duplicate layer id "'+i.id+'", previously used at line '+u.id.__line__))}if("ref"in i)["type","source","source-layer","filter","layout"].forEach(function(e){e in i&&t.push(new _i(r,i[e],'"'+e+'" is prohibited for ref layers'))}),n.layers.forEach(function(e){Ci(e.id)===l&&(o=e)}),o?o.ref?t.push(new _i(r,i.ref,"ref cannot reference another ref layer")):s=Ci(o.type):t.push(new _i(r,i.ref,'ref layer "'+l+'" not found'));else if("background"!==s)if(i.source){var d=n.sources&&n.sources[i.source],p=d&&Ci(d.type);d?"vector"===p&&"raster"===s?t.push(new _i(r,i.source,'layer "'+i.id+'" requires a raster source')):"raster"===p&&"raster"!==s?t.push(new _i(r,i.source,'layer "'+i.id+'" requires a vector source')):"vector"!==p||i["source-layer"]?"raster-dem"===p&&"hillshade"!==s?t.push(new _i(r,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!i.paint||!i.paint["line-gradient"]||"geojson"===p&&d.lineMetrics||t.push(new _i(r,i,'layer "'+i.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new _i(r,i,'layer "'+i.id+'" must specify a "source-layer"')):t.push(new _i(r,i.source,'source "'+i.source+'" not found'))}else t.push(new _i(r,i,'missing required property "source"'));return t=t.concat(Mi({key:r,value:i,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Fi({key:r+".type",value:i.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,object:i,objectKey:"type"})},filter:Li,layout:function(e){return Mi({layer:i,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return ji(I({layerType:s},e))}}})},paint:function(e){return Mi({layer:i,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return Ri(I({layerType:s},e))}}})}}}))}function zi(e){var t=e.value,i=e.key,r=Gt(t);return"string"!==r?[new _i(i,t,"string expected, "+r+" found")]:[]}var Di={promoteId:function(e){var t=e.key,i=e.value;if("string"===Gt(i))return zi({key:t,value:i});var r=[];for(var n in i)r.push.apply(r,zi({key:t+"."+n,value:i[n]}));return r}};function Vi(e){var t=e.value,i=e.key,r=e.styleSpec,n=e.style;if(!t.type)return[new _i(i,t,'"type" is required')];var a,o=Ci(t.type);switch(o){case"vector":case"raster":case"raster-dem":return a=Mi({key:i,value:t,valueSpec:r["source_"+o.replace("-","_")],style:e.style,styleSpec:r,objectElementValidators:Di});case"geojson":if(a=Mi({key:i,value:t,valueSpec:r.source_geojson,style:n,styleSpec:r,objectElementValidators:Di}),t.cluster)for(var s in t.clusterProperties){var l=t.clusterProperties[s],h=l[0],c=l[1],u="string"==typeof h?[h,["accumulated"],["get",s]]:h;a.push.apply(a,Oi({key:i+"."+s+".map",value:c,expressionContext:"cluster-map"})),a.push.apply(a,Oi({key:i+"."+s+".reduce",value:u,expressionContext:"cluster-reduce"}))}return a;case"video":return Mi({key:i,value:t,valueSpec:r.source_video,style:n,styleSpec:r});case"image":return Mi({key:i,value:t,valueSpec:r.source_image,style:n,styleSpec:r});case"canvas":return[new _i(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ei({key:i+".type",value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,styleSpec:r})}}function Ni(e){var t=e.value,i=e.styleSpec,r=i.light,n=e.style,a=[],o=Gt(t);if(void 0===t)return a;if("object"!==o)return a=a.concat([new _i("light",t,"object expected, "+o+" found")]);for(var s in t){var l=s.match(/^(.*)-transition$/);a=l&&r[l[1]]&&r[l[1]].transition?a.concat(Fi({key:s,value:t[s],valueSpec:i.transition,style:n,styleSpec:i})):r[s]?a.concat(Fi({key:s,value:t[s],valueSpec:r[s],style:n,styleSpec:i})):a.concat([new _i(s,t[s],'unknown property "'+s+'"')])}return a}var Gi={"*":function(){return[]},array:ki,boolean:function(e){var t=e.value,i=e.key,r=Gt(t);return"boolean"!==r?[new _i(i,t,"boolean expected, "+r+" found")]:[]},number:Ti,color:function(e){var t=e.key,i=e.value,r=Gt(i);return"string"!==r?[new _i(t,i,"color expected, "+r+" found")]:null===Y(i)?[new _i(t,i,'color expected, "'+i+'" found')]:[]},constants:xi,enum:Ei,filter:Li,function:Ii,layer:Ai,object:Mi,source:Vi,light:Ni,string:zi,formatted:function(e){return 0===zi(e).length?[]:Oi(e)},resolvedImage:function(e){return 0===zi(e).length?[]:Oi(e)}};function Fi(e){var t=e.value,i=e.valueSpec,r=e.styleSpec;return i.expression&&Ft(Ci(t))?Ii(e):i.expression&&$t(Si(t))?Oi(e):i.type&&Gi[i.type]?Gi[i.type](e):Mi(I({},e,{valueSpec:i.type?r[i.type]:i}))}function Bi(e){var t=e.value,i=e.key,r=zi(e);return r.length?r:(-1===t.indexOf("{fontstack}")&&r.push(new _i(i,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&r.push(new _i(i,t,'"glyphs" url must include a "{range}" token')),r)}function qi(e,t){void 0===t&&(t=n);var i=[];return i=i.concat(Fi({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:Bi,"*":function(){return[]}}})),e.constants&&(i=i.concat(xi({key:"constants",value:e.constants,style:e,styleSpec:t}))),Ui(i)}function Ui(e){return[].concat(e).sort(function(e,t){return e.line-t.line})}function Wi(e){return function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return Ui(e.apply(this,t))}}qi.source=Wi(Vi),qi.light=Wi(Ni),qi.layer=Wi(Ai),qi.filter=Wi(Li),qi.paintProperty=Wi(Ri),qi.layoutProperty=Wi(ji);var Hi=o(function(e,t){var i=function(){var e=function(e,t,i,r){for(i=i||{},r=e.length;r--;i[e[r]]=t);return i},t=[1,12],i=[1,13],r=[1,9],n=[1,10],a=[1,11],o=[1,14],s=[1,15],l=[14,18,22,24],h=[18,22],c=[22,24],u={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(e,t,i,r,n,a,o){var s=a.length-1;switch(n){case 1:this.$=new String(e.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(e),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.$=a[s-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=a[s-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[a[s-2],a[s]];break;case 16:this.$={},this.$[a[s][0]]=a[s][1];break;case 17:this.$=a[s-2],a[s-2][a[s][0]]=a[s][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[a[s]];break;case 21:this.$=a[s-2],a[s-2].push(a[s])}},table:[{3:5,4:t,5:6,6:i,7:3,8:r,9:4,10:n,11:a,12:1,13:2,15:7,16:8,17:o,23:s},{1:[3]},{14:[1,16]},e(l,[2,7]),e(l,[2,8]),e(l,[2,9]),e(l,[2,10]),e(l,[2,11]),e(l,[2,12]),e(l,[2,3]),e(l,[2,4]),e(l,[2,5]),e([14,18,21,22,24],[2,1]),e(l,[2,2]),{3:20,4:t,18:[1,17],19:18,20:19},{3:5,4:t,5:6,6:i,7:3,8:r,9:4,10:n,11:a,13:23,15:7,16:8,17:o,23:s,24:[1,21],25:22},{1:[2,6]},e(l,[2,13]),{18:[1,24],22:[1,25]},e(h,[2,16]),{21:[1,26]},e(l,[2,18]),{22:[1,28],24:[1,27]},e(c,[2,20]),e(l,[2,14]),{3:20,4:t,20:29},{3:5,4:t,5:6,6:i,7:3,8:r,9:4,10:n,11:a,13:30,15:7,16:8,17:o,23:s},e(l,[2,19]),{3:5,4:t,5:6,6:i,7:3,8:r,9:4,10:n,11:a,13:31,15:7,16:8,17:o,23:s},e(h,[2,17]),e(h,[2,15]),e(c,[2,21])],defaultActions:{16:[2,6]},parseError:function(e,t){if(!t.recoverable)throw new Error(e);this.trace(e)},parse:function(e){var t=this,i=[0],r=[null],n=[],a=this.table,o="",s=0,l=0,h=1,c=n.slice.call(arguments,1),u=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);u.setInput(e,d.yy),d.yy.lexer=u,d.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var f=u.yylloc;n.push(f);var m=u.options&&u.options.ranges;function y(){var e;return"number"!=typeof(e=u.lex()||h)&&(e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var g,v,b,_,w,x,C,S,M={};;){if(v=i[i.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null!==g&&void 0!==g||(g=y()),b=a[v]&&a[v][g]),void 0===b||!b.length||!b[0]){var k="";for(w in S=[],a[v])this.terminals_[w]&&w>2&&S.push("'"+this.terminals_[w]+"'");k=u.showPosition?"Parse error on line "+(s+1)+":\n"+u.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[g]||g)+"'":"Parse error on line "+(s+1)+": Unexpected "+(g==h?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(k,{text:u.match,token:this.terminals_[g]||g,line:u.yylineno,loc:f,expected:S})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(b[0]){case 1:i.push(g),r.push(u.yytext),n.push(u.yylloc),i.push(b[1]),g=null,l=u.yyleng,o=u.yytext,s=u.yylineno,f=u.yylloc;break;case 2:if(x=this.productions_[b[1]][1],M.$=r[r.length-x],M._$={first_line:n[n.length-(x||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(x||1)].first_column,last_column:n[n.length-1].last_column},m&&(M._$.range=[n[n.length-(x||1)].range[0],n[n.length-1].range[1]]),void 0!==(_=this.performAction.apply(M,[o,l,s,d.yy,b[1],r,n].concat(c))))return _;x&&(i=i.slice(0,-1*x*2),r=r.slice(0,-1*x),n=n.slice(0,-1*x)),i.push(this.productions_[b[1]][0]),r.push(M.$),n.push(M._$),C=a[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},d={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,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 e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.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),e},unput:function(e){var t=e.length,i=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),i.length-1&&(this.yylineno-=i.length-1);var n=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:i?(i.length===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-t]),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(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var i,r,n;if(this.options.backtrack_lexer&&(n={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&&(n.yylloc.range=this.yylloc.range.slice(0))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],i=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var a in n)this[a]=n[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var e,t,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),a=0;a<n.length;a++)if((i=this._input.match(this.rules[n[a]]))&&(!t||i[0].length>t[0].length)){if(t=i,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(i,n[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,n[r]))&&e:""===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 e=this.next();return e||this.lex()},begin:function(e){this.conditionStack.push(e)},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(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(e,t,i,r){switch(i){case 0:break;case 1:return 6;case 2:return t.yytext=t.yytext.substr(1,t.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 u.lexer=d,p.prototype=u,u.Parser=p,new p}();t.parser=i,t.Parser=i.Parser,t.parse=function(){return i.parse.apply(i,arguments)}});Hi.parser,Hi.Parser,Hi.parse;function Yi(e){if(e instanceof String||"string"==typeof e||e instanceof r)try{return Hi.parse(e.toString())}catch(e){throw new wi(e)}return e}function Xi(e,t){void 0===t&&(t=n);var i=e;try{i=Yi(i)}catch(e){return[e]}return qi(i,t)}var Ji={StyleExpression:Jt,isExpression:$t,isExpressionFilter:ui,createExpression:Kt,createPropertyExpression:ei,normalizePropertyExpression:function(e,t){if(Ft(e))return new ti(e,t);if($t(e)){var i=ei(e,t);if("error"===i.result)throw new Error(i.value.map(function(e){return e.key+": "+e.message}).join(", "));return i.value}var r=e;return"string"==typeof e&&"color"===t.type&&(r=X.parse(e)),{kind:"constant",evaluate:function(){return r}}},ZoomConstantExpression:Zt,ZoomDependentExpression:Qt,StylePropertyFunction:ti},$i={convertFunction:ri,createFunction:qt,isFunction:Ft};Xi.parsed=Xi,Xi.latest=Xi}).call(this,i(5),i(11).Buffer)},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",function(){return toLabelClass});var _mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__),_FontUtil__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(6);function toLabelClass(defaultLabelClass,text,overWrite,properties){let labelClass=defaultLabelClass.clone();const symbol=labelClass.symbol;if(text){symbol.text=text.getText();const e=text.getFont(),t=_FontUtil__WEBPACK_IMPORTED_MODULE_1__.a.parse(e,{fontSize:"12px",fontFamily:"微软雅黑",fontWeight:"normal",fontStyle:"normal"});symbol.font={size:parseFloat(t.fontSize),family:t.fontFamily,weight:t.fontWeight,style:t.fontStyle},symbol.xoffset=text.getOffsetX(),symbol.yoffset=text.getOffsetY(),labelClass.scale=text.getScale()||1,symbol.angle=180*text.getRotation()/Math.PI;const i={left:"above-left",right:"above-right",center:"above-center",start:"above-left",end:"above-right"};i[text.getTextAlign()]&&(labelClass.labelPlacement=i[text.getTextAlign()]);const r=text.getFill();if(r){const e=r.getColor();e&&(symbol.color=`rgba(${e[0]},${e[1]},${e[2]},${e[3]})`)}const n=text.getStroke();if(n){const e=n.getColor(),t=n.getWidth();e&&(symbol.haloColor=`rgba(${e[0]},${e[1]},${e[2]},${e[3]})`,symbol.haloSize=t)}const a=text.getBackgroundFill();if(a){const e=a.getColor();e&&(symbol.showBackground=!0,symbol.backgroundColor=`rgba(${e[0]},${e[1]},${e[2]},${e[3]})`)}}if(overWrite){const overWriteSymbol=Object.assign({},symbol.toJSON(),overWrite.symbol.toJSON()),overWriteLabelClass=Object.assign({},labelClass.toJSON(),overWrite.toJSON());if(overWriteLabelClass.symbol=overWriteSymbol,labelClass=new _mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.LabelClass(overWriteLabelClass),labelClass.symbol.text=text.getText(),labelClass.labelExpression){const excuteStr=labelClass.labelExpression.replace(/\$feature/g,"properties");try{labelClass.symbol.text=eval(excuteStr)||""}catch(e){console.log("err: ",e)}}else labelClass.currentAttributeName&&properties[labelClass.currentAttributeName]&&(text=properties[labelClass.currentAttributeName])}return labelClass}},function(e,t){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t,i){"use strict";(function(e){function r(e){const t=e.trim();return/^('|")/.test(t)?t:`"${t}"`}i.d(t,"a",function(){return n});class n{constructor(e,t,i,r,a,o){const s=o?"string"==typeof o?n.parse(o):o:{};this.fontFamily=a||s.fontFamily,this.fontSize=r||s.fontSize,this.fontStyle=e||s.fontStyle,this.fontWeight=i||s.fontWeight,this.fontVariant=t||s.fontVariant}toString(){return[function(e){if(!e)return"";const t=e.trim().toLowerCase();switch(t){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return t;default:return/^oblique\s+(-|)\d+deg$/.test(t)?t:""}}(this.fontStyle),this.fontVariant,function(e){if(!e)return"";const t=e.trim().toLowerCase();switch(t){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return t;default:return/^[\d.]+$/.test(t)?t:""}}(this.fontWeight),this.fontSize,function(t){return void 0===e?t:t.trim().split(",").map(r).join(",")}(this.fontFamily)].join(" ").trim()}}n.styles="normal|italic|oblique|inherit",n.variants="normal|small-caps|inherit",n.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit",n.parse=function(e="",t){let i="",r="",a="",o="",s="";const l={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return function(e){return e.replace(/(?!\u3000)\s+/gm," ")}(e).trim().split(" ").forEach(e=>{switch(!0){case!l.fontStyle&&n.styles.includes(e):"inherit"!==e&&(i=e),l.fontStyle=!0;break;case!l.fontVariant&&n.variants.includes(e):"inherit"!==e&&(r=e),l.fontStyle=!0,l.fontVariant=!0;break;case!l.fontWeight&&n.weights.includes(e):"inherit"!==e&&(a=e),l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0;break;case!l.fontSize:"inherit"!==e&&(o=e.split("/")[0]||""),l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0,l.fontSize=!0;break;default:"inherit"!==e&&(s+=e)}}),new n(i,r,a,o,s,t)}}).call(this,i(10))},function(e,t){(function(){var t;e.exports={icon:"icons/google.svg",name:"google",title:"Google Fonts",link:"google.com/fonts",getNames:function(){return t},getLink:function(e){return"https://fonts.google.com/specimen/"+e.replace(/( )/g,"+")},normalizeName:function(e){return e}},t=["ABeeZee","Abel","Abril Fatface","Aclonica","Acme","Actor","Adamina","Advent Pro","Aguafina Script","Akronim","Aladin","Aldrich","Alef","Alegreya","Alegreya SC","Alegreya Sans","Alegreya Sans SC","Alex Brush","Alfa Slab One","Alice","Alike","Alike Angular","Allan","Allerta","Allerta Stencil","Allura","Almendra","Almendra Display","Almendra SC","Amarante","Amaranth","Amatic SC","Amethysta","Amiri","Amita","Anaheim","Andada","Andika","Angkor","Annie Use Your Telescope","Anonymous Pro","Antic","Antic Didone","Antic Slab","Anton","Arapey","Arbutus","Arbutus Slab","Architects Daughter","Archivo Black","Archivo Narrow","Arimo","Arizonia","Armata","Artifika","Arvo","Arya","Asap","Asar","Asset","Astloch","Asul","Atomic Age","Aubrey","Audiowide","Autour One","Average","Average Sans","Averia Gruesa Libre","Averia Libre","Averia Sans Libre","Averia Serif Libre","Bad Script","Balthazar","Bangers","Basic","Battambang","Baumans","Bayon","Belgrano","Belleza","BenchNine","Bentham","Berkshire Swash","Bevan","Bigelow Rules","Bigshot One","Bilbo","Bilbo Swash Caps","Biryani","Bitter","Black Ops One","Bokor","Bonbon","Boogaloo","Bowlby One","Bowlby One SC","Brawler","Bree Serif","Bubblegum Sans","Bubbler One","Buda","Buenard","Butcherman","Butterfly Kids","Cabin","Cabin Condensed","Cabin Sketch","Caesar Dressing","Cagliostro","Calligraffitti","Cambay","Cambo","Candal","Cantarell","Cantata One","Cantora One","Capriola","Cardo","Carme","Carrois Gothic","Carrois Gothic SC","Carter One","Catamaran","Caudex","Caveat","Caveat Brush","Cedarville Cursive","Ceviche One","Changa One","Chango","Chau Philomene One","Chela One","Chelsea Market","Chenla","Cherry Cream Soda","Cherry Swash","Chewy","Chicle","Chivo","Chonburi","Cinzel","Cinzel Decorative","Clicker Script","Coda","Coda Caption","Codystar","Combo","Comfortaa","Coming Soon","Concert One","Condiment","Content","Contrail One","Convergence","Cookie","Copse","Corben","Courgette","Cousine","Coustard","Covered By Your Grace","Crafty Girls","Creepster","Crete Round","Crimson Text","Croissant One","Crushed","Cuprum","Cutive","Cutive Mono","Damion","Dancing Script","Dangrek","Dawning of a New Day","Days One","Dekko","Delius","Delius Swash Caps","Delius Unicase","Della Respira","Denk One","Devonshire","Dhurjati","Didact Gothic","Diplomata","Diplomata SC","Domine","Donegal One","Doppio One","Dorsa","Dosis","Dr Sugiyama","Droid Sans","Droid Sans Mono","Droid Serif","Duru Sans","Dynalight","EB Garamond","Eagle Lake","Eater","Economica","Eczar","Ek Mukta","Electrolize","Elsie","Elsie Swash Caps","Emblema One","Emilys Candy","Engagement","Englebert","Enriqueta","Erica One","Esteban","Euphoria Script","Ewert","Exo","Exo 2","Expletus Sans","Fanwood Text","Fascinate","Fascinate Inline","Faster One","Fasthand","Fauna One","Federant","Federo","Felipa","Fenix","Finger Paint","Fira Mono","Fira Sans","Fjalla One","Fjord One","Flamenco","Flavors","Fondamento","Fontdiner Swanky","Forum","Francois One","Freckle Face","Fredericka the Great","Fredoka One","Freehand","Fresca","Frijole","Fruktur","Fugaz One","GFS Didot","GFS Neohellenic","Gabriela","Gafata","Galdeano","Galindo","Gentium Basic","Gentium Book Basic","Geo","Geostar","Geostar Fill","Germania One","Gidugu","Gilda Display","Give You Glory","Glass Antiqua","Glegoo","Gloria Hallelujah","Goblin One","Gochi Hand","Gorditas","Goudy Bookletter 1911","Graduate","Grand Hotel","Gravitas One","Great Vibes","Griffy","Gruppo","Gudea","Gurajada","Habibi","Halant","Hammersmith One","Hanalei","Hanalei Fill","Handlee","Hanuman","Happy Monkey","Headland One","Henny Penny","Herr Von Muellerhoff","Hind","Hind Siliguri","Hind Vadodara","Holtwood One SC","Homemade Apple","Homenaje","IM Fell DW Pica","IM Fell DW Pica SC","IM Fell Double Pica","IM Fell Double Pica SC","IM Fell English","IM Fell English SC","IM Fell French Canon","IM Fell French Canon SC","IM Fell Great Primer","IM Fell Great Primer SC","Iceberg","Iceland","Imprima","Inconsolata","Inder","Indie Flower","Inika","Inknut Antiqua","Irish Grover","Istok Web","Italiana","Italianno","Itim","Jacques Francois","Jacques Francois Shadow","Jaldi","Jim Nightshade","Jockey One","Jolly Lodger","Josefin Sans","Josefin Slab","Joti One","Judson","Julee","Julius Sans One","Junge","Jura","Just Another Hand","Just Me Again Down Here","Kadwa","Kalam","Kameron","Kantumruy","Karla","Karma","Kaushan Script","Kavoon","Kdam Thmor","Keania One","Kelly Slab","Kenia","Khand","Khmer","Khula","Kite One","Knewave","Kotta One","Koulen","Kranky","Kreon","Kristi","Krona One","Kurale","La Belle Aurore","Laila","Lakki Reddy","Lancelot","Lateef","Lato","League Script","Leckerli One","Ledger","Lekton","Lemon","Libre Baskerville","Life Savers","Lilita One","Lily Script One","Limelight","Linden Hill","Lobster","Lobster Two","Londrina Outline","Londrina Shadow","Londrina Sketch","Londrina Solid","Lora","Love Ya Like A Sister","Loved by the King","Lovers Quarrel","Luckiest Guy","Lusitana","Lustria","Macondo","Macondo Swash Caps","Magra","Maiden Orange","Mako","Mallanna","Mandali","Marcellus","Marcellus SC","Marck Script","Margarine","Marko One","Marmelad","Martel","Martel Sans","Marvel","Mate","Mate SC","Maven Pro","McLaren","Meddon","MedievalSharp","Medula One","Megrim","Meie Script","Merienda","Merienda One","Merriweather","Merriweather Sans","Metal","Metal Mania","Metamorphous","Metrophobic","Michroma","Milonga","Miltonian","Miltonian Tattoo","Miniver","Miss Fajardose","Modak","Modern Antiqua","Molengo","Molle","Monda","Monofett","Monoton","Monsieur La Doulaise","Montaga","Montez","Montserrat","Montserrat Alternates","Montserrat Subrayada","Moul","Moulpali","Mountains of Christmas","Mouse Memoirs","Mr Bedfort","Mr Dafoe","Mr De Haviland","Mrs Saint Delafield","Mrs Sheppards","Muli","Mystery Quest","NTR","Neucha","Neuton","New Rocker","News Cycle","Niconne","Nixie One","Nobile","Nokora","Norican","Nosifer","Nothing You Could Do","Noticia Text","Noto Sans","Noto Serif","Nova Cut","Nova Flat","Nova Mono","Nova Oval","Nova Round","Nova Script","Nova Slim","Nova Square","Numans","Nunito","Odor Mean Chey","Offside","Old Standard TT","Oldenburg","Oleo Script","Oleo Script Swash Caps","Open Sans","Open Sans Condensed","Oranienbaum","Orbitron","Oregano","Orienta","Original Surfer","Oswald","Over the Rainbow","Overlock","Overlock SC","Ovo","Oxygen","Oxygen Mono","PT Mono","PT Sans","PT Sans Caption","PT Sans Narrow","PT Serif","PT Serif Caption","Pacifico","Palanquin","Palanquin Dark","Paprika","Parisienne","Passero One","Passion One","Pathway Gothic One","Patrick Hand","Patrick Hand SC","Patua One","Paytone One","Peddana","Peralta","Permanent Marker","Petit Formal Script","Petrona","Philosopher","Piedra","Pinyon Script","Pirata One","Plaster","Play","Playball","Playfair Display","Playfair Display SC","Podkova","Poiret One","Poller One","Poly","Pompiere","Pontano Sans","Poppins","Port Lligat Sans","Port Lligat Slab","Pragati Narrow","Prata","Preahvihear","Press Start 2P","Princess Sofia","Prociono","Prosto One","Puritan","Purple Purse","Quando","Quantico","Quattrocento","Quattrocento Sans","Questrial","Quicksand","Quintessential","Qwigley","Racing Sans One","Radley","Rajdhani","Raleway","Raleway Dots","Ramabhadra","Ramaraja","Rambla","Rammetto One","Ranchers","Rancho","Ranga","Rationale","Ravi Prakash","Redressed","Reenie Beanie","Revalia","Rhodium Libre","Ribeye","Ribeye Marrow","Righteous","Risque","Roboto","Roboto Condensed","Roboto Mono","Roboto Slab","Rochester","Rock Salt","Rokkitt","Romanesco","Ropa Sans","Rosario","Rosarivo","Rouge Script","Rozha One","Rubik","Rubik Mono One","Rubik One","Ruda","Rufina","Ruge Boogie","Ruluko","Rum Raisin","Ruslan Display","Russo One","Ruthie","Rye","Sacramento","Sahitya","Sail","Salsa","Sanchez","Sancreek","Sansita One","Sarala","Sarina","Sarpanch","Satisfy","Scada","Scheherazade","Schoolbell","Seaweed Script","Sevillana","Seymour One","Shadows Into Light","Shadows Into Light Two","Shanti","Share","Share Tech","Share Tech Mono","Shojumaru","Short Stack","Siemreap","Sigmar One","Signika","Signika Negative","Simonetta","Sintony","Sirin Stencil","Six Caps","Skranji","Slabo 13px","Slabo 27px","Slackey","Smokum","Smythe","Sniglet","Snippet","Snowburst One","Sofadi One","Sofia","Sonsie One","Sorts Mill Goudy","Source Code Pro","Source Sans Pro","Source Serif Pro","Special Elite","Spicy Rice","Spinnaker","Spirax","Squada One","Sree Krushnadevaraya","Stalemate","Stalinist One","Stardos Stencil","Stint Ultra Condensed","Stint Ultra Expanded","Stoke","Strait","Sue Ellen Francisco","Sumana","Sunshiney","Supermercado One","Sura","Suranna","Suravaram","Suwannaphum","Swanky and Moo Moo","Syncopate","Tangerine","Taprom","Tauri","Teko","Telex","Tenali Ramakrishna","Tenor Sans","Text Me One","The Girl Next Door","Tienne","Tillana","Timmana","Tinos","Titan One","Titillium Web","Trade Winds","Trocchi","Trochut","Trykker","Tulpen One","Ubuntu","Ubuntu Condensed","Ubuntu Mono","Ultra","Uncial Antiqua","Underdog","Unica One","UnifrakturCook","UnifrakturMaguntia","Unkempt","Unlock","Unna","VT323","Vampiro One","Varela","Varela Round","Vast Shadow","Vesper Libre","Vibur","Vidaloka","Viga","Voces","Volkhov","Vollkorn","Voltaire","Waiting for the Sunrise","Wallpoet","Walter Turncoat","Warnes","Wellfleet","Wendy One","Wire One","Work Sans","Yanone Kaffeesatz","Yantramanav","Yellowtail","Yeseva One","Yesteryear","Zeyada"]}).call(this)},function(e,t,i){"use strict";e.exports=n;var r=i(15);function n(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;function a(e){return e.type===n.Bytes?e.readVarint()+e.pos:e.pos+1}function o(e,t,i){return i?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function s(e,t,i){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.ceil(Math.log(t)/(7*Math.LN2));i.realloc(r);for(var n=i.pos-1;n>=e;n--)i.buf[n+r]=i.buf[n]}function l(e,t){for(var i=0;i<e.length;i++)t.writeVarint(e[i])}function h(e,t){for(var i=0;i<e.length;i++)t.writeSVarint(e[i])}function c(e,t){for(var i=0;i<e.length;i++)t.writeFloat(e[i])}function u(e,t){for(var i=0;i<e.length;i++)t.writeDouble(e[i])}function d(e,t){for(var i=0;i<e.length;i++)t.writeBoolean(e[i])}function p(e,t){for(var i=0;i<e.length;i++)t.writeFixed32(e[i])}function f(e,t){for(var i=0;i<e.length;i++)t.writeSFixed32(e[i])}function m(e,t){for(var i=0;i<e.length;i++)t.writeFixed64(e[i])}function y(e,t){for(var i=0;i<e.length;i++)t.writeSFixed64(e[i])}function g(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function v(e,t,i){e[i]=t,e[i+1]=t>>>8,e[i+2]=t>>>16,e[i+3]=t>>>24}function b(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}n.prototype={destroy:function(){this.buf=null},readFields:function(e,t,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),n=r>>3,a=this.pos;this.type=7&r,e(n,t,this),this.pos===a&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=g(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=b(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=g(this.buf,this.pos)+4294967296*g(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=g(this.buf,this.pos)+4294967296*b(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,i,r=this.buf;return t=127&(i=r[this.pos++]),i<128?t:(t|=(127&(i=r[this.pos++]))<<7,i<128?t:(t|=(127&(i=r[this.pos++]))<<14,i<128?t:(t|=(127&(i=r[this.pos++]))<<21,i<128?t:function(e,t,i){var r,n,a=i.buf;if(n=a[i.pos++],r=(112&n)>>4,n<128)return o(e,r,t);if(n=a[i.pos++],r|=(127&n)<<3,n<128)return o(e,r,t);if(n=a[i.pos++],r|=(127&n)<<10,n<128)return o(e,r,t);if(n=a[i.pos++],r|=(127&n)<<17,n<128)return o(e,r,t);if(n=a[i.pos++],r|=(127&n)<<24,n<128)return o(e,r,t);if(n=a[i.pos++],r|=(1&n)<<31,n<128)return o(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(i=r[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=function(e,t,i){var r="",n=t;for(;n<i;){var a,o,s,l=e[n],h=null,c=l>239?4:l>223?3:l>191?2:1;if(n+c>i)break;1===c?l<128&&(h=l):2===c?128==(192&(a=e[n+1]))&&(h=(31&l)<<6|63&a)<=127&&(h=null):3===c?(a=e[n+1],o=e[n+2],128==(192&a)&&128==(192&o)&&((h=(15&l)<<12|(63&a)<<6|63&o)<=2047||h>=55296&&h<=57343)&&(h=null)):4===c&&(a=e[n+1],o=e[n+2],s=e[n+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((h=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||h>=1114112)&&(h=null)),null===h?(h=65533,c=1):h>65535&&(h-=65536,r+=String.fromCharCode(h>>>10&1023|55296),h=56320|1023&h),r+=String.fromCharCode(h),n+=c}return r}(this.buf,this.pos,e);return this.pos=e,t},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){var i=a(this);for(e=e||[];this.pos<i;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===n.Varint)for(;this.buf[this.pos++]>127;);else if(t===n.Bytes)this.pos=this.readVarint()+this.pos;else if(t===n.Fixed32)this.pos+=4;else{if(t!==n.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var i=new Uint8Array(t);i.set(this.buf),this.buf=i,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),v(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),v(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),v(this.buf,-1&e,this.pos),v(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),v(this.buf,-1&e,this.pos),v(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var i,r;e>=0?(i=e%4294967296|0,r=e/4294967296|0):(r=~(-e/4294967296),4294967295^(i=~(-e%4294967296))?i=i+1|0:(i=0,r=r+1|0));if(e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,i){i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos]=127&e}(i,0,t),function(e,t){var i=(7&e)<<4;if(t.buf[t.pos++]|=i|((e>>>=3)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;t.buf[t.pos++]=127&e}(r,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,i){for(var r,n,a=0;a<t.length;a++){if((r=t.charCodeAt(a))>55295&&r<57344){if(!n){r>56319||a+1===t.length?(e[i++]=239,e[i++]=191,e[i++]=189):n=r;continue}if(r<56320){e[i++]=239,e[i++]=191,e[i++]=189,n=r;continue}r=n-55296<<10|r-56320|65536,n=null}else n&&(e[i++]=239,e[i++]=191,e[i++]=189,n=null);r<128?e[i++]=r:(r<2048?e[i++]=r>>6|192:(r<65536?e[i++]=r>>12|224:(e[i++]=r>>18|240,e[i++]=r>>12&63|128),e[i++]=r>>6&63|128),e[i++]=63&r|128)}return i}(this.buf,e,this.pos);var i=this.pos-t;i>=128&&s(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i},writeFloat:function(e){this.realloc(4),r.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),r.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var i=0;i<t;i++)this.buf[this.pos++]=e[i]},writeRawMessage:function(e,t){this.pos++;var i=this.pos;e(t,this);var r=this.pos-i;r>=128&&s(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,t,i){this.writeTag(e,n.Bytes),this.writeRawMessage(t,i)},writePackedVarint:function(e,t){this.writeMessage(e,l,t)},writePackedSVarint:function(e,t){this.writeMessage(e,h,t)},writePackedBoolean:function(e,t){this.writeMessage(e,d,t)},writePackedFloat:function(e,t){this.writeMessage(e,c,t)},writePackedDouble:function(e,t){this.writeMessage(e,u,t)},writePackedFixed32:function(e,t){this.writeMessage(e,p,t)},writePackedSFixed32:function(e,t){this.writeMessage(e,f,t)},writePackedFixed64:function(e,t){this.writeMessage(e,m,t)},writePackedSFixed64:function(e,t){this.writeMessage(e,y,t)},writeBytesField:function(e,t){this.writeTag(e,n.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,n.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,n.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,n.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,n.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,n.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,n.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,n.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,n.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,n.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}}},,function(e,t){var i,r,n=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(i===setTimeout)return setTimeout(e,0);if((i===a||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:a}catch(e){i=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var l,h=[],c=!1,u=-1;function d(){c&&l&&(c=!1,l.length?h=l.concat(h):u=-1,h.length&&p())}function p(){if(!c){var e=s(d);c=!0;for(var t=h.length;t;){for(l=h,h=[];++u<t;)l&&l[u].run();u=-1,t=h.length}l=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function m(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];h.push(new f(e,t)),1!==h.length||c||s(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=m,n.addListener=m,n.once=m,n.off=m,n.removeListener=m,n.removeAllListeners=m,n.emit=m,n.prependListener=m,n.prependOnceListener=m,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(e,t,i){"use strict";(function(e){
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@mapgis/webclient-common"));else if("function"==typeof define&&define.amd)define(["@mapgis/webclient-common"],t);else{var i="object"==typeof exports?t(require("@mapgis/webclient-common")):t(e["@mapgis/webclient-common"]);for(var r in i)("object"==typeof exports?exports:e)[r]=i[r]}}(window,function(__WEBPACK_EXTERNAL_MODULE__0__){return function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=15)}([function(e,t){e.exports=__WEBPACK_EXTERNAL_MODULE__0__},function(module,__webpack_exports__,__webpack_require__){"use strict";var _mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__),_DynamicLabelsUtil__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(2);function convertTextSymbolOptions(e,t){const i={};t=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(t,{});const r=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(t.layerOpacity,1);let n={};if(e){n=e instanceof _mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.Symbol?e.toJSON():e;const t=(n=JSON.parse(JSON.stringify(n))).font||{};let{verticalAlignment:a,horizontalAlignment:o}=e;const{textWraps:s,rotated:l,textDecorationUnderlineWidth:h,textDecorationUnderlineColor:c,textDecorationThroughlineColor:u,textDecorationThroughlineWidth:d,textShadowColor:p,textShadowBlur:f,textExtraIcon:m,backgroundColor:y,backgroundImage:g}=e;switch(a){case"middle":a="center";break;case"top":a="above";break;case"bottom":a="below";break;default:a="center"}switch(o){case"center":o="center";break;case"left":o="left";break;case"right":o="right";break;default:o="center"}i.labelPlacement=`${a}-${o}`,n.textWraps=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(s,!0),l||(n.angle=0),(0!==h&&c||"underline"===t.decoration)&&(n.showTextDecorationUnderline=!0),(0!==d&&u||"line-through"===t.decoration)&&(n.showTextDecorationThroughline=!0),p&&0!==f&&(n.showTextShadow=!0),void 0!==n.letterSpacing&&(n.letterSpacing+="px"),["color","haloColor","backgroundColor","borderLineColor","textDecorationUnderlineColor","textDecorationThroughlineColor","textShadowColor"].forEach(e=>{if(n[e]){const t=_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.Color.fromColor(n[e]);t.alpha*=r,n[e]=t.toCssRGBAString()}}),y||g?(n.showBackground=!0,n.backgroundImage=g,n.backgroundColor=y):(n.showBackground=!1,n.backgroundColor="rgba(0,0,0,0)"),m&&(n.showTextExtraIcon=!0,n.textExtraIcon=e.textExtraIcon,n.textExtraIconAnchor=e.textExtraIconAnchor,n.textExtraIconSize=e.textExtraIconSize),n.yoffset*=-1}return i.symbol=n,i}class CesiumPluginUtil{static convertColorToRgb(e){return e instanceof _mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.Color?Cesium.Color.fromCssColorString(e.toCssRGBAString()):"string"==typeof e?Cesium.Color.fromCssColorString(e):(e=new _mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.Color,Cesium.Color.fromCssColorString(e.toCssRGBAString()))}static convertTextSymbolToLabelNoteStyle(e,t){const i=convertTextSymbolOptions(e,t);return _DynamicLabelsUtil__WEBPACK_IMPORTED_MODULE_1__.a.parseNoteOptions("Point",i)}static convertLabelClassToLabelNoteStyle(e){const{symbol:t}=e,i=e.extensionOptions,r=convertTextSymbolOptions(t);r.minScale=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(i.minScale,e.minScale),r.maxScale=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(i.maxScale,e.maxScale),e.labelPlacement&&(r.labelPlacement=e.labelPlacement),r.repeatLabel=e.repeatLabel,r.repeatLabelDistance=e.repeatLabelDistance,r.repeatStartRate=e.repeatStartRate,r.repeatEndRate=e.repeatEndRate,r.lineLabelSpread=e.lineLabelSpread,r.labelPositionAlong=e.labelPositionAlong,r.skeletonLineStartRate=e.skeletonLineStartRate,r.skeletonLineEndRate=e.skeletonLineEndRate,r.groundScale=e.groundScale;const n=e.elevationInfo,{mode:a,offset:o,featureExpressionInfo:s,unit:l}=n;let h=1;"mile"===l?h=1609.34:"kilometers"===l&&(h=1e3),r.labelHeight=o*h;let c=0;return"OnTheGround"===a?c=1:"RelativeToGround"===a&&(c=2),r.heightReference=c,Object.entries(i).forEach(e=>{r[e[0]]=e[1]}),r}static parseExpression(feature,expression){if(!expression)return"";const excuteStr=expression.replace(/\$feature/g,"feature.attributes");try{const v=eval(excuteStr);return v}catch(e){_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.Log.info("字段表达式输入值非法")}return""}static toCartesian3Position(e,t){let i;return i="degrees"===t?Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]):Cesium.Cartesian3.fromRadians(e[0],e[1],e[2])}static createBillboardOptions(e,t){(t=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(t,{})).heightReference=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(t.heightReference,Cesium.HeightReference.NONE);const i=t.graphic,r=i._feature.symbol;let n,a={position:e,image:n=i._canvas?i._canvas:r.url,color:new Cesium.Color(1,1,1,i._layerOpacity),width:r.size||r.width,height:r.size||r.height,pixelOffset:new Cesium.Cartesian2(r.xoffset,-1*r.yoffset),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,heightReference:t.heightReference};return a=Object.assign(a,r.extensionOptions)}static calcRhumbArcCenter(e,t){const i=Cesium.Cartesian3.fromDegrees(e[0],e[1]),r=Cesium.Cartesian3.fromDegrees(t[0],t[1]),n=Cesium.Ellipsoid.WGS84;e=n.cartesianToCartographic(i),t=n.cartesianToCartographic(r);const a=new Cesium.EllipsoidRhumbLine(e,t,n),o=a.surfaceDistance/2,s=a.interpolateUsingSurfaceDistance(o,t),l=Cesium.Math.toDegrees(s.longitude),h=Cesium.Math.toDegrees(s.latitude);if(void 0!==e[2]&&void 0!==t[2]){return[l,h,((e[2]?e[2]:0)+(t[2]?t[2]:0))/2]}return[l,h]}static calcCartesianArcCenter(e,t){const i=Cesium.Cartesian3.fromDegrees(e[0],e[1]),r=Cesium.Cartesian3.fromDegrees(t[0],t[1]),n=Cesium.Ellipsoid.WGS84;e=n.cartesianToCartographic(i),t=n.cartesianToCartographic(r);const a=new Cesium.EllipsoidGeodesic;a.setEndPoints(e,t);const o=a.surfaceDistance/2,s=a.interpolateUsingSurfaceDistance(o,t),l=Cesium.Math.toDegrees(s.longitude),h=Cesium.Math.toDegrees(s.latitude);if(void 0!==e[2]&&void 0!==t[2]){return[l,h,((e[2]?e[2]:0)+(t[2]?t[2]:0))/2]}return[l,h]}}__webpack_exports__.a=CesiumPluginUtil},function(e,t,i){"use strict";function r(e,t,i,r,n,a,o,s,l,h,c,u,d){var p=!1,g=!1;if(0===l?g=!0:1===l?p=!0:(p=!0,g=!0),f(t)){var v=t.split("/"),b=v[1],_=v[2];if(v.length>4)_=v.slice(2,v.length-1).join("/");var w=n,x=T=parseInt(c.fontSize);e.textBaseline="middle";var C=e.measureText(b).width,S=e.measureText(_).width,M=C>S?C:S,k=T/2;p&&(e.strokeText(b,w+M/2-C/2,x-k),e.strokeText(_,w+M/2-S/2,x+k)),g&&(e.fillText(b,w+M/2-C/2,x-k),e.fillText(_,w+M/2-S/2,x+k));return e.strokeStyle=e.fillStyle,e.beginPath(),e.moveTo(w,x),e.lineTo(w+M,x),e.lineWidth=1,e.stroke(),e.closePath(),{width:M*d,height:u.height}}if(m(t)){var T,I=t,O=0,E=`${T=parseInt(c.fontSize)}px ${c.fontFamily}`,L=`${.666*T}px ${c.fontFamily}`,P=(w=n,x=T/2/d+T/2+a,0);e.textBaseline="middle";k=T/3;for(var R=I.split("#"),j=R[0],A=1;A<R.length;A++){var z=R[A];if(/^[-+=]$/.test(z[0]))break;j+="#"+z}if(j.length>0){y(e,j,w,x,E,g,p);var D=e.measureText(j).width;w+=D,O+=D}var V=[];(R=(I=I.slice(j.length)).split("#")).shift();for(A=0;A<R.length;A++)if(A>0&&/^[-+=]$/.test(R[A][0]))V.push(R[A]);else{var N=V.pop();Cesium.defined(N)||(N="");var G=0===A?"":"#";V.push(N+G+R[A])}R=V;for(A=0;A<R.length;A++){var F=R[A],B=F[0],q=F.substring(1);if("+"===B)y(e,q,w,x-k,L,g,p),P=P>(U=e.measureText(q).width)?P:U;else if("-"===B){var U;y(e,q,w,x+k,L,g,p),P=P>(U=e.measureText(q).width)?P:U}else if("="===B){y(e,q,w+=P,x,E,g,p),w+=s=e.measureText(q).width,O+=s}z=R[A+1];if(Cesium.defined(z))"="===z[0]&&(O+=P);else"+"!==B&&"-"!==B||(O+=P)}return{width:O*d,height:u.height}}var W=e.measureText(t).width,H=o+a,Y=parseInt(h);if(W<i||-1===r)p&&e.strokeText(t,n,H),g&&e.fillText(t,n,H);else{var X=t.split(""),$=0,J=0,K=n,Z=a+o,Q=0;for(A=0;A<X.length;A++){q=X[A];var ee=e.measureText(q).width;$+ee-Y===s&&(ee-=Y),$+=ee,J=ee,Q<=r&&($<=s?K=n+$-J:(J=0,$=ee,K=n,Z=o*((Q+=1)+1)+a),p&&e.strokeText(q,K,Z),g&&e.fillText(q,K,Z))}}}function n(e,t){var i=void 0!==t?t:{},n=f(e),a=m(e),s=Cesium.defaultValue(i.textWraps,!0),h=Cesium.defaultValue(i.lineWidth,80),c=Cesium.defaultValue(i.lineMaxNum,3),u=0;i.drawStyles&&i.drawStyles.haloSize&&(u=i.drawStyles.haloSize);var d=Cesium.defaultValue(i.showBackground,!1),p=5,y=5;Cesium.defined(i.backgroundPadding)&&(Array.isArray(i.backgroundPadding)?(p=i.backgroundPadding[0],y=i.backgroundPadding[1]):(p=i.backgroundPadding,y=i.backgroundPadding));var g=i.backgroundImage,v=Cesium.defaultValue(i.backgroundColor,"rgba(42,42,42,0.8)");d||(p=0,y=0),(!s||n||a)&&(c=-1);var b=Cesium.defaultValue(i.fontStyleOptions,{}),_=new o(b),w=Cesium.defaultValue(i.lineHeight,Cesium.defaultValue(parseInt(_.fontSize)),20),x=l(e,_,h,c,w,i.letterSpacing),C=document.createElement("canvas"),S=C.getContext("2d"),M=e,k=i.textDefinition<=1?1:i.textDefinition,T=0;_.fontStyle&&"normal"!==_.fontStyle&&(T=.5);var I=p+u,O=y+u,E=x.right+T*parseInt(_.fontSize)+2*I,L=x.bottom+2*O;S.save(),S.font=`${b.fontSize} ${b.fontFamily}`,n?(E=S.measureText(M).width,L=2*parseInt(_.fontSize)):a&&(E=S.measureText(M).width,L+=.3*parseInt(_.fontSize)),S.restore();var P=[0,0],R=[0,0],j=Cesium.defaultValue(i.showTextExtraIcon,!1),A=Cesium.defaultValue(i.textExtraIconSize,20),z=Cesium.defaultValue(i.textExtraIcon,"");if(j)switch(i.textExtraIconAnchor){case"top":P=[0,A],R=[E/2-A/2,0],E+=0,L+=A;break;case"left":P=[A,0],R=[0,L/2-A/2],E+=A,L+=0;break;case"right":P=[0,0],R=[E,L/2-A/2],E+=A,L+=0;break;case"bottom":P=[0,0],R=[E/2-A/2,L],E+=0,L+=A;break;default:P=[0,A],R=[E/2-A/2,0],E+=0,L+=A}var D=E*k,V=L*k;C.width=D,C.height=V,S.scale(k,k),document.body.appendChild(C),S.save(),d&&("function"==typeof g?g(S,P[0],P[1],E,L):g?S.drawImage(g,P[0],P[1],E,L):(S.fillStyle=v,S.fillRect(P[0],P[1],E,L))),S.restore(),j&&z&&(S.save(),S.drawImage(z,R[0],R[1],A,A),S.restore()),S.save(),C.style.letterSpacing=i.letterSpacing,S.font=_.font,S.textBaseline="bottom";var N=Cesium.defaultValue(i.drawStyles,{}),G=Cesium.defaultValue(i.drawMode,0);S.fillStyle=N.color,S.strokeStyle=N.haloColor,S.lineWidth=N.haloSize,Cesium.defaultValue(i.showTextShadow,!1)&&(S.shadowOffsetX=i.textShadowOffsetX,S.shadowOffsetY=i.textShadowOffsetY,S.shadowColor=i.textShadowColor,S.shadowBlur=i.textShadowBlur);var F=r(S,M,h,c,I+P[0],O+P[1],w,x.right,G,i.letterSpacing,_,C,k);if(S.restore(),function(e,t,i,r,n,a,o,s){for(var l=a/o,h=Cesium.defaultValue(s.showTextDecorationUnderline,!1),c=Cesium.defaultValue(s.textDecorationUnderlineColor,"rgba(0,0,0,1)"),u=Cesium.defaultValue(s.textDecorationUnderlineWidth,1),d=Cesium.defaultValue(s.showTextDecorationThroughline,!1),p=Cesium.defaultValue(s.textDecorationThroughlineColor,"rgba(0,0,0,1)"),f=Cesium.defaultValue(s.textDecorationThroughlineWidth,1),m=(i-n-a)/2+n,y=0;y<l;y++)g(e,t,m,o),m+=o;function g(e,t,i,n){e.save(),d&&(e.beginPath(),e.lineWidth=f,e.strokeStyle=p,e.moveTo(r,i+n/2),e.lineTo(t+r,i+n/2),e.stroke()),e.restore(),e.save(),h&&(e.beginPath(),e.lineWidth=u,e.strokeStyle=c,e.moveTo(r,i+n),e.lineTo(t+r,i+n),e.stroke()),e.restore()}}(S,x.right,L,P[0],P[1],x.bottom,w,i),document.body.removeChild(C),Cesium.defined(F)){var B=document.createElement("canvas");B.width=F.width,B.height=F.height,B.getContext("2d").drawImage(C,0,0),C=B}return C}function a(e,t,i){var r=a.canvas||(a.canvas=document.createElement("canvas")),n=r.getContext("2d"),o=0;return n.font=t,i&&(r.style.letterSpacing=i.letterSpacing,o=(e.split("").length-1)*parseFloat(i.letterSpacing)),n.measureText(e).width+o}function o(e){var t=Cesium.defaultValue(e.fontStyle,"normal"),i=Cesium.defaultValue(e.fontVariant,"normal"),r=Cesium.defaultValue(e.fontWeight,"normal"),n=Cesium.defaultValue(e.fontSize,"15px"),a=Cesium.defaultValue(e.fontFamily,"simHei"),o=t+" "+i+" "+r+" "+n+" "+a;this.font=o,this.fontStyle=t,this.fontVariant=i,this.fontWeight=r,this.fontSize=n,this.fontFamily=a}function s(e,t,i,r,n){if(!e)return"";var o,s,l=e.split(""),h=[],c=0,u=0;for(o=0;o<l.length;o++)if(u+=a(s=l[o],t.font),h.push(s),u>i){if(u=0,(c+=1)===r){h[h.length-1]="..";break}h.push("\n")}return"\n"===h[h.length-1]&&h.splice(h.length-1,1),h.toString().replace(/,/g,"")}function l(e,t,i,r,n,o){var s=a(e,t.font,{letterSpacing:o}),l=s/i,h=Math.ceil(l);if(-1===r||s<i)return{top:0,left:0,right:s,bottom:n};var c=0;return c=h<=r?h*n:r*n,{top:0,left:0,right:function(e,t,i,r){for(var n=e.split(""),a=parseInt(r),o=0,s=0;s<n.length;s++){var l=i(n[s]);if(!(o+l+a<=t)){o-=a;break}o+=l+a}return o}(e,i,function(e){return a(e,t.font,{letterSpacing:o})},o),bottom:c}}function h(e){var t=Cesium.defaultValue(e,{}),i=Cesium.defaultValue(t.symbol,{}),r=Cesium.defaultValue(i.font,{}),n=Cesium.defaultValue(t.pointDetail,t),a=Cesium.defaultValue(t.lineDetail,t),o=Cesium.defaultValue(t.polygonDetail,t);return{symbol:{color:Cesium.defaultValue(i.color,"rgba(0,0,0,1)"),haloColor:Cesium.defaultValue(i.haloColor,"rgba(255,255,255,0.5)"),haloSize:Cesium.defaultValue(i.haloSize,0),lineHeight:Cesium.defaultValue(i.lineHeight,1.1),lineWidth:Cesium.defaultValue(i.lineWidth,80),lineMaxNum:Cesium.defaultValue(i.lineMaxNum,3),textWraps:Cesium.defaultValue(i.textWraps,!1),letterSpacing:Cesium.defaultValue(i.letterSpacing,"0px"),xoffset:Cesium.defaultValue(i.xoffset,0),yoffset:Cesium.defaultValue(i.yoffset,0),angle:Cesium.defaultValue(i.angle,0),font:{size:Cesium.defaultValue(r.size,20),family:Cesium.defaultValue(r.family,"simHei"),weight:Cesium.defaultValue(r.weight,"normal"),style:Cesium.defaultValue(r.style,"normal")},showBackground:Cesium.defaultValue(i.showBackground,!1),backgroundColor:Cesium.defaultValue(i.backgroundColor,"rgba(42,42,42,0.8)"),backgroundPadding:Cesium.defaultValue(i.backgroundPadding,5),backgroundImage:Cesium.defaultValue(i.backgroundImage,void 0),showTextExtraIcon:Cesium.defaultValue(i.showTextExtraIcon,!1),textExtraIcon:Cesium.defaultValue(i.textExtraIcon,void 0),textExtraIconAnchor:Cesium.defaultValue(i.textExtraIconAnchor,"top"),textExtraIconSize:Cesium.defaultValue(i.textExtraIconSize,void 0),showTextDecorationUnderline:Cesium.defaultValue(i.showTextDecorationUnderline,!1),textDecorationUnderlineColor:Cesium.defaultValue(i.textDecorationUnderlineColor,Cesium.defaultValue(i.color,"rgba(255,255,255,1)")),textDecorationUnderlineWidth:Cesium.defaultValue(i.textDecorationUnderlineWidth,1),showTextDecorationThroughline:Cesium.defaultValue(i.showTextDecorationThroughline,!1),textDecorationThroughlineColor:Cesium.defaultValue(i.textDecorationThroughlineColor,Cesium.defaultValue(i.color,"rgba(255,255,255,1)")),textDecorationThroughlineWidth:Cesium.defaultValue(i.textDecorationThroughlineWidth,1),showTextShadow:Cesium.defaultValue(i.showTextShadow,!1),textShadowOffsetX:Cesium.defaultValue(i.textShadowOffsetX,1),textShadowOffsetY:Cesium.defaultValue(i.textShadowOffsetY,1),textShadowColor:Cesium.defaultValue(i.textShadowColor,"#cccccc"),textShadowBlur:Cesium.defaultValue(i.textShadowBlur,2)},maxScale:Cesium.defaultValue(t.maxScale,void 0),minScale:Cesium.defaultValue(t.minScale,void 0),scaleByDistance:Cesium.defaultValue(t.scaleByDistance,void 0),distanceDisplayCondition:Cesium.defaultValue(t.distanceDisplayCondition,void 0),heightReference:Cesium.defaultValue(t.heightReference,void 0),disableDepthTestDistance:Cesium.defaultValue(t.disableDepthTestDistance,void 0),pixelOffsetScaleByDistance:Cesium.defaultValue(t.pixelOffsetScaleByDistance,void 0),translucencyByDistance:Cesium.defaultValue(t.translucencyByDistance,void 0),cstyle:Cesium.defaultValue(t.style,void 0),cshow:Cesium.defaultValue(t.show,!0),cposition:Cesium.defaultValue(t.position,void 0),ctext:Cesium.defaultValue(t.text,void 0),cfont:Cesium.defaultValue(t.font,void 0),cfillColor:Cesium.defaultValue(t.fillColor,void 0),coutlineColor:Cesium.defaultValue(t.outlineColor,void 0),coutlineWidth:Cesium.defaultValue(t.outlineWidth,void 0),cshowBackground:Cesium.defaultValue(t.showBackground,void 0),cbackgroundColor:Cesium.defaultValue(t.backgroundColor,void 0),cbackgroundPadding:Cesium.defaultValue(t.backgroundPadding,void 0),cpixelOffset:Cesium.defaultValue(t.pixelOffset,void 0),ceyeOffset:Cesium.defaultValue(t.eyeOffset,void 0),chorizontalOrigin:Cesium.defaultValue(t.horizontalOrigin,void 0),cverticalOrigin:Cesium.defaultValue(t.verticalOrigin,void 0),cscale:Cesium.defaultValue(t.scale,1),renderMode:Cesium.defaultValue(t.renderMode,"canvas"),groundScale:Cesium.defaultValue(t.groundScale,20),labelHeight:Cesium.defaultValue(t.labelHeight,0),repeatLabel:Cesium.defaultValue(t.repeatLabel,!0),repeatLabelDistance:Cesium.defaultValue(t.repeatLabelDistance,6e3),repeatStartRate:Cesium.defaultValue(t.repeatStartRate,.3),repeatEndRate:Cesium.defaultValue(t.repeatEndRate,.7),pointDetail:{labelPlacement:Cesium.defaultValue(n.labelPlacement,"above-center"),currentAttributeName:Cesium.defaultValue(n.currentAttributeName,"n")},lineDetail:{labelPlacement:Cesium.defaultValue(a.labelPlacement,"above-line"),lineLabelSpread:Cesium.defaultValue(a.lineLabelSpread,"auto-spread"),labelPositionAlong:Cesium.defaultValue(a.labelPositionAlong,"middle"),currentAttributeName:Cesium.defaultValue(a.currentAttributeName,"ln")},polygonDetail:{labelPlacement:Cesium.defaultValue(o.labelPlacement,"skeleton"),currentAttributeName:Cesium.defaultValue(o.currentAttributeName,"name"),skeletonLineStartRate:Cesium.defaultValue(o.skeletonLineStartRate,.4),skeletonLineEndRate:Cesium.defaultValue(o.skeletonLineEndRate,.6)}}}function c(e,t){var i=t.symbol;e.symbol=i,e.renderMode=t.renderMode;var r=i.font,n={};n.fontStyle=r.style,n.fontVariant="normal",n.fontWeight=r.weight,n.fontSize=r.size+"px",n.fontFamily=r.family,e.fontStyleOptions=n,e.lineWidth=i.lineWidth,e.lineHeight=Math.max(i.lineHeight,1.1)*r.size,e.letterSpacing=i.letterSpacing;var a={},o=t.cstyle;a.color=i.color,a.haloColor=i.haloColor,a.haloSize=i.haloSize,void 0===o&&(a.color&&"none"!==a.color&&(o=0),a.haloColor&&"none"!==a.haloColor&&0!==a.haloSize&&(o=0===o?2:1),void 0===o&&(o=0)),e.drawStyles=a,e.drawMode=o,e.rotated=Cesium.defaultValue(i.rotated,!1),e.angle=Cesium.defaultValue(i.angle,0),e.showBackground=i.showBackground,e.backgroundColor=i.backgroundColor,e.backgroundPadding=i.backgroundPadding,e.backgroundImage=i.backgroundImage,e.showTextExtraIcon=i.showTextExtraIcon,e.textExtraIcon=i.textExtraIcon,e.textExtraIconAnchor=i.textExtraIconAnchor,e.textExtraIconSize=Cesium.defaultValue(i.textExtraIconSize,r.size),e.showTextDecorationUnderline=i.showTextDecorationUnderline,e.textDecorationUnderlineColor=i.textDecorationUnderlineColor,e.textDecorationUnderlineWidth=i.textDecorationUnderlineWidth,e.showTextDecorationThroughline=i.showTextDecorationThroughline,e.textDecorationThroughlineColor=i.textDecorationThroughlineColor,e.textDecorationThroughlineWidth=i.textDecorationThroughlineWidth,e.showTextShadow=i.showTextShadow,e.textShadowOffsetX=i.textShadowOffsetX,e.textShadowOffsetY=i.textShadowOffsetY,e.textShadowColor=i.textShadowColor,e.textShadowBlur=i.textShadowBlur,e.verticalAlignment=i.verticalAlignment,e.horizontalAlignment=i.horizontalAlignment,e.defaultText=i.text,e.xoffset=i.xoffset,e.yoffset=i.yoffset,e.textWraps=i.textWraps,e.lineMaxNum=i.lineMaxNum,e.labelHeight=t.labelHeight,e.maxScale=t.maxScale,e.minScale=t.minScale,e.scaleByDistance=t.scaleByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightReference=t.heightReference,e.disableDepthTestDistance=t.disableDepthTestDistance,e.pixelOffsetScaleByDistance=t.pixelOffsetScaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.cshow=t.cshow,e.cposition=t.cposition,e.ctext=t.ctext,e.cfont=t.cfont,e.cfillColor=t.cfillColor,e.coutlineColor=t.coutlineColor,e.coutlineWidth=t.coutlineWidth,e.cshowBackground=t.cshowBackground,e.cbackgroundColor=t.cbackgroundColor,e.cbackgroundPadding=t.cbackgroundPadding,e.cpixelOffset=t.cpixelOffset,e.ceyeOffset=t.ceyeOffset,e.chorizontalOrigin=t.chorizontalOrigin,e.cverticalOrigin=t.cverticalOrigin,e.cscale=t.cscale,e.groundScale=t.groundScale,e.repeatLabel=t.repeatLabel,e.repeatLabelDistance=t.repeatLabelDistance,e.repeatStartRate=t.repeatStartRate,e.repeatEndRate=t.repeatEndRate;e.textDefinition=2}function u(e){var t={},i=h(e);c(t,i);for(var r=i.pointDetail;t.angle<0;)t.angle+=360;for(;t.angle>360;)t.angle-=360;t.currentAttributeName=r.currentAttributeName;var n=0,a=0;if(t.labelPlacement=Cesium.defaultValue(r.labelPlacement,"above-center"),"angle"===t.labelPlacement)n=0,a=0;else if("labels-layer"===t.labelPlacement)n=1,a=1;else switch(t.labelPlacement){case"center-center":n=0,a=0;break;case"center-left":n=-1,a=0;break;case"center-right":n=1,a=0;break;case"above-center":n=0,a=1;break;case"below-center":n=0,a=-1;break;case"above-left":n=-1,a=1;break;case"above-right":n=1,a=1;break;case"below-left":n=-1,a=-1;break;case"below-right":n=1,a=-1;break;default:n=0,a=0}return t.positionOffsetXRate=n,t.positionOffsetYRate=a,t}function d(e){var t={},i=h(e);c(t,i);var r=i.lineDetail;t.currentAttributeName=r.currentAttributeName,t.lineLabelSpread=r.lineLabelSpread,t.labelPositionAlong=r.labelPositionAlong,t.repeat=r.repeat,t.angle=0;var n=0,a=0;switch(t.type=Cesium.defaultValue(r.labelPlacement,"on-line"),t.type){case"on-line":n=0,a=0,t.xoffset=0,t.yoffset=0;break;case"above-line":n=0,a=1;break;case"below-line":n=0,a=-1;break;default:n=0,a=0,t.xoffset=0,t.yoffset=0}return t.positionOffsetXRate=n,t.positionOffsetYRate=a,t}function p(e){var t={},i=h(e);c(t,i),t.rotated=!1,t.angle=0;var r=i.polygonDetail;t.currentAttributeName=r.currentAttributeName,t.skeletonLineStartRate=r.skeletonLineStartRate,t.skeletonLineEndRate=r.skeletonLineEndRate;return t.positionOffsetXRate=0,t.positionOffsetYRate=1,t.type=r.labelPlacement,t}function f(e){var t=!1,i=e.charAt(0),r=e.charAt(e.length-1);if("/"===i&&"/"===r){var n=e.match(/\//g);n&&n.length>=3&&(t=!0)}return t}function m(e){var t=!1;return(e.includes("#+")||e.includes("#-"))&&(t=!0),t}function y(e,t,i,r,n,a,o){e.font=n,o&&e.strokeText(t,i,r),a&&e.fillText(t,i,r)}var g={drawText:r,createNoteCanvas:n,getTextWidth:a,calcNoteBounds:l,parseLabelsOption:h,FontStyleOptions:o,parseNoteOptions:function(e,t){if("Point"===e)return u(t);if("Line"===e)return d(t);if("Polygon"===e)return p(t);throw new Error("要素类型不匹配,无法解析注记选项!")},parsePointOptions:u,parseLineOptions:d,parsePolygonOptions:p,calcWrapsDetailText:s,createNoteBillBoardOptions:function(e,t,i,r){var a=n(t,r),o=r.positionOffsetXRate,s=r.positionOffsetYRate,l=r.textDefinition,h=r.scaleByDistance,c=r.distanceDisplayCondition;c=void 0===c?[r.maxScale,r.minScale].some(function(e){return void 0===e})?void 0:new Cesium.DistanceDisplayCondition(r.maxScale,r.minScale):r.distanceDisplayCondition;var u,d=r.heightReference||Cesium.HeightReference.NONE,p=r.disableDepthTestDistance||0,f=r.pixelOffsetScaleByDistance,m=r.translucencyByDistance,y=r.cshow,g=r.cposition,v=r.cpixelOffset,b=r.ceyeOffset,_=r.chorizontalOrigin,w=r.cverticalOrigin,x=r.cscale,C=r.xoffset,S=r.yoffset,M=r.angle,k=Cesium.Cartographic.fromCartesian(i);k.height=k.height+r.labelHeight,u=Cesium.Cartographic.toCartesian(k);var T=M/180*Math.PI,I=0,O=0;if("labels-layer"===r.type){var E=a.width;I=E/2*Math.cos(T),O=E/2*Math.sin(T)}return v&&(v=new Cesium.Cartesian2(v.x+I,v.y-O)),{show:y,image:a,position:g||u,id:e,pixelOffset:v||new Cesium.Cartesian2(C+I,S-O),eyeOffset:b,horizontalOrigin:_||o,verticalOrigin:w||s,rotation:T,scaleByDistance:h,scale:1/l*x,distanceDisplayCondition:c,heightReference:d,disableDepthTestDistance:p,pixelOffsetScaleByDistance:f,translucencyByDistance:m}},createLabelOptions:function(e,t,i,r){var n,a=r.positionOffsetXRate,l=r.positionOffsetYRate,h=r.xoffset,c=r.yoffset,u=r.angle,d=r.drawStyles,p=r.scaleByDistance,f=r.distanceDisplayCondition;f=void 0===f?[r.maxScale,r.minScale].some(function(e){return void 0===e})?void 0:new Cesium.DistanceDisplayCondition(r.maxScale,r.minScale):r.distanceDisplayCondition;var m=r.heightReference||Cesium.HeightReference.NONE,y=r.disableDepthTestDistance||0,g=r.pixelOffsetScaleByDistance,v=r.translucencyByDistance,b=r.cshow,_=r.cposition,w=r.ctext,x=r.cfont,C=r.cfillColor,S=r.coutlineColor,M=r.coutlineWidth,k=r.cshowBackground,T=r.cbackgroundColor,I=r.cbackgroundPadding,O=r.cpixelOffset,E=r.ceyeOffset,L=r.chorizontalOrigin,P=r.cverticalOrigin,R=r.cscale;n=0===r.drawMode?Cesium.LabelStyle.FILL:(r.drawMode,Cesium.LabelStyle.FILL_AND_OUTLINE);var j=new o(r.fontStyleOptions),A=t;r.textWraps&&(A=s(t,j,r.lineWidth,r.lineMaxNum));var z=Cesium.defaultValue(k,Cesium.defaultValue(r.showBackground,!1)),D=5,V=5;Cesium.defined(r.backgroundPadding)&&(Array.isArray(r.backgroundPadding)?(D=r.backgroundPadding[0],V=r.backgroundPadding[1]):(D=r.backgroundPadding,V=r.backgroundPadding));var N,G=Cesium.defaultValue(r.backgroundColor,"rgba(42,42,42,0.8)"),F=Cesium.Cartographic.fromCartesian(i);F.height=F.height+r.labelHeight,N=Cesium.Cartographic.toCartesian(F);var B=u/180*Math.PI;return{show:b,text:w||A,font:x||j.font,position:_||N,id:e,pixelOffset:O||new Cesium.Cartesian2(h,c),eyeOffset:E,horizontalOrigin:L||a,verticalOrigin:P||l,rotation:B,scaleByDistance:p,fillColor:C||Cesium.Color.fromCssColorString(d.color),outlineColor:S||Cesium.Color.fromCssColorString(d.haloColor),outlineWidth:M||0!==d.haloSize?d.haloSize:void 0,style:n,scale:R,showBackground:z,backgroundColor:T||Cesium.Color.fromCssColorString(G),backgroundPadding:I||new Cesium.Cartesian2(D,V),distanceDisplayCondition:f,heightReference:m,disableDepthTestDistance:y,pixelOffsetScaleByDistance:g,translucencyByDistance:v}},createGroundOptions:function(e,t,i,r){var a,o=n(t,r),s=r.positionOffsetXRate,l=r.positionOffsetYRate,h=r.textDefinition,c=r.groundScale,u=r.cscale,d=r.angle,p=new Image;p.src=o.toDataURL("image/png");var f,m=o.width?o.width*u*c:100,y=o.height?o.height*u*c:100,g=[new Cesium.Cartesian3(0,0,0),new Cesium.Cartesian3(m,0,0),new Cesium.Cartesian3(m,y,0),new Cesium.Cartesian3(0,y,0)],v=Cesium.Matrix4.IDENTITY.clone(),b=Cesium.Transforms.eastNorthUpToFixedFrame(i);1===s?Cesium.Matrix4.multiply(v,Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0,0,0)),v):-1===s?Cesium.Matrix4.multiply(v,Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(-m,0,0)),v):Cesium.Matrix4.multiply(v,Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(-m/2,0,0)),v),v=1===l?Cesium.Matrix4.multiply(v,Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0,-y,0)),v):-1===l?Cesium.Matrix4.multiply(v,Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0,0,0)),v):Cesium.Matrix4.multiply(v,Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0,-y/2,0)),v),Cesium.Matrix4.multiply(v,Cesium.Matrix4.fromScale(new Cesium.Cartesian3(1/h,1/h,1)),v),f=g.map(function(e){var t=Cesium.Matrix4.multiplyByPoint(b,Cesium.Matrix4.multiplyByPoint(v,e,v),new Cesium.Cartesian3),i=Cesium.Cartographic.fromCartesian(t);return Cesium.Cartographic.toCartesian(i)});var _=new Cesium.RectangleGeometry({rectangle:Cesium.Rectangle.fromCartesianArray(f),rotation:d*Math.PI/180,stRotation:d*Math.PI/180,height:1}),w=new Cesium.GeometryInstance({id:Cesium.createGuid(),geometry:_});return(a=new Cesium.GroundPrimitive({geometryInstances:w,asynchronous:!0,classificationType:Cesium.ClassificationType.TERRAIN,appearance:new Cesium.MaterialAppearance({material:new Cesium.Material({type:"MapGISLabelGround",fabric:{materials:{SwipeMaterial:{type:"MaskMaterial"},ImageMaterial:{type:"Image",uniforms:{image:p}}},components:{markCull:"SwipeMaterial.markCull",diffuse:"ImageMaterial.diffuse",alpha:"ImageMaterial.alpha"}}})}),swipeEnabled:r.swipeEnabled,swipeInverse:r.swipeInverse}))._cacheGroundRect=_.rectangle,a}};t.a=g},function(e,t,i){"use strict";(function(e,r){i.d(t,"a",function(){return X}),i.d(t,"b",function(){return $i}),i.d(t,"c",function(){return pi}),i.d(t,"d",function(){return Ji});var n={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},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.",example:{anchor:"viewport",color:"white",intensity:.4}},sources:{required:!0,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).",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}},layers:{required:!0,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"}}]}},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_geojson","source_video","source_image"],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://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},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 `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers."},"*":{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://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},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."},"*":{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://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},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"},"*":{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."},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)."},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 `{<sourceLayer>: <propertyName>}`."}},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:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},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",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.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",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",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",macos:"0.7.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",macos:"0.1.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`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},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:"A 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."},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_hillshade","layout_background"],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",macos:"0.1.0"}},"property-type":"constant"}},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",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.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",macos:"0.1.0"}},"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",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.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",macos:"0.1.0"}},"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",macos:"0.7.0"}},"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",macos:"0.5.0"}},"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",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"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",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.1.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",macos:"0.1.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",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.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",macos:"0.1.0"}},"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",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.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",macos:"0.1.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",macos:"0.1.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",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.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",macos:"0.12.0"}},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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.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",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",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",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.6.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",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.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",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.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.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.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",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.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",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.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",macos:"0.14.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",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.1.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 with point placement would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols with point placement 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. The order of elements in an array define priority order for the placement of an orientation variant.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.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",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.0"}},"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",macos:"0.1.0"}},"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",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},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'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.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"}}},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"}}},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",macos:"0.7.0"}}},match:{doc:'Selects the output whose label value matches the input value, or the fallback value if no match is found. The input can be any expression (e.g. `["get", "building_type"]`). Each label must be either:\n - a single literal value; or\n - an array of literal values, whose values must be all strings or all numbers (e.g. `[100, 101]` or `["c", "b"]`). The input matches if any of the values in the array matches, similar to the `"in"` operator.\nEach label must be unique. If 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",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.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",macos:"0.7.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<number>`, 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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.9.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",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns an `image` type for use in `icon-image`, `*-pattern` entries and as a section in the `format` expression. If set, the `image` argument will check that the requested image exists in the style and will return either the resolved image name or `null`, depending on whether or not the image 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.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.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 `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"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a 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, 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. 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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.0"}}},length:{doc:"Gets 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",macos:"0.7.0"}}},properties:{doc:'Gets 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",macos:"0.7.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"}}},"geometry-type":{doc:"Gets the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Gets 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",macos:"0.7.0"}}},zoom:{doc:'Gets 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:"Zoom","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"heatmap-density":{doc:"Gets 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",macos:"0.7.0"}}},"line-progress":{doc:"Gets 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",macos:"0.12.0"}}},accumulated:{doc:"Gets 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"}}},"+":{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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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":{android:"9.2.0",ios:"5.9.0",macos:"0.16.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.15.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"}}},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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.9.0"}}}}},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",macos:"0.5.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",macos:"0.5.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",macos:"0.5.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",macos:"0.5.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],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",macos:"0.1.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",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.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",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,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",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"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",macos:"0.5.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",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.5.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",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,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",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-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",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,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",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},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",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.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",macos:"0.1.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",macos:"0.2.1"}},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",macos:"0.6.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",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.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",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.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",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"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",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.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",macos:"0.1.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",macos:"0.9.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",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"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`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"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",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"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",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"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",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,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",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"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",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"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."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It 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."}}};var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{};function o(e,t){return e(t={exports:{}},t.exports),t.exports}var s=o(function(e,t){!function(i){var r=t&&!t.nodeType&&t,n=e&&!e.nodeType&&e,o="object"==typeof a&&a;o.global!==o&&o.window!==o&&o.self!==o||(i=o);var s,l,h=2147483647,c=36,u=1,d=26,p=38,f=700,m=72,y=128,g="-",v=/^xn--/,b=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=c-u,C=Math.floor,S=String.fromCharCode;function M(e){throw RangeError(w[e])}function k(e,t){for(var i=e.length,r=[];i--;)r[i]=t(e[i]);return r}function T(e,t){var i=e.split("@"),r="";return i.length>1&&(r=i[0]+"@",e=i[1]),r+k((e=e.replace(_,".")).split("."),t).join(".")}function I(e){for(var t,i,r=[],n=0,a=e.length;n<a;)(t=e.charCodeAt(n++))>=55296&&t<=56319&&n<a?56320==(64512&(i=e.charCodeAt(n++)))?r.push(((1023&t)<<10)+(1023&i)+65536):(r.push(t),n--):r.push(t);return r}function O(e){return k(e,function(e){var t="";return e>65535&&(t+=S((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=S(e)}).join("")}function E(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:c}function L(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function P(e,t,i){var r=0;for(e=i?C(e/f):e>>1,e+=C(e/t);e>x*d>>1;r+=c)e=C(e/x);return C(r+(x+1)*e/(e+p))}function R(e){var t,i,r,n,a,o,s,l,p,f,v=[],b=e.length,_=0,w=y,x=m;for((i=e.lastIndexOf(g))<0&&(i=0),r=0;r<i;++r)e.charCodeAt(r)>=128&&M("not-basic"),v.push(e.charCodeAt(r));for(n=i>0?i+1:0;n<b;){for(a=_,o=1,s=c;n>=b&&M("invalid-input"),((l=E(e.charCodeAt(n++)))>=c||l>C((h-_)/o))&&M("overflow"),_+=l*o,!(l<(p=s<=x?u:s>=x+d?d:s-x));s+=c)o>C(h/(f=c-p))&&M("overflow"),o*=f;x=P(_-a,t=v.length+1,0==a),C(_/t)>h-w&&M("overflow"),w+=C(_/t),_%=t,v.splice(_++,0,w)}return O(v)}function j(e){var t,i,r,n,a,o,s,l,p,f,v,b,_,w,x,k=[];for(b=(e=I(e)).length,t=y,i=0,a=m,o=0;o<b;++o)(v=e[o])<128&&k.push(S(v));for(r=n=k.length,n&&k.push(g);r<b;){for(s=h,o=0;o<b;++o)(v=e[o])>=t&&v<s&&(s=v);for(s-t>C((h-i)/(_=r+1))&&M("overflow"),i+=(s-t)*_,t=s,o=0;o<b;++o)if((v=e[o])<t&&++i>h&&M("overflow"),v==t){for(l=i,p=c;!(l<(f=p<=a?u:p>=a+d?d:p-a));p+=c)x=l-f,w=c-f,k.push(S(L(f+x%w,0))),l=C(x/w);k.push(S(L(l,0))),a=P(i,_,r==n),i=0,++r}++i,++t}return k.join("")}if(s={version:"1.3.2",ucs2:{decode:I,encode:O},decode:R,encode:j,toASCII:function(e){return T(e,function(e){return b.test(e)?"xn--"+j(e):e})},toUnicode:function(e){return T(e,function(e){return v.test(e)?R(e.slice(4).toLowerCase()):e})}},r&&n)if(e.exports==r)n.exports=s;else for(l in s)s.hasOwnProperty(l)&&(r[l]=s[l]);else i.punycode=s}(a)}),l={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}};function h(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var c=function(e,t,i,r){t=t||"&",i=i||"=";var n={};if("string"!=typeof e||0===e.length)return n;var a=/\+/g;e=e.split(t);var o=1e3;r&&"number"==typeof r.maxKeys&&(o=r.maxKeys);var s=e.length;o>0&&s>o&&(s=o);for(var l=0;l<s;++l){var c,u,d,p,f=e[l].replace(a,"%20"),m=f.indexOf(i);m>=0?(c=f.substr(0,m),u=f.substr(m+1)):(c=f,u=""),d=decodeURIComponent(c),p=decodeURIComponent(u),h(n,d)?Array.isArray(n[d])?n[d].push(p):n[d]=[n[d],p]:n[d]=p}return n},u=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},d=function(e,t,i,r){return t=t||"&",i=i||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(r){var n=encodeURIComponent(u(r))+i;return Array.isArray(e[r])?e[r].map(function(e){return n+encodeURIComponent(u(e))}).join(t):n+encodeURIComponent(u(e[r]))}).join(t):r?encodeURIComponent(u(r))+i+encodeURIComponent(u(e)):""},p=o(function(e,t){t.decode=t.parse=c,t.encode=t.stringify=d});p.decode,p.parse,p.encode,p.stringify;function f(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var m=/^([a-z0-9.+-]+:)/i,y=/:[0-9]*$/,g=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,v=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),b=["'"].concat(v),_=["%","/","?",";","#"].concat(b),w=["/","?","#"],x=/^[+a-z0-9A-Z_-]{0,63}$/,C=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,S={javascript:!0,"javascript:":!0},M={javascript:!0,"javascript:":!0},k={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function T(e,t,i){if(e&&l.isObject(e)&&e instanceof f)return e;var r=new f;return r.parse(e,t,i),r}f.prototype.parse=function(e,t,i){if(!l.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),n=-1!==r&&r<e.indexOf("#")?"?":"#",a=e.split(n);a[0]=a[0].replace(/\\/g,"/");var o=e=a.join(n);if(o=o.trim(),!i&&1===e.split("#").length){var h=g.exec(o);if(h)return this.path=o,this.href=o,this.pathname=h[1],h[2]?(this.search=h[2],this.query=t?p.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var c=m.exec(o);if(c){var u=(c=c[0]).toLowerCase();this.protocol=u,o=o.substr(c.length)}if(i||c||o.match(/^\/\/[^@\/]+@[^@\/]+/)){var d="//"===o.substr(0,2);!d||c&&M[c]||(o=o.substr(2),this.slashes=!0)}if(!M[c]&&(d||c&&!k[c])){for(var f,y,v=-1,T=0;T<w.length;T++){-1!==(I=o.indexOf(w[T]))&&(-1===v||I<v)&&(v=I)}-1!==(y=-1===v?o.lastIndexOf("@"):o.lastIndexOf("@",v))&&(f=o.slice(0,y),o=o.slice(y+1),this.auth=decodeURIComponent(f)),v=-1;for(T=0;T<_.length;T++){var I;-1!==(I=o.indexOf(_[T]))&&(-1===v||I<v)&&(v=I)}-1===v&&(v=o.length),this.host=o.slice(0,v),o=o.slice(v),this.parseHost(),this.hostname=this.hostname||"";var O="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!O)for(var E=this.hostname.split(/\./),L=(T=0,E.length);T<L;T++){var P=E[T];if(P&&!P.match(x)){for(var R="",j=0,A=P.length;j<A;j++)P.charCodeAt(j)>127?R+="x":R+=P[j];if(!R.match(x)){var z=E.slice(0,T),D=E.slice(T+1),V=P.match(C);V&&(z.push(V[1]),D.unshift(V[2])),D.length&&(o="/"+D.join(".")+o),this.hostname=z.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=s.toASCII(this.hostname));var N=this.port?":"+this.port:"",G=this.hostname||"";this.host=G+N,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!S[u])for(T=0,L=b.length;T<L;T++){var F=b[T];if(-1!==o.indexOf(F)){var B=encodeURIComponent(F);B===F&&(B=escape(F)),o=o.split(F).join(B)}}var q=o.indexOf("#");-1!==q&&(this.hash=o.substr(q),o=o.slice(0,q));var U=o.indexOf("?");if(-1!==U?(this.search=o.substr(U),this.query=o.substr(U+1),t&&(this.query=p.parse(this.query)),o=o.slice(0,U)):t&&(this.search="",this.query={}),o&&(this.pathname=o),k[u]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){N=this.pathname||"";var W=this.search||"";this.path=N+W}return this.href=this.format(),this},f.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",i=this.pathname||"",r=this.hash||"",n=!1,a="";this.host?n=e+this.host:this.hostname&&(n=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&l.isObject(this.query)&&Object.keys(this.query).length&&(a=p.stringify(this.query));var o=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||k[t])&&!1!==n?(n="//"+(n||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):n||(n=""),r&&"#"!==r.charAt(0)&&(r="#"+r),o&&"?"!==o.charAt(0)&&(o="?"+o),t+n+(i=i.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(o=o.replace("#","%23"))+r},f.prototype.resolve=function(e){return this.resolveObject(T(e,!1,!0)).format()},f.prototype.resolveObject=function(e){if(l.isString(e)){var t=new f;t.parse(e,!1,!0),e=t}for(var i=new f,r=Object.keys(this),n=0;n<r.length;n++){var a=r[n];i[a]=this[a]}if(i.hash=e.hash,""===e.href)return i.href=i.format(),i;if(e.slashes&&!e.protocol){for(var o=Object.keys(e),s=0;s<o.length;s++){var h=o[s];"protocol"!==h&&(i[h]=e[h])}return k[i.protocol]&&i.hostname&&!i.pathname&&(i.path=i.pathname="/"),i.href=i.format(),i}if(e.protocol&&e.protocol!==i.protocol){if(!k[e.protocol]){for(var c=Object.keys(e),u=0;u<c.length;u++){var d=c[u];i[d]=e[d]}return i.href=i.format(),i}if(i.protocol=e.protocol,e.host||M[e.protocol])i.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),i.pathname=p.join("/")}if(i.search=e.search,i.query=e.query,i.host=e.host||"",i.auth=e.auth,i.hostname=e.hostname||e.host,i.port=e.port,i.pathname||i.search){var m=i.pathname||"",y=i.search||"";i.path=m+y}return i.slashes=i.slashes||e.slashes,i.href=i.format(),i}var g=i.pathname&&"/"===i.pathname.charAt(0),v=e.host||e.pathname&&"/"===e.pathname.charAt(0),b=v||g||i.host&&e.pathname,_=b,w=i.pathname&&i.pathname.split("/")||[],x=(p=e.pathname&&e.pathname.split("/")||[],i.protocol&&!k[i.protocol]);if(x&&(i.hostname="",i.port=null,i.host&&(""===w[0]?w[0]=i.host:w.unshift(i.host)),i.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),b=b&&(""===p[0]||""===w[0])),v)i.host=e.host||""===e.host?e.host:i.host,i.hostname=e.hostname||""===e.hostname?e.hostname:i.hostname,i.search=e.search,i.query=e.query,w=p;else if(p.length)w||(w=[]),w.pop(),w=w.concat(p),i.search=e.search,i.query=e.query;else if(!l.isNullOrUndefined(e.search)){if(x)i.hostname=i.host=w.shift(),(O=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=O.shift(),i.host=i.hostname=O.shift());return i.search=e.search,i.query=e.query,l.isNull(i.pathname)&&l.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!w.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var C=w.slice(-1)[0],S=(i.host||e.host||w.length>1)&&("."===C||".."===C)||""===C,T=0,I=w.length;I>=0;I--)"."===(C=w[I])?w.splice(I,1):".."===C?(w.splice(I,1),T++):T&&(w.splice(I,1),T--);if(!b&&!_)for(;T--;T)w.unshift("..");!b||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),S&&"/"!==w.join("/").substr(-1)&&w.push("");var O,E=""===w[0]||w[0]&&"/"===w[0].charAt(0);x&&(i.hostname=i.host=E?"":w.length?w.shift():"",(O=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=O.shift(),i.host=i.hostname=O.shift()));return(b=b||i.host&&w.length)&&!E&&w.unshift(""),w.length?i.pathname=w.join("/"):(i.pathname=null,i.path=null),l.isNull(i.pathname)&&l.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=e.auth||i.auth,i.slashes=i.slashes||e.slashes,i.href=i.format(),i},f.prototype.parseHost=function(){var e=this.host,t=y.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};function I(e){for(var t=[],i=arguments.length-1;i-- >0;)t[i]=arguments[i+1];for(var r=0,n=t;r<n.length;r+=1){var a=n[r];for(var o in a)e[o]=a[o]}return e}var O=function(e){function t(t,i){e.call(this,i),this.message=i,this.key=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error),E=function(e,t){void 0===t&&(t=[]),this.parent=e,this.bindings={};for(var i=0,r=t;i<r.length;i+=1){var n=r[i],a=n[0],o=n[1];this.bindings[a]=o}};E.prototype.concat=function(e){return new E(this,e)},E.prototype.get=function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(e+" not found in scope.")},E.prototype.has=function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)};var L={kind:"null"},P={kind:"number"},R={kind:"string"},j={kind:"boolean"},A={kind:"color"},z={kind:"object"},D={kind:"value"},V={kind:"collator"},N={kind:"formatted"},G={kind:"resolvedImage"};function F(e,t){return{kind:"array",itemType:e,N:t}}function B(e){if("array"===e.kind){var t=B(e.itemType);return"number"==typeof e.N?"array<"+t+", "+e.N+">":"value"===e.itemType.kind?"array":"array<"+t+">"}return e.kind}var q=[L,P,R,j,A,N,z,F(D),G];function U(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!U(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(var i=0,r=q;i<r.length;i+=1){if(!U(r[i],t))return null}}return"Expected "+B(e)+" but found "+B(t)+" instead."}function W(e,t){return t.some(function(t){return t.kind===e.kind})}function H(e,t){return t.some(function(t){return"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e})}var Y=o(function(e,t){var i={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function r(e){return(e=Math.round(e))<0?0:e>255?255:e}function n(e){return e<0?0:e>1?1:e}function a(e){return"%"===e[e.length-1]?r(parseFloat(e)/100*255):r(parseInt(e))}function o(e){return"%"===e[e.length-1]?n(parseFloat(e)/100):n(parseFloat(e))}function s(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}try{t.parseCSSColor=function(e){var t,n=e.replace(/ /g,"").toLowerCase();if(n in i)return i[n].slice();if("#"===n[0])return 4===n.length?(t=parseInt(n.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===n.length&&(t=parseInt(n.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var l=n.indexOf("("),h=n.indexOf(")");if(-1!==l&&h+1===n.length){var c=n.substr(0,l),u=n.substr(l+1,h-(l+1)).split(","),d=1;switch(c){case"rgba":if(4!==u.length)return null;d=o(u.pop());case"rgb":return 3!==u.length?null:[a(u[0]),a(u[1]),a(u[2]),d];case"hsla":if(4!==u.length)return null;d=o(u.pop());case"hsl":if(3!==u.length)return null;var p=(parseFloat(u[0])%360+360)%360/360,f=o(u[1]),m=o(u[2]),y=m<=.5?m*(f+1):m+f-m*f,g=2*m-y;return[r(255*s(g,y,p+1/3)),r(255*s(g,y,p)),r(255*s(g,y,p-1/3)),d];default:return null}}return null}}catch(e){}}).parseCSSColor,X=function(e,t,i,r){void 0===r&&(r=1),this.r=e,this.g=t,this.b=i,this.a=r};X.parse=function(e){if(e){if(e instanceof X)return e;if("string"==typeof e){var t=Y(e);if(t)return new X(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},X.prototype.toString=function(){var e=this.toArray(),t=e[0],i=e[1],r=e[2],n=e[3];return"rgba("+Math.round(t)+","+Math.round(i)+","+Math.round(r)+","+n+")"},X.prototype.toArray=function(){var e=this.r,t=this.g,i=this.b,r=this.a;return 0===r?[0,0,0,0]:[255*e/r,255*t/r,255*i/r,r]},X.black=new X(0,0,0,1),X.white=new X(1,1,1,1),X.transparent=new X(0,0,0,0),X.red=new X(1,0,0,1);var $=function(e,t,i){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};$.prototype.compare=function(e,t){return this.collator.compare(e,t)},$.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var J=function(e,t,i,r,n){this.text=e,this.image=t,this.scale=i,this.fontStack=r,this.textColor=n},K=function(e){this.sections=e};K.fromString=function(e){return new K([new J(e,null,null,null,null)])},K.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some(function(e){return 0!==e.text.length||e.image&&0!==e.image.name.length})},K.factory=function(e){return e instanceof K?e:K.fromString(e)},K.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map(function(e){return e.text}).join("")},K.prototype.serialize=function(){for(var e=["format"],t=0,i=this.sections;t<i.length;t+=1){var r=i[t];if(r.image)e.push(["image",r.image.name]);else{e.push(r.text);var n={};r.fontStack&&(n["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(n["font-scale"]=r.scale),r.textColor&&(n["text-color"]=["rgba"].concat(r.textColor.toArray())),e.push(n)}}return e};var Z=function(e){this.name=e.name,this.available=e.available};function Q(e,t,i,r){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value ["+[e,t,i,r].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof r?[e,t,i,r]:[e,t,i]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ee(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof X)return!0;if(e instanceof $)return!0;if(e instanceof K)return!0;if(e instanceof Z)return!0;if(Array.isArray(e)){for(var t=0,i=e;t<i.length;t+=1){if(!ee(i[t]))return!1}return!0}if("object"==typeof e){for(var r in e)if(!ee(e[r]))return!1;return!0}return!1}function te(e){if(null===e)return L;if("string"==typeof e)return R;if("boolean"==typeof e)return j;if("number"==typeof e)return P;if(e instanceof X)return A;if(e instanceof $)return V;if(e instanceof K)return N;if(e instanceof Z)return G;if(Array.isArray(e)){for(var t,i=e.length,r=0,n=e;r<n.length;r+=1){var a=te(n[r]);if(t){if(t===a)continue;t=D;break}t=a}return F(t||D,i)}return z}function ie(e){var t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof X||e instanceof K||e instanceof Z?e.toString():JSON.stringify(e)}Z.prototype.toString=function(){return this.name},Z.fromString=function(e){return e?new Z({name:e,available:!1}):null},Z.prototype.serialize=function(){return["image",this.name]};var re=function(e,t){this.type=e,this.value=t};re.parse=function(e,t){if(2!==e.length)return t.error("'literal' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(!ee(e[1]))return t.error("invalid value");var i=e[1],r=te(i),n=t.expectedType;return"array"!==r.kind||0!==r.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(r=n),new re(r,i)},re.prototype.evaluate=function(){return this.value},re.prototype.eachChild=function(){},re.prototype.outputDefined=function(){return!0},re.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof X?["rgba"].concat(this.value.toArray()):this.value instanceof K?this.value.serialize():this.value};var ne=function(e){this.name="ExpressionEvaluationError",this.message=e};ne.prototype.toJSON=function(){return this.message};var ae={string:R,number:P,boolean:j,object:z},oe=function(e,t){this.type=e,this.args=t};oe.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var i,r=1,n=e[0];if("array"===n){var a,o;if(e.length>2){var s=e[1];if("string"!=typeof s||!(s in ae)||"object"===s)return t.error('The item type argument of "array" must be one of string, number, boolean',1);a=ae[s],r++}else a=D;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],r++}i=F(a,o)}else i=ae[n];for(var l=[];r<e.length;r++){var h=t.parse(e[r],r,D);if(!h)return null;l.push(h)}return new oe(i,l)},oe.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var i=this.args[t].evaluate(e);if(!U(this.type,te(i)))return i;if(t===this.args.length-1)throw new ne("Expected value to be of type "+B(this.type)+", but found "+B(te(i))+" instead.")}return null},oe.prototype.eachChild=function(e){this.args.forEach(e)},oe.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},oe.prototype.serialize=function(){var e=this.type,t=[e.kind];if("array"===e.kind){var i=e.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){t.push(i.kind);var r=e.N;("number"==typeof r||this.args.length>1)&&t.push(r)}}return t.concat(this.args.map(function(e){return e.serialize()}))};var se=function(e){this.type=N,this.sections=e};se.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var i=e[1];if(!Array.isArray(i)&&"object"==typeof i)return t.error("First argument must be an image or text section.");for(var r=[],n=!1,a=1;a<=e.length-1;++a){var o=e[a];if(n&&"object"==typeof o&&!Array.isArray(o)){n=!1;var s=null;if(o["font-scale"]&&!(s=t.parse(o["font-scale"],1,P)))return null;var l=null;if(o["text-font"]&&!(l=t.parse(o["text-font"],1,F(R))))return null;var h=null;if(o["text-color"]&&!(h=t.parse(o["text-color"],1,A)))return null;var c=r[r.length-1];c.scale=s,c.font=l,c.textColor=h}else{var u=t.parse(e[a],1,D);if(!u)return null;var d=u.type.kind;if("string"!==d&&"value"!==d&&"null"!==d&&"resolvedImage"!==d)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,r.push({content:u,scale:null,font:null,textColor:null})}}return new se(r)},se.prototype.evaluate=function(e){return new K(this.sections.map(function(t){var i=t.content.evaluate(e);return te(i)===G?new J("",i,null,null,null):new J(ie(i),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)}))},se.prototype.eachChild=function(e){for(var t=0,i=this.sections;t<i.length;t+=1){var r=i[t];e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}},se.prototype.outputDefined=function(){return!1},se.prototype.serialize=function(){for(var e=["format"],t=0,i=this.sections;t<i.length;t+=1){var r=i[t];e.push(r.content.serialize());var n={};r.scale&&(n["font-scale"]=r.scale.serialize()),r.font&&(n["text-font"]=r.font.serialize()),r.textColor&&(n["text-color"]=r.textColor.serialize()),e.push(n)}return e};var le=function(e){this.type=G,this.input=e};le.parse=function(e,t){if(2!==e.length)return t.error("Expected two arguments.");var i=t.parse(e[1],1,R);return i?new le(i):t.error("No image name provided.")},le.prototype.evaluate=function(e){var t=this.input.evaluate(e),i=Z.fromString(t);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(t)>-1),i},le.prototype.eachChild=function(e){e(this.input)},le.prototype.outputDefined=function(){return!1},le.prototype.serialize=function(){return["image",this.input.serialize()]};var he={"to-boolean":j,"to-color":A,"to-number":P,"to-string":R},ce=function(e,t){this.type=e,this.args=t};ce.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var i=e[0];if(("to-boolean"===i||"to-string"===i)&&2!==e.length)return t.error("Expected one argument.");for(var r=he[i],n=[],a=1;a<e.length;a++){var o=t.parse(e[a],a,D);if(!o)return null;n.push(o)}return new ce(r,n)},ce.prototype.evaluate=function(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){for(var t,i,r=0,n=this.args;r<n.length;r+=1){if(i=null,(t=n[r].evaluate(e))instanceof X)return t;if("string"==typeof t){var a=e.parseColor(t);if(a)return a}else if(Array.isArray(t)&&!(i=t.length<3||t.length>4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":Q(t[0],t[1],t[2],t[3])))return new X(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new ne(i||"Could not parse color from value '"+("string"==typeof t?t:String(JSON.stringify(t)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s<l.length;s+=1){if(null===(o=l[s].evaluate(e)))return 0;var h=Number(o);if(!isNaN(h))return h}throw new ne("Could not convert "+JSON.stringify(o)+" to number.")}return"formatted"===this.type.kind?K.fromString(ie(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?Z.fromString(ie(this.args[0].evaluate(e))):ie(this.args[0].evaluate(e))},ce.prototype.eachChild=function(e){this.args.forEach(e)},ce.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},ce.prototype.serialize=function(){if("formatted"===this.type.kind)return new se([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new le(this.args[0]).serialize();var e=["to-"+this.type.kind];return this.eachChild(function(t){e.push(t.serialize())}),e};var ue=["Unknown","Point","LineString","Polygon"],de=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};de.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},de.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?ue[this.feature.type]:this.feature.type:null},de.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},de.prototype.canonicalID=function(){return this.canonical},de.prototype.properties=function(){return this.feature&&this.feature.properties||{}},de.prototype.parseColor=function(e){var t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=X.parse(e)),t};var pe=function(e,t,i,r){this.name=e,this.type=t,this._evaluate=i,this.args=r};pe.prototype.evaluate=function(e){return this._evaluate(e,this.args)},pe.prototype.eachChild=function(e){this.args.forEach(e)},pe.prototype.outputDefined=function(){return!1},pe.prototype.serialize=function(){return[this.name].concat(this.args.map(function(e){return e.serialize()}))},pe.parse=function(e,t){var i,r=e[0],n=pe.definitions[r];if(!n)return t.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0);for(var a=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=o.filter(function(t){var i=t[0];return!Array.isArray(i)||i.length===e.length-1}),l=null,h=0,c=s;h<c.length;h+=1){var u=c[h],d=u[0],p=u[1];l=new Ve(t.registry,t.path,null,t.scope);for(var f=[],m=!1,y=1;y<e.length;y++){var g=e[y],v=Array.isArray(d)?d[y-1]:d.type,b=l.parse(g,1+f.length,v);if(!b){m=!0;break}f.push(b)}if(!m)if(Array.isArray(d)&&d.length!==f.length)l.error("Expected "+d.length+" arguments, but found "+f.length+" instead.");else{for(var _=0;_<f.length;_++){var w=Array.isArray(d)?d[_]:d.type,x=f[_];l.concat(_+1).checkSubtype(w,x.type)}if(0===l.errors.length)return new pe(r,a,p,f)}}if(1===s.length)(i=t.errors).push.apply(i,l.errors);else{for(var C=(s.length?s:o).map(function(e){return function(e){return Array.isArray(e)?"("+e.map(B).join(", ")+")":"("+B(e.type)+"...)"}(e[0])}).join(" | "),S=[],M=1;M<e.length;M++){var k=t.parse(e[M],1+S.length);if(!k)return null;S.push(B(k.type))}t.error("Expected arguments of type "+C+", but found ("+S.join(", ")+") instead.")}return null},pe.register=function(e,t){for(var i in pe.definitions=t,t)e[i]=pe};var fe=function(e,t,i){this.type=V,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=t};fe.parse=function(e,t){if(2!==e.length)return t.error("Expected one argument.");var i=e[1];if("object"!=typeof i||Array.isArray(i))return t.error("Collator options argument must be an object.");var r=t.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,j);if(!r)return null;var n=t.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,j);if(!n)return null;var a=null;return i.locale&&!(a=t.parse(i.locale,1,R))?null:new fe(r,n,a)},fe.prototype.evaluate=function(e){return new $(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},fe.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},fe.prototype.outputDefined=function(){return!1},fe.prototype.serialize=function(){var e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]};var me=8192;function ye(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function ge(e,t){return!(e[0]<=t[0])&&(!(e[2]>=t[2])&&(!(e[1]<=t[1])&&!(e[3]>=t[3])))}function ve(e,t){var i=function(e){return(180+e)/360}(e[0]),r=function(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}(e[1]),n=Math.pow(2,t.z);return[Math.round(i*n*me),Math.round(r*n*me)]}function be(e,t,i){var r=e[0]-t[0],n=e[1]-t[1],a=e[0]-i[0],o=e[1]-i[1];return r*o-a*n==0&&r*a<=0&&n*o<=0}function _e(e,t,i){return t[1]>e[1]!=i[1]>e[1]&&e[0]<(i[0]-t[0])*(e[1]-t[1])/(i[1]-t[1])+t[0]}function we(e,t){for(var i=!1,r=0,n=t.length;r<n;r++)for(var a=t[r],o=0,s=a.length;o<s-1;o++){if(be(e,a[o],a[o+1]))return!1;_e(e,a[o],a[o+1])&&(i=!i)}return i}function xe(e,t){for(var i=0;i<t.length;i++)if(we(e,t[i]))return!0;return!1}function Ce(e,t,i,r){var n=e[0]-i[0],a=e[1]-i[1],o=t[0]-i[0],s=t[1]-i[1],l=r[0]-i[0],h=r[1]-i[1],c=n*h-l*a,u=o*h-l*s;return c>0&&u<0||c<0&&u>0}function Se(e,t,i,r){var n=[t[0]-e[0],t[1]-e[1]];return 0!==function(e,t){return e[0]*t[1]-e[1]*t[0]}([r[0]-i[0],r[1]-i[1]],n)&&!(!Ce(e,t,i,r)||!Ce(i,r,e,t))}function Me(e,t,i){for(var r=0,n=i;r<n.length;r+=1)for(var a=n[r],o=0;o<a.length-1;++o)if(Se(e,t,a[o],a[o+1]))return!0;return!1}function ke(e,t){for(var i=0;i<e.length;++i)if(!we(e[i],t))return!1;for(var r=0;r<e.length-1;++r)if(Me(e[r],e[r+1],t))return!1;return!0}function Te(e,t){for(var i=0;i<t.length;i++)if(ke(e,t[i]))return!0;return!1}function Ie(e,t,i){for(var r=[],n=0;n<e.length;n++){for(var a=[],o=0;o<e[n].length;o++){var s=ve(e[n][o],i);ye(t,s),a.push(s)}r.push(a)}return r}function Oe(e,t,i){for(var r=[],n=0;n<e.length;n++){var a=Ie(e[n],t,i);r.push(a)}return r}function Ee(e,t,i,r){if(e[0]<i[0]||e[0]>i[2]){var n=.5*r,a=e[0]-i[0]>n?-r:i[0]-e[0]>n?r:0;0===a&&(a=e[0]-i[2]>n?-r:i[2]-e[0]>n?r:0),e[0]+=a}ye(t,e)}function Le(e,t,i,r){for(var n=Math.pow(2,r.z)*me,a=[r.x*me,r.y*me],o=[],s=0,l=e;s<l.length;s+=1)for(var h=0,c=l[s];h<c.length;h+=1){var u=c[h],d=[u.x+a[0],u.y+a[1]];Ee(d,t,i,n),o.push(d)}return o}function Pe(e,t,i,r){for(var n=Math.pow(2,r.z)*me,a=[r.x*me,r.y*me],o=[],s=0,l=e;s<l.length;s+=1){for(var h=[],c=0,u=l[s];c<u.length;c+=1){var d=u[c],p=[d.x+a[0],d.y+a[1]];ye(t,p),h.push(p)}o.push(h)}if(t[2]-t[0]<=n/2){!function(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}(t);for(var f=0,m=o;f<m.length;f+=1)for(var y=0,g=m[f];y<g.length;y+=1){Ee(g[y],t,i,n)}}return o}var Re=function(e,t){this.type=j,this.geojson=e,this.geometries=t};function je(e){if(e instanceof pe){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof Re)return!1;var t=!0;return e.eachChild(function(e){t&&!je(e)&&(t=!1)}),t}function Ae(e){if(e instanceof pe&&"feature-state"===e.name)return!1;var t=!0;return e.eachChild(function(e){t&&!Ae(e)&&(t=!1)}),t}function ze(e,t){if(e instanceof pe&&t.indexOf(e.name)>=0)return!1;var i=!0;return e.eachChild(function(e){i&&!ze(e,t)&&(i=!1)}),i}Re.parse=function(e,t){if(2!==e.length)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(ee(e[1])){var i=e[1];if("FeatureCollection"===i.type)for(var r=0;r<i.features.length;++r){var n=i.features[r].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new Re(i,i.features[r].geometry)}else if("Feature"===i.type){var a=i.geometry.type;if("Polygon"===a||"MultiPolygon"===a)return new Re(i,i.geometry)}else if("Polygon"===i.type||"MultiPolygon"===i.type)return new Re(i,i)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Re.prototype.evaluate=function(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){var i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){var a=Ie(t.coordinates,r,n),o=Le(e.geometry(),i,r,n);if(!ge(i,r))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!we(l[s],a))return!1}if("MultiPolygon"===t.type){var h=Oe(t.coordinates,r,n),c=Le(e.geometry(),i,r,n);if(!ge(i,r))return!1;for(var u=0,d=c;u<d.length;u+=1)if(!xe(d[u],h))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){var i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){var a=Ie(t.coordinates,r,n),o=Pe(e.geometry(),i,r,n);if(!ge(i,r))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!ke(l[s],a))return!1}if("MultiPolygon"===t.type){var h=Oe(t.coordinates,r,n),c=Pe(e.geometry(),i,r,n);if(!ge(i,r))return!1;for(var u=0,d=c;u<d.length;u+=1)if(!Te(d[u],h))return!1}return!0}(e,this.geometries)}return!1},Re.prototype.eachChild=function(){},Re.prototype.outputDefined=function(){return!0},Re.prototype.serialize=function(){return["within",this.geojson]};var De=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};De.parse=function(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");var i=e[1];return t.scope.has(i)?new De(i,t.scope.get(i)):t.error('Unknown variable "'+i+'". Make sure "'+i+'" has been bound in an enclosing "let" expression before using it.',1)},De.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},De.prototype.eachChild=function(){},De.prototype.outputDefined=function(){return!1},De.prototype.serialize=function(){return["var",this.name]};var Ve=function(e,t,i,r,n){void 0===t&&(t=[]),void 0===r&&(r=new E),void 0===n&&(n=[]),this.registry=e,this.path=t,this.key=t.map(function(e){return"["+e+"]"}).join(""),this.scope=r,this.errors=n,this.expectedType=i};function Ne(e,t){for(var i,r,n=e.length-1,a=0,o=n,s=0;a<=o;)if(i=e[s=Math.floor((a+o)/2)],r=e[s+1],i<=t){if(s===n||t<r)return s;a=s+1}else{if(!(i>t))throw new ne("Input is not a number.");o=s-1}return 0}Ve.prototype.parse=function(e,t,i,r,n){return void 0===n&&(n={}),t?this.concat(t,i,r)._parse(e,n):this._parse(e,n)},Ve.prototype._parse=function(e,t){function i(e,t,i){return"assert"===i?new oe(t,[e]):"coerce"===i?new ce(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var r=e[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[r];if(n){var a=n.parse(e,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=i(a,o,t.typeAnnotation||"coerce");else a=i(a,o,t.typeAnnotation||"assert")}if(!(a instanceof re)&&"resolvedImage"!==a.type.kind&&function e(t){if(t instanceof De)return e(t.boundExpression);if(t instanceof pe&&"error"===t.name)return!1;if(t instanceof fe)return!1;if(t instanceof Re)return!1;var i=t instanceof ce||t instanceof oe;var r=!0;t.eachChild(function(t){r=i?r&&e(t):r&&t instanceof re});if(!r)return!1;return je(t)&&ze(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(a)){var l=new de;try{a=new re(a.type,a.evaluate(l))}catch(e){return this.error(e.message),null}}return a}return this.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof e+" instead.")},Ve.prototype.concat=function(e,t,i){var r="number"==typeof e?this.path.concat(e):this.path,n=i?this.scope.concat(i):this.scope;return new Ve(this.registry,r,t||null,n,this.errors)},Ve.prototype.error=function(e){for(var t=[],i=arguments.length-1;i-- >0;)t[i]=arguments[i+1];var r=""+this.key+t.map(function(e){return"["+e+"]"}).join("");this.errors.push(new O(r,e))},Ve.prototype.checkSubtype=function(e,t){var i=U(e,t);return i&&this.error(i),i};var Ge=function(e,t,i){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var r=0,n=i;r<n.length;r+=1){var a=n[r],o=a[0],s=a[1];this.labels.push(o),this.outputs.push(s)}};Ge.parse=function(e,t){if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");var i=t.parse(e[1],1,P);if(!i)return null;var r=[],n=null;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(var a=1;a<e.length;a+=2){var o=1===a?-1/0:e[a],s=e[a+1],l=a,h=a+1;if("number"!=typeof o)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(r.length&&r[r.length-1][0]>=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=t.parse(s,h,n);if(!c)return null;n=n||c.type,r.push([o,c])}return new Ge(n,i,r)},Ge.prototype.evaluate=function(e){var t=this.labels,i=this.outputs;if(1===t.length)return i[0].evaluate(e);var r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);var n=t.length;return r>=t[n-1]?i[n-1].evaluate(e):i[Ne(t,r)].evaluate(e)},Ge.prototype.eachChild=function(e){e(this.input);for(var t=0,i=this.outputs;t<i.length;t+=1){e(i[t])}},Ge.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})},Ge.prototype.serialize=function(){for(var e=["step",this.input.serialize()],t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var Fe=Be;function Be(e,t,i,r){this.cx=3*e,this.bx=3*(i-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(r-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=i,this.p2y=r}function qe(e,t,i){return e*(1-i)+t*i}Be.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},Be.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},Be.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},Be.prototype.solveCurveX=function(e,t){var i,r,n,a,o;for(void 0===t&&(t=1e-6),n=e,o=0;o<8;o++){if(a=this.sampleCurveX(n)-e,Math.abs(a)<t)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=a/s}if(r=1,(n=e)<(i=0))return i;if(n>r)return r;for(;i<r;){if(a=this.sampleCurveX(n),Math.abs(a-e)<t)return n;e>a?i=n:r=n,n=.5*(r-i)+i}return n},Be.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var Ue=Object.freeze({__proto__:null,number:qe,color:function(e,t,i){return new X(qe(e.r,t.r,i),qe(e.g,t.g,i),qe(e.b,t.b,i),qe(e.a,t.a,i))},array:function(e,t,i){return e.map(function(e,r){return qe(e,t[r],i)})}}),We=.95047,He=1,Ye=1.08883,Xe=4/29,$e=6/29,Je=3*$e*$e,Ke=$e*$e*$e,Ze=Math.PI/180,Qe=180/Math.PI;function et(e){return e>Ke?Math.pow(e,1/3):e/Je+Xe}function tt(e){return e>$e?e*e*e:Je*(e-Xe)}function it(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function rt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function nt(e){var t=rt(e.r),i=rt(e.g),r=rt(e.b),n=et((.4124564*t+.3575761*i+.1804375*r)/We),a=et((.2126729*t+.7151522*i+.072175*r)/He);return{l:116*a-16,a:500*(n-a),b:200*(a-et((.0193339*t+.119192*i+.9503041*r)/Ye)),alpha:e.a}}function at(e){var t=(e.l+16)/116,i=isNaN(e.a)?t:t+e.a/500,r=isNaN(e.b)?t:t-e.b/200;return t=He*tt(t),i=We*tt(i),r=Ye*tt(r),new X(it(3.2404542*i-1.5371385*t-.4985314*r),it(-.969266*i+1.8760108*t+.041556*r),it(.0556434*i-.2040259*t+1.0572252*r),e.alpha)}var ot={forward:nt,reverse:at,interpolate:function(e,t,i){return{l:qe(e.l,t.l,i),a:qe(e.a,t.a,i),b:qe(e.b,t.b,i),alpha:qe(e.alpha,t.alpha,i)}}},st={forward:function(e){var t=nt(e),i=t.l,r=t.a,n=t.b,a=Math.atan2(n,r)*Qe;return{h:a<0?a+360:a,c:Math.sqrt(r*r+n*n),l:i,alpha:e.a}},reverse:function(e){var t=e.h*Ze,i=e.c;return at({l:e.l,a:Math.cos(t)*i,b:Math.sin(t)*i,alpha:e.alpha})},interpolate:function(e,t,i){return{h:function(e,t,i){var r=t-e;return e+i*(r>180||r<-180?r-360*Math.round(r/360):r)}(e.h,t.h,i),c:qe(e.c,t.c,i),l:qe(e.l,t.l,i),alpha:qe(e.alpha,t.alpha,i)}}},lt=Object.freeze({__proto__:null,lab:ot,hcl:st}),ht=function(e,t,i,r,n){this.type=e,this.operator=t,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(var a=0,o=n;a<o.length;a+=1){var s=o[a],l=s[0],h=s[1];this.labels.push(l),this.outputs.push(h)}};function ct(e,t,i,r){var n=r-i,a=e-i;return 0===n?0:1===t?a/n:(Math.pow(t,a)-1)/(Math.pow(t,n)-1)}ht.interpolationFactor=function(e,t,i,r){var n=0;if("exponential"===e.name)n=ct(t,e.base,i,r);else if("linear"===e.name)n=ct(t,1,i,r);else if("cubic-bezier"===e.name){var a=e.controlPoints;n=new Fe(a[0],a[1],a[2],a[3]).solve(ct(t,1,i,r))}return n},ht.parse=function(e,t){var i=e[0],r=e[1],n=e[2],a=e.slice(3);if(!Array.isArray(r)||0===r.length)return t.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){var o=r[1];if("number"!=typeof o)return t.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:o}}else{if("cubic-bezier"!==r[0])return t.error("Unknown interpolation type "+String(r[0]),1,0);var s=r.slice(1);if(4!==s.length||s.some(function(e){return"number"!=typeof e||e<0||e>1}))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:s}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(n=t.parse(n,2,P)))return null;var l=[],h=null;"interpolate-hcl"===i||"interpolate-lab"===i?h=A:t.expectedType&&"value"!==t.expectedType.kind&&(h=t.expectedType);for(var c=0;c<a.length;c+=2){var u=a[c],d=a[c+1],p=c+3,f=c+4;if("number"!=typeof u)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(l.length&&l[l.length-1][0]>=u)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var m=t.parse(d,f,h);if(!m)return null;h=h||m.type,l.push([u,m])}return"number"===h.kind||"color"===h.kind||"array"===h.kind&&"number"===h.itemType.kind&&"number"==typeof h.N?new ht(h,i,r,n,l):t.error("Type "+B(h)+" is not interpolatable.")},ht.prototype.evaluate=function(e){var t=this.labels,i=this.outputs;if(1===t.length)return i[0].evaluate(e);var r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);var n=t.length;if(r>=t[n-1])return i[n-1].evaluate(e);var a=Ne(t,r),o=t[a],s=t[a+1],l=ht.interpolationFactor(this.interpolation,r,o,s),h=i[a].evaluate(e),c=i[a+1].evaluate(e);return"interpolate"===this.operator?Ue[this.type.kind.toLowerCase()](h,c,l):"interpolate-hcl"===this.operator?st.reverse(st.interpolate(st.forward(h),st.forward(c),l)):ot.reverse(ot.interpolate(ot.forward(h),ot.forward(c),l))},ht.prototype.eachChild=function(e){e(this.input);for(var t=0,i=this.outputs;t<i.length;t+=1){e(i[t])}},ht.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})},ht.prototype.serialize=function(){var e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var t=[this.operator,e,this.input.serialize()],i=0;i<this.labels.length;i++)t.push(this.labels[i],this.outputs[i].serialize());return t};var ut=function(e,t){this.type=e,this.args=t};ut.parse=function(e,t){if(e.length<2)return t.error("Expectected at least one argument.");var i=null,r=t.expectedType;r&&"value"!==r.kind&&(i=r);for(var n=[],a=0,o=e.slice(1);a<o.length;a+=1){var s=o[a],l=t.parse(s,1+n.length,i,void 0,{typeAnnotation:"omit"});if(!l)return null;i=i||l.type,n.push(l)}var h=r&&n.some(function(e){return U(r,e.type)});return new ut(h?D:i,n)},ut.prototype.evaluate=function(e){for(var t,i=null,r=0,n=0,a=this.args;n<a.length;n+=1){if(r++,(i=a[n].evaluate(e))&&i instanceof Z&&!i.available&&(t||(t=i.name),i=null,r===this.args.length&&(i=t)),null!==i)break}return i},ut.prototype.eachChild=function(e){this.args.forEach(e)},ut.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},ut.prototype.serialize=function(){var e=["coalesce"];return this.eachChild(function(t){e.push(t.serialize())}),e};var dt=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};dt.prototype.evaluate=function(e){return this.result.evaluate(e)},dt.prototype.eachChild=function(e){for(var t=0,i=this.bindings;t<i.length;t+=1){e(i[t][1])}e(this.result)},dt.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found "+(e.length-1)+" instead.");for(var i=[],r=1;r<e.length-1;r+=2){var n=e[r];if("string"!=typeof n)return t.error("Expected string, but found "+typeof n+" instead.",r);if(/[^a-zA-Z0-9_]/.test(n))return t.error("Variable names must contain only alphanumeric characters or '_'.",r);var a=t.parse(e[r+1],r+1);if(!a)return null;i.push([n,a])}var o=t.parse(e[e.length-1],e.length-1,t.expectedType,i);return o?new dt(i,o):null},dt.prototype.outputDefined=function(){return this.result.outputDefined()},dt.prototype.serialize=function(){for(var e=["let"],t=0,i=this.bindings;t<i.length;t+=1){var r=i[t],n=r[0],a=r[1];e.push(n,a.serialize())}return e.push(this.result.serialize()),e};var pt=function(e,t,i){this.type=e,this.index=t,this.input=i};pt.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var i=t.parse(e[1],1,P),r=t.parse(e[2],2,F(t.expectedType||D));if(!i||!r)return null;var n=r.type;return new pt(n.itemType,i,r)},pt.prototype.evaluate=function(e){var t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0)throw new ne("Array index out of bounds: "+t+" < 0.");if(t>=i.length)throw new ne("Array index out of bounds: "+t+" > "+(i.length-1)+".");if(t!==Math.floor(t))throw new ne("Array index must be an integer, but found "+t+" instead.");return i[t]},pt.prototype.eachChild=function(e){e(this.index),e(this.input)},pt.prototype.outputDefined=function(){return!1},pt.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var ft=function(e,t){this.type=j,this.needle=e,this.haystack=t};ft.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var i=t.parse(e[1],1,D),r=t.parse(e[2],2,D);return i&&r?W(i.type,[j,R,P,L,D])?new ft(i,r):t.error("Expected first argument to be of type boolean, string, number or null, but found "+B(i.type)+" instead"):null},ft.prototype.evaluate=function(e){var t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!H(t,["boolean","string","number","null"]))throw new ne("Expected first argument to be of type boolean, string, number or null, but found "+B(te(t))+" instead.");if(!H(i,["string","array"]))throw new ne("Expected second argument to be of type array or string, but found "+B(te(i))+" instead.");return i.indexOf(t)>=0},ft.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},ft.prototype.outputDefined=function(){return!0},ft.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var mt=function(e,t,i){this.type=P,this.needle=e,this.haystack=t,this.fromIndex=i};mt.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var i=t.parse(e[1],1,D),r=t.parse(e[2],2,D);if(!i||!r)return null;if(!W(i.type,[j,R,P,L,D]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+B(i.type)+" instead");if(4===e.length){var n=t.parse(e[3],3,P);return n?new mt(i,r,n):null}return new mt(i,r)},mt.prototype.evaluate=function(e){var t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!H(t,["boolean","string","number","null"]))throw new ne("Expected first argument to be of type boolean, string, number or null, but found "+B(te(t))+" instead.");if(!H(i,["string","array"]))throw new ne("Expected second argument to be of type array or string, but found "+B(te(i))+" instead.");if(this.fromIndex){var r=this.fromIndex.evaluate(e);return i.indexOf(t,r)}return i.indexOf(t)},mt.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},mt.prototype.outputDefined=function(){return!1},mt.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var yt=function(e,t,i,r,n,a){this.inputType=e,this.type=t,this.input=i,this.cases=r,this.outputs=n,this.otherwise=a};yt.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!=1)return t.error("Expected an even number of arguments.");var i,r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);for(var n={},a=[],o=2;o<e.length-1;o+=2){var s=e[o],l=e[o+1];Array.isArray(s)||(s=[s]);var h=t.concat(o);if(0===s.length)return h.error("Expected at least one branch label.");for(var c=0,u=s;c<u.length;c+=1){var d=u[c];if("number"!=typeof d&&"string"!=typeof d)return h.error("Branch labels must be numbers or strings.");if("number"==typeof d&&Math.abs(d)>Number.MAX_SAFE_INTEGER)return h.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof d&&Math.floor(d)!==d)return h.error("Numeric branch labels must be integer values.");if(i){if(h.checkSubtype(i,te(d)))return null}else i=te(d);if(void 0!==n[String(d)])return h.error("Branch labels must be unique.");n[String(d)]=a.length}var p=t.parse(l,o,r);if(!p)return null;r=r||p.type,a.push(p)}var f=t.parse(e[1],1,D);if(!f)return null;var m=t.parse(e[e.length-1],e.length-1,r);return m?"value"!==f.type.kind&&t.concat(1).checkSubtype(i,f.type)?null:new yt(i,r,f,n,a,m):null},yt.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(te(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},yt.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},yt.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})&&this.otherwise.outputDefined()},yt.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],i=[],r={},n=0,a=Object.keys(this.cases).sort();n<a.length;n+=1){var o=a[n];void 0===(u=r[this.cases[o]])?(r[this.cases[o]]=i.length,i.push([this.cases[o],[o]])):i[u][1].push(o)}for(var s=function(t){return"number"===e.inputType.kind?Number(t):t},l=0,h=i;l<h.length;l+=1){var c=h[l],u=c[0],d=c[1];1===d.length?t.push(s(d[0])):t.push(d.map(s)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var gt=function(e,t,i){this.type=e,this.branches=t,this.otherwise=i};gt.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found only "+(e.length-1)+".");if(e.length%2!=0)return t.error("Expected an odd number of arguments.");var i;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);for(var r=[],n=1;n<e.length-1;n+=2){var a=t.parse(e[n],n,j);if(!a)return null;var o=t.parse(e[n+1],n+1,i);if(!o)return null;r.push([a,o]),i=i||o.type}var s=t.parse(e[e.length-1],e.length-1,i);return s?new gt(i,r,s):null},gt.prototype.evaluate=function(e){for(var t=0,i=this.branches;t<i.length;t+=1){var r=i[t],n=r[0],a=r[1];if(n.evaluate(e))return a.evaluate(e)}return this.otherwise.evaluate(e)},gt.prototype.eachChild=function(e){for(var t=0,i=this.branches;t<i.length;t+=1){var r=i[t],n=r[0],a=r[1];e(n),e(a)}e(this.otherwise)},gt.prototype.outputDefined=function(){return this.branches.every(function(e){e[0];return e[1].outputDefined()})&&this.otherwise.outputDefined()},gt.prototype.serialize=function(){var e=["case"];return this.eachChild(function(t){e.push(t.serialize())}),e};var vt=function(e,t,i,r){this.type=e,this.input=t,this.beginIndex=i,this.endIndex=r};function bt(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function _t(e,t,i,r){return 0===r.compare(t,i)}function wt(e,t,i){var r="=="!==e&&"!="!==e;return function(){function n(e,t,i){this.type=j,this.lhs=e,this.rhs=t,this.collator=i,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}return n.parse=function(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");var i=e[0],a=t.parse(e[1],1,D);if(!a)return null;if(!bt(i,a.type))return t.concat(1).error('"'+i+"\" comparisons are not supported for type '"+B(a.type)+"'.");var o=t.parse(e[2],2,D);if(!o)return null;if(!bt(i,o.type))return t.concat(2).error('"'+i+"\" comparisons are not supported for type '"+B(o.type)+"'.");if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot compare types '"+B(a.type)+"' and '"+B(o.type)+"'.");r&&("value"===a.type.kind&&"value"!==o.type.kind?a=new oe(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new oe(a.type,[o])));var s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(s=t.parse(e[3],3,V)))return null}return new n(a,o,s)},n.prototype.evaluate=function(n){var a=this.lhs.evaluate(n),o=this.rhs.evaluate(n);if(r&&this.hasUntypedArgument){var s=te(a),l=te(o);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new ne('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!r&&this.hasUntypedArgument){var h=te(a),c=te(o);if("string"!==h.kind||"string"!==c.kind)return t(n,a,o)}return this.collator?i(n,a,o,this.collator.evaluate(n)):t(n,a,o)},n.prototype.eachChild=function(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)},n.prototype.outputDefined=function(){return!0},n.prototype.serialize=function(){var t=[e];return this.eachChild(function(e){t.push(e.serialize())}),t},n}()}vt.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var i=t.parse(e[1],1,D),r=t.parse(e[2],2,P);if(!i||!r)return null;if(!W(i.type,[F(D),R,D]))return t.error("Expected first argument to be of type array or string, but found "+B(i.type)+" instead");if(4===e.length){var n=t.parse(e[3],3,P);return n?new vt(i.type,i,r,n):null}return new vt(i.type,i,r)},vt.prototype.evaluate=function(e){var t=this.input.evaluate(e),i=this.beginIndex.evaluate(e);if(!H(t,["string","array"]))throw new ne("Expected first argument to be of type array or string, but found "+B(te(t))+" instead.");if(this.endIndex){var r=this.endIndex.evaluate(e);return t.slice(i,r)}return t.slice(i)},vt.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},vt.prototype.outputDefined=function(){return!1},vt.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var xt=wt("==",function(e,t,i){return t===i},_t),Ct=wt("!=",function(e,t,i){return t!==i},function(e,t,i,r){return!_t(0,t,i,r)}),St=wt("<",function(e,t,i){return t<i},function(e,t,i,r){return r.compare(t,i)<0}),Mt=wt(">",function(e,t,i){return t>i},function(e,t,i,r){return r.compare(t,i)>0}),kt=wt("<=",function(e,t,i){return t<=i},function(e,t,i,r){return r.compare(t,i)<=0}),Tt=wt(">=",function(e,t,i){return t>=i},function(e,t,i,r){return r.compare(t,i)>=0}),It=function(e,t,i,r,n){this.type=R,this.number=e,this.locale=t,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=n};It.parse=function(e,t){if(3!==e.length)return t.error("Expected two arguments.");var i=t.parse(e[1],1,P);if(!i)return null;var r=e[2];if("object"!=typeof r||Array.isArray(r))return t.error("NumberFormat options argument must be an object.");var n=null;if(r.locale&&!(n=t.parse(r.locale,1,R)))return null;var a=null;if(r.currency&&!(a=t.parse(r.currency,1,R)))return null;var o=null;if(r["min-fraction-digits"]&&!(o=t.parse(r["min-fraction-digits"],1,P)))return null;var s=null;return r["max-fraction-digits"]&&!(s=t.parse(r["max-fraction-digits"],1,P))?null:new It(i,n,a,o,s)},It.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},It.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},It.prototype.outputDefined=function(){return!1},It.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var Ot=function(e){this.type=P,this.input=e};Ot.parse=function(e,t){if(2!==e.length)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var i=t.parse(e[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?t.error("Expected argument of type string or array, but found "+B(i.type)+" instead."):new Ot(i):null},Ot.prototype.evaluate=function(e){var t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new ne("Expected value to be of type string or array, but found "+B(te(t))+" instead.")},Ot.prototype.eachChild=function(e){e(this.input)},Ot.prototype.outputDefined=function(){return!1},Ot.prototype.serialize=function(){var e=["length"];return this.eachChild(function(t){e.push(t.serialize())}),e};var Et={"==":xt,"!=":Ct,">":Mt,"<":St,">=":Tt,"<=":kt,array:oe,at:pt,boolean:oe,case:gt,coalesce:ut,collator:fe,format:se,image:le,in:ft,"index-of":mt,interpolate:ht,"interpolate-hcl":ht,"interpolate-lab":ht,length:Ot,let:dt,literal:re,match:yt,number:oe,"number-format":It,object:oe,slice:vt,step:Ge,string:oe,"to-boolean":ce,"to-color":ce,"to-number":ce,"to-string":ce,var:De,within:Re};function Lt(e,t){var i=t[0],r=t[1],n=t[2],a=t[3];i=i.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);var o=a?a.evaluate(e):1,s=Q(i,r,n,o);if(s)throw new ne(s);return new X(i/255*o,r/255*o,n/255*o,o)}function Pt(e,t){return e in t}function Rt(e,t){var i=t[e];return void 0===i?null:i}function jt(e){return{type:e}}function At(e){return{result:"success",value:e}}function zt(e){return{result:"error",value:e}}function Dt(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function Vt(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function Nt(e){return!!e.expression&&e.expression.interpolated}function Gt(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function Ft(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Bt(e){return e}function qt(e,t){var i,r,n,a="color"===t.type,o=e.stops&&"object"==typeof e.stops[0][0],s=o||void 0!==e.property,l=o||!s,h=e.type||(Nt(t)?"exponential":"interval");if(a&&((e=I({},e)).stops&&(e.stops=e.stops.map(function(e){return[e[0],X.parse(e[1])]})),e.default?e.default=X.parse(e.default):e.default=X.parse(t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!lt[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===h)i=Yt;else if("interval"===h)i=Ht;else if("categorical"===h){i=Wt,r=Object.create(null);for(var c=0,u=e.stops;c<u.length;c+=1){var d=u[c];r[d[0]]=d[1]}n=typeof e.stops[0][0]}else{if("identity"!==h)throw new Error('Unknown function type "'+h+'"');i=Xt}if(o){for(var p={},f=[],m=0;m<e.stops.length;m++){var y=e.stops[m],g=y[0].zoom;void 0===p[g]&&(p[g]={zoom:g,type:e.type,property:e.property,default:e.default,stops:[]},f.push(g)),p[g].stops.push([y[0].value,y[1]])}for(var v=[],b=0,_=f;b<_.length;b+=1){var w=_[b];v.push([p[w].zoom,qt(p[w],t)])}var x={name:"linear"};return{kind:"composite",interpolationType:x,interpolationFactor:ht.interpolationFactor.bind(void 0,x),zoomStops:v.map(function(e){return e[0]}),evaluate:function(i,r){var n=i.zoom;return Yt({stops:v,base:e.base},t,n).evaluate(n,r)}}}if(l){var C="exponential"===h?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:C,interpolationFactor:ht.interpolationFactor.bind(void 0,C),zoomStops:e.stops.map(function(e){return e[0]}),evaluate:function(a){var o=a.zoom;return i(e,t,o,r,n)}}}return{kind:"source",evaluate:function(a,o){var s=o&&o.properties?o.properties[e.property]:void 0;return void 0===s?Ut(e.default,t.default):i(e,t,s,r,n)}}}function Ut(e,t,i){return void 0!==e?e:void 0!==t?t:void 0!==i?i:void 0}function Wt(e,t,i,r,n){return Ut(typeof i===n?r[i]:void 0,e.default,t.default)}function Ht(e,t,i){if("number"!==Gt(i))return Ut(e.default,t.default);var r=e.stops.length;if(1===r)return e.stops[0][1];if(i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[r-1][0])return e.stops[r-1][1];var n=Ne(e.stops.map(function(e){return e[0]}),i);return e.stops[n][1]}function Yt(e,t,i){var r=void 0!==e.base?e.base:1;if("number"!==Gt(i))return Ut(e.default,t.default);var n=e.stops.length;if(1===n)return e.stops[0][1];if(i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[n-1][0])return e.stops[n-1][1];var a=Ne(e.stops.map(function(e){return e[0]}),i),o=function(e,t,i,r){var n=r-i,a=e-i;return 0===n?0:1===t?a/n:(Math.pow(t,a)-1)/(Math.pow(t,n)-1)}(i,r,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],l=e.stops[a+1][1],h=Ue[t.type]||Bt;if(e.colorSpace&&"rgb"!==e.colorSpace){var c=lt[e.colorSpace];h=function(e,t){return c.reverse(c.interpolate(c.forward(e),c.forward(t),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var i=s.evaluate.apply(void 0,e),r=l.evaluate.apply(void 0,e);if(void 0!==i&&void 0!==r)return h(i,r,o)}}:h(s,l,o)}function Xt(e,t,i){return"color"===t.type?i=X.parse(i):"formatted"===t.type?i=K.fromString(i.toString()):"resolvedImage"===t.type?i=Z.fromString(i.toString()):Gt(i)===t.type||"enum"===t.type&&t.values[i]||(i=void 0),Ut(i,e.default,t.default)}pe.register(Et,{error:[{kind:"error"},[R],function(e,t){var i=t[0];throw new ne(i.evaluate(e))}],typeof:[R,[D],function(e,t){return B(te(t[0].evaluate(e)))}],"to-rgba":[F(P,4),[A],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[A,[P,P,P],Lt],rgba:[A,[P,P,P,P],Lt],has:{type:j,overloads:[[[R],function(e,t){return Pt(t[0].evaluate(e),e.properties())}],[[R,z],function(e,t){var i=t[0],r=t[1];return Pt(i.evaluate(e),r.evaluate(e))}]]},get:{type:D,overloads:[[[R],function(e,t){return Rt(t[0].evaluate(e),e.properties())}],[[R,z],function(e,t){var i=t[0],r=t[1];return Rt(i.evaluate(e),r.evaluate(e))}]]},"feature-state":[D,[R],function(e,t){return Rt(t[0].evaluate(e),e.featureState||{})}],properties:[z,[],function(e){return e.properties()}],"geometry-type":[R,[],function(e){return e.geometryType()}],id:[D,[],function(e){return e.id()}],zoom:[P,[],function(e){return e.globals.zoom}],"heatmap-density":[P,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[P,[],function(e){return e.globals.lineProgress||0}],accumulated:[D,[],function(e){return void 0===e.globals.accumulated?null:e.globals.accumulated}],"+":[P,jt(P),function(e,t){for(var i=0,r=0,n=t;r<n.length;r+=1){i+=n[r].evaluate(e)}return i}],"*":[P,jt(P),function(e,t){for(var i=1,r=0,n=t;r<n.length;r+=1){i*=n[r].evaluate(e)}return i}],"-":{type:P,overloads:[[[P,P],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)-r.evaluate(e)}],[[P],function(e,t){return-t[0].evaluate(e)}]]},"/":[P,[P,P],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)/r.evaluate(e)}],"%":[P,[P,P],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)%r.evaluate(e)}],ln2:[P,[],function(){return Math.LN2}],pi:[P,[],function(){return Math.PI}],e:[P,[],function(){return Math.E}],"^":[P,[P,P],function(e,t){var i=t[0],r=t[1];return Math.pow(i.evaluate(e),r.evaluate(e))}],sqrt:[P,[P],function(e,t){var i=t[0];return Math.sqrt(i.evaluate(e))}],log10:[P,[P],function(e,t){var i=t[0];return Math.log(i.evaluate(e))/Math.LN10}],ln:[P,[P],function(e,t){var i=t[0];return Math.log(i.evaluate(e))}],log2:[P,[P],function(e,t){var i=t[0];return Math.log(i.evaluate(e))/Math.LN2}],sin:[P,[P],function(e,t){var i=t[0];return Math.sin(i.evaluate(e))}],cos:[P,[P],function(e,t){var i=t[0];return Math.cos(i.evaluate(e))}],tan:[P,[P],function(e,t){var i=t[0];return Math.tan(i.evaluate(e))}],asin:[P,[P],function(e,t){var i=t[0];return Math.asin(i.evaluate(e))}],acos:[P,[P],function(e,t){var i=t[0];return Math.acos(i.evaluate(e))}],atan:[P,[P],function(e,t){var i=t[0];return Math.atan(i.evaluate(e))}],min:[P,jt(P),function(e,t){return Math.min.apply(Math,t.map(function(t){return t.evaluate(e)}))}],max:[P,jt(P),function(e,t){return Math.max.apply(Math,t.map(function(t){return t.evaluate(e)}))}],abs:[P,[P],function(e,t){var i=t[0];return Math.abs(i.evaluate(e))}],round:[P,[P],function(e,t){var i=t[0].evaluate(e);return i<0?-Math.round(-i):Math.round(i)}],floor:[P,[P],function(e,t){var i=t[0];return Math.floor(i.evaluate(e))}],ceil:[P,[P],function(e,t){var i=t[0];return Math.ceil(i.evaluate(e))}],"filter-==":[j,[R,D],function(e,t){var i=t[0],r=t[1];return e.properties()[i.value]===r.value}],"filter-id-==":[j,[D],function(e,t){var i=t[0];return e.id()===i.value}],"filter-type-==":[j,[R],function(e,t){var i=t[0];return e.geometryType()===i.value}],"filter-<":[j,[R,D],function(e,t){var i=t[0],r=t[1],n=e.properties()[i.value],a=r.value;return typeof n==typeof a&&n<a}],"filter-id-<":[j,[D],function(e,t){var i=t[0],r=e.id(),n=i.value;return typeof r==typeof n&&r<n}],"filter->":[j,[R,D],function(e,t){var i=t[0],r=t[1],n=e.properties()[i.value],a=r.value;return typeof n==typeof a&&n>a}],"filter-id->":[j,[D],function(e,t){var i=t[0],r=e.id(),n=i.value;return typeof r==typeof n&&r>n}],"filter-<=":[j,[R,D],function(e,t){var i=t[0],r=t[1],n=e.properties()[i.value],a=r.value;return typeof n==typeof a&&n<=a}],"filter-id-<=":[j,[D],function(e,t){var i=t[0],r=e.id(),n=i.value;return typeof r==typeof n&&r<=n}],"filter->=":[j,[R,D],function(e,t){var i=t[0],r=t[1],n=e.properties()[i.value],a=r.value;return typeof n==typeof a&&n>=a}],"filter-id->=":[j,[D],function(e,t){var i=t[0],r=e.id(),n=i.value;return typeof r==typeof n&&r>=n}],"filter-has":[j,[D],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[j,[],function(e){return null!==e.id()&&void 0!==e.id()}],"filter-type-in":[j,[F(R)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[j,[F(D)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[j,[R,F(D)],function(e,t){var i=t[0];return t[1].value.indexOf(e.properties()[i.value])>=0}],"filter-in-large":[j,[R,F(D)],function(e,t){var i=t[0],r=t[1];return function(e,t,i,r){for(;i<=r;){var n=i+r>>1;if(t[n]===e)return!0;t[n]>e?r=n-1:i=n+1}return!1}(e.properties()[i.value],r.value,0,r.value.length-1)}],all:{type:j,overloads:[[[j,j],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)&&r.evaluate(e)}],[jt(j),function(e,t){for(var i=0,r=t;i<r.length;i+=1){if(!r[i].evaluate(e))return!1}return!0}]]},any:{type:j,overloads:[[[j,j],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)||r.evaluate(e)}],[jt(j),function(e,t){for(var i=0,r=t;i<r.length;i+=1){if(r[i].evaluate(e))return!0}return!1}]]},"!":[j,[j],function(e,t){return!t[0].evaluate(e)}],"is-supported-script":[j,[R],function(e,t){var i=t[0],r=e.globals&&e.globals.isSupportedScript;return!r||r(i.evaluate(e))}],upcase:[R,[R],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[R,[R],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[R,jt(D),function(e,t){return t.map(function(t){return ie(t.evaluate(e))}).join("")}],"resolved-locale":[R,[V],function(e,t){return t[0].evaluate(e).resolvedLocale()}]});var $t=function(e,t){this.expression=e,this._warningHistory={},this._evaluator=new de,this._defaultValue=t?function(e){return"color"===e.type&&Ft(e.default)?new X(0,0,0,0):"color"===e.type?X.parse(e.default)||null:void 0===e.default?null:e.default}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null};function Jt(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Et}function Kt(e,t){var i=new Ve(Et,[],t?function(e){var t={color:A,string:R,number:P,enum:R,boolean:j,formatted:N,resolvedImage:G};if("array"===e.type)return F(t[e.value]||D,e.length);return t[e.type]}(t):void 0),r=i.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return r?At(new $t(r,t)):zt(i.errors)}$t.prototype.evaluateWithoutErrorHandling=function(e,t,i,r,n,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},$t.prototype.evaluate=function(e,t,i,r,n,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null===o||void 0===o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new ne("Expected value to be one of "+Object.keys(this._enumValues).map(function(e){return JSON.stringify(e)}).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}};var Zt=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Ae(t.expression)};Zt.prototype.evaluateWithoutErrorHandling=function(e,t,i,r,n,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,n,a)},Zt.prototype.evaluate=function(e,t,i,r,n,a){return this._styleExpression.evaluate(e,t,i,r,n,a)};var Qt=function(e,t,i,r){this.kind=e,this.zoomStops=i,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Ae(t.expression),this.interpolationType=r};function ei(e,t){if("error"===(e=Kt(e,t)).result)return e;var i=e.value.expression,r=je(i);if(!r&&!Dt(t))return zt([new O("","data expressions not supported")]);var n=ze(i,["zoom"]);if(!n&&!Vt(t))return zt([new O("","zoom expressions not supported")]);var a=function e(t){var i=null;if(t instanceof dt)i=e(t.result);else if(t instanceof ut)for(var r=0,n=t.args;r<n.length;r+=1){var a=n[r];if(i=e(a))break}else(t instanceof Ge||t instanceof ht)&&t.input instanceof pe&&"zoom"===t.input.name&&(i=t);if(i instanceof O)return i;t.eachChild(function(t){var r=e(t);r instanceof O?i=r:!i&&r?i=new O("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):i&&r&&i!==r&&(i=new O("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))});return i}(i);if(!a&&!n)return zt([new O("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof O)return zt([a]);if(a instanceof ht&&!Nt(t))return zt([new O("",'"interpolate" expressions cannot be used with this property')]);if(!a)return At(new Zt(r?"constant":"source",e.value));var o=a instanceof ht?a.interpolation:void 0;return At(new Qt(r?"camera":"composite",e.value,a.labels,o))}Qt.prototype.evaluateWithoutErrorHandling=function(e,t,i,r,n,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,n,a)},Qt.prototype.evaluate=function(e,t,i,r,n,a){return this._styleExpression.evaluate(e,t,i,r,n,a)},Qt.prototype.interpolationFactor=function(e,t,i){return this.interpolationType?ht.interpolationFactor(this.interpolationType,e,t,i):0};var ti=function(e,t){this._parameters=e,this._specification=t,I(this,qt(this._parameters,this._specification))};function ii(e){return"object"==typeof e?["literal",e]:e}function ri(e,t){var i=e.stops;if(!i)return function(e,t){var i=["get",e.property];if(void 0===e.default)return"string"===t.type?["string",i]:i;if("enum"===t.type)return["match",i,Object.keys(t.values),i,e.default];var r=["color"===t.type?"to-color":t.type,i,ii(e.default)];return"array"===t.type&&r.splice(1,0,t.value,t.length||null),r}(e,t);var r=i&&"object"==typeof i[0][0],n=r||void 0!==e.property,a=r||!n;return i=i.map(function(e){return!n&&t.tokens&&"string"==typeof e[1]?[e[0],ci(e[1])]:[e[0],ii(e[1])]}),r?function(e,t,i){for(var r={},n={},a=[],o=0;o<i.length;o++){var s=i[o],l=s[0].zoom;void 0===r[l]&&(r[l]={zoom:l,type:e.type,property:e.property,default:e.default},n[l]=[],a.push(l)),n[l].push([s[0].value,s[1]])}if("exponential"===hi({},t)){for(var h=[ni(e),["linear"],["zoom"]],c=0,u=a;c<u.length;c+=1){var d=u[c],p=oi(r[d],t,n[d]);li(h,d,p,!1)}return h}for(var f=["step",["zoom"]],m=0,y=a;m<y.length;m+=1){var g=y[m],v=oi(r[g],t,n[g]);li(f,g,v,!0)}return si(f),f}(e,t,i):a?function(e,t,i,r){void 0===r&&(r=["zoom"]);var n,a=hi(e,t),o=!1;if("interval"===a)n=["step",r],o=!0;else{if("exponential"!==a)throw new Error('Unknown zoom function type "'+a+'"');var s=void 0!==e.base?e.base:1;n=[ni(e),1===s?["linear"]:["exponential",s],r]}for(var l=0,h=i;l<h.length;l+=1){var c=h[l];li(n,c[0],c[1],o)}return si(n),n}(e,t,i):oi(e,t,i)}function ni(e){switch(e.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function ai(e,t){return void 0!==e?e:void 0!==t?t:void 0}function oi(e,t,i){var r=hi(e,t),n=["get",e.property];if("categorical"===r&&"boolean"==typeof i[0][0]){for(var a=["case"],o=0,s=i;o<s.length;o+=1){var l=s[o];a.push(["==",n,l[0]],l[1])}return a.push(ii(ai(e.default,t.default))),a}if("categorical"===r){for(var h=["match",n],c=0,u=i;c<u.length;c+=1){var d=u[c];li(h,d[0],d[1],!1)}return h.push(ii(ai(e.default,t.default))),h}if("interval"===r){for(var p=["step",["number",n]],f=0,m=i;f<m.length;f+=1){var y=m[f];li(p,y[0],y[1],!0)}return si(p),void 0===e.default?p:["case",["==",["typeof",n],"number"],p,ii(e.default)]}if("exponential"===r){for(var g=void 0!==e.base?e.base:1,v=[ni(e),1===g?["linear"]:["exponential",g],["number",n]],b=0,_=i;b<_.length;b+=1){var w=_[b];li(v,w[0],w[1],!1)}return void 0===e.default?v:["case",["==",["typeof",n],"number"],v,ii(e.default)]}throw new Error("Unknown property function type "+r)}function si(e){"step"===e[0]&&3===e.length&&(e.push(0),e.push(e[3]))}function li(e,t,i,r){e.length>3&&t===e[e.length-2]||(r&&2===e.length||e.push(t),e.push(i))}function hi(e,t){return e.type?e.type:t.expression.interpolated?"exponential":"interval"}function ci(e){for(var t=["concat"],i=/{([^{}]+)}/g,r=0,n=i.exec(e);null!==n;n=i.exec(e)){var a=e.slice(r,i.lastIndex-n[0].length);r=i.lastIndex,a.length>0&&t.push(a),t.push(["get",n[1]])}if(1===t.length)return e;if(r<e.length)t.push(e.slice(r));else if(2===t.length)return["to-string",t[1]];return t}function ui(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,i=e.slice(1);t<i.length;t+=1){var r=i[t];if(!ui(r)&&"boolean"!=typeof r)return!1}return!0;default:return!0}}ti.deserialize=function(e){return new ti(e._parameters,e._specification)},ti.serialize=function(e){return{_parameters:e._parameters,_specification:e._specification}};var di={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function pi(e){if(null===e||void 0===e)return{filter:function(){return!0},needGeometry:!1};ui(e)||(e=mi(e));var t=Kt(e,di);if("error"===t.result)throw new Error(t.value.map(function(e){return e.key+": "+e.message}).join(", "));return{filter:function(e,i,r){return t.value.evaluate(e,i,{},r)},needGeometry:function e(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var i=1;i<t.length;i++)if(e(t[i]))return!0;return!1}(e)}}function fi(e,t){return e<t?-1:e>t?1:0}function mi(e){if(!e)return!0;var t=e[0];return e.length<=1?"any"!==t:"=="===t?yi(e[1],e[2],"=="):"!="===t?bi(yi(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?yi(e[1],e[2],t):"any"===t?function(e){return["any"].concat(e.map(mi))}(e.slice(1)):"all"===t?["all"].concat(e.slice(1).map(mi)):"none"===t?["all"].concat(e.slice(1).map(mi).map(bi)):"in"===t?gi(e[1],e.slice(2)):"!in"===t?bi(gi(e[1],e.slice(2))):"has"===t?vi(e[1]):"!has"===t?bi(vi(e[1])):"within"!==t||e}function yi(e,t,i){switch(e){case"$type":return["filter-type-"+i,t];case"$id":return["filter-id-"+i,t];default:return["filter-"+i,e,t]}}function gi(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(function(e){return typeof e!=typeof t[0]})?["filter-in-large",e,["literal",t.sort(fi)]]:["filter-in-small",e,["literal",t]]}}function vi(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function bi(e){return["!",e]}var _i=function(e,t,i,r){this.message=(e?e+": ":"")+i,r&&(this.identifier=r),null!==t&&void 0!==t&&t.__line__&&(this.line=t.__line__)},wi=function(e){this.error=e,this.message=e.message;var t=e.message.match(/line (\d+)/);this.line=t?parseInt(t[1],10):0};function xi(e){var t=e.key,i=e.value;return i?[new _i(t,i,"constants have been deprecated as of v8")]:[]}function Ci(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Si(e){if(Array.isArray(e))return e.map(Si);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){var t={};for(var i in e)t[i]=Si(e[i]);return t}return Ci(e)}function Mi(e){var t=e.key,i=e.value,r=e.valueSpec||{},n=e.objectElementValidators||{},a=e.style,o=e.styleSpec,s=[],l=Gt(i);if("object"!==l)return[new _i(t,i,"object expected, "+l+" found")];for(var h in i){var c=h.split(".")[0],u=r[c]||r["*"],d=void 0;if(n[c])d=n[c];else if(r[c])d=Fi;else if(n["*"])d=n["*"];else{if(!r["*"]){s.push(new _i(t,i[h],'unknown property "'+h+'"'));continue}d=Fi}s=s.concat(d({key:(t?t+".":t)+h,value:i[h],valueSpec:u,style:a,styleSpec:o,object:i,objectKey:h},i))}for(var p in r)n[p]||r[p].required&&void 0===r[p].default&&void 0===i[p]&&s.push(new _i(t,i,'missing required property "'+p+'"'));return s}function ki(e){var t=e.value,i=e.valueSpec,r=e.style,n=e.styleSpec,a=e.key,o=e.arrayElementValidator||Fi;if("array"!==Gt(t))return[new _i(a,t,"array expected, "+Gt(t)+" found")];if(i.length&&t.length!==i.length)return[new _i(a,t,"array length "+i.length+" expected, length "+t.length+" found")];if(i["min-length"]&&t.length<i["min-length"])return[new _i(a,t,"array length at least "+i["min-length"]+" expected, length "+t.length+" found")];var s={type:i.value,values:i.values};n.$version<7&&(s.function=i.function),"object"===Gt(i.value)&&(s=i.value);for(var l=[],h=0;h<t.length;h++)l=l.concat(o({array:t,arrayIndex:h,value:t[h],valueSpec:s,style:r,styleSpec:n,key:a+"["+h+"]"}));return l}function Ti(e){var t=e.key,i=e.value,r=e.valueSpec,n=Gt(i);return"number"===n&&i!=i&&(n="NaN"),"number"!==n?[new _i(t,i,"number expected, "+n+" found")]:"minimum"in r&&i<r.minimum?[new _i(t,i,i+" is less than the minimum value "+r.minimum)]:"maximum"in r&&i>r.maximum?[new _i(t,i,i+" is greater than the maximum value "+r.maximum)]:[]}function Ii(e){var t,i,r,n=e.valueSpec,a=Ci(e.value.type),o={},s="categorical"!==a&&void 0===e.value.property,l=!s,h="array"===Gt(e.value.stops)&&"array"===Gt(e.value.stops[0])&&"object"===Gt(e.value.stops[0][0]),c=Mi({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===a)return[new _i(e.key,e.value,'identity function may not have a "stops" property')];var t=[],i=e.value;t=t.concat(ki({key:e.key,value:i,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:u})),"array"===Gt(i)&&0===i.length&&t.push(new _i(e.key,i,"array must have at least one stop"));return t},default:function(e){return Fi({key:e.key,value:e.value,valueSpec:n,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===a&&s&&c.push(new _i(e.key,e.value,'missing required property "property"')),"identity"===a||e.value.stops||c.push(new _i(e.key,e.value,'missing required property "stops"')),"exponential"===a&&e.valueSpec.expression&&!Nt(e.valueSpec)&&c.push(new _i(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!Dt(e.valueSpec)?c.push(new _i(e.key,e.value,"property functions not supported")):s&&!Vt(e.valueSpec)&&c.push(new _i(e.key,e.value,"zoom functions not supported"))),"categorical"!==a&&!h||void 0!==e.value.property||c.push(new _i(e.key,e.value,'"property" property is required')),c;function u(e){var t=[],a=e.value,s=e.key;if("array"!==Gt(a))return[new _i(s,a,"array expected, "+Gt(a)+" found")];if(2!==a.length)return[new _i(s,a,"array length 2 expected, length "+a.length+" found")];if(h){if("object"!==Gt(a[0]))return[new _i(s,a,"object expected, "+Gt(a[0])+" found")];if(void 0===a[0].zoom)return[new _i(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new _i(s,a,"object stop key must have value")];if(r&&r>Ci(a[0].zoom))return[new _i(s,a[0].zoom,"stop zoom values must appear in ascending order")];Ci(a[0].zoom)!==r&&(r=Ci(a[0].zoom),i=void 0,o={}),t=t.concat(Mi({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:Ti,value:d}}))}else t=t.concat(d({key:s+"[0]",value:a[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},a));return Jt(Si(a[1]))?t.concat([new _i(s+"[1]",a[1],"expressions are not allowed in function stops.")]):t.concat(Fi({key:s+"[1]",value:a[1],valueSpec:n,style:e.style,styleSpec:e.styleSpec}))}function d(e,r){var s=Gt(e.value),l=Ci(e.value),h=null!==e.value?e.value:r;if(t){if(s!==t)return[new _i(e.key,h,s+" stop domain type must match previous stop domain type "+t)]}else t=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new _i(e.key,h,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var c="number expected, "+s+" found";return Dt(n)&&void 0===a&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new _i(e.key,h,c)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==i&&l<i?[new _i(e.key,h,"stop domain values must appear in ascending order")]:(i=l,"categorical"===a&&l in o?[new _i(e.key,h,"stop domain values must be unique")]:(o[l]=!0,[])):[new _i(e.key,h,"integer expected, found "+l)]}}function Oi(e){var t=("property"===e.expressionContext?ei:Kt)(Si(e.value),e.valueSpec);if("error"===t.result)return t.value.map(function(t){return new _i(""+e.key+t.key,e.value,t.message)});var i=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!i.outputDefined())return[new _i(e.key,e.value,'Invalid data expression for "'+e.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===e.expressionContext&&"layout"===e.propertyType&&!Ae(i))return[new _i(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!Ae(i))return[new _i(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!ze(i,["zoom","feature-state"]))return[new _i(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!je(i))return[new _i(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ei(e){var t=e.key,i=e.value,r=e.valueSpec,n=[];return Array.isArray(r.values)?-1===r.values.indexOf(Ci(i))&&n.push(new _i(t,i,"expected one of ["+r.values.join(", ")+"], "+JSON.stringify(i)+" found")):-1===Object.keys(r.values).indexOf(Ci(i))&&n.push(new _i(t,i,"expected one of ["+Object.keys(r.values).join(", ")+"], "+JSON.stringify(i)+" found")),n}function Li(e){return ui(Si(e.value))?Oi(I({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function e(t){var i=t.value;var r=t.key;if("array"!==Gt(i))return[new _i(r,i,"array expected, "+Gt(i)+" found")];var n=t.styleSpec;var a;var o=[];if(i.length<1)return[new _i(r,i,"filter array must have at least 1 element")];o=o.concat(Ei({key:r+"[0]",value:i[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec}));switch(Ci(i[0])){case"<":case"<=":case">":case">=":i.length>=2&&"$type"===Ci(i[1])&&o.push(new _i(r,i,'"$type" cannot be use with operator "'+i[0]+'"'));case"==":case"!=":3!==i.length&&o.push(new _i(r,i,'filter array for operator "'+i[0]+'" must have 3 elements'));case"in":case"!in":i.length>=2&&"string"!==(a=Gt(i[1]))&&o.push(new _i(r+"[1]",i[1],"string expected, "+a+" found"));for(var s=2;s<i.length;s++)a=Gt(i[s]),"$type"===Ci(i[1])?o=o.concat(Ei({key:r+"["+s+"]",value:i[s],valueSpec:n.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==a&&"number"!==a&&"boolean"!==a&&o.push(new _i(r+"["+s+"]",i[s],"string, number, or boolean expected, "+a+" found"));break;case"any":case"all":case"none":for(var l=1;l<i.length;l++)o=o.concat(e({key:r+"["+l+"]",value:i[l],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":a=Gt(i[1]),2!==i.length?o.push(new _i(r,i,'filter array for "'+i[0]+'" operator must have 2 elements')):"string"!==a&&o.push(new _i(r+"[1]",i[1],"string expected, "+a+" found"));break;case"within":a=Gt(i[1]),2!==i.length?o.push(new _i(r,i,'filter array for "'+i[0]+'" operator must have 2 elements')):"object"!==a&&o.push(new _i(r+"[1]",i[1],"object expected, "+a+" found"))}return o}(e)}function Pi(e,t){var i=e.key,r=e.style,n=e.styleSpec,a=e.value,o=e.objectKey,s=n[t+"_"+e.layerType];if(!s)return[];var l=o.match(/^(.*)-transition$/);if("paint"===t&&l&&s[l[1]]&&s[l[1]].transition)return Fi({key:i,value:a,valueSpec:n.transition,style:r,styleSpec:n});var h,c=e.valueSpec||s[o];if(!c)return[new _i(i,a,'unknown property "'+o+'"')];if("string"===Gt(a)&&Dt(c)&&!c.tokens&&(h=/^{([^}]+)}$/.exec(a)))return[new _i(i,a,'"'+o+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(h[1])+" }`.")];var u=[];return"symbol"===e.layerType&&("text-field"===o&&r&&!r.glyphs&&u.push(new _i(i,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&Ft(Si(a))&&"identity"===Ci(a.type)&&u.push(new _i(i,a,'"text-font" does not support identity functions'))),u.concat(Fi({key:e.key,value:a,valueSpec:c,style:r,styleSpec:n,expressionContext:"property",propertyType:t,propertyKey:o}))}function Ri(e){return Pi(e,"paint")}function ji(e){return Pi(e,"layout")}function Ai(e){var t=[],i=e.value,r=e.key,n=e.style,a=e.styleSpec;i.type||i.ref||t.push(new _i(r,i,'either "type" or "ref" is required'));var o,s=Ci(i.type),l=Ci(i.ref);if(i.id)for(var h=Ci(i.id),c=0;c<e.arrayIndex;c++){var u=n.layers[c];Ci(u.id)===h&&t.push(new _i(r,i.id,'duplicate layer id "'+i.id+'", previously used at line '+u.id.__line__))}if("ref"in i)["type","source","source-layer","filter","layout"].forEach(function(e){e in i&&t.push(new _i(r,i[e],'"'+e+'" is prohibited for ref layers'))}),n.layers.forEach(function(e){Ci(e.id)===l&&(o=e)}),o?o.ref?t.push(new _i(r,i.ref,"ref cannot reference another ref layer")):s=Ci(o.type):t.push(new _i(r,i.ref,'ref layer "'+l+'" not found'));else if("background"!==s)if(i.source){var d=n.sources&&n.sources[i.source],p=d&&Ci(d.type);d?"vector"===p&&"raster"===s?t.push(new _i(r,i.source,'layer "'+i.id+'" requires a raster source')):"raster"===p&&"raster"!==s?t.push(new _i(r,i.source,'layer "'+i.id+'" requires a vector source')):"vector"!==p||i["source-layer"]?"raster-dem"===p&&"hillshade"!==s?t.push(new _i(r,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!i.paint||!i.paint["line-gradient"]||"geojson"===p&&d.lineMetrics||t.push(new _i(r,i,'layer "'+i.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new _i(r,i,'layer "'+i.id+'" must specify a "source-layer"')):t.push(new _i(r,i.source,'source "'+i.source+'" not found'))}else t.push(new _i(r,i,'missing required property "source"'));return t=t.concat(Mi({key:r,value:i,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Fi({key:r+".type",value:i.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,object:i,objectKey:"type"})},filter:Li,layout:function(e){return Mi({layer:i,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return ji(I({layerType:s},e))}}})},paint:function(e){return Mi({layer:i,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return Ri(I({layerType:s},e))}}})}}}))}function zi(e){var t=e.value,i=e.key,r=Gt(t);return"string"!==r?[new _i(i,t,"string expected, "+r+" found")]:[]}var Di={promoteId:function(e){var t=e.key,i=e.value;if("string"===Gt(i))return zi({key:t,value:i});var r=[];for(var n in i)r.push.apply(r,zi({key:t+"."+n,value:i[n]}));return r}};function Vi(e){var t=e.value,i=e.key,r=e.styleSpec,n=e.style;if(!t.type)return[new _i(i,t,'"type" is required')];var a,o=Ci(t.type);switch(o){case"vector":case"raster":case"raster-dem":return a=Mi({key:i,value:t,valueSpec:r["source_"+o.replace("-","_")],style:e.style,styleSpec:r,objectElementValidators:Di});case"geojson":if(a=Mi({key:i,value:t,valueSpec:r.source_geojson,style:n,styleSpec:r,objectElementValidators:Di}),t.cluster)for(var s in t.clusterProperties){var l=t.clusterProperties[s],h=l[0],c=l[1],u="string"==typeof h?[h,["accumulated"],["get",s]]:h;a.push.apply(a,Oi({key:i+"."+s+".map",value:c,expressionContext:"cluster-map"})),a.push.apply(a,Oi({key:i+"."+s+".reduce",value:u,expressionContext:"cluster-reduce"}))}return a;case"video":return Mi({key:i,value:t,valueSpec:r.source_video,style:n,styleSpec:r});case"image":return Mi({key:i,value:t,valueSpec:r.source_image,style:n,styleSpec:r});case"canvas":return[new _i(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ei({key:i+".type",value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,styleSpec:r})}}function Ni(e){var t=e.value,i=e.styleSpec,r=i.light,n=e.style,a=[],o=Gt(t);if(void 0===t)return a;if("object"!==o)return a=a.concat([new _i("light",t,"object expected, "+o+" found")]);for(var s in t){var l=s.match(/^(.*)-transition$/);a=l&&r[l[1]]&&r[l[1]].transition?a.concat(Fi({key:s,value:t[s],valueSpec:i.transition,style:n,styleSpec:i})):r[s]?a.concat(Fi({key:s,value:t[s],valueSpec:r[s],style:n,styleSpec:i})):a.concat([new _i(s,t[s],'unknown property "'+s+'"')])}return a}var Gi={"*":function(){return[]},array:ki,boolean:function(e){var t=e.value,i=e.key,r=Gt(t);return"boolean"!==r?[new _i(i,t,"boolean expected, "+r+" found")]:[]},number:Ti,color:function(e){var t=e.key,i=e.value,r=Gt(i);return"string"!==r?[new _i(t,i,"color expected, "+r+" found")]:null===Y(i)?[new _i(t,i,'color expected, "'+i+'" found')]:[]},constants:xi,enum:Ei,filter:Li,function:Ii,layer:Ai,object:Mi,source:Vi,light:Ni,string:zi,formatted:function(e){return 0===zi(e).length?[]:Oi(e)},resolvedImage:function(e){return 0===zi(e).length?[]:Oi(e)}};function Fi(e){var t=e.value,i=e.valueSpec,r=e.styleSpec;return i.expression&&Ft(Ci(t))?Ii(e):i.expression&&Jt(Si(t))?Oi(e):i.type&&Gi[i.type]?Gi[i.type](e):Mi(I({},e,{valueSpec:i.type?r[i.type]:i}))}function Bi(e){var t=e.value,i=e.key,r=zi(e);return r.length?r:(-1===t.indexOf("{fontstack}")&&r.push(new _i(i,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&r.push(new _i(i,t,'"glyphs" url must include a "{range}" token')),r)}function qi(e,t){void 0===t&&(t=n);var i=[];return i=i.concat(Fi({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:Bi,"*":function(){return[]}}})),e.constants&&(i=i.concat(xi({key:"constants",value:e.constants,style:e,styleSpec:t}))),Ui(i)}function Ui(e){return[].concat(e).sort(function(e,t){return e.line-t.line})}function Wi(e){return function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return Ui(e.apply(this,t))}}qi.source=Wi(Vi),qi.light=Wi(Ni),qi.layer=Wi(Ai),qi.filter=Wi(Li),qi.paintProperty=Wi(Ri),qi.layoutProperty=Wi(ji);var Hi=o(function(e,t){var i=function(){var e=function(e,t,i,r){for(i=i||{},r=e.length;r--;i[e[r]]=t);return i},t=[1,12],i=[1,13],r=[1,9],n=[1,10],a=[1,11],o=[1,14],s=[1,15],l=[14,18,22,24],h=[18,22],c=[22,24],u={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(e,t,i,r,n,a,o){var s=a.length-1;switch(n){case 1:this.$=new String(e.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(e),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.$=a[s-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=a[s-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[a[s-2],a[s]];break;case 16:this.$={},this.$[a[s][0]]=a[s][1];break;case 17:this.$=a[s-2],a[s-2][a[s][0]]=a[s][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[a[s]];break;case 21:this.$=a[s-2],a[s-2].push(a[s])}},table:[{3:5,4:t,5:6,6:i,7:3,8:r,9:4,10:n,11:a,12:1,13:2,15:7,16:8,17:o,23:s},{1:[3]},{14:[1,16]},e(l,[2,7]),e(l,[2,8]),e(l,[2,9]),e(l,[2,10]),e(l,[2,11]),e(l,[2,12]),e(l,[2,3]),e(l,[2,4]),e(l,[2,5]),e([14,18,21,22,24],[2,1]),e(l,[2,2]),{3:20,4:t,18:[1,17],19:18,20:19},{3:5,4:t,5:6,6:i,7:3,8:r,9:4,10:n,11:a,13:23,15:7,16:8,17:o,23:s,24:[1,21],25:22},{1:[2,6]},e(l,[2,13]),{18:[1,24],22:[1,25]},e(h,[2,16]),{21:[1,26]},e(l,[2,18]),{22:[1,28],24:[1,27]},e(c,[2,20]),e(l,[2,14]),{3:20,4:t,20:29},{3:5,4:t,5:6,6:i,7:3,8:r,9:4,10:n,11:a,13:30,15:7,16:8,17:o,23:s},e(l,[2,19]),{3:5,4:t,5:6,6:i,7:3,8:r,9:4,10:n,11:a,13:31,15:7,16:8,17:o,23:s},e(h,[2,17]),e(h,[2,15]),e(c,[2,21])],defaultActions:{16:[2,6]},parseError:function(e,t){if(!t.recoverable)throw new Error(e);this.trace(e)},parse:function(e){var t=this,i=[0],r=[null],n=[],a=this.table,o="",s=0,l=0,h=1,c=n.slice.call(arguments,1),u=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);u.setInput(e,d.yy),d.yy.lexer=u,d.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var f=u.yylloc;n.push(f);var m=u.options&&u.options.ranges;function y(){var e;return"number"!=typeof(e=u.lex()||h)&&(e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var g,v,b,_,w,x,C,S,M={};;){if(v=i[i.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null!==g&&void 0!==g||(g=y()),b=a[v]&&a[v][g]),void 0===b||!b.length||!b[0]){var k="";for(w in S=[],a[v])this.terminals_[w]&&w>2&&S.push("'"+this.terminals_[w]+"'");k=u.showPosition?"Parse error on line "+(s+1)+":\n"+u.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[g]||g)+"'":"Parse error on line "+(s+1)+": Unexpected "+(g==h?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(k,{text:u.match,token:this.terminals_[g]||g,line:u.yylineno,loc:f,expected:S})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(b[0]){case 1:i.push(g),r.push(u.yytext),n.push(u.yylloc),i.push(b[1]),g=null,l=u.yyleng,o=u.yytext,s=u.yylineno,f=u.yylloc;break;case 2:if(x=this.productions_[b[1]][1],M.$=r[r.length-x],M._$={first_line:n[n.length-(x||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(x||1)].first_column,last_column:n[n.length-1].last_column},m&&(M._$.range=[n[n.length-(x||1)].range[0],n[n.length-1].range[1]]),void 0!==(_=this.performAction.apply(M,[o,l,s,d.yy,b[1],r,n].concat(c))))return _;x&&(i=i.slice(0,-1*x*2),r=r.slice(0,-1*x),n=n.slice(0,-1*x)),i.push(this.productions_[b[1]][0]),r.push(M.$),n.push(M._$),C=a[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},d={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,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 e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.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),e},unput:function(e){var t=e.length,i=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),i.length-1&&(this.yylineno-=i.length-1);var n=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:i?(i.length===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-t]),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(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var i,r,n;if(this.options.backtrack_lexer&&(n={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&&(n.yylloc.range=this.yylloc.range.slice(0))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],i=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var a in n)this[a]=n[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var e,t,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),a=0;a<n.length;a++)if((i=this._input.match(this.rules[n[a]]))&&(!t||i[0].length>t[0].length)){if(t=i,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(i,n[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,n[r]))&&e:""===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 e=this.next();return e||this.lex()},begin:function(e){this.conditionStack.push(e)},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(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(e,t,i,r){switch(i){case 0:break;case 1:return 6;case 2:return t.yytext=t.yytext.substr(1,t.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 u.lexer=d,p.prototype=u,u.Parser=p,new p}();t.parser=i,t.Parser=i.Parser,t.parse=function(){return i.parse.apply(i,arguments)}});Hi.parser,Hi.Parser,Hi.parse;function Yi(e){if(e instanceof String||"string"==typeof e||e instanceof r)try{return Hi.parse(e.toString())}catch(e){throw new wi(e)}return e}function Xi(e,t){void 0===t&&(t=n);var i=e;try{i=Yi(i)}catch(e){return[e]}return qi(i,t)}var $i={StyleExpression:$t,isExpression:Jt,isExpressionFilter:ui,createExpression:Kt,createPropertyExpression:ei,normalizePropertyExpression:function(e,t){if(Ft(e))return new ti(e,t);if(Jt(e)){var i=ei(e,t);if("error"===i.result)throw new Error(i.value.map(function(e){return e.key+": "+e.message}).join(", "));return i.value}var r=e;return"string"==typeof e&&"color"===t.type&&(r=X.parse(e)),{kind:"constant",evaluate:function(){return r}}},ZoomConstantExpression:Zt,ZoomDependentExpression:Qt,StylePropertyFunction:ti},Ji={convertFunction:ri,createFunction:qt,isFunction:Ft};Xi.parsed=Xi,Xi.latest=Xi}).call(this,i(5),i(12).Buffer)},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",function(){return toLabelClass});var _mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__),_FontUtil__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(7);function toLabelClass(defaultLabelClass,text,overWrite,properties){let labelClass=defaultLabelClass.clone();const symbol=labelClass.symbol;if(text){symbol.text=text.getText();const e=text.getFont(),t=_FontUtil__WEBPACK_IMPORTED_MODULE_1__.a.parse(e,{fontSize:"12px",fontFamily:"微软雅黑",fontWeight:"normal",fontStyle:"normal"});symbol.font={size:parseFloat(t.fontSize),family:t.fontFamily,weight:t.fontWeight,style:t.fontStyle},symbol.xoffset=text.getOffsetX(),symbol.yoffset=text.getOffsetY(),labelClass.scale=text.getScale()||1,symbol.angle=180*text.getRotation()/Math.PI;const i={left:"above-left",right:"above-right",center:"above-center",start:"above-left",end:"above-right"};i[text.getTextAlign()]&&(labelClass.labelPlacement=i[text.getTextAlign()]);const r=text.getFill();if(r){const e=r.getColor();e&&(symbol.color=`rgba(${e[0]},${e[1]},${e[2]},${e[3]})`)}const n=text.getStroke();if(n){const e=n.getColor(),t=n.getWidth();e&&(symbol.haloColor=`rgba(${e[0]},${e[1]},${e[2]},${e[3]})`,symbol.haloSize=t)}const a=text.getBackgroundFill();if(a){const e=a.getColor();e&&(symbol.showBackground=!0,symbol.backgroundColor=`rgba(${e[0]},${e[1]},${e[2]},${e[3]})`)}}if(overWrite){const overWriteSymbol=Object.assign({},symbol.toJSON(),overWrite.symbol.toJSON()),overWriteLabelClass=Object.assign({},labelClass.toJSON(),overWrite.toJSON());if(overWriteLabelClass.symbol=overWriteSymbol,labelClass=new _mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.LabelClass(overWriteLabelClass),labelClass.symbol.text=text.getText(),labelClass.labelExpression){const excuteStr=labelClass.labelExpression.replace(/\$feature/g,"properties");try{labelClass.symbol.text=eval(excuteStr)||""}catch(e){console.log("err: ",e)}}else labelClass.currentAttributeName&&properties[labelClass.currentAttributeName]&&(text=properties[labelClass.currentAttributeName])}return labelClass}},function(e,t){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t){
2
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
3
+ t.read=function(e,t,i,r,n){var a,o,s=8*n-r-1,l=(1<<s)-1,h=l>>1,c=-7,u=i?n-1:0,d=i?-1:1,p=e[t+u];for(u+=d,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+e[t+u],u+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+e[t+u],u+=d,c-=8);if(0===a)a=1-h;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),a-=h}return(p?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,i,r,n,a){var o,s,l,h=8*a-n-1,c=(1<<h)-1,u=c>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:a-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=c?(s=0,o=c):o+u>=1?(s=(t*l-1)*Math.pow(2,n),o+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,n),o=0));n>=8;e[i+p]=255&s,p+=f,s/=256,n-=8);for(o=o<<n|s,h+=n;h>0;e[i+p]=255&o,p+=f,o/=256,h-=8);e[i+p-f]|=128*m}},function(e,t,i){"use strict";(function(e){function r(e){const t=e.trim();return/^('|")/.test(t)?t:`"${t}"`}i.d(t,"a",function(){return n});class n{constructor(e,t,i,r,a,o){const s=o?"string"==typeof o?n.parse(o):o:{};this.fontFamily=a||s.fontFamily,this.fontSize=r||s.fontSize,this.fontStyle=e||s.fontStyle,this.fontWeight=i||s.fontWeight,this.fontVariant=t||s.fontVariant}toString(){return[function(e){if(!e)return"";const t=e.trim().toLowerCase();switch(t){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return t;default:return/^oblique\s+(-|)\d+deg$/.test(t)?t:""}}(this.fontStyle),this.fontVariant,function(e){if(!e)return"";const t=e.trim().toLowerCase();switch(t){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return t;default:return/^[\d.]+$/.test(t)?t:""}}(this.fontWeight),this.fontSize,function(t){return void 0===e?t:t.trim().split(",").map(r).join(",")}(this.fontFamily)].join(" ").trim()}}n.styles="normal|italic|oblique|inherit",n.variants="normal|small-caps|inherit",n.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit",n.parse=function(e="",t){let i="",r="",a="",o="",s="";const l={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return function(e){return e.replace(/(?!\u3000)\s+/gm," ")}(e).trim().split(" ").forEach(e=>{switch(!0){case!l.fontStyle&&n.styles.includes(e):"inherit"!==e&&(i=e),l.fontStyle=!0;break;case!l.fontVariant&&n.variants.includes(e):"inherit"!==e&&(r=e),l.fontStyle=!0,l.fontVariant=!0;break;case!l.fontWeight&&n.weights.includes(e):"inherit"!==e&&(a=e),l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0;break;case!l.fontSize:"inherit"!==e&&(o=e.split("/")[0]||""),l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0,l.fontSize=!0;break;default:"inherit"!==e&&(s+=e)}}),new n(i,r,a,o,s,t)}}).call(this,i(11))},function(e,t){(function(){var t;e.exports={icon:"icons/google.svg",name:"google",title:"Google Fonts",link:"google.com/fonts",getNames:function(){return t},getLink:function(e){return"https://fonts.google.com/specimen/"+e.replace(/( )/g,"+")},normalizeName:function(e){return e}},t=["ABeeZee","Abel","Abril Fatface","Aclonica","Acme","Actor","Adamina","Advent Pro","Aguafina Script","Akronim","Aladin","Aldrich","Alef","Alegreya","Alegreya SC","Alegreya Sans","Alegreya Sans SC","Alex Brush","Alfa Slab One","Alice","Alike","Alike Angular","Allan","Allerta","Allerta Stencil","Allura","Almendra","Almendra Display","Almendra SC","Amarante","Amaranth","Amatic SC","Amethysta","Amiri","Amita","Anaheim","Andada","Andika","Angkor","Annie Use Your Telescope","Anonymous Pro","Antic","Antic Didone","Antic Slab","Anton","Arapey","Arbutus","Arbutus Slab","Architects Daughter","Archivo Black","Archivo Narrow","Arimo","Arizonia","Armata","Artifika","Arvo","Arya","Asap","Asar","Asset","Astloch","Asul","Atomic Age","Aubrey","Audiowide","Autour One","Average","Average Sans","Averia Gruesa Libre","Averia Libre","Averia Sans Libre","Averia Serif Libre","Bad Script","Balthazar","Bangers","Basic","Battambang","Baumans","Bayon","Belgrano","Belleza","BenchNine","Bentham","Berkshire Swash","Bevan","Bigelow Rules","Bigshot One","Bilbo","Bilbo Swash Caps","Biryani","Bitter","Black Ops One","Bokor","Bonbon","Boogaloo","Bowlby One","Bowlby One SC","Brawler","Bree Serif","Bubblegum Sans","Bubbler One","Buda","Buenard","Butcherman","Butterfly Kids","Cabin","Cabin Condensed","Cabin Sketch","Caesar Dressing","Cagliostro","Calligraffitti","Cambay","Cambo","Candal","Cantarell","Cantata One","Cantora One","Capriola","Cardo","Carme","Carrois Gothic","Carrois Gothic SC","Carter One","Catamaran","Caudex","Caveat","Caveat Brush","Cedarville Cursive","Ceviche One","Changa One","Chango","Chau Philomene One","Chela One","Chelsea Market","Chenla","Cherry Cream Soda","Cherry Swash","Chewy","Chicle","Chivo","Chonburi","Cinzel","Cinzel Decorative","Clicker Script","Coda","Coda Caption","Codystar","Combo","Comfortaa","Coming Soon","Concert One","Condiment","Content","Contrail One","Convergence","Cookie","Copse","Corben","Courgette","Cousine","Coustard","Covered By Your Grace","Crafty Girls","Creepster","Crete Round","Crimson Text","Croissant One","Crushed","Cuprum","Cutive","Cutive Mono","Damion","Dancing Script","Dangrek","Dawning of a New Day","Days One","Dekko","Delius","Delius Swash Caps","Delius Unicase","Della Respira","Denk One","Devonshire","Dhurjati","Didact Gothic","Diplomata","Diplomata SC","Domine","Donegal One","Doppio One","Dorsa","Dosis","Dr Sugiyama","Droid Sans","Droid Sans Mono","Droid Serif","Duru Sans","Dynalight","EB Garamond","Eagle Lake","Eater","Economica","Eczar","Ek Mukta","Electrolize","Elsie","Elsie Swash Caps","Emblema One","Emilys Candy","Engagement","Englebert","Enriqueta","Erica One","Esteban","Euphoria Script","Ewert","Exo","Exo 2","Expletus Sans","Fanwood Text","Fascinate","Fascinate Inline","Faster One","Fasthand","Fauna One","Federant","Federo","Felipa","Fenix","Finger Paint","Fira Mono","Fira Sans","Fjalla One","Fjord One","Flamenco","Flavors","Fondamento","Fontdiner Swanky","Forum","Francois One","Freckle Face","Fredericka the Great","Fredoka One","Freehand","Fresca","Frijole","Fruktur","Fugaz One","GFS Didot","GFS Neohellenic","Gabriela","Gafata","Galdeano","Galindo","Gentium Basic","Gentium Book Basic","Geo","Geostar","Geostar Fill","Germania One","Gidugu","Gilda Display","Give You Glory","Glass Antiqua","Glegoo","Gloria Hallelujah","Goblin One","Gochi Hand","Gorditas","Goudy Bookletter 1911","Graduate","Grand Hotel","Gravitas One","Great Vibes","Griffy","Gruppo","Gudea","Gurajada","Habibi","Halant","Hammersmith One","Hanalei","Hanalei Fill","Handlee","Hanuman","Happy Monkey","Headland One","Henny Penny","Herr Von Muellerhoff","Hind","Hind Siliguri","Hind Vadodara","Holtwood One SC","Homemade Apple","Homenaje","IM Fell DW Pica","IM Fell DW Pica SC","IM Fell Double Pica","IM Fell Double Pica SC","IM Fell English","IM Fell English SC","IM Fell French Canon","IM Fell French Canon SC","IM Fell Great Primer","IM Fell Great Primer SC","Iceberg","Iceland","Imprima","Inconsolata","Inder","Indie Flower","Inika","Inknut Antiqua","Irish Grover","Istok Web","Italiana","Italianno","Itim","Jacques Francois","Jacques Francois Shadow","Jaldi","Jim Nightshade","Jockey One","Jolly Lodger","Josefin Sans","Josefin Slab","Joti One","Judson","Julee","Julius Sans One","Junge","Jura","Just Another Hand","Just Me Again Down Here","Kadwa","Kalam","Kameron","Kantumruy","Karla","Karma","Kaushan Script","Kavoon","Kdam Thmor","Keania One","Kelly Slab","Kenia","Khand","Khmer","Khula","Kite One","Knewave","Kotta One","Koulen","Kranky","Kreon","Kristi","Krona One","Kurale","La Belle Aurore","Laila","Lakki Reddy","Lancelot","Lateef","Lato","League Script","Leckerli One","Ledger","Lekton","Lemon","Libre Baskerville","Life Savers","Lilita One","Lily Script One","Limelight","Linden Hill","Lobster","Lobster Two","Londrina Outline","Londrina Shadow","Londrina Sketch","Londrina Solid","Lora","Love Ya Like A Sister","Loved by the King","Lovers Quarrel","Luckiest Guy","Lusitana","Lustria","Macondo","Macondo Swash Caps","Magra","Maiden Orange","Mako","Mallanna","Mandali","Marcellus","Marcellus SC","Marck Script","Margarine","Marko One","Marmelad","Martel","Martel Sans","Marvel","Mate","Mate SC","Maven Pro","McLaren","Meddon","MedievalSharp","Medula One","Megrim","Meie Script","Merienda","Merienda One","Merriweather","Merriweather Sans","Metal","Metal Mania","Metamorphous","Metrophobic","Michroma","Milonga","Miltonian","Miltonian Tattoo","Miniver","Miss Fajardose","Modak","Modern Antiqua","Molengo","Molle","Monda","Monofett","Monoton","Monsieur La Doulaise","Montaga","Montez","Montserrat","Montserrat Alternates","Montserrat Subrayada","Moul","Moulpali","Mountains of Christmas","Mouse Memoirs","Mr Bedfort","Mr Dafoe","Mr De Haviland","Mrs Saint Delafield","Mrs Sheppards","Muli","Mystery Quest","NTR","Neucha","Neuton","New Rocker","News Cycle","Niconne","Nixie One","Nobile","Nokora","Norican","Nosifer","Nothing You Could Do","Noticia Text","Noto Sans","Noto Serif","Nova Cut","Nova Flat","Nova Mono","Nova Oval","Nova Round","Nova Script","Nova Slim","Nova Square","Numans","Nunito","Odor Mean Chey","Offside","Old Standard TT","Oldenburg","Oleo Script","Oleo Script Swash Caps","Open Sans","Open Sans Condensed","Oranienbaum","Orbitron","Oregano","Orienta","Original Surfer","Oswald","Over the Rainbow","Overlock","Overlock SC","Ovo","Oxygen","Oxygen Mono","PT Mono","PT Sans","PT Sans Caption","PT Sans Narrow","PT Serif","PT Serif Caption","Pacifico","Palanquin","Palanquin Dark","Paprika","Parisienne","Passero One","Passion One","Pathway Gothic One","Patrick Hand","Patrick Hand SC","Patua One","Paytone One","Peddana","Peralta","Permanent Marker","Petit Formal Script","Petrona","Philosopher","Piedra","Pinyon Script","Pirata One","Plaster","Play","Playball","Playfair Display","Playfair Display SC","Podkova","Poiret One","Poller One","Poly","Pompiere","Pontano Sans","Poppins","Port Lligat Sans","Port Lligat Slab","Pragati Narrow","Prata","Preahvihear","Press Start 2P","Princess Sofia","Prociono","Prosto One","Puritan","Purple Purse","Quando","Quantico","Quattrocento","Quattrocento Sans","Questrial","Quicksand","Quintessential","Qwigley","Racing Sans One","Radley","Rajdhani","Raleway","Raleway Dots","Ramabhadra","Ramaraja","Rambla","Rammetto One","Ranchers","Rancho","Ranga","Rationale","Ravi Prakash","Redressed","Reenie Beanie","Revalia","Rhodium Libre","Ribeye","Ribeye Marrow","Righteous","Risque","Roboto","Roboto Condensed","Roboto Mono","Roboto Slab","Rochester","Rock Salt","Rokkitt","Romanesco","Ropa Sans","Rosario","Rosarivo","Rouge Script","Rozha One","Rubik","Rubik Mono One","Rubik One","Ruda","Rufina","Ruge Boogie","Ruluko","Rum Raisin","Ruslan Display","Russo One","Ruthie","Rye","Sacramento","Sahitya","Sail","Salsa","Sanchez","Sancreek","Sansita One","Sarala","Sarina","Sarpanch","Satisfy","Scada","Scheherazade","Schoolbell","Seaweed Script","Sevillana","Seymour One","Shadows Into Light","Shadows Into Light Two","Shanti","Share","Share Tech","Share Tech Mono","Shojumaru","Short Stack","Siemreap","Sigmar One","Signika","Signika Negative","Simonetta","Sintony","Sirin Stencil","Six Caps","Skranji","Slabo 13px","Slabo 27px","Slackey","Smokum","Smythe","Sniglet","Snippet","Snowburst One","Sofadi One","Sofia","Sonsie One","Sorts Mill Goudy","Source Code Pro","Source Sans Pro","Source Serif Pro","Special Elite","Spicy Rice","Spinnaker","Spirax","Squada One","Sree Krushnadevaraya","Stalemate","Stalinist One","Stardos Stencil","Stint Ultra Condensed","Stint Ultra Expanded","Stoke","Strait","Sue Ellen Francisco","Sumana","Sunshiney","Supermercado One","Sura","Suranna","Suravaram","Suwannaphum","Swanky and Moo Moo","Syncopate","Tangerine","Taprom","Tauri","Teko","Telex","Tenali Ramakrishna","Tenor Sans","Text Me One","The Girl Next Door","Tienne","Tillana","Timmana","Tinos","Titan One","Titillium Web","Trade Winds","Trocchi","Trochut","Trykker","Tulpen One","Ubuntu","Ubuntu Condensed","Ubuntu Mono","Ultra","Uncial Antiqua","Underdog","Unica One","UnifrakturCook","UnifrakturMaguntia","Unkempt","Unlock","Unna","VT323","Vampiro One","Varela","Varela Round","Vast Shadow","Vesper Libre","Vibur","Vidaloka","Viga","Voces","Volkhov","Vollkorn","Voltaire","Waiting for the Sunrise","Wallpoet","Walter Turncoat","Warnes","Wellfleet","Wendy One","Wire One","Work Sans","Yanone Kaffeesatz","Yantramanav","Yellowtail","Yeseva One","Yesteryear","Zeyada"]}).call(this)},function(e,t,i){"use strict";e.exports=n;var r=i(6);function n(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;function a(e){return e.type===n.Bytes?e.readVarint()+e.pos:e.pos+1}function o(e,t,i){return i?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function s(e,t,i){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.ceil(Math.log(t)/(7*Math.LN2));i.realloc(r);for(var n=i.pos-1;n>=e;n--)i.buf[n+r]=i.buf[n]}function l(e,t){for(var i=0;i<e.length;i++)t.writeVarint(e[i])}function h(e,t){for(var i=0;i<e.length;i++)t.writeSVarint(e[i])}function c(e,t){for(var i=0;i<e.length;i++)t.writeFloat(e[i])}function u(e,t){for(var i=0;i<e.length;i++)t.writeDouble(e[i])}function d(e,t){for(var i=0;i<e.length;i++)t.writeBoolean(e[i])}function p(e,t){for(var i=0;i<e.length;i++)t.writeFixed32(e[i])}function f(e,t){for(var i=0;i<e.length;i++)t.writeSFixed32(e[i])}function m(e,t){for(var i=0;i<e.length;i++)t.writeFixed64(e[i])}function y(e,t){for(var i=0;i<e.length;i++)t.writeSFixed64(e[i])}function g(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function v(e,t,i){e[i]=t,e[i+1]=t>>>8,e[i+2]=t>>>16,e[i+3]=t>>>24}function b(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}n.prototype={destroy:function(){this.buf=null},readFields:function(e,t,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),n=r>>3,a=this.pos;this.type=7&r,e(n,t,this),this.pos===a&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=g(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=b(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=g(this.buf,this.pos)+4294967296*g(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=g(this.buf,this.pos)+4294967296*b(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,i,r=this.buf;return t=127&(i=r[this.pos++]),i<128?t:(t|=(127&(i=r[this.pos++]))<<7,i<128?t:(t|=(127&(i=r[this.pos++]))<<14,i<128?t:(t|=(127&(i=r[this.pos++]))<<21,i<128?t:function(e,t,i){var r,n,a=i.buf;if(n=a[i.pos++],r=(112&n)>>4,n<128)return o(e,r,t);if(n=a[i.pos++],r|=(127&n)<<3,n<128)return o(e,r,t);if(n=a[i.pos++],r|=(127&n)<<10,n<128)return o(e,r,t);if(n=a[i.pos++],r|=(127&n)<<17,n<128)return o(e,r,t);if(n=a[i.pos++],r|=(127&n)<<24,n<128)return o(e,r,t);if(n=a[i.pos++],r|=(1&n)<<31,n<128)return o(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(i=r[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=function(e,t,i){var r="",n=t;for(;n<i;){var a,o,s,l=e[n],h=null,c=l>239?4:l>223?3:l>191?2:1;if(n+c>i)break;1===c?l<128&&(h=l):2===c?128==(192&(a=e[n+1]))&&(h=(31&l)<<6|63&a)<=127&&(h=null):3===c?(a=e[n+1],o=e[n+2],128==(192&a)&&128==(192&o)&&((h=(15&l)<<12|(63&a)<<6|63&o)<=2047||h>=55296&&h<=57343)&&(h=null)):4===c&&(a=e[n+1],o=e[n+2],s=e[n+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((h=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||h>=1114112)&&(h=null)),null===h?(h=65533,c=1):h>65535&&(h-=65536,r+=String.fromCharCode(h>>>10&1023|55296),h=56320|1023&h),r+=String.fromCharCode(h),n+=c}return r}(this.buf,this.pos,e);return this.pos=e,t},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){var i=a(this);for(e=e||[];this.pos<i;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===n.Varint)for(;this.buf[this.pos++]>127;);else if(t===n.Bytes)this.pos=this.readVarint()+this.pos;else if(t===n.Fixed32)this.pos+=4;else{if(t!==n.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var i=new Uint8Array(t);i.set(this.buf),this.buf=i,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),v(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),v(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),v(this.buf,-1&e,this.pos),v(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),v(this.buf,-1&e,this.pos),v(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var i,r;e>=0?(i=e%4294967296|0,r=e/4294967296|0):(r=~(-e/4294967296),4294967295^(i=~(-e%4294967296))?i=i+1|0:(i=0,r=r+1|0));if(e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,i){i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos]=127&e}(i,0,t),function(e,t){var i=(7&e)<<4;if(t.buf[t.pos++]|=i|((e>>>=3)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;t.buf[t.pos++]=127&e}(r,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,i){for(var r,n,a=0;a<t.length;a++){if((r=t.charCodeAt(a))>55295&&r<57344){if(!n){r>56319||a+1===t.length?(e[i++]=239,e[i++]=191,e[i++]=189):n=r;continue}if(r<56320){e[i++]=239,e[i++]=191,e[i++]=189,n=r;continue}r=n-55296<<10|r-56320|65536,n=null}else n&&(e[i++]=239,e[i++]=191,e[i++]=189,n=null);r<128?e[i++]=r:(r<2048?e[i++]=r>>6|192:(r<65536?e[i++]=r>>12|224:(e[i++]=r>>18|240,e[i++]=r>>12&63|128),e[i++]=r>>6&63|128),e[i++]=63&r|128)}return i}(this.buf,e,this.pos);var i=this.pos-t;i>=128&&s(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i},writeFloat:function(e){this.realloc(4),r.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),r.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var i=0;i<t;i++)this.buf[this.pos++]=e[i]},writeRawMessage:function(e,t){this.pos++;var i=this.pos;e(t,this);var r=this.pos-i;r>=128&&s(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,t,i){this.writeTag(e,n.Bytes),this.writeRawMessage(t,i)},writePackedVarint:function(e,t){this.writeMessage(e,l,t)},writePackedSVarint:function(e,t){this.writeMessage(e,h,t)},writePackedBoolean:function(e,t){this.writeMessage(e,d,t)},writePackedFloat:function(e,t){this.writeMessage(e,c,t)},writePackedDouble:function(e,t){this.writeMessage(e,u,t)},writePackedFixed32:function(e,t){this.writeMessage(e,p,t)},writePackedSFixed32:function(e,t){this.writeMessage(e,f,t)},writePackedFixed64:function(e,t){this.writeMessage(e,m,t)},writePackedSFixed64:function(e,t){this.writeMessage(e,y,t)},writeBytesField:function(e,t){this.writeTag(e,n.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,n.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,n.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,n.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,n.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,n.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,n.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,n.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,n.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,n.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}}},,function(e,t){var i,r,n=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(i===setTimeout)return setTimeout(e,0);if((i===a||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:a}catch(e){i=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var l,h=[],c=!1,u=-1;function d(){c&&l&&(c=!1,l.length?h=l.concat(h):u=-1,h.length&&p())}function p(){if(!c){var e=s(d);c=!0;for(var t=h.length;t;){for(l=h,h=[];++u<t;)l&&l[u].run();u=-1,t=h.length}l=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function m(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];h.push(new f(e,t)),1!==h.length||c||s(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=m,n.addListener=m,n.once=m,n.off=m,n.removeListener=m,n.removeAllListeners=m,n.emit=m,n.prependListener=m,n.prependOnceListener=m,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(e,t,i){"use strict";(function(e){
2
4
  /*!
3
5
  * The buffer module from node.js, for the browser.
4
6
  *
5
7
  * @author Feross Aboukhadijeh <http://feross.org>
6
8
  * @license MIT
7
9
  */
8
- var r=i(12),n=i(13),a=i(14);function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,i){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return u(this,e)}return h(this,e,t,i)}function h(e,t,i,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,r){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===i&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,i):new Uint8Array(t,i,r);l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=d(e,t);return e}(e,t,i,r):"string"==typeof t?function(e,t,i){"string"==typeof i&&""!==i||(i="utf8");if(!l.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var r=0|f(t,i),n=(e=s(e,r)).write(t,i);n!==r&&(e=e.slice(0,n));return e}(e,t,i):function(e,t){if(l.isBuffer(t)){var i=0|p(t.length);return 0===(e=s(e,i)).length?e:(t.copy(e,0,0,i),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||function(e){return e!=e}(t.length)?s(e,0):d(e,t);if("Buffer"===t.type&&a(t.data))return d(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,t){if(c(t),e=s(e,t<0?0:0|p(t)),!l.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function d(e,t){var i=t.length<0?0:0|p(t.length);e=s(e,i);for(var r=0;r<i;r+=1)e[r]=255&t[r];return e}function p(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function f(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return F(e).length;default:if(r)return G(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function y(e,t,i,r,n){if(0===e.length)return-1;if("string"==typeof i?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=n?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(n)return-1;i=e.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:g(e,t,i,r,n);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):g(e,[t],i,r,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,i,r,n){var a,o=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,i/=2}function h(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var c=-1;for(a=i;a<s;a++)if(h(e,a)===h(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===l)return c*o}else-1!==c&&(a-=a-c),c=-1}else for(i+l>s&&(i=s-l),a=i;a>=0;a--){for(var u=!0,d=0;d<l;d++)if(h(e,a+d)!==h(t,d)){u=!1;break}if(u)return a}return-1}function v(e,t,i,r){i=Number(i)||0;var n=e.length-i;r?(r=Number(r))>n&&(r=n):r=n;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[i+o]=s}return o}function b(e,t,i,r){return B(G(t,e.length-i),e,i,r)}function _(e,t,i,r){return B(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,r)}function w(e,t,i,r){return _(e,t,i,r)}function x(e,t,i,r){return B(F(t),e,i,r)}function C(e,t,i,r){return B(function(e,t){for(var i,r,n,a=[],o=0;o<e.length&&!((t-=2)<0);++o)i=e.charCodeAt(o),r=i>>8,n=i%256,a.push(n),a.push(r);return a}(t,e.length-i),e,i,r)}function S(e,t,i){return 0===t&&i===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,i))}function M(e,t,i){i=Math.min(e.length,i);for(var r=[],n=t;n<i;){var a,o,s,l,h=e[n],c=null,u=h>239?4:h>223?3:h>191?2:1;if(n+u<=i)switch(u){case 1:h<128&&(c=h);break;case 2:128==(192&(a=e[n+1]))&&(l=(31&h)<<6|63&a)>127&&(c=l);break;case 3:a=e[n+1],o=e[n+2],128==(192&a)&&128==(192&o)&&(l=(15&h)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:a=e[n+1],o=e[n+2],s=e[n+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&h)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,u=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),n+=u}return function(e){var t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);var i="",r=0;for(;r<t;)i+=String.fromCharCode.apply(String,e.slice(r,r+=k));return i}(r)}t.Buffer=l,t.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},t.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=o(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,i){return h(null,e,t,i)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,i){return function(e,t,i,r){return c(t),t<=0?s(e,t):void 0!==i?"string"==typeof r?s(e,t).fill(i,r):s(e,t).fill(i):s(e,t)}(null,e,t,i)},l.allocUnsafe=function(e){return u(null,e)},l.allocUnsafeSlow=function(e){return u(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,r=t.length,n=0,a=Math.min(i,r);n<a;++n)if(e[n]!==t[n]){i=e[n],r=t[n];break}return i<r?-1:r<i?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var r=l.allocUnsafe(t),n=0;for(i=0;i<e.length;++i){var o=e[i];if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,n),n+=o.length}return r},l.byteLength=f,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?M(this,0,e):function(e,t,i){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,i);case"utf8":case"utf-8":return M(this,t,i);case"ascii":return T(this,t,i);case"latin1":case"binary":return I(this,t,i);case"base64":return S(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,i);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",i=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,i,r,n){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),t<0||i>e.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&t>=i)return 0;if(r>=n)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,r>>>=0,n>>>=0,this===e)return 0;for(var a=n-r,o=i-t,s=Math.min(a,o),h=this.slice(r,n),c=e.slice(t,i),u=0;u<s;++u)if(h[u]!==c[u]){a=h[u],o=c[u];break}return a<o?-1:o<a?1:0},l.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},l.prototype.indexOf=function(e,t,i){return y(this,e,t,i,!0)},l.prototype.lastIndexOf=function(e,t,i){return y(this,e,t,i,!1)},l.prototype.write=function(e,t,i,r){if(void 0===t)r="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)r=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}var n=this.length-t;if((void 0===i||i>n)&&(i=n),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return v(this,e,t,i);case"utf8":case"utf-8":return b(this,e,t,i);case"ascii":return _(this,e,t,i);case"latin1":case"binary":return w(this,e,t,i);case"base64":return x(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,i);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function T(e,t,i){var r="";i=Math.min(e.length,i);for(var n=t;n<i;++n)r+=String.fromCharCode(127&e[n]);return r}function I(e,t,i){var r="";i=Math.min(e.length,i);for(var n=t;n<i;++n)r+=String.fromCharCode(e[n]);return r}function O(e,t,i){var r=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>r)&&(i=r);for(var n="",a=t;a<i;++a)n+=N(e[a]);return n}function E(e,t,i){for(var r=e.slice(t,i),n="",a=0;a<r.length;a+=2)n+=String.fromCharCode(r[a]+256*r[a+1]);return n}function L(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,i,r,n,a){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<a)throw new RangeError('"value" argument is out of bounds');if(i+r>e.length)throw new RangeError("Index out of range")}function R(e,t,i,r){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-i,2);n<a;++n)e[i+n]=(t&255<<8*(r?n:1-n))>>>8*(r?n:1-n)}function j(e,t,i,r){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-i,4);n<a;++n)e[i+n]=t>>>8*(r?n:3-n)&255}function A(e,t,i,r,n,a){if(i+r>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function z(e,t,i,r,a){return a||A(e,0,i,4),n.write(e,t,i,r,23,4),i+4}function D(e,t,i,r,a){return a||A(e,0,i,8),n.write(e,t,i,r,52,8),i+8}l.prototype.slice=function(e,t){var i,r=this.length;if(e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),l.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,t)).__proto__=l.prototype;else{var n=t-e;i=new l(n,void 0);for(var a=0;a<n;++a)i[a]=this[a+e]}return i},l.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||L(e,t,this.length);for(var r=this[e],n=1,a=0;++a<t&&(n*=256);)r+=this[e+a]*n;return r},l.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||L(e,t,this.length);for(var r=this[e+--t],n=1;t>0&&(n*=256);)r+=this[e+--t]*n;return r},l.prototype.readUInt8=function(e,t){return t||L(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||L(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||L(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||L(e,t,this.length);for(var r=this[e],n=1,a=0;++a<t&&(n*=256);)r+=this[e+a]*n;return r>=(n*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||L(e,t,this.length);for(var r=t,n=1,a=this[e+--r];r>0&&(n*=256);)a+=this[e+--r]*n;return a>=(n*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||L(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(e,t){t||L(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(e,t){return t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||L(e,4,this.length),n.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||L(e,4,this.length),n.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||L(e,8,this.length),n.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||L(e,8,this.length),n.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,i,r){(e=+e,t|=0,i|=0,r)||P(this,e,t,i,Math.pow(2,8*i)-1,0);var n=1,a=0;for(this[t]=255&e;++a<i&&(n*=256);)this[t+a]=e/n&255;return t+i},l.prototype.writeUIntBE=function(e,t,i,r){(e=+e,t|=0,i|=0,r)||P(this,e,t,i,Math.pow(2,8*i)-1,0);var n=i-1,a=1;for(this[t+n]=255&e;--n>=0&&(a*=256);)this[t+n]=e/a&255;return t+i},l.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):j(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,i,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*i-1);P(this,e,t,i,n-1,-n)}var a=0,o=1,s=0;for(this[t]=255&e;++a<i&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+i},l.prototype.writeIntBE=function(e,t,i,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*i-1);P(this,e,t,i,n-1,-n)}var a=i-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+i},l.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):j(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,i){return z(this,e,t,!0,i)},l.prototype.writeFloatBE=function(e,t,i){return z(this,e,t,!1,i)},l.prototype.writeDoubleLE=function(e,t,i){return D(this,e,t,!0,i)},l.prototype.writeDoubleBE=function(e,t,i){return D(this,e,t,!1,i)},l.prototype.copy=function(e,t,i,r){if(i||(i=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<i&&(r=i),r===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-i&&(r=e.length-t+i);var n,a=r-i;if(this===e&&i<t&&t<r)for(n=a-1;n>=0;--n)e[n+t]=this[n+i];else if(a<1e3||!l.TYPED_ARRAY_SUPPORT)for(n=0;n<a;++n)e[n+t]=this[n+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+a),t);return a},l.prototype.fill=function(e,t,i,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,i=this.length):"string"==typeof i&&(r=i,i=this.length),1===e.length){var n=e.charCodeAt(0);n<256&&(e=n)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var a;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(a=t;a<i;++a)this[a]=e;else{var o=l.isBuffer(e)?e:G(new l(e,r).toString()),s=o.length;for(a=0;a<i-t;++a)this[a+t]=o[a%s]}return this};var V=/[^+\/0-9A-Za-z-_]/g;function N(e){return e<16?"0"+e.toString(16):e.toString(16)}function G(e,t){var i;t=t||1/0;for(var r=e.length,n=null,a=[],o=0;o<r;++o){if((i=e.charCodeAt(o))>55295&&i<57344){if(!n){if(i>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}n=i;continue}if(i<56320){(t-=3)>-1&&a.push(239,191,189),n=i;continue}i=65536+(n-55296<<10|i-56320)}else n&&(t-=3)>-1&&a.push(239,191,189);if(n=null,i<128){if((t-=1)<0)break;a.push(i)}else if(i<2048){if((t-=2)<0)break;a.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;a.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return a}function F(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function B(e,t,i,r){for(var n=0;n<r&&!(n+i>=t.length||n>=e.length);++n)t[n+i]=e[n];return n}}).call(this,i(5))},function(e,t,i){"use strict";t.byteLength=function(e){var t=h(e),i=t[0],r=t[1];return 3*(i+r)/4-r},t.toByteArray=function(e){var t,i,r=h(e),o=r[0],s=r[1],l=new a(function(e,t,i){return 3*(t+i)/4-i}(0,o,s)),c=0,u=s>0?o-4:o;for(i=0;i<u;i+=4)t=n[e.charCodeAt(i)]<<18|n[e.charCodeAt(i+1)]<<12|n[e.charCodeAt(i+2)]<<6|n[e.charCodeAt(i+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;2===s&&(t=n[e.charCodeAt(i)]<<2|n[e.charCodeAt(i+1)]>>4,l[c++]=255&t);1===s&&(t=n[e.charCodeAt(i)]<<10|n[e.charCodeAt(i+1)]<<4|n[e.charCodeAt(i+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t);return l},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,a=[],o=0,s=i-n;o<s;o+=16383)a.push(u(e,o,o+16383>s?s:o+16383));1===n?(t=e[i-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===n&&(t=(e[i-2]<<8)+e[i-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],n=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s<l;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function h(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function c(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function u(e,t,i){for(var r,n=[],a=t;a<i;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),n.push(c(r));return n.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(e,t){
9
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
10
- t.read=function(e,t,i,r,n){var a,o,s=8*n-r-1,l=(1<<s)-1,h=l>>1,c=-7,u=i?n-1:0,d=i?-1:1,p=e[t+u];for(u+=d,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+e[t+u],u+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+e[t+u],u+=d,c-=8);if(0===a)a=1-h;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),a-=h}return(p?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,i,r,n,a){var o,s,l,h=8*a-n-1,c=(1<<h)-1,u=c>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:a-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=c?(s=0,o=c):o+u>=1?(s=(t*l-1)*Math.pow(2,n),o+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,n),o=0));n>=8;e[i+p]=255&s,p+=f,s/=256,n-=8);for(o=o<<n|s,h+=n;h>0;e[i+p]=255&o,p+=f,o/=256,h-=8);e[i+p-f]|=128*m}},function(e,t){var i={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},function(e,t){
11
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
12
- t.read=function(e,t,i,r,n){var a,o,s=8*n-r-1,l=(1<<s)-1,h=l>>1,c=-7,u=i?n-1:0,d=i?-1:1,p=e[t+u];for(u+=d,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+e[t+u],u+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+e[t+u],u+=d,c-=8);if(0===a)a=1-h;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),a-=h}return(p?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,i,r,n,a){var o,s,l,h=8*a-n-1,c=(1<<h)-1,u=c>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:a-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=c?(s=0,o=c):o+u>=1?(s=(t*l-1)*Math.pow(2,n),o+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,n),o=0));n>=8;e[i+p]=255&s,p+=f,s/=256,n-=8);for(o=o<<n|s,h+=n;h>0;e[i+p]=255&o,p+=f,o/=256,h-=8);e[i+p-f]|=128*m}},function(e,t,i){"use strict";i.r(t);var r={};i.r(r),i.d(r,"createBillboard",function(){return Nh}),i.d(r,"createLabel",function(){return Gh}),i.d(r,"createModelPrimitive",function(){return Fh}),i.d(r,"createObject3DAppearance",function(){return Bh}),i.d(r,"createSpherePrimitive",function(){return qh}),i.d(r,"createCylinderPrimitive",function(){return Uh}),i.d(r,"getShadows",function(){return Wh});var n=i(0),a=1,o=2,s=3,l=4,h=5,c=484813681109536e-20,u=Math.PI/2,d=.16666666666666666,p=.04722222222222222,f=.022156084656084655,m=1e-10,y=.017453292519943295,g=57.29577951308232,v=Math.PI/4,b=2*Math.PI,_=3.14159265359,w={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},x={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},C=/[\s_\-\/\(\)]/g;function S(e,t){if(e[t])return e[t];for(var i,r=Object.keys(e),n=t.toLowerCase().replace(C,""),a=-1;++a<r.length;)if((i=r[a]).toLowerCase().replace(C,"")===n)return e[i]}var M=function(e){var t,i,r,n={},a=e.split("+").map(function(e){return e.trim()}).filter(function(e){return e}).reduce(function(e,t){var i=t.split("=");return i.push(!0),e[i[0].toLowerCase()]=i[1],e},{}),o={proj:"projName",datum:"datumCode",rf:function(e){n.rf=parseFloat(e)},lat_0:function(e){n.lat0=e*y},lat_1:function(e){n.lat1=e*y},lat_2:function(e){n.lat2=e*y},lat_ts:function(e){n.lat_ts=e*y},lon_0:function(e){n.long0=e*y},lon_1:function(e){n.long1=e*y},lon_2:function(e){n.long2=e*y},alpha:function(e){n.alpha=parseFloat(e)*y},gamma:function(e){n.rectified_grid_angle=parseFloat(e)},lonc:function(e){n.longc=e*y},x_0:function(e){n.x0=parseFloat(e)},y_0:function(e){n.y0=parseFloat(e)},k_0:function(e){n.k0=parseFloat(e)},k:function(e){n.k0=parseFloat(e)},a:function(e){n.a=parseFloat(e)},b:function(e){n.b=parseFloat(e)},r_a:function(){n.R_A=!0},zone:function(e){n.zone=parseInt(e,10)},south:function(){n.utmSouth=!0},towgs84:function(e){n.datum_params=e.split(",").map(function(e){return parseFloat(e)})},to_meter:function(e){n.to_meter=parseFloat(e)},units:function(e){n.units=e;var t=S(x,e);t&&(n.to_meter=t.to_meter)},from_greenwich:function(e){n.from_greenwich=e*y},pm:function(e){var t=S(w,e);n.from_greenwich=(t||parseFloat(e))*y},nadgrids:function(e){"@null"===e?n.datumCode="none":n.nadgrids=e},axis:function(e){3===e.length&&-1!=="ewnsud".indexOf(e.substr(0,1))&&-1!=="ewnsud".indexOf(e.substr(1,1))&&-1!=="ewnsud".indexOf(e.substr(2,1))&&(n.axis=e)},approx:function(){n.approx=!0}};for(t in a)i=a[t],t in o?"function"==typeof(r=o[t])?r(i):n[r]=i:n[t]=i;return"string"==typeof n.datumCode&&"WGS84"!==n.datumCode&&(n.datumCode=n.datumCode.toLowerCase()),n},k=function(e){return new j(e).output()},T=1,I=/\s/,O=/[A-Za-z]/,E=/[A-Za-z84_]/,P=/[,\]]/,R=/[\d\.E\-\+]/;function j(e){if("string"!=typeof e)throw new Error("not a string");this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=T}function A(e,t,i){Array.isArray(t)&&(i.unshift(t),t=null);var r=t?{}:e,n=i.reduce(function(e,t){return z(t,e),e},r);t&&(e[t]=n)}function z(e,t){if(Array.isArray(e)){var i=e.shift();if("PARAMETER"===i&&(i=e.shift()),1===e.length)return Array.isArray(e[0])?(t[i]={},void z(e[0],t[i])):void(t[i]=e[0]);if(e.length)if("TOWGS84"!==i){if("AXIS"===i)return i in t||(t[i]=[]),void t[i].push(e);var r;switch(Array.isArray(i)||(t[i]={}),i){case"UNIT":case"PRIMEM":case"VERT_DATUM":return t[i]={name:e[0].toLowerCase(),convert:e[1]},void(3===e.length&&z(e[2],t[i]));case"SPHEROID":case"ELLIPSOID":return t[i]={name:e[0],a:e[1],rf:e[2]},void(4===e.length&&z(e[3],t[i]));case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":return e[0]=["name",e[0]],void A(t,i,e);case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":return e[0]=["name",e[0]],A(t,i,e),void(t[i].type=i);default:for(r=-1;++r<e.length;)if(!Array.isArray(e[r]))return z(e,t[i]);return A(t,i,e)}}else t[i]=e;else t[i]=!0}else t[e]=!0}j.prototype.readCharicter=function(){var e=this.text[this.place++];if(4!==this.state)for(;I.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case T:return this.neutral(e);case 2:return this.keyword(e);case 4:return this.quoted(e);case 5:return this.afterquote(e);case 3:return this.number(e);case-1:return}},j.prototype.afterquote=function(e){if('"'===e)return this.word+='"',void(this.state=4);if(P.test(e))return this.word=this.word.trim(),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in afterquote yet, index '+this.place)},j.prototype.afterItem=function(e){return","===e?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=T)):"]"===e?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=T,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},j.prototype.number=function(e){if(!R.test(e)){if(P.test(e))return this.word=parseFloat(this.word),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in number yet, index '+this.place)}this.word+=e},j.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=5},j.prototype.keyword=function(e){if(E.test(e))this.word+=e;else{if("["===e){var t=[];return t.push(this.word),this.level++,null===this.root?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,void(this.state=T)}if(!P.test(e))throw new Error("havn't handled \""+e+'" in keyword yet, index '+this.place);this.afterItem(e)}},j.prototype.neutral=function(e){if(O.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(R.test(e))return this.word=e,void(this.state=3);if(!P.test(e))throw new Error("havn't handled \""+e+'" in neutral yet, index '+this.place);this.afterItem(e)},j.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};var D=.017453292519943295,V=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function N(e){return e*D}function G(e){if(e.AUTHORITY){var t=Object.keys(e.AUTHORITY)[0];t&&t in e.AUTHORITY&&(e.title=t+":"+e.AUTHORITY[t])}if("GEOGCS"===e.type?e.projName="longlat":"LOCAL_CS"===e.type?(e.projName="identity",e.local=!0):"object"==typeof e.PROJECTION?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var i="",r=0,n=e.AXIS.length;r<n;++r){var a=[e.AXIS[r][0].toLowerCase(),e.AXIS[r][1].toLowerCase()];-1!==a[0].indexOf("north")||("y"===a[0]||"lat"===a[0])&&"north"===a[1]?i+="n":-1!==a[0].indexOf("south")||("y"===a[0]||"lat"===a[0])&&"south"===a[1]?i+="s":-1!==a[0].indexOf("east")||("x"===a[0]||"lon"===a[0])&&"east"===a[1]?i+="e":-1===a[0].indexOf("west")&&("x"!==a[0]&&"lon"!==a[0]||"west"!==a[1])||(i+="w")}2===i.length&&(i+="u"),3===i.length&&(e.axis=i)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),"metre"===e.units&&(e.units="meter"),e.UNIT.convert&&("GEOGCS"===e.type?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var o=e.GEOGCS;function s(t){return t*(e.to_meter||1)}"GEOGCS"===e.type&&(o=e),o&&(o.DATUM?e.datumCode=o.DATUM.name.toLowerCase():e.datumCode=o.name.toLowerCase(),"d_"===e.datumCode.slice(0,2)&&(e.datumCode=e.datumCode.slice(2)),"new_zealand_1949"===e.datumCode&&(e.datumCode="nzgd49"),"wgs_1984"!==e.datumCode&&"world_geodetic_system_1984"!==e.datumCode||("Mercator_Auxiliary_Sphere"===e.PROJECTION&&(e.sphere=!0),e.datumCode="wgs84"),"belge_1972"===e.datumCode&&(e.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(e.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===e.ellps.toLowerCase().slice(0,13)&&(e.ellps="intl"),e.a=o.DATUM.SPHEROID.a,e.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(e.datum_params=o.DATUM.TOWGS84),~e.datumCode.indexOf("osgb_1936")&&(e.datumCode="osgb36"),~e.datumCode.indexOf("osni_1952")&&(e.datumCode="osni52"),(~e.datumCode.indexOf("tm65")||~e.datumCode.indexOf("geodetic_datum_of_1965"))&&(e.datumCode="ire65"),"ch1903+"===e.datumCode&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93")),e.b&&!isFinite(e.b)&&(e.b=e.a);[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",N],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",N],["x0","false_easting",s],["y0","false_northing",s],["long0","central_meridian",N],["lat0","latitude_of_origin",N],["lat0","standard_parallel_1",N],["lat1","standard_parallel_1",N],["lat2","standard_parallel_2",N],["azimuth","Azimuth"],["alpha","azimuth",N],["srsCode","name"]].forEach(function(t){return function(e,t){var i=t[0],r=t[1];!(i in e)&&r in e&&(e[i]=e[r],3===t.length&&(e[i]=t[2](e[i])))}(e,t)}),e.long0||!e.longc||"Albers_Conic_Equal_Area"!==e.projName&&"Lambert_Azimuthal_Equal_Area"!==e.projName||(e.long0=e.longc),e.lat_ts||!e.lat1||"Stereographic_South_Pole"!==e.projName&&"Polar Stereographic (variant B)"!==e.projName?!e.lat_ts&&e.lat0&&"Polar_Stereographic"===e.projName&&(e.lat_ts=e.lat0,e.lat0=N(e.lat0>0?90:-90)):(e.lat0=N(e.lat1>0?90:-90),e.lat_ts=e.lat1)}var F=function(e){var t=k(e),i=t[0],r={};return z(t,r),function e(t){for(var i=Object.keys(t),r=0,n=i.length;r<n;++r){var a=i[r];-1!==V.indexOf(a)&&G(t[a]),"object"==typeof t[a]&&e(t[a])}}(r),r[i]};function B(e){var t=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?B[e]=M(arguments[1]):B[e]=F(arguments[1]):B[e]=i}else if(1===arguments.length){if(Array.isArray(e))return e.map(function(e){Array.isArray(e)?B.apply(t,e):B(e)});if("string"==typeof e){if(e in B)return B[e]}else"EPSG"in e?B["EPSG:"+e.EPSG]=e:"ESRI"in e?B["ESRI:"+e.ESRI]=e:"IAU2000"in e?B["IAU2000:"+e.IAU2000]=e:console.log(e);return}}!function(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("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"),e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}(B);var q=B;var U=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var W=["3857","900913","3785","102113"];var H=function(e){if(!function(e){return"string"==typeof e}(e))return e;if(function(e){return e in q}(e))return q[e];if(function(e){return U.some(function(t){return e.indexOf(t)>-1})}(e)){var t=F(e);if(function(e){var t=S(e,"authority");if(t){var i=S(t,"epsg");return i&&W.indexOf(i)>-1}}(t))return q["EPSG:3857"];var i=function(e){var t=S(e,"extension");if(t)return S(t,"proj4")}(t);return i?M(i):t}return function(e){return"+"===e[0]}(e)?M(e):void 0},Y=function(e,t){var i,r;if(e=e||{},!t)return e;for(r in t)void 0!==(i=t[r])&&(e[r]=i);return e},X=function(e,t,i){var r=e*t;return i/Math.sqrt(1-r*r)},J=function(e){return e<0?-1:1},$=function(e){return Math.abs(e)<=_?e:e-J(e)*b},K=function(e,t,i){var r=e*i,n=.5*e;return r=Math.pow((1-r)/(1+r),n),Math.tan(.5*(u-t))/r},Z=function(e,t){for(var i,r,n=.5*e,a=u-2*Math.atan(t),o=0;o<=15;o++)if(i=e*Math.sin(a),a+=r=u-2*Math.atan(t*Math.pow((1-i)/(1+i),n))-a,Math.abs(r)<=1e-10)return a;return-9999};function Q(e){return e}var ee=[{init:function(){var e=this.b/this.a;this.es=1-e*e,"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=X(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(e){var t,i,r=e.x,n=e.y;if(n*g>90&&n*g<-90&&r*g>180&&r*g<-180)return null;if(Math.abs(Math.abs(n)-u)<=m)return null;if(this.sphere)t=this.x0+this.a*this.k0*$(r-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(v+.5*n));else{var a=Math.sin(n),o=K(this.e,n,a);t=this.x0+this.a*this.k0*$(r-this.long0),i=this.y0-this.a*this.k0*Math.log(o)}return e.x=t,e.y=i,e},inverse:function(e){var t,i,r=e.x-this.x0,n=e.y-this.y0;if(this.sphere)i=u-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var a=Math.exp(-n/(this.a*this.k0));if(-9999===(i=Z(this.e,a)))return null}return t=$(this.long0+r/(this.a*this.k0)),e.x=t,e.y=i,e},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:Q,inverse:Q,names:["longlat","identity"]}],te={},ie=[];function re(e,t){var i=ie.length;return e.names?(ie[i]=e,e.names.forEach(function(e){te[e.toLowerCase()]=i}),this):(console.log(t),!0)}var ne={start:function(){ee.forEach(re)},add:re,get:function(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==te[t]&&ie[te[t]]?ie[te[t]]:void 0}},ae={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"}},oe=ae.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};ae.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var se={};se.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},se.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},se.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},se.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},se.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},se.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},se.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},se.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},se.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},se.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},se.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},se.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},se.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},se.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},se.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},se.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},se.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var le=function(e,t,i,r,n,u,d){var p={};return p.datum_type=void 0===e||"none"===e?h:l,t&&(p.datum_params=t.map(parseFloat),0===p.datum_params[0]&&0===p.datum_params[1]&&0===p.datum_params[2]||(p.datum_type=a),p.datum_params.length>3&&(0===p.datum_params[3]&&0===p.datum_params[4]&&0===p.datum_params[5]&&0===p.datum_params[6]||(p.datum_type=o,p.datum_params[3]*=c,p.datum_params[4]*=c,p.datum_params[5]*=c,p.datum_params[6]=p.datum_params[6]/1e6+1))),d&&(p.datum_type=s,p.grids=d),p.a=i,p.b=r,p.es=n,p.ep2=u,p},he={};function ce(e){if(0===e.length)return null;var t="@"===e[0];return t&&(e=e.slice(1)),"null"===e?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:he[e]||null,isNull:!1}}function ue(e){return e/3600*Math.PI/180}function de(e,t,i){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,i)))}function pe(e){return e.map(function(e){return[ue(e.longitudeShift),ue(e.latitudeShift)]})}function fe(e,t,i){return{name:de(e,t+8,t+16).trim(),parent:de(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,i),upperLatitude:e.getFloat64(t+88,i),lowerLongitude:e.getFloat64(t+104,i),upperLongitude:e.getFloat64(t+120,i),latitudeInterval:e.getFloat64(t+136,i),longitudeInterval:e.getFloat64(t+152,i),gridNodeCount:e.getInt32(t+168,i)}}function me(e,t,i,r){for(var n=t+176,a=[],o=0;o<i.gridNodeCount;o++){var s={latitudeShift:e.getFloat32(n+16*o,r),longitudeShift:e.getFloat32(n+16*o+4,r),latitudeAccuracy:e.getFloat32(n+16*o+8,r),longitudeAccuracy:e.getFloat32(n+16*o+12,r)};a.push(s)}return a}function ye(e,t){if(!(this instanceof ye))return new ye(e);t=t||function(e){if(e)throw e};var i=H(e);if("object"==typeof i){var r=ye.projections.get(i.projName);if(r){if(i.datumCode&&"none"!==i.datumCode){var n=S(se,i.datumCode);n&&(i.datum_params=i.datum_params||(n.towgs84?n.towgs84.split(","):null),i.ellps=n.ellipse,i.datumName=n.datumName?n.datumName:i.datumCode)}i.k0=i.k0||1,i.axis=i.axis||"enu",i.ellps=i.ellps||"wgs84",i.lat1=i.lat1||i.lat0;var a=function(e,t,i,r,n){if(!e){var a=S(ae,r);a||(a=oe),e=a.a,t=a.b,i=a.rf}return i&&!t&&(t=(1-1/i)*e),(0===i||Math.abs(e-t)<m)&&(n=!0,t=e),{a:e,b:t,rf:i,sphere:n}}(i.a,i.b,i.rf,i.ellps,i.sphere),o=function(e,t,i,r){var n=e*e,a=t*t,o=(n-a)/n,s=0;return r?(n=(e*=1-o*(d+o*(p+o*f)))*e,o=0):s=Math.sqrt(o),{es:o,e:s,ep2:(n-a)/a}}(a.a,a.b,a.rf,i.R_A),s=function(e){return void 0===e?null:e.split(",").map(ce)}(i.nadgrids),l=i.datum||le(i.datumCode,i.datum_params,a.a,a.b,o.es,o.ep2,s);Y(this,i),Y(this,r),this.a=a.a,this.b=a.b,this.rf=a.rf,this.sphere=a.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=l,this.init(),t(null,this)}else t(e)}else t(e)}ye.projections=ne,ye.projections.start();var ge=ye;function ve(e,t,i){var r,n,a,o,s=e.x,l=e.y,h=e.z?e.z:0;if(l<-u&&l>-1.001*u)l=-u;else if(l>u&&l<1.001*u)l=u;else{if(l<-u)return{x:-1/0,y:-1/0,z:e.z};if(l>u)return{x:1/0,y:1/0,z:e.z}}return s>Math.PI&&(s-=2*Math.PI),n=Math.sin(l),o=Math.cos(l),a=n*n,{x:((r=i/Math.sqrt(1-t*a))+h)*o*Math.cos(s),y:(r+h)*o*Math.sin(s),z:(r*(1-t)+h)*n}}function be(e,t,i,r){var n,a,o,s,l,h,c,d,p,f,m,y,g,v,b,_=e.x,w=e.y,x=e.z?e.z:0;if(n=Math.sqrt(_*_+w*w),a=Math.sqrt(_*_+w*w+x*x),n/i<1e-12){if(v=0,a/i<1e-12)return u,b=-r,{x:e.x,y:e.y,z:e.z}}else v=Math.atan2(w,_);o=x/a,d=(s=n/a)*(1-t)*(l=1/Math.sqrt(1-t*(2-t)*s*s)),p=o*l,g=0;do{g++,h=t*(c=i/Math.sqrt(1-t*p*p))/(c+(b=n*d+x*p-c*(1-t*p*p))),y=(m=o*(l=1/Math.sqrt(1-h*(2-h)*s*s)))*d-(f=s*(1-h)*l)*p,d=f,p=m}while(y*y>1e-24&&g<30);return{x:v,y:Math.atan(m/Math.abs(f)),z:b}}function _e(e){return e===a||e===o}var we=function(e,t,i){if(function(e,t){return e.datum_type===t.datum_type&&!(e.a!==t.a||Math.abs(e.es-t.es)>5e-11)&&(e.datum_type===a?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type!==o||e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6])}(e,t))return i;if(e.datum_type===h||t.datum_type===h)return i;var r=e.a,n=e.es;if(e.datum_type===s){if(0!==xe(e,!1,i))return;r=6378137,n=.0066943799901413165}var l=t.a,c=t.b,u=t.es;if(t.datum_type===s&&(l=6378137,c=6356752.314,u=.0066943799901413165),n===u&&r===l&&!_e(e.datum_type)&&!_e(t.datum_type))return i;if((i=ve(i,n,r),_e(e.datum_type)&&(i=function(e,t,i){if(t===a)return{x:e.x+i[0],y:e.y+i[1],z:e.z+i[2]};if(t===o){var r=i[0],n=i[1],s=i[2],l=i[3],h=i[4],c=i[5],u=i[6];return{x:u*(e.x-c*e.y+h*e.z)+r,y:u*(c*e.x+e.y-l*e.z)+n,z:u*(-h*e.x+l*e.y+e.z)+s}}}(i,e.datum_type,e.datum_params)),_e(t.datum_type)&&(i=function(e,t,i){if(t===a)return{x:e.x-i[0],y:e.y-i[1],z:e.z-i[2]};if(t===o){var r=i[0],n=i[1],s=i[2],l=i[3],h=i[4],c=i[5],u=i[6],d=(e.x-r)/u,p=(e.y-n)/u,f=(e.z-s)/u;return{x:d+c*p-h*f,y:-c*d+p+l*f,z:h*d-l*p+f}}}(i,t.datum_type,t.datum_params)),i=be(i,u,l,c),t.datum_type===s)&&0!==xe(t,!0,i))return;return i};function xe(e,t,i){if(null===e.grids||0===e.grids.length)return console.log("Grid shift grids not found"),-1;for(var r={x:-i.x,y:i.y},n={x:Number.NaN,y:Number.NaN},a=[],o=0;o<e.grids.length;o++){var s=e.grids[o];if(a.push(s.name),s.isNull){n=r;break}if(s.mandatory,null!==s.grid){var l=s.grid.subgrids[0],h=(Math.abs(l.del[1])+Math.abs(l.del[0]))/1e4,c=l.ll[0]-h,u=l.ll[1]-h,d=l.ll[0]+(l.lim[0]-1)*l.del[0]+h,p=l.ll[1]+(l.lim[1]-1)*l.del[1]+h;if(!(u>r.y||c>r.x||p<r.y||d<r.x||(n=Ce(r,t,l),isNaN(n.x))))break}else if(s.mandatory)return console.log("Unable to find mandatory grid '"+s.name+"'"),-1}return isNaN(n.x)?(console.log("Failed to find a grid shift table for location '"+-r.x*g+" "+r.y*g+" tried: '"+a+"'"),-1):(i.x=-n.x,i.y=n.y,0)}function Ce(e,t,i){var r={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return r;var n={x:e.x,y:e.y};n.x-=i.ll[0],n.y-=i.ll[1],n.x=$(n.x-Math.PI)+Math.PI;var a=Se(n,i);if(t){if(isNaN(a.x))return r;a.x=n.x-a.x,a.y=n.y-a.y;var o,s,l=9;do{if(s=Se(a,i),isNaN(s.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}o={x:n.x-(s.x+a.x),y:n.y-(s.y+a.y)},a.x+=o.x,a.y+=o.y}while(l--&&Math.abs(o.x)>1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=$(a.x+i.ll[0]),r.y=a.y+i.ll[1]}else isNaN(a.x)||(r.x=e.x+a.x,r.y=e.y+a.y);return r}function Se(e,t){var i,r={x:e.x/t.del[0],y:e.y/t.del[1]},n=Math.floor(r.x),a=Math.floor(r.y),o=r.x-1*n,s=r.y-1*a,l={x:Number.NaN,y:Number.NaN};if(n<0||n>=t.lim[0])return l;if(a<0||a>=t.lim[1])return l;i=a*t.lim[0]+n;var h=t.cvs[i][0],c=t.cvs[i][1];i++;var u=t.cvs[i][0],d=t.cvs[i][1];i+=t.lim[0];var p=t.cvs[i][0],f=t.cvs[i][1];i--;var m=t.cvs[i][0],y=t.cvs[i][1],g=o*s,v=o*(1-s),b=(1-o)*(1-s),_=(1-o)*s;return l.x=b*h+v*u+_*m+g*p,l.y=b*c+v*d+_*y+g*f,l}var Me=function(e,t,i){var r,n,a,o=i.x,s=i.y,l=i.z||0,h={};for(a=0;a<3;a++)if(!t||2!==a||void 0!==i.z)switch(0===a?(r=o,n=-1!=="ew".indexOf(e.axis[a])?"x":"y"):1===a?(r=s,n=-1!=="ns".indexOf(e.axis[a])?"y":"x"):(r=l,n="z"),e.axis[a]){case"e":h[n]=r;break;case"w":h[n]=-r;break;case"n":h[n]=r;break;case"s":h[n]=-r;break;case"u":void 0!==i[n]&&(h.z=r);break;case"d":void 0!==i[n]&&(h.z=-r);break;default:return null}return h},ke=function(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t},Te=function(e){Ie(e.x),Ie(e.y)};function Ie(e){if("function"==typeof Number.isFinite){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof e||e!=e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function Oe(e,t,i,r){var n,l=void 0!==(i=Array.isArray(i)?ke(i):{x:i.x,y:i.y,z:i.z,m:i.m}).z;if(Te(i),e.datum&&t.datum&&function(e,t){return(e.datum.datum_type===a||e.datum.datum_type===o||e.datum.datum_type===s)&&"WGS84"!==t.datumCode||(t.datum.datum_type===a||t.datum.datum_type===o||t.datum.datum_type===s)&&"WGS84"!==e.datumCode}(e,t)&&(i=Oe(e,n=new ge("WGS84"),i,r),e=n),r&&"enu"!==e.axis&&(i=Me(e,!1,i)),"longlat"===e.projName)i={x:i.x*y,y:i.y*y,z:i.z||0};else if(e.to_meter&&(i={x:i.x*e.to_meter,y:i.y*e.to_meter,z:i.z||0}),!(i=e.inverse(i)))return;if(e.from_greenwich&&(i.x+=e.from_greenwich),i=we(e.datum,t.datum,i))return t.from_greenwich&&(i={x:i.x-t.from_greenwich,y:i.y,z:i.z||0}),"longlat"===t.projName?i={x:i.x*g,y:i.y*g,z:i.z||0}:(i=t.forward(i),t.to_meter&&(i={x:i.x/t.to_meter,y:i.y/t.to_meter,z:i.z||0})),r&&"enu"!==t.axis?Me(t,!0,i):(l||delete i.z,i)}var Ee=ge("WGS84");function Le(e,t,i,r){var n,a,o;return Array.isArray(i)?(n=Oe(e,t,i,r)||{x:NaN,y:NaN},i.length>2?void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name?"number"==typeof n.z?[n.x,n.y,n.z].concat(i.splice(3)):[n.x,n.y,i[2]].concat(i.splice(3)):[n.x,n.y].concat(i.splice(2)):[n.x,n.y]):(a=Oe(e,t,i,r),2===(o=Object.keys(i)).length?a:(o.forEach(function(r){if(void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name){if("x"===r||"y"===r||"z"===r)return}else if("x"===r||"y"===r)return;a[r]=i[r]}),a))}function Pe(e){return e instanceof ge?e:e.oProj?e.oProj:ge(e)}var Re=function(e,t,i){e=Pe(e);var r,n=!1;return void 0===t?(t=e,e=Ee,n=!0):(void 0!==t.x||Array.isArray(t))&&(i=t,t=e,e=Ee,n=!0),t=Pe(t),i?Le(e,t,i):(r={forward:function(i,r){return Le(e,t,i,r)},inverse:function(i,r){return Le(t,e,i,r)}},n&&(r.oProj=t),r)},je=6,Ae="AJSAJS",ze="AFAFAF",De=65,Ve=73,Ne=79,Ge=86,Fe=90,Be={forward:qe,inverse:function(e){var t=Ye(Je(e.toUpperCase()));if(t.lat&&t.lon)return[t.lon,t.lat,t.lon,t.lat];return[t.left,t.bottom,t.right,t.top]},toPoint:Ue};function qe(e,t){return t=t||5,function(e,t){var i="00000"+e.easting,r="00000"+e.northing;return e.zoneNumber+e.zoneLetter+function(e,t,i){var r=Xe(i),n=Math.floor(e/1e5),a=Math.floor(t/1e5)%20;return function(e,t,i){var r=i-1,n=Ae.charCodeAt(r),a=ze.charCodeAt(r),o=n+e-1,s=a+t,l=!1;o>Fe&&(o=o-Fe+De-1,l=!0);(o===Ve||n<Ve&&o>Ve||(o>Ve||n<Ve)&&l)&&o++;(o===Ne||n<Ne&&o>Ne||(o>Ne||n<Ne)&&l)&&++o===Ve&&o++;o>Fe&&(o=o-Fe+De-1);s>Ge?(s=s-Ge+De-1,l=!0):l=!1;(s===Ve||a<Ve&&s>Ve||(s>Ve||a<Ve)&&l)&&s++;(s===Ne||a<Ne&&s>Ne||(s>Ne||a<Ne)&&l)&&++s===Ve&&s++;s>Ge&&(s=s-Ge+De-1);return String.fromCharCode(o)+String.fromCharCode(s)}(n,a,r)}(e.easting,e.northing,e.zoneNumber)+i.substr(i.length-5,t)+r.substr(r.length-5,t)}(function(e){var t,i,r,n,a,o,s,l=e.lat,h=e.lon,c=6378137,u=We(l),d=We(h);s=Math.floor((h+180)/6)+1,180===h&&(s=60);l>=56&&l<64&&h>=3&&h<12&&(s=32);l>=72&&l<84&&(h>=0&&h<9?s=31:h>=9&&h<21?s=33:h>=21&&h<33?s=35:h>=33&&h<42&&(s=37));o=We(6*(s-1)-180+3),.006739496752268451,t=c/Math.sqrt(1-.00669438*Math.sin(u)*Math.sin(u)),i=Math.tan(u)*Math.tan(u),r=.006739496752268451*Math.cos(u)*Math.cos(u),n=Math.cos(u)*(d-o),a=c*(.9983242984503243*u-.002514607064228144*Math.sin(2*u)+2639046602129982e-21*Math.sin(4*u)-3.418046101696858e-9*Math.sin(6*u));var p=.9996*t*(n+(1-i+r)*n*n*n/6+(5-18*i+i*i+72*r-.39089081163157013)*n*n*n*n*n/120)+5e5,f=.9996*(a+t*Math.tan(u)*(n*n/2+(5-i+9*r+4*r*r)*n*n*n*n/24+(61-58*i+i*i+600*r-2.2240339282485886)*n*n*n*n*n*n/720));l<0&&(f+=1e7);return{northing:Math.round(f),easting:Math.round(p),zoneNumber:s,zoneLetter:function(e){var t="Z";84>=e&&e>=72?t="X":72>e&&e>=64?t="W":64>e&&e>=56?t="V":56>e&&e>=48?t="U":48>e&&e>=40?t="T":40>e&&e>=32?t="S":32>e&&e>=24?t="R":24>e&&e>=16?t="Q":16>e&&e>=8?t="P":8>e&&e>=0?t="N":0>e&&e>=-8?t="M":-8>e&&e>=-16?t="L":-16>e&&e>=-24?t="K":-24>e&&e>=-32?t="J":-32>e&&e>=-40?t="H":-40>e&&e>=-48?t="G":-48>e&&e>=-56?t="F":-56>e&&e>=-64?t="E":-64>e&&e>=-72?t="D":-72>e&&e>=-80&&(t="C");return t}(l)}}({lat:e[1],lon:e[0]}),t)}function Ue(e){var t=Ye(Je(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function We(e){return e*(Math.PI/180)}function He(e){return e/Math.PI*180}function Ye(e){var t=e.northing,i=e.easting,r=e.zoneLetter,n=e.zoneNumber;if(n<0||n>60)return null;var a,o,s,l,h,c,u,d,p=6378137,f=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),m=i-5e5,y=t;r<"N"&&(y-=1e7),c=6*(n-1)-180+3,d=(u=y/.9996/6367449.145945056)+(3*f/2-27*f*f*f/32)*Math.sin(2*u)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*u)+151*f*f*f/96*Math.sin(6*u),a=p/Math.sqrt(1-.00669438*Math.sin(d)*Math.sin(d)),o=Math.tan(d)*Math.tan(d),s=.006739496752268451*Math.cos(d)*Math.cos(d),l=.99330562*p/Math.pow(1-.00669438*Math.sin(d)*Math.sin(d),1.5),h=m/(.9996*a);var g=d-a*Math.tan(d)/l*(h*h/2-(5+3*o+10*s-4*s*s-.06065547077041606)*h*h*h*h/24+(61+90*o+298*s+45*o*o-1.6983531815716497-3*s*s)*h*h*h*h*h*h/720);g=He(g);var v,b=(h-(1+2*o+s)*h*h*h/6+(5-2*s+28*o-3*s*s+.05391597401814761+24*o*o)*h*h*h*h*h/120)/Math.cos(d);if(b=c+He(b),e.accuracy){var _=Ye({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});v={top:_.lat,right:_.lon,bottom:g,left:b}}else v={lat:g,lon:b};return v}function Xe(e){var t=e%je;return 0===t&&(t=je),t}function Je(e){if(e&&0===e.length)throw"MGRSPoint coverting from nothing";for(var t,i=e.length,r=null,n="",a=0;!/[A-Z]/.test(t=e.charAt(a));){if(a>=2)throw"MGRSPoint bad conversion from: "+e;n+=t,a++}var o=parseInt(n,10);if(0===a||a+3>i)throw"MGRSPoint bad conversion from: "+e;var s=e.charAt(a++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+e;r=e.substring(a,a+=2);for(var l=Xe(o),h=function(e,t){var i=Ae.charCodeAt(t-1),r=1e5,n=!1;for(;i!==e.charCodeAt(0);){if(++i===Ve&&i++,i===Ne&&i++,i>Fe){if(n)throw"Bad character: "+e;i=De,n=!0}r+=1e5}return r}(r.charAt(0),l),c=function(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;var i=ze.charCodeAt(t-1),r=0,n=!1;for(;i!==e.charCodeAt(0);){if(++i===Ve&&i++,i===Ne&&i++,i>Ge){if(n)throw"Bad character: "+e;i=De,n=!0}r+=1e5}return r}(r.charAt(1),l);c<$e(s);)c+=2e6;var u=i-a;if(u%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+e;var d,p,f,m=u/2,y=0,g=0;return m>0&&(d=1e5/Math.pow(10,m),p=e.substring(a,a+m),y=parseFloat(p)*d,f=e.substring(a+m),g=parseFloat(f)*d),{easting:y+h,northing:g+c,zoneLetter:s,zoneNumber:o,accuracy:d}}function $e(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function Ke(e,t,i){if(!(this instanceof Ke))return new Ke(e,t,i);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if("object"==typeof e)this.x=e.x,this.y=e.y,this.z=e.z||0;else if("string"==typeof e&&void 0===t){var r=e.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=e,this.y=t,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Ke.fromMGRS=function(e){return new Ke(Ue(e))},Ke.prototype.toMGRS=function(e){return qe([this.x,this.y],e)};var Ze=Ke,Qe=.01068115234375,et=function(e){var t=[];t[0]=1-e*(.25+e*(.046875+e*(.01953125+e*Qe))),t[1]=e*(.75-e*(.046875+e*(.01953125+e*Qe)));var i=e*e;return t[2]=i*(.46875-e*(.013020833333333334+.007120768229166667*e)),i*=e,t[3]=i*(.3645833333333333-.005696614583333333*e),t[4]=i*e*.3076171875,t},tt=function(e,t,i,r){return i*=t,t*=t,r[0]*e-i*(r[1]+t*(r[2]+t*(r[3]+t*r[4])))},it=function(e,t,i){for(var r=1/(1-t),n=e,a=20;a;--a){var o=Math.sin(n),s=1-t*o*o;if(n-=s=(tt(n,o,Math.cos(n),i)-e)*(s*Math.sqrt(s))*r,Math.abs(s)<m)return n}return n};var rt={init:function(){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.es&&(this.en=et(this.es),this.ml0=tt(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(e){var t,i,r,n=e.x,a=e.y,o=$(n-this.long0),s=Math.sin(a),l=Math.cos(a);if(this.es){var h=l*o,c=Math.pow(h,2),u=this.ep2*Math.pow(l,2),d=Math.pow(u,2),p=Math.abs(l)>m?Math.tan(a):0,f=Math.pow(p,2),y=Math.pow(f,2);t=1-this.es*Math.pow(s,2),h/=Math.sqrt(t);var g=tt(a,s,l,this.en);i=this.a*(this.k0*h*(1+c/6*(1-f+u+c/20*(5-18*f+y+14*u-58*f*u+c/42*(61+179*y-y*f-479*f)))))+this.x0,r=this.a*(this.k0*(g-this.ml0+s*o*h/2*(1+c/12*(5-f+9*u+4*d+c/30*(61+y-58*f+270*u-330*f*u+c/56*(1385+543*y-y*f-3111*f))))))+this.y0}else{var v=l*Math.sin(o);if(Math.abs(Math.abs(v)-1)<m)return 93;if(i=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,r=l*Math.cos(o)/Math.sqrt(1-Math.pow(v,2)),(v=Math.abs(r))>=1){if(v-1>m)return 93;r=0}else r=Math.acos(r);a<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return e.x=i,e.y=r,e},inverse:function(e){var t,i,r,n,a=(e.x-this.x0)*(1/this.a),o=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+o/this.k0,i=it(t,this.es,this.en),Math.abs(i)<u){var s=Math.sin(i),l=Math.cos(i),h=Math.abs(l)>m?Math.tan(i):0,c=this.ep2*Math.pow(l,2),d=Math.pow(c,2),p=Math.pow(h,2),f=Math.pow(p,2);t=1-this.es*Math.pow(s,2);var y=a*Math.sqrt(t)/this.k0,g=Math.pow(y,2);r=i-(t*=h)*g/(1-this.es)*.5*(1-g/12*(5+3*p-9*c*p+c-4*d-g/30*(61+90*p-252*c*p+45*f+46*c-g/56*(1385+3633*p+4095*f+1574*f*p)))),n=$(this.long0+y*(1-g/6*(1+2*p+c-g/20*(5+28*p+24*f+8*c*p+6*c-g/42*(61+662*p+1320*f+720*f*p))))/l)}else r=u*J(o),n=0;else{var v=Math.exp(a/this.k0),b=.5*(v-1/v),_=this.lat0+o/this.k0,w=Math.cos(_);t=Math.sqrt((1-Math.pow(w,2))/(1+Math.pow(b,2))),r=Math.asin(t),o<0&&(r=-r),n=0===b&&0===w?0:$(Math.atan2(b,w)+this.long0)}return e.x=n,e.y=r,e},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},nt=function(e){var t=Math.exp(e);return t=(t-1/t)/2},at=function(e,t){e=Math.abs(e),t=Math.abs(t);var i=Math.max(e,t),r=Math.min(e,t)/(i||1);return i*Math.sqrt(1+Math.pow(r,2))},ot=function(e){var t=Math.abs(e);return t=function(e){var t=1+e,i=t-1;return 0===i?e:e*Math.log(t)/i}(t*(1+t/(at(1,t)+1))),e<0?-t:t},st=function(e,t){for(var i,r=2*Math.cos(2*t),n=e.length-1,a=e[n],o=0;--n>=0;)i=r*a-o+e[n],o=a,a=i;return t+i*Math.sin(2*t)},lt=function(e,t){for(var i,r=2*Math.cos(t),n=e.length-1,a=e[n],o=0;--n>=0;)i=r*a-o+e[n],o=a,a=i;return Math.sin(t)*i},ht=function(e,t,i){for(var r,n,a=Math.sin(t),o=Math.cos(t),s=nt(i),l=function(e){var t=Math.exp(e);return t=(t+1/t)/2}(i),h=2*o*l,c=-2*a*s,u=e.length-1,d=e[u],p=0,f=0,m=0;--u>=0;)r=f,n=p,d=h*(f=d)-r-c*(p=m)+e[u],m=c*f-n+h*p;return[(h=a*l)*d-(c=o*s)*m,h*m+c*d]};var ct={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&&(rt.init.apply(this),this.forward=rt.forward,this.inverse=rt.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 e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),i=t;this.cgb[0]=t*(2+t*(-2/3+t*(t*(116/45+t*(26/45+t*(-2854/675)))-2))),this.cbg[0]=t*(t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))-2),i*=t,this.cgb[1]=i*(7/3+t*(t*(-227/45+t*(2704/315+t*(2323/945)))-1.6)),this.cbg[1]=i*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),i*=t,this.cgb[2]=i*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=i*(-26/15+t*(34/21+t*(1.6+t*(-12686/2835)))),i*=t,this.cgb[3]=i*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=i*(1237/630+t*(t*(-24832/14175)-2.4)),i*=t,this.cgb[4]=i*(4174/315+t*(-144838/6237)),this.cbg[4]=i*(-734/315+t*(109598/31185)),i*=t,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+i*(.25+i*(1/64+i/256))),this.utg[0]=t*(t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))-.5),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=i*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=i*(13/48+t*(t*(557/1440+t*(281/630+t*(-1983433/1935360)))-.6)),i*=t,this.utg[2]=i*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=i*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),i*=t,this.utg[3]=i*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=i*(49561/161280+t*(-179/168+t*(6601661/7257600))),i*=t,this.utg[4]=i*(-4583/161280+t*(108847/3991680)),this.gtu[4]=i*(34729/80640+t*(-3418889/1995840)),i*=t,this.utg[5]=-.03233083094085698*i,this.gtu[5]=.6650675310896665*i;var r=st(this.cbg,this.lat0);this.Zb=-this.Qn*(r+lt(this.gtu,2*r))},forward:function(e){var t=$(e.x-this.long0),i=e.y;i=st(this.cbg,i);var r=Math.sin(i),n=Math.cos(i),a=Math.sin(t),o=Math.cos(t);i=Math.atan2(r,o*n),t=Math.atan2(a*n,at(r,n*o)),t=ot(Math.tan(t));var s,l,h=ht(this.gtu,2*i,2*t);return i+=h[0],t+=h[1],Math.abs(t)<=2.623395162778?(s=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*i+this.Zb)+this.y0):(s=1/0,l=1/0),e.x=s,e.y=l,e},inverse:function(e){var t,i,r=(e.x-this.x0)*(1/this.a),n=(e.y-this.y0)*(1/this.a);if(n=(n-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var a=ht(this.utg,2*n,2*r);n+=a[0],r+=a[1],r=Math.atan(nt(r));var o=Math.sin(n),s=Math.cos(n),l=Math.sin(r),h=Math.cos(r);n=Math.atan2(o*h,at(l,h*s)),r=Math.atan2(l,h*s),t=$(r+this.long0),i=st(this.cgb,n)}else t=1/0,i=1/0;return e.x=t,e.y=i,e},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},ut=function(e,t){if(void 0===e){if((e=Math.floor(30*($(t)+Math.PI)/Math.PI)+1)<0)return 0;if(e>60)return 60}return e};var dt={init:function(){var e=ut(this.zone,this.long0);if(void 0===e)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*y,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,ct.init.apply(this),this.forward=ct.forward,this.inverse=ct.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},pt=function(e,t){return Math.pow((1-e)/(1+e),t)},ft=20;var mt={init:function(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+v)/(Math.pow(Math.tan(.5*this.lat0+v),this.C)*pt(this.e*e,this.ratexp))},forward:function(e){var t=e.x,i=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+v),this.C)*pt(this.e*Math.sin(i),this.ratexp))-u,e.x=this.C*t,e},inverse:function(e){for(var t=e.x/this.C,i=e.y,r=Math.pow(Math.tan(.5*i+v)/this.K,1/this.C),n=ft;n>0&&(i=2*Math.atan(r*pt(this.e*Math.sin(e.y),-.5*this.e))-u,!(Math.abs(i-e.y)<1e-14));--n)e.y=i;return n?(e.x=t,e.y=i,e):null},names:["gauss"]};var yt={init:function(){mt.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(e){var t,i,r,n;return e.x=$(e.x-this.long0),mt.forward.apply(this,[e]),t=Math.sin(e.y),i=Math.cos(e.y),r=Math.cos(e.x),n=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*i*r),e.x=n*i*Math.sin(e.x),e.y=n*(this.cosc0*t-this.sinc0*i*r),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){var t,i,r,n,a;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,a=Math.sqrt(e.x*e.x+e.y*e.y)){var o=2*Math.atan2(a,this.R2);t=Math.sin(o),i=Math.cos(o),n=Math.asin(i*this.sinc0+e.y*t*this.cosc0/a),r=Math.atan2(e.x*t,a*this.cosc0*i-e.y*this.sinc0*t)}else n=this.phic0,r=0;return e.x=r,e.y=n,mt.inverse.apply(this,[e]),e.x=$(e.x+this.long0),e},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var gt={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=m&&(this.k0=.5*(1+J(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=m&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=m&&(this.k0=.5*this.cons*X(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/K(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=X(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-u,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(e){var t,i,r,n,a,o,s=e.x,l=e.y,h=Math.sin(l),c=Math.cos(l),d=$(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=m&&Math.abs(l+this.lat0)<=m?(e.x=NaN,e.y=NaN,e):this.sphere?(t=2*this.k0/(1+this.sinlat0*h+this.coslat0*c*Math.cos(d)),e.x=this.a*t*c*Math.sin(d)+this.x0,e.y=this.a*t*(this.coslat0*h-this.sinlat0*c*Math.cos(d))+this.y0,e):(i=2*Math.atan(this.ssfn_(l,h,this.e))-u,n=Math.cos(i),r=Math.sin(i),Math.abs(this.coslat0)<=m?(a=K(this.e,l*this.con,this.con*h),o=2*this.a*this.k0*a/this.cons,e.x=this.x0+o*Math.sin(s-this.long0),e.y=this.y0-this.con*o*Math.cos(s-this.long0),e):(Math.abs(this.sinlat0)<m?(t=2*this.a*this.k0/(1+n*Math.cos(d)),e.y=t*r):(t=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*n*Math.cos(d))),e.y=t*(this.cosX0*r-this.sinX0*n*Math.cos(d))+this.y0),e.x=t*n*Math.sin(d)+this.x0,e))},inverse:function(e){var t,i,r,n,a;e.x-=this.x0,e.y-=this.y0;var o=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var s=2*Math.atan(o/(2*this.a*this.k0));return t=this.long0,i=this.lat0,o<=m?(e.x=t,e.y=i,e):(i=Math.asin(Math.cos(s)*this.sinlat0+e.y*Math.sin(s)*this.coslat0/o),t=Math.abs(this.coslat0)<m?this.lat0>0?$(this.long0+Math.atan2(e.x,-1*e.y)):$(this.long0+Math.atan2(e.x,e.y)):$(this.long0+Math.atan2(e.x*Math.sin(s),o*this.coslat0*Math.cos(s)-e.y*this.sinlat0*Math.sin(s))),e.x=t,e.y=i,e)}if(Math.abs(this.coslat0)<=m){if(o<=m)return i=this.lat0,t=this.long0,e.x=t,e.y=i,e;e.x*=this.con,e.y*=this.con,r=o*this.cons/(2*this.a*this.k0),i=this.con*Z(this.e,r),t=this.con*$(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else n=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=m?a=this.X0:(a=Math.asin(Math.cos(n)*this.sinX0+e.y*Math.sin(n)*this.cosX0/o),t=$(this.long0+Math.atan2(e.x*Math.sin(n),o*this.cosX0*Math.cos(n)-e.y*this.sinX0*Math.sin(n)))),i=-1*Z(this.e,Math.tan(.5*(u+a)));return e.x=t,e.y=i,e},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(e,t,i){return t*=i,Math.tan(.5*(u+e))*Math.pow((1-t)/(1+t),.5*i)}};var vt={init:function(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),i=this.a,r=1/this.rf,n=2*r-Math.pow(r,2),a=this.e=Math.sqrt(n);this.R=this.k0*i*Math.sqrt(1-n)/(1-n*Math.pow(t,2)),this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+e/2)),l=Math.log((1+a*t)/(1-a*t));this.K=o-this.alpha*s+this.alpha*a/2*l},forward:function(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),r=-this.alpha*(t+i)+this.K,n=2*(Math.atan(Math.exp(r))-Math.PI/4),a=this.alpha*(e.x-this.lambda0),o=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(n)+Math.cos(this.b0)*Math.cos(a))),s=Math.asin(Math.cos(this.b0)*Math.sin(n)-Math.sin(this.b0)*Math.cos(n)*Math.cos(a));return e.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,e.x=this.R*o+this.x0,e},inverse:function(e){for(var t=e.x-this.x0,i=e.y-this.y0,r=t/this.R,n=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(n)+Math.sin(this.b0)*Math.cos(n)*Math.cos(r)),o=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(n))),s=this.lambda0+o/this.alpha,l=0,h=a,c=-1e3,u=0;Math.abs(h-c)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(h))/2)),c=h,h=2*Math.atan(Math.exp(l))-Math.PI/2}return e.x=s,e.y=h,e},names:["somerc"]},bt=1e-7;var _t={init:function(){var e,t,i,r,n,a,o,s,l,h,c,d=0,p=0,f=0,g=0,_=0,w=0,x=0;this.no_off=function(e){var t="object"==typeof e.PROJECTION?Object.keys(e.PROJECTION)[0]:e.PROJECTION;return"no_uoff"in e||"no_off"in e||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(t)}(this),this.no_rot="no_rot"in this;var C=!1;"alpha"in this&&(C=!0);var S=!1;if("rectified_grid_angle"in this&&(S=!0),C&&(x=this.alpha),S&&(d=this.rectified_grid_angle*y),C||S)p=this.longc;else if(f=this.long1,_=this.lat1,g=this.long2,w=this.lat2,Math.abs(_-w)<=bt||(e=Math.abs(_))<=bt||Math.abs(e-u)<=bt||Math.abs(Math.abs(this.lat0)-u)<=bt||Math.abs(Math.abs(w)-u)<=bt)throw new Error;var M=1-this.es;t=Math.sqrt(M),Math.abs(this.lat0)>m?(s=Math.sin(this.lat0),i=Math.cos(this.lat0),e=1-this.es*s*s,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/M),this.A=this.B*this.k0*t/e,(n=(r=this.B*t/(i*Math.sqrt(e)))*r-1)<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=r,this.E*=Math.pow(K(this.e,this.lat0,s),this.B)):(this.B=1/t,this.A=this.k0,this.E=r=n=1),C||S?(C?(c=Math.asin(Math.sin(x)/r),S||(d=x)):(c=d,x=Math.asin(r*Math.sin(c))),this.lam0=p-Math.asin(.5*(n-1/n)*Math.tan(c))/this.B):(a=Math.pow(K(this.e,_,Math.sin(_)),this.B),o=Math.pow(K(this.e,w,Math.sin(w)),this.B),n=this.E/a,l=(o-a)/(o+a),h=((h=this.E*this.E)-o*a)/(h+o*a),(e=f-g)<-Math.pi?g-=b:e>Math.pi&&(g+=b),this.lam0=$(.5*(f+g)-Math.atan(h*Math.tan(.5*this.B*(f-g))/l)/this.B),c=Math.atan(2*Math.sin(this.B*$(f-this.lam0))/(n-1/n)),d=x=Math.asin(r*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(d),this.cosrot=Math.cos(d),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(x))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(v-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(v+n))},forward:function(e){var t,i,r,n,a,o,s,l,h={};if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-u)>m){if(t=.5*((a=this.E/Math.pow(K(this.e,e.y,Math.sin(e.y)),this.B))-(o=1/a)),i=.5*(a+o),n=Math.sin(this.B*e.x),r=(t*this.singam-n*this.cosgam)/i,Math.abs(Math.abs(r)-1)<m)throw new Error;l=.5*this.ArB*Math.log((1-r)/(1+r)),o=Math.cos(this.B*e.x),s=Math.abs(o)<bt?this.A*e.x:this.ArB*Math.atan2(t*this.cosgam+n*this.singam,o)}else l=e.y>0?this.v_pole_n:this.v_pole_s,s=this.ArB*e.y;return this.no_rot?(h.x=s,h.y=l):(s-=this.u_0,h.x=l*this.cosrot+s*this.sinrot,h.y=s*this.cosrot-l*this.sinrot),h.x=this.a*h.x+this.x0,h.y=this.a*h.y+this.y0,h},inverse:function(e){var t,i,r,n,a,o,s,l={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(i=e.y,t=e.x):(i=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),n=.5*((r=Math.exp(-this.BrA*i))-1/r),a=.5*(r+1/r),s=((o=Math.sin(this.BrA*t))*this.cosgam+n*this.singam)/a,Math.abs(Math.abs(s)-1)<m)l.x=0,l.y=s<0?-u:u;else{if(l.y=this.E/Math.sqrt((1+s)/(1-s)),l.y=Z(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(n*this.cosgam-o*this.singam,Math.cos(this.BrA*t))}return l.x+=this.lam0,l},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]};var wt={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<m)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),i=Math.cos(this.lat1),r=X(this.e,t,i),n=K(this.e,this.lat1,t),a=Math.sin(this.lat2),o=Math.cos(this.lat2),s=X(this.e,a,o),l=K(this.e,this.lat2,a),h=K(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>m?this.ns=Math.log(r/s)/Math.log(n/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=r/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(e){var t=e.x,i=e.y;Math.abs(2*Math.abs(i)-Math.PI)<=m&&(i=J(i)*(u-2*m));var r,n,a=Math.abs(Math.abs(i)-u);if(a>m)r=K(this.e,i,Math.sin(i)),n=this.a*this.f0*Math.pow(r,this.ns);else{if((a=i*this.ns)<=0)return null;n=0}var o=this.ns*$(t-this.long0);return e.x=this.k0*(n*Math.sin(o))+this.x0,e.y=this.k0*(this.rh-n*Math.cos(o))+this.y0,e},inverse:function(e){var t,i,r,n,a,o=(e.x-this.x0)/this.k0,s=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+s*s),i=1):(t=-Math.sqrt(o*o+s*s),i=-1);var l=0;if(0!==t&&(l=Math.atan2(i*o,i*s)),0!==t||this.ns>0){if(i=1/this.ns,r=Math.pow(t/(this.a*this.f0),i),-9999===(n=Z(this.e,r)))return null}else n=-u;return a=$(l/this.ns+this.long0),e.x=a,e.y=n,e},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 xt={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(e){var t,i,r,n,a,o,s,l=e.x,h=e.y,c=$(l-this.long0);return t=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/t)-this.s45),r=-c*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(r)),a=Math.asin(Math.cos(i)*Math.sin(r)/Math.cos(n)),o=this.n*a,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),e.y=s*Math.cos(o)/1,e.x=s*Math.sin(o)/1,this.czech||(e.y*=-1,e.x*=-1),e},inverse:function(e){var t,i,r,n,a,o,s,l=e.x;e.x=e.y,e.y=l,this.czech||(e.y*=-1,e.x*=-1),a=Math.sqrt(e.x*e.x+e.y*e.y),n=Math.atan2(e.y,e.x)/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),i=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(t)),e.x=this.long0-i/this.alfa,o=t,s=0;var h=0;do{e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-e.y)<1e-10&&(s=1),o=e.y,h+=1}while(0===s&&h<15);return h>=15?null:e},names:["Krovak","krovak"]},Ct=function(e,t,i,r,n){return e*n-t*Math.sin(2*n)+i*Math.sin(4*n)-r*Math.sin(6*n)},St=function(e){return 1-.25*e*(1+e/16*(3+1.25*e))},Mt=function(e){return.375*e*(1+.25*e*(1+.46875*e))},kt=function(e){return.05859375*e*e*(1+.75*e)},Tt=function(e){return e*e*e*(35/3072)},It=function(e,t,i){var r=t*i;return e/Math.sqrt(1-r*r)},Ot=function(e){return Math.abs(e)<u?e:e-J(e)*Math.PI},Et=function(e,t,i,r,n){var a,o;a=e/t;for(var s=0;s<15;s++)if(a+=o=(e-(t*a-i*Math.sin(2*a)+r*Math.sin(4*a)-n*Math.sin(6*a)))/(t-2*i*Math.cos(2*a)+4*r*Math.cos(4*a)-6*n*Math.cos(6*a)),Math.abs(o)<=1e-10)return a;return NaN};var Lt={init:function(){this.sphere||(this.e0=St(this.es),this.e1=Mt(this.es),this.e2=kt(this.es),this.e3=Tt(this.es),this.ml0=this.a*Ct(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(e){var t,i,r=e.x,n=e.y;if(r=$(r-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(n)*Math.sin(r)),i=this.a*(Math.atan2(Math.tan(n),Math.cos(r))-this.lat0);else{var a=Math.sin(n),o=Math.cos(n),s=It(this.a,this.e,a),l=Math.tan(n)*Math.tan(n),h=r*Math.cos(n),c=h*h,u=this.es*o*o/(1-this.es);t=s*h*(1-c*l*(1/6-(8-l+8*u)*c/120)),i=this.a*Ct(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+s*a/o*c*(.5+(5-l+6*u)*c/24)}return e.x=t+this.x0,e.y=i+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,i,r=e.x/this.a,n=e.y/this.a;if(this.sphere){var a=n+this.lat0;t=Math.asin(Math.sin(a)*Math.cos(r)),i=Math.atan2(Math.tan(r),Math.cos(a))}else{var o=this.ml0/this.a+n,s=Et(o,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(s)-u)<=m)return e.x=this.long0,e.y=u,n<0&&(e.y*=-1),e;var l=It(this.a,this.e,Math.sin(s)),h=l*l*l/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(s),2),d=r*this.a/l,p=d*d;t=s-l*Math.tan(s)/h*d*d*(.5-(1+3*c)*d*d/24),i=d*(1-p*(c/3+(1+3*c)*c*p/15))/Math.cos(s)}return e.x=$(i+this.long0),e.y=Ot(t),e},names:["Cassini","Cassini_Soldner","cass"]},Pt=function(e,t){var i;return e>1e-7?(1-e*e)*(t/(1-(i=e*t)*i)-.5/e*Math.log((1-i)/(1+i))):2*t};var Rt=.3333333333333333,jt=.17222222222222222,At=.10257936507936508,zt=.06388888888888888,Dt=.0664021164021164,Vt=.016415012942191543;var Nt={init:function(){var e,t=Math.abs(this.lat0);if(Math.abs(t-u)<m?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<m?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=Pt(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(e){var t,i=[];return i[0]=e*Rt,t=e*e,i[0]+=t*jt,i[1]=t*zt,t*=e,i[0]+=t*At,i[1]+=t*Dt,i[2]=t*Vt,i}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=Pt(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*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(e){var t,i,r,n,a,o,s,l,h,c,d=e.x,p=e.y;if(d=$(d-this.long0),this.sphere){if(a=Math.sin(p),c=Math.cos(p),r=Math.cos(d),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+c*r:1+this.sinph0*a+this.cosph0*c*r)<=m)return null;t=(i=Math.sqrt(2/i))*c*Math.sin(d),i*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*c*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(p+this.lat0)<m)return null;i=v-.5*p,t=(i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)))*Math.sin(d),i*=r}}else{switch(s=0,l=0,h=0,r=Math.cos(d),n=Math.sin(d),a=Math.sin(p),o=Pt(this.e,a),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(s=o/this.qp,l=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:h=1+this.sinb1*s+this.cosb1*l*r;break;case this.EQUIT:h=1+l*r;break;case this.N_POLE:h=u+p,o=this.qp-o;break;case this.S_POLE:h=p-u,o=this.qp+o}if(Math.abs(h)<m)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:h=Math.sqrt(2/h),i=this.mode===this.OBLIQ?this.ymf*h*(this.cosb1*s-this.sinb1*l*r):(h=Math.sqrt(2/(1+l*r)))*s*this.ymf,t=this.xmf*h*l*n;break;case this.N_POLE:case this.S_POLE:o>=0?(t=(h=Math.sqrt(o))*n,i=r*(this.mode===this.S_POLE?h:-h)):t=i=0}}return e.x=this.a*t+this.x0,e.y=this.a*i+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,i,r,n,a,o,s,l=e.x/this.a,h=e.y/this.a;if(this.sphere){var c,d=0,p=0;if((i=.5*(c=Math.sqrt(l*l+h*h)))>1)return null;switch(i=2*Math.asin(i),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(p=Math.sin(i),d=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(c)<=m?0:Math.asin(h*p/c),l*=p,h=d*c;break;case this.OBLIQ:i=Math.abs(c)<=m?this.lat0:Math.asin(d*this.sinph0+h*p*this.cosph0/c),l*=p*this.cosph0,h=(d-Math.sin(i)*this.sinph0)*c;break;case this.N_POLE:h=-h,i=u-i;break;case this.S_POLE:i-=u}t=0!==h||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(l,h):0}else{if(s=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(l/=this.dd,h*=this.dd,(o=Math.sqrt(l*l+h*h))<m)return e.x=this.long0,e.y=this.lat0,e;n=2*Math.asin(.5*o/this.rq),r=Math.cos(n),l*=n=Math.sin(n),this.mode===this.OBLIQ?(s=r*this.sinb1+h*n*this.cosb1/o,a=this.qp*s,h=o*this.cosb1*r-h*this.sinb1*n):(s=h*n/o,a=this.qp*s,h=o*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(h=-h),!(a=l*l+h*h))return e.x=this.long0,e.y=this.lat0,e;s=1-a/this.qp,this.mode===this.S_POLE&&(s=-s)}t=Math.atan2(l,h),i=function(e,t){var i=e+e;return e+t[0]*Math.sin(i)+t[1]*Math.sin(i+i)+t[2]*Math.sin(i+i+i)}(Math.asin(s),this.apa)}return e.x=$(this.long0+t),e.y=i,e},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},Gt=function(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)};var Ft={init:function(){Math.abs(this.lat1+this.lat2)<m||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=X(this.e3,this.sin_po,this.cos_po),this.qs1=Pt(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=X(this.e3,this.sin_po,this.cos_po),this.qs2=Pt(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Pt(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>m?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(e){var t=e.x,i=e.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var r=Pt(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,a=this.ns0*$(t-this.long0),o=n*Math.sin(a)+this.x0,s=this.rh-n*Math.cos(a)+this.y0;return e.x=o,e.y=s,e},inverse:function(e){var t,i,r,n,a,o;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),r=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),r=-1),n=0,0!==t&&(n=Math.atan2(r*e.x,r*e.y)),r=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-r*r)/(2*this.ns0)):(i=(this.c-r*r)/this.ns0,o=this.phi1z(this.e3,i)),a=$(n/this.ns0+this.long0),e.x=a,e.y=o,e},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(e,t){var i,r,n,a,o,s=Gt(.5*t);if(e<m)return s;for(var l=e*e,h=1;h<=25;h++)if(i=Math.sin(s),r=Math.cos(s),s+=o=.5*(a=1-(n=e*i)*n)*a/r*(t/(1-l)-i/a+.5/e*Math.log((1-n)/(1+n))),Math.abs(o)<=1e-7)return s;return null}};var Bt={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(e){var t,i,r,n,a,o,s,l=e.x,h=e.y;return r=$(l-this.long0),t=Math.sin(h),i=Math.cos(h),n=Math.cos(r),(a=this.sin_p14*t+this.cos_p14*i*n)>0||Math.abs(a)<=m?(o=this.x0+1*this.a*i*Math.sin(r)/a,s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*n)/a):(o=this.x0+this.infinity_dist*i*Math.sin(r),s=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*i*n)),e.x=o,e.y=s,e},inverse:function(e){var t,i,r,n,a,o;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(n=Math.atan2(t,this.rc),i=Math.sin(n),r=Math.cos(n),o=Gt(r*this.sin_p14+e.y*i*this.cos_p14/t),a=Math.atan2(e.x*i,t*this.cos_p14*r-e.y*this.sin_p14*i),a=$(this.long0+a)):(o=this.phic0,a=0),e.x=a,e.y=o,e},names:["gnom"]},qt=function(e,t){var i=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-i)<1e-6)return t<0?-1*u:u;for(var r,n,a,o,s=Math.asin(.5*t),l=0;l<30;l++)if(n=Math.sin(s),a=Math.cos(s),o=e*n,s+=r=Math.pow(1-o*o,2)/(2*a)*(t/(1-e*e)-n/(1-o*o)+.5/e*Math.log((1-o)/(1+o))),Math.abs(r)<=1e-10)return s;return NaN};var Ut={init:function(){this.sphere||(this.k0=X(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(e){var t,i,r=e.x,n=e.y,a=$(r-this.long0);if(this.sphere)t=this.x0+this.a*a*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var o=Pt(this.e,Math.sin(n));t=this.x0+this.a*this.k0*a,i=this.y0+this.a*o*.5/this.k0}return e.x=t,e.y=i,e},inverse:function(e){var t,i;return e.x-=this.x0,e.y-=this.y0,this.sphere?(t=$(this.long0+e.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(i=qt(this.e,2*e.y*this.k0/this.a),t=$(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=i,e},names:["cea"]};var Wt={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(e){var t=e.x,i=e.y,r=$(t-this.long0),n=Ot(i-this.lat0);return e.x=this.x0+this.a*r*this.rc,e.y=this.y0+this.a*n,e},inverse:function(e){var t=e.x,i=e.y;return e.x=$(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=Ot(this.lat0+(i-this.y0)/this.a),e},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Ht=20;var Yt={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=St(this.es),this.e1=Mt(this.es),this.e2=kt(this.es),this.e3=Tt(this.es),this.ml0=this.a*Ct(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(e){var t,i,r,n=e.x,a=e.y,o=$(n-this.long0);if(r=o*Math.sin(a),this.sphere)Math.abs(a)<=m?(t=this.a*o,i=-1*this.a*this.lat0):(t=this.a*Math.sin(r)/Math.tan(a),i=this.a*(Ot(a-this.lat0)+(1-Math.cos(r))/Math.tan(a)));else if(Math.abs(a)<=m)t=this.a*o,i=-1*this.ml0;else{var s=It(this.a,this.e,Math.sin(a))/Math.tan(a);t=s*Math.sin(r),i=this.a*Ct(this.e0,this.e1,this.e2,this.e3,a)-this.ml0+s*(1-Math.cos(r))}return e.x=t+this.x0,e.y=i+this.y0,e},inverse:function(e){var t,i,r,n,a,o,s,l,h;if(r=e.x-this.x0,n=e.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=m)t=$(r/this.a+this.long0),i=0;else{var c;for(o=this.lat0+n/this.a,s=r*r/this.a/this.a+o*o,l=o,a=Ht;a;--a)if(l+=h=-1*(o*(l*(c=Math.tan(l))+1)-l-.5*(l*l+s)*c)/((l-o)/c-1),Math.abs(h)<=m){i=l;break}t=$(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(i))}else if(Math.abs(n+this.ml0)<=m)i=0,t=$(this.long0+r/this.a);else{var u,d,p,f,y;for(o=(this.ml0+n)/this.a,s=r*r/this.a/this.a+o*o,l=o,a=Ht;a;--a)if(y=this.e*Math.sin(l),u=Math.sqrt(1-y*y)*Math.tan(l),d=this.a*Ct(this.e0,this.e1,this.e2,this.e3,l),p=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=h=(o*(u*(f=d/this.a)+1)-f-.5*u*(f*f+s))/(this.es*Math.sin(2*l)*(f*f+s-2*o*f)/(4*u)+(o-f)*(u*p-2/Math.sin(2*l))-p),Math.abs(h)<=m){i=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),t=$(this.long0+Math.asin(r*u/this.a)/Math.sin(i))}return e.x=t,e.y=i,e},names:["Polyconic","poly"]};var Xt={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(e){var t,i=e.x,r=e.y-this.lat0,n=i-this.long0,a=r/c*1e-5,o=n,s=1,l=0;for(t=1;t<=10;t++)s*=a,l+=this.A[t]*s;var h,u=l,d=o,p=1,f=0,m=0,y=0;for(t=1;t<=6;t++)h=f*u+p*d,p=p*u-f*d,f=h,m=m+this.B_re[t]*p-this.B_im[t]*f,y=y+this.B_im[t]*p+this.B_re[t]*f;return e.x=y*this.a+this.x0,e.y=m*this.a+this.y0,e},inverse:function(e){var t,i,r=e.x,n=e.y,a=r-this.x0,o=(n-this.y0)/this.a,s=a/this.a,l=1,h=0,u=0,d=0;for(t=1;t<=6;t++)i=h*o+l*s,l=l*o-h*s,h=i,u=u+this.C_re[t]*l-this.C_im[t]*h,d=d+this.C_im[t]*l+this.C_re[t]*h;for(var p=0;p<this.iterations;p++){var f,m=u,y=d,g=o,v=s;for(t=2;t<=6;t++)f=y*u+m*d,m=m*u-y*d,y=f,g+=(t-1)*(this.B_re[t]*m-this.B_im[t]*y),v+=(t-1)*(this.B_im[t]*m+this.B_re[t]*y);m=1,y=0;var b=this.B_re[1],_=this.B_im[1];for(t=2;t<=6;t++)f=y*u+m*d,m=m*u-y*d,y=f,b+=t*(this.B_re[t]*m-this.B_im[t]*y),_+=t*(this.B_im[t]*m+this.B_re[t]*y);var w=b*b+_*_;u=(g*b+v*_)/w,d=(v*b-g*_)/w}var x=u,C=d,S=1,M=0;for(t=1;t<=9;t++)S*=x,M+=this.D[t]*S;var k=this.lat0+M*c*1e5,T=this.long0+C;return e.x=T,e.y=k,e},names:["New_Zealand_Map_Grid","nzmg"]};var Jt={init:function(){},forward:function(e){var t=e.x,i=e.y,r=$(t-this.long0),n=this.x0+this.a*r,a=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return e.x=n,e.y=a,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t=$(this.long0+e.x/this.a),i=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=i,e},names:["Miller_Cylindrical","mill"]},$t=20;var Kt={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=et(this.es)},forward:function(e){var t,i,r=e.x,n=e.y;if(r=$(r-this.long0),this.sphere){if(this.m)for(var a=this.n*Math.sin(n),o=$t;o;--o){var s=(this.m*n+Math.sin(n)-a)/(this.m+Math.cos(n));if(n-=s,Math.abs(s)<m)break}else n=1!==this.n?Math.asin(this.n*Math.sin(n)):n;t=this.a*this.C_x*r*(this.m+Math.cos(n)),i=this.a*this.C_y*n}else{var l=Math.sin(n),h=Math.cos(n);i=this.a*tt(n,l,h,this.en),t=this.a*r*h/Math.sqrt(1-this.es*l*l)}return e.x=t,e.y=i,e},inverse:function(e){var t,i,r,n;return e.x-=this.x0,r=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,r/=this.C_x*(this.m+Math.cos(t)),this.m?t=Gt((this.m*t+Math.sin(t))/this.n):1!==this.n&&(t=Gt(Math.sin(t)/this.n)),r=$(r+this.long0),t=Ot(t)):(t=it(e.y/this.a,this.es,this.en),(n=Math.abs(t))<u?(n=Math.sin(t),i=this.long0+e.x*Math.sqrt(1-this.es*n*n)/(this.a*Math.cos(t)),r=$(i)):n-m<u&&(r=this.long0)),e.x=r,e.y=t,e},names:["Sinusoidal","sinu"]};var Zt={init:function(){},forward:function(e){for(var t=e.x,i=e.y,r=$(t-this.long0),n=i,a=Math.PI*Math.sin(i);;){var o=-(n+Math.sin(n)-a)/(1+Math.cos(n));if(n+=o,Math.abs(o)<m)break}n/=2,Math.PI/2-Math.abs(i)<m&&(r=0);var s=.900316316158*this.a*r*Math.cos(n)+this.x0,l=1.4142135623731*this.a*Math.sin(n)+this.y0;return e.x=s,e.y=l,e},inverse:function(e){var t,i;e.x-=this.x0,e.y-=this.y0,i=e.y/(1.4142135623731*this.a),Math.abs(i)>.999999999999&&(i=.999999999999),t=Math.asin(i);var r=$(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),i=(2*t+Math.sin(2*t))/Math.PI,Math.abs(i)>1&&(i=1);var n=Math.asin(i);return e.x=r,e.y=n,e},names:["Mollweide","moll"]};var Qt={init:function(){Math.abs(this.lat1+this.lat2)<m||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=St(this.es),this.e1=Mt(this.es),this.e2=kt(this.es),this.e3=Tt(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=X(this.e,this.sinphi,this.cosphi),this.ml1=Ct(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<m?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=X(this.e,this.sinphi,this.cosphi),this.ml2=Ct(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Ct(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(e){var t,i=e.x,r=e.y;if(this.sphere)t=this.a*(this.g-r);else{var n=Ct(this.e0,this.e1,this.e2,this.e3,r);t=this.a*(this.g-n)}var a=this.ns*$(i-this.long0),o=this.x0+t*Math.sin(a),s=this.y0+this.rh-t*Math.cos(a);return e.x=o,e.y=s,e},inverse:function(e){var t,i,r,n;e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns>=0?(i=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(i=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var a=0;if(0!==i&&(a=Math.atan2(t*e.x,t*e.y)),this.sphere)return n=$(this.long0+a/this.ns),r=Ot(this.g-i/this.a),e.x=n,e.y=r,e;var o=this.g-i/this.a;return r=Et(o,this.e0,this.e1,this.e2,this.e3),n=$(this.long0+a/this.ns),e.x=n,e.y=r,e},names:["Equidistant_Conic","eqdc"]};var ei={init:function(){this.R=this.a},forward:function(e){var t,i,r=e.x,n=e.y,a=$(r-this.long0);Math.abs(n)<=m&&(t=this.x0+this.R*a,i=this.y0);var o=Gt(2*Math.abs(n/Math.PI));(Math.abs(a)<=m||Math.abs(Math.abs(n)-u)<=m)&&(t=this.x0,i=n>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var s=.5*Math.abs(Math.PI/a-a/Math.PI),l=s*s,h=Math.sin(o),c=Math.cos(o),d=c/(h+c-1),p=d*d,f=d*(2/h-1),y=f*f,g=Math.PI*this.R*(s*(d-y)+Math.sqrt(l*(d-y)*(d-y)-(y+l)*(p-y)))/(y+l);a<0&&(g=-g),t=this.x0+g;var v=l+d;return g=Math.PI*this.R*(f*v-s*Math.sqrt((y+l)*(l+1)-v*v))/(y+l),i=n>=0?this.y0+g:this.y0-g,e.x=t,e.y=i,e},inverse:function(e){var t,i,r,n,a,o,s,l,h,c,u,d;return e.x-=this.x0,e.y-=this.y0,u=Math.PI*this.R,a=(r=e.x/u)*r+(n=e.y/u)*n,u=3*(n*n/(l=-2*(o=-Math.abs(n)*(1+a))+1+2*n*n+a*a)+(2*(s=o-2*n*n+r*r)*s*s/l/l/l-9*o*s/l/l)/27)/(h=(o-s*s/3/l)/l)/(c=2*Math.sqrt(-h/3)),Math.abs(u)>1&&(u=u>=0?1:-1),d=Math.acos(u)/3,i=e.y>=0?(-c*Math.cos(d+Math.PI/3)-s/3/l)*Math.PI:-(-c*Math.cos(d+Math.PI/3)-s/3/l)*Math.PI,t=Math.abs(r)<m?this.long0:$(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(r*r-n*n)+a*a))/2/r),e.x=t,e.y=i,e},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var ti={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(e){var t,i,r,n,a,o,s,l,h,c,d,p,f,y,g,v,b,_,w,x,C,S,M=e.x,k=e.y,T=Math.sin(e.y),I=Math.cos(e.y),O=$(M-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=m?(e.x=this.x0+this.a*(u-k)*Math.sin(O),e.y=this.y0-this.a*(u-k)*Math.cos(O),e):Math.abs(this.sin_p12+1)<=m?(e.x=this.x0+this.a*(u+k)*Math.sin(O),e.y=this.y0+this.a*(u+k)*Math.cos(O),e):(_=this.sin_p12*T+this.cos_p12*I*Math.cos(O),b=(v=Math.acos(_))?v/Math.sin(v):1,e.x=this.x0+this.a*b*I*Math.sin(O),e.y=this.y0+this.a*b*(this.cos_p12*T-this.sin_p12*I*Math.cos(O)),e):(t=St(this.es),i=Mt(this.es),r=kt(this.es),n=Tt(this.es),Math.abs(this.sin_p12-1)<=m?(a=this.a*Ct(t,i,r,n,u),o=this.a*Ct(t,i,r,n,k),e.x=this.x0+(a-o)*Math.sin(O),e.y=this.y0-(a-o)*Math.cos(O),e):Math.abs(this.sin_p12+1)<=m?(a=this.a*Ct(t,i,r,n,u),o=this.a*Ct(t,i,r,n,k),e.x=this.x0+(a+o)*Math.sin(O),e.y=this.y0+(a+o)*Math.cos(O),e):(s=T/I,l=It(this.a,this.e,this.sin_p12),h=It(this.a,this.e,T),c=Math.atan((1-this.es)*s+this.es*l*this.sin_p12/(h*I)),w=0===(d=Math.atan2(Math.sin(O),this.cos_p12*Math.tan(c)-this.sin_p12*Math.cos(O)))?Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.abs(Math.abs(d)-Math.PI)<=m?-Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.asin(Math.sin(O)*Math.cos(c)/Math.sin(d)),p=this.e*this.sin_p12/Math.sqrt(1-this.es),v=l*w*(1-(x=w*w)*(g=(f=this.e*this.cos_p12*Math.cos(d)/Math.sqrt(1-this.es))*f)*(1-g)/6+(C=x*w)/8*(y=p*f)*(1-2*g)+(S=C*w)/120*(g*(4-7*g)-3*p*p*(1-7*g))-S*w/48*y),e.x=this.x0+v*Math.sin(d),e.y=this.y0+v*Math.cos(d),e))},inverse:function(e){var t,i,r,n,a,o,s,l,h,c,d,p,f,y,g,v,b,_,w,x,C,S,M;if(e.x-=this.x0,e.y-=this.y0,this.sphere){if((t=Math.sqrt(e.x*e.x+e.y*e.y))>2*u*this.a)return;return i=t/this.a,r=Math.sin(i),n=Math.cos(i),a=this.long0,Math.abs(t)<=m?o=this.lat0:(o=Gt(n*this.sin_p12+e.y*r*this.cos_p12/t),s=Math.abs(this.lat0)-u,a=Math.abs(s)<=m?this.lat0>=0?$(this.long0+Math.atan2(e.x,-e.y)):$(this.long0-Math.atan2(-e.x,e.y)):$(this.long0+Math.atan2(e.x*r,t*this.cos_p12*n-e.y*this.sin_p12*r))),e.x=a,e.y=o,e}return l=St(this.es),h=Mt(this.es),c=kt(this.es),d=Tt(this.es),Math.abs(this.sin_p12-1)<=m?(p=this.a*Ct(l,h,c,d,u),t=Math.sqrt(e.x*e.x+e.y*e.y),o=Et((p-t)/this.a,l,h,c,d),a=$(this.long0+Math.atan2(e.x,-1*e.y)),e.x=a,e.y=o,e):Math.abs(this.sin_p12+1)<=m?(p=this.a*Ct(l,h,c,d,u),t=Math.sqrt(e.x*e.x+e.y*e.y),o=Et((t-p)/this.a,l,h,c,d),a=$(this.long0+Math.atan2(e.x,e.y)),e.x=a,e.y=o,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),g=Math.atan2(e.x,e.y),f=It(this.a,this.e,this.sin_p12),v=Math.cos(g),_=-(b=this.e*this.cos_p12*v)*b/(1-this.es),w=3*this.es*(1-_)*this.sin_p12*this.cos_p12*v/(1-this.es),S=1-_*(C=(x=t/f)-_*(1+_)*Math.pow(x,3)/6-w*(1+3*_)*Math.pow(x,4)/24)*C/2-x*C*C*C/6,y=Math.asin(this.sin_p12*Math.cos(C)+this.cos_p12*Math.sin(C)*v),a=$(this.long0+Math.asin(Math.sin(g)*Math.sin(C)/Math.cos(y))),M=Math.sin(y),o=Math.atan2((M-this.es*S*this.sin_p12)*Math.tan(y),M*(1-this.es)),e.x=a,e.y=o,e)},names:["Azimuthal_Equidistant","aeqd"]};var ii={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(e){var t,i,r,n,a,o,s,l=e.x,h=e.y;return r=$(l-this.long0),t=Math.sin(h),i=Math.cos(h),n=Math.cos(r),((a=this.sin_p14*t+this.cos_p14*i*n)>0||Math.abs(a)<=m)&&(o=1*this.a*i*Math.sin(r),s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*n)),e.x=o,e.y=s,e},inverse:function(e){var t,i,r,n,a,o,s;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),i=Gt(t/this.a),r=Math.sin(i),n=Math.cos(i),o=this.long0,Math.abs(t)<=m?(s=this.lat0,e.x=o,e.y=s,e):(s=Gt(n*this.sin_p14+e.y*r*this.cos_p14/t),a=Math.abs(this.lat0)-u,Math.abs(a)<=m?(o=this.lat0>=0?$(this.long0+Math.atan2(e.x,-e.y)):$(this.long0-Math.atan2(-e.x,e.y)),e.x=o,e.y=s,e):(o=$(this.long0+Math.atan2(e.x*r,t*this.cos_p14*n-e.y*this.sin_p14*r)),e.x=o,e.y=s,e))},names:["ortho"]},ri={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},ni={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function ai(e,t,i,r){var n;return e<m?(r.value=ni.AREA_0,n=0):(n=Math.atan2(t,i),Math.abs(n)<=v?r.value=ni.AREA_0:n>v&&n<=u+v?(r.value=ni.AREA_1,n-=u):n>u+v||n<=-(u+v)?(r.value=ni.AREA_2,n=n>=0?n-_:n+_):(r.value=ni.AREA_3,n+=u)),n}function oi(e,t){var i=e+t;return i<-_?i+=b:i>+_&&(i-=b),i}var si={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=u-v/2?this.face=ri.TOP:this.lat0<=-(u-v/2)?this.face=ri.BOTTOM:Math.abs(this.long0)<=v?this.face=ri.FRONT:Math.abs(this.long0)<=u+v?this.face=this.long0>0?ri.RIGHT:ri.LEFT:this.face=ri.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(e){var t,i,r,n,a,o,s={x:0,y:0},l={value:0};if(e.x-=this.long0,t=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(e.y)):e.y,i=e.x,this.face===ri.TOP)n=u-t,i>=v&&i<=u+v?(l.value=ni.AREA_0,r=i-u):i>u+v||i<=-(u+v)?(l.value=ni.AREA_1,r=i>0?i-_:i+_):i>-(u+v)&&i<=-v?(l.value=ni.AREA_2,r=i+u):(l.value=ni.AREA_3,r=i);else if(this.face===ri.BOTTOM)n=u+t,i>=v&&i<=u+v?(l.value=ni.AREA_0,r=-i+u):i<v&&i>=-v?(l.value=ni.AREA_1,r=-i):i<-v&&i>=-(u+v)?(l.value=ni.AREA_2,r=-i-u):(l.value=ni.AREA_3,r=i>0?-i+_:-i-_);else{var h,c,d,p,f,m;this.face===ri.RIGHT?i=oi(i,+u):this.face===ri.BACK?i=oi(i,+_):this.face===ri.LEFT&&(i=oi(i,-u)),p=Math.sin(t),f=Math.cos(t),m=Math.sin(i),h=f*Math.cos(i),c=f*m,d=p,this.face===ri.FRONT?r=ai(n=Math.acos(h),d,c,l):this.face===ri.RIGHT?r=ai(n=Math.acos(c),d,-h,l):this.face===ri.BACK?r=ai(n=Math.acos(-h),d,-c,l):this.face===ri.LEFT?r=ai(n=Math.acos(-c),d,h,l):(n=r=0,l.value=ni.AREA_0)}return o=Math.atan(12/_*(r+Math.acos(Math.sin(r)*Math.cos(v))-u)),a=Math.sqrt((1-Math.cos(n))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(r))))),l.value===ni.AREA_1?o+=u:l.value===ni.AREA_2?o+=_:l.value===ni.AREA_3&&(o+=1.5*_),s.x=a*Math.cos(o),s.y=a*Math.sin(o),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,e.x=s.x,e.y=s.y,e},inverse:function(e){var t,i,r,n,a,o,s,l,h,c,d,p,f={lam:0,phi:0},m={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,i=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),t=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?m.value=ni.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(m.value=ni.AREA_1,t-=u):e.x<0&&-e.x>=Math.abs(e.y)?(m.value=ni.AREA_2,t=t<0?t+_:t-_):(m.value=ni.AREA_3,t+=u),h=_/12*Math.tan(t),a=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),o=Math.atan(a),(s=1-(r=Math.cos(t))*r*(n=Math.tan(i))*n*(1-Math.cos(Math.atan(1/Math.cos(o)))))<-1?s=-1:s>1&&(s=1),this.face===ri.TOP)l=Math.acos(s),f.phi=u-l,m.value===ni.AREA_0?f.lam=o+u:m.value===ni.AREA_1?f.lam=o<0?o+_:o-_:m.value===ni.AREA_2?f.lam=o-u:f.lam=o;else if(this.face===ri.BOTTOM)l=Math.acos(s),f.phi=l-u,m.value===ni.AREA_0?f.lam=-o+u:m.value===ni.AREA_1?f.lam=-o:m.value===ni.AREA_2?f.lam=-o-u:f.lam=o<0?-o-_:-o+_;else{var y,g,v;h=(y=s)*y,g=(h+=(v=h>=1?0:Math.sqrt(1-h)*Math.sin(o))*v)>=1?0:Math.sqrt(1-h),m.value===ni.AREA_1?(h=g,g=-v,v=h):m.value===ni.AREA_2?(g=-g,v=-v):m.value===ni.AREA_3&&(h=g,g=v,v=-h),this.face===ri.RIGHT?(h=y,y=-g,g=h):this.face===ri.BACK?(y=-y,g=-g):this.face===ri.LEFT&&(h=y,y=g,g=-h),f.phi=Math.acos(-v)-u,f.lam=Math.atan2(g,y),this.face===ri.RIGHT?f.lam=oi(f.lam,-u):this.face===ri.BACK?f.lam=oi(f.lam,-_):this.face===ri.LEFT&&(f.lam=oi(f.lam,+u))}return 0!==this.es&&(c=f.phi<0?1:0,d=Math.tan(f.phi),p=this.b/Math.sqrt(d*d+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),c&&(f.phi=-f.phi)),f.lam+=this.long0,e.x=f.lam,e.y=f.phi,e},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},li=[[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]],hi=[[-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]],ci=.8487,ui=1.3523,di=g/5,pi=1/di,fi=18,mi=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},yi=function(e,t){return e[1]+t*(2*e[2]+3*t*e[3])};var gi={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(e){var t=$(e.x-this.long0),i=Math.abs(e.y),r=Math.floor(i*di);r<0?r=0:r>=fi&&(r=fi-1),i=g*(i-pi*r);var n={x:mi(li[r],i)*t,y:mi(hi[r],i)};return e.y<0&&(n.y=-n.y),n.x=n.x*this.a*ci+this.x0,n.y=n.y*this.a*ui+this.y0,n},inverse:function(e){var t={x:(e.x-this.x0)/(this.a*ci),y:Math.abs(e.y-this.y0)/(this.a*ui)};if(t.y>=1)t.x/=li[fi][0],t.y=e.y<0?-u:u;else{var i=Math.floor(t.y*fi);for(i<0?i=0:i>=fi&&(i=fi-1);;)if(hi[i][0]>t.y)--i;else{if(!(hi[i+1][0]<=t.y))break;++i}var r=hi[i],n=5*(t.y-r[0])/(hi[i+1][0]-r[0]);n=function(e,t,i,r){for(var n=t;r;--r){var a=e(n);if(n-=a,Math.abs(a)<i)break}return n}(function(e){return(mi(r,e)-t.y)/yi(r,e)},n,m,100),t.x/=mi(li[i],n),t.y=(5*i+n)*y,e.y<0&&(t.y=-t.y)}return t.x=$(t.x+this.long0),t},names:["Robinson","robin"]};var vi={init:function(){this.name="geocent"},forward:function(e){return ve(e,this.es,this.a)},inverse:function(e){return be(e,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},bi={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},_i={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};var wi={init:function(){if(Object.keys(_i).forEach(function(e){if(void 0===this[e])this[e]=_i[e].def;else{if(_i[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);_i[e].num&&(this[e]=parseFloat(this[e]))}_i[e].degrees&&(this[e]=this[e]*y)}.bind(this)),Math.abs(Math.abs(this.lat0)-u)<m?this.mode=this.lat0<0?bi.S_POLE:bi.N_POLE:Math.abs(this.lat0)<m?this.mode=bi.EQUIT:(this.mode=bi.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)},forward:function(e){e.x-=this.long0;var t,i,r,n,a=Math.sin(e.y),o=Math.cos(e.y),s=Math.cos(e.x);switch(this.mode){case bi.OBLIQ:i=this.sinph0*a+this.cosph0*o*s;break;case bi.EQUIT:i=o*s;break;case bi.S_POLE:i=-a;break;case bi.N_POLE:i=a}switch(t=(i=this.pn1/(this.p-i))*o*Math.sin(e.x),this.mode){case bi.OBLIQ:i*=this.cosph0*a-this.sinph0*o*s;break;case bi.EQUIT:i*=a;break;case bi.N_POLE:i*=-o*s;break;case bi.S_POLE:i*=o*s}return n=1/((r=i*this.cg+t*this.sg)*this.sw*this.h1+this.cw),t=(t*this.cg-i*this.sg)*this.cw*n,i=r*n,e.x=t*this.a,e.y=i*this.a,e},inverse:function(e){e.x/=this.a,e.y/=this.a;var t,i,r,n={x:e.x,y:e.y};r=1/(this.pn1-e.y*this.sw),t=this.pn1*e.x*r,i=this.pn1*e.y*this.cw*r,e.x=t*this.cg+i*this.sg,e.y=i*this.cg-t*this.sg;var a=at(e.x,e.y);if(Math.abs(a)<m)n.x=0,n.y=e.y;else{var o,s;switch(s=1-a*a*this.pfact,s=(this.p-Math.sqrt(s))/(this.pn1/a+a/this.pn1),o=Math.sqrt(1-s*s),this.mode){case bi.OBLIQ:n.y=Math.asin(o*this.sinph0+e.y*s*this.cosph0/a),e.y=(o-this.sinph0*Math.sin(n.y))*a,e.x*=s*this.cosph0;break;case bi.EQUIT:n.y=Math.asin(e.y*s/a),e.y=o*a,e.x*=s;break;case bi.N_POLE:n.y=Math.asin(o),e.y=-e.y;break;case bi.S_POLE:n.y=-Math.asin(o)}n.x=Math.atan2(e.x,e.y)}return e.x=n.x+this.long0,e.y=n.y,e},names:["Tilted_Perspective","tpers"]};var xi={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>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 e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,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(e){var t,i,r,n,a=e.x,o=e.y;if(a-=this.long0,"ellipse"===this.shape){o=Math.atan(this.radius_p2*Math.tan(o));var s=this.radius_p/at(this.radius_p*Math.cos(o),Math.sin(o));if(i=s*Math.cos(a)*Math.cos(o),r=s*Math.sin(a)*Math.cos(o),n=s*Math.sin(o),(this.radius_g-i)*i-r*r-n*n*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;t=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(r/at(n,t)),e.y=this.radius_g_1*Math.atan(n/t)):(e.x=this.radius_g_1*Math.atan(r/t),e.y=this.radius_g_1*Math.atan(n/at(r,t)))}else"sphere"===this.shape&&(t=Math.cos(o),i=Math.cos(a)*t,r=Math.sin(a)*t,n=Math.sin(o),t=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(r/at(n,t)),e.y=this.radius_g_1*Math.atan(n/t)):(e.x=this.radius_g_1*Math.atan(r/t),e.y=this.radius_g_1*Math.atan(n/at(r,t))));return e.x=e.x*this.a,e.y=e.y*this.a,e},inverse:function(e){var t,i,r,n,a=-1,o=0,s=0;if(e.x=e.x/this.a,e.y=e.y/this.a,"ellipse"===this.shape){this.flip_axis?(s=Math.tan(e.y/this.radius_g_1),o=Math.tan(e.x/this.radius_g_1)*at(1,s)):(o=Math.tan(e.x/this.radius_g_1),s=Math.tan(e.y/this.radius_g_1)*at(1,o));var l=s/this.radius_p;if(t=o*o+l*l+a*a,(r=(i=2*this.radius_g*a)*i-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;n=(-i-Math.sqrt(r))/(2*t),a=this.radius_g+n*a,o*=n,s*=n,e.x=Math.atan2(o,a),e.y=Math.atan(s*Math.cos(e.x)/a),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if("sphere"===this.shape){if(this.flip_axis?(s=Math.tan(e.y/this.radius_g_1),o=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+s*s)):(o=Math.tan(e.x/this.radius_g_1),s=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+o*o)),t=o*o+s*s+a*a,(r=(i=2*this.radius_g*a)*i-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;n=(-i-Math.sqrt(r))/(2*t),a=this.radius_g+n*a,o*=n,s*=n,e.x=Math.atan2(o,a),e.y=Math.atan(s*Math.cos(e.x)/a)}return e.x=e.x+this.long0,e},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};Re.defaultDatum="WGS84",Re.Proj=ge,Re.WGS84=new Re.Proj("WGS84"),Re.Point=Ze,Re.toPoint=ke,Re.defs=q,Re.nadgrid=function(e,t){var i=new DataView(t),r=function(e){var t=e.getInt32(8,!1);return 11!==t&&(11!==(t=e.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(i),n=function(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:de(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}(i,r);n.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var a={header:n,subgrids:function(e,t,i){for(var r=[],n=0;n<t.nSubgrids;n++){var a=fe(e,176,i),o=me(e,176,a,i),s=Math.round(1+(a.upperLongitude-a.lowerLongitude)/a.longitudeInterval),l=Math.round(1+(a.upperLatitude-a.lowerLatitude)/a.latitudeInterval);r.push({ll:[ue(a.lowerLongitude),ue(a.lowerLatitude)],del:[ue(a.longitudeInterval),ue(a.latitudeInterval)],lim:[s,l],count:a.gridNodeCount,cvs:pe(o)})}return r}(i,n,r)};return he[e]=a,a},Re.transform=Oe,Re.mgrs=Be,Re.version="__VERSION__",function(e){e.Proj.projections.add(rt),e.Proj.projections.add(ct),e.Proj.projections.add(dt),e.Proj.projections.add(yt),e.Proj.projections.add(gt),e.Proj.projections.add(vt),e.Proj.projections.add(_t),e.Proj.projections.add(wt),e.Proj.projections.add(xt),e.Proj.projections.add(Lt),e.Proj.projections.add(Nt),e.Proj.projections.add(Ft),e.Proj.projections.add(Bt),e.Proj.projections.add(Ut),e.Proj.projections.add(Wt),e.Proj.projections.add(Yt),e.Proj.projections.add(Xt),e.Proj.projections.add(Jt),e.Proj.projections.add(Kt),e.Proj.projections.add(Zt),e.Proj.projections.add(Qt),e.Proj.projections.add(ei),e.Proj.projections.add(ti),e.Proj.projections.add(ii),e.Proj.projections.add(si),e.Proj.projections.add(gi),e.Proj.projections.add(vi),e.Proj.projections.add(wi),e.Proj.projections.add(xi)}(Re);var Ci=Re;function Si(e,t){return e.length>2?Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]+t):Cesium.Cartesian3.fromDegrees(e[0],e[1],t)}function Mi(e,t,i,r){const n=[];for(let a,o=0,s=e.length;o<s;o++)a=t?Mi(e[o],t-1,i,r):(i||Si)(e[o],r),n.push(a);return n}function ki(e,t){return"4326"!==String(e.wkid)?(t.spatialReference=e,n.Projection.project(t,new n.SpatialReference("EPSG:4326"))):t}var Ti=class{static toCartesian3Array(e,t){let i=[];const r=Object(n.defaultValue)(t,{}),a=Object(n.defaultValue)(r.offsetHeight,0);if(!(e instanceof n.Geometry))return i;let o=Object(n.defaultValue)(r.spatialReference,new n.SpatialReference("EPSG:4326"));switch(e.spatialReference&&(o=e.spatialReference),e.type){case n.GeometryType.point:{let t=e.clone();const r=(t=ki(o,t)).coordinates;i.push(Si(r,a));break}case n.GeometryType.multiPoint:case n.GeometryType.lineString:{let t=e.clone();i=Mi((t=ki(o,t)).coordinates,0,Si,a);break}case n.GeometryType.multiLineString:case n.GeometryType.polygon:{let t=e.clone();i=Mi((t=ki(o,t)).coordinates,1,Si,a);break}case n.GeometryType.multiPolygon:{let t=e.clone();i=Mi((t=ki(o,t)).coordinates,2,Si,a);break}case n.GeometryType.extent:{let t=e.clone();const r=(t=ki(o,t)).xmin,n=t.xmax,s=t.ymin,l=t.ymax,h=t.zmin,c=t.zmax;let u,d;t.hasZ?(u=Cesium.Cartesian3.fromDegrees(r,s,h+a),d=Cesium.Cartesian3.fromDegrees(n,l,c+a)):(u=Cesium.Cartesian3.fromDegrees(r,s,a),d=Cesium.Cartesian3.fromDegrees(n,l,a)),i.push(u),i.push(d);break}case n.GeometryType.circle:{let t,r=e.clone();const n=(r=ki(o,r)).center;t=r.hasZ?Cesium.Cartesian3.fromDegrees(n[0],n[1],n[2]+a):Cesium.Cartesian3.fromDegrees(n[0],n[1],a),i.push(t);break}}return i}},Ii=i(1);function Oi(e){let t,i,r,n,a=0;const o=e,s=[];for(t=1;t<o.length;t++)i=o[t],r=o[t-1],a+=n=Cesium.Cartesian3.distance(i,r),s.push(n);this.lenArr=s,this.len=a,this.coords=o}Oi.prototype.getTotalLength=function(){return this.len},Oi.prototype.getDetail=function(e){let t,i,r=e;r>=1&&(r=1),r<=0&&(r=0);const n=r*this.len;let a,o=0;const s=this.coords;for(a=0;a<this.lenArr.length;a++){if(n<=this.lenArr[a]+o){t=a,i=(n-o)/this.lenArr[a];break}o+=this.lenArr[a]}const l=new Cesium.Cartesian3;return Cesium.Cartesian3.lerp(s[t],s[t+1],i,l),{position:l,angle:180*window.Math.atan2(s[t+1].y-s[t].y,s[t+1].x-s[t].x)/window.Math.PI}},Oi.prototype.getPartsByLength=function(e){const t=window.Math.round(e/this.len*1e3)/1e3,i=window.Math.ceil(this.len/e),r=[];if(1===i)r.push({startRate:0,endRate:1});else{let e;for(e=1;e<i;e++)r.push({startRate:(e-1)*t,endRate:e*t})}return r};var Ei=Oi,Li=i(2);const Pi=Ti.toCartesian3Array;function Ri(e,t){const i=Ii.a.convertLabelClassToLabelNoteStyle(t);return Li.a.parseNoteOptions(e,i)}function ji(e){return e instanceof Cesium.LabelCollection?Li.a.createLabelOptions:e instanceof Cesium.BillboardCollection?Li.a.createNoteBillBoardOptions:Li.a.createGroundOptions}function Ai(e,t,i,r,n,a,o){const s=[],l=function(e,t,i,r,n){let a=n-r;(a<=0||a>=1)&&(a=.4);const o=t-e,s=a*o;return{spaceRate:r*o+e,parseRate:Math.round(s/i*1e3)/1e3}}(i,r,n.length,o.repeatStartRate,o.repeatEndRate);for(let i=0;i<n.length;i++){const r=e.getDetail(l.spaceRate+l.parseRate*i),h=ji(t)(a,n[i],r.position,o);s.push(h)}return s}function zi(e){const t=n.T.bbox(e),i=Math.PI,r=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(t[0]/180*i,t[3]/180*i)),a=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(t[0]/180*i,t[1]/180*i)),o=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(t[2]/180*i,t[3]/180*i));let s;return function(e,t,i,r,a,o,s){const l=n.T.lineSegment(t),h=0===e,c=h?(a-r)/i:(s-o)/i,u=[];let d,p;for(d=0;d<i;d++){const e=h?n.T.lineString([[r+d*c,s],[r+d*c,o]]):n.T.lineString([[a,s-d*c],[r,s-d*c]]),t=n.T.lineIntersect(e,l),i=t.features.length,f=[];let m;if(!(i<1)){for(p=0;p<i;p++)f.push(n.T.getCoord(t.features[p]));if(1===i)m=f[0],u.push(m);else{let e=0;for(let t=0;t<i;t+=2){const i=f[t],r=f[t+1];let n;h?(n=Math.abs(r[1]-i[1]))>=e&&(e=n,m=[i[0],(r[1]-i[1])/2+i[1]]):(n=Math.abs(r[0]-i[0]))>=e&&(e=n,m=[i[0]+(r[0]-i[0])/2,i[1]])}u.push(m)}}}return u}(s=Cesium.Cartesian3.distance(r,o)>Cesium.Cartesian3.distance(r,a)?0:1,e,20,t[0],t[2],t[1],t[3])}class Di{static renderLabel(e,t,i){const r=Di.createLabels(e,t,i);return r.forEach(t=>{e.add(t)}),r}static removeLabels(e,t){const i=e._labels||e._billboards||e._primitives,r=[];t.forEach(e=>{const t=e.id;for(let e=0;e<i.length;e++)i[e].id===t&&r.push(i[e])}),r.forEach(t=>{e.remove(t)})}static createLabels(e,t,i){let r=[];if(t=t||[],!Array.isArray(t)||t.length<=0)return r;const a=t[0].geometry.type;let o;o=[n.GeometryType.multiPolygon,n.GeometryType.polygon].some(e=>e===a)?Ri("Polygon",i):[n.GeometryType.lineString,n.GeometryType.multiLineString].some(e=>e===a)?Ri("Line",i):Ri("Point",i);const{currentAttributeName:s,labelExpression:l,symbol:h={}}=i,c=s?`$feature.${s}`:l,u=ji(e);return t.forEach(t=>{const i=t.geometry,a=i.type;let s=Pi(i);const l=Ii.a.parseExpression(t,c)||h.text||t.symbol.text,d=t.id;if(!l)return r;switch(a){case n.GeometryType.point:case n.GeometryType.multiPoint:{const e=a===n.GeometryType.point?[i.coordinates]:i.coordinates;s.forEach((t,i)=>{const n=u(d,l,t,o);n.__latLng__=e[i],r.push(n)});break}case n.GeometryType.multiLineString:case n.GeometryType.lineString:a===n.GeometryType.lineString&&(s=[s]),s.forEach(t=>{let i=o.lineLabelSpread;const n=o.repeatLabel,a=o.repeatLabelDistance,s=o.labelPositionAlong;if(!l)return r;let h;const c=new Ei(t);if("auto-spread"===i){i=new RegExp("^[A-Za-z0-9]+$").test(l)?"centralization-spread":"decentralize-spread"}if("decentralize-spread"===i){const t=l.split("");if(n){c.getPartsByLength(a).forEach(function(i){const n=i.startRate,a=i.endRate,s=Ai(c,e,n,a,t,d,o);r=r.concat(s)})}else{const i=Ai(c,e,0,1,t,d,o);r=r.concat(i)}}else if("centralization-spread"===i)if(n){c.getPartsByLength(a).forEach(function(e){const t=e.startRate,i=e.endRate;if("start"===s){h=c.getDetail(t).position;const e=u(d,l,h,o);r.push(e)}else if("end"===s){h=c.getDetail(i).position;const e=u(d,l,h,o);r.push(e)}else{h=c.getDetail((i-t)/2+t).position;const e=u(d,l,h,o);r.push(e)}})}else if("start"===s){h=c.getDetail(0).position;const e=u(d,l,h,o);r.push(e)}else if("end"===s){h=c.getDetail(1).position;const e=u(d,l,h,o);r.push(e)}else{h=c.getDetail(.5).position;const e=u(d,l,h,o);r.push(e)}});break;case n.GeometryType.multiPolygon:case n.GeometryType.polygon:a===n.GeometryType.polygon&&(s=[s]),s.forEach(t=>{t.forEach(t=>{const i=o.type,a=function(e){if(!e||0===e.length)return null;const t=e.length;let i;const r=[];let n,a;for(i=0;i<t;i++){const t=Cesium.Cartographic.fromCartesian(e[i]);r.push([180*t.longitude/Math.PI,180*t.latitude/Math.PI]),0===i&&(n=t.height,a=t.height),n=Math.max(n,t.height),a=Math.min(a,t.height)}return{latlngArr:r,maxHeight:n,minHeight:a}}(t),s=a.maxHeight,h=a.minHeight,c=n.T.polygon([a.latlngArr]),p=n.T.getCoord(n.T.centroid(c));let f=new Cesium.Cartesian3;if("parallel"===i){f=Cesium.Cartesian3.fromDegrees(p[0],p[1],(s+h)/2);const e=u(d,l,f,o);r.push(e)}else if("outside"===i||"bottom"===i){const e=n.T.bbox(c),t=n.T.lineSegment(c),a=[e[0],e[1]],p=[e[2],e[3]],m=n.T.lineString([p,a]),y=n.T.lineIntersect(m,t);let g;if(0===y.features.length)g="outside"===i?p:a;else{const e="outside"===i?p:a;g=n.T.getCoord(n.T.nearestPoint(n.T.point(e),y))}o.positionOffsetXRate=1,o.positionOffsetYRate=1,f=Cesium.Cartesian3.fromDegrees(g[0],g[1],(s+h)/2);const v=u(d,l,f,o);r.push(v)}else if("straight"===i||"skeleton"===i){const t=zi(c);if(t.length<2)return r;const n=[],a=l.split("");t.forEach(function(e){n.push(Cesium.Cartographic.toCartesian(new Cesium.Cartographic(e[0]/180*Math.PI,e[1]/180*Math.PI,0)))});const s=new Ei(n);if("skeleton"===i){const t=Ai(s,e,o.skeletonLineStartRate,o.skeletonLineEndRate,a,d,o);r=r.concat(t)}else{const e=s.getDetail(.5),t=u(d,l,e.position,o);r.push(t)}}})})}}),r}}var Vi=Di;function Ni(e,t,i,r,n){!function e(t,i,r,n,a){for(;n>r;){if(n-r>600){var o=n-r+1,s=i-r+1,l=Math.log(o),h=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*h*(o-h)/o)*(s-o/2<0?-1:1),u=Math.max(r,Math.floor(i-s*h/o+c)),d=Math.min(n,Math.floor(i+(o-s)*h/o+c));e(t,i,u,d,a)}var p=t[i],f=r,m=n;for(Gi(t,r,i),a(t[n],p)>0&&Gi(t,r,n);f<m;){for(Gi(t,f,m),f++,m--;a(t[f],p)<0;)f++;for(;a(t[m],p)>0;)m--}0===a(t[r],p)?Gi(t,r,m):Gi(t,++m,n),m<=i&&(r=m+1),i<=m&&(n=m-1)}}(e,t,i||0,r||e.length-1,n||Fi)}function Gi(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function Fi(e,t){return e<t?-1:e>t?1:0}function Bi(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function qi(e,t,i){if(!i)return t.indexOf(e);for(var r=0;r<t.length;r++)if(i(e,t[r]))return r;return-1}function Ui(e,t){Wi(e,0,e.children.length,t,e)}function Wi(e,t,i,r,n){n||(n=tr(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var a=t;a<i;a++){var o=e.children[a];Hi(n,e.leaf?r(o):o)}return n}function Hi(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function Yi(e,t){return e.minX-t.minX}function Xi(e,t){return e.minY-t.minY}function Ji(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function $i(e){return e.maxX-e.minX+(e.maxY-e.minY)}function Ki(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function Zi(e,t){var i=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),a=Math.min(e.maxY,t.maxY);return Math.max(0,n-i)*Math.max(0,a-r)}function Qi(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function er(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function tr(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ir(e,t,i,r,n){for(var a=[t,i];a.length;)if(!((i=a.pop())-(t=a.pop())<=r)){var o=t+Math.ceil((i-t)/r/2)*r;Ni(e,o,t,i,n),a.push(t,o,o,i)}}Bi.prototype.all=function(){return this._all(this.data,[])},Bi.prototype.search=function(e){var t=this.data,i=[];if(!er(e,t))return i;for(var r=this.toBBox,n=[];t;){for(var a=0;a<t.children.length;a++){var o=t.children[a],s=t.leaf?r(o):o;er(e,s)&&(t.leaf?i.push(o):Qi(e,s)?this._all(o,i):n.push(o))}t=n.pop()}return i},Bi.prototype.collides=function(e){var t=this.data;if(!er(e,t))return!1;for(var i=[];t;){for(var r=0;r<t.children.length;r++){var n=t.children[r],a=t.leaf?this.toBBox(n):n;if(er(e,a)){if(t.leaf||Qi(e,a))return!0;i.push(n)}}t=i.pop()}return!1},Bi.prototype.load=function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0;t<e.length;t++)this.insert(e[t]);return this}var i=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var r=this.data;this.data=i,i=r}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},Bi.prototype.insert=function(e){return e&&this._insert(e,this.data.height-1),this},Bi.prototype.clear=function(){return this.data=tr([]),this},Bi.prototype.remove=function(e,t){if(!e)return this;for(var i,r,n,a=this.data,o=this.toBBox(e),s=[],l=[];a||s.length;){if(a||(a=s.pop(),r=s[s.length-1],i=l.pop(),n=!0),a.leaf){var h=qi(e,a.children,t);if(-1!==h)return a.children.splice(h,1),s.push(a),this._condense(s),this}n||a.leaf||!Qi(a,o)?r?(i++,a=r.children[i],n=!1):a=null:(s.push(a),l.push(i),i=0,r=a,a=a.children[0])}return this},Bi.prototype.toBBox=function(e){return e},Bi.prototype.compareMinX=function(e,t){return e.minX-t.minX},Bi.prototype.compareMinY=function(e,t){return e.minY-t.minY},Bi.prototype.toJSON=function(){return this.data},Bi.prototype.fromJSON=function(e){return this.data=e,this},Bi.prototype._all=function(e,t){for(var i=[];e;)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},Bi.prototype._build=function(e,t,i,r){var n,a=i-t+1,o=this._maxEntries;if(a<=o)return Ui(n=tr(e.slice(t,i+1)),this.toBBox),n;r||(r=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,r-1))),(n=tr([])).leaf=!1,n.height=r;var s=Math.ceil(a/o),l=s*Math.ceil(Math.sqrt(o));ir(e,t,i,l,this.compareMinX);for(var h=t;h<=i;h+=l){var c=Math.min(h+l-1,i);ir(e,h,c,s,this.compareMinY);for(var u=h;u<=c;u+=s){var d=Math.min(u+s-1,c);n.children.push(this._build(e,u,d,r-1))}}return Ui(n,this.toBBox),n},Bi.prototype._chooseSubtree=function(e,t,i,r){for(;r.push(t),!t.leaf&&r.length-1!==i;){for(var n=1/0,a=1/0,o=void 0,s=0;s<t.children.length;s++){var l=t.children[s],h=Ji(l),c=Ki(e,l)-h;c<a?(a=c,n=h<n?h:n,o=l):c===a&&h<n&&(n=h,o=l)}t=o||t.children[0]}return t},Bi.prototype._insert=function(e,t,i){var r=i?e:this.toBBox(e),n=[],a=this._chooseSubtree(r,this.data,t,n);for(a.children.push(e),Hi(a,r);t>=0&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(r,n,t)},Bi.prototype._split=function(e,t){var i=e[t],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);var a=this._chooseSplitIndex(i,n,r),o=tr(i.children.splice(a,i.children.length-a));o.height=i.height,o.leaf=i.leaf,Ui(i,this.toBBox),Ui(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(i,o)},Bi.prototype._splitRoot=function(e,t){this.data=tr([e,t]),this.data.height=e.height+1,this.data.leaf=!1,Ui(this.data,this.toBBox)},Bi.prototype._chooseSplitIndex=function(e,t,i){for(var r,n=1/0,a=1/0,o=t;o<=i-t;o++){var s=Wi(e,0,o,this.toBBox),l=Wi(e,o,i,this.toBBox),h=Zi(s,l),c=Ji(s)+Ji(l);h<n?(n=h,r=o,a=c<a?c:a):h===n&&c<a&&(a=c,r=o)}return r||i-t},Bi.prototype._chooseSplitAxis=function(e,t,i){var r=e.leaf?this.compareMinX:Yi,n=e.leaf?this.compareMinY:Xi;this._allDistMargin(e,t,i,r)<this._allDistMargin(e,t,i,n)&&e.children.sort(r)},Bi.prototype._allDistMargin=function(e,t,i,r){e.children.sort(r);for(var n=this.toBBox,a=Wi(e,0,t,n),o=Wi(e,i-t,i,n),s=$i(a)+$i(o),l=t;l<i-t;l++){var h=e.children[l];Hi(a,e.leaf?n(h):h),s+=$i(a)}for(var c=i-t-1;c>=t;c--){var u=e.children[c];Hi(o,e.leaf?n(u):u),s+=$i(o)}return s},Bi.prototype._adjustParentBBoxes=function(e,t,i){for(var r=i;r>=0;r--)Hi(t[r],e)},Bi.prototype._condense=function(e){for(var t=e.length-1,i=void 0;t>=0;t--)0===e[t].children.length?t>0?(i=e[t-1].children).splice(i.indexOf(e[t]),1):this.clear():Ui(e[t],this.toBBox)};var rr=Bi;function nr(e,t){if(t=Cesium.defaultValue(t,Cesium.defaultValue.EMPTY_OBJECT),this.show=Cesium.defaultValue(t.show,!0),this._scene=e,!Cesium.defined(this._scene))throw new Cesium.RuntimeError("必须传入Scene.");this._enabled=Cesium.defaultValue(t.enabled,!0),this._labelFilterFunction=Cesium.defaultValue(t.labelFilterFunction,null),this._guid=Cesium.createGuid(),this._primitives=[],this._rbush=void 0,this._removeEventListener=void 0,this._cacheEntityMap={},this._rBushRefreshTime=100,this._rBushRefreshFunction=null,this._rBushDitry=!0,this.init()}function ar(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function or(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function sr(e,t){let i=e.data;if(!or(t,i))return;const r=[];for(;i;){for(let n=0;n<i.children.length;n++){const a=i.children[n],o=i.leaf?e.toBBox(a):a;if(or(t,o)){if(i.leaf||ar(t,o))return o;r.push(a)}}i=r.pop()}}function lr(e,t){const i=e.canvas.clientWidth,r=e.canvas.clientHeight,n=t.maxX,a=t.maxY,o=t.minX,s=t.minY;return o>i&&s>r||n<0&&a<0}function hr(e,t){let i;if(e instanceof Cesium.Billboard){if(!e||!e.color)return;if(e.show&&t&&e.color.alpha>=1)return;if(!t&&e.color.alpha<=0)return;e._labelRaq&&window.cancelAnimationFrame(e._labelRaq),function r(n){if(e){let n=e.color.alpha;t?(e.show=!0,(n+=.06)>=1?(n=1,e.color=e.color.withAlpha(n),window.cancelAnimationFrame(i)):(e.color=e.color.withAlpha(n),i=window.requestAnimationFrame(r),e._labelRaq=i)):(n-=.06)<=0?(e.show=!1,n=0,e.color=e.color.withAlpha(n),window.cancelAnimationFrame(i)):(e.color=e.color.withAlpha(n),i=window.requestAnimationFrame(r),e._labelRaq=i)}}()}else e.show=t}function cr(e){return e instanceof Cesium.BillboardCollection?Array.isArray(e._billboards)?e._billboards.slice(0).filter(function(e){return e?!e._isInitEntityVisualizer:e}):[]:e instanceof Cesium.LabelCollection?Array.isArray(e._labels)?e._labels.slice(0).filter(function(e){return e?!e._isInitEntityVisualizer:e}):[]:e instanceof Cesium.PrimitiveCollection&&Array.isArray(e._primitives)?e._primitives.slice(0).filter(function(e){return e?!e._isInitEntityVisualizer:e}):[]}nr.prototype.init=function(){Cesium.defined(this._scene)&&(this._rbush=new rr,this._initUpdateFunction(),this._removeEventListener=this._scene.camera.changed.addEventListener(()=>{this._rBushDitry=!0}))},nr.prototype._initUpdateFunction=function(){return this._rBushRefreshFunction?this._rBushRefreshFunction:(this._rBushRefreshFunction=Object(n.throttle)(()=>{try{this._rBushDitry=!1,this._updateVisual()}catch(e){console.error(e)}},this._rBushRefreshTime,this),this._rBushRefreshFunction)},nr.prototype.add=function(e,t,i){const r=Cesium.defined(t);if(!Cesium.defined(e))throw new Cesium.DeveloperError("primitive is required.");if(r){if(t<0)throw new Cesium.DeveloperError("index must be greater than or equal to zero.");if(t>this._primitives.length)throw new Cesium.DeveloperError("index must be less than or equal to the number of primitives.")}const n=e._external=e._external||{};return(n._composites=n._composites||{})[this._guid]={collection:this},r?this._primitives.splice(t,0,e):this._primitives.push(e),e._dynamicEntityVisualizer_uuid||(e._dynamicEntityVisualizer_uuid=Cesium.createGuid()),this._cacheEntityMap[e._dynamicEntityVisualizer_uuid]={itemCollection:cr(e),zIndex:Cesium.defined(i)?i:0},e},nr.prototype.remove=function(e){const t=this._primitives.indexOf(e);t>-1&&(this._primitives.splice(t,1),delete this._cacheEntityMap[e._dynamicEntityVisualizer_uuid])},nr.prototype.setLabelVisible=function(e,t){e&&(e.notRendering=!t)},nr.prototype.getLabelVisible=function(e){return!e||e.notRendering},nr.prototype.removeAll=function(){const e=this._primitives,t=e.length;for(let i=0;i<t;++i)delete e[i]._external._composites[this._guid],e[i].destroy();this._primitives=[],this._cacheEntityMap={}},nr.prototype._forceVisual=function(){this._rBushRefreshFunction()},nr.prototype._updateVisual=function(){const e=this._scene;if(!e)return;const t=this._rbush;if(t){t.clear();const i=this._primitives,r=this;i.sort(function(e,t){let i=0,n=0;const a=r._cacheEntityMap[e._dynamicEntityVisualizer_uuid],o=r._cacheEntityMap[t._dynamicEntityVisualizer_uuid];return a&&Cesium.defined(a.zIndex)&&(i=a.zIndex),o&&Cesium.defined(o.zIndex)&&(n=o.zIndex),n-i}),i.forEach(function(i,n){const a=r._cacheEntityMap[i._dynamicEntityVisualizer_uuid];(a?a.itemCollection:[]).forEach(function(e){e instanceof Cesium.Billboard&&e._imageIndexPromise?e._imageIndexPromise.then(function(){e._isInitEntityVisualizer=!0}):e._isInitEntityVisualizer=!0}),function(e,t,i){let r=i._billboards||i._labels||i._primitives||[];const n=!!(i instanceof Cesium.PrimitiveCollection),a=e.camera.computeViewRectangle();if(a){const{east:e,north:t,south:i,west:o}=a,s=[180*o/Math.PI,180*e/Math.PI],l=[180*i/Math.PI,180*t/Math.PI];r=r.filter(e=>{if(e&&e.__latLng__){const t=e.__latLng__;return!!(t&&t[0]>s[0]&&t[0]<s[1]&&t[1]>l[0]&&t[1]<l[1])||(n?e.show=!1:hr(e,!1),!1)}return!0})}if(i instanceof Cesium.BillboardCollection||i instanceof Cesium.LabelCollection){const i=e.camera.position,n=(r=function(e,t){return e.slice(0).sort(function(e,i){const r=e&&e.position?Cesium.Cartesian3.distance(t,e.position):0,n=i&&i.position?Cesium.Cartesian3.distance(t,i.position):0;return r-n})}(r,i)).length;for(let i=0;i<n;++i){const n=r[i];if(n&&n.computeScreenSpacePosition){const i=new Cesium.Cartesian2;if(n.computeScreenSpacePosition(e,i),i){let r=new Cesium.BoundingRectangle;if(r=n instanceof Cesium.Label?Cesium.Label.getScreenSpaceBoundingBox(n,i,r):Cesium.Billboard.getScreenSpaceBoundingBox(n,i,r),isNaN(r.width)||isNaN(r.height)){hr(n,!1);continue}if(n.notRendering){hr(n,!1);continue}const a={minX:r.x,maxX:r.x+r.width,minY:r.y,maxY:r.y+r.height,data:n};if(lr(e,a)||Math.abs(a.minX-a.maxX)<3||Math.abs(a.minY-a.maxY)<3){hr(n,!1);continue}const o=sr(t,a);o?hr(n,!1):(hr(n,!0),t.insert(a))}}}}else if(i instanceof Cesium.PrimitiveCollection){const r=i._primitives||[];r.forEach(function(i){if(i instanceof Cesium.GroundPrimitive&&i._cacheGroundRect){if(i.notRendering)return void(i.show=!1);const r=i._cacheGroundRect.east,n=i._cacheGroundRect.west,a=i._cacheGroundRect.north,o=i._cacheGroundRect.south,s=[[r,a],[r,o],[n,a],[n,o]];let l,h,c,u;s.forEach(function(t){const i=Cesium.Cartographic.fromRadians(t[0],t[1],0),r=Cesium.Cartographic.toCartesian(i),n=Cesium.SceneTransforms.wgs84ToWindowCoordinates(e,r);n&&(Cesium.defined(l)||(l=n.x),Cesium.defined(h)||(h=n.y),Cesium.defined(c)||(c=n.x),Cesium.defined(u)||(u=n.y),n.x>l&&(l=n.x),n.x<c&&(c=n.x),n.y>h&&(h=n.y),n.y<u&&(u=n.y))});const d={minX:c,maxX:l,minY:u,maxY:h,data:i};if(!(Cesium.defined(c)&&Cesium.defined(l)&&Cesium.defined(u)&&Cesium.defined(h)))return void(d.data.show=!1);if(lr(e,d)||Math.abs(c-l)<3||Math.abs(u-h)<3)return void(d.data.show=!1);const p=sr(t,d);p?d.data.show=!1:(t.insert(d),d.data.show=!0)}})}}(e,t,i)})}},Object.defineProperties(nr.prototype,{}),nr.prototype.update=function(e){if(!this.show)return;const t=this;this._primitives.forEach(function(e){const i=cr(e);i.forEach(function(e){e.show=!1});const r=t._cacheEntityMap[e._dynamicEntityVisualizer_uuid];r&&(r.itemCollection=i,0!==i.length&&(t._rBushDitry=!0))}),this._rBushDitry&&this._rBushRefreshFunction(),this._primitives.forEach(function(t){t.update(e)})},nr.prototype.isDestroyed=function(){return!1},nr.prototype.destroy=function(){this.removeAll()};var ur=nr;class dr{constructor(e){if(e=Object(n.defaultValue)(e,{}),this._scene=e.scene,!this._scene)throw new Error("缺少场景对象Scene");if(this._opacity=Object(n.defaultValue)(e.opacity,1),this._visible=Object(n.defaultValue)(e.visible,!0),this._swipeEnabled=Object(n.defaultValue)(e.swipeEnabled,!1),this._swipeInverse=Object(n.defaultValue)(e.swipeInverse,0),this._labelingInfo=Object(n.defaultValue)(e.labelingInfo,[new n.LabelClass]),(!Array.isArray(e.labelingInfo)||Array.isArray(e.labelingInfo)&&0===e.labelingInfo.length)&&(this._labelingInfo=[new n.LabelClass]),!Array.isArray(this._labelingInfo)||this._labelingInfo.length<=0)throw new Error("缺少动态注记样式参数");this._collection=null,this._dynamicEntityVisualizer=null,this._initCollection()}_initCollection(){const e=this._scene,t=this._labelingInfo[0],{renderMode:i,deconflictionStrategy:r="static"}=t;let n;switch(i){case"label":n=new Cesium.LabelCollection({blendOption:Cesium.BlendOption.OPAQUE_AND_TRANSLUCENT,scene:e,swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse});break;case"ground":n=new Cesium.PrimitiveCollection({swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse});break;default:n=new Cesium.BillboardCollection({blendOption:Cesium.BlendOption.OPAQUE_AND_TRANSLUCENT,scene:e,swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse})}dr.dynamicEntityVisualizer||(dr.dynamicEntityVisualizer=new ur(e),e.primitives.add(dr.dynamicEntityVisualizer)),"static"===r?(this._dynamicEntityVisualizer=dr.dynamicEntityVisualizer,this._collection=this._dynamicEntityVisualizer.add(n)):this._collection=e.primitives.add(n),this._collection.show=this._visible}add(e,t){return Vi.renderLabel(this._collection,e,t||this._labelingInfo[0])}remove(e){Vi.removeLabels(this._collection,e)}createLabels(e,t){return Vi.createLabels(this._collection,e,t||this._labelingInfo[0])}addLabels(e){const t=[];if(!e||!Array.isArray(e))return t;for(let i=0;i<e.length;i++)this._collection.contains(e[i])||t.push(this._collection.add(e[i]));return t}removeLabels(e){if(e&&Array.isArray(e))for(let t=0;t<e.length;t++)this._collection.contains(e[t])&&this._collection.remove(e[t])}destroyed(){this._dynamicEntityVisualizer?this._dynamicEntityVisualizer.remove(this._collection):this._scene.primitives.remove(this._collection),this._collection=null}}Object.defineProperties(dr.prototype,{show:{get(){return this._visible},set(e){this._visible=e,this._collection&&(this._collection.show=e)}},translucency:{get(){return this._opacity},set(e){this._opacity=e}},swipeEnabled:{get(){return this._swipeEnabled},set(e){"boolean"==typeof e&&(this._swipeEnabled=e,this._collection.swipeEnabled=e)}},swipeInverse:{get(){return this._swipeInverse},set(e){"number"==typeof e&&(this._swipeInverse=e,this._collection.swipeInverse=e)}}});var pr=dr;class fr{constructor(e){e=Cesium.defaultValue(e,Cesium.defaultValue.EMPTY_OBJECT),this._ellipsoid=Cesium.defaultValue(e.ellipsoid,Cesium.Ellipsoid.WGS84),e.wkt?this._wkt=e.wkt:e.wkid?this._wkid=e.wkid:this._wkt=n.Projection.getEPSGByWKID(3857).strProject,this.isGeographic()&&(this._geographicProjection=new Cesium.GeographicProjection(this._ellipsoid))}project(e,t){if(!Cesium.defined(e))throw new Cesium.DeveloperError("必须传入cartographic");let i;t=t||{};const r=[Cesium.Math.toDegrees(e.longitude),Cesium.Math.toDegrees(e.latitude)],a=(i=n.Projection.projectPoints({points:[r],originWKID:4326,targetWKID:this._wkid,targetDefs:this._wkt})[0])[0],o=i[1],s=e.height;return this.isGeographic()&&this._geographicProjection.project({longitude:i[0],latitude:i[1],height:e.height},t),Cesium.defined(t)?(t.x=a,t.y=o,t.z=s,t):new Cesium.Cartesian3(a,o,s)}unproject(e,t){if(!Cesium.defined(e))throw new Cesium.DeveloperError("必须传入cartesian");let i;t=t||{},this.isGeographic()?this._geographicProjection.unproject(e,i):i=[e.x,e.y],t=n.Projection.isCustomWKID(this._wkid)?n.Projection.projectPoints({points:[i],originWKID:this._wkid,targetWKID:4326})[0]:n.Projection.projectPoints({points:[i],originDefs:this._wkt,targetWKID:4326})[0];const r=Cesium.Math.toRadians(t[0]),a=Cesium.Math.toRadians(t[1]),o=e.z;return Cesium.defined(t)?(t.longitude=r,t.latitude=a,t.height=o,t):new Cesium.Cartographic(r,a,o)}isGeographic(){return!!(this._wkid&&[4326,4490,4610,4214,n.CustomWKID.bd09ll,n.CustomWKID.gcj02ll].includes(this._wkid)||this._wkt&&(/^GEOGCS/.test(this.wkt)||/^[+]proj=longlat/.test(this._wkt)))}}Object.defineProperties(fr.prototype,{ellipsoid:{get(){return this._ellipsoid}},wkt:{get(){return this._wkt}},wkid:{get(){return this._wkid}}});var mr=fr;class yr{constructor(e){if(e=Cesium.defaultValue(e,Cesium.defaultValue.EMPTY_OBJECT),this._ellipsoid=Cesium.defaultValue(e.ellipsoid,Cesium.Ellipsoid.WGS84),!Cesium.defined(e.wkt)&&!Cesium.defined(e.wkid))throw new Cesium.DeveloperError("必须传入wkt或wkid");var t,i,r,a;this._wkt=e.wkt,this._wkid=e.wkid,this._tileInfo=e.tileInfo,this._axisDirection=Cesium.defaultValue(e.axisDirection,{x:1,y:-1}),n.Projection.isCustomWKID(this._wkid)?this._projection=new mr({ellipsoid:this._ellipsoid,wkid:this._wkid}):(this._projection=new mr({ellipsoid:this._ellipsoid,wkt:this._wkt,proj4:e.proj4}),t=e.rectangleSouthwest,i=e.rectangleNortheast,this._rectangleSouthwest=e.rectangleSouthwest,this._rectangleNortheast=e.rectangleNortheast);this._tileInfo.lods[0].resolution;if(this._tileSize={width:this._tileInfo.size[0],height:this._tileInfo.size[1]},this._transformOrigin={x:this._tileInfo.origin.coordinates[0],y:this._tileInfo.origin.coordinates[1]},e.rectangleSouthwest&&e.rectangleNortheast){const n=this._tileInfo.lods[0].level,o=function(e,t){const i=this.getResolutionAtLevel(t);return{x:Math.floor(this._axisDirection.x*(e.x-this._transformOrigin.x)/(this._tileSize.width*i)),y:Math.floor(-this._axisDirection.y*(this._transformOrigin.y-e.y)/(this._tileSize.height*i))}}.bind(this),s=function(e,t,i){const r=this.getResolutionAtLevel(i);let n,a,o,s;return this._axisDirection.x>0?(n=this._transformOrigin.x+e*(this._tileSize.width*r),o=this._transformOrigin.x+(e+1)*(this._tileSize.width*r)):(n=this._transformOrigin.x-(e+1)*(this._tileSize.width*r),o=this._transformOrigin.x-e*(this._tileSize.width*r)),this._axisDirection.y<0?(a=this._transformOrigin.y-(t+1)*(this._tileSize.height*r),s=this._transformOrigin.y-t*(this._tileSize.height*r)):(a=this._transformOrigin.y+t*(this._tileSize.height*r),s=this._transformOrigin.y+(t+1)*(this._tileSize.height*r)),{west:n,south:a,east:o,north:s}}.bind(this),l=e.rectangleSouthwest,h=e.rectangleNortheast,c=new Cesium.Cartesian2(l.x,h.y),u=new Cesium.Cartesian2(h.x,l.y),d=o(l,n),p=s(d.x,d.y,n),f=o(h,n),m=s(f.x,f.y,n),y=o(c,n),g=s(y.x,y.y,n),v=o(u,n),b=s(v.x,v.y,n);t=new Cesium.Cartesian2(p.west,p.south),i=new Cesium.Cartesian2(m.east,m.north),r=new Cesium.Cartesian2(g.west,g.north),a=new Cesium.Cartesian2(b.east,b.south)}else{if(this.isGeographic())t=new Cesium.Cartesian2(-180,-90),i=new Cesium.Cartesian2(180,90);else{const e=this._ellipsoid.maximumRadius*Math.PI;t=new Cesium.Cartesian2(-e,-e),i=new Cesium.Cartesian2(e,e)}r=new Cesium.Cartesian2(t.x,i.y),a=new Cesium.Cartesian2(i.x,t.y),this._rectangleSouthwest=Cesium.Cartesian2.clone(t),this._rectangleNortheast=Cesium.Cartesian2.clone(i)}(this.isGeographic()||this.isWebMercator())&&this.scratchProjectionBounds(t,i);let o,s,l,h,c=void 0,u=void 0,d=void 0,p=void 0;if(this.isGeographic()&&!n.Projection.isCustomWKID(this._wkid)?(c={longitude:Cesium.Math.toRadians(t.x),latitude:Cesium.Math.toRadians(t.y)},u={longitude:Cesium.Math.toRadians(i.x),latitude:Cesium.Math.toRadians(i.y)},d={longitude:Cesium.Math.toRadians(r.x),latitude:Cesium.Math.toRadians(r.y)},p={longitude:Cesium.Math.toRadians(a.x),latitude:Cesium.Math.toRadians(a.y)}):(c=this._projection.unproject(t),u=this._projection.unproject(i),d=this._projection.unproject(r),p=this._projection.unproject(a)),Cesium.defined(this._tileInfo)&&!(this.isGeographic()||isFinite(p.longitude)&&isFinite(p.latitude))){const t=Cesium.Math.toRadians(Cesium.Math.toDegrees(this.getNumberOfXTilesAtLevel(this._tileInfo.lods[0].level)*(this._tileInfo.lods[0].resolution*this._tileSize.width)/this._ellipsoid.maximumRadius));p=this._projection.unproject(new Cesium.Cartesian2(e.rectangleNortheast.x,e.rectangleSouthwest.y)).clone(),u.longitude=c.longitude+t}this.isGeographic()&&!n.Projection.isCustomWKID(this._wkid)?(o={longitude:Cesium.Math.toRadians(e.rectangleSouthwest.x),latitude:Cesium.Math.toRadians(e.rectangleSouthwest.y)},s={longitude:Cesium.Math.toRadians(e.rectangleNortheast.x),latitude:Cesium.Math.toRadians(e.rectangleNortheast.y)},l={longitude:Cesium.Math.toRadians(e.rectangleSouthwest.x),latitude:Cesium.Math.toRadians(e.rectangleNortheast.y)},h={longitude:Cesium.Math.toRadians(e.rectangleNortheast.x),latitude:Cesium.Math.toRadians(e.rectangleSouthwest.y)}):(o=this._projection.unproject(e.rectangleSouthwest),s=this._projection.unproject(e.rectangleNortheast),l=this._projection.unproject(new Cesium.Cartesian2(e.rectangleSouthwest.x,e.rectangleNortheast.y)),h=this._projection.unproject(new Cesium.Cartesian2(e.rectangleNortheast.x,e.rectangleSouthwest.y)));const f=Math.min(c.longitude,d.longitude,o.longitude,l.longitude),m=Math.min(c.latitude,p.latitude,o.latitude,h.latitude),y=Math.max(u.longitude,p.longitude,s.longitude,h.longitude),g=Math.max(u.latitude,d.latitude,s.latitude,l.latitude);this._rectangle=new Cesium.Rectangle(f,m,y,g)}getNumberOfXTilesAtLevel(e){let t=1;const i=this.getResolutionAtLevel(e);return 0===(t=Math.round(Math.abs(this._rectangleNortheast.x-this._rectangleSouthwest.x)/(this._tileSize.width*i)))?1:t}getNumberOfYTilesAtLevel(e){let t=1;const i=this.getResolutionAtLevel(e);return 0===(t=Math.round(Math.abs(this._rectangleNortheast.y-this._rectangleSouthwest.y)/(this._tileSize.height*i)))?1:t}rectangleToNativeRectangle(e,t){const i=this._projection,r=i.project(Cesium.Rectangle.southwest(e)),n=i.project(Cesium.Rectangle.northeast(e));return Cesium.defined(t)?(t.west=r.x,t.south=r.y,t.east=n.x,t.north=n.y,t):new Cesium.Rectangle(r.x,r.y,n.x,n.y)}tileXYToNativeRectangle(e,t,i,r){const n=new Cesium.Rectangle,a=this.getResolutionAtLevel(i);return this._axisDirection.x>0?(n.west=this._transformOrigin.x+e*(this._tileSize.width*a),n.east=this._transformOrigin.x+(e+1)*(this._tileSize.width*a)):(n.west=this._transformOrigin.x-(e+1)*(this._tileSize.width*a),n.east=this._transformOrigin.x-e*(this._tileSize.width*a)),this._axisDirection.y<0?(n.south=this._transformOrigin.y-(t+1)*(this._tileSize.height*a),n.north=this._transformOrigin.y-t*(this._tileSize.height*a)):(n.south=this._transformOrigin.y+t*(this._tileSize.height*a),n.north=this._transformOrigin.y+(t+1)*(this._tileSize.height*a)),Cesium.defined(r)?(r.west=n.west,r.south=n.south,r.east=n.east,r.north=n.north,r):n}tileXYToRectangle(e,t,i,r){const a=this.tileXYToNativeRectangle(e,t,i,r);if(!isFinite(a.height)||!isFinite(a.width))return this._rectangle;if(this.isGeographic()&&!n.Projection.isCustomWKID(this._wkid))a.west=Cesium.Math.toRadians(a.west),a.south=Cesium.Math.toRadians(a.south),a.east=Cesium.Math.toRadians(a.east),a.north=Cesium.Math.toRadians(a.north);else{const e=this._projection,t=e.unproject(new Cesium.Cartesian2(a.west,a.north)),i=e.unproject(new Cesium.Cartesian2(a.east,a.south));a.west=t.longitude,a.south=i.latitude,a.east=i.longitude,a.north=t.latitude}return isFinite(a.height)&&isFinite(a.width)?a:this._rectangle}positionToTileXY(e,t,i){let r=void 0;const a=new Cesium.Cartesian2;if(this.isGeographic()&&!n.Projection.isCustomWKID(this._wkid))r={x:Cesium.Math.toDegrees(e.longitude),y:Cesium.Math.toDegrees(e.latitude)};else{r=this._projection.project(e)}const o=this.getResolutionAtLevel(t),s=this._axisDirection.x*(r.x-this._transformOrigin.x)/(this._tileSize.width*o),l=-this._axisDirection.y*(this._transformOrigin.y-r.y)/(this._tileSize.height*o);return a.x=Math.floor(s),a.y=Math.floor(l),Math.abs(s)<Math.pow(10,-8)&&(a.x=0),Math.abs(l)<Math.pow(10,-8)&&(a.y=0),Cesium.defined(i)?(i.x=a.x,i.y=a.y,i):a}getResolutionAtLevel(e){const t=this._tileInfo.lods.find((t,i)=>i===e);return t?t.resolution:void 0}getTileLevelByResolution(e){let t=0,i=0;if(this._tileInfo&&this._tileInfo.lods.length>1)if(Math.abs(e-this._tileInfo.lods[0].resolution)<Math.pow(10,-7))t=this._tileInfo.lods[0].level,i=0;else if(e<this._tileInfo.lods[this._tileInfo.lods.length-1].resolution)t=this._tileInfo.lods[this._tileInfo.lods.length-1].level,i=this._tileInfo.lods.length-1;else for(let r=0;r<this._tileInfo.lods.length-1;r++){const n=this._tileInfo.lods[r],a=this._tileInfo.lods[r+1];if(e<=n.resolution&&e>a.resolution){const o=(n.resolution-e)/(n.resolution-a.resolution);t=o<.5?n.level:n.level+1,i=o<.5?r:r+1;break}}return i}isGeographic(){return!!(this.wkid&&[4326,4490,4610,4214,n.CustomWKID.bd09ll,n.CustomWKID.gcj02ll].includes(this._wkid)||this.wkt&&(/^GEOGCS/.test(this.wkt)||/^[+]proj=longlat/.test(this.wkt)))}isWebMercator(){return[3857,102113,102100,900913,n.CustomWKID.bd09mc,n.CustomWKID.gcj02mc].includes(this._wkid)}scratchProjectionBounds(e,t){let i=void 0;this.isGeographic()?i=new Cesium.Rectangle(-180,-90,180,90):this.isWebMercator()&&(i=new Cesium.Rectangle(-20037508.34,-20037508.34,20037508.34,20037508.34)),e.x=Cesium.Math.clamp(e.x,i.west,i.east),e.y=Cesium.Math.clamp(e.y,i.south,i.north),t.x=Cesium.Math.clamp(t.x,i.west,i.east),t.y=Cesium.Math.clamp(t.y,i.south,i.north)}}Object.defineProperties(yr.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}},wkid:{get:function(){return this._wkid}},wkt:{get:function(){return this._wkt}}});var gr=yr;var vr=class extends n.LayerView{onAdd(){return new Promise(e=>{this.innerLayer=[],wr.addSceneLayer(this,t=>{this.innerLayer=t,e(this)})})}onRemove(){return wr.removeLayer(this),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t],{params:r=[]}=i;if(i){let e;switch(i.name){case"visible":wr.setVisible(r[0],this);break;case"sbuLayerVisible":wr.setSubLayerVisible(r[0],r[1],this);break;case"opacity":wr.setOpacity(r[0],this);break;case"subLayerOpacity":wr.setSubLayerOpacity(r[0],r[1],this);break;case"renderer":e=this.view.getInnerLayer(this.layer);const t=i.params[0],n=i.params[1];for(let i=0;i<e.length;i++)n===e[i].id&&(e[i].renderer=Ql(t));break;case"reset":wr.reset(r[0],this);break;case"labelingInfo":wr.removeLayer(this),wr.addSceneLayer(this,e=>{this.innerLayer=e})}}}return Promise.resolve(this)}};class br{}function _r(e,t){e.scene.terrainProvider=new Cesium.EllipsoidTerrainProvider,setTimeout(()=>{e.scene.terrainProvider=t},0)}br.addSceneLayer=function(e,t,i){const{layer:r,innerView:a,view:o}=e,s=r.activeScene.allSublayers;let l=0;const h=[];s.forEach(t=>{switch(t.type){case n.SceneSubLayerType.label:const s=br.toPrimitive(t,a,e),{_labelLayer:c}=s;c.id=t.id,h.push(c),l++;break;case n.SceneSubLayerType.mapRef:const u=br.initializeOptions(t,a);u.show=t.visible*e._getLayerViewVisible(r.visible);const d=function(e,t){const i=(e=Object(n.defaultValue)(e,{})).url||"";let r=void 0;i.includes("/igs/rest/g3d/")?r=Jl.addWebTileLayer(e,t):i.includes("/igs/rest/services/")&&i.includes("/SceneServer")&&(e._url=i,r=lh.addIGSMapImageLayer(e,t));return r}(u,a);h.push(d),l++;break;case n.SceneSubLayerType.model:case n.SceneSubLayerType.modelCache:const p=br.initializeOptions(t,a),f={};f.show=p.show,p.show=t.visible*e._getLayerViewVisible(r.visible),th(p,a,o,function(e){l++,h.push(e),e._backupProperties=f,e._backupProperties.translucency=e.translucency;const i=t.opacity*r.opacity;i<1&&i>=0&&(e.translucency=i),p.autoReset&&ih(e.boundingSphere,p,a)},i)}});const c=br.addTerrainService(e);c&&(h.push(c),l++);const u=setInterval(function(){l===s.items.length&&t&&t instanceof Function&&(clearInterval(u),t(h))},50)},br.toTerrainProvider=function(e){let t=void 0;if(e.type===n.SceneSubLayerType.terrain){const i=br.initializeOptions(e);t=new Mr(i)}return t},br.initTerrainProvider=function(e,t){const{innerView:i,view:r}=e,a=[];let o;t=Object(n.defaultValue)(t,[]);const{allLayerViews:s}=r;let l=[];const h=[];if(l.push(e),(l=l.concat(s._items)).forEach(e=>{t.indexOf(e)<0&&h.push(e)}),h.forEach(e=>{if(e instanceof vr){e.layer.activeScene.allSublayers.forEach(e=>{e.type===n.SceneSubLayerType.terrain&&a.push(e)})}}),a.length>0){const e=br.initializeOptions(a[0]),t=[];a.forEach(e=>{const i=br.initializeOptions(e);t.push({url:i.url,range:i.range,range3D:i.range3D,requestVertexNormals:i.requestVertexNormals})}),e.url=t,o=new Mr(e),i.scene.terrainProvider=o}return o},br.addTerrainService=function(e,t){const{innerView:i,view:r}=e;let a=[];t=Object(n.defaultValue)(t,[]);let o=void 0;if(!e.layer)return;const s=Object(n.defaultValue)(e.layer.visible,!0);if((a=br.getAllTerrainLayers(e)).length>0){const e=br.initializeOptions(a[0]),t=[];a.forEach(e=>{const{url:i,range:r,range3D:n,requestVertexNormals:a,show:o}=br.initializeOptions(e);t.push({url:i,range:r,range3D:n,requestVertexNormals:a,show:o&&s})}),i.scene.terrainProvider instanceof Cesium.EllipsoidTerrainProvider?(e.url=void 0,e.serviceList=t,o=new Mr(e),i.scene.terrainProvider=o):((o=i.scene.terrainProvider)._serviceList.push(e),o.addService(e),_r(i,o))}return o},br.getAllTerrainLayers=function(e){const t=[];if(e instanceof vr){e.layer.activeScene.allSublayers.forEach(e=>{e.type===n.SceneSubLayerType.terrain&&t.push(e)})}return t},br.toPrimitive=function(e,t,i){const r=br.initializeOptions(e,t,i);switch(e.type){case n.SceneSubLayerType.label:const t=r._dynamicEntityVisualizer?r._dynamicEntityVisualizer:r._collection;return t._labelLayer=r,t;case n.SceneSubLayerType.model:case n.SceneSubLayerType.modelCache:return new Cesium.MapGISM3DSet(r)}},br.initializeOptions=function(e,t,i){switch(e.type){case n.SceneSubLayerType.terrain:let r=function(e){const t={},i=e.range,r={xMin:i.xmin,yMin:i.ymin,xMax:i.xmax,yMax:i.ymax},a=e.range3D,o={xMin:a.xmin,yMin:a.ymin,xMax:a.xmax,yMax:a.ymax,zMin:a.zmin,zMax:a.zmax};return t.id=Object(n.defaultValue)(e.id,void 0),t.scale=Object(n.defaultValue)(e.elevationScale,void 0),t.range=r,t.range3D=o,t.requestVertexNormals=Object(n.defaultValue)(e.requestVertexNormals,!1),t.sceneIndex=e.layer&&void 0!==e.layer.sceneIndex?e.layer.sceneIndex:0,t.layerIndex=Object(n.defaultValue)(e.layerIndex,0),t.layerRenderIndex=Object(n.defaultValue)(e.layerRenderIndex,0),t.show=Object(n.defaultValue)(e.visible,!0),t.autoReset=Object(n.defaultValue)(e.autoReset,!0),t.url=e.layer.url,t}(e);r=Object.assign(r,e.extendOptions);const{sceneIndex:a,layerIndex:o,layerRenderIndex:s,requestVertexNormals:l,url:h}=r;return h.includes("/SceneServer")?r.url=`${h}/layers/${o}/terrains?level={z}&row={x}&col={y}&xDensity=65&yDensity=65&hasNormals=${l}`:r.url=`${h}/GetTerrain?sceneIndex=${a}&layerIndex=${s}&Level={z}&Row={x}&Col={y}&xdensity=65&ydensity=65&webGL=true&hasNormals=${l}`,r;case n.SceneSubLayerType.label:{let r=e.layer.url,a=e.layer.sceneIndex;r=r.includes("/SceneServer")?`${r}/layers/${e.layerIndex}/labels?level=0&row=0&col=0&format=json&srsName=EPSG:4326`:`${r}/GetLabels?sceneIndex=${a}&layerIndex=${e.layerRenderIndex}&level=0&row=0&col=0&format=json&srsName=EPSG:4326`;const{labelLayer:o,labelingInfo:s,opacity:l}=e,h={labelLayer:o,labelingInfo:s,opacity:l,visible:e.visible&&i._getLayerViewVisible(e.layer.visible)};return function(e,t,i,r){t=Object(n.defaultValue)(t,{}),i=Object(n.defaultValue)(i,{});const a=Object(n.defaultValue)(i.labelingInfo,[]),o=Object(n.defaultValue)(i.visible,!0),s=Object(n.defaultValue)(i.opacity,1),l=r.scene,h=Object(n.defaultValue)(i.layerInfo,{}),c=Object(n.defaultValue)(h.symbolScale,1),u=new Cesium.Resource({url:e}),d=new pr({scene:l,visible:o,opacity:s,labelingInfo:a});return u.fetchJson().then(e=>{Array.isArray(e)&&e.forEach(e=>{const t=Object(n.defaultValue)(e.dot,{}),i=Object(n.defaultValue)(t.x,0),r=Object(n.defaultValue)(t.y,0),o=Object(n.defaultValue)(t.z,0),s=function(e,t,i){Object(n.defaultValue)(e.dot,{});const r=Object(n.defaultValue)(e.geoAnno,{}),a="rgb("+Object(n.defaultValue)(r.color,"255,255,255")+")",o=Object(n.defaultValue)(r.font,"宋体"),s=Object(n.defaultValue)(r.offsetx,0),l=Object(n.defaultValue)(r.offsety,0),h=Object(n.defaultValue)(r.size,20)*t,c=Object(n.defaultValue)(r.text,"");let u=Object(n.defaultValue)(r.italic?"italic":"normal","normal");const d=Object(n.defaultValue)(r.italicType,0),p=Object(n.defaultValue)(r.bold?"bold":"normal","normal"),f=Object(n.defaultValue)(r.angle,0),m=Object(n.defaultValue)(r.shadow,!1),y=Object(n.defaultValue)(r.hollow,!1),g=Object(n.defaultValue)(r.outLine,!1),v=Object(n.defaultValue)(r.strikeOut,!1),b=Object(n.defaultValue)(r.underLine,!1),_=Object(n.defaultValue)(r.space,0),w=Object(n.defaultValue)(r.back,!1),x="rgb("+Object(n.defaultValue)(r.backClr,"255,255,255")+")",C=Object(n.defaultValue)(r.backExp,0);0!==d&&(u="italic ");const S=!1,M="rgb(191, 191, 191)",k=2,T=1,I=1;(m||g)&&(S=!0,g&&(M=x,k=C,T=0,I=0));let O=new n.LabelClass({symbol:{color:y?"rgba(255,255,255,0)":Object(n.defaultValue)(a,"rgba(255,255,255,1)"),haloColor:y?a:"rgba(255,255,255,0)",haloSize:1,lineHeight:1.1,xoffset:s,yoffset:l,angle:f,font:{size:h,family:o,weight:p,style:u},text:c,letterSpacing:_,backgroundColor:w?x:void 0,backgroundPadding:[C,C],textDecorationUnderlineColor:b?a:void 0,textDecorationUnderlineWidth:b?1:0,textDecorationThroughlineColor:v?a:void 0,textDecorationThroughlineWidth:v?1:0,textShadowOffsetX:T,textShadowOffsetY:I,textShadowColor:S?M:void 0,textShadowBlur:k},renderMode:"canvas"});if(i){let e=O.symbol.toJSON();const t=i.symbol?i.symbol:{};(e=Object.assign({},e,t)).text=c;let r=O.toJSON();(r=Object.assign({},r,i)).symbol=e,O=new n.LabelClass(r)}return O}(e,c,Array.isArray(a)&&a.length>0?a[0]:void 0);d.add([new n.Feature({geometry:new n.Point({coordinates:[i,r,o]})})],s)})}),d.type="label",d}(r,e.extendOptions,h,t)}case n.SceneSubLayerType.mapRef:return function(e){let t={};t.spatialReference=Object(n.defaultValue)(e.spatialReference,void 0),t.id=Object(n.defaultValue)(e.id,void 0),t.show=Object(n.defaultValue)(e.visible,!0),t.layerIndex=Object(n.defaultValue)(e.layerIndex,0),t.layerRenderIndex=Object(n.defaultValue)(e.layerRenderIndex,0),t.igserver=!0,t.renderer=Ql(e.renderer),t.translucency=e.opacity,t.sceneIndex=e.layer&&void 0!==e.layer.sceneIndex?e.layer.sceneIndex:0;const i=e.layer.url,r=function(e){let t="";e.includes("/igs/rest/g3d/")?t="g3d":e.includes("/igs/rest/services/")&&e.includes("/SceneServer")&&(t="sceneserver");return t}(i);if("g3d"===r){t.url=`${i}/GetCovering?sceneIndex=${t.sceneIndex}&&layerIndex=${e.layerRenderIndex}&level={z}&row={y}&col={x}`;const{tileInfo:r,extent:a}=function(e){let t=void 0,i=void 0;const r=e.range,a=Math.round((r.xmax-r.xmin)/e.maxFrameSize.wid),o=Math.round((r.ymax-r.ymin)/e.maxFrameSize.hel),s=r.xmin,l=r.ymax,h=s+a*e.maxFrameSize.wid,c=l-o*e.maxFrameSize.hel;t=new n.Extent({xmin:s,ymin:c,xmax:h,ymax:l,spatialReference:r.spatialReference});const u=new n.Point({coordinates:[s,c],spatialReference:r.spatialReference});return i=n.TileInfoUtil.createCommonTileInfo({extent:t,origin:u,numberOfMinLevelTilesX:a}),{extent:t,tileInfo:i}}(e);t.tileInfo=r,t.extent=a,t.tileSliceType="tms"}else"sceneserver"===r&&(t.extent=e.range,t.spatialReference=e.spatialReference,t.httpMethod=e.httpMethod,t.imageWidth=e.imageWidth,t.imageHeight=e.imageHeight,t.url=`${i}/layers/${e.layerIndex}/coverings`);return t}(e);case n.SceneSubLayerType.model:case n.SceneSubLayerType.modelCache:const c=eh(e);return c.url=e.layer.url,c.url.includes("/igs/rest/g3d/")?c.url=`${c.url}/GetDataStreams?sceneIndex=${e.layer.sceneIndex}&layerIndex=${e.layerRenderIndex}&Level=0&Row=0&Col=0`:c.url.includes("/igs/rest/services/")&&c.url.includes("/SceneServer"),c.headers&&(c.url=new Cesium.Resource({url:c.url,headers:c.headers})),t&&(c._scene=t.scene),c}},br.removeLayer=function(e){let{innerLayer:t}=e;const{innerView:i}=e;for(let e=0;e<t.length;e++)t[e]instanceof Cesium.MapGISM3DSet?i.scene.primitives.removeAndDestroy(t[e]):t[e]instanceof pr?t[e].destroyed():t[e]instanceof Cesium.ImageryLayer?i.scene.imageryLayers.remove(t[e]):t[e]instanceof Mr&&(t[e]=new Cesium.EllipsoidTerrainProvider,i.scene.terrainProvider=t[e]);t=[]},br.setVisible=function(e,t){const{innerLayer:i,innerView:r}=t,n=t._getLayerViewVisible(e);for(let a=0;a<i.length;a++)if(i[a]instanceof Cesium.MapGISM3DSet)i[a].show=i[a]._backupProperties.show&&n;else if(i[a]instanceof pr)i[a].show=n;else if(i[a]instanceof Cesium.ImageryLayer)i[a].show=n;else if(i[a]instanceof Mr)if(!0===e)br.addTerrainService(t);else if(!1===e){const e=[];br.getAllTerrainLayers(t).forEach(t=>{e.push(br.initializeOptions(t))}),i[a].removeServices(e),_r(r,i[a])}},br.setSubLayerVisible=function(e,t,i){const{innerLayer:r,layer:n,innerView:a}=i,o=e&&n.visible,s=i._getLayerViewVisible(o);for(let n=0;n<r.length;n++)if(String(r[n].id)===String(t)){if(r[n]instanceof Cesium.MapGISM3DSet)r[n].show=s,r[n]._backupProperties.show=e;else if(r[n]instanceof pr)r[n].show=s;else if(r[n]instanceof Cesium.ImageryLayer)r[n].show=s;else if(r[n]instanceof Mr)if(!0===e)br.addTerrainService(i);else if(!1===e){const e=[];br.getAllTerrainLayers(i).forEach(t=>{e.push(br.initializeOptions(t))}),r[n].removeServices(e),_r(a,r[n])}break}},br.setOpacity=function(e,t){const{innerLayer:i}=t;for(let t=0;t<i.length;t++)i[t]instanceof Cesium.MapGISM3DSet&&(i[t].translucency=i[t]._backupProperties.translucency*e)},br.setSubLayerOpacity=function(e,t,i){const{innerLayer:r,layer:n}=i;for(let i=0;i<r.length;i++)if(String(r[i].id)===String(t)){r[i]instanceof Cesium.MapGISM3DSet&&(r[i].translucency=e*n.opacity,r[i]._backupProperties.translucency=e);break}},br.reset=function(e,t){const{innerLayer:i,innerView:r}=t;for(let t=0;t<i.length;t++)if(String(i[t].id)===String(e)){ih(i[t].boundingSphere,{},r);break}};var wr=br;function xr(e,t,i,r){let n;if(1===e.length)n=e[0];else for(let a=0;a<e.length;++a){const o=e[a];if(o.availability&&o.availability.isTileAvailable(t,i,r)){n=o;break}}return n}var Cr=class{constructor(e){this._layers=Object(n.defaultValue)(e,[])}addAvailableTileRange(e,t,i,r,n){const a=xr(this._layers,e,(t+r)/2,(i+n)/2);a&&a.availability.addAvailableTileRange(e,t,i,r,n)}computeMaximumLevelAtPosition(e){let t=0;for(let i=0;i<this._layers.length&&!((t=this._layers[i].availability.computeMaximumLevelAtPosition(e))>0);i++);return t}computeBestAvailableLevelOverRectangle(e){let t=0;for(let i=0;i<this._layers.length&&!((t=this._layers[i].availability.computeBestAvailableLevelOverRectangle(e))>0);i++);return t}isTileAvailable(e,t,i){const r=xr(this._layers,e,t,i);return!!r&&r.availability.isTileAvailable(e,t,i)}computeChildMaskForTile(e,t,i){const r=this._getLayerToUse(e,t,i);let n=0;return r&&(n=r.availability.computeChildMaskForTile(e,t,i)),n}_getLayerToUse(e,t,i){let r;if(1===this._layers.length)r=this._layers[0];else for(let n=0;n<this._layers.length;++n){const a=this._layers[n];if(a.availability&&a.availability.isTileAvailable(e,t,i)){r=a;break}}return r}};class Sr{constructor(e){this.url=Object(n.defaultValue)(e.url,void 0),this.range=Object(n.defaultValue)(e.range,void 0),this.range3D=Object(n.defaultValue)(e.range3D,void 0),this.proxy=Object(n.defaultValue)(e.proxy,void 0),this.maxLevel=Object(n.defaultValue)(e.maxLevel,20),this.terrainColorTblInfo=Object(n.defaultValue)(e.terrainColorTblInfo,void 0),this.terrainColorTblMinHeight=Object(n.defaultValue)(e.terrainColorTblMinHeight,void 0),this.terrainColorTblMaxHeight=Object(n.defaultValue)(e.terrainColorTblMaxHeight,void 0),this.id=Object(n.defaultValue)(e.id,void 0),this._tilingScheme=Object(n.defaultValue)(e.tilingScheme,new Cesium.GeographicTilingScheme),this._requestVertexNormals=Object(n.defaultValue)(e.requestVertexNormals,!1),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._heightmapStructure={heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535},this._ready=!1,this._readyPromise=new Promise((e,t)=>{}),this._layers=[];const t=Object(n.defaultValue)(e.serviceList,[]);this._serviceList=Object(n.cloneObject)(t),this.show=Object(n.defaultValue)(e.show,!0),this._repeat=Object(n.defaultValue)(e.repeat,new Cesium.Cartesian2(1,1)),this._layerToUse=void 0,this._availability=void 0;let i=Object(n.defaultValue)(e.credit,void 0);"string"==typeof i&&(i=new Cesium.Credit(i)),this._credit=i,this._init()}static async fromUrl(e,t){const i=new n.IGSSceneLayer({url:e}),r=(await i.load()).activeScene.sublayers.items;let a=void 0;for(let e=0;e<r.length;e++)if(r[e].type===n.SceneSubLayerType.terrain){const i=wr.initializeOptions(r[e]);a=new Sr({...i,...t})}return a}requestTileGeometry(e,t,i,r){if(this._ready||n.Log.error("必须等待地形图层初始化完毕后才能请求地形瓦片数据!"),0===i&&0===e&&0===t||0===i&&1===e&&0===t)return Promise.resolve(this._getEmptyHeightMap());if(1===this._layers.length)this._layerToUse=this._layers[0];else for(let r=0;r<this._layers.length;++r){const n=this._layers[r];if(n.availability&&n.availability.isTileAvailable(i,e,t)){this._layerToUse=n;break}}if(!Cesium.defined(this._layerToUse))return this._getDefaultHeightMapData();0===this._layerToUse.tileUrlTemplates.length&&n.Log.error("请求地形数据的接口模板没有设置!");const a=this._getRequestHeader();let o=this._tilingScheme.getNumberOfYTilesAtLevel(i)-t-1,s=this._layerToUse.resource.url.replace("{z}",i).replace("{x}",e).replace("{y}",o),l=this._layerToUse.resource.getDerivedResource({url:s,headers:a,request:r,proxy:this.proxy}).fetchArrayBuffer();return Cesium.defined(l)?l.then(e=>{if(1===e.byteLength){"@"===new TextDecoder("utf-8").decode(e)&&(e=new Uint16Array(this._heightmapWidth*this._heightmapWidth))}return this._createHeightMapByTerrainData(e)}):void 0}_getDefaultHeightMapData(){const e=new Uint16Array(this._heightmapWidth*this._heightmapWidth);return this._createHeightMapByTerrainData(e)}getLevelMaximumGeometricError(e){return this._levelZeroMaximumGeometricError/(1<<e)}getTileDataAvailable(e,t,i){let r=!1;for(let n=0;n<this._layers.length;n++){const a=this._layers[n].availability;if(a&&a.isTileAvailable(i,e,t)){r=!0;break}}return r}loadTileDataAvailability(e,t,i){function r(e,t,i,r){if(0!==r){var n=e.availabilityLevels,a=r%n==0?r-n:(r/n|0)*n,o=1<<r-a;return{level:a,x:t/o|0,y:i/o|0}}}var n=xr(this._layers,i,e,t);if(!(!n.availability||i>n._availability._maximumLevel||n._availability.isTileAvailable(i,e,t))&&this.hasMetadata){var a=function(e,t,i,n,a){if(!a.availabilityLevels)return{result:!1};for(var o,s=function(){delete a.availabilityPromiseCache[o]},l=a.availabilityTilesLoaded,h=a.availability,c=r(a,t,i,n);c;){if(h.isTileAvailable(c.level,c.x,c.y)&&!l.isTileAvailable(c.level,c.x,c.y)){let t;if(o=c.level+"-"+c.x+"-"+c.y,!(t=a.availabilityPromiseCache[o])){var u=new Request({throttle:!1,throttleByServer:!0,type:Cesium.RequestType.TERRAIN});(t=e.requestTileGeometry(e,c.x,c.y,c.level,u))&&(a.availabilityPromiseCache[o]=t,t.then(s))}return{result:!0,promise:t}}c=r(a,c.x,c.y,c.level)}return{result:!1}}(this,e,t,i,n);return a.promise?a.promise:void 0}}_init(){if(this.url){const e={url:this.url,maxLevel:this.maxLevel,requestVertexNormals:this._requestVertexNormals,range:this.range,tilingScheme:this._tilingScheme,show:this.show};this._serviceList.push(e),this.addService(e)}else this._serviceList instanceof Array&&this._serviceList.length>0&&(this._combineRange("2D"),this._combineRange("3D"),this._formatRange(this.range),this._serviceList.forEach(e=>{this.addService(e)}));this._availability=new Cr(this._layers)}addService(e){this._combineRange("2D"),this._combineRange("3D"),this._formatRange(this.range);const t=Object(n.defaultValue)(e.maxLevel,this.maxLevel),i=Object(n.defaultValue)(e.range,this.range),r=Object(n.defaultValue)(e.url,void 0),a=Object(n.defaultValue)(e.show,!0);this._customTerrainInfo({url:r,tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"],maxzoom:t,requestVertexNormals:Object(n.defaultValue)(e.requestVertexNormals,this._requestVertexNormals),available:this._calcAvailability(i,t,this._tilingScheme),show:a})}removeServices(e){const t=[];e.forEach(e=>{const i=this._removeServiceFromServiceList(e);i>-1&&t.push(i)})}removeService(e){_removeServiceFromServiceList}_removeServiceFromServiceList(e){let t=-1;return this._serviceList.forEach((i,r)=>{i.url===e.url&&(t=r)}),t>-1&&(this._serviceList.splice(t,1),this._layers.splice(t,1)),t}_combineRange(e){e=Object(n.defaultValue)(e,"2D");const t=[];if(this._serviceList.forEach(i=>{let r;(r="2D"===e?i.range:i.range3D)&&t.push(r)}),t.length>0){let i,r,n,a=t[0].xMin,o=t[0].xMax,s=t[0].yMin,l=t[0].yMax;"3D"===e&&(i=t[0].zMin,r=t[0].zMax),t.forEach(t=>{t.xMin<a&&(a=t.xMin),t.xMax>o&&(o=t.xMax),t.yMin<s&&(s=t.yMin),t.yMax>l&&(l=t.yMax),"3D"===e&&(t.zMin<i&&(i=t.zMin),t.zMax>r&&(r=t.zMax))}),(n="2D"===e?this.range:this.range3D)?(a<n.xMin&&(n.xMin=a),o>n.xMax&&(n.xMax=o),s<n.yMin&&(n.yMin=s),l>n.yMax&&(n.yMax=l),"3D"===e&&(i<n.zMin&&(n.yMin=s),r>n.zMax&&(n.zMax=r))):"2D"===e?this.range={xMin:a,xMax:o,yMin:s,yMax:l}:this.range3D={xMin:a,xMax:o,yMin:s,yMax:l,zMin:i,zMax:r}}else this.range||n.Log.error("地形二维范围不存在!")}_customTerrainInfo(e){const{tiles:t,available:i,requestVertexNormals:r}=e,n=new Cesium.TileAvailability(this._tilingScheme,i.length);for(let e=0;e<i.length;++e){let t=i[e];for(let i=0;i<t.length;++i){let r=t[i];n.addAvailableTileRange(e,r.startX,r.startY,r.endX,r.endY)}}const a=Cesium.Resource.createIfNeeded(e.url);a.queryParameters.hasOwnProperty("hasNormals")||(a.queryParameters.hasNormals=r),this._layers.push(this._initTerrainLayer({resource:a,version:e.version,isHeightmap:!0,tileUrlTemplates:t,availability:n,hasVertexNormals:this.hasVertexNormals,littleEndianExtensionSize:!0})),this._ready=!0,this._readyPromise=new Promise((e,t)=>{e()})}_formatRange(e){(e.yMin<-84||e.yMin>84)&&(e.yMin=-84),e.yMax>84&&(e.yMax=84),e.xMax>180&&(e.xMax=180),(e.xMin<-180||e.xMin>180)&&(e.xMin=-180)}_calcAvailability(e,t,i){let r,n,a,o=Cesium.Cartographic.fromDegrees(e.xMin,e.yMin,new Cesium.Cartographic),s=Cesium.Cartographic.fromDegrees(e.xMax,e.yMax,new Cesium.Cartographic),l=[[{endX:1,endY:0,startX:0,startY:0}]];for(let e=1;e<t;++e)n=i.positionToTileXY(o,e),a=i.positionToTileXY(s,e),r={startX:n.x,startY:a.y,endX:a.x,endY:n.y},l.push([r]);return l}_getEmptyHeightMap(){return new Cesium.HeightmapTerrainData({buffer:new Uint16Array(this._heightmapWidth*this._heightmapWidth),width:this._heightmapWidth,height:this._heightmapWidth})}_initTerrainLayer(e){return{resource:e.resource,version:e.version,isHeightmap:e.isHeightmap,tileUrlTemplates:e.tileUrlTemplates,availability:e.availability,hasVertexNormals:e.hasVertexNormals,hasMetadata:e.hasMetadata,availabilityLevels:e.availabilityLevels,availabilityTilesLoaded:e.availabilityTilesLoaded,littleEndianExtensionSize:e.littleEndianExtensionSize,availabilityPromiseCache:{},show:e.show}}_getRequestHeader(){return{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}_createHeightMapByTerrainData(e){let t,i,r;const n=this._heightmapWidth*this._heightmapWidth*Uint16Array.BYTES_PER_ELEMENT+Uint16Array.BYTES_PER_ELEMENT;if(t=e.byteLength>n?new Float32Array(e,0,this._heightmapWidth*this._heightmapWidth):new Uint16Array(e,0,this._heightmapWidth*this._heightmapWidth),this.hasVertexNormals){i=new Uint8Array(this._heightmapWidth*this._heightmapWidth*2);const t=(this._heightmapWidth*this._heightmapWidth+1)*Float32Array.BYTES_PER_ELEMENT;r=new Uint8Array(e,t,(this._heightmapWidth+2)*(this._heightmapWidth+2)*2);for(let e=0;e<this._heightmapWidth;e++)for(let t=0;t<this._heightmapWidth;t++){const n=e*this._heightmapWidth+t,a=(e+1)*(this._heightmapWidth+2)+t+1;i[2*n]=r[2*a],i[2*n+1]=r[2*a+1]}}return new Cesium.HeightmapTerrainData({buffer:t,width:this._heightmapWidth,height:this._heightmapWidth,structure:this._heightmapStructure,encodedNormals:i,childTileMask:15,repeat:this._repeat})}}Object.defineProperties(Sr.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._ready||n.Log.error("credit must not be called before the terrain provider is ready."),this._credit}},tilingScheme:{get:function(){return this._ready||n.Log.error("tilingScheme must not be called before the terrain provider is ready."),this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},hasMetadata:{get:function(){return this._ready||n.Log.error("hasMetadata must not be called before the terrain provider is ready."),!0}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},repeat:{get:function(){return this._repeat},set:function(e){this._repeat=e}},availability:{get:function(){return this._ready&&this._layerToUse||n.Log.error("必须等待地形图层初始化完毕后才能请求地形瓦片数据!"),this._availability}}});var Mr=Sr;class kr{static isGeographic(e){let t=!1;return(e instanceof Cesium.GeographicProjection||e.isGeographic&&e.isGeographic())&&(t=!0),t}}class Tr{constructor(e){e=Object(n.defaultValue)(e,{});const t=Object(n.defaultValue)(e.headers,{}),i=Object.assign({},e);i.extensions=[];const r=Object(n.defaultValue)(e.extensions,[]),a=Object(n.defaultValue)(e.url,"");let o;(o=a instanceof Cesium.Resource?a:new Cesium.Resource({url:a})).headers=t,r&&r instanceof Array&&(e.tokenKey&&e.tokenValue&&r.push({key:e.tokenKey,value:e.tokenValue}),r.forEach(e=>{e&&(o.queryParameters[e.key]=e.value)})),i.url=o;const s=new Cesium.ArcGisMapServerImageryProvider(i);return s._transparent=e.transparent,s._format=e.format,s.requestImage=((e,t,i,r)=>{if(!s._ready)throw new Cesium.DeveloperError("requestImage must not be called before the imagery provider is ready.");return Cesium.ImageryProvider.loadImage(s,this._buildImageResource(s,e,t,i,r))}),s}static async fromUrl(e,t){const i=new n.ArcGISMapImageLayer({url:e}),r=await i.load(),a=Er.initializeOptions(r),o=new Tr({...a,...t});return Cesium.defined(o._resource)||(o._resource=Cesium.Resource.createIfNeeded(e),o._resource.appendForwardSlash()),o}_buildImageResource(e,t,i,r,n){let a;if(e._useTiles)a=e._resource.getDerivedResource({url:"tile/"+r+"/"+i+"/"+t,request:n,queryParameters:e._resource.queryParameters});else{const o=e._tilingScheme.tileXYToNativeRectangle(t,i,r),s={bbox:o.west+","+o.south+","+o.east+","+o.north,size:e._tileWidth+","+e._tileHeight,format:e._format,transparent:e._transparent,f:"image"};kr.isGeographic(e._tilingScheme.projection)?(s.bboxSR=4326,s.imageSR=4326):(s.bboxSR=3857,s.imageSR=3857),e.layers&&(s.layers="show:"+e.layers);const l=Object.assign(e._resource.queryParameters,s);a=e._resource.getDerivedResource({url:"export",request:n,queryParameters:l})}return a}}var Ir=Tr;class Or{}Or.addArcGISMapImageLayer=function(e,t){const i=Or.initializeOptions(e),r=Kl(e,t),n=new Ir(i);Cesium.defined(n._resource)||(n._resource=Cesium.Resource.createIfNeeded(i.url),n._resource.appendForwardSlash());const a=t.imageryLayers.addImageryProvider(n,r);return a.id=e.id,a._realIndex=e._realIndex+1,a},Or.initializeOptions=function(e){const t=n.TileInfoUtil.createCommonTileInfo({extent:e.extent,tileSize:e.imageWidth}),i=$l(e.spatialReference,e.extent,t),r=Zl(e,i.rectangle),a=new Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax),{extendOptions:o={}}=e;let s={url:e.url,usePreCachedTilesIfAvailable:!1,layers:e.layers,tilingScheme:i,rectangle:a,headers:e.headers,tokenKey:e.tokenKey,tokenValue:e.tokenValue,transparent:e.imageTransparency,format:e.imageFormat};return s=Object.assign(s,o)},Or.removeLayer=function(e,t){t.imageryLayers.remove(e)};var Er=Or;class Lr{}Lr.addWMSLayer=function(e,t){const i=Lr.initializeOptions(e),r=Kl(e,t),n=t.scene.imageryLayers.addImageryProvider(new Cesium.WebMapServiceImageryProvider(i),r);return e.clippingArea&&rh(e,n,t),n.id=e.id,n._realIndex=e._realIndex+1,n},Lr.initializeOptions=function(e){const t=n.TileInfoUtil.createCommonTileInfo({extent:e.extent,tileSize:e.imageWidth}),i=$l(e.spatialReference,e.extent,t),r=Zl(e,i.rectangle),a=new Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax),o=Object(n.isWMSReverse)(e.version,e.spatialReference);let s=e.url;e.tokenKey&&e.tokenValue&&(s=`${s}?${e.tokenKey}=${e.tokenValue}`);let l={url:s,layers:e.layers,parameters:{format:e.imageFormat,transparent:e.imageTransparency,version:e.version},tilingScheme:i,tileWidth:e.imageWidth,tileHeight:e.imageHeight,srs:`EPSG:${e.spatialReference.wkid}`,crs:`EPSG:${e.spatialReference.wkid}`,isReverseBBOX:o,rectangle:a};const{extendOptions:h={}}=e;return l=Object.assign(l,h)},Lr.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var Pr=Lr;class Rr{}Rr.addArcGISTileLayer=function(e,t){const i=Rr.initializeOptions(e),r=Kl(e,t),n=t.imageryLayers.addImageryProvider(new Cesium.UrlTemplateImageryProvider(i),r);return n.id=e.id,n._realIndex=e._realIndex+1,n},Rr.initializeOptions=function(e){const t=$l(e.spatialReference,e.extent,e.tileInfo),i=Zl(e,t.rectangle),r=new Cesium.Rectangle(i.xmin,i.ymin,i.xmax,i.ymax);let n={url:`${e.url}/tile/{z}/{y}/{x}`,tilingScheme:t,tileWidth:e.tileInfo.cols,tileHeight:e.tileInfo.cols,rectangle:r};const{extendOptions:a={}}=e;return n=Object.assign(n,a)},Rr.removeLayer=function(e,t){t.imageryLayers.remove(e)};var jr=Rr;class Ar{constructor(e){e=Cesium.defaultValue(e,Cesium.defaultValue.EMPTY_OBJECT),this._imageVersion=Cesium.defaultValue(e.imageVersion,"0"),this._resource=Cesium.Resource.createIfNeeded(e.url),this._mapStyle=e.mapStyle,this._proxy=e.proxy,this._imageInfoUrl=e.url,this._url=e.url,this._tilingScheme=Cesium.defaultValue(e.tilingScheme,new Cesium.GeographicTilingScheme),this._rectangle=Cesium.defaultValue(e.rectangle,this._tilingScheme.rectangle),this._tileWidth=Cesium.defaultValue(e.tileWidth,256),this._tileHeight=Cesium.defaultValue(e.tileHeight,256),this._enablePickFeatures=Cesium.defaultValue(e.enablePickFeatures,!1),this._minimumLevel=Cesium.defaultValue(e.minimumLevel,0),this._maximumLevel=Cesium.defaultValue(e.maximumLevel,20),this.isStretchImage=Cesium.defaultValue(e.isStretchImage,!1),this._mapgisOffset=Cesium.defaultValue(e.mapgisOffset,0),this._buildImageResource=Cesium.defaultValue(e.buildImageResource,void 0),this._ready=!0,this._credit=Cesium.defaultValue(e.credit,new Cesium.Credit("MapGIS"))}static async fromUrl(e,t){const i=new n.IGSTileLayer({url:e}),r=await i.load(),a=Vr.initializeOptions(r);return new Ar({...a,...t})}buildImageResource(e,t,i,r){if(this._buildImageResource&&this._buildImageResource instanceof Function)return this._buildImageResource(this,e,t,i,r);let n=this._resource.url;return n.includes("/igs/rest/services/")&&n.includes("/TileServer")?(512!==this._tileWidth&&"mapgis-tianditu"!==this._mapStyle||(i+=1),n=`${this._resource.url}/tileImage/${i}/${t}/${e}/?f=image`):n=(n=(n=512===this._tileWidth||"mapgis-tianditu"===this._mapStyle?n.replace("{level}",i+1):n.replace("{level}",i)).replace("{row}",t)).replace("{col}",e),this._resource.getDerivedResource({url:n,request:r,proxy:this._proxy})}requestImage(e,t,i,r){return i+=this.mapgisOffset,Cesium.ImageryProvider.loadImage(this,this.buildImageResource(e,t,i,r))}pickFeatures(e,t,i){if(!this._enablePickFeatures)return;let r=this._imageInfoUrl.replace("{s}",(e+t)%4);r=(r=(r=r.replace("{row}",t)).replace("{col}",e)).replace("{level}",i),this._isHistoryImage&&(r=r.replace("{version}",this._imageVersion));return this._resource.getDerivedResource({url:r,queryParameters:{f:"json"}}).fetchJson().then(e=>{const t=[],i=e.results;if(!Cesium.defined(i))return t;for(let e=0;e<i.length;++e){const r=i[e],n=new Cesium.ImageryLayerFeatureInfo;n.data=r,n.name=r.value,n.properties=r.attributes,n.configureDescriptionFromProperties(r.attributes),t.push(n)}return t})}}Object.defineProperties(Ar.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},mapgisOffset:{get:function(){return this._mapgisOffset}},rectangle:{get:function(){return this._rectangle}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});var zr=Ar;class Dr{}Dr.addIGSTileLayer=function(e,t){const i=Dr.initializeOptions(e),r=Kl(e,t),n=t.imageryLayers.addImageryProvider(new zr(i),r);return e.clippingArea&&rh(e,n,t),n.id=e.id,n._realIndex=e._realIndex+1,n},Dr.initializeOptions=function(e){const t=e.tileInfo.clone(),i=t.lods;for(;i.length>0&&0!==i[0].level;){const e=i[0];i.unshift(n.LOD.fromJSON({level:e.level-1,resolution:2*e.resolution,scale:2*e.scale}))}const r=$l(e.spatialReference,e.extent,t),a=Zl(e,r.rectangle),o=new Cesium.Rectangle(a.xmin,a.ymin,a.xmax,a.ymax),[s,l]=n.TileInfoUtil.getLevelRangeByTileInfo(e.tileInfo);let h=e.url;"1.0"===e._igsVersion&&(h=`${e.url}/{level}/{row}/{col}`);let c={url:h,tileWidth:t.cols,tileHeight:t.cols,tilingScheme:r,rectangle:o,minimumLevel:s,maximumLevel:l};const{extendOptions:u={}}=e;return c=Object.assign(c,u)},Dr.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var Vr=Dr;class Nr{}Nr.addWMTSLayer=function(e,t){const i=Nr.initializeOptions(e),r=Kl(e,t),a=new Cesium.WebMapTileServiceImageryProvider(i);a.isStretchImage=Object(n.defaultValue)(i.isStretchImage,!1);const o=t.scene.imageryLayers.addImageryProvider(a,r);return e.clippingArea&&rh(e,o,t),o.id=e.id,o._realIndex=e._realIndex+1,o},Nr.initializeOptions=function(e){const t=e.getCurrentTileInfo();let i=$l(e.spatialReference,e.activeLayer.extent,t);e.spatialReference.isWebMercator?t.lods[0].resolution*t.size[0]>40075016.685574&&(i=new Cesium.WebMercatorTilingScheme):e.spatialReference.isGeographic&&t.lods[0].resolution*t.size[0]>180&&(i=new Cesium.GeographicTilingScheme);const r=Zl(e,i.rectangle),a=new Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax),[o,s]=n.TileInfoUtil.getLevelRangeByTileInfo(t);let l=e.url;e.tokenValue&&e.tokenKey&&(l+=`?${e.tokenKey}=${e.tokenValue}`);let h={url:l,layer:e.activeLayer.title,format:e.activeLayer.imageFormat,style:e.activeLayer.styleId,tileMatrixSetID:e.activeLayer.tileMatrixSetId,tilingScheme:i,tileWidth:t.size[0],tileHeight:t.size[1],rectangle:a,minimumLevel:o,maximumLevel:s};const{extendOptions:c={}}=e;return h=Object.assign(h,c)},Nr.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var Gr=Nr;function Fr(){return function(){throw new Error("Unimplemented abstract method.")}()}var Br=0;function qr(e){return e.ol_uid||(e.ol_uid=String(++Br))}var Ur="5.3.3",Wr=function(e){function t(t){var i="Assertion failed. See https://openlayers.org/en/"+("latest"===Ur?Ur:"v"+Ur.split("-")[0])+"/doc/errors/#"+t+" for details.";e.call(this,i),this.code=t,this.name="AssertionError",this.message=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error);function Hr(e,t){if(!e)throw new Wr(t)}var Yr=i(8),Xr=i.n(Yr),Jr="function"==typeof Object.assign?Object.assign:function(e,t){var i=arguments;if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(e),n=1,a=arguments.length;n<a;++n){var o=i[n];if(void 0!==o&&null!==o)for(var s in o)o.hasOwnProperty(s)&&(r[s]=o[s])}return r};function $r(e){for(var t in e)delete e[t]}function Kr(e){var t;for(t in e)return!1;return!t}function Zr(e,t,i){return Math.min(Math.max(e,t),i)}var Qr="cosh"in Math?Math.cosh:function(e){var t=Math.exp(e);return(t+1/t)/2};function en(e,t,i,r,n,a){var o=n-i,s=a-r;if(0!==o||0!==s){var l=((e-i)*o+(t-r)*s)/(o*o+s*s);l>1?(i=n,r=a):l>0&&(i+=o*l,r+=s*l)}return tn(e,t,i,r)}function tn(e,t,i,r){var n=i-e,a=r-t;return n*n+a*a}function rn(e,t,i){return e+i*(t-e)}var nn={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};
10
+ var r=i(13),n=i(6),a=i(14);function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,i){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return u(this,e)}return h(this,e,t,i)}function h(e,t,i,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,r){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===i&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,i):new Uint8Array(t,i,r);l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=d(e,t);return e}(e,t,i,r):"string"==typeof t?function(e,t,i){"string"==typeof i&&""!==i||(i="utf8");if(!l.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var r=0|f(t,i),n=(e=s(e,r)).write(t,i);n!==r&&(e=e.slice(0,n));return e}(e,t,i):function(e,t){if(l.isBuffer(t)){var i=0|p(t.length);return 0===(e=s(e,i)).length?e:(t.copy(e,0,0,i),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||function(e){return e!=e}(t.length)?s(e,0):d(e,t);if("Buffer"===t.type&&a(t.data))return d(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,t){if(c(t),e=s(e,t<0?0:0|p(t)),!l.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function d(e,t){var i=t.length<0?0:0|p(t.length);e=s(e,i);for(var r=0;r<i;r+=1)e[r]=255&t[r];return e}function p(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function f(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return F(e).length;default:if(r)return G(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function y(e,t,i,r,n){if(0===e.length)return-1;if("string"==typeof i?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=n?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(n)return-1;i=e.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:g(e,t,i,r,n);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):g(e,[t],i,r,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,i,r,n){var a,o=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,i/=2}function h(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var c=-1;for(a=i;a<s;a++)if(h(e,a)===h(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===l)return c*o}else-1!==c&&(a-=a-c),c=-1}else for(i+l>s&&(i=s-l),a=i;a>=0;a--){for(var u=!0,d=0;d<l;d++)if(h(e,a+d)!==h(t,d)){u=!1;break}if(u)return a}return-1}function v(e,t,i,r){i=Number(i)||0;var n=e.length-i;r?(r=Number(r))>n&&(r=n):r=n;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[i+o]=s}return o}function b(e,t,i,r){return B(G(t,e.length-i),e,i,r)}function _(e,t,i,r){return B(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,r)}function w(e,t,i,r){return _(e,t,i,r)}function x(e,t,i,r){return B(F(t),e,i,r)}function C(e,t,i,r){return B(function(e,t){for(var i,r,n,a=[],o=0;o<e.length&&!((t-=2)<0);++o)i=e.charCodeAt(o),r=i>>8,n=i%256,a.push(n),a.push(r);return a}(t,e.length-i),e,i,r)}function S(e,t,i){return 0===t&&i===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,i))}function M(e,t,i){i=Math.min(e.length,i);for(var r=[],n=t;n<i;){var a,o,s,l,h=e[n],c=null,u=h>239?4:h>223?3:h>191?2:1;if(n+u<=i)switch(u){case 1:h<128&&(c=h);break;case 2:128==(192&(a=e[n+1]))&&(l=(31&h)<<6|63&a)>127&&(c=l);break;case 3:a=e[n+1],o=e[n+2],128==(192&a)&&128==(192&o)&&(l=(15&h)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:a=e[n+1],o=e[n+2],s=e[n+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&h)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,u=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),n+=u}return function(e){var t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);var i="",r=0;for(;r<t;)i+=String.fromCharCode.apply(String,e.slice(r,r+=k));return i}(r)}t.Buffer=l,t.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},t.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=o(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,i){return h(null,e,t,i)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,i){return function(e,t,i,r){return c(t),t<=0?s(e,t):void 0!==i?"string"==typeof r?s(e,t).fill(i,r):s(e,t).fill(i):s(e,t)}(null,e,t,i)},l.allocUnsafe=function(e){return u(null,e)},l.allocUnsafeSlow=function(e){return u(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,r=t.length,n=0,a=Math.min(i,r);n<a;++n)if(e[n]!==t[n]){i=e[n],r=t[n];break}return i<r?-1:r<i?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var r=l.allocUnsafe(t),n=0;for(i=0;i<e.length;++i){var o=e[i];if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,n),n+=o.length}return r},l.byteLength=f,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?M(this,0,e):function(e,t,i){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,i);case"utf8":case"utf-8":return M(this,t,i);case"ascii":return T(this,t,i);case"latin1":case"binary":return I(this,t,i);case"base64":return S(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,i);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",i=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,i,r,n){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),t<0||i>e.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&t>=i)return 0;if(r>=n)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,r>>>=0,n>>>=0,this===e)return 0;for(var a=n-r,o=i-t,s=Math.min(a,o),h=this.slice(r,n),c=e.slice(t,i),u=0;u<s;++u)if(h[u]!==c[u]){a=h[u],o=c[u];break}return a<o?-1:o<a?1:0},l.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},l.prototype.indexOf=function(e,t,i){return y(this,e,t,i,!0)},l.prototype.lastIndexOf=function(e,t,i){return y(this,e,t,i,!1)},l.prototype.write=function(e,t,i,r){if(void 0===t)r="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)r=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}var n=this.length-t;if((void 0===i||i>n)&&(i=n),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return v(this,e,t,i);case"utf8":case"utf-8":return b(this,e,t,i);case"ascii":return _(this,e,t,i);case"latin1":case"binary":return w(this,e,t,i);case"base64":return x(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,i);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function T(e,t,i){var r="";i=Math.min(e.length,i);for(var n=t;n<i;++n)r+=String.fromCharCode(127&e[n]);return r}function I(e,t,i){var r="";i=Math.min(e.length,i);for(var n=t;n<i;++n)r+=String.fromCharCode(e[n]);return r}function O(e,t,i){var r=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>r)&&(i=r);for(var n="",a=t;a<i;++a)n+=N(e[a]);return n}function E(e,t,i){for(var r=e.slice(t,i),n="",a=0;a<r.length;a+=2)n+=String.fromCharCode(r[a]+256*r[a+1]);return n}function L(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,i,r,n,a){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<a)throw new RangeError('"value" argument is out of bounds');if(i+r>e.length)throw new RangeError("Index out of range")}function R(e,t,i,r){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-i,2);n<a;++n)e[i+n]=(t&255<<8*(r?n:1-n))>>>8*(r?n:1-n)}function j(e,t,i,r){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-i,4);n<a;++n)e[i+n]=t>>>8*(r?n:3-n)&255}function A(e,t,i,r,n,a){if(i+r>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function z(e,t,i,r,a){return a||A(e,0,i,4),n.write(e,t,i,r,23,4),i+4}function D(e,t,i,r,a){return a||A(e,0,i,8),n.write(e,t,i,r,52,8),i+8}l.prototype.slice=function(e,t){var i,r=this.length;if(e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),l.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,t)).__proto__=l.prototype;else{var n=t-e;i=new l(n,void 0);for(var a=0;a<n;++a)i[a]=this[a+e]}return i},l.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||L(e,t,this.length);for(var r=this[e],n=1,a=0;++a<t&&(n*=256);)r+=this[e+a]*n;return r},l.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||L(e,t,this.length);for(var r=this[e+--t],n=1;t>0&&(n*=256);)r+=this[e+--t]*n;return r},l.prototype.readUInt8=function(e,t){return t||L(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||L(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||L(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||L(e,t,this.length);for(var r=this[e],n=1,a=0;++a<t&&(n*=256);)r+=this[e+a]*n;return r>=(n*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||L(e,t,this.length);for(var r=t,n=1,a=this[e+--r];r>0&&(n*=256);)a+=this[e+--r]*n;return a>=(n*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||L(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(e,t){t||L(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(e,t){return t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||L(e,4,this.length),n.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||L(e,4,this.length),n.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||L(e,8,this.length),n.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||L(e,8,this.length),n.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,i,r){(e=+e,t|=0,i|=0,r)||P(this,e,t,i,Math.pow(2,8*i)-1,0);var n=1,a=0;for(this[t]=255&e;++a<i&&(n*=256);)this[t+a]=e/n&255;return t+i},l.prototype.writeUIntBE=function(e,t,i,r){(e=+e,t|=0,i|=0,r)||P(this,e,t,i,Math.pow(2,8*i)-1,0);var n=i-1,a=1;for(this[t+n]=255&e;--n>=0&&(a*=256);)this[t+n]=e/a&255;return t+i},l.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):j(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,i,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*i-1);P(this,e,t,i,n-1,-n)}var a=0,o=1,s=0;for(this[t]=255&e;++a<i&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+i},l.prototype.writeIntBE=function(e,t,i,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*i-1);P(this,e,t,i,n-1,-n)}var a=i-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+i},l.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):j(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,i){return z(this,e,t,!0,i)},l.prototype.writeFloatBE=function(e,t,i){return z(this,e,t,!1,i)},l.prototype.writeDoubleLE=function(e,t,i){return D(this,e,t,!0,i)},l.prototype.writeDoubleBE=function(e,t,i){return D(this,e,t,!1,i)},l.prototype.copy=function(e,t,i,r){if(i||(i=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<i&&(r=i),r===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-i&&(r=e.length-t+i);var n,a=r-i;if(this===e&&i<t&&t<r)for(n=a-1;n>=0;--n)e[n+t]=this[n+i];else if(a<1e3||!l.TYPED_ARRAY_SUPPORT)for(n=0;n<a;++n)e[n+t]=this[n+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+a),t);return a},l.prototype.fill=function(e,t,i,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,i=this.length):"string"==typeof i&&(r=i,i=this.length),1===e.length){var n=e.charCodeAt(0);n<256&&(e=n)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var a;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(a=t;a<i;++a)this[a]=e;else{var o=l.isBuffer(e)?e:G(new l(e,r).toString()),s=o.length;for(a=0;a<i-t;++a)this[a+t]=o[a%s]}return this};var V=/[^+\/0-9A-Za-z-_]/g;function N(e){return e<16?"0"+e.toString(16):e.toString(16)}function G(e,t){var i;t=t||1/0;for(var r=e.length,n=null,a=[],o=0;o<r;++o){if((i=e.charCodeAt(o))>55295&&i<57344){if(!n){if(i>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}n=i;continue}if(i<56320){(t-=3)>-1&&a.push(239,191,189),n=i;continue}i=65536+(n-55296<<10|i-56320)}else n&&(t-=3)>-1&&a.push(239,191,189);if(n=null,i<128){if((t-=1)<0)break;a.push(i)}else if(i<2048){if((t-=2)<0)break;a.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;a.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return a}function F(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function B(e,t,i,r){for(var n=0;n<r&&!(n+i>=t.length||n>=e.length);++n)t[n+i]=e[n];return n}}).call(this,i(5))},function(e,t,i){"use strict";t.byteLength=function(e){var t=h(e),i=t[0],r=t[1];return 3*(i+r)/4-r},t.toByteArray=function(e){var t,i,r=h(e),o=r[0],s=r[1],l=new a(function(e,t,i){return 3*(t+i)/4-i}(0,o,s)),c=0,u=s>0?o-4:o;for(i=0;i<u;i+=4)t=n[e.charCodeAt(i)]<<18|n[e.charCodeAt(i+1)]<<12|n[e.charCodeAt(i+2)]<<6|n[e.charCodeAt(i+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;2===s&&(t=n[e.charCodeAt(i)]<<2|n[e.charCodeAt(i+1)]>>4,l[c++]=255&t);1===s&&(t=n[e.charCodeAt(i)]<<10|n[e.charCodeAt(i+1)]<<4|n[e.charCodeAt(i+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t);return l},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,a=[],o=0,s=i-n;o<s;o+=16383)a.push(u(e,o,o+16383>s?s:o+16383));1===n?(t=e[i-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===n&&(t=(e[i-2]<<8)+e[i-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],n=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s<l;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function h(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function c(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function u(e,t,i){for(var r,n=[],a=t;a<i;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),n.push(c(r));return n.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(e,t){var i={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},function(e,t,i){"use strict";i.r(t);var r={};i.r(r),i.d(r,"createBillboard",function(){return qh}),i.d(r,"createLabel",function(){return Uh}),i.d(r,"createModelPrimitive",function(){return Wh}),i.d(r,"createObject3DAppearance",function(){return Hh}),i.d(r,"createSpherePrimitive",function(){return Yh}),i.d(r,"createCylinderPrimitive",function(){return Xh}),i.d(r,"getShadows",function(){return $h});var n=i(0),a=1,o=2,s=3,l=4,h=5,c=484813681109536e-20,u=Math.PI/2,d=.16666666666666666,p=.04722222222222222,f=.022156084656084655,m=1e-10,y=.017453292519943295,g=57.29577951308232,v=Math.PI/4,b=2*Math.PI,_=3.14159265359,w={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},x={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},C=/[\s_\-\/\(\)]/g;function S(e,t){if(e[t])return e[t];for(var i,r=Object.keys(e),n=t.toLowerCase().replace(C,""),a=-1;++a<r.length;)if((i=r[a]).toLowerCase().replace(C,"")===n)return e[i]}var M=function(e){var t,i,r,n={},a=e.split("+").map(function(e){return e.trim()}).filter(function(e){return e}).reduce(function(e,t){var i=t.split("=");return i.push(!0),e[i[0].toLowerCase()]=i[1],e},{}),o={proj:"projName",datum:"datumCode",rf:function(e){n.rf=parseFloat(e)},lat_0:function(e){n.lat0=e*y},lat_1:function(e){n.lat1=e*y},lat_2:function(e){n.lat2=e*y},lat_ts:function(e){n.lat_ts=e*y},lon_0:function(e){n.long0=e*y},lon_1:function(e){n.long1=e*y},lon_2:function(e){n.long2=e*y},alpha:function(e){n.alpha=parseFloat(e)*y},gamma:function(e){n.rectified_grid_angle=parseFloat(e)},lonc:function(e){n.longc=e*y},x_0:function(e){n.x0=parseFloat(e)},y_0:function(e){n.y0=parseFloat(e)},k_0:function(e){n.k0=parseFloat(e)},k:function(e){n.k0=parseFloat(e)},a:function(e){n.a=parseFloat(e)},b:function(e){n.b=parseFloat(e)},r:function(e){n.a=n.b=parseFloat(e)},r_a:function(){n.R_A=!0},zone:function(e){n.zone=parseInt(e,10)},south:function(){n.utmSouth=!0},towgs84:function(e){n.datum_params=e.split(",").map(function(e){return parseFloat(e)})},to_meter:function(e){n.to_meter=parseFloat(e)},units:function(e){n.units=e;var t=S(x,e);t&&(n.to_meter=t.to_meter)},from_greenwich:function(e){n.from_greenwich=e*y},pm:function(e){var t=S(w,e);n.from_greenwich=(t||parseFloat(e))*y},nadgrids:function(e){"@null"===e?n.datumCode="none":n.nadgrids=e},axis:function(e){3===e.length&&-1!=="ewnsud".indexOf(e.substr(0,1))&&-1!=="ewnsud".indexOf(e.substr(1,1))&&-1!=="ewnsud".indexOf(e.substr(2,1))&&(n.axis=e)},approx:function(){n.approx=!0}};for(t in a)i=a[t],t in o?"function"==typeof(r=o[t])?r(i):n[r]=i:n[t]=i;return"string"==typeof n.datumCode&&"WGS84"!==n.datumCode&&(n.datumCode=n.datumCode.toLowerCase()),n},k=function(e){return new j(e).output()},T=1,I=/\s/,O=/[A-Za-z]/,E=/[A-Za-z84_]/,P=/[,\]]/,R=/[\d\.E\-\+]/;function j(e){if("string"!=typeof e)throw new Error("not a string");this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=T}function A(e,t,i){Array.isArray(t)&&(i.unshift(t),t=null);var r=t?{}:e,n=i.reduce(function(e,t){return z(t,e),e},r);t&&(e[t]=n)}function z(e,t){if(Array.isArray(e)){var i=e.shift();if("PARAMETER"===i&&(i=e.shift()),1===e.length)return Array.isArray(e[0])?(t[i]={},void z(e[0],t[i])):void(t[i]=e[0]);if(e.length)if("TOWGS84"!==i){if("AXIS"===i)return i in t||(t[i]=[]),void t[i].push(e);var r;switch(Array.isArray(i)||(t[i]={}),i){case"UNIT":case"PRIMEM":case"VERT_DATUM":return t[i]={name:e[0].toLowerCase(),convert:e[1]},void(3===e.length&&z(e[2],t[i]));case"SPHEROID":case"ELLIPSOID":return t[i]={name:e[0],a:e[1],rf:e[2]},void(4===e.length&&z(e[3],t[i]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return e[0]=["name",e[0]],void A(t,i,e);default:for(r=-1;++r<e.length;)if(!Array.isArray(e[r]))return z(e,t[i]);return A(t,i,e)}}else t[i]=e;else t[i]=!0}else t[e]=!0}j.prototype.readCharicter=function(){var e=this.text[this.place++];if(4!==this.state)for(;I.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case T:return this.neutral(e);case 2:return this.keyword(e);case 4:return this.quoted(e);case 5:return this.afterquote(e);case 3:return this.number(e);case-1:return}},j.prototype.afterquote=function(e){if('"'===e)return this.word+='"',void(this.state=4);if(P.test(e))return this.word=this.word.trim(),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in afterquote yet, index '+this.place)},j.prototype.afterItem=function(e){return","===e?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=T)):"]"===e?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=T,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},j.prototype.number=function(e){if(!R.test(e)){if(P.test(e))return this.word=parseFloat(this.word),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in number yet, index '+this.place)}this.word+=e},j.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=5},j.prototype.keyword=function(e){if(E.test(e))this.word+=e;else{if("["===e){var t=[];return t.push(this.word),this.level++,null===this.root?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,void(this.state=T)}if(!P.test(e))throw new Error("havn't handled \""+e+'" in keyword yet, index '+this.place);this.afterItem(e)}},j.prototype.neutral=function(e){if(O.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(R.test(e))return this.word=e,void(this.state=3);if(!P.test(e))throw new Error("havn't handled \""+e+'" in neutral yet, index '+this.place);this.afterItem(e)},j.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};var D=.017453292519943295;function V(e){return e*D}var N=function(e){var t=k(e),i=t.shift(),r=t.shift();t.unshift(["name",r]),t.unshift(["type",i]);var n={};return z(t,n),function(e){if("GEOGCS"===e.type?e.projName="longlat":"LOCAL_CS"===e.type?(e.projName="identity",e.local=!0):"object"==typeof e.PROJECTION?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var t="",i=0,r=e.AXIS.length;i<r;++i){var n=[e.AXIS[i][0].toLowerCase(),e.AXIS[i][1].toLowerCase()];-1!==n[0].indexOf("north")||("y"===n[0]||"lat"===n[0])&&"north"===n[1]?t+="n":-1!==n[0].indexOf("south")||("y"===n[0]||"lat"===n[0])&&"south"===n[1]?t+="s":-1!==n[0].indexOf("east")||("x"===n[0]||"lon"===n[0])&&"east"===n[1]?t+="e":-1===n[0].indexOf("west")&&("x"!==n[0]&&"lon"!==n[0]||"west"!==n[1])||(t+="w")}2===t.length&&(t+="u"),3===t.length&&(e.axis=t)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),"metre"===e.units&&(e.units="meter"),e.UNIT.convert&&("GEOGCS"===e.type?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var a=e.GEOGCS;function o(t){return t*(e.to_meter||1)}"GEOGCS"===e.type&&(a=e),a&&(a.DATUM?e.datumCode=a.DATUM.name.toLowerCase():e.datumCode=a.name.toLowerCase(),"d_"===e.datumCode.slice(0,2)&&(e.datumCode=e.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==e.datumCode&&"new_zealand_1949"!==e.datumCode||(e.datumCode="nzgd49"),"wgs_1984"!==e.datumCode&&"world_geodetic_system_1984"!==e.datumCode||("Mercator_Auxiliary_Sphere"===e.PROJECTION&&(e.sphere=!0),e.datumCode="wgs84"),"_ferro"===e.datumCode.slice(-6)&&(e.datumCode=e.datumCode.slice(0,-6)),"_jakarta"===e.datumCode.slice(-8)&&(e.datumCode=e.datumCode.slice(0,-8)),~e.datumCode.indexOf("belge")&&(e.datumCode="rnb72"),a.DATUM&&a.DATUM.SPHEROID&&(e.ellps=a.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===e.ellps.toLowerCase().slice(0,13)&&(e.ellps="intl"),e.a=a.DATUM.SPHEROID.a,e.rf=parseFloat(a.DATUM.SPHEROID.rf,10)),a.DATUM&&a.DATUM.TOWGS84&&(e.datum_params=a.DATUM.TOWGS84),~e.datumCode.indexOf("osgb_1936")&&(e.datumCode="osgb36"),~e.datumCode.indexOf("osni_1952")&&(e.datumCode="osni52"),(~e.datumCode.indexOf("tm65")||~e.datumCode.indexOf("geodetic_datum_of_1965"))&&(e.datumCode="ire65"),"ch1903+"===e.datumCode&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93")),e.b&&!isFinite(e.b)&&(e.b=e.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",V],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",V],["x0","false_easting",o],["y0","false_northing",o],["long0","central_meridian",V],["lat0","latitude_of_origin",V],["lat0","standard_parallel_1",V],["lat1","standard_parallel_1",V],["lat2","standard_parallel_2",V],["azimuth","Azimuth"],["alpha","azimuth",V],["srsCode","name"]].forEach(function(t){return function(e,t){var i=t[0],r=t[1];!(i in e)&&r in e&&(e[i]=e[r],3===t.length&&(e[i]=t[2](e[i])))}(e,t)}),e.long0||!e.longc||"Albers_Conic_Equal_Area"!==e.projName&&"Lambert_Azimuthal_Equal_Area"!==e.projName||(e.long0=e.longc),e.lat_ts||!e.lat1||"Stereographic_South_Pole"!==e.projName&&"Polar Stereographic (variant B)"!==e.projName?!e.lat_ts&&e.lat0&&"Polar_Stereographic"===e.projName&&(e.lat_ts=e.lat0,e.lat0=V(e.lat0>0?90:-90)):(e.lat0=V(e.lat1>0?90:-90),e.lat_ts=e.lat1)}(n),n};function G(e){var t=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?G[e]=M(arguments[1]):G[e]=N(arguments[1]):G[e]=i}else if(1===arguments.length){if(Array.isArray(e))return e.map(function(e){Array.isArray(e)?G.apply(t,e):G(e)});if("string"==typeof e){if(e in G)return G[e]}else"EPSG"in e?G["EPSG:"+e.EPSG]=e:"ESRI"in e?G["ESRI:"+e.ESRI]=e:"IAU2000"in e?G["IAU2000:"+e.IAU2000]=e:console.log(e);return}}!function(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("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"),e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}(G);var F=G;var B=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var q=["3857","900913","3785","102113"];var U=function(e){if(!function(e){return"string"==typeof e}(e))return e;if(function(e){return e in F}(e))return F[e];if(function(e){return B.some(function(t){return e.indexOf(t)>-1})}(e)){var t=N(e);if(function(e){var t=S(e,"authority");if(t){var i=S(t,"epsg");return i&&q.indexOf(i)>-1}}(t))return F["EPSG:3857"];var i=function(e){var t=S(e,"extension");if(t)return S(t,"proj4")}(t);return i?M(i):t}return function(e){return"+"===e[0]}(e)?M(e):void 0},W=function(e,t){var i,r;if(e=e||{},!t)return e;for(r in t)void 0!==(i=t[r])&&(e[r]=i);return e},H=function(e,t,i){var r=e*t;return i/Math.sqrt(1-r*r)},Y=function(e){return e<0?-1:1},X=function(e){return Math.abs(e)<=_?e:e-Y(e)*b},$=function(e,t,i){var r=e*i,n=.5*e;return r=Math.pow((1-r)/(1+r),n),Math.tan(.5*(u-t))/r},J=function(e,t){for(var i,r,n=.5*e,a=u-2*Math.atan(t),o=0;o<=15;o++)if(i=e*Math.sin(a),a+=r=u-2*Math.atan(t*Math.pow((1-i)/(1+i),n))-a,Math.abs(r)<=1e-10)return a;return-9999};function K(e){return e}var Z=[{init:function(){var e=this.b/this.a;this.es=1-e*e,"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=H(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(e){var t,i,r=e.x,n=e.y;if(n*g>90&&n*g<-90&&r*g>180&&r*g<-180)return null;if(Math.abs(Math.abs(n)-u)<=m)return null;if(this.sphere)t=this.x0+this.a*this.k0*X(r-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(v+.5*n));else{var a=Math.sin(n),o=$(this.e,n,a);t=this.x0+this.a*this.k0*X(r-this.long0),i=this.y0-this.a*this.k0*Math.log(o)}return e.x=t,e.y=i,e},inverse:function(e){var t,i,r=e.x-this.x0,n=e.y-this.y0;if(this.sphere)i=u-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var a=Math.exp(-n/(this.a*this.k0));if(-9999===(i=J(this.e,a)))return null}return t=X(this.long0+r/(this.a*this.k0)),e.x=t,e.y=i,e},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:K,inverse:K,names:["longlat","identity"]}],Q={},ee=[];function te(e,t){var i=ee.length;return e.names?(ee[i]=e,e.names.forEach(function(e){Q[e.toLowerCase()]=i}),this):(console.log(t),!0)}var ie={start:function(){Z.forEach(te)},add:te,get:function(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==Q[t]&&ee[Q[t]]?ee[Q[t]]:void 0}},re={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"}},ne=re.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};re.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var ae={};ae.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ae.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ae.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},ae.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},ae.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},ae.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},ae.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},ae.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},ae.militargeographische_institut={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},ae.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ae.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},ae.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},ae.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},ae.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},ae.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},ae.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},ae.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},ae.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var oe=function(e,t,i,r,n,u,d){var p={};return p.datum_type=void 0===e||"none"===e?h:l,t&&(p.datum_params=t.map(parseFloat),0===p.datum_params[0]&&0===p.datum_params[1]&&0===p.datum_params[2]||(p.datum_type=a),p.datum_params.length>3&&(0===p.datum_params[3]&&0===p.datum_params[4]&&0===p.datum_params[5]&&0===p.datum_params[6]||(p.datum_type=o,p.datum_params[3]*=c,p.datum_params[4]*=c,p.datum_params[5]*=c,p.datum_params[6]=p.datum_params[6]/1e6+1))),d&&(p.datum_type=s,p.grids=d),p.a=i,p.b=r,p.es=n,p.ep2=u,p},se={};function le(e){if(0===e.length)return null;var t="@"===e[0];return t&&(e=e.slice(1)),"null"===e?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:se[e]||null,isNull:!1}}function he(e){return e/3600*Math.PI/180}function ce(e,t,i){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,i)))}function ue(e){return e.map(function(e){return[he(e.longitudeShift),he(e.latitudeShift)]})}function de(e,t,i){return{name:ce(e,t+8,t+16).trim(),parent:ce(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,i),upperLatitude:e.getFloat64(t+88,i),lowerLongitude:e.getFloat64(t+104,i),upperLongitude:e.getFloat64(t+120,i),latitudeInterval:e.getFloat64(t+136,i),longitudeInterval:e.getFloat64(t+152,i),gridNodeCount:e.getInt32(t+168,i)}}function pe(e,t,i,r){for(var n=t+176,a=[],o=0;o<i.gridNodeCount;o++){var s={latitudeShift:e.getFloat32(n+16*o,r),longitudeShift:e.getFloat32(n+16*o+4,r),latitudeAccuracy:e.getFloat32(n+16*o+8,r),longitudeAccuracy:e.getFloat32(n+16*o+12,r)};a.push(s)}return a}function fe(e,t){if(!(this instanceof fe))return new fe(e);t=t||function(e){if(e)throw e};var i=U(e);if("object"==typeof i){var r=fe.projections.get(i.projName);if(r){if(i.datumCode&&"none"!==i.datumCode){var n=S(ae,i.datumCode);n&&(i.datum_params=i.datum_params||(n.towgs84?n.towgs84.split(","):null),i.ellps=n.ellipse,i.datumName=n.datumName?n.datumName:i.datumCode)}i.k0=i.k0||1,i.axis=i.axis||"enu",i.ellps=i.ellps||"wgs84",i.lat1=i.lat1||i.lat0;var a=function(e,t,i,r,n){if(!e){var a=S(re,r);a||(a=ne),e=a.a,t=a.b,i=a.rf}return i&&!t&&(t=(1-1/i)*e),(0===i||Math.abs(e-t)<m)&&(n=!0,t=e),{a:e,b:t,rf:i,sphere:n}}(i.a,i.b,i.rf,i.ellps,i.sphere),o=function(e,t,i,r){var n=e*e,a=t*t,o=(n-a)/n,s=0;return r?(n=(e*=1-o*(d+o*(p+o*f)))*e,o=0):s=Math.sqrt(o),{es:o,e:s,ep2:(n-a)/a}}(a.a,a.b,a.rf,i.R_A),s=function(e){return void 0===e?null:e.split(",").map(le)}(i.nadgrids),l=i.datum||oe(i.datumCode,i.datum_params,a.a,a.b,o.es,o.ep2,s);W(this,i),W(this,r),this.a=a.a,this.b=a.b,this.rf=a.rf,this.sphere=a.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=l,this.init(),t(null,this)}else t(e)}else t(e)}fe.projections=ie,fe.projections.start();var me=fe;function ye(e,t,i){var r,n,a,o,s=e.x,l=e.y,h=e.z?e.z:0;if(l<-u&&l>-1.001*u)l=-u;else if(l>u&&l<1.001*u)l=u;else{if(l<-u)return{x:-1/0,y:-1/0,z:e.z};if(l>u)return{x:1/0,y:1/0,z:e.z}}return s>Math.PI&&(s-=2*Math.PI),n=Math.sin(l),o=Math.cos(l),a=n*n,{x:((r=i/Math.sqrt(1-t*a))+h)*o*Math.cos(s),y:(r+h)*o*Math.sin(s),z:(r*(1-t)+h)*n}}function ge(e,t,i,r){var n,a,o,s,l,h,c,d,p,f,m,y,g,v,b,_=e.x,w=e.y,x=e.z?e.z:0;if(n=Math.sqrt(_*_+w*w),a=Math.sqrt(_*_+w*w+x*x),n/i<1e-12){if(v=0,a/i<1e-12)return u,b=-r,{x:e.x,y:e.y,z:e.z}}else v=Math.atan2(w,_);o=x/a,d=(s=n/a)*(1-t)*(l=1/Math.sqrt(1-t*(2-t)*s*s)),p=o*l,g=0;do{g++,h=t*(c=i/Math.sqrt(1-t*p*p))/(c+(b=n*d+x*p-c*(1-t*p*p))),y=(m=o*(l=1/Math.sqrt(1-h*(2-h)*s*s)))*d-(f=s*(1-h)*l)*p,d=f,p=m}while(y*y>1e-24&&g<30);return{x:v,y:Math.atan(m/Math.abs(f)),z:b}}function ve(e){return e===a||e===o}var be=function(e,t,i){if(function(e,t){return e.datum_type===t.datum_type&&!(e.a!==t.a||Math.abs(e.es-t.es)>5e-11)&&(e.datum_type===a?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type!==o||e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6])}(e,t))return i;if(e.datum_type===h||t.datum_type===h)return i;var r=e.a,n=e.es;if(e.datum_type===s){if(0!==_e(e,!1,i))return;r=6378137,n=.0066943799901413165}var l=t.a,c=t.b,u=t.es;if(t.datum_type===s&&(l=6378137,c=6356752.314,u=.0066943799901413165),n===u&&r===l&&!ve(e.datum_type)&&!ve(t.datum_type))return i;if((i=ye(i,n,r),ve(e.datum_type)&&(i=function(e,t,i){if(t===a)return{x:e.x+i[0],y:e.y+i[1],z:e.z+i[2]};if(t===o){var r=i[0],n=i[1],s=i[2],l=i[3],h=i[4],c=i[5],u=i[6];return{x:u*(e.x-c*e.y+h*e.z)+r,y:u*(c*e.x+e.y-l*e.z)+n,z:u*(-h*e.x+l*e.y+e.z)+s}}}(i,e.datum_type,e.datum_params)),ve(t.datum_type)&&(i=function(e,t,i){if(t===a)return{x:e.x-i[0],y:e.y-i[1],z:e.z-i[2]};if(t===o){var r=i[0],n=i[1],s=i[2],l=i[3],h=i[4],c=i[5],u=i[6],d=(e.x-r)/u,p=(e.y-n)/u,f=(e.z-s)/u;return{x:d+c*p-h*f,y:-c*d+p+l*f,z:h*d-l*p+f}}}(i,t.datum_type,t.datum_params)),i=ge(i,u,l,c),t.datum_type===s)&&0!==_e(t,!0,i))return;return i};function _e(e,t,i){if(null===e.grids||0===e.grids.length)return console.log("Grid shift grids not found"),-1;var r={x:-i.x,y:i.y},n={x:Number.NaN,y:Number.NaN},a=[];e:for(var o=0;o<e.grids.length;o++){var s=e.grids[o];if(a.push(s.name),s.isNull){n=r;break}if(s.mandatory,null!==s.grid)for(var l=s.grid.subgrids,h=0,c=l.length;h<c;h++){var u=l[h],d=(Math.abs(u.del[1])+Math.abs(u.del[0]))/1e4,p=u.ll[0]-d,f=u.ll[1]-d,m=u.ll[0]+(u.lim[0]-1)*u.del[0]+d,y=u.ll[1]+(u.lim[1]-1)*u.del[1]+d;if(!(f>r.y||p>r.x||y<r.y||m<r.x)&&(n=we(r,t,u),!isNaN(n.x)))break e}else if(s.mandatory)return console.log("Unable to find mandatory grid '"+s.name+"'"),-1}return isNaN(n.x)?(console.log("Failed to find a grid shift table for location '"+-r.x*g+" "+r.y*g+" tried: '"+a+"'"),-1):(i.x=-n.x,i.y=n.y,0)}function we(e,t,i){var r={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return r;var n={x:e.x,y:e.y};n.x-=i.ll[0],n.y-=i.ll[1],n.x=X(n.x-Math.PI)+Math.PI;var a=xe(n,i);if(t){if(isNaN(a.x))return r;a.x=n.x-a.x,a.y=n.y-a.y;var o,s,l=9;do{if(s=xe(a,i),isNaN(s.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}o={x:n.x-(s.x+a.x),y:n.y-(s.y+a.y)},a.x+=o.x,a.y+=o.y}while(l--&&Math.abs(o.x)>1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=X(a.x+i.ll[0]),r.y=a.y+i.ll[1]}else isNaN(a.x)||(r.x=e.x+a.x,r.y=e.y+a.y);return r}function xe(e,t){var i,r={x:e.x/t.del[0],y:e.y/t.del[1]},n=Math.floor(r.x),a=Math.floor(r.y),o=r.x-1*n,s=r.y-1*a,l={x:Number.NaN,y:Number.NaN};if(n<0||n>=t.lim[0])return l;if(a<0||a>=t.lim[1])return l;i=a*t.lim[0]+n;var h=t.cvs[i][0],c=t.cvs[i][1];i++;var u=t.cvs[i][0],d=t.cvs[i][1];i+=t.lim[0];var p=t.cvs[i][0],f=t.cvs[i][1];i--;var m=t.cvs[i][0],y=t.cvs[i][1],g=o*s,v=o*(1-s),b=(1-o)*(1-s),_=(1-o)*s;return l.x=b*h+v*u+_*m+g*p,l.y=b*c+v*d+_*y+g*f,l}var Ce=function(e,t,i){var r,n,a,o=i.x,s=i.y,l=i.z||0,h={};for(a=0;a<3;a++)if(!t||2!==a||void 0!==i.z)switch(0===a?(r=o,n=-1!=="ew".indexOf(e.axis[a])?"x":"y"):1===a?(r=s,n=-1!=="ns".indexOf(e.axis[a])?"y":"x"):(r=l,n="z"),e.axis[a]){case"e":h[n]=r;break;case"w":h[n]=-r;break;case"n":h[n]=r;break;case"s":h[n]=-r;break;case"u":void 0!==i[n]&&(h.z=r);break;case"d":void 0!==i[n]&&(h.z=-r);break;default:return null}return h},Se=function(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t},Me=function(e){ke(e.x),ke(e.y)};function ke(e){if("function"==typeof Number.isFinite){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof e||e!=e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function Te(e,t,i,r){var n,l=void 0!==(i=Array.isArray(i)?Se(i):{x:i.x,y:i.y,z:i.z,m:i.m}).z;if(Me(i),e.datum&&t.datum&&function(e,t){return(e.datum.datum_type===a||e.datum.datum_type===o||e.datum.datum_type===s)&&"WGS84"!==t.datumCode||(t.datum.datum_type===a||t.datum.datum_type===o||t.datum.datum_type===s)&&"WGS84"!==e.datumCode}(e,t)&&(i=Te(e,n=new me("WGS84"),i,r),e=n),r&&"enu"!==e.axis&&(i=Ce(e,!1,i)),"longlat"===e.projName)i={x:i.x*y,y:i.y*y,z:i.z||0};else if(e.to_meter&&(i={x:i.x*e.to_meter,y:i.y*e.to_meter,z:i.z||0}),!(i=e.inverse(i)))return;if(e.from_greenwich&&(i.x+=e.from_greenwich),i=be(e.datum,t.datum,i))return t.from_greenwich&&(i={x:i.x-t.from_greenwich,y:i.y,z:i.z||0}),"longlat"===t.projName?i={x:i.x*g,y:i.y*g,z:i.z||0}:(i=t.forward(i),t.to_meter&&(i={x:i.x/t.to_meter,y:i.y/t.to_meter,z:i.z||0})),r&&"enu"!==t.axis?Ce(t,!0,i):(i&&!l&&delete i.z,i)}var Ie=me("WGS84");function Oe(e,t,i,r){var n,a,o;return Array.isArray(i)?(n=Te(e,t,i,r)||{x:NaN,y:NaN},i.length>2?void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name?"number"==typeof n.z?[n.x,n.y,n.z].concat(i.splice(3)):[n.x,n.y,i[2]].concat(i.splice(3)):[n.x,n.y].concat(i.splice(2)):[n.x,n.y]):(a=Te(e,t,i,r),2===(o=Object.keys(i)).length?a:(o.forEach(function(r){if(void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name){if("x"===r||"y"===r||"z"===r)return}else if("x"===r||"y"===r)return;a[r]=i[r]}),a))}function Ee(e){return e instanceof me?e:e.oProj?e.oProj:me(e)}var Le=function(e,t,i){e=Ee(e);var r,n=!1;return void 0===t?(t=e,e=Ie,n=!0):(void 0!==t.x||Array.isArray(t))&&(i=t,t=e,e=Ie,n=!0),t=Ee(t),i?Oe(e,t,i):(r={forward:function(i,r){return Oe(e,t,i,r)},inverse:function(i,r){return Oe(t,e,i,r)}},n&&(r.oProj=t),r)},Pe=6,Re="AJSAJS",je="AFAFAF",Ae=65,ze=73,De=79,Ve=86,Ne=90,Ge={forward:Fe,inverse:function(e){var t=We(Ye(e.toUpperCase()));if(t.lat&&t.lon)return[t.lon,t.lat,t.lon,t.lat];return[t.left,t.bottom,t.right,t.top]},toPoint:Be};function Fe(e,t){return t=t||5,function(e,t){var i="00000"+e.easting,r="00000"+e.northing;return e.zoneNumber+e.zoneLetter+function(e,t,i){var r=He(i),n=Math.floor(e/1e5),a=Math.floor(t/1e5)%20;return function(e,t,i){var r=i-1,n=Re.charCodeAt(r),a=je.charCodeAt(r),o=n+e-1,s=a+t,l=!1;o>Ne&&(o=o-Ne+Ae-1,l=!0);(o===ze||n<ze&&o>ze||(o>ze||n<ze)&&l)&&o++;(o===De||n<De&&o>De||(o>De||n<De)&&l)&&++o===ze&&o++;o>Ne&&(o=o-Ne+Ae-1);s>Ve?(s=s-Ve+Ae-1,l=!0):l=!1;(s===ze||a<ze&&s>ze||(s>ze||a<ze)&&l)&&s++;(s===De||a<De&&s>De||(s>De||a<De)&&l)&&++s===ze&&s++;s>Ve&&(s=s-Ve+Ae-1);return String.fromCharCode(o)+String.fromCharCode(s)}(n,a,r)}(e.easting,e.northing,e.zoneNumber)+i.substr(i.length-5,t)+r.substr(r.length-5,t)}(function(e){var t,i,r,n,a,o,s,l=e.lat,h=e.lon,c=6378137,u=qe(l),d=qe(h);s=Math.floor((h+180)/6)+1,180===h&&(s=60);l>=56&&l<64&&h>=3&&h<12&&(s=32);l>=72&&l<84&&(h>=0&&h<9?s=31:h>=9&&h<21?s=33:h>=21&&h<33?s=35:h>=33&&h<42&&(s=37));o=qe(6*(s-1)-180+3),.006739496752268451,t=c/Math.sqrt(1-.00669438*Math.sin(u)*Math.sin(u)),i=Math.tan(u)*Math.tan(u),r=.006739496752268451*Math.cos(u)*Math.cos(u),n=Math.cos(u)*(d-o),a=c*(.9983242984503243*u-.002514607064228144*Math.sin(2*u)+2639046602129982e-21*Math.sin(4*u)-3.418046101696858e-9*Math.sin(6*u));var p=.9996*t*(n+(1-i+r)*n*n*n/6+(5-18*i+i*i+72*r-.39089081163157013)*n*n*n*n*n/120)+5e5,f=.9996*(a+t*Math.tan(u)*(n*n/2+(5-i+9*r+4*r*r)*n*n*n*n/24+(61-58*i+i*i+600*r-2.2240339282485886)*n*n*n*n*n*n/720));l<0&&(f+=1e7);return{northing:Math.round(f),easting:Math.round(p),zoneNumber:s,zoneLetter:function(e){var t="Z";84>=e&&e>=72?t="X":72>e&&e>=64?t="W":64>e&&e>=56?t="V":56>e&&e>=48?t="U":48>e&&e>=40?t="T":40>e&&e>=32?t="S":32>e&&e>=24?t="R":24>e&&e>=16?t="Q":16>e&&e>=8?t="P":8>e&&e>=0?t="N":0>e&&e>=-8?t="M":-8>e&&e>=-16?t="L":-16>e&&e>=-24?t="K":-24>e&&e>=-32?t="J":-32>e&&e>=-40?t="H":-40>e&&e>=-48?t="G":-48>e&&e>=-56?t="F":-56>e&&e>=-64?t="E":-64>e&&e>=-72?t="D":-72>e&&e>=-80&&(t="C");return t}(l)}}({lat:e[1],lon:e[0]}),t)}function Be(e){var t=We(Ye(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function qe(e){return e*(Math.PI/180)}function Ue(e){return e/Math.PI*180}function We(e){var t=e.northing,i=e.easting,r=e.zoneLetter,n=e.zoneNumber;if(n<0||n>60)return null;var a,o,s,l,h,c,u,d,p=6378137,f=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),m=i-5e5,y=t;r<"N"&&(y-=1e7),c=6*(n-1)-180+3,d=(u=y/.9996/6367449.145945056)+(3*f/2-27*f*f*f/32)*Math.sin(2*u)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*u)+151*f*f*f/96*Math.sin(6*u),a=p/Math.sqrt(1-.00669438*Math.sin(d)*Math.sin(d)),o=Math.tan(d)*Math.tan(d),s=.006739496752268451*Math.cos(d)*Math.cos(d),l=.99330562*p/Math.pow(1-.00669438*Math.sin(d)*Math.sin(d),1.5),h=m/(.9996*a);var g=d-a*Math.tan(d)/l*(h*h/2-(5+3*o+10*s-4*s*s-.06065547077041606)*h*h*h*h/24+(61+90*o+298*s+45*o*o-1.6983531815716497-3*s*s)*h*h*h*h*h*h/720);g=Ue(g);var v,b=(h-(1+2*o+s)*h*h*h/6+(5-2*s+28*o-3*s*s+.05391597401814761+24*o*o)*h*h*h*h*h/120)/Math.cos(d);if(b=c+Ue(b),e.accuracy){var _=We({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});v={top:_.lat,right:_.lon,bottom:g,left:b}}else v={lat:g,lon:b};return v}function He(e){var t=e%Pe;return 0===t&&(t=Pe),t}function Ye(e){if(e&&0===e.length)throw"MGRSPoint coverting from nothing";for(var t,i=e.length,r=null,n="",a=0;!/[A-Z]/.test(t=e.charAt(a));){if(a>=2)throw"MGRSPoint bad conversion from: "+e;n+=t,a++}var o=parseInt(n,10);if(0===a||a+3>i)throw"MGRSPoint bad conversion from: "+e;var s=e.charAt(a++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+e;r=e.substring(a,a+=2);for(var l=He(o),h=function(e,t){var i=Re.charCodeAt(t-1),r=1e5,n=!1;for(;i!==e.charCodeAt(0);){if(++i===ze&&i++,i===De&&i++,i>Ne){if(n)throw"Bad character: "+e;i=Ae,n=!0}r+=1e5}return r}(r.charAt(0),l),c=function(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;var i=je.charCodeAt(t-1),r=0,n=!1;for(;i!==e.charCodeAt(0);){if(++i===ze&&i++,i===De&&i++,i>Ve){if(n)throw"Bad character: "+e;i=Ae,n=!0}r+=1e5}return r}(r.charAt(1),l);c<Xe(s);)c+=2e6;var u=i-a;if(u%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+e;var d,p,f,m=u/2,y=0,g=0;return m>0&&(d=1e5/Math.pow(10,m),p=e.substring(a,a+m),y=parseFloat(p)*d,f=e.substring(a+m),g=parseFloat(f)*d),{easting:y+h,northing:g+c,zoneLetter:s,zoneNumber:o,accuracy:d}}function Xe(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function $e(e,t,i){if(!(this instanceof $e))return new $e(e,t,i);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if("object"==typeof e)this.x=e.x,this.y=e.y,this.z=e.z||0;else if("string"==typeof e&&void 0===t){var r=e.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=e,this.y=t,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}$e.fromMGRS=function(e){return new $e(Be(e))},$e.prototype.toMGRS=function(e){return Fe([this.x,this.y],e)};var Je=$e,Ke=.01068115234375,Ze=function(e){var t=[];t[0]=1-e*(.25+e*(.046875+e*(.01953125+e*Ke))),t[1]=e*(.75-e*(.046875+e*(.01953125+e*Ke)));var i=e*e;return t[2]=i*(.46875-e*(.013020833333333334+.007120768229166667*e)),i*=e,t[3]=i*(.3645833333333333-.005696614583333333*e),t[4]=i*e*.3076171875,t},Qe=function(e,t,i,r){return i*=t,t*=t,r[0]*e-i*(r[1]+t*(r[2]+t*(r[3]+t*r[4])))},et=function(e,t,i){for(var r=1/(1-t),n=e,a=20;a;--a){var o=Math.sin(n),s=1-t*o*o;if(n-=s=(Qe(n,o,Math.cos(n),i)-e)*(s*Math.sqrt(s))*r,Math.abs(s)<m)return n}return n};var tt={init:function(){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.es&&(this.en=Ze(this.es),this.ml0=Qe(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(e){var t,i,r,n=e.x,a=e.y,o=X(n-this.long0),s=Math.sin(a),l=Math.cos(a);if(this.es){var h=l*o,c=Math.pow(h,2),u=this.ep2*Math.pow(l,2),d=Math.pow(u,2),p=Math.abs(l)>m?Math.tan(a):0,f=Math.pow(p,2),y=Math.pow(f,2);t=1-this.es*Math.pow(s,2),h/=Math.sqrt(t);var g=Qe(a,s,l,this.en);i=this.a*(this.k0*h*(1+c/6*(1-f+u+c/20*(5-18*f+y+14*u-58*f*u+c/42*(61+179*y-y*f-479*f)))))+this.x0,r=this.a*(this.k0*(g-this.ml0+s*o*h/2*(1+c/12*(5-f+9*u+4*d+c/30*(61+y-58*f+270*u-330*f*u+c/56*(1385+543*y-y*f-3111*f))))))+this.y0}else{var v=l*Math.sin(o);if(Math.abs(Math.abs(v)-1)<m)return 93;if(i=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,r=l*Math.cos(o)/Math.sqrt(1-Math.pow(v,2)),(v=Math.abs(r))>=1){if(v-1>m)return 93;r=0}else r=Math.acos(r);a<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return e.x=i,e.y=r,e},inverse:function(e){var t,i,r,n,a=(e.x-this.x0)*(1/this.a),o=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+o/this.k0,i=et(t,this.es,this.en),Math.abs(i)<u){var s=Math.sin(i),l=Math.cos(i),h=Math.abs(l)>m?Math.tan(i):0,c=this.ep2*Math.pow(l,2),d=Math.pow(c,2),p=Math.pow(h,2),f=Math.pow(p,2);t=1-this.es*Math.pow(s,2);var y=a*Math.sqrt(t)/this.k0,g=Math.pow(y,2);r=i-(t*=h)*g/(1-this.es)*.5*(1-g/12*(5+3*p-9*c*p+c-4*d-g/30*(61+90*p-252*c*p+45*f+46*c-g/56*(1385+3633*p+4095*f+1574*f*p)))),n=X(this.long0+y*(1-g/6*(1+2*p+c-g/20*(5+28*p+24*f+8*c*p+6*c-g/42*(61+662*p+1320*f+720*f*p))))/l)}else r=u*Y(o),n=0;else{var v=Math.exp(a/this.k0),b=.5*(v-1/v),_=this.lat0+o/this.k0,w=Math.cos(_);t=Math.sqrt((1-Math.pow(w,2))/(1+Math.pow(b,2))),r=Math.asin(t),o<0&&(r=-r),n=0===b&&0===w?0:X(Math.atan2(b,w)+this.long0)}return e.x=n,e.y=r,e},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},it=function(e){var t=Math.exp(e);return t=(t-1/t)/2},rt=function(e,t){e=Math.abs(e),t=Math.abs(t);var i=Math.max(e,t),r=Math.min(e,t)/(i||1);return i*Math.sqrt(1+Math.pow(r,2))},nt=function(e){var t=Math.abs(e);return t=function(e){var t=1+e,i=t-1;return 0===i?e:e*Math.log(t)/i}(t*(1+t/(rt(1,t)+1))),e<0?-t:t},at=function(e,t){for(var i,r=2*Math.cos(2*t),n=e.length-1,a=e[n],o=0;--n>=0;)i=r*a-o+e[n],o=a,a=i;return t+i*Math.sin(2*t)},ot=function(e,t){for(var i,r=2*Math.cos(t),n=e.length-1,a=e[n],o=0;--n>=0;)i=r*a-o+e[n],o=a,a=i;return Math.sin(t)*i},st=function(e,t,i){for(var r,n,a=Math.sin(t),o=Math.cos(t),s=it(i),l=function(e){var t=Math.exp(e);return t=(t+1/t)/2}(i),h=2*o*l,c=-2*a*s,u=e.length-1,d=e[u],p=0,f=0,m=0;--u>=0;)r=f,n=p,d=h*(f=d)-r-c*(p=m)+e[u],m=c*f-n+h*p;return[(h=a*l)*d-(c=o*s)*m,h*m+c*d]};var lt={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&&(tt.init.apply(this),this.forward=tt.forward,this.inverse=tt.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 e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),i=t;this.cgb[0]=t*(2+t*(-2/3+t*(t*(116/45+t*(26/45+t*(-2854/675)))-2))),this.cbg[0]=t*(t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))-2),i*=t,this.cgb[1]=i*(7/3+t*(t*(-227/45+t*(2704/315+t*(2323/945)))-1.6)),this.cbg[1]=i*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),i*=t,this.cgb[2]=i*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=i*(-26/15+t*(34/21+t*(1.6+t*(-12686/2835)))),i*=t,this.cgb[3]=i*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=i*(1237/630+t*(t*(-24832/14175)-2.4)),i*=t,this.cgb[4]=i*(4174/315+t*(-144838/6237)),this.cbg[4]=i*(-734/315+t*(109598/31185)),i*=t,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+i*(.25+i*(1/64+i/256))),this.utg[0]=t*(t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))-.5),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=i*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=i*(13/48+t*(t*(557/1440+t*(281/630+t*(-1983433/1935360)))-.6)),i*=t,this.utg[2]=i*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=i*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),i*=t,this.utg[3]=i*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=i*(49561/161280+t*(-179/168+t*(6601661/7257600))),i*=t,this.utg[4]=i*(-4583/161280+t*(108847/3991680)),this.gtu[4]=i*(34729/80640+t*(-3418889/1995840)),i*=t,this.utg[5]=-.03233083094085698*i,this.gtu[5]=.6650675310896665*i;var r=at(this.cbg,this.lat0);this.Zb=-this.Qn*(r+ot(this.gtu,2*r))},forward:function(e){var t=X(e.x-this.long0),i=e.y;i=at(this.cbg,i);var r=Math.sin(i),n=Math.cos(i),a=Math.sin(t),o=Math.cos(t);i=Math.atan2(r,o*n),t=Math.atan2(a*n,rt(r,n*o)),t=nt(Math.tan(t));var s,l,h=st(this.gtu,2*i,2*t);return i+=h[0],t+=h[1],Math.abs(t)<=2.623395162778?(s=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*i+this.Zb)+this.y0):(s=1/0,l=1/0),e.x=s,e.y=l,e},inverse:function(e){var t,i,r=(e.x-this.x0)*(1/this.a),n=(e.y-this.y0)*(1/this.a);if(n=(n-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var a=st(this.utg,2*n,2*r);n+=a[0],r+=a[1],r=Math.atan(it(r));var o=Math.sin(n),s=Math.cos(n),l=Math.sin(r),h=Math.cos(r);n=Math.atan2(o*h,rt(l,h*s)),r=Math.atan2(l,h*s),t=X(r+this.long0),i=at(this.cgb,n)}else t=1/0,i=1/0;return e.x=t,e.y=i,e},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]},ht=function(e,t){if(void 0===e){if((e=Math.floor(30*(X(t)+Math.PI)/Math.PI)+1)<0)return 0;if(e>60)return 60}return e};var ct={init:function(){var e=ht(this.zone,this.long0);if(void 0===e)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*y,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,lt.init.apply(this),this.forward=lt.forward,this.inverse=lt.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},ut=function(e,t){return Math.pow((1-e)/(1+e),t)},dt=20;var pt={init:function(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+v)/(Math.pow(Math.tan(.5*this.lat0+v),this.C)*ut(this.e*e,this.ratexp))},forward:function(e){var t=e.x,i=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+v),this.C)*ut(this.e*Math.sin(i),this.ratexp))-u,e.x=this.C*t,e},inverse:function(e){for(var t=e.x/this.C,i=e.y,r=Math.pow(Math.tan(.5*i+v)/this.K,1/this.C),n=dt;n>0&&(i=2*Math.atan(r*ut(this.e*Math.sin(e.y),-.5*this.e))-u,!(Math.abs(i-e.y)<1e-14));--n)e.y=i;return n?(e.x=t,e.y=i,e):null},names:["gauss"]};var ft={init:function(){pt.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(e){var t,i,r,n;return e.x=X(e.x-this.long0),pt.forward.apply(this,[e]),t=Math.sin(e.y),i=Math.cos(e.y),r=Math.cos(e.x),n=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*i*r),e.x=n*i*Math.sin(e.x),e.y=n*(this.cosc0*t-this.sinc0*i*r),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){var t,i,r,n,a;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,a=rt(e.x,e.y)){var o=2*Math.atan2(a,this.R2);t=Math.sin(o),i=Math.cos(o),n=Math.asin(i*this.sinc0+e.y*t*this.cosc0/a),r=Math.atan2(e.x*t,a*this.cosc0*i-e.y*this.sinc0*t)}else n=this.phic0,r=0;return e.x=r,e.y=n,pt.inverse.apply(this,[e]),e.x=X(e.x+this.long0),e},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var mt={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=m&&(this.k0=.5*(1+Y(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=m&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=m&&Math.abs(Math.cos(this.lat_ts))>m&&(this.k0=.5*this.cons*H(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/$(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=H(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-u,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(e){var t,i,r,n,a,o,s=e.x,l=e.y,h=Math.sin(l),c=Math.cos(l),d=X(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=m&&Math.abs(l+this.lat0)<=m?(e.x=NaN,e.y=NaN,e):this.sphere?(t=2*this.k0/(1+this.sinlat0*h+this.coslat0*c*Math.cos(d)),e.x=this.a*t*c*Math.sin(d)+this.x0,e.y=this.a*t*(this.coslat0*h-this.sinlat0*c*Math.cos(d))+this.y0,e):(i=2*Math.atan(this.ssfn_(l,h,this.e))-u,n=Math.cos(i),r=Math.sin(i),Math.abs(this.coslat0)<=m?(a=$(this.e,l*this.con,this.con*h),o=2*this.a*this.k0*a/this.cons,e.x=this.x0+o*Math.sin(s-this.long0),e.y=this.y0-this.con*o*Math.cos(s-this.long0),e):(Math.abs(this.sinlat0)<m?(t=2*this.a*this.k0/(1+n*Math.cos(d)),e.y=t*r):(t=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*n*Math.cos(d))),e.y=t*(this.cosX0*r-this.sinX0*n*Math.cos(d))+this.y0),e.x=t*n*Math.sin(d)+this.x0,e))},inverse:function(e){var t,i,r,n,a;e.x-=this.x0,e.y-=this.y0;var o=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var s=2*Math.atan(o/(2*this.a*this.k0));return t=this.long0,i=this.lat0,o<=m?(e.x=t,e.y=i,e):(i=Math.asin(Math.cos(s)*this.sinlat0+e.y*Math.sin(s)*this.coslat0/o),t=Math.abs(this.coslat0)<m?this.lat0>0?X(this.long0+Math.atan2(e.x,-1*e.y)):X(this.long0+Math.atan2(e.x,e.y)):X(this.long0+Math.atan2(e.x*Math.sin(s),o*this.coslat0*Math.cos(s)-e.y*this.sinlat0*Math.sin(s))),e.x=t,e.y=i,e)}if(Math.abs(this.coslat0)<=m){if(o<=m)return i=this.lat0,t=this.long0,e.x=t,e.y=i,e;e.x*=this.con,e.y*=this.con,r=o*this.cons/(2*this.a*this.k0),i=this.con*J(this.e,r),t=this.con*X(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else n=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=m?a=this.X0:(a=Math.asin(Math.cos(n)*this.sinX0+e.y*Math.sin(n)*this.cosX0/o),t=X(this.long0+Math.atan2(e.x*Math.sin(n),o*this.cosX0*Math.cos(n)-e.y*this.sinX0*Math.sin(n)))),i=-1*J(this.e,Math.tan(.5*(u+a)));return e.x=t,e.y=i,e},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],ssfn_:function(e,t,i){return t*=i,Math.tan(.5*(u+e))*Math.pow((1-t)/(1+t),.5*i)}};var yt={init:function(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),i=this.a,r=1/this.rf,n=2*r-Math.pow(r,2),a=this.e=Math.sqrt(n);this.R=this.k0*i*Math.sqrt(1-n)/(1-n*Math.pow(t,2)),this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+e/2)),l=Math.log((1+a*t)/(1-a*t));this.K=o-this.alpha*s+this.alpha*a/2*l},forward:function(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),r=-this.alpha*(t+i)+this.K,n=2*(Math.atan(Math.exp(r))-Math.PI/4),a=this.alpha*(e.x-this.lambda0),o=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(n)+Math.cos(this.b0)*Math.cos(a))),s=Math.asin(Math.cos(this.b0)*Math.sin(n)-Math.sin(this.b0)*Math.cos(n)*Math.cos(a));return e.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,e.x=this.R*o+this.x0,e},inverse:function(e){for(var t=e.x-this.x0,i=e.y-this.y0,r=t/this.R,n=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(n)+Math.sin(this.b0)*Math.cos(n)*Math.cos(r)),o=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(n))),s=this.lambda0+o/this.alpha,l=0,h=a,c=-1e3,u=0;Math.abs(h-c)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(h))/2)),c=h,h=2*Math.atan(Math.exp(l))-Math.PI/2}return e.x=s,e.y=h,e},names:["somerc"]},gt=1e-7;var vt={init:function(){var e,t,i,r,n,a,o,s,l,h,c,d=0,p=0,f=0,g=0,_=0,w=0,x=0;this.no_off=function(e){var t="object"==typeof e.PROJECTION?Object.keys(e.PROJECTION)[0]:e.PROJECTION;return"no_uoff"in e||"no_off"in e||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(t)}(this),this.no_rot="no_rot"in this;var C=!1;"alpha"in this&&(C=!0);var S=!1;if("rectified_grid_angle"in this&&(S=!0),C&&(x=this.alpha),S&&(d=this.rectified_grid_angle*y),C||S)p=this.longc;else if(f=this.long1,_=this.lat1,g=this.long2,w=this.lat2,Math.abs(_-w)<=gt||(e=Math.abs(_))<=gt||Math.abs(e-u)<=gt||Math.abs(Math.abs(this.lat0)-u)<=gt||Math.abs(Math.abs(w)-u)<=gt)throw new Error;var M=1-this.es;t=Math.sqrt(M),Math.abs(this.lat0)>m?(s=Math.sin(this.lat0),i=Math.cos(this.lat0),e=1-this.es*s*s,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/M),this.A=this.B*this.k0*t/e,(n=(r=this.B*t/(i*Math.sqrt(e)))*r-1)<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=r,this.E*=Math.pow($(this.e,this.lat0,s),this.B)):(this.B=1/t,this.A=this.k0,this.E=r=n=1),C||S?(C?(c=Math.asin(Math.sin(x)/r),S||(d=x)):(c=d,x=Math.asin(r*Math.sin(c))),this.lam0=p-Math.asin(.5*(n-1/n)*Math.tan(c))/this.B):(a=Math.pow($(this.e,_,Math.sin(_)),this.B),o=Math.pow($(this.e,w,Math.sin(w)),this.B),n=this.E/a,l=(o-a)/(o+a),h=((h=this.E*this.E)-o*a)/(h+o*a),(e=f-g)<-Math.pi?g-=b:e>Math.pi&&(g+=b),this.lam0=X(.5*(f+g)-Math.atan(h*Math.tan(.5*this.B*(f-g))/l)/this.B),c=Math.atan(2*Math.sin(this.B*X(f-this.lam0))/(n-1/n)),d=x=Math.asin(r*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(d),this.cosrot=Math.cos(d),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(x))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(v-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(v+n))},forward:function(e){var t,i,r,n,a,o,s,l,h={};if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-u)>m){if(t=.5*((a=this.E/Math.pow($(this.e,e.y,Math.sin(e.y)),this.B))-(o=1/a)),i=.5*(a+o),n=Math.sin(this.B*e.x),r=(t*this.singam-n*this.cosgam)/i,Math.abs(Math.abs(r)-1)<m)throw new Error;l=.5*this.ArB*Math.log((1-r)/(1+r)),o=Math.cos(this.B*e.x),s=Math.abs(o)<gt?this.A*e.x:this.ArB*Math.atan2(t*this.cosgam+n*this.singam,o)}else l=e.y>0?this.v_pole_n:this.v_pole_s,s=this.ArB*e.y;return this.no_rot?(h.x=s,h.y=l):(s-=this.u_0,h.x=l*this.cosrot+s*this.sinrot,h.y=s*this.cosrot-l*this.sinrot),h.x=this.a*h.x+this.x0,h.y=this.a*h.y+this.y0,h},inverse:function(e){var t,i,r,n,a,o,s,l={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(i=e.y,t=e.x):(i=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),n=.5*((r=Math.exp(-this.BrA*i))-1/r),a=.5*(r+1/r),s=((o=Math.sin(this.BrA*t))*this.cosgam+n*this.singam)/a,Math.abs(Math.abs(s)-1)<m)l.x=0,l.y=s<0?-u:u;else{if(l.y=this.E/Math.sqrt((1+s)/(1-s)),l.y=J(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(n*this.cosgam-o*this.singam,Math.cos(this.BrA*t))}return l.x+=this.lam0,l},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]};var bt={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<m)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),i=Math.cos(this.lat1),r=H(this.e,t,i),n=$(this.e,this.lat1,t),a=Math.sin(this.lat2),o=Math.cos(this.lat2),s=H(this.e,a,o),l=$(this.e,this.lat2,a),h=$(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>m?this.ns=Math.log(r/s)/Math.log(n/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=r/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(e){var t=e.x,i=e.y;Math.abs(2*Math.abs(i)-Math.PI)<=m&&(i=Y(i)*(u-2*m));var r,n,a=Math.abs(Math.abs(i)-u);if(a>m)r=$(this.e,i,Math.sin(i)),n=this.a*this.f0*Math.pow(r,this.ns);else{if((a=i*this.ns)<=0)return null;n=0}var o=this.ns*X(t-this.long0);return e.x=this.k0*(n*Math.sin(o))+this.x0,e.y=this.k0*(this.rh-n*Math.cos(o))+this.y0,e},inverse:function(e){var t,i,r,n,a,o=(e.x-this.x0)/this.k0,s=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+s*s),i=1):(t=-Math.sqrt(o*o+s*s),i=-1);var l=0;if(0!==t&&(l=Math.atan2(i*o,i*s)),0!==t||this.ns>0){if(i=1/this.ns,r=Math.pow(t/(this.a*this.f0),i),-9999===(n=J(this.e,r)))return null}else n=-u;return a=X(l/this.ns+this.long0),e.x=a,e.y=n,e},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 _t={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(e){var t,i,r,n,a,o,s,l=e.x,h=e.y,c=X(l-this.long0);return t=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/t)-this.s45),r=-c*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(r)),a=Math.asin(Math.cos(i)*Math.sin(r)/Math.cos(n)),o=this.n*a,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),e.y=s*Math.cos(o)/1,e.x=s*Math.sin(o)/1,this.czech||(e.y*=-1,e.x*=-1),e},inverse:function(e){var t,i,r,n,a,o,s,l=e.x;e.x=e.y,e.y=l,this.czech||(e.y*=-1,e.x*=-1),a=Math.sqrt(e.x*e.x+e.y*e.y),n=Math.atan2(e.y,e.x)/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),i=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(t)),e.x=this.long0-i/this.alfa,o=t,s=0;var h=0;do{e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-e.y)<1e-10&&(s=1),o=e.y,h+=1}while(0===s&&h<15);return h>=15?null:e},names:["Krovak","krovak"]},wt=function(e,t,i,r,n){return e*n-t*Math.sin(2*n)+i*Math.sin(4*n)-r*Math.sin(6*n)},xt=function(e){return 1-.25*e*(1+e/16*(3+1.25*e))},Ct=function(e){return.375*e*(1+.25*e*(1+.46875*e))},St=function(e){return.05859375*e*e*(1+.75*e)},Mt=function(e){return e*e*e*(35/3072)},kt=function(e,t,i){var r=t*i;return e/Math.sqrt(1-r*r)},Tt=function(e){return Math.abs(e)<u?e:e-Y(e)*Math.PI},It=function(e,t,i,r,n){var a,o;a=e/t;for(var s=0;s<15;s++)if(a+=o=(e-(t*a-i*Math.sin(2*a)+r*Math.sin(4*a)-n*Math.sin(6*a)))/(t-2*i*Math.cos(2*a)+4*r*Math.cos(4*a)-6*n*Math.cos(6*a)),Math.abs(o)<=1e-10)return a;return NaN};var Ot={init:function(){this.sphere||(this.e0=xt(this.es),this.e1=Ct(this.es),this.e2=St(this.es),this.e3=Mt(this.es),this.ml0=this.a*wt(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(e){var t,i,r=e.x,n=e.y;if(r=X(r-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(n)*Math.sin(r)),i=this.a*(Math.atan2(Math.tan(n),Math.cos(r))-this.lat0);else{var a=Math.sin(n),o=Math.cos(n),s=kt(this.a,this.e,a),l=Math.tan(n)*Math.tan(n),h=r*Math.cos(n),c=h*h,u=this.es*o*o/(1-this.es);t=s*h*(1-c*l*(1/6-(8-l+8*u)*c/120)),i=this.a*wt(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+s*a/o*c*(.5+(5-l+6*u)*c/24)}return e.x=t+this.x0,e.y=i+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,i,r=e.x/this.a,n=e.y/this.a;if(this.sphere){var a=n+this.lat0;t=Math.asin(Math.sin(a)*Math.cos(r)),i=Math.atan2(Math.tan(r),Math.cos(a))}else{var o=this.ml0/this.a+n,s=It(o,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(s)-u)<=m)return e.x=this.long0,e.y=u,n<0&&(e.y*=-1),e;var l=kt(this.a,this.e,Math.sin(s)),h=l*l*l/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(s),2),d=r*this.a/l,p=d*d;t=s-l*Math.tan(s)/h*d*d*(.5-(1+3*c)*d*d/24),i=d*(1-p*(c/3+(1+3*c)*c*p/15))/Math.cos(s)}return e.x=X(i+this.long0),e.y=Tt(t),e},names:["Cassini","Cassini_Soldner","cass"]},Et=function(e,t){var i;return e>1e-7?(1-e*e)*(t/(1-(i=e*t)*i)-.5/e*Math.log((1-i)/(1+i))):2*t};var Lt=.3333333333333333,Pt=.17222222222222222,Rt=.10257936507936508,jt=.06388888888888888,At=.0664021164021164,zt=.016415012942191543;var Dt={init:function(){var e,t=Math.abs(this.lat0);if(Math.abs(t-u)<m?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<m?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=Et(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(e){var t,i=[];return i[0]=e*Lt,t=e*e,i[0]+=t*Pt,i[1]=t*jt,t*=e,i[0]+=t*Rt,i[1]+=t*At,i[2]=t*zt,i}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=Et(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*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(e){var t,i,r,n,a,o,s,l,h,c,d=e.x,p=e.y;if(d=X(d-this.long0),this.sphere){if(a=Math.sin(p),c=Math.cos(p),r=Math.cos(d),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+c*r:1+this.sinph0*a+this.cosph0*c*r)<=m)return null;t=(i=Math.sqrt(2/i))*c*Math.sin(d),i*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*c*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(p+this.lat0)<m)return null;i=v-.5*p,t=(i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)))*Math.sin(d),i*=r}}else{switch(s=0,l=0,h=0,r=Math.cos(d),n=Math.sin(d),a=Math.sin(p),o=Et(this.e,a),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(s=o/this.qp,l=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:h=1+this.sinb1*s+this.cosb1*l*r;break;case this.EQUIT:h=1+l*r;break;case this.N_POLE:h=u+p,o=this.qp-o;break;case this.S_POLE:h=p-u,o=this.qp+o}if(Math.abs(h)<m)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:h=Math.sqrt(2/h),i=this.mode===this.OBLIQ?this.ymf*h*(this.cosb1*s-this.sinb1*l*r):(h=Math.sqrt(2/(1+l*r)))*s*this.ymf,t=this.xmf*h*l*n;break;case this.N_POLE:case this.S_POLE:o>=0?(t=(h=Math.sqrt(o))*n,i=r*(this.mode===this.S_POLE?h:-h)):t=i=0}}return e.x=this.a*t+this.x0,e.y=this.a*i+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,i,r,n,a,o,s,l=e.x/this.a,h=e.y/this.a;if(this.sphere){var c,d=0,p=0;if((i=.5*(c=Math.sqrt(l*l+h*h)))>1)return null;switch(i=2*Math.asin(i),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(p=Math.sin(i),d=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(c)<=m?0:Math.asin(h*p/c),l*=p,h=d*c;break;case this.OBLIQ:i=Math.abs(c)<=m?this.lat0:Math.asin(d*this.sinph0+h*p*this.cosph0/c),l*=p*this.cosph0,h=(d-Math.sin(i)*this.sinph0)*c;break;case this.N_POLE:h=-h,i=u-i;break;case this.S_POLE:i-=u}t=0!==h||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(l,h):0}else{if(s=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(l/=this.dd,h*=this.dd,(o=Math.sqrt(l*l+h*h))<m)return e.x=this.long0,e.y=this.lat0,e;n=2*Math.asin(.5*o/this.rq),r=Math.cos(n),l*=n=Math.sin(n),this.mode===this.OBLIQ?(s=r*this.sinb1+h*n*this.cosb1/o,a=this.qp*s,h=o*this.cosb1*r-h*this.sinb1*n):(s=h*n/o,a=this.qp*s,h=o*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(h=-h),!(a=l*l+h*h))return e.x=this.long0,e.y=this.lat0,e;s=1-a/this.qp,this.mode===this.S_POLE&&(s=-s)}t=Math.atan2(l,h),i=function(e,t){var i=e+e;return e+t[0]*Math.sin(i)+t[1]*Math.sin(i+i)+t[2]*Math.sin(i+i+i)}(Math.asin(s),this.apa)}return e.x=X(this.long0+t),e.y=i,e},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},Vt=function(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)};var Nt={init:function(){Math.abs(this.lat1+this.lat2)<m||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=H(this.e3,this.sin_po,this.cos_po),this.qs1=Et(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=H(this.e3,this.sin_po,this.cos_po),this.qs2=Et(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Et(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>m?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(e){var t=e.x,i=e.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var r=Et(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,a=this.ns0*X(t-this.long0),o=n*Math.sin(a)+this.x0,s=this.rh-n*Math.cos(a)+this.y0;return e.x=o,e.y=s,e},inverse:function(e){var t,i,r,n,a,o;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),r=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),r=-1),n=0,0!==t&&(n=Math.atan2(r*e.x,r*e.y)),r=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-r*r)/(2*this.ns0)):(i=(this.c-r*r)/this.ns0,o=this.phi1z(this.e3,i)),a=X(n/this.ns0+this.long0),e.x=a,e.y=o,e},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(e,t){var i,r,n,a,o,s=Vt(.5*t);if(e<m)return s;for(var l=e*e,h=1;h<=25;h++)if(i=Math.sin(s),r=Math.cos(s),s+=o=.5*(a=1-(n=e*i)*n)*a/r*(t/(1-l)-i/a+.5/e*Math.log((1-n)/(1+n))),Math.abs(o)<=1e-7)return s;return null}};var Gt={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(e){var t,i,r,n,a,o,s,l=e.x,h=e.y;return r=X(l-this.long0),t=Math.sin(h),i=Math.cos(h),n=Math.cos(r),(a=this.sin_p14*t+this.cos_p14*i*n)>0||Math.abs(a)<=m?(o=this.x0+1*this.a*i*Math.sin(r)/a,s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*n)/a):(o=this.x0+this.infinity_dist*i*Math.sin(r),s=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*i*n)),e.x=o,e.y=s,e},inverse:function(e){var t,i,r,n,a,o;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(n=Math.atan2(t,this.rc),i=Math.sin(n),r=Math.cos(n),o=Vt(r*this.sin_p14+e.y*i*this.cos_p14/t),a=Math.atan2(e.x*i,t*this.cos_p14*r-e.y*this.sin_p14*i),a=X(this.long0+a)):(o=this.phic0,a=0),e.x=a,e.y=o,e},names:["gnom"]},Ft=function(e,t){var i=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-i)<1e-6)return t<0?-1*u:u;for(var r,n,a,o,s=Math.asin(.5*t),l=0;l<30;l++)if(n=Math.sin(s),a=Math.cos(s),o=e*n,s+=r=Math.pow(1-o*o,2)/(2*a)*(t/(1-e*e)-n/(1-o*o)+.5/e*Math.log((1-o)/(1+o))),Math.abs(r)<=1e-10)return s;return NaN};var Bt={init:function(){this.sphere||(this.k0=H(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(e){var t,i,r=e.x,n=e.y,a=X(r-this.long0);if(this.sphere)t=this.x0+this.a*a*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var o=Et(this.e,Math.sin(n));t=this.x0+this.a*this.k0*a,i=this.y0+this.a*o*.5/this.k0}return e.x=t,e.y=i,e},inverse:function(e){var t,i;return e.x-=this.x0,e.y-=this.y0,this.sphere?(t=X(this.long0+e.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(i=Ft(this.e,2*e.y*this.k0/this.a),t=X(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=i,e},names:["cea"]};var qt={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(e){var t=e.x,i=e.y,r=X(t-this.long0),n=Tt(i-this.lat0);return e.x=this.x0+this.a*r*this.rc,e.y=this.y0+this.a*n,e},inverse:function(e){var t=e.x,i=e.y;return e.x=X(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=Tt(this.lat0+(i-this.y0)/this.a),e},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Ut=20;var Wt={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=xt(this.es),this.e1=Ct(this.es),this.e2=St(this.es),this.e3=Mt(this.es),this.ml0=this.a*wt(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(e){var t,i,r,n=e.x,a=e.y,o=X(n-this.long0);if(r=o*Math.sin(a),this.sphere)Math.abs(a)<=m?(t=this.a*o,i=-1*this.a*this.lat0):(t=this.a*Math.sin(r)/Math.tan(a),i=this.a*(Tt(a-this.lat0)+(1-Math.cos(r))/Math.tan(a)));else if(Math.abs(a)<=m)t=this.a*o,i=-1*this.ml0;else{var s=kt(this.a,this.e,Math.sin(a))/Math.tan(a);t=s*Math.sin(r),i=this.a*wt(this.e0,this.e1,this.e2,this.e3,a)-this.ml0+s*(1-Math.cos(r))}return e.x=t+this.x0,e.y=i+this.y0,e},inverse:function(e){var t,i,r,n,a,o,s,l,h;if(r=e.x-this.x0,n=e.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=m)t=X(r/this.a+this.long0),i=0;else{var c;for(o=this.lat0+n/this.a,s=r*r/this.a/this.a+o*o,l=o,a=Ut;a;--a)if(l+=h=-1*(o*(l*(c=Math.tan(l))+1)-l-.5*(l*l+s)*c)/((l-o)/c-1),Math.abs(h)<=m){i=l;break}t=X(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(i))}else if(Math.abs(n+this.ml0)<=m)i=0,t=X(this.long0+r/this.a);else{var u,d,p,f,y;for(o=(this.ml0+n)/this.a,s=r*r/this.a/this.a+o*o,l=o,a=Ut;a;--a)if(y=this.e*Math.sin(l),u=Math.sqrt(1-y*y)*Math.tan(l),d=this.a*wt(this.e0,this.e1,this.e2,this.e3,l),p=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=h=(o*(u*(f=d/this.a)+1)-f-.5*u*(f*f+s))/(this.es*Math.sin(2*l)*(f*f+s-2*o*f)/(4*u)+(o-f)*(u*p-2/Math.sin(2*l))-p),Math.abs(h)<=m){i=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),t=X(this.long0+Math.asin(r*u/this.a)/Math.sin(i))}return e.x=t,e.y=i,e},names:["Polyconic","poly"]};var Ht={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(e){var t,i=e.x,r=e.y-this.lat0,n=i-this.long0,a=r/c*1e-5,o=n,s=1,l=0;for(t=1;t<=10;t++)s*=a,l+=this.A[t]*s;var h,u=l,d=o,p=1,f=0,m=0,y=0;for(t=1;t<=6;t++)h=f*u+p*d,p=p*u-f*d,f=h,m=m+this.B_re[t]*p-this.B_im[t]*f,y=y+this.B_im[t]*p+this.B_re[t]*f;return e.x=y*this.a+this.x0,e.y=m*this.a+this.y0,e},inverse:function(e){var t,i,r=e.x,n=e.y,a=r-this.x0,o=(n-this.y0)/this.a,s=a/this.a,l=1,h=0,u=0,d=0;for(t=1;t<=6;t++)i=h*o+l*s,l=l*o-h*s,h=i,u=u+this.C_re[t]*l-this.C_im[t]*h,d=d+this.C_im[t]*l+this.C_re[t]*h;for(var p=0;p<this.iterations;p++){var f,m=u,y=d,g=o,v=s;for(t=2;t<=6;t++)f=y*u+m*d,m=m*u-y*d,y=f,g+=(t-1)*(this.B_re[t]*m-this.B_im[t]*y),v+=(t-1)*(this.B_im[t]*m+this.B_re[t]*y);m=1,y=0;var b=this.B_re[1],_=this.B_im[1];for(t=2;t<=6;t++)f=y*u+m*d,m=m*u-y*d,y=f,b+=t*(this.B_re[t]*m-this.B_im[t]*y),_+=t*(this.B_im[t]*m+this.B_re[t]*y);var w=b*b+_*_;u=(g*b+v*_)/w,d=(v*b-g*_)/w}var x=u,C=d,S=1,M=0;for(t=1;t<=9;t++)S*=x,M+=this.D[t]*S;var k=this.lat0+M*c*1e5,T=this.long0+C;return e.x=T,e.y=k,e},names:["New_Zealand_Map_Grid","nzmg"]};var Yt={init:function(){},forward:function(e){var t=e.x,i=e.y,r=X(t-this.long0),n=this.x0+this.a*r,a=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return e.x=n,e.y=a,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t=X(this.long0+e.x/this.a),i=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=i,e},names:["Miller_Cylindrical","mill"]},Xt=20;var $t={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Ze(this.es)},forward:function(e){var t,i,r=e.x,n=e.y;if(r=X(r-this.long0),this.sphere){if(this.m)for(var a=this.n*Math.sin(n),o=Xt;o;--o){var s=(this.m*n+Math.sin(n)-a)/(this.m+Math.cos(n));if(n-=s,Math.abs(s)<m)break}else n=1!==this.n?Math.asin(this.n*Math.sin(n)):n;t=this.a*this.C_x*r*(this.m+Math.cos(n)),i=this.a*this.C_y*n}else{var l=Math.sin(n),h=Math.cos(n);i=this.a*Qe(n,l,h,this.en),t=this.a*r*h/Math.sqrt(1-this.es*l*l)}return e.x=t,e.y=i,e},inverse:function(e){var t,i,r,n;return e.x-=this.x0,r=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,r/=this.C_x*(this.m+Math.cos(t)),this.m?t=Vt((this.m*t+Math.sin(t))/this.n):1!==this.n&&(t=Vt(Math.sin(t)/this.n)),r=X(r+this.long0),t=Tt(t)):(t=et(e.y/this.a,this.es,this.en),(n=Math.abs(t))<u?(n=Math.sin(t),i=this.long0+e.x*Math.sqrt(1-this.es*n*n)/(this.a*Math.cos(t)),r=X(i)):n-m<u&&(r=this.long0)),e.x=r,e.y=t,e},names:["Sinusoidal","sinu"]};var Jt={init:function(){},forward:function(e){for(var t=e.x,i=e.y,r=X(t-this.long0),n=i,a=Math.PI*Math.sin(i);;){var o=-(n+Math.sin(n)-a)/(1+Math.cos(n));if(n+=o,Math.abs(o)<m)break}n/=2,Math.PI/2-Math.abs(i)<m&&(r=0);var s=.900316316158*this.a*r*Math.cos(n)+this.x0,l=1.4142135623731*this.a*Math.sin(n)+this.y0;return e.x=s,e.y=l,e},inverse:function(e){var t,i;e.x-=this.x0,e.y-=this.y0,i=e.y/(1.4142135623731*this.a),Math.abs(i)>.999999999999&&(i=.999999999999),t=Math.asin(i);var r=X(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),i=(2*t+Math.sin(2*t))/Math.PI,Math.abs(i)>1&&(i=1);var n=Math.asin(i);return e.x=r,e.y=n,e},names:["Mollweide","moll"]};var Kt={init:function(){Math.abs(this.lat1+this.lat2)<m||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=xt(this.es),this.e1=Ct(this.es),this.e2=St(this.es),this.e3=Mt(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=H(this.e,this.sinphi,this.cosphi),this.ml1=wt(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<m?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=H(this.e,this.sinphi,this.cosphi),this.ml2=wt(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=wt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(e){var t,i=e.x,r=e.y;if(this.sphere)t=this.a*(this.g-r);else{var n=wt(this.e0,this.e1,this.e2,this.e3,r);t=this.a*(this.g-n)}var a=this.ns*X(i-this.long0),o=this.x0+t*Math.sin(a),s=this.y0+this.rh-t*Math.cos(a);return e.x=o,e.y=s,e},inverse:function(e){var t,i,r,n;e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns>=0?(i=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(i=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var a=0;if(0!==i&&(a=Math.atan2(t*e.x,t*e.y)),this.sphere)return n=X(this.long0+a/this.ns),r=Tt(this.g-i/this.a),e.x=n,e.y=r,e;var o=this.g-i/this.a;return r=It(o,this.e0,this.e1,this.e2,this.e3),n=X(this.long0+a/this.ns),e.x=n,e.y=r,e},names:["Equidistant_Conic","eqdc"]};var Zt={init:function(){this.R=this.a},forward:function(e){var t,i,r=e.x,n=e.y,a=X(r-this.long0);Math.abs(n)<=m&&(t=this.x0+this.R*a,i=this.y0);var o=Vt(2*Math.abs(n/Math.PI));(Math.abs(a)<=m||Math.abs(Math.abs(n)-u)<=m)&&(t=this.x0,i=n>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var s=.5*Math.abs(Math.PI/a-a/Math.PI),l=s*s,h=Math.sin(o),c=Math.cos(o),d=c/(h+c-1),p=d*d,f=d*(2/h-1),y=f*f,g=Math.PI*this.R*(s*(d-y)+Math.sqrt(l*(d-y)*(d-y)-(y+l)*(p-y)))/(y+l);a<0&&(g=-g),t=this.x0+g;var v=l+d;return g=Math.PI*this.R*(f*v-s*Math.sqrt((y+l)*(l+1)-v*v))/(y+l),i=n>=0?this.y0+g:this.y0-g,e.x=t,e.y=i,e},inverse:function(e){var t,i,r,n,a,o,s,l,h,c,u,d;return e.x-=this.x0,e.y-=this.y0,u=Math.PI*this.R,a=(r=e.x/u)*r+(n=e.y/u)*n,u=3*(n*n/(l=-2*(o=-Math.abs(n)*(1+a))+1+2*n*n+a*a)+(2*(s=o-2*n*n+r*r)*s*s/l/l/l-9*o*s/l/l)/27)/(h=(o-s*s/3/l)/l)/(c=2*Math.sqrt(-h/3)),Math.abs(u)>1&&(u=u>=0?1:-1),d=Math.acos(u)/3,i=e.y>=0?(-c*Math.cos(d+Math.PI/3)-s/3/l)*Math.PI:-(-c*Math.cos(d+Math.PI/3)-s/3/l)*Math.PI,t=Math.abs(r)<m?this.long0:X(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(r*r-n*n)+a*a))/2/r),e.x=t,e.y=i,e},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var Qt={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(e){var t,i,r,n,a,o,s,l,h,c,d,p,f,y,g,v,b,_,w,x,C,S,M=e.x,k=e.y,T=Math.sin(e.y),I=Math.cos(e.y),O=X(M-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=m?(e.x=this.x0+this.a*(u-k)*Math.sin(O),e.y=this.y0-this.a*(u-k)*Math.cos(O),e):Math.abs(this.sin_p12+1)<=m?(e.x=this.x0+this.a*(u+k)*Math.sin(O),e.y=this.y0+this.a*(u+k)*Math.cos(O),e):(_=this.sin_p12*T+this.cos_p12*I*Math.cos(O),b=(v=Math.acos(_))?v/Math.sin(v):1,e.x=this.x0+this.a*b*I*Math.sin(O),e.y=this.y0+this.a*b*(this.cos_p12*T-this.sin_p12*I*Math.cos(O)),e):(t=xt(this.es),i=Ct(this.es),r=St(this.es),n=Mt(this.es),Math.abs(this.sin_p12-1)<=m?(a=this.a*wt(t,i,r,n,u),o=this.a*wt(t,i,r,n,k),e.x=this.x0+(a-o)*Math.sin(O),e.y=this.y0-(a-o)*Math.cos(O),e):Math.abs(this.sin_p12+1)<=m?(a=this.a*wt(t,i,r,n,u),o=this.a*wt(t,i,r,n,k),e.x=this.x0+(a+o)*Math.sin(O),e.y=this.y0+(a+o)*Math.cos(O),e):(s=T/I,l=kt(this.a,this.e,this.sin_p12),h=kt(this.a,this.e,T),c=Math.atan((1-this.es)*s+this.es*l*this.sin_p12/(h*I)),w=0===(d=Math.atan2(Math.sin(O),this.cos_p12*Math.tan(c)-this.sin_p12*Math.cos(O)))?Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.abs(Math.abs(d)-Math.PI)<=m?-Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.asin(Math.sin(O)*Math.cos(c)/Math.sin(d)),p=this.e*this.sin_p12/Math.sqrt(1-this.es),v=l*w*(1-(x=w*w)*(g=(f=this.e*this.cos_p12*Math.cos(d)/Math.sqrt(1-this.es))*f)*(1-g)/6+(C=x*w)/8*(y=p*f)*(1-2*g)+(S=C*w)/120*(g*(4-7*g)-3*p*p*(1-7*g))-S*w/48*y),e.x=this.x0+v*Math.sin(d),e.y=this.y0+v*Math.cos(d),e))},inverse:function(e){var t,i,r,n,a,o,s,l,h,c,d,p,f,y,g,v,b,_,w,x,C,S,M;if(e.x-=this.x0,e.y-=this.y0,this.sphere){if((t=Math.sqrt(e.x*e.x+e.y*e.y))>2*u*this.a)return;return i=t/this.a,r=Math.sin(i),n=Math.cos(i),a=this.long0,Math.abs(t)<=m?o=this.lat0:(o=Vt(n*this.sin_p12+e.y*r*this.cos_p12/t),s=Math.abs(this.lat0)-u,a=Math.abs(s)<=m?this.lat0>=0?X(this.long0+Math.atan2(e.x,-e.y)):X(this.long0-Math.atan2(-e.x,e.y)):X(this.long0+Math.atan2(e.x*r,t*this.cos_p12*n-e.y*this.sin_p12*r))),e.x=a,e.y=o,e}return l=xt(this.es),h=Ct(this.es),c=St(this.es),d=Mt(this.es),Math.abs(this.sin_p12-1)<=m?(p=this.a*wt(l,h,c,d,u),t=Math.sqrt(e.x*e.x+e.y*e.y),o=It((p-t)/this.a,l,h,c,d),a=X(this.long0+Math.atan2(e.x,-1*e.y)),e.x=a,e.y=o,e):Math.abs(this.sin_p12+1)<=m?(p=this.a*wt(l,h,c,d,u),t=Math.sqrt(e.x*e.x+e.y*e.y),o=It((t-p)/this.a,l,h,c,d),a=X(this.long0+Math.atan2(e.x,e.y)),e.x=a,e.y=o,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),g=Math.atan2(e.x,e.y),f=kt(this.a,this.e,this.sin_p12),v=Math.cos(g),_=-(b=this.e*this.cos_p12*v)*b/(1-this.es),w=3*this.es*(1-_)*this.sin_p12*this.cos_p12*v/(1-this.es),S=1-_*(C=(x=t/f)-_*(1+_)*Math.pow(x,3)/6-w*(1+3*_)*Math.pow(x,4)/24)*C/2-x*C*C*C/6,y=Math.asin(this.sin_p12*Math.cos(C)+this.cos_p12*Math.sin(C)*v),a=X(this.long0+Math.asin(Math.sin(g)*Math.sin(C)/Math.cos(y))),M=Math.sin(y),o=Math.atan2((M-this.es*S*this.sin_p12)*Math.tan(y),M*(1-this.es)),e.x=a,e.y=o,e)},names:["Azimuthal_Equidistant","aeqd"]};var ei={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(e){var t,i,r,n,a,o,s,l=e.x,h=e.y;return r=X(l-this.long0),t=Math.sin(h),i=Math.cos(h),n=Math.cos(r),((a=this.sin_p14*t+this.cos_p14*i*n)>0||Math.abs(a)<=m)&&(o=1*this.a*i*Math.sin(r),s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*n)),e.x=o,e.y=s,e},inverse:function(e){var t,i,r,n,a,o,s;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),i=Vt(t/this.a),r=Math.sin(i),n=Math.cos(i),o=this.long0,Math.abs(t)<=m?(s=this.lat0,e.x=o,e.y=s,e):(s=Vt(n*this.sin_p14+e.y*r*this.cos_p14/t),a=Math.abs(this.lat0)-u,Math.abs(a)<=m?(o=this.lat0>=0?X(this.long0+Math.atan2(e.x,-e.y)):X(this.long0-Math.atan2(-e.x,e.y)),e.x=o,e.y=s,e):(o=X(this.long0+Math.atan2(e.x*r,t*this.cos_p14*n-e.y*this.sin_p14*r)),e.x=o,e.y=s,e))},names:["ortho"]},ti={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},ii={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function ri(e,t,i,r){var n;return e<m?(r.value=ii.AREA_0,n=0):(n=Math.atan2(t,i),Math.abs(n)<=v?r.value=ii.AREA_0:n>v&&n<=u+v?(r.value=ii.AREA_1,n-=u):n>u+v||n<=-(u+v)?(r.value=ii.AREA_2,n=n>=0?n-_:n+_):(r.value=ii.AREA_3,n+=u)),n}function ni(e,t){var i=e+t;return i<-_?i+=b:i>+_&&(i-=b),i}var ai={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=u-v/2?this.face=ti.TOP:this.lat0<=-(u-v/2)?this.face=ti.BOTTOM:Math.abs(this.long0)<=v?this.face=ti.FRONT:Math.abs(this.long0)<=u+v?this.face=this.long0>0?ti.RIGHT:ti.LEFT:this.face=ti.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(e){var t,i,r,n,a,o,s={x:0,y:0},l={value:0};if(e.x-=this.long0,t=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(e.y)):e.y,i=e.x,this.face===ti.TOP)n=u-t,i>=v&&i<=u+v?(l.value=ii.AREA_0,r=i-u):i>u+v||i<=-(u+v)?(l.value=ii.AREA_1,r=i>0?i-_:i+_):i>-(u+v)&&i<=-v?(l.value=ii.AREA_2,r=i+u):(l.value=ii.AREA_3,r=i);else if(this.face===ti.BOTTOM)n=u+t,i>=v&&i<=u+v?(l.value=ii.AREA_0,r=-i+u):i<v&&i>=-v?(l.value=ii.AREA_1,r=-i):i<-v&&i>=-(u+v)?(l.value=ii.AREA_2,r=-i-u):(l.value=ii.AREA_3,r=i>0?-i+_:-i-_);else{var h,c,d,p,f,m;this.face===ti.RIGHT?i=ni(i,+u):this.face===ti.BACK?i=ni(i,+_):this.face===ti.LEFT&&(i=ni(i,-u)),p=Math.sin(t),f=Math.cos(t),m=Math.sin(i),h=f*Math.cos(i),c=f*m,d=p,this.face===ti.FRONT?r=ri(n=Math.acos(h),d,c,l):this.face===ti.RIGHT?r=ri(n=Math.acos(c),d,-h,l):this.face===ti.BACK?r=ri(n=Math.acos(-h),d,-c,l):this.face===ti.LEFT?r=ri(n=Math.acos(-c),d,h,l):(n=r=0,l.value=ii.AREA_0)}return o=Math.atan(12/_*(r+Math.acos(Math.sin(r)*Math.cos(v))-u)),a=Math.sqrt((1-Math.cos(n))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(r))))),l.value===ii.AREA_1?o+=u:l.value===ii.AREA_2?o+=_:l.value===ii.AREA_3&&(o+=1.5*_),s.x=a*Math.cos(o),s.y=a*Math.sin(o),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,e.x=s.x,e.y=s.y,e},inverse:function(e){var t,i,r,n,a,o,s,l,h,c,d,p,f={lam:0,phi:0},m={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,i=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),t=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?m.value=ii.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(m.value=ii.AREA_1,t-=u):e.x<0&&-e.x>=Math.abs(e.y)?(m.value=ii.AREA_2,t=t<0?t+_:t-_):(m.value=ii.AREA_3,t+=u),h=_/12*Math.tan(t),a=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),o=Math.atan(a),(s=1-(r=Math.cos(t))*r*(n=Math.tan(i))*n*(1-Math.cos(Math.atan(1/Math.cos(o)))))<-1?s=-1:s>1&&(s=1),this.face===ti.TOP)l=Math.acos(s),f.phi=u-l,m.value===ii.AREA_0?f.lam=o+u:m.value===ii.AREA_1?f.lam=o<0?o+_:o-_:m.value===ii.AREA_2?f.lam=o-u:f.lam=o;else if(this.face===ti.BOTTOM)l=Math.acos(s),f.phi=l-u,m.value===ii.AREA_0?f.lam=-o+u:m.value===ii.AREA_1?f.lam=-o:m.value===ii.AREA_2?f.lam=-o-u:f.lam=o<0?-o-_:-o+_;else{var y,g,v;h=(y=s)*y,g=(h+=(v=h>=1?0:Math.sqrt(1-h)*Math.sin(o))*v)>=1?0:Math.sqrt(1-h),m.value===ii.AREA_1?(h=g,g=-v,v=h):m.value===ii.AREA_2?(g=-g,v=-v):m.value===ii.AREA_3&&(h=g,g=v,v=-h),this.face===ti.RIGHT?(h=y,y=-g,g=h):this.face===ti.BACK?(y=-y,g=-g):this.face===ti.LEFT&&(h=y,y=g,g=-h),f.phi=Math.acos(-v)-u,f.lam=Math.atan2(g,y),this.face===ti.RIGHT?f.lam=ni(f.lam,-u):this.face===ti.BACK?f.lam=ni(f.lam,-_):this.face===ti.LEFT&&(f.lam=ni(f.lam,+u))}return 0!==this.es&&(c=f.phi<0?1:0,d=Math.tan(f.phi),p=this.b/Math.sqrt(d*d+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),c&&(f.phi=-f.phi)),f.lam+=this.long0,e.x=f.lam,e.y=f.phi,e},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},oi=[[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]],si=[[-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]],li=.8487,hi=1.3523,ci=g/5,ui=1/ci,di=18,pi=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},fi=function(e,t){return e[1]+t*(2*e[2]+3*t*e[3])};var mi={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(e){var t=X(e.x-this.long0),i=Math.abs(e.y),r=Math.floor(i*ci);r<0?r=0:r>=di&&(r=di-1),i=g*(i-ui*r);var n={x:pi(oi[r],i)*t,y:pi(si[r],i)};return e.y<0&&(n.y=-n.y),n.x=n.x*this.a*li+this.x0,n.y=n.y*this.a*hi+this.y0,n},inverse:function(e){var t={x:(e.x-this.x0)/(this.a*li),y:Math.abs(e.y-this.y0)/(this.a*hi)};if(t.y>=1)t.x/=oi[di][0],t.y=e.y<0?-u:u;else{var i=Math.floor(t.y*di);for(i<0?i=0:i>=di&&(i=di-1);;)if(si[i][0]>t.y)--i;else{if(!(si[i+1][0]<=t.y))break;++i}var r=si[i],n=5*(t.y-r[0])/(si[i+1][0]-r[0]);n=function(e,t,i,r){for(var n=t;r;--r){var a=e(n);if(n-=a,Math.abs(a)<i)break}return n}(function(e){return(pi(r,e)-t.y)/fi(r,e)},n,m,100),t.x/=pi(oi[i],n),t.y=(5*i+n)*y,e.y<0&&(t.y=-t.y)}return t.x=X(t.x+this.long0),t},names:["Robinson","robin"]};var yi={init:function(){this.name="geocent"},forward:function(e){return ye(e,this.es,this.a)},inverse:function(e){return ge(e,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},gi={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},vi={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};var bi={init:function(){if(Object.keys(vi).forEach(function(e){if(void 0===this[e])this[e]=vi[e].def;else{if(vi[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);vi[e].num&&(this[e]=parseFloat(this[e]))}vi[e].degrees&&(this[e]=this[e]*y)}.bind(this)),Math.abs(Math.abs(this.lat0)-u)<m?this.mode=this.lat0<0?gi.S_POLE:gi.N_POLE:Math.abs(this.lat0)<m?this.mode=gi.EQUIT:(this.mode=gi.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)},forward:function(e){e.x-=this.long0;var t,i,r,n,a=Math.sin(e.y),o=Math.cos(e.y),s=Math.cos(e.x);switch(this.mode){case gi.OBLIQ:i=this.sinph0*a+this.cosph0*o*s;break;case gi.EQUIT:i=o*s;break;case gi.S_POLE:i=-a;break;case gi.N_POLE:i=a}switch(t=(i=this.pn1/(this.p-i))*o*Math.sin(e.x),this.mode){case gi.OBLIQ:i*=this.cosph0*a-this.sinph0*o*s;break;case gi.EQUIT:i*=a;break;case gi.N_POLE:i*=-o*s;break;case gi.S_POLE:i*=o*s}return n=1/((r=i*this.cg+t*this.sg)*this.sw*this.h1+this.cw),t=(t*this.cg-i*this.sg)*this.cw*n,i=r*n,e.x=t*this.a,e.y=i*this.a,e},inverse:function(e){e.x/=this.a,e.y/=this.a;var t,i,r,n={x:e.x,y:e.y};r=1/(this.pn1-e.y*this.sw),t=this.pn1*e.x*r,i=this.pn1*e.y*this.cw*r,e.x=t*this.cg+i*this.sg,e.y=i*this.cg-t*this.sg;var a=rt(e.x,e.y);if(Math.abs(a)<m)n.x=0,n.y=e.y;else{var o,s;switch(s=1-a*a*this.pfact,s=(this.p-Math.sqrt(s))/(this.pn1/a+a/this.pn1),o=Math.sqrt(1-s*s),this.mode){case gi.OBLIQ:n.y=Math.asin(o*this.sinph0+e.y*s*this.cosph0/a),e.y=(o-this.sinph0*Math.sin(n.y))*a,e.x*=s*this.cosph0;break;case gi.EQUIT:n.y=Math.asin(e.y*s/a),e.y=o*a,e.x*=s;break;case gi.N_POLE:n.y=Math.asin(o),e.y=-e.y;break;case gi.S_POLE:n.y=-Math.asin(o)}n.x=Math.atan2(e.x,e.y)}return e.x=n.x+this.long0,e.y=n.y,e},names:["Tilted_Perspective","tpers"]};var _i={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>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 e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,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(e){var t,i,r,n,a=e.x,o=e.y;if(a-=this.long0,"ellipse"===this.shape){o=Math.atan(this.radius_p2*Math.tan(o));var s=this.radius_p/rt(this.radius_p*Math.cos(o),Math.sin(o));if(i=s*Math.cos(a)*Math.cos(o),r=s*Math.sin(a)*Math.cos(o),n=s*Math.sin(o),(this.radius_g-i)*i-r*r-n*n*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;t=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(r/rt(n,t)),e.y=this.radius_g_1*Math.atan(n/t)):(e.x=this.radius_g_1*Math.atan(r/t),e.y=this.radius_g_1*Math.atan(n/rt(r,t)))}else"sphere"===this.shape&&(t=Math.cos(o),i=Math.cos(a)*t,r=Math.sin(a)*t,n=Math.sin(o),t=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(r/rt(n,t)),e.y=this.radius_g_1*Math.atan(n/t)):(e.x=this.radius_g_1*Math.atan(r/t),e.y=this.radius_g_1*Math.atan(n/rt(r,t))));return e.x=e.x*this.a,e.y=e.y*this.a,e},inverse:function(e){var t,i,r,n,a=-1,o=0,s=0;if(e.x=e.x/this.a,e.y=e.y/this.a,"ellipse"===this.shape){this.flip_axis?(s=Math.tan(e.y/this.radius_g_1),o=Math.tan(e.x/this.radius_g_1)*rt(1,s)):(o=Math.tan(e.x/this.radius_g_1),s=Math.tan(e.y/this.radius_g_1)*rt(1,o));var l=s/this.radius_p;if(t=o*o+l*l+a*a,(r=(i=2*this.radius_g*a)*i-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;n=(-i-Math.sqrt(r))/(2*t),a=this.radius_g+n*a,o*=n,s*=n,e.x=Math.atan2(o,a),e.y=Math.atan(s*Math.cos(e.x)/a),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if("sphere"===this.shape){if(this.flip_axis?(s=Math.tan(e.y/this.radius_g_1),o=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+s*s)):(o=Math.tan(e.x/this.radius_g_1),s=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+o*o)),t=o*o+s*s+a*a,(r=(i=2*this.radius_g*a)*i-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;n=(-i-Math.sqrt(r))/(2*t),a=this.radius_g+n*a,o*=n,s*=n,e.x=Math.atan2(o,a),e.y=Math.atan(s*Math.cos(e.x)/a)}return e.x=e.x+this.long0,e},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]},wi=1.340264,xi=-.081106,Ci=893e-6,Si=.003796,Mi=Math.sqrt(3)/2;var ki={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0},forward:function(e){var t=X(e.x-this.long0),i=e.y,r=Math.asin(Mi*Math.sin(i)),n=r*r,a=n*n*n;return e.x=t*Math.cos(r)/(Mi*(wi+3*xi*n+a*(7*Ci+9*Si*n))),e.y=r*(wi+xi*n+a*(Ci+Si*n)),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a;var t,i,r,n,a=e.y;for(n=0;n<12&&(a-=r=(a*(wi+xi*(t=a*a)+(i=t*t*t)*(Ci+Si*t))-e.y)/(wi+3*xi*t+i*(7*Ci+9*Si*t)),!(Math.abs(r)<1e-9));++n);return i=(t=a*a)*t*t,e.x=Mi*e.x*(wi+3*xi*t+i*(7*Ci+9*Si*t))/Math.cos(a),e.y=Math.asin(Math.sin(a)/Mi),e.x=X(e.x+this.long0),e},names:["eqearth","Equal Earth","Equal_Earth"]};Le.defaultDatum="WGS84",Le.Proj=me,Le.WGS84=new Le.Proj("WGS84"),Le.Point=Je,Le.toPoint=Se,Le.defs=F,Le.nadgrid=function(e,t){var i=new DataView(t),r=function(e){var t=e.getInt32(8,!1);return 11!==t&&(11!==(t=e.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(i),n=function(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:ce(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}(i,r),a={header:n,subgrids:function(e,t,i){for(var r=176,n=[],a=0;a<t.nSubgrids;a++){var o=de(e,r,i),s=pe(e,r,o,i),l=Math.round(1+(o.upperLongitude-o.lowerLongitude)/o.longitudeInterval),h=Math.round(1+(o.upperLatitude-o.lowerLatitude)/o.latitudeInterval);n.push({ll:[he(o.lowerLongitude),he(o.lowerLatitude)],del:[he(o.longitudeInterval),he(o.latitudeInterval)],lim:[l,h],count:o.gridNodeCount,cvs:ue(s)}),r+=176+16*o.gridNodeCount}return n}(i,n,r)};return se[e]=a,a},Le.transform=Te,Le.mgrs=Ge,Le.version="__VERSION__",function(e){e.Proj.projections.add(tt),e.Proj.projections.add(lt),e.Proj.projections.add(ct),e.Proj.projections.add(ft),e.Proj.projections.add(mt),e.Proj.projections.add(yt),e.Proj.projections.add(vt),e.Proj.projections.add(bt),e.Proj.projections.add(_t),e.Proj.projections.add(Ot),e.Proj.projections.add(Dt),e.Proj.projections.add(Nt),e.Proj.projections.add(Gt),e.Proj.projections.add(Bt),e.Proj.projections.add(qt),e.Proj.projections.add(Wt),e.Proj.projections.add(Ht),e.Proj.projections.add(Yt),e.Proj.projections.add($t),e.Proj.projections.add(Jt),e.Proj.projections.add(Kt),e.Proj.projections.add(Zt),e.Proj.projections.add(Qt),e.Proj.projections.add(ei),e.Proj.projections.add(ai),e.Proj.projections.add(mi),e.Proj.projections.add(yi),e.Proj.projections.add(bi),e.Proj.projections.add(_i),e.Proj.projections.add(ki)}(Le);var Ti=Le;function Ii(e,t){return e.length>2?Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]+t):Cesium.Cartesian3.fromDegrees(e[0],e[1],t)}function Oi(e,t,i,r){const n=[];for(let a,o=0,s=e.length;o<s;o++)a=t?Oi(e[o],t-1,i,r):(i||Ii)(e[o],r),n.push(a);return n}function Ei(e,t){return"4326"!==String(e.wkid)?(t.spatialReference=e,n.Projection.project(t,new n.SpatialReference("EPSG:4326"))):t}var Li=class{static toCartesian3Array(e,t){let i=[];const r=Object(n.defaultValue)(t,{}),a=Object(n.defaultValue)(r.offsetHeight,0);if(!(e instanceof n.Geometry))return i;let o=Object(n.defaultValue)(r.spatialReference,new n.SpatialReference("EPSG:4326"));switch(e.spatialReference&&(o=e.spatialReference),e.type){case n.GeometryType.point:{let t=e.clone();const r=(t=Ei(o,t)).coordinates;i.push(Ii(r,a));break}case n.GeometryType.multiPoint:case n.GeometryType.lineString:{let t=e.clone();i=Oi((t=Ei(o,t)).coordinates,0,Ii,a);break}case n.GeometryType.multiLineString:case n.GeometryType.polygon:{let t=e.clone();i=Oi((t=Ei(o,t)).coordinates,1,Ii,a);break}case n.GeometryType.multiPolygon:{let t=e.clone();i=Oi((t=Ei(o,t)).coordinates,2,Ii,a);break}case n.GeometryType.extent:{let t=e.clone();const r=(t=Ei(o,t)).xmin,n=t.xmax,s=t.ymin,l=t.ymax,h=t.zmin,c=t.zmax;let u,d;t.hasZ?(u=Cesium.Cartesian3.fromDegrees(r,s,h+a),d=Cesium.Cartesian3.fromDegrees(n,l,c+a)):(u=Cesium.Cartesian3.fromDegrees(r,s,a),d=Cesium.Cartesian3.fromDegrees(n,l,a)),i.push(u),i.push(d);break}case n.GeometryType.circle:{let t,r=e.clone();const n=(r=Ei(o,r)).center;t=r.hasZ?Cesium.Cartesian3.fromDegrees(n[0],n[1],n[2]+a):Cesium.Cartesian3.fromDegrees(n[0],n[1],a),i.push(t);break}}return i}},Pi=i(1);function Ri(e){let t,i,r,n,a=0;const o=e,s=[];for(t=1;t<o.length;t++)i=o[t],r=o[t-1],a+=n=Cesium.Cartesian3.distance(i,r),s.push(n);this.lenArr=s,this.len=a,this.coords=o}Ri.prototype.getTotalLength=function(){return this.len},Ri.prototype.getDetail=function(e){let t,i,r=e;r>=1&&(r=1),r<=0&&(r=0);const n=r*this.len;let a,o=0;const s=this.coords;for(a=0;a<this.lenArr.length;a++){if(n<=this.lenArr[a]+o){t=a,i=(n-o)/this.lenArr[a];break}o+=this.lenArr[a]}const l=new Cesium.Cartesian3;return Cesium.Cartesian3.lerp(s[t],s[t+1],i,l),{position:l,angle:180*window.Math.atan2(s[t+1].y-s[t].y,s[t+1].x-s[t].x)/window.Math.PI}},Ri.prototype.getPartsByLength=function(e){const t=window.Math.round(e/this.len*1e3)/1e3,i=window.Math.ceil(this.len/e),r=[];if(1===i)r.push({startRate:0,endRate:1});else{let e;for(e=1;e<i;e++)r.push({startRate:(e-1)*t,endRate:e*t})}return r};var ji=Ri,Ai=i(2);const zi=Li.toCartesian3Array;function Di(e,t){const i=Pi.a.convertLabelClassToLabelNoteStyle(t);return Ai.a.parseNoteOptions(e,i)}function Vi(e){return e instanceof Cesium.LabelCollection?Ai.a.createLabelOptions:e instanceof Cesium.BillboardCollection?Ai.a.createNoteBillBoardOptions:Ai.a.createGroundOptions}function Ni(e,t,i,r,n,a,o){const s=[],l=function(e,t,i,r,n){let a=n-r;(a<=0||a>=1)&&(a=.4);const o=t-e,s=a*o;return{spaceRate:r*o+e,parseRate:Math.round(s/i*1e3)/1e3}}(i,r,n.length,o.repeatStartRate,o.repeatEndRate);for(let i=0;i<n.length;i++){const r=e.getDetail(l.spaceRate+l.parseRate*i),h=Vi(t)(a,n[i],r.position,o);s.push(h)}return s}function Gi(e){const t=n.T.bbox(e),i=Math.PI,r=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(t[0]/180*i,t[3]/180*i)),a=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(t[0]/180*i,t[1]/180*i)),o=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(t[2]/180*i,t[3]/180*i));let s;return function(e,t,i,r,a,o,s){const l=n.T.lineSegment(t),h=0===e,c=h?(a-r)/i:(s-o)/i,u=[];let d,p;for(d=0;d<i;d++){const e=h?n.T.lineString([[r+d*c,s],[r+d*c,o]]):n.T.lineString([[a,s-d*c],[r,s-d*c]]),t=n.T.lineIntersect(e,l),i=t.features.length,f=[];let m;if(!(i<1)){for(p=0;p<i;p++)f.push(n.T.getCoord(t.features[p]));if(1===i)m=f[0],u.push(m);else{let e=0;for(let t=0;t<i;t+=2){const i=f[t],r=f[t+1];let n;h?(n=Math.abs(r[1]-i[1]))>=e&&(e=n,m=[i[0],(r[1]-i[1])/2+i[1]]):(n=Math.abs(r[0]-i[0]))>=e&&(e=n,m=[i[0]+(r[0]-i[0])/2,i[1]])}u.push(m)}}}return u}(s=Cesium.Cartesian3.distance(r,o)>Cesium.Cartesian3.distance(r,a)?0:1,e,20,t[0],t[2],t[1],t[3])}class Fi{static renderLabel(e,t,i){const r=Fi.createLabels(e,t,i);return r.forEach(t=>{e.add(t)}),r}static removeLabels(e,t){const i=e._labels||e._billboards||e._primitives,r=[];t.forEach(e=>{const t=e.id;for(let e=0;e<i.length;e++)i[e].id===t&&r.push(i[e])}),r.forEach(t=>{e.remove(t)})}static createLabels(e,t,i){let r=[];if(t=t||[],!Array.isArray(t)||t.length<=0)return r;const a=t[0].geometry.type;let o;o=[n.GeometryType.multiPolygon,n.GeometryType.polygon].some(e=>e===a)?Di("Polygon",i):[n.GeometryType.lineString,n.GeometryType.multiLineString].some(e=>e===a)?Di("Line",i):Di("Point",i);const{currentAttributeName:s,labelExpression:l,symbol:h={}}=i,c=s?`$feature.${s}`:l,u=Vi(e);return t.forEach(t=>{const i=t.geometry,a=i.type;let s=zi(i);const l=Pi.a.parseExpression(t,c)||h.text||t.symbol.text,d=t.id;if(!l)return r;switch(a){case n.GeometryType.point:case n.GeometryType.multiPoint:{const e=a===n.GeometryType.point?[i.coordinates]:i.coordinates;s.forEach((t,i)=>{const n=u(d,l,t,o);n.__latLng__=e[i],r.push(n)});break}case n.GeometryType.multiLineString:case n.GeometryType.lineString:a===n.GeometryType.lineString&&(s=[s]),s.forEach(t=>{let i=o.lineLabelSpread;const n=o.repeatLabel,a=o.repeatLabelDistance,s=o.labelPositionAlong;if(!l)return r;let h;const c=new ji(t);if("auto-spread"===i){i=new RegExp("^[A-Za-z0-9]+$").test(l)?"centralization-spread":"decentralize-spread"}if("decentralize-spread"===i){const t=l.split("");if(n){c.getPartsByLength(a).forEach(function(i){const n=i.startRate,a=i.endRate,s=Ni(c,e,n,a,t,d,o);r=r.concat(s)})}else{const i=Ni(c,e,0,1,t,d,o);r=r.concat(i)}}else if("centralization-spread"===i)if(n){c.getPartsByLength(a).forEach(function(e){const t=e.startRate,i=e.endRate;if("start"===s){h=c.getDetail(t).position;const e=u(d,l,h,o);r.push(e)}else if("end"===s){h=c.getDetail(i).position;const e=u(d,l,h,o);r.push(e)}else{h=c.getDetail((i-t)/2+t).position;const e=u(d,l,h,o);r.push(e)}})}else if("start"===s){h=c.getDetail(0).position;const e=u(d,l,h,o);r.push(e)}else if("end"===s){h=c.getDetail(1).position;const e=u(d,l,h,o);r.push(e)}else{h=c.getDetail(.5).position;const e=u(d,l,h,o);r.push(e)}});break;case n.GeometryType.multiPolygon:case n.GeometryType.polygon:a===n.GeometryType.polygon&&(s=[s]),s.forEach(t=>{t.forEach(t=>{const i=o.type,a=function(e){if(!e||0===e.length)return null;const t=e.length;let i;const r=[];let n,a;for(i=0;i<t;i++){const t=Cesium.Cartographic.fromCartesian(e[i]);r.push([180*t.longitude/Math.PI,180*t.latitude/Math.PI]),0===i&&(n=t.height,a=t.height),n=Math.max(n,t.height),a=Math.min(a,t.height)}return{latlngArr:r,maxHeight:n,minHeight:a}}(t),s=a.maxHeight,h=a.minHeight,c=n.T.polygon([a.latlngArr]),p=n.T.getCoord(n.T.centroid(c));let f=new Cesium.Cartesian3;if("parallel"===i){f=Cesium.Cartesian3.fromDegrees(p[0],p[1],(s+h)/2);const e=u(d,l,f,o);r.push(e)}else if("outside"===i||"bottom"===i){const e=n.T.bbox(c),t=n.T.lineSegment(c),a=[e[0],e[1]],p=[e[2],e[3]],m=n.T.lineString([p,a]),y=n.T.lineIntersect(m,t);let g;if(0===y.features.length)g="outside"===i?p:a;else{const e="outside"===i?p:a;g=n.T.getCoord(n.T.nearestPoint(n.T.point(e),y))}o.positionOffsetXRate=1,o.positionOffsetYRate=1,f=Cesium.Cartesian3.fromDegrees(g[0],g[1],(s+h)/2);const v=u(d,l,f,o);r.push(v)}else if("straight"===i||"skeleton"===i){const t=Gi(c);if(t.length<2)return r;const n=[],a=l.split("");t.forEach(function(e){n.push(Cesium.Cartographic.toCartesian(new Cesium.Cartographic(e[0]/180*Math.PI,e[1]/180*Math.PI,0)))});const s=new ji(n);if("skeleton"===i){const t=Ni(s,e,o.skeletonLineStartRate,o.skeletonLineEndRate,a,d,o);r=r.concat(t)}else{const e=s.getDetail(.5),t=u(d,l,e.position,o);r.push(t)}}})})}}),r}}var Bi=Fi;function qi(e,t,i,r,n){!function e(t,i,r,n,a){for(;n>r;){if(n-r>600){var o=n-r+1,s=i-r+1,l=Math.log(o),h=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*h*(o-h)/o)*(s-o/2<0?-1:1),u=Math.max(r,Math.floor(i-s*h/o+c)),d=Math.min(n,Math.floor(i+(o-s)*h/o+c));e(t,i,u,d,a)}var p=t[i],f=r,m=n;for(Ui(t,r,i),a(t[n],p)>0&&Ui(t,r,n);f<m;){for(Ui(t,f,m),f++,m--;a(t[f],p)<0;)f++;for(;a(t[m],p)>0;)m--}0===a(t[r],p)?Ui(t,r,m):Ui(t,++m,n),m<=i&&(r=m+1),i<=m&&(n=m-1)}}(e,t,i||0,r||e.length-1,n||Wi)}function Ui(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function Wi(e,t){return e<t?-1:e>t?1:0}function Hi(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function Yi(e,t,i){if(!i)return t.indexOf(e);for(var r=0;r<t.length;r++)if(i(e,t[r]))return r;return-1}function Xi(e,t){$i(e,0,e.children.length,t,e)}function $i(e,t,i,r,n){n||(n=ar(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var a=t;a<i;a++){var o=e.children[a];Ji(n,e.leaf?r(o):o)}return n}function Ji(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function Ki(e,t){return e.minX-t.minX}function Zi(e,t){return e.minY-t.minY}function Qi(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function er(e){return e.maxX-e.minX+(e.maxY-e.minY)}function tr(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function ir(e,t){var i=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),a=Math.min(e.maxY,t.maxY);return Math.max(0,n-i)*Math.max(0,a-r)}function rr(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function nr(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function ar(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function or(e,t,i,r,n){for(var a=[t,i];a.length;)if(!((i=a.pop())-(t=a.pop())<=r)){var o=t+Math.ceil((i-t)/r/2)*r;qi(e,o,t,i,n),a.push(t,o,o,i)}}Hi.prototype.all=function(){return this._all(this.data,[])},Hi.prototype.search=function(e){var t=this.data,i=[];if(!nr(e,t))return i;for(var r=this.toBBox,n=[];t;){for(var a=0;a<t.children.length;a++){var o=t.children[a],s=t.leaf?r(o):o;nr(e,s)&&(t.leaf?i.push(o):rr(e,s)?this._all(o,i):n.push(o))}t=n.pop()}return i},Hi.prototype.collides=function(e){var t=this.data;if(!nr(e,t))return!1;for(var i=[];t;){for(var r=0;r<t.children.length;r++){var n=t.children[r],a=t.leaf?this.toBBox(n):n;if(nr(e,a)){if(t.leaf||rr(e,a))return!0;i.push(n)}}t=i.pop()}return!1},Hi.prototype.load=function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0;t<e.length;t++)this.insert(e[t]);return this}var i=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var r=this.data;this.data=i,i=r}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},Hi.prototype.insert=function(e){return e&&this._insert(e,this.data.height-1),this},Hi.prototype.clear=function(){return this.data=ar([]),this},Hi.prototype.remove=function(e,t){if(!e)return this;for(var i,r,n,a=this.data,o=this.toBBox(e),s=[],l=[];a||s.length;){if(a||(a=s.pop(),r=s[s.length-1],i=l.pop(),n=!0),a.leaf){var h=Yi(e,a.children,t);if(-1!==h)return a.children.splice(h,1),s.push(a),this._condense(s),this}n||a.leaf||!rr(a,o)?r?(i++,a=r.children[i],n=!1):a=null:(s.push(a),l.push(i),i=0,r=a,a=a.children[0])}return this},Hi.prototype.toBBox=function(e){return e},Hi.prototype.compareMinX=function(e,t){return e.minX-t.minX},Hi.prototype.compareMinY=function(e,t){return e.minY-t.minY},Hi.prototype.toJSON=function(){return this.data},Hi.prototype.fromJSON=function(e){return this.data=e,this},Hi.prototype._all=function(e,t){for(var i=[];e;)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},Hi.prototype._build=function(e,t,i,r){var n,a=i-t+1,o=this._maxEntries;if(a<=o)return Xi(n=ar(e.slice(t,i+1)),this.toBBox),n;r||(r=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,r-1))),(n=ar([])).leaf=!1,n.height=r;var s=Math.ceil(a/o),l=s*Math.ceil(Math.sqrt(o));or(e,t,i,l,this.compareMinX);for(var h=t;h<=i;h+=l){var c=Math.min(h+l-1,i);or(e,h,c,s,this.compareMinY);for(var u=h;u<=c;u+=s){var d=Math.min(u+s-1,c);n.children.push(this._build(e,u,d,r-1))}}return Xi(n,this.toBBox),n},Hi.prototype._chooseSubtree=function(e,t,i,r){for(;r.push(t),!t.leaf&&r.length-1!==i;){for(var n=1/0,a=1/0,o=void 0,s=0;s<t.children.length;s++){var l=t.children[s],h=Qi(l),c=tr(e,l)-h;c<a?(a=c,n=h<n?h:n,o=l):c===a&&h<n&&(n=h,o=l)}t=o||t.children[0]}return t},Hi.prototype._insert=function(e,t,i){var r=i?e:this.toBBox(e),n=[],a=this._chooseSubtree(r,this.data,t,n);for(a.children.push(e),Ji(a,r);t>=0&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(r,n,t)},Hi.prototype._split=function(e,t){var i=e[t],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);var a=this._chooseSplitIndex(i,n,r),o=ar(i.children.splice(a,i.children.length-a));o.height=i.height,o.leaf=i.leaf,Xi(i,this.toBBox),Xi(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(i,o)},Hi.prototype._splitRoot=function(e,t){this.data=ar([e,t]),this.data.height=e.height+1,this.data.leaf=!1,Xi(this.data,this.toBBox)},Hi.prototype._chooseSplitIndex=function(e,t,i){for(var r,n=1/0,a=1/0,o=t;o<=i-t;o++){var s=$i(e,0,o,this.toBBox),l=$i(e,o,i,this.toBBox),h=ir(s,l),c=Qi(s)+Qi(l);h<n?(n=h,r=o,a=c<a?c:a):h===n&&c<a&&(a=c,r=o)}return r||i-t},Hi.prototype._chooseSplitAxis=function(e,t,i){var r=e.leaf?this.compareMinX:Ki,n=e.leaf?this.compareMinY:Zi;this._allDistMargin(e,t,i,r)<this._allDistMargin(e,t,i,n)&&e.children.sort(r)},Hi.prototype._allDistMargin=function(e,t,i,r){e.children.sort(r);for(var n=this.toBBox,a=$i(e,0,t,n),o=$i(e,i-t,i,n),s=er(a)+er(o),l=t;l<i-t;l++){var h=e.children[l];Ji(a,e.leaf?n(h):h),s+=er(a)}for(var c=i-t-1;c>=t;c--){var u=e.children[c];Ji(o,e.leaf?n(u):u),s+=er(o)}return s},Hi.prototype._adjustParentBBoxes=function(e,t,i){for(var r=i;r>=0;r--)Ji(t[r],e)},Hi.prototype._condense=function(e){for(var t=e.length-1,i=void 0;t>=0;t--)0===e[t].children.length?t>0?(i=e[t-1].children).splice(i.indexOf(e[t]),1):this.clear():Xi(e[t],this.toBBox)};var sr=Hi;function lr(e,t){if(t=Cesium.defaultValue(t,Cesium.defaultValue.EMPTY_OBJECT),this.show=Cesium.defaultValue(t.show,!0),this._scene=e,!Cesium.defined(this._scene))throw new Cesium.RuntimeError("必须传入Scene.");this._enabled=Cesium.defaultValue(t.enabled,!0),this._labelFilterFunction=Cesium.defaultValue(t.labelFilterFunction,null),this._guid=Cesium.createGuid(),this._primitives=[],this._rbush=void 0,this._removeEventListener=void 0,this._cacheEntityMap={},this._rBushRefreshTime=100,this._rBushRefreshFunction=null,this._rBushDitry=!0,this.init()}function hr(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function cr(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function ur(e,t){let i=e.data;if(!cr(t,i))return;const r=[];for(;i;){for(let n=0;n<i.children.length;n++){const a=i.children[n],o=i.leaf?e.toBBox(a):a;if(cr(t,o)){if(i.leaf||hr(t,o))return o;r.push(a)}}i=r.pop()}}function dr(e,t){const i=e.canvas.clientWidth,r=e.canvas.clientHeight,n=t.maxX,a=t.maxY,o=t.minX,s=t.minY;return o>i&&s>r||n<0&&a<0}function pr(e,t){let i;if(e instanceof Cesium.Billboard){if(!e||!e.color)return;if(e.show&&t&&e.color.alpha>=1)return;if(!t&&e.color.alpha<=0)return;e._labelRaq&&window.cancelAnimationFrame(e._labelRaq),function r(n){if(e){let n=e.color.alpha;t?(e.show=!0,(n+=.06)>=1?(n=1,e.color=e.color.withAlpha(n),window.cancelAnimationFrame(i)):(e.color=e.color.withAlpha(n),i=window.requestAnimationFrame(r),e._labelRaq=i)):(n-=.06)<=0?(e.show=!1,n=0,e.color=e.color.withAlpha(n),window.cancelAnimationFrame(i)):(e.color=e.color.withAlpha(n),i=window.requestAnimationFrame(r),e._labelRaq=i)}}()}else e.show=t}function fr(e){return e instanceof Cesium.BillboardCollection?Array.isArray(e._billboards)?e._billboards.slice(0).filter(function(e){return e?!e._isInitEntityVisualizer:e}):[]:e instanceof Cesium.LabelCollection?Array.isArray(e._labels)?e._labels.slice(0).filter(function(e){return e?!e._isInitEntityVisualizer:e}):[]:e instanceof Cesium.PrimitiveCollection&&Array.isArray(e._primitives)?e._primitives.slice(0).filter(function(e){return e?!e._isInitEntityVisualizer:e}):[]}lr.prototype.init=function(){Cesium.defined(this._scene)&&(this._rbush=new sr,this._initUpdateFunction(),this._removeEventListener=this._scene.camera.changed.addEventListener(()=>{this._rBushDitry=!0}))},lr.prototype._initUpdateFunction=function(){return this._rBushRefreshFunction?this._rBushRefreshFunction:(this._rBushRefreshFunction=Object(n.throttle)(()=>{try{this._rBushDitry=!1,this._updateVisual()}catch(e){console.error(e)}},this._rBushRefreshTime,this),this._rBushRefreshFunction)},lr.prototype.add=function(e,t,i){const r=Cesium.defined(t);if(!Cesium.defined(e))throw new Cesium.DeveloperError("primitive is required.");if(r){if(t<0)throw new Cesium.DeveloperError("index must be greater than or equal to zero.");if(t>this._primitives.length)throw new Cesium.DeveloperError("index must be less than or equal to the number of primitives.")}const n=e._external=e._external||{};return(n._composites=n._composites||{})[this._guid]={collection:this},r?this._primitives.splice(t,0,e):this._primitives.push(e),e._dynamicEntityVisualizer_uuid||(e._dynamicEntityVisualizer_uuid=Cesium.createGuid()),this._cacheEntityMap[e._dynamicEntityVisualizer_uuid]={itemCollection:fr(e),zIndex:Cesium.defined(i)?i:0},e},lr.prototype.remove=function(e){const t=this._primitives.indexOf(e);t>-1&&(this._primitives.splice(t,1),delete this._cacheEntityMap[e._dynamicEntityVisualizer_uuid])},lr.prototype.setLabelVisible=function(e,t){e&&(e.notRendering=!t)},lr.prototype.getLabelVisible=function(e){return!e||e.notRendering},lr.prototype.removeAll=function(){const e=this._primitives,t=e.length;for(let i=0;i<t;++i)delete e[i]._external._composites[this._guid],e[i].destroy();this._primitives=[],this._cacheEntityMap={}},lr.prototype._forceVisual=function(){this._rBushRefreshFunction()},lr.prototype._updateVisual=function(){const e=this._scene;if(!e)return;const t=this._rbush;if(t){t.clear();const i=this._primitives,r=this;i.sort(function(e,t){let i=0,n=0;const a=r._cacheEntityMap[e._dynamicEntityVisualizer_uuid],o=r._cacheEntityMap[t._dynamicEntityVisualizer_uuid];return a&&Cesium.defined(a.zIndex)&&(i=a.zIndex),o&&Cesium.defined(o.zIndex)&&(n=o.zIndex),n-i}),i.forEach(function(i,n){const a=r._cacheEntityMap[i._dynamicEntityVisualizer_uuid];(a?a.itemCollection:[]).forEach(function(e){e instanceof Cesium.Billboard&&e._imageIndexPromise?e._imageIndexPromise.then(function(){e._isInitEntityVisualizer=!0}):e._isInitEntityVisualizer=!0}),function(e,t,i){let r=i._billboards||i._labels||i._primitives||[];const n=!!(i instanceof Cesium.PrimitiveCollection),a=e.camera.computeViewRectangle();if(a){const{east:e,north:t,south:i,west:o}=a,s=[180*o/Math.PI,180*e/Math.PI],l=[180*i/Math.PI,180*t/Math.PI];r=r.filter(e=>{if(e&&e.__latLng__){const t=e.__latLng__;return!!(t&&t[0]>s[0]&&t[0]<s[1]&&t[1]>l[0]&&t[1]<l[1])||(n?e.show=!1:pr(e,!1),!1)}return!0})}if(i instanceof Cesium.BillboardCollection||i instanceof Cesium.LabelCollection){const i=e.camera.position,n=(r=function(e,t){return e.slice(0).sort(function(e,i){const r=e&&e.position?Cesium.Cartesian3.distance(t,e.position):0,n=i&&i.position?Cesium.Cartesian3.distance(t,i.position):0;return r-n})}(r,i)).length;for(let i=0;i<n;++i){const n=r[i];if(n&&n.computeScreenSpacePosition){const i=new Cesium.Cartesian2;if(n.computeScreenSpacePosition(e,i),i){let r=new Cesium.BoundingRectangle;if(r=n instanceof Cesium.Label?Cesium.Label.getScreenSpaceBoundingBox(n,i,r):Cesium.Billboard.getScreenSpaceBoundingBox(n,i,r),isNaN(r.width)||isNaN(r.height)){pr(n,!1);continue}if(n.notRendering){pr(n,!1);continue}const a={minX:r.x,maxX:r.x+r.width,minY:r.y,maxY:r.y+r.height,data:n};if(dr(e,a)||Math.abs(a.minX-a.maxX)<3||Math.abs(a.minY-a.maxY)<3){pr(n,!1);continue}const o=ur(t,a);o?pr(n,!1):(pr(n,!0),t.insert(a))}}}}else if(i instanceof Cesium.PrimitiveCollection){const r=i._primitives||[];r.forEach(function(i){if(i instanceof Cesium.GroundPrimitive&&i._cacheGroundRect){if(i.notRendering)return void(i.show=!1);const r=i._cacheGroundRect.east,n=i._cacheGroundRect.west,a=i._cacheGroundRect.north,o=i._cacheGroundRect.south,s=[[r,a],[r,o],[n,a],[n,o]];let l,h,c,u;s.forEach(function(t){const i=Cesium.Cartographic.fromRadians(t[0],t[1],0),r=Cesium.Cartographic.toCartesian(i),n=Cesium.SceneTransforms.wgs84ToWindowCoordinates(e,r);n&&(Cesium.defined(l)||(l=n.x),Cesium.defined(h)||(h=n.y),Cesium.defined(c)||(c=n.x),Cesium.defined(u)||(u=n.y),n.x>l&&(l=n.x),n.x<c&&(c=n.x),n.y>h&&(h=n.y),n.y<u&&(u=n.y))});const d={minX:c,maxX:l,minY:u,maxY:h,data:i};if(!(Cesium.defined(c)&&Cesium.defined(l)&&Cesium.defined(u)&&Cesium.defined(h)))return void(d.data.show=!1);if(dr(e,d)||Math.abs(c-l)<3||Math.abs(u-h)<3)return void(d.data.show=!1);const p=ur(t,d);p?d.data.show=!1:(t.insert(d),d.data.show=!0)}})}}(e,t,i)})}},Object.defineProperties(lr.prototype,{}),lr.prototype.update=function(e){if(!this.show)return;const t=this;this._primitives.forEach(function(e){const i=fr(e);i.forEach(function(e){e.show=!1});const r=t._cacheEntityMap[e._dynamicEntityVisualizer_uuid];r&&(r.itemCollection=i,0!==i.length&&(t._rBushDitry=!0))}),this._rBushDitry&&this._rBushRefreshFunction(),this._primitives.forEach(function(t){t.update(e)})},lr.prototype.isDestroyed=function(){return!1},lr.prototype.destroy=function(){this.removeAll()};var mr=lr;class yr{constructor(e){if(e=Object(n.defaultValue)(e,{}),this._scene=e.scene,!this._scene)throw new Error("缺少场景对象Scene");if(this._opacity=Object(n.defaultValue)(e.opacity,1),this._visible=Object(n.defaultValue)(e.visible,!0),this._swipeEnabled=Object(n.defaultValue)(e.swipeEnabled,!1),this._swipeInverse=Object(n.defaultValue)(e.swipeInverse,0),this._labelingInfo=Object(n.defaultValue)(e.labelingInfo,[new n.LabelClass]),(!Array.isArray(e.labelingInfo)||Array.isArray(e.labelingInfo)&&0===e.labelingInfo.length)&&(this._labelingInfo=[new n.LabelClass]),!Array.isArray(this._labelingInfo)||this._labelingInfo.length<=0)throw new Error("缺少动态注记样式参数");this._collection=null,this._dynamicEntityVisualizer=null,this._initCollection()}_initCollection(){const e=this._scene,t=this._labelingInfo[0],{renderMode:i,deconflictionStrategy:r="static"}=t;let n;switch(i){case"label":n=new Cesium.LabelCollection({blendOption:Cesium.BlendOption.OPAQUE_AND_TRANSLUCENT,scene:e,swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse});break;case"ground":n=new Cesium.PrimitiveCollection({swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse});break;default:n=new Cesium.BillboardCollection({blendOption:Cesium.BlendOption.OPAQUE_AND_TRANSLUCENT,scene:e,swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse})}yr.dynamicEntityVisualizer||(yr.dynamicEntityVisualizer=new mr(e),e.primitives.add(yr.dynamicEntityVisualizer)),"static"===r?(this._dynamicEntityVisualizer=yr.dynamicEntityVisualizer,this._collection=this._dynamicEntityVisualizer.add(n)):this._collection=e.primitives.add(n),this._collection.show=this._visible}add(e,t){return Bi.renderLabel(this._collection,e,t||this._labelingInfo[0])}remove(e){Bi.removeLabels(this._collection,e)}createLabels(e,t){return Bi.createLabels(this._collection,e,t||this._labelingInfo[0])}addLabels(e){const t=[];if(!e||!Array.isArray(e))return t;for(let i=0;i<e.length;i++)this._collection.contains(e[i])||t.push(this._collection.add(e[i]));return t}removeLabels(e){if(e&&Array.isArray(e))for(let t=0;t<e.length;t++)this._collection.contains(e[t])&&this._collection.remove(e[t])}destroyed(){this._dynamicEntityVisualizer?this._dynamicEntityVisualizer.remove(this._collection):this._scene.primitives.remove(this._collection),this._collection=null}}Object.defineProperties(yr.prototype,{show:{get(){return this._visible},set(e){this._visible=e,this._collection&&(this._collection.show=e)}},translucency:{get(){return this._opacity},set(e){this._opacity=e}},swipeEnabled:{get(){return this._swipeEnabled},set(e){"boolean"==typeof e&&(this._swipeEnabled=e,this._collection.swipeEnabled=e)}},swipeInverse:{get(){return this._swipeInverse},set(e){"number"==typeof e&&(this._swipeInverse=e,this._collection.swipeInverse=e)}}});var gr=yr;class vr{constructor(e){e=Cesium.defaultValue(e,Cesium.defaultValue.EMPTY_OBJECT),this._ellipsoid=Cesium.defaultValue(e.ellipsoid,Cesium.Ellipsoid.WGS84),e.wkt?this._wkt=e.wkt:e.wkid?this._wkid=e.wkid:this._wkt=n.Projection.getEPSGByWKID(3857).strProject,this.isGeographic()&&(this._geographicProjection=new Cesium.GeographicProjection(this._ellipsoid))}project(e,t){if(!Cesium.defined(e))throw new Cesium.DeveloperError("必须传入cartographic");let i;t=t||{};const r=[Cesium.Math.toDegrees(e.longitude),Cesium.Math.toDegrees(e.latitude)],a=(i=n.Projection.projectPoints({points:[r],originWKID:4326,targetWKID:this._wkid,targetDefs:this._wkt})[0])[0],o=i[1],s=e.height;return this.isGeographic()&&this._geographicProjection.project({longitude:i[0],latitude:i[1],height:e.height},t),Cesium.defined(t)?(t.x=a,t.y=o,t.z=s,t):new Cesium.Cartesian3(a,o,s)}unproject(e,t){if(!Cesium.defined(e))throw new Cesium.DeveloperError("必须传入cartesian");let i;t=t||{},this.isGeographic()?this._geographicProjection.unproject(e,i):i=[e.x,e.y],t=n.Projection.isCustomWKID(this._wkid)?n.Projection.projectPoints({points:[i],originWKID:this._wkid,targetWKID:4326})[0]:n.Projection.projectPoints({points:[i],originDefs:this._wkt,targetWKID:4326})[0];const r=Cesium.Math.toRadians(t[0]),a=Cesium.Math.toRadians(t[1]),o=e.z;return Cesium.defined(t)?(t.longitude=r,t.latitude=a,t.height=o,t):new Cesium.Cartographic(r,a,o)}isGeographic(){return!!(this._wkid&&[4326,4490,4610,4214,n.CustomWKID.bd09ll,n.CustomWKID.gcj02ll].includes(this._wkid)||this._wkt&&(/^GEOGCS/.test(this.wkt)||/^[+]proj=longlat/.test(this._wkt)))}}Object.defineProperties(vr.prototype,{ellipsoid:{get(){return this._ellipsoid}},wkt:{get(){return this._wkt}},wkid:{get(){return this._wkid}}});var br=vr;class _r{constructor(e){if(e=Cesium.defaultValue(e,Cesium.defaultValue.EMPTY_OBJECT),this._ellipsoid=Cesium.defaultValue(e.ellipsoid,Cesium.Ellipsoid.WGS84),!Cesium.defined(e.wkt)&&!Cesium.defined(e.wkid))throw new Cesium.DeveloperError("必须传入wkt或wkid");var t,i,r,a;this._wkt=e.wkt,this._wkid=e.wkid,this._tileInfo=e.tileInfo,this._axisDirection=Cesium.defaultValue(e.axisDirection,{x:1,y:-1}),n.Projection.isCustomWKID(this._wkid)?this._projection=new br({ellipsoid:this._ellipsoid,wkid:this._wkid}):(this._projection=new br({ellipsoid:this._ellipsoid,wkt:this._wkt,proj4:e.proj4}),t=e.rectangleSouthwest,i=e.rectangleNortheast,this._rectangleSouthwest=e.rectangleSouthwest,this._rectangleNortheast=e.rectangleNortheast);this._tileInfo.lods[0].resolution;if(this._tileSize={width:this._tileInfo.size[0],height:this._tileInfo.size[1]},this._transformOrigin={x:this._tileInfo.origin.coordinates[0],y:this._tileInfo.origin.coordinates[1]},e.rectangleSouthwest&&e.rectangleNortheast){const n=this._tileInfo.lods[0].level,o=function(e,t){const i=this.getResolutionAtLevel(t);return{x:Math.floor(this._axisDirection.x*(e.x-this._transformOrigin.x)/(this._tileSize.width*i)),y:Math.floor(-this._axisDirection.y*(this._transformOrigin.y-e.y)/(this._tileSize.height*i))}}.bind(this),s=function(e,t,i){const r=this.getResolutionAtLevel(i);let n,a,o,s;return this._axisDirection.x>0?(n=this._transformOrigin.x+e*(this._tileSize.width*r),o=this._transformOrigin.x+(e+1)*(this._tileSize.width*r)):(n=this._transformOrigin.x-(e+1)*(this._tileSize.width*r),o=this._transformOrigin.x-e*(this._tileSize.width*r)),this._axisDirection.y<0?(a=this._transformOrigin.y-(t+1)*(this._tileSize.height*r),s=this._transformOrigin.y-t*(this._tileSize.height*r)):(a=this._transformOrigin.y+t*(this._tileSize.height*r),s=this._transformOrigin.y+(t+1)*(this._tileSize.height*r)),{west:n,south:a,east:o,north:s}}.bind(this),l=e.rectangleSouthwest,h=e.rectangleNortheast,c=new Cesium.Cartesian2(l.x,h.y),u=new Cesium.Cartesian2(h.x,l.y),d=o(l,n),p=s(d.x,d.y,n),f=o(h,n),m=s(f.x,f.y,n),y=o(c,n),g=s(y.x,y.y,n),v=o(u,n),b=s(v.x,v.y,n);t=new Cesium.Cartesian2(p.west,p.south),i=new Cesium.Cartesian2(m.east,m.north),r=new Cesium.Cartesian2(g.west,g.north),a=new Cesium.Cartesian2(b.east,b.south)}else{if(this.isGeographic())t=new Cesium.Cartesian2(-180,-90),i=new Cesium.Cartesian2(180,90);else{const e=this._ellipsoid.maximumRadius*Math.PI;t=new Cesium.Cartesian2(-e,-e),i=new Cesium.Cartesian2(e,e)}r=new Cesium.Cartesian2(t.x,i.y),a=new Cesium.Cartesian2(i.x,t.y),this._rectangleSouthwest=Cesium.Cartesian2.clone(t),this._rectangleNortheast=Cesium.Cartesian2.clone(i)}(this.isGeographic()||this.isWebMercator())&&this.scratchProjectionBounds(t,i);let o,s,l,h,c=void 0,u=void 0,d=void 0,p=void 0;if(this.isGeographic()&&!n.Projection.isCustomWKID(this._wkid)?(c={longitude:Cesium.Math.toRadians(t.x),latitude:Cesium.Math.toRadians(t.y)},u={longitude:Cesium.Math.toRadians(i.x),latitude:Cesium.Math.toRadians(i.y)},d={longitude:Cesium.Math.toRadians(r.x),latitude:Cesium.Math.toRadians(r.y)},p={longitude:Cesium.Math.toRadians(a.x),latitude:Cesium.Math.toRadians(a.y)}):(c=this._projection.unproject(t),u=this._projection.unproject(i),d=this._projection.unproject(r),p=this._projection.unproject(a)),Cesium.defined(this._tileInfo)&&!(this.isGeographic()||isFinite(p.longitude)&&isFinite(p.latitude))){const t=Cesium.Math.toRadians(Cesium.Math.toDegrees(this.getNumberOfXTilesAtLevel(this._tileInfo.lods[0].level)*(this._tileInfo.lods[0].resolution*this._tileSize.width)/this._ellipsoid.maximumRadius));p=this._projection.unproject(new Cesium.Cartesian2(e.rectangleNortheast.x,e.rectangleSouthwest.y)).clone(),u.longitude=c.longitude+t}this.isGeographic()&&!n.Projection.isCustomWKID(this._wkid)?(o={longitude:Cesium.Math.toRadians(e.rectangleSouthwest.x),latitude:Cesium.Math.toRadians(e.rectangleSouthwest.y)},s={longitude:Cesium.Math.toRadians(e.rectangleNortheast.x),latitude:Cesium.Math.toRadians(e.rectangleNortheast.y)},l={longitude:Cesium.Math.toRadians(e.rectangleSouthwest.x),latitude:Cesium.Math.toRadians(e.rectangleNortheast.y)},h={longitude:Cesium.Math.toRadians(e.rectangleNortheast.x),latitude:Cesium.Math.toRadians(e.rectangleSouthwest.y)}):(o=this._projection.unproject(e.rectangleSouthwest),s=this._projection.unproject(e.rectangleNortheast),l=this._projection.unproject(new Cesium.Cartesian2(e.rectangleSouthwest.x,e.rectangleNortheast.y)),h=this._projection.unproject(new Cesium.Cartesian2(e.rectangleNortheast.x,e.rectangleSouthwest.y)));const f=Math.min(c.longitude,d.longitude,o.longitude,l.longitude),m=Math.min(c.latitude,p.latitude,o.latitude,h.latitude),y=Math.max(u.longitude,p.longitude,s.longitude,h.longitude),g=Math.max(u.latitude,d.latitude,s.latitude,l.latitude);this._rectangle=new Cesium.Rectangle(f,m,y,g)}getNumberOfXTilesAtLevel(e){let t=1;const i=this.getResolutionAtLevel(e);return 0===(t=Math.round(Math.abs(this._rectangleNortheast.x-this._rectangleSouthwest.x)/(this._tileSize.width*i)))?1:t}getNumberOfYTilesAtLevel(e){let t=1;const i=this.getResolutionAtLevel(e);return 0===(t=Math.round(Math.abs(this._rectangleNortheast.y-this._rectangleSouthwest.y)/(this._tileSize.height*i)))?1:t}rectangleToNativeRectangle(e,t){const i=this._projection,r=i.project(Cesium.Rectangle.southwest(e)),n=i.project(Cesium.Rectangle.northeast(e));return Cesium.defined(t)?(t.west=r.x,t.south=r.y,t.east=n.x,t.north=n.y,t):new Cesium.Rectangle(r.x,r.y,n.x,n.y)}tileXYToNativeRectangle(e,t,i,r){const n=new Cesium.Rectangle,a=this.getResolutionAtLevel(i);return this._axisDirection.x>0?(n.west=this._transformOrigin.x+e*(this._tileSize.width*a),n.east=this._transformOrigin.x+(e+1)*(this._tileSize.width*a)):(n.west=this._transformOrigin.x-(e+1)*(this._tileSize.width*a),n.east=this._transformOrigin.x-e*(this._tileSize.width*a)),this._axisDirection.y<0?(n.south=this._transformOrigin.y-(t+1)*(this._tileSize.height*a),n.north=this._transformOrigin.y-t*(this._tileSize.height*a)):(n.south=this._transformOrigin.y+t*(this._tileSize.height*a),n.north=this._transformOrigin.y+(t+1)*(this._tileSize.height*a)),Cesium.defined(r)?(r.west=n.west,r.south=n.south,r.east=n.east,r.north=n.north,r):n}tileXYToRectangle(e,t,i,r){const a=this.tileXYToNativeRectangle(e,t,i,r);if(!isFinite(a.height)||!isFinite(a.width))return this._rectangle;if(this.isGeographic()&&!n.Projection.isCustomWKID(this._wkid))a.west=Cesium.Math.toRadians(a.west),a.south=Cesium.Math.toRadians(a.south),a.east=Cesium.Math.toRadians(a.east),a.north=Cesium.Math.toRadians(a.north);else{const e=this._projection,t=e.unproject(new Cesium.Cartesian2(a.west,a.north)),i=e.unproject(new Cesium.Cartesian2(a.east,a.south));a.west=t.longitude,a.south=i.latitude,a.east=i.longitude,a.north=t.latitude}return isFinite(a.height)&&isFinite(a.width)?a:this._rectangle}positionToTileXY(e,t,i){let r=void 0;const a=new Cesium.Cartesian2;if(this.isGeographic()&&!n.Projection.isCustomWKID(this._wkid))r={x:Cesium.Math.toDegrees(e.longitude),y:Cesium.Math.toDegrees(e.latitude)};else{r=this._projection.project(e)}const o=this.getResolutionAtLevel(t),s=this._axisDirection.x*(r.x-this._transformOrigin.x)/(this._tileSize.width*o),l=-this._axisDirection.y*(this._transformOrigin.y-r.y)/(this._tileSize.height*o);return a.x=Math.floor(s),a.y=Math.floor(l),Math.abs(s)<Math.pow(10,-8)&&(a.x=0),Math.abs(l)<Math.pow(10,-8)&&(a.y=0),Cesium.defined(i)?(i.x=a.x,i.y=a.y,i):a}getResolutionAtLevel(e){const t=this._tileInfo.lods.find((t,i)=>i===e);return t?t.resolution:void 0}getTileLevelByResolution(e){let t=0,i=0;if(this._tileInfo&&this._tileInfo.lods.length>1)if(Math.abs(e-this._tileInfo.lods[0].resolution)<Math.pow(10,-7))t=this._tileInfo.lods[0].level,i=0;else if(e<this._tileInfo.lods[this._tileInfo.lods.length-1].resolution)t=this._tileInfo.lods[this._tileInfo.lods.length-1].level,i=this._tileInfo.lods.length-1;else for(let r=0;r<this._tileInfo.lods.length-1;r++){const n=this._tileInfo.lods[r],a=this._tileInfo.lods[r+1];if(e<=n.resolution&&e>a.resolution){const o=(n.resolution-e)/(n.resolution-a.resolution);t=o<.5?n.level:n.level+1,i=o<.5?r:r+1;break}}return i}isGeographic(){return!!(this.wkid&&[4326,4490,4610,4214,n.CustomWKID.bd09ll,n.CustomWKID.gcj02ll].includes(this._wkid)||this.wkt&&(/^GEOGCS/.test(this.wkt)||/^[+]proj=longlat/.test(this.wkt)))}isWebMercator(){return[3857,102113,102100,900913,n.CustomWKID.bd09mc,n.CustomWKID.gcj02mc].includes(this._wkid)}scratchProjectionBounds(e,t){let i=void 0;this.isGeographic()?i=new Cesium.Rectangle(-180,-90,180,90):this.isWebMercator()&&(i=new Cesium.Rectangle(-20037508.34,-20037508.34,20037508.34,20037508.34)),e.x=Cesium.Math.clamp(e.x,i.west,i.east),e.y=Cesium.Math.clamp(e.y,i.south,i.north),t.x=Cesium.Math.clamp(t.x,i.west,i.east),t.y=Cesium.Math.clamp(t.y,i.south,i.north)}}Object.defineProperties(_r.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}},wkid:{get:function(){return this._wkid}},wkt:{get:function(){return this._wkt}}});var wr=_r;var xr=class extends n.LayerView{onAdd(){return new Promise(e=>{this.innerLayer=[],Mr.addSceneLayer(this,t=>{this.innerLayer=t,e(this)})})}onRemove(){return Mr.removeLayer(this),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t],{params:r=[]}=i;if(i){let e;switch(i.name){case"visible":Mr.setVisible(r[0],this);break;case"sbuLayerVisible":Mr.setSubLayerVisible(r[0],r[1],this);break;case"opacity":Mr.setOpacity(r[0],this);break;case"subLayerOpacity":Mr.setSubLayerOpacity(r[0],r[1],this);break;case"renderer":e=this.view.getInnerLayer(this.layer);const t=i.params[0],n=i.params[1];for(let i=0;i<e.length;i++)n===e[i].id&&(e[i].renderer=rh(t));break;case"reset":Mr.reset(r[0],this);break;case"labelingInfo":Mr.removeLayer(this),Mr.addSceneLayer(this,e=>{this.innerLayer=e})}}}return Promise.resolve(this)}};class Cr{}function Sr(e,t){e.scene.terrainProvider=new Cesium.EllipsoidTerrainProvider,setTimeout(()=>{e.scene.terrainProvider=t},0)}Cr.addSceneLayer=function(e,t,i){const{layer:r,innerView:a,view:o}=e,s=r.activeScene.allSublayers;let l=0;const h=[];s.forEach(t=>{switch(t.type){case n.SceneSubLayerType.label:const s=Cr.toPrimitive(t,a,e),{_labelLayer:c}=s;c.id=t.id,h.push(c),l++;break;case n.SceneSubLayerType.mapRef:const u=Cr.initializeOptions(t,a);u.show=t.visible*e._getLayerViewVisible(r.visible);const d=function(e,t){const i=(e=Object(n.defaultValue)(e,{})).url||"";let r=void 0;i.includes("/igs/rest/g3d/")?r=Ql.addWebTileLayer(e,t):i.includes("/igs/rest/services/")&&i.includes("/SceneServer")&&(e._url=i,r=dh.addIGSMapImageLayer(e,t));return r}(u,a);h.push(d),l++;break;case n.SceneSubLayerType.model:case n.SceneSubLayerType.modelCache:const p=Cr.initializeOptions(t,a),f={};f.show=p.show,p.show=t.visible*e._getLayerViewVisible(r.visible),ah(p,a,o,function(e){l++,h.push(e),e._backupProperties=f,e._backupProperties.translucency=e.translucency;const i=t.opacity*r.opacity;i<1&&i>=0&&(e.translucency=i),p.autoReset&&oh(e.boundingSphere,p,a)},i)}});const c=Cr.addTerrainService(e);c&&(h.push(c),l++);const u=setInterval(function(){l===s.items.length&&t&&t instanceof Function&&(clearInterval(u),t(h))},50)},Cr.toTerrainProvider=function(e){let t=void 0;if(e.type===n.SceneSubLayerType.terrain){const i=Cr.initializeOptions(e);t=new Or(i)}return t},Cr.initTerrainProvider=function(e,t){const{innerView:i,view:r}=e,a=[];let o;t=Object(n.defaultValue)(t,[]);const{allLayerViews:s}=r;let l=[];const h=[];if(l.push(e),(l=l.concat(s._items)).forEach(e=>{t.indexOf(e)<0&&h.push(e)}),h.forEach(e=>{if(e instanceof xr){e.layer.activeScene.allSublayers.forEach(e=>{e.type===n.SceneSubLayerType.terrain&&a.push(e)})}}),a.length>0){const e=Cr.initializeOptions(a[0]),t=[];a.forEach(e=>{const i=Cr.initializeOptions(e);t.push({url:i.url,range:i.range,range3D:i.range3D,requestVertexNormals:i.requestVertexNormals})}),e.url=t,o=new Or(e),i.scene.terrainProvider=o}return o},Cr.addTerrainService=function(e,t){const{innerView:i,view:r}=e;let a=[];t=Object(n.defaultValue)(t,[]);let o=void 0;if(!e.layer)return;const s=Object(n.defaultValue)(e.layer.visible,!0);if((a=Cr.getAllTerrainLayers(e)).length>0){const e=Cr.initializeOptions(a[0]),t=[];a.forEach(e=>{const{url:i,range:r,range3D:n,requestVertexNormals:a,show:o}=Cr.initializeOptions(e);t.push({url:i,range:r,range3D:n,requestVertexNormals:a,show:o&&s})}),i.scene.terrainProvider instanceof Cesium.EllipsoidTerrainProvider?(e.url=void 0,e.serviceList=t,o=new Or(e),i.scene.terrainProvider=o):((o=i.scene.terrainProvider)._serviceList.push(e),o.addService(e),Sr(i,o))}return o},Cr.getAllTerrainLayers=function(e){const t=[];if(e instanceof xr){e.layer.activeScene.allSublayers.forEach(e=>{e.type===n.SceneSubLayerType.terrain&&t.push(e)})}return t},Cr.toPrimitive=function(e,t,i){const r=Cr.initializeOptions(e,t,i);switch(e.type){case n.SceneSubLayerType.label:const t=r._dynamicEntityVisualizer?r._dynamicEntityVisualizer:r._collection;return t._labelLayer=r,t;case n.SceneSubLayerType.model:case n.SceneSubLayerType.modelCache:return new Cesium.MapGISM3DSet(r)}},Cr.initializeOptions=function(e,t,i){switch(e.type){case n.SceneSubLayerType.terrain:let r=function(e){const t={},i=e.range,r={xMin:i.xmin,yMin:i.ymin,xMax:i.xmax,yMax:i.ymax},a=e.range3D,o={xMin:a.xmin,yMin:a.ymin,xMax:a.xmax,yMax:a.ymax,zMin:a.zmin,zMax:a.zmax};return t.id=Object(n.defaultValue)(e.id,void 0),t.scale=Object(n.defaultValue)(e.elevationScale,void 0),t.range=r,t.range3D=o,t.requestVertexNormals=Object(n.defaultValue)(e.requestVertexNormals,!1),t.sceneIndex=e.layer&&void 0!==e.layer.sceneIndex?e.layer.sceneIndex:0,t.layerIndex=Object(n.defaultValue)(e.layerIndex,0),t.layerRenderIndex=Object(n.defaultValue)(e.layerRenderIndex,0),t.show=Object(n.defaultValue)(e.visible,!0),t.autoReset=Object(n.defaultValue)(e.autoReset,!0),t.url=e.layer.url,t}(e);r=Object.assign(r,e.extensionOptions);const{sceneIndex:a,layerIndex:o,layerRenderIndex:s,requestVertexNormals:l,url:h}=r;return h.includes("/SceneServer")?r.url=`${h}/layers/${o}/terrains?level={z}&row={x}&col={y}&xDensity=65&yDensity=65&hasNormals=${l}`:r.url=`${h}/GetTerrain?sceneIndex=${a}&layerIndex=${s}&Level={z}&Row={x}&Col={y}&xdensity=65&ydensity=65&webGL=true&hasNormals=${l}`,r;case n.SceneSubLayerType.label:{let r=e.layer.url,a=e.layer.sceneIndex;r=r.includes("/SceneServer")?`${r}/layers/${e.layerIndex}/labels?level=0&row=0&col=0&format=json&srsName=EPSG:4326`:`${r}/GetLabels?sceneIndex=${a}&layerIndex=${e.layerRenderIndex}&level=0&row=0&col=0&format=json&srsName=EPSG:4326`;const{labelLayer:o,labelingInfo:s,opacity:l}=e,h={labelLayer:o,labelingInfo:s,opacity:l,visible:e.visible&&i._getLayerViewVisible(e.layer.visible)};return function(e,t,i,r){t=Object(n.defaultValue)(t,{}),i=Object(n.defaultValue)(i,{});const a=Object(n.defaultValue)(i.labelingInfo,[]),o=Object(n.defaultValue)(i.visible,!0),s=Object(n.defaultValue)(i.opacity,1),l=r.scene,h=Object(n.defaultValue)(i.layerInfo,{}),c=Object(n.defaultValue)(h.symbolScale,1),u=new Cesium.Resource({url:e}),d=new gr({scene:l,visible:o,opacity:s,labelingInfo:a});return u.fetchJson().then(e=>{Array.isArray(e)&&e.forEach(e=>{const t=Object(n.defaultValue)(e.dot,{}),i=Object(n.defaultValue)(t.x,0),r=Object(n.defaultValue)(t.y,0),o=Object(n.defaultValue)(t.z,0),s=function(e,t,i){Object(n.defaultValue)(e.dot,{});const r=Object(n.defaultValue)(e.geoAnno,{}),a="rgb("+Object(n.defaultValue)(r.color,"255,255,255")+")",o=Object(n.defaultValue)(r.font,"宋体"),s=Object(n.defaultValue)(r.offsetx,0),l=Object(n.defaultValue)(r.offsety,0),h=Object(n.defaultValue)(r.size,20)*t,c=Object(n.defaultValue)(r.text,"");let u=Object(n.defaultValue)(r.italic?"italic":"normal","normal");const d=Object(n.defaultValue)(r.italicType,0),p=Object(n.defaultValue)(r.bold?"bold":"normal","normal"),f=Object(n.defaultValue)(r.angle,0),m=Object(n.defaultValue)(r.shadow,!1),y=Object(n.defaultValue)(r.hollow,!1),g=Object(n.defaultValue)(r.outLine,!1),v=Object(n.defaultValue)(r.strikeOut,!1),b=Object(n.defaultValue)(r.underLine,!1),_=Object(n.defaultValue)(r.space,0),w=Object(n.defaultValue)(r.back,!1),x="rgb("+Object(n.defaultValue)(r.backClr,"255,255,255")+")",C=Object(n.defaultValue)(r.backExp,0);0!==d&&(u="italic ");const S=!1,M="rgb(191, 191, 191)",k=2,T=1,I=1;(m||g)&&(S=!0,g&&(M=x,k=C,T=0,I=0));let O=new n.LabelClass({symbol:{color:y?"rgba(255,255,255,0)":Object(n.defaultValue)(a,"rgba(255,255,255,1)"),haloColor:y?a:"rgba(255,255,255,0)",haloSize:1,lineHeight:1.1,xoffset:s,yoffset:l,angle:f,font:{size:h,family:o,weight:p,style:u},text:c,letterSpacing:_,backgroundColor:w?x:void 0,backgroundPadding:[C,C],textDecorationUnderlineColor:b?a:void 0,textDecorationUnderlineWidth:b?1:0,textDecorationThroughlineColor:v?a:void 0,textDecorationThroughlineWidth:v?1:0,textShadowOffsetX:T,textShadowOffsetY:I,textShadowColor:S?M:void 0,textShadowBlur:k},renderMode:"canvas"});if(i){let e=O.symbol.toJSON();const t=i.symbol?i.symbol:{};(e=Object.assign({},e,t)).text=c;let r=O.toJSON();(r=Object.assign({},r,i)).symbol=e,O=new n.LabelClass(r)}return O}(e,c,Array.isArray(a)&&a.length>0?a[0]:void 0);d.add([new n.Feature({geometry:new n.Point({coordinates:[i,r,o]})})],s)})}),d.type="label",d}(r,e.extensionOptions,h,t)}case n.SceneSubLayerType.mapRef:return function(e){let t={};t.spatialReference=Object(n.defaultValue)(e.spatialReference,void 0),t.id=Object(n.defaultValue)(e.id,void 0),t.show=Object(n.defaultValue)(e.visible,!0),t.layerIndex=Object(n.defaultValue)(e.layerIndex,0),t.layerRenderIndex=Object(n.defaultValue)(e.layerRenderIndex,0),t.igserver=!0,t.renderer=rh(e.renderer),t.translucency=e.opacity,t.sceneIndex=e.layer&&void 0!==e.layer.sceneIndex?e.layer.sceneIndex:0;const i=e.layer.url,r=function(e){let t="";e.includes("/igs/rest/g3d/")?t="g3d":e.includes("/igs/rest/services/")&&e.includes("/SceneServer")&&(t="sceneserver");return t}(i);if("g3d"===r){t.url=`${i}/GetCovering?sceneIndex=${t.sceneIndex}&&layerIndex=${e.layerRenderIndex}&level={z}&row={y}&col={x}`;const{tileInfo:r,extent:a}=function(e){let t=void 0,i=void 0;const r=e.range,a=Math.round((r.xmax-r.xmin)/e.maxFrameSize.wid),o=Math.round((r.ymax-r.ymin)/e.maxFrameSize.hel),s=r.xmin,l=r.ymax,h=s+a*e.maxFrameSize.wid,c=l-o*e.maxFrameSize.hel;t=new n.Extent({xmin:s,ymin:c,xmax:h,ymax:l,spatialReference:r.spatialReference});const u=new n.Point({coordinates:[s,c],spatialReference:r.spatialReference});return i=n.TileInfoUtil.createCommonTileInfo({extent:t,origin:u,numberOfMinLevelTilesX:a}),{extent:t,tileInfo:i}}(e);t.tileInfo=r,t.extent=a,t.tileSliceType="tms"}else"sceneserver"===r&&(t.extent=e.range,t.spatialReference=e.spatialReference,t.httpMethod=e.httpMethod,t.imageWidth=e.imageWidth,t.imageHeight=e.imageHeight,t.url=`${i}/layers/${e.layerIndex}/coverings`);return t}(e);case n.SceneSubLayerType.model:case n.SceneSubLayerType.modelCache:const c=nh(e);return c.url=e.layer.url,c.url.includes("/igs/rest/g3d/")?c.url=`${c.url}/GetDataStreams?sceneIndex=${e.layer.sceneIndex}&layerIndex=${e.layerRenderIndex}&Level=0&Row=0&Col=0`:c.url.includes("/igs/rest/services/")&&c.url.includes("/SceneServer"),c.headers&&(c.url=new Cesium.Resource({url:c.url,headers:c.headers})),t&&(c._scene=t.scene),c}},Cr.removeLayer=function(e){let{innerLayer:t}=e;const{innerView:i}=e;for(let e=0;e<t.length;e++)t[e]instanceof Cesium.MapGISM3DSet?i.scene.primitives.removeAndDestroy(t[e]):t[e]instanceof gr?t[e].destroyed():t[e]instanceof Cesium.ImageryLayer?i.scene.imageryLayers.remove(t[e]):t[e]instanceof Or&&(t[e]=new Cesium.EllipsoidTerrainProvider,i.scene.terrainProvider=t[e]);t=[]},Cr.setVisible=function(e,t){const{innerLayer:i,innerView:r}=t,n=t._getLayerViewVisible(e);for(let a=0;a<i.length;a++)if(i[a]instanceof Cesium.MapGISM3DSet)i[a].show=i[a]._backupProperties.show&&n;else if(i[a]instanceof gr)i[a].show=n;else if(i[a]instanceof Cesium.ImageryLayer)i[a].show=n;else if(i[a]instanceof Or)if(!0===e)Cr.addTerrainService(t);else if(!1===e){const e=[];Cr.getAllTerrainLayers(t).forEach(t=>{e.push(Cr.initializeOptions(t))}),i[a].removeServices(e),Sr(r,i[a])}},Cr.setSubLayerVisible=function(e,t,i){const{innerLayer:r,layer:n,innerView:a}=i,o=e&&n.visible,s=i._getLayerViewVisible(o);for(let n=0;n<r.length;n++)if(String(r[n].id)===String(t)){if(r[n]instanceof Cesium.MapGISM3DSet)r[n].show=s,r[n]._backupProperties.show=e;else if(r[n]instanceof gr)r[n].show=s;else if(r[n]instanceof Cesium.ImageryLayer)r[n].show=s;else if(r[n]instanceof Or)if(!0===e)Cr.addTerrainService(i);else if(!1===e){const e=[];Cr.getAllTerrainLayers(i).forEach(t=>{e.push(Cr.initializeOptions(t))}),r[n].removeServices(e),Sr(a,r[n])}break}},Cr.setOpacity=function(e,t){const{innerLayer:i}=t;for(let t=0;t<i.length;t++)i[t]instanceof Cesium.MapGISM3DSet&&(i[t].translucency=i[t]._backupProperties.translucency*e)},Cr.setSubLayerOpacity=function(e,t,i){const{innerLayer:r,layer:n}=i;for(let i=0;i<r.length;i++)if(String(r[i].id)===String(t)){r[i]instanceof Cesium.MapGISM3DSet&&(r[i].translucency=e*n.opacity,r[i]._backupProperties.translucency=e);break}},Cr.reset=function(e,t){const{innerLayer:i,innerView:r}=t;for(let t=0;t<i.length;t++)if(String(i[t].id)===String(e)){oh(i[t].boundingSphere,{},r);break}};var Mr=Cr;function kr(e,t,i,r){let n;if(1===e.length)n=e[0];else for(let a=0;a<e.length;++a){const o=e[a];if(o.availability&&o.availability.isTileAvailable(t,i,r)){n=o;break}}return n}var Tr=class{constructor(e){this._layers=Object(n.defaultValue)(e,[])}addAvailableTileRange(e,t,i,r,n){const a=kr(this._layers,e,(t+r)/2,(i+n)/2);a&&a.availability.addAvailableTileRange(e,t,i,r,n)}computeMaximumLevelAtPosition(e){let t=0;for(let i=0;i<this._layers.length&&!((t=this._layers[i].availability.computeMaximumLevelAtPosition(e))>0);i++);return t}computeBestAvailableLevelOverRectangle(e){let t=0;for(let i=0;i<this._layers.length&&!((t=this._layers[i].availability.computeBestAvailableLevelOverRectangle(e))>0);i++);return t}isTileAvailable(e,t,i){const r=kr(this._layers,e,t,i);return!!r&&r.availability.isTileAvailable(e,t,i)}computeChildMaskForTile(e,t,i){const r=this._getLayerToUse(e,t,i);let n=0;return r&&(n=r.availability.computeChildMaskForTile(e,t,i)),n}_getLayerToUse(e,t,i){let r;if(1===this._layers.length)r=this._layers[0];else for(let n=0;n<this._layers.length;++n){const a=this._layers[n];if(a.availability&&a.availability.isTileAvailable(e,t,i)){r=a;break}}return r}};class Ir{constructor(e){this.url=Object(n.defaultValue)(e.url,void 0),this.range=Object(n.defaultValue)(e.range,void 0),this.range3D=Object(n.defaultValue)(e.range3D,void 0),this.proxy=Object(n.defaultValue)(e.proxy,void 0),this.maxLevel=Object(n.defaultValue)(e.maxLevel,20),this.terrainColorTblInfo=Object(n.defaultValue)(e.terrainColorTblInfo,void 0),this.terrainColorTblMinHeight=Object(n.defaultValue)(e.terrainColorTblMinHeight,void 0),this.terrainColorTblMaxHeight=Object(n.defaultValue)(e.terrainColorTblMaxHeight,void 0),this.id=Object(n.defaultValue)(e.id,void 0),this._tilingScheme=Object(n.defaultValue)(e.tilingScheme,new Cesium.GeographicTilingScheme),this._requestVertexNormals=Object(n.defaultValue)(e.requestVertexNormals,!1),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._heightmapStructure={heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535},this._ready=!1,this._readyPromise=new Promise((e,t)=>{}),this._layers=[];const t=Object(n.defaultValue)(e.serviceList,[]);this._serviceList=Object(n.cloneObject)(t),this.show=Object(n.defaultValue)(e.show,!0),this._repeat=Object(n.defaultValue)(e.repeat,new Cesium.Cartesian2(1,1)),this._layerToUse=void 0,this._availability=void 0;let i=Object(n.defaultValue)(e.credit,void 0);"string"==typeof i&&(i=new Cesium.Credit(i)),this._credit=i,this._init()}static async fromUrl(e,t){const i=new n.IGSSceneLayer({url:e}),r=(await i.load()).activeScene.sublayers.items;let a=void 0;for(let e=0;e<r.length;e++)if(r[e].type===n.SceneSubLayerType.terrain){const i=Mr.initializeOptions(r[e]);a=new Ir({...i,...t})}return a}requestTileGeometry(e,t,i,r){if(this._ready||n.Log.error("必须等待地形图层初始化完毕后才能请求地形瓦片数据!"),0===i&&0===e&&0===t||0===i&&1===e&&0===t)return Promise.resolve(this._getEmptyHeightMap());if(1===this._layers.length)this._layerToUse=this._layers[0];else for(let r=0;r<this._layers.length;++r){const n=this._layers[r];if(n.availability&&n.availability.isTileAvailable(i,e,t)){this._layerToUse=n;break}}if(!Cesium.defined(this._layerToUse))return this._getDefaultHeightMapData();0===this._layerToUse.tileUrlTemplates.length&&n.Log.error("请求地形数据的接口模板没有设置!");const a=this._getRequestHeader();let o=this._tilingScheme.getNumberOfYTilesAtLevel(i)-t-1,s=this._layerToUse.resource.url.replace("{z}",i).replace("{x}",e).replace("{y}",o),l=this._layerToUse.resource.getDerivedResource({url:s,headers:a,request:r,proxy:this.proxy}).fetchArrayBuffer();return Cesium.defined(l)?l.then(e=>{if(1===e.byteLength){"@"===new TextDecoder("utf-8").decode(e)&&(e=new Uint16Array(this._heightmapWidth*this._heightmapWidth))}return this._createHeightMapByTerrainData(e)}):void 0}_getDefaultHeightMapData(){const e=new Uint16Array(this._heightmapWidth*this._heightmapWidth);return this._createHeightMapByTerrainData(e)}getLevelMaximumGeometricError(e){return this._levelZeroMaximumGeometricError/(1<<e)}getTileDataAvailable(e,t,i){let r=!1;for(let n=0;n<this._layers.length;n++){const a=this._layers[n].availability;if(a&&a.isTileAvailable(i,e,t)){r=!0;break}}return r}loadTileDataAvailability(e,t,i){function r(e,t,i,r){if(0!==r){var n=e.availabilityLevels,a=r%n==0?r-n:(r/n|0)*n,o=1<<r-a;return{level:a,x:t/o|0,y:i/o|0}}}var n=kr(this._layers,i,e,t);if(!(!n.availability||i>n._availability._maximumLevel||n._availability.isTileAvailable(i,e,t))&&this.hasMetadata){var a=function(e,t,i,n,a){if(!a.availabilityLevels)return{result:!1};for(var o,s=function(){delete a.availabilityPromiseCache[o]},l=a.availabilityTilesLoaded,h=a.availability,c=r(a,t,i,n);c;){if(h.isTileAvailable(c.level,c.x,c.y)&&!l.isTileAvailable(c.level,c.x,c.y)){let t;if(o=c.level+"-"+c.x+"-"+c.y,!(t=a.availabilityPromiseCache[o])){var u=new Request({throttle:!1,throttleByServer:!0,type:Cesium.RequestType.TERRAIN});(t=e.requestTileGeometry(e,c.x,c.y,c.level,u))&&(a.availabilityPromiseCache[o]=t,t.then(s))}return{result:!0,promise:t}}c=r(a,c.x,c.y,c.level)}return{result:!1}}(this,e,t,i,n);return a.promise?a.promise:void 0}}_init(){if(this.url){const e={url:this.url,maxLevel:this.maxLevel,requestVertexNormals:this._requestVertexNormals,range:this.range,tilingScheme:this._tilingScheme,show:this.show};this._serviceList.push(e),this.addService(e)}else this._serviceList instanceof Array&&this._serviceList.length>0&&(this._combineRange("2D"),this._combineRange("3D"),this._formatRange(this.range),this._serviceList.forEach(e=>{this.addService(e)}));this._availability=new Tr(this._layers)}addService(e){this._combineRange("2D"),this._combineRange("3D"),this._formatRange(this.range);const t=Object(n.defaultValue)(e.maxLevel,this.maxLevel),i=Object(n.defaultValue)(e.range,this.range),r=Object(n.defaultValue)(e.url,void 0),a=Object(n.defaultValue)(e.show,!0);this._customTerrainInfo({url:r,tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"],maxzoom:t,requestVertexNormals:Object(n.defaultValue)(e.requestVertexNormals,this._requestVertexNormals),available:this._calcAvailability(i,t,this._tilingScheme),show:a})}removeServices(e){const t=[];e.forEach(e=>{const i=this._removeServiceFromServiceList(e);i>-1&&t.push(i)})}removeService(e){_removeServiceFromServiceList}_removeServiceFromServiceList(e){let t=-1;return this._serviceList.forEach((i,r)=>{i.url===e.url&&(t=r)}),t>-1&&(this._serviceList.splice(t,1),this._layers.splice(t,1)),t}_combineRange(e){e=Object(n.defaultValue)(e,"2D");const t=[];if(this._serviceList.forEach(i=>{let r;(r="2D"===e?i.range:i.range3D)&&t.push(r)}),t.length>0){let i,r,n,a=t[0].xMin,o=t[0].xMax,s=t[0].yMin,l=t[0].yMax;"3D"===e&&(i=t[0].zMin,r=t[0].zMax),t.forEach(t=>{t.xMin<a&&(a=t.xMin),t.xMax>o&&(o=t.xMax),t.yMin<s&&(s=t.yMin),t.yMax>l&&(l=t.yMax),"3D"===e&&(t.zMin<i&&(i=t.zMin),t.zMax>r&&(r=t.zMax))}),(n="2D"===e?this.range:this.range3D)?(a<n.xMin&&(n.xMin=a),o>n.xMax&&(n.xMax=o),s<n.yMin&&(n.yMin=s),l>n.yMax&&(n.yMax=l),"3D"===e&&(i<n.zMin&&(n.yMin=s),r>n.zMax&&(n.zMax=r))):"2D"===e?this.range={xMin:a,xMax:o,yMin:s,yMax:l}:this.range3D={xMin:a,xMax:o,yMin:s,yMax:l,zMin:i,zMax:r}}else this.range||n.Log.error("地形二维范围不存在!")}_customTerrainInfo(e){const{tiles:t,available:i,requestVertexNormals:r}=e,n=new Cesium.TileAvailability(this._tilingScheme,i.length);for(let e=0;e<i.length;++e){let t=i[e];for(let i=0;i<t.length;++i){let r=t[i];n.addAvailableTileRange(e,r.startX,r.startY,r.endX,r.endY)}}const a=Cesium.Resource.createIfNeeded(e.url);a.queryParameters.hasOwnProperty("hasNormals")||(a.queryParameters.hasNormals=r),this._layers.push(this._initTerrainLayer({resource:a,version:e.version,isHeightmap:!0,tileUrlTemplates:t,availability:n,hasVertexNormals:this.hasVertexNormals,littleEndianExtensionSize:!0})),this._ready=!0,this._readyPromise=new Promise((e,t)=>{e()})}_formatRange(e){(e.yMin<-84||e.yMin>84)&&(e.yMin=-84),e.yMax>84&&(e.yMax=84),e.xMax>180&&(e.xMax=180),(e.xMin<-180||e.xMin>180)&&(e.xMin=-180)}_calcAvailability(e,t,i){let r,n,a,o=Cesium.Cartographic.fromDegrees(e.xMin,e.yMin,new Cesium.Cartographic),s=Cesium.Cartographic.fromDegrees(e.xMax,e.yMax,new Cesium.Cartographic),l=[[{endX:1,endY:0,startX:0,startY:0}]];for(let e=1;e<t;++e)n=i.positionToTileXY(o,e),a=i.positionToTileXY(s,e),r={startX:n.x,startY:a.y,endX:a.x,endY:n.y},l.push([r]);return l}_getEmptyHeightMap(){return new Cesium.HeightmapTerrainData({buffer:new Uint16Array(this._heightmapWidth*this._heightmapWidth),width:this._heightmapWidth,height:this._heightmapWidth})}_initTerrainLayer(e){return{resource:e.resource,version:e.version,isHeightmap:e.isHeightmap,tileUrlTemplates:e.tileUrlTemplates,availability:e.availability,hasVertexNormals:e.hasVertexNormals,hasMetadata:e.hasMetadata,availabilityLevels:e.availabilityLevels,availabilityTilesLoaded:e.availabilityTilesLoaded,littleEndianExtensionSize:e.littleEndianExtensionSize,availabilityPromiseCache:{},show:e.show}}_getRequestHeader(){return{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}_createHeightMapByTerrainData(e){let t,i,r;const n=this._heightmapWidth*this._heightmapWidth*Uint16Array.BYTES_PER_ELEMENT+Uint16Array.BYTES_PER_ELEMENT;if(t=e.byteLength>n?new Float32Array(e,0,this._heightmapWidth*this._heightmapWidth):new Uint16Array(e,0,this._heightmapWidth*this._heightmapWidth),this.hasVertexNormals){i=new Uint8Array(this._heightmapWidth*this._heightmapWidth*2);const t=(this._heightmapWidth*this._heightmapWidth+1)*Float32Array.BYTES_PER_ELEMENT;r=new Uint8Array(e,t,(this._heightmapWidth+2)*(this._heightmapWidth+2)*2);for(let e=0;e<this._heightmapWidth;e++)for(let t=0;t<this._heightmapWidth;t++){const n=e*this._heightmapWidth+t,a=(e+1)*(this._heightmapWidth+2)+t+1;i[2*n]=r[2*a],i[2*n+1]=r[2*a+1]}}return new Cesium.HeightmapTerrainData({buffer:t,width:this._heightmapWidth,height:this._heightmapWidth,structure:this._heightmapStructure,encodedNormals:i,childTileMask:15,repeat:this._repeat})}}Object.defineProperties(Ir.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._ready||n.Log.error("credit must not be called before the terrain provider is ready."),this._credit}},tilingScheme:{get:function(){return this._ready||n.Log.error("tilingScheme must not be called before the terrain provider is ready."),this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},hasMetadata:{get:function(){return this._ready||n.Log.error("hasMetadata must not be called before the terrain provider is ready."),!0}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},repeat:{get:function(){return this._repeat},set:function(e){this._repeat=e}},availability:{get:function(){return this._ready&&this._layerToUse||n.Log.error("必须等待地形图层初始化完毕后才能请求地形瓦片数据!"),this._availability}}});var Or=Ir;class Er{static isGeographic(e){let t=!1;return(e instanceof Cesium.GeographicProjection||e.isGeographic&&e.isGeographic())&&(t=!0),t}}class Lr{constructor(e){e=Object(n.defaultValue)(e,{});const t=Object(n.defaultValue)(e.headers,{}),i=Object.assign({},e);i.extensions=[];const r=Object(n.defaultValue)(e.extensions,[]),a=Object(n.defaultValue)(e.url,"");let o;(o=a instanceof Cesium.Resource?a:new Cesium.Resource({url:a})).headers=t,r&&r instanceof Array&&(e.tokenKey&&e.tokenValue&&r.push({key:e.tokenKey,value:e.tokenValue}),r.forEach(e=>{e&&(o.queryParameters[e.key]=e.value)})),i.url=o;const s=new Cesium.ArcGisMapServerImageryProvider(i);return s._transparent=e.transparent,s._format=e.format,s.requestImage=((e,t,i,r)=>{if(!s._ready)throw new Cesium.DeveloperError("requestImage must not be called before the imagery provider is ready.");return Cesium.ImageryProvider.loadImage(s,this._buildImageResource(s,e,t,i,r))}),s}static async fromUrl(e,t){const i=new n.ArcGISMapImageLayer({url:e}),r=await i.load(),a=jr.initializeOptions(r),o=new Lr({...a,...t});return Cesium.defined(o._resource)||(o._resource=Cesium.Resource.createIfNeeded(e),o._resource.appendForwardSlash()),o}_buildImageResource(e,t,i,r,n){let a;if(e._useTiles)a=e._resource.getDerivedResource({url:"tile/"+r+"/"+i+"/"+t,request:n,queryParameters:e._resource.queryParameters});else{const o=e._tilingScheme.tileXYToNativeRectangle(t,i,r),s={bbox:o.west+","+o.south+","+o.east+","+o.north,size:e._tileWidth+","+e._tileHeight,format:e._format,transparent:e._transparent,f:"image"};Er.isGeographic(e._tilingScheme.projection)?(s.bboxSR=4326,s.imageSR=4326):(s.bboxSR=3857,s.imageSR=3857),e.layers&&(s.layers="show:"+e.layers);const l=Object.assign(e._resource.queryParameters,s);a=e._resource.getDerivedResource({url:"export",request:n,queryParameters:l})}return a}}var Pr=Lr;class Rr{}Rr.addArcGISMapImageLayer=function(e,t){const i=Rr.initializeOptions(e),r=th(e,t),n=new Pr(i);Cesium.defined(n._resource)||(n._resource=Cesium.Resource.createIfNeeded(i.url),n._resource.appendForwardSlash());const a=t.imageryLayers.addImageryProvider(n,r);return a.id=e.id,a._realIndex=e._realIndex+1,a},Rr.initializeOptions=function(e){const t=n.TileInfoUtil.createCommonTileInfo({extent:e.extent,tileSize:e.imageWidth}),i=eh(e.spatialReference,e.extent,t),r=ih(e,i.rectangle),a=new Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax),{extensionOptions:o={}}=e;let s={url:e.url,usePreCachedTilesIfAvailable:!1,layers:e.layers,tilingScheme:i,rectangle:a,headers:e.headers,tokenKey:e.tokenKey,tokenValue:e.tokenValue,transparent:e.imageTransparency,format:e.imageFormat};return s=Object.assign(s,o)},Rr.removeLayer=function(e,t){t.imageryLayers.remove(e)};var jr=Rr;class Ar{}Ar.addWMSLayer=function(e,t){const i=Ar.initializeOptions(e),r=th(e,t),n=t.scene.imageryLayers.addImageryProvider(new Cesium.WebMapServiceImageryProvider(i),r);return e.clippingArea&&sh(e,n,t),n.id=e.id,n._realIndex=e._realIndex+1,n},Ar.initializeOptions=function(e){const t=n.TileInfoUtil.createCommonTileInfo({extent:e.extent,tileSize:e.imageWidth}),i=eh(e.spatialReference,e.extent,t),r=ih(e,i.rectangle),a=new Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax),o=Object(n.isWMSReverse)(e.version,e.spatialReference);let s=e.url;e.tokenKey&&e.tokenValue&&(s=`${s}?${e.tokenKey}=${e.tokenValue}`);let l={url:s,layers:e.layers,parameters:{format:e.imageFormat,transparent:e.imageTransparency,version:e.version},tilingScheme:i,tileWidth:e.imageWidth,tileHeight:e.imageHeight,srs:`EPSG:${e.spatialReference.wkid}`,crs:`EPSG:${e.spatialReference.wkid}`,isReverseBBOX:o,rectangle:a};const{extensionOptions:h={}}=e;return l=Object.assign(l,h)},Ar.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var zr=Ar;class Dr{}Dr.addArcGISTileLayer=function(e,t){const i=Dr.initializeOptions(e),r=th(e,t),n=t.imageryLayers.addImageryProvider(new Cesium.UrlTemplateImageryProvider(i),r);return n.id=e.id,n._realIndex=e._realIndex+1,n},Dr.initializeOptions=function(e){const t=eh(e.spatialReference,e.extent,e.tileInfo),i=ih(e,t.rectangle),r=new Cesium.Rectangle(i.xmin,i.ymin,i.xmax,i.ymax);let n={url:`${e.url}/tile/{z}/{y}/{x}`,tilingScheme:t,tileWidth:e.tileInfo.cols,tileHeight:e.tileInfo.cols,rectangle:r};const{extensionOptions:a={}}=e;return n=Object.assign(n,a)},Dr.removeLayer=function(e,t){t.imageryLayers.remove(e)};var Vr=Dr;class Nr{constructor(e){e=Cesium.defaultValue(e,Cesium.defaultValue.EMPTY_OBJECT),this._imageVersion=Cesium.defaultValue(e.imageVersion,"0"),this._resource=Cesium.Resource.createIfNeeded(e.url),this._mapStyle=e.mapStyle,this._proxy=e.proxy,this._imageInfoUrl=e.url,this._url=e.url,this._tilingScheme=Cesium.defaultValue(e.tilingScheme,new Cesium.GeographicTilingScheme),this._rectangle=Cesium.defaultValue(e.rectangle,this._tilingScheme.rectangle),this._tileWidth=Cesium.defaultValue(e.tileWidth,256),this._tileHeight=Cesium.defaultValue(e.tileHeight,256),this._enablePickFeatures=Cesium.defaultValue(e.enablePickFeatures,!1),this._minimumLevel=Cesium.defaultValue(e.minimumLevel,0),this._maximumLevel=Cesium.defaultValue(e.maximumLevel,20),this.isStretchImage=Cesium.defaultValue(e.isStretchImage,!1),this._mapgisOffset=Cesium.defaultValue(e.mapgisOffset,0),this._buildImageResource=Cesium.defaultValue(e.buildImageResource,void 0),this._ready=!0,this._credit=Cesium.defaultValue(e.credit,new Cesium.Credit("MapGIS"))}static async fromUrl(e,t){const i=new n.IGSTileLayer({url:e}),r=await i.load(),a=Br.initializeOptions(r);return new Nr({...a,...t})}buildImageResource(e,t,i,r){if(this._buildImageResource&&this._buildImageResource instanceof Function)return this._buildImageResource(this,e,t,i,r);let n=this._resource.url;return n.includes("/igs/rest/services/")&&n.includes("/TileServer")?(512!==this._tileWidth&&"mapgis-tianditu"!==this._mapStyle||(i+=1),n=`${this._resource.url}/tileImage/${i}/${t}/${e}/?f=image`):n=(n=(n=512===this._tileWidth||"mapgis-tianditu"===this._mapStyle?n.replace("{level}",i+1):n.replace("{level}",i)).replace("{row}",t)).replace("{col}",e),this._resource.getDerivedResource({url:n,request:r,proxy:this._proxy})}requestImage(e,t,i,r){return i+=this.mapgisOffset,Cesium.ImageryProvider.loadImage(this,this.buildImageResource(e,t,i,r))}pickFeatures(e,t,i){if(!this._enablePickFeatures)return;let r=this._imageInfoUrl.replace("{s}",(e+t)%4);r=(r=(r=r.replace("{row}",t)).replace("{col}",e)).replace("{level}",i),this._isHistoryImage&&(r=r.replace("{version}",this._imageVersion));return this._resource.getDerivedResource({url:r,queryParameters:{f:"json"}}).fetchJson().then(e=>{const t=[],i=e.results;if(!Cesium.defined(i))return t;for(let e=0;e<i.length;++e){const r=i[e],n=new Cesium.ImageryLayerFeatureInfo;n.data=r,n.name=r.value,n.properties=r.attributes,n.configureDescriptionFromProperties(r.attributes),t.push(n)}return t})}}Object.defineProperties(Nr.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},mapgisOffset:{get:function(){return this._mapgisOffset}},rectangle:{get:function(){return this._rectangle}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});var Gr=Nr;class Fr{}Fr.addIGSTileLayer=function(e,t){const i=Fr.initializeOptions(e),r=th(e,t),n=t.imageryLayers.addImageryProvider(new Gr(i),r);return e.clippingArea&&sh(e,n,t),n.id=e.id,n._realIndex=e._realIndex+1,n},Fr.initializeOptions=function(e){const t=e.tileInfo.clone(),i=t.lods;for(;i.length>0&&0!==i[0].level;){const e=i[0];i.unshift(n.LOD.fromJSON({level:e.level-1,resolution:2*e.resolution,scale:2*e.scale}))}const r=eh(e.spatialReference,e.extent,t),a=ih(e,r.rectangle),o=new Cesium.Rectangle(a.xmin,a.ymin,a.xmax,a.ymax),[s,l]=n.TileInfoUtil.getLevelRangeByTileInfo(e.tileInfo);let h=e.url;"1.0"===e._igsVersion&&(h=`${e.url}/{level}/{row}/{col}`);let c={url:h,tileWidth:t.cols,tileHeight:t.cols,tilingScheme:r,rectangle:o,minimumLevel:s,maximumLevel:l};const{extensionOptions:u={}}=e;return c=Object.assign(c,u)},Fr.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var Br=Fr;class qr{}qr.addWMTSLayer=function(e,t){const i=qr.initializeOptions(e),r=th(e,t),a=new Cesium.WebMapTileServiceImageryProvider(i);a.isStretchImage=Object(n.defaultValue)(i.isStretchImage,!1);const o=t.scene.imageryLayers.addImageryProvider(a,r);return e.clippingArea&&sh(e,o,t),o.id=e.id,o._realIndex=e._realIndex+1,o},qr.initializeOptions=function(e){const t=e.getCurrentTileInfo();let i=eh(e.spatialReference,e.activeLayer.extent,t);e.spatialReference.isWebMercator?t.lods[0].resolution*t.size[0]>40075016.685574&&(i=new Cesium.WebMercatorTilingScheme):e.spatialReference.isGeographic&&t.lods[0].resolution*t.size[0]>180&&(i=new Cesium.GeographicTilingScheme);const r=ih(e,i.rectangle),a=new Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax),[o,s]=n.TileInfoUtil.getLevelRangeByTileInfo(t);let l=e.url;e.tokenValue&&e.tokenKey&&(l+=`?${e.tokenKey}=${e.tokenValue}`);let h={url:l,layer:e.activeLayer.title,format:e.activeLayer.imageFormat,style:e.activeLayer.styleId,tileMatrixSetID:e.activeLayer.tileMatrixSetId,tilingScheme:i,tileWidth:t.size[0],tileHeight:t.size[1],rectangle:a,minimumLevel:o,maximumLevel:s};const{extensionOptions:c={}}=e;return h=Object.assign(h,c)},qr.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var Ur=qr;function Wr(){return function(){throw new Error("Unimplemented abstract method.")}()}var Hr=0;function Yr(e){return e.ol_uid||(e.ol_uid=String(++Hr))}var Xr="5.3.3",$r=function(e){function t(t){var i="Assertion failed. See https://openlayers.org/en/"+("latest"===Xr?Xr:"v"+Xr.split("-")[0])+"/doc/errors/#"+t+" for details.";e.call(this,i),this.code=t,this.name="AssertionError",this.message=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error);function Jr(e,t){if(!e)throw new $r(t)}var Kr=i(9),Zr=i.n(Kr),Qr="function"==typeof Object.assign?Object.assign:function(e,t){var i=arguments;if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(e),n=1,a=arguments.length;n<a;++n){var o=i[n];if(void 0!==o&&null!==o)for(var s in o)o.hasOwnProperty(s)&&(r[s]=o[s])}return r};function en(e){for(var t in e)delete e[t]}function tn(e){var t;for(t in e)return!1;return!t}function rn(e,t,i){return Math.min(Math.max(e,t),i)}var nn="cosh"in Math?Math.cosh:function(e){var t=Math.exp(e);return(t+1/t)/2};function an(e,t,i,r,n,a){var o=n-i,s=a-r;if(0!==o||0!==s){var l=((e-i)*o+(t-r)*s)/(o*o+s*s);l>1?(i=n,r=a):l>0&&(i+=o*l,r+=s*l)}return on(e,t,i,r)}function on(e,t,i,r){var n=i-e,a=r-t;return n*n+a*a}function sn(e,t,i){return e+i*(t-e)}var ln={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};
13
11
  /**
14
12
  * @license
15
13
  * Latitude/longitude spherical geodesy formulae taken from
16
14
  * http://www.movable-type.co.uk/scripts/latlong.html
17
15
  * Licensed under CC-BY-3.0.
18
- */var an={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function on(e,t,i){return i?(i[0]=e[0]-t,i[1]=e[1]-t,i[2]=e[2]+t,i[3]=e[3]+t,i):[e[0]-t,e[1]-t,e[2]+t,e[3]+t]}function sn(e,t,i){var r,n;return(r=t<e[0]?e[0]-t:e[2]<t?t-e[2]:0)*r+(n=i<e[1]?e[1]-i:e[3]<i?i-e[3]:0)*n}function ln(e,t,i){return e[0]<=t&&t<=e[2]&&e[1]<=i&&i<=e[3]}function hn(e,t){var i=e[0],r=e[1],n=e[2],a=e[3],o=t[0],s=t[1],l=an.UNKNOWN;return o<i?l|=an.LEFT:o>n&&(l|=an.RIGHT),s<r?l|=an.BELOW:s>a&&(l|=an.ABOVE),l===an.UNKNOWN&&(l=an.INTERSECTING),l}function cn(e,t,i,r,n){return n?(n[0]=e,n[1]=t,n[2]=i,n[3]=r,n):[e,t,i,r]}function un(e){return cn(1/0,1/0,-1/0,-1/0,e)}function dn(e,t){var i=e[0],r=e[1];return cn(i,r,i,r,t)}function pn(e,t,i,r,n){return mn(un(n),e,t,i,r)}function fn(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function mn(e,t,i,r,n){for(;i<r;i+=n)yn(e,t[i],t[i+1]);return e}function yn(e,t,i){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],i),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],i)}function gn(e){return[e[0],e[1]]}function vn(e){return[e[2],e[1]]}function bn(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function _n(e){return e[3]-e[1]}function wn(e){return[e[0],e[3]]}function xn(e){return[e[2],e[3]]}function Cn(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function Sn(e,t,i){var r=[e[0],e[1],e[0],e[3],e[2],e[1],e[2],e[3]];return t(r,r,2),function(e,t,i){return cn(Math.min.apply(null,e),Math.min.apply(null,t),Math.max.apply(null,e),Math.max.apply(null,t),i)}([r[0],r[2],r[4],r[6]],[r[1],r[3],r[5],r[7]],i)}var Mn={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},kn={};kn[Mn.DEGREES]=2*Math.PI*6370997/360,kn[Mn.FEET]=.3048,kn[Mn.METERS]=1,kn[Mn.USFEET]=1200/3937;var Tn=Mn,In=function(e){this.code_=e.code,this.units_=e.units,this.extent_=void 0!==e.extent?e.extent:null,this.worldExtent_=void 0!==e.worldExtent?e.worldExtent:null,this.axisOrientation_=void 0!==e.axisOrientation?e.axisOrientation:"enu",this.global_=void 0!==e.global&&e.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit};In.prototype.canWrapX=function(){return this.canWrapX_},In.prototype.getCode=function(){return this.code_},In.prototype.getExtent=function(){return this.extent_},In.prototype.getUnits=function(){return this.units_},In.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||kn[this.units_]},In.prototype.getWorldExtent=function(){return this.worldExtent_},In.prototype.getAxisOrientation=function(){return this.axisOrientation_},In.prototype.isGlobal=function(){return this.global_},In.prototype.setGlobal=function(e){this.global_=e,this.canWrapX_=!(!e||!this.extent_)},In.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},In.prototype.setDefaultTileGrid=function(e){this.defaultTileGrid_=e},In.prototype.setExtent=function(e){this.extent_=e,this.canWrapX_=!(!this.global_||!e)},In.prototype.setWorldExtent=function(e){this.worldExtent_=e},In.prototype.setGetPointResolution=function(e){this.getPointResolutionFunc_=e},In.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var On=In,En=6378137,Ln=Math.PI*En,Pn=[-Ln,-Ln,Ln,Ln],Rn=[-180,-85,180,85],jn=function(e){function t(t){e.call(this,{code:t,units:Tn.METERS,extent:Pn,global:!0,worldExtent:Rn,getPointResolution:function(e,t){return e/Qr(t[1]/En)}})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(On),An=[new jn("EPSG:3857"),new jn("EPSG:102100"),new jn("EPSG:102113"),new jn("EPSG:900913"),new jn("urn:ogc:def:crs:EPSG:6.18:3:3857"),new jn("urn:ogc:def:crs:EPSG::3857"),new jn("http://www.opengis.net/gml/srs/epsg.xml#3857")];function zn(e,t,i){var r=e.length,n=i>1?i:2,a=t;void 0===a&&(a=n>2?e.slice():new Array(r));for(var o=Ln,s=0;s<r;s+=n){a[s]=o*e[s]/180;var l=En*Math.log(Math.tan(Math.PI*(e[s+1]+90)/360));l>o?l=o:l<-o&&(l=-o),a[s+1]=l}return a}function Dn(e,t,i){var r=e.length,n=i>1?i:2,a=t;void 0===a&&(a=n>2?e.slice():new Array(r));for(var o=0;o<r;o+=n)a[o]=180*e[o]/Ln,a[o+1]=360*Math.atan(Math.exp(e[o+1]/En))/Math.PI-90;return a}var Vn=[-180,-90,180,90],Nn=6378137*Math.PI/180,Gn=function(e){function t(t,i){e.call(this,{code:t,units:Tn.DEGREES,extent:Vn,axisOrientation:i,global:!0,metersPerUnit:Nn,worldExtent:Vn})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(On),Fn=[new Gn("CRS:84"),new Gn("EPSG:4326","neu"),new Gn("urn:ogc:def:crs:EPSG::4326","neu"),new Gn("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new Gn("urn:ogc:def:crs:OGC:1.3:CRS84"),new Gn("urn:ogc:def:crs:OGC:2:84"),new Gn("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Gn("urn:x-ogc:def:crs:EPSG:4326","neu")],Bn={};var qn={};function Un(e,t,i){var r=e.getCode(),n=t.getCode();r in qn||(qn[r]={}),qn[r][n]=i}function Wn(e,t,i){var r;if(void 0!==t){for(var n=0,a=e.length;n<a;++n)t[n]=e[n];r=t}else r=e.slice();return r}function Hn(e,t,i){if(void 0!==t&&e!==t){for(var r=0,n=e.length;r<n;++r)t[r]=e[r];e=t}return e}function Yn(e){!function(e,t){Bn[e]=t}(e.getCode(),e),Un(e,e,Wn)}function Xn(e){return"string"==typeof e?function(e){return Bn[e]||null}(e):e||null}function Jn(e){!function(e){e.forEach(Yn)}(e),e.forEach(function(t){e.forEach(function(e){t!==e&&Un(t,e,Wn)})})}function $n(e,t){var i=function(e,t){var i;return e in qn&&t in qn[e]&&(i=qn[e][t]),i}(e.getCode(),t.getCode());return i||(i=Hn),i}function Kn(e,t){return $n(Xn(e),Xn(t))}Jn(An),Jn(Fn),function(e,t,i,r){e.forEach(function(e){t.forEach(function(t){Un(e,t,i),Un(t,e,r)})})}(Fn,An,zn,Dn);var Zn=function(){this.dataProjection=null,this.defaultFeatureProjection=null};Zn.prototype.getReadOptions=function(e,t){var i;return t&&(i={dataProjection:t.dataProjection?t.dataProjection:this.readProjection(e),featureProjection:t.featureProjection}),this.adaptOptions(i)},Zn.prototype.adaptOptions=function(e){return Jr({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},e)},Zn.prototype.getLastExtent=function(){return null},Zn.prototype.getType=function(){return Fr()},Zn.prototype.readFeature=function(e,t){return Fr()},Zn.prototype.readFeatures=function(e,t){return Fr()},Zn.prototype.readGeometry=function(e,t){return Fr()},Zn.prototype.readProjection=function(e){return Fr()},Zn.prototype.writeFeature=function(e,t){return Fr()},Zn.prototype.writeFeatures=function(e,t){return Fr()},Zn.prototype.writeGeometry=function(e,t){return Fr()};var Qn=Zn;function ea(e,t,i){var r,n=i?Xn(i.featureProjection):null,a=i?Xn(i.dataProjection):null;if(r=n&&a&&!function(e,t){if(e===t)return!0;var i=e.getUnits()===t.getUnits();return e.getCode()===t.getCode()?i:$n(e,t)===Wn&&i}(n,a)?Array.isArray(e)?function(e,t,i){return Sn(e,Kn(t,i))}(e,a,n):(t?e.clone():e).transform(t?n:a,t?a:n):e,t&&i&&void 0!==i.decimals&&!Array.isArray(r)){var o=Math.pow(10,i.decimals);r===e&&(r=e.clone()),r.applyTransform(function(e){for(var t=0,i=e.length;t<i;++t)e[t]=Math.round(e[t]*o)/o;return e})}return r}var ta="arraybuffer",ia={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};function ra(e,t){return e>t?1:e<t?-1:0}function na(e,t,i){for(;t<i;){var r=e[t];e[t]=e[i],e[i]=r,++t,--i}}function aa(e,t){for(var i=Array.isArray(t)?t:[t],r=i.length,n=0;n<r;n++)e[e.length]=i[n]}function oa(e,t){var i=e.length;if(i!==t.length)return!1;for(var r=0;r<i;r++)if(e[r]!==t[r])return!1;return!0}var sa="propertychange";function la(e,t,i,r){for(var n,a=0,o=e.length;a<o;++a)if((n=e[a]).listener===t&&n.bindTo===i)return r&&(n.deleteIndex=a),n}function ha(e,t){var i=ca(e);return i?i[t]:void 0}function ca(e,t){var i=e.ol_lm;return!i&&t&&(i=e.ol_lm={}),i}function ua(e,t){var i=ha(e,t);if(i){for(var r=0,n=i.length;r<n;++r)e.removeEventListener(t,i[r].boundListener),$r(i[r]);i.length=0;var a=ca(e);a&&(delete a[t],0===Object.keys(a).length&&function(e){delete e.ol_lm}(e))}}function da(e,t,i,r,n){var a=ca(e,!0),o=a[t];o||(o=a[t]=[]);var s=la(o,i,r,!1);return s?n||(s.callOnce=!1):(s={bindTo:r,callOnce:!!n,listener:i,target:e,type:t},e.addEventListener(t,function(e){var t=function(t){var i=e.listener,r=e.bindTo||e.target;return e.callOnce&&ma(e),i.call(r,t)};return e.boundListener=t,t}(s)),o.push(s)),s}function pa(e,t,i,r){return da(e,t,i,r,!0)}function fa(e,t,i,r){var n=ha(e,t);if(n){var a=la(n,i,r,!0);a&&ma(a)}}function ma(e){if(e&&e.target){e.target.removeEventListener(e.type,e.boundListener);var t=ha(e.target,e.type);if(t){var i="deleteIndex"in e?e.deleteIndex:t.indexOf(e);-1!==i&&t.splice(i,1),0===t.length&&ua(e.target,e.type)}$r(e)}}var ya=function(){this.disposed_=!1};ya.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},ya.prototype.disposeInternal=function(){};var ga=ya;function va(){}var ba=function(e){this.propagationStopped,this.type=e,this.target=null};ba.prototype.preventDefault=function(){this.propagationStopped=!0},ba.prototype.stopPropagation=function(){this.propagationStopped=!0};var _a=ba,wa=function(e){function t(){e.call(this),this.pendingRemovals_={},this.dispatching_={},this.listeners_={}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.addEventListener=function(e,t){var i=this.listeners_[e];i||(i=this.listeners_[e]=[]),-1===i.indexOf(t)&&i.push(t)},t.prototype.dispatchEvent=function(e){var t="string"==typeof e?new _a(e):e,i=t.type;t.target=this;var r,n=this.listeners_[i];if(n){i in this.dispatching_||(this.dispatching_[i]=0,this.pendingRemovals_[i]=0),++this.dispatching_[i];for(var a=0,o=n.length;a<o;++a)if(!1===n[a].call(this,t)||t.propagationStopped){r=!1;break}if(--this.dispatching_[i],0===this.dispatching_[i]){var s=this.pendingRemovals_[i];for(delete this.pendingRemovals_[i];s--;)this.removeEventListener(i,va);delete this.dispatching_[i]}return r}},t.prototype.disposeInternal=function(){!function(e){var t=ca(e);if(t)for(var i in t)ua(e,i)}(this)},t.prototype.getListeners=function(e){return this.listeners_[e]},t.prototype.hasListener=function(e){return e?e in this.listeners_:Object.keys(this.listeners_).length>0},t.prototype.removeEventListener=function(e,t){var i=this.listeners_[e];if(i){var r=i.indexOf(t);e in this.pendingRemovals_?(i[r]=va,++this.pendingRemovals_[e]):(i.splice(r,1),0===i.length&&delete this.listeners_[e])}},t}(ga),xa="change",Ca="clear",Sa="error",Ma="load";var ka=function(e){function t(){e.call(this),this.revision_=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.changed=function(){++this.revision_,this.dispatchEvent(xa)},t.prototype.getRevision=function(){return this.revision_},t.prototype.on=function(e,t){if(Array.isArray(e)){for(var i=e.length,r=new Array(i),n=0;n<i;++n)r[n]=da(this,e[n],t);return r}return da(this,e,t)},t.prototype.once=function(e,t){if(Array.isArray(e)){for(var i=e.length,r=new Array(i),n=0;n<i;++n)r[n]=pa(this,e[n],t);return r}return pa(this,e,t)},t.prototype.un=function(e,t){if(Array.isArray(e))for(var i=0,r=e.length;i<r;++i)fa(this,e[i],t);else fa(this,e,t)},t}(wa),Ta=function(e){function t(t,i,r){e.call(this,t),this.key=i,this.oldValue=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(_a),Ia=function(e){function t(t){e.call(this),qr(this),this.values_={},void 0!==t&&this.setProperties(t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){var t;return this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t},t.prototype.getKeys=function(){return Object.keys(this.values_)},t.prototype.getProperties=function(){return Jr({},this.values_)},t.prototype.notify=function(e,t){var i;i=function(e){return Oa.hasOwnProperty(e)?Oa[e]:Oa[e]="change:"+e}(e),this.dispatchEvent(new Ta(i,e,t)),i=sa,this.dispatchEvent(new Ta(i,e,t))},t.prototype.set=function(e,t,i){if(i)this.values_[e]=t;else{var r=this.values_[e];this.values_[e]=t,r!==t&&this.notify(e,r)}},t.prototype.setProperties=function(e,t){for(var i in e)this.set(i,e[i],t)},t.prototype.unset=function(e,t){if(e in this.values_){var i=this.values_[e];delete this.values_[e],t||this.notify(e,i)}},t}(ka),Oa={};var Ea=Ia;function La(e,t,i,r,n,a){for(var o=a||[],s=0,l=t;l<i;l+=r){var h=e[l],c=e[l+1];o[s++]=n[0]*h+n[2]*c+n[4],o[s++]=n[1]*h+n[3]*c+n[5]}return a&&o.length!=s&&(o.length=s),o}new Array(6);function Pa(e,t){var i=t[0],r=t[1];return t[0]=e[0]*i+e[2]*r+e[4],t[1]=e[1]*i+e[3]*r+e[5],t}function Ra(e,t,i,r,n,a,o,s){var l=Math.sin(a),h=Math.cos(a);return e[0]=r*h,e[1]=n*l,e[2]=-r*l,e[3]=n*h,e[4]=o*r*h-s*r*l+t,e[5]=o*n*l+s*n*h+i,e}var ja=[1,0,0,1,0,0];function Aa(e){var t;return e==ia.XY?t=2:e==ia.XYZ||e==ia.XYM?t=3:e==ia.XYZM&&(t=4),t}var za=function(e){function t(){e.call(this),this.layout=ia.XY,this.stride=2,this.flatCoordinates=null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.computeExtent=function(e){return pn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t.prototype.getCoordinates=function(){return Fr()},t.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},t.prototype.getFlatCoordinates=function(){return this.flatCoordinates},t.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},t.prototype.getLayout=function(){return this.layout},t.prototype.getSimplifiedGeometry=function(e){if(this.simplifiedGeometryRevision!=this.getRevision()&&($r(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var t=e.toString();if(this.simplifiedGeometryCache.hasOwnProperty(t))return this.simplifiedGeometryCache[t];var i=this.getSimplifiedGeometryInternal(e);return i.getFlatCoordinates().length<this.flatCoordinates.length?(this.simplifiedGeometryCache[t]=i,i):(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)},t.prototype.getSimplifiedGeometryInternal=function(e){return this},t.prototype.getStride=function(){return this.stride},t.prototype.setFlatCoordinates=function(e,t){this.stride=Aa(e),this.layout=e,this.flatCoordinates=t},t.prototype.setCoordinates=function(e,t){Fr()},t.prototype.setLayout=function(e,t,i){var r;if(e)r=Aa(e);else{for(var n=0;n<i;++n){if(0===t.length)return this.layout=ia.XY,void(this.stride=2);t=t[0]}e=function(e){var t;2==e?t=ia.XY:3==e?t=ia.XYZ:4==e&&(t=ia.XYZM);return t}(r=t.length)}this.layout=e,this.stride=r},t.prototype.applyTransform=function(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},t.prototype.rotate=function(e,t){var i=this.getFlatCoordinates();if(i){var r=this.getStride();!function(e,t,i,r,n,a,o){for(var s=o||[],l=Math.cos(n),h=Math.sin(n),c=a[0],u=a[1],d=0,p=t;p<i;p+=r){var f=e[p]-c,m=e[p+1]-u;s[d++]=c+f*l-m*h,s[d++]=u+f*h+m*l;for(var y=p+2;y<p+r;++y)s[d++]=e[y]}o&&s.length!=d&&(s.length=d)}(i,0,i.length,r,e,t,i),this.changed()}},t.prototype.scale=function(e,t,i){var r=t;void 0===r&&(r=e);var n=i;n||(n=bn(this.getExtent()));var a=this.getFlatCoordinates();if(a){var o=this.getStride();!function(e,t,i,r,n,a,o,s){for(var l=s||[],h=o[0],c=o[1],u=0,d=t;d<i;d+=r){var p=e[d]-h,f=e[d+1]-c;l[u++]=h+n*p,l[u++]=c+a*f;for(var m=d+2;m<d+r;++m)l[u++]=e[m]}s&&l.length!=u&&(l.length=u)}(a,0,a.length,o,e,r,n,a),this.changed()}},t.prototype.translate=function(e,t){var i=this.getFlatCoordinates();if(i){var r=this.getStride();!function(e,t,i,r,n,a,o){for(var s=o||[],l=0,h=t;h<i;h+=r){s[l++]=e[h]+n,s[l++]=e[h+1]+a;for(var c=h+2;c<h+r;++c)s[l++]=e[c]}o&&s.length!=l&&(s.length=l)}(i,0,i.length,r,e,t,i),this.changed()}},t}(function(e){function t(){e.call(this),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryCache={},this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return Fr()},t.prototype.closestPointXY=function(e,t,i,r){return Fr()},t.prototype.containsXY=function(e,t){return!1},t.prototype.getClosestPoint=function(e,t){var i=t||[NaN,NaN];return this.closestPointXY(e[0],e[1],i,1/0),i},t.prototype.intersectsCoordinate=function(e){return this.containsXY(e[0],e[1])},t.prototype.computeExtent=function(e){return Fr()},t.prototype.getExtent=function(e){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),function(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e}(this.extent_,e)},t.prototype.rotate=function(e,t){Fr()},t.prototype.scale=function(e,t,i){Fr()},t.prototype.simplify=function(e){return this.getSimplifiedGeometry(e*e)},t.prototype.getSimplifiedGeometry=function(e){return Fr()},t.prototype.getType=function(){return Fr()},t.prototype.applyTransform=function(e){Fr()},t.prototype.intersectsExtent=function(e){return Fr()},t.prototype.translate=function(e,t){Fr()},t.prototype.transform=function(e,t){var i=Xn(e),r=i.getUnits()==Tn.TILE_PIXELS?function(e,r,n){var a=i.getExtent(),o=i.getWorldExtent(),s=_n(o)/_n(a);return Ra(ja,o[0],o[3],s,-s,0,0,0),La(e,0,e.length,n,ja,r),Kn(i,t)(e,r,n)}:Kn(i,t);return this.applyTransform(r),this},t}(Ea));function Da(e,t,i,r,n,a,o){var s,l=e[t],h=e[t+1],c=e[i]-l,u=e[i+1]-h;if(0===c&&0===u)s=t;else{var d=((n-l)*c+(a-h)*u)/(c*c+u*u);if(d>1)s=i;else{if(d>0){for(var p=0;p<r;++p)o[p]=rn(e[t+p],e[i+p],d);return void(o.length=r)}s=t}}for(var f=0;f<r;++f)o[f]=e[s+f];o.length=r}function Va(e,t,i,r,n){var a=e[t],o=e[t+1];for(t+=r;t<i;t+=r){var s=e[t],l=e[t+1],h=tn(a,o,s,l);h>n&&(n=h),a=s,o=l}return n}function Na(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){var s=i[a];n=Va(e,t,s,r,n),t=s}return n}function Ga(e,t,i,r,n,a,o,s,l,h,c){if(t==i)return h;var u,d;if(0===n){if((d=tn(o,s,e[t],e[t+1]))<h){for(u=0;u<r;++u)l[u]=e[t+u];return l.length=r,d}return h}for(var p=c||[NaN,NaN],f=t+r;f<i;)if(Da(e,f-r,f,r,o,s,p),(d=tn(o,s,p[0],p[1]))<h){for(h=d,u=0;u<r;++u)l[u]=p[u];l.length=r,f+=r}else f+=r*Math.max((Math.sqrt(d)-Math.sqrt(h))/n|0,1);if(a&&(Da(e,i-r,t,r,o,s,p),(d=tn(o,s,p[0],p[1]))<h)){for(h=d,u=0;u<r;++u)l[u]=p[u];l.length=r}return h}function Fa(e,t,i,r,n,a,o,s,l,h,c){for(var u=c||[NaN,NaN],d=0,p=i.length;d<p;++d){var f=i[d];h=Ga(e,t,f,r,n,a,o,s,l,h,u),t=f}return h}function Ba(e,t,i,r){for(var n=0,a=i.length;n<a;++n)for(var o=i[n],s=0;s<r;++s)e[t++]=o[s];return t}function qa(e,t,i,r,n){for(var a=n||[],o=0,s=0,l=i.length;s<l;++s){var h=Ba(e,t,i[s],r);a[o++]=h,t=h}return a.length=o,a}function Ua(e,t,i,r,n){for(var a=void 0!==n?n:[],o=0,s=t;s<i;s+=r)a[o++]=e.slice(s,s+r);return a.length=o,a}function Wa(e,t,i,r,n){for(var a=void 0!==n?n:[],o=0,s=0,l=i.length;s<l;++s){var h=i[s];a[o++]=Ua(e,t,h,r,a[o]),t=h}return a.length=o,a}function Ha(e,t,i,r,n){for(var a=void 0!==n?n:[],o=0,s=0,l=i.length;s<l;++s){var h=i[s];a[o++]=Wa(e,t,h,r,a[o]),t=h[h.length-1]}return a.length=o,a}function Ya(e,t,i,r,n,a){var o=NaN,s=NaN,l=(i-t)/r;if(1===l)o=e[t],s=e[t+1];else if(2==l)o=(1-n)*e[t]+n*e[t+r],s=(1-n)*e[t+1]+n*e[t+r+1];else if(0!==l){for(var h=e[t],c=e[t+1],u=0,d=[0],p=t+r;p<i;p+=r){var f=e[p],m=e[p+1];u+=Math.sqrt((f-h)*(f-h)+(m-c)*(m-c)),d.push(u),h=f,c=m}var y=n*u,g=function(e,t,i){for(var r,n,a=i||ra,o=0,s=e.length,l=!1;o<s;)(n=+a(e[r=o+(s-o>>1)],t))<0?o=r+1:(s=r,l=!n);return l?o:~o}(d,y);if(g<0){var v=(y-d[-g-2])/(d[-g-1]-d[-g-2]),b=t+(-g-2)*r;o=rn(e[b],e[b+r],v),s=rn(e[b+1],e[b+r+1],v)}else o=e[t+g*r],s=e[t+g*r+1]}return a?(a[0]=o,a[1]=s,a):[o,s]}function Xa(e,t,i,r,n,a){if(i==t)return null;var o;if(n<e[t+r-1])return a?((o=e.slice(t,t+r))[r-1]=n,o):null;if(e[i-1]<n)return a?((o=e.slice(i-r,i))[r-1]=n,o):null;if(n==e[t+r-1])return e.slice(t,t+r);for(var s=t/r,l=i/r;s<l;){var h=s+l>>1;n<e[(h+1)*r-1]?l=h:s=h+1}var c=e[s*r-1];if(n==c)return e.slice((s-1)*r,(s-1)*r+r);var u=(n-c)/(e[(s+1)*r-1]-c);o=[];for(var d=0;d<r-1;++d)o.push(rn(e[(s-1)*r+d],e[s*r+d],u));return o.push(n),o}function Ja(e,t,i,r,n){return!function(e,t,i){var r;return(r=t.call(i,gn(e)))?r:(r=t.call(i,vn(e)))?r:(r=t.call(i,xn(e)))?r:(r=t.call(i,wn(e)))||!1}(n,function(n){return!$a(e,t,i,r,n[0],n[1])})}function $a(e,t,i,r,n,a){for(var o=0,s=e[i-r],l=e[i-r+1];t<i;t+=r){var h=e[t],c=e[t+1];l<=a?c>a&&(h-s)*(a-l)-(n-s)*(c-l)>0&&o++:c<=a&&(h-s)*(a-l)-(n-s)*(c-l)<0&&o--,s=h,l=c}return 0!==o}function Ka(e,t,i,r,n,a){if(0===i.length)return!1;if(!$a(e,t,i[0],r,n,a))return!1;for(var o=1,s=i.length;o<s;++o)if($a(e,i[o-1],i[o],r,n,a))return!1;return!0}function Za(e,t,i,r,n,a){for(var o,s=[e[t],e[t+1]],l=[];t+r<i;t+=r){if(l[0]=e[t+r],l[1]=e[t+r+1],o=n.call(a,s,l))return o;s[0]=l[0],s[1]=l[1]}return!1}function Qa(e,t,i,r,n){var a=mn([1/0,1/0,-1/0,-1/0],e,t,i,r);return!!Cn(n,a)&&(!!function(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}(n,a)||(a[0]>=n[0]&&a[2]<=n[2]||(a[1]>=n[1]&&a[3]<=n[3]||Za(e,t,i,r,function(e,t){return function(e,t,i){var r=!1,n=hn(e,t),a=hn(e,i);if(n===an.INTERSECTING||a===an.INTERSECTING)r=!0;else{var o,s,l=e[0],h=e[1],c=e[2],u=e[3],d=t[0],p=t[1],f=i[0],m=i[1],y=(m-p)/(f-d);a&an.ABOVE&&!(n&an.ABOVE)&&(r=(o=f-(m-u)/y)>=l&&o<=c),r||!(a&an.RIGHT)||n&an.RIGHT||(r=(s=m-(f-c)*y)>=h&&s<=u),r||!(a&an.BELOW)||n&an.BELOW||(r=(o=f-(m-h)/y)>=l&&o<=c),r||!(a&an.LEFT)||n&an.LEFT||(r=(s=m-(f-l)*y)>=h&&s<=u)}return r}(n,e,t)}))))}function eo(e,t,i,r,n){if(!function(e,t,i,r,n){return!!(Qa(e,t,i,r,n)||$a(e,t,i,r,n[0],n[1])||$a(e,t,i,r,n[0],n[3])||$a(e,t,i,r,n[2],n[1])||$a(e,t,i,r,n[2],n[3]))}(e,t,i[0],r,n))return!1;if(1===i.length)return!0;for(var a=1,o=i.length;a<o;++a)if(Ja(e,i[a-1],i[a],r,n)&&!Qa(e,i[a-1],i[a],r,n))return!1;return!0}function to(e,t,i,r){for(var n=e[t],a=e[t+1],o=0,s=t+r;s<i;s+=r){var l=e[s],h=e[s+1];o+=Math.sqrt((l-n)*(l-n)+(h-a)*(h-a)),n=l,a=h}return o}function io(e,t,i,r,n,a,o){var s=(i-t)/r;if(s<3){for(;t<i;t+=r)a[o++]=e[t],a[o++]=e[t+1];return o}var l=new Array(s);l[0]=1,l[s-1]=1;for(var h=[t,i-r],c=0;h.length>0;){for(var u=h.pop(),d=h.pop(),p=0,f=e[d],m=e[d+1],y=e[u],g=e[u+1],v=d+r;v<u;v+=r){var b=en(e[v],e[v+1],f,m,y,g);b>p&&(c=v,p=b)}p>n&&(l[(c-t)/r]=1,d+r<c&&h.push(d,c),c+r<u&&h.push(c,u))}for(var _=0;_<s;++_)l[_]&&(a[o++]=e[t+_*r],a[o++]=e[t+_*r+1]);return o}function ro(e,t,i,r,n,a,o,s){for(var l=0,h=i.length;l<h;++l){var c=i[l];o=io(e,t,c,r,n,a,o),s.push(o),t=c}return o}function no(e,t){return t*Math.round(e/t)}function ao(e,t,i,r,n,a,o){if(t==i)return o;var s,l,h=no(e[t],n),c=no(e[t+1],n);t+=r,a[o++]=h,a[o++]=c;do{if(s=no(e[t],n),l=no(e[t+1],n),(t+=r)==i)return a[o++]=s,a[o++]=l,o}while(s==h&&l==c);for(;t<i;){var u=no(e[t],n),d=no(e[t+1],n);if(t+=r,u!=s||d!=l){var p=s-h,f=l-c,m=u-h,y=d-c;p*y==f*m&&(p<0&&m<p||p==m||p>0&&m>p)&&(f<0&&y<f||f==y||f>0&&y>f)?(s=u,l=d):(a[o++]=s,a[o++]=l,h=s,c=l,s=u,l=d)}}return a[o++]=s,a[o++]=l,o}function oo(e,t,i,r,n,a,o,s){for(var l=0,h=i.length;l<h;++l){var c=i[l];o=ao(e,t,c,r,n,a,o),s.push(o),t=c}return o}var so=function(e){function t(t,i){e.call(this),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===i||Array.isArray(t[0])?this.setCoordinates(t,i):this.setFlatCoordinates(i,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendCoordinate=function(e){this.flatCoordinates?aa(this.flatCoordinates,e):this.flatCoordinates=e.slice(),this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,i,r){return r<sn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Va(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ga(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,i,r))},t.prototype.forEachSegment=function(e){return Za(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t.prototype.getCoordinateAtM=function(e,t){if(this.layout!=ia.XYM&&this.layout!=ia.XYZM)return null;var i=void 0!==t&&t;return Xa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i)},t.prototype.getCoordinates=function(){return Ua(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getCoordinateAt=function(e,t){return Ya(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t)},t.prototype.getLength=function(){return to(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[];return i.length=io(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i,0),new t(i,ia.XY)},t.prototype.getType=function(){return nn.LINE_STRING},t.prototype.intersectsExtent=function(e){return Qa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ba(this.flatCoordinates,0,e,this.stride),this.changed()},t}(za),lo=function(e){function t(t,i,r){if(e.call(this),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,i);else if(void 0!==i&&r)this.setFlatCoordinates(i,t),this.ends_=r;else{for(var n=this.getLayout(),a=t,o=[],s=[],l=0,h=a.length;l<h;++l){var c=a[l];0===l&&(n=c.getLayout()),aa(o,c.getFlatCoordinates()),s.push(o.length)}this.setFlatCoordinates(n,o),this.ends_=s}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendLineString=function(e){this.flatCoordinates?aa(this.flatCoordinates,e.getFlatCoordinates().slice()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},t.prototype.closestPointXY=function(e,t,i,r){return r<sn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Na(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,i,r))},t.prototype.getCoordinateAtM=function(e,t,i){if(this.layout!=ia.XYM&&this.layout!=ia.XYZM||0===this.flatCoordinates.length)return null;var r=void 0!==t&&t,n=void 0!==i&&i;return function(e,t,i,r,n,a,o){if(o)return Xa(e,t,i[i.length-1],r,n,a);var s;if(n<e[r-1])return a?((s=e.slice(0,r))[r-1]=n,s):null;if(e[e.length-1]<n)return a?((s=e.slice(e.length-r))[r-1]=n,s):null;for(var l=0,h=i.length;l<h;++l){var c=i[l];if(t!=c){if(n<e[t+r-1])return null;if(n<=e[c-1])return Xa(e,t,c,r,n,!1);t=c}}return null}(this.flatCoordinates,0,this.ends_,this.stride,e,r,n)},t.prototype.getCoordinates=function(){return Wa(this.flatCoordinates,0,this.ends_,this.stride)},t.prototype.getEnds=function(){return this.ends_},t.prototype.getLineString=function(e){return e<0||this.ends_.length<=e?null:new so(this.flatCoordinates.slice(0===e?0:this.ends_[e-1],this.ends_[e]),this.layout)},t.prototype.getLineStrings=function(){for(var e=this.flatCoordinates,t=this.ends_,i=this.layout,r=[],n=0,a=0,o=t.length;a<o;++a){var s=t[a],l=new so(e.slice(n,s),i);r.push(l),n=s}return r},t.prototype.getFlatMidpoints=function(){for(var e=[],t=this.flatCoordinates,i=0,r=this.ends_,n=this.stride,a=0,o=r.length;a<o;++a){var s=r[a];aa(e,Ya(t,i,s,n,.5)),i=s}return e},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[],r=[];return i.length=ro(this.flatCoordinates,0,this.ends_,this.stride,e,i,0,r),new t(i,ia.XY,r)},t.prototype.getType=function(){return nn.MULTI_LINE_STRING},t.prototype.intersectsExtent=function(e){return function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){if(Qa(e,t,i[a],r,n))return!0;t=i[a]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,e)},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=qa(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},t}(za),ho=function(e){function t(t,i){e.call(this),this.setCoordinates(t,i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,i,r){var n=this.flatCoordinates,a=tn(e,t,n[0],n[1]);if(a<r){for(var o=this.stride,s=0;s<o;++s)i[s]=n[s];return i.length=o,a}return r},t.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},t.prototype.computeExtent=function(e){return dn(this.flatCoordinates,e)},t.prototype.getType=function(){return nn.POINT},t.prototype.intersectsExtent=function(e){return ln(e,this.flatCoordinates[0],this.flatCoordinates[1])},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=function(e,t,i,r){for(var n=0,a=i.length;n<a;++n)e[t++]=i[n];return t}(this.flatCoordinates,0,e,this.stride),this.changed()},t}(za),co=function(e){function t(t,i){e.call(this),i&&!Array.isArray(t[0])?this.setFlatCoordinates(i,t):this.setCoordinates(t,i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendPoint=function(e){this.flatCoordinates?aa(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,i,r){if(r<sn(this.getExtent(),e,t))return r;for(var n=this.flatCoordinates,a=this.stride,o=0,s=n.length;o<s;o+=a){var l=tn(e,t,n[o],n[o+1]);if(l<r){r=l;for(var h=0;h<a;++h)i[h]=n[o+h];i.length=a}}return r},t.prototype.getCoordinates=function(){return Ua(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getPoint=function(e){var t=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return e<0||t<=e?null:new ho(this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride),this.layout)},t.prototype.getPoints=function(){for(var e=this.flatCoordinates,t=this.layout,i=this.stride,r=[],n=0,a=e.length;n<a;n+=i){var o=new ho(e.slice(n,n+i),t);r.push(o)}return r},t.prototype.getType=function(){return nn.MULTI_POINT},t.prototype.intersectsExtent=function(e){for(var t=this.flatCoordinates,i=this.stride,r=0,n=t.length;r<n;r+=i){if(ln(e,t[r],t[r+1]))return!0}return!1},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ba(this.flatCoordinates,0,e,this.stride),this.changed()},t}(za);function uo(e,t,i,r){for(var n=0,a=e[i-r],o=e[i-r+1];t<i;t+=r){var s=e[t],l=e[t+1];n+=o*s-a*l,a=s,o=l}return n/2}function po(e,t,i,r){for(var n=0,a=0,o=i.length;a<o;++a){var s=i[a];n+=uo(e,t,s,r),t=s}return n}var fo=function(e){function t(t,i){e.call(this),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===i||Array.isArray(t[0])?this.setCoordinates(t,i):this.setFlatCoordinates(i,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,i,r){return r<sn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Va(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ga(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,i,r))},t.prototype.getArea=function(){return uo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getCoordinates=function(){return Ua(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[];return i.length=io(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i,0),new t(i,ia.XY)},t.prototype.getType=function(){return nn.LINEAR_RING},t.prototype.intersectsExtent=function(e){return!1},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ba(this.flatCoordinates,0,e,this.stride),this.changed()},t}(za);function mo(e,t,i,r,n,a,o){for(var s,l,h,c,u,d,p,f=n[a+1],m=[],y=0,g=i.length;y<g;++y){var v=i[y];for(c=e[v-r],d=e[v-r+1],s=t;s<v;s+=r)u=e[s],p=e[s+1],(f<=d&&p<=f||d<=f&&f<=p)&&(h=(f-d)/(p-d)*(u-c)+c,m.push(h)),c=u,d=p}var b=NaN,_=-1/0;for(m.sort(ra),c=m[0],s=1,l=m.length;s<l;++s){u=m[s];var w=Math.abs(u-c);w>_&&Ka(e,t,i,r,h=(c+u)/2,f)&&(b=h,_=w),c=u}return isNaN(b)&&(b=n[a]),o?(o.push(b,f,_),o):[b,f,_]}function yo(e,t,i,r,n){for(var a=[],o=0,s=i.length;o<s;++o){var l=i[o];a=mo(e,t,l,r,n,2*o,a),t=l[l.length-1]}return a}function go(e,t,i,r){for(;t<i-r;){for(var n=0;n<r;++n){var a=e[t+n];e[t+n]=e[i-r+n],e[i-r+n]=a}t+=r,i-=r}}function vo(e,t,i,r){for(var n=0,a=e[i-r],o=e[i-r+1];t<i;t+=r){var s=e[t],l=e[t+1];n+=(s-a)*(l+o),a=s,o=l}return n>0}function bo(e,t,i,r,n){for(var a=void 0!==n&&n,o=0,s=i.length;o<s;++o){var l=i[o],h=vo(e,t,l,r);if(0===o){if(a&&h||!a&&!h)return!1}else if(a&&!h||!a&&h)return!1;t=l}return!0}function _o(e,t,i,r,n){for(var a=void 0!==n&&n,o=0,s=i.length;o<s;++o){var l=i[o],h=vo(e,t,l,r);(0===o?a&&h||!a&&!h:a&&!h||!a&&h)&&go(e,t,l,r),t=l}return t}function wo(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a)t=_o(e,t,i[a],r,n);return t}var xo=function(e){function t(t,i,r){e.call(this),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,void 0!==i&&r?(this.setFlatCoordinates(i,t),this.ends_=r):this.setCoordinates(t,i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendLinearRing=function(e){this.flatCoordinates?aa(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},t.prototype.closestPointXY=function(e,t,i,r){return r<sn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Na(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,i,r))},t.prototype.containsXY=function(e,t){return Ka(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)},t.prototype.getArea=function(){return po(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},t.prototype.getCoordinates=function(e){var t;return void 0!==e?_o(t=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,e):t=this.flatCoordinates,Wa(t,0,this.ends_,this.stride)},t.prototype.getEnds=function(){return this.ends_},t.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var e=bn(this.getExtent());this.flatInteriorPoint_=mo(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},t.prototype.getInteriorPoint=function(){return new ho(this.getFlatInteriorPoint(),ia.XYM)},t.prototype.getLinearRingCount=function(){return this.ends_.length},t.prototype.getLinearRing=function(e){return e<0||this.ends_.length<=e?null:new fo(this.flatCoordinates.slice(0===e?0:this.ends_[e-1],this.ends_[e]),this.layout)},t.prototype.getLinearRings=function(){for(var e=this.layout,t=this.flatCoordinates,i=this.ends_,r=[],n=0,a=0,o=i.length;a<o;++a){var s=i[a],l=new fo(t.slice(n,s),e);r.push(l),n=s}return r},t.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var e=this.flatCoordinates;bo(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=_o(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[],r=[];return i.length=oo(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),i,0,r),new t(i,ia.XY,r)},t.prototype.getType=function(){return nn.POLYGON},t.prototype.intersectsExtent=function(e){return eo(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=qa(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},t}(za),Co=xo;function So(e,t,i,r){for(var n=[],a=[1/0,1/0,-1/0,-1/0],o=0,s=i.length;o<s;++o){var l=i[o];a=pn(e,t,l[0],r),n.push((a[0]+a[2])/2,(a[1]+a[3])/2),t=l[l.length-1]}return n}var Mo=function(e){function t(t,i,r){if(e.call(this),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!r&&!Array.isArray(t[0])){for(var n=this.getLayout(),a=t,o=[],s=[],l=0,h=a.length;l<h;++l){var c=a[l];0===l&&(n=c.getLayout());for(var u=o.length,d=c.getEnds(),p=0,f=d.length;p<f;++p)d[p]+=u;aa(o,c.getFlatCoordinates()),s.push(d)}i=n,t=o,r=s}void 0!==i&&r?(this.setFlatCoordinates(i,t),this.endss_=r):this.setCoordinates(t,i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendPolygon=function(e){var t;if(this.flatCoordinates){var i=this.flatCoordinates.length;aa(this.flatCoordinates,e.getFlatCoordinates());for(var r=0,n=(t=e.getEnds().slice()).length;r<n;++r)t[r]+=i}else this.flatCoordinates=e.getFlatCoordinates().slice(),t=e.getEnds().slice(),this.endss_.push();this.endss_.push(t),this.changed()},t.prototype.clone=function(){for(var e=this.endss_.length,i=new Array(e),r=0;r<e;++r)i[r]=this.endss_[r].slice();return new t(this.flatCoordinates.slice(),this.layout,i)},t.prototype.closestPointXY=function(e,t,i,r){return r<sn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){var s=i[a];n=Na(e,t,s,r,n),t=s[s.length-1]}return n}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(e,t,i,r,n,a,o,s,l,h,c){for(var u=c||[NaN,NaN],d=0,p=i.length;d<p;++d){var f=i[d];h=Fa(e,t,f,r,n,a,o,s,l,h,u),t=f[f.length-1]}return h}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,i,r))},t.prototype.containsXY=function(e,t){return function(e,t,i,r,n,a){if(0===i.length)return!1;for(var o=0,s=i.length;o<s;++o){var l=i[o];if(Ka(e,t,l,r,n,a))return!0;t=l[l.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)},t.prototype.getArea=function(){return function(e,t,i,r){for(var n=0,a=0,o=i.length;a<o;++a){var s=i[a];n+=po(e,t,s,r),t=s[s.length-1]}return n}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},t.prototype.getCoordinates=function(e){var t;return void 0!==e?wo(t=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,e):t=this.flatCoordinates,Ha(t,0,this.endss_,this.stride)},t.prototype.getEndss=function(){return this.endss_},t.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var e=So(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=yo(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},t.prototype.getInteriorPoints=function(){return new co(this.getFlatInteriorPoints().slice(),ia.XYM)},t.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var e=this.flatCoordinates;!function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a)if(!bo(e,t,i[a],r,n))return!1;return!0}(e,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=wo(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=e,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[],r=[];return i.length=function(e,t,i,r,n,a,o,s){for(var l=0,h=i.length;l<h;++l){var c=i[l],u=[];o=oo(e,t,c,r,n,a,o,u),s.push(u),t=c[c.length-1]}return o}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(e),i,0,r),new t(i,ia.XY,r)},t.prototype.getPolygon=function(e){if(e<0||this.endss_.length<=e)return null;var t;if(0===e)t=0;else{var i=this.endss_[e-1];t=i[i.length-1]}var r=this.endss_[e].slice(),n=r[r.length-1];if(0!==t)for(var a=0,o=r.length;a<o;++a)r[a]-=t;return new Co(this.flatCoordinates.slice(t,n),this.layout,r)},t.prototype.getPolygons=function(){for(var e=this.layout,t=this.flatCoordinates,i=this.endss_,r=[],n=0,a=0,o=i.length;a<o;++a){var s=i[a].slice(),l=s[s.length-1];if(0!==n)for(var h=0,c=s.length;h<c;++h)s[h]-=n;var u=new Co(t.slice(n,l),e,s);r.push(u),n=l}return r},t.prototype.getType=function(){return nn.MULTI_POLYGON},t.prototype.intersectsExtent=function(e){return function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){var s=i[a];if(eo(e,t,s,r,n))return!0;t=s[s.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=function(e,t,i,r,n){for(var a=n||[],o=0,s=0,l=i.length;s<l;++s){var h=qa(e,t,i[s],r,a[o]);a[o++]=h,t=h[h.length-1]}return a.length=o,a}(this.flatCoordinates,0,e,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var r=i[i.length-1];this.flatCoordinates.length=0===r.length?0:r[r.length-1]}this.changed()},t}(za),ko=[1,0,0,1,0,0],To=function(e,t,i,r,n){this.extent_,this.id_=n,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=r};To.prototype.get=function(e){return this.properties_[e]},To.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===nn.POINT?dn(this.flatCoordinates_):pn(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},To.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var e=bn(this.getExtent());this.flatInteriorPoints_=mo(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_},To.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var e=So(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=yo(this.flatCoordinates_,0,this.ends_,2,e)}return this.flatInteriorPoints_},To.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=Ya(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},To.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var e=this.flatCoordinates_,t=0,i=this.ends_,r=0,n=i.length;r<n;++r){var a=i[r],o=Ya(e,t,a,2,.5);aa(this.flatMidpoints_,o),t=a}}return this.flatMidpoints_},To.prototype.getId=function(){return this.id_},To.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},To.prototype.getGeometry=function(){return this},To.prototype.getSimplifiedGeometry=function(e){return this},To.prototype.getProperties=function(){return this.properties_},To.prototype.getStride=function(){return 2},To.prototype.getStyleFunction=function(){},To.prototype.getType=function(){return this.type_},To.prototype.transform=function(e,t){var i=(e=Xn(e)).getExtent(),r=e.getWorldExtent(),n=_n(r)/_n(i);Ra(ko,r[0],r[3],n,-n,0,0,0),La(this.flatCoordinates_,0,this.flatCoordinates_.length,2,ko,this.flatCoordinates_)},To.prototype.getEnds=To.prototype.getEndss=function(){return this.ends_},To.prototype.getFlatCoordinates=To.prototype.getOrientedFlatCoordinates;var Io=To;function Oo(e,t,i){if(3===e){var r={keys:[],values:[],features:[]},n=i.readVarint()+i.pos;i.readFields(Eo,r,n),r.length=r.features.length,r.length&&(t[r.name]=r)}}function Eo(e,t,i){if(15===e)t.version=i.readVarint();else if(1===e)t.name=i.readString();else if(5===e)t.extent=i.readVarint();else if(2===e)t.features.push(i.pos);else if(3===e)t.keys.push(i.readString());else if(4===e){for(var r=null,n=i.readVarint()+i.pos;i.pos<n;)r=1===(e=i.readVarint()>>3)?i.readString():2===e?i.readFloat():3===e?i.readDouble():4===e?i.readVarint64():5===e?i.readVarint():6===e?i.readSVarint():7===e?i.readBoolean():null;t.values.push(r)}}function Lo(e,t,i){if(1==e)t.id=i.readVarint();else if(2==e)for(var r=i.readVarint()+i.pos;i.pos<r;){var n=t.layer.keys[i.readVarint()],a=t.layer.values[i.readVarint()];t.properties[n]=a}else 3==e?t.type=i.readVarint():4==e&&(t.geometry=i.pos)}function Po(e,t,i){e.pos=t.features[i];var r=e.readVarint()+e.pos,n={layer:t,type:0,properties:{}};return e.readFields(Lo,n,r),n}var Ro=function(e){function t(t){e.call(this);var i=t||{};this.dataProjection=new On({code:"",units:Tn.TILE_PIXELS}),this.featureClass_=i.featureClass?i.featureClass:Io,this.geometryName_=i.geometryName,this.layerName_=i.layerName?i.layerName:"layer",this.layers_=i.layers?i.layers:null,this.extent_=null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.readRawGeometry_=function(e,t,i,r){e.pos=t.geometry;for(var n=e.readVarint()+e.pos,a=1,o=0,s=0,l=0,h=0,c=0;e.pos<n;){if(!o){var u=e.readVarint();a=7&u,o=u>>3}o--,1===a||2===a?(s+=e.readSVarint(),l+=e.readSVarint(),1===a&&h>c&&(r.push(h),c=h),i.push(s,l),h+=2):7===a?h>c&&(i.push(i[c],i[c+1]),h+=2):Hr(!1,59)}h>c&&(r.push(h),c=h)},t.prototype.createFeature_=function(e,t,i){var r,n=t.type;if(0===n)return null;var a=t.id,o=t.properties;o[this.layerName_]=t.layer.name;var s=[],l=[];this.readRawGeometry_(e,t,s,l);var h=function(e,t){var i;1===e?i=1===t?nn.POINT:nn.MULTI_POINT:2===e?i=1===t?nn.LINE_STRING:nn.MULTI_LINE_STRING:3===e&&(i=nn.POLYGON);return i}(n,l.length);if(this.featureClass_===Io)r=new this.featureClass_(h,s,l,o,a);else{var c;if(h==nn.POLYGON){for(var u=[],d=0,p=0,f=0,m=l.length;f<m;++f){var y=l[f];vo(s,d,y,2)||(u.push(l.slice(p,f)),p=f),d=y}c=u.length>1?new Mo(s,ia.XY,u):new Co(s,ia.XY,l)}else c=h===nn.POINT?new ho(s,ia.XY):h===nn.LINE_STRING?new so(s,ia.XY):h===nn.POLYGON?new Co(s,ia.XY,l):h===nn.MULTI_POINT?new co(s,ia.XY):h===nn.MULTI_LINE_STRING?new lo(s,ia.XY,l):null;r=new(0,this.featureClass_),this.geometryName_&&r.setGeometryName(this.geometryName_);var g=ea(c,!1,this.adaptOptions(i));r.setGeometry(g),r.setId(a),r.setProperties(o)}return r},t.prototype.getLastExtent=function(){return this.extent_},t.prototype.getType=function(){return ta},t.prototype.readFeatures=function(e,t){var i=this.layers_,r=new Xr.a(e),n=r.readFields(Oo,{}),a=[];for(var o in n)if(!i||-1!=i.indexOf(o)){for(var s=n[o],l=0,h=s.length;l<h;++l){var c=Po(r,s,l);a.push(this.createFeature_(r,c))}this.extent_=s?[0,0,s.extent,s.extent]:null}return a},t.prototype.readProjection=function(e){return this.dataProjection},t.prototype.setLayers=function(e){this.layers_=e},t}(Qn);function jo(e,t){var i=document.createElement("canvas");return e&&(i.width=e),t&&(i.height=t),i.getContext("2d")}var Ao=function(){};Ao.prototype.getReplay=function(e,t){return Fr()},Ao.prototype.isEmpty=function(){return Fr()},Ao.prototype.addDeclutter=function(e){return Fr()};var zo=Ao,Do={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"},Vo=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,No=/^([a-z]*)$/i;function Go(e){return"string"==typeof e?e:qo(e)}var Fo=function(){var e={},t=0;return function(i){var r;if(e.hasOwnProperty(i))r=e[i];else{if(t>=1024){var n=0;for(var a in e)0==(3&n++)&&(delete e[a],--t)}r=function(e){var t,i,r,n,a;No.exec(e)&&(e=function(e){var t=document.createElement("div");if(t.style.color=e,""!==t.style.color){document.body.appendChild(t);var i=getComputedStyle(t).color;return document.body.removeChild(t),i}return""}(e));if(Vo.exec(e)){var o,s=e.length-1;o=s<=4?1:2;var l=4===s||8===s;t=parseInt(e.substr(1+0*o,o),16),i=parseInt(e.substr(1+1*o,o),16),r=parseInt(e.substr(1+2*o,o),16),n=l?parseInt(e.substr(1+3*o,o),16):255,1==o&&(t=(t<<4)+t,i=(i<<4)+i,r=(r<<4)+r,l&&(n=(n<<4)+n)),a=[t,i,r,n/255]}else 0==e.indexOf("rgba(")?Bo(a=e.slice(5,-1).split(",").map(Number)):0==e.indexOf("rgb(")?((a=e.slice(4,-1).split(",").map(Number)).push(1),Bo(a)):Hr(!1,14);return a}(i),e[i]=r,++t}return r}}();function Bo(e){return e[0]=Zr(e[0]+.5|0,0,255),e[1]=Zr(e[1]+.5|0,0,255),e[2]=Zr(e[2]+.5|0,0,255),e[3]=Zr(e[3],0,1),e}function qo(e){var t=e[0];t!=(0|t)&&(t=t+.5|0);var i=e[1];i!=(0|i)&&(i=i+.5|0);var r=e[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+t+","+i+","+r+","+(void 0===e[3]?1:e[3])+")"}function Uo(e){return Array.isArray(e)?qo(e):e}function Wo(e,t,i,r,n,a,o,s){for(var l,h,c,u=[],d=e[t]>e[i-r],p=n.length,f=e[t],m=e[t+1],y=e[t+=r],g=e[t+1],v=0,b=Math.sqrt(Math.pow(y-f,2)+Math.pow(g-m,2)),_="",w=0,x=0;x<p;++x){h=d?p-x-1:x;var C=n.charAt(h),S=a(_=d?C+_:_+C)-w;w+=S;for(var M=o+S/2;t<i-r&&v+b<M;)f=y,m=g,y=e[t+=r],g=e[t+1],v+=b,b=Math.sqrt(Math.pow(y-f,2)+Math.pow(g-m,2));var k=M-v,T=Math.atan2(g-m,y-f);if(d&&(T+=T>0?-Math.PI:Math.PI),void 0!==c){var I=T-c;if(I+=I>Math.PI?-2*Math.PI:I<-Math.PI?2*Math.PI:0,Math.abs(I)>s)return null}var O=k/b,E=rn(f,y,O),L=rn(m,g,O);c==T?(d&&(l[0]=E,l[1]=L,l[2]=S/2),l[4]=_):(w=S,l=[E,L,S/2,T,_=C],d?u.unshift(l):u.push(l),c=T),o+=S}return u}var Ho="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",Yo=(Ho.indexOf("firefox"),-1!==Ho.indexOf("safari")&&Ho.indexOf("chrom"),-1!==Ho.indexOf("webkit")&&Ho.indexOf("edge"),Ho.indexOf("macintosh"),window.devicePixelRatio,function(){var e=!1;try{e=!!document.createElement("canvas").getContext("2d").setLineDash}catch(e){}return e}()),Xo=(navigator,window,window,navigator.msPointerEnabled,function(){});Xo.prototype.drawCustom=function(e,t,i){},Xo.prototype.drawGeometry=function(e){},Xo.prototype.setStyle=function(e){},Xo.prototype.drawCircle=function(e,t){},Xo.prototype.drawFeature=function(e,t){},Xo.prototype.drawGeometryCollection=function(e,t){},Xo.prototype.drawLineString=function(e,t){},Xo.prototype.drawMultiLineString=function(e,t){},Xo.prototype.drawMultiPoint=function(e,t){},Xo.prototype.drawMultiPolygon=function(e,t){},Xo.prototype.drawPoint=function(e,t){},Xo.prototype.drawPolygon=function(e,t){},Xo.prototype.drawText=function(e,t){},Xo.prototype.setFillStrokeStyle=function(e,t){},Xo.prototype.setImageStyle=function(e,t){},Xo.prototype.setTextStyle=function(e,t){};var Jo=Xo,$o=function(){var e,t={};return function(i){if(e||(e=document.createElement("div").style),!(i in t)){e.font=i;var r=e.fontFamily;if(e.font="",!r)return null;t[i]=r.split(/,\s?/)}return t[i]}}(),Ko=[0,0,0,1],Zo=[],Qo=[0,0,0,1],es=[0,0,0,0],ts=new(function(e){function t(t){e.call(this),this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(Ca)},t.prototype.containsKey=function(e){return this.entries_.hasOwnProperty(e)},t.prototype.forEach=function(e,t){for(var i=this.oldest_;i;)e.call(t,i.value_,i.key_,this),i=i.newer},t.prototype.get=function(e){var t=this.entries_[e];return Hr(void 0!==t,15),t===this.newest_?t.value_:(t===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(t.newer.older=t.older,t.older.newer=t.newer),t.newer=null,t.older=this.newest_,this.newest_.newer=t,this.newest_=t,t.value_)},t.prototype.remove=function(e){var t=this.entries_[e];return Hr(void 0!==t,15),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var e,t=new Array(this.count_),i=0;for(e=this.newest_;e;e=e.older)t[i++]=e.key_;return t},t.prototype.getValues=function(){var e,t=new Array(this.count_),i=0;for(e=this.newest_;e;e=e.older)t[i++]=e.value_;return t},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_},t.prototype.replace=function(e,t){this.get(e),this.entries_[e].value_=t},t.prototype.set=function(e,t){Hr(!(e in this.entries_),16);var i={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[e]=i,++this.count_},t.prototype.setSize=function(e){this.highWaterMark=e},t.prototype.prune=function(){for(;this.canExpireCache();)this.pop()},t}(wa)),is={},rs=null,ns={},as=function(){var e,t,i=60,r=is,n="32px ",a=["monospace","serif"],o=a.length,s="wmytzilWMYTZIL@#/&?$%10";function l(e){for(var i=os(),r=100;r<=700;r+=300){for(var l=r+" ",h=!0,c=0;c<o;++c){var u=a[c];if(i.font=l+n+u,t=i.measureText(s).width,e!=u){i.font=l+n+e+","+u;var d=i.measureText(s).width;h=h&&d!=t}}if(h)return!0}return!1}function h(){var t=!0;for(var n in r)r[n]<i&&(l(n)?(r[n]=i,$r(ns),rs=null,ts.clear()):(++r[n],t=!1));t&&(clearInterval(e),e=void 0)}return function(t){var n=$o(t);if(n)for(var a=0,o=n.length;a<o;++a){var s=n[a];s in r||(r[s]=i,l(s)||(r[s]=0,void 0===e&&(e=setInterval(h,32))))}}}();function os(){return rs||(rs=jo(1,1)),rs}var ss=function(){var e,t=ns;return function(i){var r=t[i];return void 0==r&&(e||((e=document.createElement("span")).textContent="M",e.style.margin=e.style.padding="0 !important",e.style.position="absolute !important",e.style.left="-99999px !important"),e.style.font=i,document.body.appendChild(e),r=t[i]=e.offsetHeight,document.body.removeChild(e)),r}}();function ls(e,t){var i=os();return e!=i.font&&(i.font=e),i.measureText(t).width}var hs=[1,0,0,1,0,0];function cs(e,t,i,r,n,a,o,s,l,h,c){var u;1!=i&&(u=e.globalAlpha,e.globalAlpha=u*i),t&&e.setTransform.apply(e,t),e.drawImage(r,n,a,o,s,l,h,o*c,s*c),u&&(e.globalAlpha=u),t&&e.setTransform.apply(e,hs)}var us={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},ds=[us.FILL],ps=[us.STROKE],fs=[us.BEGIN_PATH],ms=[us.CLOSE_PATH],ys=us,gs=[Do.POLYGON,Do.CIRCLE,Do.LINE_STRING,Do.IMAGE,Do.TEXT,Do.DEFAULT],vs={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},bs=[1/0,1/0,-1/0,-1/0],_s=[1,0,0,1,0,0],ws=function(e){function t(t,i,r,n,a,o){e.call(this),this.declutterTree=o,this.tolerance=t,this.maxExtent=i,this.overlaps=a,this.pixelRatio=n,this.maxLineWidth=0,this.resolution=r,this.alignFill_,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=[],this.pixelCoordinates_=null,this.state={},this.viewRotation_=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.replayTextBackground_=function(e,t,i,r,n,a,o){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,i),e.lineTo.apply(e,r),e.lineTo.apply(e,n),e.lineTo.apply(e,t),a&&(this.alignFill_=a[2],this.fill_(e)),o&&(this.setStrokeStyle_(e,o),e.stroke())},t.prototype.replayImage_=function(e,t,i,r,n,a,o,s,l,h,c,u,d,p,f,m,y,g){var v=y||g;t-=n*=d,i-=a*=d;var b,_,w,x,C=f+h>r.width?r.width-h:f,S=s+c>r.height?r.height-c:s,M=m[3]+C*d+m[1],k=m[0]+S*d+m[2],T=t-m[3],I=i-m[0];(v||0!==u)&&(b=[T,I],_=[T+M,I],w=[T+M,I+k],x=[T,I+k]);var O=null;if(0!==u){var E=t+n,L=i+a;O=Ra(_s,E,L,1,1,u,-E,-L),un(bs),fn(bs,Pa(_s,b)),fn(bs,Pa(_s,_)),fn(bs,Pa(_s,w)),fn(bs,Pa(_s,x))}else cn(T,I,T+M,I+k,bs);var P=e.canvas,R=g?g[2]*d/2:0,j=bs[0]-R<=P.width&&bs[2]+R>=0&&bs[1]-R<=P.height&&bs[3]+R>=0;if(p&&(t=Math.round(t),i=Math.round(i)),o){if(!j&&1==o[4])return;!function(e,t){t[0]<e[0]&&(e[0]=t[0]),t[2]>e[2]&&(e[2]=t[2]),t[1]<e[1]&&(e[1]=t[1]),t[3]>e[3]&&(e[3]=t[3])}(o,bs);var A=j?[e,O?O.slice(0):null,l,r,h,c,C,S,t,i,d]:null;A&&v&&A.push(y,g,b,_,w,x),o.push(A)}else j&&(v&&this.replayTextBackground_(e,b,_,w,x,y,g),cs(e,O,l,r,h,c,C,S,t,i,d))},t.prototype.applyPixelRatio=function(e){var t=this.pixelRatio;return 1==t?e:e.map(function(e){return e*t})},t.prototype.appendFlatCoordinates=function(e,t,i,r,n,a){var o=this.coordinates.length,s=this.getBufferedMaxExtent();a&&(t+=r);var l,h,c,u=[e[t],e[t+1]],d=[NaN,NaN],p=!0;for(l=t+r;l<i;l+=r)d[0]=e[l],d[1]=e[l+1],(c=hn(s,d))!==h?(p&&(this.coordinates[o++]=u[0],this.coordinates[o++]=u[1]),this.coordinates[o++]=d[0],this.coordinates[o++]=d[1],p=!1):c===an.INTERSECTING?(this.coordinates[o++]=d[0],this.coordinates[o++]=d[1],p=!1):p=!0,u[0]=d[0],u[1]=d[1],h=c;return(n&&p||l===t+r)&&(this.coordinates[o++]=u[0],this.coordinates[o++]=u[1]),o},t.prototype.drawCustomCoordinates_=function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){var s=i[a],l=this.appendFlatCoordinates(e,t,s,r,!1,!1);n.push(l),t=s}return t},t.prototype.drawCustom=function(e,t,i){this.beginGeometry(e,t);var r,n,a,o,s,l=e.getType(),h=e.getStride(),c=this.coordinates.length;if(l==nn.MULTI_POLYGON){r=(e=e).getOrientedFlatCoordinates(),o=[];var u=e.getEndss();s=0;for(var d=0,p=u.length;d<p;++d){var f=[];s=this.drawCustomCoordinates_(r,s,u[d],h,f),o.push(f)}this.instructions.push([ys.CUSTOM,c,o,e,i,Ha])}else l==nn.POLYGON||l==nn.MULTI_LINE_STRING?(a=[],r=l==nn.POLYGON?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),s=this.drawCustomCoordinates_(r,0,e.getEnds(),h,a),this.instructions.push([ys.CUSTOM,c,a,e,i,Wa])):l==nn.LINE_STRING||l==nn.MULTI_POINT?(r=e.getFlatCoordinates(),n=this.appendFlatCoordinates(r,0,r.length,h,!1,!1),this.instructions.push([ys.CUSTOM,c,n,e,i,Ua])):l==nn.POINT&&(r=e.getFlatCoordinates(),this.coordinates.push(r[0],r[1]),n=this.coordinates.length,this.instructions.push([ys.CUSTOM,c,n,e,i]));this.endGeometry(e,t)},t.prototype.beginGeometry=function(e,t){this.beginGeometryInstruction1_=[ys.BEGIN_GEOMETRY,t,0],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[ys.BEGIN_GEOMETRY,t,0],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},t.prototype.finish=function(){},t.prototype.fill_=function(e){if(this.alignFill_){var t=Pa(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;e.translate(t[0]%i,t[1]%i),e.rotate(this.viewRotation_)}e.fill(),this.alignFill_&&e.setTransform.apply(e,hs)},t.prototype.setStrokeStyle_=function(e,t){e.strokeStyle=t[1],e.lineWidth=t[2],e.lineCap=t[3],e.lineJoin=t[4],e.miterLimit=t[5],Yo&&(e.lineDashOffset=t[7],e.setLineDash(t[6]))},t.prototype.renderDeclutter_=function(e,t){if(e&&e.length>5){var i=e[4];if(1==i||i==e.length-5){var r={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};if(!this.declutterTree.collides(r)){this.declutterTree.insert(r);for(var n=5,a=e.length;n<a;++n){var o=e[n];o&&(o.length>11&&this.replayTextBackground_(o[0],o[13],o[14],o[15],o[16],o[11],o[12]),cs.apply(void 0,o))}}e.length=5,un(e)}}},t.prototype.replay_=function(e,t,i,r,n,a,o){var s;this.pixelCoordinates_&&oa(t,this.renderedTransform_)?s=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),s=La(this.coordinates,0,this.coordinates.length,2,t,this.pixelCoordinates_),function(e,t){e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5]}(this.renderedTransform_,t));for(var l,h,c,u,d,p,f,m,y,g,v,b,_=!Kr(i),w=0,x=r.length,C=0,S=0,M=0,k=null,T=null,I=this.coordinateCache_,O=this.viewRotation_,E={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:O},L=this.instructions!=r||this.overlaps?0:200;w<x;){var P=r[w];switch(P[0]){case ys.BEGIN_GEOMETRY:g=P[1],_&&i[qr(g)]||!g.getGeometry()?w=P[2]:void 0===o||Cn(o,g.getGeometry().getExtent())?++w:w=P[2]+1;break;case ys.BEGIN_PATH:S>L&&(this.fill_(e),S=0),M>L&&(e.stroke(),M=0),S||M||(e.beginPath(),u=d=NaN),++w;break;case ys.CIRCLE:var R=s[C=P[1]],j=s[C+1],A=s[C+2]-R,z=s[C+3]-j,D=Math.sqrt(A*A+z*z);e.moveTo(R+D,j),e.arc(R,j,D,0,2*Math.PI,!0),++w;break;case ys.CLOSE_PATH:e.closePath(),++w;break;case ys.CUSTOM:C=P[1],l=P[2];var V=P[3],N=P[4],G=6==P.length?P[5]:void 0;E.geometry=V,E.feature=g,w in I||(I[w]=[]);var F=I[w];G?G(s,C,l,2,F):(F[0]=s[C],F[1]=s[C+1],F.length=2),N(F,E),++w;break;case ys.DRAW_IMAGE:C=P[1],l=P[2],y=P[3],h=P[4],c=P[5],m=a?null:P[6];var B=P[7],q=P[8],U=P[9],W=P[10],H=P[11],Y=P[12],X=P[13],J=P[14],$=void 0,K=void 0,Z=void 0;for(P.length>16?($=P[15],K=P[16],Z=P[17]):($=es,K=Z=!1),H&&(Y+=O);C<l;C+=2)this.replayImage_(e,s[C],s[C+1],y,h,c,m,B,q,U,W,Y,X,n,J,$,K?k:null,Z?T:null);this.renderDeclutter_(m,g),++w;break;case ys.DRAW_CHARS:var Q=P[1],ee=P[2],te=P[3];m=a?null:P[4];var ie=P[5],re=P[6],ne=P[7],ae=P[8],oe=P[9],se=P[10],le=P[11],he=P[12],ce=P[13],ue=P[14],de=to(s,Q,ee,2),pe=ae(he);if(ie||pe<=de){var fe=this.textStates[ce].textAlign,me=Wo(s,Q,ee,2,he,ae,(de-pe)*vs[fe],ne);if(me){var ye=void 0,ge=void 0,ve=void 0,be=void 0,_e=void 0;if(se)for(ye=0,ge=me.length;ye<ge;++ye)ve=(_e=me[ye])[4],be=this.getImage(ve,ce,"",se),h=_e[2]+le,c=te*be.height+2*(.5-te)*le-oe,this.replayImage_(e,_e[0],_e[1],be,h,c,m,be.height,1,0,0,_e[3],ue,!1,be.width,es,null,null);if(re)for(ye=0,ge=me.length;ye<ge;++ye)ve=(_e=me[ye])[4],be=this.getImage(ve,ce,re,""),h=_e[2],c=te*be.height-oe,this.replayImage_(e,_e[0],_e[1],be,h,c,m,be.height,1,0,0,_e[3],ue,!1,be.width,es,null,null)}}this.renderDeclutter_(m,g),++w;break;case ys.END_GEOMETRY:if(void 0!==a){var we=a(g=P[1]);if(we)return we}++w;break;case ys.FILL:L?S++:this.fill_(e),++w;break;case ys.MOVE_TO_LINE_TO:for(C=P[1],l=P[2],v=s[C],f=(b=s[C+1])+.5|0,(p=v+.5|0)===u&&f===d||(e.moveTo(v,b),u=p,d=f),C+=2;C<l;C+=2)p=(v=s[C])+.5|0,f=(b=s[C+1])+.5|0,C!=l-2&&p===u&&f===d||(e.lineTo(v,b),u=p,d=f);++w;break;case ys.SET_FILL_STYLE:k=P,this.alignFill_=P[2],S&&(this.fill_(e),S=0,M&&(e.stroke(),M=0)),e.fillStyle=P[1],++w;break;case ys.SET_STROKE_STYLE:T=P,M&&(e.stroke(),M=0),this.setStrokeStyle_(e,P),++w;break;case ys.STROKE:L?M++:e.stroke(),++w;break;default:++w}}S&&this.fill_(e),M&&e.stroke()},t.prototype.replay=function(e,t,i,r,n){this.viewRotation_=i,this.replay_(e,t,r,this.instructions,n,void 0,void 0)},t.prototype.replayHitDetection=function(e,t,i,r,n,a){return this.viewRotation_=i,this.replay_(e,t,r,this.hitDetectionInstructions,!0,n,a)},t.prototype.reverseHitDetectionInstructions=function(){var e,t=this.hitDetectionInstructions;t.reverse();var i,r,n=t.length,a=-1;for(e=0;e<n;++e)(r=(i=t[e])[0])==ys.END_GEOMETRY?a=e:r==ys.BEGIN_GEOMETRY&&(i[2]=e,na(this.hitDetectionInstructions,a,e),a=-1)},t.prototype.setFillStrokeStyle=function(e,t){var i=this.state;if(e){var r=e.getColor();i.fillStyle=Uo(r||Ko)}else i.fillStyle=void 0;if(t){var n=t.getColor();i.strokeStyle=Uo(n||Qo);var a=t.getLineCap();i.lineCap=void 0!==a?a:"round";var o=t.getLineDash();i.lineDash=o?o.slice():Zo;var s=t.getLineDashOffset();i.lineDashOffset=s||0;var l=t.getLineJoin();i.lineJoin=void 0!==l?l:"round";var h=t.getWidth();i.lineWidth=void 0!==h?h:1;var c=t.getMiterLimit();i.miterLimit=void 0!==c?c:10,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},t.prototype.createFill=function(e,t){var i=e.fillStyle,r=[ys.SET_FILL_STYLE,i];return"string"!=typeof i&&r.push(!0),r},t.prototype.applyStroke=function(e){this.instructions.push(this.createStroke(e))},t.prototype.createStroke=function(e){return[ys.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth*this.pixelRatio,e.lineCap,e.lineJoin,e.miterLimit,this.applyPixelRatio(e.lineDash),e.lineDashOffset*this.pixelRatio]},t.prototype.updateFillStyle=function(e,t,i){var r=e.fillStyle;"string"==typeof r&&e.currentFillStyle==r||(void 0!==r&&this.instructions.push(t.call(this,e,i)),e.currentFillStyle=r)},t.prototype.updateStrokeStyle=function(e,t){var i=e.strokeStyle,r=e.lineCap,n=e.lineDash,a=e.lineDashOffset,o=e.lineJoin,s=e.lineWidth,l=e.miterLimit;(e.currentStrokeStyle!=i||e.currentLineCap!=r||n!=e.currentLineDash&&!oa(e.currentLineDash,n)||e.currentLineDashOffset!=a||e.currentLineJoin!=o||e.currentLineWidth!=s||e.currentMiterLimit!=l)&&(void 0!==i&&t.call(this,e),e.currentStrokeStyle=i,e.currentLineCap=r,e.currentLineDash=n,e.currentLineDashOffset=a,e.currentLineJoin=o,e.currentLineWidth=s,e.currentMiterLimit=l)},t.prototype.endGeometry=function(e,t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var i=[ys.END_GEOMETRY,t];this.instructions.push(i),this.hitDetectionInstructions.push(i)},t.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=function(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e.slice()}(this.maxExtent),this.maxLineWidth>0)){var e=this.resolution*(this.maxLineWidth+1)/2;on(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},t}(Jo),xs=function(e){function t(t,i,r,n,a,o){e.call(this,t,i,r,n,a,o),this.declutterGroup_=null,this.hitDetectionImage_=null,this.image_=null,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.drawCoordinates_=function(e,t,i,r){return this.appendFlatCoordinates(e,t,i,r,!1,!1)},t.prototype.drawPoint=function(e,t){if(this.image_){this.beginGeometry(e,t);var i=e.getFlatCoordinates(),r=e.getStride(),n=this.coordinates.length,a=this.drawCoordinates_(i,0,i.length,r);this.instructions.push([ys.DRAW_IMAGE,n,a,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([ys.DRAW_IMAGE,n,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(e,t)}},t.prototype.drawMultiPoint=function(e,t){if(this.image_){this.beginGeometry(e,t);var i=e.getFlatCoordinates(),r=e.getStride(),n=this.coordinates.length,a=this.drawCoordinates_(i,0,i.length,r);this.instructions.push([ys.DRAW_IMAGE,n,a,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([ys.DRAW_IMAGE,n,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(e,t)}},t.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0},t.prototype.setImageStyle=function(e,t){var i=e.getAnchor(),r=e.getSize(),n=e.getHitDetectionImage(1),a=e.getImage(1),o=e.getOrigin();this.anchorX_=i[0],this.anchorY_=i[1],this.declutterGroup_=t,this.hitDetectionImage_=n,this.image_=a,this.height_=r[1],this.opacity_=e.getOpacity(),this.originX_=o[0],this.originY_=o[1],this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScale(),this.width_=r[0]},t}(ws),Cs=function(e){function t(t,i,r,n,a,o){e.call(this,t,i,r,n,a,o)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.drawFlatCoordinates_=function(e,t,i,r){var n=this.coordinates.length,a=this.appendFlatCoordinates(e,t,i,r,!1,!1),o=[ys.MOVE_TO_LINE_TO,n,a];return this.instructions.push(o),this.hitDetectionInstructions.push(o),i},t.prototype.drawLineString=function(e,t){var i=this.state,r=i.strokeStyle,n=i.lineWidth;if(void 0!==r&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([ys.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],fs);var a=e.getFlatCoordinates(),o=e.getStride();this.drawFlatCoordinates_(a,0,a.length,o),this.hitDetectionInstructions.push(ps),this.endGeometry(e,t)}},t.prototype.drawMultiLineString=function(e,t){var i=this.state,r=i.strokeStyle,n=i.lineWidth;if(void 0!==r&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([ys.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],fs);for(var a=e.getEnds(),o=e.getFlatCoordinates(),s=e.getStride(),l=0,h=0,c=a.length;h<c;++h)l=this.drawFlatCoordinates_(o,l,a[h],s);this.hitDetectionInstructions.push(ps),this.endGeometry(e,t)}},t.prototype.finish=function(){var e=this.state;void 0!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(ps),this.reverseHitDetectionInstructions(),this.state=null},t.prototype.applyStroke=function(t){void 0!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(ps),t.lastStroke=this.coordinates.length),t.lastStroke=0,e.prototype.applyStroke.call(this,t),this.instructions.push(fs)},t}(ws),Ss=function(e){function t(t,i,r,n,a,o){e.call(this,t,i,r,n,a,o)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.drawFlatCoordinatess_=function(e,t,i,r){var n=this.state,a=void 0!==n.fillStyle,o=void 0!=n.strokeStyle,s=i.length;this.instructions.push(fs),this.hitDetectionInstructions.push(fs);for(var l=0;l<s;++l){var h=i[l],c=this.coordinates.length,u=this.appendFlatCoordinates(e,t,h,r,!0,!o),d=[ys.MOVE_TO_LINE_TO,c,u];this.instructions.push(d),this.hitDetectionInstructions.push(d),o&&(this.instructions.push(ms),this.hitDetectionInstructions.push(ms)),t=h}return a&&(this.instructions.push(ds),this.hitDetectionInstructions.push(ds)),o&&(this.instructions.push(ps),this.hitDetectionInstructions.push(ps)),t},t.prototype.drawCircle=function(e,t){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ys.SET_FILL_STYLE,Go(Ko)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ys.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var a=e.getFlatCoordinates(),o=e.getStride(),s=this.coordinates.length;this.appendFlatCoordinates(a,0,a.length,o,!1,!1);var l=[ys.CIRCLE,s];this.instructions.push(fs,l),this.hitDetectionInstructions.push(fs,l),this.hitDetectionInstructions.push(ds),void 0!==i.fillStyle&&this.instructions.push(ds),void 0!==i.strokeStyle&&(this.instructions.push(ps),this.hitDetectionInstructions.push(ps)),this.endGeometry(e,t)}},t.prototype.drawPolygon=function(e,t){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ys.SET_FILL_STYLE,Go(Ko)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ys.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var a=e.getEnds(),o=e.getOrientedFlatCoordinates(),s=e.getStride();this.drawFlatCoordinatess_(o,0,a,s),this.endGeometry(e,t)}},t.prototype.drawMultiPolygon=function(e,t){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ys.SET_FILL_STYLE,Go(Ko)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ys.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var a=e.getEndss(),o=e.getOrientedFlatCoordinates(),s=e.getStride(),l=0,h=0,c=a.length;h<c;++h)l=this.drawFlatCoordinatess_(o,l,a[h],s);this.endGeometry(e,t)}},t.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var t=this.coordinates,i=0,r=t.length;i<r;++i)t[i]=no(t[i],e)},t.prototype.setFillStrokeStyles_=function(e){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill,e),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},t}(ws);function Ms(e,t,i,r,n){var a,o,s,l,h,c,u,d,p,f=i,m=i,y=0,g=0,v=i;for(a=i;a<r;a+=n){var b=t[a],_=t[a+1];void 0!==l&&(d=b-l,p=_-h,s=Math.sqrt(d*d+p*p),void 0!==c&&(g+=o,Math.acos((c*d+u*p)/(o*s))>e&&(g>y&&(y=g,f=v,m=a),g=0,v=a-n)),o=s,c=d,u=p),l=b,h=_}return(g+=s)>y?[v,a]:[f,m]}var ks="point",Ts="line";var Is={Circle:Ss,Default:ws,Image:xs,LineString:Cs,Polygon:Ss,Text:function(e){function t(t,i,r,n,a,o){e.call(this,t,i,r,n,a,o),this.declutterGroup_,this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.widths_={},ts.prune()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.drawText=function(e,t){var i=this.textFillState_,r=this.textStrokeState_,n=this.textState_;if(""!==this.text_&&n&&(i||r)){var a,o,s=this.coordinates.length,l=e.getType(),h=null,c=2,u=2;if(n.placement===Ts){if(!Cn(this.getBufferedMaxExtent(),e.getExtent()))return;var d;if(h=e.getFlatCoordinates(),u=e.getStride(),l==nn.LINE_STRING)d=[h.length];else if(l==nn.MULTI_LINE_STRING)d=e.getEnds();else if(l==nn.POLYGON)d=e.getEnds().slice(0,1);else if(l==nn.MULTI_POLYGON){var p=e.getEndss();for(d=[],a=0,o=p.length;a<o;++a)d.push(p[a][0])}this.beginGeometry(e,t);for(var f,m=n.textAlign,y=0,g=0,v=d.length;g<v;++g){if(void 0==m){var b=Ms(n.maxAngle,h,y,d[g],u);y=b[0],f=b[1]}else f=d[g];for(a=y;a<f;a+=u)this.coordinates.push(h[a],h[a+1]);c=this.coordinates.length,y=d[g],this.drawChars_(s,c,this.declutterGroup_),s=c}this.endGeometry(e,t)}else{var _=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_),w=_.width/this.pixelRatio;switch(l){case nn.POINT:case nn.MULTI_POINT:c=(h=e.getFlatCoordinates()).length;break;case nn.LINE_STRING:h=e.getFlatMidpoint();break;case nn.CIRCLE:h=e.getCenter();break;case nn.MULTI_LINE_STRING:c=(h=e.getFlatMidpoints()).length;break;case nn.POLYGON:if(h=e.getFlatInteriorPoint(),!n.overflow&&h[2]/this.resolution<w)return;u=3;break;case nn.MULTI_POLYGON:var x=e.getFlatInteriorPoints();for(h=[],a=0,o=x.length;a<o;a+=3)(n.overflow||x[a+2]/this.resolution>=w)&&h.push(x[a],x[a+1]);if(0==(c=h.length))return}c=this.appendFlatCoordinates(h,0,c,u,!1,!1),(n.backgroundFill||n.backgroundStroke)&&(this.setFillStrokeStyle(n.backgroundFill,n.backgroundStroke),n.backgroundFill&&(this.updateFillStyle(this.state,this.createFill,e),this.hitDetectionInstructions.push(this.createFill(this.state,e))),n.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(e,t),this.drawTextImage_(_,s,c),this.endGeometry(e,t)}}},t.prototype.getImage=function(e,t,i,r){var n,a=r+t+e+i+this.pixelRatio;if(!ts.containsKey(a)){var o=r?this.strokeStates[r]||this.textStrokeState_:null,s=i?this.fillStates[i]||this.textFillState_:null,l=this.textStates[t]||this.textState_,h=this.pixelRatio,c=l.scale*h,u=vs[l.textAlign||"center"],d=r&&o.lineWidth?o.lineWidth:0,p=e.split("\n"),f=p.length,m=[],y=function(e,t,i){for(var r=t.length,n=0,a=0;a<r;++a){var o=ls(e,t[a]);n=Math.max(n,o),i.push(o)}return n}(l.font,p,m),g=ss(l.font),v=g*f,b=y+d,_=jo(Math.ceil(b*c),Math.ceil((v+d)*c));n=_.canvas,ts.set(a,n),1!=c&&_.scale(c,c),_.font=l.font,r&&(_.strokeStyle=o.strokeStyle,_.lineWidth=d,_.lineCap=o.lineCap,_.lineJoin=o.lineJoin,_.miterLimit=o.miterLimit,Yo&&o.lineDash.length&&(_.setLineDash(o.lineDash),_.lineDashOffset=o.lineDashOffset)),i&&(_.fillStyle=s.fillStyle),_.textBaseline="middle",_.textAlign="center";var w,x=.5-u,C=u*n.width/c+x*d;if(r)for(w=0;w<f;++w)_.strokeText(p[w],C+x*m[w],.5*(d+g)+w*g);if(i)for(w=0;w<f;++w)_.fillText(p[w],C+x*m[w],.5*(d+g)+w*g)}return ts.get(a)},t.prototype.drawTextImage_=function(e,t,i){var r=this.textState_,n=this.textStrokeState_,a=this.pixelRatio,o=vs[r.textAlign||"center"],s=vs[r.textBaseline],l=n&&n.lineWidth?n.lineWidth:0,h=o*e.width/a+2*(.5-o)*l,c=s*e.height/a+2*(.5-s)*l;this.instructions.push([ys.DRAW_IMAGE,t,i,e,(h-this.textOffsetX_)*a,(c-this.textOffsetY_)*a,this.declutterGroup_,e.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,e.width,r.padding==es?es:r.padding.map(function(e){return e*a}),!!r.backgroundFill,!!r.backgroundStroke]),this.hitDetectionInstructions.push([ys.DRAW_IMAGE,t,i,e,(h-this.textOffsetX_)*a,(c-this.textOffsetY_)*a,this.declutterGroup_,e.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/a,e.width,r.padding,!!r.backgroundFill,!!r.backgroundStroke])},t.prototype.drawChars_=function(e,t,i){var r=this.textStrokeState_,n=this.textState_,a=this.textFillState_,o=this.strokeKey_;r&&(o in this.strokeStates||(this.strokeStates[o]={strokeStyle:r.strokeStyle,lineCap:r.lineCap,lineDashOffset:r.lineDashOffset,lineWidth:r.lineWidth,lineJoin:r.lineJoin,miterLimit:r.miterLimit,lineDash:r.lineDash}));var s=this.textKey_;this.textKey_ in this.textStates||(this.textStates[this.textKey_]={font:n.font,textAlign:n.textAlign||"center",scale:n.scale});var l=this.fillKey_;a&&(l in this.fillStates||(this.fillStates[l]={fillStyle:a.fillStyle}));var h=this.pixelRatio,c=vs[n.textBaseline],u=this.textOffsetY_*h,d=this.text_,p=n.font,f=n.scale,m=r?r.lineWidth*f/2:0,y=this.widths_[p];y||(this.widths_[p]=y={}),this.instructions.push([ys.DRAW_CHARS,e,t,c,i,n.overflow,l,n.maxAngle,function(e){var t=y[e];return t||(t=y[e]=ls(p,e)),t*f*h},u,o,m*h,d,s,1]),this.hitDetectionInstructions.push([ys.DRAW_CHARS,e,t,c,i,n.overflow,l,n.maxAngle,function(e){var t=y[e];return t||(t=y[e]=ls(p,e)),t*f},u,o,m,d,s,1/h])},t.prototype.setTextStyle=function(e,t){var i,r,n;if(e){this.declutterGroup_=t;var a=e.getFill();a?((r=this.textFillState_)||(r=this.textFillState_={}),r.fillStyle=Uo(a.getColor()||Ko)):r=this.textFillState_=null;var o=e.getStroke();if(o){(n=this.textStrokeState_)||(n=this.textStrokeState_={});var s=o.getLineDash(),l=o.getLineDashOffset(),h=o.getWidth(),c=o.getMiterLimit();n.lineCap=o.getLineCap()||"round",n.lineDash=s?s.slice():Zo,n.lineDashOffset=void 0===l?0:l,n.lineJoin=o.getLineJoin()||"round",n.lineWidth=void 0===h?1:h,n.miterLimit=void 0===c?10:c,n.strokeStyle=Uo(o.getColor()||Qo)}else n=this.textStrokeState_=null;i=this.textState_;var u=e.getFont()||"10px sans-serif";as(u);var d=e.getScale();i.overflow=e.getOverflow(),i.font=u,i.maxAngle=e.getMaxAngle(),i.placement=e.getPlacement(),i.textAlign=e.getTextAlign(),i.textBaseline=e.getTextBaseline()||"middle",i.backgroundFill=e.getBackgroundFill(),i.backgroundStroke=e.getBackgroundStroke(),i.padding=e.getPadding()||es,i.scale=void 0===d?1:d;var p=e.getOffsetX(),f=e.getOffsetY(),m=e.getRotateWithView(),y=e.getRotation();this.text_=e.getText()||"",this.textOffsetX_=void 0===p?0:p,this.textOffsetY_=void 0===f?0:f,this.textRotateWithView_=void 0!==m&&m,this.textRotation_=void 0===y?0:y,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:qr(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?"),this.fillKey_=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+qr(r.fillStyle):""}else this.text_=""},t}(ws)},Os=function(e){function t(t,i,r,n,a,o,s){e.call(this),this.declutterTree_=o,this.declutterGroup_=null,this.tolerance_=t,this.maxExtent_=i,this.overlaps_=a,this.pixelRatio_=n,this.resolution_=r,this.renderBuffer_=s,this.replaysByZIndex_={},this.hitDetectionContext_=jo(1,1),this.hitDetectionTransform_=[1,0,0,1,0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.addDeclutter=function(e){var t=null;return this.declutterTree_&&(e?(t=this.declutterGroup_)[4]++:(t=this.declutterGroup_=[1/0,1/0,-1/0,-1/0]).push(1)),t},t.prototype.clip=function(e,t){var i=this.getClipCoords(t);e.beginPath(),e.moveTo(i[0],i[1]),e.lineTo(i[2],i[3]),e.lineTo(i[4],i[5]),e.lineTo(i[6],i[7]),e.clip()},t.prototype.hasReplays=function(e){for(var t in this.replaysByZIndex_)for(var i=this.replaysByZIndex_[t],r=0,n=e.length;r<n;++r)if(e[r]in i)return!0;return!1},t.prototype.finish=function(){for(var e in this.replaysByZIndex_){var t=this.replaysByZIndex_[e];for(var i in t)t[i].finish()}},t.prototype.forEachFeatureAtCoordinate=function(e,t,i,r,n,a,o){var s,l=2*(r=Math.round(r))+1,h=Ra(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-i,-e[0],-e[1]),c=this.hitDetectionContext_;c.canvas.width!==l||c.canvas.height!==l?(c.canvas.width=l,c.canvas.height=l):c.clearRect(0,0,l,l),void 0!==this.renderBuffer_&&(fn(s=[1/0,1/0,-1/0,-1/0],e),on(s,t*(this.renderBuffer_+r),s));var u,d,p=function(e){if(void 0!==Es[e])return Es[e];for(var t=2*e+1,i=new Array(t),r=0;r<t;r++)i[r]=new Array(t);var n=e,a=0,o=0;for(;n>=a;)Ls(i,e+n,e+a),Ls(i,e+a,e+n),Ls(i,e-a,e+n),Ls(i,e-n,e+a),Ls(i,e-n,e-a),Ls(i,e-a,e-n),Ls(i,e+a,e-n),Ls(i,e+n,e-a),2*((o+=1+2*++a)-n)+1>0&&(o+=1-2*(n-=1));return Es[e]=i,i}(r);function f(e){for(var t=c.getImageData(0,0,l,l).data,i=0;i<l;i++)for(var r=0;r<l;r++)if(p[i][r]&&t[4*(r*l+i)+3]>0){var n=void 0;return(!u||d!=Do.IMAGE&&d!=Do.TEXT||-1!==u.indexOf(e))&&(n=a(e)),n||void c.clearRect(0,0,l,l)}}this.declutterTree_&&(u=this.declutterTree_.all().map(function(e){return e.value}));var m,y,g,v,b,_=Object.keys(this.replaysByZIndex_).map(Number);for(_.sort(ra),m=_.length-1;m>=0;--m){var w=_[m].toString();for(g=this.replaysByZIndex_[w],y=gs.length-1;y>=0;--y)if(void 0!==(v=g[d=gs[y]]))if(!o||d!=Do.IMAGE&&d!=Do.TEXT){if(b=v.replayHitDetection(c,h,i,n,f,s))return b}else{var x=o[w];x?x.push(v,h.slice(0)):o[w]=[v,h.slice(0)]}}},t.prototype.getClipCoords=function(e){var t=this.maxExtent_,i=t[0],r=t[1],n=t[2],a=t[3],o=[i,r,i,a,n,a,n,r];return La(o,0,8,2,e,o),o},t.prototype.getReplay=function(e,t){var i=void 0!==e?e.toString():"0",r=this.replaysByZIndex_[i];void 0===r&&(r={},this.replaysByZIndex_[i]=r);var n=r[t];void 0===n&&(n=new(0,Is[t])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),r[t]=n);return n},t.prototype.getReplays=function(){return this.replaysByZIndex_},t.prototype.isEmpty=function(){return Kr(this.replaysByZIndex_)},t.prototype.replay=function(e,t,i,r,n,a,o){var s=Object.keys(this.replaysByZIndex_).map(Number);s.sort(ra),e.save(),this.clip(e,t);var l,h,c,u,d,p,f=a||gs;for(l=0,h=s.length;l<h;++l){var m=s[l].toString();for(d=this.replaysByZIndex_[m],c=0,u=f.length;c<u;++c){var y=f[c];if(p=d[y],void 0!==p)if(!o||y!=Do.IMAGE&&y!=Do.TEXT)p.replay(e,t,i,r,n);else{var g=o[m];g?g.push(p,t.slice(0)):o[m]=[p,t.slice(0)]}}}e.restore()},t}(zo),Es={0:[[!0]]};function Ls(e,t,i){var r,n=Math.floor(e.length/2);if(t>=n)for(r=n;r<t;r++)e[r][i]=!0;else if(t<n)for(r=t+1;r<n;r++)e[r][i]=!0}var Ps=Os,Rs={IDLE:0,LOADING:1,LOADED:2,ERROR:3},js={Point:function(e,t,i,r){var n=i.getImage();if(n){if(n.getImageState()!=Rs.LOADED)return;var a=e.getReplay(i.getZIndex(),Do.IMAGE);a.setImageStyle(n,e.addDeclutter(!1)),a.drawPoint(t,r)}var o=i.getText();if(o){var s=e.getReplay(i.getZIndex(),Do.TEXT);s.setTextStyle(o,e.addDeclutter(!!n)),s.drawText(t,r)}},LineString:function(e,t,i,r){var n=i.getStroke();if(n){var a=e.getReplay(i.getZIndex(),Do.LINE_STRING);a.setFillStrokeStyle(null,n),a.drawLineString(t,r)}var o=i.getText();if(o){var s=e.getReplay(i.getZIndex(),Do.TEXT);s.setTextStyle(o,e.addDeclutter(!1)),s.drawText(t,r)}},Polygon:function(e,t,i,r){var n=i.getFill(),a=i.getStroke();if(n||a){var o=e.getReplay(i.getZIndex(),Do.POLYGON);o.setFillStrokeStyle(n,a),o.drawPolygon(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),Do.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}},MultiPoint:function(e,t,i,r){var n=i.getImage();if(n){if(n.getImageState()!=Rs.LOADED)return;var a=e.getReplay(i.getZIndex(),Do.IMAGE);a.setImageStyle(n,e.addDeclutter(!1)),a.drawMultiPoint(t,r)}var o=i.getText();if(o){var s=e.getReplay(i.getZIndex(),Do.TEXT);s.setTextStyle(o,e.addDeclutter(!!n)),s.drawText(t,r)}},MultiLineString:function(e,t,i,r){var n=i.getStroke();if(n){var a=e.getReplay(i.getZIndex(),Do.LINE_STRING);a.setFillStrokeStyle(null,n),a.drawMultiLineString(t,r)}var o=i.getText();if(o){var s=e.getReplay(i.getZIndex(),Do.TEXT);s.setTextStyle(o,e.addDeclutter(!1)),s.drawText(t,r)}},MultiPolygon:function(e,t,i,r){var n=i.getFill(),a=i.getStroke();if(a||n){var o=e.getReplay(i.getZIndex(),Do.POLYGON);o.setFillStrokeStyle(n,a),o.drawMultiPolygon(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),Do.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}},GeometryCollection:function(e,t,i,r){var n,a,o=t.getGeometriesArray();for(n=0,a=o.length;n<a;++n){var s=js[o[n].getType()];s(e,o[n],i,r)}},Circle:function(e,t,i,r){var n=i.getFill(),a=i.getStroke();if(n||a){var o=e.getReplay(i.getZIndex(),Do.CIRCLE);o.setFillStrokeStyle(n,a),o.drawCircle(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),Do.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}}};function As(e,t,i,r,n,a){var o=!1,s=i.getImage();if(s){var l=s.getImageState();l==Rs.LOADED||l==Rs.ERROR?s.unlistenImageChange(n,a):(l==Rs.IDLE&&s.load(),l=s.getImageState(),s.listenImageChange(n,a),o=!0)}return function(e,t,i,r){var n=i.getGeometryFunction()(t);if(!n)return;var a=n.getSimplifiedGeometry(r);if(i.getRenderer())!function e(t,i,r,n){if(i.getType()==nn.GEOMETRY_COLLECTION){for(var a=i.getGeometries(),o=0,s=a.length;o<s;++o)e(t,a[o],r,n);return}var l=t.getReplay(r.getZIndex(),Do.DEFAULT);l.drawCustom(i,n,r.getRenderer())}(e,a,i,t);else{var o=js[a.getType()];o(e,a,i,t)}}(e,t,i,r),o}var zs=class{constructor(){this.queue=[]}push(e){this.queue.push(e)}remove(e){for(let t=0;t<this.queue.length;t++){const i=this.queue[t];if(i.x===e.x&&i.y===e.y&&i.z===e.z&&i.id===e.id)return void this.queue.splice(t,1)}}has(e){for(let t=0;t<this.queue.length;t++){const i=this.queue[t];if(i.x===e.x&&i.y===e.y&&i.z===e.z&&i.id===e.id)return!0}return!1}},Ds=i(4),Vs=i(7);function Ns(e,t){let i;return e.some(function(e){if(e.id==t)return i=e.source,!0}),i}const Gs=/font-family: ?([^;]*);/,Fs=/("|')/g;let Bs;const qs={},Us=i.n(Vs).a.getNames();function Ws(e){if(e in qs)return qs[e];const t=e.map(function(e){return mb2css(e,1).split(" 1px ")[1].replace(/"/g,"")})[0];if(!function(e){if(!Bs){Bs={};const e=document.styleSheets;for(let t=0,i=e.length;t<i;++t){const i=e[t];try{const e=i.rules||i.cssRules;if(e)for(let t=0,i=e.length;t<i;++t){const i=e[t];if(5==i.type){const e=i.cssText.match(Gs);Bs[e[1].replace(Fs,"")]=!0}}}catch(e){}}}return e in Bs}(t)&&-1!==Us.indexOf(t)){const e="https://fonts.googleapis.com/css?family="+t.replace(/ /g,"+");if(!document.querySelector('link[href="'+e+'"]')){const t=document.createElement("link");t.href=e,t.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(t)}}return e}var Hs=function(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale};Hs.prototype.clone=function(){return new Hs({opacity:this.getOpacity(),scale:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},Hs.prototype.getOpacity=function(){return this.opacity_},Hs.prototype.getRotateWithView=function(){return this.rotateWithView_},Hs.prototype.getRotation=function(){return this.rotation_},Hs.prototype.getScale=function(){return this.scale_},Hs.prototype.getSnapToPixel=function(){return!1},Hs.prototype.getAnchor=function(){return Fr()},Hs.prototype.getImage=function(e){return Fr()},Hs.prototype.getHitDetectionImage=function(e){return Fr()},Hs.prototype.getImageState=function(){return Fr()},Hs.prototype.getImageSize=function(){return Fr()},Hs.prototype.getHitDetectionImageSize=function(){return Fr()},Hs.prototype.getOrigin=function(){return Fr()},Hs.prototype.getSize=function(){return Fr()},Hs.prototype.setOpacity=function(e){this.opacity_=e},Hs.prototype.setRotateWithView=function(e){this.rotateWithView_=e},Hs.prototype.setRotation=function(e){this.rotation_=e},Hs.prototype.setScale=function(e){this.scale_=e},Hs.prototype.setSnapToPixel=function(e){},Hs.prototype.listenImageChange=function(e,t){return Fr()},Hs.prototype.load=function(){Fr()},Hs.prototype.unlistenImageChange=function(e,t){Fr()};var Ys=Hs,Xs=function(e){function t(t){var i=t||{};e.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,atlasManager:i.atlasManager})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){var e=new t({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),atlasManager:this.atlasManager_});return e.setOpacity(this.getOpacity()),e.setScale(this.getScale()),e},t.prototype.setRadius=function(e){this.radius_=e,this.render_(this.atlasManager_)},t}(function(e){function t(t){var i=void 0!==t.rotateWithView&&t.rotateWithView;e.call(this,{opacity:1,rotateWithView:i,rotation:void 0!==t.rotation?t.rotation:0,scale:1}),this.checksums_=null,this.canvas_=null,this.hitDetectionCanvas_=null,this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=void 0!==t.radius?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.anchor_=null,this.size_=null,this.imageSize_=null,this.hitDetectionImageSize_=null,this.atlasManager_=t.atlasManager,this.render_(this.atlasManager_)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){var e=new t({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),atlasManager:this.atlasManager_});return e.setOpacity(this.getOpacity()),e.setScale(this.getScale()),e},t.prototype.getAnchor=function(){return this.anchor_},t.prototype.getAngle=function(){return this.angle_},t.prototype.getFill=function(){return this.fill_},t.prototype.getHitDetectionImage=function(e){return this.hitDetectionCanvas_},t.prototype.getImage=function(e){return this.canvas_},t.prototype.getImageSize=function(){return this.imageSize_},t.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},t.prototype.getImageState=function(){return Rs.LOADED},t.prototype.getOrigin=function(){return this.origin_},t.prototype.getPoints=function(){return this.points_},t.prototype.getRadius=function(){return this.radius_},t.prototype.getRadius2=function(){return this.radius2_},t.prototype.getSize=function(){return this.size_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.listenImageChange=function(e,t){},t.prototype.load=function(){},t.prototype.unlistenImageChange=function(e,t){},t.prototype.render_=function(e){var t,i,r="",n="",a=0,o=null,s=0,l=0;this.stroke_&&(null===(i=this.stroke_.getColor())&&(i=Qo),i=Uo(i),void 0===(l=this.stroke_.getWidth())&&(l=1),o=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset(),Yo||(o=null,s=0),void 0===(n=this.stroke_.getLineJoin())&&(n="round"),void 0===(r=this.stroke_.getLineCap())&&(r="round"),void 0===(a=this.stroke_.getMiterLimit())&&(a=10));var h=2*(this.radius_+l)+1,c={strokeStyle:i,strokeWidth:l,size:h,lineCap:r,lineDash:o,lineDashOffset:s,lineJoin:n,miterLimit:a};if(void 0===e){var u=jo(h,h);this.canvas_=u.canvas,t=h=this.canvas_.width,this.draw_(c,u,0,0),this.createHitDetectionCanvas_(c)}else{h=Math.round(h);var d,p=!this.fill_;p&&(d=this.drawHitDetectionCanvas_.bind(this,c));var f=this.getChecksum(),m=e.add(f,h,h,this.draw_.bind(this,c),d);this.canvas_=m.image,this.origin_=[m.offsetX,m.offsetY],t=m.image.width,p?(this.hitDetectionCanvas_=m.hitImage,this.hitDetectionImageSize_=[m.hitImage.width,m.hitImage.height]):(this.hitDetectionCanvas_=this.canvas_,this.hitDetectionImageSize_=[t,t])}this.anchor_=[h/2,h/2],this.size_=[h,h],this.imageSize_=[t,t]},t.prototype.draw_=function(e,t,i,r){var n,a,o;t.setTransform(1,0,0,1,0,0),t.translate(i,r),t.beginPath();var s=this.points_;if(s===1/0)t.arc(e.size/2,e.size/2,this.radius_,0,2*Math.PI,!0);else{var l=void 0!==this.radius2_?this.radius2_:this.radius_;for(l!==this.radius_&&(s*=2),n=0;n<=s;n++)a=2*n*Math.PI/s-Math.PI/2+this.angle_,o=n%2==0?this.radius_:l,t.lineTo(e.size/2+o*Math.cos(a),e.size/2+o*Math.sin(a))}if(this.fill_){var h=this.fill_.getColor();null===h&&(h=Ko),t.fillStyle=Uo(h),t.fill()}this.stroke_&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke()),t.closePath()},t.prototype.createHitDetectionCanvas_=function(e){if(this.hitDetectionImageSize_=[e.size,e.size],this.fill_)this.hitDetectionCanvas_=this.canvas_;else{var t=jo(e.size,e.size);this.hitDetectionCanvas_=t.canvas,this.drawHitDetectionCanvas_(e,t,0,0)}},t.prototype.drawHitDetectionCanvas_=function(e,t,i,r){t.setTransform(1,0,0,1,0,0),t.translate(i,r),t.beginPath();var n=this.points_;if(n===1/0)t.arc(e.size/2,e.size/2,this.radius_,0,2*Math.PI,!0);else{var a,o,s,l=void 0!==this.radius2_?this.radius2_:this.radius_;for(l!==this.radius_&&(n*=2),a=0;a<=n;a++)s=2*a*Math.PI/n-Math.PI/2+this.angle_,o=a%2==0?this.radius_:l,t.lineTo(e.size/2+o*Math.cos(s),e.size/2+o*Math.sin(s))}t.fillStyle=Go(Ko),t.fill(),this.stroke_&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.stroke()),t.closePath()},t.prototype.getChecksum=function(){var e=this.stroke_?this.stroke_.getChecksum():"-",t=this.fill_?this.fill_.getChecksum():"-";if(!this.checksums_||e!=this.checksums_[1]||t!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.radius2_!=this.checksums_[4]||this.angle_!=this.checksums_[5]||this.points_!=this.checksums_[6]){var i="r"+e+t+(void 0!==this.radius_?this.radius_.toString():"-")+(void 0!==this.radius2_?this.radius2_.toString():"-")+(void 0!==this.angle_?this.angle_.toString():"-")+(void 0!==this.points_?this.points_.toString():"-");this.checksums_=[i,e,t,this.radius_,this.radius2_,this.angle_,this.points_]}return this.checksums_[0]},t}(Ys)),Js=function(e){var t=e||{};this.color_=void 0!==t.color?t.color:null,this.checksum_=void 0};Js.prototype.clone=function(){var e=this.getColor();return new Js({color:Array.isArray(e)?e.slice():e||void 0})},Js.prototype.getColor=function(){return this.color_},Js.prototype.setColor=function(e){this.color_=e,this.checksum_=void 0},Js.prototype.getChecksum=function(){if(void 0===this.checksum_){var e=this.color_;e?Array.isArray(e)||"string"==typeof e?this.checksum_="f"+Go(e):this.checksum_=qr(this.color_):this.checksum_="f-"}return this.checksum_};var $s=Js,Ks=function(e){var t=e||{};this.color_=void 0!==t.color?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=void 0!==t.lineDash?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width,this.checksum_=void 0};Ks.prototype.clone=function(){var e=this.getColor();return new Ks({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},Ks.prototype.getColor=function(){return this.color_},Ks.prototype.getLineCap=function(){return this.lineCap_},Ks.prototype.getLineDash=function(){return this.lineDash_},Ks.prototype.getLineDashOffset=function(){return this.lineDashOffset_},Ks.prototype.getLineJoin=function(){return this.lineJoin_},Ks.prototype.getMiterLimit=function(){return this.miterLimit_},Ks.prototype.getWidth=function(){return this.width_},Ks.prototype.setColor=function(e){this.color_=e,this.checksum_=void 0},Ks.prototype.setLineCap=function(e){this.lineCap_=e,this.checksum_=void 0},Ks.prototype.setLineDash=function(e){this.lineDash_=e,this.checksum_=void 0},Ks.prototype.setLineDashOffset=function(e){this.lineDashOffset_=e,this.checksum_=void 0},Ks.prototype.setLineJoin=function(e){this.lineJoin_=e,this.checksum_=void 0},Ks.prototype.setMiterLimit=function(e){this.miterLimit_=e,this.checksum_=void 0},Ks.prototype.setWidth=function(e){this.width_=e,this.checksum_=void 0},Ks.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_="s",this.color_?"string"==typeof this.color_?this.checksum_+=this.color_:this.checksum_+=qr(this.color_):this.checksum_+="-",this.checksum_+=","+(void 0!==this.lineCap_?this.lineCap_.toString():"-")+","+(this.lineDash_?this.lineDash_.toString():"-")+","+(void 0!==this.lineDashOffset_?this.lineDashOffset_:"-")+","+(void 0!==this.lineJoin_?this.lineJoin_:"-")+","+(void 0!==this.miterLimit_?this.miterLimit_.toString():"-")+","+(void 0!==this.width_?this.width_.toString():"-")),this.checksum_};var Zs=Ks,Qs=function(e){var t=e||{};this.geometry_=null,this.geometryFunction_=el,void 0!==t.geometry&&this.setGeometry(t.geometry),this.fill_=void 0!==t.fill?t.fill:null,this.image_=void 0!==t.image?t.image:null,this.renderer_=void 0!==t.renderer?t.renderer:null,this.stroke_=void 0!==t.stroke?t.stroke:null,this.text_=void 0!==t.text?t.text:null,this.zIndex_=t.zIndex};Qs.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new Qs({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},Qs.prototype.getRenderer=function(){return this.renderer_},Qs.prototype.setRenderer=function(e){this.renderer_=e},Qs.prototype.getGeometry=function(){return this.geometry_},Qs.prototype.getGeometryFunction=function(){return this.geometryFunction_},Qs.prototype.getFill=function(){return this.fill_},Qs.prototype.setFill=function(e){this.fill_=e},Qs.prototype.getImage=function(){return this.image_},Qs.prototype.setImage=function(e){this.image_=e},Qs.prototype.getStroke=function(){return this.stroke_},Qs.prototype.setStroke=function(e){this.stroke_=e},Qs.prototype.getText=function(){return this.text_},Qs.prototype.setText=function(e){this.text_=e},Qs.prototype.getZIndex=function(){return this.zIndex_},Qs.prototype.setGeometry=function(e){"function"==typeof e?this.geometryFunction_=e:"string"==typeof e?this.geometryFunction_=function(t){return t.get(e)}:e?void 0!==e&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=el,this.geometry_=e},Qs.prototype.setZIndex=function(e){this.zIndex_=e};function el(e){return e.getGeometry()}var tl=Qs,il={FRACTION:"fraction",PIXELS:"pixels"},rl=function(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32};function nl(e,t,i){return t+":"+e+":"+(i?Go(i):"null")}rl.prototype.clear=function(){this.cache_={},this.cacheSize_=0},rl.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){var e=0;for(var t in this.cache_){var i=this.cache_[t];0!=(3&e++)||i.hasListener()||(delete this.cache_[t],--this.cacheSize_)}}},rl.prototype.get=function(e,t,i){var r=nl(e,t,i);return r in this.cache_?this.cache_[r]:null},rl.prototype.set=function(e,t,i,r){var n=nl(e,t,i);this.cache_[n]=r,++this.cacheSize_},rl.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()};var al=new rl,ol=function(e){function t(t,i,r,n,a,o){e.call(this),this.hitDetectionImage_=null,this.image_=t||new Image,null!==n&&(this.image_.crossOrigin=n),this.canvas_=o?document.createElement("canvas"):null,this.color_=o,this.imageListenerKeys_=null,this.imageState_=a,this.size_=r,this.src_=i,this.tainted_}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Rs.LOADED){this.tainted_=!1;var e=jo(1,1);try{e.drawImage(this.image_,0,0),e.getImageData(0,0,1,1)}catch(e){this.tainted_=!0}}return!0===this.tainted_},t.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(xa)},t.prototype.handleImageError_=function(){this.imageState_=Rs.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},t.prototype.handleImageLoad_=function(){this.imageState_=Rs.LOADED,this.size_&&(this.image_.width=this.size_[0],this.image_.height=this.size_[1]),this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.replaceColor_(),this.dispatchChangeEvent_()},t.prototype.getImage=function(e){return this.canvas_?this.canvas_:this.image_},t.prototype.getImageState=function(){return this.imageState_},t.prototype.getHitDetectionImage=function(e){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],i=this.size_[1],r=jo(t,i);r.fillRect(0,0,t,i),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},t.prototype.getSize=function(){return this.size_},t.prototype.getSrc=function(){return this.src_},t.prototype.load=function(){if(this.imageState_==Rs.IDLE){this.imageState_=Rs.LOADING,this.imageListenerKeys_=[pa(this.image_,Sa,this.handleImageError_,this),pa(this.image_,Ma,this.handleImageLoad_,this)];try{this.image_.src=this.src_}catch(e){this.handleImageError_()}}},t.prototype.replaceColor_=function(){if(this.color_&&!this.isTainted_()){this.canvas_.width=this.image_.width,this.canvas_.height=this.image_.height;var e=this.canvas_.getContext("2d");e.drawImage(this.image_,0,0);for(var t=e.getImageData(0,0,this.image_.width,this.image_.height),i=t.data,r=this.color_[0]/255,n=this.color_[1]/255,a=this.color_[2]/255,o=0,s=i.length;o<s;o+=4)i[o]*=r,i[o+1]*=n,i[o+2]*=a;e.putImageData(t,0,0)}},t.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(ma),this.imageListenerKeys_=null},t}(wa);var sl={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},ll=function(e){function t(t){var i=t||{},r=void 0!==i.opacity?i.opacity:1,n=void 0!==i.rotation?i.rotation:0,a=void 0!==i.scale?i.scale:1,o=void 0!==i.rotateWithView&&i.rotateWithView;e.call(this,{opacity:r,rotation:n,scale:a,rotateWithView:o}),this.anchor_=void 0!==i.anchor?i.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:sl.TOP_LEFT,this.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:il.FRACTION,this.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:il.FRACTION,this.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null;var s=void 0!==i.img?i.img:null,l=void 0!==i.imgSize?i.imgSize:null,h=i.src;Hr(!(void 0!==h&&s),4),Hr(!s||s&&l,5),void 0!==h&&0!==h.length||!s||(h=s.src||qr(s)),Hr(void 0!==h&&h.length>0,6);var c=void 0!==i.src?Rs.IDLE:Rs.LOADED;this.color_=void 0!==i.color?function(e){return Array.isArray(e)?e:Fo(e)}(i.color):null,this.iconImage_=function(e,t,i,r,n,a){var o=al.get(t,r,a);return o||(o=new ol(e,t,i,r,n,a),al.set(t,r,a,o)),o}(s,h,l,this.crossOrigin_,c,this.color_),this.offset_=void 0!==i.offset?i.offset:[0,0],this.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:sl.TOP_LEFT,this.origin_=null,this.size_=void 0!==i.size?i.size:null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},t.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var e=this.anchor_,t=this.getSize();if(this.anchorXUnits_==il.FRACTION||this.anchorYUnits_==il.FRACTION){if(!t)return null;e=this.anchor_.slice(),this.anchorXUnits_==il.FRACTION&&(e[0]*=t[0]),this.anchorYUnits_==il.FRACTION&&(e[1]*=t[1])}if(this.anchorOrigin_!=sl.TOP_LEFT){if(!t)return null;e===this.anchor_&&(e=this.anchor_.slice()),this.anchorOrigin_!=sl.TOP_RIGHT&&this.anchorOrigin_!=sl.BOTTOM_RIGHT||(e[0]=-e[0]+t[0]),this.anchorOrigin_!=sl.BOTTOM_LEFT&&this.anchorOrigin_!=sl.BOTTOM_RIGHT||(e[1]=-e[1]+t[1])}return this.normalizedAnchor_=e,this.normalizedAnchor_},t.prototype.setAnchor=function(e){this.anchor_=e,this.normalizedAnchor_=null},t.prototype.getColor=function(){return this.color_},t.prototype.getImage=function(e){return this.iconImage_.getImage(e)},t.prototype.getImageSize=function(){return this.iconImage_.getSize()},t.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},t.prototype.getImageState=function(){return this.iconImage_.getImageState()},t.prototype.getHitDetectionImage=function(e){return this.iconImage_.getHitDetectionImage(e)},t.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var e=this.offset_;if(this.offsetOrigin_!=sl.TOP_LEFT){var t=this.getSize(),i=this.iconImage_.getSize();if(!t||!i)return null;e=e.slice(),this.offsetOrigin_!=sl.TOP_RIGHT&&this.offsetOrigin_!=sl.BOTTOM_RIGHT||(e[0]=i[0]-t[0]-e[0]),this.offsetOrigin_!=sl.BOTTOM_LEFT&&this.offsetOrigin_!=sl.BOTTOM_RIGHT||(e[1]=i[1]-t[1]-e[1])}return this.origin_=e,this.origin_},t.prototype.getSrc=function(){return this.iconImage_.getSrc()},t.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},t.prototype.listenImageChange=function(e,t){return da(this.iconImage_,xa,e,t)},t.prototype.load=function(){this.iconImage_.load()},t.prototype.unlistenImageChange=function(e,t){fa(this.iconImage_,xa,e,t)},t}(Ys),hl=function(e){var t=e||{};this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.text_=t.text,this.textAlign_=t.textAlign,this.textBaseline_=t.textBaseline,this.fill_=void 0!==t.fill?t.fill:new $s({color:"#333"}),this.maxAngle_=void 0!==t.maxAngle?t.maxAngle:Math.PI/4,this.placement_=void 0!==t.placement?t.placement:ks,this.overflow_=!!t.overflow,this.stroke_=void 0!==t.stroke?t.stroke:null,this.offsetX_=void 0!==t.offsetX?t.offsetX:0,this.offsetY_=void 0!==t.offsetY?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=void 0===t.padding?null:t.padding};hl.prototype.clone=function(){return new hl({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:this.getScale(),text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0})},hl.prototype.getOverflow=function(){return this.overflow_},hl.prototype.getFont=function(){return this.font_},hl.prototype.getMaxAngle=function(){return this.maxAngle_},hl.prototype.getPlacement=function(){return this.placement_},hl.prototype.getOffsetX=function(){return this.offsetX_},hl.prototype.getOffsetY=function(){return this.offsetY_},hl.prototype.getFill=function(){return this.fill_},hl.prototype.getRotateWithView=function(){return this.rotateWithView_},hl.prototype.getRotation=function(){return this.rotation_},hl.prototype.getScale=function(){return this.scale_},hl.prototype.getStroke=function(){return this.stroke_},hl.prototype.getText=function(){return this.text_},hl.prototype.getTextAlign=function(){return this.textAlign_},hl.prototype.getTextBaseline=function(){return this.textBaseline_},hl.prototype.getBackgroundFill=function(){return this.backgroundFill_},hl.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},hl.prototype.getPadding=function(){return this.padding_},hl.prototype.setOverflow=function(e){this.overflow_=e},hl.prototype.setFont=function(e){this.font_=e},hl.prototype.setMaxAngle=function(e){this.maxAngle_=e},hl.prototype.setOffsetX=function(e){this.offsetX_=e},hl.prototype.setOffsetY=function(e){this.offsetY_=e},hl.prototype.setPlacement=function(e){this.placement_=e},hl.prototype.setFill=function(e){this.fill_=e},hl.prototype.setRotation=function(e){this.rotation_=e},hl.prototype.setScale=function(e){this.scale_=e},hl.prototype.setStroke=function(e){this.stroke_=e},hl.prototype.setText=function(e){this.text_=e},hl.prototype.setTextAlign=function(e){this.textAlign_=e},hl.prototype.setTextBaseline=function(e){this.textBaseline_=e},hl.prototype.setBackgroundFill=function(e){this.backgroundFill_=e},hl.prototype.setBackgroundStroke=function(e){this.backgroundStroke_=e},hl.prototype.setPadding=function(e){this.padding_=e};var cl=hl,ul=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function dl(e,t){const i={};for(const t in e)"ref"!==t&&(i[t]=e[t]);return ul.forEach(e=>{e in t&&(i[e]=t[e])}),i}var pl=function(e){e=e.slice();const t=Object.create(null);for(let i=0;i<e.length;i++)t[e[i].id]=e[i];for(let i=0;i<e.length;i++)"ref"in e[i]&&(e[i]=dl(e[i],t[e[i].ref]));return e};var fl={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},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.",example:{anchor:"viewport",color:"white",intensity:.4}},sources:{required:!0,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).",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}},layers:{required:!0,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"}}]}},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_geojson","source_video","source_image"],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://<mapid>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},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."},"*":{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://<mapid>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},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."},"*":{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://<mapid>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},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"},"*":{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."},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)."},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."}},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:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},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",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.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",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",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",macos:"0.7.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",macos:"0.1.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`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},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:"A 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."},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_hillshade","layout_background"],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",macos:"0.1.0"}},"property-type":"constant"}},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":{js:"1.2.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",macos:"0.1.0"}},"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":{js:"1.2.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",macos:"0.1.0"}},"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",macos:"0.7.0"}},"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",macos:"0.5.0"}},"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",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"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",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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":{js:"1.2.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",macos:"0.1.0"},"data-driven styling":{}},"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",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},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 a higher sort key will appear above features with a lower sort key when they overlap. Features with a lower sort key will have priority over other features when doing placement.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"If `symbol-sort-key` is set, sort based on that. Otherwise sort symbols by their y-position relative to the viewport."},"viewport-y":{doc:"Symbols will be sorted by their y-position relative to the viewport."},source:{doc:"Symbols will be rendered in the same order as the source data with no sorting applied."}},default:"auto",doc:"Controls the order in which overlapping symbols in the same layer are rendered","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.2.1"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",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",macos:"0.2.1"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"string",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",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.6.0"},"data-driven styling":{}},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",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"data-driven styling":{}},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",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"data-driven styling":{}},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.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.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",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.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 doesn't support the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.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 render 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` instead of the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"Not yet supported",android:"Not yet supported",ios:"Not yet supported",macos:"Not yet supported"}},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",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,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",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"},{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},"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",macos:"0.1.0"},"data-driven styling":{}},"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",macos:"0.7.0"},"data-driven styling":{}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},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:22,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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.0"}}},match:{doc:'Selects the output whose label value matches the input value, or the fallback value if no match is found. The input can be any expression (e.g. `["get", "building_type"]`). Each label must be either:\n * a single literal value; or\n * an array of literal values, whose values must be all strings or all numbers (e.g. `[100, 101]` or `["c", "b"]`). The input matches if any of the values in the array matches, similar to the deprecated `"in"` operator.\n\nEach label must be unique. If 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",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.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 input 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",macos:"0.7.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<number>`, 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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.9.0"}}},format:{doc:"Returns `formatted` text containing annotations for use in mixed-format `text-field` entries. If set, the `text-font` argument overrides the font specified by the root layout properties. If set, the `font-scale` argument specifies a scaling factor relative to the `text-size` specified in the root layout properties.",group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.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 `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"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a 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, 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. 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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.0"}}},length:{doc:"Gets 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",macos:"0.7.0"}}},properties:{doc:'Gets 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",macos:"0.7.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. 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"}}},"geometry-type":{doc:"Gets the feature's geometry type: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Gets 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",macos:"0.7.0"}}},zoom:{doc:'Gets 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:"Zoom","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"heatmap-density":{doc:"Gets 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",macos:"0.7.0"}}},"line-progress":{doc:"Gets 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",macos:"0.12.0"}}},accumulated:{doc:"Gets 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"}}},"+":{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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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"},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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.9.0"}}}}},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",macos:"0.5.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",macos:"0.5.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",macos:"0.5.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",macos:"0.5.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"string",transition:!0,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",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"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",macos:"0.5.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",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.5.0"},"data-driven styling":{}},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",macos:"0.5.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"string",transition:!0,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",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-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",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"string",transition:!0,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",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},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",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.2.1"},"data-driven styling":{}},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",macos:"0.6.0"},"data-driven styling":{}},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",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.7.0"},"data-driven styling":{}},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",macos:"0.7.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",macos:"0.7.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"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",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.9.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"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`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},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",macos:"0.7.0"},"data-driven styling":{}},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",macos:"0.7.0"},"data-driven styling":{}},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",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"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",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"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",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"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",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"string",transition:!0,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",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"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",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"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."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It 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."}}},ml=i(3),yl={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},gl=" ",vl=/(italic|oblique)$/i,bl={};function _l(e,t){var i=bl[e];if(!i){Array.isArray(e)||(e=[e]);for(var r="normal",n="normal",a=[],o=0,s=e.length;o<s;++o){var l=e[o].split(" "),h=l[l.length-1].toLowerCase();for(var c in"normal"==h||"italic"==h||"oblique"==h?(n=h,l.pop(),h=l[l.length-1].toLowerCase()):vl.test(h)&&(h=h.replace(vl,""),n=l[l.length-1].replace(h,"")),yl)if(h==c||h==c.replace("-","")||h==c.replace("-",gl)){r=yl[c],l.pop();break}"number"==typeof h&&(r=h);var u=l.join(gl).replace("Klokantech Noto Sans","Noto Sans");-1!==u.indexOf(gl)&&(u='"'+u+'"'),a.push(u)}i=bl[e]=[n,r,a]}return i[0]+gl+i[1]+gl+t+"px"+gl+i[2]}function wl(e){return e*Math.PI/180}const xl=ml.d.isFunction,Cl=ml.d.convertFunction,Sl=ml.b.isExpression,Ml=ml.b.createPropertyExpression,kl={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Tl=function(e,t){const i=Ml(e,t);if("error"===i.result)throw new Error(i.value.map(e=>`${e.key}: ${e.message}`).join(", "));return i.value},Il={},Ol={zoom:0},El={};function Ll(e,t,i,r,n){const a=e.id;El[a]||(El[a]={});const o=El[a];if(!o[i]){let r=(e[t]||Il)[i];const n=fl[`${t}_${e.type}`][i];void 0===r&&(r=n.default);let a=Sl(r);if(!a&&xl(r)&&(r=Cl(r,n),a=!0),a){const e=Tl(r,n);o[i]=e.evaluate.bind(e)}else"color"==n.type&&(r=ml.a.parse(r)),o[i]=function(){return r}}return Ol.zoom=r,o[i](Ol,n)}const Pl={};function Rl(e,t,i,r){return e in Pl||(Pl[e]=Object(ml.c)(t).filter),Ol.zoom=r,Pl[e](Ol,i)}const jl={};function Al(e,t){if(e&&void 0!==t){let i=jl[e];i||(jl[e]=i={color:e.toArray(),opacity:e.a}),(e=i.color)[3]=i.opacity*t,0===e[3]&&(e=void 0)}return e}const zl=/^([^]*)\{(.*)\}([^]*)$/;function Dl(e,t){let i;do{if(i=e.match(zl)){const r=t[i[2]]||"";e=i[1]+r+i[3]}}while(i);return e}var Vl=function(e,t,i,r,n,a){if(!i){i=[];for(let e=78271.51696402048;i.length<21;e/=2)i.push(e)}if("string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");let o,s;if(n){const e=new Image;e.crossOrigin="anonymous",e.onload=function(){o=e,s=[e.width,e.height],e.onload=null},e.src=n}const l=document.createElement("CANVAS").getContext("2d"),h={};function c(e,t,i){const r=i+","+t+","+e;let n=h[r];if(!n){l.font=t;const a=l.measureText("M").width*i,o=e.split(" ");let s="";const c=[];for(let e=0,t=o.length;e<t;++e){const t=o[e];l.measureText(s+t).width<=a?s+=(s?" ":"")+t:(s&&c.push(s),s=t)}s&&c.push(s),h[r]=n=c.join("\n")}return n}const u=pl(e.layers),d={},p=[];let f;for(let i=0,r=u.length;i<r;++i){const r=u[i],n=r.id;if("string"==typeof t&&r.source==t||"object"==typeof t&&t.indexOf(r.source)>=0){const t=r["source-layer"];if(!f){f=r.source;const t=e.sources[f];if(!t)throw new Error(`Source "${f}" is not defined`);const i=t.type;if("vector"!==i&&"geojson"!==i)throw new Error(`Source "${f}" is not of type "vector" or "geojson", but "${i}"`)}let a=d[t];a||(a=d[t]=[]),a.push({layer:r,index:i}),p.push(n)}delete El[n],delete Pl[n]}const m=new Zs,y=new $s,g={},v={},b=[];return function(e,t){const n=e.getProperties(),a=d[n.layer];if(!a)return[];let l=i.indexOf(t);-1==l&&(l=function(e,t){let i=0;const r=t.length;for(;i<r;++i)if(t[i]<e&&i+1<r){const r=t[i]/t[i+1];return i+Math.log(t[i]/e)/Math.log(r)}return r-1}(t,i));const h=kl[e.getGeometry().getType()],u={properties:n,type:h};let p=-1;for(let i=0,d=a.length;i<d;++i){const d=a[i],f=d.layer,_=f.id,w=f.layout||Il,x=f.paint||Il;if(!("none"===w.visibility||"minzoom"in f&&l<f.minzoom||"maxzoom"in f&&l>=f.maxzoom)){const i=f.filter;if(!i||Rl(_,i,u,l)){let i,a,C,S,M,k;const T=d.index;if(3==h&&"fill"==f.type)if(a=Ll(f,"paint","fill-opacity",l,u),"fill-pattern"in x){const e=Ll(f,"paint","fill-pattern",l,u);if(e){const t=Dl(e,n);if(o&&r&&r[t]){(k=b[++p])&&k.getFill()&&!k.getStroke()&&!k.getText()||(k=b[p]=new tl({fill:new $s})),C=k.getFill(),k.setZIndex(T);const e=t+"."+a;let i=v[e];if(!i){const n=r[t],s=document.createElement("canvas");s.width=n.width,s.height=n.height;const l=s.getContext("2d");l.globalAlpha=a,l.drawImage(o,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i=l.createPattern(s,"repeat"),v[e]=i}C.setColor(i)}}}else(i=Al(Ll(f,"paint","fill-color",l,u),a))&&((k=b[++p])&&k.getFill()&&!k.getStroke()&&!k.getText()||(k=b[p]=new tl({fill:new $s})),(C=k.getFill()).setColor(i),k.setZIndex(T)),"fill-outline-color"in x&&(M=Al(Ll(f,"paint","fill-outline-color",l,u),a)),M&&((k=b[++p])&&k.getStroke()&&!k.getFill()&&!k.getText()||(k=b[p]=new tl({stroke:new Zs})),(S=k.getStroke()).setLineCap(fl.layout_line["line-cap"]),S.setLineJoin(fl.layout_line["line-join"]),S.setMiterLimit(fl.layout_line["line-miter-limit"]),S.setColor(M),S.setWidth(1),S.setLineDash(null),k.setZIndex(T));if(1!=h&&"line"==f.type){i=!("line-pattern"in x)&&"line-color"in x?Al(Ll(f,"paint","line-color",l,u),Ll(f,"paint","line-opacity",l,u)):void 0;const e=Ll(f,"paint","line-width",l,u);i&&e>0&&((k=b[++p])&&k.getStroke()&&!k.getFill()&&!k.getText()||(k=b[p]=new tl({stroke:new Zs})),(S=k.getStroke()).setLineCap(Ll(f,"layout","line-cap",l,u)),S.setLineJoin(Ll(f,"layout","line-join",l,u)),S.setMiterLimit(Ll(f,"layout","line-miter-limit",l,u)),S.setColor(i),S.setWidth(e),S.setLineDash(x["line-dasharray"]?Ll(f,"paint","line-dasharray",l,u).map(function(t){return t*e}):null),k.setZIndex(T))}let I,O,E,L,P=!1,R=null,j=0;if((1==h||2==h)&&"icon-image"in w){const a=Ll(f,"layout","icon-image",l,u);if(a){I=Dl(a,n);let c=void 0;if(o&&r&&r[I]){const n=Ll(f,"layout","icon-rotation-alignment",l,u);if(2==h){const i=e.getGeometry();if(i.getFlatMidpoint){const e=i.getExtent();if(Math.sqrt(Math.max(Math.pow((e[2]-e[0])/t,2),Math.pow((e[3]-e[1])/t,2)))>150){const e=i.getFlatMidpoint();if(c=new ho(e),"line"===Ll(f,"layout","symbol-placement",l,u)&&"map"===n){const t=i.getStride(),r=i.getFlatCoordinates();for(let i=0,n=r.length-t;i<n;i+=t){const n=r[i],a=r[i+1],o=r[i+t],s=r[i+t+1],l=Math.min(n,o),h=Math.min(a,s),c=Math.max(n,o),u=Math.max(a,s);if(e[0]>=l&&e[0]<=c&&e[1]>=h&&e[1]<=u){j=Math.atan2(a-s,o-n);break}}}}}}if(2!==h||c){(k=b[++p])&&k.getImage()&&!k.getFill()&&!k.getStroke()||(k=b[p]=new tl),k.setGeometry(c);const e=Ll(f,"layout","icon-size",l,u),t=void 0!==x["icon-color"]?Ll(f,"paint","icon-color",l,u):null;let a=I+"."+e;if(null!==t&&(a+="."+t),!(O=g[a])){const l=r[I];if(null!==t){i=Al(t,1);const r=document.createElement("canvas");r.width=l.width,r.height=l.height;const n=r.getContext("2d");n.drawImage(o,l.x,l.y,l.width,l.height,0,0,l.width,l.height);const s=n.getImageData(0,0,r.width,r.height);for(let e=0,t=s.data.length;e<t;e+=4)s.data[e]=i[0],s.data[e+1]=i[1],s.data[e+2]=i[2];n.putImageData(s,0,0),O=g[a]=new ll({img:r,imgSize:[r.width,r.height],scale:e/l.pixelRatio})}else O=g[a]=new ll({img:o,imgSize:s,size:[l.width,l.height],offset:[l.x,l.y],rotateWithView:"map"===n,scale:e/l.pixelRatio})}O.setRotation(j+wl(Ll(f,"layout","icon-rotate",l,u))),O.setOpacity(Ll(f,"paint","icon-opacity",l,u)),k.setImage(O),R=k.getText(),k.setText(void 0),k.setZIndex(99999-T),P=!0,E=!1}else E=!0}}}if(1==h&&"circle-radius"in x){(k=b[++p])&&k.getImage()&&!k.getFill()&&!k.getStroke()||(k=b[p]=new tl);const e=Ll(f,"paint","circle-radius",l,u),t=Ll(f,"paint","circle-stroke-color",l,u),i=Ll(f,"paint","circle-color",l,u),r=Ll(f,"paint","circle-opacity",l,u),n=Ll(f,"paint","circle-stroke-opacity",l,u),a=Ll(f,"paint","circle-stroke-width",l,u);(O=g[e+"."+t+"."+i+"."+r+"."+a])||(O=new Xs({radius:e,stroke:0===a?void 0:new Zs({width:a,color:Al(t,n)}),fill:new $s({color:Al(i,r)})})),k.setImage(O),R=k.getText(),k.setText(void 0),k.setGeometry(void 0),k.setZIndex(99999-T),P=!0}if("text-field"in w&&(L=Dl(Ll(f,"layout","text-field",l,u).toString(),n)),L&&!E){P||((k=b[++p])&&k.getText()&&!k.getFill()&&!k.getStroke()||(k=b[p]=new tl),k.setImage(void 0),k.setGeometry(void 0),k.layerId=_),k.getText()||k.setText(R||new cl),R=k.getText();const e=Ll(f,"layout","text-size",l,u),t=_l(Ll(f,"layout","text-font",l,u),e),i=w["text-transform"];"uppercase"==i?L=L.toUpperCase():"lowercase"==i&&(L=L.toLowerCase());const r=2==h?L:c(L,t,Ll(f,"layout","text-max-width",l,u));R.setText(r),R.setFont(t),R.setRotation(wl(Ll(f,"layout","text-rotate",l,u)));const n=Ll(f,"layout","text-anchor",l,u),o=P||1==h?"point":Ll(f,"layout","symbol-placement",l,u);if(R.setPlacement(o),"point"==o){let e="center";-1!==n.indexOf("left")?e="left":-1!==n.indexOf("right")&&(e="right"),R.setTextAlign(e)}else R.setTextAlign();let s="middle";0==n.indexOf("bottom")?s="bottom":0==n.indexOf("top")&&(s="top"),R.setTextBaseline(s);const d=Ll(f,"layout","text-offset",l,u);R.setOffsetX(d[0]*e),R.setOffsetY(d[1]*e),a=Ll(f,"paint","text-opacity",l,u),y.setColor(Al(Ll(f,"paint","text-color",l,u),a)),R.setFill(y);const g=Al(Ll(f,"paint","text-halo-color",l,u),a);g?(m.setColor(g),m.setWidth(Ll(f,"paint","text-halo-width",l,u)),R.setStroke(m)):R.setStroke(void 0),k.setZIndex(99999-T)}}}}return p>-1?(b.length=p+1,b):[]}};class Nl{constructor(e){this.options=Object(n.defaultValue)(e,{}),this.style=Object(n.defaultValue)(e.style,void 0),this.show=Object(n.defaultValue)(e.show,!0),this.defaultAlpha=Object(n.defaultValue)(e.defaultAlpha,1),this.tilingScheme=Object(n.defaultValue)(e.tilingScheme,new Cesium.WebMercatorTilingScheme),this.tileWidth=Object(n.defaultValue)(e.tileWidth,512),this.tileHeight=Object(n.defaultValue)(e.tileHeight,512),this.tokenKey=Object(n.defaultValue)(e.tokenKey,"token"),this.tokenValue=Object(n.defaultValue)(e.tokenValue,void 0),this.readyPromise=Object(n.defaultValue)(e.readyPromise,new Promise((e,t)=>{e()})),this.scene=Object(n.defaultValue)(e.scene,void 0),this.rectangle=Object(n.defaultValue)(e.rectangle,this.tilingScheme.rectangle),this.mvtParser=new Ro,this.pixelRatio=Object(n.defaultValue)(e.pixelRatio,1),this.maximumLevel=Object(n.defaultValue)(e.maximumLevel,20),this.minimumLevel=Object(n.defaultValue)(e.minimumLevel,0),this.isStretchImage=Object(n.defaultValue)(e.isStretchImage,!1),this.transform=Object(n.defaultValue)(e.transform,[.125,0,0,.125,0,0]),this.sublayerLabelingInfos=Object(n.defaultValue)(e.sublayerLabelingInfos,{}),this.labelsRenderMode=Object(n.defaultValue)(e.labelsRenderMode,"on-screen"),this._resolutions=[78271.51696402048,39135.75848201024,19567.87924100512,9783.93962050256,4891.96981025128,2445.98490512564,1222.99245256282,611.49622628141,305.748113140705,152.8740565703525,76.43702828517625,38.21851414258813,19.109257071294063,9.554628535647032,4.777314267823516,2.388657133911758,1.194328566955879,.5971642834779395,.29858214173896974,.14929107086948487,.07464553543474244],this._replays=["Default","Image","Polygon","LineString","Text"],this._tileQueue=new Cesium.TileReplacementQueue,this._tileSends=new zs,this._cacheSize=300,this._labelsNoteStyle=new n.LabelClass({renderMode:Nl.getRenderMode(this.sublayerLabelingInfos)}),this._dynamicLabelLayer=new pr({scene:this.scene,labelingInfo:[this._labelsNoteStyle]}),this._url=void 0,this._olVectorStyle=void 0,this._setOpenLayerVectorStyle(),this._initEvents()}}Object.defineProperties(Nl.prototype,{ready:{get:()=>!0},hasAlphaChannel:{get:()=>!0}}),Nl.fromUrl=async function(e,t){const i=new n.IGSVectorTileLayer({url:e}),r=await i.load(),a=Bl.initializeOptions(r);return new Nl({...a,...t})},Nl.getRenderMode=function(e){let t="canvas";if(e){const i=Object.keys(e);for(let r=0;r<i.length;r++){const n=e[i[r]];if(Array.isArray(n)&&n.length>0){t=n[0].renderMode||"canvas";break}}}return t},Nl.prototype.requestImage=function(e,t,i){if(!this._tileSends.has({x:e,y:t,z:i,id:this.options.threadId}))return this._tileSends.push({x:e,y:t,z:i,id:this.options.threadId}),this.drawTile(e,t,i);{const r=this._findTileInQueue(e,t,i,this._tileQueue);if(r)return this._tileQueue.markTileRendered(r),r.isaddedLabels||this._addDynamicLabel(r,this._dynamicLabelLayer),new Promise((e,t)=>{e(r)});this._tileSends.remove(e,t,i)}},Nl.prototype.drawTile=function(e,t,i){const r=this;let n=this._url;n=n.replace("{x}",e).replace("{y}",t).replace("{z}",i);let a={xMvt:e,yMvt:t,zMvt:i};if(this._maximumLevel&&i>this._maximumLevel)return this._tileQueue.markTileRendered(a),null;let o=i;Cesium.Resource.createIfNeeded(n);return new Promise((s,l)=>{fetch(n).then(e=>e.arrayBuffer()).then(function(n){try{(a=document.createElement("canvas")).width=512,a.height=512,a.xMvt=e,a.yMvt=t,a.zMvt=o;const h=a.getContext("2d"),c=r.mvtParser.readFeatures(n),u=r._olVectorStyle,d=[0,0,4096,4096];let p=new Ps(0,d,8,!0,512);const f=r.tilingScheme.tileXYToRectangle(e,t,i);if(!f)return null;const m=Cesium.Rectangle.northwest(f),y=Cesium.Rectangle.southeast(f);a.isaddedLabels=!0;for(let n=0;n<c.length;n++){const o=c[n],s=u(o,r._resolutions[i]);let l=[],h=[];"on-screen"===r.labelsRenderMode?(l=s.filter(e=>!e.text_),h=s.filter(e=>e.text_)):l=s,h.length>0&&requestAnimationFrame(()=>{const n=r._renderLabels(a,o,h,e,t,i,d,m,y),s=r._dynamicLabelLayer.addLabels(n);a.cacheLabels||(a.cacheLabels=[]),s.forEach(e=>{a.cacheLabels.push(e)}),a.isaddedLabels&&r._dynamicLabelLayer.addLabels(s)});for(let e=0;e<l.length;e++)As(p,o,l[e],16)}p.finish(),p.replay(h,r.transform,0,{},r._replays),r._tileQueue.count>r._cacheSize&&r._trimTiles(r._tileQueue,r._dynamicLabelLayer,r._cacheSize/2),p=null,s(a)}catch(e){console.log("err: ",e),l()}r._tileQueue.markTileRendered(a)})})},Nl.prototype._initEvents=function(){this.scene&&"on-screen"===this.labelsRenderMode&&(this._changeTileHandler=(()=>{let e=this._tileQueue.tail,t=this._tileQueue.count;for(;e&&t>60;)t--,e.cacheLabels&&this._removeDynamicLabel(e,this._dynamicLabelLayer),e=e.replacementPrevious}),this.scene.postRender.addEventListener(this._changeTileHandler))},Nl.prototype._removeEvents=function(){this.scene&&this._changeTileHandler&&this.scene.postRender.removeEventListener(this._changeTileHandler)},Nl.prototype._renderLabels=function(e,t,i,r,a,o,s,l,h){if(!i||!e||Array.isArray(i)&&0===i.length)return[];if(!t||!t.properties_)return[];const c=t.properties_;let u=[];return i.forEach(e=>{const i=e.getText(),r=this.sublayerLabelingInfos[e.layerId]||[];let a=Object(Ds.a)(this._labelsNoteStyle,i,r.length>0?r[0]:null,c);if(t.flatCoordinates_&&Array.isArray(t.flatCoordinates_)&&2===t.flatCoordinates_.length&&a.symbol.text){const e=t.flatCoordinates_,i=s[2],r=s[3],o=(Cesium.Math.toDegrees(h.longitude)-Cesium.Math.toDegrees(l.longitude))*e[0]/i+Cesium.Math.toDegrees(l.longitude),c=(Cesium.Math.toDegrees(h.latitude)-Cesium.Math.toDegrees(l.latitude))*e[1]/r+Cesium.Math.toDegrees(l.latitude);if(e[0]>i||e[1]>r)return;const d=new n.Point({coordinates:[o,c]}),p=new n.Feature({geometry:d});(this._dynamicLabelLayer.createLabels([p],a)||[]).forEach(e=>{u.push(e)})}}),u},Nl.prototype._findTileInQueue=function(e,t,i,r){let n=r.head;for(;n&&(n.xMvt!==e||n.yMvt!==t||n.zMvt!==i);)n=n.replacementNext;return n},Nl.prototype._trimTiles=function(e,t,i){let r=e.tail;const n=this;for(;e.count>i&&Cesium.defined(r);){const i=r.replacementPrevious;n._removeTile(e,r),n._removeDynamicLabel(r,t),r=null,r=i}},Nl.prototype._removeTile=function(e,t){const i=t.replacementPrevious,r=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=r),t===e.head?e.head=r:i.replacementNext=r,t===e.tail?e.tail=i:r.replacementPrevious=i,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count},Nl.prototype._removeDynamicLabel=function(e,t){e&&t&&e.cacheLabels&&Array.isArray(e.cacheLabels)&&0!==e.cacheLabels.length&&(t.removeLabels(e.cacheLabels),e.isaddedLabels=!1)},Nl.prototype._addDynamicLabel=function(e,t){e&&t&&e.cacheLabels&&Array.isArray(e.cacheLabels)&&0!==e.cacheLabels.length&&(e.cacheLabels=t.addLabels(e.cacheLabels),e.isaddedLabels=!0)},Nl.prototype._setOpenLayerVectorStyle=function(){if(this.style){const e=function(e){const t=e.layers;let i,r,n,a,o,s=[];for(let l=0,h=t.length;l<h;++l)"background"==(i=t[l]).type||((a=i.source||Ns(t,i.ref))!=n&&(s.length&&(s=[]),o=(r=e.sources[a]).url,"vector"==r.type||"raster"==r.type||r.type,n=a),s.push(i.id));return s}(this.style),t=function(e){const t=e.sources;let i=[];for(const e in t)if(t.hasOwnProperty(e)){const r=t[e];r.type&&"vector"==r.type&&r.tiles&&r.tiles.length>0&&i.push(r)}return i}(this.style),i=function(e){let t=e.sprite;return t.indexOf("png")>0?t:t+=".png"}(this.style),r={vectortilejson:this.style,layers:e,spritedata:this.style.spritedata,spritepng:i,fonts:Ws,sources:t};this._url=t[0].tiles[0],this.tokenKey&&this.tokenValue&&(this._url+=`&${this.tokenKey}=${this.tokenValue}`),this._olVectorStyle=Vl(r.vectortilejson,Object.keys(r.vectortilejson.sources),null,r.spritedata,r.spritepng,r.fonts)}},Nl.prototype.destroy=function(){this._removeEvents(),this._dynamicLabelLayer&&(this._dynamicLabelLayer.destroyed(),this._dynamicLabelLayer=null)};var Gl=Nl;class Fl{}Fl.addVectorTileLayer=function(e){const{layer:t,innerView:i}=e,r=$l(t.spatialReference,t.extent,t.tileInfo),[a,o]=n.TileInfoUtil.getLevelRangeByTileInfo(t.tileInfo),s=Zl(t,r.rectangle);s.spatialReference=new n.SpatialReference("EPSG:4326");const l=new Cesium.Rectangle(s.xmin,s.ymin,s.xmax,s.ymax),h=Fl._getSublayerLabelingInfos(t);return new Promise(n=>{const s=new Gl({style:t.style,opacity:t.opacity,show:e._getLayerViewVisible(t.visible),tilingScheme:r,maximumLevel:o,minimumLevel:a,scene:i.scene,labelsRenderMode:t.labelsRenderMode,sublayerLabelingInfos:h,rectangle:l,transform:[512/t.mvtExtent,0,0,512/t.mvtExtent,0,0],tokenKey:t.tokenKey,tokenValue:t.tokenValue});e.innerLayer=i.imageryLayers.addImageryProvider(s),e.innerLayer.id=t.id,t.clippingArea&&rh(t,e.innerLayer,i),n(e)})},Fl.initializeOptions=function(e,t){const{extent:i,tileInfo:r,spatialReference:a}=e,o=$l(a,i,r),s=Zl({spatialReference:a,extent:i},o.rectangle),[l,h]=n.TileInfoUtil.getLevelRangeByTileInfo(r);return{style:e.style,opacity:e.opacity,show:e.visible,tilingScheme:o,minimumLevel:l,maximumLevel:h,scene:t&&t.scene?t.scene:void 0,labelsRenderMode:e.labelsRenderMode,sublayerLabelingInfos:Fl._getSublayerLabelingInfos(e),rectangle:new Cesium.Rectangle(s.xmin,s.ymin,s.xmax,s.ymax),transform:[512/e.mvtExtent,0,0,512/e.mvtExtent,0,0],tokenKey:e.tokenKey,tokenValue:e.tokenValue}},Fl.refresh=function(e){this.removeLayer(e),this.addVectorTileLayer(e)},Fl.setOpacity=function(e,t){e.innerLayer.alpha=t},Fl.setVisible=function(e,t){e.innerLayer.show=e._getLayerViewVisible(t)},Fl.setClipArea=function(e){const{layer:t,innerView:i,innerLayer:r}=e;t.clippingArea?rh(t,r,i):i._clipPreRenderFunction&&(r.swipeEnabled=!1,i.scene.preRender.removeEventListener(i._clipPreRenderFunction))},Fl.removeLayer=function(e){const{innerLayer:t,innerView:i}=e;t.imageryProvider.destroy(),i.imageryLayers.remove(t,!0)},Fl._getSublayerLabelingInfos=function(e){const t={};return e.style.layers.forEach(i=>{if(i&&i.id){const r=e.getExtendProperties(i.id,"labelingInfo");r&&r instanceof Array&&r.length>0&&(t[i.id]=r)}}),t};var Bl=Fl;class ql{}ql.addM3DLayer=function(e,t,i){const{layer:r,innerView:n,view:a}=e;let o=ql.initializeOptions(e);o.show=e._getLayerViewVisible(r.visible);const{extendOptions:s={}}=r;th(o=Object.assign(o,s),n,a,function(e){o.autoReset&&ih(e.boundingSphere,o,n),e.translucency=o.translucency,t(e)},i)},ql.initializeOptions=function(e){const{layer:t,innerView:i}=e,r=eh(t);return r.url=t.url,t.url.includes("/igs/rest/services/")?r.igserver=!0:r.igserver=!1,r.headers&&(r.url=new Cesium.Resource({url:r.url,headers:r.headers})),i&&(r._scene=i.scene),r},ql.removeLayer=function(e,t,i){t.scene.primitives.removeAndDestroy(e)};var Ul=ql;class Wl{}Wl.addTerrainCacheLayer=function(e,t,i){const r=Wl.initializeOptions(e);t.terrainProvider=new Cesium.CesiumTerrainProvider(r),i(t.terrainProvider)},Wl.initializeOptions=function(e){let t={url:e.url};const{extendOptions:i={}}=e;return t=Object.assign(t,i)},Wl.setOpacity=function(e,t){let i;1===e.opacity?(t.scene.globe.translucency.enabled=!1,(i=new Cesium.Color.clone(t.scene.globe.baseColor)).alpha=1,t.scene.globe.baseColor=i):(t.scene.globe.translucency.enabled=!0,(i=new Cesium.Color.clone(t.scene.globe.baseColor)).alpha=e.opacity,t.scene.globe.baseColor=i)},Wl.removeLayer=function(e,t){t.terrainProvider=new Cesium.EllipsoidTerrainProvider};var Hl=Wl;var Yl=class{constructor(e){const t=Object.assign({},e);t.extensions=[];const i=Object(n.defaultValue)(e.extensions,[]),r=Object(n.defaultValue)(e.url,"");let a;a=r instanceof Cesium.Resource?r:new Cesium.Resource({url:r}),i&&i instanceof Array&&i.forEach(e=>{e&&e.value&&(a.queryParameters[e.key]=e.value)}),t.url=a;const o=new Cesium.UrlTemplateImageryProvider(t);return o.isStretchImage=Object(n.defaultValue)(e.isStretchImage,!1),o}};class Xl{}Xl.addWebTileLayer=function(e,t){let i=e._buildRequestUrl?e._buildRequestUrl():e.url;i=i.replace("{col}","{x}");let r={x:1,y:-1};"tms"===e.tileSliceType?(i=i.replace("{row}","{y}"),r={x:1,y:1}):i=i.replace("{row}","{y}"),i=i.replace("{level}","{z}");const a=$l(e.spatialReference,e.extent,e.tileInfo,r),o=Zl(e,a.rectangle),s=new Cesium.Rectangle(o.xmin,o.ymin,o.xmax,o.ymax),{extendOptions:l={}}=e,[h,c]=n.TileInfoUtil.getLevelRangeByTileInfo(e.tileInfo);let u={url:i,tileWidth:e.tileInfo.cols,tileHeight:e.tileInfo.cols,tilingScheme:a,minimumLevel:h,maximumLevel:c,rectangle:s,subdomains:e.subDomains,extensions:[{key:e.tokenKey,value:e.tokenValue}]};u=Object.assign(u,l);const d=Kl(e,t),p=new Yl(u),f=t.imageryLayers.addImageryProvider(p,d);return e.clippingArea&&rh(e,f,t),f.id=e.id,f._realIndex=e._realIndex+1,f},Xl.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var Jl=Xl;function $l(e,t,i,r){let a=e.wkid,o=e.wkt,s=void 0;if(e.isWebMercator&&a!=n.CustomWKID.bd09mc&&a!=n.CustomWKID.gcj02mc&&(a=3857),!Object(n.defined)(a)&&!Object(n.defined)(o))return new Cesium.WebMercatorTilingScheme;if(n.Projection.isCustomWKID(a)){return new gr({wkid:a,tileInfo:i,rectangleSouthwest:new Cesium.Cartesian2(t.xmin,t.ymin),rectangleNortheast:new Cesium.Cartesian2(t.xmax,t.ymax),axisDirection:r})}if(Object(n.defined)(a)){const e=n.EPSG.find(e=>e.id===a);if(!Object(n.defined)(e))return n.Log.error("根据该空间参考系的wkid未匹配到wkt值"),new Cesium.WebMercatorTilingScheme;o=e.strProject}return 4326==a||4490==a||4610==a||4212==a?Object(n.defined)(i)&&!Object(n.defined)(i.lods)?s=new Cesium.GeographicTilingScheme:(Object(n.defined)(t)||(t={xmin:-180,ymin:-90,xmax:180,ymax:90}),s=new gr({wkt:o,wkid:a,proj4:Ci,tileInfo:i,numberOfLevelZeroTilesX:Object(n.defined)(i)?2:1,rectangleSouthwest:new Cesium.Cartesian2(t.xmin,t.ymin),rectangleNortheast:new Cesium.Cartesian2(t.xmax,t.ymax),axisDirection:r})):Object(n.defined)(i)&&!Object(n.defined)(i.lods)?s=new Cesium.WebMercatorTilingScheme:(Object(n.defined)(t)||(t={xmin:-20037508.342787,ymin:-20037508.342787,xmax:20037508.342787,ymax:20037508.342787}),s=new gr({wkt:o,wkid:a,proj4:Ci,tileInfo:i,rectangleSouthwest:new Cesium.Cartesian2(t.xmin,t.ymin),rectangleNortheast:new Cesium.Cartesian2(t.xmax,t.ymax),axisDirection:r})),s}function Kl(e,t){let i=t.imageryLayers._layers.length;for(let r=0;r<t.imageryLayers._layers.length;r++)if(t.imageryLayers._layers[r].hasOwnProperty("_realIndex")&&e._realIndex+1<t.imageryLayers._layers[r]._realIndex){i=r;break}return i}function Zl(e,t){const i={...e.extent},r=e.spatialReference.wkid,a=e.spatialReference.wkt;let o=void 0;e.spatialReference.isGeographic?o=new Cesium.Rectangle(-180,-90,180,90):e.spatialReference.isWebMercator&&(o=new Cesium.Rectangle(-20037508.342787,-20037508.342787,20037508.342787,20037508.342787)),o&&(i.xmin=Cesium.Math.clamp(i.xmin,o.west,o.east),i.ymin=Cesium.Math.clamp(i.ymin,o.south,o.north),i.xmax=Cesium.Math.clamp(i.xmax,o.west,o.east),i.ymax=Cesium.Math.clamp(i.ymax,o.south,o.north));const s=n.Projection.projectPoints({originWKID:r,originDefs:a,targetWKID:4326,points:[[i.xmin,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin],[i.xmax,i.ymax]]}),[l,h,c,u]=s;l[0]=Cesium.Math.toRadians(l[0]),l[1]=Cesium.Math.toRadians(l[1]),h[0]=Cesium.Math.toRadians(h[0]),h[1]=Cesium.Math.toRadians(h[1]),c[0]=Cesium.Math.toRadians(c[0]),c[1]=Cesium.Math.toRadians(c[1]),u[0]=Cesium.Math.toRadians(u[0]),u[1]=Cesium.Math.toRadians(u[1]),i.xmin=Math.min(l[0],c[0]),i.ymin=Math.min(h[1],c[1]),i.xmax=Math.max(h[0],u[0]),i.ymax=Math.max(l[1],u[1]);const d={xmin:t.west,xmax:t.east,ymin:t.south,ymax:t.north};return i.xmin=Cesium.Math.clamp(i.xmin,d.xmin,d.xmax),i.xmax=Cesium.Math.clamp(i.xmax,d.xmin,d.xmax),i.ymin=Cesium.Math.clamp(i.ymin,d.ymin,d.ymax),i.ymax=Cesium.Math.clamp(i.ymax,d.ymin,d.ymax),i}function Ql(e){if(!e)return;const t={type:e.type,field:e.field};switch(e.type){case n.RendererType.classBreak:t.classBreakInfos=[];for(let i=0;i<e.classBreakInfos.length;i++){const r=e.classBreakInfos[i],a=r.symbol;let o=n.Color.fromColor(a.color);o=o.toCesiumRGB(),t.classBreakInfos.push({minValue:r.minValue,maxValue:r.maxValue,symbol:{type:"mesh-3d",symbolLayers:[{type:"fill",material:{color:new Cesium.Color(o.red,o.green,o.blue,o.alpha)}}]}})}break;case n.RendererType.uniqueValue:t.uniqueValueInfos=[];for(let i=0;i<e.uniqueValueInfos.length;i++){const r=e.uniqueValueInfos[i],a=r.symbol;let o=n.Color.fromColor(a.color);o=o.toCesiumRGB(),t.uniqueValueInfos.push({value:r.value,symbol:{type:"mesh-3d",symbolLayers:[{type:"fill",material:{color:new Cesium.Color(o.red,o.green,o.blue,o.alpha)}}]}})}break;default:return}return t}function eh(e){let t={};return t.url=Object(n.defaultValue)(e.url,void 0),t.id=Object(n.defaultValue)(e.id,void 0),t.show=Object(n.defaultValue)(e.visible,!0),t.layerIndex=Object(n.defaultValue)(e.layerIndex,0),t.layerRenderIndex=Object(n.defaultValue)(e.layerRenderIndex,0),t.sceneIndex=t.layer&&void 0!==t.layer.sceneIndex?t.layer.sceneIndex:0,t.igserver=!0,t.renderer=Ql(e.renderer),t.translucency=e.opacity,t=Object.assign(t,e.extendOptions)}function th(e,t,i,r,a){e=Object(n.defaultValue)(e,{}),t.scene.primitives.add(new Cesium.MapGISM3DSet(e)).readyPromise.then(function(t){t.id=e.id,t.type="m3d",r&&"function"==typeof r&&r(t)}).otherwise(function(e){a&&"function"==typeof a&&a(e)})}function ih(e,t,i){t=Object(n.defaultValue)(t,{});const r=Object(n.defaultValue)(t.duration,0),a=Object(n.defaultValue)(t.orientation,new Cesium.HeadingPitchRange(0,-.5,2.5*e.radius));i.scene.camera.flyToBoundingSphere(e,{duration:r,offset:a}),i.scene.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)}function rh(e,t,i){let r=e.clippingArea;if(r.type!==n.GeometryType.polygon&r.type!==n.GeometryType.extent&r.type!==n.GeometryType.circle)return;r.spatialReference.isGeographic||(r=n.Projection.project(r,new n.SpatialReference({wkid:4326})));let a={};switch(r.type){case n.GeometryType.polygon:a.outerRing=r.coordinates[0],a.holes=r.coordinates.splice(1,r.coordinates.length-1);break;case n.GeometryType.circle:a.outerRing=r.toPolygon().coordinates[0],a.holes=void 0;break;case n.GeometryType.extent:const{xmin:e,xmax:t,ymin:i,ymax:o}=r;a.outerRing=[[e,i],[t,i],[t,o],[e,o],[e,i]],a.holes=void 0;break;default:a=void 0}if(!a)return;t.swipeEnabled=!0;const o=[],s=a.outerRing;for(let e=0;e<s.length;e++)o.push(Cesium.Cartesian3.fromDegrees(s[e][0],s[e][1],0));let l=void 0;if(a.holes&&a.holes.length>0){l=[];for(let e=0;e<a.holes.length;e++){const t=[];for(let i=0;i<a.holes[e].length;i++)t.push(Cesium.Cartesian3.fromDegrees(a.holes[e][i][0],a.holes[e][i][1],0));l.push(new Cesium.PolygonHierarchy(t))}}const h=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(o,l)}),c=Cesium.PolygonGeometry.createGeometry(h),u=Cesium.GeometryPipeline.createAttributeLocations(c),d=Cesium.VertexArray.fromGeometry({context:i.scene.context,geometry:c,attributeLocations:u}),p=Cesium.ShaderProgram.fromCache({context:i.scene.context,vertexShaderSource:"\n attribute vec3 position;\n void main() {\n gl_Position = czm_viewProjection * vec4(position.xyz, 1.0);\n }\n ",fragmentShaderSource:"\n void main() {\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n }\n ",attributeLocations:u}),f=Cesium.RenderState.fromCache({cull:{enabled:!0,face:Cesium.CullFace.BACK}}),m=new Cesium.DrawCommand({primitiveType:Cesium.PrimitiveType.TRIANGLES,vertexArray:d,shaderProgram:p,castShadows:!1,receiveShadows:!1,uniformMap:{},renderState:f}),y=i.scene.context.drawingBufferWidth,g=i.scene.context.drawingBufferHeight,v=new Cesium.Framebuffer({context:i.scene.context,colorTextures:[new Cesium.Texture({context:i.scene.context,width:y,height:g,pixelDatatype:Cesium.PixelDatatype.UNSIGNED_BYTE,pixelFormat:Cesium.PixelFormat.RGB})],destroyAttachments:!1}),b=new Cesium.PassState(i.scene.context);b.framebuffer=v,i.scene._frameState.swipeTexture=b.framebuffer.getColorTexture(0),i.scene._frameState.swiper.type=Cesium.SwipeModeType.POLYGON,i._clipPreRenderFunction=function(){i.scene.context.uniformState.updateCamera(i.camera),new Cesium.ClearCommand({color:new Cesium.Color(0,0,0,1)}).execute(i.scene.context,b),m.execute(i.scene.context,b)},i.scene.preRender.removeEventListener(i._clipPreRenderFunction),i.scene.preRender.addEventListener(i._clipPreRenderFunction)}function nh(e,t){switch(e.type){case n.LayerType.arcgisMapImage:return Er.initializeOptions(e);case n.LayerType.igsMapImage:return lh.initializeOptions(e);case n.LayerType.wms:return Pr.initializeOptions(e);case n.LayerType.arcgisTile:return jr.initializeOptions(e);case n.LayerType.igsTile:return Vr.initializeOptions(e);case n.LayerType.wmts:return Gr.initializeOptions(e);case n.LayerType.arcgisVectorTile:case n.LayerType.igsVectorTile:return Bl.initializeOptions(e,t);case n.LayerType.m3dCache:return Ul.initializeOptions({layer:e,innerView:t});case n.LayerType.terrain:return Hl.initializeOptions(e);default:n.Log.error(`暂不支持为${e.type}类型的图层构造实例化参数`)}}class ah{constructor(e){if(e=Cesium.defaultValue(e,Cesium.defaultValue.EMPTY_OBJECT),!Cesium.defined(e.url))throw new Cesium.DeveloperError("必须传入地图服务的URL");this._imageInfoUrl=e.url,this._resource=Cesium.Resource.createIfNeeded(e.url),this._tilingScheme=Cesium.defaultValue(e.tilingScheme,new Cesium.GeographicTilingScheme),this._rectangle=Cesium.defaultValue(e.rectangle,this._tilingScheme.rectangle),this._tileWidth=Cesium.defaultValue(e.tileWidth,256),this._tileHeight=Cesium.defaultValue(e.tileHeight,256),this._enablePickFeatures=Cesium.defaultValue(e.enablePickFeatures,!1),this._minimumLevel=Cesium.defaultValue(e.minimumLevel,0),this._maximumLevel=Cesium.defaultValue(e.maximumLevel,20),this._gdbpsUrl=Cesium.defaultValue(e.gdbps,[]),this._filters=Cesium.defaultValue(e.filters,""),this._layers=e.layers,this._extensions=e.extensions,this._dynamicLayers=e.dynamicLayers,this._isAntialiasing=Cesium.defaultValue(e.isAntialiasing,void 0),this._build2DImageResource=e.build2DImageResource,this._proxy=e.proxy,this._ready=!0,this._credit=Cesium.defaultValue(e.credit,new Cesium.Credit("MapGIS")),this._clientId=Cesium.defaultValue(e.clientId,Math.random().toString(36).substring(2)),this._httpMethod=Cesium.defaultValue(e.httpMethod,"GET"),this._headers=Cesium.defaultValue(e.headers,void 0)}static async fromUrl(e,t){const i=new n.IGSMapImageLayer({url:e}),r=await i.load(),a=lh.initializeOptions(r);return new ah({...a,...t})}buildImageResource(e,t,i,r){if(this._build2DImageResource&&this._build2DImageResource instanceof Function)return this._build2DImageResource(this,e,t,i,r);let n=this._resource.url;if(r.httpMethod=this._httpMethod,Cesium.defined(this._headers)?this._headers.hasOwnProperty("Content-Type")||(n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?this._headers["Content-Type"]="text/plain":this._headers["Content-Type"]="application/x-www-form-urlencoded"):n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?this._headers={"Content-Type":"text/plain"}:this._headers={"Content-Type":"application/x-www-form-urlencoded"},r.headers=this._headers,"GET"===this._httpMethod){n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?n+=`?f=png&w=${this._tileWidth}&h=${this._tileHeight}&filters=${this._filters}&bbox=`:n.includes("/coverings")?n+=`?f=image&size=${this._tileWidth},${this._tileHeight}&bbox=`:n+=`/image?f=image&size=${this._tileWidth},${this._tileHeight}&layerFilters=${this._filters}&bbox=`;const r=this._tilingScheme.tileXYToNativeRectangle(e,t,i);if((n+=`${r.west},${r.south},${r.east},${r.north}`).includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?n+=`&guid=${this._clientId}`:n+=`&clientId=${this._clientId}`,Cesium.defined(this._gdbpsUrl)&&this._gdbpsUrl.length>0){n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?n+="&gdbps=":n+="&urls=";for(let e=0;e<this._gdbpsUrl.length;e++)n+=this._gdbpsUrl[e],e<this._gdbpsUrl.length-1&&(n+=",")}if(Cesium.defined(this._layers)&&(n+=`&layers=${this._layers}`),Cesium.defined(this._dynamicLayers)&&(n+=`&dynamicLayers=${this._dynamicLayers}`),Cesium.defined(this._extensions)&&this._extensions.length>0)for(let e=0;e<this._extensions.length;e++){const t=this._extensions[e];n+=`&${t.key}=${encodeURIComponent(t.value)}`}null!==this._isAntialiasing&&void 0!==this._isAntialiasing&&(n+=`&isAntialiasing=${this._isAntialiasing}`)}else if("POST"===this._httpMethod){let a={};n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?(a.f="png",a.w=this._tileWidth,a.h=this._tileHeight,a.filters=this._filters):(a.f="image",a.size=`${this._tileWidth},${this._tileHeight}`,a.layerFilters=this._filters);const o=this._tilingScheme.tileXYToNativeRectangle(e,t,i);if(a.bbox=`${o.west},${o.south},${o.east},${o.north}`,n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers"),a.clientId=this._clientId,null!==this._isAntialiasing&&void 0!==this._isAntialiasing&&(a.isAntialiasing=this._isAntialiasing),Cesium.defined(this._gdbpsUrl)&&this._gdbpsUrl.length>0){let e="";for(let t=0;t<this._gdbpsUrl.length;t++)e+=this._gdbpsUrl[t],t<this._gdbpsUrl.length-1&&(e+=",");n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?a.gdbps=e:a.urls=e}if(Cesium.defined(this._layers)&&(a.layers=this._layers),Cesium.defined(this._dynamicLayers)&&(a.dynamicLayers=this._dynamicLayers),Cesium.defined(this._extensions)&&this._extensions.length>0)for(let e=0;e<this._extensions.length;e++){const t=this._extensions[e];a[t.key]=t.value}if(n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers"))a=JSON.stringify(a);else{n+="/image";let e="";Object.keys(a).forEach(t=>{a[t]&&(e+=`${t}=${encodeURIComponent(a[t])}&`)}),e=e.substring(0,e.length-1),a=e}r.data=a}return this._resource.getDerivedResource({url:n,request:r,proxy:this._proxy})}requestImage(e,t,i,r){return Cesium.ImageryProvider.loadImage(this,this.buildImageResource(e,t,i,r))}pickFeatures(e,t,i){if(!this._enablePickFeatures)return;let r=this._imageInfoUrl.replace("{s}",(e+t)%4);t=3*Math.pow(2,i)-1-t,r=(r=(r=(r=r.replace("{s}",(e+t)%4)).replace("{row}",t)).replace("{col}",e)).replace("{level}",i);return this._resource.getDerivedResource({url:r,queryParameters:{f:"json"}}).fetchJson().then(function(e){const t=[],i=e.results;if(!Cesium.defined(i))return t;for(let e=0;e<i.length;++e){const r=i[e],n=new Cesium.ImageryLayerFeatureInfo;n.data=r,n.name=r.value,n.properties=r.attributes,n.configureDescriptionFromProperties(r.attributes),t.push(n)}return t})}}Object.defineProperties(ah.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},gdbps:{get:function(){return this._gdbpsUrl},set:function(e){e instanceof Array&&(this._gdbpsUrl=e)}},layers:{get:function(){return this._layers},set:function(e){this._layers=e}}});var oh=ah;class sh{}sh.addIGSMapImageLayer=function(e,t){const i=sh.initializeOptions(e),r=Kl(e,t),n=t.imageryLayers.addImageryProvider(new oh(i),r);return e.clippingArea&&rh(e,n,t),n.id=e.id,n._realIndex=e._realIndex+1,n},sh.initializeOptions=function(e){const t=n.TileInfoUtil.createCommonTileInfo({extent:e.extent,tileSize:e.imageWidth}),i=$l(e.spatialReference,e.extent,t),r=Zl(e,i.rectangle),a=new Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax);let o=e._url;"1.0"===e._igsVersion&&(o=o.replace("/mrcs/","/mrms/"));let s=[];e.tokenKey&&s.push({key:e.tokenKey,value:e.tokenValue});let l={url:o,httpMethod:e.httpMethod,tileWidth:e.imageWidth,tileHeight:e.imageHeight,layers:e.layers,tilingScheme:i,clientId:e.clientId,projectionSrs:Object(n.getProjectionSrs)(e.spatialReference),rectangle:a,filters:e.getFilters?JSON.stringify(e.getFilters()):void 0,headers:e.headers,extensions:s,isAntialiasing:e.isAntialiasing};const{extendOptions:h={}}=e;if(l=Object.assign(l,h),e.allSublayers){const t=Object(n.getIGSDynamicLayer)(e);t.length>0&&(l.dynamicLayers=JSON.stringify(t))}return l},sh.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var lh=sh;class hh{}hh.getMouseEvent=function(e,t,i){let r=null;if(t._innerView.scene.globe.depthTestAgainstTerrain&&!t._innerView.scene.globe.translucency.enabled)r=t._innerView.scene.pickPosition(e.position);else{const i=t._innerView.camera.getPickRay(e.position);r=t._innerView.scene.globe.pick(i,t._innerView.scene)}if(!r)return;const a=Cesium.Cartographic.fromCartesian(r),o=Cesium.Math.toDegrees(a.longitude),s=Cesium.Math.toDegrees(a.latitude),l={mapPoint:new n.Point({coordinates:[o,s,a.height]}),x:e.position.x,y:e.position.y,type:i};return e.originalEvent&&(l.native=e.originalEvent,l.stopPropagation=e.originalEvent.stopPropagation,l.timeStamp=e.originalEvent.timeStamp,l.button=e.originalEvent.button,l.buttons=e.originalEvent.buttons),l},hh.getKeyEvent=function(e,t,i){const r={key:e.key,stopPropagation:e.stopPropagation,timeStamp:e.timeStamp,native:e,type:i};return"key-down"===i&&(r.repeat=e.repeat),r},hh.getViewChangeEvent=function(e,t,i){const r={event:e,target:t,type:i};return r.mapView=t,r.scale=t._scale,r.zoom=t._zoom,r.center=t.center,r.extent=t._extent,r},hh.getDragEvent=function(e,t,i,r,n){return e.originalEvent?{x:e.originalEvent.layerX,y:e.originalEvent.layerY,button:void 0!==n?n:e.originalEvent.button,buttons:e.originalEvent.buttons,cancelable:e.originalEvent.cancelable,origin:i,stopPropagation:e.originalEvent.stopPropagation,timeStamp:e.originalEvent.timeStamp,native:e.originalEvent,action:r,type:"drag"}:{origin:i,action:r,type:"drag"}},hh.getResizeEvent=function(e,t,i,r){return e};var ch=hh;class uh{}uh.addCesium3DTilesLayer=function(e,t,i){const{layer:r,innerView:n}=e,{extendOptions:a={},opacity:o,visible:s}=r,l={};r.tokenKey&&r.tokenValue&&(l[r.tokenKey]=r.tokenValue);let h={show:e._getLayerViewVisible(s),url:new Cesium.Resource({url:r._paramUrl,headers:r.headers,queryParameters:l})};h=Object.assign(h,a),n.scene.primitives.add(new Cesium.Cesium3DTileset(h)).readyPromise.then(function(e){e.id=r.id,e.style=new Cesium.Cesium3DTileStyle({color:`rgba(255, 255, 255, ${o})`}),a.autoReset&&ih(e.boundingSphere,h,n),t(e)}).otherwise(i)},uh.removeLayer=function(e,t){t.scene.primitives.removeAndDestroy(e)};var dh=uh;const ph=window.mapv||{},fh=ph.baiduMapLayer?ph.baiduMapLayer.__proto__:Function;class mh extends fh{constructor(e,t,i,r){if(super(e,t,i),!fh)return;this.map=e,this.scene=e.scene,this.dataSet=t;i=i||{},this.init(i),this.argCheck(i),this.initDevicePixelRatio(),this.canvasLayer=r,this.stopAniamation=!1,this.animation=i.animation,this.clickEvent=this.clickEvent.bind(this),this.mousemoveEvent=this.mousemoveEvent.bind(this),this.bindEvent()}initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1}clickEvent(e){const t=e.point;super.clickEvent(t,e)}mousemoveEvent(e){const t=e.point;super.mousemoveEvent(t,e)}addAnimatorEvent(){}animatorMovestartEvent(){const e=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=e.stepsRange.start)}animatorMoveendEvent(){this.isEnabledTime()&&this.animator}bindEvent(){this.map;this.options.methods&&(this.options.methods.click,this.options.methods.mousemove)}unbindEvent(){const e=this.map;this.options.methods&&(this.options.methods.click&&e.off("click",this.clickEvent),this.options.methods.mousemove&&e.off("mousemove",this.mousemoveEvent))}getContext(){return this.canvasLayer.canvas.getContext(this.context)}init(e){const t=this;t.options=e,this.initDataRange(e),this.context=t.options.context||"2d",t.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(t.options.zIndex),this.initAnimator()}_canvasUpdate(e){this.map;const t=this.scene;if(!this.canvasLayer||this.stopAniamation)return;const i=this,r=i.options.animation,n=i.getContext();if(i.isEnabledTime()){if(void 0===e)return void this.clear(n);"2d"===this.context&&(n.save(),n.globalCompositeOperation="destination-out",n.fillStyle="rgba(0, 0, 0, .1)",n.fillRect(0,0,n.canvas.width,n.canvas.height),n.restore())}else this.clear(n);if("2d"===this.context)for(const e in i.options)n[e]=i.options[e];else n.clear(n.COLOR_BUFFER_BIT);const a={transferCoordinate(e){const t=Cesium.Cartesian3.fromDegrees(e[0],e[1]);var r=i.map.camera.position;let n=i.map.scene.globe.ellipsoid.cartesianToCartographic(r).height;if(n+=1.2*i.map.scene.globe.ellipsoid.maximumRadius,Cesium.Cartesian3.distance(r,t)>n)return;r=Cesium.Cartesian3.fromDegrees(e[0],e[1]);const a=Cesium.SceneTransforms.wgs84ToWindowCoordinates(i.map.scene,r);return a?[a.x,a.y]:[0,0]}};void 0!==e&&(a.filter=function(t){const i=r.trails||10;return!!(e&&t.time>e-i&&t.time<e)});const o=i.dataSet.get(a);this.processData(o),"m"==i.options.unit&&i.options.size,i.options._size=i.options.size;let s=Cesium.SceneTransforms.wgs84ToWindowCoordinates(t,Cesium.Cartesian3.fromDegrees(0,0));s||(s=[0,0]),this.drawContext(n,new ph.DataSet(o),i.options,s),i.options.updateCallback&&i.options.updateCallback(e)}updateData(e,t){let i=e;i&&i.get&&(i=i.get()),void 0!=i&&this.dataSet.set(i),super.update({options:t})}addData(e,t){let i=e;e&&e.get&&(i=e.get()),this.dataSet.add(i),this.update({options:t})}getData(){return this.dataSet}removeData(e){if(!this.dataSet)return;const t=this.dataSet.get({filter:t=>null==e||"function"!=typeof e||!e(t)});this.dataSet.set(t),this.stopAniamation=!0}clearData(){this.dataSet&&this.dataSet.clear(),this.stopAniamation=!0}draw(){this.canvasLayer.draw()}clear(e){e&&e.clearRect&&e.clearRect(0,0,e.canvas.width,e.canvas.height)}}let yh=0;class gh{constructor(e,t,i,r){this.map=e,this.scene=e.scene,this.mapvBaseLayer=new mh(e,t,i,this),this.mapVOptions=i,this.initDevicePixelRatio(),this.canvas=this._creteWidgetCanvas(),this.render=this.render.bind(this),this.handler=void 0,this.postRenderTime=0;const n=i.cesium;if(n&&(this.postRender=n.postRender||!1,this.postRenderFrame=n.postRenderFrame||30),void 0!=r)this.container=r,r.appendChild(this.canvas);else{const t=document.getElementsByClassName("cesium-widget"),i=t.length>0?t[0]:e.container;this.container=i,this.addInnerContainer()}this.bindEvent(),this._reset()}initDevicePixelRatio(){this.devicePixelRatio=1}addInnerContainer(){this.container.appendChild(this.canvas)}bindEvent(){const e=this.map;if(this.innerMoveStart=this.moveStartEvent.bind(this),this.innerMoveEnd=this.moveEndEvent.bind(this),this.innnerZoomStart=this.zoomStartEvent.bind(this),this.innnerZoomEnd=this.zoomEndEvent.bind(this),this.postEventHandle=this.postEvent.bind(this),this.postStartEvent=this.postStartEvent.bind(this),this.postEndEvent=this.postEndEvent.bind(this),this.postRender)this.scene.camera.moveStart.addEventListener(this.postStartEvent,this),this.scene.camera.moveEnd.addEventListener(this.postEndEvent,this);else{const t=new Cesium.ScreenSpaceEventHandler(this.scene.canvas);t.setInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.WHEEL),t.setInputAction(this.innerMoveStart,Cesium.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.LEFT_UP),t.setInputAction(this.innerMoveStart,Cesium.ScreenSpaceEventType.RIGHT_DOWN),t.setInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.RIGHT_UP),e.scene.camera.moveEnd.addEventListener(this.innerMoveEnd,this),this.handler=t}}unbindEvent(){const e=this.map;if(this.postRender)this.scene.camera.moveStart.removeEventListener(this.postStartEvent,this),this.scene.camera.moveEnd.removeEventListener(this.postEndEvent,this);else{const t=this.handler;t&&(t.removeInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.WHEEL),t.removeInputAction(this.innerMoveStart,Cesium.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(this.innerMoveStart,Cesium.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.RIGHT_UP),t.destroy()),e.scene.camera.moveEnd.removeEventListener(this.innerMoveEnd,this)}}postStartEvent(){this.mapvBaseLayer&&(this.mapvBaseLayer.animatorMovestartEvent(),this.scene.postRender.addEventListener(this._reset,this)),this._visiable()}postEndEvent(){this.mapvBaseLayer&&(this.mapvBaseLayer.animatorMoveendEvent(),this.scene.postRender.removeEventListener(this._reset,this)),this._reset(),this._visiable()}moveStartEvent(){this.mapvBaseLayer&&this.mapvBaseLayer.animatorMovestartEvent(),this._unvisiable()}moveEndEvent(){this.mapvBaseLayer&&this.mapvBaseLayer.animatorMoveendEvent(),this._reset(),this._visiable()}zoomStartEvent(){this._unvisiable()}zoomEndEvent(){this._unvisiable()}postEvent(){this.postRenderTime++,this.postRenderTime%this.postRenderFrame==0&&this.moveEndEvent()}addData(e,t){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer.addData(e,t)}updateData(e,t){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer.updateData(e,t)}getData(){return this.mapvBaseLayer&&(this.dataSet=this.mapvBaseLayer.getData()),this.dataSet}removeData(e){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer&&this.mapvBaseLayer.removeData(e)}removeAllData(){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer.clearData()}_visiable(){return this.canvas.style.display="block",this}_unvisiable(){return this.canvas.style.display="none",this}setOpacity(e){return this.canvas.style.opacity=e,this}_createCanvas(){const e=document.createElement("canvas");e.id=this.mapVOptions.layerid||`mapv${yh++}`,e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",e.style.zIndex=this.mapVOptions.zIndex||100,e.width=parseInt(this.map.canvas.width)||parseInt(this.map.container.offsetWidth),e.height=parseInt(this.map.canvas.height)||parseInt(this.map.container.offsetHeight),e.style.width=`${parseInt(this.map.container.offsetWidth)}px`,e.style.height=`${parseInt(this.map.container.offsetHeight)}px`;const t=this.devicePixelRatio;return"2d"==this.mapVOptions.context&&e.getContext(this.mapVOptions.context).scale(t,t),e}_creteWidgetCanvas(){const e=document.createElement("canvas");e.id=this.mapVOptions.layerid||`mapv${yh++}`,e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",e.style.zIndex=this.mapVOptions.zIndex||100,e.width=parseInt(this.map.canvas.width)||parseInt(this.map.container.offsetWidth),e.height=parseInt(this.map.canvas.height)||parseInt(this.map.container.offsetHeight),e.style.width=`${parseInt(this.map.container.offsetWidth)}px`,e.style.height=`${parseInt(this.map.container.offsetHeight)}px`;const t=this.devicePixelRatio;return"2d"==this.mapVOptions.context&&e.getContext("2d").scale(t,t),e}_reset(){this.resizeCanvas(),this.fixPosition(),this.onResize(),this.render()}draw(){this._reset()}show(){this._visiable()}hide(){this._unvisiable()}destroy(){this.remove()}remove(){if(void 0==this.mapvBaseLayer)return;this.unbindEvent(),this.removeAllData(),this.mapvBaseLayer.clear(this.mapvBaseLayer.getContext()),this.mapvBaseLayer=void 0,this.canvas.parentElement.removeChild(this.canvas)}update(e){void 0!=e&&this.updateData(e.data,e.options)}resizeCanvas(){if(void 0==this.canvas||null==this.canvas)return;const e=this.canvas;e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.width=parseInt(this.map.canvas.width)||parseInt(this.map.container.offsetWidth)*this.devicePixelRatio,e.height=parseInt(this.map.canvas.height)||parseInt(this.map.container.offsetHeight)*this.devicePixelRatio,e.style.width=`${parseInt(this.map.container.offsetWidth)}px`,e.style.height=`${parseInt(this.map.container.offsetHeight)}px`;const t=this.devicePixelRatio;"2d"==this.mapVOptions.context&&e.getContext("2d").scale(t,t)}fixPosition(){}onResize(){}render(){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer._canvasUpdate()}}class vh{}vh.addMapVLayer=function(e,t){const{extendOptions:i={}}=e,r=Object.assign(e.mapVOptions,i),n=new gh(t,e.data,r);return n.id=e.id,n},vh.removeLayer=function(e){e.remove()};var bh=vh;var _h=class{constructor(e){e=Cesium.defaultValue(e,{}),this.commonLayerId=Cesium.defaultValue(e.layerId,null),this._feature=e.feature,this._feature||n.Log.error("feature不能为空!"),this._feature=n.Feature.fromJSON(this._feature.toJSON()),this._addZCoordinate(),this.checkSymbol()&&(this.id=Cesium.defaultValue(this._feature.id,Cesium.createGuid()),this.show=Cesium.defaultValue(this._feature.visible,!0),this._layerOpacity=Cesium.defaultValue(e.layerOpacity,1),this._primitivesCollection=Cesium.defaultValue(e.primitivesCollection,void 0),this._pointsCollection=Cesium.defaultValue(e.pointsCollection,void 0),this._billboardsCollection=Cesium.defaultValue(e.billboardsCollection,void 0),this._labelsCollection=Cesium.defaultValue(e.labelsCollection,void 0),this._points=[],this._billboards=[],this._labels=[],this._primitives=[],this._canvas=void 0,this._symbol=this._feature.symbol,this._elevationInfo=this._feature.elevationInfo,this._viewer=Cesium.defaultValue(e.viewer,void 0),this._createPrimitive())}update(e){this._feature=e,this._addZCoordinate(),this._feature&&(this.show=this._feature.visible),this._markRemovePrimitives(),this._createPrimitive(()=>{this._removeMarkPrimitives(!0)})}destroy(){this._removePrimitives(),this.id=void 0,this.show=void 0,this._layerOpacity=void 0,this._feature=void 0,this._canvas=void 0,this._symbol=void 0,this._points=[],this._billboards=[],this._labels=[],this._primitives=[],this._primitivesCollection=void 0,this._pointsCollection=void 0,this._billboardsCollection=void 0,this._labelsCollection=void 0}checkSymbol(){return!0}setVisible(e){if(this._points&&this._points.length>0)for(let t=0;t<this._points.length;t++)this._points[t].show=e;if(this._labels&&this._labels.length>0)for(let t=0;t<this._labels.length;t++)this._labels[t].show=e;if(this._billboards&&this._billboards.length>0)for(let t=0;t<this._billboards.length;t++)this._billboards[t].show=e;if(this._primitives&&this._primitives.length>0)for(let t=0;t<this._primitives.length;t++)this._primitives[t].show=e}_getCesiumColor(e){return new Cesium.Color(e.red/255,e.green/255,e.blue/255,e.alpha)}_getCesiumColorByOpacity(e,t){return"number"!=typeof t&&(t=1),new Cesium.Color(e.red/255,e.green/255,e.blue/255,e.alpha*t)}_createAppearance(){}_createPrimitive(){}_getPositions(){const e=this._feature.geometry,t=[];switch(e.type){case n.GeometryType.point:t.push(Cesium.Cartographic.fromDegrees(e.coordinates[0],e.coordinates[1],e.coordinates[2]||0));break;case n.GeometryType.multiPoint:case n.GeometryType.lineString:for(let i=0;i<e.coordinates.length;i++)t.push(Cesium.Cartographic.fromDegrees(e.coordinates[i][0],e.coordinates[i][1],e.coordinates[i][2]||0));break;case n.GeometryType.multiLineString:case n.GeometryType.polygon:for(let i=0;i<e.coordinates.length;i++){t.push([]);for(let r=0;r<e.coordinates[i].length;r++)t[i].push(Cesium.Cartographic.fromDegrees(e.coordinates[i][r][0],e.coordinates[i][r][1],e.coordinates[i][r][2]||0))}break;case n.GeometryType.multiPolygon:for(let i=0;i<e.coordinates.length;i++){t.push([]);for(let r=0;r<e.coordinates[i].length;r++){t[i].push([]);for(let n=0;n<e.coordinates[i][r].length;n++)t[i][r].push(Cesium.Cartographic.fromDegrees(e.coordinates[i][r][n][0],e.coordinates[i][r][n][1],e.coordinates[i][r][n][2]))}}break;case n.GeometryType.extent:t.push([]),t[0].push(Cesium.Cartographic.fromDegrees(e.xmin,e.ymin,e.zmin||0)),t[0].push(Cesium.Cartographic.fromDegrees(e.xmax,e.ymin,e.zmin||0)),t[0].push(Cesium.Cartographic.fromDegrees(e.xmax,e.ymax,e.zmin||0)),t[0].push(Cesium.Cartographic.fromDegrees(e.xmin,e.ymax,e.zmin||0)),t[0].push(Cesium.Cartographic.fromDegrees(e.xmin,e.ymin,e.zmin||0));break;case n.GeometryType.circle:const i=e.toPolygon();for(let e=0;e<i.coordinates.length;e++){t.push([]);for(let r=0;r<i.coordinates[e].length;r++)t[e].push(Cesium.Cartographic.fromDegrees(i.coordinates[e][r][0],i.coordinates[e][r][1],i.coordinates[e][r][2]))}}return 0===t.length&&n.Log.error("顶点数组为空,无法正常创建图形!"),t}_addZCoordinate(){const e=this._feature.geometry;if(!e.hasZ)switch(e.type){case n.GeometryType.point:e.coordinates.push(0);break;case n.GeometryType.multiPoint:case n.GeometryType.lineString:for(let t=0;t<e.coordinates.length;t++)e.coordinates[t].push(0);break;case n.GeometryType.multiLineString:case n.GeometryType.polygon:for(let t=0;t<e.coordinates.length;t++)for(let i=0;i<e.coordinates[t].length;i++)e.coordinates[t][i].push(0);break;case n.GeometryType.multiPolygon:for(let t=0;t<e.coordinates.length;t++)for(let i=0;i<e.coordinates[t].length;i++)for(let r=0;r<e.coordinates[t][i].length;r++)e.coordinates[t][i][r].push(0);break;case n.GeometryType.extent:e.zmin=0,e.zmax=0;break;case n.GeometryType.circle:e.center.push(0)}}_removePrimitives(){for(let e=0;this._points&&e<this._points.length;e++)this._pointsCollection.remove(this._points[e]);this._points=[];for(let e=0;this._billboards&&e<this._billboards.length;e++)this._billboardsCollection.remove(this._billboards[e]);this._billboards=[];for(let e=0;this._labels&&e<this._labels.length;e++)this._labelsCollection.remove(this._labels[e]);this._labels=[];for(let e=0;this._primitives&&e<this._primitives.length;e++)this._primitivesCollection.remove(this._primitives[e]);this._primitives=[]}_removeMarkPrimitives(){const e=[];for(let t=0;this._points&&t<this._points.length;t++)this._points[t]._isRemove?this._pointsCollection.remove(this._points[t]):e.push(this._points[t]);this._points=e;const t=[];for(let e=0;this._billboards&&e<this._billboards.length;e++)this._billboards[e]._isRemove?this._billboardsCollection.remove(this._billboards[e]):t.push(this._billboards[e]);this._billboards=t;const i=[];for(let e=0;this._labels&&e<this._labels.length;e++)this._labels[e]._isRemove?this._labelsCollection.remove(this._labels[e]):i.push(this._labels[e]);this._labels=i;const r=[];for(let e=0;this._primitives&&e<this._primitives.length;e++)this._primitives[e]._isRemove?this._primitivesCollection.remove(this._primitives[e]):r.push(this._primitives[e]);this._primitives=r}_markRemovePrimitives(){this._points.forEach(e=>{e._isRemove=!0}),this._billboards.forEach(e=>{e._isRemove=!0}),this._labels.forEach(e=>{e._isRemove=!0}),this._primitives.forEach(e=>{e._isRemove=!0})}_saveBillboard(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._billboards.push(e)}_savePoint(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._points.push(e)}_saveLabel(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._labels.push(e)}};var wh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.SimpleMarkerSymbol||(n.Log.info("要素的符号类型不是SimpleMarkerSymbol!"),!1)}_createPrimitive(e){if(this._feature.symbol.style)switch(this._feature.symbol.style){case"circle":this._addPointPrimitive(e);break;default:this._addBillBoardPrimitive(e)}}_getPositions(){return Th(this._feature)}_symbolEquals(e,t){let i=!0;return e.size===t.size&&e.style===t.style&&e.outline.width===t.outline.width&&e.outline.color.red===t.outline.color.red&&e.outline.color.green===t.outline.color.green&&e.outline.color.blue===t.outline.color.blue&&e.outline.color.alpha===t.outline.color.alpha||(i=!1),("circle"===e.style&&"circle"!==t.style||"circle"!==e.style&&"circle"===t.style)&&(this._primitiveCollection=void 0),i}_addBillBoardPrimitive(e){const t=this._feature.symbol;this._canvas?this._symbolEquals(t,this._symbol)||(this._canvas=Object(n.createSimpleMarkerSymbolCanvas)(t),this._symbol=t):this._canvas=Object(n.createSimpleMarkerSymbolCanvas)(t);const{type:i}=this._feature.geometry,r=this._getPositions();switch(i){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:Ah(this,r[0],e);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:for(let t=0;t<r.length;t++)Ah(this,r[t],e)}}_createBillboardOptions(e,t){return(t=Object(n.defaultValue)(t,{})).graphic=this,Ii.a.createBillboardOptions(e,t)}_addPointPrimitive(e){const t=this._getPositions(),{type:i}=this._feature.geometry;switch(i){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:Rh(this,t[0],e);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:for(let i=0;i<t.length;i++)Rh(this,t[i],e);break;default:n.Log.error("要素的几何类型是不支持的类型!")}}_createPointOptions(e){const t=this._feature.symbol,i=this._getCesiumColor(t.color);i.alpha*=this._layerOpacity;const r=this._getCesiumColor(t.outline.color);r.alpha*=this._layerOpacity;const n=t.extendOptions;let a={position:e,color:i,outlineColor:r,outlineWidth:t.outline.width,pixelSize:t.size};return a=Object.assign(a,n)}};var xh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.PictureMarkerSymbol||(n.Log.info("要素的符号类型不是PictureMarkerSymbol!"),!1)}_getPositions(){return Th(this._feature,this._viewer)}_createPrimitive(e){const{type:t}=this._feature.geometry,i=this._getPositions();switch(t){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:Ah(this,i[0],e);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:for(let t=0;t<i.length;t++)Ah(this,i[t],e)}}_createBillboardOptions(e,t){return(t=Object(n.defaultValue)(t,{})).graphic=this,Ii.a.createBillboardOptions(e,t)}};function Ch(e,t){let i=0;return i=isNaN(e)?t:isNaN(t)?e:e>=t?e:t}function Sh(e,t,i,r){const a=[];for(let e=0;e<t.length;e++)a.push(Cesium.Cartographic.clone(t[0]));Cesium.sampleTerrain(e.terrainProvider,12,a).then(function(e){if(i.mode===n.ElevationMode.RelativeToGround)for(let t=0;t<e.length;t++)e[t].height+=i.offset;r(e)})}function Mh(e,t,i,r,a){const{mode:o,offset:s}=r,l=[];for(let e=0;e<t.length;e++)l.push(Cesium.Cartographic.clone(t[0]));Sh(e,t,r,function(t){e.scene.sampleHeightMostDetailed(l,i,1).then(e=>{const i=[];for(let r=0;r<e.length;r++){const n=e[r]?e[r]:t[r];n.height=Ch(e[r].height,t[r].height),i.push(n)}if(o===n.ElevationMode.RelativeToScene)for(let e=0;e<i.length;e++)i[e].height+=s;a(i)})})}function kh(e){let t=[];const i=e.scene.primitives._primitives;for(let e=0;e<i.length;e++)Cesium.MapGISM3DSet&&i[e]instanceof Cesium.MapGISM3DSet||i[e]instanceof Cesium.Cesium3DTileset||i[e]instanceof Cesium.Model||i[e]instanceof Cesium.ViewportQuad||(i[e]instanceof Cesium.PrimitiveCollection?t=t.concat(i[e]._primitives):i[e]instanceof Cesium.PointPrimitiveCollection?t=t.concat(i[e]._pointPrimitives):t.push(i[e]));return t}function Th(e){const t=e.geometry,i=[];switch(t.type){case n.GeometryType.point:i.push(new Cesium.Cartographic(Cesium.Math.toRadians(t.coordinates[0]),Cesium.Math.toRadians(t.coordinates[1]),t.coordinates[2]||0));break;case n.GeometryType.multiPoint:for(let e=0;e<t.coordinates.length;e++)i.push(new Cesium.Cartographic(Cesium.Math.toRadians(t.coordinates[e][0]),Cesium.Math.toRadians(t.coordinates[e][1]),t.coordinates[e][2]||0));break;case n.GeometryType.polygon:const e=n.Geometry.fromJSON(t).centroid;i.push(new Cesium.Cartographic(Cesium.Math.toRadians(e.coordinates[0]),Cesium.Math.toRadians(e.coordinates[1]),e.coordinates[2]||0));break;case n.GeometryType.multiPolygon:const r=n.Geometry.fromJSON(t).toPolygonArray();for(let e=0;e<r.length;e++){const t=r[e].centroid;i.push(new Cesium.Cartographic(Cesium.Math.toRadians(t.coordinates[0]),Cesium.Math.toRadians(t.coordinates[1]),t.coordinates[2]||0))}break;case n.GeometryType.extent:i.push(new Cesium.Cartographic(Cesium.Math.toRadians((t.xmin+t.xmax)/2),Cesium.Math.toRadians((t.ymin+t.ymax)/2),(t.zmin+t.zmax)/2||0));break;case n.GeometryType.circle:i.push(new Cesium.Cartographic(Cesium.Math.toRadians(t.center[0]),Cesium.Math.toRadians(t.center[1]),t.center[2]||0))}return i}function Ih(e){let t=void 0;switch(e){case n.ElevationMode.OnTheGround:t=Cesium.ClassificationType.TERRAIN;break;case n.ElevationMode.OnTheScene:t=Cesium.ClassificationType.BOTH}return t}function Oh(e,t){let i=void 0;switch(t){case"dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:32});break;case"dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:32,maskIndexFactor:2,maskTestFactor:1.5});break;case"dot":i=Cesium.Material.fromType("PolylineDash",{color:e,gapColor:new Cesium.Color(0,0,0,0),dashPattern:240});break;case"long-dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:64});break;case"long-dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:64,maskIndexFactor:2,maskTestFactor:1.5});break;case"long-dash-dot-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:64,maskIndexFactor:2});break;case"short-dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:16});break;case"short-dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:32,maskIndexFactor:2,maskTestFactor:1.5});break;case"short-dash-dot-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:32,maskIndexFactor:2});break;default:i=Cesium.Material.fromType("Color",{color:e})}return i}function Eh(e,t){return"number"!=typeof t&&(t=1),new Cesium.Color(e.red/255,e.green/255,e.blue/255,e.alpha*t)}function Lh(e,t){const i=e._viewer,r=e._feature;let a,o=Cesium.HeightReference.NONE;return r.elevationInfo.mode===n.ElevationMode.OnTheGround&&(o=Cesium.HeightReference.CLAMP_TO_GROUND),r.elevationInfo.mode===n.ElevationMode.RelativeToGround&&(t[2]=e._feature.elevationInfo.offset,o=Cesium.HeightReference.RELATIVE_TO_GROUND),r.elevationInfo.mode===n.ElevationMode.OnTheScene&&(a=i.scene.sampleHeight(new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1]),0)),t[2]=a),r.elevationInfo.mode===n.ElevationMode.RelativeToScene&&(a=i.scene.sampleHeight(new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1]),0)),t[2]=a+r.elevationInfo.offset),r.elevationInfo.mode===n.ElevationMode.AbsoluteHeight&&(t[2]+=e._feature.elevationInfo.offset),{heightReference:o,position:Ii.a.toCartesian3Position(t,"degrees")}}function Ph(e,t,i){const r=e._viewer,a=e._feature,{mode:o}=a.elevationInfo;switch(o){case n.ElevationMode.OnTheGround:case n.ElevationMode.RelativeToGround:Sh(r,t,a.elevationInfo,function(e){i(e)});break;case n.ElevationMode.OnTheScene:case n.ElevationMode.RelativeToScene:Mh(r,t,kh(r),a.elevationInfo,function(e){i(e)})}}function Rh(e,t,i){const r=e._feature,{mode:a}=r.elevationInfo;switch(a){case n.ElevationMode.AbsoluteHeight:default:const r=e._pointsCollection.add(e._createPointOptions(Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,t.height)));e._savePoint(r),i&&i instanceof Function&&i();break;case n.ElevationMode.OnTheGround:case n.ElevationMode.RelativeToGround:case n.ElevationMode.OnTheScene:case n.ElevationMode.RelativeToScene:Ph(e,[t],function(t){const r=e._pointsCollection.add(e._createPointOptions(Cesium.Cartesian3.fromRadians(t[0].longitude,t[0].latitude,t[0].height)));e._savePoint(r),i&&i instanceof Function&&i()})}}function jh(e,t,i){const r=e._feature.symbol;let n=e._createBillboardOptions(Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,t.height),i);n=Object.assign(n,r.extendOptions);const a=e._billboardsCollection.add(n);e._saveBillboard(a)}function Ah(e,t,i){const r=e._viewer,a=e._feature,{mode:o}=a.elevationInfo;switch(o){case n.ElevationMode.AbsoluteHeight:default:jh(e,t),i&&i instanceof Function&&i();break;case n.ElevationMode.OnTheGround:case n.ElevationMode.RelativeToGround:r.scene.globe.depthTestAgainstTerrain?(jh(e,t,{heightReference:o===n.ElevationMode.OnTheGround?Cesium.HeightReference.CLAMP_TO_GROUND:Cesium.HeightReference.RELATIVE_TO_GROUND}),i&&i instanceof Function&&i()):Ph(e,[t],function(t){jh(e,t[0]),i&&i instanceof Function&&i()});break;case n.ElevationMode.OnTheScene:case n.ElevationMode.RelativeToScene:Ph(e,[t],function(t){jh(e,t[0]),i&&i instanceof Function&&i()})}}function zh(e){let t=!1;return e.elevationInfo.mode!==n.ElevationMode.OnTheGround&&e.elevationInfo.mode!==n.ElevationMode.OnTheScene&&e.elevationInfo.mode!==n.ElevationMode.RelativeToGround&&e.elevationInfo.mode!==n.ElevationMode.RelativeToScene||(t=!0),t}function Dh(e,t,i,r){let a,o;switch(t){case n.SymbolType.pictureMarker:return a=e.resource,o=new n.PictureMarkerSymbol({width:e.size,height:e.size,url:a.href}),new n.Feature({geometry:new n.Point({coordinates:[Cesium.Math.toDegrees(i.longitude),Cesium.Math.toDegrees(i.latitude),i.height]}),symbol:o,elevationInfo:r.elevationInfo.clone()});case n.SymbolType.simpleMarker:default:return a=e.resource,o=new n.SimpleMarkerSymbol({style:a.primitive,size:e.size,color:e.material.color,outline:new n.SimpleLineSymbol({color:e.outline.color,width:e.outline.size})}),new n.Feature({geometry:new n.Point({coordinates:[Cesium.Math.toDegrees(i.longitude),Cesium.Math.toDegrees(i.latitude),i.height]}),symbol:o,elevationInfo:r.elevationInfo.clone()});case n.SymbolType.mapgisText:const s=n.Font.fromJSON(e.font);return s.size=e.size,o=new n.MapGISTextSymbol({text:e.text,verticalAlignment:e.verticalAlignment,horizontalAlignment:e.horizontalAlignment,font:s,haloColor:e.halo.color,haloSize:e.halo.size,backgroundColor:e.background,lineHeight:e.lineHeight,color:e.material.color}),new n.Feature({geometry:new n.Point({coordinates:[Cesium.Math.toDegrees(i.longitude),Cesium.Math.toDegrees(i.latitude),i.height]}),symbol:o,elevationInfo:r.elevationInfo.clone()})}}var Vh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.SimpleLineSymbol||(n.Log.info("要素的符号类型不是SimpleLineSymbol!"),!1)}_createPrimitive(e){const t=this._feature.geometry;switch(t.type){case n.GeometryType.lineString:this._addPrimitiveByElevationMode(this._getPositions(),new n.LineString({coordinates:t.coordinates}),e);break;case n.GeometryType.multiLineString:const i=this._getPositions();for(let r=0;r<i.length;r++)this._addPrimitiveByElevationMode(i[r],new n.LineString({coordinates:t.coordinates[r]}),e)}}_addPrimitiveByElevationMode(e,t,i){const{mode:r}=this._elevationInfo;switch(r){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.OnTheScene:case n.ElevationMode.OnTheGround:default:this._addLinePrimitive(e),i&&i instanceof Function&&i();break;case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:const a=n.GeometryEngine.getCenterOID(t),o=[Cesium.Cartographic.fromDegrees(a.coordinates[0],a.coordinates[1],0)];if(r===n.ElevationMode.RelativeToGround)Sh(this._viewer,o,this._elevationInfo,t=>{this._addLinePrimitive(e,t[0].height),i&&i instanceof Function&&i()});else{const t=kh(this._viewer);Mh(this._viewer,o,t,this._elevationInfo,t=>{this._addLinePrimitive(e,t[0].height),i&&i instanceof Function&&i()})}}}_addLinePrimitive(e,t){const i=this._feature.symbol,r=this._getCesiumColor(i.color);r.alpha*=this._layerOpacity;const a=i.width;let o;const s=[],{mode:l}=this._elevationInfo;switch(l){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:default:for(let t=0;t<e.length;t++)s.push(Cesium.Cartesian3.fromRadians(e[t].longitude,e[t].latitude,e[t].height));break;case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:let i=0;for(let t=0;t<e.length;t++)e[t].height<i&&(i=e[t].height);for(let r=0;r<e.length;r++)s.push(Cesium.Cartesian3.fromRadians(e[r].longitude,e[r].latitude,e[r].height-i+t))}let h=Cesium.ArcType.NONE;switch(this._feature.geometry&&this._feature.geometry.extendOptions&&this._feature.geometry.extendOptions.arcType&&(h=this._feature.geometry.extendOptions.arcType),l){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:default:o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:s,width:a,arcType:h}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),show:this.show,appearance:this._createAppearance(),asynchronous:!1});break;case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:h===Cesium.ArcType.NONE&&(h=Cesium.ArcType.GEODESIC);const e=Ih(l),t=new Cesium.GroundPolylineGeometry({positions:s,width:a,arcType:h});o=new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:t,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),show:this.show,appearance:this._createAppearance(),asynchronous:!1,classificationType:e})}const c=this._primitivesCollection.add(o);this._savePrimitive(c)}_createAppearance(){const e=this._feature.symbol;let t=void 0;switch(this._feature.geometry.type){case n.GeometryType.lineString:case n.GeometryType.multiLineString:switch(e.type){case n.SymbolType.simpleLine:switch(e.style){case"dash":case"dash-dot":case"dot":case"long-dash":case"long-dash-dot":case"long-dash-dot-dot":case"short-dash":case"short-dash-dot":case"short-dash-dot-dot":return t=this._createLineMaterial(),new Cesium.PolylineMaterialAppearance({material:t,translucent:!1,renderState:{depthTest:{enabled:!0}}});case"solid":default:return t=Cesium.Material.fromType("Color",{color:this._getCesiumColor(e.color)}),new Cesium.PolylineColorAppearance({material:t,renderState:{depthTest:{enabled:!0}}})}}break;default:n.Log.error("要素几何为不支持的类型!")}}_createLineMaterial(){const e=this._feature.symbol,t=this._getCesiumColor(e.color);t.alpha*=this._layerOpacity;let i=void 0;switch(e.style){case"dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:32});break;case"dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:32,maskIndexFactor:2,maskTestFactor:1.5});break;case"dot":i=Cesium.Material.fromType("PolylineDash",{color:t,gapColor:new Cesium.Color(0,0,0,0),dashPattern:240});break;case"long-dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:64});break;case"long-dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:64,maskIndexFactor:2,maskTestFactor:1.5});break;case"long-dash-dot-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:64,maskIndexFactor:2});break;case"short-dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:16});break;case"short-dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:32,maskIndexFactor:2,maskTestFactor:1.5});break;case"short-dash-dot-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:32,maskIndexFactor:2});break;default:i=Cesium.Material.fromType("Color",{color:t})}return i}_savePrimitive(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._primitives.push(e)}};function Nh(e,t,i){const r=Lh((i=Object(n.defaultValue)(i,{show:!0,layerOpacity:1})).graphic,t),a=e.material,o=e.anchorPosition,s=function(e){const t={horizontalOrigin:void 0,verticalOrigin:void 0};switch(e){case n.AnchorType.center:default:t.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.verticalOrigin=Cesium.VerticalOrigin.CENTER;break;case n.AnchorType.left:t.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,t.verticalOrigin=Cesium.VerticalOrigin.CENTER;break;case n.AnchorType.right:t.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,t.verticalOrigin=Cesium.VerticalOrigin.CENTER;break;case n.AnchorType.top:t.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case n.AnchorType.bottom:t.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.verticalOrigin=Cesium.VerticalOrigin.BOTTOM;break;case n.AnchorType.topLeft:t.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,t.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case n.AnchorType.topRight:t.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,t.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case n.AnchorType.bottomLeft:t.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,t.verticalOrigin=Cesium.VerticalOrigin.BOTTOM;break;case n.AnchorType.bottomRight:t.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,t.verticalOrigin=Cesium.VerticalOrigin.BOTTOM}return t}(e.anchor);return{show:i.show,position:r.position,image:i.image,color:Eh(a.color,i.layerOpacity),width:e.size,height:e.size,horizontalOrigin:s.horizontalOrigin,verticalOrigin:s.verticalOrigin,pixelOffset:new Cesium.Cartesian2(o.coordinates[0],-1*o.coordinates[1]),heightReference:r.heightReference}}function Gh(e,t,i){const r=Lh((i=Object(n.defaultValue)(i,{show:!0,layerOpacity:1})).graphic,t),a=e.material,o=e.font;let s,l;switch(e.horizontalAlignment){case n.HorizontalAlignment.center:default:s=Cesium.HorizontalOrigin.CENTER;break;case n.HorizontalAlignment.right:s=Cesium.HorizontalOrigin.RIGHT;break;case n.HorizontalAlignment.left:s=Cesium.HorizontalOrigin.LEFT}switch(e.verticalAlignment){case n.VerticalAlignment.baseline:default:l=Cesium.VerticalOrigin.BASELINE;break;case n.VerticalAlignment.top:l=Cesium.VerticalOrigin.TOP;break;case n.VerticalAlignment.bottom:l=Cesium.VerticalOrigin.BOTTOM;break;case n.VerticalAlignment.middle:l=Cesium.VerticalOrigin.CENTER}return{show:i.show,position:r.position,text:e.text,fillColor:Eh(a.color,i.layerOpacity),font:`${e.size} ${o.family}`,backgroundColor:Eh(e.background,i.layerOpacity),horizontalOrigin:s,verticalOrigin:l,heightReference:r.heightReference}}function Fh(e,t,i){const r=Lh((i=Object(n.defaultValue)(i,{show:!0,layerOpacity:1})).graphic,t),a=e.material,o=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(r.position[0],r.position[1],r.position[2])),s={show:i.show,url:e.resource.href,shadows:e.castShadows,scale:1,color:Eh(a.color,i.layerOpacity),modelMatrix:o,asynchronous:!1,heightReference:r.heightReference};return Cesium.Model.fromGltf(s)}function Bh(e,t){t=Object(n.defaultValue)(t,{layerOpacity:1});const i=e.material;switch(i.type){case n.MaterialType.color:default:return new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:Eh(i.color,t.layerOpacity)})})}}function qh(e,t,i){i=Object(n.defaultValue)(i,{show:!0,layerOpacity:1});const r=e.material,a=new Cesium.EllipsoidGeometry({radii:new Cesium.Cartesian3(e.width,e.height,e.depth),innerRadii:new Cesium.Cartesian3(e.width,e.height,e.depth)}),o=Cesium.Transforms.eastNorthUpToFixedFrame(t);return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:a,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Eh(r.color,i.layerOpacity))}}),show:i.show,modelMatrix:o,appearance:Bh(e,{layerOpacity:i.layerOpacity}),asynchronous:!1})}function Uh(e,t,i){i=Object(n.defaultValue)(i,{topRadius:0,bottomRadius:0,slices:128,layerOpacity:1,show:!0});const r=e.material,a=Cesium.Transforms.eastNorthUpToFixedFrame(t),o=new Cesium.CylinderGeometry({topRadius:i.topRadius,bottomRadius:i.bottomRadius,length:e.depth,slices:i.slices});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:o,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Eh(r.color,i.layerOpacity))}}),show:i.show,modelMatrix:a,appearance:Bh(e,{layerOpacity:i.layerOpacity}),asynchronous:!1})}function Wh(e){let t=Cesium.ShadowMode.DISABLED;return e.castShadows&&(t=Cesium.ShadowMode.ENABLED),t}function Hh(e){const t=e.color,i=e.outline.color;return{color:new Cesium.Color(t.red/255,t.green/255,t.blue/255,t.alpha),pixelSize:e.size,show:"none"!==e.style,outlineColor:new Cesium.Color(i.red/255,i.green/255,i.blue/255,i.alpha),outlineWidth:e.outline.width}}var Yh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.SimpleFillSymbol||(n.Log.info("要素的符号类型不是SimpleFillSymbol!"),!1)}_createPrimitive(e){const{type:t}=this._feature.geometry,i=this._getPositions();switch(t){case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:default:this._addPrimitiveByElevationMode(i,e);break;case n.GeometryType.multiPolygon:for(let t=0;t<i.length;t++)this._addPrimitiveByElevationMode(i[t],e)}}_addPrimitiveByElevationMode(e,t){const{mode:i}=this._elevationInfo;switch(i){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:default:this._addPolygonPrimitive(e),this._addPolygonOutlinePrimitive(e),t&&t instanceof Function&&t();break;case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:const r=n.GeometryEngine.getCenterOID(this._feature.geometry),a=[Cesium.Cartographic.fromDegrees(r.coordinates[0],r.coordinates[1],0)];if(i===n.ElevationMode.RelativeToGround)Sh(this._viewer,a,this._elevationInfo,i=>{this._addPolygonPrimitive(e,i[0].height),this._addPolygonOutlinePrimitive(e,i[0].height),t&&t instanceof Function&&t()});else{const i=kh(this._viewer);Mh(this._viewer,a,i,this._elevationInfo,i=>{this._addPolygonPrimitive(e,i[0].height),this._addPolygonOutlinePrimitive(e,i[0].height),t&&t instanceof Function&&t()})}}}_addPolygonPrimitive(e,t){const i=this._feature.symbol,r=this._getCesiumColor(i.color);let a;const o=[],{mode:s}=this._elevationInfo;switch(s){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:default:for(let t=0;t<e.length;t++){o.push([]);for(let i=0;i<e[t].length;i++)o[t].push(Cesium.Cartesian3.fromRadians(e[t][i].longitude,e[t][i].latitude,e[t][i].height))}break;case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:for(let i=0;i<e.length;i++){o.push([]);for(let r=0;r<e[i].length;r++)o[i].push(Cesium.Cartesian3.fromRadians(e[i][r].longitude,e[i][r].latitude,t))}}const l=[];for(let e=1;e<o.length;e++)l.push(new Cesium.PolygonHierarchy(o[e]));let h=void 0;const c=this._feature.geometry;let u;c.type===n.GeometryType.extent&&(h=c.zmax);let d=!0;this._feature.geometry&&this._feature.geometry.extendOptions&&this._feature.geometry.extendOptions.arcType&&(u=this._feature.geometry.extendOptions.arcType,d=!1);const p=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(o[0],l),extrudedHeight:h,perPositionHeight:d,arcType:u}),f=new Cesium.MaterialAppearance({material:this._createPolygonMaterial(),translucent:!1,renderState:{depthTest:{enabled:!0}}});switch(s){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:default:a=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:p,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),appearance:f,asynchronous:!1});break;case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:const e=Ih(s);a=new Cesium.GroundPrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:p,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),appearance:f,asynchronous:!1,classificationType:e})}const m=this._primitivesCollection.add(a);this._savePrimitive(m)}_addPolygonOutlinePrimitive(e,t){const i=this._feature.symbol.outline,{geometry:r}=this._feature,{type:a}=r;let o,s=[];switch(a){case n.GeometryType.polygon:default:for(let t=0;t<e.length;t++){s.push([]);for(let i=0;i<e[t].length;i++)s[t].push([Cesium.Math.toDegrees(e[t][i].longitude),Cesium.Math.toDegrees(e[t][i].latitude),e[t][i].height]);s[t].push([s[t][0][0]+(s[t][1][0]-s[t][0][0])/1e4,s[t][0][1]+(s[t][1][1]-s[t][0][1])/1e4,s[t][0][2]+(s[t][1][2]-s[t][0][2])/1e4])}break;case n.GeometryType.circle:s.push([]),s=r.toPolygon().coordinates;break;case n.GeometryType.extent:s.push([]),s[0].push([r.xmin,r.ymin,r.zmin||0]),s[0].push([r.xmax,r.ymin,r.zmin||0]),s[0].push([r.xmax,r.ymax,r.zmin||0]),s[0].push([r.xmin,r.ymax,r.zmin||0]),s[0].push([r.xmin,r.ymin,r.zmin||0]),s[0].push([s[0][0][0]+(s[0][1][0]-s[0][0][0])/1e4,s[0][0][1]+(s[0][1][1]-s[0][0][1])/1e4,s[0][0][2]+(s[0][1][2]-s[0][0][2])/1e4])}if(this._elevationInfo.mode===n.ElevationMode.RelativeToGround||this._elevationInfo.mode===n.ElevationMode.RelativeToScene){o=new n.ElevationInfo({mode:n.ElevationMode.AbsoluteHeight});for(let e=0;e<s.length;e++){let i=0;for(let t=0;t<s[e].length;t++)i<s[e][t][2]&&(i=s[e][t][2]);for(let r=0;r<s[e].length;r++)s[e][r][2]=s[e][r][2]-i+t}}else o=this._elevationInfo;const l=new n.MultiLineString({coordinates:s,extendOptions:r.extendOptions}),h=new n.Feature({geometry:l,symbol:i,elevationInfo:o,visible:this.show}),c=new Vh({feature:h,layerOpacity:this._layerOpacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});this._primitives=this._primitives.concat(c._primitives)}_createPolygonMaterial(){const e=this._feature.symbol;let t;switch(e.style){case"backward-diagonal":case"cross":case"diagonal-cross":case"forward-diagonal":case"horizontal":case"vertical":this._canvas?(this._symbol||(this._symbol=this._feature.symbol),this._symbolEquals(e,this._symbol)||(this._canvas=Object(n.createSimpleFillSymbolCanvas)(e),this._symbol=e)):this._canvas=Object(n.createSimpleFillSymbolCanvas)(e,{lineWidth:1}),t=Cesium.Material.fromType("Image",{image:this._canvas,repeat:new Cesium.Cartesian2(1,1),color:new Cesium.Color(1,1,1,this._layerOpacity)});break;default:const i=this._getCesiumColor(e.color);i.alpha*=this._layerOpacity,t=Cesium.Material.fromType("Color",{color:i})}return t}_symbolEquals(e,t){return e.style===t.style&&e.color.red===t.color.red&&e.color.green===t.color.green&&e.color.blue===t.color.blue&&e.color.alpha===t.color.alpha&&e.outline.width===t.outline.width&&e.outline.color.red===t.outline.color.red&&e.outline.color.green===t.outline.color.green&&e.outline.color.blue===t.outline.color.blue&&e.outline.color.alpha===t.outline.color.alpha}_savePrimitive(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._primitives.push(e)}};var Xh=class extends Yh{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.PictureFillSymbol||(n.Log.info("要素的符号类型不是PictureFillSymbol!"),!1)}_createPolygonMaterial(){const e=this._feature.symbol,{url:t,xscale:i,yscale:r}=e;return new Cesium.Material({fabric:{type:"Image",uniforms:{color:new Cesium.Color(1,1,1,this._layerOpacity),image:t,repeat:{x:1/i,y:1/r}}}})}};var Jh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.MapGISTextSymbol||this._feature.symbol instanceof n.TextSymbol||(n.Log.info("要素的符号类型不是MapGISTextSymbol!"),!1)}_createPrimitive(e){const{type:t}=this._feature.geometry,i=this._getPositions();switch(t){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:Ah(this,i[0],e);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:for(let t=0;t<i.length;t++)Ah(this,i[t],e)}}_getPositions(){return Th(this._feature,this._viewer)}_createBillboardOptions(e,t){(t=Object(n.defaultValue)(t,{})).heightReference=Object(n.defaultValue)(t.heightReference,Cesium.HeightReference.NONE);const i=this._feature.symbol;let r=(Cesium.DynamicLabelsUtil||Li.a).createNoteBillBoardOptions(this._feature.id,i.text,e,Ii.a.convertTextSymbolToLabelNoteStyle(i,{layerOpacity:this._layerOpacity}));return r.verticalOrigin=Cesium.VerticalOrigin.BOTTOM,r.heightReference=t.heightReference,r=Object.assign(r,this._feature.symbol.extendOptions)}};var $h=class{constructor(e){e=Object(n.defaultValue)(e,{}),this.id=Object(n.defaultValue)(e.id,Object(n.getGUID)()),this._viewer=e.viewer,this._renderer=e.renderer,this._dataSource=new Cesium.CustomDataSource(this.id),this._initCluster()}_initCluster(){this._dataSourcePromise=this._viewer.dataSources.add(this._dataSource,{camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas});const e=this;this._dataSourcePromise.then(function(t){t.clustering.enabled=!0,t.clustering.pixelRange=e._renderer.radius,t.clustering.clusterEvent.addEventListener(function(t,i){i.label.show=!1,i.billboard.show=!1,i.point.show=!1;const r=e._renderer.clusterInfos,n=e._renderer.defaultSymbol,a=e._renderer.defaultLabelSymbol;if(r instanceof Array&&r.length>0){let o=!1;for(let n=0;n<r.length;n++)if(t.length>=r[n].minValue&&t.length<r[n].maxValue){e._setClusterEntity(i,r[n].symbol,r[n].labelSymbol),o=!0;break}o||e._setClusterEntity(i,n,a)}else e._setClusterEntity(i,n,a)})})}_setClusterEntity(e,t,i){switch(t.type){case n.SymbolType.simpleMarker:switch(t.style){case"circle":this._setClusterPoint(e,t),i&&this._setClusterLabel(e,i,{});break;default:this._setClusterBillBoard(e,t),i&&this._setClusterLabel(e,i,{})}break;case n.SymbolType.pictureMarker:this._setClusterBillBoard(e,t),i&&this._setClusterLabel(e,i,{pictureMarkerSymbol:t})}}_setClusterLabel(e,t,i){i=Object(n.defaultValue)(i,{});const r=Object(n.defaultValue)(i.pictureMarkerSymbol,void 0);t&&t instanceof n.TextSymbol&&(e.label.show=!0,e.label.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,e.label.verticalOrigin=Cesium.VerticalOrigin.CENTER,e.label.font=`${t.font.size}px ${t.font.family}`,e.label.fillColor=new Cesium.Color(t.color.red/255,t.color.green/255,t.color.blue/255,t.color.alpha)),r&&r instanceof n.PictureMarkerSymbol&&(e.label.pixelOffset=new Cesium.Cartesian2(t.xoffset,-1*t.yoffset+-1*r.height))}_setClusterBillBoard(e,t){t&&(t instanceof n.PictureMarkerSymbol?(e.billboard.show=!0,e.billboard.image=t.url,e.billboard.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,e.billboard.verticalOrigin=Cesium.VerticalOrigin.CENTER,e.billboard.width=t.width,e.billboard.height=t.height,e.billboard.pixelOffset=new Cesium.Cartesian2(t.xoffset,t.yoffset),e.billboard.rotation=Cesium.Math.toRadians(t.angle)):t instanceof n.SimpleMarkerSymbol&&(e.billboard.show=!0,e.billboard.image=Object(n.createSimpleMarkerSymbolCanvas)(t),e.billboard.width=t.size,e.billboard.height=t.size,e.billboard.pixelOffset=new Cesium.Cartesian2(t.xoffset,t.yoffset),e.billboard.rotation=Cesium.Math.toRadians(t.angle)))}_setClusterPoint(e,t){const i=Hh(t);e.point.show=!0,e.point.color=i.color,e.point.color=e.point.color.withAlpha(.75),e.point.pixelSize=i.pixelSize,e.point.outlineColor=i.outlineColor,e.point.outlineWidth=i.outlineWidth}add(e){let t,i,r;switch((e=Object(n.defaultValue)(e,{})).geometry.type){case n.GeometryType.multiPolygon:i=e.geometry.coordinates;for(let a=0;a<i.length;a++)r=new n.Polygon({coordinates:i[a],spatialReference:e.geometry.spatialReference}),t=n.GeometryEngine.getCenterOID(r),this._addEntity(e,t);break;case n.GeometryType.multiLineString:i=e.geometry.coordinates;for(let a=0;a<i.length;a++)r=new n.LineString({coordinates:i[a],spatialReference:e.geometry.spatialReference}),t=n.GeometryEngine.getCenterOID(r),this._addEntity(e,t);break;case n.GeometryType.multiPoint:i=e.geometry.coordinates;for(let t=0;t<i.length;t++)r=new n.Point({coordinates:i[t],spatialReference:e.geometry.spatialReference}),this._addEntity(e,r);break;default:t=n.GeometryEngine.getCenterOID(e.geometry),this._addEntity(e,t)}}_addEntity(e,t){const i={position:Cesium.Cartesian3.fromDegrees(t.coordinates[0],t.coordinates[1],1e3)},r=e.symbol;switch(r.type){case n.SymbolType.simpleMarker:switch(r.style){case"circle":i.point=Hh(r),i.point.id=e.id;break;default:i.billboard=function(e){return{show:"none"!==e.style,image:Object(n.createSimpleMarkerSymbolCanvas)(e)}}(r),i.billboard.id=e.id}break;case n.SymbolType.pictureMarker:i.billboard=function(e){return{image:e.url,width:e.width,height:e.height,pixelOffset:new Cesium.Cartesian2(e.xoffset,e.yoffset),rotation:Cesium.Math.toRadians(e.angle)}}(r),i.billboard.id=e.id}this._dataSource.entities.add(i)}setVisible(e){this._dataSource.entities.show=e}destroy(){this._dataSource.entities.removeAll()}};var Kh=class{constructor(e){e=Object(n.defaultValue)(e,{}),this.id=Object(n.defaultValue)(e.id,Object(n.getGUID)()),this._field=Object(n.defaultValue)(e.field,void 0),this._valueExpression=Object(n.defaultValue)(e.valueExpression,void 0),this._features=Object(n.defaultValue)(e.features,[]),this._radius=Object(n.defaultValue)(e.radius,void 0),this._radiusFactor=Object(n.defaultValue)(e.radiusFactor,60),this._minDataValue=Object(n.defaultValue)(e.minDataValue,0),this._maxDataValue=Object(n.defaultValue)(e.maxDataValue,0),this._minCanvasSize=Object(n.defaultValue)(e.minCanvasSize,700),this._maxCanvasSize=Object(n.defaultValue)(e.maxCanvasSize,2e3),this._spacingFactor=Object(n.defaultValue)(e.spacingFactor,1.5),this._opacity=Object(n.defaultValue)(e.opacity,1),this._blur=Object(n.defaultValue)(e.blur,.85),this._gradient=Object(n.defaultValue)(e.gradient,{}),this._canChange=Object(n.defaultValue)(e.canChange,!0),this._viewer=Object(n.defaultValue)(e.viewer,void 0),this._heatMap=void 0,this._initHeatMap()}_initHeatMap(){this._viewer||n.Log.error("Cesium视图对象不能为空!"),this._features&&this._features instanceof Array||n.Log.error("热力图数据不能为空或者不是数组!"),this._field||this._valueExpression||n.Log.error("字段名或字段表达式不能为空!");const e=this._getHeatMapData(),t=this._getBounds(e),i=this._getGradient();this._heatMap=Cesium.CesiumHeatmap.create(this._viewer,t,{radius:this._radius,radiusFactor:this._radiusFactor,minCanvasSize:this._minCanvasSize,maxCanvasSize:this._maxCanvasSize,spacingFactor:this._spacingFactor,alpha:this._opacity,blur:this._blur,gradient:i,canChange:this._canChange}),this._heatMap.setWGS84Data(this._minDataValue,this._maxDataValue,e)}_getBounds(e){const t=[[]];for(let i=0;i<e.length;i++)t[0].push([e[i].x,e[i].y]);t[0].push(t[0][0]);const i=new n.Polygon({coordinates:t});return{west:i.extent.xmin,east:i.extent.xmax,south:i.extent.ymin,north:i.extent.ymax}}_getHeatMapData(){const e=[];for(let t=0;t<this._features.length;t++){const i=this._features[t],r=i.geometry;let a;switch(this._valueExpression?(a=Ii.a.parseExpression(i,this._valueExpression),a=Number(a)):a=Number(i.attributes[this._field]),r.type){case n.GeometryType.point:e.push({x:r.coordinates[0],y:r.coordinates[1],value:a});break;case n.GeometryType.multiPoint:for(let t=0;t<r.coordinates.length;t++)e.push({x:r.coordinates[t][0],y:r.coordinates[t][1],value:a});break;case n.GeometryType.lineString:e.push({x:r.extent.center.coordinates[0],y:r.extent.center.coordinates[1],value:a});break;case n.GeometryType.multiLineString:for(let i=0;i<r.coordinates.length;i++){const i=new n.LineString({coordinates:r.coordinates[t]});e.push({x:i.extent.center.coordinates[0],y:i.extent.center.coordinates[1],value:a})}break;case n.GeometryType.polygon:e.push({x:r.centroid.coordinates[0],y:r.centroid.coordinates[1],value:a});break;case n.GeometryType.multiPolygon:for(let i=0;i<r.coordinates.length;i++){const i=new n.Polygon({coordinates:r.coordinates[t]});e.push({x:i.centroid.coordinates[0],y:i.centroid.coordinates[1],value:a})}break;case n.GeometryType.extent:e.push({x:r.center.coordinates[0],y:r.center.coordinates[1],value:a});break;case n.GeometryType.circle:e.push({x:r.center[0],y:r.center[1],value:a})}}return e}_getGradient(){const e={};for(let t=0;t<this._gradient.length;t++)e[this._gradient[t].ratio]=this._gradient[t].color.toCssRGBAString();return e}destroy(){this._heatMap.removeLayer()}};var Zh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.LineSymbol3D||(n.Log.info("要素的符号类型不是SimpleLineSymbol!"),!1)}update(e){this._feature=e,this.destroy(),this._createPrimitive()}destroy(){this._primitivesCollection&&this._primitivesCollection.removeAll()}_createPrimitive(){const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;for(let i=0;i<e.items.length;i++){const r=e.items[i];switch(r.type){case n.Symbol3DLayerType.line:default:switch(t.type){case n.GeometryType.lineString:const e=this._primitivesCollection.add(this._createLineSymbol3DLayerPrimitive(r,this._getPositions()));e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._primitives.push(e);break;case n.GeometryType.multiLineString:const i=this._getPositions();for(let e=0;e<i.length;e++){const t=this._primitivesCollection.add(this._createLineSymbol3DLayerPrimitive(r,i[e]));t.id=this._feature.id,t.commonFeatureId=this._feature.id,t.commonLayerId=this.commonLayerId,this._primitives.push(t)}}break;case n.Symbol3DLayerType.path:switch(t.type){case n.GeometryType.lineString:case n.GeometryType.arc:const e=this._primitivesCollection.add(this._createPathSymbol3DLayerPrimitive(r,this._getPositions()));e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._primitives.push(e);break;case n.GeometryType.multiLineString:const i=this._getPositions();for(let e=0;e<i.length;e++){const t=this._primitivesCollection.add(this._createPathSymbol3DLayerPrimitive(r,i[e]));t.id=this._feature.id,t.commonFeatureId=this._feature.id,t.commonLayerId=this.commonLayerId,this._primitives.push(t)}}}}}_createLineSymbol3DLayerPrimitive(e,t){const i=[];t.forEach(e=>{i.push(Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,e.height))});const r=e.material;let a,o=Cesium.ArcType.NONE;if(this._feature.geometry&&this._feature.geometry.extendOptions&&this._feature.geometry.extendOptions.arcType&&(o=this._feature.geometry.extendOptions.arcType),this._elevationInfo.mode===n.ElevationMode.AbsoluteHeight)a=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:i,width:e.size,arcType:o}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(r.color,this._layerOpacity))}}),show:this.show,appearance:this._createLineAppearance(e),asynchronous:!1});else{const t=Ih(this._elevationInfo.mode),n=new Cesium.GroundPolylineGeometry({positions:i,width:e.size,loop:!1});a=new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:n,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(r.color,this._layerOpacity))}}),show:this.show,appearance:this._createAppearance(),asynchronous:!1,classificationType:t})}return a}_createLineAppearance(e){const t=e.pattern,i=e.material,r=e.marker;let a=void 0;switch(i.type){case n.MaterialType.color:default:switch(t.style){case"dash":case"dash-dot":case"dot":case"long-dash":case"long-dash-dot":case"long-dash-dot-dot":case"short-dash":case"short-dash-dot":case"short-dash-dot-dot":return a=Oh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style),new Cesium.PolylineMaterialAppearance({material:a,translucent:!1,renderState:{depthTest:{enabled:!0}}});case"solid":default:if(r){let e=r.color;switch(e||(e=i.color),r.style){case n.LineMarkerStyle.arrow:a=Cesium.Material.fromType("PolylineArrow",{color:this._getCesiumColorByOpacity(e,this._layerOpacity)});break;default:a=Oh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style)}}else a=Oh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style);return new Cesium.PolylineColorAppearance({material:a,renderState:{depthTest:{enabled:!0}}})}}}_createPathSymbol3DLayerPrimitive(e,t){const i=[];switch(t.forEach(e=>{i.push(Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,e.height))}),e.profile){case n.ProfileType.circle:default:return this._createPolylineVolumePrimitive(e,i);case n.ProfileType.quad:return this._createCorridorPrimitive(e,i)}}_createPolylineVolumePrimitive(e,t){const i=e.material,r=this._getCesiumColorByOpacity(i.color,this._layerOpacity),n=this._getCornerType(e),a=new Cesium.PolylineVolumeGeometry({polylinePositions:t,shapePositions:this._computeCircle(e.width>e.height?e.width:e.height),cornerType:n});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:a,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),show:this.show,appearance:this._createPathAppearance(i),asynchronous:!1,shadows:this._getShadows(e)})}_computeCircle(e){const t=[];for(let i=0;i<360;i++){const r=Cesium.Math.toRadians(i);t.push(new Cesium.Cartesian2(e*Math.cos(r),e*Math.sin(r)))}return t}_createCorridorPrimitive(e,t){const i=e.material,r=this._getCesiumColorByOpacity(i.color,this._layerOpacity),n=this._getCornerType(e),a=new Cesium.CorridorGeometry({positions:t,width:e.width,height:e.height,extrudedHeight:0,cornerType:n});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:a,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),show:this.show,appearance:this._createPathAppearance(i),asynchronous:!1,shadows:this._getShadows(e)})}_createPathAppearance(e){switch(e.type){case n.MaterialType.color:default:const t=this._getCesiumColorByOpacity(e.color,this._layerOpacity);return new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{_color:t})})}}_getCornerType(e){let t=void 0;switch(e.join){case n.LineJoinType.round:default:t=Cesium.CornerType.ROUNDED;break;case n.LineJoinType.bevel:t=Cesium.CornerType.BEVELED;break;case n.LineJoinType.miter:t=Cesium.CornerType.MITERED}return t}_getShadows(e){let t=Cesium.ShadowMode.DISABLED;return e.castShadows&&(t=Cesium.ShadowMode.ENABLED),t}};var Qh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.PolygonSymbol3D||(n.Log.info("要素的符号类型不是SimpleLineSymbol!"),!1)}update(e){this._feature=e,this.destroy(),this._createPrimitive()}destroy(){this._primitivesCollection&&this._primitivesCollection.removeAll()}_createPrimitive(){const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;let i;for(let r=0;r<e.items.length;r++){const a=e.items[r];switch(a.type){case n.Symbol3DLayerType.line:switch(t.type){case n.GeometryType.polygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createLine(a,i[r]);break;case n.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length;e++)this._createLine(a,i[e][t])}break;case n.Symbol3DLayerType.fill:default:switch(t.type){case n.GeometryType.polygon:this._createPolygon(a,this._getPositions());break;case n.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createPolygon(a,i[e])}break;case n.Symbol3DLayerType.extrude:switch(t.type){case n.GeometryType.polygon:this._createPolygon(a,this._getPositions(),a.size);break;case n.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createPolygon(a,i[e],a.size)}break;case n.Symbol3DLayerType.icon:switch(t.type){case n.GeometryType.polygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length;t++)this._createBillBoard(a,i[e][t]);break;case n.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length;t++)for(let r=0;r<i[e][t].length;r++)this._createBillBoard(a,i[e][t][r])}break;case n.Symbol3DLayerType.object:switch(t.type){case n.GeometryType.polygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length-1;t++)this._createObject(a,i[e][t]);break;case n.GeometryType.multiPolygon:i=this._getPositions()}}}}_createLineSymbol3DLayerPrimitive(e,t){const i=e.material;let r,a=Cesium.ArcType.NONE;if(this._feature.geometry&&this._feature.geometry.extendOptions&&this._feature.geometry.extendOptions.arcType&&(a=this._feature.geometry.extendOptions.arcType),this._elevationInfo.mode===n.ElevationMode.AbsoluteHeight)r=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:t,width:e.size,arcType:a}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(i.color,this._layerOpacity))}}),show:this.show,appearance:this._createLineAppearance(e),asynchronous:!1});else{const n=Ih(this._elevationInfo.mode),a=new Cesium.GroundPolylineGeometry({positions:t,width:e.size,loop:!1});r=new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:a,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(i.color,this._layerOpacity))}}),show:this.show,appearance:this._createLineAppearance(e),asynchronous:!1,classificationType:n})}return r}_createLineAppearance(e){const t=e.pattern,i=e.material,r=e.marker;let a=void 0;switch(i.type){case n.MaterialType.color:default:switch(t.style){case"dash":case"dash-dot":case"dot":case"long-dash":case"long-dash-dot":case"long-dash-dot-dot":case"short-dash":case"short-dash-dot":case"short-dash-dot-dot":return a=Oh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style),new Cesium.PolylineMaterialAppearance({material:a,translucent:!1,renderState:{depthTest:{enabled:!0}}});case"solid":default:if(r){let e=r.color;switch(e||(e=i.color),r.style){case n.LineMarkerStyle.arrow:a=Cesium.Material.fromType("PolylineArrow",{color:this._getCesiumColorByOpacity(e,this._layerOpacity)});break;default:a=Oh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style)}}else a=Oh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style);return new Cesium.PolylineColorAppearance({material:a,renderState:{depthTest:{enabled:!0}}})}}}_createLine(e,t){const i=[];t.forEach(e=>{i.push(Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,e.height))});const r=this._primitivesCollection.add(this._createLineSymbol3DLayerPrimitive(e,i));r.id=this._feature.id,r.commonFeatureId=this._feature.id,r.commonLayerId=this.commonLayerId,this._primitives.push(r)}_createPolygon(e,t,i){const r=[];t.forEach(e=>{const t=[];e.forEach(e=>{t.push(Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,e.height))}),r.push(t)});const n=this._primitivesCollection.add(this._createFillSymbol3DLayerPrimitive(e,r,i));n.id=this._feature.id,n.commonFeatureId=this._feature.id,n.commonLayerId=this.commonLayerId,this._primitives.push(n)}_createFillSymbol3DLayerPrimitive(e,t,i){const a=e.material,o=[];for(let e=1;e<t.length;e++)o.push(new Cesium.PolygonHierarchy(t[e]));let s;s=i?new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(t[0],o),perPositionHeight:!0,height:i,extrudedHeight:i}):new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(t[0],o),perPositionHeight:!0});const l=new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:this._getCesiumColorByOpacity(a.color,this._layerOpacity)}),translucent:!1,renderState:{depthTest:{enabled:!0}}});let h;if(this._elevationInfo.mode===n.ElevationMode.AbsoluteHeight)h=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:s,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(a.color,this._layerOpacity))}}),appearance:l,asynchronous:!1,shadows:r.getShadows(e)});else{const t=Ih(this._elevationInfo.mode);h=new Cesium.GroundPrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:s,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(a.color,this._layerOpacity))}}),appearance:l,asynchronous:!1,classificationType:t,shadows:r.getShadows(e)})}return h=this._primitivesCollection.add(h)}_createIconSymbol3dLayerPrimitive(e,t){const i=e.material;return{position:t,image:e.resource.href,color:this._getCesiumColorByOpacity(i.color,this._layerOpacity),width:e.size,height:e.size,verticalOrigin:Cesium.VerticalOrigin.BOTTOM}}_createBillBoard(e,t){const i=this._billboardsCollection.add(this._createIconSymbol3dLayerPrimitive(e,t));i.id=this._feature.id,i.commonFeatureId=this._feature.id,i.commonLayerId=this.commonLayerId,this._billboards.push(i)}_createObject(e,t){const i=e.resource;let r;if(i.href)r=this._primitivesCollection.add(this._createModelPrimitive(e,t));else{let n;switch(i.primitive){case"sphere":r=this._primitivesCollection.add(this._createSpherePrimitive(e,t));break;case"cylinder":n=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:n,bottomRadius:n}));break;case"cone":n=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:0,bottomRadius:n}));break;case"inverted-cone":n=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:n,bottomRadius:0}));break;case"tetrahedron":n=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:0,bottomRadius:n,slices:3}))}}r.id=this._feature.id,r.commonFeatureId=this._feature.id,r.commonLayerId=this.commonLayerId,this._primitives.push(r)}_createSpherePrimitive(e,t){const i=e.material,r=new Cesium.EllipsoidGeometry({radii:new Cesium.Cartesian3(e.width,e.height,e.depth),innerRadii:new Cesium.Cartesian3(e.width,e.height,e.depth)}),n=Cesium.Transforms.eastNorthUpToFixedFrame(t);return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:r,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(i.color,this._layerOpacity))}}),show:this.show,modelMatrix:n,appearance:this._createObject3DAppearance(e),asynchronous:!1})}_createCylinderPrimitive(e,t,i){i=Object(n.defaultValue)(i,{topRadius:0,bottomRadius:0,slices:128});const r=e.material,a=Cesium.Transforms.eastNorthUpToFixedFrame(t),o=new Cesium.CylinderGeometry({topRadius:i.topRadius,bottomRadius:i.bottomRadius,length:e.depth,slices:i.slices});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:o,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(r.color,this._layerOpacity))}}),show:this.show,modelMatrix:a,appearance:this._createObject3DAppearance(e),asynchronous:!1})}_createModelPrimitive(e,t){const i=e.material,r=Cesium.Transforms.eastNorthUpToFixedFrame(t),n={show:this.show,url:e.resource.href,shadows:e.castShadows,scale:1e3,color:this._getCesiumColorByOpacity(i.color,this._layerOpacity),modelMatrix:r,asynchronous:!1};return Cesium.Model.fromGltf(n)}_createObject3DAppearance(e){const t=e.material;switch(t.type){case n.MaterialType.color:default:return new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:this._getCesiumColorByOpacity(t.color,this._layerOpacity)})})}}};var ec=class extends _h{constructor(e){super(e),this._graphics=Object(n.defaultValue)(this._graphics,[])}checkSymbol(){return this._feature.symbol instanceof n.PointSymbol3D||(n.Log.info("要素的符号类型不是PictureMarkerSymbol!"),!1)}update(e){this._feature=e,this.destroy(),this._createPrimitive()}destroy(){this._graphics&&(this._graphics.forEach(e=>{e&&e.destroy()}),this._graphics=[]),this._primitivesCollection&&this._primitivesCollection.removeAll()}_createPrimitive(){this._graphics=[];const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;let i;for(let r=0;r<e.items.length;r++){const a=e.items[r];switch(t.type){case n.GeometryType.point:i=this._getPositions(),this._createPointSymbol3D(a,i[0]);break;case n.GeometryType.multiPoint:i=this._getPositions();for(let e=0;e<i.length;e++)this._createPointSymbol3D(a,i[e])}}}_createPointSymbol3D(e,t){switch(e.type){case n.Symbol3DLayerType.icon:default:this._createBillboard(e,t);break;case n.Symbol3DLayerType.text:this._createLabel(e,t);break;case n.Symbol3DLayerType.object:this._createObject(e,t)}}_createBillboard(e,t){let i;if(e.resource.href){const r=Dh(e,n.SymbolType.pictureMarker,t,this._feature);i=new xh({feature:r,billboardsCollection:this._billboardsCollection})}else{const r=Dh(e,n.SymbolType.simpleMarker,t,this._feature);i=new wh({feature:r,pointsCollection:this._pointsCollection,billboardsCollection:this._billboardsCollection})}this._graphics.push(i)}_createLabel(e,t){const i=Dh(e,n.SymbolType.mapgisText,t,this._feature),r=new Jh({feature:i,billboardsCollection:this._billboardsCollection});this._graphics.push(r)}_createObject(e,t){const i={show:this.show,layerOpacity:this._layerOpacity},n=Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,t.height),a=e.resource;let o;if(a.href)o=this._primitivesCollection.add(r.createModelPrimitive(e,n,i));else{let t;switch(a.primitive){case"sphere":o=this._primitivesCollection.add(r.createSpherePrimitive(e,n,{show:this.show,layerOpacity:this._layerOpacity}));break;case"cylinder":t=e.width>e.height?e.width:e.height,i.topRadius=t,i.bottomRadius=t,o=this._primitivesCollection.add(r.createCylinderPrimitive(e,n,i));break;case"cone":t=e.width>e.height?e.width:e.height,i.topRadius=0,i.bottomRadius=t,o=this._primitivesCollection.add(r.createCylinderPrimitive(e,n,i));break;case"inverted-cone":t=e.width>e.height?e.width:e.height,i.topRadius=t,i.bottomRadius=0,o=this._primitivesCollection.add(r.createCylinderPrimitive(e,n,i));break;case"tetrahedron":t=e.width>e.height?e.width:e.height,i.topRadius=0,i.bottomRadius=t,i.slices=3,o=this._primitivesCollection.add(r.createCylinderPrimitive(e,n,i))}}o.id=this._feature.id,o.commonFeatureId=this._feature.id,o.commonLayerId=this.commonLayerId,this._primitives.push(o)}};var tc=class extends _h{constructor(e){super(e),this._graphics=Object(n.defaultValue)(this._graphics,[])}checkSymbol(){return this._feature.symbol instanceof n.LabelSymbol3D||(n.Log.info("要素的符号类型不是LabelSymbol3D!"),!1)}update(e){this._feature=e,this.destroy(),this._createPrimitive()}destroy(){this._graphics&&(this._graphics.forEach(e=>{e&&e.destroy()}),this._graphics=[])}_createPrimitive(){this._graphics=[];const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;let i;for(let r=0;r<e.items.length;r++){const a=e.items[r];switch(t.type){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:i=this._getPositions(),this._createLabel(a,i[0]);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createLabel(a,i[e])}}}_createLabel(e,t){const i=Dh(e,n.SymbolType.mapgisText,t,this._feature),r=new Jh({feature:i,billboardsCollection:this._billboardsCollection});this._graphics.push(r)}};class ic{constructor(e){e=Object(n.defaultValue)(e,{}),this.id=Object(n.defaultValue)(e.id,Object(n.getGUID)()),this.opacity=Object(n.defaultValue)(e.opacity,1),this.elevationInfo=Object(n.defaultValue)(e.elevationInfo,new n.ElevationInfo),this.cameraHeightStep=Object(n.defaultValue)(e.cameraHeightStep,1e3),this._viewer=Object(n.defaultValue)(e.viewer,{}),this._swipeEnabled=Object(n.defaultValue)(e.swipeEnabled,!1),this._swipeInverse=Object(n.defaultValue)(e.swipeInverse,0),this._graphicsCollection=[],this._primitivesCollection=new Cesium.PrimitiveCollection({swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse}),this._pointsCollection=new Cesium.PointPrimitiveCollection({swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse}),this._billboardsCollection=new Cesium.BillboardCollection({scene:this._viewer.scene,swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse}),this._labelsCollection=new Cesium.LabelCollection({scene:this._viewer.scene,swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse}),this._allPrimitives=new Cesium.PrimitiveCollection;const t=this;this._oldCameraHeight=0,this._viewer.camera&&this._viewer.camera.changed.addEventListener(()=>{for(let e=0;e<t._graphicsCollection.length;e++){const i=t._graphicsCollection[e];if(i){if(zh(i._feature)&&(i instanceof xh||i instanceof wh||i instanceof Jh||i instanceof ec)){const e=t._viewer.camera.positionCartographic.height;Math.abs(t._oldCameraHeight-e)>t.cameraHeightStep&&(t._oldCameraHeight=e,t.update(i._feature))}}}})}addPrimitives(){this._allPrimitives.add(this._primitivesCollection),this._allPrimitives.add(this._pointsCollection),this._allPrimitives.add(this._billboardsCollection),this._allPrimitives.add(this._labelsCollection),this._viewer.scene.primitives.add(this._allPrimitives)}add(e){let t=n.Feature.fromJSON(e);let i;switch(t.elevationInfo||(t.elevationInfo=this.elevationInfo),t.additional&&t.additional.hasOwnProperty("arc3")&&(t=Object(n.editFeatureByArc3)(t)),t.symbol.type){case n.SymbolType.simpleMarker:i=new wh({layerId:this.id,feature:t,layerOpacity:this.opacity,pointsCollection:this._pointsCollection,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case n.SymbolType.pictureMarker:i=new xh({layerId:this.id,feature:t,layerOpacity:this.opacity,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case n.SymbolType.text:case n.SymbolType.mapgisText:i=new Jh({layerId:this.id,feature:t,layerOpacity:this.opacity,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case n.SymbolType.simpleLine:i=new Vh({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case n.SymbolType.simpleFill:i=new Yh({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case n.SymbolType.pictureFill:i=new Xh({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case n.SymbolType.line3D:i=new Zh({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case n.SymbolType.polygon3D:i=new Qh({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case n.SymbolType.point3D:i=new ec({layerId:this.id,feature:t,layerOpacity:this.opacity,pointsCollection:this._pointsCollection,primitivesCollection:this._primitivesCollection,billboardsCollection:this._billboardsCollection,labelsCollection:this._labelsCollection,viewer:this._viewer});break;case n.SymbolType.label3D:i=new tc({layerId:this.id,feature:t,layerOpacity:this.opacity,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;default:n.Log.error("要素的符号暂时不支持!")}i&&(this._graphicsCollection.push(i),i.setVisible&&i.setVisible(t.visible))}removeByID(e){const t=this._findGraphicById(e),i=this._graphicsCollection.indexOf(t);i>-1&&this._graphicsCollection.splice(i,1),t.destroy()}update(e){let t=n.Feature.fromJSON(e.toJSON());t.additional.hasOwnProperty("arc3")&&(t=Object(n.editFeatureByArc3)(t));const i=this._findGraphicById(e.id);i&&i._feature&&(i._feature.symbol.type!==t.symbol.type?(this.removeByID(e.id),this.add(e)):(i.update(t),i.setVisible&&i.setVisible(t.visible)))}findByID(e){return this._findGraphicById(e)}getAll(){return this._graphicsCollection}remove(e){this.removeByID(e.id)}removeAll(){if(this._graphicsCollection&&this._graphicsCollection.length>0)for(let e=0;e<this._graphicsCollection.length;e++)this._graphicsCollection[e].destroy();this._graphicsCollection=[]}destroy(){this.removeAll(),this.id=void 0,this.opacity=void 0,this._primitivesCollection=void 0,this._pointsCollection=void 0,this._billboardsCollection=void 0,this._labelsCollection=void 0,this._allPrimitives=void 0,this._viewer=void 0}setVisible(e){this._graphicsCollection&&this._graphicsCollection.length>0&&this._graphicsCollection.forEach(function(t){t.setVisible&&t.setVisible(e)})}setOpacity(e){let t=e;if(t<0&&(t=0),t>1&&(t=1),this.opacity=t,this._graphicsCollection&&this._graphicsCollection.length>0)for(let e=0;e<this._graphicsCollection.length;e++){const i=this._graphicsCollection[e];i&&(i._layerOpacity=t,i.update(i._feature))}}_findGraphicById(e){let t=void 0;if(this._graphicsCollection&&this._graphicsCollection.length>0)for(let i=0;i<this._graphicsCollection.length;i++){const r=this._graphicsCollection[i];r.id===e&&(t=r)}return t}}Object.defineProperties(ic.prototype,{swipeEnabled:{get(){return this._swipeEnabled},set(e){"boolean"==typeof e&&(this._swipeEnabled=e,this._allPrimitives._primitives.forEach(t=>{t.swipeEnabled=e,t instanceof Cesium.PrimitiveCollection&&t._primitives.forEach(t=>{t.swipeEnabled=e})}))}},swipeInverse:{get(){return this._swipeInverse},set(e){"number"==typeof e&&(this._swipeInverse=e,this._allPrimitives._primitives.forEach(t=>{t.swipeInverse=e,t instanceof Cesium.PrimitiveCollection&&t._primitives.forEach(t=>{t.swipeInverse=e})}))}}});var rc=ic;var nc=class{static toPrimitive(e,t){const i=new rc({viewer:t&&t.viewer});if(Array.isArray(e))for(let t=0;t<e.length;t++)i.add(e[t]);else i.add(e);const r=[];return i._billboardsCollection.length>0&&r.push(i._billboardsCollection),i._labelsCollection.length>0&&r.push(i._labelsCollection),i._pointsCollection.length>0&&r.push(i._pointsCollection),i._primitivesCollection.length>0&&r.push(i._primitivesCollection),r}};var ac=class extends nc{static toPrimitive(e,t){return super.toPrimitive(e,t)}};var oc=class extends nc{static toPrimitive(e,t){return super.toPrimitive(e,t)}};var sc=class extends nc{static toPrimitive(e,t){return super.toPrimitive(e,t)}};var lc=class extends nc{static toPrimitive(e,t){return super.toPrimitive(e,t)}};function hc(e,t){this._CesiumMap=e,this._CesiumScene=e.scene,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t}hc.prototype.dimensions=["lng","lat"],hc.prototype.setMapOffset=function(e){this._mapOffset=e},hc.prototype.getBMap=function(){return this._CesiumMap},hc.prototype.dataToPoint=function(e){const t=Cesium.Cartesian3.fromDegrees(e[0],e[1]),i=this._CesiumMap.camera.position;let r=this._CesiumMap.scene.globe.ellipsoid.cartesianToCartographic(i).height;if(r+=1.2*this._CesiumMap.scene.globe.ellipsoid.maximumRadius,Cesium.Cartesian3.distance(i,t)>r)return[-50,-50];const n=this._mapOffset,a=Cesium.Cartesian3.fromDegrees(e[0],e[1]);let o=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this._CesiumScene,a);return[(o=o||{x:0,y:0}).x-n[0],o.y-n[1]]},hc.prototype.pointToData=function(e){const t=this._mapOffset,i=Cesium.Cartesian3.fromDegrees(e[0]+t[0],e[1]+t[1]),r=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this._CesiumScene,i);return[r.x,r.y]},hc.prototype.getViewRect=function(){const e=this._api;return new echarts.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},hc.prototype.getRoamTransform=function(){return echarts.matrix.create()},hc.prototype.prepareCustoms=function(){const e=echarts.util,t=this.getViewRect();return{coordSys:{type:"cesium",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:e.bind(this.dataToPoint,this),size:e.bind(function(t,i){return i=i||[0,0],e.map([0,1],function(e){const r=i[e],n=t[e]/2,a=[],o=[];return a[e]=r-n,o[e]=r+n,a[1-e]=i[1-e],o[1-e]=i[1-e],Math.abs(this.dataToPoint(a)[e]-this.dataToPoint(o)[e])},this)},this)}}},hc.dimensions=hc.prototype.dimensions,hc.create=function(e,t){let i;e.eachComponent("cesium",function(e){const r=echarts.cesiumMap;(i=new hc(r,t)).setMapOffset(e.__mapOffset||[0,0]),e.coordinateSystem=i}),e.eachSeries(function(e){"cesium"===e.get("coordinateSystem")&&(e.coordinateSystem=i)})};var cc=hc;let uc=0;class dc{constructor(e,t,i){if(this.map=e,this.scene=e.scene,this.options=t,this.initStats=!1,this.handler=void 0,this.moveEndEvent=void 0,this.postEvent=void 0,this.postStartEvent=void 0,this.postEndEvent=void 0,this.layerId=t.layerId||`echarts${uc++}`,this.layerClass=t.layerClass||"echartlayerdefaultclass",this.initDevicePixelRatio(),this.visible=Object(n.defaultValue)(t.visible,!0),this.opacity=Object(n.defaultValue)(t.opacity,1),this.canvas=this._createCanvas(),this.postRenderTime=0,this.postRenderFrame=t.postRenderFrame||30,void 0!=i)this.container=i,i.appendChild(this.canvas);else{const t=document.getElementsByClassName("cesium-widget"),i=t.length>0?t[0]:e.container;this.container=i,this.addInnerContainer()}return this.chart=echarts.init(this.canvas),this.initEcharts(),this._resizeCanvas(),this.resize(),this}initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1}addInnerContainer(){this.container.appendChild(this.canvas)}initEcharts(){return echarts.cesiumMap=this.map,echarts.registerCoordinateSystem("cesium",cc),echarts.extendComponentModel({type:"cesium",getBMap(){return this.__cesium},defaultOption:{roam:!1}}),echarts.registerAction({type:"CesiumRoma",event:"CesiumRoma",update:"updateLayout"},function(e,t){}),this}_createCanvas(){const e=document.createElement("div");e.className="cesium-echarts-layer",e.setAttribute("class","cesium-echarts-layer"),e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility=this.visible?"visible":"hidden",e.style.opacity=this.opacity,e.style.pointerEvents="none",e.style.zIndex=this.options.zIndex||100;const t=`${parseInt(this.map.canvas.width)}px`,i=`${parseInt(this.map.canvas.height)}px`;return e.width=t,e.height=i,e.style.width=t,e.style.height=i,e}_resizeCanvas(){const e=this;window.onresize=function(){if(void 0==this.canvas||null==this.canvas)return;const t=e.canvas,i=e.map;t.style.position="absolute",t.style.top="0px",t.style.left="0px";const r=`${parseInt(i.canvas.width)}px`,n=`${parseInt(i.canvas.height)}px`;t.width=r,t.height=n,t.style.width=r,t.style.height=n,e.chart.resize()}}_visible(){this.visible=!0,this.canvas.style.visibility="visible"}_unvisible(){this.visible=!1,this.canvas.style.visibility="hidden"}addTo(e){this.endStatus=!1;const t=this;return echarts.extendComponentView({type:"cesium",render(e,i,r){let n=!0;echarts.cesiumMap;const a=r.getZr().painter.getViewportRoot(),o=e.coordinateSystem,s=function(i,s){if(n||!t.map||!t.visible)return;t._unvisible();const l=t.map.canvas,h=[-parseInt(l.style.left,10)||0,-parseInt(l.style.top,10)||0];a.style.left=`${h[0]}px`,a.style.top=`${h[1]}px`,o.setMapOffset(h),e.__mapOffset=h,r.dispatchAction({type:"CesiumRoma"})},l=function(i,s){if(n||!t.map)return;t._visible();const l=t.map.canvas,h=[-parseInt(l.style.left,10)||0,-parseInt(l.style.top,10)||0];a.style.left=`${h[0]}px`,a.style.top=`${h[1]}px`,o.setMapOffset(h),e.__mapOffset=h,r.dispatchAction({type:"CesiumRoma"})};function h(){n||(t._visible(),r.dispatchAction({type:"CesiumRoma"}))}t.moveEndEvent=l;const c=function(){h()};t.postStartEvent=function(){this.endStatus||t.scene.postRender.addEventListener(c)}.bind(t);t.postEndEvent=function(){this.endStatus||(t.scene.postRender.removeEventListener(c),t.resize(),t._visible())}.bind(t),t.handler=new Cesium.ScreenSpaceEventHandler(t.scene.canvas),0==t.initStats&&(t.initStats=!0,t.options.postRender?(t.scene.camera.moveStart.addEventListener(t.postStartEvent,t),t.scene.camera.moveEnd.addEventListener(t.postEndEvent,t)):(t.handler.setInputAction(s,Cesium.ScreenSpaceEventType.LEFT_DOWN),t.handler.setInputAction(l,Cesium.ScreenSpaceEventType.LEFT_UP),t.handler.setInputAction(s,Cesium.ScreenSpaceEventType.RIGHT_DOWN),t.handler.setInputAction(l,Cesium.ScreenSpaceEventType.RIGHT_UP),t.map.scene.camera.moveEnd.addEventListener(function(){t.moveEndEvent()}))),this._oldMoveHandler=s,this._oldZoomEndHandler=h;e.get("roam");n=!1}}),this.chart.setOption(this.options),this}show(){this._visible()}hide(){this._unvisible()}setOpacity(e){this.opacity=e,this.canvas.style.opacity=this.opacity}resize(){if(void 0==this.canvas||null==this.canvas)return;const e=this.canvas;e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.width=parseInt(this.map.canvas.width),e.height=parseInt(this.map.canvas.height),e.style.width=this.map.canvas.style.width,e.style.height=this.map.canvas.style.height}remove(){this.endStatus=!0;const e=this;return this.chart.clear(),e.options.postRender?(this.scene.camera.moveStart.removeEventListener(this.postStartEvent,this),this.scene.camera.moveEnd.removeEventListener(this.postEndEvent,this)):(this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN),this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP),this.handler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_DOWN),this.handler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_UP),this.scene.camera.moveEnd.removeEventListener(function(){e.moveEndEvent()}),this.handler.destroy()),this.canvas.parentElement&&this.canvas.parentElement.removeChild(this.canvas),this.map=void 0,this}}window.EchartsLayer=dc;var pc=class{constructor(e){e=Object(n.defaultValue)(e,{}),this.view=Object(n.defaultValue)(e.view,null),this.format=Object(n.defaultValue)(e.format,n.PictureFormat.png),this.filename=Object(n.defaultValue)(e.filename,"screenshotFile"),this.width=Object(n.defaultValue)(e.width,void 0),this.height=Object(n.defaultValue)(e.height,void 0),this.x=Object(n.defaultValue)(e.x,0),this.y=Object(n.defaultValue)(e.y,0),this.isDownload=Object(n.defaultValue)(e.isDownload,!0)}_addView(){const e=this;this.view._innerView.render();const t=this.view._innerView.canvas;let i=null;this.format===n.PictureFormat.png?i=t.toDataURL():this.format===n.PictureFormat.jpeg?i=t.toDataURL("image/jpeg"):"svg"===this.format&&(i=t.toDataURL());const r=document.createElement("canvas");r.width=this.width,r.height=this.height;const a=r.getContext("2d"),o=function(e,t){const i=document.createElement("a");i.href=e,i.download=t,document.body.appendChild(i),i.click()};return new Promise(t=>{if(this.width&&this.height){const s=new Image;s.src=i,s.onload=function(){a.drawImage(s,e.x,e.y,e.width,e.height,0,0,e.width,e.height);let i=null;e.format===n.PictureFormat.png?i=r.toDataURL():e.format===n.PictureFormat.jpeg?i=r.toDataURL("image/jpeg"):"svg"===e.format&&(i=r.toDataURL()),e.isDownload&&o(i,e.filename),t({dataUrl:i})}}else e.isDownload&&o(i,this.filename),t({dataUrl:i})})}_removeView(){}};var fc=class extends n.Evented{constructor(e){super(e),e=Object(n.defaultValue)(e,{}),this.view=Object(n.defaultValue)(e.view,""),this.location=Object(n.defaultValue)(e.location,""),this.title=Object(n.defaultValue)(e.title,""),this.content=Object(n.defaultValue)(e.content,""),this.alignment=Object(n.defaultValue)(e.alignment,"bottom-center"),this.defaultButtons=Object(n.defaultValue)(e.defaultButtons,["toggle","close","zoom"]),this._popup=void 0,this._initDefaultClass()}open(e){this._popup?(this.close(),this._popup=void 0,this.openPopup(e)):this.openPopup(e)}openPopup(e){if(e.view){const t=e.view._innerView;this.view&&e.view.id===this.view.id?this._popupLayer||(this._popupLayer=new Cesium.GraphicsLayer(t,{})):(this.view=e.view,this._popupLayer&&this.view._innerView.remove(this._popupLayer),this._popupLayer=new Cesium.GraphicsLayer(t,{}))}else if(!this._popupLayer){if(!this.view)return;this._popupLayer=new Cesium.GraphicsLayer(this.view._innerView,{})}this.location=e.location?e.location:this.location,this.location.spatialReference.isGeographic?this._location=this.location:this._location=n.Projection.project(this.location,new n.SpatialReference({wkid:4326})),this.title=e.title?e.title:this.title,this.content=e.content?e.content:this.content,this.alignment=e.alignment?e.alignment:this.alignment;const t=this._location.coordinates[0],i=this._location.coordinates[1],r=this._initDefaultUI(this.title,this.content);r.style.display="block";const a=new Cesium.Graphic({type:"div",positions:[Cesium.Cartesian3.fromDegrees(t,i,0)],style:{html:r}});this._popup=this._popupLayer.addGraphic(a),this._popup.style.pixelOffset=this._getOffset()}_contentUI(e,t){const i=this;let r=void 0;const n=function(e){const t=document.createElement("div");return t.innerHTML=e,t.childNodes};(r=document.createElement("div")).setAttribute("id",`${this.id}-popup-default`);const a=document.createElement("div");a.setAttribute("class","zondy-popup__header"),a.setAttribute("style","display: flex;");const o=n('<div class="zondy-popup__toggle">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 24 24" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M5 13.793l7-7 7 7v1.414l-7-7-7 7z"></path></svg>\n </div>')[0],s=n('<div class="zondy-popup__close">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M3.98 11.303L7.281 8 3.98 4.697l.707-.707L7.99 7.293l.01-.01.01.01 3.304-3.303.707.707L8.718 8l3.303 3.303-.707.707L8.01 8.707l-.01.01-.01-.01-3.304 3.303z"></path></svg>\n </div>')[0];if(e){const t=n('<div style="flex: 1;"></div>')[0];if(a.appendChild(t),"object"==typeof e?e instanceof Node?t.appendChild(e):e instanceof NodeList&&e.forEach(e=>{t.appendChild(e)}):t.innerHTML=e,this.defaultButtons.indexOf("toggle")>-1){a.appendChild(o);let e=!0;o.onclick=function(){e=!e,document.getElementById(`${i.id}-popup-default`).querySelector(".zondy-popup__content").style.display=e?"block":"none"}}this.defaultButtons.indexOf("close")>-1&&(a.appendChild(s),s.onclick=(()=>{this.close()}))}const l=document.createElement("div");if(l.setAttribute("class","zondy-popup__content"),t)if("object"==typeof t){if(t instanceof Node)l.appendChild(t);else if(t instanceof NodeList)for(let e=0;e<t.length;e++)l.appendChild(t[e]),e--}else l.innerHTML=t;const h=document.createElement("div");h.setAttribute("class","zondy-popup__footer");const c=n('<div class="zondy-popup__zoom" style="display: inline-block;width: 36px;height: 36px;line-height: 36px;text-align: center;">\n <svg class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M9 7H7v2H6V7H4V6h2V4h1v2h2zm6.805 7.861l-.943.942a.665.665 0 0 1-.943 0l-3.067-3.067a.667.667 0 0 1 0-.943l.129-.13-1.108-1.107A5.279 5.279 0 1 1 11.8 6.5a5.251 5.251 0 0 1-1.237 3.366l1.108 1.108.124-.124a.668.668 0 0 1 .943 0l3.067 3.068a.666.666 0 0 1 0 .943zM10.8 6.5a4.3 4.3 0 1 0-4.3 4.3 4.304 4.304 0 0 0 4.3-4.3zm4.062 7.89l-2.595-2.598-.473.473 2.597 2.595z"></path></svg>\n </div>')[0];return this.defaultButtons.indexOf("zoom")>-1&&(h.appendChild(c),c.onclick=function(){i.view._setZoomAndCenter({zoom:i.view._zoom+1,center:i.location})}),h.childNodes.length>0&&h.setAttribute("class","zondy-popup__footer zondy-popup__footer-division"),r.appendChild(a),r.appendChild(l),r.appendChild(h),r}_initDefaultUI(e,t){const i=document.createElement("div");i.setAttribute("class","zondy-popup");const r=document.createElement("div");r.setAttribute("class","zondy-popup__container");const n=this._contentUI(e,t);r.appendChild(n),i.appendChild(r);const a=document.createElement("div");return a.setAttribute("style","margin: auto;width: 40px;height: 20px;pointer-events: none;overflow: hidden;pointer-events: none;"),a.innerHTML="<div class='zondy-popup__tip' style='width: 17px;height: 17px;padding: 1px;margin: -10px auto 0;pointer-events: auto;transform: rotate(45deg);'>\n </div>",i.appendChild(a),i}_initDefaultClass(){let e=!1;const t=document.head.getElementsByTagName("style");if(t)for(let i=0;i<t.length;i++)if(t[i].innerHTML.indexOf("styleDomString")>-1){e=!0;break}if(!e){const e=document.createElement("style");e.innerHTML="\n .zondy-popup__container{background-color: #fff;padding:0;border-radius: 10px;}\n .zondy-popup__tip{\n background-color: #fff;\n }\n .zondy-popup__header{\n padding: 8px;\n font-size: 18px;\n font-weight: 600;\n line-height: 20px;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n white-space: nowrap;\n }\n .zondy-popup__content{\n padding: 8px;\n }\n .zondy-popup__footer{\n }\n .zondy-popup__footer-division{\n border-top: 1px solid;\n }\n .zondy-popup__toggle,.zondy-popup__close{\n display: inline-block;width: 30px;text-align: center;\n }\n ",document.querySelector("head").append(e)}}_getOffset(){let e=null;if(this._popup&&this._popup.style&&this._popup.style.html&&this.alignment){const t=this._popup.style.html.getBoundingClientRect(),i=this._getOffsetByAlignment(this.alignment,t.width,t.height);e=new L.Point(i.x,i.y)}return e}_getOffsetByAlignment(e,t,i){let r=0,n=0;switch(e){case"top-left":n=-i;break;case"top-center":r=-t/2,n=-i;break;case"top-right":r=-t,n=-i;break;case"bottom-left":break;case"auto":case"bottom-center":r=-t/2;break;case"bottom-right":r=-t}return{x:r,y:n}}close(){this._popup.remove()}destroy(){this._popupLayer&&this.view._innerView.remove(this._popupLayer)}};var mc=class extends n.LayerView{onAdd(){return Bl.addVectorTileLayer(this)}onRemove(){return Bl.removeLayer(this),Promise.resolve(this)}onUpdate(e){if(!this.innerLayer)return Promise.resolve(this);if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t],{params:r}=i;if(i)switch(i.name){case"setPaintProperties":case"setLayoutProperties":case"setStyleLayer":case"deleteStyleLayer":default:Bl.refresh(this);break;case"opacity":Bl.setOpacity(this,r[0]);break;case"visible":{const e=i.params&&i.params.length>0?i.params[0]:void 0;Bl.setVisible(this,e);break}case"clippingArea":Bl.setClipArea(this)}}return Promise.resolve(this)}};function yc(e,t,i){const r=Kl(e,i),n=i.imageryLayers.indexOf(t);if(n>=r){for(let e=0;e<n-r;e++)i.imageryLayers.lower(t);t._realIndex=e._realIndex+1}else{for(let e=0;e<r-n;e++)i.imageryLayers.raise(t);t._realIndex=e._realIndex+1}}var gc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{r.innerLayer=Pr.addWMSLayer(t,i),r.innerLayer.alpha=t.opacity,r.innerLayer.show=r._getLayerViewVisible(),e(r)})}onRemove(e){return Pr.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"spatialReference":Pr.removeLayer(this.innerLayer,this.innerView),self.innerLayer=Pr.addWMSLayer(this.layer,this.innerView);break;case"index":yc(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?rh(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"sublayerVisible":case"refresh":Pr.removeLayer(this.innerLayer,this.innerView),this.innerLayer=Pr.addWMSLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};var vc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{r.innerLayer=Gr.addWMTSLayer(t,i),r.innerLayer.alpha=t.opacity,r.innerLayer.show=r._getLayerViewVisible(),e(r)})}onRemove(e){return Gr.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":yc(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?rh(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction))}}return Promise.resolve(this)}};var bc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return new Promise(e=>{this.innerLayer=Vr.addIGSTileLayer(t,i),this.innerLayer.alpha=t.opacity,this.innerLayer.show=this._getLayerViewVisible(),e(this)})}onRemove(e){return Vr.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(!this.innerLayer)return Promise.resolve(this);if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":yc(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?rh(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"refresh":Vr.removeLayer(this.innerLayer,this.innerView),self.innerLayer=Vr.addIGSTileLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};var _c=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return new Promise(e=>{this.innerLayer=lh.addIGSMapImageLayer(t,i),this.innerLayer.alpha=t.opacity,this._getLayerViewVisible()||(this.innerLayer.alpha=0),e(this)})}onRemove(e){return lh.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(!this.innerLayer)return Promise.resolve(this);if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.alpha=t?this.layer.opacity:0;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":yc(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?rh(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"refresh":lh.removeLayer(this.innerLayer,this.innerView),this.innerLayer=lh.addIGSMapImageLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};var wc=class{static applyUpdate(e,t,i,r,a){if(r.updateContent)for(let e=0;e<r.updateContent.length;e++){const o=r.updateContent[e];if(o)switch(o.name){case"visible":switch(t.type){case n.LayerType.wms:case n.LayerType.igsMapImage:case n.LayerType.igsTile:case n.LayerType.m3d:case n.LayerType.scene:case n.LayerType.cesium3DTiles:case n.LayerType.m3dCache:const e=o.params&&o.params.length>0?o.params[0]:this.layer.visible,r=a._getLayerViewVisible(e);i.show=r}break;case"opacity":switch(t.type){case n.LayerType.wms:i.alpha=t.opacity;break;case n.LayerType.m3dCache:i.translucency=t.opacity;break;case n.LayerType.cesium3DTiles:i.style=new Cesium.Cesium3DTileStyle,i.style.color={evaluateColor(e,i){if(i)return i.alpha=t.opacity,i}}}}}if(!i)return;let o=!1;switch(t.type){case n.LayerType.igsVectorTile:i.updateStyle(t.style),o=!0}if(r.extend&&r.extend.type){switch(r.extend.type){case n.LayerEventType.layerUpdateOpacity:switch(t.type){case n.LayerType.igsMapImage:case n.LayerType.igsTile:i.alpha=t.opacity,o=!0;break;case n.LayerType.m3d:case n.LayerType.scene:case n.LayerType.cesium3DTiles:(i=e._innerView.scene.layers.getLayer(t.layerIndex)).translucency=t.opacity}break;case n.LayerEventType.layerUpdateVisible:switch(t.type){case n.LayerType.igsMapImage:case n.LayerType.igsTile:case n.LayerType.m3d:case n.LayerType.scene:case n.LayerType.cesium3DTiles:i.show=!i.show,o=!0}break;case n.LayerEventType.layerUpdateStyle:switch(t.type){case n.LayerType.igsVectorTile:i.updateStyle(t.style),o=!0}break;case n.LayerEventType.layerSublayerVisible:switch(t.type){case n.LayerType.igsMapImage:i._imageryProvider._layers=t.layers,o=!0}}return o?new Promise(e=>{e()}):null}}};var xc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return this._getLayerViewVisible(),new Promise(e=>{Ul.addM3DLayer(t,i,this.view,t=>{this.innerLayer=t,e(r)})})}onRemove(e){return Ul.removeLayer(this.innerLayer,this.innerView,this.view),Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return wc.applyUpdate(this.view,this.layer,t,e,this),Promise.resolve(this)}};var Cc=class extends n.LayerView{onAdd(e){return new Promise(e=>{dh.addCesium3DTilesLayer(this,t=>{this.innerLayer=t,e(this)})})}onRemove(e){return dh.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return wc.applyUpdate(this.view,this.layer,t,e,this),Promise.resolve(this)}};var Sc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return this._getLayerViewVisible(),new Promise(e=>{Hl.addTerrainCacheLayer(t,i,t=>{this.innerLayer=t,e(r)})})}onRemove(e){return Hl.removeLayer(this.layer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":Hl.setOpacity(this.layer,this.innerView)}}return Promise.resolve(this)}};class Mc{}Mc.addEchartsLayer=function(e){const{layer:t,innerView:i}=e,r=e._getLayerViewVisible(t.visible);let n=Object.assign({},t.echartsOptions);n.visible=r,n.opacity=t.opacity;const{extendOptions:a={}}=t;n=Object.assign(n,a);const o=new dc(i,n).addTo(i);return o.id=t.id,o},Mc.removeLayer=function(e){e.remove()};var kc=Mc;var Tc=class extends n.LayerView{onAdd(e){return this.innerLayer=kc.addEchartsLayer(this),Promise.resolve(this)}onRemove(e){return kc.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible;this._getLayerViewVisible(e)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity);break;case"refresh":kc.removeLayer(this.innerLayer),this.innerLayer=kc.addEchartsLayer(this)}}return Promise.resolve(this)}};var Ic=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this._getLayerViewVisible();return this.innerLayer=bh.addMapVLayer(t,i),r||this.innerLayer.hide(),Promise.resolve(this)}onRemove(e){return bh.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible;this._getLayerViewVisible(e)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity)}}return Promise.resolve(this)}};var Oc=class extends n.GroupLayerView{};var Ec=class extends n.BaseGraphicsLayerView{onAdd(e){const t=this.layer,i=this.innerView,r=t.graphics||[];return this._getLayerViewVisible(),this.innerLayer=new rc({id:t.id,viewer:i,opacity:t.opacity,elevationInfo:t.elevationInfo}),this.innerLayer.addPrimitives(),this.render.drawFeature(this.innerLayer,r),Promise.resolve(this)}onRemove(e){return this.innerLayer.destroy(),this.innerLayer=null,Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return e.updateContent&&t&&e.updateContent.forEach(e=>{if(e&&"property"===e.operationType)switch(e.name){case"opacity":{const i=e.params;t.setOpacity&&t.setOpacity(i[0]);break}case"visible":{const i=e.params&&e.params.length>0?e.params[0]:void 0,r=this._getLayerViewVisible(i);t.setVisible&&t.setVisible(r);break}}if(e&&"method"===e.operationType)switch(e.name){case"add":this.render.drawFeature(t,[e.params[0]]);break;case"remove":{const i=e.params;t.remove(i[0]);break}case"addMany":this.render.drawFeature(t,e.params[0]);break;case"removeMany":e.params[0].forEach(e=>{t.remove(e)});break;case"removeAll":t.removeAll()}}),Promise.resolve(this)}};var Lc=class extends n.BaseFeatureLayerView{constructor(e){super(e),this._labelClass=null}_processData(){return new Promise(e=>{e()})}onAdd(e){const t=this,i=this.innerView,r=this.layer,a=this.layer.renderer;return this._processData().then(e=>new Promise(o=>{if(t.innerLayer&&t.innerLayer.destroy(),a instanceof n.ClusterRenderer){t.innerLayer=new $h({id:r.id,viewer:i,renderer:a});const o=Object(n.getFeaturesFromFeatureSet)(e);for(let e=0;e<o.length;e++)o[e].symbol=n.Symbol.fromJSON(a.defaultSymbol.toJSON());for(let e=0;e<o.length;e++)t.innerLayer.add(o[e])}else if(a instanceof n.HeatmapRenderer)t.innerLayer=new Kh({id:r.id,viewer:i,field:a.field,valueExpression:a.valueExpression,radius:a.radius,alpha:r.opacity,gradient:a.colorStops,minDataValue:a.minDataValue,maxDataValue:a.maxDataValue,features:Object(n.getFeaturesFromFeatureSet)(e)});else{const o=this._getLayerViewVisible()?t.layer.opacity:0;if(t.innerLayer=new rc({id:r.id,viewer:i,opacity:o,elevationInfo:t.layer.elevationInfo}),t.innerLayer.addPrimitives(),e.features.length>0&&!e.features[0].geometry.spatialReference.isGeographic)for(let t=0;t<e.features.length;t++)e.features[t].geometry=n.Projection.project(e.features[t].geometry,new n.SpatialReference({wkid:4326}));t._initFeatures(e,a)}t._initDynamicLabel(e||{}),o(t)}))}_initDynamicLabel(e){const{innerView:t}=this,{labelingInfo:i,labelsVisible:r}=this.layer;r&&Array.isArray(i)&&i.length>0&&(this._dynamicLabelLayer=new pr({labelingInfo:i,scene:t.scene,visible:this.layer.visible&&r,opacity:this.layer.opacity}),this._dynamicLabelLayer.add(e.features||[]))}onRemove(e){return this._dynamicLabelLayer&&(this._dynamicLabelLayer.destroyed(),this._dynamicLabelLayer=null),this.innerLayer.destroy(),this.innerLayer=null,Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return e.updateContent&&t&&e.updateContent.forEach(i=>{if(i&&"property"===i.operationType)switch(i.name){case"opacity":{const e=i.params;t.setOpacity&&(t.setOpacity(e[0]),this._dynamicLabelLayer&&(this._dynamicLabelLayer.translucency=e[0]));break}case"visible":{const e=i.params&&i.params.length>0?i.params[0]:void 0,r=this._getLayerViewVisible(e);this._dynamicLabelLayer&&(this._dynamicLabelLayer.show=r),t.setVisible&&t.setVisible(r);break}case"renderer":this.onAdd(e)}if(i&&"method"===i.operationType)switch(i.name){case"refresh":this.onAdd(e)}}),Promise.resolve(this)}};var Pc=class extends Lc{_processData(){const e=this.layer,t=e._createQueryOption();return t.resultRecordCount=1e5,e.queryFeatures(t).then(e=>e)}onAdd(e){const t=this,i=this.layer,r=this.innerView;if("server"===i.renderMode){let e;e=i.spatialReference?$l(i.spatialReference,i.extent):new Cesium.GeographicTilingScheme({rectangle:Cesium.Rectangle.fromDegrees(-180,-90,180,90),ellipsoid:Cesium.Ellipsoid.WGS84,numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1});const a=i.url,o=Object(n.getBaseUrl)(a);let s;return s="1.0"===i._igsVersion?{url:`${o}/igs/rest/mrms/layers`,gdbps:[i.gdbp],tilingScheme:e,filters:i.definitionExpression?`0:${i.definitionExpression}`:""}:{url:`${o}/igs/rest/services/system/ResourceServer/tempData`,gdbps:[i.gdbp],tilingScheme:e,filters:i.definitionExpression?`0:${i.definitionExpression}`:""},this.innerLayer=r.imageryLayers.addImageryProvider(new Cesium.MapGISMapServerImageryProvider(s)),this.innerLayer.alpha=i.opacity,this.innerLayer.show=this._getLayerViewVisible(),Promise.resolve(t)}return super.onAdd(e)}onRemove(e){const t=this;return this.layer.gdbp?(this.innerView.imageryLayers.remove(this.innerLayer),Promise.resolve(t)):super.onRemove(e)}};var Rc=class extends Lc{_processData(){return this.layer.queryFeatures()}onUpdate(e){let t=!1;return e.updateContent&&this.innerLayer&&e.updateContent.forEach(i=>{i&&"property"===i.operationType&&("renderer"===i.name?(super.onRemove(e),super.onAdd(e)):t=!0)}),t&&super.onUpdate(e),Promise.resolve(this)}};var jc=class extends Lc{_processData(){return this.layer.queryFeatures().then(e=>e)}onUpdate(e){let t=!1;return e.updateContent&&this.innerLayer&&e.updateContent.forEach(i=>{i&&"property"===i.operationType&&("renderer"===i.name?(super.onRemove(e),super.onAdd(e)):t=!0)}),t&&super.onUpdate(e),Promise.resolve(this)}};var Ac=class extends n.LayerView{onAdd(e){return new Promise(e=>{Ul.addM3DLayer(this,t=>{this.innerLayer=t,e(this)})})}onRemove(e){return Ul.removeLayer(this.innerLayer,this.innerView,this.view),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.translucency=this.layer.opacity;break;case"renderer":const r=i.params[0];this.innerLayer.renderer=Ql(r)}}return Promise.resolve(this)}};var zc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return new Promise(e=>{this.innerLayer=Er.addArcGISMapImageLayer(t,i),this.innerLayer.alpha=t.opacity,this.innerLayer.show=this._getLayerViewVisible(),e(this)})}onRemove(e){return Er.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":yc(this.layer,this.innerLayer,this.innerView)}}return Promise.resolve(this)}};var Dc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return new Promise(e=>{this.innerLayer=jr.addArcGISTileLayer(t,i),this.innerLayer.alpha=t.opacity,this.innerLayer.show=this._getLayerViewVisible(),e(this)})}onRemove(e){return jr.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":yc(this.layer,this.innerLayer,this.innerView)}}return Promise.resolve(this)}};var Vc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{r.innerLayer=Jl.addWebTileLayer(t,i),r.innerLayer.alpha=t.opacity,this.innerLayer.show=this._getLayerViewVisible(),e(r)})}onRemove(e){return Jl.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":yc(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?rh(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"refresh":Jl.removeLayer(this.innerLayer,this.innerView),self.innerLayer=Jl.addIGSTileLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};function Nc(e){const t=n.Feature.fromJSON(e);return t.geometry.spatialReference.isGeographic||(t.geometry=n.Projection.project(t.geometry,new n.SpatialReference({wkid:4326}))),t}function Gc(e){const t=[];if(e instanceof n.FeatureSet)for(let i=0;i<e.features.length;i++)t.push(Nc(e.features[i]));else if(e instanceof n.FeatureCollection)e.forEach(e=>{t.push(Nc(e))});else for(let i=0;i<e.length;i++)t.push(Nc(e[i]));return t}var Fc=class extends n.FeatureRender{drawFeature(e,t){const i=Gc(t);if(e)for(let t=0;t<i.length;t++)e.add(i[t])}updateFeature(e,t,i){const r=Gc(t);if(e)for(let t=0;t<r.length;t++)e.update(r[t])}clearFeature(e,t){if(e)for(let i=0;i<t.length;i++)e.remove(t[i])}clear(e){e&&e.removeAll()}};var Bc=function(e){Bc.instance={tokenKey:e.tokenKey,tokenValue:e.tokenValue,headers:e.headers,request:e.request}},qc=Bc;class Uc extends n.SceneView{constructor(e){super(e),e=Object(n.defaultValue)(e,{}),this._center=Object(n.defaultValue)(e.center,new n.Point({coordinates:[0,0]})),this._center&&Array.isArray(this._center)&&this._center.length>1&&(this._center=new n.Point({coordinates:[this._center[0],this._center[1],this._center[2]]})),this._scale=Object(n.defaultValue)(e.scale,void 0),this._zoom=Object(n.defaultValue)(e.zoom,3),this.minZoom=Object(n.defaultValue)(e.minZoom,void 0),this.maxZoom=Object(n.defaultValue)(e.maxZoom,void 0),this._extent=Object(n.defaultValue)(e.extent,void 0),this.width=void 0,this.height=void 0,this._spatialReference=new n.SpatialReference("EPSG:4326"),this.popup=Object(n.defaultValue)(e.popup,void 0),this.stationary=!0,this.engineType="cesium",this._innerView=Object(n.defaultValue)(e.innerView,void 0),this._innerView||(this._innerView=new Cesium.Viewer(this._viewId,this.extendOptions)),qc(n.Config),this._initSize(),this._extent?this._initExtent():(this._initScale(),this._initZoom()),this._initViewEvent(),this._initPopup(),this._map._initCesiumView=!0,this._showLayerByScale()}_initViewEvent(){const e=this;this._clickStore=null,this._dragParams={isDrag:!1,origin:null,action:"",button:null},this._screenSpaceEventHandler=new Cesium.ScreenSpaceEventHandler(this._innerView.scene.canvas),this.fire(n.ViewEventType.loaded,{}),this._screenSpaceEventHandler.setInputAction(t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(n.ViewEventType.click,ch.getMouseEvent(t,e))},300),e.fire(n.ViewEventType.immediateClick,ch.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.LEFT_CLICK),this._screenSpaceEventHandler.setInputAction(t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(n.ViewEventType.click,ch.getMouseEvent(t,e))},300),e.fire(n.ViewEventType.immediateClick,ch.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.RIGHT_CLICK),this._screenSpaceEventHandler.setInputAction(t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(n.ViewEventType.click,ch.getMouseEvent(t,e))},300),e.fire(n.ViewEventType.immediateClick,ch.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.MIDDLE_CLICK),this._screenSpaceEventHandler.setInputAction(t=>{e._clickStore&&(clearTimeout(e._clickStore),e._clickStore=null),e.fire(n.ViewEventType.doubleClick,ch.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerDown,ch.getMouseEvent(t,e)),this._dragParams.isDrag||(t.originalEvent&&(this._dragParams.origin={x:t.originalEvent.layerX,y:t.originalEvent.layerY},this._dragParams.button=t.originalEvent.button),this._dragParams.action="mouse-down",this._dragParams.isDrag=!1)},Cesium.ScreenSpaceEventType.LEFT_DOWN),this._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerUp,ch.getMouseEvent(t,e)),e._dragParams.isDrag&&"update"===this._dragParams.action&&(this._dragParams.action="end",e.fire(n.ViewEventType.drag,ch.getDragEvent(t,e,e._dragParams.origin,this._dragParams.action))),e._dragParams={isDrag:!1,origin:null,action:"",button:null}},Cesium.ScreenSpaceEventType.LEFT_UP),this._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerDown,ch.getMouseEvent(t,e)),this._dragParams.isDrag||(t.originalEvent&&(this._dragParams.origin={x:t.originalEvent.layerX,y:t.originalEvent.layerY},this._dragParams.button=t.originalEvent.button),this._dragParams.action="mouse-down",this._dragParams.isDrag=!1)},Cesium.ScreenSpaceEventType.RIGHT_DOWN),this._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerUp,ch.getMouseEvent(t,e)),e._dragParams.isDrag&&"update"===this._dragParams.action&&(this._dragParams.action="end",e.fire(n.ViewEventType.drag,ch.getDragEvent(t,e,e._dragParams.origin,this._dragParams.action))),e._dragParams={isDrag:!1,origin:null,action:"",button:null}},Cesium.ScreenSpaceEventType.RIGHT_UP),this._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerDown,ch.getMouseEvent(t,e)),this._dragParams.isDrag||(t.originalEvent&&(this._dragParams.origin={x:t.originalEvent.layerX,y:t.originalEvent.layerY},this._dragParams.button=t.originalEvent.button),this._dragParams.action="mouse-down",this._dragParams.isDrag=!1)},Cesium.ScreenSpaceEventType.MIDDLE_DOWN),this._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerUp,ch.getMouseEvent(t,e)),e._dragParams.isDrag&&(this._dragParams.action="end",e.fire(n.ViewEventType.drag,ch.getDragEvent(t,e,e._dragParams.origin,this._dragParams.action)),e._dragParams={isDrag:!1,origin:null,action:"",button:null})},Cesium.ScreenSpaceEventType.MIDDLE_UP),this._screenSpaceEventHandler.setInputAction(t=>{t.position=t.endPosition,e.fire(n.ViewEventType.pointerMove,ch.getMouseEvent(t,e)),e._dragParams.isDrag?(e.fire(n.ViewEventType.drag,ch.getDragEvent(t,e,e._dragParams.origin,e._dragParams.action,e._dragParams.button)),e._dragParams.action="update"):"mouse-down"===this._dragParams.action&&(this._dragParams.action="start",e._dragParams.isDrag=!0)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this._innerView.camera.moveEnd.addEventListener(t=>{e._cameraMoveEndHandler(),e.fire(n.ViewEventType.viewChange,ch.getViewChangeEvent(t,e))}),this._innerView.camera.moveStart.addEventListener(()=>{e.stationary=!1}),this._innerView.camera.moveEnd.addEventListener(()=>{e.stationary=!0}),this._listenResize(),this._listenKey()}_listenResize(){const e=this;this._lastSize=this.getSize(),new ResizeObserver(t=>{const i=t.length>0?{x:t[0].contentRect.width,y:t[0].contentRect.height}:{width:null,height:null};e.fire(n.ViewEventType.resize,{oldWidth:e._lastSize.x,oldHeight:e._lastSize.y,width:i.x,height:i.y}),this._lastSize=i}).observe(this._innerView._container)}_listenKey(){const e=this,t=this._innerView.canvas;t.setAttribute("tabIndex","-1"),t.onclick=(()=>{t.focus()}),t.addEventListener("keydown",t=>{e.fire(n.ViewEventType.keyDown,ch.getKeyEvent(t,e))}),t.addEventListener("keyup",t=>{e.fire(n.ViewEventType.keyUp,ch.getKeyEvent(t,e))})}_mapActionControl(e,t){"drag-pan"===e&&(this._innerView.scene.screenSpaceCameraController.enableRotate=t)}flyTo(e){e=Object(n.defaultValue)(e,{});const t=Object(n.defaultValue)(e.duration,2),i=Object(n.defaultValue)(e.orientation,void 0),r=Object(n.defaultValue)(e.cancel,void 0),a=Object(n.defaultValue)(e.endTransform,void 0),o=Object(n.defaultValue)(e.maximumHeight,void 0),s=Object(n.defaultValue)(e.flyOverLongitude,void 0),l=Object(n.defaultValue)(e.flyOverLongitudeWeight,void 0),h=Object(n.defaultValue)(e.convert,void 0),c=Object(n.defaultValue)(e.easingFunction,void 0),u=this._getFlyToCenter(e),d=this._getFlyToExtent(e),p=function(t){e.complete instanceof Function&&e.complete(t)};Object(n.isNull)(u)?Object(n.isNull)(d)||this._innerView.camera.flyTo({destination:Cesium.Rectangle.fromDegrees(d.xmin,d.ymin,d.xmax,d.ymax),duration:t,orientation:i,complete:p,cancel:r,endTransform:a,maximumHeight:o,flyOverLongitude:s,flyOverLongitudeWeight:l,convert:h,easingFunction:c}):this._innerView.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(u.coordinates[0],u.coordinates[1],u.coordinates[2]),duration:t,orientation:i,complete:p,cancel:r,endTransform:a,maximumHeight:o,flyOverLongitude:s,flyOverLongitudeWeight:l,convert:h,easingFunction:c})}goTo(e={},t={}){let i,r,a=new Promise(e=>{e()});if(this._innerView){let o;if(Object(n.isNull)(e.center)&&Object(n.isNull)(e.zoom)&&Object(n.isNull)(e.scale)||(i=Object(n.isNull)(e.center)?this._center:this._getFlyToCenter({center:e.center}),r=!Object(n.isNull)(e.scale)&&e.scale>0?this._getZoomByScale(e.scale):!Object(n.isNull)(e.zoom)&&e.zoom>0?e.zoom:this._zoom),!Object(n.isNull)(e.target)){const t=this._getTargetExtent(e.target);t.xmin!==t.xmax&&t.ymin!==t.ymax?o=t:i=this._getFlyToCenter({center:new n.Point({coordinates:[t.xmin,t.ymin]})})}const s={animate:!0,duration:.2};let l;if(Object(n.isNull)(t)||(Object(n.isNull)(t.animate)||(s.animate=t.animate),Object(n.isNull)(t.duration)||(s.duration=t.duration/1e3),Object(n.isNull)(t.orientation)||(s.orientation=t.orientation)),Object(n.isNull)(i))Object(n.isNull)(o)||(l=Cesium.Rectangle.fromDegrees(o.xmin,o.ymin,o.xmax,o.ymax));else{let e;e=r?this._getAltitudeByZoom(r):void 0!==i.coordinates[2]?i.coordinates[2]:this._getAltitudeByZoom(this._zoom),l=Cesium.Cartesian3.fromDegrees(i.coordinates[0],i.coordinates[1],e)}l&&(a=new Promise(e=>{const t={destination:l,complete:function(){e()}};Object.assign(t,s),this._innerView.camera.flyTo(t)}))}return a}_createLayerView(e){let t=null;return e&&e.autoAddTo3D&&(t=function(e,t){let i=null;switch(t.type){case n.LayerType.vectorTile:case n.LayerType.igsVectorTile:case n.LayerType.arcgisVectorTile:i=new mc({view:e,layer:t});break;case n.LayerType.wmts:i=new vc({view:e,layer:t});break;case n.LayerType.igsMapImage:i=new _c({view:e,layer:t});break;case n.LayerType.igsTile:i=new bc({view:e,layer:t});break;case n.LayerType.wms:i=new gc({view:e,layer:t});break;case n.LayerType.m3d:i=new xc({view:e,layer:t});break;case n.LayerType.cesium3DTiles:i=new Cc({view:e,layer:t});break;case n.LayerType.scene:i=new vr({view:e,layer:t});break;case n.LayerType.terrain:i=new Sc({view:e,layer:t});break;case n.LayerType.echarts:i=new Tc({view:e,layer:t});break;case n.LayerType.mapv:i=new Ic({view:e,layer:t});break;case n.LayerType.group:i=new Oc({view:e,layer:t});break;case n.LayerType.graphics:i=new Ec({view:e,layer:t,render:new Fc});break;case n.LayerType.igsFeature:i=new Pc({view:e,layer:t,render:new Fc});break;case n.LayerType.geojson:i=new Rc({view:e,layer:t,render:new Fc});break;case n.LayerType.wfs:i=new jc({view:e,layer:t,render:new Fc});break;case n.LayerType.m3dCache:i=new Ac({view:e,layer:t});break;case n.LayerType.arcgisMapImage:i=new zc({view:e,layer:t});break;case n.LayerType.arcgisTile:i=new Dc({view:e,layer:t});break;case n.LayerType.webTileLayer:i=new Vc({view:e,layer:t})}return i}(this,e)),t}toJSON(){return super.toJSON()}toMap(e){let t=null;const i=new Cesium.Cartesian2(e.x,e.y);if(this._innerView.scene.globe.translucency.enabled||!this._innerView.scene.globe.depthTestAgainstTerrain){const e=this._innerView.camera.getPickRay(i);t=this._innerView.scene.globe.pick(e,this._innerView.scene)}else i.y=i.y+1,t=this._innerView.scene.pickPosition(i);let r=null;if(t&&!Object(n.isNull)(t)){const e=this._innerView.scene.globe.ellipsoid.cartesianToCartographic(t),i=Cesium.Math.toDegrees(e.longitude),a=Cesium.Math.toDegrees(e.latitude),o=e.height;r=new n.Point({coordinates:[i,a,o]})}return r}toScreen(e){const t=Cesium.Cartesian3.fromDegrees(e.coordinates[0],e.coordinates[1],e.coordinates[2]);return Cesium.SceneTransforms.wgs84ToWindowCoordinates(this._innerView.scene,t)}getSize(){return{x:this._innerView._container.clientWidth,y:this._innerView._container.clientHeight}}getCenter(){const e=Cesium.Cartographic.fromCartesian(this._innerView.camera.position),t=Cesium.Math.toDegrees(e.longitude),i=Cesium.Math.toDegrees(e.latitude),r=e.height,a=new n.Point({coordinates:[t,i,r]});return this._center=a,a}setCenter(e){if(!this._innerView||!this._center)return;let t=!1;const i=this._center.coordinates[2];Array.isArray(e)&&e.length>1?(this._center=new n.Point({coordinates:[e[0],e[1],i]}),t=!0):e instanceof n.Point&&(this._center=new n.Point({coordinates:[e.coordinates[0],e.coordinates[1],i]}),t=!0),t&&this.flyTo({center:this._center})}getExtent(){if(!this._innerView)return;const e=this._innerView.camera.computeViewRectangle();let t;return t=e?new n.Extent({xmin:e.west/Math.PI*180,ymin:e.south/Math.PI*180,xmax:e.east/Math.PI*180,ymax:e.north/Math.PI*180}):new n.Extent({xmin:-180,ymin:-90,xmax:180,ymax:90}),this._extent=t,t}setExtent(e){this._innerView&&(this._extent=e,this.flyTo({extent:e}))}getInnerLayer(e){if(e instanceof n.Layer)return super.getInnerLayer(e);if(e instanceof n.IGSSceneSubLayer){const t=super.getInnerLayer(e.layer);for(let i=0;i<t.length;i++)if(t[i]._layerIndex===e.layerIndex)return t[i]}}_initPopup(){this.popup=new fc({view:this})}hitTest(e){const t=[];return this._innerView.scene.drillPick({x:e.x,y:e.y}).forEach(i=>{if(i.primitive){const r=i.primitive,a=this.getLayer(r.commonLayerId);if(Object(n.isNull)(r.commonLayerId))return;let o=null;if(a.type===n.LayerType.igsFeature||a.type===n.LayerType.geojson){o=this._getLayerView(a)._featureSetCache.filter(e=>{if(e.id===r.commonFeatureId)return e})}else a.type===n.LayerType.graphics&&(o=a.graphics.filter(e=>{if(e.id===r.commonFeatureId)return e}));const s={graphic:o&&o.items.length>0?o.items[0]:null,layer:a,mapPoint:this.toMap(e),type:"graphic"};t.push(s)}}),t}_cameraMoveEndHandler(){this.getCenter(),this.getExtent(),this.getZoom(),this.getScale(),this._showLayerByScale()}_initSize(){const e=this._innerView.canvas;this.width=e.width,this.height=e.height}_setCursor(e){this._innerView&&(e&&null!==e?(this._innerView._container.style.cursor=e,this._innerView.canvas.style.cursor=e):(this._innerView._container.style.removeProperty("cursor"),this._innerView.canvas.style.removeProperty("cursor")),this._cursor=e)}_initScale(){if(this.scale&&this._center){const e=this._getZoomByScale(this.scale),t=this._getAltitudeByZoom(e);if(t){this.zoom=e;const i=this._center.coordinates[0],r=this._center.coordinates[1];this._center=new n.Point({coordinates:[i,r,t]}),this.flyTo({center:this._center})}}}_initZoom(){if(!this.scale&&!Object(n.isNull)(this._zoom)&&this._center&&this._center.coordinates[2]){const e=this._getZoomByAltitude(this._center.coordinates[2]),t=this._getAltitudeByZoom(this._zoom);if(t){this._zoom=e,this.scale=this._getScaleByZoom(this.zoom);const i=this._center.coordinates[0],r=this._center.coordinates[1];this._center=new n.Point({coordinates:[i,r,t]}),this.flyTo({center:this._center})}}if(this.maxZoom){const e=this._getAltitudeByZoom(this.maxZoom);this._innerView.scene.screenSpaceCameraController.minimumZoomDistance=e}if(this.minZoom){const e=this._getAltitudeByZoom(this.minZoom);this._innerView.scene.screenSpaceCameraController.maximumZoomDistance=e}}_initExtent(){this.flyTo({extent:this._extent})}getZoom(){const e=this._getZoomByAltitude(this._center.coordinates[2]);this._zoom=e}setZoom(e){if(this._innerView&&!Object(n.isNull)(this._zoom)&&this._center){const t=this._getAltitudeByZoom(e);if(t){this._zoom=e;const i=this._center.coordinates[0],r=this._center.coordinates[1],a=new n.Point({coordinates:[i,r,t]});this.flyTo({center:a})}}}_setZoomAndCenter(e){if(this._innerView&&!Object(n.isNull)(e.zoom)&&!Object(n.isNull)(e.center)){const t=e.center.coordinates[0],i=e.center.coordinates[1],r=this._getAltitudeByZoom(e.zoom);if(r){this._zoom=e.zoom;const a=new n.Point({coordinates:[t,i,r]});this._center=a,this.flyTo({center:a})}}}getScale(){const e=this._getScaleByZoom(this._zoom);return this._scale=e,e}setScale(e){if(this._innerView&&this._scale&&this._center){this._scale=e;const t=this._getZoomByScale(e),i=this._getAltitudeByZoom(t);if(i){const e=this._center.coordinates[0],t=this._center.coordinates[1],r=new n.Point({coordinates:[e,t,i]});this.flyTo({center:r})}}}_getZoomByScale(e){const t=e/(96/.0254);return Math.round(Math.log2(156543.03392804062/t))}_getScaleByZoom(e){return 96/.0254*(156543.03392804062/Math.pow(2,e))}takeScreenshot(e){e.view=this;let t=null;return this._screenshot?t=this._screenshot._addView():(this._screenshot=new pc(e),t=this._screenshot._addView()),t}_getZoomByAltitude(e){const t=-40467.74;return Math.round(t+80955.31/(1+Math.pow(e/91610.74,7096758e-11)))}_getAltitudeByZoom(e){const t=-40467.74;return 91610.74*Math.pow(80955.31/(e-t)-1,1/7096758e-11)}_moveLayerView(e,t){let i=t;const r=e.innerView;let n,a;if(e instanceof Ec||e instanceof Rc||e instanceof Pc||e instanceof jc||t instanceof Ec||t instanceof Rc||t instanceof Pc||t instanceof jc){n=r.scene._primitives._primitives.indexOf(e.innerLayer._allPrimitives);let t=(a=r.scene._primitives._primitives.indexOf(i.innerLayer._allPrimitives))-n;if(t>1)for(let i=0;i<t-1;i++)r.scene._primitives.raise(e.innerLayer._allPrimitives);else if(t<0){t=Math.abs(t);for(let e=0;e<t;e++)r.scene._primitives.raise(i.innerLayer._allPrimitives)}}else if(!(e instanceof Ec||e instanceof Rc||e instanceof Pc||e instanceof jc||t instanceof Ec||t instanceof Rc||t instanceof Pc||t instanceof jc)&&this._isLayerViewSupportReorder(e)){if(!this._isLayerViewSupportReorder(t)){const e=this.allLayerViews.toArray();for(let r=this.allLayerViews.indexOf(t)+1;r<e.length;r++)if(this._isLayerViewSupportReorder(e[r])){i=e[r];break}}n=r.imageryLayers.indexOf(e.innerLayer);let o=(a=r.imageryLayers.indexOf(i.innerLayer))-n;if(o>1)for(let t=0;t<o-1;t++)r.imageryLayers.raise(e.innerLayer);else if(o<0){o=Math.abs(o);for(let e=0;e<o;e++)r.imageryLayers.raise(i.innerLayer)}}}}Uc.fromJSON=function(e){return e=Object(n.defaultValue)(e,{}),new Uc(e)},Object.defineProperties(Uc.prototype,{scale:{get(){return this._scale},set(e){this.setScale(e)}},zoom:{get(){return this._zoom},set(e){this.setZoom(e)}},center:{get(){return this._center},set(e){this.setCenter(e)}},extent:{get(){return this._extent},set(e){this.setExtent(e)}},spatialReference:{get(){return this._spatialReference},set(e){this._spatialReference=e}}});var Wc=Uc;var Hc=class extends n.SketchEditor3D{constructor(e){super(e),this.arcType=Object(n.defaultValue)(e.arcType,n.ArcType.rhumb)}addVertex(e,t){return this._getHight&&(e.coordinates[2]=this._getHight()),this._drawTool.addVertex(e,t)}updateVertex(e,t){return this._getHight&&(e.coordinates[2]=this._getHight()),this._drawTool.updateVertex(e,t)}removeVertex(e){return this._drawTool.removeVertex(e)}split(e,t){return super.split(e,t)}drawPolylineToPolygon(e){super.drawPolylineToPolygon(e)}_initLayerEvent(){}_hitTestSketchEvent(){const e=this,t=t=>{if(!t||!t.x||!t.y)return;if(e._drawTool&&e._drawTool._editMode===n.SketchEditMode.DRAWING)return;let i=void 0,r=!1;if(e._drawTool&&e._drawTool.sketchStage&&e._drawTool.sketchStage.selectBoxGraphics.length>0&&e.view._innerView.scene.drillPick({x:t.x,y:t.y}).forEach(n=>{if(n.primitive&&(e._layer&&e._layer.id===n.primitive.commonLayerId||e._sketchInnerLayer.id===n.primitive.commonLayerId)&&e._drawTool.sketchStage.entityGraphic.id===n.primitive.commonFeatureId){const a=e.view._innerView.camera.getPickRay({x:t.x,y:t.y}),o=e.view._innerView.scene.pickFromRay(a,[n.primitive]);o&&o.object&&o.object.primitive&&(r=!0,i=o.object)}}),r||(i=e.view._innerView.scene.pick({x:t.x,y:t.y})),i&&i.primitive&&(e._layer&&e._layer.id===i.primitive.commonLayerId||e._sketchInnerLayer.id===i.primitive.commonLayerId)){let r=e._drawTool?e._drawTool._getDrawToolByFeatureId(i.primitive.commonFeatureId):void 0;if(!r&&(!e._drawTool||e._drawTool.sketchStage.entityGraphic&&"drawn"===e._drawTool.state)){const t=e.view.getLayer(i.primitive.commonLayerId).graphics.filter(e=>{if(e.id===i.primitive.commonFeatureId)return e});if(!(t&&t.items.length>0))return;{const i=t.items[0];e._drawTool&&e._drawTool._clearEditGraphics(e._drawTool._editMode),this._addFeatureToSketchEditor(i),e._undoRedoManager.reset(),e._drawTools=[e._drawTool],r=e._drawTool}}if(!r||r===e._drawTool&&"drawn"!==r.state)return;if(0===r.editOption._hitTestMode){const i=()=>{if(e._editable&&(void 0===e._drawTool||null===e._drawTool||3!==e._drawTool._editMode)){if(r.hitTestFeature(r.sketchStage.entityGraphic,t),void 0!==e._drawTool&&null!==e._drawTool&&(e.fire("selected",{isSelected:!0,selectedDrawTool:e._drawTool,selectedGeometry:e._drawTool.sketchStage.entityGraphic.geometry},e),!r._parent&&0===r._editMode)){const t=new n.SketchEditorEvent({type:n.SketchEditorEventType.update,target:e,toolEventInfo:null,state:n.SketchEditorState.start,feature:e._drawTool.sketchStage.entityGraphic,geometry:e._drawTool.sketchStage.entityGraphic.geometry});e.fire(n.SketchEditorEventType.update,t)}e.view.off(n.ViewEventType.mouseUp,i)}};e.view.on(n.ViewEventType.mouseUp,i)}else{if(!e._editable)return;if(void 0!==e._drawTool&&null!==e._drawTool&&3===e._drawTool._editMode)return;r.hitTestFeature(r.sketchStage.entityGraphic,t)}}};this._hitTestSketchHandler||(this.view.on(n.ViewEventType.mouseDown,t),this._hitTestSketchHandler=t)}_getCenterCoordinate(e,t,i){let r;return 2===(i=void 0!==i?i:this.arcType)&&(r=Ii.a.calcRhumbArcCenter(e,t)),r=1===i?Ii.a.calcCartesianArcCenter(e,t):[(e[0]+t[0])/2,(e[1]+t[1])/2]}_getHight(){return 0}};var Yc=class{static async fromUrl(e,t){const i=new n.ArcGISTileLayer({url:e}),r=await i.load(),a=jr.initializeOptions(r);return new Cesium.UrlTemplateImageryProvider({...a,...t})}};var Xc=class{static async fromUrl(e,t){const i=new n.WMSLayer({url:e}),r=await i.load(),a=Pr.initializeOptions(r);return new Cesium.WebMapServiceImageryProvider({...a,...t})}};var Jc=class{static async fromUrl(e,t={}){t=Object(n.defaultValue)(t,{});const i=new n.WMTSLayer({url:e}),r=await i.load(),a=Gr.initializeOptions(r),o=new Cesium.WebMapTileServiceImageryProvider({...a,...t});return o.isStretchImage=Object(n.defaultValue)(t.isStretchImage,!1),o}};var $c=class extends Gl{static async fromUrl(e,t){const i=new n.ArcGISVectorTileLayer({url:e}),r=await i.load(),a=Bl.initializeOptions(r);return new Gl({...a,...t})}};var Kc=class{static fromUrl(e,t){const i=new n.M3DModelCacheLayer({url:e}),r=Ul.initializeOptions(i);return(t||t.viewer)&&(r._scene=t.viewer.scene),new Cesium.MapGISM3DSet({...r,...t})}};function Zc(){Cesium.ImageryLayer.prototype._createTileImagerySkeletons=function(e,t,i){const r=e.data;if(Cesium.defined(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(Cesium.defined(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;const n=this._imageryProvider;if(Cesium.defined(i)||(i=r.imagery.length),!Cesium.defined(n))return this._skeletonPlaceholder.loadingImagery.addReference(),r.imagery.splice(i,0,this._skeletonPlaceholder),!0;const a=n.tilingScheme.projection instanceof Cesium.WebMercatorProjection&&e.rectangle.north<Cesium.WebMercatorProjection.MaximumLatitude&&e.rectangle.south>-Cesium.WebMercatorProjection.MaximumLatitude,o=Cesium.Rectangle.intersection(n.rectangle,this._rectangle,this.imageryBoundsScratch);let s=Cesium.Rectangle.intersection(e.rectangle,o,this.tileImageryBoundsScratch);if(!Cesium.defined(s)){if(!this.isBaseLayer())return!1;const t=o,i=e.rectangle;s=this.tileImageryBoundsScratch,i.south>=t.north?(s.north=t.north,s.south=t.north):i.north<=t.south?(s.north=t.south,s.south=t.south):(s.south=Math.max(i.south,t.south),s.north=Math.min(i.north,t.north)),i.west>=t.east?(s.west=t.east,s.east=t.east):i.east<=t.west?(s.west=t.west,s.east=t.west):(s.west=Math.max(i.west,t.west),s.east=Math.min(i.east,t.east))}let l=0;s.south>0?l=s.south:s.north<0&&(l=s.north);let h=function(e,t,i){const r=e._imageryProvider,n=r.tilingScheme,a=n.ellipsoid,o=kr.isGeographic(e._imageryProvider.tilingScheme.projection)?1:Math.cos(i);let s=0,l=t;if(kr.isGeographic(e._imageryProvider.tilingScheme.projection)&&(l=t/(Math.PI*a.maximumRadius*o/180)),n._tileInfo&&n.getTileLevelByResolution)s=n.getTileLevelByResolution(l);else{const e=n.rectangle.width,i=a.maximumRadius*e*o/(r.tileWidth*n.getNumberOfXTilesAtLevel(0))/t;s=Math.log(i)/Math.log(2)}return Math.round(s)||0}(this,1*t.getLevelMaximumGeometricError(e.level),l);h=Math.max(0,h);const c=n.maximumLevel,u=!(void 0!==n.isStretchImage&&!n.isStretchImage);if(h>c){if(!u)return!1;h=c}if(Cesium.defined(n.minimumLevel)){const e=n.minimumLevel;if(h<e){if(!u)return!1;h=e}}const d=n.tilingScheme,p=d.positionToTileXY(Cesium.Rectangle.northwest(s),h),f=d.positionToTileXY(Cesium.Rectangle.southeast(s),h);let m=e.rectangle.width/512,y=e.rectangle.height/512;const g=d.tileXYToRectangle(p.x,p.y,h);Math.abs(g.south-e.rectangle.north)<y&&p.y<f.y&&++p.y,Math.abs(g.east-e.rectangle.west)<m&&p.x<f.x&&++p.x;const v=d.tileXYToRectangle(f.x,f.y,h);Math.abs(v.north-e.rectangle.south)<y&&f.y>p.y&&--f.y,Math.abs(v.west-e.rectangle.east)<m&&f.x>p.x&&--f.x;const b=Cesium.Rectangle.clone(e.rectangle,this.terrainRectangleScratch),_=d.tileXYToRectangle(p.x,p.y,h),w=d.tileXYToRectangle(f.x,f.y,h);let x,C,S=new Cesium.Rectangle(_.west,w.south,w.east,_.north),M=Cesium.Rectangle.intersection(S,o,this.clippedRectangleScratch);a?(d.rectangleToNativeRectangle(b,b),d.rectangleToNativeRectangle(S,S),d.rectangleToNativeRectangle(M,M),d.rectangleToNativeRectangle(o,o),x=d.tileXYToNativeRectangle.bind(d),m=b.width/512,y=b.height/512):x=d.tileXYToRectangle.bind(d);let k,T=0,I=1;!this.isBaseLayer()&&M&&Math.abs(M.west-b.west)>=m&&(T=Math.min(1,(M.west-b.west)/b.width)),!this.isBaseLayer()&&M&&Math.abs(M.north-b.north)>=y&&(I=Math.max(0,(M.north-b.south)/b.height));const O=I,E=[],L=[];let P,R=void 0,j=void 0;if(d._axisDirection&&d._axisDirection.y>0){for(P=p.y;P>=f.y;P--)E.push(P);j=f.y}else{for(P=p.y;P<=f.y;P++)E.push(P);j=p.y}if(d._axisDirection&&d._axisDirection.x<0){for(P=p.x;P>=f.x;P--)L.push(P);R=f.x}else{for(P=p.x;P<=f.x;P++)L.push(P);R=p.x}for(let e=0;e<L.length;e++){const t=L[e];C=T;const n=x(t,j,h),s=x(t,Math.max(...E),h);if(S=new Cesium.Rectangle(Math.min(n.west,s.west),Math.min(n.south,s.south),Math.max(n.east,s.east),Math.max(n.north,s.north)),M=Cesium.Rectangle.simpleIntersection(S,o,this.clippedRectangleScratch),Cesium.defined(M)){T=Math.min(1,(M.east-b.west)/b.width),t===f.x&&(this.isBaseLayer()||Math.abs(M.east-b.east)<m)&&(T=1),I=O;for(let e=0;e<E.length;e++){const n=E[e];if(k=I,S=x(t,n,h),M=Cesium.Rectangle.simpleIntersection(S,o,this.clippedRectangleScratch),!Cesium.defined(M))continue;I=Math.max(0,(M.south-b.south)/b.height),n===f.y&&(this.isBaseLayer()||Math.abs(M.south-b.south)<y)&&(I=0);const s=new Cesium.Cartesian4(C,I,T,k),l=this.getImageryFromCache(t,n,h);r.imagery.splice(i,0,new Cesium.TileImagery(l,s,a)),++i}}}return!0},Cesium.ImageryLayer.prototype._requestImagery=function(e){const t=this._imageryProvider,i=this;function r(t){if(!Cesium.defined(t))return n();e.image=t,e.state=Cesium.ImageryState.RECEIVED,e.request=void 0,Cesium.TileProviderError.handleSuccess?Cesium.TileProviderError.handleSuccess(i._requestImageError):Cesium.TileProviderError.reportSuccess(i._requestImageError)}function n(r){if(e.request.state===Cesium.RequestState.CANCELLED)return e.state=Cesium.ImageryState.UNLOADED,void(e.request=void 0);e.state=Cesium.ImageryState.FAILED,e.request=void 0;const n="Failed to obtain image tile X: "+e.x+" Y: "+e.y+" Level: "+e.level+".";Cesium.TileProviderError.handleError?i._requestImageError=Cesium.TileProviderError.handleError(i._requestImageError,t,t.errorEvent,n,e.x,e.y,e.level,a,r):(i._requestImageError=Cesium.TileProviderError.reportError(i._requestImageError,t,t.errorEvent,n,e.x,e.y,e.level,r),i._requestImageError.retry&&a())}function a(){const i=new Cesium.Request({throttle:!1,throttleByServer:!0,type:Cesium.RequestType.IMAGERY});let a;e.request=i,e.state=Cesium.ImageryState.TRANSITIONING,a=t instanceof Cesium.WebMapTileServiceImageryProvider&&Cesium.defined(t._tileMatrixLabels)?e.level:function(e){let i=e.level;t.tilingScheme&&t.tilingScheme._tileInfo&&(i=t.tilingScheme._tileInfo.lods[e.level].level);return i}(e);const o=t.requestImage(e.x,e.y,a,i);if(!Cesium.defined(o))return e.state=Cesium.ImageryState.UNLOADED,void(e.request=void 0);Cesium.defined(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),"function"==typeof o.then?o.then(r,n):Promise.resolve(o).then(r,n)}a()}}let Qc;function eu(){if(window.Cesium){try{n.Log.info("Cesium原型链修改完毕"),Zc()}catch(e){console.error(e)}window.removeEventListener("load",eu),window.document.removeEventListener("readystatechange",eu),window.document.removeEventListener("DOMContentLoaded",eu),window.clearInterval(Qc)}}window.addEventListener("load",eu),window.document.addEventListener("readystatechange",eu),window.document.addEventListener("DOMContentLoaded",eu),Qc=setInterval(()=>{eu()},20),i.d(t,"SceneViewCesium",function(){return Wc}),i.d(t,"SceneView",function(){return Wc}),i.d(t,"SketchEditorCesium",function(){return Hc}),i.d(t,"SketchEditor",function(){return Hc}),i.d(t,"CesiumInnerGraphicsLayer",function(){return rc}),i.d(t,"getTilingScheme",function(){return $l}),i.d(t,"getProviderExtent",function(){return Zl}),i.d(t,"MapGISMapServerImageryProvider",function(){return oh}),i.d(t,"MapGISTileServerImageryProvider",function(){return zr}),i.d(t,"CustomTilingScheme",function(){return gr}),i.d(t,"MapGISVectorTileImageryProvider",function(){return Gl}),i.d(t,"ArcGISMapServerImageryProvider",function(){return Ir}),i.d(t,"ArcGISTileServerImageryProvider",function(){return Yc}),i.d(t,"WebMapServiceImageryProvider",function(){return Xc}),i.d(t,"WebMapTileServiceImageryProvider",function(){return Jc}),i.d(t,"UrlTemplateImageryProvider",function(){return Yl}),i.d(t,"ArcGISVectorTileImageryProvider",function(){return $c}),i.d(t,"MapGISTerrainProvider",function(){return Mr}),i.d(t,"MapGISM3DSet",function(){return Kc}),i.d(t,"initializeOptions",function(){return nh}),i.d(t,"EchartsLayer",function(){return dc}),i.d(t,"MapvLayer",function(){return gh}),i.d(t,"GeoJSONLayerUtil",function(){return ac}),i.d(t,"GraphicsLayerUtil",function(){return oc}),i.d(t,"IGSFeatureLayerUtil",function(){return sc}),i.d(t,"WFSLayerUtil",function(){return lc}),i.d(t,"Screenshot",function(){return pc}),i.d(t,"Popup",function(){return fc}),i.d(t,"MapGISTileAvailability",function(){return Cr}),n.zondy.cesium={},n.zondy.cesium.MapGISMapServerImageryProvider=oh,n.zondy.cesium.MapGISTileServerImageryProvider=zr,n.zondy.cesium.MapGISVectorTileImageryProvider=Gl,n.zondy.cesium.ArcGISMapServerImageryProvider=Ir,n.zondy.cesium.ArcGISTileServerImageryProvider=Yc,n.zondy.cesium.ArcGISVectorTileImageryProvider=$c,n.zondy.cesium.WebMapServiceImageryProvider=Xc,n.zondy.cesium.WebMapTileServiceImageryProvider=Jc,n.zondy.cesium.UrlTemplateImageryProvider=Yl,n.zondy.cesium.MapGISTerrainProvider=Mr,n.zondy.cesium.MapGISTileAvailability=Cr,n.zondy.cesium.layer={},n.zondy.cesium.layer.EchartsLayer=dc,n.zondy.cesium.layer.MapVLayer=gh,n.zondy.cesium.layer.GraphicsLayer=rc,n.zondy.cesium.tool={},n.zondy.cesium.tool.sketch={},n.zondy.cesium.tool.sketch.SketchEditor=Hc,n.zondy.cesium.tool.Screenshot=pc,n.zondy.cesium.widget={},n.zondy.cesium.widget.Popup=fc,n.zondy.cesium.util={},n.zondy.cesium.util.getTilingScheme=$l,n.zondy.cesium.util.getProviderExtent=Zl,n.zondy.cesium.util.initializeOptions=nh,n.zondy.cesium.util.GeoJSONLayerUtil=ac,n.zondy.cesium.util.GraphicsLayerUtil=oc,n.zondy.cesium.util.IGSFeatureLayerUtil=sc,n.zondy.cesium.WFSLayerUtil=lc,n.zondy.cesium.CustomTilingScheme=gr,n.zondy.cesium.MapGISM3DSet=Kc,n.zondy.cesium.SceneView=Wc,n.zondy.cesium.VERSION="17.2.2",n.Zondy.CesiumInnerGraphicsLayer=rc,n.Zondy.MapGISMapServerImageryProvider=oh,n.Zondy.MapGISTileServerImageryProvider=zr,n.Zondy.MapGISVectorTileImageryProvider=Gl,n.Zondy.ArcGISMapServerImageryProvider=Ir,n.Zondy.ArcGISTileServerImageryProvider=Yc,n.Zondy.ArcGISVectorTileImageryProvider=$c,n.Zondy.WebMapServiceImageryProvider=Xc,n.Zondy.WebMapTileServiceImageryProvider=Jc,n.Zondy.UrlTemplateImageryProvider=Yl,n.Zondy.MapGISTerrainProvider=Mr,n.Zondy.MapGISTileAvailability=Cr,n.Zondy.EchartsLayer=dc,n.Zondy.MapvLayer=gh,n.Zondy.SketchEditorCesium=Hc,n.Zondy.Screenshot=pc,n.Zondy.Popup=fc,n.Zondy.getTilingScheme=$l,n.Zondy.getProviderExtent=Zl,n.Zondy.initializeOptions=nh,n.Zondy.GeoJSONLayerUtil=ac,n.Zondy.GraphicsLayerUtil=oc,n.Zondy.IGSFeatureLayerUtil=sc,n.Zondy.WFSLayerUtil=lc,n.Zondy.CustomTilingScheme=gr,n.Zondy.MapGISM3DSet=Kc,n.Zondy.SceneViewCesium=Wc,n.Zondy.PluginVersion=n.zondy.cesium.VERSION}])});
16
+ */var hn={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function cn(e,t,i){return i?(i[0]=e[0]-t,i[1]=e[1]-t,i[2]=e[2]+t,i[3]=e[3]+t,i):[e[0]-t,e[1]-t,e[2]+t,e[3]+t]}function un(e,t,i){var r,n;return(r=t<e[0]?e[0]-t:e[2]<t?t-e[2]:0)*r+(n=i<e[1]?e[1]-i:e[3]<i?i-e[3]:0)*n}function dn(e,t,i){return e[0]<=t&&t<=e[2]&&e[1]<=i&&i<=e[3]}function pn(e,t){var i=e[0],r=e[1],n=e[2],a=e[3],o=t[0],s=t[1],l=hn.UNKNOWN;return o<i?l|=hn.LEFT:o>n&&(l|=hn.RIGHT),s<r?l|=hn.BELOW:s>a&&(l|=hn.ABOVE),l===hn.UNKNOWN&&(l=hn.INTERSECTING),l}function fn(e,t,i,r,n){return n?(n[0]=e,n[1]=t,n[2]=i,n[3]=r,n):[e,t,i,r]}function mn(e){return fn(1/0,1/0,-1/0,-1/0,e)}function yn(e,t){var i=e[0],r=e[1];return fn(i,r,i,r,t)}function gn(e,t,i,r,n){return bn(mn(n),e,t,i,r)}function vn(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function bn(e,t,i,r,n){for(;i<r;i+=n)_n(e,t[i],t[i+1]);return e}function _n(e,t,i){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],i),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],i)}function wn(e){return[e[0],e[1]]}function xn(e){return[e[2],e[1]]}function Cn(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function Sn(e){return e[3]-e[1]}function Mn(e){return[e[0],e[3]]}function kn(e){return[e[2],e[3]]}function Tn(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function In(e,t,i){var r=[e[0],e[1],e[0],e[3],e[2],e[1],e[2],e[3]];return t(r,r,2),function(e,t,i){return fn(Math.min.apply(null,e),Math.min.apply(null,t),Math.max.apply(null,e),Math.max.apply(null,t),i)}([r[0],r[2],r[4],r[6]],[r[1],r[3],r[5],r[7]],i)}var On={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},En={};En[On.DEGREES]=2*Math.PI*6370997/360,En[On.FEET]=.3048,En[On.METERS]=1,En[On.USFEET]=1200/3937;var Ln=On,Pn=function(e){this.code_=e.code,this.units_=e.units,this.extent_=void 0!==e.extent?e.extent:null,this.worldExtent_=void 0!==e.worldExtent?e.worldExtent:null,this.axisOrientation_=void 0!==e.axisOrientation?e.axisOrientation:"enu",this.global_=void 0!==e.global&&e.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit};Pn.prototype.canWrapX=function(){return this.canWrapX_},Pn.prototype.getCode=function(){return this.code_},Pn.prototype.getExtent=function(){return this.extent_},Pn.prototype.getUnits=function(){return this.units_},Pn.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||En[this.units_]},Pn.prototype.getWorldExtent=function(){return this.worldExtent_},Pn.prototype.getAxisOrientation=function(){return this.axisOrientation_},Pn.prototype.isGlobal=function(){return this.global_},Pn.prototype.setGlobal=function(e){this.global_=e,this.canWrapX_=!(!e||!this.extent_)},Pn.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},Pn.prototype.setDefaultTileGrid=function(e){this.defaultTileGrid_=e},Pn.prototype.setExtent=function(e){this.extent_=e,this.canWrapX_=!(!this.global_||!e)},Pn.prototype.setWorldExtent=function(e){this.worldExtent_=e},Pn.prototype.setGetPointResolution=function(e){this.getPointResolutionFunc_=e},Pn.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var Rn=Pn,jn=6378137,An=Math.PI*jn,zn=[-An,-An,An,An],Dn=[-180,-85,180,85],Vn=function(e){function t(t){e.call(this,{code:t,units:Ln.METERS,extent:zn,global:!0,worldExtent:Dn,getPointResolution:function(e,t){return e/nn(t[1]/jn)}})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Rn),Nn=[new Vn("EPSG:3857"),new Vn("EPSG:102100"),new Vn("EPSG:102113"),new Vn("EPSG:900913"),new Vn("urn:ogc:def:crs:EPSG:6.18:3:3857"),new Vn("urn:ogc:def:crs:EPSG::3857"),new Vn("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Gn(e,t,i){var r=e.length,n=i>1?i:2,a=t;void 0===a&&(a=n>2?e.slice():new Array(r));for(var o=An,s=0;s<r;s+=n){a[s]=o*e[s]/180;var l=jn*Math.log(Math.tan(Math.PI*(e[s+1]+90)/360));l>o?l=o:l<-o&&(l=-o),a[s+1]=l}return a}function Fn(e,t,i){var r=e.length,n=i>1?i:2,a=t;void 0===a&&(a=n>2?e.slice():new Array(r));for(var o=0;o<r;o+=n)a[o]=180*e[o]/An,a[o+1]=360*Math.atan(Math.exp(e[o+1]/jn))/Math.PI-90;return a}var Bn=[-180,-90,180,90],qn=6378137*Math.PI/180,Un=function(e){function t(t,i){e.call(this,{code:t,units:Ln.DEGREES,extent:Bn,axisOrientation:i,global:!0,metersPerUnit:qn,worldExtent:Bn})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Rn),Wn=[new Un("CRS:84"),new Un("EPSG:4326","neu"),new Un("urn:ogc:def:crs:EPSG::4326","neu"),new Un("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new Un("urn:ogc:def:crs:OGC:1.3:CRS84"),new Un("urn:ogc:def:crs:OGC:2:84"),new Un("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Un("urn:x-ogc:def:crs:EPSG:4326","neu")],Hn={};var Yn={};function Xn(e,t,i){var r=e.getCode(),n=t.getCode();r in Yn||(Yn[r]={}),Yn[r][n]=i}function $n(e,t,i){var r;if(void 0!==t){for(var n=0,a=e.length;n<a;++n)t[n]=e[n];r=t}else r=e.slice();return r}function Jn(e,t,i){if(void 0!==t&&e!==t){for(var r=0,n=e.length;r<n;++r)t[r]=e[r];e=t}return e}function Kn(e){!function(e,t){Hn[e]=t}(e.getCode(),e),Xn(e,e,$n)}function Zn(e){return"string"==typeof e?function(e){return Hn[e]||null}(e):e||null}function Qn(e){!function(e){e.forEach(Kn)}(e),e.forEach(function(t){e.forEach(function(e){t!==e&&Xn(t,e,$n)})})}function ea(e,t){var i=function(e,t){var i;return e in Yn&&t in Yn[e]&&(i=Yn[e][t]),i}(e.getCode(),t.getCode());return i||(i=Jn),i}function ta(e,t){return ea(Zn(e),Zn(t))}Qn(Nn),Qn(Wn),function(e,t,i,r){e.forEach(function(e){t.forEach(function(t){Xn(e,t,i),Xn(t,e,r)})})}(Wn,Nn,Gn,Fn);var ia=function(){this.dataProjection=null,this.defaultFeatureProjection=null};ia.prototype.getReadOptions=function(e,t){var i;return t&&(i={dataProjection:t.dataProjection?t.dataProjection:this.readProjection(e),featureProjection:t.featureProjection}),this.adaptOptions(i)},ia.prototype.adaptOptions=function(e){return Qr({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},e)},ia.prototype.getLastExtent=function(){return null},ia.prototype.getType=function(){return Wr()},ia.prototype.readFeature=function(e,t){return Wr()},ia.prototype.readFeatures=function(e,t){return Wr()},ia.prototype.readGeometry=function(e,t){return Wr()},ia.prototype.readProjection=function(e){return Wr()},ia.prototype.writeFeature=function(e,t){return Wr()},ia.prototype.writeFeatures=function(e,t){return Wr()},ia.prototype.writeGeometry=function(e,t){return Wr()};var ra=ia;function na(e,t,i){var r,n=i?Zn(i.featureProjection):null,a=i?Zn(i.dataProjection):null;if(r=n&&a&&!function(e,t){if(e===t)return!0;var i=e.getUnits()===t.getUnits();return e.getCode()===t.getCode()?i:ea(e,t)===$n&&i}(n,a)?Array.isArray(e)?function(e,t,i){return In(e,ta(t,i))}(e,a,n):(t?e.clone():e).transform(t?n:a,t?a:n):e,t&&i&&void 0!==i.decimals&&!Array.isArray(r)){var o=Math.pow(10,i.decimals);r===e&&(r=e.clone()),r.applyTransform(function(e){for(var t=0,i=e.length;t<i;++t)e[t]=Math.round(e[t]*o)/o;return e})}return r}var aa="arraybuffer",oa={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};function sa(e,t){return e>t?1:e<t?-1:0}function la(e,t,i){for(;t<i;){var r=e[t];e[t]=e[i],e[i]=r,++t,--i}}function ha(e,t){for(var i=Array.isArray(t)?t:[t],r=i.length,n=0;n<r;n++)e[e.length]=i[n]}function ca(e,t){var i=e.length;if(i!==t.length)return!1;for(var r=0;r<i;r++)if(e[r]!==t[r])return!1;return!0}var ua="propertychange";function da(e,t,i,r){for(var n,a=0,o=e.length;a<o;++a)if((n=e[a]).listener===t&&n.bindTo===i)return r&&(n.deleteIndex=a),n}function pa(e,t){var i=fa(e);return i?i[t]:void 0}function fa(e,t){var i=e.ol_lm;return!i&&t&&(i=e.ol_lm={}),i}function ma(e,t){var i=pa(e,t);if(i){for(var r=0,n=i.length;r<n;++r)e.removeEventListener(t,i[r].boundListener),en(i[r]);i.length=0;var a=fa(e);a&&(delete a[t],0===Object.keys(a).length&&function(e){delete e.ol_lm}(e))}}function ya(e,t,i,r,n){var a=fa(e,!0),o=a[t];o||(o=a[t]=[]);var s=da(o,i,r,!1);return s?n||(s.callOnce=!1):(s={bindTo:r,callOnce:!!n,listener:i,target:e,type:t},e.addEventListener(t,function(e){var t=function(t){var i=e.listener,r=e.bindTo||e.target;return e.callOnce&&ba(e),i.call(r,t)};return e.boundListener=t,t}(s)),o.push(s)),s}function ga(e,t,i,r){return ya(e,t,i,r,!0)}function va(e,t,i,r){var n=pa(e,t);if(n){var a=da(n,i,r,!0);a&&ba(a)}}function ba(e){if(e&&e.target){e.target.removeEventListener(e.type,e.boundListener);var t=pa(e.target,e.type);if(t){var i="deleteIndex"in e?e.deleteIndex:t.indexOf(e);-1!==i&&t.splice(i,1),0===t.length&&ma(e.target,e.type)}en(e)}}var _a=function(){this.disposed_=!1};_a.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},_a.prototype.disposeInternal=function(){};var wa=_a;function xa(){}var Ca=function(e){this.propagationStopped,this.type=e,this.target=null};Ca.prototype.preventDefault=function(){this.propagationStopped=!0},Ca.prototype.stopPropagation=function(){this.propagationStopped=!0};var Sa=Ca,Ma=function(e){function t(){e.call(this),this.pendingRemovals_={},this.dispatching_={},this.listeners_={}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.addEventListener=function(e,t){var i=this.listeners_[e];i||(i=this.listeners_[e]=[]),-1===i.indexOf(t)&&i.push(t)},t.prototype.dispatchEvent=function(e){var t="string"==typeof e?new Sa(e):e,i=t.type;t.target=this;var r,n=this.listeners_[i];if(n){i in this.dispatching_||(this.dispatching_[i]=0,this.pendingRemovals_[i]=0),++this.dispatching_[i];for(var a=0,o=n.length;a<o;++a)if(!1===n[a].call(this,t)||t.propagationStopped){r=!1;break}if(--this.dispatching_[i],0===this.dispatching_[i]){var s=this.pendingRemovals_[i];for(delete this.pendingRemovals_[i];s--;)this.removeEventListener(i,xa);delete this.dispatching_[i]}return r}},t.prototype.disposeInternal=function(){!function(e){var t=fa(e);if(t)for(var i in t)ma(e,i)}(this)},t.prototype.getListeners=function(e){return this.listeners_[e]},t.prototype.hasListener=function(e){return e?e in this.listeners_:Object.keys(this.listeners_).length>0},t.prototype.removeEventListener=function(e,t){var i=this.listeners_[e];if(i){var r=i.indexOf(t);e in this.pendingRemovals_?(i[r]=xa,++this.pendingRemovals_[e]):(i.splice(r,1),0===i.length&&delete this.listeners_[e])}},t}(wa),ka="change",Ta="clear",Ia="error",Oa="load";var Ea=function(e){function t(){e.call(this),this.revision_=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.changed=function(){++this.revision_,this.dispatchEvent(ka)},t.prototype.getRevision=function(){return this.revision_},t.prototype.on=function(e,t){if(Array.isArray(e)){for(var i=e.length,r=new Array(i),n=0;n<i;++n)r[n]=ya(this,e[n],t);return r}return ya(this,e,t)},t.prototype.once=function(e,t){if(Array.isArray(e)){for(var i=e.length,r=new Array(i),n=0;n<i;++n)r[n]=ga(this,e[n],t);return r}return ga(this,e,t)},t.prototype.un=function(e,t){if(Array.isArray(e))for(var i=0,r=e.length;i<r;++i)va(this,e[i],t);else va(this,e,t)},t}(Ma),La=function(e){function t(t,i,r){e.call(this,t),this.key=i,this.oldValue=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Sa),Pa=function(e){function t(t){e.call(this),Yr(this),this.values_={},void 0!==t&&this.setProperties(t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){var t;return this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t},t.prototype.getKeys=function(){return Object.keys(this.values_)},t.prototype.getProperties=function(){return Qr({},this.values_)},t.prototype.notify=function(e,t){var i;i=function(e){return Ra.hasOwnProperty(e)?Ra[e]:Ra[e]="change:"+e}(e),this.dispatchEvent(new La(i,e,t)),i=ua,this.dispatchEvent(new La(i,e,t))},t.prototype.set=function(e,t,i){if(i)this.values_[e]=t;else{var r=this.values_[e];this.values_[e]=t,r!==t&&this.notify(e,r)}},t.prototype.setProperties=function(e,t){for(var i in e)this.set(i,e[i],t)},t.prototype.unset=function(e,t){if(e in this.values_){var i=this.values_[e];delete this.values_[e],t||this.notify(e,i)}},t}(Ea),Ra={};var ja=Pa;function Aa(e,t,i,r,n,a){for(var o=a||[],s=0,l=t;l<i;l+=r){var h=e[l],c=e[l+1];o[s++]=n[0]*h+n[2]*c+n[4],o[s++]=n[1]*h+n[3]*c+n[5]}return a&&o.length!=s&&(o.length=s),o}new Array(6);function za(e,t){var i=t[0],r=t[1];return t[0]=e[0]*i+e[2]*r+e[4],t[1]=e[1]*i+e[3]*r+e[5],t}function Da(e,t,i,r,n,a,o,s){var l=Math.sin(a),h=Math.cos(a);return e[0]=r*h,e[1]=n*l,e[2]=-r*l,e[3]=n*h,e[4]=o*r*h-s*r*l+t,e[5]=o*n*l+s*n*h+i,e}var Va=[1,0,0,1,0,0];function Na(e){var t;return e==oa.XY?t=2:e==oa.XYZ||e==oa.XYM?t=3:e==oa.XYZM&&(t=4),t}var Ga=function(e){function t(){e.call(this),this.layout=oa.XY,this.stride=2,this.flatCoordinates=null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.computeExtent=function(e){return gn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t.prototype.getCoordinates=function(){return Wr()},t.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},t.prototype.getFlatCoordinates=function(){return this.flatCoordinates},t.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},t.prototype.getLayout=function(){return this.layout},t.prototype.getSimplifiedGeometry=function(e){if(this.simplifiedGeometryRevision!=this.getRevision()&&(en(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var t=e.toString();if(this.simplifiedGeometryCache.hasOwnProperty(t))return this.simplifiedGeometryCache[t];var i=this.getSimplifiedGeometryInternal(e);return i.getFlatCoordinates().length<this.flatCoordinates.length?(this.simplifiedGeometryCache[t]=i,i):(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)},t.prototype.getSimplifiedGeometryInternal=function(e){return this},t.prototype.getStride=function(){return this.stride},t.prototype.setFlatCoordinates=function(e,t){this.stride=Na(e),this.layout=e,this.flatCoordinates=t},t.prototype.setCoordinates=function(e,t){Wr()},t.prototype.setLayout=function(e,t,i){var r;if(e)r=Na(e);else{for(var n=0;n<i;++n){if(0===t.length)return this.layout=oa.XY,void(this.stride=2);t=t[0]}e=function(e){var t;2==e?t=oa.XY:3==e?t=oa.XYZ:4==e&&(t=oa.XYZM);return t}(r=t.length)}this.layout=e,this.stride=r},t.prototype.applyTransform=function(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},t.prototype.rotate=function(e,t){var i=this.getFlatCoordinates();if(i){var r=this.getStride();!function(e,t,i,r,n,a,o){for(var s=o||[],l=Math.cos(n),h=Math.sin(n),c=a[0],u=a[1],d=0,p=t;p<i;p+=r){var f=e[p]-c,m=e[p+1]-u;s[d++]=c+f*l-m*h,s[d++]=u+f*h+m*l;for(var y=p+2;y<p+r;++y)s[d++]=e[y]}o&&s.length!=d&&(s.length=d)}(i,0,i.length,r,e,t,i),this.changed()}},t.prototype.scale=function(e,t,i){var r=t;void 0===r&&(r=e);var n=i;n||(n=Cn(this.getExtent()));var a=this.getFlatCoordinates();if(a){var o=this.getStride();!function(e,t,i,r,n,a,o,s){for(var l=s||[],h=o[0],c=o[1],u=0,d=t;d<i;d+=r){var p=e[d]-h,f=e[d+1]-c;l[u++]=h+n*p,l[u++]=c+a*f;for(var m=d+2;m<d+r;++m)l[u++]=e[m]}s&&l.length!=u&&(l.length=u)}(a,0,a.length,o,e,r,n,a),this.changed()}},t.prototype.translate=function(e,t){var i=this.getFlatCoordinates();if(i){var r=this.getStride();!function(e,t,i,r,n,a,o){for(var s=o||[],l=0,h=t;h<i;h+=r){s[l++]=e[h]+n,s[l++]=e[h+1]+a;for(var c=h+2;c<h+r;++c)s[l++]=e[c]}o&&s.length!=l&&(s.length=l)}(i,0,i.length,r,e,t,i),this.changed()}},t}(function(e){function t(){e.call(this),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryCache={},this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return Wr()},t.prototype.closestPointXY=function(e,t,i,r){return Wr()},t.prototype.containsXY=function(e,t){return!1},t.prototype.getClosestPoint=function(e,t){var i=t||[NaN,NaN];return this.closestPointXY(e[0],e[1],i,1/0),i},t.prototype.intersectsCoordinate=function(e){return this.containsXY(e[0],e[1])},t.prototype.computeExtent=function(e){return Wr()},t.prototype.getExtent=function(e){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),function(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e}(this.extent_,e)},t.prototype.rotate=function(e,t){Wr()},t.prototype.scale=function(e,t,i){Wr()},t.prototype.simplify=function(e){return this.getSimplifiedGeometry(e*e)},t.prototype.getSimplifiedGeometry=function(e){return Wr()},t.prototype.getType=function(){return Wr()},t.prototype.applyTransform=function(e){Wr()},t.prototype.intersectsExtent=function(e){return Wr()},t.prototype.translate=function(e,t){Wr()},t.prototype.transform=function(e,t){var i=Zn(e),r=i.getUnits()==Ln.TILE_PIXELS?function(e,r,n){var a=i.getExtent(),o=i.getWorldExtent(),s=Sn(o)/Sn(a);return Da(Va,o[0],o[3],s,-s,0,0,0),Aa(e,0,e.length,n,Va,r),ta(i,t)(e,r,n)}:ta(i,t);return this.applyTransform(r),this},t}(ja));function Fa(e,t,i,r,n,a,o){var s,l=e[t],h=e[t+1],c=e[i]-l,u=e[i+1]-h;if(0===c&&0===u)s=t;else{var d=((n-l)*c+(a-h)*u)/(c*c+u*u);if(d>1)s=i;else{if(d>0){for(var p=0;p<r;++p)o[p]=sn(e[t+p],e[i+p],d);return void(o.length=r)}s=t}}for(var f=0;f<r;++f)o[f]=e[s+f];o.length=r}function Ba(e,t,i,r,n){var a=e[t],o=e[t+1];for(t+=r;t<i;t+=r){var s=e[t],l=e[t+1],h=on(a,o,s,l);h>n&&(n=h),a=s,o=l}return n}function qa(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){var s=i[a];n=Ba(e,t,s,r,n),t=s}return n}function Ua(e,t,i,r,n,a,o,s,l,h,c){if(t==i)return h;var u,d;if(0===n){if((d=on(o,s,e[t],e[t+1]))<h){for(u=0;u<r;++u)l[u]=e[t+u];return l.length=r,d}return h}for(var p=c||[NaN,NaN],f=t+r;f<i;)if(Fa(e,f-r,f,r,o,s,p),(d=on(o,s,p[0],p[1]))<h){for(h=d,u=0;u<r;++u)l[u]=p[u];l.length=r,f+=r}else f+=r*Math.max((Math.sqrt(d)-Math.sqrt(h))/n|0,1);if(a&&(Fa(e,i-r,t,r,o,s,p),(d=on(o,s,p[0],p[1]))<h)){for(h=d,u=0;u<r;++u)l[u]=p[u];l.length=r}return h}function Wa(e,t,i,r,n,a,o,s,l,h,c){for(var u=c||[NaN,NaN],d=0,p=i.length;d<p;++d){var f=i[d];h=Ua(e,t,f,r,n,a,o,s,l,h,u),t=f}return h}function Ha(e,t,i,r){for(var n=0,a=i.length;n<a;++n)for(var o=i[n],s=0;s<r;++s)e[t++]=o[s];return t}function Ya(e,t,i,r,n){for(var a=n||[],o=0,s=0,l=i.length;s<l;++s){var h=Ha(e,t,i[s],r);a[o++]=h,t=h}return a.length=o,a}function Xa(e,t,i,r,n){for(var a=void 0!==n?n:[],o=0,s=t;s<i;s+=r)a[o++]=e.slice(s,s+r);return a.length=o,a}function $a(e,t,i,r,n){for(var a=void 0!==n?n:[],o=0,s=0,l=i.length;s<l;++s){var h=i[s];a[o++]=Xa(e,t,h,r,a[o]),t=h}return a.length=o,a}function Ja(e,t,i,r,n){for(var a=void 0!==n?n:[],o=0,s=0,l=i.length;s<l;++s){var h=i[s];a[o++]=$a(e,t,h,r,a[o]),t=h[h.length-1]}return a.length=o,a}function Ka(e,t,i,r,n,a){var o=NaN,s=NaN,l=(i-t)/r;if(1===l)o=e[t],s=e[t+1];else if(2==l)o=(1-n)*e[t]+n*e[t+r],s=(1-n)*e[t+1]+n*e[t+r+1];else if(0!==l){for(var h=e[t],c=e[t+1],u=0,d=[0],p=t+r;p<i;p+=r){var f=e[p],m=e[p+1];u+=Math.sqrt((f-h)*(f-h)+(m-c)*(m-c)),d.push(u),h=f,c=m}var y=n*u,g=function(e,t,i){for(var r,n,a=i||sa,o=0,s=e.length,l=!1;o<s;)(n=+a(e[r=o+(s-o>>1)],t))<0?o=r+1:(s=r,l=!n);return l?o:~o}(d,y);if(g<0){var v=(y-d[-g-2])/(d[-g-1]-d[-g-2]),b=t+(-g-2)*r;o=sn(e[b],e[b+r],v),s=sn(e[b+1],e[b+r+1],v)}else o=e[t+g*r],s=e[t+g*r+1]}return a?(a[0]=o,a[1]=s,a):[o,s]}function Za(e,t,i,r,n,a){if(i==t)return null;var o;if(n<e[t+r-1])return a?((o=e.slice(t,t+r))[r-1]=n,o):null;if(e[i-1]<n)return a?((o=e.slice(i-r,i))[r-1]=n,o):null;if(n==e[t+r-1])return e.slice(t,t+r);for(var s=t/r,l=i/r;s<l;){var h=s+l>>1;n<e[(h+1)*r-1]?l=h:s=h+1}var c=e[s*r-1];if(n==c)return e.slice((s-1)*r,(s-1)*r+r);var u=(n-c)/(e[(s+1)*r-1]-c);o=[];for(var d=0;d<r-1;++d)o.push(sn(e[(s-1)*r+d],e[s*r+d],u));return o.push(n),o}function Qa(e,t,i,r,n){return!function(e,t,i){var r;return(r=t.call(i,wn(e)))?r:(r=t.call(i,xn(e)))?r:(r=t.call(i,kn(e)))?r:(r=t.call(i,Mn(e)))||!1}(n,function(n){return!eo(e,t,i,r,n[0],n[1])})}function eo(e,t,i,r,n,a){for(var o=0,s=e[i-r],l=e[i-r+1];t<i;t+=r){var h=e[t],c=e[t+1];l<=a?c>a&&(h-s)*(a-l)-(n-s)*(c-l)>0&&o++:c<=a&&(h-s)*(a-l)-(n-s)*(c-l)<0&&o--,s=h,l=c}return 0!==o}function to(e,t,i,r,n,a){if(0===i.length)return!1;if(!eo(e,t,i[0],r,n,a))return!1;for(var o=1,s=i.length;o<s;++o)if(eo(e,i[o-1],i[o],r,n,a))return!1;return!0}function io(e,t,i,r,n,a){for(var o,s=[e[t],e[t+1]],l=[];t+r<i;t+=r){if(l[0]=e[t+r],l[1]=e[t+r+1],o=n.call(a,s,l))return o;s[0]=l[0],s[1]=l[1]}return!1}function ro(e,t,i,r,n){var a=bn([1/0,1/0,-1/0,-1/0],e,t,i,r);return!!Tn(n,a)&&(!!function(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}(n,a)||(a[0]>=n[0]&&a[2]<=n[2]||(a[1]>=n[1]&&a[3]<=n[3]||io(e,t,i,r,function(e,t){return function(e,t,i){var r=!1,n=pn(e,t),a=pn(e,i);if(n===hn.INTERSECTING||a===hn.INTERSECTING)r=!0;else{var o,s,l=e[0],h=e[1],c=e[2],u=e[3],d=t[0],p=t[1],f=i[0],m=i[1],y=(m-p)/(f-d);a&hn.ABOVE&&!(n&hn.ABOVE)&&(r=(o=f-(m-u)/y)>=l&&o<=c),r||!(a&hn.RIGHT)||n&hn.RIGHT||(r=(s=m-(f-c)*y)>=h&&s<=u),r||!(a&hn.BELOW)||n&hn.BELOW||(r=(o=f-(m-h)/y)>=l&&o<=c),r||!(a&hn.LEFT)||n&hn.LEFT||(r=(s=m-(f-l)*y)>=h&&s<=u)}return r}(n,e,t)}))))}function no(e,t,i,r,n){if(!function(e,t,i,r,n){return!!(ro(e,t,i,r,n)||eo(e,t,i,r,n[0],n[1])||eo(e,t,i,r,n[0],n[3])||eo(e,t,i,r,n[2],n[1])||eo(e,t,i,r,n[2],n[3]))}(e,t,i[0],r,n))return!1;if(1===i.length)return!0;for(var a=1,o=i.length;a<o;++a)if(Qa(e,i[a-1],i[a],r,n)&&!ro(e,i[a-1],i[a],r,n))return!1;return!0}function ao(e,t,i,r){for(var n=e[t],a=e[t+1],o=0,s=t+r;s<i;s+=r){var l=e[s],h=e[s+1];o+=Math.sqrt((l-n)*(l-n)+(h-a)*(h-a)),n=l,a=h}return o}function oo(e,t,i,r,n,a,o){var s=(i-t)/r;if(s<3){for(;t<i;t+=r)a[o++]=e[t],a[o++]=e[t+1];return o}var l=new Array(s);l[0]=1,l[s-1]=1;for(var h=[t,i-r],c=0;h.length>0;){for(var u=h.pop(),d=h.pop(),p=0,f=e[d],m=e[d+1],y=e[u],g=e[u+1],v=d+r;v<u;v+=r){var b=an(e[v],e[v+1],f,m,y,g);b>p&&(c=v,p=b)}p>n&&(l[(c-t)/r]=1,d+r<c&&h.push(d,c),c+r<u&&h.push(c,u))}for(var _=0;_<s;++_)l[_]&&(a[o++]=e[t+_*r],a[o++]=e[t+_*r+1]);return o}function so(e,t,i,r,n,a,o,s){for(var l=0,h=i.length;l<h;++l){var c=i[l];o=oo(e,t,c,r,n,a,o),s.push(o),t=c}return o}function lo(e,t){return t*Math.round(e/t)}function ho(e,t,i,r,n,a,o){if(t==i)return o;var s,l,h=lo(e[t],n),c=lo(e[t+1],n);t+=r,a[o++]=h,a[o++]=c;do{if(s=lo(e[t],n),l=lo(e[t+1],n),(t+=r)==i)return a[o++]=s,a[o++]=l,o}while(s==h&&l==c);for(;t<i;){var u=lo(e[t],n),d=lo(e[t+1],n);if(t+=r,u!=s||d!=l){var p=s-h,f=l-c,m=u-h,y=d-c;p*y==f*m&&(p<0&&m<p||p==m||p>0&&m>p)&&(f<0&&y<f||f==y||f>0&&y>f)?(s=u,l=d):(a[o++]=s,a[o++]=l,h=s,c=l,s=u,l=d)}}return a[o++]=s,a[o++]=l,o}function co(e,t,i,r,n,a,o,s){for(var l=0,h=i.length;l<h;++l){var c=i[l];o=ho(e,t,c,r,n,a,o),s.push(o),t=c}return o}var uo=function(e){function t(t,i){e.call(this),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===i||Array.isArray(t[0])?this.setCoordinates(t,i):this.setFlatCoordinates(i,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendCoordinate=function(e){this.flatCoordinates?ha(this.flatCoordinates,e):this.flatCoordinates=e.slice(),this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,i,r){return r<un(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ba(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ua(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,i,r))},t.prototype.forEachSegment=function(e){return io(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t.prototype.getCoordinateAtM=function(e,t){if(this.layout!=oa.XYM&&this.layout!=oa.XYZM)return null;var i=void 0!==t&&t;return Za(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i)},t.prototype.getCoordinates=function(){return Xa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getCoordinateAt=function(e,t){return Ka(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t)},t.prototype.getLength=function(){return ao(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[];return i.length=oo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i,0),new t(i,oa.XY)},t.prototype.getType=function(){return ln.LINE_STRING},t.prototype.intersectsExtent=function(e){return ro(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ha(this.flatCoordinates,0,e,this.stride),this.changed()},t}(Ga),po=function(e){function t(t,i,r){if(e.call(this),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,i);else if(void 0!==i&&r)this.setFlatCoordinates(i,t),this.ends_=r;else{for(var n=this.getLayout(),a=t,o=[],s=[],l=0,h=a.length;l<h;++l){var c=a[l];0===l&&(n=c.getLayout()),ha(o,c.getFlatCoordinates()),s.push(o.length)}this.setFlatCoordinates(n,o),this.ends_=s}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendLineString=function(e){this.flatCoordinates?ha(this.flatCoordinates,e.getFlatCoordinates().slice()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},t.prototype.closestPointXY=function(e,t,i,r){return r<un(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(qa(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Wa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,i,r))},t.prototype.getCoordinateAtM=function(e,t,i){if(this.layout!=oa.XYM&&this.layout!=oa.XYZM||0===this.flatCoordinates.length)return null;var r=void 0!==t&&t,n=void 0!==i&&i;return function(e,t,i,r,n,a,o){if(o)return Za(e,t,i[i.length-1],r,n,a);var s;if(n<e[r-1])return a?((s=e.slice(0,r))[r-1]=n,s):null;if(e[e.length-1]<n)return a?((s=e.slice(e.length-r))[r-1]=n,s):null;for(var l=0,h=i.length;l<h;++l){var c=i[l];if(t!=c){if(n<e[t+r-1])return null;if(n<=e[c-1])return Za(e,t,c,r,n,!1);t=c}}return null}(this.flatCoordinates,0,this.ends_,this.stride,e,r,n)},t.prototype.getCoordinates=function(){return $a(this.flatCoordinates,0,this.ends_,this.stride)},t.prototype.getEnds=function(){return this.ends_},t.prototype.getLineString=function(e){return e<0||this.ends_.length<=e?null:new uo(this.flatCoordinates.slice(0===e?0:this.ends_[e-1],this.ends_[e]),this.layout)},t.prototype.getLineStrings=function(){for(var e=this.flatCoordinates,t=this.ends_,i=this.layout,r=[],n=0,a=0,o=t.length;a<o;++a){var s=t[a],l=new uo(e.slice(n,s),i);r.push(l),n=s}return r},t.prototype.getFlatMidpoints=function(){for(var e=[],t=this.flatCoordinates,i=0,r=this.ends_,n=this.stride,a=0,o=r.length;a<o;++a){var s=r[a];ha(e,Ka(t,i,s,n,.5)),i=s}return e},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[],r=[];return i.length=so(this.flatCoordinates,0,this.ends_,this.stride,e,i,0,r),new t(i,oa.XY,r)},t.prototype.getType=function(){return ln.MULTI_LINE_STRING},t.prototype.intersectsExtent=function(e){return function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){if(ro(e,t,i[a],r,n))return!0;t=i[a]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,e)},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=Ya(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},t}(Ga),fo=function(e){function t(t,i){e.call(this),this.setCoordinates(t,i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,i,r){var n=this.flatCoordinates,a=on(e,t,n[0],n[1]);if(a<r){for(var o=this.stride,s=0;s<o;++s)i[s]=n[s];return i.length=o,a}return r},t.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},t.prototype.computeExtent=function(e){return yn(this.flatCoordinates,e)},t.prototype.getType=function(){return ln.POINT},t.prototype.intersectsExtent=function(e){return dn(e,this.flatCoordinates[0],this.flatCoordinates[1])},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=function(e,t,i,r){for(var n=0,a=i.length;n<a;++n)e[t++]=i[n];return t}(this.flatCoordinates,0,e,this.stride),this.changed()},t}(Ga),mo=function(e){function t(t,i){e.call(this),i&&!Array.isArray(t[0])?this.setFlatCoordinates(i,t):this.setCoordinates(t,i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendPoint=function(e){this.flatCoordinates?ha(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,i,r){if(r<un(this.getExtent(),e,t))return r;for(var n=this.flatCoordinates,a=this.stride,o=0,s=n.length;o<s;o+=a){var l=on(e,t,n[o],n[o+1]);if(l<r){r=l;for(var h=0;h<a;++h)i[h]=n[o+h];i.length=a}}return r},t.prototype.getCoordinates=function(){return Xa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getPoint=function(e){var t=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return e<0||t<=e?null:new fo(this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride),this.layout)},t.prototype.getPoints=function(){for(var e=this.flatCoordinates,t=this.layout,i=this.stride,r=[],n=0,a=e.length;n<a;n+=i){var o=new fo(e.slice(n,n+i),t);r.push(o)}return r},t.prototype.getType=function(){return ln.MULTI_POINT},t.prototype.intersectsExtent=function(e){for(var t=this.flatCoordinates,i=this.stride,r=0,n=t.length;r<n;r+=i){if(dn(e,t[r],t[r+1]))return!0}return!1},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ha(this.flatCoordinates,0,e,this.stride),this.changed()},t}(Ga);function yo(e,t,i,r){for(var n=0,a=e[i-r],o=e[i-r+1];t<i;t+=r){var s=e[t],l=e[t+1];n+=o*s-a*l,a=s,o=l}return n/2}function go(e,t,i,r){for(var n=0,a=0,o=i.length;a<o;++a){var s=i[a];n+=yo(e,t,s,r),t=s}return n}var vo=function(e){function t(t,i){e.call(this),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===i||Array.isArray(t[0])?this.setCoordinates(t,i):this.setFlatCoordinates(i,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,i,r){return r<un(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ba(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ua(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,i,r))},t.prototype.getArea=function(){return yo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getCoordinates=function(){return Xa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[];return i.length=oo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i,0),new t(i,oa.XY)},t.prototype.getType=function(){return ln.LINEAR_RING},t.prototype.intersectsExtent=function(e){return!1},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ha(this.flatCoordinates,0,e,this.stride),this.changed()},t}(Ga);function bo(e,t,i,r,n,a,o){for(var s,l,h,c,u,d,p,f=n[a+1],m=[],y=0,g=i.length;y<g;++y){var v=i[y];for(c=e[v-r],d=e[v-r+1],s=t;s<v;s+=r)u=e[s],p=e[s+1],(f<=d&&p<=f||d<=f&&f<=p)&&(h=(f-d)/(p-d)*(u-c)+c,m.push(h)),c=u,d=p}var b=NaN,_=-1/0;for(m.sort(sa),c=m[0],s=1,l=m.length;s<l;++s){u=m[s];var w=Math.abs(u-c);w>_&&to(e,t,i,r,h=(c+u)/2,f)&&(b=h,_=w),c=u}return isNaN(b)&&(b=n[a]),o?(o.push(b,f,_),o):[b,f,_]}function _o(e,t,i,r,n){for(var a=[],o=0,s=i.length;o<s;++o){var l=i[o];a=bo(e,t,l,r,n,2*o,a),t=l[l.length-1]}return a}function wo(e,t,i,r){for(;t<i-r;){for(var n=0;n<r;++n){var a=e[t+n];e[t+n]=e[i-r+n],e[i-r+n]=a}t+=r,i-=r}}function xo(e,t,i,r){for(var n=0,a=e[i-r],o=e[i-r+1];t<i;t+=r){var s=e[t],l=e[t+1];n+=(s-a)*(l+o),a=s,o=l}return n>0}function Co(e,t,i,r,n){for(var a=void 0!==n&&n,o=0,s=i.length;o<s;++o){var l=i[o],h=xo(e,t,l,r);if(0===o){if(a&&h||!a&&!h)return!1}else if(a&&!h||!a&&h)return!1;t=l}return!0}function So(e,t,i,r,n){for(var a=void 0!==n&&n,o=0,s=i.length;o<s;++o){var l=i[o],h=xo(e,t,l,r);(0===o?a&&h||!a&&!h:a&&!h||!a&&h)&&wo(e,t,l,r),t=l}return t}function Mo(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a)t=So(e,t,i[a],r,n);return t}var ko=function(e){function t(t,i,r){e.call(this),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,void 0!==i&&r?(this.setFlatCoordinates(i,t),this.ends_=r):this.setCoordinates(t,i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendLinearRing=function(e){this.flatCoordinates?ha(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},t.prototype.closestPointXY=function(e,t,i,r){return r<un(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(qa(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Wa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,i,r))},t.prototype.containsXY=function(e,t){return to(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)},t.prototype.getArea=function(){return go(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},t.prototype.getCoordinates=function(e){var t;return void 0!==e?So(t=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,e):t=this.flatCoordinates,$a(t,0,this.ends_,this.stride)},t.prototype.getEnds=function(){return this.ends_},t.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var e=Cn(this.getExtent());this.flatInteriorPoint_=bo(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},t.prototype.getInteriorPoint=function(){return new fo(this.getFlatInteriorPoint(),oa.XYM)},t.prototype.getLinearRingCount=function(){return this.ends_.length},t.prototype.getLinearRing=function(e){return e<0||this.ends_.length<=e?null:new vo(this.flatCoordinates.slice(0===e?0:this.ends_[e-1],this.ends_[e]),this.layout)},t.prototype.getLinearRings=function(){for(var e=this.layout,t=this.flatCoordinates,i=this.ends_,r=[],n=0,a=0,o=i.length;a<o;++a){var s=i[a],l=new vo(t.slice(n,s),e);r.push(l),n=s}return r},t.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var e=this.flatCoordinates;Co(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=So(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[],r=[];return i.length=co(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),i,0,r),new t(i,oa.XY,r)},t.prototype.getType=function(){return ln.POLYGON},t.prototype.intersectsExtent=function(e){return no(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=Ya(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},t}(Ga),To=ko;function Io(e,t,i,r){for(var n=[],a=[1/0,1/0,-1/0,-1/0],o=0,s=i.length;o<s;++o){var l=i[o];a=gn(e,t,l[0],r),n.push((a[0]+a[2])/2,(a[1]+a[3])/2),t=l[l.length-1]}return n}var Oo=function(e){function t(t,i,r){if(e.call(this),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!r&&!Array.isArray(t[0])){for(var n=this.getLayout(),a=t,o=[],s=[],l=0,h=a.length;l<h;++l){var c=a[l];0===l&&(n=c.getLayout());for(var u=o.length,d=c.getEnds(),p=0,f=d.length;p<f;++p)d[p]+=u;ha(o,c.getFlatCoordinates()),s.push(d)}i=n,t=o,r=s}void 0!==i&&r?(this.setFlatCoordinates(i,t),this.endss_=r):this.setCoordinates(t,i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendPolygon=function(e){var t;if(this.flatCoordinates){var i=this.flatCoordinates.length;ha(this.flatCoordinates,e.getFlatCoordinates());for(var r=0,n=(t=e.getEnds().slice()).length;r<n;++r)t[r]+=i}else this.flatCoordinates=e.getFlatCoordinates().slice(),t=e.getEnds().slice(),this.endss_.push();this.endss_.push(t),this.changed()},t.prototype.clone=function(){for(var e=this.endss_.length,i=new Array(e),r=0;r<e;++r)i[r]=this.endss_[r].slice();return new t(this.flatCoordinates.slice(),this.layout,i)},t.prototype.closestPointXY=function(e,t,i,r){return r<un(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){var s=i[a];n=qa(e,t,s,r,n),t=s[s.length-1]}return n}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(e,t,i,r,n,a,o,s,l,h,c){for(var u=c||[NaN,NaN],d=0,p=i.length;d<p;++d){var f=i[d];h=Wa(e,t,f,r,n,a,o,s,l,h,u),t=f[f.length-1]}return h}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,i,r))},t.prototype.containsXY=function(e,t){return function(e,t,i,r,n,a){if(0===i.length)return!1;for(var o=0,s=i.length;o<s;++o){var l=i[o];if(to(e,t,l,r,n,a))return!0;t=l[l.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)},t.prototype.getArea=function(){return function(e,t,i,r){for(var n=0,a=0,o=i.length;a<o;++a){var s=i[a];n+=go(e,t,s,r),t=s[s.length-1]}return n}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},t.prototype.getCoordinates=function(e){var t;return void 0!==e?Mo(t=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,e):t=this.flatCoordinates,Ja(t,0,this.endss_,this.stride)},t.prototype.getEndss=function(){return this.endss_},t.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var e=Io(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=_o(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},t.prototype.getInteriorPoints=function(){return new mo(this.getFlatInteriorPoints().slice(),oa.XYM)},t.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var e=this.flatCoordinates;!function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a)if(!Co(e,t,i[a],r,n))return!1;return!0}(e,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=Mo(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=e,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[],r=[];return i.length=function(e,t,i,r,n,a,o,s){for(var l=0,h=i.length;l<h;++l){var c=i[l],u=[];o=co(e,t,c,r,n,a,o,u),s.push(u),t=c[c.length-1]}return o}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(e),i,0,r),new t(i,oa.XY,r)},t.prototype.getPolygon=function(e){if(e<0||this.endss_.length<=e)return null;var t;if(0===e)t=0;else{var i=this.endss_[e-1];t=i[i.length-1]}var r=this.endss_[e].slice(),n=r[r.length-1];if(0!==t)for(var a=0,o=r.length;a<o;++a)r[a]-=t;return new To(this.flatCoordinates.slice(t,n),this.layout,r)},t.prototype.getPolygons=function(){for(var e=this.layout,t=this.flatCoordinates,i=this.endss_,r=[],n=0,a=0,o=i.length;a<o;++a){var s=i[a].slice(),l=s[s.length-1];if(0!==n)for(var h=0,c=s.length;h<c;++h)s[h]-=n;var u=new To(t.slice(n,l),e,s);r.push(u),n=l}return r},t.prototype.getType=function(){return ln.MULTI_POLYGON},t.prototype.intersectsExtent=function(e){return function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){var s=i[a];if(no(e,t,s,r,n))return!0;t=s[s.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=function(e,t,i,r,n){for(var a=n||[],o=0,s=0,l=i.length;s<l;++s){var h=Ya(e,t,i[s],r,a[o]);a[o++]=h,t=h[h.length-1]}return a.length=o,a}(this.flatCoordinates,0,e,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var r=i[i.length-1];this.flatCoordinates.length=0===r.length?0:r[r.length-1]}this.changed()},t}(Ga),Eo=[1,0,0,1,0,0],Lo=function(e,t,i,r,n){this.extent_,this.id_=n,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=r};Lo.prototype.get=function(e){return this.properties_[e]},Lo.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===ln.POINT?yn(this.flatCoordinates_):gn(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},Lo.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var e=Cn(this.getExtent());this.flatInteriorPoints_=bo(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_},Lo.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var e=Io(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=_o(this.flatCoordinates_,0,this.ends_,2,e)}return this.flatInteriorPoints_},Lo.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=Ka(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},Lo.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var e=this.flatCoordinates_,t=0,i=this.ends_,r=0,n=i.length;r<n;++r){var a=i[r],o=Ka(e,t,a,2,.5);ha(this.flatMidpoints_,o),t=a}}return this.flatMidpoints_},Lo.prototype.getId=function(){return this.id_},Lo.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},Lo.prototype.getGeometry=function(){return this},Lo.prototype.getSimplifiedGeometry=function(e){return this},Lo.prototype.getProperties=function(){return this.properties_},Lo.prototype.getStride=function(){return 2},Lo.prototype.getStyleFunction=function(){},Lo.prototype.getType=function(){return this.type_},Lo.prototype.transform=function(e,t){var i=(e=Zn(e)).getExtent(),r=e.getWorldExtent(),n=Sn(r)/Sn(i);Da(Eo,r[0],r[3],n,-n,0,0,0),Aa(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Eo,this.flatCoordinates_)},Lo.prototype.getEnds=Lo.prototype.getEndss=function(){return this.ends_},Lo.prototype.getFlatCoordinates=Lo.prototype.getOrientedFlatCoordinates;var Po=Lo;function Ro(e,t,i){if(3===e){var r={keys:[],values:[],features:[]},n=i.readVarint()+i.pos;i.readFields(jo,r,n),r.length=r.features.length,r.length&&(t[r.name]=r)}}function jo(e,t,i){if(15===e)t.version=i.readVarint();else if(1===e)t.name=i.readString();else if(5===e)t.extent=i.readVarint();else if(2===e)t.features.push(i.pos);else if(3===e)t.keys.push(i.readString());else if(4===e){for(var r=null,n=i.readVarint()+i.pos;i.pos<n;)r=1===(e=i.readVarint()>>3)?i.readString():2===e?i.readFloat():3===e?i.readDouble():4===e?i.readVarint64():5===e?i.readVarint():6===e?i.readSVarint():7===e?i.readBoolean():null;t.values.push(r)}}function Ao(e,t,i){if(1==e)t.id=i.readVarint();else if(2==e)for(var r=i.readVarint()+i.pos;i.pos<r;){var n=t.layer.keys[i.readVarint()],a=t.layer.values[i.readVarint()];t.properties[n]=a}else 3==e?t.type=i.readVarint():4==e&&(t.geometry=i.pos)}function zo(e,t,i){e.pos=t.features[i];var r=e.readVarint()+e.pos,n={layer:t,type:0,properties:{}};return e.readFields(Ao,n,r),n}var Do=function(e){function t(t){e.call(this);var i=t||{};this.dataProjection=new Rn({code:"",units:Ln.TILE_PIXELS}),this.featureClass_=i.featureClass?i.featureClass:Po,this.geometryName_=i.geometryName,this.layerName_=i.layerName?i.layerName:"layer",this.layers_=i.layers?i.layers:null,this.extent_=null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.readRawGeometry_=function(e,t,i,r){e.pos=t.geometry;for(var n=e.readVarint()+e.pos,a=1,o=0,s=0,l=0,h=0,c=0;e.pos<n;){if(!o){var u=e.readVarint();a=7&u,o=u>>3}o--,1===a||2===a?(s+=e.readSVarint(),l+=e.readSVarint(),1===a&&h>c&&(r.push(h),c=h),i.push(s,l),h+=2):7===a?h>c&&(i.push(i[c],i[c+1]),h+=2):Jr(!1,59)}h>c&&(r.push(h),c=h)},t.prototype.createFeature_=function(e,t,i){var r,n=t.type;if(0===n)return null;var a=t.id,o=t.properties;o[this.layerName_]=t.layer.name;var s=[],l=[];this.readRawGeometry_(e,t,s,l);var h=function(e,t){var i;1===e?i=1===t?ln.POINT:ln.MULTI_POINT:2===e?i=1===t?ln.LINE_STRING:ln.MULTI_LINE_STRING:3===e&&(i=ln.POLYGON);return i}(n,l.length);if(this.featureClass_===Po)r=new this.featureClass_(h,s,l,o,a);else{var c;if(h==ln.POLYGON){for(var u=[],d=0,p=0,f=0,m=l.length;f<m;++f){var y=l[f];xo(s,d,y,2)||(u.push(l.slice(p,f)),p=f),d=y}c=u.length>1?new Oo(s,oa.XY,u):new To(s,oa.XY,l)}else c=h===ln.POINT?new fo(s,oa.XY):h===ln.LINE_STRING?new uo(s,oa.XY):h===ln.POLYGON?new To(s,oa.XY,l):h===ln.MULTI_POINT?new mo(s,oa.XY):h===ln.MULTI_LINE_STRING?new po(s,oa.XY,l):null;r=new(0,this.featureClass_),this.geometryName_&&r.setGeometryName(this.geometryName_);var g=na(c,!1,this.adaptOptions(i));r.setGeometry(g),r.setId(a),r.setProperties(o)}return r},t.prototype.getLastExtent=function(){return this.extent_},t.prototype.getType=function(){return aa},t.prototype.readFeatures=function(e,t){var i=this.layers_,r=new Zr.a(e),n=r.readFields(Ro,{}),a=[];for(var o in n)if(!i||-1!=i.indexOf(o)){for(var s=n[o],l=0,h=s.length;l<h;++l){var c=zo(r,s,l);a.push(this.createFeature_(r,c))}this.extent_=s?[0,0,s.extent,s.extent]:null}return a},t.prototype.readProjection=function(e){return this.dataProjection},t.prototype.setLayers=function(e){this.layers_=e},t}(ra);function Vo(e,t){var i=document.createElement("canvas");return e&&(i.width=e),t&&(i.height=t),i.getContext("2d")}var No=function(){};No.prototype.getReplay=function(e,t){return Wr()},No.prototype.isEmpty=function(){return Wr()},No.prototype.addDeclutter=function(e){return Wr()};var Go=No,Fo={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"},Bo=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,qo=/^([a-z]*)$/i;function Uo(e){return"string"==typeof e?e:Yo(e)}var Wo=function(){var e={},t=0;return function(i){var r;if(e.hasOwnProperty(i))r=e[i];else{if(t>=1024){var n=0;for(var a in e)0==(3&n++)&&(delete e[a],--t)}r=function(e){var t,i,r,n,a;qo.exec(e)&&(e=function(e){var t=document.createElement("div");if(t.style.color=e,""!==t.style.color){document.body.appendChild(t);var i=getComputedStyle(t).color;return document.body.removeChild(t),i}return""}(e));if(Bo.exec(e)){var o,s=e.length-1;o=s<=4?1:2;var l=4===s||8===s;t=parseInt(e.substr(1+0*o,o),16),i=parseInt(e.substr(1+1*o,o),16),r=parseInt(e.substr(1+2*o,o),16),n=l?parseInt(e.substr(1+3*o,o),16):255,1==o&&(t=(t<<4)+t,i=(i<<4)+i,r=(r<<4)+r,l&&(n=(n<<4)+n)),a=[t,i,r,n/255]}else 0==e.indexOf("rgba(")?Ho(a=e.slice(5,-1).split(",").map(Number)):0==e.indexOf("rgb(")?((a=e.slice(4,-1).split(",").map(Number)).push(1),Ho(a)):Jr(!1,14);return a}(i),e[i]=r,++t}return r}}();function Ho(e){return e[0]=rn(e[0]+.5|0,0,255),e[1]=rn(e[1]+.5|0,0,255),e[2]=rn(e[2]+.5|0,0,255),e[3]=rn(e[3],0,1),e}function Yo(e){var t=e[0];t!=(0|t)&&(t=t+.5|0);var i=e[1];i!=(0|i)&&(i=i+.5|0);var r=e[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+t+","+i+","+r+","+(void 0===e[3]?1:e[3])+")"}function Xo(e){return Array.isArray(e)?Yo(e):e}function $o(e,t,i,r,n,a,o,s){for(var l,h,c,u=[],d=e[t]>e[i-r],p=n.length,f=e[t],m=e[t+1],y=e[t+=r],g=e[t+1],v=0,b=Math.sqrt(Math.pow(y-f,2)+Math.pow(g-m,2)),_="",w=0,x=0;x<p;++x){h=d?p-x-1:x;var C=n.charAt(h),S=a(_=d?C+_:_+C)-w;w+=S;for(var M=o+S/2;t<i-r&&v+b<M;)f=y,m=g,y=e[t+=r],g=e[t+1],v+=b,b=Math.sqrt(Math.pow(y-f,2)+Math.pow(g-m,2));var k=M-v,T=Math.atan2(g-m,y-f);if(d&&(T+=T>0?-Math.PI:Math.PI),void 0!==c){var I=T-c;if(I+=I>Math.PI?-2*Math.PI:I<-Math.PI?2*Math.PI:0,Math.abs(I)>s)return null}var O=k/b,E=sn(f,y,O),L=sn(m,g,O);c==T?(d&&(l[0]=E,l[1]=L,l[2]=S/2),l[4]=_):(w=S,l=[E,L,S/2,T,_=C],d?u.unshift(l):u.push(l),c=T),o+=S}return u}var Jo="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",Ko=(Jo.indexOf("firefox"),-1!==Jo.indexOf("safari")&&Jo.indexOf("chrom"),-1!==Jo.indexOf("webkit")&&Jo.indexOf("edge"),Jo.indexOf("macintosh"),window.devicePixelRatio,function(){var e=!1;try{e=!!document.createElement("canvas").getContext("2d").setLineDash}catch(e){}return e}()),Zo=(navigator,window,window,navigator.msPointerEnabled,function(){});Zo.prototype.drawCustom=function(e,t,i){},Zo.prototype.drawGeometry=function(e){},Zo.prototype.setStyle=function(e){},Zo.prototype.drawCircle=function(e,t){},Zo.prototype.drawFeature=function(e,t){},Zo.prototype.drawGeometryCollection=function(e,t){},Zo.prototype.drawLineString=function(e,t){},Zo.prototype.drawMultiLineString=function(e,t){},Zo.prototype.drawMultiPoint=function(e,t){},Zo.prototype.drawMultiPolygon=function(e,t){},Zo.prototype.drawPoint=function(e,t){},Zo.prototype.drawPolygon=function(e,t){},Zo.prototype.drawText=function(e,t){},Zo.prototype.setFillStrokeStyle=function(e,t){},Zo.prototype.setImageStyle=function(e,t){},Zo.prototype.setTextStyle=function(e,t){};var Qo=Zo,es=function(){var e,t={};return function(i){if(e||(e=document.createElement("div").style),!(i in t)){e.font=i;var r=e.fontFamily;if(e.font="",!r)return null;t[i]=r.split(/,\s?/)}return t[i]}}(),ts=[0,0,0,1],is=[],rs=[0,0,0,1],ns=[0,0,0,0],as=new(function(e){function t(t){e.call(this),this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(Ta)},t.prototype.containsKey=function(e){return this.entries_.hasOwnProperty(e)},t.prototype.forEach=function(e,t){for(var i=this.oldest_;i;)e.call(t,i.value_,i.key_,this),i=i.newer},t.prototype.get=function(e){var t=this.entries_[e];return Jr(void 0!==t,15),t===this.newest_?t.value_:(t===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(t.newer.older=t.older,t.older.newer=t.newer),t.newer=null,t.older=this.newest_,this.newest_.newer=t,this.newest_=t,t.value_)},t.prototype.remove=function(e){var t=this.entries_[e];return Jr(void 0!==t,15),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var e,t=new Array(this.count_),i=0;for(e=this.newest_;e;e=e.older)t[i++]=e.key_;return t},t.prototype.getValues=function(){var e,t=new Array(this.count_),i=0;for(e=this.newest_;e;e=e.older)t[i++]=e.value_;return t},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_},t.prototype.replace=function(e,t){this.get(e),this.entries_[e].value_=t},t.prototype.set=function(e,t){Jr(!(e in this.entries_),16);var i={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[e]=i,++this.count_},t.prototype.setSize=function(e){this.highWaterMark=e},t.prototype.prune=function(){for(;this.canExpireCache();)this.pop()},t}(Ma)),os={},ss=null,ls={},hs=function(){var e,t,i=60,r=os,n="32px ",a=["monospace","serif"],o=a.length,s="wmytzilWMYTZIL@#/&?$%10";function l(e){for(var i=cs(),r=100;r<=700;r+=300){for(var l=r+" ",h=!0,c=0;c<o;++c){var u=a[c];if(i.font=l+n+u,t=i.measureText(s).width,e!=u){i.font=l+n+e+","+u;var d=i.measureText(s).width;h=h&&d!=t}}if(h)return!0}return!1}function h(){var t=!0;for(var n in r)r[n]<i&&(l(n)?(r[n]=i,en(ls),ss=null,as.clear()):(++r[n],t=!1));t&&(clearInterval(e),e=void 0)}return function(t){var n=es(t);if(n)for(var a=0,o=n.length;a<o;++a){var s=n[a];s in r||(r[s]=i,l(s)||(r[s]=0,void 0===e&&(e=setInterval(h,32))))}}}();function cs(){return ss||(ss=Vo(1,1)),ss}var us=function(){var e,t=ls;return function(i){var r=t[i];return void 0==r&&(e||((e=document.createElement("span")).textContent="M",e.style.margin=e.style.padding="0 !important",e.style.position="absolute !important",e.style.left="-99999px !important"),e.style.font=i,document.body.appendChild(e),r=t[i]=e.offsetHeight,document.body.removeChild(e)),r}}();function ds(e,t){var i=cs();return e!=i.font&&(i.font=e),i.measureText(t).width}var ps=[1,0,0,1,0,0];function fs(e,t,i,r,n,a,o,s,l,h,c){var u;1!=i&&(u=e.globalAlpha,e.globalAlpha=u*i),t&&e.setTransform.apply(e,t),e.drawImage(r,n,a,o,s,l,h,o*c,s*c),u&&(e.globalAlpha=u),t&&e.setTransform.apply(e,ps)}var ms={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},ys=[ms.FILL],gs=[ms.STROKE],vs=[ms.BEGIN_PATH],bs=[ms.CLOSE_PATH],_s=ms,ws=[Fo.POLYGON,Fo.CIRCLE,Fo.LINE_STRING,Fo.IMAGE,Fo.TEXT,Fo.DEFAULT],xs={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Cs=[1/0,1/0,-1/0,-1/0],Ss=[1,0,0,1,0,0],Ms=function(e){function t(t,i,r,n,a,o){e.call(this),this.declutterTree=o,this.tolerance=t,this.maxExtent=i,this.overlaps=a,this.pixelRatio=n,this.maxLineWidth=0,this.resolution=r,this.alignFill_,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=[],this.pixelCoordinates_=null,this.state={},this.viewRotation_=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.replayTextBackground_=function(e,t,i,r,n,a,o){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,i),e.lineTo.apply(e,r),e.lineTo.apply(e,n),e.lineTo.apply(e,t),a&&(this.alignFill_=a[2],this.fill_(e)),o&&(this.setStrokeStyle_(e,o),e.stroke())},t.prototype.replayImage_=function(e,t,i,r,n,a,o,s,l,h,c,u,d,p,f,m,y,g){var v=y||g;t-=n*=d,i-=a*=d;var b,_,w,x,C=f+h>r.width?r.width-h:f,S=s+c>r.height?r.height-c:s,M=m[3]+C*d+m[1],k=m[0]+S*d+m[2],T=t-m[3],I=i-m[0];(v||0!==u)&&(b=[T,I],_=[T+M,I],w=[T+M,I+k],x=[T,I+k]);var O=null;if(0!==u){var E=t+n,L=i+a;O=Da(Ss,E,L,1,1,u,-E,-L),mn(Cs),vn(Cs,za(Ss,b)),vn(Cs,za(Ss,_)),vn(Cs,za(Ss,w)),vn(Cs,za(Ss,x))}else fn(T,I,T+M,I+k,Cs);var P=e.canvas,R=g?g[2]*d/2:0,j=Cs[0]-R<=P.width&&Cs[2]+R>=0&&Cs[1]-R<=P.height&&Cs[3]+R>=0;if(p&&(t=Math.round(t),i=Math.round(i)),o){if(!j&&1==o[4])return;!function(e,t){t[0]<e[0]&&(e[0]=t[0]),t[2]>e[2]&&(e[2]=t[2]),t[1]<e[1]&&(e[1]=t[1]),t[3]>e[3]&&(e[3]=t[3])}(o,Cs);var A=j?[e,O?O.slice(0):null,l,r,h,c,C,S,t,i,d]:null;A&&v&&A.push(y,g,b,_,w,x),o.push(A)}else j&&(v&&this.replayTextBackground_(e,b,_,w,x,y,g),fs(e,O,l,r,h,c,C,S,t,i,d))},t.prototype.applyPixelRatio=function(e){var t=this.pixelRatio;return 1==t?e:e.map(function(e){return e*t})},t.prototype.appendFlatCoordinates=function(e,t,i,r,n,a){var o=this.coordinates.length,s=this.getBufferedMaxExtent();a&&(t+=r);var l,h,c,u=[e[t],e[t+1]],d=[NaN,NaN],p=!0;for(l=t+r;l<i;l+=r)d[0]=e[l],d[1]=e[l+1],(c=pn(s,d))!==h?(p&&(this.coordinates[o++]=u[0],this.coordinates[o++]=u[1]),this.coordinates[o++]=d[0],this.coordinates[o++]=d[1],p=!1):c===hn.INTERSECTING?(this.coordinates[o++]=d[0],this.coordinates[o++]=d[1],p=!1):p=!0,u[0]=d[0],u[1]=d[1],h=c;return(n&&p||l===t+r)&&(this.coordinates[o++]=u[0],this.coordinates[o++]=u[1]),o},t.prototype.drawCustomCoordinates_=function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){var s=i[a],l=this.appendFlatCoordinates(e,t,s,r,!1,!1);n.push(l),t=s}return t},t.prototype.drawCustom=function(e,t,i){this.beginGeometry(e,t);var r,n,a,o,s,l=e.getType(),h=e.getStride(),c=this.coordinates.length;if(l==ln.MULTI_POLYGON){r=(e=e).getOrientedFlatCoordinates(),o=[];var u=e.getEndss();s=0;for(var d=0,p=u.length;d<p;++d){var f=[];s=this.drawCustomCoordinates_(r,s,u[d],h,f),o.push(f)}this.instructions.push([_s.CUSTOM,c,o,e,i,Ja])}else l==ln.POLYGON||l==ln.MULTI_LINE_STRING?(a=[],r=l==ln.POLYGON?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),s=this.drawCustomCoordinates_(r,0,e.getEnds(),h,a),this.instructions.push([_s.CUSTOM,c,a,e,i,$a])):l==ln.LINE_STRING||l==ln.MULTI_POINT?(r=e.getFlatCoordinates(),n=this.appendFlatCoordinates(r,0,r.length,h,!1,!1),this.instructions.push([_s.CUSTOM,c,n,e,i,Xa])):l==ln.POINT&&(r=e.getFlatCoordinates(),this.coordinates.push(r[0],r[1]),n=this.coordinates.length,this.instructions.push([_s.CUSTOM,c,n,e,i]));this.endGeometry(e,t)},t.prototype.beginGeometry=function(e,t){this.beginGeometryInstruction1_=[_s.BEGIN_GEOMETRY,t,0],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[_s.BEGIN_GEOMETRY,t,0],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},t.prototype.finish=function(){},t.prototype.fill_=function(e){if(this.alignFill_){var t=za(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;e.translate(t[0]%i,t[1]%i),e.rotate(this.viewRotation_)}e.fill(),this.alignFill_&&e.setTransform.apply(e,ps)},t.prototype.setStrokeStyle_=function(e,t){e.strokeStyle=t[1],e.lineWidth=t[2],e.lineCap=t[3],e.lineJoin=t[4],e.miterLimit=t[5],Ko&&(e.lineDashOffset=t[7],e.setLineDash(t[6]))},t.prototype.renderDeclutter_=function(e,t){if(e&&e.length>5){var i=e[4];if(1==i||i==e.length-5){var r={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};if(!this.declutterTree.collides(r)){this.declutterTree.insert(r);for(var n=5,a=e.length;n<a;++n){var o=e[n];o&&(o.length>11&&this.replayTextBackground_(o[0],o[13],o[14],o[15],o[16],o[11],o[12]),fs.apply(void 0,o))}}e.length=5,mn(e)}}},t.prototype.replay_=function(e,t,i,r,n,a,o){var s;this.pixelCoordinates_&&ca(t,this.renderedTransform_)?s=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),s=Aa(this.coordinates,0,this.coordinates.length,2,t,this.pixelCoordinates_),function(e,t){e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5]}(this.renderedTransform_,t));for(var l,h,c,u,d,p,f,m,y,g,v,b,_=!tn(i),w=0,x=r.length,C=0,S=0,M=0,k=null,T=null,I=this.coordinateCache_,O=this.viewRotation_,E={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:O},L=this.instructions!=r||this.overlaps?0:200;w<x;){var P=r[w];switch(P[0]){case _s.BEGIN_GEOMETRY:g=P[1],_&&i[Yr(g)]||!g.getGeometry()?w=P[2]:void 0===o||Tn(o,g.getGeometry().getExtent())?++w:w=P[2]+1;break;case _s.BEGIN_PATH:S>L&&(this.fill_(e),S=0),M>L&&(e.stroke(),M=0),S||M||(e.beginPath(),u=d=NaN),++w;break;case _s.CIRCLE:var R=s[C=P[1]],j=s[C+1],A=s[C+2]-R,z=s[C+3]-j,D=Math.sqrt(A*A+z*z);e.moveTo(R+D,j),e.arc(R,j,D,0,2*Math.PI,!0),++w;break;case _s.CLOSE_PATH:e.closePath(),++w;break;case _s.CUSTOM:C=P[1],l=P[2];var V=P[3],N=P[4],G=6==P.length?P[5]:void 0;E.geometry=V,E.feature=g,w in I||(I[w]=[]);var F=I[w];G?G(s,C,l,2,F):(F[0]=s[C],F[1]=s[C+1],F.length=2),N(F,E),++w;break;case _s.DRAW_IMAGE:C=P[1],l=P[2],y=P[3],h=P[4],c=P[5],m=a?null:P[6];var B=P[7],q=P[8],U=P[9],W=P[10],H=P[11],Y=P[12],X=P[13],$=P[14],J=void 0,K=void 0,Z=void 0;for(P.length>16?(J=P[15],K=P[16],Z=P[17]):(J=ns,K=Z=!1),H&&(Y+=O);C<l;C+=2)this.replayImage_(e,s[C],s[C+1],y,h,c,m,B,q,U,W,Y,X,n,$,J,K?k:null,Z?T:null);this.renderDeclutter_(m,g),++w;break;case _s.DRAW_CHARS:var Q=P[1],ee=P[2],te=P[3];m=a?null:P[4];var ie=P[5],re=P[6],ne=P[7],ae=P[8],oe=P[9],se=P[10],le=P[11],he=P[12],ce=P[13],ue=P[14],de=ao(s,Q,ee,2),pe=ae(he);if(ie||pe<=de){var fe=this.textStates[ce].textAlign,me=$o(s,Q,ee,2,he,ae,(de-pe)*xs[fe],ne);if(me){var ye=void 0,ge=void 0,ve=void 0,be=void 0,_e=void 0;if(se)for(ye=0,ge=me.length;ye<ge;++ye)ve=(_e=me[ye])[4],be=this.getImage(ve,ce,"",se),h=_e[2]+le,c=te*be.height+2*(.5-te)*le-oe,this.replayImage_(e,_e[0],_e[1],be,h,c,m,be.height,1,0,0,_e[3],ue,!1,be.width,ns,null,null);if(re)for(ye=0,ge=me.length;ye<ge;++ye)ve=(_e=me[ye])[4],be=this.getImage(ve,ce,re,""),h=_e[2],c=te*be.height-oe,this.replayImage_(e,_e[0],_e[1],be,h,c,m,be.height,1,0,0,_e[3],ue,!1,be.width,ns,null,null)}}this.renderDeclutter_(m,g),++w;break;case _s.END_GEOMETRY:if(void 0!==a){var we=a(g=P[1]);if(we)return we}++w;break;case _s.FILL:L?S++:this.fill_(e),++w;break;case _s.MOVE_TO_LINE_TO:for(C=P[1],l=P[2],v=s[C],f=(b=s[C+1])+.5|0,(p=v+.5|0)===u&&f===d||(e.moveTo(v,b),u=p,d=f),C+=2;C<l;C+=2)p=(v=s[C])+.5|0,f=(b=s[C+1])+.5|0,C!=l-2&&p===u&&f===d||(e.lineTo(v,b),u=p,d=f);++w;break;case _s.SET_FILL_STYLE:k=P,this.alignFill_=P[2],S&&(this.fill_(e),S=0,M&&(e.stroke(),M=0)),e.fillStyle=P[1],++w;break;case _s.SET_STROKE_STYLE:T=P,M&&(e.stroke(),M=0),this.setStrokeStyle_(e,P),++w;break;case _s.STROKE:L?M++:e.stroke(),++w;break;default:++w}}S&&this.fill_(e),M&&e.stroke()},t.prototype.replay=function(e,t,i,r,n){this.viewRotation_=i,this.replay_(e,t,r,this.instructions,n,void 0,void 0)},t.prototype.replayHitDetection=function(e,t,i,r,n,a){return this.viewRotation_=i,this.replay_(e,t,r,this.hitDetectionInstructions,!0,n,a)},t.prototype.reverseHitDetectionInstructions=function(){var e,t=this.hitDetectionInstructions;t.reverse();var i,r,n=t.length,a=-1;for(e=0;e<n;++e)(r=(i=t[e])[0])==_s.END_GEOMETRY?a=e:r==_s.BEGIN_GEOMETRY&&(i[2]=e,la(this.hitDetectionInstructions,a,e),a=-1)},t.prototype.setFillStrokeStyle=function(e,t){var i=this.state;if(e){var r=e.getColor();i.fillStyle=Xo(r||ts)}else i.fillStyle=void 0;if(t){var n=t.getColor();i.strokeStyle=Xo(n||rs);var a=t.getLineCap();i.lineCap=void 0!==a?a:"round";var o=t.getLineDash();i.lineDash=o?o.slice():is;var s=t.getLineDashOffset();i.lineDashOffset=s||0;var l=t.getLineJoin();i.lineJoin=void 0!==l?l:"round";var h=t.getWidth();i.lineWidth=void 0!==h?h:1;var c=t.getMiterLimit();i.miterLimit=void 0!==c?c:10,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},t.prototype.createFill=function(e,t){var i=e.fillStyle,r=[_s.SET_FILL_STYLE,i];return"string"!=typeof i&&r.push(!0),r},t.prototype.applyStroke=function(e){this.instructions.push(this.createStroke(e))},t.prototype.createStroke=function(e){return[_s.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth*this.pixelRatio,e.lineCap,e.lineJoin,e.miterLimit,this.applyPixelRatio(e.lineDash),e.lineDashOffset*this.pixelRatio]},t.prototype.updateFillStyle=function(e,t,i){var r=e.fillStyle;"string"==typeof r&&e.currentFillStyle==r||(void 0!==r&&this.instructions.push(t.call(this,e,i)),e.currentFillStyle=r)},t.prototype.updateStrokeStyle=function(e,t){var i=e.strokeStyle,r=e.lineCap,n=e.lineDash,a=e.lineDashOffset,o=e.lineJoin,s=e.lineWidth,l=e.miterLimit;(e.currentStrokeStyle!=i||e.currentLineCap!=r||n!=e.currentLineDash&&!ca(e.currentLineDash,n)||e.currentLineDashOffset!=a||e.currentLineJoin!=o||e.currentLineWidth!=s||e.currentMiterLimit!=l)&&(void 0!==i&&t.call(this,e),e.currentStrokeStyle=i,e.currentLineCap=r,e.currentLineDash=n,e.currentLineDashOffset=a,e.currentLineJoin=o,e.currentLineWidth=s,e.currentMiterLimit=l)},t.prototype.endGeometry=function(e,t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var i=[_s.END_GEOMETRY,t];this.instructions.push(i),this.hitDetectionInstructions.push(i)},t.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=function(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e.slice()}(this.maxExtent),this.maxLineWidth>0)){var e=this.resolution*(this.maxLineWidth+1)/2;cn(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},t}(Qo),ks=function(e){function t(t,i,r,n,a,o){e.call(this,t,i,r,n,a,o),this.declutterGroup_=null,this.hitDetectionImage_=null,this.image_=null,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.drawCoordinates_=function(e,t,i,r){return this.appendFlatCoordinates(e,t,i,r,!1,!1)},t.prototype.drawPoint=function(e,t){if(this.image_){this.beginGeometry(e,t);var i=e.getFlatCoordinates(),r=e.getStride(),n=this.coordinates.length,a=this.drawCoordinates_(i,0,i.length,r);this.instructions.push([_s.DRAW_IMAGE,n,a,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([_s.DRAW_IMAGE,n,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(e,t)}},t.prototype.drawMultiPoint=function(e,t){if(this.image_){this.beginGeometry(e,t);var i=e.getFlatCoordinates(),r=e.getStride(),n=this.coordinates.length,a=this.drawCoordinates_(i,0,i.length,r);this.instructions.push([_s.DRAW_IMAGE,n,a,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([_s.DRAW_IMAGE,n,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(e,t)}},t.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0},t.prototype.setImageStyle=function(e,t){var i=e.getAnchor(),r=e.getSize(),n=e.getHitDetectionImage(1),a=e.getImage(1),o=e.getOrigin();this.anchorX_=i[0],this.anchorY_=i[1],this.declutterGroup_=t,this.hitDetectionImage_=n,this.image_=a,this.height_=r[1],this.opacity_=e.getOpacity(),this.originX_=o[0],this.originY_=o[1],this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScale(),this.width_=r[0]},t}(Ms),Ts=function(e){function t(t,i,r,n,a,o){e.call(this,t,i,r,n,a,o)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.drawFlatCoordinates_=function(e,t,i,r){var n=this.coordinates.length,a=this.appendFlatCoordinates(e,t,i,r,!1,!1),o=[_s.MOVE_TO_LINE_TO,n,a];return this.instructions.push(o),this.hitDetectionInstructions.push(o),i},t.prototype.drawLineString=function(e,t){var i=this.state,r=i.strokeStyle,n=i.lineWidth;if(void 0!==r&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([_s.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],vs);var a=e.getFlatCoordinates(),o=e.getStride();this.drawFlatCoordinates_(a,0,a.length,o),this.hitDetectionInstructions.push(gs),this.endGeometry(e,t)}},t.prototype.drawMultiLineString=function(e,t){var i=this.state,r=i.strokeStyle,n=i.lineWidth;if(void 0!==r&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([_s.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],vs);for(var a=e.getEnds(),o=e.getFlatCoordinates(),s=e.getStride(),l=0,h=0,c=a.length;h<c;++h)l=this.drawFlatCoordinates_(o,l,a[h],s);this.hitDetectionInstructions.push(gs),this.endGeometry(e,t)}},t.prototype.finish=function(){var e=this.state;void 0!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(gs),this.reverseHitDetectionInstructions(),this.state=null},t.prototype.applyStroke=function(t){void 0!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(gs),t.lastStroke=this.coordinates.length),t.lastStroke=0,e.prototype.applyStroke.call(this,t),this.instructions.push(vs)},t}(Ms),Is=function(e){function t(t,i,r,n,a,o){e.call(this,t,i,r,n,a,o)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.drawFlatCoordinatess_=function(e,t,i,r){var n=this.state,a=void 0!==n.fillStyle,o=void 0!=n.strokeStyle,s=i.length;this.instructions.push(vs),this.hitDetectionInstructions.push(vs);for(var l=0;l<s;++l){var h=i[l],c=this.coordinates.length,u=this.appendFlatCoordinates(e,t,h,r,!0,!o),d=[_s.MOVE_TO_LINE_TO,c,u];this.instructions.push(d),this.hitDetectionInstructions.push(d),o&&(this.instructions.push(bs),this.hitDetectionInstructions.push(bs)),t=h}return a&&(this.instructions.push(ys),this.hitDetectionInstructions.push(ys)),o&&(this.instructions.push(gs),this.hitDetectionInstructions.push(gs)),t},t.prototype.drawCircle=function(e,t){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([_s.SET_FILL_STYLE,Uo(ts)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([_s.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var a=e.getFlatCoordinates(),o=e.getStride(),s=this.coordinates.length;this.appendFlatCoordinates(a,0,a.length,o,!1,!1);var l=[_s.CIRCLE,s];this.instructions.push(vs,l),this.hitDetectionInstructions.push(vs,l),this.hitDetectionInstructions.push(ys),void 0!==i.fillStyle&&this.instructions.push(ys),void 0!==i.strokeStyle&&(this.instructions.push(gs),this.hitDetectionInstructions.push(gs)),this.endGeometry(e,t)}},t.prototype.drawPolygon=function(e,t){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([_s.SET_FILL_STYLE,Uo(ts)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([_s.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var a=e.getEnds(),o=e.getOrientedFlatCoordinates(),s=e.getStride();this.drawFlatCoordinatess_(o,0,a,s),this.endGeometry(e,t)}},t.prototype.drawMultiPolygon=function(e,t){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([_s.SET_FILL_STYLE,Uo(ts)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([_s.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var a=e.getEndss(),o=e.getOrientedFlatCoordinates(),s=e.getStride(),l=0,h=0,c=a.length;h<c;++h)l=this.drawFlatCoordinatess_(o,l,a[h],s);this.endGeometry(e,t)}},t.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var t=this.coordinates,i=0,r=t.length;i<r;++i)t[i]=lo(t[i],e)},t.prototype.setFillStrokeStyles_=function(e){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill,e),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},t}(Ms);function Os(e,t,i,r,n){var a,o,s,l,h,c,u,d,p,f=i,m=i,y=0,g=0,v=i;for(a=i;a<r;a+=n){var b=t[a],_=t[a+1];void 0!==l&&(d=b-l,p=_-h,s=Math.sqrt(d*d+p*p),void 0!==c&&(g+=o,Math.acos((c*d+u*p)/(o*s))>e&&(g>y&&(y=g,f=v,m=a),g=0,v=a-n)),o=s,c=d,u=p),l=b,h=_}return(g+=s)>y?[v,a]:[f,m]}var Es="point",Ls="line";var Ps={Circle:Is,Default:Ms,Image:ks,LineString:Ts,Polygon:Is,Text:function(e){function t(t,i,r,n,a,o){e.call(this,t,i,r,n,a,o),this.declutterGroup_,this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.widths_={},as.prune()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.drawText=function(e,t){var i=this.textFillState_,r=this.textStrokeState_,n=this.textState_;if(""!==this.text_&&n&&(i||r)){var a,o,s=this.coordinates.length,l=e.getType(),h=null,c=2,u=2;if(n.placement===Ls){if(!Tn(this.getBufferedMaxExtent(),e.getExtent()))return;var d;if(h=e.getFlatCoordinates(),u=e.getStride(),l==ln.LINE_STRING)d=[h.length];else if(l==ln.MULTI_LINE_STRING)d=e.getEnds();else if(l==ln.POLYGON)d=e.getEnds().slice(0,1);else if(l==ln.MULTI_POLYGON){var p=e.getEndss();for(d=[],a=0,o=p.length;a<o;++a)d.push(p[a][0])}this.beginGeometry(e,t);for(var f,m=n.textAlign,y=0,g=0,v=d.length;g<v;++g){if(void 0==m){var b=Os(n.maxAngle,h,y,d[g],u);y=b[0],f=b[1]}else f=d[g];for(a=y;a<f;a+=u)this.coordinates.push(h[a],h[a+1]);c=this.coordinates.length,y=d[g],this.drawChars_(s,c,this.declutterGroup_),s=c}this.endGeometry(e,t)}else{var _=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_),w=_.width/this.pixelRatio;switch(l){case ln.POINT:case ln.MULTI_POINT:c=(h=e.getFlatCoordinates()).length;break;case ln.LINE_STRING:h=e.getFlatMidpoint();break;case ln.CIRCLE:h=e.getCenter();break;case ln.MULTI_LINE_STRING:c=(h=e.getFlatMidpoints()).length;break;case ln.POLYGON:if(h=e.getFlatInteriorPoint(),!n.overflow&&h[2]/this.resolution<w)return;u=3;break;case ln.MULTI_POLYGON:var x=e.getFlatInteriorPoints();for(h=[],a=0,o=x.length;a<o;a+=3)(n.overflow||x[a+2]/this.resolution>=w)&&h.push(x[a],x[a+1]);if(0==(c=h.length))return}c=this.appendFlatCoordinates(h,0,c,u,!1,!1),(n.backgroundFill||n.backgroundStroke)&&(this.setFillStrokeStyle(n.backgroundFill,n.backgroundStroke),n.backgroundFill&&(this.updateFillStyle(this.state,this.createFill,e),this.hitDetectionInstructions.push(this.createFill(this.state,e))),n.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(e,t),this.drawTextImage_(_,s,c),this.endGeometry(e,t)}}},t.prototype.getImage=function(e,t,i,r){var n,a=r+t+e+i+this.pixelRatio;if(!as.containsKey(a)){var o=r?this.strokeStates[r]||this.textStrokeState_:null,s=i?this.fillStates[i]||this.textFillState_:null,l=this.textStates[t]||this.textState_,h=this.pixelRatio,c=l.scale*h,u=xs[l.textAlign||"center"],d=r&&o.lineWidth?o.lineWidth:0,p=e.split("\n"),f=p.length,m=[],y=function(e,t,i){for(var r=t.length,n=0,a=0;a<r;++a){var o=ds(e,t[a]);n=Math.max(n,o),i.push(o)}return n}(l.font,p,m),g=us(l.font),v=g*f,b=y+d,_=Vo(Math.ceil(b*c),Math.ceil((v+d)*c));n=_.canvas,as.set(a,n),1!=c&&_.scale(c,c),_.font=l.font,r&&(_.strokeStyle=o.strokeStyle,_.lineWidth=d,_.lineCap=o.lineCap,_.lineJoin=o.lineJoin,_.miterLimit=o.miterLimit,Ko&&o.lineDash.length&&(_.setLineDash(o.lineDash),_.lineDashOffset=o.lineDashOffset)),i&&(_.fillStyle=s.fillStyle),_.textBaseline="middle",_.textAlign="center";var w,x=.5-u,C=u*n.width/c+x*d;if(r)for(w=0;w<f;++w)_.strokeText(p[w],C+x*m[w],.5*(d+g)+w*g);if(i)for(w=0;w<f;++w)_.fillText(p[w],C+x*m[w],.5*(d+g)+w*g)}return as.get(a)},t.prototype.drawTextImage_=function(e,t,i){var r=this.textState_,n=this.textStrokeState_,a=this.pixelRatio,o=xs[r.textAlign||"center"],s=xs[r.textBaseline],l=n&&n.lineWidth?n.lineWidth:0,h=o*e.width/a+2*(.5-o)*l,c=s*e.height/a+2*(.5-s)*l;this.instructions.push([_s.DRAW_IMAGE,t,i,e,(h-this.textOffsetX_)*a,(c-this.textOffsetY_)*a,this.declutterGroup_,e.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,e.width,r.padding==ns?ns:r.padding.map(function(e){return e*a}),!!r.backgroundFill,!!r.backgroundStroke]),this.hitDetectionInstructions.push([_s.DRAW_IMAGE,t,i,e,(h-this.textOffsetX_)*a,(c-this.textOffsetY_)*a,this.declutterGroup_,e.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/a,e.width,r.padding,!!r.backgroundFill,!!r.backgroundStroke])},t.prototype.drawChars_=function(e,t,i){var r=this.textStrokeState_,n=this.textState_,a=this.textFillState_,o=this.strokeKey_;r&&(o in this.strokeStates||(this.strokeStates[o]={strokeStyle:r.strokeStyle,lineCap:r.lineCap,lineDashOffset:r.lineDashOffset,lineWidth:r.lineWidth,lineJoin:r.lineJoin,miterLimit:r.miterLimit,lineDash:r.lineDash}));var s=this.textKey_;this.textKey_ in this.textStates||(this.textStates[this.textKey_]={font:n.font,textAlign:n.textAlign||"center",scale:n.scale});var l=this.fillKey_;a&&(l in this.fillStates||(this.fillStates[l]={fillStyle:a.fillStyle}));var h=this.pixelRatio,c=xs[n.textBaseline],u=this.textOffsetY_*h,d=this.text_,p=n.font,f=n.scale,m=r?r.lineWidth*f/2:0,y=this.widths_[p];y||(this.widths_[p]=y={}),this.instructions.push([_s.DRAW_CHARS,e,t,c,i,n.overflow,l,n.maxAngle,function(e){var t=y[e];return t||(t=y[e]=ds(p,e)),t*f*h},u,o,m*h,d,s,1]),this.hitDetectionInstructions.push([_s.DRAW_CHARS,e,t,c,i,n.overflow,l,n.maxAngle,function(e){var t=y[e];return t||(t=y[e]=ds(p,e)),t*f},u,o,m,d,s,1/h])},t.prototype.setTextStyle=function(e,t){var i,r,n;if(e){this.declutterGroup_=t;var a=e.getFill();a?((r=this.textFillState_)||(r=this.textFillState_={}),r.fillStyle=Xo(a.getColor()||ts)):r=this.textFillState_=null;var o=e.getStroke();if(o){(n=this.textStrokeState_)||(n=this.textStrokeState_={});var s=o.getLineDash(),l=o.getLineDashOffset(),h=o.getWidth(),c=o.getMiterLimit();n.lineCap=o.getLineCap()||"round",n.lineDash=s?s.slice():is,n.lineDashOffset=void 0===l?0:l,n.lineJoin=o.getLineJoin()||"round",n.lineWidth=void 0===h?1:h,n.miterLimit=void 0===c?10:c,n.strokeStyle=Xo(o.getColor()||rs)}else n=this.textStrokeState_=null;i=this.textState_;var u=e.getFont()||"10px sans-serif";hs(u);var d=e.getScale();i.overflow=e.getOverflow(),i.font=u,i.maxAngle=e.getMaxAngle(),i.placement=e.getPlacement(),i.textAlign=e.getTextAlign(),i.textBaseline=e.getTextBaseline()||"middle",i.backgroundFill=e.getBackgroundFill(),i.backgroundStroke=e.getBackgroundStroke(),i.padding=e.getPadding()||ns,i.scale=void 0===d?1:d;var p=e.getOffsetX(),f=e.getOffsetY(),m=e.getRotateWithView(),y=e.getRotation();this.text_=e.getText()||"",this.textOffsetX_=void 0===p?0:p,this.textOffsetY_=void 0===f?0:f,this.textRotateWithView_=void 0!==m&&m,this.textRotation_=void 0===y?0:y,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:Yr(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?"),this.fillKey_=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+Yr(r.fillStyle):""}else this.text_=""},t}(Ms)},Rs=function(e){function t(t,i,r,n,a,o,s){e.call(this),this.declutterTree_=o,this.declutterGroup_=null,this.tolerance_=t,this.maxExtent_=i,this.overlaps_=a,this.pixelRatio_=n,this.resolution_=r,this.renderBuffer_=s,this.replaysByZIndex_={},this.hitDetectionContext_=Vo(1,1),this.hitDetectionTransform_=[1,0,0,1,0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.addDeclutter=function(e){var t=null;return this.declutterTree_&&(e?(t=this.declutterGroup_)[4]++:(t=this.declutterGroup_=[1/0,1/0,-1/0,-1/0]).push(1)),t},t.prototype.clip=function(e,t){var i=this.getClipCoords(t);e.beginPath(),e.moveTo(i[0],i[1]),e.lineTo(i[2],i[3]),e.lineTo(i[4],i[5]),e.lineTo(i[6],i[7]),e.clip()},t.prototype.hasReplays=function(e){for(var t in this.replaysByZIndex_)for(var i=this.replaysByZIndex_[t],r=0,n=e.length;r<n;++r)if(e[r]in i)return!0;return!1},t.prototype.finish=function(){for(var e in this.replaysByZIndex_){var t=this.replaysByZIndex_[e];for(var i in t)t[i].finish()}},t.prototype.forEachFeatureAtCoordinate=function(e,t,i,r,n,a,o){var s,l=2*(r=Math.round(r))+1,h=Da(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-i,-e[0],-e[1]),c=this.hitDetectionContext_;c.canvas.width!==l||c.canvas.height!==l?(c.canvas.width=l,c.canvas.height=l):c.clearRect(0,0,l,l),void 0!==this.renderBuffer_&&(vn(s=[1/0,1/0,-1/0,-1/0],e),cn(s,t*(this.renderBuffer_+r),s));var u,d,p=function(e){if(void 0!==js[e])return js[e];for(var t=2*e+1,i=new Array(t),r=0;r<t;r++)i[r]=new Array(t);var n=e,a=0,o=0;for(;n>=a;)As(i,e+n,e+a),As(i,e+a,e+n),As(i,e-a,e+n),As(i,e-n,e+a),As(i,e-n,e-a),As(i,e-a,e-n),As(i,e+a,e-n),As(i,e+n,e-a),2*((o+=1+2*++a)-n)+1>0&&(o+=1-2*(n-=1));return js[e]=i,i}(r);function f(e){for(var t=c.getImageData(0,0,l,l).data,i=0;i<l;i++)for(var r=0;r<l;r++)if(p[i][r]&&t[4*(r*l+i)+3]>0){var n=void 0;return(!u||d!=Fo.IMAGE&&d!=Fo.TEXT||-1!==u.indexOf(e))&&(n=a(e)),n||void c.clearRect(0,0,l,l)}}this.declutterTree_&&(u=this.declutterTree_.all().map(function(e){return e.value}));var m,y,g,v,b,_=Object.keys(this.replaysByZIndex_).map(Number);for(_.sort(sa),m=_.length-1;m>=0;--m){var w=_[m].toString();for(g=this.replaysByZIndex_[w],y=ws.length-1;y>=0;--y)if(void 0!==(v=g[d=ws[y]]))if(!o||d!=Fo.IMAGE&&d!=Fo.TEXT){if(b=v.replayHitDetection(c,h,i,n,f,s))return b}else{var x=o[w];x?x.push(v,h.slice(0)):o[w]=[v,h.slice(0)]}}},t.prototype.getClipCoords=function(e){var t=this.maxExtent_,i=t[0],r=t[1],n=t[2],a=t[3],o=[i,r,i,a,n,a,n,r];return Aa(o,0,8,2,e,o),o},t.prototype.getReplay=function(e,t){var i=void 0!==e?e.toString():"0",r=this.replaysByZIndex_[i];void 0===r&&(r={},this.replaysByZIndex_[i]=r);var n=r[t];void 0===n&&(n=new(0,Ps[t])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),r[t]=n);return n},t.prototype.getReplays=function(){return this.replaysByZIndex_},t.prototype.isEmpty=function(){return tn(this.replaysByZIndex_)},t.prototype.replay=function(e,t,i,r,n,a,o){var s=Object.keys(this.replaysByZIndex_).map(Number);s.sort(sa),e.save(),this.clip(e,t);var l,h,c,u,d,p,f=a||ws;for(l=0,h=s.length;l<h;++l){var m=s[l].toString();for(d=this.replaysByZIndex_[m],c=0,u=f.length;c<u;++c){var y=f[c];if(p=d[y],void 0!==p)if(!o||y!=Fo.IMAGE&&y!=Fo.TEXT)p.replay(e,t,i,r,n);else{var g=o[m];g?g.push(p,t.slice(0)):o[m]=[p,t.slice(0)]}}}e.restore()},t}(Go),js={0:[[!0]]};function As(e,t,i){var r,n=Math.floor(e.length/2);if(t>=n)for(r=n;r<t;r++)e[r][i]=!0;else if(t<n)for(r=t+1;r<n;r++)e[r][i]=!0}var zs=Rs,Ds={IDLE:0,LOADING:1,LOADED:2,ERROR:3},Vs={Point:function(e,t,i,r){var n=i.getImage();if(n){if(n.getImageState()!=Ds.LOADED)return;var a=e.getReplay(i.getZIndex(),Fo.IMAGE);a.setImageStyle(n,e.addDeclutter(!1)),a.drawPoint(t,r)}var o=i.getText();if(o){var s=e.getReplay(i.getZIndex(),Fo.TEXT);s.setTextStyle(o,e.addDeclutter(!!n)),s.drawText(t,r)}},LineString:function(e,t,i,r){var n=i.getStroke();if(n){var a=e.getReplay(i.getZIndex(),Fo.LINE_STRING);a.setFillStrokeStyle(null,n),a.drawLineString(t,r)}var o=i.getText();if(o){var s=e.getReplay(i.getZIndex(),Fo.TEXT);s.setTextStyle(o,e.addDeclutter(!1)),s.drawText(t,r)}},Polygon:function(e,t,i,r){var n=i.getFill(),a=i.getStroke();if(n||a){var o=e.getReplay(i.getZIndex(),Fo.POLYGON);o.setFillStrokeStyle(n,a),o.drawPolygon(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),Fo.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}},MultiPoint:function(e,t,i,r){var n=i.getImage();if(n){if(n.getImageState()!=Ds.LOADED)return;var a=e.getReplay(i.getZIndex(),Fo.IMAGE);a.setImageStyle(n,e.addDeclutter(!1)),a.drawMultiPoint(t,r)}var o=i.getText();if(o){var s=e.getReplay(i.getZIndex(),Fo.TEXT);s.setTextStyle(o,e.addDeclutter(!!n)),s.drawText(t,r)}},MultiLineString:function(e,t,i,r){var n=i.getStroke();if(n){var a=e.getReplay(i.getZIndex(),Fo.LINE_STRING);a.setFillStrokeStyle(null,n),a.drawMultiLineString(t,r)}var o=i.getText();if(o){var s=e.getReplay(i.getZIndex(),Fo.TEXT);s.setTextStyle(o,e.addDeclutter(!1)),s.drawText(t,r)}},MultiPolygon:function(e,t,i,r){var n=i.getFill(),a=i.getStroke();if(a||n){var o=e.getReplay(i.getZIndex(),Fo.POLYGON);o.setFillStrokeStyle(n,a),o.drawMultiPolygon(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),Fo.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}},GeometryCollection:function(e,t,i,r){var n,a,o=t.getGeometriesArray();for(n=0,a=o.length;n<a;++n){var s=Vs[o[n].getType()];s(e,o[n],i,r)}},Circle:function(e,t,i,r){var n=i.getFill(),a=i.getStroke();if(n||a){var o=e.getReplay(i.getZIndex(),Fo.CIRCLE);o.setFillStrokeStyle(n,a),o.drawCircle(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),Fo.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}}};function Ns(e,t,i,r,n,a){var o=!1,s=i.getImage();if(s){var l=s.getImageState();l==Ds.LOADED||l==Ds.ERROR?s.unlistenImageChange(n,a):(l==Ds.IDLE&&s.load(),l=s.getImageState(),s.listenImageChange(n,a),o=!0)}return function(e,t,i,r){var n=i.getGeometryFunction()(t);if(!n)return;var a=n.getSimplifiedGeometry(r);if(i.getRenderer())!function e(t,i,r,n){if(i.getType()==ln.GEOMETRY_COLLECTION){for(var a=i.getGeometries(),o=0,s=a.length;o<s;++o)e(t,a[o],r,n);return}var l=t.getReplay(r.getZIndex(),Fo.DEFAULT);l.drawCustom(i,n,r.getRenderer())}(e,a,i,t);else{var o=Vs[a.getType()];o(e,a,i,t)}}(e,t,i,r),o}var Gs=class{constructor(){this.queue=[]}push(e){this.queue.push(e)}remove(e){for(let t=0;t<this.queue.length;t++){const i=this.queue[t];if(i.x===e.x&&i.y===e.y&&i.z===e.z&&i.id===e.id)return void this.queue.splice(t,1)}}has(e){for(let t=0;t<this.queue.length;t++){const i=this.queue[t];if(i.x===e.x&&i.y===e.y&&i.z===e.z&&i.id===e.id)return!0}return!1}},Fs=i(4),Bs=i(8);function qs(e,t){let i;return e.some(function(e){if(e.id==t)return i=e.source,!0}),i}const Us=/font-family: ?([^;]*);/,Ws=/("|')/g;let Hs;const Ys={},Xs=i.n(Bs).a.getNames();function $s(e){if(e in Ys)return Ys[e];const t=e.map(function(e){return mb2css(e,1).split(" 1px ")[1].replace(/"/g,"")})[0];if(!function(e){if(!Hs){Hs={};const e=document.styleSheets;for(let t=0,i=e.length;t<i;++t){const i=e[t];try{const e=i.rules||i.cssRules;if(e)for(let t=0,i=e.length;t<i;++t){const i=e[t];if(5==i.type){const e=i.cssText.match(Us);Hs[e[1].replace(Ws,"")]=!0}}}catch(e){}}}return e in Hs}(t)&&-1!==Xs.indexOf(t)){const e="https://fonts.googleapis.com/css?family="+t.replace(/ /g,"+");if(!document.querySelector('link[href="'+e+'"]')){const t=document.createElement("link");t.href=e,t.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(t)}}return e}var Js=function(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale};Js.prototype.clone=function(){return new Js({opacity:this.getOpacity(),scale:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},Js.prototype.getOpacity=function(){return this.opacity_},Js.prototype.getRotateWithView=function(){return this.rotateWithView_},Js.prototype.getRotation=function(){return this.rotation_},Js.prototype.getScale=function(){return this.scale_},Js.prototype.getSnapToPixel=function(){return!1},Js.prototype.getAnchor=function(){return Wr()},Js.prototype.getImage=function(e){return Wr()},Js.prototype.getHitDetectionImage=function(e){return Wr()},Js.prototype.getImageState=function(){return Wr()},Js.prototype.getImageSize=function(){return Wr()},Js.prototype.getHitDetectionImageSize=function(){return Wr()},Js.prototype.getOrigin=function(){return Wr()},Js.prototype.getSize=function(){return Wr()},Js.prototype.setOpacity=function(e){this.opacity_=e},Js.prototype.setRotateWithView=function(e){this.rotateWithView_=e},Js.prototype.setRotation=function(e){this.rotation_=e},Js.prototype.setScale=function(e){this.scale_=e},Js.prototype.setSnapToPixel=function(e){},Js.prototype.listenImageChange=function(e,t){return Wr()},Js.prototype.load=function(){Wr()},Js.prototype.unlistenImageChange=function(e,t){Wr()};var Ks=Js,Zs=function(e){function t(t){var i=t||{};e.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,atlasManager:i.atlasManager})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){var e=new t({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),atlasManager:this.atlasManager_});return e.setOpacity(this.getOpacity()),e.setScale(this.getScale()),e},t.prototype.setRadius=function(e){this.radius_=e,this.render_(this.atlasManager_)},t}(function(e){function t(t){var i=void 0!==t.rotateWithView&&t.rotateWithView;e.call(this,{opacity:1,rotateWithView:i,rotation:void 0!==t.rotation?t.rotation:0,scale:1}),this.checksums_=null,this.canvas_=null,this.hitDetectionCanvas_=null,this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=void 0!==t.radius?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.anchor_=null,this.size_=null,this.imageSize_=null,this.hitDetectionImageSize_=null,this.atlasManager_=t.atlasManager,this.render_(this.atlasManager_)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){var e=new t({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),atlasManager:this.atlasManager_});return e.setOpacity(this.getOpacity()),e.setScale(this.getScale()),e},t.prototype.getAnchor=function(){return this.anchor_},t.prototype.getAngle=function(){return this.angle_},t.prototype.getFill=function(){return this.fill_},t.prototype.getHitDetectionImage=function(e){return this.hitDetectionCanvas_},t.prototype.getImage=function(e){return this.canvas_},t.prototype.getImageSize=function(){return this.imageSize_},t.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},t.prototype.getImageState=function(){return Ds.LOADED},t.prototype.getOrigin=function(){return this.origin_},t.prototype.getPoints=function(){return this.points_},t.prototype.getRadius=function(){return this.radius_},t.prototype.getRadius2=function(){return this.radius2_},t.prototype.getSize=function(){return this.size_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.listenImageChange=function(e,t){},t.prototype.load=function(){},t.prototype.unlistenImageChange=function(e,t){},t.prototype.render_=function(e){var t,i,r="",n="",a=0,o=null,s=0,l=0;this.stroke_&&(null===(i=this.stroke_.getColor())&&(i=rs),i=Xo(i),void 0===(l=this.stroke_.getWidth())&&(l=1),o=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset(),Ko||(o=null,s=0),void 0===(n=this.stroke_.getLineJoin())&&(n="round"),void 0===(r=this.stroke_.getLineCap())&&(r="round"),void 0===(a=this.stroke_.getMiterLimit())&&(a=10));var h=2*(this.radius_+l)+1,c={strokeStyle:i,strokeWidth:l,size:h,lineCap:r,lineDash:o,lineDashOffset:s,lineJoin:n,miterLimit:a};if(void 0===e){var u=Vo(h,h);this.canvas_=u.canvas,t=h=this.canvas_.width,this.draw_(c,u,0,0),this.createHitDetectionCanvas_(c)}else{h=Math.round(h);var d,p=!this.fill_;p&&(d=this.drawHitDetectionCanvas_.bind(this,c));var f=this.getChecksum(),m=e.add(f,h,h,this.draw_.bind(this,c),d);this.canvas_=m.image,this.origin_=[m.offsetX,m.offsetY],t=m.image.width,p?(this.hitDetectionCanvas_=m.hitImage,this.hitDetectionImageSize_=[m.hitImage.width,m.hitImage.height]):(this.hitDetectionCanvas_=this.canvas_,this.hitDetectionImageSize_=[t,t])}this.anchor_=[h/2,h/2],this.size_=[h,h],this.imageSize_=[t,t]},t.prototype.draw_=function(e,t,i,r){var n,a,o;t.setTransform(1,0,0,1,0,0),t.translate(i,r),t.beginPath();var s=this.points_;if(s===1/0)t.arc(e.size/2,e.size/2,this.radius_,0,2*Math.PI,!0);else{var l=void 0!==this.radius2_?this.radius2_:this.radius_;for(l!==this.radius_&&(s*=2),n=0;n<=s;n++)a=2*n*Math.PI/s-Math.PI/2+this.angle_,o=n%2==0?this.radius_:l,t.lineTo(e.size/2+o*Math.cos(a),e.size/2+o*Math.sin(a))}if(this.fill_){var h=this.fill_.getColor();null===h&&(h=ts),t.fillStyle=Xo(h),t.fill()}this.stroke_&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke()),t.closePath()},t.prototype.createHitDetectionCanvas_=function(e){if(this.hitDetectionImageSize_=[e.size,e.size],this.fill_)this.hitDetectionCanvas_=this.canvas_;else{var t=Vo(e.size,e.size);this.hitDetectionCanvas_=t.canvas,this.drawHitDetectionCanvas_(e,t,0,0)}},t.prototype.drawHitDetectionCanvas_=function(e,t,i,r){t.setTransform(1,0,0,1,0,0),t.translate(i,r),t.beginPath();var n=this.points_;if(n===1/0)t.arc(e.size/2,e.size/2,this.radius_,0,2*Math.PI,!0);else{var a,o,s,l=void 0!==this.radius2_?this.radius2_:this.radius_;for(l!==this.radius_&&(n*=2),a=0;a<=n;a++)s=2*a*Math.PI/n-Math.PI/2+this.angle_,o=a%2==0?this.radius_:l,t.lineTo(e.size/2+o*Math.cos(s),e.size/2+o*Math.sin(s))}t.fillStyle=Uo(ts),t.fill(),this.stroke_&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.stroke()),t.closePath()},t.prototype.getChecksum=function(){var e=this.stroke_?this.stroke_.getChecksum():"-",t=this.fill_?this.fill_.getChecksum():"-";if(!this.checksums_||e!=this.checksums_[1]||t!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.radius2_!=this.checksums_[4]||this.angle_!=this.checksums_[5]||this.points_!=this.checksums_[6]){var i="r"+e+t+(void 0!==this.radius_?this.radius_.toString():"-")+(void 0!==this.radius2_?this.radius2_.toString():"-")+(void 0!==this.angle_?this.angle_.toString():"-")+(void 0!==this.points_?this.points_.toString():"-");this.checksums_=[i,e,t,this.radius_,this.radius2_,this.angle_,this.points_]}return this.checksums_[0]},t}(Ks)),Qs=function(e){var t=e||{};this.color_=void 0!==t.color?t.color:null,this.checksum_=void 0};Qs.prototype.clone=function(){var e=this.getColor();return new Qs({color:Array.isArray(e)?e.slice():e||void 0})},Qs.prototype.getColor=function(){return this.color_},Qs.prototype.setColor=function(e){this.color_=e,this.checksum_=void 0},Qs.prototype.getChecksum=function(){if(void 0===this.checksum_){var e=this.color_;e?Array.isArray(e)||"string"==typeof e?this.checksum_="f"+Uo(e):this.checksum_=Yr(this.color_):this.checksum_="f-"}return this.checksum_};var el=Qs,tl=function(e){var t=e||{};this.color_=void 0!==t.color?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=void 0!==t.lineDash?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width,this.checksum_=void 0};tl.prototype.clone=function(){var e=this.getColor();return new tl({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},tl.prototype.getColor=function(){return this.color_},tl.prototype.getLineCap=function(){return this.lineCap_},tl.prototype.getLineDash=function(){return this.lineDash_},tl.prototype.getLineDashOffset=function(){return this.lineDashOffset_},tl.prototype.getLineJoin=function(){return this.lineJoin_},tl.prototype.getMiterLimit=function(){return this.miterLimit_},tl.prototype.getWidth=function(){return this.width_},tl.prototype.setColor=function(e){this.color_=e,this.checksum_=void 0},tl.prototype.setLineCap=function(e){this.lineCap_=e,this.checksum_=void 0},tl.prototype.setLineDash=function(e){this.lineDash_=e,this.checksum_=void 0},tl.prototype.setLineDashOffset=function(e){this.lineDashOffset_=e,this.checksum_=void 0},tl.prototype.setLineJoin=function(e){this.lineJoin_=e,this.checksum_=void 0},tl.prototype.setMiterLimit=function(e){this.miterLimit_=e,this.checksum_=void 0},tl.prototype.setWidth=function(e){this.width_=e,this.checksum_=void 0},tl.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_="s",this.color_?"string"==typeof this.color_?this.checksum_+=this.color_:this.checksum_+=Yr(this.color_):this.checksum_+="-",this.checksum_+=","+(void 0!==this.lineCap_?this.lineCap_.toString():"-")+","+(this.lineDash_?this.lineDash_.toString():"-")+","+(void 0!==this.lineDashOffset_?this.lineDashOffset_:"-")+","+(void 0!==this.lineJoin_?this.lineJoin_:"-")+","+(void 0!==this.miterLimit_?this.miterLimit_.toString():"-")+","+(void 0!==this.width_?this.width_.toString():"-")),this.checksum_};var il=tl,rl=function(e){var t=e||{};this.geometry_=null,this.geometryFunction_=nl,void 0!==t.geometry&&this.setGeometry(t.geometry),this.fill_=void 0!==t.fill?t.fill:null,this.image_=void 0!==t.image?t.image:null,this.renderer_=void 0!==t.renderer?t.renderer:null,this.stroke_=void 0!==t.stroke?t.stroke:null,this.text_=void 0!==t.text?t.text:null,this.zIndex_=t.zIndex};rl.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new rl({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},rl.prototype.getRenderer=function(){return this.renderer_},rl.prototype.setRenderer=function(e){this.renderer_=e},rl.prototype.getGeometry=function(){return this.geometry_},rl.prototype.getGeometryFunction=function(){return this.geometryFunction_},rl.prototype.getFill=function(){return this.fill_},rl.prototype.setFill=function(e){this.fill_=e},rl.prototype.getImage=function(){return this.image_},rl.prototype.setImage=function(e){this.image_=e},rl.prototype.getStroke=function(){return this.stroke_},rl.prototype.setStroke=function(e){this.stroke_=e},rl.prototype.getText=function(){return this.text_},rl.prototype.setText=function(e){this.text_=e},rl.prototype.getZIndex=function(){return this.zIndex_},rl.prototype.setGeometry=function(e){"function"==typeof e?this.geometryFunction_=e:"string"==typeof e?this.geometryFunction_=function(t){return t.get(e)}:e?void 0!==e&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=nl,this.geometry_=e},rl.prototype.setZIndex=function(e){this.zIndex_=e};function nl(e){return e.getGeometry()}var al=rl,ol={FRACTION:"fraction",PIXELS:"pixels"},sl=function(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32};function ll(e,t,i){return t+":"+e+":"+(i?Uo(i):"null")}sl.prototype.clear=function(){this.cache_={},this.cacheSize_=0},sl.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){var e=0;for(var t in this.cache_){var i=this.cache_[t];0!=(3&e++)||i.hasListener()||(delete this.cache_[t],--this.cacheSize_)}}},sl.prototype.get=function(e,t,i){var r=ll(e,t,i);return r in this.cache_?this.cache_[r]:null},sl.prototype.set=function(e,t,i,r){var n=ll(e,t,i);this.cache_[n]=r,++this.cacheSize_},sl.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()};var hl=new sl,cl=function(e){function t(t,i,r,n,a,o){e.call(this),this.hitDetectionImage_=null,this.image_=t||new Image,null!==n&&(this.image_.crossOrigin=n),this.canvas_=o?document.createElement("canvas"):null,this.color_=o,this.imageListenerKeys_=null,this.imageState_=a,this.size_=r,this.src_=i,this.tainted_}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Ds.LOADED){this.tainted_=!1;var e=Vo(1,1);try{e.drawImage(this.image_,0,0),e.getImageData(0,0,1,1)}catch(e){this.tainted_=!0}}return!0===this.tainted_},t.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(ka)},t.prototype.handleImageError_=function(){this.imageState_=Ds.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},t.prototype.handleImageLoad_=function(){this.imageState_=Ds.LOADED,this.size_&&(this.image_.width=this.size_[0],this.image_.height=this.size_[1]),this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.replaceColor_(),this.dispatchChangeEvent_()},t.prototype.getImage=function(e){return this.canvas_?this.canvas_:this.image_},t.prototype.getImageState=function(){return this.imageState_},t.prototype.getHitDetectionImage=function(e){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],i=this.size_[1],r=Vo(t,i);r.fillRect(0,0,t,i),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},t.prototype.getSize=function(){return this.size_},t.prototype.getSrc=function(){return this.src_},t.prototype.load=function(){if(this.imageState_==Ds.IDLE){this.imageState_=Ds.LOADING,this.imageListenerKeys_=[ga(this.image_,Ia,this.handleImageError_,this),ga(this.image_,Oa,this.handleImageLoad_,this)];try{this.image_.src=this.src_}catch(e){this.handleImageError_()}}},t.prototype.replaceColor_=function(){if(this.color_&&!this.isTainted_()){this.canvas_.width=this.image_.width,this.canvas_.height=this.image_.height;var e=this.canvas_.getContext("2d");e.drawImage(this.image_,0,0);for(var t=e.getImageData(0,0,this.image_.width,this.image_.height),i=t.data,r=this.color_[0]/255,n=this.color_[1]/255,a=this.color_[2]/255,o=0,s=i.length;o<s;o+=4)i[o]*=r,i[o+1]*=n,i[o+2]*=a;e.putImageData(t,0,0)}},t.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(ba),this.imageListenerKeys_=null},t}(Ma);var ul={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},dl=function(e){function t(t){var i=t||{},r=void 0!==i.opacity?i.opacity:1,n=void 0!==i.rotation?i.rotation:0,a=void 0!==i.scale?i.scale:1,o=void 0!==i.rotateWithView&&i.rotateWithView;e.call(this,{opacity:r,rotation:n,scale:a,rotateWithView:o}),this.anchor_=void 0!==i.anchor?i.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:ul.TOP_LEFT,this.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:ol.FRACTION,this.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:ol.FRACTION,this.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null;var s=void 0!==i.img?i.img:null,l=void 0!==i.imgSize?i.imgSize:null,h=i.src;Jr(!(void 0!==h&&s),4),Jr(!s||s&&l,5),void 0!==h&&0!==h.length||!s||(h=s.src||Yr(s)),Jr(void 0!==h&&h.length>0,6);var c=void 0!==i.src?Ds.IDLE:Ds.LOADED;this.color_=void 0!==i.color?function(e){return Array.isArray(e)?e:Wo(e)}(i.color):null,this.iconImage_=function(e,t,i,r,n,a){var o=hl.get(t,r,a);return o||(o=new cl(e,t,i,r,n,a),hl.set(t,r,a,o)),o}(s,h,l,this.crossOrigin_,c,this.color_),this.offset_=void 0!==i.offset?i.offset:[0,0],this.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:ul.TOP_LEFT,this.origin_=null,this.size_=void 0!==i.size?i.size:null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},t.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var e=this.anchor_,t=this.getSize();if(this.anchorXUnits_==ol.FRACTION||this.anchorYUnits_==ol.FRACTION){if(!t)return null;e=this.anchor_.slice(),this.anchorXUnits_==ol.FRACTION&&(e[0]*=t[0]),this.anchorYUnits_==ol.FRACTION&&(e[1]*=t[1])}if(this.anchorOrigin_!=ul.TOP_LEFT){if(!t)return null;e===this.anchor_&&(e=this.anchor_.slice()),this.anchorOrigin_!=ul.TOP_RIGHT&&this.anchorOrigin_!=ul.BOTTOM_RIGHT||(e[0]=-e[0]+t[0]),this.anchorOrigin_!=ul.BOTTOM_LEFT&&this.anchorOrigin_!=ul.BOTTOM_RIGHT||(e[1]=-e[1]+t[1])}return this.normalizedAnchor_=e,this.normalizedAnchor_},t.prototype.setAnchor=function(e){this.anchor_=e,this.normalizedAnchor_=null},t.prototype.getColor=function(){return this.color_},t.prototype.getImage=function(e){return this.iconImage_.getImage(e)},t.prototype.getImageSize=function(){return this.iconImage_.getSize()},t.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},t.prototype.getImageState=function(){return this.iconImage_.getImageState()},t.prototype.getHitDetectionImage=function(e){return this.iconImage_.getHitDetectionImage(e)},t.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var e=this.offset_;if(this.offsetOrigin_!=ul.TOP_LEFT){var t=this.getSize(),i=this.iconImage_.getSize();if(!t||!i)return null;e=e.slice(),this.offsetOrigin_!=ul.TOP_RIGHT&&this.offsetOrigin_!=ul.BOTTOM_RIGHT||(e[0]=i[0]-t[0]-e[0]),this.offsetOrigin_!=ul.BOTTOM_LEFT&&this.offsetOrigin_!=ul.BOTTOM_RIGHT||(e[1]=i[1]-t[1]-e[1])}return this.origin_=e,this.origin_},t.prototype.getSrc=function(){return this.iconImage_.getSrc()},t.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},t.prototype.listenImageChange=function(e,t){return ya(this.iconImage_,ka,e,t)},t.prototype.load=function(){this.iconImage_.load()},t.prototype.unlistenImageChange=function(e,t){va(this.iconImage_,ka,e,t)},t}(Ks),pl=function(e){var t=e||{};this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.text_=t.text,this.textAlign_=t.textAlign,this.textBaseline_=t.textBaseline,this.fill_=void 0!==t.fill?t.fill:new el({color:"#333"}),this.maxAngle_=void 0!==t.maxAngle?t.maxAngle:Math.PI/4,this.placement_=void 0!==t.placement?t.placement:Es,this.overflow_=!!t.overflow,this.stroke_=void 0!==t.stroke?t.stroke:null,this.offsetX_=void 0!==t.offsetX?t.offsetX:0,this.offsetY_=void 0!==t.offsetY?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=void 0===t.padding?null:t.padding};pl.prototype.clone=function(){return new pl({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:this.getScale(),text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0})},pl.prototype.getOverflow=function(){return this.overflow_},pl.prototype.getFont=function(){return this.font_},pl.prototype.getMaxAngle=function(){return this.maxAngle_},pl.prototype.getPlacement=function(){return this.placement_},pl.prototype.getOffsetX=function(){return this.offsetX_},pl.prototype.getOffsetY=function(){return this.offsetY_},pl.prototype.getFill=function(){return this.fill_},pl.prototype.getRotateWithView=function(){return this.rotateWithView_},pl.prototype.getRotation=function(){return this.rotation_},pl.prototype.getScale=function(){return this.scale_},pl.prototype.getStroke=function(){return this.stroke_},pl.prototype.getText=function(){return this.text_},pl.prototype.getTextAlign=function(){return this.textAlign_},pl.prototype.getTextBaseline=function(){return this.textBaseline_},pl.prototype.getBackgroundFill=function(){return this.backgroundFill_},pl.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},pl.prototype.getPadding=function(){return this.padding_},pl.prototype.setOverflow=function(e){this.overflow_=e},pl.prototype.setFont=function(e){this.font_=e},pl.prototype.setMaxAngle=function(e){this.maxAngle_=e},pl.prototype.setOffsetX=function(e){this.offsetX_=e},pl.prototype.setOffsetY=function(e){this.offsetY_=e},pl.prototype.setPlacement=function(e){this.placement_=e},pl.prototype.setFill=function(e){this.fill_=e},pl.prototype.setRotation=function(e){this.rotation_=e},pl.prototype.setScale=function(e){this.scale_=e},pl.prototype.setStroke=function(e){this.stroke_=e},pl.prototype.setText=function(e){this.text_=e},pl.prototype.setTextAlign=function(e){this.textAlign_=e},pl.prototype.setTextBaseline=function(e){this.textBaseline_=e},pl.prototype.setBackgroundFill=function(e){this.backgroundFill_=e},pl.prototype.setBackgroundStroke=function(e){this.backgroundStroke_=e},pl.prototype.setPadding=function(e){this.padding_=e};var fl=pl,ml=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function yl(e,t){const i={};for(const t in e)"ref"!==t&&(i[t]=e[t]);return ml.forEach(e=>{e in t&&(i[e]=t[e])}),i}var gl=function(e){e=e.slice();const t=Object.create(null);for(let i=0;i<e.length;i++)t[e[i].id]=e[i];for(let i=0;i<e.length;i++)"ref"in e[i]&&(e[i]=yl(e[i],t[e[i].ref]));return e};var vl={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},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.",example:{anchor:"viewport",color:"white",intensity:.4}},sources:{required:!0,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).",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}},layers:{required:!0,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"}}]}},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_geojson","source_video","source_image"],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://<mapid>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},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."},"*":{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://<mapid>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},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."},"*":{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://<mapid>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},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"},"*":{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."},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)."},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."}},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:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},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",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.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",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",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",macos:"0.7.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",macos:"0.1.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`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},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:"A 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."},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_hillshade","layout_background"],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",macos:"0.1.0"}},"property-type":"constant"}},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":{js:"1.2.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",macos:"0.1.0"}},"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":{js:"1.2.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",macos:"0.1.0"}},"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",macos:"0.7.0"}},"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",macos:"0.5.0"}},"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",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"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",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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":{js:"1.2.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",macos:"0.1.0"},"data-driven styling":{}},"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",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},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 a higher sort key will appear above features with a lower sort key when they overlap. Features with a lower sort key will have priority over other features when doing placement.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"If `symbol-sort-key` is set, sort based on that. Otherwise sort symbols by their y-position relative to the viewport."},"viewport-y":{doc:"Symbols will be sorted by their y-position relative to the viewport."},source:{doc:"Symbols will be rendered in the same order as the source data with no sorting applied."}},default:"auto",doc:"Controls the order in which overlapping symbols in the same layer are rendered","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.2.1"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",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",macos:"0.2.1"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"string",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",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.6.0"},"data-driven styling":{}},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",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"data-driven styling":{}},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",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"data-driven styling":{}},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.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.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",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.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 doesn't support the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.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 render 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` instead of the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"Not yet supported",android:"Not yet supported",ios:"Not yet supported",macos:"Not yet supported"}},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",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.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",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,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",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"},{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},"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",macos:"0.1.0"},"data-driven styling":{}},"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",macos:"0.7.0"},"data-driven styling":{}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},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:22,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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.0"}}},match:{doc:'Selects the output whose label value matches the input value, or the fallback value if no match is found. The input can be any expression (e.g. `["get", "building_type"]`). Each label must be either:\n * a single literal value; or\n * an array of literal values, whose values must be all strings or all numbers (e.g. `[100, 101]` or `["c", "b"]`). The input matches if any of the values in the array matches, similar to the deprecated `"in"` operator.\n\nEach label must be unique. If 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",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.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 input 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",macos:"0.7.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<number>`, 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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.9.0"}}},format:{doc:"Returns `formatted` text containing annotations for use in mixed-format `text-field` entries. If set, the `text-font` argument overrides the font specified by the root layout properties. If set, the `font-scale` argument specifies a scaling factor relative to the `text-size` specified in the root layout properties.",group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.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 `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"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a 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, 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. 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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.0"}}},length:{doc:"Gets 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",macos:"0.7.0"}}},properties:{doc:'Gets 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",macos:"0.7.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. 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"}}},"geometry-type":{doc:"Gets the feature's geometry type: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Gets 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",macos:"0.7.0"}}},zoom:{doc:'Gets 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:"Zoom","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"heatmap-density":{doc:"Gets 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",macos:"0.7.0"}}},"line-progress":{doc:"Gets 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",macos:"0.12.0"}}},accumulated:{doc:"Gets 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"}}},"+":{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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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"},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",macos:"0.7.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",macos:"0.7.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",macos:"0.7.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",macos:"0.9.0"}}}}},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",macos:"0.5.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",macos:"0.5.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",macos:"0.5.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",macos:"0.5.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"string",transition:!0,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",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"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",macos:"0.5.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",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.5.0"},"data-driven styling":{}},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",macos:"0.5.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"string",transition:!0,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",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-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",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"string",transition:!0,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",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},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",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.2.1"},"data-driven styling":{}},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",macos:"0.6.0"},"data-driven styling":{}},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",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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",macos:"0.7.0"},"data-driven styling":{}},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",macos:"0.7.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",macos:"0.7.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"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.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"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",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},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",macos:"0.9.0"},"data-driven styling":{}},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",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"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`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},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",macos:"0.7.0"},"data-driven styling":{}},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",macos:"0.7.0"},"data-driven styling":{}},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",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"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",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"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",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"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",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"string",transition:!0,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",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"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",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"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."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It 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."}}},bl=i(3),_l={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},wl=" ",xl=/(italic|oblique)$/i,Cl={};function Sl(e,t){var i=Cl[e];if(!i){Array.isArray(e)||(e=[e]);for(var r="normal",n="normal",a=[],o=0,s=e.length;o<s;++o){var l=e[o].split(" "),h=l[l.length-1].toLowerCase();for(var c in"normal"==h||"italic"==h||"oblique"==h?(n=h,l.pop(),h=l[l.length-1].toLowerCase()):xl.test(h)&&(h=h.replace(xl,""),n=l[l.length-1].replace(h,"")),_l)if(h==c||h==c.replace("-","")||h==c.replace("-",wl)){r=_l[c],l.pop();break}"number"==typeof h&&(r=h);var u=l.join(wl).replace("Klokantech Noto Sans","Noto Sans");-1!==u.indexOf(wl)&&(u='"'+u+'"'),a.push(u)}i=Cl[e]=[n,r,a]}return i[0]+wl+i[1]+wl+t+"px"+wl+i[2]}function Ml(e){return e*Math.PI/180}const kl=bl.d.isFunction,Tl=bl.d.convertFunction,Il=bl.b.isExpression,Ol=bl.b.createPropertyExpression,El={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Ll=function(e,t){const i=Ol(e,t);if("error"===i.result)throw new Error(i.value.map(e=>`${e.key}: ${e.message}`).join(", "));return i.value},Pl={},Rl={zoom:0},jl={};function Al(e,t,i,r,n){const a=e.id;jl[a]||(jl[a]={});const o=jl[a];if(!o[i]){let r=(e[t]||Pl)[i];const n=vl[`${t}_${e.type}`][i];void 0===r&&(r=n.default);let a=Il(r);if(!a&&kl(r)&&(r=Tl(r,n),a=!0),a){const e=Ll(r,n);o[i]=e.evaluate.bind(e)}else"color"==n.type&&(r=bl.a.parse(r)),o[i]=function(){return r}}return Rl.zoom=r,o[i](Rl,n)}const zl={};function Dl(e,t,i,r){return e in zl||(zl[e]=Object(bl.c)(t).filter),Rl.zoom=r,zl[e](Rl,i)}const Vl={};function Nl(e,t){if(e&&void 0!==t){let i=Vl[e];i||(Vl[e]=i={color:e.toArray(),opacity:e.a}),(e=i.color)[3]=i.opacity*t,0===e[3]&&(e=void 0)}return e}const Gl=/^([^]*)\{(.*)\}([^]*)$/;function Fl(e,t){let i;do{if(i=e.match(Gl)){const r=t[i[2]]||"";e=i[1]+r+i[3]}}while(i);return e}var Bl=function(e,t,i,r,n,a){if(!i){i=[];for(let e=78271.51696402048;i.length<21;e/=2)i.push(e)}if("string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");let o,s;if(n){const e=new Image;e.crossOrigin="anonymous",e.onload=function(){o=e,s=[e.width,e.height],e.onload=null},e.src=n}const l=document.createElement("CANVAS").getContext("2d"),h={};function c(e,t,i){const r=i+","+t+","+e;let n=h[r];if(!n){l.font=t;const a=l.measureText("M").width*i,o=e.split(" ");let s="";const c=[];for(let e=0,t=o.length;e<t;++e){const t=o[e];l.measureText(s+t).width<=a?s+=(s?" ":"")+t:(s&&c.push(s),s=t)}s&&c.push(s),h[r]=n=c.join("\n")}return n}const u=gl(e.layers),d={},p=[];let f;for(let i=0,r=u.length;i<r;++i){const r=u[i],n=r.id;if("string"==typeof t&&r.source==t||"object"==typeof t&&t.indexOf(r.source)>=0){const t=r["source-layer"];if(!f){f=r.source;const t=e.sources[f];if(!t)throw new Error(`Source "${f}" is not defined`);const i=t.type;if("vector"!==i&&"geojson"!==i)throw new Error(`Source "${f}" is not of type "vector" or "geojson", but "${i}"`)}let a=d[t];a||(a=d[t]=[]),a.push({layer:r,index:i}),p.push(n)}delete jl[n],delete zl[n]}const m=new il,y=new el,g={},v={},b=[];return function(e,t){const n=e.getProperties(),a=d[n.layer];if(!a)return[];let l=i.indexOf(t);-1==l&&(l=function(e,t){let i=0;const r=t.length;for(;i<r;++i)if(t[i]<e&&i+1<r){const r=t[i]/t[i+1];return i+Math.log(t[i]/e)/Math.log(r)}return r-1}(t,i));const h=El[e.getGeometry().getType()],u={properties:n,type:h};let p=-1;for(let i=0,d=a.length;i<d;++i){const d=a[i],f=d.layer,_=f.id,w=f.layout||Pl,x=f.paint||Pl;if(!("none"===w.visibility||"minzoom"in f&&l<f.minzoom||"maxzoom"in f&&l>=f.maxzoom)){const i=f.filter;if(!i||Dl(_,i,u,l)){let i,a,C,S,M,k;const T=d.index;if(3==h&&"fill"==f.type)if(a=Al(f,"paint","fill-opacity",l,u),"fill-pattern"in x){const e=Al(f,"paint","fill-pattern",l,u);if(e){const t=Fl(e,n);if(o&&r&&r[t]){(k=b[++p])&&k.getFill()&&!k.getStroke()&&!k.getText()||(k=b[p]=new al({fill:new el})),C=k.getFill(),k.setZIndex(T);const e=t+"."+a;let i=v[e];if(!i){const n=r[t],s=document.createElement("canvas");s.width=n.width,s.height=n.height;const l=s.getContext("2d");l.globalAlpha=a,l.drawImage(o,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i=l.createPattern(s,"repeat"),v[e]=i}C.setColor(i)}}}else(i=Nl(Al(f,"paint","fill-color",l,u),a))&&((k=b[++p])&&k.getFill()&&!k.getStroke()&&!k.getText()||(k=b[p]=new al({fill:new el})),(C=k.getFill()).setColor(i),k.setZIndex(T)),"fill-outline-color"in x&&(M=Nl(Al(f,"paint","fill-outline-color",l,u),a)),M&&((k=b[++p])&&k.getStroke()&&!k.getFill()&&!k.getText()||(k=b[p]=new al({stroke:new il})),(S=k.getStroke()).setLineCap(vl.layout_line["line-cap"]),S.setLineJoin(vl.layout_line["line-join"]),S.setMiterLimit(vl.layout_line["line-miter-limit"]),S.setColor(M),S.setWidth(1),S.setLineDash(null),k.setZIndex(T));if(1!=h&&"line"==f.type){i=!("line-pattern"in x)&&"line-color"in x?Nl(Al(f,"paint","line-color",l,u),Al(f,"paint","line-opacity",l,u)):void 0;const e=Al(f,"paint","line-width",l,u);i&&e>0&&((k=b[++p])&&k.getStroke()&&!k.getFill()&&!k.getText()||(k=b[p]=new al({stroke:new il})),(S=k.getStroke()).setLineCap(Al(f,"layout","line-cap",l,u)),S.setLineJoin(Al(f,"layout","line-join",l,u)),S.setMiterLimit(Al(f,"layout","line-miter-limit",l,u)),S.setColor(i),S.setWidth(e),S.setLineDash(x["line-dasharray"]?Al(f,"paint","line-dasharray",l,u).map(function(t){return t*e}):null),k.setZIndex(T))}let I,O,E,L,P=!1,R=null,j=0;if((1==h||2==h)&&"icon-image"in w){const a=Al(f,"layout","icon-image",l,u);if(a){I=Fl(a,n);let c=void 0;if(o&&r&&r[I]){const n=Al(f,"layout","icon-rotation-alignment",l,u);if(2==h){const i=e.getGeometry();if(i.getFlatMidpoint){const e=i.getExtent();if(Math.sqrt(Math.max(Math.pow((e[2]-e[0])/t,2),Math.pow((e[3]-e[1])/t,2)))>150){const e=i.getFlatMidpoint();if(c=new fo(e),"line"===Al(f,"layout","symbol-placement",l,u)&&"map"===n){const t=i.getStride(),r=i.getFlatCoordinates();for(let i=0,n=r.length-t;i<n;i+=t){const n=r[i],a=r[i+1],o=r[i+t],s=r[i+t+1],l=Math.min(n,o),h=Math.min(a,s),c=Math.max(n,o),u=Math.max(a,s);if(e[0]>=l&&e[0]<=c&&e[1]>=h&&e[1]<=u){j=Math.atan2(a-s,o-n);break}}}}}}if(2!==h||c){(k=b[++p])&&k.getImage()&&!k.getFill()&&!k.getStroke()||(k=b[p]=new al),k.setGeometry(c);const e=Al(f,"layout","icon-size",l,u),t=void 0!==x["icon-color"]?Al(f,"paint","icon-color",l,u):null;let a=I+"."+e;if(null!==t&&(a+="."+t),!(O=g[a])){const l=r[I];if(null!==t){i=Nl(t,1);const r=document.createElement("canvas");r.width=l.width,r.height=l.height;const n=r.getContext("2d");n.drawImage(o,l.x,l.y,l.width,l.height,0,0,l.width,l.height);const s=n.getImageData(0,0,r.width,r.height);for(let e=0,t=s.data.length;e<t;e+=4)s.data[e]=i[0],s.data[e+1]=i[1],s.data[e+2]=i[2];n.putImageData(s,0,0),O=g[a]=new dl({img:r,imgSize:[r.width,r.height],scale:e/l.pixelRatio})}else O=g[a]=new dl({img:o,imgSize:s,size:[l.width,l.height],offset:[l.x,l.y],rotateWithView:"map"===n,scale:e/l.pixelRatio})}O.setRotation(j+Ml(Al(f,"layout","icon-rotate",l,u))),O.setOpacity(Al(f,"paint","icon-opacity",l,u)),k.setImage(O),R=k.getText(),k.setText(void 0),k.setZIndex(99999-T),P=!0,E=!1}else E=!0}}}if(1==h&&"circle-radius"in x){(k=b[++p])&&k.getImage()&&!k.getFill()&&!k.getStroke()||(k=b[p]=new al);const e=Al(f,"paint","circle-radius",l,u),t=Al(f,"paint","circle-stroke-color",l,u),i=Al(f,"paint","circle-color",l,u),r=Al(f,"paint","circle-opacity",l,u),n=Al(f,"paint","circle-stroke-opacity",l,u),a=Al(f,"paint","circle-stroke-width",l,u);(O=g[e+"."+t+"."+i+"."+r+"."+a])||(O=new Zs({radius:e,stroke:0===a?void 0:new il({width:a,color:Nl(t,n)}),fill:new el({color:Nl(i,r)})})),k.setImage(O),R=k.getText(),k.setText(void 0),k.setGeometry(void 0),k.setZIndex(99999-T),P=!0}if("text-field"in w&&(L=Fl(Al(f,"layout","text-field",l,u).toString(),n)),L&&!E){P||((k=b[++p])&&k.getText()&&!k.getFill()&&!k.getStroke()||(k=b[p]=new al),k.setImage(void 0),k.setGeometry(void 0),k.layerId=_),k.getText()||k.setText(R||new fl),R=k.getText();const e=Al(f,"layout","text-size",l,u),t=Sl(Al(f,"layout","text-font",l,u),e),i=w["text-transform"];"uppercase"==i?L=L.toUpperCase():"lowercase"==i&&(L=L.toLowerCase());const r=2==h?L:c(L,t,Al(f,"layout","text-max-width",l,u));R.setText(r),R.setFont(t),R.setRotation(Ml(Al(f,"layout","text-rotate",l,u)));const n=Al(f,"layout","text-anchor",l,u),o=P||1==h?"point":Al(f,"layout","symbol-placement",l,u);if(R.setPlacement(o),"point"==o){let e="center";-1!==n.indexOf("left")?e="left":-1!==n.indexOf("right")&&(e="right"),R.setTextAlign(e)}else R.setTextAlign();let s="middle";0==n.indexOf("bottom")?s="bottom":0==n.indexOf("top")&&(s="top"),R.setTextBaseline(s);const d=Al(f,"layout","text-offset",l,u);R.setOffsetX(d[0]*e),R.setOffsetY(d[1]*e),a=Al(f,"paint","text-opacity",l,u),y.setColor(Nl(Al(f,"paint","text-color",l,u),a)),R.setFill(y);const g=Nl(Al(f,"paint","text-halo-color",l,u),a);g?(m.setColor(g),m.setWidth(Al(f,"paint","text-halo-width",l,u)),R.setStroke(m)):R.setStroke(void 0),k.setZIndex(99999-T)}}}}return p>-1?(b.length=p+1,b):[]}};class ql{constructor(e){this.options=Object(n.defaultValue)(e,{}),this.style=Object(n.defaultValue)(e.style,void 0),this.show=Object(n.defaultValue)(e.show,!0),this.defaultAlpha=Object(n.defaultValue)(e.defaultAlpha,1),this.tilingScheme=Object(n.defaultValue)(e.tilingScheme,new Cesium.WebMercatorTilingScheme),this.tileWidth=Object(n.defaultValue)(e.tileWidth,512),this.tileHeight=Object(n.defaultValue)(e.tileHeight,512),this.tokenKey=Object(n.defaultValue)(e.tokenKey,"token"),this.tokenValue=Object(n.defaultValue)(e.tokenValue,void 0),this.readyPromise=Object(n.defaultValue)(e.readyPromise,new Promise((e,t)=>{e()})),this.scene=Object(n.defaultValue)(e.scene,void 0),this.rectangle=Object(n.defaultValue)(e.rectangle,this.tilingScheme.rectangle),this.mvtParser=new Do,this.pixelRatio=Object(n.defaultValue)(e.pixelRatio,1),this.maximumLevel=Object(n.defaultValue)(e.maximumLevel,20),this.minimumLevel=Object(n.defaultValue)(e.minimumLevel,0),this.isStretchImage=Object(n.defaultValue)(e.isStretchImage,!1),this.transform=Object(n.defaultValue)(e.transform,[.125,0,0,.125,0,0]),this.sublayerLabelingInfos=Object(n.defaultValue)(e.sublayerLabelingInfos,{}),this.labelsRenderMode=Object(n.defaultValue)(e.labelsRenderMode,"on-screen"),this._resolutions=[78271.51696402048,39135.75848201024,19567.87924100512,9783.93962050256,4891.96981025128,2445.98490512564,1222.99245256282,611.49622628141,305.748113140705,152.8740565703525,76.43702828517625,38.21851414258813,19.109257071294063,9.554628535647032,4.777314267823516,2.388657133911758,1.194328566955879,.5971642834779395,.29858214173896974,.14929107086948487,.07464553543474244],this._replays=["Default","Image","Polygon","LineString","Text"],this._tileQueue=new Cesium.TileReplacementQueue,this._tileSends=new Gs,this._cacheSize=300,this._labelsNoteStyle=new n.LabelClass({renderMode:ql.getRenderMode(this.sublayerLabelingInfos)}),this._dynamicLabelLayer=new gr({scene:this.scene,labelingInfo:[this._labelsNoteStyle]}),this._url=void 0,this._olVectorStyle=void 0,this._setOpenLayerVectorStyle(),this._initEvents()}}Object.defineProperties(ql.prototype,{ready:{get:()=>!0},hasAlphaChannel:{get:()=>!0}}),ql.fromUrl=async function(e,t){const i=new n.IGSVectorTileLayer({url:e}),r=await i.load(),a=Hl.initializeOptions(r);return new ql({...a,...t})},ql.getRenderMode=function(e){let t="canvas";if(e){const i=Object.keys(e);for(let r=0;r<i.length;r++){const n=e[i[r]];if(Array.isArray(n)&&n.length>0){t=n[0].renderMode||"canvas";break}}}return t},ql.prototype.requestImage=function(e,t,i){if(!this._tileSends.has({x:e,y:t,z:i,id:this.options.threadId}))return this._tileSends.push({x:e,y:t,z:i,id:this.options.threadId}),this.drawTile(e,t,i);{const r=this._findTileInQueue(e,t,i,this._tileQueue);if(r)return this._tileQueue.markTileRendered(r),r.isaddedLabels||this._addDynamicLabel(r,this._dynamicLabelLayer),new Promise((e,t)=>{e(r)});this._tileSends.remove(e,t,i)}},ql.prototype.drawTile=function(e,t,i){const r=this;let n=this._url;n=n.replace("{x}",e).replace("{y}",t).replace("{z}",i);let a={xMvt:e,yMvt:t,zMvt:i};if(this._maximumLevel&&i>this._maximumLevel)return this._tileQueue.markTileRendered(a),null;let o=i;Cesium.Resource.createIfNeeded(n);return new Promise((s,l)=>{fetch(n).then(e=>e.arrayBuffer()).then(function(n){try{(a=document.createElement("canvas")).width=512,a.height=512,a.xMvt=e,a.yMvt=t,a.zMvt=o;const h=a.getContext("2d"),c=r.mvtParser.readFeatures(n),u=r._olVectorStyle,d=[0,0,4096,4096];let p=new zs(0,d,8,!0,512);const f=r.tilingScheme.tileXYToRectangle(e,t,i);if(!f)return null;const m=Cesium.Rectangle.northwest(f),y=Cesium.Rectangle.southeast(f);a.isaddedLabels=!0;for(let n=0;n<c.length;n++){const o=c[n],s=u(o,r._resolutions[i]);let l=[],h=[];"on-screen"===r.labelsRenderMode?(l=s.filter(e=>!e.text_),h=s.filter(e=>e.text_)):l=s,h.length>0&&requestAnimationFrame(()=>{const n=r._renderLabels(a,o,h,e,t,i,d,m,y),s=r._dynamicLabelLayer.addLabels(n);a.cacheLabels||(a.cacheLabels=[]),s.forEach(e=>{a.cacheLabels.push(e)}),a.isaddedLabels&&r._dynamicLabelLayer.addLabels(s)});for(let e=0;e<l.length;e++)Ns(p,o,l[e],16)}p.finish(),p.replay(h,r.transform,0,{},r._replays),r._tileQueue.count>r._cacheSize&&r._trimTiles(r._tileQueue,r._dynamicLabelLayer,r._cacheSize/2),p=null,s(a)}catch(e){console.log("err: ",e),l()}r._tileQueue.markTileRendered(a)})})},ql.prototype._initEvents=function(){this.scene&&"on-screen"===this.labelsRenderMode&&(this._changeTileHandler=(()=>{let e=this._tileQueue.tail,t=this._tileQueue.count;for(;e&&t>60;)t--,e.cacheLabels&&this._removeDynamicLabel(e,this._dynamicLabelLayer),e=e.replacementPrevious}),this.scene.postRender.addEventListener(this._changeTileHandler))},ql.prototype._removeEvents=function(){this.scene&&this._changeTileHandler&&this.scene.postRender.removeEventListener(this._changeTileHandler)},ql.prototype._renderLabels=function(e,t,i,r,a,o,s,l,h){if(!i||!e||Array.isArray(i)&&0===i.length)return[];if(!t||!t.properties_)return[];const c=t.properties_;let u=[];return i.forEach(e=>{const i=e.getText(),r=this.sublayerLabelingInfos[e.layerId]||[];let a=Object(Fs.a)(this._labelsNoteStyle,i,r.length>0?r[0]:null,c);if(t.flatCoordinates_&&Array.isArray(t.flatCoordinates_)&&2===t.flatCoordinates_.length&&a.symbol.text){const e=t.flatCoordinates_,i=s[2],r=s[3],o=(Cesium.Math.toDegrees(h.longitude)-Cesium.Math.toDegrees(l.longitude))*e[0]/i+Cesium.Math.toDegrees(l.longitude),c=(Cesium.Math.toDegrees(h.latitude)-Cesium.Math.toDegrees(l.latitude))*e[1]/r+Cesium.Math.toDegrees(l.latitude);if(e[0]>i||e[1]>r)return;const d=new n.Point({coordinates:[o,c]}),p=new n.Feature({geometry:d});(this._dynamicLabelLayer.createLabels([p],a)||[]).forEach(e=>{u.push(e)})}}),u},ql.prototype._findTileInQueue=function(e,t,i,r){let n=r.head;for(;n&&(n.xMvt!==e||n.yMvt!==t||n.zMvt!==i);)n=n.replacementNext;return n},ql.prototype._trimTiles=function(e,t,i){let r=e.tail;const n=this;for(;e.count>i&&Cesium.defined(r);){const i=r.replacementPrevious;n._removeTile(e,r),n._removeDynamicLabel(r,t),r=null,r=i}},ql.prototype._removeTile=function(e,t){const i=t.replacementPrevious,r=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=r),t===e.head?e.head=r:i.replacementNext=r,t===e.tail?e.tail=i:r.replacementPrevious=i,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count},ql.prototype._removeDynamicLabel=function(e,t){e&&t&&e.cacheLabels&&Array.isArray(e.cacheLabels)&&0!==e.cacheLabels.length&&(t.removeLabels(e.cacheLabels),e.isaddedLabels=!1)},ql.prototype._addDynamicLabel=function(e,t){e&&t&&e.cacheLabels&&Array.isArray(e.cacheLabels)&&0!==e.cacheLabels.length&&(e.cacheLabels=t.addLabels(e.cacheLabels),e.isaddedLabels=!0)},ql.prototype._setOpenLayerVectorStyle=function(){if(this.style){const e=function(e){const t=e.layers;let i,r,n,a,o,s=[];for(let l=0,h=t.length;l<h;++l)"background"==(i=t[l]).type||((a=i.source||qs(t,i.ref))!=n&&(s.length&&(s=[]),o=(r=e.sources[a]).url,"vector"==r.type||"raster"==r.type||r.type,n=a),s.push(i.id));return s}(this.style),t=function(e){const t=e.sources;let i=[];for(const e in t)if(t.hasOwnProperty(e)){const r=t[e];r.type&&"vector"==r.type&&r.tiles&&r.tiles.length>0&&i.push(r)}return i}(this.style),i=function(e){let t=e.sprite;return t.indexOf("png")>0?t:t+=".png"}(this.style),r={vectortilejson:this.style,layers:e,spritedata:this.style.spritedata,spritepng:i,fonts:$s,sources:t};this._url=t[0].tiles[0],this.tokenKey&&this.tokenValue&&(this._url+=`&${this.tokenKey}=${this.tokenValue}`),this._olVectorStyle=Bl(r.vectortilejson,Object.keys(r.vectortilejson.sources),null,r.spritedata,r.spritepng,r.fonts)}},ql.prototype.destroy=function(){this._removeEvents(),this._dynamicLabelLayer&&(this._dynamicLabelLayer.destroyed(),this._dynamicLabelLayer=null)};var Ul=ql;class Wl{}Wl.addVectorTileLayer=function(e){const{layer:t,innerView:i}=e,r=eh(t.spatialReference,t.extent,t.tileInfo),[a,o]=n.TileInfoUtil.getLevelRangeByTileInfo(t.tileInfo),s=ih(t,r.rectangle);s.spatialReference=new n.SpatialReference("EPSG:4326");const l=new Cesium.Rectangle(s.xmin,s.ymin,s.xmax,s.ymax),h=Wl._getSublayerLabelingInfos(t);return new Promise(n=>{const s=new Ul({style:t.style,opacity:t.opacity,show:e._getLayerViewVisible(t.visible),tilingScheme:r,maximumLevel:o,minimumLevel:a,scene:i.scene,labelsRenderMode:t.labelsRenderMode,sublayerLabelingInfos:h,rectangle:l,transform:[512/t.mvtExtent,0,0,512/t.mvtExtent,0,0],tokenKey:t.tokenKey,tokenValue:t.tokenValue});e.innerLayer=i.imageryLayers.addImageryProvider(s),e.innerLayer.id=t.id,t.clippingArea&&sh(t,e.innerLayer,i),n(e)})},Wl.initializeOptions=function(e,t){const{extent:i,tileInfo:r,spatialReference:a}=e,o=eh(a,i,r),s=ih({spatialReference:a,extent:i},o.rectangle),[l,h]=n.TileInfoUtil.getLevelRangeByTileInfo(r);return{style:e.style,opacity:e.opacity,show:e.visible,tilingScheme:o,minimumLevel:l,maximumLevel:h,scene:t&&t.scene?t.scene:void 0,labelsRenderMode:e.labelsRenderMode,sublayerLabelingInfos:Wl._getSublayerLabelingInfos(e),rectangle:new Cesium.Rectangle(s.xmin,s.ymin,s.xmax,s.ymax),transform:[512/e.mvtExtent,0,0,512/e.mvtExtent,0,0],tokenKey:e.tokenKey,tokenValue:e.tokenValue}},Wl.refresh=function(e){this.removeLayer(e),this.addVectorTileLayer(e)},Wl.setOpacity=function(e,t){e.innerLayer.alpha=t},Wl.setVisible=function(e,t){e.innerLayer.show=e._getLayerViewVisible(t)},Wl.setClipArea=function(e){const{layer:t,innerView:i,innerLayer:r}=e;t.clippingArea?sh(t,r,i):i._clipPreRenderFunction&&(r.swipeEnabled=!1,i.scene.preRender.removeEventListener(i._clipPreRenderFunction))},Wl.removeLayer=function(e){const{innerLayer:t,innerView:i}=e;t.imageryProvider.destroy(),i.imageryLayers.remove(t,!0)},Wl._getSublayerLabelingInfos=function(e){const t={};return e.style.layers.forEach(i=>{if(i&&i.id){const r=e.getExtendProperties(i.id,"labelingInfo");r&&r instanceof Array&&r.length>0&&(t[i.id]=r)}}),t};var Hl=Wl;class Yl{}Yl.addM3DLayer=function(e,t,i){const{layer:r,innerView:n,view:a}=e;let o=Yl.initializeOptions(e);o.show=e._getLayerViewVisible(r.visible);const{extensionOptions:s={}}=r;ah(o=Object.assign(o,s),n,a,function(e){o.autoReset&&oh(e.boundingSphere,o,n),e.translucency=o.translucency,t(e)},i)},Yl.initializeOptions=function(e){const{layer:t,innerView:i}=e,r=nh(t);return r.url=t.url,t.url.includes("/igs/rest/services/")?r.igserver=!0:r.igserver=!1,r.headers&&(r.url=new Cesium.Resource({url:r.url,headers:r.headers})),i&&(r._scene=i.scene),r},Yl.removeLayer=function(e,t,i){t.scene.primitives.removeAndDestroy(e)};var Xl=Yl;class $l{}$l.addTerrainCacheLayer=function(e,t,i){const r=$l.initializeOptions(e);t.terrainProvider=new Cesium.CesiumTerrainProvider(r),i(t.terrainProvider)},$l.initializeOptions=function(e){let t={url:e.url};const{extensionOptions:i={}}=e;return t=Object.assign(t,i)},$l.setOpacity=function(e,t){let i;1===e.opacity?(t.scene.globe.translucency.enabled=!1,(i=new Cesium.Color.clone(t.scene.globe.baseColor)).alpha=1,t.scene.globe.baseColor=i):(t.scene.globe.translucency.enabled=!0,(i=new Cesium.Color.clone(t.scene.globe.baseColor)).alpha=e.opacity,t.scene.globe.baseColor=i)},$l.removeLayer=function(e,t){t.terrainProvider=new Cesium.EllipsoidTerrainProvider};var Jl=$l;var Kl=class{constructor(e){const t=Object.assign({},e);t.extensions=[];const i=Object(n.defaultValue)(e.extensions,[]),r=Object(n.defaultValue)(e.url,"");let a;a=r instanceof Cesium.Resource?r:new Cesium.Resource({url:r}),i&&i instanceof Array&&i.forEach(e=>{e&&e.value&&(a.queryParameters[e.key]=e.value)}),t.url=a;const o=new Cesium.UrlTemplateImageryProvider(t);return o.isStretchImage=Object(n.defaultValue)(e.isStretchImage,!1),o}};class Zl{}Zl.addWebTileLayer=function(e,t){let i=e._buildRequestUrl?e._buildRequestUrl():e.url;i=i.replace("{col}","{x}");let r={x:1,y:-1};"tms"===e.tileSliceType?(i=i.replace("{row}","{y}"),r={x:1,y:1}):i=i.replace("{row}","{y}"),i=i.replace("{level}","{z}");const a=eh(e.spatialReference,e.extent,e.tileInfo,r),o=ih(e,a.rectangle),s=new Cesium.Rectangle(o.xmin,o.ymin,o.xmax,o.ymax),{extensionOptions:l={}}=e,[h,c]=n.TileInfoUtil.getLevelRangeByTileInfo(e.tileInfo);let u={url:i,tileWidth:e.tileInfo.cols,tileHeight:e.tileInfo.cols,tilingScheme:a,minimumLevel:h,maximumLevel:c,rectangle:s,subdomains:e.subDomains,extensions:[{key:e.tokenKey,value:e.tokenValue}]};u=Object.assign(u,l);const d=th(e,t),p=new Kl(u),f=t.imageryLayers.addImageryProvider(p,d);return e.clippingArea&&sh(e,f,t),f.id=e.id,f._realIndex=e._realIndex+1,f},Zl.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var Ql=Zl;function eh(e,t,i,r){let a=e.wkid,o=e.wkt,s=void 0;if(e.isWebMercator&&a!=n.CustomWKID.bd09mc&&a!=n.CustomWKID.gcj02mc&&(a=3857),!Object(n.defined)(a)&&!Object(n.defined)(o))return new Cesium.WebMercatorTilingScheme;if(n.Projection.isCustomWKID(a)){return new wr({wkid:a,tileInfo:i,rectangleSouthwest:new Cesium.Cartesian2(t.xmin,t.ymin),rectangleNortheast:new Cesium.Cartesian2(t.xmax,t.ymax),axisDirection:r})}if(Object(n.defined)(a)){const e=n.EPSG.find(e=>e.id===a);if(!Object(n.defined)(e))return n.Log.error("根据该空间参考系的wkid未匹配到wkt值"),new Cesium.WebMercatorTilingScheme;o=e.strProject}return 4326==a||4490==a||4610==a||4212==a?Object(n.defined)(i)&&!Object(n.defined)(i.lods)?s=new Cesium.GeographicTilingScheme:(Object(n.defined)(t)||(t={xmin:-180,ymin:-90,xmax:180,ymax:90}),s=new wr({wkt:o,wkid:a,proj4:Ti,tileInfo:i,numberOfLevelZeroTilesX:Object(n.defined)(i)?2:1,rectangleSouthwest:new Cesium.Cartesian2(t.xmin,t.ymin),rectangleNortheast:new Cesium.Cartesian2(t.xmax,t.ymax),axisDirection:r})):Object(n.defined)(i)&&!Object(n.defined)(i.lods)?s=new Cesium.WebMercatorTilingScheme:(Object(n.defined)(t)||(t={xmin:-20037508.342787,ymin:-20037508.342787,xmax:20037508.342787,ymax:20037508.342787}),s=new wr({wkt:o,wkid:a,proj4:Ti,tileInfo:i,rectangleSouthwest:new Cesium.Cartesian2(t.xmin,t.ymin),rectangleNortheast:new Cesium.Cartesian2(t.xmax,t.ymax),axisDirection:r})),s}function th(e,t){let i=t.imageryLayers._layers.length;for(let r=0;r<t.imageryLayers._layers.length;r++)if(t.imageryLayers._layers[r].hasOwnProperty("_realIndex")&&e._realIndex+1<t.imageryLayers._layers[r]._realIndex){i=r;break}return i}function ih(e,t){const i={...e.extent},r=e.spatialReference.wkid,a=e.spatialReference.wkt;let o=void 0;e.spatialReference.isGeographic?o=new Cesium.Rectangle(-180,-90,180,90):e.spatialReference.isWebMercator&&(o=new Cesium.Rectangle(-20037508.342787,-20037508.342787,20037508.342787,20037508.342787)),o&&(i.xmin=Cesium.Math.clamp(i.xmin,o.west,o.east),i.ymin=Cesium.Math.clamp(i.ymin,o.south,o.north),i.xmax=Cesium.Math.clamp(i.xmax,o.west,o.east),i.ymax=Cesium.Math.clamp(i.ymax,o.south,o.north));const s=n.Projection.projectPoints({originWKID:r,originDefs:a,targetWKID:4326,points:[[i.xmin,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin],[i.xmax,i.ymax]]}),[l,h,c,u]=s;l[0]=Cesium.Math.toRadians(l[0]),l[1]=Cesium.Math.toRadians(l[1]),h[0]=Cesium.Math.toRadians(h[0]),h[1]=Cesium.Math.toRadians(h[1]),c[0]=Cesium.Math.toRadians(c[0]),c[1]=Cesium.Math.toRadians(c[1]),u[0]=Cesium.Math.toRadians(u[0]),u[1]=Cesium.Math.toRadians(u[1]),i.xmin=Math.min(l[0],c[0]),i.ymin=Math.min(h[1],c[1]),i.xmax=Math.max(h[0],u[0]),i.ymax=Math.max(l[1],u[1]);const d={xmin:t.west,xmax:t.east,ymin:t.south,ymax:t.north};return i.xmin=Cesium.Math.clamp(i.xmin,d.xmin,d.xmax),i.xmax=Cesium.Math.clamp(i.xmax,d.xmin,d.xmax),i.ymin=Cesium.Math.clamp(i.ymin,d.ymin,d.ymax),i.ymax=Cesium.Math.clamp(i.ymax,d.ymin,d.ymax),i}function rh(e){if(!e)return;const t={type:e.type,field:e.field};switch(e.type){case n.RendererType.classBreak:t.classBreakInfos=[];for(let i=0;i<e.classBreakInfos.length;i++){const r=e.classBreakInfos[i],a=r.symbol;let o=n.Color.fromColor(a.color);o=o.toCesiumRGB(),t.classBreakInfos.push({minValue:r.minValue,maxValue:r.maxValue,symbol:{type:"mesh-3d",symbolLayers:[{type:"fill",material:{color:new Cesium.Color(o.red,o.green,o.blue,o.alpha)}}]}})}break;case n.RendererType.uniqueValue:t.uniqueValueInfos=[];for(let i=0;i<e.uniqueValueInfos.length;i++){const r=e.uniqueValueInfos[i],a=r.symbol;let o=n.Color.fromColor(a.color);o=o.toCesiumRGB(),t.uniqueValueInfos.push({value:r.value,symbol:{type:"mesh-3d",symbolLayers:[{type:"fill",material:{color:new Cesium.Color(o.red,o.green,o.blue,o.alpha)}}]}})}break;default:return}return t}function nh(e){let t={};return t.url=Object(n.defaultValue)(e.url,void 0),t.id=Object(n.defaultValue)(e.id,void 0),t.show=Object(n.defaultValue)(e.visible,!0),t.layerIndex=Object(n.defaultValue)(e.layerIndex,0),t.layerRenderIndex=Object(n.defaultValue)(e.layerRenderIndex,0),t.sceneIndex=t.layer&&void 0!==t.layer.sceneIndex?t.layer.sceneIndex:0,t.igserver=!0,t.renderer=rh(e.renderer),t.translucency=e.opacity,t=Object.assign(t,e.extensionOptions)}function ah(e,t,i,r,a){e=Object(n.defaultValue)(e,{}),t.scene.primitives.add(new Cesium.MapGISM3DSet(e)).readyPromise.then(function(t){t.id=e.id,t.type="m3d",r&&"function"==typeof r&&r(t)}).otherwise(function(e){a&&"function"==typeof a&&a(e)})}function oh(e,t,i){t=Object(n.defaultValue)(t,{});const r=Object(n.defaultValue)(t.duration,0),a=Object(n.defaultValue)(t.orientation,new Cesium.HeadingPitchRange(0,-.5,2.5*e.radius));i.scene.camera.flyToBoundingSphere(e,{duration:r,offset:a}),i.scene.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)}function sh(e,t,i){let r=e.clippingArea;if(r.type!==n.GeometryType.polygon&r.type!==n.GeometryType.extent&r.type!==n.GeometryType.circle)return;r.spatialReference.isGeographic||(r=n.Projection.project(r,new n.SpatialReference({wkid:4326})));let a={};switch(r.type){case n.GeometryType.polygon:a.outerRing=r.coordinates[0],a.holes=r.coordinates.splice(1,r.coordinates.length-1);break;case n.GeometryType.circle:a.outerRing=r.toPolygon().coordinates[0],a.holes=void 0;break;case n.GeometryType.extent:const{xmin:e,xmax:t,ymin:i,ymax:o}=r;a.outerRing=[[e,i],[t,i],[t,o],[e,o],[e,i]],a.holes=void 0;break;default:a=void 0}if(!a)return;t.swipeEnabled=!0;const o=[],s=a.outerRing;for(let e=0;e<s.length;e++)o.push(Cesium.Cartesian3.fromDegrees(s[e][0],s[e][1],0));let l=void 0;if(a.holes&&a.holes.length>0){l=[];for(let e=0;e<a.holes.length;e++){const t=[];for(let i=0;i<a.holes[e].length;i++)t.push(Cesium.Cartesian3.fromDegrees(a.holes[e][i][0],a.holes[e][i][1],0));l.push(new Cesium.PolygonHierarchy(t))}}const h=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(o,l)}),c=Cesium.PolygonGeometry.createGeometry(h),u=Cesium.GeometryPipeline.createAttributeLocations(c),d=Cesium.VertexArray.fromGeometry({context:i.scene.context,geometry:c,attributeLocations:u}),p=Cesium.ShaderProgram.fromCache({context:i.scene.context,vertexShaderSource:"\n attribute vec3 position;\n void main() {\n gl_Position = czm_viewProjection * vec4(position.xyz, 1.0);\n }\n ",fragmentShaderSource:"\n void main() {\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n }\n ",attributeLocations:u}),f=Cesium.RenderState.fromCache({cull:{enabled:!0,face:Cesium.CullFace.BACK}}),m=new Cesium.DrawCommand({primitiveType:Cesium.PrimitiveType.TRIANGLES,vertexArray:d,shaderProgram:p,castShadows:!1,receiveShadows:!1,uniformMap:{},renderState:f}),y=i.scene.context.drawingBufferWidth,g=i.scene.context.drawingBufferHeight,v=new Cesium.Framebuffer({context:i.scene.context,colorTextures:[new Cesium.Texture({context:i.scene.context,width:y,height:g,pixelDatatype:Cesium.PixelDatatype.UNSIGNED_BYTE,pixelFormat:Cesium.PixelFormat.RGB})],destroyAttachments:!1}),b=new Cesium.PassState(i.scene.context);b.framebuffer=v,i.scene._frameState.swipeTexture=b.framebuffer.getColorTexture(0),i.scene._frameState.swiper.type=Cesium.SwipeModeType.POLYGON,i._clipPreRenderFunction=function(){i.scene.context.uniformState.updateCamera(i.camera),new Cesium.ClearCommand({color:new Cesium.Color(0,0,0,1)}).execute(i.scene.context,b),m.execute(i.scene.context,b)},i.scene.preRender.removeEventListener(i._clipPreRenderFunction),i.scene.preRender.addEventListener(i._clipPreRenderFunction)}function lh(e,t){switch(e.type){case n.LayerType.arcgisMapImage:return jr.initializeOptions(e);case n.LayerType.igsMapImage:return dh.initializeOptions(e);case n.LayerType.wms:return zr.initializeOptions(e);case n.LayerType.arcgisTile:return Vr.initializeOptions(e);case n.LayerType.igsTile:return Br.initializeOptions(e);case n.LayerType.wmts:return Ur.initializeOptions(e);case n.LayerType.arcgisVectorTile:case n.LayerType.igsVectorTile:return Hl.initializeOptions(e,t);case n.LayerType.m3dCache:return Xl.initializeOptions({layer:e,innerView:t});case n.LayerType.terrain:return Jl.initializeOptions(e);default:n.Log.error(`暂不支持为${e.type}类型的图层构造实例化参数`)}}class hh{constructor(e){if(e=Cesium.defaultValue(e,Cesium.defaultValue.EMPTY_OBJECT),!Cesium.defined(e.url))throw new Cesium.DeveloperError("必须传入地图服务的URL");this._imageInfoUrl=e.url,this._resource=Cesium.Resource.createIfNeeded(e.url),this._tilingScheme=Cesium.defaultValue(e.tilingScheme,new Cesium.GeographicTilingScheme),this._rectangle=Cesium.defaultValue(e.rectangle,this._tilingScheme.rectangle),this._tileWidth=Cesium.defaultValue(e.tileWidth,256),this._tileHeight=Cesium.defaultValue(e.tileHeight,256),this._enablePickFeatures=Cesium.defaultValue(e.enablePickFeatures,!1),this._minimumLevel=Cesium.defaultValue(e.minimumLevel,0),this._maximumLevel=Cesium.defaultValue(e.maximumLevel,20),this._gdbpsUrl=Cesium.defaultValue(e.gdbps,[]),this._filters=Cesium.defaultValue(e.filters,""),this._layers=e.layers,this._extensions=e.extensions,this._dynamicLayers=e.dynamicLayers,this._isAntialiasing=Cesium.defaultValue(e.isAntialiasing,void 0),this._build2DImageResource=e.build2DImageResource,this._proxy=e.proxy,this._ready=!0,this._credit=Cesium.defaultValue(e.credit,new Cesium.Credit("MapGIS")),this._clientId=Cesium.defaultValue(e.clientId,Math.random().toString(36).substring(2)),this._httpMethod=Cesium.defaultValue(e.httpMethod,"GET"),this._headers=Cesium.defaultValue(e.headers,void 0)}static async fromUrl(e,t){const i=new n.IGSMapImageLayer({url:e}),r=await i.load(),a=dh.initializeOptions(r);return new hh({...a,...t})}buildImageResource(e,t,i,r){if(this._build2DImageResource&&this._build2DImageResource instanceof Function)return this._build2DImageResource(this,e,t,i,r);let n=this._resource.url;if(r.httpMethod=this._httpMethod,Cesium.defined(this._headers)?this._headers.hasOwnProperty("Content-Type")||(n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?this._headers["Content-Type"]="text/plain":this._headers["Content-Type"]="application/x-www-form-urlencoded"):n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?this._headers={"Content-Type":"text/plain"}:this._headers={"Content-Type":"application/x-www-form-urlencoded"},this._resource.headers=this._headers,"GET"===this._httpMethod){n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?n+=`?f=png&w=${this._tileWidth}&h=${this._tileHeight}&filters=${this._filters}&bbox=`:n.includes("/coverings")?n+=`?f=image&size=${this._tileWidth},${this._tileHeight}&bbox=`:n+=`/image?f=image&size=${this._tileWidth},${this._tileHeight}&layerFilters=${this._filters}&bbox=`;const r=this._tilingScheme.tileXYToNativeRectangle(e,t,i);if((n+=`${r.west},${r.south},${r.east},${r.north}`).includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?n+=`&guid=${this._clientId}`:n+=`&clientId=${this._clientId}`,Cesium.defined(this._gdbpsUrl)&&this._gdbpsUrl.length>0){n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?n+="&gdbps=":n+="&urls=";for(let e=0;e<this._gdbpsUrl.length;e++)n+=this._gdbpsUrl[e],e<this._gdbpsUrl.length-1&&(n+=",")}if(Cesium.defined(this._layers)&&(n+=`&layers=${this._layers}`),Cesium.defined(this._dynamicLayers)&&(n+=`&dynamicLayers=${this._dynamicLayers}`),Cesium.defined(this._extensions)&&this._extensions.length>0)for(let e=0;e<this._extensions.length;e++){const t=this._extensions[e];n+=`&${t.key}=${encodeURIComponent(t.value)}`}null!==this._isAntialiasing&&void 0!==this._isAntialiasing&&(n+=`&isAntialiasing=${this._isAntialiasing}`)}else if("POST"===this._httpMethod){let a={};n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?(a.f="png",a.w=this._tileWidth,a.h=this._tileHeight,a.filters=this._filters):(a.f="image",a.size=`${this._tileWidth},${this._tileHeight}`,a.layerFilters=this._filters);const o=this._tilingScheme.tileXYToNativeRectangle(e,t,i);if(a.bbox=`${o.west},${o.south},${o.east},${o.north}`,n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers"),a.clientId=this._clientId,null!==this._isAntialiasing&&void 0!==this._isAntialiasing&&(a.isAntialiasing=this._isAntialiasing),Cesium.defined(this._gdbpsUrl)&&this._gdbpsUrl.length>0){let e="";for(let t=0;t<this._gdbpsUrl.length;t++)e+=this._gdbpsUrl[t],t<this._gdbpsUrl.length-1&&(e+=",");n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?a.gdbps=e:a.urls=e}if(Cesium.defined(this._layers)&&(a.layers=this._layers),Cesium.defined(this._dynamicLayers)&&(a.dynamicLayers=this._dynamicLayers),Cesium.defined(this._extensions)&&this._extensions.length>0)for(let e=0;e<this._extensions.length;e++){const t=this._extensions[e];a[t.key]=t.value}if(n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers"))a=JSON.stringify(a);else{n+="/image";let e="";Object.keys(a).forEach(t=>{a[t]&&(e+=`${t}=${encodeURIComponent(a[t])}&`)}),e=e.substring(0,e.length-1),a=e}r.data=a}return this._resource.getDerivedResource({url:n,request:r,proxy:this._proxy})}requestImage(e,t,i,r){return Cesium.ImageryProvider.loadImage(this,this.buildImageResource(e,t,i,r))}pickFeatures(e,t,i){if(!this._enablePickFeatures)return;let r=this._imageInfoUrl.replace("{s}",(e+t)%4);t=3*Math.pow(2,i)-1-t,r=(r=(r=(r=r.replace("{s}",(e+t)%4)).replace("{row}",t)).replace("{col}",e)).replace("{level}",i);return this._resource.getDerivedResource({url:r,queryParameters:{f:"json"}}).fetchJson().then(function(e){const t=[],i=e.results;if(!Cesium.defined(i))return t;for(let e=0;e<i.length;++e){const r=i[e],n=new Cesium.ImageryLayerFeatureInfo;n.data=r,n.name=r.value,n.properties=r.attributes,n.configureDescriptionFromProperties(r.attributes),t.push(n)}return t})}}Object.defineProperties(hh.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},gdbps:{get:function(){return this._gdbpsUrl},set:function(e){e instanceof Array&&(this._gdbpsUrl=e)}},layers:{get:function(){return this._layers},set:function(e){this._layers=e}}});var ch=hh;class uh{}uh.addIGSMapImageLayer=function(e,t){const i=uh.initializeOptions(e),r=th(e,t),n=t.imageryLayers.addImageryProvider(new ch(i),r);return e.clippingArea&&sh(e,n,t),n.id=e.id,n._realIndex=e._realIndex+1,n},uh.initializeOptions=function(e){const t=n.TileInfoUtil.createCommonTileInfo({extent:e.extent,tileSize:e.imageWidth}),i=eh(e.spatialReference,e.extent,t),r=ih(e,i.rectangle),a=new Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax);let o=e._url;"1.0"===e._igsVersion&&(o=o.replace("/mrcs/","/mrms/"));let s=[];e.tokenKey&&s.push({key:e.tokenKey,value:e.tokenValue});let l={url:o,httpMethod:e.httpMethod,tileWidth:e.imageWidth,tileHeight:e.imageHeight,layers:e.layers,tilingScheme:i,clientId:e.clientId,projectionSrs:Object(n.getProjectionSrs)(e.spatialReference),rectangle:a,filters:e.getFilters?JSON.stringify(e.getFilters()):void 0,headers:e.headers,extensions:s,isAntialiasing:e.isAntialiasing};const{extensionOptions:h={}}=e;if(l=Object.assign(l,h),e.allSublayers){const t=Object(n.getIGSDynamicLayer)(e);t.length>0&&(l.dynamicLayers=JSON.stringify(t))}return l},uh.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var dh=uh;class ph{}ph.getMouseEvent=function(e,t,i){let r=null;if(t._innerView.scene.globe.depthTestAgainstTerrain&&!t._innerView.scene.globe.translucency.enabled)r=t._innerView.scene.pickPosition(e.position);else{const i=t._innerView.camera.getPickRay(e.position);r=t._innerView.scene.globe.pick(i,t._innerView.scene)}if(!r)return;const a=Cesium.Cartographic.fromCartesian(r),o=Cesium.Math.toDegrees(a.longitude),s=Cesium.Math.toDegrees(a.latitude),l={mapPoint:new n.Point({coordinates:[o,s,a.height]}),x:e.position.x,y:e.position.y,type:i};return e.originalEvent&&(l.native=e.originalEvent,l.stopPropagation=e.originalEvent.stopPropagation,l.timeStamp=e.originalEvent.timeStamp,l.button=e.originalEvent.button,l.buttons=e.originalEvent.buttons),l},ph.getKeyEvent=function(e,t,i){const r={key:e.key,stopPropagation:e.stopPropagation,timeStamp:e.timeStamp,native:e,type:i};return"key-down"===i&&(r.repeat=e.repeat),r},ph.getViewChangeEvent=function(e,t,i){const r={event:e,target:t,type:i};return r.mapView=t,r.scale=t._scale,r.zoom=t._zoom,r.center=t.center,r.extent=t._extent,r},ph.getDragEvent=function(e,t,i,r,n){return e.originalEvent?{x:e.originalEvent.layerX,y:e.originalEvent.layerY,button:void 0!==n?n:e.originalEvent.button,buttons:e.originalEvent.buttons,cancelable:e.originalEvent.cancelable,origin:i,stopPropagation:e.originalEvent.stopPropagation,timeStamp:e.originalEvent.timeStamp,native:e.originalEvent,action:r,type:"drag"}:{origin:i,action:r,type:"drag"}},ph.getResizeEvent=function(e,t,i,r){return e};var fh=ph;class mh{}mh.addCesium3DTilesLayer=function(e,t,i){const{layer:r,innerView:n}=e,{extensionOptions:a={},opacity:o,visible:s}=r,l={};r.tokenKey&&r.tokenValue&&(l[r.tokenKey]=r.tokenValue);let h={show:e._getLayerViewVisible(s),url:new Cesium.Resource({url:r._paramUrl,headers:r.headers,queryParameters:l})};h=Object.assign(h,a),n.scene.primitives.add(new Cesium.Cesium3DTileset(h)).readyPromise.then(function(e){e.id=r.id,e.style=new Cesium.Cesium3DTileStyle({color:`rgba(255, 255, 255, ${o})`}),a.autoReset&&oh(e.boundingSphere,h,n),t(e)}).otherwise(i)},mh.removeLayer=function(e,t){t.scene.primitives.removeAndDestroy(e)};var yh=mh;const gh=window.mapv||{},vh=gh.baiduMapLayer?gh.baiduMapLayer.__proto__:Function;class bh extends vh{constructor(e,t,i,r){if(super(e,t,i),!vh)return;this.map=e,this.scene=e.scene,this.dataSet=t;i=i||{},this.init(i),this.argCheck(i),this.initDevicePixelRatio(),this.canvasLayer=r,this.stopAniamation=!1,this.animation=i.animation,this.clickEvent=this.clickEvent.bind(this),this.mousemoveEvent=this.mousemoveEvent.bind(this),this.bindEvent()}initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1}clickEvent(e){const t=e.point;super.clickEvent(t,e)}mousemoveEvent(e){const t=e.point;super.mousemoveEvent(t,e)}addAnimatorEvent(){}animatorMovestartEvent(){const e=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=e.stepsRange.start)}animatorMoveendEvent(){this.isEnabledTime()&&this.animator}bindEvent(){this.map;this.options.methods&&(this.options.methods.click,this.options.methods.mousemove)}unbindEvent(){const e=this.map;this.options.methods&&(this.options.methods.click&&e.off("click",this.clickEvent),this.options.methods.mousemove&&e.off("mousemove",this.mousemoveEvent))}getContext(){return this.canvasLayer.canvas.getContext(this.context)}init(e){const t=this;t.options=e,this.initDataRange(e),this.context=t.options.context||"2d",t.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(t.options.zIndex),this.initAnimator()}_canvasUpdate(e){this.map;const t=this.scene;if(!this.canvasLayer||this.stopAniamation)return;const i=this,r=i.options.animation,n=i.getContext();if(i.isEnabledTime()){if(void 0===e)return void this.clear(n);"2d"===this.context&&(n.save(),n.globalCompositeOperation="destination-out",n.fillStyle="rgba(0, 0, 0, .1)",n.fillRect(0,0,n.canvas.width,n.canvas.height),n.restore())}else this.clear(n);if("2d"===this.context)for(const e in i.options)n[e]=i.options[e];else n.clear(n.COLOR_BUFFER_BIT);const a={transferCoordinate(e){const t=Cesium.Cartesian3.fromDegrees(e[0],e[1]);var r=i.map.camera.position;let n=i.map.scene.globe.ellipsoid.cartesianToCartographic(r).height;if(n+=1.2*i.map.scene.globe.ellipsoid.maximumRadius,Cesium.Cartesian3.distance(r,t)>n)return;r=Cesium.Cartesian3.fromDegrees(e[0],e[1]);const a=Cesium.SceneTransforms.wgs84ToWindowCoordinates(i.map.scene,r);return a?[a.x,a.y]:[0,0]}};void 0!==e&&(a.filter=function(t){const i=r.trails||10;return!!(e&&t.time>e-i&&t.time<e)});const o=i.dataSet.get(a);this.processData(o),"m"==i.options.unit&&i.options.size,i.options._size=i.options.size;let s=Cesium.SceneTransforms.wgs84ToWindowCoordinates(t,Cesium.Cartesian3.fromDegrees(0,0));s||(s=[0,0]),this.drawContext(n,new gh.DataSet(o),i.options,s),i.options.updateCallback&&i.options.updateCallback(e)}updateData(e,t){let i=e;i&&i.get&&(i=i.get()),void 0!=i&&this.dataSet.set(i),super.update({options:t})}addData(e,t){let i=e;e&&e.get&&(i=e.get()),this.dataSet.add(i),this.update({options:t})}getData(){return this.dataSet}removeData(e){if(!this.dataSet)return;const t=this.dataSet.get({filter:t=>null==e||"function"!=typeof e||!e(t)});this.dataSet.set(t),this.stopAniamation=!0}clearData(){this.dataSet&&this.dataSet.clear(),this.stopAniamation=!0}draw(){this.canvasLayer.draw()}clear(e){e&&e.clearRect&&e.clearRect(0,0,e.canvas.width,e.canvas.height)}}let _h=0;class wh{constructor(e,t,i,r){this.map=e,this.scene=e.scene,this.mapvBaseLayer=new bh(e,t,i,this),this.mapVOptions=i,this.initDevicePixelRatio(),this.canvas=this._creteWidgetCanvas(),this.render=this.render.bind(this),this.handler=void 0,this.postRenderTime=0;const n=i.cesium;if(n&&(this.postRender=n.postRender||!1,this.postRenderFrame=n.postRenderFrame||30),void 0!=r)this.container=r,r.appendChild(this.canvas);else{const t=document.getElementsByClassName("cesium-widget"),i=t.length>0?t[0]:e.container;this.container=i,this.addInnerContainer()}this.bindEvent(),this._reset()}initDevicePixelRatio(){this.devicePixelRatio=1}addInnerContainer(){this.container.appendChild(this.canvas)}bindEvent(){const e=this.map;if(this.innerMoveStart=this.moveStartEvent.bind(this),this.innerMoveEnd=this.moveEndEvent.bind(this),this.innnerZoomStart=this.zoomStartEvent.bind(this),this.innnerZoomEnd=this.zoomEndEvent.bind(this),this.postEventHandle=this.postEvent.bind(this),this.postStartEvent=this.postStartEvent.bind(this),this.postEndEvent=this.postEndEvent.bind(this),this.postRender)this.scene.camera.moveStart.addEventListener(this.postStartEvent,this),this.scene.camera.moveEnd.addEventListener(this.postEndEvent,this);else{const t=new Cesium.ScreenSpaceEventHandler(this.scene.canvas);t.setInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.WHEEL),t.setInputAction(this.innerMoveStart,Cesium.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.LEFT_UP),t.setInputAction(this.innerMoveStart,Cesium.ScreenSpaceEventType.RIGHT_DOWN),t.setInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.RIGHT_UP),e.scene.camera.moveEnd.addEventListener(this.innerMoveEnd,this),this.handler=t}}unbindEvent(){const e=this.map;if(this.postRender)this.scene.camera.moveStart.removeEventListener(this.postStartEvent,this),this.scene.camera.moveEnd.removeEventListener(this.postEndEvent,this);else{const t=this.handler;t&&(t.removeInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.WHEEL),t.removeInputAction(this.innerMoveStart,Cesium.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(this.innerMoveStart,Cesium.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.RIGHT_UP),t.destroy()),e.scene.camera.moveEnd.removeEventListener(this.innerMoveEnd,this)}}postStartEvent(){this.mapvBaseLayer&&(this.mapvBaseLayer.animatorMovestartEvent(),this.scene.postRender.addEventListener(this._reset,this)),this._visiable()}postEndEvent(){this.mapvBaseLayer&&(this.mapvBaseLayer.animatorMoveendEvent(),this.scene.postRender.removeEventListener(this._reset,this)),this._reset(),this._visiable()}moveStartEvent(){this.mapvBaseLayer&&this.mapvBaseLayer.animatorMovestartEvent(),this._unvisiable()}moveEndEvent(){this.mapvBaseLayer&&this.mapvBaseLayer.animatorMoveendEvent(),this._reset(),this._visiable()}zoomStartEvent(){this._unvisiable()}zoomEndEvent(){this._unvisiable()}postEvent(){this.postRenderTime++,this.postRenderTime%this.postRenderFrame==0&&this.moveEndEvent()}addData(e,t){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer.addData(e,t)}updateData(e,t){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer.updateData(e,t)}getData(){return this.mapvBaseLayer&&(this.dataSet=this.mapvBaseLayer.getData()),this.dataSet}removeData(e){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer&&this.mapvBaseLayer.removeData(e)}removeAllData(){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer.clearData()}_visiable(){return this.canvas.style.display="block",this}_unvisiable(){return this.canvas.style.display="none",this}setOpacity(e){return this.canvas.style.opacity=e,this}_createCanvas(){const e=document.createElement("canvas");e.id=this.mapVOptions.layerid||`mapv${_h++}`,e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",e.style.zIndex=this.mapVOptions.zIndex||100,e.width=parseInt(this.map.canvas.width)||parseInt(this.map.container.offsetWidth),e.height=parseInt(this.map.canvas.height)||parseInt(this.map.container.offsetHeight),e.style.width=`${parseInt(this.map.container.offsetWidth)}px`,e.style.height=`${parseInt(this.map.container.offsetHeight)}px`;const t=this.devicePixelRatio;return"2d"==this.mapVOptions.context&&e.getContext(this.mapVOptions.context).scale(t,t),e}_creteWidgetCanvas(){const e=document.createElement("canvas");e.id=this.mapVOptions.layerid||`mapv${_h++}`,e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",e.style.zIndex=this.mapVOptions.zIndex||100,e.width=parseInt(this.map.canvas.width)||parseInt(this.map.container.offsetWidth),e.height=parseInt(this.map.canvas.height)||parseInt(this.map.container.offsetHeight),e.style.width=`${parseInt(this.map.container.offsetWidth)}px`,e.style.height=`${parseInt(this.map.container.offsetHeight)}px`;const t=this.devicePixelRatio;return"2d"==this.mapVOptions.context&&e.getContext("2d").scale(t,t),e}_reset(){this.resizeCanvas(),this.fixPosition(),this.onResize(),this.render()}draw(){this._reset()}show(){this._visiable()}hide(){this._unvisiable()}destroy(){this.remove()}remove(){if(void 0==this.mapvBaseLayer)return;this.unbindEvent(),this.removeAllData(),this.mapvBaseLayer.clear(this.mapvBaseLayer.getContext()),this.mapvBaseLayer=void 0,this.canvas.parentElement.removeChild(this.canvas)}update(e){void 0!=e&&this.updateData(e.data,e.options)}resizeCanvas(){if(void 0==this.canvas||null==this.canvas)return;const e=this.canvas;e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.width=parseInt(this.map.canvas.width)||parseInt(this.map.container.offsetWidth)*this.devicePixelRatio,e.height=parseInt(this.map.canvas.height)||parseInt(this.map.container.offsetHeight)*this.devicePixelRatio,e.style.width=`${parseInt(this.map.container.offsetWidth)}px`,e.style.height=`${parseInt(this.map.container.offsetHeight)}px`;const t=this.devicePixelRatio;"2d"==this.mapVOptions.context&&e.getContext("2d").scale(t,t)}fixPosition(){}onResize(){}render(){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer._canvasUpdate()}}class xh{}xh.addMapVLayer=function(e,t){const{extensionOptions:i={}}=e,r=Object.assign(e.mapVOptions,i),n=new wh(t,e.data,r);return n.id=e.id,n},xh.removeLayer=function(e){e.remove()};var Ch=xh;var Sh=class{constructor(e){e=Cesium.defaultValue(e,{}),this.commonLayerId=Cesium.defaultValue(e.layerId,null),this._feature=e.feature,this._feature||n.Log.error("feature不能为空!"),this._feature=n.Feature.fromJSON(this._feature.toJSON()),this._addZCoordinate(),this.checkSymbol()&&(this.id=Cesium.defaultValue(this._feature.id,Cesium.createGuid()),this.show=Cesium.defaultValue(this._feature.visible,!0),this._layerOpacity=Cesium.defaultValue(e.layerOpacity,1),this._primitivesCollection=Cesium.defaultValue(e.primitivesCollection,void 0),this._pointsCollection=Cesium.defaultValue(e.pointsCollection,void 0),this._billboardsCollection=Cesium.defaultValue(e.billboardsCollection,void 0),this._labelsCollection=Cesium.defaultValue(e.labelsCollection,void 0),this._points=[],this._billboards=[],this._labels=[],this._primitives=[],this._canvas=void 0,this._symbol=this._feature.symbol,this._elevationInfo=this._feature.elevationInfo,this._viewer=Cesium.defaultValue(e.viewer,void 0),this._createPrimitive())}update(e){this._feature=e,this._addZCoordinate(),this._feature&&(this.show=this._feature.visible),this._markRemovePrimitives(),this._createPrimitive(()=>{this._removeMarkPrimitives(!0)})}destroy(){this._removePrimitives(),this.id=void 0,this.show=void 0,this._layerOpacity=void 0,this._feature=void 0,this._canvas=void 0,this._symbol=void 0,this._points=[],this._billboards=[],this._labels=[],this._primitives=[],this._primitivesCollection=void 0,this._pointsCollection=void 0,this._billboardsCollection=void 0,this._labelsCollection=void 0}checkSymbol(){return!0}setVisible(e){if(this._points&&this._points.length>0)for(let t=0;t<this._points.length;t++)this._points[t].show=e;if(this._labels&&this._labels.length>0)for(let t=0;t<this._labels.length;t++)this._labels[t].show=e;if(this._billboards&&this._billboards.length>0)for(let t=0;t<this._billboards.length;t++)this._billboards[t].show=e;if(this._primitives&&this._primitives.length>0)for(let t=0;t<this._primitives.length;t++)this._primitives[t].show=e}_getCesiumColor(e){return new Cesium.Color(e.red/255,e.green/255,e.blue/255,e.alpha)}_getCesiumColorByOpacity(e,t){return"number"!=typeof t&&(t=1),new Cesium.Color(e.red/255,e.green/255,e.blue/255,e.alpha*t)}_createAppearance(){}_createPrimitive(){}_getPositions(){const e=this._feature.geometry,t=[];switch(e.type){case n.GeometryType.point:t.push(Cesium.Cartographic.fromDegrees(e.coordinates[0],e.coordinates[1],e.coordinates[2]||0));break;case n.GeometryType.multiPoint:case n.GeometryType.lineString:for(let i=0;i<e.coordinates.length;i++)t.push(Cesium.Cartographic.fromDegrees(e.coordinates[i][0],e.coordinates[i][1],e.coordinates[i][2]||0));break;case n.GeometryType.multiLineString:case n.GeometryType.polygon:for(let i=0;i<e.coordinates.length;i++){t.push([]);for(let r=0;r<e.coordinates[i].length;r++)t[i].push(Cesium.Cartographic.fromDegrees(e.coordinates[i][r][0],e.coordinates[i][r][1],e.coordinates[i][r][2]||0))}break;case n.GeometryType.multiPolygon:for(let i=0;i<e.coordinates.length;i++){t.push([]);for(let r=0;r<e.coordinates[i].length;r++){t[i].push([]);for(let n=0;n<e.coordinates[i][r].length;n++)t[i][r].push(Cesium.Cartographic.fromDegrees(e.coordinates[i][r][n][0],e.coordinates[i][r][n][1],e.coordinates[i][r][n][2]))}}break;case n.GeometryType.extent:t.push([]),t[0].push(Cesium.Cartographic.fromDegrees(e.xmin,e.ymin,e.zmin||0)),t[0].push(Cesium.Cartographic.fromDegrees(e.xmax,e.ymin,e.zmin||0)),t[0].push(Cesium.Cartographic.fromDegrees(e.xmax,e.ymax,e.zmin||0)),t[0].push(Cesium.Cartographic.fromDegrees(e.xmin,e.ymax,e.zmin||0)),t[0].push(Cesium.Cartographic.fromDegrees(e.xmin,e.ymin,e.zmin||0));break;case n.GeometryType.circle:const i=e.toPolygon();for(let e=0;e<i.coordinates.length;e++){t.push([]);for(let r=0;r<i.coordinates[e].length;r++)t[e].push(Cesium.Cartographic.fromDegrees(i.coordinates[e][r][0],i.coordinates[e][r][1],i.coordinates[e][r][2]))}}return 0===t.length&&n.Log.error("顶点数组为空,无法正常创建图形!"),t}_addZCoordinate(){const e=this._feature.geometry;if(!e.hasZ)switch(e.type){case n.GeometryType.point:e.coordinates.push(0);break;case n.GeometryType.multiPoint:case n.GeometryType.lineString:for(let t=0;t<e.coordinates.length;t++)e.coordinates[t].push(0);break;case n.GeometryType.multiLineString:case n.GeometryType.polygon:for(let t=0;t<e.coordinates.length;t++)for(let i=0;i<e.coordinates[t].length;i++)e.coordinates[t][i].push(0);break;case n.GeometryType.multiPolygon:for(let t=0;t<e.coordinates.length;t++)for(let i=0;i<e.coordinates[t].length;i++)for(let r=0;r<e.coordinates[t][i].length;r++)e.coordinates[t][i][r].push(0);break;case n.GeometryType.extent:e.zmin=0,e.zmax=0;break;case n.GeometryType.circle:e.center.push(0)}}_removePrimitives(){for(let e=0;this._points&&e<this._points.length;e++)this._pointsCollection.remove(this._points[e]);this._points=[];for(let e=0;this._billboards&&e<this._billboards.length;e++)this._billboardsCollection.remove(this._billboards[e]);this._billboards=[];for(let e=0;this._labels&&e<this._labels.length;e++)this._labelsCollection.remove(this._labels[e]);this._labels=[];for(let e=0;this._primitives&&e<this._primitives.length;e++)this._primitivesCollection.remove(this._primitives[e]);this._primitives=[]}_removeMarkPrimitives(){const e=[];for(let t=0;this._points&&t<this._points.length;t++)this._points[t]._isRemove?this._pointsCollection.remove(this._points[t]):e.push(this._points[t]);this._points=e;const t=[];for(let e=0;this._billboards&&e<this._billboards.length;e++)this._billboards[e]._isRemove?this._billboardsCollection.remove(this._billboards[e]):t.push(this._billboards[e]);this._billboards=t;const i=[];for(let e=0;this._labels&&e<this._labels.length;e++)this._labels[e]._isRemove?this._labelsCollection.remove(this._labels[e]):i.push(this._labels[e]);this._labels=i;const r=[];for(let e=0;this._primitives&&e<this._primitives.length;e++)this._primitives[e]._isRemove?this._primitivesCollection.remove(this._primitives[e]):r.push(this._primitives[e]);this._primitives=r}_markRemovePrimitives(){this._points.forEach(e=>{e._isRemove=!0}),this._billboards.forEach(e=>{e._isRemove=!0}),this._labels.forEach(e=>{e._isRemove=!0}),this._primitives.forEach(e=>{e._isRemove=!0})}_saveBillboard(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._billboards.push(e)}_savePoint(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._points.push(e)}_saveLabel(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._labels.push(e)}};var Mh=class extends Sh{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.SimpleMarkerSymbol||(n.Log.info("要素的符号类型不是SimpleMarkerSymbol!"),!1)}_createPrimitive(e){if(this._feature.symbol.style)switch(this._feature.symbol.style){case"circle":this._addPointPrimitive(e);break;default:this._addBillBoardPrimitive(e)}}_getPositions(){return Lh(this._feature)}_symbolEquals(e,t){let i=!0;return e.size===t.size&&e.style===t.style&&e.outline.width===t.outline.width&&e.outline.color.red===t.outline.color.red&&e.outline.color.green===t.outline.color.green&&e.outline.color.blue===t.outline.color.blue&&e.outline.color.alpha===t.outline.color.alpha||(i=!1),("circle"===e.style&&"circle"!==t.style||"circle"!==e.style&&"circle"===t.style)&&(this._primitiveCollection=void 0),i}_addBillBoardPrimitive(e){const t=this._feature.symbol;this._canvas?this._symbolEquals(t,this._symbol)||(this._canvas=Object(n.createSimpleMarkerSymbolCanvas)(t),this._symbol=t):this._canvas=Object(n.createSimpleMarkerSymbolCanvas)(t);const{type:i}=this._feature.geometry,r=this._getPositions();switch(i){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:Nh(this,r[0],e);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:for(let t=0;t<r.length;t++)Nh(this,r[t],e)}}_createBillboardOptions(e,t){return(t=Object(n.defaultValue)(t,{})).graphic=this,Pi.a.createBillboardOptions(e,t)}_addPointPrimitive(e){const t=this._getPositions(),{type:i}=this._feature.geometry;switch(i){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:Dh(this,t[0],e);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:for(let i=0;i<t.length;i++)Dh(this,t[i],e);break;default:n.Log.error("要素的几何类型是不支持的类型!")}}_createPointOptions(e){const t=this._feature.symbol,i=this._getCesiumColor(t.color);i.alpha*=this._layerOpacity;const r=this._getCesiumColor(t.outline.color);r.alpha*=this._layerOpacity;const n=t.extensionOptions;let a={position:e,color:i,outlineColor:r,outlineWidth:t.outline.width,pixelSize:t.size};return a=Object.assign(a,n)}};var kh=class extends Sh{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.PictureMarkerSymbol||(n.Log.info("要素的符号类型不是PictureMarkerSymbol!"),!1)}_getPositions(){return Lh(this._feature,this._viewer)}_createPrimitive(e){const{type:t}=this._feature.geometry,i=this._getPositions();switch(t){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:Nh(this,i[0],e);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:for(let t=0;t<i.length;t++)Nh(this,i[t],e)}}_createBillboardOptions(e,t){return(t=Object(n.defaultValue)(t,{})).graphic=this,Pi.a.createBillboardOptions(e,t)}};function Th(e,t){let i=0;return i=isNaN(e)?t:isNaN(t)?e:e>=t?e:t}function Ih(e,t,i,r){const a=[];for(let e=0;e<t.length;e++)a.push(Cesium.Cartographic.clone(t[0]));Cesium.sampleTerrain(e.terrainProvider,12,a).then(function(e){if(i.mode===n.ElevationMode.RelativeToGround)for(let t=0;t<e.length;t++)e[t].height+=i.offset;r(e)})}function Oh(e,t,i,r,a){const{mode:o,offset:s}=r,l=[];for(let e=0;e<t.length;e++)l.push(Cesium.Cartographic.clone(t[0]));Ih(e,t,r,function(t){e.scene.sampleHeightMostDetailed(l,i,1).then(e=>{const i=[];for(let r=0;r<e.length;r++){const n=e[r]?e[r]:t[r];n.height=Th(e[r].height,t[r].height),i.push(n)}if(o===n.ElevationMode.RelativeToScene)for(let e=0;e<i.length;e++)i[e].height+=s;a(i)})})}function Eh(e){let t=[];const i=e.scene.primitives._primitives;for(let e=0;e<i.length;e++)Cesium.MapGISM3DSet&&i[e]instanceof Cesium.MapGISM3DSet||i[e]instanceof Cesium.Cesium3DTileset||i[e]instanceof Cesium.Model||i[e]instanceof Cesium.ViewportQuad||(i[e]instanceof Cesium.PrimitiveCollection?t=t.concat(i[e]._primitives):i[e]instanceof Cesium.PointPrimitiveCollection?t=t.concat(i[e]._pointPrimitives):t.push(i[e]));return t}function Lh(e){const t=e.geometry,i=[];switch(t.type){case n.GeometryType.point:i.push(new Cesium.Cartographic(Cesium.Math.toRadians(t.coordinates[0]),Cesium.Math.toRadians(t.coordinates[1]),t.coordinates[2]||0));break;case n.GeometryType.multiPoint:for(let e=0;e<t.coordinates.length;e++)i.push(new Cesium.Cartographic(Cesium.Math.toRadians(t.coordinates[e][0]),Cesium.Math.toRadians(t.coordinates[e][1]),t.coordinates[e][2]||0));break;case n.GeometryType.polygon:const e=n.Geometry.fromJSON(t).centroid;i.push(new Cesium.Cartographic(Cesium.Math.toRadians(e.coordinates[0]),Cesium.Math.toRadians(e.coordinates[1]),e.coordinates[2]||0));break;case n.GeometryType.multiPolygon:const r=n.Geometry.fromJSON(t).toPolygonArray();for(let e=0;e<r.length;e++){const t=r[e].centroid;i.push(new Cesium.Cartographic(Cesium.Math.toRadians(t.coordinates[0]),Cesium.Math.toRadians(t.coordinates[1]),t.coordinates[2]||0))}break;case n.GeometryType.extent:i.push(new Cesium.Cartographic(Cesium.Math.toRadians((t.xmin+t.xmax)/2),Cesium.Math.toRadians((t.ymin+t.ymax)/2),(t.zmin+t.zmax)/2||0));break;case n.GeometryType.circle:i.push(new Cesium.Cartographic(Cesium.Math.toRadians(t.center[0]),Cesium.Math.toRadians(t.center[1]),t.center[2]||0))}return i}function Ph(e){let t=void 0;switch(e){case n.ElevationMode.OnTheGround:t=Cesium.ClassificationType.TERRAIN;break;case n.ElevationMode.OnTheScene:t=Cesium.ClassificationType.BOTH}return t}function Rh(e,t){let i=void 0;switch(t){case"dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:32});break;case"dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:32,maskIndexFactor:2,maskTestFactor:1.5});break;case"dot":i=Cesium.Material.fromType("PolylineDash",{color:e,gapColor:new Cesium.Color(0,0,0,0),dashPattern:240});break;case"long-dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:64});break;case"long-dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:64,maskIndexFactor:2,maskTestFactor:1.5});break;case"long-dash-dot-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:64,maskIndexFactor:2});break;case"short-dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:16});break;case"short-dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:32,maskIndexFactor:2,maskTestFactor:1.5});break;case"short-dash-dot-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:32,maskIndexFactor:2});break;default:i=Cesium.Material.fromType("Color",{color:e})}return i}function jh(e,t){return"number"!=typeof t&&(t=1),new Cesium.Color(e.red/255,e.green/255,e.blue/255,e.alpha*t)}function Ah(e,t){const i=e._viewer,r=e._feature;let a,o=Cesium.HeightReference.NONE;return r.elevationInfo.mode===n.ElevationMode.OnTheGround&&(o=Cesium.HeightReference.CLAMP_TO_GROUND),r.elevationInfo.mode===n.ElevationMode.RelativeToGround&&(t[2]=e._feature.elevationInfo.offset,o=Cesium.HeightReference.RELATIVE_TO_GROUND),r.elevationInfo.mode===n.ElevationMode.OnTheScene&&(a=i.scene.sampleHeight(new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1]),0)),t[2]=a),r.elevationInfo.mode===n.ElevationMode.RelativeToScene&&(a=i.scene.sampleHeight(new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1]),0)),t[2]=a+r.elevationInfo.offset),r.elevationInfo.mode===n.ElevationMode.AbsoluteHeight&&(t[2]+=e._feature.elevationInfo.offset),{heightReference:o,position:Pi.a.toCartesian3Position(t,"degrees")}}function zh(e,t,i){const r=e._viewer,a=e._feature,{mode:o}=a.elevationInfo;switch(o){case n.ElevationMode.OnTheGround:case n.ElevationMode.RelativeToGround:Ih(r,t,a.elevationInfo,function(e){i(e)});break;case n.ElevationMode.OnTheScene:case n.ElevationMode.RelativeToScene:Oh(r,t,Eh(r),a.elevationInfo,function(e){i(e)})}}function Dh(e,t,i){const r=e._feature,{mode:a}=r.elevationInfo;switch(a){case n.ElevationMode.AbsoluteHeight:default:const r=e._pointsCollection.add(e._createPointOptions(Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,t.height)));e._savePoint(r),i&&i instanceof Function&&i();break;case n.ElevationMode.OnTheGround:case n.ElevationMode.RelativeToGround:case n.ElevationMode.OnTheScene:case n.ElevationMode.RelativeToScene:zh(e,[t],function(t){const r=e._pointsCollection.add(e._createPointOptions(Cesium.Cartesian3.fromRadians(t[0].longitude,t[0].latitude,t[0].height)));e._savePoint(r),i&&i instanceof Function&&i()})}}function Vh(e,t,i){const r=e._feature.symbol;let n=e._createBillboardOptions(Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,t.height),i);n=Object.assign(n,r.extensionOptions);const a=e._billboardsCollection.add(n);e._saveBillboard(a)}function Nh(e,t,i){const r=e._viewer,a=e._feature,{mode:o}=a.elevationInfo;switch(o){case n.ElevationMode.AbsoluteHeight:default:Vh(e,t),i&&i instanceof Function&&i();break;case n.ElevationMode.OnTheGround:case n.ElevationMode.RelativeToGround:r.scene.globe.depthTestAgainstTerrain?(Vh(e,t,{heightReference:o===n.ElevationMode.OnTheGround?Cesium.HeightReference.CLAMP_TO_GROUND:Cesium.HeightReference.RELATIVE_TO_GROUND}),i&&i instanceof Function&&i()):zh(e,[t],function(t){Vh(e,t[0]),i&&i instanceof Function&&i()});break;case n.ElevationMode.OnTheScene:case n.ElevationMode.RelativeToScene:zh(e,[t],function(t){Vh(e,t[0]),i&&i instanceof Function&&i()})}}function Gh(e){let t=!1;return e.elevationInfo.mode!==n.ElevationMode.OnTheGround&&e.elevationInfo.mode!==n.ElevationMode.OnTheScene&&e.elevationInfo.mode!==n.ElevationMode.RelativeToGround&&e.elevationInfo.mode!==n.ElevationMode.RelativeToScene||(t=!0),t}function Fh(e,t,i,r){let a,o;switch(t){case n.SymbolType.pictureMarker:return a=e.resource,o=new n.PictureMarkerSymbol({width:e.size,height:e.size,url:a.href}),new n.Feature({geometry:new n.Point({coordinates:[Cesium.Math.toDegrees(i.longitude),Cesium.Math.toDegrees(i.latitude),i.height]}),symbol:o,elevationInfo:r.elevationInfo.clone()});case n.SymbolType.simpleMarker:default:return a=e.resource,o=new n.SimpleMarkerSymbol({style:a.primitive,size:e.size,color:e.material.color,outline:new n.SimpleLineSymbol({color:e.outline.color,width:e.outline.size})}),new n.Feature({geometry:new n.Point({coordinates:[Cesium.Math.toDegrees(i.longitude),Cesium.Math.toDegrees(i.latitude),i.height]}),symbol:o,elevationInfo:r.elevationInfo.clone()});case n.SymbolType.mapgisText:const s=n.Font.fromJSON(e.font);return s.size=e.size,o=new n.MapGISTextSymbol({text:e.text,verticalAlignment:e.verticalAlignment,horizontalAlignment:e.horizontalAlignment,font:s,haloColor:e.halo.color,haloSize:e.halo.size,backgroundColor:e.background,lineHeight:e.lineHeight,color:e.material.color}),new n.Feature({geometry:new n.Point({coordinates:[Cesium.Math.toDegrees(i.longitude),Cesium.Math.toDegrees(i.latitude),i.height]}),symbol:o,elevationInfo:r.elevationInfo.clone()})}}var Bh=class extends Sh{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.SimpleLineSymbol||(n.Log.info("要素的符号类型不是SimpleLineSymbol!"),!1)}_createPrimitive(e){const t=this._feature.geometry;switch(t.type){case n.GeometryType.lineString:this._addPrimitiveByElevationMode(this._getPositions(),new n.LineString({coordinates:t.coordinates}),e);break;case n.GeometryType.multiLineString:const i=this._getPositions();for(let r=0;r<i.length;r++)this._addPrimitiveByElevationMode(i[r],new n.LineString({coordinates:t.coordinates[r]}),e)}}_addPrimitiveByElevationMode(e,t,i){const{mode:r}=this._elevationInfo;switch(r){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.OnTheScene:case n.ElevationMode.OnTheGround:default:this._addLinePrimitive(e),i&&i instanceof Function&&i();break;case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:const a=n.GeometryEngine.getCenterOID(t),o=[Cesium.Cartographic.fromDegrees(a.coordinates[0],a.coordinates[1],0)];if(r===n.ElevationMode.RelativeToGround)Ih(this._viewer,o,this._elevationInfo,t=>{this._addLinePrimitive(e,t[0].height),i&&i instanceof Function&&i()});else{const t=Eh(this._viewer);Oh(this._viewer,o,t,this._elevationInfo,t=>{this._addLinePrimitive(e,t[0].height),i&&i instanceof Function&&i()})}}}_addLinePrimitive(e,t){const i=this._feature.symbol,r=this._getCesiumColor(i.color);r.alpha*=this._layerOpacity;const a=i.width;let o;const s=[],{mode:l}=this._elevationInfo;switch(l){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:default:for(let t=0;t<e.length;t++)s.push(Cesium.Cartesian3.fromRadians(e[t].longitude,e[t].latitude,e[t].height));break;case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:let i=0;for(let t=0;t<e.length;t++)e[t].height<i&&(i=e[t].height);for(let r=0;r<e.length;r++)s.push(Cesium.Cartesian3.fromRadians(e[r].longitude,e[r].latitude,e[r].height-i+t))}let h=Cesium.ArcType.NONE;switch(this._feature.geometry&&this._feature.geometry.extensionOptions&&this._feature.geometry.extensionOptions.arcType&&(h=this._feature.geometry.extensionOptions.arcType),l){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:default:o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:s,width:a,arcType:h}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),show:this.show,appearance:this._createAppearance(),asynchronous:!1});break;case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:h===Cesium.ArcType.NONE&&(h=Cesium.ArcType.GEODESIC);const e=Ph(l),t=new Cesium.GroundPolylineGeometry({positions:s,width:a,arcType:h});o=new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:t,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),show:this.show,appearance:this._createAppearance(),asynchronous:!1,classificationType:e})}const c=this._primitivesCollection.add(o);this._savePrimitive(c)}_createAppearance(){const e=this._feature.symbol;let t=void 0;switch(this._feature.geometry.type){case n.GeometryType.lineString:case n.GeometryType.multiLineString:switch(e.type){case n.SymbolType.simpleLine:switch(e.style){case"dash":case"dash-dot":case"dot":case"long-dash":case"long-dash-dot":case"long-dash-dot-dot":case"short-dash":case"short-dash-dot":case"short-dash-dot-dot":return t=this._createLineMaterial(),new Cesium.PolylineMaterialAppearance({material:t,translucent:!1,renderState:{depthTest:{enabled:!0}}});case"solid":default:return t=Cesium.Material.fromType("Color",{color:this._getCesiumColor(e.color)}),new Cesium.PolylineColorAppearance({material:t,renderState:{depthTest:{enabled:!0}}})}}break;default:n.Log.error("要素几何为不支持的类型!")}}_createLineMaterial(){const e=this._feature.symbol,t=this._getCesiumColor(e.color);t.alpha*=this._layerOpacity;let i=void 0;switch(e.style){case"dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:32});break;case"dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:32,maskIndexFactor:2,maskTestFactor:1.5});break;case"dot":i=Cesium.Material.fromType("PolylineDash",{color:t,gapColor:new Cesium.Color(0,0,0,0),dashPattern:240});break;case"long-dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:64});break;case"long-dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:64,maskIndexFactor:2,maskTestFactor:1.5});break;case"long-dash-dot-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:64,maskIndexFactor:2});break;case"short-dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:16});break;case"short-dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:32,maskIndexFactor:2,maskTestFactor:1.5});break;case"short-dash-dot-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:32,maskIndexFactor:2});break;default:i=Cesium.Material.fromType("Color",{color:t})}return i}_savePrimitive(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._primitives.push(e)}};function qh(e,t,i){const r=Ah((i=Object(n.defaultValue)(i,{show:!0,layerOpacity:1})).graphic,t),a=e.material,o=e.anchorPosition,s=function(e){const t={horizontalOrigin:void 0,verticalOrigin:void 0};switch(e){case n.AnchorType.center:default:t.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.verticalOrigin=Cesium.VerticalOrigin.CENTER;break;case n.AnchorType.left:t.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,t.verticalOrigin=Cesium.VerticalOrigin.CENTER;break;case n.AnchorType.right:t.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,t.verticalOrigin=Cesium.VerticalOrigin.CENTER;break;case n.AnchorType.top:t.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case n.AnchorType.bottom:t.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.verticalOrigin=Cesium.VerticalOrigin.BOTTOM;break;case n.AnchorType.topLeft:t.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,t.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case n.AnchorType.topRight:t.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,t.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case n.AnchorType.bottomLeft:t.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,t.verticalOrigin=Cesium.VerticalOrigin.BOTTOM;break;case n.AnchorType.bottomRight:t.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,t.verticalOrigin=Cesium.VerticalOrigin.BOTTOM}return t}(e.anchor);return{show:i.show,position:r.position,image:i.image,color:jh(a.color,i.layerOpacity),width:e.size,height:e.size,horizontalOrigin:s.horizontalOrigin,verticalOrigin:s.verticalOrigin,pixelOffset:new Cesium.Cartesian2(o.coordinates[0],-1*o.coordinates[1]),heightReference:r.heightReference}}function Uh(e,t,i){const r=Ah((i=Object(n.defaultValue)(i,{show:!0,layerOpacity:1})).graphic,t),a=e.material,o=e.font;let s,l;switch(e.horizontalAlignment){case n.HorizontalAlignment.center:default:s=Cesium.HorizontalOrigin.CENTER;break;case n.HorizontalAlignment.right:s=Cesium.HorizontalOrigin.RIGHT;break;case n.HorizontalAlignment.left:s=Cesium.HorizontalOrigin.LEFT}switch(e.verticalAlignment){case n.VerticalAlignment.baseline:default:l=Cesium.VerticalOrigin.BASELINE;break;case n.VerticalAlignment.top:l=Cesium.VerticalOrigin.TOP;break;case n.VerticalAlignment.bottom:l=Cesium.VerticalOrigin.BOTTOM;break;case n.VerticalAlignment.middle:l=Cesium.VerticalOrigin.CENTER}return{show:i.show,position:r.position,text:e.text,fillColor:jh(a.color,i.layerOpacity),font:`${e.size} ${o.family}`,backgroundColor:jh(e.background,i.layerOpacity),horizontalOrigin:s,verticalOrigin:l,heightReference:r.heightReference}}function Wh(e,t,i){const r=Ah((i=Object(n.defaultValue)(i,{show:!0,layerOpacity:1})).graphic,t),a=e.material,o=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(r.position[0],r.position[1],r.position[2])),s={show:i.show,url:e.resource.href,shadows:e.castShadows,scale:1,color:jh(a.color,i.layerOpacity),modelMatrix:o,asynchronous:!1,heightReference:r.heightReference};return Cesium.Model.fromGltf(s)}function Hh(e,t){t=Object(n.defaultValue)(t,{layerOpacity:1});const i=e.material;switch(i.type){case n.MaterialType.color:default:return new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:jh(i.color,t.layerOpacity)})})}}function Yh(e,t,i){i=Object(n.defaultValue)(i,{show:!0,layerOpacity:1});const r=e.material,a=new Cesium.EllipsoidGeometry({radii:new Cesium.Cartesian3(e.width,e.height,e.depth),innerRadii:new Cesium.Cartesian3(e.width,e.height,e.depth)}),o=Cesium.Transforms.eastNorthUpToFixedFrame(t);return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:a,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(jh(r.color,i.layerOpacity))}}),show:i.show,modelMatrix:o,appearance:Hh(e,{layerOpacity:i.layerOpacity}),asynchronous:!1})}function Xh(e,t,i){i=Object(n.defaultValue)(i,{topRadius:0,bottomRadius:0,slices:128,layerOpacity:1,show:!0});const r=e.material,a=Cesium.Transforms.eastNorthUpToFixedFrame(t),o=new Cesium.CylinderGeometry({topRadius:i.topRadius,bottomRadius:i.bottomRadius,length:e.depth,slices:i.slices});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:o,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(jh(r.color,i.layerOpacity))}}),show:i.show,modelMatrix:a,appearance:Hh(e,{layerOpacity:i.layerOpacity}),asynchronous:!1})}function $h(e){let t=Cesium.ShadowMode.DISABLED;return e.castShadows&&(t=Cesium.ShadowMode.ENABLED),t}function Jh(e){const t=e.color,i=e.outline.color;return{color:new Cesium.Color(t.red/255,t.green/255,t.blue/255,t.alpha),pixelSize:e.size,show:"none"!==e.style,outlineColor:new Cesium.Color(i.red/255,i.green/255,i.blue/255,i.alpha),outlineWidth:e.outline.width}}var Kh=class extends Sh{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.SimpleFillSymbol||(n.Log.info("要素的符号类型不是SimpleFillSymbol!"),!1)}_createPrimitive(e){const{type:t}=this._feature.geometry,i=this._getPositions();switch(t){case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:default:this._addPrimitiveByElevationMode(i,e);break;case n.GeometryType.multiPolygon:for(let t=0;t<i.length;t++)this._addPrimitiveByElevationMode(i[t],e)}}_addPrimitiveByElevationMode(e,t){const{mode:i}=this._elevationInfo;switch(i){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:default:this._addPolygonPrimitive(e),this._addPolygonOutlinePrimitive(e),t&&t instanceof Function&&t();break;case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:const r=n.GeometryEngine.getCenterOID(this._feature.geometry),a=[Cesium.Cartographic.fromDegrees(r.coordinates[0],r.coordinates[1],0)];if(i===n.ElevationMode.RelativeToGround)Ih(this._viewer,a,this._elevationInfo,i=>{this._addPolygonPrimitive(e,i[0].height),this._addPolygonOutlinePrimitive(e,i[0].height),t&&t instanceof Function&&t()});else{const i=Eh(this._viewer);Oh(this._viewer,a,i,this._elevationInfo,i=>{this._addPolygonPrimitive(e,i[0].height),this._addPolygonOutlinePrimitive(e,i[0].height),t&&t instanceof Function&&t()})}}}_addPolygonPrimitive(e,t){const i=this._feature.symbol,r=this._getCesiumColor(i.color);let a;const o=[],{mode:s}=this._elevationInfo;switch(s){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:default:for(let t=0;t<e.length;t++){o.push([]);for(let i=0;i<e[t].length;i++)o[t].push(Cesium.Cartesian3.fromRadians(e[t][i].longitude,e[t][i].latitude,e[t][i].height))}break;case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:for(let i=0;i<e.length;i++){o.push([]);for(let r=0;r<e[i].length;r++)o[i].push(Cesium.Cartesian3.fromRadians(e[i][r].longitude,e[i][r].latitude,t))}}const l=[];for(let e=1;e<o.length;e++)l.push(new Cesium.PolygonHierarchy(o[e]));let h=void 0;const c=this._feature.geometry;let u;c.type===n.GeometryType.extent&&(h=c.zmax);let d=!0;this._feature.geometry&&this._feature.geometry.extensionOptions&&this._feature.geometry.extensionOptions.arcType&&(u=this._feature.geometry.extensionOptions.arcType,d=!1);const p=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(o[0],l),extrudedHeight:h,perPositionHeight:d,arcType:u}),f=new Cesium.MaterialAppearance({material:this._createPolygonMaterial(),translucent:!1,renderState:{depthTest:{enabled:!0}}});switch(s){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:default:a=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:p,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),appearance:f,asynchronous:!1});break;case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:const e=Ph(s);a=new Cesium.GroundPrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:p,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),appearance:f,asynchronous:!1,classificationType:e})}const m=this._primitivesCollection.add(a);this._savePrimitive(m)}_addPolygonOutlinePrimitive(e,t){const i=this._feature.symbol.outline,{geometry:r}=this._feature,{type:a}=r;let o,s=[];switch(a){case n.GeometryType.polygon:default:for(let t=0;t<e.length;t++){s.push([]);for(let i=0;i<e[t].length;i++)s[t].push([Cesium.Math.toDegrees(e[t][i].longitude),Cesium.Math.toDegrees(e[t][i].latitude),e[t][i].height]);s[t].push([s[t][0][0]+(s[t][1][0]-s[t][0][0])/1e4,s[t][0][1]+(s[t][1][1]-s[t][0][1])/1e4,s[t][0][2]+(s[t][1][2]-s[t][0][2])/1e4])}break;case n.GeometryType.circle:s.push([]),s=r.toPolygon().coordinates;break;case n.GeometryType.extent:s.push([]),s[0].push([r.xmin,r.ymin,r.zmin||0]),s[0].push([r.xmax,r.ymin,r.zmin||0]),s[0].push([r.xmax,r.ymax,r.zmin||0]),s[0].push([r.xmin,r.ymax,r.zmin||0]),s[0].push([r.xmin,r.ymin,r.zmin||0]),s[0].push([s[0][0][0]+(s[0][1][0]-s[0][0][0])/1e4,s[0][0][1]+(s[0][1][1]-s[0][0][1])/1e4,s[0][0][2]+(s[0][1][2]-s[0][0][2])/1e4])}if(this._elevationInfo.mode===n.ElevationMode.RelativeToGround||this._elevationInfo.mode===n.ElevationMode.RelativeToScene){o=new n.ElevationInfo({mode:n.ElevationMode.AbsoluteHeight});for(let e=0;e<s.length;e++){let i=0;for(let t=0;t<s[e].length;t++)i<s[e][t][2]&&(i=s[e][t][2]);for(let r=0;r<s[e].length;r++)s[e][r][2]=s[e][r][2]-i+t}}else o=this._elevationInfo;const l=new n.MultiLineString({coordinates:s,extensionOptions:r.extensionOptions}),h=new n.Feature({geometry:l,symbol:i,elevationInfo:o,visible:this.show}),c=new Bh({feature:h,layerOpacity:this._layerOpacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});this._primitives=this._primitives.concat(c._primitives)}_createPolygonMaterial(){const e=this._feature.symbol;let t;switch(e.style){case"backward-diagonal":case"cross":case"diagonal-cross":case"forward-diagonal":case"horizontal":case"vertical":this._canvas?(this._symbol||(this._symbol=this._feature.symbol),this._symbolEquals(e,this._symbol)||(this._canvas=Object(n.createSimpleFillSymbolCanvas)(e),this._symbol=e)):this._canvas=Object(n.createSimpleFillSymbolCanvas)(e,{lineWidth:1}),t=Cesium.Material.fromType("Image",{image:this._canvas,repeat:new Cesium.Cartesian2(1,1),color:new Cesium.Color(1,1,1,this._layerOpacity)});break;default:const i=this._getCesiumColor(e.color);i.alpha*=this._layerOpacity,t=Cesium.Material.fromType("Color",{color:i})}return t}_symbolEquals(e,t){return e.style===t.style&&e.color.red===t.color.red&&e.color.green===t.color.green&&e.color.blue===t.color.blue&&e.color.alpha===t.color.alpha&&e.outline.width===t.outline.width&&e.outline.color.red===t.outline.color.red&&e.outline.color.green===t.outline.color.green&&e.outline.color.blue===t.outline.color.blue&&e.outline.color.alpha===t.outline.color.alpha}_savePrimitive(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._primitives.push(e)}};var Zh=class extends Kh{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.PictureFillSymbol||(n.Log.info("要素的符号类型不是PictureFillSymbol!"),!1)}_createPolygonMaterial(){const e=this._feature.symbol,{url:t,xscale:i,yscale:r}=e;return new Cesium.Material({fabric:{type:"Image",uniforms:{color:new Cesium.Color(1,1,1,this._layerOpacity),image:t,repeat:{x:1/i,y:1/r}}}})}};var Qh=class extends Sh{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.MapGISTextSymbol||this._feature.symbol instanceof n.TextSymbol||(n.Log.info("要素的符号类型不是MapGISTextSymbol!"),!1)}_createPrimitive(e){const{type:t}=this._feature.geometry,i=this._getPositions();switch(t){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:Nh(this,i[0],e);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:for(let t=0;t<i.length;t++)Nh(this,i[t],e)}}_getPositions(){return Lh(this._feature,this._viewer)}_createBillboardOptions(e,t){(t=Object(n.defaultValue)(t,{})).heightReference=Object(n.defaultValue)(t.heightReference,Cesium.HeightReference.NONE);const i=this._feature.symbol;let r=(Cesium.DynamicLabelsUtil||Ai.a).createNoteBillBoardOptions(this._feature.id,i.text,e,Pi.a.convertTextSymbolToLabelNoteStyle(i,{layerOpacity:this._layerOpacity}));return r.verticalOrigin=Cesium.VerticalOrigin.BOTTOM,r.heightReference=t.heightReference,r=Object.assign(r,this._feature.symbol.extensionOptions)}};var ec=class{constructor(e){e=Object(n.defaultValue)(e,{}),this.id=Object(n.defaultValue)(e.id,Object(n.getGUID)()),this._viewer=e.viewer,this._renderer=e.renderer,this._dataSource=new Cesium.CustomDataSource(this.id),this._initCluster()}_initCluster(){this._dataSourcePromise=this._viewer.dataSources.add(this._dataSource,{camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas});const e=this;this._dataSourcePromise.then(function(t){t.clustering.enabled=!0,t.clustering.pixelRange=e._renderer.radius,t.clustering.clusterEvent.addEventListener(function(t,i){i.label.show=!1,i.billboard.show=!1,i.point.show=!1;const r=e._renderer.clusterInfos,n=e._renderer.defaultSymbol,a=e._renderer.defaultLabelSymbol;if(r instanceof Array&&r.length>0){let o=!1;for(let n=0;n<r.length;n++)if(t.length>=r[n].minValue&&t.length<r[n].maxValue){e._setClusterEntity(i,r[n].symbol,r[n].labelSymbol),o=!0;break}o||e._setClusterEntity(i,n,a)}else e._setClusterEntity(i,n,a)})})}_setClusterEntity(e,t,i){switch(t.type){case n.SymbolType.simpleMarker:switch(t.style){case"circle":this._setClusterPoint(e,t),i&&this._setClusterLabel(e,i,{});break;default:this._setClusterBillBoard(e,t),i&&this._setClusterLabel(e,i,{})}break;case n.SymbolType.pictureMarker:this._setClusterBillBoard(e,t),i&&this._setClusterLabel(e,i,{pictureMarkerSymbol:t})}}_setClusterLabel(e,t,i){i=Object(n.defaultValue)(i,{});const r=Object(n.defaultValue)(i.pictureMarkerSymbol,void 0);t&&t instanceof n.TextSymbol&&(e.label.show=!0,e.label.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,e.label.verticalOrigin=Cesium.VerticalOrigin.CENTER,e.label.font=`${t.font.size}px ${t.font.family}`,e.label.fillColor=new Cesium.Color(t.color.red/255,t.color.green/255,t.color.blue/255,t.color.alpha)),r&&r instanceof n.PictureMarkerSymbol&&(e.label.pixelOffset=new Cesium.Cartesian2(t.xoffset,-1*t.yoffset+-1*r.height))}_setClusterBillBoard(e,t){t&&(t instanceof n.PictureMarkerSymbol?(e.billboard.show=!0,e.billboard.image=t.url,e.billboard.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,e.billboard.verticalOrigin=Cesium.VerticalOrigin.CENTER,e.billboard.width=t.width,e.billboard.height=t.height,e.billboard.pixelOffset=new Cesium.Cartesian2(t.xoffset,t.yoffset),e.billboard.rotation=Cesium.Math.toRadians(t.angle)):t instanceof n.SimpleMarkerSymbol&&(e.billboard.show=!0,e.billboard.image=Object(n.createSimpleMarkerSymbolCanvas)(t),e.billboard.width=t.size,e.billboard.height=t.size,e.billboard.pixelOffset=new Cesium.Cartesian2(t.xoffset,t.yoffset),e.billboard.rotation=Cesium.Math.toRadians(t.angle)))}_setClusterPoint(e,t){const i=Jh(t);e.point.show=!0,e.point.color=i.color,e.point.color=e.point.color.withAlpha(.75),e.point.pixelSize=i.pixelSize,e.point.outlineColor=i.outlineColor,e.point.outlineWidth=i.outlineWidth}add(e){let t,i,r;switch((e=Object(n.defaultValue)(e,{})).geometry.type){case n.GeometryType.multiPolygon:i=e.geometry.coordinates;for(let a=0;a<i.length;a++)r=new n.Polygon({coordinates:i[a],spatialReference:e.geometry.spatialReference}),t=n.GeometryEngine.getCenterOID(r),this._addEntity(e,t);break;case n.GeometryType.multiLineString:i=e.geometry.coordinates;for(let a=0;a<i.length;a++)r=new n.LineString({coordinates:i[a],spatialReference:e.geometry.spatialReference}),t=n.GeometryEngine.getCenterOID(r),this._addEntity(e,t);break;case n.GeometryType.multiPoint:i=e.geometry.coordinates;for(let t=0;t<i.length;t++)r=new n.Point({coordinates:i[t],spatialReference:e.geometry.spatialReference}),this._addEntity(e,r);break;default:t=n.GeometryEngine.getCenterOID(e.geometry),this._addEntity(e,t)}}_addEntity(e,t){const i={position:Cesium.Cartesian3.fromDegrees(t.coordinates[0],t.coordinates[1],1e3)},r=e.symbol;switch(r.type){case n.SymbolType.simpleMarker:switch(r.style){case"circle":i.point=Jh(r),i.point.id=e.id;break;default:i.billboard=function(e){return{show:"none"!==e.style,image:Object(n.createSimpleMarkerSymbolCanvas)(e)}}(r),i.billboard.id=e.id}break;case n.SymbolType.pictureMarker:i.billboard=function(e){return{image:e.url,width:e.width,height:e.height,pixelOffset:new Cesium.Cartesian2(e.xoffset,e.yoffset),rotation:Cesium.Math.toRadians(e.angle)}}(r),i.billboard.id=e.id}this._dataSource.entities.add(i)}setVisible(e){this._dataSource.entities.show=e}destroy(){this._dataSource.entities.removeAll()}};var tc=class{constructor(e){e=Object(n.defaultValue)(e,{}),this.id=Object(n.defaultValue)(e.id,Object(n.getGUID)()),this._field=Object(n.defaultValue)(e.field,void 0),this._valueExpression=Object(n.defaultValue)(e.valueExpression,void 0),this._features=Object(n.defaultValue)(e.features,[]),this._radius=Object(n.defaultValue)(e.radius,void 0),this._radiusFactor=Object(n.defaultValue)(e.radiusFactor,60),this._minDataValue=Object(n.defaultValue)(e.minDataValue,0),this._maxDataValue=Object(n.defaultValue)(e.maxDataValue,0),this._minCanvasSize=Object(n.defaultValue)(e.minCanvasSize,700),this._maxCanvasSize=Object(n.defaultValue)(e.maxCanvasSize,2e3),this._spacingFactor=Object(n.defaultValue)(e.spacingFactor,1.5),this._opacity=Object(n.defaultValue)(e.opacity,1),this._blur=Object(n.defaultValue)(e.blur,.85),this._gradient=Object(n.defaultValue)(e.gradient,{}),this._canChange=Object(n.defaultValue)(e.canChange,!0),this._viewer=Object(n.defaultValue)(e.viewer,void 0),this._heatMap=void 0,this._initHeatMap()}_initHeatMap(){this._viewer||n.Log.error("Cesium视图对象不能为空!"),this._features&&this._features instanceof Array||n.Log.error("热力图数据不能为空或者不是数组!"),this._field||this._valueExpression||n.Log.error("字段名或字段表达式不能为空!");const e=this._getHeatMapData(),t=this._getBounds(e),i=this._getGradient();this._heatMap=Cesium.CesiumHeatmap.create(this._viewer,t,{radius:this._radius,radiusFactor:this._radiusFactor,minCanvasSize:this._minCanvasSize,maxCanvasSize:this._maxCanvasSize,spacingFactor:this._spacingFactor,alpha:this._opacity,blur:this._blur,gradient:i,canChange:this._canChange}),this._heatMap.setWGS84Data(this._minDataValue,this._maxDataValue,e)}_getBounds(e){const t=[[]];for(let i=0;i<e.length;i++)t[0].push([e[i].x,e[i].y]);t[0].push(t[0][0]);const i=new n.Polygon({coordinates:t});return{west:i.extent.xmin,east:i.extent.xmax,south:i.extent.ymin,north:i.extent.ymax}}_getHeatMapData(){const e=[];for(let t=0;t<this._features.length;t++){const i=this._features[t],r=i.geometry;let a;switch(this._valueExpression?(a=Pi.a.parseExpression(i,this._valueExpression),a=Number(a)):a=Number(i.attributes[this._field]),r.type){case n.GeometryType.point:e.push({x:r.coordinates[0],y:r.coordinates[1],value:a});break;case n.GeometryType.multiPoint:for(let t=0;t<r.coordinates.length;t++)e.push({x:r.coordinates[t][0],y:r.coordinates[t][1],value:a});break;case n.GeometryType.lineString:e.push({x:r.extent.center.coordinates[0],y:r.extent.center.coordinates[1],value:a});break;case n.GeometryType.multiLineString:for(let i=0;i<r.coordinates.length;i++){const i=new n.LineString({coordinates:r.coordinates[t]});e.push({x:i.extent.center.coordinates[0],y:i.extent.center.coordinates[1],value:a})}break;case n.GeometryType.polygon:e.push({x:r.centroid.coordinates[0],y:r.centroid.coordinates[1],value:a});break;case n.GeometryType.multiPolygon:for(let i=0;i<r.coordinates.length;i++){const i=new n.Polygon({coordinates:r.coordinates[t]});e.push({x:i.centroid.coordinates[0],y:i.centroid.coordinates[1],value:a})}break;case n.GeometryType.extent:e.push({x:r.center.coordinates[0],y:r.center.coordinates[1],value:a});break;case n.GeometryType.circle:e.push({x:r.center[0],y:r.center[1],value:a})}}return e}_getGradient(){const e={};for(let t=0;t<this._gradient.length;t++)e[this._gradient[t].ratio]=this._gradient[t].color.toCssRGBAString();return e}destroy(){this._heatMap.removeLayer()}};var ic=class extends Sh{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.LineSymbol3D||(n.Log.info("要素的符号类型不是SimpleLineSymbol!"),!1)}update(e){this._feature=e,this.destroy(),this._createPrimitive()}destroy(){this._primitivesCollection&&this._primitivesCollection.removeAll()}_createPrimitive(){const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;for(let i=0;i<e.items.length;i++){const r=e.items[i];switch(r.type){case n.Symbol3DLayerType.line:default:switch(t.type){case n.GeometryType.lineString:const e=this._primitivesCollection.add(this._createLineSymbol3DLayerPrimitive(r,this._getPositions()));e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._primitives.push(e);break;case n.GeometryType.multiLineString:const i=this._getPositions();for(let e=0;e<i.length;e++){const t=this._primitivesCollection.add(this._createLineSymbol3DLayerPrimitive(r,i[e]));t.id=this._feature.id,t.commonFeatureId=this._feature.id,t.commonLayerId=this.commonLayerId,this._primitives.push(t)}}break;case n.Symbol3DLayerType.path:switch(t.type){case n.GeometryType.lineString:case n.GeometryType.arc:const e=this._primitivesCollection.add(this._createPathSymbol3DLayerPrimitive(r,this._getPositions()));e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._primitives.push(e);break;case n.GeometryType.multiLineString:const i=this._getPositions();for(let e=0;e<i.length;e++){const t=this._primitivesCollection.add(this._createPathSymbol3DLayerPrimitive(r,i[e]));t.id=this._feature.id,t.commonFeatureId=this._feature.id,t.commonLayerId=this.commonLayerId,this._primitives.push(t)}}}}}_createLineSymbol3DLayerPrimitive(e,t){const i=[];t.forEach(e=>{i.push(Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,e.height))});const r=e.material;let a,o=Cesium.ArcType.NONE;if(this._feature.geometry&&this._feature.geometry.extensionOptions&&this._feature.geometry.extensionOptions.arcType&&(o=this._feature.geometry.extensionOptions.arcType),this._elevationInfo.mode===n.ElevationMode.AbsoluteHeight)a=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:i,width:e.size,arcType:o}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(r.color,this._layerOpacity))}}),show:this.show,appearance:this._createLineAppearance(e),asynchronous:!1});else{const t=Ph(this._elevationInfo.mode),n=new Cesium.GroundPolylineGeometry({positions:i,width:e.size,loop:!1});a=new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:n,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(r.color,this._layerOpacity))}}),show:this.show,appearance:this._createAppearance(),asynchronous:!1,classificationType:t})}return a}_createLineAppearance(e){const t=e.pattern,i=e.material,r=e.marker;let a=void 0;switch(i.type){case n.MaterialType.color:default:switch(t.style){case"dash":case"dash-dot":case"dot":case"long-dash":case"long-dash-dot":case"long-dash-dot-dot":case"short-dash":case"short-dash-dot":case"short-dash-dot-dot":return a=Rh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style),new Cesium.PolylineMaterialAppearance({material:a,translucent:!1,renderState:{depthTest:{enabled:!0}}});case"solid":default:if(r){let e=r.color;switch(e||(e=i.color),r.style){case n.LineMarkerStyle.arrow:a=Cesium.Material.fromType("PolylineArrow",{color:this._getCesiumColorByOpacity(e,this._layerOpacity)});break;default:a=Rh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style)}}else a=Rh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style);return new Cesium.PolylineColorAppearance({material:a,renderState:{depthTest:{enabled:!0}}})}}}_createPathSymbol3DLayerPrimitive(e,t){const i=[];switch(t.forEach(e=>{i.push(Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,e.height))}),e.profile){case n.ProfileType.circle:default:return this._createPolylineVolumePrimitive(e,i);case n.ProfileType.quad:return this._createCorridorPrimitive(e,i)}}_createPolylineVolumePrimitive(e,t){const i=e.material,r=this._getCesiumColorByOpacity(i.color,this._layerOpacity),n=this._getCornerType(e),a=new Cesium.PolylineVolumeGeometry({polylinePositions:t,shapePositions:this._computeCircle(e.width>e.height?e.width:e.height),cornerType:n});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:a,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),show:this.show,appearance:this._createPathAppearance(i),asynchronous:!1,shadows:this._getShadows(e)})}_computeCircle(e){const t=[];for(let i=0;i<360;i++){const r=Cesium.Math.toRadians(i);t.push(new Cesium.Cartesian2(e*Math.cos(r),e*Math.sin(r)))}return t}_createCorridorPrimitive(e,t){const i=e.material,r=this._getCesiumColorByOpacity(i.color,this._layerOpacity),n=this._getCornerType(e),a=new Cesium.CorridorGeometry({positions:t,width:e.width,height:e.height,extrudedHeight:0,cornerType:n});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:a,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),show:this.show,appearance:this._createPathAppearance(i),asynchronous:!1,shadows:this._getShadows(e)})}_createPathAppearance(e){switch(e.type){case n.MaterialType.color:default:const t=this._getCesiumColorByOpacity(e.color,this._layerOpacity);return new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{_color:t})})}}_getCornerType(e){let t=void 0;switch(e.join){case n.LineJoinType.round:default:t=Cesium.CornerType.ROUNDED;break;case n.LineJoinType.bevel:t=Cesium.CornerType.BEVELED;break;case n.LineJoinType.miter:t=Cesium.CornerType.MITERED}return t}_getShadows(e){let t=Cesium.ShadowMode.DISABLED;return e.castShadows&&(t=Cesium.ShadowMode.ENABLED),t}};var rc=class extends Sh{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.PolygonSymbol3D||(n.Log.info("要素的符号类型不是SimpleLineSymbol!"),!1)}update(e){this._feature=e,this.destroy(),this._createPrimitive()}destroy(){this._primitivesCollection&&this._primitivesCollection.removeAll()}_createPrimitive(){const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;let i;for(let r=0;r<e.items.length;r++){const a=e.items[r];switch(a.type){case n.Symbol3DLayerType.line:switch(t.type){case n.GeometryType.polygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createLine(a,i[r]);break;case n.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length;e++)this._createLine(a,i[e][t])}break;case n.Symbol3DLayerType.fill:default:switch(t.type){case n.GeometryType.polygon:this._createPolygon(a,this._getPositions());break;case n.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createPolygon(a,i[e])}break;case n.Symbol3DLayerType.extrude:switch(t.type){case n.GeometryType.polygon:this._createPolygon(a,this._getPositions(),a.size);break;case n.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createPolygon(a,i[e],a.size)}break;case n.Symbol3DLayerType.icon:switch(t.type){case n.GeometryType.polygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length;t++)this._createBillBoard(a,i[e][t]);break;case n.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length;t++)for(let r=0;r<i[e][t].length;r++)this._createBillBoard(a,i[e][t][r])}break;case n.Symbol3DLayerType.object:switch(t.type){case n.GeometryType.polygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length-1;t++)this._createObject(a,i[e][t]);break;case n.GeometryType.multiPolygon:i=this._getPositions()}}}}_createLineSymbol3DLayerPrimitive(e,t){const i=e.material;let r,a=Cesium.ArcType.NONE;if(this._feature.geometry&&this._feature.geometry.extensionOptions&&this._feature.geometry.extensionOptions.arcType&&(a=this._feature.geometry.extensionOptions.arcType),this._elevationInfo.mode===n.ElevationMode.AbsoluteHeight)r=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:t,width:e.size,arcType:a}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(i.color,this._layerOpacity))}}),show:this.show,appearance:this._createLineAppearance(e),asynchronous:!1});else{const n=Ph(this._elevationInfo.mode),a=new Cesium.GroundPolylineGeometry({positions:t,width:e.size,loop:!1});r=new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:a,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(i.color,this._layerOpacity))}}),show:this.show,appearance:this._createLineAppearance(e),asynchronous:!1,classificationType:n})}return r}_createLineAppearance(e){const t=e.pattern,i=e.material,r=e.marker;let a=void 0;switch(i.type){case n.MaterialType.color:default:switch(t.style){case"dash":case"dash-dot":case"dot":case"long-dash":case"long-dash-dot":case"long-dash-dot-dot":case"short-dash":case"short-dash-dot":case"short-dash-dot-dot":return a=Rh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style),new Cesium.PolylineMaterialAppearance({material:a,translucent:!1,renderState:{depthTest:{enabled:!0}}});case"solid":default:if(r){let e=r.color;switch(e||(e=i.color),r.style){case n.LineMarkerStyle.arrow:a=Cesium.Material.fromType("PolylineArrow",{color:this._getCesiumColorByOpacity(e,this._layerOpacity)});break;default:a=Rh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style)}}else a=Rh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style);return new Cesium.PolylineColorAppearance({material:a,renderState:{depthTest:{enabled:!0}}})}}}_createLine(e,t){const i=[];t.forEach(e=>{i.push(Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,e.height))});const r=this._primitivesCollection.add(this._createLineSymbol3DLayerPrimitive(e,i));r.id=this._feature.id,r.commonFeatureId=this._feature.id,r.commonLayerId=this.commonLayerId,this._primitives.push(r)}_createPolygon(e,t,i){const r=[];t.forEach(e=>{const t=[];e.forEach(e=>{t.push(Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,e.height))}),r.push(t)});const n=this._primitivesCollection.add(this._createFillSymbol3DLayerPrimitive(e,r,i));n.id=this._feature.id,n.commonFeatureId=this._feature.id,n.commonLayerId=this.commonLayerId,this._primitives.push(n)}_createFillSymbol3DLayerPrimitive(e,t,i){const a=e.material,o=[];for(let e=1;e<t.length;e++)o.push(new Cesium.PolygonHierarchy(t[e]));let s;s=i?new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(t[0],o),perPositionHeight:!0,height:i,extrudedHeight:i}):new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(t[0],o),perPositionHeight:!0});const l=new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:this._getCesiumColorByOpacity(a.color,this._layerOpacity)}),translucent:!1,renderState:{depthTest:{enabled:!0}}});let h;if(this._elevationInfo.mode===n.ElevationMode.AbsoluteHeight)h=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:s,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(a.color,this._layerOpacity))}}),appearance:l,asynchronous:!1,shadows:r.getShadows(e)});else{const t=Ph(this._elevationInfo.mode);h=new Cesium.GroundPrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:s,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(a.color,this._layerOpacity))}}),appearance:l,asynchronous:!1,classificationType:t,shadows:r.getShadows(e)})}return h=this._primitivesCollection.add(h)}_createIconSymbol3dLayerPrimitive(e,t){const i=e.material;return{position:t,image:e.resource.href,color:this._getCesiumColorByOpacity(i.color,this._layerOpacity),width:e.size,height:e.size,verticalOrigin:Cesium.VerticalOrigin.BOTTOM}}_createBillBoard(e,t){const i=this._billboardsCollection.add(this._createIconSymbol3dLayerPrimitive(e,t));i.id=this._feature.id,i.commonFeatureId=this._feature.id,i.commonLayerId=this.commonLayerId,this._billboards.push(i)}_createObject(e,t){const i=e.resource;let r;if(i.href)r=this._primitivesCollection.add(this._createModelPrimitive(e,t));else{let n;switch(i.primitive){case"sphere":r=this._primitivesCollection.add(this._createSpherePrimitive(e,t));break;case"cylinder":n=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:n,bottomRadius:n}));break;case"cone":n=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:0,bottomRadius:n}));break;case"inverted-cone":n=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:n,bottomRadius:0}));break;case"tetrahedron":n=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:0,bottomRadius:n,slices:3}))}}r.id=this._feature.id,r.commonFeatureId=this._feature.id,r.commonLayerId=this.commonLayerId,this._primitives.push(r)}_createSpherePrimitive(e,t){const i=e.material,r=new Cesium.EllipsoidGeometry({radii:new Cesium.Cartesian3(e.width,e.height,e.depth),innerRadii:new Cesium.Cartesian3(e.width,e.height,e.depth)}),n=Cesium.Transforms.eastNorthUpToFixedFrame(t);return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:r,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(i.color,this._layerOpacity))}}),show:this.show,modelMatrix:n,appearance:this._createObject3DAppearance(e),asynchronous:!1})}_createCylinderPrimitive(e,t,i){i=Object(n.defaultValue)(i,{topRadius:0,bottomRadius:0,slices:128});const r=e.material,a=Cesium.Transforms.eastNorthUpToFixedFrame(t),o=new Cesium.CylinderGeometry({topRadius:i.topRadius,bottomRadius:i.bottomRadius,length:e.depth,slices:i.slices});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:o,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(r.color,this._layerOpacity))}}),show:this.show,modelMatrix:a,appearance:this._createObject3DAppearance(e),asynchronous:!1})}_createModelPrimitive(e,t){const i=e.material,r=Cesium.Transforms.eastNorthUpToFixedFrame(t),n={show:this.show,url:e.resource.href,shadows:e.castShadows,scale:1e3,color:this._getCesiumColorByOpacity(i.color,this._layerOpacity),modelMatrix:r,asynchronous:!1};return Cesium.Model.fromGltf(n)}_createObject3DAppearance(e){const t=e.material;switch(t.type){case n.MaterialType.color:default:return new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:this._getCesiumColorByOpacity(t.color,this._layerOpacity)})})}}};var nc=class extends Sh{constructor(e){super(e),this._graphics=Object(n.defaultValue)(this._graphics,[])}checkSymbol(){return this._feature.symbol instanceof n.PointSymbol3D||(n.Log.info("要素的符号类型不是PictureMarkerSymbol!"),!1)}update(e){this._feature=e,this.destroy(),this._createPrimitive()}destroy(){this._graphics&&(this._graphics.forEach(e=>{e&&e.destroy()}),this._graphics=[]),this._primitivesCollection&&this._primitivesCollection.removeAll()}_createPrimitive(){this._graphics=[];const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;let i;for(let r=0;r<e.items.length;r++){const a=e.items[r];switch(t.type){case n.GeometryType.point:i=this._getPositions(),this._createPointSymbol3D(a,i[0]);break;case n.GeometryType.multiPoint:i=this._getPositions();for(let e=0;e<i.length;e++)this._createPointSymbol3D(a,i[e])}}}_createPointSymbol3D(e,t){switch(e.type){case n.Symbol3DLayerType.icon:default:this._createBillboard(e,t);break;case n.Symbol3DLayerType.text:this._createLabel(e,t);break;case n.Symbol3DLayerType.object:this._createObject(e,t)}}_createBillboard(e,t){let i;if(e.resource.href){const r=Fh(e,n.SymbolType.pictureMarker,t,this._feature);i=new kh({feature:r,billboardsCollection:this._billboardsCollection})}else{const r=Fh(e,n.SymbolType.simpleMarker,t,this._feature);i=new Mh({feature:r,pointsCollection:this._pointsCollection,billboardsCollection:this._billboardsCollection})}this._graphics.push(i)}_createLabel(e,t){const i=Fh(e,n.SymbolType.mapgisText,t,this._feature),r=new Qh({feature:i,billboardsCollection:this._billboardsCollection});this._graphics.push(r)}_createObject(e,t){const i={show:this.show,layerOpacity:this._layerOpacity},n=Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,t.height),a=e.resource;let o;if(a.href)o=this._primitivesCollection.add(r.createModelPrimitive(e,n,i));else{let t;switch(a.primitive){case"sphere":o=this._primitivesCollection.add(r.createSpherePrimitive(e,n,{show:this.show,layerOpacity:this._layerOpacity}));break;case"cylinder":t=e.width>e.height?e.width:e.height,i.topRadius=t,i.bottomRadius=t,o=this._primitivesCollection.add(r.createCylinderPrimitive(e,n,i));break;case"cone":t=e.width>e.height?e.width:e.height,i.topRadius=0,i.bottomRadius=t,o=this._primitivesCollection.add(r.createCylinderPrimitive(e,n,i));break;case"inverted-cone":t=e.width>e.height?e.width:e.height,i.topRadius=t,i.bottomRadius=0,o=this._primitivesCollection.add(r.createCylinderPrimitive(e,n,i));break;case"tetrahedron":t=e.width>e.height?e.width:e.height,i.topRadius=0,i.bottomRadius=t,i.slices=3,o=this._primitivesCollection.add(r.createCylinderPrimitive(e,n,i))}}o.id=this._feature.id,o.commonFeatureId=this._feature.id,o.commonLayerId=this.commonLayerId,this._primitives.push(o)}};var ac=class extends Sh{constructor(e){super(e),this._graphics=Object(n.defaultValue)(this._graphics,[])}checkSymbol(){return this._feature.symbol instanceof n.LabelSymbol3D||(n.Log.info("要素的符号类型不是LabelSymbol3D!"),!1)}update(e){this._feature=e,this.destroy(),this._createPrimitive()}destroy(){this._graphics&&(this._graphics.forEach(e=>{e&&e.destroy()}),this._graphics=[])}_createPrimitive(){this._graphics=[];const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;let i;for(let r=0;r<e.items.length;r++){const a=e.items[r];switch(t.type){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:i=this._getPositions(),this._createLabel(a,i[0]);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createLabel(a,i[e])}}}_createLabel(e,t){const i=Fh(e,n.SymbolType.mapgisText,t,this._feature),r=new Qh({feature:i,billboardsCollection:this._billboardsCollection});this._graphics.push(r)}};class oc{constructor(e){e=Object(n.defaultValue)(e,{}),this.id=Object(n.defaultValue)(e.id,Object(n.getGUID)()),this.opacity=Object(n.defaultValue)(e.opacity,1),this.elevationInfo=Object(n.defaultValue)(e.elevationInfo,new n.ElevationInfo),this.cameraHeightStep=Object(n.defaultValue)(e.cameraHeightStep,1e3),this._viewer=Object(n.defaultValue)(e.viewer,{}),this._swipeEnabled=Object(n.defaultValue)(e.swipeEnabled,!1),this._swipeInverse=Object(n.defaultValue)(e.swipeInverse,0),this._graphicsCollection=[],this._primitivesCollection=new Cesium.PrimitiveCollection({swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse}),this._pointsCollection=new Cesium.PointPrimitiveCollection({swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse}),this._billboardsCollection=new Cesium.BillboardCollection({scene:this._viewer.scene,swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse}),this._labelsCollection=new Cesium.LabelCollection({scene:this._viewer.scene,swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse}),this._allPrimitives=new Cesium.PrimitiveCollection;const t=this;this._oldCameraHeight=0,this._viewer.camera&&this._viewer.camera.changed.addEventListener(()=>{for(let e=0;e<t._graphicsCollection.length;e++){const i=t._graphicsCollection[e];if(i){if(Gh(i._feature)&&(i instanceof kh||i instanceof Mh||i instanceof Qh||i instanceof nc)){const e=t._viewer.camera.positionCartographic.height;Math.abs(t._oldCameraHeight-e)>t.cameraHeightStep&&(t._oldCameraHeight=e,t.update(i._feature))}}}})}addPrimitives(){this._allPrimitives.add(this._primitivesCollection),this._allPrimitives.add(this._pointsCollection),this._allPrimitives.add(this._billboardsCollection),this._allPrimitives.add(this._labelsCollection),this._viewer.scene.primitives.add(this._allPrimitives)}add(e){let t=n.Feature.fromJSON(e);let i;switch(t.elevationInfo||(t.elevationInfo=this.elevationInfo),t.additional&&t.additional.hasOwnProperty("arc3")&&(t=Object(n.editFeatureByArc3)(t)),t.symbol.type){case n.SymbolType.simpleMarker:i=new Mh({layerId:this.id,feature:t,layerOpacity:this.opacity,pointsCollection:this._pointsCollection,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case n.SymbolType.pictureMarker:i=new kh({layerId:this.id,feature:t,layerOpacity:this.opacity,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case n.SymbolType.text:case n.SymbolType.mapgisText:i=new Qh({layerId:this.id,feature:t,layerOpacity:this.opacity,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case n.SymbolType.simpleLine:i=new Bh({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case n.SymbolType.simpleFill:i=new Kh({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case n.SymbolType.pictureFill:i=new Zh({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case n.SymbolType.line3D:i=new ic({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case n.SymbolType.polygon3D:i=new rc({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case n.SymbolType.point3D:i=new nc({layerId:this.id,feature:t,layerOpacity:this.opacity,pointsCollection:this._pointsCollection,primitivesCollection:this._primitivesCollection,billboardsCollection:this._billboardsCollection,labelsCollection:this._labelsCollection,viewer:this._viewer});break;case n.SymbolType.label3D:i=new ac({layerId:this.id,feature:t,layerOpacity:this.opacity,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;default:n.Log.error("要素的符号暂时不支持!")}i&&(this._graphicsCollection.push(i),i.setVisible&&i.setVisible(t.visible))}removeByID(e){const t=this._findGraphicById(e),i=this._graphicsCollection.indexOf(t);i>-1&&this._graphicsCollection.splice(i,1),t.destroy()}update(e){let t=n.Feature.fromJSON(e.toJSON());t.additional.hasOwnProperty("arc3")&&(t=Object(n.editFeatureByArc3)(t));const i=this._findGraphicById(e.id);i&&i._feature&&(i._feature.symbol.type!==t.symbol.type?(this.removeByID(e.id),this.add(e)):(i.update(t),i.setVisible&&i.setVisible(t.visible)))}findByID(e){return this._findGraphicById(e)}getAll(){return this._graphicsCollection}remove(e){this.removeByID(e.id)}removeAll(){if(this._graphicsCollection&&this._graphicsCollection.length>0)for(let e=0;e<this._graphicsCollection.length;e++)this._graphicsCollection[e].destroy();this._graphicsCollection=[]}destroy(){this.removeAll(),this.id=void 0,this.opacity=void 0,this._primitivesCollection=void 0,this._pointsCollection=void 0,this._billboardsCollection=void 0,this._labelsCollection=void 0,this._allPrimitives=void 0,this._viewer=void 0}setVisible(e){this._graphicsCollection&&this._graphicsCollection.length>0&&this._graphicsCollection.forEach(function(t){t.setVisible&&t.setVisible(e)})}setOpacity(e){let t=e;if(t<0&&(t=0),t>1&&(t=1),this.opacity=t,this._graphicsCollection&&this._graphicsCollection.length>0)for(let e=0;e<this._graphicsCollection.length;e++){const i=this._graphicsCollection[e];i&&(i._layerOpacity=t,i.update(i._feature))}}_findGraphicById(e){let t=void 0;if(this._graphicsCollection&&this._graphicsCollection.length>0)for(let i=0;i<this._graphicsCollection.length;i++){const r=this._graphicsCollection[i];r.id===e&&(t=r)}return t}}Object.defineProperties(oc.prototype,{swipeEnabled:{get(){return this._swipeEnabled},set(e){"boolean"==typeof e&&(this._swipeEnabled=e,this._allPrimitives._primitives.forEach(t=>{t.swipeEnabled=e,t instanceof Cesium.PrimitiveCollection&&t._primitives.forEach(t=>{t.swipeEnabled=e})}))}},swipeInverse:{get(){return this._swipeInverse},set(e){"number"==typeof e&&(this._swipeInverse=e,this._allPrimitives._primitives.forEach(t=>{t.swipeInverse=e,t instanceof Cesium.PrimitiveCollection&&t._primitives.forEach(t=>{t.swipeInverse=e})}))}}});var sc=oc;var lc=class{static toPrimitive(e,t){const i=new sc({viewer:t&&t.viewer});if(Array.isArray(e))for(let t=0;t<e.length;t++)i.add(e[t]);else i.add(e);const r=[];return i._billboardsCollection.length>0&&r.push(i._billboardsCollection),i._labelsCollection.length>0&&r.push(i._labelsCollection),i._pointsCollection.length>0&&r.push(i._pointsCollection),i._primitivesCollection.length>0&&r.push(i._primitivesCollection),r}};var hc=class extends lc{static toPrimitive(e,t){return super.toPrimitive(e,t)}};var cc=class extends lc{static toPrimitive(e,t){return super.toPrimitive(e,t)}};var uc=class extends lc{static toPrimitive(e,t){return super.toPrimitive(e,t)}};var dc=class extends lc{static toPrimitive(e,t){return super.toPrimitive(e,t)}};function pc(e,t){this._CesiumMap=e,this._CesiumScene=e.scene,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t}pc.prototype.dimensions=["lng","lat"],pc.prototype.setMapOffset=function(e){this._mapOffset=e},pc.prototype.getBMap=function(){return this._CesiumMap},pc.prototype.dataToPoint=function(e){const t=Cesium.Cartesian3.fromDegrees(e[0],e[1]),i=this._CesiumMap.camera.position;let r=this._CesiumMap.scene.globe.ellipsoid.cartesianToCartographic(i).height;if(r+=1.2*this._CesiumMap.scene.globe.ellipsoid.maximumRadius,Cesium.Cartesian3.distance(i,t)>r)return[-50,-50];const n=this._mapOffset,a=Cesium.Cartesian3.fromDegrees(e[0],e[1]);let o=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this._CesiumScene,a);return[(o=o||{x:0,y:0}).x-n[0],o.y-n[1]]},pc.prototype.pointToData=function(e){const t=this._mapOffset,i=Cesium.Cartesian3.fromDegrees(e[0]+t[0],e[1]+t[1]),r=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this._CesiumScene,i);return[r.x,r.y]},pc.prototype.getViewRect=function(){const e=this._api;return new echarts.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},pc.prototype.getRoamTransform=function(){return echarts.matrix.create()},pc.prototype.prepareCustoms=function(){const e=echarts.util,t=this.getViewRect();return{coordSys:{type:"cesium",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:e.bind(this.dataToPoint,this),size:e.bind(function(t,i){return i=i||[0,0],e.map([0,1],function(e){const r=i[e],n=t[e]/2,a=[],o=[];return a[e]=r-n,o[e]=r+n,a[1-e]=i[1-e],o[1-e]=i[1-e],Math.abs(this.dataToPoint(a)[e]-this.dataToPoint(o)[e])},this)},this)}}},pc.dimensions=pc.prototype.dimensions,pc.create=function(e,t){let i;e.eachComponent("cesium",function(e){const r=echarts.cesiumMap;(i=new pc(r,t)).setMapOffset(e.__mapOffset||[0,0]),e.coordinateSystem=i}),e.eachSeries(function(e){"cesium"===e.get("coordinateSystem")&&(e.coordinateSystem=i)})};var fc=pc;let mc=0;class yc{constructor(e,t,i){if(this.map=e,this.scene=e.scene,this.options=t,this.initStats=!1,this.handler=void 0,this.moveEndEvent=void 0,this.postEvent=void 0,this.postStartEvent=void 0,this.postEndEvent=void 0,this.layerId=t.layerId||`echarts${mc++}`,this.layerClass=t.layerClass||"echartlayerdefaultclass",this.initDevicePixelRatio(),this.visible=Object(n.defaultValue)(t.visible,!0),this.opacity=Object(n.defaultValue)(t.opacity,1),this.canvas=this._createCanvas(),this.postRenderTime=0,this.postRenderFrame=t.postRenderFrame||30,void 0!=i)this.container=i,i.appendChild(this.canvas);else{const t=document.getElementsByClassName("cesium-widget"),i=t.length>0?t[0]:e.container;this.container=i,this.addInnerContainer()}return this.chart=echarts.init(this.canvas),this.initEcharts(),this._resizeCanvas(),this.resize(),this}initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1}addInnerContainer(){this.container.appendChild(this.canvas)}initEcharts(){return echarts.cesiumMap=this.map,echarts.registerCoordinateSystem("cesium",fc),echarts.extendComponentModel({type:"cesium",getBMap(){return this.__cesium},defaultOption:{roam:!1}}),echarts.registerAction({type:"CesiumRoma",event:"CesiumRoma",update:"updateLayout"},function(e,t){}),this}_createCanvas(){const e=document.createElement("div");e.className="cesium-echarts-layer",e.setAttribute("class","cesium-echarts-layer"),e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility=this.visible?"visible":"hidden",e.style.opacity=this.opacity,e.style.pointerEvents="none",e.style.zIndex=this.options.zIndex||100;const t=`${parseInt(this.map.canvas.width)}px`,i=`${parseInt(this.map.canvas.height)}px`;return e.width=t,e.height=i,e.style.width=t,e.style.height=i,e}_resizeCanvas(){const e=this;window.onresize=function(){if(void 0==this.canvas||null==this.canvas)return;const t=e.canvas,i=e.map;t.style.position="absolute",t.style.top="0px",t.style.left="0px";const r=`${parseInt(i.canvas.width)}px`,n=`${parseInt(i.canvas.height)}px`;t.width=r,t.height=n,t.style.width=r,t.style.height=n,e.chart.resize()}}_visible(){this.visible=!0,this.canvas.style.visibility="visible"}_unvisible(){this.visible=!1,this.canvas.style.visibility="hidden"}addTo(e){this.endStatus=!1;const t=this;return echarts.extendComponentView({type:"cesium",render(e,i,r){let n=!0;echarts.cesiumMap;const a=r.getZr().painter.getViewportRoot(),o=e.coordinateSystem,s=function(i,s){if(n||!t.map||!t.visible)return;t._unvisible();const l=t.map.canvas,h=[-parseInt(l.style.left,10)||0,-parseInt(l.style.top,10)||0];a.style.left=`${h[0]}px`,a.style.top=`${h[1]}px`,o.setMapOffset(h),e.__mapOffset=h,r.dispatchAction({type:"CesiumRoma"})},l=function(i,s){if(n||!t.map)return;t._visible();const l=t.map.canvas,h=[-parseInt(l.style.left,10)||0,-parseInt(l.style.top,10)||0];a.style.left=`${h[0]}px`,a.style.top=`${h[1]}px`,o.setMapOffset(h),e.__mapOffset=h,r.dispatchAction({type:"CesiumRoma"})};function h(){n||(t._visible(),r.dispatchAction({type:"CesiumRoma"}))}t.moveEndEvent=l;const c=function(){h()};t.postStartEvent=function(){this.endStatus||t.scene.postRender.addEventListener(c)}.bind(t);t.postEndEvent=function(){this.endStatus||(t.scene.postRender.removeEventListener(c),t.resize(),t._visible())}.bind(t),t.handler=new Cesium.ScreenSpaceEventHandler(t.scene.canvas),0==t.initStats&&(t.initStats=!0,t.options.postRender?(t.scene.camera.moveStart.addEventListener(t.postStartEvent,t),t.scene.camera.moveEnd.addEventListener(t.postEndEvent,t)):(t.handler.setInputAction(s,Cesium.ScreenSpaceEventType.LEFT_DOWN),t.handler.setInputAction(l,Cesium.ScreenSpaceEventType.LEFT_UP),t.handler.setInputAction(s,Cesium.ScreenSpaceEventType.RIGHT_DOWN),t.handler.setInputAction(l,Cesium.ScreenSpaceEventType.RIGHT_UP),t.map.scene.camera.moveEnd.addEventListener(function(){t.moveEndEvent()}))),this._oldMoveHandler=s,this._oldZoomEndHandler=h;e.get("roam");n=!1}}),this.chart.setOption(this.options),this}show(){this._visible()}hide(){this._unvisible()}setOpacity(e){this.opacity=e,this.canvas.style.opacity=this.opacity}resize(){if(void 0==this.canvas||null==this.canvas)return;const e=this.canvas;e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.width=parseInt(this.map.canvas.width),e.height=parseInt(this.map.canvas.height),e.style.width=this.map.canvas.style.width,e.style.height=this.map.canvas.style.height}remove(){this.endStatus=!0;const e=this;return this.chart.clear(),e.options.postRender?(this.scene.camera.moveStart.removeEventListener(this.postStartEvent,this),this.scene.camera.moveEnd.removeEventListener(this.postEndEvent,this)):(this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN),this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP),this.handler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_DOWN),this.handler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_UP),this.scene.camera.moveEnd.removeEventListener(function(){e.moveEndEvent()}),this.handler.destroy()),this.canvas.parentElement&&this.canvas.parentElement.removeChild(this.canvas),this.map=void 0,this}}window.EchartsLayer=yc;var gc=class{constructor(e){e=Object(n.defaultValue)(e,{}),this.view=Object(n.defaultValue)(e.view,null),this.format=Object(n.defaultValue)(e.format,n.PictureFormat.png),this.filename=Object(n.defaultValue)(e.filename,"screenshotFile"),this.width=Object(n.defaultValue)(e.width,void 0),this.height=Object(n.defaultValue)(e.height,void 0),this.x=Object(n.defaultValue)(e.x,0),this.y=Object(n.defaultValue)(e.y,0),this.isDownload=Object(n.defaultValue)(e.isDownload,!0)}_addView(){const e=this;this.view._innerView.render();const t=this.view._innerView.canvas;let i=null;this.format===n.PictureFormat.png?i=t.toDataURL():this.format===n.PictureFormat.jpeg?i=t.toDataURL("image/jpeg"):"svg"===this.format&&(i=t.toDataURL());const r=document.createElement("canvas");r.width=this.width,r.height=this.height;const a=r.getContext("2d"),o=function(e,t){const i=document.createElement("a");i.href=e,i.download=t,document.body.appendChild(i),i.click()};return new Promise(t=>{if(this.width&&this.height){const s=new Image;s.src=i,s.onload=function(){a.drawImage(s,e.x,e.y,e.width,e.height,0,0,e.width,e.height);let i=null;e.format===n.PictureFormat.png?i=r.toDataURL():e.format===n.PictureFormat.jpeg?i=r.toDataURL("image/jpeg"):"svg"===e.format&&(i=r.toDataURL()),e.isDownload&&o(i,e.filename),t({dataUrl:i})}}else e.isDownload&&o(i,this.filename),t({dataUrl:i})})}_removeView(){}};var vc=class extends n.Evented{constructor(e){super(e),e=Object(n.defaultValue)(e,{}),this.view=Object(n.defaultValue)(e.view,""),this.location=Object(n.defaultValue)(e.location,""),this.title=Object(n.defaultValue)(e.title,""),this.content=Object(n.defaultValue)(e.content,""),this.alignment=Object(n.defaultValue)(e.alignment,"bottom-center"),this.defaultButtons=Object(n.defaultValue)(e.defaultButtons,["toggle","close","zoom"]),this._popup=void 0,this._initDefaultClass()}open(e){this._popup?(this.close(),this._popup=void 0,this.openPopup(e)):this.openPopup(e)}openPopup(e){if(e.view){const t=e.view._innerView;this.view&&e.view.id===this.view.id?this._popupLayer||(this._popupLayer=new Cesium.GraphicsLayer(t,{})):(this.view=e.view,this._popupLayer&&this.view._innerView.remove(this._popupLayer),this._popupLayer=new Cesium.GraphicsLayer(t,{}))}else if(!this._popupLayer){if(!this.view)return;this._popupLayer=new Cesium.GraphicsLayer(this.view._innerView,{})}this.location=e.location?e.location:this.location,this.location.spatialReference.isGeographic?this._location=this.location:this._location=n.Projection.project(this.location,new n.SpatialReference({wkid:4326})),this.title=e.title?e.title:this.title,this.content=e.content?e.content:this.content,this.alignment=e.alignment?e.alignment:this.alignment;const t=this._location.coordinates[0],i=this._location.coordinates[1],r=this._initDefaultUI(this.title,this.content);r.style.display="block";const a=new Cesium.Graphic({type:"div",positions:[Cesium.Cartesian3.fromDegrees(t,i,0)],style:{html:r}});this._popup=this._popupLayer.addGraphic(a),this._popup.style.pixelOffset=this._getOffset()}_contentUI(e,t){const i=this;let r=void 0;const n=function(e){const t=document.createElement("div");return t.innerHTML=e,t.childNodes};(r=document.createElement("div")).setAttribute("id",`${this.id}-popup-default`);const a=document.createElement("div");a.setAttribute("class","zondy-popup__header"),a.setAttribute("style","display: flex;");const o=n('<div class="zondy-popup__toggle">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 24 24" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M5 13.793l7-7 7 7v1.414l-7-7-7 7z"></path></svg>\n </div>')[0],s=n('<div class="zondy-popup__close">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M3.98 11.303L7.281 8 3.98 4.697l.707-.707L7.99 7.293l.01-.01.01.01 3.304-3.303.707.707L8.718 8l3.303 3.303-.707.707L8.01 8.707l-.01.01-.01-.01-3.304 3.303z"></path></svg>\n </div>')[0];if(e){const t=n('<div style="flex: 1;"></div>')[0];if(a.appendChild(t),"object"==typeof e?e instanceof Node?t.appendChild(e):e instanceof NodeList&&e.forEach(e=>{t.appendChild(e)}):t.innerHTML=e,this.defaultButtons.indexOf("toggle")>-1){a.appendChild(o);let e=!0;o.onclick=function(){e=!e,document.getElementById(`${i.id}-popup-default`).querySelector(".zondy-popup__content").style.display=e?"block":"none"}}this.defaultButtons.indexOf("close")>-1&&(a.appendChild(s),s.onclick=(()=>{this.close()}))}const l=document.createElement("div");if(l.setAttribute("class","zondy-popup__content"),t)if("object"==typeof t){if(t instanceof Node)l.appendChild(t);else if(t instanceof NodeList)for(let e=0;e<t.length;e++)l.appendChild(t[e]),e--}else l.innerHTML=t;const h=document.createElement("div");h.setAttribute("class","zondy-popup__footer");const c=n('<div class="zondy-popup__zoom" style="display: inline-block;width: 36px;height: 36px;line-height: 36px;text-align: center;">\n <svg class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M9 7H7v2H6V7H4V6h2V4h1v2h2zm6.805 7.861l-.943.942a.665.665 0 0 1-.943 0l-3.067-3.067a.667.667 0 0 1 0-.943l.129-.13-1.108-1.107A5.279 5.279 0 1 1 11.8 6.5a5.251 5.251 0 0 1-1.237 3.366l1.108 1.108.124-.124a.668.668 0 0 1 .943 0l3.067 3.068a.666.666 0 0 1 0 .943zM10.8 6.5a4.3 4.3 0 1 0-4.3 4.3 4.304 4.304 0 0 0 4.3-4.3zm4.062 7.89l-2.595-2.598-.473.473 2.597 2.595z"></path></svg>\n </div>')[0];return this.defaultButtons.indexOf("zoom")>-1&&(h.appendChild(c),c.onclick=function(){i.view._setZoomAndCenter({zoom:i.view._zoom+1,center:i.location})}),h.childNodes.length>0&&h.setAttribute("class","zondy-popup__footer zondy-popup__footer-division"),r.appendChild(a),r.appendChild(l),r.appendChild(h),r}_initDefaultUI(e,t){const i=document.createElement("div");i.setAttribute("class","zondy-popup");const r=document.createElement("div");r.setAttribute("class","zondy-popup__container");const n=this._contentUI(e,t);r.appendChild(n),i.appendChild(r);const a=document.createElement("div");return a.setAttribute("style","margin: auto;width: 40px;height: 20px;pointer-events: none;overflow: hidden;pointer-events: none;"),a.innerHTML="<div class='zondy-popup__tip' style='width: 17px;height: 17px;padding: 1px;margin: -10px auto 0;pointer-events: auto;transform: rotate(45deg);'>\n </div>",i.appendChild(a),i}_initDefaultClass(){let e=!1;const t=document.head.getElementsByTagName("style");if(t)for(let i=0;i<t.length;i++)if(t[i].innerHTML.indexOf("styleDomString")>-1){e=!0;break}if(!e){const e=document.createElement("style");e.innerHTML="\n .zondy-popup__container{background-color: #fff;padding:0;border-radius: 10px;}\n .zondy-popup__tip{\n background-color: #fff;\n }\n .zondy-popup__header{\n padding: 8px;\n font-size: 18px;\n font-weight: 600;\n line-height: 20px;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n white-space: nowrap;\n }\n .zondy-popup__content{\n padding: 8px;\n }\n .zondy-popup__footer{\n }\n .zondy-popup__footer-division{\n border-top: 1px solid;\n }\n .zondy-popup__toggle,.zondy-popup__close{\n display: inline-block;width: 30px;text-align: center;\n }\n ",document.querySelector("head").append(e)}}_getOffset(){let e=null;if(this._popup&&this._popup.style&&this._popup.style.html&&this.alignment){const t=this._popup.style.html.getBoundingClientRect(),i=this._getOffsetByAlignment(this.alignment,t.width,t.height);e=new L.Point(i.x,i.y)}return e}_getOffsetByAlignment(e,t,i){let r=0,n=0;switch(e){case"top-left":n=-i;break;case"top-center":r=-t/2,n=-i;break;case"top-right":r=-t,n=-i;break;case"bottom-left":break;case"auto":case"bottom-center":r=-t/2;break;case"bottom-right":r=-t}return{x:r,y:n}}close(){this._popup.remove()}destroy(){this._popupLayer&&this.view._innerView.remove(this._popupLayer)}};var bc=class extends n.LayerView{onAdd(){return Hl.addVectorTileLayer(this)}onRemove(){return Hl.removeLayer(this),Promise.resolve(this)}onUpdate(e){if(!this.innerLayer)return Promise.resolve(this);if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t],{params:r}=i;if(i)switch(i.name){case"setPaintProperties":case"setLayoutProperties":case"setStyleLayer":case"deleteStyleLayer":default:Hl.refresh(this);break;case"opacity":Hl.setOpacity(this,r[0]);break;case"visible":{const e=i.params&&i.params.length>0?i.params[0]:void 0;Hl.setVisible(this,e);break}case"clippingArea":Hl.setClipArea(this)}}return Promise.resolve(this)}};function _c(e,t,i){const r=th(e,i),n=i.imageryLayers.indexOf(t);if(n>=r){for(let e=0;e<n-r;e++)i.imageryLayers.lower(t);t._realIndex=e._realIndex+1}else{for(let e=0;e<r-n;e++)i.imageryLayers.raise(t);t._realIndex=e._realIndex+1}}var wc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{r.innerLayer=zr.addWMSLayer(t,i),r.innerLayer.alpha=t.opacity,r.innerLayer.show=r._getLayerViewVisible(),e(r)})}onRemove(e){return zr.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"spatialReference":zr.removeLayer(this.innerLayer,this.innerView),self.innerLayer=zr.addWMSLayer(this.layer,this.innerView);break;case"index":_c(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?sh(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"sublayerVisible":case"refresh":zr.removeLayer(this.innerLayer,this.innerView),this.innerLayer=zr.addWMSLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};var xc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{r.innerLayer=Ur.addWMTSLayer(t,i),r.innerLayer.alpha=t.opacity,r.innerLayer.show=r._getLayerViewVisible(),e(r)})}onRemove(e){return Ur.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":_c(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?sh(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction))}}return Promise.resolve(this)}};var Cc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return new Promise(e=>{this.innerLayer=Br.addIGSTileLayer(t,i),this.innerLayer.alpha=t.opacity,this.innerLayer.show=this._getLayerViewVisible(),e(this)})}onRemove(e){return Br.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(!this.innerLayer)return Promise.resolve(this);if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":_c(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?sh(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"refresh":Br.removeLayer(this.innerLayer,this.innerView),self.innerLayer=Br.addIGSTileLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};var Sc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return new Promise(e=>{this.innerLayer=dh.addIGSMapImageLayer(t,i),this.innerLayer.alpha=t.opacity,this._getLayerViewVisible()||(this.innerLayer.alpha=0),e(this)})}onRemove(e){return dh.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(!this.innerLayer)return Promise.resolve(this);if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.alpha=t?this.layer.opacity:0;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":_c(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?sh(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"refresh":dh.removeLayer(this.innerLayer,this.innerView),this.innerLayer=dh.addIGSMapImageLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};var Mc=class{static applyUpdate(e,t,i,r,a){if(r.updateContent)for(let e=0;e<r.updateContent.length;e++){const o=r.updateContent[e];if(o)switch(o.name){case"visible":switch(t.type){case n.LayerType.wms:case n.LayerType.igsMapImage:case n.LayerType.igsTile:case n.LayerType.m3d:case n.LayerType.scene:case n.LayerType.cesium3DTiles:case n.LayerType.m3dCache:const e=o.params&&o.params.length>0?o.params[0]:this.layer.visible,r=a._getLayerViewVisible(e);i.show=r}break;case"opacity":switch(t.type){case n.LayerType.wms:i.alpha=t.opacity;break;case n.LayerType.m3dCache:i.translucency=t.opacity;break;case n.LayerType.cesium3DTiles:i.style=new Cesium.Cesium3DTileStyle,i.style.color={evaluateColor(e,i){if(i)return i.alpha=t.opacity,i}}}}}if(!i)return;let o=!1;switch(t.type){case n.LayerType.igsVectorTile:i.updateStyle(t.style),o=!0}if(r.extend&&r.extend.type){switch(r.extend.type){case n.LayerEventType.layerUpdateOpacity:switch(t.type){case n.LayerType.igsMapImage:case n.LayerType.igsTile:i.alpha=t.opacity,o=!0;break;case n.LayerType.m3d:case n.LayerType.scene:case n.LayerType.cesium3DTiles:(i=e._innerView.scene.layers.getLayer(t.layerIndex)).translucency=t.opacity}break;case n.LayerEventType.layerUpdateVisible:switch(t.type){case n.LayerType.igsMapImage:case n.LayerType.igsTile:case n.LayerType.m3d:case n.LayerType.scene:case n.LayerType.cesium3DTiles:i.show=!i.show,o=!0}break;case n.LayerEventType.layerUpdateStyle:switch(t.type){case n.LayerType.igsVectorTile:i.updateStyle(t.style),o=!0}break;case n.LayerEventType.layerSublayerVisible:switch(t.type){case n.LayerType.igsMapImage:i._imageryProvider._layers=t.layers,o=!0}}return o?new Promise(e=>{e()}):null}}};var kc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return this._getLayerViewVisible(),new Promise(e=>{Xl.addM3DLayer(t,i,this.view,t=>{this.innerLayer=t,e(r)})})}onRemove(e){return Xl.removeLayer(this.innerLayer,this.innerView,this.view),Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return Mc.applyUpdate(this.view,this.layer,t,e,this),Promise.resolve(this)}};var Tc=class extends n.LayerView{onAdd(e){return new Promise(e=>{yh.addCesium3DTilesLayer(this,t=>{this.innerLayer=t,e(this)})})}onRemove(e){return yh.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return Mc.applyUpdate(this.view,this.layer,t,e,this),Promise.resolve(this)}};var Ic=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return this._getLayerViewVisible(),new Promise(e=>{Jl.addTerrainCacheLayer(t,i,t=>{this.innerLayer=t,e(r)})})}onRemove(e){return Jl.removeLayer(this.layer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":Jl.setOpacity(this.layer,this.innerView)}}return Promise.resolve(this)}};class Oc{}Oc.addEchartsLayer=function(e){const{layer:t,innerView:i}=e,r=e._getLayerViewVisible(t.visible);let n=Object.assign({},t.echartsOptions);n.visible=r,n.opacity=t.opacity;const{extensionOptions:a={}}=t;n=Object.assign(n,a);const o=new yc(i,n).addTo(i);return o.id=t.id,o},Oc.removeLayer=function(e){e.remove()};var Ec=Oc;var Lc=class extends n.LayerView{onAdd(e){return this.innerLayer=Ec.addEchartsLayer(this),Promise.resolve(this)}onRemove(e){return Ec.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible;this._getLayerViewVisible(e)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity);break;case"refresh":Ec.removeLayer(this.innerLayer),this.innerLayer=Ec.addEchartsLayer(this)}}return Promise.resolve(this)}};var Pc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this._getLayerViewVisible();return this.innerLayer=Ch.addMapVLayer(t,i),r||this.innerLayer.hide(),Promise.resolve(this)}onRemove(e){return Ch.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible;this._getLayerViewVisible(e)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity)}}return Promise.resolve(this)}};var Rc=class extends n.GroupLayerView{};var jc=class extends n.BaseGraphicsLayerView{onAdd(e){const t=this.layer,i=this.innerView,r=t.graphics||[];return this._getLayerViewVisible(),this.innerLayer=new sc({id:t.id,viewer:i,opacity:t.opacity,elevationInfo:t.elevationInfo}),this.innerLayer.addPrimitives(),this.render.drawFeature(this.innerLayer,r),Promise.resolve(this)}onRemove(e){return this.innerLayer.destroy(),this.innerLayer=null,Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return e.updateContent&&t&&e.updateContent.forEach(e=>{if(e&&"property"===e.operationType)switch(e.name){case"opacity":{const i=e.params;t.setOpacity&&t.setOpacity(i[0]);break}case"visible":{const i=e.params&&e.params.length>0?e.params[0]:void 0,r=this._getLayerViewVisible(i);t.setVisible&&t.setVisible(r);break}}if(e&&"method"===e.operationType)switch(e.name){case"add":this.render.drawFeature(t,[e.params[0]]);break;case"remove":{const i=e.params;t.remove(i[0]);break}case"addMany":this.render.drawFeature(t,e.params[0]);break;case"removeMany":e.params[0].forEach(e=>{t.remove(e)});break;case"removeAll":t.removeAll()}}),Promise.resolve(this)}};var Ac=class extends n.BaseFeatureLayerView{constructor(e){super(e),this._labelClass=null}_processData(){return new Promise(e=>{e()})}onAdd(e){const t=this,i=this.innerView,r=this.layer,a=this.layer.renderer;return this._processData().then(e=>new Promise(o=>{if(t.innerLayer&&t.innerLayer.destroy(),a instanceof n.ClusterRenderer){t.innerLayer=new ec({id:r.id,viewer:i,renderer:a});const o=Object(n.getFeaturesFromFeatureSet)(e);for(let e=0;e<o.length;e++)o[e].symbol=n.Symbol.fromJSON(a.defaultSymbol.toJSON());for(let e=0;e<o.length;e++)t.innerLayer.add(o[e])}else if(a instanceof n.HeatmapRenderer)t.innerLayer=new tc({id:r.id,viewer:i,field:a.field,valueExpression:a.valueExpression,radius:a.radius,alpha:r.opacity,gradient:a.colorStops,minDataValue:a.minDataValue,maxDataValue:a.maxDataValue,features:Object(n.getFeaturesFromFeatureSet)(e)});else{const o=this._getLayerViewVisible()?t.layer.opacity:0;if(t.innerLayer=new sc({id:r.id,viewer:i,opacity:o,elevationInfo:t.layer.elevationInfo}),t.innerLayer.addPrimitives(),e.features.length>0&&!e.features[0].geometry.spatialReference.isGeographic)for(let t=0;t<e.features.length;t++)e.features[t].geometry=n.Projection.project(e.features[t].geometry,new n.SpatialReference({wkid:4326}));t._initFeatures(e,a)}t._initDynamicLabel(e||{}),o(t)}))}_initDynamicLabel(e){const{innerView:t}=this,{labelingInfo:i,labelsVisible:r}=this.layer;r&&Array.isArray(i)&&i.length>0&&(this._dynamicLabelLayer=new gr({labelingInfo:i,scene:t.scene,visible:this.layer.visible&&r,opacity:this.layer.opacity}),this._dynamicLabelLayer.add(e.features||[]))}onRemove(e){return this._dynamicLabelLayer&&(this._dynamicLabelLayer.destroyed(),this._dynamicLabelLayer=null),this.innerLayer.destroy(),this.innerLayer=null,Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return e.updateContent&&t&&e.updateContent.forEach(i=>{if(i&&"property"===i.operationType)switch(i.name){case"opacity":{const e=i.params;t.setOpacity&&(t.setOpacity(e[0]),this._dynamicLabelLayer&&(this._dynamicLabelLayer.translucency=e[0]));break}case"visible":{const e=i.params&&i.params.length>0?i.params[0]:void 0,r=this._getLayerViewVisible(e);this._dynamicLabelLayer&&(this._dynamicLabelLayer.show=r),t.setVisible&&t.setVisible(r);break}case"renderer":this.onAdd(e)}if(i&&"method"===i.operationType)switch(i.name){case"refresh":this.onAdd(e)}}),Promise.resolve(this)}};var zc=class extends Ac{_processData(){const e=this.layer,t=e._createQueryOption();return t.resultRecordCount=1e5,e.queryFeatures(t).then(e=>e)}onAdd(e){const t=this,i=this.layer,r=this.innerView;if("server"===i.renderMode){let e;e=i.spatialReference?eh(i.spatialReference,i.extent):new Cesium.GeographicTilingScheme({rectangle:Cesium.Rectangle.fromDegrees(-180,-90,180,90),ellipsoid:Cesium.Ellipsoid.WGS84,numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1});const a=i.url,o=Object(n.getBaseUrl)(a);let s;return s="1.0"===i._igsVersion?{url:`${o}/igs/rest/mrms/layers`,gdbps:[i.gdbp],tilingScheme:e,filters:i.definitionExpression?`0:${i.definitionExpression}`:""}:{url:`${o}/igs/rest/services/system/ResourceServer/tempData`,gdbps:[i.gdbp],tilingScheme:e,filters:i.definitionExpression?`0:${i.definitionExpression}`:""},this.innerLayer=r.imageryLayers.addImageryProvider(new Cesium.MapGISMapServerImageryProvider(s)),this.innerLayer.alpha=i.opacity,this.innerLayer.show=this._getLayerViewVisible(),Promise.resolve(t)}return super.onAdd(e)}onRemove(e){const t=this;return this.layer.gdbp?(this.innerView.imageryLayers.remove(this.innerLayer),Promise.resolve(t)):super.onRemove(e)}};var Dc=class extends Ac{_processData(){return this.layer.queryFeatures()}onUpdate(e){let t=!1;return e.updateContent&&this.innerLayer&&e.updateContent.forEach(i=>{i&&"property"===i.operationType&&("renderer"===i.name?(super.onRemove(e),super.onAdd(e)):t=!0)}),t&&super.onUpdate(e),Promise.resolve(this)}};var Vc=class extends Ac{_processData(){return this.layer.queryFeatures().then(e=>e)}onUpdate(e){let t=!1;return e.updateContent&&this.innerLayer&&e.updateContent.forEach(i=>{i&&"property"===i.operationType&&("renderer"===i.name?(super.onRemove(e),super.onAdd(e)):t=!0)}),t&&super.onUpdate(e),Promise.resolve(this)}};var Nc=class extends n.LayerView{onAdd(e){return new Promise(e=>{Xl.addM3DLayer(this,t=>{this.innerLayer=t,e(this)})})}onRemove(e){return Xl.removeLayer(this.innerLayer,this.innerView,this.view),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.translucency=this.layer.opacity;break;case"renderer":const r=i.params[0];this.innerLayer.renderer=rh(r)}}return Promise.resolve(this)}};var Gc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return new Promise(e=>{this.innerLayer=jr.addArcGISMapImageLayer(t,i),this.innerLayer.alpha=t.opacity,this.innerLayer.show=this._getLayerViewVisible(),e(this)})}onRemove(e){return jr.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":_c(this.layer,this.innerLayer,this.innerView)}}return Promise.resolve(this)}};var Fc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return new Promise(e=>{this.innerLayer=Vr.addArcGISTileLayer(t,i),this.innerLayer.alpha=t.opacity,this.innerLayer.show=this._getLayerViewVisible(),e(this)})}onRemove(e){return Vr.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":_c(this.layer,this.innerLayer,this.innerView)}}return Promise.resolve(this)}};var Bc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{r.innerLayer=Ql.addWebTileLayer(t,i),r.innerLayer.alpha=t.opacity,this.innerLayer.show=this._getLayerViewVisible(),e(r)})}onRemove(e){return Ql.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":_c(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?sh(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"refresh":Ql.removeLayer(this.innerLayer,this.innerView),self.innerLayer=Ql.addIGSTileLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};function qc(e){const t=n.Feature.fromJSON(e);return t.geometry.spatialReference.isGeographic||(t.geometry=n.Projection.project(t.geometry,new n.SpatialReference({wkid:4326}))),t}function Uc(e){const t=[];if(e instanceof n.FeatureSet)for(let i=0;i<e.features.length;i++)t.push(qc(e.features[i]));else if(e instanceof n.FeatureCollection)e.forEach(e=>{t.push(qc(e))});else for(let i=0;i<e.length;i++)t.push(qc(e[i]));return t}var Wc=class extends n.FeatureRender{drawFeature(e,t){const i=Uc(t);if(e)for(let t=0;t<i.length;t++)e.add(i[t])}updateFeature(e,t,i){const r=Uc(t);if(e)for(let t=0;t<r.length;t++)e.update(r[t])}clearFeature(e,t){if(e)for(let i=0;i<t.length;i++)e.remove(t[i])}clear(e){e&&e.removeAll()}};var Hc=function(e){Hc.instance={tokenKey:e.tokenKey,tokenValue:e.tokenValue,headers:e.headers,request:e.request}},Yc=Hc;class Xc extends n.SceneView{constructor(e){super(e),e=Object(n.defaultValue)(e,{}),this._center=Object(n.defaultValue)(e.center,new n.Point({coordinates:[0,0]})),this._center&&Array.isArray(this._center)&&this._center.length>1&&(this._center=new n.Point({coordinates:[this._center[0],this._center[1],this._center[2]]})),this._scale=Object(n.defaultValue)(e.scale,void 0),this._zoom=Object(n.defaultValue)(e.zoom,3),this.minZoom=Object(n.defaultValue)(e.minZoom,void 0),this.maxZoom=Object(n.defaultValue)(e.maxZoom,void 0),this._extent=Object(n.defaultValue)(e.extent,void 0),this.width=void 0,this.height=void 0,this._spatialReference=new n.SpatialReference("EPSG:4326"),this.popup=Object(n.defaultValue)(e.popup,void 0),this.stationary=!0,this.engineType="cesium",this._innerView=Object(n.defaultValue)(e.innerView,void 0),this._innerView||(this._innerView=new Cesium.Viewer(this._viewId,this.extensionOptions)),Yc(n.Config),this._initSize(),this._extent?this._initExtent():(this._initScale(),this._initZoom()),this._initViewEvent(),this._initPopup(),this._map._initCesiumView=!0,this._showLayerByScale()}_initViewEvent(){const e=this;this._clickStore=null,this._dragParams={isDrag:!1,origin:null,action:"",button:null},this._screenSpaceEventHandler=new Cesium.ScreenSpaceEventHandler(this._innerView.scene.canvas),this.fire(n.ViewEventType.loaded,{}),this._screenSpaceEventHandler.setInputAction(t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(n.ViewEventType.click,fh.getMouseEvent(t,e))},300),e.fire(n.ViewEventType.immediateClick,fh.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.LEFT_CLICK),this._screenSpaceEventHandler.setInputAction(t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(n.ViewEventType.click,fh.getMouseEvent(t,e))},300),e.fire(n.ViewEventType.immediateClick,fh.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.RIGHT_CLICK),this._screenSpaceEventHandler.setInputAction(t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(n.ViewEventType.click,fh.getMouseEvent(t,e))},300),e.fire(n.ViewEventType.immediateClick,fh.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.MIDDLE_CLICK),this._screenSpaceEventHandler.setInputAction(t=>{e._clickStore&&(clearTimeout(e._clickStore),e._clickStore=null),e.fire(n.ViewEventType.doubleClick,fh.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerDown,fh.getMouseEvent(t,e)),this._dragParams.isDrag||(t.originalEvent&&(this._dragParams.origin={x:t.originalEvent.layerX,y:t.originalEvent.layerY},this._dragParams.button=t.originalEvent.button),this._dragParams.action="mouse-down",this._dragParams.isDrag=!1)},Cesium.ScreenSpaceEventType.LEFT_DOWN),this._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerUp,fh.getMouseEvent(t,e)),e._dragParams.isDrag&&"update"===this._dragParams.action&&(this._dragParams.action="end",e.fire(n.ViewEventType.drag,fh.getDragEvent(t,e,e._dragParams.origin,this._dragParams.action))),e._dragParams={isDrag:!1,origin:null,action:"",button:null}},Cesium.ScreenSpaceEventType.LEFT_UP),this._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerDown,fh.getMouseEvent(t,e)),this._dragParams.isDrag||(t.originalEvent&&(this._dragParams.origin={x:t.originalEvent.layerX,y:t.originalEvent.layerY},this._dragParams.button=t.originalEvent.button),this._dragParams.action="mouse-down",this._dragParams.isDrag=!1)},Cesium.ScreenSpaceEventType.RIGHT_DOWN),this._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerUp,fh.getMouseEvent(t,e)),e._dragParams.isDrag&&"update"===this._dragParams.action&&(this._dragParams.action="end",e.fire(n.ViewEventType.drag,fh.getDragEvent(t,e,e._dragParams.origin,this._dragParams.action))),e._dragParams={isDrag:!1,origin:null,action:"",button:null}},Cesium.ScreenSpaceEventType.RIGHT_UP),this._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerDown,fh.getMouseEvent(t,e)),this._dragParams.isDrag||(t.originalEvent&&(this._dragParams.origin={x:t.originalEvent.layerX,y:t.originalEvent.layerY},this._dragParams.button=t.originalEvent.button),this._dragParams.action="mouse-down",this._dragParams.isDrag=!1)},Cesium.ScreenSpaceEventType.MIDDLE_DOWN),this._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerUp,fh.getMouseEvent(t,e)),e._dragParams.isDrag&&(this._dragParams.action="end",e.fire(n.ViewEventType.drag,fh.getDragEvent(t,e,e._dragParams.origin,this._dragParams.action)),e._dragParams={isDrag:!1,origin:null,action:"",button:null})},Cesium.ScreenSpaceEventType.MIDDLE_UP),this._screenSpaceEventHandler.setInputAction(t=>{t.position=t.endPosition,e.fire(n.ViewEventType.pointerMove,fh.getMouseEvent(t,e)),e._dragParams.isDrag?(e.fire(n.ViewEventType.drag,fh.getDragEvent(t,e,e._dragParams.origin,e._dragParams.action,e._dragParams.button)),e._dragParams.action="update"):"mouse-down"===this._dragParams.action&&(this._dragParams.action="start",e._dragParams.isDrag=!0)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this._innerView.camera.moveEnd.addEventListener(t=>{e._cameraMoveEndHandler(),e.fire(n.ViewEventType.viewChange,fh.getViewChangeEvent(t,e))}),this._innerView.camera.moveStart.addEventListener(()=>{e.stationary=!1}),this._innerView.camera.moveEnd.addEventListener(()=>{e.stationary=!0}),this._listenResize(),this._listenKey()}_listenResize(){const e=this;this._lastSize=this.getSize(),new ResizeObserver(t=>{const i=t.length>0?{x:t[0].contentRect.width,y:t[0].contentRect.height}:{width:null,height:null};e.fire(n.ViewEventType.resize,{oldWidth:e._lastSize.x,oldHeight:e._lastSize.y,width:i.x,height:i.y}),this._lastSize=i}).observe(this._innerView._container)}_listenKey(){const e=this,t=this._innerView.canvas;t.setAttribute("tabIndex","-1"),t.onclick=(()=>{t.focus()}),t.addEventListener("keydown",t=>{e.fire(n.ViewEventType.keyDown,fh.getKeyEvent(t,e))}),t.addEventListener("keyup",t=>{e.fire(n.ViewEventType.keyUp,fh.getKeyEvent(t,e))})}_mapActionControl(e,t){"drag-pan"===e&&(this._innerView.scene.screenSpaceCameraController.enableRotate=t)}flyTo(e){e=Object(n.defaultValue)(e,{});const t=Object(n.defaultValue)(e.duration,2),i=Object(n.defaultValue)(e.orientation,void 0),r=Object(n.defaultValue)(e.cancel,void 0),a=Object(n.defaultValue)(e.endTransform,void 0),o=Object(n.defaultValue)(e.maximumHeight,void 0),s=Object(n.defaultValue)(e.flyOverLongitude,void 0),l=Object(n.defaultValue)(e.flyOverLongitudeWeight,void 0),h=Object(n.defaultValue)(e.convert,void 0),c=Object(n.defaultValue)(e.easingFunction,void 0),u=this._getFlyToCenter(e),d=this._getFlyToExtent(e),p=function(t){e.complete instanceof Function&&e.complete(t)};Object(n.isNull)(u)?Object(n.isNull)(d)||this._innerView.camera.flyTo({destination:Cesium.Rectangle.fromDegrees(d.xmin,d.ymin,d.xmax,d.ymax),duration:t,orientation:i,complete:p,cancel:r,endTransform:a,maximumHeight:o,flyOverLongitude:s,flyOverLongitudeWeight:l,convert:h,easingFunction:c}):this._innerView.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(u.coordinates[0],u.coordinates[1],u.coordinates[2]),duration:t,orientation:i,complete:p,cancel:r,endTransform:a,maximumHeight:o,flyOverLongitude:s,flyOverLongitudeWeight:l,convert:h,easingFunction:c})}goTo(e={},t={}){let i,r,a=new Promise(e=>{e()});if(this._innerView){let o;if(Object(n.isNull)(e.center)&&Object(n.isNull)(e.zoom)&&Object(n.isNull)(e.scale)||(i=Object(n.isNull)(e.center)?this._center:this._getFlyToCenter({center:e.center}),r=!Object(n.isNull)(e.scale)&&e.scale>0?this._getZoomByScale(e.scale):!Object(n.isNull)(e.zoom)&&e.zoom>0?e.zoom:this._zoom),!Object(n.isNull)(e.target)){const t=this._getTargetExtent(e.target);t.xmin!==t.xmax&&t.ymin!==t.ymax?o=t:i=this._getFlyToCenter({center:new n.Point({coordinates:[t.xmin,t.ymin]})})}const s={animate:!0,duration:.2};let l;if(Object(n.isNull)(t)||(Object(n.isNull)(t.animate)||(s.animate=t.animate),Object(n.isNull)(t.duration)||(s.duration=t.duration/1e3),Object(n.isNull)(t.orientation)||(s.orientation=t.orientation)),Object(n.isNull)(i))Object(n.isNull)(o)||(l=Cesium.Rectangle.fromDegrees(o.xmin,o.ymin,o.xmax,o.ymax));else{let e;e=r?this._getAltitudeByZoom(r):void 0!==i.coordinates[2]?i.coordinates[2]:this._getAltitudeByZoom(this._zoom),l=Cesium.Cartesian3.fromDegrees(i.coordinates[0],i.coordinates[1],e)}l&&(a=new Promise(e=>{const t={destination:l,complete:function(){e()}};Object.assign(t,s),this._innerView.camera.flyTo(t)}))}return a}_createLayerView(e){let t=null;return e&&e.autoAddTo3D&&(t=function(e,t){let i=null;switch(t.type){case n.LayerType.vectorTile:case n.LayerType.igsVectorTile:case n.LayerType.arcgisVectorTile:i=new bc({view:e,layer:t});break;case n.LayerType.wmts:i=new xc({view:e,layer:t});break;case n.LayerType.igsMapImage:i=new Sc({view:e,layer:t});break;case n.LayerType.igsTile:i=new Cc({view:e,layer:t});break;case n.LayerType.wms:i=new wc({view:e,layer:t});break;case n.LayerType.m3d:i=new kc({view:e,layer:t});break;case n.LayerType.cesium3DTiles:i=new Tc({view:e,layer:t});break;case n.LayerType.scene:i=new xr({view:e,layer:t});break;case n.LayerType.terrain:i=new Ic({view:e,layer:t});break;case n.LayerType.echarts:i=new Lc({view:e,layer:t});break;case n.LayerType.mapv:i=new Pc({view:e,layer:t});break;case n.LayerType.group:i=new Rc({view:e,layer:t});break;case n.LayerType.graphics:i=new jc({view:e,layer:t,render:new Wc});break;case n.LayerType.igsFeature:i=new zc({view:e,layer:t,render:new Wc});break;case n.LayerType.geojson:i=new Dc({view:e,layer:t,render:new Wc});break;case n.LayerType.wfs:i=new Vc({view:e,layer:t,render:new Wc});break;case n.LayerType.m3dCache:i=new Nc({view:e,layer:t});break;case n.LayerType.arcgisMapImage:i=new Gc({view:e,layer:t});break;case n.LayerType.arcgisTile:i=new Fc({view:e,layer:t});break;case n.LayerType.webTileLayer:i=new Bc({view:e,layer:t})}return i}(this,e)),t}toJSON(){return super.toJSON()}toMap(e){let t=null;const i=new Cesium.Cartesian2(e.x,e.y);if(this._innerView.scene.globe.translucency.enabled||!this._innerView.scene.globe.depthTestAgainstTerrain){const e=this._innerView.camera.getPickRay(i);t=this._innerView.scene.globe.pick(e,this._innerView.scene)}else i.y=i.y+1,t=this._innerView.scene.pickPosition(i);let r=null;if(t&&!Object(n.isNull)(t)){const e=this._innerView.scene.globe.ellipsoid.cartesianToCartographic(t),i=Cesium.Math.toDegrees(e.longitude),a=Cesium.Math.toDegrees(e.latitude),o=e.height;r=new n.Point({coordinates:[i,a,o]})}return r}toScreen(e){const t=Cesium.Cartesian3.fromDegrees(e.coordinates[0],e.coordinates[1],e.coordinates[2]);return Cesium.SceneTransforms.wgs84ToWindowCoordinates(this._innerView.scene,t)}getSize(){return{x:this._innerView._container.clientWidth,y:this._innerView._container.clientHeight}}getCenter(){const e=Cesium.Cartographic.fromCartesian(this._innerView.camera.position),t=Cesium.Math.toDegrees(e.longitude),i=Cesium.Math.toDegrees(e.latitude),r=e.height,a=new n.Point({coordinates:[t,i,r]});return this._center=a,a}setCenter(e){if(!this._innerView||!this._center)return;let t=!1;const i=this._center.coordinates[2];Array.isArray(e)&&e.length>1?(this._center=new n.Point({coordinates:[e[0],e[1],i]}),t=!0):e instanceof n.Point&&(this._center=new n.Point({coordinates:[e.coordinates[0],e.coordinates[1],i]}),t=!0),t&&this.flyTo({center:this._center})}getExtent(){if(!this._innerView)return;const e=this._innerView.camera.computeViewRectangle();let t;return t=e?new n.Extent({xmin:e.west/Math.PI*180,ymin:e.south/Math.PI*180,xmax:e.east/Math.PI*180,ymax:e.north/Math.PI*180}):new n.Extent({xmin:-180,ymin:-90,xmax:180,ymax:90}),this._extent=t,t}setExtent(e){this._innerView&&(this._extent=e,this.flyTo({extent:e}))}getInnerLayer(e){if(e instanceof n.Layer)return super.getInnerLayer(e);if(e instanceof n.IGSSceneSubLayer){const t=super.getInnerLayer(e.layer);for(let i=0;i<t.length;i++)if(t[i]._layerIndex===e.layerIndex)return t[i]}}_initPopup(){this.popup=new vc({view:this})}hitTest(e){const t=[];return this._innerView.scene.drillPick({x:e.x,y:e.y}).forEach(i=>{if(i.primitive){const r=i.primitive,a=this.getLayer(r.commonLayerId);if(Object(n.isNull)(r.commonLayerId))return;let o=null;if(a.type===n.LayerType.igsFeature||a.type===n.LayerType.geojson){o=this._getLayerView(a)._featureSetCache.filter(e=>{if(e.id===r.commonFeatureId)return e})}else a.type===n.LayerType.graphics&&(o=a.graphics.filter(e=>{if(e.id===r.commonFeatureId)return e}));const s={graphic:o&&o.items.length>0?o.items[0]:null,layer:a,mapPoint:this.toMap(e),type:"graphic"};t.push(s)}}),t}_cameraMoveEndHandler(){this.getCenter(),this.getExtent(),this.getZoom(),this.getScale(),this._showLayerByScale()}_initSize(){const e=this._innerView.canvas;this.width=e.width,this.height=e.height}_setCursor(e){this._innerView&&(e&&null!==e?(this._innerView._container.style.cursor=e,this._innerView.canvas.style.cursor=e):(this._innerView._container.style.removeProperty("cursor"),this._innerView.canvas.style.removeProperty("cursor")),this._cursor=e)}_initScale(){if(this.scale&&this._center){const e=this._getZoomByScale(this.scale),t=this._getAltitudeByZoom(e);if(t){this.zoom=e;const i=this._center.coordinates[0],r=this._center.coordinates[1];this._center=new n.Point({coordinates:[i,r,t]}),this.flyTo({center:this._center})}}}_initZoom(){if(!this.scale&&!Object(n.isNull)(this._zoom)&&this._center&&this._center.coordinates[2]){const e=this._getZoomByAltitude(this._center.coordinates[2]),t=this._getAltitudeByZoom(this._zoom);if(t){this._zoom=e,this.scale=this._getScaleByZoom(this.zoom);const i=this._center.coordinates[0],r=this._center.coordinates[1];this._center=new n.Point({coordinates:[i,r,t]}),this.flyTo({center:this._center})}}if(this.maxZoom){const e=this._getAltitudeByZoom(this.maxZoom);this._innerView.scene.screenSpaceCameraController.minimumZoomDistance=e}if(this.minZoom){const e=this._getAltitudeByZoom(this.minZoom);this._innerView.scene.screenSpaceCameraController.maximumZoomDistance=e}}_initExtent(){this.flyTo({extent:this._extent})}getZoom(){const e=this._getZoomByAltitude(this._center.coordinates[2]);this._zoom=e}setZoom(e){if(this._innerView&&!Object(n.isNull)(this._zoom)&&this._center){const t=this._getAltitudeByZoom(e);if(t){this._zoom=e;const i=this._center.coordinates[0],r=this._center.coordinates[1],a=new n.Point({coordinates:[i,r,t]});this.flyTo({center:a})}}}_setZoomAndCenter(e){if(this._innerView&&!Object(n.isNull)(e.zoom)&&!Object(n.isNull)(e.center)){const t=e.center.coordinates[0],i=e.center.coordinates[1],r=this._getAltitudeByZoom(e.zoom);if(r){this._zoom=e.zoom;const a=new n.Point({coordinates:[t,i,r]});this._center=a,this.flyTo({center:a})}}}getScale(){const e=this._getScaleByZoom(this._zoom);return this._scale=e,e}setScale(e){if(this._innerView&&this._scale&&this._center){this._scale=e;const t=this._getZoomByScale(e),i=this._getAltitudeByZoom(t);if(i){const e=this._center.coordinates[0],t=this._center.coordinates[1],r=new n.Point({coordinates:[e,t,i]});this.flyTo({center:r})}}}_getZoomByScale(e){const t=e/(96/.0254);return Math.round(Math.log2(156543.03392804062/t))}_getScaleByZoom(e){return 96/.0254*(156543.03392804062/Math.pow(2,e))}takeScreenshot(e){e.view=this;let t=null;return this._screenshot?t=this._screenshot._addView():(this._screenshot=new gc(e),t=this._screenshot._addView()),t}_getZoomByAltitude(e){const t=-40467.74;return Math.round(t+80955.31/(1+Math.pow(e/91610.74,7096758e-11)))}_getAltitudeByZoom(e){const t=-40467.74;return 91610.74*Math.pow(80955.31/(e-t)-1,1/7096758e-11)}_moveLayerView(e,t){let i=t;const r=e.innerView;let n,a;if(e instanceof jc||e instanceof Dc||e instanceof zc||e instanceof Vc||t instanceof jc||t instanceof Dc||t instanceof zc||t instanceof Vc){n=r.scene._primitives._primitives.indexOf(e.innerLayer._allPrimitives);let t=(a=r.scene._primitives._primitives.indexOf(i.innerLayer._allPrimitives))-n;if(t>1)for(let i=0;i<t-1;i++)r.scene._primitives.raise(e.innerLayer._allPrimitives);else if(t<0){t=Math.abs(t);for(let e=0;e<t;e++)r.scene._primitives.raise(i.innerLayer._allPrimitives)}}else if(!(e instanceof jc||e instanceof Dc||e instanceof zc||e instanceof Vc||t instanceof jc||t instanceof Dc||t instanceof zc||t instanceof Vc)&&this._isLayerViewSupportReorder(e)){if(!this._isLayerViewSupportReorder(t)){const e=this.allLayerViews.toArray();for(let r=this.allLayerViews.indexOf(t)+1;r<e.length;r++)if(this._isLayerViewSupportReorder(e[r])){i=e[r];break}}n=r.imageryLayers.indexOf(e.innerLayer);let o=(a=r.imageryLayers.indexOf(i.innerLayer))-n;if(o>1)for(let t=0;t<o-1;t++)r.imageryLayers.raise(e.innerLayer);else if(o<0){o=Math.abs(o);for(let e=0;e<o;e++)r.imageryLayers.raise(i.innerLayer)}}}}Xc.fromJSON=function(e){return e=Object(n.defaultValue)(e,{}),new Xc(e)},Object.defineProperties(Xc.prototype,{scale:{get(){return this._scale},set(e){this.setScale(e)}},zoom:{get(){return this._zoom},set(e){this.setZoom(e)}},center:{get(){return this._center},set(e){this.setCenter(e)}},extent:{get(){return this._extent},set(e){this.setExtent(e)}},spatialReference:{get(){return this._spatialReference},set(e){this._spatialReference=e}}});var $c=Xc;var Jc=class extends n.SketchEditor3D{constructor(e){super(e),this.arcType=Object(n.defaultValue)(e.arcType,n.ArcType.rhumb)}addVertex(e,t){return this._getHight&&(e.coordinates[2]=this._getHight()),this._drawTool.addVertex(e,t)}updateVertex(e,t){return this._getHight&&(e.coordinates[2]=this._getHight()),this._drawTool.updateVertex(e,t)}removeVertex(e){return this._drawTool.removeVertex(e)}split(e,t){return super.split(e,t)}drawPolylineToPolygon(e){super.drawPolylineToPolygon(e)}_initLayerEvent(){}_hitTestSketchEvent(){const e=this,t=t=>{if(!t||!t.x||!t.y)return;if(e._drawTool&&e._drawTool._editMode===n.SketchEditMode.DRAWING)return;let i=void 0,r=!1;if(e._drawTool&&e._drawTool.sketchStage&&e._drawTool.sketchStage.selectBoxGraphics.length>0&&e.view._innerView.scene.drillPick({x:t.x,y:t.y}).forEach(n=>{if(n.primitive&&(e._layer&&e._layer.id===n.primitive.commonLayerId||e._sketchInnerLayer.id===n.primitive.commonLayerId)&&e._drawTool.sketchStage.entityGraphic.id===n.primitive.commonFeatureId){const a=e.view._innerView.camera.getPickRay({x:t.x,y:t.y}),o=e.view._innerView.scene.pickFromRay(a,[n.primitive]);o&&o.object&&o.object.primitive&&(r=!0,i=o.object)}}),r||(i=e.view._innerView.scene.pick({x:t.x,y:t.y})),i&&i.primitive&&(e._layer&&e._layer.id===i.primitive.commonLayerId||e._sketchInnerLayer.id===i.primitive.commonLayerId)){let r=e._drawTool?e._drawTool._getDrawToolByFeatureId(i.primitive.commonFeatureId):void 0;if(!r&&(!e._drawTool||e._drawTool.sketchStage.entityGraphic&&"drawn"===e._drawTool.state)){const t=e.view.getLayer(i.primitive.commonLayerId).graphics.filter(e=>{if(e.id===i.primitive.commonFeatureId)return e});if(!(t&&t.items.length>0))return;{const i=t.items[0];e._drawTool&&e._drawTool._clearEditGraphics(e._drawTool._editMode),this._addFeatureToSketchEditor(i),e._undoRedoManager.reset(),e._drawTools=[e._drawTool],r=e._drawTool}}if(!r||r===e._drawTool&&"drawn"!==r.state)return;if(0===r.editOption._hitTestMode){const i=()=>{if(e._editable&&(void 0===e._drawTool||null===e._drawTool||3!==e._drawTool._editMode)){if(r.hitTestFeature(r.sketchStage.entityGraphic,t),void 0!==e._drawTool&&null!==e._drawTool&&(e.fire("selected",{isSelected:!0,selectedDrawTool:e._drawTool,selectedGeometry:e._drawTool.sketchStage.entityGraphic.geometry},e),!r._parent&&0===r._editMode)){const t=new n.SketchEditorEvent({type:n.SketchEditorEventType.update,target:e,toolEventInfo:null,state:n.SketchEditorState.start,feature:e._drawTool.sketchStage.entityGraphic,geometry:e._drawTool.sketchStage.entityGraphic.geometry});e.fire(n.SketchEditorEventType.update,t)}e.view.off(n.ViewEventType.mouseUp,i)}};e.view.on(n.ViewEventType.mouseUp,i)}else{if(!e._editable)return;if(void 0!==e._drawTool&&null!==e._drawTool&&3===e._drawTool._editMode)return;r.hitTestFeature(r.sketchStage.entityGraphic,t)}}};this._hitTestSketchHandler||(this.view.on(n.ViewEventType.mouseDown,t),this._hitTestSketchHandler=t)}_getCenterCoordinate(e,t,i){let r;return 2===(i=void 0!==i?i:this.arcType)&&(r=Pi.a.calcRhumbArcCenter(e,t)),r=1===i?Pi.a.calcCartesianArcCenter(e,t):[(e[0]+t[0])/2,(e[1]+t[1])/2]}_getHight(){return 0}};var Kc=class{static async fromUrl(e,t){const i=new n.ArcGISTileLayer({url:e}),r=await i.load(),a=Vr.initializeOptions(r);return new Cesium.UrlTemplateImageryProvider({...a,...t})}};var Zc=class{static async fromUrl(e,t){const i=new n.WMSLayer({url:e}),r=await i.load(),a=zr.initializeOptions(r);return new Cesium.WebMapServiceImageryProvider({...a,...t})}};var Qc=class{static async fromUrl(e,t={}){t=Object(n.defaultValue)(t,{});const i=new n.WMTSLayer({url:e}),r=await i.load(),a=Ur.initializeOptions(r),o=new Cesium.WebMapTileServiceImageryProvider({...a,...t});return o.isStretchImage=Object(n.defaultValue)(t.isStretchImage,!1),o}};var eu=class extends Ul{static async fromUrl(e,t){const i=new n.ArcGISVectorTileLayer({url:e}),r=await i.load(),a=Hl.initializeOptions(r);return new Ul({...a,...t})}};var tu=class{static fromUrl(e,t){const i=new n.M3DModelCacheLayer({url:e}),r=Xl.initializeOptions(i);return(t||t.viewer)&&(r._scene=t.viewer.scene),new Cesium.MapGISM3DSet({...r,...t})}};function iu(){Cesium.ImageryLayer.prototype._createTileImagerySkeletons=function(e,t,i){const r=e.data;if(Cesium.defined(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(Cesium.defined(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;const n=this._imageryProvider;if(Cesium.defined(i)||(i=r.imagery.length),!Cesium.defined(n))return this._skeletonPlaceholder.loadingImagery.addReference(),r.imagery.splice(i,0,this._skeletonPlaceholder),!0;const a=n.tilingScheme.projection instanceof Cesium.WebMercatorProjection&&e.rectangle.north<Cesium.WebMercatorProjection.MaximumLatitude&&e.rectangle.south>-Cesium.WebMercatorProjection.MaximumLatitude,o=Cesium.Rectangle.intersection(n.rectangle,this._rectangle,this.imageryBoundsScratch);let s=Cesium.Rectangle.intersection(e.rectangle,o,this.tileImageryBoundsScratch);if(!Cesium.defined(s)){if(!this.isBaseLayer())return!1;const t=o,i=e.rectangle;s=this.tileImageryBoundsScratch,i.south>=t.north?(s.north=t.north,s.south=t.north):i.north<=t.south?(s.north=t.south,s.south=t.south):(s.south=Math.max(i.south,t.south),s.north=Math.min(i.north,t.north)),i.west>=t.east?(s.west=t.east,s.east=t.east):i.east<=t.west?(s.west=t.west,s.east=t.west):(s.west=Math.max(i.west,t.west),s.east=Math.min(i.east,t.east))}let l=0;s.south>0?l=s.south:s.north<0&&(l=s.north);let h=function(e,t,i){const r=e._imageryProvider,n=r.tilingScheme,a=n.ellipsoid,o=Er.isGeographic(e._imageryProvider.tilingScheme.projection)?1:Math.cos(i);let s=0,l=t;if(Er.isGeographic(e._imageryProvider.tilingScheme.projection)&&(l=t/(Math.PI*a.maximumRadius*o/180)),n._tileInfo&&n.getTileLevelByResolution)s=n.getTileLevelByResolution(l);else{const e=n.rectangle.width,i=a.maximumRadius*e*o/(r.tileWidth*n.getNumberOfXTilesAtLevel(0))/t;s=Math.log(i)/Math.log(2)}return Math.round(s)||0}(this,1*t.getLevelMaximumGeometricError(e.level),l);h=Math.max(0,h);const c=n.maximumLevel,u=!(void 0!==n.isStretchImage&&!n.isStretchImage);if(h>c){if(!u)return!1;h=c}if(Cesium.defined(n.minimumLevel)){const e=n.minimumLevel;if(h<e){if(!u)return!1;h=e}}const d=n.tilingScheme,p=d.positionToTileXY(Cesium.Rectangle.northwest(s),h),f=d.positionToTileXY(Cesium.Rectangle.southeast(s),h);let m=e.rectangle.width/512,y=e.rectangle.height/512;const g=d.tileXYToRectangle(p.x,p.y,h);Math.abs(g.south-e.rectangle.north)<y&&p.y<f.y&&++p.y,Math.abs(g.east-e.rectangle.west)<m&&p.x<f.x&&++p.x;const v=d.tileXYToRectangle(f.x,f.y,h);Math.abs(v.north-e.rectangle.south)<y&&f.y>p.y&&--f.y,Math.abs(v.west-e.rectangle.east)<m&&f.x>p.x&&--f.x;const b=Cesium.Rectangle.clone(e.rectangle,this.terrainRectangleScratch),_=d.tileXYToRectangle(p.x,p.y,h),w=d.tileXYToRectangle(f.x,f.y,h);let x,C,S=new Cesium.Rectangle(_.west,w.south,w.east,_.north),M=Cesium.Rectangle.intersection(S,o,this.clippedRectangleScratch);a?(d.rectangleToNativeRectangle(b,b),d.rectangleToNativeRectangle(S,S),d.rectangleToNativeRectangle(M,M),d.rectangleToNativeRectangle(o,o),x=d.tileXYToNativeRectangle.bind(d),m=b.width/512,y=b.height/512):x=d.tileXYToRectangle.bind(d);let k,T=0,I=1;!this.isBaseLayer()&&M&&Math.abs(M.west-b.west)>=m&&(T=Math.min(1,(M.west-b.west)/b.width)),!this.isBaseLayer()&&M&&Math.abs(M.north-b.north)>=y&&(I=Math.max(0,(M.north-b.south)/b.height));const O=I,E=[],L=[];let P,R=void 0,j=void 0;if(d._axisDirection&&d._axisDirection.y>0){for(P=p.y;P>=f.y;P--)E.push(P);j=f.y}else{for(P=p.y;P<=f.y;P++)E.push(P);j=p.y}if(d._axisDirection&&d._axisDirection.x<0){for(P=p.x;P>=f.x;P--)L.push(P);R=f.x}else{for(P=p.x;P<=f.x;P++)L.push(P);R=p.x}for(let e=0;e<L.length;e++){const t=L[e];C=T;const n=x(t,j,h),s=x(t,Math.max(...E),h);if(S=new Cesium.Rectangle(Math.min(n.west,s.west),Math.min(n.south,s.south),Math.max(n.east,s.east),Math.max(n.north,s.north)),M=Cesium.Rectangle.simpleIntersection(S,o,this.clippedRectangleScratch),Cesium.defined(M)){T=Math.min(1,(M.east-b.west)/b.width),t===f.x&&(this.isBaseLayer()||Math.abs(M.east-b.east)<m)&&(T=1),I=O;for(let e=0;e<E.length;e++){const n=E[e];if(k=I,S=x(t,n,h),M=Cesium.Rectangle.simpleIntersection(S,o,this.clippedRectangleScratch),!Cesium.defined(M))continue;I=Math.max(0,(M.south-b.south)/b.height),n===f.y&&(this.isBaseLayer()||Math.abs(M.south-b.south)<y)&&(I=0);const s=new Cesium.Cartesian4(C,I,T,k),l=this.getImageryFromCache(t,n,h);r.imagery.splice(i,0,new Cesium.TileImagery(l,s,a)),++i}}}return!0},Cesium.ImageryLayer.prototype._requestImagery=function(e){const t=this._imageryProvider,i=this;function r(t){if(!Cesium.defined(t))return n();e.image=t,e.state=Cesium.ImageryState.RECEIVED,e.request=void 0,Cesium.TileProviderError.handleSuccess?Cesium.TileProviderError.handleSuccess(i._requestImageError):Cesium.TileProviderError.reportSuccess(i._requestImageError)}function n(r){if(e.request.state===Cesium.RequestState.CANCELLED)return e.state=Cesium.ImageryState.UNLOADED,void(e.request=void 0);e.state=Cesium.ImageryState.FAILED,e.request=void 0;const n="Failed to obtain image tile X: "+e.x+" Y: "+e.y+" Level: "+e.level+".";Cesium.TileProviderError.handleError?i._requestImageError=Cesium.TileProviderError.handleError(i._requestImageError,t,t.errorEvent,n,e.x,e.y,e.level,a,r):(i._requestImageError=Cesium.TileProviderError.reportError(i._requestImageError,t,t.errorEvent,n,e.x,e.y,e.level,r),i._requestImageError.retry&&a())}function a(){const i=new Cesium.Request({throttle:!1,throttleByServer:!0,type:Cesium.RequestType.IMAGERY});let a;e.request=i,e.state=Cesium.ImageryState.TRANSITIONING,a=t instanceof Cesium.WebMapTileServiceImageryProvider&&Cesium.defined(t._tileMatrixLabels)?e.level:function(e){let i=e.level;t.tilingScheme&&t.tilingScheme._tileInfo&&(i=t.tilingScheme._tileInfo.lods[e.level].level);return i}(e);const o=t.requestImage(e.x,e.y,a,i);if(!Cesium.defined(o))return e.state=Cesium.ImageryState.UNLOADED,void(e.request=void 0);Cesium.defined(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),"function"==typeof o.then?o.then(r,n):Promise.resolve(o).then(r,n)}a()}}let ru;function nu(){if(window.Cesium){try{n.Log.info("Cesium原型链修改完毕"),iu()}catch(e){console.error(e)}window.removeEventListener("load",nu),window.document.removeEventListener("readystatechange",nu),window.document.removeEventListener("DOMContentLoaded",nu),window.clearInterval(ru)}}window.addEventListener("load",nu),window.document.addEventListener("readystatechange",nu),window.document.addEventListener("DOMContentLoaded",nu),ru=setInterval(()=>{nu()},20),i.d(t,"SceneViewCesium",function(){return $c}),i.d(t,"SceneView",function(){return $c}),i.d(t,"SketchEditorCesium",function(){return Jc}),i.d(t,"SketchEditor",function(){return Jc}),i.d(t,"CesiumInnerGraphicsLayer",function(){return sc}),i.d(t,"getTilingScheme",function(){return eh}),i.d(t,"getProviderExtent",function(){return ih}),i.d(t,"MapGISMapServerImageryProvider",function(){return ch}),i.d(t,"MapGISTileServerImageryProvider",function(){return Gr}),i.d(t,"CustomTilingScheme",function(){return wr}),i.d(t,"MapGISVectorTileImageryProvider",function(){return Ul}),i.d(t,"ArcGISMapServerImageryProvider",function(){return Pr}),i.d(t,"ArcGISTileServerImageryProvider",function(){return Kc}),i.d(t,"WebMapServiceImageryProvider",function(){return Zc}),i.d(t,"WebMapTileServiceImageryProvider",function(){return Qc}),i.d(t,"UrlTemplateImageryProvider",function(){return Kl}),i.d(t,"ArcGISVectorTileImageryProvider",function(){return eu}),i.d(t,"MapGISTerrainProvider",function(){return Or}),i.d(t,"MapGISM3DSet",function(){return tu}),i.d(t,"initializeOptions",function(){return lh}),i.d(t,"EchartsLayer",function(){return yc}),i.d(t,"MapvLayer",function(){return wh}),i.d(t,"GeoJSONLayerUtil",function(){return hc}),i.d(t,"GraphicsLayerUtil",function(){return cc}),i.d(t,"IGSFeatureLayerUtil",function(){return uc}),i.d(t,"WFSLayerUtil",function(){return dc}),i.d(t,"Screenshot",function(){return gc}),i.d(t,"Popup",function(){return vc}),i.d(t,"MapGISTileAvailability",function(){return Tr}),n.zondy.cesium={},n.zondy.cesium.MapGISMapServerImageryProvider=ch,n.zondy.cesium.MapGISTileServerImageryProvider=Gr,n.zondy.cesium.MapGISVectorTileImageryProvider=Ul,n.zondy.cesium.ArcGISMapServerImageryProvider=Pr,n.zondy.cesium.ArcGISTileServerImageryProvider=Kc,n.zondy.cesium.ArcGISVectorTileImageryProvider=eu,n.zondy.cesium.WebMapServiceImageryProvider=Zc,n.zondy.cesium.WebMapTileServiceImageryProvider=Qc,n.zondy.cesium.UrlTemplateImageryProvider=Kl,n.zondy.cesium.MapGISTerrainProvider=Or,n.zondy.cesium.MapGISTileAvailability=Tr,n.zondy.cesium.layer={},n.zondy.cesium.layer.EchartsLayer=yc,n.zondy.cesium.layer.MapVLayer=wh,n.zondy.cesium.layer.GraphicsLayer=sc,n.zondy.cesium.tool={},n.zondy.cesium.tool.sketch={},n.zondy.cesium.tool.sketch.SketchEditor=Jc,n.zondy.cesium.tool.Screenshot=gc,n.zondy.cesium.widget={},n.zondy.cesium.widget.Popup=vc,n.zondy.cesium.util={},n.zondy.cesium.util.getTilingScheme=eh,n.zondy.cesium.util.getProviderExtent=ih,n.zondy.cesium.util.initializeOptions=lh,n.zondy.cesium.util.GeoJSONLayerUtil=hc,n.zondy.cesium.util.GraphicsLayerUtil=cc,n.zondy.cesium.util.IGSFeatureLayerUtil=uc,n.zondy.cesium.WFSLayerUtil=dc,n.zondy.cesium.CustomTilingScheme=wr,n.zondy.cesium.MapGISM3DSet=tu,n.zondy.cesium.SceneView=$c,n.zondy.cesium.VERSION="17.2.3",n.Zondy.CesiumInnerGraphicsLayer=sc,n.Zondy.MapGISMapServerImageryProvider=ch,n.Zondy.MapGISTileServerImageryProvider=Gr,n.Zondy.MapGISVectorTileImageryProvider=Ul,n.Zondy.ArcGISMapServerImageryProvider=Pr,n.Zondy.ArcGISTileServerImageryProvider=Kc,n.Zondy.ArcGISVectorTileImageryProvider=eu,n.Zondy.WebMapServiceImageryProvider=Zc,n.Zondy.WebMapTileServiceImageryProvider=Qc,n.Zondy.UrlTemplateImageryProvider=Kl,n.Zondy.MapGISTerrainProvider=Or,n.Zondy.MapGISTileAvailability=Tr,n.Zondy.EchartsLayer=yc,n.Zondy.MapvLayer=wh,n.Zondy.SketchEditorCesium=Jc,n.Zondy.Screenshot=gc,n.Zondy.Popup=vc,n.Zondy.getTilingScheme=eh,n.Zondy.getProviderExtent=ih,n.Zondy.initializeOptions=lh,n.Zondy.GeoJSONLayerUtil=hc,n.Zondy.GraphicsLayerUtil=cc,n.Zondy.IGSFeatureLayerUtil=uc,n.Zondy.WFSLayerUtil=dc,n.Zondy.CustomTilingScheme=wr,n.Zondy.MapGISM3DSet=tu,n.Zondy.SceneViewCesium=$c,n.Zondy.PluginVersion=n.zondy.cesium.VERSION}])});