UNPKG

trifid-plugin-yasgui

Version:
7 lines (6 loc) 43.4 kB
var st=Object.create;var Q=Object.defineProperty;var ot=Object.getOwnPropertyDescriptor;var at=Object.getOwnPropertyNames;var lt=Object.getPrototypeOf,ht=Object.prototype.hasOwnProperty;var Pt=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(i){throw e=0,i}},ct=(t,e)=>{for(var i in e)Q(t,i,{get:e[i],enumerable:!0})},ut=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of at(e))!ht.call(t,r)&&r!==i&&Q(t,r,{get:()=>e[r],enumerable:!(n=ot(e,r))||n.enumerable});return t};var Nt=(t,e,i)=>(i=t!=null?st(lt(t)):{},ut(e||!t||!t.__esModule?Q(i,"default",{value:t,enumerable:!0}):i,t));var ee=class t{constructor(e){e=e||{},this.color_=e.color!==void 0?e.color:null}clone(){let e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})}getColor(){return this.color_}setColor(e){this.color_=e}},v=ee;var te=class t{constructor(e){e=e||{},this.color_=e.color!==void 0?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=e.lineDash!==void 0?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}clone(){let e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}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(e){this.color_=e}setLineCap(e){this.lineCap_=e}setLineDash(e){this.lineDash_=e}setLineDashOffset(e){this.lineDashOffset_=e}setLineJoin(e){this.lineJoin_=e}setMiterLimit(e){this.miterLimit_=e}setWidth(e){this.width_=e}},O=te;var _={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function y(){throw new Error("Unimplemented abstract method.")}var ft=0;function N(t){return t.ol_uid||(t.ol_uid=String(++ft))}function Xt(t){return t[0]>0&&t[1]>0}function Yt(t,e,i){return i===void 0&&(i=[0,0]),i[0]=t[0]*e+.5|0,i[1]=t[1]*e+.5|0,i}function D(t,e){return Array.isArray(t)?t:(e===void 0?e=[t,t]:(e[0]=t,e[1]=t),e)}var ie=class t{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=D(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){let e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,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 y()}getImage(e){return y()}getHitDetectionImage(){return y()}getPixelRatio(e){return 1}getImageState(){return y()}getImageSize(){return y()}getOrigin(){return y()}getSize(){return y()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=D(e)}listenImageChange(e){y()}load(){y()}unlistenImageChange(e){y()}},x=ie;var dt={1:"The view center is not defined",2:"The view resolution is not defined",3:"The view rotation is not defined",4:"`image` and `src` cannot be provided at the same time",5:"`imgSize` must be set when `image` is provided",7:"`format` must be set when `url` is set",8:"Unknown `serverType` configured",9:"`url` must be configured or set using `#setUrl()`",10:"The default `geometryFunction` can only handle `Point` geometries",11:"`options.featureTypes` must be an Array",12:"`options.geometryName` must also be provided when `options.bbox` is set",13:"Invalid corner",14:"Invalid color",15:"Tried to get a value for a key that does not exist in the cache",16:"Tried to set a value for a key that is used already",17:"`resolutions` must be sorted in descending order",18:"Either `origin` or `origins` must be configured, never both",19:"Number of `tileSizes` and `resolutions` must be equal",20:"Number of `origins` and `resolutions` must be equal",22:"Either `tileSize` or `tileSizes` must be configured, never both",24:"Invalid extent or geometry provided as `geometry`",25:"Cannot fit empty extent provided as `geometry`",26:"Features must have an id set",27:"Features must have an id set",28:'`renderMode` must be `"hybrid"` or `"vector"`',30:"The passed `feature` was already added to the source",31:"Tried to enqueue an `element` that was already added to the queue",32:"Transformation matrix cannot be inverted",33:"Invalid units",34:"Invalid geometry layout",36:"Unknown SRS type",37:"Unknown geometry type found",38:"`styleMapValue` has an unknown type",39:"Unknown geometry type",40:"Expected `feature` to have a geometry",41:"Expected an `ol/style/Style` or an array of `ol/style/Style.js`",42:"Question unknown, the answer is 42",43:"Expected `layers` to be an array or a `Collection`",47:"Expected `controls` to be an array or an `ol/Collection`",48:"Expected `interactions` to be an array or an `ol/Collection`",49:"Expected `overlays` to be an array or an `ol/Collection`",50:"`options.featureTypes` should be an Array",51:"Either `url` or `tileJSON` options must be provided",52:"Unknown `serverType` configured",53:"Unknown `tierSizeCalculation` configured",55:"The {-y} placeholder requires a tile grid with extent",56:"mapBrowserEvent must originate from a pointer event",57:"At least 2 conditions are required",59:"Invalid command found in the PBF",60:"Missing or invalid `size`",61:"Cannot determine IIIF Image API version from provided image information JSON",62:"A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`",64:"Layer opacity must be a number",66:"`forEachFeatureAtCoordinate` cannot be used on a WebGL layer if the hit detection logic has not been enabled. This is done by providing adequate shaders using the `hitVertexShader` and `hitFragmentShader` properties of `WebGLPointsLayerRenderer`",67:"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both",68:"A VectorTile source can only be rendered if it has a projection compatible with the view projection",69:"`width` or `height` cannot be provided together with `scale`"},ne=class extends Error{constructor(e){let i=dt[e];super(i),this.code=e,this.name="AssertionError",this.message=i}},Le=ne;function S(t,e){if(!t)throw new Le(e)}function T(t,e,i){return Math.min(Math.max(t,e),i)}function ei(t,e,i,n,r,s){let o=r-i,a=s-n;if(o!==0||a!==0){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 gt(t,e,i,n)}function gt(t,e,i,n){let r=i-t,s=n-e;return r*r+s*s}function ti(t){let e=t.length;for(let n=0;n<e;n++){let r=n,s=Math.abs(t[n][n]);for(let a=n+1;a<e;a++){let l=Math.abs(t[a][n]);l>s&&(s=l,r=a)}if(s===0)return null;let o=t[r];t[r]=t[n],t[n]=o;for(let a=n+1;a<e;a++){let l=-t[a][n]/t[n][n];for(let h=n;h<e+1;h++)n==h?t[a][h]=0:t[a][h]+=l*t[n][h]}}let i=new 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 ii(t){return t*Math.PI/180}function ni(t,e){let i=t%e;return i*e<0?i+e:i}function ri(t,e,i){return t+i*(e-t)}function Oe(t,e){let i=Math.pow(10,e);return Math.round(t*i)/i}function si(t,e){return Math.floor(Oe(t,e))}function oi(t,e){return Math.ceil(Oe(t,e))}var mt=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,_t=/^([a-z]*)$|^hsla?\(.*\)$/i;function V(t){return typeof t=="string"?t:re(t)}function pt(t){let e=document.createElement("div");if(e.style.color=t,e.style.color!==""){document.body.appendChild(e);let i=getComputedStyle(e).color;return document.body.removeChild(e),i}return""}var yt=(function(){let e={},i=0;return(function(n){let r;if(e.hasOwnProperty(n))r=e[n];else{if(i>=1024){let s=0;for(let o in e)(s++&3)===0&&(delete e[o],--i)}r=St(n),e[n]=r,++i}return r})})();function B(t){return Array.isArray(t)?t:yt(t)}function St(t){let e,i,n,r,s;if(_t.exec(t)&&(t=pt(t)),mt.exec(t)){let o=t.length-1,a;o<=4?a=1:a=2;let l=o===4||o===8;e=parseInt(t.substr(1+0*a,a),16),i=parseInt(t.substr(1+1*a,a),16),n=parseInt(t.substr(1+2*a,a),16),l?r=parseInt(t.substr(1+3*a,a),16):r=255,a==1&&(e=(e<<4)+e,i=(i<<4)+i,n=(n<<4)+n,l&&(r=(r<<4)+r)),s=[e,i,n,r/255]}else t.startsWith("rgba(")?(s=t.slice(5,-1).split(",").map(Number),De(s)):t.startsWith("rgb(")?(s=t.slice(4,-1).split(",").map(Number),s.push(1),De(s)):S(!1,14);return s}function De(t){return t[0]=T(t[0]+.5|0,0,255),t[1]=T(t[1]+.5|0,0,255),t[2]=T(t[2]+.5|0,0,255),t[3]=T(t[3],0,1),t}function re(t){let e=t[0];e!=(e|0)&&(e=e+.5|0);let i=t[1];i!=(i|0)&&(i=i+.5|0);let n=t[2];n!=(n|0)&&(n=n+.5|0);let r=t[3]===void 0?1:Math.round(t[3]*100)/100;return"rgba("+e+","+i+","+n+","+r+")"}function se(t){return Array.isArray(t)?re(t):t}var A=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",di=A.includes("firefox"),It=A.includes("safari")&&!A.includes("chrom"),gi=It&&(A.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(A)),mi=A.includes("webkit")&&!A.includes("edge"),_i=A.includes("macintosh"),pi=typeof devicePixelRatio<"u"?devicePixelRatio:1,U=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,xe=typeof Image<"u"&&Image.prototype.decode,yi=(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})();function w(t,e,i,n){let r;return i&&i.length?r=i.shift():U?r=new OffscreenCanvas(t||300,e||300):r=document.createElement("canvas"),t&&(r.width=t),e&&(r.height=e),r.getContext("2d",n)}function Ei(t){let e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function vi(t,e){let i=e.parentNode;i&&i.replaceChild(t,e)}function Ai(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function wi(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function Ci(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)}}}var oe=class{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}};var H=oe;var Re={PROPERTYCHANGE:"propertychange"};var ae=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}},be=ae;function Ri(t,e,i){let n,r;i=i||Me;let s=0,o=t.length,a=!1;for(;s<o;)n=s+(o-s>>1),r=+i(t[n],e),r<0?s=n+1:(o=n,a=!r);return a?s:~s}function Me(t,e){return t>e?1:t<e?-1:0}function bi(t,e,i){if(t[0]<=e)return 0;let n=t.length;if(e<=t[n-1])return n-1;if(typeof i=="function"){for(let r=1;r<n;++r){let s=t[r];if(s===e)return r;if(s<e)return i(e,t[r-1],s)>0?r-1:r}return n-1}if(i>0){for(let r=1;r<n;++r)if(t[r]<e)return r-1;return n-1}if(i<0){for(let r=1;r<n;++r)if(t[r]<=e)return r;return n-1}for(let r=1;r<n;++r){if(t[r]==e)return r;if(t[r]<e)return t[r-1]-e<e-t[r]?r-1:r}return n-1}function Mi(t,e,i){for(;e<i;){let n=t[e];t[e]=t[i],t[i]=n,++e,--i}}function ki(t,e){let i=Array.isArray(e)?e:[e],n=i.length;for(let r=0;r<n;r++)t[t.length]=i[r]}function ke(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 zi(t,e,i){let n=e||Me;return t.every(function(r,s){if(s===0)return!0;let o=n(t[s-1],r);return!(o>0||i&&o===0)})}function Wi(){return!0}function Pi(){return!1}function le(){}function Ni(t){let e=!1,i,n,r;return function(){let s=Array.prototype.slice.call(arguments);return(!e||this!==r||!ke(s,n))&&(e=!0,r=this,n=s,i=t.apply(this,arguments)),i}}function R(t){for(let e in t)delete t[e]}function ze(t){let e;for(e in t)return!1;return!e}var he=class extends be{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,i){if(!e||!i)return;let n=this.listeners_||(this.listeners_={}),r=n[e]||(n[e]=[]);r.includes(i)||r.push(i)}dispatchEvent(e){let i=typeof e=="string",n=i?e:e.type,r=this.listeners_&&this.listeners_[n];if(!r)return;let s=i?new H(e):e;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];let l;for(let h=0,c=r.length;h<c;++h)if("handleEvent"in r[h]?l=r[h].handleEvent(s):l=r[h].call(this,s),l===!1||s.propagationStopped){l=!1;break}if(--o[n]===0){let h=a[n];for(delete a[n];h--;)this.removeEventListener(n,le);delete o[n]}return l}disposeInternal(){this.listeners_&&R(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,i){let n=this.listeners_&&this.listeners_[e];if(n){let r=n.indexOf(i);r!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(n[r]=le,++this.pendingRemovals_[e]):(n.splice(r,1),n.length===0&&delete this.listeners_[e]))}}},G=he;var E={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function X(t,e,i,n,r){if(n&&n!==t&&(i=i.bind(n)),r){let o=i;i=function(){t.removeEventListener(e,i),o.apply(this,arguments)}}let s={target:t,type:e,listener:i};return t.addEventListener(e,i),s}function b(t,e,i,n){return X(t,e,i,n,!0)}function F(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),R(t))}var M=class extends G{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(E.CHANGE)}getRevision(){return this.revision_}onInternal(e,i){if(Array.isArray(e)){let n=e.length,r=new Array(n);for(let s=0;s<n;++s)r[s]=X(this,e[s],i);return r}return X(this,e,i)}onceInternal(e,i){let n;if(Array.isArray(e)){let r=e.length;n=new Array(r);for(let s=0;s<r;++s)n[s]=b(this,e[s],i)}else n=b(this,e,i);return i.ol_key=n,n}unInternal(e,i){let n=i.ol_key;if(n)Et(n);else if(Array.isArray(e))for(let r=0,s=e.length;r<s;++r)this.removeEventListener(e[r],i);else this.removeEventListener(e,i)}};M.prototype.on;M.prototype.once;M.prototype.un;function Et(t){if(Array.isArray(t))for(let e=0,i=t.length;e<i;++e)F(t[e]);else F(t)}var Te=M;var Y=class extends H{constructor(e,i,n){super(e),this.key=i,this.oldValue=n}},ce=class extends Te{constructor(e){super(),this.on,this.once,this.un,N(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let i;return this.values_&&this.values_.hasOwnProperty(e)&&(i=this.values_[e]),i}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}hasProperties(){return!!this.values_}notify(e,i){let n;n=`change:${e}`,this.hasListener(n)&&this.dispatchEvent(new Y(n,e,i)),n=Re.PROPERTYCHANGE,this.hasListener(n)&&this.dispatchEvent(new Y(n,e,i))}addChangeListener(e,i){this.addEventListener(`change:${e}`,i)}removeChangeListener(e,i){this.removeEventListener(`change:${e}`,i)}set(e,i,n){let r=this.values_||(this.values_={});if(n)r[e]=i;else{let s=r[e];r[e]=i,s!==i&&this.notify(e,s)}}setProperties(e,i){for(let n in e)this.set(n,e[n],i)}applyProperties(e){e.values_&&Object.assign(this.values_||(this.values_={}),e.values_)}unset(e,i){if(this.values_&&e in this.values_){let n=this.values_[e];delete this.values_[e],ze(this.values_)&&(this.values_=null),i||this.notify(e,n)}}},Fe=ce;var an="ol-hidden";var ln="ol-unselectable";var hn="ol-control",cn="ol-collapsed",vt=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),We=["style","variant","weight","size","lineHeight","family"],ue=function(t){let e=t.match(vt);if(!e)return null;let i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let n=0,r=We.length;n<r;++n){let s=e[n+1];s!==void 0&&(i[We[n]]=s)}return i.families=i.family.split(/,\s?/),i};var pn="10px sans-serif",ge="#000",yn="round",Sn=[],In=0,me="round",Pe=10,Ne="#000",En="center",vn="middle",An=[0,0,0,0],Ve=1,C=new Fe,k=null,fe,de={},wn=(function(){let e="32px ",i=["monospace","serif"],n=i.length,r="wmytzilWMYTZIL@#/&?$%10\uF013",s,o;function a(h,c,f){let u=!0;for(let d=0;d<n;++d){let m=i[d];if(o=q(h+" "+c+" "+e+m,r),f!=m){let p=q(h+" "+c+" "+e+f+","+m,r);u=u&&p!=o}}return!!u}function l(){let h=!0,c=C.getKeys();for(let f=0,u=c.length;f<u;++f){let d=c[f];C.get(d)<100&&(a.apply(this,d.split(` `))?(R(de),k=null,fe=void 0,C.set(d,100)):(C.set(d,C.get(d)+1,!0),h=!1))}h&&(clearInterval(s),s=void 0)}return function(h){let c=ue(h);if(!c)return;let f=c.families;for(let u=0,d=f.length;u<d;++u){let m=f[u],p=c.style+` `+c.weight+` `+m;C.get(p)===void 0&&(C.set(p,100,!0),a(c.style,c.weight,m)||(C.set(p,0,!0),s===void 0&&(s=setInterval(l,32))))}}})(),At=(function(){let t;return function(e){let i=de[e];if(i==null){if(U){let n=ue(e),r=Be(e,"\u017Dg");i=(isNaN(Number(n.lineHeight))?1.2:Number(n.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else t||(t=document.createElement("div"),t.innerHTML="M",t.style.minHeight="0",t.style.maxHeight="none",t.style.height="auto",t.style.padding="0",t.style.border="none",t.style.position="absolute",t.style.display="block",t.style.left="-99999px"),t.style.font=e,document.body.appendChild(t),i=t.offsetHeight,document.body.removeChild(t);de[e]=i}return i}})();function Be(t,e){return k||(k=w(1,1)),t!=fe&&(k.font=t,fe=k.font),k.measureText(e)}function q(t,e){return Be(t,e).width}function Cn(t,e,i){if(e in i)return i[e];let n=e.split(` `).reduce((r,s)=>Math.max(r,q(t,s)),0);return i[e]=n,n}function Ln(t,e){let i=[],n=[],r=[],s=0,o=0,a=0,l=0;for(let h=0,c=e.length;h<=c;h+=2){let f=e[h];if(f===` `||h===c){s=Math.max(s,o),r.push(o),o=0,a+=l;continue}let u=e[h+1]||t.font,d=q(u,f);i.push(d),o+=d;let m=At(u);n.push(m),l=Math.max(l,m)}return{width:s,height:a,widths:i,heights:n,lineWidths:r}}function On(t,e,i,n,r,s,o,a,l,h,c){t.save(),i!==1&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),n.contextInstructions?(t.translate(l,h),t.scale(c[0],c[1]),wt(n,t)):c[0]<0||c[1]<0?(t.translate(l,h),t.scale(c[0],c[1]),t.drawImage(n,r,s,o,a,0,0,o,a)):t.drawImage(n,r,s,o,a,l,h,o*c[0],a*c[1]),t.restore()}function wt(t,e){let i=t.contextInstructions;for(let n=0,r=i.length;n<r;n+=2)Array.isArray(i[n+1])?e[i[n]].apply(e,i[n+1]):e[i[n]]=i[n+1]}var _e=class t extends x{constructor(e){let i=e.rotateWithView!==void 0?e.rotateWithView:!1;super({opacity:1,rotateWithView:i,rotation:e.rotation!==void 0?e.rotation:0,scale:e.scale!==void 0?e.scale:1,displacement:e.displacement!==void 0?e.displacement:[0,0],declutterMode:e.declutterMode}),this.canvas_=void 0,this.hitDetectionCanvas_=null,this.fill_=e.fill!==void 0?e.fill:null,this.origin_=[0,0],this.points_=e.points,this.radius_=e.radius!==void 0?e.radius:e.radius1,this.radius2_=e.radius2,this.angle_=e.angle!==void 0?e.angle:0,this.stroke_=e.stroke!==void 0?e.stroke:null,this.size_=null,this.renderOptions_=null,this.render()}clone(){let e=this.getScale(),i=new t({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return i.setOpacity(this.getOpacity()),i}getAnchor(){let e=this.size_;if(!e)return null;let i=this.getDisplacement(),n=this.getScaleArray();return[e[0]/2-i[0]/n[0],e[1]/2+i[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(e){this.fill_=e,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_}getImage(e){let i=this.canvas_[e];if(!i){let n=this.renderOptions_,r=w(n.size*e,n.size*e);this.draw_(n,r,e),i=r.canvas,this.canvas_[e]=i}return i}getPixelRatio(e){return e}getImageSize(){return this.size_}getImageState(){return _.LOADED}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(e){this.stroke_=e,this.render()}listenImageChange(e){}load(){}unlistenImageChange(e){}calculateLineJoinSize_(e,i,n){if(i===0||this.points_===1/0||e!=="bevel"&&e!=="miter")return i;let r=this.radius_,s=this.radius2_===void 0?r:this.radius2_;if(r<s){let $=r;r=s,s=$}let o=this.radius2_===void 0?this.points_:this.points_*2,a=2*Math.PI/o,l=s*Math.sin(a),h=Math.sqrt(s*s-l*l),c=r-h,f=Math.sqrt(l*l+c*c),u=f/l;if(e==="miter"&&u<=n)return u*i;let d=i/2/u,m=i/2*(c/f),I=Math.sqrt((r+d)*(r+d)+m*m)-r;if(this.radius2_===void 0||e==="bevel")return I*2;let z=r*Math.sin(a),rt=Math.sqrt(r*r-z*z),we=s-rt,Ce=Math.sqrt(z*z+we*we)/z;if(Ce<=n){let $=Ce*i/2-s-r;return 2*Math.max(I,$)}return I*2}createRenderOptions(){let e=me,i=0,n=null,r=0,s,o=0;this.stroke_&&(s=this.stroke_.getColor(),s===null&&(s=Ne),s=se(s),o=this.stroke_.getWidth(),o===void 0&&(o=Ve),n=this.stroke_.getLineDash(),r=this.stroke_.getLineDashOffset(),e=this.stroke_.getLineJoin(),e===void 0&&(e=me),i=this.stroke_.getMiterLimit(),i===void 0&&(i=Pe));let a=this.calculateLineJoinSize_(e,o,i),l=Math.max(this.radius_,this.radius2_||0),h=Math.ceil(2*l+a);return{strokeStyle:s,strokeWidth:o,size:h,lineDash:n,lineDashOffset:r,lineJoin:e,miterLimit:i}}render(){this.renderOptions_=this.createRenderOptions();let e=this.renderOptions_.size;this.canvas_={},this.size_=[e,e]}draw_(e,i,n){if(i.scale(n,n),i.translate(e.size/2,e.size/2),this.createPath_(i),this.fill_){let r=this.fill_.getColor();r===null&&(r=ge),i.fillStyle=se(r),i.fill()}this.stroke_&&(i.strokeStyle=e.strokeStyle,i.lineWidth=e.strokeWidth,e.lineDash&&(i.setLineDash(e.lineDash),i.lineDashOffset=e.lineDashOffset),i.lineJoin=e.lineJoin,i.miterLimit=e.miterLimit,i.stroke())}createHitDetectionCanvas_(e){if(this.fill_){let i=this.fill_.getColor(),n=0;if(typeof i=="string"&&(i=B(i)),i===null?n=1:Array.isArray(i)&&(n=i.length===4?i[3]:1),n===0){let r=w(e.size,e.size);this.hitDetectionCanvas_=r.canvas,this.drawHitDetectionCanvas_(e,r)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))}createPath_(e){let i=this.points_,n=this.radius_;if(i===1/0)e.arc(0,0,n,0,2*Math.PI);else{let r=this.radius2_===void 0?n:this.radius2_;this.radius2_!==void 0&&(i*=2);let s=this.angle_-Math.PI/2,o=2*Math.PI/i;for(let a=0;a<i;a++){let l=s+a*o,h=a%2===0?n:r;e.lineTo(h*Math.cos(l),h*Math.sin(l))}e.closePath()}}drawHitDetectionCanvas_(e,i){i.translate(e.size/2,e.size/2),this.createPath_(i),i.fillStyle=ge,i.fill(),this.stroke_&&(i.strokeStyle=e.strokeStyle,i.lineWidth=e.strokeWidth,e.lineDash&&(i.setLineDash(e.lineDash),i.lineDashOffset=e.lineDashOffset),i.lineJoin=e.lineJoin,i.miterLimit=e.miterLimit,i.stroke())}},J=_e;var pe=class t extends J{constructor(e){e=e||{radius:5},super({points:1/0,fill:e.fill,radius:e.radius,stroke:e.stroke,scale:e.scale!==void 0?e.scale:1,rotation:e.rotation!==void 0?e.rotation:0,rotateWithView:e.rotateWithView!==void 0?e.rotateWithView:!1,displacement:e.displacement!==void 0?e.displacement:[0,0],declutterMode:e.declutterMode})}clone(){let e=this.getScale(),i=new t({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return i.setOpacity(this.getOpacity()),i}setRadius(e){this.radius_=e,this.render()}},W=pe;var L=class t{constructor(e){e=e||{},this.geometry_=null,this.geometryFunction_=Ue,e.geometry!==void 0&&this.setGeometry(e.geometry),this.fill_=e.fill!==void 0?e.fill:null,this.image_=e.image!==void 0?e.image:null,this.renderer_=e.renderer!==void 0?e.renderer:null,this.hitDetectionRenderer_=e.hitDetectionRenderer!==void 0?e.hitDetectionRenderer:null,this.stroke_=e.stroke!==void 0?e.stroke:null,this.text_=e.text!==void 0?e.text:null,this.zIndex_=e.zIndex}clone(){let e=this.getGeometry();return e&&typeof e=="object"&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(e){this.renderer_=e}setHitDetectionRenderer(e){this.hitDetectionRenderer_=e}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(e){this.fill_=e}getImage(){return this.image_}setImage(e){this.image_=e}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e}getText(){return this.text_}setText(e){this.text_=e}getZIndex(){return this.zIndex_}setGeometry(e){typeof e=="function"?this.geometryFunction_=e:typeof e=="string"?this.geometryFunction_=function(i){return i.get(e)}:e?e!==void 0&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=Ue,this.geometry_=e}setZIndex(e){this.zIndex_=e}};function Un(t){let e;if(typeof t=="function")e=t;else{let i;Array.isArray(t)?i=t:(S(typeof t.getZIndex=="function",41),i=[t]),e=function(){return i}}return e}var ye=null;function Hn(t,e){if(!ye){let i=new v({color:"rgba(255,255,255,0.4)"}),n=new O({color:"#3399CC",width:1.25});ye=[new L({image:new W({fill:i,stroke:n,radius:5}),fill:i,stroke:n})]}return ye}function Gn(){let t={},e=[255,255,255,1],i=[0,153,255,1],n=3;return t.Polygon=[new L({fill:new v({color:[255,255,255,.5]})})],t.MultiPolygon=t.Polygon,t.LineString=[new L({stroke:new O({color:e,width:n+2})}),new L({stroke:new O({color:i,width:n})})],t.MultiLineString=t.LineString,t.Circle=t.Polygon.concat(t.LineString),t.Point=[new L({image:new W({radius:n*2,fill:new v({color:i}),stroke:new O({color:e,width:n/2})}),zIndex:1/0})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.LineString,t.Point),t}function Ue(t){return t.getGeometry()}var He=L;var Ft={};ct(Ft,{Circle:()=>W,Fill:()=>v,Icon:()=>it,IconImage:()=>et,Image:()=>x,RegularShape:()=>J,Stroke:()=>O,Style:()=>He,Text:()=>nt});var Se=class{constructor(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(let i in this.cache_){let n=this.cache_[i];(e++&3)===0&&!n.hasListener()&&(delete this.cache_[i],--this.cacheSize_)}}}get(e,i,n){let r=Ge(e,i,n);return r in this.cache_?this.cache_[r]:null}set(e,i,n,r){let s=Ge(e,i,n);this.cache_[s]=r,++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}};function Ge(t,e,i){let n=i?V(i):"null";return e+":"+t+":"+n}var Ie=new Se;var g={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Zn(t){let e=Ye();for(let i=0,n=t.length;i<n;++i)Ot(e,t[i]);return e}function Ct(t,e,i){let n=Math.min.apply(null,t),r=Math.min.apply(null,e),s=Math.max.apply(null,t),o=Math.max.apply(null,e);return j(n,r,s,o,i)}function $n(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 Qn(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function er(t,e,i){let n,r;return e<t[0]?n=t[0]-e:t[2]<e?n=e-t[2]:n=0,i<t[1]?r=t[1]-i:t[3]<i?r=i-t[3]:r=0,n*n+r*r}function tr(t,e){return Lt(t,e[0],e[1])}function ir(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function Lt(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function Xe(t,e){let i=t[0],n=t[1],r=t[2],s=t[3],o=e[0],a=e[1],l=g.UNKNOWN;return o<i?l=l|g.LEFT:o>r&&(l=l|g.RIGHT),a<n?l=l|g.BELOW:a>s&&(l=l|g.ABOVE),l===g.UNKNOWN&&(l=g.INTERSECTING),l}function Ye(){return[1/0,1/0,-1/0,-1/0]}function j(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 Ee(t){return j(1/0,1/0,-1/0,-1/0,t)}function nr(t,e){let i=t[0],n=t[1];return j(i,n,i,n,e)}function rr(t,e,i,n,r){let s=Ee(r);return Dt(s,t,e,i,n)}function sr(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function or(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 Ot(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 Dt(t,e,i,n,r){for(;i<n;i+=r)xt(t,e[i],e[i+1]);return t}function xt(t,e,i){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],i)}function ar(t,e){let i;return i=e(qe(t)),i||(i=e(Je(t)),i)||(i=e(je(t)),i)||(i=e(Ke(t)),i)?i:!1}function lr(t){let e=0;return Ze(t)||(e=K(t)*Mt(t)),e}function qe(t){return[t[0],t[1]]}function Je(t){return[t[2],t[1]]}function Rt(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function hr(t,e){let i;return e==="bottom-left"?i=qe(t):e==="bottom-right"?i=Je(t):e==="top-left"?i=Ke(t):e==="top-right"?i=je(t):S(!1,13),i}function cr(t,e,i,n,r){let[s,o,a,l,h,c,f,u]=bt(t,e,i,n);return j(Math.min(s,a,h,f),Math.min(o,l,c,u),Math.max(s,a,h,f),Math.max(o,l,c,u),r)}function bt(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,c=s*o,f=s*a,u=t[0],d=t[1];return[u-l+f,d-h-c,u-l-f,d-h+c,u+l-f,d+h+c,u+l+f,d+h-c,u-l+f,d-h-c]}function Mt(t){return t[3]-t[1]}function ur(t,e,i){let n=i||Ye();return kt(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]):Ee(n),n}function Ke(t){return[t[0],t[3]]}function je(t){return[t[2],t[3]]}function K(t){return t[2]-t[0]}function kt(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Ze(t){return t[2]<t[0]||t[3]<t[1]}function fr(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}function dr(t,e,i){let n=!1,r=Xe(t,e),s=Xe(t,i);if(r===g.INTERSECTING||s===g.INTERSECTING)n=!0;else{let o=t[0],a=t[1],l=t[2],h=t[3],c=e[0],f=e[1],u=i[0],d=i[1],m=(d-f)/(u-c),p,I;s&g.ABOVE&&!(r&g.ABOVE)&&(p=u-(d-h)/m,n=p>=o&&p<=l),!n&&s&g.RIGHT&&!(r&g.RIGHT)&&(I=d-(u-l)*m,n=I>=a&&I<=h),!n&&s&g.BELOW&&!(r&g.BELOW)&&(p=u-(d-a)/m,n=p>=o&&p<=l),!n&&s&g.LEFT&&!(r&g.LEFT)&&(I=d-(u-o)*m,n=I>=a&&I<=h)}return n}function gr(t,e,i,n){if(Ze(t))return Ee(i);let r=[];if(n>1){let a=t[2]-t[0],l=t[3]-t[1];for(let h=0;h<n;++h)r.push(t[0]+a*h/n,t[1],t[2],t[1]+l*h/n,t[2]-a*h/n,t[3],t[0],t[3]-l*h/n)}else r=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(r,r,2);let s=[],o=[];for(let a=0,l=r.length;a<l;a+=2)s.push(r[a]),o.push(r[a+1]);return Ct(s,o,i)}function zt(t,e){let i=e.getExtent(),n=Rt(t);if(e.canWrapX()&&(n[0]<i[0]||n[0]>=i[2])){let r=K(i),o=Math.floor((n[0]-i[0])/r)*r;t[0]-=o,t[2]-=o}return t}function mr(t,e){if(e.canWrapX()){let i=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[i[0],t[1],i[2],t[3]]];zt(t,e);let n=K(i);if(K(t)>n)return[[i[0],t[1],i[2],t[3]]];if(t[0]<i[0])return[[t[0]+n,t[1],i[2],t[3]],[i[0],t[1],t[2],t[3]]];if(t[2]>i[2])return[[t[0],t[1],i[2],t[3]],[i[0],t[1],t[2]-n,t[3]]]}return[t]}function $e(t,e,i){let n=t,r=!0,s=!1,o=!1,a=[b(n,E.LOAD,function(){o=!0,s||e()})];return n.src&&xe?(s=!0,n.decode().then(function(){r&&e()}).catch(function(l){r&&(o?e():i())})):a.push(b(n,E.ERROR,i)),function(){r=!1,a.forEach(F)}}var P=null,Z=class extends G{constructor(e,i,n,r,s,o){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=r,this.canvas_={},this.color_=o,this.unlisten_=null,this.imageState_=s,this.size_=n,this.src_=i,this.tainted_}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===_.LOADED){P||(P=w(1,1,void 0,{willReadFrequently:!0})),P.drawImage(this.image_,0,0);try{P.getImageData(0,0,1,1),this.tainted_=!1}catch{P=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(E.CHANGE)}handleImageError_(){this.imageState_=_.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=_.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()}getImage(e){return this.image_||this.initializeImage_(),this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){let e=this.size_[0],i=this.size_[1],n=w(e,i);n.fillRect(0,0,e,i),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===_.IDLE){this.image_||this.initializeImage_(),this.imageState_=_.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=$e(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==_.LOADED)return;let i=this.image_,n=document.createElement("canvas");n.width=Math.ceil(i.width*e),n.height=Math.ceil(i.height*e);let r=n.getContext("2d");r.scale(e,e),r.drawImage(i,0,0),r.globalCompositeOperation="multiply",r.fillStyle=V(this.color_),r.fillRect(0,0,n.width/e,n.height/e),r.globalCompositeOperation="destination-in",r.drawImage(i,0,0),this.canvas_[e]=n}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}};function Qe(t,e,i,n,r,s){let o=Ie.get(e,n,s);return o||(o=new Z(t,e,i,n,r,s),Ie.set(e,n,s,o)),o}var et=Z;function tt(t,e,i,n){return i!==void 0&&n!==void 0?[i/t,n/e]:i!==void 0?i/t:n!==void 0?n/e:1}var ve=class t extends x{constructor(e){e=e||{};let i=e.opacity!==void 0?e.opacity:1,n=e.rotation!==void 0?e.rotation:0,r=e.scale!==void 0?e.scale:1,s=e.rotateWithView!==void 0?e.rotateWithView:!1;super({opacity:i,rotation:n,scale:r,displacement:e.displacement!==void 0?e.displacement:[0,0],rotateWithView:s,declutterMode:e.declutterMode}),this.anchor_=e.anchor!==void 0?e.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=e.anchorOrigin!==void 0?e.anchorOrigin:"top-left",this.anchorXUnits_=e.anchorXUnits!==void 0?e.anchorXUnits:"fraction",this.anchorYUnits_=e.anchorYUnits!==void 0?e.anchorYUnits:"fraction",this.crossOrigin_=e.crossOrigin!==void 0?e.crossOrigin:null;let o=e.img!==void 0?e.img:null;this.imgSize_=e.imgSize;let a=e.src;S(!(a!==void 0&&o),4),S(!o||o&&this.imgSize_,5),(a===void 0||a.length===0)&&o&&(a=o.src||N(o)),S(a!==void 0&&a.length>0,6),S(!((e.width!==void 0||e.height!==void 0)&&e.scale!==void 0),69);let l=e.src!==void 0?_.IDLE:_.LOADED;if(this.color_=e.color!==void 0?B(e.color):null,this.iconImage_=Qe(o,a,this.imgSize_!==void 0?this.imgSize_:null,this.crossOrigin_,l,this.color_),this.offset_=e.offset!==void 0?e.offset:[0,0],this.offsetOrigin_=e.offsetOrigin!==void 0?e.offsetOrigin:"top-left",this.origin_=null,this.size_=e.size!==void 0?e.size:null,e.width!==void 0||e.height!==void 0){let h,c;if(e.size)[h,c]=e.size;else{let f=this.getImage(1);if(f instanceof HTMLCanvasElement||f.src&&f.complete)h=f.width,c=f.height;else{this.initialOptions_=e;let u=()=>{if(this.unlistenImageChange(u),!this.initialOptions_)return;let d=this.iconImage_.getSize();this.setScale(tt(d[0],d[1],e.width,e.height))};this.listenImageChange(u);return}}h!==void 0&&this.setScale(tt(h,c,e.width,e.height))}}clone(){let e,i,n;return this.initialOptions_?(i=this.initialOptions_.width,n=this.initialOptions_.height):(e=this.getScale(),e=Array.isArray(e)?e.slice():e),new t({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_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:e,width:i,height:n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let e=this.normalizedAnchor_;if(!e){e=this.anchor_;let r=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!r)return null;e=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(e[0]*=r[0]),this.anchorYUnits_=="fraction"&&(e[1]*=r[1])}if(this.anchorOrigin_!="top-left"){if(!r)return null;e===this.anchor_&&(e=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(e[0]=-e[0]+r[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(e[1]=-e[1]+r[1])}this.normalizedAnchor_=e}let i=this.getDisplacement(),n=this.getScaleArray();return[e[0]-i[0]/n[0],e[1]+i[1]/n[1]]}setAnchor(e){this.anchor_=e,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(e){return this.iconImage_.getImage(e)}getPixelRatio(e){return this.iconImage_.getPixelRatio(e)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let e=this.offset_;if(this.offsetOrigin_!="top-left"){let i=this.getSize(),n=this.iconImage_.getSize();if(!i||!n)return null;e=e.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(e[0]=n[0]-i[0]-e[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(e[1]=n[1]-i[1]-e[1])}return this.origin_=e,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){let e=this.getScaleArray();if(this.size_)return this.size_[0]*e[0];if(this.iconImage_.getImageState()==_.LOADED)return this.iconImage_.getSize()[0]*e[0]}getHeight(){let e=this.getScaleArray();if(this.size_)return this.size_[1]*e[1];if(this.iconImage_.getImageState()==_.LOADED)return this.iconImage_.getSize()[1]*e[1]}setScale(e){delete this.initialOptions_,super.setScale(e)}listenImageChange(e){this.iconImage_.addEventListener(E.CHANGE,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(E.CHANGE,e)}},it=ve;var Tt="#333",Ae=class t{constructor(e){e=e||{},this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=D(e.scale!==void 0?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.justify_=e.justify,this.repeat_=e.repeat,this.textBaseline_=e.textBaseline,this.fill_=e.fill!==void 0?e.fill:new v({color:Tt}),this.maxAngle_=e.maxAngle!==void 0?e.maxAngle:Math.PI/4,this.placement_=e.placement!==void 0?e.placement:"point",this.overflow_=!!e.overflow,this.stroke_=e.stroke!==void 0?e.stroke:null,this.offsetX_=e.offsetX!==void 0?e.offsetX:0,this.offsetY_=e.offsetY!==void 0?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=e.padding===void 0?null:e.padding}clone(){let e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,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})}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_}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_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}setOverflow(e){this.overflow_=e}setFont(e){this.font_=e}setMaxAngle(e){this.maxAngle_=e}setOffsetX(e){this.offsetX_=e}setOffsetY(e){this.offsetY_=e}setPlacement(e){this.placement_=e}setRepeat(e){this.repeat_=e}setRotateWithView(e){this.rotateWithView_=e}setFill(e){this.fill_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=D(e!==void 0?e:1)}setStroke(e){this.stroke_=e}setText(e){this.text_=e}setTextAlign(e){this.textAlign_=e}setJustify(e){this.justify_=e}setTextBaseline(e){this.textBaseline_=e}setBackgroundFill(e){this.backgroundFill_=e}setBackgroundStroke(e){this.backgroundStroke_=e}setPadding(e){this.padding_=e}},nt=Ae;export{Pt as a,Nt as b,H as c,Re as d,be as e,Ri as f,Me as g,bi as h,Mi as i,ki as j,ke as k,zi as l,Wi as m,Pi as n,le as o,Ni as p,R as q,ze as r,G as s,E as t,X as u,F as v,Te as w,y as x,N as y,Fe as z,Le as A,di as B,mi as C,_i as D,pi as E,U as F,yi as G,S as H,g as I,Zn as J,$n as K,Qn as L,er as M,tr as N,ir as O,Lt as P,Xe as Q,Ye as R,j as S,Ee as T,nr as U,rr as V,sr as W,or as X,Ot as Y,Dt as Z,ar as _,lr as $,qe as aa,Je as ba,Rt as ca,hr as da,cr as ea,bt as fa,Mt as ga,ur as ha,Ke as ia,je as ja,K as ka,kt as la,Ze as ma,fr as na,dr as oa,gr as pa,zt as qa,mr as ra,T as sa,ei as ta,gt as ua,ti as va,ii as wa,ni as xa,ri as ya,Oe as za,si as Aa,oi as Ba,B as Ca,Ie as Da,an as Ea,ln as Fa,hn as Ga,cn as Ha,w as Ia,Ei as Ja,vi as Ka,Ai as La,wi as Ma,Ci as Na,pn as Oa,ge as Pa,yn as Qa,Sn as Ra,In as Sa,me as Ta,Pe as Ua,Ne as Va,En as Wa,vn as Xa,An as Ya,Ve as Za,C as _a,wn as $a,Cn as ab,Ln as bb,On as cb,Xt as db,Yt as eb,D as fb,_ as gb,se as hb,J as ib,W as jb,v as kb,O as lb,Un as mb,Hn as nb,Gn as ob,He as pb,$e as qb,it as rb,nt as sb,Ft as tb};