/*! For license information please see main~253ae210.js.LICENSE.txt */ (window.webpackJsonp=window.webpackJsonp||[]).push([["main~253ae210"],[,,,function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"h",(function(){return s})),n.d(e,"e",(function(){return a})),n.d(e,"p",(function(){return u})),n.d(e,"i",(function(){return c})),n.d(e,"m",(function(){return l})),n.d(e,"k",(function(){return h})),n.d(e,"l",(function(){return f})),n.d(e,"j",(function(){return p})),n.d(e,"n",(function(){return d})),n.d(e,"a",(function(){return g})),n.d(e,"o",(function(){return y})),n.d(e,"q",(function(){return v})),n.d(e,"r",(function(){return m})),n.d(e,"s",(function(){return b})),n.d(e,"g",(function(){return x})),n.d(e,"f",(function(){return E}));n(36);var r="http://www.w3.org/2001/XMLSchema-instance";function i(t,e){return E().createElementNS(t,e)}function o(t,e){return function t(e,n,r){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)n?r.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,"")):r.push(e.nodeValue);else{var i=void 0;for(i=e.firstChild;i;i=i.nextSibling)t(i,n,r)}return r}(t,e,[]).join("")}function s(t){return"documentElement"in t}function a(t,e,n){return t.getAttributeNS(e,n)||""}function u(t){return(new DOMParser).parseFromString(t,"application/xml")}function c(t,e){return function(n,r){var i=t.call(void 0!==e?e:this,n,r);void 0!==i&&r[r.length-1].push(i)}}function l(t,e){return function(n,r){var i=t.call(void 0!==e?e:this,n,r);void 0!==i&&(r[r.length-1]=i)}}function h(t,e,n){return function(r,i){var o=t.call(void 0!==n?n:this,r,i);if(void 0!==o){var s=i[i.length-1],a=void 0!==e?e:r.localName,u=void 0;a in s?u=s[a]:(u=[],s[a]=u),u.push(o)}}}function f(t,e,n){return function(r,i){var o=t.call(void 0!==n?n:this,r,i);void 0!==o&&(i[i.length-1][void 0!==e?e:r.localName]=o)}}function p(t,e){return function(n,r,i){t.call(void 0!==e?e:this,n,r,i),i[i.length-1].node.appendChild(n)}}function d(t,e){var n=t;return function(t,r,o){var s=r[r.length-1].node,a=n;return void 0===a&&(a=o),i(void 0!==e?e:s.namespaceURI,a)}}var g=d();function y(t,e,n){var r,i,o=void 0!==n?n:{};for(r=0,i=t.length;ro&&(c|=i.a.RIGHT),us&&(c|=i.a.ABOVE),c===i.a.UNKNOWN&&(c=i.a.INTERSECTING),c}function d(){return[1/0,1/0,-1/0,-1/0]}function g(t,e,n,r,i){return i?(i[0]=t,i[1]=e,i[2]=n,i[3]=r,i):[t,e,n,r]}function y(t){return g(1/0,1/0,-1/0,-1/0,t)}function v(t,e){var n=t[0],r=t[1];return g(n,r,n,r,e)}function m(t,e,n,r,i){return x(y(i),t,e,n,r)}function _(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function b(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function w(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function x(t,e,n,r,i){for(;ne[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function k(t){return t[2]=a&&v<=c),r||!(s&i.a.RIGHT)||o&i.a.RIGHT||(r=(m=g-(d-c)*y)>=u&&m<=l),r||!(s&i.a.BELOW)||o&i.a.BELOW||(r=(v=d-(g-u)/y)>=a&&v<=c),r||!(s&i.a.LEFT)||o&i.a.LEFT||(r=(m=g-(d-a)*y)>=u&&m<=l)}return r}function q(t,e,n,r){var i=[];if(r>1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;a=n[2])){var i=T(n),o=Math.floor((r[0]-n[0])/i)*i;t[0]-=o,t[2]-=o}return t}},function(t,e,n){var r=n(413)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){var r=n(323);t.exports=function(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports},,,function(t,e,n){var r=n(398),i=n(399),o=n(325),s=n(400);t.exports=function(t,e){return r(t)||i(t,e)||o(t,e)||s()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";n.d(e,"a",(function(){return i.a})),n.d(e,"l",(function(){return N})),n.d(e,"g",(function(){return L})),n.d(e,"h",(function(){return I})),n.d(e,"b",(function(){return j})),n.d(e,"c",(function(){return A})),n.d(e,"j",(function(){return R})),n.d(e,"i",(function(){return T})),n.d(e,"p",(function(){return F})),n.d(e,"q",(function(){return k})),n.d(e,"k",(function(){return z})),n.d(e,"m",(function(){return U})),n.d(e,"d",(function(){return V})),n.d(e,"n",(function(){return Y})),n.d(e,"e",(function(){return W})),n.d(e,"o",(function(){return X})),n.d(e,"f",(function(){return H}));var r,i=n(62),o=n(151),s=n(26),a=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=6378137*Math.PI,c=[-u,-u,u,u],l=[-180,-85,180,85],h=6378137*Math.log(Math.tan(Math.PI/2)),f=function(t){function e(e){return t.call(this,{code:e,units:i.b.METERS,extent:c,global:!0,worldExtent:l,getPointResolution:function(t,e){return t/Object(s.b)(e[1]/6378137)}})||this}return a(e,t),e}(o.a),p=[new f("EPSG:3857"),new f("EPSG:102100"),new f("EPSG:102113"),new f("EPSG:900913"),new f("http://www.opengis.net/def/crs/EPSG/0/3857"),new f("http://www.opengis.net/gml/srs/epsg.xml#3857")];function d(t,e,n){var r=t.length,i=n>1?n:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(r));for(var s=0;sh?a=h:a<-h&&(a=-h),o[s+1]=a}return o}function g(t,e,n){var r=t.length,i=n>1?n:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(r));for(var s=0;s1?(n=i,r=o):c>0&&(n+=s*c,r+=u*c)}return a(t,e,n,r)}function a(t,e,n,r){var i=n-t,o=r-e;return i*i+o*o}function u(t){for(var e=t.length,n=0;ni&&(i=s,r=o)}if(0===i)return null;var a=t[r];t[r]=t[n],t[n]=a;for(var u=n+1;u=0;f--){h[f]=t[f][e]/t[f][f];for(var p=f-1;p>=0;p--)t[p][e]-=t[p][f]*h[f]}return h}function c(t){return 180*t/Math.PI}function l(t){return t*Math.PI/180}function h(t,e){var n=t%e;return n*e<0?n+e:n}function f(t,e,n){return t+n*(e-t)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return s}));var r=n(23);function i(t,e,n,r,i){if(r&&r!==t&&(n=n.bind(r)),i){var o=n;n=function(){t.removeEventListener(e,n),o.apply(this,arguments)}}var s={target:t,type:e,listener:n};return t.addEventListener(e,n),s}function o(t,e,n,r){return i(t,e,n,r,!0)}function s(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),Object(r.b)(t))}},function(t,e,n){"use strict";e.a={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,i,o,s,a){if(!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,s,a],l=0;(u=new Error(e.replace(/%s/g,(function(){return c[l++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}}},function(t,e,n){var r=n(414),i=n(415),o=n(325),s=n(416);t.exports=function(t){return r(t)||i(t)||o(t)||s()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";n.d(e,"c",(function(){return c})),n.d(e,"b",(function(){return l})),n.d(e,"d",(function(){return h})),n.d(e,"e",(function(){return f})),n.d(e,"f",(function(){return p})),n.d(e,"g",(function(){return d})),n.d(e,"i",(function(){return g})),n.d(e,"k",(function(){return y})),n.d(e,"l",(function(){return v})),n.d(e,"m",(function(){return m})),n.d(e,"j",(function(){return _})),n.d(e,"h",(function(){return b})),n.d(e,"a",(function(){return w})),n.d(e,"r",(function(){return C})),n.d(e,"p",(function(){return N})),n.d(e,"o",(function(){return I})),n.d(e,"q",(function(){return P})),n.d(e,"n",(function(){return j}));var r=n(81),i=n(135),o=n(79),s=n(23),a=n(57),u=n(64),c="10px sans-serif",l="#000",h="round",f=[],p=0,d="round",g=10,y="#000",v="center",m="middle",_=[0,0,0,0],b=1,w=new r.a;(new i.a).setSize=function(){console.warn("labelCache is deprecated.")};var x,O,E=null,S={},C=function(){var t,e,n=["monospace","serif"],r=n.length,i="wmytzilWMYTZIL@#/&?$%10";function o(t,o,s){for(var a=!0,u=0;u2?n-2:0),i=2;i>1)],e))<0?a=r+1:(u=r,c=!o);return c?a:~a}function i(t,e){return t>e?1:t=0}function s(t,e,n){var r=t.length;if(t[0]<=e)return 0;if(e<=t[r-1])return r-1;var i=void 0;if(n>0){for(i=1;i0?i-1:i:t[i-1]-e0||n&&0===o)}))}n.d(e,"a",(function(){return r})),n.d(e,"g",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"f",(function(){return s})),n.d(e,"h",(function(){return a})),n.d(e,"c",(function(){return u})),n.d(e,"b",(function(){return c})),n.d(e,"e",(function(){return l}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return u}));var r=n(99),i=n(0),o=(n(167),n(213),n(214)),s=(n(278),n(98),n(224),n(110),function(t,e){var n=arguments;if(null==e||!r.e.call(e,"css"))return i.createElement.apply(void 0,n);var o=n.length,s=new Array(o);s[0]=r.b,s[1]=Object(r.d)(t,e);for(var a=2;a=1?(n=l,r=h):(n=u+d*f,r=c+d*p),[n,r]}function c(t,e,n){var r=Object(i.e)(e+180,360)-180,s=Math.abs(3600*r),a=n||0,u=Math.pow(10,a),c=Math.floor(s/3600),l=Math.floor((s-3600*c)/60),h=s-3600*c-60*l;return(h=Math.ceil(h*u)/u)>=60&&(h=0,l+=1),l>=60&&(l=0,c+=1),c+"° "+Object(o.b)(l,2)+"′ "+Object(o.b)(h,2,a)+"″"+(0==r?"":" "+t.charAt(r<0?1:0))}function l(t,e){for(var n=!0,r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function h(t,e){var n=Math.cos(e),r=Math.sin(e),i=t[0]*n-t[1]*r,o=t[1]*n+t[0]*r;return t[0]=i,t[1]=o,t}function f(t,e){return t[0]*=e,t[1]*=e,t}function p(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function d(t,e){return Math.sqrt(p(t,e))}function g(t,e){return p(t,u(t,e))}function y(t,e){return t?c("NS",t[1],e)+" "+c("EW",t[0],e):""}function v(t,e){if(e.canWrapX()){var n=Object(r.D)(e.getExtent()),i=m(t,e,n);i&&(t[0]-=i*n)}return t}function m(t,e,n){var i=e.getExtent(),o=0;if(e.canWrapX()&&(t[0]i[2])){var s=n||Object(r.D)(i);o=Math.floor((t[0]-i[0])/s)}return o}},,function(t,e,n){var r=n(323);function i(t,e){for(var n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"};var i={};i[r.RADIANS]=6370997/(2*Math.PI),i[r.DEGREES]=2*Math.PI*6370997/360,i[r.FEET]=.3048,i[r.METERS]=1,i[r.USFEET]=1200/3937,e.b=r},function(t,e,n){"use strict";e.a={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source"}},function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"d",(function(){return i})),n.d(e,"e",(function(){return o})),n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return a})),n.d(e,"g",(function(){return l})),n.d(e,"f",(function(){return h}));var r="ol-hidden",i="ol-selectable",o="ol-unselectable",s="ol-control",a="ol-collapsed",u=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),c=["style","variant","weight","size","lineHeight","family"],l=function(t){var e=t.match(u);if(!e)return null;for(var n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,i=c.length;r=4;++r,i-=4)e=1540483477*(65535&(e=255&t.charCodeAt(r)|(255&t.charCodeAt(++r))<<8|(255&t.charCodeAt(++r))<<16|(255&t.charCodeAt(++r))<<24))+(59797*(e>>>16)<<16),n=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&t.charCodeAt(r+2))<<16;case 2:n^=(255&t.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},d=n(253),g=n(254),y=/[A-Z]|^ms/g,v=/_EMO_([^_]+?)_([^]*?)_EMO_/g,m=function(t){return 45===t.charCodeAt(1)},_=function(t){return null!=t&&"boolean"!=typeof t},b=Object(g.a)((function(t){return m(t)?t:t.replace(y,"-$&").toLowerCase()})),w=function(t,e){switch(t){case"animation":case"animationName":if("string"==typeof e)return e.replace(v,(function(t,e,n){return O={name:e,styles:n,next:O},e}))}return 1===d.a[t]||m(t)||"number"!=typeof e||0===e?e:e+"px"};function x(t,e,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return O={name:n.name,styles:n.styles,next:O},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)O={name:i.name,styles:i.styles,next:O},i=i.next;return n.styles+";"}return function(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i0&&t[1]>0}function o(t,e,n){return void 0===n&&(n=[0,0]),n[0]=t[0]*e+.5|0,n[1]=t[1]*e+.5|0,n}function s(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return s}))},function(t,e,n){"use strict";n.d(e,"d",(function(){return c})),n.d(e,"a",(function(){return h})),n.d(e,"b",(function(){return f}));var r=n(120),i=n(105),o=n(15),s=n(68),a=n(32),u=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=p,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.setHitDetectionRenderer=function(t){this.hitDetectionRenderer_=t},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=p,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();function c(t){var e;if("function"==typeof t)e=t;else{var n;if(Array.isArray(t))n=t;else Object(a.a)("function"==typeof t.getZIndex,41),n=[t];e=function(){return n}}return e}var l=null;function h(t,e){if(!l){var n=new i.a({color:"rgba(255,255,255,0.4)"}),o=new s.a({color:"#3399CC",width:1.25});l=[new u({image:new r.a({fill:n,stroke:o,radius:5}),fill:n,stroke:o})]}return l}function f(){var t={},e=[255,255,255,1],n=[0,153,255,1];return t[o.a.POLYGON]=[new u({fill:new i.a({color:[255,255,255,.5]})})],t[o.a.MULTI_POLYGON]=t[o.a.POLYGON],t[o.a.LINE_STRING]=[new u({stroke:new s.a({color:e,width:5})}),new u({stroke:new s.a({color:n,width:3})})],t[o.a.MULTI_LINE_STRING]=t[o.a.LINE_STRING],t[o.a.CIRCLE]=t[o.a.POLYGON].concat(t[o.a.LINE_STRING]),t[o.a.POINT]=[new u({image:new r.a({radius:6,fill:new i.a({color:n}),stroke:new s.a({color:e,width:1.5})}),zIndex:1/0})],t[o.a.MULTI_POINT]=t[o.a.POINT],t[o.a.GEOMETRY_COLLECTION]=t[o.a.POLYGON].concat(t[o.a.LINE_STRING],t[o.a.POINT]),t}function p(t){return t.getGeometry()}e.c=u},function(t,e,n){"use strict";var r=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({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()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}();e.a=r},,function(t,e,n){"use strict";e.a={ANIMATING:0,INTERACTING:1}},function(t,e,n){"use strict";var r=function(){function t(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}();e.a=r},function(t,e,n){"use strict";n.d(e,"c",(function(){return O})),n.d(e,"b",(function(){return E})),n.d(e,"d",(function(){return S}));var r,i=n(53),o=n(15),s=n(228),a=n(116),u=n(87),c=n(119),l=n(7),h=n(111),f=n(36),p=n(261),d=n(80),g=n(173),y=n(179),v=n(199),m=n(138),_=n(26),b=n(136),w=(n(220),r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),x=function(t){function e(e,n,r){var i=t.call(this)||this;return i.ends_=[],i.flatInteriorPointRevision_=-1,i.flatInteriorPoint_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,void 0!==n&&r?(i.setFlatCoordinates(n,e),i.ends_=r):i.setCoordinates(e,n),i}return w(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?Object(f.c)(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){return r0;)this.pop()},e.prototype.extend=function(t){for(var e=0,n=t.length;e0}}else if(t.type==o.a.POINTERDOWN){var r=this.handleDownEvent(t);this.handlingDownUpSequence=r,e=this.stopDown(r)}else t.type==o.a.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===o.a.POINTERDOWN||e===o.a.POINTERDRAG||e===o.a.POINTERUP}(t)){var e=t.originalEvent,n=e.pointerId.toString();t.type==o.a.POINTERUP?delete this.trackedPointers_[n]:(t.type==o.a.POINTERDOWN||n in this.trackedPointers_)&&(this.trackedPointers_[n]=e),this.targetPointers=Object(s.c)(this.trackedPointers_)}},e}(i.a);function c(t){for(var e=t.length,n=0,r=0,i=0;in||n>e.getMaxZoom())return!1;var o=e.getFullTileRange(n);return!o||o.containsXY(r,i)}n.d(e,"a",(function(){return r})),n.d(e,"d",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return s})),n.d(e,"e",(function(){return a})),n.d(e,"f",(function(){return u}))},,,function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var r=.5,i=!0},function(t,e,n){"use strict";var r=n(73),i=n(74),o=n(71),s=n(28),a=n(137),u=n(185),c=n(201),l=n(129),h=n(103),f=n(50);n(13);function p(t,e){return[[-1/0,-1/0,1/0,1/0]]}var d=n(32),g=n(7),y=n(36),v=n(20),m=n(23),_=n(27),b=n(156),w=!1;function x(t,e){return function(n,r,i,o,s){var a=this;!function(t,e,n,r,i,o,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(n,r,i):t,!0),e.getType()==b.a.ARRAY_BUFFER&&(a.responseType="arraybuffer"),a.withCredentials=w,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var r=e.getType(),u=void 0;r==b.a.JSON||r==b.a.TEXT?u=a.responseText:r==b.a.XML?(u=a.responseXML)||(u=(new DOMParser).parseFromString(a.responseText,"application/xml")):r==b.a.ARRAY_BUFFER&&(u=a.response),u?o(e.readFeatures(u,{extent:n,featureProjection:i}),e.readProjection(u)):s()}else s()},a.onerror=s,a.send()}(t,e,n,r,i,(function(t,e){a.addFeatures(t),void 0!==o&&o(t)}),s||f.c)}}var O,E=(O=function(t,e){return(O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}O(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),S=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.feature=n,i.features=r,i}return E(e,t),e}(o.a),C=function(t){function e(e){var n=this,i=e||{};(n=t.call(this,{attributions:i.attributions,projection:void 0,state:l.a.READY,wrapX:void 0===i.wrapX||i.wrapX})||this).on,n.once,n.un,n.loader_=f.c,n.format_=i.format,n.overlaps_=void 0===i.overlaps||i.overlaps,n.url_=i.url,void 0!==i.loader?n.loader_=i.loader:void 0!==n.url_&&(Object(d.a)(n.format_,7),n.loader_=x(n.url_,n.format_)),n.strategy_=void 0!==i.strategy?i.strategy:p;var o,s,a=void 0===i.useSpatialIndex||i.useSpatialIndex;return n.featuresRtree_=a?new u.a:null,n.loadedExtentsRtree_=new u.a,n.loadingExtentsCount_=0,n.nullGeometryFeatures_={},n.idIndex_={},n.uidIndex_={},n.featureChangeKeys_={},n.featuresCollection_=null,Array.isArray(i.features)?s=i.features:i.features&&(s=(o=i.features).getArray()),a||void 0!==o||(o=new r.a(s)),void 0!==s&&n.addFeaturesInternal(s),void 0!==o&&n.bindFeaturesCollection_(o),n}return E(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=Object(v.c)(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var n=t.getGeometry();if(n){var r=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new S(h.a.ADDFEATURE,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[Object(_.a)(e,s.a.CHANGE,this.handleFeatureChange_,this),Object(_.a)(e,a.a.PROPERTYCHANGE,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var n=!0,r=e.getId();return void 0!==r&&(r.toString()in this.idIndex_?n=!1:this.idIndex_[r.toString()]=e),n&&(Object(d.a)(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),n},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],n=[],r=[],i=0,o=t.length;i0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,n=this.loadedExtentsRtree_;n.forEachInExtent(t,(function(n){if(Object(g.o)(n.extent,t))return e=n,!0})),e&&n.remove(e)},e.prototype.removeFeature=function(t){var e=Object(v.c)(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},e.prototype.removeFeatureInternal=function(t){var e=Object(v.c)(t);this.featureChangeKeys_[e].forEach(_.c),delete this.featureChangeKeys_[e];var n=t.getId();void 0!==n&&delete this.idIndex_[n.toString()],delete this.uidIndex_[e],this.dispatchEvent(new S(h.a.REMOVEFEATURE,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var n in this.idIndex_)if(this.idIndex_[n]===t){delete this.idIndex_[n],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){Object(d.a)(this.format_,7),this.url_=t,this.setLoader(x(t,this.format_))},e}(c.a);e.a=C},,,function(t,e){function n(){return t.exports=n=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(i[n]=t[n]);return i}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(392),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function u(t){return r.isMemo(t)?s:a[t.$$typeof]||i}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=s;var c=Object.defineProperty,l=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,d=Object.prototype;t.exports=function t(e,n,r){if("string"!=typeof n){if(d){var i=p(n);i&&i!==d&&t(e,i,r)}var s=l(n);h&&(s=s.concat(h(n)));for(var a=u(e),g=u(n),y=0;y1&&void 0!==arguments[1]?arguments[1]:{};Object(o.a)(this,t),this.init(e,n)}return Object(s.a)(t,[{key:"init",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||h,this.options=e,this.debug=e.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n1?e-1:0),r=1;r-1?t.replace(/###/g,"."):t}function i(){return!t||"string"==typeof t}for(var o="string"!=typeof e?[].concat(e):e.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!t[s]&&n&&(t[s]=new n),t=Object.prototype.hasOwnProperty.call(t,s)?t[s]:{}}return i()?{}:{obj:t,k:r(o.shift())}}function m(t,e,n){var r=v(t,e,Object);r.obj[r.k]=n}function _(t,e){var n=v(t,e),r=n.obj,i=n.k;if(r)return r[i]}function b(t,e,n){var r=_(t,n);return void 0!==r?r:_(e,n)}function w(t,e,n){for(var r in e)"__proto__"!==r&&"constructor"!==r&&(r in t?"string"==typeof t[r]||t[r]instanceof String||"string"==typeof e[r]||e[r]instanceof String?n&&(t[r]=e[r]):w(t[r],e[r],n):t[r]=e[r]);return t}function x(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var O={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function E(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,(function(t){return O[t]})):t}var S="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,C=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Object(o.a)(this,e),n=Object(a.a)(this,Object(u.a)(e).call(this)),S&&p.call(Object(c.a)(n)),n.data=t||{},n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return Object(l.a)(e,t),Object(s.a)(e,[{key:"addNamespaces",value:function(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}},{key:"removeNamespaces",value:function(t){var e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}},{key:"getResource",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=[t,e];return n&&"string"!=typeof n&&(o=o.concat(n)),n&&"string"==typeof n&&(o=o.concat(i?n.split(i):n)),t.indexOf(".")>-1&&(o=t.split(".")),_(this.data,o)}},{key:"addResource",value:function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var s=[t,e];n&&(s=s.concat(o?n.split(o):n)),t.indexOf(".")>-1&&(r=e,e=(s=t.split("."))[1]),this.addNamespaces(e),m(this.data,s,r),i.silent||this.emit("added",t,e,n,r)}},{key:"addResources",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(t,e,i,n[i],{silent:!0});r.silent||this.emit("added",t,e,n)}},{key:"addResourceBundle",value:function(t,e,n,r,o){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[t,e];t.indexOf(".")>-1&&(r=n,n=e,e=(a=t.split("."))[1]),this.addNamespaces(e);var u=_(this.data,a)||{};r?w(u,n,o):u=Object(i.a)({},u,n),m(this.data,a,u),s.silent||this.emit("added",t,e,n)}},{key:"removeResourceBundle",value:function(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}},{key:"hasResourceBundle",value:function(t,e){return void 0!==this.getResource(t,e)}},{key:"getResourceBundle",value:function(t,e){return e||(e=this.options.defaultNS),"v1"===this.options.compatibilityAPI?Object(i.a)({},{},this.getResource(t,e)):this.getResource(t,e)}},{key:"getDataByLanguage",value:function(t){return this.data[t]}},{key:"toJSON",value:function(){return this.data}}]),e}(p),N={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,e,n,r,i){var o=this;return t.forEach((function(t){o.processors[t]&&(e=o.processors[t].process(e,n,r,i))})),e}},M={},L=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(o.a)(this,e),n=Object(a.a)(this,Object(u.a)(e).call(this)),S&&p.call(Object(c.a)(n)),y(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,Object(c.a)(n)),n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=f.create("translator"),n}return Object(l.a)(e,t),Object(s.a)(e,[{key:"changeLanguage",value:function(t){t&&(this.language=t)}},{key:"exists",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(t,e);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(t,e){var n=void 0!==e.nsSeparator?e.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,i=e.ns||this.options.defaultNS;if(n&&t.indexOf(n)>-1){var o=t.match(this.interpolator.nestingRegexp);if(o&&o.length>0)return{key:t,namespaces:i};var s=t.split(n);(n!==r||n===r&&this.options.ns.indexOf(s[0])>-1)&&(i=s.shift()),t=s.join(r)}return"string"==typeof i&&(i=[i]),{key:t,namespaces:i}}},{key:"translate",value:function(t,n,o){var s=this;if("object"!==Object(r.a)(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);var a=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,u=this.extractFromKey(t[t.length-1],n),c=u.key,l=u.namespaces,h=l[l.length-1],f=n.lng||this.language,p=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f&&"cimode"===f.toLowerCase()){if(p){var d=n.nsSeparator||this.options.nsSeparator;return h+d+c}return c}var g=this.resolve(t,n),y=g&&g.res,v=g&&g.usedKey||c,m=g&&g.exactUsedKey||c,_=Object.prototype.toString.apply(y),b=["[object Number]","[object Function]","[object RegExp]"],w=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,O="string"!=typeof y&&"boolean"!=typeof y&&"number"!=typeof y;if(x&&y&&O&&b.indexOf(_)<0&&("string"!=typeof w||"[object Array]"!==_)){if(!n.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,y,n):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");if(a){var E="[object Array]"===_,S=E?[]:{},C=E?m:v;for(var N in y)if(Object.prototype.hasOwnProperty.call(y,N)){var M="".concat(C).concat(a).concat(N);S[N]=this.translate(M,Object(i.a)({},n,{joinArrays:!1,ns:l})),S[N]===M&&(S[N]=y[N])}y=S}}else if(x&&"string"==typeof w&&"[object Array]"===_)(y=y.join(w))&&(y=this.extendTranslation(y,t,n,o));else{var L=!1,I=!1,P=void 0!==n.count&&"string"!=typeof n.count,j=e.hasDefaultValue(n),A=P?this.pluralResolver.getSuffix(f,n.count):"",R=n["defaultValue".concat(A)]||n.defaultValue;!this.isValidLookup(y)&&j&&(L=!0,y=R),this.isValidLookup(y)||(I=!0,y=c);var T=j&&R!==y&&this.options.updateMissing;if(I||L||T){if(this.logger.log(T?"updateKey":"missingKey",f,h,c,T?R:y),a){var F=this.resolve(c,Object(i.a)({},n,{keySeparator:!1}));F&&F.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var k=[],D=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&D&&D[0])for(var B=0;B1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach((function(t){if(!s.isValidLookup(e)){var u=s.extractFromKey(t,a),c=u.key;n=c;var l=u.namespaces;s.options.fallbackNS&&(l=l.concat(s.options.fallbackNS));var h=void 0!==a.count&&"string"!=typeof a.count,f=void 0!==a.context&&"string"==typeof a.context&&""!==a.context,p=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);l.forEach((function(t){s.isValidLookup(e)||(o=t,!M["".concat(p[0],"-").concat(t)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(M["".concat(p[0],"-").concat(t)]=!0,s.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((function(n){if(!s.isValidLookup(e)){i=n;var o,u,l=c,p=[l];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(p,c,n,t,a);else h&&(o=s.pluralResolver.getSuffix(n,a.count)),h&&f&&p.push(l+o),f&&p.push(l+="".concat(s.options.contextSeparator).concat(a.context)),h&&p.push(l+=o);for(;u=p.pop();)s.isValidLookup(e)||(r=u,e=s.getResource(n,t,u,a))}})))}))}})),{res:e,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}},{key:"getResource",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,e,n,r):this.resourceStore.getResource(t,e,n,r)}}],[{key:"hasDefaultValue",value:function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&"defaultValue"===e.substring(0,"defaultValue".length)&&void 0!==t[e])return!0;return!1}}]),e}(p);function I(t){return t.charAt(0).toUpperCase()+t.slice(1)}var P=function(){function t(e){Object(o.a)(this,t),this.options=e,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=f.create("languageUtils")}return Object(s.a)(t,[{key:"getScriptPartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return null;var e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase()?null:this.formatLanguageCode(e.join("-")))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return t;var e=t.split("-");return this.formatLanguageCode(e[0])}},{key:"formatLanguageCode",value:function(t){if("string"==typeof t&&t.indexOf("-")>-1){var e=["hans","hant","latn","cyrl","cans","mong","arab"],n=t.split("-");return this.options.lowerCaseLng?n=n.map((function(t){return t.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=I(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=I(n[1].toLowerCase())),e.indexOf(n[2].toLowerCase())>-1&&(n[2]=I(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isWhitelisted",value:function(t){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(t)}},{key:"isSupportedCode",value:function(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var e,n=this;return t?(t.forEach((function(t){if(!e){var r=n.formatLanguageCode(t);n.options.supportedLngs&&!n.isSupportedCode(r)||(e=r)}})),!e&&this.options.supportedLngs&&t.forEach((function(t){if(!e){var r=n.getLanguagePartFromCode(t);if(n.isSupportedCode(r))return e=r;e=n.options.supportedLngs.find((function(t){if(0===t.indexOf(r))return t}))}})),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e):null}},{key:"getFallbackCodes",value:function(t,e){if(!t)return[];if("function"==typeof t&&(t=t(e)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!e)return t.default||[];var n=t[e];return n||(n=t[this.getScriptPartFromCode(e)]),n||(n=t[this.formatLanguageCode(e)]),n||(n=t[this.getLanguagePartFromCode(e)]),n||(n=t.default),n||[]}},{key:"toResolveHierarchy",value:function(t,e){var n=this,r=this.getFallbackCodes(e||this.options.fallbackLng||[],t),i=[],o=function(t){t&&(n.isSupportedCode(t)?i.push(t):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(t)))};return"string"==typeof t&&t.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(t))):"string"==typeof t&&o(this.formatLanguageCode(t)),r.forEach((function(t){i.indexOf(t)<0&&o(n.formatLanguageCode(t))})),i}}]),t}(),j=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],A={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(1==t||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}};function R(){var t={};return j.forEach((function(e){e.lngs.forEach((function(n){t[n]={numbers:e.nr,plurals:A[e.fc]}}))})),t}var T=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(o.a)(this,t),this.languageUtils=e,this.options=n,this.logger=f.create("pluralResolver"),this.rules=R()}return Object(s.a)(t,[{key:"addRule",value:function(t,e){this.rules[t]=e}},{key:"getRule",value:function(t){return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var e=this.getRule(t);return e&&e.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,e){return this.getSuffixes(t).map((function(t){return e+t}))}},{key:"getSuffixes",value:function(t){var e=this,n=this.getRule(t);return n?n.numbers.map((function(n){return e.getSuffix(t,n)})):[]}},{key:"getSuffix",value:function(t,e){var n=this,r=this.getRule(t);if(r){var i=r.noAbs?r.plurals(e):r.plurals(Math.abs(e)),o=r.numbers[i];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var s=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):s():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]?s():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}return this.logger.warn("no plural rule found for: ".concat(t)),""}}]),t}(),F=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(o.a)(this,t),this.logger=f.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(t){return t},this.init(e)}return Object(s.a)(t,[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var e=t.interpolation;this.escape=void 0!==e.escape?e.escape:E,this.escapeValue=void 0===e.escapeValue||e.escapeValue,this.useRawValueToEscape=void 0!==e.useRawValueToEscape&&e.useRawValueToEscape,this.prefix=e.prefix?x(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?x(e.suffix):e.suffixEscaped||"}}",this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||",",this.unescapePrefix=e.unescapeSuffix?"":e.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":e.unescapeSuffix||"",this.nestingPrefix=e.nestingPrefix?x(e.nestingPrefix):e.nestingPrefixEscaped||x("$t("),this.nestingSuffix=e.nestingSuffix?x(e.nestingSuffix):e.nestingSuffixEscaped||x(")"),this.nestingOptionsSeparator=e.nestingOptionsSeparator?e.nestingOptionsSeparator:e.nestingOptionsSeparator||",",this.maxReplaces=e.maxReplaces?e.maxReplaces:1e3,this.alwaysFormat=void 0!==e.alwaysFormat&&e.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var e="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(e,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(t,e,n,r){var i,o,s,a=this,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(t){return t.replace(/\$/g,"$$$$")}var l=function(t){if(t.indexOf(a.formatSeparator)<0){var i=b(e,u,t);return a.alwaysFormat?a.format(i,void 0,n):i}var o=t.split(a.formatSeparator),s=o.shift().trim(),c=o.join(a.formatSeparator).trim();return a.format(b(e,u,s),c,n,r)};this.resetRegExp();var h=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r&&r.interpolation&&r.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(t){return c(t)}},{regex:this.regexp,safeValue:function(t){return a.escapeValue?c(a.escape(t)):c(t)}}].forEach((function(e){for(s=0;i=e.regex.exec(t);){if(void 0===(o=l(i[1].trim())))if("function"==typeof h){var n=h(t,i,r);o="string"==typeof n?n:""}else{if(f){o=i[0];continue}a.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(t)),o=""}else"string"==typeof o||a.useRawValueToEscape||(o=g(o));if(t=t.replace(i[0],e.safeValue(o)),e.regex.lastIndex=0,++s>=a.maxReplaces)break}})),t}},{key:"nest",value:function(t,e){var n,r,o=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=Object(i.a)({},s);function u(t,e){var n=this.nestingOptionsSeparator;if(t.indexOf(n)<0)return t;var r=t.split(new RegExp("".concat(n,"[ ]*{"))),o="{".concat(r[1]);t=r[0],o=(o=this.interpolate(o,a)).replace(/'/g,'"');try{a=JSON.parse(o),e&&(a=Object(i.a)({},e,a))}catch(e){return this.logger.warn("failed parsing options string in nesting for key ".concat(t),e),"".concat(t).concat(n).concat(o)}return delete a.defaultValue,t}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(t);){var c=[],l=!1;if(n[0].includes(this.formatSeparator)&&!/{.*}/.test(n[1])){var h=n[1].split(this.formatSeparator).map((function(t){return t.trim()}));n[1]=h.shift(),c=h,l=!0}if((r=e(u.call(this,n[1].trim(),a),a))&&n[0]===t&&"string"!=typeof r)return r;"string"!=typeof r&&(r=g(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(t)),r=""),l&&(r=c.reduce((function(t,e){return o.format(t,e,s.lng,s)}),r.trim())),t=t.replace(n[0],r),this.regexp.lastIndex=0}return t}}]),t}();var k=function(t){function e(t,n,r){var i,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Object(o.a)(this,e),i=Object(a.a)(this,Object(u.a)(e).call(this)),S&&p.call(Object(c.a)(i)),i.backend=t,i.store=n,i.services=r,i.languageUtils=r.languageUtils,i.options=s,i.logger=f.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(r,s.backend,s),i}return Object(l.a)(e,t),Object(s.a)(e,[{key:"queueLoad",value:function(t,e,n,r){var i=this,o=[],s=[],a=[],u=[];return t.forEach((function(t){var r=!0;e.forEach((function(e){var a="".concat(t,"|").concat(e);!n.reload&&i.store.hasResourceBundle(t,e)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?s.indexOf(a)<0&&s.push(a):(i.state[a]=1,r=!1,s.indexOf(a)<0&&s.push(a),o.indexOf(a)<0&&o.push(a),u.indexOf(e)<0&&u.push(e)))})),r||a.push(t)})),(o.length||s.length)&&this.queue.push({pending:s,loaded:{},errors:[],callback:r}),{toLoad:o,pending:s,toLoadLanguages:a,toLoadNamespaces:u}}},{key:"loaded",value:function(t,e,n){var r=t.split("|"),i=r[0],o=r[1];e&&this.emit("failedLoading",i,o,e),n&&this.store.addResourceBundle(i,o,n),this.state[t]=e?-1:2;var s={};this.queue.forEach((function(n){var r,a,u,c,l,h;r=n.loaded,a=o,c=v(r,[i],Object),l=c.obj,h=c.k,l[h]=l[h]||[],u&&(l[h]=l[h].concat(a)),u||l[h].push(a),function(t,e){for(var n=t.indexOf(e);-1!==n;)t.splice(n,1),n=t.indexOf(e)}(n.pending,t),e&&n.errors.push(e),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(t){s[t]||(s[t]=[]),n.loaded[t].length&&n.loaded[t].forEach((function(e){s[t].indexOf(e)<0&&s[t].push(e)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(t){return!t.done}))}},{key:"read",value:function(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,s=arguments.length>5?arguments[5]:void 0;return t.length?this.backend[n](t,e,(function(a,u){a&&u&&i<5?setTimeout((function(){r.read.call(r,t,e,n,i+1,2*o,s)}),o):s(a,u)})):s(null,{})}},{key:"prepareLoading",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]);var o=this.queueLoad(t,e,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(t){n.loadOne(t)}))}},{key:"load",value:function(t,e,n){this.prepareLoading(t,e,{},n)}},{key:"reload",value:function(t,e,n){this.prepareLoading(t,e,{reload:!0},n)}},{key:"loadOne",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,s){r&&e.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&s&&e.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),s),e.loaded(t,r,s)}))}},{key:"saveMissing",value:function(t,e,n,r,o){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(e)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(e,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(t,e,n,r,null,Object(i.a)({},s,{isUpdate:o})),t&&t[0]&&this.store.addResource(t[0],e,n,r))}}]),e}(p);function D(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var e={};if("object"===Object(r.a)(t[1])&&(e=t[1]),"string"==typeof t[1]&&(e.defaultValue=t[1]),"string"==typeof t[2]&&(e.tDescription=t[2]),"object"===Object(r.a)(t[2])||"object"===Object(r.a)(t[3])){var n=t[3]||t[2];Object.keys(n).forEach((function(t){e[t]=n[t]}))}return e},interpolation:{escapeValue:!0,format:function(t,e,n,r){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function B(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.whitelist&&(t.whitelist&&t.whitelist.indexOf("cimode")<0&&(t.whitelist=t.whitelist.concat(["cimode"])),t.supportedLngs=t.whitelist),t.nonExplicitWhitelist&&(t.nonExplicitSupportedLngs=t.nonExplicitWhitelist),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function G(){}var q=new(function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(Object(o.a)(this,e),t=Object(a.a)(this,Object(u.a)(e).call(this)),S&&p.call(Object(c.a)(t)),t.options=B(n),t.services={},t.logger=f,t.modules={external:[]},r&&!t.isInitialized&&!n.isClone){if(!t.options.initImmediate)return t.init(n,r),Object(a.a)(t,Object(c.a)(t));setTimeout((function(){t.init(n,r)}),0)}return t}return Object(l.a)(e,t),Object(s.a)(e,[{key:"init",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function r(t){return t?"function"==typeof t?new t:t:null}if("function"==typeof e&&(n=e,e={}),e.whitelist&&!e.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),e.nonExplicitWhitelist&&!e.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=Object(i.a)({},D(),this.options,B(e)),this.format=this.options.interpolation.format,n||(n=G),!this.options.isClone){this.modules.logger?f.init(r(this.modules.logger),this.options):f.init(null,this.options);var o=new P(this.options);this.store=new C(this.options.resources,this.options);var s=this.services;s.logger=f,s.resourceStore=this.store,s.languageUtils=o,s.pluralResolver=new T(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s.interpolator=new F(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new k(r(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i1?n-1:0),i=1;i0&&"dev"!==a[0]&&(this.options.lng=a[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var u=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];u.forEach((function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments)}}));var c=["addResource","addResources","addResourceBundle","removeResourceBundle"];c.forEach((function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments),t}}));var l=d(),h=function(){var e=function(e,r){t.isInitialized&&t.logger.warn("init: i18next is already initialized. You should call init just once!"),t.isInitialized=!0,t.options.isClone||t.logger.log("initialized",t.options),t.emit("initialized",t.options),l.resolve(r),n(e,r)};if(t.languages&&"v1"!==t.options.compatibilityAPI&&!t.isInitialized)return e(null,t.t.bind(t));t.changeLanguage(t.options.lng,e)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),l}},{key:"loadResources",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G,r=n,i="string"==typeof t?t:this.language;if("function"==typeof t&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return r();var o=[],s=function(t){t&&e.services.languageUtils.toResolveHierarchy(t).forEach((function(t){o.indexOf(t)<0&&o.push(t)}))};if(i)s(i);else{var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.forEach((function(t){return s(t)}))}this.options.preload&&this.options.preload.forEach((function(t){return s(t)})),this.services.backendConnector.load(o,this.options.ns,r)}else r(null)}},{key:"reloadResources",value:function(t,e,n){var r=d();return t||(t=this.languages),e||(e=this.options.ns),n||(n=G),this.services.backendConnector.reload(t,e,(function(t){r.resolve(),n(t)})),r}},{key:"use",value:function(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&N.addPostProcessor(t),"3rdParty"===t.type&&this.modules.external.push(t),this}},{key:"changeLanguage",value:function(t,e){var n=this;this.isLanguageChangingTo=t;var r=d();this.emit("languageChanging",t);var i=function(t){var i="string"==typeof t?t:n.services.languageUtils.getBestMatchFromCodes(t);i&&(n.language||(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i)),n.translator.language||n.translator.changeLanguage(i),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(i)),n.loadResources(i,(function(t){!function(t,i){i?(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),e&&e(t,(function(){return n.t.apply(n,arguments)}))}(t,i)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(t):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(t,e){var n=this,o=function t(e,o){var s;if("object"!==Object(r.a)(o)){for(var a=arguments.length,u=new Array(a>2?a-2:0),c=2;c1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var s=function(t,n){var r=e.services.backendConnector.state["".concat(t,"|").concat(n)];return-1===r||2===r};if(n.precheck){var a=n.precheck(this,s);if(void 0!==a)return a}return!!this.hasResourceBundle(r,t)||(!this.services.backendConnector.backend||!(!s(r,t)||i&&!s(o,t)))}},{key:"loadNamespaces",value:function(t,e){var n=this,r=d();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach((function(t){n.options.ns.indexOf(t)<0&&n.options.ns.push(t)})),this.loadResources((function(t){r.resolve(),e&&e(t)})),r):(e&&e(),Promise.resolve())}},{key:"loadLanguages",value:function(t,e){var n=d();"string"==typeof t&&(t=[t]);var r=this.options.preload||[],i=t.filter((function(t){return r.indexOf(t)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(t){n.resolve(),e&&e(t)})),n):(e&&e(),Promise.resolve())}},{key:"dir",value:function(t){if(t||(t=this.languages&&this.languages.length>0?this.languages[0]:this.language),!t)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new e(t,n)}},{key:"cloneInstance",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G,o=Object(i.a)({},this.options,n,{isClone:!0}),s=new e(o),a=["store","services","language"];return a.forEach((function(e){s[e]=t[e]})),s.services=Object(i.a)({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s.translator=new L(s.services,s.options),s.translator.on("*",(function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1)u=n;else{if(p>0){for(var d=0;do&&(o=l),s=u,a=c}return o}function s(t,e,n,r,i){for(var s=0,a=n.length;sp&&(p=f=(p+f)/2),d>g&&(g=d=(g+d)/2);var v=Object(y.a)(r[0],f,p),m=Object(y.a)(r[1],d,g),_=30*i;return s&&n&&(v+=-_*Math.log(1+Math.max(0,f-r[0])/_)+_*Math.log(1+Math.max(0,r[0]-p)/_),m+=-_*Math.log(1+Math.max(0,d-r[1])/_)+_*Math.log(1+Math.max(0,r[1]-g)/_)),[v,m]}}}function m(t){return t}var _=n(7),b=n(36);function w(t,e,n,r){var i=Object(_.D)(e)/n[0],o=Object(_.z)(e)/n[1];return r?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function x(t,e,n){var r=Math.min(t,e);return r*=Math.log(1+50*Math.max(0,t/e-1))/50+1,n&&(r=Math.max(r,n),r/=Math.log(1+50*Math.max(0,n/t-1))/50+1),Object(y.a)(r,n/2,2*e)}function O(t,e,n,r,i){return function(o,s,a,u){if(void 0!==o){var c=r?w(t,r,a,i):t;return(void 0===n||n)&&u?x(o,c,e):Object(y.a)(o,e,c)}}}var E,S=n(157),C=n(101),N=n(72),M=(E=function(t,e){return(E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}E(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),L=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=Object(g.a)({},e);return n.hints_=[0,0],n.animations_=[],n.updateAnimationKey_,n.projection_=Object(h.b)(r.projection,"EPSG:3857"),n.viewportSize_=[100,100],n.targetCenter_=null,n.targetResolution_,n.targetRotation_,n.nextCenter_=null,n.nextResolution_,n.nextRotation_,n.cancelAnchor_=void 0,r.center&&(r.center=Object(h.d)(r.center,n.projection_)),r.extent&&(r.extent=Object(h.e)(r.extent,n.projection_)),n.applyOptions_(r),n}return M(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,n,r,i=void 0!==t.minZoom?t.minZoom:0,s=void 0!==t.maxZoom?t.maxZoom:28,a=void 0!==t.zoomFactor?t.zoomFactor:2,u=void 0!==t.multiWorld&&t.multiWorld,c=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,f=void 0!==t.showFullExtent&&t.showFullExtent,p=Object(h.b)(t.projection,"EPSG:3857"),d=p.getExtent(),g=t.constrainOnlyCenter,v=t.extent;u||v||!p.isGlobal()||(g=!1,v=d);if(void 0!==t.resolutions){var m=t.resolutions;n=m[i],r=void 0!==m[s]?m[s]:m[m.length-1],e=t.constrainResolution?function(t,e,n,r){return function(i,o,s,a){if(void 0!==i){var u=t[0],c=t[t.length-1],l=n?w(u,n,s,r):u;if(a)return void 0===e||e?x(i,l,c):Object(y.a)(i,c,l);var h=Math.min(l,i),f=Math.floor(Object(b.f)(t,h,o));return t[f]>l&&f1&&"function"==typeof arguments[n-1]&&(e=arguments[n-1],--n);for(var r=0;r0},e.prototype.getInteracting=function(){return this.hints_[s.a.INTERACTING]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(s.a.ANIMATING,-this.hints_[s.a.ANIMATING]);for(var e=0,n=this.animations_.length;e=0;--n){for(var r=this.animations_[n],i=!0,o=0,a=r.length;o0?c/u.duration:1;l>=1?(u.complete=!0,l=1):i=!1;var h=u.easing(l);if(u.sourceCenter){var f=u.sourceCenter[0],p=u.sourceCenter[1],d=u.targetCenter[0],g=u.targetCenter[1];this.nextCenter_=u.targetCenter;var v=f+h*(d-f),m=p+h*(g-p);this.targetCenter_=[v,m]}if(u.sourceResolution&&u.targetResolution){var _=1===h?u.targetResolution:u.sourceResolution+h*(u.targetResolution-u.sourceResolution);if(u.anchor){var b=this.getViewportSize_(this.getRotation()),w=this.constraints_.resolution(_,0,b,!0);this.targetCenter_=this.calculateCenterZoom(w,u.anchor)}this.nextResolution_=u.targetResolution,this.targetResolution_=_,this.applyTargetState_(!0)}if(void 0!==u.sourceRotation&&void 0!==u.targetRotation){var x=1===h?Object(y.e)(u.targetRotation+Math.PI,2*Math.PI)-Math.PI:u.sourceRotation+h*(u.targetRotation-u.sourceRotation);if(u.anchor){var O=this.constraints_.rotation(x,!0);this.targetCenter_=this.calculateCenterRotate(O,u.anchor)}this.nextRotation_=u.targetRotation,this.targetRotation_=x}if(this.applyTargetState_(!0),e=!0,!u.complete)break}}if(i){this.animations_[n]=null,this.setHint(s.a.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var E=r[0].callback;E&&I(E,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var n,r=this.getCenterInternal();return void 0!==r&&(n=[r[0]-e[0],r[1]-e[1]],Object(p.g)(n,t-this.getRotation()),Object(p.a)(n,e)),n},e.prototype.calculateCenterZoom=function(t,e){var n,r=this.getCenterInternal(),i=this.getResolution();void 0!==r&&void 0!==i&&(n=[e[0]-t*(e[0]-r[0])/i,e[1]-t*(e[1]-r[1])/i]);return n},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var n=e[0],r=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(r*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(r*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?Object(h.m)(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(a)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){var e=this.calculateExtentInternal(t);return Object(h.n)(e,this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),n=this.getCenterInternal();Object(d.a)(n,1);var r=this.getResolution();Object(d.a)(void 0!==r,2);var i=this.getRotation();return Object(d.a)(void 0!==i,3),Object(_.y)(n,r,i,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(u)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Object(h.e)(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var n=e||this.getViewportSizeMinusPadding_(),r=Object(_.D)(t)/n[0],i=Object(_.z)(t)/n[1];return Math.max(r,i)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/Math.log(e);return function(t){return n/Math.pow(e,t*i)}},e.prototype.getRotation=function(){return this.get(c)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/e;return function(t){return Math.log(n/t)/e/i}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),n=this.getRotation(),r=this.getCenterInternal(),i=this.padding_;if(i){var o=this.getViewportSizeMinusPadding_();r=j(r,this.getViewportSize_(),[o[0]/2+i[3],o[1]/2+i[0]],e,n)}return{center:r.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,n,r=this.minZoom_||0;if(this.resolutions_){var i=Object(b.f)(this.resolutions_,t,1);r=i,e=this.resolutions_[i],n=i==this.resolutions_.length-1?2:e/this.resolutions_[i+1]}else e=this.maxResolution_,n=this.zoomFactor_;return r+Math.log(e/t)/Math.log(n)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=Object(y.a)(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,Object(y.a)(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var n;if(Object(d.a)(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t)){Object(d.a)(!Object(_.G)(t),25);var r=Object(h.e)(t,this.getProjection());n=Object(N.c)(r)}else if(t.getType()===i.a.CIRCLE){r=Object(h.e)(t.getExtent(),this.getProjection());(n=Object(N.c)(r)).rotate(this.getRotation(),Object(_.w)(r))}else{var o=Object(h.k)();n=o?t.clone().transform(o,this.getProjection()):t}this.fitInternal(n,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),n=Math.cos(e),r=Math.sin(-e),i=t.getFlatCoordinates(),o=t.getStride(),s=1/0,a=1/0,u=-1/0,c=-1/0,l=0,h=i.length;l=t.maxResolution)return!1;var r=e.zoom;return r>t.minZoom&&r<=t.maxZoom}e.a=p},function(t,e,n){"use strict";var r,i=n(53),o=n(15),s=n(87),a=n(119),u=n(7),c=n(111),l=n(136),h=n(36),f=n(259),p=n(80),d=n(208),g=n(173),y=n(260),v=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),m=function(t){function e(e,n){var r=t.call(this)||this;return r.flatMidpoint_=null,r.flatMidpointRevision_=-1,r.maxDelta_=-1,r.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?r.setCoordinates(e,n):r.setFlatCoordinates(n,e),r}return v(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?Object(h.c)(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){return re?r:new Array(1+e-i).join("0")+r}function i(t,e){for(var n=(""+t).split("."),r=(""+e).split("."),i=0;is)return 1;if(s>o)return-1}return 0}n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}))},function(t,e,n){var r=n(372);t.exports=function(t,e){if(null==t)return{};var n,i,o=r(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";var r,i=n(81),o=n(203),s=n(50),a=n(27),u=n(57),c=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e){var n=t.call(this)||this,r=e.element;return!r||e.target||r.style.pointerEvents||(r.style.pointerEvents="auto"),n.element=r||null,n.target_=null,n.map_=null,n.listenerKeys=[],e.render&&(n.render=e.render),e.target&&n.setTarget(e.target),n}return c(e,t),e.prototype.disposeInternal=function(){Object(u.e)(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&Object(u.e)(this.element);for(var e=0,n=this.listenerKeys.length;e0)},e.prototype.removeEventListener=function(t,e){var n=this.listeners_&&this.listeners_[t];if(n){var r=n.indexOf(e);-1!==r&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[r]=s.c,++this.pendingRemovals_[t]):(n.splice(r,1),0===n.length&&delete this.listeners_[t]))}},e}(i.a);e.a=c},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"e",(function(){return s})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return c}));var r=n(26);function i(t,e,n,i,o,s,a){var u=(n-e)/i;if(u<3){for(;e0;){for(var f=l.pop(),p=l.pop(),d=0,g=t[p],y=t[p+1],v=t[f],m=t[f+1],_=p+i;_d&&(h=_,d=x)}d>o&&(c[(h-e)/i]=1,p+i0&&y>d)&&(g<0&&v0&&v>g)?(u=f,c=p):(o[a++]=u,o[a++]=c,l=u,h=c,u=f,c=p)}}return o[a++]=u,o[a++]=c,a}function u(t,e,n,r,i,o,s,u){for(var c=0,l=n.length;co&&(c-a)*(o-u)-(i-a)*(l-u)>0&&s++:l<=o&&(c-a)*(o-u)-(i-a)*(l-u)<0&&s--,a=c,u=l}return 0!==s}function s(t,e,n,r,i,s){if(0===n.length)return!1;if(!o(t,e,n[0],r,i,s))return!1;for(var a=1,u=n.length;a=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function b(t,e){void 0===e&&(e="kilometers");var n=r[e];if(!n)throw new Error(e+" units is invalid");return t*n}function w(t,e){void 0===e&&(e="kilometers");var n=r[e];if(!n)throw new Error(e+" units is invalid");return t/n}function x(t,e){return E(w(t,e))}function O(t){var e=t%360;return e<0&&(e+=360),e}function E(t){return t%(2*Math.PI)*180/Math.PI}function S(t){return t%360*Math.PI/180}function C(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("length must be a positive number");return b(w(t,e),n)}function N(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var r=o[e];if(!r)throw new Error("invalid original units");var i=o[n];if(!i)throw new Error("invalid final units");return t/r*i}function M(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function L(t){return!!t&&t.constructor===Object}function I(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!M(t))throw new Error("bbox must only contain numbers")}))}function P(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}var j=Object.freeze({__proto__:null,earthRadius:n,factors:r,unitsFactors:i,areaFactors:o,feature:s,geometry:a,point:u,points:c,polygon:l,polygons:h,lineString:f,lineStrings:p,featureCollection:d,multiLineString:g,multiPoint:y,multiPolygon:v,geometryCollection:m,round:_,radiansToLength:b,lengthToRadians:w,lengthToDegrees:x,bearingToAzimuth:O,radiansToDegrees:E,degreesToRadians:S,convertLength:C,convertArea:N,isNumber:M,isObject:L,validateBBox:I,validateId:P});function A(t,e,n){if(null!==t)for(var r,i,o,s,a,u,c,l,h=0,f=0,p=t.type,d="FeatureCollection"===p,g="Feature"===p,y=d?t.features.length:1,v=0;va||p>u||d>c)return s=o,a=n,u=p,c=d,void(i=0);var g=f([s,o],t.properties);if(!1===e(g,n,r,d,i))return!1;i++,s=o}))&&void 0}}}))}function Y(t,e,n){var r=n,i=!1;return V(t,(function(t,o,s,a,u){r=!1===i&&void 0===n?t:e(r,t,o,s,a,u),i=!0})),r}function W(t,e){if(!t)throw new Error("geojson is required");z(t,(function(t,n,r){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,n,r,0,0))return!1;break;case"Polygon":for(var s=0;st[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Q(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function tt(t){if(t.length>1&&M(t[0])&&M(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return tt(t[0]);throw new Error("coordinates must only contain numbers")}function et(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)}function nt(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function rt(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var r=0,i=t.features;r=0&&g>=0&&g=0;l--)if(Math.abs(e[l][0][0]-u)<=1e-7&&Math.abs(e[l][0][1]-c)<=1e-7){for(var h=s.path.length-2;h>=0;--h)e[l].unshift(s.path[h]);a=!0;break}a||(e[n++]=s.path)}var f}))})),e}(function(t,e){for(var n=t.length-1,r=t[0].length-1,i={rows:n,cols:r,cells:[]},o=0;o=e?8:0,a|=c>=e?4:0,a|=l>=e?2:0;var f,p,d,g,y=!1;if(5==(a|=h>=e?1:0)||10===a){var v=(u+c+l+h)/4;5===a&&vr;){if(i-r>600){var s=i-r+1,a=n-r+1,u=Math.log(s),c=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*c*(s-c)/s)*(a-s/2<0?-1:1);t(e,n,Math.max(r,Math.floor(n-a*c/s+l)),Math.min(i,Math.floor(n+(s-a)*c/s+l)),o)}var h=e[n],f=r,p=i;for(xt(e,r,n),o(e[i],h)>0&&xt(e,r,i);f0;)p--}0===o(e[r],h)?xt(e,r,p):xt(e,++p,i),p<=n&&(r=p+1),n<=p&&(i=p-1)}}(t,e,n||0,r||t.length-1,i||Ot)}function xt(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Ot(t,e){return te?1:0}_t.default=bt;var Et=Ct,St=Ct;function Ct(t,e){if(!(this instanceof Ct))return new Ct(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function Nt(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r=t.minX&&e.maxY>=t.minY}function kt(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Dt(t,e,n,r,i){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=r||(o=e+Math.ceil((n-e)/r/2)*r,_t(t,o,e,n,i),s.push(e,o,o,n))}function Bt(t){var e={exports:{}};return t(e,e.exports),e.exports}Ct.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!Ft(t,e))return n;for(var i,o,s,a,u=[];e;){for(i=0,o=e.children.length;i=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=kt(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,Mt(n,this.toBBox),Mt(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=kt([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Mt(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,a,u,c,l,h,f,p,d,g,y;for(u=c=1/0,r=e;r<=n-e;r++)h=i=Lt(t,0,r,this.toBBox),f=o=Lt(t,r,n,this.toBBox),p=Math.max(h.minX,f.minX),d=Math.max(h.minY,f.minY),g=Math.min(h.maxX,f.maxX),y=Math.min(h.maxY,f.maxY),s=Math.max(0,g-p)*Math.max(0,y-d),a=At(i)+At(o),s=e;i--)o=t.children[i],It(u,t.leaf?s(o):o),c+=Rt(u);return c},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)It(e[r],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():Mt(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}},Et.default=St;var Gt=function(t,e,n){var r=t*e,i=qt*t,o=i-(i-t),s=t-o,a=qt*e,u=a-(a-e),c=e-u,l=s*c-(r-o*u-s*u-o*c);return n?(n[0]=l,n[1]=r,n):[l,r]},qt=+(Math.pow(2,27)+1),zt=function(t,e){var n=0|t.length,r=0|e.length;if(1===n&&1===r)return function(t,e){var n=t+e,r=n-t,i=t-(n-r)+(e-r);return i?[i,n]:[n]}(t[0],e[0]);var i,o,s=new Array(n+r),a=0,u=0,c=0,l=Math.abs,h=t[u],f=l(h),p=e[c],d=l(p);f=r?(i=h,(u+=1)=r?(i=h,(u+=1)>1;return["sum(",n(t.slice(0,e)),",",n(t.slice(e)),")"].join("")}function r(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var i=[],o=0;o0){if(s<=0)return a;r=i+s}else{if(!(i<0))return a;if(s>=0)return a;r=-(i+s)}var u=33306690738754716e-32*r;return a>=u||a<=-u?a:o(t,e,n)},function(t,e,n,r){var i=t[0]-r[0],o=e[0]-r[0],a=n[0]-r[0],u=t[1]-r[1],c=e[1]-r[1],l=n[1]-r[1],h=t[2]-r[2],f=e[2]-r[2],p=n[2]-r[2],d=o*l,g=a*c,y=a*u,v=i*l,m=i*c,_=o*u,b=h*(d-g)+f*(y-v)+p*(m-_),w=7771561172376103e-31*((Math.abs(d)+Math.abs(g))*Math.abs(h)+(Math.abs(y)+Math.abs(v))*Math.abs(f)+(Math.abs(m)+Math.abs(_))*Math.abs(p));return b>w||-b>w?b:s(t,e,n,r)}];function u(t){var e=a[t.length];return e||(e=a[t.length]=i(t.length)),e.apply(void 0,t)}!function(){for(;a.length<=5;)a.push(i(a.length));for(var e=[],n=["slow"],r=0;r<=5;++r)e.push("a"+r),n.push("o"+r);var o=["function getOrientation(",e.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(r=2;r<=5;++r)o.push("case ",r,":return o",r,"(",e.slice(0,r).join(),");");o.push("}var s=new Array(arguments.length);for(var i=0;i0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)}function Jt(t,e){return te?1:0}Zt.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r},_down:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i}},Ht.default=Kt;var $t=function(t,e){for(var n=t[0],r=t[1],i=!1,o=0,s=e.length-1;or!=l>r&&n<(c-a)*(r-u)/(l-u)+a&&(i=!i)}return i},Qt=Wt[3],te=ne,ee=ne;function ne(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;for(var r,i=function(t){for(var e=t[0],n=t[0],r=t[0],i=t[0],o=0;or[0]&&(r=s),s[1]i[1]&&(i=s)}var a=[e,n,r,i],u=a.slice();for(o=0;o1&&Xt(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(a),c=s.length;c>1&&Xt(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(a)}n=new Array(s.length+o.length-2);for(var l=0,h=(r=0,o.length);r0;--f)n[l++]=s[f];return n}(u),l=[];for(o=0;oo||a.push({node:l,dist:h})}for(;a.length&&!a.peek().node.children;){var f=a.pop(),p=f.node,d=he(p,e,n),g=he(p,r,i);if(f.dist=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function ae(t,e,n){for(var r,i,o,s,a=Math.min(t[0],e[0]),u=Math.min(t[1],e[1]),c=Math.max(t[0],e[0]),l=Math.max(t[1],e[1]),h=n.search({minX:a,minY:u,maxX:c,maxY:l}),f=0;f0!=Qt(r,i,s)>0&&Qt(o,s,r)>0!=Qt(o,s,i)>0)return!1;return!0}function ue(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function ce(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function le(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function he(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s}function fe(t,e,n,r,i,o,s,a){var u,c,l,h,f=n-t,p=r-e,d=s-i,g=a-o,y=t-i,v=e-o,m=f*f+p*p,_=f*d+p*g,b=d*d+g*g,w=f*y+p*v,x=d*y+g*v,O=m*b-_*_,E=O,S=O;0===O?(c=0,E=1,h=x,S=b):(h=m*x-_*w,(c=_*x-b*w)<0?(c=0,h=x,S=b):c>E&&(c=E,h=x+_,S=b)),h<0?(h=0,-w<0?c=0:-w>m?c=E:(c=-w,E=m)):h>S&&(h=S,-w+_<0?c=0:-w+_>m?c=E:(c=-w+_,E=m));var C=(1-(l=0===h?0:h/S))*i+l*s-((1-(u=0===c?0:c/E))*t+u*n),N=(1-l)*o+l*a-((1-u)*e+u*r);return C*C+N*N}function pe(t,e){void 0===e&&(e={}),e.concavity=e.concavity||1/0;var n=[];if(A(t,(function(t){n.push([t[0],t[1]])})),!n.length)return null;var r=te(n,e.concavity);return r.length>3?l([r]):null}function de(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=$(t),i=it(e),o=i.type,s=e.bbox,a=i.coordinates;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(r,s))return!1;"Polygon"===o&&(a=[a]);for(var u=!1,c=0;ct[1]!=c>t[1]&&t[0]<(u-s)*(t[1]-a)/(c-a)+s&&(r=!r)}return r}function ye(t,e){var n=[];return k(t,(function(t){var r=!1;if("Point"===t.geometry.type)G(e,(function(e){de(t,e)&&(r=!0)})),r&&n.push(t);else{if("MultiPoint"!==t.geometry.type)throw new Error("Input geometry must be a Point or MultiPoint");var i=[];G(e,(function(e){A(t,(function(t){de(t,e)&&(r=!0,i.push(t))}))})),r&&n.push(y(i))}})),d(n)}function ve(t,e,n){void 0===n&&(n={});var r=$(t),i=$(e),o=S(i[1]-r[1]),s=S(i[0]-r[0]),a=S(r[1]),u=S(i[1]),c=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(u);return b(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),n.units)}function me(t,e){var n=!1;return d(function(t){if(t.length<3)return[];t.sort(be);for(var e,n,r,i,o,s,a=t.length-1,u=t[a].x,c=t[0].x,l=t[a].y,h=l;a--;)t[a].yh&&(h=t[a].y);var f,p=c-u,d=h-l,g=p>d?p:d,y=.5*(c+u),v=.5*(h+l),m=[new _e({__sentinel:!0,x:y-20*g,y:v-g},{__sentinel:!0,x:y,y:v+20*g},{__sentinel:!0,x:y+20*g,y:v-g})],_=[],b=[];for(a=t.length;a--;){for(b.length=0,f=m.length;f--;)(p=t[a].x-m[f].x)>0&&p*p>m[f].r?(_.push(m[f]),m.splice(f,1)):p*p+(d=t[a].y-m[f].y)*d>m[f].r||(b.push(m[f].a,m[f].b,m[f].b,m[f].c,m[f].c,m[f].a),m.splice(f,1));for(we(b),f=b.length;f;)n=b[--f],e=b[--f],r=t[a],i=n.x-e.x,o=n.y-e.y,s=2*(i*(r.y-n.y)-o*(r.x-n.x)),Math.abs(s)>1e-12&&m.push(new _e(e,n,r))}for(Array.prototype.push.apply(_,m),a=_.length;a--;)(_[a].a.__sentinel||_[a].b.__sentinel||_[a].c.__sentinel)&&_.splice(a,1);return _}(t.features.map((function(t){var r={x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]};return e?r.z=t.properties[e]:3===t.geometry.coordinates.length&&(n=!0,r.z=t.geometry.coordinates[2]),r}))).map((function(t){var e=[t.a.x,t.a.y],r=[t.b.x,t.b.y],i=[t.c.x,t.c.y],o={};return n?(e.push(t.a.z),r.push(t.b.z),i.push(t.c.z)):o={a:t.a.z,b:t.b.z,c:t.c.z},l([[e,r,i,e]],o)})))}te.default=ee;var _e=function(t,e,n){this.a=t,this.b=e,this.c=n;var r,i,o=e.x-t.x,s=e.y-t.y,a=n.x-t.x,u=n.y-t.y,c=o*(t.x+e.x)+s*(t.y+e.y),l=a*(t.x+n.x)+u*(t.y+n.y),h=2*(o*(n.y-e.y)-s*(n.x-e.x));this.x=(u*c-s*l)/h,this.y=(o*l-a*c)/h,r=this.x-t.x,i=this.y-t.y,this.r=r*r+i*i};function be(t,e){return e.x-t.x}function we(t){var e,n,r,i,o,s=t.length;t:for(;s;)for(n=t[--s],e=t[--s],r=s;r;)if(o=t[--r],e===(i=t[--r])&&n===o||e===o&&n===i){t.splice(s,2),t.splice(r,2),s-=2;continue t}}function xe(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return Oe(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"features":return;default:e[n]=t[n]}})),e.features=t.features.map((function(t){return Oe(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Ee(t);default:throw new Error("unknown GeoJSON type")}}function Oe(t){var e={type:"Feature"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}})),e.properties=function t(e){var n={};return e?(Object.keys(e).forEach((function(r){var i=e[r];"object"==typeof i?null===i?n[r]=null:Array.isArray(i)?n[r]=i.map((function(t){return t})):n[r]=t(i):n[r]=i})),n):n}(t.properties),e.geometry=Ee(t.geometry),e}function Ee(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return Ee(t)})),e):(e.coordinates=function t(e){var n=e;return"object"!=typeof n[0]?n.slice():n.map((function(e){return t(e)}))}(t.coordinates),e)}function Se(t){return t[0].toString()+","+t[1].toString()}function Ce(t){return t}function Ne(t,e){var n=function(t){if(null==t)return Ce;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,a){a||(e=n=0);var u=2,c=t.length,l=new Array(c);for(l[0]=(e+=t[0])*r+o,l[1]=(n+=t[1])*i+s;u1)for(var o,a,u=1,c=s(i[0]);uc&&(a=i[0],i[0]=i[u],i[u]=a,c=o);return i})).filter((function(t){return t.length>0}))}}var Le=Object.prototype.hasOwnProperty;function Ie(t,e,n,r,i,o){3===arguments.length&&(r=o=Array,i=null);for(var s=new r(t=1<=t)throw new Error("full hashmap");l=s[c=c+1&u]}return s[c]=r,a[c]=o,o}function h(r,o){for(var c=e(r)&u,l=s[c],h=0;l!=i;){if(n(l,r))return a[c];if(++h>=t)throw new Error("full hashmap");l=s[c=c+1&u]}return s[c]=r,a[c]=o,o}function f(r,o){for(var c=e(r)&u,l=s[c],h=0;l!=i;){if(n(l,r))return a[c];if(++h>=t)break;l=s[c=c+1&u]}return o}function p(){for(var t=[],e=0,n=s.length;e>7^Re[2]^Re[3])}function Fe(t,e,n,r){ke(t,e,n),ke(t,e,e+r),ke(t,e+r,n)}function ke(t,e,n){for(var r,i=e+(n---e>>1);er&&(r=o),si&&(i=s)}function u(t){t.forEach(a)}function c(t){t.forEach(u)}for(var l in t)o(t[l]);return r>=e&&i>=n?[e,n,r,i]:void 0}(t=function(t){var e,n,r={};for(e in t)r[e]=null==(n=t[e])?{type:null}:("FeatureCollection"===n.type?De:"Feature"===n.type?Be:Ge)(n);return r}(t)),r=e>0&&n&&function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=o-r?(n-1)/(o-r):1,u=s-i?(n-1)/(s-i):1;function c(t){return[Math.round((t[0]-r)*a),Math.round((t[1]-i)*u)]}function l(t,e){for(var n,o,s,c,l,h=-1,f=0,p=t.length,d=new Array(p);++h=0){var o=h[n];i===e&&o===r||i===r&&o===e||(++p,f[n]=1)}else l[n]=e,h[n]=r}}function w(t){return Te(o[t])}function x(t,e){return Pe(o[t],o[e])}c=l=h=null;var O,E=function(t,e,n,r,i){3===arguments.length&&(r=Array,i=null);for(var o=new r(t=1<=t)throw new Error("full hashset");u=o[a=a+1&s]}return o[a]=r,!0}function c(r){for(var a=e(r)&s,u=o[a],c=0;u!=i;){if(n(u,r))return!0;if(++c>=t)break;u=o[a=a+1&s]}return!1}function l(){for(var t=[],e=0,n=o.length;e2&&He(n[i-3],n[i-1],n[i-2])&&n.splice(n.length-2,1))}if(n.push(e[e.length-1]),i=n.length,Xe(e[0],e[e.length-1])&&i<4)throw new Error("invalid polygon");return He(n[i-3],n[i-1],n[i-2])&&n.splice(n.length-2,1),n}function Xe(t,e){return t[0]===e[0]&&t[1]===e[1]}function He(t,e,n){var r=n[0],i=n[1],o=t[0],s=t[1],a=e[0],u=e[1],c=a-o,l=u-s;return 0==(r-o)*l-(i-s)*c&&(Math.abs(c)>=Math.abs(l)?c>0?o<=r&&r<=a:a<=r&&r<=o:l>0?s<=i&&i<=u:u<=i&&i<=s)}function Ke(t,e,n){var r=e.x,i=e.y,o=n.x-r,s=n.y-i;if(0!==o||0!==s){var a=((t.x-r)*o+(t.y-i)*s)/(o*o+s*s);a>1?(r=n.x,i=n.y):a>0&&(r+=o*a,i+=s*a)}return(o=t.x-r)*o+(s=t.y-i)*s}function Ze(t,e){var n=t.length-1,r=[t[0]];return function t(e,n,r,i,o){for(var s,a=i,u=n+1;ua&&(s=u,a=c)}a>i&&(s-n>1&&t(e,n,s,i,o),o.push(e[s]),r-s>1&&t(e,s,r,i,o))}(t,0,n,e,r),r.push(t[n]),r}function Je(t,e,n){if(t.length<=2)return t;var r=void 0!==e?e*e:1;return Ze(t=n?t:function(t,e){for(var n,r,i,o,s,a=t[0],u=[a],c=1,l=t.length;ce&&(u.push(n),a=n);return a!==n&&u.push(n),u}(t,r),r)}function $e(t,e,n){return Je(t.map((function(t){return{x:t[0],y:t[1],z:t[2]}})),e,n).map((function(t){return t.z?[t.x,t.y,t.z]:[t.x,t.y]}))}function Qe(t,e,n){return t.map((function(t){var r=t.map((function(t){return{x:t[0],y:t[1]}}));if(r.length<4)throw new Error("invalid polygon");for(var i=Je(r,e,n).map((function(t){return[t.x,t.y]}));!tn(i);)i=Je(r,e-=.01*e,n).map((function(t){return[t.x,t.y]}));return i[i.length-1][0]===i[0][0]&&i[i.length-1][1]===i[0][1]||i.push(i[0]),i}))}function tn(t){return!(t.length<3||3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1])}var en=function(){function t(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;et&&(e.push(r),n=i)}return e},t.prototype.vector=function(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}},t.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var r=Math.floor((this.points.length-1)*n);return function(t,e,n,r,i){var o=function(t){var e=t*t;return[e*t,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t);return{x:i.x*o[0]+r.x*o[1]+n.x*o[2]+e.x*o[3],y:i.y*o[0]+r.y*o[1]+n.y*o[2]+e.y*o[3],z:i.z*o[0]+r.z*o[1]+n.z*o[2]+e.z*o[3]}}((this.length-1)*n-r,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])},t}();function nn(t,e){void 0===e&&(e={});for(var n=e.resolution||1e4,r=e.sharpness||.85,i=[],o=it(t).coordinates.map((function(t){return{x:t[0],y:t[1]}})),s=new en({duration:n,points:o,sharpness:r}),a=function(t){var e=s.pos(t);Math.floor(t/100)%2==0&&i.push([e.x,e.y])},u=0;u=ve(t.slice(0,2),[e,i])){var o=(n+i)/2;return[e,o-(r-e)/2,r,o+(r-e)/2]}var s=(e+r)/2;return[s-(i-n)/2,n,s+(i-n)/2,i]}function an(t,e,n,r){void 0===r&&(r={});var i=$(t),o=S(i[0]),s=S(i[1]),a=S(n),c=w(e,r.units),l=Math.asin(Math.sin(s)*Math.cos(c)+Math.cos(s)*Math.sin(c)*Math.cos(a));return u([E(o+Math.atan2(Math.sin(a)*Math.sin(c)*Math.cos(s),Math.cos(c)-Math.sin(s)*Math.sin(l))),E(l)],r.properties)}function un(t,e,n){void 0===n&&(n={});for(var r=n.steps||64,i=n.properties?n.properties:!Array.isArray(t)&&"Feature"===t.type&&t.properties?t.properties:{},o=[],s=0;s80*n){r=o=t[0],i=s=t[1];for(var d=n;do&&(o=a),u>s&&(s=u);c=0!==(c=Math.max(o-r,s-i))?1/c:0}return mn(f,p,n,r,i,c),p}function yn(t,e,n,r,i){var o,s;if(i===kn(t,e,n,r)>0)for(o=e;o=e;o-=r)s=Rn(o,t[o],t[o+1],s);return s&&In(s,s.next)&&(Tn(s),s=s.next),s}function vn(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!In(r,r.next)&&0!==Ln(r.prev,r,r.next))r=r.next;else{if(Tn(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function mn(t,e,n,r,i,o,s){if(t){!s&&o&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=Sn(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,s,a,u,c=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,r=n,a=0,e=0;e0||u>0&&r;)0!==a&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(s>1)}(i)}(t,r,i,o);for(var a,u,c=t;t.prev!==t.next;)if(a=t.prev,u=t.next,o?bn(t,r,i,o):_n(t))e.push(a.i/n),e.push(t.i/n),e.push(u.i/n),Tn(t),t=u.next,c=u.next;else if((t=u)===c){s?1===s?mn(t=wn(t,e,n),e,n,r,i,o,2):2===s&&xn(t,e,n,r,i,o):mn(vn(t),e,n,r,i,o,1);break}}}function _n(t){var e=t.prev,n=t,r=t.next;if(Ln(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Nn(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Ln(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function bn(t,e,n,r){var i=t.prev,o=t,s=t.next;if(Ln(i,o,s)>=0)return!1;for(var a=i.xo.x?i.x>s.x?i.x:s.x:o.x>s.x?o.x:s.x,l=i.y>o.y?i.y>s.y?i.y:s.y:o.y>s.y?o.y:s.y,h=Sn(a,u,e,n,r),f=Sn(c,l,e,n,r),p=t.prevZ,d=t.nextZ;p&&p.z>=h&&d&&d.z<=f;){if(p!==t.prev&&p!==t.next&&Nn(i.x,i.y,o.x,o.y,s.x,s.y,p.x,p.y)&&Ln(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,d!==t.prev&&d!==t.next&&Nn(i.x,i.y,o.x,o.y,s.x,s.y,d.x,d.y)&&Ln(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&Nn(i.x,i.y,o.x,o.y,s.x,s.y,p.x,p.y)&&Ln(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&Nn(i.x,i.y,o.x,o.y,s.x,s.y,d.x,d.y)&&Ln(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function wn(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!In(i,o)&&Pn(i,r,r.next,o)&&jn(i,o)&&jn(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),Tn(r),Tn(r.next),r=t=o),r=r.next}while(r!==t);return r}function xn(t,e,n,r,i,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&Mn(s,a)){var u=An(s,a);return s=vn(s,s.next),u=vn(u,u.next),mn(s,e,n,r,i,o),void mn(u,e,n,r,i,o)}a=a.next}s=s.next}while(s!==t)}function On(t,e){return t.x-e.x}function En(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&a>s){if(s=a,a===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x=r.x&&r.x>=l&&i!==r.x&&Nn(on.x)&&jn(r,t)&&(n=r,f=u),r=r.next;return n}(t,e)){var n=An(e,t);vn(n,n.next)}}function Sn(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Cn(t){var e=t,n=t;do{e.x=0&&(t-s)*(r-a)-(n-s)*(e-a)>=0&&(n-s)*(o-a)-(i-s)*(r-a)>=0}function Mn(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Pn(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&jn(t,e)&&jn(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)}function Ln(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function In(t,e){return t.x===e.x&&t.y===e.y}function Pn(t,e,n,r){return!!(In(t,e)&&In(n,r)||In(t,r)&&In(n,e))||Ln(t,e,n)>0!=Ln(t,e,r)>0&&Ln(n,r,t)>0!=Ln(n,r,e)>0}function jn(t,e){return Ln(t.prev,t,t.next)<0?Ln(t,e,t.next)>=0&&Ln(t,t.prev,e)>=0:Ln(t,e,t.prev)<0||Ln(t,t.next,e)<0}function An(t,e){var n=new Fn(t.i,t.x,t.y),r=new Fn(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Rn(t,e,n,r){var i=new Fn(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Tn(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Fn(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function kn(t,e,n,r){for(var i=0,o=e,s=n-r;o0&&(r+=t[i-1].length,n.holes.push(r))}return n}(t),n=pn(e.vertices,e.holes,2),r=[],i=[];n.forEach((function(t,r){var o=n[r];i.push([e.vertices[2*o],e.vertices[2*o+1]])}));for(var o=0;oi?n:i,r>o?r:o]}(t,r),n.push(i),r})),n})(n,t.properties).forEach((function(t){t.id=e.length,e.push(t)}))}))}}(t,e)})),d(e)}gn.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,s=Math.abs(kn(t,0,o,n));if(i)for(var a=0,u=e.length;a0&&(r+=t[i-1].length,n.holes.push(r))}return n},pn.default=dn;var qn=Bt((function(t,e){function n(t,e,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function r(t,e,r){if(void 0===r&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!p(t[0])||!p(t[1]))throw new Error("coordinates must contain numbers");return n({type:"Point",coordinates:t},e,r)}function i(t,e,r){void 0===r&&(r={});for(var i=0,o=t;i=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n},e.radiansToLength=l,e.lengthToRadians=h,e.lengthToDegrees=function(t,e){return f(h(t,e))},e.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},e.radiansToDegrees=f,e.degreesToRadians=function(t){return t%360*Math.PI/180},e.convertLength=function(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("length must be a positive number");return l(h(t,e),n)},e.convertArea=function(t,n,r){if(void 0===n&&(n="meters"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=e.areaFactors[n];if(!i)throw new Error("invalid original units");var o=e.areaFactors[r];if(!o)throw new Error("invalid final units");return t/i*o},e.isNumber=p,e.isObject=function(t){return!!t&&t.constructor===Object},e.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!p(t))throw new Error("bbox must only contain numbers")}))},e.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}}));function zn(t,e,n){if(null!==t)for(var r,i,o,s,a,u,c,l,h=0,f=0,p=t.type,d="FeatureCollection"===p,g="Feature"===p,y=d?t.features.length:1,v=0;va||f>u||p>c)return s=o,a=n,u=f,c=p,void(i=0);var d=qn.lineString([s,o],t.properties);if(!1===e(d,n,r,p,i))return!1;i++,s=o}))&&void 0}}}))}function Hn(t,e){if(!t)throw new Error("geojson is required");Wn(t,(function(t,n,r){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,n,r,0,0))return!1;break;case"Polygon":for(var s=0;st[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2] line1 must only contain 2 coordinates");if(2!==r.length)throw new Error(" line2 must only contain 2 coordinates");var i=n[0][0],o=n[0][1],s=n[1][0],a=n[1][1],c=r[0][0],l=r[0][1],h=r[1][0],f=r[1][1],p=(f-l)*(s-i)-(h-c)*(a-o);if(0===p)return null;var d=((h-c)*(o-l)-(f-l)*(i-c))/p,g=((s-i)*(o-l)-(a-o)*(i-c))/p;return d>=0&&d<=1&&g>=0&&g<=1?u([i+d*(s-i),o+d*(a-o)]):null}function pr(t,e,n){void 0===n&&(n={});var r=u([1/0,1/0],{dist:1/0}),i=0;return z(t,(function(t){for(var o=Q(t),s=0;s0&&((v=y.features[0]).properties.dist=ve(e,v,n),v.properties.location=i+ve(a,v,n)),a.properties.dist180?-360:i[0]-o[0]>180?360:0,C(function(t,e,r){var i=r=void 0===r?n:Number(r),o=t[1]*Math.PI/180,s=e[1]*Math.PI/180,a=s-o,u=Math.abs(e[0]-t[0])*Math.PI/180;u>Math.PI&&(u-=2*Math.PI);var c=Math.log(Math.tan(s/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),l=Math.abs(c)>1e-11?a/c:Math.cos(o);return Math.sqrt(a*a+l*l*u*u)*i}(i,o),"meters",r.units)}function gr(t,e,n){if(void 0===n&&(n={}),n.method||(n.method="geodesic"),n.units||(n.units="kilometers"),!t)throw new Error("pt is required");if(Array.isArray(t)?t=u(t):"Point"===t.type?t=s(t):nt(t,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=f(e):"LineString"===e.type?e=s(e):nt(e,"LineString","line");var r=1/0,i=t.geometry.coordinates;return V(e,(function(t){var e=t.geometry.coordinates[0],o=t.geometry.coordinates[1],s=function(t,e,n,r){var i=[n[0]-e[0],n[1]-e[1]],o=yr([t[0]-e[0],t[1]-e[1]],i);if(o<=0)return vr(t,e,{method:r.method,units:"degrees"});var s=yr(i,i);if(s<=o)return vr(t,n,{method:r.method,units:"degrees"});var a=o/s;return vr(t,[e[0]+a*i[0],e[1]+a*i[1]],{method:r.method,units:"degrees"})}(i,e,o,n);s=0&&c<=1&&(f.onLine1=!0),l>=0&&l<=1&&(f.onLine2=!0),!(!f.onLine1||!f.onLine2)&&[f.x,f.y])}function _r(t){for(var e=function(t){return"FeatureCollection"!==t.type?"Feature"!==t.type?d([s(t)]):d([t]):t}(t),n=ln(e),r=!1,i=0;!r&&i0){e+=Math.abs(Or(t[0]));for(var n=1;n2){for(s=0;s=l&&h===i.length-1);h++){if(l>e&&0===o.length){if(!(s=e-l))return o.push(i[h]),f(o);a=cn(i[h],i[h-1])-180,u=an(i[h],s,a,r),o.push(u.geometry.coordinates)}if(l>=n)return(s=n-l)?(a=cn(i[h],i[h-1])-180,u=an(i[h],s,a,r),o.push(u.geometry.coordinates),f(o)):(o.push(i[h]),f(o));if(l>=e&&o.push(i[h]),h===i.length-1)return f(o);l+=ve(i[h],i[h+1],r)}if(li)return!1}else if(0!==p)return!1;return r?"start"===r?Math.abs(h)>=Math.abs(f)?h>0?a0?u=Math.abs(f)?h>0?a<=o&&o0?u<=s&&s=Math.abs(f)?h>0?a0?u=Math.abs(f)?h>0?a<=o&&o<=c:c<=o&&o<=a:f>0?u<=s&&s<=l:l<=s&&s<=u}function Lr(t,e){var n=it(t),r=it(e),i=n.type,o=r.type;switch(i){case"Point":switch(o){case"MultiPoint":return function(t,e){var n,r=!1;for(n=0;ne[0]||t[2]e[1]||t[3] is required");if("number"!=typeof n)throw new Error(" must be a number");if("number"!=typeof r)throw new Error(" must be a number");!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t)));var o=Math.pow(10,n);return A(t,(function(t){!function(t,e,n){t.length>n&&t.splice(n,t.length);for(var r=0;r=1||u<=0||c>=1||c<=0))){var g=d,y=!o[g];y&&(o[g]=!0),e?i.push(e(d,t,n,l,h,u,s,a,f,p,c,y)):i.push(d)}}function g(t,e){var n,i,o,s,a=r[t][e],u=r[t][e+1];return a[0]f[e.isect].coord?-1:1})),u=[];x.length>0;){var N=x.pop(),M=N.isect,L=N.parent,I=N.winding,P=u.length,j=[f[M].coord],A=M;if(f[M].ringAndEdge1Walkable)var R=f[M].ringAndEdge1,T=f[M].nxtIsectAlongRingAndEdge1;else R=f[M].ringAndEdge2,T=f[M].nxtIsectAlongRingAndEdge2;for(;!zr(f[M].coord,f[T].coord);){j.push(f[T].coord);var F=void 0;for(r=0;r1)for(e=0;e=0==e}function qr(t){for(var e=0,n=0;n1&&n.push(f(c)),d(n)}function $r(t,e){if(!e.features.length)throw new Error("lines must contain features");if(1===e.features.length)return e.features[0];var n,r=1/0;return k(e,(function(e){var i=pr(e,t).properties.dist;il&&p.push(an(t,e,l,i).geometry.coordinates),f(p,u)}function ei(t){var e=t%360;return e<0&&(e+=360),e}function ni(t,e){void 0===e&&(e={});var n=it(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),n.type){case"Polygon":return ri(n,e);case"MultiPolygon":return function(t,e){void 0===e&&(e={});var n=it(t).coordinates,r=e.properties?e.properties:"Feature"===t.type?t.properties:{},i=[];return n.forEach((function(t){i.push(ii(t,r))})),d(i)}(n,e);default:throw new Error("invalid poly")}}function ri(t,e){return void 0===e&&(e={}),ii(it(t).coordinates,e.properties?e.properties:"Feature"===t.type?t.properties:{})}function ii(t,e){return t.length>1?g(t,e):f(t[0],e)}function oi(t,e){var n,r,i;void 0===e&&(e={});var o=e.properties,s=null===(n=e.autoComplete)||void 0===n||n,a=null===(r=e.orderCoords)||void 0===r||r;switch(null!==(i=e.mutate)&&void 0!==i&&i||(t=xe(t)),t.type){case"FeatureCollection":var u=[];return t.features.forEach((function(t){u.push(Q(si(t,{},s,a)))})),v(u,o);default:return si(t,o,s,a)}}function si(t,e,n,r){e=e||("Feature"===t.type?t.properties:{});var i=it(t),o=i.coordinates,s=i.type;if(!o.length)throw new Error("line must contain coordinates");switch(s){case"LineString":return n&&(o=ai(o)),l([o],e);case"MultiLineString":var a=[],u=0;return o.forEach((function(t){if(n&&(t=ai(t)),r){var e=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.abs(e-r)*Math.abs(n-i)}(J(f(t)));e>u?(a.unshift(t),u=e):a.push(t)}else a.push(t)})),l(a,e);default:throw new Error("geometry type "+s+" is not supported")}}function ai(t){var e=t[0],n=e[0],r=e[1],i=t[t.length-1],o=i[0],s=i[1];return n===o&&r===s||t.push(e),t}function ui(t,e){var n,r,i,o,s,a,u;for(r=1;r<=8;r*=2){for(n=[],o=!(li(i=t[t.length-1],e)&r),s=0;se[2]&&(n|=2),t[1]e[3]&&(n|=8),n}function hi(t,e){for(var n=[],r=0,i=t;r0&&(o[0][0]===o[o.length-1][0]&&o[0][1]===o[o.length-1][1]||o.push(o[0]),o.length>=4&&n.push(o))}return n}Kr.prototype.interpolate=function(t){var e=Math.sin((1-t)*this.g)/Math.sin(this.g),n=Math.sin(t*this.g)/Math.sin(this.g),r=e*Math.cos(this.start.y)*Math.cos(this.start.x)+n*Math.cos(this.end.y)*Math.cos(this.end.x),i=e*Math.cos(this.start.y)*Math.sin(this.start.x)+n*Math.cos(this.end.y)*Math.sin(this.end.x),o=e*Math.sin(this.start.y)+n*Math.sin(this.end.y),s=Yr*Math.atan2(o,Math.sqrt(Math.pow(r,2)+Math.pow(i,2)));return[Yr*Math.atan2(i,r),s]},Kr.prototype.Arc=function(t,e){var n=[];if(!t||t<=2)n.push([this.start.lon,this.start.lat]),n.push([this.end.lon,this.end.lat]);else for(var r=1/(t-1),i=0;if&&(g>l&&dl&&gu&&(u=y)}var v=[];if(a&&u0&&Math.abs(b-n[_-1][0])>f){var w=parseFloat(n[_-1][0]),x=parseFloat(n[_-1][1]),O=parseFloat(n[_][0]),E=parseFloat(n[_][1]);if(w>-180&&w-180&&n[_-1][0]l&&w<180&&-180===O&&_+1l&&n[_-1][0]<180){m.push([180,n[_][1]]),_++,m.push([n[_][0],n[_][1]]);continue}if(wl){var S=w;w=O,O=S;var C=x;x=E,E=C}if(w>l&&O=180&&wl?180:-180,M]),(m=[]).push([n[_-1][0]>l?-180:180,M]),v.push(m)}else m=[],v.push(m);m.push([b,n[_][1]])}else m.push([n[_][0],n[_][1]])}}else{var L=[];v.push(L);for(var I=0;I=0;a--)if(c[a]!=l[a])return!1;for(a=c.length-1;a>=0;a--)if(u=c[a],!n(t[u],o[u],s))return!1;return typeof t==typeof o}(t,o,s))};function r(t){return null==t}function i(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length||"function"!=typeof t.copy||"function"!=typeof t.slice||t.length>0&&"number"!=typeof t[0])}}));function gi(t,e,n){if(void 0===n&&(n={}),!L(n=n||{}))throw new Error("options is invalid");var r,i=n.tolerance||0,o=[],s=cr(),a=Gn(t);return s.load(a),V(e,(function(t){var e=!1;t&&(k(s.search(t),(function(n){if(!1===e){var o=Q(t).sort(),s=Q(n).sort();di(o,s)||(0===i?Nr(o[0],n)&&Nr(o[1],n):pr(n,o[0]).properties.dist<=i&&pr(n,o[1]).properties.dist<=i)?(e=!0,r=r?yi(r,t):t):(0===i?Nr(s[0],t)&&Nr(s[1],t):pr(t,s[0]).properties.dist<=i&&pr(t,s[1]).properties.dist<=i)&&(r=r?yi(r,n):n)}})),!1===e&&r&&(o.push(r),r=void 0))})),r&&o.push(r),d(o)}function yi(t,e){var n=Q(e),r=Q(t),i=r[0],o=r[r.length-1],s=t.geometry.coordinates;return di(n[0],i)?s.unshift(n[1]):di(n[0],o)?s.push(n[1]):di(n[1],i)?s.unshift(n[0]):di(n[1],o)&&s.push(n[0]),t}function vi(t){var e=t%360;return e<0&&(e+=360),e}function mi(t,e,n){var r;return void 0===n&&(n={}),(r=n.final?_i($(e),$(t)):_i($(t),$(e)))>180?-(360-r):r}function _i(t,e){var n=S(t[1]),r=S(e[1]),i=S(e[0]-t[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var o=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4));return(E(Math.atan2(i,o))+360)%360}function bi(t,e,r,i){void 0===i&&(i={});var o=e<0,s=C(Math.abs(e),i.units,"meters");o&&(s=-Math.abs(s));var a=$(t),c=function(t,e,r,i){var o=e/(i=void 0===i?n:Number(i)),s=t[0]*Math.PI/180,a=S(t[1]),u=S(r),c=o*Math.cos(u),l=a+c;Math.abs(l)>Math.PI/2&&(l=l>0?Math.PI-l:-Math.PI-l);var h=Math.log(Math.tan(l/2+Math.PI/4)/Math.tan(a/2+Math.PI/4)),f=Math.abs(h)>1e-11?c/h:Math.cos(a);return[(180*(s+o*Math.sin(u)/f)/Math.PI+540)%360-180,180*l/Math.PI]}(a,s,r);return c[0]+=c[0]-a[0]>180?-360:a[0]-c[0]>180?360:0,u(c,i.properties)}function wi(t,e,n,r,i,o){for(var s=0;s0?Oi(e,a,i)<0||(i=a):n>0&&r<=0&&(xi(e,a,o)||(o=a)),n=r}return[i,o]}function xi(t,e,n){return Oi(t,e,n)>0}function Oi(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(e[1]-t[1])}function Ei(t){for(var e,n,r=Q(t),i=0,o=1;o0}function Si(t,e){switch("Feature"===t.type?t.geometry.type:t.type){case"GeometryCollection":return G(t,(function(t){Si(t,e)})),t;case"LineString":return Ci(Q(t),e),t;case"Polygon":return Ni(Q(t),e),t;case"MultiLineString":return Q(t).forEach((function(t){Ci(t,e)})),t;case"MultiPolygon":return Q(t).forEach((function(t){Ni(t,e)})),t;case"Point":case"MultiPoint":return t}}function Ci(t,e){Ei(t)===e&&t.reverse()}function Ni(t,e){Ei(t[0])!==e&&t[0].reverse();for(var n=1;ns?128:64,c|=hs?32:16,c|=fs?8:4;var d=+(c|=ps?2:1),g=0;if(17===c||18===c||33===c||34===c||38===c||68===c||72===c||98===c||102===c||132===c||136===c||137===c||152===c||153===c){var y=(l+h+f+p)/4;g=y>s?2:y0?(c=156,g=4):c=152:33===c?g>0?(c=139,g=4):c=137:72===c?g>0?(c=99,g=4):c=98:132===c&&(g>0?(c=39,g=4):c=38)}if(0!=c&&170!=c){var v,m,_,b,w,x,O,E;v=m=_=b=w=x=O=E=.5;var S=[];1===c?(_=1-_o(e,f,p),E=1-_o(e,l,p),S.push(fo[c])):169===c?(_=_o(s,p,f),E=_o(s,p,l),S.push(fo[c])):4===c?(x=1-_o(e,h,f),b=_o(e,p,f),S.push(lo[c])):166===c?(x=_o(s,f,h),b=1-_o(s,f,p),S.push(lo[c])):16===c?(w=_o(e,f,h),m=_o(e,l,h),S.push(co[c])):154===c?(w=1-_o(s,h,f),m=1-_o(s,h,l),S.push(co[c])):64===c?(O=_o(e,p,l),v=1-_o(e,h,l),S.push(go[c])):106===c?(O=1-_o(s,l,p),v=_o(s,l,h),S.push(go[c])):168===c?(b=_o(s,p,f),_=_o(e,p,f),E=_o(e,p,l),O=_o(s,p,l),S.push(ho[c]),S.push(fo[c])):2===c?(b=1-_o(e,f,p),_=1-_o(s,f,p),E=1-_o(s,l,p),O=1-_o(e,l,p),S.push(ho[c]),S.push(fo[c])):162===c?(w=_o(s,f,h),x=_o(e,f,h),b=1-_o(e,f,p),_=1-_o(s,f,p),S.push(ho[c]),S.push(fo[c])):8===c?(w=1-_o(e,h,f),x=1-_o(s,h,f),b=_o(s,p,f),_=_o(e,p,f),S.push(co[c]),S.push(lo[c])):138===c?(w=1-_o(e,h,f),x=1-_o(s,h,f),v=1-_o(s,h,l),m=1-_o(e,h,l),S.push(co[c]),S.push(lo[c])):32===c?(w=_o(s,f,h),x=_o(e,f,h),v=_o(e,l,h),m=_o(s,l,h),S.push(co[c]),S.push(lo[c])):42===c?(E=1-_o(s,l,p),O=1-_o(e,l,p),v=_o(e,l,h),m=_o(s,l,h),S.push(po[c]),S.push(go[c])):128===c&&(E=_o(e,p,l),O=_o(s,p,l),v=1-_o(s,h,l),m=1-_o(e,h,l),S.push(po[c]),S.push(go[c])),5===c?(x=1-_o(e,h,f),E=1-_o(e,l,p),S.push(lo[c])):165===c?(x=_o(s,f,h),E=_o(s,p,l),S.push(lo[c])):20===c?(b=_o(e,p,f),m=_o(e,l,h),S.push(ho[c])):150===c?(b=1-_o(s,f,p),m=1-_o(s,h,l),S.push(ho[c])):80===c?(w=_o(e,f,h),O=_o(e,p,l),S.push(co[c])):90===c?(w=1-_o(s,h,f),O=1-_o(s,l,p),S.push(co[c])):65===c?(_=1-_o(e,f,p),v=1-_o(e,h,l),S.push(fo[c])):105===c?(_=_o(s,p,f),v=_o(s,l,h),S.push(fo[c])):160===c?(w=_o(s,f,h),x=_o(e,f,h),E=_o(e,p,l),O=_o(s,p,l),S.push(co[c]),S.push(lo[c])):10===c?(w=1-_o(e,h,f),x=1-_o(s,h,f),E=1-_o(s,l,p),O=1-_o(e,l,p),S.push(co[c]),S.push(lo[c])):130===c?(b=1-_o(e,f,p),_=1-_o(s,f,p),v=1-_o(s,h,l),m=1-_o(e,h,l),S.push(ho[c]),S.push(fo[c])):40===c?(b=_o(s,p,f),_=_o(e,p,f),v=_o(e,l,h),m=_o(s,l,h),S.push(ho[c]),S.push(fo[c])):101===c?(x=_o(s,f,h),v=_o(s,l,h),S.push(lo[c])):69===c?(x=1-_o(e,h,f),v=1-_o(e,h,l),S.push(lo[c])):149===c?(E=_o(s,p,l),m=1-_o(s,h,l),S.push(po[c])):21===c?(E=1-_o(e,l,p),m=_o(e,l,h),S.push(po[c])):86===c?(b=1-_o(s,f,p),O=1-_o(s,l,p),S.push(ho[c])):84===c?(b=_o(e,p,f),O=_o(e,p,l),S.push(ho[c])):89===c?(w=1-_o(s,h,f),_=_o(s,p,f),S.push(fo[c])):81===c?(w=_o(e,f,h),_=1-_o(e,f,p),S.push(fo[c])):96===c?(w=_o(s,f,h),x=_o(e,f,h),O=_o(e,p,l),v=_o(s,l,h),S.push(co[c]),S.push(lo[c])):74===c?(w=1-_o(e,h,f),x=1-_o(s,h,f),O=1-_o(s,l,p),v=1-_o(e,h,l),S.push(co[c]),S.push(lo[c])):24===c?(w=1-_o(s,h,f),b=_o(s,p,f),_=_o(e,p,f),m=_o(e,l,h),S.push(co[c]),S.push(fo[c])):146===c?(w=_o(e,f,h),b=1-_o(e,f,p),_=1-_o(s,f,p),m=1-_o(s,h,l),S.push(co[c]),S.push(fo[c])):6===c?(x=1-_o(e,h,f),b=1-_o(s,f,p),E=1-_o(s,l,p),O=1-_o(e,l,p),S.push(lo[c]),S.push(ho[c])):164===c?(x=_o(s,f,h),b=_o(e,p,f),E=_o(e,p,l),O=_o(s,p,l),S.push(lo[c]),S.push(ho[c])):129===c?(_=1-_o(e,f,p),E=_o(s,p,l),v=1-_o(s,h,l),m=1-_o(e,h,l),S.push(fo[c]),S.push(po[c])):41===c?(_=_o(s,p,f),E=1-_o(e,l,p),v=_o(e,l,h),m=_o(s,l,h),S.push(fo[c]),S.push(po[c])):66===c?(b=1-_o(e,f,p),_=1-_o(s,f,p),O=1-_o(s,l,p),v=1-_o(e,h,l),S.push(ho[c]),S.push(fo[c])):104===c?(b=_o(s,p,f),_=_o(e,p,f),O=_o(e,p,l),v=_o(s,l,h),S.push(fo[c]),S.push(yo[c])):144===c?(w=_o(e,f,h),E=_o(e,p,l),O=_o(s,p,l),m=1-_o(s,h,l),S.push(co[c]),S.push(go[c])):26===c?(w=1-_o(s,h,f),E=1-_o(s,l,p),O=1-_o(e,l,p),m=_o(e,l,h),S.push(co[c]),S.push(go[c])):36===c?(x=_o(s,f,h),b=_o(e,p,f),v=_o(e,l,h),m=_o(s,l,h),S.push(lo[c]),S.push(ho[c])):134===c?(x=1-_o(e,h,f),b=1-_o(s,f,p),v=1-_o(s,h,l),m=1-_o(e,h,l),S.push(lo[c]),S.push(ho[c])):9===c?(w=1-_o(e,h,f),x=1-_o(s,h,f),_=_o(s,p,f),E=1-_o(e,l,p),S.push(co[c]),S.push(lo[c])):161===c?(w=_o(s,f,h),x=_o(e,f,h),_=1-_o(e,f,p),E=_o(s,p,l),S.push(co[c]),S.push(lo[c])):37===c?(x=_o(s,f,h),E=1-_o(e,l,p),v=_o(e,l,h),m=_o(s,l,h),S.push(lo[c]),S.push(po[c])):133===c?(x=1-_o(e,h,f),E=_o(s,p,l),v=1-_o(s,h,l),m=1-_o(e,h,l),S.push(lo[c]),S.push(po[c])):148===c?(b=_o(e,p,f),E=_o(e,p,l),O=_o(s,p,l),m=1-_o(s,h,l),S.push(ho[c]),S.push(go[c])):22===c?(b=1-_o(s,f,p),E=1-_o(s,l,p),O=1-_o(e,l,p),m=_o(e,l,h),S.push(ho[c]),S.push(go[c])):82===c?(w=_o(e,f,h),b=1-_o(e,f,p),_=1-_o(s,f,p),O=1-_o(s,l,p),S.push(co[c]),S.push(fo[c])):88===c?(w=1-_o(s,h,f),b=_o(s,p,f),_=_o(e,p,f),O=_o(e,p,l),S.push(co[c]),S.push(fo[c])):73===c?(w=1-_o(e,h,f),x=1-_o(s,h,f),_=_o(s,p,f),v=1-_o(e,h,l),S.push(co[c]),S.push(lo[c])):97===c?(w=_o(s,f,h),x=_o(e,f,h),_=1-_o(e,f,p),v=_o(s,l,h),S.push(co[c]),S.push(lo[c])):145===c?(w=_o(e,f,h),_=1-_o(e,f,p),E=_o(s,p,l),m=1-_o(s,h,l),S.push(co[c]),S.push(po[c])):25===c?(w=1-_o(s,h,f),_=_o(s,p,f),E=1-_o(e,l,p),m=_o(e,l,h),S.push(co[c]),S.push(po[c])):70===c?(x=1-_o(e,h,f),b=1-_o(s,f,p),O=1-_o(s,l,p),v=1-_o(e,h,l),S.push(lo[c]),S.push(ho[c])):100===c?(x=_o(s,f,h),b=_o(e,p,f),O=_o(e,p,l),v=_o(s,l,h),S.push(lo[c]),S.push(ho[c])):34===c?(0===g?(w=1-_o(e,h,f),x=1-_o(s,h,f),b=_o(s,p,f),_=_o(e,p,f),E=_o(e,p,l),O=_o(s,p,l),v=1-_o(s,h,l),m=1-_o(e,h,l)):(w=_o(s,f,h),x=_o(e,f,h),b=1-_o(e,f,p),_=1-_o(s,f,p),E=1-_o(s,l,p),O=1-_o(e,l,p),v=_o(e,l,h),m=_o(s,l,h)),S.push(co[c]),S.push(lo[c]),S.push(po[c]),S.push(go[c])):35===c?(4===g?(w=1-_o(e,h,f),x=1-_o(s,h,f),b=_o(s,p,f),_=_o(e,p,f),E=_o(e,p,l),O=_o(s,p,l),v=1-_o(s,h,l),m=1-_o(e,h,l)):(w=_o(s,f,h),x=_o(e,f,h),b=1-_o(e,f,p),_=1-_o(s,f,p),E=1-_o(s,l,p),O=1-_o(e,l,p),v=_o(e,l,h),m=_o(s,l,h)),S.push(co[c]),S.push(lo[c]),S.push(fo[c]),S.push(go[c])):136===c?(0===g?(w=_o(s,f,h),x=_o(e,f,h),b=1-_o(e,f,p),_=1-_o(s,f,p),E=1-_o(s,l,p),O=1-_o(e,l,p),v=_o(e,l,h),m=_o(s,l,h)):(w=1-_o(e,h,f),x=1-_o(s,h,f),b=_o(s,p,f),_=_o(e,p,f),E=_o(e,p,l),O=_o(s,p,l),v=1-_o(s,h,l),m=1-_o(e,h,l)),S.push(co[c]),S.push(lo[c]),S.push(po[c]),S.push(go[c])):153===c?(0===g?(w=_o(e,f,h),_=1-_o(e,f,p),E=1-_o(e,l,p),m=_o(e,l,h)):(w=1-_o(s,h,f),_=_o(s,p,f),E=_o(s,p,l),m=1-_o(s,h,l)),S.push(co[c]),S.push(fo[c])):102===c?(0===g?(x=1-_o(e,h,f),b=_o(e,p,f),O=_o(e,p,l),v=1-_o(e,h,l)):(x=_o(s,f,h),b=1-_o(s,f,p),O=1-_o(s,l,p),v=_o(s,l,h)),S.push(lo[c]),S.push(go[c])):155===c?(4===g?(w=_o(e,f,h),_=1-_o(e,f,p),E=1-_o(e,l,p),m=_o(e,l,h)):(w=1-_o(s,h,f),_=_o(s,p,f),E=_o(s,p,l),m=1-_o(s,h,l)),S.push(co[c]),S.push(po[c])):103===c?(4===g?(x=1-_o(e,h,f),b=_o(e,p,f),O=_o(e,p,l),v=1-_o(e,h,l)):(x=_o(s,f,h),b=1-_o(s,f,p),O=1-_o(s,l,p),v=_o(s,l,h)),S.push(lo[c]),S.push(ho[c])):152===c?(0===g?(w=_o(e,f,h),b=1-_o(e,f,p),_=1-_o(s,f,p),E=1-_o(s,l,p),O=1-_o(e,l,p),m=_o(e,l,h)):(w=1-_o(s,h,f),b=_o(s,p,f),_=_o(e,p,f),E=_o(e,p,l),O=_o(s,p,l),m=1-_o(s,h,l)),S.push(co[c]),S.push(ho[c]),S.push(fo[c])):156===c?(4===g?(w=_o(e,f,h),b=1-_o(e,f,p),_=1-_o(s,f,p),E=1-_o(s,l,p),O=1-_o(e,l,p),m=_o(e,l,h)):(w=1-_o(s,h,f),b=_o(s,p,f),_=_o(e,p,f),E=_o(e,p,l),O=_o(s,p,l),m=1-_o(s,h,l)),S.push(co[c]),S.push(fo[c]),S.push(go[c])):137===c?(0===g?(w=_o(s,f,h),x=_o(e,f,h),_=1-_o(e,f,p),E=1-_o(e,l,p),v=_o(e,l,h),m=_o(s,l,h)):(w=1-_o(e,h,f),x=1-_o(s,h,f),_=_o(s,p,f),E=_o(s,p,l),v=1-_o(s,h,l),m=1-_o(e,h,l)),S.push(co[c]),S.push(lo[c]),S.push(fo[c])):139===c?(4===g?(w=_o(s,f,h),x=_o(e,f,h),_=1-_o(e,f,p),E=1-_o(e,l,p),v=_o(e,l,h),m=_o(s,l,h)):(w=1-_o(e,h,f),x=1-_o(s,h,f),_=_o(s,p,f),E=_o(s,p,l),v=1-_o(s,h,l),m=1-_o(e,h,l)),S.push(co[c]),S.push(lo[c]),S.push(po[c])):98===c?(0===g?(w=1-_o(e,h,f),x=1-_o(s,h,f),b=_o(s,p,f),_=_o(e,p,f),O=_o(e,p,l),v=1-_o(e,h,l)):(w=_o(s,f,h),x=_o(e,f,h),b=1-_o(e,f,p),_=1-_o(s,f,p),O=1-_o(s,l,p),v=_o(s,l,h)),S.push(co[c]),S.push(lo[c]),S.push(go[c])):99===c?(4===g?(w=1-_o(e,h,f),x=1-_o(s,h,f),b=_o(s,p,f),_=_o(e,p,f),O=_o(e,p,l),v=1-_o(e,h,l)):(w=_o(s,f,h),x=_o(e,f,h),b=1-_o(e,f,p),_=1-_o(s,f,p),O=1-_o(s,l,p),v=_o(s,l,h)),S.push(co[c]),S.push(lo[c]),S.push(fo[c])):38===c?(0===g?(x=1-_o(e,h,f),b=_o(e,p,f),E=_o(e,p,l),O=_o(s,p,l),v=1-_o(s,h,l),m=1-_o(e,h,l)):(x=_o(s,f,h),b=1-_o(s,f,p),E=1-_o(s,l,p),O=1-_o(e,l,p),v=_o(e,l,h),m=_o(s,l,h)),S.push(lo[c]),S.push(po[c]),S.push(go[c])):39===c?(4===g?(x=1-_o(e,h,f),b=_o(e,p,f),E=_o(e,p,l),O=_o(s,p,l),v=1-_o(s,h,l),m=1-_o(e,h,l)):(x=_o(s,f,h),b=1-_o(s,f,p),E=1-_o(s,l,p),O=1-_o(e,l,p),v=_o(e,l,h),m=_o(s,l,h)),S.push(lo[c]),S.push(ho[c]),S.push(go[c])):85===c&&(w=1,x=0,b=1,_=0,E=0,O=1,v=0,m=1),(v<0||v>1||m<0||m>1||w<0||w>1||b<0||b>1||E<0||E>1||O<0||O>1)&&console.log("MarchingSquaresJS-isoBands: "+c+" "+d+" "+l+","+h+","+f+","+p+" "+g+" "+v+" "+m+" "+w+" "+x+" "+b+" "+_+" "+E+" "+O),o.cells[a][u]={cval:c,cval_real:d,flipped:g,topleft:v,topright:m,righttop:w,rightbottom:x,bottomright:b,bottomleft:_,leftbottom:E,lefttop:O,edges:S}}}}}return o}(t,e,n);return Li.polygons?(Li.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),u=function(t){var e=[],n=0;return t.cells.forEach((function(t,r){t.forEach((function(t,i){if(void 0!==t){var o=mo[t.cval](t);"object"==typeof o&&bo(o)?"object"==typeof o[0]&&bo(o[0])?"object"==typeof o[0][0]&&bo(o[0][0])?o.forEach((function(t){t.forEach((function(t){t[0]+=i,t[1]+=r})),e[n++]=t})):(o.forEach((function(t){t[0]+=i,t[1]+=r})),e[n++]=o):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}}))})),e}(c)):(Li.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),u=function(t){for(var e=[],n=t.rows,r=t.cols,i=[],o=0;o0){var a=xo(t.cells[o][s]),u=null,c=s,l=o;null!==a&&i.push([a.p[0]+c,a.p[1]+l]);do{if(null===(u=Oo(t.cells[l][c],a.x,a.y,a.o)))break;if(i.push([u.p[0]+c,u.p[1]+l]),c+=u.x,a=u,(l+=u.y)<0||l>=n||c<0||c>=r||void 0===t.cells[l][c]){var h=wo(t,c-=u.x,l-=u.y,u.x,u.y,u.o);if(null===h)break;h.path.forEach((function(t){i.push(t)})),c=h.i,l=h.j,a=h}}while(void 0!==t.cells[l][c]&&t.cells[l][c].edges.length>0);e.push(i),i=[],t.cells[o][s].edges.length>0&&s--}return e}(c)),"function"==typeof Li.successCallback&&Li.successCallback(u),u}var Pi=[],ji=[],Ai=[],Ri=[],Ti=[],Fi=[],ki=[],Di=[],Bi=[],Gi=[],qi=[],zi=[],Ui=[],Vi=[],Yi=[],Wi=[],Xi=[],Hi=[],Ki=[],Zi=[],Ji=[],$i=[],Qi=[],to=[];ki[85]=Gi[85]=-1,Di[85]=qi[85]=0,Bi[85]=zi[85]=1,Ki[85]=$i[85]=1,Zi[85]=Qi[85]=0,Ji[85]=to[85]=1,Pi[85]=Ri[85]=0,ji[85]=Ti[85]=-1,Ai[85]=Yi[85]=0,Wi[85]=Ui[85]=0,Xi[85]=Vi[85]=1,Fi[85]=Hi[85]=1,$i[1]=$i[169]=0,Qi[1]=Qi[169]=-1,to[1]=to[169]=0,Ui[1]=Ui[169]=-1,Vi[1]=Vi[169]=0,Yi[1]=Yi[169]=0,Gi[4]=Gi[166]=0,qi[4]=qi[166]=-1,zi[4]=zi[166]=1,Wi[4]=Wi[166]=1,Xi[4]=Xi[166]=0,Hi[4]=Hi[166]=0,ki[16]=ki[154]=0,Di[16]=Di[154]=1,Bi[16]=Bi[154]=1,Ri[16]=Ri[154]=1,Ti[16]=Ti[154]=0,Fi[16]=Fi[154]=1,Ki[64]=Ki[106]=0,Zi[64]=Zi[106]=1,Ji[64]=Ji[106]=0,Pi[64]=Pi[106]=-1,ji[64]=ji[106]=0,Ai[64]=Ai[106]=1,Ki[2]=Ki[168]=0,Zi[2]=Zi[168]=-1,Ji[2]=Ji[168]=1,$i[2]=$i[168]=0,Qi[2]=Qi[168]=-1,to[2]=to[168]=0,Ui[2]=Ui[168]=-1,Vi[2]=Vi[168]=0,Yi[2]=Yi[168]=0,Wi[2]=Wi[168]=-1,Xi[2]=Xi[168]=0,Hi[2]=Hi[168]=1,ki[8]=ki[162]=0,Di[8]=Di[162]=-1,Bi[8]=Bi[162]=0,Gi[8]=Gi[162]=0,qi[8]=qi[162]=-1,zi[8]=zi[162]=1,Ui[8]=Ui[162]=1,Vi[8]=Vi[162]=0,Yi[8]=Yi[162]=1,Wi[8]=Wi[162]=1,Xi[8]=Xi[162]=0,Hi[8]=Hi[162]=0,ki[32]=ki[138]=0,Di[32]=Di[138]=1,Bi[32]=Bi[138]=1,Gi[32]=Gi[138]=0,qi[32]=qi[138]=1,zi[32]=zi[138]=0,Pi[32]=Pi[138]=1,ji[32]=ji[138]=0,Ai[32]=Ai[138]=0,Ri[32]=Ri[138]=1,Ti[32]=Ti[138]=0,Fi[32]=Fi[138]=1,$i[128]=$i[42]=0,Qi[128]=Qi[42]=1,to[128]=to[42]=1,Ki[128]=Ki[42]=0,Zi[128]=Zi[42]=1,Ji[128]=Ji[42]=0,Pi[128]=Pi[42]=-1,ji[128]=ji[42]=0,Ai[128]=Ai[42]=1,Ri[128]=Ri[42]=-1,Ti[128]=Ti[42]=0,Fi[128]=Fi[42]=0,Gi[5]=Gi[165]=-1,qi[5]=qi[165]=0,zi[5]=zi[165]=0,$i[5]=$i[165]=1,Qi[5]=Qi[165]=0,to[5]=to[165]=0,Wi[20]=Wi[150]=0,Xi[20]=Xi[150]=1,Hi[20]=Hi[150]=1,Ri[20]=Ri[150]=0,Ti[20]=Ti[150]=-1,Fi[20]=Fi[150]=1,ki[80]=ki[90]=-1,Di[80]=Di[90]=0,Bi[80]=Bi[90]=1,Ki[80]=Ki[90]=1,Zi[80]=Zi[90]=0,Ji[80]=Ji[90]=1,Ui[65]=Ui[105]=0,Vi[65]=Vi[105]=1,Yi[65]=Yi[105]=0,Pi[65]=Pi[105]=0,ji[65]=ji[105]=-1,Ai[65]=Ai[105]=0,ki[160]=ki[10]=-1,Di[160]=Di[10]=0,Bi[160]=Bi[10]=1,Gi[160]=Gi[10]=-1,qi[160]=qi[10]=0,zi[160]=zi[10]=0,$i[160]=$i[10]=1,Qi[160]=Qi[10]=0,to[160]=to[10]=0,Ki[160]=Ki[10]=1,Zi[160]=Zi[10]=0,Ji[160]=Ji[10]=1,Wi[130]=Wi[40]=0,Xi[130]=Xi[40]=1,Hi[130]=Hi[40]=1,Ui[130]=Ui[40]=0,Vi[130]=Vi[40]=1,Yi[130]=Yi[40]=0,Pi[130]=Pi[40]=0,ji[130]=ji[40]=-1,Ai[130]=Ai[40]=0,Ri[130]=Ri[40]=0,Ti[130]=Ti[40]=-1,Fi[130]=Fi[40]=1,Gi[37]=Gi[133]=0,qi[37]=qi[133]=1,zi[37]=zi[133]=1,$i[37]=$i[133]=0,Qi[37]=Qi[133]=1,to[37]=to[133]=0,Pi[37]=Pi[133]=-1,ji[37]=ji[133]=0,Ai[37]=Ai[133]=0,Ri[37]=Ri[133]=1,Ti[37]=Ti[133]=0,Fi[37]=Fi[133]=0,Wi[148]=Wi[22]=-1,Xi[148]=Xi[22]=0,Hi[148]=Hi[22]=0,$i[148]=$i[22]=0,Qi[148]=Qi[22]=-1,to[148]=to[22]=1,Ki[148]=Ki[22]=0,Zi[148]=Zi[22]=1,Ji[148]=Ji[22]=1,Ri[148]=Ri[22]=-1,Ti[148]=Ti[22]=0,Fi[148]=Fi[22]=1,ki[82]=ki[88]=0,Di[82]=Di[88]=-1,Bi[82]=Bi[88]=1,Wi[82]=Wi[88]=1,Xi[82]=Xi[88]=0,Hi[82]=Hi[88]=1,Ui[82]=Ui[88]=-1,Vi[82]=Vi[88]=0,Yi[82]=Yi[88]=1,Ki[82]=Ki[88]=0,Zi[82]=Zi[88]=-1,Ji[82]=Ji[88]=0,ki[73]=ki[97]=0,Di[73]=Di[97]=1,Bi[73]=Bi[97]=0,Gi[73]=Gi[97]=0,qi[73]=qi[97]=-1,zi[73]=zi[97]=0,Ui[73]=Ui[97]=1,Vi[73]=Vi[97]=0,Yi[73]=Yi[97]=0,Pi[73]=Pi[97]=1,ji[73]=ji[97]=0,Ai[73]=Ai[97]=1,ki[145]=ki[25]=0,Di[145]=Di[25]=-1,Bi[145]=Bi[25]=0,Ui[145]=Ui[25]=1,Vi[145]=Vi[25]=0,Yi[145]=Yi[25]=1,$i[145]=$i[25]=0,Qi[145]=Qi[25]=1,to[145]=to[25]=1,Ri[145]=Ri[25]=-1,Ti[145]=Ti[25]=0,Fi[145]=Fi[25]=0,Gi[70]=Gi[100]=0,qi[70]=qi[100]=1,zi[70]=zi[100]=0,Wi[70]=Wi[100]=-1,Xi[70]=Xi[100]=0,Hi[70]=Hi[100]=1,Ki[70]=Ki[100]=0,Zi[70]=Zi[100]=-1,Ji[70]=Ji[100]=1,Pi[70]=Pi[100]=1,ji[70]=ji[100]=0,Ai[70]=Ai[100]=0,Gi[101]=Gi[69]=0,qi[101]=qi[69]=1,zi[101]=zi[69]=0,Pi[101]=Pi[69]=1,ji[101]=ji[69]=0,Ai[101]=Ai[69]=0,$i[149]=$i[21]=0,Qi[149]=Qi[21]=1,to[149]=to[21]=1,Ri[149]=Ri[21]=-1,Ti[149]=Ti[21]=0,Fi[149]=Fi[21]=0,Wi[86]=Wi[84]=-1,Xi[86]=Xi[84]=0,Hi[86]=Hi[84]=1,Ki[86]=Ki[84]=0,Zi[86]=Zi[84]=-1,Ji[86]=Ji[84]=1,ki[89]=ki[81]=0,Di[89]=Di[81]=-1,Bi[89]=Bi[81]=0,Ui[89]=Ui[81]=1,Vi[89]=Vi[81]=0,Yi[89]=Yi[81]=1,ki[96]=ki[74]=0,Di[96]=Di[74]=1,Bi[96]=Bi[74]=0,Gi[96]=Gi[74]=-1,qi[96]=qi[74]=0,zi[96]=zi[74]=1,Ki[96]=Ki[74]=1,Zi[96]=Zi[74]=0,Ji[96]=Ji[74]=0,Pi[96]=Pi[74]=1,ji[96]=ji[74]=0,Ai[96]=Ai[74]=1,ki[24]=ki[146]=0,Di[24]=Di[146]=-1,Bi[24]=Bi[146]=1,Wi[24]=Wi[146]=1,Xi[24]=Xi[146]=0,Hi[24]=Hi[146]=1,Ui[24]=Ui[146]=0,Vi[24]=Vi[146]=1,Yi[24]=Yi[146]=1,Ri[24]=Ri[146]=0,Ti[24]=Ti[146]=-1,Fi[24]=Fi[146]=0,Gi[6]=Gi[164]=-1,qi[6]=qi[164]=0,zi[6]=zi[164]=1,Wi[6]=Wi[164]=-1,Xi[6]=Xi[164]=0,Hi[6]=Hi[164]=0,$i[6]=$i[164]=0,Qi[6]=Qi[164]=-1,to[6]=to[164]=1,Ki[6]=Ki[164]=1,Zi[6]=Zi[164]=0,Ji[6]=Ji[164]=0,Ui[129]=Ui[41]=0,Vi[129]=Vi[41]=1,Yi[129]=Yi[41]=1,$i[129]=$i[41]=0,Qi[129]=Qi[41]=1,to[129]=to[41]=0,Pi[129]=Pi[41]=-1,ji[129]=ji[41]=0,Ai[129]=Ai[41]=0,Ri[129]=Ri[41]=0,Ti[129]=Ti[41]=-1,Fi[129]=Fi[41]=0,Wi[66]=Wi[104]=0,Xi[66]=Xi[104]=1,Hi[66]=Hi[104]=0,Ui[66]=Ui[104]=-1,Vi[66]=Vi[104]=0,Yi[66]=Yi[104]=1,Ki[66]=Ki[104]=0,Zi[66]=Zi[104]=-1,Ji[66]=Ji[104]=0,Pi[66]=Pi[104]=0,ji[66]=ji[104]=-1,Ai[66]=Ai[104]=1,ki[144]=ki[26]=-1,Di[144]=Di[26]=0,Bi[144]=Bi[26]=0,$i[144]=$i[26]=1,Qi[144]=Qi[26]=0,to[144]=to[26]=1,Ki[144]=Ki[26]=0,Zi[144]=Zi[26]=1,Ji[144]=Ji[26]=1,Ri[144]=Ri[26]=-1,Ti[144]=Ti[26]=0,Fi[144]=Fi[26]=1,Gi[36]=Gi[134]=0,qi[36]=qi[134]=1,zi[36]=zi[134]=1,Wi[36]=Wi[134]=0,Xi[36]=Xi[134]=1,Hi[36]=Hi[134]=0,Pi[36]=Pi[134]=0,ji[36]=ji[134]=-1,Ai[36]=Ai[134]=1,Ri[36]=Ri[134]=1,Ti[36]=Ti[134]=0,Fi[36]=Fi[134]=0,ki[9]=ki[161]=-1,Di[9]=Di[161]=0,Bi[9]=Bi[161]=0,Gi[9]=Gi[161]=0,qi[9]=qi[161]=-1,zi[9]=zi[161]=0,Ui[9]=Ui[161]=1,Vi[9]=Vi[161]=0,Yi[9]=Yi[161]=0,$i[9]=$i[161]=1,Qi[9]=Qi[161]=0,to[9]=to[161]=1,ki[136]=0,Di[136]=1,Bi[136]=1,Gi[136]=0,qi[136]=1,zi[136]=0,Wi[136]=-1,Xi[136]=0,Hi[136]=1,Ui[136]=-1,Vi[136]=0,Yi[136]=0,$i[136]=0,Qi[136]=-1,to[136]=0,Ki[136]=0,Zi[136]=-1,Ji[136]=1,Pi[136]=1,ji[136]=0,Ai[136]=0,Ri[136]=1,Ti[136]=0,Fi[136]=1,ki[34]=0,Di[34]=-1,Bi[34]=0,Gi[34]=0,qi[34]=-1,zi[34]=1,Wi[34]=1,Xi[34]=0,Hi[34]=0,Ui[34]=1,Vi[34]=0,Yi[34]=1,$i[34]=0,Qi[34]=1,to[34]=1,Ki[34]=0,Zi[34]=1,Ji[34]=0,Pi[34]=-1,ji[34]=0,Ai[34]=1,Ri[34]=-1,Ti[34]=0,Fi[34]=0,ki[35]=0,Di[35]=1,Bi[35]=1,Gi[35]=0,qi[35]=-1,zi[35]=1,Wi[35]=1,Xi[35]=0,Hi[35]=0,Ui[35]=-1,Vi[35]=0,Yi[35]=0,$i[35]=0,Qi[35]=-1,to[35]=0,Ki[35]=0,Zi[35]=1,Ji[35]=0,Pi[35]=-1,ji[35]=0,Ai[35]=1,Ri[35]=1,Ti[35]=0,Fi[35]=1,ki[153]=0,Di[153]=1,Bi[153]=1,Ui[153]=-1,Vi[153]=0,Yi[153]=0,$i[153]=0,Qi[153]=-1,to[153]=0,Ri[153]=1,Ti[153]=0,Fi[153]=1,Gi[102]=0,qi[102]=-1,zi[102]=1,Wi[102]=1,Xi[102]=0,Hi[102]=0,Ki[102]=0,Zi[102]=1,Ji[102]=0,Pi[102]=-1,ji[102]=0,Ai[102]=1,ki[155]=0,Di[155]=-1,Bi[155]=0,Ui[155]=1,Vi[155]=0,Yi[155]=1,$i[155]=0,Qi[155]=1,to[155]=1,Ri[155]=-1,Ti[155]=0,Fi[155]=0,Gi[103]=0,qi[103]=1,zi[103]=0,Wi[103]=-1,Xi[103]=0,Hi[103]=1,Ki[103]=0,Zi[103]=-1,Ji[103]=1,Pi[103]=1,ji[103]=0,Ai[103]=0,ki[152]=0,Di[152]=1,Bi[152]=1,Wi[152]=-1,Xi[152]=0,Hi[152]=1,Ui[152]=-1,Vi[152]=0,Yi[152]=0,$i[152]=0,Qi[152]=-1,to[152]=0,Ki[152]=0,Zi[152]=-1,Ji[152]=1,Ri[152]=1,Ti[152]=0,Fi[152]=1,ki[156]=0,Di[156]=-1,Bi[156]=1,Wi[156]=1,Xi[156]=0,Hi[156]=1,Ui[156]=-1,Vi[156]=0,Yi[156]=0,$i[156]=0,Qi[156]=-1,to[156]=0,Ki[156]=0,Zi[156]=1,Ji[156]=1,Ri[156]=-1,Ti[156]=0,Fi[156]=1,ki[137]=0,Di[137]=1,Bi[137]=1,Gi[137]=0,qi[137]=1,zi[137]=0,Ui[137]=-1,Vi[137]=0,Yi[137]=0,$i[137]=0,Qi[137]=-1,to[137]=0,Pi[137]=1,ji[137]=0,Ai[137]=0,Ri[137]=1,Ti[137]=0,Fi[137]=1,ki[139]=0,Di[139]=1,Bi[139]=1,Gi[139]=0,qi[139]=-1,zi[139]=0,Ui[139]=1,Vi[139]=0,Yi[139]=0,$i[139]=0,Qi[139]=1,to[139]=0,Pi[139]=-1,ji[139]=0,Ai[139]=0,Ri[139]=1,Ti[139]=0,Fi[139]=1,ki[98]=0,Di[98]=-1,Bi[98]=0,Gi[98]=0,qi[98]=-1,zi[98]=1,Wi[98]=1,Xi[98]=0,Hi[98]=0,Ui[98]=1,Vi[98]=0,Yi[98]=1,Ki[98]=0,Zi[98]=1,Ji[98]=0,Pi[98]=-1,ji[98]=0,Ai[98]=1,ki[99]=0,Di[99]=1,Bi[99]=0,Gi[99]=0,qi[99]=-1,zi[99]=1,Wi[99]=1,Xi[99]=0,Hi[99]=0,Ui[99]=-1,Vi[99]=0,Yi[99]=1,Ki[99]=0,Zi[99]=-1,Ji[99]=0,Pi[99]=1,ji[99]=0,Ai[99]=1,Gi[38]=0,qi[38]=-1,zi[38]=1,Wi[38]=1,Xi[38]=0,Hi[38]=0,$i[38]=0,Qi[38]=1,to[38]=1,Ki[38]=0,Zi[38]=1,Ji[38]=0,Pi[38]=-1,ji[38]=0,Ai[38]=1,Ri[38]=-1,Ti[38]=0,Fi[38]=0,Gi[39]=0,qi[39]=1,zi[39]=1,Wi[39]=-1,Xi[39]=0,Hi[39]=0,$i[39]=0,Qi[39]=-1,to[39]=1,Ki[39]=0,Zi[39]=1,Ji[39]=0,Pi[39]=-1,ji[39]=0,Ai[39]=1,Ri[39]=1,Ti[39]=0,Fi[39]=0;var eo=function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]},no=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]},ro=function(t){return[[t.topright,1],[1,1],[1,t.righttop]]},io=function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]},oo=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]},so=function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]},ao=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]},uo=function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},co=[],lo=[],ho=[],fo=[],po=[],go=[],yo=[],vo=[];fo[1]=po[1]=18,fo[169]=po[169]=18,ho[4]=lo[4]=12,ho[166]=lo[166]=12,co[16]=vo[16]=4,co[154]=vo[154]=4,go[64]=yo[64]=22,go[106]=yo[106]=22,ho[2]=go[2]=17,fo[2]=po[2]=18,ho[168]=go[168]=17,fo[168]=po[168]=18,co[8]=fo[8]=9,lo[8]=ho[8]=12,co[162]=fo[162]=9,lo[162]=ho[162]=12,co[32]=vo[32]=4,lo[32]=yo[32]=1,co[138]=vo[138]=4,lo[138]=yo[138]=1,po[128]=vo[128]=21,go[128]=yo[128]=22,po[42]=vo[42]=21,go[42]=yo[42]=22,lo[5]=po[5]=14,lo[165]=po[165]=14,ho[20]=vo[20]=6,ho[150]=vo[150]=6,co[80]=go[80]=11,co[90]=go[90]=11,fo[65]=yo[65]=3,fo[105]=yo[105]=3,co[160]=go[160]=11,lo[160]=po[160]=14,co[10]=go[10]=11,lo[10]=po[10]=14,ho[130]=vo[130]=6,fo[130]=yo[130]=3,ho[40]=vo[40]=6,fo[40]=yo[40]=3,lo[101]=yo[101]=1,lo[69]=yo[69]=1,po[149]=vo[149]=21,po[21]=vo[21]=21,ho[86]=go[86]=17,ho[84]=go[84]=17,co[89]=fo[89]=9,co[81]=fo[81]=9,co[96]=yo[96]=0,lo[96]=go[96]=15,co[74]=yo[74]=0,lo[74]=go[74]=15,co[24]=ho[24]=8,fo[24]=vo[24]=7,co[146]=ho[146]=8,fo[146]=vo[146]=7,lo[6]=go[6]=15,ho[6]=po[6]=16,lo[164]=go[164]=15,ho[164]=po[164]=16,fo[129]=vo[129]=7,po[129]=yo[129]=20,fo[41]=vo[41]=7,po[41]=yo[41]=20,ho[66]=yo[66]=2,fo[66]=go[66]=19,ho[104]=yo[104]=2,fo[104]=go[104]=19,co[144]=po[144]=10,go[144]=vo[144]=23,co[26]=po[26]=10,go[26]=vo[26]=23,lo[36]=vo[36]=5,ho[36]=yo[36]=2,lo[134]=vo[134]=5,ho[134]=yo[134]=2,co[9]=po[9]=10,lo[9]=fo[9]=13,co[161]=po[161]=10,lo[161]=fo[161]=13,lo[37]=vo[37]=5,po[37]=yo[37]=20,lo[133]=vo[133]=5,po[133]=yo[133]=20,ho[148]=po[148]=16,go[148]=vo[148]=23,ho[22]=po[22]=16,go[22]=vo[22]=23,co[82]=ho[82]=8,fo[82]=go[82]=19,co[88]=ho[88]=8,fo[88]=go[88]=19,co[73]=yo[73]=0,lo[73]=fo[73]=13,co[97]=yo[97]=0,lo[97]=fo[97]=13,co[145]=fo[145]=9,po[145]=vo[145]=21,co[25]=fo[25]=9,po[25]=vo[25]=21,lo[70]=yo[70]=1,ho[70]=go[70]=17,lo[100]=yo[100]=1,ho[100]=go[100]=17,co[34]=fo[34]=9,lo[34]=ho[34]=12,po[34]=vo[34]=21,go[34]=yo[34]=22,co[136]=vo[136]=4,lo[136]=yo[136]=1,ho[136]=go[136]=17,fo[136]=po[136]=18,co[35]=vo[35]=4,lo[35]=ho[35]=12,fo[35]=po[35]=18,go[35]=yo[35]=22,co[153]=vo[153]=4,fo[153]=po[153]=18,lo[102]=ho[102]=12,go[102]=yo[102]=22,co[155]=fo[155]=9,po[155]=vo[155]=23,lo[103]=yo[103]=1,ho[103]=go[103]=17,co[152]=vo[152]=4,ho[152]=go[152]=17,fo[152]=po[152]=18,co[156]=ho[156]=8,fo[156]=po[156]=18,go[156]=vo[156]=23,co[137]=vo[137]=4,lo[137]=yo[137]=1,fo[137]=po[137]=18,co[139]=vo[139]=4,lo[139]=fo[139]=13,po[139]=yo[139]=20,co[98]=fo[98]=9,lo[98]=ho[98]=12,go[98]=yo[98]=22,co[99]=yo[99]=0,lo[99]=ho[99]=12,fo[99]=go[99]=19,lo[38]=ho[38]=12,po[38]=vo[38]=21,go[38]=yo[38]=22,lo[39]=vo[39]=5,ho[39]=po[39]=16,go[39]=yo[39]=22;var mo=[];function _o(t,e,n){return(t-e)/(n-e)}function bo(t){return t.constructor.toString().indexOf("Array")>-1}function wo(t,e,n,r,i,o){for(var s=t.cells[n][e],a=s.cval_real,u=e+r,c=n+i,l=[],h=!1;!h;){if(void 0===t.cells[c]||void 0===t.cells[c][u])if(c-=i,u-=r,a=(s=t.cells[c][u]).cval_real,-1===i)if(0===o)if(1&a)l.push([u,c]),r=-1,i=0,o=0;else{if(!(4&a)){l.push([u+s.bottomright,c]),r=0,i=1,o=1,h=!0;break}l.push([u+1,c]),r=1,i=0,o=0}else{if(!(1&a)){if(4&a){l.push([u+s.bottomright,c]),r=0,i=1,o=1,h=!0;break}l.push([u+s.bottomleft,c]),r=0,i=1,o=0,h=!0;break}l.push([u,c]),r=-1,i=0,o=0}else if(1===i)if(0===o){if(!(16&a)){if(64&a){l.push([u+s.topleft,c+1]),r=0,i=-1,o=0,h=!0;break}l.push([u+s.topright,c+1]),r=0,i=-1,o=1,h=!0;break}l.push([u+1,c+1]),r=1,i=0,o=1}else l.push([u+1,c+1]),r=1,i=0,o=1;else if(-1===r)if(0===o){if(!(64&a)){if(1&a){l.push([u,c+s.leftbottom]),r=1,i=0,o=0,h=!0;break}l.push([u,c+s.lefttop]),r=1,i=0,o=1,h=!0;break}l.push([u,c+1]),r=0,i=1,o=0}else{if(!(64&a)){console.log("MarchingSquaresJS-isoBands: wtf");break}l.push([u,c+1]),r=0,i=1,o=0}else{if(1!==r){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===o){if(!(4&a)){l.push([u+1,c+s.rightbottom]),r=-1,i=0,o=0,h=!0;break}l.push([u+1,c]),r=0,i=-1,o=1}else{if(!(4&a)){if(16&a){l.push([u+1,c+s.righttop]),r=-1,i=0,o=1;break}l.push([u+1,c+s.rightbottom]),r=-1,i=0,o=0,h=!0;break}l.push([u+1,c]),r=0,i=-1,o=1}}else if(a=(s=t.cells[c][u]).cval_real,-1===r)if(0===o)if(void 0!==t.cells[c-1]&&void 0!==t.cells[c-1][u])r=0,i=-1,o=1;else{if(!(1&a)){l.push([u+s.bottomright,c]),r=0,i=1,o=1,h=!0;break}l.push([u,c])}else{if(!(64&a)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+u+","+c);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===r){if(0===o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[c+1]&&void 0!==t.cells[c+1][u])r=0,i=1,o=0;else{if(!(16&a)){l.push([u+s.topleft,c+1]),r=0,i=-1,o=0,h=!0;break}l.push([u+1,c+1]),r=1,i=0,o=1}}else if(-1===i){if(1!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[c][u+1])r=1,i=0,o=1;else{if(!(4&a)){l.push([u+1,c+s.righttop]),r=-1,i=0,o=1,h=!0;break}l.push([u+1,c]),r=0,i=-1,o=1}}else{if(1!==i){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[c][u-1])r=-1,i=0,o=0;else{if(!(64&a)){l.push([u,c+s.leftbottom]),r=1,i=0,o=0,h=!0;break}l.push([u,c+1]),r=0,i=1,o=0}}if(c+=i,(u+=r)===e&&c===n)break}return{path:l,i:u,j:c,x:r,y:i,o:o}}function xo(t){if(t.edges.length>0){var e=t.edges[t.edges.length-1],n=t.cval_real;switch(e){case 0:return 16&n?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return 4&n?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return 4&n?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return 1&n?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return 16&n?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return 4&n?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return 4&n?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return 1&n?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return 4&n?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return 1&n?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return 1&n?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return 64&n?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return 4&n?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return 1&n?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return 1&n?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return 64&n?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return 4&n?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return 64&n?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return 1&n?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return 64&n?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return 64&n?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return 16&n?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return 64&n?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return 16&n?{p:[0,t.lefttop],x:1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t)}}return null}function Oo(t,e,n,r){var i,o,s,a,u,c=t.cval;switch(e){case-1:switch(r){case 0:i=lo[c],s=Gi[c],a=qi[c],u=zi[c];break;default:i=co[c],s=ki[c],a=Di[c],u=Bi[c]}break;case 1:switch(r){case 0:i=po[c],s=$i[c],a=Qi[c],u=to[c];break;default:i=go[c],s=Ki[c],a=Zi[c],u=Ji[c]}break;default:switch(n){case-1:switch(r){case 0:i=yo[c],s=Pi[c],a=ji[c],u=Ai[c];break;default:i=vo[c],s=Ri[c],a=Ti[c],u=Fi[c]}break;case 1:switch(r){case 0:i=fo[c],s=Ui[c],a=Vi[c],u=Yi[c];break;default:i=ho[c],s=Wi[c],a=Xi[c],u=Hi[c]}}}if(o=t.edges.indexOf(i),void 0===t.edges[o])return null;switch(function(t,e){delete t.edges[e];for(var n=e+1;n0){var a=r[e-1],u=function(t,e){return!function(t,e){return 0===jo(Po(t),Po(e))}(t,e)&&function(t,e){var n,r,i=t[0],o=Po(t),s=e[0],a=Po(e),u=jo(o,a);return function(t,e){return[t[0]+e[0],t[1]+e[1]]}(i,function(t,e){return[t*e[0],t*e[1]]}(jo((r=i,[(n=s)[0]-r[0],n[1]-r[1]]),a)/u,o))}(t,e)}(n,a);!1!==u&&(a[1]=u,n[0]=u),s.push(a[0]),e===o.length-2&&(s.push(n[0]),s.push(n[1]))}2===o.length&&(s.push(n[0]),s.push(n[1]))}var c,l,h,f,p,d})),f(s,t.properties)}function Ro(t,e,n){var r=e[0]-t[0],i=e[1]-t[1],o=n[0]-e[0];return function(t){return(t>0)-(t<0)||+t}(r*(n[1]-e[1])-o*i)}function To(t,e){return e.geometry.coordinates[0].every((function(e){return de(u(e),t)}))}mo[1]=mo[169]=eo,mo[4]=mo[166]=no,mo[16]=mo[154]=ro,mo[64]=mo[106]=io,mo[168]=mo[2]=oo,mo[162]=mo[8]=so,mo[138]=mo[32]=ao,mo[42]=mo[128]=uo,mo[5]=mo[165]=function(t){return[[0,0],[0,t.leftbottom],[1,t.rightbottom],[1,0]]},mo[20]=mo[150]=function(t){return[[1,0],[t.bottomright,0],[t.topright,1],[1,1]]},mo[80]=mo[90]=function(t){return[[1,1],[1,t.righttop],[0,t.lefttop],[0,1]]},mo[65]=mo[105]=function(t){return[[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},mo[160]=mo[10]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.leftbottom],[0,t.lefttop]]},mo[130]=mo[40]=function(t){return[[t.topleft,1],[t.topright,1],[t.bottomright,0],[t.bottomleft,0]]},mo[85]=function(){return[[0,0],[0,1],[1,1],[1,0]]},mo[101]=mo[69]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,1],[t.topleft,1]]},mo[149]=mo[21]=function(t){return[[t.topright,1],[1,1],[1,0],[0,0],[0,t.leftbottom]]},mo[86]=mo[84]=function(t){return[[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[1,1]]},mo[89]=mo[81]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,1]]},mo[96]=mo[74]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.lefttop],[0,1],[t.topleft,1]]},mo[24]=mo[146]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[t.topright,1]]},mo[6]=mo[164]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop]]},mo[129]=mo[41]=function(t){return[[t.topright,1],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1]]},mo[66]=mo[104]=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},mo[144]=mo[26]=function(t){return[[1,1],[1,t.righttop],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},mo[36]=mo[134]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[t.topleft,1],[t.topright,1]]},mo[9]=mo[161]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom]]},mo[37]=mo[133]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},mo[148]=mo[22]=function(t){return[[1,1],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},mo[82]=mo[88]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1]]},mo[73]=mo[97]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},mo[145]=mo[25]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},mo[70]=mo[100]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},mo[34]=function(t){return[uo(t),so(t)]},mo[35]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},mo[136]=function(t){return[ao(t),oo(t)]},mo[153]=function(t){return[ro(t),eo(t)]},mo[102]=function(t){return[no(t),io(t)]},mo[155]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},mo[103]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},mo[152]=function(t){return[ro(t),oo(t)]},mo[156]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},mo[137]=function(t){return[ao(t),eo(t)]},mo[139]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},mo[98]=function(t){return[so(t),io(t)]},mo[99]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},mo[38]=function(t){return[no(t),uo(t)]},mo[39]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]};var Fo=function(){function t(e){this.id=t.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return t.buildId=function(t){return t.join(",")},t.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter((function(e){return e.from.id!==t.from.id}))},t.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter((function(e){return e.to.id!==t.to.id}))},t.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},t.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort((function(e,n){var r=e.to,i=n.to;if(r.coordinates[0]-t.coordinates[0]>=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(r.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(r.coordinates[0]-t.coordinates[0]==0&&i.coordinates[0]-t.coordinates[0]==0)return r.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?r.coordinates[1]-i.coordinates[1]:i.coordinates[1]-r.coordinates[1];var o=Ro(t.coordinates,r.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))})),this.outerEdgesSorted=!0)},t.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},t.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},t.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},t}(),ko=function(){function t(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return t.prototype.getSymetric=function(){return this.symetric||(this.symetric=new t(this.to,this.from),this.symetric.symetric=this),this.symetric},t.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},t.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},t.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},t.prototype.toLineString=function(){return f([this.from.coordinates,this.to.coordinates])},t.prototype.compareTo=function(t){return Ro(t.from.coordinates,t.to.coordinates,this.to.coordinates)},t}(),Do=function(){function t(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return t.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},t.prototype.get=function(t){return this.edges[t]},Object.defineProperty(t.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),t.prototype.forEach=function(t){this.edges.forEach(t)},t.prototype.map=function(t){return this.edges.map(t)},t.prototype.some=function(t){return this.edges.some(t)},t.prototype.isValid=function(){return!0},t.prototype.isHole=function(){var t=this,e=this.edges.reduce((function(e,n,r){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=r),e}),0),n=(0===e?this.length:e)-1,r=(e+1)%this.length,i=Ro(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[r].from.coordinates);return 0===i?this.edges[n].from.coordinates[0]>this.edges[r].from.coordinates[0]:i>0},t.prototype.toMultiPoint=function(){return y(this.edges.map((function(t){return t.from.coordinates})))},t.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map((function(t){return t.from.coordinates}));return t.push(this.edges[0].from.coordinates),this.polygon=l([t])},t.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=on(this.toPolygon())},t.findEdgeRingContaining=function(t,e){var n,r,i=t.getEnvelope();return e.forEach((function(e){var o,s,a,c,l,h,f=e.getEnvelope();if(r&&(n=r.getEnvelope()),s=i,a=(o=f).geometry.coordinates[0].map((function(t){return t[0]})),c=o.geometry.coordinates[0].map((function(t){return t[1]})),l=s.geometry.coordinates[0].map((function(t){return t[0]})),h=s.geometry.coordinates[0].map((function(t){return t[1]})),(Math.max.apply(null,a)!==Math.max.apply(null,l)||Math.max.apply(null,c)!==Math.max.apply(null,h)||Math.min.apply(null,a)!==Math.min.apply(null,l)||Math.min.apply(null,c)!==Math.min.apply(null,h))&&To(f,i)){for(var p=t.map((function(t){return t.from.coordinates})),d=void 0,g=function(t){e.some((function(e){return n=t,r=e.from.coordinates,n[0]===r[0]&&n[1]===r[1];var n,r}))||(d=t)},y=0,v=p;y=0;--o){var s=i[o],a=s.symetric,u=void 0,c=void 0;s.label===e&&(u=s),a.label===e&&(c=a),u&&c&&(c&&(r=c),u&&(r&&(r.next=u,r=void 0),n||(n=u)))}r&&(r.next=n)},t.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach((function(n){if(!(n.label>=0)){t.push(n);var r=n;do{r.label=e,r=r.next}while(!n.isEqual(r));e++}})),t},t.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach((function(t){t.label=void 0})),this._findLabeledEdgeRings().forEach((function(e){t._findIntersectionNodes(e).forEach((function(n){t._computeNextCCWEdges(n,e.label)}))}));var e=[];return this.edges.forEach((function(n){n.ring||e.push(t._findEdgeRing(n))})),e},t.prototype._findIntersectionNodes=function(t){var e=[],n=t,r=function(){var r=0;n.from.getOuterEdges().forEach((function(e){e.label===t.label&&++r})),r>1&&e.push(n.from),n=n.next};do{r()}while(!t.isEqual(n));return e},t.prototype._findEdgeRing=function(t){var e=t,n=new Do;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n},t.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach((function(t){return e.removeEdge(t)})),t.innerEdges.forEach((function(t){return e.removeEdge(t)})),delete this.nodes[t.id]},t.prototype.removeEdge=function(t){this.edges=this.edges.filter((function(e){return!e.isEqual(t)})),t.deleteEdge()},t}();function Go(t,e){var n=!0;return z(t,(function(t){z(e,(function(e){if(!1===n)return!1;n=function(t,e){switch(t.type){case"Point":switch(e.type){case"Point":return n=t.coordinates,r=e.coordinates,!(n[0]===r[0]&&n[1]===r[1]);case"LineString":return!qo(e,t);case"Polygon":return!de(t,e)}break;case"LineString":switch(e.type){case"Point":return!qo(t,e);case"LineString":return!function(t,e){return hr(t,e).features.length>0}(t,e);case"Polygon":return!zo(e,t)}break;case"Polygon":switch(e.type){case"Point":return!de(e,t);case"LineString":return!zo(t,e);case"Polygon":return!function(t,e){for(var n=0,r=t.coordinates[0];n0}(e,t)}}var n,r;return!1}(t.geometry,e.geometry)}))})),n}function qo(t,e){for(var n=0;n0}function Uo(t,e,n){var r=n[0]-t[0],i=n[1]-t[1],o=e[0]-t[0],s=e[1]-t[1];return 0==r*s-i*o&&(Math.abs(o)>=Math.abs(s)?o>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:s>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1])}function Vo(t,e){return!(t[0]>e[0]||t[2]e[1]||t[3]0}function Ko(t,e){for(var n=!1,r=!1,i=t.coordinates.length,o=0;o=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1]:Math.abs(s)>=Math.abs(a)?s>0?t[0]0?t[1]=0&&(n=[].concat(t.slice(r,t.length),t.slice(1,r+1))),n},Jo.prototype.comparePath=function(t,e){var n=this;return t.every((function(t,e){return n.compareCoord(t,this[e])}),e)},Jo.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var n=t.coordinates.slice(1,t.coordinates.length),r=e.coordinates.slice(1,e.coordinates.length),i=this;return n.every((function(t){return this.some((function(e){return i.compareLine(t,e,1,!0)}))}),r)}return!1},Jo.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},Jo.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},Jo.prototype.removePseudo=function(t){return t};var es=Jo;function ns(t,e){var n=!1;return z(t,(function(t){z(e,(function(e){if(!0===n)return!0;n=!Go(t.geometry,e.geometry)}))})),n}var rs=Bt((function(t){function e(t,e,n,r){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,n,r)}e.prototype.run=function(t,e,n,r){this._init(t,e,n,r);for(var i=0;i=this.minPts&&(e=this._mergeArrays(e,i))}1!==this._assigned[r]&&this._addToCluster(r,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],n=0;n0){for(u=0;u=0);return t},e.prototype.assign=function(){for(var t,e=!1,n=this.dataset.length,r=0;ri&&(n=r):e=this.minPts)return n},n.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var n=[],r=0,i=this.dataset.length;r0,p=[];if(n)i="kmrand"==n?function(t,e){for(var n={},r=[],i=e<<2,o=t.length,s=t[0].length>0;r.length0;){var a=t[Math.floor(Math.random()*o)],u=s?a.join("_"):""+a;n[u]||(n[u]=!0,r.push(a))}if(r.length0,s=t[Math.floor(Math.random()*i)];for(o&&s.join("_"),r.push(s);r.length0;){var u=s.pop();if(u===n)return ys(u);u.closed=!0;for(var c=t.neighbors(u),l=0,h=c.length;l0)){if(o/=f,f<0){if(o0){if(o>h)return;o>l&&(l=o)}if(o=r-u,f||!(o<0)){if(o/=f,f<0){if(o>h)return;o>l&&(l=o)}else if(f>0){if(o0)){if(o/=p,p<0){if(o0){if(o>h)return;o>l&&(l=o)}if(o=i-c,p||!(o<0)){if(o/=p,p<0){if(o>h)return;o>l&&(l=o)}else if(p>0){if(o0||h<1)||(l>0&&(t[0]=[u+l*f,c+l*p]),h<1&&(t[1]=[u+h*f,c+h*p]),!0)}}}}}function Rs(t,e,n,r,i){var o=t[1];if(o)return!0;var s,a,u=t[0],c=t.left,l=t.right,h=c[0],f=c[1],p=l[0],d=l[1],g=(h+p)/2,y=(f+d)/2;if(d===f){if(g=r)return;if(h>p){if(u){if(u[1]>=i)return}else u=[g,n];o=[g,i]}else{if(u){if(u[1]1)if(h>p){if(u){if(u[1]>=i)return}else u=[(n-a)/s,n];o=[(i-a)/s,i]}else{if(u){if(u[1]=r)return}else u=[e,s*e+a];o=[r,s*r+a]}else{if(u){if(u[0]0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),n=this.content.pop();e!==this.content.length-1&&(this.content[e]=n,this.scoreFunction(n)0;){var n=(t+1>>1)-1,r=this.content[n];if(!(this.scoreFunction(e)=-na)){var p=u*u+c*c,d=l*l+h*h,g=(h*p-c*d)/f,y=(u*d-l*p)/f,v=Bs.pop()||new Gs;v.arc=t,v.site=i,v.x=g+s,v.y=(v.cy=y+a)+Math.sqrt(g*g+y*y),t.circle=v;for(var m=null,_=Qs._;_;)if(v.y<_.y||v.y===_.y&&v.x<=_.x){if(!_.L){m=_.P;break}_=_.L}else{if(!_.R){m=_;break}_=_.R}Qs.insert(m,v),m||(Ds=v)}}}}function zs(t){var e=t.circle;e&&(e.P||(Ds=e.N),Qs.remove(e),Bs.push(e),Cs(e),t.circle=null)}var Us=[];function Vs(){Cs(this),this.edge=this.site=this.circle=null}function Ys(t){var e=Us.pop()||new Vs;return e.site=t,e}function Ws(t){zs(t),Js.remove(t),Us.push(t),Cs(t)}function Xs(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],o=t.P,s=t.N,a=[t];Ws(t);for(var u=o;u.circle&&Math.abs(n-u.circle.x)ea)a=a.L;else{if(!((i=o-Zs(a,s))>ea)){r>-ea?(e=a.P,n=a):i>-ea?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}!function(t){$s[t.index]={site:t,halfedges:[]}}(t);var u=Ys(t);if(Js.insert(e,u),e||n){if(e===n)return zs(e),n=Ys(e.site),Js.insert(u,n),u.edge=n.edge=Is(e.site,u.site),qs(e),void qs(n);if(n){zs(e),zs(n);var c=e.site,l=c[0],h=c[1],f=t[0]-l,p=t[1]-h,d=n.site,g=d[0]-l,y=d[1]-h,v=2*(f*y-p*g),m=f*f+p*p,_=g*g+y*y,b=[(y*m-p*_)/v+l,(f*_-g*m)/v+h];js(n.edge,c,d,b),u.edge=Is(c,t,null,b),n.edge=Is(t,d,null,b),qs(e),qs(n)}else u.edge=Is(e.site,u.site)}}function Ks(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var s=t.P;if(!s)return-1/0;var a=(n=s.site)[0],u=n[1],c=u-e;if(!c)return a;var l=a-r,h=1/o-1/c,f=l/c;return h?(-f+Math.sqrt(f*f-2*h*(l*l/(-2*c)-u+c/2+i-o/2)))/h+r:(r+a)/2}function Zs(t,e){var n=t.N;if(n)return Ks(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var Js,$s,Qs,ta,ea=1e-6,na=1e-12;function ra(t,e){return e[1]-t[1]||e[0]-t[0]}function ia(t,e){var n,r,i,o=t.sort(ra).pop();for(ta=[],$s=new Array(t.length),Js=new Ss,Qs=new Ss;;)if(i=Ds,o&&(!i||o[1]ea||Math.abs(i[0][1]-i[1][1])>ea)||delete ta[o]}(s,a,u,c),function(t,e,n,r){var i,o,s,a,u,c,l,h,f,p,d,g,y=$s.length,v=!0;for(i=0;iea||Math.abs(g-f)>ea)&&(u.splice(a,0,ta.push(Ps(s,p,Math.abs(d-t)ea?[t,Math.abs(h-t)ea?[Math.abs(f-r)ea?[n,Math.abs(h-n)ea?[Math.abs(f-e)=-270&&(g=-g),d<-180&&d>=-360&&(y=-y),"degrees"===o){var v=g*Math.cos(h)+y*Math.sin(h),m=y*Math.cos(h)-g*Math.sin(h);g=v,y=m}f.push([g+c[0],y+c[1]])}return f.push(f[0]),"degrees"===o?l([f],u):Mo(l([f],u),s,{pivot:a})}function aa(t){var e=t*Math.PI/180;return Math.tan(e)}function ua(t,e){void 0===e&&(e={});var n=0,r=0,i=0;return G(t,(function(t,o,s){var a=e.weight?null==s?void 0:s[e.weight]:void 0;if(!M(a=null==a?1:a))throw new Error("weight value must be a number for feature index "+o);(a=Number(a))>0&&A(t,(function(t){n+=t[0]*a,r+=t[1]*a,i+=a}))})),u([n/i,r/i],e.properties,e)}function ca(t,e){return{x:t[0]-e[0],y:t[1]-e[1]}}function la(t,e){var n=0,r=0;A(t,(function(i,o,s,a,u){u>n&&(n=u,r=o,e.push([]));var c=o-r,l=t.coordinates[u][c+1],h=i[0],f=i[1],p=l[0],d=l[1];e[u].push([.75*h+.25*p,.75*f+.25*d]),e[u].push([.25*h+.75*p,.25*f+.75*d])}),!0),e.forEach((function(t){t.push(t[0])}))}function ha(t,e){var n=0,r=0,i=0;A(t,(function(o,s,a,u,c){u>i&&(i=u,r=s,e.push([[]])),c>n&&(n=c,r=s,e[u].push([]));var l=s-r,h=t.coordinates[u][c][l+1],f=o[0],p=o[1],d=h[0],g=h[1];e[u][c].push([.75*f+.25*d,.75*p+.25*g]),e[u][c].push([.25*f+.75*d,.25*p+.75*g])}),!0),e.forEach((function(t){t.forEach((function(t){t.push(t[0])}))}))}function fa(t,e,n){void 0===n&&(n=2);var r=$(t),i=$(e),o=r[0]-i[0],s=r[1]-i[1];return 1===n?Math.abs(o)+Math.abs(s):Math.pow(Math.pow(o,n)+Math.pow(s,n),1/n)}function pa(t,e){var n=(e=e||{}).threshold||1e4,r=e.p||2,i=e.binary||!1,o=e.alpha||-1,s=e.standardization||!1,a=[];k(t,(function(t){a.push(hn(t))}));for(var u=[],c=0;c0?1:0}(t[0]))*e,n*Math.log(Math.tan(.25*Math.PI+.5*t[1]*e))];return i[0]>r&&(i[0]=r),i[0]<-r&&(i[0]=-r),i[1]>r&&(i[1]=r),i[1]<-r&&(i[1]=-r),i}function _a(t){var e=180/Math.PI,n=6378137;return[t[0]*e/n,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/n)))*e]}ia.prototype={constructor:ia,polygons:function(){var t=this.edges;return this.cells.map((function(e){var n=e.halfedges.map((function(n){return Fs(e,t[n])}));return n.data=e.site.data,n}))},triangles:function(){var t=[],e=this.edges;return this.cells.forEach((function(n,r){if(o=(i=n.halfedges).length)for(var i,o,s,a,u,c,l=n.site,h=-1,f=e[i[o-1]],p=f.left===l?f.right:f.left;++h=a)return null;var u=t-i.site[0],c=e-i.site[1],l=u*u+c*c;do{i=o.cells[r=s],s=null,i.halfedges.forEach((function(n){var r=o.edges[n],a=r.left;if(a!==i.site&&a||(a=r.right)){var u=t-a[0],c=e-a[1],h=u*u+c*c;h0?t+n[e-1]:t})),o.forEach((function(t){t=2*t*Math.PI/o[o.length-1];var n=Math.random();i.push([n*(e.max_radial_length||10)*Math.sin(t),n*(e.max_radial_length||10)*Math.cos(t)])})),i[i.length-1]=i[0],i=i.map((r=wa(e.bbox),function(t){return[t[0]+r[0],t[1]+r[1]]})),n.push(l([i]))},i=0;ie?1:t0))break;if(null===e.right)break;if(n(t,e.right.key)>0&&(a=e.right,e.right=a.left,a.left=e,null===(e=a).right))break;i.right=e,i=e,e=e.right}}return i.right=e.left,o.left=e.right,e.left=r.right,e.right=r.left,e}function Ba(t,e,n,r){var i=new Fa(t,e);if(null===n)return i.left=i.right=null,i;var o=r(t,(n=Da(t,n,r)).key);return o<0?(i.left=n.left,i.right=n,n.left=null):o>=0&&(i.right=n.right,i.left=n,n.right=null),i}function Ga(t,e,n){var r=null,i=null;if(e){var o=n((e=Da(t,e,n)).key,t);0===o?(r=e.left,i=e.right):o<0?(i=e.right,e.right=null,r=e):(r=e.left,e.left=null,i=e)}return{left:r,right:i}}var qa=function(){function t(t){void 0===t&&(t=ka),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=Ba(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var n=new Fa(t,e);null===this._root&&(n.left=n.right=null,this._size++,this._root=n);var r=this._comparator,i=Da(t,this._root,r),o=r(t,i.key);return 0===o?this._root=i:(o<0?(n.left=i.left,n.right=i,i.left=null):o>0&&(n.right=i.right,n.left=i,i.right=null),this._size++,this._root=n),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,n){var r;return null===e?null:0===n(t,(e=Da(t,e,n)).key)?(null===e.left?r=e.right:(r=Da(t,e.left,n)).right=e.right,this._size--,r):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Da(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return e;e=r<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=Da(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return!0;e=r<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var n=this._root,r=[],i=!1;!i;)null!==n?(r.push(n),n=n.left):0!==r.length?(n=r.pop(),t.call(e,n),n=n.right):i=!0;return this},t.prototype.range=function(t,e,n,r){for(var i=[],o=this._comparator,s=this._root;0!==i.length||s;)if(s)i.push(s),s=s.left;else{if(o((s=i.pop()).key,e)>0)break;if(o(s.key,t)>=0&&n.call(r,s))return this;s=s.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var n=e.key;return t.push(n)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var n=e.data;return t.push(n)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,n=!1,r=0,i=[];!n;)if(e)i.push(e),e=e.left;else if(i.length>0){if(e=i.pop(),r===t)return e;r++,e=e.right}else n=!0;return null},t.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?(n=e,e=e.left):e=e.right}return n},t.prototype.prev=function(t){var e=this._root,n=null;if(null!==t.left){for(n=t.left;n.right;)n=n.right;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?e=e.left:(n=e,e=e.right)}return n},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){for(var e=t,n=[],r=!1,i=new Fa(null,null),o=i;!r;)e?(n.push(e),e=e.left):n.length>0?e=(e=o=o.next=n.pop()).right:r=!0;return o.next=null,i.next}(this._root)},t.prototype.load=function(t,e,n){void 0===e&&(e=[]),void 0===n&&(n=!1);var r=t.length,i=this._comparator;if(n&&function t(e,n,r,i,o){if(!(r>=i)){for(var s=e[r+i>>1],a=r-1,u=i+1;;){do{a++}while(o(e[a],s)<0);do{u--}while(o(e[u],s)>0);if(a>=u)break;var c=e[a];e[a]=e[u],e[u]=c,c=n[a],n[a]=n[u],n[u]=c}t(e,n,r,u,o),t(e,n,u+1,i,o)}}(t,e,0,r-1,i),null===this._root)this._root=function t(e,n,r,i){var o=i-r;if(o>0){var s=r+Math.floor(o/2),a=e[s],u=n[s],c=new Fa(a,u);return c.left=t(e,n,r,s),c.right=t(e,n,s+1,i),c}return null}(t,e,0,r),this._size=r;else{var o=function(t,e,n){for(var r=new Fa(null,null),i=r,o=t,s=e;null!==o&&null!==s;)n(o.key,s.key)<0?(i.next=o,o=o.next):(i.next=s,s=s.next),i=i.next;return null!==o?i.next=o:null!==s&&(i.next=s),r.next}(this.toList(),function(t,e){for(var n=new Fa(null,null),r=n,i=0;i0){var o=n+Math.floor(i/2),s=t(e,n,o),a=e.head;return a.left=s,e.head=e.head.next,a.right=t(e,o+1,r),a}return null}({head:o},0,r)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return function t(e,n,r,i,o){if(e){i(n+(r?"└── ":"├── ")+o(e)+"\n");var s=n+(r?" ":"│ ");e.left&&t(e.left,s,!1,i,o),e.right&&t(e.right,s,!0,i,o)}}(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,n){var r=this._comparator,i=Ga(t,this._root,r),o=i.left,s=i.right;r(t,e)<0?s=Ba(e,n,s,r):o=Ba(e,n,o,r),this._root=function(t,e,n){return null===e?t:(null===t||((e=Da(t.key,e,n)).left=t),e)}(o,s,r)},t.prototype.split=function(t){return Ga(t,this._root,this._comparator)},t}();function za(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ua(t,e){for(var n=0;ne.x?1:t.ye.y?1:0}}]),Va(t,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,n=0,r=e.length;n=0&&u>=0?sc?-1:0:o<0&&u<0?sc?1:0:uo?1:0}}}]),t}(),au=0,uu=function(){function t(e,n,r,i){za(this,t),this.id=++au,this.leftSE=e,e.segment=this,e.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=e,this.rings=r,this.windings=i}return Va(t,null,[{key:"compare",value:function(t,e){var n=t.leftSE.point.x,r=e.leftSE.point.x,i=t.rightSE.point.x,o=e.rightSE.point.x;if(os&&a>u)return-1;var l=t.comparePoint(e.leftSE.point);if(l<0)return 1;if(l>0)return-1;var h=e.comparePoint(t.rightSE.point);return 0!==h?h:-1}if(n>r){if(sa&&s>c)return 1;var f=e.comparePoint(t.leftSE.point);if(0!==f)return f;var p=t.comparePoint(e.rightSE.point);return p<0?1:p>0?-1:1}if(sa)return 1;if(io){var g=t.comparePoint(e.rightSE.point);if(g<0)return 1;if(g>0)return-1}if(i!==o){var y=u-s,v=i-n,m=c-a,_=o-r;if(y>v&&m<_)return 1;if(y_)return-1}return i>o?1:ic?1:t.ide.id?1:0}}]),Va(t,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:te?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x0&&a.swapEvents(),su.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(i.checkForConsuming(),o.checkForConsuming()),n}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,n=this.windings.length;e0){var o=n;n=r,r=o}if(n.prev===r){var s=n;n=r,r=s}for(var a=0,u=r.rings.length;a0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));i=n,o=e,s=-1}return new t(new su(i,!0),new su(o,!1),[r],[s])}}]),t}(),cu=function(){function t(e,n,r){if(za(this,t),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=r,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var i=$a.round(e[0][0],e[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};for(var o=i,s=1,a=e.length;sthis.bbox.ur.x&&(this.bbox.ur.x=u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),o=u)}i.x===o.x&&i.y===o.y||this.segments.push(uu.fromRing(o,i,this))}return Va(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,n=this.segments.length;ethis.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=n}return Va(t,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,n=this.interiorRings.length;ethis.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=n}return Va(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,n=this.polys.length;e0&&(t=r)}for(var i=t.segment.prevInResult(),o=i?i.prevInResult():null;;){if(!i)return null;if(!o)return i.ringOut;if(o.ringOut!==i.ringOut)return o.ringOut.enclosingRing()!==i.ringOut?i.ringOut:i.ringOut.enclosingRing();i=o.prevInResult(),o=i?i.prevInResult():null}}}]),t}(),pu=function(){function t(e){za(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return Va(t,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,n=this.interiorRings.length;e1&&void 0!==arguments[1]?arguments[1]:uu.compare;za(this,t),this.queue=e,this.tree=new qa(n),this.segments=[]}return Va(t,[{key:"process",value:function(t){var e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;var r=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!r)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var i=r,o=r,s=void 0,a=void 0;void 0===s;)null===(i=this.tree.prev(i))?s=null:void 0===i.key.consumedBy&&(s=i.key);for(;void 0===a;)null===(o=this.tree.next(o))?a=null:void 0===o.key.consumedBy&&(a=o.key);if(t.isLeft){var u=null;if(s){var c=s.getIntersection(e);if(null!==c&&(e.isAnEndpoint(c)||(u=c),!s.isAnEndpoint(c)))for(var l=this._splitSafely(s,c),h=0,f=l.length;h0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=s)}else{if(s&&a){var x=s.getIntersection(a);if(null!==x){if(!s.isAnEndpoint(x))for(var O=this._splitSafely(s,x),E=0,S=O.length;Eyu)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var _=new gu(p),b=p.size,w=p.pop();w;){var x=w.key;if(p.size===b){var O=x.segment;throw new Error("Unable to pop() ".concat(x.isLeft?"left":"right"," SweepEvent ")+"[".concat(x.point.x,", ").concat(x.point.y,"] from segment #").concat(O.id," ")+"[".concat(O.leftSE.point.x,", ").concat(O.leftSE.point.y,"] -> ")+"[".concat(O.rightSE.point.x,", ").concat(O.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(p.size>yu)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(_.segments.length>vu)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var E=_.process(x),S=0,C=E.length;S1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;re.x?1:this.ye.y?1:0},Mu.prototype.clone=function(){},Mu.prototype.copy=function(){return new Mu(this)},Mu.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},Mu.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)},Mu.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},Mu.prototype.hashCode=function(){var t=17;return 37*(t=37*t+Mu.hashCode(this.x))+Mu.hashCode(this.y)},Mu.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},Mu.prototype.interfaces_=function(){return[Eu,Su,Nu]},Mu.prototype.getClass=function(){return Mu},Mu.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=xu.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},Lu.DimensionalComparator.get=function(){return Iu},Lu.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},Lu.NULL_ORDINATE.get=function(){return xu.NaN},Lu.X.get=function(){return 0},Lu.Y.get=function(){return 1},Lu.Z.get=function(){return 2},Object.defineProperties(Mu,Lu);var Iu=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new wu("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};Iu.prototype.compare=function(t,e){var n=t,r=e,i=Iu.compare(n.x,r.x);if(0!==i)return i;var o=Iu.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:Iu.compare(n.z,r.z)},Iu.prototype.interfaces_=function(){return[Cu]},Iu.prototype.getClass=function(){return Iu},Iu.compare=function(t,e){return te?1:xu.isNaN(t)?xu.isNaN(e)?0:-1:xu.isNaN(e)?1:0};var Pu=function(){};Pu.prototype.create=function(){},Pu.prototype.interfaces_=function(){return[]},Pu.prototype.getClass=function(){return Pu};var ju=function(){},Au={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};ju.prototype.interfaces_=function(){return[]},ju.prototype.getClass=function(){return ju},ju.toLocationSymbol=function(t){switch(t){case ju.EXTERIOR:return"e";case ju.BOUNDARY:return"b";case ju.INTERIOR:return"i";case ju.NONE:return"-"}throw new wu("Unknown location value: "+t)},Au.INTERIOR.get=function(){return 0},Au.BOUNDARY.get=function(){return 1},Au.EXTERIOR.get=function(){return 2},Au.NONE.get=function(){return-1},Object.defineProperties(ju,Au);var Ru=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},Tu=function(){},Fu={LOG_10:{configurable:!0}};Tu.prototype.interfaces_=function(){return[]},Tu.prototype.getClass=function(){return Tu},Tu.log10=function(t){var e=Math.log(t);return xu.isInfinite(e)||xu.isNaN(e)?e:e/Tu.LOG_10},Tu.min=function(t,e,n,r){var i=t;return en?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],o=arguments[2];return ro?o:r}},Tu.wrap=function(t,e){return t<0?e- -t%e:t%e},Tu.max=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=t;return e>r&&(r=e),n>r&&(r=n),r}if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=i;return o>u&&(u=o),s>u&&(u=s),a>u&&(u=a),u}},Tu.average=function(t,e){return(t+e)/2},Fu.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Tu,Fu);var ku=function(t){this.str=t};ku.prototype.append=function(t){this.str+=t},ku.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},ku.prototype.toString=function(t){return this.str};var Du=function(t){this.value=t};Du.prototype.intValue=function(){return this.value},Du.prototype.compareTo=function(t){return this.valuet?1:0},Du.isNaN=function(t){return Number.isNaN(t)};var Bu=function(){};Bu.isWhitespace=function(t){return t<=32&&t>=0||127===t},Bu.toUpperCase=function(t){return t.toUpperCase()};var Gu=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else if("string"==typeof arguments[0]){var r=arguments[0];t.call(this,t.parse(r))}}else if(2===arguments.length){var i=arguments[0],o=arguments[1];this.init(i,o)}},qu={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};Gu.prototype.le=function(t){return(this._hi9?(l=!0,h="9"):h="0"+c,s.append(h),n=n.subtract(Gu.valueOf(c)).multiply(Gu.TEN),l&&n.selfAdd(Gu.TEN);var f=!0,p=Gu.magnitude(n._hi);if(p<0&&Math.abs(p)>=a-u&&(f=!1),!f)break}return e[0]=r,s.toString()},Gu.prototype.sqr=function(){return this.multiply(this)},Gu.prototype.doubleValue=function(){return this._hi+this._lo},Gu.prototype.subtract=function(){if(arguments[0]instanceof Gu){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},Gu.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},Gu.prototype.isZero=function(){return 0===this._hi&&0===this._lo},Gu.prototype.selfSubtract=function(){if(arguments[0]instanceof Gu){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},Gu.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},Gu.prototype.min=function(t){return this.le(t)?this:t},Gu.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof Gu){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,s=null,a=null,u=null,c=null,l=null,h=null;return u=this._hi/n,h=(i=(c=Gu.SPLIT*u)-(i=c-u))*(s=(h=Gu.SPLIT*n)-(s=h-n))-(l=u*n)+i*(a=n-s)+(o=u-i)*s+o*a,h=u+(c=(this._hi-l-h+this._lo-u*r)/n),this._hi=h,this._lo=u-h+c,this}},Gu.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},Gu.prototype.divide=function(){if(arguments[0]instanceof Gu){var t=arguments[0],e=null,n=null,r=null,i=null,o=null,s=null,a=null,u=null;n=(o=this._hi/t._hi)-(e=(s=Gu.SPLIT*o)-(e=s-o)),u=e*(r=(u=Gu.SPLIT*t._hi)-(r=u-t._hi))-(a=o*t._hi)+e*(i=t._hi-r)+n*r+n*i;var c=u=o+(s=(this._hi-a-u+this._lo-o*t._lo)/t._hi),l=o-u+s;return new Gu(c,l)}if("number"==typeof arguments[0]){var h=arguments[0];return xu.isNaN(h)?Gu.createNaN():Gu.copy(this).selfDivide(h,0)}},Gu.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},Gu.prototype.pow=function(t){if(0===t)return Gu.valueOf(1);var e=new Gu(this),n=Gu.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2==1&&n.selfMultiply(e),(r/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},Gu.prototype.ceil=function(){if(this.isNaN())return Gu.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new Gu(t,e)},Gu.prototype.compareTo=function(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0},Gu.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},Gu.prototype.setValue=function(){if(arguments[0]instanceof Gu){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},Gu.prototype.max=function(t){return this.ge(t)?this:t},Gu.prototype.sqrt=function(){if(this.isZero())return Gu.valueOf(0);if(this.isNegative())return Gu.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=Gu.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},Gu.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof Gu){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,r=null,i=null,o=null,s=null,a=null;return o=(i=this._hi+e)-(s=i-this._hi),r=(a=(o=e-s+(this._hi-o))+this._lo)+(i-(n=i+a)),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var u=arguments[0],c=arguments[1],l=null,h=null,f=null,p=null,d=null,g=null,y=null;p=this._hi+u,h=this._lo+c,d=p-(g=p-this._hi),f=h-(y=h-this._lo);var v=(l=p+(g=(d=u-g+(this._hi-d))+h))+(g=(f=c-y+(this._lo-f))+(g+(p-l))),m=g+(l-v);return this._hi=v,this._lo=m,this}},Gu.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof Gu){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,s=null,a=null,u=null,c=null;i=(u=Gu.SPLIT*this._hi)-this._hi,c=Gu.SPLIT*n,i=u-i,o=this._hi-i,s=c-n;var l=(u=this._hi*n)+(c=i*(s=c-s)-u+i*(a=n-s)+o*s+o*a+(this._hi*r+this._lo*n)),h=c+(i=u-l);return this._hi=l,this._lo=h,this}},Gu.prototype.selfSqr=function(){return this.selfMultiply(this)},Gu.prototype.floor=function(){if(this.isNaN())return Gu.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new Gu(t,e)},Gu.prototype.negate=function(){return this.isNaN()?this:new Gu(-this._hi,-this._lo)},Gu.prototype.clone=function(){},Gu.prototype.multiply=function(){if(arguments[0]instanceof Gu){var t=arguments[0];return t.isNaN()?Gu.createNaN():Gu.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return xu.isNaN(e)?Gu.createNaN():Gu.copy(this).selfMultiply(e,0)}},Gu.prototype.isNaN=function(){return xu.isNaN(this._hi)},Gu.prototype.intValue=function(){return Math.trunc(this._hi)},Gu.prototype.toString=function(){var t=Gu.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},Gu.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+Gu.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+Gu.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},Gu.prototype.reciprocal=function(){var t,e,n,r,i=null,o=null,s=null,a=null;t=(n=1/this._hi)-(i=(s=Gu.SPLIT*n)-(i=s-n)),o=(a=Gu.SPLIT*this._hi)-this._hi;var u=n+(s=(1-(r=n*this._hi)-(a=i*(o=a-o)-r+i*(e=this._hi-o)+t*o+t*e)-n*this._lo)/this._hi);return new Gu(u,n-u+s)},Gu.prototype.toSciNotation=function(){if(this.isZero())return Gu.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=Gu.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";n.length>1&&(i=n.substring(1));var o=n.charAt(0)+"."+i;return this.isNegative()?"-"+o+r:o+r},Gu.prototype.abs=function(){return this.isNaN()?Gu.NaN:this.isNegative()?this.negate():new Gu(this)},Gu.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},Gu.prototype.lt=function(t){return(this._hit._hi||this._hi===t._hi)&&this._lo>t._lo},Gu.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},Gu.prototype.trunc=function(){return this.isNaN()?Gu.NaN:this.isPositive()?this.floor():this.ceil()},Gu.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},Gu.prototype.interfaces_=function(){return[Nu,Eu,Su]},Gu.prototype.getClass=function(){return Gu},Gu.sqr=function(t){return Gu.valueOf(t).selfMultiply(t)},Gu.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return Gu.parse(t)}if("number"==typeof arguments[0]){var e=arguments[0];return new Gu(e)}},Gu.sqrt=function(t){return Gu.valueOf(t).sqrt()},Gu.parse=function(t){for(var e=0,n=t.length;Bu.isWhitespace(t.charAt(e));)e++;var r=!1;if(e=n);){var c=t.charAt(e);if(e++,Bu.isDigit(c)){var l=c-"0";o.selfMultiply(Gu.TEN),o.selfAdd(l),s++}else{if("."!==c){if("e"===c||"E"===c){var h=t.substring(e);try{u=Du.parseInt(h)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+h+" in string "+t):e}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}a=s}}var f=o,p=s-a-u;if(0===p)f=o;else if(p>0){var d=Gu.TEN.pow(p);f=o.divide(d)}else if(p<0){var g=Gu.TEN.pow(-p);f=o.multiply(g)}return r?f.negate():f},Gu.createNaN=function(){return new Gu(xu.NaN,xu.NaN)},Gu.copy=function(t){return new Gu(t)},Gu.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=e&&(r+=1),r},Gu.stringOfChar=function(t,e){for(var n=new ku,r=0;r0){if(o<=0)return zu.signum(s);r=i+o}else{if(!(i<0))return zu.signum(s);if(o>=0)return zu.signum(s);r=-i-o}var a=zu.DP_SAFE_EPSILON*r;return s>=a||-s>=a?zu.signum(s):2},zu.signum=function(t){return t>0?1:t<0?-1:0},Uu.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(zu,Uu);var Vu=function(){},Yu={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Yu.X.get=function(){return 0},Yu.Y.get=function(){return 1},Yu.Z.get=function(){return 2},Yu.M.get=function(){return 3},Vu.prototype.setOrdinate=function(t,e,n){},Vu.prototype.size=function(){},Vu.prototype.getOrdinate=function(t,e){},Vu.prototype.getCoordinate=function(){},Vu.prototype.getCoordinateCopy=function(t){},Vu.prototype.getDimension=function(){},Vu.prototype.getX=function(t){},Vu.prototype.clone=function(){},Vu.prototype.expandEnvelope=function(t){},Vu.prototype.copy=function(){},Vu.prototype.getY=function(t){},Vu.prototype.toCoordinateArray=function(){},Vu.prototype.interfaces_=function(){return[Su]},Vu.prototype.getClass=function(){return Vu},Object.defineProperties(Vu,Yu);var Wu=function(){},Xu=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Wu),Hu=function(){};Hu.arraycopy=function(t,e,n,r,i){for(var o=0,s=e;st._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}},Zu.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof Zu){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||nthis._maxy||rthis._maxx&&(this._maxx=e._maxx),e._minythis._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(nthis._maxx&&(this._maxx=n),rthis._maxy&&(this._maxy=r))}},Zu.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0},Zu.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},Zu.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Zu.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Zu.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Zu.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},Zu.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Zu.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof Zu){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof Mu){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},Zu.prototype.centre=function(){return this.isNull()?null:new Mu((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Zu.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof Mu){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Zu){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];it._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxyt._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},Zu.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+Mu.hashCode(this._minx))+Mu.hashCode(this._maxx))+Mu.hashCode(this._miny))+Mu.hashCode(this._maxy)},Zu.prototype.interfaces_=function(){return[Eu,Nu]},Zu.prototype.getClass=function(){return Zu},Zu.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.xe.x?t.x:e.x)&&n.y>=(t.ye.y?t.y:e.y)}if(4===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),c=Math.min(r.x,i.x),l=Math.max(r.x,i.x);return!(c>u||lu||ln?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},sc.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},sc.prototype.setPrecisionModel=function(t){this._precisionModel=t},sc.prototype.isInteriorIntersection=function(){var t=this;if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var e=arguments[0],n=0;ni?r:i;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(o=r>i?s:a)||t.equals(e)||(o=Math.max(s,a))}return oc.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},sc.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return oc.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},ac.DONT_INTERSECT.get=function(){return 0},ac.DO_INTERSECT.get=function(){return 1},ac.COLLINEAR.get=function(){return 2},ac.NO_INTERSECTION.get=function(){return 0},ac.POINT_INTERSECTION.get=function(){return 1},ac.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(sc,ac);var uc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new Zu(this._inputLines[0][0],this._inputLines[0][1]),n=new Zu(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2];if(this._isProper=!1,Zu.intersects(n,r,e)&&0===hc.orientationIndex(n,r,e)&&0===hc.orientationIndex(r,n,e))return this._isProper=!0,(e.equals(n)||e.equals(r))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,r,i){i.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),i.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,i){var o=null;try{o=Ku.intersection(t,n,r,i)}catch(s){if(!(s instanceof Xu))throw s;o=e.nearestEndpoint(t,n,r,i)}return o},e.prototype.intersection=function(t,n,r,i){var o=this.intersectionWithNormalization(t,n,r,i);return this.isInSegmentEnvelopes(o)||(o=new Mu(e.nearestEndpoint(t,n,r,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,n,r){var i=t,o=Math.abs(i);return Math.abs(e)1e-4&&Hu.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new Mu(t),o=new Mu(e),s=new Mu(n),a=new Mu(r),u=new Mu;this.normalizeToEnvCentre(i,o,s,a,u);var c=this.safeHCoordinateIntersection(i,o,s,a);return c.x+=u.x,c.y+=u.y,c},e.prototype.computeCollinearIntersection=function(e,n,r,i){var o=Zu.intersects(e,n,r),s=Zu.intersects(e,n,i),a=Zu.intersects(r,i,e),u=Zu.intersects(r,i,n);return o&&s?(this._intPt[0]=r,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):a&&u?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):o&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||s||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&u?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||s||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&a?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||o||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&u?(this._intPt[0]=i,this._intPt[1]=n,!i.equals(n)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,i){var o=t.xe.x?t.x:e.x,u=t.y>e.y?t.y:e.y,c=n.xr.x?n.x:r.x,f=n.y>r.y?n.y:r.y,p=((o>c?o:c)+(al?s:l)+(u0&&s>0||o<0&&s<0)return t.NO_INTERSECTION;var a=hc.orientationIndex(r,i,e),u=hc.orientationIndex(r,i,n);return a>0&&u>0||a<0&&u<0?t.NO_INTERSECTION:0===o&&0===s&&0===a&&0===u?this.computeCollinearIntersection(e,n,r,i):(0===o||0===s||0===a||0===u?(this._isProper=!1,e.equals2D(r)||e.equals2D(i)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(i)?this._intPt[0]=n:0===o?this._intPt[0]=new Mu(r):0===s?this._intPt[0]=new Mu(i):0===a?this._intPt[0]=new Mu(e):0===u&&(this._intPt[0]=new Mu(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var i=t,o=hc.distancePointLine(t,n,r),s=hc.distancePointLine(e,n,r);return s0?n>0?-i:i:n>0?i:-i;if(0===e||0===n)return r>0?t>0?i:-i:t>0?-i:i;if(e>0?r>0?e<=r||(i=-i,o=t,t=n,n=o,o=e,e=r,r=o):e<=-r?(i=-i,n=-n,r=-r):(o=t,t=-n,n=o,o=e,e=-r,r=o):r>0?-e<=r?(i=-i,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,n=-n,r=-r):(i=-i,o=-t,t=-n,n=o,o=-e,e=-r,r=o),t>0){if(!(n>0))return i;if(!(t<=n))return i}else{if(n>0)return-i;if(!(t>=n))return-i;i=-i,t=-t,n=-n}for(;;){if((r-=(s=Math.floor(n/t))*e)<0)return-i;if(r>e)return i;if(t>(n-=s*t)+n){if(er+r)return-i;n=t-n,r=e-r,i=-i}if(0===r)return 0===n?0:-i;if(0===n)return i;if((e-=(s=Math.floor(t/n))*r)<0)return i;if(e>r)return-i;if(n>(t-=s*n)+t){if(re+e)return i;t=n-t,e=r-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var lc=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};lc.prototype.countSegment=function(t,e){if(t.xr&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var i=t.x-this._p.x,o=t.y-this._p.y,s=e.x-this._p.x,a=e.y-this._p.y,u=cc.signOfDet2x2(i,o,s,a);if(0===u)return this._isPointOnSegment=!0,null;a0&&this._crossingCount++}},lc.prototype.isPointInPolygon=function(){return this.getLocation()!==ju.EXTERIOR},lc.prototype.getLocation=function(){return this._isPointOnSegment?ju.BOUNDARY:this._crossingCount%2==1?ju.INTERIOR:ju.EXTERIOR},lc.prototype.isOnSegment=function(){return this._isPointOnSegment},lc.prototype.interfaces_=function(){return[]},lc.prototype.getClass=function(){return lc},lc.locatePointInRing=function(){if(arguments[0]instanceof Mu&&Ru(arguments[1],Vu)){for(var t=arguments[0],e=arguments[1],n=new lc(t),r=new Mu,i=new Mu,o=1;o1||a<0||a>1)&&(i=!0)}}else i=!0;return i?Tu.min(hc.distancePointLine(t,n,r),hc.distancePointLine(e,n,r),hc.distancePointLine(n,t,e),hc.distancePointLine(r,t,e)):0},hc.isPointInRing=function(t,e){return hc.locatePointInRing(t,e)!==ju.EXTERIOR},hc.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new Mu;t.getCoordinate(0,r);for(var i=r.x,o=r.y,s=1;sn.y&&(n=o,r=i)}var s=r;do{(s-=1)<0&&(s=e)}while(t[s].equals2D(n)&&s!==r);var a=r;do{a=(a+1)%e}while(t[a].equals2D(n)&&a!==r);var u=t[s],c=t[a];if(u.equals2D(n)||c.equals2D(n)||u.equals2D(c))return!1;var l=hc.computeOrientation(u,n,c);return 0===l?u.x>c.x:l>0},hc.locatePointInRing=function(t,e){return lc.locatePointInRing(t,e)},hc.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)},hc.computeOrientation=function(t,e,n){return hc.orientationIndex(t,e,n)},hc.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new wu("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r=1)return o.distance(a);var l=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/u;return Math.abs(l)*Math.sqrt(u)}},hc.isOnLine=function(t,e){for(var n=new uc,r=1;r0},wc.prototype.interfaces_=function(){return[mc]},wc.prototype.getClass=function(){return wc};var xc=function(){};xc.prototype.isInBoundary=function(t){return t>1},xc.prototype.interfaces_=function(){return[mc]},xc.prototype.getClass=function(){return xc};var Oc=function(){};Oc.prototype.isInBoundary=function(t){return 1===t},Oc.prototype.interfaces_=function(){return[mc]},Oc.prototype.getClass=function(){return Oc};var Ec=function(){};function Sc(t){this.message=t||""}Ec.prototype.add=function(){},Ec.prototype.addAll=function(){},Ec.prototype.isEmpty=function(){},Ec.prototype.iterator=function(){},Ec.prototype.size=function(){},Ec.prototype.toArray=function(){},Ec.prototype.remove=function(){},Sc.prototype=new Error,Sc.prototype.name="IndexOutOfBoundsException";var Cc=function(){};Cc.prototype.hasNext=function(){},Cc.prototype.next=function(){},Cc.prototype.remove=function(){};var Nc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(Ec);function Mc(t){this.message=t||""}Mc.prototype=new Error,Mc.prototype.name="NoSuchElementException";var Lc=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof Ec&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,Ec]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},e.prototype.iterator=function(){return new Ic(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new Sc;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e=1){var a=this.get(this.size()-1);if(a.equals2D(o))return null}t.prototype.add.call(this,o)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var u=arguments[0],c=arguments[1];return this.add(u,c),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var l=arguments[0],h=arguments[1],f=arguments[2];if(f)for(var p=0;p=0;d--)e.add(l[d],h);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof Mu){var g=arguments[0],y=arguments[1],v=arguments[2];if(!v){var m=this.size();if(m>0){if(g>0){var _=this.get(g-1);if(_.equals2D(y))return null}if(gE&&(S=-1);for(var C=O;C!==E;C+=S)e.add(w[C],x);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new Mu(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(Lc),jc=function(){},Ac={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Ac.ForwardComparator.get=function(){return Rc},Ac.BidirectionalComparator.get=function(){return Tc},Ac.coordArrayType.get=function(){return new Array(0).fill(null)},jc.prototype.interfaces_=function(){return[]},jc.prototype.getClass=function(){return jc},jc.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},jc.ptNotInList=function(t,e){for(var n=0;n=t?e:[]},jc.indexOf=function(t,e){for(var n=0;n0)&&(e=t[n]);return e},jc.extract=function(t,e,n){e=Tu.clamp(e,0,t.length);var r=(n=Tu.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),nr.length)return 1;if(0===n.length)return 0;var i=jc.compare(n,r);return jc.isEqualReversed(n,r)?0:i},Tc.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.lengthr.length)return 1;if(0===n.length)return 0;for(var i=jc.increasingDirection(n),o=jc.increasingDirection(r),s=i>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u0))return e.value;e=e.right}}return null},Xc.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:0,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,i=this.root_;do{if(n=i,(r=t.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var s={key:t,left:null,right:null,value:e,parent:n,color:0,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},Xc.prototype.fixAfterInsertion=function(t){var e=this;for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(Uc(t)===Yc(Uc(Uc(t)))){var n=Wc(Uc(Uc(t)));1===zc(n)?(Vc(Uc(t),0),Vc(n,0),Vc(Uc(Uc(t)),1),t=Uc(Uc(t))):(t===Wc(Uc(t))&&(t=Uc(t),e.rotateLeft(t)),Vc(Uc(t),0),Vc(Uc(Uc(t)),1),e.rotateRight(Uc(Uc(t))))}else{var r=Yc(Uc(Uc(t)));1===zc(r)?(Vc(Uc(t),0),Vc(r,0),Vc(Uc(Uc(t)),1),t=Uc(Uc(t))):(t===Yc(Uc(t))&&(t=Uc(t),e.rotateRight(t)),Vc(Uc(t),0),Vc(Uc(Uc(t)),1),e.rotateLeft(Uc(Uc(t))))}this.root_.color=0},Xc.prototype.values=function(){var t=new Lc,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=Xc.successor(e));)t.add(e.value);return t},Xc.prototype.entrySet=function(){var t=new Gc,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=Xc.successor(e));)t.add(e);return t},Xc.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},Xc.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},Xc.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},Xc.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var n=t.parent,r=t;null!==n&&r===n.right;)r=n,n=n.parent;return n},Xc.prototype.size=function(){return this.size_};var Hc=function(){};function Kc(){}function Zc(){this.array_=[],arguments[0]instanceof Ec&&this.addAll(arguments[0])}Hc.prototype.interfaces_=function(){return[]},Hc.prototype.getClass=function(){return Hc},Kc.prototype=new Bc,Zc.prototype=new Kc,Zc.prototype.contains=function(t){for(var e=0,n=this.array_.length;e=0;){var s=i.substring(0,o);r.add(s),o=(i=i.substring(o+n)).indexOf(e)}i.length>0&&r.add(i);for(var a=new Array(r.size()).fill(null),u=0;u0)for(var o=i;o0&&r.append(" ");for(var o=0;o0&&r.append(","),r.append(pl.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}},gl.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?gl.createClosedRing(t,e,4):e.getOrdinate(0,Vu.X)===e.getOrdinate(n-1,Vu.X)&&e.getOrdinate(0,Vu.Y)===e.getOrdinate(n-1,Vu.Y)?e:gl.createClosedRing(t,e,n+1)},gl.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();gl.copy(e,0,r,0,i);for(var o=i;o0&&gl.reverse(t._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Qc.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return hc.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return gl.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){var t=this;if(1===arguments.length){for(var e=arguments[0],n=e,r=0,i=0;r= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e=1&&this.getCoordinateSequence().size()= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}(yl),Ol=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return dc.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n0?e.createPoint(n[0]):e.createPoint():t},Nl.prototype.interfaces_=function(){return[El.GeometryEditorOperation]},Nl.prototype.getClass=function(){return Nl};var Ml=function(){};Ml.prototype.edit=function(t,e){return t instanceof xl?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof yl?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof ml?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},Ml.prototype.interfaces_=function(){return[El.GeometryEditorOperation]},Ml.prototype.getClass=function(){return Ml};var Ll=function(){var t=this;if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(var n=0;n0){var t=new ku(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e3&&(r=3),r<2?new Ll(n):new Ll(n,r)}},Pl.prototype.interfaces_=function(){return[Pu,Nu]},Pl.prototype.getClass=function(){return Pl},Pl.instance=function(){return Pl.instanceObject},jl.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},jl.instanceObject.get=function(){return new Pl},Object.defineProperties(Pl,jl);var Al=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new Lc,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},e.prototype.entrySet=function(){var t=new Gc;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(Fc),Rl=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof Fl){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}},Tl={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Rl.prototype.equals=function(t){if(!(t instanceof Rl))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},Rl.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new Du(n).compareTo(new Du(r))},Rl.prototype.getScale=function(){return this._scale},Rl.prototype.isFloating=function(){return this._modelType===Rl.FLOATING||this._modelType===Rl.FLOATING_SINGLE},Rl.prototype.getType=function(){return this._modelType},Rl.prototype.toString=function(){var t="UNKNOWN";return this._modelType===Rl.FLOATING?t="Floating":this._modelType===Rl.FLOATING_SINGLE?t="Floating-Single":this._modelType===Rl.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},Rl.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return xu.isNaN(t)||this._modelType===Rl.FLOATING_SINGLE?t:this._modelType===Rl.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof Mu){var e=arguments[0];if(this._modelType===Rl.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},Rl.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===Rl.FLOATING?t=16:this._modelType===Rl.FLOATING_SINGLE?t=6:this._modelType===Rl.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},Rl.prototype.setScale=function(t){this._scale=Math.abs(t)},Rl.prototype.interfaces_=function(){return[Nu,Eu]},Rl.prototype.getClass=function(){return Rl},Rl.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},Tl.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},Tl.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Rl,Tl);var Fl=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},kl={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};Fl.prototype.readResolve=function(){return Fl.nameToTypeMap.get(this._name)},Fl.prototype.toString=function(){return this._name},Fl.prototype.interfaces_=function(){return[Nu]},Fl.prototype.getClass=function(){return Fl},kl.serialVersionUID.get=function(){return-552860263173159e4},kl.nameToTypeMap.get=function(){return new Al},Object.defineProperties(Fl,kl),Rl.Type=Fl,Rl.FIXED=new Fl("FIXED"),Rl.FLOATING=new Fl("FLOATING"),Rl.FLOATING_SINGLE=new Fl("FLOATING SINGLE");var Dl=function t(){this._precisionModel=new Rl,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?Ru(arguments[0],Pu)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Rl&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},Bl={serialVersionUID:{configurable:!0}};Dl.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new Mu(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new Mu(t.getMinX(),t.getMinY()),new Mu(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new Mu(t.getMinX(),t.getMinY()),new Mu(t.getMinX(),t.getMaxY()),new Mu(t.getMaxX(),t.getMaxY()),new Mu(t.getMaxX(),t.getMinY()),new Mu(t.getMinX(),t.getMinY())]),null)},Dl.prototype.createLineString=function(t){return t?t instanceof Array?new yl(this.getCoordinateSequenceFactory().create(t),this):Ru(t,Vu)?new yl(t,this):void 0:new yl(this.getCoordinateSequenceFactory().create([]),this)},Dl.prototype.createMultiLineString=function(){if(0===arguments.length)return new il(null,this);if(1===arguments.length){var t=arguments[0];return new il(t,this)}},Dl.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,i=t.iterator();i.hasNext();){var o=i.next(),s=o.getClass();null===e&&(e=s),s!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(Dl.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof bl)return this.createMultiPolygon(Dl.toPolygonArray(t));if(a instanceof yl)return this.createMultiLineString(Dl.toLineStringArray(t));if(a instanceof ml)return this.createMultiPoint(Dl.toPointArray(t));oc.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},Dl.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},Dl.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Mu){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(Ru(arguments[0],Vu)){var e=arguments[0];return new ml(e,this)}}},Dl.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},Dl.prototype.createPolygon=function(){if(0===arguments.length)return new bl(null,null,this);if(1===arguments.length){if(Ru(arguments[0],Vu)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof xl){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return new bl(r,i,this)}},Dl.prototype.getSRID=function(){return this._SRID},Dl.prototype.createGeometryCollection=function(){if(0===arguments.length)return new rl(null,this);if(1===arguments.length){var t=arguments[0];return new rl(t,this)}},Dl.prototype.createGeometry=function(t){return new El(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},Dl.prototype.getPrecisionModel=function(){return this._precisionModel},Dl.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(Ru(arguments[0],Vu)){var e=arguments[0];return new xl(e,this)}}},Dl.prototype.createMultiPolygon=function(){if(0===arguments.length)return new Ol(null,this);if(1===arguments.length){var t=arguments[0];return new Ol(t,this)}},Dl.prototype.createMultiPoint=function(){var t=this;if(0===arguments.length)return new wl(null,this);if(1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];return new wl(e,this)}if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(null!==n?this.getCoordinateSequenceFactory().create(n):null)}if(Ru(arguments[0],Vu)){var r=arguments[0];if(null===r)return this.createMultiPoint(new Array(0).fill(null));for(var i=new Array(r.size()).fill(null),o=0;o=this.size())throw new Error;return this.array_[t]},Kl.prototype.push=function(t){return this.array_.push(t),t},Kl.prototype.pop=function(t){if(0===this.array_.length)throw new Hl;return this.array_.pop()},Kl.prototype.peek=function(){if(0===this.array_.length)throw new Hl;return this.array_[this.array_.length-1]},Kl.prototype.empty=function(){return 0===this.array_.length},Kl.prototype.isEmpty=function(){return this.empty()},Kl.prototype.search=function(t){return this.array_.indexOf(t)},Kl.prototype.size=function(){return this.array_.length},Kl.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e0&&this._minIndexthis._minCoord.y&&n.y>this._minCoord.y&&r===hc.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Zl.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=Wl.LEFT;return n[e].ye._minCoord.x)&&(e._minDe=t,e._minIndex=r,e._minCoord=n[r])},Zl.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Zl.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}oc.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Wl.LEFT&&(this._orientedDe=this._minDe.getSym())},Zl.prototype.interfaces_=function(){return[]},Zl.prototype.getClass=function(){return Zl};var Jl=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new Mu(r):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}(rc),$l=function(){this.array_=[]};$l.prototype.addLast=function(t){this.array_.push(t)},$l.prototype.removeFirst=function(){return this.array_.shift()},$l.prototype.isEmpty=function(){return 0===this.array_.length};var Ql=function(){this._finder=null,this._dirEdgeList=new Lc,this._nodes=new Lc,this._rightMostCoord=null,this._env=null,this._finder=new Zl};Ql.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Ql.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ql.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new Jl("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},Ql.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Wl.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Ql.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ql.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Wl.RIGHT)>=1&&e.getDepth(Wl.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Ql.prototype.computeDepths=function(t){var e=new Gc,n=new $l,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var s=o.next().getSym();if(!s.isVisited()){var a=s.getNode();e.contains(a)||(n.addLast(a),e.add(a))}}}},Ql.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0},Ql.prototype.getEnvelope=function(){if(null===this._env){for(var t=new Zu,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;rthis.location.length){var e=new Array(3).fill(null);e[Wl.ON]=this.location[Wl.ON],e[Wl.LEFT]=ju.NONE,e[Wl.RIGHT]=ju.NONE,this.location=e}for(var n=0;n1&&t.append(ju.toLocationSymbol(this.location[Wl.LEFT])),t.append(ju.toLocationSymbol(this.location[Wl.ON])),this.location.length>1&&t.append(ju.toLocationSymbol(this.location[Wl.RIGHT])),t.toString()},th.prototype.setLocations=function(t,e,n){this.location[Wl.ON]=t,this.location[Wl.LEFT]=e,this.location[Wl.RIGHT]=n},th.prototype.get=function(t){return t1},th.prototype.isAnyNull=function(){for(var t=0;tt._maxNodeDegree&&(t._maxNodeDegree=n),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},nh.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o=0;a--)this._pts.add(r[a])}},nh.prototype.isHole=function(){return this._isHole},nh.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},nh.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!hc.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},nh.prototype.addHole=function(t){this._holes.add(t)},nh.prototype.isShell=function(){return null===this._shell},nh.prototype.getLabel=function(){return this._label},nh.prototype.getEdges=function(){return this._edges},nh.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},nh.prototype.getShell=function(){return this._shell},nh.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=e.getLocation(n,Wl.RIGHT);if(r===ju.NONE)return null;if(this._label.getLocation(n)===ju.NONE)return this._label.setLocation(n,r),null}},nh.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},nh.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n=2,"found partial label"),this.computeIM(t)},oh.prototype.isInResult=function(){return this._isInResult},oh.prototype.isVisited=function(){return this._isVisited},oh.prototype.interfaces_=function(){return[]},oh.prototype.getClass=function(){return oh};var sh=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new eh(0,ju.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var n=ju.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==ju.BOUNDARY&&(n=r)}return n},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],n=arguments[1];null===this._label?this._label=new eh(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){var t=this;if(arguments[0]instanceof e){var n=arguments[0];this.mergeLabel(n._label)}else if(arguments[0]instanceof eh)for(var r=arguments[0],i=0;i<2;i++){var o=t.computeMergedLocation(r,i),s=t._label.getLocation(i);s===ju.NONE&&t._label.setLocation(i,o)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=ju.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case ju.BOUNDARY:n=ju.INTERIOR;break;case ju.INTERIOR:default:n=ju.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(oh),ah=function(){this.nodeMap=new Xc,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};ah.prototype.find=function(t){return this.nodeMap.get(t)},ah.prototype.addNode=function(){if(arguments[0]instanceof Mu){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof sh){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},ah.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},ah.prototype.iterator=function(){return this.nodeMap.values().iterator()},ah.prototype.values=function(){return this.nodeMap.values()},ah.prototype.getBoundaryNodes=function(t){for(var e=new Lc,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===ju.BOUNDARY&&e.add(r)}return e},ah.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},ah.prototype.interfaces_=function(){return[]},ah.prototype.getClass=function(){return ah};var uh=function(){},ch={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};uh.prototype.interfaces_=function(){return[]},uh.prototype.getClass=function(){return uh},uh.isNorthern=function(t){return t===uh.NE||t===uh.NW},uh.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},uh.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var n=te?t:e)?3:n},uh.isInHalfPlane=function(t,e){return e===uh.SE?t===uh.SE||t===uh.SW:t===e||t===e+1},uh.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new wu("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?uh.NE:uh.SE:e>=0?uh.NW:uh.SW}if(arguments[0]instanceof Mu&&arguments[1]instanceof Mu){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new wu("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?uh.NE:uh.SE:r.y>=n.y?uh.NW:uh.SW}},ch.NE.get=function(){return 0},ch.NW.get=function(){return 1},ch.SW.get=function(){return 2},ch.SE.get=function(){return 3},Object.defineProperties(uh,ch);var lh=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=null;this._edge=e,this.init(n,r),this._label=i}else if(4===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];this._edge=o,this.init(s,a),this._label=u}};lh.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){o.linkDirectedEdgesForMinimalEdgeRings();var s=o.buildMinimalRings(),a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.add(a)):n.addAll(s)}else r.add(o)}return r},dh.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},dh.prototype.buildMaximalEdgeRings=function(t){for(var e=new Lc,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new ih(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},dh.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},dh.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},dh.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),c=u.getLinearRing(),l=c.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var h=!1;l.contains(r)&&hc.isPointInRing(i,c.getCoordinates())&&(h=!0),h&&(null===o||s.contains(l))&&(o=u)}return o},dh.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return oc.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},dh.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];ph.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new Lc,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},dh.prototype.interfaces_=function(){return[]},dh.prototype.getClass=function(){return dh};var gh=function(){};gh.prototype.getBounds=function(){},gh.prototype.interfaces_=function(){return[]},gh.prototype.getClass=function(){return gh};var yh=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};yh.prototype.getItem=function(){return this._item},yh.prototype.getBounds=function(){return this._bounds},yh.prototype.interfaces_=function(){return[gh,Nu]},yh.prototype.getClass=function(){return yh};var vh=function(){this._size=null,this._items=null,this._size=0,this._items=new Lc,this._items.add(null)};vh.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},vh.prototype.size=function(){return this._size},vh.prototype.reorder=function(t){for(var e=this,n=null,r=this._items.get(t);2*t<=this._size&&((n=2*t)!==e._size&&e._items.get(n+1).compareTo(e._items.get(n))<0&&n++,e._items.get(n).compareTo(r)<0);t=n)e._items.set(t,e._items.get(n));this._items.set(t,r)},vh.prototype.clear=function(){this._size=0,this._items.clear()},vh.prototype.isEmpty=function(){return 0===this._size},vh.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},vh.prototype.interfaces_=function(){return[]},vh.prototype.getClass=function(){return vh};var mh=function(){};mh.prototype.visitItem=function(t){},mh.prototype.interfaces_=function(){return[]},mh.prototype.getClass=function(){return mh};var _h=function(){};_h.prototype.insert=function(t,e){},_h.prototype.remove=function(t,e){},_h.prototype.query=function(){},_h.prototype.interfaces_=function(){return[]},_h.prototype.getClass=function(){return _h};var bh=function(){if(this._childBoundables=new Lc,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},wh={serialVersionUID:{configurable:!0}};bh.prototype.getLevel=function(){return this._level},bh.prototype.size=function(){return this._childBoundables.size()},bh.prototype.getChildBoundables=function(){return this._childBoundables},bh.prototype.addChildBoundable=function(t){oc.isTrue(null===this._bounds),this._childBoundables.add(t)},bh.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},bh.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},bh.prototype.interfaces_=function(){return[gh,Nu]},bh.prototype.getClass=function(){return bh},wh.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(bh,wh);var xh=function(){};xh.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},xh.min=function(t){return xh.sort(t),t.get(0)},xh.sort=function(t,e){var n=t.toArray();e?$c.sort(n,e):$c.sort(n);for(var r=t.iterator(),i=0,o=n.length;iOh.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new wu("neither boundable is composite")},Oh.prototype.isLeaves=function(){return!(Oh.isComposite(this._boundable1)||Oh.isComposite(this._boundable2))},Oh.prototype.compareTo=function(t){var e=t;return this._distancee._distance?1:0},Oh.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),s=new Oh(o,e,this._itemDistance);s.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},Sh={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Eh.prototype.getNodeCapacity=function(){return this._nodeCapacity},Eh.prototype.lastNode=function(t){return t.get(t.size()-1)},Eh.prototype.size=function(){var t=this;if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var e=arguments[0],n=0,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof bh?n+=t.size(i):i instanceof yh&&(n+=1)}return n}},Eh.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof yh&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)},Eh.prototype.itemsTree=function(){var t=this;if(0===arguments.length){this.build();var e=this.itemsTree(this._root);return null===e?new Lc:e}if(1===arguments.length){for(var n=arguments[0],r=new Lc,i=n.getChildBoundables().iterator();i.hasNext();){var o=i.next();if(o instanceof bh){var s=t.itemsTree(o);null!==s&&r.add(s)}else o instanceof yh?r.add(o.getItem()):oc.shouldNeverReachHere()}return r.size()<=0?null:r}},Eh.prototype.insert=function(t,e){oc.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new yh(t,e))},Eh.prototype.boundablesAtLevel=function(){var t=this;if(1===arguments.length){var e=arguments[0],n=new Lc;return this.boundablesAtLevel(e,this._root,n),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];if(oc.isTrue(r>-2),i.getLevel()===r)return o.add(i),null;for(var s=i.getChildBoundables().iterator();s.hasNext();){var a=s.next();a instanceof bh?t.boundablesAtLevel(r,a,o):(oc.isTrue(a instanceof yh),-1===r&&o.add(a))}return null}},Eh.prototype.query=function(){var t=this;if(1===arguments.length){var e=arguments[0];this.build();var n=new Lc;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,n),n}if(2===arguments.length){var r=arguments[0],i=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,i)}else if(3===arguments.length)if(Ru(arguments[2],mh)&&arguments[0]instanceof Object&&arguments[1]instanceof bh)for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getChildBoundables(),c=0;cn&&(n=o)}}return n+1}},Eh.prototype.createParentBoundables=function(t,e){var n=this;oc.isTrue(!t.isEmpty());var r=new Lc;r.add(this.createNode(e));var i=new Lc(t);xh.sort(i,this.getComparator());for(var o=i.iterator();o.hasNext();){var s=o.next();n.lastNode(r).getChildBoundables().size()===n.getNodeCapacity()&&r.add(n.createNode(e)),n.lastNode(r).addChildBoundable(s)}return r},Eh.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Eh.prototype.interfaces_=function(){return[Nu]},Eh.prototype.getClass=function(){return Eh},Eh.compareDoubles=function(t,e){return t>e?1:t0);for(var n=new Lc,r=0;r0;){var f=h.poll(),p=f.getDistance();if(p>=c)break;f.isLeaves()?(c=p,l=f):f.expandToQueue(h,c)}return[l.getBoundable(0).getItem(),l.getBoundable(1).getItem()]}}else if(3===arguments.length){var d=arguments[0],g=arguments[1],y=arguments[2],v=new yh(d,g),m=new Oh(this.getRoot(),v,y);return this.nearestNeighbour(m)[0]}},e.prototype.interfaces_=function(){return[_h,Nu]},e.prototype.getClass=function(){return e},e.centreX=function(t){return e.avg(t.getMinX(),t.getMaxX())},e.avg=function(t,e){return(t+e)/2},e.centreY=function(t){return e.avg(t.getMinY(),t.getMaxY())},n.STRtreeNode.get=function(){return Lh},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[Cu]},compare:function(n,r){return t.compareDoubles(e.centreX(n.getBounds()),e.centreX(r.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[Cu]},compare:function(n,r){return t.compareDoubles(e.centreY(n.getBounds()),e.centreY(r.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,n),e}(Eh),Lh=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new Zu(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(bh),Ih=function(){};Ih.prototype.interfaces_=function(){return[]},Ih.prototype.getClass=function(){return Ih},Ih.relativeSign=function(t,e){return te?1:0},Ih.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=Ih.relativeSign(e.x,n.x),i=Ih.relativeSign(e.y,n.y);switch(t){case 0:return Ih.compareValue(r,i);case 1:return Ih.compareValue(i,r);case 2:return Ih.compareValue(i,-r);case 3:return Ih.compareValue(-r,i);case 4:return Ih.compareValue(-r,-i);case 5:return Ih.compareValue(-i,-r);case 6:return Ih.compareValue(-i,r);case 7:return Ih.compareValue(r,-i)}return oc.shouldNeverReachHere("invalid octant value"),0},Ih.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var Ph=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString=t,this.coord=new Mu(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};Ph.prototype.getCoordinate=function(){return this.coord},Ph.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},Ph.prototype.compareTo=function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:Ih.compare(this._segmentOctant,this.coord,e.coord)},Ph.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},Ph.prototype.isInterior=function(){return this._isInterior},Ph.prototype.interfaces_=function(){return[Eu]},Ph.prototype.getClass=function(){return Ph};var jh=function(){this._nodeMap=new Xc,this._edge=null;var t=arguments[0];this._edge=t};jh.prototype.getSplitCoordinates=function(){var t=new Pc;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next();this.addEdgeCoordinates(n,r,t),n=r}return t.toCoordinateArray()},jh.prototype.addCollapsedNodes=function(){var t=new Lc;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this._edge.getCoordinate(n),n)}},jh.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},jh.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}if(arguments[0]instanceof Mu&&arguments[1]instanceof Mu){var i=arguments[0],o=arguments[1],s=o.x-i.x,a=o.y-i.y;if(0===s&&0===a)throw new wu("Cannot compute the octant for two identical points "+i);return Ah.octant(s,a)}};var Rh=function(){};Rh.prototype.getCoordinates=function(){},Rh.prototype.size=function(){},Rh.prototype.getCoordinate=function(t){},Rh.prototype.isClosed=function(){},Rh.prototype.setData=function(t){},Rh.prototype.getData=function(){},Rh.prototype.interfaces_=function(){return[]},Rh.prototype.getClass=function(){return Rh};var Th=function(){};Th.prototype.addIntersection=function(t,e){},Th.prototype.interfaces_=function(){return[Rh]},Th.prototype.getClass=function(){return Th};var Fh=function(){this._nodeList=new jh(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Fh.prototype.getCoordinates=function(){return this._pts},Fh.prototype.size=function(){return this._pts.length},Fh.prototype.getCoordinate=function(t){return this._pts[t]},Fh.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Fh.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},Fh.prototype.setData=function(t){this._data=t},Fh.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:Ah.octant(t,e)},Fh.prototype.getData=function(){return this._data},Fh.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[3],o=new Mu(n.getIntersection(i));this.addIntersection(o,r)}},Fh.prototype.toString=function(){return nc.toLineString(new Ll(this._pts))},Fh.prototype.getNodeList=function(){return this._nodeList},Fh.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof Mu){var r=arguments[0];return hc.orientationIndex(this.p0,this.p1,r)}},kh.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},kh.prototype.isVertical=function(){return this.p0.x===this.p1.x},kh.prototype.equals=function(t){if(!(t instanceof kh))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},kh.prototype.intersection=function(t){var e=new uc;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},kh.prototype.project=function(){if(arguments[0]instanceof Mu){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new Mu(t);var e=this.projectionFactor(t),n=new Mu;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof kh){var r=arguments[0],i=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(i>=1&&o>=1)return null;if(i<=0&&o<=0)return null;var s=this.project(r.p0);i<0&&(s=this.p0),i>1&&(s=this.p1);var a=this.project(r.p1);return o<0&&(a=this.p0),o>1&&(a=this.p1),new kh(s,a)}},kh.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},kh.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},kh.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},kh.prototype.distancePerpendicular=function(t){return hc.distancePointLinePerpendicular(t,this.p0,this.p1)},kh.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},kh.prototype.midPoint=function(){return kh.midPoint(this.p0,this.p1)},kh.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;return r<=0?xu.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},kh.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=xu.MAX_VALUE,i=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var s=this.closestPoint(t.p1);(i=s.distance(t.p1))0&&e<1?this.project(t):this.p0.distance(t)1||xu.isNaN(e))&&(e=1),e},kh.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},kh.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},kh.prototype.distance=function(){if(arguments[0]instanceof kh){var t=arguments[0];return hc.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof Mu){var e=arguments[0];return hc.distancePointLine(e,this.p0,this.p1)}},kh.prototype.pointAlong=function(t){var e=new Mu;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},kh.prototype.hashCode=function(){var t=xu.doubleToLongBits(this.p0.x);t^=31*xu.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=xu.doubleToLongBits(this.p1.x);return n^=31*xu.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},kh.prototype.interfaces_=function(){return[Eu,Nu]},kh.prototype.getClass=function(){return kh},kh.midPoint=function(t,e){return new Mu((t.x+e.x)/2,(t.y+e.y)/2)},Dh.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(kh,Dh);var Bh=function(){this.tempEnv1=new Zu,this.tempEnv2=new Zu,this._overlapSeg1=new kh,this._overlapSeg2=new kh};Bh.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},Bh.prototype.interfaces_=function(){return[]},Bh.prototype.getClass=function(){return Bh};var Gh=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};Gh.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},Gh.prototype.computeSelect=function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(i,o),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var s=Math.trunc((e+n)/2);e=t.length-1)return t.length-1;for(var r=uh.quadrant(t[n],t[n+1]),i=e+1;ir.getId()&&(r.computeOverlaps(o,e),t._nOverlaps++),t._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return Yh},Object.defineProperties(e,n),e}(Uh),Yh=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3],o=e.getContext(),s=r.getContext();this._si.processIntersections(o,n,s,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Bh),Wh=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}},Xh={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Wh.prototype.getEndCapStyle=function(){return this._endCapStyle},Wh.prototype.isSingleSided=function(){return this._isSingleSided},Wh.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=Wh.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Wh.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Wh.JOIN_ROUND&&(this._quadrantSegments=Wh.DEFAULT_QUADRANT_SEGMENTS)},Wh.prototype.getJoinStyle=function(){return this._joinStyle},Wh.prototype.setJoinStyle=function(t){this._joinStyle=t},Wh.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Wh.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Wh.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Wh.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Wh.prototype.getMitreLimit=function(){return this._mitreLimit},Wh.prototype.setMitreLimit=function(t){this._mitreLimit=t},Wh.prototype.setSingleSided=function(t){this._isSingleSided=t},Wh.prototype.interfaces_=function(){return[]},Wh.prototype.getClass=function(){return Wh},Wh.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Xh.CAP_ROUND.get=function(){return 1},Xh.CAP_FLAT.get=function(){return 2},Xh.CAP_SQUARE.get=function(){return 3},Xh.JOIN_ROUND.get=function(){return 1},Xh.JOIN_MITRE.get=function(){return 2},Xh.JOIN_BEVEL.get=function(){return 3},Xh.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Xh.DEFAULT_MITRE_LIMIT.get=function(){return 5},Xh.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(Wh,Xh);var Hh=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=hc.COUNTERCLOCKWISE,this._inputLine=t||null},Kh={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Hh.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!!this.isConcave(i,o,s)&&!!this.isShallow(i,o,s,r)&&this.isShallowSampled(i,o,t,n,r)},Hh.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,n=this.findNextNonDeletedIndex(e),r=this.findNextNonDeletedIndex(n),i=!1;r=0;r--)this.addPt(t[r])},Zh.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)Math.PI;)t-=$h.PI_TIMES_2;for(;t<=-Math.PI;)t+=$h.PI_TIMES_2;return t},$h.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}},$h.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)>0},$h.isObtuse=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)<0},$h.interiorAngle=function(t,e,n){var r=$h.angle(e,t),i=$h.angle(e,n);return Math.abs(i-r)},$h.normalizePositive=function(t){if(t<0){for(;t<0;)t+=$h.PI_TIMES_2;t>=$h.PI_TIMES_2&&(t=0)}else{for(;t>=$h.PI_TIMES_2;)t-=$h.PI_TIMES_2;t<0&&(t=0)}return t},$h.angleBetween=function(t,e,n){var r=$h.angle(e,t),i=$h.angle(e,n);return $h.diff(r,i)},$h.diff=function(t,e){var n=null;return(n=tMath.PI&&(n=2*Math.PI-n),n},$h.toRadians=function(t){return t*Math.PI/180},$h.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?$h.COUNTERCLOCKWISE:n<0?$h.CLOCKWISE:$h.NONE},$h.angleBetweenOriented=function(t,e,n){var r=$h.angle(e,t),i=$h.angle(e,n)-r;return i<=-Math.PI?i+$h.PI_TIMES_2:i>Math.PI?i-$h.PI_TIMES_2:i},Qh.PI_TIMES_2.get=function(){return 2*Math.PI},Qh.PI_OVER_2.get=function(){return Math.PI/2},Qh.PI_OVER_4.get=function(){return Math.PI/4},Qh.COUNTERCLOCKWISE.get=function(){return hc.COUNTERCLOCKWISE},Qh.CLOCKWISE.get=function(){return hc.CLOCKWISE},Qh.NONE.get=function(){return hc.COLLINEAR},Object.defineProperties($h,Qh);var tf=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new kh,this._seg1=new kh,this._offset0=new kh,this._offset1=new kh,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new uc,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===Wh.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},ef={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};tf.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=hc.computeOrientation(this._s0,this._s1,this._s2),r=n===hc.CLOCKWISE&&this._side===Wl.LEFT||n===hc.COUNTERCLOCKWISE&&this._side===Wl.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},tf.prototype.addLineEndCap=function(t,e){var n=new kh(t,e),r=new kh;this.computeOffsetSegment(n,Wl.LEFT,this._distance,r);var i=new kh;this.computeOffsetSegment(n,Wl.RIGHT,this._distance,i);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case Wh.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,hc.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case Wh.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case Wh.CAP_SQUARE:var u=new Mu;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var c=new Mu(r.p1.x+u.x,r.p1.y+u.y),l=new Mu(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(c),this._segList.addPt(l)}},tf.prototype.getCoordinates=function(){return this._segList.getCoordinates()},tf.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=Ku.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:o.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof Xu))throw t;o=new Mu(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},tf.prototype.addFilletCorner=function(t,e,n,r,i){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),u=n.x-t.x,c=n.y-t.y,l=Math.atan2(c,u);r===hc.CLOCKWISE?a<=l&&(a+=2*Math.PI):a>=l&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,l,r,i),this._segList.addPt(n)},tf.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)0){var n=new Mu((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var r=new Mu((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},tf.prototype.createCircle=function(t){var e=new Mu(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},tf.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},tf.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Zh,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*tf.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},tf.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Wh.JOIN_BEVEL||this._bufParams.getJoinStyle()===Wh.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,hc.CLOCKWISE,this._distance))},tf.prototype.closeRing=function(){this._segList.closeRing()},tf.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},tf.prototype.interfaces_=function(){return[]},tf.prototype.getClass=function(){return tf},ef.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},ef.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},ef.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},ef.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(tf,ef);var nf=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};nf.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,n,i);var o=i.getCoordinates();return n&&jc.reverse(o),o},nf.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Hh.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Wl.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{n.addSegments(t,!1);var a=Hh.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Wl.LEFT),n.addFirstSegment();for(var c=2;c<=u;c++)n.addNextSegment(a[c],!0)}n.addLastSegment(),n.closeRing()},nf.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Wl.RIGHT&&(r=-r);var i=Hh.simplify(t,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],e);for(var s=1;s<=o;s++){var a=1!==s;n.addNextSegment(i[s],a)}n.closeRing()},nf.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=Hh.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Wl.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var s=Hh.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],Wl.LEFT);for(var u=a-2;u>=0;u--)e.addNextSegment(s[u],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},nf.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Wh.CAP_ROUND:e.createCircle(t);break;case Wh.CAP_SQUARE:e.createSquare(t)}},nf.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()},nf.prototype.getBufferParameters=function(){return this._bufParams},nf.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},nf.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return nf.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},nf.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=Hh.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Wl.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{var a=Hh.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Wl.LEFT),n.addFirstSegment();for(var c=2;c<=u;c++)n.addNextSegment(a[c],!0)}n.addLastSegment()},nf.prototype.getSegGen=function(t){return new tf(this._precisionModel,this._bufParams,t)},nf.prototype.interfaces_=function(){return[]},nf.prototype.getClass=function(){return nf},nf.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;no.getMaxY()||t.findStabbedSegments(e,i.getDirectedEdges(),n)}return n}if(3===arguments.length)if(Ru(arguments[2],Nc)&&arguments[0]instanceof Mu&&arguments[1]instanceof hh)for(var s=arguments[0],a=arguments[1],u=arguments[2],c=a.getEdge().getCoordinates(),l=0;lt._seg.p1.y&&t._seg.reverse();var h=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(ht._seg.p1.y||hc.computeOrientation(t._seg.p0,t._seg.p1,s)===hc.RIGHT)){var f=a.getDepth(Wl.LEFT);t._seg.p0.equals(c[l])||(f=a.getDepth(Wl.RIGHT));var p=new sf(t._seg,f);u.add(p)}}else if(Ru(arguments[2],Nc)&&arguments[0]instanceof Mu&&Ru(arguments[1],Nc))for(var d=arguments[0],g=arguments[1],y=arguments[2],v=g.iterator();v.hasNext();){var m=v.next();m.isForward()&&t.findStabbedSegments(d,m,y)}},rf.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:xh.min(e)._leftDepth},rf.prototype.interfaces_=function(){return[]},rf.prototype.getClass=function(){return rf},of.DepthSegment.get=function(){return sf},Object.defineProperties(rf,of);var sf=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new kh(t),this._leftDepth=e};sf.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==n||0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},sf.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},sf.prototype.toString=function(){return this._upwardSeg.toString()},sf.prototype.interfaces_=function(){return[Eu]},sf.prototype.getClass=function(){return sf};var af=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};af.prototype.area=function(){return af.area(this.p0,this.p1,this.p2)},af.prototype.signedArea=function(){return af.signedArea(this.p0,this.p1,this.p2)},af.prototype.interpolateZ=function(t){if(null===t)throw new wu("Supplied point is null.");return af.interpolateZ(t,this.p0,this.p1,this.p2)},af.prototype.longestSideLength=function(){return af.longestSideLength(this.p0,this.p1,this.p2)},af.prototype.isAcute=function(){return af.isAcute(this.p0,this.p1,this.p2)},af.prototype.circumcentre=function(){return af.circumcentre(this.p0,this.p1,this.p2)},af.prototype.area3D=function(){return af.area3D(this.p0,this.p1,this.p2)},af.prototype.centroid=function(){return af.centroid(this.p0,this.p1,this.p2)},af.prototype.inCentre=function(){return af.inCentre(this.p0,this.p1,this.p2)},af.prototype.interfaces_=function(){return[]},af.prototype.getClass=function(){return af},af.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},af.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},af.det=function(t,e,n,r){return t*r-e*n},af.interpolateZ=function(t,e,n,r){var i=e.x,o=e.y,s=n.x-i,a=r.x-i,u=n.y-o,c=r.y-o,l=s*c-a*u,h=t.x-i,f=t.y-o,p=(c*h-a*f)/l,d=(-u*h+s*f)/l;return e.z+p*(n.z-e.z)+d*(r.z-e.z)},af.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),s=r;return i>s&&(s=i),o>s&&(s=o),s},af.isAcute=function(t,e,n){return!!$h.isAcute(t,e,n)&&!!$h.isAcute(e,n,t)&&!!$h.isAcute(n,t,e)},af.circumcentre=function(t,e,n){var r=n.x,i=n.y,o=t.x-r,s=t.y-i,a=e.x-r,u=e.y-i,c=2*af.det(o,s,a,u),l=af.det(s,o*o+s*s,u,a*a+u*u),h=af.det(o,o*o+s*s,a,a*a+u*u);return new Mu(r-l/c,i+h/c)},af.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new Ku(t.x+n/2,t.y+r/2,1),o=new Ku(t.x-r+n/2,t.y+n+r/2,1);return new Ku(i,o)},af.angleBisector=function(t,e,n){var r=e.distance(t),i=r/(r+e.distance(n)),o=n.x-t.x,s=n.y-t.y;return new Mu(t.x+i*o,t.y+i*s)},af.area3D=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.z-t.z,s=n.x-t.x,a=n.y-t.y,u=n.z-t.z,c=i*u-o*a,l=o*s-r*u,h=r*a-i*s,f=c*c+l*l+h*h;return Math.sqrt(f)/2},af.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new Mu(r,i)},af.inCentre=function(t,e,n){var r=e.distance(n),i=t.distance(n),o=t.distance(e),s=r+i+o,a=(r*t.x+i*e.x+o*n.x)/s,u=(r*t.y+i*e.y+o*n.y)/s;return new Mu(a,u)};var uf=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Lc;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};uf.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,ju.EXTERIOR,ju.INTERIOR)},uf.prototype.addPolygon=function(t){var e=this,n=this._distance,r=Wl.LEFT;this._distance<0&&(n=-this._distance,r=Wl.RIGHT);var i=t.getExteriorRing(),o=jc.removeRepeatedPoints(i.getCoordinates());if(this._distance<0&&this.isErodedCompletely(i,this._distance))return null;if(this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,n,r,ju.EXTERIOR,ju.INTERIOR);for(var s=0;s0&&e.isErodedCompletely(a,-e._distance)||e.addPolygonRing(u,n,Wl.opposite(r),ju.INTERIOR,ju.EXTERIOR)}},uf.prototype.isTriangleErodedCompletely=function(t,e){var n=new af(t[0],t[1],t[2]),r=n.inCentre();return hc.distancePointLine(r,n.p0,n.p1)=xl.MINIMUM_VALID_SIZE&&hc.isCCW(t)&&(o=i,s=r,n=Wl.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},uf.prototype.add=function(t){if(t.isEmpty())return null;t instanceof bl?this.addPolygon(t):t instanceof yl?this.addLineString(t):t instanceof ml?this.addPoint(t):(t instanceof wl||t instanceof il||t instanceof Ol||t instanceof rl)&&this.addCollection(t)},uf.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i},uf.prototype.addCollection=function(t){for(var e=0;e=this._max)throw new Mc;var t=this._parent.getGeometryN(this._index++);return t instanceof rl?(this._subcollectionIterator=new lf(t),this._subcollectionIterator.next()):t},lf.prototype.remove=function(){throw new Error(this.getClass().getName())},lf.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},lf.prototype.interfaces_=function(){return[Cc]},lf.prototype.getClass=function(){return lf},lf.isAtomic=function(t){return!(t instanceof rl)};var hf=function(){this._geom=null;var t=arguments[0];this._geom=t};hf.prototype.locate=function(t){return hf.locate(t,this._geom)},hf.prototype.interfaces_=function(){return[cf]},hf.prototype.getClass=function(){return hf},hf.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&hc.isPointInRing(t,e.getCoordinates())},hf.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!hf.isPointInRing(t,n))return!1;for(var r=0;r=0;n--){var r=this._edgeList.get(n),i=r.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=r}e.setNext(t)},e.prototype.computeDepths=function(){var t=this;if(1===arguments.length){var e=arguments[0],n=this.findIndex(e),r=e.getDepth(Wl.LEFT),i=e.getDepth(Wl.RIGHT),o=this.computeDepths(n+1,this._edgeList.size(),r),s=this.computeDepths(0,n,o);if(s!==i)throw new Jl("depth mismatch at "+e.getCoordinate())}else if(3===arguments.length){for(var a=arguments[0],u=arguments[1],c=arguments[2],l=c,h=a;h=0;o--){var s=e._resultAreaEdgeList.get(o),a=s.getSym();switch(null===n&&s.getEdgeRing()===t&&(n=s),i){case e._SCANNING_FOR_INCOMING:if(a.getEdgeRing()!==t)continue;r=a,i=e._LINKING_TO_OUTGOING;break;case e._LINKING_TO_OUTGOING:if(s.getEdgeRing()!==t)continue;r.setNextMin(s),i=e._SCANNING_FOR_INCOMING}}i===this._LINKING_TO_OUTGOING&&(oc.isTrue(null!==n,"found null for first outgoing dirEdge"),oc.isTrue(n.getEdgeRing()===t,"unable to link last incoming dirEdge"),r.setNextMin(n))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();){var n=e.next();n.isInResult()&&t++}return t}if(1===arguments.length){for(var r=arguments[0],i=0,o=this.iterator();o.hasNext();){var s=o.next();s.getEdgeRing()===r&&i++}return i}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=ju.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=ju.INTERIOR;break}if(r.isInResult()){t=ju.EXTERIOR;break}}}if(t===ju.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getSym();s.isLineEdge()?s.getEdge().setCovered(i===ju.INTERIOR):(s.isInResult()&&(i=ju.EXTERIOR),a.isInResult()&&(i=ju.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new eh(ju.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),i=0;i<2;i++){var o=r.getLocation(i);o!==ju.INTERIOR&&o!==ju.BOUNDARY||this._label.setLocation(i,ju.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ff),df=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new sh(t,new pf)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(fh),gf=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};gf.prototype.compareTo=function(t){var e=t;return gf.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},gf.prototype.interfaces_=function(){return[Eu]},gf.prototype.getClass=function(){return gf},gf.orientation=function(t){return 1===jc.increasingDirection(t)},gf.compareOriented=function(t,e,n,r){for(var i=e?1:-1,o=r?1:-1,s=e?t.length:-1,a=r?n.length:-1,u=e?0:t.length-1,c=r?0:n.length-1;;){var l=t[u].compareTo(n[c]);if(0!==l)return l;var h=(u+=i)===s,f=(c+=o)===a;if(h&&!f)return-1;if(!h&&f)return 1;if(h&&f)return 0}};var yf=function(){this._edges=new Lc,this._ocaMap=new Xc};yf.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")},yf.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},yf.prototype.findEdgeIndex=function(t){for(var e=0;e0||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new Mu(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return i&&(o[s]=e.coord),new Sf(o,new eh(this.edge._label))},bf.prototype.add=function(t,e,n){var r=new _f(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},bf.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},bf.prototype.interfaces_=function(){return[]},bf.prototype.getClass=function(){return bf};var wf=function(){};wf.prototype.getChainStartIndices=function(t){var e=0,n=new Lc;n.add(new Du(e));do{var r=this.findChainEnd(t,e);n.add(new Du(r)),e=r}while(en?e:n},xf.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return en&&(i=1),t._depth[e][r]=i}}},Of.prototype.getDelta=function(t){return this._depth[t][Wl.RIGHT]-this._depth[t][Wl.LEFT]},Of.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?ju.EXTERIOR:ju.INTERIOR},Of.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Of.prototype.add=function(){var t=this;if(1===arguments.length)for(var e=arguments[0],n=0;n<2;n++)for(var r=1;r<3;r++){var i=e.getLocation(n,r);i!==ju.EXTERIOR&&i!==ju.INTERIOR||(t.isNull(n,r)?t._depth[n][r]=Of.depthAtLocation(i):t._depth[n][r]+=Of.depthAtLocation(i))}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];a===ju.INTERIOR&&this._depth[o][s]++}},Of.prototype.interfaces_=function(){return[]},Of.prototype.getClass=function(){return Of},Of.depthAtLocation=function(t){return t===ju.EXTERIOR?0:t===ju.INTERIOR?1:Of.NULL_VALUE},Ef.NULL_VALUE.get=function(){return-1},Object.defineProperties(Of,Ef);var Sf=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new bf(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Of,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,eh.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var r=!0,i=!0,o=this.pts.length,s=0;s0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new xf(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new Zu;for(var t=0;t0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;er||this._maxyo;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return oc.isTrue(!(s&&a),"Found bad envelope test"),a},If.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new Mu(this._maxx,this._maxy),this._corner[1]=new Mu(this._minx,this._maxy),this._corner[2]=new Mu(this._minx,this._miny),this._corner[3]=new Mu(this._maxx,this._miny)},If.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},If.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},If.prototype.getCoordinate=function(){return this._originalPt},If.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},If.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=If.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Zu(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},If.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))))},If.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||n&&r||t.equals(this._pt)||e.equals(this._pt)))))},If.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)},If.prototype.interfaces_=function(){return[]},If.prototype.getClass=function(){return If},Pf.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(If,Pf);var jf=function(){this.tempEnv1=new Zu,this.selectedSegment=new kh};jf.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}},jf.prototype.interfaces_=function(){return[]},jf.prototype.getClass=function(){return jf};var Af=function(){this._index=null;var t=arguments[0];this._index=t},Rf={HotPixelSnapAction:{configurable:!0}};Af.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),o=new Tf(e,n,r);return this._index.query(i,{interfaces_:function(){return[mh]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},Af.prototype.interfaces_=function(){return[]},Af.prototype.getClass=function(){return Af},Rf.HotPixelSnapAction.get=function(){return Tf},Object.defineProperties(Af,Rf);var Tf=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[0],n=arguments[1],r=e.getContext();if(null!==this._parentEdge&&r===this._parentEdge&&n===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(r,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(jf),Ff=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new Lc};Ff.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Jl))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=Df.precisionScaleFactor(this._argGeom,this._distance,n),i=new Rl(r);this.bufferFixedPrecision(i)}},Df.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Rl.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},Df.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},Df.prototype.bufferOriginalPrecision=function(){try{var t=new Cf(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof rc))throw t;this._saveException=t}},Df.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},Df.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},Df.prototype.interfaces_=function(){return[]},Df.prototype.getClass=function(){return Df},Df.bufferOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new Df(t),r=n.getResultGeometry(e);return r}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof dc&&"number"==typeof arguments[1]){var i=arguments[0],o=arguments[1],s=arguments[2],a=new Df(i);a.setQuadrantSegments(s);var u=a.getResultGeometry(o);return u}if(arguments[2]instanceof Wh&&arguments[0]instanceof dc&&"number"==typeof arguments[1]){var c=arguments[0],l=arguments[1],h=arguments[2],f=new Df(c,h),p=f.getResultGeometry(l);return p}}else if(4===arguments.length){var d=arguments[0],g=arguments[1],y=arguments[2],v=arguments[3],m=new Df(d);m.setQuadrantSegments(y),m.setEndCapStyle(v);var _=m.getResultGeometry(g);return _}},Df.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=Tu.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},Bf.CAP_ROUND.get=function(){return Wh.CAP_ROUND},Bf.CAP_BUTT.get=function(){return Wh.CAP_FLAT},Bf.CAP_FLAT.get=function(){return Wh.CAP_FLAT},Bf.CAP_SQUARE.get=function(){return Wh.CAP_SQUARE},Bf.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Df,Bf);var Gf=function(){this._pt=[new Mu,new Mu],this._distance=xu.NaN,this._isNull=!0};Gf.prototype.getCoordinates=function(){return this._pt},Gf.prototype.getCoordinate=function(t){return this._pt[t]},Gf.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);rthis._distance&&this.initialize(e,n,r)}},Gf.prototype.interfaces_=function(){return[]},Gf.prototype.getClass=function(){return Gf};var qf=function(){};qf.prototype.interfaces_=function(){return[]},qf.prototype.getClass=function(){return qf},qf.computeDistance=function(){if(arguments[2]instanceof Gf&&arguments[0]instanceof yl&&arguments[1]instanceof Mu)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=t.getCoordinates(),i=new kh,o=0;o0||this._isIn?ju.INTERIOR:ju.EXTERIOR)},Hf.prototype.interfaces_=function(){return[]},Hf.prototype.getClass=function(){return Hf};var Kf=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length){var e=arguments[0],n=arguments[1];t.call(this,e,t.INSIDE_AREA,n)}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._component=r,this._segIndex=i,this._pt=o}},Zf={INSIDE_AREA:{configurable:!0}};Kf.prototype.isInsideArea=function(){return this._segIndex===Kf.INSIDE_AREA},Kf.prototype.getCoordinate=function(){return this._pt},Kf.prototype.getGeometryComponent=function(){return this._component},Kf.prototype.getSegmentIndex=function(){return this._segIndex},Kf.prototype.interfaces_=function(){return[]},Kf.prototype.getClass=function(){return Kf},Zf.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Kf,Zf);var Jf=function(t){this._pts=t||null};Jf.prototype.filter=function(t){t instanceof ml&&this._pts.add(t)},Jf.prototype.interfaces_=function(){return[el]},Jf.prototype.getClass=function(){return Jf},Jf.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof ml?xh.singletonList(t):Jf.getPoints(t,new Lc)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof ml?n.add(e):e instanceof rl&&e.apply(new Jf(n)),n}};var $f=function(){this._locations=null;var t=arguments[0];this._locations=t};$f.prototype.filter=function(t){(t instanceof ml||t instanceof yl||t instanceof bl)&&this._locations.add(new Kf(t,0,t.getCoordinate()))},$f.prototype.interfaces_=function(){return[el]},$f.prototype.getClass=function(){return $f},$f.getLocations=function(t){var e=new Lc;return t.apply(new $f(e)),e};var Qf=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Hf,this._minDistanceLocation=null,this._minDistance=xu.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}};Qf.prototype.computeContainmentDistance=function(){var t=this;if(0===arguments.length){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=1-n,o=Wf.getPolygons(this._geom[n]);if(o.size()>0){var s=$f.getLocations(this._geom[i]);if(this.computeContainmentDistance(s,o,r),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[i]=r[0],this._minDistanceLocation[n]=r[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&Ru(arguments[0],Nc)&&Ru(arguments[1],Nc)){for(var a=arguments[0],u=arguments[1],c=arguments[2],l=0;lthis._minDistance)return null;for(var i=e.getCoordinates(),o=n.getCoordinate(),s=0;sthis._minDistance)return null;for(var p=l.getCoordinates(),d=h.getCoordinates(),g=0;gthis._distance&&this.initialize(e,n,r)}},tp.prototype.interfaces_=function(){return[]},tp.prototype.getClass=function(){return tp};var ep=function(){};ep.prototype.interfaces_=function(){return[]},ep.prototype.getClass=function(){return ep},ep.computeDistance=function(){if(arguments[2]instanceof tp&&arguments[0]instanceof yl&&arguments[1]instanceof Mu)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new kh,i=t.getCoordinates(),o=0;o1||t<=0)throw new wu("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},np.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},np.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},np.prototype.computeOrientedDistance=function(t,e,n){var r=new ip(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new op(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},np.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},np.prototype.interfaces_=function(){return[]},np.prototype.getClass=function(){return np},np.distance=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new np(t,e);return n.distance()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=new np(r,i);return s.setDensifyFraction(o),s.distance()}},rp.MaxPointDistanceFilter.get=function(){return ip},rp.MaxDensifiedByFractionDistanceFilter.get=function(){return op},Object.defineProperties(np,rp);var ip=function(){this._maxPtDist=new tp,this._minPtDist=new tp,this._euclideanDist=new ep,this._geom=null;var t=arguments[0];this._geom=t};ip.prototype.filter=function(t){this._minPtDist.initialize(),ep.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ip.prototype.getMaxPointDistance=function(){return this._maxPtDist},ip.prototype.interfaces_=function(){return[vc]},ip.prototype.getClass=function(){return ip};var op=function(){this._maxPtDist=new tp,this._minPtDist=new tp,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};op.prototype.filter=function(t,e){var n=this;if(0===e)return null;for(var r=t.getCoordinate(e-1),i=t.getCoordinate(e),o=(i.x-r.x)/this._numSubSegs,s=(i.y-r.y)/this._numSubSegs,a=0;an){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+nc.toLineString(i[0],i[1])+")"}},sp.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=sp.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),sp.VERBOSE&&Hu.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},sp.prototype.checkNegativeValid=function(){if(!(this._input instanceof bl||this._input instanceof Ol||this._input instanceof rl))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},sp.prototype.getErrorIndicator=function(){return this._errorIndicator},sp.prototype.checkMinimumDistance=function(t,e,n){var r=new Qf(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},up.prototype.report=function(t){if(!up.VERBOSE)return null;Hu.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},up.prototype.getErrorMessage=function(){return this._errorMsg},up.prototype.interfaces_=function(){return[]},up.prototype.getClass=function(){return up},up.isValidMsg=function(t,e,n){var r=new up(t,e,n);return r.isValid()?null:r.getErrorMessage()},up.isValid=function(t,e,n){return!!new up(t,e,n).isValid()},cp.VERBOSE.get=function(){return!1},cp.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(up,cp);var lp=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};lp.prototype.getCoordinates=function(){return this._pts},lp.prototype.size=function(){return this._pts.length},lp.prototype.getCoordinate=function(t){return this._pts[t]},lp.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},lp.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:Ah.octant(this.getCoordinate(t),this.getCoordinate(t+1))},lp.prototype.setData=function(t){this._data=t},lp.prototype.getData=function(){return this._data},lp.prototype.toString=function(){return nc.toLineString(new Ll(this._pts))},lp.prototype.interfaces_=function(){return[Rh]},lp.prototype.getClass=function(){return lp};var hp=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Lc,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};hp.prototype.getInteriorIntersection=function(){return this._interiorIntersection},hp.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},hp.prototype.getIntersectionSegments=function(){return this._intSegments},hp.prototype.count=function(){return this._intersectionCount},hp.prototype.getIntersections=function(){return this._intersections},hp.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},hp.prototype.setKeepIntersections=function(t){this._keepIntersections=t},hp.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,r))return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=s,this._intSegments[3]=a,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},hp.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},hp.prototype.hasIntersection=function(){return null!==this._interiorIntersection},hp.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},hp.prototype.interfaces_=function(){return[vf]},hp.prototype.getClass=function(){return hp},hp.createAllIntersectionsFinder=function(t){var e=new hp(t);return e.setFindAllIntersections(!0),e},hp.createAnyIntersectionFinder=function(t){return new hp(t)},hp.createIntersectionCounter=function(t){var e=new hp(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var fp=function(){this._li=new uc,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};fp.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},fp.prototype.getIntersections=function(){return this._segInt.getIntersections()},fp.prototype.isValid=function(){return this.execute(),this._isValid},fp.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},fp.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new hp(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new Vh;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},fp.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Jl(this.getErrorMessage(),this._segInt.getInteriorIntersection())},fp.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+nc.toLineString(t[0],t[1])+" and "+nc.toLineString(t[2],t[3])},fp.prototype.interfaces_=function(){return[]},fp.prototype.getClass=function(){return fp},fp.computeIntersections=function(t){var e=new fp(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var pp=function t(){this._nv=null;var e=arguments[0];this._nv=new fp(t.toSegmentStrings(e))};pp.prototype.checkValid=function(){this._nv.checkValid()},pp.prototype.interfaces_=function(){return[]},pp.prototype.getClass=function(){return pp},pp.toSegmentStrings=function(t){for(var e=new Lc,n=t.iterator();n.hasNext();){var r=n.next();e.add(new lp(r.getCoordinates(),r))}return e},pp.checkValid=function(t){new pp(t).checkValid()};var dp=function(t){this._mapOp=t};dp.prototype.map=function(t){for(var e=new Lc,n=0;n0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},vp.prototype.interfaces_=function(){return[]},vp.prototype.getClass=function(){return vp};var mp=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new kh,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof yl&&"number"==typeof arguments[1]){var e=arguments[0],n=arguments[1];t.call(this,e.getCoordinates(),n)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=t.isClosed(r),this._snapTolerance=i}};mp.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r=0&&t.add(o+1,new Mu(i),!1)}},mp.prototype.findSegmentIndexToSnap=function(t,e){for(var n=this,r=xu.MAX_VALUE,i=-1,o=0;oe&&(e=r)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(_p.computeOverlaySnapTolerance(i),_p.computeOverlaySnapTolerance(o))}},_p.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*_p.SNAP_PRECISION_FACTOR},_p.snapToSelf=function(t,e,n){return new _p(t).snapToSelf(e,n)},bp.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(_p,bp);var wp=function(t){function e(e,n,r){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new mp(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(vp),xp=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};xp.prototype.getCommon=function(){return xu.longBitsToDouble(this._commonBits)},xp.prototype.add=function(t){var e=xu.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=xp.signExpBits(this._commonBits),this._isFirst=!1,null):xp.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=xp.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=xp.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},xp.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=xu.longBitsToDouble(t),n=xu.toBinaryString(t),r="0000000000000000000000000000000000000000000000000000000000000000"+n,i=r.substring(r.length-64),o=i.substring(0,1)+" "+i.substring(1,12)+"(exp) "+i.substring(12)+" [ "+e+" ]";return o}},xp.prototype.interfaces_=function(){return[]},xp.prototype.getClass=function(){return xp},xp.getBit=function(t,e){return 0!=(t&1<>52},xp.zeroLowerBits=function(t,e){return t&~((1<=0;r--){if(xp.getBit(t,r)!==xp.getBit(e,r))return n;n++}return 52};var Op=function(){this._commonCoord=null,this._ccFilter=new Sp},Ep={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Op.prototype.addCommonBits=function(t){var e=new Cp(this._commonCoord);t.apply(e),t.geometryChanged()},Op.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new Mu(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new Cp(e);return t.apply(n),t.geometryChanged(),t},Op.prototype.getCommonCoordinate=function(){return this._commonCoord},Op.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},Op.prototype.interfaces_=function(){return[]},Op.prototype.getClass=function(){return Op},Ep.CommonCoordinateFilter.get=function(){return Sp},Ep.Translater.get=function(){return Cp},Object.defineProperties(Op,Ep);var Sp=function(){this._commonBitsX=new xp,this._commonBitsY=new xp};Sp.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},Sp.prototype.getCommonCoordinate=function(){return new Mu(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Sp.prototype.interfaces_=function(){return[vc]},Sp.prototype.getClass=function(){return Sp};var Cp=function(){this.trans=null;var t=arguments[0];this.trans=t};Cp.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)},Cp.prototype.isDone=function(){return!1},Cp.prototype.isGeometryChanged=function(){return!0},Cp.prototype.interfaces_=function(){return[nl]},Cp.prototype.getClass=function(){return Cp};var Np=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};Np.prototype.selfSnap=function(t){return new _p(t).snapTo(t,this._snapTolerance)},Np.prototype.removeCommonBits=function(t){this._cbr=new Op,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},Np.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},Np.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Kp.overlayOp(e[0],e[1],t);return this.prepareResult(n)},Np.prototype.checkValid=function(t){t.isValid()||Hu.out.println("Snapped geometry is invalid")},Np.prototype.computeSnapTolerance=function(){this._snapTolerance=_p.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Np.prototype.snap=function(t){var e=this.removeCommonBits(t);return _p.snap(e[0],e[1],this._snapTolerance)},Np.prototype.interfaces_=function(){return[]},Np.prototype.getClass=function(){return Np},Np.overlayOp=function(t,e,n){return new Np(t,e).getResultGeometry(n)},Np.union=function(t,e){return Np.overlayOp(t,e,Kp.UNION)},Np.intersection=function(t,e){return Np.overlayOp(t,e,Kp.INTERSECTION)},Np.symDifference=function(t,e){return Np.overlayOp(t,e,Kp.SYMDIFFERENCE)},Np.difference=function(t,e){return Np.overlayOp(t,e,Kp.DIFFERENCE)};var Mp=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};Mp.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=Kp.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof rc))throw t;r=t}if(!n)try{e=Np.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof rc?r:t}return e},Mp.prototype.interfaces_=function(){return[]},Mp.prototype.getClass=function(){return Mp},Mp.overlayOp=function(t,e,n){return new Mp(t,e).getResultGeometry(n)},Mp.union=function(t,e){return Mp.overlayOp(t,e,Kp.UNION)},Mp.intersection=function(t,e){return Mp.overlayOp(t,e,Kp.INTERSECTION)},Mp.symDifference=function(t,e){return Mp.overlayOp(t,e,Kp.SYMDIFFERENCE)},Mp.difference=function(t,e){return Mp.overlayOp(t,e,Kp.DIFFERENCE)};var Lp=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Lp.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Lp.prototype.interfaces_=function(){return[]},Lp.prototype.getClass=function(){return Lp};var Ip=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}},Pp={INSERT:{configurable:!0},DELETE:{configurable:!0}};Ip.prototype.isDelete=function(){return this._eventType===Ip.DELETE},Ip.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},Ip.prototype.getObject=function(){return this._obj},Ip.prototype.compareTo=function(t){var e=t;return this._xValuee._xValue?1:this._eventTypee._eventType?1:0},Ip.prototype.getInsertEvent=function(){return this._insertEvent},Ip.prototype.isInsert=function(){return this._eventType===Ip.INSERT},Ip.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},Ip.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Ip.prototype.interfaces_=function(){return[Eu]},Ip.prototype.getClass=function(){return Ip},Pp.INSERT.get=function(){return 1},Pp.DELETE.get=function(){return 2},Object.defineProperties(Ip,Pp);var jp=function(){};jp.prototype.interfaces_=function(){return[]},jp.prototype.getClass=function(){return jp};var Ap=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};Ap.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Ap.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},Ap.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Ap.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Ap.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Ap.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},Ap.prototype.hasProperIntersection=function(){return this._hasProper},Ap.prototype.hasIntersection=function(){return this._hasIntersection},Ap.prototype.isDone=function(){return this._isDone},Ap.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},Ap.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Ap.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Ap.prototype.interfaces_=function(){return[]},Ap.prototype.getClass=function(){return Ap},Ap.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Rp=function(t){function e(){t.call(this),this.events=new Lc,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){xh.sort(this.events);for(var t=0;te||this._maxo?1:0},kp.prototype.interfaces_=function(){return[Cu]},kp.prototype.getClass=function(){return kp};var Dp=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],n=arguments[1],r=arguments[2];this._min=e,this._max=n,this._item=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Tp),Bp=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Tp),Gp=function(){this._leaves=new Lc,this._root=null,this._level=0};Gp.prototype.buildTree=function(){xh.sort(this._leaves,new Tp.NodeComparator);for(var t=this._leaves,e=null,n=new Lc;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},Gp.prototype.insert=function(t,e,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new Dp(t,e,n))},Gp.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},Gp.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},Gp.prototype.printNode=function(t){Hu.out.println(nc.toLineString(new Mu(t._min,this._level),new Mu(t._max,this._level)))},Gp.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},Gp.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,r=t.iterator();r.hasNext();){var i=r.next();e[n++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===ju.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var r=jc.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=e,o=n;hc.isCCW(r)&&(i=n,o=e);var s=new Sf(r,new eh(this._argIndex,ju.BOUNDARY,i,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,r[0],ju.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new eh(t,n):i.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new Rp},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),i=n.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof Ol&&(this._useBoundaryDeterminationRule=!1),e instanceof bl)this.addPolygon(e);else if(e instanceof yl)this.addLineString(e);else if(e instanceof ml)this.addPoint(e);else if(e instanceof wl)this.addCollection(e);else if(e instanceof il)this.addCollection(e);else if(e instanceof Ol)this.addCollection(e);else{if(!(e instanceof rl))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e50?(null===this._areaPtLocator&&(this._areaPtLocator=new zp(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?ju.BOUNDARY:ju.INTERIOR},e}(ph),Xp=function(){if(this._li=new uc,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Wp(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=mc.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Wp(0,e,r),this._arg[1]=new Wp(1,n,r)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Wp(0,i,s),this._arg[1]=new Wp(1,o,s)}};Xp.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Xp.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Xp.prototype.interfaces_=function(){return[]},Xp.prototype.getClass=function(){return Xp};var Hp=function(){};Hp.prototype.interfaces_=function(){return[]},Hp.prototype.getClass=function(){return Hp},Hp.map=function(){if(arguments[0]instanceof dc&&Ru(arguments[1],Hp.MapOp)){for(var t=arguments[0],e=arguments[1],n=new Lc,r=0;r=t.size()?null:t.get(e)},nd.union=function(t){return new nd(t).union()},rd.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(nd,rd);var id=function(){};function od(){return new sd}function sd(){this.reset()}id.prototype.interfaces_=function(){return[]},id.prototype.getClass=function(){return id},id.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Kp.createEmptyResult(Kp.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Mp.overlayOp(t,e,Kp.UNION)},sd.prototype={constructor:sd,reset:function(){this.s=this.t=0},add:function(t){ud(ad,t,this.t),ud(this,ad.s,this.s),this.s?this.t+=ad.t:this.s=ad.t},valueOf:function(){return this.s}};var ad=new sd;function ud(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}var cd=1e-6,ld=Math.PI,hd=ld/2,fd=ld/4,pd=2*ld,dd=180/ld,gd=ld/180,yd=Math.abs,vd=Math.atan,md=Math.atan2,_d=Math.cos,bd=Math.sin,wd=Math.sqrt;function xd(t){return t>1?0:t<-1?ld:Math.acos(t)}function Od(t){return t>1?hd:t<-1?-hd:Math.asin(t)}function Ed(){}function Sd(t,e){t&&Ld.hasOwnProperty(t.type)&&Ld[t.type](t,e)}var Cd,Nd,Md={Feature:function(t,e){Sd(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++rld?t-pd:t<-ld?t+pd:t,e]}function qd(t){return function(e,n){return[(e+=t)>ld?e-pd:e<-ld?e+pd:e,n]}}function zd(t){var e=qd(t);return e.invert=qd(-t),e}function Ud(t,e){var n=_d(t),r=bd(t),i=_d(e),o=bd(e);function s(t,e){var s=_d(e),a=_d(t)*s,u=bd(t)*s,c=bd(e),l=c*n+a*r;return[md(u*i-l*o,a*n-c*r),Od(l*i+u*o)]}return s.invert=function(t,e){var s=_d(e),a=_d(t)*s,u=bd(t)*s,c=bd(e),l=c*i-u*o;return[md(u*i+c*o,a*n+l*r),Od(l*n-a*r)]},s}function Vd(t,e){(e=Ad(e))[0]-=t,Dd(e);var n=xd(-e[1]);return((-e[2]<0?-n:n)+pd-cd)%pd}function Yd(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:Ed,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Wd(t,e){return yd(t[0]-e[0])=0;--o)i.point((l=c[o])[0],l[1]);else r(f.x,f.p.x,-1,i);f=f.p}c=(f=f.o).z,p=!p}while(!f.v);i.lineEnd()}}}function Kd(t){if(e=t.length){for(var e,n,r=0,i=t[0];++re?1:t>=e?0:NaN}function Jd(t){for(var e,n,r,i=t.length,o=-1,s=0;++o=0;)for(e=(r=t[i]).length;--e>=0;)n[--s]=r[e];return n}od(),od(),od(),Gd.invert=Gd,1===(Cd=Zd).length&&(Nd=Cd,Cd=function(t,e){return Zd(Nd(t),e)});var $d=1e9,Qd=-$d;function tg(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,a,c){var l=0,h=0;if(null==i||(l=s(i,a))!==(h=s(o,a))||u(i,o)<0^a>0)do{c.point(0===l||3===l?t:n,l>1?r:e)}while((l=(l+a+4)%4)!==h);else c.point(o[0],o[1])}function s(r,i){return yd(r[0]-t)0?0:3:yd(r[0]-n)0?2:1:yd(r[1]-e)0?1:0:i>0?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=s(t,1),r=s(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){var u,c,l,h,f,p,d,g,y,v,m,_=s,b=Yd(),w={point:x,lineStart:function(){w.point=O,c&&c.push(l=[]),v=!0,y=!1,d=g=NaN},lineEnd:function(){u&&(O(h,f),p&&y&&b.rejoin(),u.push(b.result())),w.point=x,y&&_.lineEnd()},polygonStart:function(){_=b,u=[],c=[],m=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=c.length;nr&&(f-o)*(r-s)>(p-s)*(t-o)&&++e:p<=r&&(f-o)*(r-s)<(p-s)*(t-o)&&--e;return e}(),n=m&&e,i=(u=Jd(u)).length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),i&&Hd(u,a,e,o,s),s.polygonEnd()),_=s,u=c=l=null}};function x(t,e){i(t,e)&&_.point(t,e)}function O(o,s){var a=i(o,s);if(c&&l.push([o,s]),v)h=o,f=s,p=a,v=!1,a&&(_.lineStart(),_.point(o,s));else if(a&&y)_.point(o,s);else{var u=[d=Math.max(Qd,Math.min($d,d)),g=Math.max(Qd,Math.min($d,g))],b=[o=Math.max(Qd,Math.min($d,o)),s=Math.max(Qd,Math.min($d,s))];!function(t,e,n,r,i,o){var s,a=t[0],u=t[1],c=0,l=1,h=e[0]-a,f=e[1]-u;if(s=n-a,h||!(s>0)){if(s/=h,h<0){if(s0){if(s>l)return;s>c&&(c=s)}if(s=i-a,h||!(s<0)){if(s/=h,h<0){if(s>l)return;s>c&&(c=s)}else if(h>0){if(s0)){if(s/=f,f<0){if(s0){if(s>l)return;s>c&&(c=s)}if(s=o-u,f||!(s<0)){if(s/=f,f<0){if(s>l)return;s>c&&(c=s)}else if(f>0){if(s0&&(t[0]=a+c*h,t[1]=u+c*f),l<1&&(e[0]=a+l*h,e[1]=u+l*f),!0}}}}}(u,b,t,e,n,r)?a&&(_.lineStart(),_.point(o,s),m=!1):(y||(_.lineStart(),_.point(u[0],u[1])),_.point(b[0],b[1]),a||_.lineEnd(),m=!1)}d=o,g=s,y=a}return w}}var eg=od();function ng(t){return t}od(),od(),od();var rg=1/0,ig=rg,og=-rg,sg=og,ag={point:function(t,e){tog&&(og=t),esg&&(sg=e)},lineStart:Ed,lineEnd:Ed,polygonStart:Ed,polygonEnd:Ed,result:function(){var t=[[rg,ig],[og,sg]];return og=sg=-(ig=rg=1/0),t}};function ug(t,e,n,r){return function(i,o){var s,a,u,c=e(o),l=i.invert(r[0],r[1]),h=Yd(),f=e(h),p=!1,d={point:g,lineStart:v,lineEnd:m,polygonStart:function(){d.point=_,d.lineStart=b,d.lineEnd=w,a=[],s=[]},polygonEnd:function(){d.point=g,d.lineStart=v,d.lineEnd=m,a=Jd(a);var t=function(t,e){var n=e[0],r=e[1],i=[bd(n),-_d(n),0],o=0,s=0;eg.reset();for(var a=0,u=t.length;a=0?1:-1,E=O*x,S=E>ld,C=d*b;if(eg.add(md(C*O*bd(E),g*w+C*_d(E))),o+=S?x+O*pd:x,S^f>=n^m>=n){var N=Td(Ad(h),Ad(v));Dd(N);var M=Td(i,N);Dd(M);var L=(S^x>=0?-1:1)*Od(M[2]);(r>L||r===L&&(N[0]||N[1]))&&(s+=S^x>=0?1:-1)}}return(o<-1e-6||o0){for(p||(o.polygonStart(),p=!0),o.lineStart(),t=0;t1&&2&i&&c.push(c.pop().concat(c.shift())),a.push(c.filter(cg))}return d}}function cg(t){return t.length>1}function lg(t,e){return((t=t.x)[0]<0?t[1]-hd-cd:hd-t[1])-((e=e.x)[0]<0?e[1]-hd-cd:hd-e[1])}od();var hg=ug((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?ld:-ld,u=yd(o-n);yd(u-ld)0?hd:-hd),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),e=0):i!==a&&u>=ld&&(yd(n-i)cd?vd((bd(e)*(o=_d(r))*bd(n)-bd(r)*(i=_d(e))*bd(t))/(i*o*s)):(e+r)/2}(n,r,o,s),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),e=0),t.point(n=o,r=s),i=a},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*hd,r.point(-ld,i),r.point(0,i),r.point(ld,i),r.point(ld,0),r.point(ld,-i),r.point(0,-i),r.point(-ld,-i),r.point(-ld,0),r.point(-ld,i);else if(yd(t[0]-e[0])>cd){var o=t[0]0,i=yd(n)>cd;function o(t,e){return _d(t)*_d(e)>n}function s(t,e,r){var i=[1,0,0],o=Td(Ad(t),Ad(e)),s=Rd(o,o),a=o[0],u=s-a*a;if(!u)return!r&&t;var c=n*s/u,l=-n*a/u,h=Td(i,o),f=kd(i,c);Fd(f,kd(o,l));var p=h,d=Rd(f,p),g=Rd(p,p),y=d*d-g*(Rd(f,f)-1);if(!(y<0)){var v=wd(y),m=kd(p,(-d-v)/g);if(Fd(m,f),m=jd(m),!r)return m;var _,b=t[0],w=e[0],x=t[1],O=e[1];w0^m[1]<(yd(m[0]-b)ld^(b<=m[0]&&m[0]<=w)){var C=kd(p,(-d+v)/g);return Fd(C,f),[m,jd(C)]}}}function a(e,n){var i=r?t:ld-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return ug(o,(function(t){var e,n,u,c,l;return{lineStart:function(){c=u=!1,l=1},point:function(h,f){var p,d=[h,f],g=o(h,f),y=r?g?0:a(h,f):g?a(h+(h<0?ld:-ld),f):0;if(!e&&(c=u=g)&&t.lineStart(),g!==u&&(!(p=s(e,d))||Wd(e,p)||Wd(d,p))&&(d[0]+=cd,d[1]+=cd,g=o(d[0],d[1])),g!==u)l=0,g?(t.lineStart(),p=s(d,e),t.point(p[0],p[1])):(p=s(e,d),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(i&&e&&r^g){var v;y&n||!(v=s(d,e,!0))||(l=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!g||e&&Wd(e,d)||t.point(d[0],d[1]),e=d,u=g,n=y},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return l|(c&&u)<<1}}}),(function(n,r,i,o){!function(t,e,n,r,i,o){if(n){var s=_d(e),a=bd(e),u=r*n;null==i?(i=e+r*pd,o=e-u/2):(i=Vd(s,i),o=Vd(s,o),(r>0?io)&&(i+=r*pd));for(var c,l=i;r>0?l>o:l4*e&&g--){var b=s+f,w=a+p,x=u+d,O=wd(b*b+w*w+x*x),E=Od(x/=O),S=yd(yd(x)-1)e||yd((v*L+m*I)/_-.5)>.3||s*f+a*p+u*d2?t[2]%360*gd:0,M()):[y*dd,v*dd,m*dd]},S.precision=function(t){return arguments.length?(E=vg(N,O=t*t),L()):wd(O)},S.fitExtent=function(t,e){return gg(S,t,e)},S.fitSize=function(t,e){return function(t,e,n){return gg(t,[[0,0],e],n)}(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&C,M()}}((function(){return t}))()}(_g).scale(79.4188).clipAngle(179.999)}function wg(t,e,r,i){var o=t.properties||{},a="Feature"===t.type?t.geometry:t;if("GeometryCollection"===a.type){var u=[];return G(t,(function(t){var n=wg(t,e,r,i);n&&u.push(n)})),d(u)}var c=function(t){var e=ln(t).geometry.coordinates,r=[-e[0],-e[1]];return bg().rotate(r).scale(n)}(a),l={type:a.type,coordinates:xg(a.coordinates,c)},h=(new Vl).read(l),f=b(w(e,r),"meters"),p=Df.bufferOp(h,f,i);if(!function t(e){return Array.isArray(e[0])?t(e[0]):isNaN(e[0])}((p=(new Yl).write(p)).coordinates))return s({type:p.type,coordinates:Og(p.coordinates,c)},o)}function xg(t,e){return"object"!=typeof t[0]?e(t):t.map((function(t){return xg(t,e)}))}function Og(t,e){return"object"!=typeof t[0]?e.invert(t):t.map((function(t){return Og(t,e)}))}function Eg(t,e,n){void 0===n&&(n={});var r=it(t),i=it(e),o=_u.intersection(r.coordinates,i.coordinates);return 0===o.length?null:1===o.length?l(o[0],n.properties):v(o,n.properties)}function Sg(t,e,n){void 0===n&&(n={});var r=JSON.stringify(n.properties||{}),i=t[0],o=t[1],s=t[2],a=t[3],u=(o+a)/2,c=(i+s)/2,l=2*e/ve([i,u],[s,u],n)*(s-i),h=2*e/ve([c,o],[c,a],n)*(a-o),f=l/2,p=2*f,g=Math.sqrt(3)/2*h,y=s-i,v=a-o,m=3/4*p,_=g,b=(y-p)/(p-f/2),w=Math.floor(b),x=(w*m-f/2-y)/2-f/2+m/2,O=Math.floor((v-g)/g),E=(v-O*g)/2,S=O*g-v>g/2;S&&(E-=g/4);for(var C=[],N=[],M=0;M<6;M++){var L=2*Math.PI/6*M;C.push(Math.cos(L)),N.push(Math.sin(L))}for(var I=[],P=0;P<=w;P++)for(var j=0;j<=O;j++){var A=P%2==1;if(!(0===j&&A||0===j&&S)){var R=P*m+i-x,T=j*_+o+E;if(A&&(T-=g/2),!0===n.triangles)Ng([R,T],l/2,h/2,JSON.parse(r),C,N).forEach((function(t){n.mask?Eg(n.mask,t)&&I.push(t):I.push(t)}));else{var F=Cg([R,T],l/2,h/2,JSON.parse(r),C,N);n.mask?Eg(n.mask,F)&&I.push(F):I.push(F)}}}return d(I)}function Cg(t,e,n,r,i,o){for(var s=[],a=0;a<6;a++){var u=t[0]+e*i[a],c=t[1]+n*o[a];s.push([u,c])}return s.push(s[0].slice()),l([s],r)}function Ng(t,e,n,r,i,o){for(var s=[],a=0;a<6;a++){var u=[];u.push(t),u.push([t[0]+e*i[a],t[1]+n*o[a]]),u.push([t[0]+e*i[(a+1)%6],t[1]+n*o[(a+1)%6]]),u.push(t),s.push(l([u],r))}return s}function Mg(t){return v(t)}function Lg(t,e,n){return void 0===n&&(n={}),function(t,e,n,r){void 0===r&&(r={});for(var i=[],o=t[0],s=t[1],a=t[2],u=t[3],c=e/ve([o,s],[a,s],r)*(a-o),h=n/ve([o,s],[o,u],r)*(u-s),f=a-o,p=u-s,g=Math.floor(f/c),y=Math.floor(p/h),v=(p-y*h)/2,m=o+(f-g*c)/2,_=0;_=i&&o===r.length-1);o++){if(i>=e){var s=e-i;if(s){var a=cn(r[o],r[o-1])-180;return an(r[o],s,a,n)}return u(r[o])}i+=ve(r[o],r[o+1],n)}return u(r[r.length-1])},e.angle=function(t,e,n,r){if(void 0===r&&(r={}),!L(r))throw new Error("options is invalid");if(!t)throw new Error("startPoint is required");if(!e)throw new Error("midPoint is required");if(!n)throw new Error("endPoint is required");var i=t,o=e,s=n,a=O(!0!==r.mercator?cn(i,o):mi(i,o)),u=O(!0!==r.mercator?cn(s,o):mi(s,o)),c=Math.abs(a-u);return!0===r.explementary?360-c:c},e.applyFilter=ja,e.area=wr,e.areaFactors=o,e.bbox=J,e.bboxClip=function(t,e){var n=it(t),r=n.type,i="Feature"===t.type?t.properties:{},o=n.coordinates;switch(r){case"LineString":case"MultiLineString":var s=[];return"LineString"===r&&(o=[o]),o.forEach((function(t){!function(t,e,n){var r,i,o,s,a,u=t.length,c=li(t[0],e),l=[];for(n||(n=[]),r=1;r0)for(var n=0;n0},e.booleanParallel=function(t,e){if(!t)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");if("LineString"!==gs(t,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==gs(e,"line2"))throw new Error("line2 must be a LineString");for(var n=Gn(Ye(t)).features,r=Gn(Ye(e)).features,i=0;i0){h+=1;var o=i*ve(t,e);0===o&&(o=1);var s=i/o;a+=t.geometry.coordinates[0]*s,c+=t.geometry.coordinates[1]*s,l+=s}})),h<1)throw new Error("no features to measure");var f=a/l,p=c/l;return 1===h||0===o||Math.abs(f-n[0])n&&(e.numberOfClusters=n),!0!==e.mutate&&(t=xe(t));var r=B(t),i=r.slice(0,e.numberOfClusters),o=ps(r,e.numberOfClusters,i),s={};return o.centroids.forEach((function(t,e){s[e]=t})),k(t,(function(t,e){var n=o.idxs[e];t.properties.cluster=n,t.properties.centroid=s[n]})),t},e.collect=function(t,e,n,r){var i=Et(6),o=e.features.map((function(t){var e;return{minX:t.geometry.coordinates[0],minY:t.geometry.coordinates[1],maxX:t.geometry.coordinates[0],maxY:t.geometry.coordinates[1],property:null===(e=t.properties)||void 0===e?void 0:e[n]}}));return i.load(o),t.features.forEach((function(t){t.properties||(t.properties={});var e=J(t),n=i.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}),o=[];n.forEach((function(e){de([e.minX,e.minY],t)&&o.push(e.property)})),t.properties[r]=o})),t},e.collectionOf=rt,e.combine=function(t){var e={MultiPoint:{coordinates:[],properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}};return k(t,(function(t){var n,r,i,o;switch(null===(o=t.geometry)||void 0===o?void 0:o.type){case"Point":e.MultiPoint.coordinates.push(t.geometry.coordinates),e.MultiPoint.properties.push(t.properties);break;case"MultiPoint":(n=e.MultiPoint.coordinates).push.apply(n,t.geometry.coordinates),e.MultiPoint.properties.push(t.properties);break;case"LineString":e.MultiLineString.coordinates.push(t.geometry.coordinates),e.MultiLineString.properties.push(t.properties);break;case"MultiLineString":(r=e.MultiLineString.coordinates).push.apply(r,t.geometry.coordinates),e.MultiLineString.properties.push(t.properties);break;case"Polygon":e.MultiPolygon.coordinates.push(t.geometry.coordinates),e.MultiPolygon.properties.push(t.properties);break;case"MultiPolygon":(i=e.MultiPolygon.coordinates).push.apply(i,t.geometry.coordinates),e.MultiPolygon.properties.push(t.properties)}})),d(Object.keys(e).filter((function(t){return e[t].coordinates.length})).sort().map((function(t){return s({type:t,coordinates:e[t].coordinates},{collectedProperties:e[t].properties})})))},e.concave=function(t,e){void 0===e&&(e={});var n=e.maxEdge||1/0,r=me(function(t){var e=[],n={};return k(t,(function(t){if(t.geometry){var r=t.geometry.coordinates.join("-");Object.prototype.hasOwnProperty.call(n,r)||(e.push(t),n[r]=!0)}})),d(e)}(t));if(r.features=r.features.filter((function(t){var r=t.geometry.coordinates[0][0],i=t.geometry.coordinates[0][1],o=t.geometry.coordinates[0][2],s=ve(r,i,e),a=ve(i,o,e),u=ve(r,o,e);return s<=n&&a<=n&&u<=n})),r.features.length<1)return null;var i=Ve(r);return 1===i.coordinates.length&&(i.coordinates=i.coordinates[0],i.type="Polygon"),s(i)},e.containsNumber=tt,e.convertArea=N,e.convertDistance=C,e.convertLength=C,e.convex=pe,e.coordAll=B,e.coordEach=A,e.coordReduce=R,e.createBins=Pa,e.degrees2radians=S,e.degreesToRadians=S,e.destination=an,e.difference=function(t,e){var n=it(t),r=it(e),i=t.properties||{},o=_u.difference(n.coordinates,r.coordinates);return 0===o.length?null:1===o.length?l(o[0],i):v(o,i)},e.dissolve=function(t,e){if(!L(e=e||{}))throw new Error("options is invalid");var n=e.propertyName;rt(t,"Polygon","dissolve");var r=[];if(!e.propertyName)return Tr(v(_u.union.apply(null,t.features.map((function(t){return t.geometry.coordinates})))));var i={};k(t,(function(t){Object.prototype.hasOwnProperty.call(i,t.properties[n])||(i[t.properties[n]]=[]),i[t.properties[n]].push(t)}));for(var o=Object.keys(i),s=0;s0&&(s=l(o).geometry),la(s,a),o=a.slice(0);n.push(l(o,i));break;case"MultiPolygon":o=[[[]]];for(var c=0;c0&&(s=v(o).geometry),ha(s,a),o=a.slice(0);n.push(v(o,i));break;default:throw new Error("geometry is invalid, must be Polygon or MultiPolygon")}})),d(n)},e.polygonTangents=function(t,e){var n,r,i,o,s=Q(t),a=Q(e),c=J(e),l=0,h=null;switch(s[0]>c[0]&&s[0]c[1]&&s[1] is required");if("boolean"!=typeof n)throw new Error(" must be a boolean");if("boolean"!=typeof r)throw new Error(" must be a boolean");!1===r&&(t=xe(t));var i=[];switch(t.type){case"GeometryCollection":return G(t,(function(t){Si(t,n)})),t;case"FeatureCollection":return k(t,(function(t){k(Si(t,n),(function(t){i.push(t)}))})),d(i)}return Si(t,n)},e.rhumbBearing=mi,e.rhumbDestination=bi,e.rhumbDistance=dr,e.round=_,e.sample=function(t,e){if(!t)throw new Error("featurecollection is required");if(null==e)throw new Error("num is required");if("number"!=typeof e)throw new Error("num must be a number");return d(function(t,e){for(var n,r,i=t.slice(0),o=t.length,s=o-e;o-- >s;)n=i[r=Math.floor((o+1)*Math.random())],i[r]=i[o],i[o]=n;return i.slice(s)}(t.features,e))},e.sector=function(t,e,n,r,i){if(!L(i=i||{}))throw new Error("options is invalid");var o=i.properties;if(!t)throw new Error("center is required");if(null==n)throw new Error("bearing1 is required");if(null==r)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if("object"!=typeof i)throw new Error("options must be an object");if(vi(n)===vi(r))return un(t,e,i);var s=Q(t),a=ti(t,e,n,r,i),u=[[s]];return A(a,(function(t){u[0].push(t)})),u[0].push(s),l(u,o)},e.segmentEach=V,e.segmentReduce=Y,e.shortestPath=function(t,e,n){if(!L(n=n||{}))throw new Error("options is invalid");var r=n.resolution,i=n.minDistance,o=n.obstacles||d([]);if(!t)throw new Error("start is required");if(!e)throw new Error("end is required");if(r&&!M(r)||r<=0)throw new Error("options.resolution must be a number, greater than 0");if(i)throw new Error("options.minDistance is not yet implemented");var a=$(t),c=$(e);switch(t=u(a),e=u(c),ot(o)){case"FeatureCollection":if(0===o.features.length)return f([a,c]);break;case"Polygon":o=d([s(it(o))]);break;default:throw new Error("invalid obstacles")}var l=o;l.features.push(t),l.features.push(e);var h=J(Lo(rn(J(l)),1.15));r||(r=ve([h[0],h[1]],[h[2],h[1]],n)/100),l.features.pop(),l.features.pop();for(var p=h[0],g=h[1],y=h[2],v=h[3],m=r/ve([p,g],[y,g],n)*(y-p),_=r/ve([p,g],[p,v],n)*(v-g),b=y-p,w=v-g,x=Math.floor(b/m),O=Math.floor(w/_),E=(b-x*m)/2,S=[],C=[],N=[],I=[],P=1/0,j=1/0,A=v-(w-O*_)/2,R=0;A>=g;){for(var T=[],F=[],k=p+E,D=0;k<=y;){var B=u([k,A]),G=ws(B,o);T.push(G?0:1),F.push(k+"|"+A);var q=ve(B,t);!G&&q=1024){var n=0;for(var i in c)0==(3&n++)&&(delete c[i],--l)}e=function(t){var e,n,i,a,c;if(s.exec(t)&&(t=u(t)),o.exec(t)){var l=t.length-1,h=void 0;h=l<=4?1:2;var f=4===l||8===l;e=parseInt(t.substr(1+0*h,h),16),n=parseInt(t.substr(1+1*h,h),16),i=parseInt(t.substr(1+2*h,h),16),a=f?parseInt(t.substr(1+3*h,h),16):255,1==h&&(e=(e<<4)+e,n=(n<<4)+n,i=(i<<4)+i,f&&(a=(a<<4)+a)),c=[e,n,i,a/255]}else 0==t.indexOf("rgba(")?p(c=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((c=t.slice(4,-1).split(",").map(Number)).push(1),p(c)):Object(r.a)(!1,14);return c}(t),c[t]=e,++l}return e});function f(t){return Array.isArray(t)?t:h(t)}function p(t){return t[0]=Object(i.a)(t[0]+.5|0,0,255),t[1]=Object(i.a)(t[1]+.5|0,0,255),t[2]=Object(i.a)(t[2]+.5|0,0,255),t[3]=Object(i.a)(t[3],0,1),t}function d(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var n=t[1];n!=(0|n)&&(n=n+.5|0);var r=t[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+e+","+n+","+r+","+(void 0===t[3]?1:t[3])+")"}},function(t,e,n){"use strict";var r,i=n(53),o=n(15),s=n(131),a=n(87),u=n(119),c=n(7),l=n(111),h=n(136),f=n(36),p=n(80),d=n(208),g=n(173),y=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),v=function(t){function e(e,n,r){var i=t.call(this)||this;if(i.ends_=[],i.maxDelta_=-1,i.maxDeltaRevision_=-1,Array.isArray(e[0]))i.setCoordinates(e,n);else if(void 0!==n&&r)i.setFlatCoordinates(n,e),i.ends_=r;else{for(var o=i.getLayout(),s=e,a=[],u=[],c=0,l=s.length;c2||Math.abs(t[4*e+3]-191.25)>2}function f(t,e,n,r){var i=Object(u.p)(n,e,t),o=Object(u.h)(e,r,n),a=e.getMetersPerUnit();void 0!==a&&(o*=a);var c=t.getMetersPerUnit();void 0!==c&&(o/=c);var l=t.getExtent();if(!l||Object(s.f)(l,i)){var h=Object(u.h)(t,o,i)/o;isFinite(h)&&h>0&&(o/=h)}return o}function p(t,e,n,r){var i=Object(s.w)(n),o=f(t,e,i,r);return(!isFinite(o)||o<=0)&&Object(s.s)(n,(function(n){return o=f(t,e,n,r),isFinite(o)&&o>0})),o}function d(t,e,n,u,f,p,d,g,y,v,m,_){var b=Object(a.a)(Math.round(n*t),Math.round(n*e));if(Object(o.a)(b,_),0===y.length)return b.canvas;function w(t){return Math.round(t*n)/n}b.scale(n,n),b.globalCompositeOperation="lighter";var x=Object(s.j)();y.forEach((function(t,e,n){Object(s.p)(x,t.extent)}));var O=Object(s.D)(x),E=Object(s.z)(x),S=Object(a.a)(Math.round(n*O/u),Math.round(n*E/u));Object(o.a)(S,_);var C=n/u;y.forEach((function(t,e,n){var r=t.extent[0]-x[0],i=-(t.extent[3]-x[3]),o=Object(s.D)(t.extent),a=Object(s.z)(t.extent);t.image.width>0&&t.image.height>0&&S.drawImage(t.image,v,v,t.image.width-2*v,t.image.height-2*v,r*C,i*C,o*C,a*C)}));var N=Object(s.B)(d);return g.getTriangles().forEach((function(t,e,o){var s=t.source,a=t.target,f=s[0][0],d=s[0][1],g=s[1][0],y=s[1][1],v=s[2][0],m=s[2][1],O=w((a[0][0]-N[0])/p),E=w(-(a[0][1]-N[1])/p),C=w((a[1][0]-N[0])/p),M=w(-(a[1][1]-N[1])/p),L=w((a[2][0]-N[0])/p),I=w(-(a[2][1]-N[1])/p),P=f,j=d;f=0,d=0;var A=[[g-=P,y-=j,0,0,C-O],[v-=P,m-=j,0,0,L-O],[0,0,g,y,M-E],[0,0,v,m,I-E]],R=Object(c.f)(A);if(R){if(b.save(),b.beginPath(),function(){if(void 0===r){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",l(t,4,5,4,0),l(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;r=h(e,0)||h(e,4)||h(e,8)}return r}()||_===i.b){b.moveTo(C,M);for(var T=O-C,F=E-M,k=0;k<4;k++)b.lineTo(C+w((k+1)*T/4),M+w(k*F/3)),3!=k&&b.lineTo(C+w((k+1)*T/4),M+w((k+1)*F/3));b.lineTo(L,I)}else b.moveTo(C,M),b.lineTo(O,E),b.lineTo(L,I);b.clip(),b.transform(R[0],R[2],R[1],R[3],O,E),b.translate(x[0]-P,x[3]-j),b.scale(u/n,-u/n),b.drawImage(S.canvas,0,0),b.restore()}})),m&&(b.save(),b.globalCompositeOperation="source-over",b.strokeStyle="black",b.lineWidth=1,g.getTriangles().forEach((function(t,e,n){var r=t.target,i=(r[0][0]-N[0])/p,o=-(r[0][1]-N[1])/p,s=(r[1][0]-N[0])/p,a=-(r[1][1]-N[1])/p,u=(r[2][0]-N[0])/p,c=-(r[2][1]-N[1])/p;b.beginPath(),b.moveTo(s,a),b.lineTo(i,o),b.lineTo(u,c),b.closePath(),b.stroke()})),b.restore()),b.canvas}},function(t,e,n){"use strict";e.a={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"}},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return a}));var r=n(26);function i(t){return void 0!==t?0:void 0}function o(t){return void 0!==t?t:void 0}function s(t){var e=2*Math.PI/t;return function(t,n){return n?t:void 0!==t?t=Math.floor(t/e+.5)*e:void 0}}function a(t){var e=t||Object(r.j)(5);return function(t,n){return n?t:void 0!==t?Math.abs(t)<=e?0:t:void 0}}},function(t,e,n){"use strict";e.a={FRACTION:"fraction",PIXELS:"pixels"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=function(){function t(t,e,n,r){this.minX=t,this.maxX=e,this.minY=n,this.maxY=r}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function i(t,e,n,i,o){return void 0!==o?(o.minX=t,o.maxX=e,o.minY=n,o.maxY=i,o):new r(t,e,n,i)}e.b=r},function(t,e,n){"use strict";e.a={CARMENTA_SERVER:"carmentaserver",GEOSERVER:"geoserver",MAPSERVER:"mapserver",QGIS:"qgis"}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return q}));var r,i=n(73),o=n(112),s=n(48),a=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.delta_=r.delta?r.delta:1,n.duration_=void 0!==r.duration?r.duration:250,n}return a(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==s.a.DBLCLICK){var n=t.originalEvent,r=t.map,i=t.coordinate,a=n.shiftKey?-this.delta_:this.delta_,u=r.getView();Object(o.c)(u,a,i,this.duration_),n.preventDefault(),e=!0}return!e},e}(o.a),c=n(222),l=n(77),h=n(50),f=n(51),p=n(157),d=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),g=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this,{stopDown:h.a})||this).condition_=r.condition?r.condition:f.c,n.lastAngle_=void 0,n.duration_=void 0!==r.duration?r.duration:250,n}return d(e,t),e.prototype.handleDragEvent=function(t){if(Object(f.g)(t)){var e=t.map,n=e.getView();if(n.getConstraints().rotation!==p.c){var r=e.getSize(),i=t.pixel,o=Math.atan2(r[1]/2-i[1],i[0]-r[0]/2);if(void 0!==this.lastAngle_){var s=o-this.lastAngle_;n.adjustRotationInternal(-s)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!Object(f.g)(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!Object(f.g)(t)&&(!(!Object(f.f)(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(l.b),y=n(250),v=n(101),m=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_=function(t){function e(e){var n=this,r=e||{},i=r.condition?r.condition:f.k;return(n=t.call(this,{condition:i,className:r.className||"ol-dragzoom",minArea:r.minArea})||this).duration_=void 0!==r.duration?r.duration:200,n.out_=void 0!==r.out&&r.out,n}return m(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),n=this.getGeometry();if(this.out_){var r=e.rotatedExtentForGeometry(n),i=e.getResolutionForExtentInternal(r),o=e.getResolution()/i;(n=n.clone()).scale(o*o)}e.fitInternal(n,{duration:this.duration_,easing:v.b})},e}(y.a),b=n(28),w=37,x=38,O=39,E=40,S=n(45),C=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),N=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.defaultCondition_=function(t){return Object(f.i)(t)&&Object(f.m)(t)},n.condition_=void 0!==r.condition?r.condition:n.defaultCondition_,n.duration_=void 0!==r.duration?r.duration:100,n.pixelDelta_=void 0!==r.pixelDelta?r.pixelDelta:128,n}return C(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==b.a.KEYDOWN){var n=t.originalEvent,r=n.keyCode;if(this.condition_(t)&&(r==E||r==w||r==O||r==x)){var i=t.map.getView(),s=i.getResolution()*this.pixelDelta_,a=0,u=0;r==E?u=-s:r==w?a=-s:r==O?a=s:u=s;var c=[a,u];Object(S.g)(c,i.getRotation()),Object(o.b)(i,c,this.duration_),n.preventDefault(),e=!0}}return!e},e}(o.a),M=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),L=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.condition_=r.condition?r.condition:f.m,n.delta_=r.delta?r.delta:1,n.duration_=void 0!==r.duration?r.duration:100,n}return M(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==b.a.KEYDOWN||t.type==b.a.KEYPRESS){var n=t.originalEvent,r=n.charCode;if(this.condition_(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var i=t.map,s=r=="+".charCodeAt(0)?this.delta_:-this.delta_,a=i.getView();Object(o.c)(a,s,void 0,this.duration_),n.preventDefault(),e=!0}}return!e},e}(o.a),I=function(){function t(t,e,n){this.decay_=t,this.minVelocity_=e,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]0&&this.points_[n+2]>t;)n-=3;var r=this.points_[e+2]-this.points_[n+2];if(r<1e3/60)return!1;var i=this.points_[e]-this.points_[n],o=this.points_[e+1]-this.points_[n+1];return this.angle_=Math.atan2(o,i),this.initialVelocity_=Math.sqrt(i*i+o*o)/r,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),P=n(79),j=n(26),A=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),R="trackpad",T="wheel",F=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,r)||this).totalDelta_=0,n.lastDelta_=0,n.maxDelta_=void 0!==r.maxDelta?r.maxDelta:1,n.duration_=void 0!==r.duration?r.duration:250,n.timeout_=void 0!==r.timeout?r.timeout:80,n.useAnchor_=void 0===r.useAnchor||r.useAnchor,n.constrainResolution_=void 0!==r.constrainResolution&&r.constrainResolution;var i=r.condition?r.condition:f.d;return n.condition_=r.onFocusOnly?Object(f.a)(f.e,i):i,n.lastAnchor_=null,n.startTime_=void 0,n.timeoutId_,n.mode_=void 0,n.trackpadEventGap_=400,n.trackpadTimeoutId_,n.deltaPerZoom_=300,n}return A(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==b.a.WHEEL)return!0;var e,n=t.map,r=t.originalEvent;if(r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==b.a.WHEEL&&(e=r.deltaY,P.b&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=P.a),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var i=Date.now();void 0===this.startTime_&&(this.startTime_=i),(!this.mode_||i-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?R:T);var o=n.getView();if(this.mode_===R&&!o.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=i,!1;this.totalDelta_+=e;var s=Math.max(this.timeout_-(i-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),s),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var n=-Object(j.a)(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),Object(o.c)(e,n,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(o.a),k=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),D=function(t){function e(e){var n=this,r=e||{},i=r;return i.stopDown||(i.stopDown=h.a),(n=t.call(this,i)||this).anchor_=null,n.lastAngle_=void 0,n.rotating_=!1,n.rotationDelta_=0,n.threshold_=void 0!==r.threshold?r.threshold:.3,n.duration_=void 0!==r.duration?r.duration:250,n}return k(e,t),e.prototype.handleDragEvent=function(t){var e=0,n=this.targetPointers[0],r=this.targetPointers[1],i=Math.atan2(r.clientY-n.clientY,r.clientX-n.clientX);if(void 0!==this.lastAngle_){var o=i-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=i;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==p.c){var u=s.getViewport().getBoundingClientRect(),c=Object(l.a)(this.targetPointers);c[0]-=u.left,c[1]-=u.top,this.anchor_=s.getCoordinateFromPixelInternal(c),this.rotating_&&(s.render(),a.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(l.b),B=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),G=function(t){function e(e){var n=this,r=e||{},i=r;return i.stopDown||(i.stopDown=h.a),(n=t.call(this,i)||this).anchor_=null,n.duration_=void 0!==r.duration?r.duration:400,n.lastDistance_=void 0,n.lastScaleDelta_=1,n}return B(e,t),e.prototype.handleDragEvent=function(t){var e=1,n=this.targetPointers[0],r=this.targetPointers[1],i=n.clientX-r.clientX,o=n.clientY-r.clientY,s=Math.sqrt(i*i+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,u=a.getView();1!=e&&(this.lastScaleDelta_=e);var c=a.getViewport().getBoundingClientRect(),h=Object(l.a)(this.targetPointers);h[0]-=c.left,h[1]-=c.top,this.anchor_=a.getCoordinateFromPixelInternal(h),a.render(),u.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,n),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(l.b);function q(t){var e=t||{},n=new i.a,r=new I(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&n.push(new g),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&n.push(new u({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&n.push(new c.a({onFocusOnly:e.onFocusOnly,kinetic:r})),(void 0===e.pinchRotate||e.pinchRotate)&&n.push(new D),(void 0===e.pinchZoom||e.pinchZoom)&&n.push(new G({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(n.push(new N),n.push(new L({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&n.push(new F({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&n.push(new _({duration:e.zoomDuration})),n}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(251);function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Object(r.a)(t,e)}},function(t,e,n){"use strict";function r(t,e,n,r){var i=n?n.call(r,t,e):void 0;if(void 0!==i)return!!i;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var o=Object.keys(t),s=Object.keys(e);if(o.length!==s.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(e),u=0;u=n[0]||(t[1]<=n[1]&&t[3]>=n[1]||Object(s.s)(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,n=this.flatCoordinates[e]-this.flatCoordinates[0],r=t.slice();r[e]=r[0]+n;for(var i=1;i=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,n=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===m.a.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),r=!1):this.freehand_&&e.type===m.a.POINTERDOWN?r=!1:n&&this.getPointerCount()<2?(r=e.type===m.a.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===m.a.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===m.a.DBLCLICK&&(r=!1),t.prototype.handleEvent.call(this,e)&&r},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new v.a(m.a.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var n=!this.finishCoordinate_;n&&this.startDrawing_(t.coordinate),!n&&this.freehand_?this.finishDrawing():this.freehand_||n&&this.mode_!==A||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,n=t.pixel,r=e[0]-n[0],i=e[1]-n[1],o=r*r+i*i;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var n=!1,r=[this.finishCoordinate_],i=this.mode_;if(i===A)e=!0;else if(i===F)e=2===this.sketchCoords_.length;else if(i===R)n=this.sketchCoords_.length>this.minPoints_;else if(i===T){var o=this.sketchCoords_;n=o[0].length>this.minPoints_,r=[o[0][0],o[0][o[0].length-2]]}if(n)for(var s=this.getMap(),a=0,u=r.length;a=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),this.geometryFunction_(n,r,i)):o===T&&((n=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),e&&(this.finishCoordinate_=n[0]),this.geometryFunction_(this.sketchCoords_,r,i)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;if(r===R||r===F){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var o=this.finishCoordinate_.slice();t[t.length-1]=o,this.createOrUpdateSketchPoint_(o)}this.geometryFunction_(t,e,n),e.getType()===i.a.POLYGON&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(r===T){(t=this.sketchCoords_[0]).splice(-2,1);var s=this.sketchLine_.getGeometry();if(t.length>=2){o=t[t.length-2].slice();t[t.length-1]=o,this.createOrUpdateSketchPoint_(o)}s.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,n)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,n=t.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===R?(e.pop(),this.geometryFunction_(e,n,r)):this.mode_===T&&(e[0].pop(),this.geometryFunction_(e,n,r),e=n.getCoordinates()),this.type_===i.a.MULTI_POINT?t.setGeometry(new b.a([e])):this.type_===i.a.MULTI_LINE_STRING?t.setGeometry(new _.a([e])):this.type_===i.a.MULTI_POLYGON&&t.setGeometry(new w.a([e])),this.dispatchEvent(new G(D,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new G(B,t))},e.prototype.appendCoordinates=function(t){var e,n=this.mode_,r=!this.sketchFeature_;if(r&&this.startDrawing_(t[0]),n===R||n===F)e=this.sketchCoords_;else{if(n!==T)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}r&&e.shift(),e.pop();for(var i=0;i=e.status}function i(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(n){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var o="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n&&n.global===n?n:void 0,s=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=o.saveAs||("object"!=typeof window||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(t,n,s){var a=o.URL||o.webkitURL,u=document.createElement("a");n=n||t.name||"download",u.download=n,u.rel="noopener","string"==typeof t?(u.href=t,u.origin===location.origin?i(u):r(u.href)?e(t,n,s):i(u,u.target="_blank")):(u.href=a.createObjectURL(t),setTimeout((function(){a.revokeObjectURL(u.href)}),4e4),setTimeout((function(){i(u)}),0))}:"msSaveOrOpenBlob"in navigator?function(t,n,o){if(n=n||t.name||"download","string"!=typeof t)navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t}(t,o),n);else if(r(t))e(t,n,o);else{var s=document.createElement("a");s.href=t,s.target="_blank",setTimeout((function(){i(s)}))}}:function(t,n,r,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof t)return e(t,n,r);var a="application/octet-stream"===t.type,u=/constructor/i.test(o.HTMLElement)||o.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||a&&u||s)&&"undefined"!=typeof FileReader){var l=new FileReader;l.onloadend=function(){var t=l.result;t=c?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=t:location=t,i=null},l.readAsDataURL(t)}else{var h=o.URL||o.webkitURL,f=h.createObjectURL(t);i?i.location=f:location.href=f,i=null,setTimeout((function(){h.revokeObjectURL(f)}),4e4)}});o.saveAs=a.saveAs=a,t.exports=a})?r.apply(e,i):r)||(t.exports=o)}).call(this,n(126))},,function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return c}));var r=n(7),i=n(259),o=n(138);function s(t,e,n,o,s){var a=Object(r.r)(Object(r.j)(),t,e,n,o);return!!Object(r.E)(s,a)&&(!!Object(r.g)(s,a)||(a[0]>=s[0]&&a[2]<=s[2]||(a[1]>=s[1]&&a[3]<=s[3]||Object(i.a)(t,e,n,o,(function(t,e){return Object(r.F)(s,t,e)})))))}function a(t,e,n,r,i){for(var o=0,a=n.length;o0?r:Math.max(a/l[0],o/l[1]),f=i+1,p=new Array(f),d=0;d0}function o(t,e,n,r,o){for(var s=void 0!==o&&o,a=0,u=n.length;a0?n[0]:null},e.prototype.readFeatureFromNode=function(t,e){return null},e.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var n=Object(v.p)(t);return this.readFeaturesFromDocument(n,e)}return Object(v.h)(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},e.prototype.readFeaturesFromDocument=function(t,e){for(var n=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&Object(y.c)(n,this.readFeaturesFromNode(r,e));return n},e.prototype.readFeaturesFromNode=function(t,e){return Object(g.b)()},e.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var n=Object(v.p)(t);return this.readGeometryFromDocument(n,e)}return Object(v.h)(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},e.prototype.readGeometryFromDocument=function(t,e){return null},e.prototype.readGeometryFromNode=function(t,e){return null},e.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=Object(v.p)(t);return this.readProjectionFromDocument(e)}return Object(v.h)(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},e.prototype.readProjectionFromDocument=function(t){return this.dataProjection},e.prototype.readProjectionFromNode=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){var n=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(n)},e.prototype.writeFeatureNode=function(t,e){return null},e.prototype.writeFeatures=function(t,e){var n=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(n)},e.prototype.writeFeaturesNode=function(t,e){return null},e.prototype.writeGeometry=function(t,e){var n=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(n)},e.prototype.writeGeometryNode=function(t,e){return null},e}(p.a),b=n(23),w=n(13),x=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),O="http://www.opengis.net/gml",E=/^[\s\xa0]*$/,S=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.featureType=r.featureType,n.featureNS=r.featureNS,n.srsName=r.srsName,n.schemaLocation="",n.FEATURE_COLLECTION_PARSERS={},n.FEATURE_COLLECTION_PARSERS[n.namespace]={featureMember:Object(v.i)(n.readFeaturesInternal),featureMembers:Object(v.m)(n.readFeaturesInternal)},n.supportedMediaTypes=["application/gml+xml"],n}return x(e,t),e.prototype.readFeaturesInternal=function(t,e){var n=t.localName,r=null;if("FeatureCollection"==n)r=Object(v.r)([],this.FEATURE_COLLECTION_PARSERS,t,e,this);else if("featureMembers"==n||"featureMember"==n||"member"==n){var i=e[0],o=i.featureType,s=i.featureNS;if(!o&&t.childNodes){o=[],s={};for(var a=0,u=t.childNodes.length;a0){o[u]={_content_:o[u]};for(var l=0;l=2,57),r}return z(e,t),e}(G),V=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Y=function(t){function e(e){return t.call(this,"And",Array.prototype.slice.call(arguments))||this}return V(e,t),e}(U),W=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),X=function(t){function e(e,n,r){var i=t.call(this,"BBOX")||this;if(i.geometryName=e,i.extent=n,4!==n.length)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");return i.srsName=r,i}return W(e,t),e}(G),H=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),K=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.geometryName=n||"the_geom",o.geometry=r,o.srsName=i,o}return H(e,t),e}(G),Z=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),J=(function(t){function e(e,n,r){return t.call(this,"Contains",e,n,r)||this}Z(e,t)}(K),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),$=(function(t){function e(e,n,r,i,o){var s=t.call(this,"DWithin",e,n,o)||this;return s.distance=r,s.unit=i,s}J(e,t)}(K),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Q=(function(t){function e(e,n,r){return t.call(this,"Disjoint",e,n,r)||this}$(e,t)}(K),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),tt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.propertyName=n,r}return Q(e,t),e}(G),et=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),nt=(function(t){function e(e,n,r){var i=t.call(this,"During",e)||this;return i.begin=n,i.end=r,i}et(e,t)}(tt),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),rt=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;return o.expression=r,o.matchCase=i,o}return nt(e,t),e}(tt),it=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ot=(function(t){function e(e,n,r){return t.call(this,"PropertyIsEqualTo",e,n,r)||this}it(e,t)}(rt),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),st=(function(t){function e(e,n){return t.call(this,"PropertyIsGreaterThan",e,n)||this}ot(e,t)}(rt),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),at=(function(t){function e(e,n){return t.call(this,"PropertyIsGreaterThanOrEqualTo",e,n)||this}st(e,t)}(rt),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),ut=(function(t){function e(e,n,r){return t.call(this,"Intersects",e,n,r)||this}at(e,t)}(K),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),ct=(function(t){function e(e,n,r){var i=t.call(this,"PropertyIsBetween",e)||this;return i.lowerBoundary=n,i.upperBoundary=r,i}ut(e,t)}(tt),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),lt=(function(t){function e(e,n,r,i,o,s){var a=t.call(this,"PropertyIsLike",e)||this;return a.pattern=n,a.wildCard=void 0!==r?r:"*",a.singleChar=void 0!==i?i:".",a.escapeChar=void 0!==o?o:"!",a.matchCase=s,a}ct(e,t)}(tt),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),ht=(function(t){function e(e){return t.call(this,"PropertyIsNull",e)||this}lt(e,t)}(tt),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),ft=(function(t){function e(e,n){return t.call(this,"PropertyIsLessThan",e,n)||this}ht(e,t)}(rt),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),pt=(function(t){function e(e,n){return t.call(this,"PropertyIsLessThanOrEqualTo",e,n)||this}ft(e,t)}(rt),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),dt=(function(t){function e(e){var n=t.call(this,"Not")||this;return n.condition=e,n}pt(e,t)}(G),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),gt=(function(t){function e(e,n,r){return t.call(this,"PropertyIsNotEqualTo",e,n,r)||this}dt(e,t)}(rt),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),yt=(function(t){function e(e){return t.call(this,"Or",Array.prototype.slice.call(arguments))||this}gt(e,t)}(U),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),vt=(function(t){function e(e){var n=t.call(this,"ResourceId")||this;return n.rid=e,n}yt(e,t)}(G),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}());!function(t){function e(e,n,r){return t.call(this,"Within",e,n,r)||this}vt(e,t)}(K);var mt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_t={"http://www.opengis.net/gml":{boundedBy:Object(v.l)(C.prototype.readGeometryElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:Object(v.i)(C.prototype.readFeaturesInternal)}},bt={"http://www.opengis.net/wfs":{totalInserted:Object(v.l)(M.e),totalUpdated:Object(v.l)(M.e),totalDeleted:Object(v.l)(M.e)},"http://www.opengis.net/wfs/2.0":{totalInserted:Object(v.l)(M.e),totalUpdated:Object(v.l)(M.e),totalDeleted:Object(v.l)(M.e)}},wt={"http://www.opengis.net/wfs":{TransactionSummary:Object(v.l)(jt,"transactionSummary"),InsertResults:Object(v.l)(Ft,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:Object(v.l)(jt,"transactionSummary"),InsertResults:Object(v.l)(Ft,"insertIds")}},xt={"http://www.opengis.net/wfs":{PropertyName:Object(v.j)(M.g)},"http://www.opengis.net/wfs/2.0":{PropertyName:Object(v.j)(M.g)}},Ot={"http://www.opengis.net/wfs":{Insert:Object(v.j)(kt),Update:Object(v.j)(qt),Delete:Object(v.j)(Gt),Property:Object(v.j)(zt),Native:Object(v.j)(Ut)},"http://www.opengis.net/wfs/2.0":{Insert:Object(v.j)(kt),Update:Object(v.j)(qt),Delete:Object(v.j)(Gt),Property:Object(v.j)(zt),Native:Object(v.j)(Ut)}},Et="http://www.w3.org/2000/xmlns/",St={"2.0.0":"http://www.opengis.net/ogc/1.1","1.1.0":"http://www.opengis.net/ogc","1.0.0":"http://www.opengis.net/ogc"},Ct={"2.0.0":"http://www.opengis.net/wfs/2.0","1.1.0":"http://www.opengis.net/wfs","1.0.0":"http://www.opengis.net/wfs"},Nt={"2.0.0":"http://www.opengis.net/fes/2.0","1.1.0":"http://www.opengis.net/fes","1.0.0":"http://www.opengis.net/fes"},Mt={"2.0.0":"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd","1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},Lt={"2.0.0":B,"1.1.0":F,"1.0.0":j},It=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.version_=r.version?r.version:"1.1.0",n.featureType_=r.featureType,n.featureNS_=r.featureNS,n.gmlFormat_=r.gmlFormat?r.gmlFormat:new Lt[n.version_],n.schemaLocation_=r.schemaLocation?r.schemaLocation:Mt[n.version_],n}return mt(e,t),e.prototype.getFeatureType=function(){return this.featureType_},e.prototype.setFeatureType=function(t){this.featureType_=t},e.prototype.readFeaturesFromNode=function(t,e){var n={node:t};Object(b.a)(n,{featureType:this.featureType_,featureNS:this.featureNS_}),Object(b.a)(n,this.getReadOptions(t,e||{}));var r,i=[n];r="2.0.0"===this.version_?_t:this.gmlFormat_.FEATURE_COLLECTION_PARSERS;var o=Object(v.r)([],r,t,i,this.gmlFormat_);return o||(o=[]),o},e.prototype.readTransactionResponse=function(t){if(t){if("string"==typeof t){var e=Object(v.p)(t);return this.readTransactionResponseFromDocument(e)}return Object(v.h)(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}},e.prototype.readFeatureCollectionMetadata=function(t){if(t){if("string"==typeof t){var e=Object(v.p)(t);return this.readFeatureCollectionMetadataFromDocument(e)}return Object(v.h)(t)?this.readFeatureCollectionMetadataFromDocument(t):this.readFeatureCollectionMetadataFromNode(t)}},e.prototype.readFeatureCollectionMetadataFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(e)},e.prototype.readFeatureCollectionMetadataFromNode=function(t){var e={},n=Object(M.d)(t.getAttribute("numberOfFeatures"));return e.numberOfFeatures=n,Object(v.r)(e,_t,t,[],this.gmlFormat_)},e.prototype.readTransactionResponseFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(e)},e.prototype.readTransactionResponseFromNode=function(t){return Object(v.r)({},wt,t,[])},e.prototype.writeGetFeature=function(t){var e=this,n=Object(v.c)(Ct[this.version_],"GetFeature");n.setAttribute("service","WFS"),n.setAttribute("version",this.version_),t.handle&&n.setAttribute("handle",t.handle),t.outputFormat&&n.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&n.setAttribute("maxFeatures",String(t.maxFeatures)),t.resultType&&n.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&n.setAttribute("startIndex",String(t.startIndex)),void 0!==t.count&&n.setAttribute("count",String(t.count)),void 0!==t.viewParams&&n.setAttribute("viewParams",t.viewParams),n.setAttributeNS(v.b,"xsi:schemaLocation",this.schemaLocation_);var r={node:n};if(Object(b.a)(r,{version:this.version_,srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.featureNS_,featurePrefix:t.featurePrefix,propertyNames:t.propertyNames?t.propertyNames:[]}),Object(q.a)(Array.isArray(t.featureTypes),11),"string"==typeof t.featureTypes[0]){var i=t.filter;t.bbox&&(Object(q.a)(t.geometryName,12),i=this.combineBboxAndFilter(t.geometryName,t.bbox,t.srsName,i)),Object(b.a)(r,{geometryName:t.geometryName,filter:i}),ae(n,t.featureTypes,[r])}else t.featureTypes.forEach((function(i){var o=e.combineBboxAndFilter(i.geometryName,i.bbox,t.srsName,t.filter);Object(b.a)(r,{geometryName:i.geometryName,filter:o}),ae(n,[i.name],[r])}));return n},e.prototype.combineBboxAndFilter=function(t,e,n,r){var i=function(t,e,n){return new X(t,e,n)}(t,e,n);return r?function(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(Y,e))}(r,i):i},e.prototype.writeTransaction=function(t,e,n,r){var i,o=[],s=r.version?r.version:this.version_,a=Object(v.c)(Ct[s],"Transaction");a.setAttribute("service","WFS"),a.setAttribute("version",s),r&&(i=r.gmlOptions?r.gmlOptions:{},r.handle&&a.setAttribute("handle",r.handle)),a.setAttributeNS(v.b,"xsi:schemaLocation",Mt[s]);var u=function(t,e,n,r){var i,o=r.featurePrefix?r.featurePrefix:"feature";"1.0.0"===n?i=2:"1.1.0"===n?i=3:"2.0.0"===n&&(i=3.2);return Object(b.a)({node:t},{version:n,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:o,gmlVersion:i,hasZ:r.hasZ,srsName:r.srsName},e)}(a,i,s,r);return t&&Pt("Insert",t,o,u),e&&Pt("Update",e,o,u),n&&Pt("Delete",n,o,u),r.nativeElements&&Pt("Native",r.nativeElements,o,u),a},e.prototype.readProjectionFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(e);return null},e.prototype.readProjectionFromNode=function(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(var e=(t=t.firstElementChild.firstElementChild).firstElementChild;e;e=e.nextElementSibling)if(0!==e.childNodes.length&&(1!==e.childNodes.length||3!==e.firstChild.nodeType)){var n=[{}];return this.gmlFormat_.readGeometryElement(e,n),Object(w.g)(n.pop().srsName)}return null},e}(_);function Pt(t,e,n,r){Object(v.s)(r,Ot,Object(v.n)(t),e,n)}function jt(t,e){return Object(v.r)({},bt,t,e)}var At={"http://www.opengis.net/ogc":{FeatureId:Object(v.i)((function(t,e){return t.getAttribute("fid")}))},"http://www.opengis.net/ogc/1.1":{FeatureId:Object(v.i)((function(t,e){return t.getAttribute("fid")}))}};function Rt(t,e){Object(v.q)(At,t,e)}var Tt={"http://www.opengis.net/wfs":{Feature:Rt},"http://www.opengis.net/wfs/2.0":{Feature:Rt}};function Ft(t,e){return Object(v.r)([],Tt,t,e)}function kt(t,e,n){var r=n[n.length-1],i=r.featureType,o=r.featureNS,s=r.gmlVersion,a=Object(v.c)(o,i);t.appendChild(a),2===s?j.prototype.writeFeatureElement(a,e,n):3===s?F.prototype.writeFeatureElement(a,e,n):B.prototype.writeFeatureElement(a,e,n)}function Dt(t,e,n){var r=n[n.length-1].version,i=St[r],o=Object(v.c)(i,"Filter"),s=Object(v.c)(i,"FeatureId");o.appendChild(s),s.setAttribute("fid",e),t.appendChild(o)}function Bt(t,e){var n=(t=t||"feature")+":";return 0===e.indexOf(n)?e:n+e}function Gt(t,e,n){var r=n[n.length-1];Object(q.a)(void 0!==e.getId(),26);var i=r.featureType,o=r.featurePrefix,s=r.featureNS,a=Bt(o,i);t.setAttribute("typeName",a),t.setAttributeNS(Et,"xmlns:"+o,s);var u=e.getId();void 0!==u&&Dt(t,u,n)}function qt(t,e,n){var r=n[n.length-1];Object(q.a)(void 0!==e.getId(),27);var i=r.version,o=r.featureType,s=r.featurePrefix,a=r.featureNS,u=Bt(s,o),c=e.getGeometryName();t.setAttribute("typeName",u),t.setAttributeNS(Et,"xmlns:"+s,a);var l=e.getId();if(void 0!==l){for(var h=e.getKeys(),f=[],p=0,d=h.length;p1?u:2,x=a||new Array(w);for(y=0;y>1;othis.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var n=this.cache_[e];0!=(3&t++)||n.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,n){var r=o(t,e,n);return r in this.cache_?this.cache_[r]:null},t.prototype.set=function(t,e,n,r){var i=o(t,e,n);this.cache_[i]=r,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}();function o(t,e,n){return e+":"+t+":"+(n?Object(r.b)(n):"null")}var s=new i},,function(t,e,n){"use strict";function r(t,e){var n=[];Object.keys(e).forEach((function(t){null!==e[t]&&void 0!==e[t]&&n.push(t+"="+encodeURIComponent(e[t]))}));var r=n.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+r}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r,i=n(71),o=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.map=n,i.frameState=void 0!==r?r:null,i}return o(e,t),e}(i.a);e.a=s},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s}));var r=n(0),i=!!r.useInsertionEffect&&r.useInsertionEffect,o=i||function(t){return t()},s=i||r.useLayoutEffect},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},i=n(295),o=/[A-Z]|^ms/g,s=/_EMO_([^_]+?)_([^]*?)_EMO_/g,a=function(t){return 45===t.charCodeAt(1)},u=function(t){return null!=t&&"boolean"!=typeof t},c=Object(i.a)((function(t){return a(t)?t:t.replace(o,"-$&").toLowerCase()})),l=function(t,e){switch(t){case"animation":case"animationName":if("string"==typeof e)return e.replace(s,(function(t,e,n){return f={name:e,styles:n,next:f},e}))}return 1===r[t]||a(t)||"number"!=typeof e||0===e?e:e+"px"};function h(t,e,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return f={name:n.name,styles:n.styles,next:f},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)f={name:r.name,styles:r.styles,next:f},r=r.next;return n.styles+";"}return function(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i=4;++r,i-=4)e=1540483477*(65535&(e=255&t.charCodeAt(r)|(255&t.charCodeAt(++r))<<8|(255&t.charCodeAt(++r))<<16|(255&t.charCodeAt(++r))<<24))+(59797*(e>>>16)<<16),n=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&t.charCodeAt(r+2))<<16;case 2:n^=(255&t.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(i)+u,styles:i,next:f}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return C}));var r,i=n(71),o=n(38),s=n(94),a=n(28),u=n(202),c=n(269),l=n(155),h=n(7),f=n(27),p=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e,n,r,i,a,u,f){var p=this,d=e.getExtent(),g=n.getExtent(),y=g?Object(h.A)(r,g):r,v=Object(h.w)(y),m=Object(l.b)(e,n,v,i),_=s.b,b=new c.a(e,n,y,d,m*_,i),w=u(b.calculateSourceExtent(),m,a),x=w?o.a.IDLE:o.a.EMPTY,O=w?w.getPixelRatio():1;return(p=t.call(this,r,i,O,x)||this).targetProj_=n,p.maxSourceExtent_=d,p.triangulation_=b,p.targetResolution_=i,p.targetExtent_=r,p.sourceImage_=w,p.sourcePixelRatio_=O,p.contextOptions_=f,p.canvas_=null,p.sourceListenerKey_=null,p}return p(e,t),e.prototype.disposeInternal=function(){this.state==o.a.LOADING&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==o.a.LOADED){var e=Object(h.D)(this.targetExtent_)/this.targetResolution_,n=Object(h.z)(this.targetExtent_)/this.targetResolution_;this.canvas_=Object(l.c)(e,n,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.contextOptions_)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==o.a.IDLE){this.state=o.a.LOADING,this.changed();var t=this.sourceImage_.getState();t==o.a.LOADED||t==o.a.ERROR?this.reproject_():(this.sourceListenerKey_=Object(f.a)(this.sourceImage_,a.a.CHANGE,(function(t){var e=this.sourceImage_.getState();e!=o.a.LOADED&&e!=o.a.ERROR||(this.unlistenSource_(),this.reproject_())}),this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){Object(f.c)(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(u.a),g=n(201),y=n(114),v=n(20),m=n(13),_=n(36),b=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),w="imageloadstart",x="imageloadend",O="imageloaderror",E=function(t){function e(e,n){var r=t.call(this,e)||this;return r.image=n,r}return b(e,t),e}(i.a),S=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state})||this;return n.on,n.once,n.un,n.resolutions_=void 0!==e.resolutions?e.resolutions:null,n.reprojectedImage_=null,n.reprojectedRevision_=0,n.contextOptions_=!1===e.imageSmoothing?y.b:void 0,n}return b(e,t),e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=Object(_.f)(this.resolutions_,t,0);t=this.resolutions_[e]}return t},e.prototype.getImage=function(t,e,n,r){var i=this.getProjection();if(s.a&&i&&r&&!Object(m.c)(i,r)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Object(m.c)(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==e&&Object(h.o)(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new d(i,r,t,e,n,function(t,e,n){return this.getImageInternal(t,e,n,i)}.bind(this),this.contextOptions_),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return i&&(r=i),this.getImageInternal(t,e,n,r)},e.prototype.getImageInternal=function(t,e,n,r){return Object(v.b)()},e.prototype.handleImageChange=function(t){var e=t.target;switch(e.getState()){case o.a.LOADING:this.loading=!0,this.dispatchEvent(new E(w,e));break;case o.a.LOADED:this.loading=!1,this.dispatchEvent(new E(x,e));break;case o.a.ERROR:this.loading=!1,this.dispatchEvent(new E(O,e))}},e}(g.a);function C(t,e){t.getImage().src=e}e.a=S},,,function(t,e){function n(e){return t.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,c=[],l=!1,h=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):h=-1,c.length&&p())}function p(){if(!l){var t=a(f);l=!0;for(var e=c.length;e;){for(u=c,c=[];++h1)for(var n=1;n0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(i.b);e.a=l},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(t){var e=new WeakMap;return function(n){if(e.has(n))return e.get(n);var r=t(n);return e.set(n,r),r}}},,function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return o}));var r,i=!("undefined"==typeof window||!window.document||!window.document.createElement);function o(t){if((!r&&0!==r||t)&&i){var e=document.createElement("div");e.style.position="absolute",e.style.top="-9999px",e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e),r=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return r}},,function(t,e,n){"use strict";var r,i=n(53),o=n(15),s=n(87),a=n(119),u=n(7),c=n(111),l=n(136),h=n(80),f=n(199),p=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e,n){var r=t.call(this)||this;return r.maxDelta_=-1,r.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?r.setCoordinates(e,n):r.setFlatCoordinates(n,e),r}return p(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,n,r){return r=this.minZoom;){if(2===this.zoomFactor_?(s=Math.floor(s/2),a=Math.floor(a/2),o=Object(r.a)(s,s,a,a,n)):o=this.getTileRangeForExtentAndZ(u,c,n),e(c,o))return!0;--c}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,n){if(t[0]this.maxZoom||et.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1}))}(t)){var e=Object(g.a)(t);if(function(t){var e=p(t,"authority");if(e){var n=p(e,"epsg");return n&&_.indexOf(n)>-1}}(e))return v["EPSG:3857"];var n=function(t){var e=p(t,"extension");if(e)return p(e,"proj4")}(e);return n?d(n):e}return function(t){return"+"===t[0]}(t)?d(t):void 0},w=function(t,e){var n,r;if(t=t||{},!e)return t;for(r in e)void 0!==(n=e[r])&&(t[r]=n);return t},x=function(t,e,n){var r=t*e;return n/Math.sqrt(1-r*r)},O=function(t){return t<0?-1:1},E=function(t){return Math.abs(t)<=c?t:t-O(t)*u},S=function(t,e,n){var r=t*n,o=.5*t;return r=Math.pow((1-r)/(1+r),o),Math.tan(.5*(i-e))/r},C=function(t,e){for(var n,r,o=.5*t,s=i-2*Math.atan(e),a=0;a<=15;a++)if(n=t*Math.sin(s),s+=r=i-2*Math.atan(e*Math.pow((1-n)/(1+n),o))-s,Math.abs(r)<=1e-10)return s;return-9999};function N(t){return t}var M=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=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(t){var e,n,r=t.x,o=t.y;if(o*s>90&&o*s<-90&&r*s>180&&r*s<-180)return null;if(Math.abs(Math.abs(o)-i)<=1e-10)return null;if(this.sphere)e=this.x0+this.a*this.k0*E(r-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan(a+.5*o));else{var u=Math.sin(o),c=S(this.e,o,u);e=this.x0+this.a*this.k0*E(r-this.long0),n=this.y0-this.a*this.k0*Math.log(c)}return t.x=e,t.y=n,t},inverse:function(t){var e,n,r=t.x-this.x0,o=t.y-this.y0;if(this.sphere)n=i-2*Math.atan(Math.exp(-o/(this.a*this.k0)));else{var s=Math.exp(-o/(this.a*this.k0));if(-9999===(n=C(this.e,s)))return null}return e=E(this.long0+r/(this.a*this.k0)),t.x=e,t.y=n,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:N,inverse:N,names:["longlat","identity"]}],L={},I=[];function P(t,e){var n=I.length;return t.names?(I[n]=t,t.names.forEach((function(t){L[t.toLowerCase()]=n})),this):(console.log(e),!0)}var j={start:function(){M.forEach(P)},add:P,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==L[e]&&I[L[e]]?I[L[e]]:void 0}},A={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"}},R=A.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};A.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var T={};T.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},T.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},T.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},T.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},T.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},T.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},T.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},T.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},T.militargeographische_institut={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},T.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},T.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},T.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},T.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},T.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},T.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},T.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},T.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},T.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var F=function(t,e,n,i,o,s,a){var u={};return u.datum_type=void 0===t||"none"===t?5:4,e&&(u.datum_params=e.map(parseFloat),0===u.datum_params[0]&&0===u.datum_params[1]&&0===u.datum_params[2]||(u.datum_type=1),u.datum_params.length>3&&(0===u.datum_params[3]&&0===u.datum_params[4]&&0===u.datum_params[5]&&0===u.datum_params[6]||(u.datum_type=2,u.datum_params[3]*=r,u.datum_params[4]*=r,u.datum_params[5]*=r,u.datum_params[6]=u.datum_params[6]/1e6+1))),a&&(u.datum_type=3,u.grids=a),u.a=n,u.b=i,u.es=o,u.ep2=s,u},k={};function D(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:k[t]||null,isNull:!1}}function B(t){return t/3600*Math.PI/180}function G(t,e,n){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,n)))}function q(t){return t.map((function(t){return[B(t.longitudeShift),B(t.latitudeShift)]}))}function z(t,e,n){return{name:G(t,e+8,e+16).trim(),parent:G(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,n),upperLatitude:t.getFloat64(e+88,n),lowerLongitude:t.getFloat64(e+104,n),upperLongitude:t.getFloat64(e+120,n),latitudeInterval:t.getFloat64(e+136,n),longitudeInterval:t.getFloat64(e+152,n),gridNodeCount:t.getInt32(e+168,n)}}function U(t,e,n,r){for(var i=e+176,o=[],s=0;s-1.001*i)c=-i;else if(c>i&&c<1.001*i)c=i;else{if(c<-i)return{x:-1/0,y:-1/0,z:t.z};if(c>i)return{x:1/0,y:1/0,z:t.z}}return u>Math.PI&&(u-=2*Math.PI),o=Math.sin(c),a=Math.cos(c),s=o*o,{x:((r=n/Math.sqrt(1-e*s))+l)*a*Math.cos(u),y:(r+l)*a*Math.sin(u),z:(r*(1-e)+l)*o}}function X(t,e,n,r){var o,s,a,u,c,l,h,f,p,d,g,y,v,m,_,b=t.x,w=t.y,x=t.z?t.z:0;if(o=Math.sqrt(b*b+w*w),s=Math.sqrt(b*b+w*w+x*x),o/n<1e-12){if(m=0,s/n<1e-12)return i,_=-r,{x:t.x,y:t.y,z:t.z}}else m=Math.atan2(w,b);a=x/s,f=(u=o/s)*(1-e)*(c=1/Math.sqrt(1-e*(2-e)*u*u)),p=a*c,v=0;do{v++,l=e*(h=n/Math.sqrt(1-e*p*p))/(h+(_=o*f+x*p-h*(1-e*p*p))),y=(g=a*(c=1/Math.sqrt(1-l*(2-l)*u*u)))*f-(d=u*(1-l)*c)*p,f=d,p=g}while(y*y>1e-24&&v<30);return{x:m,y:Math.atan(g/Math.abs(d)),z:_}}function H(t){return 1===t||2===t}var K=function(t,e,n){if(function(t,e){return t.datum_type===e.datum_type&&(!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]))}(t,e))return n;if(5===t.datum_type||5===e.datum_type)return n;var r=t.a,i=t.es;if(3===t.datum_type){if(0!==Z(t,!1,n))return;r=6378137,i=.0066943799901413165}var o=e.a,s=e.b,a=e.es;if(3===e.datum_type&&(o=6378137,s=6356752.314,a=.0066943799901413165),i===a&&r===o&&!H(t.datum_type)&&!H(e.datum_type))return n;if((n=W(n,i,r),H(t.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x+n[0],y:t.y+n[1],z:t.z+n[2]};if(2===e){var r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],u=n[5],c=n[6];return{x:c*(t.x-u*t.y+a*t.z)+r,y:c*(u*t.x+t.y-s*t.z)+i,z:c*(-a*t.x+s*t.y+t.z)+o}}}(n,t.datum_type,t.datum_params)),H(e.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x-n[0],y:t.y-n[1],z:t.z-n[2]};if(2===e){var r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],u=n[5],c=n[6],l=(t.x-r)/c,h=(t.y-i)/c,f=(t.z-o)/c;return{x:l+u*h-a*f,y:-u*l+h+s*f,z:a*l-s*h+f}}}(n,e.datum_type,e.datum_params)),n=X(n,a,o,s),3===e.datum_type)&&0!==Z(e,!0,n))return;return n};function Z(t,e,n){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var r={x:-n.x,y:n.y},i={x:Number.NaN,y:Number.NaN},o=[];t:for(var a=0;ar.y||d>r.x||v1e-12&&Math.abs(s.y)>1e-12);if(u<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=E(o.x+n.ll[0]),r.y=o.y+n.ll[1]}else isNaN(o.x)||(r.x=t.x+o.x,r.y=t.y+o.y);return r}function $(t,e){var n,r={x:t.x/e.del[0],y:t.y/e.del[1]},i=Math.floor(r.x),o=Math.floor(r.y),s=r.x-1*i,a=r.y-1*o,u={x:Number.NaN,y:Number.NaN};if(i<0||i>=e.lim[0])return u;if(o<0||o>=e.lim[1])return u;n=o*e.lim[0]+i;var c=e.cvs[n][0],l=e.cvs[n][1];n++;var h=e.cvs[n][0],f=e.cvs[n][1];n+=e.lim[0];var p=e.cvs[n][0],d=e.cvs[n][1];n--;var g=e.cvs[n][0],y=e.cvs[n][1],v=s*a,m=s*(1-a),_=(1-s)*(1-a),b=(1-s)*a;return u.x=_*c+m*h+b*g+v*p,u.y=_*l+m*f+b*y+v*d,u}var Q=function(t,e,n){var r,i,o,s=n.x,a=n.y,u=n.z||0,c={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==n.z)switch(0===o?(r=s,i=-1!=="ew".indexOf(t.axis[o])?"x":"y"):1===o?(r=a,i=-1!=="ns".indexOf(t.axis[o])?"y":"x"):(r=u,i="z"),t.axis[o]){case"e":c[i]=r;break;case"w":c[i]=-r;break;case"n":c[i]=r;break;case"s":c[i]=-r;break;case"u":void 0!==n[i]&&(c.z=r);break;case"d":void 0!==n[i]&&(c.z=-r);break;default:return null}return c},tt=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e};function et(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function nt(t,e,n,r){var i,a=void 0!==(n=Array.isArray(n)?tt(n):{x:n.x,y:n.y,z:n.z,m:n.m}).z;if(function(t){et(t.x),et(t.y)}(n),t.datum&&e.datum&&function(t,e){return(1===t.datum.datum_type||2===t.datum.datum_type||3===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type||3===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(n=nt(t,i=new Y("WGS84"),n,r),t=i),r&&"enu"!==t.axis&&(n=Q(t,!1,n)),"longlat"===t.projName)n={x:n.x*o,y:n.y*o,z:n.z||0};else if(t.to_meter&&(n={x:n.x*t.to_meter,y:n.y*t.to_meter,z:n.z||0}),!(n=t.inverse(n)))return;if(t.from_greenwich&&(n.x+=t.from_greenwich),n=K(t.datum,e.datum,n))return e.from_greenwich&&(n={x:n.x-e.from_greenwich,y:n.y,z:n.z||0}),"longlat"===e.projName?n={x:n.x*s,y:n.y*s,z:n.z||0}:(n=e.forward(n),e.to_meter&&(n={x:n.x/e.to_meter,y:n.y/e.to_meter,z:n.z||0})),r&&"enu"!==e.axis?Q(e,!0,n):(n&&!a&&delete n.z,n)}var rt=Y("WGS84");function it(t,e,n,r){var i,o,s;return Array.isArray(n)?(i=nt(t,e,n,r)||{x:NaN,y:NaN},n.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof i.z?[i.x,i.y,i.z].concat(n.splice(3)):[i.x,i.y,n[2]].concat(n.splice(3)):[i.x,i.y].concat(n.splice(2)):[i.x,i.y]):(o=nt(t,e,n,r),2===(s=Object.keys(n)).length||s.forEach((function(r){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===r||"y"===r||"z"===r)return}else if("x"===r||"y"===r)return;o[r]=n[r]})),o)}function ot(t){return t instanceof Y?t:t.oProj?t.oProj:Y(t)}var st=function(t,e,n){t=ot(t);var r,i=!1;return void 0===e?(e=t,t=rt,i=!0):(void 0!==e.x||Array.isArray(e))&&(n=e,e=t,t=rt,i=!0),e=ot(e),n?it(t,e,n):(r={forward:function(n,r){return it(t,e,n,r)},inverse:function(n,r){return it(e,t,n,r)}},i&&(r.oProj=e),r)},at=73,ut=79,ct={forward:lt,inverse:function(t){var e=dt(vt(t.toUpperCase()));if(e.lat&&e.lon)return[e.lon,e.lat,e.lon,e.lat];return[e.left,e.bottom,e.right,e.top]},toPoint:ht};function lt(t,e){return e=e||5,function(t,e){var n="00000"+t.easting,r="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(p=t.easting,d=t.northing,g=t.zoneNumber,y=yt(g),v=Math.floor(p/1e5),m=Math.floor(d/1e5)%20,i=v,o=m,s=y,a=s-1,u="AJSAJS".charCodeAt(a),c="AFAFAF".charCodeAt(a),l=u+i-1,h=c+o,f=!1,l>90&&(l=l-90+65-1,f=!0),(l===at||uat||(l>at||uut||(l>ut||u90&&(l=l-90+65-1),h>86?(h=h-86+65-1,f=!0):f=!1,(h===at||cat||(h>at||cut||(h>ut||c86&&(h=h-86+65-1),String.fromCharCode(l)+String.fromCharCode(h))+n.substr(n.length-5,e)+r.substr(r.length-5,e);var i,o,s,a,u,c,l,h,f;var p,d,g,y,v,m}(function(t){var e,n,r,i,o,s,a,u=t.lat,c=t.lon,l=6378137,h=ft(u),f=ft(c);a=Math.floor((c+180)/6)+1,180===c&&(a=60);u>=56&&u<64&&c>=3&&c<12&&(a=32);u>=72&&u<84&&(c>=0&&c<9?a=31:c>=9&&c<21?a=33:c>=21&&c<33?a=35:c>=33&&c<42&&(a=37));s=ft(6*(a-1)-180+3),.006739496752268451,e=l/Math.sqrt(1-.00669438*Math.sin(h)*Math.sin(h)),n=Math.tan(h)*Math.tan(h),r=.006739496752268451*Math.cos(h)*Math.cos(h),i=Math.cos(h)*(f-s),o=l*(.9983242984503243*h-.002514607064228144*Math.sin(2*h)+2639046602129982e-21*Math.sin(4*h)-3.418046101696858e-9*Math.sin(6*h));var p=.9996*e*(i+(1-n+r)*i*i*i/6+(5-18*n+n*n+72*r-.39089081163157013)*i*i*i*i*i/120)+5e5,d=.9996*(o+e*Math.tan(h)*(i*i/2+(5-n+9*r+4*r*r)*i*i*i*i/24+(61-58*n+n*n+600*r-2.2240339282485886)*i*i*i*i*i*i/720));u<0&&(d+=1e7);return{northing:Math.round(d),easting:Math.round(p),zoneNumber:a,zoneLetter:gt(u)}}({lat:t[1],lon:t[0]}),e)}function ht(t){var e=dt(vt(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function ft(t){return t*(Math.PI/180)}function pt(t){return t/Math.PI*180}function dt(t){var e=t.northing,n=t.easting,r=t.zoneLetter,i=t.zoneNumber;if(i<0||i>60)return null;var o,s,a,u,c,l,h,f,p=6378137,d=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),g=n-5e5,y=e;r<"N"&&(y-=1e7),l=6*(i-1)-180+3,f=(h=y/.9996/6367449.145945056)+(3*d/2-27*d*d*d/32)*Math.sin(2*h)+(21*d*d/16-55*d*d*d*d/32)*Math.sin(4*h)+151*d*d*d/96*Math.sin(6*h),o=p/Math.sqrt(1-.00669438*Math.sin(f)*Math.sin(f)),s=Math.tan(f)*Math.tan(f),a=.006739496752268451*Math.cos(f)*Math.cos(f),u=.99330562*p/Math.pow(1-.00669438*Math.sin(f)*Math.sin(f),1.5),c=g/(.9996*o);var v=f-o*Math.tan(f)/u*(c*c/2-(5+3*s+10*a-4*a*a-.06065547077041606)*c*c*c*c/24+(61+90*s+298*a+45*s*s-1.6983531815716497-3*a*a)*c*c*c*c*c*c/720);v=pt(v);var m,_=(c-(1+2*s+a)*c*c*c/6+(5-2*a+28*s-3*a*a+.05391597401814761+24*s*s)*c*c*c*c*c/120)/Math.cos(f);if(_=l+pt(_),t.accuracy){var b=dt({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});m={top:b.lat,right:b.lon,bottom:v,left:_}}else m={lat:v,lon:_};return m}function gt(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function yt(t){var e=t%6;return 0===e&&(e=6),e}function vt(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,n=t.length,r=null,i="",o=0;!/[A-Z]/.test(e=t.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+t;i+=e,o++}var s=parseInt(i,10);if(0===o||o+3>n)throw"MGRSPoint bad conversion from: "+t;var a=t.charAt(o++);if(a<="A"||"B"===a||"Y"===a||a>="Z"||"I"===a||"O"===a)throw"MGRSPoint zone letter "+a+" not handled: "+t;r=t.substring(o,o+=2);for(var u=yt(s),c=function(t,e){var n="AJSAJS".charCodeAt(e-1),r=1e5,i=!1;for(;n!==t.charCodeAt(0);){if(++n===at&&n++,n===ut&&n++,n>90){if(i)throw"Bad character: "+t;n=65,i=!0}r+=1e5}return r}(r.charAt(0),u),l=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var n="AFAFAF".charCodeAt(e-1),r=0,i=!1;for(;n!==t.charCodeAt(0);){if(++n===at&&n++,n===ut&&n++,n>86){if(i)throw"Bad character: "+t;n=65,i=!0}r+=1e5}return r}(r.charAt(1),u);l0&&(f=1e5/Math.pow(10,g),p=t.substring(o,o+g),y=parseFloat(p)*f,d=t.substring(o+g),v=parseFloat(d)*f),{easting:y+c,northing:v+l,zoneLetter:a,zoneNumber:s,accuracy:f}}function mt(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function _t(t,e,n){if(!(this instanceof _t))return new _t(t,e,n);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var r=t.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=t,this.y=e,this.z=n||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}_t.fromMGRS=function(t){return new _t(ht(t))},_t.prototype.toMGRS=function(t){return lt([this.x,this.y],t)};var bt=_t,wt=.01068115234375,xt=function(t){var e=[];e[0]=1-t*(.25+t*(.046875+t*(.01953125+t*wt))),e[1]=t*(.75-t*(.046875+t*(.01953125+t*wt)));var n=t*t;return e[2]=n*(.46875-t*(.013020833333333334+.007120768229166667*t)),n*=t,e[3]=n*(.3645833333333333-.005696614583333333*t),e[4]=n*t*.3076171875,e},Ot=function(t,e,n,r){return n*=e,e*=e,r[0]*t-n*(r[1]+e*(r[2]+e*(r[3]+e*r[4])))},Et=function(t,e,n){for(var r=1/(1-e),i=t,o=20;o;--o){var s=Math.sin(i),a=1-e*s*s;if(i-=a=(Ot(i,s,Math.cos(i),n)-t)*(a*Math.sqrt(a))*r,Math.abs(a)<1e-10)return i}return i};var St={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=xt(this.es),this.ml0=Ot(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var e,n,r,i=t.x,o=t.y,s=E(i-this.long0),a=Math.sin(o),u=Math.cos(o);if(this.es){var c=u*s,l=Math.pow(c,2),h=this.ep2*Math.pow(u,2),f=Math.pow(h,2),p=Math.abs(u)>1e-10?Math.tan(o):0,d=Math.pow(p,2),g=Math.pow(d,2);e=1-this.es*Math.pow(a,2),c/=Math.sqrt(e);var y=Ot(o,a,u,this.en);n=this.a*(this.k0*c*(1+l/6*(1-d+h+l/20*(5-18*d+g+14*h-58*d*h+l/42*(61+179*g-g*d-479*d)))))+this.x0,r=this.a*(this.k0*(y-this.ml0+a*s*c/2*(1+l/12*(5-d+9*h+4*f+l/30*(61+g-58*d+270*h-330*d*h+l/56*(1385+543*g-g*d-3111*d))))))+this.y0}else{var v=u*Math.sin(s);if(Math.abs(Math.abs(v)-1)<1e-10)return 93;if(n=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,r=u*Math.cos(s)/Math.sqrt(1-Math.pow(v,2)),(v=Math.abs(r))>=1){if(v-1>1e-10)return 93;r=0}else r=Math.acos(r);o<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return t.x=n,t.y=r,t},inverse:function(t){var e,n,r,o,s=(t.x-this.x0)*(1/this.a),a=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+a/this.k0,n=Et(e,this.es,this.en),Math.abs(n)1e-10?Math.tan(n):0,h=this.ep2*Math.pow(c,2),f=Math.pow(h,2),p=Math.pow(l,2),d=Math.pow(p,2);e=1-this.es*Math.pow(u,2);var g=s*Math.sqrt(e)/this.k0,y=Math.pow(g,2);r=n-(e*=l)*y/(1-this.es)*.5*(1-y/12*(5+3*p-9*h*p+h-4*f-y/30*(61+90*p-252*h*p+45*d+46*h-y/56*(1385+3633*p+4095*d+1574*d*p)))),o=E(this.long0+g*(1-y/6*(1+2*p+h-y/20*(5+28*p+24*d+8*h*p+6*h-y/42*(61+662*p+1320*d+720*d*p))))/c)}else r=i*O(a),o=0;else{var v=Math.exp(s/this.k0),m=.5*(v-1/v),_=this.lat0+a/this.k0,b=Math.cos(_);e=Math.sqrt((1-Math.pow(b,2))/(1+Math.pow(m,2))),r=Math.asin(e),a<0&&(r=-r),o=0===m&&0===b?0:E(Math.atan2(m,b)+this.long0)}return t.x=o,t.y=r,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},Ct=function(t){var e=Math.exp(t);return e=(e-1/e)/2},Nt=function(t,e){t=Math.abs(t),e=Math.abs(e);var n=Math.max(t,e),r=Math.min(t,e)/(n||1);return n*Math.sqrt(1+Math.pow(r,2))},Mt=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,n=e-1;return 0===n?t:t*Math.log(e)/n}(e*(1+e/(Nt(1,e)+1))),t<0?-e:e},Lt=function(t,e){for(var n,r=2*Math.cos(2*e),i=t.length-1,o=t[i],s=0;--i>=0;)n=r*o-s+t[i],s=o,o=n;return e+n*Math.sin(2*e)},It=function(t,e,n){for(var r,i,o=Math.sin(e),s=Math.cos(e),a=Ct(n),u=function(t){var e=Math.exp(t);return e=(e+1/e)/2}(n),c=2*s*u,l=-2*o*a,h=t.length-1,f=t[h],p=0,d=0,g=0;--h>=0;)r=d,i=p,f=c*(d=f)-r-l*(p=g)+t[h],g=l*d-i+c*p;return[(c=o*u)*f-(l=s*a)*g,c*g+l*f]};var Pt={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&&(St.init.apply(this),this.forward=St.forward,this.inverse=St.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),n=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),n*=e,this.cgb[1]=n*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=n*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),n*=e,this.cgb[2]=n*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=n*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),n*=e,this.cgb[3]=n*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=n*(1237/630+e*(e*(-24832/14175)-2.4)),n*=e,this.cgb[4]=n*(4174/315+e*(-144838/6237)),this.cbg[4]=n*(-734/315+e*(109598/31185)),n*=e,this.cgb[5]=n*(601676/22275),this.cbg[5]=n*(444337/155925),n=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=n*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=n*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),n*=e,this.utg[2]=n*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=n*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),n*=e,this.utg[3]=n*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=n*(49561/161280+e*(-179/168+e*(6601661/7257600))),n*=e,this.utg[4]=n*(-4583/161280+e*(108847/3991680)),this.gtu[4]=n*(34729/80640+e*(-3418889/1995840)),n*=e,this.utg[5]=n*(-20648693/638668800),this.gtu[5]=.6650675310896665*n;var r=Lt(this.cbg,this.lat0);this.Zb=-this.Qn*(r+function(t,e){for(var n,r=2*Math.cos(e),i=t.length-1,o=t[i],s=0;--i>=0;)n=r*o-s+t[i],s=o,o=n;return Math.sin(e)*n}(this.gtu,2*r))},forward:function(t){var e=E(t.x-this.long0),n=t.y;n=Lt(this.cbg,n);var r=Math.sin(n),i=Math.cos(n),o=Math.sin(e),s=Math.cos(e);n=Math.atan2(r,s*i),e=Math.atan2(o*i,Nt(r,i*s)),e=Mt(Math.tan(e));var a,u,c=It(this.gtu,2*n,2*e);return n+=c[0],e+=c[1],Math.abs(e)<=2.623395162778?(a=this.a*(this.Qn*e)+this.x0,u=this.a*(this.Qn*n+this.Zb)+this.y0):(a=1/0,u=1/0),t.x=a,t.y=u,t},inverse:function(t){var e,n,r=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);if(i=(i-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var o=It(this.utg,2*i,2*r);i+=o[0],r+=o[1],r=Math.atan(Ct(r));var s=Math.sin(i),a=Math.cos(i),u=Math.sin(r),c=Math.cos(r);i=Math.atan2(s*c,Nt(u,c*a)),r=Math.atan2(u,c*a),e=E(r+this.long0),n=Lt(this.cgb,i)}else e=1/0,n=1/0;return t.x=e,t.y=n,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]};var jt={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(E(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*o,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Pt.init.apply(this),this.forward=Pt.forward,this.inverse=Pt.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},At=function(t,e){return Math.pow((1-t)/(1+t),e)};var Rt={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+a)/(Math.pow(Math.tan(.5*this.lat0+a),this.C)*At(this.e*t,this.ratexp))},forward:function(t){var e=t.x,n=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+a),this.C)*At(this.e*Math.sin(n),this.ratexp))-i,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,n=t.y,r=Math.pow(Math.tan(.5*n+a)/this.K,1/this.C),o=20;o>0&&(n=2*Math.atan(r*At(this.e*Math.sin(t.y),-.5*this.e))-i,!(Math.abs(n-t.y)<1e-14));--o)t.y=n;return o?(t.x=e,t.y=n,t):null},names:["gauss"]};var Tt={init:function(){Rt.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,n,r,i;return t.x=E(t.x-this.long0),Rt.forward.apply(this,[t]),e=Math.sin(t.y),n=Math.cos(t.y),r=Math.cos(t.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*n*r),t.x=i*n*Math.sin(t.x),t.y=i*(this.cosc0*e-this.sinc0*n*r),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,n,r,i,o;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,o=Nt(t.x,t.y)){var s=2*Math.atan2(o,this.R2);e=Math.sin(s),n=Math.cos(s),i=Math.asin(n*this.sinc0+t.y*e*this.cosc0/o),r=Math.atan2(t.x*e,o*this.cosc0*n-t.y*this.sinc0*e)}else i=this.phic0,r=0;return t.x=r,t.y=i,Rt.inverse.apply(this,[t]),t.x=E(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var Ft={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)<=1e-10&&(this.k0=.5*(1+O(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(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)<=1e-10&&Math.abs(Math.cos(this.lat_ts))>1e-10&&(this.k0=.5*this.cons*x(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/S(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))-i,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,n,r,o,s,a,u=t.x,c=t.y,l=Math.sin(c),h=Math.cos(c),f=E(u-this.long0);return Math.abs(Math.abs(u-this.long0)-Math.PI)<=1e-10&&Math.abs(c+this.lat0)<=1e-10?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*l+this.coslat0*h*Math.cos(f)),t.x=this.a*e*h*Math.sin(f)+this.x0,t.y=this.a*e*(this.coslat0*l-this.sinlat0*h*Math.cos(f))+this.y0,t):(n=2*Math.atan(this.ssfn_(c,l,this.e))-i,o=Math.cos(n),r=Math.sin(n),Math.abs(this.coslat0)<=1e-10?(s=S(this.e,c*this.con,this.con*l),a=2*this.a*this.k0*s/this.cons,t.x=this.x0+a*Math.sin(u-this.long0),t.y=this.y0-this.con*a*Math.cos(u-this.long0),t):(Math.abs(this.sinlat0)<1e-10?(e=2*this.a*this.k0/(1+o*Math.cos(f)),t.y=e*r):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*o*Math.cos(f))),t.y=e*(this.cosX0*r-this.sinX0*o*Math.cos(f))+this.y0),t.x=e*o*Math.sin(f)+this.x0,t))},inverse:function(t){var e,n,r,o,s;t.x-=this.x0,t.y-=this.y0;var a=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var u=2*Math.atan(a/(2*this.a*this.k0));return e=this.long0,n=this.lat0,a<=1e-10?(t.x=e,t.y=n,t):(n=Math.asin(Math.cos(u)*this.sinlat0+t.y*Math.sin(u)*this.coslat0/a),e=Math.abs(this.coslat0)<1e-10?this.lat0>0?E(this.long0+Math.atan2(t.x,-1*t.y)):E(this.long0+Math.atan2(t.x,t.y)):E(this.long0+Math.atan2(t.x*Math.sin(u),a*this.coslat0*Math.cos(u)-t.y*this.sinlat0*Math.sin(u))),t.x=e,t.y=n,t)}if(Math.abs(this.coslat0)<=1e-10){if(a<=1e-10)return n=this.lat0,e=this.long0,t.x=e,t.y=n,t;t.x*=this.con,t.y*=this.con,r=a*this.cons/(2*this.a*this.k0),n=this.con*C(this.e,r),e=this.con*E(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else o=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,a<=1e-10?s=this.X0:(s=Math.asin(Math.cos(o)*this.sinX0+t.y*Math.sin(o)*this.cosX0/a),e=E(this.long0+Math.atan2(t.x*Math.sin(o),a*this.cosX0*Math.cos(o)-t.y*this.sinX0*Math.sin(o)))),n=-1*C(this.e,Math.tan(.5*(i+s)));return t.x=e,t.y=n,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],ssfn_:function(t,e,n){return e*=n,Math.tan(.5*(i+t))*Math.pow((1-e)/(1+e),.5*n)}};var kt={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),n=this.a,r=1/this.rf,i=2*r-Math.pow(r,2),o=this.e=Math.sqrt(i);this.R=this.k0*n*Math.sqrt(1-i)/(1-i*Math.pow(e,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var s=Math.log(Math.tan(Math.PI/4+this.b0/2)),a=Math.log(Math.tan(Math.PI/4+t/2)),u=Math.log((1+o*e)/(1-o*e));this.K=s-this.alpha*a+this.alpha*o/2*u},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),r=-this.alpha*(e+n)+this.K,i=2*(Math.atan(Math.exp(r))-Math.PI/4),o=this.alpha*(t.x-this.lambda0),s=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(o))),a=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(o));return t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,t.x=this.R*s+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,n=t.y-this.y0,r=e/this.R,i=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(r)),s=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(i))),a=this.lambda0+s/this.alpha,u=0,c=o,l=-1e3,h=0;Math.abs(c-l)>1e-7;){if(++h>20)return;u=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),l=c,c=2*Math.atan(Math.exp(u))-Math.PI/2}return t.x=a,t.y=c,t},names:["somerc"]};var Dt={init:function(){var t,e,n,r,s,c,l,h,f,p,d,g,y,v=0,m=0,_=0,b=0,w=0,x=0,O=0;this.no_off=(y="object"==typeof(g=this).PROJECTION?Object.keys(g.PROJECTION)[0]:g.PROJECTION,"no_uoff"in g||"no_off"in g||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(y)),this.no_rot="no_rot"in this;var C=!1;"alpha"in this&&(C=!0);var N=!1;if("rectified_grid_angle"in this&&(N=!0),C&&(O=this.alpha),N&&(v=this.rectified_grid_angle*o),C||N)m=this.longc;else if(_=this.long1,w=this.lat1,b=this.long2,x=this.lat2,Math.abs(w-x)<=1e-7||(t=Math.abs(w))<=1e-7||Math.abs(t-i)<=1e-7||Math.abs(Math.abs(this.lat0)-i)<=1e-7||Math.abs(Math.abs(x)-i)<=1e-7)throw new Error;var M=1-this.es;e=Math.sqrt(M),Math.abs(this.lat0)>1e-10?(h=Math.sin(this.lat0),n=Math.cos(this.lat0),t=1-this.es*h*h,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/M),this.A=this.B*this.k0*e/t,(s=(r=this.B*e/(n*Math.sqrt(t)))*r-1)<=0?s=0:(s=Math.sqrt(s),this.lat0<0&&(s=-s)),this.E=s+=r,this.E*=Math.pow(S(this.e,this.lat0,h),this.B)):(this.B=1/e,this.A=this.k0,this.E=r=s=1),C||N?(C?(d=Math.asin(Math.sin(O)/r),N||(v=O)):(d=v,O=Math.asin(r*Math.sin(d))),this.lam0=m-Math.asin(.5*(s-1/s)*Math.tan(d))/this.B):(c=Math.pow(S(this.e,w,Math.sin(w)),this.B),l=Math.pow(S(this.e,x,Math.sin(x)),this.B),s=this.E/c,f=(l-c)/(l+c),p=((p=this.E*this.E)-l*c)/(p+l*c),(t=_-b)<-Math.pi?b-=u:t>Math.pi&&(b+=u),this.lam0=E(.5*(_+b)-Math.atan(p*Math.tan(.5*this.B*(_-b))/f)/this.B),d=Math.atan(2*Math.sin(this.B*E(_-this.lam0))/(s-1/s)),v=O=Math.asin(r*Math.sin(d))),this.singam=Math.sin(d),this.cosgam=Math.cos(d),this.sinrot=Math.sin(v),this.cosrot=Math.cos(v),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(O))),this.lat0<0&&(this.u_0=-this.u_0)),s=.5*d,this.v_pole_n=this.ArB*Math.log(Math.tan(a-s)),this.v_pole_s=this.ArB*Math.log(Math.tan(a+s))},forward:function(t){var e,n,r,o,s,a,u,c,l={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-i)>1e-10){if(e=.5*((s=this.E/Math.pow(S(this.e,t.y,Math.sin(t.y)),this.B))-(a=1/s)),n=.5*(s+a),o=Math.sin(this.B*t.x),r=(e*this.singam-o*this.cosgam)/n,Math.abs(Math.abs(r)-1)<1e-10)throw new Error;c=.5*this.ArB*Math.log((1-r)/(1+r)),a=Math.cos(this.B*t.x),u=Math.abs(a)<1e-7?this.A*t.x:this.ArB*Math.atan2(e*this.cosgam+o*this.singam,a)}else c=t.y>0?this.v_pole_n:this.v_pole_s,u=this.ArB*t.y;return this.no_rot?(l.x=u,l.y=c):(u-=this.u_0,l.x=c*this.cosrot+u*this.sinrot,l.y=u*this.cosrot-c*this.sinrot),l.x=this.a*l.x+this.x0,l.y=this.a*l.y+this.y0,l},inverse:function(t){var e,n,r,o,s,a,u,c={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(n=t.y,e=t.x):(n=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),o=.5*((r=Math.exp(-this.BrA*n))-1/r),s=.5*(r+1/r),u=((a=Math.sin(this.BrA*e))*this.cosgam+o*this.singam)/s,Math.abs(Math.abs(u)-1)<1e-10)c.x=0,c.y=u<0?-i:i;else{if(c.y=this.E/Math.sqrt((1+u)/(1-u)),c.y=C(this.e,Math.pow(c.y,1/this.B)),c.y===1/0)throw new Error;c.x=-this.rB*Math.atan2(o*this.cosgam-a*this.singam,Math.cos(this.BrA*e))}return c.x+=this.lam0,c},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)<1e-10)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),n=Math.cos(this.lat1),r=x(this.e,e,n),i=S(this.e,this.lat1,e),o=Math.sin(this.lat2),s=Math.cos(this.lat2),a=x(this.e,o,s),u=S(this.e,this.lat2,o),c=S(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>1e-10?this.ns=Math.log(r/a)/Math.log(i/u):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=r/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,n=t.y;Math.abs(2*Math.abs(n)-Math.PI)<=1e-10&&(n=O(n)*(i-2e-10));var r,o,s=Math.abs(Math.abs(n)-i);if(s>1e-10)r=S(this.e,n,Math.sin(n)),o=this.a*this.f0*Math.pow(r,this.ns);else{if((s=n*this.ns)<=0)return null;o=0}var a=this.ns*E(e-this.long0);return t.x=this.k0*(o*Math.sin(a))+this.x0,t.y=this.k0*(this.rh-o*Math.cos(a))+this.y0,t},inverse:function(t){var e,n,r,o,s,a=(t.x-this.x0)/this.k0,u=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(a*a+u*u),n=1):(e=-Math.sqrt(a*a+u*u),n=-1);var c=0;if(0!==e&&(c=Math.atan2(n*a,n*u)),0!==e||this.ns>0){if(n=1/this.ns,r=Math.pow(e/(this.a*this.f0),n),-9999===(o=C(this.e,r)))return null}else o=-i;return s=E(c/this.ns+this.long0),t.x=s,t.y=o,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};var Gt={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,n,r,i,o,s,a,u=t.x,c=t.y,l=E(u-this.long0);return e=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/e)-this.s45),r=-l*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),o=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),s=this.n*o,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),t.y=a*Math.cos(s)/1,t.x=a*Math.sin(s)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,n,r,i,o,s,a,u=t.x;t.x=t.y,t.y=u,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),i=Math.atan2(t.y,t.x)/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),n=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(e)),t.x=this.long0-n/this.alfa,s=e,a=0;var c=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(s))/(1-this.e*Math.sin(s)),this.e/2))-this.s45),Math.abs(s-t.y)<1e-10&&(a=1),s=t.y,c+=1}while(0===a&&c<15);return c>=15?null:t},names:["Krovak","krovak"]},qt=function(t,e,n,r,i){return t*i-e*Math.sin(2*i)+n*Math.sin(4*i)-r*Math.sin(6*i)},zt=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))},Ut=function(t){return.375*t*(1+.25*t*(1+.46875*t))},Vt=function(t){return.05859375*t*t*(1+.75*t)},Yt=function(t){return t*t*t*(35/3072)},Wt=function(t,e,n){var r=e*n;return t/Math.sqrt(1-r*r)},Xt=function(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(n=t*e)*n)-.5/t*Math.log((1-n)/(1+n))):2*e};var Jt={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-i)<1e-10?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<1e-10?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=Zt(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,n=[];return n[0]=.3333333333333333*t,e=t*t,n[0]+=.17222222222222222*e,n[1]=.06388888888888888*e,e*=t,n[0]+=.10257936507936508*e,n[1]+=.0664021164021164*e,n[2]=.016415012942191543*e,n}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Zt(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,n,r,o,s,u,c,l,h,f,p=t.x,d=t.y;if(p=E(p-this.long0),this.sphere){if(s=Math.sin(d),f=Math.cos(d),r=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((n=this.mode===this.EQUIT?1+f*r:1+this.sinph0*s+this.cosph0*f*r)<=1e-10)return null;e=(n=Math.sqrt(2/n))*f*Math.sin(p),n*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*f*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(d+this.lat0)<1e-10)return null;n=a-.5*d,e=(n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)))*Math.sin(p),n*=r}}else{switch(c=0,l=0,h=0,r=Math.cos(p),o=Math.sin(p),s=Math.sin(d),u=Zt(this.e,s),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(c=u/this.qp,l=Math.sqrt(1-c*c)),this.mode){case this.OBLIQ:h=1+this.sinb1*c+this.cosb1*l*r;break;case this.EQUIT:h=1+l*r;break;case this.N_POLE:h=i+d,u=this.qp-u;break;case this.S_POLE:h=d-i,u=this.qp+u}if(Math.abs(h)<1e-10)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:h=Math.sqrt(2/h),n=this.mode===this.OBLIQ?this.ymf*h*(this.cosb1*c-this.sinb1*l*r):(h=Math.sqrt(2/(1+l*r)))*c*this.ymf,e=this.xmf*h*l*o;break;case this.N_POLE:case this.S_POLE:u>=0?(e=(h=Math.sqrt(u))*o,n=r*(this.mode===this.S_POLE?h:-h)):e=n=0}}return t.x=this.a*e+this.x0,t.y=this.a*n+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,n,r,o,s,a,u,c,l,h,f=t.x/this.a,p=t.y/this.a;if(this.sphere){var d,g=0,y=0;if((n=.5*(d=Math.sqrt(f*f+p*p)))>1)return null;switch(n=2*Math.asin(n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(y=Math.sin(n),g=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(d)<=1e-10?0:Math.asin(p*y/d),f*=y,p=g*d;break;case this.OBLIQ:n=Math.abs(d)<=1e-10?this.lat0:Math.asin(g*this.sinph0+p*y*this.cosph0/d),f*=y*this.cosph0,p=(g-Math.sin(n)*this.sinph0)*d;break;case this.N_POLE:p=-p,n=i-n;break;case this.S_POLE:n-=i}e=0!==p||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(f,p):0}else{if(u=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(f/=this.dd,p*=this.dd,(a=Math.sqrt(f*f+p*p))<1e-10)return t.x=this.long0,t.y=this.lat0,t;o=2*Math.asin(.5*a/this.rq),r=Math.cos(o),f*=o=Math.sin(o),this.mode===this.OBLIQ?(u=r*this.sinb1+p*o*this.cosb1/a,s=this.qp*u,p=a*this.cosb1*r-p*this.sinb1*o):(u=p*o/a,s=this.qp*u,p=a*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(p=-p),!(s=f*f+p*p))return t.x=this.long0,t.y=this.lat0,t;u=1-s/this.qp,this.mode===this.S_POLE&&(u=-u)}e=Math.atan2(f,p),c=Math.asin(u),l=this.apa,h=c+c,n=c+l[0]*Math.sin(h)+l[1]*Math.sin(h+h)+l[2]*Math.sin(h+h+h)}return t.x=E(this.long0+e),t.y=n,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},$t=function(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)};var Qt={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(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=Zt(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=Zt(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=Zt(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>1e-10?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,n=t.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var r=Zt(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,o=this.ns0*E(e-this.long0),s=i*Math.sin(o)+this.x0,a=this.rh-i*Math.cos(o)+this.y0;return t.x=s,t.y=a,t},inverse:function(t){var e,n,r,i,o,s;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),r=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1),i=0,0!==e&&(i=Math.atan2(r*t.x,r*t.y)),r=e*this.ns0/this.a,this.sphere?s=Math.asin((this.c-r*r)/(2*this.ns0)):(n=(this.c-r*r)/this.ns0,s=this.phi1z(this.e3,n)),o=E(i/this.ns0+this.long0),t.x=o,t.y=s,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var n,r,i,o,s=$t(.5*e);if(t<1e-10)return s;for(var a=t*t,u=1;u<=25;u++)if(s+=o=.5*(i=1-(r=t*(n=Math.sin(s)))*r)*i/Math.cos(s)*(e/(1-a)-n/i+.5/t*Math.log((1-r)/(1+r))),Math.abs(o)<=1e-7)return s;return null}};var te={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(t){var e,n,r,i,o,s,a,u=t.x,c=t.y;return r=E(u-this.long0),e=Math.sin(c),n=Math.cos(c),i=Math.cos(r),1,(o=this.sin_p14*e+this.cos_p14*n*i)>0||Math.abs(o)<=1e-10?(s=this.x0+1*this.a*n*Math.sin(r)/o,a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*i)/o):(s=this.x0+this.infinity_dist*n*Math.sin(r),a=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*n*i)),t.x=s,t.y=a,t},inverse:function(t){var e,n,r,i,o,s;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(i=Math.atan2(e,this.rc),n=Math.sin(i),r=Math.cos(i),s=$t(r*this.sin_p14+t.y*n*this.cos_p14/e),o=Math.atan2(t.x*n,e*this.cos_p14*r-t.y*this.sin_p14*n),o=E(this.long0+o)):(s=this.phic0,o=0),t.x=o,t.y=s,t},names:["gnom"]};var ee={init:function(){this.sphere||(this.k0=x(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,n,r=t.x,i=t.y,o=E(r-this.long0);if(this.sphere)e=this.x0+this.a*o*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var s=Zt(this.e,Math.sin(i));e=this.x0+this.a*this.k0*o,n=this.y0+this.a*s*.5/this.k0}return t.x=e,t.y=n,t},inverse:function(t){var e,n;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=E(this.long0+t.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(n=function(t,e){var n=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-n)<1e-6)return e<0?-1*i:i;for(var r,o,s,a,u=Math.asin(.5*e),c=0;c<30;c++)if(o=Math.sin(u),s=Math.cos(u),a=t*o,u+=r=Math.pow(1-a*a,2)/(2*s)*(e/(1-t*t)-o/(1-a*a)+.5/t*Math.log((1-a)/(1+a))),Math.abs(r)<=1e-10)return u;return NaN}(this.e,2*t.y*this.k0/this.a),e=E(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=n,t},names:["cea"]};var ne={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,n=t.y,r=E(e-this.long0),i=Xt(n-this.lat0);return t.x=this.x0+this.a*r*this.rc,t.y=this.y0+this.a*i,t},inverse:function(t){var e=t.x,n=t.y;return t.x=E(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=Xt(this.lat0+(n-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]};var re={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=zt(this.es),this.e1=Ut(this.es),this.e2=Vt(this.es),this.e3=Yt(this.es),this.ml0=this.a*qt(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,n,r,i=t.x,o=t.y,s=E(i-this.long0);if(r=s*Math.sin(o),this.sphere)Math.abs(o)<=1e-10?(e=this.a*s,n=-1*this.a*this.lat0):(e=this.a*Math.sin(r)/Math.tan(o),n=this.a*(Xt(o-this.lat0)+(1-Math.cos(r))/Math.tan(o)));else if(Math.abs(o)<=1e-10)e=this.a*s,n=-1*this.ml0;else{var a=Wt(this.a,this.e,Math.sin(o))/Math.tan(o);e=a*Math.sin(r),n=this.a*qt(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+a*(1-Math.cos(r))}return t.x=e+this.x0,t.y=n+this.y0,t},inverse:function(t){var e,n,r,i,o,s,a,u,c;if(r=t.x-this.x0,i=t.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=1e-10)e=E(r/this.a+this.long0),n=0;else{var l;for(s=this.lat0+i/this.a,a=r*r/this.a/this.a+s*s,u=s,o=20;o;--o)if(u+=c=-1*(s*(u*(l=Math.tan(u))+1)-u-.5*(u*u+a)*l)/((u-s)/l-1),Math.abs(c)<=1e-10){n=u;break}e=E(this.long0+Math.asin(r*Math.tan(u)/this.a)/Math.sin(n))}else if(Math.abs(i+this.ml0)<=1e-10)n=0,e=E(this.long0+r/this.a);else{var h,f,p,d,g;for(s=(this.ml0+i)/this.a,a=r*r/this.a/this.a+s*s,u=s,o=20;o;--o)if(g=this.e*Math.sin(u),h=Math.sqrt(1-g*g)*Math.tan(u),f=this.a*qt(this.e0,this.e1,this.e2,this.e3,u),p=this.e0-2*this.e1*Math.cos(2*u)+4*this.e2*Math.cos(4*u)-6*this.e3*Math.cos(6*u),u-=c=(s*(h*(d=f/this.a)+1)-d-.5*h*(d*d+a))/(this.es*Math.sin(2*u)*(d*d+a-2*s*d)/(4*h)+(s-d)*(h*p-2/Math.sin(2*u))-p),Math.abs(c)<=1e-10){n=u;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),e=E(this.long0+Math.asin(r*h/this.a)/Math.sin(n))}return t.x=e,t.y=n,t},names:["Polyconic","poly"]};var ie={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,n=t.x,i=t.y-this.lat0,o=n-this.long0,s=i/r*1e-5,a=o,u=1,c=0;for(e=1;e<=10;e++)u*=s,c+=this.A[e]*u;var l,h=c,f=a,p=1,d=0,g=0,y=0;for(e=1;e<=6;e++)l=d*h+p*f,p=p*h-d*f,d=l,g=g+this.B_re[e]*p-this.B_im[e]*d,y=y+this.B_im[e]*p+this.B_re[e]*d;return t.x=y*this.a+this.x0,t.y=g*this.a+this.y0,t},inverse:function(t){var e,n,i=t.x,o=t.y,s=i-this.x0,a=(o-this.y0)/this.a,u=s/this.a,c=1,l=0,h=0,f=0;for(e=1;e<=6;e++)n=l*a+c*u,c=c*a-l*u,l=n,h=h+this.C_re[e]*c-this.C_im[e]*l,f=f+this.C_im[e]*c+this.C_re[e]*l;for(var p=0;p.999999999999&&(n=.999999999999),e=Math.asin(n);var r=E(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),n=(2*e+Math.sin(2*e))/Math.PI,Math.abs(n)>1&&(n=1);var i=Math.asin(n);return t.x=r,t.y=i,t},names:["Mollweide","moll"]};var ue={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(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=zt(this.es),this.e1=Ut(this.es),this.e2=Vt(this.es),this.e3=Yt(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=qt(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<1e-10?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=qt(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=qt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var e,n=t.x,r=t.y;if(this.sphere)e=this.a*(this.g-r);else{var i=qt(this.e0,this.e1,this.e2,this.e3,r);e=this.a*(this.g-i)}var o=this.ns*E(n-this.long0),s=this.x0+e*Math.sin(o),a=this.y0+this.rh-e*Math.cos(o);return t.x=s,t.y=a,t},inverse:function(t){var e,n,r,i;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(n=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(n=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var o=0;if(0!==n&&(o=Math.atan2(e*t.x,e*t.y)),this.sphere)return i=E(this.long0+o/this.ns),r=Xt(this.g-n/this.a),t.x=i,t.y=r,t;var s=this.g-n/this.a;return r=Ht(s,this.e0,this.e1,this.e2,this.e3),i=E(this.long0+o/this.ns),t.x=i,t.y=r,t},names:["Equidistant_Conic","eqdc"]};var ce={init:function(){this.R=this.a},forward:function(t){var e,n,r=t.x,o=t.y,s=E(r-this.long0);Math.abs(o)<=1e-10&&(e=this.x0+this.R*s,n=this.y0);var a=$t(2*Math.abs(o/Math.PI));(Math.abs(s)<=1e-10||Math.abs(Math.abs(o)-i)<=1e-10)&&(e=this.x0,n=o>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var u=.5*Math.abs(Math.PI/s-s/Math.PI),c=u*u,l=Math.sin(a),h=Math.cos(a),f=h/(l+h-1),p=f*f,d=f*(2/l-1),g=d*d,y=Math.PI*this.R*(u*(f-g)+Math.sqrt(c*(f-g)*(f-g)-(g+c)*(p-g)))/(g+c);s<0&&(y=-y),e=this.x0+y;var v=c+f;return y=Math.PI*this.R*(d*v-u*Math.sqrt((g+c)*(c+1)-v*v))/(g+c),n=o>=0?this.y0+y:this.y0-y,t.x=e,t.y=n,t},inverse:function(t){var e,n,r,i,o,s,a,u,c,l,h,f;return t.x-=this.x0,t.y-=this.y0,h=Math.PI*this.R,o=(r=t.x/h)*r+(i=t.y/h)*i,h=3*(i*i/(u=-2*(s=-Math.abs(i)*(1+o))+1+2*i*i+o*o)+(2*(a=s-2*i*i+r*r)*a*a/u/u/u-9*s*a/u/u)/27)/(c=(s-a*a/3/u)/u)/(l=2*Math.sqrt(-c/3)),Math.abs(h)>1&&(h=h>=0?1:-1),f=Math.acos(h)/3,n=t.y>=0?(-l*Math.cos(f+Math.PI/3)-a/3/u)*Math.PI:-(-l*Math.cos(f+Math.PI/3)-a/3/u)*Math.PI,e=Math.abs(r)<1e-10?this.long0:E(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(r*r-i*i)+o*o))/2/r),t.x=e,t.y=n,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var le={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var e,n,r,o,s,a,u,c,l,h,f,p,d,g,y,v,m,_,b,w,x,O,S=t.x,C=t.y,N=Math.sin(t.y),M=Math.cos(t.y),L=E(S-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(t.x=this.x0+this.a*(i-C)*Math.sin(L),t.y=this.y0-this.a*(i-C)*Math.cos(L),t):Math.abs(this.sin_p12+1)<=1e-10?(t.x=this.x0+this.a*(i+C)*Math.sin(L),t.y=this.y0+this.a*(i+C)*Math.cos(L),t):(_=this.sin_p12*N+this.cos_p12*M*Math.cos(L),m=(v=Math.acos(_))?v/Math.sin(v):1,t.x=this.x0+this.a*m*M*Math.sin(L),t.y=this.y0+this.a*m*(this.cos_p12*N-this.sin_p12*M*Math.cos(L)),t):(e=zt(this.es),n=Ut(this.es),r=Vt(this.es),o=Yt(this.es),Math.abs(this.sin_p12-1)<=1e-10?(s=this.a*qt(e,n,r,o,i),a=this.a*qt(e,n,r,o,C),t.x=this.x0+(s-a)*Math.sin(L),t.y=this.y0-(s-a)*Math.cos(L),t):Math.abs(this.sin_p12+1)<=1e-10?(s=this.a*qt(e,n,r,o,i),a=this.a*qt(e,n,r,o,C),t.x=this.x0+(s+a)*Math.sin(L),t.y=this.y0+(s+a)*Math.cos(L),t):(u=N/M,c=Wt(this.a,this.e,this.sin_p12),l=Wt(this.a,this.e,N),h=Math.atan((1-this.es)*u+this.es*c*this.sin_p12/(l*M)),b=0===(f=Math.atan2(Math.sin(L),this.cos_p12*Math.tan(h)-this.sin_p12*Math.cos(L)))?Math.asin(this.cos_p12*Math.sin(h)-this.sin_p12*Math.cos(h)):Math.abs(Math.abs(f)-Math.PI)<=1e-10?-Math.asin(this.cos_p12*Math.sin(h)-this.sin_p12*Math.cos(h)):Math.asin(Math.sin(L)*Math.cos(h)/Math.sin(f)),p=this.e*this.sin_p12/Math.sqrt(1-this.es),v=c*b*(1-(w=b*b)*(y=(d=this.e*this.cos_p12*Math.cos(f)/Math.sqrt(1-this.es))*d)*(1-y)/6+(x=w*b)/8*(g=p*d)*(1-2*y)+(O=x*b)/120*(y*(4-7*y)-3*p*p*(1-7*y))-O*b/48*g),t.x=this.x0+v*Math.sin(f),t.y=this.y0+v*Math.cos(f),t))},inverse:function(t){var e,n,r,o,s,a,u,c,l,h,f,p,d,g,y,v,m,_,b,w,x,O,S;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*i*this.a)return;return n=e/this.a,r=Math.sin(n),o=Math.cos(n),s=this.long0,Math.abs(e)<=1e-10?a=this.lat0:(a=$t(o*this.sin_p12+t.y*r*this.cos_p12/e),u=Math.abs(this.lat0)-i,s=Math.abs(u)<=1e-10?this.lat0>=0?E(this.long0+Math.atan2(t.x,-t.y)):E(this.long0-Math.atan2(-t.x,t.y)):E(this.long0+Math.atan2(t.x*r,e*this.cos_p12*o-t.y*this.sin_p12*r))),t.x=s,t.y=a,t}return c=zt(this.es),l=Ut(this.es),h=Vt(this.es),f=Yt(this.es),Math.abs(this.sin_p12-1)<=1e-10?(p=this.a*qt(c,l,h,f,i),e=Math.sqrt(t.x*t.x+t.y*t.y),a=Ht((p-e)/this.a,c,l,h,f),s=E(this.long0+Math.atan2(t.x,-1*t.y)),t.x=s,t.y=a,t):Math.abs(this.sin_p12+1)<=1e-10?(p=this.a*qt(c,l,h,f,i),e=Math.sqrt(t.x*t.x+t.y*t.y),a=Ht((e-p)/this.a,c,l,h,f),s=E(this.long0+Math.atan2(t.x,t.y)),t.x=s,t.y=a,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),y=Math.atan2(t.x,t.y),d=Wt(this.a,this.e,this.sin_p12),v=Math.cos(y),_=-(m=this.e*this.cos_p12*v)*m/(1-this.es),b=3*this.es*(1-_)*this.sin_p12*this.cos_p12*v/(1-this.es),O=1-_*(x=(w=e/d)-_*(1+_)*Math.pow(w,3)/6-b*(1+3*_)*Math.pow(w,4)/24)*x/2-w*x*x*x/6,g=Math.asin(this.sin_p12*Math.cos(x)+this.cos_p12*Math.sin(x)*v),s=E(this.long0+Math.asin(Math.sin(y)*Math.sin(x)/Math.cos(g))),S=Math.sin(g),a=Math.atan2((S-this.es*O*this.sin_p12)*Math.tan(g),S*(1-this.es)),t.x=s,t.y=a,t)},names:["Azimuthal_Equidistant","aeqd"]};var he={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,n,r,i,o,s,a,u=t.x,c=t.y;return r=E(u-this.long0),e=Math.sin(c),n=Math.cos(c),i=Math.cos(r),1,((o=this.sin_p14*e+this.cos_p14*n*i)>0||Math.abs(o)<=1e-10)&&(s=1*this.a*n*Math.sin(r),a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*i)),t.x=s,t.y=a,t},inverse:function(t){var e,n,r,o,s,a,u;return t.x-=this.x0,t.y-=this.y0,e=Math.sqrt(t.x*t.x+t.y*t.y),n=$t(e/this.a),r=Math.sin(n),o=Math.cos(n),a=this.long0,Math.abs(e)<=1e-10?(u=this.lat0,t.x=a,t.y=u,t):(u=$t(o*this.sin_p14+t.y*r*this.cos_p14/e),s=Math.abs(this.lat0)-i,Math.abs(s)<=1e-10?(a=this.lat0>=0?E(this.long0+Math.atan2(t.x,-t.y)):E(this.long0-Math.atan2(-t.x,t.y)),t.x=a,t.y=u,t):(a=E(this.long0+Math.atan2(t.x*r,e*this.cos_p14*o-t.y*this.sin_p14*r)),t.x=a,t.y=u,t))},names:["ortho"]},fe=1,pe=2,de=3,ge=4,ye=5,ve=6,me=1,_e=2,be=3,we=4;function xe(t,e,n,r){var o;return t<1e-10?(r.value=me,o=0):(o=Math.atan2(e,n),Math.abs(o)<=a?r.value=me:o>a&&o<=i+a?(r.value=_e,o-=i):o>i+a||o<=-(i+a)?(r.value=be,o=o>=0?o-c:o+c):(r.value=we,o+=i)),o}function Oe(t,e){var n=t+e;return n<-c?n+=u:n>+c&&(n-=u),n}var Ee={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=i-a/2?this.face=ye:this.lat0<=-(i-a/2)?this.face=ve:Math.abs(this.long0)<=a?this.face=fe:Math.abs(this.long0)<=i+a?this.face=this.long0>0?pe:ge:this.face=de,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,n,r,o,s,u,l={x:0,y:0},h={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,n=t.x,this.face===ye)o=i-e,n>=a&&n<=i+a?(h.value=me,r=n-i):n>i+a||n<=-(i+a)?(h.value=_e,r=n>0?n-c:n+c):n>-(i+a)&&n<=-a?(h.value=be,r=n+i):(h.value=we,r=n);else if(this.face===ve)o=i+e,n>=a&&n<=i+a?(h.value=me,r=-n+i):n=-a?(h.value=_e,r=-n):n<-a&&n>=-(i+a)?(h.value=be,r=-n-i):(h.value=we,r=n>0?-n+c:-n-c);else{var f,p,d,g,y,v;this.face===pe?n=Oe(n,+i):this.face===de?n=Oe(n,+c):this.face===ge&&(n=Oe(n,-i)),g=Math.sin(e),y=Math.cos(e),v=Math.sin(n),f=y*Math.cos(n),p=y*v,d=g,this.face===fe?r=xe(o=Math.acos(f),d,p,h):this.face===pe?r=xe(o=Math.acos(p),d,-f,h):this.face===de?r=xe(o=Math.acos(-f),d,-p,h):this.face===ge?r=xe(o=Math.acos(-p),d,f,h):(o=r=0,h.value=me)}return u=Math.atan(12/c*(r+Math.acos(Math.sin(r)*Math.cos(a))-i)),s=Math.sqrt((1-Math.cos(o))/(Math.cos(u)*Math.cos(u))/(1-Math.cos(Math.atan(1/Math.cos(r))))),h.value===_e?u+=i:h.value===be?u+=c:h.value===we&&(u+=1.5*c),l.x=s*Math.cos(u),l.y=s*Math.sin(u),l.x=l.x*this.a+this.x0,l.y=l.y*this.a+this.y0,t.x=l.x,t.y=l.y,t},inverse:function(t){var e,n,r,o,s,a,u,l,h,f,p,d,g={lam:0,phi:0},y={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,n=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?y.value=me:t.y>=0&&t.y>=Math.abs(t.x)?(y.value=_e,e-=i):t.x<0&&-t.x>=Math.abs(t.y)?(y.value=be,e=e<0?e+c:e-c):(y.value=we,e+=i),h=c/12*Math.tan(e),s=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),a=Math.atan(s),(u=1-(r=Math.cos(e))*r*(o=Math.tan(n))*o*(1-Math.cos(Math.atan(1/Math.cos(a)))))<-1?u=-1:u>1&&(u=1),this.face===ye)l=Math.acos(u),g.phi=i-l,y.value===me?g.lam=a+i:y.value===_e?g.lam=a<0?a+c:a-c:y.value===be?g.lam=a-i:g.lam=a;else if(this.face===ve)l=Math.acos(u),g.phi=l-i,y.value===me?g.lam=-a+i:y.value===_e?g.lam=-a:y.value===be?g.lam=-a-i:g.lam=a<0?-a-c:-a+c;else{var v,m,_;h=(v=u)*v,m=(h+=(_=h>=1?0:Math.sqrt(1-h)*Math.sin(a))*_)>=1?0:Math.sqrt(1-h),y.value===_e?(h=m,m=-_,_=h):y.value===be?(m=-m,_=-_):y.value===we&&(h=m,m=_,_=-h),this.face===pe?(h=v,v=-m,m=h):this.face===de?(v=-v,m=-m):this.face===ge&&(h=v,v=m,m=-h),g.phi=Math.acos(-_)-i,g.lam=Math.atan2(m,v),this.face===pe?g.lam=Oe(g.lam,-i):this.face===de?g.lam=Oe(g.lam,-c):this.face===ge&&(g.lam=Oe(g.lam,+i))}return 0!==this.es&&(f=g.phi<0?1:0,p=Math.tan(g.phi),d=this.b/Math.sqrt(p*p+this.one_minus_f_squared),g.phi=Math.atan(Math.sqrt(this.a*this.a-d*d)/(this.one_minus_f*d)),f&&(g.phi=-g.phi)),g.lam+=this.long0,t.x=g.lam,t.y=g.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Se=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Ce=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Ne=s/5,Me=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};var Le={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=E(t.x-this.long0),n=Math.abs(t.y),r=Math.floor(n*Ne);r<0?r=0:r>=18&&(r=17);var i={x:Me(Se[r],n=s*(n-.08726646259971647*r))*e,y:Me(Ce[r],n)};return t.y<0&&(i.y=-i.y),i.x=i.x*this.a*.8487+this.x0,i.y=i.y*this.a*1.3523+this.y0,i},inverse:function(t){var e={x:(t.x-this.x0)/(.8487*this.a),y:Math.abs(t.y-this.y0)/(1.3523*this.a)};if(e.y>=1)e.x/=Se[18][0],e.y=t.y<0?-i:i;else{var n=Math.floor(18*e.y);for(n<0?n=0:n>=18&&(n=17);;)if(Ce[n][0]>e.y)--n;else{if(!(Ce[n+1][0]<=e.y))break;++n}var r=Ce[n],s=5*(e.y-r[0])/(Ce[n+1][0]-r[0]);s=function(t,e,n,r){for(var i=e;r;--r){var o=t(i);if(i-=o,Math.abs(o)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,n,r,i,o=t.x,s=t.y;if(o-=this.long0,"ellipse"===this.shape){s=Math.atan(this.radius_p2*Math.tan(s));var a=this.radius_p/Nt(this.radius_p*Math.cos(s),Math.sin(s));if(n=a*Math.cos(o)*Math.cos(s),r=a*Math.sin(o)*Math.cos(s),i=a*Math.sin(s),(this.radius_g-n)*n-r*r-i*i*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/Nt(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(r/e),t.y=this.radius_g_1*Math.atan(i/Nt(r,e)))}else"sphere"===this.shape&&(e=Math.cos(s),n=Math.cos(o)*e,r=Math.sin(o)*e,i=Math.sin(s),e=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/Nt(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(r/e),t.y=this.radius_g_1*Math.atan(i/Nt(r,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,n,r,i,o=-1,s=0,a=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),s=Math.tan(t.x/this.radius_g_1)*Nt(1,a)):(s=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*Nt(1,s));var u=a/this.radius_p;if(e=s*s+u*u+o*o,(r=(n=2*this.radius_g*o)*n-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-n-Math.sqrt(r))/(2*e),o=this.radius_g+i*o,s*=i,a*=i,t.x=Math.atan2(s,o),t.y=Math.atan(a*Math.cos(t.x)/o),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),s=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+a*a)):(s=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+s*s)),e=s*s+a*a+o*o,(r=(n=2*this.radius_g*o)*n-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-n-Math.sqrt(r))/(2*e),o=this.radius_g+i*o,s*=i,a*=i,t.x=Math.atan2(s,o),t.y=Math.atan(a*Math.cos(t.x)/o)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]},De=1.340264,Be=-.081106,Ge=893e-6,qe=.003796,ze=Math.sqrt(3)/2;var Ue,Ve={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0},forward:function(t){var e=E(t.x-this.long0),n=t.y,r=Math.asin(ze*Math.sin(n)),i=r*r,o=i*i*i;return t.x=e*Math.cos(r)/(ze*(De+3*Be*i+o*(7*Ge+9*qe*i))),t.y=r*(De+Be*i+o*(Ge+qe*i)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var e,n,r,i,o=t.y;for(i=0;i<12&&(o-=r=(o*(De+Be*(e=o*o)+(n=e*e*e)*(Ge+qe*e))-t.y)/(De+3*Be*e+n*(7*Ge+9*qe*e)),!(Math.abs(r)<1e-9));++i);return n=(e=o*o)*e*e,t.x=ze*t.x*(De+3*Be*e+n*(7*Ge+9*qe*e))/Math.cos(o),t.y=Math.asin(Math.sin(o)/ze),t.x=E(t.x+this.long0),t},names:["eqearth","Equal Earth","Equal_Earth"]};st.defaultDatum="WGS84",st.Proj=Y,st.WGS84=new st.Proj("WGS84"),st.Point=bt,st.toPoint=tt,st.defs=v,st.nadgrid=function(t,e){var n=new DataView(e),r=function(t){var e=t.getInt32(8,!1);if(11===e)return!1;11!==(e=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian");return!0}(n),i=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:G(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(n,r),o={header:i,subgrids:function(t,e,n){for(var r=176,i=[],o=0;o=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function y(t,e){for(var n=0;n=r&&n.x<=r+i&&n.y>=o&&n.y<=o+s){if(n.xr+i-a)return-(r+i-n.x-a)/a}return 0}}function x(t){return function(e,n){var r=e.y,i=e.h,o=e.x,s=e.w,a=Math.min(i/2,t);if(n.y>=r&&n.y<=r+i&&n.x>=o&&n.x<=o+s){if(n.yr+i-a)return-(r+i-n.y-a)/a}return 0}}var O=w(150);e.defaultHorizontalStrength=O;var E=x(150);function S(t){var e=function(e){function n(t,e){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),i=function(t,e){return!e||"object"!==p(e)&&"function"!=typeof e?_(t):e}(this,v(n).call(this,t,e)),b(_(_(i)),"updateScrolling",(0,s.default)((function(t){var e=i.container.getBoundingClientRect(),n={x:e.left,y:e.top,w:e.width,h:e.height},r=(0,h.getCoords)(t),o=i.props,s=o.horizontalStrength,a=o.verticalStrength;i.scaleX=s(n,r),i.scaleY=a(n,r),i.frame||!i.scaleX&&!i.scaleY||i.startScrolling()}),100,{trailing:!1})),b(_(_(i)),"handleEvent",(function(t){i.dragging&&!i.attached&&(i.attach(),i.updateScrolling(t))})),i.wrappedInstance=r.default.createRef(),i.scaleX=0,i.scaleY=0,i.frame=null,i.attached=!1,i.dragging=!1,i}var i,u,c;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&m(t,e)}(n,e),i=n,(u=[{key:"componentDidMount",value:function(){var t=this;this.container=(0,o.findDOMNode)(this.wrappedInstance.current),this.container&&"function"==typeof this.container.addEventListener&&this.container.addEventListener("dragover",this.handleEvent),window.document.body.addEventListener("touchmove",this.handleEvent);var e=this.props.dragDropManager;this.clearMonitorSubscription=e.getMonitor().subscribeToStateChange((function(){return t.handleMonitorChange()}))}},{key:"componentWillUnmount",value:function(){this.container&&"function"==typeof this.container.removeEventListener&&this.container.removeEventListener("dragover",this.handleEvent),window.document.body.removeEventListener("touchmove",this.handleEvent),this.clearMonitorSubscription(),this.stopScrolling()}},{key:"handleMonitorChange",value:function(){var t=this.props.dragDropManager.getMonitor().isDragging();!this.dragging&&t?this.dragging=!0:this.dragging&&!t&&(this.dragging=!1,this.stopScrolling())}},{key:"attach",value:function(){this.attached=!0,window.document.body.addEventListener("dragover",this.updateScrolling),window.document.body.addEventListener("touchmove",this.updateScrolling)}},{key:"detach",value:function(){this.attached=!1,window.document.body.removeEventListener("dragover",this.updateScrolling),window.document.body.removeEventListener("touchmove",this.updateScrolling)}},{key:"startScrolling",value:function(){var t=this,e=0;!function n(){var r=t.scaleX,i=t.scaleY,o=t.container,s=t.props,u=s.strengthMultiplier,c=s.onScrollChange;if(0!==u&&r+i!==0){if((e+=1)%2){var l=o.scrollLeft,f=o.scrollTop,p=o.scrollWidth,d=o.scrollHeight,g=o.clientWidth,y=o.clientHeight;c(r?o.scrollLeft=(0,h.intBetween)(0,p-g,l+r*u):l,i?o.scrollTop=(0,h.intBetween)(0,d-y,f+i*u):f)}t.frame=(0,a.default)(n)}else t.stopScrolling()}()}},{key:"stopScrolling",value:function(){this.detach(),this.scaleX=0,this.scaleY=0,this.frame&&(a.default.cancel(this.frame),this.frame=null)}},{key:"render",value:function(){var e=this.props,n=(e.strengthMultiplier,e.verticalStrength,e.horizontalStrength,e.onScrollChange,g(e,["strengthMultiplier","verticalStrength","horizontalStrength","onScrollChange"]));return r.default.createElement(t,d({ref:this.wrappedInstance},n))}}])&&y(i.prototype,u),c&&y(i,c),n}(r.Component);return b(e,"displayName","Scrolling(".concat((0,u.default)(t),")")),b(e,"propTypes",{dragDropManager:i.default.object.isRequired,onScrollChange:i.default.func,verticalStrength:i.default.func,horizontalStrength:i.default.func,strengthMultiplier:i.default.number}),b(e,"defaultProps",{onScrollChange:h.noop,verticalStrength:E,horizontalStrength:O,strengthMultiplier:30}),(0,l.default)(e,t)}e.defaultVerticalStrength=E},,,,,,,,,,,function(t,e,n){"use strict";var r,i=n(73),o=n(71),s=n(186),a=n(77),u=n(50),c=n(51),l=n(36),h=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f="translatestart",p="translating",d="translateend",g=function(t){function e(e,n,r,i,o){var s=t.call(this,e)||this;return s.features=n,s.coordinate=r,s.startCoordinate=i,s.mapBrowserEvent=o,s}return h(e,t),e}(o.a),y=function(t){function e(e){var n,r=this,i=e||{};if((r=t.call(this,i)||this).on,r.once,r.un,r.lastCoordinate_=null,r.startCoordinate_=null,r.features_=void 0!==i.features?i.features:null,i.layers&&!r.features_)if("function"==typeof i.layers)n=i.layers;else{var o=i.layers;n=function(t){return Object(l.d)(o,t)}}else n=u.b;return r.layerFilter_=n,r.filter_=i.filter&&!r.features_?i.filter:u.b,r.hitTolerance_=i.hitTolerance?i.hitTolerance:0,r.condition_=i.condition?i.condition:c.d,r.lastFeature_=null,r.addChangeListener(s.a.ACTIVE,r.handleActiveChanged_),r}return h(e,t),e.prototype.handleDownEvent=function(t){if(!t.originalEvent||!this.condition_(t))return!1;if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=t.coordinate,this.lastCoordinate_=t.coordinate,this.handleMoveEvent(t);var e=this.features_||new i.a([this.lastFeature_]);return this.dispatchEvent(new g(f,e,t.coordinate,this.startCoordinate_,t)),!0}return!1},e.prototype.handleUpEvent=function(t){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(t);var e=this.features_||new i.a([this.lastFeature_]);return this.dispatchEvent(new g(d,e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,n=e[0]-this.lastCoordinate_[0],r=e[1]-this.lastCoordinate_[1],o=this.features_||new i.a([this.lastFeature_]);o.forEach((function(t){var e=t.getGeometry();e.translate(n,r),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new g(p,o,e,this.startCoordinate_,t))}},e.prototype.handleMoveEvent=function(t){var e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")},e.prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t,e){if(this.filter_(t,e)&&(!this.features_||Object(l.d)(this.features_.getArray(),t)))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var n=this.getMap();t.prototype.setMap.call(this,e),this.updateState_(n)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),n=this.getActive();e&&n||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}(a.b);e.a=y},,,function(t,e,n){"use strict";n.d(e,"b",(function(){return c}));var r,i=n(135),o=n(28),s=n(27),a=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(){var e=t.call(this)||this;return e.on=e.onInternal,e.once=e.onceInternal,e.un=e.unInternal,e.revision_=0,e}return a(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(o.a.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var n=t.length,r=new Array(n),i=0;i=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new y(p,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new y(e?d:g,t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new y(f,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(o.b);e.a=v},function(t,e,n){"use strict";function r(t,e){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";e.a=function(t){function e(t,e,r){var i=e.trim().split(d);e=i;var o=i.length,s=t.length;switch(s){case 0:case 1:var a=0;for(t=0===s?"":t[0]+" ";ar&&(r=(e=e.trim()).charCodeAt(0)),r){case 38:return e.replace(g,"$1"+t.trim());case 58:return t.trim()+e.replace(g,"$1"+t.trim());default:if(0<1*n&&0u.charCodeAt(8))break;case 115:s=s.replace(u,"-webkit-"+u)+";"+s;break;case 207:case 102:s=s.replace(u,"-webkit-"+(102a.charCodeAt(0)&&(a=a.trim()),a=[a],0p)&&(B=(z=z.replace(" ",":")).length),0x&&(h=(f+p)/2,Object(r.c)(t,e,n,o,h,y)&&(w=h,x=O)),f=p}return isNaN(w)&&(w=s[a]),u?(u.push(w,y,x),u):[w,y,x]}function s(t,e,n,r,i){for(var s=[],a=0,u=n.length;a=.5&&I>=.5){var P=M[4],j=M[5],A=s.opacity,R=void 0;1!==A&&(R=x.globalAlpha,x.globalAlpha=A),x.drawImage(N,0,0,+N.width,+N.height,Math.round(P),Math.round(j),Math.round(L),Math.round(I)),1!==A&&(x.globalAlpha=R)}return this.postRender(x,t),E&&x.restore(),w!==O.style.transform&&(O.style.transform=w),this.container},e}(i.a);e.a=f},function(t,e,n){"use strict";var r,i=n(130),o=n(200),s=n.n(o),a=n(23),u=n(67),c=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l="renderOrder",h=function(t){function e(e){var n=this,r=e||{},i=Object(a.a)({},r);return delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,(n=t.call(this,i)||this).declutter_=void 0!==r.declutter&&r.declutter,n.renderBuffer_=void 0!==r.renderBuffer?r.renderBuffer:100,n.style_=null,n.styleFunction_=void 0,n.setStyle(r.style),n.updateWhileAnimating_=void 0!==r.updateWhileAnimating&&r.updateWhileAnimating,n.updateWhileInteracting_=void 0!==r.updateWhileInteracting&&r.updateWhileInteracting,n}return c(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(l)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new s.a(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(l,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:u.a,this.styleFunction_=null===t?void 0:Object(u.d)(this.style_),this.changed()},e}(i.a);e.a=h},function(t,e,n){"use strict";var r,i=n(81),o=n(63),s=n(20),a=n(32),u=n(23),c=n(26),l=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=Object(u.a)({},e);return"object"==typeof e.properties&&(delete r.properties,Object(u.a)(r,e.properties)),r[o.a.OPACITY]=void 0!==e.opacity?e.opacity:1,Object(a.a)("number"==typeof r[o.a.OPACITY],64),r[o.a.VISIBLE]=void 0===e.visible||e.visible,r[o.a.Z_INDEX]=e.zIndex,r[o.a.MAX_RESOLUTION]=void 0!==e.maxResolution?e.maxResolution:1/0,r[o.a.MIN_RESOLUTION]=void 0!==e.minResolution?e.minResolution:0,r[o.a.MIN_ZOOM]=void 0!==e.minZoom?e.minZoom:-1/0,r[o.a.MAX_ZOOM]=void 0!==e.maxZoom?e.maxZoom:1/0,n.className_=void 0!==r.className?e.className:"ol-layer",delete r.className,n.setProperties(r),n.state_=null,n}return l(e,t),e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},n=this.getZIndex();return e.opacity=Object(c.a)(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==n||e.managed?n:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return Object(s.b)()},e.prototype.getLayerStatesArray=function(t){return Object(s.b)()},e.prototype.getExtent=function(){return this.get(o.a.EXTENT)},e.prototype.getMaxResolution=function(){return this.get(o.a.MAX_RESOLUTION)},e.prototype.getMinResolution=function(){return this.get(o.a.MIN_RESOLUTION)},e.prototype.getMinZoom=function(){return this.get(o.a.MIN_ZOOM)},e.prototype.getMaxZoom=function(){return this.get(o.a.MAX_ZOOM)},e.prototype.getOpacity=function(){return this.get(o.a.OPACITY)},e.prototype.getSourceState=function(){return Object(s.b)()},e.prototype.getVisible=function(){return this.get(o.a.VISIBLE)},e.prototype.getZIndex=function(){return this.get(o.a.Z_INDEX)},e.prototype.setExtent=function(t){this.set(o.a.EXTENT,t)},e.prototype.setMaxResolution=function(t){this.set(o.a.MAX_RESOLUTION,t)},e.prototype.setMinResolution=function(t){this.set(o.a.MIN_RESOLUTION,t)},e.prototype.setMaxZoom=function(t){this.set(o.a.MAX_ZOOM,t)},e.prototype.setMinZoom=function(t){this.set(o.a.MIN_ZOOM,t)},e.prototype.setOpacity=function(t){Object(a.a)("number"==typeof t,64),this.set(o.a.OPACITY,t)},e.prototype.setVisible=function(t){this.set(o.a.VISIBLE,t)},e.prototype.setZIndex=function(t){this.set(o.a.Z_INDEX,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(i.a);e.a=h},,function(t,e,n){"use strict";var r,i=n(265),o=n(73),s=n(74),a=n(28),u=n(137),c=n(129),l=n(32),h=n(23),f=n(7),p=n(20),d=n(27),g=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),y="layers",v=function(t){function e(e){var n=this,r=e||{},i=Object(h.a)({},r);delete i.layers;var s=r.layers;return(n=t.call(this,i)||this).on,n.once,n.un,n.layersListenerKeys_=[],n.listenerKeys_={},n.addChangeListener(y,n.handleLayersChanged_),s?Array.isArray(s)?s=new o.a(s.slice(),{unique:!0}):Object(l.a)("function"==typeof s.getArray,43):s=new o.a(void 0,{unique:!0}),n.setLayers(s),n}return g(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(d.c),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(Object(d.a)(t,s.a.ADD,this.handleLayersAdd_,this),Object(d.a)(t,s.a.REMOVE,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(d.c);Object(h.b)(this.listenerKeys_);for(var n=t.getArray(),r=0,i=n.length;r=0},e}(s.a);e.a=m},function(t,e,n){"use strict";var r=n(7),i=n(13),o=n(26),s=function(){function t(t,e,n,s,a,u){this.sourceProj_=t,this.targetProj_=e;var c={},l=Object(i.i)(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return c[e]||(c[e]=l(t)),c[e]},this.maxSourceExtent_=s,this.errorThresholdSquared_=a*a,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!s&&!!this.sourceProj_.getExtent()&&Object(r.D)(s)==Object(r.D)(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Object(r.D)(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Object(r.D)(this.targetProj_.getExtent()):null;var h=Object(r.B)(n),f=Object(r.C)(n),p=Object(r.v)(n),d=Object(r.u)(n),g=this.transformInv_(h),y=this.transformInv_(f),v=this.transformInv_(p),m=this.transformInv_(d),_=10+(u?Math.max(0,Math.ceil(Object(o.d)(Object(r.t)(n)/(u*u*256*256)))):0);if(this.addQuad_(h,f,p,d,g,y,v,m,_),this.wrapsXInSource_){var b=1/0;this.triangles_.forEach((function(t,e,n){b=Math.min(b,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-b>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-b>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-b>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-b>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var n=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-n.5&&f<1,g=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var y=Object(r.b)([t,e,n,i]);g=Object(r.D)(y)/this.targetWorldWidth_>.25||g}!d&&this.sourceProj_.isGlobal()&&f&&(g=f>.25||g)}if(!(!g&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3]))||Object(r.E)(h,this.maxSourceExtent_)){var v=0;if(!(g||isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(u[0])&&isFinite(u[1])&&isFinite(c[0])&&isFinite(c[1])))if(l>0)g=!0;else if(1!=(v=(isFinite(s[0])&&isFinite(s[1])?0:8)+(isFinite(a[0])&&isFinite(a[1])?0:4)+(isFinite(u[0])&&isFinite(u[1])?0:2)+(isFinite(c[0])&&isFinite(c[1])?0:1))&&2!=v&&4!=v&&8!=v)return;if(l>0){if(!g){var m=[(t[0]+n[0])/2,(t[1]+n[1])/2],_=this.transformInv_(m),b=void 0;if(d)b=(Object(o.e)(s[0],p)+Object(o.e)(u[0],p))/2-Object(o.e)(_[0],p);else b=(s[0]+u[0])/2-_[0];var w=(s[1]+u[1])/2-_[1];g=b*b+w*w>this.errorThresholdSquared_}if(g){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){var x=[(e[0]+n[0])/2,(e[1]+n[1])/2],O=this.transformInv_(x),E=[(i[0]+t[0])/2,(i[1]+t[1])/2],S=this.transformInv_(E);this.addQuad_(t,e,x,E,s,a,O,S,l-1),this.addQuad_(E,x,n,i,S,O,u,c,l-1)}else{var C=[(t[0]+e[0])/2,(t[1]+e[1])/2],N=this.transformInv_(C),M=[(n[0]+i[0])/2,(n[1]+i[1])/2],L=this.transformInv_(M);this.addQuad_(t,C,M,i,s,N,L,c,l-1),this.addQuad_(C,e,n,M,N,a,u,L,l-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&v)&&this.addTriangle_(t,n,i,s,u,c),0==(14&v)&&this.addTriangle_(t,n,e,s,u,a),v&&(0==(13&v)&&this.addTriangle_(e,i,t,a,c,s),0==(7&v)&&this.addTriangle_(e,i,n,a,c,u))}},t.prototype.calculateSourceExtent=function(){var t=Object(r.j)();return this.triangles_.forEach((function(e,n,i){var o=e.source;Object(r.q)(t,o[0]),Object(r.q)(t,o[1]),Object(r.q)(t,o[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}();e.a=s},,,,function(t,e,n){"use strict";var r,i={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},o=[i.FILL],s=[i.STROKE],a=[i.BEGIN_PATH],u=[i.CLOSE_PATH],c=i,l=n(15),h=n(83),f=function(){function t(){}return t.prototype.drawCustom=function(t,e,n,r){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),p=n(123),d=n(7),g=n(31),y=n(36),v=n(80),m=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),_=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=n,o.pixelRatio=i,o.maxLineWidth=0,o.resolution=r,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return m(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatPointCoordinates=function(t,e){for(var n=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,i=this.coordinates,o=i.length,s=0,a=t.length;sp&&(this.instructions.push([c.CUSTOM,p,o,t,n,v.a]),this.hitDetectionInstructions.push([c.CUSTOM,p,o,t,r||n,v.a]));break;case l.a.POINT:i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),o=this.coordinates.length,this.instructions.push([c.CUSTOM,p,o,t,n]),this.hitDetectionInstructions.push([c.CUSTOM,p,o,t,r||n])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[c.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[c.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var n,r,i=e.length,o=-1;for(t=0;tthis.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,n=[c.SET_FILL_STYLE,e];return"string"!=typeof e&&n.push(!0),n},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[c.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var n=t.fillStyle;"string"==typeof n&&t.currentFillStyle==n||(void 0!==n&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)},e.prototype.updateStrokeStyle=function(t,e){var n=t.strokeStyle,r=t.lineCap,i=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,u=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=r||i!=t.currentLineDash&&!Object(y.b)(t.currentLineDash,i)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=u)&&(void 0!==n&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=r,t.currentLineDash=i,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=u)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[c.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Object(d.d)(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Object(d.c)(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(f),b=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),w=function(t){function e(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterImageWithText_=void 0,o}return b(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([c.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([c.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([c.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([c.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,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.finish.call(this)},e.prototype.setImageStyle=function(t,e){var n=t.getAnchor(),r=t.getSize(),i=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=i,this.image_=o,this.height_=r[1],this.opacity_=t.getOpacity(),this.originX_=s[0]*this.imagePixelRatio_,this.originY_=s[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=r[0],this.declutterImageWithText_=e},e}(_),x=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),O=function(t){function e(e,n,r,i){return t.call(this,e,n,r,i)||this}return x(e,t),e.prototype.drawFlatCoordinates_=function(t,e,n,r){var i=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,n,r,!1,!1),s=[c.MOVE_TO_LINE_TO,i,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),n},e.prototype.drawLineString=function(t,e){var n=this.state,r=n.strokeStyle,i=n.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([c.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,g.e,g.f],a);var o=t.getFlatCoordinates(),u=t.getStride();this.drawFlatCoordinates_(o,0,o.length,u),this.hitDetectionInstructions.push(s),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var n=this.state,r=n.strokeStyle,i=n.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([c.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],a);for(var o=t.getEnds(),u=t.getFlatCoordinates(),l=t.getStride(),h=0,f=0,p=o.length;ft&&(v>y&&(y=v,d=m,g=o),v=0,m=o-i)),s=a,l=f,h=p),u=_,c=b}return(v+=a)>y?[m,o]:[d,g]}var I=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),P={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},j={Circle:C,Default:_,Image:w,LineString:O,Polygon:C,Text:function(t){function e(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return I(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var n=this.textFillState_,r=this.textStrokeState_,i=this.textState_;if(""!==this.text_&&i&&(n||r)){var o=this.coordinates,s=o.length,a=t.getType(),u=null,h=t.getStride();if(i.placement!==N.a.LINE||a!=l.a.LINE_STRING&&a!=l.a.MULTI_LINE_STRING&&a!=l.a.POLYGON&&a!=l.a.MULTI_POLYGON){var f=i.overflow?null:[];switch(a){case l.a.POINT:case l.a.MULTI_POINT:u=t.getFlatCoordinates();break;case l.a.LINE_STRING:u=t.getFlatMidpoint();break;case l.a.CIRCLE:u=t.getCenter();break;case l.a.MULTI_LINE_STRING:u=t.getFlatMidpoints(),h=2;break;case l.a.POLYGON:u=t.getFlatInteriorPoint(),i.overflow||f.push(u[2]/this.resolution),h=3;break;case l.a.MULTI_POLYGON:var p=t.getFlatInteriorPoints();u=[];for(C=0,M=p.length;CM[2]}else S=b>C;var L,I=Math.PI,P=[],j=x+r===e;if(y=0,v=O,f=t[e=x],p=t[e+1],j){m(),L=Math.atan2(p-g,f-d),S&&(L+=L>0?-I:I);var A=(C+b)/2,R=(N+w)/2;return P[0]=[A,R,(E-o)/2,L,i],P}for(var T=0,F=i.length;T0?-I:I),void 0!==L){var D=k-L;if(D+=D>I?-2*I:D<-I?2*I:0,Math.abs(D)>s)return null}L=k;for(var B=T,G=0;Tt?t-u:i,w=o+c>e?e-c:o,x=p[3]+b*h[0]+p[1],O=p[0]+w*h[1]+p[2],E=m-p[3],S=_-p[0];return(g||0!==l)&&(H[0]=E,J[0]=E,H[1]=S,K[1]=S,K[0]=E+x,Z[0]=K[0],Z[1]=S+O,J[1]=Z[1]),0!==l?(v=Object(z.b)(Object(z.c)(),n,r,1,1,l,-n,-r),Object(z.a)(v,H),Object(z.a)(v,K),Object(z.a)(v,Z),Object(z.a)(v,J),Object(d.k)(Math.min(H[0],K[0],Z[0],J[0]),Math.min(H[1],K[1],Z[1],J[1]),Math.max(H[0],K[0],Z[0],J[0]),Math.max(H[1],K[1],Z[1],J[1]),X)):Object(d.k)(Math.min(E,E+x),Math.min(S,S+O),Math.max(E,E+x),Math.max(S,S+O),X),f&&(m=Math.round(m),_=Math.round(_)),{drawImageX:m,drawImageY:_,drawImageW:b,drawImageH:w,originX:u,originY:c,declutterBox:{minX:X[0],minY:X[1],maxX:X[2],maxY:X[3],value:y},canvasTransform:v,scale:h}},t.prototype.replayImageOrLabel_=function(t,e,n,r,i,o,s){var a=!(!o&&!s),u=r.declutterBox,c=t.canvas,l=s?s[2]*r.scale[0]/2:0;return u.minX-l<=c.width/e&&u.maxX+l>=0&&u.minY-l<=c.height/e&&u.maxY+l>=0&&(a&&this.replayTextBackground_(t,H,K,Z,J,o,s),Object(g.n)(t,r.canvasTransform,i,n,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=Object(z.a)(this.renderedTransform_,[0,0]),n=512*this.pixelRatio;t.save(),t.translate(e[0]%n,e[1]%n),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,n,r){var i=this.textStates[e],o=this.createLabel(t,e,r,n),s=this.strokeStates[n],a=this.pixelRatio,u=tt(t,i.textAlign||g.l),c=P[i.textBaseline||g.m],l=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:u*(o.width/a-2*i.scale[0])+2*(.5-u)*l,anchorY:c*o.height/a+2*(.5-c)*l}},t.prototype.execute_=function(t,e,n,r,i,o,s,a){var u;this.pixelCoordinates_&&Object(y.b)(n,this.renderedTransform_)?u=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),u=Object(V.c)(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),Object(z.f)(this.renderedTransform_,n));for(var l,h,f,p,v,m,_,b,w,x,O,E,S,C,N,M,L=0,I=r.length,j=0,A=0,R=0,T=null,F=null,k=this.coordinateCache_,D=this.viewRotation_,B=Math.round(1e12*Math.atan2(-n[1],n[0]))/1e12,G={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:D},q=this.instructions!=r||this.overlaps?0:200;Lq&&(this.fill_(t),A=0),R>q&&(t.stroke(),R=0),A||R||(t.beginPath(),p=NaN,v=NaN),++L;break;case c.CIRCLE:var X=u[j=U[1]],H=u[j+1],K=u[j+2]-X,Z=u[j+3]-H,J=Math.sqrt(K*K+Z*Z);t.moveTo(X+J,H),t.arc(X,H,J,0,2*Math.PI,!0),++L;break;case c.CLOSE_PATH:t.closePath(),++L;break;case c.CUSTOM:j=U[1],l=U[2];var Q=U[3],tt=U[4],et=6==U.length?U[5]:void 0;G.geometry=Q,G.feature=S,L in k||(k[L]=[]);var nt=k[L];et?et(u,j,l,2,nt):(nt[0]=u[j],nt[1]=u[j+1],nt.length=2),tt(nt,G),++L;break;case c.DRAW_IMAGE:j=U[1],l=U[2],b=U[3],h=U[4],f=U[5];var rt=U[6],it=U[7],ot=U[8],st=U[9],at=U[10],ut=U[11],ct=U[12],lt=U[13],ht=U[14];if(!b&&U.length>=19){w=U[18],x=U[19],O=U[20],E=U[21];var ft=this.drawLabelWithPointPlacement_(w,x,O,E);b=ft.label,U[3]=b;var pt=U[22];h=(ft.anchorX-pt)*this.pixelRatio,U[4]=h;var dt=U[23];f=(ft.anchorY-dt)*this.pixelRatio,U[5]=f,rt=b.height,U[6]=rt,lt=b.width,U[13]=lt}var gt=void 0;U.length>24&&(gt=U[24]);var yt=void 0,vt=void 0,mt=void 0;U.length>16?(yt=U[15],vt=U[16],mt=U[17]):(yt=g.j,vt=!1,mt=!1),at&&B?ut+=D:at||B||(ut-=D);for(var _t=0;jn)break;var a=r[s];a||(a=[],r[s]=a),a.push(4*((t+i)*e+(t+o))+3),i>0&&a.push(4*((t-i)*e+(t+o))+3),o>0&&(a.push(4*((t+i)*e+(t-o))+3),i>0&&a.push(4*((t-i)*e+(t-o))+3))}for(var u=[],c=(i=0,r.length);i0){if(!o||h!==k&&h!==G||-1!==o.indexOf(t)){var c=(f[a]-3)/4,p=r-c%s,d=r-(c/s|0),g=i(t,e,p*p+d*d);if(g)return g}l.clearRect(0,0,s,s);break}}var g,v,m,_,b,w=Object.keys(this.executorsByZIndex_).map(Number);for(w.sort(y.g),g=w.length-1;g>=0;--g){var x=w[g].toString();for(m=this.executorsByZIndex_[x],v=it.length-1;v>=0;--v)if(void 0!==(_=m[h=it[v]])&&(b=_.executeHitDetection(l,a,n,p,c)))return b}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var n=e[0],r=e[1],i=e[2],o=e[3],s=[n,r,n,o,i,o,i,r];return Object(V.c)(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return Object(rt.d)(this.executorsByZIndex_)},t.prototype.execute=function(t,e,n,r,i,o,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(y.g),this.maxExtent_&&(t.save(),this.clip(t,n));var u,c,l,h,f,p,d=o||it;for(s&&a.reverse(),u=0,c=a.length;ug[2];)b=m*++_,c.push(this.getRenderTransform(r,i,o,.5,h,f,b).slice()),v-=m}this.hitDetectionImageData_=function(t,e,n,r,i,o,s){var a=.5*t[0],u=.5*t[1],c=Object(nt.a)(a,u);c.imageSmoothingEnabled=!1;for(var h=c.canvas,f=new ht(c,.5,i,null,s),p=n.length,g=Math.floor(16777215/p),v={},m=1;m<=p;++m){var _=n[m-1],b=_.getStyleFunction()||r;if(r){var w=b(_,o);if(w){Array.isArray(w)||(w=[w]);for(var x="#"+("000000"+(m*g).toString(16)).slice(-6),O=0,E=w.length;Ow[0]&&E[2]>w[2]&&b.push([E[0]-x,E[1],E[2]-x,E[3]])}if(!this.dirty_&&this.renderedResolution_==l&&this.renderedRevision_==f&&this.renderedRenderOrder_==g&&Object(d.g)(this.wrappedRenderedExtent_,m))return Object(y.b)(this.renderedExtent_,_)||(this.hitDetectionImageData_=null,this.renderedExtent_=_),this.renderedCenter_=v,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var S,C=new A(mt(l,h),m,l,h);this.getLayer().getDeclutter()&&(S=new A(mt(l,h),m,l,h));var N,M=Object(bt.k)();if(M){for(var L=0,I=b.length;Lt)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){Object(a.b)()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var n=this.transitionStarts_[t];if(n){if(-1===n)return 1}else n=e,this.transitionStarts_[t]=n;var r=e-n+1e3/60;return r>=this.transition_?1:Object(u.a)(r/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(o.a),h=n(57),f=n(174),p=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();var d=function(t){function e(e,n,r,i,o,s){var a=t.call(this,e,n,s)||this;return a.crossOrigin_=i,a.src_=r,a.key=r,a.image_=new Image,null!==i&&(a.image_.crossOrigin=i),a.unlisten_=null,a.tileLoadFunction_=o,a}return p(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=s.a.LOADED,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=s.a.ERROR,this.unlistenImage_(),this.image_=((t=Object(h.a)(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=s.a.LOADED:this.state=s.a.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==s.a.ERROR&&(this.state=s.a.IDLE,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==s.a.IDLE&&(this.state=s.a.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Object(f.b)(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(l),g=n(94),y=n(269),v=n(155),m=n(26),_=n(7),b=n(27),w=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),x=function(t){function e(e,n,r,i,o,a,u,c,l,h,f,p){var d=t.call(this,o,s.a.IDLE)||this;d.renderEdges_=void 0!==f&&f,d.contextOptions_=p,d.pixelRatio_=u,d.gutter_=c,d.canvas_=null,d.sourceTileGrid_=n,d.targetTileGrid_=i,d.wrappedTileCoord_=a||o,d.sourceTiles_=[],d.sourcesListenerKeys_=null,d.sourceZ_=0;var b=i.getTileCoordExtent(d.wrappedTileCoord_),w=d.targetTileGrid_.getExtent(),x=d.sourceTileGrid_.getExtent(),O=w?Object(_.A)(b,w):b;if(0===Object(_.t)(O))return d.state=s.a.EMPTY,d;var E=e.getExtent();E&&(x=x?Object(_.A)(x,E):E);var S=i.getResolution(d.wrappedTileCoord_[0]),C=Object(v.a)(e,r,O,S);if(!isFinite(C)||C<=0)return d.state=s.a.EMPTY,d;var N=void 0!==h?h:g.b;if(d.triangulation_=new y.a(e,r,O,x,C*N,S),0===d.triangulation_.getTriangles().length)return d.state=s.a.EMPTY,d;d.sourceZ_=n.getZForResolution(C);var M=d.triangulation_.calculateSourceExtent();if(x&&(e.canWrapX()?(M[1]=Object(m.a)(M[1],x[1],x[3]),M[3]=Object(m.a)(M[3],x[1],x[3])):M=Object(_.A)(M,x)),Object(_.t)(M)){for(var L=n.getTileRangeForExtentAndZ(M,d.sourceZ_),I=L.minX;I<=L.maxX;I++)for(var P=L.minY;P<=L.maxY;P++){var j=l(d.sourceZ_,I,P,u);j&&d.sourceTiles_.push(j)}0===d.sourceTiles_.length&&(d.state=s.a.EMPTY)}else d.state=s.a.EMPTY;return d}return w(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,n,r){e&&e.getState()==s.a.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=s.a.ERROR;else{var e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),r="number"==typeof n?n:n[0],i="number"==typeof n?n:n[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),u=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Object(v.c)(r,i,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,u,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=s.a.LOADED}this.changed()},e.prototype.load=function(){if(this.state==s.a.IDLE){this.state=s.a.LOADING,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,n,r){var o=e.getState();if(o==s.a.IDLE||o==s.a.LOADING){t++;var a=Object(b.a)(e,i.a.CHANGE,(function(n){var r=e.getState();r!=s.a.LOADED&&r!=s.a.ERROR&&r!=s.a.EMPTY||(Object(b.c)(a),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(a)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,n){t.getState()==s.a.IDLE&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(b.c),this.sourcesListenerKeys_=null},e}(l),O=n(32),E=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var n=this.entries_[t];return Object(O.a)(void 0!==n,15),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_},t.prototype.remove=function(t){var e=this.entries_[t];return Object(O.a)(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.value_;return e},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 t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){Object(O.a)(!(t in this.entries_),16);var n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}(),S=n(91),C=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return C(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=this.peekFirstKey(),e=Object(S.b)(t)[0];this.forEach(function(t){t.tileCoord[0]!==e&&(this.remove(Object(S.c)(t.tileCoord)),t.release())}.bind(this))}},e}(E),M="tileloadstart",L="tileloadend",I="tileloaderror",P=n(71),j=n(201),A=n(13),R=n(176),T=n(66),F=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),k=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;n.on,n.once,n.un,n.opaque_=void 0!==e.opaque&&e.opaque,n.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,n.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var r=e.tileGrid;return r&&Object(T.d)(r.getTileSize(r.getMinZoom()),[256,256]),n.tileCache=new N(e.cacheSize||0),n.tmpSize=[0,0],n.key_=e.key||"",n.tileOptions={transition:e.transition},n.zDirection=e.zDirection?e.zDirection:0,n}return F(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var n=this.getTileCacheForProjection(t);n&&n.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,n,r){var i=this.getTileCacheForProjection(t);if(!i)return!1;for(var o,a,u,c=!0,l=n.minX;l<=n.maxX;++l)for(var h=n.minY;h<=n.maxY;++h)a=Object(S.d)(e,l,h),u=!1,i.containsKey(a)&&(u=(o=i.get(a)).getState()===s.a.LOADED)&&(u=!1!==r(o)),u||(c=!1);return c},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(t,e,n,r,i){return Object(a.b)()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Object(R.c)(t)},e.prototype.getTileCacheForProjection=function(t){return Object(O.a)(Object(A.c)(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,n){var r=this.getTileGridForProjection(n),i=this.getTilePixelRatio(e),o=Object(T.d)(r.getTileSize(t),this.tmpSize);return 1==i?o:Object(T.c)(o,i,this.tmpSize)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var n=void 0!==e?e:this.getProjection(),r=this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=Object(R.d)(r,t,n)),Object(S.f)(t,r)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var n=this.getTileCacheForProjection(e);t>n.highWaterMark&&(n.highWaterMark=t)},e.prototype.useTile=function(t,e,n,r){},e}(j.a),D=function(t){function e(e,n){var r=t.call(this,e)||this;return r.tile=n,r}return F(e,t),e}(P.a),B=k;function G(t,e){var n=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(s,a,u){return s?t.replace(n,s[0].toString()).replace(r,s[1].toString()).replace(i,s[2].toString()).replace(o,(function(){var t=s[0],n=e.getFullTileRange(t);return Object(O.a)(n,55),(n.getHeight()-s[2]-1).toString()})):void 0}}function q(t,e){for(var n=t.length,r=new Array(n),i=0;i=0;--E){var S=_[E],C=S.layer;if(C.hasRenderer()&&Object(l.b)(S,f)&&s.call(a,C)){var N=C.getRenderer(),M=C.getSource();if(N&&M){var L=M.getWrapX()?g:t,I=p.bind(null,S.managed);x[0]=L[0]+y[O][0],x[1]=L[1]+y[O][1],c=N.forEachFeatureAtCoordinate(x,e,n,I,w)}if(c)return c}}if(0!==w.length){var P=1/w.length;return w.forEach((function(t,e){return t.distanceSq+=e*P})),w.sort((function(t,e){return t.distanceSq-e.distanceSq})),w.some((function(t){return c=t.callback(t.feature,t.layer,t.geometry)})),c}},e.prototype.forEachLayerAtPixel=function(t,e,n,r,i){return Object(s.b)()},e.prototype.hasFeatureAtCoordinate=function(t,e,n,r,i,s){return void 0!==this.forEachFeatureAtCoordinate(t,e,n,r,o.b,this,i,s)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){Object(s.b)()},e.prototype.scheduleExpireIconCache=function(t){c.a.canExpireCache()&&t.postRenderFunctions.push(p)},e}(i.a),g=n(137),y=n(262),v=n(141),m=n(129),_=n(64),b=n(31),w=n(27),x=n(57),O=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=function(t){function e(e){var n=t.call(this,e)||this;n.fontChangeListenerKey_=Object(w.a)(b.a,g.a.PROPERTYCHANGE,e.redrawText.bind(e)),n.element_=document.createElement("div");var r=n.element_.style;r.position="absolute",r.width="100%",r.height="100%",r.zIndex="0",n.element_.className=_.e+" ol-layers";var i=e.getViewport();return i.insertBefore(n.element_,i.firstChild||null),n.children_=[],n.renderedVisible_=!0,n}return O(e,t),e.prototype.dispatchRenderEvent=function(t,e){var n=this.getMap();if(n.hasListener(t)){var r=new y.a(t,void 0,e);n.dispatchEvent(r)}},e.prototype.disposeInternal=function(){Object(w.c)(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(t){this.calculateMatrices2D(t),this.dispatchRenderEvent(v.a.PRECOMPOSE,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),n=t.viewState;this.children_.length=0;for(var r=[],i=null,o=0,s=e.length;o=0;--o)r[o].renderDeclutter(t);Object(x.f)(this.element_,this.children_),this.dispatchRenderEvent(v.a.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,n,r,i){for(var o=e.viewState,s=e.layerStatesArray,a=s.length-1;a>=0;--a){var u=s[a],c=u.layer;if(c.hasRenderer()&&Object(l.b)(u,o)&&i(c)){var h=c.getRenderer().getDataAtPixel(t,e,n);if(h){var f=r(c,h);if(f)return f}}}},e}(d),S=n(81),C=n(73),N=n(74),M=n(28),L=n(267),I=n(139),P=n(48),j=n(177),A=n(135),R=n(79),T=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),F=function(t){function e(e,n){var r=t.call(this,e)||this;r.map_=e,r.clickTimeoutId_,r.emulateClicks_=!1,r.dragging_=!1,r.dragListenerKeys_=[],r.moveTolerance_=void 0===n?1:n,r.down_=null;var i=r.map_.getViewport();return r.activePointers_=0,r.trackedTouches_={},r.element_=i,r.pointerdownListenerKey_=Object(w.a)(i,j.a.POINTERDOWN,r.handlePointerDown_,r),r.originalPointerMoveEvent_,r.relayedListenerKey_=Object(w.a)(i,j.a.POINTERMOVE,r.relayEvent_,r),r.boundHandleTouchMove_=r.handleTouchMove_.bind(r),r.element_.addEventListener(M.a.TOUCHMOVE,r.boundHandleTouchMove_,!!R.e&&{passive:!1}),r}return T(e,t),e.prototype.emulateClick_=function(t){var e=new I.a(P.a.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new I.a(P.a.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new I.a(P.a.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==P.a.POINTERUP||e.type==P.a.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==P.a.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new I.a(P.a.POINTERUP,this.map_,t);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(w.c),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.emulateClicks_=0===this.activePointers_,this.updateActivePointers_(t);var e=new I.a(P.a.POINTERDOWN,this.map_,t);for(var n in this.dispatchEvent(e),this.down_={},t){var r=t[n];this.down_[n]="function"==typeof r?o.c:r}if(0===this.dragListenerKeys_.length){var i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(Object(w.a)(i,P.a.POINTERMOVE,this.handlePointerMove_,this),Object(w.a)(i,P.a.POINTERUP,this.handlePointerUp_,this),Object(w.a)(this.element_,P.a.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(Object(w.a)(this.element_.getRootNode(),P.a.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new I.a(P.a.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},e.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new I.a(t.type,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){var e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(Object(w.c)(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(M.a.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Object(w.c)(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(w.c),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(A.a),k=n(212),D=n(203),B="layergroup",G="size",q="target",z="view",U=n(32),V=n(23),Y=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,Object(V.b)(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,n=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var r=this.keyFunction_(n);return delete this.queuedElements_[r],n},t.prototype.enqueue=function(t){Object(U.a)(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=1/0&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,n=this.priorities_,r=e.length,i=e[t],o=n[t],s=t;t>1;){var a=this.getLeftChildIndex_(t),u=this.getRightChildIndex_(t),c=ut;){var s=this.getParentIndex_(e);if(!(r[s]>o))break;n[e]=n[s],r[e]=r[s],e=s}n[e]=i,r[e]=o},t.prototype.reprioritize=function(){var t,e,n,r=this.priorityFunction_,i=this.elements_,o=this.priorities_,s=0,a=i.length;for(e=0;e0;)r=(n=this.dequeue()[0]).getKey(),n.getState()!==W.a.IDLE||r in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++i,n.load())},e}(Y);var K=n(124),Z=n(70),J=n(13),$=n(66),Q=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();var tt=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var n,r,i,o={},s=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new L.a({layers:t.layers});o[B]=s,o[q]=t.target,o[z]=t.view instanceof K.a?t.view:new K.a,void 0!==t.controls&&(Array.isArray(t.controls)?n=new C.a(t.controls.slice()):(Object(U.a)("function"==typeof t.controls.getArray,47),n=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?r=new C.a(t.interactions.slice()):(Object(U.a)("function"==typeof t.interactions.getArray,48),r=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?i=new C.a(t.overlays.slice()):(Object(U.a)("function"==typeof t.overlays.getArray,49),i=t.overlays):i=new C.a;return{controls:n,interactions:r,keyboardEventTarget:e,overlays:i,values:o}}(e);n.boundHandleBrowserEvent_=n.handleBrowserEvent.bind(n),n.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,n.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:R.a,n.postRenderTimeoutHandle_,n.animationDelayKey_,n.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(n),n.coordinateToPixelTransform_=Object(a.c)(),n.pixelToCoordinateTransform_=Object(a.c)(),n.frameIndex_=0,n.frameState_=null,n.previousExtent_=null,n.viewPropertyListenerKey_=null,n.viewChangeListenerKey_=null,n.layerGroupPropertyListenerKeys_=null,n.viewport_=document.createElement("div"),n.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),n.viewport_.style.position="relative",n.viewport_.style.overflow="hidden",n.viewport_.style.width="100%",n.viewport_.style.height="100%",n.overlayContainer_=document.createElement("div"),n.overlayContainer_.style.position="absolute",n.overlayContainer_.style.zIndex="0",n.overlayContainer_.style.width="100%",n.overlayContainer_.style.height="100%",n.overlayContainer_.style.pointerEvents="none",n.overlayContainer_.className="ol-overlaycontainer",n.viewport_.appendChild(n.overlayContainer_),n.overlayContainerStopEvent_=document.createElement("div"),n.overlayContainerStopEvent_.style.position="absolute",n.overlayContainerStopEvent_.style.zIndex="0",n.overlayContainerStopEvent_.style.width="100%",n.overlayContainerStopEvent_.style.height="100%",n.overlayContainerStopEvent_.style.pointerEvents="none",n.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",n.viewport_.appendChild(n.overlayContainerStopEvent_),n.mapBrowserEventHandler_=null,n.moveTolerance_=e.moveTolerance,n.keyboardEventTarget_=r.keyboardEventTarget,n.keyHandlerKeys_=null,n.controls=r.controls||new C.a,n.interactions=r.interactions||new C.a,n.overlays_=r.overlays,n.overlayIdIndex_={},n.renderer_=null,n.handleResize_,n.postRenderFunctions_=[],n.tileQueue_=new H(n.getTilePriority.bind(n),n.handleTileChange_.bind(n)),n.addChangeListener(B,n.handleLayerGroupChanged_),n.addChangeListener(z,n.handleViewChanged_),n.addChangeListener(G,n.handleSizeChanged_),n.addChangeListener(q,n.handleTargetChanged_),n.setProperties(r.values);var i=n;return!e.view||e.view instanceof K.a||e.view.then((function(t){i.setView(new K.a(t))})),n.controls.addEventListener(N.a.ADD,function(t){t.element.setMap(this)}.bind(n)),n.controls.addEventListener(N.a.REMOVE,function(t){t.element.setMap(null)}.bind(n)),n.interactions.addEventListener(N.a.ADD,function(t){t.element.setMap(this)}.bind(n)),n.interactions.addEventListener(N.a.REMOVE,function(t){t.element.setMap(null)}.bind(n)),n.overlays_.addEventListener(N.a.ADD,function(t){this.addOverlayInternal_(t.element)}.bind(n)),n.overlays_.addEventListener(N.a.REMOVE,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(n)),n.controls.forEach(function(t){t.setMap(this)}.bind(n)),n.interactions.forEach(function(t){t.setMap(this)}.bind(n)),n.overlays_.forEach(n.addOverlayInternal_.bind(n)),n}return Q(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,n){if(this.frameState_){var r=this.getCoordinateFromPixelInternal(t),i=void 0!==(n=void 0!==n?n:{}).hitTolerance?n.hitTolerance:0,s=void 0!==n.layerFilter?n.layerFilter:o.b,a=!1!==n.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,i,a,e,null,s,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var n=[];return this.forEachFeatureAtPixel(t,(function(t){n.push(t)}),e),n},e.prototype.forEachLayerAtPixel=function(t,e,n){if(this.frameState_){var r=n||{},i=void 0!==r.hitTolerance?r.hitTolerance:0,s=r.layerFilter||o.b;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,e,s)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var n=this.getCoordinateFromPixelInternal(t),r=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:o.b,i=void 0!==e.hitTolerance?e.hitTolerance:0,s=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,i,s,r,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),n="changedTouches"in t?t.changedTouches[0]:t;return[n.clientX-e.left,n.clientY-e.top]},e.prototype.getTarget=function(){return this.get(q)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return Object(J.m)(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?Object(a.a)(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(B)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof C.a)e.setLayers(t);else{var n=e.getLayers();n.clear(),n.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,n=t.length;e=0;a--){var u=s[a];if(u.getMap()===this&&u.getActive()&&this.getTargetElement())if(!u.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var n=this.maxTilesLoading_,r=n;if(t){var i=t.viewHints;if(i[Z.a.ANIMATING]||i[Z.a.INTERACTING]){var o=Date.now()-t.time>8;n=o?0:8,r=o?0:2}}e.getTilesLoading()0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!Object(a.b)(e,this.renderedAttributions_)){Object(c.d)(this.ulElement_);for(var r=0,i=e.length;r0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:p.b}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var n=e.viewState.rotation;if(n!=this.rotation_){var r="rotate("+n+"rad)";if(this.autoHide_){var i=this.element.classList.contains(s.c);i||0!==n?i&&0!==n&&this.element.classList.remove(s.c):this.element.classList.add(s.c)}this.label_.style.transform=r}this.rotation_=n}},e}(i.a),y=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),v=function(t){function e(e){var n=this,r=e||{};n=t.call(this,{element:document.createElement("div"),target:r.target})||this;var i=void 0!==r.className?r.className:"ol-zoom",a=void 0!==r.delta?r.delta:1,u=void 0!==r.zoomInClassName?r.zoomInClassName:i+"-in",c=void 0!==r.zoomOutClassName?r.zoomOutClassName:i+"-out",l=void 0!==r.zoomInLabel?r.zoomInLabel:"+",h=void 0!==r.zoomOutLabel?r.zoomOutLabel:"–",f=void 0!==r.zoomInTipLabel?r.zoomInTipLabel:"Zoom in",p=void 0!==r.zoomOutTipLabel?r.zoomOutTipLabel:"Zoom out",d=document.createElement("button");d.className=u,d.setAttribute("type","button"),d.title=f,d.appendChild("string"==typeof l?document.createTextNode(l):l),d.addEventListener(o.a.CLICK,n.handleClick_.bind(n,a),!1);var g=document.createElement("button");g.className=c,g.setAttribute("type","button"),g.title=p,g.appendChild("string"==typeof h?document.createTextNode(h):h),g.addEventListener(o.a.CLICK,n.handleClick_.bind(n,-a),!1);var y=i+" "+s.e+" "+s.b,v=n.element;return v.className=y,v.appendChild(d),v.appendChild(g),n.duration_=void 0!==r.duration?r.duration:250,n}return y(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var n=e.getZoom();if(void 0!==n){var r=e.getConstrainedZoom(n+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:r,duration:this.duration_,easing:p.b})):e.setZoom(r)}}},e}(i.a);function m(t){var e=t||{},n=new f.a;return(void 0===e.zoom||e.zoom)&&n.push(new v(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&n.push(new g(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&n.push(new h(e.attributionOptions)),n}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=function(){function t(t){var e=this;this._insertTag=function(t){var n;n=0===e.tags.length?e.insertionPoint?e.insertionPoint.nextSibling:e.prepend?e.container.firstChild:e.before:e.tags[e.tags.length-1].nextSibling,e.container.insertBefore(t,n),e.tags.push(t)},this.isSpeedy=void 0===t.speedy||t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.prepend=t.prepend,this.insertionPoint=t.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(t){t.forEach(this._insertTag)},e.insert=function(t){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),void 0!==t.nonce&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}(this));var e=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(t){if(t.sheet)return t.sheet;for(var e=0;e-1&&!t.return)switch(t.type){case i.a:t.return=function t(e,n){switch(Object(i.o)(e,n)){case 5103:return i.f+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return i.f+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return i.f+e+i.c+e+i.d+e+e;case 6828:case 4268:return i.f+e+i.d+e+e;case 6165:return i.f+e+i.d+"flex-"+e+e;case 5187:return i.f+e+Object(i.v)(e,/(\w+).+(:[^]+)/,i.f+"box-$1$2"+i.d+"flex-$1$2")+e;case 5443:return i.f+e+i.d+"flex-item-"+Object(i.v)(e,/flex-|-self/,"")+e;case 4675:return i.f+e+i.d+"flex-line-pack"+Object(i.v)(e,/align-content|flex-|-self/,"")+e;case 5548:return i.f+e+i.d+Object(i.v)(e,"shrink","negative")+e;case 5292:return i.f+e+i.d+Object(i.v)(e,"basis","preferred-size")+e;case 6060:return i.f+"box-"+Object(i.v)(e,"-grow","")+i.f+e+i.d+Object(i.v)(e,"grow","positive")+e;case 4554:return i.f+Object(i.v)(e,/([^-])(transform)/g,"$1"+i.f+"$2")+e;case 6187:return Object(i.v)(Object(i.v)(Object(i.v)(e,/(zoom-|grab)/,i.f+"$1"),/(image-set)/,i.f+"$1"),e,"")+e;case 5495:case 3959:return Object(i.v)(e,/(image-set\([^]*)/,i.f+"$1$`$1");case 4968:return Object(i.v)(Object(i.v)(e,/(.+:)(flex-)?(.*)/,i.f+"box-pack:$3"+i.d+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+i.f+e+e;case 4095:case 3583:case 4068:case 2532:return Object(i.v)(e,/(.+)-inline(.+)/,i.f+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Object(i.A)(e)-1-n>6)switch(Object(i.h)(e,n+1)){case 109:if(45!==Object(i.h)(e,n+4))break;case 102:return Object(i.v)(e,/(.+:)(.+)-([^]+)/,"$1"+i.f+"$2-$3$1"+i.c+(108==Object(i.h)(e,n+3)?"$3":"$2-$3"))+e;case 115:return~Object(i.p)(e,"stretch")?t(Object(i.v)(e,"stretch","fill-available"),n)+e:e}break;case 4949:if(115!==Object(i.h)(e,n+1))break;case 6444:switch(Object(i.h)(e,Object(i.A)(e)-3-(~Object(i.p)(e,"!important")&&10))){case 107:return Object(i.v)(e,":",":"+i.f)+e;case 101:return Object(i.v)(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+i.f+(45===Object(i.h)(e,14)?"inline-":"")+"box$3$1"+i.f+"$2$3$1"+i.d+"$2box$3")+e}break;case 5936:switch(Object(i.h)(e,n+11)){case 114:return i.f+e+i.d+Object(i.v)(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return i.f+e+i.d+Object(i.v)(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return i.f+e+i.d+Object(i.v)(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return i.f+e+i.d+e+e}return e}(t.value,t.length);break;case i.b:return Object(i.x)([Object(i.k)(t,{value:Object(i.v)(t.value,"@","@"+i.f)})],r);case i.e:if(t.length)return Object(i.i)(t.props,(function(e){switch(Object(i.q)(e,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Object(i.x)([Object(i.k)(t,{props:[Object(i.v)(e,/:(read-\w+)/,":"+i.c+"$1")]})],r);case"::placeholder":return Object(i.x)([Object(i.k)(t,{props:[Object(i.v)(e,/:(plac\w+)/,":"+i.f+"input-$1")]}),Object(i.k)(t,{props:[Object(i.v)(e,/:(plac\w+)/,":"+i.c+"$1")]}),Object(i.k)(t,{props:[Object(i.v)(e,/:(plac\w+)/,i.d+"input-$1")]})],r)}return""}))}}],h=function(t){var e=t.key;if("css"===e){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(t){-1!==t.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(t),t.setAttribute("data-s",""))}))}var o=t.stylisPlugins||l;var s,a,h={},f=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+e+' "]'),(function(t){for(var e=t.getAttribute("data-emotion").split(" "),n=1;np?d=Math.round(a/p):g=Math.round(h/f),d!==i||g!==o){var y=Object(c.a)(d,g);Object(u.a)(y,this.getContextOptions());var v=y.canvas;y.drawImage(r,0,0,i,o,0,0,v.width,v.height),this.image_.setImage(v)}}t.prototype.handleImageChange.call(this,e)},e}(o.a);e.a=p},function(t,e,n){"use strict";var r,i=n(142),o=n(204),s=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=['Map tiles by Stamen Design, under CC BY 3.0.',o.a],u={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},c={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},l=function(t){function e(e){var n=e.layer.indexOf("-"),r=-1==n?e.layer:e.layer.slice(0,n),i=c[r],o=u[e.layer],s=void 0!==e.url?e.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+e.layer+"/{z}/{x}/{y}."+o.extension;return t.call(this,{attributions:a,cacheSize:e.cacheSize,crossOrigin:"anonymous",imageSmoothing:e.imageSmoothing,maxZoom:null!=e.maxZoom?e.maxZoom:i.maxZoom,minZoom:null!=e.minZoom?e.minZoom:i.minZoom,opaque:o.opaque,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:s,wrapX:e.wrapX,zDirection:e.zDirection})||this}return s(e,t),e}(i.a);e.a=l},function(t,e,n){"use strict";var r,i=n(130),o=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e){var n=e||{};return t.call(this,n)||this}return o(e,t),e}(i.a),a=n(263),u=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),c=function(t){function e(e){return t.call(this,e)||this}return u(e,t),e.prototype.createRenderer=function(){return new a.a(this)},e}(s);e.a=c},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(122);function i(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Object(r.a)(t)););return t}function o(){return(o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=i(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}}).apply(this,arguments)}},,function(t,e,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function s(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,a,u=s(t),c=1;c({x:t,y:t});function u(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function c(t){return f(t)?(t.nodeName||"").toLowerCase():"#document"}function l(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function h(t){var e;return null==(e=(f(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function f(t){return t instanceof Node||t instanceof l(t).Node}function p(t){return t instanceof Element||t instanceof l(t).Element}function d(t){return t instanceof HTMLElement||t instanceof l(t).HTMLElement}function g(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof l(t).ShadowRoot)}function y(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=_(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function v(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function m(t){return["html","body","#document"].includes(c(t))}function _(t){return l(t).getComputedStyle(t)}function b(t){if("html"===c(t))return t;const e=t.assignedSlot||t.parentNode||g(t)&&t.host||h(t);return g(e)?e.host:e}function w(t,e,n){var r;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=function t(e){const n=b(e);return m(n)?e.ownerDocument?e.ownerDocument.body:e.body:d(n)&&y(n)?n:t(n)}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),s=l(i);return o?e.concat(s,s.visualViewport||[],y(i)?i:[],s.frameElement&&n?w(s.frameElement):[]):e.concat(i,w(i,[],n))}function x(t){const e=_(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=d(t),s=i?t.offsetWidth:n,a=i?t.offsetHeight:r,u=o(n)!==s||o(r)!==a;return u&&(n=s,r=a),{width:n,height:r,$:u}}function O(t){return p(t)?t:t.contextElement}function E(t){const e=O(t);if(!d(e))return a(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=x(e);let u=(s?o(n.width):n.width)/r,c=(s?o(n.height):n.height)/i;return u&&Number.isFinite(u)||(u=1),c&&Number.isFinite(c)||(c=1),{x:u,y:c}}const S=a(0);function C(t){const e=l(t);return v()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:S}function N(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),o=O(t);let s=a(1);e&&(r?p(r)&&(s=E(r)):s=E(t));const c=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==l(t))&&e}(o,n,r)?C(o):a(0);let h=(i.left+c.x)/s.x,f=(i.top+c.y)/s.y,d=i.width/s.x,g=i.height/s.y;if(o){const t=l(o),e=r&&p(r)?l(r):r;let n=t,i=n.frameElement;for(;i&&r&&e!==n;){const t=E(i),e=i.getBoundingClientRect(),r=_(i),o=e.left+(i.clientLeft+parseFloat(r.paddingLeft))*t.x,s=e.top+(i.clientTop+parseFloat(r.paddingTop))*t.y;h*=t.x,f*=t.y,d*=t.x,g*=t.y,h+=o,f+=s,n=l(i),i=n.frameElement}}return u({width:d,height:g,x:h,y:f})}function M(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:a=!0,ancestorResize:u=!0,elementResize:c="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:f=!1}=o,p=O(t),d=a||u?[...p?w(p):[],...w(e)]:[];d.forEach(t=>{a&&t.addEventListener("scroll",n,{passive:!0}),u&&t.addEventListener("resize",n)});const g=p&&l?function(t,e){let n,o=null;const a=h(t);function u(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function c(l,h){void 0===l&&(l=!1),void 0===h&&(h=1),u();const{left:f,top:p,width:d,height:g}=t.getBoundingClientRect();if(l||e(),!d||!g)return;const y={rootMargin:-s(p)+"px "+-s(a.clientWidth-(f+d))+"px "+-s(a.clientHeight-(p+g))+"px "+-s(f)+"px",threshold:i(0,r(1,h))||1};let v=!0;function m(t){const e=t[0].intersectionRatio;if(e!==h){if(!v)return c();e?c(!1,e):n=setTimeout(()=>{c(!1,1e-7)},100)}v=!1}try{o=new IntersectionObserver(m,{...y,root:a.ownerDocument})}catch(t){o=new IntersectionObserver(m,y)}o.observe(t)}(!0),u}(p,n):null;let y,v=-1,m=null;c&&(m=new ResizeObserver(t=>{let[r]=t;r&&r.target===p&&m&&(m.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var t;null==(t=m)||t.observe(e)})),n()}),p&&!f&&m.observe(p),m.observe(e));let _=f?N(t):null;return f&&function e(){const r=N(t);!_||r.x===_.x&&r.y===_.y&&r.width===_.width&&r.height===_.height||n();_=r,y=requestAnimationFrame(e)}(),n(),()=>{var t;d.forEach(t=>{a&&t.removeEventListener("scroll",n),u&&t.removeEventListener("resize",n)}),null==g||g(),null==(t=m)||t.disconnect(),m=null,f&&cancelAnimationFrame(y)}}},,,function(t,e,n){"use strict";var r,i=n(134),o=n(62),s=n(64),a=n(13),u=n(32),c=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l="degrees",h="imperial",f="nautical",p="metric",d="us",g=[1,2,5],y=function(t){function e(e){var n=this,r=e||{},i=void 0!==r.className?r.className:r.bar?"ol-scale-bar":"ol-scale-line";return(n=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).on,n.once,n.un,n.innerElement_=document.createElement("div"),n.innerElement_.className=i+"-inner",n.element.className=i+" "+s.e,n.element.appendChild(n.innerElement_),n.viewState_=null,n.minWidth_=void 0!==r.minWidth?r.minWidth:64,n.renderedVisible_=!1,n.renderedWidth_=void 0,n.renderedHTML_="",n.addChangeListener("units",n.handleUnitsChanged_),n.setUnits(r.units||p),n.scaleBar_=r.bar||!1,n.scaleBarSteps_=r.steps||4,n.scaleBarText_=r.text||!1,n.dpi_=r.dpi||void 0,n}return c(e,t),e.prototype.getUnits=function(){return this.get("units")},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set("units",t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,n=t.projection,r=this.getUnits(),i=r==l?o.b.DEGREES:o.b.METERS,s=Object(a.h)(n,t.resolution,e,i),c=this.minWidth_*(this.dpi_||25.4/.28)/(25.4/.28),y=c*s,v="";if(r==l){var m=a.a[o.b.DEGREES];(y*=m)=c)break;++O}x=this.scaleBar_?this.createScaleBar(b,_,v):_.toFixed(w<0?-w:0)+" "+v,this.renderedHTML_!=x&&(this.innerElement_.innerHTML=x,this.renderedHTML_=x),this.renderedWidth_!=b&&(this.innerElement_.style.width=b+"px",this.renderedWidth_=b),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,n){for(var r="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),i=[],o=t/this.scaleBarSteps_,s="#ffffff",a=0;a
'+this.createMarker("relative",a)+(a%2==0||2===this.scaleBarSteps_?this.createStepText(a,t,!1,e,n):"")+""),a===this.scaleBarSteps_-1&&i.push(this.createStepText(a+1,t,!0,e,n)),s="#ffffff"===s?"#000000":"#ffffff";return'
'+(this.scaleBarText_?'
'+r+"
":"")+i.join("")+"
"},e.prototype.createMarker=function(t,e){return'
'},e.prototype.createStepText=function(t,e,n,r,i){var o=(0===t?0:Math.round(r/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+i);return'
'+o+"
"},e.prototype.getScaleForResolution=function(){var t=Object(a.h)(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||25.4/.28,n=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*n*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(i.a);e.a=y},function(t,e,n){"use strict";function r(t){var e=Object.create(null);return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(110),i=n.n(r),o=function(t,e){return i()(t,e)}},,,,function(t,e,n){"use strict";var r=n(254),i=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,o=Object(r.a)((function(t){return i.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91}));e.a=o},,function(t,e,n){(function(r){var i,o;i=function(){"use strict";function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t){if("object"!==i(t.console)){t.console={};for(var e,n,r=t.console,o=function(){},s=["memory"],a="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");e=s.pop();)r[e]||(r[e]={});for(;n=a.pop();)r[n]||(r[n]=o)}var u,c,l,h,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";void 0===t.btoa&&(t.btoa=function(t){var e,n,r,i,o,s=0,a=0,u="",c=[];if(!t)return t;for(;e=(o=t.charCodeAt(s++)<<16|t.charCodeAt(s++)<<8|t.charCodeAt(s++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,c[a++]=f.charAt(e)+f.charAt(n)+f.charAt(r)+f.charAt(i),s>16&255,n=s>>8&255,r=255&s,c[u++]=64==i?String.fromCharCode(e):64==o?String.fromCharCode(e,n):String.fromCharCode(e,n,r),a>>0,r=new Array(n),i=1>>0,i=0;i>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i>16&255,r=c>>8&255,o=255&c}if(void 0===r||void 0===s&&n===r&&r===o)if("string"==typeof n)e=n+" "+a[0];else switch(t.precision){case 2:e=_(n/255)+" "+a[0];break;case 3:default:e=b(n/255)+" "+a[0]}else if(void 0===s||"object"===i(s)){if(s&&!isNaN(s.a)&&0===s.a)return["1.000","1.000","1.000",a[1]].join(" ");if("string"==typeof n)e=[n,r,o,a[1]].join(" ");else switch(t.precision){case 2:e=[_(n/255),_(r/255),_(o/255),a[1]].join(" ");break;default:case 3:e=[b(n/255),b(r/255),b(o/255),a[1]].join(" ")}}else if("string"==typeof n)e=[n,r,o,s,a[2]].join(" ");else switch(t.precision){case 2:e=[_(n/255),_(r/255),_(o/255),_(s/255),a[2]].join(" ");break;case 3:default:e=[b(n/255),b(r/255),b(o/255),b(s/255),a[2]].join(" ")}return e},gt=p.__private__.getFilters=function(){return c},yt=p.__private__.putStream=function(t){var e,n=(t=t||{}).data||"",r=t.filters||gt(),i=t.alreadyAppliedFilters||[],o=t.addLength1||!1,s=n.length;!0===r&&(r=["FlateEncode"]);var u=t.additionalKeyValues||[],c=(e=void 0!==a.API.processDataByFilters?a.API.processDataByFilters(n,r):{data:n,reverseChain:[]}).reverseChain+(Array.isArray(i)?i.join(" "):i.toString());0!==e.data.length&&(u.push({key:"Length",value:e.data.length}),!0===o&&u.push({key:"Length1",value:s})),0!=c.length&&(c.split("/").length-1==1?u.push({key:"Filter",value:c}):u.push({key:"Filter",value:"["+c+"]"})),q("<<");for(var l=0;l>"),0!==e.data.length&&(q("stream"),q(e.data),q("endstream"))},vt=p.__private__.putPage=function(t){t.mediaBox;var e=t.number,n=t.data,r=t.objId,i=t.contentsObjId;ct(r,!0),rt[M].mediaBox.topRightX,rt[M].mediaBox.bottomLeftX,rt[M].mediaBox.topRightY,rt[M].mediaBox.bottomLeftY,q("<>"),q("endobj");var o=n.join("\n");return ct(i,!0),yt({data:o,filters:gt()}),q("endobj"),r},mt=p.__private__.putPages=function(){var t,e,n=[];for(t=1;t<=nt;t++)rt[t].objId=ut(),rt[t].contentsObjId=ut();for(t=1;t<=nt;t++)n.push(vt({number:t,data:D[t],objId:rt[t].objId,contentsObjId:rt[t].contentsObjId,mediaBox:rt[t].mediaBox,cropBox:rt[t].cropBox,bleedBox:rt[t].bleedBox,trimBox:rt[t].trimBox,artBox:rt[t].artBox,userUnit:rt[t].userUnit,rootDictionaryObjId:ht,resourceDictionaryObjId:ft}));ct(ht,!0),q("<>"),q("endobj"),ot.publish("postPutPages")},_t=function(t,e,n){et.hasOwnProperty(e)||(et[e]={}),et[e][n]=t},bt=function(t,e,n,r,i){i=i||!1;var o="F"+(Object.keys(tt).length+1).toString(10),s={id:o,postScriptName:t,fontName:e,fontStyle:n,encoding:r,isStandardFont:i,metadata:{}};return ot.publish("addFont",{font:s,instance:this}),void 0!==o&&(tt[o]=s,_t(o,e,n)),o},wt=p.__private__.pdfEscape=p.pdfEscape=function(t,e){return function(t,e){var n,r,i,o,s,a,u,c,l;if(i=(e=e||{}).sourceEncoding||"Unicode",s=e.outputEncoding,(e.autoencode||s)&&tt[A].metadata&&tt[A].metadata[i]&&tt[A].metadata[i].encoding&&(o=tt[A].metadata[i].encoding,!s&&tt[A].encoding&&(s=tt[A].encoding),!s&&o.codePages&&(s=o.codePages[0]),"string"==typeof s&&(s=o[s]),s)){for(u=!1,a=[],n=0,r=t.length;n>8&&(u=!0);t=a.join("")}for(n=t.length;void 0===u&&0!==n;)t.charCodeAt(n-1)>>8&&(u=!0),n--;if(!u)return t;for(a=e.noBOM?[]:[254,255],n=0,r=t.length;n>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");a.push(l),a.push(c-(l<<8))}return String.fromCharCode.apply(void 0,a)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},xt=p.__private__.beginPage=function(t,e){var r,i="string"==typeof e&&e.toLowerCase();if("string"==typeof t&&(r=v(t.toLowerCase()))&&(t=r[0],e=r[1]),Array.isArray(t)&&(e=t[1],t=t[0]),(isNaN(t)||isNaN(e))&&(t=n[0],e=n[1]),i){switch(i.substr(0,1)){case"l":t>"),q("endobj")},Mt=p.__private__.putCatalog=function(t){var e=(t=t||{}).rootDictionaryObjId||ht;switch(at(),q("<<"),q("/Type /Catalog"),q("/Pages "+e+" 0 R"),I||(I="fullwidth"),I){case"fullwidth":q("/OpenAction [3 0 R /FitH null]");break;case"fullheight":q("/OpenAction [3 0 R /FitV null]");break;case"fullpage":q("/OpenAction [3 0 R /Fit]");break;case"original":q("/OpenAction [3 0 R /XYZ null null 1]");break;default:var n=""+I;"%"===n.substr(n.length-1)&&(I=parseInt(I)/100),"number"==typeof I&&q("/OpenAction [3 0 R /XYZ null null "+_(I)+"]")}switch(j||(j="continuous"),j){case"continuous":q("/PageLayout /OneColumn");break;case"single":q("/PageLayout /SinglePage");break;case"two":case"twoleft":q("/PageLayout /TwoColumnLeft");break;case"tworight":q("/PageLayout /TwoColumnRight")}P&&q("/PageMode /"+P),ot.publish("putCatalog"),q(">>"),q("endobj")},Lt=p.__private__.putTrailer=function(){q("trailer"),q("<<"),q("/Size "+($+1)),q("/Root "+$+" 0 R"),q("/Info "+($-1)+" 0 R"),q("/ID [ <"+w+"> <"+w+"> ]"),q(">>")},Pt=p.__private__.putHeader=function(){q("%PDF-"+d),q("%ºß¬à")},jt=p.__private__.putXRef=function(){var t=1,e="0000000000";for(q("xref"),q("0 "+($+1)),q("0000000000 65535 f "),t=1;t<=$;t++)"function"==typeof Q[t]?q((e+Q[t]()).slice(-10)+" 00000 n "):void 0!==Q[t]?q((e+Q[t]).slice(-10)+" 00000 n "):q("0000000000 00000 n ")},At=p.__private__.buildDocument=function(){k=!1,G=$=0,B=[],Q=[],it=[],ht=ut(),ft=ut(),ot.publish("buildDocument"),Pt(),mt(),function(){ot.publish("putAdditionalObjects");for(var t=0;t>"),q("endobj")));var e}(),ot.publish("putResources"),ct(ft,!0),q("<<"),function(){for(var t in q("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),q("/Font <<"),tt)tt.hasOwnProperty(t)&&(!1===h||!0===h&&f.hasOwnProperty(t))&&q("/"+t+" "+tt[t].objectNumber+" 0 R");q(">>"),q("/XObject <<"),ot.publish("putXobjectDict"),q(">>")}(),q(">>"),q("endobj"),ot.publish("postPutResources"),Nt(),Mt();var t=G;return jt(),Lt(),q("startxref"),q(""+t),q("%%EOF"),k=!0,B.join("\n")},Rt=p.__private__.getBlob=function(t){return new Blob([U(t)],{type:"application/pdf"})},Tt=p.output=p.__private__.output=((T=function(t,e){e=e||{};var n=At();switch("string"==typeof e?e={filename:e}:e.filename=e.filename||"generated.pdf",t){case void 0:return n;case"save":p.save(e.filename);break;case"arraybuffer":return U(n);case"blob":return Rt(n);case"bloburi":case"bloburl":if(void 0!==r.URL&&"function"==typeof r.URL.createObjectURL)return r.URL&&r.URL.createObjectURL(Rt(n))||void 0;console.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":return"data:application/pdf;filename="+e.filename+";base64,"+btoa(n);case"dataurlnewwindow":var i='',o=r.open();if(null!==o&&o.document.write(i),o||"undefined"==typeof safari)return o;case"datauri":case"dataurl":return r.document.location.href="data:application/pdf;filename="+e.filename+";base64,"+btoa(n);default:return null}}).foo=function(){try{return T.apply(this,arguments)}catch(n){var t=n.stack||"";~t.indexOf(" at ")&&(t=t.split(" at ")[1]);var e="Error in function "+t.split("\n")[0].split("<")[0]+": "+n.message;if(!r.console)throw new Error(e);r.console.error(e,n),r.alert&&alert(e)}},(T.foo.bar=T).foo),Ft=function(t){return!0===Array.isArray(st)&&-1":")"),et=1):(J=Ht(e),$=Kt(n),Q=(c?"<":"(")+x[Z]+(c?">":")")),void 0!==U&&void 0!==U[Z]&&(nt=U[Z]+" Tw\n"),0!==L.length&&0===Z?t.push(nt+L.join(" ")+" "+J.toFixed(2)+" "+$.toFixed(2)+" Tm\n"+Q):1===et||0===et&&0===Z?t.push(nt+J.toFixed(2)+" "+$.toFixed(2)+" Td\n"+Q):t.push(nt+Q);t=0===et?t.join(" Tj\nT* "):t.join(" Tj\n"),t+=" Tj\n";var rt="BT\n/"+A+" "+Y+" Tf\n"+(Y*h).toFixed(2)+" TL\n"+te+"\n";return rt+=l,rt+=t,q(rt+="ET"),f[A]=!0,p},p.__private__.lstext=p.lstext=function(t,e,n,r){return console.warn("jsPDF.lstext is deprecated"),this.text(t,e,n,{charSpace:r})},p.__private__.clip=p.clip=function(t){q("evenodd"===t?"W*":"W"),q("n")},p.__private__.clip_fixed=p.clip_fixed=function(t){console.log("clip_fixed is deprecated"),p.clip(t)};var Gt=p.__private__.isValidStyle=function(t){var e=!1;return-1!==[void 0,null,"S","F","DF","FD","f","f*","B","B*"].indexOf(t)&&(e=!0),e},qt=p.__private__.getStyle=function(t){var e="S";return"F"===t?e="f":"FD"===t||"DF"===t?e="B":"f"!==t&&"f*"!==t&&"B"!==t&&"B*"!==t||(e=t),e};p.__private__.line=p.line=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.line");return this.lines([[n-t,r-e]],t,e)},p.__private__.lines=p.lines=function(t,e,n,r,i,o){var s,a,u,c,l,h,f,p,d,g,y,v;if("number"==typeof t&&(v=n,n=e,e=t,t=v),r=r||[1,1],o=o||!1,isNaN(e)||isNaN(n)||!Array.isArray(t)||!Array.isArray(r)||!Gt(i)||"boolean"!=typeof o)throw new Error("Invalid arguments passed to jsPDF.lines");for(q(b(Ht(e))+" "+b(Kt(n))+" m "),s=r[0],a=r[1],c=t.length,g=e,y=n,u=0;u=s.length-1;if(E&&!S){_+=" ";continue}if(E||S){if(S)v=O;else if(t.multiline&&c<(f+2)*(b+2)+2)continue t}else{if(!t.multiline)continue t;if(c<(f+2)*(b+2)+2)continue t;v=O}for(var C="",N=y;N<=v;N++)C+=s[N]+" ";switch(C=" "==C.substr(C.length-1)?C.substr(0,C.length-1):C,m=x(C,t,u).width,t.textAlign){case"right":d=l-m-2;break;case"center":d=(l-m)/2;break;case"left":default:d=2}e+=a(d)+" "+a(g)+" Td\n",e+="("+o(C)+") Tj\n",e+=-a(d)+" 0 Td\n",g=-(u+2),m=0,y=v+1,b++,_=""}break}return i.text=e,i.fontSize=u,i},x=function(t,e,r){var i=n.internal.getFont(e.fontName,e.fontStyle),o=n.getStringUnitWidth(t,{font:i,fontSize:parseFloat(r),charSpace:0})*parseFloat(r);return{height:n.getStringUnitWidth("3",{font:i,fontSize:parseFloat(r),charSpace:0})*parseFloat(r)*1.5,width:o}},O={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},E=function(){n.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=n.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var r=t[e];r.objId=void 0,r.hasAnnotation&&S.call(n,r)}},S=function(t){var e={type:"reference",object:t};void 0===n.internal.getPageInfo(t.page).pageContext.annotations.find((function(t){return t.type===e.type&&t.object===e.object}))&&n.internal.getPageInfo(t.page).pageContext.annotations.push(e)},C=function(){if(void 0===n.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");n.internal.write("/AcroForm "+n.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")},N=function(){n.internal.events.unsubscribe(n.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete n.internal.acroformPlugin.acroFormDictionaryRoot._eventID,n.internal.acroformPlugin.printedOut=!0},M=function(t){var e=!t;for(var r in t||(n.internal.newObjectDeferredBegin(n.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),n.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),t=t||n.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(t.hasOwnProperty(r)){var o=t[r],s=[],a=o.Rect;if(o.Rect&&(o.Rect=_.call(this,o.Rect)),n.internal.newObjectDeferredBegin(o.objId,!0),o.DA=H.createDefaultAppearanceStream(o),"object"===i(o)&&"function"==typeof o.getKeyValueListForStream&&(s=o.getKeyValueListForStream()),o.Rect=a,o.hasAppearanceStream&&!o.appearanceStreamContent){var u=b.call(this,o);s.push({key:"AP",value:"<>"}),n.internal.acroformPlugin.xForms.push(u)}if(o.appearanceStreamContent){var c="";for(var l in o.appearanceStreamContent)if(o.appearanceStreamContent.hasOwnProperty(l)){var h=o.appearanceStreamContent[l];if(c+="/"+l+" ",c+="<<",1<=Object.keys(h).length||Array.isArray(h))for(var r in h){var f;h.hasOwnProperty(r)&&("function"==typeof(f=h[r])&&(f=f.call(this,o)),c+="/"+r+" "+f+" ",0<=n.internal.acroformPlugin.xForms.indexOf(f)||n.internal.acroformPlugin.xForms.push(f))}else"function"==typeof(f=h)&&(f=f.call(this,o)),c+="/"+r+" "+f,0<=n.internal.acroformPlugin.xForms.indexOf(f)||n.internal.acroformPlugin.xForms.push(f);c+=">>"}s.push({key:"AP",value:"<<\n"+c+">>"})}n.internal.putStream({additionalKeyValues:s}),n.internal.out("endobj")}e&&L.call(this,n.internal.acroformPlugin.xForms)},L=function(t){for(var e in t)if(t.hasOwnProperty(e)){var r=e,o=t[e];n.internal.newObjectDeferredBegin(o&&o.objId,!0),"object"===i(o)&&"function"==typeof o.putStream&&o.putStream(),delete t[r]}},I=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(n=this,F.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(O)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");r=n.internal.scaleFactor,n.internal.acroformPlugin.acroFormDictionaryRoot=new T,n.internal.acroformPlugin.acroFormDictionaryRoot._eventID=n.internal.events.subscribe("postPutResources",N),n.internal.events.subscribe("buildDocument",E),n.internal.events.subscribe("putCatalog",C),n.internal.events.subscribe("postPutPages",M),n.internal.acroformPlugin.isInitialized=!0}},P=t.__acroform__.arrayToPdfArray=function(t){if(Array.isArray(t)){for(var e="[",n=0;n>"),n.join("\n")}},set:function(t){"object"===i(t)&&(e=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(t){"string"==typeof t&&(e.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(e){t="/"+e}})};c(q,F);var z=function(){q.call(this),this.pushButton=!0};c(z,q);var U=function(){q.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=void 0!==e?e:[]}})};c(U,q);var V=function(){var t,e;F.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(t){e=t}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t,e=[];for(t in e.push("<<"),r)e.push("/"+t+" ("+r[t]+")");return e.push(">>"),e.join("\n")},set:function(t){"object"===i(t)&&(r=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(t){"string"==typeof t&&(r.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(t){n="/"+t}}),this.optionName=name,this.caption="l",this.appearanceState="Off",this._AppearanceType=H.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(name)};c(V,F),U.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t)||!("getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},U.prototype.createOption=function(t){this.Kids.length;var e=new V;return e.Parent=this,e.optionName=t,this.Kids.push(e),K.call(this,e),e};var Y=function(){q.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=H.CheckBox.createAppearanceStream()};c(Y,q);var W=function(){F.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,13))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,13):this.Ff=m(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,21))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,21):this.Ff=m(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,23):this.Ff=m(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,24))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,24):this.Ff=m(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,25))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,25):this.Ff=m(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,26):this.Ff=m(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){Number.isInteger(e)&&(t=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};c(W,F);var X=function(){W.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,14))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,14):this.Ff=m(this.Ff,14)}}),this.password=!0};c(X,W);var H={CheckBox:{createAppearanceStream:function(){return{N:{On:H.CheckBox.YesNormal},D:{On:H.CheckBox.YesPushDown,Off:H.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=f(t),r=[],i=n.internal.getFont(t.fontName,t.fontStyle).id,o=n.__private__.encodeColorString(t.color),s=w(t,t.caption);return r.push("0.749023 g"),r.push("0 0 "+a(H.internal.getWidth(t))+" "+a(H.internal.getHeight(t))+" re"),r.push("f"),r.push("BMC"),r.push("q"),r.push("0 0 1 rg"),r.push("/"+i+" "+a(s.fontSize)+" Tf "+o),r.push("BT"),r.push(s.text),r.push("ET"),r.push("Q"),r.push("EMC"),e.stream=r.join("\n"),e},YesNormal:function(t){var e=f(t),r=n.internal.getFont(t.fontName,t.fontStyle).id,i=n.__private__.encodeColorString(t.color),o=[],s=H.internal.getHeight(t),u=H.internal.getWidth(t),c=w(t,t.caption);return o.push("1 g"),o.push("0 0 "+a(u)+" "+a(s)+" re"),o.push("f"),o.push("q"),o.push("0 0 1 rg"),o.push("0 0 "+a(u-1)+" "+a(s-1)+" re"),o.push("W"),o.push("n"),o.push("0 g"),o.push("BT"),o.push("/"+r+" "+a(c.fontSize)+" Tf "+i),o.push(c.text),o.push("ET"),o.push("Q"),e.stream=o.join("\n"),e},OffPushDown:function(t){var e=f(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+a(H.internal.getWidth(t))+" "+a(H.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:H.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=H.RadioButton.Circle.YesNormal,e.D[t]=H.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=f(t),n=[],r=H.internal.getWidth(t)<=H.internal.getHeight(t)?H.internal.getWidth(t)/4:H.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=H.internal.Bezier_C,o=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+u(H.internal.getWidth(t)/2)+" "+u(H.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=f(t),n=[],r=H.internal.getWidth(t)<=H.internal.getHeight(t)?H.internal.getWidth(t)/4:H.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*H.internal.Bezier_C).toFixed(5)),s=Number((r*H.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+u(H.internal.getWidth(t)/2)+" "+u(H.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+u(H.internal.getWidth(t)/2)+" "+u(H.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+s+" "+s+" "+r+" 0 "+r+" c"),n.push("-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c"),n.push("-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c"),n.push(s+" -"+r+" "+r+" -"+s+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=f(t),n=[],r=H.internal.getWidth(t)<=H.internal.getHeight(t)?H.internal.getWidth(t)/4:H.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*H.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+u(H.internal.getWidth(t)/2)+" "+u(H.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:H.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=H.RadioButton.Cross.YesNormal,e.D[t]=H.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=f(t),n=[],r=H.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+a(H.internal.getWidth(t)-2)+" "+a(H.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(a(r.x1.x)+" "+a(r.x1.y)+" m"),n.push(a(r.x2.x)+" "+a(r.x2.y)+" l"),n.push(a(r.x4.x)+" "+a(r.x4.y)+" m"),n.push(a(r.x3.x)+" "+a(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=f(t),n=H.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+a(H.internal.getWidth(t))+" "+a(H.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+a(H.internal.getWidth(t)-2)+" "+a(H.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(a(n.x1.x)+" "+a(n.x1.y)+" m"),r.push(a(n.x2.x)+" "+a(n.x2.y)+" l"),r.push(a(n.x4.x)+" "+a(n.x4.y)+" m"),r.push(a(n.x3.x)+" "+a(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join("\n"),e},OffPushDown:function(t){var e=f(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+a(H.internal.getWidth(t))+" "+a(H.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}}},createDefaultAppearanceStream:function(t){var e=n.internal.getFont(t.fontName,t.fontStyle).id,r=n.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+r}};H.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=H.internal.getWidth(t),n=H.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},H.internal.getWidth=function(t){var e=0;return"object"===i(t)&&(e=l(t.Rect[2])),e},H.internal.getHeight=function(t){var e=0;return"object"===i(t)&&(e=l(t.Rect[3])),e};var K=t.addField=function(t){if(I.call(this),!(t instanceof F))throw new Error("Invalid argument passed to jsPDF.addField.");return function(t){n.internal.acroformPlugin.printedOut&&(n.internal.acroformPlugin.printedOut=!1,n.internal.acroformPlugin.acroFormDictionaryRoot=null),n.internal.acroformPlugin.acroFormDictionaryRoot||I.call(n),n.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)}.call(this,t),t.page=n.internal.getCurrentPageInfo().pageNumber,this};t.addButton=function(t){if(t instanceof q==0)throw new Error("Invalid argument passed to jsPDF.addButton.");return K.call(this,t)},t.addTextField=function(t){if(t instanceof W==0)throw new Error("Invalid argument passed to jsPDF.addTextField.");return K.call(this,t)},t.addChoiceField=function(t){if(t instanceof k==0)throw new Error("Invalid argument passed to jsPDF.addChoiceField.");return K.call(this,t)},"object"==i(e)&&void 0===e.ChoiceField&&void 0===e.ListBox&&void 0===e.ComboBox&&void 0===e.EditBox&&void 0===e.Button&&void 0===e.PushButton&&void 0===e.RadioButton&&void 0===e.CheckBox&&void 0===e.TextField&&void 0===e.PasswordField?(e.ChoiceField=k,e.ListBox=D,e.ComboBox=B,e.EditBox=G,e.Button=q,e.PushButton=z,e.RadioButton=U,e.CheckBox=Y,e.TextField=W,e.PasswordField=X,e.AcroForm={Appearance:H}):console.warn("AcroForm-Classes are not populated into global-namespace, because the class-Names exist already."),t.AcroFormChoiceField=k,t.AcroFormListBox=D,t.AcroFormComboBox=B,t.AcroFormEditBox=G,t.AcroFormButton=q,t.AcroFormPushButton=z,t.AcroFormRadioButton=U,t.AcroFormCheckBox=Y,t.AcroFormTextField=W,t.AcroFormPasswordField=X,t.AcroFormAppearance=H,t.AcroForm={ChoiceField:k,ListBox:D,ComboBox:B,EditBox:G,Button:q,PushButton:z,RadioButton:U,CheckBox:Y,TextField:W,PasswordField:X,Appearance:H}})((window.tmp=dt).API,"undefined"!=typeof window&&window||void 0!==r&&r),function(t){var e="addImage_",n={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},r=t.getImageFileTypeByImageData=function(e,r){var i,o;r=r||"UNKNOWN";var s,a,u,c="UNKNOWN";for(u in t.isArrayBufferView(e)&&(e=t.arrayBufferToBinaryString(e)),n)for(s=n[u],i=0;i>"}),"trns"in e&&e.trns.constructor==Array){for(var a="",u=0,c=e.trns.length;u>18]+r[(258048&e)>>12]+r[(4032&e)>>6]+r[63&e];return 1==s?n+=r[(252&(e=i[a]))>>2]+r[(3&e)<<4]+"==":2==s&&(n+=r[(64512&(e=i[a]<<8|i[a+1]))>>10]+r[(1008&e)>>4]+r[(15&e)<<2]+"="),n},t.createImageInfo=function(t,e,n,r,i,o,s,a,u,c,l,h,f){var p={alias:a,w:e,h:n,cs:r,bpc:i,i:s,data:t};return o&&(p.f=o),u&&(p.dp=u),c&&(p.trns=c),l&&(p.pal=l),h&&(p.smask=h),f&&(p.p=f),p},t.addImage=function(n,r,o,f,p,d,g,y,v){var m="";if("string"!=typeof r){var _=d;d=p,p=f,f=o,o=r,r=_}if("object"===i(n)&&!c(n)&&"imageData"in n){var b=n;n=b.imageData,r=b.format||r||"UNKNOWN",o=b.x||o||0,f=b.y||f||0,p=b.w||p,d=b.h||d,g=b.alias||g,y=b.compression||y,v=b.rotation||b.angle||v}var w=this.internal.getFilters();if(void 0===y&&-1!==w.indexOf("FlateEncode")&&(y="SLOW"),"string"==typeof n&&(n=unescape(n)),isNaN(o)||isNaN(f))throw console.error("jsPDF.addImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addImage");var x,O,E,S,C,N,M,L=function(){var t=this.internal.collections[e+"images"];return t||(this.internal.collections[e+"images"]=t={},this.internal.events.subscribe("putResources",s),this.internal.events.subscribe("putXobjectDict",a)),t}.call(this);if(!((x=h(n,L))||(c(n)&&(n=l(n,r)),(null==(M=g)||0===M.length)&&(g="string"==typeof(N=n)?t.sHashCode(N):t.isArrayBufferView(N)?t.sHashCode(t.arrayBufferToBinaryString(N)):null),x=h(g,L)))){if(this.isString(n)&&(""!==(m=this.convertStringToImageData(n))||void 0!==(m=t.loadFile(n)))&&(n=m),r=this.getImageFileTypeByImageData(n,r),!u(r))throw new Error("addImage does not support files of type '"+r+"', please ensure that a plugin for '"+r+"' support is added.");if(this.supportsArrayBuffer()&&(n instanceof Uint8Array||(O=n,n=this.binaryStringToUint8Array(n))),!(x=this["process"+r.toUpperCase()](n,(C=0,(S=L)&&(C=Object.keys?Object.keys(S).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(S)),C),g,((E=y)&&"string"==typeof E&&(E=E.toUpperCase()),E in t.image_compression?E:t.image_compression.NONE),O)))throw new Error("An unknown error occurred whilst processing the image")}return function(t,e,n,r,i,o,s,a){var u=function(t,e,n){return t||e||(e=t=-96),t<0&&(t=-1*n.w*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.h*72/e/this.internal.scaleFactor),0===t&&(t=e*n.w/n.h),0===e&&(e=t*n.h/n.w),[t,e]}.call(this,n,r,i),c=this.internal.getCoordinateString,l=this.internal.getVerticalCoordinateString;if(n=u[0],r=u[1],s[o]=i,a){a*=Math.PI/180;var h=Math.cos(a),f=Math.sin(a),p=function(t){return t.toFixed(4)},d=[p(h),p(f),p(-1*f),p(h),0,0,"cm"]}this.internal.write("q"),a?(this.internal.write([1,"0","0",1,c(t),l(e+r),"cm"].join(" ")),this.internal.write(d.join(" ")),this.internal.write([c(n),"0","0",c(r),"0","0","cm"].join(" "))):this.internal.write([c(n),"0","0",c(r),c(t),l(e+r),"cm"].join(" ")),this.internal.write("/I"+i.i+" Do"),this.internal.write("Q")}.call(this,o,f,p,d,x,x.i,L,v),this},t.convertStringToImageData=function(e){var n,r="";if(this.isString(e)){var i;n=null!==(i=this.extractImageFromDataUrl(e))?i.data:e;try{r=atob(n)}catch(e){throw t.validateStringAsBase64(n)?new Error("atob-Error in jsPDF.convertStringToImageData "+e.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertStringToImageData ")}}return r};var f=function(t,e){return t.subarray(e,e+5)};t.processJPEG=function(t,e,n,i,o,s){var a,u=this.decode.DCT_DECODE;if(!this.isString(t)&&!this.isArrayBuffer(t)&&!this.isArrayBufferView(t))return null;if(this.isString(t)&&(a=function(t){var e;if("JPEG"!==r(t))throw new Error("getJpegSize requires a binary string jpeg file");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),i=4,o=t.length;i>",c.content=y;var f=c.objId+" 0 R";y="<>";else if(u.options.pageNumber)switch(y="<>",this.internal.write(y))}}this.internal.write("]")}}]),s.createAnnotation=function(t){var e=this.internal.getCurrentPageInfo();switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":e.pageContext.annotations.push(t)}},s.link=function(t,e,n,r,i){this.internal.getCurrentPageInfo().pageContext.annotations.push({x:t,y:e,w:n,h:r,options:i,type:"link"})},s.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(t,e,n),n+=.2*o,this.link(e,n-o,i,o,r),i},s.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor},function(t){var e={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},n={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},r={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];t.__arabicParser__={};var o=t.__arabicParser__.isInArabicSubstitutionA=function(t){return void 0!==e[t.charCodeAt(0)]},s=t.__arabicParser__.isArabicLetter=function(t){return"string"==typeof t&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(t)},a=t.__arabicParser__.isArabicEndLetter=function(t){return s(t)&&o(t)&&e[t.charCodeAt(0)].length<=2},u=t.__arabicParser__.isArabicAlfLetter=function(t){return s(t)&&0<=i.indexOf(t.charCodeAt(0))},c=(t.__arabicParser__.arabicLetterHasIsolatedForm=function(t){return s(t)&&o(t)&&1<=e[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasFinalForm=function(t){return s(t)&&o(t)&&2<=e[t.charCodeAt(0)].length}),l=(t.__arabicParser__.arabicLetterHasInitialForm=function(t){return s(t)&&o(t)&&3<=e[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasMedialForm=function(t){return s(t)&&o(t)&&4==e[t.charCodeAt(0)].length}),h=t.__arabicParser__.resolveLigatures=function(t){var e=0,r=n,i=0,o="",s=0;for(e=0;e>"),this.internal.out("endobj")})),this.internal.events.subscribe("putCatalog",(function(){this.internal.out("/OpenAction "+e+" 0 R")}))}return this},a=dt.API,(u=function(){var t=void 0;Object.defineProperty(this,"pdf",{get:function(){return t},set:function(e){t=e}});var e=150;Object.defineProperty(this,"width",{get:function(){return e},set:function(t){e=isNaN(t)||!1===Number.isInteger(t)||t<0?150:t,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=e+1)}});var n=300;Object.defineProperty(this,"height",{get:function(){return n},set:function(t){n=isNaN(t)||!1===Number.isInteger(t)||t<0?300:t,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=n+1)}});var r=[];Object.defineProperty(this,"childNodes",{get:function(){return r},set:function(t){r=t}});var i={};Object.defineProperty(this,"style",{get:function(){return i},set:function(t){i=t}}),Object.defineProperty(this,"parentNode",{get:function(){return!1}})}).prototype.getContext=function(t,e){var n;if("2d"!==(t=t||"2d"))return null;for(n in e)this.pdf.context2d.hasOwnProperty(n)&&(this.pdf.context2d[n]=e[n]);return(this.pdf.context2d._canvas=this).pdf.context2d},u.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},a.events.push(["initialized",function(){this.canvas=new u,this.canvas.pdf=this}]),c=dt.API,h={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},f=1,p=function(t,e,n,r,i){h={x:t,y:e,w:n,h:r,ln:i}},d=function(){return h},g={left:0,top:0,bottom:0},c.setHeaderFunction=function(t){l=t},c.getTextDimensions=function(t,e){var n=this.table_font_size||this.internal.getFontSize(),r=(this.internal.getFont().fontStyle,(e=e||{}).scaleFactor||this.internal.scaleFactor),i=0,o=0,s=0;if("string"==typeof t)0!=(i=this.getStringUnitWidth(t)*n)&&(o=1);else{if("[object Array]"!==Object.prototype.toString.call(t))throw new Error("getTextDimensions expects text-parameter to be of type String or an Array of Strings.");for(var a=0;a=this.internal.pageSize.getHeight()-c.bottom&&(this.cellAddPage(),u=!0,this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(o,!0)),e=d().y+d().h,u&&(e=23)}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,"FD"):this.rect(t,e,n,r),"right"===s){i instanceof Array||(i=[i]);for(var l=0;l=2*Math.PI&&(r=0,i=2*Math.PI),this.path.push({type:"arc",x:t,y:e,radius:n,startAngle:r,endAngle:i,counterclockwise:o})},c.prototype.arcTo=function(t,e,n,r,i){throw new Error("arcTo not implemented.")},c.prototype.rect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.lineTo(t+n,e),this.lineTo(t,e)},c.prototype.fillRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!h.call(this)){var i={};"butt"!==this.lineCap&&(i.lineCap=this.lineCap,this.lineCap="butt"),"miter"!==this.lineJoin&&(i.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(t,e,n,r),this.fill(),i.hasOwnProperty("lineCap")&&(this.lineCap=i.lineCap),i.hasOwnProperty("lineJoin")&&(this.lineJoin=i.lineJoin)}},c.prototype.strokeRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");f.call(this)||(this.beginPath(),this.rect(t,e,n,r),this.stroke())},c.prototype.clearRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(t,e,n,r))},c.prototype.save=function(t){t="boolean"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n"},m=function(t){var e,n,r,i,o,s=String,a="length",u="charCodeAt",c="slice",l="replace";for(t[c](-2),t=t[c](0,-2)[l](/\s/g,"")[l]("z","!!!!!"),r=[],i=0,o=(t+=e="uuuuu"[c](t[a]%5||5))[a];i>24,255&n>>16,255&n>>8,255&n);return function(t,n){for(var r=e[a];0"},b=function(t){var e=new RegExp(/^([0-9A-Fa-f]{2})+$/);if(-1!==(t=t.replace(/\s/g,"")).indexOf(">")&&(t=t.substr(0,t.indexOf(">"))),t.length%2&&(t+="0"),!1===e.test(t))return"";for(var n="",r=0;r>8&255,n>>16&255,n>>24&255]),t.length+2),String.fromCharCode.apply(null,i)},y.processDataByFilters=function(t,e){var n=0,r=t||"",i=[];for("string"==typeof(e=e||[])&&(e=[e]),n=0;n>"),this.internal.out("endobj"),L=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+I+")"),this.internal.out(">>"),this.internal.out("endobj")})),this.internal.events.subscribe("putCatalog",(function(){void 0!==M&&void 0!==L&&this.internal.out("/Names <>")})),this},(P=dt.API).events.push(["postPutResources",function(){var t=this,e=/^(\d+) 0 obj$/;if(0> endobj")}var h=t.internal.newObject();for(t.internal.write("<< /Names [ "),r=0;r>","endobj"),t.internal.newObject(),t.internal.write("<< /Dests "+h+" 0 R"),t.internal.write(">>","endobj")}}]),P.events.push(["putCatalog",function(){0> \r\nendobj\r\n"},t.outline.count_r=function(t,e){for(var n=0;n>>24&255,f[h++]=a>>>16&255,f[h++]=a>>>8&255,f[h++]=255&a,j.arrayBufferToBinaryString(f)},T=function(t,e){var n=Math.LOG2E*Math.log(32768)-8<<4|8,r=n<<8;return r|=Math.min(3,(e-1&255)>>1)<<6,r|=0,[n,255&(r+=31-r%31)]},F=function(t,e){for(var n,r=1,i=0,o=t.length,s=0;0>>0},k=function(t,e,n,r){for(var i,o,s,a=t.length/e,u=new Uint8Array(t.length+a),c=V(),l=0;l>>1)&255;return o},z=function(t,e,n){var r,i,o,s,a=[],u=0,c=t.length;for(a[0]=4;u>>d&255,d+=o.bits;v[_]=w>>>d&255}if(16===o.bits){g=(C=new Uint32Array(o.decodePixels().buffer)).length,y=new Uint8Array(g*(32/o.pixelBitlength)*o.colors),v=new Uint8Array(g*(32/o.pixelBitlength));for(var w,x=1>>0&255,x&&(y[b++]=w>>>16&255,w=C[_++],y[b++]=w>>>0&255),v[O++]=w>>>16&255;p=8}r!==j.image_compression.NONE&&A()?(t=R(y,o.width*o.colors,o.colors,r),l=R(v,o.width,1,r)):(t=y,l=v,f=null)}if(3===o.colorType&&(h=this.color_spaces.INDEXED,c=o.palette,o.transparency.indexed)){var E=o.transparency.indexed,S=0;for(_=0,g=E.length;_r&&(i.push(t.slice(u,o)),a=0,u=o),a+=e[o],o++;return u!==o&&i.push(t.slice(u,o)),i},tt=function(t,e,n){n||(n={});var r,i,o,s,a,u,c=[],l=[c],h=n.textIndent||0,f=0,p=0,d=t.split(" "),g=Z.apply(this,[" ",n])[0];if(u=-1===n.lineIndent?d[0].length+2:n.lineIndent||0){var y=Array(u).join(" "),v=[];d.map((function(t){1<(t=t.split(/\s*\n/)).length?v=v.concat(t.map((function(t,e){return(e&&t.length?"\n":"")+t}))):v.push(t[0])})),d=v,u=$.apply(this,[y,n])}for(o=0,s=d.length;o>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},ut=dt.API,ht=lt=ct="",ut.addMetadata=function(t,e){return lt=e||"http://jspdf.default.namespaceuri/",ct=t,this.internal.events.subscribe("postPutResources",(function(){if(ct){var t='',e=unescape(encodeURIComponent('')),n=unescape(encodeURIComponent(t)),r=unescape(encodeURIComponent(ct)),i=unescape(encodeURIComponent("")),o=unescape(encodeURIComponent("")),s=n.length+r.length+i.length+e.length+o.length;ht=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+s+" >>"),this.internal.write("stream"),this.internal.write(e+n+r+i+o),this.internal.write("endstream"),this.internal.write("endobj")}else ht=""})),this.internal.events.subscribe("putCatalog",(function(){ht&&this.internal.write("/Metadata "+ht+" 0 R")})),this},function(t,e){var n=t.API,r=n.pdfEscape16=function(t,e){for(var n,r=e.metadata.Unicode.widths,i=["","0","00","000","0000"],o=[""],s=0,a=t.length;s<"+i+">");return r.length&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),o+"endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};n.events.push(["putFont",function(e){!function(e,n,r,o){if(e.metadata instanceof t.API.TTFFont&&"Identity-H"===e.encoding){for(var s=e.metadata.Unicode.widths,a=e.metadata.subset.encode(e.metadata.glyIdsUsed,1),u="",c=0;c>"),n("endobj");var p=r();n("<<"),n("/Type /Font"),n("/BaseFont /"+e.fontName),n("/FontDescriptor "+f+" 0 R"),n("/W "+t.API.PDFObject.convert(s)),n("/CIDToGIDMap /Identity"),n("/DW 1000"),n("/Subtype /CIDFontType2"),n("/CIDSystemInfo"),n("<<"),n("/Supplement 0"),n("/Registry (Adobe)"),n("/Ordering ("+e.encoding+")"),n(">>"),n(">>"),n("endobj"),e.objectNumber=r(),n("<<"),n("/Type /Font"),n("/Subtype /Type0"),n("/ToUnicode "+h+" 0 R"),n("/BaseFont /"+e.fontName),n("/Encoding /"+e.encoding),n("/DescendantFonts ["+p+" 0 R]"),n(">>"),n("endobj"),e.isAlreadyPutted=!0}}(e.font,e.out,e.newObject,e.putStream)}]),n.events.push(["putFont",function(e){!function(e,n,r,o){if(e.metadata instanceof t.API.TTFFont&&"WinAnsiEncoding"===e.encoding){e.metadata.Unicode.widths;for(var s=e.metadata.rawData,a="",u=0;u>"),n("endobj"),e.objectNumber=r(),u=0;u>"),n("endobj"),e.isAlreadyPutted=!0}}(e.font,e.out,e.newObject,e.putStream)}]);var o=function(t){var e,n,i=t.text||"",o=t.x,s=t.y,a=t.options||{},u=t.mutex||{},c=u.pdfEscape,l=u.activeFontKey,h=u.fonts,f=(u.activeFontSize,""),p=0,d="",g=h[n=l].encoding;if("Identity-H"!==h[n].encoding)return{text:i,x:o,y:s,options:a,mutex:u};for(d=i,n=l,"[object Array]"===Object.prototype.toString.call(i)&&(d=i[0]),p=0;pu-c.top-c.bottom&&r.pagesplit){var d=function(t,e,n,i,o){var s=document.createElement("canvas");s.height=o,s.width=i;var a=s.getContext("2d");return a.mozImageSmoothingEnabled=!1,a.webkitImageSmoothingEnabled=!1,a.msImageSmoothingEnabled=!1,a.imageSmoothingEnabled=!1,a.fillStyle=r.backgroundColor||"#ffffff",a.fillRect(0,0,i,o),a.drawImage(t,e,n,i,o,0,0,i,o),s},g=function(){for(var r,o,l=0,g=0,y={},v=!1;;){var m;if(g=0,y.top=0!==l?c.top:n,y.left=0!==l?c.left:e,v=(a-c.left-c.right)*s=t.width)break;this.addPage()}else _=[m=d(t,0,l,r,o),y.left,y.top,m.width/s,m.height/s,f,null,p],this.addImage.apply(this,_);if((l+=o)>=t.height)break;this.addPage()}i(h,l,null,_)}.bind(this);if("CANVAS"===t.nodeName){var y=new Image;y.onload=g,y.src=t.toDataURL("image/png"),t=y}else g()}else{var v=Math.random().toString(35),m=[t,e,n,h,l,f,v,p];this.addImage.apply(this,m),i(h,l,v,m)}}.bind(this),"undefined"!=typeof html2canvas&&!r.rstz)return html2canvas(t,r);if("undefined"==typeof rasterizeHTML)return null;var c="drawDocument";return"string"==typeof t&&(c=/^http/.test(t)?"drawURL":"drawHTML"),r.width=r.width||a*s,rasterizeHTML[c](t,void 0,r).then((function(t){r.onrendered(t.image)}),(function(t){i(null,t)}))},function(t){var e,n,r,o,s,a,u,c,l,h,f,p,d,g,y,v,m,_,b,w;e=function(){return function(e){return t.prototype=e,new t};function t(){}}(),h=function(t){var e,n,r,i,o,s,a;for(n=0,r=t.length,e=void 0,s=i=!1;!i&&n!==r;)(e=t[n]=t[n].trimLeft())&&(i=!0),n++;for(n=r-1;r&&!s&&-1!==n;)(e=t[n]=t[n].trimRight())&&(s=!0),n--;for(o=/\s+$/g,a=!0,n=0;n!==r;)"\u2028"!=t[n]&&(e=t[n].replace(/\s+/g," "),a&&(e=e.trimLeft()),e&&(a=o.test(e)),t[n]=e),n++;return t},p=function(t){var e,n,i;for(e=void 0,n=(i=t.split(",")).shift();!e&&n;)e=r[n.trim().toLowerCase()],n=i.shift();return e},d=function(t){var e;return-1<(t="auto"===t?"0px":t).indexOf("em")&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"),-1r.pdf.margins_doc.top&&(r.pdf.addPage(),r.y=r.pdf.margins_doc.top,r.executeWatchFunctions(s));var L=l(s),I=r.x,P=12/r.pdf.internal.scaleFactor,j=(L["margin-left"]+L["padding-left"])*P,A=(L["margin-right"]+L["padding-right"])*P,R=(L["margin-top"]+L["padding-top"])*P,T=(L["margin-bottom"]+L["padding-bottom"])*P;void 0!==L.float&&"right"===L.float?I+=r.settings.width-s.width-A:I+=j,r.pdf.addImage(N,I,r.y+R,s.width,s.height),N=void 0,"right"===L.float||"left"===L.float?(r.watchFunctions.push(function(t,e,n,i){return r.y>=e?(r.x+=t,r.settings.width+=n,!0):!!(i&&1===i.nodeType&&!x[i.nodeName]&&r.x+i.width>r.pdf.margins_doc.left+r.pdf.margins_doc.width)&&(r.x+=t,r.y=e,r.settings.width+=n,!0)}.bind(this,"left"===L.float?-s.width-j-A:0,r.y+s.height+R+T,s.width)),r.watchFunctions.push(function(t,e,n){return!(r.y]*?>/gi,""),l="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),(c=document.createElement("div")).style.cssText="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",c.innerHTML='