@mapcreator/sdk 0.0.0-video.2 → 0.0.0-video.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1103,14 +1103,14 @@ vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matr
1103
1103
  ${m?.humanized??``}
1104
1104
  </text>
1105
1105
  </svg>
1106
- `}function Zc(e,t,n){let r=document.createElement(`div`);r.className=`adornment`;let i=`ArialMT`,a=[e.titleFont??i,e.subtitleFont??i];return wr(Array.from(new Set(a)),t,n).then(()=>r.innerHTML=Qc(e,i)),r}function Qc(e,t){let{title:n,titleColor:r=`#000000`,titleFont:i=t,titleFontSize:a=20,titleJustify:o=`center`,subtitle:s,subtitleColor:c=`#000000`,subtitleFont:l=t,subtitleFontSize:u=12,subtitleJustify:d=`center`,background:f=`#ffffff`,showBackground:p=!1}=e,m=0,h=0,g=0,_=0,v=0,y=n.trim().length>0?Br([n],i,a):null,b=s.trim().length>0?Br([s],l,u):null;if(m=Math.max(y?.width??0,b?.width??0),y){let{ascent:e,descent:t}=y;h=e+t,_=8+e}if(b){let{ascent:e,descent:t}=b;g=e+t,v=y?_+y.descent+e+6:8+e}let x=m+16,S=h+g+16,C=o===`center`?x/2:o===`right`?x-8:8,w=d===`center`?x/2:d===`right`?x-8:8,T=``;if(T+=`<svg xmlns="http://www.w3.org/2000/svg" width="${x}" height="${S}" viewBox="0 0 ${x} ${S}">`,T+=`<rect x="0" y="0" width="${x}" height="${S}" fill="${f}" rx="6" style="visibility:${p?`visible`:`hidden`}" />`,y||b){let e=o===`center`?`middle`:o===`right`?`end`:`start`,t=d===`center`?`middle`:d===`right`?`end`:`start`;T+=`<text x="${C}" y="${_}" fill="${r}" font-family="${i}" font-size="${a}" text-anchor="${e}">`,y&&(T+=`${Cr(n)}`),b&&(T+=`<tspan x="${w}" y="${v}" fill="${c}" font-family="${l}" font-size="${u}" text-anchor="${t}">`,T+=`${Cr(s)}`,T+=`</tspan>`),T+=`</text>`}return T+=`</svg>`,T}var $c={"sky-color":`#6babff`,"sky-horizon-blend":1,"horizon-color":[`interpolate-hcl`,[`linear`],[`zoom`],0,`#edf7fc`,9,`#edf7fc`,10,`#dcf0fa`],"horizon-fog-blend":.5,"fog-color":`#edf7fc`,"fog-ground-blend":.5,"atmosphere-blend":1},el={top_left:{x:`left`,y:`top`},top_center:{x:`center`,y:`top`},top_right:{x:`right`,y:`top`},right_center:{x:`right`,y:`center`},bottom_right:{x:`right`,y:`bottom`},bottom_center:{x:`center`,y:`bottom`},bottom_left:{x:`left`,y:`bottom`},left_center:{x:`left`,y:`center`}},tl=[`top_left`,`top_right`,`bottom_left`,`bottom_right`,`top_center`,`left_center`,`right_center`,`bottom_center`],nl=new Map;function rl(e,t,n,r,i,a,o){let{adornments:s=[]}=e;il(n,t),s.forEach(t=>{t.type===`custom`?ol(M(t),t.position,t.stacking):t.type===`scalebar`?ol(Yc(t,n),t.position,t.stacking):t.type===`northArrow`?ol(ci(t,n),t.position,t.stacking):t.type===`webControls`&&t.buttons?ol(Bi(t,n,r),t.position,t.stacking):t.type===`insetMap`?ol(zc(t,n,a),t.position,t.stacking):t.type===`heading`?ol(Zc(t,i,o),t.position,t.stacking):t.type===`manualLegend`?ol(si(t,i,o),t.position,t.stacking):t.type===`connectedLegend`&&ol($r(t,e,n,i,o),t.position,t.stacking)}),sl(n),n.on(`moveend`,()=>sl(n))}function il(e,t){let n=e.getContainer();for(let e of tl){let r=document.createElement(`div`);r.classList.add(`adornment-container`,`${e}`),t?.[e]&&(r.style.cssText=al(e,t));let i=document.createElement(`div`),a=document.createElement(`div`);r.classList.add(`adornment-container`,e),i.classList.add(`inner`),a.classList.add(`inner`,`vertical`),r.append(i,a),n.appendChild(r),nl.set(e,{horizontal:i,vertical:a})}}function al(e,t){let n=el[e],{x:r,y:i,unit:a}=t[e],o=``,s=[];return n.x===`center`?s.push(`translateX(${r}${a})`):o+=`${n.x}: ${r}${a};`,n.y===`center`?s.push(`translateY(${i}${a})`):e===`bottom_right`?o+=`${n.y}: max(${i}${a}, 25px);`:o+=`${n.y}: ${i}${a};`,s.length&&(o+=`transform: ${s.join(` `)};`),o}function ol(e,t,n){n||=[`left_center`,`right_center`].includes(t)?`vertical`:`horizontal`;let r=nl.get(t),i=t===`left_center`||t===`right_center`?`vertical`:`horizontal`;r?.[i].hasChildNodes()||(n=i),(r?.[n])?.appendChild(e)}function sl(e){let t=Array.from(document.querySelectorAll(`.adornment, .maplibregl-ctrl-attrib`)),n=[];t.forEach(e=>{let t=e.getBoundingClientRect();t&&n.push([t.x,t.y,t.x+t.width,t.y+t.height])}),e.setLabelFreeAreas(n)}function cl(e,t,n,r,i){e.addSource(t.id,{type:`geojson`,data:{type:`FeatureCollection`,features:t.models.filter(e=>e.visible??!0).map(e=>ll(t,e,r,i))}}),e.addLayer({id:t.id,type:`fill`,source:t.id,metadata:{"mc-model-type":`polygon`,"mc-group-id":t.id},paint:{"fill-color":[`get`,`fill-color`]}},n),e.addLayer({id:`${t.id}-pattern`,type:`fill`,source:t.id,filter:[`has`,`fill-pattern`],paint:{"fill-pattern":[`get`,`fill-pattern`]},metadata:{"mc-model-type":`polygon`,"mc-group-id":t.id}},n),e.addLayer({id:`${t.id}-outline`,type:`line`,source:t.id,metadata:{"mc-model-type":`polygon`,"mc-group-id":t.id},layout:{"line-cap":`round`,"line-join":`round`},paint:{"line-width":[`get`,`outline-width`],"line-color":[`get`,`outline-color`]}},n)}function ll(e,t,n,r){let i=t.fillPattern===void 0?void 0:r.getMapLibreImageKey(n[t.fillPattern],2*window.devicePixelRatio);return{type:`Feature`,id:b(t.id),properties:{id:t.id,"fill-color":e.fillColor||t.fillColor?Vr(t.dataBindings??{},t.fillColor,e.fillColor):`#000000`,"outline-color":e.outlineColor||t.outlineColor?Vr(t.dataBindings??{},t.outlineColor,e.outlineColor):`#000000`,"outline-width":t.outlineWidth??0,"fill-pattern":i},geometry:{type:`Polygon`,coordinates:rr(t)}}}function ul(e,t,n,r,i){e.addSource(t.id,{type:`geojson`,data:{type:`FeatureCollection`,features:t.models.filter(e=>e.visible??!0).map(e=>dl(t,e,r,i))}}),e.addLayer({id:t.id,type:`fill`,source:t.id,metadata:{"mc-model-type":`circle`,"mc-group-id":t.id},filter:[`==`,[`geometry-type`],`Polygon`],paint:{"fill-color":[`get`,`fill-color`]}},n),e.addLayer({id:`${t.id}-pattern`,type:`fill`,source:t.id,filter:[`has`,`fill-pattern`],paint:{"fill-pattern":[`get`,`fill-pattern`]},metadata:{"mc-model-type":`circle`,"mc-group-id":t.id}},n),e.addLayer({id:`${t.id}-radius-line`,type:`line`,source:t.id,metadata:{"mc-model-type":`circle`,"mc-group-id":t.id},filter:[`all`,[`==`,[`geometry-type`],`LineString`],[`get`,`radius-line-enabled`]],paint:{"line-color":[`get`,`radius-line-color`],"line-width":[`get`,`radius-line-width`]}},n),e.addLayer({id:`${t.id}-outline`,type:`line`,source:t.id,metadata:{"mc-model-type":`circle`,"mc-group-id":t.id},filter:[`==`,[`geometry-type`],`Polygon`],layout:{"line-cap":`round`,"line-join":`round`},paint:{"line-width":[`get`,`outline-width`],"line-color":[`get`,`outline-color`]}},n)}function dl(e,t,n,r){let i=t.fillPattern===void 0?void 0:r.getMapLibreImageKey(n[t.fillPattern],2*window.devicePixelRatio);return{type:`Feature`,id:b(t.id),properties:{id:t.id,"fill-color":e.fillColor||t.fillColor?Vr(t.dataBindings??{},t.fillColor,e.fillColor):`#000000`,"outline-color":e.outlineColor||t.outlineColor?Vr(t.dataBindings??{},t.outlineColor,e.outlineColor):`#000000`,"outline-width":t.outlineWidth??0,"fill-pattern":i,"radius-line-enabled":t.radiusLineEnabled??!1,"radius-line-color":e.radiusLineColor||t.radiusLineColor?Vr(t.dataBindings??{},t.radiusLineColor,e.radiusLineColor):`#000000`,"radius-line-width":t.radiusLineWidth??0},geometry:{type:`GeometryCollection`,geometries:[{type:`Polygon`,coordinates:[Qn(t.center,t.radius)]},{type:`LineString`,coordinates:$n(t.center,t.radius,t.radiusLineBearing??0)}]}}}var fl=`Roboto-Regular`;function pl(e,t,n,r,i){let a=[],o=new Set,s=new Set,c=[`match`,[`get`,`text-font`]],l=!!t.clustering;for(let e of t.models)(e.visible??!0)&&a.push(hl(t,e,r,i)),o.add(e.textFont),s.add(e.textLineHeight??1.2);if(Array.from(o).length>0){for(let e of Array.from(o))c.push(e,[`literal`,[e,fl]]);c.push([`literal`,[fl]])}e.addSource(t.id,{type:`geojson`,data:{type:`FeatureCollection`,features:a},cluster:l,clusterRadius:t.clusterRadius??50,clusterMaxZoom:t.clusterMaxZoom??14}),s.forEach(r=>{e.addLayer({id:`${t.id}-${r}`,type:`symbol`,source:t.id,metadata:{"mc-model-type":`marker`,"mc-group-id":t.id},layout:{"icon-allow-overlap":!t.collisionDetection,"icon-ignore-placement":!t.collisionDetection,"text-allow-overlap":!t.collisionDetection,"text-ignore-placement":!t.collisionDetection,"icon-image":[`get`,`mc-image-key`],"icon-anchor":[`get`,`icon-anchor`],"icon-size":[`get`,`icon-size`],"icon-rotate":[`get`,`icon-rotate`],"icon-offset":[`get`,`icon-offset`],"text-field":`{text}`,"text-font":c,"text-max-width":[`get`,`text-max-width`],"text-offset":[`get`,`text-offset`],"text-rotate":[`get`,`text-rotate`],"text-size":[`get`,`text-size`],"text-anchor":[`get`,`text-anchor`],"text-letter-spacing":[`get`,`text-letter-spacing`],"text-line-height":r,"text-justify":[`get`,`text-justify`]},paint:{"text-color":[`get`,`text-color`],"text-halo-color":[`get`,`text-halo-color`],"text-halo-width":[`get`,`text-halo-width`]},filter:[`all`,[`==`,[`get`,`text-line-height`],r],[`!`,[`has`,`point_count`]]]},n)}),l&&(e.addLayer({id:`${t.id}-circle-cluster`,type:`circle`,source:t.id,filter:[`has`,`point_count`],paint:{"circle-color":{property:`point_count`,type:`interval`,stops:t.clusterCircleColor??[]},"circle-radius":{property:`point_count`,type:`interval`,stops:t.clusterCircleRadius??[]}}}),e.addLayer({id:`${t.id}-text-cluster`,type:`symbol`,source:t.id,filter:[`has`,`point_count`],paint:{"text-color":{property:`point_count`,type:`interval`,stops:t.clusterTextColor??[]}},layout:{"text-font":[`literal`,[fl]],"text-field":`{point_count_abbreviated}`,"text-size":{property:`point_count`,type:`interval`,stops:t.clusterTextSize??[]}}}),ml(e,t))}function ml(e,t){e.on(`click`,`${t.id}-circle-cluster`,async t=>{let n=e.queryRenderedFeatures(t.point).find(e=>e.properties.cluster);if(!n)return;let r=e.getSource(n.source);if(!r)return;let i=await r.getClusterExpansionZoom(Number(n.id));e.easeTo({center:n.geometry.coordinates,zoom:i})})}function hl(e,t,n,r){let i=t.svg===void 0?void 0:r.getMapLibreImageKey(Ur(t.dataBindings??{},n[t.svg],e.svg?n[e.svg]:void 0),window.devicePixelRatio*(t.iconScale??1));return{type:`Feature`,id:b(t.id),properties:{id:t.id,"mc-image-key":i,"icon-anchor":t.iconAnchor??`center`,"icon-rotate":t.iconRotation??0,"icon-offset":t.iconOffset??[0,0],"icon-size":t.iconScale??1,text:e.text||t.text?Hr(t.dataBindings??{},t.text,e.text):void 0,"text-anchor":t.textAnchor??`center`,"text-font":t.textFont,"text-offset":[(t.textOffset?.[0]??0)/(t.textSize??16),(t.textOffset?.[1]??0)/(t.textSize??16)],"text-rotate":t.textRotation??0,"text-max-width":t.textMaxWidth??10,"text-size":t.textSize??16,"text-color":e.textColor||t.textColor?Vr(t.dataBindings??{},t.textColor,e.textColor):`#000000`,"text-halo-color":e.textHaloColor||t.textHaloColor?Vr(t.dataBindings??{},t.textHaloColor,e.textHaloColor):`#000000`,"text-halo-width":t.textHaloWidth??0,"text-line-height":t.textLineHeight??1.2,"text-letter-spacing":t.textLetterSpacing??0,"text-justify":t.textJustify??`center`},geometry:{type:`Point`,coordinates:[t.lngLat.lng,t.lngLat.lat]}}}async function gl(e,t,n,r,i){let a=e.map(e=>`${n}/styles/${e}.json?access_token=${r}`).map(e=>fetch(e).then(e=>e.json())),o=await Promise.all(a);await Promise.all(o.map(e=>_l(e,t,r,i)))}async function _l(e,t,n,r){for(let n in e.sources)t.getSource(n)===void 0&&t.addSource(n,e.sources[n]);e.sprite!==void 0&&await yl(t,e.sprite,n);for(let n of e.layers){t.getLayer(n.id)!==void 0&&t.removeLayer(n.id);let e=n.metadata?.[`mc-add-before`]??`mc-before-none`;t.addLayer(vl(n,r),e)}}function vl(e,t){let n=(t??{})[e.id]??{},r={...e,layout:{...e.layout,...n.layout},paint:{...e.paint,...n.paint},metadata:{...e.metadata,...n.metadata}};return n.minzoom!==void 0&&(r.minzoom=n.minzoom),n.maxzoom!==void 0&&(r.maxzoom=n.maxzoom),`filter`in n&&r.type!==`background`&&(r.filter=n.filter),r}async function yl(e,t,n){try{let r=`${t}.json?access_token=${n}`,i=`${t}.png?access_token=${n}`,[a,o]=await Promise.all([fetch(r),fetch(i)]);if(!a.ok||!o.ok)throw Error(`Failed to load sprite from ${t}`);let s=await a.json(),c=await o.blob(),l=await new Promise((e,t)=>{let n=new Image;n.onload=()=>e(n),n.onerror=e=>t(e),n.src=URL.createObjectURL(c)}),u=document.createElement(`canvas`),d=u.getContext(`2d`,{willReadFrequently:!0});if(!d)throw Error(`Failed to get canvas context`);for(let[t,n]of Object.entries(s)){if(e.hasImage(t))continue;let{x:r,y:i,width:a,height:o,pixelRatio:s}=n;u.width=a*s,u.height=o*s,d.clearRect(0,0,u.width,u.height),d.drawImage(l,r,i,a,o,0,0,u.width,u.height);let c=d.getImageData(0,0,u.width,u.height);e.addImage(t,c,{pixelRatio:s})}}catch(e){console.error(e)}}var bl=`<svg xmlns="http://www.w3.org/2000/svg" width="6" height="10" viewBox="0 0 6 10" fill="currentColor"><path d="m0 4.647 4.282 4.4a.814.814 0 0 0 1.166-1.134L2.27 4.647l3.178-3.266A.814.814 0 1 0 4.282.246z"/></svg>
1107
- `,xl=`<svg xmlns="http://www.w3.org/2000/svg" width="10" height="11" viewBox="0 0 10 11" fill="currentColor"><path d="M.21.71a.714.714 0 0 1 1.011 0l3.78 3.78L8.778.71a.715.715 0 0 1 1.013 1.01L6.01 5.501l3.78 3.778a.715.715 0 0 1-1.01 1.012L5 6.51l-3.779 3.78A.716.716 0 0 1 .21 9.28L3.99 5.5.21 1.721A.714.714 0 0 1 .21.71"/></svg>
1108
- `,Sl=`<svg xmlns="http://www.w3.org/2000/svg" width="6" height="10" viewBox="0 0 6 10" fill="currentColor"><path d="m5.678 4.647-4.282 4.4A.814.814 0 1 1 .23 7.914l3.177-3.266L.23 1.381A.814.814 0 1 1 1.396.246z"/></svg>
1109
- `,Cl=`<svg width="20" height="20" viewBox="0 0 40 40" stroke="currentColor" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 4.167 1.667 35.834h36.667z" stroke-width="2" stroke-linejoin="round"/><path d="M20 29.167v.834m0-14.167.007 8.333" stroke-width="2" stroke-linecap="round"/></svg>
1110
- `;function wl(e,t){let{allowFullscreen:n,loop:r}=e,i=x(e.src,t),a,o=i.match(/(?:youtube\.com\/(?:watch\?.*v=|embed\/|v\/)|youtu\.be\/)([-\w]{11})/)?.[1];a=o?`https://www.youtube.com/embed/${o}`:i;let s=[];if(n||s.push(`fs=0`),r&&o&&s.push(`loop=1&playlist=${o}`),a=El(a),a=Tl(a),s.length){let e=a.includes(`?`)?`&`:`?`;a+=`${e}${s.join(`&`)}`}return a}function Tl(e){return e.replace(/([?&])si=[^&]+(&)?/,(e,t,n)=>t===`?`&&!n?``:t===`?`&&n?`?`:n?`&`:``)}function El(e){let t=new URL(e),n=t.searchParams.get(`t`);if(!n)return e;let r=0,i=/^((\d+)m)?((\d+)s)?$/;if(/^\d+$/.test(n))r=parseInt(n,10);else{let e=n.match(i);if(e){let t=parseInt(e[2]||`0`,10),n=parseInt(e[4]||`0`,10);r=t*60+n}}return r>0&&(t.searchParams.delete(`t`),t.searchParams.set(`start`,String(r))),t.toString()}function Dl(e,t,n,r){let i;if(t?.type===`video`)i=r===`preview`?Ml(t.src,n):`
1106
+ `}function Zc(e,t,n){let r=document.createElement(`div`);r.className=`adornment`;let i=`ArialMT`,a=[e.titleFont??i,e.subtitleFont??i];return wr(Array.from(new Set(a)),t,n).then(()=>r.innerHTML=Qc(e,i)),r}function Qc(e,t){let{title:n,titleColor:r=`#000000`,titleFont:i=t,titleFontSize:a=20,titleJustify:o=`center`,subtitle:s,subtitleColor:c=`#000000`,subtitleFont:l=t,subtitleFontSize:u=12,subtitleJustify:d=`center`,background:f=`#ffffff`,showBackground:p=!1}=e,m=0,h=0,g=0,_=0,v=0,y=n.trim().length>0?Br([n],i,a):null,b=s.trim().length>0?Br([s],l,u):null;if(m=Math.max(y?.width??0,b?.width??0),y){let{ascent:e,descent:t}=y;h=e+t,_=8+e}if(b){let{ascent:e,descent:t}=b;g=e+t,v=y?_+y.descent+e+6:8+e}let x=m+16,S=h+g+16,C=o===`center`?x/2:o===`right`?x-8:8,w=d===`center`?x/2:d===`right`?x-8:8,T=``;if(T+=`<svg xmlns="http://www.w3.org/2000/svg" width="${x}" height="${S}" viewBox="0 0 ${x} ${S}">`,T+=`<rect x="0" y="0" width="${x}" height="${S}" fill="${f}" rx="6" style="visibility:${p?`visible`:`hidden`}" />`,y||b){let e=o===`center`?`middle`:o===`right`?`end`:`start`,t=d===`center`?`middle`:d===`right`?`end`:`start`;T+=`<text x="${C}" y="${_}" fill="${r}" font-family="${i}" font-size="${a}" text-anchor="${e}">`,y&&(T+=`${Cr(n)}`),b&&(T+=`<tspan x="${w}" y="${v}" fill="${c}" font-family="${l}" font-size="${u}" text-anchor="${t}">`,T+=`${Cr(s)}`,T+=`</tspan>`),T+=`</text>`}return T+=`</svg>`,T}var $c={"sky-color":`#6babff`,"sky-horizon-blend":1,"horizon-color":[`interpolate-hcl`,[`linear`],[`zoom`],0,`#edf7fc`,9,`#edf7fc`,10,`#dcf0fa`],"horizon-fog-blend":.5,"fog-color":`#edf7fc`,"fog-ground-blend":.5,"atmosphere-blend":1},el={top_left:{x:5,y:5,unit:`px`},top_center:{x:0,y:5,unit:`px`},top_right:{x:5,y:5,unit:`px`},right_center:{x:5,y:0,unit:`px`},bottom_right:{x:5,y:5,unit:`px`},bottom_center:{x:0,y:5,unit:`px`},bottom_left:{x:5,y:5,unit:`px`},left_center:{x:5,y:0,unit:`px`}},tl={top_left:{x:`left`,y:`top`},top_center:{x:`center`,y:`top`},top_right:{x:`right`,y:`top`},right_center:{x:`right`,y:`center`},bottom_right:{x:`right`,y:`bottom`},bottom_center:{x:`center`,y:`bottom`},bottom_left:{x:`left`,y:`bottom`},left_center:{x:`left`,y:`center`}},nl=[`top_left`,`top_right`,`bottom_left`,`bottom_right`,`top_center`,`left_center`,`right_center`,`bottom_center`],rl=new Map;function il(e,t,n,r,i,a,o,s,c){let{adornments:l=[]}=e;al(n,t,s,c),l.forEach(t=>{t.type===`custom`?sl(M(t),t.position,t.stacking):t.type===`scalebar`?sl(Yc(t,n),t.position,t.stacking):t.type===`northArrow`?sl(ci(t,n),t.position,t.stacking):t.type===`webControls`&&t.buttons?sl(Bi(t,n,r),t.position,t.stacking):t.type===`insetMap`?sl(zc(t,n,a),t.position,t.stacking):t.type===`heading`?sl(Zc(t,i,o),t.position,t.stacking):t.type===`manualLegend`?sl(si(t,i,o),t.position,t.stacking):t.type===`connectedLegend`&&sl($r(t,e,n,i,o),t.position,t.stacking)}),cl(n),n.on(`moveend`,()=>cl(n))}function al(e,t,n,r){let i=e.getContainer();for(let e of nl){let a=document.createElement(`div`);a.classList.add(`adornment-container`,e),a.style.cssText=ol(e,t[e],n,r);let o=document.createElement(`div`),s=document.createElement(`div`);o.classList.add(`inner`),s.classList.add(`inner`,`vertical`),a.append(o,s),i.appendChild(a),rl.set(e,{horizontal:o,vertical:s})}}function ol(e,t,n,r){let i=tl[e],a=``,o=[],s=t.x*n,c=t.y*n;o.push(`scale(${n})`);let{unit:l}=t;return i.x===`center`?o.push(`translateX(${s}${l})`):a+=`${i.x}: ${s}${l};`,i.y===`center`?o.push(`translateY(${c}${l})`):e===`bottom_right`&&r!==`video`?a+=`${i.y}: max(${c}${l}, 25px);`:a+=`${i.y}: ${c}${l};`,o.length&&(a+=`transform: ${o.join(` `)};`),a}function sl(e,t,n){n||=[`left_center`,`right_center`].includes(t)?`vertical`:`horizontal`;let r=rl.get(t),i=t===`left_center`||t===`right_center`?`vertical`:`horizontal`;r?.[i].hasChildNodes()||(n=i),(r?.[n])?.appendChild(e)}function cl(e){let t=Array.from(document.querySelectorAll(`.adornment, .maplibregl-ctrl-attrib`)),n=[];t.forEach(e=>{let t=e.getBoundingClientRect();t&&n.push([t.x,t.y,t.x+t.width,t.y+t.height])}),e.setLabelFreeAreas(n)}function ll(e,t,n,r,i){e.addSource(t.id,{type:`geojson`,data:{type:`FeatureCollection`,features:t.models.filter(e=>e.visible??!0).map(e=>ul(t,e,r,i))}}),e.addLayer({id:t.id,type:`fill`,source:t.id,metadata:{"mc-model-type":`polygon`,"mc-group-id":t.id},paint:{"fill-color":[`get`,`fill-color`]}},n),e.addLayer({id:`${t.id}-pattern`,type:`fill`,source:t.id,filter:[`has`,`fill-pattern`],paint:{"fill-pattern":[`get`,`fill-pattern`]},metadata:{"mc-model-type":`polygon`,"mc-group-id":t.id}},n),e.addLayer({id:`${t.id}-outline`,type:`line`,source:t.id,metadata:{"mc-model-type":`polygon`,"mc-group-id":t.id},layout:{"line-cap":`round`,"line-join":`round`},paint:{"line-width":[`get`,`outline-width`],"line-color":[`get`,`outline-color`]}},n)}function ul(e,t,n,r){let i=t.fillPattern===void 0?void 0:r.getMapLibreImageKey(n[t.fillPattern],2*window.devicePixelRatio);return{type:`Feature`,id:b(t.id),properties:{id:t.id,"fill-color":e.fillColor||t.fillColor?Vr(t.dataBindings??{},t.fillColor,e.fillColor):`#000000`,"outline-color":e.outlineColor||t.outlineColor?Vr(t.dataBindings??{},t.outlineColor,e.outlineColor):`#000000`,"outline-width":t.outlineWidth??0,"fill-pattern":i},geometry:{type:`Polygon`,coordinates:rr(t)}}}function dl(e,t,n,r,i){e.addSource(t.id,{type:`geojson`,data:{type:`FeatureCollection`,features:t.models.filter(e=>e.visible??!0).map(e=>fl(t,e,r,i))}}),e.addLayer({id:t.id,type:`fill`,source:t.id,metadata:{"mc-model-type":`circle`,"mc-group-id":t.id},filter:[`==`,[`geometry-type`],`Polygon`],paint:{"fill-color":[`get`,`fill-color`]}},n),e.addLayer({id:`${t.id}-pattern`,type:`fill`,source:t.id,filter:[`has`,`fill-pattern`],paint:{"fill-pattern":[`get`,`fill-pattern`]},metadata:{"mc-model-type":`circle`,"mc-group-id":t.id}},n),e.addLayer({id:`${t.id}-radius-line`,type:`line`,source:t.id,metadata:{"mc-model-type":`circle`,"mc-group-id":t.id},filter:[`all`,[`==`,[`geometry-type`],`LineString`],[`get`,`radius-line-enabled`]],paint:{"line-color":[`get`,`radius-line-color`],"line-width":[`get`,`radius-line-width`]}},n),e.addLayer({id:`${t.id}-outline`,type:`line`,source:t.id,metadata:{"mc-model-type":`circle`,"mc-group-id":t.id},filter:[`==`,[`geometry-type`],`Polygon`],layout:{"line-cap":`round`,"line-join":`round`},paint:{"line-width":[`get`,`outline-width`],"line-color":[`get`,`outline-color`]}},n)}function fl(e,t,n,r){let i=t.fillPattern===void 0?void 0:r.getMapLibreImageKey(n[t.fillPattern],2*window.devicePixelRatio);return{type:`Feature`,id:b(t.id),properties:{id:t.id,"fill-color":e.fillColor||t.fillColor?Vr(t.dataBindings??{},t.fillColor,e.fillColor):`#000000`,"outline-color":e.outlineColor||t.outlineColor?Vr(t.dataBindings??{},t.outlineColor,e.outlineColor):`#000000`,"outline-width":t.outlineWidth??0,"fill-pattern":i,"radius-line-enabled":t.radiusLineEnabled??!1,"radius-line-color":e.radiusLineColor||t.radiusLineColor?Vr(t.dataBindings??{},t.radiusLineColor,e.radiusLineColor):`#000000`,"radius-line-width":t.radiusLineWidth??0},geometry:{type:`GeometryCollection`,geometries:[{type:`Polygon`,coordinates:[Qn(t.center,t.radius)]},{type:`LineString`,coordinates:$n(t.center,t.radius,t.radiusLineBearing??0)}]}}}var pl=`Roboto-Regular`;function ml(e,t,n,r,i){let a=[],o=new Set,s=new Set,c=[`match`,[`get`,`text-font`]],l=!!t.clustering;for(let e of t.models)(e.visible??!0)&&a.push(gl(t,e,r,i)),o.add(e.textFont),s.add(e.textLineHeight??1.2);if(Array.from(o).length>0){for(let e of Array.from(o))c.push(e,[`literal`,[e,pl]]);c.push([`literal`,[pl]])}e.addSource(t.id,{type:`geojson`,data:{type:`FeatureCollection`,features:a},cluster:l,clusterRadius:t.clusterRadius??50,clusterMaxZoom:t.clusterMaxZoom??14}),s.forEach(r=>{e.addLayer({id:`${t.id}-${r}`,type:`symbol`,source:t.id,metadata:{"mc-model-type":`marker`,"mc-group-id":t.id},layout:{"icon-allow-overlap":!t.collisionDetection,"icon-ignore-placement":!t.collisionDetection,"text-allow-overlap":!t.collisionDetection,"text-ignore-placement":!t.collisionDetection,"icon-image":[`get`,`mc-image-key`],"icon-anchor":[`get`,`icon-anchor`],"icon-size":[`get`,`icon-size`],"icon-rotate":[`get`,`icon-rotate`],"icon-offset":[`get`,`icon-offset`],"text-field":`{text}`,"text-font":c,"text-max-width":[`get`,`text-max-width`],"text-offset":[`get`,`text-offset`],"text-rotate":[`get`,`text-rotate`],"text-size":[`get`,`text-size`],"text-anchor":[`get`,`text-anchor`],"text-letter-spacing":[`get`,`text-letter-spacing`],"text-line-height":r,"text-justify":[`get`,`text-justify`]},paint:{"text-color":[`get`,`text-color`],"text-halo-color":[`get`,`text-halo-color`],"text-halo-width":[`get`,`text-halo-width`]},filter:[`all`,[`==`,[`get`,`text-line-height`],r],[`!`,[`has`,`point_count`]]]},n)}),l&&(e.addLayer({id:`${t.id}-circle-cluster`,type:`circle`,source:t.id,filter:[`has`,`point_count`],paint:{"circle-color":{property:`point_count`,type:`interval`,stops:t.clusterCircleColor??[]},"circle-radius":{property:`point_count`,type:`interval`,stops:t.clusterCircleRadius??[]}}}),e.addLayer({id:`${t.id}-text-cluster`,type:`symbol`,source:t.id,filter:[`has`,`point_count`],paint:{"text-color":{property:`point_count`,type:`interval`,stops:t.clusterTextColor??[]}},layout:{"text-font":[`literal`,[pl]],"text-field":`{point_count_abbreviated}`,"text-size":{property:`point_count`,type:`interval`,stops:t.clusterTextSize??[]}}}),hl(e,t))}function hl(e,t){e.on(`click`,`${t.id}-circle-cluster`,async t=>{let n=e.queryRenderedFeatures(t.point).find(e=>e.properties.cluster);if(!n)return;let r=e.getSource(n.source);if(!r)return;let i=await r.getClusterExpansionZoom(Number(n.id));e.easeTo({center:n.geometry.coordinates,zoom:i})})}function gl(e,t,n,r){let i=t.svg===void 0?void 0:r.getMapLibreImageKey(Ur(t.dataBindings??{},n[t.svg],e.svg?n[e.svg]:void 0),window.devicePixelRatio*(t.iconScale??1));return{type:`Feature`,id:b(t.id),properties:{id:t.id,"mc-image-key":i,"icon-anchor":t.iconAnchor??`center`,"icon-rotate":t.iconRotation??0,"icon-offset":t.iconOffset??[0,0],"icon-size":t.iconScale??1,text:e.text||t.text?Hr(t.dataBindings??{},t.text,e.text):void 0,"text-anchor":t.textAnchor??`center`,"text-font":t.textFont,"text-offset":[(t.textOffset?.[0]??0)/(t.textSize??16),(t.textOffset?.[1]??0)/(t.textSize??16)],"text-rotate":t.textRotation??0,"text-max-width":t.textMaxWidth??10,"text-size":t.textSize??16,"text-color":e.textColor||t.textColor?Vr(t.dataBindings??{},t.textColor,e.textColor):`#000000`,"text-halo-color":e.textHaloColor||t.textHaloColor?Vr(t.dataBindings??{},t.textHaloColor,e.textHaloColor):`#000000`,"text-halo-width":t.textHaloWidth??0,"text-line-height":t.textLineHeight??1.2,"text-letter-spacing":t.textLetterSpacing??0,"text-justify":t.textJustify??`center`},geometry:{type:`Point`,coordinates:[t.lngLat.lng,t.lngLat.lat]}}}async function _l(e,t,n,r,i){let a=e.map(e=>`${n}/styles/${e}.json?access_token=${r}`).map(e=>fetch(e).then(e=>e.json())),o=await Promise.all(a);await Promise.all(o.map(e=>vl(e,t,r,i)))}async function vl(e,t,n,r){for(let n in e.sources)t.getSource(n)===void 0&&t.addSource(n,e.sources[n]);e.sprite!==void 0&&await bl(t,e.sprite,n);for(let n of e.layers){t.getLayer(n.id)!==void 0&&t.removeLayer(n.id);let e=n.metadata?.[`mc-add-before`]??`mc-before-none`;t.addLayer(yl(n,r),e)}}function yl(e,t){let n=(t??{})[e.id]??{},r={...e,layout:{...e.layout,...n.layout},paint:{...e.paint,...n.paint},metadata:{...e.metadata,...n.metadata}};return n.minzoom!==void 0&&(r.minzoom=n.minzoom),n.maxzoom!==void 0&&(r.maxzoom=n.maxzoom),`filter`in n&&r.type!==`background`&&(r.filter=n.filter),r}async function bl(e,t,n){try{let r=`${t}.json?access_token=${n}`,i=`${t}.png?access_token=${n}`,[a,o]=await Promise.all([fetch(r),fetch(i)]);if(!a.ok||!o.ok)throw Error(`Failed to load sprite from ${t}`);let s=await a.json(),c=await o.blob(),l=await new Promise((e,t)=>{let n=new Image;n.onload=()=>e(n),n.onerror=e=>t(e),n.src=URL.createObjectURL(c)}),u=document.createElement(`canvas`),d=u.getContext(`2d`,{willReadFrequently:!0});if(!d)throw Error(`Failed to get canvas context`);for(let[t,n]of Object.entries(s)){if(e.hasImage(t))continue;let{x:r,y:i,width:a,height:o,pixelRatio:s}=n;u.width=a*s,u.height=o*s,d.clearRect(0,0,u.width,u.height),d.drawImage(l,r,i,a,o,0,0,u.width,u.height);let c=d.getImageData(0,0,u.width,u.height);e.addImage(t,c,{pixelRatio:s})}}catch(e){console.error(e)}}var xl=`<svg xmlns="http://www.w3.org/2000/svg" width="6" height="10" viewBox="0 0 6 10" fill="currentColor"><path d="m0 4.647 4.282 4.4a.814.814 0 0 0 1.166-1.134L2.27 4.647l3.178-3.266A.814.814 0 1 0 4.282.246z"/></svg>
1107
+ `,Sl=`<svg xmlns="http://www.w3.org/2000/svg" width="10" height="11" viewBox="0 0 10 11" fill="currentColor"><path d="M.21.71a.714.714 0 0 1 1.011 0l3.78 3.78L8.778.71a.715.715 0 0 1 1.013 1.01L6.01 5.501l3.78 3.778a.715.715 0 0 1-1.01 1.012L5 6.51l-3.779 3.78A.716.716 0 0 1 .21 9.28L3.99 5.5.21 1.721A.714.714 0 0 1 .21.71"/></svg>
1108
+ `,Cl=`<svg xmlns="http://www.w3.org/2000/svg" width="6" height="10" viewBox="0 0 6 10" fill="currentColor"><path d="m5.678 4.647-4.282 4.4A.814.814 0 1 1 .23 7.914l3.177-3.266L.23 1.381A.814.814 0 1 1 1.396.246z"/></svg>
1109
+ `,wl=`<svg width="20" height="20" viewBox="0 0 40 40" stroke="currentColor" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 4.167 1.667 35.834h36.667z" stroke-width="2" stroke-linejoin="round"/><path d="M20 29.167v.834m0-14.167.007 8.333" stroke-width="2" stroke-linecap="round"/></svg>
1110
+ `;function Tl(e,t){let{allowFullscreen:n,loop:r}=e,i=x(e.src,t),a,o=i.match(/(?:youtube\.com\/(?:watch\?.*v=|embed\/|v\/)|youtu\.be\/)([-\w]{11})/)?.[1];a=o?`https://www.youtube.com/embed/${o}`:i;let s=[];if(n||s.push(`fs=0`),r&&o&&s.push(`loop=1&playlist=${o}`),a=Dl(a),a=El(a),s.length){let e=a.includes(`?`)?`&`:`?`;a+=`${e}${s.join(`&`)}`}return a}function El(e){return e.replace(/([?&])si=[^&]+(&)?/,(e,t,n)=>t===`?`&&!n?``:t===`?`&&n?`?`:n?`&`:``)}function Dl(e){let t=new URL(e),n=t.searchParams.get(`t`);if(!n)return e;let r=0,i=/^((\d+)m)?((\d+)s)?$/;if(/^\d+$/.test(n))r=parseInt(n,10);else{let e=n.match(i);if(e){let t=parseInt(e[2]||`0`,10),n=parseInt(e[4]||`0`,10);r=t*60+n}}return r>0&&(t.searchParams.delete(`t`),t.searchParams.set(`start`,String(r))),t.toString()}function Ol(e,t,n,r){let i;if(t?.type===`video`)i=r===`preview`?Nl(t.src,n):`
1111
1111
  <div class="youtube-container">
