@ambuj.bhaskar/react-component-library 0.30.1 → 0.30.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -34
- package/bin/cli.js +86 -86
- package/dist/assets/index.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -9
- package/dist/index.umd.js +2 -2
- package/package.json +106 -106
package/dist/index.cjs
CHANGED
|
@@ -709,4 +709,4 @@ https://sweetalert2.github.io/#ajax-request`),zpe(e),typeof e.title=="string"&&(
|
|
|
709
709
|
*/var Jke=w4.exports,xS;function eRe(){return xS||(xS=1,function(e,t){(function(n,r){r(t)})(Jke,function(n){var r="1.9.4";function o(f){var b,O,Z,G;for(O=1,Z=arguments.length;O<Z;O++){G=arguments[O];for(b in G)f[b]=G[b]}return f}var i=Object.create||function(){function f(){}return function(b){return f.prototype=b,new f}}();function a(f,b){var O=Array.prototype.slice;if(f.bind)return f.bind.apply(f,O.call(arguments,1));var Z=O.call(arguments,2);return function(){return f.apply(b,Z.length?Z.concat(O.call(arguments)):arguments)}}var s=0;function l(f){return"_leaflet_id"in f||(f._leaflet_id=++s),f._leaflet_id}function u(f,b,O){var Z,G,oe,Re;return Re=function(){Z=!1,G&&(oe.apply(O,G),G=!1)},oe=function(){Z?G=arguments:(f.apply(O,arguments),setTimeout(Re,b),Z=!0)},oe}function d(f,b,O){var Z=b[1],G=b[0],oe=Z-G;return f===Z&&O?f:((f-G)%oe+oe)%oe+G}function h(){return!1}function C(f,b){if(b===!1)return f;var O=Math.pow(10,b===void 0?6:b);return Math.round(f*O)/O}function m(f){return f.trim?f.trim():f.replace(/^\s+|\s+$/g,"")}function A(f){return m(f).split(/\s+/)}function v(f,b){Object.prototype.hasOwnProperty.call(f,"options")||(f.options=f.options?i(f.options):{});for(var O in b)f.options[O]=b[O];return f.options}function p(f,b,O){var Z=[];for(var G in f)Z.push(encodeURIComponent(O?G.toUpperCase():G)+"="+encodeURIComponent(f[G]));return(!b||b.indexOf("?")===-1?"?":"&")+Z.join("&")}var w=/\{ *([\w_ -]+) *\}/g;function x(f,b){return f.replace(w,function(O,Z){var G=b[Z];if(G===void 0)throw new Error("No value provided for variable "+O);return typeof G=="function"&&(G=G(b)),G})}var E=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"};function S(f,b){for(var O=0;O<f.length;O++)if(f[O]===b)return O;return-1}var _="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function M(f){return window["webkit"+f]||window["moz"+f]||window["ms"+f]}var H=0;function R(f){var b=+new Date,O=Math.max(0,16-(b-H));return H=b+O,window.setTimeout(f,O)}var k=window.requestAnimationFrame||M("RequestAnimationFrame")||R,I=window.cancelAnimationFrame||M("CancelAnimationFrame")||M("CancelRequestAnimationFrame")||function(f){window.clearTimeout(f)};function P(f,b,O){if(O&&k===R)f.call(b);else return k.call(window,a(f,b))}function T(f){f&&I.call(window,f)}var N={__proto__:null,extend:o,create:i,bind:a,get lastId(){return s},stamp:l,throttle:u,wrapNum:d,falseFn:h,formatNum:C,trim:m,splitWords:A,setOptions:v,getParamString:p,template:x,isArray:E,indexOf:S,emptyImageUrl:_,requestFn:k,cancelFn:I,requestAnimFrame:P,cancelAnimFrame:T};function F(){}F.extend=function(f){var b=function(){v(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},O=b.__super__=this.prototype,Z=i(O);Z.constructor=b,b.prototype=Z;for(var G in this)Object.prototype.hasOwnProperty.call(this,G)&&G!=="prototype"&&G!=="__super__"&&(b[G]=this[G]);return f.statics&&o(b,f.statics),f.includes&&(j(f.includes),o.apply(null,[Z].concat(f.includes))),o(Z,f),delete Z.statics,delete Z.includes,Z.options&&(Z.options=O.options?i(O.options):{},o(Z.options,f.options)),Z._initHooks=[],Z.callInitHooks=function(){if(!this._initHooksCalled){O.callInitHooks&&O.callInitHooks.call(this),this._initHooksCalled=!0;for(var oe=0,Re=Z._initHooks.length;oe<Re;oe++)Z._initHooks[oe].call(this)}},b},F.include=function(f){var b=this.prototype.options;return o(this.prototype,f),f.options&&(this.prototype.options=b,this.mergeOptions(f.options)),this},F.mergeOptions=function(f){return o(this.prototype.options,f),this},F.addInitHook=function(f){var b=Array.prototype.slice.call(arguments,1),O=typeof f=="function"?f:function(){this[f].apply(this,b)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(O),this};function j(f){if(!(typeof L>"u"||!L||!L.Mixin)){f=E(f)?f:[f];for(var b=0;b<f.length;b++)f[b]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var z={on:function(f,b,O){if(typeof f=="object")for(var Z in f)this._on(Z,f[Z],b);else{f=A(f);for(var G=0,oe=f.length;G<oe;G++)this._on(f[G],b,O)}return this},off:function(f,b,O){if(!arguments.length)delete this._events;else if(typeof f=="object")for(var Z in f)this._off(Z,f[Z],b);else{f=A(f);for(var G=arguments.length===1,oe=0,Re=f.length;oe<Re;oe++)G?this._off(f[oe]):this._off(f[oe],b,O)}return this},_on:function(f,b,O,Z){if(typeof b!="function"){console.warn("wrong listener type: "+typeof b);return}if(this._listens(f,b,O)===!1){O===this&&(O=void 0);var G={fn:b,ctx:O};Z&&(G.once=!0),this._events=this._events||{},this._events[f]=this._events[f]||[],this._events[f].push(G)}},_off:function(f,b,O){var Z,G,oe;if(this._events&&(Z=this._events[f],!!Z)){if(arguments.length===1){if(this._firingCount)for(G=0,oe=Z.length;G<oe;G++)Z[G].fn=h;delete this._events[f];return}if(typeof b!="function"){console.warn("wrong listener type: "+typeof b);return}var Re=this._listens(f,b,O);if(Re!==!1){var qe=Z[Re];this._firingCount&&(qe.fn=h,this._events[f]=Z=Z.slice()),Z.splice(Re,1)}}},fire:function(f,b,O){if(!this.listens(f,O))return this;var Z=o({},b,{type:f,target:this,sourceTarget:b&&b.sourceTarget||this});if(this._events){var G=this._events[f];if(G){this._firingCount=this._firingCount+1||1;for(var oe=0,Re=G.length;oe<Re;oe++){var qe=G[oe],at=qe.fn;qe.once&&this.off(f,at,qe.ctx),at.call(qe.ctx||this,Z)}this._firingCount--}}return O&&this._propagateEvent(Z),this},listens:function(f,b,O,Z){typeof f!="string"&&console.warn('"string" type argument expected');var G=b;typeof b!="function"&&(Z=!!b,G=void 0,O=void 0);var oe=this._events&&this._events[f];if(oe&&oe.length&&this._listens(f,G,O)!==!1)return!0;if(Z){for(var Re in this._eventParents)if(this._eventParents[Re].listens(f,b,O,Z))return!0}return!1},_listens:function(f,b,O){if(!this._events)return!1;var Z=this._events[f]||[];if(!b)return!!Z.length;O===this&&(O=void 0);for(var G=0,oe=Z.length;G<oe;G++)if(Z[G].fn===b&&Z[G].ctx===O)return G;return!1},once:function(f,b,O){if(typeof f=="object")for(var Z in f)this._on(Z,f[Z],b,!0);else{f=A(f);for(var G=0,oe=f.length;G<oe;G++)this._on(f[G],b,O,!0)}return this},addEventParent:function(f){return this._eventParents=this._eventParents||{},this._eventParents[l(f)]=f,this},removeEventParent:function(f){return this._eventParents&&delete this._eventParents[l(f)],this},_propagateEvent:function(f){for(var b in this._eventParents)this._eventParents[b].fire(f.type,o({layer:f.target,propagatedFrom:f.target},f),!0)}};z.addEventListener=z.on,z.removeEventListener=z.clearAllEventListeners=z.off,z.addOneTimeEventListener=z.once,z.fireEvent=z.fire,z.hasEventListeners=z.listens;var W=F.extend(z);function Q(f,b,O){this.x=O?Math.round(f):f,this.y=O?Math.round(b):b}var q=Math.trunc||function(f){return f>0?Math.floor(f):Math.ceil(f)};Q.prototype={clone:function(){return new Q(this.x,this.y)},add:function(f){return this.clone()._add(K(f))},_add:function(f){return this.x+=f.x,this.y+=f.y,this},subtract:function(f){return this.clone()._subtract(K(f))},_subtract:function(f){return this.x-=f.x,this.y-=f.y,this},divideBy:function(f){return this.clone()._divideBy(f)},_divideBy:function(f){return this.x/=f,this.y/=f,this},multiplyBy:function(f){return this.clone()._multiplyBy(f)},_multiplyBy:function(f){return this.x*=f,this.y*=f,this},scaleBy:function(f){return new Q(this.x*f.x,this.y*f.y)},unscaleBy:function(f){return new Q(this.x/f.x,this.y/f.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=q(this.x),this.y=q(this.y),this},distanceTo:function(f){f=K(f);var b=f.x-this.x,O=f.y-this.y;return Math.sqrt(b*b+O*O)},equals:function(f){return f=K(f),f.x===this.x&&f.y===this.y},contains:function(f){return f=K(f),Math.abs(f.x)<=Math.abs(this.x)&&Math.abs(f.y)<=Math.abs(this.y)},toString:function(){return"Point("+C(this.x)+", "+C(this.y)+")"}};function K(f,b,O){return f instanceof Q?f:E(f)?new Q(f[0],f[1]):f==null?f:typeof f=="object"&&"x"in f&&"y"in f?new Q(f.x,f.y):new Q(f,b,O)}function $(f,b){if(f)for(var O=b?[f,b]:f,Z=0,G=O.length;Z<G;Z++)this.extend(O[Z])}$.prototype={extend:function(f){var b,O;if(!f)return this;if(f instanceof Q||typeof f[0]=="number"||"x"in f)b=O=K(f);else if(f=Y(f),b=f.min,O=f.max,!b||!O)return this;return!this.min&&!this.max?(this.min=b.clone(),this.max=O.clone()):(this.min.x=Math.min(b.x,this.min.x),this.max.x=Math.max(O.x,this.max.x),this.min.y=Math.min(b.y,this.min.y),this.max.y=Math.max(O.y,this.max.y)),this},getCenter:function(f){return K((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,f)},getBottomLeft:function(){return K(this.min.x,this.max.y)},getTopRight:function(){return K(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(f){var b,O;return typeof f[0]=="number"||f instanceof Q?f=K(f):f=Y(f),f instanceof $?(b=f.min,O=f.max):b=O=f,b.x>=this.min.x&&O.x<=this.max.x&&b.y>=this.min.y&&O.y<=this.max.y},intersects:function(f){f=Y(f);var b=this.min,O=this.max,Z=f.min,G=f.max,oe=G.x>=b.x&&Z.x<=O.x,Re=G.y>=b.y&&Z.y<=O.y;return oe&&Re},overlaps:function(f){f=Y(f);var b=this.min,O=this.max,Z=f.min,G=f.max,oe=G.x>b.x&&Z.x<O.x,Re=G.y>b.y&&Z.y<O.y;return oe&&Re},isValid:function(){return!!(this.min&&this.max)},pad:function(f){var b=this.min,O=this.max,Z=Math.abs(b.x-O.x)*f,G=Math.abs(b.y-O.y)*f;return Y(K(b.x-Z,b.y-G),K(O.x+Z,O.y+G))},equals:function(f){return f?(f=Y(f),this.min.equals(f.getTopLeft())&&this.max.equals(f.getBottomRight())):!1}};function Y(f,b){return!f||f instanceof $?f:new $(f,b)}function X(f,b){if(f)for(var O=b?[f,b]:f,Z=0,G=O.length;Z<G;Z++)this.extend(O[Z])}X.prototype={extend:function(f){var b=this._southWest,O=this._northEast,Z,G;if(f instanceof ee)Z=f,G=f;else if(f instanceof X){if(Z=f._southWest,G=f._northEast,!Z||!G)return this}else return f?this.extend(ie(f)||J(f)):this;return!b&&!O?(this._southWest=new ee(Z.lat,Z.lng),this._northEast=new ee(G.lat,G.lng)):(b.lat=Math.min(Z.lat,b.lat),b.lng=Math.min(Z.lng,b.lng),O.lat=Math.max(G.lat,O.lat),O.lng=Math.max(G.lng,O.lng)),this},pad:function(f){var b=this._southWest,O=this._northEast,Z=Math.abs(b.lat-O.lat)*f,G=Math.abs(b.lng-O.lng)*f;return new X(new ee(b.lat-Z,b.lng-G),new ee(O.lat+Z,O.lng+G))},getCenter:function(){return new ee((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new ee(this.getNorth(),this.getWest())},getSouthEast:function(){return new ee(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(f){typeof f[0]=="number"||f instanceof ee||"lat"in f?f=ie(f):f=J(f);var b=this._southWest,O=this._northEast,Z,G;return f instanceof X?(Z=f.getSouthWest(),G=f.getNorthEast()):Z=G=f,Z.lat>=b.lat&&G.lat<=O.lat&&Z.lng>=b.lng&&G.lng<=O.lng},intersects:function(f){f=J(f);var b=this._southWest,O=this._northEast,Z=f.getSouthWest(),G=f.getNorthEast(),oe=G.lat>=b.lat&&Z.lat<=O.lat,Re=G.lng>=b.lng&&Z.lng<=O.lng;return oe&&Re},overlaps:function(f){f=J(f);var b=this._southWest,O=this._northEast,Z=f.getSouthWest(),G=f.getNorthEast(),oe=G.lat>b.lat&&Z.lat<O.lat,Re=G.lng>b.lng&&Z.lng<O.lng;return oe&&Re},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(f,b){return f?(f=J(f),this._southWest.equals(f.getSouthWest(),b)&&this._northEast.equals(f.getNorthEast(),b)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function J(f,b){return f instanceof X?f:new X(f,b)}function ee(f,b,O){if(isNaN(f)||isNaN(b))throw new Error("Invalid LatLng object: ("+f+", "+b+")");this.lat=+f,this.lng=+b,O!==void 0&&(this.alt=+O)}ee.prototype={equals:function(f,b){if(!f)return!1;f=ie(f);var O=Math.max(Math.abs(this.lat-f.lat),Math.abs(this.lng-f.lng));return O<=(b===void 0?1e-9:b)},toString:function(f){return"LatLng("+C(this.lat,f)+", "+C(this.lng,f)+")"},distanceTo:function(f){return le.distance(this,ie(f))},wrap:function(){return le.wrapLatLng(this)},toBounds:function(f){var b=180*f/40075017,O=b/Math.cos(Math.PI/180*this.lat);return J([this.lat-b,this.lng-O],[this.lat+b,this.lng+O])},clone:function(){return new ee(this.lat,this.lng,this.alt)}};function ie(f,b,O){return f instanceof ee?f:E(f)&&typeof f[0]!="object"?f.length===3?new ee(f[0],f[1],f[2]):f.length===2?new ee(f[0],f[1]):null:f==null?f:typeof f=="object"&&"lat"in f?new ee(f.lat,"lng"in f?f.lng:f.lon,f.alt):b===void 0?null:new ee(f,b,O)}var he={latLngToPoint:function(f,b){var O=this.projection.project(f),Z=this.scale(b);return this.transformation._transform(O,Z)},pointToLatLng:function(f,b){var O=this.scale(b),Z=this.transformation.untransform(f,O);return this.projection.unproject(Z)},project:function(f){return this.projection.project(f)},unproject:function(f){return this.projection.unproject(f)},scale:function(f){return 256*Math.pow(2,f)},zoom:function(f){return Math.log(f/256)/Math.LN2},getProjectedBounds:function(f){if(this.infinite)return null;var b=this.projection.bounds,O=this.scale(f),Z=this.transformation.transform(b.min,O),G=this.transformation.transform(b.max,O);return new $(Z,G)},infinite:!1,wrapLatLng:function(f){var b=this.wrapLng?d(f.lng,this.wrapLng,!0):f.lng,O=this.wrapLat?d(f.lat,this.wrapLat,!0):f.lat,Z=f.alt;return new ee(O,b,Z)},wrapLatLngBounds:function(f){var b=f.getCenter(),O=this.wrapLatLng(b),Z=b.lat-O.lat,G=b.lng-O.lng;if(Z===0&&G===0)return f;var oe=f.getSouthWest(),Re=f.getNorthEast(),qe=new ee(oe.lat-Z,oe.lng-G),at=new ee(Re.lat-Z,Re.lng-G);return new X(qe,at)}},le=o({},he,{wrapLng:[-180,180],R:6371e3,distance:function(f,b){var O=Math.PI/180,Z=f.lat*O,G=b.lat*O,oe=Math.sin((b.lat-f.lat)*O/2),Re=Math.sin((b.lng-f.lng)*O/2),qe=oe*oe+Math.cos(Z)*Math.cos(G)*Re*Re,at=2*Math.atan2(Math.sqrt(qe),Math.sqrt(1-qe));return this.R*at}}),ye=6378137,xe={R:ye,MAX_LATITUDE:85.0511287798,project:function(f){var b=Math.PI/180,O=this.MAX_LATITUDE,Z=Math.max(Math.min(O,f.lat),-O),G=Math.sin(Z*b);return new Q(this.R*f.lng*b,this.R*Math.log((1+G)/(1-G))/2)},unproject:function(f){var b=180/Math.PI;return new ee((2*Math.atan(Math.exp(f.y/this.R))-Math.PI/2)*b,f.x*b/this.R)},bounds:function(){var f=ye*Math.PI;return new $([-f,-f],[f,f])}()};function Ae(f,b,O,Z){if(E(f)){this._a=f[0],this._b=f[1],this._c=f[2],this._d=f[3];return}this._a=f,this._b=b,this._c=O,this._d=Z}Ae.prototype={transform:function(f,b){return this._transform(f.clone(),b)},_transform:function(f,b){return b=b||1,f.x=b*(this._a*f.x+this._b),f.y=b*(this._c*f.y+this._d),f},untransform:function(f,b){return b=b||1,new Q((f.x/b-this._b)/this._a,(f.y/b-this._d)/this._c)}};function de(f,b,O,Z){return new Ae(f,b,O,Z)}var ce=o({},le,{code:"EPSG:3857",projection:xe,transformation:function(){var f=.5/(Math.PI*xe.R);return de(f,.5,-f,.5)}()}),Ce=o({},ce,{code:"EPSG:900913"});function we(f){return document.createElementNS("http://www.w3.org/2000/svg",f)}function Se(f,b){var O="",Z,G,oe,Re,qe,at;for(Z=0,oe=f.length;Z<oe;Z++){for(qe=f[Z],G=0,Re=qe.length;G<Re;G++)at=qe[G],O+=(G?"L":"M")+at.x+" "+at.y;O+=b?ot.svg?"z":"x":""}return O||"M0 0"}var $e=document.documentElement.style,ae="ActiveXObject"in window,Xe=ae&&!document.addEventListener,se="msLaunchUri"in navigator&&!("documentMode"in document),ne=Mt("webkit"),me=Mt("android"),ke=Mt("android 2")||Mt("android 3"),_e=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Oe=me&&Mt("Google")&&_e<537&&!("AudioNode"in window),Pe=!!window.opera,et=!se&&Mt("chrome"),st=Mt("gecko")&&!ne&&!Pe&&!ae,tt=!et&&Mt("safari"),gt=Mt("phantom"),Ke="OTransition"in $e,Ne=navigator.platform.indexOf("Win")===0,pt=ae&&"transition"in $e,Ge="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ke,Qe="MozPerspective"in $e,nt=!window.L_DISABLE_3D&&(pt||Ge||Qe)&&!Ke&&!gt,je=typeof orientation<"u"||Mt("mobile"),dt=je&&ne,Tt=je&&Ge,Zt=!window.PointerEvent&&window.MSPointerEvent,qt=!!(window.PointerEvent||Zt),On="ontouchstart"in window||!!window.TouchEvent,Kt=!window.L_NO_TOUCH&&(On||qt),En=je&&Pe,Xt=je&&st,jt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Ot=function(){var f=!1;try{var b=Object.defineProperty({},"passive",{get:function(){f=!0}});window.addEventListener("testPassiveEventSupport",h,b),window.removeEventListener("testPassiveEventSupport",h,b)}catch{}return f}(),It=function(){return!!document.createElement("canvas").getContext}(),yt=!!(document.createElementNS&&we("svg").createSVGRect),Dt=!!yt&&function(){var f=document.createElement("div");return f.innerHTML="<svg/>",(f.firstChild&&f.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),en=!yt&&function(){try{var f=document.createElement("div");f.innerHTML='<v:shape adj="1"/>';var b=f.firstChild;return b.style.behavior="url(#default#VML)",b&&typeof b.adj=="object"}catch{return!1}}(),vt=navigator.platform.indexOf("Mac")===0,Je=navigator.platform.indexOf("Linux")===0;function Mt(f){return navigator.userAgent.toLowerCase().indexOf(f)>=0}var ot={ie:ae,ielt9:Xe,edge:se,webkit:ne,android:me,android23:ke,androidStock:Oe,opera:Pe,chrome:et,gecko:st,safari:tt,phantom:gt,opera12:Ke,win:Ne,ie3d:pt,webkit3d:Ge,gecko3d:Qe,any3d:nt,mobile:je,mobileWebkit:dt,mobileWebkit3d:Tt,msPointer:Zt,pointer:qt,touch:Kt,touchNative:On,mobileOpera:En,mobileGecko:Xt,retina:jt,passiveEvents:Ot,canvas:It,svg:yt,vml:en,inlineSvg:Dt,mac:vt,linux:Je},Vt=ot.msPointer?"MSPointerDown":"pointerdown",ve=ot.msPointer?"MSPointerMove":"pointermove",it=ot.msPointer?"MSPointerUp":"pointerup",Ue=ot.msPointer?"MSPointerCancel":"pointercancel",mt={touchstart:Vt,touchmove:ve,touchend:it,touchcancel:Ue},Ye={touchstart:Lt,touchmove:_t,touchend:_t,touchcancel:_t},wt={},kt=!1;function zt(f,b,O){return b==="touchstart"&&Ze(),Ye[b]?(O=Ye[b].bind(this,O),f.addEventListener(mt[b],O,!1),O):(console.warn("wrong event specified:",b),h)}function Mn(f,b,O){if(!mt[b]){console.warn("wrong event specified:",b);return}f.removeEventListener(mt[b],O,!1)}function Qt(f){wt[f.pointerId]=f}function vn(f){wt[f.pointerId]&&(wt[f.pointerId]=f)}function Et(f){delete wt[f.pointerId]}function Ze(){kt||(document.addEventListener(Vt,Qt,!0),document.addEventListener(ve,vn,!0),document.addEventListener(it,Et,!0),document.addEventListener(Ue,Et,!0),kt=!0)}function _t(f,b){if(b.pointerType!==(b.MSPOINTER_TYPE_MOUSE||"mouse")){b.touches=[];for(var O in wt)b.touches.push(wt[O]);b.changedTouches=[b],f(b)}}function Lt(f,b){b.MSPOINTER_TYPE_TOUCH&&b.pointerType===b.MSPOINTER_TYPE_TOUCH&&jn(b),_t(f,b)}function Pn(f){var b={},O,Z;for(Z in f)O=f[Z],b[Z]=O&&O.bind?O.bind(f):O;return f=b,b.type="dblclick",b.detail=2,b.isTrusted=!1,b._simulated=!0,b}var C1=200;function Kn(f,b){f.addEventListener("dblclick",b);var O=0,Z;function G(oe){if(oe.detail!==1){Z=oe.detail;return}if(!(oe.pointerType==="mouse"||oe.sourceCapabilities&&!oe.sourceCapabilities.firesTouchEvents)){var Re=Ni(oe);if(!(Re.some(function(at){return at instanceof HTMLLabelElement&&at.attributes.for})&&!Re.some(function(at){return at instanceof HTMLInputElement||at instanceof HTMLSelectElement}))){var qe=Date.now();qe-O<=C1?(Z++,Z===2&&b(Pn(oe))):Z=1,O=qe}}}return f.addEventListener("click",G),{dblclick:b,simDblclick:G}}function Yn(f,b){f.removeEventListener("dblclick",b.dblclick),f.removeEventListener("click",b.simDblclick)}var d1=Pt(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),e1=Pt(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Jt=e1==="webkitTransition"||e1==="OTransition"?e1+"End":"transitionend";function Hn(f){return typeof f=="string"?document.getElementById(f):f}function Tn(f,b){var O=f.style[b]||f.currentStyle&&f.currentStyle[b];if((!O||O==="auto")&&document.defaultView){var Z=document.defaultView.getComputedStyle(f,null);O=Z?Z[b]:null}return O==="auto"?null:O}function Ut(f,b,O){var Z=document.createElement(f);return Z.className=b||"",O&&O.appendChild(Z),Z}function bn(f){var b=f.parentNode;b&&b.removeChild(f)}function Qn(f){for(;f.firstChild;)f.removeChild(f.firstChild)}function S1(f){var b=f.parentNode;b&&b.lastChild!==f&&b.appendChild(f)}function Xn(f){var b=f.parentNode;b&&b.firstChild!==f&&b.insertBefore(f,b.firstChild)}function H1(f,b){if(f.classList!==void 0)return f.classList.contains(b);var O=Wt(f);return O.length>0&&new RegExp("(^|\\s)"+b+"(\\s|$)").test(O)}function hn(f,b){if(f.classList!==void 0)for(var O=A(b),Z=0,G=O.length;Z<G;Z++)f.classList.add(O[Z]);else if(!H1(f,b)){var oe=Wt(f);kn(f,(oe?oe+" ":"")+b)}}function Bn(f,b){f.classList!==void 0?f.classList.remove(b):kn(f,m((" "+Wt(f)+" ").replace(" "+b+" "," ")))}function kn(f,b){f.className.baseVal===void 0?f.className=b:f.className.baseVal=b}function Wt(f){return f.correspondingElement&&(f=f.correspondingElement),f.className.baseVal===void 0?f.className:f.className.baseVal}function At(f,b){"opacity"in f.style?f.style.opacity=b:"filter"in f.style&&Nt(f,b)}function Nt(f,b){var O=!1,Z="DXImageTransform.Microsoft.Alpha";try{O=f.filters.item(Z)}catch{if(b===1)return}b=Math.round(b*100),O?(O.Enabled=b!==100,O.Opacity=b):f.style.filter+=" progid:"+Z+"(opacity="+b+")"}function Pt(f){for(var b=document.documentElement.style,O=0;O<f.length;O++)if(f[O]in b)return f[O];return!1}function rt(f,b,O){var Z=b||new Q(0,0);f.style[d1]=(ot.ie3d?"translate("+Z.x+"px,"+Z.y+"px)":"translate3d("+Z.x+"px,"+Z.y+"px,0)")+(O?" scale("+O+")":"")}function An(f,b){f._leaflet_pos=b,ot.any3d?rt(f,b):(f.style.left=b.x+"px",f.style.top=b.y+"px")}function _n(f){return f._leaflet_pos||new Q(0,0)}var L1,g1,Q1;if("onselectstart"in document)L1=function(){Nn(window,"selectstart",jn)},g1=function(){pn(window,"selectstart",jn)};else{var Cn=Pt(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);L1=function(){if(Cn){var f=document.documentElement.style;Q1=f[Cn],f[Cn]="none"}},g1=function(){Cn&&(document.documentElement.style[Cn]=Q1,Q1=void 0)}}function Bt(){Nn(window,"dragstart",jn)}function Ft(){pn(window,"dragstart",jn)}var mn,nn;function i1(f){for(;f.tabIndex===-1;)f=f.parentNode;f.style&&(a0(),mn=f,nn=f.style.outlineStyle,f.style.outlineStyle="none",Nn(window,"keydown",a0))}function a0(){mn&&(mn.style.outlineStyle=nn,mn=void 0,nn=void 0,pn(window,"keydown",a0))}function O1(f){do f=f.parentNode;while((!f.offsetWidth||!f.offsetHeight)&&f!==document.body);return f}function gn(f){var b=f.getBoundingClientRect();return{x:b.width/f.offsetWidth||1,y:b.height/f.offsetHeight||1,boundingClientRect:b}}var br={__proto__:null,TRANSFORM:d1,TRANSITION:e1,TRANSITION_END:Jt,get:Hn,getStyle:Tn,create:Ut,remove:bn,empty:Qn,toFront:S1,toBack:Xn,hasClass:H1,addClass:hn,removeClass:Bn,setClass:kn,getClass:Wt,setOpacity:At,testProp:Pt,setTransform:rt,setPosition:An,getPosition:_n,get disableTextSelection(){return L1},get enableTextSelection(){return g1},disableImageDrag:Bt,enableImageDrag:Ft,preventOutline:i1,restoreOutline:a0,getSizedParentNode:O1,getScale:gn};function Nn(f,b,O,Z){if(b&&typeof b=="object")for(var G in b)B1(f,G,b[G],O);else{b=A(b);for(var oe=0,Re=b.length;oe<Re;oe++)B1(f,b[oe],O,Z)}return this}var J0="_leaflet_events";function pn(f,b,O,Z){if(arguments.length===1)dn(f),delete f[J0];else if(b&&typeof b=="object")for(var G in b)G1(f,G,b[G],O);else if(b=A(b),arguments.length===2)dn(f,function(qe){return S(b,qe)!==-1});else for(var oe=0,Re=b.length;oe<Re;oe++)G1(f,b[oe],O,Z);return this}function dn(f,b){for(var O in f[J0]){var Z=O.split(/\d/)[0];(!b||b(Z))&&G1(f,Z,null,null,O)}}var Ln={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function B1(f,b,O,Z){var G=b+l(O)+(Z?"_"+l(Z):"");if(f[J0]&&f[J0][G])return this;var oe=function(qe){return O.call(Z||f,qe||window.event)},Re=oe;!ot.touchNative&&ot.pointer&&b.indexOf("touch")===0?oe=zt(f,b,oe):ot.touch&&b==="dblclick"?oe=Kn(f,oe):"addEventListener"in f?b==="touchstart"||b==="touchmove"||b==="wheel"||b==="mousewheel"?f.addEventListener(Ln[b]||b,oe,ot.passiveEvents?{passive:!1}:!1):b==="mouseenter"||b==="mouseleave"?(oe=function(qe){qe=qe||window.event,ka(f,qe)&&Re(qe)},f.addEventListener(Ln[b],oe,!1)):f.addEventListener(b,Re,!1):f.attachEvent("on"+b,oe),f[J0]=f[J0]||{},f[J0][G]=oe}function G1(f,b,O,Z,G){G=G||b+l(O)+(Z?"_"+l(Z):"");var oe=f[J0]&&f[J0][G];if(!oe)return this;!ot.touchNative&&ot.pointer&&b.indexOf("touch")===0?Mn(f,b,oe):ot.touch&&b==="dblclick"?Yn(f,oe):"removeEventListener"in f?f.removeEventListener(Ln[b]||b,oe,!1):f.detachEvent("on"+b,oe),f[J0][G]=null}function M1(f){return f.stopPropagation?f.stopPropagation():f.originalEvent?f.originalEvent._stopped=!0:f.cancelBubble=!0,this}function Z2(f){return B1(f,"wheel",M1),this}function Tr(f){return Nn(f,"mousedown touchstart dblclick contextmenu",M1),f._leaflet_disable_click=!0,this}function jn(f){return f.preventDefault?f.preventDefault():f.returnValue=!1,this}function t1(f){return jn(f),M1(f),this}function Ni(f){if(f.composedPath)return f.composedPath();for(var b=[],O=f.target;O;)b.push(O),O=O.parentNode;return b}function B9(f,b){if(!b)return new Q(f.clientX,f.clientY);var O=gn(b),Z=O.boundingClientRect;return new Q((f.clientX-Z.left)/O.x-b.clientLeft,(f.clientY-Z.top)/O.y-b.clientTop)}var Ba=ot.linux&&ot.chrome?window.devicePixelRatio:ot.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function $2(f){return ot.edge?f.wheelDeltaY/2:f.deltaY&&f.deltaMode===0?-f.deltaY/Ba:f.deltaY&&f.deltaMode===1?-f.deltaY*20:f.deltaY&&f.deltaMode===2?-f.deltaY*60:f.deltaX||f.deltaZ?0:f.wheelDelta?(f.wheelDeltaY||f.wheelDelta)/2:f.detail&&Math.abs(f.detail)<32765?-f.detail*20:f.detail?f.detail/-32765*60:0}function ka(f,b){var O=b.relatedTarget;if(!O)return!0;try{for(;O&&O!==f;)O=O.parentNode}catch{return!1}return O!==f}var k9={__proto__:null,on:Nn,off:pn,stopPropagation:M1,disableScrollPropagation:Z2,disableClickPropagation:Tr,preventDefault:jn,stop:t1,getPropagationPath:Ni,getMousePosition:B9,getWheelDelta:$2,isExternalTarget:ka,addListener:Nn,removeListener:pn},R9=W.extend({run:function(f,b,O,Z){this.stop(),this._el=f,this._inProgress=!0,this._duration=O||.25,this._easeOutPower=1/Math.max(Z||.5,.2),this._startPos=_n(f),this._offset=b.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=P(this._animate,this),this._step()},_step:function(f){var b=+new Date-this._startTime,O=this._duration*1e3;b<O?this._runFrame(this._easeOut(b/O),f):(this._runFrame(1),this._complete())},_runFrame:function(f,b){var O=this._startPos.add(this._offset.multiplyBy(f));b&&O._round(),An(this._el,O),this.fire("step")},_complete:function(){T(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(f){return 1-Math.pow(1-f,this._easeOutPower)}}),m1=W.extend({options:{crs:ce,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(f,b){b=v(this,b),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(f),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),b.maxBounds&&this.setMaxBounds(b.maxBounds),b.zoom!==void 0&&(this._zoom=this._limitZoom(b.zoom)),b.center&&b.zoom!==void 0&&this.setView(ie(b.center),b.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=e1&&ot.any3d&&!ot.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Nn(this._proxy,Jt,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(f,b,O){if(b=b===void 0?this._zoom:this._limitZoom(b),f=this._limitCenter(ie(f),b,this.options.maxBounds),O=O||{},this._stop(),this._loaded&&!O.reset&&O!==!0){O.animate!==void 0&&(O.zoom=o({animate:O.animate},O.zoom),O.pan=o({animate:O.animate,duration:O.duration},O.pan));var Z=this._zoom!==b?this._tryAnimatedZoom&&this._tryAnimatedZoom(f,b,O.zoom):this._tryAnimatedPan(f,O.pan);if(Z)return clearTimeout(this._sizeTimer),this}return this._resetView(f,b,O.pan&&O.pan.noMoveStart),this},setZoom:function(f,b){return this._loaded?this.setView(this.getCenter(),f,{zoom:b}):(this._zoom=f,this)},zoomIn:function(f,b){return f=f||(ot.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+f,b)},zoomOut:function(f,b){return f=f||(ot.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-f,b)},setZoomAround:function(f,b,O){var Z=this.getZoomScale(b),G=this.getSize().divideBy(2),oe=f instanceof Q?f:this.latLngToContainerPoint(f),Re=oe.subtract(G).multiplyBy(1-1/Z),qe=this.containerPointToLatLng(G.add(Re));return this.setView(qe,b,{zoom:O})},_getBoundsCenterZoom:function(f,b){b=b||{},f=f.getBounds?f.getBounds():J(f);var O=K(b.paddingTopLeft||b.padding||[0,0]),Z=K(b.paddingBottomRight||b.padding||[0,0]),G=this.getBoundsZoom(f,!1,O.add(Z));if(G=typeof b.maxZoom=="number"?Math.min(b.maxZoom,G):G,G===1/0)return{center:f.getCenter(),zoom:G};var oe=Z.subtract(O).divideBy(2),Re=this.project(f.getSouthWest(),G),qe=this.project(f.getNorthEast(),G),at=this.unproject(Re.add(qe).divideBy(2).add(oe),G);return{center:at,zoom:G}},fitBounds:function(f,b){if(f=J(f),!f.isValid())throw new Error("Bounds are not valid.");var O=this._getBoundsCenterZoom(f,b);return this.setView(O.center,O.zoom,b)},fitWorld:function(f){return this.fitBounds([[-90,-180],[90,180]],f)},panTo:function(f,b){return this.setView(f,this._zoom,{pan:b})},panBy:function(f,b){if(f=K(f).round(),b=b||{},!f.x&&!f.y)return this.fire("moveend");if(b.animate!==!0&&!this.getSize().contains(f))return this._resetView(this.unproject(this.project(this.getCenter()).add(f)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new R9,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),b.noMoveStart||this.fire("movestart"),b.animate!==!1){hn(this._mapPane,"leaflet-pan-anim");var O=this._getMapPanePos().subtract(f).round();this._panAnim.run(this._mapPane,O,b.duration||.25,b.easeLinearity)}else this._rawPanBy(f),this.fire("move").fire("moveend");return this},flyTo:function(f,b,O){if(O=O||{},O.animate===!1||!ot.any3d)return this.setView(f,b,O);this._stop();var Z=this.project(this.getCenter()),G=this.project(f),oe=this.getSize(),Re=this._zoom;f=ie(f),b=b===void 0?Re:b;var qe=Math.max(oe.x,oe.y),at=qe*this.getZoomScale(Re,b),Ht=G.distanceTo(Z)||1,rn=1.42,Rn=rn*rn;function Gn($t){var x1=$t?-1:1,ue=$t?at:qe,C0=at*at-qe*qe+x1*Rn*Rn*Ht*Ht,O0=2*ue*Rn*Ht,v1=C0/O0,on=Math.sqrt(v1*v1+1)-v1,_0=on<1e-9?-18:Math.log(on);return _0}function h0($t){return(Math.exp($t)-Math.exp(-$t))/2}function be($t){return(Math.exp($t)+Math.exp(-$t))/2}function ge($t){return h0($t)/be($t)}var Me=Gn(0);function Fe($t){return qe*(be(Me)/be(Me+rn*$t))}function De($t){return qe*(be(Me)*ge(Me+rn*$t)-h0(Me))/Rn}function ct($t){return 1-Math.pow(1-$t,1.5)}var bt=Date.now(),Gt=(Gn(1)-Me)/rn,fn=O.duration?1e3*O.duration:1e3*Gt*.8;function ht(){var $t=(Date.now()-bt)/fn,x1=ct($t)*Gt;$t<=1?(this._flyToFrame=P(ht,this),this._move(this.unproject(Z.add(G.subtract(Z).multiplyBy(De(x1)/Ht)),Re),this.getScaleZoom(qe/Fe(x1),Re),{flyTo:!0})):this._move(f,b)._moveEnd(!0)}return this._moveStart(!0,O.noMoveStart),ht.call(this),this},flyToBounds:function(f,b){var O=this._getBoundsCenterZoom(f,b);return this.flyTo(O.center,O.zoom,b)},setMaxBounds:function(f){return f=J(f),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),f.isValid()?(this.options.maxBounds=f,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(f){var b=this.options.minZoom;return this.options.minZoom=f,this._loaded&&b!==f&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(f):this},setMaxZoom:function(f){var b=this.options.maxZoom;return this.options.maxZoom=f,this._loaded&&b!==f&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(f):this},panInsideBounds:function(f,b){this._enforcingBounds=!0;var O=this.getCenter(),Z=this._limitCenter(O,this._zoom,J(f));return O.equals(Z)||this.panTo(Z,b),this._enforcingBounds=!1,this},panInside:function(f,b){b=b||{};var O=K(b.paddingTopLeft||b.padding||[0,0]),Z=K(b.paddingBottomRight||b.padding||[0,0]),G=this.project(this.getCenter()),oe=this.project(f),Re=this.getPixelBounds(),qe=Y([Re.min.add(O),Re.max.subtract(Z)]),at=qe.getSize();if(!qe.contains(oe)){this._enforcingBounds=!0;var Ht=oe.subtract(qe.getCenter()),rn=qe.extend(oe).getSize().subtract(at);G.x+=Ht.x<0?-rn.x:rn.x,G.y+=Ht.y<0?-rn.y:rn.y,this.panTo(this.unproject(G),b),this._enforcingBounds=!1}return this},invalidateSize:function(f){if(!this._loaded)return this;f=o({animate:!1,pan:!0},f===!0?{animate:!0}:f);var b=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var O=this.getSize(),Z=b.divideBy(2).round(),G=O.divideBy(2).round(),oe=Z.subtract(G);return!oe.x&&!oe.y?this:(f.animate&&f.pan?this.panBy(oe):(f.pan&&this._rawPanBy(oe),this.fire("move"),f.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:b,newSize:O}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(f){if(f=this._locateOptions=o({timeout:1e4,watch:!1},f),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var b=a(this._handleGeolocationResponse,this),O=a(this._handleGeolocationError,this);return f.watch?this._locationWatchId=navigator.geolocation.watchPosition(b,O,f):navigator.geolocation.getCurrentPosition(b,O,f),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(f){if(this._container._leaflet_id){var b=f.code,O=f.message||(b===1?"permission denied":b===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:b,message:"Geolocation error: "+O+"."})}},_handleGeolocationResponse:function(f){if(this._container._leaflet_id){var b=f.coords.latitude,O=f.coords.longitude,Z=new ee(b,O),G=Z.toBounds(f.coords.accuracy*2),oe=this._locateOptions;if(oe.setView){var Re=this.getBoundsZoom(G);this.setView(Z,oe.maxZoom?Math.min(Re,oe.maxZoom):Re)}var qe={latlng:Z,bounds:G,timestamp:f.timestamp};for(var at in f.coords)typeof f.coords[at]=="number"&&(qe[at]=f.coords[at]);this.fire("locationfound",qe)}},addHandler:function(f,b){if(!b)return this;var O=this[f]=new b(this);return this._handlers.push(O),this.options[f]&&O.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),bn(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(T(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var f;for(f in this._layers)this._layers[f].remove();for(f in this._panes)bn(this._panes[f]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(f,b){var O="leaflet-pane"+(f?" leaflet-"+f.replace("Pane","")+"-pane":""),Z=Ut("div",O,b||this._mapPane);return f&&(this._panes[f]=Z),Z},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var f=this.getPixelBounds(),b=this.unproject(f.getBottomLeft()),O=this.unproject(f.getTopRight());return new X(b,O)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(f,b,O){f=J(f),O=K(O||[0,0]);var Z=this.getZoom()||0,G=this.getMinZoom(),oe=this.getMaxZoom(),Re=f.getNorthWest(),qe=f.getSouthEast(),at=this.getSize().subtract(O),Ht=Y(this.project(qe,Z),this.project(Re,Z)).getSize(),rn=ot.any3d?this.options.zoomSnap:1,Rn=at.x/Ht.x,Gn=at.y/Ht.y,h0=b?Math.max(Rn,Gn):Math.min(Rn,Gn);return Z=this.getScaleZoom(h0,Z),rn&&(Z=Math.round(Z/(rn/100))*(rn/100),Z=b?Math.ceil(Z/rn)*rn:Math.floor(Z/rn)*rn),Math.max(G,Math.min(oe,Z))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new Q(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(f,b){var O=this._getTopLeftPoint(f,b);return new $(O,O.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(f){return this.options.crs.getProjectedBounds(f===void 0?this.getZoom():f)},getPane:function(f){return typeof f=="string"?this._panes[f]:f},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(f,b){var O=this.options.crs;return b=b===void 0?this._zoom:b,O.scale(f)/O.scale(b)},getScaleZoom:function(f,b){var O=this.options.crs;b=b===void 0?this._zoom:b;var Z=O.zoom(f*O.scale(b));return isNaN(Z)?1/0:Z},project:function(f,b){return b=b===void 0?this._zoom:b,this.options.crs.latLngToPoint(ie(f),b)},unproject:function(f,b){return b=b===void 0?this._zoom:b,this.options.crs.pointToLatLng(K(f),b)},layerPointToLatLng:function(f){var b=K(f).add(this.getPixelOrigin());return this.unproject(b)},latLngToLayerPoint:function(f){var b=this.project(ie(f))._round();return b._subtract(this.getPixelOrigin())},wrapLatLng:function(f){return this.options.crs.wrapLatLng(ie(f))},wrapLatLngBounds:function(f){return this.options.crs.wrapLatLngBounds(J(f))},distance:function(f,b){return this.options.crs.distance(ie(f),ie(b))},containerPointToLayerPoint:function(f){return K(f).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(f){return K(f).add(this._getMapPanePos())},containerPointToLatLng:function(f){var b=this.containerPointToLayerPoint(K(f));return this.layerPointToLatLng(b)},latLngToContainerPoint:function(f){return this.layerPointToContainerPoint(this.latLngToLayerPoint(ie(f)))},mouseEventToContainerPoint:function(f){return B9(f,this._container)},mouseEventToLayerPoint:function(f){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(f))},mouseEventToLatLng:function(f){return this.layerPointToLatLng(this.mouseEventToLayerPoint(f))},_initContainer:function(f){var b=this._container=Hn(f);if(b){if(b._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Nn(b,"scroll",this._onScroll,this),this._containerId=l(b)},_initLayout:function(){var f=this._container;this._fadeAnimated=this.options.fadeAnimation&&ot.any3d,hn(f,"leaflet-container"+(ot.touch?" leaflet-touch":"")+(ot.retina?" leaflet-retina":"")+(ot.ielt9?" leaflet-oldie":"")+(ot.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var b=Tn(f,"position");b!=="absolute"&&b!=="relative"&&b!=="fixed"&&b!=="sticky"&&(f.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var f=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),An(this._mapPane,new Q(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(hn(f.markerPane,"leaflet-zoom-hide"),hn(f.shadowPane,"leaflet-zoom-hide"))},_resetView:function(f,b,O){An(this._mapPane,new Q(0,0));var Z=!this._loaded;this._loaded=!0,b=this._limitZoom(b),this.fire("viewprereset");var G=this._zoom!==b;this._moveStart(G,O)._move(f,b)._moveEnd(G),this.fire("viewreset"),Z&&this.fire("load")},_moveStart:function(f,b){return f&&this.fire("zoomstart"),b||this.fire("movestart"),this},_move:function(f,b,O,Z){b===void 0&&(b=this._zoom);var G=this._zoom!==b;return this._zoom=b,this._lastCenter=f,this._pixelOrigin=this._getNewPixelOrigin(f),Z?O&&O.pinch&&this.fire("zoom",O):((G||O&&O.pinch)&&this.fire("zoom",O),this.fire("move",O)),this},_moveEnd:function(f){return f&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return T(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(f){An(this._mapPane,this._getMapPanePos().subtract(f))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(f){this._targets={},this._targets[l(this._container)]=this;var b=f?pn:Nn;b(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&b(window,"resize",this._onResize,this),ot.any3d&&this.options.transform3DLimit&&(f?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){T(this._resizeRequest),this._resizeRequest=P(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var f=this._getMapPanePos();Math.max(Math.abs(f.x),Math.abs(f.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(f,b){for(var O=[],Z,G=b==="mouseout"||b==="mouseover",oe=f.target||f.srcElement,Re=!1;oe;){if(Z=this._targets[l(oe)],Z&&(b==="click"||b==="preclick")&&this._draggableMoved(Z)){Re=!0;break}if(Z&&Z.listens(b,!0)&&(G&&!ka(oe,f)||(O.push(Z),G))||oe===this._container)break;oe=oe.parentNode}return!O.length&&!Re&&!G&&this.listens(b,!0)&&(O=[this]),O},_isClickDisabled:function(f){for(;f&&f!==this._container;){if(f._leaflet_disable_click)return!0;f=f.parentNode}},_handleDOMEvent:function(f){var b=f.target||f.srcElement;if(!(!this._loaded||b._leaflet_disable_events||f.type==="click"&&this._isClickDisabled(b))){var O=f.type;O==="mousedown"&&i1(b),this._fireDOMEvent(f,O)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(f,b,O){if(f.type==="click"){var Z=o({},f);Z.type="preclick",this._fireDOMEvent(Z,Z.type,O)}var G=this._findEventTargets(f,b);if(O){for(var oe=[],Re=0;Re<O.length;Re++)O[Re].listens(b,!0)&&oe.push(O[Re]);G=oe.concat(G)}if(G.length){b==="contextmenu"&&jn(f);var qe=G[0],at={originalEvent:f};if(f.type!=="keypress"&&f.type!=="keydown"&&f.type!=="keyup"){var Ht=qe.getLatLng&&(!qe._radius||qe._radius<=10);at.containerPoint=Ht?this.latLngToContainerPoint(qe.getLatLng()):this.mouseEventToContainerPoint(f),at.layerPoint=this.containerPointToLayerPoint(at.containerPoint),at.latlng=Ht?qe.getLatLng():this.layerPointToLatLng(at.layerPoint)}for(Re=0;Re<G.length;Re++)if(G[Re].fire(b,at,!0),at.originalEvent._stopped||G[Re].options.bubblingMouseEvents===!1&&S(this._mouseEvents,b)!==-1)return}},_draggableMoved:function(f){return f=f.dragging&&f.dragging.enabled()?f:this,f.dragging&&f.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var f=0,b=this._handlers.length;f<b;f++)this._handlers[f].disable()},whenReady:function(f,b){return this._loaded?f.call(b||this,{target:this}):this.on("load",f,b),this},_getMapPanePos:function(){return _n(this._mapPane)||new Q(0,0)},_moved:function(){var f=this._getMapPanePos();return f&&!f.equals([0,0])},_getTopLeftPoint:function(f,b){var O=f&&b!==void 0?this._getNewPixelOrigin(f,b):this.getPixelOrigin();return O.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(f,b){var O=this.getSize()._divideBy(2);return this.project(f,b)._subtract(O)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(f,b,O){var Z=this._getNewPixelOrigin(O,b);return this.project(f,b)._subtract(Z)},_latLngBoundsToNewLayerBounds:function(f,b,O){var Z=this._getNewPixelOrigin(O,b);return Y([this.project(f.getSouthWest(),b)._subtract(Z),this.project(f.getNorthWest(),b)._subtract(Z),this.project(f.getSouthEast(),b)._subtract(Z),this.project(f.getNorthEast(),b)._subtract(Z)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(f){return this.latLngToLayerPoint(f).subtract(this._getCenterLayerPoint())},_limitCenter:function(f,b,O){if(!O)return f;var Z=this.project(f,b),G=this.getSize().divideBy(2),oe=new $(Z.subtract(G),Z.add(G)),Re=this._getBoundsOffset(oe,O,b);return Math.abs(Re.x)<=1&&Math.abs(Re.y)<=1?f:this.unproject(Z.add(Re),b)},_limitOffset:function(f,b){if(!b)return f;var O=this.getPixelBounds(),Z=new $(O.min.add(f),O.max.add(f));return f.add(this._getBoundsOffset(Z,b))},_getBoundsOffset:function(f,b,O){var Z=Y(this.project(b.getNorthEast(),O),this.project(b.getSouthWest(),O)),G=Z.min.subtract(f.min),oe=Z.max.subtract(f.max),Re=this._rebound(G.x,-oe.x),qe=this._rebound(G.y,-oe.y);return new Q(Re,qe)},_rebound:function(f,b){return f+b>0?Math.round(f-b)/2:Math.max(0,Math.ceil(f))-Math.max(0,Math.floor(b))},_limitZoom:function(f){var b=this.getMinZoom(),O=this.getMaxZoom(),Z=ot.any3d?this.options.zoomSnap:1;return Z&&(f=Math.round(f/Z)*Z),Math.max(b,Math.min(O,f))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Bn(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(f,b){var O=this._getCenterOffset(f)._trunc();return(b&&b.animate)!==!0&&!this.getSize().contains(O)?!1:(this.panBy(O,b),!0)},_createAnimProxy:function(){var f=this._proxy=Ut("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(f),this.on("zoomanim",function(b){var O=d1,Z=this._proxy.style[O];rt(this._proxy,this.project(b.center,b.zoom),this.getZoomScale(b.zoom,1)),Z===this._proxy.style[O]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){bn(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var f=this.getCenter(),b=this.getZoom();rt(this._proxy,this.project(f,b),this.getZoomScale(b,1))},_catchTransitionEnd:function(f){this._animatingZoom&&f.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(f,b,O){if(this._animatingZoom)return!0;if(O=O||{},!this._zoomAnimated||O.animate===!1||this._nothingToAnimate()||Math.abs(b-this._zoom)>this.options.zoomAnimationThreshold)return!1;var Z=this.getZoomScale(b),G=this._getCenterOffset(f)._divideBy(1-1/Z);return O.animate!==!0&&!this.getSize().contains(G)?!1:(P(function(){this._moveStart(!0,O.noMoveStart||!1)._animateZoom(f,b,!0)},this),!0)},_animateZoom:function(f,b,O,Z){this._mapPane&&(O&&(this._animatingZoom=!0,this._animateToCenter=f,this._animateToZoom=b,hn(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:f,zoom:b,noUpdate:Z}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Bn(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function L0(f,b){return new m1(f,b)}var ur=F.extend({options:{position:"topright"},initialize:function(f){v(this,f)},getPosition:function(){return this.options.position},setPosition:function(f){var b=this._map;return b&&b.removeControl(this),this.options.position=f,b&&b.addControl(this),this},getContainer:function(){return this._container},addTo:function(f){this.remove(),this._map=f;var b=this._container=this.onAdd(f),O=this.getPosition(),Z=f._controlCorners[O];return hn(b,"leaflet-control"),O.indexOf("bottom")!==-1?Z.insertBefore(b,Z.firstChild):Z.appendChild(b),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(bn(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(f){this._map&&f&&f.screenX>0&&f.screenY>0&&this._map.getContainer().focus()}}),yr=function(f){return new ur(f)};m1.include({addControl:function(f){return f.addTo(this),this},removeControl:function(f){return f.remove(),this},_initControlPos:function(){var f=this._controlCorners={},b="leaflet-",O=this._controlContainer=Ut("div",b+"control-container",this._container);function Z(G,oe){var Re=b+G+" "+b+oe;f[G+oe]=Ut("div",Re,O)}Z("top","left"),Z("top","right"),Z("bottom","left"),Z("bottom","right")},_clearControlPos:function(){for(var f in this._controlCorners)bn(this._controlCorners[f]);bn(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Wo=ur.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(f,b,O,Z){return O<Z?-1:Z<O?1:0}},initialize:function(f,b,O){v(this,O),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var Z in f)this._addLayer(f[Z],Z);for(Z in b)this._addLayer(b[Z],Z,!0)},onAdd:function(f){this._initLayout(),this._update(),this._map=f,f.on("zoomend",this._checkDisabledLayers,this);for(var b=0;b<this._layers.length;b++)this._layers[b].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(f){return ur.prototype.addTo.call(this,f),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var f=0;f<this._layers.length;f++)this._layers[f].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(f,b){return this._addLayer(f,b),this._map?this._update():this},addOverlay:function(f,b){return this._addLayer(f,b,!0),this._map?this._update():this},removeLayer:function(f){f.off("add remove",this._onLayerChange,this);var b=this._getLayer(l(f));return b&&this._layers.splice(this._layers.indexOf(b),1),this._map?this._update():this},expand:function(){hn(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var f=this._map.getSize().y-(this._container.offsetTop+50);return f<this._section.clientHeight?(hn(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=f+"px"):Bn(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return Bn(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var f="leaflet-control-layers",b=this._container=Ut("div",f),O=this.options.collapsed;b.setAttribute("aria-haspopup",!0),Tr(b),Z2(b);var Z=this._section=Ut("section",f+"-list");O&&(this._map.on("click",this.collapse,this),Nn(b,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var G=this._layersLink=Ut("a",f+"-toggle",b);G.href="#",G.title="Layers",G.setAttribute("role","button"),Nn(G,{keydown:function(oe){oe.keyCode===13&&this._expandSafely()},click:function(oe){jn(oe),this._expandSafely()}},this),O||this.expand(),this._baseLayersList=Ut("div",f+"-base",Z),this._separator=Ut("div",f+"-separator",Z),this._overlaysList=Ut("div",f+"-overlays",Z),b.appendChild(Z)},_getLayer:function(f){for(var b=0;b<this._layers.length;b++)if(this._layers[b]&&l(this._layers[b].layer)===f)return this._layers[b]},_addLayer:function(f,b,O){this._map&&f.on("add remove",this._onLayerChange,this),this._layers.push({layer:f,name:b,overlay:O}),this.options.sortLayers&&this._layers.sort(a(function(Z,G){return this.options.sortFunction(Z.layer,G.layer,Z.name,G.name)},this)),this.options.autoZIndex&&f.setZIndex&&(this._lastZIndex++,f.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Qn(this._baseLayersList),Qn(this._overlaysList),this._layerControlInputs=[];var f,b,O,Z,G=0;for(O=0;O<this._layers.length;O++)Z=this._layers[O],this._addItem(Z),b=b||Z.overlay,f=f||!Z.overlay,G+=Z.overlay?0:1;return this.options.hideSingleBase&&(f=f&&G>1,this._baseLayersList.style.display=f?"":"none"),this._separator.style.display=b&&f?"":"none",this},_onLayerChange:function(f){this._handlingClick||this._update();var b=this._getLayer(l(f.target)),O=b.overlay?f.type==="add"?"overlayadd":"overlayremove":f.type==="add"?"baselayerchange":null;O&&this._map.fire(O,b)},_createRadioElement:function(f,b){var O='<input type="radio" class="leaflet-control-layers-selector" name="'+f+'"'+(b?' checked="checked"':"")+"/>",Z=document.createElement("div");return Z.innerHTML=O,Z.firstChild},_addItem:function(f){var b=document.createElement("label"),O=this._map.hasLayer(f.layer),Z;f.overlay?(Z=document.createElement("input"),Z.type="checkbox",Z.className="leaflet-control-layers-selector",Z.defaultChecked=O):Z=this._createRadioElement("leaflet-base-layers_"+l(this),O),this._layerControlInputs.push(Z),Z.layerId=l(f.layer),Nn(Z,"click",this._onInputClick,this);var G=document.createElement("span");G.innerHTML=" "+f.name;var oe=document.createElement("span");b.appendChild(oe),oe.appendChild(Z),oe.appendChild(G);var Re=f.overlay?this._overlaysList:this._baseLayersList;return Re.appendChild(b),this._checkDisabledLayers(),b},_onInputClick:function(){if(!this._preventClick){var f=this._layerControlInputs,b,O,Z=[],G=[];this._handlingClick=!0;for(var oe=f.length-1;oe>=0;oe--)b=f[oe],O=this._getLayer(b.layerId).layer,b.checked?Z.push(O):b.checked||G.push(O);for(oe=0;oe<G.length;oe++)this._map.hasLayer(G[oe])&&this._map.removeLayer(G[oe]);for(oe=0;oe<Z.length;oe++)this._map.hasLayer(Z[oe])||this._map.addLayer(Z[oe]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var f=this._layerControlInputs,b,O,Z=this._map.getZoom(),G=f.length-1;G>=0;G--)b=f[G],O=this._getLayer(b.layerId).layer,b.disabled=O.options.minZoom!==void 0&&Z<O.options.minZoom||O.options.maxZoom!==void 0&&Z>O.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var f=this._section;this._preventClick=!0,Nn(f,"click",jn),this.expand();var b=this;setTimeout(function(){pn(f,"click",jn),b._preventClick=!1})}}),Ra=function(f,b,O){return new Wo(f,b,O)},b0=ur.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(f){var b="leaflet-control-zoom",O=Ut("div",b+" leaflet-bar"),Z=this.options;return this._zoomInButton=this._createButton(Z.zoomInText,Z.zoomInTitle,b+"-in",O,this._zoomIn),this._zoomOutButton=this._createButton(Z.zoomOutText,Z.zoomOutTitle,b+"-out",O,this._zoomOut),this._updateDisabled(),f.on("zoomend zoomlevelschange",this._updateDisabled,this),O},onRemove:function(f){f.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(f){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(f.shiftKey?3:1))},_zoomOut:function(f){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(f.shiftKey?3:1))},_createButton:function(f,b,O,Z,G){var oe=Ut("a",O,Z);return oe.innerHTML=f,oe.href="#",oe.title=b,oe.setAttribute("role","button"),oe.setAttribute("aria-label",b),Tr(oe),Nn(oe,"click",t1),Nn(oe,"click",G,this),Nn(oe,"click",this._refocusOnMap,this),oe},_updateDisabled:function(){var f=this._map,b="leaflet-disabled";Bn(this._zoomInButton,b),Bn(this._zoomOutButton,b),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||f._zoom===f.getMinZoom())&&(hn(this._zoomOutButton,b),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||f._zoom===f.getMaxZoom())&&(hn(this._zoomInButton,b),this._zoomInButton.setAttribute("aria-disabled","true"))}});m1.mergeOptions({zoomControl:!0}),m1.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new b0,this.addControl(this.zoomControl))});var T3=function(f){return new b0(f)},e2=ur.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(f){var b="leaflet-control-scale",O=Ut("div",b),Z=this.options;return this._addScales(Z,b+"-line",O),f.on(Z.updateWhenIdle?"moveend":"move",this._update,this),f.whenReady(this._update,this),O},onRemove:function(f){f.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(f,b,O){f.metric&&(this._mScale=Ut("div",b,O)),f.imperial&&(this._iScale=Ut("div",b,O))},_update:function(){var f=this._map,b=f.getSize().y/2,O=f.distance(f.containerPointToLatLng([0,b]),f.containerPointToLatLng([this.options.maxWidth,b]));this._updateScales(O)},_updateScales:function(f){this.options.metric&&f&&this._updateMetric(f),this.options.imperial&&f&&this._updateImperial(f)},_updateMetric:function(f){var b=this._getRoundNum(f),O=b<1e3?b+" m":b/1e3+" km";this._updateScale(this._mScale,O,b/f)},_updateImperial:function(f){var b=f*3.2808399,O,Z,G;b>5280?(O=b/5280,Z=this._getRoundNum(O),this._updateScale(this._iScale,Z+" mi",Z/O)):(G=this._getRoundNum(b),this._updateScale(this._iScale,G+" ft",G/b))},_updateScale:function(f,b,O){f.style.width=Math.round(this.options.maxWidth*O)+"px",f.innerHTML=b},_getRoundNum:function(f){var b=Math.pow(10,(Math.floor(f)+"").length-1),O=f/b;return O=O>=10?10:O>=5?5:O>=3?3:O>=2?2:1,b*O}}),N3=function(f){return new e2(f)},Nr='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Da=ur.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(ot.inlineSvg?Nr+" ":"")+"Leaflet</a>"},initialize:function(f){v(this,f),this._attributions={}},onAdd:function(f){f.attributionControl=this,this._container=Ut("div","leaflet-control-attribution"),Tr(this._container);for(var b in f._layers)f._layers[b].getAttribution&&this.addAttribution(f._layers[b].getAttribution());return this._update(),f.on("layeradd",this._addAttribution,this),this._container},onRemove:function(f){f.off("layeradd",this._addAttribution,this)},_addAttribution:function(f){f.layer.getAttribution&&(this.addAttribution(f.layer.getAttribution()),f.layer.once("remove",function(){this.removeAttribution(f.layer.getAttribution())},this))},setPrefix:function(f){return this.options.prefix=f,this._update(),this},addAttribution:function(f){return f?(this._attributions[f]||(this._attributions[f]=0),this._attributions[f]++,this._update(),this):this},removeAttribution:function(f){return f?(this._attributions[f]&&(this._attributions[f]--,this._update()),this):this},_update:function(){if(this._map){var f=[];for(var b in this._attributions)this._attributions[b]&&f.push(b);var O=[];this.options.prefix&&O.push(this.options.prefix),f.length&&O.push(f.join(", ")),this._container.innerHTML=O.join(' <span aria-hidden="true">|</span> ')}}});m1.mergeOptions({attributionControl:!0}),m1.addInitHook(function(){this.options.attributionControl&&new Da().addTo(this)});var t2=function(f){return new Da(f)};ur.Layers=Wo,ur.Zoom=b0,ur.Scale=e2,ur.Attribution=Da,yr.layers=Ra,yr.zoom=T3,yr.scale=N3,yr.attribution=t2;var l0=F.extend({initialize:function(f){this._map=f},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});l0.addTo=function(f,b){return f.addHandler(b,this),this};var F3={Events:z},m0=ot.touch?"touchstart mousedown":"mousedown",U2=W.extend({options:{clickTolerance:3},initialize:function(f,b,O,Z){v(this,Z),this._element=f,this._dragStartTarget=b||f,this._preventOutline=O},enable:function(){this._enabled||(Nn(this._dragStartTarget,m0,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(U2._dragging===this&&this.finishDrag(!0),pn(this._dragStartTarget,m0,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(f){if(this._enabled&&(this._moved=!1,!H1(this._element,"leaflet-zoom-anim"))){if(f.touches&&f.touches.length!==1){U2._dragging===this&&this.finishDrag();return}if(!(U2._dragging||f.shiftKey||f.which!==1&&f.button!==1&&!f.touches)&&(U2._dragging=this,this._preventOutline&&i1(this._element),Bt(),L1(),!this._moving)){this.fire("down");var b=f.touches?f.touches[0]:f,O=O1(this._element);this._startPoint=new Q(b.clientX,b.clientY),this._startPos=_n(this._element),this._parentScale=gn(O);var Z=f.type==="mousedown";Nn(document,Z?"mousemove":"touchmove",this._onMove,this),Nn(document,Z?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(f){if(this._enabled){if(f.touches&&f.touches.length>1){this._moved=!0;return}var b=f.touches&&f.touches.length===1?f.touches[0]:f,O=new Q(b.clientX,b.clientY)._subtract(this._startPoint);!O.x&&!O.y||Math.abs(O.x)+Math.abs(O.y)<this.options.clickTolerance||(O.x/=this._parentScale.x,O.y/=this._parentScale.y,jn(f),this._moved||(this.fire("dragstart"),this._moved=!0,hn(document.body,"leaflet-dragging"),this._lastTarget=f.target||f.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),hn(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(O),this._moving=!0,this._lastEvent=f,this._updatePosition())}},_updatePosition:function(){var f={originalEvent:this._lastEvent};this.fire("predrag",f),An(this._element,this._newPos),this.fire("drag",f)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(f){Bn(document.body,"leaflet-dragging"),this._lastTarget&&(Bn(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),pn(document,"mousemove touchmove",this._onMove,this),pn(document,"mouseup touchend touchcancel",this._onUp,this),Ft(),g1();var b=this._moved&&this._moving;this._moving=!1,U2._dragging=!1,b&&this.fire("dragend",{noInertia:f,distance:this._newPos.distanceTo(this._startPos)})}});function Ko(f,b,O){var Z,G=[1,4,2,8],oe,Re,qe,at,Ht,rn,Rn,Gn;for(oe=0,rn=f.length;oe<rn;oe++)f[oe]._code=er(f[oe],b);for(qe=0;qe<4;qe++){for(Rn=G[qe],Z=[],oe=0,rn=f.length,Re=rn-1;oe<rn;Re=oe++)at=f[oe],Ht=f[Re],at._code&Rn?Ht._code&Rn||(Gn=wr(Ht,at,Rn,b,O),Gn._code=er(Gn,b),Z.push(Gn)):(Ht._code&Rn&&(Gn=wr(Ht,at,Rn,b,O),Gn._code=er(Gn,b),Z.push(Gn)),Z.push(at));f=Z}return f}function T1(f,b){var O,Z,G,oe,Re,qe,at,Ht,rn;if(!f||f.length===0)throw new Error("latlngs not passed");fr(f)||(console.warn("latlngs are not flat! Only the first ring will be used"),f=f[0]);var Rn=ie([0,0]),Gn=J(f),h0=Gn.getNorthWest().distanceTo(Gn.getSouthWest())*Gn.getNorthEast().distanceTo(Gn.getNorthWest());h0<1700&&(Rn=Qo(f));var be=f.length,ge=[];for(O=0;O<be;O++){var Me=ie(f[O]);ge.push(b.project(ie([Me.lat-Rn.lat,Me.lng-Rn.lng])))}for(qe=at=Ht=0,O=0,Z=be-1;O<be;Z=O++)G=ge[O],oe=ge[Z],Re=G.y*oe.x-oe.y*G.x,at+=(G.x+oe.x)*Re,Ht+=(G.y+oe.y)*Re,qe+=Re*3;qe===0?rn=ge[0]:rn=[at/qe,Ht/qe];var Fe=b.unproject(K(rn));return ie([Fe.lat+Rn.lat,Fe.lng+Rn.lng])}function Qo(f){for(var b=0,O=0,Z=0,G=0;G<f.length;G++){var oe=ie(f[G]);b+=oe.lat,O+=oe.lng,Z++}return ie([b/Z,O/Z])}var D9={__proto__:null,clipPolygon:Ko,polygonCenter:T1,centroid:Qo};function Y1(f,b){if(!b||!f.length)return f.slice();var O=b*b;return f=y5(f,O),f=j3(f,O),f}function dr(f,b,O){return Math.sqrt(Fi(f,b,O,!0))}function Go(f,b,O){return Fi(f,b,O)}function j3(f,b){var O=f.length,Z=typeof Uint8Array<"u"?Uint8Array:Array,G=new Z(O);G[0]=G[O-1]=1,Yo(f,G,b,0,O-1);var oe,Re=[];for(oe=0;oe<O;oe++)G[oe]&&Re.push(f[oe]);return Re}function Yo(f,b,O,Z,G){var oe=0,Re,qe,at;for(qe=Z+1;qe<=G-1;qe++)at=Fi(f[qe],f[Z],f[G],!0),at>oe&&(Re=qe,oe=at);oe>O&&(b[Re]=1,Yo(f,b,O,Z,Re),Yo(f,b,O,Re,G))}function y5(f,b){for(var O=[f[0]],Z=1,G=0,oe=f.length;Z<oe;Z++)Jo(f[Z],f[G])>b&&(O.push(f[Z]),G=Z);return G<oe-1&&O.push(f[oe-1]),O}var Xo;function qo(f,b,O,Z,G){var oe=Z?Xo:er(f,O),Re=er(b,O),qe,at,Ht;for(Xo=Re;;){if(!(oe|Re))return[f,b];if(oe&Re)return!1;qe=oe||Re,at=wr(f,b,qe,O,G),Ht=er(at,O),qe===oe?(f=at,oe=Ht):(b=at,Re=Ht)}}function wr(f,b,O,Z,G){var oe=b.x-f.x,Re=b.y-f.y,qe=Z.min,at=Z.max,Ht,rn;return O&8?(Ht=f.x+oe*(at.y-f.y)/Re,rn=at.y):O&4?(Ht=f.x+oe*(qe.y-f.y)/Re,rn=qe.y):O&2?(Ht=at.x,rn=f.y+Re*(at.x-f.x)/oe):O&1&&(Ht=qe.x,rn=f.y+Re*(qe.x-f.x)/oe),new Q(Ht,rn,G)}function er(f,b){var O=0;return f.x<b.min.x?O|=1:f.x>b.max.x&&(O|=2),f.y<b.min.y?O|=4:f.y>b.max.y&&(O|=8),O}function Jo(f,b){var O=b.x-f.x,Z=b.y-f.y;return O*O+Z*Z}function Fi(f,b,O,Z){var G=b.x,oe=b.y,Re=O.x-G,qe=O.y-oe,at=Re*Re+qe*qe,Ht;return at>0&&(Ht=((f.x-G)*Re+(f.y-oe)*qe)/at,Ht>1?(G=O.x,oe=O.y):Ht>0&&(G+=Re*Ht,oe+=qe*Ht)),Re=f.x-G,qe=f.y-oe,Z?Re*Re+qe*qe:new Q(G,oe)}function fr(f){return!E(f[0])||typeof f[0][0]!="object"&&typeof f[0][0]<"u"}function ji(f){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),fr(f)}function ei(f,b){var O,Z,G,oe,Re,qe,at,Ht;if(!f||f.length===0)throw new Error("latlngs not passed");fr(f)||(console.warn("latlngs are not flat! Only the first ring will be used"),f=f[0]);var rn=ie([0,0]),Rn=J(f),Gn=Rn.getNorthWest().distanceTo(Rn.getSouthWest())*Rn.getNorthEast().distanceTo(Rn.getNorthWest());Gn<1700&&(rn=Qo(f));var h0=f.length,be=[];for(O=0;O<h0;O++){var ge=ie(f[O]);be.push(b.project(ie([ge.lat-rn.lat,ge.lng-rn.lng])))}for(O=0,Z=0;O<h0-1;O++)Z+=be[O].distanceTo(be[O+1])/2;if(Z===0)Ht=be[0];else for(O=0,oe=0;O<h0-1;O++)if(Re=be[O],qe=be[O+1],G=Re.distanceTo(qe),oe+=G,oe>Z){at=(oe-Z)/G,Ht=[qe.x-at*(qe.x-Re.x),qe.y-at*(qe.y-Re.y)];break}var Me=b.unproject(K(Ht));return ie([Me.lat+rn.lat,Me.lng+rn.lng])}var ti={__proto__:null,simplify:Y1,pointToSegmentDistance:dr,closestPointOnSegment:Go,clipSegment:qo,_getEdgeIntersection:wr,_getBitCode:er,_sqClosestPointOnSegment:Fi,isFlat:fr,_flat:ji,polylineCenter:ei},xr={project:function(f){return new Q(f.lng,f.lat)},unproject:function(f){return new ee(f.y,f.x)},bounds:new $([-180,-90],[180,90])},ni={R:6378137,R_MINOR:6356752314245179e-9,bounds:new $([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(f){var b=Math.PI/180,O=this.R,Z=f.lat*b,G=this.R_MINOR/O,oe=Math.sqrt(1-G*G),Re=oe*Math.sin(Z),qe=Math.tan(Math.PI/4-Z/2)/Math.pow((1-Re)/(1+Re),oe/2);return Z=-O*Math.log(Math.max(qe,1e-10)),new Q(f.lng*b*O,Z)},unproject:function(f){for(var b=180/Math.PI,O=this.R,Z=this.R_MINOR/O,G=Math.sqrt(1-Z*Z),oe=Math.exp(-f.y/O),Re=Math.PI/2-2*Math.atan(oe),qe=0,at=.1,Ht;qe<15&&Math.abs(at)>1e-7;qe++)Ht=G*Math.sin(Re),Ht=Math.pow((1-Ht)/(1+Ht),G/2),at=Math.PI/2-2*Math.atan(oe*Ht)-Re,Re+=at;return new ee(Re*b,f.x*b/O)}},Er={__proto__:null,LonLat:xr,Mercator:ni,SphericalMercator:xe},I9=o({},le,{code:"EPSG:3395",projection:ni,transformation:function(){var f=.5/(Math.PI*ni.R);return de(f,.5,-f,.5)}()}),V3=o({},le,{code:"EPSG:4326",projection:xr,transformation:de(1/180,1,-1/180,.5)}),P9=o({},he,{projection:xr,transformation:de(1,0,-1,0),scale:function(f){return Math.pow(2,f)},zoom:function(f){return Math.log(f)/Math.LN2},distance:function(f,b){var O=b.lng-f.lng,Z=b.lat-f.lat;return Math.sqrt(O*O+Z*Z)},infinite:!0});he.Earth=le,he.EPSG3395=I9,he.EPSG3857=ce,he.EPSG900913=Ce,he.EPSG4326=V3,he.Simple=P9;var n1=W.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(f){return f.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(f){return f&&f.removeLayer(this),this},getPane:function(f){return this._map.getPane(f?this.options[f]||f:this.options.pane)},addInteractiveTarget:function(f){return this._map._targets[l(f)]=this,this},removeInteractiveTarget:function(f){return delete this._map._targets[l(f)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(f){var b=f.target;if(b.hasLayer(this)){if(this._map=b,this._zoomAnimated=b._zoomAnimated,this.getEvents){var O=this.getEvents();b.on(O,this),this.once("remove",function(){b.off(O,this)},this)}this.onAdd(b),this.fire("add"),b.fire("layeradd",{layer:this})}}});m1.include({addLayer:function(f){if(!f._layerAdd)throw new Error("The provided object is not a Layer.");var b=l(f);return this._layers[b]?this:(this._layers[b]=f,f._mapToAdd=this,f.beforeAdd&&f.beforeAdd(this),this.whenReady(f._layerAdd,f),this)},removeLayer:function(f){var b=l(f);return this._layers[b]?(this._loaded&&f.onRemove(this),delete this._layers[b],this._loaded&&(this.fire("layerremove",{layer:f}),f.fire("remove")),f._map=f._mapToAdd=null,this):this},hasLayer:function(f){return l(f)in this._layers},eachLayer:function(f,b){for(var O in this._layers)f.call(b,this._layers[O]);return this},_addLayers:function(f){f=f?E(f)?f:[f]:[];for(var b=0,O=f.length;b<O;b++)this.addLayer(f[b])},_addZoomLimit:function(f){(!isNaN(f.options.maxZoom)||!isNaN(f.options.minZoom))&&(this._zoomBoundLayers[l(f)]=f,this._updateZoomLevels())},_removeZoomLimit:function(f){var b=l(f);this._zoomBoundLayers[b]&&(delete this._zoomBoundLayers[b],this._updateZoomLevels())},_updateZoomLevels:function(){var f=1/0,b=-1/0,O=this._getZoomSpan();for(var Z in this._zoomBoundLayers){var G=this._zoomBoundLayers[Z].options;f=G.minZoom===void 0?f:Math.min(f,G.minZoom),b=G.maxZoom===void 0?b:Math.max(b,G.maxZoom)}this._layersMaxZoom=b===-1/0?void 0:b,this._layersMinZoom=f===1/0?void 0:f,O!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Fr=n1.extend({initialize:function(f,b){v(this,b),this._layers={};var O,Z;if(f)for(O=0,Z=f.length;O<Z;O++)this.addLayer(f[O])},addLayer:function(f){var b=this.getLayerId(f);return this._layers[b]=f,this._map&&this._map.addLayer(f),this},removeLayer:function(f){var b=f in this._layers?f:this.getLayerId(f);return this._map&&this._layers[b]&&this._map.removeLayer(this._layers[b]),delete this._layers[b],this},hasLayer:function(f){var b=typeof f=="number"?f:this.getLayerId(f);return b in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(f){var b=Array.prototype.slice.call(arguments,1),O,Z;for(O in this._layers)Z=this._layers[O],Z[f]&&Z[f].apply(Z,b);return this},onAdd:function(f){this.eachLayer(f.addLayer,f)},onRemove:function(f){this.eachLayer(f.removeLayer,f)},eachLayer:function(f,b){for(var O in this._layers)f.call(b,this._layers[O]);return this},getLayer:function(f){return this._layers[f]},getLayers:function(){var f=[];return this.eachLayer(f.push,f),f},setZIndex:function(f){return this.invoke("setZIndex",f)},getLayerId:function(f){return l(f)}}),Vi=function(f,b){return new Fr(f,b)},_r=Fr.extend({addLayer:function(f){return this.hasLayer(f)?this:(f.addEventParent(this),Fr.prototype.addLayer.call(this,f),this.fire("layeradd",{layer:f}))},removeLayer:function(f){return this.hasLayer(f)?(f in this._layers&&(f=this._layers[f]),f.removeEventParent(this),Fr.prototype.removeLayer.call(this,f),this.fire("layerremove",{layer:f})):this},setStyle:function(f){return this.invoke("setStyle",f)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var f=new X;for(var b in this._layers){var O=this._layers[b];f.extend(O.getBounds?O.getBounds():O.getLatLng())}return f}}),W2=function(f,b){return new _r(f,b)},A2=F.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(f){v(this,f)},createIcon:function(f){return this._createIcon("icon",f)},createShadow:function(f){return this._createIcon("shadow",f)},_createIcon:function(f,b){var O=this._getIconUrl(f);if(!O){if(f==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var Z=this._createImg(O,b&&b.tagName==="IMG"?b:null);return this._setIconStyles(Z,f),(this.options.crossOrigin||this.options.crossOrigin==="")&&(Z.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),Z},_setIconStyles:function(f,b){var O=this.options,Z=O[b+"Size"];typeof Z=="number"&&(Z=[Z,Z]);var G=K(Z),oe=K(b==="shadow"&&O.shadowAnchor||O.iconAnchor||G&&G.divideBy(2,!0));f.className="leaflet-marker-"+b+" "+(O.className||""),oe&&(f.style.marginLeft=-oe.x+"px",f.style.marginTop=-oe.y+"px"),G&&(f.style.width=G.x+"px",f.style.height=G.y+"px")},_createImg:function(f,b){return b=b||document.createElement("img"),b.src=f,b},_getIconUrl:function(f){return ot.retina&&this.options[f+"RetinaUrl"]||this.options[f+"Url"]}});function w5(f){return new A2(f)}var ri=A2.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(f){return typeof ri.imagePath!="string"&&(ri.imagePath=this._detectIconPath()),(this.options.imagePath||ri.imagePath)+A2.prototype._getIconUrl.call(this,f)},_stripUrl:function(f){var b=function(O,Z,G){var oe=Z.exec(O);return oe&&oe[G]};return f=b(f,/^url\((['"])?(.+)\1\)$/,2),f&&b(f,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var f=Ut("div","leaflet-default-icon-path",document.body),b=Tn(f,"background-image")||Tn(f,"backgroundImage");if(document.body.removeChild(f),b=this._stripUrl(b),b)return b;var O=document.querySelector('link[href$="leaflet.css"]');return O?O.href.substring(0,O.href.length-11-1):""}}),z3=l0.extend({initialize:function(f){this._marker=f},addHooks:function(){var f=this._marker._icon;this._draggable||(this._draggable=new U2(f,f,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),hn(f,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&Bn(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(f){var b=this._marker,O=b._map,Z=this._marker.options.autoPanSpeed,G=this._marker.options.autoPanPadding,oe=_n(b._icon),Re=O.getPixelBounds(),qe=O.getPixelOrigin(),at=Y(Re.min._subtract(qe).add(G),Re.max._subtract(qe).subtract(G));if(!at.contains(oe)){var Ht=K((Math.max(at.max.x,oe.x)-at.max.x)/(Re.max.x-at.max.x)-(Math.min(at.min.x,oe.x)-at.min.x)/(Re.min.x-at.min.x),(Math.max(at.max.y,oe.y)-at.max.y)/(Re.max.y-at.max.y)-(Math.min(at.min.y,oe.y)-at.min.y)/(Re.min.y-at.min.y)).multiplyBy(Z);O.panBy(Ht,{animate:!1}),this._draggable._newPos._add(Ht),this._draggable._startPos._add(Ht),An(b._icon,this._draggable._newPos),this._onDrag(f),this._panRequest=P(this._adjustPan.bind(this,f))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(f){this._marker.options.autoPan&&(T(this._panRequest),this._panRequest=P(this._adjustPan.bind(this,f)))},_onDrag:function(f){var b=this._marker,O=b._shadow,Z=_n(b._icon),G=b._map.layerPointToLatLng(Z);O&&An(O,Z),b._latlng=G,f.latlng=G,f.oldLatLng=this._oldLatLng,b.fire("move",f).fire("drag",f)},_onDragEnd:function(f){T(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",f)}}),zi=n1.extend({options:{icon:new ri,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(f,b){v(this,b),this._latlng=ie(f)},onAdd:function(f){this._zoomAnimated=this._zoomAnimated&&f.options.markerZoomAnimation,this._zoomAnimated&&f.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(f){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&f.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(f){var b=this._latlng;return this._latlng=ie(f),this.update(),this.fire("move",{oldLatLng:b,latlng:this._latlng})},setZIndexOffset:function(f){return this.options.zIndexOffset=f,this.update()},getIcon:function(){return this.options.icon},setIcon:function(f){return this.options.icon=f,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var f=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(f)}return this},_initIcon:function(){var f=this.options,b="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),O=f.icon.createIcon(this._icon),Z=!1;O!==this._icon&&(this._icon&&this._removeIcon(),Z=!0,f.title&&(O.title=f.title),O.tagName==="IMG"&&(O.alt=f.alt||"")),hn(O,b),f.keyboard&&(O.tabIndex="0",O.setAttribute("role","button")),this._icon=O,f.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Nn(O,"focus",this._panOnFocus,this);var G=f.icon.createShadow(this._shadow),oe=!1;G!==this._shadow&&(this._removeShadow(),oe=!0),G&&(hn(G,b),G.alt=""),this._shadow=G,f.opacity<1&&this._updateOpacity(),Z&&this.getPane().appendChild(this._icon),this._initInteraction(),G&&oe&&this.getPane(f.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&pn(this._icon,"focus",this._panOnFocus,this),bn(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&bn(this._shadow),this._shadow=null},_setPos:function(f){this._icon&&An(this._icon,f),this._shadow&&An(this._shadow,f),this._zIndex=f.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(f){this._icon&&(this._icon.style.zIndex=this._zIndex+f)},_animateZoom:function(f){var b=this._map._latLngToNewLayerPoint(this._latlng,f.zoom,f.center).round();this._setPos(b)},_initInteraction:function(){if(this.options.interactive&&(hn(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),z3)){var f=this.options.draggable;this.dragging&&(f=this.dragging.enabled(),this.dragging.disable()),this.dragging=new z3(this),f&&this.dragging.enable()}},setOpacity:function(f){return this.options.opacity=f,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var f=this.options.opacity;this._icon&&At(this._icon,f),this._shadow&&At(this._shadow,f)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var f=this._map;if(f){var b=this.options.icon.options,O=b.iconSize?K(b.iconSize):K(0,0),Z=b.iconAnchor?K(b.iconAnchor):K(0,0);f.panInside(this._latlng,{paddingTopLeft:Z,paddingBottomRight:O.subtract(Z)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function ho(f,b){return new zi(f,b)}var K2=n1.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(f){this._renderer=f.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(f){return v(this,f),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&f&&Object.prototype.hasOwnProperty.call(f,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),oi=K2.extend({options:{fill:!0,radius:10},initialize:function(f,b){v(this,b),this._latlng=ie(f),this._radius=this.options.radius},setLatLng:function(f){var b=this._latlng;return this._latlng=ie(f),this.redraw(),this.fire("move",{oldLatLng:b,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(f){return this.options.radius=this._radius=f,this.redraw()},getRadius:function(){return this._radius},setStyle:function(f){var b=f&&f.radius||this._radius;return K2.prototype.setStyle.call(this,f),this.setRadius(b),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var f=this._radius,b=this._radiusY||f,O=this._clickTolerance(),Z=[f+O,b+O];this._pxBounds=new $(this._point.subtract(Z),this._point.add(Z))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(f){return f.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function k1(f,b){return new oi(f,b)}var Sr=oi.extend({initialize:function(f,b,O){if(typeof b=="number"&&(b=o({},O,{radius:b})),v(this,b),this._latlng=ie(f),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(f){return this._mRadius=f,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var f=[this._radius,this._radiusY||this._radius];return new X(this._map.layerPointToLatLng(this._point.subtract(f)),this._map.layerPointToLatLng(this._point.add(f)))},setStyle:K2.prototype.setStyle,_project:function(){var f=this._latlng.lng,b=this._latlng.lat,O=this._map,Z=O.options.crs;if(Z.distance===le.distance){var G=Math.PI/180,oe=this._mRadius/le.R/G,Re=O.project([b+oe,f]),qe=O.project([b-oe,f]),at=Re.add(qe).divideBy(2),Ht=O.unproject(at).lat,rn=Math.acos((Math.cos(oe*G)-Math.sin(b*G)*Math.sin(Ht*G))/(Math.cos(b*G)*Math.cos(Ht*G)))/G;(isNaN(rn)||rn===0)&&(rn=oe/Math.cos(Math.PI/180*b)),this._point=at.subtract(O.getPixelOrigin()),this._radius=isNaN(rn)?0:at.x-O.project([Ht,f-rn]).x,this._radiusY=at.y-Re.y}else{var Rn=Z.unproject(Z.project(this._latlng).subtract([this._mRadius,0]));this._point=O.latLngToLayerPoint(this._latlng),this._radius=this._point.x-O.latLngToLayerPoint(Rn).x}this._updateBounds()}});function Q2(f,b,O){return new Sr(f,b,O)}var c0=K2.extend({options:{smoothFactor:1,noClip:!1},initialize:function(f,b){v(this,b),this._setLatLngs(f)},getLatLngs:function(){return this._latlngs},setLatLngs:function(f){return this._setLatLngs(f),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(f){for(var b=1/0,O=null,Z=Fi,G,oe,Re=0,qe=this._parts.length;Re<qe;Re++)for(var at=this._parts[Re],Ht=1,rn=at.length;Ht<rn;Ht++){G=at[Ht-1],oe=at[Ht];var Rn=Z(f,G,oe,!0);Rn<b&&(b=Rn,O=Z(f,G,oe))}return O&&(O.distance=Math.sqrt(b)),O},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return ei(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(f,b){return b=b||this._defaultShape(),f=ie(f),b.push(f),this._bounds.extend(f),this.redraw()},_setLatLngs:function(f){this._bounds=new X,this._latlngs=this._convertLatLngs(f)},_defaultShape:function(){return fr(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(f){for(var b=[],O=fr(f),Z=0,G=f.length;Z<G;Z++)O?(b[Z]=ie(f[Z]),this._bounds.extend(b[Z])):b[Z]=this._convertLatLngs(f[Z]);return b},_project:function(){var f=new $;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,f),this._bounds.isValid()&&f.isValid()&&(this._rawPxBounds=f,this._updateBounds())},_updateBounds:function(){var f=this._clickTolerance(),b=new Q(f,f);this._rawPxBounds&&(this._pxBounds=new $([this._rawPxBounds.min.subtract(b),this._rawPxBounds.max.add(b)]))},_projectLatlngs:function(f,b,O){var Z=f[0]instanceof ee,G=f.length,oe,Re;if(Z){for(Re=[],oe=0;oe<G;oe++)Re[oe]=this._map.latLngToLayerPoint(f[oe]),O.extend(Re[oe]);b.push(Re)}else for(oe=0;oe<G;oe++)this._projectLatlngs(f[oe],b,O)},_clipPoints:function(){var f=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(f))){if(this.options.noClip){this._parts=this._rings;return}var b=this._parts,O,Z,G,oe,Re,qe,at;for(O=0,G=0,oe=this._rings.length;O<oe;O++)for(at=this._rings[O],Z=0,Re=at.length;Z<Re-1;Z++)qe=qo(at[Z],at[Z+1],f,Z,!0),qe&&(b[G]=b[G]||[],b[G].push(qe[0]),(qe[1]!==at[Z+1]||Z===Re-2)&&(b[G].push(qe[1]),G++))}},_simplifyPoints:function(){for(var f=this._parts,b=this.options.smoothFactor,O=0,Z=f.length;O<Z;O++)f[O]=Y1(f[O],b)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(f,b){var O,Z,G,oe,Re,qe,at=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(f))return!1;for(O=0,oe=this._parts.length;O<oe;O++)for(qe=this._parts[O],Z=0,Re=qe.length,G=Re-1;Z<Re;G=Z++)if(!(!b&&Z===0)&&dr(f,qe[G],qe[Z])<=at)return!0;return!1}});function Z3(f,b){return new c0(f,b)}c0._flat=ji;var Co=c0.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return T1(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(f){var b=c0.prototype._convertLatLngs.call(this,f),O=b.length;return O>=2&&b[0]instanceof ee&&b[0].equals(b[O-1])&&b.pop(),b},_setLatLngs:function(f){c0.prototype._setLatLngs.call(this,f),fr(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return fr(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var f=this._renderer._bounds,b=this.options.weight,O=new Q(b,b);if(f=new $(f.min.subtract(O),f.max.add(O)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(f))){if(this.options.noClip){this._parts=this._rings;return}for(var Z=0,G=this._rings.length,oe;Z<G;Z++)oe=Ko(this._rings[Z],f,!0),oe.length&&this._parts.push(oe)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(f){var b=!1,O,Z,G,oe,Re,qe,at,Ht;if(!this._pxBounds||!this._pxBounds.contains(f))return!1;for(oe=0,at=this._parts.length;oe<at;oe++)for(O=this._parts[oe],Re=0,Ht=O.length,qe=Ht-1;Re<Ht;qe=Re++)Z=O[Re],G=O[qe],Z.y>f.y!=G.y>f.y&&f.x<(G.x-Z.x)*(f.y-Z.y)/(G.y-Z.y)+Z.x&&(b=!b);return b||c0.prototype._containsPoint.call(this,f,!0)}});function $3(f,b){return new Co(f,b)}var U0=_r.extend({initialize:function(f,b){v(this,b),this._layers={},f&&this.addData(f)},addData:function(f){var b=E(f)?f:f.features,O,Z,G;if(b){for(O=0,Z=b.length;O<Z;O++)G=b[O],(G.geometries||G.geometry||G.features||G.coordinates)&&this.addData(G);return this}var oe=this.options;if(oe.filter&&!oe.filter(f))return this;var Re=tr(f,oe);return Re?(Re.feature=jr(f),Re.defaultOptions=Re.options,this.resetStyle(Re),oe.onEachFeature&&oe.onEachFeature(f,Re),this.addLayer(Re)):this},resetStyle:function(f){return f===void 0?this.eachLayer(this.resetStyle,this):(f.options=o({},f.defaultOptions),this._setLayerStyle(f,this.options.style),this)},setStyle:function(f){return this.eachLayer(function(b){this._setLayerStyle(b,f)},this)},_setLayerStyle:function(f,b){f.setStyle&&(typeof b=="function"&&(b=b(f.feature)),f.setStyle(b))}});function tr(f,b){var O=f.type==="Feature"?f.geometry:f,Z=O?O.coordinates:null,G=[],oe=b&&b.pointToLayer,Re=b&&b.coordsToLatLng||Zi,qe,at,Ht,rn;if(!Z&&!O)return null;switch(O.type){case"Point":return qe=Re(Z),ii(oe,f,qe,b);case"MultiPoint":for(Ht=0,rn=Z.length;Ht<rn;Ht++)qe=Re(Z[Ht]),G.push(ii(oe,f,qe,b));return new _r(G);case"LineString":case"MultiLineString":return at=Ia(Z,O.type==="LineString"?0:1,Re),new c0(at,b);case"Polygon":case"MultiPolygon":return at=Ia(Z,O.type==="Polygon"?1:2,Re),new Co(at,b);case"GeometryCollection":for(Ht=0,rn=O.geometries.length;Ht<rn;Ht++){var Rn=tr({geometry:O.geometries[Ht],type:"Feature",properties:f.properties},b);Rn&&G.push(Rn)}return new _r(G);case"FeatureCollection":for(Ht=0,rn=O.features.length;Ht<rn;Ht++){var Gn=tr(O.features[Ht],b);Gn&&G.push(Gn)}return new _r(G);default:throw new Error("Invalid GeoJSON object.")}}function ii(f,b,O,Z){return f?f(b,O):new zi(O,Z&&Z.markersInheritOptions&&Z)}function Zi(f){return new ee(f[1],f[0],f[2])}function Ia(f,b,O){for(var Z=[],G=0,oe=f.length,Re;G<oe;G++)Re=b?Ia(f[G],b-1,O):(O||Zi)(f[G]),Z.push(Re);return Z}function T9(f,b){return f=ie(f),f.alt!==void 0?[C(f.lng,b),C(f.lat,b),C(f.alt,b)]:[C(f.lng,b),C(f.lat,b)]}function $i(f,b,O,Z){for(var G=[],oe=0,Re=f.length;oe<Re;oe++)G.push(b?$i(f[oe],fr(f[oe])?0:b-1,O,Z):T9(f[oe],Z));return!b&&O&&G.length>0&&G.push(G[0].slice()),G}function ai(f,b){return f.feature?o({},f.feature,{geometry:b}):jr(b)}function jr(f){return f.type==="Feature"||f.type==="FeatureCollection"?f:{type:"Feature",properties:{},geometry:f}}var Ve={toGeoJSON:function(f){return ai(this,{type:"Point",coordinates:T9(this.getLatLng(),f)})}};zi.include(Ve),Sr.include(Ve),oi.include(Ve),c0.include({toGeoJSON:function(f){var b=!fr(this._latlngs),O=$i(this._latlngs,b?1:0,!1,f);return ai(this,{type:(b?"Multi":"")+"LineString",coordinates:O})}}),Co.include({toGeoJSON:function(f){var b=!fr(this._latlngs),O=b&&!fr(this._latlngs[0]),Z=$i(this._latlngs,O?2:b?1:0,!0,f);return b||(Z=[Z]),ai(this,{type:(O?"Multi":"")+"Polygon",coordinates:Z})}}),Fr.include({toMultiPoint:function(f){var b=[];return this.eachLayer(function(O){b.push(O.toGeoJSON(f).geometry.coordinates)}),ai(this,{type:"MultiPoint",coordinates:b})},toGeoJSON:function(f){var b=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(b==="MultiPoint")return this.toMultiPoint(f);var O=b==="GeometryCollection",Z=[];return this.eachLayer(function(G){if(G.toGeoJSON){var oe=G.toGeoJSON(f);if(O)Z.push(oe.geometry);else{var Re=jr(oe);Re.type==="FeatureCollection"?Z.push.apply(Z,Re.features):Z.push(Re)}}}),O?ai(this,{geometries:Z,type:"GeometryCollection"}):{type:"FeatureCollection",features:Z}}});function ft(f,b){return new U0(f,b)}var lt=ft,ln=n1.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(f,b,O){this._url=f,this._bounds=J(b),v(this,O)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(hn(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){bn(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(f){return this.options.opacity=f,this._image&&this._updateOpacity(),this},setStyle:function(f){return f.opacity&&this.setOpacity(f.opacity),this},bringToFront:function(){return this._map&&S1(this._image),this},bringToBack:function(){return this._map&&Xn(this._image),this},setUrl:function(f){return this._url=f,this._image&&(this._image.src=f),this},setBounds:function(f){return this._bounds=J(f),this._map&&this._reset(),this},getEvents:function(){var f={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(f.zoomanim=this._animateZoom),f},setZIndex:function(f){return this.options.zIndex=f,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var f=this._url.tagName==="IMG",b=this._image=f?this._url:Ut("img");if(hn(b,"leaflet-image-layer"),this._zoomAnimated&&hn(b,"leaflet-zoom-animated"),this.options.className&&hn(b,this.options.className),b.onselectstart=h,b.onmousemove=h,b.onload=a(this.fire,this,"load"),b.onerror=a(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(b.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),f){this._url=b.src;return}b.src=this._url,b.alt=this.options.alt},_animateZoom:function(f){var b=this._map.getZoomScale(f.zoom),O=this._map._latLngBoundsToNewLayerBounds(this._bounds,f.zoom,f.center).min;rt(this._image,O,b)},_reset:function(){var f=this._image,b=new $(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),O=b.getSize();An(f,b.min),f.style.width=O.x+"px",f.style.height=O.y+"px"},_updateOpacity:function(){At(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var f=this.options.errorOverlayUrl;f&&this._url!==f&&(this._url=f,this._image.src=f)},getCenter:function(){return this._bounds.getCenter()}}),$n=function(f,b,O){return new ln(f,b,O)},p1=ln.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var f=this._url.tagName==="VIDEO",b=this._image=f?this._url:Ut("video");if(hn(b,"leaflet-image-layer"),this._zoomAnimated&&hn(b,"leaflet-zoom-animated"),this.options.className&&hn(b,this.options.className),b.onselectstart=h,b.onmousemove=h,b.onloadeddata=a(this.fire,this,"load"),f){for(var O=b.getElementsByTagName("source"),Z=[],G=0;G<O.length;G++)Z.push(O[G].src);this._url=O.length>0?Z:[b.src];return}E(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(b.style,"objectFit")&&(b.style.objectFit="fill"),b.autoplay=!!this.options.autoplay,b.loop=!!this.options.loop,b.muted=!!this.options.muted,b.playsInline=!!this.options.playsInline;for(var oe=0;oe<this._url.length;oe++){var Re=Ut("source");Re.src=this._url[oe],b.appendChild(Re)}}});function r0(f,b,O){return new p1(f,b,O)}var R1=ln.extend({_initImage:function(){var f=this._image=this._url;hn(f,"leaflet-image-layer"),this._zoomAnimated&&hn(f,"leaflet-zoom-animated"),this.options.className&&hn(f,this.options.className),f.onselectstart=h,f.onmousemove=h}});function go(f,b,O){return new R1(f,b,O)}var nr=n1.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(f,b){f&&(f instanceof ee||E(f))?(this._latlng=ie(f),v(this,b)):(v(this,f),this._source=b),this.options.content&&(this._content=this.options.content)},openOn:function(f){return f=arguments.length?f:this._source._map,f.hasLayer(this)||f.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(f){return this._map?this.close():(arguments.length?this._source=f:f=this._source,this._prepareOpen(),this.openOn(f._map)),this},onAdd:function(f){this._zoomAnimated=f._zoomAnimated,this._container||this._initLayout(),f._fadeAnimated&&At(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),f._fadeAnimated&&At(this._container,1),this.bringToFront(),this.options.interactive&&(hn(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(f){f._fadeAnimated?(At(this._container,0),this._removeTimeout=setTimeout(a(bn,void 0,this._container),200)):bn(this._container),this.options.interactive&&(Bn(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(f){return this._latlng=ie(f),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(f){return this._content=f,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var f={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(f.zoomanim=this._animateZoom),f},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&S1(this._container),this},bringToBack:function(){return this._map&&Xn(this._container),this},_prepareOpen:function(f){var b=this._source;if(!b._map)return!1;if(b instanceof _r){b=null;var O=this._source._layers;for(var Z in O)if(O[Z]._map){b=O[Z];break}if(!b)return!1;this._source=b}if(!f)if(b.getCenter)f=b.getCenter();else if(b.getLatLng)f=b.getLatLng();else if(b.getBounds)f=b.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(f),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var f=this._contentNode,b=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof b=="string")f.innerHTML=b;else{for(;f.hasChildNodes();)f.removeChild(f.firstChild);f.appendChild(b)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var f=this._map.latLngToLayerPoint(this._latlng),b=K(this.options.offset),O=this._getAnchor();this._zoomAnimated?An(this._container,f.add(O)):b=b.add(f).add(O);var Z=this._containerBottom=-b.y,G=this._containerLeft=-Math.round(this._containerWidth/2)+b.x;this._container.style.bottom=Z+"px",this._container.style.left=G+"px"}},_getAnchor:function(){return[0,0]}});m1.include({_initOverlay:function(f,b,O,Z){var G=b;return G instanceof f||(G=new f(Z).setContent(b)),O&&G.setLatLng(O),G}}),n1.include({_initOverlay:function(f,b,O,Z){var G=O;return G instanceof f?(v(G,Z),G._source=this):(G=b&&!Z?b:new f(Z,this),G.setContent(O)),G}});var E0=nr.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(f){return f=arguments.length?f:this._source._map,!f.hasLayer(this)&&f._popup&&f._popup.options.autoClose&&f.removeLayer(f._popup),f._popup=this,nr.prototype.openOn.call(this,f)},onAdd:function(f){nr.prototype.onAdd.call(this,f),f.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof K2||this._source.on("preclick",M1))},onRemove:function(f){nr.prototype.onRemove.call(this,f),f.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof K2||this._source.off("preclick",M1))},getEvents:function(){var f=nr.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(f.preclick=this.close),this.options.keepInView&&(f.moveend=this._adjustPan),f},_initLayout:function(){var f="leaflet-popup",b=this._container=Ut("div",f+" "+(this.options.className||"")+" leaflet-zoom-animated"),O=this._wrapper=Ut("div",f+"-content-wrapper",b);if(this._contentNode=Ut("div",f+"-content",O),Tr(b),Z2(this._contentNode),Nn(b,"contextmenu",M1),this._tipContainer=Ut("div",f+"-tip-container",b),this._tip=Ut("div",f+"-tip",this._tipContainer),this.options.closeButton){var Z=this._closeButton=Ut("a",f+"-close-button",b);Z.setAttribute("role","button"),Z.setAttribute("aria-label","Close popup"),Z.href="#close",Z.innerHTML='<span aria-hidden="true">×</span>',Nn(Z,"click",function(G){jn(G),this.close()},this)}},_updateLayout:function(){var f=this._contentNode,b=f.style;b.width="",b.whiteSpace="nowrap";var O=f.offsetWidth;O=Math.min(O,this.options.maxWidth),O=Math.max(O,this.options.minWidth),b.width=O+1+"px",b.whiteSpace="",b.height="";var Z=f.offsetHeight,G=this.options.maxHeight,oe="leaflet-popup-scrolled";G&&Z>G?(b.height=G+"px",hn(f,oe)):Bn(f,oe),this._containerWidth=this._container.offsetWidth},_animateZoom:function(f){var b=this._map._latLngToNewLayerPoint(this._latlng,f.zoom,f.center),O=this._getAnchor();An(this._container,b.add(O))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var f=this._map,b=parseInt(Tn(this._container,"marginBottom"),10)||0,O=this._container.offsetHeight+b,Z=this._containerWidth,G=new Q(this._containerLeft,-O-this._containerBottom);G._add(_n(this._container));var oe=f.layerPointToContainerPoint(G),Re=K(this.options.autoPanPadding),qe=K(this.options.autoPanPaddingTopLeft||Re),at=K(this.options.autoPanPaddingBottomRight||Re),Ht=f.getSize(),rn=0,Rn=0;oe.x+Z+at.x>Ht.x&&(rn=oe.x+Z-Ht.x+at.x),oe.x-rn-qe.x<0&&(rn=oe.x-qe.x),oe.y+O+at.y>Ht.y&&(Rn=oe.y+O-Ht.y+at.y),oe.y-Rn-qe.y<0&&(Rn=oe.y-qe.y),(rn||Rn)&&(this.options.keepInView&&(this._autopanning=!0),f.fire("autopanstart").panBy([rn,Rn]))}},_getAnchor:function(){return K(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),mo=function(f,b){return new E0(f,b)};m1.mergeOptions({closePopupOnClick:!0}),m1.include({openPopup:function(f,b,O){return this._initOverlay(E0,f,b,O).openOn(this),this},closePopup:function(f){return f=arguments.length?f:this._popup,f&&f.close(),this}}),n1.include({bindPopup:function(f,b){return this._popup=this._initOverlay(E0,this._popup,f,b),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(f){return this._popup&&(this instanceof _r||(this._popup._source=this),this._popup._prepareOpen(f||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(f){return this._popup&&this._popup.setContent(f),this},getPopup:function(){return this._popup},_openPopup:function(f){if(!(!this._popup||!this._map)){t1(f);var b=f.layer||f.target;if(this._popup._source===b&&!(b instanceof K2)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(f.latlng);return}this._popup._source=b,this.openPopup(f.latlng)}},_movePopup:function(f){this._popup.setLatLng(f.latlng)},_onKeyPress:function(f){f.originalEvent.keyCode===13&&this._openPopup(f)}});var po=nr.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(f){nr.prototype.onAdd.call(this,f),this.setOpacity(this.options.opacity),f.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(f){nr.prototype.onRemove.call(this,f),f.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var f=nr.prototype.getEvents.call(this);return this.options.permanent||(f.preclick=this.close),f},_initLayout:function(){var f="leaflet-tooltip",b=f+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Ut("div",b),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+l(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(f){var b,O,Z=this._map,G=this._container,oe=Z.latLngToContainerPoint(Z.getCenter()),Re=Z.layerPointToContainerPoint(f),qe=this.options.direction,at=G.offsetWidth,Ht=G.offsetHeight,rn=K(this.options.offset),Rn=this._getAnchor();qe==="top"?(b=at/2,O=Ht):qe==="bottom"?(b=at/2,O=0):qe==="center"?(b=at/2,O=Ht/2):qe==="right"?(b=0,O=Ht/2):qe==="left"?(b=at,O=Ht/2):Re.x<oe.x?(qe="right",b=0,O=Ht/2):(qe="left",b=at+(rn.x+Rn.x)*2,O=Ht/2),f=f.subtract(K(b,O,!0)).add(rn).add(Rn),Bn(G,"leaflet-tooltip-right"),Bn(G,"leaflet-tooltip-left"),Bn(G,"leaflet-tooltip-top"),Bn(G,"leaflet-tooltip-bottom"),hn(G,"leaflet-tooltip-"+qe),An(G,f)},_updatePosition:function(){var f=this._map.latLngToLayerPoint(this._latlng);this._setPosition(f)},setOpacity:function(f){this.options.opacity=f,this._container&&At(this._container,f)},_animateZoom:function(f){var b=this._map._latLngToNewLayerPoint(this._latlng,f.zoom,f.center);this._setPosition(b)},_getAnchor:function(){return K(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),v2=function(f,b){return new po(f,b)};m1.include({openTooltip:function(f,b,O){return this._initOverlay(po,f,b,O).openOn(this),this},closeTooltip:function(f){return f.close(),this}}),n1.include({bindTooltip:function(f,b){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(po,this._tooltip,f,b),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(f){if(!(!f&&this._tooltipHandlersAdded)){var b=f?"off":"on",O={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?O.add=this._openTooltip:(O.mouseover=this._openTooltip,O.mouseout=this.closeTooltip,O.click=this._openTooltip,this._map?this._addFocusListeners():O.add=this._addFocusListeners),this._tooltip.options.sticky&&(O.mousemove=this._moveTooltip),this[b](O),this._tooltipHandlersAdded=!f}},openTooltip:function(f){return this._tooltip&&(this instanceof _r||(this._tooltip._source=this),this._tooltip._prepareOpen(f)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(f){return this._tooltip&&this._tooltip.setContent(f),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(f){var b=typeof f.getElement=="function"&&f.getElement();b&&(Nn(b,"focus",function(){this._tooltip._source=f,this.openTooltip()},this),Nn(b,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(f){var b=typeof f.getElement=="function"&&f.getElement();b&&b.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(f){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var b=this;this._map.once("moveend",function(){b._openOnceFlag=!1,b._openTooltip(f)});return}this._tooltip._source=f.layer||f.target,this.openTooltip(this._tooltip.options.sticky?f.latlng:void 0)}},_moveTooltip:function(f){var b=f.latlng,O,Z;this._tooltip.options.sticky&&f.originalEvent&&(O=this._map.mouseEventToContainerPoint(f.originalEvent),Z=this._map.containerPointToLayerPoint(O),b=this._map.layerPointToLatLng(Z)),this._tooltip.setLatLng(b)}});var G2=A2.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(f){var b=f&&f.tagName==="DIV"?f:document.createElement("div"),O=this.options;if(O.html instanceof Element?(Qn(b),b.appendChild(O.html)):b.innerHTML=O.html!==!1?O.html:"",O.bgPos){var Z=K(O.bgPos);b.style.backgroundPosition=-Z.x+"px "+-Z.y+"px"}return this._setIconStyles(b,"icon"),b},createShadow:function(){return null}});function Ao(f){return new G2(f)}A2.Default=ri;var f1=n1.extend({options:{tileSize:256,opacity:1,updateWhenIdle:ot.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(f){v(this,f)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(f){f._addZoomLimit(this)},onRemove:function(f){this._removeAllTiles(),bn(this._container),f._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(S1(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Xn(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(f){return this.options.opacity=f,this._updateOpacity(),this},setZIndex:function(f){return this.options.zIndex=f,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var f=this._clampZoom(this._map.getZoom());f!==this._tileZoom&&(this._tileZoom=f,this._updateLevels()),this._update()}return this},getEvents:function(){var f={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=u(this._onMoveEnd,this.options.updateInterval,this)),f.move=this._onMove),this._zoomAnimated&&(f.zoomanim=this._animateZoom),f},createTile:function(){return document.createElement("div")},getTileSize:function(){var f=this.options.tileSize;return f instanceof Q?f:new Q(f,f)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(f){for(var b=this.getPane().children,O=-f(-1/0,1/0),Z=0,G=b.length,oe;Z<G;Z++)oe=b[Z].style.zIndex,b[Z]!==this._container&&oe&&(O=f(O,+oe));isFinite(O)&&(this.options.zIndex=O+f(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!ot.ielt9){At(this._container,this.options.opacity);var f=+new Date,b=!1,O=!1;for(var Z in this._tiles){var G=this._tiles[Z];if(!(!G.current||!G.loaded)){var oe=Math.min(1,(f-G.loaded)/200);At(G.el,oe),oe<1?b=!0:(G.active?O=!0:this._onOpaqueTile(G),G.active=!0)}}O&&!this._noPrune&&this._pruneTiles(),b&&(T(this._fadeFrame),this._fadeFrame=P(this._updateOpacity,this))}},_onOpaqueTile:h,_initContainer:function(){this._container||(this._container=Ut("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var f=this._tileZoom,b=this.options.maxZoom;if(f!==void 0){for(var O in this._levels)O=Number(O),this._levels[O].el.children.length||O===f?(this._levels[O].el.style.zIndex=b-Math.abs(f-O),this._onUpdateLevel(O)):(bn(this._levels[O].el),this._removeTilesAtZoom(O),this._onRemoveLevel(O),delete this._levels[O]);var Z=this._levels[f],G=this._map;return Z||(Z=this._levels[f]={},Z.el=Ut("div","leaflet-tile-container leaflet-zoom-animated",this._container),Z.el.style.zIndex=b,Z.origin=G.project(G.unproject(G.getPixelOrigin()),f).round(),Z.zoom=f,this._setZoomTransform(Z,G.getCenter(),G.getZoom()),h(Z.el.offsetWidth),this._onCreateLevel(Z)),this._level=Z,Z}},_onUpdateLevel:h,_onRemoveLevel:h,_onCreateLevel:h,_pruneTiles:function(){if(this._map){var f,b,O=this._map.getZoom();if(O>this.options.maxZoom||O<this.options.minZoom){this._removeAllTiles();return}for(f in this._tiles)b=this._tiles[f],b.retain=b.current;for(f in this._tiles)if(b=this._tiles[f],b.current&&!b.active){var Z=b.coords;this._retainParent(Z.x,Z.y,Z.z,Z.z-5)||this._retainChildren(Z.x,Z.y,Z.z,Z.z+2)}for(f in this._tiles)this._tiles[f].retain||this._removeTile(f)}},_removeTilesAtZoom:function(f){for(var b in this._tiles)this._tiles[b].coords.z===f&&this._removeTile(b)},_removeAllTiles:function(){for(var f in this._tiles)this._removeTile(f)},_invalidateAll:function(){for(var f in this._levels)bn(this._levels[f].el),this._onRemoveLevel(Number(f)),delete this._levels[f];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(f,b,O,Z){var G=Math.floor(f/2),oe=Math.floor(b/2),Re=O-1,qe=new Q(+G,+oe);qe.z=+Re;var at=this._tileCoordsToKey(qe),Ht=this._tiles[at];return Ht&&Ht.active?(Ht.retain=!0,!0):(Ht&&Ht.loaded&&(Ht.retain=!0),Re>Z?this._retainParent(G,oe,Re,Z):!1)},_retainChildren:function(f,b,O,Z){for(var G=2*f;G<2*f+2;G++)for(var oe=2*b;oe<2*b+2;oe++){var Re=new Q(G,oe);Re.z=O+1;var qe=this._tileCoordsToKey(Re),at=this._tiles[qe];if(at&&at.active){at.retain=!0;continue}else at&&at.loaded&&(at.retain=!0);O+1<Z&&this._retainChildren(G,oe,O+1,Z)}},_resetView:function(f){var b=f&&(f.pinch||f.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),b,b)},_animateZoom:function(f){this._setView(f.center,f.zoom,!0,f.noUpdate)},_clampZoom:function(f){var b=this.options;return b.minNativeZoom!==void 0&&f<b.minNativeZoom?b.minNativeZoom:b.maxNativeZoom!==void 0&&b.maxNativeZoom<f?b.maxNativeZoom:f},_setView:function(f,b,O,Z){var G=Math.round(b);this.options.maxZoom!==void 0&&G>this.options.maxZoom||this.options.minZoom!==void 0&&G<this.options.minZoom?G=void 0:G=this._clampZoom(G);var oe=this.options.updateWhenZooming&&G!==this._tileZoom;(!Z||oe)&&(this._tileZoom=G,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),G!==void 0&&this._update(f),O||this._pruneTiles(),this._noPrune=!!O),this._setZoomTransforms(f,b)},_setZoomTransforms:function(f,b){for(var O in this._levels)this._setZoomTransform(this._levels[O],f,b)},_setZoomTransform:function(f,b,O){var Z=this._map.getZoomScale(O,f.zoom),G=f.origin.multiplyBy(Z).subtract(this._map._getNewPixelOrigin(b,O)).round();ot.any3d?rt(f.el,G,Z):An(f.el,G)},_resetGrid:function(){var f=this._map,b=f.options.crs,O=this._tileSize=this.getTileSize(),Z=this._tileZoom,G=this._map.getPixelWorldBounds(this._tileZoom);G&&(this._globalTileRange=this._pxBoundsToTileRange(G)),this._wrapX=b.wrapLng&&!this.options.noWrap&&[Math.floor(f.project([0,b.wrapLng[0]],Z).x/O.x),Math.ceil(f.project([0,b.wrapLng[1]],Z).x/O.y)],this._wrapY=b.wrapLat&&!this.options.noWrap&&[Math.floor(f.project([b.wrapLat[0],0],Z).y/O.x),Math.ceil(f.project([b.wrapLat[1],0],Z).y/O.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(f){var b=this._map,O=b._animatingZoom?Math.max(b._animateToZoom,b.getZoom()):b.getZoom(),Z=b.getZoomScale(O,this._tileZoom),G=b.project(f,this._tileZoom).floor(),oe=b.getSize().divideBy(Z*2);return new $(G.subtract(oe),G.add(oe))},_update:function(f){var b=this._map;if(b){var O=this._clampZoom(b.getZoom());if(f===void 0&&(f=b.getCenter()),this._tileZoom!==void 0){var Z=this._getTiledPixelBounds(f),G=this._pxBoundsToTileRange(Z),oe=G.getCenter(),Re=[],qe=this.options.keepBuffer,at=new $(G.getBottomLeft().subtract([qe,-qe]),G.getTopRight().add([qe,-qe]));if(!(isFinite(G.min.x)&&isFinite(G.min.y)&&isFinite(G.max.x)&&isFinite(G.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var Ht in this._tiles){var rn=this._tiles[Ht].coords;(rn.z!==this._tileZoom||!at.contains(new Q(rn.x,rn.y)))&&(this._tiles[Ht].current=!1)}if(Math.abs(O-this._tileZoom)>1){this._setView(f,O);return}for(var Rn=G.min.y;Rn<=G.max.y;Rn++)for(var Gn=G.min.x;Gn<=G.max.x;Gn++){var h0=new Q(Gn,Rn);if(h0.z=this._tileZoom,!!this._isValidTile(h0)){var be=this._tiles[this._tileCoordsToKey(h0)];be?be.current=!0:Re.push(h0)}}if(Re.sort(function(Me,Fe){return Me.distanceTo(oe)-Fe.distanceTo(oe)}),Re.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var ge=document.createDocumentFragment();for(Gn=0;Gn<Re.length;Gn++)this._addTile(Re[Gn],ge);this._level.el.appendChild(ge)}}}},_isValidTile:function(f){var b=this._map.options.crs;if(!b.infinite){var O=this._globalTileRange;if(!b.wrapLng&&(f.x<O.min.x||f.x>O.max.x)||!b.wrapLat&&(f.y<O.min.y||f.y>O.max.y))return!1}if(!this.options.bounds)return!0;var Z=this._tileCoordsToBounds(f);return J(this.options.bounds).overlaps(Z)},_keyToBounds:function(f){return this._tileCoordsToBounds(this._keyToTileCoords(f))},_tileCoordsToNwSe:function(f){var b=this._map,O=this.getTileSize(),Z=f.scaleBy(O),G=Z.add(O),oe=b.unproject(Z,f.z),Re=b.unproject(G,f.z);return[oe,Re]},_tileCoordsToBounds:function(f){var b=this._tileCoordsToNwSe(f),O=new X(b[0],b[1]);return this.options.noWrap||(O=this._map.wrapLatLngBounds(O)),O},_tileCoordsToKey:function(f){return f.x+":"+f.y+":"+f.z},_keyToTileCoords:function(f){var b=f.split(":"),O=new Q(+b[0],+b[1]);return O.z=+b[2],O},_removeTile:function(f){var b=this._tiles[f];b&&(bn(b.el),delete this._tiles[f],this.fire("tileunload",{tile:b.el,coords:this._keyToTileCoords(f)}))},_initTile:function(f){hn(f,"leaflet-tile");var b=this.getTileSize();f.style.width=b.x+"px",f.style.height=b.y+"px",f.onselectstart=h,f.onmousemove=h,ot.ielt9&&this.options.opacity<1&&At(f,this.options.opacity)},_addTile:function(f,b){var O=this._getTilePos(f),Z=this._tileCoordsToKey(f),G=this.createTile(this._wrapCoords(f),a(this._tileReady,this,f));this._initTile(G),this.createTile.length<2&&P(a(this._tileReady,this,f,null,G)),An(G,O),this._tiles[Z]={el:G,coords:f,current:!0},b.appendChild(G),this.fire("tileloadstart",{tile:G,coords:f})},_tileReady:function(f,b,O){b&&this.fire("tileerror",{error:b,tile:O,coords:f});var Z=this._tileCoordsToKey(f);O=this._tiles[Z],O&&(O.loaded=+new Date,this._map._fadeAnimated?(At(O.el,0),T(this._fadeFrame),this._fadeFrame=P(this._updateOpacity,this)):(O.active=!0,this._pruneTiles()),b||(hn(O.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:O.el,coords:f})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),ot.ielt9||!this._map._fadeAnimated?P(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(f){return f.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(f){var b=new Q(this._wrapX?d(f.x,this._wrapX):f.x,this._wrapY?d(f.y,this._wrapY):f.y);return b.z=f.z,b},_pxBoundsToTileRange:function(f){var b=this.getTileSize();return new $(f.min.unscaleBy(b).floor(),f.max.unscaleBy(b).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var f in this._tiles)if(!this._tiles[f].loaded)return!1;return!0}});function x5(f){return new f1(f)}var vo=f1.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(f,b){this._url=f,b=v(this,b),b.detectRetina&&ot.retina&&b.maxZoom>0?(b.tileSize=Math.floor(b.tileSize/2),b.zoomReverse?(b.zoomOffset--,b.minZoom=Math.min(b.maxZoom,b.minZoom+1)):(b.zoomOffset++,b.maxZoom=Math.max(b.minZoom,b.maxZoom-1)),b.minZoom=Math.max(0,b.minZoom)):b.zoomReverse?b.minZoom=Math.min(b.maxZoom,b.minZoom):b.maxZoom=Math.max(b.minZoom,b.maxZoom),typeof b.subdomains=="string"&&(b.subdomains=b.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(f,b){return this._url===f&&b===void 0&&(b=!0),this._url=f,b||this.redraw(),this},createTile:function(f,b){var O=document.createElement("img");return Nn(O,"load",a(this._tileOnLoad,this,b,O)),Nn(O,"error",a(this._tileOnError,this,b,O)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(O.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(O.referrerPolicy=this.options.referrerPolicy),O.alt="",O.src=this.getTileUrl(f),O},getTileUrl:function(f){var b={r:ot.retina?"@2x":"",s:this._getSubdomain(f),x:f.x,y:f.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var O=this._globalTileRange.max.y-f.y;this.options.tms&&(b.y=O),b["-y"]=O}return x(this._url,o(b,this.options))},_tileOnLoad:function(f,b){ot.ielt9?setTimeout(a(f,this,null,b),0):f(null,b)},_tileOnError:function(f,b,O){var Z=this.options.errorTileUrl;Z&&b.getAttribute("src")!==Z&&(b.src=Z),f(O,b)},_onTileRemove:function(f){f.tile.onload=null},_getZoomForUrl:function(){var f=this._tileZoom,b=this.options.maxZoom,O=this.options.zoomReverse,Z=this.options.zoomOffset;return O&&(f=b-f),f+Z},_getSubdomain:function(f){var b=Math.abs(f.x+f.y)%this.options.subdomains.length;return this.options.subdomains[b]},_abortLoading:function(){var f,b;for(f in this._tiles)if(this._tiles[f].coords.z!==this._tileZoom&&(b=this._tiles[f].el,b.onload=h,b.onerror=h,!b.complete)){b.src=_;var O=this._tiles[f].coords;bn(b),delete this._tiles[f],this.fire("tileabort",{tile:b,coords:O})}},_removeTile:function(f){var b=this._tiles[f];if(b)return b.el.setAttribute("src",_),f1.prototype._removeTile.call(this,f)},_tileReady:function(f,b,O){if(!(!this._map||O&&O.getAttribute("src")===_))return f1.prototype._tileReady.call(this,f,b,O)}});function Ui(f,b){return new vo(f,b)}var Pa=vo.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(f,b){this._url=f;var O=o({},this.defaultWmsParams);for(var Z in b)Z in this.options||(O[Z]=b[Z]);b=v(this,b);var G=b.detectRetina&&ot.retina?2:1,oe=this.getTileSize();O.width=oe.x*G,O.height=oe.y*G,this.wmsParams=O},onAdd:function(f){this._crs=this.options.crs||f.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var b=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[b]=this._crs.code,vo.prototype.onAdd.call(this,f)},getTileUrl:function(f){var b=this._tileCoordsToNwSe(f),O=this._crs,Z=Y(O.project(b[0]),O.project(b[1])),G=Z.min,oe=Z.max,Re=(this._wmsVersion>=1.3&&this._crs===V3?[G.y,G.x,oe.y,oe.x]:[G.x,G.y,oe.x,oe.y]).join(","),qe=vo.prototype.getTileUrl.call(this,f);return qe+p(this.wmsParams,qe,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+Re},setParams:function(f,b){return o(this.wmsParams,f),b||this.redraw(),this}});function Ta(f,b){return new Pa(f,b)}vo.WMS=Pa,Ui.wms=Ta;var b2=n1.extend({options:{padding:.1},initialize:function(f){v(this,f),l(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),hn(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var f={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(f.zoomanim=this._onAnimZoom),f},_onAnimZoom:function(f){this._updateTransform(f.center,f.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(f,b){var O=this._map.getZoomScale(b,this._zoom),Z=this._map.getSize().multiplyBy(.5+this.options.padding),G=this._map.project(this._center,b),oe=Z.multiplyBy(-O).add(G).subtract(this._map._getNewPixelOrigin(f,b));ot.any3d?rt(this._container,oe,O):An(this._container,oe)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var f in this._layers)this._layers[f]._reset()},_onZoomEnd:function(){for(var f in this._layers)this._layers[f]._project()},_updatePaths:function(){for(var f in this._layers)this._layers[f]._update()},_update:function(){var f=this.options.padding,b=this._map.getSize(),O=this._map.containerPointToLayerPoint(b.multiplyBy(-f)).round();this._bounds=new $(O,O.add(b.multiplyBy(1+f*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Wi=b2.extend({options:{tolerance:0},getEvents:function(){var f=b2.prototype.getEvents.call(this);return f.viewprereset=this._onViewPreReset,f},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){b2.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var f=this._container=document.createElement("canvas");Nn(f,"mousemove",this._onMouseMove,this),Nn(f,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Nn(f,"mouseout",this._handleMouseOut,this),f._leaflet_disable_events=!0,this._ctx=f.getContext("2d")},_destroyContainer:function(){T(this._redrawRequest),delete this._ctx,bn(this._container),pn(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var f;this._redrawBounds=null;for(var b in this._layers)f=this._layers[b],f._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){b2.prototype._update.call(this);var f=this._bounds,b=this._container,O=f.getSize(),Z=ot.retina?2:1;An(b,f.min),b.width=Z*O.x,b.height=Z*O.y,b.style.width=O.x+"px",b.style.height=O.y+"px",ot.retina&&this._ctx.scale(2,2),this._ctx.translate(-f.min.x,-f.min.y),this.fire("update")}},_reset:function(){b2.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(f){this._updateDashArray(f),this._layers[l(f)]=f;var b=f._order={layer:f,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=b),this._drawLast=b,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(f){this._requestRedraw(f)},_removePath:function(f){var b=f._order,O=b.next,Z=b.prev;O?O.prev=Z:this._drawLast=Z,Z?Z.next=O:this._drawFirst=O,delete f._order,delete this._layers[l(f)],this._requestRedraw(f)},_updatePath:function(f){this._extendRedrawBounds(f),f._project(),f._update(),this._requestRedraw(f)},_updateStyle:function(f){this._updateDashArray(f),this._requestRedraw(f)},_updateDashArray:function(f){if(typeof f.options.dashArray=="string"){var b=f.options.dashArray.split(/[, ]+/),O=[],Z,G;for(G=0;G<b.length;G++){if(Z=Number(b[G]),isNaN(Z))return;O.push(Z)}f.options._dashArray=O}else f.options._dashArray=f.options.dashArray},_requestRedraw:function(f){this._map&&(this._extendRedrawBounds(f),this._redrawRequest=this._redrawRequest||P(this._redraw,this))},_extendRedrawBounds:function(f){if(f._pxBounds){var b=(f.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new $,this._redrawBounds.extend(f._pxBounds.min.subtract([b,b])),this._redrawBounds.extend(f._pxBounds.max.add([b,b]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var f=this._redrawBounds;if(f){var b=f.getSize();this._ctx.clearRect(f.min.x,f.min.y,b.x,b.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var f,b=this._redrawBounds;if(this._ctx.save(),b){var O=b.getSize();this._ctx.beginPath(),this._ctx.rect(b.min.x,b.min.y,O.x,O.y),this._ctx.clip()}this._drawing=!0;for(var Z=this._drawFirst;Z;Z=Z.next)f=Z.layer,(!b||f._pxBounds&&f._pxBounds.intersects(b))&&f._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(f,b){if(this._drawing){var O,Z,G,oe,Re=f._parts,qe=Re.length,at=this._ctx;if(qe){for(at.beginPath(),O=0;O<qe;O++){for(Z=0,G=Re[O].length;Z<G;Z++)oe=Re[O][Z],at[Z?"lineTo":"moveTo"](oe.x,oe.y);b&&at.closePath()}this._fillStroke(at,f)}}},_updateCircle:function(f){if(!(!this._drawing||f._empty())){var b=f._point,O=this._ctx,Z=Math.max(Math.round(f._radius),1),G=(Math.max(Math.round(f._radiusY),1)||Z)/Z;G!==1&&(O.save(),O.scale(1,G)),O.beginPath(),O.arc(b.x,b.y/G,Z,0,Math.PI*2,!1),G!==1&&O.restore(),this._fillStroke(O,f)}},_fillStroke:function(f,b){var O=b.options;O.fill&&(f.globalAlpha=O.fillOpacity,f.fillStyle=O.fillColor||O.color,f.fill(O.fillRule||"evenodd")),O.stroke&&O.weight!==0&&(f.setLineDash&&f.setLineDash(b.options&&b.options._dashArray||[]),f.globalAlpha=O.opacity,f.lineWidth=O.weight,f.strokeStyle=O.color,f.lineCap=O.lineCap,f.lineJoin=O.lineJoin,f.stroke())},_onClick:function(f){for(var b=this._map.mouseEventToLayerPoint(f),O,Z,G=this._drawFirst;G;G=G.next)O=G.layer,O.options.interactive&&O._containsPoint(b)&&(!(f.type==="click"||f.type==="preclick")||!this._map._draggableMoved(O))&&(Z=O);this._fireEvent(Z?[Z]:!1,f)},_onMouseMove:function(f){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var b=this._map.mouseEventToLayerPoint(f);this._handleMouseHover(f,b)}},_handleMouseOut:function(f){var b=this._hoveredLayer;b&&(Bn(this._container,"leaflet-interactive"),this._fireEvent([b],f,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(f,b){if(!this._mouseHoverThrottled){for(var O,Z,G=this._drawFirst;G;G=G.next)O=G.layer,O.options.interactive&&O._containsPoint(b)&&(Z=O);Z!==this._hoveredLayer&&(this._handleMouseOut(f),Z&&(hn(this._container,"leaflet-interactive"),this._fireEvent([Z],f,"mouseover"),this._hoveredLayer=Z)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,f),this._mouseHoverThrottled=!0,setTimeout(a(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(f,b,O){this._map._fireDOMEvent(b,O||b.type,f)},_bringToFront:function(f){var b=f._order;if(b){var O=b.next,Z=b.prev;if(O)O.prev=Z;else return;Z?Z.next=O:O&&(this._drawFirst=O),b.prev=this._drawLast,this._drawLast.next=b,b.next=null,this._drawLast=b,this._requestRedraw(f)}},_bringToBack:function(f){var b=f._order;if(b){var O=b.next,Z=b.prev;if(Z)Z.next=O;else return;O?O.prev=Z:Z&&(this._drawLast=Z),b.prev=null,b.next=this._drawFirst,this._drawFirst.prev=b,this._drawFirst=b,this._requestRedraw(f)}}});function Vr(f){return ot.canvas?new Wi(f):null}var n2=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(f){return document.createElement("<lvml:"+f+' class="lvml">')}}catch{}return function(f){return document.createElement("<"+f+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),U3={_initContainer:function(){this._container=Ut("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(b2.prototype._update.call(this),this.fire("update"))},_initPath:function(f){var b=f._container=n2("shape");hn(b,"leaflet-vml-shape "+(this.options.className||"")),b.coordsize="1 1",f._path=n2("path"),b.appendChild(f._path),this._updateStyle(f),this._layers[l(f)]=f},_addPath:function(f){var b=f._container;this._container.appendChild(b),f.options.interactive&&f.addInteractiveTarget(b)},_removePath:function(f){var b=f._container;bn(b),f.removeInteractiveTarget(b),delete this._layers[l(f)]},_updateStyle:function(f){var b=f._stroke,O=f._fill,Z=f.options,G=f._container;G.stroked=!!Z.stroke,G.filled=!!Z.fill,Z.stroke?(b||(b=f._stroke=n2("stroke")),G.appendChild(b),b.weight=Z.weight+"px",b.color=Z.color,b.opacity=Z.opacity,Z.dashArray?b.dashStyle=E(Z.dashArray)?Z.dashArray.join(" "):Z.dashArray.replace(/( *, *)/g," "):b.dashStyle="",b.endcap=Z.lineCap.replace("butt","flat"),b.joinstyle=Z.lineJoin):b&&(G.removeChild(b),f._stroke=null),Z.fill?(O||(O=f._fill=n2("fill")),G.appendChild(O),O.color=Z.fillColor||Z.color,O.opacity=Z.fillOpacity):O&&(G.removeChild(O),f._fill=null)},_updateCircle:function(f){var b=f._point.round(),O=Math.round(f._radius),Z=Math.round(f._radiusY||O);this._setPath(f,f._empty()?"M0 0":"AL "+b.x+","+b.y+" "+O+","+Z+" 0,"+65535*360)},_setPath:function(f,b){f._path.v=b},_bringToFront:function(f){S1(f._container)},_bringToBack:function(f){Xn(f._container)}},r2=ot.vml?n2:we,y2=b2.extend({_initContainer:function(){this._container=r2("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=r2("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){bn(this._container),pn(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){b2.prototype._update.call(this);var f=this._bounds,b=f.getSize(),O=this._container;(!this._svgSize||!this._svgSize.equals(b))&&(this._svgSize=b,O.setAttribute("width",b.x),O.setAttribute("height",b.y)),An(O,f.min),O.setAttribute("viewBox",[f.min.x,f.min.y,b.x,b.y].join(" ")),this.fire("update")}},_initPath:function(f){var b=f._path=r2("path");f.options.className&&hn(b,f.options.className),f.options.interactive&&hn(b,"leaflet-interactive"),this._updateStyle(f),this._layers[l(f)]=f},_addPath:function(f){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(f._path),f.addInteractiveTarget(f._path)},_removePath:function(f){bn(f._path),f.removeInteractiveTarget(f._path),delete this._layers[l(f)]},_updatePath:function(f){f._project(),f._update()},_updateStyle:function(f){var b=f._path,O=f.options;b&&(O.stroke?(b.setAttribute("stroke",O.color),b.setAttribute("stroke-opacity",O.opacity),b.setAttribute("stroke-width",O.weight),b.setAttribute("stroke-linecap",O.lineCap),b.setAttribute("stroke-linejoin",O.lineJoin),O.dashArray?b.setAttribute("stroke-dasharray",O.dashArray):b.removeAttribute("stroke-dasharray"),O.dashOffset?b.setAttribute("stroke-dashoffset",O.dashOffset):b.removeAttribute("stroke-dashoffset")):b.setAttribute("stroke","none"),O.fill?(b.setAttribute("fill",O.fillColor||O.color),b.setAttribute("fill-opacity",O.fillOpacity),b.setAttribute("fill-rule",O.fillRule||"evenodd")):b.setAttribute("fill","none"))},_updatePoly:function(f,b){this._setPath(f,Se(f._parts,b))},_updateCircle:function(f){var b=f._point,O=Math.max(Math.round(f._radius),1),Z=Math.max(Math.round(f._radiusY),1)||O,G="a"+O+","+Z+" 0 1,0 ",oe=f._empty()?"M0 0":"M"+(b.x-O)+","+b.y+G+O*2+",0 "+G+-O*2+",0 ";this._setPath(f,oe)},_setPath:function(f,b){f._path.setAttribute("d",b)},_bringToFront:function(f){S1(f._path)},_bringToBack:function(f){Xn(f._path)}});ot.vml&&y2.include(U3);function si(f){return ot.svg||ot.vml?new y2(f):null}m1.include({getRenderer:function(f){var b=f.options.renderer||this._getPaneRenderer(f.options.pane)||this.options.renderer||this._renderer;return b||(b=this._renderer=this._createRenderer()),this.hasLayer(b)||this.addLayer(b),b},_getPaneRenderer:function(f){if(f==="overlayPane"||f===void 0)return!1;var b=this._paneRenderers[f];return b===void 0&&(b=this._createRenderer({pane:f}),this._paneRenderers[f]=b),b},_createRenderer:function(f){return this.options.preferCanvas&&Vr(f)||si(f)}});var Y2=Co.extend({initialize:function(f,b){Co.prototype.initialize.call(this,this._boundsToLatLngs(f),b)},setBounds:function(f){return this.setLatLngs(this._boundsToLatLngs(f))},_boundsToLatLngs:function(f){return f=J(f),[f.getSouthWest(),f.getNorthWest(),f.getNorthEast(),f.getSouthEast()]}});function Na(f,b){return new Y2(f,b)}y2.create=r2,y2.pointsToPath=Se,U0.geometryToLayer=tr,U0.coordsToLatLng=Zi,U0.coordsToLatLngs=Ia,U0.latLngToCoords=T9,U0.latLngsToCoords=$i,U0.getFeature=ai,U0.asFeature=jr,m1.mergeOptions({boxZoom:!0});var X2=l0.extend({initialize:function(f){this._map=f,this._container=f._container,this._pane=f._panes.overlayPane,this._resetStateTimeout=0,f.on("unload",this._destroy,this)},addHooks:function(){Nn(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){pn(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){bn(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(f){if(!f.shiftKey||f.which!==1&&f.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),L1(),Bt(),this._startPoint=this._map.mouseEventToContainerPoint(f),Nn(document,{contextmenu:t1,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(f){this._moved||(this._moved=!0,this._box=Ut("div","leaflet-zoom-box",this._container),hn(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(f);var b=new $(this._point,this._startPoint),O=b.getSize();An(this._box,b.min),this._box.style.width=O.x+"px",this._box.style.height=O.y+"px"},_finish:function(){this._moved&&(bn(this._box),Bn(this._container,"leaflet-crosshair")),g1(),Ft(),pn(document,{contextmenu:t1,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(f){if(!(f.which!==1&&f.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0);var b=new X(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(b).fire("boxzoomend",{boxZoomBounds:b})}},_onKeyDown:function(f){f.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});m1.addInitHook("addHandler","boxZoom",X2),m1.mergeOptions({doubleClickZoom:!0});var o2=l0.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(f){var b=this._map,O=b.getZoom(),Z=b.options.zoomDelta,G=f.originalEvent.shiftKey?O-Z:O+Z;b.options.doubleClickZoom==="center"?b.setZoom(G):b.setZoomAround(f.containerPoint,G)}});m1.addInitHook("addHandler","doubleClickZoom",o2),m1.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var bo=l0.extend({addHooks:function(){if(!this._draggable){var f=this._map;this._draggable=new U2(f._mapPane,f._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),f.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),f.on("zoomend",this._onZoomEnd,this),f.whenReady(this._onZoomEnd,this))}hn(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Bn(this._map._container,"leaflet-grab"),Bn(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var f=this._map;if(f._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var b=J(this._map.options.maxBounds);this._offsetLimit=Y(this._map.latLngToContainerPoint(b.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(b.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;f.fire("movestart").fire("dragstart"),f.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(f){if(this._map.options.inertia){var b=this._lastTime=+new Date,O=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(O),this._times.push(b),this._prunePositions(b)}this._map.fire("move",f).fire("drag",f)},_prunePositions:function(f){for(;this._positions.length>1&&f-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var f=this._map.getSize().divideBy(2),b=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=b.subtract(f).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(f,b){return f-(f-b)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var f=this._draggable._newPos.subtract(this._draggable._startPos),b=this._offsetLimit;f.x<b.min.x&&(f.x=this._viscousLimit(f.x,b.min.x)),f.y<b.min.y&&(f.y=this._viscousLimit(f.y,b.min.y)),f.x>b.max.x&&(f.x=this._viscousLimit(f.x,b.max.x)),f.y>b.max.y&&(f.y=this._viscousLimit(f.y,b.max.y)),this._draggable._newPos=this._draggable._startPos.add(f)}},_onPreDragWrap:function(){var f=this._worldWidth,b=Math.round(f/2),O=this._initialWorldOffset,Z=this._draggable._newPos.x,G=(Z-b+O)%f+b-O,oe=(Z+b+O)%f-b-O,Re=Math.abs(G+O)<Math.abs(oe+O)?G:oe;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=Re},_onDragEnd:function(f){var b=this._map,O=b.options,Z=!O.inertia||f.noInertia||this._times.length<2;if(b.fire("dragend",f),Z)b.fire("moveend");else{this._prunePositions(+new Date);var G=this._lastPos.subtract(this._positions[0]),oe=(this._lastTime-this._times[0])/1e3,Re=O.easeLinearity,qe=G.multiplyBy(Re/oe),at=qe.distanceTo([0,0]),Ht=Math.min(O.inertiaMaxSpeed,at),rn=qe.multiplyBy(Ht/at),Rn=Ht/(O.inertiaDeceleration*Re),Gn=rn.multiplyBy(-Rn/2).round();!Gn.x&&!Gn.y?b.fire("moveend"):(Gn=b._limitOffset(Gn,b.options.maxBounds),P(function(){b.panBy(Gn,{duration:Rn,easeLinearity:Re,noMoveStart:!0,animate:!0})}))}}});m1.addInitHook("addHandler","dragging",bo),m1.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Ki=l0.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(f){this._map=f,this._setPanDelta(f.options.keyboardPanDelta),this._setZoomDelta(f.options.zoomDelta)},addHooks:function(){var f=this._map._container;f.tabIndex<=0&&(f.tabIndex="0"),Nn(f,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),pn(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var f=document.body,b=document.documentElement,O=f.scrollTop||b.scrollTop,Z=f.scrollLeft||b.scrollLeft;this._map._container.focus(),window.scrollTo(Z,O)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(f){var b=this._panKeys={},O=this.keyCodes,Z,G;for(Z=0,G=O.left.length;Z<G;Z++)b[O.left[Z]]=[-1*f,0];for(Z=0,G=O.right.length;Z<G;Z++)b[O.right[Z]]=[f,0];for(Z=0,G=O.down.length;Z<G;Z++)b[O.down[Z]]=[0,f];for(Z=0,G=O.up.length;Z<G;Z++)b[O.up[Z]]=[0,-1*f]},_setZoomDelta:function(f){var b=this._zoomKeys={},O=this.keyCodes,Z,G;for(Z=0,G=O.zoomIn.length;Z<G;Z++)b[O.zoomIn[Z]]=f;for(Z=0,G=O.zoomOut.length;Z<G;Z++)b[O.zoomOut[Z]]=-f},_addHooks:function(){Nn(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){pn(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(f){if(!(f.altKey||f.ctrlKey||f.metaKey)){var b=f.keyCode,O=this._map,Z;if(b in this._panKeys){if(!O._panAnim||!O._panAnim._inProgress)if(Z=this._panKeys[b],f.shiftKey&&(Z=K(Z).multiplyBy(3)),O.options.maxBounds&&(Z=O._limitOffset(K(Z),O.options.maxBounds)),O.options.worldCopyJump){var G=O.wrapLatLng(O.unproject(O.project(O.getCenter()).add(Z)));O.panTo(G)}else O.panBy(Z)}else if(b in this._zoomKeys)O.setZoom(O.getZoom()+(f.shiftKey?3:1)*this._zoomKeys[b]);else if(b===27&&O._popup&&O._popup.options.closeOnEscapeKey)O.closePopup();else return;t1(f)}}});m1.addInitHook("addHandler","keyboard",Ki),m1.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Fa=l0.extend({addHooks:function(){Nn(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){pn(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(f){var b=$2(f),O=this._map.options.wheelDebounceTime;this._delta+=b,this._lastMousePos=this._map.mouseEventToContainerPoint(f),this._startTime||(this._startTime=+new Date);var Z=Math.max(O-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),Z),t1(f)},_performZoom:function(){var f=this._map,b=f.getZoom(),O=this._map.options.zoomSnap||0;f._stop();var Z=this._delta/(this._map.options.wheelPxPerZoomLevel*4),G=4*Math.log(2/(1+Math.exp(-Math.abs(Z))))/Math.LN2,oe=O?Math.ceil(G/O)*O:G,Re=f._limitZoom(b+(this._delta>0?oe:-oe))-b;this._delta=0,this._startTime=null,Re&&(f.options.scrollWheelZoom==="center"?f.setZoom(b+Re):f.setZoomAround(this._lastMousePos,b+Re))}});m1.addInitHook("addHandler","scrollWheelZoom",Fa);var N9=600;m1.mergeOptions({tapHold:ot.touchNative&&ot.safari&&ot.mobile,tapTolerance:15});var Qi=l0.extend({addHooks:function(){Nn(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){pn(this._map._container,"touchstart",this._onDown,this)},_onDown:function(f){if(clearTimeout(this._holdTimeout),f.touches.length===1){var b=f.touches[0];this._startPos=this._newPos=new Q(b.clientX,b.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(Nn(document,"touchend",jn),Nn(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",b))},this),N9),Nn(document,"touchend touchcancel contextmenu",this._cancel,this),Nn(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function f(){pn(document,"touchend",jn),pn(document,"touchend touchcancel",f)},_cancel:function(){clearTimeout(this._holdTimeout),pn(document,"touchend touchcancel contextmenu",this._cancel,this),pn(document,"touchmove",this._onMove,this)},_onMove:function(f){var b=f.touches[0];this._newPos=new Q(b.clientX,b.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(f,b){var O=new MouseEvent(f,{bubbles:!0,cancelable:!0,view:window,screenX:b.screenX,screenY:b.screenY,clientX:b.clientX,clientY:b.clientY});O._simulated=!0,b.target.dispatchEvent(O)}});m1.addInitHook("addHandler","tapHold",Qi),m1.mergeOptions({touchZoom:ot.touch,bounceAtZoomLimits:!0});var li=l0.extend({addHooks:function(){hn(this._map._container,"leaflet-touch-zoom"),Nn(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Bn(this._map._container,"leaflet-touch-zoom"),pn(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(f){var b=this._map;if(!(!f.touches||f.touches.length!==2||b._animatingZoom||this._zooming)){var O=b.mouseEventToContainerPoint(f.touches[0]),Z=b.mouseEventToContainerPoint(f.touches[1]);this._centerPoint=b.getSize()._divideBy(2),this._startLatLng=b.containerPointToLatLng(this._centerPoint),b.options.touchZoom!=="center"&&(this._pinchStartLatLng=b.containerPointToLatLng(O.add(Z)._divideBy(2))),this._startDist=O.distanceTo(Z),this._startZoom=b.getZoom(),this._moved=!1,this._zooming=!0,b._stop(),Nn(document,"touchmove",this._onTouchMove,this),Nn(document,"touchend touchcancel",this._onTouchEnd,this),jn(f)}},_onTouchMove:function(f){if(!(!f.touches||f.touches.length!==2||!this._zooming)){var b=this._map,O=b.mouseEventToContainerPoint(f.touches[0]),Z=b.mouseEventToContainerPoint(f.touches[1]),G=O.distanceTo(Z)/this._startDist;if(this._zoom=b.getScaleZoom(G,this._startZoom),!b.options.bounceAtZoomLimits&&(this._zoom<b.getMinZoom()&&G<1||this._zoom>b.getMaxZoom()&&G>1)&&(this._zoom=b._limitZoom(this._zoom)),b.options.touchZoom==="center"){if(this._center=this._startLatLng,G===1)return}else{var oe=O._add(Z)._divideBy(2)._subtract(this._centerPoint);if(G===1&&oe.x===0&&oe.y===0)return;this._center=b.unproject(b.project(this._pinchStartLatLng,this._zoom).subtract(oe),this._zoom)}this._moved||(b._moveStart(!0,!1),this._moved=!0),T(this._animRequest);var Re=a(b._move,b,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=P(Re,this,!0),jn(f)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,T(this._animRequest),pn(document,"touchmove",this._onTouchMove,this),pn(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});m1.addInitHook("addHandler","touchZoom",li),m1.BoxZoom=X2,m1.DoubleClickZoom=o2,m1.Drag=bo,m1.Keyboard=Ki,m1.ScrollWheelZoom=Fa,m1.TapHold=Qi,m1.TouchZoom=li,n.Bounds=$,n.Browser=ot,n.CRS=he,n.Canvas=Wi,n.Circle=Sr,n.CircleMarker=oi,n.Class=F,n.Control=ur,n.DivIcon=G2,n.DivOverlay=nr,n.DomEvent=k9,n.DomUtil=br,n.Draggable=U2,n.Evented=W,n.FeatureGroup=_r,n.GeoJSON=U0,n.GridLayer=f1,n.Handler=l0,n.Icon=A2,n.ImageOverlay=ln,n.LatLng=ee,n.LatLngBounds=X,n.Layer=n1,n.LayerGroup=Fr,n.LineUtil=ti,n.Map=m1,n.Marker=zi,n.Mixin=F3,n.Path=K2,n.Point=Q,n.PolyUtil=D9,n.Polygon=Co,n.Polyline=c0,n.Popup=E0,n.PosAnimation=R9,n.Projection=Er,n.Rectangle=Y2,n.Renderer=b2,n.SVG=y2,n.SVGOverlay=R1,n.TileLayer=vo,n.Tooltip=po,n.Transformation=Ae,n.Util=N,n.VideoOverlay=p1,n.bind=a,n.bounds=Y,n.canvas=Vr,n.circle=Q2,n.circleMarker=k1,n.control=yr,n.divIcon=Ao,n.extend=o,n.featureGroup=W2,n.geoJSON=ft,n.geoJson=lt,n.gridLayer=x5,n.icon=w5,n.imageOverlay=$n,n.latLng=ie,n.latLngBounds=J,n.layerGroup=Vi,n.map=L0,n.marker=ho,n.point=K,n.polygon=$3,n.polyline=Z3,n.popup=mo,n.rectangle=Na,n.setOptions=v,n.stamp=l,n.svg=si,n.svgOverlay=go,n.tileLayer=Ui,n.tooltip=v2,n.transformation=de,n.version=r,n.videoOverlay=r0;var ja=window.L;n.noConflict=function(){return window.L=ja,this},window.L=n})}(w4,w4.exports)),w4.exports}var To=eRe();const P2=p2(To);(function(e,t,n){function r(o,i){for(;(o=o.parentElement)&&!o.classList.contains(i););return o}L.drawVersion="1.0.4",L.Draw={},L.drawLocal={draw:{toolbar:{actions:{title:"Cancel drawing",text:"Cancel"},finish:{title:"Finish drawing",text:"Finish"},undo:{title:"Delete last point drawn",text:"Delete last point"},buttons:{polyline:"Draw a polyline",polygon:"Draw a polygon",rectangle:"Draw a rectangle",circle:"Draw a circle",marker:"Draw a marker",circlemarker:"Draw a circlemarker"}},handlers:{circle:{tooltip:{start:"Click and drag to draw circle."},radius:"Radius"},circlemarker:{tooltip:{start:"Click map to place circle marker."}},marker:{tooltip:{start:"Click map to place marker."}},polygon:{tooltip:{start:"Click to start drawing shape.",cont:"Click to continue drawing shape.",end:"Click first point to close this shape."}},polyline:{error:"<strong>Error:</strong> shape edges cannot cross!",tooltip:{start:"Click to start drawing line.",cont:"Click to continue drawing line.",end:"Click last point to finish line."}},rectangle:{tooltip:{start:"Click and drag to draw rectangle."}},simpleshape:{tooltip:{end:"Release mouse to finish drawing."}}}},edit:{toolbar:{actions:{save:{title:"Save changes",text:"Save"},cancel:{title:"Cancel editing, discards all changes",text:"Cancel"},clearAll:{title:"Clear all layers",text:"Clear All"}},buttons:{edit:"Edit layers",editDisabled:"No layers to edit",remove:"Delete layers",removeDisabled:"No layers to delete"}},handlers:{edit:{tooltip:{text:"Drag handles or markers to edit features.",subtext:"Click cancel to undo changes."}},remove:{tooltip:{text:"Click on a feature to remove."}}}}},L.Draw.Event={},L.Draw.Event.CREATED="draw:created",L.Draw.Event.EDITED="draw:edited",L.Draw.Event.DELETED="draw:deleted",L.Draw.Event.DRAWSTART="draw:drawstart",L.Draw.Event.DRAWSTOP="draw:drawstop",L.Draw.Event.DRAWVERTEX="draw:drawvertex",L.Draw.Event.EDITSTART="draw:editstart",L.Draw.Event.EDITMOVE="draw:editmove",L.Draw.Event.EDITRESIZE="draw:editresize",L.Draw.Event.EDITVERTEX="draw:editvertex",L.Draw.Event.EDITSTOP="draw:editstop",L.Draw.Event.DELETESTART="draw:deletestart",L.Draw.Event.DELETESTOP="draw:deletestop",L.Draw.Event.TOOLBAROPENED="draw:toolbaropened",L.Draw.Event.TOOLBARCLOSED="draw:toolbarclosed",L.Draw.Event.MARKERCONTEXT="draw:markercontext",L.Draw=L.Draw||{},L.Draw.Feature=L.Handler.extend({initialize:function(o,i){this._map=o,this._container=o._container,this._overlayPane=o._panes.overlayPane,this._popupPane=o._panes.popupPane,i&&i.shapeOptions&&(i.shapeOptions=L.Util.extend({},this.options.shapeOptions,i.shapeOptions)),L.setOptions(this,i);var a=L.version.split(".");parseInt(a[0],10)===1&&parseInt(a[1],10)>=2?L.Draw.Feature.include(L.Evented.prototype):L.Draw.Feature.include(L.Mixin.Events)},enable:function(){this._enabled||(L.Handler.prototype.enable.call(this),this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DRAWSTART,{layerType:this.type}))},disable:function(){this._enabled&&(L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DRAWSTOP,{layerType:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var o=this._map;o&&(L.DomUtil.disableTextSelection(),o.getContainer().focus(),this._tooltip=new L.Draw.Tooltip(this._map),L.DomEvent.on(this._container,"keyup",this._cancelDrawing,this))},removeHooks:function(){this._map&&(L.DomUtil.enableTextSelection(),this._tooltip.dispose(),this._tooltip=null,L.DomEvent.off(this._container,"keyup",this._cancelDrawing,this))},setOptions:function(o){L.setOptions(this,o)},_fireCreatedEvent:function(o){this._map.fire(L.Draw.Event.CREATED,{layer:o,layerType:this.type})},_cancelDrawing:function(o){o.keyCode===27&&(this._map.fire("draw:canceled",{layerType:this.type}),this.disable())}}),L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:"polyline"},Poly:L.Polyline,options:{allowIntersection:!0,repeatMode:!1,drawError:{color:"#b00b00",timeout:2500},icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1,maxPoints:0},initialize:function(o,i){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this.options.drawError.message=L.drawLocal.draw.handlers.polyline.error,i&&i.drawError&&(i.drawError=L.Util.extend({},this.options.drawError,i.drawError)),this.type=L.Draw.Polyline.TYPE,L.Draw.Feature.prototype.initialize.call(this,o,i)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._markers=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._poly=new L.Polyline([],this.options.shapeOptions),this._tooltip.updateContent(this._getTooltipText()),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("mouseout",this._onMouseOut,this).on("mousemove",this._onMouseMove,this).on("mousedown",this._onMouseDown,this).on("mouseup",this._onMouseUp,this).addTo(this._map),this._map.on("mouseup",this._onMouseUp,this).on("mousemove",this._onMouseMove,this).on("zoomlevelschange",this._onZoomEnd,this).on("touchstart",this._onTouch,this).on("zoomend",this._onZoomEnd,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._clearHideErrorTimeout(),this._cleanUpShape(),this._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers,this._map.removeLayer(this._poly),delete this._poly,this._mouseMarker.off("mousedown",this._onMouseDown,this).off("mouseout",this._onMouseOut,this).off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._clearGuides(),this._map.off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this).off("zoomlevelschange",this._onZoomEnd,this).off("zoomend",this._onZoomEnd,this).off("touchstart",this._onTouch,this).off("click",this._onTouch,this)},deleteLastVertex:function(){if(!(this._markers.length<=1)){var o=this._markers.pop(),i=this._poly,a=i.getLatLngs(),s=a.splice(-1,1)[0];this._poly.setLatLngs(a),this._markerGroup.removeLayer(o),i.getLatLngs().length<2&&this._map.removeLayer(i),this._vertexChanged(s,!1)}},addVertex:function(o){if(this._markers.length>=2&&!this.options.allowIntersection&&this._poly.newLatLngIntersects(o))return void this._showErrorTooltip();this._errorShown&&this._hideErrorTooltip(),this._markers.push(this._createMarker(o)),this._poly.addLatLng(o),this._poly.getLatLngs().length===2&&this._map.addLayer(this._poly),this._vertexChanged(o,!0)},completeShape:function(){this._markers.length<=1||!this._shapeIsValid()||(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},_finishShape:function(){var o=this._poly._defaultShape?this._poly._defaultShape():this._poly.getLatLngs(),i=this._poly.newLatLngIntersects(o[o.length-1]);if(!this.options.allowIntersection&&i||!this._shapeIsValid())return void this._showErrorTooltip();this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_shapeIsValid:function(){return!0},_onZoomEnd:function(){this._markers!==null&&this._updateGuide()},_onMouseMove:function(o){var i=this._map.mouseEventToLayerPoint(o.originalEvent),a=this._map.layerPointToLatLng(i);this._currentLatLng=a,this._updateTooltip(a),this._updateGuide(i),this._mouseMarker.setLatLng(a),L.DomEvent.preventDefault(o.originalEvent)},_vertexChanged:function(o,i){this._map.fire(L.Draw.Event.DRAWVERTEX,{layers:this._markerGroup}),this._updateFinishHandler(),this._updateRunningMeasure(o,i),this._clearGuides(),this._updateTooltip()},_onMouseDown:function(o){if(!this._clickHandled&&!this._touchHandled&&!this._disableMarkers){this._onMouseMove(o),this._clickHandled=!0,this._disableNewMarkers();var i=o.originalEvent,a=i.clientX,s=i.clientY;this._startPoint.call(this,a,s)}},_startPoint:function(o,i){this._mouseDownOrigin=L.point(o,i)},_onMouseUp:function(o){var i=o.originalEvent,a=i.clientX,s=i.clientY;this._endPoint.call(this,a,s,o),this._clickHandled=null},_endPoint:function(o,i,a){if(this._mouseDownOrigin){var s=L.point(o,i).distanceTo(this._mouseDownOrigin),l=this._calculateFinishDistance(a.latlng);this.options.maxPoints>1&&this.options.maxPoints==this._markers.length+1?(this.addVertex(a.latlng),this._finishShape()):l<10&&L.Browser.touch?this._finishShape():Math.abs(s)<9*(e.devicePixelRatio||1)&&this.addVertex(a.latlng),this._enableNewMarkers()}this._mouseDownOrigin=null},_onTouch:function(o){var i,a,s=o.originalEvent;!s.touches||!s.touches[0]||this._clickHandled||this._touchHandled||this._disableMarkers||(i=s.touches[0].clientX,a=s.touches[0].clientY,this._disableNewMarkers(),this._touchHandled=!0,this._startPoint.call(this,i,a),this._endPoint.call(this,i,a,o),this._touchHandled=null),this._clickHandled=null},_onMouseOut:function(){this._tooltip&&this._tooltip._onMouseOut.call(this._tooltip)},_calculateFinishDistance:function(o){var i;if(this._markers.length>0){var a;if(this.type===L.Draw.Polyline.TYPE)a=this._markers[this._markers.length-1];else{if(this.type!==L.Draw.Polygon.TYPE)return 1/0;a=this._markers[0]}var s=this._map.latLngToContainerPoint(a.getLatLng()),l=new L.Marker(o,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset}),u=this._map.latLngToContainerPoint(l.getLatLng());i=s.distanceTo(u)}else i=1/0;return i},_updateFinishHandler:function(){var o=this._markers.length;o>1&&this._markers[o-1].on("click",this._finishShape,this),o>2&&this._markers[o-2].off("click",this._finishShape,this)},_createMarker:function(o){var i=new L.Marker(o,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset});return this._markerGroup.addLayer(i),i},_updateGuide:function(o){var i=this._markers?this._markers.length:0;i>0&&(o=o||this._map.latLngToLayerPoint(this._currentLatLng),this._clearGuides(),this._drawGuide(this._map.latLngToLayerPoint(this._markers[i-1].getLatLng()),o))},_updateTooltip:function(o){var i=this._getTooltipText();o&&this._tooltip.updatePosition(o),this._errorShown||this._tooltip.updateContent(i)},_drawGuide:function(o,i){var a,s,l,u=Math.floor(Math.sqrt(Math.pow(i.x-o.x,2)+Math.pow(i.y-o.y,2))),d=this.options.guidelineDistance,h=this.options.maxGuideLineLength,C=u>h?u-h:d;for(this._guidesContainer||(this._guidesContainer=L.DomUtil.create("div","leaflet-draw-guides",this._overlayPane));C<u;C+=this.options.guidelineDistance)a=C/u,s={x:Math.floor(o.x*(1-a)+a*i.x),y:Math.floor(o.y*(1-a)+a*i.y)},l=L.DomUtil.create("div","leaflet-draw-guide-dash",this._guidesContainer),l.style.backgroundColor=this._errorShown?this.options.drawError.color:this.options.shapeOptions.color,L.DomUtil.setPosition(l,s)},_updateGuideColor:function(o){if(this._guidesContainer)for(var i=0,a=this._guidesContainer.childNodes.length;i<a;i++)this._guidesContainer.childNodes[i].style.backgroundColor=o},_clearGuides:function(){if(this._guidesContainer)for(;this._guidesContainer.firstChild;)this._guidesContainer.removeChild(this._guidesContainer.firstChild)},_getTooltipText:function(){var o,i,a=this.options.showLength;return this._markers.length===0?o={text:L.drawLocal.draw.handlers.polyline.tooltip.start}:(i=a?this._getMeasurementString():"",o=this._markers.length===1?{text:L.drawLocal.draw.handlers.polyline.tooltip.cont,subtext:i}:{text:L.drawLocal.draw.handlers.polyline.tooltip.end,subtext:i}),o},_updateRunningMeasure:function(o,i){var a,s,l=this._markers.length;this._markers.length===1?this._measurementRunningTotal=0:(a=l-(i?2:1),s=L.GeometryUtil.isVersion07x()?o.distanceTo(this._markers[a].getLatLng())*(this.options.factor||1):this._map.distance(o,this._markers[a].getLatLng())*(this.options.factor||1),this._measurementRunningTotal+=s*(i?1:-1))},_getMeasurementString:function(){var o,i=this._currentLatLng,a=this._markers[this._markers.length-1].getLatLng();return o=L.GeometryUtil.isVersion07x()?a&&i&&i.distanceTo?this._measurementRunningTotal+i.distanceTo(a)*(this.options.factor||1):this._measurementRunningTotal||0:a&&i?this._measurementRunningTotal+this._map.distance(i,a)*(this.options.factor||1):this._measurementRunningTotal||0,L.GeometryUtil.readableDistance(o,this.options.metric,this.options.feet,this.options.nautic,this.options.precision)},_showErrorTooltip:function(){this._errorShown=!0,this._tooltip.showAsError().updateContent({text:this.options.drawError.message}),this._updateGuideColor(this.options.drawError.color),this._poly.setStyle({color:this.options.drawError.color}),this._clearHideErrorTimeout(),this._hideErrorTimeout=setTimeout(L.Util.bind(this._hideErrorTooltip,this),this.options.drawError.timeout)},_hideErrorTooltip:function(){this._errorShown=!1,this._clearHideErrorTimeout(),this._tooltip.removeError().updateContent(this._getTooltipText()),this._updateGuideColor(this.options.shapeOptions.color),this._poly.setStyle({color:this.options.shapeOptions.color})},_clearHideErrorTimeout:function(){this._hideErrorTimeout&&(clearTimeout(this._hideErrorTimeout),this._hideErrorTimeout=null)},_disableNewMarkers:function(){this._disableMarkers=!0},_enableNewMarkers:function(){setTimeout((function(){this._disableMarkers=!1}).bind(this),50)},_cleanUpShape:function(){this._markers.length>1&&this._markers[this._markers.length-1].off("click",this._finishShape,this)},_fireCreatedEvent:function(){var o=new this.Poly(this._poly.getLatLngs(),this.options.shapeOptions);L.Draw.Feature.prototype._fireCreatedEvent.call(this,o)}}),L.Draw.Polygon=L.Draw.Polyline.extend({statics:{TYPE:"polygon"},Poly:L.Polygon,options:{showArea:!1,showLength:!1,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0,feet:!0,nautic:!1,precision:{}},initialize:function(o,i){L.Draw.Polyline.prototype.initialize.call(this,o,i),this.type=L.Draw.Polygon.TYPE},_updateFinishHandler:function(){var o=this._markers.length;o===1&&this._markers[0].on("click",this._finishShape,this),o>2&&(this._markers[o-1].on("dblclick",this._finishShape,this),o>3&&this._markers[o-2].off("dblclick",this._finishShape,this))},_getTooltipText:function(){var o,i;return this._markers.length===0?o=L.drawLocal.draw.handlers.polygon.tooltip.start:this._markers.length<3?(o=L.drawLocal.draw.handlers.polygon.tooltip.cont,i=this._getMeasurementString()):(o=L.drawLocal.draw.handlers.polygon.tooltip.end,i=this._getMeasurementString()),{text:o,subtext:i}},_getMeasurementString:function(){var o=this._area,i="";return o||this.options.showLength?(this.options.showLength&&(i=L.Draw.Polyline.prototype._getMeasurementString.call(this)),o&&(i+="<br>"+L.GeometryUtil.readableArea(o,this.options.metric,this.options.precision)),i):null},_shapeIsValid:function(){return this._markers.length>=3},_vertexChanged:function(o,i){var a;!this.options.allowIntersection&&this.options.showArea&&(a=this._poly.getLatLngs(),this._area=L.GeometryUtil.geodesicArea(a)),L.Draw.Polyline.prototype._vertexChanged.call(this,o,i)},_cleanUpShape:function(){var o=this._markers.length;o>0&&(this._markers[0].off("click",this._finishShape,this),o>2&&this._markers[o-1].off("dblclick",this._finishShape,this))}}),L.SimpleShape={},L.Draw.SimpleShape=L.Draw.Feature.extend({options:{repeatMode:!1},initialize:function(o,i){this._endLabelText=L.drawLocal.draw.handlers.simpleshape.tooltip.end,L.Draw.Feature.prototype.initialize.call(this,o,i)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._mapDraggable=this._map.dragging.enabled(),this._mapDraggable&&this._map.dragging.disable(),this._container.style.cursor="crosshair",this._tooltip.updateContent({text:this._initialLabelText}),this._map.on("mousedown",this._onMouseDown,this).on("mousemove",this._onMouseMove,this).on("touchstart",this._onMouseDown,this).on("touchmove",this._onMouseMove,this),t.addEventListener("touchstart",L.DomEvent.preventDefault,{passive:!1}))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._mapDraggable&&this._map.dragging.enable(),this._container.style.cursor="",this._map.off("mousedown",this._onMouseDown,this).off("mousemove",this._onMouseMove,this).off("touchstart",this._onMouseDown,this).off("touchmove",this._onMouseMove,this),L.DomEvent.off(t,"mouseup",this._onMouseUp,this),L.DomEvent.off(t,"touchend",this._onMouseUp,this),t.removeEventListener("touchstart",L.DomEvent.preventDefault),this._shape&&(this._map.removeLayer(this._shape),delete this._shape)),this._isDrawing=!1},_getTooltipText:function(){return{text:this._endLabelText}},_onMouseDown:function(o){this._isDrawing=!0,this._startLatLng=o.latlng,L.DomEvent.on(t,"mouseup",this._onMouseUp,this).on(t,"touchend",this._onMouseUp,this).preventDefault(o.originalEvent)},_onMouseMove:function(o){var i=o.latlng;this._tooltip.updatePosition(i),this._isDrawing&&(this._tooltip.updateContent(this._getTooltipText()),this._drawShape(i))},_onMouseUp:function(){this._shape&&this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()}}),L.Draw.Rectangle=L.Draw.SimpleShape.extend({statics:{TYPE:"rectangle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showArea:!0,metric:!0},initialize:function(o,i){this.type=L.Draw.Rectangle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.rectangle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,o,i)},disable:function(){this._enabled&&(this._isCurrentlyTwoClickDrawing=!1,L.Draw.SimpleShape.prototype.disable.call(this))},_onMouseUp:function(o){if(!this._shape&&!this._isCurrentlyTwoClickDrawing)return void(this._isCurrentlyTwoClickDrawing=!0);this._isCurrentlyTwoClickDrawing&&!r(o.target,"leaflet-pane")||L.Draw.SimpleShape.prototype._onMouseUp.call(this)},_drawShape:function(o){this._shape?this._shape.setBounds(new L.LatLngBounds(this._startLatLng,o)):(this._shape=new L.Rectangle(new L.LatLngBounds(this._startLatLng,o),this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var o=new L.Rectangle(this._shape.getBounds(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,o)},_getTooltipText:function(){var o,i,a,s=L.Draw.SimpleShape.prototype._getTooltipText.call(this),l=this._shape,u=this.options.showArea;return l&&(o=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),i=L.GeometryUtil.geodesicArea(o),a=u?L.GeometryUtil.readableArea(i,this.options.metric):""),{text:s.text,subtext:a}}}),L.Draw.Marker=L.Draw.Feature.extend({statics:{TYPE:"marker"},options:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},initialize:function(o,i){this.type=L.Draw.Marker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.marker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,o,i)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._tooltip.updateContent({text:this._initialLabelText}),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("click",this._onClick,this).addTo(this._map),this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onTouch,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._map.off("click",this._onClick,this).off("click",this._onTouch,this),this._marker&&(this._marker.off("click",this._onClick,this),this._map.removeLayer(this._marker),delete this._marker),this._mouseMarker.off("click",this._onClick,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._map.off("mousemove",this._onMouseMove,this))},_onMouseMove:function(o){var i=o.latlng;this._tooltip.updatePosition(i),this._mouseMarker.setLatLng(i),this._marker?(i=this._mouseMarker.getLatLng(),this._marker.setLatLng(i)):(this._marker=this._createMarker(i),this._marker.on("click",this._onClick,this),this._map.on("click",this._onClick,this).addLayer(this._marker))},_createMarker:function(o){return new L.Marker(o,{icon:this.options.icon,zIndexOffset:this.options.zIndexOffset})},_onClick:function(){this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_onTouch:function(o){this._onMouseMove(o),this._onClick()},_fireCreatedEvent:function(){var o=new L.Marker.Touch(this._marker.getLatLng(),{icon:this.options.icon});L.Draw.Feature.prototype._fireCreatedEvent.call(this,o)}}),L.Draw.CircleMarker=L.Draw.Marker.extend({statics:{TYPE:"circlemarker"},options:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0,zIndexOffset:2e3},initialize:function(o,i){this.type=L.Draw.CircleMarker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circlemarker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,o,i)},_fireCreatedEvent:function(){var o=new L.CircleMarker(this._marker.getLatLng(),this.options);L.Draw.Feature.prototype._fireCreatedEvent.call(this,o)},_createMarker:function(o){return new L.CircleMarker(o,this.options)}}),L.Draw.Circle=L.Draw.SimpleShape.extend({statics:{TYPE:"circle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0,nautic:!1},initialize:function(o,i){this.type=L.Draw.Circle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,o,i)},_drawShape:function(o){if(L.GeometryUtil.isVersion07x())var i=this._startLatLng.distanceTo(o);else var i=this._map.distance(this._startLatLng,o);this._shape?this._shape.setRadius(i):(this._shape=new L.Circle(this._startLatLng,i,this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var o=new L.Circle(this._startLatLng,this._shape.getRadius(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,o)},_onMouseMove:function(o){var i,a=o.latlng,s=this.options.showRadius,l=this.options.metric;if(this._tooltip.updatePosition(a),this._isDrawing){this._drawShape(a),i=this._shape.getRadius().toFixed(1);var u="";s&&(u=L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(i,l,this.options.feet,this.options.nautic)),this._tooltip.updateContent({text:this._endLabelText,subtext:u})}}}),L.Edit=L.Edit||{},L.Edit.Marker=L.Handler.extend({initialize:function(o,i){this._marker=o,L.setOptions(this,i)},addHooks:function(){var o=this._marker;o.dragging.enable(),o.on("dragend",this._onDragEnd,o),this._toggleMarkerHighlight()},removeHooks:function(){var o=this._marker;o.dragging.disable(),o.off("dragend",this._onDragEnd,o),this._toggleMarkerHighlight()},_onDragEnd:function(o){var i=o.target;i.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:i})},_toggleMarkerHighlight:function(){var o=this._marker._icon;o&&(o.style.display="none",L.DomUtil.hasClass(o,"leaflet-edit-marker-selected")?(L.DomUtil.removeClass(o,"leaflet-edit-marker-selected"),this._offsetMarker(o,-4)):(L.DomUtil.addClass(o,"leaflet-edit-marker-selected"),this._offsetMarker(o,4)),o.style.display="")},_offsetMarker:function(o,i){var a=parseInt(o.style.marginTop,10)-i,s=parseInt(o.style.marginLeft,10)-i;o.style.marginTop=a+"px",o.style.marginLeft=s+"px"}}),L.Marker.addInitHook(function(){L.Edit.Marker&&(this.editing=new L.Edit.Marker(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.Poly=L.Handler.extend({initialize:function(o){this.latlngs=[o._latlngs],o._holes&&(this.latlngs=this.latlngs.concat(o._holes)),this._poly=o,this._poly.on("revert-edited",this._updateLatLngs,this)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._poly._latlngs)?this._poly._latlngs:this._poly._latlngs[0]:this._poly._latlngs},_eachVertexHandler:function(o){for(var i=0;i<this._verticesHandlers.length;i++)o(this._verticesHandlers[i])},addHooks:function(){this._initHandlers(),this._eachVertexHandler(function(o){o.addHooks()})},removeHooks:function(){this._eachVertexHandler(function(o){o.removeHooks()})},updateMarkers:function(){this._eachVertexHandler(function(o){o.updateMarkers()})},_initHandlers:function(){this._verticesHandlers=[];for(var o=0;o<this.latlngs.length;o++)this._verticesHandlers.push(new L.Edit.PolyVerticesEdit(this._poly,this.latlngs[o],this._poly.options.poly))},_updateLatLngs:function(o){this.latlngs=[o.layer._latlngs],o.layer._holes&&(this.latlngs=this.latlngs.concat(o.layer._holes))}}),L.Edit.PolyVerticesEdit=L.Handler.extend({options:{icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),drawError:{color:"#b00b00",timeout:1e3}},initialize:function(o,i,a){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this._poly=o,a&&a.drawError&&(a.drawError=L.Util.extend({},this.options.drawError,a.drawError)),this._latlngs=i,L.setOptions(this,a)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._latlngs)?this._latlngs:this._latlngs[0]:this._latlngs},addHooks:function(){var o=this._poly,i=o._path;o instanceof L.Polygon||(o.options.fill=!1,o.options.editing&&(o.options.editing.fill=!1)),i&&o.options.editing&&o.options.editing.className&&(o.options.original.className&&o.options.original.className.split(" ").forEach(function(a){L.DomUtil.removeClass(i,a)}),o.options.editing.className.split(" ").forEach(function(a){L.DomUtil.addClass(i,a)})),o.setStyle(o.options.editing),this._poly._map&&(this._map=this._poly._map,this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){var o=this._poly,i=o._path;i&&o.options.editing&&o.options.editing.className&&(o.options.editing.className.split(" ").forEach(function(a){L.DomUtil.removeClass(i,a)}),o.options.original.className&&o.options.original.className.split(" ").forEach(function(a){L.DomUtil.addClass(i,a)})),o.setStyle(o.options.original),o._map&&(o._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers)},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._markers=[];var o,i,a,s,l=this._defaultShape();for(o=0,a=l.length;o<a;o++)s=this._createMarker(l[o],o),s.on("click",this._onMarkerClick,this),s.on("contextmenu",this._onContextMenu,this),this._markers.push(s);var u,d;for(o=0,i=a-1;o<a;i=o++)(o!==0||L.Polygon&&this._poly instanceof L.Polygon)&&(u=this._markers[i],d=this._markers[o],this._createMiddleMarker(u,d),this._updatePrevNext(u,d))},_createMarker:function(o,i){var a=new L.Marker.Touch(o,{draggable:!0,icon:this.options.icon});return a._origLatLng=o,a._index=i,a.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._fireEdit,this).on("touchmove",this._onTouchMove,this).on("touchend",this._fireEdit,this).on("MSPointerMove",this._onTouchMove,this).on("MSPointerUp",this._fireEdit,this),this._markerGroup.addLayer(a),a},_onMarkerDragStart:function(){this._poly.fire("editstart")},_spliceLatLngs:function(){var o=this._defaultShape(),i=[].splice.apply(o,arguments);return this._poly._convertLatLngs(o,!0),this._poly.redraw(),i},_removeMarker:function(o){var i=o._index;this._markerGroup.removeLayer(o),this._markers.splice(i,1),this._spliceLatLngs(i,1),this._updateIndexes(i,-1),o.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._fireEdit,this).off("touchmove",this._onMarkerDrag,this).off("touchend",this._fireEdit,this).off("click",this._onMarkerClick,this).off("MSPointerMove",this._onTouchMove,this).off("MSPointerUp",this._fireEdit,this)},_fireEdit:function(){this._poly.edited=!0,this._poly.fire("edit"),this._poly._map.fire(L.Draw.Event.EDITVERTEX,{layers:this._markerGroup,poly:this._poly})},_onMarkerDrag:function(o){var i=o.target,a=this._poly,s=L.LatLngUtil.cloneLatLng(i._origLatLng);if(L.extend(i._origLatLng,i._latlng),a.options.poly){var l=a._map._editTooltip;if(!a.options.poly.allowIntersection&&a.intersects()){L.extend(i._origLatLng,s),i.setLatLng(s);var u=a.options.color;a.setStyle({color:this.options.drawError.color}),l&&l.updateContent({text:L.drawLocal.draw.handlers.polyline.error}),setTimeout(function(){a.setStyle({color:u}),l&&l.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext})},1e3)}}i._middleLeft&&i._middleLeft.setLatLng(this._getMiddleLatLng(i._prev,i)),i._middleRight&&i._middleRight.setLatLng(this._getMiddleLatLng(i,i._next)),this._poly._bounds._southWest=L.latLng(1/0,1/0),this._poly._bounds._northEast=L.latLng(-1/0,-1/0);var d=this._poly.getLatLngs();this._poly._convertLatLngs(d,!0),this._poly.redraw(),this._poly.fire("editdrag")},_onMarkerClick:function(o){var i=L.Polygon&&this._poly instanceof L.Polygon?4:3,a=o.target;this._defaultShape().length<i||(this._removeMarker(a),this._updatePrevNext(a._prev,a._next),a._middleLeft&&this._markerGroup.removeLayer(a._middleLeft),a._middleRight&&this._markerGroup.removeLayer(a._middleRight),a._prev&&a._next?this._createMiddleMarker(a._prev,a._next):a._prev?a._next||(a._prev._middleRight=null):a._next._middleLeft=null,this._fireEdit())},_onContextMenu:function(o){var i=o.target;this._poly,this._poly._map.fire(L.Draw.Event.MARKERCONTEXT,{marker:i,layers:this._markerGroup,poly:this._poly}),L.DomEvent.stopPropagation},_onTouchMove:function(o){var i=this._map.mouseEventToLayerPoint(o.originalEvent.touches[0]),a=this._map.layerPointToLatLng(i),s=o.target;L.extend(s._origLatLng,a),s._middleLeft&&s._middleLeft.setLatLng(this._getMiddleLatLng(s._prev,s)),s._middleRight&&s._middleRight.setLatLng(this._getMiddleLatLng(s,s._next)),this._poly.redraw(),this.updateMarkers()},_updateIndexes:function(o,i){this._markerGroup.eachLayer(function(a){a._index>o&&(a._index+=i)})},_createMiddleMarker:function(o,i){var a,s,l,u=this._getMiddleLatLng(o,i),d=this._createMarker(u);d.setOpacity(.6),o._middleRight=i._middleLeft=d,s=function(){d.off("touchmove",s,this);var h=i._index;d._index=h,d.off("click",a,this).on("click",this._onMarkerClick,this),u.lat=d.getLatLng().lat,u.lng=d.getLatLng().lng,this._spliceLatLngs(h,0,u),this._markers.splice(h,0,d),d.setOpacity(1),this._updateIndexes(h,1),i._index++,this._updatePrevNext(o,d),this._updatePrevNext(d,i),this._poly.fire("editstart")},l=function(){d.off("dragstart",s,this),d.off("dragend",l,this),d.off("touchmove",s,this),this._createMiddleMarker(o,d),this._createMiddleMarker(d,i)},a=function(){s.call(this),l.call(this),this._fireEdit()},d.on("click",a,this).on("dragstart",s,this).on("dragend",l,this).on("touchmove",s,this),this._markerGroup.addLayer(d)},_updatePrevNext:function(o,i){o&&(o._next=i),i&&(i._prev=o)},_getMiddleLatLng:function(o,i){var a=this._poly._map,s=a.project(o.getLatLng()),l=a.project(i.getLatLng());return a.unproject(s._add(l)._divideBy(2))}}),L.Polyline.addInitHook(function(){this.editing||(L.Edit.Poly&&(this.editing=new L.Edit.Poly(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()}))}),L.Edit=L.Edit||{},L.Edit.SimpleShape=L.Handler.extend({options:{moveIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move"}),resizeIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize"}),touchMoveIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move leaflet-touch-icon"}),touchResizeIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize leaflet-touch-icon"})},initialize:function(o,i){L.Browser.touch&&(this.options.moveIcon=this.options.touchMoveIcon,this.options.resizeIcon=this.options.touchResizeIcon),this._shape=o,L.Util.setOptions(this,i)},addHooks:function(){var o=this._shape;this._shape._map&&(this._map=this._shape._map,o.setStyle(o.options.editing),o._map&&(this._map=o._map,this._markerGroup||this._initMarkers(),this._map.addLayer(this._markerGroup)))},removeHooks:function(){var o=this._shape;if(o.setStyle(o.options.original),o._map){this._unbindMarker(this._moveMarker);for(var i=0,a=this._resizeMarkers.length;i<a;i++)this._unbindMarker(this._resizeMarkers[i]);this._resizeMarkers=null,this._map.removeLayer(this._markerGroup),delete this._markerGroup}this._map=null},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._createMoveMarker(),this._createResizeMarker()},_createMoveMarker:function(){},_createResizeMarker:function(){},_createMarker:function(o,i){var a=new L.Marker.Touch(o,{draggable:!0,icon:i,zIndexOffset:10});return this._bindMarker(a),this._markerGroup.addLayer(a),a},_bindMarker:function(o){o.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._onMarkerDragEnd,this).on("touchstart",this._onTouchStart,this).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onTouchEnd,this).on("MSPointerUp",this._onTouchEnd,this)},_unbindMarker:function(o){o.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._onMarkerDragEnd,this).off("touchstart",this._onTouchStart,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onTouchEnd,this).off("MSPointerUp",this._onTouchEnd,this)},_onMarkerDragStart:function(o){o.target.setOpacity(0),this._shape.fire("editstart")},_fireEdit:function(){this._shape.edited=!0,this._shape.fire("edit")},_onMarkerDrag:function(o){var i=o.target,a=i.getLatLng();i===this._moveMarker?this._move(a):this._resize(a),this._shape.redraw(),this._shape.fire("editdrag")},_onMarkerDragEnd:function(o){o.target.setOpacity(1),this._fireEdit()},_onTouchStart:function(o){if(L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,o),typeof this._getCorners=="function"){var i=this._getCorners(),a=o.target,s=a._cornerIndex;a.setOpacity(0),this._oppositeCorner=i[(s+2)%4],this._toggleCornerMarkers(0,s)}this._shape.fire("editstart")},_onTouchMove:function(o){var i=this._map.mouseEventToLayerPoint(o.originalEvent.touches[0]),a=this._map.layerPointToLatLng(i);return o.target===this._moveMarker?this._move(a):this._resize(a),this._shape.redraw(),!1},_onTouchEnd:function(o){o.target.setOpacity(1),this.updateMarkers(),this._fireEdit()},_move:function(){},_resize:function(){}}),L.Edit=L.Edit||{},L.Edit.Rectangle=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var o=this._shape.getBounds(),i=o.getCenter();this._moveMarker=this._createMarker(i,this.options.moveIcon)},_createResizeMarker:function(){var o=this._getCorners();this._resizeMarkers=[];for(var i=0,a=o.length;i<a;i++)this._resizeMarkers.push(this._createMarker(o[i],this.options.resizeIcon)),this._resizeMarkers[i]._cornerIndex=i},_onMarkerDragStart:function(o){L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,o);var i=this._getCorners(),a=o.target,s=a._cornerIndex;this._oppositeCorner=i[(s+2)%4],this._toggleCornerMarkers(0,s)},_onMarkerDragEnd:function(o){var i,a,s=o.target;s===this._moveMarker&&(i=this._shape.getBounds(),a=i.getCenter(),s.setLatLng(a)),this._toggleCornerMarkers(1),this._repositionCornerMarkers(),L.Edit.SimpleShape.prototype._onMarkerDragEnd.call(this,o)},_move:function(o){for(var i,a=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),s=this._shape.getBounds(),l=s.getCenter(),u=[],d=0,h=a.length;d<h;d++)i=[a[d].lat-l.lat,a[d].lng-l.lng],u.push([o.lat+i[0],o.lng+i[1]]);this._shape.setLatLngs(u),this._repositionCornerMarkers(),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})},_resize:function(o){var i;this._shape.setBounds(L.latLngBounds(o,this._oppositeCorner)),i=this._shape.getBounds(),this._moveMarker.setLatLng(i.getCenter()),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})},_getCorners:function(){var o=this._shape.getBounds();return[o.getNorthWest(),o.getNorthEast(),o.getSouthEast(),o.getSouthWest()]},_toggleCornerMarkers:function(o){for(var i=0,a=this._resizeMarkers.length;i<a;i++)this._resizeMarkers[i].setOpacity(o)},_repositionCornerMarkers:function(){for(var o=this._getCorners(),i=0,a=this._resizeMarkers.length;i<a;i++)this._resizeMarkers[i].setLatLng(o[i])}}),L.Rectangle.addInitHook(function(){L.Edit.Rectangle&&(this.editing=new L.Edit.Rectangle(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.CircleMarker=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var o=this._shape.getLatLng();this._moveMarker=this._createMarker(o,this.options.moveIcon)},_createResizeMarker:function(){this._resizeMarkers=[]},_move:function(o){if(this._resizeMarkers.length){var i=this._getResizeMarkerPoint(o);this._resizeMarkers[0].setLatLng(i)}this._shape.setLatLng(o),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})}}),L.CircleMarker.addInitHook(function(){L.Edit.CircleMarker&&(this.editing=new L.Edit.CircleMarker(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})}),L.Edit=L.Edit||{},L.Edit.Circle=L.Edit.CircleMarker.extend({_createResizeMarker:function(){var o=this._shape.getLatLng(),i=this._getResizeMarkerPoint(o);this._resizeMarkers=[],this._resizeMarkers.push(this._createMarker(i,this.options.resizeIcon))},_getResizeMarkerPoint:function(o){var i=this._shape._radius*Math.cos(Math.PI/4),a=this._map.project(o);return this._map.unproject([a.x+i,a.y-i])},_resize:function(o){var i=this._moveMarker.getLatLng();L.GeometryUtil.isVersion07x()?radius=i.distanceTo(o):radius=this._map.distance(i,o),this._shape.setRadius(radius),this._map.editTooltip&&this._map._editTooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.subtext+"<br />"+L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(radius,!0,this.options.feet,this.options.nautic)}),this._shape.setRadius(radius),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})}}),L.Circle.addInitHook(function(){L.Edit.Circle&&(this.editing=new L.Edit.Circle(this),this.options.editable&&this.editing.enable())}),L.Map.mergeOptions({touchExtend:!0}),L.Map.TouchExtend=L.Handler.extend({initialize:function(o){this._map=o,this._container=o._container,this._pane=o._panes.overlayPane},addHooks:function(){L.DomEvent.on(this._container,"touchstart",this._onTouchStart,this),L.DomEvent.on(this._container,"touchend",this._onTouchEnd,this),L.DomEvent.on(this._container,"touchmove",this._onTouchMove,this),this._detectIE()?(L.DomEvent.on(this._container,"MSPointerDown",this._onTouchStart,this),L.DomEvent.on(this._container,"MSPointerUp",this._onTouchEnd,this),L.DomEvent.on(this._container,"MSPointerMove",this._onTouchMove,this),L.DomEvent.on(this._container,"MSPointerCancel",this._onTouchCancel,this)):(L.DomEvent.on(this._container,"touchcancel",this._onTouchCancel,this),L.DomEvent.on(this._container,"touchleave",this._onTouchLeave,this))},removeHooks:function(){L.DomEvent.off(this._container,"touchstart",this._onTouchStart,this),L.DomEvent.off(this._container,"touchend",this._onTouchEnd,this),L.DomEvent.off(this._container,"touchmove",this._onTouchMove,this),this._detectIE()?(L.DomEvent.off(this._container,"MSPointerDown",this._onTouchStart,this),L.DomEvent.off(this._container,"MSPointerUp",this._onTouchEnd,this),L.DomEvent.off(this._container,"MSPointerMove",this._onTouchMove,this),L.DomEvent.off(this._container,"MSPointerCancel",this._onTouchCancel,this)):(L.DomEvent.off(this._container,"touchcancel",this._onTouchCancel,this),L.DomEvent.off(this._container,"touchleave",this._onTouchLeave,this))},_touchEvent:function(o,i){var a={};if(o.touches!==void 0){if(!o.touches.length)return;a=o.touches[0]}else if(o.pointerType!=="touch"||(a=o,!this._filterClick(o)))return;var s=this._map.mouseEventToContainerPoint(a),l=this._map.mouseEventToLayerPoint(a),u=this._map.layerPointToLatLng(l);this._map.fire(i,{latlng:u,layerPoint:l,containerPoint:s,pageX:a.pageX,pageY:a.pageY,originalEvent:o})},_filterClick:function(o){var i=o.timeStamp||o.originalEvent.timeStamp,a=L.DomEvent._lastClick&&i-L.DomEvent._lastClick;return a&&a>100&&a<500||o.target._simulatedClick&&!o._simulated?(L.DomEvent.stop(o),!1):(L.DomEvent._lastClick=i,!0)},_onTouchStart:function(o){this._map._loaded&&this._touchEvent(o,"touchstart")},_onTouchEnd:function(o){this._map._loaded&&this._touchEvent(o,"touchend")},_onTouchCancel:function(o){if(this._map._loaded){var i="touchcancel";this._detectIE()&&(i="pointercancel"),this._touchEvent(o,i)}},_onTouchLeave:function(o){this._map._loaded&&this._touchEvent(o,"touchleave")},_onTouchMove:function(o){this._map._loaded&&this._touchEvent(o,"touchmove")},_detectIE:function(){var o=e.navigator.userAgent,i=o.indexOf("MSIE ");if(i>0)return parseInt(o.substring(i+5,o.indexOf(".",i)),10);if(o.indexOf("Trident/")>0){var a=o.indexOf("rv:");return parseInt(o.substring(a+3,o.indexOf(".",a)),10)}var s=o.indexOf("Edge/");return s>0&&parseInt(o.substring(s+5,o.indexOf(".",s)),10)}}),L.Map.addInitHook("addHandler","touchExtend",L.Map.TouchExtend),L.Marker.Touch=L.Marker.extend({_initInteraction:function(){return this.addInteractiveTarget?L.Marker.prototype._initInteraction.apply(this):this._initInteractionLegacy()},_initInteractionLegacy:function(){if(this.options.clickable){var o=this._icon,i=["dblclick","mousedown","mouseover","mouseout","contextmenu","touchstart","touchend","touchmove"];this._detectIE?i.concat(["MSPointerDown","MSPointerUp","MSPointerMove","MSPointerCancel"]):i.concat(["touchcancel"]),L.DomUtil.addClass(o,"leaflet-clickable"),L.DomEvent.on(o,"click",this._onMouseClick,this),L.DomEvent.on(o,"keypress",this._onKeyPress,this);for(var a=0;a<i.length;a++)L.DomEvent.on(o,i[a],this._fireMouseEvent,this);L.Handler.MarkerDrag&&(this.dragging=new L.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_detectIE:function(){var o=e.navigator.userAgent,i=o.indexOf("MSIE ");if(i>0)return parseInt(o.substring(i+5,o.indexOf(".",i)),10);if(o.indexOf("Trident/")>0){var a=o.indexOf("rv:");return parseInt(o.substring(a+3,o.indexOf(".",a)),10)}var s=o.indexOf("Edge/");return s>0&&parseInt(o.substring(s+5,o.indexOf(".",s)),10)}}),L.LatLngUtil={cloneLatLngs:function(o){for(var i=[],a=0,s=o.length;a<s;a++)Array.isArray(o[a])?i.push(L.LatLngUtil.cloneLatLngs(o[a])):i.push(this.cloneLatLng(o[a]));return i},cloneLatLng:function(o){return L.latLng(o.lat,o.lng)}},function(){var o={km:2,ha:2,m:0,mi:2,ac:2,yd:0,ft:0,nm:2};L.GeometryUtil=L.extend(L.GeometryUtil||{},{geodesicArea:function(i){var a,s,l=i.length,u=0,d=Math.PI/180;if(l>2){for(var h=0;h<l;h++)a=i[h],s=i[(h+1)%l],u+=(s.lng-a.lng)*d*(2+Math.sin(a.lat*d)+Math.sin(s.lat*d));u=6378137*u*6378137/2}return Math.abs(u)},formattedNumber:function(i,a){var s=parseFloat(i).toFixed(a),l=L.drawLocal.format&&L.drawLocal.format.numeric,u=l&&l.delimiters,d=u&&u.thousands,h=u&&u.decimal;if(d||h){var C=s.split(".");s=d?C[0].replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+d):C[0],h=h||".",C.length>1&&(s=s+h+C[1])}return s},readableArea:function(i,a,d){var l,u,d=L.Util.extend({},o,d);return a?(u=["ha","m"],type=typeof a,type==="string"?u=[a]:type!=="boolean"&&(u=a),l=i>=1e6&&u.indexOf("km")!==-1?L.GeometryUtil.formattedNumber(1e-6*i,d.km)+" km²":i>=1e4&&u.indexOf("ha")!==-1?L.GeometryUtil.formattedNumber(1e-4*i,d.ha)+" ha":L.GeometryUtil.formattedNumber(i,d.m)+" m²"):(i/=.836127,l=i>=3097600?L.GeometryUtil.formattedNumber(i/3097600,d.mi)+" mi²":i>=4840?L.GeometryUtil.formattedNumber(i/4840,d.ac)+" acres":L.GeometryUtil.formattedNumber(i,d.yd)+" yd²"),l},readableDistance:function(i,a,s,l,h){var d,h=L.Util.extend({},o,h);switch(a?typeof a=="string"?a:"metric":s?"feet":l?"nauticalMile":"yards"){case"metric":d=i>1e3?L.GeometryUtil.formattedNumber(i/1e3,h.km)+" km":L.GeometryUtil.formattedNumber(i,h.m)+" m";break;case"feet":i*=3.28083,d=L.GeometryUtil.formattedNumber(i,h.ft)+" ft";break;case"nauticalMile":i*=.53996,d=L.GeometryUtil.formattedNumber(i/1e3,h.nm)+" nm";break;case"yards":default:i*=1.09361,d=i>1760?L.GeometryUtil.formattedNumber(i/1760,h.mi)+" miles":L.GeometryUtil.formattedNumber(i,h.yd)+" yd"}return d},isVersion07x:function(){var i=L.version.split(".");return parseInt(i[0],10)===0&&parseInt(i[1],10)===7}})}(),L.Util.extend(L.LineUtil,{segmentsIntersect:function(o,i,a,s){return this._checkCounterclockwise(o,a,s)!==this._checkCounterclockwise(i,a,s)&&this._checkCounterclockwise(o,i,a)!==this._checkCounterclockwise(o,i,s)},_checkCounterclockwise:function(o,i,a){return(a.y-o.y)*(i.x-o.x)>(i.y-o.y)*(a.x-o.x)}}),L.Polyline.include({intersects:function(){var o,i,a,s=this._getProjectedPoints(),l=s?s.length:0;if(this._tooFewPointsForIntersection())return!1;for(o=l-1;o>=3;o--)if(i=s[o-1],a=s[o],this._lineSegmentsIntersectsRange(i,a,o-2))return!0;return!1},newLatLngIntersects:function(o,i){return!!this._map&&this.newPointIntersects(this._map.latLngToLayerPoint(o),i)},newPointIntersects:function(o,i){var a=this._getProjectedPoints(),s=a?a.length:0,l=a?a[s-1]:null,u=s-2;return!this._tooFewPointsForIntersection(1)&&this._lineSegmentsIntersectsRange(l,o,u,i?1:0)},_tooFewPointsForIntersection:function(o){var i=this._getProjectedPoints(),a=i?i.length:0;return a+=o||0,!i||a<=3},_lineSegmentsIntersectsRange:function(o,i,a,s){var l,u,d=this._getProjectedPoints();s=s||0;for(var h=a;h>s;h--)if(l=d[h-1],u=d[h],L.LineUtil.segmentsIntersect(o,i,l,u))return!0;return!1},_getProjectedPoints:function(){if(!this._defaultShape)return this._originalPoints;for(var o=[],i=this._defaultShape(),a=0;a<i.length;a++)o.push(this._map.latLngToLayerPoint(i[a]));return o}}),L.Polygon.include({intersects:function(){var o,i,a,s,l=this._getProjectedPoints();return!this._tooFewPointsForIntersection()&&(!!L.Polyline.prototype.intersects.call(this)||(o=l.length,i=l[0],a=l[o-1],s=o-2,this._lineSegmentsIntersectsRange(a,i,s,1)))}}),L.Control.Draw=L.Control.extend({options:{position:"topleft",draw:{},edit:!1},initialize:function(o){if(L.version<"0.7")throw new Error("Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/");L.Control.prototype.initialize.call(this,o);var i;this._toolbars={},L.DrawToolbar&&this.options.draw&&(i=new L.DrawToolbar(this.options.draw),this._toolbars[L.DrawToolbar.TYPE]=i,this._toolbars[L.DrawToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.EditToolbar&&this.options.edit&&(i=new L.EditToolbar(this.options.edit),this._toolbars[L.EditToolbar.TYPE]=i,this._toolbars[L.EditToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.toolbar=this},onAdd:function(o){var i,a=L.DomUtil.create("div","leaflet-draw"),s=!1;for(var l in this._toolbars)this._toolbars.hasOwnProperty(l)&&(i=this._toolbars[l].addToolbar(o))&&(s||(L.DomUtil.hasClass(i,"leaflet-draw-toolbar-top")||L.DomUtil.addClass(i.childNodes[0],"leaflet-draw-toolbar-top"),s=!0),a.appendChild(i));return a},onRemove:function(){for(var o in this._toolbars)this._toolbars.hasOwnProperty(o)&&this._toolbars[o].removeToolbar()},setDrawingOptions:function(o){for(var i in this._toolbars)this._toolbars[i]instanceof L.DrawToolbar&&this._toolbars[i].setOptions(o)},_toolbarEnabled:function(o){var i=o.target;for(var a in this._toolbars)this._toolbars[a]!==i&&this._toolbars[a].disable()}}),L.Map.mergeOptions({drawControlTooltips:!0,drawControl:!1}),L.Map.addInitHook(function(){this.options.drawControl&&(this.drawControl=new L.Control.Draw,this.addControl(this.drawControl))}),L.Toolbar=L.Class.extend({initialize:function(o){L.setOptions(this,o),this._modes={},this._actionButtons=[],this._activeMode=null;var i=L.version.split(".");parseInt(i[0],10)===1&&parseInt(i[1],10)>=2?L.Toolbar.include(L.Evented.prototype):L.Toolbar.include(L.Mixin.Events)},enabled:function(){return this._activeMode!==null},disable:function(){this.enabled()&&this._activeMode.handler.disable()},addToolbar:function(o){var i,a=L.DomUtil.create("div","leaflet-draw-section"),s=0,l=this._toolbarClass||"",u=this.getModeHandlers(o);for(this._toolbarContainer=L.DomUtil.create("div","leaflet-draw-toolbar leaflet-bar"),this._map=o,i=0;i<u.length;i++)u[i].enabled&&this._initModeHandler(u[i].handler,this._toolbarContainer,s++,l,u[i].title);if(s)return this._lastButtonIndex=--s,this._actionsContainer=L.DomUtil.create("ul","leaflet-draw-actions"),a.appendChild(this._toolbarContainer),a.appendChild(this._actionsContainer),a},removeToolbar:function(){for(var o in this._modes)this._modes.hasOwnProperty(o)&&(this._disposeButton(this._modes[o].button,this._modes[o].handler.enable,this._modes[o].handler),this._modes[o].handler.disable(),this._modes[o].handler.off("enabled",this._handlerActivated,this).off("disabled",this._handlerDeactivated,this));this._modes={};for(var i=0,a=this._actionButtons.length;i<a;i++)this._disposeButton(this._actionButtons[i].button,this._actionButtons[i].callback,this);this._actionButtons=[],this._actionsContainer=null},_initModeHandler:function(o,i,a,s,l){var u=o.type;this._modes[u]={},this._modes[u].handler=o,this._modes[u].button=this._createButton({type:u,title:l,className:s+"-"+u,container:i,callback:this._modes[u].handler.enable,context:this._modes[u].handler}),this._modes[u].buttonIndex=a,this._modes[u].handler.on("enabled",this._handlerActivated,this).on("disabled",this._handlerDeactivated,this)},_detectIOS:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!e.MSStream},_createButton:function(o){var i=L.DomUtil.create("a",o.className||"",o.container),a=L.DomUtil.create("span","sr-only",o.container);i.href="#",i.appendChild(a),o.title&&(i.title=o.title,a.innerHTML=o.title),o.text&&(i.innerHTML=o.text,a.innerHTML=o.text);var s=this._detectIOS()?"touchstart":"click";return L.DomEvent.on(i,"click",L.DomEvent.stopPropagation).on(i,"mousedown",L.DomEvent.stopPropagation).on(i,"dblclick",L.DomEvent.stopPropagation).on(i,"touchstart",L.DomEvent.stopPropagation).on(i,"click",L.DomEvent.preventDefault).on(i,s,o.callback,o.context),i},_disposeButton:function(o,i){var a=this._detectIOS()?"touchstart":"click";L.DomEvent.off(o,"click",L.DomEvent.stopPropagation).off(o,"mousedown",L.DomEvent.stopPropagation).off(o,"dblclick",L.DomEvent.stopPropagation).off(o,"touchstart",L.DomEvent.stopPropagation).off(o,"click",L.DomEvent.preventDefault).off(o,a,i)},_handlerActivated:function(o){this.disable(),this._activeMode=this._modes[o.handler],L.DomUtil.addClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._showActionsToolbar(),this.fire("enable")},_handlerDeactivated:function(){this._hideActionsToolbar(),L.DomUtil.removeClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._activeMode=null,this.fire("disable")},_createActions:function(o){var i,a,s,l,u=this._actionsContainer,d=this.getActions(o),h=d.length;for(a=0,s=this._actionButtons.length;a<s;a++)this._disposeButton(this._actionButtons[a].button,this._actionButtons[a].callback);for(this._actionButtons=[];u.firstChild;)u.removeChild(u.firstChild);for(var C=0;C<h;C++)"enabled"in d[C]&&!d[C].enabled||(i=L.DomUtil.create("li","",u),l=this._createButton({title:d[C].title,text:d[C].text,container:i,callback:d[C].callback,context:d[C].context}),this._actionButtons.push({button:l,callback:d[C].callback}))},_showActionsToolbar:function(){var o=this._activeMode.buttonIndex,i=this._lastButtonIndex,a=this._activeMode.button.offsetTop-1;this._createActions(this._activeMode.handler),this._actionsContainer.style.top=a+"px",o===0&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-top")),o===i&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-bottom")),this._actionsContainer.style.display="block",this._map.fire(L.Draw.Event.TOOLBAROPENED)},_hideActionsToolbar:function(){this._actionsContainer.style.display="none",L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-top"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-bottom"),this._map.fire(L.Draw.Event.TOOLBARCLOSED)}}),L.Draw=L.Draw||{},L.Draw.Tooltip=L.Class.extend({initialize:function(o){this._map=o,this._popupPane=o._panes.popupPane,this._visible=!1,this._container=o.options.drawControlTooltips?L.DomUtil.create("div","leaflet-draw-tooltip",this._popupPane):null,this._singleLineLabel=!1,this._map.on("mouseout",this._onMouseOut,this)},dispose:function(){this._map.off("mouseout",this._onMouseOut,this),this._container&&(this._popupPane.removeChild(this._container),this._container=null)},updateContent:function(o){return this._container?(o.subtext=o.subtext||"",o.subtext.length!==0||this._singleLineLabel?o.subtext.length>0&&this._singleLineLabel&&(L.DomUtil.removeClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!1):(L.DomUtil.addClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!0),this._container.innerHTML=(o.subtext.length>0?'<span class="leaflet-draw-tooltip-subtext">'+o.subtext+"</span><br />":"")+"<span>"+o.text+"</span>",o.text||o.subtext?(this._visible=!0,this._container.style.visibility="inherit"):(this._visible=!1,this._container.style.visibility="hidden"),this):this},updatePosition:function(o){var i=this._map.latLngToLayerPoint(o),a=this._container;return this._container&&(this._visible&&(a.style.visibility="inherit"),L.DomUtil.setPosition(a,i)),this},showAsError:function(){return this._container&&L.DomUtil.addClass(this._container,"leaflet-error-draw-tooltip"),this},removeError:function(){return this._container&&L.DomUtil.removeClass(this._container,"leaflet-error-draw-tooltip"),this},_onMouseOut:function(){this._container&&(this._container.style.visibility="hidden")}}),L.DrawToolbar=L.Toolbar.extend({statics:{TYPE:"draw"},options:{polyline:{},polygon:{},rectangle:{},circle:{},marker:{},circlemarker:{}},initialize:function(o){for(var i in this.options)this.options.hasOwnProperty(i)&&o[i]&&(o[i]=L.extend({},this.options[i],o[i]));this._toolbarClass="leaflet-draw-draw",L.Toolbar.prototype.initialize.call(this,o)},getModeHandlers:function(o){return[{enabled:this.options.polyline,handler:new L.Draw.Polyline(o,this.options.polyline),title:L.drawLocal.draw.toolbar.buttons.polyline},{enabled:this.options.polygon,handler:new L.Draw.Polygon(o,this.options.polygon),title:L.drawLocal.draw.toolbar.buttons.polygon},{enabled:this.options.rectangle,handler:new L.Draw.Rectangle(o,this.options.rectangle),title:L.drawLocal.draw.toolbar.buttons.rectangle},{enabled:this.options.circle,handler:new L.Draw.Circle(o,this.options.circle),title:L.drawLocal.draw.toolbar.buttons.circle},{enabled:this.options.marker,handler:new L.Draw.Marker(o,this.options.marker),title:L.drawLocal.draw.toolbar.buttons.marker},{enabled:this.options.circlemarker,handler:new L.Draw.CircleMarker(o,this.options.circlemarker),title:L.drawLocal.draw.toolbar.buttons.circlemarker}]},getActions:function(o){return[{enabled:o.completeShape,title:L.drawLocal.draw.toolbar.finish.title,text:L.drawLocal.draw.toolbar.finish.text,callback:o.completeShape,context:o},{enabled:o.deleteLastVertex,title:L.drawLocal.draw.toolbar.undo.title,text:L.drawLocal.draw.toolbar.undo.text,callback:o.deleteLastVertex,context:o},{title:L.drawLocal.draw.toolbar.actions.title,text:L.drawLocal.draw.toolbar.actions.text,callback:this.disable,context:this}]},setOptions:function(o){L.setOptions(this,o);for(var i in this._modes)this._modes.hasOwnProperty(i)&&o.hasOwnProperty(i)&&this._modes[i].handler.setOptions(o[i])}}),L.EditToolbar=L.Toolbar.extend({statics:{TYPE:"edit"},options:{edit:{selectedPathOptions:{dashArray:"10, 10",fill:!0,fillColor:"#fe57a1",fillOpacity:.1,maintainColor:!1}},remove:{},poly:null,featureGroup:null},initialize:function(o){o.edit&&(o.edit.selectedPathOptions===void 0&&(o.edit.selectedPathOptions=this.options.edit.selectedPathOptions),o.edit.selectedPathOptions=L.extend({},this.options.edit.selectedPathOptions,o.edit.selectedPathOptions)),o.remove&&(o.remove=L.extend({},this.options.remove,o.remove)),o.poly&&(o.poly=L.extend({},this.options.poly,o.poly)),this._toolbarClass="leaflet-draw-edit",L.Toolbar.prototype.initialize.call(this,o),this._selectedFeatureCount=0},getModeHandlers:function(o){var i=this.options.featureGroup;return[{enabled:this.options.edit,handler:new L.EditToolbar.Edit(o,{featureGroup:i,selectedPathOptions:this.options.edit.selectedPathOptions,poly:this.options.poly}),title:L.drawLocal.edit.toolbar.buttons.edit},{enabled:this.options.remove,handler:new L.EditToolbar.Delete(o,{featureGroup:i}),title:L.drawLocal.edit.toolbar.buttons.remove}]},getActions:function(o){var i=[{title:L.drawLocal.edit.toolbar.actions.save.title,text:L.drawLocal.edit.toolbar.actions.save.text,callback:this._save,context:this},{title:L.drawLocal.edit.toolbar.actions.cancel.title,text:L.drawLocal.edit.toolbar.actions.cancel.text,callback:this.disable,context:this}];return o.removeAllLayers&&i.push({title:L.drawLocal.edit.toolbar.actions.clearAll.title,text:L.drawLocal.edit.toolbar.actions.clearAll.text,callback:this._clearAllLayers,context:this}),i},addToolbar:function(o){var i=L.Toolbar.prototype.addToolbar.call(this,o);return this._checkDisabled(),this.options.featureGroup.on("layeradd layerremove",this._checkDisabled,this),i},removeToolbar:function(){this.options.featureGroup.off("layeradd layerremove",this._checkDisabled,this),L.Toolbar.prototype.removeToolbar.call(this)},disable:function(){this.enabled()&&(this._activeMode.handler.revertLayers(),L.Toolbar.prototype.disable.call(this))},_save:function(){this._activeMode.handler.save(),this._activeMode&&this._activeMode.handler.disable()},_clearAllLayers:function(){this._activeMode.handler.removeAllLayers(),this._activeMode&&this._activeMode.handler.disable()},_checkDisabled:function(){var o,i=this.options.featureGroup,a=i.getLayers().length!==0;this.options.edit&&(o=this._modes[L.EditToolbar.Edit.TYPE].button,a?L.DomUtil.removeClass(o,"leaflet-disabled"):L.DomUtil.addClass(o,"leaflet-disabled"),o.setAttribute("title",a?L.drawLocal.edit.toolbar.buttons.edit:L.drawLocal.edit.toolbar.buttons.editDisabled)),this.options.remove&&(o=this._modes[L.EditToolbar.Delete.TYPE].button,a?L.DomUtil.removeClass(o,"leaflet-disabled"):L.DomUtil.addClass(o,"leaflet-disabled"),o.setAttribute("title",a?L.drawLocal.edit.toolbar.buttons.remove:L.drawLocal.edit.toolbar.buttons.removeDisabled))}}),L.EditToolbar.Edit=L.Handler.extend({statics:{TYPE:"edit"},initialize:function(o,i){if(L.Handler.prototype.initialize.call(this,o),L.setOptions(this,i),this._featureGroup=i.featureGroup,!(this._featureGroup instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this._uneditedLayerProps={},this.type=L.EditToolbar.Edit.TYPE;var a=L.version.split(".");parseInt(a[0],10)===1&&parseInt(a[1],10)>=2?L.EditToolbar.Edit.include(L.Evented.prototype):L.EditToolbar.Edit.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.EDITSTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._featureGroup.on("layeradd",this._enableLayerEdit,this).on("layerremove",this._disableLayerEdit,this))},disable:function(){this._enabled&&(this._featureGroup.off("layeradd",this._enableLayerEdit,this).off("layerremove",this._disableLayerEdit,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.EDITSTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var o=this._map;o&&(o.getContainer().focus(),this._featureGroup.eachLayer(this._enableLayerEdit,this),this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}),o._editTooltip=this._tooltip,this._updateTooltip(),this._map.on("mousemove",this._onMouseMove,this).on("touchmove",this._onMouseMove,this).on("MSPointerMove",this._onMouseMove,this).on(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},removeHooks:function(){this._map&&(this._featureGroup.eachLayer(this._disableLayerEdit,this),this._uneditedLayerProps={},this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this).off("touchmove",this._onMouseMove,this).off("MSPointerMove",this._onMouseMove,this).off(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},revertLayers:function(){this._featureGroup.eachLayer(function(o){this._revertLayer(o)},this)},save:function(){var o=new L.LayerGroup;this._featureGroup.eachLayer(function(i){i.edited&&(o.addLayer(i),i.edited=!1)}),this._map.fire(L.Draw.Event.EDITED,{layers:o})},_backupLayer:function(o){var i=L.Util.stamp(o);this._uneditedLayerProps[i]||(o instanceof L.Polyline||o instanceof L.Polygon||o instanceof L.Rectangle?this._uneditedLayerProps[i]={latlngs:L.LatLngUtil.cloneLatLngs(o.getLatLngs())}:o instanceof L.Circle?this._uneditedLayerProps[i]={latlng:L.LatLngUtil.cloneLatLng(o.getLatLng()),radius:o.getRadius()}:(o instanceof L.Marker||o instanceof L.CircleMarker)&&(this._uneditedLayerProps[i]={latlng:L.LatLngUtil.cloneLatLng(o.getLatLng())}))},_getTooltipText:function(){return{text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}},_updateTooltip:function(){this._tooltip.updateContent(this._getTooltipText())},_revertLayer:function(o){var i=L.Util.stamp(o);o.edited=!1,this._uneditedLayerProps.hasOwnProperty(i)&&(o instanceof L.Polyline||o instanceof L.Polygon||o instanceof L.Rectangle?o.setLatLngs(this._uneditedLayerProps[i].latlngs):o instanceof L.Circle?(o.setLatLng(this._uneditedLayerProps[i].latlng),o.setRadius(this._uneditedLayerProps[i].radius)):(o instanceof L.Marker||o instanceof L.CircleMarker)&&o.setLatLng(this._uneditedLayerProps[i].latlng),o.fire("revert-edited",{layer:o}))},_enableLayerEdit:function(o){var i,a,s=o.layer||o.target||o;this._backupLayer(s),this.options.poly&&(a=L.Util.extend({},this.options.poly),s.options.poly=a),this.options.selectedPathOptions&&(i=L.Util.extend({},this.options.selectedPathOptions),i.maintainColor&&(i.color=s.options.color,i.fillColor=s.options.fillColor),s.options.original=L.extend({},s.options),s.options.editing=i),s instanceof L.Marker?(s.editing&&s.editing.enable(),s.dragging.enable(),s.on("dragend",this._onMarkerDragEnd).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onMarkerDragEnd,this).on("MSPointerUp",this._onMarkerDragEnd,this)):s.editing.enable()},_disableLayerEdit:function(o){var i=o.layer||o.target||o;i.edited=!1,i.editing&&i.editing.disable(),delete i.options.editing,delete i.options.original,this._selectedPathOptions&&(i instanceof L.Marker?this._toggleMarkerHighlight(i):(i.setStyle(i.options.previousOptions),delete i.options.previousOptions)),i instanceof L.Marker?(i.dragging.disable(),i.off("dragend",this._onMarkerDragEnd,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onMarkerDragEnd,this).off("MSPointerUp",this._onMarkerDragEnd,this)):i.editing.disable()},_onMouseMove:function(o){this._tooltip.updatePosition(o.latlng)},_onMarkerDragEnd:function(o){var i=o.target;i.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:i})},_onTouchMove:function(o){var i=o.originalEvent.changedTouches[0],a=this._map.mouseEventToLayerPoint(i),s=this._map.layerPointToLatLng(a);o.target.setLatLng(s)},_hasAvailableLayers:function(){return this._featureGroup.getLayers().length!==0}}),L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:"remove"},initialize:function(o,i){if(L.Handler.prototype.initialize.call(this,o),L.Util.setOptions(this,i),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this.type=L.EditToolbar.Delete.TYPE;var a=L.version.split(".");parseInt(a[0],10)===1&&parseInt(a[1],10)>=2?L.EditToolbar.Delete.include(L.Evented.prototype):L.EditToolbar.Delete.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DELETESTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on("layeradd",this._enableLayerDelete,this).on("layerremove",this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off("layeradd",this._enableLayerDelete,this).off("layerremove",this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DELETESTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var o=this._map;o&&(o.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on("mousemove",this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer(function(o){this._deletableLayers.addLayer(o),o.fire("revert-deleted",{layer:o})},this)},save:function(){this._map.fire(L.Draw.Event.DELETED,{layers:this._deletedLayers})},removeAllLayers:function(){this._deletableLayers.eachLayer(function(o){this._removeLayer({layer:o})},this),this.save()},_enableLayerDelete:function(o){(o.layer||o.target||o).on("click",this._removeLayer,this)},_disableLayerDelete:function(o){var i=o.layer||o.target||o;i.off("click",this._removeLayer,this),this._deletedLayers.removeLayer(i)},_removeLayer:function(o){var i=o.layer||o.target||o;this._deletableLayers.removeLayer(i),this._deletedLayers.addLayer(i),i.fire("deleted")},_onMouseMove:function(o){this._tooltip.updatePosition(o.latlng)},_hasAvailableLayers:function(){return this._deletableLayers.getLayers().length!==0}})})(window,document);function oP(e,t){const n=B.useRef(t);B.useEffect(function(){t!==n.current&&e.attributionControl!=null&&(n.current!=null&&e.attributionControl.removeAttribution(n.current),t!=null&&e.attributionControl.addAttribution(t)),n.current=t},[e,t])}const tRe=1;function nRe(e){return Object.freeze({__version:tRe,map:e})}function Up(e,t){return Object.freeze({...e,...t})}const iP=B.createContext(null),aP=iP.Provider;function Gl(){const e=B.useContext(iP);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return e}function sP(e){function t(n,r){const{instance:o,context:i}=e(n).current;return B.useImperativeHandle(r,()=>o),n.children==null?null:B.createElement(aP,{value:i},n.children)}return B.forwardRef(t)}function rRe(e){function t(n,r){const[o,i]=B.useState(!1),{instance:a}=e(n,i).current;B.useImperativeHandle(r,()=>a),B.useEffect(function(){o&&a.update()},[a,o,n.children]);const s=a._contentNode;return s?pr.createPortal(n.children,s):null}return B.forwardRef(t)}function lP(e){function t(n,r){const{instance:o}=e(n).current;return B.useImperativeHandle(r,()=>o),null}return B.forwardRef(t)}function oRe(e){return function(n){const r=Gl(),o=e(n,r),{instance:i}=o.current,a=B.useRef(n.position),{position:s}=n;return B.useEffect(function(){return i.addTo(r.map),function(){i.remove()}},[r.map,i]),B.useEffect(function(){s!=null&&s!==a.current&&(i.setPosition(s),a.current=s)},[i,s]),o}}function Wp(e,t){const n=B.useRef();B.useEffect(function(){return t!=null&&e.instance.on(t),n.current=t,function(){n.current!=null&&e.instance.off(n.current),n.current=null}},[e,t])}function ad(e,t){const n=e.pane??t.pane;return n?{...e,pane:n}:e}function iRe(e,t){return function(r,o){const i=Gl(),a=e(ad(r,i),i);return oP(i.map,r.attribution),Wp(a.current,r.eventHandlers),t(a.current,i,r,o),a}}function b5(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function Yl(e,t){return t==null?function(r,o){const i=B.useRef();return i.current||(i.current=e(r,o)),i}:function(r,o){const i=B.useRef();i.current||(i.current=e(r,o));const a=B.useRef(r),{instance:s}=i.current;return B.useEffect(function(){a.current!==r&&(t(s,r,a.current),a.current=r)},[s,r,o]),i}}function cP(e,t){B.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){var i;(i=t.layerContainer)==null||i.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function uP(e){return function(n){const r=Gl(),o=e(ad(n,r),r);return oP(r.map,n.attribution),Wp(o.current,n.eventHandlers),cP(o.current,r),o}}function aRe(e,t){const n=B.useRef();B.useEffect(function(){if(t.pathOptions!==n.current){const o=t.pathOptions??{};e.instance.setStyle(o),n.current=o}},[e,t])}function sRe(e){return function(n){const r=Gl(),o=e(ad(n,r),r);return Wp(o.current,n.eventHandlers),cP(o.current,r),aRe(o.current,n),o}}function lRe(e){function t(o,i){return b5(e(o),i)}const n=Yl(t),r=oRe(n);return lP(r)}function dP(e,t){const n=Yl(e,t),r=uP(n);return sP(r)}function cRe(e,t){const n=Yl(e),r=iRe(n,t);return rRe(r)}function uRe(e,t){const n=Yl(e,t),r=sRe(n);return sP(r)}function dRe(e,t){const n=Yl(e,t),r=uP(n);return lP(r)}function fRe(e,t,n){const{opacity:r,zIndex:o}=t;r!=null&&r!==n.opacity&&e.setOpacity(r),o!=null&&o!==n.zIndex&&e.setZIndex(o)}function hRe(e,t,n){t.bounds instanceof To.LatLngBounds&&t.bounds!==n.bounds&&e.setBounds(t.bounds),t.opacity!=null&&t.opacity!==n.opacity&&e.setOpacity(t.opacity),t.zIndex!=null&&t.zIndex!==n.zIndex&&e.setZIndex(t.zIndex)}function sd(){return Gl().map}const fP=uRe(function({data:t,...n},r){const o=new To.GeoJSON(t,n);return b5(o,Up(r,{overlayContainer:o}))},function(t,n,r){n.style!==r.style&&(n.style==null?t.resetStyle():t.setStyle(n.style))}),CRe=dP(function({bounds:t,url:n,...r},o){const i=new To.ImageOverlay(n,t,r);return b5(i,Up(o,{overlayContainer:i}))},function(t,n,r){if(hRe(t,n,r),n.bounds!==r.bounds){const o=n.bounds instanceof To.LatLngBounds?n.bounds:new To.LatLngBounds(n.bounds);t.setBounds(o)}n.url!==r.url&&t.setUrl(n.url)});function Rg(){return Rg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rg.apply(this,arguments)}function gRe({bounds:e,boundsOptions:t,center:n,children:r,className:o,id:i,placeholder:a,style:s,whenReady:l,zoom:u,...d},h){const[C]=B.useState({className:o,id:i,style:s}),[m,A]=B.useState(null);B.useImperativeHandle(h,()=>(m==null?void 0:m.map)??null,[m]);const v=B.useCallback(w=>{if(w!==null&&m===null){const x=new To.Map(w,d);n!=null&&u!=null?x.setView(n,u):e!=null&&x.fitBounds(e,t),l!=null&&x.whenReady(l),A(nRe(x))}},[]);B.useEffect(()=>()=>{m==null||m.map.remove()},[m]);const p=m?B.createElement(aP,{value:m},r):a??null;return B.createElement("div",Rg({},C,{ref:v}),p)}const hP=B.forwardRef(gRe),CP=dP(function({position:t,...n},r){const o=new To.Marker(t,n);return b5(o,Up(r,{overlayContainer:o}))},function(t,n,r){n.position!==r.position&&t.setLatLng(n.position),n.icon!=null&&n.icon!==r.icon&&t.setIcon(n.icon),n.zIndexOffset!=null&&n.zIndexOffset!==r.zIndexOffset&&t.setZIndexOffset(n.zIndexOffset),n.opacity!=null&&n.opacity!==r.opacity&&t.setOpacity(n.opacity),t.dragging!=null&&n.draggable!==r.draggable&&(n.draggable===!0?t.dragging.enable():t.dragging.disable())}),gP=cRe(function(t,n){const r=new To.Popup(t,n.overlayContainer);return b5(r,n)},function(t,n,{position:r},o){B.useEffect(function(){const{instance:a}=t;function s(u){u.popup===a&&(a.update(),o(!0))}function l(u){u.popup===a&&o(!1)}return n.map.on({popupopen:s,popupclose:l}),n.overlayContainer==null?(r!=null&&a.setLatLng(r),a.openOn(n.map)):n.overlayContainer.bindPopup(a),function(){var d;n.map.off({popupopen:s,popupclose:l}),(d=n.overlayContainer)==null||d.unbindPopup(),n.map.removeLayer(a)}},[t,n,o,r])}),mRe=dRe(function({url:t,...n},r){const o=new To.TileLayer(t,ad(n,r));return b5(o,r)},function(t,n,r){fRe(t,n,r);const{url:o}=n;o!=null&&o!==r.url&&t.setUrl(o)}),mP=lRe(function(t){return new To.Control.Zoom(t)}),pRe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11.999%202C16.2792%202%2019.749%205.50394%2019.749%209.82617C19.7489%2015.0436%2011.999%2022%2011.999%2022C11.951%2021.9569%204.24911%2015.0273%204.24902%209.82617C4.24902%205.50408%207.71905%202.00022%2011.999%202ZM12%207C10.6328%207%209.52448%208.11934%209.52441%209.5C9.52441%2010.8807%2010.6327%2012%2012%2012C13.3672%2011.9999%2014.4756%2010.8806%2014.4756%209.5C14.4755%208.11941%2013.3671%207.0001%2012%207Z'%20fill='%23FFCC00'%20stroke='%23B49000'%20stroke-width='1.4'/%3e%3c/svg%3e",pP=new P2.Icon({iconUrl:pRe,className:"awi_map_marker_icon",iconSize:[32,32]}),AP=e=>new P2.Icon({iconUrl:e,className:"awi_map_marker_icon",iconSize:[32,32]}),ARe=({items:e})=>{const t=sd();return B.useEffect(()=>{if(!(e!=null&&e.length))return;const n=P2.latLngBounds(e==null?void 0:e.map(r=>r==null?void 0:r.position));t.fitBounds(n,{padding:[50,50]})},[e,t]),null},vP=({mapRef:e})=>{const t=sd();return B.useEffect(()=>{e.current=t},[t]),null},vRe=({enableDrawing:e,drawOptions:t,drawnItems:n,onDrawCreated:r})=>{const o=sd();return B.useEffect(()=>{var a,s,l;if(!e||!o)return;const i=new P2.Control.Draw({position:(t==null?void 0:t.position)||"topleft",draw:{polyline:((a=t==null?void 0:t.draw)==null?void 0:a.polyline)!==!1?{}:!1,polygon:((s=t==null?void 0:t.draw)==null?void 0:s.polygon)!==!1?{}:!1,rectangle:!1,circle:!1,marker:((l=t==null?void 0:t.draw)==null?void 0:l.marker)!==!1?{}:!1,circlemarker:!1},edit:{featureGroup:n,remove:!1,edit:!1}});return o.addControl(i),o.on(P2.Draw.Event.CREATED,r),()=>{o.removeControl(i),o.off(P2.Draw.Event.CREATED,r)}},[o,e,t,n,r]),null},bRe=({enableDrawing:e,drawnItems:t})=>{const n=B.useMemo(()=>{if(!e||!t)return{type:"FeatureCollection",features:[]};try{const r=t.toGeoJSON();return r&&r.type==="FeatureCollection"&&Array.isArray(r.features)?r:{type:"FeatureCollection",features:[]}}catch(r){return console.warn("Error converting drawn items to GeoJSON:",r),{type:"FeatureCollection",features:[]}}},[e,t]);return!e||!t||n.features.length===0?null:V.jsx(fP,{data:n,style:{color:"#ff7800",weight:2,opacity:.65}},`drawn-items-${n.features.length}`)},yRe=(e,t,n)=>({...e,features:e.features.map(r=>({...r,geometry:{...r.geometry,coordinates:wRe(r.geometry.coordinates,r.geometry.type,t,n)}}))}),wRe=(e,t,n,r)=>{const o=i=>[i[0]*n.width,r==="top-left"?(1-i[1])*n.height:i[1]*n.height];switch(t){case"Polygon":return e.map(i=>i.map(o));case"MultiPolygon":return e.map(i=>i.map(a=>a.map(o)));case"LineString":return e.map(o);case"MultiLineString":return e.map(i=>i.map(o));case"Point":return o(e);case"MultiPoint":return e.map(o);default:return e}},xRe=(e,t)=>{const[n,r]=B.useState(null);B.useEffect(()=>{r(e?new P2.FeatureGroup:null)},[e]);const o=B.useCallback(a=>{const{layer:s}=a;if(n){n.addLayer(s);const l=new P2.FeatureGroup(n.getLayers());r(l);const u=s.toGeoJSON();t&&t(u)}else console.warn("drawnItems is null, cannot add layer")},[n,t]),i=B.useCallback(()=>n?n.toGeoJSON():{type:"FeatureCollection",features:[]},[n]);return{drawnItems:n,handleDrawCreated:o,getDrawnItemsGeoJSON:i}},dc=(e,t,n)=>{const r=e.x*t.width;let o;switch(n){case"bottom-left":o=e.y*t.height;break;case"top-left":o=(1-e.y)*t.height;break;default:throw new Error(`Unknown origin type for floormap: ${n}`)}return P2.latLng(o,r)},ERe=P2.extend({},P2.CRS.Simple,{transformation:new P2.Transformation(1,0,-1,1)}),_Re=P2.CRS.Simple,kh={"top-left":ERe,"bottom-left":_Re},SRe=({bounds:e})=>{const t=sd(),n=B.useRef(!1);return B.useEffect(()=>{n.current||(t.fitBounds(e,{maxZoom:2}),n.current=!0)},[t,e]),null},MRe={defaultZoom:14,defaultCenter:{x:.5,y:.5},imageHeight:1e3,imageWidth:1e3,imageUrl:"https://unsplash.it/1000/1000"},HRe=({mapConfig:e=MRe,items:t,features:n={type:"FeatureCollection",features:[]},featureStyle:r,width:o="500px",height:i="500px",showCardPopup:a=!0,showCountPopup:s=!0,showNavigation:l=!0,fitImageBounds:u=!0,onCountPopupClick:d=()=>{},navClassName:h,navButtonColor:C,className:m,focusedIndex:A,onClickAway:v,onFocusedIndexChange:p,enableDrawing:w=!1,onShapeSave:x,drawOptions:E,origin:S="top-left"})=>{const[_,M]=B.useState(!1),[H,R]=B.useState(null),{drawnItems:k,handleDrawCreated:I}=xRe(w,x),P=typeof A=="number",T=P?A:H;B.useEffect(()=>{M(!0)},[]),B.useEffect(()=>{},[w,k]);const N={width:(e==null?void 0:e.imageWidth)??1e3,height:(e==null?void 0:e.imageHeight)??1e3},F=yRe(n,N,S),j=[[0,0],[N==null?void 0:N.height,N==null?void 0:N.width]],z=B.useMemo(()=>T!==null?t==null?void 0:t[T]:null,[t,T]),W=B.useRef(null),Q=B.useRef({});B.useEffect(()=>{if(!_)return;const ee=requestAnimationFrame(()=>{W.current=T!=null?Q.current[T]??null:null,s&&Object.entries(Q.current).forEach(([ie,he])=>{Number(ie)===T||he==null||he.openPopup()}),T!=null&&Q.current[T]&&Q.current[T].openPopup()});return()=>cancelAnimationFrame(ee)},[T,_,s]);const q=B.useRef(null);B.useEffect(()=>{const ee=q.current;if(ee&&(z!=null&&z.position)){const ie=dc(z==null?void 0:z.position,N,S);ee.setView(ie,ee.getZoom(),{animate:!0})}},[z,_,N]);const[K,$]=B.useState(dc(e==null?void 0:e.defaultCenter,N,S));B.useEffect(()=>{if(z&&K){const ee=dc(z==null?void 0:z.position,N,S);$(ee)}},[z]);const Y=()=>{const ee=((T??0)-1+(t==null?void 0:t.length))%(t==null?void 0:t.length);P&&p?p(ee):R(ee)},X=()=>{const ee=((T??0)+1)%(t==null?void 0:t.length);P&&p?p(ee):R(ee)};if(typeof window>"u"||!_)return null;const J=C||"var(--awi-color-common-highlight, #ffcc00)";return V.jsxs("div",{className:`map_view_container ${m??""}`,style:{width:o,height:i},children:[V.jsxs(hP,{zoom:e==null?void 0:e.defaultZoom,maxBounds:j,maxBoundsViscosity:.8,center:K,crs:kh==null?void 0:kh[S],style:{width:"100%",height:"100%"},zoomControl:!1,children:[V.jsx(vP,{mapRef:q}),V.jsx(CRe,{url:e==null?void 0:e.imageUrl,bounds:j}),u?V.jsx(SRe,{bounds:j}):null,V.jsx(mP,{position:"bottomright"}),V.jsx(fP,{data:F,style:r}),w&&k&&V.jsx(vRe,{enableDrawing:w,drawOptions:E,drawnItems:k,onDrawCreated:I}),V.jsx(bRe,{enableDrawing:w,drawnItems:k}),t==null?void 0:t.map((ee,ie)=>{const he=dc(ee==null?void 0:ee.position,N,S),le=ie===T;return V.jsx(CP,{position:he,icon:ee!=null&&ee.icon?AP(ee==null?void 0:ee.icon):pP,ref:ye=>{ye&&(Q.current[ie]=ye)},eventHandlers:{click:()=>{P&&p?p(ie):R(ie)}},children:a||s?V.jsx(gP,{closeButton:!1,autoPan:!1,autoClose:!1,closeOnClick:le&&a,className:le&&a?"card_popup":s?"count_popup":"",eventHandlers:{remove:()=>{P&&p?p(null):R(null),le&&v&&v()}},children:le&&a&&(ee!=null&&ee.element)?ee==null?void 0:ee.element:s?V.jsx("p",{onClick:d,children:(ee==null?void 0:ee.count)??"N/A"}):null},le?`focused-${ie}`:`count-${ie}`):V.jsx(V.Fragment,{})},ie)})]}),l&&V.jsxs("div",{className:`map_view_nav_container ${h??""}`,children:[V.jsx($0,{variant:"primary",onClick:Y,size:"s",icon:"leftArrow",backgroundColor:J,borderColor:J,title:"Previous"}),V.jsx($0,{variant:"primary",onClick:X,size:"s",icon:"rightArrow",iconPosition:"after",backgroundColor:J,borderColor:J,title:"Next"})]})]})};function k7(e){"@babel/helpers - typeof";return k7=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k7(e)}var LRe=/^\s+/,ORe=/\s+$/;function In(e,t){if(e=e||"",t=t||{},e instanceof In)return e;if(!(this instanceof In))return new In(e,t);var n=BRe(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}In.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),n,r,o,i,a,s;return n=t.r/255,r=t.g/255,o=t.b/255,n<=.03928?i=n/12.92:i=Math.pow((n+.055)/1.055,2.4),r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),o<=.03928?s=o/12.92:s=Math.pow((o+.055)/1.055,2.4),.2126*i+.7152*a+.0722*s},setAlpha:function(t){return this._a=bP(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=_S(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=_S(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),o=Math.round(t.v*100);return this._a==1?"hsv("+n+", "+r+"%, "+o+"%)":"hsva("+n+", "+r+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var t=ES(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=ES(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),o=Math.round(t.l*100);return this._a==1?"hsl("+n+", "+r+"%, "+o+"%)":"hsla("+n+", "+r+"%, "+o+"%, "+this._roundA+")"},toHex:function(t){return SS(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return IRe(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(v0(this._r,255)*100)+"%",g:Math.round(v0(this._g,255)*100)+"%",b:Math.round(v0(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(v0(this._r,255)*100)+"%, "+Math.round(v0(this._g,255)*100)+"%, "+Math.round(v0(this._b,255)*100)+"%)":"rgba("+Math.round(v0(this._r,255)*100)+"%, "+Math.round(v0(this._g,255)*100)+"%, "+Math.round(v0(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:KRe[SS(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+MS(this._r,this._g,this._b,this._a),r=n,o=this._gradientType?"GradientType = 1, ":"";if(t){var i=In(t);r="#"+MS(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+n+",endColorstr="+r+")"},toString:function(t){var n=!!t;t=t||this._format;var r=!1,o=this._a<1&&this._a>=0,i=!n&&o&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return i?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return In(this.toString())},_applyModification:function(t,n){var r=t.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(FRe,arguments)},brighten:function(){return this._applyModification(jRe,arguments)},darken:function(){return this._applyModification(VRe,arguments)},desaturate:function(){return this._applyModification(PRe,arguments)},saturate:function(){return this._applyModification(TRe,arguments)},greyscale:function(){return this._applyModification(NRe,arguments)},spin:function(){return this._applyModification(zRe,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(URe,arguments)},complement:function(){return this._applyCombination(ZRe,arguments)},monochromatic:function(){return this._applyCombination(WRe,arguments)},splitcomplement:function(){return this._applyCombination($Re,arguments)},triad:function(){return this._applyCombination(HS,[3])},tetrad:function(){return this._applyCombination(HS,[4])}};In.fromRatio=function(e,t){if(k7(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(r==="a"?n[r]=e[r]:n[r]=x4(e[r]));e=n}return In(e,t)};function BRe(e){var t={r:0,g:0,b:0},n=1,r=null,o=null,i=null,a=!1,s=!1;return typeof e=="string"&&(e=XRe(e)),k7(e)=="object"&&(ia(e.r)&&ia(e.g)&&ia(e.b)?(t=kRe(e.r,e.g,e.b),a=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):ia(e.h)&&ia(e.s)&&ia(e.v)?(r=x4(e.s),o=x4(e.v),t=DRe(e.h,r,o),a=!0,s="hsv"):ia(e.h)&&ia(e.s)&&ia(e.l)&&(r=x4(e.s),i=x4(e.l),t=RRe(e.h,r,i),a=!0,s="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=bP(n),{ok:a,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function kRe(e,t,n){return{r:v0(e,255)*255,g:v0(t,255)*255,b:v0(n,255)*255}}function ES(e,t,n){e=v0(e,255),t=v0(t,255),n=v0(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i,a,s=(r+o)/2;if(r==o)i=a=0;else{var l=r-o;switch(a=s>.5?l/(2-r-o):l/(r+o),r){case e:i=(t-n)/l+(t<n?6:0);break;case t:i=(n-e)/l+2;break;case n:i=(e-t)/l+4;break}i/=6}return{h:i,s:a,l:s}}function RRe(e,t,n){var r,o,i;e=v0(e,360),t=v0(t,100),n=v0(n,100);function a(u,d,h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?u+(d-u)*6*h:h<1/2?d:h<2/3?u+(d-u)*(2/3-h)*6:u}if(t===0)r=o=i=n;else{var s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;r=a(l,s,e+1/3),o=a(l,s,e),i=a(l,s,e-1/3)}return{r:r*255,g:o*255,b:i*255}}function _S(e,t,n){e=v0(e,255),t=v0(t,255),n=v0(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i,a,s=r,l=r-o;if(a=r===0?0:l/r,r==o)i=0;else{switch(r){case e:i=(t-n)/l+(t<n?6:0);break;case t:i=(n-e)/l+2;break;case n:i=(e-t)/l+4;break}i/=6}return{h:i,s:a,v:s}}function DRe(e,t,n){e=v0(e,360)*6,t=v0(t,100),n=v0(n,100);var r=Math.floor(e),o=e-r,i=n*(1-t),a=n*(1-o*t),s=n*(1-(1-o)*t),l=r%6,u=[n,a,i,i,s,n][l],d=[s,n,n,a,i,i][l],h=[i,i,s,n,n,a][l];return{r:u*255,g:d*255,b:h*255}}function SS(e,t,n,r){var o=[Bo(Math.round(e).toString(16)),Bo(Math.round(t).toString(16)),Bo(Math.round(n).toString(16))];return r&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function IRe(e,t,n,r,o){var i=[Bo(Math.round(e).toString(16)),Bo(Math.round(t).toString(16)),Bo(Math.round(n).toString(16)),Bo(yP(r))];return o&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function MS(e,t,n,r){var o=[Bo(yP(r)),Bo(Math.round(e).toString(16)),Bo(Math.round(t).toString(16)),Bo(Math.round(n).toString(16))];return o.join("")}In.equals=function(e,t){return!e||!t?!1:In(e).toRgbString()==In(t).toRgbString()};In.random=function(){return In.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function PRe(e,t){t=t===0?0:t||10;var n=In(e).toHsl();return n.s-=t/100,n.s=ld(n.s),In(n)}function TRe(e,t){t=t===0?0:t||10;var n=In(e).toHsl();return n.s+=t/100,n.s=ld(n.s),In(n)}function NRe(e){return In(e).desaturate(100)}function FRe(e,t){t=t===0?0:t||10;var n=In(e).toHsl();return n.l+=t/100,n.l=ld(n.l),In(n)}function jRe(e,t){t=t===0?0:t||10;var n=In(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),In(n)}function VRe(e,t){t=t===0?0:t||10;var n=In(e).toHsl();return n.l-=t/100,n.l=ld(n.l),In(n)}function zRe(e,t){var n=In(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,In(n)}function ZRe(e){var t=In(e).toHsl();return t.h=(t.h+180)%360,In(t)}function HS(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=In(e).toHsl(),r=[In(e)],o=360/t,i=1;i<t;i++)r.push(In({h:(n.h+i*o)%360,s:n.s,l:n.l}));return r}function $Re(e){var t=In(e).toHsl(),n=t.h;return[In(e),In({h:(n+72)%360,s:t.s,l:t.l}),In({h:(n+216)%360,s:t.s,l:t.l})]}function URe(e,t,n){t=t||6,n=n||30;var r=In(e).toHsl(),o=360/n,i=[In(e)];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,i.push(In(r));return i}function WRe(e,t){t=t||6;for(var n=In(e).toHsv(),r=n.h,o=n.s,i=n.v,a=[],s=1/t;t--;)a.push(In({h:r,s:o,v:i})),i=(i+s)%1;return a}In.mix=function(e,t,n){n=n===0?0:n||50;var r=In(e).toRgb(),o=In(t).toRgb(),i=n/100,a={r:(o.r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b,a:(o.a-r.a)*i+r.a};return In(a)};In.readability=function(e,t){var n=In(e),r=In(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};In.isReadable=function(e,t,n){var r=In.readability(e,t),o,i;switch(i=!1,o=qRe(n),o.level+o.size){case"AAsmall":case"AAAlarge":i=r>=4.5;break;case"AAlarge":i=r>=3;break;case"AAAsmall":i=r>=7;break}return i};In.mostReadable=function(e,t,n){var r=null,o=0,i,a,s,l;n=n||{},a=n.includeFallbackColors,s=n.level,l=n.size;for(var u=0;u<t.length;u++)i=In.readability(e,t[u]),i>o&&(o=i,r=In(t[u]));return In.isReadable(e,r,{level:s,size:l})||!a?r:(n.includeFallbackColors=!1,In.mostReadable(e,["#fff","#000"],n))};var Dg=In.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},KRe=In.hexNames=QRe(Dg);function QRe(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function bP(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function v0(e,t){GRe(e)&&(e="100%");var n=YRe(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function ld(e){return Math.min(1,Math.max(0,e))}function L2(e){return parseInt(e,16)}function GRe(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function YRe(e){return typeof e=="string"&&e.indexOf("%")!=-1}function Bo(e){return e.length==1?"0"+e:""+e}function x4(e){return e<=1&&(e=e*100+"%"),e}function yP(e){return Math.round(parseFloat(e)*255).toString(16)}function LS(e){return L2(e)/255}var Eo=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",o="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function ia(e){return!!Eo.CSS_UNIT.exec(e)}function XRe(e){e=e.replace(LRe,"").replace(ORe,"").toLowerCase();var t=!1;if(Dg[e])e=Dg[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=Eo.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=Eo.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Eo.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=Eo.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Eo.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=Eo.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Eo.hex8.exec(e))?{r:L2(n[1]),g:L2(n[2]),b:L2(n[3]),a:LS(n[4]),format:t?"name":"hex8"}:(n=Eo.hex6.exec(e))?{r:L2(n[1]),g:L2(n[2]),b:L2(n[3]),format:t?"name":"hex"}:(n=Eo.hex4.exec(e))?{r:L2(n[1]+""+n[1]),g:L2(n[2]+""+n[2]),b:L2(n[3]+""+n[3]),a:LS(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=Eo.hex3.exec(e))?{r:L2(n[1]+""+n[1]),g:L2(n[2]+""+n[2]),b:L2(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function qRe(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}const JRe=(e,t,n)=>{const[r,o]=t,i=Math.min(Math.max((e-r)/(o-r),0),1),a=n.length;if(a<2)throw new Error("colorRange must have at least two colors");const s=i*(a-1),l=Math.floor(s),u=s-l,d=In(n[l]).toRgb(),h=In(n[Math.min(l+1,a-1)]).toRgb(),C=Math.round(d.r+(h.r-d.r)*u),m=Math.round(d.g+(h.g-d.g)*u),A=Math.round(d.b+(h.b-d.b)*u),v=d.a+(h.a-d.a)*u;return`rgba(${C}, ${m}, ${A}, ${+v.toFixed(3)})`},eDe=({data:e,colorRange:t,valueRange:n,width:r,height:o,showLegend:i=!0,transformCellData:a=S=>S.value,cellWidth:s,cellHeight:l,yLabelWidth:u="4rem",xLabelHeight:d="1.5rem",legendHeight:h="2rem",cellTextColor:C,labelTextColor:m,cellBorderColor:A,borderColor:v,className:p,cellClassName:w,xLabelFontSize:x,yLabelFontSize:E})=>{var S,_,M,H;return i||(h="0rem"),!s&&r&&(s=`calc((${r} - ${u})/${(S=e==null?void 0:e.xlabels)==null?void 0:S.length})`),!l&&o&&(l=`calc((${o} - ${h} - ${d})/${(_=e==null?void 0:e.ylabels)==null?void 0:_.length})`),V.jsx("div",{className:`heatmap ${p||""}`,style:{width:r,height:o,"--c_cell_border":A,"--c_border":v},children:V.jsxs("table",{children:[(M=e==null?void 0:e.ylabels)==null?void 0:M.map((R,k)=>{var I,P;return V.jsxs("tr",{style:{width:"100%",height:l},children:[V.jsx("th",{className:"y_axis_label",title:R,style:{width:u,maxWidth:u,minWidth:u,color:m,fontSize:E},children:R}),(P=(I=e==null?void 0:e.datasets)==null?void 0:I[R])==null?void 0:P.map((T,N)=>V.jsx("td",{className:`heatmap_cell ${w||""}`,style:{width:s,height:"100%"},children:V.jsx(bu,{content:V.jsx("div",{className:"heatmap_cell_tooltip",children:T==null?void 0:T.hoverContent}),trigger:"hover",children:V.jsx("div",{style:{backgroundColor:(T==null?void 0:T.color)??JRe((T==null?void 0:T.value)??0,n,t),color:C},className:"heatmap_cell_inner",children:a(T)},`${N}-${k}-${T==null?void 0:T.value}`)})},`${N}-${k}-${T==null?void 0:T.value}`))]},`${k}-${R}`)}),V.jsxs("tr",{children:[V.jsx("th",{className:"y_axis_label",style:{width:u,maxWidth:u,minWidth:u}}),(H=e==null?void 0:e.xlabels)==null?void 0:H.map((R,k)=>V.jsx("th",{className:"x_axis_label font_secondary",style:{width:s,maxWidth:s,minWidth:s,height:d,maxHeight:d,minHeight:d,color:m,fontSize:x},title:R,children:R},`${k}-${R}`))]},"x_axis_labels"),i?V.jsxs("tr",{className:"heatmap_legend_container",style:{width:`calc( 100% - ${u})`,marginLeft:u,height:h},children:[V.jsx("p",{children:n==null?void 0:n[0]}),V.jsx("div",{className:"heatmap_legend",title:`${n==null?void 0:n[0]} - ${n==null?void 0:n[1]}`,style:{backgroundImage:`linear-gradient(to right, ${t.join(",")})`}}),V.jsx("p",{children:n==null?void 0:n[1]})]}):V.jsx(V.Fragment,{})]})})},tDe=({color:e,size:t="m",showText:n=!1,liveText:r="Live"})=>V.jsxs("div",{className:`awi_live_dot_container size_${t}`,children:[V.jsx("span",{className:`awi_live_dot size_${t}`,style:e?{backgroundColor:e}:void 0,children:V.jsx("span",{className:"awi_live_dot_inner",style:e?{backgroundColor:e}:void 0})}),V.jsx("p",{className:"awi_live_dot_text",children:n?r:""})]});var Xl=e=>e.type==="checkbox",l3=e=>e instanceof Date,Wr=e=>e==null;const wP=e=>typeof e=="object";var N0=e=>!Wr(e)&&!Array.isArray(e)&&wP(e)&&!l3(e),xP=e=>N0(e)&&e.target?Xl(e.target)?e.target.checked:e.target.value:e,nDe=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,EP=(e,t)=>e.has(nDe(t)),rDe=e=>{const t=e.constructor&&e.constructor.prototype;return N0(t)&&t.hasOwnProperty("isPrototypeOf")},Kp=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function W0(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Kp&&(e instanceof Blob||r))&&(n||N0(e)))if(t=n?[]:{},!n&&!rDe(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=W0(e[o]));else return e;return t}var cd=e=>/^\w*$/.test(e),P0=e=>e===void 0,Qp=e=>Array.isArray(e)?e.filter(Boolean):[],Gp=e=>Qp(e.replace(/["|']|\]/g,"").split(/\.|\[/)),cn=(e,t,n)=>{if(!t||!N0(e))return n;const r=(cd(t)?[t]:Gp(t)).reduce((o,i)=>Wr(o)?o:o[i],e);return P0(r)||r===e?P0(e[t])?n:e[t]:r},R2=e=>typeof e=="boolean",q1=(e,t,n)=>{let r=-1;const o=cd(t)?[t]:Gp(t),i=o.length,a=i-1;for(;++r<i;){const s=o[r];let l=n;if(r!==a){const u=e[s];l=N0(u)||Array.isArray(u)?u:isNaN(+o[r+1])?{}:[]}if(s==="__proto__"||s==="constructor"||s==="prototype")return;e[s]=l,e=e[s]}};const R7={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Lo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},aa={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},_P=B.createContext(null);_P.displayName="HookFormContext";const Yp=()=>B.useContext(_P);var SP=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const a=i;return t._proxyFormState[a]!==Lo.all&&(t._proxyFormState[a]=!r||Lo.all),n&&(n[a]=!0),e[a]}});return o};const Xp=typeof window<"u"?c.useLayoutEffect:c.useEffect;function oDe(e){const t=Yp(),{control:n=t.control,disabled:r,name:o,exact:i}=e||{},[a,s]=B.useState(n._formState),l=B.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Xp(()=>n._subscribe({name:o,formState:l.current,exact:i,callback:u=>{!r&&s({...n._formState,...u})}}),[o,r,i]),B.useEffect(()=>{l.current.isValid&&n._setValid(!0)},[n]),B.useMemo(()=>SP(a,n,l.current,!1),[a,n])}var xi=e=>typeof e=="string",MP=(e,t,n,r,o)=>xi(e)?(r&&t.watch.add(e),cn(n,e,o)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),cn(n,i))):(r&&(t.watchAll=!0),n);function iDe(e){const t=Yp(),{control:n=t.control,name:r,defaultValue:o,disabled:i,exact:a}=e||{},s=B.useRef(o),[l,u]=B.useState(n._getWatch(r,s.current));return Xp(()=>n._subscribe({name:r,formState:{values:!0},exact:a,callback:d=>!i&&u(MP(r,n._names,d.values||n._formValues,!1,s.current))}),[r,n,i,a]),B.useEffect(()=>n._removeUnmounted()),l}function aDe(e){const t=Yp(),{name:n,disabled:r,control:o=t.control,shouldUnregister:i}=e,a=EP(o._names.array,n),s=iDe({control:o,name:n,defaultValue:cn(o._formValues,n,cn(o._defaultValues,n,e.defaultValue)),exact:!0}),l=oDe({control:o,name:n,exact:!0}),u=B.useRef(e),d=B.useRef(o.register(n,{...e.rules,value:s,...R2(e.disabled)?{disabled:e.disabled}:{}})),h=B.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!cn(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!cn(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!cn(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!cn(l.validatingFields,n)},error:{enumerable:!0,get:()=>cn(l.errors,n)}}),[l,n]),C=B.useCallback(p=>d.current.onChange({target:{value:xP(p),name:n},type:R7.CHANGE}),[n]),m=B.useCallback(()=>d.current.onBlur({target:{value:cn(o._formValues,n),name:n},type:R7.BLUR}),[n,o._formValues]),A=B.useCallback(p=>{const w=cn(o._fields,n);w&&p&&(w._f.ref={focus:()=>p.focus&&p.focus(),select:()=>p.select&&p.select(),setCustomValidity:x=>p.setCustomValidity(x),reportValidity:()=>p.reportValidity()})},[o._fields,n]),v=B.useMemo(()=>({name:n,value:s,...R2(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:C,onBlur:m,ref:A}),[n,r,l.disabled,C,m,A,s]);return B.useEffect(()=>{const p=o._options.shouldUnregister||i;o.register(n,{...u.current.rules,...R2(u.current.disabled)?{disabled:u.current.disabled}:{}});const w=(x,E)=>{const S=cn(o._fields,x);S&&S._f&&(S._f.mount=E)};if(w(n,!0),p){const x=W0(cn(o._options.defaultValues,n));q1(o._defaultValues,n,x),P0(cn(o._formValues,n))&&q1(o._formValues,n,x)}return!a&&o.register(n),()=>{(a?p&&!o._state.action:p)?o.unregister(n):w(n,!1)}},[n,o,a,i]),B.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),B.useMemo(()=>({field:v,formState:l,fieldState:h}),[v,l,h])}const ps=e=>e.render(aDe(e));var HP=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},j4=e=>Array.isArray(e)?e:[e],OS=()=>{let e=[];return{get observers(){return e},next:o=>{for(const i of e)i.next&&i.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(i=>i!==o)}}),unsubscribe:()=>{e=[]}}},Ig=e=>Wr(e)||!wP(e);function n9(e,t,n=new WeakSet){if(Ig(e)||Ig(t))return e===t;if(l3(e)&&l3(t))return e.getTime()===t.getTime();const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const i of r){const a=e[i];if(!o.includes(i))return!1;if(i!=="ref"){const s=t[i];if(l3(a)&&l3(s)||N0(a)&&N0(s)||Array.isArray(a)&&Array.isArray(s)?!n9(a,s,n):a!==s)return!1}}return!0}var f2=e=>N0(e)&&!Object.keys(e).length,qp=e=>e.type==="file",Oo=e=>typeof e=="function",D7=e=>{if(!Kp)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},LP=e=>e.type==="select-multiple",Jp=e=>e.type==="radio",sDe=e=>Jp(e)||Xl(e),Rh=e=>D7(e)&&e.isConnected;function lDe(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=P0(e)?r++:e[t[r++]];return e}function cDe(e){for(const t in e)if(e.hasOwnProperty(t)&&!P0(e[t]))return!1;return!0}function V0(e,t){const n=Array.isArray(t)?t:cd(t)?[t]:Gp(t),r=n.length===1?e:lDe(e,n),o=n.length-1,i=n[o];return r&&delete r[i],o!==0&&(N0(r)&&f2(r)||Array.isArray(r)&&cDe(r))&&V0(e,n.slice(0,-1)),e}var OP=e=>{for(const t in e)if(Oo(e[t]))return!0;return!1};function I7(e,t={}){const n=Array.isArray(e);if(N0(e)||n)for(const r in e)Array.isArray(e[r])||N0(e[r])&&!OP(e[r])?(t[r]=Array.isArray(e[r])?[]:{},I7(e[r],t[r])):Wr(e[r])||(t[r]=!0);return t}function BP(e,t,n){const r=Array.isArray(e);if(N0(e)||r)for(const o in e)Array.isArray(e[o])||N0(e[o])&&!OP(e[o])?P0(t)||Ig(n[o])?n[o]=Array.isArray(e[o])?I7(e[o],[]):{...I7(e[o])}:BP(e[o],Wr(t)?{}:t[o],n[o]):n[o]=!n9(e[o],t[o]);return n}var o4=(e,t)=>BP(e,t,I7(t));const BS={value:!1,isValid:!1},kS={value:!0,isValid:!0};var kP=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!P0(e[0].attributes.value)?P0(e[0].value)||e[0].value===""?kS:{value:e[0].value,isValid:!0}:kS:BS}return BS},RP=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>P0(e)?e:t?e===""?NaN:e&&+e:n&&xi(e)?new Date(e):r?r(e):e;const RS={isValid:!1,value:null};var DP=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,RS):RS;function DS(e){const t=e.ref;return qp(t)?t.files:Jp(t)?DP(e.refs).value:LP(t)?[...t.selectedOptions].map(({value:n})=>n):Xl(t)?kP(e.refs).value:RP(P0(t.value)?e.ref.value:t.value,e)}var uDe=(e,t,n,r)=>{const o={};for(const i of e){const a=cn(t,i);a&&q1(o,i,a._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},P7=e=>e instanceof RegExp,i4=e=>P0(e)?e:P7(e)?e.source:N0(e)?P7(e.value)?e.value.source:e.value:e,IS=e=>({isOnSubmit:!e||e===Lo.onSubmit,isOnBlur:e===Lo.onBlur,isOnChange:e===Lo.onChange,isOnAll:e===Lo.all,isOnTouch:e===Lo.onTouched});const PS="AsyncFunction";var dDe=e=>!!e&&!!e.validate&&!!(Oo(e.validate)&&e.validate.constructor.name===PS||N0(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===PS)),fDe=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),TS=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const V4=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const i=cn(e,o);if(i){const{_f:a,...s}=i;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],o)&&!r)return!0;if(a.ref&&t(a.ref,a.name)&&!r)return!0;if(V4(s,t))break}else if(N0(s)&&V4(s,t))break}}};function NS(e,t,n){const r=cn(e,n);if(r||cd(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),a=cn(t,i),s=cn(e,i);if(a&&!Array.isArray(a)&&n!==i)return{name:n};if(s&&s.type)return{name:i,error:s};if(s&&s.root&&s.root.type)return{name:`${i}.root`,error:s.root};o.pop()}return{name:n}}var hDe=(e,t,n,r)=>{n(e);const{name:o,...i}=e;return f2(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(a=>t[a]===(!r||Lo.all))},CDe=(e,t,n)=>!e||!t||e===t||j4(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),gDe=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,mDe=(e,t)=>!Qp(cn(e,t)).length&&V0(e,t),pDe=(e,t,n)=>{const r=j4(cn(e,n));return q1(r,"root",t[n]),q1(e,n,r),e},k8=e=>xi(e);function FS(e,t,n="validate"){if(k8(e)||Array.isArray(e)&&e.every(k8)||R2(e)&&!e)return{type:n,message:k8(e)?e:"",ref:t}}var hs=e=>N0(e)&&!P7(e)?e:{value:e,message:""},jS=async(e,t,n,r,o,i)=>{const{ref:a,refs:s,required:l,maxLength:u,minLength:d,min:h,max:C,pattern:m,validate:A,name:v,valueAsNumber:p,mount:w}=e._f,x=cn(n,v);if(!w||t.has(v))return{};const E=s?s[0]:a,S=T=>{o&&E.reportValidity&&(E.setCustomValidity(R2(T)?"":T||""),E.reportValidity())},_={},M=Jp(a),H=Xl(a),R=M||H,k=(p||qp(a))&&P0(a.value)&&P0(x)||D7(a)&&a.value===""||x===""||Array.isArray(x)&&!x.length,I=HP.bind(null,v,r,_),P=(T,N,F,j=aa.maxLength,z=aa.minLength)=>{const W=T?N:F;_[v]={type:T?j:z,message:W,ref:a,...I(T?j:z,W)}};if(i?!Array.isArray(x)||!x.length:l&&(!R&&(k||Wr(x))||R2(x)&&!x||H&&!kP(s).isValid||M&&!DP(s).isValid)){const{value:T,message:N}=k8(l)?{value:!!l,message:l}:hs(l);if(T&&(_[v]={type:aa.required,message:N,ref:E,...I(aa.required,N)},!r))return S(N),_}if(!k&&(!Wr(h)||!Wr(C))){let T,N;const F=hs(C),j=hs(h);if(!Wr(x)&&!isNaN(x)){const z=a.valueAsNumber||x&&+x;Wr(F.value)||(T=z>F.value),Wr(j.value)||(N=z<j.value)}else{const z=a.valueAsDate||new Date(x),W=K=>new Date(new Date().toDateString()+" "+K),Q=a.type=="time",q=a.type=="week";xi(F.value)&&x&&(T=Q?W(x)>W(F.value):q?x>F.value:z>new Date(F.value)),xi(j.value)&&x&&(N=Q?W(x)<W(j.value):q?x<j.value:z<new Date(j.value))}if((T||N)&&(P(!!T,F.message,j.message,aa.max,aa.min),!r))return S(_[v].message),_}if((u||d)&&!k&&(xi(x)||i&&Array.isArray(x))){const T=hs(u),N=hs(d),F=!Wr(T.value)&&x.length>+T.value,j=!Wr(N.value)&&x.length<+N.value;if((F||j)&&(P(F,T.message,N.message),!r))return S(_[v].message),_}if(m&&!k&&xi(x)){const{value:T,message:N}=hs(m);if(P7(T)&&!x.match(T)&&(_[v]={type:aa.pattern,message:N,ref:a,...I(aa.pattern,N)},!r))return S(N),_}if(A){if(Oo(A)){const T=await A(x,n),N=FS(T,E);if(N&&(_[v]={...N,...I(aa.validate,N.message)},!r))return S(N.message),_}else if(N0(A)){let T={};for(const N in A){if(!f2(T)&&!r)break;const F=FS(await A[N](x,n),E,N);F&&(T={...F,...I(N,F.message)},S(F.message),r&&(_[v]=T))}if(!f2(T)&&(_[v]={ref:E,...T},!r))return _}}return S(!0),_};const ADe={mode:Lo.onSubmit,reValidateMode:Lo.onChange,shouldFocusError:!0};function vDe(e={}){let t={...ADe,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Oo(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=N0(t.defaultValues)||N0(t.values)?W0(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:W0(o),a={action:!1,mount:!1,watch:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let h={...d};const C={array:OS(),state:OS()},m=t.criteriaMode===Lo.all,A=se=>ne=>{clearTimeout(u),u=setTimeout(se,ne)},v=async se=>{if(!t.disabled&&(d.isValid||h.isValid||se)){const ne=t.resolver?f2((await H()).errors):await k(r,!0);ne!==n.isValid&&C.state.next({isValid:ne})}},p=(se,ne)=>{!t.disabled&&(d.isValidating||d.validatingFields||h.isValidating||h.validatingFields)&&((se||Array.from(s.mount)).forEach(me=>{me&&(ne?q1(n.validatingFields,me,ne):V0(n.validatingFields,me))}),C.state.next({validatingFields:n.validatingFields,isValidating:!f2(n.validatingFields)}))},w=(se,ne=[],me,ke,_e=!0,Oe=!0)=>{if(ke&&me&&!t.disabled){if(a.action=!0,Oe&&Array.isArray(cn(r,se))){const Pe=me(cn(r,se),ke.argA,ke.argB);_e&&q1(r,se,Pe)}if(Oe&&Array.isArray(cn(n.errors,se))){const Pe=me(cn(n.errors,se),ke.argA,ke.argB);_e&&q1(n.errors,se,Pe),mDe(n.errors,se)}if((d.touchedFields||h.touchedFields)&&Oe&&Array.isArray(cn(n.touchedFields,se))){const Pe=me(cn(n.touchedFields,se),ke.argA,ke.argB);_e&&q1(n.touchedFields,se,Pe)}(d.dirtyFields||h.dirtyFields)&&(n.dirtyFields=o4(o,i)),C.state.next({name:se,isDirty:P(se,ne),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else q1(i,se,ne)},x=(se,ne)=>{q1(n.errors,se,ne),C.state.next({errors:n.errors})},E=se=>{n.errors=se,C.state.next({errors:n.errors,isValid:!1})},S=(se,ne,me,ke)=>{const _e=cn(r,se);if(_e){const Oe=cn(i,se,P0(me)?cn(o,se):me);P0(Oe)||ke&&ke.defaultChecked||ne?q1(i,se,ne?Oe:DS(_e._f)):F(se,Oe),a.mount&&v()}},_=(se,ne,me,ke,_e)=>{let Oe=!1,Pe=!1;const et={name:se};if(!t.disabled){if(!me||ke){(d.isDirty||h.isDirty)&&(Pe=n.isDirty,n.isDirty=et.isDirty=P(),Oe=Pe!==et.isDirty);const st=n9(cn(o,se),ne);Pe=!!cn(n.dirtyFields,se),st?V0(n.dirtyFields,se):q1(n.dirtyFields,se,!0),et.dirtyFields=n.dirtyFields,Oe=Oe||(d.dirtyFields||h.dirtyFields)&&Pe!==!st}if(me){const st=cn(n.touchedFields,se);st||(q1(n.touchedFields,se,me),et.touchedFields=n.touchedFields,Oe=Oe||(d.touchedFields||h.touchedFields)&&st!==me)}Oe&&_e&&C.state.next(et)}return Oe?et:{}},M=(se,ne,me,ke)=>{const _e=cn(n.errors,se),Oe=(d.isValid||h.isValid)&&R2(ne)&&n.isValid!==ne;if(t.delayError&&me?(l=A(()=>x(se,me)),l(t.delayError)):(clearTimeout(u),l=null,me?q1(n.errors,se,me):V0(n.errors,se)),(me?!n9(_e,me):_e)||!f2(ke)||Oe){const Pe={...ke,...Oe&&R2(ne)?{isValid:ne}:{},errors:n.errors,name:se};n={...n,...Pe},C.state.next(Pe)}},H=async se=>{p(se,!0);const ne=await t.resolver(i,t.context,uDe(se||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return p(se),ne},R=async se=>{const{errors:ne}=await H(se);if(se)for(const me of se){const ke=cn(ne,me);ke?q1(n.errors,me,ke):V0(n.errors,me)}else n.errors=ne;return ne},k=async(se,ne,me={valid:!0})=>{for(const ke in se){const _e=se[ke];if(_e){const{_f:Oe,...Pe}=_e;if(Oe){const et=s.array.has(Oe.name),st=_e._f&&dDe(_e._f);st&&d.validatingFields&&p([ke],!0);const tt=await jS(_e,s.disabled,i,m,t.shouldUseNativeValidation&&!ne,et);if(st&&d.validatingFields&&p([ke]),tt[Oe.name]&&(me.valid=!1,ne))break;!ne&&(cn(tt,Oe.name)?et?pDe(n.errors,tt,Oe.name):q1(n.errors,Oe.name,tt[Oe.name]):V0(n.errors,Oe.name))}!f2(Pe)&&await k(Pe,ne,me)}}return me.valid},I=()=>{for(const se of s.unMount){const ne=cn(r,se);ne&&(ne._f.refs?ne._f.refs.every(me=>!Rh(me)):!Rh(ne._f.ref))&&he(se)}s.unMount=new Set},P=(se,ne)=>!t.disabled&&(se&&ne&&q1(i,se,ne),!n9(K(),o)),T=(se,ne,me)=>MP(se,s,{...a.mount?i:P0(ne)?o:xi(se)?{[se]:ne}:ne},me,ne),N=se=>Qp(cn(a.mount?i:o,se,t.shouldUnregister?cn(o,se,[]):[])),F=(se,ne,me={})=>{const ke=cn(r,se);let _e=ne;if(ke){const Oe=ke._f;Oe&&(!Oe.disabled&&q1(i,se,RP(ne,Oe)),_e=D7(Oe.ref)&&Wr(ne)?"":ne,LP(Oe.ref)?[...Oe.ref.options].forEach(Pe=>Pe.selected=_e.includes(Pe.value)):Oe.refs?Xl(Oe.ref)?Oe.refs.forEach(Pe=>{(!Pe.defaultChecked||!Pe.disabled)&&(Array.isArray(_e)?Pe.checked=!!_e.find(et=>et===Pe.value):Pe.checked=_e===Pe.value||!!_e)}):Oe.refs.forEach(Pe=>Pe.checked=Pe.value===_e):qp(Oe.ref)?Oe.ref.value="":(Oe.ref.value=_e,Oe.ref.type||C.state.next({name:se,values:W0(i)})))}(me.shouldDirty||me.shouldTouch)&&_(se,_e,me.shouldTouch,me.shouldDirty,!0),me.shouldValidate&&q(se)},j=(se,ne,me)=>{for(const ke in ne){if(!ne.hasOwnProperty(ke))return;const _e=ne[ke],Oe=se+"."+ke,Pe=cn(r,Oe);(s.array.has(se)||N0(_e)||Pe&&!Pe._f)&&!l3(_e)?j(Oe,_e,me):F(Oe,_e,me)}},z=(se,ne,me={})=>{const ke=cn(r,se),_e=s.array.has(se),Oe=W0(ne);q1(i,se,Oe),_e?(C.array.next({name:se,values:W0(i)}),(d.isDirty||d.dirtyFields||h.isDirty||h.dirtyFields)&&me.shouldDirty&&C.state.next({name:se,dirtyFields:o4(o,i),isDirty:P(se,Oe)})):ke&&!ke._f&&!Wr(Oe)?j(se,Oe,me):F(se,Oe,me),TS(se,s)&&C.state.next({...n}),C.state.next({name:a.mount?se:void 0,values:W0(i)})},W=async se=>{a.mount=!0;const ne=se.target;let me=ne.name,ke=!0;const _e=cn(r,me),Oe=st=>{ke=Number.isNaN(st)||l3(st)&&isNaN(st.getTime())||n9(st,cn(i,me,st))},Pe=IS(t.mode),et=IS(t.reValidateMode);if(_e){let st,tt;const gt=ne.type?DS(_e._f):xP(se),Ke=se.type===R7.BLUR||se.type===R7.FOCUS_OUT,Ne=!fDe(_e._f)&&!t.resolver&&!cn(n.errors,me)&&!_e._f.deps||gDe(Ke,cn(n.touchedFields,me),n.isSubmitted,et,Pe),pt=TS(me,s,Ke);q1(i,me,gt),Ke?(_e._f.onBlur&&_e._f.onBlur(se),l&&l(0)):_e._f.onChange&&_e._f.onChange(se);const Ge=_(me,gt,Ke),Qe=!f2(Ge)||pt;if(!Ke&&C.state.next({name:me,type:se.type,values:W0(i)}),Ne)return(d.isValid||h.isValid)&&(t.mode==="onBlur"?Ke&&v():Ke||v()),Qe&&C.state.next({name:me,...pt?{}:Ge});if(!Ke&&pt&&C.state.next({...n}),t.resolver){const{errors:nt}=await H([me]);if(Oe(gt),ke){const je=NS(n.errors,r,me),dt=NS(nt,r,je.name||me);st=dt.error,me=dt.name,tt=f2(nt)}}else p([me],!0),st=(await jS(_e,s.disabled,i,m,t.shouldUseNativeValidation))[me],p([me]),Oe(gt),ke&&(st?tt=!1:(d.isValid||h.isValid)&&(tt=await k(r,!0)));ke&&(_e._f.deps&&q(_e._f.deps),M(me,tt,st,Ge))}},Q=(se,ne)=>{if(cn(n.errors,ne)&&se.focus)return se.focus(),1},q=async(se,ne={})=>{let me,ke;const _e=j4(se);if(t.resolver){const Oe=await R(P0(se)?se:_e);me=f2(Oe),ke=se?!_e.some(Pe=>cn(Oe,Pe)):me}else se?(ke=(await Promise.all(_e.map(async Oe=>{const Pe=cn(r,Oe);return await k(Pe&&Pe._f?{[Oe]:Pe}:Pe)}))).every(Boolean),!(!ke&&!n.isValid)&&v()):ke=me=await k(r);return C.state.next({...!xi(se)||(d.isValid||h.isValid)&&me!==n.isValid?{}:{name:se},...t.resolver||!se?{isValid:me}:{},errors:n.errors}),ne.shouldFocus&&!ke&&V4(r,Q,se?_e:s.mount),ke},K=se=>{const ne={...a.mount?i:o};return P0(se)?ne:xi(se)?cn(ne,se):se.map(me=>cn(ne,me))},$=(se,ne)=>({invalid:!!cn((ne||n).errors,se),isDirty:!!cn((ne||n).dirtyFields,se),error:cn((ne||n).errors,se),isValidating:!!cn(n.validatingFields,se),isTouched:!!cn((ne||n).touchedFields,se)}),Y=se=>{se&&j4(se).forEach(ne=>V0(n.errors,ne)),C.state.next({errors:se?n.errors:{}})},X=(se,ne,me)=>{const ke=(cn(r,se,{_f:{}})._f||{}).ref,_e=cn(n.errors,se)||{},{ref:Oe,message:Pe,type:et,...st}=_e;q1(n.errors,se,{...st,...ne,ref:ke}),C.state.next({name:se,errors:n.errors,isValid:!1}),me&&me.shouldFocus&&ke&&ke.focus&&ke.focus()},J=(se,ne)=>Oo(se)?C.state.subscribe({next:me=>se(T(void 0,ne),me)}):T(se,ne,!0),ee=se=>C.state.subscribe({next:ne=>{CDe(se.name,ne.name,se.exact)&&hDe(ne,se.formState||d,$e,se.reRenderRoot)&&se.callback({values:{...i},...n,...ne})}}).unsubscribe,ie=se=>(a.mount=!0,h={...h,...se.formState},ee({...se,formState:h})),he=(se,ne={})=>{for(const me of se?j4(se):s.mount)s.mount.delete(me),s.array.delete(me),ne.keepValue||(V0(r,me),V0(i,me)),!ne.keepError&&V0(n.errors,me),!ne.keepDirty&&V0(n.dirtyFields,me),!ne.keepTouched&&V0(n.touchedFields,me),!ne.keepIsValidating&&V0(n.validatingFields,me),!t.shouldUnregister&&!ne.keepDefaultValue&&V0(o,me);C.state.next({values:W0(i)}),C.state.next({...n,...ne.keepDirty?{isDirty:P()}:{}}),!ne.keepIsValid&&v()},le=({disabled:se,name:ne})=>{(R2(se)&&a.mount||se||s.disabled.has(ne))&&(se?s.disabled.add(ne):s.disabled.delete(ne))},ye=(se,ne={})=>{let me=cn(r,se);const ke=R2(ne.disabled)||R2(t.disabled);return q1(r,se,{...me||{},_f:{...me&&me._f?me._f:{ref:{name:se}},name:se,mount:!0,...ne}}),s.mount.add(se),me?le({disabled:R2(ne.disabled)?ne.disabled:t.disabled,name:se}):S(se,!0,ne.value),{...ke?{disabled:ne.disabled||t.disabled}:{},...t.progressive?{required:!!ne.required,min:i4(ne.min),max:i4(ne.max),minLength:i4(ne.minLength),maxLength:i4(ne.maxLength),pattern:i4(ne.pattern)}:{},name:se,onChange:W,onBlur:W,ref:_e=>{if(_e){ye(se,ne),me=cn(r,se);const Oe=P0(_e.value)&&_e.querySelectorAll&&_e.querySelectorAll("input,select,textarea")[0]||_e,Pe=sDe(Oe),et=me._f.refs||[];if(Pe?et.find(st=>st===Oe):Oe===me._f.ref)return;q1(r,se,{_f:{...me._f,...Pe?{refs:[...et.filter(Rh),Oe,...Array.isArray(cn(o,se))?[{}]:[]],ref:{type:Oe.type,name:se}}:{ref:Oe}}}),S(se,!1,void 0,Oe)}else me=cn(r,se,{}),me._f&&(me._f.mount=!1),(t.shouldUnregister||ne.shouldUnregister)&&!(EP(s.array,se)&&a.action)&&s.unMount.add(se)}}},xe=()=>t.shouldFocusError&&V4(r,Q,s.mount),Ae=se=>{R2(se)&&(C.state.next({disabled:se}),V4(r,(ne,me)=>{const ke=cn(r,me);ke&&(ne.disabled=ke._f.disabled||se,Array.isArray(ke._f.refs)&&ke._f.refs.forEach(_e=>{_e.disabled=ke._f.disabled||se}))},0,!1))},de=(se,ne)=>async me=>{let ke;me&&(me.preventDefault&&me.preventDefault(),me.persist&&me.persist());let _e=W0(i);if(C.state.next({isSubmitting:!0}),t.resolver){const{errors:Oe,values:Pe}=await H();n.errors=Oe,_e=W0(Pe)}else await k(r);if(s.disabled.size)for(const Oe of s.disabled)V0(_e,Oe);if(V0(n.errors,"root"),f2(n.errors)){C.state.next({errors:{}});try{await se(_e,me)}catch(Oe){ke=Oe}}else ne&&await ne({...n.errors},me),xe(),setTimeout(xe);if(C.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:f2(n.errors)&&!ke,submitCount:n.submitCount+1,errors:n.errors}),ke)throw ke},ce=(se,ne={})=>{cn(r,se)&&(P0(ne.defaultValue)?z(se,W0(cn(o,se))):(z(se,ne.defaultValue),q1(o,se,W0(ne.defaultValue))),ne.keepTouched||V0(n.touchedFields,se),ne.keepDirty||(V0(n.dirtyFields,se),n.isDirty=ne.defaultValue?P(se,W0(cn(o,se))):P()),ne.keepError||(V0(n.errors,se),d.isValid&&v()),C.state.next({...n}))},Ce=(se,ne={})=>{const me=se?W0(se):o,ke=W0(me),_e=f2(se),Oe=_e?o:ke;if(ne.keepDefaultValues||(o=me),!ne.keepValues){if(ne.keepDirtyValues){const Pe=new Set([...s.mount,...Object.keys(o4(o,i))]);for(const et of Array.from(Pe))cn(n.dirtyFields,et)?q1(Oe,et,cn(i,et)):z(et,cn(Oe,et))}else{if(Kp&&P0(se))for(const Pe of s.mount){const et=cn(r,Pe);if(et&&et._f){const st=Array.isArray(et._f.refs)?et._f.refs[0]:et._f.ref;if(D7(st)){const tt=st.closest("form");if(tt){tt.reset();break}}}}if(ne.keepFieldsRef)for(const Pe of s.mount)z(Pe,cn(Oe,Pe));else r={}}i=t.shouldUnregister?ne.keepDefaultValues?W0(o):{}:W0(Oe),C.array.next({values:{...Oe}}),C.state.next({values:{...Oe}})}s={mount:ne.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!d.isValid||!!ne.keepIsValid||!!ne.keepDirtyValues,a.watch=!!t.shouldUnregister,C.state.next({submitCount:ne.keepSubmitCount?n.submitCount:0,isDirty:_e?!1:ne.keepDirty?n.isDirty:!!(ne.keepDefaultValues&&!n9(se,o)),isSubmitted:ne.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:_e?{}:ne.keepDirtyValues?ne.keepDefaultValues&&i?o4(o,i):n.dirtyFields:ne.keepDefaultValues&&se?o4(o,se):ne.keepDirty?n.dirtyFields:{},touchedFields:ne.keepTouched?n.touchedFields:{},errors:ne.keepErrors?n.errors:{},isSubmitSuccessful:ne.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},we=(se,ne)=>Ce(Oo(se)?se(i):se,ne),Se=(se,ne={})=>{const me=cn(r,se),ke=me&&me._f;if(ke){const _e=ke.refs?ke.refs[0]:ke.ref;_e.focus&&(_e.focus(),ne.shouldSelect&&Oo(_e.select)&&_e.select())}},$e=se=>{n={...n,...se}},Xe={control:{register:ye,unregister:he,getFieldState:$,handleSubmit:de,setError:X,_subscribe:ee,_runSchema:H,_focusError:xe,_getWatch:T,_getDirty:P,_setValid:v,_setFieldArray:w,_setDisabledField:le,_setErrors:E,_getFieldArray:N,_reset:Ce,_resetDefaultValues:()=>Oo(t.defaultValues)&&t.defaultValues().then(se=>{we(se,t.resetOptions),C.state.next({isLoading:!1})}),_removeUnmounted:I,_disableForm:Ae,_subjects:C,_proxyFormState:d,get _fields(){return r},get _formValues(){return i},get _state(){return a},set _state(se){a=se},get _defaultValues(){return o},get _names(){return s},set _names(se){s=se},get _formState(){return n},get _options(){return t},set _options(se){t={...t,...se}}},subscribe:ie,trigger:q,register:ye,handleSubmit:de,watch:J,setValue:z,getValues:K,reset:we,resetField:ce,clearErrors:Y,unregister:he,setError:X,setFocus:Se,getFieldState:$};return{...Xe,formControl:Xe}}function IP(e={}){const t=B.useRef(void 0),n=B.useRef(void 0),[r,o]=B.useState({isDirty:!1,isValidating:!1,isLoading:Oo(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Oo(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Oo(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...s}=vDe(e);t.current={...s,formState:r}}const i=t.current.control;return i._options=e,Xp(()=>{const a=i._subscribe({formState:i._proxyFormState,callback:()=>o({...i._formState}),reRenderRoot:!0});return o(s=>({...s,isReady:!0})),i._formState.isReady=!0,a},[i]),B.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),B.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),B.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),B.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),B.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==r.isDirty&&i._subjects.state.next({isDirty:a})}},[i,r.isDirty]),B.useEffect(()=>{e.values&&!n9(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),n.current=e.values,o(a=>({...a}))):i._resetDefaultValues()},[i,e.values]),B.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=SP(r,i),t.current}const bDe={s:"xs",m:"s",l:"m"},eA=({options:e,onChange:t,value:n,placeholder:r="Select Items...",triggerHighlightColor:o,triggerBackgroundColor:i,menuBackgroundColor:a,menuActiveColor:s,menuHoverColor:l,borderColor:u,disabled:d=!1,searchable:h=!0,maxTagCount:C="responsive",maxCount:m,suffixIcon:A=!0,allowClear:v=!1,title:p="",width:w="300px",height:x="m",id:E="",className:S="",textColor:_,textSize:M="s"})=>(M=M??bDe[x],V.jsx(La,{id:E,allowClear:v,disabled:d,showSearch:h,className:`multi_select_container ${S} h_${x} text_${M}`,mode:"multiple",style:{width:w,"--c_trigger_highlight":o,"--c_trigger_background":i,"--c_menu_background":a,"--c_menu_active":s,"--c_menu_hover":l,"--c_border":u,"--c_text_primary":_},suffixIcon:A?void 0:null,options:e,placeholder:r,onChange:t,popupClassName:`multi_select_dropdown h_${x} text_${M}`,value:n,filterOption:(H,R)=>((R==null?void 0:R.label)??"").toLowerCase().includes(H.toLowerCase()),title:p,maxCount:m,maxTagCount:C,maxTagPlaceholder:H=>V.jsx(A9,{styles:{root:{pointerEvents:"none"}},title:H.map(({label:R})=>R).join(", "),children:V.jsxs("span",{children:["+",H.length]})})})),PP=({value:e=!1,disabled:t=!1,checkedChildren:n,unCheckedChildren:r,onChange:o=()=>{},loading:i=!1,uncheckedBackgroundColor:a="#29292955",checkedBackgroundColor:s="#ffcc00",disabledBackgroundColor:l="#29292929"})=>{const[u,d]=B.useState(e),h=e!==void 0,C=h?e:u,m=A=>{h||d(A),o==null||o(A)};return V.jsx(Du,{checked:C,onChange:m,disabled:t,loading:i,checkedChildren:n,unCheckedChildren:r,style:{backgroundColor:t||i?l:C?s:a}})},yDe=({width:e="100%",height:t="100%",elementSize:n="m",className:r="",bannerImage:o,showAwirosLogo:i,title:a,description:s,headerImage:l,headerImageMargin:u,formConfig:d,formSchema:h,formSubmitDisclaimer:C,formSubmitButtonText:m,formSubmitLoading:A,onSubmit:v=()=>{},footerItems:p,footerImage:w,footerImageMargin:x})=>{const{control:E,handleSubmit:S,formState:{errors:_}}=IP({resolver:h}),[M,H]=B.useState(!1),R=S(P=>v(P)),k=({name:P,type:T,width:N,placeholder:F,options:j})=>{switch(T){case"input":return V.jsx(ps,{control:E,name:P,render:({field:{onChange:z,value:W}})=>V.jsx(x9,{width:N,onChange:z,value:W,placeholder:F,height:n})});case"select":return V.jsx(ps,{control:E,name:P,render:({field:{onChange:z,value:W}})=>V.jsx(Ql,{options:j,width:N,onChange:z,value:W,placeholder:F,height:n})});case"multiselect":return V.jsx(ps,{control:E,name:P,render:({field:{onChange:z,value:W}})=>V.jsx(eA,{options:j,width:N,onChange:z,value:W,placeholder:F,height:n})});case"checkbox":return V.jsx(ps,{control:E,name:P,render:({field:{onChange:z,value:W}})=>V.jsx(PP,{onChange:z,value:W})});case"password":return V.jsx(ps,{control:E,name:P,render:({field:{onChange:z,value:W}})=>V.jsxs("div",{className:"password_input",style:{width:N},children:[V.jsx(x9,{width:N,onChange:z,value:W,placeholder:F,height:n,type:M?"text":"password"}),V.jsx(Gr,{name:M?"eye_closed":"eye",className:"toggle_icon",onClick:()=>H(Q=>!Q)})]})})}},I=P=>{var N;const T=(N=_==null?void 0:_[P])==null?void 0:N.message;return typeof T=="string"?String(T):null};return V.jsxs("div",{className:`awi_login_page ${r||""}`,style:{width:e,height:t},children:[V.jsxs("span",{className:`login_page_banner ${o?"has_banner":"no_banner"}`,children:[i?V.jsx(Gr,{name:"awirosLogo",className:"awiros_logo",size:"auto"}):V.jsx(V.Fragment,{}),V.jsx("img",{src:o,alt:"banner",className:"login_banner_image"})]}),V.jsxs("span",{className:`login_page_main ${o?"has_banner":"no_banner"}`,children:[l?V.jsx("img",{src:l,alt:"header image",className:"login_header_image",style:{top:u}}):V.jsx(V.Fragment,{}),V.jsxs("form",{className:"login_form",children:[V.jsxs("header",{className:"login_form_header",children:[a?V.jsx("h2",{children:a}):V.jsx(V.Fragment,{}),s?V.jsx("p",{children:s}):V.jsx(V.Fragment,{})]}),V.jsx("main",{className:"login_form_body",children:d?Object.entries(d).map(([P,T])=>V.jsxs("div",{className:"login_form_element",children:[V.jsxs("p",{children:[T==null?void 0:T.label," ",T!=null&&T.required?V.jsx("mark",{className:"form_item_required",children:"•"}):null]}),k({name:P,type:(T==null?void 0:T.type)??"input",width:T==null?void 0:T.width,placeholder:T==null?void 0:T.placeholder,options:T==null?void 0:T.options}),I(P)?V.jsx("p",{className:"form_error_message",children:I(P)}):null]},P)):V.jsx(V.Fragment,{})}),V.jsxs("footer",{className:"login_form_footer",children:[V.jsx($0,{type:"submit",content:m,loading:A,onClick:R,width:"100%",size:n}),C?V.jsx("p",{children:C}):V.jsx(V.Fragment,{}),p||V.jsx(V.Fragment,{})]})]}),w?V.jsx("img",{src:w,alt:"footer image",className:"login_footer_image",style:{bottom:x}}):V.jsx(V.Fragment,{})]})]})},wDe={lat:20.5937,lng:78.9629},xDe=5,EDe={osm:{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:'© <a href="https://osm.org/copyright">OpenStreetMap</a> contributors'}},_De={defaultZoom:xDe,defaultCenter:wDe,defaultMapProvider:EDe.osm},SDe=B.forwardRef(({position:e,children:t,src:n,...r},o)=>V.jsx(CP,{position:e,icon:n?AP(n):pP,draggable:!1,ref:o,...r,children:t})),MDe=({mapConfig:e=_De,items:t,width:n="500px",height:r="500px",showCardPopup:o=!0,showCountPopup:i=!0,showNavigation:a=!0,fitBoundsToItems:s=!1,onCountPopupClick:l=()=>{},navClassName:u,navButtonColor:d,className:h,focusedIndex:C,onFocusedIndexChange:m,onClickAway:A})=>{const[v,p]=B.useState(!1),[w,x]=B.useState(null),E=C!==void 0,S=E?C:w;B.useEffect(()=>{p(!0)},[]);const _=()=>{const F=((S??0)-1+(t==null?void 0:t.length))%(t==null?void 0:t.length);E&&m?m(F):x(F)},M=()=>{const F=((S??0)+1)%(t==null?void 0:t.length);E&&m?m(F):x(F)},H=B.useMemo(()=>S==null?null:t==null?void 0:t[S],[t,S]),R=B.useRef(null),k=B.useRef({});B.useEffect(()=>{if(!v)return;const F=requestAnimationFrame(()=>{R.current=S!=null?k.current[S]??null:null,i&&Object.entries(k.current).forEach(([j,z])=>{Number(j)===S||z==null||z.openPopup()}),S!=null&&k.current[S]&&k.current[S].openPopup()});return()=>cancelAnimationFrame(F)},[S,v]);const I=B.useRef(null);B.useEffect(()=>{const F=I.current;F&&(H!=null&&H.position)&&F.setView(H.position,F.getZoom(),{animate:!0})},[H,v]);const[P,T]=B.useState(e==null?void 0:e.defaultCenter);if(B.useEffect(()=>{S&&P&&T(H==null?void 0:H.position)},[H]),typeof window>"u"||!v)return null;const N=d||"var(--awi-color-common-highlight, #ffcc00)";return V.jsxs("div",{className:`map_view_container ${h}`,style:{width:n,height:r},children:[V.jsxs(hP,{center:P,zoom:e==null?void 0:e.defaultZoom,className:"static_map",zoomControl:!1,style:{width:"100%",height:"100%"},children:[V.jsx(mRe,{url:e==null?void 0:e.defaultMapProvider.url,attribution:e==null?void 0:e.defaultMapProvider.attribution}),V.jsx(vP,{mapRef:I}),s?V.jsx(ARe,{items:t}):null,V.jsx(mP,{position:"bottomright"}),t==null?void 0:t.map((F,j)=>{const z=j===S;return V.jsx(SDe,{position:F==null?void 0:F.position,ref:W=>{W&&(k.current[j]=W)},eventHandlers:{click:()=>{E&&m?m(j):x(j)}},src:(F==null?void 0:F.icon)??"",children:o||i?V.jsx(gP,{closeButton:!1,autoPan:!1,autoClose:!1,closeOnClick:z&&o,className:z&&o?"card_popup":i?"count_popup":"",eventHandlers:{remove:()=>{E&&m?m(null):x(null),z&&A&&A()}},children:z&&o&&(F!=null&&F.element)?F.element:i&&(F!=null&&F.count)?V.jsx("p",{onClick:l,children:F.count}):null},z?`focused-${j}`:`count-${j}`):V.jsx(V.Fragment,{})},j)})]}),a?V.jsxs("div",{className:`map_view_nav_container ${u??""}`,children:[V.jsx($0,{variant:"primary",onClick:_,size:"s",icon:"leftArrow",backgroundColor:N,borderColor:N,title:"Previous"}),V.jsx($0,{variant:"primary",onClick:M,size:"s",icon:"rightArrow",iconPosition:"after",backgroundColor:N,borderColor:N,title:"Next"})]}):null]})},HDe=({className:e,style:t,...n})=>{const r=`menu ${e||""}`.trim();return V.jsx(S9,{className:r,style:t,...n})},LDe={xs:"16.67%",s:"25%",m:"37.5%",l:"53.54%",xl:"75%",full:"100%"},ODe=({visible:e,onClose:t,showCloseButton:n=!0,size:r="xl",children:o})=>V.jsx(fo,{open:e,onCancel:t,footer:null,closable:n,maskClosable:!0,destroyOnClose:!0,width:LDe[r],children:o}),BDe=({size:e="m",width:t="12rem",onChange:n,value:r,format:o="MMM YYYY",className:i="",popupClassName:a=""})=>{const s=r?D1(r[0]):void 0,l=u=>{const d=u==null?void 0:u.startOf("month").startOf("day").toDate(),h=u==null?void 0:u.endOf("month").endOf("day").toDate();n&&n([d,h])};return V.jsx(Oa,{onChange:l,picker:"month",className:`awi_month_picker size_${e} ${i}`,popupClassName:`awi_month_picker_popup ${a}`,format:o,value:s,style:{width:t}})},kDe=({totalPages:e,currentPage:t,onPageChange:n,onNext:r,onPrev:o,color:i,size:a,width:s,inputWidth:l,showPages:u=!0,showArrows:d=!0,className:h})=>{const[C,m]=B.useState(t);B.useEffect(()=>{m(t)},[t]);const A=p=>{const w=parseInt(p.target.value);isNaN(w)||m(w)},v=(p,w)=>{p.key==="Enter"&&n(w)};return V.jsxs("div",{className:"paginator "+(h||""),style:{width:s},children:[u?V.jsxs("span",{className:"paginator_current_page "+(u&&!d?"full_pagination":""),children:[V.jsx(x9,{type:"number",min:1,max:e,height:a||"s",width:l??"5rem",title:`${C}`,value:C,onChange:A,onKeyDown:p=>v(p,C)}),V.jsx(x9,{type:"number",min:1,max:e,height:a||"s",width:l??"5rem",value:e,title:`${e}`,disabled:!0})]}):V.jsx(V.Fragment,{}),d?V.jsxs("span",{className:"paginator_arrows "+(!u&&d?"full_pagination":""),children:[V.jsx($0,{variant:"secondary",size:a||"s",icon:"arrowLeft",width:"2.5rem",backgroundColor:i,onClick:o,disabled:t===1}),V.jsx($0,{variant:"secondary",size:a||"s",icon:"arrowRight",width:"2.5rem",backgroundColor:i,onClick:r,disabled:t===e})]}):V.jsx(V.Fragment,{})]})},RDe=({children:e,borderColor:t,backgroundColor:n,...r})=>V.jsx(bu,{styles:{root:{"--c_border_color":t,"--c_background_color":n}},trigger:r.trigger??"hover",...r,children:e}),DDe=[{label:"Off",value:1/0},{label:"5s",value:5e3},{label:"10s",value:1e4},{label:"15s",value:15e3},{label:"30s",value:3e4},{label:"1m",value:6e4},{label:"2m",value:12e4},{label:"4m",value:24e4},{label:"5m",value:3e5},{label:"10m",value:6e5},{label:"15m",value:9e5},{label:"30m",value:18e5},{label:"1h",value:36e5}],Cs={s:16,m:24,l:32},IDe=({intervals:e=DDe,onRefresh:t,backgroundColor:n,borderColor:r,size:o="m",selectWidth:i="6rem",buttonWidth:a="6rem",showText:s=!0,loading:l,disabled:u,textColor:d})=>{const[h,C]=B.useState(void 0),[m,A]=B.useState(0),v=B.useRef(null),p=B.useRef(null),w=()=>{t(),A(0)},x=h!=null&&h!=1/0&&h!=0;B.useEffect(()=>{if(x){v.current&&clearInterval(v.current),p.current&&clearInterval(p.current),v.current=setInterval(w,h);const S=200;p.current=setInterval(()=>{A(_=>_+S>Number(h)?S:_+S)},S)}return()=>{v.current&&clearInterval(v.current),p.current&&clearInterval(p.current)}},[h]);const E=h!==void 0?100-m/h*100:0;return V.jsx("div",{className:"awi_auto_refresh",style:{"--c_refresh_bg":n,"--c_refresh_border":r},children:l?V.jsx(Nu,{}):V.jsxs(V.Fragment,{children:[x?V.jsx(ck,{type:"circle",percent:Math.min(E,100),size:Cs==null?void 0:Cs[o],strokeWidth:8,strokeColor:r||"#ffcc00",format:()=>"",className:"awi_auto_refresh_progress"}):V.jsx("div",{style:{width:`${Cs==null?void 0:Cs[o]}px`}}),V.jsx(Ql,{className:"awi_auto_refresh_select",options:e.map(S=>({label:S.label,value:S.value})),value:h,onChange:S=>{C(S),A(0)},placeholder:"Off",triggerBackgroundColor:n,borderColor:r,width:i,height:o,searchable:!1,textColor:d,title:"Auto refresh interval",disabled:u}),V.jsx($0,{className:"awi_auto_refresh_button",width:a,content:s?"Refresh":void 0,variant:"primary",icon:"refresh",size:o,onClick:w,backgroundColor:n,borderColor:r,disabled:u})]})})},PDe=({currentSection:e,currentSubSection:t,height:n="30rem",width:r="16rem",collapsedWidth:o="5.5rem",config:i,isOpen:a,onToggle:s,loading:l})=>{var A,v,p,w,x;const[u,d]=B.useState(!0),h=a??u,C=()=>{const E=!h;d(E),s==null||s(E)},m=()=>V.jsxs("div",{className:"awi_sidebar_skeleton",children:[V.jsxs("div",{className:"awi_sidebar_skeleton_header",children:[V.jsx("div",{className:"awi_sidebar_skeleton_logo"}),V.jsx("div",{className:"awi_sidebar_skeleton_toggle"})]}),V.jsx("div",{className:"awi_sidebar_skeleton_body",children:[1,2,3].map((E,S)=>V.jsxs("div",{className:"awi_sidebar_skeleton_item",children:[V.jsx("div",{className:"awi_sidebar_skeleton_icon"}),h&&V.jsx("div",{className:"awi_sidebar_skeleton_text"})]},S))}),V.jsx("div",{className:"awi_sidebar_skeleton_dynamic",children:[1,2].map((E,S)=>V.jsxs("div",{className:"awi_sidebar_skeleton_item",children:[V.jsx("div",{className:"awi_sidebar_skeleton_icon"}),h&&V.jsx("div",{className:"awi_sidebar_skeleton_text"})]},S))}),V.jsxs("div",{className:"awi_sidebar_skeleton_footer",children:[V.jsx("div",{className:"awi_sidebar_skeleton_avatar"}),h&&V.jsxs("div",{className:"awi_sidebar_skeleton_footer_content",children:[V.jsx("div",{className:"awi_sidebar_skeleton_title"}),V.jsx("div",{className:"awi_sidebar_skeleton_subtitle"})]})]})]});return V.jsx("span",{className:`awi_sidebar ${h?"open":"closed"} ${l?"loading":""}`,style:{height:n,"--sidebar-width":r,"--sidebar-collapsed-width":o},children:l?V.jsx(m,{}):V.jsxs(V.Fragment,{children:[V.jsxs("header",{className:"awi_sidebar_header",children:[h?V.jsx(Gr,{name:i.header.logo,size:"auto",className:"awi_sidebar_logo open",onClick:i.header.logoClickAction}):V.jsx(Gr,{size:"auto",name:i.header.logoCollapsed,className:"awi_sidebar_logo closed",onClick:i.header.logoClickAction}),V.jsx(Gr,{name:h?"sidebarClose":"sidebarOpen",className:`awi_sidebar_close_icon ${h?"open":"closed"}`,onClick:C})]}),V.jsx("main",{className:`awi_sidebar_body ${h?"open":"closed"}`,children:i.body.static.map((E,S)=>V.jsx("div",{className:"awi_sidebar_nav_container",children:V.jsx($0,{variant:e==E.key?"primary":"nav",size:"l",gap:h?"0.25rem":"0",width:h?"100%":"max-content",borderColor:"var(--awi-color-sidebar-button-border, #FFCC00)",backgroundColor:"var(--awi-color-sidebar-button-background, #FFCC00)",textColor:"var(--awi-color-sidebar-button-text, #292929)",icon:E.icon,placement:"flex-start",content:h?E.title:void 0,onClick:E.action,title:(E==null?void 0:E.hoverTitle)||""},S)}))}),V.jsx("div",{className:"awi_sidebar_content_dynamic",children:(A=i.body.dynamic)!=null&&A[e]?(p=(v=i.body.dynamic)==null?void 0:v[e])==null?void 0:p.map((E,S)=>V.jsx("div",{className:"awi_sidebar_nav_container",children:V.jsx($0,{variant:t==E.key?"primary":"secondary",size:"m",gap:h?"0.25rem":"0",width:h?"100%":"max-content",borderColor:"var(--awi-color-sidebar-button-border, #FFCC00)",backgroundColor:"var(--awi-color-sidebar-button-background, #FFCC00)",textColor:"var(--awi-color-sidebar-button-text, #292929)",icon:E.icon,placement:"flex-start",content:h?E.title:void 0,onClick:E.action,title:(E==null?void 0:E.hoverTitle)||""},S)})):V.jsx(V.Fragment,{})}),V.jsxs("footer",{className:`awi_sidebar_footer ${e==i.footer.key?"active":""}`,onClick:i.footer.action,children:[((x=(w=i==null?void 0:i.footer)==null?void 0:w.image)==null?void 0:x.length)>0&&V.jsx("img",{src:i.footer.image,alt:"Footer or Profile Image"}),V.jsxs("div",{className:"awi_sidebar_footer_content "+(h?"open":"closed"),children:[V.jsx("p",{className:"title",children:i.footer.title}),V.jsx("p",{className:"description",children:i.footer.description})]})]})]})})},TDe={xs:32,s:40,m:48,l:56,xl:64},NDe=({headerBackgroundColor:e,bodyBackgroundColor:t,titleBackgroundColor:n,footerBackgroundColor:r,title:o,footer:i,width:a,height:s,size:l="m",containerClassName:u="",className:d="",...h})=>{const{height:C,containerRef:m}=w8(),{height:A,containerRef:v}=w8(),{height:p,containerRef:w}=w8(),x=TDe[l];return V.jsx("div",{className:`awi_table_container ${u}`,style:{width:a,height:s},ref:m,children:V.jsx(Ti,{...h,className:`awi_table ${l} ${d}`,bordered:!0,pagination:h.pagination||!1,title:o?()=>V.jsx("div",{className:"table_title",ref:v,children:o}):void 0,footer:i?()=>V.jsx("div",{className:"table_footer",ref:w,children:i}):void 0,scroll:{x:"max-content",y:C-x-A-p},style:{"--c_header_bg":e,"--c_body_bg":t,"--c_title_bg":n,"--c_footer_bg":r}})})},FDe=({title:e="Topbar",width:t,height:n,style:r,className:o})=>V.jsx("div",{className:`topbar ${o}`,style:{width:t,height:n,...r},children:V.jsx("h3",{children:e})});var R8={exports:{}},jDe=R8.exports,VS;function VDe(){return VS||(VS=1,function(e,t){(function(n,r){e.exports=r()})(jDe,function(){var n="day";return function(r,o,i){var a=function(u){return u.add(4-u.isoWeekday(),n)},s=o.prototype;s.isoWeekYear=function(){return a(this).year()},s.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),n);var d,h,C,m,A=a(this),v=(d=this.isoWeekYear(),h=this.$u,C=(h?i.utc:i)().year(d).startOf("year"),m=4-C.isoWeekday(),C.isoWeekday()>4&&(m+=7),C.add(m,n));return A.diff(v,"week")+1},s.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=s.startOf;s.startOf=function(u,d){var h=this.$utils(),C=!!h.u(d)||d;return h.p(u)==="isoweek"?C?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(u,d)}}})}(R8)),R8.exports}var zDe=VDe();const ZDe=p2(zDe);D1.extend(ZDe);D1.extend(jO);const $De=({size:e="m",width:t="12rem",onChange:n,value:r,format:o,className:i="",popupClassName:a=""})=>{const s=r?D1(r[0]):void 0,l=h=>{const C=h==null?void 0:h.startOf("week").startOf("day").toDate(),m=h==null?void 0:h.endOf("week").endOf("day").toDate();n&&n([C,m])},d=o?typeof o=="function"?o:h=>h.format(o):h=>{if(!h)return"";const C=h.week(),m=h.year(),A=h.startOf("week"),v=h.endOf("week"),p=`${A.format("Do MMM")}`,w=`${v.format("Do MMMM")}`;return`${m}-${C}th (${p} - ${w})`};return V.jsx(Oa,{onChange:l,picker:"week",className:`awi_week_picker size_${e} ${i}`,popupClassName:`awi_week_picker_popup ${a}`,value:s,format:d,style:{width:t}})},zS=(e,t,n)=>{if(e&&"reportValidity"in e){const r=cn(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},TP=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?zS(r.ref,n,e):r.refs&&r.refs.forEach(o=>zS(o,n,e))}},UDe=(e,t)=>{t.shouldUseNativeValidation&&TP(e,t);const n={};for(const r in e){const o=cn(t.fields,r),i=Object.assign(e[r]||{},{ref:o&&o.ref});if(WDe(t.names||Object.keys(e),r)){const a=Object.assign({},cn(n,r));q1(a,"root",i),q1(n,r,a)}else q1(n,r,i)}return n},WDe=(e,t)=>e.some(n=>n.startsWith(t+"."));function KDe(e,t,n){return t===void 0&&(t={}),n===void 0&&(n={}),function(r,o,i){try{return Promise.resolve(function(a,s){try{var l=(t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[n.mode==="sync"?"validateSync":"validate"](r,Object.assign({abortEarly:!1},t,{context:o}))).then(function(u){return i.shouldUseNativeValidation&&TP({},i),{values:n.raw?r:u,errors:{}}}))}catch(u){return s(u)}return l&&l.then?l.then(void 0,s):l}(0,function(a){if(!a.inner)throw a;return{values:{},errors:UDe((s=a,l=!i.shouldUseNativeValidation&&i.criteriaMode==="all",(s.inner||[]).reduce(function(u,d){if(u[d.path]||(u[d.path]={message:d.message,type:d.type}),l){var h=u[d.path].types,C=h&&h[d.type];u[d.path]=HP(d.path,l,u,d.type,C?[].concat(C,d.message):d.message)}return u},{})),i)};var s,l}))}catch(a){return Promise.reject(a)}}}var Dh,ZS;function QDe(){if(ZS)return Dh;ZS=1;function e(w){this._maxSize=w,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(w){return this._values[w]},e.prototype.set=function(w,x){return this._size>=this._maxSize&&this.clear(),w in this._values||this._size++,this._values[w]=x};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,r=/^\d/,o=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,i=/^\s*(['"]?)(.*?)(\1)\s*$/,a=512,s=new e(a),l=new e(a),u=new e(a);Dh={Cache:e,split:h,normalizePath:d,setter:function(w){var x=d(w);return l.get(w)||l.set(w,function(S,_){for(var M=0,H=x.length,R=S;M<H-1;){var k=x[M];if(k==="__proto__"||k==="constructor"||k==="prototype")return S;R=R[x[M++]]}R[x[M]]=_})},getter:function(w,x){var E=d(w);return u.get(w)||u.set(w,function(_){for(var M=0,H=E.length;M<H;)if(_!=null||!x)_=_[E[M++]];else return;return _})},join:function(w){return w.reduce(function(x,E){return x+(m(E)||n.test(E)?"["+E+"]":(x?".":"")+E)},"")},forEach:function(w,x,E){C(Array.isArray(w)?w:h(w),x,E)}};function d(w){return s.get(w)||s.set(w,h(w).map(function(x){return x.replace(i,"$2")}))}function h(w){return w.match(t)||[""]}function C(w,x,E){var S=w.length,_,M,H,R;for(M=0;M<S;M++)_=w[M],_&&(p(_)&&(_='"'+_+'"'),R=m(_),H=!R&&/^\d+$/.test(_),x.call(E,_,R,H,M,w))}function m(w){return typeof w=="string"&&w&&["'",'"'].indexOf(w.charAt(0))!==-1}function A(w){return w.match(r)&&!w.match(n)}function v(w){return o.test(w)}function p(w){return!m(w)&&(A(w)||v(w))}return Dh}var h3=QDe(),Ih,$S;function GDe(){if($S)return Ih;$S=1;const e=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=d=>d.match(e)||[],n=d=>d[0].toUpperCase()+d.slice(1),r=(d,h)=>t(d).join(h).toLowerCase(),o=d=>t(d).reduce((h,C)=>`${h}${h?C[0].toUpperCase()+C.slice(1).toLowerCase():C.toLowerCase()}`,"");return Ih={words:t,upperFirst:n,camelCase:o,pascalCase:d=>n(o(d)),snakeCase:d=>r(d,"_"),kebabCase:d=>r(d,"-"),sentenceCase:d=>n(r(d," ")),titleCase:d=>t(d).map(n).join(" ")},Ih}var Ph=GDe(),fc={exports:{}},US;function YDe(){if(US)return fc.exports;US=1,fc.exports=function(o){return e(t(o),o)},fc.exports.array=e;function e(o,i){var a=o.length,s=new Array(a),l={},u=a,d=n(i),h=r(o);for(i.forEach(function(m){if(!h.has(m[0])||!h.has(m[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});u--;)l[u]||C(o[u],u,new Set);return s;function C(m,A,v){if(v.has(m)){var p;try{p=", node was:"+JSON.stringify(m)}catch{p=""}throw new Error("Cyclic dependency"+p)}if(!h.has(m))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(m));if(!l[A]){l[A]=!0;var w=d.get(m)||new Set;if(w=Array.from(w),A=w.length){v.add(m);do{var x=w[--A];C(x,h.get(x),v)}while(A);v.delete(m)}s[--a]=m}}}function t(o){for(var i=new Set,a=0,s=o.length;a<s;a++){var l=o[a];i.add(l[0]),i.add(l[1])}return Array.from(i)}function n(o){for(var i=new Map,a=0,s=o.length;a<s;a++){var l=o[a];i.has(l[0])||i.set(l[0],new Set),i.has(l[1])||i.set(l[1],new Set),i.get(l[0]).add(l[1])}return i}function r(o){for(var i=new Map,a=0,s=o.length;a<s;a++)i.set(o[a],a);return i}return fc.exports}var XDe=YDe();const qDe=p2(XDe),JDe=Object.prototype.toString,eIe=Error.prototype.toString,tIe=RegExp.prototype.toString,nIe=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",rIe=/^Symbol\((.*)\)(.*)$/;function oIe(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function WS(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return oIe(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return nIe.call(e).replace(rIe,"Symbol($1)");const r=JDe.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+eIe.call(e)+"]":r==="RegExp"?tIe.call(e):null}function xa(e,t){let n=WS(e,t);return n!==null?n:JSON.stringify(e,function(r,o){let i=WS(this[r],t);return i!==null?i:o},2)}function NP(e){return e==null?[]:[].concat(e)}let FP,jP,VP,iIe=/\$\{\s*(\w+)\s*\}/g;FP=Symbol.toStringTag;class KS{constructor(t,n,r,o){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[FP]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=o,this.errors=[],this.inner=[],NP(t).forEach(i=>{if(Kr.isError(i)){this.errors.push(...i.errors);const a=i.inner.length?i.inner:[i];this.inner.push(...a)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}jP=Symbol.hasInstance;VP=Symbol.toStringTag;class Kr extends Error{static formatError(t,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof t=="string"?t.replace(iIe,(o,i)=>xa(n[i])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,o,i){const a=new KS(t,n,r,o);if(i)return a;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[VP]="Error",this.name=a.name,this.message=a.message,this.type=a.type,this.value=a.value,this.path=a.path,this.errors=a.errors,this.inner=a.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Kr)}static[jP](t){return KS[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let yi={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const o=r!=null&&r!==n?` (cast from the value \`${xa(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${xa(n,!0)}\``+o:`${e} must match the configured type. The validated value was: \`${xa(n,!0)}\``+o}},d2={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Ja={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Pg={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Tg={isValue:"${path} field must be ${value}"},D8={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},I8={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},aIe={notType:e=>{const{path:t,value:n,spec:r}=e,o=r.types.length;if(Array.isArray(n)){if(n.length<o)return`${t} tuple value has too few items, expected a length of ${o} but got ${n.length} for value: \`${xa(n,!0)}\``;if(n.length>o)return`${t} tuple value has too many items, expected a length of ${o} but got ${n.length} for value: \`${xa(n,!0)}\``}return Kr.formatError(yi.notType,e)}};Object.assign(Object.create(null),{mixed:yi,string:d2,number:Ja,date:Pg,object:D8,array:I8,boolean:Tg,tuple:aIe});const ud=e=>e&&e.__isYupSchema__;class T7{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:o,otherwise:i}=n,a=typeof r=="function"?r:(...s)=>s.every(l=>l===r);return new T7(t,(s,l)=>{var u;let d=a(...s)?o:i;return(u=d==null?void 0:d(l))!=null?u:l})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(i=>i.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),o=this.fn(r,t,n);if(o===void 0||o===t)return t;if(!ud(o))throw new TypeError("conditions must return a schema object");return o.resolve(n)}}const hc={context:"$",value:"."};class P3{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===hc.context,this.isValue=this.key[0]===hc.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?hc.context:this.isValue?hc.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&h3.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let o=this.isContext?r:this.isValue?t:n;return this.getter&&(o=this.getter(o||{})),this.map&&(o=this.map(o)),o}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}P3.prototype.__isYupRef=!0;const ko=e=>e==null;function gs(e){function t({value:n,path:r="",options:o,originalValue:i,schema:a},s,l){const{name:u,test:d,params:h,message:C,skipAbsent:m}=e;let{parent:A,context:v,abortEarly:p=a.spec.abortEarly,disableStackTrace:w=a.spec.disableStackTrace}=o;const x={value:n,parent:A,context:v};function E(P={}){const T=zP(Object.assign({value:n,originalValue:i,label:a.spec.label,path:P.path||r,spec:a.spec,disableStackTrace:P.disableStackTrace||w},h,P.params),x),N=new Kr(Kr.formatError(P.message||C,T),n,T.path,P.type||u,T.disableStackTrace);return N.params=T,N}const S=p?s:l;let _={path:r,parent:A,type:u,from:o.from,createError:E,resolve(P){return ZP(P,x)},options:o,originalValue:i,schema:a};const M=P=>{Kr.isError(P)?S(P):P?l(null):S(E())},H=P=>{Kr.isError(P)?S(P):s(P)};if(m&&ko(n))return M(!0);let k;try{var I;if(k=d.call(_,n,_),typeof((I=k)==null?void 0:I.then)=="function"){if(o.sync)throw new Error(`Validation test of type: "${_.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(k).then(M,H)}}catch(P){H(P);return}M(k)}return t.OPTIONS=e,t}function zP(e,t){if(!e)return e;for(const n of Object.keys(e))e[n]=ZP(e[n],t);return e}function ZP(e,t){return P3.isRef(e)?e.getValue(t.value,t.parent,t.context):e}function sIe(e,t,n,r=n){let o,i,a;return t?(h3.forEach(t,(s,l,u)=>{let d=l?s.slice(1,s.length-1):s;e=e.resolve({context:r,parent:o,value:n});let h=e.type==="tuple",C=u?parseInt(d,10):0;if(e.innerType||h){if(h&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(n&&C>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);o=n,n=n&&n[C],e=h?e.spec.types[C]:e.innerType}if(!u){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${a} which is a type: "${e.type}")`);o=n,n=n&&n[d],e=e.fields[d]}i=d,a=l?"["+s+"]":"."+s}),{schema:e,parent:o,parentPath:i}):{parent:o,parentPath:t,schema:e}}class N7 extends Set{describe(){const t=[];for(const n of this.values())t.push(P3.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new N7(this.values())}merge(t,n){const r=this.clone();return t.forEach(o=>r.add(o)),n.forEach(o=>r.delete(o)),r}}function xs(e,t=new Map){if(ud(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=xs(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,o]of e.entries())n.set(r,xs(o,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(xs(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,o]of Object.entries(e))n[r]=xs(o,t)}else throw Error(`Unable to clone ${e}`);return n}function lIe(e){if(!(e!=null&&e.length))return;const t=[];let n="",r=!1,o=!1;for(let i=0;i<e.length;i++){const a=e[i];if(a==="["&&!o){n&&(t.push(...n.split(".").filter(Boolean)),n=""),r=!0;continue}if(a==="]"&&!o){n&&(/^\d+$/.test(n)?t.push(n):t.push(n.replace(/^"|"$/g,"")),n=""),r=!1;continue}if(a==='"'){o=!o;continue}if(a==="."&&!r&&!o){n&&(t.push(n),n="");continue}n+=a}return n&&t.push(...n.split(".").filter(Boolean)),t}function cIe(e,t){const n=t?`${t}.${e.path}`:e.path;return e.errors.map(r=>({message:r,path:lIe(n)}))}function $P(e,t){var n;if(!((n=e.inner)!=null&&n.length)&&e.errors.length)return cIe(e,t);const r=t?`${t}.${e.path}`:e.path;return e.inner.flatMap(o=>$P(o,r))}class F2{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new N7,this._blacklist=new N7,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(yi.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=xs(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const o=Object.assign({},n.spec,r.spec);return r.spec=o,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(i=>{t.tests.forEach(a=>{i.test(a.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((o,i)=>i.resolve(o,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,o,i;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(o=t.recursive)!=null?o:this.spec.recursive,disableStackTrace:(i=t.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),o=n.assert==="ignore-optionality",i=r._cast(t,n);if(n.assert!==!1&&!r.isType(i)){if(o&&ko(i))return i;let a=xa(t),s=xa(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
|
|
710
710
|
|
|
711
711
|
attempted value: ${a}
|
|
712
|
-
`+(s!==a?`result of cast: ${s}`:""))}return i}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((o,i)=>i.call(this,o,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,o){let{path:i,originalValue:a=t,strict:s=this.spec.strict}=n,l=t;s||(l=this._cast(l,Object.assign({assert:!1},n)));let u=[];for(let d of Object.values(this.internalTests))d&&u.push(d);this.runTests({path:i,value:l,originalValue:a,options:n,tests:u},r,d=>{if(d.length)return o(d,l);this.runTests({path:i,value:l,originalValue:a,options:n,tests:this.tests},r,o)})}runTests(t,n,r){let o=!1,{tests:i,value:a,originalValue:s,path:l,options:u}=t,d=v=>{o||(o=!0,n(v,a))},h=v=>{o||(o=!0,r(v,a))},C=i.length,m=[];if(!C)return h([]);let A={value:a,originalValue:s,path:l,options:u,schema:this};for(let v=0;v<i.length;v++){const p=i[v];p(A,d,function(x){x&&(Array.isArray(x)?m.push(...x):m.push(x)),--C<=0&&h(m)})}}asNestedTest({key:t,index:n,parent:r,parentPath:o,originalParent:i,options:a}){const s=t??n;if(s==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof s=="number";let u=r[s];const d=Object.assign({},a,{strict:!0,parent:r,value:u,originalValue:i[s],key:void 0,[l?"index":"key"]:s,path:l||s.includes(".")?`${o||""}[${l?s:`"${s}"`}]`:(o?`${o}.`:"")+t});return(h,C,m)=>this.resolve(d)._validate(u,d,C,m)}validate(t,n){var r;let o=this.resolve(Object.assign({},n,{value:t})),i=(r=n==null?void 0:n.disableStackTrace)!=null?r:o.spec.disableStackTrace;return new Promise((a,s)=>o._validate(t,n,(l,u)=>{Kr.isError(l)&&(l.value=u),s(l)},(l,u)=>{l.length?s(new Kr(l,u,void 0,void 0,i)):a(u)}))}validateSync(t,n){var r;let o=this.resolve(Object.assign({},n,{value:t})),i,a=(r=n==null?void 0:n.disableStackTrace)!=null?r:o.spec.disableStackTrace;return o._validate(t,Object.assign({},n,{sync:!0}),(s,l)=>{throw Kr.isError(s)&&(s.value=l),s},(s,l)=>{if(s.length)throw new Kr(s,t,void 0,void 0,a);i=l}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Kr.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Kr.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):xs(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=gs({message:n,name:"nullable",test(o){return o===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=gs({message:n,name:"optionality",test(o){return o===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=yi.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=yi.notNull){return this.nullability(!1,t)}required(t=yi.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=yi.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),o=gs(n),i=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(a=>!(a.OPTIONS.name===n.name&&(i||a.OPTIONS.test===o.OPTIONS.test))),r.tests.push(o),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),o=NP(t).map(i=>new P3(i));return o.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof n=="function"?new T7(o,n):T7.fromOptions(o,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=gs({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=yi.oneOf){let r=this.clone();return t.forEach(o=>{r._whitelist.add(o),r._blacklist.delete(o)}),r.internalTests.whiteList=gs({message:n,name:"oneOf",skipAbsent:!0,test(o){let i=this.schema._whitelist,a=i.resolveAll(this.resolve);return a.includes(o)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:a}})}}),r}notOneOf(t,n=yi.notOneOf){let r=this.clone();return t.forEach(o=>{r._blacklist.add(o),r._whitelist.delete(o)}),r.internalTests.blacklist=gs({message:n,name:"notOneOf",test(o){let i=this.schema._blacklist,a=i.resolveAll(this.resolve);return a.includes(o)?this.createError({params:{values:Array.from(i).join(", "),resolved:a}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:o,optional:i,nullable:a}=n.spec;return{meta:o,label:r,optional:i,nullable:a,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.filter((l,u,d)=>d.findIndex(h=>h.OPTIONS.name===l.OPTIONS.name)===u).map(l=>{const u=l.OPTIONS.params&&t?zP(Object.assign({},l.OPTIONS.params),t):l.OPTIONS.params;return{name:l.OPTIONS.name,params:u}})}}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(r){try{return{value:await t.validate(r,{abortEarly:!1})}}catch(o){if(o instanceof Kr)return{issues:$P(o)};throw o}}}}}F2.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])F2.prototype[`${e}At`]=function(t,n,r={}){const{parent:o,parentPath:i,schema:a}=sIe(this,t,n,r.context);return a[e](o&&o[i],Object.assign({},r,{parent:o,path:t}))};for(const e of["equals","is"])F2.prototype[e]=F2.prototype.oneOf;for(const e of["not","nope"])F2.prototype[e]=F2.prototype.notOneOf;function UP(){return new WP}class WP extends F2{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(r.spec.coerce&&!r.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=Tg.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(n){return ko(n)||n===!0}})}isFalse(t=Tg.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(n){return ko(n)||n===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}UP.prototype=WP.prototype;const uIe=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function dIe(e){const t=Ng(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function Ng(e){var t,n;const r=uIe.exec(e);return r?{year:sa(r[1]),month:sa(r[2],1)-1,day:sa(r[3],1),hour:sa(r[4]),minute:sa(r[5]),second:sa(r[6]),millisecond:r[7]?sa(r[7].substring(0,3)):0,precision:(t=(n=r[7])==null?void 0:n.length)!=null?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:sa(r[10]),minuteOffset:sa(r[11])}:null}function sa(e,t=0){return Number(e)||t}let fIe=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,hIe=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,CIe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,gIe="^\\d{4}-\\d{2}-\\d{2}",mIe="\\d{2}:\\d{2}:\\d{2}",pIe="(([+-]\\d{2}(:?\\d{2})?)|Z)",AIe=new RegExp(`${gIe}T${mIe}(\\.\\d+)?${pIe}$`),vIe=e=>ko(e)||e===e.trim(),bIe={}.toString();function P8(){return new KP}class KP extends F2{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const o=t!=null&&t.toString?t.toString():t;return o===bIe?t:o})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||yi.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=d2.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=d2.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=d2.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,o,i;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:o,name:i}=n:o=n),this.test({name:i||"matches",message:o||d2.matches,params:{regex:t},skipAbsent:!0,test:a=>a===""&&r||a.search(t)!==-1})}email(t=d2.email){return this.matches(fIe,{name:"email",message:t,excludeEmptyString:!0})}url(t=d2.url){return this.matches(hIe,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=d2.uuid){return this.matches(CIe,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",r,o;return t&&(typeof t=="object"?{message:n="",allowOffset:r=!1,precision:o=void 0}=t:n=t),this.matches(AIe,{name:"datetime",message:n||d2.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||d2.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:i=>{if(!i||r)return!0;const a=Ng(i);return a?!!a.z:!1}}).test({name:"datetime_precision",message:n||d2.datetime_precision,params:{precision:o},skipAbsent:!0,test:i=>{if(!i||o==null)return!0;const a=Ng(i);return a?a.precision===o:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=d2.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:vIe})}lowercase(t=d2.lowercase){return this.transform(n=>ko(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>ko(n)||n===n.toLowerCase()})}uppercase(t=d2.uppercase){return this.transform(n=>ko(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>ko(n)||n===n.toUpperCase()})}}P8.prototype=KP.prototype;let yIe=e=>e!=+e;function QP(){return new GP}class GP extends F2{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!yIe(t)}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce)return t;let o=t;if(typeof o=="string"){if(o=o.replace(/\s/g,""),o==="")return NaN;o=+o}return r.isType(o)||o===null?o:parseFloat(o)})})}min(t,n=Ja.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r>=this.resolve(t)}})}max(t,n=Ja.max){return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r<=this.resolve(t)}})}lessThan(t,n=Ja.lessThan){return this.test({message:n,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(r){return r<this.resolve(t)}})}moreThan(t,n=Ja.moreThan){return this.test({message:n,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(r){return r>this.resolve(t)}})}positive(t=Ja.positive){return this.moreThan(0,t)}negative(t=Ja.negative){return this.lessThan(0,t)}integer(t=Ja.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(t=>ko(t)?t:t|0)}round(t){var n;let r=["ceil","floor","round","trunc"];if(t=((n=t)==null?void 0:n.toLowerCase())||"round",t==="trunc")return this.truncate();if(r.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+r.join(", "));return this.transform(o=>ko(o)?o:Math[t](o))}}QP.prototype=GP.prototype;let wIe=new Date(""),xIe=e=>Object.prototype.toString.call(e)==="[object Date]";class tA extends F2{constructor(){super({type:"date",check(t){return xIe(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=dIe(t),isNaN(t)?tA.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(P3.isRef(t))r=t;else{let o=this.cast(t);if(!this._typeCheck(o))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=o}return r}min(t,n=Pg.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(o){return o>=this.resolve(r)}})}max(t,n=Pg.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(o){return o<=this.resolve(r)}})}}tA.INVALID_DATE=wIe;function EIe(e,t=[]){let n=[],r=new Set,o=new Set(t.map(([a,s])=>`${a}-${s}`));function i(a,s){let l=h3.split(a)[0];r.add(l),o.has(`${s}-${l}`)||n.push([s,l])}for(const a of Object.keys(e)){let s=e[a];r.add(a),P3.isRef(s)&&s.isSibling?i(s.path,a):ud(s)&&"deps"in s&&s.deps.forEach(l=>i(l,a))}return qDe.array(Array.from(r),n).reverse()}function QS(e,t){let n=1/0;return e.some((r,o)=>{var i;if((i=t.path)!=null&&i.includes(r))return n=o,!0}),n}function YP(e){return(t,n)=>QS(e,t)-QS(e,n)}const XP=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function T8(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=T8(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=T8(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(T8)}):"optional"in e?e.optional():e}const _Ie=(e,t)=>{const n=[...h3.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),o=h3.getter(h3.join(n),!0)(e);return!!(o&&r in o)};let GS=e=>Object.prototype.toString.call(e)==="[object Object]";function YS(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const SIe=YP([]);function qP(e){return new JP(e)}class JP extends F2{constructor(t){super({type:"object",check(n){return GS(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=SIe,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let o=super._cast(t,n);if(o===void 0)return this.getDefault(n);if(!this._typeCheck(o))return o;let i=this.fields,a=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,s=[].concat(this._nodes,Object.keys(o).filter(h=>!this._nodes.includes(h))),l={},u=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),d=!1;for(const h of s){let C=i[h],m=h in o;if(C){let A,v=o[h];u.path=(n.path?`${n.path}.`:"")+h,C=C.resolve({value:v,context:n.context,parent:l});let p=C instanceof F2?C.spec:void 0,w=p==null?void 0:p.strict;if(p!=null&&p.strip){d=d||h in o;continue}A=!n.__validating||!w?C.cast(o[h],u):o[h],A!==void 0&&(l[h]=A)}else m&&!a&&(l[h]=o[h]);(m!==h in l||l[h]!==o[h])&&(d=!0)}return d?l:o}_validate(t,n={},r,o){let{from:i=[],originalValue:a=t,recursive:s=this.spec.recursive}=n;n.from=[{schema:this,value:a},...i],n.__validating=!0,n.originalValue=a,super._validate(t,n,r,(l,u)=>{if(!s||!GS(u)){o(l,u);return}a=a||u;let d=[];for(let h of this._nodes){let C=this.fields[h];!C||P3.isRef(C)||d.push(C.asNestedTest({options:n,key:h,parent:u,parentPath:n.path,originalParent:a}))}this.runTests({tests:d,value:u,originalValue:a,options:n},r,h=>{o(h.sort(this._sortErrors).concat(l),u)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[o,i]of Object.entries(this.fields)){const a=r[o];r[o]=a===void 0?i:a}return n.withMutation(o=>o.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var o;const i=this.fields[r];let a=t;(o=a)!=null&&o.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[r]})),n[r]=i&&"getDefault"in i?i.getDefault(a):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=EIe(t,n),r._sortErrors=YP(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let o=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),o=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),o)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return T8(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,o])=>t.includes(r)&&t.includes(o)))}omit(t){const n=[];for(const r of Object.keys(this.fields))t.includes(r)||n.push(r);return this.pick(n)}from(t,n,r){let o=h3.getter(t,!0);return this.transform(i=>{if(!i)return i;let a=i;return _Ie(i,t)&&(a=Object.assign({},i),r||delete a[t],a[n]=o(i)),a})}json(){return this.transform(XP)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||D8.exact,test(n){if(n==null)return!0;const r=YS(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=D8.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(o){if(o==null)return!0;const i=YS(this.schema,o);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=D8.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const o of Object.keys(n))r[t(o)]=n[o];return r})}camelCase(){return this.transformKeys(Ph.camelCase)}snakeCase(){return this.transformKeys(Ph.snakeCase)}constantCase(){return this.transformKeys(t=>Ph.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(const[i,a]of Object.entries(n.fields)){var o;let s=t;(o=s)!=null&&o.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[i]})),r.fields[i]=a.describe(s)}return r}}qP.prototype=JP.prototype;function eT(e){return new tT(e)}class tT extends F2{constructor(t){super({type:"array",spec:{types:t},check(n){return Array.isArray(n)}}),this.innerType=void 0,this.innerType=t}_cast(t,n){const r=super._cast(t,n);if(!this._typeCheck(r)||!this.innerType)return r;let o=!1;const i=r.map((a,s)=>{const l=this.innerType.cast(a,Object.assign({},n,{path:`${n.path||""}[${s}]`}));return l!==a&&(o=!0),l});return o?i:r}_validate(t,n={},r,o){var i;let a=this.innerType,s=(i=n.recursive)!=null?i:this.spec.recursive;n.originalValue!=null&&n.originalValue,super._validate(t,n,r,(l,u)=>{var d;if(!s||!a||!this._typeCheck(u)){o(l,u);return}let h=new Array(u.length);for(let m=0;m<u.length;m++){var C;h[m]=a.asNestedTest({options:n,index:m,parent:u,parentPath:n.path,originalParent:(C=n.originalValue)!=null?C:t})}this.runTests({value:u,tests:h,originalValue:(d=n.originalValue)!=null?d:t,options:n},r,m=>o(m.concat(l),u))})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}json(){return this.transform(XP)}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!ud(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+xa(t));return n.innerType=t,n.spec=Object.assign({},n.spec,{types:t}),n}length(t,n=I8.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n){return n=n||I8.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n){return n=n||I8.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(r,o,i)=>!t(r,o,i):r=>!!r;return this.transform(r=>r!=null?r.filter(n):r)}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);if(n.innerType){var o;let i=t;(o=i)!=null&&o.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[0]})),r.innerType=n.innerType.describe(i)}return r}}eT.prototype=tT.prototype;const MIe=e=>{const t={},n=(r,o="")=>{if("inputType"in r){const i=HIe(r);i&&(t[o]=i)}else Object.entries(r).forEach(([i,a])=>{if(i!=="label"&&i!=="description"){const s=o?`${o}.${i}`:i;n(a,s)}})};return Object.entries(e).forEach(([r,o])=>{n(o,r)}),qP().shape(t)},HIe=e=>{let t;switch(e.inputType){case"text":t=P8();break;case"slider":case"range-slider":t=QP();break;case"select":t=P8();break;case"multiselect":t=eT().of(P8());break;case"checkbox":t=UP();break;default:return null}return e.required&&(t=t.required(`${e.label||"This field"} is required`)),(e.inputType==="slider"||e.inputType==="range-slider")&&(e.min!==void 0&&(t=t.min(e.min,`Must be at least ${e.min}`)),e.max!==void 0&&(t=t.max(e.max,`Must be at most ${e.max}`))),t},XS=e=>{const t={},n=(r,o="")=>{Object.entries(r).forEach(([i,a])=>{const s=o?`${o}.${i}`:i;a&&typeof a=="object"&&!Array.isArray(a)?n(a,s):t[s]=a})};return n(e),t},LIe=e=>{const t={};return Object.entries(e).forEach(([n,r])=>{const o=n.split(".");let i=t;for(let a=0;a<o.length-1;a++){const s=o[a];s in i||(i[s]={}),i=i[s]}i[o[o.length-1]]=r}),t},OIe=({name:e,control:t,field:n,className:r=""})=>{const o=(i,a)=>{const s={width:n.width||"100%",disabled:!1};switch(n.inputType){case"text":return V.jsx(x9,{...s,placeholder:n.placeholder,value:i||"",onChange:l=>a(l.target.value)});case"select":return V.jsx(Ql,{...s,placeholder:n.placeholder||"Select an option",value:i,onChange:a,options:n.options||[]});case"multiselect":return V.jsx(eA,{...s,placeholder:n.placeholder||"Select options",value:i||[],onChange:a,options:n.options||[]});case"checkbox":return V.jsx(Du,{value:i||!1,onChange:a});case"slider":return V.jsx(k4,{label:n.label,min:n.min||0,max:n.max||100,value:i||n.min||0,onChange:a,name:e});case"range-slider":return V.jsxs("div",{className:"range-slider-container",children:[V.jsx(k4,{label:`${n.label} (Min)`,min:n.min||0,max:n.max||100,value:Array.isArray(i)?i[0]:n.min||0,onChange:l=>{const u=Array.isArray(i)?i:[n.min||0,n.max||100];a([l,u[1]])},name:`${e}_min`}),V.jsx(k4,{label:`${n.label} (Max)`,min:n.min||0,max:n.max||100,value:Array.isArray(i)?i[1]:n.max||100,onChange:l=>{const u=Array.isArray(i)?i:[n.min||0,n.max||100];a([u[0],l])},name:`${e}_max`})]});default:return V.jsxs("div",{className:"unsupported-field",children:["Unsupported field type: ",n.inputType]})}};return V.jsxs("div",{className:`form-field ${r}`,children:[n.label&&n.inputType!=="slider"&&n.inputType!=="range-slider"&&V.jsxs("label",{className:"form-field-label",children:[n.label,n.required&&V.jsx("span",{className:"required",children:"*"})]}),n.description&&V.jsx("p",{className:"form-field-description",children:n.description}),V.jsx(ps,{name:e,control:t,defaultValue:n.defaultValue||n.defaultValues,render:({field:i})=>V.jsx("div",{className:"form-field-input",children:o(i.value,i.onChange)})})]})},nT=({name:e,config:t,control:n,level:r,className:o=""})=>{const[i,a]=B.useState(!0);if("inputType"in t)return V.jsx(OIe,{name:e,control:n,field:t,className:o});const l=t,u=r>0,d=Object.keys(l).filter(C=>C!=="label"&&C!=="description").length>1,h=()=>V.jsx("div",{className:"form-section-content",children:Object.entries(l).map(([C,m])=>C==="label"||C==="description"?null:V.jsx(nT,{name:`${e}.${C}`,config:m,control:n,level:r+1,className:"form-section-child"},C))});return u&&d?V.jsxs("div",{className:`form-section accordion ${o}`,children:[V.jsxs("div",{className:"form-section-header accordion-header",onClick:()=>a(!i),children:[V.jsxs("div",{className:"accordion-title",children:[l.label&&V.jsx("h3",{className:"form-section-title",children:l.label}),l.description&&V.jsx("p",{className:"form-section-description",children:l.description})]}),V.jsx("div",{className:`accordion-icon ${i?"expanded":"collapsed"}`,children:"▼"})]}),i&&h()]}):V.jsxs("div",{className:`form-section simple ${o}`,children:[l.label&&V.jsxs("div",{className:"form-section-header simple-header",children:[V.jsx("h3",{className:"form-section-title",children:l.label}),l.description&&V.jsx("p",{className:"form-section-description",children:l.description})]}),h()]})},BIe=({formConfig:e={},width:t,height:n,onSubmit:r,submitButtonText:o="Submit",submitButtonProps:i={},showResetButton:a=!1,resetButtonText:s="Reset",resetButtonProps:l={},defaultValues:u={},className:d=""})=>{const h=MIe(e),{control:C,handleSubmit:m,reset:A,formState:{errors:v,isSubmitting:p}}=IP({resolver:KDe(h),defaultValues:XS(u)}),w=S=>{const _=LIe(S);r==null||r(_)},x=()=>{A(XS(u))},E=()=>Object.entries(e).map(([S,_])=>V.jsx(nT,{name:S,config:_,control:C,level:0,className:"form-section-root"},S));return V.jsxs("div",{className:`form-group ${d}`,style:{width:t,height:n,minWidth:t,minHeight:n,maxWidth:t,maxHeight:n},children:[V.jsxs("form",{onSubmit:m(w),className:"form-group-form",children:[V.jsx("div",{className:"form-group-content",children:E()}),(r||a)&&V.jsxs("div",{className:"form-group-actions",children:[r&&V.jsx($0,{type:"submit",content:o,loading:p,...i}),a&&V.jsx($0,{type:"button",content:s,onClick:x,...l})]})]}),Object.keys(v).length>0&&process.env.NODE_ENV==="development"&&V.jsxs("div",{className:"form-group-errors",children:[V.jsx("h4",{children:"Form Errors:"}),V.jsx("pre",{children:JSON.stringify(v,null,2)})]})]})},Fg=()=>{const e=B.useRef(!1),t=B.useRef(!1);return B.useEffect(()=>{const o=l=>{l.key==="Control"&&(e.current=!0,W1.success("Control pressed, Handling control press events")),l.key==="Alt"&&(t.current=!0,W1.success("Alt pressed, Handling alt press events")),l.key==="Command"&&(e.current=!0,W1.success("Command pressed, Handling command press events"))},i=l=>{l.key==="Control"&&(e.current=!1),l.key==="Alt"&&(t.current=!1),l.key==="Command"&&(e.current=!1)},a=()=>{document.hidden&&(e.current=!1,t.current=!1)},s=()=>{e.current=!1,t.current=!1};return window.addEventListener("keydown",o),window.addEventListener("keyup",i),document.addEventListener("visibilitychange",a),window.addEventListener("blur",s),()=>{window.removeEventListener("keydown",o),window.removeEventListener("keyup",i),document.removeEventListener("visibilitychange",a),window.removeEventListener("blur",s)}},[]),{isCtrlPressedFunc:()=>e.current,isAltPressedFunc:()=>t.current}};exports.AnnotationComponentLibrary=UAe;exports.AwiAnnotationHotkeys=wg;exports.AwiAnnotationTools=x8;exports.AwiCanvasContainer=E8;exports.AwiCustomConfirmation=WD;exports.AwiEmptyState=qAe;exports.AwiHelperMethods=B2;exports.AwiInput=YR;exports.AwiLoadMoreButton=fve;exports.AwiMessageScreen=_8;exports.AwiModal=$u;exports.AwiModalBody=Uu;exports.AwiModalFooter=Ku;exports.AwiModalHeader=Wu;exports.AwiModalRow=C4;exports.AwiPagination=iI;exports.AwiSafeLocalStorage=ga;exports.AwiSamModal=XR;exports.AwiScrollableTableCellList=hve;exports.AwiSlider=k4;exports.AwiTableBar=dve;exports.AwiTableBody=oI;exports.AwiTableCell=m4;exports.AwiTableHeader=sR;exports.AwiTableHeaders=lR;exports.AwiTableInfinite=rI;exports.AwiTableRow=rp;exports.AwiToastMessage=W1;exports.AwiUseKeyChecker=Fg;exports.Backdrop=UR;exports.Badge=Cve;exports.Button=$0;exports.ButtonGroup=gve;exports.Chart=CEe;exports.CompactEventCard=tP;exports.ContactInput=Vke;exports.DEFAULT_THEME=LR;exports.DatePicker=zke;exports.DateRangePicker=Qke;exports.DetectionCarousel=rP;exports.Dropdown=Yke;exports.EventPreview=Xke;exports.FloorMapView=HRe;exports.FormGroup=BIe;exports.Heatmap=eDe;exports.Icon=Gr;exports.Input=x9;exports.LiveDot=tDe;exports.LoginPage=yDe;exports.MapView=MDe;exports.Menu=HDe;exports.Modal=ODe;exports.MonthPicker=BDe;exports.Multiselect=eA;exports.Pagination=kDe;exports.Popover=RDe;exports.Refresh=IDe;exports.Select=Ql;exports.Sidebar=PDe;exports.Spinner=Nu;exports.Switch=PP;exports.Table=NDe;exports.ThemeProvider=phe;exports.Toast=iR;exports.Topbar=FDe;exports.WeekPicker=$De;exports.showToast=f4;exports.usePagination=Tz;exports.usePointerState=vhe;exports.useResize=w8;exports.useTheme=Ahe;exports.useToast=bhe;
|
|
712
|
+
`+(s!==a?`result of cast: ${s}`:""))}return i}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((o,i)=>i.call(this,o,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,o){let{path:i,originalValue:a=t,strict:s=this.spec.strict}=n,l=t;s||(l=this._cast(l,Object.assign({assert:!1},n)));let u=[];for(let d of Object.values(this.internalTests))d&&u.push(d);this.runTests({path:i,value:l,originalValue:a,options:n,tests:u},r,d=>{if(d.length)return o(d,l);this.runTests({path:i,value:l,originalValue:a,options:n,tests:this.tests},r,o)})}runTests(t,n,r){let o=!1,{tests:i,value:a,originalValue:s,path:l,options:u}=t,d=v=>{o||(o=!0,n(v,a))},h=v=>{o||(o=!0,r(v,a))},C=i.length,m=[];if(!C)return h([]);let A={value:a,originalValue:s,path:l,options:u,schema:this};for(let v=0;v<i.length;v++){const p=i[v];p(A,d,function(x){x&&(Array.isArray(x)?m.push(...x):m.push(x)),--C<=0&&h(m)})}}asNestedTest({key:t,index:n,parent:r,parentPath:o,originalParent:i,options:a}){const s=t??n;if(s==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof s=="number";let u=r[s];const d=Object.assign({},a,{strict:!0,parent:r,value:u,originalValue:i[s],key:void 0,[l?"index":"key"]:s,path:l||s.includes(".")?`${o||""}[${l?s:`"${s}"`}]`:(o?`${o}.`:"")+t});return(h,C,m)=>this.resolve(d)._validate(u,d,C,m)}validate(t,n){var r;let o=this.resolve(Object.assign({},n,{value:t})),i=(r=n==null?void 0:n.disableStackTrace)!=null?r:o.spec.disableStackTrace;return new Promise((a,s)=>o._validate(t,n,(l,u)=>{Kr.isError(l)&&(l.value=u),s(l)},(l,u)=>{l.length?s(new Kr(l,u,void 0,void 0,i)):a(u)}))}validateSync(t,n){var r;let o=this.resolve(Object.assign({},n,{value:t})),i,a=(r=n==null?void 0:n.disableStackTrace)!=null?r:o.spec.disableStackTrace;return o._validate(t,Object.assign({},n,{sync:!0}),(s,l)=>{throw Kr.isError(s)&&(s.value=l),s},(s,l)=>{if(s.length)throw new Kr(s,t,void 0,void 0,a);i=l}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Kr.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Kr.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):xs(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=gs({message:n,name:"nullable",test(o){return o===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=gs({message:n,name:"optionality",test(o){return o===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=yi.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=yi.notNull){return this.nullability(!1,t)}required(t=yi.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=yi.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),o=gs(n),i=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(a=>!(a.OPTIONS.name===n.name&&(i||a.OPTIONS.test===o.OPTIONS.test))),r.tests.push(o),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),o=NP(t).map(i=>new P3(i));return o.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof n=="function"?new T7(o,n):T7.fromOptions(o,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=gs({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=yi.oneOf){let r=this.clone();return t.forEach(o=>{r._whitelist.add(o),r._blacklist.delete(o)}),r.internalTests.whiteList=gs({message:n,name:"oneOf",skipAbsent:!0,test(o){let i=this.schema._whitelist,a=i.resolveAll(this.resolve);return a.includes(o)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:a}})}}),r}notOneOf(t,n=yi.notOneOf){let r=this.clone();return t.forEach(o=>{r._blacklist.add(o),r._whitelist.delete(o)}),r.internalTests.blacklist=gs({message:n,name:"notOneOf",test(o){let i=this.schema._blacklist,a=i.resolveAll(this.resolve);return a.includes(o)?this.createError({params:{values:Array.from(i).join(", "),resolved:a}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:o,optional:i,nullable:a}=n.spec;return{meta:o,label:r,optional:i,nullable:a,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.filter((l,u,d)=>d.findIndex(h=>h.OPTIONS.name===l.OPTIONS.name)===u).map(l=>{const u=l.OPTIONS.params&&t?zP(Object.assign({},l.OPTIONS.params),t):l.OPTIONS.params;return{name:l.OPTIONS.name,params:u}})}}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(r){try{return{value:await t.validate(r,{abortEarly:!1})}}catch(o){if(o instanceof Kr)return{issues:$P(o)};throw o}}}}}F2.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])F2.prototype[`${e}At`]=function(t,n,r={}){const{parent:o,parentPath:i,schema:a}=sIe(this,t,n,r.context);return a[e](o&&o[i],Object.assign({},r,{parent:o,path:t}))};for(const e of["equals","is"])F2.prototype[e]=F2.prototype.oneOf;for(const e of["not","nope"])F2.prototype[e]=F2.prototype.notOneOf;function UP(){return new WP}class WP extends F2{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(r.spec.coerce&&!r.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=Tg.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(n){return ko(n)||n===!0}})}isFalse(t=Tg.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(n){return ko(n)||n===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}UP.prototype=WP.prototype;const uIe=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function dIe(e){const t=Ng(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function Ng(e){var t,n;const r=uIe.exec(e);return r?{year:sa(r[1]),month:sa(r[2],1)-1,day:sa(r[3],1),hour:sa(r[4]),minute:sa(r[5]),second:sa(r[6]),millisecond:r[7]?sa(r[7].substring(0,3)):0,precision:(t=(n=r[7])==null?void 0:n.length)!=null?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:sa(r[10]),minuteOffset:sa(r[11])}:null}function sa(e,t=0){return Number(e)||t}let fIe=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,hIe=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,CIe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,gIe="^\\d{4}-\\d{2}-\\d{2}",mIe="\\d{2}:\\d{2}:\\d{2}",pIe="(([+-]\\d{2}(:?\\d{2})?)|Z)",AIe=new RegExp(`${gIe}T${mIe}(\\.\\d+)?${pIe}$`),vIe=e=>ko(e)||e===e.trim(),bIe={}.toString();function P8(){return new KP}class KP extends F2{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const o=t!=null&&t.toString?t.toString():t;return o===bIe?t:o})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||yi.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=d2.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=d2.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=d2.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,o,i;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:o,name:i}=n:o=n),this.test({name:i||"matches",message:o||d2.matches,params:{regex:t},skipAbsent:!0,test:a=>a===""&&r||a.search(t)!==-1})}email(t=d2.email){return this.matches(fIe,{name:"email",message:t,excludeEmptyString:!0})}url(t=d2.url){return this.matches(hIe,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=d2.uuid){return this.matches(CIe,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",r,o;return t&&(typeof t=="object"?{message:n="",allowOffset:r=!1,precision:o=void 0}=t:n=t),this.matches(AIe,{name:"datetime",message:n||d2.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||d2.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:i=>{if(!i||r)return!0;const a=Ng(i);return a?!!a.z:!1}}).test({name:"datetime_precision",message:n||d2.datetime_precision,params:{precision:o},skipAbsent:!0,test:i=>{if(!i||o==null)return!0;const a=Ng(i);return a?a.precision===o:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=d2.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:vIe})}lowercase(t=d2.lowercase){return this.transform(n=>ko(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>ko(n)||n===n.toLowerCase()})}uppercase(t=d2.uppercase){return this.transform(n=>ko(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>ko(n)||n===n.toUpperCase()})}}P8.prototype=KP.prototype;let yIe=e=>e!=+e;function QP(){return new GP}class GP extends F2{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!yIe(t)}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce)return t;let o=t;if(typeof o=="string"){if(o=o.replace(/\s/g,""),o==="")return NaN;o=+o}return r.isType(o)||o===null?o:parseFloat(o)})})}min(t,n=Ja.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r>=this.resolve(t)}})}max(t,n=Ja.max){return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r<=this.resolve(t)}})}lessThan(t,n=Ja.lessThan){return this.test({message:n,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(r){return r<this.resolve(t)}})}moreThan(t,n=Ja.moreThan){return this.test({message:n,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(r){return r>this.resolve(t)}})}positive(t=Ja.positive){return this.moreThan(0,t)}negative(t=Ja.negative){return this.lessThan(0,t)}integer(t=Ja.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(t=>ko(t)?t:t|0)}round(t){var n;let r=["ceil","floor","round","trunc"];if(t=((n=t)==null?void 0:n.toLowerCase())||"round",t==="trunc")return this.truncate();if(r.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+r.join(", "));return this.transform(o=>ko(o)?o:Math[t](o))}}QP.prototype=GP.prototype;let wIe=new Date(""),xIe=e=>Object.prototype.toString.call(e)==="[object Date]";class tA extends F2{constructor(){super({type:"date",check(t){return xIe(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=dIe(t),isNaN(t)?tA.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(P3.isRef(t))r=t;else{let o=this.cast(t);if(!this._typeCheck(o))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=o}return r}min(t,n=Pg.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(o){return o>=this.resolve(r)}})}max(t,n=Pg.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(o){return o<=this.resolve(r)}})}}tA.INVALID_DATE=wIe;function EIe(e,t=[]){let n=[],r=new Set,o=new Set(t.map(([a,s])=>`${a}-${s}`));function i(a,s){let l=h3.split(a)[0];r.add(l),o.has(`${s}-${l}`)||n.push([s,l])}for(const a of Object.keys(e)){let s=e[a];r.add(a),P3.isRef(s)&&s.isSibling?i(s.path,a):ud(s)&&"deps"in s&&s.deps.forEach(l=>i(l,a))}return qDe.array(Array.from(r),n).reverse()}function QS(e,t){let n=1/0;return e.some((r,o)=>{var i;if((i=t.path)!=null&&i.includes(r))return n=o,!0}),n}function YP(e){return(t,n)=>QS(e,t)-QS(e,n)}const XP=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function T8(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=T8(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=T8(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(T8)}):"optional"in e?e.optional():e}const _Ie=(e,t)=>{const n=[...h3.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),o=h3.getter(h3.join(n),!0)(e);return!!(o&&r in o)};let GS=e=>Object.prototype.toString.call(e)==="[object Object]";function YS(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const SIe=YP([]);function qP(e){return new JP(e)}class JP extends F2{constructor(t){super({type:"object",check(n){return GS(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=SIe,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let o=super._cast(t,n);if(o===void 0)return this.getDefault(n);if(!this._typeCheck(o))return o;let i=this.fields,a=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,s=[].concat(this._nodes,Object.keys(o).filter(h=>!this._nodes.includes(h))),l={},u=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),d=!1;for(const h of s){let C=i[h],m=h in o;if(C){let A,v=o[h];u.path=(n.path?`${n.path}.`:"")+h,C=C.resolve({value:v,context:n.context,parent:l});let p=C instanceof F2?C.spec:void 0,w=p==null?void 0:p.strict;if(p!=null&&p.strip){d=d||h in o;continue}A=!n.__validating||!w?C.cast(o[h],u):o[h],A!==void 0&&(l[h]=A)}else m&&!a&&(l[h]=o[h]);(m!==h in l||l[h]!==o[h])&&(d=!0)}return d?l:o}_validate(t,n={},r,o){let{from:i=[],originalValue:a=t,recursive:s=this.spec.recursive}=n;n.from=[{schema:this,value:a},...i],n.__validating=!0,n.originalValue=a,super._validate(t,n,r,(l,u)=>{if(!s||!GS(u)){o(l,u);return}a=a||u;let d=[];for(let h of this._nodes){let C=this.fields[h];!C||P3.isRef(C)||d.push(C.asNestedTest({options:n,key:h,parent:u,parentPath:n.path,originalParent:a}))}this.runTests({tests:d,value:u,originalValue:a,options:n},r,h=>{o(h.sort(this._sortErrors).concat(l),u)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[o,i]of Object.entries(this.fields)){const a=r[o];r[o]=a===void 0?i:a}return n.withMutation(o=>o.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var o;const i=this.fields[r];let a=t;(o=a)!=null&&o.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[r]})),n[r]=i&&"getDefault"in i?i.getDefault(a):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=EIe(t,n),r._sortErrors=YP(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let o=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),o=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),o)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return T8(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,o])=>t.includes(r)&&t.includes(o)))}omit(t){const n=[];for(const r of Object.keys(this.fields))t.includes(r)||n.push(r);return this.pick(n)}from(t,n,r){let o=h3.getter(t,!0);return this.transform(i=>{if(!i)return i;let a=i;return _Ie(i,t)&&(a=Object.assign({},i),r||delete a[t],a[n]=o(i)),a})}json(){return this.transform(XP)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||D8.exact,test(n){if(n==null)return!0;const r=YS(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=D8.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(o){if(o==null)return!0;const i=YS(this.schema,o);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=D8.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const o of Object.keys(n))r[t(o)]=n[o];return r})}camelCase(){return this.transformKeys(Ph.camelCase)}snakeCase(){return this.transformKeys(Ph.snakeCase)}constantCase(){return this.transformKeys(t=>Ph.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(const[i,a]of Object.entries(n.fields)){var o;let s=t;(o=s)!=null&&o.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[i]})),r.fields[i]=a.describe(s)}return r}}qP.prototype=JP.prototype;function eT(e){return new tT(e)}class tT extends F2{constructor(t){super({type:"array",spec:{types:t},check(n){return Array.isArray(n)}}),this.innerType=void 0,this.innerType=t}_cast(t,n){const r=super._cast(t,n);if(!this._typeCheck(r)||!this.innerType)return r;let o=!1;const i=r.map((a,s)=>{const l=this.innerType.cast(a,Object.assign({},n,{path:`${n.path||""}[${s}]`}));return l!==a&&(o=!0),l});return o?i:r}_validate(t,n={},r,o){var i;let a=this.innerType,s=(i=n.recursive)!=null?i:this.spec.recursive;n.originalValue!=null&&n.originalValue,super._validate(t,n,r,(l,u)=>{var d;if(!s||!a||!this._typeCheck(u)){o(l,u);return}let h=new Array(u.length);for(let m=0;m<u.length;m++){var C;h[m]=a.asNestedTest({options:n,index:m,parent:u,parentPath:n.path,originalParent:(C=n.originalValue)!=null?C:t})}this.runTests({value:u,tests:h,originalValue:(d=n.originalValue)!=null?d:t,options:n},r,m=>o(m.concat(l),u))})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}json(){return this.transform(XP)}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!ud(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+xa(t));return n.innerType=t,n.spec=Object.assign({},n.spec,{types:t}),n}length(t,n=I8.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n){return n=n||I8.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n){return n=n||I8.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(r,o,i)=>!t(r,o,i):r=>!!r;return this.transform(r=>r!=null?r.filter(n):r)}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);if(n.innerType){var o;let i=t;(o=i)!=null&&o.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[0]})),r.innerType=n.innerType.describe(i)}return r}}eT.prototype=tT.prototype;const MIe=e=>{const t={},n=(r,o="")=>{if("inputType"in r){const i=HIe(r);i&&(t[o]=i)}else Object.entries(r).forEach(([i,a])=>{if(i!=="label"&&i!=="description"){const s=o?`${o}.${i}`:i;n(a,s)}})};return Object.entries(e).forEach(([r,o])=>{n(o,r)}),qP().shape(t)},HIe=e=>{let t;switch(e.inputType){case"text":t=P8();break;case"slider":case"range-slider":t=QP();break;case"select":t=P8();break;case"multiselect":t=eT().of(P8());break;case"checkbox":t=UP();break;default:return null}return e.required&&(t=t.required(`${e.label||"This field"} is required`)),(e.inputType==="slider"||e.inputType==="range-slider")&&(e.min!==void 0&&(t=t.min(e.min,`Must be at least ${e.min}`)),e.max!==void 0&&(t=t.max(e.max,`Must be at most ${e.max}`))),t},XS=e=>{const t={},n=(r,o="")=>{Object.entries(r).forEach(([i,a])=>{const s=o?`${o}.${i}`:i;a&&typeof a=="object"&&!Array.isArray(a)?n(a,s):t[s]=a})};return n(e),t},LIe=e=>{const t={};return Object.entries(e).forEach(([n,r])=>{const o=n.split(".");let i=t;for(let a=0;a<o.length-1;a++){const s=o[a];s in i||(i[s]={}),i=i[s]}i[o[o.length-1]]=r}),t},OIe=({name:e,control:t,field:n,className:r=""})=>{const o=(i,a)=>{const s={width:n.width||"100%",disabled:!1};switch(n.inputType){case"text":return V.jsx(x9,{...s,placeholder:n.placeholder,value:i||"",onChange:l=>a(l.target.value)});case"select":return V.jsx(Ql,{...s,placeholder:n.placeholder||"Select an option",value:i,onChange:a,options:n.options||[]});case"multiselect":return V.jsx(eA,{...s,placeholder:n.placeholder||"Select options",value:i||[],onChange:a,options:n.options||[]});case"checkbox":return V.jsx(Du,{value:i||!1,onChange:a});case"slider":return V.jsx(k4,{label:n.label,min:n.min||0,max:n.max||100,value:i||n.min||0,onChange:a,name:e});case"range-slider":return V.jsxs("div",{className:"range-slider-container",children:[V.jsx(k4,{label:`${n.label} (Min)`,min:n.min||0,max:n.max||100,value:Array.isArray(i)?i[0]:n.min||0,onChange:l=>{const u=Array.isArray(i)?i:[n.min||0,n.max||100];a([l,u[1]])},name:`${e}_min`}),V.jsx(k4,{label:`${n.label} (Max)`,min:n.min||0,max:n.max||100,value:Array.isArray(i)?i[1]:n.max||100,onChange:l=>{const u=Array.isArray(i)?i:[n.min||0,n.max||100];a([u[0],l])},name:`${e}_max`})]});default:return V.jsxs("div",{className:"unsupported-field",children:["Unsupported field type: ",n.inputType]})}};return V.jsxs("div",{className:`form-field ${r}`,children:[n.label&&n.inputType!=="slider"&&n.inputType!=="range-slider"&&V.jsxs("label",{className:"form-field-label",children:[n.label,n.required&&V.jsx("span",{className:"required",children:"*"})]}),n.description&&V.jsx("p",{className:"form-field-description",children:n.description}),V.jsx(ps,{name:e,control:t,defaultValue:n.defaultValue||n.defaultValues,render:({field:i})=>V.jsx("div",{className:"form-field-input",children:o(i.value,i.onChange)})})]})},nT=({name:e,config:t,control:n,level:r,className:o=""})=>{const[i,a]=B.useState(!0);if("inputType"in t)return V.jsx(OIe,{name:e,control:n,field:t,className:o});const l=t,u=r>0,d=Object.keys(l).filter(C=>C!=="label"&&C!=="description").length>1,h=()=>V.jsx("div",{className:"form-section-content",children:Object.entries(l).map(([C,m])=>C==="label"||C==="description"?null:V.jsx(nT,{name:`${e}.${C}`,config:m,control:n,level:r+1,className:"form-section-child"},C))});return u&&d?V.jsxs("div",{className:`form-section accordion ${o}`,children:[V.jsxs("div",{className:"form-section-header accordion-header",onClick:()=>a(!i),children:[V.jsxs("div",{className:"accordion-title",children:[l.label&&V.jsx("h3",{className:"form-section-title",children:l.label}),l.description&&V.jsx("p",{className:"form-section-description",children:l.description})]}),V.jsx("div",{className:`accordion-icon ${i?"expanded":"collapsed"}`,children:"▼"})]}),i&&h()]}):V.jsxs("div",{className:`form-section simple ${o}`,children:[l.label&&V.jsxs("div",{className:"form-section-header simple-header",children:[V.jsx("h3",{className:"form-section-title",children:l.label}),l.description&&V.jsx("p",{className:"form-section-description",children:l.description})]}),h()]})},BIe=({formConfig:e={},width:t,height:n,onSubmit:r,submitButtonText:o="Submit",submitButtonProps:i={},showResetButton:a=!1,resetButtonText:s="Reset",resetButtonProps:l={},defaultValues:u={},className:d=""})=>{const h=MIe(e),{control:C,handleSubmit:m,reset:A,formState:{errors:v,isSubmitting:p}}=IP({resolver:KDe(h),defaultValues:XS(u)}),w=S=>{const _=LIe(S);r==null||r(_)},x=()=>{A(XS(u))},E=()=>Object.entries(e).map(([S,_])=>V.jsx(nT,{name:S,config:_,control:C,level:0,className:"form-section-root"},S));return V.jsxs("div",{className:`form-group ${d}`,style:{width:t,height:n,minWidth:t,minHeight:n,maxWidth:t,maxHeight:n},children:[V.jsxs("form",{onSubmit:m(w),className:"form-group-form",children:[V.jsx("div",{className:"form-group-content",children:E()}),(r||a)&&V.jsxs("div",{className:"form-group-actions",children:[a&&V.jsx($0,{type:"button",content:s,onClick:x,...l}),r&&V.jsx($0,{type:"submit",content:o,loading:p,...i})]})]}),Object.keys(v).length>0&&process.env.NODE_ENV==="development"&&V.jsxs("div",{className:"form-group-errors",children:[V.jsx("h4",{children:"Form Errors:"}),V.jsx("pre",{children:JSON.stringify(v,null,2)})]})]})},Fg=()=>{const e=B.useRef(!1),t=B.useRef(!1);return B.useEffect(()=>{const o=l=>{l.key==="Control"&&(e.current=!0,W1.success("Control pressed, Handling control press events")),l.key==="Alt"&&(t.current=!0,W1.success("Alt pressed, Handling alt press events")),l.key==="Command"&&(e.current=!0,W1.success("Command pressed, Handling command press events"))},i=l=>{l.key==="Control"&&(e.current=!1),l.key==="Alt"&&(t.current=!1),l.key==="Command"&&(e.current=!1)},a=()=>{document.hidden&&(e.current=!1,t.current=!1)},s=()=>{e.current=!1,t.current=!1};return window.addEventListener("keydown",o),window.addEventListener("keyup",i),document.addEventListener("visibilitychange",a),window.addEventListener("blur",s),()=>{window.removeEventListener("keydown",o),window.removeEventListener("keyup",i),document.removeEventListener("visibilitychange",a),window.removeEventListener("blur",s)}},[]),{isCtrlPressedFunc:()=>e.current,isAltPressedFunc:()=>t.current}};exports.AnnotationComponentLibrary=UAe;exports.AwiAnnotationHotkeys=wg;exports.AwiAnnotationTools=x8;exports.AwiCanvasContainer=E8;exports.AwiCustomConfirmation=WD;exports.AwiEmptyState=qAe;exports.AwiHelperMethods=B2;exports.AwiInput=YR;exports.AwiLoadMoreButton=fve;exports.AwiMessageScreen=_8;exports.AwiModal=$u;exports.AwiModalBody=Uu;exports.AwiModalFooter=Ku;exports.AwiModalHeader=Wu;exports.AwiModalRow=C4;exports.AwiPagination=iI;exports.AwiSafeLocalStorage=ga;exports.AwiSamModal=XR;exports.AwiScrollableTableCellList=hve;exports.AwiSlider=k4;exports.AwiTableBar=dve;exports.AwiTableBody=oI;exports.AwiTableCell=m4;exports.AwiTableHeader=sR;exports.AwiTableHeaders=lR;exports.AwiTableInfinite=rI;exports.AwiTableRow=rp;exports.AwiToastMessage=W1;exports.AwiUseKeyChecker=Fg;exports.Backdrop=UR;exports.Badge=Cve;exports.Button=$0;exports.ButtonGroup=gve;exports.Chart=CEe;exports.CompactEventCard=tP;exports.ContactInput=Vke;exports.DEFAULT_THEME=LR;exports.DatePicker=zke;exports.DateRangePicker=Qke;exports.DetectionCarousel=rP;exports.Dropdown=Yke;exports.EventPreview=Xke;exports.FloorMapView=HRe;exports.FormGroup=BIe;exports.Heatmap=eDe;exports.Icon=Gr;exports.Input=x9;exports.LiveDot=tDe;exports.LoginPage=yDe;exports.MapView=MDe;exports.Menu=HDe;exports.Modal=ODe;exports.MonthPicker=BDe;exports.Multiselect=eA;exports.Pagination=kDe;exports.Popover=RDe;exports.Refresh=IDe;exports.Select=Ql;exports.Sidebar=PDe;exports.Spinner=Nu;exports.Switch=PP;exports.Table=NDe;exports.ThemeProvider=phe;exports.Toast=iR;exports.Topbar=FDe;exports.WeekPicker=$De;exports.showToast=f4;exports.usePagination=Tz;exports.usePointerState=vhe;exports.useResize=w8;exports.useTheme=Ahe;exports.useToast=bhe;
|