@ambuj.bhaskar/react-component-library 0.30.7 → 0.30.8
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/index.cjs +1 -1
- package/dist/index.js +5 -2
- package/dist/index.umd.js +1 -1
- package/package.json +106 -106
package/dist/index.cjs
CHANGED
|
@@ -721,4 +721,4 @@ https://sweetalert2.github.io/#ajax-request`),xve(e),typeof e.title=="string"&&(
|
|
|
721
721
|
*/var DRe=_4.exports,RS;function IRe(){return RS||(RS=1,function(e,t){(function(n,r){r(t)})(DRe,function(n){var r="1.9.4";function o(f){var b,O,Z,Y;for(O=1,Z=arguments.length;O<Z;O++){Y=arguments[O];for(b in Y)f[b]=Y[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,Y,ce,Re;return Re=function(){Z=!1,Y&&(ce.apply(O,Y),Y=!1)},ce=function(){Z?Y=arguments:(f.apply(O,arguments),setTimeout(Re,b),Z=!0)},ce}function d(f,b,O){var Z=b[1],Y=b[0],ce=Z-Y;return f===Z&&O?f:((f-Y)%ce+ce)%ce+Y}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 v(f){return m(f).split(/\s+/)}function A(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 Y in f)Z.push(encodeURIComponent(O?Y.toUpperCase():Y)+"="+encodeURIComponent(f[Y]));return(!b||b.indexOf("?")===-1?"?":"&")+Z.join("&")}var y=/\{ *([\w_ -]+) *\}/g;function x(f,b){return f.replace(y,function(O,Z){var Y=b[Z];if(Y===void 0)throw new Error("No value provided for variable "+O);return typeof Y=="function"&&(Y=Y(b)),Y})}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 B=window.requestAnimationFrame||M("RequestAnimationFrame")||R,I=window.cancelAnimationFrame||M("CancelAnimationFrame")||M("CancelRequestAnimationFrame")||function(f){window.clearTimeout(f)};function P(f,b,O){if(O&&B===R)f.call(b);else return B.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:v,setOptions:A,getParamString:p,template:x,isArray:E,indexOf:S,emptyImageUrl:_,requestFn:B,cancelFn:I,requestAnimFrame:P,cancelAnimFrame:T};function F(){}F.extend=function(f){var b=function(){A(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 Y in this)Object.prototype.hasOwnProperty.call(this,Y)&&Y!=="prototype"&&Y!=="__super__"&&(b[Y]=this[Y]);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 ce=0,Re=Z._initHooks.length;ce<Re;ce++)Z._initHooks[ce].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=v(f);for(var Y=0,ce=f.length;Y<ce;Y++)this._on(f[Y],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=v(f);for(var Y=arguments.length===1,ce=0,Re=f.length;ce<Re;ce++)Y?this._off(f[ce]):this._off(f[ce],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 Y={fn:b,ctx:O};Z&&(Y.once=!0),this._events=this._events||{},this._events[f]=this._events[f]||[],this._events[f].push(Y)}},_off:function(f,b,O){var Z,Y,ce;if(this._events&&(Z=this._events[f],!!Z)){if(arguments.length===1){if(this._firingCount)for(Y=0,ce=Z.length;Y<ce;Y++)Z[Y].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 et=Z[Re];this._firingCount&&(et.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 Y=this._events[f];if(Y){this._firingCount=this._firingCount+1||1;for(var ce=0,Re=Y.length;ce<Re;ce++){var et=Y[ce],ct=et.fn;et.once&&this.off(f,ct,et.ctx),ct.call(et.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 Y=b;typeof b!="function"&&(Z=!!b,Y=void 0,O=void 0);var ce=this._events&&this._events[f];if(ce&&ce.length&&this._listens(f,Y,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 Y=0,ce=Z.length;Y<ce;Y++)if(Z[Y].fn===b&&Z[Y].ctx===O)return Y;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=v(f);for(var Y=0,ce=f.length;Y<ce;Y++)this._on(f[Y],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 U=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,Y=O.length;Z<Y;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=G(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=G(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=G(f);var b=this.min,O=this.max,Z=f.min,Y=f.max,ce=Y.x>=b.x&&Z.x<=O.x,Re=Y.y>=b.y&&Z.y<=O.y;return ce&&Re},overlaps:function(f){f=G(f);var b=this.min,O=this.max,Z=f.min,Y=f.max,ce=Y.x>b.x&&Z.x<O.x,Re=Y.y>b.y&&Z.y<O.y;return ce&&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,Y=Math.abs(b.y-O.y)*f;return G(K(b.x-Z,b.y-Y),K(O.x+Z,O.y+Y))},equals:function(f){return f?(f=G(f),this.min.equals(f.getTopLeft())&&this.max.equals(f.getBottomRight())):!1}};function G(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,Y=O.length;Z<Y;Z++)this.extend(O[Z])}X.prototype={extend:function(f){var b=this._southWest,O=this._northEast,Z,Y;if(f instanceof ee)Z=f,Y=f;else if(f instanceof X){if(Z=f._southWest,Y=f._northEast,!Z||!Y)return this}else return f?this.extend(ne(f)||J(f)):this;return!b&&!O?(this._southWest=new ee(Z.lat,Z.lng),this._northEast=new ee(Y.lat,Y.lng)):(b.lat=Math.min(Z.lat,b.lat),b.lng=Math.min(Z.lng,b.lng),O.lat=Math.max(Y.lat,O.lat),O.lng=Math.max(Y.lng,O.lng)),this},pad:function(f){var b=this._southWest,O=this._northEast,Z=Math.abs(b.lat-O.lat)*f,Y=Math.abs(b.lng-O.lng)*f;return new X(new ee(b.lat-Z,b.lng-Y),new ee(O.lat+Z,O.lng+Y))},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=ne(f):f=J(f);var b=this._southWest,O=this._northEast,Z,Y;return f instanceof X?(Z=f.getSouthWest(),Y=f.getNorthEast()):Z=Y=f,Z.lat>=b.lat&&Y.lat<=O.lat&&Z.lng>=b.lng&&Y.lng<=O.lng},intersects:function(f){f=J(f);var b=this._southWest,O=this._northEast,Z=f.getSouthWest(),Y=f.getNorthEast(),ce=Y.lat>=b.lat&&Z.lat<=O.lat,Re=Y.lng>=b.lng&&Z.lng<=O.lng;return ce&&Re},overlaps:function(f){f=J(f);var b=this._southWest,O=this._northEast,Z=f.getSouthWest(),Y=f.getNorthEast(),ce=Y.lat>b.lat&&Z.lat<O.lat,Re=Y.lng>b.lng&&Z.lng<O.lng;return ce&&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=ne(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 oe.distance(this,ne(f))},wrap:function(){return oe.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 ne(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),Y=this.transformation.transform(b.max,O);return new $(Z,Y)},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,Y=b.lng-O.lng;if(Z===0&&Y===0)return f;var ce=f.getSouthWest(),Re=f.getNorthEast(),et=new ee(ce.lat-Z,ce.lng-Y),ct=new ee(Re.lat-Z,Re.lng-Y);return new X(et,ct)}},oe=o({},he,{wrapLng:[-180,180],R:6371e3,distance:function(f,b){var O=Math.PI/180,Z=f.lat*O,Y=b.lat*O,ce=Math.sin((b.lat-f.lat)*O/2),Re=Math.sin((b.lng-f.lng)*O/2),et=ce*ce+Math.cos(Z)*Math.cos(Y)*Re*Re,ct=2*Math.atan2(Math.sqrt(et),Math.sqrt(1-et));return this.R*ct}}),ye=6378137,be={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),Y=Math.sin(Z*b);return new Q(this.R*f.lng*b,this.R*Math.log((1+Y)/(1-Y))/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 ge(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}ge.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 ue(f,b,O,Z){return new ge(f,b,O,Z)}var le=o({},oe,{code:"EPSG:3857",projection:be,transformation:function(){var f=.5/(Math.PI*be.R);return ue(f,.5,-f,.5)}()}),Ce=o({},le,{code:"EPSG:900913"});function Ee(f){return document.createElementNS("http://www.w3.org/2000/svg",f)}function Se(f,b){var O="",Z,Y,ce,Re,et,ct;for(Z=0,ce=f.length;Z<ce;Z++){for(et=f[Z],Y=0,Re=et.length;Y<Re;Y++)ct=et[Y],O+=(Y?"L":"M")+ct.x+" "+ct.y;O+=b?at.svg?"z":"x":""}return O||"M0 0"}var Ve=document.documentElement.style,ae="ActiveXObject"in window,Ue=ae&&!document.addEventListener,se="msLaunchUri"in navigator&&!("documentMode"in document),re=Ht("webkit"),me=Ht("android"),Oe=Ht("android 2")||Ht("android 3"),xe=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Me=me&&Ht("Google")&&xe<537&&!("AudioNode"in window),Ie=!!window.opera,qe=!se&&Ht("chrome"),nt=Ht("gecko")&&!re&&!Ie&&!ae,Je=!qe&&Ht("safari"),gt=Ht("phantom"),Ke="OTransition"in Ve,De=navigator.platform.indexOf("Win")===0,ft=ae&&"transition"in Ve,Ge="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!Oe,Qe="MozPerspective"in Ve,rt=!window.L_DISABLE_3D&&(ft||Ge||Qe)&&!Ke&&!gt,Fe=typeof orientation<"u"||Ht("mobile"),dt=Fe&&re,Pt=Fe&&Ge,Nt=!window.PointerEvent&&window.MSPointerEvent,tn=!!(window.PointerEvent||Nt),fn="ontouchstart"in window||!!window.TouchEvent,Wt=!window.L_NO_TOUCH&&(fn||tn),En=Fe&&Ie,Xt=Fe&&nt,Zt=(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}(),kt=function(){return!!document.createElement("canvas").getContext}(),wt=!!(document.createElementNS&&Ee("svg").createSVGRect),Dt=!!wt&&function(){var f=document.createElement("div");return f.innerHTML="<svg/>",(f.firstChild&&f.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),rn=!wt&&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}}(),bt=navigator.platform.indexOf("Mac")===0,tt=navigator.platform.indexOf("Linux")===0;function Ht(f){return navigator.userAgent.toLowerCase().indexOf(f)>=0}var at={ie:ae,ielt9:Ue,edge:se,webkit:re,android:me,android23:Oe,androidStock:Me,opera:Ie,chrome:qe,gecko:nt,safari:Je,phantom:gt,opera12:Ke,win:De,ie3d:ft,webkit3d:Ge,gecko3d:Qe,any3d:rt,mobile:Fe,mobileWebkit:dt,mobileWebkit3d:Pt,msPointer:Nt,pointer:tn,touch:Wt,touchNative:fn,mobileOpera:En,mobileGecko:Xt,retina:Zt,passiveEvents:Ot,canvas:kt,svg:wt,vml:rn,inlineSvg:Dt,mac:bt,linux:tt},Ut=at.msPointer?"MSPointerDown":"pointerdown",Ae=at.msPointer?"MSPointerMove":"pointermove",ot=at.msPointer?"MSPointerUp":"pointerup",We=at.msPointer?"MSPointerCancel":"pointercancel",vt={touchstart:Ut,touchmove:Ae,touchend:ot,touchcancel:We},Xe={touchstart:it,touchmove:ht,touchend:ht,touchcancel:ht},xt={},Bt=!1;function jt(f,b,O){return b==="touchstart"&&$e(),Xe[b]?(O=Xe[b].bind(this,O),f.addEventListener(vt[b],O,!1),O):(console.warn("wrong event specified:",b),h)}function On(f,b,O){if(!vt[b]){console.warn("wrong event specified:",b);return}f.removeEventListener(vt[b],O,!1)}function Yt(f){xt[f.pointerId]=f}function mn(f){xt[f.pointerId]&&(xt[f.pointerId]=f)}function _t(f){delete xt[f.pointerId]}function $e(){Bt||(document.addEventListener(Ut,Yt,!0),document.addEventListener(Ae,mn,!0),document.addEventListener(ot,_t,!0),document.addEventListener(We,_t,!0),Bt=!0)}function ht(f,b){if(b.pointerType!==(b.MSPOINTER_TYPE_MOUSE||"mouse")){b.touches=[];for(var O in xt)b.touches.push(xt[O]);b.changedTouches=[b],f(b)}}function it(f,b){b.MSPOINTER_TYPE_TOUCH&&b.pointerType===b.MSPOINTER_TYPE_TOUCH&&$n(b),ht(f,b)}function Jt(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 Hn=200;function _n(f,b){f.addEventListener("dblclick",b);var O=0,Z;function Y(ce){if(ce.detail!==1){Z=ce.detail;return}if(!(ce.pointerType==="mouse"||ce.sourceCapabilities&&!ce.sourceCapabilities.firesTouchEvents)){var Re=Fi(ce);if(!(Re.some(function(ct){return ct instanceof HTMLLabelElement&&ct.attributes.for})&&!Re.some(function(ct){return ct instanceof HTMLInputElement||ct instanceof HTMLSelectElement}))){var et=Date.now();et-O<=Hn?(Z++,Z===2&&b(Jt(ce))):Z=1,O=et}}}return f.addEventListener("click",Y),{dblclick:b,simDblclick:Y}}function Vn(f,b){f.removeEventListener("dblclick",b.dblclick),f.removeEventListener("click",b.simDblclick)}var Gn=Tt(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),zn=Tt(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Kt=zn==="webkitTransition"||zn==="OTransition"?zn+"End":"transitionend";function xn(f){return typeof f=="string"?document.getElementById(f):f}function kn(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 Vt(f,b,O){var Z=document.createElement(f);return Z.className=b||"",O&&O.appendChild(Z),Z}function hn(f){var b=f.parentNode;b&&b.removeChild(f)}function Xn(f){for(;f.firstChild;)f.removeChild(f.firstChild)}function S1(f){var b=f.parentNode;b&&b.lastChild!==f&&b.appendChild(f)}function t1(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=Gt(f);return O.length>0&&new RegExp("(^|\\s)"+b+"(\\s|$)").test(O)}function pn(f,b){if(f.classList!==void 0)for(var O=v(b),Z=0,Y=O.length;Z<Y;Z++)f.classList.add(O[Z]);else if(!H1(f,b)){var ce=Gt(f);Pn(f,(ce?ce+" ":"")+b)}}function In(f,b){f.classList!==void 0?f.classList.remove(b):Pn(f,m((" "+Gt(f)+" ").replace(" "+b+" "," ")))}function Pn(f,b){f.className.baseVal===void 0?f.className=b:f.className.baseVal=b}function Gt(f){return f.correspondingElement&&(f=f.correspondingElement),f.className.baseVal===void 0?f.className:f.className.baseVal}function yt(f,b){"opacity"in f.style?f.style.opacity=b:"filter"in f.style&&Ft(f,b)}function Ft(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 Tt(f){for(var b=document.documentElement.style,O=0;O<f.length;O++)if(f[O]in b)return f[O];return!1}function st(f,b,O){var Z=b||new Q(0,0);f.style[Gn]=(at.ie3d?"translate("+Z.x+"px,"+Z.y+"px)":"translate3d("+Z.x+"px,"+Z.y+"px,0)")+(O?" scale("+O+")":"")}function wn(f,b){f._leaflet_pos=b,at.any3d?st(f,b):(f.style.left=b.x+"px",f.style.top=b.y+"px")}function Bn(f){return f._leaflet_pos||new Q(0,0)}var L1,m1,G1;if("onselectstart"in document)L1=function(){jn(window,"selectstart",$n)},m1=function(){yn(window,"selectstart",$n)};else{var vn=Tt(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);L1=function(){if(vn){var f=document.documentElement.style;G1=f[vn],f[vn]="none"}},m1=function(){vn&&(document.documentElement.style[vn]=G1,G1=void 0)}}function Rt(){jn(window,"dragstart",$n)}function $t(){yn(window,"dragstart",$n)}var bn,on;function c1(f){for(;f.tabIndex===-1;)f=f.parentNode;f.style&&(ar(),bn=f,on=f.style.outlineStyle,f.style.outlineStyle="none",jn(window,"keydown",ar))}function ar(){bn&&(bn.style.outlineStyle=on,bn=void 0,on=void 0,yn(window,"keydown",ar))}function O1(f){do f=f.parentNode;while((!f.offsetWidth||!f.offsetHeight)&&f!==document.body);return f}function An(f){var b=f.getBoundingClientRect();return{x:b.width/f.offsetWidth||1,y:b.height/f.offsetHeight||1,boundingClientRect:b}}var b0={__proto__:null,TRANSFORM:Gn,TRANSITION:zn,TRANSITION_END:Kt,get:xn,getStyle:kn,create:Vt,remove:hn,empty:Xn,toFront:S1,toBack:t1,hasClass:H1,addClass:pn,removeClass:In,setClass:Pn,getClass:Gt,setOpacity:yt,testProp:Tt,setTransform:st,setPosition:wn,getPosition:Bn,get disableTextSelection(){return L1},get enableTextSelection(){return m1},disableImageDrag:Rt,enableImageDrag:$t,preventOutline:c1,restoreOutline:ar,getSizedParentNode:O1,getScale:An};function jn(f,b,O,Z){if(b&&typeof b=="object")for(var Y in b)k1(f,Y,b[Y],O);else{b=v(b);for(var ce=0,Re=b.length;ce<Re;ce++)k1(f,b[ce],O,Z)}return this}var Jr="_leaflet_events";function yn(f,b,O,Z){if(arguments.length===1)Cn(f),delete f[Jr];else if(b&&typeof b=="object")for(var Y in b)Y1(f,Y,b[Y],O);else if(b=v(b),arguments.length===2)Cn(f,function(et){return S(b,et)!==-1});else for(var ce=0,Re=b.length;ce<Re;ce++)Y1(f,b[ce],O,Z);return this}function Cn(f,b){for(var O in f[Jr]){var Z=O.split(/\d/)[0];(!b||b(Z))&&Y1(f,Z,null,null,O)}}var Dn={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function k1(f,b,O,Z){var Y=b+l(O)+(Z?"_"+l(Z):"");if(f[Jr]&&f[Jr][Y])return this;var ce=function(et){return O.call(Z||f,et||window.event)},Re=ce;!at.touchNative&&at.pointer&&b.indexOf("touch")===0?ce=jt(f,b,ce):at.touch&&b==="dblclick"?ce=_n(f,ce):"addEventListener"in f?b==="touchstart"||b==="touchmove"||b==="wheel"||b==="mousewheel"?f.addEventListener(Dn[b]||b,ce,at.passiveEvents?{passive:!1}:!1):b==="mouseenter"||b==="mouseleave"?(ce=function(et){et=et||window.event,Ra(f,et)&&Re(et)},f.addEventListener(Dn[b],ce,!1)):f.addEventListener(b,Re,!1):f.attachEvent("on"+b,ce),f[Jr]=f[Jr]||{},f[Jr][Y]=ce}function Y1(f,b,O,Z,Y){Y=Y||b+l(O)+(Z?"_"+l(Z):"");var ce=f[Jr]&&f[Jr][Y];if(!ce)return this;!at.touchNative&&at.pointer&&b.indexOf("touch")===0?On(f,b,ce):at.touch&&b==="dblclick"?Vn(f,ce):"removeEventListener"in f?f.removeEventListener(Dn[b]||b,ce,!1):f.detachEvent("on"+b,ce),f[Jr][Y]=null}function M1(f){return f.stopPropagation?f.stopPropagation():f.originalEvent?f.originalEvent._stopped=!0:f.cancelBubble=!0,this}function Z2(f){return k1(f,"wheel",M1),this}function T0(f){return jn(f,"mousedown touchstart dblclick contextmenu",M1),f._leaflet_disable_click=!0,this}function $n(f){return f.preventDefault?f.preventDefault():f.returnValue=!1,this}function o1(f){return $n(f),M1(f),this}function Fi(f){if(f.composedPath)return f.composedPath();for(var b=[],O=f.target;O;)b.push(O),O=O.parentNode;return b}function k9(f,b){if(!b)return new Q(f.clientX,f.clientY);var O=An(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=at.linux&&at.chrome?window.devicePixelRatio:at.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function $2(f){return at.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 Ra(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 B9={__proto__:null,on:jn,off:yn,stopPropagation:M1,disableScrollPropagation:Z2,disableClickPropagation:T0,preventDefault:$n,stop:o1,getPropagationPath:Fi,getMousePosition:k9,getWheelDelta:$2,isExternalTarget:Ra,addListener:jn,removeListener:yn},R9=U.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=Bn(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(),wn(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)}}),p1=U.extend({options:{crs:le,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=A(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(ne(b.center),b.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=zn&&at.any3d&&!at.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),jn(this._proxy,Kt,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(ne(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||(at.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+f,b)},zoomOut:function(f,b){return f=f||(at.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-f,b)},setZoomAround:function(f,b,O){var Z=this.getZoomScale(b),Y=this.getSize().divideBy(2),ce=f instanceof Q?f:this.latLngToContainerPoint(f),Re=ce.subtract(Y).multiplyBy(1-1/Z),et=this.containerPointToLatLng(Y.add(Re));return this.setView(et,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]),Y=this.getBoundsZoom(f,!1,O.add(Z));if(Y=typeof b.maxZoom=="number"?Math.min(b.maxZoom,Y):Y,Y===1/0)return{center:f.getCenter(),zoom:Y};var ce=Z.subtract(O).divideBy(2),Re=this.project(f.getSouthWest(),Y),et=this.project(f.getNorthEast(),Y),ct=this.unproject(Re.add(et).divideBy(2).add(ce),Y);return{center:ct,zoom:Y}},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){pn(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||!at.any3d)return this.setView(f,b,O);this._stop();var Z=this.project(this.getCenter()),Y=this.project(f),ce=this.getSize(),Re=this._zoom;f=ne(f),b=b===void 0?Re:b;var et=Math.max(ce.x,ce.y),ct=et*this.getZoomScale(Re,b),Lt=Y.distanceTo(Z)||1,an=1.42,Tn=an*an;function e1(Qt){var x1=Qt?-1:1,fe=Qt?ct:et,Cr=ct*ct-et*et+x1*Tn*Tn*Lt*Lt,kr=2*fe*Tn*Lt,A1=Cr/kr,sn=Math.sqrt(A1*A1+1)-A1,Sr=sn<1e-9?-18:Math.log(sn);return Sr}function hr(Qt){return(Math.exp(Qt)-Math.exp(-Qt))/2}function we(Qt){return(Math.exp(Qt)+Math.exp(-Qt))/2}function pe(Qt){return hr(Qt)/we(Qt)}var ke=e1(0);function je(Qt){return et*(we(ke)/we(ke+an*Qt))}function Pe(Qt){return et*(we(ke)*pe(ke+an*Qt)-hr(ke))/Tn}function Ct(Qt){return 1-Math.pow(1-Qt,1.5)}var Et=Date.now(),en=(e1(1)-ke)/an,gn=O.duration?1e3*O.duration:1e3*en*.8;function pt(){var Qt=(Date.now()-Et)/gn,x1=Ct(Qt)*en;Qt<=1?(this._flyToFrame=P(pt,this),this._move(this.unproject(Z.add(Y.subtract(Z).multiplyBy(Pe(x1)/Lt)),Re),this.getScaleZoom(et/je(x1),Re),{flyTo:!0})):this._move(f,b)._moveEnd(!0)}return this._moveStart(!0,O.noMoveStart),pt.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]),Y=this.project(this.getCenter()),ce=this.project(f),Re=this.getPixelBounds(),et=G([Re.min.add(O),Re.max.subtract(Z)]),ct=et.getSize();if(!et.contains(ce)){this._enforcingBounds=!0;var Lt=ce.subtract(et.getCenter()),an=et.extend(ce).getSize().subtract(ct);Y.x+=Lt.x<0?-an.x:an.x,Y.y+=Lt.y<0?-an.y:an.y,this.panTo(this.unproject(Y),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(),Y=O.divideBy(2).round(),ce=Z.subtract(Y);return!ce.x&&!ce.y?this:(f.animate&&f.pan?this.panBy(ce):(f.pan&&this._rawPanBy(ce),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),Y=Z.toBounds(f.coords.accuracy*2),ce=this._locateOptions;if(ce.setView){var Re=this.getBoundsZoom(Y);this.setView(Z,ce.maxZoom?Math.min(Re,ce.maxZoom):Re)}var et={latlng:Z,bounds:Y,timestamp:f.timestamp};for(var ct in f.coords)typeof f.coords[ct]=="number"&&(et[ct]=f.coords[ct]);this.fire("locationfound",et)}},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(),hn(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)hn(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=Vt("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,Y=this.getMinZoom(),ce=this.getMaxZoom(),Re=f.getNorthWest(),et=f.getSouthEast(),ct=this.getSize().subtract(O),Lt=G(this.project(et,Z),this.project(Re,Z)).getSize(),an=at.any3d?this.options.zoomSnap:1,Tn=ct.x/Lt.x,e1=ct.y/Lt.y,hr=b?Math.max(Tn,e1):Math.min(Tn,e1);return Z=this.getScaleZoom(hr,Z),an&&(Z=Math.round(Z/(an/100))*(an/100),Z=b?Math.ceil(Z/an)*an:Math.floor(Z/an)*an),Math.max(Y,Math.min(ce,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(ne(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(ne(f))._round();return b._subtract(this.getPixelOrigin())},wrapLatLng:function(f){return this.options.crs.wrapLatLng(ne(f))},wrapLatLngBounds:function(f){return this.options.crs.wrapLatLngBounds(J(f))},distance:function(f,b){return this.options.crs.distance(ne(f),ne(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(ne(f)))},mouseEventToContainerPoint:function(f){return k9(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=xn(f);if(b){if(b._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");jn(b,"scroll",this._onScroll,this),this._containerId=l(b)},_initLayout:function(){var f=this._container;this._fadeAnimated=this.options.fadeAnimation&&at.any3d,pn(f,"leaflet-container"+(at.touch?" leaflet-touch":"")+(at.retina?" leaflet-retina":"")+(at.ielt9?" leaflet-oldie":"")+(at.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var b=kn(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),wn(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||(pn(f.markerPane,"leaflet-zoom-hide"),pn(f.shadowPane,"leaflet-zoom-hide"))},_resetView:function(f,b,O){wn(this._mapPane,new Q(0,0));var Z=!this._loaded;this._loaded=!0,b=this._limitZoom(b),this.fire("viewprereset");var Y=this._zoom!==b;this._moveStart(Y,O)._move(f,b)._moveEnd(Y),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 Y=this._zoom!==b;return this._zoom=b,this._lastCenter=f,this._pixelOrigin=this._getNewPixelOrigin(f),Z?O&&O.pinch&&this.fire("zoom",O):((Y||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){wn(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?yn:jn;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),at.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,Y=b==="mouseout"||b==="mouseover",ce=f.target||f.srcElement,Re=!1;ce;){if(Z=this._targets[l(ce)],Z&&(b==="click"||b==="preclick")&&this._draggableMoved(Z)){Re=!0;break}if(Z&&Z.listens(b,!0)&&(Y&&!Ra(ce,f)||(O.push(Z),Y))||ce===this._container)break;ce=ce.parentNode}return!O.length&&!Re&&!Y&&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"&&c1(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 Y=this._findEventTargets(f,b);if(O){for(var ce=[],Re=0;Re<O.length;Re++)O[Re].listens(b,!0)&&ce.push(O[Re]);Y=ce.concat(Y)}if(Y.length){b==="contextmenu"&&$n(f);var et=Y[0],ct={originalEvent:f};if(f.type!=="keypress"&&f.type!=="keydown"&&f.type!=="keyup"){var Lt=et.getLatLng&&(!et._radius||et._radius<=10);ct.containerPoint=Lt?this.latLngToContainerPoint(et.getLatLng()):this.mouseEventToContainerPoint(f),ct.layerPoint=this.containerPointToLayerPoint(ct.containerPoint),ct.latlng=Lt?et.getLatLng():this.layerPointToLatLng(ct.layerPoint)}for(Re=0;Re<Y.length;Re++)if(Y[Re].fire(b,ct,!0),ct.originalEvent._stopped||Y[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 Bn(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 G([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),Y=this.getSize().divideBy(2),ce=new $(Z.subtract(Y),Z.add(Y)),Re=this._getBoundsOffset(ce,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=G(this.project(b.getNorthEast(),O),this.project(b.getSouthWest(),O)),Y=Z.min.subtract(f.min),ce=Z.max.subtract(f.max),Re=this._rebound(Y.x,-ce.x),et=this._rebound(Y.y,-ce.y);return new Q(Re,et)},_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=at.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(){In(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=Vt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(f),this.on("zoomanim",function(b){var O=Gn,Z=this._proxy.style[O];st(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(){hn(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var f=this.getCenter(),b=this.getZoom();st(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),Y=this._getCenterOffset(f)._divideBy(1-1/Z);return O.animate!==!0&&!this.getSize().contains(Y)?!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,pn(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&&In(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 Or(f,b){return new p1(f,b)}var d0=F.extend({options:{position:"topright"},initialize:function(f){A(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 pn(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?(hn(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()}}),y0=function(f){return new d0(f)};p1.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=Vt("div",b+"control-container",this._container);function Z(Y,ce){var Re=b+Y+" "+b+ce;f[Y+ce]=Vt("div",Re,O)}Z("top","left"),Z("top","right"),Z("bottom","left"),Z("bottom","right")},_clearControlPos:function(){for(var f in this._controlCorners)hn(this._controlCorners[f]);hn(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Qo=d0.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){A(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 d0.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(){pn(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?(pn(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=f+"px"):In(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return In(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var f="leaflet-control-layers",b=this._container=Vt("div",f),O=this.options.collapsed;b.setAttribute("aria-haspopup",!0),T0(b),Z2(b);var Z=this._section=Vt("section",f+"-list");O&&(this._map.on("click",this.collapse,this),jn(b,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var Y=this._layersLink=Vt("a",f+"-toggle",b);Y.href="#",Y.title="Layers",Y.setAttribute("role","button"),jn(Y,{keydown:function(ce){ce.keyCode===13&&this._expandSafely()},click:function(ce){$n(ce),this._expandSafely()}},this),O||this.expand(),this._baseLayersList=Vt("div",f+"-base",Z),this._separator=Vt("div",f+"-separator",Z),this._overlaysList=Vt("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,Y){return this.options.sortFunction(Z.layer,Y.layer,Z.name,Y.name)},this)),this.options.autoZIndex&&f.setZIndex&&(this._lastZIndex++,f.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Xn(this._baseLayersList),Xn(this._overlaysList),this._layerControlInputs=[];var f,b,O,Z,Y=0;for(O=0;O<this._layers.length;O++)Z=this._layers[O],this._addItem(Z),b=b||Z.overlay,f=f||!Z.overlay,Y+=Z.overlay?0:1;return this.options.hideSingleBase&&(f=f&&Y>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),jn(Z,"click",this._onInputClick,this);var Y=document.createElement("span");Y.innerHTML=" "+f.name;var ce=document.createElement("span");b.appendChild(ce),ce.appendChild(Z),ce.appendChild(Y);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=[],Y=[];this._handlingClick=!0;for(var ce=f.length-1;ce>=0;ce--)b=f[ce],O=this._getLayer(b.layerId).layer,b.checked?Z.push(O):b.checked||Y.push(O);for(ce=0;ce<Y.length;ce++)this._map.hasLayer(Y[ce])&&this._map.removeLayer(Y[ce]);for(ce=0;ce<Z.length;ce++)this._map.hasLayer(Z[ce])||this._map.addLayer(Z[ce]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var f=this._layerControlInputs,b,O,Z=this._map.getZoom(),Y=f.length-1;Y>=0;Y--)b=f[Y],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,jn(f,"click",$n),this.expand();var b=this;setTimeout(function(){yn(f,"click",$n),b._preventClick=!1})}}),Da=function(f,b,O){return new Qo(f,b,O)},br=d0.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=Vt("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,Y){var ce=Vt("a",O,Z);return ce.innerHTML=f,ce.href="#",ce.title=b,ce.setAttribute("role","button"),ce.setAttribute("aria-label",b),T0(ce),jn(ce,"click",o1),jn(ce,"click",Y,this),jn(ce,"click",this._refocusOnMap,this),ce},_updateDisabled:function(){var f=this._map,b="leaflet-disabled";In(this._zoomInButton,b),In(this._zoomOutButton,b),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||f._zoom===f.getMinZoom())&&(pn(this._zoomOutButton,b),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||f._zoom===f.getMaxZoom())&&(pn(this._zoomInButton,b),this._zoomInButton.setAttribute("aria-disabled","true"))}});p1.mergeOptions({zoomControl:!0}),p1.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new br,this.addControl(this.zoomControl))});var js=function(f){return new br(f)},e2=d0.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(f){var b="leaflet-control-scale",O=Vt("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=Vt("div",b,O)),f.imperial&&(this._iScale=Vt("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,Y;b>5280?(O=b/5280,Z=this._getRoundNum(O),this._updateScale(this._iScale,Z+" mi",Z/O)):(Y=this._getRoundNum(b),this._updateScale(this._iScale,Y+" ft",Y/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}}),Vs=function(f){return new e2(f)},N0='<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>',Ia=d0.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(at.inlineSvg?N0+" ":"")+"Leaflet</a>"},initialize:function(f){A(this,f),this._attributions={}},onAdd:function(f){f.attributionControl=this,this._container=Vt("div","leaflet-control-attribution"),T0(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> ')}}});p1.mergeOptions({attributionControl:!0}),p1.addInitHook(function(){this.options.attributionControl&&new Ia().addTo(this)});var t2=function(f){return new Ia(f)};d0.Layers=Qo,d0.Zoom=br,d0.Scale=e2,d0.Attribution=Ia,y0.layers=Da,y0.zoom=js,y0.scale=Vs,y0.attribution=t2;var ur=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}});ur.addTo=function(f,b){return f.addHandler(b,this),this};var zs={Events:z},mr=at.touch?"touchstart mousedown":"mousedown",U2=U.extend({options:{clickTolerance:3},initialize:function(f,b,O,Z){A(this,Z),this._element=f,this._dragStartTarget=b||f,this._preventOutline=O},enable:function(){this._enabled||(jn(this._dragStartTarget,mr,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(U2._dragging===this&&this.finishDrag(!0),yn(this._dragStartTarget,mr,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&&c1(this._element),Rt(),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=Bn(this._element),this._parentScale=An(O);var Z=f.type==="mousedown";jn(document,Z?"mousemove":"touchmove",this._onMove,this),jn(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,$n(f),this._moved||(this.fire("dragstart"),this._moved=!0,pn(document.body,"leaflet-dragging"),this._lastTarget=f.target||f.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),pn(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),wn(this._element,this._newPos),this.fire("drag",f)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(f){In(document.body,"leaflet-dragging"),this._lastTarget&&(In(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),yn(document,"mousemove touchmove",this._onMove,this),yn(document,"mouseup touchend touchcancel",this._onUp,this),$t(),m1();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 Go(f,b,O){var Z,Y=[1,4,2,8],ce,Re,et,ct,Lt,an,Tn,e1;for(ce=0,an=f.length;ce<an;ce++)f[ce]._code=e0(f[ce],b);for(et=0;et<4;et++){for(Tn=Y[et],Z=[],ce=0,an=f.length,Re=an-1;ce<an;Re=ce++)ct=f[ce],Lt=f[Re],ct._code&Tn?Lt._code&Tn||(e1=w0(Lt,ct,Tn,b,O),e1._code=e0(e1,b),Z.push(e1)):(Lt._code&Tn&&(e1=w0(Lt,ct,Tn,b,O),e1._code=e0(e1,b),Z.push(e1)),Z.push(ct));f=Z}return f}function T1(f,b){var O,Z,Y,ce,Re,et,ct,Lt,an;if(!f||f.length===0)throw new Error("latlngs not passed");h0(f)||(console.warn("latlngs are not flat! Only the first ring will be used"),f=f[0]);var Tn=ne([0,0]),e1=J(f),hr=e1.getNorthWest().distanceTo(e1.getSouthWest())*e1.getNorthEast().distanceTo(e1.getNorthWest());hr<1700&&(Tn=Yo(f));var we=f.length,pe=[];for(O=0;O<we;O++){var ke=ne(f[O]);pe.push(b.project(ne([ke.lat-Tn.lat,ke.lng-Tn.lng])))}for(et=ct=Lt=0,O=0,Z=we-1;O<we;Z=O++)Y=pe[O],ce=pe[Z],Re=Y.y*ce.x-ce.y*Y.x,ct+=(Y.x+ce.x)*Re,Lt+=(Y.y+ce.y)*Re,et+=Re*3;et===0?an=pe[0]:an=[ct/et,Lt/et];var je=b.unproject(K(an));return ne([je.lat+Tn.lat,je.lng+Tn.lng])}function Yo(f){for(var b=0,O=0,Z=0,Y=0;Y<f.length;Y++){var ce=ne(f[Y]);b+=ce.lat,O+=ce.lng,Z++}return ne([b/Z,O/Z])}var D9={__proto__:null,clipPolygon:Go,polygonCenter:T1,centroid:Yo};function X1(f,b){if(!b||!f.length)return f.slice();var O=b*b;return f=E5(f,O),f=Zs(f,O),f}function f0(f,b,O){return Math.sqrt(ji(f,b,O,!0))}function Xo(f,b,O){return ji(f,b,O)}function Zs(f,b){var O=f.length,Z=typeof Uint8Array<"u"?Uint8Array:Array,Y=new Z(O);Y[0]=Y[O-1]=1,qo(f,Y,b,0,O-1);var ce,Re=[];for(ce=0;ce<O;ce++)Y[ce]&&Re.push(f[ce]);return Re}function qo(f,b,O,Z,Y){var ce=0,Re,et,ct;for(et=Z+1;et<=Y-1;et++)ct=ji(f[et],f[Z],f[Y],!0),ct>ce&&(Re=et,ce=ct);ce>O&&(b[Re]=1,qo(f,b,O,Z,Re),qo(f,b,O,Re,Y))}function E5(f,b){for(var O=[f[0]],Z=1,Y=0,ce=f.length;Z<ce;Z++)ti(f[Z],f[Y])>b&&(O.push(f[Z]),Y=Z);return Y<ce-1&&O.push(f[ce-1]),O}var Jo;function ei(f,b,O,Z,Y){var ce=Z?Jo:e0(f,O),Re=e0(b,O),et,ct,Lt;for(Jo=Re;;){if(!(ce|Re))return[f,b];if(ce&Re)return!1;et=ce||Re,ct=w0(f,b,et,O,Y),Lt=e0(ct,O),et===ce?(f=ct,ce=Lt):(b=ct,Re=Lt)}}function w0(f,b,O,Z,Y){var ce=b.x-f.x,Re=b.y-f.y,et=Z.min,ct=Z.max,Lt,an;return O&8?(Lt=f.x+ce*(ct.y-f.y)/Re,an=ct.y):O&4?(Lt=f.x+ce*(et.y-f.y)/Re,an=et.y):O&2?(Lt=ct.x,an=f.y+Re*(ct.x-f.x)/ce):O&1&&(Lt=et.x,an=f.y+Re*(et.x-f.x)/ce),new Q(Lt,an,Y)}function e0(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 ti(f,b){var O=b.x-f.x,Z=b.y-f.y;return O*O+Z*Z}function ji(f,b,O,Z){var Y=b.x,ce=b.y,Re=O.x-Y,et=O.y-ce,ct=Re*Re+et*et,Lt;return ct>0&&(Lt=((f.x-Y)*Re+(f.y-ce)*et)/ct,Lt>1?(Y=O.x,ce=O.y):Lt>0&&(Y+=Re*Lt,ce+=et*Lt)),Re=f.x-Y,et=f.y-ce,Z?Re*Re+et*et:new Q(Y,ce)}function h0(f){return!E(f[0])||typeof f[0][0]!="object"&&typeof f[0][0]<"u"}function Vi(f){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),h0(f)}function ni(f,b){var O,Z,Y,ce,Re,et,ct,Lt;if(!f||f.length===0)throw new Error("latlngs not passed");h0(f)||(console.warn("latlngs are not flat! Only the first ring will be used"),f=f[0]);var an=ne([0,0]),Tn=J(f),e1=Tn.getNorthWest().distanceTo(Tn.getSouthWest())*Tn.getNorthEast().distanceTo(Tn.getNorthWest());e1<1700&&(an=Yo(f));var hr=f.length,we=[];for(O=0;O<hr;O++){var pe=ne(f[O]);we.push(b.project(ne([pe.lat-an.lat,pe.lng-an.lng])))}for(O=0,Z=0;O<hr-1;O++)Z+=we[O].distanceTo(we[O+1])/2;if(Z===0)Lt=we[0];else for(O=0,ce=0;O<hr-1;O++)if(Re=we[O],et=we[O+1],Y=Re.distanceTo(et),ce+=Y,ce>Z){ct=(ce-Z)/Y,Lt=[et.x-ct*(et.x-Re.x),et.y-ct*(et.y-Re.y)];break}var ke=b.unproject(K(Lt));return ne([ke.lat+an.lat,ke.lng+an.lng])}var ri={__proto__:null,simplify:X1,pointToSegmentDistance:f0,closestPointOnSegment:Xo,clipSegment:ei,_getEdgeIntersection:w0,_getBitCode:e0,_sqClosestPointOnSegment:ji,isFlat:h0,_flat:Vi,polylineCenter:ni},x0={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])},oi={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,Y=this.R_MINOR/O,ce=Math.sqrt(1-Y*Y),Re=ce*Math.sin(Z),et=Math.tan(Math.PI/4-Z/2)/Math.pow((1-Re)/(1+Re),ce/2);return Z=-O*Math.log(Math.max(et,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,Y=Math.sqrt(1-Z*Z),ce=Math.exp(-f.y/O),Re=Math.PI/2-2*Math.atan(ce),et=0,ct=.1,Lt;et<15&&Math.abs(ct)>1e-7;et++)Lt=Y*Math.sin(Re),Lt=Math.pow((1-Lt)/(1+Lt),Y/2),ct=Math.PI/2-2*Math.atan(ce*Lt)-Re,Re+=ct;return new ee(Re*b,f.x*b/O)}},E0={__proto__:null,LonLat:x0,Mercator:oi,SphericalMercator:be},I9=o({},oe,{code:"EPSG:3395",projection:oi,transformation:function(){var f=.5/(Math.PI*oi.R);return ue(f,.5,-f,.5)}()}),$s=o({},oe,{code:"EPSG:4326",projection:x0,transformation:ue(1/180,1,-1/180,.5)}),P9=o({},he,{projection:x0,transformation:ue(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=oe,he.EPSG3395=I9,he.EPSG3857=le,he.EPSG900913=Ce,he.EPSG4326=$s,he.Simple=P9;var i1=U.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})}}});p1.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 Y=this._zoomBoundLayers[Z].options;f=Y.minZoom===void 0?f:Math.min(f,Y.minZoom),b=Y.maxZoom===void 0?b:Math.max(b,Y.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 F0=i1.extend({initialize:function(f,b){A(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)}}),zi=function(f,b){return new F0(f,b)},_0=F0.extend({addLayer:function(f){return this.hasLayer(f)?this:(f.addEventParent(this),F0.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),F0.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 _0(f,b)},v2=F.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(f){A(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 Y=K(Z),ce=K(b==="shadow"&&O.shadowAnchor||O.iconAnchor||Y&&Y.divideBy(2,!0));f.className="leaflet-marker-"+b+" "+(O.className||""),ce&&(f.style.marginLeft=-ce.x+"px",f.style.marginTop=-ce.y+"px"),Y&&(f.style.width=Y.x+"px",f.style.height=Y.y+"px")},_createImg:function(f,b){return b=b||document.createElement("img"),b.src=f,b},_getIconUrl:function(f){return at.retina&&this.options[f+"RetinaUrl"]||this.options[f+"Url"]}});function _5(f){return new v2(f)}var ii=v2.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 ii.imagePath!="string"&&(ii.imagePath=this._detectIconPath()),(this.options.imagePath||ii.imagePath)+v2.prototype._getIconUrl.call(this,f)},_stripUrl:function(f){var b=function(O,Z,Y){var ce=Z.exec(O);return ce&&ce[Y]};return f=b(f,/^url\((['"])?(.+)\1\)$/,2),f&&b(f,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var f=Vt("div","leaflet-default-icon-path",document.body),b=kn(f,"background-image")||kn(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):""}}),Us=ur.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(),pn(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&&In(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,Y=this._marker.options.autoPanPadding,ce=Bn(b._icon),Re=O.getPixelBounds(),et=O.getPixelOrigin(),ct=G(Re.min._subtract(et).add(Y),Re.max._subtract(et).subtract(Y));if(!ct.contains(ce)){var Lt=K((Math.max(ct.max.x,ce.x)-ct.max.x)/(Re.max.x-ct.max.x)-(Math.min(ct.min.x,ce.x)-ct.min.x)/(Re.min.x-ct.min.x),(Math.max(ct.max.y,ce.y)-ct.max.y)/(Re.max.y-ct.max.y)-(Math.min(ct.min.y,ce.y)-ct.min.y)/(Re.min.y-ct.min.y)).multiplyBy(Z);O.panBy(Lt,{animate:!1}),this._draggable._newPos._add(Lt),this._draggable._startPos._add(Lt),wn(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=Bn(b._icon),Y=b._map.layerPointToLatLng(Z);O&&wn(O,Z),b._latlng=Y,f.latlng=Y,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=i1.extend({options:{icon:new ii,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){A(this,b),this._latlng=ne(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=ne(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||"")),pn(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&&jn(O,"focus",this._panOnFocus,this);var Y=f.icon.createShadow(this._shadow),ce=!1;Y!==this._shadow&&(this._removeShadow(),ce=!0),Y&&(pn(Y,b),Y.alt=""),this._shadow=Y,f.opacity<1&&this._updateOpacity(),Z&&this.getPane().appendChild(this._icon),this._initInteraction(),Y&&ce&&this.getPane(f.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&yn(this._icon,"focus",this._panOnFocus,this),hn(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&hn(this._shadow),this._shadow=null},_setPos:function(f){this._icon&&wn(this._icon,f),this._shadow&&wn(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&&(pn(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Us)){var f=this.options.draggable;this.dragging&&(f=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Us(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&&yt(this._icon,f),this._shadow&&yt(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 go(f,b){return new Zi(f,b)}var K2=i1.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 A(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)}}),ai=K2.extend({options:{fill:!0,radius:10},initialize:function(f,b){A(this,b),this._latlng=ne(f),this._radius=this.options.radius},setLatLng:function(f){var b=this._latlng;return this._latlng=ne(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 B1(f,b){return new ai(f,b)}var S0=ai.extend({initialize:function(f,b,O){if(typeof b=="number"&&(b=o({},O,{radius:b})),A(this,b),this._latlng=ne(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===oe.distance){var Y=Math.PI/180,ce=this._mRadius/oe.R/Y,Re=O.project([b+ce,f]),et=O.project([b-ce,f]),ct=Re.add(et).divideBy(2),Lt=O.unproject(ct).lat,an=Math.acos((Math.cos(ce*Y)-Math.sin(b*Y)*Math.sin(Lt*Y))/(Math.cos(b*Y)*Math.cos(Lt*Y)))/Y;(isNaN(an)||an===0)&&(an=ce/Math.cos(Math.PI/180*b)),this._point=ct.subtract(O.getPixelOrigin()),this._radius=isNaN(an)?0:ct.x-O.project([Lt,f-an]).x,this._radiusY=ct.y-Re.y}else{var Tn=Z.unproject(Z.project(this._latlng).subtract([this._mRadius,0]));this._point=O.latLngToLayerPoint(this._latlng),this._radius=this._point.x-O.latLngToLayerPoint(Tn).x}this._updateBounds()}});function Q2(f,b,O){return new S0(f,b,O)}var dr=K2.extend({options:{smoothFactor:1,noClip:!1},initialize:function(f,b){A(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=ji,Y,ce,Re=0,et=this._parts.length;Re<et;Re++)for(var ct=this._parts[Re],Lt=1,an=ct.length;Lt<an;Lt++){Y=ct[Lt-1],ce=ct[Lt];var Tn=Z(f,Y,ce,!0);Tn<b&&(b=Tn,O=Z(f,Y,ce))}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 ni(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(f,b){return b=b||this._defaultShape(),f=ne(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 h0(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(f){for(var b=[],O=h0(f),Z=0,Y=f.length;Z<Y;Z++)O?(b[Z]=ne(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,Y=f.length,ce,Re;if(Z){for(Re=[],ce=0;ce<Y;ce++)Re[ce]=this._map.latLngToLayerPoint(f[ce]),O.extend(Re[ce]);b.push(Re)}else for(ce=0;ce<Y;ce++)this._projectLatlngs(f[ce],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,Y,ce,Re,et,ct;for(O=0,Y=0,ce=this._rings.length;O<ce;O++)for(ct=this._rings[O],Z=0,Re=ct.length;Z<Re-1;Z++)et=ei(ct[Z],ct[Z+1],f,Z,!0),et&&(b[Y]=b[Y]||[],b[Y].push(et[0]),(et[1]!==ct[Z+1]||Z===Re-2)&&(b[Y].push(et[1]),Y++))}},_simplifyPoints:function(){for(var f=this._parts,b=this.options.smoothFactor,O=0,Z=f.length;O<Z;O++)f[O]=X1(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,Y,ce,Re,et,ct=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(f))return!1;for(O=0,ce=this._parts.length;O<ce;O++)for(et=this._parts[O],Z=0,Re=et.length,Y=Re-1;Z<Re;Y=Z++)if(!(!b&&Z===0)&&f0(f,et[Y],et[Z])<=ct)return!0;return!1}});function Ws(f,b){return new dr(f,b)}dr._flat=Vi;var mo=dr.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=dr.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){dr.prototype._setLatLngs.call(this,f),h0(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return h0(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,Y=this._rings.length,ce;Z<Y;Z++)ce=Go(this._rings[Z],f,!0),ce.length&&this._parts.push(ce)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(f){var b=!1,O,Z,Y,ce,Re,et,ct,Lt;if(!this._pxBounds||!this._pxBounds.contains(f))return!1;for(ce=0,ct=this._parts.length;ce<ct;ce++)for(O=this._parts[ce],Re=0,Lt=O.length,et=Lt-1;Re<Lt;et=Re++)Z=O[Re],Y=O[et],Z.y>f.y!=Y.y>f.y&&f.x<(Y.x-Z.x)*(f.y-Z.y)/(Y.y-Z.y)+Z.x&&(b=!b);return b||dr.prototype._containsPoint.call(this,f,!0)}});function Ks(f,b){return new mo(f,b)}var Ur=_0.extend({initialize:function(f,b){A(this,b),this._layers={},f&&this.addData(f)},addData:function(f){var b=E(f)?f:f.features,O,Z,Y;if(b){for(O=0,Z=b.length;O<Z;O++)Y=b[O],(Y.geometries||Y.geometry||Y.features||Y.coordinates)&&this.addData(Y);return this}var ce=this.options;if(ce.filter&&!ce.filter(f))return this;var Re=t0(f,ce);return Re?(Re.feature=j0(f),Re.defaultOptions=Re.options,this.resetStyle(Re),ce.onEachFeature&&ce.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 t0(f,b){var O=f.type==="Feature"?f.geometry:f,Z=O?O.coordinates:null,Y=[],ce=b&&b.pointToLayer,Re=b&&b.coordsToLatLng||$i,et,ct,Lt,an;if(!Z&&!O)return null;switch(O.type){case"Point":return et=Re(Z),si(ce,f,et,b);case"MultiPoint":for(Lt=0,an=Z.length;Lt<an;Lt++)et=Re(Z[Lt]),Y.push(si(ce,f,et,b));return new _0(Y);case"LineString":case"MultiLineString":return ct=Pa(Z,O.type==="LineString"?0:1,Re),new dr(ct,b);case"Polygon":case"MultiPolygon":return ct=Pa(Z,O.type==="Polygon"?1:2,Re),new mo(ct,b);case"GeometryCollection":for(Lt=0,an=O.geometries.length;Lt<an;Lt++){var Tn=t0({geometry:O.geometries[Lt],type:"Feature",properties:f.properties},b);Tn&&Y.push(Tn)}return new _0(Y);case"FeatureCollection":for(Lt=0,an=O.features.length;Lt<an;Lt++){var e1=t0(O.features[Lt],b);e1&&Y.push(e1)}return new _0(Y);default:throw new Error("Invalid GeoJSON object.")}}function si(f,b,O,Z){return f?f(b,O):new Zi(O,Z&&Z.markersInheritOptions&&Z)}function $i(f){return new ee(f[1],f[0],f[2])}function Pa(f,b,O){for(var Z=[],Y=0,ce=f.length,Re;Y<ce;Y++)Re=b?Pa(f[Y],b-1,O):(O||$i)(f[Y]),Z.push(Re);return Z}function T9(f,b){return f=ne(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 Ui(f,b,O,Z){for(var Y=[],ce=0,Re=f.length;ce<Re;ce++)Y.push(b?Ui(f[ce],h0(f[ce])?0:b-1,O,Z):T9(f[ce],Z));return!b&&O&&Y.length>0&&Y.push(Y[0].slice()),Y}function li(f,b){return f.feature?o({},f.feature,{geometry:b}):j0(b)}function j0(f){return f.type==="Feature"||f.type==="FeatureCollection"?f:{type:"Feature",properties:{},geometry:f}}var Ze={toGeoJSON:function(f){return li(this,{type:"Point",coordinates:T9(this.getLatLng(),f)})}};Zi.include(Ze),S0.include(Ze),ai.include(Ze),dr.include({toGeoJSON:function(f){var b=!h0(this._latlngs),O=Ui(this._latlngs,b?1:0,!1,f);return li(this,{type:(b?"Multi":"")+"LineString",coordinates:O})}}),mo.include({toGeoJSON:function(f){var b=!h0(this._latlngs),O=b&&!h0(this._latlngs[0]),Z=Ui(this._latlngs,O?2:b?1:0,!0,f);return b||(Z=[Z]),li(this,{type:(O?"Multi":"")+"Polygon",coordinates:Z})}}),F0.include({toMultiPoint:function(f){var b=[];return this.eachLayer(function(O){b.push(O.toGeoJSON(f).geometry.coordinates)}),li(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(Y){if(Y.toGeoJSON){var ce=Y.toGeoJSON(f);if(O)Z.push(ce.geometry);else{var Re=j0(ce);Re.type==="FeatureCollection"?Z.push.apply(Z,Re.features):Z.push(Re)}}}),O?li(this,{geometries:Z,type:"GeometryCollection"}):{type:"FeatureCollection",features:Z}}});function mt(f,b){return new Ur(f,b)}var ut=mt,cn=i1.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),A(this,O)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(pn(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){hn(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&&t1(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:Vt("img");if(pn(b,"leaflet-image-layer"),this._zoomAnimated&&pn(b,"leaflet-zoom-animated"),this.options.className&&pn(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;st(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();wn(f,b.min),f.style.width=O.x+"px",f.style.height=O.y+"px"},_updateOpacity:function(){yt(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()}}),Yn=function(f,b,O){return new cn(f,b,O)},v1=cn.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:Vt("video");if(pn(b,"leaflet-image-layer"),this._zoomAnimated&&pn(b,"leaflet-zoom-animated"),this.options.className&&pn(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=[],Y=0;Y<O.length;Y++)Z.push(O[Y].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 ce=0;ce<this._url.length;ce++){var Re=Vt("source");Re.src=this._url[ce],b.appendChild(Re)}}});function rr(f,b,O){return new v1(f,b,O)}var R1=cn.extend({_initImage:function(){var f=this._image=this._url;pn(f,"leaflet-image-layer"),this._zoomAnimated&&pn(f,"leaflet-zoom-animated"),this.options.className&&pn(f,this.options.className),f.onselectstart=h,f.onmousemove=h}});function po(f,b,O){return new R1(f,b,O)}var n0=i1.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(f,b){f&&(f instanceof ee||E(f))?(this._latlng=ne(f),A(this,b)):(A(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&&yt(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),f._fadeAnimated&&yt(this._container,1),this.bringToFront(),this.options.interactive&&(pn(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(f){f._fadeAnimated?(yt(this._container,0),this._removeTimeout=setTimeout(a(hn,void 0,this._container),200)):hn(this._container),this.options.interactive&&(In(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(f){return this._latlng=ne(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&&t1(this._container),this},_prepareOpen:function(f){var b=this._source;if(!b._map)return!1;if(b instanceof _0){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?wn(this._container,f.add(O)):b=b.add(f).add(O);var Z=this._containerBottom=-b.y,Y=this._containerLeft=-Math.round(this._containerWidth/2)+b.x;this._container.style.bottom=Z+"px",this._container.style.left=Y+"px"}},_getAnchor:function(){return[0,0]}});p1.include({_initOverlay:function(f,b,O,Z){var Y=b;return Y instanceof f||(Y=new f(Z).setContent(b)),O&&Y.setLatLng(O),Y}}),i1.include({_initOverlay:function(f,b,O,Z){var Y=O;return Y instanceof f?(A(Y,Z),Y._source=this):(Y=b&&!Z?b:new f(Z,this),Y.setContent(O)),Y}});var _r=n0.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,n0.prototype.openOn.call(this,f)},onAdd:function(f){n0.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){n0.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=n0.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=Vt("div",f+" "+(this.options.className||"")+" leaflet-zoom-animated"),O=this._wrapper=Vt("div",f+"-content-wrapper",b);if(this._contentNode=Vt("div",f+"-content",O),T0(b),Z2(this._contentNode),jn(b,"contextmenu",M1),this._tipContainer=Vt("div",f+"-tip-container",b),this._tip=Vt("div",f+"-tip",this._tipContainer),this.options.closeButton){var Z=this._closeButton=Vt("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>',jn(Z,"click",function(Y){$n(Y),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,Y=this.options.maxHeight,ce="leaflet-popup-scrolled";Y&&Z>Y?(b.height=Y+"px",pn(f,ce)):In(f,ce),this._containerWidth=this._container.offsetWidth},_animateZoom:function(f){var b=this._map._latLngToNewLayerPoint(this._latlng,f.zoom,f.center),O=this._getAnchor();wn(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(kn(this._container,"marginBottom"),10)||0,O=this._container.offsetHeight+b,Z=this._containerWidth,Y=new Q(this._containerLeft,-O-this._containerBottom);Y._add(Bn(this._container));var ce=f.layerPointToContainerPoint(Y),Re=K(this.options.autoPanPadding),et=K(this.options.autoPanPaddingTopLeft||Re),ct=K(this.options.autoPanPaddingBottomRight||Re),Lt=f.getSize(),an=0,Tn=0;ce.x+Z+ct.x>Lt.x&&(an=ce.x+Z-Lt.x+ct.x),ce.x-an-et.x<0&&(an=ce.x-et.x),ce.y+O+ct.y>Lt.y&&(Tn=ce.y+O-Lt.y+ct.y),ce.y-Tn-et.y<0&&(Tn=ce.y-et.y),(an||Tn)&&(this.options.keepInView&&(this._autopanning=!0),f.fire("autopanstart").panBy([an,Tn]))}},_getAnchor:function(){return K(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),vo=function(f,b){return new _r(f,b)};p1.mergeOptions({closePopupOnClick:!0}),p1.include({openPopup:function(f,b,O){return this._initOverlay(_r,f,b,O).openOn(this),this},closePopup:function(f){return f=arguments.length?f:this._popup,f&&f.close(),this}}),i1.include({bindPopup:function(f,b){return this._popup=this._initOverlay(_r,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 _0||(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)){o1(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 Ao=n0.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(f){n0.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){n0.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=n0.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=Vt("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,Y=this._container,ce=Z.latLngToContainerPoint(Z.getCenter()),Re=Z.layerPointToContainerPoint(f),et=this.options.direction,ct=Y.offsetWidth,Lt=Y.offsetHeight,an=K(this.options.offset),Tn=this._getAnchor();et==="top"?(b=ct/2,O=Lt):et==="bottom"?(b=ct/2,O=0):et==="center"?(b=ct/2,O=Lt/2):et==="right"?(b=0,O=Lt/2):et==="left"?(b=ct,O=Lt/2):Re.x<ce.x?(et="right",b=0,O=Lt/2):(et="left",b=ct+(an.x+Tn.x)*2,O=Lt/2),f=f.subtract(K(b,O,!0)).add(an).add(Tn),In(Y,"leaflet-tooltip-right"),In(Y,"leaflet-tooltip-left"),In(Y,"leaflet-tooltip-top"),In(Y,"leaflet-tooltip-bottom"),pn(Y,"leaflet-tooltip-"+et),wn(Y,f)},_updatePosition:function(){var f=this._map.latLngToLayerPoint(this._latlng);this._setPosition(f)},setOpacity:function(f){this.options.opacity=f,this._container&&yt(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])}}),A2=function(f,b){return new Ao(f,b)};p1.include({openTooltip:function(f,b,O){return this._initOverlay(Ao,f,b,O).openOn(this),this},closeTooltip:function(f){return f.close(),this}}),i1.include({bindTooltip:function(f,b){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ao,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 _0||(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&&(jn(b,"focus",function(){this._tooltip._source=f,this.openTooltip()},this),jn(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=v2.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?(Xn(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 bo(f){return new G2(f)}v2.Default=ii;var h1=i1.extend({options:{tileSize:256,opacity:1,updateWhenIdle:at.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){A(this,f)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(f){f._addZoomLimit(this)},onRemove:function(f){this._removeAllTiles(),hn(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&&(t1(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,Y=b.length,ce;Z<Y;Z++)ce=b[Z].style.zIndex,b[Z]!==this._container&&ce&&(O=f(O,+ce));isFinite(O)&&(this.options.zIndex=O+f(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!at.ielt9){yt(this._container,this.options.opacity);var f=+new Date,b=!1,O=!1;for(var Z in this._tiles){var Y=this._tiles[Z];if(!(!Y.current||!Y.loaded)){var ce=Math.min(1,(f-Y.loaded)/200);yt(Y.el,ce),ce<1?b=!0:(Y.active?O=!0:this._onOpaqueTile(Y),Y.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=Vt("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)):(hn(this._levels[O].el),this._removeTilesAtZoom(O),this._onRemoveLevel(O),delete this._levels[O]);var Z=this._levels[f],Y=this._map;return Z||(Z=this._levels[f]={},Z.el=Vt("div","leaflet-tile-container leaflet-zoom-animated",this._container),Z.el.style.zIndex=b,Z.origin=Y.project(Y.unproject(Y.getPixelOrigin()),f).round(),Z.zoom=f,this._setZoomTransform(Z,Y.getCenter(),Y.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)hn(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 Y=Math.floor(f/2),ce=Math.floor(b/2),Re=O-1,et=new Q(+Y,+ce);et.z=+Re;var ct=this._tileCoordsToKey(et),Lt=this._tiles[ct];return Lt&&Lt.active?(Lt.retain=!0,!0):(Lt&&Lt.loaded&&(Lt.retain=!0),Re>Z?this._retainParent(Y,ce,Re,Z):!1)},_retainChildren:function(f,b,O,Z){for(var Y=2*f;Y<2*f+2;Y++)for(var ce=2*b;ce<2*b+2;ce++){var Re=new Q(Y,ce);Re.z=O+1;var et=this._tileCoordsToKey(Re),ct=this._tiles[et];if(ct&&ct.active){ct.retain=!0;continue}else ct&&ct.loaded&&(ct.retain=!0);O+1<Z&&this._retainChildren(Y,ce,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 Y=Math.round(b);this.options.maxZoom!==void 0&&Y>this.options.maxZoom||this.options.minZoom!==void 0&&Y<this.options.minZoom?Y=void 0:Y=this._clampZoom(Y);var ce=this.options.updateWhenZooming&&Y!==this._tileZoom;(!Z||ce)&&(this._tileZoom=Y,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),Y!==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),Y=f.origin.multiplyBy(Z).subtract(this._map._getNewPixelOrigin(b,O)).round();at.any3d?st(f.el,Y,Z):wn(f.el,Y)},_resetGrid:function(){var f=this._map,b=f.options.crs,O=this._tileSize=this.getTileSize(),Z=this._tileZoom,Y=this._map.getPixelWorldBounds(this._tileZoom);Y&&(this._globalTileRange=this._pxBoundsToTileRange(Y)),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),Y=b.project(f,this._tileZoom).floor(),ce=b.getSize().divideBy(Z*2);return new $(Y.subtract(ce),Y.add(ce))},_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),Y=this._pxBoundsToTileRange(Z),ce=Y.getCenter(),Re=[],et=this.options.keepBuffer,ct=new $(Y.getBottomLeft().subtract([et,-et]),Y.getTopRight().add([et,-et]));if(!(isFinite(Y.min.x)&&isFinite(Y.min.y)&&isFinite(Y.max.x)&&isFinite(Y.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var Lt in this._tiles){var an=this._tiles[Lt].coords;(an.z!==this._tileZoom||!ct.contains(new Q(an.x,an.y)))&&(this._tiles[Lt].current=!1)}if(Math.abs(O-this._tileZoom)>1){this._setView(f,O);return}for(var Tn=Y.min.y;Tn<=Y.max.y;Tn++)for(var e1=Y.min.x;e1<=Y.max.x;e1++){var hr=new Q(e1,Tn);if(hr.z=this._tileZoom,!!this._isValidTile(hr)){var we=this._tiles[this._tileCoordsToKey(hr)];we?we.current=!0:Re.push(hr)}}if(Re.sort(function(ke,je){return ke.distanceTo(ce)-je.distanceTo(ce)}),Re.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var pe=document.createDocumentFragment();for(e1=0;e1<Re.length;e1++)this._addTile(Re[e1],pe);this._level.el.appendChild(pe)}}}},_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),Y=Z.add(O),ce=b.unproject(Z,f.z),Re=b.unproject(Y,f.z);return[ce,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&&(hn(b.el),delete this._tiles[f],this.fire("tileunload",{tile:b.el,coords:this._keyToTileCoords(f)}))},_initTile:function(f){pn(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,at.ielt9&&this.options.opacity<1&&yt(f,this.options.opacity)},_addTile:function(f,b){var O=this._getTilePos(f),Z=this._tileCoordsToKey(f),Y=this.createTile(this._wrapCoords(f),a(this._tileReady,this,f));this._initTile(Y),this.createTile.length<2&&P(a(this._tileReady,this,f,null,Y)),wn(Y,O),this._tiles[Z]={el:Y,coords:f,current:!0},b.appendChild(Y),this.fire("tileloadstart",{tile:Y,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?(yt(O.el,0),T(this._fadeFrame),this._fadeFrame=P(this._updateOpacity,this)):(O.active=!0,this._pruneTiles()),b||(pn(O.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:O.el,coords:f})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),at.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 S5(f){return new h1(f)}var yo=h1.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=A(this,b),b.detectRetina&&at.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 jn(O,"load",a(this._tileOnLoad,this,b,O)),jn(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:at.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){at.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;hn(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",_),h1.prototype._removeTile.call(this,f)},_tileReady:function(f,b,O){if(!(!this._map||O&&O.getAttribute("src")===_))return h1.prototype._tileReady.call(this,f,b,O)}});function Wi(f,b){return new yo(f,b)}var Ta=yo.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=A(this,b);var Y=b.detectRetina&&at.retina?2:1,ce=this.getTileSize();O.width=ce.x*Y,O.height=ce.y*Y,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,yo.prototype.onAdd.call(this,f)},getTileUrl:function(f){var b=this._tileCoordsToNwSe(f),O=this._crs,Z=G(O.project(b[0]),O.project(b[1])),Y=Z.min,ce=Z.max,Re=(this._wmsVersion>=1.3&&this._crs===$s?[Y.y,Y.x,ce.y,ce.x]:[Y.x,Y.y,ce.x,ce.y]).join(","),et=yo.prototype.getTileUrl.call(this,f);return et+p(this.wmsParams,et,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+Re},setParams:function(f,b){return o(this.wmsParams,f),b||this.redraw(),this}});function Na(f,b){return new Ta(f,b)}yo.WMS=Ta,Wi.wms=Na;var b2=i1.extend({options:{padding:.1},initialize:function(f){A(this,f),l(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),pn(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),Y=this._map.project(this._center,b),ce=Z.multiplyBy(-O).add(Y).subtract(this._map._getNewPixelOrigin(f,b));at.any3d?st(this._container,ce,O):wn(this._container,ce)},_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()}}),Ki=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");jn(f,"mousemove",this._onMouseMove,this),jn(f,"click dblclick mousedown mouseup contextmenu",this._onClick,this),jn(f,"mouseout",this._handleMouseOut,this),f._leaflet_disable_events=!0,this._ctx=f.getContext("2d")},_destroyContainer:function(){T(this._redrawRequest),delete this._ctx,hn(this._container),yn(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=at.retina?2:1;wn(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",at.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,Y;for(Y=0;Y<b.length;Y++){if(Z=Number(b[Y]),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,Y,ce,Re=f._parts,et=Re.length,ct=this._ctx;if(et){for(ct.beginPath(),O=0;O<et;O++){for(Z=0,Y=Re[O].length;Z<Y;Z++)ce=Re[O][Z],ct[Z?"lineTo":"moveTo"](ce.x,ce.y);b&&ct.closePath()}this._fillStroke(ct,f)}}},_updateCircle:function(f){if(!(!this._drawing||f._empty())){var b=f._point,O=this._ctx,Z=Math.max(Math.round(f._radius),1),Y=(Math.max(Math.round(f._radiusY),1)||Z)/Z;Y!==1&&(O.save(),O.scale(1,Y)),O.beginPath(),O.arc(b.x,b.y/Y,Z,0,Math.PI*2,!1),Y!==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,Y=this._drawFirst;Y;Y=Y.next)O=Y.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&&(In(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,Y=this._drawFirst;Y;Y=Y.next)O=Y.layer,O.options.interactive&&O._containsPoint(b)&&(Z=O);Z!==this._hoveredLayer&&(this._handleMouseOut(f),Z&&(pn(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 V0(f){return at.canvas?new Ki(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">')}}(),Qs={_initContainer:function(){this._container=Vt("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");pn(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;hn(b),f.removeInteractiveTarget(b),delete this._layers[l(f)]},_updateStyle:function(f){var b=f._stroke,O=f._fill,Z=f.options,Y=f._container;Y.stroked=!!Z.stroke,Y.filled=!!Z.fill,Z.stroke?(b||(b=f._stroke=n2("stroke")),Y.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&&(Y.removeChild(b),f._stroke=null),Z.fill?(O||(O=f._fill=n2("fill")),Y.appendChild(O),O.color=Z.fillColor||Z.color,O.opacity=Z.fillOpacity):O&&(Y.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){t1(f._container)}},r2=at.vml?n2:Ee,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(){hn(this._container),yn(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)),wn(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&&pn(b,f.options.className),f.options.interactive&&pn(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){hn(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,Y="a"+O+","+Z+" 0 1,0 ",ce=f._empty()?"M0 0":"M"+(b.x-O)+","+b.y+Y+O*2+",0 "+Y+-O*2+",0 ";this._setPath(f,ce)},_setPath:function(f,b){f._path.setAttribute("d",b)},_bringToFront:function(f){S1(f._path)},_bringToBack:function(f){t1(f._path)}});at.vml&&y2.include(Qs);function ci(f){return at.svg||at.vml?new y2(f):null}p1.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&&V0(f)||ci(f)}});var Y2=mo.extend({initialize:function(f,b){mo.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 Fa(f,b){return new Y2(f,b)}y2.create=r2,y2.pointsToPath=Se,Ur.geometryToLayer=t0,Ur.coordsToLatLng=$i,Ur.coordsToLatLngs=Pa,Ur.latLngToCoords=T9,Ur.latLngsToCoords=Ui,Ur.getFeature=li,Ur.asFeature=j0,p1.mergeOptions({boxZoom:!0});var X2=ur.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(){jn(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){yn(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){hn(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(),Rt(),this._startPoint=this._map.mouseEventToContainerPoint(f),jn(document,{contextmenu:o1,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(f){this._moved||(this._moved=!0,this._box=Vt("div","leaflet-zoom-box",this._container),pn(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(f);var b=new $(this._point,this._startPoint),O=b.getSize();wn(this._box,b.min),this._box.style.width=O.x+"px",this._box.style.height=O.y+"px"},_finish:function(){this._moved&&(hn(this._box),In(this._container,"leaflet-crosshair")),m1(),$t(),yn(document,{contextmenu:o1,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())}});p1.addInitHook("addHandler","boxZoom",X2),p1.mergeOptions({doubleClickZoom:!0});var o2=ur.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,Y=f.originalEvent.shiftKey?O-Z:O+Z;b.options.doubleClickZoom==="center"?b.setZoom(Y):b.setZoomAround(f.containerPoint,Y)}});p1.addInitHook("addHandler","doubleClickZoom",o2),p1.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var wo=ur.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))}pn(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){In(this._map._container,"leaflet-grab"),In(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=G(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,Y=(Z-b+O)%f+b-O,ce=(Z+b+O)%f-b-O,Re=Math.abs(Y+O)<Math.abs(ce+O)?Y:ce;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 Y=this._lastPos.subtract(this._positions[0]),ce=(this._lastTime-this._times[0])/1e3,Re=O.easeLinearity,et=Y.multiplyBy(Re/ce),ct=et.distanceTo([0,0]),Lt=Math.min(O.inertiaMaxSpeed,ct),an=et.multiplyBy(Lt/ct),Tn=Lt/(O.inertiaDeceleration*Re),e1=an.multiplyBy(-Tn/2).round();!e1.x&&!e1.y?b.fire("moveend"):(e1=b._limitOffset(e1,b.options.maxBounds),P(function(){b.panBy(e1,{duration:Tn,easeLinearity:Re,noMoveStart:!0,animate:!0})}))}}});p1.addInitHook("addHandler","dragging",wo),p1.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Qi=ur.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"),jn(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(),yn(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,Y;for(Z=0,Y=O.left.length;Z<Y;Z++)b[O.left[Z]]=[-1*f,0];for(Z=0,Y=O.right.length;Z<Y;Z++)b[O.right[Z]]=[f,0];for(Z=0,Y=O.down.length;Z<Y;Z++)b[O.down[Z]]=[0,f];for(Z=0,Y=O.up.length;Z<Y;Z++)b[O.up[Z]]=[0,-1*f]},_setZoomDelta:function(f){var b=this._zoomKeys={},O=this.keyCodes,Z,Y;for(Z=0,Y=O.zoomIn.length;Z<Y;Z++)b[O.zoomIn[Z]]=f;for(Z=0,Y=O.zoomOut.length;Z<Y;Z++)b[O.zoomOut[Z]]=-f},_addHooks:function(){jn(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){yn(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 Y=O.wrapLatLng(O.unproject(O.project(O.getCenter()).add(Z)));O.panTo(Y)}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;o1(f)}}});p1.addInitHook("addHandler","keyboard",Qi),p1.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var ja=ur.extend({addHooks:function(){jn(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){yn(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),o1(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),Y=4*Math.log(2/(1+Math.exp(-Math.abs(Z))))/Math.LN2,ce=O?Math.ceil(Y/O)*O:Y,Re=f._limitZoom(b+(this._delta>0?ce:-ce))-b;this._delta=0,this._startTime=null,Re&&(f.options.scrollWheelZoom==="center"?f.setZoom(b+Re):f.setZoomAround(this._lastMousePos,b+Re))}});p1.addInitHook("addHandler","scrollWheelZoom",ja);var N9=600;p1.mergeOptions({tapHold:at.touchNative&&at.safari&&at.mobile,tapTolerance:15});var Gi=ur.extend({addHooks:function(){jn(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){yn(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()&&(jn(document,"touchend",$n),jn(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",b))},this),N9),jn(document,"touchend touchcancel contextmenu",this._cancel,this),jn(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function f(){yn(document,"touchend",$n),yn(document,"touchend touchcancel",f)},_cancel:function(){clearTimeout(this._holdTimeout),yn(document,"touchend touchcancel contextmenu",this._cancel,this),yn(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)}});p1.addInitHook("addHandler","tapHold",Gi),p1.mergeOptions({touchZoom:at.touch,bounceAtZoomLimits:!0});var ui=ur.extend({addHooks:function(){pn(this._map._container,"leaflet-touch-zoom"),jn(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){In(this._map._container,"leaflet-touch-zoom"),yn(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(),jn(document,"touchmove",this._onTouchMove,this),jn(document,"touchend touchcancel",this._onTouchEnd,this),$n(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]),Y=O.distanceTo(Z)/this._startDist;if(this._zoom=b.getScaleZoom(Y,this._startZoom),!b.options.bounceAtZoomLimits&&(this._zoom<b.getMinZoom()&&Y<1||this._zoom>b.getMaxZoom()&&Y>1)&&(this._zoom=b._limitZoom(this._zoom)),b.options.touchZoom==="center"){if(this._center=this._startLatLng,Y===1)return}else{var ce=O._add(Z)._divideBy(2)._subtract(this._centerPoint);if(Y===1&&ce.x===0&&ce.y===0)return;this._center=b.unproject(b.project(this._pinchStartLatLng,this._zoom).subtract(ce),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),$n(f)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,T(this._animRequest),yn(document,"touchmove",this._onTouchMove,this),yn(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))}});p1.addInitHook("addHandler","touchZoom",ui),p1.BoxZoom=X2,p1.DoubleClickZoom=o2,p1.Drag=wo,p1.Keyboard=Qi,p1.ScrollWheelZoom=ja,p1.TapHold=Gi,p1.TouchZoom=ui,n.Bounds=$,n.Browser=at,n.CRS=he,n.Canvas=Ki,n.Circle=S0,n.CircleMarker=ai,n.Class=F,n.Control=d0,n.DivIcon=G2,n.DivOverlay=n0,n.DomEvent=B9,n.DomUtil=b0,n.Draggable=U2,n.Evented=U,n.FeatureGroup=_0,n.GeoJSON=Ur,n.GridLayer=h1,n.Handler=ur,n.Icon=v2,n.ImageOverlay=cn,n.LatLng=ee,n.LatLngBounds=X,n.Layer=i1,n.LayerGroup=F0,n.LineUtil=ri,n.Map=p1,n.Marker=Zi,n.Mixin=zs,n.Path=K2,n.Point=Q,n.PolyUtil=D9,n.Polygon=mo,n.Polyline=dr,n.Popup=_r,n.PosAnimation=R9,n.Projection=E0,n.Rectangle=Y2,n.Renderer=b2,n.SVG=y2,n.SVGOverlay=R1,n.TileLayer=yo,n.Tooltip=Ao,n.Transformation=ge,n.Util=N,n.VideoOverlay=v1,n.bind=a,n.bounds=G,n.canvas=V0,n.circle=Q2,n.circleMarker=B1,n.control=y0,n.divIcon=bo,n.extend=o,n.featureGroup=W2,n.geoJSON=mt,n.geoJson=ut,n.gridLayer=S5,n.icon=_5,n.imageOverlay=Yn,n.latLng=ne,n.latLngBounds=J,n.layerGroup=zi,n.map=Or,n.marker=go,n.point=K,n.polygon=Ks,n.polyline=Ws,n.popup=vo,n.rectangle=Fa,n.setOptions=A,n.stamp=l,n.svg=ci,n.svgOverlay=po,n.tileLayer=Wi,n.tooltip=A2,n.transformation=ue,n.version=r,n.videoOverlay=rr;var Va=window.L;n.noConflict=function(){return window.L=Va,this},window.L=n})}(_4,_4.exports)),_4.exports}var Fo=IRe();const P2=p2(Fo);(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 vP(e,t){const n=k.useRef(t);k.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 PRe=1;function TRe(e){return Object.freeze({__version:PRe,map:e})}function qp(e,t){return Object.freeze({...e,...t})}const AP=k.createContext(null),bP=AP.Provider;function Yl(){const e=k.useContext(AP);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return e}function yP(e){function t(n,r){const{instance:o,context:i}=e(n).current;return k.useImperativeHandle(r,()=>o),n.children==null?null:k.createElement(bP,{value:i},n.children)}return k.forwardRef(t)}function NRe(e){function t(n,r){const[o,i]=k.useState(!1),{instance:a}=e(n,i).current;k.useImperativeHandle(r,()=>a),k.useEffect(function(){o&&a.update()},[a,o,n.children]);const s=a._contentNode;return s?s0.createPortal(n.children,s):null}return k.forwardRef(t)}function wP(e){function t(n,r){const{instance:o}=e(n).current;return k.useImperativeHandle(r,()=>o),null}return k.forwardRef(t)}function FRe(e){return function(n){const r=Yl(),o=e(n,r),{instance:i}=o.current,a=k.useRef(n.position),{position:s}=n;return k.useEffect(function(){return i.addTo(r.map),function(){i.remove()}},[r.map,i]),k.useEffect(function(){s!=null&&s!==a.current&&(i.setPosition(s),a.current=s)},[i,s]),o}}function Jp(e,t){const n=k.useRef();k.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 sd(e,t){const n=e.pane??t.pane;return n?{...e,pane:n}:e}function jRe(e,t){return function(r,o){const i=Yl(),a=e(sd(r,i),i);return vP(i.map,r.attribution),Jp(a.current,r.eventHandlers),t(a.current,i,r,o),a}}function x5(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function Xl(e,t){return t==null?function(r,o){const i=k.useRef();return i.current||(i.current=e(r,o)),i}:function(r,o){const i=k.useRef();i.current||(i.current=e(r,o));const a=k.useRef(r),{instance:s}=i.current;return k.useEffect(function(){a.current!==r&&(t(s,r,a.current),a.current=r)},[s,r,o]),i}}function xP(e,t){k.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 EP(e){return function(n){const r=Yl(),o=e(sd(n,r),r);return vP(r.map,n.attribution),Jp(o.current,n.eventHandlers),xP(o.current,r),o}}function VRe(e,t){const n=k.useRef();k.useEffect(function(){if(t.pathOptions!==n.current){const o=t.pathOptions??{};e.instance.setStyle(o),n.current=o}},[e,t])}function zRe(e){return function(n){const r=Yl(),o=e(sd(n,r),r);return Jp(o.current,n.eventHandlers),xP(o.current,r),VRe(o.current,n),o}}function ZRe(e){function t(o,i){return x5(e(o),i)}const n=Xl(t),r=FRe(n);return wP(r)}function _P(e,t){const n=Xl(e,t),r=EP(n);return yP(r)}function $Re(e,t){const n=Xl(e),r=jRe(n,t);return NRe(r)}function URe(e,t){const n=Xl(e,t),r=zRe(n);return yP(r)}function WRe(e,t){const n=Xl(e,t),r=EP(n);return wP(r)}function KRe(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 QRe(e,t,n){t.bounds instanceof Fo.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 ld(){return Yl().map}const SP=URe(function({data:t,...n},r){const o=new Fo.GeoJSON(t,n);return x5(o,qp(r,{overlayContainer:o}))},function(t,n,r){n.style!==r.style&&(n.style==null?t.resetStyle():t.setStyle(n.style))}),GRe=_P(function({bounds:t,url:n,...r},o){const i=new Fo.ImageOverlay(n,t,r);return x5(i,qp(o,{overlayContainer:i}))},function(t,n,r){if(QRe(t,n,r),n.bounds!==r.bounds){const o=n.bounds instanceof Fo.LatLngBounds?n.bounds:new Fo.LatLngBounds(n.bounds);t.setBounds(o)}n.url!==r.url&&t.setUrl(n.url)});function Fg(){return Fg=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},Fg.apply(this,arguments)}function YRe({bounds:e,boundsOptions:t,center:n,children:r,className:o,id:i,placeholder:a,style:s,whenReady:l,zoom:u,...d},h){const[C]=k.useState({className:o,id:i,style:s}),[m,v]=k.useState(null);k.useImperativeHandle(h,()=>(m==null?void 0:m.map)??null,[m]);const A=k.useCallback(y=>{if(y!==null&&m===null){const x=new Fo.Map(y,d);n!=null&&u!=null?x.setView(n,u):e!=null&&x.fitBounds(e,t),l!=null&&x.whenReady(l),v(TRe(x))}},[]);k.useEffect(()=>()=>{m==null||m.map.remove()},[m]);const p=m?k.createElement(bP,{value:m},r):a??null;return k.createElement("div",Fg({},C,{ref:A}),p)}const MP=k.forwardRef(YRe),HP=_P(function({position:t,...n},r){const o=new Fo.Marker(t,n);return x5(o,qp(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())}),LP=$Re(function(t,n){const r=new Fo.Popup(t,n.overlayContainer);return x5(r,n)},function(t,n,{position:r},o){k.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])}),XRe=WRe(function({url:t,...n},r){const o=new Fo.TileLayer(t,sd(n,r));return x5(o,r)},function(t,n,r){KRe(t,n,r);const{url:o}=n;o!=null&&o!==r.url&&t.setUrl(o)}),OP=ZRe(function(t){return new Fo.Control.Zoom(t)}),qRe="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",kP=new P2.Icon({iconUrl:qRe,className:"awi_map_marker_icon",iconSize:[32,32]}),BP=e=>new P2.Icon({iconUrl:e,className:"awi_map_marker_icon",iconSize:[32,32]}),JRe=({items:e})=>{const t=ld();return k.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},RP=({mapRef:e})=>{const t=ld();return k.useEffect(()=>{e.current=t},[t]),null},eDe=({enableDrawing:e,drawOptions:t,drawnItems:n,onDrawCreated:r})=>{const o=ld();return k.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},tDe=({enableDrawing:e,drawnItems:t})=>{const n=k.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(SP,{data:n,style:{color:"#ff7800",weight:2,opacity:.65}},`drawn-items-${n.features.length}`)},nDe=(e,t,n)=>({...e,features:e.features.map(r=>({...r,geometry:{...r.geometry,coordinates:rDe(r.geometry.coordinates,r.geometry.type,t,n)}}))}),rDe=(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}},oDe=(e,t)=>{const[n,r]=k.useState(null);k.useEffect(()=>{r(e?new P2.FeatureGroup:null)},[e]);const o=k.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=k.useCallback(()=>n?n.toGeoJSON():{type:"FeatureCollection",features:[]},[n]);return{drawnItems:n,handleDrawCreated:o,getDrawnItemsGeoJSON:i}},fc=(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)},iDe=P2.extend({},P2.CRS.Simple,{transformation:new P2.Transformation(1,0,-1,1)}),aDe=P2.CRS.Simple,Dh={"top-left":iDe,"bottom-left":aDe},sDe=({bounds:e})=>{const t=ld(),n=k.useRef(!1);return k.useEffect(()=>{n.current||(t.fitBounds(e,{maxZoom:2}),n.current=!0)},[t,e]),null},lDe={defaultZoom:14,defaultCenter:{x:.5,y:.5},imageHeight:1e3,imageWidth:1e3,imageUrl:"https://unsplash.it/1000/1000"},cDe=({mapConfig:e=lDe,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:v,onClickAway:A,onFocusedIndexChange:p,enableDrawing:y=!1,onShapeSave:x,drawOptions:E,origin:S="top-left"})=>{const[_,M]=k.useState(!1),[H,R]=k.useState(null),{drawnItems:B,handleDrawCreated:I}=oDe(y,x),P=typeof v=="number",T=P?v:H;k.useEffect(()=>{M(!0)},[]),k.useEffect(()=>{},[y,B]);const N={width:(e==null?void 0:e.imageWidth)??1e3,height:(e==null?void 0:e.imageHeight)??1e3},F=nDe(n,N,S),j=[[0,0],[N==null?void 0:N.height,N==null?void 0:N.width]],z=k.useMemo(()=>T!==null?t==null?void 0:t[T]:null,[t,T]),U=k.useRef(null),Q=k.useRef({});k.useEffect(()=>{if(!_)return;const ee=requestAnimationFrame(()=>{U.current=T!=null?Q.current[T]??null:null,s&&Object.entries(Q.current).forEach(([ne,he])=>{Number(ne)===T||he==null||he.openPopup()}),T!=null&&Q.current[T]&&Q.current[T].openPopup()});return()=>cancelAnimationFrame(ee)},[T,_,s]);const q=k.useRef(null);k.useEffect(()=>{const ee=q.current;if(ee&&(z!=null&&z.position)){const ne=fc(z==null?void 0:z.position,N,S);ee.setView(ne,ee.getZoom(),{animate:!0})}},[z,_,N]);const[K,$]=k.useState(fc(e==null?void 0:e.defaultCenter,N,S));k.useEffect(()=>{if(z&&K){const ee=fc(z==null?void 0:z.position,N,S);$(ee)}},[z]);const G=()=>{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(MP,{zoom:e==null?void 0:e.defaultZoom,maxBounds:j,maxBoundsViscosity:.8,center:K,crs:Dh==null?void 0:Dh[S],style:{width:"100%",height:"100%"},zoomControl:!1,children:[V.jsx(RP,{mapRef:q}),V.jsx(GRe,{url:e==null?void 0:e.imageUrl,bounds:j}),u?V.jsx(sDe,{bounds:j}):null,V.jsx(OP,{position:"bottomright"}),V.jsx(SP,{data:F,style:r}),y&&B&&V.jsx(eDe,{enableDrawing:y,drawOptions:E,drawnItems:B,onDrawCreated:I}),V.jsx(tDe,{enableDrawing:y,drawnItems:B}),t==null?void 0:t.map((ee,ne)=>{const he=fc(ee==null?void 0:ee.position,N,S),oe=ne===T;return V.jsx(HP,{position:he,icon:ee!=null&&ee.icon?BP(ee==null?void 0:ee.icon):kP,ref:ye=>{ye&&(Q.current[ne]=ye)},eventHandlers:{click:()=>{P&&p?p(ne):R(ne)}},children:a||s?V.jsx(LP,{closeButton:!1,autoPan:!1,autoClose:!1,closeOnClick:oe&&a,className:oe&&a?"card_popup":s?"count_popup":"",eventHandlers:{remove:()=>{P&&p?p(null):R(null),oe&&A&&A()}},children:oe&&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},oe?`focused-${ne}`:`count-${ne}`):V.jsx(V.Fragment,{})},ne)})]}),l&&V.jsxs("div",{className:`map_view_nav_container ${h??""}`,children:[V.jsx(Er,{variant:"primary",onClick:G,size:"s",icon:"leftArrow",backgroundColor:J,borderColor:J,title:"Previous"}),V.jsx(Er,{variant:"primary",onClick:X,size:"s",icon:"rightArrow",iconPosition:"after",backgroundColor:J,borderColor:J,title:"Next"})]})]})};function R7(e){"@babel/helpers - typeof";return R7=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},R7(e)}var uDe=/^\s+/,dDe=/\s+$/;function Fn(e,t){if(e=e||"",t=t||{},e instanceof Fn)return e;if(!(this instanceof Fn))return new Fn(e,t);var n=fDe(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}Fn.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=DP(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=IS(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=IS(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=DS(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=DS(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 PS(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return mDe(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(Ar(this._r,255)*100)+"%",g:Math.round(Ar(this._g,255)*100)+"%",b:Math.round(Ar(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Ar(this._r,255)*100)+"%, "+Math.round(Ar(this._g,255)*100)+"%, "+Math.round(Ar(this._b,255)*100)+"%)":"rgba("+Math.round(Ar(this._r,255)*100)+"%, "+Math.round(Ar(this._g,255)*100)+"%, "+Math.round(Ar(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:HDe[PS(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+TS(this._r,this._g,this._b,this._a),r=n,o=this._gradientType?"GradientType = 1, ":"";if(t){var i=Fn(t);r="#"+TS(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 Fn(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(bDe,arguments)},brighten:function(){return this._applyModification(yDe,arguments)},darken:function(){return this._applyModification(wDe,arguments)},desaturate:function(){return this._applyModification(pDe,arguments)},saturate:function(){return this._applyModification(vDe,arguments)},greyscale:function(){return this._applyModification(ADe,arguments)},spin:function(){return this._applyModification(xDe,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(SDe,arguments)},complement:function(){return this._applyCombination(EDe,arguments)},monochromatic:function(){return this._applyCombination(MDe,arguments)},splitcomplement:function(){return this._applyCombination(_De,arguments)},triad:function(){return this._applyCombination(NS,[3])},tetrad:function(){return this._applyCombination(NS,[4])}};Fn.fromRatio=function(e,t){if(R7(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(r==="a"?n[r]=e[r]:n[r]=S4(e[r]));e=n}return Fn(e,t)};function fDe(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=BDe(e)),R7(e)=="object"&&(aa(e.r)&&aa(e.g)&&aa(e.b)?(t=hDe(e.r,e.g,e.b),a=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):aa(e.h)&&aa(e.s)&&aa(e.v)?(r=S4(e.s),o=S4(e.v),t=gDe(e.h,r,o),a=!0,s="hsv"):aa(e.h)&&aa(e.s)&&aa(e.l)&&(r=S4(e.s),i=S4(e.l),t=CDe(e.h,r,i),a=!0,s="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=DP(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 hDe(e,t,n){return{r:Ar(e,255)*255,g:Ar(t,255)*255,b:Ar(n,255)*255}}function DS(e,t,n){e=Ar(e,255),t=Ar(t,255),n=Ar(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 CDe(e,t,n){var r,o,i;e=Ar(e,360),t=Ar(t,100),n=Ar(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 IS(e,t,n){e=Ar(e,255),t=Ar(t,255),n=Ar(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 gDe(e,t,n){e=Ar(e,360)*6,t=Ar(t,100),n=Ar(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 PS(e,t,n,r){var o=[Ro(Math.round(e).toString(16)),Ro(Math.round(t).toString(16)),Ro(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 mDe(e,t,n,r,o){var i=[Ro(Math.round(e).toString(16)),Ro(Math.round(t).toString(16)),Ro(Math.round(n).toString(16)),Ro(IP(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 TS(e,t,n,r){var o=[Ro(IP(r)),Ro(Math.round(e).toString(16)),Ro(Math.round(t).toString(16)),Ro(Math.round(n).toString(16))];return o.join("")}Fn.equals=function(e,t){return!e||!t?!1:Fn(e).toRgbString()==Fn(t).toRgbString()};Fn.random=function(){return Fn.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function pDe(e,t){t=t===0?0:t||10;var n=Fn(e).toHsl();return n.s-=t/100,n.s=cd(n.s),Fn(n)}function vDe(e,t){t=t===0?0:t||10;var n=Fn(e).toHsl();return n.s+=t/100,n.s=cd(n.s),Fn(n)}function ADe(e){return Fn(e).desaturate(100)}function bDe(e,t){t=t===0?0:t||10;var n=Fn(e).toHsl();return n.l+=t/100,n.l=cd(n.l),Fn(n)}function yDe(e,t){t=t===0?0:t||10;var n=Fn(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)))),Fn(n)}function wDe(e,t){t=t===0?0:t||10;var n=Fn(e).toHsl();return n.l-=t/100,n.l=cd(n.l),Fn(n)}function xDe(e,t){var n=Fn(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,Fn(n)}function EDe(e){var t=Fn(e).toHsl();return t.h=(t.h+180)%360,Fn(t)}function NS(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=Fn(e).toHsl(),r=[Fn(e)],o=360/t,i=1;i<t;i++)r.push(Fn({h:(n.h+i*o)%360,s:n.s,l:n.l}));return r}function _De(e){var t=Fn(e).toHsl(),n=t.h;return[Fn(e),Fn({h:(n+72)%360,s:t.s,l:t.l}),Fn({h:(n+216)%360,s:t.s,l:t.l})]}function SDe(e,t,n){t=t||6,n=n||30;var r=Fn(e).toHsl(),o=360/n,i=[Fn(e)];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,i.push(Fn(r));return i}function MDe(e,t){t=t||6;for(var n=Fn(e).toHsv(),r=n.h,o=n.s,i=n.v,a=[],s=1/t;t--;)a.push(Fn({h:r,s:o,v:i})),i=(i+s)%1;return a}Fn.mix=function(e,t,n){n=n===0?0:n||50;var r=Fn(e).toRgb(),o=Fn(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 Fn(a)};Fn.readability=function(e,t){var n=Fn(e),r=Fn(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};Fn.isReadable=function(e,t,n){var r=Fn.readability(e,t),o,i;switch(i=!1,o=RDe(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};Fn.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=Fn.readability(e,t[u]),i>o&&(o=i,r=Fn(t[u]));return Fn.isReadable(e,r,{level:s,size:l})||!a?r:(n.includeFallbackColors=!1,Fn.mostReadable(e,["#fff","#000"],n))};var jg=Fn.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"},HDe=Fn.hexNames=LDe(jg);function LDe(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function DP(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Ar(e,t){ODe(e)&&(e="100%");var n=kDe(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 cd(e){return Math.min(1,Math.max(0,e))}function L2(e){return parseInt(e,16)}function ODe(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function kDe(e){return typeof e=="string"&&e.indexOf("%")!=-1}function Ro(e){return e.length==1?"0"+e:""+e}function S4(e){return e<=1&&(e=e*100+"%"),e}function IP(e){return Math.round(parseFloat(e)*255).toString(16)}function FS(e){return L2(e)/255}var So=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 aa(e){return!!So.CSS_UNIT.exec(e)}function BDe(e){e=e.replace(uDe,"").replace(dDe,"").toLowerCase();var t=!1;if(jg[e])e=jg[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=So.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=So.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=So.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=So.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=So.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=So.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=So.hex8.exec(e))?{r:L2(n[1]),g:L2(n[2]),b:L2(n[3]),a:FS(n[4]),format:t?"name":"hex8"}:(n=So.hex6.exec(e))?{r:L2(n[1]),g:L2(n[2]),b:L2(n[3]),format:t?"name":"hex"}:(n=So.hex4.exec(e))?{r:L2(n[1]+""+n[1]),g:L2(n[2]+""+n[2]),b:L2(n[3]+""+n[3]),a:FS(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=So.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 RDe(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 DDe=(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=Fn(n[l]).toRgb(),h=Fn(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),v=Math.round(d.b+(h.b-d.b)*u),A=d.a+(h.a-d.a)*u;return`rgba(${C}, ${m}, ${v}, ${+A.toFixed(3)})`},IDe=({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:v,borderColor:A,className:p,cellClassName:y,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":v,"--c_border":A},children:V.jsxs("table",{children:[(M=e==null?void 0:e.ylabels)==null?void 0:M.map((R,B)=>{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 ${y||""}`,style:{width:s,height:"100%"},children:V.jsx(yu,{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)??DDe((T==null?void 0:T.value)??0,n,t),color:C},className:"heatmap_cell_inner",children:a(T)},`${N}-${B}-${T==null?void 0:T.value}`)})},`${N}-${B}-${T==null?void 0:T.value}`))]},`${B}-${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,B)=>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},`${B}-${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,{})]})})},PDe=({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 ql=e=>e.type==="checkbox",cs=e=>e instanceof Date,W0=e=>e==null;const PP=e=>typeof e=="object";var Fr=e=>!W0(e)&&!Array.isArray(e)&&PP(e)&&!cs(e),TP=e=>Fr(e)&&e.target?ql(e.target)?e.target.checked:e.target.value:e,TDe=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,NP=(e,t)=>e.has(TDe(t)),NDe=e=>{const t=e.constructor&&e.constructor.prototype;return Fr(t)&&t.hasOwnProperty("isPrototypeOf")},ev=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Wr(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(!(ev&&(e instanceof Blob||r))&&(n||Fr(e)))if(t=n?[]:{},!n&&!NDe(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=Wr(e[o]));else return e;return t}var ud=e=>/^\w*$/.test(e),Tr=e=>e===void 0,tv=e=>Array.isArray(e)?e.filter(Boolean):[],nv=e=>tv(e.replace(/["|']|\]/g,"").split(/\.|\[/)),un=(e,t,n)=>{if(!t||!Fr(e))return n;const r=(ud(t)?[t]:nv(t)).reduce((o,i)=>W0(o)?o:o[i],e);return Tr(r)||r===e?Tr(e[t])?n:e[t]:r},R2=e=>typeof e=="boolean",J1=(e,t,n)=>{let r=-1;const o=ud(t)?[t]:nv(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=Fr(u)||Array.isArray(u)?u:isNaN(+o[r+1])?{}:[]}if(s==="__proto__"||s==="constructor"||s==="prototype")return;e[s]=l,e=e[s]}};const D7={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ko={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},sa={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},FP=k.createContext(null);FP.displayName="HookFormContext";const rv=()=>k.useContext(FP);var jP=(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]!==ko.all&&(t._proxyFormState[a]=!r||ko.all),n&&(n[a]=!0),e[a]}});return o};const ov=typeof window<"u"?c.useLayoutEffect:c.useEffect;function FDe(e){const t=rv(),{control:n=t.control,disabled:r,name:o,exact:i}=e||{},[a,s]=k.useState(n._formState),l=k.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return ov(()=>n._subscribe({name:o,formState:l.current,exact:i,callback:u=>{!r&&s({...n._formState,...u})}}),[o,r,i]),k.useEffect(()=>{l.current.isValid&&n._setValid(!0)},[n]),k.useMemo(()=>jP(a,n,l.current,!1),[a,n])}var _i=e=>typeof e=="string",VP=(e,t,n,r,o)=>_i(e)?(r&&t.watch.add(e),un(n,e,o)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),un(n,i))):(r&&(t.watchAll=!0),n);function jDe(e){const t=rv(),{control:n=t.control,name:r,defaultValue:o,disabled:i,exact:a}=e||{},s=k.useRef(o),[l,u]=k.useState(n._getWatch(r,s.current));return ov(()=>n._subscribe({name:r,formState:{values:!0},exact:a,callback:d=>!i&&u(VP(r,n._names,d.values||n._formValues,!1,s.current))}),[r,n,i,a]),k.useEffect(()=>n._removeUnmounted()),l}function VDe(e){const t=rv(),{name:n,disabled:r,control:o=t.control,shouldUnregister:i}=e,a=NP(o._names.array,n),s=jDe({control:o,name:n,defaultValue:un(o._formValues,n,un(o._defaultValues,n,e.defaultValue)),exact:!0}),l=FDe({control:o,name:n,exact:!0}),u=k.useRef(e),d=k.useRef(o.register(n,{...e.rules,value:s,...R2(e.disabled)?{disabled:e.disabled}:{}})),h=k.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!un(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!un(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!un(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!un(l.validatingFields,n)},error:{enumerable:!0,get:()=>un(l.errors,n)}}),[l,n]),C=k.useCallback(p=>d.current.onChange({target:{value:TP(p),name:n},type:D7.CHANGE}),[n]),m=k.useCallback(()=>d.current.onBlur({target:{value:un(o._formValues,n),name:n},type:D7.BLUR}),[n,o._formValues]),v=k.useCallback(p=>{const y=un(o._fields,n);y&&p&&(y._f.ref={focus:()=>p.focus&&p.focus(),select:()=>p.select&&p.select(),setCustomValidity:x=>p.setCustomValidity(x),reportValidity:()=>p.reportValidity()})},[o._fields,n]),A=k.useMemo(()=>({name:n,value:s,...R2(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:C,onBlur:m,ref:v}),[n,r,l.disabled,C,m,v,s]);return k.useEffect(()=>{const p=o._options.shouldUnregister||i;o.register(n,{...u.current.rules,...R2(u.current.disabled)?{disabled:u.current.disabled}:{}});const y=(x,E)=>{const S=un(o._fields,x);S&&S._f&&(S._f.mount=E)};if(y(n,!0),p){const x=Wr(un(o._options.defaultValues,n));J1(o._defaultValues,n,x),Tr(un(o._formValues,n))&&J1(o._formValues,n,x)}return!a&&o.register(n),()=>{(a?p&&!o._state.action:p)?o.unregister(n):y(n,!1)}},[n,o,a,i]),k.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),k.useMemo(()=>({field:A,formState:l,fieldState:h}),[A,l,h])}const b3=e=>e.render(VDe(e));var zP=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},z4=e=>Array.isArray(e)?e:[e],jS=()=>{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=[]}}},Vg=e=>W0(e)||!PP(e);function r9(e,t,n=new WeakSet){if(Vg(e)||Vg(t))return e===t;if(cs(e)&&cs(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(cs(a)&&cs(s)||Fr(a)&&Fr(s)||Array.isArray(a)&&Array.isArray(s)?!r9(a,s,n):a!==s)return!1}}return!0}var f2=e=>Fr(e)&&!Object.keys(e).length,iv=e=>e.type==="file",Bo=e=>typeof e=="function",I7=e=>{if(!ev)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ZP=e=>e.type==="select-multiple",av=e=>e.type==="radio",zDe=e=>av(e)||ql(e),Ih=e=>I7(e)&&e.isConnected;function ZDe(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Tr(e)?r++:e[t[r++]];return e}function $De(e){for(const t in e)if(e.hasOwnProperty(t)&&!Tr(e[t]))return!1;return!0}function zr(e,t){const n=Array.isArray(t)?t:ud(t)?[t]:nv(t),r=n.length===1?e:ZDe(e,n),o=n.length-1,i=n[o];return r&&delete r[i],o!==0&&(Fr(r)&&f2(r)||Array.isArray(r)&&$De(r))&&zr(e,n.slice(0,-1)),e}var $P=e=>{for(const t in e)if(Bo(e[t]))return!0;return!1};function P7(e,t={}){const n=Array.isArray(e);if(Fr(e)||n)for(const r in e)Array.isArray(e[r])||Fr(e[r])&&!$P(e[r])?(t[r]=Array.isArray(e[r])?[]:{},P7(e[r],t[r])):W0(e[r])||(t[r]=!0);return t}function UP(e,t,n){const r=Array.isArray(e);if(Fr(e)||r)for(const o in e)Array.isArray(e[o])||Fr(e[o])&&!$P(e[o])?Tr(t)||Vg(n[o])?n[o]=Array.isArray(e[o])?P7(e[o],[]):{...P7(e[o])}:UP(e[o],W0(t)?{}:t[o],n[o]):n[o]=!r9(e[o],t[o]);return n}var s4=(e,t)=>UP(e,t,P7(t));const VS={value:!1,isValid:!1},zS={value:!0,isValid:!0};var WP=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&&!Tr(e[0].attributes.value)?Tr(e[0].value)||e[0].value===""?zS:{value:e[0].value,isValid:!0}:zS:VS}return VS},KP=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Tr(e)?e:t?e===""?NaN:e&&+e:n&&_i(e)?new Date(e):r?r(e):e;const ZS={isValid:!1,value:null};var QP=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,ZS):ZS;function $S(e){const t=e.ref;return iv(t)?t.files:av(t)?QP(e.refs).value:ZP(t)?[...t.selectedOptions].map(({value:n})=>n):ql(t)?WP(e.refs).value:KP(Tr(t.value)?e.ref.value:t.value,e)}var UDe=(e,t,n,r)=>{const o={};for(const i of e){const a=un(t,i);a&&J1(o,i,a._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},T7=e=>e instanceof RegExp,l4=e=>Tr(e)?e:T7(e)?e.source:Fr(e)?T7(e.value)?e.value.source:e.value:e,US=e=>({isOnSubmit:!e||e===ko.onSubmit,isOnBlur:e===ko.onBlur,isOnChange:e===ko.onChange,isOnAll:e===ko.all,isOnTouch:e===ko.onTouched});const WS="AsyncFunction";var WDe=e=>!!e&&!!e.validate&&!!(Bo(e.validate)&&e.validate.constructor.name===WS||Fr(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===WS)),KDe=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),KS=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Z4=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const i=un(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(Z4(s,t))break}else if(Fr(s)&&Z4(s,t))break}}};function QS(e,t,n){const r=un(e,n);if(r||ud(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),a=un(t,i),s=un(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 QDe=(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||ko.all))},GDe=(e,t,n)=>!e||!t||e===t||z4(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),YDe=(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,XDe=(e,t)=>!tv(un(e,t)).length&&zr(e,t),qDe=(e,t,n)=>{const r=z4(un(e,n));return J1(r,"root",t[n]),J1(e,n,r),e},R8=e=>_i(e);function GS(e,t,n="validate"){if(R8(e)||Array.isArray(e)&&e.every(R8)||R2(e)&&!e)return{type:n,message:R8(e)?e:"",ref:t}}var m3=e=>Fr(e)&&!T7(e)?e:{value:e,message:""},YS=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:v,name:A,valueAsNumber:p,mount:y}=e._f,x=un(n,A);if(!y||t.has(A))return{};const E=s?s[0]:a,S=T=>{o&&E.reportValidity&&(E.setCustomValidity(R2(T)?"":T||""),E.reportValidity())},_={},M=av(a),H=ql(a),R=M||H,B=(p||iv(a))&&Tr(a.value)&&Tr(x)||I7(a)&&a.value===""||x===""||Array.isArray(x)&&!x.length,I=zP.bind(null,A,r,_),P=(T,N,F,j=sa.maxLength,z=sa.minLength)=>{const U=T?N:F;_[A]={type:T?j:z,message:U,ref:a,...I(T?j:z,U)}};if(i?!Array.isArray(x)||!x.length:l&&(!R&&(B||W0(x))||R2(x)&&!x||H&&!WP(s).isValid||M&&!QP(s).isValid)){const{value:T,message:N}=R8(l)?{value:!!l,message:l}:m3(l);if(T&&(_[A]={type:sa.required,message:N,ref:E,...I(sa.required,N)},!r))return S(N),_}if(!B&&(!W0(h)||!W0(C))){let T,N;const F=m3(C),j=m3(h);if(!W0(x)&&!isNaN(x)){const z=a.valueAsNumber||x&&+x;W0(F.value)||(T=z>F.value),W0(j.value)||(N=z<j.value)}else{const z=a.valueAsDate||new Date(x),U=K=>new Date(new Date().toDateString()+" "+K),Q=a.type=="time",q=a.type=="week";_i(F.value)&&x&&(T=Q?U(x)>U(F.value):q?x>F.value:z>new Date(F.value)),_i(j.value)&&x&&(N=Q?U(x)<U(j.value):q?x<j.value:z<new Date(j.value))}if((T||N)&&(P(!!T,F.message,j.message,sa.max,sa.min),!r))return S(_[A].message),_}if((u||d)&&!B&&(_i(x)||i&&Array.isArray(x))){const T=m3(u),N=m3(d),F=!W0(T.value)&&x.length>+T.value,j=!W0(N.value)&&x.length<+N.value;if((F||j)&&(P(F,T.message,N.message),!r))return S(_[A].message),_}if(m&&!B&&_i(x)){const{value:T,message:N}=m3(m);if(T7(T)&&!x.match(T)&&(_[A]={type:sa.pattern,message:N,ref:a,...I(sa.pattern,N)},!r))return S(N),_}if(v){if(Bo(v)){const T=await v(x,n),N=GS(T,E);if(N&&(_[A]={...N,...I(sa.validate,N.message)},!r))return S(N.message),_}else if(Fr(v)){let T={};for(const N in v){if(!f2(T)&&!r)break;const F=GS(await v[N](x,n),E,N);F&&(T={...F,...I(N,F.message)},S(F.message),r&&(_[A]=T))}if(!f2(T)&&(_[A]={ref:E,...T},!r))return _}}return S(!0),_};const JDe={mode:ko.onSubmit,reValidateMode:ko.onChange,shouldFocusError:!0};function eIe(e={}){let t={...JDe,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Bo(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=Fr(t.defaultValues)||Fr(t.values)?Wr(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:Wr(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:jS(),state:jS()},m=t.criteriaMode===ko.all,v=se=>re=>{clearTimeout(u),u=setTimeout(se,re)},A=async se=>{if(!t.disabled&&(d.isValid||h.isValid||se)){const re=t.resolver?f2((await H()).errors):await B(r,!0);re!==n.isValid&&C.state.next({isValid:re})}},p=(se,re)=>{!t.disabled&&(d.isValidating||d.validatingFields||h.isValidating||h.validatingFields)&&((se||Array.from(s.mount)).forEach(me=>{me&&(re?J1(n.validatingFields,me,re):zr(n.validatingFields,me))}),C.state.next({validatingFields:n.validatingFields,isValidating:!f2(n.validatingFields)}))},y=(se,re=[],me,Oe,xe=!0,Me=!0)=>{if(Oe&&me&&!t.disabled){if(a.action=!0,Me&&Array.isArray(un(r,se))){const Ie=me(un(r,se),Oe.argA,Oe.argB);xe&&J1(r,se,Ie)}if(Me&&Array.isArray(un(n.errors,se))){const Ie=me(un(n.errors,se),Oe.argA,Oe.argB);xe&&J1(n.errors,se,Ie),XDe(n.errors,se)}if((d.touchedFields||h.touchedFields)&&Me&&Array.isArray(un(n.touchedFields,se))){const Ie=me(un(n.touchedFields,se),Oe.argA,Oe.argB);xe&&J1(n.touchedFields,se,Ie)}(d.dirtyFields||h.dirtyFields)&&(n.dirtyFields=s4(o,i)),C.state.next({name:se,isDirty:P(se,re),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else J1(i,se,re)},x=(se,re)=>{J1(n.errors,se,re),C.state.next({errors:n.errors})},E=se=>{n.errors=se,C.state.next({errors:n.errors,isValid:!1})},S=(se,re,me,Oe)=>{const xe=un(r,se);if(xe){const Me=un(i,se,Tr(me)?un(o,se):me);Tr(Me)||Oe&&Oe.defaultChecked||re?J1(i,se,re?Me:$S(xe._f)):F(se,Me),a.mount&&A()}},_=(se,re,me,Oe,xe)=>{let Me=!1,Ie=!1;const qe={name:se};if(!t.disabled){if(!me||Oe){(d.isDirty||h.isDirty)&&(Ie=n.isDirty,n.isDirty=qe.isDirty=P(),Me=Ie!==qe.isDirty);const nt=r9(un(o,se),re);Ie=!!un(n.dirtyFields,se),nt?zr(n.dirtyFields,se):J1(n.dirtyFields,se,!0),qe.dirtyFields=n.dirtyFields,Me=Me||(d.dirtyFields||h.dirtyFields)&&Ie!==!nt}if(me){const nt=un(n.touchedFields,se);nt||(J1(n.touchedFields,se,me),qe.touchedFields=n.touchedFields,Me=Me||(d.touchedFields||h.touchedFields)&&nt!==me)}Me&&xe&&C.state.next(qe)}return Me?qe:{}},M=(se,re,me,Oe)=>{const xe=un(n.errors,se),Me=(d.isValid||h.isValid)&&R2(re)&&n.isValid!==re;if(t.delayError&&me?(l=v(()=>x(se,me)),l(t.delayError)):(clearTimeout(u),l=null,me?J1(n.errors,se,me):zr(n.errors,se)),(me?!r9(xe,me):xe)||!f2(Oe)||Me){const Ie={...Oe,...Me&&R2(re)?{isValid:re}:{},errors:n.errors,name:se};n={...n,...Ie},C.state.next(Ie)}},H=async se=>{p(se,!0);const re=await t.resolver(i,t.context,UDe(se||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return p(se),re},R=async se=>{const{errors:re}=await H(se);if(se)for(const me of se){const Oe=un(re,me);Oe?J1(n.errors,me,Oe):zr(n.errors,me)}else n.errors=re;return re},B=async(se,re,me={valid:!0})=>{for(const Oe in se){const xe=se[Oe];if(xe){const{_f:Me,...Ie}=xe;if(Me){const qe=s.array.has(Me.name),nt=xe._f&&WDe(xe._f);nt&&d.validatingFields&&p([Oe],!0);const Je=await YS(xe,s.disabled,i,m,t.shouldUseNativeValidation&&!re,qe);if(nt&&d.validatingFields&&p([Oe]),Je[Me.name]&&(me.valid=!1,re))break;!re&&(un(Je,Me.name)?qe?qDe(n.errors,Je,Me.name):J1(n.errors,Me.name,Je[Me.name]):zr(n.errors,Me.name))}!f2(Ie)&&await B(Ie,re,me)}}return me.valid},I=()=>{for(const se of s.unMount){const re=un(r,se);re&&(re._f.refs?re._f.refs.every(me=>!Ih(me)):!Ih(re._f.ref))&&he(se)}s.unMount=new Set},P=(se,re)=>!t.disabled&&(se&&re&&J1(i,se,re),!r9(K(),o)),T=(se,re,me)=>VP(se,s,{...a.mount?i:Tr(re)?o:_i(se)?{[se]:re}:re},me,re),N=se=>tv(un(a.mount?i:o,se,t.shouldUnregister?un(o,se,[]):[])),F=(se,re,me={})=>{const Oe=un(r,se);let xe=re;if(Oe){const Me=Oe._f;Me&&(!Me.disabled&&J1(i,se,KP(re,Me)),xe=I7(Me.ref)&&W0(re)?"":re,ZP(Me.ref)?[...Me.ref.options].forEach(Ie=>Ie.selected=xe.includes(Ie.value)):Me.refs?ql(Me.ref)?Me.refs.forEach(Ie=>{(!Ie.defaultChecked||!Ie.disabled)&&(Array.isArray(xe)?Ie.checked=!!xe.find(qe=>qe===Ie.value):Ie.checked=xe===Ie.value||!!xe)}):Me.refs.forEach(Ie=>Ie.checked=Ie.value===xe):iv(Me.ref)?Me.ref.value="":(Me.ref.value=xe,Me.ref.type||C.state.next({name:se,values:Wr(i)})))}(me.shouldDirty||me.shouldTouch)&&_(se,xe,me.shouldTouch,me.shouldDirty,!0),me.shouldValidate&&q(se)},j=(se,re,me)=>{for(const Oe in re){if(!re.hasOwnProperty(Oe))return;const xe=re[Oe],Me=se+"."+Oe,Ie=un(r,Me);(s.array.has(se)||Fr(xe)||Ie&&!Ie._f)&&!cs(xe)?j(Me,xe,me):F(Me,xe,me)}},z=(se,re,me={})=>{const Oe=un(r,se),xe=s.array.has(se),Me=Wr(re);J1(i,se,Me),xe?(C.array.next({name:se,values:Wr(i)}),(d.isDirty||d.dirtyFields||h.isDirty||h.dirtyFields)&&me.shouldDirty&&C.state.next({name:se,dirtyFields:s4(o,i),isDirty:P(se,Me)})):Oe&&!Oe._f&&!W0(Me)?j(se,Me,me):F(se,Me,me),KS(se,s)&&C.state.next({...n}),C.state.next({name:a.mount?se:void 0,values:Wr(i)})},U=async se=>{a.mount=!0;const re=se.target;let me=re.name,Oe=!0;const xe=un(r,me),Me=nt=>{Oe=Number.isNaN(nt)||cs(nt)&&isNaN(nt.getTime())||r9(nt,un(i,me,nt))},Ie=US(t.mode),qe=US(t.reValidateMode);if(xe){let nt,Je;const gt=re.type?$S(xe._f):TP(se),Ke=se.type===D7.BLUR||se.type===D7.FOCUS_OUT,De=!KDe(xe._f)&&!t.resolver&&!un(n.errors,me)&&!xe._f.deps||YDe(Ke,un(n.touchedFields,me),n.isSubmitted,qe,Ie),ft=KS(me,s,Ke);J1(i,me,gt),Ke?(xe._f.onBlur&&xe._f.onBlur(se),l&&l(0)):xe._f.onChange&&xe._f.onChange(se);const Ge=_(me,gt,Ke),Qe=!f2(Ge)||ft;if(!Ke&&C.state.next({name:me,type:se.type,values:Wr(i)}),De)return(d.isValid||h.isValid)&&(t.mode==="onBlur"?Ke&&A():Ke||A()),Qe&&C.state.next({name:me,...ft?{}:Ge});if(!Ke&&ft&&C.state.next({...n}),t.resolver){const{errors:rt}=await H([me]);if(Me(gt),Oe){const Fe=QS(n.errors,r,me),dt=QS(rt,r,Fe.name||me);nt=dt.error,me=dt.name,Je=f2(rt)}}else p([me],!0),nt=(await YS(xe,s.disabled,i,m,t.shouldUseNativeValidation))[me],p([me]),Me(gt),Oe&&(nt?Je=!1:(d.isValid||h.isValid)&&(Je=await B(r,!0)));Oe&&(xe._f.deps&&q(xe._f.deps),M(me,Je,nt,Ge))}},Q=(se,re)=>{if(un(n.errors,re)&&se.focus)return se.focus(),1},q=async(se,re={})=>{let me,Oe;const xe=z4(se);if(t.resolver){const Me=await R(Tr(se)?se:xe);me=f2(Me),Oe=se?!xe.some(Ie=>un(Me,Ie)):me}else se?(Oe=(await Promise.all(xe.map(async Me=>{const Ie=un(r,Me);return await B(Ie&&Ie._f?{[Me]:Ie}:Ie)}))).every(Boolean),!(!Oe&&!n.isValid)&&A()):Oe=me=await B(r);return C.state.next({...!_i(se)||(d.isValid||h.isValid)&&me!==n.isValid?{}:{name:se},...t.resolver||!se?{isValid:me}:{},errors:n.errors}),re.shouldFocus&&!Oe&&Z4(r,Q,se?xe:s.mount),Oe},K=se=>{const re={...a.mount?i:o};return Tr(se)?re:_i(se)?un(re,se):se.map(me=>un(re,me))},$=(se,re)=>({invalid:!!un((re||n).errors,se),isDirty:!!un((re||n).dirtyFields,se),error:un((re||n).errors,se),isValidating:!!un(n.validatingFields,se),isTouched:!!un((re||n).touchedFields,se)}),G=se=>{se&&z4(se).forEach(re=>zr(n.errors,re)),C.state.next({errors:se?n.errors:{}})},X=(se,re,me)=>{const Oe=(un(r,se,{_f:{}})._f||{}).ref,xe=un(n.errors,se)||{},{ref:Me,message:Ie,type:qe,...nt}=xe;J1(n.errors,se,{...nt,...re,ref:Oe}),C.state.next({name:se,errors:n.errors,isValid:!1}),me&&me.shouldFocus&&Oe&&Oe.focus&&Oe.focus()},J=(se,re)=>Bo(se)?C.state.subscribe({next:me=>se(T(void 0,re),me)}):T(se,re,!0),ee=se=>C.state.subscribe({next:re=>{GDe(se.name,re.name,se.exact)&&QDe(re,se.formState||d,Ve,se.reRenderRoot)&&se.callback({values:{...i},...n,...re})}}).unsubscribe,ne=se=>(a.mount=!0,h={...h,...se.formState},ee({...se,formState:h})),he=(se,re={})=>{for(const me of se?z4(se):s.mount)s.mount.delete(me),s.array.delete(me),re.keepValue||(zr(r,me),zr(i,me)),!re.keepError&&zr(n.errors,me),!re.keepDirty&&zr(n.dirtyFields,me),!re.keepTouched&&zr(n.touchedFields,me),!re.keepIsValidating&&zr(n.validatingFields,me),!t.shouldUnregister&&!re.keepDefaultValue&&zr(o,me);C.state.next({values:Wr(i)}),C.state.next({...n,...re.keepDirty?{isDirty:P()}:{}}),!re.keepIsValid&&A()},oe=({disabled:se,name:re})=>{(R2(se)&&a.mount||se||s.disabled.has(re))&&(se?s.disabled.add(re):s.disabled.delete(re))},ye=(se,re={})=>{let me=un(r,se);const Oe=R2(re.disabled)||R2(t.disabled);return J1(r,se,{...me||{},_f:{...me&&me._f?me._f:{ref:{name:se}},name:se,mount:!0,...re}}),s.mount.add(se),me?oe({disabled:R2(re.disabled)?re.disabled:t.disabled,name:se}):S(se,!0,re.value),{...Oe?{disabled:re.disabled||t.disabled}:{},...t.progressive?{required:!!re.required,min:l4(re.min),max:l4(re.max),minLength:l4(re.minLength),maxLength:l4(re.maxLength),pattern:l4(re.pattern)}:{},name:se,onChange:U,onBlur:U,ref:xe=>{if(xe){ye(se,re),me=un(r,se);const Me=Tr(xe.value)&&xe.querySelectorAll&&xe.querySelectorAll("input,select,textarea")[0]||xe,Ie=zDe(Me),qe=me._f.refs||[];if(Ie?qe.find(nt=>nt===Me):Me===me._f.ref)return;J1(r,se,{_f:{...me._f,...Ie?{refs:[...qe.filter(Ih),Me,...Array.isArray(un(o,se))?[{}]:[]],ref:{type:Me.type,name:se}}:{ref:Me}}}),S(se,!1,void 0,Me)}else me=un(r,se,{}),me._f&&(me._f.mount=!1),(t.shouldUnregister||re.shouldUnregister)&&!(NP(s.array,se)&&a.action)&&s.unMount.add(se)}}},be=()=>t.shouldFocusError&&Z4(r,Q,s.mount),ge=se=>{R2(se)&&(C.state.next({disabled:se}),Z4(r,(re,me)=>{const Oe=un(r,me);Oe&&(re.disabled=Oe._f.disabled||se,Array.isArray(Oe._f.refs)&&Oe._f.refs.forEach(xe=>{xe.disabled=Oe._f.disabled||se}))},0,!1))},ue=(se,re)=>async me=>{let Oe;me&&(me.preventDefault&&me.preventDefault(),me.persist&&me.persist());let xe=Wr(i);if(C.state.next({isSubmitting:!0}),t.resolver){const{errors:Me,values:Ie}=await H();n.errors=Me,xe=Wr(Ie)}else await B(r);if(s.disabled.size)for(const Me of s.disabled)zr(xe,Me);if(zr(n.errors,"root"),f2(n.errors)){C.state.next({errors:{}});try{await se(xe,me)}catch(Me){Oe=Me}}else re&&await re({...n.errors},me),be(),setTimeout(be);if(C.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:f2(n.errors)&&!Oe,submitCount:n.submitCount+1,errors:n.errors}),Oe)throw Oe},le=(se,re={})=>{un(r,se)&&(Tr(re.defaultValue)?z(se,Wr(un(o,se))):(z(se,re.defaultValue),J1(o,se,Wr(re.defaultValue))),re.keepTouched||zr(n.touchedFields,se),re.keepDirty||(zr(n.dirtyFields,se),n.isDirty=re.defaultValue?P(se,Wr(un(o,se))):P()),re.keepError||(zr(n.errors,se),d.isValid&&A()),C.state.next({...n}))},Ce=(se,re={})=>{const me=se?Wr(se):o,Oe=Wr(me),xe=f2(se),Me=xe?o:Oe;if(re.keepDefaultValues||(o=me),!re.keepValues){if(re.keepDirtyValues){const Ie=new Set([...s.mount,...Object.keys(s4(o,i))]);for(const qe of Array.from(Ie))un(n.dirtyFields,qe)?J1(Me,qe,un(i,qe)):z(qe,un(Me,qe))}else{if(ev&&Tr(se))for(const Ie of s.mount){const qe=un(r,Ie);if(qe&&qe._f){const nt=Array.isArray(qe._f.refs)?qe._f.refs[0]:qe._f.ref;if(I7(nt)){const Je=nt.closest("form");if(Je){Je.reset();break}}}}if(re.keepFieldsRef)for(const Ie of s.mount)z(Ie,un(Me,Ie));else r={}}i=t.shouldUnregister?re.keepDefaultValues?Wr(o):{}:Wr(Me),C.array.next({values:{...Me}}),C.state.next({values:{...Me}})}s={mount:re.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!d.isValid||!!re.keepIsValid||!!re.keepDirtyValues,a.watch=!!t.shouldUnregister,C.state.next({submitCount:re.keepSubmitCount?n.submitCount:0,isDirty:xe?!1:re.keepDirty?n.isDirty:!!(re.keepDefaultValues&&!r9(se,o)),isSubmitted:re.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:xe?{}:re.keepDirtyValues?re.keepDefaultValues&&i?s4(o,i):n.dirtyFields:re.keepDefaultValues&&se?s4(o,se):re.keepDirty?n.dirtyFields:{},touchedFields:re.keepTouched?n.touchedFields:{},errors:re.keepErrors?n.errors:{},isSubmitSuccessful:re.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Ee=(se,re)=>Ce(Bo(se)?se(i):se,re),Se=(se,re={})=>{const me=un(r,se),Oe=me&&me._f;if(Oe){const xe=Oe.refs?Oe.refs[0]:Oe.ref;xe.focus&&(xe.focus(),re.shouldSelect&&Bo(xe.select)&&xe.select())}},Ve=se=>{n={...n,...se}},Ue={control:{register:ye,unregister:he,getFieldState:$,handleSubmit:ue,setError:X,_subscribe:ee,_runSchema:H,_focusError:be,_getWatch:T,_getDirty:P,_setValid:A,_setFieldArray:y,_setDisabledField:oe,_setErrors:E,_getFieldArray:N,_reset:Ce,_resetDefaultValues:()=>Bo(t.defaultValues)&&t.defaultValues().then(se=>{Ee(se,t.resetOptions),C.state.next({isLoading:!1})}),_removeUnmounted:I,_disableForm:ge,_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:ne,trigger:q,register:ye,handleSubmit:ue,watch:J,setValue:z,getValues:K,reset:Ee,resetField:le,clearErrors:G,unregister:he,setError:X,setFocus:Se,getFieldState:$};return{...Ue,formControl:Ue}}function GP(e={}){const t=k.useRef(void 0),n=k.useRef(void 0),[r,o]=k.useState({isDirty:!1,isValidating:!1,isLoading:Bo(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:Bo(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Bo(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...s}=eIe(e);t.current={...s,formState:r}}const i=t.current.control;return i._options=e,ov(()=>{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]),k.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),k.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),k.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),k.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),k.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==r.isDirty&&i._subjects.state.next({isDirty:a})}},[i,r.isDirty]),k.useEffect(()=>{e.values&&!r9(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]),k.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=jP(r,i),t.current}const tIe={s:"xs",m:"s",l:"m"},sv=({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:v=!0,allowClear:A=!1,title:p="",width:y="300px",height:x="m",id:E="",className:S="",textColor:_,textSize:M="s"})=>(M=M??tIe[x],V.jsx(Oa,{id:E,allowClear:A,disabled:d,showSearch:h,className:`multi_select_container ${S} h_${x} text_${M}`,mode:"multiple",style:{width:y,"--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:v?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(Ma,{styles:{root:{pointerEvents:"none"}},title:H.map(({label:R})=>R).join(", "),children:V.jsxs("span",{children:["+",H.length]})})})),YP=({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]=k.useState(e),h=e!==void 0,C=h?e:u,m=v=>{h||d(v),o==null||o(v)};return V.jsx(Iu,{checked:C,onChange:m,disabled:t,loading:i,checkedChildren:n,unCheckedChildren:r,style:{backgroundColor:t||i?l:C?s:a}})},nIe=({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:v,onSubmit:A=()=>{},footerItems:p,footerImage:y,footerImageMargin:x})=>{const{control:E,handleSubmit:S,formState:{errors:_}}=GP({resolver:h}),[M,H]=k.useState(!1),R=S(P=>A(P)),B=({name:P,type:T,width:N,placeholder:F,options:j})=>{switch(T){case"input":return V.jsx(b3,{control:E,name:P,render:({field:{onChange:z,value:U}})=>V.jsx(x9,{width:N,onChange:z,value:U,placeholder:F,height:n})});case"select":return V.jsx(b3,{control:E,name:P,render:({field:{onChange:z,value:U}})=>V.jsx(xs,{options:j,width:N,onChange:z,value:U,placeholder:F,height:n})});case"multiselect":return V.jsx(b3,{control:E,name:P,render:({field:{onChange:z,value:U}})=>V.jsx(sv,{options:j,width:N,onChange:z,value:U,placeholder:F,height:n})});case"checkbox":return V.jsx(b3,{control:E,name:P,render:({field:{onChange:z,value:U}})=>V.jsx(YP,{onChange:z,value:U})});case"password":return V.jsx(b3,{control:E,name:P,render:({field:{onChange:z,value:U}})=>V.jsxs("div",{className:"password_input",style:{width:N},children:[V.jsx(x9,{width:N,onChange:z,value:U,placeholder:F,height:n,type:M?"text":"password"}),V.jsx(G0,{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(G0,{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]}),B({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(Er,{type:"submit",content:m,loading:v,onClick:R,width:"100%",size:n}),C?V.jsx("p",{children:C}):V.jsx(V.Fragment,{}),p||V.jsx(V.Fragment,{})]})]}),y?V.jsx("img",{src:y,alt:"footer image",className:"login_footer_image",style:{bottom:x}}):V.jsx(V.Fragment,{})]})]})},rIe={lat:20.5937,lng:78.9629},oIe=5,iIe={osm:{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:'© <a href="https://osm.org/copyright">OpenStreetMap</a> contributors'}},aIe={defaultZoom:oIe,defaultCenter:rIe,defaultMapProvider:iIe.osm},sIe=k.forwardRef(({position:e,children:t,src:n,...r},o)=>V.jsx(HP,{position:e,icon:n?BP(n):kP,draggable:!1,ref:o,...r,children:t})),lIe=({mapConfig:e=aIe,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:v})=>{const[A,p]=k.useState(!1),[y,x]=k.useState(null),E=C!==void 0,S=E?C:y;k.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=k.useMemo(()=>S==null?null:t==null?void 0:t[S],[t,S]),R=k.useRef(null),B=k.useRef({});k.useEffect(()=>{if(!A)return;const F=requestAnimationFrame(()=>{R.current=S!=null?B.current[S]??null:null,i&&Object.entries(B.current).forEach(([j,z])=>{Number(j)===S||z==null||z.openPopup()}),S!=null&&B.current[S]&&B.current[S].openPopup()});return()=>cancelAnimationFrame(F)},[S,A]);const I=k.useRef(null);k.useEffect(()=>{const F=I.current;F&&(H!=null&&H.position)&&F.setView(H.position,F.getZoom(),{animate:!0})},[H,A]);const[P,T]=k.useState(e==null?void 0:e.defaultCenter);if(k.useEffect(()=>{S&&P&&T(H==null?void 0:H.position)},[H]),typeof window>"u"||!A)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(MP,{center:P,zoom:e==null?void 0:e.defaultZoom,className:"static_map",zoomControl:!1,style:{width:"100%",height:"100%"},children:[V.jsx(XRe,{url:e==null?void 0:e.defaultMapProvider.url,attribution:e==null?void 0:e.defaultMapProvider.attribution}),V.jsx(RP,{mapRef:I}),s?V.jsx(JRe,{items:t}):null,V.jsx(OP,{position:"bottomright"}),t==null?void 0:t.map((F,j)=>{const z=j===S;return V.jsx(sIe,{position:F==null?void 0:F.position,ref:U=>{U&&(B.current[j]=U)},eventHandlers:{click:()=>{E&&m?m(j):x(j)}},src:(F==null?void 0:F.icon)??"",children:o||i?V.jsx(LP,{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&&v&&v()}},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(Er,{variant:"primary",onClick:_,size:"s",icon:"leftArrow",backgroundColor:N,borderColor:N,title:"Previous"}),V.jsx(Er,{variant:"primary",onClick:M,size:"s",icon:"rightArrow",iconPosition:"after",backgroundColor:N,borderColor:N,title:"Next"})]}):null]})},cIe=({className:e,style:t,...n})=>{const r=`menu ${e||""}`.trim();return V.jsx(S9,{className:r,style:t,...n})},uIe={xs:"16.67%",s:"25%",m:"37.5%",l:"53.54%",xl:"75%",full:"100%"},dIe=({visible:e,onClose:t,showCloseButton:n=!0,size:r="xl",children:o})=>V.jsx(Co,{open:e,onCancel:t,footer:null,closable:n,maskClosable:!0,destroyOnClose:!0,width:uIe[r],children:o}),fIe=({size:e="m",width:t="12rem",onChange:n,value:r,format:o="MMM YYYY",className:i="",popupClassName:a=""})=>{const s=r?I1(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(ka,{onChange:l,picker:"month",className:`awi_month_picker size_${e} ${i}`,popupClassName:`awi_month_picker_popup ${a}`,format:o,value:s,style:{width:t}})},hIe=({totalPages:e,currentPage:t,onPageChange:n,onNext:r,onPrev:o,color:i,size:a,width:s,inputWidth:l,showPages:u=!0,showArrows:d=!0,showPageSize:h=!1,pageSizes:C=qz,onPageSizeChange:m,className:v})=>{const[A,p]=k.useState(t),[y,x]=k.useState(C[0]);k.useEffect(()=>{p(t)},[t]);const E=M=>{const H=parseInt(M.target.value);isNaN(H)||p(H)},S=M=>{const H=Number(M);x(H),m==null||m(H)},_=(M,H)=>{M.key==="Enter"&&n(H)};return V.jsxs("div",{className:"paginator "+(v||""),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:`${A}`,value:A,onChange:E,onKeyDown:M=>_(M,A)}),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(Er,{variant:"secondary",size:a||"s",icon:"arrowLeft",width:"2.5rem",backgroundColor:i,onClick:o,disabled:t===1}),V.jsx(Er,{variant:"secondary",size:a||"s",icon:"arrowRight",width:"2.5rem",backgroundColor:i,onClick:r,disabled:t===e}),h?V.jsx(xs,{options:$A(C),width:"max-content",onChange:S,value:y,searchable:!1}):V.jsx(V.Fragment,{})]}):V.jsx(V.Fragment,{children:h?V.jsx(xs,{options:$A(C),width:"max-content",onChange:S,value:y,searchable:!1}):V.jsx(V.Fragment,{})})]})},CIe=({children:e,borderColor:t,backgroundColor:n,...r})=>V.jsx(yu,{styles:{root:{"--c_border_color":t,"--c_background_color":n}},trigger:r.trigger??"hover",...r,children:e}),gIe=[{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}],p3={s:16,m:24,l:32},mIe=({intervals:e=gIe,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]=k.useState(void 0),[m,v]=k.useState(0),A=k.useRef(null),p=k.useRef(null),y=()=>{t(),v(0)},x=h!=null&&h!=1/0&&h!=0;k.useEffect(()=>{if(x){A.current&&clearInterval(A.current),p.current&&clearInterval(p.current),A.current=setInterval(y,h);const S=200;p.current=setInterval(()=>{v(_=>_+S>Number(h)?S:_+S)},S)}return()=>{A.current&&clearInterval(A.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(Fu,{}):V.jsxs(V.Fragment,{children:[x?V.jsx(wB,{type:"circle",percent:Math.min(E,100),size:p3==null?void 0:p3[o],strokeWidth:8,strokeColor:r||"#ffcc00",format:()=>"",className:"awi_auto_refresh_progress"}):V.jsx("div",{style:{width:`${p3==null?void 0:p3[o]}px`}}),V.jsx(xs,{className:"awi_auto_refresh_select",options:e.map(S=>({label:S.label,value:S.value})),value:h,onChange:S=>{C(S),v(0)},placeholder:"Off",triggerBackgroundColor:n,borderColor:r,width:i,height:o,searchable:!1,textColor:d,title:"Auto refresh interval",disabled:u}),V.jsx(Er,{className:"awi_auto_refresh_button",width:a,content:s?"Refresh":void 0,variant:"primary",icon:"refresh",size:o,onClick:y,backgroundColor:n,borderColor:r,disabled:u})]})})},pIe=({currentSection:e,currentSubSection:t,height:n="30rem",width:r="16rem",collapsedWidth:o="5.5rem",config:i,isOpen:a,onToggle:s,loading:l})=>{var v,A,p,y,x;const[u,d]=k.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(G0,{name:i.header.logo,size:"auto",className:"awi_sidebar_logo open",onClick:i.header.logoClickAction}):V.jsx(G0,{size:"auto",name:i.header.logoCollapsed,className:"awi_sidebar_logo closed",onClick:i.header.logoClickAction}),V.jsx(G0,{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(Er,{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:(v=i.body.dynamic)!=null&&v[e]?(p=(A=i.body.dynamic)==null?void 0:A[e])==null?void 0:p.map((E,S)=>V.jsx("div",{className:"awi_sidebar_nav_container",children:V.jsx(Er,{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=(y=i==null?void 0:i.footer)==null?void 0:y.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})]})]})]})})},vIe={xs:32,s:40,m:48,l:56,xl:64},AIe=({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}=x8(),{height:v,containerRef:A}=x8(),{height:p,containerRef:y}=x8(),x=vIe[l];return V.jsx("div",{className:`awi_table_container ${u}`,style:{width:a,height:s},ref:m,children:V.jsx(Ni,{...h,className:`awi_table ${l} ${d}`,bordered:!0,pagination:h.pagination||!1,title:o?()=>V.jsx("div",{className:"table_title",ref:A,children:o}):void 0,footer:i?()=>V.jsx("div",{className:"table_footer",ref:y,children:i}):void 0,scroll:{x:"max-content",y:C-x-v-p},style:{"--c_header_bg":e,"--c_body_bg":t,"--c_title_bg":n,"--c_footer_bg":r}})})},bIe=({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 D8={exports:{}},yIe=D8.exports,XS;function wIe(){return XS||(XS=1,function(e,t){(function(n,r){e.exports=r()})(yIe,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,v=a(this),A=(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 v.diff(A,"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)}}})}(D8)),D8.exports}var xIe=wIe();const EIe=p2(xIe);I1.extend(EIe);I1.extend(YO);const _Ie=({size:e="m",width:t="12rem",onChange:n,value:r,format:o,className:i="",popupClassName:a=""})=>{const s=r?I1(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(),v=h.startOf("week"),A=h.endOf("week"),p=`${v.format("Do MMM")}`,y=`${A.format("Do MMMM")}`;return`${m}-${C}th (${p} - ${y})`};return V.jsx(ka,{onChange:l,picker:"week",className:`awi_week_picker size_${e} ${i}`,popupClassName:`awi_week_picker_popup ${a}`,value:s,format:d,style:{width:t}})},qS=(e,t,n)=>{if(e&&"reportValidity"in e){const r=un(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},XP=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?qS(r.ref,n,e):r.refs&&r.refs.forEach(o=>qS(o,n,e))}},SIe=(e,t)=>{t.shouldUseNativeValidation&&XP(e,t);const n={};for(const r in e){const o=un(t.fields,r),i=Object.assign(e[r]||{},{ref:o&&o.ref});if(MIe(t.names||Object.keys(e),r)){const a=Object.assign({},un(n,r));J1(a,"root",i),J1(n,r,a)}else J1(n,r,i)}return n},MIe=(e,t)=>e.some(n=>n.startsWith(t+"."));function HIe(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&&XP({},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:SIe((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]=zP(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 Ph,JS;function LIe(){if(JS)return Ph;JS=1;function e(y){this._maxSize=y,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(y){return this._values[y]},e.prototype.set=function(y,x){return this._size>=this._maxSize&&this.clear(),y in this._values||this._size++,this._values[y]=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);Ph={Cache:e,split:h,normalizePath:d,setter:function(y){var x=d(y);return l.get(y)||l.set(y,function(S,_){for(var M=0,H=x.length,R=S;M<H-1;){var B=x[M];if(B==="__proto__"||B==="constructor"||B==="prototype")return S;R=R[x[M++]]}R[x[M]]=_})},getter:function(y,x){var E=d(y);return u.get(y)||u.set(y,function(_){for(var M=0,H=E.length;M<H;)if(_!=null||!x)_=_[E[M++]];else return;return _})},join:function(y){return y.reduce(function(x,E){return x+(m(E)||n.test(E)?"["+E+"]":(x?".":"")+E)},"")},forEach:function(y,x,E){C(Array.isArray(y)?y:h(y),x,E)}};function d(y){return s.get(y)||s.set(y,h(y).map(function(x){return x.replace(i,"$2")}))}function h(y){return y.match(t)||[""]}function C(y,x,E){var S=y.length,_,M,H,R;for(M=0;M<S;M++)_=y[M],_&&(p(_)&&(_='"'+_+'"'),R=m(_),H=!R&&/^\d+$/.test(_),x.call(E,_,R,H,M,y))}function m(y){return typeof y=="string"&&y&&["'",'"'].indexOf(y.charAt(0))!==-1}function v(y){return y.match(r)&&!y.match(n)}function A(y){return o.test(y)}function p(y){return!m(y)&&(v(y)||A(y))}return Ph}var Cs=LIe(),Th,eM;function OIe(){if(eM)return Th;eM=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 Th={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(" ")},Th}var Nh=OIe(),hc={exports:{}},tM;function kIe(){if(tM)return hc.exports;tM=1,hc.exports=function(o){return e(t(o),o)},hc.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,v,A){if(A.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[v]){l[v]=!0;var y=d.get(m)||new Set;if(y=Array.from(y),v=y.length){A.add(m);do{var x=y[--v];C(x,h.get(x),A)}while(v);A.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 hc.exports}var BIe=kIe();const RIe=p2(BIe),DIe=Object.prototype.toString,IIe=Error.prototype.toString,PIe=RegExp.prototype.toString,TIe=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",NIe=/^Symbol\((.*)\)(.*)$/;function FIe(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function nM(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return FIe(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return TIe.call(e).replace(NIe,"Symbol($1)");const r=DIe.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+IIe.call(e)+"]":r==="RegExp"?PIe.call(e):null}function Ea(e,t){let n=nM(e,t);return n!==null?n:JSON.stringify(e,function(r,o){let i=nM(this[r],t);return i!==null?i:o},2)}function qP(e){return e==null?[]:[].concat(e)}let JP,eT,tT,jIe=/\$\{\s*(\w+)\s*\}/g;JP=Symbol.toStringTag;class rM{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[JP]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=o,this.errors=[],this.inner=[],qP(t).forEach(i=>{if(K0.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]}}eT=Symbol.hasInstance;tT=Symbol.toStringTag;class K0 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(jIe,(o,i)=>Ea(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 rM(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[tT]="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,K0)}static[eT](t){return rM[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let xi={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 \`${Ea(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${Ea(n,!0)}\``+o:`${e} must match the configured type. The validated value was: \`${Ea(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"},e9={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"},zg={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Zg={isValue:"${path} field must be ${value}"},I8={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},P8={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"},VIe={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: \`${Ea(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: \`${Ea(n,!0)}\``}return K0.formatError(xi.notType,e)}};Object.assign(Object.create(null),{mixed:xi,string:d2,number:e9,date:zg,object:I8,array:P8,boolean:Zg,tuple:VIe});const dd=e=>e&&e.__isYupSchema__;class N7{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 N7(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(!dd(o))throw new TypeError("conditions must return a schema object");return o.resolve(n)}}const Cc={context:"$",value:"."};class Fs{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]===Cc.context,this.isValue=this.key[0]===Cc.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Cc.context:this.isValue?Cc.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Cs.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}}Fs.prototype.__isYupRef=!0;const Do=e=>e==null;function v3(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:v,context:A,abortEarly:p=a.spec.abortEarly,disableStackTrace:y=a.spec.disableStackTrace}=o;const x={value:n,parent:v,context:A};function E(P={}){const T=nT(Object.assign({value:n,originalValue:i,label:a.spec.label,path:P.path||r,spec:a.spec,disableStackTrace:P.disableStackTrace||y},h,P.params),x),N=new K0(K0.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:v,type:u,from:o.from,createError:E,resolve(P){return rT(P,x)},options:o,originalValue:i,schema:a};const M=P=>{K0.isError(P)?S(P):P?l(null):S(E())},H=P=>{K0.isError(P)?S(P):s(P)};if(m&&Do(n))return M(!0);let B;try{var I;if(B=d.call(_,n,_),typeof((I=B)==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(B).then(M,H)}}catch(P){H(P);return}M(B)}return t.OPTIONS=e,t}function nT(e,t){if(!e)return e;for(const n of Object.keys(e))e[n]=rT(e[n],t);return e}function rT(e,t){return Fs.isRef(e)?e.getValue(t.value,t.parent,t.context):e}function zIe(e,t,n,r=n){let o,i,a;return t?(Cs.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 F7 extends Set{describe(){const t=[];for(const n of this.values())t.push(Fs.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 F7(this.values())}merge(t,n){const r=this.clone();return t.forEach(o=>r.add(o)),n.forEach(o=>r.delete(o)),r}}function S3(e,t=new Map){if(dd(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]=S3(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,S3(o,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(S3(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,o]of Object.entries(e))n[r]=S3(o,t)}else throw Error(`Unable to clone ${e}`);return n}function ZIe(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 $Ie(e,t){const n=t?`${t}.${e.path}`:e.path;return e.errors.map(r=>({message:r,path:ZIe(n)}))}function oT(e,t){var n;if(!((n=e.inner)!=null&&n.length)&&e.errors.length)return $Ie(e,t);const r=t?`${t}.${e.path}`:e.path;return e.inner.flatMap(o=>oT(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 F7,this._blacklist=new F7,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(xi.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=S3(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&&Do(i))return i;let a=Ea(t),s=Ea(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
|
|
722
722
|
|
|
723
723
|
attempted value: ${a}
|
|
724
|
-
`+(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=A=>{o||(o=!0,n(A,a))},h=A=>{o||(o=!0,r(A,a))},C=i.length,m=[];if(!C)return h([]);let v={value:a,originalValue:s,path:l,options:u,schema:this};for(let A=0;A<i.length;A++){const p=i[A];p(v,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)=>{K0.isError(l)&&(l.value=u),s(l)},(l,u)=>{l.length?s(new K0(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 K0.isError(s)&&(s.value=l),s},(s,l)=>{if(s.length)throw new K0(s,t,void 0,void 0,a);i=l}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(K0.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(K0.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):S3(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=v3({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=v3({message:n,name:"optionality",test(o){return o===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=xi.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=xi.notNull){return this.nullability(!1,t)}required(t=xi.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=xi.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),o=v3(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=qP(t).map(i=>new Fs(i));return o.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof n=="function"?new N7(o,n):N7.fromOptions(o,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=v3({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=xi.oneOf){let r=this.clone();return t.forEach(o=>{r._whitelist.add(o),r._blacklist.delete(o)}),r.internalTests.whiteList=v3({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=xi.notOneOf){let r=this.clone();return t.forEach(o=>{r._blacklist.add(o),r._whitelist.delete(o)}),r.internalTests.blacklist=v3({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?nT(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 K0)return{issues:oT(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}=zIe(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 iT(){return new aT}class aT 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=Zg.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(n){return Do(n)||n===!0}})}isFalse(t=Zg.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(n){return Do(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)}}iT.prototype=aT.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 WIe(e){const t=$g(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 $g(e){var t,n;const r=UIe.exec(e);return r?{year:la(r[1]),month:la(r[2],1)-1,day:la(r[3],1),hour:la(r[4]),minute:la(r[5]),second:la(r[6]),millisecond:r[7]?la(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:la(r[10]),minuteOffset:la(r[11])}:null}function la(e,t=0){return Number(e)||t}let KIe=/^[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])?)*$/,QIe=/^((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,GIe=/^(?:[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,YIe="^\\d{4}-\\d{2}-\\d{2}",XIe="\\d{2}:\\d{2}:\\d{2}",qIe="(([+-]\\d{2}(:?\\d{2})?)|Z)",JIe=new RegExp(`${YIe}T${XIe}(\\.\\d+)?${qIe}$`),ePe=e=>Do(e)||e===e.trim(),tPe={}.toString();function T8(){return new sT}class sT 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===tPe?t:o})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||xi.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(KIe,{name:"email",message:t,excludeEmptyString:!0})}url(t=d2.url){return this.matches(QIe,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=d2.uuid){return this.matches(GIe,{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(JIe,{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=$g(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=$g(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:ePe})}lowercase(t=d2.lowercase){return this.transform(n=>Do(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Do(n)||n===n.toLowerCase()})}uppercase(t=d2.uppercase){return this.transform(n=>Do(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Do(n)||n===n.toUpperCase()})}}T8.prototype=sT.prototype;let nPe=e=>e!=+e;function lT(){return new cT}class cT extends F2{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!nPe(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=e9.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=e9.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=e9.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=e9.moreThan){return this.test({message:n,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(r){return r>this.resolve(t)}})}positive(t=e9.positive){return this.moreThan(0,t)}negative(t=e9.negative){return this.lessThan(0,t)}integer(t=e9.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(t=>Do(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=>Do(o)?o:Math[t](o))}}lT.prototype=cT.prototype;let rPe=new Date(""),oPe=e=>Object.prototype.toString.call(e)==="[object Date]";class lv extends F2{constructor(){super({type:"date",check(t){return oPe(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=WIe(t),isNaN(t)?lv.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(Fs.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=zg.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=zg.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)}})}}lv.INVALID_DATE=rPe;function iPe(e,t=[]){let n=[],r=new Set,o=new Set(t.map(([a,s])=>`${a}-${s}`));function i(a,s){let l=Cs.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),Fs.isRef(s)&&s.isSibling?i(s.path,a):dd(s)&&"deps"in s&&s.deps.forEach(l=>i(l,a))}return RIe.array(Array.from(r),n).reverse()}function oM(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 uT(e){return(t,n)=>oM(e,t)-oM(e,n)}const dT=(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 N8(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=N8(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=N8(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(N8)}):"optional"in e?e.optional():e}const aPe=(e,t)=>{const n=[...Cs.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),o=Cs.getter(Cs.join(n),!0)(e);return!!(o&&r in o)};let iM=e=>Object.prototype.toString.call(e)==="[object Object]";function aM(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const sPe=uT([]);function fT(e){return new hT(e)}class hT extends F2{constructor(t){super({type:"object",check(n){return iM(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=sPe,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 v,A=o[h];u.path=(n.path?`${n.path}.`:"")+h,C=C.resolve({value:A,context:n.context,parent:l});let p=C instanceof F2?C.spec:void 0,y=p==null?void 0:p.strict;if(p!=null&&p.strip){d=d||h in o;continue}v=!n.__validating||!y?C.cast(o[h],u):o[h],v!==void 0&&(l[h]=v)}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||!iM(u)){o(l,u);return}a=a||u;let d=[];for(let h of this._nodes){let C=this.fields[h];!C||Fs.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=iPe(t,n),r._sortErrors=uT(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 N8(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=Cs.getter(t,!0);return this.transform(i=>{if(!i)return i;let a=i;return aPe(i,t)&&(a=Object.assign({},i),r||delete a[t],a[n]=o(i)),a})}json(){return this.transform(dT)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||I8.exact,test(n){if(n==null)return!0;const r=aM(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=I8.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=aM(this.schema,o);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=I8.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(Nh.camelCase)}snakeCase(){return this.transformKeys(Nh.snakeCase)}constantCase(){return this.transformKeys(t=>Nh.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}}fT.prototype=hT.prototype;function CT(e){return new gT(e)}class gT 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(dT)}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(!dd(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+Ea(t));return n.innerType=t,n.spec=Object.assign({},n.spec,{types:t}),n}length(t,n=P8.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||P8.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||P8.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}}CT.prototype=gT.prototype;const lPe=e=>{const t={},n=(r,o="")=>{if("inputType"in r){const i=cPe(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)}),fT().shape(t)},cPe=e=>{let t;switch(e.inputType){case"text":t=T8();break;case"slider":case"range-slider":t=lT();break;case"select":t=T8();break;case"multiselect":t=CT().of(T8());break;case"checkbox":t=iT();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},sM=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},uPe=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},dPe=({name:e,control:t,field:n,className:r="",edit:o=!1,onDeleteClick:i})=>{const a=(s,l)=>{const u={width:n.width||"100%",disabled:!1};switch(n.inputType){case"text":return V.jsx(x9,{...u,placeholder:n.placeholder,value:s||"",onChange:d=>l(d.target.value)});case"select":return V.jsx(xs,{...u,placeholder:n.placeholder||"Select an option",value:s,onChange:l,options:n.options||[]});case"multiselect":return V.jsx(sv,{...u,placeholder:n.placeholder||"Select options",value:s||[],onChange:l,options:n.options||[]});case"checkbox":return V.jsx(Iu,{value:s||!1,onChange:l});case"slider":return V.jsx("div",{className:"slider-container",children:V.jsx(tg,{min:n.min||0,max:n.max||100,step:n.step||1,value:s||n.min||0,onChange:l})});case"range-slider":return V.jsx("div",{className:"range-slider-container",children:V.jsx(tg,{range:!0,min:n.min||0,max:n.max||100,step:n.step||1,value:Array.isArray(s)?s:[n.min||0,n.max||100],onChange:l})});default:return V.jsxs("div",{className:"unsupported-field",children:["Unsupported field type: ",n.inputType]})}};return V.jsxs("div",{className:`form-field ${r}`,children:[V.jsxs("div",{className:"form-field-header",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:"•"})]}):V.jsxs("div",{className:"form-field-label",children:[n.label,": [",Array.isArray(n.value)?n.value[0]:n.min||0,","," ",Array.isArray(n.value)?n.value[1]:n.max||100,"]"]}):V.jsx(V.Fragment,{}),o&&V.jsx(Er,{icon:"deleteIcon",size:"s",variant:"secondary",onClick:s=>{s.preventDefault(),i==null||i(e)},className:"form-field-delete-button"})]}),n.description&&V.jsx("p",{className:"form-field-description",children:n.description}),V.jsx(b3,{name:e,control:t,defaultValue:n.defaultValue||n.defaultValues,render:({field:s})=>V.jsx("div",{className:"form-field-input",children:a(s.value,s.onChange)})})]})},mT=({name:e,config:t,control:n,level:r,className:o="",edit:i=!1,onAddClick:a,onDeleteClick:s})=>{const[l,u]=k.useState(!0),d="inputType"in t,h=()=>i?V.jsxs("div",{className:"form-section-edit-buttons",children:[V.jsx(Er,{icon:"plus",size:"s",variant:"secondary",onClick:p=>{p.preventDefault(),a==null||a(e)},className:"edit-add-button"}),V.jsx(Er,{icon:"deleteIcon",size:"s",variant:"secondary",onClick:p=>{p.preventDefault(),s==null||s(e)},className:"edit-delete-button"})]}):null;if(d)return V.jsx(dPe,{name:e,control:n,field:t,className:o,edit:i,onDeleteClick:s});const C=t,m=r>0,v=Object.keys(C).filter(p=>p!=="label"&&p!=="description").length>1,A=()=>V.jsx("div",{className:"form-section-content",children:Object.entries(C).map(([p,y])=>p==="label"||p==="description"?null:V.jsx(mT,{name:`${e}.${p}`,config:y,control:n,level:r+1,className:"form-section-child",edit:i,onAddClick:a,onDeleteClick:s},p))});return m&&v?V.jsxs("div",{className:`form-section accordion ${o}`,children:[V.jsxs("div",{className:"form-section-header-wrapper",children:[V.jsxs("div",{className:"form-section-header accordion-header",onClick:()=>u(!l),children:[V.jsxs("div",{className:"accordion-title",children:[C.label&&V.jsx("h3",{className:"form-section-title",children:C.label}),C.description&&V.jsx("p",{className:"form-section-description",children:C.description})]}),V.jsx("div",{className:`accordion-icon ${l?"expanded":"collapsed"}`,children:"▼"})]}),h()]}),l&&A()]}):V.jsxs("div",{className:`form-section simple ${o}`,children:[C.label&&V.jsxs("div",{className:"form-section-header-wrapper",children:[V.jsxs("div",{className:"form-section-header simple-header",children:[V.jsx("h3",{className:"form-section-title",children:C.label}),C.description&&V.jsx("p",{className:"form-section-description",children:C.description})]}),h()]}),A()]})},fPe=({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="",edit:h=!1,onAddClick:C,onDeleteClick:m})=>{const v=lPe(e),{control:A,handleSubmit:p,reset:y,formState:{errors:x,isSubmitting:E}}=GP({resolver:HIe(v),defaultValues:sM(u)}),S=H=>{const R=uPe(H);r==null||r(R)},_=()=>{y(sM(u))},M=()=>Object.entries(e).map(([H,R])=>V.jsx(mT,{name:H,config:R,control:A,level:0,className:"form-section-root",edit:h,onAddClick:C,onDeleteClick:m},H));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:p(S),className:"form-group-form",children:[V.jsx("div",{className:"form-group-content",children:M()}),(r||a)&&V.jsxs("div",{className:"form-group-actions",children:[a&&V.jsx(Er,{type:"button",content:s,onClick:_,...l}),r&&V.jsx(Er,{type:"submit",content:o,loading:E,...i})]})]}),Object.keys(x).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(x,null,2)})]})]})},Ug=()=>{const e=k.useRef(!1),t=k.useRef(!1);return k.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=SAe;exports.AwiAnnotationHotkeys=Hg;exports.AwiAnnotationTools=E8;exports.AwiCanvasContainer=_8;exports.AwiCustomConfirmation=aI;exports.AwiEmptyState=RAe;exports.AwiHelperMethods=k2;exports.AwiInput=uD;exports.AwiLoadMoreButton=KAe;exports.AwiMessageScreen=S8;exports.AwiModal=Uu;exports.AwiModalBody=Wu;exports.AwiModalFooter=Qu;exports.AwiModalHeader=Ku;exports.AwiModalRow=p4;exports.AwiPagination=AI;exports.AwiSafeLocalStorage=ma;exports.AwiSamModal=dD;exports.AwiScrollableTableCellList=QAe;exports.AwiSlider=cD;exports.AwiTableBar=WAe;exports.AwiTableBody=vI;exports.AwiTableCell=A4;exports.AwiTableHeader=bR;exports.AwiTableHeaders=yR;exports.AwiTableInfinite=pI;exports.AwiTableRow=up;exports.AwiToastMessage=W1;exports.AwiUseKeyChecker=Ug;exports.Backdrop=oD;exports.Badge=GAe;exports.Button=Er;exports.ButtonGroup=YAe;exports.Chart=GEe;exports.CompactEventCard=gP;exports.ContactInput=wRe;exports.DEFAULT_THEME=zR;exports.DatePicker=xRe;exports.DateRangePicker=LRe;exports.DetectionCarousel=pP;exports.Dropdown=kRe;exports.EventPreview=BRe;exports.FloorMapView=cDe;exports.FormGroup=fPe;exports.Heatmap=IDe;exports.Icon=G0;exports.Input=x9;exports.LiveDot=PDe;exports.LoginPage=nIe;exports.MapView=lIe;exports.Menu=cIe;exports.Modal=dIe;exports.MonthPicker=fIe;exports.Multiselect=sv;exports.Pagination=hIe;exports.Popover=CIe;exports.Refresh=mIe;exports.Select=xs;exports.Sidebar=pIe;exports.Spinner=Fu;exports.Switch=YP;exports.Table=AIe;exports.ThemeProvider=qhe;exports.Toast=vR;exports.Topbar=bIe;exports.WeekPicker=_Ie;exports.showToast=g4;exports.usePagination=Xz;exports.usePointerState=eCe;exports.useResize=x8;exports.useTheme=Jhe;exports.useToast=tCe;
|
|
724
|
+
`+(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=A=>{o||(o=!0,n(A,a))},h=A=>{o||(o=!0,r(A,a))},C=i.length,m=[];if(!C)return h([]);let v={value:a,originalValue:s,path:l,options:u,schema:this};for(let A=0;A<i.length;A++){const p=i[A];p(v,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)=>{K0.isError(l)&&(l.value=u),s(l)},(l,u)=>{l.length?s(new K0(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 K0.isError(s)&&(s.value=l),s},(s,l)=>{if(s.length)throw new K0(s,t,void 0,void 0,a);i=l}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(K0.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(K0.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):S3(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=v3({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=v3({message:n,name:"optionality",test(o){return o===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=xi.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=xi.notNull){return this.nullability(!1,t)}required(t=xi.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=xi.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),o=v3(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=qP(t).map(i=>new Fs(i));return o.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof n=="function"?new N7(o,n):N7.fromOptions(o,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=v3({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=xi.oneOf){let r=this.clone();return t.forEach(o=>{r._whitelist.add(o),r._blacklist.delete(o)}),r.internalTests.whiteList=v3({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=xi.notOneOf){let r=this.clone();return t.forEach(o=>{r._blacklist.add(o),r._whitelist.delete(o)}),r.internalTests.blacklist=v3({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?nT(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 K0)return{issues:oT(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}=zIe(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 iT(){return new aT}class aT 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=Zg.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(n){return Do(n)||n===!0}})}isFalse(t=Zg.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(n){return Do(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)}}iT.prototype=aT.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 WIe(e){const t=$g(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 $g(e){var t,n;const r=UIe.exec(e);return r?{year:la(r[1]),month:la(r[2],1)-1,day:la(r[3],1),hour:la(r[4]),minute:la(r[5]),second:la(r[6]),millisecond:r[7]?la(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:la(r[10]),minuteOffset:la(r[11])}:null}function la(e,t=0){return Number(e)||t}let KIe=/^[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])?)*$/,QIe=/^((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,GIe=/^(?:[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,YIe="^\\d{4}-\\d{2}-\\d{2}",XIe="\\d{2}:\\d{2}:\\d{2}",qIe="(([+-]\\d{2}(:?\\d{2})?)|Z)",JIe=new RegExp(`${YIe}T${XIe}(\\.\\d+)?${qIe}$`),ePe=e=>Do(e)||e===e.trim(),tPe={}.toString();function T8(){return new sT}class sT 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===tPe?t:o})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||xi.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(KIe,{name:"email",message:t,excludeEmptyString:!0})}url(t=d2.url){return this.matches(QIe,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=d2.uuid){return this.matches(GIe,{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(JIe,{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=$g(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=$g(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:ePe})}lowercase(t=d2.lowercase){return this.transform(n=>Do(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Do(n)||n===n.toLowerCase()})}uppercase(t=d2.uppercase){return this.transform(n=>Do(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Do(n)||n===n.toUpperCase()})}}T8.prototype=sT.prototype;let nPe=e=>e!=+e;function lT(){return new cT}class cT extends F2{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!nPe(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=e9.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=e9.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=e9.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=e9.moreThan){return this.test({message:n,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(r){return r>this.resolve(t)}})}positive(t=e9.positive){return this.moreThan(0,t)}negative(t=e9.negative){return this.lessThan(0,t)}integer(t=e9.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(t=>Do(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=>Do(o)?o:Math[t](o))}}lT.prototype=cT.prototype;let rPe=new Date(""),oPe=e=>Object.prototype.toString.call(e)==="[object Date]";class lv extends F2{constructor(){super({type:"date",check(t){return oPe(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=WIe(t),isNaN(t)?lv.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(Fs.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=zg.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=zg.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)}})}}lv.INVALID_DATE=rPe;function iPe(e,t=[]){let n=[],r=new Set,o=new Set(t.map(([a,s])=>`${a}-${s}`));function i(a,s){let l=Cs.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),Fs.isRef(s)&&s.isSibling?i(s.path,a):dd(s)&&"deps"in s&&s.deps.forEach(l=>i(l,a))}return RIe.array(Array.from(r),n).reverse()}function oM(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 uT(e){return(t,n)=>oM(e,t)-oM(e,n)}const dT=(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 N8(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=N8(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=N8(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(N8)}):"optional"in e?e.optional():e}const aPe=(e,t)=>{const n=[...Cs.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),o=Cs.getter(Cs.join(n),!0)(e);return!!(o&&r in o)};let iM=e=>Object.prototype.toString.call(e)==="[object Object]";function aM(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const sPe=uT([]);function fT(e){return new hT(e)}class hT extends F2{constructor(t){super({type:"object",check(n){return iM(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=sPe,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 v,A=o[h];u.path=(n.path?`${n.path}.`:"")+h,C=C.resolve({value:A,context:n.context,parent:l});let p=C instanceof F2?C.spec:void 0,y=p==null?void 0:p.strict;if(p!=null&&p.strip){d=d||h in o;continue}v=!n.__validating||!y?C.cast(o[h],u):o[h],v!==void 0&&(l[h]=v)}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||!iM(u)){o(l,u);return}a=a||u;let d=[];for(let h of this._nodes){let C=this.fields[h];!C||Fs.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=iPe(t,n),r._sortErrors=uT(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 N8(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=Cs.getter(t,!0);return this.transform(i=>{if(!i)return i;let a=i;return aPe(i,t)&&(a=Object.assign({},i),r||delete a[t],a[n]=o(i)),a})}json(){return this.transform(dT)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||I8.exact,test(n){if(n==null)return!0;const r=aM(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=I8.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=aM(this.schema,o);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=I8.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(Nh.camelCase)}snakeCase(){return this.transformKeys(Nh.snakeCase)}constantCase(){return this.transformKeys(t=>Nh.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}}fT.prototype=hT.prototype;function CT(e){return new gT(e)}class gT 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(dT)}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(!dd(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+Ea(t));return n.innerType=t,n.spec=Object.assign({},n.spec,{types:t}),n}length(t,n=P8.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||P8.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||P8.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}}CT.prototype=gT.prototype;const lPe=e=>{const t={},n=(r,o="")=>{if("inputType"in r){const i=cPe(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)}),fT().shape(t)},cPe=e=>{let t;switch(e.inputType){case"text":t=T8();break;case"slider":case"range-slider":t=lT();break;case"select":t=T8();break;case"multiselect":t=CT().of(T8());break;case"checkbox":t=iT();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},sM=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},uPe=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},dPe=({name:e,control:t,field:n,className:r="",edit:o=!1,onDeleteClick:i})=>{const a=(s,l)=>{const u={width:n.width||"100%",disabled:!1};switch(n.inputType){case"text":return V.jsx(x9,{...u,placeholder:n.placeholder,value:s||"",onChange:d=>l(d.target.value)});case"select":return V.jsx(xs,{...u,placeholder:n.placeholder||"Select an option",value:s,onChange:l,options:n.options||[]});case"multiselect":return V.jsx(sv,{...u,placeholder:n.placeholder||"Select options",value:s||[],onChange:l,options:n.options||[]});case"checkbox":return V.jsx(Iu,{value:s||!1,onChange:l});case"slider":return V.jsx("div",{className:"slider-container",children:V.jsx(tg,{min:n.min||0,max:n.max||100,step:n.step||1,value:s||n.min||0,onChange:l})});case"range-slider":return V.jsx("div",{className:"range-slider-container",children:V.jsx(tg,{range:!0,min:n.min||0,max:n.max||100,step:n.step||1,value:Array.isArray(s)?s:[n.min||0,n.max||100],onChange:l})});default:return V.jsxs("div",{className:"unsupported-field",children:["Unsupported field type: ",n.inputType]})}};return V.jsxs("div",{className:`form-field ${r}`,children:[V.jsxs("div",{className:"form-field-header",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:"•"})]}):V.jsxs("div",{className:"form-field-label",children:[n.label,": [",Array.isArray(n.value)?n.value[0]:n.min||0,","," ",Array.isArray(n.value)?n.value[1]:n.max||100,"]"]}):V.jsx(V.Fragment,{}),o&&V.jsx(Er,{icon:"deleteIcon",size:"s",variant:"secondary",onClick:s=>{s.preventDefault(),i==null||i(e)},className:"form-field-delete-button"})]}),n.description&&V.jsx("p",{className:"form-field-description",children:n.description}),V.jsx(b3,{name:e,control:t,defaultValue:n.defaultValue||n.defaultValues,render:({field:s})=>V.jsx("div",{className:"form-field-input",children:a(s.value,s.onChange)})})]})},mT=({name:e,config:t,control:n,level:r,className:o="",edit:i=!1,onAddClick:a,onDeleteClick:s})=>{const[l,u]=k.useState(!0),d="inputType"in t,h=()=>i?V.jsxs("div",{className:"form-section-edit-buttons",children:[V.jsx(Er,{icon:"plus",size:"s",variant:"secondary",onClick:p=>{p.preventDefault(),a==null||a(e)},className:"edit-add-button"}),V.jsx(Er,{icon:"deleteIcon",size:"s",variant:"secondary",onClick:p=>{p.preventDefault(),s==null||s(e)},className:"edit-delete-button"})]}):null;if(d)return V.jsx(dPe,{name:e,control:n,field:t,className:o,edit:i,onDeleteClick:s});const C=t,m=r>0,v=Object.keys(C).filter(p=>p!=="label"&&p!=="description").length>1,A=()=>V.jsx("div",{className:"form-section-content",children:Object.entries(C).map(([p,y])=>p==="label"||p==="description"?null:V.jsx(mT,{name:`${e}.${p}`,config:y,control:n,level:r+1,className:"form-section-child",edit:i,onAddClick:a,onDeleteClick:s},p))});return m&&v?V.jsxs("div",{className:`form-section accordion ${o}`,children:[V.jsxs("div",{className:"form-section-header-wrapper",children:[V.jsxs("div",{className:"form-section-header accordion-header",onClick:()=>u(!l),children:[V.jsxs("div",{className:"accordion-title",children:[C.label&&V.jsx("h3",{className:"form-section-title",children:C.label}),C.description&&V.jsx("p",{className:"form-section-description",children:C.description})]}),V.jsx("div",{className:`accordion-icon ${l?"expanded":"collapsed"}`,children:"▼"})]}),h()]}),l&&A()]}):V.jsxs("div",{className:`form-section simple ${o}`,children:[C.label&&V.jsxs("div",{className:"form-section-header-wrapper",children:[V.jsxs("div",{className:"form-section-header simple-header",children:[V.jsx("h3",{className:"form-section-title",children:C.label}),C.description&&V.jsx("p",{className:"form-section-description",children:C.description})]}),h()]}),A()]})},fPe=({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="",edit:h=!1,onAddClick:C,onDeleteClick:m})=>{const v=lPe(e),{control:A,handleSubmit:p,reset:y,formState:{errors:x,isSubmitting:E}}=GP({resolver:HIe(v),defaultValues:sM(u)}),S=H=>{const R=uPe(H);r==null||r(R)},_=()=>{y(sM(u))},M=()=>Object.entries(e).map(([H,R])=>V.jsx(mT,{name:H,config:R,control:A,level:0,className:"form-section-root",edit:h,onAddClick:C,onDeleteClick:m},H));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",{className:"form-group-form",children:[V.jsx("div",{className:"form-group-content",children:M()}),(r||a)&&V.jsxs("div",{className:"form-group-actions",children:[a&&V.jsx(Er,{type:"button",content:s,onClick:_,...l}),r&&V.jsx(Er,{type:"submit",content:o,loading:E,...i,onClick:H=>{H.preventDefault(),p(S)}})]})]}),Object.keys(x).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(x,null,2)})]})]})},Ug=()=>{const e=k.useRef(!1),t=k.useRef(!1);return k.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=SAe;exports.AwiAnnotationHotkeys=Hg;exports.AwiAnnotationTools=E8;exports.AwiCanvasContainer=_8;exports.AwiCustomConfirmation=aI;exports.AwiEmptyState=RAe;exports.AwiHelperMethods=k2;exports.AwiInput=uD;exports.AwiLoadMoreButton=KAe;exports.AwiMessageScreen=S8;exports.AwiModal=Uu;exports.AwiModalBody=Wu;exports.AwiModalFooter=Qu;exports.AwiModalHeader=Ku;exports.AwiModalRow=p4;exports.AwiPagination=AI;exports.AwiSafeLocalStorage=ma;exports.AwiSamModal=dD;exports.AwiScrollableTableCellList=QAe;exports.AwiSlider=cD;exports.AwiTableBar=WAe;exports.AwiTableBody=vI;exports.AwiTableCell=A4;exports.AwiTableHeader=bR;exports.AwiTableHeaders=yR;exports.AwiTableInfinite=pI;exports.AwiTableRow=up;exports.AwiToastMessage=W1;exports.AwiUseKeyChecker=Ug;exports.Backdrop=oD;exports.Badge=GAe;exports.Button=Er;exports.ButtonGroup=YAe;exports.Chart=GEe;exports.CompactEventCard=gP;exports.ContactInput=wRe;exports.DEFAULT_THEME=zR;exports.DatePicker=xRe;exports.DateRangePicker=LRe;exports.DetectionCarousel=pP;exports.Dropdown=kRe;exports.EventPreview=BRe;exports.FloorMapView=cDe;exports.FormGroup=fPe;exports.Heatmap=IDe;exports.Icon=G0;exports.Input=x9;exports.LiveDot=PDe;exports.LoginPage=nIe;exports.MapView=lIe;exports.Menu=cIe;exports.Modal=dIe;exports.MonthPicker=fIe;exports.Multiselect=sv;exports.Pagination=hIe;exports.Popover=CIe;exports.Refresh=mIe;exports.Select=xs;exports.Sidebar=pIe;exports.Spinner=Fu;exports.Switch=YP;exports.Table=AIe;exports.ThemeProvider=qhe;exports.Toast=vR;exports.Topbar=bIe;exports.WeekPicker=_Ie;exports.showToast=g4;exports.usePagination=Xz;exports.usePointerState=eCe;exports.useResize=x8;exports.useTheme=Jhe;exports.useToast=tCe;
|