PageSourceSearch

https://cloudforest.market/assets/Directory-5b9d709c.js

js cloudforest.market collected 2026-10-04 23:31:54 UTC 92,986 bytes, 4 lines download raw bytes

1import{d as Vt,x as Kt,t as Ii,l as H,Z as ns,Y as Ti,r as os,o as W,A as Rt,w as ct,e as J,W as rs,a as D,Q as Gt,c as U,m as Lt,F as ge,E as _e,b as Ri,_ as Ae,h as Tt,aI as vi,C as as,ab as ls,aJ as hs,p as cs,k as Fi,s as wi,az as ds,i as Li,al as us,af as fs,ak as gs,u as _s}from"./index-91957c83.js";import{T as Me}from"./Tag-ef399404.js";import{R as ps}from"./ResponsiveResult-9786f168.js";import{_ as xs}from"./CfToggle.vue_vue_type_script_setup_true_lang-b6716067.js";import{_ as ms}from"./CfCollapse.vue_vue_type_script_setup_true_lang-e6c25808.js";import{_ as ys,F as Ss}from"./StickyBar.vue_vue_type_script_setup_true_lang-96045d6f.js";import{B as ki,C as Cs,r as Es,a as Is,u as ie,l as se,M as Ts,o as Rs,b as vs,c as Ct,E as bi,d as ee,e as ke,f as Fs,R as ws,i as qt,g as ze,h as Qe,j as Ls,k as xt,m as Q,n as ne,p as oe,q as dt,s as ut,t as re,v as ae,w as le,x as pe,y as ks,z as Ge,A as bs,D as et,F as ht,G as Et,H as Bt,I as he,J as Di,K as Ds,L as Y,N as Os,O as Yt,Z as Ps,P as As,Q as xe,S as Ft,T as be,U as Ms,V as kt,W as Gs,X as ti,Y as Xt,_ as ce,$ as Ws,a0 as De,a1 as de,a2 as Ns,a3 as Bs,a4 as Ys,a5 as Xs,a6 as Oi,a7 as ei,a8 as Pi,a9 as Wt,aa as Vs,ab as jt,ac as zt,ad as Ks,ae as ii,af as Us,ag as $s,ah as Hs,ai as si,aj as Zs,ak as Js,al as qs,am as js,an as zs,ao as Qs,ap as ni,aq as tn,ar as Oe,as as Ai,at as wt,au as en,av as sn,aw as ue,ax as Mi,ay as nn,az as Gi,aA as on,aB as Wi,aC as rn,aD as an,aE as ln,aF as hn,aG as cn,aH as dn,aI as oi,aJ as un,aK as fn,aL as gn,aM as _n,aN as Ni,aO as pn,aP as xn,aQ as mn,aR as ri,aS as ai,aT as yn,aU as Sn,aV as Cn,aW as En,aX as In,aY as li,aZ as hi,a_ as Tn}from"./Lightbox-51fc699d.js";import{A as Rn}from"./Avatar-3fdd9ccd.js";import{_ as vn}from"./Spinner.vue_vue_type_script_setup_true_lang-4959fa20.js";import"./ICaretDown-b918d17c.js";const K={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};class Fn extends ki{constructor(t){super(),this.on,this.once,this.un,this.options=t,this.id=t.id,this.insertFirst=t.insertFirst!==void 0?t.insertFirst:!0,this.stopEvent=t.stopEvent!==void 0?t.stopEvent:!0,this.element=document.createElement("div"),this.element.className=t.className!==void 0?t.className:"ol-overlay-container "+Cs,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.autoPan=t.autoPan===!0?{}:t.autoPan||void 0,this.rendered={transform_:"",visible:!0},this.mapPostrenderListenerKey=null,this.addChangeListener(K.ELEMENT,this.handleElementChanged),this.addChangeListener(K.MAP,this.handleMapChanged),this.addChangeListener(K.OFFSET,this.handleOffsetChanged),this.addChangeListener(K.POSITION,this.handlePositionChanged),this.addChangeListener(K.POSITIONING,this.handlePositioningChanged),t.element!==void 0&&this.setElement(t.element),this.setOffset(t.offset!==void 0?t.offset:[0,0]),this.setPositioning(t.positioning||"top-left"),t.position!==void 0&&this.setPosition(t.position)}getElement(){return this.get(K.ELEMENT)}getId(){return this.id}getMap(){return this.get(K.MAP)||null}getOffset(){return this.get(K.OFFSET)}getPosition(){return this.get(K.POSITION)}getPositioning(){return this.get(K.POSITIONING)}handleElementChanged(){Es(this.element);const t=this.getElement();t&&this.element.appendChild(t)}handleMapChanged(){this.mapPostrenderListenerKey&&(Is(this.element),ie(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const t=this.getMap();if(t){this.mapPostrenderListenerKey=se(t,Ts.POSTRENDER,this.render,this),this.updatePixelPosition();const e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}}render(){this.updatePixelPosition()}handleOffsetChanged(){this.updatePixelPosition()}handlePositionChanged(){this.updatePixelPosition(),this.performAutoPan()}handlePositioningChanged(){this.updatePixelPosition()}setElement(t){this.set(K.ELEMENT,t)}setMap(t){this.set(K.MAP,t)}setOffset(t){this.set(K.OFFSET,t)}setPosition(t){this.set(K.POSITION,t)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(t){const e=this.getMap();
1if(!e||!e.getTargetElement()||!this.get(K.POSITION))return;const i=this.getRect(e.getTargetElement(),e.getSize()),s=this.getElement(),n=this.getRect(s,[Rs(s),vs(s)]);t=t||{};const o=t.margin===void 0?20:t.margin;if(!Ct(i,n)){const r=n[0]-i[0],a=i[2]-n[2],h=n[1]-i[1],l=i[3]-n[3],c=[0,0];if(r<0?c[0]=r-o:a<0&&(c[0]=Math.abs(a)+o),h<0?c[1]=h-o:l<0&&(c[1]=Math.abs(l)+o),c[0]!==0||c[1]!==0){const d=e.getView().getCenterInternal(),u=e.getPixelFromCoordinateInternal(d);if(!u)return;const g=[u[0]+c[0],u[1]+c[1]],_=t.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(g),duration:_.duration,easing:_.easing})}}}getRect(t,e){const i=t.getBoundingClientRect(),s=i.left+window.pageXOffset,n=i.top+window.pageYOffset;return[s,n,s+e[0],n+e[1]]}setPositioning(t){this.set(K.POSITIONING,t)}setVisible(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)}updatePixelPosition(){const t=this.getMap(),e=this.getPosition();if(!t||!t.isRendered()||!e){this.setVisible(!1);return}const i=t.getPixelFromCoordinate(e),s=t.getSize();this.updateRenderedPosition(i,s)}updateRenderedPosition(t,e){const i=this.element.style,s=this.getOffset(),n=this.getPositioning();this.setVisible(!0);const o=Math.round(t[0]+s[0])+"px",r=Math.round(t[1]+s[1])+"px";let a="0%",h="0%";n=="bottom-right"||n=="center-right"||n=="top-right"?a="-100%":(n=="bottom-center"||n=="center-center"||n=="top-center")&&(a="-50%"),n=="bottom-left"||n=="bottom-center"||n=="bottom-right"?h="-100%":(n=="center-left"||n=="center-center"||n=="center-right")&&(h="-50%");const l=`translate(${a}, ${h}) translate(${o}, ${r})`;this.rendered.transform_!=l&&(this.rendered.transform_=l,i.transform=l)}getOptions(){return this.options}}const ci=Fn,wn={key:0,class:"mt-2"},Ln={key:1,class:"mb-0 mt-2"},kn={key:2,class:"mt-2"},bn={class:"d-flex flex-wrap"},Dn=Vt({__name:"Entry",props:{id:{}},setup(f){const t=Kt(),e=Ii(),i=f,s=H(()=>t.getCompany(i.id)||new ns),n=H(()=>s.value.images.length>0?s.value.images[0]:""),o=H(()=>{const a=[];return s.value.categories.forEach(h=>{const l=Ti.find(c=>c.id===h);l&&a.push(l)}),a});function r(){e.push({name:"company",params:{id:i.id}})}return(a,h)=>{const l=os("RouterLink");return W(),Rt(ps,null,{thumbnail:ct(()=>[J(rs,{id:n.value,border:!1,class:"cursor-pointer",alt:"Profile image for "+s.value.displayName,onClick:r},null,8,["id","alt"])]),content:ct(()=>[D("h4",{class:"mb-0 cursor-pointer",onClick:r},Gt(s.value.displayName),1),s.value.profile.length>0?(W(),U("div",wn,Gt(s.value.profile),1)):Lt("",!0),s.value.address.length>0?(W(),U("p",Ln," Location: "+Gt(s.value.address),1)):Lt("",!0),s.value.categories.length>0?(W(),U("div",kn,[D("div",bn,[(W(!0),U(ge,null,_e(o.value,c=>(W(),Rt(Me,{key:c.id,class:"mr-1 mb-1",value:c.name},null,8,["value"]))),128))])])):Lt("",!0)]),"actions-right":ct(()=>[J(l,{to:{name:"company",params:{id:s.value.id}},class:"btn btn-success"},{default:ct(()=>h[0]||(h[0]=[Ri(" View ")])),_:1},8,["to"])]),_:1})}}});const On=Ae(Dn,[["__scopeId","data-v-84070da6"]]),Pn={class:"container-fluid px-0"},An={class:"row"},Mn={class:"col-12"},Gn={class:"title d-flex align-items-center justify-content-between mr-5 mr-lg-0"},Wn={class:"row"},Nn={class:"col-12"},Bn={class:"filter border-bottom border-top mt-2 py-2 px-0 w-100"},Yn={class:"filter-body"},Xn={class:"d-flex flex-wrap"},Vn=Vt({__name:"Filters",setup(f){const t=Kt(),e=Tt(Ti),i=Tt(!0),s=H(()=>vi.clone(t.directoryQuery)),n=H(()=>!t.directoryQuery.isEmpty());function o(){const{event:l}=cs();l("user_click",{user_click_source:"Directory.Filters.ChangeQuery"}),t.setDirectoryQuery(s.value)}function r(){const l=new hs;t.setDirectoryQuery(l)}function a(l){const c=t.directoryQuery.categories.findIndex(d=>d.id===l.id);c===-1?s.value.categories.push(l):s.value.categories.splice(c,1),o()}function h(l){return t.directoryQuery.categories.findIndex(d=>d.id===l.id)!==-1}return(l,c)=>(W(),U("div",Pn,[D("div",An,[D("div",Mn,[D("div",Gn,[c[2]||(c[2]=D("h5",{class:"mb-0"}," Filter By ",-1)),as(D("button",{class:"btn btn-success py-1 ml-2",onClick:r}," Clear filters ",512),[[ls,n.value]])])])]),D("div",Wn,[D("div",Nn,[D("div",Bn,[D("div",{class:"filter-header cursor-pointer py-1",onClick:c[0]||(c[0]=d=>i.value=!i.value)},[J(xs,{open:i.value},null,8,["open"]),c[3]||(c[3]=Ri(" Products and services "))]),J(ms,{modelValue:i.value,"onUpdate:modelValue":c[1]||(c[1]=d=>i.value=d)},{default:ct(()=>[D("div",Yn,[D("div",Xn,[(W(!0),U(ge,null,_e(e.value,d=>(W(),Rt(Me,{key:d.id,value:d.name,selected:h(d),class:"my-pt5 mr-1 cursor-pointer",onClick:u=>a(d)},null,8,["value","selected","onClick"]))),128))])])]),_:1},8,["modelValue"])])])])]))}});const di=Ae(Vn,[["__scopeId","data-v-f87b5e43"]]),Kn={class:"d-flex flex-shrink-1 align-items-center d-lg-none"},Un={class:"d-flex flex-grow-1 justify-content-center"},$n={class:"ml-2 mr-1 text-nowrap"},Hn=Vt({__name:"QueryInfo",setup(f){const t=Kt(),e=Fi(),i=H(()=>t.directoryQuery),s=H(()=>t.directory.length),n=H(()=>t.directory.length===0?"businesses":t.directory.length===1?"business":"businesses"),o=H(()=>!t.directoryQuery.isEmpty()),r=H(()=>vi.clone(t.directoryQuery));function a(){t.setDirectoryQuery(r.value)}function h(){e.setDirectoryFilterOpen(!e.directoryFilterOpen)}function l(c){const d=JSON.parse(JSON.stringify(r.value.categories));d.splice(c,1),r.value.categories=d,a()}return(c,d)=>(W(),Rt(ys,{"has-query":o.value},{row1:ct(()=>[D("div",Kn,[D("span",{class:"toggle-wrapper cursor-pointer border border-success rounded rounded-pill px-2 py-1 d-flex align-items-center d-lg-none mr-md-1",onClick:h},[d[0]||(d[0]=D("span",{class:"mr-1"},"Filter",-1)),J(wi(ds))])]),D("div",Un,[D("span",$n,Gt(s.value)+" "+Gt(n.value),1)])]),row2:ct(()=>[(W(!0),U(ge,null,_e(i.value.categories,(u,g)=>(W(),Rt(Me,{key:"cat-"+u.id,value:u.name,selected:!0,close:!0,class:"mr-1 my-pt5 cursor-pointer",onClick:_=>l(g)},null,8,["value","onClick"]))),128))]),_:1},8,["has-query"]))}});class We extends ki{constructor(t){if(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)if(typeof t.getSimplifiedGeometry=="function"){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new We(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const 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_&&(ie(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=se(t,bi.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?Zn(t):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 Zn(f){if(typeof f=="function")return f;let t;return Array.isArray(f)?t=f:(ee(typeof f.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[f]),function(){return t}}const Pe=We,Ut={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},Qt=[Ut.FILL],mt=[Ut.STROKE],It=[Ut.BEGIN_PATH],ui=[Ut.CLOSE_PATH],T=Ut;class Jn{drawCustom(t,e,i,s,n){}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){}}const Bi=Jn;class qn extends Bi{constructor(t,e,i,s){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=s,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){const e=this.pixelRatio;return e==1?t:t.map(function(i){return i*e})}appendFlatPointCoordinates(t,e){const i=this.getBufferedMaxExtent(),s=this.tmpCoordinate_,n=this.coordinates;let o=n.length;for(let r=0,a=t.length;r<a;r+=e)s[0]=t[r],s[1]=t[r+1],ke(i,s)&&(n[o++]=s[0],n[o++]=s[1]);return o}appendFlatLineCoordinates(t,e,i,s,n,o){const r=this.coordinates;let a=r.length;const h=this.getBufferedMaxExtent();o&&(e+=s);let l=t[e],c=t[e+1];const d=this.tmpCoordinate_;let u=!0,g,_,p;for(g=e+s;g<i;g+=s)d[0]=t[g],d[1]=t[g+1],p=Fs(h,d),p!==_?(u&&(r[a++]=l,r[a++]=c,u=!1),r[a++]=d[0],r[a++]=d[1]):p===ws.INTERSECTING?(r[a++]=d[0],r[a++]=d[1],u=!1):u=!0,l=d[0],c=d[1],_=p;return(n&&u||g===e+s)&&(r[a++]=l,r[a++]=c),a}drawCustomCoordinates_(t,e,i,s,n){for(let o=0,r=i.length;o<r;++o){const a=i[o],h=this.appendFlatLineCoordinates(t,e,a,s,!1,!1);n.push(h),e=a}return e}drawCustom(t,e,i,s,n){this.beginGeometry(t,e,n);const o=t.getType(),r=t.getStride(),a=this.coordinates.length;let h,l,c,d,u;switch(o){case"MultiPolygon":h=t.getOrientedFlatCoordinates(),d=[];const g=t.getEndss();u=0;for(let _=0,p=g.length;_<p;++_){const x=[];u=this.drawCustomCoordinates_(h,u,g[_],r,x),d.push(x)}this.instructions.push([T.CUSTOM,a,d,t,i,Qe,n]),this.hitDetectionInstructions.push([T.CUSTOM,a,d,t,s||i,Qe,n]);break;case"Polygon":case"MultiLineString":c=[],h=o=="Polygon"?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),u=this.drawCustomCoordinates_(h,0,t.getEnds(),r,c),this.instructions.push([T.CUSTOM,a,c,t,i,ze,n]),this.hitDetectionInstructions.push([T.CUSTOM,a,c,t,s||i,ze,n]);break;case"LineString":case"Circle":h=t.getFlatCoordinates(),l=this.appendFlatLineCoordinates(h,0,h.length,r,!1,!1),this.instructions.push([T.CUSTOM,a,l,t,i,qt,n]),this.hitDetectionInstructions.push([T.CUSTOM,a,l,t,s||i,qt,n]);break;case"MultiPoint":h=t.getFlatCoordinates(),l=this.appendFlatPointCoordinates(h,r),l>a&&(this.instructions.push([T.CUSTOM,a,l,t,i,qt,n]),this.hitDetectionInstructions.push([T.CUSTOM,a,l,t,s||i,qt,n]));break;case"Point":h=t.getFlatCoordinates(),this.coordinates.push(h[0],h[1]),l=this.coordinates.length,this.instructions.push([T.CUSTOM,a,l,t,i,void 0,n]),this.hitDetectionInstructions.push([T.CUSTOM,a,l,t,s||i,void 0,n]);break}this.endGeometry(e)}beginGeometry(t,e,i){this.beginGeometryInstruction1_=[T.BEGIN_GEOMETRY,e,0,t,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[T.BEGIN_GEOMETRY,e,0,t,i],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;t.reverse();let e;const i=t.length;let s,n,o=-1;for(e=0;e<i;++e)s=t[e],n=s[0],n==T.END_GEOMETRY?o=e:n==T.BEGIN_GEOMETRY&&(s[2]=e,Ls(this.hitDetectionInstructions,o,e),o=-1)}setFillStrokeStyle(t,e){const i=this.state;if(t){const s=t.getColor();i.fillPatternScale=s&&typeof s=="object"&&"src"in s?this.pixelRatio:1,i.fillStyle=xt(s||Q)}else i.fillStyle=void 0;if(e){const s=e.getColor();i.strokeStyle=xt(s||ne);const n=e.getLineCap();i.lineCap=n!==void 0?n:oe;const o=e.getLineDash();i.lineDash=o?o.slice():dt;const r=e.getLineDashOffset();i.lineDashOffset=r||ut;const a=e.getLineJoin();i.lineJoin=a!==void 0?a:re;const h=e.getWidth();i.lineWidth=h!==void 0?h:ae;const l=e.getMiterLimit();i.miterLimit=l!==void 0?l:le,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0}createFill(t){const e=t.fillStyle,i=[T.SET_FILL_STYLE,e];return typeof e!="string"&&i.push(t.fillPatternScale),i}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[T.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const i=t.fillStyle;
1(typeof i!="string"||t.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)}updateStrokeStyle(t,e){const i=t.strokeStyle,s=t.lineCap,n=t.lineDash,o=t.lineDashOffset,r=t.lineJoin,a=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=s||n!=t.currentLineDash&&!pe(t.currentLineDash,n)||t.currentLineDashOffset!=o||t.currentLineJoin!=r||t.currentLineWidth!=a||t.currentMiterLimit!=h)&&(i!==void 0&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=s,t.currentLineDash=n,t.currentLineDashOffset=o,t.currentLineJoin=r,t.currentLineWidth=a,t.currentMiterLimit=h)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[T.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=ks(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;Ge(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}const $t=qn;class jn extends $t{constructor(t,e,i,s){super(t,e,i,s),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&&!ke(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,e,i);const s=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,r=this.appendFlatPointCoordinates(s,n);this.instructions.push([T.DRAW_IMAGE,o,r,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([T.DRAW_IMAGE,o,r,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);const s=t.getFlatCoordinates(),n=[];for(let a=0,h=s.length;a<h;a+=t.getStride())(!this.maxExtent||ke(this.maxExtent,s.slice(a,a+2)))&&n.push(s[a],s[a+1]);const o=this.coordinates.length,r=this.appendFlatPointCoordinates(n,2);this.instructions.push([T.DRAW_IMAGE,o,r,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([T.DRAW_IMAGE,o,r,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){const i=t.getAnchor(),s=t.getSize(),n=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_=s[1],this.opacity_=t.getOpacity(),this.originX_=n[0],this.originY_=n[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=s[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}const zn=jn;class Qn extends $t{constructor(t,e,i,s){super(t,e,i,s)}drawFlatCoordinates_(t,e,i,s){const n=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,i,s,!1,!1),r=[T.MOVE_TO_LINE_TO,n,o];return this.instructions.push(r),this.hitDetectionInstructions.push(r),i}drawLineString(t,e,i){const s=this.state,n=s.strokeStyle,o=s.lineWidth;if(n===void 0||o===void 0)return;this.updateStrokeStyle(s,this.applyStroke),this.beginGeometry(t,e,i),this.hitDetectionInstructions.push([T.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,dt,ut],It);const r=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(r,0,r.length,a),this.hitDetectionInstructions.push(mt),this.endGeometry(e)}drawMultiLineString(t,e,i){const s=this.state,n=s.strokeStyle,o=s.lineWidth;if(n===void 0||o===void 0)return;this.updateStrokeStyle(s,this.applyStroke),this.beginGeometry(t,e,i),this.hitDetectionInstructions.push([T.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,dt,ut],It);const r=t.getEnds(),a=t.getFlatCoordinates(),h=t.getStride();let l=0;for(let c=0,d=r.length;c<d;++c)l=this.drawFlatCoordinates_(a,l,r[c],h);this.hitDetectionInstructions.push(mt),this.endGeometry(e)}finish(){const t=this.state;return t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&this.instructions.push(mt),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(t){t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(mt),t.lastStroke=this.coordinates.length),t.lastStroke=0,super.applyStroke(t),this.instructions.push(It)}}const to=Qn;class eo extends $t{constructor(t,e,i,s){super(t,e,i,s)}drawFlatCoordinatess_(t,e,i,s){const n=this.state,o=n.fillStyle!==void 0,r=n.strokeStyle!==void 0,a=i.length;this.instructions.push(It),this.hitDetectionInstructions.push(It);for(let h=0;h<a;++h){const l=i[h],c=this.coordinates.length,d=this.appendFlatLineCoordinates(t,e,l,s,!0,!r),u=[T.MOVE_TO_LINE_TO,c,d];this.instructions.push(u),this.hitDetectionInstructions.push(u),r&&(this.instructions.push(u
1i),this.hitDetectionInstructions.push(ui)),e=l}return o&&(this.instructions.push(Qt),this.hitDetectionInstructions.push(Qt)),r&&(this.instructions.push(mt),this.hitDetectionInstructions.push(mt)),e}drawCircle(t,e,i){const s=this.state,n=s.fillStyle,o=s.strokeStyle;if(n===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,i),s.fillStyle!==void 0&&this.hitDetectionInstructions.push([T.SET_FILL_STYLE,Q]),s.strokeStyle!==void 0&&this.hitDetectionInstructions.push([T.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,dt,ut]);const r=t.getFlatCoordinates(),a=t.getStride(),h=this.coordinates.length;this.appendFlatLineCoordinates(r,0,r.length,a,!1,!1);const l=[T.CIRCLE,h];this.instructions.push(It,l),this.hitDetectionInstructions.push(It,l),s.fillStyle!==void 0&&(this.instructions.push(Qt),this.hitDetectionInstructions.push(Qt)),s.strokeStyle!==void 0&&(this.instructions.push(mt),this.hitDetectionInstructions.push(mt)),this.endGeometry(e)}drawPolygon(t,e,i){const s=this.state,n=s.fillStyle,o=s.strokeStyle;if(n===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,i),s.fillStyle!==void 0&&this.hitDetectionInstructions.push([T.SET_FILL_STYLE,Q]),s.strokeStyle!==void 0&&this.hitDetectionInstructions.push([T.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,dt,ut]);const r=t.getEnds(),a=t.getOrientedFlatCoordinates(),h=t.getStride();this.drawFlatCoordinatess_(a,0,r,h),this.endGeometry(e)}drawMultiPolygon(t,e,i){const s=this.state,n=s.fillStyle,o=s.strokeStyle;if(n===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,i),s.fillStyle!==void 0&&this.hitDetectionInstructions.push([T.SET_FILL_STYLE,Q]),s.strokeStyle!==void 0&&this.hitDetectionInstructions.push([T.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,dt,ut]);const r=t.getEndss(),a=t.getOrientedFlatCoordinates(),h=t.getStride();let l=0;for(let c=0,d=r.length;c<d;++c)l=this.drawFlatCoordinatess_(a,l,r[c],h);this.endGeometry(e)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const t=this.tolerance;if(t!==0){const e=this.coordinates;for(let i=0,s=e.length;i<s;++i)e[i]=bs(e[i],t)}return super.finish()}setFillStrokeStyles_(){const t=this.state;t.fillStyle!==void 0&&this.updateFillStyle(t,this.createFill),t.strokeStyle!==void 0&&this.updateStrokeStyle(t,this.applyStroke)}}const fi=eo;function io(f,t,e,i,s){const n=[];let o=e,r=0,a=t.slice(e,2);for(;r<f&&o+s<i;){const[h,l]=a.slice(-2),c=t[o+s],d=t[o+s+1],u=Math.sqrt((c-h)*(c-h)+(d-l)*(d-l));if(r+=u,r>=f){const g=(f-r+u)/u,_=et(h,c,g),p=et(l,d,g);a.push(_,p),n.push(a),a=[_,p],r==f&&(o+=s),r=0}else if(r<f)a.push(t[o+s],t[o+s+1]),o+=s;else{const g=u-r,_=et(h,c,g/u),p=et(l,d,g/u);a.push(_,p),n.push(a),a=[_,p],r=0,o+=s}}return r>0&&n.push(a),n}function so(f,t,e,i,s){let n=e,o=e,r=0,a=0,h=e,l,c,d,u,g,_,p,x,m,y;for(c=e;c<i;c+=s){const C=t[c],E=t[c+1];g!==void 0&&(m=C-g,y=E-_,u=Math.sqrt(m*m+y*y),p!==void 0&&(a+=d,l=Math.acos((p*m+x*y)/(d*u)),l>f&&(a>r&&(r=a,n=h,o=c),a=0,h=c-s)),d=u,p=m,x=y),g=C,_=E}return a+=u,a>r?[h,c]:[n,o]}const fe={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class no extends $t{constructor(t,e,i,s){super(t,e,i,s),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[Q]={fillStyle:Q},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e,i){const s=this.textFillState_,n=this.textStrokeState_,o=this.textState_;if(this.text_===""||!o||!s&&!n)return;const r=this.coordinates;let a=r.length;const h=t.getType();let l=null,c=t.getStride();if(o.placement==="line"&&(h=="LineString"||h=="MultiLineString"||h=="Polygon"||h=="MultiPolygon")){if(!ht(this.maxExtent,t.getExtent()))return;let d;if(l=t.getFlatCoordinates(),h=="LineString")d=[l.length];else if(h=="MultiLineString")d=t.getEnds();else if(h=="Polygon")d=t.getEnds().slice(0,1);else if(h=="MultiPolygon"){const p=t.getEndss();d=[];for(let x=0,m=p.length;x<m;++x)d.push(p[x][0])}this.beginGeometry(t,e,i);const u=o.repeat,g=u?void 0:o.textAlign;let _=0;for(let p=0,x=d.length;p<x;
1++p){let m;u?m=io(u*this.resolution,l,_,d[p],c):m=[l.slice(_,d[p])];for(let y=0,C=m.length;y<C;++y){const E=m[y];let R=0,v=E.length;if(g==null){const w=so(o.maxAngle,E,0,E.length,2);R=w[0],v=w[1]}for(let w=R;w<v;w+=c)r.push(E[w],E[w+1]);const F=r.length;_=d[p],this.drawChars_(a,F),a=F}}this.endGeometry(e)}else{let d=o.overflow?null:[];switch(h){case"Point":case"MultiPoint":l=t.getFlatCoordinates();break;case"LineString":l=t.getFlatMidpoint();break;case"Circle":l=t.getCenter();break;case"MultiLineString":l=t.getFlatMidpoints(),c=2;break;case"Polygon":l=t.getFlatInteriorPoint(),o.overflow||d.push(l[2]/this.resolution),c=3;break;case"MultiPolygon":const m=t.getFlatInteriorPoints();l=[];for(let y=0,C=m.length;y<C;y+=3)o.overflow||d.push(m[y+2]/this.resolution),l.push(m[y],m[y+1]);if(l.length===0)return;c=2;break}const u=this.appendFlatPointCoordinates(l,c);if(u===a)return;if(d&&(u-a)/2!==l.length/c){let m=a/2;d=d.filter((y,C)=>{const E=r[(m+C)*2]===l[C*c]&&r[(m+C)*2+1]===l[C*c+1];return E||--m,E})}this.saveTextStates_(),(o.backgroundFill||o.backgroundStroke)&&(this.setFillStrokeStyle(o.backgroundFill,o.backgroundStroke),o.backgroundFill&&this.updateFillStyle(this.state,this.createFill),o.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e,i);let g=o.padding;if(g!=Et&&(o.scale[0]<0||o.scale[1]<0)){let m=o.padding[0],y=o.padding[1],C=o.padding[2],E=o.padding[3];o.scale[0]<0&&(y=-y,E=-E),o.scale[1]<0&&(m=-m,C=-C),g=[m,y,C,E]}const _=this.pixelRatio;this.instructions.push([T.DRAW_IMAGE,a,u,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,g==Et?Et:g.map(function(m){return m*_}),!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]);const p=1/_,x=this.state.fillStyle;o.backgroundFill&&(this.state.fillStyle=Q,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([T.DRAW_IMAGE,a,u,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[p,p],NaN,this.declutterMode_,this.declutterImageWithText_,g,!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?Q:this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]),o.backgroundFill&&(this.state.fillStyle=x,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,s=this.strokeKey_;t&&(s in this.strokeStates||(this.strokeStates[s]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const n=this.textKey_;n in this.textStates||(this.textStates[n]={font:e.font,textAlign:e.textAlign||Bt,justify:e.justify,textBaseline:e.textBaseline||he,scale:e.scale});const o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))}drawChars_(t,e){const i=this.textStrokeState_,s=this.textState_,n=this.strokeKey_,o=this.textKey_,r=this.fillKey_;this.saveTextStates_();const a=this.pixelRatio,h=fe[s.textBaseline],l=this.textOffsetY_*a,c=this.text_,d=i?i.lineWidth*Math.abs(s.scale[0])/2:0;this.instructions.push([T.DRAW_CHARS,t,e,h,s.overflow,r,s.maxAngle,a,l,n,d*a,c,o,1,this.declutterMode_]),this.hitDetectionInstructions.push([T.DRAW_CHARS,t,e,h,s.overflow,r&&Q,s.maxAngle,a,l,n,d*a,c,o,1/a,this.declutterMode_])}setTextStyle(t,e){let i,s,n;if(!t)this.text_="";else{const o=t.getFill();o?(s=this.textFillState_,s||(s={},this.textFillState_=s),s.fillStyle=xt(o.getColor()||Q)):(s=null,this.textFillState_=s);const r=t.getStroke();if(!r)n=null,this.textStrokeState_=n;else{n=this.textStrokeState_,n||(n={},this.textStrokeState_=n);const g=r.getLineDash(),_=r.getLineDashOffset(),p=r.getWidth(),x=r.getMiterLimit();n.lineCap=r.getLineCap()||oe,n.lineDash=g?g.slice():dt,n.lineDashOffset=_===void 0?ut:_,n.lineJoin=r.getLineJoin()||re,n.lineWidth=p===void 0?ae:p,n.miterLimit=x===void 0?le:x,n.strokeStyle=xt(r.getColor()||ne)}i=this.textState_;const a=t.getFont()||Di;Ds(a);const h=t.getScaleArray();i.overflow=t.getOverflow(),i.font=a,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.repeat=t.getRepeat(),i.justify=t.getJustify(),i.textBaseline=t.getTextBaseline()||he,i.backgroundFill=t.getBackgroun
1dFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||Et,i.scale=h===void 0?[1,1]:h;const l=t.getOffsetX(),c=t.getOffsetY(),d=t.getRotateWithView(),u=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=l===void 0?0:l,this.textOffsetY_=c===void 0?0:c,this.textRotateWithView_=d===void 0?!1:d,this.textRotation_=u===void 0?0:u,this.strokeKey_=n?(typeof n.strokeStyle=="string"?n.strokeStyle:Y(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.repeat||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=s&&s.fillStyle?typeof s.fillStyle=="string"?s.fillStyle:"|"+Y(s.fillStyle):""}this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}const oo={Circle:fi,Default:$t,Image:zn,LineString:to,Polygon:fi,Text:no};class ro{constructor(t,e,i,s){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=s,this.resolution_=i,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const i=this.buildersByZIndex_[e];for(const s in i){const n=i[s].finish();t[e][s]=n}}return t}getBuilder(t,e){const i=t!==void 0?t.toString():"0";let s=this.buildersByZIndex_[i];s===void 0&&(s={},this.buildersByZIndex_[i]=s);let n=s[e];if(n===void 0){const o=oo[e];n=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),s[e]=n}return n}}const ao=ro;function lo(f,t,e,i,s,n,o,r,a,h,l,c){let d=f[t],u=f[t+1],g=0,_=0,p=0,x=0;function m(){g=d,_=u,t+=i,d=f[t],u=f[t+1],x+=p,p=Math.sqrt((d-g)*(d-g)+(u-_)*(u-_))}do m();while(t<e-i&&x+p<n);let y=p===0?0:(n-x)/p;const C=et(g,d,y),E=et(_,u,y),R=t-i,v=x,F=n+r*a(h,s,l);for(;t<e-i&&x+p<F;)m();y=p===0?0:(F-x)/p;const w=et(g,d,y),G=et(_,u,y);let k;if(c){const I=[C,E,w,G];Os(I,0,4,2,c,I,I),k=I[0]>I[2]}else k=C>w;const L=Math.PI,P=[],O=R+i===t;t=R,p=0,x=v,d=f[t],u=f[t+1];let b;if(O){m(),b=Math.atan2(u-_,d-g),k&&(b+=b>0?-L:L);const I=(w+C)/2,X=(G+E)/2;return P[0]=[I,X,(F-n)/2,b,s],P}s=s.replace(/\n/g," ");for(let I=0,X=s.length;I<X;){m();let A=Math.atan2(u-_,d-g);if(k&&(A+=A>0?-L:L),b!==void 0){let S=A-b;if(S+=S>L?-2*L:S<-L?2*L:0,Math.abs(S)>o)return null}b=A;const Z=I;let M=0;for(;I<X;++I){const S=k?X-I-1:I,me=r*a(h,s[S],l);if(t+i<e&&x+p<n+M+me/2)break;M+=me}if(I===Z)continue;const B=k?s.substring(X-Z,X-I):s.substring(Z,I);y=p===0?0:(n+M/2-x)/p;const V=et(g,d,y),ft=et(_,u,y);P.push([V,ft,M/2,A,B]),n+=M}return P}function ho(f,t,e,i){let s=f[t],n=f[t+1],o=0;for(let r=t+i;r<e;r+=i){const a=f[r],h=f[r+1];o+=Math.sqrt((a-s)*(a-s)+(h-n)*(h-n)),s=a,n=h}return o}const vt=Xt(),gt=[],at=[],lt=[],_t=[];function gi(f){return f[3].declutterBox}const _i=new 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 we(f,t){return t==="start"?t=_i.test(f)?"right":"left":t==="end"&&(t=_i.test(f)?"left":"right"),fe[t]}function co(f,t,e){return e>0&&f.push(`
2`,""),f.push(t,""),f}class uo{constructor(t,e,i,s,n){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignAndScaleFill_,this.instructions=s.instructions,this.coordinates=s.coordinates,this.coordinateCache_={},this.renderedTransform_=Yt(),this.hitDetectionInstructions=s.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=s.fillStates||{},this.strokeStates=s.strokeStates||{},this.textStates=s.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=n?new Ps:null}getZIndexContext(){return this.zIndexContext_}createLabel(t,e,i,s){const n=t+e+i+s;if(this.labels_[n])return this.labels_[n];const o=s?this.strokeStates[s]:null,r=i?this.fillStates[i]:null,a=this.textStates[e],h=this.pixelRatio,l=[a.scale[0]*h,a.scale[1]*h],c=Array.isArray(t),d=a.justify?fe[a.justify]:we(Array.isArray(t)?t[0]:t,a.textAlign||Bt),u=s&&o.lineWidth?o.lineWidth:0,g=c?t:t.split(`
3`).reduce(co,[]),{width:_,height:p,widths:x,heights:m,lineWidths:y}=As(a,g),C=_+u,E=[],R=(C+2)*l[0],v=(p+u)*l[1],F={width:R<0?Math.floor(R):Math.ceil(R),height:v<0?Math.floor(v):Math.ceil(v),contextInstructions:E};(l[0]!=1||l[1]!=1)&&E.push("scale",l),s&&(E.push("strokeStyle",o.strokeStyle),E.push("lineWidth",u),E.push("lineCap",o.lineCap),E.push("lineJoin",o.lineJoin),E.push("miterLimit",o.miterLimit),E.push("set
3LineDash",[o.lineDash]),E.push("lineDashOffset",o.lineDashOffset)),i&&E.push("fillStyle",r.fillStyle),E.push("textBaseline","middle"),E.push("textAlign","center");const w=.5-d;let G=d*C+w*u;const k=[],L=[];let P=0,O=0,b=0,I=0,X;for(let A=0,Z=g.length;A<Z;A+=2){const M=g[A];if(M===`
4`){O+=P,P=0,G=d*C+w*u,++I;continue}const B=g[A+1]||a.font;B!==X&&(s&&k.push("font",B),i&&L.push("font",B),X=B),P=Math.max(P,m[b]);const V=[M,G+w*x[b]+d*(x[b]-y[I]),.5*(u+P)+O];G+=x[b],s&&k.push("strokeText",V),i&&L.push("fillText",V),++b}return Array.prototype.push.apply(E,k),Array.prototype.push.apply(E,L),this.labels_[n]=F,F}replayTextBackground_(t,e,i,s,n,o,r){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,s),t.lineTo.apply(t,n),t.lineTo.apply(t,e),o&&(this.alignAndScaleFill_=o[2],this.fill_(t)),r&&(this.setStrokeStyle_(t,r),t.stroke())}calculateImageOrLabelDimensions_(t,e,i,s,n,o,r,a,h,l,c,d,u,g,_,p){r*=d[0],a*=d[1];let x=i-r,m=s-a;const y=n+h>t?t-h:n,C=o+l>e?e-l:o,E=g[3]+y*d[0]+g[1],R=g[0]+C*d[1]+g[2],v=x-g[3],F=m-g[0];(_||c!==0)&&(gt[0]=v,_t[0]=v,gt[1]=F,at[1]=F,at[0]=v+E,lt[0]=at[0],lt[1]=F+R,_t[1]=lt[1]);let w;return c!==0?(w=xe(Yt(),i,s,1,1,c,-i,-s),Ft(w,gt),Ft(w,at),Ft(w,lt),Ft(w,_t),be(Math.min(gt[0],at[0],lt[0],_t[0]),Math.min(gt[1],at[1],lt[1],_t[1]),Math.max(gt[0],at[0],lt[0],_t[0]),Math.max(gt[1],at[1],lt[1],_t[1]),vt)):be(Math.min(v,v+E),Math.min(F,F+R),Math.max(v,v+E),Math.max(F,F+R),vt),u&&(x=Math.round(x),m=Math.round(m)),{drawImageX:x,drawImageY:m,drawImageW:y,drawImageH:C,originX:h,originY:l,declutterBox:{minX:vt[0],minY:vt[1],maxX:vt[2],maxY:vt[3],value:p},canvasTransform:w,scale:d}}replayImageOrLabel_(t,e,i,s,n,o,r){const a=!!(o||r),h=s.declutterBox,l=r?r[2]*s.scale[0]/2:0;return h.minX-l<=e[0]&&h.maxX+l>=0&&h.minY-l<=e[1]&&h.maxY+l>=0&&(a&&this.replayTextBackground_(t,gt,at,lt,_t,o,r),Ms(t,s.canvasTransform,n,i,s.originX,s.originY,s.drawImageW,s.drawImageH,s.drawImageX,s.drawImageY,s.scale)),!0}fill_(t){const e=this.alignAndScaleFill_;if(e){const i=Ft(this.renderedTransform_,[0,0]),s=512*this.pixelRatio;t.save(),t.translate(i[0]%s,i[1]%s),e!==1&&t.scale(e,e),t.rotate(this.viewRotation_)}t.fill(),e&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=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,s){const n=this.textStates[e],o=this.createLabel(t,e,s,i),r=this.strokeStates[i],a=this.pixelRatio,h=we(Array.isArray(t)?t[0]:t,n.textAlign||Bt),l=fe[n.textBaseline||he],c=r&&r.lineWidth?r.lineWidth:0,d=o.width/a-2*n.scale[0],u=h*d+2*(.5-h)*c,g=l*o.height/a+2*(.5-l)*c;return{label:o,anchorX:u,anchorY:g}}execute_(t,e,i,s,n,o,r,a){const h=this.zIndexContext_;let l;this.pixelCoordinates_&&pe(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=kt(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),Gs(this.renderedTransform_,i));let c=0;const d=s.length;let u=0,g,_,p,x,m,y,C,E,R,v,F,w,G,k=0,L=0,P=null,O=null;const b=this.coordinateCache_,I=this.viewRotation_,X=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,A={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:I},Z=this.instructions!=s||this.overlaps?0:200;let M,B,V,ft;for(;c<d;){const S=s[c];switch(S[0]){case T.BEGIN_GEOMETRY:M=S[1],ft=S[3],M.getGeometry()?r!==void 0&&!ht(r,ft.getExtent())?c=S[2]+1:++c:c=S[2],h&&(h.zIndex=S[4]);break;case T.BEGIN_PATH:k>Z&&(this.fill_(t),k=0),L>Z&&(t.stroke(),L=0),!k&&!L&&(t.beginPath(),m=NaN,y=NaN),++c;break;case T.CIRCLE:u=S[1];const ye=l[u],Se=l[u+1],$i=l[u+2],Hi=l[u+3],Be=$i-ye,Ye=Hi-Se,Xe=Math.sqrt(Be*Be+Ye*Ye);t.moveTo(ye+Xe,Se),t.arc(ye,Se,Xe,0,2*Math.PI,!0),++c;break;case T.CLOSE_PATH:t.closePath(),++c;break;case T.CUSTOM:u=S[1],g=S[2];const Zi=S[3],Ji=S[4],Ve=S[5];A.geometry=Zi,A.feature=M,c in b||(b[c]=[]);const Dt=b[c];Ve?Ve(l,u,g,2,Dt):(Dt[0]=l[u],Dt[1]=l[u+1],Dt.length=2),h&&(h.zIndex=S[6]),Ji(Dt,A),++c;break;case T.DRAW_IMAGE:u=S[1],g=S[2],R=S[3],_=S[4],p=S[5];let Ce=S[6];const qi=S[7],ji=S[8],zi=S[9],Ke=S[10];let Ee=S[11];const Qi=S[12];let Ht=S[13];x=S[14]||"declutter";const Ot=S[15];if(!R&&S.length>=20){v=S[19],F=S[20],w=S[21],G=S[22];const q=this.drawLabelWithPointPlacement_(v,F,w,G);R=q.label,S[3]=R;const yt=S[23];_=(q.anchorX-yt)*this.pixelRatio,S[4]=_;const j=S[24];p=(q.anchorY-j)*this.pixelRatio,S[5]=p,Ce=R.height,S[6]=Ce,Ht=R.width,S[13]=Ht}let Ie;S.length>25&&(Ie=S[25]);let Te,Zt,Jt;S.length>17?(Te=S[16],Zt=S[17],Jt=S[18]):(Te=Et,Zt=!1,Jt=!1),Ke&&X?Ee+=I:!Ke&&!X&&(Ee-=I);let ts=0;for(;u<g;u+=2){if(Ie&&Ie[ts++]<Ht/this.pixelRatio)continue;const q=this.calculateImageOrLabelDimensions_(R.width,R.height,l[u],l[u+1],Ht,Ce,_,p,ji,zi,Ee,Qi,n,Te,Zt||Jt,M),yt=[t,e,R,q,qi,Zt?P:null,Jt?O:null];if(a){let j,it,z;if(Ot){const N=g-u;if(!Ot[N]){Ot[N]={args:yt,declutterMode:x};continue}const $=Ot[N];j=$.args,it=$.declutterMode,delete Ot[N],z=gi(j)}let nt,ot;if(j&&(it!=="declutter"||!a.collides(z))&&(nt=!0),(x!=="declutter"||!a.collides(q.declutterBox))&&(ot=!0),it==="declutter"&&x==="declutter"){const N=nt&&ot;nt=N,ot=N}nt&&(it!=="none"&&a.insert(z),this.replayImageOrLabel_.apply(this,j)),ot&&(x!=="none"&&a.insert(q.declutterBox),this.replayImageOrLabel_.apply(this,yt))}else this.replayImageOrLabel_.apply(this,yt)}++c;break;case T.DRAW_CHARS:const Ue=S[1],$e=S[2],Re=S[3],es=S[4];G=S[5];const is=S[6],He=S[7],Ze=S[8];w=S[9];const ve=S[10];v=S[11],F=S[12];const Je=[S[13],S[13]];x=S[14]||"declutter";const Fe=this.textStates[F],Pt=Fe.font,At=[Fe.scale[0]*He,Fe.scale[1]*He];let Mt;Pt in this.widths_?Mt=this.widths_[Pt]:(Mt={},this.widths_[Pt]=Mt);const qe=ho(l,Ue,$e,2),je=Math.abs(At[0])*ti(Pt,v,Mt);if(es||je<=qe){const q=this.textStates[F].textAlign,yt=(qe-je)*we(v,q),j=lo(l,Ue,$e,2,v,yt,is,Math.abs(At[0]),ti,Pt,Mt,X?0:this.viewRotation_);t:if(j){const it=[];let z,nt,ot,N,$;if(w)for(z=0,nt=j.length;z<nt;++z){$=j[z],ot=$[4],N=this.createLabel(ot,F,"",w),_=$[2]+(At[0]<0?-ve:ve),p=Re*N.height+(.5-Re)*2*ve*At[1]/At[0]-Ze;const rt=this.calculateImageOrLabelDimensions_(N.width,N.height,$[0],$[1],N.width,N.height,_,p,0,0,$[3],Je,!1,Et,!1,M);if(a&&x==="declutter"&&a.collides(rt.declutterBox))break t;it.push([t,e,N,rt,1,null,null])}if(G)for(z=0,nt=j.length;z<nt;++z){$=j[z],ot=$[4],N=this.createLabel(ot,F,G,""),_=$[2],p=Re*N.height-Ze;const rt=this.calculateImageOrLabelDimensions_(N.width,N.height,$[0],$[1],N.width,N.height,_,p,0,0,$[3],Je,!1,Et,!1,M);if(a&&x==="declutter"&&a.collides(rt.declutterBox))break t;it.push([t,e,N,rt,1,null,null])}a&&x!=="none"&&a.load(it.map(gi));for(let rt=0,ss=it.length;rt<ss;++rt)this.replayImageOrLabel_.apply(this,it[rt])}}++c;break;case T.END_GEOMETRY:if(o!==void 0){M=S[1];const q=o(M,ft);if(q)return q}++c;break;case T.FILL:Z?k++:this.fill_(t),++c;break;case T.MOVE_TO_LINE_TO:for(u=S[1],g=S[2],B=l[u],V=l[u+1],C=B+.5|0,E=V+.5|0,(C!==m||E!==y)&&(t.moveTo(B,V),m=C,y=E),u+=2;u<g;u+=2)B=l[u],V=l[u+1],C=B+.5|0,E=V+.5|0,(u==g-2||C!==m||E!==y)&&(t.lineTo(B,V),m=C,y=E);++c;break;case T.SET_FILL_STYLE:P=S,this.alignAndScaleFill_=S[2],k&&(this.fill_(t),k=0,L&&(t.stroke(),L=0)),t.fillStyle=S[1],++c;break;case T.SET_STROKE_STYLE:O=S,L&&(t.stroke(),L=0),this.setStrokeStyle_(t,S),++c;break;case T.STROKE:Z?L++:t.stroke(),++c;break;default:++c;break}}k&&this.fill_(t),L&&t.stroke()}execute(t,e,i,s,n,o){this.viewRotation_=s,this.execute_(t,e,i,this.instructions,n,void 0,void 0,o)}
4executeHitDetection(t,e,i,s,n){return this.viewRotation_=i,this.execute_(t,[t.canvas.width,t.canvas.height],e,this.hitDetectionInstructions,!0,s,n)}}const fo=uo,Nt=["Polygon","Circle","LineString","Image","Text","Default"],Yi=["Image","Text"],go=Nt.filter(f=>!Yi.includes(f));class _o{constructor(t,e,i,s,n,o,r){this.maxExtent_=t,this.overlaps_=s,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Yt(),this.renderedContext_=null,this.deferredZIndexContexts_=[],this.createExecutors_(n,r)}clip(t,e){const 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(const i in t){let s=this.executorsByZIndex_[i];s===void 0&&(s={},this.executorsByZIndex_[i]=s);const n=t[i];for(const o in n){const r=n[o];s[o]=new fo(this.resolution_,this.pixelRatio_,this.overlaps_,r,e)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const i=this.executorsByZIndex_[e];for(let s=0,n=t.length;s<n;++s)if(t[s]in i)return!0}return!1}forEachFeatureAtCoordinate(t,e,i,s,n,o){s=Math.round(s);const r=s*2+1,a=xe(this.hitDetectionTransform_,s+.5,s+.5,1/e,-1/e,-i,-t[0],-t[1]),h=!this.hitDetectionContext_;h&&(this.hitDetectionContext_=ce(r,r,void 0,{willReadFrequently:!0}));const l=this.hitDetectionContext_;l.canvas.width!==r||l.canvas.height!==r?(l.canvas.width=r,l.canvas.height=r):h||l.clearRect(0,0,r,r);let c;this.renderBuffer_!==void 0&&(c=Xt(),Ws(c,t),Ge(c,e*(this.renderBuffer_+s),c));const d=po(s);let u;function g(E,R){const v=l.getImageData(0,0,r,r).data;for(let F=0,w=d.length;F<w;F++)if(v[d[F]]>0){if(!o||u!=="Image"&&u!=="Text"||o.includes(E)){const G=(d[F]-3)/4,k=s-G%r,L=s-(G/r|0),P=n(E,R,k*k+L*L);if(P)return P}l.clearRect(0,0,r,r);break}}const _=Object.keys(this.executorsByZIndex_).map(Number);_.sort(De);let p,x,m,y,C;for(p=_.length-1;p>=0;--p){const E=_[p].toString();for(m=this.executorsByZIndex_[E],x=Nt.length-1;x>=0;--x)if(u=Nt[x],y=m[u],y!==void 0&&(C=y.executeHitDetection(l,a,i,g,c),C))return C}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const i=e[0],s=e[1],n=e[2],o=e[3],r=[i,s,i,o,n,o,n,s];return kt(r,0,8,2,t,r),r}isEmpty(){return de(this.executorsByZIndex_)}execute(t,e,i,s,n,o,r){const a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(De),o=o||Nt;let h,l,c,d,u,g;for(r&&a.reverse(),h=0,l=a.length;h<l;++h){const _=a[h].toString();for(u=this.executorsByZIndex_[_],c=0,d=o.length;c<d;++c){const p=o[c];if(g=u[p],g!==void 0){const x=r===null?void 0:g.getZIndexContext(),m=x?x.getContext():t,y=this.maxExtent_&&p!=="Image"&&p!=="Text";if(y&&(m.save(),this.clip(m,i)),g.execute(m,e,i,s,n,r),y&&m.restore(),x){x.offset();const C=a[h];this.deferredZIndexContexts_[C]||(this.deferredZIndexContexts_[C]=[]),this.deferredZIndexContexts_[C].push(x)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){this.deferredZIndexContexts_.forEach(t=>{t.forEach(e=>{e.draw(this.renderedContext_),e.clear()})})}}const Le={};function po(f){if(Le[f]!==void 0)return Le[f];const t=f*2+1,e=f*f,i=new Array(e+1);for(let n=0;n<=f;++n)for(let o=0;o<=f;++o){const r=n*n+o*o;if(r>e)break;let a=i[r];a||(a=[],i[r]=a),a.push(((f+n)*t+(f+o))*4+3),n>0&&a.push(((f-n)*t+(f+o))*4+3),o>0&&(a.push(((f+n)*t+(f-o))*4+3),n>0&&a.push(((f-n)*t+(f-o))*4+3))}const s=[];for(let n=0,o=i.length;n<o;++n)i[n]&&s.push(...i[n]);return Le[f]=s,s}const xo=_o;class mo extends Bi{constructor(t,e,i,s,n,o,r){super(),this.context_=t,this.pixelRatio_=e,this.extent_=i,this.transform_=s,this.transformRotation_=s?Ns(Math.atan2(s[1],s[0]),10):0,this.viewRotation_=n,this.squaredTolerance_=o,this.userTransform_=r,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_=Yt()}drawImages_(t,e,i,s){if(!this.image_)return;const n=kt(t,e,i,s,this.transform_,this.pixelCoordinates_),o=this.context_,r=this.tmpLocalTransform_,a=o.globalAlpha;this.imageOpacity_!=1&&(o.globalAlpha=a*this.imageOpacity_);let h=this.imageRotation_;this.transformRotation_===0&&(h-=this.viewRotation_),this.imageRotateWithView_&&(h+=this.viewRotation_);for(let l=0,c=n.length;l<c;l+=2){const d=n[l]-this.imageAnchorX_,u=n[l+1]-this.imageAnchorY_;if(h!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){const g=d+this.imageAnchorX_,_=u+this.imageAnchorY_;xe(r,g,_,1,1,h,-g,-_),o.save(),o.transform.apply(o,r),o.translate(g,_),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.restore(
4)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,d,u,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(o.globalAlpha=a)}drawText_(t,e,i,s){if(!this.textState_||this.text_==="")return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const n=kt(t,e,i,s,this.transform_,this.pixelCoordinates_),o=this.context_;let r=this.textRotation_;for(this.transformRotation_===0&&(r-=this.viewRotation_),this.textRotateWithView_&&(r+=this.viewRotation_);e<i;e+=s){const a=n[e]+this.textOffsetX_,h=n[e+1]+this.textOffsetY_;r!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(o.save(),o.translate(a-this.textOffsetX_,h-this.textOffsetY_),o.rotate(r),o.translate(this.textOffsetX_,this.textOffsetY_),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.restore()):(this.textStrokeState_&&o.strokeText(this.text_,a,h),this.textFillState_&&o.fillText(this.text_,a,h))}}moveToLineTo_(t,e,i,s,n){const o=this.context_,r=kt(t,e,i,s,this.transform_,this.pixelCoordinates_);o.moveTo(r[0],r[1]);let a=r.length;n&&(a-=2);for(let h=2;h<a;h+=2)o.lineTo(r[h],r[h+1]);return n&&o.closePath(),i}drawRings_(t,e,i,s){for(let n=0,o=i.length;n<o;++n)e=this.moveToLineTo_(t,e,i[n],s,!0);return e}drawCircle(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!ht(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=Bs(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],s=e[3]-e[1],n=Math.sqrt(i*i+s*s),o=this.context_;o.beginPath(),o.arc(e[0],e[1],n,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.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);break}}drawFeature(t,e){const i=e.getGeometryFunction()(t);i&&(this.setStyle(e),this.drawGeometry(i))}drawGeometryCollection(t){const e=t.getGeometriesArray();for(let i=0,s=e.length;i<s;++i)this.drawGeometry(e[i])}drawPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const 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_));const 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_)),!!ht(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(this.text_!==""){const e=t.getFlatMidpoint();this.drawText_(e,0,2,2)}}}drawMultiLineString(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getExtent();if(ht(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const i=this.context_,s=t.getFlatCoordinates();let n=0;const o=t.getEnds(),r=t.getStride();i.beginPath();for(let a=0,h=o.length;a<h;++a)n=this.moveToLineTo_(s,n,o[a],r,!1);i.stroke()}if(this.text_!==""){const i=t.getFlatMidpoints();this.drawText_(i,0,i.length,2)}}}drawPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!ht(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const 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_!==""){const e=t.getFlatInteriorPoint();this.drawText_(e,0,2,2)}}}drawMultiPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!ht(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_,i=t.getOrientedFlatCoordinates();let s=0;const n=t.getEndss(),o=t.getStride();e.beginPath();for(let r=0,a=n.length;r<a;++r){const h=n[r];s=this.drawRings_(i,s,h,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(this.text_!==""){const e=t.getFlatInteriorPoints();this.drawText_(e,0,e.length,2)}}}setContextFillState_(t){const 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){const e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),pe(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){const e=this.context_,i=this.contextTextState_,s=t.textAlign?t.textAlign:Bt;i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=s&&(i.textAlign=s,e.textAlign=s),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=s,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:s,textBaseline:t.textBaseline})}setFillStrokeStyle(t,e){if(!t)this.fillState_=null;else{const i=t.getColor();this.fillState_={fillStyle:xt(i||Q)}}if(!e)this.strokeState_=null;else{const i=e.getColor(),s=e.getLineCap(),n=e.getLineDash(),o=e.getLineDashOffset(),r=e.getLineJoin(),a=e.getWidth(),h=e.getMiterLimit(),l=n||dt;this.strokeState_={lineCap:s!==void 0?s:oe,lineDash:this.pixelRatio_===1?l:l.map(c=>c*this.pixelRatio_),lineDashOffset:(o||ut)*this.pixelRatio_,lineJoin:r!==void 0?r:re,lineWidth:(a!==void 0?a:ae)*this.pixelRatio_,miter
4Limit:h!==void 0?h:le,strokeStyle:xt(i||ne)}}}setImageStyle(t){let e;if(!t||!(e=t.getSize())){this.image_=null;return}const i=t.getPixelRatio(this.pixelRatio_),s=t.getAnchor(),n=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=s[0]*i,this.imageAnchorY_=s[1]*i,this.imageHeight_=e[1]*i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=n[0],this.imageOriginY_=n[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const o=t.getScaleArray();this.imageScale_=[o[0]*this.pixelRatio_/i,o[1]*this.pixelRatio_/i],this.imageWidth_=e[0]*i}setTextStyle(t){if(!t)this.text_="";else{const e=t.getFill();if(!e)this.textFillState_=null;else{const u=e.getColor();this.textFillState_={fillStyle:xt(u||Q)}}const i=t.getStroke();if(!i)this.textStrokeState_=null;else{const u=i.getColor(),g=i.getLineCap(),_=i.getLineDash(),p=i.getLineDashOffset(),x=i.getLineJoin(),m=i.getWidth(),y=i.getMiterLimit();this.textStrokeState_={lineCap:g!==void 0?g:oe,lineDash:_||dt,lineDashOffset:p||ut,lineJoin:x!==void 0?x:re,lineWidth:m!==void 0?m:ae,miterLimit:y!==void 0?y:le,strokeStyle:xt(u||ne)}}const s=t.getFont(),n=t.getOffsetX(),o=t.getOffsetY(),r=t.getRotateWithView(),a=t.getRotation(),h=t.getScaleArray(),l=t.getText(),c=t.getTextAlign(),d=t.getTextBaseline();this.textState_={font:s!==void 0?s:Di,textAlign:c!==void 0?c:Bt,textBaseline:d!==void 0?d:he},this.text_=l!==void 0?Array.isArray(l)?l.reduce((u,g,_)=>u+=_%2?" ":g,""):l:"",this.textOffsetX_=n!==void 0?this.pixelRatio_*n:0,this.textOffsetY_=o!==void 0?this.pixelRatio_*o:0,this.textRotateWithView_=r!==void 0?r:!1,this.textRotation_=a!==void 0?a:0,this.textScale_=[this.pixelRatio_*h[0],this.pixelRatio_*h[1]]}}}const yo=mo,st=.5;function So(f,t,e,i,s,n,o,r,a){const h=a?Pi(s):s,l=f[0]*st,c=f[1]*st,d=ce(l,c);d.imageSmoothingEnabled=!1;const u=d.canvas,g=new yo(d,st,s,null,o,r,a?Ys(Xs(),a):null),_=e.length,p=Math.floor((256*256*256-1)/_),x={};for(let y=1;y<=_;++y){const C=e[y-1],E=C.getStyleFunction()||i;if(!E)continue;let R=E(C,n);if(!R)continue;Array.isArray(R)||(R=[R]);const F=(y*p).toString(16).padStart(7,"#00000");for(let w=0,G=R.length;w<G;++w){const k=R[w],L=k.getGeometryFunction()(C);if(!L||!ht(h,L.getExtent()))continue;const P=k.clone(),O=P.getFill();O&&O.setColor(F);const b=P.getStroke();b&&(b.setColor(F),b.setLineDash(null)),P.setText(void 0);const I=k.getImage();if(I){const M=I.getImageSize();if(!M)continue;const B=ce(M[0],M[1],void 0,{alpha:!1}),V=B.canvas;B.fillStyle=F,B.fillRect(0,0,V.width,V.height),P.setImage(new Oi({img:V,anchor:I.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:I.getOrigin(),opacity:1,size:I.getSize(),scale:I.getScale(),rotation:I.getRotation(),rotateWithView:I.getRotateWithView()}))}const X=P.getZIndex()||0;let A=x[X];A||(A={},x[X]=A,A.Polygon=[],A.Circle=[],A.LineString=[],A.Point=[]);const Z=L.getType();if(Z==="GeometryCollection"){const M=L.getGeometriesArrayRecursive();for(let B=0,V=M.length;B<V;++B){const ft=M[B];A[ft.getType().replace("Multi","")].push(ft,P)}}else A[Z.replace("Multi","")].push(L,P)}}const m=Object.keys(x).map(Number).sort(De);for(let y=0,C=m.length;y<C;++y){const E=x[m[y]];for(const R in E){const v=E[R];for(let F=0,w=v.length;F<w;F+=2){g.setStyle(v[F+1]);for(let G=0,k=t.length;G<k;++G)g.setTransform(t[G]),g.drawGeometry(v[F])}}}return d.getImageData(0,0,u.width,u.height)}function Co(f,t,e){const i=[];if(e){const s=Math.floor(Math.round(f[0])*st),n=Math.floor(Math.round(f[1])*st),o=(ei(s,0,e.width-1)+ei(n,0,e.height-1)*e.width)*4,r=e.data[o],a=e.data[o+1],l=e.data[o+2]+256*(a+256*r),c=Math.floor((256*256*256-1)/t.length);l&&l%c===0&&i.push(t[l/c-1])}return i}const Eo=.5,Xi={Point:ko,LineString:Fo,Polygon:Do,MultiPoint:bo,MultiLineString:wo,MultiPolygon:Lo,GeometryCollection:vo,Circle:To};function Io(f,t){return parseInt(Y(f),10)-parseInt(Y(t),10)}function pi(f,t){const e=Vi(f,t);return e*e}function Vi(f,t){return Eo*f/t}function To(f,t,e,i){const s=e.getFill(),n=e.getStroke();if(s||n){const r=f.getBuilder(e.getZIndex(),"Circle");r.setFillStrokeStyle(s,n),r.drawCircle(t,i)}const o=e.getText();if(o&&o.getText()){const r=f.getBuilder(e.getZIndex(),"Text");r.setTextStyle(o),r.drawText(t,i)}}function xi(f,t,e,i,s,n,o,r){const a=[],h=e.getImage();if(h){let d=!0;const u=h.getImageState();u==Wt.LOADED||u==Wt.ERROR?d=!1:u==Wt.IDLE&&h.load(),d&&a.push(h.ready())}
4const l=e.getFill();l&&l.loading()&&a.push(l.ready());const c=a.length>0;return c&&Promise.all(a).then(()=>s(null)),Ro(f,t,e,i,n,o,r),c}function Ro(f,t,e,i,s,n,o){const r=e.getGeometryFunction()(t);if(!r)return;const a=r.simplifyTransformed(i,s);if(e.getRenderer())Ki(f,a,e,t,o);else{const l=Xi[a.getType()];l(f,a,e,t,o,n)}}function Ki(f,t,e,i,s){if(t.getType()=="GeometryCollection"){const o=t.getGeometries();for(let r=0,a=o.length;r<a;++r)Ki(f,o[r],e,i,s);return}f.getBuilder(e.getZIndex(),"Default").drawCustom(t,i,e.getRenderer(),e.getHitDetectionRenderer(),s)}function vo(f,t,e,i,s,n){const o=t.getGeometriesArray();let r,a;for(r=0,a=o.length;r<a;++r){const h=Xi[o[r].getType()];h(f,o[r],e,i,s,n)}}function Fo(f,t,e,i,s){const n=e.getStroke();if(n){const r=f.getBuilder(e.getZIndex(),"LineString");r.setFillStrokeStyle(null,n),r.drawLineString(t,i,s)}const o=e.getText();if(o&&o.getText()){const r=f.getBuilder(e.getZIndex(),"Text");r.setTextStyle(o),r.drawText(t,i,s)}}function wo(f,t,e,i,s){const n=e.getStroke();if(n){const r=f.getBuilder(e.getZIndex(),"LineString");r.setFillStrokeStyle(null,n),r.drawMultiLineString(t,i,s)}const o=e.getText();if(o&&o.getText()){const r=f.getBuilder(e.getZIndex(),"Text");r.setTextStyle(o),r.drawText(t,i,s)}}function Lo(f,t,e,i,s){const n=e.getFill(),o=e.getStroke();if(o||n){const a=f.getBuilder(e.getZIndex(),"Polygon");a.setFillStrokeStyle(n,o),a.drawMultiPolygon(t,i,s)}const r=e.getText();if(r&&r.getText()){const a=f.getBuilder(e.getZIndex(),"Text");a.setTextStyle(r),a.drawText(t,i,s)}}function ko(f,t,e,i,s,n){const o=e.getImage(),r=e.getText(),a=r&&r.getText(),h=n&&o&&a?{}:void 0;if(o){if(o.getImageState()!=Wt.LOADED)return;const l=f.getBuilder(e.getZIndex(),"Image");l.setImageStyle(o,h),l.drawPoint(t,i,s)}if(a){const l=f.getBuilder(e.getZIndex(),"Text");l.setTextStyle(r,h),l.drawText(t,i,s)}}function bo(f,t,e,i,s,n){const o=e.getImage(),r=o&&o.getOpacity()!==0,a=e.getText(),h=a&&a.getText(),l=n&&r&&h?{}:void 0;if(r){if(o.getImageState()!=Wt.LOADED)return;const c=f.getBuilder(e.getZIndex(),"Image");c.setImageStyle(o,l),c.drawMultiPoint(t,i,s)}if(h){const c=f.getBuilder(e.getZIndex(),"Text");c.setTextStyle(a,l),c.drawText(t,i,s)}}function Do(f,t,e,i,s){const n=e.getFill(),o=e.getStroke();if(n||o){const a=f.getBuilder(e.getZIndex(),"Polygon");a.setFillStrokeStyle(n,o),a.drawPolygon(t,i,s)}const r=e.getText();if(r&&r.getText()){const a=f.getBuilder(e.getZIndex(),"Text");a.setTextStyle(r),a.drawText(t,i,s)}}class Oo extends Vs{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=Xt(),this.wrappedRenderedExtent_=Xt(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedPixelRatio_=1,this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.clipping=!0,this.compositionContext_=null,this.opacity_=1}renderWorlds(t,e,i){const s=e.extent,n=e.viewState,o=n.center,r=n.resolution,a=n.projection,h=n.rotation,l=a.getExtent(),c=this.getLayer().getSource(),d=this.getLayer().getDeclutter(),u=e.pixelRatio,g=e.viewHints,_=!(g[jt.ANIMATING]||g[jt.INTERACTING]),p=this.compositionContext_,x=Math.round(e.size[0]*u),m=Math.round(e.size[1]*u),y=c.getWrapX()&&a.canWrapX(),C=y?zt(l):null,E=y?Math.ceil((s[2]-l[2])/C)+1:1;let R=y?Math.floor((s[0]-l[0])/C):0;do{const v=this.getRenderTransform(o,r,h,u,x,m,R*C);t.execute(p,[p.canvas.width,p.canvas.height],v,h,_,i===void 0?Nt:i?Yi:go,i?d&&e.declutter[d]:void 0)}while(++R<E)}setupCompositionContext_(){if(this.opacity_!==1){const t=ce(this.context.canvas.width,this.context.canvas.height,ii);this.compositionContext_=t}else this.compositionContext_=this.context}releaseCompositionContext_(){if(this.opacity_!==1){const t=this.context.globalAlpha;this.context.globalAlpha=this.opacity_,this.context.drawImage(this.compositionContext_.canvas,0,0),this.context.globalAlpha=t,Ks(this.compositionContext_),ii.push(this.compositionContext_.canvas),this.compositionContext_=null}}renderDeclutter(t){this.getLayer().getDeclutter()&&(this.setupCompositionContext_(),this.renderWorlds(this.replayGroup_,t,!0),this.releaseCompositionContext_())}renderDeferredInternal(t){this.replayGroup_.renderDeferred()}renderFrame(t,e){const i=t.pixelRatio,s=t.layerStatesArray[t.layerIndex];Us(this.pixelTransform,1/i,1/i),$s(this.inversePixelTransform,this.pixelTransform);const n=Hs(this.pixelTransform);
4this.useContainer(e,n,this.getBackground(t));const o=this.context,r=o.canvas,a=this.replayGroup_;let h=a&&!a.isEmpty();if(!h&&!(this.getLayer().hasListener(si.PRERENDER)||this.getLayer().hasListener(si.POSTRENDER)))return null;const l=Math.round(t.size[0]*i),c=Math.round(t.size[1]*i);r.width!=l||r.height!=c?(r.width=l,r.height=c,r.style.transform!==n&&(r.style.transform=n)):this.containerReused||o.clearRect(0,0,l,c),this.preRender(o,t);const d=t.viewState;d.projection,this.opacity_=s.opacity,this.setupCompositionContext_();let u=!1;if(h&&s.extent&&this.clipping){const g=Zs(s.extent);h=ht(g,t.extent),u=h&&!Ct(g,t.extent),u&&this.clipUnrotated(this.compositionContext_,t,g)}return h&&this.renderWorlds(a,t,this.getLayer().getDeclutter()?!1:void 0),u&&this.compositionContext_.restore(),this.releaseCompositionContext_(),this.postRender(o,t),this.renderedRotation_!==d.rotation&&(this.renderedRotation_=d.rotation,this.hitDetectionImageData_=null),this.container}getFeatures(t){return new Promise(e=>{if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const i=[this.context.canvas.width,this.context.canvas.height];Ft(this.pixelTransform,i);const s=this.renderedCenter_,n=this.renderedResolution_,o=this.renderedRotation_,r=this.renderedProjection_,a=this.wrappedRenderedExtent_,h=this.getLayer(),l=[],c=i[0]*st,d=i[1]*st;l.push(this.getRenderTransform(s,n,o,st,c,d,0).slice());const u=h.getSource(),g=r.getExtent();if(u.getWrapX()&&r.canWrapX()&&!Ct(g,a)){let _=a[0];const p=zt(g);let x=0,m;for(;_<g[0];)--x,m=p*x,l.push(this.getRenderTransform(s,n,o,st,c,d,m).slice()),_+=p;for(x=0,_=a[2];_>g[2];)++x,m=p*x,l.push(this.getRenderTransform(s,n,o,st,c,d,m).slice()),_-=p}this.hitDetectionImageData_=So(i,l,this.renderedFeatures_,h.getStyleFunction(),a,n,o,pi(n,this.renderedPixelRatio_),null)}e(Co(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,i,s,n){if(!this.replayGroup_)return;const o=e.viewState.resolution,r=e.viewState.rotation,a=this.getLayer(),h={},l=function(g,_,p){const x=Y(g),m=h[x];if(m){if(m!==!0&&p<m.distanceSq){if(p===0)return h[x]=!0,n.splice(n.lastIndexOf(m),1),s(g,a,_);m.geometry=_,m.distanceSq=p}}else{if(p===0)return h[x]=!0,s(g,a,_);n.push(h[x]={feature:g,layer:a,geometry:_,distanceSq:p,callback:s})}};let c;const d=[this.replayGroup_],u=this.getLayer().getDeclutter();return d.some(g=>c=g.forEachFeatureAtCoordinate(t,o,r,i,l,u&&e.declutter[u]?e.declutter[u].all().map(_=>_.value):null)),c}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),i=e.getSource();if(!i)return!1;const s=t.viewHints[jt.ANIMATING],n=t.viewHints[jt.INTERACTING],o=e.getUpdateWhileAnimating(),r=e.getUpdateWhileInteracting();if(this.ready&&!o&&s||!r&&n)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const a=t.extent,h=t.viewState,l=h.projection,c=h.resolution,d=t.pixelRatio,u=e.getRevision(),g=e.getRenderBuffer();let _=e.getRenderOrder();_===void 0&&(_=Io);const p=h.center.slice(),x=Ge(a,g*c),m=x.slice(),y=[x.slice()],C=l.getExtent();if(i.getWrapX()&&l.canWrapX()&&!Ct(C,t.extent)){const O=zt(C),b=Math.max(zt(x)/2,O);x[0]=C[0]-b,x[2]=C[2]+b,Js(p,l);const I=qs(y[0],l);I[0]<C[0]&&I[2]<C[2]?y.push([I[0]+O,I[1],I[2]+O,I[3]]):I[0]>C[0]&&I[2]>C[2]&&y.push([I[0]-O,I[1],I[2]-O,I[3]])}if(this.ready&&this.renderedResolution_==c&&this.renderedRevision_==u&&this.renderedRenderOrder_==_&&Ct(this.wrappedRenderedExtent_,x))return pe(this.renderedExtent_,m)||(this.hitDetectionImageData_=null,this.renderedExtent_=m),this.renderedCenter_=p,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const E=new ao(Vi(c,d),x,c,d);let R;for(let O=0,b=y.length;O<b;++O)i.loadFeatures(y[O],c,l);const v=pi(c,d);let F=!0;const w=(O,b)=>{let I;const X=O.getStyleFunction()||e.getStyleFunction();if(X&&(I=X(O,c)),I){const A=this.renderFeature(O,v,I,E,R,this.getLayer().getDeclutter(),b);F=F&&!A}},G=Pi(x),k=i.getFeaturesInExtent(G);_&&k.sort(_);for(let O=0,b=k.length;O<b;++O)w(k[O],O);this.renderedFeatures_=k,this.ready=F;const L=E.finish(),P=new xo(x,c,d,i.getOverlaps(),L,e.getRenderBuffer(),!!t.declutter);return this.renderedResolution_=c,this.renderedRevision_=u,this.renderedRenderOrder_=_,this.renderedExtent_=m,this.wrappedRenderedExtent_=x,this.renderedCenter_=p,this.renderedProjection_=l,this.renderedPixelRatio_=d,this.replayGroup_=P,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(t,e,i,s,n,o,r){if(!i)return!1;let a=!1;if(Array.isArray(i))for(let h=0,l=i.length;h<l;++h)a=xi(s,t,i[h],e,this.boundHandleStyleImageChange_,n,o,r)||a;else a=xi(s,t,i,e,this.boundHandleStyleImageChange_,n,o,r);return a}}const Po=Oo;class Ao extends js{constructor(t){super(t)}createRenderer(){return new Po(this)}}const Ui=Ao,Mo={SELECT:"select"};class Go extends Mi{constructor(t,e,i,s){super(t),this.selected=e,this.deselected=i,this.mapBrowserEvent=s}}const te={};class Ne extends zs{constructor(t){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:Qs,this.addCondition_=t.addCondition?t.addCondition:ni,this.removeCondition_=t.removeCondition?t.removeCondition:ni,this.toggleCondition_=t.toggleCondition?t.toggleCondition:tn,this.multi_=t.multi?t.multi:!1,this.filter_=t.filter?t.filter:Oe,this.hitTolerance_=t.hitTolerance?t.hitTolerance:0,this.style_=t.style!==void 0?t.style:Wo(),this.features_=t.features||new Ai;let e;if(t.layers)if(typeof t.layers=="function")e=t.layers;else{const i=t.layers;e=function(s){return i.includes(s)}}else e=Oe;this.layerFilter_=e,this.featureLayerAssociation_={}}addFeatureLayerAssociation_(t,e){this.featureLayerAssociation_[Y(t)]=e}getFeatures(){return this.features_}getHitTolerance(){return this.hitTolerance_}getLayer(t){return this.featureLayerAssociation_[Y(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(wt.ADD,this.boundAddFeature_),this.features_.addEventListener(wt.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(wt.ADD,this.boundAddFeature_),this.features_.removeEventListener(wt.REMOVE,this.boundRemoveFeature_))}addFeature_(t){const e=t.element;if(this.style_&&this.applySelectedStyle_(e),!this.getLayer(e)){const i=this.getMap().getAllLayers().find(function(s){if(s instanceof Ui&&s.getSource()&&s.getSource().hasFeature(e))return s});
4i&&this.addFeatureLayerAssociation_(e,i)}}removeFeature_(t){this.style_&&this.restorePreviousStyle_(t.element)}getStyle(){return this.style_}applySelectedStyle_(t){const e=Y(t);e in te||(te[e]=t.getStyle()),t.setStyle(this.style_)}restorePreviousStyle_(t){const e=this.getMap().getInteractions().getArray();for(let s=e.length-1;s>=0;--s){const n=e[s];if(n!==this&&n instanceof Ne&&n.getStyle()&&n.getFeatures().getArray().lastIndexOf(t)!==-1){t.setStyle(n.getStyle());return}}const i=Y(t);t.setStyle(te[i]),delete te[i]}removeFeatureLayerAssociation_(t){delete this.featureLayerAssociation_[Y(t)]}handleEvent(t){if(!this.condition_(t))return!0;const e=this.addCondition_(t),i=this.removeCondition_(t),s=this.toggleCondition_(t),n=!e&&!i&&!s,o=t.map,r=this.getFeatures(),a=[],h=[];if(n){en(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,(l,c)=>{if(!(!(l instanceof Pe)||!this.filter_(l,c)))return this.addFeatureLayerAssociation_(l,c),h.push(l),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let l=r.getLength()-1;l>=0;--l){const c=r.item(l),d=h.indexOf(c);d>-1?h.splice(d,1):(r.remove(c),a.push(c))}h.length!==0&&r.extend(h)}else{o.forEachFeatureAtPixel(t.pixel,(l,c)=>{if(!(!(l instanceof Pe)||!this.filter_(l,c)))return(e||s)&&!r.getArray().includes(l)?(this.addFeatureLayerAssociation_(l,c),h.push(l)):(i||s)&&r.getArray().includes(l)&&(a.push(l),this.removeFeatureLayerAssociation_(l)),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let l=a.length-1;l>=0;--l)r.remove(a[l]);r.extend(h)}return(h.length>0||a.length>0)&&this.dispatchEvent(new Go(Mo.SELECT,h,a,t)),!0}}function Wo(){const f=sn();return ue(f.Polygon,f.LineString),ue(f.GeometryCollection,f.LineString),function(t){return t.getGeometry()?f[t.getGeometry().getType()]:null}}const mi=Ne;class No{constructor(t){this.rbush_=new nn(t),this.items_={}}insert(t,e){const i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[Y(e)]=i}load(t,e){const i=new Array(e.length);for(let s=0,n=e.length;s<n;s++){const o=t[s],r=e[s],a={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:r};i[s]=a,this.items_[Y(r)]=a}this.rbush_.load(i)}remove(t){const e=Y(t),i=this.items_[e];return delete this.items_[e],this.rbush_.remove(i)!==null}update(t,e){const i=this.items_[Y(e)],s=[i.minX,i.minY,i.maxX,i.maxY];Gi(s,t)||(this.remove(e),this.insert(t,e))}getAll(){return this.rbush_.all().map(function(e){return e.value})}getInExtent(t){const e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map(function(s){return s.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 s=0,n=t.length;s<n;s++)if(i=e(t[s]),i)return i;return i}isEmpty(){return de(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(t){const e=this.rbush_.toJSON();return be(e.minX,e.minY,e.maxX,e.maxY,t)}concat(t){this.rbush_.load(t.rbush_.all());for(const e in t.items_)this.items_[e]=t.items_[e]}}const yi=No;function Si(f,t,e,i,s,n,o){let r,a;const h=(e-t)/i;if(h===1)r=t;else if(h===2)r=t,a=s;else if(h!==0){let l=f[t],c=f[t+1],d=0;const u=[0];for(let p=t+i;p<e;p+=i){const x=f[p],m=f[p+1];d+=Math.sqrt((x-l)*(x-l)+(m-c)*(m-c)),u.push(d),l=x,c=m}const g=s*d,_=on(u,g);_<0?(a=(g-u[-_-2])/(u[-_-1]-u[-_-2]),r=t+(-_-2)*i):r=t+_*i}o=o>1?o:2,n=n||new Array(o);for(let l=0;l<o;++l)n[l]=r===void 0?NaN:a===void 0?f[r+l]:et(f[r+l],f[r+i+l],a);return n}function Bo(f,t,e,i){const s=[];let n=Xt();for(let o=0,r=e.length;o<r;++o){const a=e[o];n=Wi(f,t,a[0],i),s.push((n[0]+n[2])/2,(n[1]+n[3])/2),t=a[a.length-1]}return s}const Ci=Yt();class bt{constructor(t,e,i,s,n,o){this.styleFunction,this.extent_,this.id_=o,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i||null,this.properties_=n,this.squaredTolerance_,this.stride_=s,this.simplifiedGeometry_}get(t){return this.properties_[t]}getExtent(){return this.extent_||(this.extent_=this.type_==="Point"?rn(this.flatCoordinates_):Wi(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const t=an(this.getExtent());this.flatInteriorPoints_=ln(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const t=hn(this.flatCoordinates_,this.ends_),e=Bo(this.flatCoordinates_,0,t,2);this.flatInteriorPoints_=cn(this.flatCoordinates_,0,t,2,e)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=Si(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const t=this.flatCoordinates_;let e=0;const i=this.ends_;for(let s=0,n=i.length;s<n;++s){const o=i[s],r=Si(t,e,o,2,.5);ue(this.flatMidpoints_,r),e=o}}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){t=dn(t);const e=t.getExtent(),i=t.getWorldExtent();if(e&&i){const s=oi(i)/oi(e);xe(Ci,i[0],i[3],s,-s,0,0,0),kt(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Ci,this.flatCoordinates_)}}applyTransform(t){t(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){var t;return new bt(this.type_,this.flatCoordinates_.slice(),(t=this.ends_)==null?void 0:t.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=un((t,e)=>{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const i=this.simplifiedGeometry_.getFlatCoordinates();let s;switch(this.type_){case"LineString":i.length=_n(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,i,0),s=[i.length];break;case"MultiLineString":s=[],i.length=gn(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,i,0,s);break;case"Polygon":s=[],i.length=fn(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),i,0,s);break}return s&&(this.simplifiedGeometry_=new bt(this.type_,i,s,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}bt.prototype.getFlatCoordinates=bt.prototype.getOrientedFlatCoordinates;const St=bt,tt={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVE
4FEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};function Yo(f,t){return[[-1/0,-1/0,1/0,1/0]]}let Xo=!1;function Vo(f,t,e,i,s,n,o){const r=new XMLHttpRequest;r.open("GET",typeof f=="function"?f(e,i,s):f,!0),t.getType()=="arraybuffer"&&(r.responseType="arraybuffer"),r.withCredentials=Xo,r.onload=function(a){if(!r.status||r.status>=200&&r.status<300){const h=t.getType();let l;h=="json"?l=JSON.parse(r.responseText):h=="text"?l=r.responseText:h=="xml"?(l=r.responseXML,l||(l=new DOMParser().parseFromString(r.responseText,"application/xml"))):h=="arraybuffer"&&(l=r.response),l?n(t.readFeatures(l,{extent:e,featureProjection:s}),t.readProjection(l)):o()}else o()},r.onerror=o,r.send()}function Ei(f,t){return function(e,i,s,n,o){const r=this;Vo(f,t,e,i,s,function(a,h){r.addFeatures(a),n!==void 0&&n(a)},o||Ni)}}class pt extends Mi{constructor(t,e,i){super(t),this.feature=e,this.features=i}}class Ko extends pn{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:t.wrapX!==void 0?t.wrapX:!0}),this.on,this.once,this.un,this.loader_=Ni,this.format_=t.format,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(ee(this.format_,"`format` must be set when `url` is set"),this.loader_=Ei(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:Yo;const e=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=e?new yi:null,this.loadedExtentsRtree_=new yi,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let i,s;Array.isArray(t.features)?s=t.features:t.features&&(i=t.features,s=i.getArray()),!e&&i===void 0&&(i=new Ai(s)),s!==void 0&&this.addFeaturesInternal(s),i!==void 0&&this.bindFeaturesCollection_(i)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=Y(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);const i=t.getGeometry();if(i){const s=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(s,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new pt(tt.ADDFEATURE,t))}setupChangeEvents_(t,e){e instanceof St||(this.featureChangeKeys_[t]=[se(e,bi.CHANGE,this.handleFeatureChange_,this),se(e,xn.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(t,e){let i=!0;if(e.getId()!==void 0){const s=String(e.getId());if(!(s in this.idIndex_))this.idIndex_[s]=e;else if(e instanceof St){const n=this.idIndex_[s];n instanceof St?Array.isArray(n)?n.push(e):this.idIndex_[s]=[n,e]:i=!1}else i=!1}return i&&(ee(!(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){const e=[],i=[],s=[];for(let n=0,o=t.length;n<o;n++){const r=t[n],a=Y(r);this.addToIndex_(a,r)&&i.push(r)}for(let n=0,o=i.length;n<o;n++){const r=i[n],a=Y(r);this.setupChangeEvents_(a,r);const h=r.getGeometry();if(h){const l=h.getExtent();e.push(l),s.push(r)}else this.nullGeometryFeatures_[a]=r}if(this.featuresRtree_&&this.featuresRtree_.load(e,s),this.hasListener(tt.ADDFEATURE))for(let n=0,o=i.length;n<o;n++)this.dispatchEvent(new pt(tt.ADDFEATURE,i[n]))}bindFeaturesCollection_(t){let e=!1;this.addEventListener(tt.ADDFEATURE,function(i){e||(e=!0,t.push(i.feature),e=!1)}),this.addEventListener(tt.REMOVEFEATURE,function(i){e||(e=!0,t.remove(i.feature),e=!1)}),t.addEventListener(wt.ADD,i=>{e||(e=!0,this.addFeature(i.element),e=!1)}),t.addEventListener(wt.REMOVE,i=>{e||(e=!0,this.removeFeature(i.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(ie);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const i=s=>{this.removeFeatureInternal(s)};this.featuresRtree_.forEach(i);for(const s in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[s])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new pt(tt.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){const i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,function(s){const n=s.getGeometry();if(n instanceof St||n.intersectsCoordinate(t))return e(s)})}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){const s=i.getGeometry();if(s instanceof St||s.intersectsExtent(t)){const n=e(i);if(n)return n}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),de(this.nullGeometryFeatures_)||ue(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,function(i){e.push(i)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const s=mn(t,e);return[].concat(...s.map(n=>this.featuresRtree_.getInExtent(n)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const i=t[0],s=t[1];let n=null;const o=[NaN,NaN];let r=1/0;const a=[-1/0,-1/0,1/0,1/0];return e=e||Oe,this.featuresRtree_.forEachInExtent(a,function(h){if(e(h)){const l=h.getGeometry(),c=r;if(r=l instanceof St?0:l.closestPointXY(i,s,o,r),r<c){n=h;const d=Math.sqrt(r);a[0]=i-d,a[1]=s-d,a[2]=i+d,a[3]=s+d}}}),n}getExtent(t){return this.featuresRtree_.getExtent(t)}getFeatureById(t){const e=this.idIndex_[t.toString()];return e!==void 0?e:null}getFeatureByUid(t){const e=this.uidIndex_[t];return e!==void 0?e:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(t){const e=t.target,i=Y(e),s=e.getGeometry();if(!s)i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);else{const o=s.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(o,e)):this.featuresRtree_&&this.featuresRtree_.update(o,e)}const n=e.getId();if(n!==void 0){const o=n.toString();this.idIndex_[o]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[o]=e)}
4else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new pt(tt.CHANGEFEATURE,e))}hasFeature(t){const e=t.getId();return e!==void 0?e in this.idIndex_:Y(t)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&de(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(t,e,i){const s=this.loadedExtentsRtree_,n=this.strategy_(t,e,i);for(let o=0,r=n.length;o<r;++o){const a=n[o];s.forEachInExtent(a,function(l){return Ct(l.extent,a)})||(++this.loadingExtentsCount_,this.dispatchEvent(new pt(tt.FEATURESLOADSTART)),this.loader_.call(this,a,e,i,l=>{--this.loadingExtentsCount_,this.dispatchEvent(new pt(tt.FEATURESLOADEND,void 0,l))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new pt(tt.FEATURESLOADERROR))}),s.insert(a,{extent:a.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_;let i;e.forEachInExtent(t,function(s){if(Gi(s.extent,t))return i=s,!0}),i&&e.remove(i)}removeFeature(t){if(!t)return;const e=Y(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const e=Y(t),i=this.featureChangeKeys_[e];if(!i)return;i.forEach(ie),delete this.featureChangeKeys_[e];const s=t.getId();return s!==void 0&&delete this.idIndex_[s.toString()],delete this.uidIndex_[e],this.dispatchEvent(new pt(tt.REMOVEFEATURE,t)),t}removeFromIdIndex_(t){let e=!1;for(const i in this.idIndex_){const s=this.idIndex_[i];if(t instanceof St&&Array.isArray(s)&&s.includes(t))s.splice(s.indexOf(t),1);else if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}}return e}setLoader(t){this.loader_=t}setUrl(t){ee(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader(Ei(t,this.format_))}}const Uo=Ko,$o="/assets/marker-69ad47e9.png",Ho={class:"d-flex flex-column map-container p-2 bg-light-light border"},Zo={class:"card-body p-2 d-flex justify-content-between align-items-center"},Jo=Vt({__name:"MapDirectory",emits:["close"],setup(f,{emit:t}){const e=t,i=Kt(),s=Ii(),n=Tt(!1),o=Tt(null),r=Tt(null);let a=new ri({});const h=new Uo;let l=new ci({});const c="map-"+Math.random().toString().slice(2);let d=new mi({}),u=new ai({});Li(()=>{u=new ai({image:new Oi({anchor:[.5,1],src:$o,scale:.4})}),g()});function g(){if(r.value==null)throw new Error("MapDirectory.initMap: no popover reference");l=new ci({element:r.value,autoPan:{animation:{duration:250}},offset:[-150,0]});const y="https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";a=new ri({target:c,layers:[new yn({source:new Sn({url:y})}),new Ui({source:h})],overlays:[l]}),d=new mi({style:u}),d.on("select",p),a.addInteraction(d),a.once("postrender",()=>{n.value=!0,_()}),a.on("pointermove",C=>{const E=a.getEventPixel(C.originalEvent),R=a.hasFeatureAtPixel(E);a.getViewport().style.cursor=R?"pointer":""}),h.on("addfeature",()=>{const C=h.getExtent(),E=Cn([-11.7,49.6,3.7,61],hi,li),R=Ct(E,C)?C:E;a.getView().fit(R,{padding:[100,50,50,50],maxZoom:14})})}function _(){const y=[];i.directory.forEach(C=>{const E=C.geolocation;if(E==null)return;const R=En([E.lon,E.lat],hi,li),v=new Pe({geometry:new In(R)});v.setStyle(u),v.set("id",C.id),y.push(v)}),h.addFeatures(y)}function p(y){x(void 0);let C=y.selected[0];if(!C)return;C=C;const E=C.get("id");if(E){const R=i.directory.find(v=>v.id===E);if(R){o.value=R;const v=C.getGeometry();v&&l.setPosition(v.getCoordinates())}}}function x(y){l.setPosition(void 0),y&&y.target&&y.target.blur(),o.value=null,d.getFeatures().clear()}function m(){if(o.value){const y=o.value.id;x(void 0),e("close"),window.setTimeout(()=>{s.push({name:"company",params:{id:y}})},10)}}return(y,C)=>(W(),U("div",Ho,[D("div",{id:c,class:"map"}),D("div",{ref_key:"popoverRef",ref:r,class:"card card-popover bg-primary"},[D("div",Zo,[o.value?(W(),Rt(Rn,{key:0,"user-id":"","company-id":o.value.id,navigate:!1,
4class:"mr-2",onNavigate:m},null,8,["company-id"])):Lt("",!0),o.value?(W(),U("button",{key:1,class:"btn btn-success mr-2",onClick:m}," Go ")):Lt("",!0),D("div",{class:"icon-holder icon-holder-20 text-success cursor-pointer d-flex align-items-center",onClick:x},[J(wi(us))])])],512)]))}});const qo=Ae(Jo,[["__scopeId","data-v-1fc767c6"]]),jo={class:"container py-4"},zo={class:"row"},Qo={class:"col-lg-3 d-none d-lg-block"},tr={class:"col-lg-9 col-12"},er={key:0},ir={key:1},sr={key:0,class:"mb-2"},nr={key:0,class:"mb-2"},or={key:1,class:"mb-0"},pr=Vt({__name:"Directory",setup(f){const{updateMeta:t}=_s();t({title:"Wood Business Directory"});const e=Tt(!1),i=Tt(!1),s=Kt(),n=Fi(),o=H(()=>s.directory),r=H(()=>s.directoryQuery),a=H({get(){return n.directoryFilterOpen},set(d){n.setDirectoryFilterOpen(d)}}),h=H(()=>s.directory.filter(d=>d.geolocation!=null).length>0);fs(r,()=>{l()},{deep:!0});async function l(){e.value=!0,await s.findDirectory(),s.filterDirectory(),e.value=!1}const c=H(()=>o.value.slice().sort((u,g)=>{const _=u.displayName,p=g.displayName;return _<p?-1:_>p?1:0}));return gs(l),Li(()=>{o.value.length==0&&l()}),(d,u)=>(W(),U("div",jo,[J(Ss,{modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=g=>a.value=g),results:o.value},{filters:ct(()=>[J(di)]),_:1},8,["modelValue","results"]),u[4]||(u[4]=D("div",{class:"row"},[D("div",{class:"col-12"},[D("h1",null,"Wood Business Directory"),D("p",{class:"lead"}," Search our directory of businesses working with UK grown wood and trees. ")])],-1)),D("div",zo,[D("div",Qo,[J(di)]),D("div",tr,[J(Hn,{class:"mb-2"}),e.value?(W(),U("div",er,[J(vn)])):(W(),U("div",ir,[c.value.length>0?(W(),U("div",sr,[h.value?(W(),U("div",nr,[D("button",{class:"btn btn-success",onClick:u[1]||(u[1]=g=>i.value=!0)}," View on map "),J(Tn,{modelValue:i.value,"onUpdate:modelValue":u[3]||(u[3]=g=>i.value=g)},{default:ct(()=>[J(qo,{onClose:u[2]||(u[2]=g=>i.value=!1)})]),_:1},8,["modelValue"])])):Lt("",!0),(W(!0),U(ge,null,_e(c.value,g=>(W(),Rt(On,{id:g.id,key:g.id,class:"mb-3"},null,8,["id"]))),128))])):(W(),U("div",or," There's no businesses matching your search. Try clearing some filters. "))]))])])]))}});export{pr as default};

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.