1112
1112
  <iframe
1113
- src="${wl(t,n)}"
1113
+ src="${Tl(t,n)}"
1114
1114
  width="100%" height="300" style="border: none" allowfullscreen>
1115
1115
  </iframe>
1116
1116
  </div>
@@ -1118,36 +1118,36 @@ vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matr
1118
1118
  <div class="image-container ${t.fill?`fill`:``}">
1119
1119
  <img src="${e}" alt="${r}" />
1120
1120
  </div>
1121
- `}i=i?`<div class="media-content">${i}</div>`:``;let a=e?`<div class="text-content">${Al(e,n)}</div>`:``;return`
1121
+ `}i=i?`<div class="media-content">${i}</div>`:``;let a=e?`<div class="text-content">${jl(e,n)}</div>`:``;return`
1122
1122
  <div class="popup-scroll-wrapper">
1123
1123
  <div class="mc-popup">
1124
1124
  ${i}
1125
1125
  ${a}
1126
1126
  </div>
1127
1127
  </div>
1128
- `}var Ol=`
1128
+ `}var kl=`
1129
1129
  <button class="mc-popup-button close">
1130
- ${xl}
1130
+ ${Sl}
1131
1131
  </button>
1132
- `,kl=`
1132
+ `,Al=`
1133
1133
  <div class="cycle-buttons">
