1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,77011,80821,52258,13872,88553,40631,93065,9025,75192,35937,30812,50502,68529,41096,71701,56513,3970,56843,14913,40399,11365,1292,27749,53420,63932,83332,75261,59703,1336,18530,61914,11229,71733,52062,64829,13685,45185,85390,91732,95068,77583,79703,82554,93021,62442,9496,58e3,12206,16677,17552,66184,79784,33697,77267,43136,25933,93325,65791,30719,25529,51076,39442,50718,33498,74344,59386,23923,57504,t=>{"use strict";let e,i,n,r,s={ADD:"add",REMOVE:"remove"};t.s(["default",0,s],80821);let o="propertychange",a={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};t.s(["default",0,a],52258);let l=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}};function h(t,e,i){let n,r;i=i||d;let s=0,o=t.length,a=!1;for(;s<o;)(r=+i(t[n=s+(o-s>>1)],e))<0?s=n+1:(o=n,a=!r);return a?s:~s}function d(t,e){return t>e?1:t<e?-1:0}function u(t,e){return t<e?1:t>e?-1:0}function c(t,e,i){if(t[0]<=e)return 0;let n=t.length;if(e<=t[n-1])return n-1;if("function"==typeof i){for(let r=1;r<n;++r){let n=t[r];if(n===e)return r;if(n<e){if(i(e,t[r-1],n)>0)return r-1;return r}}return n-1}if(i>0){for(let i=1;i<n;++i)if(t[i]<e)return i-1;return n-1}if(i<0){for(let i=1;i<n;++i)if(t[i]<=e)return i;return n-1}for(let i=1;i<n;++i){if(t[i]==e)return i;if(t[i]<e){if(t[i-1]-e<e-t[i])return i-1;return i}}return n-1}function g(t,e,i){for(;e<i;){let n=t[e];t[e]=t[i],t[i]=n,++e,--i}}function f(t,e){let i=Array.isArray(e)?e:[e],n=i.length;for(let e=0;e<n;e++)t[t.length]=i[e]}function _(t,e){let i=t.length;if(i!==e.length)return!1;for(let n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}function p(t,e,i){let n=e||d;return t.every(function(e,r){if(0===r)return!0;let s=n(t[r-1],e);return!(s>0||i&&0===s)})}function m(){return!0}function y(){return!1}function x(){}function v(t){let e,i,n;return function(){let r=Array.prototype.slice.call(arguments);return i&&this===n&&_(r,i)||(n=this,i=r,e=t.apply(this,arguments)),e}}function C(t){let e;try{e=t()}catch(t){return Promise.reject(t)}return e instanceof Promise?e:Promise.resolve(e)}function w(t){for(let e in t)delete t[e]}function E(t){let e;for(e in t)return!1;return!e}t.s(["default",0,l],13872),t.s(["ascending",()=>d,"binarySearch",()=>h,"descending",()=>u,"equals",()=>_,"extend",()=>f,"isSorted",()=>p,"linearFindNearest",()=>c,"reverseSubArray",()=>g],88553),t.s(["FALSE",()=>y,"TRUE",()=>m,"VOID",()=>x,"memoizeOne",()=>v,"toPromise",()=>C],40631),t.s(["clear",()=>w,"isEmpty",()=>E],93065);let S=class{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}};t.s(["default",0,S],9025);let R=class extends l{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;let i=this.listeners_||(this.listeners_={}),n=i[t]||(i[t]=[]);n.includes(e)||n.push(e)}dispatchEvent(t){let e,i="string"==typeof t,n=i?t:t.type,r=this.listeners_&&this.listeners_[n];if(!r)return;let s=i?new S(t):t;s.target||(s.target=this.eventTarget_||this);let o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});n in o||(o[n]=0,a[n]=0),++o[n];for(let t=0,i=r.length;t<i;++t)if(!1===(e="handleEvent"in r[t]?r[t].handleEvent(s):r[t].call(this,s))||s.propagationStopped){e=!1;break}if(0==--o[n]){let t=a[n];for(delete a[n];t--;)this.removeEventListener(n,x);delete o[n]}return e}disposeInternal(){this.listeners_&&w(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||void 0}hasListener(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)}removeEventListener(t,e){if(!this.listeners_)return;let i=this.listeners_[t];if(!i)return;let n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=x,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}};function I(t,e,i,n,r){if(r){let r=i;i=function(s){return t.removeEventListener(e,i),r.call(n??this,s)}}else n&&n!==t&&(i=i.bind(n));let s={target:t,type:e,listener:i};return t.addEventListener(e,i),s}function T(t,e,i,n){return I(t,e,i,n,!0)}function b(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),w(t))}t.s(["default",0,R],75192),t.s(["listen",()=>I,"listenOnce",()=>T,"unlistenByKey",()=>b],35937);class M extends R{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(a.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){let i=t.length,n=Array(i);for(let r=0;r<i;++r)n[r]=I(this,t[r],e);return n}return I(this,t,e)}onceInternal(t,e){let i;if(Array.isArray(t)){let n=t.length;i=Array(n);for(let r=0;r<n;++r)i[r]=T(this,t[r],e)}else i=T(this,t,e);return e.ol_key=i,i}unInternal(t,e){let i=e.ol_key;if(i){var n=i;if(Array.isArray(n))for(let t=0,e=n.length;t<e;++t)b(n[t]);else b(n)}else if(Array.isArray(t))for(let i=0,n=t.length;i<n;++i)this.removeEventListener(t[i],e);else this.removeEventListener(t,e)}}M.prototype.on,M.prototype.once,M.prototype.un;let P=M;function L(){throw Error("Unimplemented abstract method.")}let F=0;function A(t){return t.ol_uid||(t.ol_uid=String(++F))}t.s(["abstract",()=>L,"getUid",()=>A],30812);class D extends S{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}}let k=class extends P{constructor(t){super(),this.on,this.once,this.un,A(this),this.values_=null,void 0!==t&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}
1hasProperties(){return!!this.values_}notify(t,e){let i;i=`change:${t}`,this.hasListener(i)&&this.dispatchEvent(new D(i,t,e)),i=o,this.hasListener(i)&&this.dispatchEvent(new D(i,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,i){let n=this.values_||(this.values_={});if(i)n[t]=e;else{let i=n[t];n[t]=e,i!==e&&this.notify(t,i)}}setProperties(t,e){for(let i in t)this.set(i,t[i],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){let i=this.values_[t];delete this.values_[t],E(this.values_)&&(this.values_=null),e||this.notify(t,i)}}},O="length";class G extends S{constructor(t,e,i){super(t),this.element=e,this.index=i}}let z=class extends k{constructor(t,e){if(super(),this.on,this.once,this.un,e=e||{},this.unique_=!!e.unique,this.array_=t||[],this.unique_)for(let t=0,e=this.array_.length;t<e;++t)this.assertUnique_(this.array_[t],t);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(t){for(let e=0,i=t.length;e<i;++e)this.push(t[e]);return this}forEach(t){let e=this.array_;for(let i=0,n=e.length;i<n;++i)t(e[i],i,e)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get(O)}insertAt(t,e){if(t<0||t>this.getLength())throw Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new G(s.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);let e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){let e=this.array_;for(let i=0,n=e.length;i<n;++i)if(e[i]===t)return this.removeAt(i)}removeAt(t){if(t<0||t>=this.getLength())return;let e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new G(s.REMOVE,e,t)),e}setAt(t,e){if(t>=this.getLength())return void this.insertAt(t,e);if(t<0)throw Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);let i=this.array_[t];this.array_[t]=e,this.dispatchEvent(new G(s.REMOVE,i,t)),this.dispatchEvent(new G(s.ADD,e,t))}updateLength_(){this.set(O,this.array_.length)}assertUnique_(t,e){for(let i=0,n=this.array_.length;i<n;++i)if(this.array_[i]===t&&i!==e)throw Error("Duplicate item added to a unique collection")}};t.s(["default",0,z],50502);let N=class extends S{constructor(t,e,i){super(t),this.map=e,this.frameState=void 0!==i?i:null}},U=class extends N{constructor(t,e,i,n,r,s){super(t,e,r),this.originalEvent=i,this.pixel_=null,this.coordinate_=null,this.dragging=void 0!==n&&n,this.activePointers=s}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(t){this.pixel_=t}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(t){this.coordinate_=t}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}};t.s(["default",0,U],68529);let W={SINGLECLICK:"singleclick",CLICK:a.CLICK,DBLCLICK:a.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};t.s(["default",0,W],41096);let j="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"";j.includes("safari")&&!j.includes("chrom")&&(j.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(j));let B=j.includes("webkit")&&!j.includes("edge"),X=j.includes("macintosh"),V="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,K="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,Y="undefined"!=typeof Image&&Image.prototype.decode,Z="function"==typeof createImageBitmap,q=function(){let t=!1;try{let e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return t}(),H="pointerdown",$=class extends R{constructor(t,e){super(t),this.map_=t,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=void 0===e?1:e,this.down_=null;const i=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=i,this.pointerdownListenerKey_=I(i,H,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=I(i,"pointermove",this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(a.TOUCHMOVE,this.boundHandleTouchMove_,!!q&&{passive:!1})}emulateClick_(t){let e=new U(W.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new U(W.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;let e=new U(W.SINGLECLICK,this.map_,t);this.dispatchEvent(e)},250)}updateActivePointers_(t){let e=t.pointerId;if(t.type==W.POINTERUP||t.type==W.POINTERCANCEL){for(let i in delete this.trackedTouches_[e],this.trackedTouches_)if(this.trackedTouches_[i].target!==t.target){delete this.trackedTouches_[i];break}}else(t.type==W.POINTERDOWN||t.type==W.POINTERMOVE)&&(this.trackedTouches_[e]=t);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);let e=new U(W.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_.length&&(this.dragListenerKeys_.forEach(b),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return 0===t.button}handlePointerDown_(t){this.emulateClicks_=0===this.activePointers_.length,this.updateActivePointers_(t);let e=new U(W.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);
1if(this.dispatchEvent(e),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),0===this.dragListenerKeys_.length){let t=this.map_.getOwnerDocument();this.dragListenerKeys_.push(I(t,W.POINTERMOVE,this.handlePointerMove_,this),I(t,W.POINTERUP,this.handlePointerUp_,this),I(this.element_,W.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==t&&this.dragListenerKeys_.push(I(this.element_.getRootNode(),W.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;let e=new U(W.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;let e=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new U(W.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){let e=this.originalPointerMoveEvent_;(!e||e.defaultPrevented)&&("boolean"!=typeof t.cancelable||!0===t.cancelable)&&t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(b(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(a.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(b(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(b),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}},J="postrender",Q="loadstart",tt="loadend",te="layergroup",ti="size",tn="target",tr="view",ts={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function to(t,e){if(!t)throw Error(e)}t.s(["default",0,ts],71701),t.s(["assert",()=>to],56513);let ta=1/0,tl=class{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,w(this.queuedElements_)}dequeue(){let t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));let n=this.keyFunction_(i);return delete this.queuedElements_[n],i}enqueue(t){to(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");let e=this.priorityFunction_(t);return e!=ta&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)}getCount(){return this.elements_.length}getLeftChildIndex_(t){return 2*t+1}getRightChildIndex_(t){return 2*t+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return 0===this.elements_.length}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){let e=this.elements_,i=this.priorities_,n=e.length,r=e[t],s=i[t],o=t;for(;t<n>>1;){let r=this.getLeftChildIndex_(t),s=this.getRightChildIndex_(t),o=s<n&&i[s]<i[r]?s:r;e[t]=e[o],i[t]=i[o],t=o}e[t]=r,i[t]=s,this.siftDown_(o,t)}siftDown_(t,e){let i=this.elements_,n=this.priorities_,r=i[e],s=n[e];for(;e>t;){let t=this.getParentIndex_(e);if(n[t]>s)i[e]=i[t],n[e]=n[t],e=t;else break}i[e]=r,n[e]=s}reprioritize(){let t,e,i,n=this.priorityFunction_,r=this.elements_,s=this.priorities_,o=0,a=r.length;for(e=0;e<a;++e)(i=n(t=r[e]))==ta?delete this.queuedElements_[this.keyFunction_(t)]:(s[o]=i,r[o++]=t);r.length=o,s.length=o,this.heapify_()}},th=class extends tl{constructor(t,e){super(e=>t.apply(null,e),t=>t[0].getKey()),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=e,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(t){let e=super.enqueue(t);return e&&t[0].addEventListener(a.CHANGE,this.boundHandleTileChange_),e}getTilesLoading(){return this.tilesLoading_}handleTileChange(t){let e=t.target,i=e.getState();if(i===ts.LOADED||i===ts.ERROR||i===ts.EMPTY){i!==ts.ERROR&&e.removeEventListener(a.CHANGE,this.boundHandleTileChange_);let t=e.getKey();t in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[t],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(t,e){let i=0;for(;this.tilesLoading_<t&&i<e&&this.getCount()>0;){let t=this.dequeue()[0],e=t.getKey();t.getState()!==ts.IDLE||e in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[e]=!0,++this.tilesLoading_,++i,t.load())}}},td={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function tu(t,e,i){return Math.min(Math.max(t,e),i)}function tc(t,e,i,n,r,s){let o=r-i,a=s-n;if(0!==o||0!==a){let l=((t-i)*o+(e-n)*a)/(o*o+a*a);l>1?(i=r,n=s):l>0&&(i+=o*l,n+=a*l)}return tg(t,e,i,n)}function tg(t,e,i,n){let r=i-t,s=n-e;return r*r+s*s}function tf(t){let e=t.length;for(let i=0;i<e;i++){let n=i,r=Math.abs(t[i][i]);for(let s=i+1;s<e;s++){let e=Math.abs(t[s][i]);e>r&&(r=e,n=s)}if(0===r)return null;let s=t[n];t[n]=t[i],t[i]=s;for(let n=i+1;n<e;n++){let r=-t[n][i]/t[i][i];for(let s=i;s<e+1;s++)i==s?t[n][s]=0:t[n][s]+=r*t[i][s]}}let i=Array(e);for(let n=e-1;n>=0;n--){i[n]=t[n][e]/t[n][n];for(let r=n-1;r>=0;r--)t[r][e]-=t[r][n]*i[n]}return i}function t_(t){return 180*t/Math.PI}function tp(t){return t*Math.PI/180}function tm(t,e){let i=t%e;return i*e<0?i+e:i}function ty(t,e,i){return t+i*(e-t)}function tx(t,e){let i=Math.pow(10,e);return Math.round(t*i)/i}function tv(t,e){return Math.round(tx(t,e))}function tC(t,e){return Math.floor(tx(t,e))}function tw(t,e){return Math.ceil(tx(t,e))}function tE(t,e,i){if(t>=e&&t<i)return t;let n=i-e;return((t-e)%n+n)%n+e}function tS(t,e,i){return function(n,r,s,o,a){if(!n)return;if(!r&&!e)return n;let l=e?0:s[0]*r,h=e?0:s[1]*r,d=a?a[0]:0,u=a?a[1]:0,c=t[0]+l/2+d,g=t[2]-l/2+d,f=t[1]+h/2+u,_=t[3]-h/2+u;c>g&&(g=c=(g+c)/2),f>_&&(_=f=(_+f)/2);let p=tu(n[0],c,g),m=tu(n[1],f,_);if(o&&i&&r){let t=30*r;p+=-t*Math.log(1+Math.max(0,c-n[0])/t)+t*Math.log(1+Math.max(0,n[0]-g)/t),m+=-t*Math.log(1+Math.max(0,f-n[1])/t)+t*Math.log(1+Math.max(0,n[1]-_)/t)}return[p,m]}}function tR(t){return t}t.s(["ceil",()=>tw,"clamp",()=>tu,"floor",()=>tC,"lerp",()=>ty,"modulo",()=>tm,"round",()=>tv,"solveLinearSystem",()=>tf,"squaredDistance",()=>tg,"squaredSegmentDistance",()=>tc,"toDegrees",()=>t_,"toFixed",()=>tx,"toRadians",()=>tp,"wrap",()=>tE],3970);function tI(t){let e=tD();for(let i=0,n=t.length;i<n;++i)tW(e,t[i]);return e}function tT(t,e,i){return i?(i[0]=t[0]-e,i[1]=t[1]-e,i[2]=t[2]+e,i[3]=t[3]+e,i):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function tb(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function tM(t,e,i){let n,r;return(n=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*n+(r=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*r}function tP(t,e){return tF(t,e[0],e[1])}function tL(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function tF(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function tA(t,e){let i=t[0],n=t[1],r=t[2],s=t[3],o=e[0],a=e[1],l=0;return o<i?l|=16:o>r&&(l|=4),a<n?l|=8:a>s&&(l|=2),0===l&&(l=1),l}function tD(){return[1/0,1/0,-1/0,-1/0]}function tk(t,e,i,n,r){return r?(r[0]=t,r[1]=e,r[2]=i,r[3]=n,r):[t,e,i,n]}function tO(t){return tk(1/0,1/0,-1/0,-1/0,t)}function tG(t,e){let i=t[0],n=t[1];return tk(i,n,i,n,e)}function tz(t,e,i,n,r){return tj(tO(r),t,e,i,n)}function tN(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function tU(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function tW(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function tj(t,e,i,n,r){for(;i<n;i+=r){var s,o,a;s=t,o=e[i],a=e[i+1],s[0]=Math.min(s[0],o),s[1]=Math.min(s[1],a),s[2]=Math.max(s[2],o),s[3]=Math.max(s[3],a)}return t}function tB(t,e){let i;return!!((i=e(tV(t)))||(i=e(tK(t)))||(i=e(t0(t)))||(i=e(tQ(t))))&&i}function tX(t){let e=0;return t3(t)||(e=t1(t)*t$(t)),e}function tV(t){return[t[0],t[1]]}function tK(t){return[t[2],t[1]]}function tY(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function tZ(t,e){let i;if("bottom-left"===e)i=tV(t);else if("bottom-right"===e)i=tK(t);else if("top-left"===e)i=tQ(t);else if("top-right"===e)i=t0(t);else throw Error("Invalid corner");return i}function tq(t,e,i,n,r){let[s,o,a,l,h,d,u,c]=tH(t,e,i,n);return tk(Math.min(s,a,h,u),Math.min(o,l,d,c),Math.max(s,a,h,u),Math.max(o,l,d,c),r)}
1function tH(t,e,i,n){let r=e*n[0]/2,s=e*n[1]/2,o=Math.cos(i),a=Math.sin(i),l=r*o,h=r*a,d=s*o,u=s*a,c=t[0],g=t[1];return[c-l+u,g-h-d,c-l-u,g-h+d,c+l-u,g+h+d,c+l+u,g+h-d,c-l+u,g-h-d]}function t$(t){return t[3]-t[1]}function tJ(t,e,i){let n=i||tD();return t2(t,e)?(t[0]>e[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]<e[2]?n[2]=t[2]:n[2]=e[2],t[3]<e[3]?n[3]=t[3]:n[3]=e[3]):tO(n),n}function tQ(t){return[t[0],t[3]]}function t0(t){return[t[2],t[3]]}function t1(t){return t[2]-t[0]}function t2(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function t3(t){return t[2]<t[0]||t[3]<t[1]}function t5(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}function t6(t,e,i){let n=!1,r=tA(t,e),s=tA(t,i);if(1===r||1===s)n=!0;else{let o,a,l=t[0],h=t[1],d=t[2],u=t[3],c=e[0],g=e[1],f=i[0],_=i[1],p=(_-g)/(f-c);2&s&&!(2&r)&&(n=(o=f-(_-u)/p)>=l&&o<=d),n||!(4&s)||4&r||(n=(a=_-(f-d)*p)>=h&&a<=u),n||!(8&s)||8&r||(n=(o=f-(_-h)/p)>=l&&o<=d),n||!(16&s)||16&r||(n=(a=_-(f-l)*p)>=h&&a<=u)}return n}function t4(t,e,i,n){let r,s;if(t3(t))return tO(i);let o=[];if(n>1){let e=t[2]-t[0],i=t[3]-t[1];for(let r=0;r<n;++r)o.push(t[0]+e*r/n,t[1],t[2],t[1]+i*r/n,t[2]-e*r/n,t[3],t[0],t[3]-i*r/n)}else o=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(o,o,2);let a=[],l=[];for(let t=0,e=o.length;t<e;t+=2)a.push(o[t]),l.push(o[t+1]);return r=Math.min.apply(null,a),s=Math.min.apply(null,l),tk(r,s,Math.max.apply(null,a),Math.max.apply(null,l),i)}function t8(t,e){let i=e.getExtent(),n=tY(t);if(e.canWrapX()&&(n[0]<i[0]||n[0]>=i[2])){let e=t1(i),r=Math.floor((n[0]-i[0])/e)*e;t[0]-=r,t[2]-=r}return t}function t9(t,e,i){if(e.canWrapX()){let n=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[n[0],t[1],n[2],t[3]]];t8(t,e);let r=t1(n);if(t1(t)>r&&!i)return[[n[0],t[1],n[2],t[3]]];if(t[0]<n[0])return[[t[0]+r,t[1],n[2],t[3]],[n[0],t[1],t[2],t[3]]];if(t[2]>n[2])return[[t[0],t[1],n[2],t[3]],[n[0],t[1],t[2]-r,t[3]]]}return[t]}function t7(t,e,i){let n=void 0!==i?t.toFixed(i):""+t,r=n.indexOf(".");return(r=-1===r?n.length:r)>e?n:Array(1+e-r).join("0")+n}function et(t,e){let i=(""+t).split("."),n=(""+e).split(".");for(let t=0;t<Math.max(i.length,n.length);t++){let e=parseInt(i[t]||"0",10),r=parseInt(n[t]||"0",10);if(e>r)return 1;if(r>e)return -1}return 0}function ee(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function ei(t,e){let i=e.getRadius(),n=e.getCenter(),r=n[0],s=n[1],o=t[0],a=t[1],l=o-r,h=a-s;0===l&&0===h&&(l=1);let d=Math.sqrt(l*l+h*h);return[r+i*l/d,s+i*h/d]}function en(t,e){let i,n,r=t[0],s=t[1],o=e[0],a=e[1],l=o[0],h=o[1],d=a[0],u=a[1],c=d-l,g=u-h,f=0===c&&0===g?0:(c*(r-l)+g*(s-h))/(c*c+g*g||0);
1return f<=0?(i=l,n=h):f>=1?(i=d,n=u):(i=l+f*c,n=h+f*g),[i,n]}function er(t,e){let i=!0;for(let n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function es(t,e){let i=Math.cos(e),n=Math.sin(e),r=t[0]*i-t[1]*n,s=t[1]*i+t[0]*n;return t[0]=r,t[1]=s,t}function eo(t,e){return t[0]*=e,t[1]*=e,t}function ea(t,e){let i=t[0]-e[0],n=t[1]-e[1];return i*i+n*n}function el(t,e){return Math.sqrt(ea(t,e))}function eh(t,e){return ea(t,en(t,e))}function ed(t,e){if(e.canWrapX()){let i=t1(e.getExtent()),n=eu(t,e,i);n&&(t[0]-=n*i)}return t}function eu(t,e,i){let n=e.getExtent(),r=0;return e.canWrapX()&&(t[0]<n[0]||t[0]>n[2])&&(i=i||t1(n),r=Math.floor((t[0]-n[0])/i)),r}function ec(t){return Math.pow(t,3)}function eg(t){return 1-ec(1-t)}function ef(t){return 3*t*t-2*t*t*t}function e_(t){return t}function ep(t,e,i){i=i||6371008.8;let n=tp(t[1]),r=tp(e[1]),s=(r-n)/2,o=tp(e[0]-t[0])/2,a=Math.sin(s)*Math.sin(s)+Math.sin(o)*Math.sin(o)*Math.cos(n)*Math.cos(r);return 2*i*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function em(t,e,i,n){n=n||6371008.8;let r=tp(t[1]),s=tp(t[0]),o=e/n,a=Math.asin(Math.sin(r)*Math.cos(o)+Math.cos(r)*Math.sin(o)*Math.cos(i));return[t_(s+Math.atan2(Math.sin(i)*Math.sin(o)*Math.cos(r),Math.cos(o)-Math.sin(r)*Math.sin(a))),t_(a)]}t.s(["applyTransform",()=>t4,"boundingExtent",()=>tI,"buffer",()=>tT,"clone",()=>tb,"closestSquaredDistanceXY",()=>tM,"containsCoordinate",()=>tP,"containsExtent",()=>tL,"containsXY",()=>tF,"coordinateRelationship",()=>tA,"createEmpty",()=>tD,"createOrUpdate",()=>tk,"createOrUpdateEmpty",()=>tO,"createOrUpdateFromCoordinate",()=>tG,"createOrUpdateFromFlatCoordinates",()=>tz,"equals",()=>tN,"extend",()=>tU,"extendCoordinate",()=>tW,"extendFlatCoordinates",()=>tj,"forEachCorner",()=>tB,"getArea",()=>tX,"getBottomLeft",()=>tV,"getBottomRight",()=>tK,"getCenter",()=>tY,"getCorner",()=>tZ,"getForViewAndSize",()=>tq,"getHeight",()=>t$,"getIntersection",()=>tJ,"getRotatedViewport",()=>tH,"getTopLeft",()=>tQ,"getTopRight",()=>t0,"getWidth",()=>t1,"intersects",()=>t2,"intersectsSegment",()=>t6,"isEmpty",()=>t3,"returnOrUpdate",()=>t5,"wrapAndSliceX",()=>t9,"wrapX",()=>t8],56843),t.s(["compareVersions",()=>et,"padNumber",()=>t7],14913),t.s(["add",()=>ee,"closestOnCircle",()=>ei,"closestOnSegment",()=>en,"distance",()=>el,"equals",()=>er,"getWorldsAway",()=>eu,"rotate",()=>es,"scale",()=>eo,"squaredDistance",()=>ea,"squaredDistanceToSegment",()=>eh,"wrapX",()=>ed],40399),t.s(["easeIn",()=>ec,"easeOut",()=>eg,"inAndOut",()=>ef,"linear",()=>e_],11365),t.s(["getDistance",()=>ep,"offset",()=>em],1292);function ey(...t){console.warn(...t)}let ex={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};t.s(["METERS_PER_UNIT",0,ex],27749);let ev=class{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||ex[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}},eC=6378137*Math.PI,ew=[-eC,-eC,eC,eC],eE=[-180,-85,180,85],eS=6378137*Math.log(Math.tan(Math.PI/2));class eR extends ev{constructor(t){super({code:t,units:"m",extent:ew,global:!0,worldExtent:eE,getPointResolution:function(t,e){return t/Math.cosh(e[1]/6378137)}})}}let eI=[new eR("EPSG:3857"),new eR("EPSG:102100"),new eR("EPSG:102113"),new eR("EPSG:900913"),new eR("http://www.opengis.net/def/crs/EPSG/0/3857"),new eR("http://www.opengis.net/gml/srs/epsg.xml#3857")],eT=[-180,-90,180,90],eb=6378137*Math.PI/180;class eM extends ev{constructor(t,e){super({code:t,units:"degrees",extent:eT,axisOrientation:e,global:!0,metersPerUnit:eb,worldExtent:eT})}}let eP=[new eM("CRS:84"),new eM("EPSG:4326","neu"),new eM("urn:ogc:def:crs:OGC:1.3:CRS84"),new eM("urn:ogc:def:crs:OGC:2:84"),new eM("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new eM("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new eM("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],eL={},eF={};function eA(t,e,i){let n=t.getCode(),r=e.getCode();n in eF||(eF[n]={}),eF[n][r]=i}function eD(t,e){return t in eF&&e in eF[t]?eF[t][e]:null}let ek=.00669438/.99330562,eO=Math.sqrt(.99330562),eG=(1-eO)/(1+eO),ez=eG*eG,eN=ez*eG,eU=eN*eG,eW=eU*eG,ej=1-.001673595-1344441707532e-16/64-15000339463446782e-22/256,eB=.02008314/8+1344441707532e-16/32+13500305517102105e-21/1024,eX=672220853766e-15/256+13500305517102105e-21/1024,eV=10500237624412747e-21/3072,eK=1.5*eG-27/32*eN+269/512*eW,eY=21/16*ez-55/32*eU,eZ=151/96*eN-417/128*eW,eq=1097/512*eU;function eH(t,e,i){let n=(i.north?e:e-1e7)/.9996/(6378137*ej),r=n+eK*Math.sin(2*n)+eY*Math.sin(4*n)+eZ*Math.sin(6*n)+eq*Math.sin(8*n),s=Math.sin(r),o=s*s,a=Math.cos(r),l=s/a,h=l*l,d=h*h,u=ek*a**2,c=u*u,g=(t-5e5)/(6378137/Math.sqrt(1-.00669438*o)*.9996),f=g*g,_=f*g,p=_*g,m=p*g,y=r-l/(.99330562/(1-.00669438*o))*(f/2-p/24*(5+3*h+10*u-4*c-9*ek))+m*g/720*(61+90*h+298*u+45*d-252*ek-3*c),x=(g-_/6*(1+2*h+u)+m/120*(5-2*u+28*h-3*c+8*ek+24*d))/a;return[t_(x=tE(x+tp(eJ(i.number)),-Math.PI,Math.PI)),t_(y)]}function e$(t,e,i){t=tE(t,-180,180),e<-80?e=-80:e>84&&(e=84);let n=tp(e),r=Math.sin(n),s=Math.cos(n),o=r/s,a=o*o,l=a*a,h=tp(t),d=tp(eJ(i.number)),u=6378137/Math.sqrt(1-.00669438*r**2),c=ek*s**2,g=s*tE(h-d,-Math.PI,Math.PI),f=g*g,_=f*g,p=_*g,m=p*g,y=.9996*u*(g+_/6*(1-a+c)+m/120*(5-18*a+l+72*c-58*ek))+5e5,x=.9996*(6378137*(ej*n-eB*Math.sin(2*n)+eX*Math.sin(4*n)-eV*Math.sin(6*n))+u*o*(f/2+p/24*(5-a+9*c+4*c**2)+m*g/720*(61-58*a+l+600*c-330*ek)));return i.north||(x+=1e7),[y,x]}function eJ(t){return(t-1)*6-180+3}let eQ=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function e0(t){let e=0;for(let i of eQ){let n=t.match(i);if(n){e=parseInt(n[1]);break}}if(!e)return null;let i=0,n=!1;return(e>32700&&e<32761?i=e-32700:e>32600&&e<32661&&(n=!0,i=e-32600),i)?{number:i,north:n}:null}function e1(t,e){return function(i,n,r,s){let o=i.length;r=r>1?r:2,s=s??r,n||(n=r>2?i.slice():Array(o));for(let r=0;r<o;r+=s){let s=t(i[r],i[r+1],e);n[r]=s[0],n[r+1]=s[1]}return n}}let e2=[function(t){let e=e0(t.getCode());return e?{forward:e1(e$,e),inverse:e1(eH,e)}:null}],e3=[function(t){return e0(t)?new ev({code:t,units:"m"}):null}],e5=!0;function e6(t){e5=!(void 0===t||t)}function e4(t,e){if(void 0!==e)for(let i=0,n=t.length;i<n;++i)e[i]=t[i];else e=t.slice();return e}function e8(t){var e;e=t.getCode(),eL[e]=t,eA(t,t,e4)}function e9(t){if("string"!=typeof t)return t;let e=eL[t]||eL[t.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null;if(e)return e;for(let e of e3){let i=e(t);if(i)return i}return null}function e7(t,e,i,n){let r,s=(t=e9(t)).getPointResolutionFunc();if(s){if(r=s(e,i),n&&n!==t.getUnits()){let e=t.getMetersPerUnit();e&&(r=r*e/ex[n])}}else{let s=t.getUnits();if(("degrees"!=s||n)&&"degrees"!=n){let o=ia(t,e9("EPSG:4326"));if(o||"degrees"===s){let t=[i[0]-e/2,i[1],i[0]+e/2,i[1],i[0],i[1]-e/2,i[0],i[1]+e/2];r=(ep((t=o(t,t,2)).slice(0,2),t.slice(2,4))+ep(t.slice(4,6),t.slice(6,8)))/2}else r=e*t.getMetersPerUnit();let a=n?ex[n]:t.getMetersPerUnit();void 0!==a&&(r/=a)}else r=e}return r}function it(t){t.forEach(e8),t.forEach(function(e){t.forEach(function(t){e!==t&&eA(e,t,e4)})})}function ie(t,e){return t?"string"==typeof t?e9(t):t:e9(e)}function ii(t){return function(e,i,n,r){let s=e.length;n=void 0!==n?n:2,r=r??n,i=void 0!==i?i:Array(s);for(let o=0;o<s;o+=r){let s=t(e.slice(o,o+n)),a=s.length;for(let t=0,n=r;t<n;++t)i[o+t]=t>=a?e[o+t]:s[t]}return i}}function ir(t,e){return e6(),id(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function is(t,e){let i=id(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),n=i[0];return(n<-180||n>180)&&(i[0]=tm(n+180,360)-180),i}function io(t,e){if(t===e)return!0;let i=t.getUnits()===e.getUnits();return t.getCode()===e.getCode()?i:ia(t,e)===e4&&i}function ia(t,e){let i=t.getCode(),n=e.getCode(),r=eD(i,n);if(r)return r;let s=null,o=null;for(let i of e2)s||(s=i(t)),o||(o=i(e));if(!s&&!o)return null;let a="EPSG:4326";if(o)if(s)r=il(s.inverse,o.forward);else{let t=eD(i,a);t&&(r=il(t,o.forward))}else{let t=eD(a,n);t&&(r=il(s.inverse,t))}return r&&(e8(t),e8(e),eA(t,e,r)),r}function il(t,e){return function(i,n,r,s){return e(n=t(i,n,r,s),n,r,s)}}function ih(t,e){return ia(e9(t),e9(e))}function id(t,e,i){let n=ih(e,i);if(!n){let t=e9(e).getCode(),n=e9(i).getCode();throw Error(`No transform available between ${t} and ${n}`)}return n(t,void 0,t.length)}function iu(){return null}function ic(t,e){return t}function ig(t,e){return e5&&!er(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(e5=!1,ey("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function i_(t,e){return t}function ip(t,e){return t}function im(t,e){return t}function iy(t,e){return t}function ix(){return[1,0,0,1,0,0]}function iv(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function iC(t,e){let i=e[0],n=e[1];return e[0]=t[0]*i+t[2]*n+t[4],e[1]=t[1]*i+t[3]*n+t[5],e}
1function iw(t,e,i,n,r,s,o,a){let l=Math.sin(s),h=Math.cos(s);return t[0]=n*h,t[1]=r*l,t[2]=-n*l,t[3]=r*h,t[4]=o*n*h-a*n*l+e,t[5]=o*r*l+a*r*h+i,t}function iE(t,e){var i;let n=(i=e)[0]*i[3]-i[1]*i[2];to(0!==n,"Transformation matrix cannot be inverted");let r=e[0],s=e[1],o=e[2],a=e[3],l=e[4],h=e[5];return t[0]=a/n,t[1]=-s/n,t[2]=-o/n,t[3]=r/n,t[4]=(o*h-a*l)/n,t[5]=-(r*h-s*l)/n,t}it(eI),it(eP),a7=function(t,e,i,n){let r=t.length;i=i>1?i:2,n=n??i,void 0===e&&(e=i>2?t.slice():Array(r));for(let i=0;i<r;i+=n){e[i]=eC*t[i]/180;let n=6378137*Math.log(Math.tan(Math.PI*(+t[i+1]+90)/360));n>eS?n=eS:n<-eS&&(n=-eS),e[i+1]=n}return e},lt=function(t,e,i,n){let r=t.length;i=i>1?i:2,n=n??i,void 0===e&&(e=i>2?t.slice():Array(r));for(let i=0;i<r;i+=n)e[i]=180*t[i]/eC,e[i+1]=360*Math.atan(Math.exp(t[i+1]/6378137))/Math.PI-90;return e},eP.forEach(function(t){eI.forEach(function(e){eA(t,e,a7),eA(e,t,lt)})}),t.s(["createProjection",()=>ie,"createTransformFromCoordinateTransform",()=>ii,"disableCoordinateWarning",()=>e6,"equivalent",()=>io,"fromLonLat",()=>ir,"fromUserCoordinate",()=>ig,"fromUserExtent",()=>ip,"fromUserResolution",()=>iy,"get",()=>e9,"getPointResolution",()=>e7,"getTransform",()=>ih,"getTransformFromProjections",()=>ia,"getUserProjection",()=>iu,"toLonLat",()=>is,"toUserCoordinate",()=>ic,"toUserExtent",()=>i_,"toUserResolution",()=>im,"transform",()=>id],53420);let iS=[1e5,1e5,1e5,1e5,2,2];function iR(t){return"matrix("+t.join(", ")+")"}function iI(t){return t.substring(7,t.length-1).split(",").map(parseFloat)}function iT(t,e){let i=iI(t),n=iI(e);for(let t=0;t<6;++t)if(0!==Math.round((i[t]-n[t])*iS[t]))return!1;return!0}function ib(t,e,i,n,r,s,o){s=s||[],o=o||2;let a=0;for(let l=e;l<i;l+=n){let e=t[l],i=t[l+1];s[a++]=r[0]*e+r[2]*i+r[4],s[a++]=r[1]*e+r[3]*i+r[5];for(let e=2;e<o;e++)s[a++]=t[l+e]}return s&&s.length!=a&&(s.length=a),s}function iM(t,e,i,n,r,s,o){o=o||[];let a=Math.cos(r),l=Math.sin(r),h=s[0],d=s[1],u=0;for(let r=e;r<i;r+=n){let e=t[r]-h,i=t[r+1]-d;o[u++]=h+e*a-i*l,o[u++]=d+e*l+i*a;for(let e=r+2;e<r+n;++e)o[u++]=t[e]}return o&&o.length!=u&&(o.length=u),o}function iP(t,e,i,n,r,s,o,a){a=a||[];let l=o[0],h=o[1],d=0;for(let o=e;o<i;o+=n){let e=t[o]-l,i=t[o+1]-h;a[d++]=l+r*e,a[d++]=h+s*i;for(let e=o+2;e<o+n;++e)a[d++]=t[e]}return a&&a.length!=d&&(a.length=d),a}function iL(t,e,i,n,r,s,o){o=o||[];let a=0;for(let l=e;l<i;l+=n){o[a++]=t[l]+r,o[a++]=t[l+1]+s;for(let e=l+2;e<l+n;++e)o[a++]=t[e]}return o&&o.length!=a&&(o.length=a),o}t.s(["apply",()=>iC,"compose",()=>iw,"create",()=>ix,"equivalent",()=>iT,"makeInverse",()=>iE,"setFromArray",()=>iv,"toString",()=>iR],63932),t.s(["rotate",()=>iM,"scale",()=>iP,"transform2D",()=>ib,"translate",()=>iL],83332);let iF=ix(),iA=[NaN,NaN],iD=class extends k{constructor(){super(),this.extent_=tD(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=v((t,e,i)=>{if(!i)return this.getSimplifiedGeometry(e);let n=this.clone();return n.applyTransform(i),n.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return L()}closestPointXY(t,e,i,n){return L()}containsXY(t,e){return 0===this.closestPointXY(t,e,iA,5e-324)}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return L()}getExtent(t){if(this.extentRevision_!=this.getRevision()){let t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&tO(t),this.extentRevision_=this.getRevision()}return t5(this.extent_,t)}rotate(t,e){L()}scale(t,e,i){L()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return L()}getType(){return L()}applyTransform(t){L()}intersectsExtent(t){return L()}translate(t,e){L()}transform(t,e){let i=e9(t),n="tile-pixels"==i.getUnits()?function(t,n,r){let s=i.getExtent(),o=i.getWorldExtent(),a=t$(o)/t$(s);iw(iF,o[0],o[3],a,-a,0,0,0);let l=ib(t,0,t.length,r,iF,n),h=ih(i,e);return h?h(l,l,r):l}:ih(i,e);return this.applyTransform(n),this}};function ik(t){let e;return"XY"==t?e=2:"XYZ"==t||"XYM"==t?e=3:"XYZM"==t&&(e=4),e}function iO(t,e,i){let n=t.getFlatCoordinates();if(!n)return null;let r=t.getStride();return ib(n,0,n.length,r,e,i)}t.s(["default",0,iD],75261);let iG=class extends iD{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return tz(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return L()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;let e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,e){this.stride=ik(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){L()}setLayout(t,e,i){let n;if(t)n=ik(t);else{var r;let s;for(let t=0;t<i;++t){if(0===e.length){this.layout="XY",this.stride=2;return}e=e[0]}2==(r=n=e.length)?s="XY":3==r?s="XYZ":4==r&&(s="XYZM"),t=s}this.layout=t,this.stride=n}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(t,e){let i=this.getFlatCoordinates();if(i){let n=this.getStride();iM(i,0,i.length,n,t,e,i),this.changed()}}scale(t,e,i){void 0===e&&(e=t),i||(i=tY(this.getExtent()));let n=this.getFlatCoordinates();if(n){let r=this.getStride();iP(n,0,n.length,r,t,e,i,n),this.changed()}}translate(t,e){let i=this.getFlatCoordinates();if(i){let n=this.getStride();iL(i,0,i.length,n,t,e,i),this.changed()}}};function iz(t,e,i,n){let r=0,s=t[i-n],o=t[i-n+1],a=0,l=0;for(;e<i;e+=n){let i=t[e]-s,n=t[e+1]-o;r+=l*i-a*n,a=i,l=n}return r/2}function iN(t,e,i,n){let r=0;for(let s=0,o=i.length;s<o;++s){let o=i[s];r+=iz(t,e,o,n),e=o}return r}function iU(t,e,i,n,r,s,o){let a,l=t[e],h=t[e+1],d=t[i]-l,u=t[i+1]-h;if(0===d&&0===u)a=e;else{let g=((r-l)*d+(s-h)*u)/(d*d+u*u);if(g>1)a=i;else if(g>0){for(let r=0;r<n;++r){var c;o[r]=(c=t[e+r],c+g*(t[i+r]-c))}o.length=n;return}else a=e}for(let e=0;e<n;++e)o[e]=t[a+e];o.length=n}function iW(t,e,i,n,r){let s=t[e],o=t[e+1];for(e+=n;e<i;e+=n){let i=t[e],n=t[e+1],a=tg(s,o,i,n);a>r&&(r=a),s=i,o=n}return r}
1function ij(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){let o=i[s];r=iW(t,e,o,n,r),e=o}return r}function iB(t,e,i,n,r,s,o,a,l,h,d){let u,c;if(e==i)return h;if(0===r){if((c=tg(o,a,t[e],t[e+1]))<h){for(u=0;u<n;++u)l[u]=t[e+u];return l.length=n,c}return h}d=d||[NaN,NaN];let g=e+n;for(;g<i;)if(iU(t,g-n,g,n,o,a,d),(c=tg(o,a,d[0],d[1]))<h){for(u=0,h=c;u<n;++u)l[u]=d[u];l.length=n,g+=n}else g+=n*Math.max((Math.sqrt(c)-Math.sqrt(h))/r|0,1);if(s&&(iU(t,i-n,e,n,o,a,d),(c=tg(o,a,d[0],d[1]))<h)){for(u=0,h=c;u<n;++u)l[u]=d[u];l.length=n}return h}function iX(t,e,i,n,r,s,o,a,l,h,d){d=d||[NaN,NaN];for(let u=0,c=i.length;u<c;++u){let c=i[u];h=iB(t,e,c,n,r,s,o,a,l,h,d),e=c}return h}function iV(t,e,i,n){for(let n=0,r=i.length;n<r;++n)t[e++]=i[n];return e}function iK(t,e,i,n){for(let r=0,s=i.length;r<s;++r){let s=i[r];for(let i=0;i<n;++i)t[e++]=s[i]}return e}function iY(t,e,i,n,r){r=r||[];let s=0;for(let o=0,a=i.length;o<a;++o){let a=iK(t,e,i[o],n);r[s++]=a,e=a}return r.length=s,r}function iZ(t,e,i,n,r){r=r||[];let s=0;for(let o=0,a=i.length;o<a;++o){let a=iY(t,e,i[o],n,r[s]);0===a.length&&(a[0]=e),r[s++]=a,e=a[a.length-1]}return r.length=s,r}function iq(t,e,i,n,r){r=void 0!==r?r:[];let s=0;for(let o=e;o<i;o+=n)r[s++]=t.slice(o,o+n);return r.length=s,r}function iH(t,e,i,n,r){r=void 0!==r?r:[];let s=0;for(let o=0,a=i.length;o<a;++o){let a=i[o];r[s++]=iq(t,e,a,n,r[s]),e=a}return r.length=s,r}function i$(t,e,i,n,r){r=void 0!==r?r:[];let s=0;for(let o=0,a=i.length;o<a;++o){let a=i[o];r[s++]=1===a.length&&a[0]===e?[]:iH(t,e,a,n,r[s]),e=a[a.length-1]}return r.length=s,r}function iJ(t,e,i,n,r,s,o){let a=(i-e)/n;if(a<3){for(;e<i;e+=n)s[o++]=t[e],s[o++]=t[e+1];return o}let l=Array(a);l[0]=1,l[a-1]=1;let h=[e,i-n],d=0;for(;h.length>0;){let i=h.pop(),s=h.pop(),o=0,a=t[s],u=t[s+1],c=t[i],g=t[i+1];for(let e=s+n;e<i;e+=n){let i=tc(t[e],t[e+1],a,u,c,g);i>o&&(d=e,o=i)}o>r&&(l[(d-e)/n]=1,s+n<d&&h.push(s,d),d+n<i&&h.push(d,i))}for(let i=0;i<a;++i)l[i]&&(s[o++]=t[e+i*n],s[o++]=t[e+i*n+1]);return o}function iQ(t,e,i,n,r,s,o,a){for(let l=0,h=i.length;l<h;++l){let h=i[l];o=iJ(t,e,h,n,r,s,o),a.push(o),e=h}return o}function i0(t,e){return e*Math.round(t/e)}function i1(t,e,i,n,r,s,o,a){for(let l=0,h=i.length;l<h;++l){let h=i[l];o=function(t,e,i,n,r,s,o){let a,l;if(e==i)return o;let h=i0(t[e],r),d=i0(t[e+1],r);e+=n,s[o++]=h,s[o++]=d;do if(a=i0(t[e],r),l=i0(t[e+1],r),(e+=n)==i)return s[o++]=a,s[o++]=l,o;while(a==h&&l==d)for(;e<i;){let i=i0(t[e],r),u=i0(t[e+1],r);if(e+=n,i==a&&u==l)continue;let c=a-h,g=l-d,f=i-h,_=u-d;if(c*_==g*f&&(c<0&&f<c||c==f||c>0&&f>c)&&(g<0&&_<g||g==_||g>0&&_>g)){a=i,l=u;continue}s[o++]=a,s[o++]=l,h=a,d=l,a=i,l=u}return s[o++]=a,s[o++]=l,o}(t,e,h,n,r,s,o),a.push(o),e=h}return o}t.s(["default",0,iG,"getStrideForLayout",()=>ik,"transformGeom2D",()=>iO],59703),t.s(["deflateCoordinate",()=>iV,"deflateCoordinates",()=>iK,"deflateCoordinatesArray",()=>iY,"deflateMultiCoordinatesArray",()=>iZ],1336);class i2 extends iG{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?this.setCoordinates(t,e):this.setFlatCoordinates(e,t)}clone(){return new i2(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,i,n){return n<tM(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(iW(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),iB(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,n))}getArea(){return iz(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return iq(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){let e=[];return e.length=iJ(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new i2(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=iK(this.flatCoordinates,0,t,this.stride),this.changed()}}class i3 extends iG{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){let t=new i3(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){let r=this.flatCoordinates,s=tg(t,e,r[0],r[1]);if(s<n){let t=this.stride;for(let e=0;e<t;++e)i[e]=r[e];return i.length=t,s}return n}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(t){return tG(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return tF(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=iV(this.flatCoordinates,0,t,this.stride),this.changed()}}function i5(t,e,i,n,r,s){let o=0,a=t[i-n],l=t[i-n+1];for(;e<i;e+=n){let i=t[e],n=t[e+1];l<=s?n>s&&(i-a)*(s-l)-(r-a)*(n-l)>0&&o++:n<=s&&(i-a)*(s-l)-(r-a)*(n-l)<0&&o--,a=i,l=n}return 0!==o}function i6(t,e,i,n,r,s){if(0===i.length||!i5(t,e,i[0],n,r,s))return!1;for(let e=1,o=i.length;e<o;++e)if(i5(t,i[e-1],i[e],n,r,s))return!1;return!0}function i4(t,e,i,n,r,s,o){let a,l,h,u,c,g,f,_=r[s+1],p=[];for(let r=0,s=i.length;r<s;++r){let s=i[r];for(u=t[s-n],g=t[s-n+1],a=e;a<s;
1a+=n)c=t[a],f=t[a+1],(_<=g&&f<=_||g<=_&&_<=f)&&(h=(_-g)/(f-g)*(c-u)+u,p.push(h)),u=c,g=f}let m=NaN,y=-1/0;for(p.sort(d),u=p[0],a=1,l=p.length;a<l;++a){let r=Math.abs((c=p[a])-u);r>y&&i6(t,e,i,n,h=(u+c)/2,_)&&(m=h,y=r),u=c}return(isNaN(m)&&(m=r[s]),o)?(o.push(m,_,y),o):[m,_,y]}function i8(t,e,i,n,r){let s=[];for(let o=0,a=i.length;o<a;++o){let a=i[o];s=i4(t,e,a,n,r,2*o,s),e=a[a.length-1]}return s}function i9(t,e,i,n,r){let s;for(e+=n;e<i;e+=n)if(s=r(t.slice(e-n,e),t.slice(e,e+n)))return s;return!1}function i7(t,e){let[i,n]=t,[r,s]=e,o=((i[0]-r[0])*(r[1]-s[1])-(i[1]-r[1])*(r[0]-s[0]))/((i[0]-n[0])*(r[1]-s[1])-(i[1]-n[1])*(r[0]-s[0])),a=((i[0]-r[0])*(i[1]-n[1])-(i[1]-r[1])*(i[0]-n[0]))/((i[0]-n[0])*(r[1]-s[1])-(i[1]-n[1])*(r[0]-s[0]));if(0<=o&&o<=1&&0<=a&&a<=1)return[i[0]+o*(n[0]-i[0]),i[1]+o*(n[1]-i[1])]}function nt(t,e,i,n,r,s){return!!t2(r,s=s??tj(tD(),t,e,i,n))&&(s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]||i9(t,e,i,n,function(t,e){return t6(r,t,e)}))}function ne(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){if(nt(t,e,i[s],n,r))return!0;e=i[s]}return!1}function ni(t,e,i,n,r){return!!(nt(t,e,i,n,r)||i5(t,e,i,n,r[0],r[1])||i5(t,e,i,n,r[0],r[3])||i5(t,e,i,n,r[2],r[1])||i5(t,e,i,n,r[2],r[3]))}function nn(t,e,i,n,r){if(!ni(t,e,i[0],n,r))return!1;if(1===i.length)return!0;for(let e=1,s=i.length;e<s;++e)if(function(t,e,i,n,r){return!tB(r,function(r){return!i5(t,e,i,n,r[0],r[1])})}(t,i[e-1],i[e],n,r)&&!nt(t,i[e-1],i[e],n,r))return!1;return!0}function nr(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){let o=i[s];if(nn(t,e,o,n,r))return!0;e=o[o.length-1]}return!1}function ns(t,e,i,n){let r=0,s=t[i-n],o=t[i-n+1];for(;e<i;e+=n){let i=t[e],n=t[e+1];r+=(i-s)*(n+o),s=i,o=n}return 0===r?void 0:r>0}function no(t,e,i,n,r){r=void 0!==r&&r;for(let s=0,o=i.length;s<o;++s){let o=i[s],a=ns(t,e,o,n);if(0===s){if(r&&a||!r&&!a)return!1}else if(r&&!a||!r&&a)return!1;e=o}return!0}function na(t,e,i,n,r){r=void 0!==r&&r;for(let s=0,o=i.length;s<o;++s){let o=i[s],a=ns(t,e,o,n);(0===s?r&&a||!r&&!a:r&&!a||!r&&a)&&function(t,e,i,n){for(;e<i-n;){for(let r=0;r<n;++r){let s=t[e+r];t[e+r]=t[i-n+r],t[i-n+r]=s}e+=n,i-=n}}(t,e,o,n),e=o}return e}function nl(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s)e=na(t,e,i[s],n,r);return e}t.s(["default",0,i3],18530),t.s(["forEach",()=>i9,"getIntersectionPoint",()=>i7],61914),t.s(["intersectsLineString",()=>nt,"intersectsLineStringArray",()=>ne,"intersectsLinearRing",()=>ni,"intersectsLinearRingArray",()=>nn,"intersectsLinearRingMultiArray",()=>nr],11229);class nh extends iG{constructor(t,e,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,void 0!==e&&i?(this.setFlatCoordinates(e,t),this.ends_=i):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?f(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){let t=new nh(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<tM(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ij(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),iX(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,n))}containsXY(t,e){return i6(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return iN(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return void 0!==t?na(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,iH(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){let t=tY(this.getExtent());this.flatInteriorPoint_=i4(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new i3(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new i2(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){let t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[],r=0;for(let s=0,o=i.length;s<o;++s){let o=i[s],a=new i2(e.slice(r,o),t);n.push(a),r=o}return n}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){let t=this.flatCoordinates;no(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=na(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){let e=[],i=[];return e.length=i1(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,i),new nh(e,"XY",i)}getType(){return"Polygon"}intersectsExtent(t){return nn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);let i=iY(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()}}
1function nd(t){if(t3(t))throw Error("Cannot create polygon from empty extent");let e=t[0],i=t[1],n=t[2],r=t[3],s=[e,i,e,r,n,r,n,i,e,i];return new nh(s,"XY",[s.length])}function nu(t,e,i){e=e||32;let n=t.getStride(),r=t.getLayout(),s=t.getCenter(),o=n*(e+1),a=Array(o);for(let t=0;t<o;t+=n){a[t]=0,a[t+1]=0;for(let e=2;e<n;e++)a[t+e]=s[e]}let l=[a.length],h=new nh(a,r,l);return nc(h,s,t.getRadius(),i),h}function nc(t,e,i,n){let r=t.getFlatCoordinates(),s=t.getStride(),o=r.length/s-1,a=n||0;for(let t=0;t<=o;++t){let n=t*s,l=a+2*tm(t,o)*Math.PI/o;r[n]=e[0]+i*Math.cos(l),r[n+1]=e[1]+i*Math.sin(l)}t.changed()}function ng(t,e,i,n){let r=t1(e)/i[0],s=t$(e)/i[1];return n?Math.min(t,Math.max(r,s)):Math.min(t,Math.min(r,s))}function nf(t,e,i){let n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(n=Math.max(n,i)/(Math.log(1+50*Math.max(0,i/t-1))/50+1)),tu(n,i/2,2*e)}function n_(t,e,i,n,r){return i=void 0===i||i,function(s,o,a,l){if(void 0!==s){let o=n?ng(t,n,a,r):t;return i&&l?nf(s,o,e):tu(s,e,o)}}}function np(t){if(void 0!==t)return 0}function nm(t){if(void 0!==t)return t}function ny(t,e){setTimeout(function(){t(e)},0)}function nx(t,e,i,n,r){let s=Math.cos(-r),o=Math.sin(-r),a=t[0]*s-t[1]*o,l=t[1]*s+t[0]*o;return a+=(e[0]/2-i[0])*n,[a*s-(l+=(i[1]-e[1]/2)*n)*(o=-o),l*s+a*o]}t.s(["default",0,nh,"fromCircle",()=>nu,"fromExtent",()=>nd,"makeRegular",()=>nc],71733),t.s(["DEFAULT_MAX_ZOOM",0,42,"DEFAULT_TILE_SIZE",0,256],52062);let nv=class extends k{constructor(t){var e,i;super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=ie(t.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,t.projection&&e6(),t.center&&(t.center=ig(t.center,this.projection_)),t.extent&&(t.extent=(e=t.extent,i=this.projection_,e)),this.applyOptions_(t)}applyOptions_(t){let e=Object.assign({},t);for(let t in td)delete e[t];this.setProperties(e,!0);let i=function(t){var e,i,n,r,s,o;let a,l,h,d=void 0!==t.minZoom?t.minZoom:0,u=void 0!==t.maxZoom?t.maxZoom:28,g=void 0!==t.zoomFactor?t.zoomFactor:2,f=void 0!==t.multiWorld&&t.multiWorld,_=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,p=void 0!==t.showFullExtent&&t.showFullExtent,m=ie(t.projection,"EPSG:3857"),y=m.getExtent(),x=t.constrainOnlyCenter,v=t.extent;if(!f&&!v&&m.isGlobal()&&(x=!1,v=y),void 0!==t.resolutions){let n=t.resolutions;(l=n[d],h=void 0!==n[u]?n[u]:n[n.length-1],t.constrainResolution)?(e=_,i=!x&&v,e=void 0===e||e,a=function(t,r,s,o){if(void 0!==t){let a=n[0],l=n[n.length-1],h=i?ng(a,i,s,p):a;if(o)return e?nf(t,h,l):tu(t,l,h);let d=Math.floor(c(n,Math.min(h,t),r));return n[d]>h&&d<n.length-1?n[d+1]:n[d]}}):a=n_(l,h,_,!x&&v,p)}else{let e=(y?Math.max(t1(y),t$(y)):360*ex.degrees/m.getMetersPerUnit())/256/1;(void 0!==(l=t.maxResolution)?d=0:l=e/Math.pow(g,d),void 0===(h=t.minResolution)&&(h=void 0!==t.maxZoom?void 0!==t.maxResolution?l/Math.pow(g,u):e/Math.pow(g,u):e/0x10000000),u=d+Math.floor(Math.log(l/h)/Math.log(g)),h=l/Math.pow(g,u-d),t.constrainResolution)?(n=l,r=h,s=_,o=!x&&v,s=void 0===s||s,r=void 0!==r?r:0,a=function(t,e,i,a){if(void 0!==t){let l=o?ng(n,o,i,p):n;if(a)return s?nf(t,l,r):tu(t,r,l);let h=Math.max(Math.ceil(Math.log(n/l)/Math.log(g)-1e-9),Math.floor(Math.log(n/Math.min(l,t))/Math.log(g)+(-(.499999999*e)+.5)));return tu(n/Math.pow(g,h),r,l)}}):a=n_(l,h,_,!x&&v,p)}return{constraint:a,maxResolution:l,minResolution:h,minZoom:d,zoomFactor:g}}(t);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=i.minZoom;let n=function(t){if(void 0!==t.extent){let e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return tS(t.extent,t.constrainOnlyCenter,e)}let e=ie(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&e.isGlobal()){let t=e.getExtent().slice();return t[0]=-1/0,t[2]=1/0,tS(t,!1,!1)}return tR}
1(t),r=i.constraint,s=function(t){if(void 0===t.enableRotation||t.enableRotation){let e=t.constrainRotation;if(void 0===e||!0===e){let t;return t=tp(5),function(e,i){return i||void 0===e?e:Math.abs(e)<=t?0:e}}if(!1===e)return nm;if("number"==typeof e){let t;return t=2*Math.PI/e,function(e,i){return i?e:void 0!==e?e=Math.floor(e/t+.5)*t:void 0}}return nm}return np}(t);this.constraints_={center:n,resolution:r,rotation:s},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom)}get padding(){return this.padding_}set padding(t){let e=this.padding_;this.padding_=t;let i=this.getCenterInternal();if(i){let n=t||[0,0,0,0];e=e||[0,0,0,0];let r=this.getResolution(),s=r/2*(n[3]-e[3]+e[1]-n[1]),o=r/2*(n[0]-e[0]+e[2]-n[2]);this.setCenterInternal([i[0]+s,i[1]-o])}}getUpdatedOptions_(t){let e=this.getProperties();return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Object.assign({},e,t)}animate(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);let e=Array(arguments.length);for(let t=0;t<e.length;++t){let i=arguments[t];i.center&&((i=Object.assign({},i)).center=ig(i.center,this.getProjection())),i.anchor&&((i=Object.assign({},i)).anchor=ig(i.anchor,this.getProjection())),e[t]=i}this.animateInternal.apply(this,e)}animateInternal(t){let e,i=arguments.length;i>1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i);let n=0;for(;n<i&&!this.isDef();++n){let t=arguments[n];t.center&&this.setCenterInternal(t.center),void 0!==t.zoom?this.setZoom(t.zoom):t.resolution&&this.setResolution(t.resolution),void 0!==t.rotation&&this.setRotation(t.rotation)}if(n===i){e&&ny(e,!0);return}let r=Date.now(),s=this.targetCenter_.slice(),o=this.targetResolution_,a=this.targetRotation_,l=[];for(;n<i;++n){var h;let t=arguments[n],i={start:r,complete:!1,anchor:t.anchor,duration:void 0!==t.duration?t.duration:1e3,easing:t.easing||ef,callback:e};if(t.center&&(i.sourceCenter=s,i.targetCenter=t.center.slice(),s=i.targetCenter),void 0!==t.zoom?(i.sourceResolution=o,i.targetResolution=this.getResolutionForZoom(t.zoom),o=i.targetResolution):t.resolution&&(i.sourceResolution=o,i.targetResolution=t.resolution,o=i.targetResolution),void 0!==t.rotation){i.sourceRotation=a;let e=tm(t.rotation-a+Math.PI,2*Math.PI)-Math.PI;i.targetRotation=a+e,a=i.targetRotation}(!(h=i).sourceCenter||!h.targetCenter||er(h.sourceCenter,h.targetCenter))&&h.sourceResolution===h.targetResolution&&h.sourceRotation===h.targetRotation?i.complete=!0:r+=i.duration,l.push(i)}this.animations_.push(l),this.setHint(0,1),this.updateAnimations_()}getAnimating(){return this.hints_[0]>0}getInteracting(){return this.hints_[1]>0}cancelAnimations(){let t;this.setHint(0,-this.hints_[0]);for(let e=0,i=this.animations_.length;e<i;++e){let i=this.animations_[e];if(i[0].callback&&ny(i[0].callback,!1),!t)for(let e=0,n=i.length;e<n;++e){let n=i[e];if(!n.complete){t=n.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;let t=Date.now(),e=!1;for(let i=this.animations_.length-1;i>=0;--i){let n=this.animations_[i],r=!0;for(let i=0,s=n.length;i<s;++i){let s=n[i];if(s.complete)continue;let o=t-s.start,a=s.duration>0?o/s.duration:1;a>=1?(s.complete=!0,a=1):r=!1;let l=s.easing(a);if(s.sourceCenter){let t=s.sourceCenter[0],e=s.sourceCenter[1],i=s.targetCenter[0],n=s.targetCenter[1];this.nextCenter_=s.targetCenter;let r=t+l*(i-t),o=e+l*(n-e);this.targetCenter_=[r,o]}if(s.sourceResolution&&s.targetResolution){let t=1===l?s.targetResolution:s.sourceResolution+l*(s.targetResolution-s.sourceResolution);if(s.anchor){let e=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(t,0,e,!0);this.targetCenter_=this.calculateCenterZoom(i,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=t,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){let t=1===l?tm(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+l*(s.targetRotation-s.sourceRotation);if(s.anchor){let e=this.constraints_.rotation(t,!0);this.targetCenter_=this.calculateCenterRotate(e,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=t}if(this.applyTargetState_(!0),e=!0,!s.complete)break}if(r){this.animations_[i]=null,this.setHint(0,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;let t=n[0].callback;t&&ny(t,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let i,n=this.getCenterInternal();return void 0!==n&&(es(i=[n[0]-e[0],n[1]-e[1]],t-this.getRotation()),ee(i,e)),i}calculateCenterZoom(t,e){let i,n=this.getCenterInternal(),r=this.getResolution();return void 0!==n&&void 0!==r&&(i=[e[0]-t*(e[0]-n[0])/r,e[1]-t*(e[1]-n[1])/r]),i}getViewportSize_(t){let e=this.viewportSize_;if(t){let i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){var t,e;let i=this.getCenterInternal();return i?(t=i,e=this.getProjection(),t):i}getCenterInternal(){return this.get(td.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){var e,i;return e=this.calculateExtentInternal(t),i=this.getProjection(),e}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();let e=this.getCenterInternal();to(e,"The view center is not defined");let i=this.getResolution();to(void 0!==i,"The view resolution is not defined");let n=this.getRotation();return to(void 0!==n,"The view rotation is not defined"),tq(e,i,n,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(td.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){var i,n;return this.getResolutionForExtentInternal((i=t,n=this.getProjection(),i),e)}getResolutionForExtentInternal(t,e){return e=e||this.getViewportSizeMinusPadding_(),Math.max(t1(t)/e[0],t$(t)/e[1])}getResolutionForValueFunction(t){t=t||2;let e=this.getConstrainedResolution(this.maxResolution_),i=Math.log(e/this.minResolution_)/Math.log(t);return function(n){return e/Math.pow(t,n*i)}}getRotation(){return this.get(td.ROTATION)}getValueForResolutionFunction(t){let e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=Math.log(i/this.minResolution_)/e;return function(t){return Math.log(i/t)/e/n}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t),i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e}getState(){let t=this.getProjection(),e=this.getResolution(),i=this.getRotation(),n=this.getCenterInternal(),r=this.padding_;if(r){let t=this.getViewportSizeMinusPadding_();n=nx(n,this.getViewportSize_(),[t[0]/2+r[3],t[1]/2+r[0]],e,i)}return{center:n.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e,i,n=this.minZoom_||0;if(this.resolutions_){let r=c(this.resolutions_,t,1);n=r,e=this.resolutions_[r],i=r==this.resolutions_.length-1?2:e/this.resolutions_[r+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)}getResolutionForZoom(t){if(this.resolutions_?.length){if(1===this.resolutions_.length)return this.resolutions_[0];let e=tu(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,tu(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}
1fit(t,e){var i,n,r,s;let o;if(to(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,"Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){to(!t3(t),"Cannot fit empty extent provided as `geometry`"),o=nd((i=t,n=this.getProjection(),i))}else if("Circle"===t.getType()){let e=(r=t.getExtent(),s=this.getProjection(),r);(o=nd(e)).rotate(this.getRotation(),tY(e))}else{let e=iu();o=e?t.clone().transform(e,this.getProjection()):t}this.fitInternal(o,e)}rotatedExtentForGeometry(t){let e=this.getRotation(),i=Math.cos(e),n=Math.sin(-e),r=t.getFlatCoordinates(),s=t.getStride(),o=Infinity,a=Infinity,l=-1/0,h=-1/0;for(let t=0,e=r.length;t<e;t+=s){let e=r[t]*i-r[t+1]*n,s=r[t]*n+r[t+1]*i;o=Math.min(o,e),a=Math.min(a,s),l=Math.max(l,e),h=Math.max(h,s)}return[o,a,l,h]}fitInternal(t,e){let i,n=(e=e||{}).size;n||(n=this.getViewportSizeMinusPadding_());let r=void 0!==e.padding?e.padding:[0,0,0,0],s=void 0!==e.nearest&&e.nearest;i=void 0!==e.minResolution?e.minResolution:void 0!==e.maxZoom?this.getResolutionForZoom(e.maxZoom):0;let o=this.rotatedExtentForGeometry(t),a=this.getResolutionForExtentInternal(o,[n[0]-r[1]-r[3],n[1]-r[0]-r[2]]);a=isNaN(a)?i:Math.max(a,i),a=this.getConstrainedResolution(a,+!s);let l=this.getRotation(),h=Math.sin(l),d=Math.cos(l),u=tY(o);u[0]+=(r[1]-r[3])/2*a,u[1]+=(r[0]-r[2])/2*a;let c=u[0]*d-u[1]*h,g=u[1]*d+u[0]*h,f=this.getConstrainedCenter([c,g],a),_=e.callback?e.callback:x;void 0!==e.duration?this.animateInternal({resolution:a,center:f,duration:e.duration,easing:e.easing},_):(this.targetResolution_=a,this.targetCenter_=f,this.applyTargetState_(!1,!0),ny(_,!0))}centerOn(t,e,i){this.centerOnInternal(ig(t,this.getProjection()),e,i)}centerOnInternal(t,e,i){this.setCenterInternal(nx(t,e,i,this.getResolution(),this.getRotation()))}calculateCenterShift(t,e,i,n){let r,s=this.padding_;if(s&&t){let o=this.getViewportSizeMinusPadding_(-i),a=nx(t,n,[o[0]/2+s[3],o[1]/2+s[0]],e,i);r=[t[0]-a[0],t[1]-a[1]]}return r}isDef(){return!!this.getCenterInternal()&&void 0!==this.getResolution()}adjustCenter(t){var e,i;let n=(e=this.targetCenter_,i=this.getProjection(),e);this.setCenter([n[0]+t[0],n[1]+t[1]])}adjustCenterInternal(t){let e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])}adjustResolution(t,e){e=e&&ig(e,this.getProjection()),this.adjustResolutionInternal(t,e)}adjustResolutionInternal(t,e){let i=this.getAnimating()||this.getInteracting(),n=this.getViewportSize_(this.getRotation()),r=this.constraints_.resolution(this.targetResolution_*t,0,n,i);e&&(this.targetCenter_=this.calculateCenterZoom(r,e)),this.targetResolution_*=t,this.applyTargetState_()}adjustZoom(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)}adjustRotation(t,e){e&&(e=ig(e,this.getProjection())),this.adjustRotationInternal(t,e)}adjustRotationInternal(t,e){let i=this.getAnimating()||this.getInteracting(),n=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(n,e)),this.targetRotation_+=t,this.applyTargetState_()}setCenter(t){this.setCenterInternal(t?ig(t,this.getProjection()):t)}setCenterInternal(t){this.targetCenter_=t,this.applyTargetState_()}setHint(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]}setResolution(t){this.targetResolution_=t,this.applyTargetState_()}setRotation(t){this.targetRotation_=t,this.applyTargetState_()}setZoom(t){this.setResolution(this.getResolutionForZoom(t))}applyTargetState_(t,e){let i=this.getAnimating()||this.getInteracting()||e,n=this.constraints_.rotation(this.targetRotation_,i),r=this.getViewportSize_(n),s=this.constraints_.resolution(this.targetResolution_,0,r,i),o=this.constraints_.center(this.targetCenter_,s,r,i,this.calculateCenterShift(this.targetCenter_,s,n,r));this.get(td.ROTATION)!==n&&this.set(td.ROTATION,n),this.get(td.RESOLUTION)!==s&&(this.set(td.RESOLUTION,s),this.set("zoom",this.getZoom(),!0)),o&&this.get(td.CENTER)&&er(this.get(td.CENTER),o)||this.set(td.CENTER,o),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(t,e,i){t=void 0!==t?t:200;let n=this.constraints_.rotation(this.targetRotation_),r=this.getViewportSize_(n),s=this.constraints_.resolution(this.targetResolution_,e||0,r),o=this.constraints_.center(this.targetCenter_,s,r,!1,this.calculateCenterShift(this.targetCenter_,s,n,r));if(0===t&&!this.cancelAnchor_){this.targetResolution_=s,this.targetRotation_=n,this.targetCenter_=o,this.applyTargetState_();return}i=i||(0===t?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===n&&this.getCenterInternal()&&er(this.getCenterInternal(),o)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:n,center:o,resolution:s,duration:t,easing:eg,anchor:i}))}beginInteraction(){this.resolveConstraints(0),this.setHint(1,1)}
1endInteraction(t,e,i){i=i&&ig(i,this.getProjection()),this.endInteractionInternal(t,e,i)}endInteractionInternal(t,e,i){this.getInteracting()&&(this.setHint(1,-1),this.resolveConstraints(t,e,i))}getConstrainedCenter(t,e){let i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),i)}getConstrainedZoom(t,e){let i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,e))}getConstrainedResolution(t,e){e=e||0;let i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,e,i)}};t.s(["default",0,nv],64829);let nC="ol-hidden",nw="ol-unselectable",nE="ol-control",nS="ol-collapsed",nR=RegExp("^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))?\\s*([-,\\\"\\'\\sa-z0-9]+?)\\s*$","i"),nI=["style","variant","weight","size","lineHeight","family"],nT={normal:400,bold:700},nb=function(t){let e=t.match(nR);if(!e)return null;let i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"400",variant:"normal"};for(let t=0,n=nI.length;t<n;++t){let n=e[t+1];void 0!==n&&(i[nI[t]]="string"==typeof n?n.trim():n)}return isNaN(Number(i.weight))&&i.weight in nT&&(i.weight=nT[i.weight]),i.families=i.family.split(/,\s?/).map(t=>t.trim().replace(/^['"]|['"]$/g,"")),i};function nM(t,e,i,n){let r;return r=i&&i.length?i.shift():K?new OffscreenCanvas(t||300,e||300):document.createElement("canvas"),t&&(r.width=t),e&&(r.height=e),r.getContext("2d",n)}function nP(){return e||(e=nM(1,1)),e}function nL(t){let e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function nF(t,e){let i=e.parentNode;i&&i.replaceChild(t,e)}function nA(t){for(;t.lastChild;)t.lastChild.remove()}function nD(t,e){let i=t.childNodes;for(let n=0;;++n){let r=i[n],s=e[n];if(!r&&!s)break;if(r!==s){if(!r){t.appendChild(s);continue}if(!s){t.removeChild(r),--n;continue}t.insertBefore(s,r)}}}t.s(["createCanvasContext2D",()=>nM,"getSharedCanvasContext2D",()=>nP,"releaseCanvas",()=>nL,"removeChildren",()=>nA,"replaceChildren",()=>nD,"replaceNode",()=>nF],13685);let nk=class extends k{constructor(t){super();const e=t.element;!e||t.target||e.style.pointerEvents||(e.style.pointerEvents="auto"),this.element=e||null,this.target_=null,this.map_=null,this.listenerKeys=[],t.render&&(this.render=t.render),t.target&&this.setTarget(t.target)}disposeInternal(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&this.element?.remove();for(let t=0,e=this.listenerKeys.length;t<e;++t)b(this.listenerKeys[t]);if(this.listenerKeys.length=0,this.map_=t,t){let e=this.target_??t.getOverlayContainerStopEvent();this.element&&e.appendChild(this.element),this.render!==x&&this.listenerKeys.push(I(t,J,this.render,this)),t.render()}}render(t){}setTarget(t){this.target_="string"==typeof t?document.getElementById(t):t}},nO=class extends nk{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=void 0===t.collapsed||t.collapsed,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=void 0!==t.collapsible,this.collapsible_=void 0===t.collapsible||t.collapsible,this.collapsible_||(this.collapsed_=!1),this.attributions_=t.attributions;const e=void 0!==t.className?t.className:"ol-attribution",i=void 0!==t.tipLabel?t.tipLabel:"Attributions",n=void 0!==t.expandClassName?t.expandClassName:e+"-expand",r=void 0!==t.collapseLabel?t.collapseLabel:"âº",s=void 0!==t.collapseClassName?t.collapseClassName:e+"-collapse";"string"==typeof r?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=r,this.collapseLabel_.className=s):this.collapseLabel_=r;const o=void 0!==t.label?t.label:"i";"string"==typeof o?(this.label_=document.createElement("span"),this.label_.textContent=o,this.label_.className=n):this.label_=o;const l=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=i,this.toggleButton_.appendChild(l),this.toggleButton_.addEventListener(a.CLICK,this.handleClick_.bind(this),!1);const h=e+" "+nw+" "+nE+(this.collapsed_&&this.collapsible_?" "+nS:"")+(this.collapsible_?"":" ol-uncollapsible"),d=this.element;d.className=h,d.appendChild(this.toggleButton_),d.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(t){let e=this.getMap().getAllLayers(),i=new Set(e.flatMap(e=>e.getAttributions(t)));if(void 0!==this.attributions_&&(Array.isArray(this.attributions_)?this.attributions_.forEach(t=>i.add(t)):i.add(this.attributions_)),!this.overrideCollapsible_){let t=!e.some(t=>t.getSource()?.getAttributionsCollapsible()===!1);this.setCollapsible(t)}return Array.from(i)}async updateElement_(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}let e=await Promise.all(this.collectSourceAttributions_(t).map(t=>C(()=>t))),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!_(e,this.renderedAttributions_)){nA(this.ulElement_);for(let t=0,i=e.length;t<i;++t){let i=document.createElement("li");i.innerHTML=e[t],this.ulElement_.appendChild(i)}this.renderedAttributions_=e}}handleClick_(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(nS),this.collapsed_?nF(this.collapseLabel_,this.label_):nF(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())}setCollapsed(t){this.userCollapsed_=t,this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(t){this.updateElement_(t.frameState)}},nG=class extends nk{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target});const e=void 0!==t.className?t.className:"ol-rotate",i=void 0!==t.label?t.label:"â§",n=void 0!==t.compassClassName?t.compassClassName:"ol-compass";this.label_=null,"string"==typeof i?(this.label_=document.createElement("span"),this.label_.className=n,this.label_.textContent=i):(this.label_=i,this.label_.classList.add(n));const r=t.tipLabel?t.tipLabel:"Reset rotation",s=document.createElement("button");s.className=e+"-reset",s.setAttribute("type","button"),s.title=r,s.appendChild(this.label_),s.addEventListener(a.CLICK,this.handleClick_.bind(this),!1);const o=this.element;o.className=e+" "+nw+" "+nE,o.appendChild(s),this.callResetNorth_=t.resetNorth?t.resetNorth:void 0,this.duration_=void 0!==t.duration?t.duration:250,this.autoHide_=void 0===t.autoHide||t.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(nC)}handleClick_(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()}resetNorth_(){let t=this.getMap().getView();if(!t)return;let e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:eg}):t.setRotation(0))}render(t){let e=t.frameState;if(!e)return;let i=e.viewState.rotation;if(i!=this.rotation_){if(this.autoHide_){let t=this.element.classList.contains(nC);t||0!==i?t&&0!==i&&this.element.classList.remove(nC):this.element.classList.add(nC)}this.label_.style.transform="rotate("+i+"rad)"}this.rotation_=i}},nz=class extends nk{constructor(t){super({element:document.createElement("div"),target:(t=t||{}).target});const e=void 0!==t.className?t.className:"ol-zoom",i=void 0!==t.delta?t.delta:1,n=void 0!==t.zoomInClassName?t.zoomInClassName:e+"-in",r=void 0!==t.zoomOutClassName?t.zoomOutClassName:e+"-out",s=void 0!==t.zoomInLabel?t.zoomInLabel:"+",o=void 0!==t.zoomOutLabel?t.zoomOutLabel:"â",l=void 0!==t.zoomInTipLabel?t.zoomInTipLabel:"Zoom in",h=void 0!==t.zoomOutTipLabel?t.zoomOutTipLabel:"Zoom out",d=document.createElement("button");d.className=n,d.setAttribute("type","button"),d.title=l,d.appendChild("string"==typeof s?document.createTextNode(s):s),d.addEventListener(a.CLICK,this.handleClick_.bind(this,i),!1);const u=document.createElement("button");u.className=r,u.setAttribute("type","button"),u.title=h,u.appendChild("string"==typeof o?document.createTextNode(o):o),u.addEventListener(a.CLICK,this.handleClick_.bind(this,-i),!1);const c=this.element;c.className=e+" "+nw+" "+nE,c.appendChild(d),c.appendChild(u),this.duration_=void 0!==t.duration?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){let e=this.getMap().getView();if(!e)return;let i=e.getZoom();if(void 0!==i){let n=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:eg})):e.setZoom(n)}}};function nN(t){t=t||{};let e=new z;return(void 0===t.zoom||t.zoom)&&e.push(new nz(t.zoomOptions)),(void 0===t.rotate||t.rotate)&&e.push(new nG(t.rotateOptions)),(void 0===t.attribution||t.attribution)&&e.push(new nO(t.attributionOptions)),e}t.s(["defaults",()=>nN],45185);let nU=class{constructor(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(t,e){this.points_.push(t,e,Date.now())}end(){if(this.points_.length<6)return!1;let t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;let i=e-3;for(;i>0&&this.points_[i+2]>t;)i-=3;let n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;let r=this.points_[e]-this.points_[i],s=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(s,r),this.initialVelocity_=Math.sqrt(r*r+s*s)/n,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}},nW={ACTIVE:"active"};
1function nj(t,e,i){let n=t.getCenterInternal();if(n){let r=[n[0]+e[0],n[1]+e[1]];t.animateInternal({duration:void 0!==i?i:250,easing:e_,center:t.getConstrainedCenter(r)})}}function nB(t,e,i,n){let r=t.getZoom();if(void 0===r)return;let s=t.getConstrainedZoom(r+e),o=t.getResolutionForZoom(s);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:o,anchor:i,duration:void 0!==n?n:250,easing:eg})}t.s(["default",0,nW],85390);let nX=class extends k{constructor(t){super(),this.on,this.once,this.un,t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(nW.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(nW.ACTIVE,t)}setMap(t){this.map_=t}};t.s(["default",0,nX,"pan",()=>nj,"zoomByDelta",()=>nB],91732);let nV=class extends nX{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=void 0!==t.duration?t.duration:250}handleEvent(t){let e=!1;if(t.type==W.DBLCLICK){let i=t.originalEvent,n=t.map,r=t.coordinate,s=i.shiftKey?-this.delta_:this.delta_;nB(n.getView(),s,r,this.duration_),i.preventDefault(),e=!0}return!e}};function nK(t){let e=arguments;return function(t){let i=!0;for(let n=0,r=e.length;n<r&&(i=i&&e[n](t));++n);return i}}let nY=function(t){let e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},nZ=function(t){let e=t.map.getTargetElement(),i=e.getRootNode(),n=t.map.getOwnerDocument().activeElement;return i instanceof ShadowRoot?i.host.contains(n):e.contains(n)},nq=function(t){let e=t.map.getTargetElement(),i=e.getRootNode();return!(i instanceof ShadowRoot?i.host:e).hasAttribute("tabindex")||nZ(t)},nH=function(t){let e=t.originalEvent;return"pointerId"in e&&0==e.button&&!(B&&X&&e.ctrlKey)},n$=function(t){let e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},nJ=function(t){let e=t.originalEvent;return X?e.metaKey:e.ctrlKey},nQ=function(t){let e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},n0=function(t){let e=t.originalEvent,i=e.target.tagName;return"INPUT"!==i&&"SELECT"!==i&&"TEXTAREA"!==i&&!e.target.isContentEditable},n1=function(t){let e=t.originalEvent;return"pointerId"in e&&"mouse"==e.pointerType},n2=function(t){let e=t.originalEvent;return"pointerId"in e&&e.isPrimary&&0===e.button};function n3(t){let e=t.length,i=0,n=0;for(let r=0;r<e;r++)i+=t[r].clientX,n+=t[r].clientY;return{clientX:i/e,clientY:n/e}}t.s(["all",()=>nK,"altKeyOnly",0,function(t){let e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},"altShiftKeysOnly",0,nY,"always",0,m,"focusWithTabindex",0,nq,"mouseActionButton",0,nH,"mouseOnly",0,n1,"never",0,y,"noModifierKeys",0,n$,"platformModifierKey",0,nJ,"primaryAction",0,n2,"shiftKeyOnly",0,nQ,"singleClick",0,function(t){return t.type==W.SINGLECLICK},"targetNotEditable",0,n0],95068);let n5=class extends nX{constructor(t){super(t=t||{}),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==W.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==W.POINTERUP){let e=this.handleUpEvent(t);this.handlingDownUpSequence=e&&this.targetPointers.length>0}}else if(t.type==W.POINTERDOWN){let i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==W.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}};t.s(["centroid",()=>n3,"default",0,n5],77583);let n6=class extends n5{constructor(t){super({stopDown:y}),t=t||{},this.kinetic_=t.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;
1const e=t.condition?t.condition:nK(n$,n2);this.condition_=t.onFocusOnly?nK(nq,e):e,this.noKinetic_=!1}handleDragEvent(t){let e=t.map;this.panning_||(this.panning_=!0,e.getView().beginInteraction());let i=this.targetPointers,n=e.getEventPixel(n3(i));if(i.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){let e=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],i=t.map.getView();eo(e,i.getResolution()),es(e,i.getRotation()),i.adjustCenterInternal(e)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=i.length,t.originalEvent.preventDefault()}handleUpEvent(t){let e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){let t=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),r=i.getCenterInternal(),s=e.getPixelFromCoordinateInternal(r),o=e.getCoordinateFromPixelInternal([s[0]-t*Math.cos(n),s[1]-t*Math.sin(n)]);i.animateInternal({center:i.getConstrainedCenter(o),duration:500,easing:eg})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(t){if(this.targetPointers.length>0&&this.condition_(t)){let e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}},n4=class extends n5{constructor(t){t=t||{},super({stopDown:y}),this.condition_=t.condition?t.condition:nY,this.lastAngle_=void 0,this.duration_=void 0!==t.duration?t.duration:250}handleDragEvent(t){if(!n1(t))return;let e=t.map,i=e.getView();if(i.getConstraints().rotation===np)return;let n=e.getSize(),r=t.pixel,s=Math.atan2(n[1]/2-r[1],r[0]-n[0]/2);if(void 0!==this.lastAngle_){let t=s-this.lastAngle_;i.adjustRotationInternal(-t)}this.lastAngle_=s}handleUpEvent(t){return!n1(t)||(t.map.getView().endInteraction(this.duration_),!1)}handleDownEvent(t){return!!n1(t)&&!!(nH(t)&&this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0)}},n8=class extends l{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){let t=this.startPixel_,e=this.endPixel_,i=this.element_.style;i.left=Math.min(t[0],e[0])+"px",i.top=Math.min(t[1],e[1])+"px",i.width=Math.abs(e[0]-t[0])+"px",i.height=Math.abs(e[1]-t[1])+"px"}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);let t=this.element_.style;t.left="inherit",t.top="inherit",t.width="inherit",t.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;let t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new nh([i])}getGeometry(){return this.geometry_}},n9="boxcancel";class n7 extends S{constructor(t,e,i){super(t),this.coordinate=e,this.mapBrowserEvent=i}}let rt=class extends n5{constructor(t){super(),this.on,this.once,this.un,t=t??{},this.box_=new n8(t.className||"ol-dragbox"),this.minArea_=t.minArea??
164,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition??nH,this.boxEndCondition_=t.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,i){let n=i[0]-e[0],r=i[1]-e[1];return n*n+r*r>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.startPixel_&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new n7("boxdrag",t.coordinate,t)))}handleUpEvent(t){if(!this.startPixel_)return!1;let e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new n7(e?"boxend":n9,t.coordinate,t)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new n7("boxstart",t.coordinate,t)),!0)}onBoxEnd(t){}setActive(t){!t&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new n7(n9,this.startPixel_,null)),this.startPixel_=null)),super.setActive(t)}setMap(t){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new n7(n9,this.startPixel_,null)),this.startPixel_=null)),super.setMap(t)}},re=class extends rt{constructor(t){super({condition:(t=t||{}).condition?t.condition:nQ,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=void 0!==t.duration?t.duration:200,this.out_=void 0!==t.out&&t.out}onBoxEnd(t){let e=this.getMap().getView(),i=this.getGeometry();if(this.out_){let t=e.rotatedExtentForGeometry(i),n=e.getResolutionForExtentInternal(t),r=e.getResolution()/n;(i=i.clone()).scale(r*r)}e.fitInternal(i,{duration:this.duration_,easing:eg})}},ri="ArrowLeft",rn="ArrowRight",rr="ArrowDown",rs=class extends nX{constructor(t){super(),t=t||{},this.defaultCondition_=function(t){return n$(t)&&n0(t)},this.condition_=void 0!==t.condition?t.condition:this.defaultCondition_,this.duration_=void 0!==t.duration?t.duration:100,this.pixelDelta_=void 0!==t.pixelDelta?t.pixelDelta:128}handleEvent(t){let e=!1;if(t.type==a.KEYDOWN){let i=t.originalEvent,n=i.key;if(this.condition_(t)&&(n==rr||n==ri||n==rn||"ArrowUp"==n)){let r=t.map.getView(),s=r.getResolution()*this.pixelDelta_,o=0,a=0;n==rr?a=-s:n==ri?o=-s:n==rn?o=s:a=s;let l=[o,a];es(l,r.getRotation()),nj(r,l,this.duration_),i.preventDefault(),e=!0}}return!e}},ro=class extends nX{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(t){return!nJ(t)&&n0(t)},this.delta_=t.delta?t.delta:1,this.duration_=void 0!==t.duration?t.duration:100}handleEvent(t){let e=!1;if(t.type==a.KEYDOWN||t.type==a.KEYPRESS){let i=t.originalEvent,n=i.key;if(this.condition_(t)&&("+"===n||"-"===n)){let r=t.map,s="+"===n?this.delta_:-this.delta_;nB(r.getView(),s,void 0,this.duration_),i.preventDefault(),e=!0}}return!e}},ra=class extends nX{constructor(t){super(t=t||{}),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=void 0!==t.maxDelta?t.maxDelta:1,this.duration_=void 0!==t.duration?t.duration:250,this.timeout_=void 0!==t.timeout?t.timeout:80,this.useAnchor_=void 0===t.useAnchor||t.useAnchor,this.constrainResolution_=void 0!==t.constrainResolution&&t.constrainResolution;const e=t.condition?t.condition:m;this.condition_=t.onFocusOnly?nK(nq,e):e,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;let t=this.getMap();t&&t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(t){if(!this.condition_(t)||t.type!==a.WHEEL)return!0;let e=t.map,i=t.originalEvent;i.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.pixel);let n=i.deltaY;switch(i.deltaMode){case WheelEvent.DOM_DELTA_LINE:n*=40;break;case WheelEvent.DOM_DELTA_PAGE:n*=300}if(0===n)return!1;this.lastDelta_=n;let r=Date.now();void 0===this.startTime_&&(this.startTime_=r),(!this.mode_||r-this.startTime_>this.trackpadEventGap_)&&(this.mode_=4>Math.abs(n)?"trackpad":"wheel");let s=e.getView();if("trackpad"===this.mode_&&!(s.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(s.getAnimating()&&s.cancelAnimations(),s.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),s.adju
1stZoom(-n/this.deltaPerZoom_,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=r,!1;this.totalDelta_+=n;let o=Math.max(this.timeout_-(r-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,e),o),!1}handleWheelZoom_(t){let e=t.getView();e.getAnimating()&&e.cancelAnimations();let i=-tu(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),nB(e,i,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}},rl=class extends n5{constructor(t){const e=t=t||{};e.stopDown||(e.stopDown=y),super(e),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==t.threshold?t.threshold:.3,this.duration_=void 0!==t.duration?t.duration:250}handleDragEvent(t){let e=0,i=this.targetPointers[0],n=this.targetPointers[1],r=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(void 0!==this.lastAngle_){let t=r-this.lastAngle_;this.rotationDelta_+=t,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=t}this.lastAngle_=r;let s=t.map,o=s.getView();o.getConstraints().rotation!==np&&(this.anchor_=s.getCoordinateFromPixelInternal(s.getEventPixel(n3(this.targetPointers))),this.rotating_&&(s.render(),o.adjustRotationInternal(e,this.anchor_)))}handleUpEvent(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)}handleDownEvent(t){if(this.targetPointers.length>=2){let e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}},rh=class extends n5{constructor(t){const e=t=t||{};e.stopDown||(e.stopDown=y),super(e),this.anchor_=null,this.duration_=void 0!==t.duration?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=1,i=this.targetPointers[0],n=this.targetPointers[1],r=i.clientX-n.clientX,s=i.clientY-n.clientY,o=Math.sqrt(r*r+s*s);void 0!==this.lastDistance_&&(e=this.lastDistance_/o),this.lastDistance_=o;let a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e),this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel(n3(this.targetPointers))),a.render(),l.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){let e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){let e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}},rd="opacity",ru="visible",rc="extent",rg="zIndex",rf="maxResolution",r_="minResolution",rp="maxZoom",rm="minZoom",ry="source",rx=class extends k{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const e=Object.assign({},t);"object"==typeof t.properties&&(delete e.properties,Object.assign(e,t.properties)),e[rd]=void 0!==t.opacity?t.opacity:1,to("number"==typeof e[rd],"Layer opacity must be a number"),e[ru]=void 0===t.visible||t.visible,e[rg]=t.zIndex,e[rf]=void 0!==t.maxResolution?t.maxResolution:1/0,e[r_]=void 0!==t.minResolution?t.minResolution:0,e[rm]=void 0!==t.minZoom?t.minZoom:-1/0,e[rp]=void 0!==t.maxZoom?t.maxZoom:1/0,this.className_=void 0!==e.className?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){let e=this.state_||{layer:this,managed:void 0===t||t},i=this.getZIndex();return e.opacity=tu(Math.round(100*this.getOpacity())/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==i||e.managed?i:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return L()}getLayerStatesArray(t){return L()}getExtent(){return this.get(rc)}getMaxResolution(){return this.get(rf)}getMinResolution(){return this.get(r_)}getMinZoom(){return this.get(rm)}getMaxZoom(){return this.get(rp)}getOpacity(){return this.get(rd)}getSourceState(){return L()}getVisible(){return this.get(ru)}getZIndex(){return this.get(rg)}
1setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(rc,t)}setMaxResolution(t){this.set(rf,t)}setMinResolution(t){this.set(r_,t)}setMaxZoom(t){this.set(rp,t)}setMinZoom(t){this.set(rm,t)}setOpacity(t){to("number"==typeof t,"Layer opacity must be a number"),this.set(rd,t)}setVisible(t){this.set(ru,t)}setZIndex(t){this.set(rg,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}};class rv extends S{constructor(t,e){super(t),this.layer=e}}let rC="layers";class rw extends rx{constructor(t){const e=Object.assign({},t=t||{});delete e.layers;let i=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(rC,this.handleLayersChanged_),i?Array.isArray(i)?i=new z(i.slice(),{unique:!0}):to("function"==typeof i.getArray,"Expected `layers` to be an array or a `Collection`"):i=new z(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(b),this.layersListenerKeys_.length=0;let t=this.getLayers();for(let e in this.layersListenerKeys_.push(I(t,s.ADD,this.handleLayersAdd_,this),I(t,s.REMOVE,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(b);w(this.listenerKeys_);let e=t.getArray();for(let t=0,i=e.length;t<i;t++){let i=e[t];this.registerLayerListeners_(i),this.dispatchEvent(new rv("addlayer",i))}this.changed()}registerLayerListeners_(t){let e=[I(t,o,this.handleLayerChange_,this),I(t,a.CHANGE,this.handleLayerChange_,this)];t instanceof rw&&e.push(I(t,"addlayer",this.handleLayerGroupAdd_,this),I(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[A(t)]=e}handleLayerGroupAdd_(t){this.dispatchEvent(new rv("addlayer",t.layer))}handleLayerGroupRemove_(t){this.dispatchEvent(new rv("removelayer",t.layer))}handleLayersAdd_(t){let e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new rv("addlayer",e)),this.changed()}handleLayersRemove_(t){let e=t.element,i=A(e);this.listenerKeys_[i].forEach(b),delete this.listenerKeys_[i],this.dispatchEvent(new rv("removelayer",e)),this.changed()}getLayers(){return this.get(rC)}setLayers(t){let e=this.getLayers();if(e){let t=e.getArray();for(let e=0,i=t.length;e<i;++e)this.dispatchEvent(new rv("removelayer",t[e]))}this.set(rC,t)}getLayersArray(t){return t=void 0!==t?t:[],this.getLayers().forEach(function(e){e.getLayersArray(t)}),t}getLayerStatesArray(t){let e=void 0!==t?t:[],i=e.length;this.getLayers().forEach(function(t){t.getLayerStatesArray(e)});let n=this.getLayerState(),r=n.zIndex;t||void 0!==n.zIndex||(r=0);for(let t=i,s=e.length;t<s;t++){let i=e[t];i.opacity*=n.opacity,i.visible=i.visible&&n.visible,i.maxResolution=Math.min(i.maxResolution,n.maxResolution),i.minResolution=Math.max(i.minResolution,n.minResolution),i.minZoom=Math.max(i.minZoom,n.minZoom),i.maxZoom=Math.min(i.maxZoom,n.maxZoom),void 0!==n.extent&&(void 0!==i.extent?i.extent=tJ(i.extent,n.extent):i.extent=n.extent),void 0===i.zIndex&&(i.zIndex=r)}return e}getSourceState(){return"ready"}}let rE="prerender",rS="postrender",rR="precompose",rI="rendercomplete";function rT(t,e){if(!t.visible)return!1;let i=e.resolution;if(i<t.minResolution||i>=t.maxResolution)return!1;let n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}let rb=class extends rx{constructor(t){const e=Object.assign({},t);delete e.source,super(e),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,t.render&&(this.render=t.render),t.map&&this.setMap(t.map),this.addChangeListener(ry,this.handleSourcePropertyChange_);const i=t.source?t.source:null;this.setSource(i)}getLayersArray(t){return(t=t||[]).push(this),t}getLayerStatesArray(t){return(t=t||[]).push(this.getLayerState()),t}getSource(){return this.get(ry)||null}getRenderSource(){return this.getSource()}getSourceState(){let t=this.getSource();return t?t.getState():"undefined"}handleSourceChange_(){this.changed(),this.sourceReady_||"ready"!==this.getSource().getState()||(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(b(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;let t=this.getSource();t&&(this.sourceChangeKey_=I(t,a.CHANGE,this.handleSourceChange_,this),"ready"===t.getState()&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return this.renderer_&&this.rendered?this.renderer_.getData(t):null}isVisible(t){let e,i,n=this.getMapInternal();if(!t&&n&&(t=n.getView()),!(e=t instanceof nv?{viewState:t.getState(),extent:t.calculateExtent()}:t).layerStatesArray&&n&&(e.layerStatesArray=n.getLayerGroup().getLayerStatesArray()),e.layerStatesArray){if(!(i=e.layerStatesArray.find(t=>t.layer===this)))return!1}else i=this.getLayerState();let r=this.getExtent();return rT(i,e.viewState)&&(!r||t2(r,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];let e=this.getSource()?.getAttributions();if(!e)return[];let i=e(t instanceof nv?t.getViewStateAndExtent():t);return Array.isArray(i)||(i=[i]),i}render(t,e){let i=this.getRenderer();return i.prepareFrame(t)?(this.rendered=!0,i.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){let e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set("map",t)}getMapInternal(){return this.get("map")}setMap(t){this.mapPrecomposeKey_&&(b(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(b(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=I(t,rR,this.handlePrecompose_,this),this.mapRenderKey_=I(this,a.CHANGE,t.render,t),this.changed())}handlePrecompose_(t){let e=t.frameState.layerStatesArray,i=this.getLayerState(!1);to(!e.some(t=>t.layer===i.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),e.push(i)}setSource(t){this.set(ry,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}clearRenderer(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_)}disposeInternal(){this.clearRenderer(),this.setSource(null),super.disposeInternal()}};function rM(t,e,i){let n=t[e];t[e]=t[i],t[i]=n}t.s(["default",0,rb,"inView",()=>rT],79703);class rP{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data,i=[];if(!rN(t,e))return i;let n=this.toBBox,r=[];for(;e;){for(let s=0;s<e.children.length;s++){let o=e.children[s],a=e.leaf?n(o):o;rN(t,a)&&(e.leaf?i.push(o):rz(t,a)?this._all(o,i):r.push(o))}e=r.pop()}return i}collides(t){let e=this.data;if(!rN(t,e))return!1;let i=[];for(;e;){for(let n=0;n<e.children.length;n++){let r=e.children[n],s=e.leaf?this.toBBox(r):r;if(rN(t,s)){if(e.leaf||rz(t,s))return!0;
1i.push(r)}}e=i.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){let t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=rU([]),this}remove(t,e){let i,n,r;if(!t)return this;let s=this.data,o=this.toBBox(t),a=[],l=[];for(;s||a.length;){if(s||(s=a.pop(),n=a[a.length-1],i=l.pop(),r=!0),s.leaf){let i=function(t,e,i){if(!i)return e.indexOf(t);for(let n=0;n<e.length;n++)if(i(t,e[n]))return n;return -1}(t,s.children,e);if(-1!==i){s.children.splice(i,1),a.push(s),this._condense(a);break}}!r&&!s.leaf&&rz(s,o)?(a.push(s),l.push(i),i=0,n=s,s=s.children[0]):n?(i++,s=n.children[i],r=!1):s=null}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){let i=[];for(;t;)t.leaf?e.push(...t.children):i.push(...t.children),t=i.pop();return e}_build(t,e,i,n){let r,s=i-e+1,o=this._maxEntries;if(s<=o)return rL(r=rU(t.slice(e,i+1)),this.toBBox),r;n||(n=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/Math.pow(o,n-1))),(r=rU([])).leaf=!1,r.height=n;let a=Math.ceil(s/o),l=a*Math.ceil(Math.sqrt(o));rW(t,e,i,l,this.compareMinX);for(let s=e;s<=i;s+=l){let e=Math.min(s+l-1,i);rW(t,s,e,a,this.compareMinY);for(let i=s;i<=e;i+=a){let s=Math.min(i+a-1,e);r.children.push(this._build(t,i,s,n-1))}}return rL(r,this.toBBox),r}_chooseSubtree(t,e,i,n){for(;;){let o;if(n.push(e),e.leaf||n.length-1===i)break;let a=1/0,l=1/0;for(let i=0;i<e.children.length;i++){var r,s;let n=e.children[i],h=rO(n),d=(r=t,(Math.max((s=n).maxX,r.maxX)-Math.min(s.minX,r.minX))*(Math.max(s.maxY,r.maxY)-Math.min(s.minY,r.minY))-h);d<l?(l=d,a=h<a?h:a,o=n):d===l&&h<a&&(a=h,o=n)}e=o||e.children[0]}return e}_insert(t,e,i){let n=i?t:this.toBBox(t),r=[],s=this._chooseSubtree(n,this.data,e,r);for(s.children.push(t),rA(s,n);e>=0;)if(r[e].children.length>this._maxEntries)this._split(r,e),e--;else break;this._adjustParentBBoxes(n,r,e)}_split(t,e){let i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);let s=this._chooseSplitIndex(i,r,n),o=rU(i.children.splice(s,i.children.length-s));o.height=i.height,o.leaf=i.leaf,rL(i,this.toBBox),rL(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)}_splitRoot(t,e){this.data=rU([t,e]),this.data.height=t.height+1,this.data.leaf=!1,rL(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let n,r=1/0,s=1/0;for(let o=e;o<=i-e;o++){let e=rF(t,0,o,this.toBBox),a=rF(t,o,i,this.toBBox),l=function(t,e){let i=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY);return Math.max(0,Math.min(t.maxX,e.maxX)-i)*Math.max(0,Math.min(t.maxY,e.maxY)-n)}(e,a),h=rO(e)+rO(a);l<r?(r=l,n=o,s=h<s?h:s):l===r&&h<s&&(s=h,n=o)}return n||i-e}_chooseSplitAxis(t,e,i){let n=t.leaf?this.compareMinX:rD,r=t.leaf?this.compareMinY:rk;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,r)&&t.children.sort(n)}_allDistMargin(t,e,i,n){t.children.sort(n);let r=this.toBBox,s=rF(t,0,e,r),o=rF(t,i-e,i,r),a=rG(s)+rG(o);for(let n=e;n<i-e;n++){let e=t.children[n];rA(s,t.leaf?r(e):e),a+=rG(s)}for(let n=i-e-1;n>=e;n--){let e=t.children[n];rA(o,t.leaf?r(e):e),a+=rG(o)}return a}_adjustParentBBoxes(t,e,i){for(let n=i;n>=0;n--)rA(e[n],t)}_condense(t){for(let e=t.length-1,i;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():rL(t[e],this.toBBox)}}function rL(t,e){rF(t,0,t.children.length,e,t)}function rF(t,e,i,n,r){r||(r=rU(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let s=e;s<i;s++){let e=t.children[s];rA(r,t.leaf?n(e):e)}return r}function rA(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function rD(t,e){return t.minX-e.minX}function rk(t,e){return t.minY-e.minY}
1function rO(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function rG(t){return t.maxX-t.minX+(t.maxY-t.minY)}function rz(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function rN(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function rU(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function rW(t,e,i,n,r){let s=[e,i];for(;s.length;){if((i=s.pop())-(e=s.pop())<=n)continue;let o=e+Math.ceil((i-e)/n/2)*n;!function t(e,i,n=0,r=e.length-1,s=function(t,e){return t<e?-1:+(t>e)}){for(;r>n;){if(r-n>600){let o=r-n+1,a=i-n+1,l=Math.log(o),h=.5*Math.exp(2*l/3),d=.5*Math.sqrt(l*h*(o-h)/o)*(a-o/2<0?-1:1),u=Math.max(n,Math.floor(i-a*h/o+d)),c=Math.min(r,Math.floor(i+(o-a)*h/o+d));t(e,i,u,c,s)}let o=e[i],a=n,l=r;for(rM(e,n,i),s(e[r],o)>0&&rM(e,n,r);a<l;){for(rM(e,a,l),a++,l--;0>s(e[a],o);)a++;for(;s(e[l],o)>0;)l--}0===s(e[n],o)?rM(e,n,l):rM(e,++l,r),l<=i&&(n=l+1),i<=l&&(r=l-1)}}(t,o,e,i,r),s.push(e,o,o,i)}}let rj=[NaN,NaN,NaN,0],rB=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,rX=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,rV=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,rK=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function rY(t,e){return t.endsWith("%")?Number(t.substring(0,t.length-1))/e:Number(t)}function rZ(t){throw Error('failed to parse "'+t+'" as color')}let rq={},rH=0;function r$(t){return t>.0031308?269.025*Math.pow(t,1/2.4)-14.025:3294.6*t}function rJ(t){return t>.2068965?Math.pow(t,3):108/841*(t-4/29)}function rQ(t){return t>10.314724?Math.pow((t+14.025)/269.025,2.4):t/3294.6}function r0(t){return t>.0088564?Math.pow(t,1/3):t/(108/841)+4/29}function r1(t){let e=rQ(t[0]),i=rQ(t[1]),n=rQ(t[2]),r=r0(.222488403*e+.716873169*i+.06060791*n),s=500*(r0(.452247074*e+.399439023*i+.148375274*n)-r),o=200*(r-r0(.016863605*e+.117638439*i+.865350722*n)),a=180/Math.PI*Math.atan2(o,s);return[116*r-16,Math.sqrt(s*s+o*o),a<0?a+360:a,t[3]]}function r2(t){if("none"===t)return rj;if(rq.hasOwnProperty(t))return rq[t];if(rH>=1024){let t=0;for(let e in rq)(3&t++)==0&&(delete rq[e],--rH)}let e=function t(e){if(e.toLowerCase().startsWith("rgb")){let t=e.match(rX)||e.match(rB)||e.match(rV);if(t){let e=t[4],i=100/255;return[tu(rY(t[1],i)+.5|0,0,255),tu(rY(t[2],i)+.5|0,0,255),tu(rY(t[3],i)+.5|0,0,255),void 0!==e?tu(rY(e,100),0,1):1]}rZ(e)}if(e.startsWith("#")){if(rK.test(e)){let t=e.substring(1),i=t.length<=4?1:2,n=[0,0,0,255];for(let e=0,r=t.length;e<r;e+=i){let r=parseInt(t.substring(e,e+i),16);1===i&&(r+=r<<4),n[e/i]=r}return n[3]=n[3]/255,n}rZ(e)}let n=(i||(i=nM(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),i);n.fillStyle="#abcdef";let r=n.fillStyle;n.fillStyle=e,n.fillStyle===r&&(n.fillStyle="#fedcba",r=n.fillStyle,n.fillStyle=e,n.fillStyle===r&&rZ(e));let s=n.fillStyle;if(s.startsWith("#")||s.startsWith("rgba"))return t(s);n.clearRect(0,0,1,1),n.fillRect(0,0,1,1);let o=Array.from(n.getImageData(0,0,1,1).data);return o[3]=tx(o[3]/255,3),o}(t);for(let i of(4!==e.length&&rZ(t),e))isNaN(i)&&rZ(t);return rq[t]=e,++rH,e}function r3(t){return Array.isArray(t)?t:r2(t)}function r5(t){let e=t[0];e!=(0|e)&&(e=e+.5|0);let i=t[1];i!=(0|i)&&(i=i+.5|0);let n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:Math.round(1e3*t[3])/1e3)+")"}function r6(t){return t[0]>0&&t[1]>0}function r4(t,e,i){return void 0===i&&(i=[0,0]),i[0]=t[0]*e+.5|0,i[1]=t[1]*e+.5|0,i}function r8(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}t.s(["hasArea",()=>r6,"scale",()=>r4,"toSize",()=>r8],82554);let r9=0,r7=1<<r9++,st=1<<r9++,se=1<<r9++,si=1<<r9++,sn=1<<r9++,sr=1<<r9++,ss=Math.pow(2,r9)-1,so={[r7]:"boolean",[st]:"number",[se]:"string",[si]:"color",[sn]:"number[]",[sr]:"size"},sa=Object.keys(so).map(Number).sort(d);function sl(t){let e=[];for(let n of sa){var i;(t&(i=n))===i&&e.push(so[n])}return 0===e.length?"untyped":e.length<3?e.join(" or "):e.slice(0,-1).join(", ")+", or "+e[e.length-1]}class sh{constructor(t,e){if(!(t in so))throw Error(`literal expressions must have a specific type, got ${sl(t)}`);this.type=t,this.value=e}}class sd{constructor(t,e,...i){this.type=t,this.operator=e,this.args=i}}function su(){return{variables:new Set,properties:new Set,featureId:!1,geometryType:!1,mapState:!1}}function sc(t,e,i){switch(typeof t){case"boolean":if(e===se)return new sh(se,t?"true":"false");if((e&r7)!==r7)throw Error(`got a boolean, but expected ${sl(e)}`);return new sh(r7,t);case"number":if(e===sr)return new sh(sr,r8(t));if(e===r7)return new sh(r7,!!t);if(e===se)return new sh(se,t.toString());if((e&st)!==st)throw Error(`got a number, but expected ${sl(e)}`);return new sh(st,t);case"string":if(e===si)return new sh(si,r2(t));if(e===r7)return new sh(r7,!!t);if((e&se)!==se)throw Error(`got a string, but expected ${sl(e)}`);return new sh(se,t)}if(!Array.isArray(t))throw Error("expression must be an array or a primitive value");if(0===t.length)throw Error("empty expression");if("string"==typeof t[0]){var n=t,r=e,s=i;let o=n[0],a=sP[o];if(!a)throw Error(`unknown operator: ${o}`);return a(n,r,s)}for(let e of t)if("number"!=typeof e)throw Error("expected an array of numbers");if(e===sr){if(2!==t.length)throw Error(`expected an array of two values for a size, got ${t.length}`);return new sh(sr,t)}if(e===si){if(3===t.length)return new sh(si,[...t,1]);if(4===t.length)return new sh(si,t);throw Error(`expected an array of 3 or 4 values for a color, got ${t.length}`)}if((e&sn)!==sn)throw Error(`got an array of numbers, but expected ${sl(e)}`);return new sh(sn,t)}
1let sg="concat",sf="geometry-type",s_="resolution",sp="clamp",sm="floor",sy="ceil",sx="round",sv="atan",sC="sqrt",sw="match",sE="between",sS="interpolate",sR="coalesce",sI="case",sT="number",sb="string",sM="to-string",sP={get:sz(sD(1,1/0),sL),var:sz(sD(1,1),function(t,e,i){let n=t[1];if("string"!=typeof n)throw Error("expected a string argument for var operation");return i.variables.add(n),[new sh(se,n)]}),has:sz(sD(1,1/0),sL),id:sz(function(t,e,i){i.featureId=!0},sA),[sg]:sz(sD(2,1/0),sO(se)),[sf]:sz(function(t,e,i){i.geometryType=!0},sA),"line-metric":sz(sA),[s_]:sz(sF,sA),zoom:sz(sF,sA),time:sz(sF,sA),any:sz(sD(2,1/0),sO(r7)),all:sz(sD(2,1/0),sO(r7)),"!":sz(sD(1,1),sO(r7)),"==":sz(sD(2,2),sO(ss)),"!=":sz(sD(2,2),sO(ss)),">":sz(sD(2,2),sO(st)),">=":sz(sD(2,2),sO(st)),"<":sz(sD(2,2),sO(st)),"<=":sz(sD(2,2),sO(st)),"*":sz(sD(2,1/0),sk),[sR]:sz(sD(2,1/0),sk),"/":sz(sD(2,2),sO(st)),"+":sz(sD(2,1/0),sO(st)),"-":sz(sD(2,2),sO(st)),[sp]:sz(sD(3,3),sO(st)),"%":sz(sD(2,2),sO(st)),"^":sz(sD(2,2),sO(st)),abs:sz(sD(1,1),sO(st)),[sm]:sz(sD(1,1),sO(st)),[sy]:sz(sD(1,1),sO(st)),[sx]:sz(sD(1,1),sO(st)),sin:sz(sD(1,1),sO(st)),cos:sz(sD(1,1),sO(st)),[sv]:sz(sD(1,2),sO(st)),[sC]:sz(sD(1,1),sO(st)),[sw]:sz(sD(4,1/0),sG,function(t,e,i){let n=t.length-1,r=se|st|r7,s=sc(t[1],r,i),o=sc(t[t.length-1],e,i),a=Array(n-2);for(let e=0;e<n-2;e+=2){try{let n=sc(t[e+2],s.type,i);a[e]=n}catch(t){throw Error(`failed to parse argument ${e+1} of match expression: ${t.message}`)}try{let n=sc(t[e+3],o.type,i);a[e+1]=n}catch(t){throw Error(`failed to parse argument ${e+2} of match expression: ${t.message}`)}}return[s,...a,o]}),[sE]:sz(sD(3,3),sO(st)),[sS]:sz(sD(6,1/0),sG,function(t,e,i){let n,r,s=t[1];switch(s[0]){case"linear":n=1;break;case"exponential":let o=s[1];if("number"!=typeof o||o<=0)throw Error(`expected a number base for exponential interpolation, got ${JSON.stringify(o)} instead`);n=o;break;default:throw Error(`invalid interpolation type: ${JSON.stringify(s)}`)}let a=new sh(st,n);try{r=sc(t[2],st,i)}catch(t){throw Error(`failed to parse argument 1 in interpolate expression: ${t.message}`)}let l=Array(t.length-3);for(let n=0;n<l.length;n+=2){try{let e=sc(t[n+3],st,i);l[n]=e}catch(t){throw Error(`failed to parse argument ${n+2} for interpolate expression: ${t.message}`)}try{let r=sc(t[n+4],e,i);l[n+1]=r}catch(t){throw Error(`failed to parse argument ${n+3} for interpolate expression: ${t.message}`)}}return[a,r,...l]}),[sI]:sz(sD(3,1/0),function(t,e,i){let n=t[0],r=t.length-1;if(r%2==0)throw Error(`expected an odd number of arguments for ${n}, got ${r} instead`)},function(t,e,i){let n=sc(t[t.length-1],e,i),r=Array(t.length-1);for(let e=0;e<r.length-1;e+=2){try{let n=sc(t[e+1],r7,i);r[e]=n}catch(t){throw Error(`failed to parse argument ${e} of case expression: ${t.message}`)}try{let s=sc(t[e+2],n.type,i);r[e+1]=s}catch(t){throw Error(`failed to parse argument ${e+1} of case expression: ${t.message}`)}}return r[r.length-1]=n,r}),in:sz(sD(2,2),function(t,e,i){let n,r=t[2];if(!Array.isArray(r))throw Error('the second argument for the "in" operator must be an array');if("string"==typeof r[0]){if("literal"!==r[0])throw Error('for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions');if(!Array.isArray(r[1]))throw Error('failed to parse "in" expression: the literal operator must be followed by an array');r=r[1],n=se}else n=st;let s=Array(r.length);for(let t=0;t<s.length;t++)try{let e=sc(r[t],n,i);s[t]=e}catch(e){throw Error(`failed to parse haystack item ${t} for "in" expression: ${e.message}`)}return[sc(t[1],n,i),...s]}),[sT]:sz(sD(1,1/0),sO(ss)),[sb]:sz(sD(1,1/0),sO(ss)),array:sz(sD(1,1/0),sO(st)),color:sz(sD(1,4),sO(st)),band:sz(sD(1,3),sO(st)),palette:sz(sD(2,2),function(t,e,i){let n;try{n=sc(t[1],st,i)}catch(t){throw Error(`failed to parse first argument in palette expression: ${t.message}`)}let r=t[2];if(!Array.isArray(r))throw Error("the second argument of palette must be an array");let s=Array(r.length);for(let t=0;t<s.length;t++){let e;try{e=sc(r[t],si,i)}catch(e){throw Error(`failed to parse color at index ${t} in palette expression: ${e.message}`)}if(!(e instanceof sh))throw Error(`the palette color at index ${t} must be a literal value`);s[t]=e}return[n,...s]}),[sM]:sz(sD(1,1),sO(r7|st|se|si))};
1function sL(t,e,i){let n=t.length-1,r=Array(n);for(let e=0;e<n;++e){let n=t[e+1];switch(typeof n){case"number":r[e]=new sh(st,n);break;case"string":r[e]=new sh(se,n);break;default:throw Error(`expected a string key or numeric array index for a get operation, got ${n}`)}0===e&&i.properties.add(String(n))}return r}function sF(t,e,i){i.mapState=!0}function sA(t,e,i){let n=t[0];if(1!==t.length)throw Error(`expected no arguments for ${n} operation`);return[]}function sD(t,e){return function(i,n,r){let s=i[0],o=i.length-1;if(t===e){if(o!==t)throw Error(`expected ${t} argument${1===t?"":"s"} for ${s}, got ${o}`)}else if(o<t||o>e){let i=e===1/0?`${t} or more`:`${t} to ${e}`;throw Error(`expected ${i} arguments for ${s}, got ${o}`)}}}function sk(t,e,i){let n=t.length-1,r=Array(n);for(let s=0;s<n;++s){let n=sc(t[s+1],e,i);r[s]=n}return r}function sO(t){return function(e,i,n){let r=e.length-1,s=Array(r);for(let i=0;i<r;++i){let r=sc(e[i+1],t,n);s[i]=r}return s}}function sG(t,e,i){let n=t[0],r=t.length-1;if(r%2==1)throw Error(`expected an even number of arguments for operation ${n}, got ${r} instead`)}function sz(...t){return function(e,i,n){let r,s=e[0];for(let s=0;s<t.length;s++){let o=t[s](e,i,n);if(s==t.length-1){if(!o)throw Error("expected last argument validator to return the parsed args");r=o}}return new sd(i,s,...r)}}function sN(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""}}function sU(t,e,i){return function t(e,i){if(e instanceof sh){if(e.type===si&&"string"==typeof e.value){let t=r2(e.value);return function(){return t}}return function(){return e.value}}let n=e.operator;switch(n){case sT:case sb:case sR:var r=e,s=i;let o=r.operator,a=r.args.length,l=Array(a);for(let e=0;e<a;++e)l[e]=t(r.args[e],s);switch(o){case sR:return t=>{for(let e=0;e<a;++e){let i=l[e](t);if(null!=i)return i}throw Error("Expected one of the values to be non-null")};case sT:case sb:return t=>{for(let e=0;e<a;++e){let i=l[e](t);if(typeof i===o)return i}throw Error(`Expected one of the values to be a ${o}`)};default:throw Error(`Unsupported assertion operator ${o}`)}case"get":case"var":case"has":var h=e;let d=h.args[0].value;switch(h.operator){case"get":return t=>{let e=h.args,i=t.properties[d];for(let t=1,n=e.length;t<n;++t)i=i[e[t].value];return i};case"var":return t=>t.variables[d];case"has":return t=>{let e=h.args;if(!(d in t.properties))return!1;let i=t.properties[d];for(let t=1,n=e.length;t<n;++t){let n=e[t].value;if(!i||!Object.hasOwn(i,n))return!1;i=i[n]}return!0};default:throw Error(`Unsupported accessor operator ${h.operator}`)}case"id":return t=>t.featureId;case sf:return t=>t.geometryType;case sg:{let n=e.args.map(e=>t(e,i));return t=>"".concat(...n.map(e=>e(t).toString()))}case s_:return t=>t.resolution;case"any":case"all":case sE:case"in":case"!":var u=e,c=i;let g=u.operator,f=u.args.length,_=Array(f);for(let e=0;e<f;++e)_[e]=t(u.args[e],c);switch(g){case"any":return t=>{for(let e=0;e<f;++e)if(_[e](t))return!0;return!1};case"all":return t=>{for(let e=0;e<f;++e)if(!_[e](t))return!1;return!0};case sE:return t=>{let e=_[0](t),i=_[1](t),n=_[2](t);return e>=i&&e<=n};case"in":return t=>{let e=_[0](t);for(let i=1;i<f;++i)if(e===_[i](t))return!0;return!1};case"!":return t=>!_[0](t);default:throw Error(`Unsupported logical operator ${g}`)}case"==":case"!=":case"<":case"<=":case">":case">=":var p=e,m=i;let y=p.operator,x=t(p.args[0],m),v=t(p.args[1],m);switch(y){case"==":return t=>x(t)===v(t);case"!=":return t=>x(t)!==v(t);case"<":return t=>x(t)<v(t);case"<=":return t=>x(t)<=v(t);case">":return t=>x(t)>v(t);case">=":return t=>x(t)>=v(t);default:throw Error(`Unsupported comparison operator ${y}`)}case"*":case"/":case"+":case"-":case sp:case"%":case"^":case"abs":case sm:case sy:case sx:case"sin":case"cos":case sv:case sC:var C=e,w=i;let E=C.operator,S=C.args.length,R=Array(S);for(let e=0;e<S;++e)R[e]=t(C.args[e],w);switch(E){case"*":return t=>{let e=1;for(let i=0;i<S;++i)e*=R[i](t);return e};case"/":return t=>R[0](t)/R[1](t);case"+":return t=>{let e=0;for(let i=0;i<S;++i)e+=R[i](t);return e};case"-":return t=>R[0](t)-R[1](t);case sp:return t=>{let e=R[0](t),i=R[1](t);if(e<i)return i;let n=R[2](t);return e>n?n:e};case"%":return t=>R[0](t)%R[1](t);case"^":return t=>Math.pow(R[0](t),R[1](t));case"abs":return t=>Math.abs(R[0](t));case sm:return t=>Math.floor(R[0](t));case sy:return t=>Math.ceil(R[0](t));case sx:return t=>Math.round(R[0](t));case"sin":return t=>Math.sin(R[0](t));case"cos":return t=>Math.cos(R[0](t));case sv:if(2===S)return t=>Math.atan2(R[0](t),R[1](t));return t=>Math.atan(R[0](t));case sC:return t=>Math.sqrt(R[0](t));default:throw Error(`Unsupported numeric operator ${E}`)}case sI:var I=e,T=i;let b=I.args.length,M=Array(b);for(let e=0;e<b;++e)M[e]=t(I.args[e],T);return t=>{for(let e=0;e<b-1;e+=2)if(M[e](t))return M[e+1](t);return M[b-1](t)};case sw:var P=e,L=i;let F=P.args.length,A=Array(F);for(let e=0;e<F;++e)A[e]=t(P.args[e],L);return t=>{let e=A[0](t);for(let i=1;i<F-1;i+=2)if(e===A[i](t))return A[i+1](t);return A[F-1](t)};case sS:var D=e,k=i;let O=D.args.length,G=Array(O);for(let e=0;e<O;++e)G[e]=t(D.args[e],k);return t=>{let e,i,n=G[0](t),r=G[1](t);for(let s=2;s<O;s+=2){let o=G[s](t),a=G[s+1](t),l=Array.isArray(a);if(l&&(a=function(t){if(4===t.length)return t;let e=t.slice();return e[3]=1,e}(a)),o>=r){if(2===s)return a;
1if(l)return function(t,e,i,n,r,s){var o;let a,l,h,d,u,c,g,f,_;if(0==r-i)return n;let p=r1(n),m=r1(s),y=m[2]-p[2];return y>180?y-=360:y<-180&&(y+=360),a=((o=[sW(t,e,i,p[0],r,m[0]),sW(t,e,i,p[1],r,m[1]),p[2]+sW(t,e,i,0,r,y),sW(t,e,i,n[3],r,s[3])])[0]+16)/116,l=o[1],h=o[2]*Math.PI/180,d=rJ(a),u=rJ(a+l/500*Math.cos(h)),g=r$(3.021973625*u-1.617392459*d-.404875592*(c=rJ(a-l/200*Math.sin(h)))),f=r$(-.943766287*u+1.916279586*d+.027607165*c),_=r$(.069407491*u-.22898585*d+1.159737864*c),[tu(g+.5|0,0,255),tu(f+.5|0,0,255),tu(_+.5|0,0,255),o[3]]}(n,r,e,i,o,a);return sW(n,r,e,i,o,a)}e=o,i=a}return i};case sM:var z=e,N=i;let U=z.operator,W=z.args.length,j=Array(W);for(let e=0;e<W;++e)j[e]=t(z.args[e],N);if(U===sM)return t=>{let e=j[0](t);return z.args[0].type===si?r5(e):e.toString()};throw Error(`Unsupported convert operator ${U}`);default:throw Error(`Unsupported operator ${n}`)}}(sc(t,e,i),i)}function sW(t,e,i,n,r,s){let o=r-i;if(0===o)return n;let a=e-i;return n+(1===t?a/o:(Math.pow(t,a)-1)/(Math.pow(t,o)-1))*(s-n)}let sj={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function sB(t,e,i){let n=!0,r=!1,s=!1,o=[T(t,a.LOAD,function(){s=!0,r||e()})];return t.src&&Y?(r=!0,t.decode().then(function(){n&&e()}).catch(function(t){n&&(s?e():i())})):o.push(T(t,a.ERROR,i)),function(){n=!1,o.forEach(b)}}function sX(t,e){return e&&(t.src=e),t.src&&Y?new Promise((e,i)=>t.decode().then(()=>e(t)).catch(n=>t.complete&&t.width?e(t):i(n))):new Promise((e,i)=>{function n(){s(),e(t)}function r(){s(),i(Error("Image load error"))}function s(){t.removeEventListener("load",n),t.removeEventListener("error",r)}t.addEventListener("load",n),t.addEventListener("error",r)})}function sV(t,e){return e&&(t.src=e),t.src&&Y&&Z?t.decode().then(()=>createImageBitmap(t)).catch(e=>{if(t.complete&&t.width)return t;throw e}):sX(t)}t.s(["default",0,sj],93021);let sK=class extends R{constructor(t,e,i,n){super(),this.extent=t,this.pixelRatio_=i,this.resolution=e,this.state="function"==typeof n?sj.IDLE:n,this.image_=null,this.loader="function"==typeof n?n:null}changed(){this.dispatchEvent(a.CHANGE)}getExtent(){return this.extent}getImage(){return this.image_}getPixelRatio(){return this.pixelRatio_}getResolution(){return this.resolution}getState(){return this.state}load(){if(this.state==sj.IDLE&&this.loader){this.state=sj.LOADING,this.changed();let t=this.getResolution(),e=Array.isArray(t)?t[0]:t;C(()=>this.loader(this.getExtent(),e,this.getPixelRatio())).then(t=>{"image"in t&&(this.image_=t.image),"extent"in t&&(this.extent=t.extent),"resolution"in t&&(this.resolution=t.resolution),"pixelRatio"in t&&(this.pixelRatio_=t.pixelRatio),(t instanceof HTMLImageElement||Z&&t instanceof ImageBitmap||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement)&&(this.image_=t),this.state=sj.LOADED}).catch(t=>{this.state=sj.ERROR,console.error(t)}).finally(()=>this.changed())}}setImage(t){this.image_=t}setResolution(t){this.resolution=t}};function sY(t,e,i){return e+":"+t+":"+(i?r3(i):"null")}t.s(["decode",()=>sV,"decodeFallback",()=>sX,"default",0,sK,"listenImage",()=>sB],62442);let sZ=new class{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=1024}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(let e in this.cache_){let i=this.cache_[e];(3&t++)==0&&!i.hasListener()&&(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,i){let n=sY(t,e,i);return n in this.cache_?this.cache_[n]:null}getPattern(t,e,i){let n=sY(t,e,i);return n in this.patternCache_?this.patternCache_[n]:null}set(t,e,i,n,r){let s=sY(t,e,i),o=s in this.cache_;this.cache_[s]=n,r&&(n.getImageState()===sj.IDLE&&n.load(),n.getImageState()===sj.LOADING?n.ready().then(()=>{this.patternCache_[s]=nP().createPattern(n.getImage(1),"repeat")}):this.patternCache_[s]=nP().createPattern(n.getImage(1),"repeat")),!o&&++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}},sq=null;class sH extends R{constructor(t,e,i,n,r){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=i,this.canvas_={},this.color_=r,this.imageState_=void 0===n?sj.IDLE:n,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(void 0===this.tainted_&&this.imageState_===sj.LOADED){sq||(sq=nM(1,1,void 0,{willReadFrequently:!0}
1)),sq.drawImage(this.image_,0,0);try{sq.getImageData(0,0,1,1),this.tainted_=!1}catch{sq=null,this.tainted_=!0}}return!0===this.tainted_}dispatchChangeEvent_(){this.dispatchEvent(a.CHANGE)}handleImageError_(){this.imageState_=sj.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=sj.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){let t=this.size_[0],e=this.size_[1],i=nM(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===sj.IDLE){this.image_||this.initializeImage_(),this.imageState_=sj.LOADING;try{void 0!==this.src_&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&sX(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){var e;if(!this.color_||this.canvas_[t]||this.imageState_!==sj.LOADED)return;let i=this.image_,n=nM(Math.ceil(i.width*t),Math.ceil(i.height*t)),r=n.canvas;n.scale(t,t),n.drawImage(i,0,0),n.globalCompositeOperation="multiply",n.fillStyle="string"==typeof(e=this.color_)?e:r5(e),n.fillRect(0,0,r.width/t,r.height/t),n.globalCompositeOperation="destination-in",n.drawImage(i,0,0),this.canvas_[t]=r}ready(){return this.ready_||(this.ready_=new Promise(t=>{if(this.imageState_===sj.LOADED||this.imageState_===sj.ERROR)t();else{let e=()=>{(this.imageState_===sj.LOADED||this.imageState_===sj.ERROR)&&(this.removeEventListener(a.CHANGE,e),t())};this.addEventListener(a.CHANGE,e)}})),this.ready_}}function s$(t,e,i,n,r,s){let o=void 0===e?void 0:sZ.get(e,i,r);return o||(o=new sH(t,t&&"src"in t?t.src||void 0:e,i,n,r),sZ.set(e,i,r,o,s)),s&&o&&!sZ.getPattern(e,i,r)&&sZ.set(e,i,r,o,s),o}function sJ(t){return t?Array.isArray(t)?r5(t):"object"==typeof t&&"src"in t?function(t){if(!t.offset||!t.size)return sZ.getPattern(t.src,"anonymous",t.color);let e=t.src+":"+t.offset,i=sZ.getPattern(e,void 0,t.color);if(i)return i;let n=sZ.get(t.src,"anonymous",null);if(n.getImageState()!==sj.LOADED)return null;let r=nM(t.size[0],t.size[1]);return r.drawImage(n.getImage(1),t.offset[0],t.offset[1],t.size[0],t.size[1],0,0,t.size[0],t.size[1]),s$(r.canvas,e,void 0,sj.LOADED,t.color,!0),sZ.getPattern(e,void 0,t.color)}(t):t:null}let sQ="10px sans-serif",s0="#000",s1="round",s2=[],s3="round",s5="#000",s6="center",s4="middle",s8=[0,0,0,0],s9=new k,s7=null,ot={},oe=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]),oi=function(){let t,e;async function i(t){await e.ready;let i=await e.load(t);if(0===i.length)return!1;let n=nb(t),r=n.families[0].toLowerCase(),s=n.weight;return i.some(t=>{let e=t.family.replace(/^['"]|['"]$/g,"").toLowerCase(),i=nT[t.weight]||t.weight;return e===r&&t.style===n.style&&i==s})}async function n(){await e.ready;let r=!0,s=s9.getProperties(),o=Object.keys(s).filter(t=>s[t]<100);for(let t=o.length-1;t>=0;--t){let e=o[t],n=s[e];n<100&&(await i(e)?(w(ot),s9.set(e,100)):(n+=10,s9.set(e,n,!0),n<100&&(r=!1)))}t=void 0,r||(t=setTimeout(n,100))}return async function(i){e||(e=K?self.fonts:document.fonts);let r=nb(i);if(!r)return;let s=r.families,o=!1;for(let t of s){var a,l;if(oe.has(t))continue;let e=(a=r.style,l=r.weight,`${a} ${l} 16px "${t}"`);void 0===s9.get(e)&&(s9.set(e,0,!0),o=!0)}o&&(clearTimeout(t),t=setTimeout(n,100))}}(),on=function(t){let e=ot[t];if(void 0==e){if(K){let i=nb(t),n=or(t,"Žg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)}else r||((r=document.createElement("div")).innerHTML="M",r.style.minHeight="0",r.style.maxHeight="none",r.style.height="auto",r.style.padding="0",r.style.border="none",r.style.position="absolute",r.style.display="block",r.style.left="-99999px"),r.style.font=t,document.body.appendChild(r),e=r.offsetHeight,document.body.removeChild(r);ot[t]=e}return e};function or(t,e){return s7||(s7=nM(1,1)),t!=n&&(s7.font=t,n=s7.font),s7.measureText(e)}function os(t,e,i){if(e in i)return i[e];let n=e.split("\n").reduce((e,i)=>Math.max(e,or(t,i).width),0);return i[e]=n,n}class oo{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=r8(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){let t=this.getScale();return new oo({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return L()}getImage(t){return L()}getHitDetectionImage(){return L()}getPixelRatio(t){return 1}getImageState(){return L()}getImageSize(){return L()}getOrigin(){return L()}getSize(){return L()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=r8(t)}listenImageChange(t){L()}load(){L()}unlistenImageChange(t){L()}ready(){return Promise.resolve()}}let oa=oo;class ol extends oa{constructor(t){super({opacity:1,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,rotation:void 0!==t.rotation?t.rotation:0,scale:void 0!==t.scale?t.scale:1,displacement:void 0!==t.displacement?t.dis
1placement:[0,0],declutterMode:t.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius=t.radius,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?sj.LOADING:sj.LOADED,this.imageState_===sj.LOADING&&this.ready().then(()=>this.imageState_=sj.LOADED),this.render()}clone(){let t=this.getScale(),e=new ol({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){let t=this.size_,e=this.getDisplacement(),i=this.getScaleArray();return[t[0]/2-e[0]/i[0],t[1]/2+e[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){let e=this.fill_?.getKey(),i=`${t},${this.angle_},${this.radius},${this.radius2_},${this.points_},${e}`+Object.values(this.renderOptions_).join(","),n=sZ.get(i,null,null)?.getImage(1);if(!n){let e=this.renderOptions_,r=Math.ceil(e.size*t),s=nM(r,r);this.draw_(e,s,t),n=s.canvas,sZ.set(i,null,null,new sH(n,void 0,null,sj.LOADED,null))}return n}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,i){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;let n=this.radius,r=void 0===this.radius2_?n:this.radius2_;if(n<r){let t=n;n=r,r=t}let s=2*Math.PI/(void 0===this.radius2_?this.points_:2*this.points_),o=r*Math.sin(s),a=n-Math.sqrt(r*r-o*o),l=Math.sqrt(o*o+a*a),h=l/o;if("miter"===t&&h<=i)return h*e;let d=e/2/h,u=e/2*(a/l),c=Math.sqrt((n+d)*(n+d)+u*u)-n;if(void 0===this.radius2_||"bevel"===t)return 2*c;let g=n*Math.sin(s),f=r-Math.sqrt(n*n-g*g),_=Math.sqrt(g*g+f*f)/g;return _<=i?2*Math.max(c,_*e/2-r-n):2*c}createRenderOptions(){let t,e=s1,i=s3,n=0,r=null,s=0,o=0;this.stroke_&&(t=sJ(this.stroke_.getColor()??s5),o=this.stroke_.getWidth()??1,r=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset()??0,i=this.stroke_.getLineJoin()??s3,e=this.stroke_.getLineCap()??s1,n=this.stroke_.getMiterLimit()??10);let a=this.calculateLineJoinSize_(i,o,n);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*Math.max(this.radius,this.radius2_||0)+a),lineCap:e,lineDash:r,lineDashOffset:s,lineJoin:i,miterLimit:n}}render(){this.renderOptions_=this.createRenderOptions();let t=this.renderOptions_.size;this.hitDetectionCanvas_=null,this.size_=[t,t]}draw_(t,e,i){if(e.scale(i,i),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){let t=this.fill_.getColor();null===t&&(t=s0),e.fillStyle=sJ(t),e.fill()}t.strokeStyle&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}createHitDetectionCanvas_(t){let e;if(this.fill_){let i=this.fill_.getColor(),n=0;"string"==typeof i&&(i=r3(i)),null===i?n=1:Array.isArray(i)&&(n=4===i.length?i[3]:1),0===n&&(e=nM(t.size,t.size),this.drawHitDetectionCanvas_(t,e))}return e?e.canvas:this.getImage(1)}createPath_(t){let e=this.points_,i=this.radius;if(e===1/0)t.arc(0,0,i,0,2*Math.PI);else{let n=void 0===this.radius2_?i:this.radius2_;void 0!==this.radius2_&&(e*=2);let r=this.angle_-Math.PI/2,s=2*Math.PI/e;for(let o=0;o<e;o++){let e=r+o*s,a=o%2==0?i:n;t.lineTo(a*Math.cos(e),a*Math.sin(e))}t.closePath()}}drawHitDetectionCanvas_(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=s0,e.fill(),t.strokeStyle&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}ready(){return this.fill_?this.fill_.ready():Promise.resolve()}}let oh=ol;class od extends oh{constructor(t){t=t||{radius:5},super({points:1/0,fill:t.fill,radius:t.radius,stroke:t.stroke,scale:void 0!==t.scale?t.scale:1,rotation:void 0!==t.rotation?t.rotation:0,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,displacement:void 0!==t.displacement?t.dis
1placement:[0,0],declutterMode:t.declutterMode})}clone(){let t=this.getScale(),e=new od({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}setRadius(t){this.radius=t,this.render()}}t.s(["default",0,od],9496);class ou{constructor(t){t=t||{},this.patternImage_=null,this.color_=null,void 0!==t.color&&this.setColor(t.color)}clone(){let t=this.getColor();return new ou({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){if(null!==t&&"object"==typeof t&&"src"in t){let e=s$(null,t.src,"anonymous",void 0,t.offset?null:t.color?t.color:null,!(t.offset&&t.size));e.ready().then(()=>{this.patternImage_=null}),e.getImageState()===sj.IDLE&&e.load(),e.getImageState()===sj.LOADING&&(this.patternImage_=e)}this.color_=t}getKey(){let t=this.getColor();return t?t instanceof CanvasPattern||t instanceof CanvasGradient?A(t):"object"==typeof t&&"src"in t?t.src+":"+t.offset:r3(t).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function oc(t,e,i,n){return void 0!==i&&void 0!==n?[i/t,n/e]:void 0!==i?i/t:void 0!==n?n/e:1}t.s(["default",0,ou],58e3);class og extends oa{constructor(t){let e;const i=void 0!==(t=t||{}).opacity?t.opacity:1,n=void 0!==t.rotation?t.rotation:0;super({opacity:i,rotation:n,scale:void 0!==t.scale?t.scale:1,displacement:void 0!==t.displacement?t.displacement:[0,0],rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,declutterMode:t.declutterMode}),this.anchor_=void 0!==t.anchor?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==t.anchorOrigin?t.anchorOrigin:"top-left",this.anchorXUnits_=void 0!==t.anchorXUnits?t.anchorXUnits:"fraction",this.anchorYUnits_=void 0!==t.anchorYUnits?t.anchorYUnits:"fraction",this.crossOrigin_=void 0!==t.crossOrigin?t.crossOrigin:null;const r=void 0!==t.img?t.img:null;let s=t.src;if(to(!(void 0!==s&&r),"`image` and `src` cannot be provided at the same time"),(void 0===s||0===s.length)&&r&&(s=r.src||A(r)),to(void 0!==s&&s.length>0,"A defined and non-empty `src` or `image` must be provided"),to(void 0===t.width&&void 0===t.height||void 0===t.scale,"`width` or `height` cannot be provided together with `scale`"),void 0!==t.src?e=sj.IDLE:void 0!==r&&(e="complete"in r?r.complete?r.src?sj.LOADED:sj.IDLE:sj.LOADING:sj.LOADED),this.color_=void 0!==t.color?r3(t.color):null,this.iconImage_=s$(r,s,this.crossOrigin_,e,this.color_),this.offset_=void 0!==t.offset?t.offset:[0,0],this.offsetOrigin_=void 0!==t.offsetOrigin?t.offsetOrigin:"top-left",this.origin_=null,this.size_=void 0!==t.size?t.size:null,this.initialOptions_,void 0!==t.width||void 0!==t.height){let e,i;if(t.size)[e,i]=t.size;else{const n=this.getImage(1);if(n.width&&n.height)e=n.width,i=n.height;else if(n instanceof HTMLImageElement){this.initialOptions_=t;const e=()=>{if(this.unlistenImageChange(e),!this.initialOptions_)return;let i=this.iconImage_.getSize();this.setScale(oc(i[0],i[1],t.width,t.height))};this.listenImageChange(e);return}}void 0!==e&&this.setScale(oc(e,i,t.width,t.height))}}clone(){let t,e,i;return this.initialOptions_?(e=this.initialOptions_.width,i=this.initialOptions_.height):t=Array.isArray(t=this.getScale())?t.slice():t,new og({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:i,size:null!==this.size_?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;let e=this.getSize();if("fraction"==this.anchorXUnits_||"fraction"==this.anchorYUnits_){if(!e)return null;t=this.anchor_.slice(),"fraction"==this.anchorXUnits_&&(t[0]*=e[0]),"fraction"==this.anchorYUnits_&&(t[1]*=e[1])}if("top-left"!=this.anchorOrigin_){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),("top-right"==this.anchorOrigin_||"bottom-right"==this.anchorOrigin_)&&(t[0]=-t[0]+e[0]),("bottom-left"==this.anchorOrigin_||"bottom-right"==this.anchorOrigin_)&&(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}let e=this.getDisplacement(),i=this.getScaleArray();return[t[0]-e[0]/i[0],t[1]+e[1]/i[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if("top-left"!=this.offsetOrigin_){let e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),("top-right"==this.offsetOrigin_||"bottom-right"==this.offsetOrigin_)&&(t[0]=i[0]-e[0]-t[0]),("bottom-left"==this.offsetOrigin_||"bottom-right"==this.offsetOrigin_)&&(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){let t=this.getScaleArray();return this.size_?this.size_[0]*t[0]:this.iconImage_.getImageState()==sj.LOADED?this.iconImage_.getSize()[0]*t[0]:void 0}getHeight(){let t=this.getScaleArray();return this.size_?this.size_[1]*t[1]:this.iconImage_.getImageState()==sj.LOADED?this.iconImage_.getSize()[1]*t[1]:void 0}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(a.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(a.CHANGE,t)}ready(){return this.iconImage_.ready()}}t.s(["default",0,og],12206);class of{constructor(t){t=t||{},this.color_=void 0!==t.color?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=void 0!==t.lineDash?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){let t=this.getColor();return new of({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}t.s(["default",0,of],16677);class o_{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=ov,void 0!==t.geometry&&this.setGeometry(t.geometry),this.fill_=void 0!==t.fill?t.fill:null,this.image_=void 0!==t.image?t.image:null,this.renderer_=void 0!==t.renderer?t.renderer:null,this.hitDetectionRenderer_=void 0!==t.hitDetectionRenderer?t.hitDetectionRenderer:null,this.stroke_=void 0!==t.stroke?t.stroke:null,this.text_=void 0!==t.text?t.text:null,this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();return t&&"object"==typeof t&&(t=t.clone()),new o_({geometry:t??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.get
1Stroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=ov,this.geometry_=t}setZIndex(t){this.zIndex_=t}}function op(t){let e;if("function"==typeof t)e=t;else{let i;Array.isArray(t)?i=t:(to("function"==typeof t.getZIndex,"Expected an `Style` or an array of `Style`"),i=[t]),e=function(){return i}}return e}let om=null;function oy(t,e){if(!om){let t=new ou({color:"rgba(255,255,255,0.4)"}),e=new of({color:"#3399CC",width:1.25});om=[new o_({image:new od({fill:t,stroke:e,radius:5}),fill:t,stroke:e})]}return om}function ox(){let t={},e=[255,255,255,1],i=[0,153,255,1];return t.Polygon=[new o_({fill:new ou({color:[255,255,255,.5]})})],t.MultiPolygon=t.Polygon,t.LineString=[new o_({stroke:new of({color:e,width:5})}),new o_({stroke:new of({color:i,width:3})})],t.MultiLineString=t.LineString,t.Circle=t.Polygon.concat(t.LineString),t.Point=[new o_({image:new od({radius:6,fill:new ou({color:i}),stroke:new of({color:e,width:1.5})}),zIndex:1/0})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.LineString,t.Point),t}function ov(t){return t.getGeometry()}t.s(["createDefaultStyle",()=>oy,"createEditingStyle",()=>ox,"default",0,o_,"toFunction",()=>op],17552);class oC{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.keepUpright_=t.keepUpright,this.scale_=t.scale,this.scaleArray_=r8(void 0!==t.scale?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=void 0!==t.fill?t.fill:new ou({color:"#333"}),this.maxAngle_=void 0!==t.maxAngle?t.maxAngle:Math.PI/4,this.placement_=void 0!==t.placement?t.placement:"point",this.overflow_=!!t.overflow,this.stroke_=void 0!==t.stroke?t.stroke:null,this.offsetX_=void 0!==t.offsetX?t.offsetX:0,this.offsetY_=void 0!==t.offsetY?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=void 0===t.padding?null:t.padding,this.declutterMode_=t.declutterMode}clone(){let t=this.getScale();return new oC({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),keepUpright:this.getKeepUpright(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getKeepUpright(){return this.keepUpright_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}
1getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setKeepUpright(t){this.keepUpright_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=r8(void 0!==t?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}function ow(t){return!0}function oE(t){let e=su(),i=t.length,n=Array(i);for(let r=0;r<i;++r)n[r]=oS(t[r],e);let r=sN(),s=Array(i);return function(t,o){if(r.properties=t.getPropertiesInternal(),r.resolution=o,e.featureId){let e=t.getId();void 0!==e?r.featureId=e:r.featureId=null}let a=0;for(let t=0;t<i;++t){let e=n[t](r);e&&(s[a]=e,a+=1)}return s.length=a,s}}function oS(t,e){var i,n,r,s,o,a,l,h;let d,u,c,g,f,_,p,m,y,x,v,C,w,S,R,I,T,b,M,P,L,F,A,D,k,O,G,z,N,U,W,j,B,X,V,K,Y,Z,q,H=oR(t,"",e),$=oI(t,"",e),J=function(t,e){let i="text-",n=ob(t,i+"value",e);if(!n)return null;let r=oR(t,i,e),s=oR(t,i+"background-",e),o=oI(t,i,e),a=oI(t,i+"background-",e),l=ob(t,i+"font",e),h=oT(t,i+"max-angle",e),d=oT(t,i+"offset-x",e),u=oT(t,i+"offset-y",e),c=oM(t,i+"overflow",e),g=ob(t,i+"placement",e),f=oT(t,i+"repeat",e),_=oD(t,i+"scale",e),p=oM(t,i+"rotate-with-view",e),m=oT(t,i+"rotation",e),y=ob(t,i+"align",e),x=ob(t,i+"justify",e),v=ob(t,i+"baseline",e),C=oM(t,i+"keep-upright",e),w=oL(t,i+"padding",e),E=new oC({declutterMode:oz(t,i+"declutter-mode")});return function(t){if(E.setText(n(t)),r&&E.setFill(r(t)),s&&E.setBackgroundFill(s(t)),o&&E.setStroke(o(t)),a&&E.setBackgroundStroke(a(t)),l&&E.setFont(l(t)),h&&E.setMaxAngle(h(t)),d&&E.setOffsetX(d(t)),u&&E.setOffsetY(u(t)),c&&E.setOverflow(c(t)),g){let e=g(t);if("point"!==e&&"line"!==e)throw Error("Expected point or line for text-placement");E.setPlacement(e)}if(f&&E.setRepeat(f(t)),_&&E.setScale(_(t)),p&&E.setRotateWithView(p(t)),m&&E.setRotation(m(t)),y){let e=y(t);if("left"!==e&&"center"!==e&&"right"!==e&&"end"!==e&&"start"!==e)throw Error("Expected left, right, center, start, or end for text-align");E.setTextAlign(e)}if(x){let e=x(t);if("left"!==e&&"right"!==e&&"center"!==e)throw Error("Expected left, right, or center for text-justify");E.setJustify(e)}if(v){let e=v(t);if("bottom"!==e&&"top"!==e&&"middle"!==e&&"alphabetic"!==e&&"hanging"!==e)throw Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");E.setTextBaseline(e)}return w&&E.setPadding(w(t)),C&&E.setKeepUpright(C(t)),E}}(t,e),Q=(i=t,n=e,"icon-src"in i?(r=i,s=n,c=oU(r[u=(d="icon-")+"src"],u),g=oF(r,d+"anchor",s),f=oD(r,d+"scale",s),_=oT(r,d+"opacity",s),p=oF(r,d+"displacement",s),m=oT(r,d+"rotation",s),y=oM(r,d+"rotate-with-view",s),x=oO(r,d+"anchor-origin"),v=oG(r,d+"anchor-x-units"),C=oG(r,d+"anchor-y-units"),w=function(t,e){let i=t[e];if(void 0!==i)return oj(i,e)}(r,d+"color"),S=function(t,e){let i=t[e];if(void 0!==i){if("string"!=typeof i)throw Error(`Expected a string for ${e}`);return i}}(r,d+"cross-origin"),R=function(t,e){let i=t[e];if(void 0!==i)return oN(i,e)}(r,d+"offset"),I=oO(r,d+"offset-origin"),T=ok(r,d+"width"),b=new og({src:c,anchorOrigin:x,anchorXUnits:v,anchorYUnits:C,color:w,crossOrigin:S,offset:R,offsetOrigin:I,height:ok(r,d+"height"),width:T,size:function(t,e){let i=t[e];if(void 0!==i){if("number"==typeof i)return r8(i);if(!Array.isArray(i)||2!==i.length||"number"!=typeof i[0]||"number"!=typeof i[1])throw Error(`Expected a number or size array for ${e}`);return i}}(r,d+"size"),declutterMode:oz(r,d+"declutter-mode")}),function(t){return _&&b.setOpacity(_(t)),p&&b.setDisplacement(p(t)),m&&b.setRotation(m(t)),y&&b.setRotateWithView(y(t)),f&&b.setScale(f(t)),g&&b.setAnchor(g(t)),b}):"shape-points"in i?(o=i,a=n,P=(M="shape-")+"points",L=M+"radius",F=oW(o[P],P),A=oW(o[L],L),D=oR(o,M,a),k=oI(o,M,a),O=oD(o,M+"scale",a),G=oF(o,M+"displacement",a),z=oT(o,M+"rotation",a),N=oM(o,M+"rotate-with-view",a),U=new oh({points:F,radius:A,radiu
1s2:ok(o,M+"radius2"),angle:ok(o,M+"angle"),declutterMode:oz(o,M+"declutter-mode")}),function(t){return D&&U.setFill(D(t)),k&&U.setStroke(k(t)),G&&U.setDisplacement(G(t)),z&&U.setRotation(z(t)),N&&U.setRotateWithView(N(t)),O&&U.setScale(O(t)),U}):"circle-radius"in i?(j=oR(l=i,W="circle-",h=n),B=oI(l,W,h),X=oT(l,W+"radius",h),V=oD(l,W+"scale",h),K=oF(l,W+"displacement",h),Y=oT(l,W+"rotation",h),Z=oM(l,W+"rotate-with-view",h),q=new od({radius:5,declutterMode:oz(l,W+"declutter-mode")}),function(t){return X&&q.setRadius(X(t)),j&&q.setFill(j(t)),B&&q.setStroke(B(t)),K&&q.setDisplacement(K(t)),Y&&q.setRotation(Y(t)),Z&&q.setRotateWithView(Z(t)),V&&q.setScale(V(t)),q}):null),tt=oT(t,"z-index",e);if(!H&&!$&&!J&&!Q&&!E(t))throw Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(t));let te=new o_;return function(t){let e=!0;if(H){let i=H(t);i&&(e=!1),te.setFill(i)}if($){let i=$(t);i&&(e=!1),te.setStroke(i)}if(J){let i=J(t);i&&(e=!1),te.setText(i)}if(Q){let i=Q(t);i&&(e=!1),te.setImage(i)}return(tt&&te.setZIndex(tt(t)),e)?null:te}}function oR(t,e,i){let n;if(e+"fill-pattern-src"in t){var r,s,o;let a,l,h,d;a=ob(r=t,(s=e+"fill-")+"pattern-src",o=i),l=oA(r,s+"pattern-offset",o),h=oA(r,s+"pattern-size",o),d=oP(r,s+"color",o),n=function(t){return{src:a(t),offset:l&&l(t),size:h&&h(t),color:d&&d(t)}}}else{if("none"===t[e+"fill-color"])return t=>null;n=oP(t,e+"fill-color",i)}if(!n)return null;let a=new ou;return function(t){let e=n(t);return e===rj?null:(a.setColor(e),a)}}function oI(t,e,i){let n=oT(t,e+"stroke-width",i),r=oP(t,e+"stroke-color",i);if(!n&&!r)return null;let s=ob(t,e+"stroke-line-cap",i),o=ob(t,e+"stroke-line-join",i),a=oL(t,e+"stroke-line-dash",i),l=oT(t,e+"stroke-line-dash-offset",i),h=oT(t,e+"stroke-miter-limit",i),d=new of;return function(t){if(r){let e=r(t);if(e===rj)return null;d.setColor(e)}if(n&&d.setWidth(n(t)),s){let e=s(t);if("butt"!==e&&"round"!==e&&"square"!==e)throw Error("Expected butt, round, or square line cap");d.setLineCap(e)}if(o){let e=o(t);if("bevel"!==e&&"round"!==e&&"miter"!==e)throw Error("Expected bevel, round, or miter line join");d.setLineJoin(e)}return a&&d.setLineDash(a(t)),l&&d.setLineDashOffset(l(t)),h&&d.setMiterLimit(h(t)),d}}function oT(t,e,i){if(!(e in t))return;let n=sU(t[e],st,i);return function(t){return oW(n(t),e)}}function ob(t,e,i){if(!(e in t))return null;let n=sU(t[e],se,i);return function(t){return oU(n(t),e)}}function oM(t,e,i){if(!(e in t))return null;let n=sU(t[e],r7,i);return function(t){let i=n(t);if("boolean"!=typeof i)throw Error(`Expected a boolean for ${e}`);return i}}function oP(t,e,i){if(!(e in t))return null;let n=sU(t[e],si,i);return function(t){return oj(n(t),e)}}function oL(t,e,i){if(!(e in t))return null;let n=sU(t[e],sn,i);return function(t){return oN(n(t),e)}}function oF(t,e,i){if(!(e in t))return null;let n=sU(t[e],sn,i);return function(t){let i=oN(n(t),e);if(2!==i.length)throw Error(`Expected two numbers for ${e}`);return i}}function oA(t,e,i){if(!(e in t))return null;let n=sU(t[e],sn,i);return function(t){return oB(n(t),e)}}function oD(t,e,i){if(!(e in t))return null;let n=sU(t[e],sn|st,i);return function(t){var i,r;return i=n(t),r=e,"number"==typeof i?i:oB(i,r)}}function ok(t,e){let i=t[e];if(void 0!==i){if("number"!=typeof i)throw Error(`Expected a number for ${e}`);return i}}function oO(t,e){let i=t[e];if(void 0!==i){if("bottom-left"!==i&&"bottom-right"!==i&&"top-left"!==i&&"top-right"!==i)throw Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${e}`);return i}}function oG(t,e){let i=t[e];if(void 0!==i){if("pixels"!==i&&"fraction"!==i)throw Error(`Expected pixels or fraction for ${e}`);return i}}function oz(t,e){let i=t[e];if(void 0!==i){if("string"!=typeof i)throw Error(`Expected a string for ${e}`);if("declutter"!==i&&"obstacle"!==i&&"none"!==i)throw Error(`Expected declutter, obstacle, or none for ${e}`);return i}}function oN(t,e){if(!Array.isArray(t))throw Error(`Expected an array for ${e}`);let i=t.length;for(let n=0;n<i;++n)if("number"!=typeof t[n])throw Error(`Expected an array of numbers for ${e}`);return t}function oU(t,e){if("string"!=typeof t)throw Error(`Expected a string for ${e}`);return t}function oW(t,e){if("number"!=typeof t)throw Error(`Expected a number for ${e}`);return t}function oj(t,e){if("string"==typeof t)return t;let i=oN(t,e),n=i.length;if(n<3||n>4)throw Error(`Expected a color with 3 or 4 values for ${e}`);return i}function oB(t,e){let i=oN(t,e);if(2!==i.length)throw Error(`Expected an array of two numbers for ${e}`);return i}t.s(["default",0,oC],66184);let oX="renderOrder",oV=class extends rb{constructor(t){const e=Object.assign({},t=t||{});delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter?String(t.declutter):void 0,this.renderBuffer_=void 0!==t.renderBuffer?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=void 0!==t.updateWhileAnimating&&t.updateWhileAnimating,this.updateWhileInteracting_=void 0!==t.updateWhileInteracting&&t.updateWhileInteracting}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(oX)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,e){let i=this.getDeclutter();i in t.declutter==!1&&(t.declutter[i]=new rP(9)),this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set(oX,t)}setStyle(t){this.style_=void 0===t?oy:t;let e=function(t){if(void 0===t)return oy;
1if(!t)return null;if("function"==typeof t||t instanceof o_)return t;if(!Array.isArray(t))return oE([t]);if(0===t.length)return[];let e=t.length,i=t[0];if(i instanceof o_){let i=Array(e);for(let n=0;n<e;++n){let e=t[n];if(!(e instanceof o_))throw Error("Expected a list of style instances");i[n]=e}return i}if("style"in i){let i,n,r,s=Array(e);for(let i=0;i<e;++i){let e=t[i];if(!("style"in e))throw Error("Expected a list of rules with a style property");s[i]=e}return n=function(t,e){let i=t.length,n=Array(i);for(let r=0;r<i;++r){let i,s=t[r],o="filter"in s?sU(s.filter,r7,e):ow;if(Array.isArray(s.style)){let t=s.style.length;i=Array(t);for(let n=0;n<t;++n)i[n]=oS(s.style[n],e)}else i=[oS(s.style,e)];n[r]={filter:o,styles:i}}return function(e){let r=[],s=!1;for(let o=0;o<i;++o)if((0,n[o].filter)(e)&&(!t[o].else||!s))for(let t of(s=!0,n[o].styles)){let i=t(e);i&&r.push(i)}return r}}(s,i=su()),r=sN(),function(t,e){if(r.properties=t.getPropertiesInternal(),r.resolution=e,i.featureId){let e=t.getId();void 0!==e?r.featureId=e:r.featureId=null}return i.geometryType&&(r.geometryType=function t(e){if(!e)return"";let i=e.getType();switch(i){case"Point":case"LineString":case"Polygon":return i;case"MultiPoint":case"MultiLineString":case"MultiPolygon":return i.substring(5);case"Circle":return"Polygon";
1case"GeometryCollection":return t(e.getGeometries()[0]);default:return""}}(t.getGeometry())),n(r)}}return oE(t)}(t);this.styleFunction_=null===t?void 0:op(e),this.changed()}setDeclutter(t){this.declutter_=t?String(t):void 0,this.changed()}},oK=class extends S{constructor(t,e,i,n){super(t),this.inversePixelTransform=e,this.frameState=i,this.context=n}};function oY(t,e){sZ.expire()}let oZ=class extends l{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){L()}calculateMatrices2D(t){let e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;iw(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),iE(n,i)}forEachFeatureAtCoordinate(t,e,i,n,r,s,o,a){let l,h=e.viewState;function d(t,e,i,n){return r.call(s,e,t?i:null,n)}let u=h.projection,c=ed(t.slice(),u),g=[[0,0]];if(u.canWrapX()&&n){let t=t1(u.getExtent());g.push([-t,0],[t,0])}let f=e.layerStatesArray,_=f.length,p=[],m=[];for(let n=0;n<g.length;n++)for(let r=_-1;r>=0;--r){let s=f[r],u=s.layer;if(u.hasRenderer()&&rT(s,h)&&o.call(a,u)){let r=u.getRenderer(),o=u.getSource();if(r&&o){let a=o.getWrapX()?c:t,h=d.bind(null,s.managed);m[0]=a[0]+g[n][0],m[1]=a[1]+g[n][1],l=r.forEachFeatureAtCoordinate(m,e,i,h,p)}if(l)return l}}if(0===p.length)return;let y=1/p.length;return p.forEach((t,e)=>t.distanceSq+=e*y),p.sort((t,e)=>t.distanceSq-e.distanceSq),p.some(t=>l=t.callback(t.feature,t.layer,t.geometry)),l}hasFeatureAtCoordinate(t,e,i,n,r,s){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,n,m,this,r,s)}getMap(){return this.map_}renderFrame(t){L()}scheduleExpireIconCache(t){sZ.canExpireCache()&&t.postRenderFunctions.push(oY)}},oq=class extends oZ{constructor(t){super(t),this.fontChangeListenerKey_=I(s9,o,t.redrawText,t),this.element_=document.createElement("div");const e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=nw+" ol-layers";const i=t.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(t,e){let i=this.getMap();if(i.hasListener(t)){let n=new oK(t,void 0,e);i.dispatchEvent(n)}}disposeInternal(){b(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(rR,t);let e=t.layerStatesArray.sort((t,e)=>t.zIndex-e.zIndex);e.some(t=>t.layer instanceof oV&&t.layer.getDeclutter())&&(t.declutter={});let i=t.viewState;this.children_.length=0;let n=[],r=null;for(let s=0,o=e.length;s<o;++s){let o=e[s];t.layerIndex=s;let a=o.layer,l=a.getSourceState();if(!rT(o,i)||"ready"!=l&&"undefined"!=l){a.unrender();continue}let h=a.render(t,r);h&&(h!==r&&(this.children_.push(h),r=h),n.push(o))}this.declutter(t,n),nD(this.element_,this.children_),this.dispatchRenderEvent("postcompose",t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}declutter(t,e){if(t.declutter){for(let i=e.length-1;i>=0;--i){let n=e[i],r=n.layer;r.getDeclutter()&&r.renderDeclutter(t,n)}e.forEach(e=>e.layer.renderDeferred(t))}}},oH=class extends k{constructor(t){super(),t=t||{},this.on,this.once,this.un;const e=function(t){let e,i,n,r=null;void 0!==t.keyboardEventTarget&&(r="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);let s={},o=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new rw({layers:t.layers});return s[te]=o,s[tn]=t.target,s[tr]=t.view instanceof nv?t.view:new nv,void 0!==t.controls&&(Array.isArray(t.controls)?e=new z(t.controls.slice()):(to("function"==typeof t.controls.getArray,"Expected `controls` to be an array or an `ol/Collection.js`"),e=t.controls)),void 0!==t.interactions&&(Array.isArray(t.interactions)?i=new z(t.interactions.slice()):(to("function"==typeof t.interactions.getArray,"Expected `interactions` to be an array or an `ol/Collection.js`"),i=t.interactions)),void 0!==t.overlays?Array.isArray(t.overlays)?n=new z(t.overlays.slice()):(to("function"==typeof t.overlays.getArray,"Expected `overlays` to be an array or an `ol/Collection.js`"),n=t.overlays):n=new z,{controls:e,interactions:i,keyboardEventTarget:r,overlays:n,values:s}}(t);this.renderComplete_=!1,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=void 0!==t.maxTilesLoading?t.maxTilesLoading:16,this.pixelRatio_=void 0!==t.pixelRatio?t.pixelRatio:V,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=ix(),this.pixelToCoordinateTransform_=ix(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.style.position="absolute",this.overlayContainer_.style.zIndex="0",this.overlayContainer_.style.width="100%",this.overlayContainer_.style.height="100%",this.overlayContainer_.style.pointerEvents="none",this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.style.position="absolute",this.overlayContainerStopEvent_.style.zIndex="0",this.overlayContainerStopEvent_.style.width="100%",this.overlayContainerStopEvent_.style.height="100%",this.overlayContainerStopEvent_.style.pointerEvents="none",this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=null,this.moveTolerance_=t.moveTolerance,this.keyboardEventTarget_=e.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,this.resizeObserver_=new ResizeObserver(()=>this.updateSize()),this.controls=e.controls||nN(),this.interactions=e.interactions||function(t){t=t||{};let e=new z,i=new nU(-.005,.05,100);return(void 0===t.altShiftDragRotate||t.altShiftDragRotate)&&e.push(new n4),(void 0===t.doubleClickZoom||t.doubleClickZoom)&&e.push(new nV({delta:t.zoomDelta,duration:t.zoomDuration})),(void 0===t.dragPan||t.dragPan)&&e.push(new n6({onFocusOnly:t.onF
1ocusOnly,kinetic:i})),(void 0===t.pinchRotate||t.pinchRotate)&&e.push(new rl),(void 0===t.pinchZoom||t.pinchZoom)&&e.push(new rh({duration:t.zoomDuration})),(void 0===t.keyboard||t.keyboard)&&(e.push(new rs),e.push(new ro({delta:t.zoomDelta,duration:t.zoomDuration}))),(void 0===t.mouseWheelZoom||t.mouseWheelZoom)&&e.push(new ra({onFocusOnly:t.onFocusOnly,duration:t.zoomDuration})),(void 0===t.shiftDragZoom||t.shiftDragZoom)&&e.push(new re({duration:t.zoomDuration})),e}({onFocusOnly:!0}),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new th(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(te,this.handleLayerGroupChanged_),this.addChangeListener(tr,this.handleViewChanged_),this.addChangeListener(ti,this.handleSizeChanged_),this.addChangeListener(tn,this.handleTargetChanged_),this.setProperties(e.values);const i=this;!t.view||t.view instanceof nv||t.view.then(function(t){i.setView(new nv(t))}),this.controls.addEventListener(s.ADD,t=>{t.element.setMap(this)}),this.controls.addEventListener(s.REMOVE,t=>{t.element.setMap(null)}),this.interactions.addEventListener(s.ADD,t=>{t.element.setMap(this)}),this.interactions.addEventListener(s.REMOVE,t=>{t.element.setMap(null)}),this.overlays_.addEventListener(s.ADD,t=>{this.addOverlayInternal_(t.element)}),this.overlays_.addEventListener(s.REMOVE,t=>{let e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}),this.controls.forEach(t=>{t.setMap(this)}),this.interactions.forEach(t=>{t.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){!function t(e,i){if(e instanceof rb)return void e.setMapInternal(i);if(e instanceof rw){let n=e.getLayers().getArray();for(let e=0,r=n.length;e<r;++e)t(n[e],i)}}(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){let e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(t,e,i){if(!this.frameState_||!this.renderer_)return;let n=this.getCoordinateFromPixelInternal(t),r=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,s=void 0!==i.layerFilter?i.layerFilter:m,o=!1!==i.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,r,o,e,null,s,null)}getFeaturesAtPixel(t,e){let i=[];return this.forEachFeatureAtPixel(t,function(t){i.push(t)},e),i}getAllLayers(){let t=[];return!function e(i){i.forEach(function(i){i instanceof rw?e(i.getLayers()):t.push(i)})}(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;let i=this.getCoordinateFromPixelInternal(t),n=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:m,r=void 0!==e.hitTolerance?e.hitTolerance:0,s=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,r,s,n,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){let e=this.viewport_.getBoundingClientRect(),i=this.getSize(),n=e.width/i[0],r=e.height/i[1],s="changedTouches"in t?t.changedTouches[0]:t;return[(s.clientX-e.left)/n,(s.clientY-e.top)/r]}getTarget(){return this.get(tn)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){var e,i;return e=this.getCoordinateFromPixelInternal(t),i=this.getView().getProjection(),e}getCoordinateFromPixelInternal(t){let e=this.frameState_;return e?iC(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){let e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(te)}setLayers(t){let e=this.getLayerGroup();if(t instanceof z)return void e.setLayers(t);let i=e.getLayers();i.clear(),i.extend(t)}
1getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){let t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e<i;++e){let i=t[e];if(!i.visible)continue;let n=i.layer.getRenderer();if(n&&!n.ready)return!0;let r=i.layer.getSource();if(r&&r.loading)return!0}return!1}getPixelFromCoordinate(t){let e=ig(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)}getPixelFromCoordinateInternal(t){let e=this.frameState_;return e?iC(e.coordinateToPixelTransform,t.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(ti)}getView(){return this.get(tr)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){let t=this.getTargetElement();return t?t.ownerDocument:document}getTilePriority(t,e,i,n){return function(t,e,i,n,r){if(!t||!(i in t.wantedTiles)||!t.wantedTiles[i][e.getKey()])return ta;let s=t.viewState.center,o=n[0]-s[0],a=n[1]-s[1];return 65536*Math.log(r)+Math.sqrt(o*o+a*a)/r}(this.frameState_,t,e,i,n)}handleBrowserEvent(t,e){let i=new U(e=e||t.type,this,t);this.handleMapBrowserEvent(i)}handleMapBrowserEvent(t){if(!this.frameState_)return;let e=t.originalEvent,i=e.type;if(i===H||i===a.WHEEL||i===a.KEYDOWN){let t=this.getOwnerDocument(),i=this.viewport_.getRootNode?this.viewport_.getRootNode():t,n=e.target,r=i instanceof ShadowRoot?i.host===n?i.host.ownerDocument:i:i===t?t.documentElement:i;if(this.overlayContainerStopEvent_.contains(n)||!r.contains(n))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t)){let e=this.getInteractions().getArray().slice();for(let i=e.length-1;i>=0;i--){let n=e[i];if(n.getMap()===this&&n.getActive()&&this.getTargetElement()&&(!n.handleEvent(t)||t.propagationStopped))break}}}handlePostRender(){let t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let i=this.maxTilesLoading_,n=i;if(t){let e=t.viewHints;if(e[0]||e[1]){let e=Date.now()-t.time>8;i=8*!e,n=2*!e}}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,n))}t&&this.renderer_&&!t.animate&&(this.renderComplete_?(this.hasListener(rI)&&this.renderer_.dispatchRenderEvent(rI,t),!1===this.loaded_&&(this.loaded_=!0,this.dispatchEvent(new N(tt,this,t)))):!0===this.loaded_&&(this.loaded_=!1,this.dispatchEvent(new N(Q,this,t))));let i=this.postRenderFunctions_;if(t)for(let e=0,n=i.length;e<n;++e)i[e](this,t);i.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let t=0,e=this.targetChangeHandlerKeys_.length;t<e;++t)b(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(a.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(a.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_){this.resizeObserver_.unobserve(this.targetElement_);let t=this.targetElement_.getRootNode();t instanceof ShadowRoot&&this.resizeObserver_.unobserve(t.host),this.setSize(void 0)}let t=this.getTarget(),e="string"==typeof t?document.getElementById(t):t;if(this.targetElement_=e,e){let t;for(let t in e.appendChild(this.viewport_),this.renderer_||(this.renderer_=new oq(this)),this.mapBrowserEventHandler_=new $(this,this.moveTolerance_),W)this.mapBrowserEventHandler_.addEventListener(W[t],this.handleMapBrowserEvent.bind(this));if(this.viewport_.addEventListener(a.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(a.WHEEL,this.boundHandleBrowserEvent_,!!q&&{passive:!1}),this.keyboardEventTarget_)t=this.keyboardEventTarget_;else{let i=e.getRootNode();t=i instanceof ShadowRoot?i.host:e}this.targetChangeHandlerKeys_=[I(t,a.KEYDOWN,this.handleBrowserEvent,this),I(t,a.KEYPRESS,this.handleBrowserEvent,this)];let i=e.getRootNode();i instanceof ShadowRoot&&this.resizeObserver_.observe(i.host),this.resizeObserver_.observe(e)}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(b(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(b(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);let t=this.getView();t&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=I(t,o,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=I(t,a.CHANGE,this.handleViewPropertyChanged_,this),t.resolve
1Constraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(b),this.layerGroupPropertyListenerKeys_=null);let t=this.getLayerGroup();t&&(this.handleLayerAdd_(new rv("addlayer",t)),this.layerGroupPropertyListenerKeys_=[I(t,o,this.render,this),I(t,a.CHANGE,this.render,this),I(t,"addlayer",this.handleLayerAdd_,this),I(t,"removelayer",this.handleLayerRemove_,this)]),this.render()}isRendered(){return!!this.frameState_}animationDelay_(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}renderSync(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()}redrawText(){if(!this.frameState_)return;let t=this.frameState_.layerStatesArray;for(let e=0,i=t.length;e<i;++e){let i=t[e].layer;i.hasRenderer()&&i.getRenderer().handleFontsChanged()}}render(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}removeControl(t){return this.getControls().remove(t)}removeInteraction(t){return this.getInteractions().remove(t)}removeLayer(t){return this.getLayerGroup().getLayers().remove(t)}handleLayerRemove_(t){!function t(e){e instanceof rb?e.setMapInternal(null):e instanceof rw&&e.getLayers().forEach(t)}(t.layer)}removeOverlay(t){return this.getOverlays().remove(t)}renderFrame_(t){let e=this.getSize(),i=this.getView(),n=this.frameState_,r=null;if(void 0!==e&&r6(e)&&i&&i.isDef()){let n=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),s=i.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutter:null,extent:tq(s.center,s.resolution,s.rotation,e),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:e,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:s,viewHints:n,wantedTiles:{},mapId:A(this),renderTargets:{}},s.nextCenter&&s.nextResolution){let t=isNaN(s.nextRotation)?s.rotation:s.nextRotation;r.nextExtent=tq(s.nextCenter,s.nextResolution,t,e)}}this.frameState_=r,this.renderer_.renderFrame(r),r&&(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),n&&(this.previousExtent_&&(t3(this.previousExtent_)||tN(r.extent,this.previousExtent_))||(this.dispatchEvent(new N("movestart",this,n)),this.previousExtent_=tO(this.previousExtent_))),!this.previousExtent_||r.viewHints[0]||r.viewHints[1]||tN(r.extent,this.previousExtent_)||(this.dispatchEvent(new N("moveend",this,r)),tb(r.extent,this.previousExtent_))),this.dispatchEvent(new N(J,this,r)),this.renderComplete_=(this.hasListener(Q)||this.hasListener(tt)||this.hasListener(rI))&&!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady(),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){let e=this.getLayerGroup();e&&this.handleLayerRemove_(new rv("removelayer",e)),this.set(te,t)}setSize(t){this.set(ti,t)}setTarget(t){this.set(tn,t)}setView(t){if(!t||t instanceof nv)return void this.set(tr,t);this.set(tr,new nv);let e=this;t.then(function(t){e.setView(new nv(t))})}updateSize(){let t,e=this.getTargetElement();if(e){let i=getComputedStyle(e),n=e.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),r=e.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);!isNaN(n)&&!isNaN(r)&&!r6(t=[Math.max(0,n),Math.max(0,r)])&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&ey("No map visible because the map container's width or height are 0.")}let i=this.getSize();!t||i&&_(t,i)||(this.setSize(t),this.updateViewportSize_(t))}updateViewportSize_(t){let e=this.getView();e&&e.setViewportSize(t)}};t.s(["default",0,oH],77011);let o$=class{drawCustom(t,e,i,n,r){}drawGeometry(t){}setStyle(t){}drawCircle(t,e,i){}drawFeature(t,e,i){}
1drawGeometryCollection(t,e,i){}drawLineString(t,e,i){}drawMultiLineString(t,e,i){}drawMultiPoint(t,e,i){}drawMultiPolygon(t,e,i){}drawPoint(t,e,i){}drawPolygon(t,e,i){}drawText(t,e,i){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}},oJ=0,oQ=1,o0=2,o1=3,o2=4,o3=5,o5=6,o6=7,o4=8,o8=9,o9=10,o7=11,at=12,ae=[o4],ai=[at],an=[oQ],ar=[o1],as=class extends o${constructor(t,e,i,n){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=n,this.maxLineWidth=0,this.resolution=i,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(t){let e=this.pixelRatio;return 1==e?t:t.map(function(t){return t*e})}appendFlatPointCoordinates(t,e){let i=this.getBufferedMaxExtent(),n=this.tmpCoordinate_,r=this.coordinates,s=r.length;for(let o=0,a=t.length;o<a;o+=e)n[0]=t[o],n[1]=t[o+1],tP(i,n)&&(r[s++]=n[0],r[s++]=n[1]);return s}appendFlatLineCoordinates(t,e,i,n,r,s){let o,a,l,h=this.coordinates,d=h.length,u=this.getBufferedMaxExtent();s&&(e+=n);let c=t[e],g=t[e+1],f=this.tmpCoordinate_,_=!0;for(o=e+n;o<i;o+=n)f[0]=t[o],f[1]=t[o+1],(l=tA(u,f))!==a?(_&&(h[d++]=c,h[d++]=g,_=!1),h[d++]=f[0],h[d++]=f[1]):1===l?(h[d++]=f[0],h[d++]=f[1],_=!1):_=!0,c=f[0],g=f[1],a=l;return(r&&_||o===e+n)&&(h[d++]=c,h[d++]=g),d}drawCustomCoordinates_(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){let o=i[s],a=this.appendFlatLineCoordinates(t,e,o,n,!1,!1);r.push(a),e=o}return e}drawCustom(t,e,i,n,r){let s,o,a,l,h;this.beginGeometry(t,e,r);let d=t.getType(),u=t.getStride(),c=this.coordinates.length;switch(d){case"MultiPolygon":s=t.getOrientedFlatCoordinates(),l=[];let g=t.getEndss();h=0;for(let t=0,e=g.length;t<e;++t){let e=[];h=this.drawCustomCoordinates_(s,h,g[t],u,e),l.push(e)}this.instructions.push([o2,c,l,t,i,i$,r]),this.hitDetectionInstructions.push([o2,c,l,t,n||i,i$,r]);break;case"Polygon":case"MultiLineString":a=[],s="Polygon"==d?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),h=this.drawCustomCoordinates_(s,0,t.getEnds(),u,a),this.instructions.push([o2,c,a,t,i,iH,r]),this.hitDetectionInstructions.push([o2,c,a,t,n||i,iH,r]);break;case"LineString":case"Circle":s=t.getFlatCoordinates(),o=this.appendFlatLineCoordinates(s,0,s.length,u,!1,!1),this.instructions.push([o2,c,o,t,i,iq,r]),this.hitDetectionInstructions.push([o2,c,o,t,n||i,iq,r]);break;case"MultiPoint":s=t.getFlatCoordinates(),(o=this.appendFlatPointCoordinates(s,u))>c&&(this.instructions.push([o2,c,o,t,i,iq,r]),this.hitDetectionInstructions.push([o2,c,o,t,n||i,iq,r]));break;case"Point":s=t.getFlatCoordinates(),this.coordinates.push(s[0],s[1]),o=this.coordinates.length,this.instructions.push([o2,c,o,t,i,void 0,r]),this.hitDetectionInstructions.push([o2,c,o,t,n||i,void 0,r])}this.endGeometry(e)}beginGeometry(t,e,i){this.beginGeometryInstruction1_=[oJ,e,0,t,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[oJ,e,0,t,i],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){let t,e,i,n=this.hitDetectionInstructions;n.reverse();let r=n.length,s=-1;for(t=0;t<r;++t)(i=(e=n[t])[0])==o6?s=t:i==oJ&&(e[2]=t,g(this.hitDetectionInstructions,s,t),s=-1)}fillStyleToState(t,e={}){if(t){let i=t.getColor();e.fillPatternScale=i&&"object"==typeof i&&"src"in i?this.pixelRatio:1,e.fillStyle=sJ(i||s0)}else e.fillStyle=void 0;return e}strokeStyleToState(t,e={}){if(t){e.strokeStyle=sJ(t.getColor()||s5);let i=t.getLineCap();e.lineCap=void 0!==i?i:s1;let n=t.getLineDash();e.lineDash=n?n.slice():s2,e.lineDashOffset=t.getLineDashOffset()||0;let r=t.getLineJoin();e.lineJoin=void 0!==r?r:s3;let s=t.getWidth();e.lineWidth=void 0!==s?s:1;let o=t.getMiterLimit();e.miterLimit=void 0!==o?o:10,e.lineWidth>this.maxLineWidth&&(this.maxLineWidth=e.lineWidth,this.bufferedMaxExtent_=null)}else e.strokeStyle=void 0,e.lineCap=void 0,e.lineDash=null,e.lineDashOffset=void 0,e.lineJoin=void 0,e.lineWidth=void 0,e.miterLimit=void 0;return e}setFillStrokeStyle(t,e){let i=this.state;this.fillStyleToState(t,i),this.strokeStyleToState(e,i)}createFill(t){let e=t.fillStyle,i=[o9,e];return"string"!=typeof e&&i.push(t.fillPatternScale),i}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[o7,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,t.lineDash?this.applyPixelRatio(t.lineDash):null,t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){let i=t.fillStyle;("string"!=typeof i||t.currentFillStyle!=i)&&(this.instructions.push(e.call(this,t)),t.currentFillStyle=i)}updateStrokeStyle(t,e){let i=t.strokeStyle,n=t.lineCap,r=t.lineDash,s=t.lineDashOffset,o=t.lineJoin,a=t.lineWidth,l=t.miterLimit;t.currentStrokeStyle==i&&t.currentLineCap==n&&(r==t.currentLineDash||_(t.currentLineDash,r))&&t.currentLineDashOffset==s&&t.currentLineJoin==o&&t.currentLineWidth==a&&t.currentMiterLimit==l||(e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=r,t.currentLineDashOffset=s,t.currentLineJoin=o,t.currentLineWidth=a,t.currentMiterLimit=l)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;let e=[o6,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=tb(this.maxExtent),this.maxLineWidth>0)){let t=this.resolution*(this.maxLineWidth+1)/2;tT(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}},ao=class extends as{constructor(t,e,i,n){super(t,e,i,n),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e,i){if(!this.image_||this.maxExtent&&!tP(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,e,i);let n=t.getFlatCoordinates(),r=t.getStride(),s=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([o5,s,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.
1ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([o5,s,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e,i){if(!this.image_)return;this.beginGeometry(t,e,i);let n=t.getFlatCoordinates(),r=[];for(let e=0,i=n.length;e<i;e+=t.getStride())(!this.maxExtent||tP(this.maxExtent,n.slice(e,e+2)))&&r.push(n[e],n[e+1]);let s=this.coordinates.length,o=this.appendFlatPointCoordinates(r,2);this.instructions.push([o5,s,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([o5,s,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(t,e){let i=t.getAnchor(),n=t.getSize(),r=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=r[0],this.originY_=r[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}},aa=class extends as{constructor(t,e,i,n){super(t,e,i,n)}drawFlatCoordinates_(t,e,i,n){let r=this.coordinates.length,s=this.appendFlatLineCoordinates(t,e,i,n,!1,!1),o=[o8,r,s];return this.instructions.push(o),this.hitDetectionInstructions.push(o),i}drawLineString(t,e,i){let n=this.state,r=n.strokeStyle,s=n.lineWidth;if(void 0===r||void 0===s)return;this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e,i),this.hitDetectionInstructions.push([o7,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,s2,0],an);let o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(ai),this.endGeometry(e)}drawMultiLineString(t,e,i){let n=this.state,r=n.strokeStyle,s=n.lineWidth;if(void 0===r||void 0===s)return;this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e,i),this.hitDetectionInstructions.push([o7,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,s2,0],an);let o=t.getEnds(),a=t.getFlatCoordinates(),l=t.getStride(),h=0;for(let t=0,e=o.length;t<e;++t)h=this.drawFlatCoordinates_(a,h,o[t],l);this.hitDetectionInstructions.push(ai),this.endGeometry(e)}finish(){let t=this.state;return void 0!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&this.instructions.push(ai),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(t){void 0!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(ai),t.lastStroke=this.coordinates.length),t.lastStroke=0,super.applyStroke(t),this.instructions.push(an)}},al=class extends as{constructor(t,e,i,n){super(t,e,i,n)}drawFlatCoordinatess_(t,e,i,n){let r=this.state,s=void 0!==r.fillStyle,o=void 0!==r.strokeStyle,a=i.length;this.instructions.push(an),this.hitDetectionInstructions.push(an);for(let r=0;r<a;++r){let s=i[r],a=this.coordinates.length,l=this.appendFlatLineCoordinates(t,e,s,n,!0,!o),h=[o8,a,l];this.instructions.push(h),this.hitDetectionInstructions.push(h),o&&(this.instructions.push(ar),this.hitDetectionInstructions.push(ar)),e=s}return s&&(this.instructions.push(ae),this.hitDetectionInstructions.push(ae)),o&&(this.instructions.push(ai),this.hitDetectionInstructions.push(ai)),e}drawCircle(t,e,i){let n=this.state,r=n.fillStyle,s=n.strokeStyle;if(void 0===r&&void 0===s)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,i),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([o9,s0]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([o7,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,s2,0]);let o=t.getFlatCoordinates(),a=t.getStride(),l=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,a,!1,!1);let h=[o0,l];this.instructions.push(an,h),this.hitDetectionInstructions.push(an,h),void 0!==n.fillStyle&&(this.instructions.push(ae),this.hitDetectionInstructions.push(ae)),void 0!==n.strokeStyle&&(this.instructions.push(ai),this.hitDetectionInstructions.push(ai)),this.endGeometry(e)}drawPolygon(t,e,i){let n=this.state,r=n.fillStyle,s=n.strokeStyle;if(void 0===r&&void 0===s)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,i),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([o9,s0]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([o7,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,s2,0]);let o=t.getEnds(),a=t.getOrientedFlatCoordinates(),l=t.getStride();this.drawFlatCoordinatess_(a,0,o,l),this.endGeometry(e)}drawMultiPolygon(t,e,i){let n=this.state,r=n.fillStyle,s=n.strokeStyle;if(void 0===r&&void 0===s)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,i),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([o9,s0]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([o7,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,s2,0]);let o=t.getEndss(),a=t.getOrientedFlatCoordinates(),l=t.getStride(),h=0;for(let t=0,e=o.length;t<e;++t)h=this.drawFlatCoordinatess_(a,h,o[t],l);this.endGeometry(e)}finish(){this.reverseHitDetectionInstructions(),this.state=null;let t=this.tolerance;if(0!==t){let e=this.coordinates;for(let i=0,n=e.length;i<n;++i)e[i]=i0(e[i],t)}return super.finish()}setFillStrokeStyles_(){let t=this.state;this.updateFillStyle(t,this.createFill),this.updateStrokeStyle(t,this.applyStroke)}},ah={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},ad=class extends as{constructor(t,e,i,n){super(t,e,i,n),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textKeepUpright_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[s0]={fillStyle:s0},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){let t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e,i){let n=this.textFillState_,r=this.textStrokeState_,s=this.textState_;if(""===this.text_||!s||!n&&!r)return;let o=this.coordinates,a=o.length,l=t.getType(),h=null,d=t.getStride();if("line"===s.placement&&("LineString"==l||"MultiLineString"==l||"Polygon"==l||"MultiPolygon"==l)){let n;if(!t2(this.maxExtent,t.getExtent()))return;if(h=t.getFlatCoordinates(),"LineString"==l)n=[h.length];else if("MultiLineString"==l)n=t.getEnds();else if("Polygon"==l)n=t.getEnds().slice(0,1);else if("MultiPolygon"==l){let e=t.getEndss();n=[];for(let t=0,i=e.length;t<i;++t)n.push(e[t][0])}this.beginGeometry(t,e,i);let r=s.repeat,u=r?void 0:s.textAlign,c=0;for(let t=0,e=n.length;t<e;++t){let e;
1e=r?function(t,e,i,n,r){let s=[],o=i,a=0,l=e.slice(i,2);for(;a<t&&o+r<n;){let[i,n]=l.slice(-2),h=e[o+r],d=e[o+r+1],u=Math.sqrt((h-i)*(h-i)+(d-n)*(d-n));if((a+=u)>=t){let e=(t-a+u)/u,c=i+e*(h-i),g=n+e*(d-n);l.push(c,g),s.push(l),l=[c,g],a==t&&(o+=r),a=0}else if(a<t)l.push(e[o+r],e[o+r+1]),o+=r;else{let t=u-a,e=i+t/u*(h-i),c=n+t/u*(d-n);l.push(e,c),s.push(l),l=[e,c],a=0,o+=r}}return a>0&&s.push(l),s}(r*this.resolution,h,c,n[t],d):[h.slice(c,n[t])];for(let i=0,r=e.length;i<r;++i){let r=e[i],l=0,h=r.length;if(void 0==u){let t=function(t,e,i,n,r){let s,o,a,l,h,d,u,c,g,f=0,_=0,p=0,m=0,y=0;for(s=0;s<n;s+=2){let i=e[s],n=e[s+1];void 0!==l&&(a=Math.sqrt((c=i-l)*c+(g=n-h)*g),void 0!==d&&(m+=o,Math.acos((d*c+u*g)/(o*a))>t&&(m>p&&(p=m,f=y,_=s),m=0,y=s-2)),o=a,d=c,u=g),l=i,h=n}return(m+=a)>p?[y,s]:[f,_]}(s.maxAngle,r,0,r.length,0);l=t[0],h=t[1]}for(let t=l;t<h;t+=d)o.push(r[t],r[t+1]);let g=o.length;c=n[t],this.drawChars_(a,g),a=g}}this.endGeometry(e)}else{let n=s.overflow?null:[];switch(l){case"Point":case"MultiPoint":h=t.getFlatCoordinates();break;case"LineString":h=t.getFlatMidpoint();break;case"Circle":h=t.getCenter();break;case"MultiLineString":h=t.getFlatMidpoints(),d=2;break;case"Polygon":h=t.getFlatInteriorPoint(),s.overflow||n.push(h[2]/this.resolution),d=3;break;case"MultiPolygon":let r=t.getFlatInteriorPoints();h=[];for(let t=0,e=r.length;t<e;t+=3)s.overflow||n.push(r[t+2]/this.resolution),h.push(r[t],r[t+1]);if(0===h.length)return;d=2}let u=this.appendFlatPointCoordinates(h,d);if(u===a)return;if(n&&(u-a)/2!=h.length/d){let t=a/2;n=n.filter((e,i)=>{let n=o[(t+i)*2]===h[i*d]&&o[(t+i)*2+1]===h[i*d+1];return!n&&--t,n})}this.saveTextStates_();let c=s.backgroundFill?this.createFill(this.fillStyleToState(s.backgroundFill)):null,g=s.backgroundStroke?this.createStroke(this.strokeStyleToState(s.backgroundStroke)):null;this.beginGeometry(t,e,i);let f=s.padding;if(f!=s8&&(s.scale[0]<0||s.scale[1]<0)){let t=s.padding[0],e=s.padding[1],i=s.padding[2],n=s.padding[3];s.scale[0]<0&&(e=-e,n=-n),s.scale[1]<0&&(t=-t,i=-i),f=[t,e,i,n]}let _=this.pixelRatio;this.instructions.push([o5,a,u,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,f==s8?s8:f.map(function(t){return t*_}),c,g,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,n]);let p=1/_,m=c?c.slice(0):null;m&&(m[1]=s0),this.hitDetectionInstructions.push([o5,a,u,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[p,p],NaN,this.declutterMode_,this.declutterImageWithText_,f,m,g,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?s0:this.fillKey_,this.textOffsetX_,this.textOffsetY_,n]),this.endGeometry(e)}}saveTextStates_(){let t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,n=this.strokeKey_;!t||n in this.strokeStates||(this.strokeStates[n]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash});let r=this.textKey_;r in this.textStates||(this.textStates[r]={font:e.font,textAlign:e.textAlign||s6,justify:e.justify,textBaseline:e.textBaseline||s4,scale:e.scale});let s=this.fillKey_;!i||s in this.fillStates||(this.fillStates[s]={fillStyle:i.fillStyle})}drawChars_(t,e){let i=this.textStrokeState_,n=this.textState_,r=this.strokeKey_,s=this.textKey_,o=this.fillKey_;this.saveTextStates_();let a=this.pixelRatio,l=ah[n.textBaseline],h=this.textOffsetY_*a,d=this.text_,u=i?i.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([o3,t,e,l,n.overflow,o,n.maxAngle,a,h,r,u*a,d,s,1,this.declutterMode_,this.textKeepUpright_]),this.hitDetectionInstructions.push([o3,t,e,l,n.overflow,o?s0:o,n.maxAngle,a,h,r,u*a,d,s,1/a,this.declutterMode_,this.textKeepUpright_])}setTextStyle(t,e){let i,n,r;
1if(t){let e=t.getFill();e?((n=this.textFillState_)||(n={},this.textFillState_=n),n.fillStyle=sJ(e.getColor()||s0)):(n=null,this.textFillState_=n);let s=t.getStroke();if(s){(r=this.textStrokeState_)||(r={},this.textStrokeState_=r);let t=s.getLineDash(),e=s.getLineDashOffset(),i=s.getWidth(),n=s.getMiterLimit();r.lineCap=s.getLineCap()||s1,r.lineDash=t?t.slice():s2,r.lineDashOffset=void 0===e?0:e,r.lineJoin=s.getLineJoin()||s3,r.lineWidth=void 0===i?1:i,r.miterLimit=void 0===n?10:n,r.strokeStyle=sJ(s.getColor()||s5)}else r=null,this.textStrokeState_=r;i=this.textState_;let o=t.getFont()||sQ;oi(o);let a=t.getScaleArray();i.overflow=t.getOverflow(),i.font=o,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.repeat=t.getRepeat(),i.justify=t.getJustify(),i.textBaseline=t.getTextBaseline()||s4,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||s8,i.scale=void 0===a?[1,1]:a;let l=t.getOffsetX(),h=t.getOffsetY(),d=t.getRotateWithView(),u=t.getKeepUpright(),c=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===l?0:l,this.textOffsetY_=void 0===h?0:h,this.textRotateWithView_=void 0!==d&&d,this.textKeepUpright_=void 0===u||u,this.textRotation_=void 0===c?0:c,this.strokeKey_=r?("string"==typeof r.strokeStyle?r.strokeStyle:A(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.repeat||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=n&&n.fillStyle?"string"==typeof n.fillStyle?n.fillStyle:"|"+A(n.fillStyle):""}else this.text_="";this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}},au={Circle:al,Default:as,Image:ao,LineString:aa,Polygon:al,Text:ad},ac=class{constructor(t,e,i,n){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=n,this.resolution_=i,this.buildersByZIndex_={}}finish(){let t={};for(let e in this.buildersByZIndex_){t[e]=t[e]||{};let i=this.buildersByZIndex_[e];for(let n in i){let r=i[n].finish();t[e][n]=r}}return t}getBuilder(t,e){let i=void 0!==t?t.toString():"0",n=this.buildersByZIndex_[i];void 0===n&&(n={},this.buildersByZIndex_[i]=n);let r=n[e];return void 0===r&&(r=new au[e](this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=r),r}};function ag(t,e,i,n){let r=t[e],s=t[e+1],o=0;for(let a=e+n;a<i;a+=n){let e=t[a],i=t[a+1];o+=Math.sqrt((e-r)*(e-r)+(i-s)*(i-s)),r=e,s=i}return o}let af=class{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(nP(),{get:(t,e)=>{if("function"==typeof nP()[e])return this.push_(e),this.pushMethodArgs_},set:(t,e,i)=>(this.push_(e,i),!0)})}push_(...t){let e=this.instructions_,i=this.zIndex+this.offset_;e[i]||(e[i]=[]),e[i].push(...t)}pushMethodArgs_=(...t)=>(this.push_(t),this);pushFunction(t){this.push_(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach(e=>{for(let i=0,n=e.length;i<n;++i){let n=e[i];if("function"==typeof n){n(t);continue}let r=e[++i];if("function"==typeof t[n])t[n](...r);else{if("function"==typeof r){t[n]=r(t);continue}t[n]=r}}})}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}},a_=tD(),ap=[],am=[],ay=[],ax=[];function av(t){return t[3].declutterBox}let aC=RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function aw(t,e){return"start"===e?e=aC.test(t)?"right":"left":"end"===e&&(e=aC.test(t)?"left":"right"),ah[e]}function aE(t,e,i){return i>0&&t.push("\n",""),t.push(e,""),t}function aS(t,e,i){return i%2==0&&(t+=e),t}let aR=class{constructor(t,e,i,n,r){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignAndScaleFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=ix(),this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=r?new af:null}getZIndexContext(){return this.zIndexContext_}createLabel(t,e,i,n){let r,s=t+e+i+n;
1if(this.labels_[s])return this.labels_[s];let o=n?this.strokeStates[n]:null,a=i?this.fillStates[i]:null,l=this.textStates[e],h=this.pixelRatio,d=[l.scale[0]*h,l.scale[1]*h],u=l.justify?ah[l.justify]:aw(Array.isArray(t)?t[0]:t,l.textAlign||s6),c=n&&o.lineWidth?o.lineWidth:0,g=Array.isArray(t)?t:String(t).split("\n").reduce(aE,[]),{width:f,height:_,widths:p,heights:m,lineWidths:y}=function(t,e){let i=[],n=[],r=[],s=0,o=0,a=0,l=0;for(let h=0,d=e.length;h<=d;h+=2){let u=e[h];if("\n"===u||h===d){s=Math.max(s,o),r.push(o),o=0,a+=l,l=0;continue}let c=e[h+1]||t.font,g=or(c,u).width;i.push(g),o+=g;let f=on(c);n.push(f),l=Math.max(l,f)}return{width:s,height:a,widths:i,heights:n,lineWidths:r}}(l,g),x=f+c,v=[],C=(x+2)*d[0],w=(_+c)*d[1],E={width:C<0?Math.floor(C):Math.ceil(C),height:w<0?Math.floor(w):Math.ceil(w),contextInstructions:v};(1!=d[0]||1!=d[1])&&v.push("scale",d),n&&(v.push("strokeStyle",o.strokeStyle),v.push("lineWidth",c),v.push("lineCap",o.lineCap),v.push("lineJoin",o.lineJoin),v.push("miterLimit",o.miterLimit),v.push("setLineDash",[o.lineDash]),v.push("lineDashOffset",o.lineDashOffset)),i&&v.push("fillStyle",a.fillStyle),v.push("textBaseline","middle"),v.push("textAlign","center");let S=.5-u,R=u*x+S*c,I=[],T=[],b=0,M=0,P=0,L=0;for(let t=0,e=g.length;t<e;t+=2){let e=g[t];if("\n"===e){M+=b,b=0,R=u*x+S*c,++L;continue}let s=g[t+1]||l.font;s!==r&&(n&&I.push("font",s),i&&T.push("font",s),r=s),b=Math.max(b,m[P]);let o=[e,R+S*p[P]+u*(p[P]-y[L]),.5*(c+b)+M];R+=p[P],n&&I.push("strokeText",o),i&&T.push("fillText",o),++P}return Array.prototype.push.apply(v,I),Array.prototype.push.apply(v,T),this.labels_[s]=E,E}replayTextBackground_(t,e,i,n,r,s,o){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,n),t.lineTo.apply(t,r),t.lineTo.apply(t,e),s&&(this.alignAndScaleFill_=s[2],t.fillStyle=s[1],this.fill_(t)),o&&(this.setStrokeStyle_(t,o),t.stroke())}calculateImageOrLabelDimensions_(t,e,i,n,r,s,o,a,l,h,d,u,c,g,f,_){let p;o*=u[0],a*=u[1];let m=i-o,y=n-a,x=r+l>t?t-l:r,v=s+h>e?e-h:s,C=g[3]+x*u[0]+g[1],w=g[0]+v*u[1]+g[2],E=m-g[3],S=y-g[0];return(f||0!==d)&&(ap[0]=E,ax[0]=E,ap[1]=S,am[1]=S,am[0]=E+C,ay[0]=am[0],ay[1]=S+w,ax[1]=ay[1]),0!==d?(iC(p=iw(ix(),i,n,1,1,d,-i,-n),ap),iC(p,am),iC(p,ay),iC(p,ax),tk(Math.min(ap[0],am[0],ay[0],ax[0]),Math.min(ap[1],am[1],ay[1],ax[1]),Math.max(ap[0],am[0],ay[0],ax[0]),Math.max(ap[1],am[1],ay[1],ax[1]),a_)):tk(Math.min(E,E+C),Math.min(S,S+w),Math.max(E,E+C),Math.max(S,S+w),a_),c&&(m=Math.round(m),y=Math.round(y)),{drawImageX:m,drawImageY:y,drawImageW:x,drawImageH:v,originX:l,originY:h,declutterBox:{minX:a_[0],minY:a_[1],maxX:a_[2],maxY:a_[3],value:_},canvasTransform:p,scale:u}}replayImageOrLabel_(t,e,i,n,r,s,o){let a=!!(s||o),l=n.declutterBox,h=o?o[2]*n.scale[0]/2:0;if(l.minX-h<=e[0]&&l.maxX+h>=0&&l.minY-h<=e[1]&&l.maxY+h>=0){var d,u,c,g,f,_,p,m;a&&this.replayTextBackground_(t,ap,am,ay,ax,s,o),d=n.canvasTransform,u=n.originX,c=n.originY,g=n.drawImageW,f=n.drawImageH,_=n.drawImageX,p=n.drawImageY,m=n.scale,t.save(),1!==r&&(void 0===t.globalAlpha?t.globalAlpha=t=>t.globalAlpha*=r:t.globalAlpha*=r),d&&t.transform.apply(t,d),i.contextInstructions?(t.translate(_,p),t.scale(m[0],m[1]),function(t,e){let i=t.contextInstructions;for(let t=0,n=i.length;t<n;t+=2)Array.isArray(i[t+1])?e[i[t]].apply(e,i[t+1]):e[i[t]]=i[t+1]}(i,t)):m[0]<0||m[1]<0?(t.translate(_,p),t.scale(m[0],m[1]),t.drawImage(i,u,c,g,f,0,0,g,f)):t.drawImage(i,u,c,g,f,_,p,g*m[0],f*m[1]),t.restore()}return!0}fill_(t){let e=this.alignAndScaleFill_;if(e){let i=iC(this.renderedTransform_,[0,0]),n=512*this.pixelRatio;t.save(),t.translate(i[0]%n,i[1]%n),1!==e&&t.scale(e,e),t.rotate(this.viewRotation_)}t.fill(),e&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],e[1]&&(t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6]))}drawLabelWithPointPlacement_(t,e,i,n){let r=this.textStates[e],s=this.createLabel(t,e,n,i),o=this.strokeStates[i],a=this.pixelRatio,l=aw(Array.isArray(t)?t[0]:t,r.textAlign||s6),h=ah[r.textBaseline||s4],d=o&&o.lineWidth?o.lineWidth:0,u=s.width/a-2*r.scale[0],c=h*s.height/a+2*(.5-h)*d;return{label:s,anchorX:l*u+2*(.5-l)*d,anchorY:c}}execute_(t,e,i,n,r,s,o,a){let l,h,d,u,c,g,f,p,m,y,x,v,C,w,E,S,R,I,T=this.zIndexContext_;this.pixelCoordinates_&&_(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=ib(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),iv(this.renderedTransform_,i));let b=0,M=n.length,P=0,L=0,F=0,A=this.coordinateCache_,D=this.viewRotation_,k=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,O={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:D},G=this.instructions!=n||this.overlaps?0:200;for(;b<M;){let i=n[b];switch(i[0]){case oJ:E=i[1],I=i[3],E.getGeometry()?void 0===o||t2(o,I.getExtent())?++b:b=i[2]+1:b=i[2],T&&(T.zIndex=i[4]);break;case oQ:L>G&&(this.fill_(t),L=0),F>G&&(t.stroke(),F=0),L||F||(t.beginPath(),g=NaN,f=NaN),++b;break;case o0:let _=l[P=i[1]],M=l[P+1],z=l[P+2],N=l[P+3],U=z-_,W=N-M,j=Math.sqrt(U*U+W*W);t.moveTo(_+j,M),t.arc(_,M,j,0,2*Math.PI,!0),++b;break;case o1:t.closePath(),++b;break;case o2:P=i[1],h=i[2];let B=i[3],X=i[4],V=i[5];O.geometry=B,O.feature=E,b in A||(A[b]=[]);let K=A[b];V?V(l,P,h,2,K):(K[0]=l[P],K[1]=l[P+1],K.length=2),T&&(T.zIndex=i[6]),X(K,O),++b;break;case o5:let Y,Z,q,H;P=i[1],h=i[2],y=i[3],d=i[4],u=i[5];let $=i[6],J=i[7],Q=i[8],tt=i[9],te=i[10],ti=i[11],tn=i[12],tr=i[13];c=i[14]||"declutter";let ts=i[15];if(!y&&i.length>=20){x=i[19],v=i[20],C=i[21],w=i[22];let t=this.drawLabelWithPointPlacement_(x,v,C,w);y=t.label,i[3]=y;let e=i[23];d=(t.anchorX-e)*this.pixelRatio,i[4]=d;let n=i[24];u=(t.anchorY-n)*this.pixelRatio,i[5]=u,$=y.height,i[6]=$,tr=y.width,i[13]=tr}i.length>25&&(Y=i[25]),i.length>17?(Z=i[16],q=i[17],H=i[18]):(Z=s8,q=null,H=null),te&&k?ti+=D:te||k||(ti-=D);let to=0;for(;P<h;P+=2){if(Y&&Y[to++]<tr/this.pixelRatio)continue;let i=this.calculateImageOrLabelDimensions_(y.width,y.height,l[P],l[P+1],tr,$,d,u,Q,tt,ti,tn,r,Z,!!q||!!H,E),n=[t,e,y,i,J,q,H];if(a){let t,e,r,s,o;if(ts){let i=h-P;if(!ts[i]){ts[i]={args:n,declutterMode:c};continue}let s=ts[i];t=s.args,e=s.declutterMode,delete ts[i],r=av(t)}if(t&&("declutter"!==e||!a.collides(r))&&(s=!0),"declutter"===c&&a.collides(i.declutterBox)||(o=!0),"declutter"===e&&"declutter"===c){let t=s&&o;s=t,o=t}s&&("none"!==e&&a.insert(r),this.replayImageOrLabel_.apply(this,t)),o&&("none"!==c&&a.insert(i.declutterBox),this.replayImageOrLabel_.apply(this,n))}else this.replayImageOrLabel_.apply(this,n)}++b;break;case o3:let ta,tl=i[1],th=i[2],td=i[3],tu=i[4];w=i[5];let tc=i[6],tg=i[7],tf=i[8];C=i[9];let t_=i[10];Array.isArray(x=i[11])&&(x=x.reduce(aS,"")),v=i[12];let tp=[i[13],i[13]];c=i[14]||"declutter";let tm=i[15],ty=this.textStates[v],tx=ty.font,tv=[ty.scale[0]*tg,ty.scale[1]*tg];tx in this.widths_?ta=this.widths_[tx]:(ta={},this.widths_[tx]=ta);let tC=ag(l,tl,th,2),tw=Math.abs(tv[0])*os(tx,x,ta);if(tu||tw<=tC){let i=(tC-tw)*aw(x,this.textStates[v].textAlign),n=function(t,e,
1i,n,r,s,o,a,l,h,d,u,c=!0){var g,f,_,p,m,y;let x,v=t[e],C=t[e+1],w=0,E=0,S=0,R=0;function I(){w=v,E=C,e+=2,v=t[e],C=t[e+1],R+=S,S=Math.sqrt((v-w)*(v-w)+(C-E)*(C-E))}do I();while(e<i-2&&R+S<s)let T=0===S?0:(s-R)/S,b=(g=w)+T*(v-g),M=(f=E)+T*(C-f),P=e-2,L=R,F=s+a*l(h,r,d);for(;e<i-2&&R+S<F;)I();T=0===S?0:(F-R)/S;let A=(_=w)+T*(v-_),D=(p=E)+T*(C-p),k=!1;if(c)if(u){let t=[b,M,A,D];iM(t,0,4,2,u,t,t),k=t[0]>t[2]}else k=b>A;let O=Math.PI,G=[],z=P+2===e;if(e=P,S=0,R=L,v=t[e],C=t[e+1],z){I(),x=Math.atan2(C-E,v-w),k&&(x+=x>0?-O:O);let t=(A+b)/2,e=(D+M)/2;return G[0]=[t,e,(F-s)/2,x,r],G}r=r.replace(/\n/g," ");for(let t=0,n=r.length;t<n;){I();let u=Math.atan2(C-E,v-w);if(k&&(u+=u>0?-O:O),void 0!==x){let t=u-x;if(Math.abs(t+=t>O?-2*O:t<-O?2*O:0)>o)return null}x=u;let c=t,g=0;for(;t<n;++t){let o=a*l(h,r[k?n-t-1:t],d);if(e+2<i&&R+S<s+g+o/2)break;g+=o}if(t===c)continue;let f=k?r.substring(n-c,n-t):r.substring(c,t);T=0===S?0:(s+g/2-R)/S;let _=(m=w)+T*(v-m),p=(y=E)+T*(C-y);G.push([_,p,g/2,u,f]),s+=g}return G}(l,tl,th,0,x,i,tc,Math.abs(tv[0]),os,tx,ta,k?0:this.viewRotation_,tm);t:if(n){let i,r,s,o,l,h=[];if(C)for(i=0,r=n.length;i<r;++i){s=(l=n[i])[4],o=this.createLabel(s,v,"",C),d=l[2]+(tv[0]<0?-t_:t_),u=td*o.height+(.5-td)*2*t_*tv[1]/tv[0]-tf;let r=this.calculateImageOrLabelDimensions_(o.width,o.height,l[0],l[1],o.width,o.height,d,u,0,0,l[3],tp,!1,s8,!1,E);if(a&&"declutter"===c&&a.collides(r.declutterBox))break t;h.push([t,e,o,r,1,null,null])}if(w)for(i=0,r=n.length;i<r;++i){s=(l=n[i])[4],o=this.createLabel(s,v,w,""),d=l[2],u=td*o.height-tf;let r=this.calculateImageOrLabelDimensions_(o.width,o.height,l[0],l[1],o.width,o.height,d,u,0,0,l[3],tp,!1,s8,!1,E);if(a&&"declutter"===c&&a.collides(r.declutterBox))break t;h.push([t,e,o,r,1,null,null])}a&&"none"!==c&&a.load(h.map(av));for(let t=0,e=h.length;t<e;++t)this.replayImageOrLabel_.apply(this,h[t])}}++b;break;case o6:if(void 0!==s){let t=s(E=i[1],I,c);if(t)return t}++b;break;case o4:G?L++:this.fill_(t),++b;break;case o8:for(P=i[1],h=i[2],S=l[P],R=l[P+1],t.moveTo(S,R),g=S+.5|0,f=R+.5|0,P+=2;P<h;P+=2)S=l[P],R=l[P+1],p=S+.5|0,m=R+.5|0,(P==h-2||p!==g||m!==f)&&(t.lineTo(S,R),g=p,f=m);++b;break;case o9:this.alignAndScaleFill_=i[2],L&&(this.fill_(t),L=0,F&&(t.stroke(),F=0)),t.fillStyle=i[1],++b;break;case o7:F&&(t.stroke(),F=0),this.setStrokeStyle_(t,i),++b;break;case at:G?F++:t.stroke(),++b;break;default:++b}}L&&this.fill_(t),F&&t.stroke()}execute(t,e,i,n,r,s){this.viewRotation_=n,this.execute_(t,e,i,this.instructions,r,void 0,void 0,s)}executeHitDetection(t,e,i,n,r){return this.viewRotation_=i,this.execute_(t,[t.canvas.width,t.canvas.height],e,this.hitDetectionInstructions,!0,n,r)}},aI=["Polygon","Circle","LineString","Image","Text","Default"],aT=["Image","Text"],ab=aI.filter(t=>!aT.includes(t)),aM={},aP=class{constructor(t,e,i,n,r,s,o){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=s,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=ix(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(r,o)}clip(t,e){let i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()}createExecutors_(t,e){for(let i in t){let n=this.executorsByZIndex_[i];void 0===n&&(n={},this.executorsByZIndex_[i]=n);let r=t[i];for(let t in r){let i=r[t];n[t]=new aR(this.resolution_,this.pixelRatio_,this.overlaps_,i,e)}}}hasExecutors(t){for(let e in this.executorsByZIndex_){let i=this.executorsByZIndex_[e];for(let e=0,n=t.length;e<n;++e)if(t[e]in i)return!0}return!1}forEachFeatureAtCoordinate(t,e,i,n,r,s){let o,a,l,h,u,c,g,f=2*(n=Math.round(n))+1,_=iw(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-i,-t[0],-t[1]),p=!this.hitDetectionContext_;p&&(this.hitDetectionContext_=nM(f,f));let m=this.hitDetectionContext_;m.canvas.width!==f||m.canvas.height!==f?(m.canvas.width=f,m.canvas.height=f):p||m.clearRect(0,0,f,f),void 0!==this.renderBuffer_&&(tW(o=tD(),t),tT(o,e*(this.renderBuffer_+n),o));let y=function(t){if(void 0!==aM[t])return aM[t];let e=2*t+1,i=t*t,n=Array(i+1);for(let r=0;r<=t;++r)for(let s=0;s<=t;++s){let o=r*r+s*s;if(o>i)break;let a=n[o];a||(a=[],n[o]=a),a.push(((t+r)*e+(t+s))*4+3),r>0&&a.push(((t-r)*e+(t+s))*4+3),s>0&&(a.push(((t+r)*e+(t-s))*4+3),r>0&&a.push(((t-r)*e+(t-s))*4+3))}let r=[];for(let t=0,e=n.length;t<e;++t)n[t]&&r.push(...n[t]);return aM[t]=r,r}(n);function x(t,e,i){let o=m.getImageData(0,0,f,f).data;for(let l=0,h=y.length;l<h;l++)if(o[y[l]]>0){if(!s||"none"===i||"Image"!==a&&"Text"!==a||s.includes(t)){let i=(y[l]-3)/4,s=n-i%f,o=n-(i/f|0),a=r(t,e,s*s+o*o);if(a)return a}m.clearRect(0,0,f,f);break}}let v=Object.keys(this.executorsByZIndex_).map(Number);for(v.sort(d),l=v.length-1;l>=0;--l){let t=v[l].toString();for(u=this.executorsByZIndex_[t],h=aI.length-1;h>=0;
1--h)if(void 0!==(c=u[a=aI[h]])&&(g=c.executeHitDetection(m,_,i,x,o)))return g}}getClipCoords(t){let e=this.maxExtent_;if(!e)return null;let i=e[0],n=e[1],r=e[2],s=e[3],o=[i,n,i,s,r,s,r,n];return ib(o,0,8,2,t,o),o}isEmpty(){return E(this.executorsByZIndex_)}execute(t,e,i,n,r,s,o){let a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(o?u:d),s=s||aI;let l=aI.length;for(let h=0,d=a.length;h<d;++h){let d=a[h].toString(),u=this.executorsByZIndex_[d];for(let d=0,c=s.length;d<c;++d){let c=s[d],g=u[c];if(void 0!==g){let s=null===o?void 0:g.getZIndexContext(),d=s?s.getContext():t,u=this.maxExtent_&&"Image"!==c&&"Text"!==c;if(u&&(d.save(),this.clip(d,i)),s&&"Text"!==c&&"Image"!==c?s.pushFunction(t=>g.execute(t,e,i,n,r,o)):g.execute(d,e,i,n,r,o),u&&d.restore(),s){s.offset();let t=a[h]*l+aI.indexOf(c);this.deferredZIndexContexts_[t]||(this.deferredZIndexContexts_[t]=[]),this.deferredZIndexContexts_[t].push(s)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){let t=this.deferredZIndexContexts_,e=Object.keys(t).map(Number).sort(d);for(let i=0,n=e.length;i<n;
vendor: 9,274 bytes, line 1
1++i)t[e[i]].forEach(t=>{t.draw(this.renderedContext_),t.clear()}),t[e[i]].length=0}},aL=class extends o${constructor(t,e,i,n,r,s,o){super(),this.context_=t,this.pixelRatio_=e,this.extent_=i,this.transform_=n,this.transformRotation_=n?tx(Math.atan2(n[1],n[0]),10):0,this.viewRotation_=r,this.squaredTolerance_=s,this.userTransform_=o,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=ix()}drawImages_(t,e,i,n){if(!this.image_)return;let r=ib(t,e,i,n,this.transform_,this.pixelCoordinates_),s=this.context_,o=this.tmpLocalTransform_,a=s.globalAlpha;1!=this.imageOpacity_&&(s.globalAlpha=a*this.imageOpacity_);let l=this.imageRotation_;0===this.transformRotation_&&(l-=this.viewRotation_),this.imageRotateWithView_&&(l+=this.viewRotation_);for(let t=0,e=r.length;t<e;t+=2){let e=r[t]-this.imageAnchorX_,i=r[t+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){let t=e+this.imageAnchorX_,n=i+this.imageAnchorY_;iw(o,t,n,1,1,l,-t,-n),s.save(),s.transform.apply(s,o),s.translate(t,n),s.scale(this.imageScale_[0],this.imageScale_[1]),s.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),s.restore()}else s.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,e,i,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(s.globalAlpha=a)}drawText_(t,e,i,n){if(!this.textState_||""===this.text_)return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);let r=ib(t,e,i,n,this.transform_,this.pixelCoordinates_),s=this.context_,o=this.textRotation_;for(0===this.transformRotation_&&(o-=this.viewRotation_),this.textRotateWithView_&&(o+=this.viewRotation_);e<i;e+=n){let t=r[e]+this.textOffsetX_,i=r[e+1]+this.textOffsetY_;0!==o||1!=this.textScale_[0]||1!=this.textScale_[1]?(s.save(),s.translate(t-this.textOffsetX_,i-this.textOffsetY_),s.rotate(o),s.translate(this.textOffsetX_,this.textOffsetY_),s.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&s.strokeText(this.text_,0,0),this.textFillState_&&s.fillText(this.text_,0,0),s.restore()):(this.textStrokeState_&&s.strokeText(this.text_,t,i),this.textFillState_&&s.fillText(this.text_,t,i))}}moveToLineTo_(t,e,i,n,r){let s=this.context_,o=ib(t,e,i,n,this.transform_,this.pixelCoordinates_);s.moveTo(o[0],o[1]);let a=o.length;r&&(a-=2);for(let t=2;t<a;t+=2)s.lineTo(o[t],o[t+1]);return r&&s.closePath(),i}drawRings_(t,e,i,n){for(let r=0,s=i.length;r<s;++r)e=this.moveToLineTo_(t,e,i[r],n,!0);return e}drawCircle(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),t2(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let e=iO(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],n=e[3]-e[1],r=Math.sqrt(i*i+n*n),s=this.context_;s.beginPath(),s.arc(e[0],e[1],r,0,2*Math.PI),this.fillState_&&s.fill(),this.strokeState_&&s.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}}setStyle(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())}setTransform(t){this.transform_=t}drawGeometry(t){switch(t.getType()){case"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t)}}drawFeature(t,e){let i=e.getGeometryFunction()(t);i&&(this.setStyle(e),this.drawGeometry(i))}drawGeometryCollection(t){let e=t.getGeometriesArray();for(let t=0,i=e.length;t<i;++t)this.drawGeometry(e[t])}drawPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)}drawMultiPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)}drawLineString(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),t2(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);let e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){let e=t.getFlatMidpoint();this.drawText_(e,0,2,2)}}}drawMultiLineString(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let e=t.getExtent();if(t2(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);let e=this.context_,i=t.getFlatCoordinates(),n=0,r=t.getEnds(),s=t.getStride();e.beginPath();for(let t=0,e=r.length;t<e;++t)n=this.moveToLineTo_(i,n,r[t],s,!1);e.stroke()}if(""!==this.text_){let e=t.getFlatMidpoints();this.drawText_(e,0,e.length,2)}}}drawPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),t2(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){let e=t.getFlatInteriorPoint();this.drawText_(e,0,2,2)}}}drawMultiPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),t2(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let e=this.context_,i=t.getOrientedFlatCoordinates(),n=0,r=t.getEndss(),s=t.getStride();e.beginPath();for(let t=0,e=r.length;t<e;++t){let e=r[t];n=this.drawRings_(i,n,e,s)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){let e=t.getFlatInteriorPoints();this.drawText_(e,0,e.length,2)}}}setContextFillState_(t){let e=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})}setContextStrokeState_(t){let e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),_(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset,e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})}setContextTextState_(t){let e=this.context_,i=this.contextTextState_,n=t.textAlign?t.textAlign:s6;i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=n&&(i.textAlign=n,e.textAlign=n),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=n,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:n,textBaseline:t.textBaseline})}setFillStrokeStyle(t,e){if(t){let e=t.getColor();this.fillState_={fillStyle:sJ(e||s0)}}else this.fillState_=null;if(e){let t=e.getColor(),i=e.getLineCap(),n=e.getLineDash(),r=e.getLineDashOffset(),s=e.getLineJoin(),o=e.getWidth(),a=e.getMiterLimit(),l=n||s2;this.strokeState_={lineCap:void 0!==i?i:s1,lineDash:1===this.pixelRatio_?l:l.map(t=>t*this.pixelRatio_),lineDashOffset:(r||0)*this.pixelRatio_,lineJoin:void 0!==s?s:s3,lineWidth:(void 0!==o?o:1)*this.pixelRatio_,miter
1Limit:void 0!==a?a:10,strokeStyle:sJ(t||s5)}}else this.strokeState_=null}setImageStyle(t){let e;if(!t||!(e=t.getSize())){this.image_=null;return}let i=t.getPixelRatio(this.pixelRatio_),n=t.getAnchor(),r=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=n[0]*i,this.imageAnchorY_=n[1]*i,this.imageHeight_=e[1]*i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();let s=t.getScaleArray();this.imageScale_=[s[0]*this.pixelRatio_/i,s[1]*this.pixelRatio_/i],this.imageWidth_=e[0]*i}setTextStyle(t){if(t){let e=t.getFill();if(e){let t=e.getColor();this.textFillState_={fillStyle:sJ(t||s0)}}else this.textFillState_=null;let i=t.getStroke();if(i){let t=i.getColor(),e=i.getLineCap(),n=i.getLineDash(),r=i.getLineDashOffset(),s=i.getLineJoin(),o=i.getWidth(),a=i.getMiterLimit();this.textStrokeState_={lineCap:void 0!==e?e:s1,lineDash:n||s2,lineDashOffset:r||0,lineJoin:void 0!==s?s:s3,lineWidth:void 0!==o?o:1,miterLimit:void 0!==a?a:10,strokeStyle:sJ(t||s5)}}else this.textStrokeState_=null;let n=t.getFont(),r=t.getOffsetX(),s=t.getOffsetY(),o=t.getRotateWithView(),a=t.getRotation(),l=t.getScaleArray(),h=t.getText(),d=t.getTextAlign(),u=t.getTextBaseline();this.textState_={font:void 0!==n?n:sQ,textAlign:void 0!==d?d:s6,textBaseline:void 0!==u?u:s4},this.text_=void 0!==h?Array.isArray(h)?h.reduce((t,e,i)=>t+=i%2?" ":e,""):h:"",this.textOffsetX_=void 0!==r?this.pixelRatio_*r:0,this.textOffsetY_=void 0!==s?this.pixelRatio_*s:0,this.textRotateWithView_=void 0!==o&&o,this.textRotation_=void 0!==a?a:0,this.textScale_=[this.pixelRatio_*l[0],this.pixelRatio_*l[1]]}else this.text_=""}},aF={Point:function(t,e,i,n,r,s){let o=i.getImage(),a=i.getText(),l=a&&a.getText(),h=s&&o&&l?{}:void 0;if(o){if(o.getImageState()!=sj.LOADED)return;let s=t.getBuilder(i.getZIndex(),"Image");s.setImageStyle(o,h),s.drawPoint(e,n,r)}if(l){let s=t.getBuilder(i.getZIndex(),"Text");s.setTextStyle(a,h),s.drawText(e,n,r)}},LineString:function(t,e,i,n,r){let s=i.getStroke();if(s){let o=t.getBuilder(i.getZIndex(),"LineString");o.setFillStrokeStyle(null,s),o.drawLineString(e,n,r)}let o=i.getText();if(o&&o.getText()){let s=t.getBuilder(i.getZIndex(),"Text");s.setTextStyle(o),s.drawText(e,n,r)}},Polygon:function(t,e,i,n,r){let s=i.getFill(),o=i.getStroke();if(s||o){let a=t.getBuilder(i.getZIndex(),"Polygon");a.setFillStrokeStyle(s,o),a.drawPolygon(e,n,r)}let a=i.getText();if(a&&a.getText()){let s=t.getBuilder(i.getZIndex(),"Text");s.setTextStyle(a),s.drawText(e,n,r)}},MultiPoint:function(t,e,i,n,r,s){let o=i.getImage(),a=o&&0!==o.getOpacity(),l=i.getText(),h=l&&l.getText(),d=s&&a&&h?{}:void 0;if(a){if(o.getImageState()!=sj.LOADED)return;let s=t.getBuilder(i.getZIndex(),"Image");s.setImageStyle(o,d),s.drawMultiPoint(e,n,r)}if(h){let s=t.getBuilder(i.getZIndex(),"Text");s.setTextStyle(l,d),s.drawText(e,n,r)}},MultiLineString:function(t,e,i,n,r){let s=i.getStroke();if(s){let o=t.getBuilder(i.getZIndex(),"LineString");o.setFillStrokeStyle(null,s),o.drawMultiLineString(e,n,r)}let o=i.getText();if(o&&o.getText()){let s=t.getBuilder(i.getZIndex(),"Text");s.setTextStyle(o),s.drawText(e,n,r)}},MultiPolygon:function(t,e,i,n,r){let s=i.getFill(),o=i.getStroke();if(o||s){let a=t.getBuilder(i.getZIndex(),"Polygon");a.setFillStrokeStyle(s,o),a.drawMultiPolygon(e,n,r)}let a=i.getText();if(a&&a.getText()){let s=t.getBuilder(i.getZIndex(),"Text");s.setTextStyle(a),s.drawText(e,n,r)}},GeometryCollection:function(t,e,i,n,r,s){let o,a,l=e.getGeometriesArray();for(o=0,a=l.length;o<a;++o)(0,aF[l[o].getType()])(t,l[o],i,n,r,s)},Circle:function(t,e,i,n,r){let s=i.getFill(),o=i.getStroke();if(s||o){let a=t.getBuilder(i.getZIndex(),"Circle");a.setFillStrokeStyle(s,o),a.drawCircle(e,n,r)}let a=i.getText();if(a&&a.getText()){let r=t.getBuilder(i.getZIndex(),"Text");r.setTextStyle(a),r.drawText(e,n)}}};function aA(t,e){return parseInt(A(t),10)-parseInt(A(e),10)}function aD(t,e){let i=.5*t/e;return i*i}function ak(t,e,i,n,r,s,o,a){let l=[],h=i.getImage();if(h){let t=!0,e=h.getImageState();e==sj.LOADED||e==sj.ERROR?t=!1:e==sj.IDLE&&h.load(),t&&l.push(h.ready())}let d=i.getFill();d&&d.loading()&&l.push(d.ready());let u=l.length>0;return u&&Promise.all(l).then(()=>
1r(null)),function(t,e,i,n,r,s,o){let a=i.getGeometryFunction()(e);if(!a)return;let l=a.simplifyTransformed(n,r);i.getRenderer()?function t(e,i,n,r,s){if("GeometryCollection"==i.getType()){let o=i.getGeometries();for(let i=0,a=o.length;i<a;++i)t(e,o[i],n,r,s);return}e.getBuilder(n.getZIndex(),"Default").drawCustom(i,r,n.getRenderer(),n.getHitDetectionRenderer(),s)}(t,l,i,e,o):(0,aF[l.getType()])(t,l,i,e,o,s)}(t,e,i,n,s,o,a),u}let aO=class extends P{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.staleKeys_=[],this.maxStaleKeys=5}getStaleKeys(){return this.staleKeys_}prependStaleKey(t){this.staleKeys_.unshift(t),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(t){return L()}getData(t){return null}prepareFrame(t){return L()}renderFrame(t,e){return L()}forEachFeatureAtCoordinate(t,e,i,n,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){let e=t.target;(e.getState()===sj.LOADED||e.getState()===sj.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=sj.LOADED&&e!=sj.ERROR&&t.addEventListener(a.CHANGE,this.boundHandleImageChange_),e==sj.IDLE&&(t.load(),e=t.getState()),e==sj.LOADED}renderIfReadyAndVisible(){let t=this.getLayer();t&&t.getVisible()&&"ready"===t.getSourceState()&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}},aG=[],az=null,aN=class extends aO{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=ix(),this.pixelTransform=ix(),this.inversePixelTransform=ix(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(t,e,i){let n;az||(az=nM(1,1,void 0,{willReadFrequently:!0})),az.clearRect(0,0,1,1);try{az.drawImage(t,e,i,1,1,0,0,1,1),n=az.getImageData(0,0,1,1).data}catch{return az=null,null}return n}getBackground(t){let e=this.getLayer().getBackground();return"function"==typeof e&&(e=e(t.viewState.resolution)),e||void 0}useContainer(t,e,i){let n,r,s=this.getLayer().getClassName();if(t&&t.className===s&&(!i||t&&t.style.backgroundColor&&_(r3(t.style.backgroundColor),r3(i)))){let e=t.firstElementChild;e instanceof HTMLCanvasElement&&(r=e.getContext("2d"))}if(r&&iT(r.canvas.style.transform,e)?(this.container=t,this.context=r,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){(n=document.createElement("div")).className=s;let t=n.style;t.position="absolute",t.width="100%",t.height="100%";let e=(r=nM()).canvas;n.appendChild(e),(t=e.style).position="absolute",t.left="0",t.transformOrigin="top left",this.container=n,this.context=r}this.containerReused||!i||this.container.style.backgroundColor||(this.container.style.backgroundColor=i)}clipUnrotated(t,e,i){let n=tQ(i),r=t0(i),s=tK(i),o=tV(i);iC(e.coordinateToPixelTransform,n),iC(e.coordinateToPixelTransform,r),iC(e.coordinateToPixelTransform,s),iC(e.coordinateToPixelTransform,o);let a=this.inversePixelTransform;iC(a,n),iC(a,r),iC(a,s),iC(a,o),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])
1),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.clip()}prepareContainer(t,e){let i=t.extent,n=t.viewState.resolution,r=t.viewState.rotation,s=t.pixelRatio,o=Math.round(t1(i)/n*s),a=Math.round(t$(i)/n*s);iw(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/s,1/s,r,-o/2,-a/2),iE(this.inversePixelTransform,this.pixelTransform);let l=iR(this.pixelTransform);if(this.useContainer(e,l,this.getBackground(t)),!this.containerReused){let t=this.context.canvas;t.width!=o||t.height!=a?(t.width=o,t.height=a):this.context.clearRect(0,0,o,a),l!==t.style.transform&&(t.style.transform=l)}}dispatchRenderEvent_(t,e,i){let n=this.getLayer();if(n.hasListener(t)){let r=new oK(t,this.inversePixelTransform,i,e);n.dispatchEvent(r)}}preRender(t,e){this.frameState=e,e.declutter||this.dispatchRenderEvent_(rE,t,e)}postRender(t,e){e.declutter||this.dispatchRenderEvent_(rS,t,e)}renderDeferredInternal(t){}getRenderContext(t){return t.declutter&&!this.deferredContext_&&(this.deferredContext_=new af),t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){t.declutter&&(this.dispatchRenderEvent_(rE,this.context,t),t.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(t),this.dispatchRenderEvent_(rS,this.context,t))}getRenderTransform(t,e,i,n,r,s,o){let a=n/e,l=-t[0]+o,h=-t[1];return iw(this.tempTransform,r/2,s/2,a,-a,-i,l,h)}disposeInternal(){delete this.frameState,super.disposeInternal()}};t.s(["canvasPool",0,aG,"default",0,aN],79784);let aU=class extends aN{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipped_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=tD(),this.wrappedRenderedExtent_=tD(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedPixelRatio_=1,this.renderedRenderOrder_=null,this.renderedFrameDeclutter_,this.replayGroup_=null,this.replayGroupChanged=!0,this.clipping=!0,this.targetContext_=null,this.opacity_=1}renderWorlds(t,e,i){let n=e.extent,r=e.viewState,s=r.center,o=r.resolution,a=r.projection,l=r.rotation,h=a.getExtent(),d=this.getLayer().getSource(),u=this.getLayer().getDeclutter(),c=e.pixelRatio,g=e.viewHints,f=!(g[0]||g[1]),_=this.context,p=Math.round(t1(n)/o*c),m=Math.round(t$(n)/o*c),y=d.getWrapX()&&a.canWrapX(),x=y?t1(h):null,v=y?Math.ceil((n[2]-h[2])/x)+1:1,C=y?Math.floor((n[0]-h[0])/x):0;do{let n=this.getRenderTransform(s,o,0,c,p,m,C*x);e.declutter&&(n=n.slice(0)),t.execute(_,[_.canvas.width,_.canvas.height],n,l,f,void 0===i?aI:i?aT:ab,i?u&&e.declutter[u]:void 0)}while(++C<v)}setDrawContext_(){1!==this.opacity_&&(this.targetContext_=this.context,this.context=nM(this.context.canvas.width,this.context.canvas.height,aG))}resetDrawContext_(){if(1!==this.opacity_&&this.targetContext_){let t=this.targetContext_.globalAlpha;this.targetContext_.globalAlpha=this.opacity_,this.targetContext_.drawImage(this.context.canvas,0,0),this.targetContext_.globalAlpha=t,nL(this.context),aG.push(this.context.canvas),this.context=this.targetContext_,this.targetContext_=null}}renderDeclutter(t){this.replayGroup_&&this.getLayer().getDeclutter()&&this.renderWorlds(this.replayGroup_,t,!0)}renderDeferredInternal(t){this.replayGroup_&&(this.replayGroup_.renderDeferred(),this.clipped_&&this.context.restore(),this.resetDrawContext_())}renderFrame(t,e){let i=t.layerStatesArray[t.layerIndex];this.opacity_=i.opacity;let n=t.viewState;this.prepareContainer(t,e);let r=this.context,s=this.replayGroup_,o=s&&!s.isEmpty();if(!o&&!(this.getLayer().hasListener(rE)||this.getLayer().hasListener(rS)))return this.container;this.setDrawContext_(),this.preRender(r,t);n.projection;if(this.clipped_=!1,o&&i.extent&&this.clipping){var a,l;let e=(a=i.extent,l=0,a);o=t2(e,t.extent),this.clipped_=o&&!tL(e,t.extent),this.clipped_&&this.clipUnrotated(r,t,e)}return o&&this.renderWorlds(s,t,!this.getLayer().getDeclutter()&&void 0),!t.declutter&&this.clipped_&&r.restore(
1),this.postRender(r,t),this.renderedRotation_!==n.rotation&&(this.renderedRotation_=n.rotation,this.hitDetectionImageData_=null),t.declutter||this.resetDrawContext_(),this.container}getFeatures(t){return new Promise(e=>{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){let t=this.frameState.size.slice(),e=this.renderedCenter_,i=this.renderedResolution_,n=this.renderedRotation_,r=this.renderedProjection_,s=this.wrappedRenderedExtent_,o=this.getLayer(),a=[],l=.5*t[0],h=.5*t[1];a.push(this.getRenderTransform(e,i,n,.5,l,h,0).slice());let u=o.getSource(),c=r.getExtent();if(u.getWrapX()&&r.canWrapX()&&!tL(c,s)){let t,r=s[0],o=t1(c),d=0;for(;r<c[0];)t=o*--d,a.push(this.getRenderTransform(e,i,n,.5,l,h,t).slice()),r+=o;for(d=0,r=s[2];r>c[2];)t=o*++d,a.push(this.getRenderTransform(e,i,n,.5,l,h,t).slice()),r-=o}let g=iu();this.hitDetectionImageData_=function(t,e,i,n,r,s,o,a,l){var h;let u=(l&&(h=0),r),c=nM(.5*t[0],.5*t[1]);c.imageSmoothingEnabled=!1;let g=c.canvas,f=new aL(c,.5,r,null,o,a,l?ia(iu(),l):null),_=i.length,p=Math.floor(0xffffff/_),m={};for(let t=1;t<=_;++t){let e=i[t-1],r=e.getStyleFunction()||n;if(!r)continue;let o=r(e,s);if(!o)continue;Array.isArray(o)||(o=[o]);let a=(t*p).toString(16).padStart(7,"#00000");for(let t=0,i=o.length;t<i;++t){let i=o[t],n=i.getGeometryFunction()(e);if(!n||!t2(u,n.getExtent()))continue;let r=i.clone(),s=r.getFill();s&&s.setColor(a);let l=r.getStroke();l&&(l.setColor(a),l.setLineDash(null)),r.setText(void 0);let h=i.getImage();if(h){let t=h.getImageSize();if(!t)continue;let e=nM(t[0],t[1],void 0,{alpha:!1}),i=e.canvas;e.fillStyle=a,e.fillRect(0,0,i.width,i.height),r.setImage(new og({img:i,anchor:h.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:h.getOrigin(),opacity:1,size:h.getSize(),scale:h.getScale(),rotation:h.getRotation(),rotateWithView:h.getRotateWithView()}))}let d=r.getZIndex()||0,c=m[d];c||(c={},m[d]=c,c.Polygon=[],c.Circle=[],c.LineString=[],c.Point=[]);let g=n.getType();if("GeometryCollection"===g){let t=n.getGeometriesArrayRecursive();for(let e=0,i=t.length;e<i;++e){let i=t[e];c[i.getType().replace("Multi","")].push(i,r)}}else c[g.replace("Multi","")].push(n,r)}}let y=Object.keys(m).map(Number).sort(d);for(let t=0,i=y.length;t<i;++t){let i=m[y[t]];for(let t in i){let n=i[t];for(let t=0,i=n.length;t<i;t+=2){f.setStyle(n[t+1]);for(let i=0,r=e.length;i<r;++i)f.setTransform(e[i]),f.drawGeometry(n[t])}}}return c.getImageData(0,0,g.width,g.height)}(t,a,this.renderedFeatures_,o.getStyleFunction(),s,i,n,aD(i,this.renderedPixelRatio_),g?r:null)}e(function(t,e,i){let n=[];if(i){let r=Math.floor(.5*Math.round(t[0])),s=Math.floor(.5*Math.round(t[1])),o=(tu(r,0,i.width-1)+tu(s,0,i.height-1)*i.width)*4,a=i.data[o],l=i.data[o+1],h=i.data[o+2]+256*(l+256*a),d=Math.floor(0xffffff/e.length);h&&h%d==0&&n.push(e[h/d-1])}return n}(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,i,n,r){if(!this.replayGroup_)return;let s=e.viewState.resolution,o=e.viewState.rotation,a=this.getLayer(),l={},h=this.getLayer().getDeclutter();return this.replayGroup_.forEachFeatureAtCoordinate(t,s,o,i,function(t,e,i){let s=A(t),o=l[s];if(o){if(!0!==o&&i<o.distanceSq){if(0===i)return l[s]=!0,r.splice(r.lastIndexOf(o),1),n(t,a,e);o.geometry=e,o.distanceSq=i}}else{if(0===i)return l[s]=!0,n(t,a,e);r.push(l[s]={feature:t,layer:a,geometry:e,distanceSq:i,callback:n})}},h?e.declutter?.[h]?.all().map(t=>t.value):null)}handleFontsChanged(){let t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){var e,i,n,r;let s,o=this.getLayer(),a=o.getSource();if(!a)return!1;let l=t.viewHints[0],h=t.viewHints[1],d=o.getUpdateWhileAnimating(),u=o.getUpdateWhileInteracting();if(this.ready&&!d&&l||!u&&h)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;let c=t.extent,g=t.viewState,f=g.projection,p=g.resolution,m=t.pixelRatio,y=o.getRevision(),x=o.getRenderBuffer(),v=o.getRenderOrder();void 0===v&&(v=aA);let C=g.center.slice(),w=tT(c,x*p),E=w.slice(),S=[w.slice()],R=f.getExtent();if(a.getWrapX()&&f.canWrapX()&&!tL(R,t.extent)){let t=t1(R),e=Math.max(t1(w)/2,t);
1w[0]=R[0]-e,w[2]=R[2]+e,ed(C,f);let i=t8(S[0],f);i[0]<R[0]&&i[2]<R[2]?S.push([i[0]+t,i[1],i[2]+t,i[3]]):i[0]>R[0]&&i[2]>R[2]&&S.push([i[0]-t,i[1],i[2]-t,i[3]])}if(this.ready&&this.renderedResolution_==p&&this.renderedRevision_==y&&this.renderedRenderOrder_==v&&!!t.declutter===this.renderedFrameDeclutter_&&tL(this.wrappedRenderedExtent_,w))return _(this.renderedExtent_,E)||(this.hitDetectionImageData_=null,this.renderedExtent_=E),this.renderedCenter_=C,this.replayGroupChanged=!1,!0;this.replayGroup_=null;let I=new ac(.5*p/m,w,p,m),T=iu();if(T){for(let t=0,r=S.length;t<r;++t){let r=(e=S[t],i=0,e);a.loadFeatures(r,(n=0,p),T)}s=ia(T,f)}else for(let t=0,e=S.length;t<e;++t)a.loadFeatures(S[t],p,f);let b=aD(p,m),M=!0,P=(t,e)=>{let i,n=t.getStyleFunction()||o.getStyleFunction();if(n&&(i=n(t,p)),i){let n=this.renderFeature(t,b,i,I,s,this.getLayer().getDeclutter(),e);M=M&&!n}},L=(r=0,w),F=a.getFeaturesInExtent(L);v&&F.sort(v);for(let t=0,e=F.length;t<e;++t)P(F[t],t);this.renderedFeatures_=F,this.ready=M;let A=I.finish(),D=new aP(w,p,m,a.getOverlaps(),A,o.getRenderBuffer(),!!t.declutter);return this.renderedResolution_=p,this.renderedRevision_=y,this.renderedRenderOrder_=v,this.renderedFrameDeclutter_=!!t.declutter,this.renderedExtent_=E,this.wrappedRenderedExtent_=w,this.renderedCenter_=C,this.renderedProjection_=f,this.renderedPixelRatio_=m,this.replayGroup_=D,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(t,e,i,n,r,s,o){if(!i)return!1;let a=!1;if(Array.isArray(i))for(let l=0,h=i.length;l<h;++l)a=ak(n,t,i[l],e,this.boundHandleStyleImageChange_,r,s,o)||a;else a=ak(n,t,i,e,this.boundHandleStyleImageChange_,r,s,o);return a}};function aW(t,e){return function(i,n,r,s,o){var a,l;let h;a=(t,e)=>{this.addFeatures(t),void 0!==s&&s(t)},l=()=>{this.changed(),void 0!==o&&o()},(h=new XMLHttpRequest).open("GET","function"==typeof t?t(i,n,r):t,!0),"arraybuffer"==e.getType()&&(h.responseType="arraybuffer"),h.withCredentials=!1,h.onload=function(t){if(!h.status||h.status>=200&&h.status<300){let t=e.getType();try{let n;"text"==t||"json"==t?n=h.responseText:"xml"==t?n=h.responseXML||h.responseText:"arraybuffer"==t&&(n=h.response),n?a(e.readFeatures(n,{extent:i,featureProjection:r}),e.readProjection(n)):l()}catch{l()}}else l()},h.onerror=l,h.send()}}function aj(t,e){return[[-1/0,-1/0,1/0,1/0]]}t.s(["default",0,class extends oV{constructor(t){super(t)}createRenderer(){return new aU(this)}}],33697);class aB extends k{constructor(t){super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t&&("function"==typeof t.getSimplifiedGeometry?this.setGeometry(t):this.setProperties(t))}clone(){let t=new aB(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());let e=this.getGeometry();e&&t.setGeometry(e.clone());let i=this.getStyle();return i&&t.setStyle(i),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(b(this.geometryChangeKey_),this.geometryChangeKey_=null);let t=this.getGeometry();t&&(this.geometryChangeKey_=I(t,a.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){var e;let i;this.style_=t,this.styleFunction_=t?"function"==typeof(e=t)?e:(Array.isArray(e)?i=e:(to("function"==typeof e.getZIndex,"Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),i=[e]),function(){return i}):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function aX(t,e,i,n){let r=[],s=tD();for(let o=0,a=i.length;o<a;++o){let a=i[o];s=tz(t,e,a[0],n),r.push((s[0]+s[2])/2,(s[1]+s[3])/2),e=a[a.length-1]}return r}function aV(t,e,i,n,r,s,o){let a,l,d=(i-e)/n;if(1===d)a=e;else if(2===d)a=e,l=r;else if(0!==d){let s=t[e],o=t[e+1],d=0,u=[0];for(let r=e+n;r<i;r+=n){let e=t[r],i=t[r+1];d+=Math.sqrt((e-s)*(e-s)+(i-o)*(i-o)),u.push(d),s=e,o=i}let c=r*d,g=h(u,c);g<0?(l=(c-u[-g-2])/(u[-g-1]-u[-g-2]),a=e+(-g-2)*n):a=e+g*n}o=o>1?o:2,s=s||Array(o);for(let e=0;e<o;++e){var u;s[e]=void 0===a?NaN:void 0===l?t[a+e]:(u=t[a+e],u+l*(t[a+n+e]-u))}return s}function aK(t,e,i,n,r,s){let o;if(i==e)return null;if(r<t[e+n-1])return s?((o=t.slice(e,e+n))[n-1]=r,o):null;if(t[i-1]<r)return s?((o=t.slice(i-n,i))[n-1]=r,o):null;if(r==t[e+n-1])return t.slice(e,e+n);let a=e/n,l=i/n;for(;a<l;){let e=a+l>>1;r<t[(e+1)*n-1]?l=e:a=e+1}let h=t[a*n-1];
1if(r==h)return t.slice((a-1)*n,(a-1)*n+n);let d=(r-h)/(t[(a+1)*n-1]-h);o=[];for(let e=0;e<n-1;++e){var u;o.push((u=t[(a-1)*n+e],u+d*(t[a*n+e]-u)))}return o.push(r),o}t.s(["default",0,aB],77267);class aY extends iG{constructor(t,e){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?this.setCoordinates(t,e):this.setFlatCoordinates(e,t)}appendCoordinate(t){f(this.flatCoordinates,t),this.changed()}clone(){let t=new aY(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<tM(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(iW(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),iB(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,n))}forEachSegment(t){return i9(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinateAtM(t,e){return"XYM"!=this.layout&&"XYZM"!=this.layout?null:(e=void 0!==e&&e,aK(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e))}getCoordinates(){return iq(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,e){return aV(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)}getLength(){return ag(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){let e=[];return e.length=iJ(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new aY(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return nt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,this.getExtent())}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=iK(this.flatCoordinates,0,t,this.stride),this.changed()}}t.s(["default",0,aY],43136);class aZ extends iG{constructor(t,e,i){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,e);else if(void 0!==e&&i)this.setFlatCoordinates(e,t),this.ends_=i;else{const e=[],i=[];for(let n=0,r=t.length;n<r;++n)f(e,t[n].getFlatCoordinates()),i.push(e.length);const n=0===t.length?this.getLayout():t[0].getLayout();this.setFlatCoordinates(n,e),this.ends_=i}}appendLineString(t){f(this.flatCoordinates,t.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){let t=new aZ(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<tM(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ij(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),iX(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,n))}getCoordinateAtM(t,e,i){return"XYM"!=this.layout&&"XYZM"!=this.layout||0===this.flatCoordinates.length?null:(e=void 0!==e&&e,i=void 0!==i&&i,function(t,e,i,n,r,s,o){let a;if(o)return aK(t,e,i[i.length-1],n,r,s);if(r<t[n-1])return s?((a=t.slice(0,n))[n-1]=r,a):null;if(t[t.length-1]<r)return s?((a=t.slice(t.length-n))[n-1]=r,a):null;for(let s=0,o=i.length;s<o;++s){let o=i[s];if(e!=o){if(r<t[e+n-1])return null;if(r<=t[o-1])return aK(t,e,o,n,r,!1);e=o}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,e,i))}getCoordinates(){return iH(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(t){return t<0||this.ends_.length<=t?null:new aY(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLineStrings(){let t=this.flatCoordinates,e=this.ends_,i=this.layout,n=[],r=0;for(let s=0,o=e.length;s<o;++s){let o=e[s],a=new aY(t.slice(r,o),i);n.push(a),r=o}return n}getLength(){let t=this.ends_,e=0,i=0;for(let n=0,r=t.length;n<r;++n)i+=ag(this.flatCoordinates,e,t[n],this.stride),e=t[n];return i}getFlatMidpoints(){let t=[],e=this.flatCoordinates,i=0,n=this.ends_,r=this.stride;for(let s=0,o=n.length;s<o;++s){let o=n[s];f(t,aV(e,i,o,r,.5)),i=o}return t}getSimplifiedGeometryInternal(t){let e=[],i=[];return e.length=iQ(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,i),new aZ(e,"XY",i)}getType(){return"MultiLineString"}intersectsExtent(t){return ne(this.flatCoordinates,0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);let i=iY(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()}}t.s(["default",0,aZ],25933);class aq extends iG{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){f(this.flatCoordinates,t.getFlatCoordinates()),this.changed()}clone(){let t=new aq(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){if(n<tM(this.getExtent(),t,e))return n;let r=this.flatCoordinates,s=this.stride;for(let o=0,a=r.length;o<a;o+=s){let a=tg(t,e,r[o],r[o+1]);if(a<n){n=a;for(let t=0;t<s;++t)i[t]=r[o+t];i.length=s}}return n}getCoordinates(){return iq(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(t){let e=this.flatCoordinates.length/this.stride;return t<0||e<=t?null:new i3(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)}getPoints(){let t=this.flatCoordinates,e=this.layout,i=this.stride,n=[];for(let r=0,s=t.length;r<s;r+=i){let s=new i3(t.slice(r,r+i),e);n.push(s)}return n}getType(){return"MultiPoint"}intersectsExtent(t){let e=this.flatCoordinates,i=this.stride;for(let n=0,r=e.length;n<r;n+=i)if(tF(t,e[n],e[n+1]))return!0;return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=iK(this.flatCoordinates,0,t,this.stride),this.changed()}}t.s(["default",0,aq],93325);class aH extends iG{constructor(t,e,i){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!i&&!Array.isArray(t[0])){const n=t,r=[],s=[];for(let t=0,e=n.length;t<e;++t){const e=n[t],i=r.length,o=e.getEnds();for(let t=0,e=o.length;t<e;++t)o[t]+=i;f(r,e.getFlatCoordinates()),s.push(o)}e=0===n.length?this.getLayout():n[0].getLayout(),t=r,i=s}void 0!==e&&i?(this.setFlatCoordinates(e,t),this.endss_=i):this.setCoordinates(t,e)}appendPolygon(t){let e;if(this.flatCoordinates){let i=this.flatCoordinates.length;f(this.flatCoordinates,t.getFlatCoordinates()),e=t.getEnds().slice();for(let t=0,n=e.length;t<n;++t)e[t]+=i}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()}clone(){let t=this.endss_.length,e=Array(t);for(let i=0;i<t;++i)e[i]=this.endss_[i].slice();let i=new aH(this.flatCoordinates.slice(),this.layout,e);return i.applyProperties(this),i}closestPointXY(t,e,i,n){return n<tM(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,
1i,n,r){for(let s=0,o=i.length;s<o;++s){let o=i[s];r=ij(t,e,o,n,r),e=o[o.length-1]}return r}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,i,n,r,s,o,a,l,h,d){d=d||[NaN,NaN];for(let u=0,c=i.length;u<c;++u){let c=i[u];h=iX(t,e,c,n,r,s,o,a,l,h,d),e=c[c.length-1]}return h}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,n))}containsXY(t,e){return function(t,e,i,n,r,s){if(0===i.length)return!1;for(let o=0,a=i.length;o<a;++o){let a=i[o];if(i6(t,e,a,n,r,s))return!0;e=a[a.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)}getArea(){return function(t,e,i,n){let r=0;for(let s=0,o=i.length;s<o;++s){let o=i[s];r+=iN(t,e,o,n),e=o[o.length-1]}return r}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(t){let e;return void 0!==t?nl(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,i$(e,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){let t=aX(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=i8(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new aq(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){let t=this.flatCoordinates;!function(t,e,i,n,r){for(let r=0,s=i.length;r<s;++r){let s=i[r];if(!no(t,e,s,n,void 0))return!1;s.length&&(e=s[s.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=nl(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){let e=[],i=[];return e.length=function(t,e,i,n,r,s,o,a){for(let l=0,h=i.length;l<h;++l){let h=i[l],d=[];o=i1(t,e,h,n,r,s,o,d),a.push(d),e=h[h.length-1]}return o}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,i),new aH(e,"XY",i)}getPolygon(t){let e;if(t<0||this.endss_.length<=t)return null;if(0===t)e=0;else{let i=this.endss_[t-1];e=i[i.length-1]}let i=this.endss_[t].slice(),n=i[i.length-1];if(0!==e)for(let t=0,n=i.length;t<n;++t)i[t]-=e;return new nh(this.flatCoordinates.slice(e,n),this.layout,i)}getPolygons(){let t=this.layout,e=this.flatCoordinates,i=this.endss_,n=[],r=0;for(let s=0,o=i.length;s<o;++s){let o=i[s].slice(),a=o[o.length-1];if(0!==r)for(let t=0,e=o.length;t<e;++t)o[t]-=r;let l=new nh(e.slice(r,a),t,o);n.push(l),r=a}return n}getType(){return"MultiPolygon"}intersectsExtent(t){return nr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);let i=iZ(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{let t=i[i.length-1];this.flatCoordinates.length=0===t.length?0:t[t.length-1]}this.changed()}}t.s(["default",0,aH],65791);let a$=ix();class aJ{constructor(t,e,i,n,r,s){this.styleFunction,this.extent_,this.id_=s,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i||null,this.properties_=r,this.squaredTolerance_,this.stride_=n,this.simplifiedGeometry_}get(t){return this.properties_[t]}getExtent(){return this.extent_||(this.extent_="Point"===this.type_?tG(this.flatCoordinates_):tz(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){let t=tY(this.getExtent());this.flatInteriorPoints_=i4(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){let t=function(t,e){let i,n=[],r=0,s=0;for(let o=0,a=e.length;o<a;++o){let a=e[o],l=ns(t,r,a,2);if(void 0===i&&(i=l),l===i)n.push(e.slice(s,o+1));else{if(0===n.length)continue;n[n.length-1].push(e[s])}s=o+1,r=a}return n}(this.flatCoordinates_,this.ends_),e=aX(this.flatCoordinates_,0,t,2);this.flatInteriorPoints_=i8(this.flatCoordinates_,0,t,2,e)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=aV(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];let t=this.flatCoordinates_,e=0,i=this.ends_;for(let n=0,r=i.length;n<r;++n){let r=i[n],s=aV(t,e,r,2,.5);f(this.flatMidpoints_,s),e=r}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(t){return this}simplifyTransformed(t,e){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(t){let e=(t=e9(t)).getExtent(),i=t.getWorldExtent();if(e&&i){let t=t$(i)/t$(e);iw(a$,i[0],i[3],t,-t,0,0,0),ib(this.flatCoordinates_,0,this.flatCoordinates_.length,2,a$,this.flatCoordinates_)}}applyTransform(t){t(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){return new aJ(this.type_,this.flatCoordinates_.slice(),this.ends_?.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=v((t,e)=>{let i;if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);let n=this.simplifiedGeometry_.getFlatCoordinates();switch(this.type_){case"LineString":n.length=iJ(n,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,n,0),i=[n.length];break;case"MultiLineString":i=[],n.length=iQ(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,n,0,i);break;case"Polygon":i=[],n.length=i1(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),n,0,i)}return i&&(this.simplifiedGeometry_=new aJ(this.type_,n,i,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}aJ.prototype.getFlatCoordinates=aJ.prototype.getOrientedFlatCoordinates;let aQ=class{constructor(t){this.rbush_=new rP(t),this.items_={}}insert(t,e){let i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[A(e)]=i}load(t,e){let i=Array(e.length);for(let n=0,r=e.length;n<r;n++){let r=t[n],s=e[n],o={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],value:s};i[n]=o,this.items_[A(s)]=o}this.rbush_.load(i)}remove(t){let e=A(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)}update(t,e){let i=this.items_[A(e)];tN([i.minX,i.minY,i.maxX,i.maxY],t)||(this.remove(e),this.insert(t,e))}getAll(){return this.rbush_.all().map(function(t){return t.value})}getInExtent(t){let e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map(function(t){return t.value})}forEach(t){return this.forEach_(this.getAll(),t)}forEachInExtent(t,e){return this.forEach_(this.getInExtent(t),e)}forEach_(t,e){let i;for(let n=0,r=t.length;n<r&&!(i=e(t[n]));n++);return i}isEmpty(){return E(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(t){let e=this.rbush_.toJSON();return tk(e.minX,e.minY,e.maxX,e.maxY,t)}concat(t){for(let e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]}};function a0(t){return t?"function"==typeof t?t:(Array.isArray(t)||(t=[t]),e=>t):null}t.s(["default",0,aQ],30719);let a1=class extends k{constructor(t){super(),this.projection=e9(t.projection),this.attributions_=a0(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible??!0,this.loading=!1,this.state_=void 0!==t.state?t.state:"ready",this.wrapX_=void 0!==t.wrapX&&t.wrapX,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const e=this;this.viewPromise_=new Promise(function(t,i){e.viewResolver=t,e.viewRejector=i})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=a0(t),this.changed()}setState(t){this.state_=t,this.changed()}};t.s(["default",0,a1],25529);let a2={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVE
1FEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};t.s(["default",0,a2],51076);class a3 extends S{constructor(t,e,i){super(t),this.feature=e,this.features=i}}let a5=class extends a1{constructor(t){let e,i;t=t||{},super({attributions:t.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:void 0===t.wrapX||t.wrapX}),this.on,this.once,this.un,this.loader_=x,this.format_=t.format||null,this.overlaps_=void 0===t.overlaps||t.overlaps,this.url_=t.url,void 0!==t.loader?this.loader_=t.loader:void 0!==this.url_&&(to(this.format_,"`format` must be set when `url` is set"),this.loader_=aW(this.url_,this.format_)),this.strategy_=void 0!==t.strategy?t.strategy:aj;const n=void 0===t.useSpatialIndex||t.useSpatialIndex;this.featuresRtree_=n?new aQ:null,this.loadedExtentsRtree_=new aQ,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null,Array.isArray(t.features)?i=t.features:t.features&&(i=(e=t.features).getArray()),n||void 0!==e||(e=new z(i)),void 0!==i&&this.addFeaturesInternal(i),void 0!==e&&this.bindFeaturesCollection_(e)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){let e=A(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);let i=t.getGeometry();if(i){let e=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(e,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new a3(a2.ADDFEATURE,t))}setupChangeEvents_(t,e){e instanceof aJ||(this.featureChangeKeys_[t]=[I(e,a.CHANGE,this.handleFeatureChange_,this),I(e,o,this.handleFeatureChange_,this)])}addToIndex_(t,e){let i=!0;if(void 0!==e.getId()){let t=String(e.getId());if(t in this.idIndex_)if(e instanceof aJ){let n=this.idIndex_[t];n instanceof aJ?Array.isArray(n)?n.push(e):this.idIndex_[t]=[n,e]:i=!1}else i=!1;else this.idIndex_[t]=e}return i&&(to(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),i}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){let e=[],i=[],n=[];for(let e=0,n=t.length;e<n;e++){let n=t[e],r=A(n);this.addToIndex_(r,n)&&i.push(n)}for(let t=0,r=i.length;t<r;t++){let r=i[t],s=A(r);this.setupChangeEvents_(s,r);let o=r.getGeometry();if(o){let t=o.getExtent();e.push(t),n.push(r)}else this.nullGeometryFeatures_[s]=r}if(this.featuresRtree_&&this.featuresRtree_.load(e,n),this.hasListener(a2.ADDFEATURE))for(let t=0,e=i.length;t<e;t++)this.dispatchEvent(new a3(a2.ADDFEATURE,i[t]))}bindFeaturesCollection_(t){let e=!1;this.addEventListener(a2.ADDFEATURE,function(i){e||(e=!0,t.push(i.feature),e=!1)}),this.addEventListener(a2.REMOVEFEATURE,function(i){e||(e=!0,t.remove(i.feature),e=!1)}),t.addEventListener(s.ADD,t=>{e||(e=!0,this.addFeature(t.element),e=!1)}),t.addEventListener(s.REMOVE,t=>{e||(e=!0,this.removeFeature(t.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(let t in this.featureChangeKeys_)this.featureChangeKeys_[t].forEach(b);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(let t in this.featuresRtree_.forEach(t=>{this.removeFeatureInternal(t)}),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[t]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};let e=new a3(a2.CLEAR);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){let i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,function(i){let n=i.getGeometry();if(n instanceof aJ||n.intersectsCoordinate(t))return e(i)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(i){let n=i.getGeometry();if(n instanceof aJ||n.intersectsExtent(t)){let t=e(i);if(t)return t}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),E(this.nullGeometryFeatures_)||f(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){let e=[];return this.forEachFeatureAtCoordinateDirect(t,function(t){e.push(t)}),e}getFeaturesInExtent(t,e){return this.featuresRtree_?e&&e.canWrapX()&&this.getWrapX()?[].concat(...t9(t,e).map(t=>this.featuresRtree_.getInExtent(t))):this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){let i=t[0],n=t[1],r=null,s=[NaN,NaN],o=1/0,a=[-1/0,-1/0,1/0,1/0];return e=e||m,this.featuresRtree_.forEachInExtent(a,function(t){if(e(t)){let e=t.getGeometry(),l=o;if((o=e instanceof aJ?0:e.closestPointXY(i,n,s,o))<l){r=t;let e=Math.sqrt(o);a[0]=i-e,a[1]=n-e,a[2]=i+e,a[3]=n+e}}}),r}getExtent(t){return this.featuresRtree_.getExtent(t)}getFeatureById(t){let e=this.idIndex_[t.toString()];return void 0!==e?e:null}getFeatureByUid(t){let e=this.uidIndex_[t];return void 0!==e?e:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(t){let e=t.target,i=A(e),n=e.getGeometry();if(n){let t=n.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(t,e)):this.featuresRtree_&&this.featuresRtree_.update(t,e)}else i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);let r=e.getId();if(void 0!==r){let t=r.toString();this.idIndex_[t]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[t]=e)}
1else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new a3(a2.CHANGEFEATURE,e))}hasFeature(t){let e=t.getId();return void 0!==e?e in this.idIndex_:A(t)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&E(this.nullGeometryFeatures_):!this.featuresCollection_||0===this.featuresCollection_.getLength()}loadFeatures(t,e,i){let n=this.loadedExtentsRtree_,r=this.strategy_(t,e,i);for(let t=0,s=r.length;t<s;++t){let s=r[t];n.forEachInExtent(s,function(t){return tL(t.extent,s)})||(++this.loadingExtentsCount_,this.dispatchEvent(new a3(a2.FEATURESLOADSTART)),this.loader_.call(this,s,e,i,t=>{--this.loadingExtentsCount_,this.dispatchEvent(new a3(a2.FEATURESLOADEND,void 0,t))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new a3(a2.FEATURESLOADERROR))}),n.insert(s,{extent:s.slice()}))}this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){let e=this.loadedExtentsRtree_,i=e.forEachInExtent(t,function(e){if(tN(e.extent,t))return e});i&&e.remove(i)}removeFeatures(t){let e=!1;for(let i=0,n=t.length;i<n;++i)e=this.removeFeatureInternal(t[i])||e;e&&this.changed()}removeFeature(t){!t||this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){let e=A(t);if(!(e in this.uidIndex_))return!1;e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t);let i=this.featureChangeKeys_[e];i?.forEach(b),delete this.featureChangeKeys_[e];let n=t.getId();if(void 0!==n){let e=n.toString(),i=this.idIndex_[e];i===t?delete this.idIndex_[e]:Array.isArray(i)&&(i.splice(i.indexOf(t),1),1===i.length&&(this.idIndex_[e]=i[0]))}return delete this.uidIndex_[e],this.hasListener(a2.REMOVEFEATURE)&&this.dispatchEvent(new a3(a2.REMOVEFEATURE,t)),!0}removeFromIdIndex_(t){for(let e in this.idIndex_)if(this.idIndex_[e]===t){delete this.idIndex_[e];break}}setLoader(t){this.loader_=t}setUrl(t){to(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader(aW(t,this.format_))}setOverlaps(t){this.overlaps_=t,this.changed()}};t.s(["default",0,a5],39442);let a6="units",a4=[1,2,5],a8=25.4/.28,a9=class extends nk{constructor(t){t=t||{};const e=document.createElement("div");e.style.pointerEvents="none",super({element:e,render:t.render,target:t.target}),this.on,this.once,this.un;const i=void 0!==t.className?t.className:t.bar?"ol-scale-bar":"ol-scale-line";this.innerElement_=document.createElement("div"),this.innerElement_.className=i+"-inner",this.element.className=i+" "+nw,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=void 0!==t.minWidth?t.minWidth:64,this.maxWidth_=t.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",this.addChangeListener(a6,this.handleUnitsChanged_),this.setUnits(t.units||"metric"),this.scaleBar_=t.bar||!1,this.scaleBarSteps_=t.steps||4,this.scaleBarText_=t.text||!1,this.dpi_=t.dpi||void 0}getUnits(){return this.get(a6)}handleUnitsChanged_(){this.updateElement_()}setUnits(t){this.set(a6,t)}setDpi(t){this.dpi_=t}updateElement_(){let t,e,i,n,r,s=this.viewState_;if(!s){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}let o=s.center,a=s.projection,l=this.getUnits(),h=e7(a,s.resolution,o,"degrees"==l?"degrees":"m"),d=this.minWidth_*(this.dpi_||a8)/a8,u=void 0!==this.maxWidth_?this.maxWidth_*(this.dpi_||a8)/a8:void 0,c=d*h,g="";if("degrees"==l){let t=ex.degrees;(c*=t)<t/60?(g="â³",h*=3600):c<t?(g="â²",h*=60):g="°"}else if("imperial"==l)c<.9144?(g="in",h/=.0254):c<1609.344?(g="ft",h/=.3048):(g="mi",h/=1609.344);else if("nautical"==l)h/=1852,g="NM";else if("metric"==l)c<1e-6?(g="nm",h*=1e9):c<.001?(g="μm",h*=1e6):c<1?(g="mm",h*=1e3):c<1e3?g="m":(g="km",h/=1e3);else if("us"==l)c<.9144?(g="in",h*=39.37):c<1609.344?(g="ft",h/=.30480061):(g="mi",h/=1609.3472);else throw Error("Invalid units");let f=3*Math.floor(Math.log(d*h)/Math.log(10)),_=0;for(;;){let s=Math.pow(10,i=Math.floor(f/3));if(isNaN(e=Math.round((t=a4[(f%3+3)%3]*s)/h))){this.element.style.display="none",this.renderedVisible_=!1;return}if(void 0!==u&&e>=u){t=_,e=n,i=r;break}if(e>=d)break;_=t,n=e,r=i,++f}let p=this.scaleBar_?this.createScaleBar(e,t,g):t.toFixed(i<0?-i:0)+" "+g;this.renderedHTML_!=p&&(this.innerElement_.innerHTML=p,this.renderedHTML_=p),this.renderedWidth_!=e&&(this.innerElement_.style.width=e+"px",this.renderedWidth_=e),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(t,e,i){let n=this.getScaleForResolution(),r=n<1?Math.round(1/n).toLocaleStr
1ing()+" : 1":"1 : "+Math.round(n).toLocaleString(),s=this.scaleBarSteps_,o=t/s,a=[this.createMarker("absolute")];for(let n=0;n<s;++n){let r=n%2==0?"ol-scale-singlebar-odd":"ol-scale-singlebar-even";a.push(`<div><div class="ol-scale-singlebar ${r}" style="width: ${o}px;"></div>`+this.createMarker("relative")+(n%2==0||2===s?this.createStepText(n,t,!1,e,i):"")+"</div>")}return a.push(this.createStepText(s,t,!0,e,i)),(this.scaleBarText_?`<div class="ol-scale-text" style="width: ${t}px;">`+r+"</div>":"")+a.join("")}createMarker(t){return`<div class="ol-scale-step-marker" style="position: ${t}; top: ${"absolute"===t?3:-10}px;"></div>`}createStepText(t,e,i,n,r){let s=0===t?0:Math.round(n/this.scaleBarSteps_*t*100)/100,o=0===t?-3:-(e/this.scaleBarSteps_*1),a=0===t?0:e/this.scaleBarSteps_*2;return`<div class="ol-scale-step-text" style="margin-left: ${o}px;text-align: ${0===t?"left":"center"};min-width: ${a}px;left: ${i?e+"px":"unset"};">`+s+(0===t?"":" "+r)+"</div>"}getScaleForResolution(){return 1e3/25.4*e7(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m")*(this.dpi_||a8)}render(t){let e=t.frameState;e?this.viewState_=e.viewState:this.viewState_=null,this.updateElement_()}};t.s(["ScaleLine",0,a9],50718);var a7,lt,le=t.i(75254);let li=(0,le.default)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);t.s(["CircleIcon",()=>li],33498);let ln=(0,le.default)("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);t.s(["Maximize",()=>ln],74344);let lr=(0,le.default)("Ruler",[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]]);t.s(["Ruler",()=>lr],59386);var ls=t.i(70896),lo=t.i(66027);t.s(["useActiveCapturePoints",0,()=>(0,lo.useQuery)({queryKey:["CACHE_KEY_CAPTURE_POINTS"],queryFn:ls.default.getActiveCapturePoints,refetchInterval:6e4})],23923);let la=(0,le.default)("Minimize",[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]);t.s(["Minimize",()=>la],57504)},73179,t=>{"use strict";let e;t.s(["default",()=>it],73179);var i=t.i(18050),n=t.i(71645),r=t.i(77011),s=t.i(64829),o=t.i(33697),a=t.i(39442),l=t.i(50718),h=t.i(45185),d=t.i(53420),u=t.i(17552),c=t.i(58e3),g=t.i(16677),f=t.i(9496),_=t.i(33498),p=t.i(74344),m=t.i(59386),y=t.i(23923),x=t.i(19455),v=t.i(76639),C=t.i(57504),w=t.i(62278);let E=({children:t,onOpenChange:e,measurementTargetCoord:r,onMeasurementTargetChange:s,showMeasurement:o,onShowMeasurementChange:a,mapViewState:l,onMapViewStateChange:h,userLocation:d,onUserLocationChange:u,showUserLocationRadius:c,onShowUserLocationRadiusChange:g})=>{let[f,_]=(0,n.useState)(!1),m=t=>{_(t),e?.(t)};return(0,i.jsxs)(v.Dialog,{open:f,onOpenChange:m,children:[(0,i.jsx)(v.DialogTrigger,{asChild:!0,children:t||(0,i.jsx)(x.Button,{variant:"outline",size:"sm",className:"ml-2 bg-gray-700 hover:bg-gray-600 border-gray-600 text-white",children:(0,i.jsx)(p.Maximize,{className:"h-4 w-4"})})}),(0,i.jsx)(v.DialogContent,{className:"max-w-full max-h-full w-screen h-screen p-0 border-0 !rounded-none bg-gray-900",style:{borderRadius:0},children:(0,i.jsxs)("div",{className:"w-full h-full relative",children:[(0,i.jsx)(w.default,{fullHeight:!0,hideFullscreenButton:!0,measurementTargetCoord:r,onMeasurementTargetChange:s,showMeasurement:o,onShowMeasurementChange:a,mapViewState:l,onMapViewStateChange:h,userLocation:d,onUserLocationChange:u,showUserLocationRadius:c,onShowUserLocationRadiusChange:g}),(0,i.jsx)(x.Button,{variant:"outline",size:"sm",className:"absolute top-2 right-2 z-[1001] bg-gray-700 hover:bg-gray-600 border-gray-600 text-white backdrop-blur-sm",onClick:()=>m(!1),children:(0,i.jsx)(C.Minimize,{className:"h-4 w-4"})})]})})]})};var S=t.i(71701),R=t.i(11365),I=t.i(52258),T=t.i(75192),b=t.i(30812);class M extends T.default{constructor(t,e,i){super(),i=i||{},this.tileCoord=t,this.state=e,this.key="",this.transition_=void 0===i.transition?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(I.default.CHANGE)}release(){this.setState(S.default.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==S.default.EMPTY){if(this.state!==S.default.ERROR&&this.state>t)throw Error("Tile load sequence violation");this.state=t,this.changed()}}load(){(0,b.abstract)()}getAlpha(t,e){if(!this.transition_)return 1;let i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;let n=e-i+1e3/60;return n>=this.transition_?1:(0,R.easeIn)(n/this.transition_)}inTransition(t){return!!this.transition_&&-1!==this.transitionStarts_[t]}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}let P=M;var L=t.i(13685);function F(t){return t instanceof Image||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageBitmap?t:null}let A=Error("disposed"),D=[256,256],k=class extends P{constructor(t){super(t.tileCoord,S.default.IDLE,{transition:t.transition,interpolate:t.interpolate}),this.loader_=t.loader,this.data_=null,this.error_=null,this.size_=t.size||null,this.controller_=t.controller||null}getSize(){if(this.size_)return this.size_;let t=F(this.data_);return t?[t.width,t.height]:D}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==S.default.IDLE&&this.state!==S.default.ERROR)return;this.state=S.default.LOADING,this.changed();let t=this;this.loader_().then(function(e){t.data_=e,t.state=S.default.LOADED,t.changed()}).catch(function(e){t.error_=e,t.state=S.default.ERROR,t.changed()})}disposeInternal(){this.controller_&&(this.controller_.abort(A),this.controller_=null),super.disposeInternal()}};var O=t.i(62442);let G=class extends P{constructor(t,e,i,n,r,s){super(t,e,s),this.crossOrigin_=n,this.src_=i,this.key=i,this.image_=new Image,null!==n&&(this.image_.crossOrigin=n),this.unlisten_=null,this.tileLoadFunction_=r}getImage(){return this.image_}setImage(t){this.image_=t,this.state=S.default.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){let t;this.state=S.default.ERROR,this.unlistenImage_(),this.image_=((t=(0,L.createCanvasContext2D)(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()}handleImageLoad_(){let t=this.image_;
1t.naturalWidth&&t.naturalHeight?this.state=S.default.LOADED:this.state=S.default.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==S.default.ERROR&&(this.state=S.default.IDLE,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==S.default.IDLE&&(this.state=S.default.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=(0,O.listenImage)(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}};class z{constructor(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)}
1getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function N(t,e,i,n,r){return void 0!==r?(r.minX=t,r.maxX=e,r.minY=i,r.maxY=n,r):new z(t,e,i,n)}var U=t.i(88553),W=t.i(56843),j=t.i(35937),B=t.i(3970);let X=[];function V(t,e,i,n,r){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(n,r),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(i,r)),t.restore()}function K(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function Y(t,e,i,n){let r=(0,d.transform)(i,e,t),s=(0,d.getPointResolution)(e,n,i),o=e.getMetersPerUnit();void 0!==o&&(s*=o);let a=t.getMetersPerUnit();void 0!==a&&(s/=a);let l=t.getExtent();if(!l||(0,W.containsCoordinate)(l,r)){let e=(0,d.getPointResolution)(t,s,r)/s;isFinite(e)&&e>0&&(s/=e)}return s}function Z(t,i,n,r,s,o,a,l,h,d,u,c,g,f){let _,p=(0,L.createCanvasContext2D)(Math.round(n*t),Math.round(n*i),X);if(c||(p.imageSmoothingEnabled=!1),0===h.length)return p.canvas;function m(t){return Math.round(t*n)/n}p.scale(n,n),p.globalCompositeOperation="lighter";let y=(0,W.createEmpty)();h.forEach(function(t,e,i){(0,W.extend)(y,t.extent)});let x=n/r,v=(c?1:1.0000000596046448)/x;if(!g||1!==h.length||0!==d){if(_=(0,L.createCanvasContext2D)(Math.round((0,W.getWidth)(y)*x),Math.round((0,W.getHeight)(y)*x),X),c||(_.imageSmoothingEnabled=!1),s&&f){let t=(s[0]-y[0])*x,e=-(s[3]-y[3])*x,i=(0,W.getWidth)(s)*x,n=(0,W.getHeight)(s)*x;_.rect(t,e,i,n),_.clip()}h.forEach(function(t,e,i){if(t.image.width>0&&t.image.height>0){if(t.clipExtent){_.save();let e=(t.clipExtent[0]-y[0])*x,i=-(t.clipExtent[3]-y[3])*x,n=(0,W.getWidth)(t.clipExtent)*x,r=(0,W.getHeight)(t.clipExtent)*x;_.rect(c?e:Math.round(e),c?i:Math.round(i),c?n:Math.round(e+n)-Math.round(e),c?r:Math.round(i+r)-Math.round(i)),_.clip()}let e=(t.extent[0]-y[0])*x,i=-(t.extent[3]-y[3])*x,n=(0,W.getWidth)(t.extent)*
1x,r=(0,W.getHeight)(t.extent)*x;_.drawImage(t.image,d,d,t.image.width-2*d,t.image.height-2*d,c?e:Math.round(e),c?i:Math.round(i),c?n:Math.round(e+n)-Math.round(e),c?r:Math.round(i+r)-Math.round(i)),t.clipExtent&&_.restore()}})}let C=(0,W.getTopLeft)(a);return l.getTriangles().forEach(function(t,i,n){let r,s=t.source,a=t.target,l=s[0][0],d=s[0][1],u=s[1][0],g=s[1][1],f=s[2][0],x=s[2][1],w=m((a[0][0]-C[0])/o),E=m(-(a[0][1]-C[1])/o),S=m((a[1][0]-C[0])/o),R=m(-(a[1][1]-C[1])/o),I=m((a[2][0]-C[0])/o),T=m(-(a[2][1]-C[1])/o),b=l,M=d;l=0,d=0;let P=[[u-=b,g-=M,0,0,S-w],[f-=b,x-=M,0,0,I-w],[0,0,u,g,R-E],[0,0,f,x,T-E]],F=(0,B.solveLinearSystem)(P);if(F){if(p.save(),p.beginPath(),function(){if(void 0===e){let t=(0,L.createCanvasContext2D)(6,6,X);t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",V(t,4,5,4,0),V(t,4,5,0,5);let i=t.getImageData(0,0,3,3).data;e=K(i,0)||K(i,4)||K(i,8),(0,L.releaseCanvas)(t),X.push(t.canvas)}return e}()||!c){p.moveTo(S,R);let t=w-S,e=E-R;for(let i=0;i<4;i++)p.lineTo(S+m((i+1)*t/4),R+m(i*e/3)),3!=i&&p.lineTo(S+m((i+1)*t/4),R+m((i+1)*e/3));p.lineTo(I,T)}else p.moveTo(S,R),p.lineTo(w,E),p.lineTo(I,T);if(p.clip(),p.transform(F[0],F[2],F[1],F[3],w,E),p.translate(y[0]-b,y[3]-M),_)r=_.canvas,p.scale(v,-v);else{let t=h[0],e=t.extent;r=t.image,p.scale((0,W.getWidth)(e)/r.width,-(0,W.getHeight)(e)/r.height)}p.drawImage(r,0,0),p.restore()}}),_&&((0,L.releaseCanvas)(_),X.push(_.canvas)),u&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,l.getTriangles().forEac
1h(function(t,e,i){let n=t.target,r=(n[0][0]-C[0])/o,s=-(n[0][1]-C[1])/o,a=(n[1][0]-C[0])/o,l=-(n[1][1]-C[1])/o,h=(n[2][0]-C[0])/o,d=-(n[2][1]-C[1])/o;p.beginPath(),p.moveTo(a,l),p.lineTo(r,s),p.lineTo(h,d),p.closePath(),p.stroke()}),p.restore()),p.canvas}var q=t.i(63932);let H=class{constructor(t,e,i,n,r,s,o){this.sourceProj_=t,this.targetProj_=e;let a={};const l=o?(0,d.createTransformFromCoordinateTransform)(t=>(0,q.apply)(o,(0,d.transform)(t,this.targetProj_,this.sourceProj_))):(0,d.getTransform)(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){let e=t[0]+"/"+t[1];return a[e]||(a[e]=l(t)),a[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&(0,W.getWidth)(n)>=(0,W.getWidth)(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?(0,W.getWidth)(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?(0,W.getWidth)(this.targetProj_.getExtent()):null;const h=(0,W.getTopLeft)(i),u=(0,W.getTopRight)(i),c=(0,W.getBottomRight)(i),g=(0,W.getBottomLeft)(i),f=this.transformInv_(h),_=this.transformInv_(u),p=this.transformInv_(c),m=this.transformInv_(g),y=10+(s?Math.max(0,Math.ceil(Math.log2((0,W.getArea)(i)/(s*s*65536)))):0);if(this.addQuad_(h,u,c,g,f,_,p,m,y),this.wrapsXInSource_){let t=1/0;this.triangles_.forEach(function(e,i,n){t=Math.min(t,e.source[0][0],e.source[1][0],e.source[2][0])}),this.triangles_.forEach(e=>{if(Math.max(e.source[0][0],e.source[1][0],e.source[2][0])-t>this.sourceWorldWidth_/2){let i=[[e.source[0][0],e.source[0][1]],[e.source[1][0],e.source[1][1]],[e.source[2][0],e.source[2][1]]];i[0][0]-t>this.sourceWorldWidth_/2&&(i[0][0]-=this.sourceWorldWidth_),i[1][0]-t>this.sourceWorldWidth_/2&&(i[1][0]-=this.sourceWorldWidth_),i[2][0]-t>this.sourceWorldWidth_/2&&(i[2][0]-=this.sourceWorldWidth_);let n=Math.min(i[0][0],i[1][0],i[2][0]);Math.max(i[0][0],i[1][0],i[2][0])-n<this.sourceWorldWidth_/2&&(e.source=i)}})}a={}}addTriangle_(t,e,i,n,r,s){this.triangles_.push({source:[n,r,s],target:[t,e,i]})}addQuad_(t,e,i,n,r,s,o,a,l){let h=(0,W.boundingExtent)([r,s,o,a]),d=this.sourceWorldWidth_?(0,W.getWidth)(h)/this.sourceWorldWidth_:null,u=this.sourceWorldWidth_,c=this.sourceProj_.canWrapX()&&d>.5&&d<1,g=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){let r=(0,W.boundingExtent)([t,e,i,n]);g=(0,W.getWidth)(r)/this.targetWorldWidth_>.25||g}!c&&this.sourceProj_.isGlobal()&&d&&(g=d>.25||g)}if(!g&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!(0,W.intersects)(h,this.maxSourceExtent_))return;let f=0;if(!g&&(!isFinite(r[0])||!isFinite(r[1])||!isFinite(s[0])||!isFinite(s[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1]))){if(l>0)g=!0;else if(1!=(f=8*!(isFinite(r[0])&&isFinite(r[1]))+4*!(isFinite(s[0])&&isFinite(s[1]))+2*!(isFinite(o[0])&&isFinite(o[1]))+ +!(isFinite(a[0])&&isFinite(a[1])))&&2!=f&&4!=f&&8!=f)return}if(l>0){if(!g){let e,n=[(t[0]+i[0])/2,(t[1]+i[1])/2],s=this.transformInv_(n);e=c?((0,B.modulo)(r[0],u)+(0,B.modulo)(o[0],u))/2-(0,B.modulo)(s[0],u):(r[0]+o[0])/2-s[0];let a=(r[1]+o[1])/2-s[1];g=e*e+a*a>this.errorThresholdSquared_}if(g){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){let h=[(e[0]+i[0])/2,(e[1]+i[1])/2],d=this.transformInv_(h),u=[(n[0]+t[0])/2,(n[1]+t[1])/2],c=this.transformInv_(u);this.addQuad_(t,e,h,u,r,s,d,c,l-1),this.addQuad_(u,h,i,n,c,d,o,a,l-1)}else{let h=[(t[0]+e[0])/2,(t[1]+e[1])/2],d=this.transformInv_(h),u=[(i[0]+n[0])/2,(i[1]+n[1])/2],c=this.transformInv_(u);this.addQuad_(t,h,u,n,r,d,c,a,l-1),this.addQuad_(h,e,i,u,d,s,o,c,l-1)}return}}if(c){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(11&f)==0&&this.addTriangle_(t,i,n,r,o,a),(14&f)==0&&this.addTriangle_(t,i,e,r,o,s),f&&((13&f)==0&&this.addTriangle_(e,n,t,s,a,r),(7&f)==0&&this.addTriangle_(e,n,i,s,a,o))}calculateSourceExtent(){let t=(0,W.createEmpty)();return this.triangles_.forEach(function(e,i,n){let r=e.source;(0,W.extendCoordinate)(t,r[0]),(0,W.extendCoordinate)(t,r[1]),(0,W.extendCoordinate)(t,r[2])}),t}getTriangles(){return this.triangles_}},$=class extends P{constructor(t,e,i,n,r,s,o,a,l,h,d,u){super(r,S.default.IDLE,u),this.renderEdges_=void 0!==d&&d,this.pixelRatio_=o,this.gutter_=a,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=n,this.wrappedTileCoord_=s||r,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=t.canWrapX()?t.getExtent():void 0;const c=n.getTileCoordExtent(this.wrappedTileCoord_),g=this.targetTileGrid_.getExtent();let f=this.sourceTileGrid_.getExtent();const _=g?(0,W.getIntersection)(c,g):c;if(0===(0,W.getArea)(_)){this.state=S.default.EMPTY;return}const p=t.getExtent();p&&(f=f?(0,W.getIntersection)(f,p):p);const m=n.getResolution(this.wrappedTileCoord_[0]),y=function(t,e,
1i,n){let r=Y(t,e,(0,W.getCenter)(i),n);return(!isFinite(r)||r<=0)&&(0,W.forEachCorner)(i,function(i){return isFinite(r=Y(t,e,i,n))&&r>0}),r}(t,i,_,m);if(!isFinite(y)||y<=0||(this.triangulation_=new H(t,i,_,f,y*(void 0!==h?h:.5),m),0===this.triangulation_.getTriangles().length)){this.state=S.default.EMPTY;return}this.sourceZ_=e.getZForResolution(y);let x=this.triangulation_.calculateSourceExtent();if(f&&(t.canWrapX()?(x[1]=(0,B.clamp)(x[1],f[1],f[3]),x[3]=(0,B.clamp)(x[3],f[1],f[3])):x=(0,W.getIntersection)(x,f)),(0,W.getArea)(x)){let i=0,n=0;t.canWrapX()&&(i=(0,W.getWidth)(p),n=Math.floor((x[0]-p[0])/i)),(0,W.wrapAndSliceX)(x.slice(),t,!0).forEach(t=>{let r=e.getTileRangeForExtentAndZ(t,this.sourceZ_);for(let t=r.minX;t<=r.maxX;t++)for(let e=r.minY;e<=r.maxY;e++){let r=l(this.sourceZ_,t,e,o);if(r){let t=n*i;this.sourceTiles_.push({tile:r,offset:t})}}++n}),0===this.sourceTiles_.length&&(this.state=S.default.EMPTY)}else this.state=S.default.EMPTY}getImage(){return this.canvas_}reproject_(){let t=[];if(this.sourceTiles_.forEach(e=>{let i=e.tile;if(i&&i.getState()==S.default.LOADED){let n=this.sourceTileGrid_.getTileCoordExtent(i.tileCoord);n[0]+=e.offset,n[2]+=e.offset;let r=this.clipExtent_?.slice();r&&(r[0]+=e.offset,r[2]+=e.offset),t.push({extent:n,clipExtent:r,image:i.getImage()})}}),this.sourceTiles_.length=0,0===t.length)this.state=S.default.ERROR;else{let e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],r="number"==typeof i?i:i[1],s=this.targetTileGrid_.getResolution(e),o=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Z(n,r,this.pixelRatio_,o,this.sourceTileGrid_.getExtent(),s,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=S.default.LOADED}this.changed()}load(){if(this.state==S.default.IDLE){this.state=S.default.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:e})=>{let i=e.getState();if(i==S.default.IDLE||i==S.default.LOADING){t++;let i=(0,j.listen)(e,I.default.CHANGE,n=>{let r=e.getState();(r==S.default.LOADED||r==S.default.ERROR||r==S.default.EMPTY)&&((0,j.unlistenByKey)(i),0==--t&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(i)}}),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:t},e,i){t.getState()==S.default.IDLE&&t.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(j.unlistenByKey),this.sourcesListenerKeys_=null}release(){this.canvas_&&((0,L.releaseCanvas)(this.canvas_.getContext("2d")),X.push(this.canvas_),this.canvas_=null),super.release()}};var J=t.i(82554),Q=t.i(13872),tt=t.i(56513);let te=class{constructor(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){let t=this.pop();t instanceof Q.default&&t.dispose()}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.deleteOldest()}clear(){for(;this.oldest_;)this.deleteOldest()}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){let i=this.entries_[t];return(0,tt.assert)(void 0!==i,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(t){let e=this.entries_[t];return(0,tt.assert)(void 0!==e,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){let t,e=Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e}getValues(){let t,e=Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){return this.entries_[t]?.value_}pop(){let t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){(0,tt.assert)(!(t in this.entries_),"Tried to set a value for a key that is used already");let i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_}setSize(t){this.highWaterMark=t}};function ti(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function tn(t){var e,i;return e=t[0],i=t[1],(i<<e)+t[2]}var tr=t.i(79784);function ts(t,e,i,n,r){return`${(0,b.getUid)(t)},${e},${i+"/"+n+"/"+r}`}function to(t,e,i){if(!(i in t))return t[i]=new Set([e]),!0;let n=t[i],r=n.has(e);
1return r||n.add(e),!r}function ta(t,e){let i=t.layerStatesArray[t.layerIndex];i.extent&&(e=(0,W.getIntersection)(e,(0,d.fromUserExtent)(i.extent,t.viewState.projection)));let n=i.layer.getRenderSource();if(!n.getWrapX()){let i=n.getTileGridForProjection(t.viewState.projection).getExtent();i&&(e=(0,W.getIntersection)(e,i))}return e}class tl extends tr.default{constructor(t,e){super(t),e=e||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=(0,W.createEmpty)(),this.tempTileRange_=new z(0,0,0,0),this.tempTileCoord_=ti(0,0,0);const i=void 0!==e.cacheSize?e.cacheSize:512;this.tileCache_=new te(i),this.maxStaleKeys=.5*i}getTileCache(){return this.tileCache_}getOrCreateTile(t,e,i,n){let r,s=this.tileCache_,o=this.getLayer().getSource(),a=ts(o,o.getKey(),t,e,i);if(s.containsKey(a))r=s.get(a);else{if(!(r=o.getTile(t,e,i,n.pixelRatio,n.viewState.projection)))return null;s.set(a,r)}return r}getTile(t,e,i,n){let r=this.getOrCreateTile(t,e,i,n);return r||null}getData(t){let e=this.frameState;if(!e)return null;let i=this.getLayer(),n=(0,q.apply)(e.pixelToCoordinateTransform,t.slice()),r=i.getExtent();if(r&&!(0,W.containsCoordinate)(r,n))return null;let s=e.viewState,o=i.getRenderSource(),a=o.getTileGridForProjection(s.projection),l=o.getTilePixelRatio(e.pixelRatio);for(let t=a.getZForResolution(s.resolution);t>=a.getMinZoom();--t){let i,r=a.getTileCoordForCoordAndZ(n,t),h=this.getTile(t,r[1],r[2],e);if(!h||h.getState()!==S.default.LOADED)continue;let d=a.getOrigin(t),u=(0,J.toSize)(a.getTileSize(t)),c=a.getResolution(t);if(h instanceof G||h instanceof $)i=h.getImage();else if(!(h instanceof k))continue;else if(!(i=F(h.getData())))continue;let g=Math.floor(l*((n[0]-d[0])/c-r[1]*u[0])),f=Math.floor(l*((d[1]-n[1])/c-r[2]*u[1])),_=Math.round(l*o.getGutterForProjection(s.projection));return this.getImageData(i,g+_,f+_)}return null}prepareFrame(t){this.renderedProjection?t.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=t.viewState.projection):this.renderedProjection=t.viewState.projection;let e=this.getLayer().getSource();if(!e)return!1;let i=e.getRevision();return this.renderedSourceRevision_?this.renderedSourceRevision_!==i&&(this.renderedSourceRevision_=i,this.renderedSourceKey_===e.getKey()&&this.tileCache_.clear()):this.renderedSourceRevision_=i,!0}enqueueTiles(t,e,i,n,r){let s=t.viewState,o=this.getLayer(),a=o.getRenderSource(),l=a.getTileGridForProjection(s.projection),h=(0,b.getUid)(a);h in t.wantedTiles||(t.wantedTiles[h]={});let d=t.wantedTiles[h],u=o.getMapInternal(),c=Math.max(i-r,l.getMinZoom(),l.getZForResolution(Math.min(o.getMaxResolution(),u?u.getView().getResolutionForZoom(Math.max(o.getMinZoom(),0)):l.getResolution(0)),a.zDirection)),g=s.rotation,f=g?(0,W.getRotatedViewport)(s.center,s.resolution,g,t.size):void 0;for(let r=i;r>=c;--r){let i=l.getTileRangeForExtentAndZ(e,r,this.tempTileRange_),s=l.getResolution(r);for(let e=i.minX;e<=i.maxX;++e)for(let o=i.minY;o<=i.maxY;++o){if(g&&!l.tileCoordIntersectsViewport([r,e,o],f))continue;let i=this.getTile(r,e,o,t);if(!i||!to(n,i,r))continue;let a=i.getKey();if(d[a]=!0,i.getState()===S.default.IDLE&&!t.tileQueue.isKeyQueued(a)){let n=ti(r,e,o,this.tempTileCoord_);t.tileQueue.enqueue([i,h,l.getTileCoordCenter(n),s])}}}}findStaleTile_(t,e){let i=this.tileCache_,n=t[0],r=t[1],s=t[2],o=this.getStaleKeys();for(let t=0;t<o.length;++t){let a=ts(this.getLayer().getSource(),o[t],n,r,s);if(i.containsKey(a)){let t=i.peek(a);if(t.getState()===S.default.LOADED)return t.endTransition((0,b.getUid)(this)),to(e,t,n),!0}}return!1}findAltTiles_(t,e,i,n){let r=t.getTileRangeForTileCoordAndZ(e,i,this.tempTileRange_);if(!r)return!1;let s=!0,o=this.tileCache_,a=this.getLayer().getRenderSource(),l=a.getKey();for(let t=r.minX;t<=r.maxX;++t)for(let e=r.minY;e<=r.maxY;++e){let r=ts(a,l,i,t,e),h=!1;if(o.containsKey(r)){let t=o.peek(r);t.getState()===S.default.LOADED&&(to(n,t,i),h=!0)}h||(s=!1)}return s}renderFrame(t,e){let i;this.renderComplete=!0;let n=t.layerStatesArray[t.layerIndex],r=t.viewState,s=r.projection,o=r.resolution,a=r.center,l=t.pixelRatio,h=this.getLayer(),u=h.getSource(),c=u.getTileGridForProjection(s),g=c.getZForResolution(o,u.zDirection),f=c.getResolution(g),_=u.getKey();this.renderedSourceKey_?this.renderedSourceKey_!==_&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=_):this.renderedSourceKey_=_;let p=t.extent,m=u.getTilePixelRatio(l);this.prepareContainer(t,e);let y=this.context.canvas.width,x=this.context.canvas.height,v=n.extent&&(0,d.fromUserExtent)(n.extent,s);v&&(p=(0,W.getIntersection)(p,(0,d.fromUserExtent)(n.extent,s)));let C=f*y/2/m,w=f*x/2/m,E=[a[0]-C,a[1]-w,a[0]+C,a[1]+w],R={};this.renderedTiles.length=0;let I=h.getPreload();if(t.nextExtent){let e=c.getZForResolution(r.nextResolution,u.zDirection),i=ta(t,t.nextExtent);this.enqueueTiles(t,i,e,R,I)}let T=ta(t,p);if(this.enqueueTiles(t,T,g,R,0),I>0&&setTimeout(()=>{this.enqueueTiles(t,T,g-1,R,I-1)},0),!(g in R))return this.container;let M=(0,b.getUid)(this),P=t.time;for(let e of R[g]){let i=e.getState();if(i===S.default.EMPTY)continue;let n=e.tileCoord;if(i===S.default.LOADED&&1===e.getAlpha(M,P)){e.endTransition(M);continue}if(i!==S.default.ERROR&&(this.renderComplete=!1),this.findStaleTile_(n,R)){!function(t,e,
1i){let n=t[i];n&&n.delete(e)}(R,e,g),t.animate=!0;continue}if(this.findAltTiles_(c,n,g+1,R))continue;let r=c.getMinZoom();for(let t=g-1;t>=r&&!this.findAltTiles_(c,n,t,R);--t);}let L=f/o*l/m,F=this.getRenderContext(t);(0,q.compose)(this.tempTransform,y/2,x/2,L,L,0,-y/2,-x/2),n.extent&&this.clipUnrotated(F,t,v),u.getInterpolate()||(F.imageSmoothingEnabled=!1),this.preRender(F,t);let A=Object.keys(R).map(Number);A.sort(U.ascending);let D=[],k=[];for(let e=A.length-1;e>=0;--e){let n=A[e],r=u.getTilePixelSize(n,l,s),o=c.getResolution(n)/f,a=r[0]*o*L,h=r[1]*o*L,d=c.getTileCoordForCoordAndZ((0,W.getTopLeft)(E),n),g=c.getTileCoordExtent(d),_=(0,q.apply)(this.tempTransform,[m*(g[0]-E[0])/f,m*(E[3]-g[3])/f]),p=m*u.getGutterForProjection(s);for(let e of R[n]){if(e.getState()!==S.default.LOADED)continue;let r=e.tileCoord,s=d[1]-r[1],o=Math.round(_[0]-(s-1)*a),l=d[2]-r[2],c=Math.round(_[1]-(l-1)*h),g=Math.round(_[0]-s*a),f=Math.round(_[1]-l*h),m=o-g,y=c-f,x=1===A.length,v=!1;i=[g,f,g+m,f,g+m,f+y,g,f+y];for(let t=0,e=D.length;t<e;++t)if(!x&&n<k[t]){let e=D[t];(0,W.intersects)([g,f,g+m,f+y],[e[0],e[3],e[4],e[7]])&&(v||(F.save(),v=!0),F.beginPath(),F.moveTo(i[0],i[1]),F.lineTo(i[2],i[3]),F.lineTo(i[4],i[5]),F.lineTo(i[6],i[7]),F.moveTo(e[6],e[7]),F.lineTo(e[4],e[5]),F.lineTo(e[2],e[3]),F.lineTo(e[0],e[1]),F.clip())}D.push(i),k.push(n),this.drawTile(e,t,g,f,m,y,p,x),v&&F.restore(
1),this.renderedTiles.unshift(e),this.updateUsedTiles(t.usedTiles,u,e)}}if(this.renderedResolution=f,this.extentChanged=!this.renderedExtent_||!(0,W.equals)(this.renderedExtent_,E),this.renderedExtent_=E,this.renderedPixelRatio=l,this.postRender(this.context,t),n.extent&&F.restore(),F.imageSmoothingEnabled=!0,this.renderComplete){let e=(t,e)=>{let i=(0,b.getUid)(u),n=e.wantedTiles[i],r=n?Object.keys(n).length:0;this.updateCacheSize(r),this.tileCache_.expireCache()};t.postRenderFunctions.push(e)}return this.container}updateCacheSize(t){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,2*t)}drawTile(t,e,i,n,r,s,o,a){let l;if(t instanceof k){if(!(l=F(t.getData())))throw Error("Rendering array data is not yet supported")}else l=this.getTileImage(t);if(!l)return;let h=this.getRenderContext(e),d=(0,b.getUid)(this),u=e.layerStatesArray[e.layerIndex],c=u.opacity*(a?t.getAlpha(d,e.time):1),g=c!==h.globalAlpha;g&&(h.save(),h.globalAlpha=c),h.drawImage(l,o,o,l.width-2*o,l.height-2*o,i,n,r,s),g&&h.restore(),c!==u.opacity?e.animate=!0:a&&t.endTransition(d)}getImage(){let t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}updateUsedTiles(t,e,i){let n=(0,b.getUid)(e);n in t||(t[n]={}),t[n][i.getKey()]=!0}}var th=t.i(79703);let td="preload",tu="useInterimTilesOnError";class tc extends th.default{constructor(t){const e=Object.assign({},t=t||{}),i=t.cacheSize;delete t.cacheSize,delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.cacheSize_=i,this.setPreload(void 0!==t.preload?t.preload:0),this.setUseInterimTilesOnError(void 0===t.useInterimTilesOnError||t.useInterimTilesOnError)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(td)}setPreload(t){this.set(td,t)}getUseInterimTilesOnError(){return this.get(tu)}setUseInterimTilesOnError(t){this.set(tu,t)}getData(t){return super.getData(t)}}let tg=tc,tf=class extends tg{constructor(t){super(t)}createRenderer(){return new tl(this,{cacheSize:this.getCacheSize()})}};var t_=t.i(27749),tp=t.i(11229),tm=t.i(52062);let ty=[0,0,0],tx=class{constructor(t){let e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,(0,tt.assert)((0,U.isSorted)(this.resolutions_,(t,e)=>e-t,!0),"`resolutions` must be sorted in descending order"),!t.origins)for(let t=0,i=this.resolutions_.length-1;t<i;++t)if(e){if(this.resolutions_[t]/this.resolutions_[t+1]!==e){e=void 0;break}}else e=this.resolutions_[t]/this.resolutions_[t+1];this.zoomFactor_=e,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,(0,tt.assert)(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const i=t.extent;void 0===i||this.origin_||this.origins_||(this.origin_=(0,W.getTopLeft)(i)),(0,tt.assert)(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,(0,tt.assert)(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:tm.DEFAULT_TILE_SIZE,(0,tt.assert)(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=void 0!==i?i:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((t,e)=>{let n=new z(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(i){let t=this.getTileRangeForExtentAndZ(i,e);n.minX=Math.max(t.minX,n.minX),n.maxX=Math.min(t.maxX,n.maxX),n.minY=Math.max(t.minY,n.minY),n.maxY=Math.min(t.maxY,n.maxY)}return n}):i&&this.calculateTileRanges_(i)}forEachTileCoord(t,e,i){let n=this.getTileRangeForExtentAndZ(t,e);for(let t=n.minX,r=n.maxX;t<=r;++t)for(let r=n.minY,s=n.maxY;r<=s;++r)i([e,t,r])}forEachTileCoordParentTileRange(t,e,i,n){let r,s,o,a=null,l=t[0]-1;for(2===this.zoomFactor_?(s=t[1],o=t[2]):a=this.getTileCoordExtent(t,n);l>=this.minZoom;){if(r=void 0!==s&&void 0!==o?N(s=Math.floor(s/2),s,o=Math.floor(o/2),o,i):this.getTileRangeForExtentAndZ(a,l,i),e(l,r))return!0;--l}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){let i=2*t[1],n=2*t[2];return N(i,i+1,n,n+1,e)}let n=this.getTileCoordExtent(t,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(n,t[0]+1,e)}return null}getTileRangeForTileCoordAndZ(t,e,i){if(e>this.maxZoom||e<this.minZoom)return null;let n=t[0],r=t[1],s=t[2];if(e===n)return N(r,s,r,s,i);if(this.zoomFactor_){let t=Math.pow(this.zoomFactor_,e-n),o=Math.floor(r*t),a=Math.floor(s*t);return e<n?N(o,o,a,a,i):N(o,Math.floor(t*(r+1))-1,a,Math.floor(t*(s+1))-1,i)}let o=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,e,i)}getTileRangeForExtentAndZ(t,e,i){this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,ty);let n=ty[1],r=ty[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,ty),N(n,ty[1],r,ty[2],i)}getTileCoordCenter(t){let e=this.getOrigin(t[0]),i=this.getResolution(t[0]),n=(0,J.toSize)(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*i,e[1]-(t[2]+.5)*n[1]*i]}getTileCoordExtent(t,e){let i=this.getOrigin(t[0]),n=this.getResolution(t[0]),r=(0,J.toSize)(this.getTileSize(t[0]),this.tmpSize_),s=i[0]+t[1]*r[0]*n,o=i[1]-(t[2]+1)*r[1]*n,a=s+r[0]*n,l=o+r[1]*n;return(0,W.createOrUpdate)(s,o,a,l,e)}
1getTileCoordForCoordAndResolution(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)}getTileCoordForXYAndResolution_(t,e,i,n,r){let s=this.getZForResolution(i),o=i/this.getResolution(s),a=this.getOrigin(s),l=(0,J.toSize)(this.getTileSize(s),this.tmpSize_),h=o*(t-a[0])/i/l[0],d=o*(a[1]-e)/i/l[1];return n?(h=(0,B.ceil)(h,5)-1,d=(0,B.ceil)(d,5)-1):(h=(0,B.floor)(h,5),d=(0,B.floor)(d,5)),ti(s,h,d,r)}getTileCoordForXYAndZ_(t,e,i,n,r){let s=this.getOrigin(i),o=this.getResolution(i),a=(0,J.toSize)(this.getTileSize(i),this.tmpSize_),l=(t-s[0])/o/a[0],h=(s[1]-e)/o/a[1];return n?(l=(0,B.ceil)(l,5)-1,h=(0,B.ceil)(h,5)-1):(l=(0,B.floor)(l,5),h=(0,B.floor)(h,5)),ti(i,l,h,r)}getTileCoordForCoordAndZ(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)}getTileCoordResolution(t){return this.resolutions_[t[0]]}getTileSize(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]}getFullTileRange(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null}getZForResolution(t,e){let i=(0,U.linearFindNearest)(this.resolutions_,t,e||0);return(0,B.clamp)(i,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(t,e){return(0,tp.intersectsLinearRing)(e,0,e.length,2,this.getTileCoordExtent(t))}calculateTileRanges_(t){let e=this.resolutions_.length,i=Array(e);for(let n=this.minZoom;n<e;++n)i[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=i}};function tv(t){let e=t.getDefaultTileGrid();return e||(e=function(t,e,i,n){var r,s;let o;return r=tw(t),s=(s=void 0,"top-left"),o=tC(r,void 0,void 0),new tx({extent:r,origin:(0,W.getCorner)(r,s),resolutions:o,tileSize:void 0})}(t),t.setDefaultTileGrid(e)),e}function tC(t,e,i,n){e=void 0!==e?e:tm.DEFAULT_MAX_ZOOM,i=(0,J.toSize)(void 0!==i?i:tm.DEFAULT_TILE_SIZE);let r=(0,W.getHeight)(t),s=(0,W.getWidth)(t);n=n>0?n:Math.max(s/i[0],r/i[1]);let o=e+1,a=Array(o);for(let t=0;t<o;++t)a[t]=n/Math.pow(2,t);return a}function tw(t){let e=(t=(0,d.get)(t)).getExtent();if(!e){let i=180*t_.METERS_PER_UNIT.degrees/t.getMetersPerUnit();e=(0,W.createOrUpdate)(-i,-i,i,i)}return e}function tE(t,e){let i=[];Object.keys(e).forEach(function(t){null!==e[t]&&void 0!==e[t]&&i.push(t+"="+encodeURIComponent(e[t]))});let n=i.join("&");return t=t.replace(/[?&]$/,""),(t+=t.includes("?")?"&":"?")+n}let tS=/\{z\}/g,tR=/\{x\}/g,tI=/\{y\}/g,tT=/\{-y\}/g;var tb=t.i(9025),tM=t.i(25529);class tP extends tM.default{constructor(t){super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX,interpolate:t.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,this.tileGrid=void 0!==t.tileGrid?t.tileGrid:null,this.tileGrid&&(0,J.toSize)(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),[256,256]),this.tmpSize=[0,0],this.key_=t.key||(0,b.getUid)(this),this.tileOptions={transition:t.transition,interpolate:t.interpolate},this.zDirection=t.zDirection?t.zDirection:0}getGutterForProjection(t){return 0}getKey(){return this.key_}setKey(t){this.key_!==t&&(this.key_=t,this.changed())}getResolutions(t){let e=t?this.getTileGridForProjection(t):this.tileGrid;return e?e.getResolutions():null}getTile(t,e,i,n,r){return(0,b.abstract)()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){return this.tileGrid?this.tileGrid:tv(t)}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,e,i){let n=this.getTileGridForProjection(i),r=this.getTilePixelRatio(e),s=(0,J.toSize)(n.getTileSize(t),this.tmpSize);return 1==r?s:(0,J.scale)(s,r,this.tmpSize)}getTileCoordForTileUrlFunction(t,e){let i=void 0!==e?e:this.getProjection(),n=void 0!==e?this.getTileGridForProjection(i):this.tileGrid||this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){let n=e[0],r=t.getTileCoordCenter(e),s=tw(i);if(!(0,W.containsCoordinate)(s,r)){let e=(0,W.getWidth)(s),i=Math.ceil((s[0]-r[0])/e);return r[0]+=e*i,t.getTileCoordForCoordAndZ(r,n)}return e}(n,t,i)),!function(t,e){let i=t[0],n=t[1],r=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;let s=e.getFullTileRange(i);return!s||s.containsXY(n,r)}(t,n)?null:t}clear(){}refresh(){this.clear(),super.refresh()}}class tL extends tb.default{constructor(t,e){super(t),this.tile=e}}let tF=tP;class tA extends tF{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===tA.prototype.tileUrlFunction,this.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(this.tileUrlFunction=t.tileUrlFunction),this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(t){let e,i=t.target,n=(0,b.getUid)(i),r=i.getState();r==S.default.LOADING?(this.tileLoadingKeys_[n]=!0,e="tileloadstart"):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=r==S.default.ERROR?"tileloaderror":r==S.default.LOADED?"tileloadend":void 0),void 0!=e&&this.dispatchEvent(new tL(e,i))}setTileLoadFunction(t){this.tileLoadFunction=t,this.changed()}setTileUrlFunction(t,e){this.tileUrlFunction=t,void 0!==e?this.setKey(e):this.changed()}setUrl(t){let e=function(t){let e=[],i=/\{([a-z])-([a-z])\}/.exec(t);
1if(i){let n,r=i[1].charCodeAt(0),s=i[2].charCodeAt(0);for(n=r;n<=s;++n)e.push(t.replace(i[0],String.fromCharCode(n)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){let n=parseInt(i[2],10);for(let r=parseInt(i[1],10);r<=n;r++)e.push(t.replace(i[0],r.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)}setUrls(t){this.urls=t;let e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(function(t,e){var i;let n=t.length,r=Array(n);for(let i=0;i<n;++i)r[i]=function(t,e){return function(i,n,r){var s,o,a;let l;if(!i)return;let h=i[0];if(e){let t=e.getFullTileRange(h);t&&(l=t.getHeight()-1)}return s=i[1],o=i[2],a=l,t.replace(tS,h.toString()).replace(tR,s.toString()).replace(tI,o.toString()).replace(tT,function(){if(void 0===a)throw Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(a-o).toString()})}}(t[i],e);return 1===(i=r).length?i[0]:function(t,e,n){if(!t)return;let r=tn(t),s=(0,B.modulo)(r,i.length);return i[s](t,e,n)}}(t,this.tileGrid),e):this.setKey(e)}tileUrlFunction(t,e,i){}}let tD=tA;function tk(t,e){t.getImage().src=e}let tO=class extends tD{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:tk,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:void 0===t.interpolate||t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.crossOrigin=void 0!==t.crossOrigin?t.crossOrigin:null,this.tileClass=void 0!==t.tileClass?t.tileClass:G,this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(t){return this.getProjection()&&t&&!(0,d.equivalent)(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getTileGridForProjection(t){let e=this.getProjection();if(this.tileGrid&&(!e||(0,d.equivalent)(e,t)))return this.tileGrid;let i=(0,b.getUid)(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=tv(t)),this.tileGridForProjection[i]}createTile_(t,e,i,n,r,s){let o=[t,e,i],a=this.getTileCoordForTileUrlFunction(o,r),l=a?this.tileUrlFunction(a,n,r):void 0,h=new this.tileClass(o,void 0!==l?S.default.IDLE:S.default.EMPTY,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=s,h.addEventListener(I.default.CHANGE,this.handleTileChange.bind(this)),h}getTile(t,e,i,n,r){let s=this.getProjection();if(!s||!r||(0,d.equivalent)(s,r))return this.getTileInternal(t,e,i,n,s||r);let o=[t,e,i],a=this.getKey(),l=this.getTileGridForProjection(s),h=this.getTileGridForProjection(r),u=this.getTileCoordForTileUrlFunction(o,r),c=new $(s,l,r,h,o,u,this.getTilePixelRatio(n),this.getGutter(),(t,e,i,n)=>this.getTileInternal(t,e,i,n,s),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return c.key=a,c}getTileInternal(t,e,i,n,r){let s=this.getKey();return this.createTile_(t,e,i,n,r,s)}setRenderReprojectionEdges(t){this.renderReprojectionEdges_!=t&&(this.renderReprojectionEdges_=t,this.changed())}setTileGridForProjection(t,e){let i=(0,d.get)(t);if(i){let t=(0,b.getUid)(i);t in this.tileGridForProjection||(this.tileGridForProjection[t]=e)}}},tG=class extends tO{constructor(t){const e=void 0!==(t=t||{}).projection?t.projection:"EPSG:3857";super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:void 0!==t.tileGrid?t.tileGrid:function(t){let e=t||{},i=e.extent||(0,d.get)("EPSG:3857").getExtent();return new tx({extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:tC(i,e.maxZoom,e.tileSize,e.maxResolution)})}({extent:tw(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize}),tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=void 0!==t.gutter?t.gutter:0}getGutter(){return this.gutter_}},tz=class extends tG{constructor(t){let e;e=void 0!==(t=t||{}).attributions?t.attributions:['© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.'],super({attributions:e,attributionsCollapsible:!1,
1cacheSize:t.cacheSize,crossOrigin:void 0!==t.crossOrigin?t.crossOrigin:"anonymous",interpolate:t.interpolate,maxZoom:void 0!==t.maxZoom?t.maxZoom:19,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:void 0!==t.url?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png",wrapX:t.wrapX,zDirection:t.zDirection})}};var tN=t.i(14913),tU=t.i(93021),tW=tb,tj=O;tj.default;tW.default,tM.default;let tB="1.3.0";function tX(t,e){return Object.assign({REQUEST:e,SERVICE:"WMS",VERSION:tB,FORMAT:"image/png",STYLES:"",TRANSPARENT:"TRUE"},t)}let tV=class extends tO{constructor(t){const e=Object.assign({},(t=t||{}).params);super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,zDirection:t.zDirection}),this.gutter_=void 0!==t.gutter?t.gutter:0,this.params_=e,this.v13_=!0,this.serverType_=t.serverType,this.hidpi_=void 0===t.hidpi||t.hidpi,this.tmpExtent_=(0,W.createEmpty)(),this.updateV13_(),this.setKey(this.getKeyForParams_())}getFeatureInfoUrl(t,e,i,n){let r=(0,d.get)(i),s=this.getProjection()||r,o=this.getTileGrid();o||(o=this.getTileGridForProjection(s));let a=(0,d.transform)(t,r,s),l=Y(s,r,t,e),h=o.getZForResolution(l,this.zDirection),u=o.getResolution(h),c=o.getTileCoordForCoordAndZ(a,h);if(o.getResolutions().length<=c[0])return;let g=o.getTileCoordExtent(c,this.tmpExtent_),f=this.gutter_;0!==f&&(g=(0,W.buffer)(g,u*f,g));let _={QUERY_LAYERS:this.params_.LAYERS};Object.assign(_,tX(this.params_,"GetFeatureInfo"),n);let p=Math.floor((a[0]-g[0])/u),m=Math.floor((g[3]-a[1])/u);return _[this.v13_?"I":"X"]=p,_[this.v13_?"J":"Y"]=m,this.getRequestUrl_(c,g,1,s||r,_)}getLegendUrl(t,e){if(void 0===this.urls[0])return;let i={SERVICE:"WMS",VERSION:tB,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){let t=this.params_.LAYERS;if(!(!Array.isArray(t)||1===t.length))return;i.LAYER=t}return void 0!==t&&(i.SCALE=t*(this.getProjection()?this.getProjection().getMetersPerUnit():1)/28e-5),Object.assign(i,e),tE(this.urls[0],i)}getGutter(){return this.gutter_}getParams(){return this.params_}getRequestUrl_(t,e,i,n,r){let s,o=this.urls;if(o){if(1==o.length)s=o[0];else{let e=(0,B.modulo)(tn(t),o.length);s=o[e]}return function(t,e,i,n,r,s,o){var a;let l,h;s=Object.assign({REQUEST:"GetMap"},s);let d=e/i,u=[(0,B.round)((0,W.getWidth)(t)/d,4),(0,B.round)((0,W.getHeight)(t)/d,4)];if(1!=i)switch(o){case"geoserver":let c=90*i+.5|0;"FORMAT_OPTIONS"in s?s.FORMAT_OPTIONS+=";dpi:"+c:s.FORMAT_OPTIONS="dpi:"+c;break;case"mapserver":s.MAP_RESOLUTION=90*i;break;case"carmentaserver":case"qgis":s.DPI=90*i;break;default:throw Error("Unknown `serverType` configured")}return(a=s).WIDTH=u[0],a.HEIGHT=u[1],l=n.getAxisOrientation(),h=(0,tN.compareVersions)(a.VERSION,"1.3")>=0,a[h?"CRS":"SRS"]=n.getCode(),a.BBOX=(h&&l.startsWith("ne")?[t[1],t[0],t[3],t[2]]:t).join(","),tE(r,a)}(e,(this.tileGrid||this.getTileGridForProjection(n)).getResolution(t[0]),i,n,s,r,this.serverType_)}}getTilePixelRatio(t){return this.hidpi_&&void 0!==this.serverType_?t:1}getKeyForParams_(){let t=0,e=[];for(let i in this.params_)e[t++]=i+"-"+this.params_[i];return e.join("/")}setParams_(t){this.params_=t,this.updateV13_(),this.setKey(this.getKeyForParams_())}setParams(t){this.setParams_(Object.assign({},t))}updateParams(t){this.setParams_(Object.assign(this.params_,t))}updateV13_(){let t=this.params_.VERSION||tB;this.v13_=(0,tN.compareVersions)(t,"1.3")>=0}tileUrlFunction(t,e,i){let n=this.getTileGrid();if(n||(n=this.getTileGridForProjection(i)),n.getResolutions().length<=t[0])return;1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);let r=n.getResolution(t[0]),s=n.getTileCoordExtent(t,this.tmpExtent_),o=this.gutter_;0!==o&&(s=(0,W.buffer)(s,r*o,s));let a=Object.assign({},tX(this.params_,"GetMap"));return this.getRequestUrl_(t,s,e,i,a)}},tK=t=>{switch(t){case"satellite":return new tf({source:new tG({url:"https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",attributions:"© Google"})});case"hybrid":return new tf({source:new tG({url:"https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}",attributions:"© Google"})});case"terrain":return new tf({source:new tG({url:"https://mt1.google.com/vt/lyrs=p&x={x}&y={y}&z={z}",attributions:"© Google"})});case"cuzk":return new tf({source:new tV({url:"https://ags.cuzk.gov.cz/arcgis1/services/ZTM/ZTM10/MapServer/WMSServer",params:{LAYERS:"0",FORMAT:"image/png",TRANSPARENT:!1},attributions:"© ÄÃZK â ZTM 10/S-JTSK"})});default:return new tf({source:new tz})}};class tY{source;constructor(t){this.source=t}removeFeatureById(t){let e=this.source.getFeatureById(t);
1e&&this.source.removeFeature(e)}removeFeaturesByIds(t){t.forEach(t=>this.removeFeatureById(t))}addFeature(t){this.source.addFeature(t)}clear(){this.source.clear()}}var tZ=t.i(77267),tq=t.i(18530),tH=t.i(43136),t$=t.i(66184);let tJ=(t,e)=>{if(t.startsWith("rgba")||t.startsWith("rgb"))return t.startsWith("rgb(")?t.replace("rgb(","rgba(").replace(")",`, ${e})`):t.replace(/[\d.]+\)$/,`${e})`);let i=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),r=parseInt(t.slice(5,7),16);return`rgba(${i}, ${n}, ${r}, ${e})`},tQ=t=>{let e=[4,8,4,8];if(!t)return e;let i=t.replace(/px/g,"").trim().split(/\s+/).map(Number);if(1===i.length){let t=i[0];return[t,t,t,t]}if(2===i.length){let t=i[0],e=i[1];return[t,e,t,e]}return 4===i.length?[i[0],i[1],i[2],i[3]]:e},t0=t=>["S","SV","V","JV","J","JZ","Z","SZ"][Math.round(t/45)%8],t1=t=>t>=1e3?`${(t/1e3).toFixed(2)} km`:`${Math.round(t)} m`,t2=(t,e)=>{let i=180/Math.PI*Math.atan2(e[0]-t[0],e[1]-t[1]);return i<0&&(i+=360),i},t3=(t,e)=>{let i=(0,d.toLonLat)(t),n=i[1]*Math.PI/180,r=i[0]*Math.PI/180,s=e/6378137,o=Math.asin(Math.sin(n)*Math.cos(s)+Math.cos(n)*Math.sin(s)*1),a=[180*(r+Math.atan2(0*Math.sin(s)*Math.cos(n),Math.cos(s)-Math.sin(n)*Math.sin(o)))/Math.PI,180*o/Math.PI],l=(0,d.fromLonLat)(a);return Math.sqrt(Math.pow(l[0]-t[0],2)+Math.pow(l[1]-t[1],2))};class t5 extends tY{render(t,e){let i=(0,d.fromLonLat)([t.center.lng,t.center.lat]),n=t.cols*t.cellSizeLng*111320*Math.cos(t.center.lat*Math.PI/180),r=t.rows*t.cellSizeLat*111320,s=n/2,o=r/2;this.drawGridLines(t,i,s,o,n,r),t.showLabels&&this.drawGridLabels(t,i,s,o,n,r),e||this.drawGridControls(i,s,o)}drawGridLines(t,e,i,n,r,s){for(let r=0;r<=t.rows;r++){let o=-n+r*s/t.rows,a=[e[0]-i,e[1]+o],l=[e[0]+i,e[1]+o],h=new tZ.default({geometry:new tH.default([a,l])});h.set("type","grid-line"),h.setStyle(new u.default({stroke:new g.default({color:t.strokeColor,width:t.strokeWeight})})),this.addFeature(h)}for(let s=0;s<=t.cols;s++){let o=-i+s*r/t.cols,a=[e[0]+o,e[1]-n],l=[e[0]+o,e[1]+n],h=new tZ.default({geometry:new tH.default([a,l])});h.set("type","grid-line"),h.setStyle(new u.default({stroke:new g.default({color:t.strokeColor,width:t.strokeWeight})})),this.addFeature(h)}}drawGridLabels(t,e,i,n,r,s){let o=r/t.cols,a=s/t.rows;for(let r=0;r<t.rows;r++)for(let s=0;s<t.cols;s++){let l=[e[0]-i+(s+.5)*o,e[1]+n-(r+.5)*a],h=`${String.fromCharCode(65+r)}${s+1}`,d=new tZ.default({geometry:new tq.default(l)});d.set("type","grid-label");let g=t.labelColor;void 0!==t.labelOpacity&&1!==t.labelOpacity&&(g=tJ(g,t.labelOpacity)),d.setStyle(new u.default({text:new t$.default({text:h,font:`bold ${t.labelSize} sans-serif`,fill:new c.default({color:g})})})),this.addFeature(d)}}drawGridControls(t,e,i){let n=new tZ.default({geometry:new tq.default(t)});n.setId("grid-center"),n.set("type","grid-control"),n.setStyle(new u.default({image:new f.default({radius:10,fill:new c.default({color:"#ff9900"}),stroke:new g.default({color:"#fff",width:3})})})),this.addFeature(n),[{id:"grid-corner-ne",x:1,y:1},{id:"grid-corner-nw",x:-1,y:1},{id:"grid-corner-se",x:1,y:-1},{id:"grid-corner-sw",x:-1,y:-1}].forEach(n=>{let r=t[0]+n.x*e,s=t[1]+n.y*i,o=new tZ.default({geometry:new tq.default([r,s])});o.setId(n.id),o.set("type","grid-control"),o.set("cornerType",n.id),o.setStyle(new u.default({image:new f.default({radius:8,fill:new c.default({color:"#00ff00"}),stroke:new g.default({color:"#fff",width:3})})})),this.addFeature(o)})}}var t6=t.i(71733);class t4 extends tY{renderAll(t){t.forEach(t=>this.render(t))}render(t){let e=new tZ.default({geometry:new t6.default([t.coords])}),i=t.fillColor||"#0096ff",n=t.strokeColor||"#007aff",r=t.fillOpacity??.2,s=t.strokeOpacity??1,o=t.strokeWeight??2,a=tJ(i,r),l=tJ(n,s),h=t.labelFontSize||"14px",d=t.labelFontWeight||"bold",f=t.labelColor||"#ffffff",_=t.labelBackgroundColor,p=tQ(t.labelPadding);e.setStyle(new u.default({fill:new c.default({color:a}),stroke:new g.default({color:l,width:o}),text:t.label?new t$.default({text:t.label,font:`${d} ${h} sans-serif`,fill:new c.default({color:f}),backgroundFill:_?new c.default({color:_}):void 0,padding:p,textBaseline:"middle",textAlign:"center"}):void 0})),e.setId(t.id),e.set("type","zone"),this.addFeature(e)}}var t8=t.i(12206);class t9 extends tY{svgIconCache;readOnly;activeCapturePoints;constructor(t,e,i,n){super(t),this.svgIconCache=e,this.readOnly=i,this.activeCapturePoints=n}setActiveCapturePoints(t){this.activeCapturePoints=t}renderAll(t){t.forEach(t=>this.render(t))}render(t){let e=new tZ.default({geometry:new tq.default(t.coord)});e.setId(`point-${t.id}`),e.set("type","point");let{pointColor:i,pointLabelColor:n,isHeldByCapturePoint:r}=this.getPointColors(t),s=t.labelFontSize||"20px",o=t.labelFontWeight||"bold",a=tQ(t.labelPadding);t.customHTML?this.renderCustomSVGPoint(e,t,i,s,o,n,a):this.renderCirclePoint(e,t,i,r,s,o,n,a),this.addFeature(e)}getPointColors(t){let e=t.color||"#007aff",i=t.labelColor||"#ffffff",n=!1;if("objective"===t.type&&(e=t.color||"#ff6b35",i=t.labelColor||"#ff6b35"),this.readOnly&&t.capturePointId&&this.activeCapturePoints){let r=this.activeCapturePoints.find(e=>e.id===t.capturePointId);r?.heldBy?.color&&(e=r.heldBy.color,i=r.heldBy.color,n=!0)}return{pointColor:e,pointLabelColor:i,isHeldByCapturePoint:n}}renderCustomSVGPoint(t,e,i,n,r,s,o){let a=e.customHTML;if("objective"!==e.type||e.color||(a=a.replace(/fill="[^"]*"/g,'fill="#ff6b35"')),this.readOnly&&e.capturePointId&&this.activeCapturePoints){let t=this.activeCapturePoints.find(t=>
1t.id===e.capturePointId);t?.heldBy?.color&&(a=a.replace(/fill="[^"]*"/g,`fill="${t.heldBy.color}"`))}let l=a;if(this.svgIconCache[l])t.setStyle(new u.default({image:new t8.default({img:this.svgIconCache[l],size:[e.size||36,e.size||36],anchor:[.5,.5]}),text:e.label?new t$.default({text:e.label,font:`${r} ${n} sans-serif`,offsetY:(e.size||36)/2+10,fill:new c.default({color:s}),padding:o}):void 0}));else{let i=new Image;i.src="data:image/svg+xml;utf8,"+encodeURIComponent(a),i.onload=()=>{this.svgIconCache[l]=i,t.setStyle(new u.default({image:new t8.default({img:i,size:[e.size||36,e.size||36],anchor:[.5,.5]}),text:e.label?new t$.default({text:e.label,font:`${r} ${n} sans-serif`,offsetY:(e.size||36)/2+10,fill:new c.default({color:s}),padding:o}):void 0}))}}}renderCirclePoint(t,e,i,n,r,s,o,a){t.setStyle(new u.default({image:new f.default({radius:(e.size||36)/6,fill:new c.default({color:i}),stroke:new g.default({color:!n&&"objective"===e.type&&!e.strokeColor&&e.strokeColor||"#fff",width:e.strokeWidth||2})}),text:e.label?new t$.default({text:e.label,font:`${s} ${r} sans-serif`,offsetY:-15,fill:new c.default({color:o}),padding:a}):void 0}))}}class t7 extends tY{renderAll(t){t.forEach(t=>this.render(t))}render(t){let e=new tZ.default({geometry:new tq.default(t.coord)});e.setId(`label-${t.id}`),e.set("type","label"),e.setStyle(new u.default({image:new f.default({radius:8,fill:new c.default({color:"rgba(255, 255, 255, 0.01)"}),stroke:new g.default({color:"rgba(255, 255, 255, 0.3)",width:1})}),text:new t$.default({text:t.text,font:`bold ${t.fontSize||"16px"} sans-serif`,fill:new c.default({color:t.color||"#fff"}),offsetY:0})})),this.addFeature(e)}}var et=t.i(59703),ee=t.i(1336),ei=t.i(83332);class en extends et.default{constructor(t,e,i){super(),void 0!==i&&void 0===e?this.setFlatCoordinates(i,t):(e=e||0,this.setCenterAndRadius(t,e,i))}clone(){let t=new en(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){let r=this.flatCoordinates,s=t-r[0],o=e-r[1],a=s*s+o*o;if(a<n){if(0===a)for(let t=0;t<this.stride;++t)i[t]=r[t];else{let t=this.getRadius()/Math.sqrt(a);i[0]=r[0]+t*s,i[1]=r[1]+t*o;for(let t=2;t<this.stride;++t)i[t]=r[t]}return i.length=this.stride,a}return n}containsXY(t,e){let i=this.flatCoordinates,n=t-i[0],r=e-i[1];return n*n+r*r<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(t){let e=this.flatCoordinates,i=e[this.stride]-e[0];return(0,W.createOrUpdate)(e[0]-i,e[1]-i,e[0]+i,e[1]+i,t)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){let t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e}getType(){return"Circle"}intersectsExtent(t){let e=this.getExtent();if((0,W.intersects)(t,e)){let e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||t[1]<=e[1]&&t[3]>=e[1]||(0,W.forEachCorner)(t,this.intersectsCoordinate.bind(this))}return!1}setCenter(t){let e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+i;for(let i=1;i<e;++i)n[e+i]=t[i];this.setFlatCoordinates(this.layout,n),this.changed()}setCenterAndRadius(t,e,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);let n=this.flatCoordinates,r=(0,ee.deflateCoordinate)(n,0,t,this.stride);n[r++]=n[0]+e;for(let t=1,e=this.stride;t<e;++t)n[r++]=n[t];n.length=r,this.changed()}getCoordinates(){return null}setCoordinates(t,e){}setRadius(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()}rotate(t,e){let i=this.getCenter(),n=this.getStride();this.setCenter((0,ei.rotate)(i,0,i.length,n,t,e,i)),this.changed()}}en.prototype.transform;class er extends tY{FEATURE_IDS={MARKER:"user-location",RADIUS_50:"user-location-radius-50",RADIUS_100:"user-location-radius-100",LABEL_50:"user-location-radius-label-50",LABEL_100:"user-location-radius-label-100"};render(t,e){this.clearUserLocationFeatures(),this.renderLocationMarker(t),e&&this.renderRadiusCircles(t)}clearUserLocationFeatures(){Object.values(this.FEATURE_IDS).forEac
1h(t=>this.removeFeatureById(t))}renderLocationMarker(t){let e=new tZ.default({geometry:new tq.default(t)});e.setId(this.FEATURE_IDS.MARKER),e.set("type","user-location"),e.setStyle(new u.default({image:new f.default({radius:8,fill:new c.default({color:"#4285F4"}),stroke:new g.default({color:"#ffffff",width:3})})})),this.addFeature(e)}renderRadiusCircles(t){let e="#FF9800",i=(0,d.toLonLat)(t),n=t3(t,50),r=t3(t,100);this.renderCircle(t,n,this.FEATURE_IDS.RADIUS_50,e,[4,4],.08),this.renderRadiusLabel(i,50,this.FEATURE_IDS.LABEL_50,e,"50 m"),this.renderCircle(t,r,this.FEATURE_IDS.RADIUS_100,e,[2,6],.04),this.renderRadiusLabel(i,100,this.FEATURE_IDS.LABEL_100,e,"100 m")}renderCircle(t,e,i,n,r,s){let o=new tZ.default({geometry:new en(t,e)});o.setId(i),o.set("type","user-location-radius"),o.setStyle(new u.default({stroke:new g.default({color:n,width:2,lineDash:r}),fill:new c.default({color:`rgba(255,152,0,${s})`})})),this.addFeature(o)}renderRadiusLabel(t,e,i,n,r){let s,o,a,l,h,f=(s=t[1]*Math.PI/180,o=t[0]*Math.PI/180,h=Math.asin(Math.sin(s)*Math.cos(a=e/6378137)+Math.cos(s)*Math.sin(a)*Math.cos(l=0*Math.PI/180)),[180*(o+Math.atan2(Math.sin(l)*Math.sin(a)*Math.cos(s),Math.cos(a)-Math.sin(s)*Math.sin(h)))/Math.PI,180*h/Math.PI]),_=(0,d.fromLonLat)(f),p=new tZ.default({geometry:new tq.default(_)});p.setId(i),p.setStyle(new u.default({text:new t$.default({text:r,font:"bold 14px sans-serif",fill:new c.default({color:n}),stroke:new g.default({color:"#fff",width:3}),textAlign:"center",offsetY:-10})})),this.addFeature(p)}}var es=t.i(1292);class eo extends tY{measurementLine=null;render(t,e){this.clear();let i=new tZ.default({geometry:new tH.default([t,e])});i.set("type","measurement-line"),i.set("targetCoord",e);let n=(0,es.getDistance)((0,d.toLonLat)(t),(0,d.toLonLat)(e)),r=t2(t,e),s=t1(n),o=t0(r);return i.setStyle(new u.default({stroke:new g.default({color:"#FF9800",width:4,lineDash:[10,10]}),text:new t$.default({text:`${s} ${Math.round(r)}\xb0 ${o}`,font:"bold 16px sans-serif",fill:new c.default({color:"#FF9800"}),stroke:new g.default({color:"#ffffff",width:3}),placement:"line",textAlign:"center",overflow:!0})})),this.addFeature(i),this.measurementLine=i,i}update(t){if(!this.measurementLine)return;let e=this.measurementLine.get("targetCoord");if(!e)return;this.measurementLine.getGeometry().setCoordinates([t,e]);let i=(0,es.getDistance)((0,d.toLonLat)(t),(0,d.toLonLat)(e)),n=t2(t,e),r=t1(i),s=t0(n);this.measurementLine.setStyle(new u.default({stroke:new g.default({color:"#FF9800",width:4,lineDash:[10,10]}),text:new t$.default({text:`${r} ${Math.round(n)}\xb0 ${s}`,font:"bold 16px sans-serif",fill:new c.default({color:"#FF9800"}),stroke:new g.default({color:"#ffffff",width:3}),placement:"line",textAlign:"center",overflow:!0})}))}getMeasurementLine(){return this.measurementLine}clear(){this.measurementLine&&(this.source.removeFeature(this.measurementLine),this.measurementLine=null)}}var ea=t.i(68529),el=t.i(41096),eh=t.i(40399),ed=tb,eu=t.i(95068),ec=t.i(40631),eg=t.i(75261);class ef extends eg.default{constructor(t){super(),this.geometries_=t,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(j.unlistenByKey),this.changeEventsKeys_.length=0}listenGeometriesChange_(){let t=this.geometries_;for(let e=0,i=t.length;e<i;++e)this.changeEventsKeys_.push((0,j.listen)(t[e],I.default.CHANGE,this.changed,this))}clone(){let t=new ef(e_(this.geometries_));return t.applyProperties(this),t}closestPointXY(t,e,i,n){if(n<(0,W.closestSquaredDistanceXY)(this.getExtent(),t,e))return n;let r=this.geometries_;for(let s=0,o=r.length;s<o;++s)n=r[s].closestPointXY(t,e,i,n);return n}containsXY(t,e){let i=this.geometries_;for(let n=0,r=i.length;n<r;++n)if(i[n].containsXY(t,e))return!0;return!1}computeExtent(t){(0,W.createOrUpdateEmpty)(t);let e=this.geometries_;for(let i=0,n=e.length;i<n;++i)(0,W.extend)(t,e[i].getExtent());return t}getGeometries(){return e_(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let t=[],e=this.geometries_;for(let i=0,n=e.length;i<n;++i)e[i].getType()===this.getType()?t=t.concat(e[i].getGeometriesArrayRecursive()):t.push(e[i]);return t}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;let e=[],i=this.geometries_,n=!1;for(let r=0,s=i.length;r<s;
1++r){let s=i[r],o=s.getSimplifiedGeometry(t);e.push(o),o!==s&&(n=!0)}return n?new ef(e):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getType(){return"GeometryCollection"}intersectsExtent(t){let e=this.geometries_;for(let i=0,n=e.length;i<n;++i)if(e[i].intersectsExtent(t))return!0;return!1}isEmpty(){return 0===this.geometries_.length}rotate(t,e){let i=this.geometries_;for(let n=0,r=i.length;n<r;++n)i[n].rotate(t,e);this.changed()}scale(t,e,i){i||(i=(0,W.getCenter)(this.getExtent()));let n=this.geometries_;for(let r=0,s=n.length;r<s;++r)n[r].scale(t,e,i);this.changed()}setGeometries(t){this.setGeometriesArray(e_(t))}setGeometriesArray(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()}applyTransform(t){let e=this.geometries_;for(let i=0,n=e.length;i<n;++i)e[i].applyTransform(t);this.changed()}translate(t,e){let i=this.geometries_;for(let n=0,r=i.length;n<r;++n)i[n].translate(t,e);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function e_(t){return t.map(t=>t.clone())}var ep=t.i(25933),em=t.i(93325),ey=t.i(65791),ex=t.i(77583),ev=t.i(85390);let eC="drawstart";class ew extends ed.default{constructor(t,e){super(t),this.feature=e}}function eE(t,e){return(0,B.squaredDistance)(t[0],t[1],e[0],e[1])}function eS(t,e){let i=t.length;return e<0?t[e+i]:e>=i?t[e-i]:t[e]}function eR(t,e,i){let n,r;e<i?(n=e,r=i):(n=i,r=e);let s=Math.ceil(n),o=Math.floor(r);if(s>o)return eE(eP(t,n),eP(t,r));let a=0;n<s&&(a+=eE(eP(t,n),eS(t,s))),o<r&&(a+=eE(eS(t,o),eP(t,r)));for(let e=s;e<o-1;++e)a+=eE(eS(t,e),eS(t,e+1));return a}let eI={index:-1,endIndex:NaN};function eT(t,e,i,n){let r=t[0],s=t[1];for(let t=0,o=e.length-1;t<o;++t){let o=eM(r,s,e[t],e[t+1]);if(0===o.squaredDistance){let r=t+o.along;n.push({coordinates:e,ring:i,startIndex:r,endIndex:r});return}}}let eb={along:0,squaredDistance:0};function eM(t,e,i,n){let r=i[0],s=i[1],o=n[0],a=n[1],l=o-r,h=a-s,d=0,u=r,c=s;return(0!==l||0!==h)&&(d=(0,B.clamp)(((t-r)*l+(e-s)*h)/(l*l+h*h),0,1),u+=l*d,c+=h*d),eb.along=d,eb.squaredDistance=(0,B.toFixed)((0,B.squaredDistance)(t,e,u,c),10),eb}function eP(t,e){let i=t.length,n=Math.floor(e),r=e-n;n>=i?n-=i:n<0&&(n+=i);let s=n+1;s>=i&&(s-=i);let o=t[n],a=o[0],l=o[1],h=t[s],d=h[0]-a,u=h[1]-l;return[a+d*r,l+u*r]}class eL extends ex.default{constructor(t){t.stopDown||(t.stopDown=ec.FALSE),super(t),this.on,this.once,this.un,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=t.source?t.source:null,this.features_=t.features?t.features:null,this.snapTolerance_=t.snapTolerance?t.snapTolerance:12,this.type_=t.type,this.mode_=function(t){switch(t){case"Point":case"MultiPoint":return"Point";case"LineString":case"MultiLineString":return"LineString";case"Polygon":case"MultiPolygon":return"Polygon";
1case"Circle":return"Circle";default:throw Error("Invalid type: "+t)}}(this.type_),this.stopClick_=!!t.stopClick,this.minPoints_=t.minPoints?t.minPoints:"Polygon"===this.mode_?3:2,this.maxPoints_="Circle"===this.mode_?2:t.maxPoints?t.maxPoints:1/0,this.finishCondition_=t.finishCondition?t.finishCondition:ec.TRUE,this.geometryLayout_=t.geometryLayout?t.geometryLayout:"XY";let e=t.geometryFunction;if(!e){const t=this.mode_;if("Circle"===t)e=(t,e,i)=>{let n=e||new en([NaN,NaN]),r=(0,d.fromUserCoordinate)(t[0],i),s=(0,eh.squaredDistance)(r,(0,d.fromUserCoordinate)(t[t.length-1],i));n.setCenterAndRadius(r,Math.sqrt(s),this.geometryLayout_);let o=(0,d.getUserProjection)();return o&&n.transform(i,o),n};else{let i;"Point"===t?i=tq.default:"LineString"===t?i=tH.default:"Polygon"===t&&(i=t6.default),e=(e,n,r)=>(n?"Polygon"===t?e[0].length?n.setCoordinates([e[0].concat([e[0][0]])],this.geometryLayout_):n.setCoordinates([],this.geometryLayout_):n.setCoordinates(e,this.geometryLayout_):n=new i(e,this.geometryLayout_),n)}}this.geometryFunction_=e,this.dragVertexDelay_=void 0!==t.dragVertexDelay?t.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=t.clickTolerance?t.clickTolerance*t.clickTolerance:36,this.overlay_=new o.default({source:new a.default({useSpatialIndex:!1,wrapX:!!t.wrapX&&t.wrapX}),style:t.style?t.style:function(){let t=(0,u.createEditingStyle)();return function(e,i){return t[e.getGeometry().getType()]}}(),updateWhileInteracting:!0}),this.geometryName_=t.geometryName,this.condition_=t.condition?t.condition:eu.noModifierKeys,this.freehandCondition_,t.freehand?this.freehandCondition_=eu.always:this.freehandCondition_=t.freehandCondition?t.freehandCondition:eu.shiftKeyOnly,this.traceCondition_,this.setTrace(t.trace||!1),this.traceState_={active:!1},this.traceSource_=t.traceSource||t.source||null,this.addChangeListener(ev.default.ACTIVE,this.updateState_)}setTrace(t){let e;e=t?!0===t?eu.always:t:eu.never,this.traceCondition_=e}setMap(t){super.setMap(t),this.updateState_()}getOverlay(){return this.overlay_}handleEvent(t){t.originalEvent.type===I.default.CONTEXTMENU&&t.originalEvent.preventDefault(),this.freehand_="Point"!==this.mode_&&this.freehandCondition_(t);let e=t.type===el.default.POINTERMOVE,i=!0;return!this.freehand_&&this.lastDragTime_&&t.type===el.default.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=t.pixel,this.shouldHandle_=!this.freehand_,e=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&t.type===el.default.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(t.coordinate),i=!1):this.freehand_&&t.type===el.default.POINTERDOWN?i=!1:e&&2>this.getPointerCount()?(i=t.type===el.default.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(t),this.shouldHandle_&&t.originalEvent.preventDefault()):("mouse"===t.originalEvent.pointerType||t.type===el.default.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(t):t.type===el.default.DBLCLICK&&(i=!1),super.handleEvent(t)&&i}handleDownEvent(t){return(this.shouldHandle_=!this.freehand_,this.freehand_)?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(()=>{this.handlePointerMove_(new ea.default(el.default.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))},this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}
1toggleTraceState_(t){if(!this.traceSource_||!this.traceCondition_(t))return;if(this.traceState_.active)return void this.deactivateTrace_();let e=this.getMap(),i=e.getCoordinateFromPixel([t.pixel[0]-this.snapTolerance_,t.pixel[1]+this.snapTolerance_]),n=e.getCoordinateFromPixel([t.pixel[0]+this.snapTolerance_,t.pixel[1]-this.snapTolerance_]),r=(0,W.boundingExtent)([i,n]),s=this.traceSource_.getFeaturesInExtent(r);if(0===s.length)return;let o=function(t,e){let i=[];for(let n=0;n<e.length;++n)!function t(e,i,n){if(i instanceof tH.default)return void eT(e,i.getCoordinates(),!1,n);if(i instanceof ep.default){let t=i.getCoordinates();for(let i=0,r=t.length;i<r;++i)eT(e,t[i],!1,n);return}if(i instanceof t6.default){let t=i.getCoordinates();for(let i=0,r=t.length;i<r;++i)eT(e,t[i],!0,n);return}if(i instanceof ey.default){let t=i.getCoordinates();for(let i=0,r=t.length;i<r;++i){let r=t[i];for(let t=0,i=r.length;t<i;++t)eT(e,r[t],!0,n)}return}if(i instanceof ef){let r=i.getGeometries();for(let i=0;i<r.length;++i)t(e,r[i],n);return}}(t,e[n].getGeometry(),i);return i}(t.coordinate,s);o.length&&(this.traceState_={active:!0,startPx:t.pixel.slice(),targets:o,targetIndex:-1})}addOrRemoveTracedCoordinates_(t,e){let i=t.startIndex<=t.endIndex;i===t.startIndex<=e?i&&e>t.endIndex||!i&&e<t.endIndex?this.addTracedCoordinates_(t,t.endIndex,e):(i&&e<t.endIndex||!i&&e>t.endIndex)&&this.removeTracedCoordinates_(e,t.endIndex):(this.removeTracedCoordinates_(t.startIndex,t.endIndex),this.addTracedCoordinates_(t,t.startIndex,e))}removeTracedCoordinates_(t,e){if(t===e)return;let i=0;if(t<e){let n=Math.floor(e);n===e&&(n-=1),i=n-Math.ceil(t)+1}else{let n=Math.ceil(e);n===e&&(n+=1),i=Math.floor(t)-n+1}i>0&&this.removeLastPoints_(i)}addTracedCoordinates_(t,e,i){if(e===i)return;let n=[];if(e<i){let r=Math.ceil(e),s=Math.floor(i);s===i&&(s-=1);for(let e=r;e<=s;++e)n.push(eS(t.coordinates,e))}else{let r=Math.floor(e),s=Math.ceil(i);s===i&&(s+=1);for(let e=r;e>=s;--e)n.push(eS(t.coordinates,e))}n.length&&this.appendCoordinates(n)}updateTrace_(t){let e=this.traceState_;if(!e.active||-1===e.targetIndex&&(0,eh.distance)(e.startPx,t.pixel)<this.snapTolerance_)return;let i=function(t,e,i,n){let r=t[0],s=t[1],o=1/0,a=-1,l=NaN;for(let t=0;t<e.targets.length;++t){let i,n=e.targets[t],h=n.coordinates,d=1/0;for(let t=0;t<h.length-1;++t){let e=eM(r,s,h[t],h[t+1]);e.squaredDistance<d&&(d=e.squaredDistance,i=t+e.along)}d<o&&(o=d,n.ring&&e.targetIndex===t&&(n.endIndex>n.startIndex?i<n.startIndex&&(i+=h.length):n.endIndex<n.startIndex&&i>n.startIndex&&(i-=h.length)),l=i,a=t)}let h=e.targets[a],d=h.ring;if(e.targetIndex===a&&d){let t=eP(h.coordinates,l),r=i.getPixelFromCoordinate(t);(0,eh.distance)(r,e.startPx)>n&&(d=!1)}if(d){let t=h.coordinates,e=t.length,i=h.startIndex,n=l;if(i<n){let r=eR(t,i,n);eR(t,i,n-e)<r&&(l-=e)}else{let r=eR(t,i,n);eR(t,i,n+e)<r&&(l+=e)}}return eI.index=a,eI.endIndex=l,eI}(t.coordinate,e,this.getMap(),this.snapTolerance_);if(e.targetIndex!==i.index){if(-1!==e.targetIndex){let t=e.targets[e.targetIndex];this.removeTracedCoordinates_(t.startIndex,t.endIndex)}let t=e.targets[i.index];this.addTracedCoordinates_(t,t.startIndex,i.endIndex)}else{let t=e.targets[e.targetIndex];this.addOrRemoveTracedCoordinates_(t,i.endIndex)}e.targetIndex=i.index;let n=e.targets[e.targetIndex];n.endIndex=i.endIndex;let r=eP(n.coordinates,n.endIndex),s=this.getMap().getPixelFromCoordinate(r);t.coordinate=r,t.pixel=[Math.round(s[0]),Math.round(s[1])]}handleUpEvent(t){let e=!0;if(0===this.getPointerCount()){this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t);let i=this.traceState_.active;if(this.toggleTraceState_(t),this.shouldHandle_){let n=!this.finishCoordinate_;n&&this.startDrawing_(t.coordinate),!n&&this.freehand_?this.finishDrawing():this.freehand_||n&&"Point"!==this.mode_||(this.atFinish_(t.pixel,i)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing()}return!e&&this.stopClick_&&t.preventDefault(),e}handlePointerMove_(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){let e=this.downPx_,i=t.pixel,n=e[0]-i[0],r=e[1]-i[1],s=n*n+r*r;if(this.shouldHandle_=this.freehand_?s>this.squaredClickTolerance_:s<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?(this.updateTrace_(t),this.modifyDrawing_(t.coordinate)):this.createOrUpdateSketchPoint_(t.coordinate.slice())}atFinish_(t,e){let i=!1;if(this.sketchFeature_){let n=!1,r=[this.finishCoordinate_],s=this.mode_;if("Point"===s)i=!0;else if("Circle"===s)i=2===this.sketchCoords_.length;else if("LineString"===s)n=!e&&this.sketchCoords_.length>this.minPoints_;else if("Polygon"===s){let t=this.sketchCoords_;n=t[0].length>this.minPoints_,r=[t[0][0],t[0][t[0].length-2]],r=e?[t[0][0]]:[t[0][0],t[0][t[0].length-2]]}if(n){let e=this.getMap();for(let n=0,s=r.length;n<s;
1n++){let s=r[n],o=e.getPixelFromCoordinate(s),a=t[0]-o[0],l=t[1]-o[1];if(i=Math.sqrt(a*a+l*l)<=(this.freehand_?1:this.snapTolerance_)){this.finishCoordinate_=s;break}}}}return i}createOrUpdateSketchPoint_(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new tZ.default(new tq.default(t)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(t){this.sketchLine_||(this.sketchLine_=new tZ.default);let e=t.getLinearRing(0),i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),i.changed()):(i=new tH.default(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(i))}startDrawing_(t){let e=this.getMap().getView().getProjection(),i=(0,et.getStrideForLayout)(this.geometryLayout_);for(;t.length<i;)t.push(0);this.finishCoordinate_=t,"Point"===this.mode_?this.sketchCoords_=t.slice():"Polygon"===this.mode_?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new tZ.default(new tH.default(this.sketchLineCoords_)));let n=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new tZ.default,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(n),this.updateSketchFeatures_(),this.dispatchEvent(new ew(eC,this.sketchFeature_))}modifyDrawing_(t){let e,i,n=this.getMap(),r=this.sketchFeature_.getGeometry(),s=n.getView().getProjection(),o=(0,et.getStrideForLayout)(this.geometryLayout_);for(;t.length<o;)t.push(0);"Point"===this.mode_?i=this.sketchCoords_:"Polygon"===this.mode_?(i=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(n.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):i=(e=this.sketchCoords_)[e.length-1],i[0]=t[0],i[1]=t[1],this.geometryFunction_(this.sketchCoords_,r,s),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(t),"Polygon"===r.getType()&&"Polygon"!==this.mode_?this.createOrUpdateCustomSketchLine_(r):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()}addToDrawing_(t){let e,i,n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),s=this.mode_;return("LineString"===s||"Circle"===s?(this.finishCoordinate_=t.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),this.geometryFunction_(i,n,r)):"Polygon"===s&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,n,r)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e)?this.finishDrawing():this.sketchFeature_}removeLastPoints_(t){if(!this.sketchFeature_)return;let e=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),n=this.mode_;for(let r=0;r<t;++r){let t;if("LineString"===n||"Circle"===n){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();let e=this.finishCoordinate_.slice();t[t.length-1]=e,this.createOrUpdateSketchPoint_(e)}this.geometryFunction_(t,e,i),"Polygon"===e.getType()&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if("Polygon"===n){(t=this.sketchCoords_[0]).splice(-2,1);let n=this.sketchLine_.getGeometry();if(t.length>=2){let e=t[t.length-2].slice();t[t.length-1]=e,this.createOrUpdateSketchPoint_(e)}n.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,i)}if(1===t.length){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){let t=this.abortDrawing_();if(!t)return null;let e=this.sketchCoords_,i=t.getGeometry(),n=this.getMap().getView().getProjection();return"LineString"===this.mode_?(e.pop(),this.geometryFunction_(e,i,n)):"Polygon"===this.mode_&&(e[0].pop(),this.geometryFunction_(e,i,n),e=i.getCoordinates()),"MultiPoint"===this.type_?t.setGeometry(new em.default([e])):"MultiLineString"===this.type_?t.setGeometry(new ep.default([e])):"MultiPolygon"===this.type_&&t.setGeometry(new ey.default([e])),this.dispatchEvent(new ew("drawend",t)),this.features_&&this.features_.pu
1sh(t),this.source_&&this.source_.addFeature(t),t}abortDrawing_(){this.finishCoordinate_=null;let t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),t}abortDrawing(){let t=this.abortDrawing_();t&&this.dispatchEvent(new ew("drawabort",t))}appendCoordinates(t){let e,i=this.mode_,n=!this.sketchFeature_;if(n&&this.startDrawing_(t[0]),"LineString"===i||"Circle"===i)e=this.sketchCoords_;else{if("Polygon"!==i)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}n&&e.shift(),e.pop();for(let e=0;e<t.length;e++)this.addToDrawing_(t[e]);let r=t[t.length-1];this.sketchFeature_=this.addToDrawing_(r),this.modifyDrawing_(r)}extend(t){let e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();let i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.sketchPoint_=new tZ.default(new tq.default(i)),this.updateSketchFeatures_(),this.dispatchEvent(new ew(eC,this.sketchFeature_))}updateSketchFeatures_(){let t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);let e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)}updateState_(){let t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)}}var eF=t.i(50502),eA=t.i(80821),eD=tb,ek=t.i(51076),eO=t.i(30719),eG=ex;let ez=[0,0,0,0],eN=[],eU="modifyend";class eW extends eD.default{constructor(t,e,i){super(t),this.features=e,this.mapBrowserEvent=i}}class ej extends eG.default{constructor(t){let e;if(super(t),this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=t.condition?t.condition:eu.primaryAction,this.defaultDeleteCondition_=function(t){return(0,eu.altKeyOnly)(t)&&(0,eu.singleClick)(t)},this.deleteCondition_=t.deleteCondition?t.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=t.insertVertexCondition?t.insertVertexCondition:eu.always,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new eO.default,this.pixelTolerance_=void 0!==t.pixelTolerance?t.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new o.default({source:new a.default({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.style?t.style:function(){let t=(0,u.createEditingStyle)();return function(e,i){return t.Point}}(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.hitDetection_=null,t.features?e=t.features:t.source&&(this.source_=t.source,e=new eF.default(this.source_.getFeatures()),this.source_.addEventListener(ek.default.ADDFEATURE,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(ek.default.REMOVEFEATURE,this.handleSourceRemove_.bind(this))),!e)throw Error("The modify interaction requires features, a source or a layer");t.hitDetection&&(this.hitDetection_=t.hitDetection),this.features_=e,this.features_.forEach(this.addFeature_.bind(this)),this.features_.addEventListener(eA.default.ADD,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(eA.default.REMOVE,this.handleFeatureRemove_.bind(this)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=void 0===t.snapToPointer?!this.hitDetection_:t.snapToPointer}addFeature_(t){let e=t.getGeometry();if(e){let i=this.SEGMENT_WRITERS_[e.getType()];i&&i(t,e)}let i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(i.getCoordinateFromPixel(this.lastPixel_)),t.addEventListener(I.default.CHANGE,this.boundHandleFeatureChange_)}willModifyFeatures_(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new eF.default;let i=this.featuresBeingModified_.getArray();for(let t=0,n=e.length;t<n;++t){let n=e[t].feature;n&&!i.includes(n)&&this.featuresBeingModified_.push(n)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new eW("modifystart",this.featuresBeingModified_,t))}}removeFeature_(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature
1(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(I.default.CHANGE,this.boundHandleFeatureChange_)}removeFeatureSegmentData_(t){let e=this.rBush_,i=[];e.forEach(function(e){t===e.feature&&i.push(e)});for(let t=i.length-1;t>=0;--t){let n=i[t];for(let t=this.dragSegments_.length-1;t>=0;--t)this.dragSegments_[t][0]===n&&this.dragSegments_.splice(t,1);e.remove(n)}}setActive(t){this.vertexFeature_&&!t&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(t)}setMap(t){this.overlay_.setMap(t),super.setMap(t)}getOverlay(){return this.overlay_}handleSourceAdd_(t){t.feature&&this.features_.push(t.feature)}handleSourceRemove_(t){t.feature&&this.features_.remove(t.feature)}handleFeatureAdd_(t){this.addFeature_(t.element)}handleFeatureChange_(t){if(!this.changingFeature_){let e=t.target;this.removeFeature_(e),this.addFeature_(e)}}handleFeatureRemove_(t){this.removeFeature_(t.element)}writePointGeometry_(t,e){let i=e.getCoordinates();this.rBush_.insert(e.getExtent(),{feature:t,geometry:e,segment:[i,i]})}writeMultiPointGeometry_(t,e){let i=e.getCoordinates();for(let n=0,r=i.length;n<r;++n){let r=i[n],s={feature:t,geometry:e,depth:[n],index:n,segment:[r,r]};this.rBush_.insert(e.getExtent(),s)}}writeLineStringGeometry_(t,e){let i=e.getCoordinates();for(let n=0,r=i.length-1;n<r;++n){let r=i.slice(n,n+2),s={feature:t,geometry:e,index:n,segment:r};this.rBush_.insert((0,W.boundingExtent)(r),s)}}writeMultiLineStringGeometry_(t,e){let i=e.getCoordinates();for(let n=0,r=i.length;n<r;++n){let r=i[n];for(let i=0,s=r.length-1;i<s;++i){let s=r.slice(i,i+2),o={feature:t,geometry:e,depth:[n],index:i,segment:s};this.rBush_.insert((0,W.boundingExtent)(s),o)}}}writePolygonGeometry_(t,e){let i=e.getCoordinates();for(let n=0,r=i.length;n<r;++n){let r=i[n];for(let i=0,s=r.length-1;i<s;++i){let s=r.slice(i,i+2),o={feature:t,geometry:e,depth:[n],index:i,segment:s};this.rBush_.insert((0,W.boundingExtent)(s),o)}}}writeMultiPolygonGeometry_(t,e){let i=e.getCoordinates();for(let n=0,r=i.length;n<r;++n){let r=i[n];for(let i=0,s=r.length;i<s;++i){let s=r[i];for(let r=0,o=s.length-1;r<o;++r){let o=s.slice(r,r+2),a={feature:t,geometry:e,depth:[i,n],index:r,segment:o};this.rBush_.insert((0,W.boundingExtent)(o),a)}}}}writeCircleGeometry_(t,e){let i=e.getCenter(),n={feature:t,geometry:e,index:0,segment:[i,i]},r={feature:t,geometry:e,index:1,segment:[i,i]},s=[n,r];n.featureSegments=s,r.featureSegments=s,this.rBush_.insert((0,W.createOrUpdateFromCoordinate)(i),n);let o=e,a=(0,d.getUserProjection)();if(a&&this.getMap()){let t=this.getMap().getView().getProjection();o=o.clone().transform(a,t),o=(0,t6.fromCircle)(o).transform(t,a)}this.rBush_.insert(o.getExtent(),r)}writeGeometryCollectionGeometry_(t,e){let i=e.getGeometriesArray();for(let e=0;e<i.length;++e){let n=i[e];(0,this.SEGMENT_WRITERS_[n.getType()])(t,n)}}createOrUpdateVertexFeature_(t,e,i,n){let r=this.vertexFeature_;return r?r.getGeometry().setCoordinates(t):(r=new tZ.default(new tq.default(t)),this.vertexFeature_=r,this.overlay_.getSource().addFeature(r)),r.set("features",e),r.set("geometries",i),r.set("existing",n),r}handleEvent(t){let e;return!t.originalEvent||(this.lastPointerEvent_=t,t.map.getView().getInteracting()||t.type!=el.default.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(t),this.vertexFeature_&&this.deleteCondition_(t)&&(e=t.type==el.default.SINGLECLICK&&!!this.ignoreNextSingleClick_||this.removePoint()),t.type==el.default.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),super.handleEvent(t)&&!e)}findInsertVerticesAndUpdateDragSegments_(t){this.handlePointerAtPixel_(t),this.dragSegments_.length=0,this.featuresBeingModified_=null;let e=this.vertexFeature_;if(!e)return;let i=this.getMap().getView().getProjection(),n=[],r=e.getGeometry().getCoordinates(),s=(0,W.boundingExtent)([r]),o=this.rBush_.getInExtent(s),a={};o.sort(eB);for(let e=0,s=o.length;e<s;++e){let s=o[e],l=s.segment,h=(0,b.getUid)(s.geometry),d=s.depth;if(d&&(h+="-"+d.join("-")),a[h]||(a[h]=[,,]),"Circle"===s.geometry.getType()&&1===s.index){let e=eV(t,s,i);
1(0,eh.equals)(e,r)&&!a[h][0]&&(this.dragSegments_.push([s,0]),a[h][0]=s);continue}if((0,eh.equals)(l[0],r)&&!a[h][0]){this.dragSegments_.push([s,0]),a[h][0]=s;continue}if((0,eh.equals)(l[1],r)&&!a[h][1]){if(a[h][0]&&0===a[h][0].index){let t=s.geometry.getCoordinates();switch(s.geometry.getType()){case"LineString":case"MultiLineString":continue;case"MultiPolygon":t=t[d[1]];case"Polygon":if(s.index!==t[d[0]].length-2)continue}}this.dragSegments_.push([s,1]),a[h][1]=s;continue}(0,b.getUid)(l)in this.vertexSegments_&&!a[h][0]&&!a[h][1]&&n.push(s)}return n}handleDragEvent(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_.map(([t])=>t));let e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],i=[],n=[];for(let r=0,s=this.dragSegments_.length;r<s;++r){let s,o=this.dragSegments_[r],a=o[0],l=a.feature;i.includes(l)||i.push(l);let h=a.geometry;n.includes(h)||n.push(h);let u=a.depth,c=a.segment,g=o[1];for(;e.length<h.getStride();)e.push(c[g][e.length]);switch(h.getType()){case"Point":s=e,c[0]=e,c[1]=e;break;case"MultiPoint":(s=h.getCoordinates())[a.index]=e,c[0]=e,c[1]=e;break;case"LineString":(s=h.getCoordinates())[a.index+g]=e,c[g]=e;break;case"MultiLineString":case"Polygon":(s=h.getCoordinates())[u[0]][a.index+g]=e,c[g]=e;break;case"MultiPolygon":(s=h.getCoordinates())[u[1]][u[0]][a.index+g]=e,c[g]=e;break;case"Circle":if(c[0]=e,c[1]=e,0===a.index)this.changingFeature_=!0,h.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;let i=t.map.getView().getProjection(),n=(0,eh.distance)((0,d.fromUserCoordinate)(h.getCenter(),i),(0,d.fromUserCoordinate)(e,i)),r=(0,d.getUserProjection)();if(r){let t=h.clone().transform(r,i);t.setRadius(n),n=t.transform(i,r).getRadius()}h.setRadius(n),this.changingFeature_=!1}}s&&this.setGeometryCoordinates_(h,s)}this.createOrUpdateVertexFeature_(e,i,n,!0)}handleDownEvent(t){if(!this.condition_(t))return!1;let e=t.coordinate,i=this.findInsertVerticesAndUpdateDragSegments_(e);if(i?.length&&this.insertVertexCondition_(t)&&(this.willModifyFeatures_(t,i),this.vertexFeature_)){let t=this.vertexFeature_.getGeometry().getCoordinates();for(let e=i.length-1;e>=0;--e)this.insertVertex_(i[e],t);this.ignoreNextSingleClick_=!0}return!!this.vertexFeature_}handleUpEvent(t){for(let e=this.dragSegments_.length-1;e>=0;--e){let i=this.dragSegments_[e][0],n=i.geometry;if("Circle"===n.getType()){let e=n.getCenter(),r=i.featureSegments[0],s=i.featureSegments[1];r.segment[0]=e,r.segment[1]=e,s.segment[0]=e,s.segment[1]=e,this.rBush_.update((0,W.createOrUpdateFromCoordinate)(e),r);let o=n,a=(0,d.getUserProjection)();if(a){let e=t.map.getView().getProjection();o=o.clone().transform(a,e),o=(0,t6.fromCircle)(o).transform(e,a)}this.rBush_.update(o.getExtent(),s)}else this.rBush_.update((0,W.boundingExtent)(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new eW(eU,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1}handlePointerMove_(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.coordinate)}handlePointerAtPixel_(t){let e,i,n=this.getMap(),r=n.getPixelFromCoordinate(t),s=n.getView().getProjection();if(this.hitDetection_){let t="object"==typeof this.hitDetection_?t=>t===this.hitDetection_:void 0;n.forEachFeatureAtPixel(r,(t,n,r)=>{r&&"Point"===r.getType()&&(r=new tq.default((0,d.toUserCoordinate)(r.getCoordinates(),s)));let o=r||t.getGeometry();if(o&&"Point"===o.getType()&&t instanceof tZ.default&&this.features_.getArray().includes(t)){i=o;let n=t.getGeometry().getFlatCoordinates().slice(0,2);e=[{feature:t,geometry:i,segment:[n,n]}]}return!0},{layerFilter:t})}if(!e){let i=(0,d.fromUserExtent)((0,W.createOrUpdateFromCoordinate)(t,ez),s),r=n.getView().getResolution()*this.pixelTolerance_,o=(0,d.toUserExtent)((0,W.buffer)(i,r,ez),s);e=this.rBush_.getInExtent(o)}if(e&&e.length>0){let o=e.sort(function(e,i){return eX(t,e,s)-eX(t,i,s)})[0],a=o.segment,l=eV(t,o,s),h=n.getPixelFromCoordinate(l),d=(0,eh.distance)(r,h);if(i||d<=this.pixelTolerance_){let i={};if(i[(0,b.getUid)(a)]=!0,this.snapToPointer_||(this.delta_[0]=l[0]-t[0],this.delta_[1]=l[1]-t[1]),"Circle"===o.geometry.getType()&&1===o.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(l,[o.feature],[o.geometry],this.snappedToVertex_);
1else{let t=n.getPixelFromCoordinate(a[0]),r=n.getPixelFromCoordinate(a[1]),s=(0,eh.squaredDistance)(h,t),u=(0,eh.squaredDistance)(h,r);if(d=Math.sqrt(Math.min(s,u)),this.snappedToVertex_=d<=this.pixelTolerance_,!this.snappedToVertex_&&!this.insertVertexCondition_(this.lastPointerEvent_)){this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null);return}this.snappedToVertex_&&(l=s>u?a[1]:a[0]),this.createOrUpdateVertexFeature_(l,[o.feature],[o.geometry],this.snappedToVertex_);let c={};c[(0,b.getUid)(o.geometry)]=!0;for(let t=1,n=e.length;t<n;++t){let n=e[t].segment;if((0,eh.equals)(a[0],n[0])&&(0,eh.equals)(a[1],n[1])||(0,eh.equals)(a[0],n[1])&&(0,eh.equals)(a[1],n[0])){let r=(0,b.getUid)(e[t].geometry);r in c||(c[r]=!0,i[(0,b.getUid)(n)]=!0)}else break}}this.vertexSegments_=i;return}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)}insertVertex_(t,e){let i,n=t.segment,r=t.feature,s=t.geometry,o=t.depth,a=t.index;for(;e.length<s.getStride();)e.push(0);switch(s.getType()){case"MultiLineString":case"Polygon":(i=s.getCoordinates())[o[0]].splice(a+1,0,e);break;case"MultiPolygon":(i=s.getCoordinates())[o[1]][o[0]].splice(a+1,0,e);break;case"LineString":(i=s.getCoordinates()).splice(a+1,0,e);break;default:return!1}this.setGeometryCoordinates_(s,i);let l=this.rBush_;l.remove(t),this.updateSegmentIndices_(s,a,o,1);let h={segment:[n[0],e],feature:r,geometry:s,depth:o,index:a};l.insert((0,W.boundingExtent)(h.segment),h),this.dragSegments_.push([h,1]);let d={segment:[e,n[1]],feature:r,geometry:s,depth:o,index:a+1};return l.insert((0,W.boundingExtent)(d.segment),d),this.dragSegments_.push([d,0]),!0}updatePointer_(t){return t&&this.findInsertVerticesAndUpdateDragSegments_(t),this.vertexFeature_?.getGeometry().getCoordinates()}getPoint(){let t=this.vertexFeature_?.getGeometry().getCoordinates();return t?(0,d.toUserCoordinate)(t,this.getMap().getView().getProjection()):null}canRemovePoint(){if(!this.vertexFeature_||this.vertexFeature_.get("geometries").every(t=>"Circle"===t.getType()||t.getType().endsWith("Point")))return!1;let t=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent((0,W.boundingExtent)([t])).some(({segment:e})=>(0,eh.equals)(e[0],t)||(0,eh.equals)(e[1],t))}removePoint(t){if(t&&(t=(0,d.fromUserCoordinate)(t,this.getMap().getView().getProjection()),this.updatePointer_(t)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=el.default.POINTERDRAG){let t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_.map(([t])=>t));let e=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new eW(eU,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1}removeVertex_(){let t,e,i,n,r,s,o,a,l,h,d,u=this.dragSegments_,c={},g=!1;for(r=u.length-1;r>=0;--r)h=(i=u[r])[0],d=(0,b.getUid)(h.feature),h.depth&&(d+="-"+h.depth.join("-")),d in c||(c[d]={}),0===i[1]?(c[d].right=h,c[d].index=h.index):1==i[1]&&(c[d].left=h,c[d].index=h.index+1);for(d in c){switch(l=c[d].right,o=c[d].left,(a=(s=c[d].index)-1)<0&&(a=0),t=e=(n=(h=void 0!==o?o:l).geometry).getCoordinates(),g=!1,n.getType()){case"MultiLineString":e[h.depth[0]].length>2&&(e[h.depth[0]].splice(s,1),g=!0);break;case"LineString":e.length>2&&(e.splice(s,1),g=!0);break;case"MultiPolygon":t=t[h.depth[1]];case"Polygon":(t=t[h.depth[0]]).length>4&&(s==t.length-1&&(s=0),t.splice(s,1),g=!0,0===s&&(t.pop(),t.push(t[0]),a=t.length-1))}if(g){this.setGeometryCoordinates_(n,e);let t=[];if(void 0!==o&&(this.rBush_.remove(o),t.push(o.segment[0])),void 0!==l&&(this.rBush_.remove(l),t.push(l.segment[1])),void 0!==o&&void 0!==l){let e={depth:h.depth,feature:h.feature,geometry:h.geometry,index:a,segment:t};this.rBush_.insert((0,W.boundingExtent)(e.segment),e)}this.updateSegmentIndices_(n,s,h.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),u.length=0}}return g}canInsertPoint(){if(!this.vertexFeature_||this.vertexFeature_.get("geometries").every(t=>"Circle"===t.getType()||t.getType().endsWith("Point")))return!1;let t=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent((0,W.boundingExtent)([t])).some(({segment:e})=>!((0,eh.equals)(e[0],t)||(0,eh.equals)(e[1],t)))}insertPoint(t){let e=t?(0,d.fromUserCoordinate)(t,this.getMap().getView().getProjection()):this.vertexFeature_?.getGeometry().getCoordinates();return!!e&&this.findInsertVerticesAndUpdateDragSegments_(e).reduce((t,i)=>t||this.insertVertex_(i,e),!1)}setGeometryCoordinates_(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1}updateSegmentIndices_(t,e,i,n){this.rBush_.forEachInExtent(t.getExtent(),function(r){r.geometry===t&&(void 0===i||void 0===r.depth||(0,U.equals)(r.depth,i))&&r.index>
1e&&(r.index+=n)})}}function eB(t,e){return t.index-e.index}function eX(t,e,i){let n=e.geometry;if("Circle"===n.getType()){let r=n;if(1===e.index){let e=(0,d.getUserProjection)();e&&(r=r.clone().transform(e,i));let n=Math.sqrt((0,eh.squaredDistance)(r.getCenter(),(0,d.fromUserCoordinate)(t,i)))-r.getRadius();return n*n}}let r=(0,d.fromUserCoordinate)(t,i);return eN[0]=(0,d.fromUserCoordinate)(e.segment[0],i),eN[1]=(0,d.fromUserCoordinate)(e.segment[1],i),(0,eh.squaredDistanceToSegment)(r,eN)}function eV(t,e,i){let n=e.geometry;if("Circle"===n.getType()&&1===e.index){let e=n,r=(0,d.getUserProjection)();return r&&(e=e.clone().transform(r,i)),(0,d.toUserCoordinate)(e.getClosestPoint((0,d.fromUserCoordinate)(t,i)),i)}let r=(0,d.fromUserCoordinate)(t,i);return eN[0]=(0,d.fromUserCoordinate)(e.segment[0],i),eN[1]=(0,d.fromUserCoordinate)(e.segment[1],i),(0,d.toUserCoordinate)((0,eh.closestOnSegment)(r,eN),i)}var eK=tb,eY=t.i(93065),eZ=t.i(91732);class eq extends eK.default{constructor(t,e,i,n){super(t),this.selected=e,this.deselected=i,this.mapBrowserEvent=n}}let eH={};class e$ extends eZ.default{constructor(t){let e;if(super(),this.on,this.once,this.un,t=t||{},this.boundAddFeature_=this.addFeature_.bind(this),this.boundRemoveFeature_=this.removeFeature_.bind(this),this.condition_=t.condition?t.condition:eu.singleClick,this.addCondition_=t.addCondition?t.addCondition:eu.never,this.removeCondition_=t.removeCondition?t.removeCondition:eu.never,this.toggleCondition_=t.toggleCondition?t.toggleCondition:eu.shiftKeyOnly,this.multi_=!!t.multi&&t.multi,this.filter_=t.filter?t.filter:ec.TRUE,this.hitTolerance_=t.hitTolerance?t.hitTolerance:0,this.style_=void 0!==t.style?t.style:function(){let t=(0,u.createEditingStyle)();return(0,U.extend)(t.Polygon,t.LineString),(0,U.extend)(t.GeometryCollection,t.LineString),function(e){return e.getGeometry()?t[e.getGeometry().getType()]:null}}(),this.features_=t.features||new eF.default,t.layers)if("function"==typeof t.layers)e=t.layers;else{const i=t.layers;e=function(t){return i.includes(t)}}else e=ec.TRUE;this.layerFilter_=e,this.featureLayerAssociation_={}}addFeatureLayerAssociation_(t,e){this.featureLayerAssociation_[(0,b.getUid)(t)]=e}getFeatures(){return this.features_}getHitTolerance(){return this.hitTolerance_}getLayer(t){return this.featureLayerAssociation_[(0,b.getUid)(t)]}setHitTolerance(t){this.hitTolerance_=t}setMap(t){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),super.setMap(t),t?(this.features_.addEventListener(eA.default.ADD,this.boundAddFeature_),this.features_.addEventListener(eA.default.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(eA.default.ADD,this.boundAddFeature_),this.features_.removeEventListener(eA.default.REMOVE,this.boundRemoveFeature_))}addFeature_(t){let e=t.element;if(this.style_&&this.applySelectedStyle_(e),!this.getLayer(e)){let t=this.getMap().getAllLayers().find(function(t){if(t instanceof o.default&&t.getSource()&&t.getSource().hasFeature(e))return t});t&&this.addFeatureLayerAssociation_(e,t)}}removeFeature_(t){this.style_&&this.restorePreviousStyle_(t.element)}getStyle(){return this.style_}applySelectedStyle_(t){let e=(0,b.getUid)(t);e in eH||(eH[e]=t.getStyle()),t.setStyle(this.style_)}restorePreviousStyle_(t){let e=this.getMap().getInteractions().getArray();for(let i=e.length-1;i>=0;--i){let n=e[i];if(n!==this&&n instanceof e$&&n.getStyle()&&-1!==n.getFeatures().getArray().lastIndexOf(t))return void t.setStyle(n.getStyle())}let i=(0,b.getUid)(t);t.setStyle(eH[i]),delete eH[i]}removeFeatureLayerAssociation_(t){delete this.featureLayerAssociation_[(0,b.getUid)(t)]}handleEvent(t){if(!this.condition_(t))return!0;let e=this.addCondition_(t),i=this.removeCondition_(t),n=this.toggleCondition_(t),r=t.map,s=this.getFeatures(),o=[],a=[];if(e||i||n){r.forEachFeatureAtPixel(t.pixel,(t,r)=>{if(t instanceof tZ.default&&this.filter_(t,r))return(e||n)&&!s.getArray().includes(t)?(this.addFeatureLayerAssociation_(t,r),a.push(t)):(i||n)&&s.getArray().includes(t)&&(o.push(t),this.removeFeatureLayerAssociation_(t)),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let t=o.length-1;t>=0;--t)s.remove(o[t]);s.extend(a)}else{(0,eY.clear)(this.featureLayerAssociation_),r.forEachFeatureAtPixel(t.pixel,(t,e)=>{if(t instanceof tZ.default&&this.filter_(t,e))return this.addFeatureLayerAssociation_(t,e),a.push(t),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let t=s.getLength()-1;t>=0;--t){let e=s.item(t),i=a.indexOf(e);i>-1?a.splice(i,1):(s.remove(e),o.push(e))}0!==a.length&&s.extend(a)}return(a.length>0||o.length>0)&&this.dispatchEvent(new eq("select",a,o,t)),!0}}var eJ=tb;let eQ="unsnap";class e0 extends eJ.default{constructor(t,e){super(t),this.vertex=e.vertex,this.vertexPixel=e.vertexPixel,this.feature=e.feature,this.segment=e.segment}}var e1=t.i(61914),e2=ex;let e3={Circle(t,e){let i=t,n=(0,d.getUserProjection)();n&&(i=i.clone().transform(n,e));let r=(0,t6.fromCircle)(i);return n&&r.transform(e,n),e3.Polygon(r)},GeometryCollection(t,e){let i=[],n=t.getGeometriesArray();for(let t=0;t<n.length;++t){let r=e3[n[t].getType()];
1r&&i.push(r(n[t],e))}return i.flat()},LineString(t){let e=[],i=t.getFlatCoordinates(),n=t.getStride();for(let t=0,r=i.length-n;t<r;t+=n)e.push([i.slice(t,t+2),i.slice(t+n,t+n+2)]);return e},MultiLineString(t){let e=[],i=t.getFlatCoordinates(),n=t.getStride(),r=t.getEnds(),s=0;for(let t=0,o=r.length;t<o;++t){let o=r[t];for(let t=s,r=o-n;t<r;t+=n)e.push([i.slice(t,t+2),i.slice(t+n,t+n+2)]);s=o}return e},MultiPoint(t){let e=[],i=t.getFlatCoordinates(),n=t.getStride();for(let t=0,r=i.length;t<r;t+=n)e.push([i.slice(t,t+2)]);return e},MultiPolygon(t){let e=[],i=t.getFlatCoordinates(),n=t.getStride(),r=t.getEndss(),s=0;for(let t=0,o=r.length;t<o;++t){let o=r[t];for(let t=0,r=o.length;t<r;++t){let r=o[t];for(let t=s,o=r-n;t<o;t+=n)e.push([i.slice(t,t+2),i.slice(t+n,t+n+2)]);s=r}}return e},Point:t=>[[t.getFlatCoordinates().slice(0,2)]],Polygon(t){let e=[],i=t.getFlatCoordinates(),n=t.getStride(),r=t.getEnds(),s=0;for(let t=0,o=r.length;t<o;++t){let o=r[t];for(let t=s,r=o-n;t<r;t+=n)e.push([i.slice(t,t+2),i.slice(t+n,t+n+2)]);s=o}return e}};function e5(t){return t.feature?t.feature:t.element?t.element:null}let e6=[],e4=[],e8=[];class e9 extends e2.default{constructor(t){const e=t=t||{};e.handleDownEvent||(e.handleDownEvent=ec.TRUE),e.stopDown||(e.stopDown=ec.FALSE),super(e),this.on,this.once,this.un,this.source_=t.source?t.source:null,this.vertex_=void 0===t.vertex||t.vertex,this.edge_=void 0===t.edge||t.edge,this.intersection_=void 0!==t.intersection&&t.intersection,this.features_=t.features?t.features:null,this.featuresListenerKeys_=[],this.featureChangeListenerKeys_={},this.indexedFeaturesExtents_={},this.pendingFeatures_={},this.pixelTolerance_=void 0!==t.pixelTolerance?t.pixelTolerance:10,this.rBush_=new eO.default,this.snapped_=null,this.segmenters_=Object.assign({},e3,t.segmenters)}addFeature(t,e){e=void 0===e||e;let i=(0,b.getUid)(t),n=t.getGeometry();if(n){let e=this.segmenters_[n.getType()];if(e){this.indexedFeaturesExtents_[i]=n.getExtent((0,W.createEmpty)());let r=e(n,this.getMap().getView().getProjection()),s=r.length;for(let e=0;e<s;++e){let i=r[e];e4[e]=(0,W.boundingExtent)(i),e8[e]={feature:t,segment:i}}if(e4.length=s,e8.length=s,this.intersection_)for(let e=0,i=r.length;e<i;++e){let i=r[e];if(1===i.length)continue;let n=e4[e];for(let o=0,a=r.length;o<a;++o){if(e===o||e-1===o||e+1===o)continue;let a=r[o];if(!(0,W.intersects)(n,e4[o]))continue;let l=(0,e1.getIntersectionPoint)(i,a);if(!l)continue;let h=[l];e4[s]=(0,W.boundingExtent)(h),e8[s++]={feature:t,segment:h,isIntersection:!0}}for(let{segment:n}of this.rBush_.getInExtent(e4[e])){if(1===n.length)continue;let e=(0,e1.getIntersectionPoint)(i,n);if(!e)continue;let r=[e];e4[s]=(0,W.boundingExtent)(r),e8[s++]={feature:t,segment:r,isIntersection:!0}}}1===s?this.rBush_.insert(e4[0],e8[0]):this.rBush_.load(e4,e8)}}e&&(this.featureChangeListenerKeys_[i]=(0,j.listen)(t,I.default.CHANGE,this.handleFeatureChange_,this))}getFeatures_(){let t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t}areSnapDataEqual_(t,e){return t.segment===e.segment&&t.feature===e.feature}handleEvent(t){let e=this.snapTo(t.pixel,t.coordinate,t.map);return e?(t.coordinate=e.vertex.slice(0,2),t.pixel=e.vertexPixel,this.snapped_&&!this.areSnapDataEqual_(this.snapped_,e)&&this.dispatchEvent(new e0(eQ,this.snapped_)),this.snapped_={vertex:t.coordinate,vertexPixel:t.pixel,feature:e.feature,segment:e.segment},this.dispatchEvent(new e0("snap",this.snapped_))):this.snapped_&&(this.dispatchEvent(new e0(eQ,this.snapped_)),this.snapped_=null),super.handleEvent(t)}handleFeatureAdd_(t){let e=e5(t);e&&this.addFeature(e)}handleFeatureRemove_(t){let e=e5(t);e&&this.removeFeature(e)}handleFeatureChange_(t){let e=t.target;if(this.handlingDownUpSequence){let t=(0,b.getUid)(e);t in this.pendingFeatures_||(this.pendingFeatures_[t]=e)}else this.updateFeature_(e)}handleUpEvent(t){let e=Object.values(this.pendingFeatures_);if(e.length)for(let t of e)this.updateFeature_(t);return!1}removeFeature(t,e){let i=(0,b.getUid)(t),n=this.indexedFeaturesExtents_[i];if(n){let e=this.rBush_,i=[];e.forEachInExtent(n,function(e){t===e.feature&&i.push(e)});for(let t=i.length-1;t>=0;--t)e.remove(i[t])}(void 0===e||e)&&((0,j.unlistenByKey)(this.featureChangeListenerKeys_[i]),delete this.featureChangeListenerKeys_[i])}setMap(t){let e=this.getMap(),i=this.featuresListenerKeys_,n=this.getFeatures_();if(Array.isArray(n)||(n=n.getArray()),e&&(i.forEach(j.unlistenByKey),i.length=0,this.rBush_.clear(),Object.values(this.featureChangeListenerKeys_).forEach(j.unlistenByKey),this.featureChangeListenerKeys_={}),super.setMap(t),t)for(let t of(this.features_?i.push((0,j.listen)(this.features_,eA.default.ADD,this.handleFeatureAdd_,this),(0,j.listen)(this.features_,eA.default.REMOVE,this.handleFeatureRemove_,this)):this.source_&&i.push((0,j.listen)(this.source_,ek.default.ADDFEATURE,this.handleFeatureAdd_,this),(0,j.listen)(this.source_,ek.default.REMOVE
1FEATURE,this.handleFeatureRemove_,this)),n))this.addFeature(t)}snapTo(t,e,i){let n,r,s,o=i.getView().getProjection(),a=(0,d.fromUserCoordinate)(e,o),l=(0,d.toUserExtent)((0,W.buffer)((0,W.boundingExtent)([a]),i.getView().getResolution()*this.pixelTolerance_),o),h=this.rBush_.getInExtent(l),u=h.length;if(0===u)return null;let c=1/0,g=null,f=this.pixelTolerance_*this.pixelTolerance_,_=()=>{if(n){let e=i.getPixelFromCoordinate(n);if((0,eh.squaredDistance)(t,e)<=f&&(s&&this.intersection_||!s&&(this.vertex_||this.edge_)))return{vertex:n,vertexPixel:[Math.round(e[0]),Math.round(e[1])],feature:r,segment:g}}return null};if(this.vertex_||this.intersection_){for(let t=0;t<u;++t){let e=h[t];if("Circle"!==e.feature.getGeometry().getType())for(let t of e.segment){let i=(0,d.fromUserCoordinate)(t,o),l=(0,eh.squaredDistance)(a,i);l<c&&(n=t,c=l,r=e.feature,s=e.isIntersection)}}let t=_();if(t)return t}if(this.edge_){for(let t=0;t<u;++t){let e=null,i=h[t];if("Circle"===i.feature.getGeometry().getType()){let t=i.feature.getGeometry(),n=(0,d.getUserProjection)();n&&(t=t.clone().transform(n,o)),e=(0,eh.closestOnCircle)(a,t)}else{let[t,n]=i.segment;n&&(e6[0]=(0,d.fromUserCoordinate)(t,o),e6[1]=(0,d.fromUserCoordinate)(n,o),e=(0,eh.closestOnSegment)(a,e6))}if(e){let t=(0,eh.squaredDistance)(a,e);t<c&&(n=(0,d.toUserCoordinate)(e,o),g="Circle"===i.feature.getGeometry().getType()?null:i.segment,c=t,r=i.feature)}}let t=_();if(t)return t}return null}updateFeature_(t){this.removeFeature(t,!1),this.addFeature(t,!1)}}let e7=new u.default({fill:new c.default({color:"rgba(0, 150, 255, 0.2)"}),stroke:new g.default({color:"#007aff",width:2}),image:new f.default({radius:6,fill:new c.default({color:"#007aff"}),stroke:new g.default({color:"#fff",width:2})})}),it=t=>{var e;let{selectedTool:u,onPolygonComplete:c,onPointAdd:g,onPointMove:f,onLabelAdd:v,onLabelMove:C,onFeatureSelect:w,onSetCenter:S,onGridUpdate:R,onGridClick:I,polygons:T,points:b,labels:M,grid:P,mapCenter:L,mapZoom:F,mapType:A,height:D,hideControls:k,hideFullscreenButton:O,isFullscreenOpen:G,onFullscreenChange:z,measurementTargetCoord:N,onMeasurementTargetChange:U,showMeasurement:W,onShowMeasurementChange:j,onMapViewStateChange:B,userLocation:X,onUserLocationChange:V,readOnly:K,showUserLocationRadius:Y,onShowUserLocationRadiusChange:Z}=t,q=(0,n.useRef)(null),H=(0,n.useRef)(null),$=(0,n.useRef)(new a.default),J=(0,n.useRef)(new a.default),Q=(0,n.useRef)(new a.default),tt=(0,n.useRef)(new a.default),te=(0,n.useRef)(new a.default),ti=(0,n.useRef)(null),tn=(0,n.useRef)({}),tr=(0,n.useRef)(null),ts=(0,n.useRef)(null),to=(0,n.useRef)(null),ta=(0,n.useRef)(null),tl=(0,n.useRef)(null),th=(0,n.useRef)(null),td=(0,n.useRef)(!1),[tu,tc]=(0,n.useState)(X||null),tg=K?(0,y.useActiveCapturePoints)():{data:null};return((t,e)=>{let[i,r]=(0,n.useState)(null);return(0,n.useEffect)(()=>{if(!t||!navigator.geolocation)return;let i=navigator.geolocation.watchPosition(t=>{let i=(0,d.fromLonLat)([t.coords.longitude,t.coords.latitude]);r(i),e?.(i)},t=>console.error("Geolocation error:",t),{enableHighAccuracy:!0,maximumAge:1e4,timeout:2e4});return()=>navigator.geolocation.clearWatch(i)},[t,e])})(!!(K&&!k),t=>{tc(t),V?.(t)}),e=!!(K&&!k),(0,n.useEffect)(()=>{if(!e)return;let t=t=>{let e=0;void 0!==t.webkitCompassHeading?e=t.webkitCompassHeading:null!==t.alpha&&(t.absolute,e=((e=360-t.alpha)+360)%360),ti.current&&(ti.current.textContent=`${Math.round(e)}\xb0`)},i=t=>{if(null!==t.alpha){let e=360-t.alpha;e=(e+360)%360,ti.current&&(ti.current.textContent=`${Math.round(e)}\xb0`)}};return"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(e=>{"granted"===e&&window.addEventListener("deviceorientation",t,!0)}).catch(console.error):"ondeviceorientationabsolute"in window?window.addEventListener("deviceorientationabsolute",i,!0):window.addEventListener("deviceorientation",t,!0),()=>{window.removeEventListener("deviceorientation",t,!0),window.removeEventListener("deviceorientationabsolute",i,!0)}},[e,ti]),(0,n.useEffect)(()=>{X&&X!==tu&&tc(X)},[X]),(0,n.useEffect)(()=>{if(!q.current)return;let t=tK(A||"roadmap"),e=new o.default({source:$.current,style:e7,zIndex:1}),i=new o.default({source:J.current,style:e7,zIndex:10}),n=new o.default({source:Q.current,style:e7,zIndex:20}),a=new o.default({source:tt.current,style:e7,zIndex:30}),u=new o.default({source:te.current,style:e7,zIndex:1e3}),c=new l.ScaleLine({units:"metric",bar:!0,steps:4,text:!1,minWidth:140}),g=new r.default({target:q.current,controls:(0,h.defaults)().extend([c]),layers:[t,e,i,n,a,u],view:new s.default({center:L?(0,d.fromLonLat)([L.lng,L.lat]):void 0,zoom:F})});
1return H.current=g,tr.current=new t5($.current),ts.current=new t4(J.current),to.current=new t9(Q.current,tn.current,!!K,null),ta.current=new t7(tt.current),tl.current=new er(te.current),th.current=new eo(te.current),()=>g.setTarget(void 0)},[]),(0,n.useEffect)(()=>{let t=H.current;if(!t||!B)return;let e=t.getView(),i=()=>{let t=e.getCenter(),i=e.getZoom();if(t&&void 0!==i){let[e,n]=(0,d.toLonLat)(t);B({center:{lat:n,lng:e},zoom:i})}};return e.on("change:center",i),e.on("change:resolution",i),()=>{e.un("change:center",i),e.un("change:resolution",i)}},[B]),(0,n.useEffect)(()=>{if(!H.current)return;let t=H.current.getLayers().getArray();t.length>0&&(t[0]=tK(A||"roadmap"),H.current.render())},[A]),(0,n.useEffect)(()=>{H.current&&(!td.current&&(J.current.clear(),Q.current.clear(),tt.current.clear(),T&&ts.current&&ts.current.renderAll(T),b&&to.current&&(to.current.setActiveCapturePoints(tg.data||null),to.current.renderAll(b)),M&&ta.current&&ta.current.renderAll(M)),$.current.clear(),P&&P.enabled&&tr.current&&tr.current.render(P,!!K))},[T,b,M,P,K,tg.data]),(0,n.useEffect)(()=>{H.current&&tu&&K&&tl.current&&tl.current.render(tu,!!Y)},[tu,K,Y]),(0,n.useEffect)(()=>{let t=H.current;if(!t||!K||!tu||!W||!th.current)return;let e=t=>{let e=t.coordinate;U?.(e),th.current.render(tu,e)};return t.on("click",e),()=>{t.un("click",e)}},[K,tu,W,U]),(0,n.useEffect)(()=>{!(!tu||!N||!th.current||th.current.getMeasurementLine())&&W&&th.current.render(tu,N)},[tu,N,W]),(0,n.useEffect)(()=>{th.current&&tu&&th.current.update(tu)},[tu]),(0,n.useEffect)(()=>{!W&&th.current&&(th.current.clear(),U?.(null))},[W,U]),(0,n.useEffect)(()=>{let t=H.current;t&&((t,e,i,n,r,s,o)=>{if(t.getInteractions().getArray().filter(t=>t instanceof eL||t instanceof ej||t instanceof e$).forEach(e=>t.removeInteraction(e)),t._labelClickHandler&&(t.un("click",t._labelClickHandler),t._labelClickHandler=null),t._setCenterClickHandler&&(t.un("click",t._setCenterClickHandler),t._setCenterClickHandler=null),t._gridClickHandler&&(t.un("click",t._gridClickHandler),t._gridClickHandler=null),!s)switch(i){case"polygon":let a;c=r.onPolygonComplete,(a=new eL({source:e,type:"Polygon"})).on("drawend",t=>{let e=t.feature.getGeometry().getCoordinates()[0].map(t=>{let[e,i]=(0,d.toLonLat)([t[0],t[1]]);return{lat:i,lng:e}});c?.(e)}),t.addInteraction(a);break;case"point":let l;g=r.onPointAdd,(l=new eL({source:e,type:"Point"})).on("drawend",t=>{let i=t.feature.getGeometry(),[n,r]=(0,d.toLonLat)(i.getCoordinates());g?.({lat:r,lng:n}),setTimeout(()=>{e.removeFeature(t.feature)},0)}),t.addInteraction(l);break;case"setCenter":let h;f=r.onSetCenter,h=t=>{let e=t.coordinate,[i,n]=(0,d.toLonLat)(e);f?.({lat:n,lng:i})},t.on("click",h),t._setCenterClickHandler=h;break;case"label":let u;_=r.onLabelAdd,u=t=>{let e=t.coordinate,[i,n]=(0,d.toLonLat)(e),r=prompt("Enter label text:");r&&_?.({lat:n,lng:i},r)},t.on("click",u),t._labelClickHandler=u;break;case"select":case"grid":var c,g,f,_;let p=new e$({hitTolerance:10,filter:t=>{let e=t.get("type");return"grid"===i?"grid-control"===e:"grid-control"!==e&&"grid-line"!==e&&"grid-label"!==e}});if(r.onFeatureSelect&&p.on("select",t=>{if(t.selected.length>0){let e=t.selected[0].getId();e?.startsWith("polygon-")?r.onFeatureSelect(e.replace("polygon-",""),"zone"):e?.startsWith("point-")?r.onFeatureSelect(e.replace("point-",""),"point"):e?.startsWith("label-")&&r.onFeatureSelect(e.replace("label-",""),"label")}}),"select"===i&&r.onGridClick){let e=e=>{t.forEachFeatureAtPixel(e.pixel,t=>{let e=t.get("type");return("grid-line"===e||"grid-control"===e)&&(r.onGridClick(),!0)})};t.on("click",e),t._gridClickHandler=e}let m=new ej({features:p.getFeatures()});m.on("modifystart",()=>{o&&(o.current=!0)}),m.on("modifyend",t=>{t.features.forEach(t=>{let e=t.getId(),i=t.getGeometry();if("grid-center"===e&&n&&r.onGridUpdate){let t=i.getCoordinates(),[e,s]=(0,d.toLonLat)(t);r.onGridUpdate({lat:s,lng:e},n.cellSizeLat,n.cellSizeLng)}else if(e?.startsWith("grid-corner-")&&n&&r.onGridUpdate){let t=i.getCoordinates(),e=(0,d.fromLonLat)([n.center.lng,n.center.lat]),s=Math.abs(t[0]-e[0]),o=Math.abs(t[1]-e[1]),a=2*s/n.cols/(111320*Math.cos(n.center.lat*Math.PI/180)
1),l=2*o/n.rows/111320;r.onGridUpdate(n.center,l,a)}else if(e?.startsWith("point-")&&r.onPointMove){let t=i.getCoordinates(),[n,s]=(0,d.toLonLat)(t),o=e.replace("point-","");r.onPointMove(o,{lat:s,lng:n})}else if(e?.startsWith("label-")&&r.onLabelMove){let t=i.getCoordinates(),[n,s]=(0,d.toLonLat)(t),o=e.replace("label-","");r.onLabelMove(o,{lat:s,lng:n})}}),o&&setTimeout(()=>{o.current=!1},100)});let y=new e9({source:e});t.addInteraction(p),t.addInteraction(m),t.addInteraction(y)}})(t,J.current,u,P,{onPolygonComplete:c,onPointAdd:g,onPointMove:f,onLabelAdd:v,onLabelMove:C,onFeatureSelect:w,onSetCenter:S,onGridUpdate:R,onGridClick:I},!!K,td)},[u,c,g,f,v,C,w,R,I,P,K]),(0,i.jsxs)("div",{style:{position:"relative",width:"100%",height:D||(G?"100vh":"600px")},children:[(0,i.jsx)("style",{children:` 2 .ol-zoom { 3 display: none !important; 4 } 5 .ol-rotate { 6 display: none !important; 7 } 8 .ol-full-screen { 9 display: none !important; 10 } 11 .ol-attribution button { 12 display: none !important; 13 } 14 .ol-attribution.ol-collapsed { 15 display: none !important; 16 } 17 `}),(0,i.jsxs)("div",{ref:q,style:{width:"100%",height:"100%",borderRadius:G||"100%"===D?"0":"12px",overflow:"hidden",position:"relative"},children:[K&&!k&&!O&&(0,i.jsx)(E,{onOpenChange:z,measurementTargetCoord:N,onMeasurementTargetChange:U,showMeasurement:W,onShowMeasurementChange:j,mapViewState:H.current?(()=>{let t=H.current.getView(),e=t.getCenter(),i=t.getZoom();if(e&&void 0!==i){let[t,n]=(0,d.toLonLat)(e);return{center:{lat:n,lng:t},zoom:i}}return null})():null,onMapViewStateChange:B,userLocation:X,onUserLocationChange:V,showUserLocationRadius:Y,onShowUserLocationRadiusChange:Z,children:(0,i.jsx)(x.Button,{variant:"outline",size:"sm",className:"absolute top-2 right-2 z-40 bg-gray-700 hover:bg-gray-600 border-gray-600 text-white",style:{display:G?"none":"flex"},children:(0,i.jsx)(p.Maximize,{className:"h-4 w-4"})})}),K&&!k&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(x.Button,{variant:"outline",size:"sm",className:`absolute top-2 left-2 z-40 ${W?"bg-orange-600 hover:bg-orange-500 border-orange-500 text-white":"bg-gray-700 hover:bg-gray-600 border-gray-600 text-white"}`,style:{display:G?"none":"flex"},onClick:()=>{j?.(!W)},children:(0,i.jsx)(m.Ruler,{className:"h-4 w-4"})}),(0,i.jsx)(x.Button,{variant:Y?"default":"outline",size:"sm",className:`absolute top-2 left-13 z-40 ${Y?"bg-orange-600 hover:bg-orange-500 border-orange-500 text-white":"bg-gray-700 hover:bg-gray-600 border-gray-600 text-white"}`,style:{display:G?"none":"flex"},onClick:()=>{Z?.(!Y)},title:"Zobrazit 50/100m okruhy",children:(0,i.jsx)(_.CircleIcon,{className:"h-4 w-4"})})]}),K&&!k&&(0,i.jsxs)("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-40 bg-gray-800/90 backdrop-blur-sm rounded-full border border-gray-600",style:{display:G?"none":"flex",alignItems:"center",gap:"6px",padding:"4px 10px",willChange:"contents"},children:[(0,i.jsx)("div",{style:{color:"#999",fontSize:"10px",fontWeight:"500"},children:"Azimut:"}),(0,i.jsx)("div",{ref:ti,style:{color:"#fff",fontSize:"14px",fontWeight:"bold",fontFamily:"monospace"},children:"0°"})]})]})]})}},62278,t=>{"use strict";t.s(["default",()=>o]);var e=t.i(18050),i=t.i(66027),n=t.i(70896),r=t.i(73179),s=t.i(53420);let o=({mapId:t,fullHeight:o=!1,hideControls:a=!1,hideFullscreenButton:l=!1,onFullscreenChange:h,isFullscreenOpen:d=!1,measurementTargetCoord:u,onMeasurementTargetChange:c,showMeasurement:g,onShowMeasurementChange:f,mapViewState:_,onMapViewStateChange:p,userLocation:m,onUserLocationChange:y,showUserLocationRadius:x,onShowUserLocationRadiusChange:v})=>{let C=(0,i.useQuery)({queryKey:["map",t],queryFn:()=>t?n.default.getMapById(t):n.default.getActiveMap().then(t=>t[1]),enabled:!0});return C.isLoading?(0,e.jsx)("div",{className:`flex items-center justify-center ${o?"h-full":"h-[500px]"} bg-gray-900 ${o?"":"rounded"}`,children:(0,e.jsx)("div",{className:"text-white",children:"Loading map..."})}):C.isError||!C.data?(0,e.jsx)("div",{className:`flex items-center justify-center ${o?"h-full":"h-[500px]"} bg-gray-900 ${o?"":"rounded"}`,children:(0,e.jsx)("div",{className:"text-red-400",children:"Failed to load map"})}):(0,e.jsx)("div",{className:o?"h-full w-full":"",style:{position:"relative"},children:(0,e.jsx)(r.default,{selectedTool:"select",readOnly:!0,polygons:C.data?.zones?C.data.zones.map(t=>({id:t.id,coords:t.paths.map(t=>(0,s.fromLonLat)([t.lng,t.lat])),label:t.label?.text||t.name,fillColor:t.fillColor,strokeColor:t.strokeColor,fillOpacity:t.fillOpacity,strokeOpacity:t.strokeOpacity,strokeWeight:t.strokeWeight,labelFontSize:t.label?.fontSize,labelFontWeight:t.label?.fontWeight,labelColor:t.label?.color,labelBackgroun
17dColor:t.label?.backgroundColor,labelPadding:t.label?.padding})):[],points:C.data?.points?C.data.points.map(t=>({id:t.id,coord:(0,s.fromLonLat)([t.position.lng,t.position.lat]),type:t.type,label:t.label?.text||t.name,customHTML:t.customHTML,color:t.color,size:t.size,strokeColor:t.strokeColor,strokeWidth:t.strokeWidth,labelFontSize:t.label?.fontSize,labelFontWeight:t.label?.fontWeight,labelColor:t.label?.color,labelPadding:t.label?.padding,capturePointId:t.capturePointId})):[],labels:C.data?.labels?C.data.labels.map(t=>({id:t.id,coord:(0,s.fromLonLat)([t.position.lng,t.position.lat]),text:t.text,fontSize:t.fontSize,color:t.color})):[],grid:C.data.grid,mapCenter:_?.center||C.data.center,mapZoom:_?.zoom||C.data.zoom,mapType:C.data.mapType,height:o?"100%":void 0,hideControls:a,hideFullscreenButton:l,onFullscreenChange:h,isFullscreenOpen:d,measurementTargetCoord:u,onMeasurementTargetChange:c,showMeasurement:g,onShowMeasurementChange:f,onMapViewStateChange:p,userLocation:m,onUserLocationChange:y,showUserLocationRadius:x,onShowUserLocationRadiusChange:v})})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.