1134
1134
  <button class="mc-popup-button prev">
1135
- ${bl}
1135
+ ${xl}
1136
1136
  </button>
1137
1137
  <button class="mc-popup-button next">
1138
- ${Sl}
1138
+ ${Cl}
1139
1139
  </button>
1140
1140
  </div>
1141
- `;function Al(e,t){return e?(e=e.replace(/placeholder="[^"]+"/,``),e=e.replace(/onerror="[^"]+"/,``),e=e.replace(/youtube\.com\/embed\/\$([^"'<>\\]+)/gi,(e,n)=>{let r=S(t[n]);return r?`youtube.com/embed/${w(r)}?`:``}),e=e.replace(/(\S+?)\s*=\s*"\$([^"]+?)"/g,(e,n,r)=>{let i=S(t[r]);return[`src`,`href`].includes(n)&&!i?``:[`src`,`href`].includes(n)?/^(mailto:|tel:|ftp:|data:|http:\/\/|https:\/\/)/i.test(i)?` ${n}="${i}"`:` ${n}="${jl(i)}"`:` ${n}="${i}"`}),e=e.replace(/>\$(.+?)</gi,(e,n)=>`>${S(t[n])}<`),e=e.replace(/<span\s+class="mention"\s+data-mention-id="[^"]*">(.*?)<\/span>/gim,(e,t)=>t),e):``}function jl(e){return/^https?:\/\//i.test(e)?e:`https://${e}`}function Ml(e,t){return`
1141
+ `;function jl(e,t){return e?(e=e.replace(/placeholder="[^"]+"/,``),e=e.replace(/onerror="[^"]+"/,``),e=e.replace(/youtube\.com\/embed\/\$([^"'<>\\]+)/gi,(e,n)=>{let r=S(t[n]);return r?`youtube.com/embed/${w(r)}?`:``}),e=e.replace(/(\S+?)\s*=\s*"\$([^"]+?)"/g,(e,n,r)=>{let i=S(t[r]);return[`src`,`href`].includes(n)&&!i?``:[`src`,`href`].includes(n)?/^(mailto:|tel:|ftp:|data:|http:\/\/|https:\/\/)/i.test(i)?` ${n}="${i}"`:` ${n}="${Ml(i)}"`:` ${n}="${i}"`}),e=e.replace(/>\$(.+?)</gi,(e,n)=>`>${S(t[n])}<`),e=e.replace(/<span\s+class="mention"\s+data-mention-id="[^"]*">(.*?)<\/span>/gim,(e,t)=>t),e):``}function Ml(e){return/^https?:\/\//i.test(e)?e:`https://${e}`}function Nl(e,t){return`
1142
1142
  <div class="youtube-placeholder">
1143
1143
  <img src="${`https://img.youtube.com/vi/${w(x(e,t))}/hqdefault.jpg`}" />
1144
1144
  <div class="popup-alert">
1145
- <div class="alert-icon">${Cl}</div>
1145
+ <div class="alert-icon">${wl}</div>
1146
1146
  <div>${Li(`videoAlert`)}</div>
1147
1147
  </div>
1148
1148
  </div>
1149
- `}var Nl=[`area`,`circle`,`dot`,`line`,`marker`,`polygon`],Pl=class{data;customGroupIds;constructor(e){this.data={area:{},circle:{},dot:{},line:{},marker:{},polygon:{}};for(let t of Nl)for(let n of e.registry?.models?.[t]??[]){this.data[t][n.id]={};for(let e of n.models){if(t===`area`){let t=e;t.featureId===void 0&&(t.featureId=Number(t.id),t.id=`${t.vectorUrl}-${t.id}`)}this.data[t][n.id][e.id]=e}}let{beforeWaters:t=[],beforeBoundaries:n=[],beforeNames:r=[],beforeNone:i=[]}=e.registry?.slots??{};this.customGroupIds=[...t,...n,...r,...i].map(e=>e.groupId)}getModel(e){let t=String(e.properties?.id),n=e.layer.metadata,r=n?.[`mc-group-id`],i=n?.[`mc-model-type`],a=n?.[`mc-model-id-prefix`];if(a&&(t=`${a}-${t}`),!(r===void 0||t===void 0||i===void 0))return this.data[i]?.[r]?.[t]}getPopupElements(){let e=[],t=[`circle`,`dot`,`line`,`marker`,`polygon`];for(let n of this.customGroupIds)for(let r of t){let t=this.data[r]?.[n];if(t)for(let[r,i]of Object.entries(t))(i.popup||i.popupMedia)&&e.push({groupId:n,modelId:r,popup:i.popup,popupMedia:i.popupMedia,lngLat:i.lngLat,center:i.center,radius:i.radius,anchorPoints:i.anchorPoints,dataBindings:i.dataBindings})}return e.reverse()}},Fl=class{map;popupElements;markerLayerIds;resizeObserver;constructor(e,t){this.map=e,this.popupElements=t,this.markerLayerIds=this.map.getStyle().layers.filter(e=>e.id.startsWith(`custom-marker`)).filter(e=>!e.id.endsWith(`-cluster`)).map(e=>e.id)}highlight(e){if(this.deselect(),!e)return;let{groupId:t,modelId:n}=e,r=this.popupElements.filter(e=>e.groupId===t);r.length>1&&t.startsWith(`custom-marker`)&&this.highlightGroupedMarker(t,n,r),t.startsWith(`custom-marker`)&&this.fadeOtherMarkers(t),this.repositionMap(e)}deselect(){this.markerLayerIds.forEach(e=>{this.map.setPaintProperty(e,`icon-opacity`,1),this.map.setPaintProperty(e,`text-opacity`,1)}),this.resizeObserver?.disconnect()}highlightGroupedMarker(e,t,n){let r=this.markerLayerIds.find(t=>t.startsWith(e));r&&(this.map.setPaintProperty(r,`icon-opacity`,[`case`,[`boolean`,[`feature-state`,`highlighted`],!1],1,.3]),this.map.setPaintProperty(r,`text-opacity`,[`case`,[`boolean`,[`feature-state`,`highlighted`],!1],1,.3]),n.forEach(n=>{this.map.setFeatureState({source:e,id:b(n.modelId)},{highlighted:n.modelId===t})}))}fadeOtherMarkers(e){this.markerLayerIds.filter(t=>!t.startsWith(e)).forEach(e=>{this.map.setPaintProperty(e,`icon-opacity`,.3),this.map.setPaintProperty(e,`text-opacity`,.3)})}repositionMap(e){let t,n=20;e.lngLat===void 0?e.anchorPoints===void 0?e.center!==void 0&&e.radius!==void 0&&(t=this.getElementBounds(Qn(e.center,e.radius))):t=this.getElementBounds(this.flattenCoordinates(e.anchorPoints)):(t=new u.LngLatBounds(e.lngLat,e.lngLat),n=40);let r=document.querySelector(`.popup-container`);if(!r||!t)return;this.resizeObserver?.disconnect();let i=0;this.resizeObserver=new ResizeObserver(e=>{let r=e[0].contentRect.height;r>i&&(i=r,this.panToElement(t,n))}),this.resizeObserver.observe(r)}getElementBounds(e){let t=new u.LngLatBounds(e[0],e[0]);for(let n of e)t.extend(n);return t}flattenCoordinates(e){return Array.isArray(e[0][0])?e.flat():e}panToElement(e,t){let n=this.map;if(n.getProjection()?.type===`globe`&&[e.getSouthWest(),e.getNorthEast(),e.getNorthWest(),e.getSouthEast()].some(e=>!this.visibleOnGlobe(e.lng,e.lat))){n.easeTo({center:e.getCenter(),duration:500});return}let r=n.projectWithScaleCorrection(e.getSouthWest()),i=n.projectWithScaleCorrection(e.getNorthEast()),a=n.getContainer().clientWidth,o=n.getContainer().clientHeight,s=a>600,c=document.querySelector(`.popup-container`)?.getBoundingClientRect(),l=c?.width??0,u=c?.height??0;s||(u=Math.min(u,o/2));let d=o-r.y>u+t,f=r.x>t+(s&&!d?l:0),p=i.x<a-t,m=i.y>t,h=s?r.y<o-t:d;if(!(f&&p&&m&&h))if(i.x-r.x+2*t<a&&r.y-i.y+2*t<o){let t=e.getCenter();n.easeTo({center:t,duration:500,offset:s?[0,0]:[0,-30]})}else n.fitBounds(e,{padding:t,maxZoom:n.getZoom(),duration:500,linear:!0})}visibleOnGlobe(e,t){let{lng:n,lat:r}=this.map.getCenter(),i=this.map.getPitch()*Math.PI/180,a=this.map.getBearing()*Math.PI/180,o=this.lngLatToUnitVector(n,r),s=this.lngLatToUnitVector(e,t),c=this.normalize(this.cross([0,0,1],o)),l=this.rotateAroundZ(c,a),u=this.rotateVectorAroundAxis(o,l,i);return u[0]*s[0]+u[1]*s[1]+u[2]*s[2]>.3}lngLatToUnitVector(e,t){let n=t*Math.PI/180,r=e*Math.PI/180;return[Math.cos(n)*Math.cos(r),Math.cos(n)*Math.sin(r),Math.sin(n)]}rotateVectorAroundAxis(e,t,n){let[r,i,a]=e,[o,s,c]=t,l=Math.cos(n),u=Math.sin(n),d=r*o+i*s+a*c;return[r*l+(s*a-c*i)*u+o*d*(1-l),i*l+(c*r-o*a)*u+s*d*(1-l),a*l+(o*i-s*r)*u+c*d*(1-l)]}rotateAroundZ(e,t){let[n,r,i]=e,a=Math.cos(t),o=Math.sin(t);return[n*a-r*o,n*o+r*a,i]}cross(e,t){let[n,r,i]=e,[a,o,s]=t;return[r*s-i*o,i*a-n*s,n*o-r*a]}normalize(e){let[t,n,r]=e,i=Math.hypot(t,n,r);return[t/i,n/i,r/i]}},Il=class{map;popupPosition=`bottomLeft`;mapContainer;popupContainer;feature;currentFeatureId;currentModelId;popupElements=[];language=`en`;promoteIdCache=new Map;publication;floatingPopup;registry;highlightManager;mode;restrictMapMovement;center;constructor(e,t){this.map=e,this.mode=t,this.mapContainer=this.map.getContainer(),this.popupContainer=document.createElement(`div`),this.popupContainer.classList.add(`popup-container`),this.map.on(`mousemove`,e=>this.onMouseMove(e)),this.map.on(`click`,e=>this.onClick(e))}setJobObject(e){this.registry=new Pl(e)}setParams(e,t,n,r){this.popupPosition=e,this.language=t,this.restrictMapMovement=n,this.center=r}setPublication(e){this.publication=e}setpopupElements(){this.popupElements=this.registry.getPopupElements()}setHighlightManager(){this.highlightManager=new Fl(this.map,this.registry.getPopupElements())}onMouseMove(e){this.feature=this.getInteractiveFeature(e),this.feature?this.map.getCanvas().style.cursor=`pointer`:this.map.getCanvas().style.cursor=``}onClick(e){this.feature=this.getInteractiveFeature(e),this.currentModelId=this.feature?.properties?.id,this.feature&&(!this.mapContainer.contains(this.popupContainer)||this.feature?.id!==this.currentFeatureId)?(this.addPopup(e),this.highlightManager?.highlight(this.getPopupElementFromFeature(this.feature))):(this.hidePopup(),this.highlightManager?.highlight(void 0))}getPopupElementFromFeature(e){return this.popupElements.find(t=>t.modelId===e.properties.id)}getInteractiveFeature(e){return this.map.queryRenderedFeatures(e.point).find(e=>{if(Object.keys(e.layer.metadata??{}).some(e=>e.startsWith(`mc-interactivity-template`)))return!0;let t=this.registry.getModel(e);return!!(t?.popup??t?.popupMedia)})}addPopup(e){if(!this.feature)return;this.floatingPopup?.remove();let t=Number(this.feature.id);this.currentFeatureId=isNaN(t)?this.feature.id:t;let n=this.getTemplate(this.feature);if(n){if(this.popupPosition===`mapElement`){if(this.feature.geometry.type===`Point`)this.addFloatingPopup(n,this.feature.geometry.coordinates);else{let{lng:t,lat:r}=this.map.unproject(e.point);this.addFloatingPopup(n,[t,r])}return}this.popupContainer.innerHTML=n,this.popupElements.find(e=>e.modelId===this.currentModelId)&&this.addPopupControls(),this.mapContainer.appendChild(this.popupContainer)}}addFloatingPopup(e,t){let n=this.restrictMapMovement?this.getAnchor(t):void 0;this.floatingPopup=new u.Popup({maxWidth:`none`,closeButton:!1,offset:20,...n!==void 0&&{anchor:n}}).setLngLat(t).setHTML(e).addTo(this.map)}getAnchor(e){let t=this.map.projectWithScaleCorrection(e),n=this.map.getContainer().clientWidth,r=this.map.getContainer().clientHeight,i,a;return i=t.y<r*.33?`top`:t.y>r*.66?`bottom`:`center`,a=t.x<n*.33?`left`:t.x>n*.66?`right`:`center`,i===`center`&&a===`center`?`bottom`:i===`center`?a:a===`center`?i:`${i}-${a}`}hidePopup(){this.popupContainer&&(this.popupContainer.remove(),this.feature=void 0,this.currentFeatureId=void 0),this.restrictMapMovement&&this.center&&this.map.easeTo({center:this.center})}getTemplate(e){let{layer:t}=e,n,r=this.registry.getModel(e);if(r?.popup||r?.popupMedia)n=Dl(r.popup,r.popupMedia,r.dataBindings??{},this.mode);else{let r=[];this.publication&&(r.push(`:${this.publication}-${this.language}`),r.push(`:${this.publication}-:en`)),r.push(`:${this.language}`),r.push(`:en`),r.push(``);for(let i of r){let r=t.metadata?.[`mc-interactivity-template${i}`];if(r){n=this.fillDatalayerTemplate(e,r,i);break}}n&&=`
1149
+ `}var Pl=[`area`,`circle`,`dot`,`line`,`marker`,`polygon`],Fl=class{data;customGroupIds;constructor(e){this.data={area:{},circle:{},dot:{},line:{},marker:{},polygon:{}};for(let t of Pl)for(let n of e.registry?.models?.[t]??[]){this.data[t][n.id]={};for(let e of n.models){if(t===`area`){let t=e;t.featureId===void 0&&(t.featureId=Number(t.id),t.id=`${t.vectorUrl}-${t.id}`)}this.data[t][n.id][e.id]=e}}let{beforeWaters:t=[],beforeBoundaries:n=[],beforeNames:r=[],beforeNone:i=[]}=e.registry?.slots??{};this.customGroupIds=[...t,...n,...r,...i].map(e=>e.groupId)}getModel(e){let t=String(e.properties?.id),n=e.layer.metadata,r=n?.[`mc-group-id`],i=n?.[`mc-model-type`],a=n?.[`mc-model-id-prefix`];if(a&&(t=`${a}-${t}`),!(r===void 0||t===void 0||i===void 0))return this.data[i]?.[r]?.[t]}getPopupElements(){let e=[],t=[`circle`,`dot`,`line`,`marker`,`polygon`];for(let n of this.customGroupIds)for(let r of t){let t=this.data[r]?.[n];if(t)for(let[r,i]of Object.entries(t))(i.popup||i.popupMedia)&&e.push({groupId:n,modelId:r,popup:i.popup,popupMedia:i.popupMedia,lngLat:i.lngLat,center:i.center,radius:i.radius,anchorPoints:i.anchorPoints,dataBindings:i.dataBindings})}return e.reverse()}},Il=class{map;popupElements;markerLayerIds;resizeObserver;constructor(e,t){this.map=e,this.popupElements=t,this.markerLayerIds=this.map.getStyle().layers.filter(e=>e.id.startsWith(`custom-marker`)).filter(e=>!e.id.endsWith(`-cluster`)).map(e=>e.id)}highlight(e){if(this.deselect(),!e)return;let{groupId:t,modelId:n}=e,r=this.popupElements.filter(e=>e.groupId===t);r.length>1&&t.startsWith(`custom-marker`)&&this.highlightGroupedMarker(t,n,r),t.startsWith(`custom-marker`)&&this.fadeOtherMarkers(t),this.repositionMap(e)}deselect(){this.markerLayerIds.forEach(e=>{this.map.setPaintProperty(e,`icon-opacity`,1),this.map.setPaintProperty(e,`text-opacity`,1)}),this.resizeObserver?.disconnect()}highlightGroupedMarker(e,t,n){let r=this.markerLayerIds.find(t=>t.startsWith(e));r&&(this.map.setPaintProperty(r,`icon-opacity`,[`case`,[`boolean`,[`feature-state`,`highlighted`],!1],1,.3]),this.map.setPaintProperty(r,`text-opacity`,[`case`,[`boolean`,[`feature-state`,`highlighted`],!1],1,.3]),n.forEach(n=>{this.map.setFeatureState({source:e,id:b(n.modelId)},{highlighted:n.modelId===t})}))}fadeOtherMarkers(e){this.markerLayerIds.filter(t=>!t.startsWith(e)).forEach(e=>{this.map.setPaintProperty(e,`icon-opacity`,.3),this.map.setPaintProperty(e,`text-opacity`,.3)})}repositionMap(e){let t,n=20;e.lngLat===void 0?e.anchorPoints===void 0?e.center!==void 0&&e.radius!==void 0&&(t=this.getElementBounds(Qn(e.center,e.radius))):t=this.getElementBounds(this.flattenCoordinates(e.anchorPoints)):(t=new u.LngLatBounds(e.lngLat,e.lngLat),n=40);let r=document.querySelector(`.popup-container`);if(!r||!t)return;this.resizeObserver?.disconnect();let i=0;this.resizeObserver=new ResizeObserver(e=>{let r=e[0].contentRect.height;r>i&&(i=r,this.panToElement(t,n))}),this.resizeObserver.observe(r)}getElementBounds(e){let t=new u.LngLatBounds(e[0],e[0]);for(let n of e)t.extend(n);return t}flattenCoordinates(e){return Array.isArray(e[0][0])?e.flat():e}panToElement(e,t){let n=this.map;if(n.getProjection()?.type===`globe`&&[e.getSouthWest(),e.getNorthEast(),e.getNorthWest(),e.getSouthEast()].some(e=>!this.visibleOnGlobe(e.lng,e.lat))){n.easeTo({center:e.getCenter(),duration:500});return}let r=n.projectWithScaleCorrection(e.getSouthWest()),i=n.projectWithScaleCorrection(e.getNorthEast()),a=n.getContainer().clientWidth,o=n.getContainer().clientHeight,s=a>600,c=document.querySelector(`.popup-container`)?.getBoundingClientRect(),l=c?.width??0,u=c?.height??0;s||(u=Math.min(u,o/2));let d=o-r.y>u+t,f=r.x>t+(s&&!d?l:0),p=i.x<a-t,m=i.y>t,h=s?r.y<o-t:d;if(!(f&&p&&m&&h))if(i.x-r.x+2*t<a&&r.y-i.y+2*t<o){let t=e.getCenter();n.easeTo({center:t,duration:500,offset:s?[0,0]:[0,-30]})}else n.fitBounds(e,{padding:t,maxZoom:n.getZoom(),duration:500,linear:!0})}visibleOnGlobe(e,t){let{lng:n,lat:r}=this.map.getCenter(),i=this.map.getPitch()*Math.PI/180,a=this.map.getBearing()*Math.PI/180,o=this.lngLatToUnitVector(n,r),s=this.lngLatToUnitVector(e,t),c=this.normalize(this.cross([0,0,1],o)),l=this.rotateAroundZ(c,a),u=this.rotateVectorAroundAxis(o,l,i);return u[0]*s[0]+u[1]*s[1]+u[2]*s[2]>.3}lngLatToUnitVector(e,t){let n=t*Math.PI/180,r=e*Math.PI/180;return[Math.cos(n)*Math.cos(r),Math.cos(n)*Math.sin(r),Math.sin(n)]}rotateVectorAroundAxis(e,t,n){let[r,i,a]=e,[o,s,c]=t,l=Math.cos(n),u=Math.sin(n),d=r*o+i*s+a*c;return[r*l+(s*a-c*i)*u+o*d*(1-l),i*l+(c*r-o*a)*u+s*d*(1-l),a*l+(o*i-s*r)*u+c*d*(1-l)]}rotateAroundZ(e,t){let[n,r,i]=e,a=Math.cos(t),o=Math.sin(t);return[n*a-r*o,n*o+r*a,i]}cross(e,t){let[n,r,i]=e,[a,o,s]=t;return[r*s-i*o,i*a-n*s,n*o-r*a]}normalize(e){let[t,n,r]=e,i=Math.hypot(t,n,r);return[t/i,n/i,r/i]}},Ll=class{map;popupPosition=`bottomLeft`;mapContainer;popupContainer;feature;currentFeatureId;currentModelId;popupElements=[];language=`en`;promoteIdCache=new Map;publication;floatingPopup;registry;highlightManager;mode;restrictMapMovement;center;constructor(e,t){this.map=e,this.mode=t,this.mapContainer=this.map.getContainer(),this.popupContainer=document.createElement(`div`),this.popupContainer.classList.add(`popup-container`),this.map.on(`mousemove`,e=>this.onMouseMove(e)),this.map.on(`click`,e=>this.onClick(e))}setJobObject(e){this.registry=new Fl(e)}setParams(e,t,n,r){this.popupPosition=e,this.language=t,this.restrictMapMovement=n,this.center=r}setPublication(e){this.publication=e}setpopupElements(){this.popupElements=this.registry.getPopupElements()}setHighlightManager(){this.highlightManager=new Il(this.map,this.registry.getPopupElements())}onMouseMove(e){this.feature=this.getInteractiveFeature(e),this.feature?this.map.getCanvas().style.cursor=`pointer`:this.map.getCanvas().style.cursor=``}onClick(e){this.feature=this.getInteractiveFeature(e),this.currentModelId=this.feature?.properties?.id,this.feature&&(!this.mapContainer.contains(this.popupContainer)||this.feature?.id!==this.currentFeatureId)?(this.addPopup(e),this.highlightManager?.highlight(this.getPopupElementFromFeature(this.feature))):(this.hidePopup(),this.highlightManager?.highlight(void 0))}getPopupElementFromFeature(e){return this.popupElements.find(t=>t.modelId===e.properties.id)}getInteractiveFeature(e){return this.map.queryRenderedFeatures(e.point).find(e=>{if(Object.keys(e.layer.metadata??{}).some(e=>e.startsWith(`mc-interactivity-template`)))return!0;let t=this.registry.getModel(e);return!!(t?.popup??t?.popupMedia)})}addPopup(e){if(!this.feature)return;this.floatingPopup?.remove();let t=Number(this.feature.id);this.currentFeatureId=isNaN(t)?this.feature.id:t;let n=this.getTemplate(this.feature);if(n){if(this.popupPosition===`mapElement`){if(this.feature.geometry.type===`Point`)this.addFloatingPopup(n,this.feature.geometry.coordinates);else{let{lng:t,lat:r}=this.map.unproject(e.point);this.addFloatingPopup(n,[t,r])}return}this.popupContainer.innerHTML=n,this.popupElements.find(e=>e.modelId===this.currentModelId)&&this.addPopupControls(),this.mapContainer.appendChild(this.popupContainer)}}addFloatingPopup(e,t){let n=this.restrictMapMovement?this.getAnchor(t):void 0;this.floatingPopup=new u.Popup({maxWidth:`none`,closeButton:!1,offset:20,...n!==void 0&&{anchor:n}}).setLngLat(t).setHTML(e).addTo(this.map)}getAnchor(e){let t=this.map.projectWithScaleCorrection(e),n=this.map.getContainer().clientWidth,r=this.map.getContainer().clientHeight,i,a;return i=t.y<r*.33?`top`:t.y>r*.66?`bottom`:`center`,a=t.x<n*.33?`left`:t.x>n*.66?`right`:`center`,i===`center`&&a===`center`?`bottom`:i===`center`?a:a===`center`?i:`${i}-${a}`}hidePopup(){this.popupContainer&&(this.popupContainer.remove(),this.feature=void 0,this.currentFeatureId=void 0),this.restrictMapMovement&&this.center&&this.map.easeTo({center:this.center})}getTemplate(e){let{layer:t}=e,n,r=this.registry.getModel(e);if(r?.popup||r?.popupMedia)n=Ol(r.popup,r.popupMedia,r.dataBindings??{},this.mode);else{let r=[];this.publication&&(r.push(`:${this.publication}-${this.language}`),r.push(`:${this.publication}-:en`)),r.push(`:${this.language}`),r.push(`:en`),r.push(``);for(let i of r){let r=t.metadata?.[`mc-interactivity-template${i}`];if(r){n=this.fillDatalayerTemplate(e,r,i);break}}n&&=`
1150
1150
  <div class="popup-scroll-wrapper">
1151
1151
  <div class="mc-popup data-layer text-content">${n}</div>
1152
1152
  </div>
1153
- `}return n}htmlToElement(e){let t=document.createElement(`template`);return t.innerHTML=e.trim(),t.content.firstElementChild}addPopupControls(){let e=this.htmlToElement(Ol);if(e&&(e.addEventListener(`click`,()=>{this.hidePopup(),this.highlightManager.highlight(void 0)}),this.popupContainer.appendChild(e)),this.popupElements.length<2)return;let t=this.htmlToElement(kl);t&&(t.querySelector(`.prev`)?.addEventListener(`click`,()=>this.cyclePopups(!1)),t.querySelector(`.next`)?.addEventListener(`click`,()=>this.cyclePopups()),this.popupContainer.appendChild(t))}fillDatalayerTemplate(e,t,n){let r=`data-mention-id`,i=new DOMParser().parseFromString(t,`text/html`).body;for(let t of i.querySelectorAll(`[${r}]`)){let i=this.getProperty(e,t.getAttribute(r),n);i!==void 0&&(t.innerText=i)}return i.innerHTML}getProperty(e,t,n){if(!t)return;let r=t.endsWith(`:en`)?[t.replace(`:en`,n),t]:[t];for(let t of r){let n=e.properties[t]??this.getVectorProperty(e,t);if(n!==void 0)return n}}getVectorProperty(e,t){let n=this.promoteIdCache.get(e.source);n===void 0&&(n=this.map.getSource(e.source)?.serialize().promoteId||`id`,this.promoteIdCache.set(e.source,n));try{let r=e.properties[n];return e.layer.metadata.properties[t][r]}catch{return}}cyclePopups(e=!0){let t=this.popupElements?.findIndex(e=>e.modelId===this.currentModelId);if(t!==-1){let n=0;n=e?t===this.popupElements.length-1?0:t+1:t===0?this.popupElements.length-1:t-1;let r=this.popupElements?.[n];this.highlightManager.highlight(r);let i=Dl(r.popup,r.popupMedia,r.dataBindings??{},this.mode),a=this.popupContainer;this.popupContainer.remove(),a.innerHTML=i,this.mapContainer.appendChild(a),this.currentModelId=r.modelId,this.addPopupControls(),e?this.popupContainer.querySelector(`.mc-popup-button.next`)?.focus():this.popupContainer.querySelector(`.mc-popup-button.prev`)?.focus(),this.currentFeatureId=void 0}}},Ll={solid:[1,0],dotted:[.7,.3],dashed:[3.5,1.5]};function Rl(e,t,n,r){e.addSource(t.id,{type:`geojson`,data:{type:`FeatureCollection`,features:t.models.filter(e=>e.visible??!0).map(n=>zl(e,t,n,r))}}),Object.entries(Ll).forEach(([r,i])=>{t.models.some(e=>(e.lineStyle??`solid`)===r)&&e.addLayer({id:`${t.id}-${r}`,type:`line`,source:t.id,metadata:{"mc-model-type":`line`,"mc-group-id":t.id},filter:[`all`,[`==`,[`geometry-type`],`LineString`],[`==`,[`get`,`line-style`],r]],paint:{"line-width":[`get`,`line-width`],"line-color":[`get`,`line-color`],"line-dasharray":i}},n)}),e.addLayer({id:`${t.id}-clickable`,type:`line`,source:t.id,metadata:{"mc-model-type":`line`,"mc-group-id":t.id},paint:{"line-width":[`max`,[`get`,`line-width`],15],"line-opacity":0},filter:[`==`,[`geometry-type`],`LineString`]},n),t.models.some(e=>e.svg)&&e.addLayer({id:`${t.id}-icon`,type:`symbol`,source:t.id,metadata:{"mc-model-type":`line`,"mc-group-id":t.id},layout:{"icon-allow-overlap":!0,"icon-ignore-placement":!0,"icon-image":[`get`,`mc-image-key`],"icon-anchor":`center`,"icon-size":[`get`,`icon-size`],"icon-rotate":[`get`,`icon-rotate`],"icon-offset":[`get`,`icon-offset`]},filter:[`==`,[`geometry-type`],`Point`]},n)}function zl(e,t,n,r){let i=n.svg===void 0?void 0:r.getMapLibreImageKey(Ur(n.dataBindings??{},n.svg,void 0),window.devicePixelRatio*(n.iconScale??1));return{type:`Feature`,id:b(n.id),properties:{id:n.id,"line-width":n.lineWidth??3,"line-color":t.lineColor||n.lineColor?Vr(n.dataBindings??{},n.lineColor,t.lineColor):`#000000`,"line-style":n.lineStyle??`solid`,"mc-image-key":i,"icon-rotate":Bl(n,e),"icon-offset":n.iconOffset,"icon-size":n.iconScale},geometry:{type:`GeometryCollection`,geometries:[{type:`LineString`,coordinates:n.geometry},{type:`Point`,coordinates:n.geometry[n.geometry.length-1]}]}}}function Bl(e,t){return e.iconRotation?e.iconAlign?sr(e.geometry,t)+e.iconRotation:e.iconRotation:0}function Vl(e,t,n,r,i,a,o){let s=mr(t),c=new Map,l=new Map;for(let e of t.models){let n=e.featureId,a=t.id,o=[],u=ar(e),d=ir(a,e),f=l.get(d)??{model:e,featureIds:o,modelIdToFillColor:{},modelIdToFillPattern:{},modelIdToOutlineColor:{},modelIdToOutlineWidth:{}};if(e.visible??!0){f.featureIds.push(n);let a=e.fillPattern===void 0?null:i.getMapLibreImageKey(r[e.fillPattern],2*window.devicePixelRatio);f.modelIdToFillColor[n]=t.fillColor||e.fillColor?Vr(e.dataBindings??{},e.fillColor,t.fillColor,s,t.choropleth?.unmatchedColor):`#000000`,f.modelIdToFillPattern[n]=a,f.modelIdToOutlineColor[n]=t.outlineColor||e.outlineColor?Vr(e.dataBindings??{},e.outlineColor,t.outlineColor):`#000000`,f.modelIdToOutlineWidth[n]=e.outlineWidth??.5}c.set(u,e),l.set(d,f)}for(let t of c.keys())e.getSource(t)||e.addSource(t,{type:`vector`,url:`${a}${c.get(t).vectorUrl}?access_token=${o}`});for(let r of l.keys()){let{model:i}=l.get(r),{sourceLayerId:a}=i,o=ar(i);e.addLayer({id:r,type:`fill`,source:o,"source-layer":a,filter:[`literal`,!1],metadata:{"mc-model-type":`area`,"mc-model-id-prefix":i.vectorUrl,"mc-group-id":t.id},paint:{"fill-color":`#ffffff`,"fill-outline-color":`#000000`,"fill-antialias":!1}},n),e.addLayer({id:`${r}-pattern`,type:`fill`,source:o,"source-layer":a,filter:[`literal`,!1],metadata:{"mc-model-type":`area`,"mc-model-id-prefix":i.vectorUrl,"mc-group-id":t.id},paint:{"fill-pattern":[`get`,`fill-pattern`]},layout:{visibility:`visible`}},n),e.addLayer({id:`${r}-outline`,type:`line`,source:o,"source-layer":a,filter:[`literal`,!1],metadata:{"mc-model-type":`area`,"mc-model-id-prefix":i.vectorUrl,"mc-group-id":t.id},paint:{"line-color":`#000000`,"line-width":.5}},n)}l.forEach((t,n)=>{let{featureIds:r,modelIdToFillColor:i,modelIdToFillPattern:a,modelIdToOutlineColor:o,modelIdToOutlineWidth:s}=t;e.setFilter(n,[`in`,`id`,...r]),e.setFilter(`${n}-outline`,[`in`,`id`,...r]),e.setPaintProperty(n,`fill-color`,[`get`,[`case`,[`==`,[`typeof`,[`get`,`id`]],`number`],[`to-string`,[`get`,`id`]],[`get`,`id`]],[`literal`,i]]),e.setPaintProperty(`${n}-outline`,`line-color`,[`get`,[`case`,[`==`,[`typeof`,[`get`,`id`]],`number`],[`to-string`,[`get`,`id`]],[`get`,`id`]],[`literal`,o]]),e.setPaintProperty(`${n}-outline`,`line-width`,[`get`,[`case`,[`==`,[`typeof`,[`get`,`id`]],`number`],[`to-string`,[`get`,`id`]],[`get`,`id`]],[`literal`,s]]),e.setFilter(`${n}-pattern`,[`to-boolean`,[`get`,[`case`,[`==`,[`typeof`,[`get`,`id`]],`number`],[`to-string`,[`get`,`id`]],[`get`,`id`]],[`literal`,a]]]),e.setPaintProperty(`${n}-pattern`,`fill-pattern`,[`get`,[`case`,[`==`,[`typeof`,[`get`,`id`]],`number`],[`to-string`,[`get`,`id`]],[`get`,`id`]],[`literal`,a]])})}function Hl(e,t,n){e.addSource(t.id,{type:`geojson`,data:{type:`FeatureCollection`,features:t.models.filter(e=>e.visible??!0).map(e=>Ul(t,e))}}),e.addLayer({id:t.id,type:`circle`,source:t.id,metadata:{"mc-model-type":`dot`,"mc-group-id":t.id},paint:{"circle-color":[`get`,`circle-color`],"circle-radius":[`get`,`circle-radius`]}},n)}function Ul(e,t){return{type:`Feature`,id:t.id,properties:{id:t.id,"circle-radius":t.radius,"circle-color":e.fillColor||t.fillColor?Vr(t.dataBindings??{},t.fillColor,e.fillColor):`#000000`},geometry:{type:`Point`,coordinates:[t.center.lng,t.center.lat]}}}function Wl(e){let t=e.length>0?[Gl(e[0])]:[],n=0,r=0;for(let i=1;i<e.length;++i){let a=Gl(e[i]);n+=Kl(e[i-1].center[0],a.center[0]),r+=Kl(e[i-1].bearing,a.bearing),a.center[0]+=n*360,a.x+=n,a.bearing+=r*360,t.push(a)}return t}function Gl(e){return{...e,center:[e.center[0],e.center[1]]}}function Kl(e,t){if(Math.abs(e)+Math.abs(t)>180){if(e>0&&t<0)return 1;if(e<0&&t>0)return-1}return 0}function ql(e){return 2**-e}function Jl(e){return e.length>0?e[e.length-1].time:0}function Yl(e){return e<0?-1:1}function Xl(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(Yl(a)+Yl(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Zl(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Ql(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function $l(e){this._context=e}$l.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ql(this,this._t0,Zl(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Ql(this,Zl(this,n=Xl(this,e,t)),n);break;default:Ql(this,this._t0,n=Xl(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function eu(e){this._context=new tu(e)}(eu.prototype=Object.create($l.prototype)).point=function(e,t){$l.prototype.point.call(this,t,e)};function tu(e){this._context=e}tu.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function nu(e){return new $l(e)}function ru(e){return e}var{cbrt:iu,sqrt:au,PI:ou}=Math,su=(e,t,n,r,i)=>{let a=t+n*e,o=a**2+r;if(o>0){let e=au(o);return iu(a+e)+iu(a-e)-i}let s=iu(au(a*a-o)),c=a?Math.atan(au(-o)/a):-ou/2,l;return l=n<0?(a>0?2*ou:ou)-c:i<0?(a>0?2*ou:-3*ou)+c:(a>0?0:ou)+c,2*s*Math.cos(l/3)-i},cu=(e,t,n,r)=>((t*e+3*n)*e+r)*e;function lu(e,t,n,r){if(!(0<=e&&e<=1&&0<=n&&n<=1))throw Error(`bezier x values must be in [0, 1] range`);if(e===t&&n===r)return ru;let i=6*(3*e-3*n+1),a=6*(n-2*e),o=3*e,s=i*i,c=a*a,l=a/i,u=3*a*o/s-c*a/(s*i),d=2*o/i-c/s,f=d*d*d,p=3/i,m=3*t-3*r+1,h=r-2*t,g=3*t,_=i?su:ru;return function(e){return e===0||e===1?e:cu(_(e,u,p,f,l),m,h,g)}}var uu=l(s(((e,t)=>{t.exports=n;function n(e,t,n,r){var i,a,o,s,c,l,u,d,f,p,m,h,g,_;for(typeof t!=`function`&&(r=n,n=t,t=null),r||={},s=r.tolerance===void 0?1e-7:r.tolerance,_=r.epsilon===void 0?2220446049250313e-31:r.epsilon,c=r.maxIterations===void 0?20:r.maxIterations,m=r.h===void 0?1e-4:r.h,g=r.verbose===void 0?!1:r.verbose,h=1/m,l=0;l++<c;){if(a=e(n),t?o=t(n):(u=e(n+m),d=e(n-m),f=e(n+2*m),p=e(n-2*m),o=(p-f+8*(u-d))*h/12),Math.abs(o)<=_*Math.abs(a))return g&&console.log(`Newton-Raphson: failed to converged due to nearly zero first derivative`),!1;if(i=n-a/o,Math.abs(i-n)<=s*Math.abs(i))return g&&console.log(`Newton-Raphson: converged to x = `+i+` after `+l+` iterations`),i;n=i}return g&&console.log(`Newton-Raphson: Maximum iterations reached (`+c+`)`),!1}}))(),1),du=class{segments;constructor(e){this.segments=[];let t=new fu,n=nu(t);n.lineStart();for(let t of e)n.point(t.x,t.y);n.lineEnd(),this.segments=t.segments}sample(e){if(e<=0)return this.segments[0].startY;if(e>=this.segments[this.segments.length-1].endX)return this.segments[this.segments.length-1].endY;let t=this.segments.find(t=>e>=t.startX&&e<t.endX),n=O(t.startX,t.endX,e);return t.startY!==t.endY&&t.easing!==void 0?D(t.startY,t.endY,t.easing(n)):D(t.startY,t.endY,n)}solve(e,t){let n=(0,uu.default)(t=>this.sample(t)-e,t);return n===!1?t:n}},fu=class{previousPoint={x:0,y:0};segments=[];bezierCurveTo(e,t,n,r,i,a){let o=this.previousPoint.x,s=this.previousPoint.y,c=i===o?void 0:lu((e-o)/(i-o),(t-s)/(a-s),(n-o)/(i-o),(r-s)/(a-s));this.segments.push({startX:o,endX:i,startY:s,endY:a,easing:c}),this.previousPoint={x:i,y:a}}lineTo(e,t){this.segments.push({startX:this.previousPoint.x,endX:e,startY:this.previousPoint.y,endY:t,easing:void 0}),this.previousPoint={x:e,y:t}}moveTo(e,t){this.previousPoint={x:e,y:t}}closePath(){}arc(){}rect(){}arcTo(){}quadraticCurveTo(){}};function pu(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}var mu=class{script;xCurve;yCurve;fovCurve;zoomCurve;pitchCurve;bearingCurve;altitudeCurve;elevationCurve;constructor(e){this.script=Wl(e),this.xCurve=this.createMonotonicCurve(this.script,`x`),this.yCurve=this.createMonotonicCurve(this.script,`y`),this.fovCurve=this.createMonotonicCurve(this.script,`fov`),this.zoomCurve=this.createMonotonicCurve(this.script,`zoom`),this.pitchCurve=this.createMonotonicCurve(this.script,`pitch`),this.bearingCurve=this.createMonotonicCurve(this.script,`bearing`),this.altitudeCurve=this.createMonotonicCurve(this.script,`altitude`),this.elevationCurve=this.createMonotonicCurve(this.script,`elevation`)}sample(e){let t=this.zoomCurve.sample(e),n=this.altitudeCurve.solve(ql(t),e),r=this.xCurve.sample(n),i=this.yCurve.sample(n),a=this.elevationCurve.sample(n),o=this.bearingCurve.sample(e),s=this.pitchCurve.sample(e),c=this.fovCurve.sample(e);return{center:new u.MercatorCoordinate(r,i).toLngLat(),zoom:t,bearing:o,pitch:s,fov:c,elevation:a}}createMonotonicCurve(e,t){let n=[];for(let r=0;r<e.length;r++){let i=r===0,a=r===e.length-1,o=e[r],s=e[r+1],c=e[r-1],l=this.getKeyframeValue(o,t);if(i&&n.push({x:-1,y:l}),n.push({x:o.time,y:l}),!i&&!a&&c.transition===`instant`&&o.transition===`ease`&&n.push({x:o.time+.1,y:l}),!a)if(o.transition===`linear`){let e=o.time+.1,r=s.time-.1,i=O(o.time,s.time,e),a=O(o.time,s.time,r),c=this.getKeyframeValue(s,t);n.push({x:e,y:D(l,c,i)}),n.push({x:r,y:D(l,c,a)})}else o.transition===`instant`&&(n.push({x:o.time+.1,y:l}),n.push({x:s.time-.1,y:l}));a&&n.push({x:o.time+1,y:l})}return new du(n)}sampleAutoHideOpacity(e){let t=this.script;if(t.length<2)return 1;let n=this.getKeyframeIndexByTime(e);if(n===-1||n===t.length-1)return 1;let r=t[n],i=t[n+1],a=n>0?t[n-1]:void 0,o;if(r.hideLabels===(a?.hideLabels??!1))o=r.hideLabels?0:1;else{let t=e-r.time,n=Math.min(400,i.time-r.time);o=k(pu(t,r.hideLabels?1:0,r.hideLabels?-1:1,n),0,1)}let s;if(n===t.length-2&&r.hideLabels){let t=Math.max(r.time,i.time-400);s=k(pu(e-t,0,1,i.time-t),0,1)}else s=0;return Math.max(o,s)}getKeyframeIndexByTime(e){let t=this.script;if(t.length!==0){for(let n=0;n<t.length;n++)if(e<t[n].time)return n-1;return t.length-1}}getKeyframeValue(e,t){return t===`altitude`?ql(e.zoom):e[t]}},hu=gu;function gu(e,t,n){var r=null,i=null,a=function(){r&&=(clearTimeout(r),i=null,null)},o=function(){var e=i;a(),e&&e()},s=function(){if(!t)return e.apply(this,arguments);var o=this,s=arguments,c=n&&!r;if(a(),i=function(){e.apply(o,s)},r=setTimeout(function(){if(r=null,!c){var e=i;return i=null,e()}},t),c)return i()};return s.cancel=a,s.flush=o,s}var _u=class extends u.Evented{map;jobObject;cameraCurve;duration;playhead;playbackContext;constructor(e,t){super(),this.map=e,this.jobObject=t,this.playhead=0,this.playbackContext=void 0;let n=(t.video?.keyframes??[]).map(e=>{let{x:t,y:n}=u.MercatorCoordinate.fromLngLat(e.center);return{...e,x:t,y:n,fov:e.fov??36.87,elevation:e.elevation??0}});this.duration=Jl(n),this.cameraCurve=new mu(n)}on(e,t){return super.on(e,t)}once(e,t){return super.once(e,t)}off(e,t){return super.off(e,t)}fire(e,t){return super.fire(e,t)}play(){this.playbackContext===void 0&&this.duration>0&&(this.playhead>=this.duration&&(this.playhead=0),this.playbackContext={startTime:Date.now(),startPlayhead:this.playhead},this.fire(`playstart`,{time:this.playhead}),this.playFrame())}pause(){this.playbackContext!==void 0&&(this.playbackContext=void 0,this.fire(`playend`,{time:this.playhead}))}seekTo(e){this.duration>0&&(e=k(e,0,this.duration),this.setCamera(e),this.playbackContext!==void 0&&(this.playbackContext={startTime:Date.now(),startPlayhead:e}))}playFrame(){if(this.playbackContext!==void 0){let e=this.playbackContext.startPlayhead+(Date.now()-this.playbackContext.startTime);e>this.duration?(this.setCamera(this.duration),this.playbackContext=void 0,this.fire(`playend`,{time:this.playhead})):(this.setCamera(e),requestAnimationFrame(()=>this.playFrame()))}}setCamera(e){this.playhead=e;let t=this.map,n=this.cameraCurve;this.prepareForPlayback();let r=n.sample(e),i=t.getCenter(),a=t.getZoom(),o=t.getBearing(),s=t.getPitch(),c=t.getCenterElevation(),l=t.getVerticalFieldOfView(),u=t.getScale(),d=j(this.jobObject,t.getContainer());d!==t.getScale()&&t.setScale(d),r.center.lat!==i.lat||r.center.lng!==i.lng||r.zoom!==a||r.bearing!==o||r.pitch!==s||r.elevation!==c||r.fov!==l||d!==u?(t.setVerticalFieldOfView(r.fov),t.jumpTo(r)):t.triggerRepaint(),this.fire(`play`,{time:e})}prepareForPlayback(){this.map.setCenterClampedToGround(!1),this.map.style?.stylesheet&&(this.map.style.stylesheet.transition={duration:0,delay:0}),this.restoreAfterPlayback()}restoreAfterPlayback=hu(()=>{this.map.setCenterClampedToGround(!0),this.map.style?.stylesheet&&(this.map.style.stylesheet.transition=void 0)},300)};async function vu(e){let{accessToken:t,mode:n=`sdk`,env:r=`production`}=e,i=r===`bleeding`?`https://vapi.bleeding.mc-cdn.io`:r===`beta`?`https://vapi.beta.mc-cdn.io`:`https://vapi.mc-cdn.io`,a=r===`bleeding`?`https://cdn.bleeding.mapcreator.io`:r===`beta`?`https://cdn.beta.mapcreator.io`:`https://cdn.mapcreator.io`,o=typeof e.job==`string`?await yu(e.job,a,t):e.job;await bu();let s=new u.Map({container:e.container,attributionControl:!1,style:null,maxBounds:[-1/0,-90,1/0,90],maxPitch:85,maxZoom:22,locale:{"CooperativeGesturesHandler.WindowsHelpText":Li(`windowsHelpText`),"CooperativeGesturesHandler.MacHelpText":Li(`macHelpText`),"CooperativeGesturesHandler.MobileHelpText":Li(`mobileHelpText`)}}),c=s.getContainer();c.classList.add(`mc-map`);let l=new Ir(s),f=new Il(s,n),{map:{language:m,pitch:g=0,rotation:_=0,center:v,hideBasemap:y,layerInfo:b=[],detailLevel:x=0,projection:S=`mercator`,terrain:C=!1,terrainExaggeration:w=1},registry:T={},web:E,positionOffsets:D,title:O}=o,{models:k={},slots:A={},svgs:M={}}=T;Cu(r,i,t),s.resize(),n===`app`&&(document.title=O?`${O} - Mapcreator`:`Mapcreator`),s.setPitch(g),s.setBearing(_);let N=Math.log2(j(o,c)),P=o.map.zoom-x+N;if(s.setZoom(P),s.setCenter(v),s.setDetailLevel(x),s.setMinZoom(x),s.addControl(new u.AttributionControl({compact:!1})),n===`app`&&s.cooperativeGestures.enable(),rl(o,D,s,{center:v,zoom:P,pitch:g,rotation:_},i,a,t),f.setJobObject(o),E){let{restrictMapMovement:e,popupPosition:t}=E;e&&(s.boxZoom.disable(),s.doubleClickZoom.disable(),s.dragPan.disable(),s.dragRotate.disable(),s.keyboard.disable(),s.scrollZoom.disable(),s.touchPitch.disable(),s.touchZoomRotate.disable()),f.setParams(t,h(m,p.TWO),e,v)}let F=await fetch(`${i}/styles/${o.meta.mapstyleSet}.json?access_token=${t}`).then(e=>e.json());return s.setStyle(null),s.setStyle(F),await s.once(`style.load`),n===`app`&&wu(s.getStyle().metadata?.customCssFilePath,t),d(m,s),await gl(o.meta.layers??[],s,i,t,F.metadata?.styleOverride),Eu(s,l,k,A,M,i,t),d(m,s),f.setPublication(F.metadata?.publication),f.setpopupElements(),f.setHighlightManager(),s.setProjection({type:S===`globe`?`globe`:`mercator`}),xu(s,S),C&&Su(s,i,t,w),Tu(s,s.getStyle(),b,!y),new _u(s,o)}function yu(e,t,n){return fetch(`${t}/jobs/${e}.json?access_token=${n}`).then(e=>e.json())}function bu(){return new Promise(e=>{let t=()=>{window.innerWidth>0&&window.innerHeight>0&&(window.removeEventListener(`resize`,t),e())};window.addEventListener(`resize`,t),t()})}function xu(e,t){let n=e.getStyle().metadata??{},r=n[`mc:background-color`]??`#f8f8f8`,i=n[`mc:background-color-globe`]??`#000000`;e.getContainer().style.backgroundColor=t===`globe`?i:r,e.setSky(e.getStyle().sky??$c),e.setLight({position:[1.15,210,45]})}function Su(e,t,n,r){e.addSource(`mc-dem`,{type:`raster-dem`,tiles:[`${t}/dataset/jaxa_terrainrgb/{z}/{x}/{y}?access_token=${n}`],attribution:`<a href="https://earth.jaxa.jp/en/data/policy" target="_blank">© AW3D30 (JAXA)</a>`,minzoom:0,maxzoom:12}),e.setTerrain({source:`mc-dem`,exaggeration:r})}function Cu(e,t,n){let r=`${t}/stylesheets/ff-${e===`beta`?`b-`:``}${n}.css?access_token=${n}`,i=document.createElement(`link`);i.setAttribute(`rel`,`stylesheet`),i.setAttribute(`href`,r),i.setAttribute(`type`,`text/css`),document.head.insertBefore(i,document.head.firstChild)}function wu(e,t){if(document.getElementById(`custom-style`)?.remove(),!e)return;let n;e.startsWith(`http`)?(e=`${e}?access_token=${t}`,n=document.createElement(`link`),n.setAttribute(`rel`,`stylesheet`),n.setAttribute(`href`,e.replace(/https?:/,``))):(n=document.createElement(`style`),n.appendChild(document.createTextNode(e))),n.setAttribute(`id`,`custom-style`),n.setAttribute(`type`,`text/css`),document.head.appendChild(n)}function Tu(e,t,n,r){for(let i of n){let n=t.layers.find(e=>i.id===e.id||i.id.endsWith(` | ${e.id}`));n&&e.setLayoutProperty(n.id,`visibility`,i.visibility&&r?`visible`:`none`)}}function Eu(e,t,n,r,i,a,o){let{beforeNone:s=[],beforeNames:c=[],beforeBoundaries:l=[],beforeWaters:u=[]}=r;s.forEach(r=>{Du(e,t,n,r,i,`mc-before-none`,a,o)}),c.forEach(r=>{Du(e,t,n,r,i,`mc-before-names`,a,o)}),l.forEach(r=>{Du(e,t,n,r,i,`mc-before-boundaries`,a,o)}),u.forEach(r=>{Du(e,t,n,r,i,`mc-before-waters`,a,o)})}function Du(e,t,n,r,i,a,o,s){if(r.type===`marker`){let o=n.marker?.find(e=>e.id===r.groupId);o&&pl(e,o,a,i,t)}else if(r.type===`polygon`){let o=n.polygon?.find(e=>e.id===r.groupId);o&&cl(e,o,a,i,t)}else if(r.type===`circle`){let o=n.circle?.find(e=>e.id===r.groupId);o&&ul(e,o,a,i,t)}else if(r.type===`line`){let i=n.line?.find(e=>e.id===r.groupId);i&&Rl(e,i,a,t)}else if(r.type===`dot`){let t=n.dot?.find(e=>e.id===r.groupId);t&&Hl(e,t,a)}else if(r.type===`area`){let c=n.area?.find(e=>e.id===r.groupId);c&&Vl(e,c,a,i,t,o,s)}}e.initMap=vu,e.setRTLTextPlugin=u.setRTLTextPlugin});
1153
+ `}return n}htmlToElement(e){let t=document.createElement(`template`);return t.innerHTML=e.trim(),t.content.firstElementChild}addPopupControls(){let e=this.htmlToElement(kl);if(e&&(e.addEventListener(`click`,()=>{this.hidePopup(),this.highlightManager.highlight(void 0)}),this.popupContainer.appendChild(e)),this.popupElements.length<2)return;let t=this.htmlToElement(Al);t&&(t.querySelector(`.prev`)?.addEventListener(`click`,()=>this.cyclePopups(!1)),t.querySelector(`.next`)?.addEventListener(`click`,()=>this.cyclePopups()),this.popupContainer.appendChild(t))}fillDatalayerTemplate(e,t,n){let r=`data-mention-id`,i=new DOMParser().parseFromString(t,`text/html`).body;for(let t of i.querySelectorAll(`[${r}]`)){let i=this.getProperty(e,t.getAttribute(r),n);i!==void 0&&(t.innerText=i)}return i.innerHTML}getProperty(e,t,n){if(!t)return;let r=t.endsWith(`:en`)?[t.replace(`:en`,n),t]:[t];for(let t of r){let n=e.properties[t]??this.getVectorProperty(e,t);if(n!==void 0)return n}}getVectorProperty(e,t){let n=this.promoteIdCache.get(e.source);n===void 0&&(n=this.map.getSource(e.source)?.serialize().promoteId||`id`,this.promoteIdCache.set(e.source,n));try{let r=e.properties[n];return e.layer.metadata.properties[t][r]}catch{return}}cyclePopups(e=!0){let t=this.popupElements?.findIndex(e=>e.modelId===this.currentModelId);if(t!==-1){let n=0;n=e?t===this.popupElements.length-1?0:t+1:t===0?this.popupElements.length-1:t-1;let r=this.popupElements?.[n];this.highlightManager.highlight(r);let i=Ol(r.popup,r.popupMedia,r.dataBindings??{},this.mode),a=this.popupContainer;this.popupContainer.remove(),a.innerHTML=i,this.mapContainer.appendChild(a),this.currentModelId=r.modelId,this.addPopupControls(),e?this.popupContainer.querySelector(`.mc-popup-button.next`)?.focus():this.popupContainer.querySelector(`.mc-popup-button.prev`)?.focus(),this.currentFeatureId=void 0}}},Rl={solid:[1,0],dotted:[.7,.3],dashed:[3.5,1.5]};function zl(e,t,n,r){e.addSource(t.id,{type:`geojson`,data:{type:`FeatureCollection`,features:t.models.filter(e=>e.visible??!0).map(n=>Bl(e,t,n,r))}}),Object.entries(Rl).forEach(([r,i])=>{t.models.some(e=>(e.lineStyle??`solid`)===r)&&e.addLayer({id:`${t.id}-${r}`,type:`line`,source:t.id,metadata:{"mc-model-type":`line`,"mc-group-id":t.id},filter:[`all`,[`==`,[`geometry-type`],`LineString`],[`==`,[`get`,`line-style`],r]],paint:{"line-width":[`get`,`line-width`],"line-color":[`get`,`line-color`],"line-dasharray":i}},n)}),e.addLayer({id:`${t.id}-clickable`,type:`line`,source:t.id,metadata:{"mc-model-type":`line`,"mc-group-id":t.id},paint:{"line-width":[`max`,[`get`,`line-width`],15],"line-opacity":0},filter:[`==`,[`geometry-type`],`LineString`]},n),t.models.some(e=>e.svg)&&e.addLayer({id:`${t.id}-icon`,type:`symbol`,source:t.id,metadata:{"mc-model-type":`line`,"mc-group-id":t.id},layout:{"icon-allow-overlap":!0,"icon-ignore-placement":!0,"icon-image":[`get`,`mc-image-key`],"icon-anchor":`center`,"icon-size":[`get`,`icon-size`],"icon-rotate":[`get`,`icon-rotate`],"icon-offset":[`get`,`icon-offset`]},filter:[`==`,[`geometry-type`],`Point`]},n)}function Bl(e,t,n,r){let i=n.svg===void 0?void 0:r.getMapLibreImageKey(Ur(n.dataBindings??{},n.svg,void 0),window.devicePixelRatio*(n.iconScale??1));return{type:`Feature`,id:b(n.id),properties:{id:n.id,"line-width":n.lineWidth??3,"line-color":t.lineColor||n.lineColor?Vr(n.dataBindings??{},n.lineColor,t.lineColor):`#000000`,"line-style":n.lineStyle??`solid`,"mc-image-key":i,"icon-rotate":Vl(n,e),"icon-offset":n.iconOffset,"icon-size":n.iconScale},geometry:{type:`GeometryCollection`,geometries:[{type:`LineString`,coordinates:n.geometry},{type:`Point`,coordinates:n.geometry[n.geometry.length-1]}]}}}function Vl(e,t){return e.iconRotation?e.iconAlign?sr(e.geometry,t)+e.iconRotation:e.iconRotation:0}function Hl(e,t,n,r,i,a,o){let s=mr(t),c=new Map,l=new Map;for(let e of t.models){let n=e.featureId,a=t.id,o=[],u=ar(e),d=ir(a,e),f=l.get(d)??{model:e,featureIds:o,modelIdToFillColor:{},modelIdToFillPattern:{},modelIdToOutlineColor:{},modelIdToOutlineWidth:{}};if(e.visible??!0){f.featureIds.push(n);let a=e.fillPattern===void 0?null:i.getMapLibreImageKey(r[e.fillPattern],2*window.devicePixelRatio);f.modelIdToFillColor[n]=t.fillColor||e.fillColor?Vr(e.dataBindings??{},e.fillColor,t.fillColor,s,t.choropleth?.unmatchedColor):`#000000`,f.modelIdToFillPattern[n]=a,f.modelIdToOutlineColor[n]=t.outlineColor||e.outlineColor?Vr(e.dataBindings??{},e.outlineColor,t.outlineColor):`#000000`,f.modelIdToOutlineWidth[n]=e.outlineWidth??.5}c.set(u,e),l.set(d,f)}for(let t of c.keys())e.getSource(t)||e.addSource(t,{type:`vector`,url:`${a}${c.get(t).vectorUrl}?access_token=${o}`});for(let r of l.keys()){let{model:i}=l.get(r),{sourceLayerId:a}=i,o=ar(i);e.addLayer({id:r,type:`fill`,source:o,"source-layer":a,filter:[`literal`,!1],metadata:{"mc-model-type":`area`,"mc-model-id-prefix":i.vectorUrl,"mc-group-id":t.id},paint:{"fill-color":`#ffffff`,"fill-outline-color":`#000000`,"fill-antialias":!1}},n),e.addLayer({id:`${r}-pattern`,type:`fill`,source:o,"source-layer":a,filter:[`literal`,!1],metadata:{"mc-model-type":`area`,"mc-model-id-prefix":i.vectorUrl,"mc-group-id":t.id},paint:{"fill-pattern":[`get`,`fill-pattern`]},layout:{visibility:`visible`}},n),e.addLayer({id:`${r}-outline`,type:`line`,source:o,"source-layer":a,filter:[`literal`,!1],metadata:{"mc-model-type":`area`,"mc-model-id-prefix":i.vectorUrl,"mc-group-id":t.id},paint:{"line-color":`#000000`,"line-width":.5}},n)}l.forEach((t,n)=>{let{featureIds:r,modelIdToFillColor:i,modelIdToFillPattern:a,modelIdToOutlineColor:o,modelIdToOutlineWidth:s}=t;e.setFilter(n,[`in`,`id`,...r]),e.setFilter(`${n}-outline`,[`in`,`id`,...r]),e.setPaintProperty(n,`fill-color`,[`get`,[`case`,[`==`,[`typeof`,[`get`,`id`]],`number`],[`to-string`,[`get`,`id`]],[`get`,`id`]],[`literal`,i]]),e.setPaintProperty(`${n}-outline`,`line-color`,[`get`,[`case`,[`==`,[`typeof`,[`get`,`id`]],`number`],[`to-string`,[`get`,`id`]],[`get`,`id`]],[`literal`,o]]),e.setPaintProperty(`${n}-outline`,`line-width`,[`get`,[`case`,[`==`,[`typeof`,[`get`,`id`]],`number`],[`to-string`,[`get`,`id`]],[`get`,`id`]],[`literal`,s]]),e.setFilter(`${n}-pattern`,[`to-boolean`,[`get`,[`case`,[`==`,[`typeof`,[`get`,`id`]],`number`],[`to-string`,[`get`,`id`]],[`get`,`id`]],[`literal`,a]]]),e.setPaintProperty(`${n}-pattern`,`fill-pattern`,[`get`,[`case`,[`==`,[`typeof`,[`get`,`id`]],`number`],[`to-string`,[`get`,`id`]],[`get`,`id`]],[`literal`,a]])})}function Ul(e,t,n){e.addSource(t.id,{type:`geojson`,data:{type:`FeatureCollection`,features:t.models.filter(e=>e.visible??!0).map(e=>Wl(t,e))}}),e.addLayer({id:t.id,type:`circle`,source:t.id,metadata:{"mc-model-type":`dot`,"mc-group-id":t.id},paint:{"circle-color":[`get`,`circle-color`],"circle-radius":[`get`,`circle-radius`]}},n)}function Wl(e,t){return{type:`Feature`,id:t.id,properties:{id:t.id,"circle-radius":t.radius,"circle-color":e.fillColor||t.fillColor?Vr(t.dataBindings??{},t.fillColor,e.fillColor):`#000000`},geometry:{type:`Point`,coordinates:[t.center.lng,t.center.lat]}}}function Gl(e){let t=e.length>0?[Kl(e[0])]:[],n=0,r=0;for(let i=1;i<e.length;++i){let a=Kl(e[i]);n+=ql(e[i-1].center[0],a.center[0]),r+=ql(e[i-1].bearing,a.bearing),a.center[0]+=n*360,a.x+=n,a.bearing+=r*360,t.push(a)}return t}function Kl(e){return{...e,center:[e.center[0],e.center[1]]}}function ql(e,t){if(Math.abs(e)+Math.abs(t)>180){if(e>0&&t<0)return 1;if(e<0&&t>0)return-1}return 0}function Jl(e){return 2**-e}function Yl(e){return e.length>0?e[e.length-1].time:0}function Xl(e){return e<0?-1:1}function Zl(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(Xl(a)+Xl(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Ql(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function $l(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function eu(e){this._context=e}eu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:$l(this,this._t0,Ql(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,$l(this,Ql(this,n=Zl(this,e,t)),n);break;default:$l(this,this._t0,n=Zl(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function tu(e){this._context=new nu(e)}(tu.prototype=Object.create(eu.prototype)).point=function(e,t){eu.prototype.point.call(this,t,e)};function nu(e){this._context=e}nu.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function ru(e){return new eu(e)}function iu(e){return e}var{cbrt:au,sqrt:ou,PI:su}=Math,cu=(e,t,n,r,i)=>{let a=t+n*e,o=a**2+r;if(o>0){let e=ou(o);return au(a+e)+au(a-e)-i}let s=au(ou(a*a-o)),c=a?Math.atan(ou(-o)/a):-su/2,l;return l=n<0?(a>0?2*su:su)-c:i<0?(a>0?2*su:-3*su)+c:(a>0?0:su)+c,2*s*Math.cos(l/3)-i},lu=(e,t,n,r)=>((t*e+3*n)*e+r)*e;function uu(e,t,n,r){if(!(0<=e&&e<=1&&0<=n&&n<=1))throw Error(`bezier x values must be in [0, 1] range`);if(e===t&&n===r)return iu;let i=6*(3*e-3*n+1),a=6*(n-2*e),o=3*e,s=i*i,c=a*a,l=a/i,u=3*a*o/s-c*a/(s*i),d=2*o/i-c/s,f=d*d*d,p=3/i,m=3*t-3*r+1,h=r-2*t,g=3*t,_=i?cu:iu;return function(e){return e===0||e===1?e:lu(_(e,u,p,f,l),m,h,g)}}var du=l(s(((e,t)=>{t.exports=n;function n(e,t,n,r){var i,a,o,s,c,l,u,d,f,p,m,h,g,_;for(typeof t!=`function`&&(r=n,n=t,t=null),r||={},s=r.tolerance===void 0?1e-7:r.tolerance,_=r.epsilon===void 0?2220446049250313e-31:r.epsilon,c=r.maxIterations===void 0?20:r.maxIterations,m=r.h===void 0?1e-4:r.h,g=r.verbose===void 0?!1:r.verbose,h=1/m,l=0;l++<c;){if(a=e(n),t?o=t(n):(u=e(n+m),d=e(n-m),f=e(n+2*m),p=e(n-2*m),o=(p-f+8*(u-d))*h/12),Math.abs(o)<=_*Math.abs(a))return g&&console.log(`Newton-Raphson: failed to converged due to nearly zero first derivative`),!1;if(i=n-a/o,Math.abs(i-n)<=s*Math.abs(i))return g&&console.log(`Newton-Raphson: converged to x = `+i+` after `+l+` iterations`),i;n=i}return g&&console.log(`Newton-Raphson: Maximum iterations reached (`+c+`)`),!1}}))(),1),fu=class{segments;constructor(e){this.segments=[];let t=new pu,n=ru(t);n.lineStart();for(let t of e)n.point(t.x,t.y);n.lineEnd(),this.segments=t.segments}sample(e){if(e<=0)return this.segments[0].startY;if(e>=this.segments[this.segments.length-1].endX)return this.segments[this.segments.length-1].endY;let t=this.segments.find(t=>e>=t.startX&&e<t.endX),n=O(t.startX,t.endX,e);return t.startY!==t.endY&&t.easing!==void 0?D(t.startY,t.endY,t.easing(n)):D(t.startY,t.endY,n)}solve(e,t){let n=(0,du.default)(t=>this.sample(t)-e,t);return n===!1?t:n}},pu=class{previousPoint={x:0,y:0};segments=[];bezierCurveTo(e,t,n,r,i,a){let o=this.previousPoint.x,s=this.previousPoint.y,c=i===o?void 0:uu((e-o)/(i-o),(t-s)/(a-s),(n-o)/(i-o),(r-s)/(a-s));this.segments.push({startX:o,endX:i,startY:s,endY:a,easing:c}),this.previousPoint={x:i,y:a}}lineTo(e,t){this.segments.push({startX:this.previousPoint.x,endX:e,startY:this.previousPoint.y,endY:t,easing:void 0}),this.previousPoint={x:e,y:t}}moveTo(e,t){this.previousPoint={x:e,y:t}}closePath(){}arc(){}rect(){}arcTo(){}quadraticCurveTo(){}};function mu(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}var hu=class{script;xCurve;yCurve;fovCurve;zoomCurve;pitchCurve;bearingCurve;altitudeCurve;elevationCurve;constructor(e){this.script=Gl(e),this.xCurve=this.createMonotonicCurve(this.script,`x`),this.yCurve=this.createMonotonicCurve(this.script,`y`),this.fovCurve=this.createMonotonicCurve(this.script,`fov`),this.zoomCurve=this.createMonotonicCurve(this.script,`zoom`),this.pitchCurve=this.createMonotonicCurve(this.script,`pitch`),this.bearingCurve=this.createMonotonicCurve(this.script,`bearing`),this.altitudeCurve=this.createMonotonicCurve(this.script,`altitude`),this.elevationCurve=this.createMonotonicCurve(this.script,`elevation`)}sample(e){let t=this.zoomCurve.sample(e),n=this.altitudeCurve.solve(Jl(t),e),r=this.xCurve.sample(n),i=this.yCurve.sample(n),a=this.elevationCurve.sample(n),o=this.bearingCurve.sample(e),s=this.pitchCurve.sample(e),c=this.fovCurve.sample(e);return{center:new u.MercatorCoordinate(r,i).toLngLat(),zoom:t,bearing:o,pitch:s,fov:c,elevation:a}}createMonotonicCurve(e,t){let n=[];for(let r=0;r<e.length;r++){let i=r===0,a=r===e.length-1,o=e[r],s=e[r+1],c=e[r-1],l=this.getKeyframeValue(o,t);if(i&&n.push({x:-1,y:l}),n.push({x:o.time,y:l}),!i&&!a&&c.transition===`instant`&&o.transition===`ease`&&n.push({x:o.time+.1,y:l}),!a)if(o.transition===`linear`){let e=o.time+.1,r=s.time-.1,i=O(o.time,s.time,e),a=O(o.time,s.time,r),c=this.getKeyframeValue(s,t);n.push({x:e,y:D(l,c,i)}),n.push({x:r,y:D(l,c,a)})}else o.transition===`instant`&&(n.push({x:o.time+.1,y:l}),n.push({x:s.time-.1,y:l}));a&&n.push({x:o.time+1,y:l})}return new fu(n)}sampleAutoHideOpacity(e){let t=this.script;if(t.length<2)return 1;let n=this.getKeyframeIndexByTime(e);if(n===-1||n===t.length-1)return 1;let r=t[n],i=t[n+1],a=n>0?t[n-1]:void 0,o;if(r.hideLabels===(a?.hideLabels??!1))o=r.hideLabels?0:1;else{let t=e-r.time,n=Math.min(400,i.time-r.time);o=k(mu(t,r.hideLabels?1:0,r.hideLabels?-1:1,n),0,1)}let s;if(n===t.length-2&&r.hideLabels){let t=Math.max(r.time,i.time-400);s=k(mu(e-t,0,1,i.time-t),0,1)}else s=0;return Math.max(o,s)}getKeyframeIndexByTime(e){let t=this.script;if(t.length!==0){for(let n=0;n<t.length;n++)if(e<t[n].time)return n-1;return t.length-1}}getKeyframeValue(e,t){return t===`altitude`?Jl(e.zoom):e[t]}},gu=_u;function _u(e,t,n){var r=null,i=null,a=function(){r&&=(clearTimeout(r),i=null,null)},o=function(){var e=i;a(),e&&e()},s=function(){if(!t)return e.apply(this,arguments);var o=this,s=arguments,c=n&&!r;if(a(),i=function(){e.apply(o,s)},r=setTimeout(function(){if(r=null,!c){var e=i;return i=null,e()}},t),c)return i()};return s.cancel=a,s.flush=o,s}var vu=class extends u.Evented{map;cameraCurve;duration;playhead;playbackContext;constructor(e,t){super(),this.map=e,this.playhead=0,this.playbackContext=void 0;let n=(t.video?.keyframes??[]).map(e=>{let{x:t,y:n}=u.MercatorCoordinate.fromLngLat(e.center);return{...e,x:t,y:n,fov:e.fov??36.87,elevation:e.elevation??0}});this.duration=Yl(n),this.cameraCurve=new hu(n)}on(e,t){return super.on(e,t)}once(e,t){return super.once(e,t)}off(e,t){return super.off(e,t)}fire(e,t){return super.fire(e,t)}play(){this.playbackContext===void 0&&this.duration>0&&(this.playhead>=this.duration&&(this.playhead=0),this.playbackContext={startTime:Date.now(),startPlayhead:this.playhead},this.fire(`playstart`,{time:this.playhead}),this.playFrame())}pause(){this.playbackContext!==void 0&&(this.playbackContext=void 0,this.fire(`playend`,{time:this.playhead}))}seekTo(e){this.duration>0&&(e=k(e,0,this.duration),this.setCamera(e),this.playbackContext!==void 0&&(this.playbackContext={startTime:Date.now(),startPlayhead:e}))}playFrame(){if(this.playbackContext!==void 0){let e=this.playbackContext.startPlayhead+(Date.now()-this.playbackContext.startTime);e>this.duration?(this.setCamera(this.duration),this.playbackContext=void 0,this.fire(`playend`,{time:this.playhead})):(this.setCamera(e),requestAnimationFrame(()=>this.playFrame()))}}setCamera(e){this.playhead=e;let t=this.map,n=this.cameraCurve;this.prepareForPlayback();let r=n.sample(e),i=t.getCenter(),a=t.getZoom(),o=t.getBearing(),s=t.getPitch(),c=t.getCenterElevation(),l=t.getVerticalFieldOfView();r.center.lat!==i.lat||r.center.lng!==i.lng||r.zoom!==a||r.bearing!==o||r.pitch!==s||r.elevation!==c||r.fov!==l?(t.setVerticalFieldOfView(r.fov),t.jumpTo(r)):t.triggerRepaint(),this.fire(`play`,{time:e})}prepareForPlayback(){this.map.setCenterClampedToGround(!1),this.map.style?.stylesheet&&(this.map.style.stylesheet.transition={duration:0,delay:0}),this.restoreAfterPlayback()}restoreAfterPlayback=gu(()=>{this.map.setCenterClampedToGround(!0),this.map.style?.stylesheet&&(this.map.style.stylesheet.transition=void 0)},300)};async function yu(e){let{accessToken:t,mode:n=`sdk`,env:r=`production`}=e,i=r===`bleeding`?`https://vapi.bleeding.mc-cdn.io`:r===`beta`?`https://vapi.beta.mc-cdn.io`:`https://vapi.mc-cdn.io`,a=r===`bleeding`?`https://cdn.bleeding.mapcreator.io`:r===`beta`?`https://cdn.beta.mapcreator.io`:`https://cdn.mapcreator.io`,o=typeof e.job==`string`?await bu(e.job,a,t):e.job;await xu();let s=new u.Map({container:e.container,attributionControl:!1,style:null,maxBounds:[-1/0,-90,1/0,90],maxPitch:85,maxZoom:22,locale:{"CooperativeGesturesHandler.WindowsHelpText":Li(`windowsHelpText`),"CooperativeGesturesHandler.MacHelpText":Li(`macHelpText`),"CooperativeGesturesHandler.MobileHelpText":Li(`mobileHelpText`)}}),c=s.getContainer();c.classList.add(`mc-map`),c.classList.add(`mc-mode-${n}`);let l=new Ir(s),f=new Ll(s,n),{map:{language:m,pitch:g=0,rotation:_=0,center:v,hideBasemap:y,layerInfo:b=[],detailLevel:x=0,projection:S=`mercator`,terrain:C=!1,terrainExaggeration:w=1},registry:T={},web:E,positionOffsets:D,title:O}=o,{models:k={},slots:A={},svgs:M={}}=T;wu(r,i,t),s.resize(),n===`app`&&(document.title=O?`${O} - Mapcreator`:`Mapcreator`),s.setPitch(g),s.setBearing(_);let N=j(o,c),P,F;if(n===`video`?(F=o.map.zoom-x,P=N):(F=o.map.zoom-x+Math.log2(N),P=1),s.setScale(P),s.setZoom(F),s.setCenter(v),s.setDetailLevel(x),s.setMinZoom(x),s.addControl(new u.AttributionControl({compact:!1})),n===`app`&&s.cooperativeGestures.enable(),il(o,D??el,s,{center:v,zoom:F,pitch:g,rotation:_},i,a,t,P,n),f.setJobObject(o),E){let{restrictMapMovement:e,popupPosition:t}=E;e&&(s.boxZoom.disable(),s.doubleClickZoom.disable(),s.dragPan.disable(),s.dragRotate.disable(),s.keyboard.disable(),s.scrollZoom.disable(),s.touchPitch.disable(),s.touchZoomRotate.disable()),f.setParams(t,h(m,p.TWO),e,v)}let ee=await fetch(`${i}/styles/${o.meta.mapstyleSet}.json?access_token=${t}`).then(e=>e.json());return s.setStyle(null),s.setStyle(ee),await s.once(`style.load`),n===`app`&&Tu(s.getStyle().metadata?.customCssFilePath,t),d(m,s),await _l(o.meta.layers??[],s,i,t,ee.metadata?.styleOverride),Du(s,l,k,A,M,i,t),d(m,s),f.setPublication(ee.metadata?.publication),f.setpopupElements(),f.setHighlightManager(),s.setProjection({type:S===`globe`?`globe`:`mercator`}),Su(s,S),C&&Cu(s,i,t,w),Eu(s,s.getStyle(),b,!y),new vu(s,o)}function bu(e,t,n){return fetch(`${t}/jobs/${e}.json?access_token=${n}`).then(e=>e.json())}function xu(){return new Promise(e=>{let t=()=>{window.innerWidth>0&&window.innerHeight>0&&(window.removeEventListener(`resize`,t),e())};window.addEventListener(`resize`,t),t()})}function Su(e,t){let n=e.getStyle().metadata??{},r=n[`mc:background-color`]??`#f8f8f8`,i=n[`mc:background-color-globe`]??`#000000`;e.getContainer().style.backgroundColor=t===`globe`?i:r,e.setSky(e.getStyle().sky??$c),e.setLight({position:[1.15,210,45]})}function Cu(e,t,n,r){e.addSource(`mc-dem`,{type:`raster-dem`,tiles:[`${t}/dataset/jaxa_terrainrgb/{z}/{x}/{y}?access_token=${n}`],attribution:`<a href="https://earth.jaxa.jp/en/data/policy" target="_blank">© AW3D30 (JAXA)</a>`,minzoom:0,maxzoom:12}),e.setTerrain({source:`mc-dem`,exaggeration:r})}function wu(e,t,n){let r=`${t}/stylesheets/ff-${e===`beta`?`b-`:``}${n}.css?access_token=${n}`,i=document.createElement(`link`);i.setAttribute(`rel`,`stylesheet`),i.setAttribute(`href`,r),i.setAttribute(`type`,`text/css`),document.head.insertBefore(i,document.head.firstChild)}function Tu(e,t){if(document.getElementById(`custom-style`)?.remove(),!e)return;let n;e.startsWith(`http`)?(e=`${e}?access_token=${t}`,n=document.createElement(`link`),n.setAttribute(`rel`,`stylesheet`),n.setAttribute(`href`,e.replace(/https?:/,``))):(n=document.createElement(`style`),n.appendChild(document.createTextNode(e))),n.setAttribute(`id`,`custom-style`),n.setAttribute(`type`,`text/css`),document.head.appendChild(n)}function Eu(e,t,n,r){for(let i of n){let n=t.layers.find(e=>i.id===e.id||i.id.endsWith(` | ${e.id}`));n&&e.setLayoutProperty(n.id,`visibility`,i.visibility&&r?`visible`:`none`)}}function Du(e,t,n,r,i,a,o){let{beforeNone:s=[],beforeNames:c=[],beforeBoundaries:l=[],beforeWaters:u=[]}=r;s.forEach(r=>{Ou(e,t,n,r,i,`mc-before-none`,a,o)}),c.forEach(r=>{Ou(e,t,n,r,i,`mc-before-names`,a,o)}),l.forEach(r=>{Ou(e,t,n,r,i,`mc-before-boundaries`,a,o)}),u.forEach(r=>{Ou(e,t,n,r,i,`mc-before-waters`,a,o)})}function Ou(e,t,n,r,i,a,o,s){if(r.type===`marker`){let o=n.marker?.find(e=>e.id===r.groupId);o&&ml(e,o,a,i,t)}else if(r.type===`polygon`){let o=n.polygon?.find(e=>e.id===r.groupId);o&&ll(e,o,a,i,t)}else if(r.type===`circle`){let o=n.circle?.find(e=>e.id===r.groupId);o&&dl(e,o,a,i,t)}else if(r.type===`line`){let i=n.line?.find(e=>e.id===r.groupId);i&&zl(e,i,a,t)}else if(r.type===`dot`){let t=n.dot?.find(e=>e.id===r.groupId);t&&Ul(e,t,a)}else if(r.type===`area`){let c=n.area?.find(e=>e.id===r.groupId);c&&Hl(e,c,a,i,t,o,s)}}e.initMap=yu,e.setRTLTextPlugin=u.setRTLTextPlugin});
@@ -1,4 +1,4 @@
1
- import { PositionOffsets, JobObject } from './types/jobObject';
2
1
  import { Map as MapLibre } from '@mapcreator/maplibre-gl';
3
- import { InitialPositionInfo } from './types';
4
- export declare function useRenderAdornments(jobObject: JobObject, positionOffsets: PositionOffsets | undefined, map: MapLibre, initialPosition: InitialPositionInfo, vapiUrl: string, cdnUrl: string, accessToken: string): void;
2
+ import { InitialPositionInfo, Mode } from './types';
3
+ import { PositionOffsets, JobObject } from './types/jobObject';
4
+ export declare function useRenderAdornments(jobObject: JobObject, positionOffsets: PositionOffsets, map: MapLibre, initialPosition: InitialPositionInfo, vapiUrl: string, cdnUrl: string, accessToken: string, scale: number, mode: Mode): void;