@mapcreator/sdk 0.0.0-video.8 → 0.0.0-video.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/MCMap.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Evented, Map as MapLibre, StyleSpecification } from '@mapcreator/maplibre-gl';
2
2
  import { JobObject } from './types/jobObject';
3
3
  import { SvgCache } from './utils/svgHelpers';
4
- import { Svgs } from './types';
4
+ import { LayerInfo, Svgs } from './types';
5
5
  type SdkEventType = {
6
6
  playstart: VideoEvent;
7
7
  playend: VideoEvent;
@@ -13,7 +13,7 @@ type VideoEvent = {
13
13
  export declare class MCMap extends Evented {
14
14
  map: MapLibre;
15
15
  private video;
16
- constructor(map: MapLibre, jobObject: JobObject, svgs: Svgs, svgCache: SvgCache, mapstyle: StyleSpecification, overlays: Map<number, StyleSpecification>);
16
+ constructor(map: MapLibre, jobObject: JobObject, svgs: Svgs, svgCache: SvgCache, mapstyle: StyleSpecification, overlays: Map<number, StyleSpecification>, layerInfo: LayerInfo);
17
17
  on<T extends keyof SdkEventType>(type: T, listener: (e: SdkEventType[T]) => void): import('@mapcreator/maplibre-gl').Subscription;
18
18
  once<T extends keyof SdkEventType>(type: T, listener: (e: SdkEventType[T]) => void): Promise<any> | this;
19
19
  off<T extends keyof SdkEventType>(type: T, listener: (e: SdkEventType[T]) => void): this;
package/dist/Video.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { JobObject } from './types/jobObject';
2
2
  import { SvgCache } from './utils/svgHelpers';
3
+ import { LayerInfo, Svgs } from './types';
3
4
  import { MCMap } from './MCMap';
4
- import { Svgs } from './types';
5
5
  import { StyleSpecification } from '@mapcreator/maplibre-gl';
6
6
  export declare class Video {
7
7
  private mcMap;
@@ -15,7 +15,7 @@ export declare class Video {
15
15
  private layerInfo;
16
16
  private playhead;
17
17
  private playbackContext;
18
- constructor(mcMap: MCMap, jobObject: JobObject, svgs: Svgs, svgCache: SvgCache, mapstyle: StyleSpecification, overlays: Map<number, StyleSpecification>);
18
+ constructor(mcMap: MCMap, jobObject: JobObject, svgs: Svgs, svgCache: SvgCache, mapstyle: StyleSpecification, overlays: Map<number, StyleSpecification>, layerInfo: LayerInfo);
19
19
  play(): void;
20
20
  pause(): void;
21
21
  seekTo(time: number): void;
@@ -40085,9 +40085,9 @@ var Nu = class {
40085
40085
  layerInfo;
40086
40086
  playhead;
40087
40087
  playbackContext;
40088
- constructor(e, t, n, r, i, a) {
40088
+ constructor(e, t, n, r, i, a, o) {
40089
40089
  this.mcMap = e, this.playhead = 0, this.playbackContext = void 0;
40090
- let o = (t.video?.keyframes ?? []).map((e) => {
40090
+ let s = (t.video?.keyframes ?? []).map((e) => {
40091
40091
  let { x: t, y: n } = l.MercatorCoordinate.fromLngLat(e.center);
40092
40092
  return {
40093
40093
  ...e,
@@ -40097,7 +40097,7 @@ var Nu = class {
40097
40097
  elevation: e.elevation ?? 0
40098
40098
  };
40099
40099
  });
40100
- this.duration = uu(o), this.cameraCurve = new Au(o), this.jobObject = t, this.svgs = n, this.svgCache = r, this.mapstyle = i, this.overlays = a, this.layerInfo = t.map.layerInfo?.reduce((e, t) => (e[t.id] = { visibility: t.visibility }, e), {}) ?? {};
40100
+ this.duration = uu(s), this.cameraCurve = new Au(s), this.jobObject = t, this.svgs = n, this.svgCache = r, this.mapstyle = i, this.overlays = a, this.layerInfo = o;
40101
40101
  }
40102
40102
  play() {
40103
40103
  this.playbackContext === void 0 && this.duration > 0 && (this.playhead >= this.duration && (this.playhead = 0), this.playbackContext = {
@@ -40267,8 +40267,8 @@ var Nu = class {
40267
40267
  }, Pu = class extends l.Evented {
40268
40268
  map;
40269
40269
  video;
40270
- constructor(e, t, n, r, i, a) {
40271
- super(), this.map = e, this.video = new Nu(this, t, n, r, i, a);
40270
+ constructor(e, t, n, r, i, a, o) {
40271
+ super(), this.map = e, this.video = new Nu(this, t, n, r, i, a, o);
40272
40272
  }
40273
40273
  on(e, t) {
40274
40274
  return super.on(e, t);
@@ -40320,22 +40320,24 @@ async function Fu(e) {
40320
40320
  canvasContextAttributes: { preserveDrawingBuffer: n === "video" }
40321
40321
  }), c = s.getContainer();
40322
40322
  c.classList.add("mc-map"), c.classList.add(`mc-mode-${n}`);
40323
- let d = new Rr(s), p = new Hl(s, n), { map: { language: h, pitch: _ = 0, rotation: v = 0, center: y, hideBasemap: b, layerInfo: x = [], detailLevel: S = 0, projection: C = "mercator", terrain: w = !1, terrainExaggeration: T = 1 }, registry: E = {}, web: D, positionOffsets: O, title: k } = o, { models: A = {}, slots: j = {}, svgs: M = {} } = E;
40324
- Bu(r, i, t), s.resize(), n === "app" && (document.title = k ? `${k} - Mapcreator` : "Mapcreator"), s.setPitch(_), s.setBearing(v);
40325
- let P = N(o, c), F, ee;
40326
- if (n === "video" ? (ee = o.map.zoom - S, F = P) : (ee = o.map.zoom - S + Math.log2(P), F = 1), s.setScale(F), s.setZoom(ee), s.setCenter(y), s.setDetailLevel(S), s.setMinZoom(S), s.addControl(new l.AttributionControl({ compact: !1 })), n === "app" && s.cooperativeGestures.enable(), ll(o, O ?? g, s, {
40323
+ let d = new Rr(s), p = new Hl(s, n), { map: { language: h, pitch: _ = 0, rotation: v = 0, center: y, hideBasemap: 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: j = {} } = T;
40324
+ Bu(r, i, t), s.resize(), n === "app" && (document.title = O ? `${O} - Mapcreator` : "Mapcreator"), s.setPitch(_), s.setBearing(v);
40325
+ let M = N(o, c), P, F;
40326
+ if (n === "video" ? (F = o.map.zoom - x, P = M) : (F = o.map.zoom - x + Math.log2(M), P = 1), s.setScale(P), s.setZoom(F), s.setCenter(y), s.setDetailLevel(x), s.setMinZoom(x), s.addControl(new l.AttributionControl({ compact: !1 })), n === "app" && s.cooperativeGestures.enable(), ll(o, D ?? g, s, {
40327
40327
  center: y,
40328
- zoom: ee,
40328
+ zoom: F,
40329
40329
  pitch: _,
40330
40330
  rotation: v
40331
- }, i, a, t, F, n), p.setJobObject(o), D) {
40332
- let { restrictMapMovement: e, popupPosition: t } = D;
40331
+ }, i, a, t, P, n), p.setJobObject(o), E) {
40332
+ let { restrictMapMovement: e, popupPosition: t } = E;
40333
40333
  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()), p.setParams(t, m(h, f.TWO), e, y);
40334
40334
  }
40335
- let I = await fetch(`${i}/styles/${o.meta.mapstyleSet}.json?access_token=${t}`).then((e) => e.json());
40336
- s.setStyle(null), s.setStyle(I), await s.once("style.load"), n === "app" && Vu(s.getStyle().metadata?.customCssFilePath, t), u(h, s);
40337
- let te = await Sl(o.map.overlays ?? [], o.meta.layers ?? [], s, i, t, I.metadata?.styleOverride), ne = (o.map.overlays ?? []).reduce((e, t, n) => e.set(t, te[n]), /* @__PURE__ */ new Map());
40338
- return Uu(s, d, A, j, M, i, t), u(h, s), p.setPublication(I.metadata?.publication), p.setpopupElements(), p.setHighlightManager(), s.setProjection({ type: C === "globe" ? "globe" : "mercator" }), Ru(s, C), w && zu(s, i, t, T), Hu(s, x, !b), new Pu(s, o, M, d, I, ne);
40335
+ let ee = await fetch(`${i}/styles/${o.meta.mapstyleSet}.json?access_token=${t}`).then((e) => e.json());
40336
+ s.setStyle(null), s.setStyle(ee), await s.once("style.load"), n === "app" && Vu(s.getStyle().metadata?.customCssFilePath, t), u(h, s);
40337
+ let I = await Sl(o.map.overlays ?? [], o.meta.layers ?? [], s, i, t, ee.metadata?.styleOverride), te = (o.map.overlays ?? []).reduce((e, t, n) => e.set(t, I[n]), /* @__PURE__ */ new Map());
40338
+ Wu(s, d, k, A, j, i, t), u(h, s), p.setPublication(ee.metadata?.publication), p.setpopupElements(), p.setHighlightManager(), s.setProjection({ type: S === "globe" ? "globe" : "mercator" }), Ru(s, S), C && zu(s, i, t, w);
40339
+ let ne = Hu(o.map.layerInfo, ee, I);
40340
+ return Uu(s, ne, !b), new Pu(s, o, j, d, ee, te, ne);
40339
40341
  }
40340
40342
  function Iu(e, t, n) {
40341
40343
  return fetch(`${t}/jobs/${e}.json?access_token=${n}`).then((e) => e.json());
@@ -40378,21 +40380,27 @@ function Vu(e, t) {
40378
40380
  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);
40379
40381
  }
40380
40382
  function Hu(e, t, n) {
40381
- for (let r of t) e.getLayer(r.id) !== void 0 && e.setLayoutProperty(r.id, "visibility", r.visibility && n ? "visible" : "none");
40383
+ let r = e?.reduce((e, t) => (e[t.id] = { visibility: t.visibility }, e), {}) ?? {}, i = {};
40384
+ for (let e of t.layers) i[e.id] = r[e.id] ?? { visibility: (e.layout?.visibility ?? "visible") === "visible" };
40385
+ for (let e of n) for (let t of e.layers) i[t.id] = r[t.id] ?? { visibility: !1 };
40386
+ return i;
40382
40387
  }
40383
- function Uu(e, t, n, r, i, a, o) {
40388
+ function Uu(e, t, n) {
40389
+ for (let r in t) e.getLayer(r) !== void 0 && e.setLayoutProperty(r, "visibility", t[r].visibility && n ? "visible" : "none");
40390
+ }
40391
+ function Wu(e, t, n, r, i, a, o) {
40384
40392
  let { beforeNone: s = [], beforeNames: c = [], beforeBoundaries: l = [], beforeWaters: u = [] } = r;
40385
40393
  s.forEach((r) => {
40386
- Wu(e, t, n, r, i, "mc-before-none", a, o);
40394
+ Gu(e, t, n, r, i, "mc-before-none", a, o);
40387
40395
  }), c.forEach((r) => {
40388
- Wu(e, t, n, r, i, "mc-before-names", a, o);
40396
+ Gu(e, t, n, r, i, "mc-before-names", a, o);
40389
40397
  }), l.forEach((r) => {
40390
- Wu(e, t, n, r, i, "mc-before-boundaries", a, o);
40398
+ Gu(e, t, n, r, i, "mc-before-boundaries", a, o);
40391
40399
  }), u.forEach((r) => {
40392
- Wu(e, t, n, r, i, "mc-before-waters", a, o);
40400
+ Gu(e, t, n, r, i, "mc-before-waters", a, o);
40393
40401
  });
40394
40402
  }
40395
- function Wu(e, t, n, r, i, a, o, s) {
40403
+ function Gu(e, t, n, r, i, a, o, s) {
40396
40404
  if (r.type === "marker") {
40397
40405
  let o = n.marker?.find((e) => e.id === r.groupId);
40398
40406
  o && yl(e, o, a, i, t);
@@ -40414,5 +40422,5 @@ function Wu(e, t, n, r, i, a, o, s) {
40414
40422
  }
40415
40423
  }
40416
40424
  //#endregion
40417
- var Gu = l.setRTLTextPlugin;
40418
- export { Fu as initMap, Gu as setRTLTextPlugin };
40425
+ var Ku = l.setRTLTextPlugin;
40426
+ export { Fu as initMap, Ku as setRTLTextPlugin };
@@ -1165,4 +1165,4 @@ vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matr
1165
1165
  <div class="popup-scroll-wrapper">
1166
1166
  <div class="mc-popup data-layer text-content">${n}</div>
1167
1167
  </div>
1168
- `}return n}htmlToElement(e){let t=document.createElement(`template`);return t.innerHTML=e.trim(),t.content.firstElementChild}addPopupControls(){let e=this.htmlToElement(Fl);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(Il);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=Pl(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}}},Wl=class e{static#e(e){let t=0,n=[t];for(let r=1;r<e.length;++r){let i=e[r-1],a=e[r],o=a.x-i.x,s=a.y-i.y;t+=Math.sqrt(o*o+s*s),n.push(t)}return n}static#t(e,t){return e.x===t.x&&e.y===t.y}#n;#r;#i;#a;constructor(t){this.#n=t.filter((e,n)=>n===0||t[n][0]!==t[n-1][0]||t[n][1]!==t[n-1][1]),this.#r=this.#n.map(e=>u.MercatorCoordinate.fromLngLat(e)),this.#i=e.#e(this.#r),this.#a=this.#i[this.#i.length-1]}sample(e){let t=this.#r,n=this.#i;if(t.length<2)return t[0];e*=this.#a;for(let r=1;r<t.length;++r){let i=t[r-1],a=t[r],o=n[r-1],s=n[r];if(s>=e){let t=(e-o)/(s-o);return new u.MercatorCoordinate(A(i.x,a.x,t),A(i.y,a.y,t))}}return new u.MercatorCoordinate(t[t.length-1].x,t[t.length-1].y)}slice(t,n){if(this.#n.length<2)return this.#n;let r=this.#r.filter((e,r)=>this.#i[r]>=t*this.#a&&this.#i[r]<=n*this.#a);if(t>0){let n=this.sample(t);e.#t(n,r[0])||r.unshift(n)}if(n<1){let t=this.sample(n);e.#t(t,r[r.length-1])||r.push(t)}return r.map(e=>{let{lng:t,lat:n}=e.toLngLat();return[t,n]})}get length(){return this.#a}},Gl={solid:[1,0],dotted:[.7,.3],dashed:[3.5,1.5]};function Kl(e,t,n,r){e.addSource(t.id,{type:`geojson`,data:{type:`FeatureCollection`,features:t.models.filter(e=>e.visible??!0).map(n=>ql(e,t,n,1,r))}}),Object.entries(Gl).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,"line-opacity":[`coalesce`,[`feature-state`,`opacity`],[`global-state`,`opacity-${t.id}`],1]}},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`]},paint:{"icon-opacity":[`coalesce`,[`feature-state`,`opacity`],[`global-state`,`opacity-${t.id}`],1]},filter:[`==`,[`geometry-type`],`Point`]},n)}function ql(e,t,n,r,i){let a=new Wl(n.geometry).slice(0,r),o=n.svg===void 0?void 0:i.getMapLibreImageKey(Kr(n.dataBindings??{},n.svg,void 0),window.devicePixelRatio*(n.iconScale??1));return{type:`Feature`,id:C(n.id),properties:{id:n.id,"line-width":n.lineWidth??3,"line-color":t.lineColor||n.lineColor?Wr(n.dataBindings??{},n.lineColor,t.lineColor):`#000000`,"line-style":n.lineStyle??`solid`,"mc-image-key":o,"icon-rotate":Jl(n,a,e),"icon-offset":n.iconOffset,"icon-size":n.iconScale},geometry:{type:`GeometryCollection`,geometries:[{type:`LineString`,coordinates:a},{type:`Point`,coordinates:a[a.length-1]}]}}}function Jl(e,t,n){return e.iconRotation?e.iconAlign?ur(t,n)+e.iconRotation:e.iconRotation:0}function Yl(e,t,n,r,i,a,o){let s=_r(t),c=new Map,l=new Map;for(let e of t.models){let n=e.featureId,a=t.id,o=[],u=cr(e),d=sr(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?Wr(e.dataBindings??{},e.fillColor,t.fillColor,s,t.choropleth?.unmatchedColor):`#000000`,f.modelIdToFillPattern[n]=a,f.modelIdToOutlineColor[n]=t.outlineColor||e.outlineColor?Wr(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=cr(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 Xl(e,t,n){e.addSource(t.id,{type:`geojson`,data:{type:`FeatureCollection`,features:t.models.filter(e=>e.visible??!0).map(e=>Zl(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`],"circle-opacity":[`coalesce`,[`feature-state`,`opacity`],[`global-state`,`opacity-${t.id}`],1]}},n)}function Zl(e,t){return{type:`Feature`,id:t.id,properties:{id:t.id,"circle-radius":t.radius,"circle-color":e.fillColor||t.fillColor?Wr(t.dataBindings??{},t.fillColor,e.fillColor):`#000000`},geometry:{type:`Point`,coordinates:[t.center.lng,t.center.lat]}}}function Ql(e,t,n,r){return t+n/r*e}function $l(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function eu(e,t,n,r){let i=1.70158,a=0,o=n;return e===0?t:(e/=r)===1?t+n:(a||=r*.3,o<Math.abs(n)?(o=n,i=a/4):i=a/(2*Math.PI)*Math.asin(n/o),o*2**(-10*e)*Math.sin((e*r-i)*(2*Math.PI)/a)+n+t)}function tu(e,t,n,r,i){return i===void 0&&(i=1.70158),n*((e=e/r-1)*e*((i+1)*e+i)+1)+t}function nu(e,t,n,r){return(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t}var ru={linear:Ql,easeOutCubic:$l,easeOutBack:tu,easeOutBounce:nu,easeOutElastic:eu};function iu(e){return e.entryType===`fade`||e.exitType===`fade`||e.entryType===`instant`||e.exitType===`instant`}function au(e){return e.entryType===`grow`||e.exitType===`grow`}function ou(e,t,n){let{entry:r,entryDuration:i,exit:a,exitDuration:o}=e,{entryType:s,entryEasing:c,exitType:l,exitEasing:u}=e;return n<r&&(s===t||s===`instant`&&t===`fade`)||n>a&&(l===t||l===`instant`&&t===`fade`)?0:i>0&&n<r+i&&s===t?ru[c](n-r,0,1,i):o>0&&n>a-o&&l===t?ru[u](n-(a-o),1,-1,o):1}function su(e){let t=e.length>0?[cu(e[0])]:[],n=0,r=0;for(let i=1;i<e.length;++i){let a=cu(e[i]);n+=lu(e[i-1].center[0],a.center[0]),r+=lu(e[i-1].bearing,a.bearing),a.center[0]+=n*360,a.x+=n,a.bearing+=r*360,t.push(a)}return t}function cu(e){return{...e,center:[e.center[0],e.center[1]]}}function lu(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 uu(e){return 2**-e}function du(e){return e.length>0?e[e.length-1].time:0}function fu(e){return P(e,23.976)?24e3/1001:P(e,29.97)?3e4/1001:P(e,59.94)?6e4/1001:e}function pu(e){return e<0?-1:1}function mu(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(pu(a)+pu(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function hu(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function gu(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 _u(e){this._context=e}_u.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:gu(this,this._t0,hu(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,gu(this,hu(this,n=mu(this,e,t)),n);break;default:gu(this,this._t0,n=mu(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function vu(e){this._context=new yu(e)}(vu.prototype=Object.create(_u.prototype)).point=function(e,t){_u.prototype.point.call(this,t,e)};function yu(e){this._context=e}yu.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 bu(e){return new _u(e)}function xu(e){return e}var{cbrt:Su,sqrt:Cu,PI:wu}=Math,Tu=(e,t,n,r,i)=>{let a=t+n*e,o=a**2+r;if(o>0){let e=Cu(o);return Su(a+e)+Su(a-e)-i}let s=Su(Cu(a*a-o)),c=a?Math.atan(Cu(-o)/a):-wu/2,l;return l=n<0?(a>0?2*wu:wu)-c:i<0?(a>0?2*wu:-3*wu)+c:(a>0?0:wu)+c,2*s*Math.cos(l/3)-i},Eu=(e,t,n,r)=>((t*e+3*n)*e+r)*e;function Du(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 xu;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?Tu:xu;return function(e){return e===0||e===1?e:Eu(_(e,u,p,f,l),m,h,g)}}var Ou=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),ku=class{segments;constructor(e){this.segments=[];let t=new Au,n=bu(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=j(t.startX,t.endX,e);return t.startY!==t.endY&&t.easing!==void 0?A(t.startY,t.endY,t.easing(n)):A(t.startY,t.endY,n)}solve(e,t){let n=(0,Ou.default)(t=>this.sample(t)-e,t);return n===!1?t:n}},Au=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:Du((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(){}},ju=class{script;xCurve;yCurve;fovCurve;zoomCurve;pitchCurve;bearingCurve;altitudeCurve;elevationCurve;constructor(e){this.script=su(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(uu(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=j(o.time,s.time,e),a=j(o.time,s.time,r),c=this.getKeyframeValue(s,t);n.push({x:e,y:A(l,c,i)}),n.push({x:r,y:A(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 ku(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=ee($l(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=ee($l(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`?uu(e.zoom):e[t]}},Mu=Nu;function Nu(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 Pu=class{mcMap;cameraCurve;jobObject;svgs;svgCache;duration;mapstyle;overlays;layerInfo;playhead;playbackContext;constructor(e,t,n,r,i,a){this.mcMap=e,this.playhead=0,this.playbackContext=void 0;let o=(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=du(o),this.cameraCurve=new ju(o),this.jobObject=t,this.svgs=n,this.svgCache=r,this.mapstyle=i,this.overlays=a,this.layerInfo=t.map.layerInfo?.reduce((e,t)=>(e[t.id]={visibility:t.visibility},e),{})??{}}play(){this.playbackContext===void 0&&this.duration>0&&(this.playhead>=this.duration&&(this.playhead=0),this.playbackContext={startTime:Date.now(),startPlayhead:this.playhead},this.mcMap.fire(`playstart`,{time:this.playhead}),this.playFrame())}pause(){this.playbackContext!==void 0&&(this.playbackContext=void 0,this.mcMap.fire(`playend`,{time:this.playhead}))}seekTo(e){this.duration>0&&(e=ee(e,0,this.duration),this.prepareForPlayback(),this.setCamera(e),this.playbackContext!==void 0&&(this.playbackContext={startTime:Date.now(),startPlayhead:e}))}async*frames(){let e=this.mcMap.map,t=fu(this.jobObject.export?.frameRate??60),n=Math.ceil(this.duration*t/1e3);e._fadeDuration=0,e.style.stylesheet.transition={duration:0,delay:0},e.setCenterClampedToGround(!1);let r=e.getCanvas(),{width:i,height:a}=r,o=new OffscreenCanvas(i,a).getContext(`2d`,{desynchronized:!0,willReadFrequently:!0});for(let e=0;e<n;e++)yield this.captureFrame(e*1e3/t,r,o,i,a);e._fadeDuration=300,e.style.stylesheet.transition=void 0,e.setCenterClampedToGround(!0)}async captureFrame(e,t,n,r,i){return this.setCamera(e),await this.mcMap.map.once(`idle`),n.fillStyle=`#ffffff`,n.fillRect(0,0,r,i),n.drawImage(t,0,0),n.getImageData(0,0,r,i)}playFrame(){if(this.playbackContext!==void 0){let e=this.playbackContext.startPlayhead+(Date.now()-this.playbackContext.startTime);this.prepareForPlayback(),e>this.duration?(this.setCamera(this.duration),this.playbackContext=void 0,this.mcMap.fire(`playend`,{time:this.playhead})):(this.setCamera(e),requestAnimationFrame(()=>this.playFrame()))}}setCamera(e){this.playhead=e;let t=this.mcMap.map,n=this.cameraCurve.sample(e),r=t.getCenter(),i=t.getZoom(),a=t.getBearing(),o=t.getPitch(),s=t.getCenterElevation(),c=t.getVerticalFieldOfView();n.center.lat!==r.lat||n.center.lng!==r.lng||n.zoom!==i||n.bearing!==a||n.pitch!==o||n.elevation!==s||n.fov!==c?(t.setVerticalFieldOfView(n.fov),t.jumpTo(n)):t.triggerRepaint(),this.applyAnimations(e),this.mcMap.fire(`play`,{time:e})}applyAnimations(e){let t=this.mcMap.map,{svgs:n,svgCache:r}=this,i=this.jobObject.video?.animations??[];for(let n of i){let{target:r}=n;if(r.type===`model`&&iu(n)){let{modelType:i,groupId:a,modelId:o}=r,s=ou(n,`fade`,e);(i===`polygon`||i===`circle`||i===`line`||i===`marker`||i===`dot`)&&(o===void 0?t.setGlobalStateProperty(`opacity-${a}`,s===1?null:s):t.setFeatureState({source:a,id:C(o)},{opacity:s}))}}for(let n of this.jobObject.registry?.models?.area??[]){let{groupAnimation:r,modelAnimations:a}=this.getGroupAnimations(i,`area`,n.id,`opacity`);if(!(r===void 0&&a.size===0))if(r!==void 0&&a.size===0){let i=ou(r,`fade`,e);n.models.reduce((e,t)=>e.add(sr(n.id,t)),new Set).forEach(e=>{t.setPaintProperty(e,`fill-opacity`,i),t.setPaintProperty(`${e}-outline`,`line-opacity`,i),t.setPaintProperty(`${e}-pattern`,`fill-opacity`,i)})}else{let i=r===void 0?1:ou(r,`fade`,e),o={};for(let t of n.models){let r=t.featureId===void 0?t.id:String(t.featureId),s=sr(n.id,t),c=a.get(t.id),l=c===void 0?i:ou(c,`fade`,e);o[s]??={},o[s][r]=l}for(let[e,n]of Object.entries(o)){let r=[`get`,[`case`,[`==`,[`typeof`,[`get`,`id`]],`number`],[`to-string`,[`get`,`id`]],[`get`,`id`]],[`literal`,n]];t.setPaintProperty(e,`fill-opacity`,r),t.setPaintProperty(`${e}-outline`,`line-opacity`,r),t.setPaintProperty(`${e}-pattern`,`fill-opacity`,r)}}}for(let a of this.jobObject.registry?.models?.circle??[]){let{groupAnimation:o,modelAnimations:s}=this.getGroupAnimations(i,`circle`,a.id,`scale`),c=o===void 0?1:ou(o,`grow`,e);(o!==void 0||s.size>0)&&t.getSource(a.id).setData({type:`FeatureCollection`,features:a.models.filter(e=>e.visible??!0).map(t=>{let i=s.get(t.id);return vl(a,t,i===void 0?c:ou(i,`grow`,e),n,r)})})}for(let n of this.jobObject.registry?.models?.line??[]){let{groupAnimation:a,modelAnimations:o}=this.getGroupAnimations(i,`line`,n.id,`scale`),s=a===void 0?1:ou(a,`grow`,e);(a!==void 0||o.size>0)&&t.getSource(n.id).setData({type:`FeatureCollection`,features:n.models.filter(e=>e.visible??!0).map(i=>{let a=o.get(i.id);return ql(t,n,i,a===void 0?s:ou(a,`grow`,e),r)})})}for(let a of this.jobObject.registry?.models?.marker??[]){let{groupAnimation:o,modelAnimations:s}=this.getGroupAnimations(i,`marker`,a.id,`scale`),c=o===void 0?1:ou(o,`grow`,e);(o!==void 0||s.size>0)&&t.getSource(a.id).setData({type:`FeatureCollection`,features:a.models.filter(e=>e.visible??!0).map(t=>{let i=s.get(t.id);return Sl(a,t,i===void 0?c:ou(i,`grow`,e),n,r)})})}let a=this.cameraCurve.sampleAutoHideOpacity(e);for(let t of this.mapstyle.layers){let n=this.getLayerOpacity(i,t,e,void 0);n===void 0?t.type===`symbol`&&this.setLayerOpacity(t,a):this.setLayerOpacity(t,n)}for(let[t,n]of this.overlays)for(let r of n.layers){let n=this.getLayerOpacity(i,r,e,t);n===void 0?this.resetLayerOpacity(r):this.setLayerOpacity(r,n)}}prepareForPlayback(){let e=this.mcMap.map;e.setCenterClampedToGround(!1),e.style?.stylesheet&&(e.style.stylesheet.transition={duration:0,delay:0}),this.restoreAfterPlayback()}restoreAfterPlayback=Mu(()=>{let e=this.mcMap.map;e.setCenterClampedToGround(!0),e.style?.stylesheet&&(e.style.stylesheet.transition=void 0)},300);getGroupAnimations(e,t,n,r){let i,a=new Map;for(let o of e){let{target:e}=o;e.type===`model`&&e.modelType===t&&e.groupId===n&&(r===`opacity`&&iu(o)||r===`scale`&&au(o))&&(e.modelId===void 0?i=o:a.set(e.modelId,o))}return{groupAnimation:i,modelAnimations:a}}getLayerOpacity(e,t,n,r){let i,a,o=1/0;r!==void 0&&(i=e.find(e=>e.target.type===`overlay`&&e.target.id===r));for(let n of e){let{target:e}=n;e.type===`layer`&&e.ids.includes(t.id)&&e.ids.length<o&&(a=n,o=e.ids.length)}return a===void 0?i===void 0?void 0:ou(i,`fade`,n):ou(a,`fade`,n)}setLayerOpacity(e,t){let n=this.mcMap.map;e.type===`fill`?n.setPaintProperty(e.id,`fill-opacity`,t):e.type===`line`?n.setPaintProperty(e.id,`line-opacity`,t):e.type===`circle`?(n.setPaintProperty(e.id,`circle-opacity`,t),n.setPaintProperty(e.id,`circle-stroke-opacity`,t)):e.type===`heatmap`?n.setPaintProperty(e.id,`heatmap-opacity`,t):e.type===`fill-extrusion`?n.setPaintProperty(e.id,`fill-extrusion-opacity`,t):e.type===`symbol`?(n.setPaintProperty(e.id,`icon-opacity`,t),n.setPaintProperty(e.id,`text-opacity`,t)):e.type===`raster`?n.setPaintProperty(e.id,`raster-opacity`,t):e.type===`hillshade`?n.setPaintProperty(e.id,`hillshade-exaggeration`,t*.5):e.type===`color-relief`?n.setPaintProperty(e.id,`color-relief-opacity`,t):e.type===`background`&&n.setPaintProperty(e.id,`background-opacity`,t),n.setLayoutProperty(e.id,`visibility`,t===0?`none`:this.layerInfo[e.id]?.visibility?`visible`:`none`)}resetLayerOpacity(e){let t=this.mcMap.map;e.type===`fill`?t.setPaintProperty(e.id,`fill-opacity`,e.paint?.[`fill-opacity`]??1):e.type===`line`?t.setPaintProperty(e.id,`line-opacity`,e.paint?.[`line-opacity`]??1):e.type===`circle`?(t.setPaintProperty(e.id,`circle-opacity`,e.paint?.[`circle-opacity`]??1),t.setPaintProperty(e.id,`circle-stroke-opacity`,e.paint?.[`circle-stroke-opacity`]??1)):e.type===`heatmap`?t.setPaintProperty(e.id,`heatmap-opacity`,e.paint?.[`heatmap-opacity`]??1):e.type===`fill-extrusion`?t.setPaintProperty(e.id,`fill-extrusion-opacity`,e.paint?.[`fill-extrusion-opacity`]??1):e.type===`symbol`?(t.setPaintProperty(e.id,`icon-opacity`,e.paint?.[`icon-opacity`]??1),t.setPaintProperty(e.id,`text-opacity`,e.paint?.[`text-opacity`]??1)):e.type===`raster`?t.setPaintProperty(e.id,`raster-opacity`,e.paint?.[`raster-opacity`]??1):e.type===`hillshade`?t.setPaintProperty(e.id,`hillshade-exaggeration`,e.paint?.[`hillshade-exaggeration`]??.5):e.type===`color-relief`?t.setPaintProperty(e.id,`color-relief-opacity`,e.paint?.[`color-relief-opacity`]??1):e.type===`background`&&t.setPaintProperty(e.id,`background-opacity`,e.paint?.[`background-opacity`]??1),t.setLayoutProperty(e.id,`visibility`,this.layerInfo[e.id]?.visibility?`visible`:`none`)}},Fu=class extends u.Evented{map;video;constructor(e,t,n,r,i,a){super(),this.map=e,this.video=new Pu(this,t,n,r,i,a)}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.video.play()}pause(){this.video.pause()}seekTo(e){this.video.seekTo(e)}frames(){return this.video.frames()}};async function Iu(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 Lu(e.job,a,t):e.job;await Ru();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":Bi(`windowsHelpText`),"CooperativeGesturesHandler.MacHelpText":Bi(`macHelpText`),"CooperativeGesturesHandler.MobileHelpText":Bi(`mobileHelpText`)},canvasContextAttributes:{preserveDrawingBuffer:n===`video`}}),c=s.getContainer();c.classList.add(`mc-map`),c.classList.add(`mc-mode-${n}`);let l=new zr(s),f=new Ul(s,n),{map:{language:m,pitch:g=0,rotation:v=0,center:y,hideBasemap:b,layerInfo:x=[],detailLevel:S=0,projection:C=`mercator`,terrain:w=!1,terrainExaggeration:T=1},registry:E={},web:D,positionOffsets:O,title:k}=o,{models:A={},slots:j={},svgs:ee={}}=E;Vu(r,i,t),s.resize(),n===`app`&&(document.title=k?`${k} - Mapcreator`:`Mapcreator`),s.setPitch(g),s.setBearing(v);let M=N(o,c),P,te;if(n===`video`?(te=o.map.zoom-S,P=M):(te=o.map.zoom-S+Math.log2(M),P=1),s.setScale(P),s.setZoom(te),s.setCenter(y),s.setDetailLevel(S),s.setMinZoom(S),s.addControl(new u.AttributionControl({compact:!1})),n===`app`&&s.cooperativeGestures.enable(),ul(o,O??_,s,{center:y,zoom:te,pitch:g,rotation:v},i,a,t,P,n),f.setJobObject(o),D){let{restrictMapMovement:e,popupPosition:t}=D;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,y)}let F=await fetch(`${i}/styles/${o.meta.mapstyleSet}.json?access_token=${t}`).then(e=>e.json());s.setStyle(null),s.setStyle(F),await s.once(`style.load`),n===`app`&&Hu(s.getStyle().metadata?.customCssFilePath,t),d(m,s);let ne=await Cl(o.map.overlays??[],o.meta.layers??[],s,i,t,F.metadata?.styleOverride),I=(o.map.overlays??[]).reduce((e,t,n)=>e.set(t,ne[n]),new Map);return Wu(s,l,A,j,ee,i,t),d(m,s),f.setPublication(F.metadata?.publication),f.setpopupElements(),f.setHighlightManager(),s.setProjection({type:C===`globe`?`globe`:`mercator`}),zu(s,C),w&&Bu(s,i,t,T),Uu(s,x,!b),new Fu(s,o,ee,l,F,I)}function Lu(e,t,n){return fetch(`${t}/jobs/${e}.json?access_token=${n}`).then(e=>e.json())}function Ru(){return new Promise(e=>{let t=()=>{window.innerWidth>0&&window.innerHeight>0&&(window.removeEventListener(`resize`,t),e())};window.addEventListener(`resize`,t),t()})}function zu(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??g),e.setLight({position:[1.15,210,45]})}function Bu(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 Vu(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 Hu(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 Uu(e,t,n){for(let r of t)e.getLayer(r.id)!==void 0&&e.setLayoutProperty(r.id,`visibility`,r.visibility&&n?`visible`:`none`)}function Wu(e,t,n,r,i,a,o){let{beforeNone:s=[],beforeNames:c=[],beforeBoundaries:l=[],beforeWaters:u=[]}=r;s.forEach(r=>{Gu(e,t,n,r,i,`mc-before-none`,a,o)}),c.forEach(r=>{Gu(e,t,n,r,i,`mc-before-names`,a,o)}),l.forEach(r=>{Gu(e,t,n,r,i,`mc-before-boundaries`,a,o)}),u.forEach(r=>{Gu(e,t,n,r,i,`mc-before-waters`,a,o)})}function Gu(e,t,n,r,i,a,o,s){if(r.type===`marker`){let o=n.marker?.find(e=>e.id===r.groupId);o&&bl(e,o,a,i,t)}else if(r.type===`polygon`){let o=n.polygon?.find(e=>e.id===r.groupId);o&&hl(e,o,a,i,t)}else if(r.type===`circle`){let o=n.circle?.find(e=>e.id===r.groupId);o&&_l(e,o,a,i,t)}else if(r.type===`line`){let i=n.line?.find(e=>e.id===r.groupId);i&&Kl(e,i,a,t)}else if(r.type===`dot`){let t=n.dot?.find(e=>e.id===r.groupId);t&&Xl(e,t,a)}else if(r.type===`area`){let c=n.area?.find(e=>e.id===r.groupId);c&&Yl(e,c,a,i,t,o,s)}}e.initMap=Iu,e.setRTLTextPlugin=u.setRTLTextPlugin});
1168
+ `}return n}htmlToElement(e){let t=document.createElement(`template`);return t.innerHTML=e.trim(),t.content.firstElementChild}addPopupControls(){let e=this.htmlToElement(Fl);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(Il);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=Pl(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}}},Wl=class e{static#e(e){let t=0,n=[t];for(let r=1;r<e.length;++r){let i=e[r-1],a=e[r],o=a.x-i.x,s=a.y-i.y;t+=Math.sqrt(o*o+s*s),n.push(t)}return n}static#t(e,t){return e.x===t.x&&e.y===t.y}#n;#r;#i;#a;constructor(t){this.#n=t.filter((e,n)=>n===0||t[n][0]!==t[n-1][0]||t[n][1]!==t[n-1][1]),this.#r=this.#n.map(e=>u.MercatorCoordinate.fromLngLat(e)),this.#i=e.#e(this.#r),this.#a=this.#i[this.#i.length-1]}sample(e){let t=this.#r,n=this.#i;if(t.length<2)return t[0];e*=this.#a;for(let r=1;r<t.length;++r){let i=t[r-1],a=t[r],o=n[r-1],s=n[r];if(s>=e){let t=(e-o)/(s-o);return new u.MercatorCoordinate(A(i.x,a.x,t),A(i.y,a.y,t))}}return new u.MercatorCoordinate(t[t.length-1].x,t[t.length-1].y)}slice(t,n){if(this.#n.length<2)return this.#n;let r=this.#r.filter((e,r)=>this.#i[r]>=t*this.#a&&this.#i[r]<=n*this.#a);if(t>0){let n=this.sample(t);e.#t(n,r[0])||r.unshift(n)}if(n<1){let t=this.sample(n);e.#t(t,r[r.length-1])||r.push(t)}return r.map(e=>{let{lng:t,lat:n}=e.toLngLat();return[t,n]})}get length(){return this.#a}},Gl={solid:[1,0],dotted:[.7,.3],dashed:[3.5,1.5]};function Kl(e,t,n,r){e.addSource(t.id,{type:`geojson`,data:{type:`FeatureCollection`,features:t.models.filter(e=>e.visible??!0).map(n=>ql(e,t,n,1,r))}}),Object.entries(Gl).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,"line-opacity":[`coalesce`,[`feature-state`,`opacity`],[`global-state`,`opacity-${t.id}`],1]}},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`]},paint:{"icon-opacity":[`coalesce`,[`feature-state`,`opacity`],[`global-state`,`opacity-${t.id}`],1]},filter:[`==`,[`geometry-type`],`Point`]},n)}function ql(e,t,n,r,i){let a=new Wl(n.geometry).slice(0,r),o=n.svg===void 0?void 0:i.getMapLibreImageKey(Kr(n.dataBindings??{},n.svg,void 0),window.devicePixelRatio*(n.iconScale??1));return{type:`Feature`,id:C(n.id),properties:{id:n.id,"line-width":n.lineWidth??3,"line-color":t.lineColor||n.lineColor?Wr(n.dataBindings??{},n.lineColor,t.lineColor):`#000000`,"line-style":n.lineStyle??`solid`,"mc-image-key":o,"icon-rotate":Jl(n,a,e),"icon-offset":n.iconOffset,"icon-size":n.iconScale},geometry:{type:`GeometryCollection`,geometries:[{type:`LineString`,coordinates:a},{type:`Point`,coordinates:a[a.length-1]}]}}}function Jl(e,t,n){return e.iconRotation?e.iconAlign?ur(t,n)+e.iconRotation:e.iconRotation:0}function Yl(e,t,n,r,i,a,o){let s=_r(t),c=new Map,l=new Map;for(let e of t.models){let n=e.featureId,a=t.id,o=[],u=cr(e),d=sr(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?Wr(e.dataBindings??{},e.fillColor,t.fillColor,s,t.choropleth?.unmatchedColor):`#000000`,f.modelIdToFillPattern[n]=a,f.modelIdToOutlineColor[n]=t.outlineColor||e.outlineColor?Wr(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=cr(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 Xl(e,t,n){e.addSource(t.id,{type:`geojson`,data:{type:`FeatureCollection`,features:t.models.filter(e=>e.visible??!0).map(e=>Zl(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`],"circle-opacity":[`coalesce`,[`feature-state`,`opacity`],[`global-state`,`opacity-${t.id}`],1]}},n)}function Zl(e,t){return{type:`Feature`,id:t.id,properties:{id:t.id,"circle-radius":t.radius,"circle-color":e.fillColor||t.fillColor?Wr(t.dataBindings??{},t.fillColor,e.fillColor):`#000000`},geometry:{type:`Point`,coordinates:[t.center.lng,t.center.lat]}}}function Ql(e,t,n,r){return t+n/r*e}function $l(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function eu(e,t,n,r){let i=1.70158,a=0,o=n;return e===0?t:(e/=r)===1?t+n:(a||=r*.3,o<Math.abs(n)?(o=n,i=a/4):i=a/(2*Math.PI)*Math.asin(n/o),o*2**(-10*e)*Math.sin((e*r-i)*(2*Math.PI)/a)+n+t)}function tu(e,t,n,r,i){return i===void 0&&(i=1.70158),n*((e=e/r-1)*e*((i+1)*e+i)+1)+t}function nu(e,t,n,r){return(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t}var ru={linear:Ql,easeOutCubic:$l,easeOutBack:tu,easeOutBounce:nu,easeOutElastic:eu};function iu(e){return e.entryType===`fade`||e.exitType===`fade`||e.entryType===`instant`||e.exitType===`instant`}function au(e){return e.entryType===`grow`||e.exitType===`grow`}function ou(e,t,n){let{entry:r,entryDuration:i,exit:a,exitDuration:o}=e,{entryType:s,entryEasing:c,exitType:l,exitEasing:u}=e;return n<r&&(s===t||s===`instant`&&t===`fade`)||n>a&&(l===t||l===`instant`&&t===`fade`)?0:i>0&&n<r+i&&s===t?ru[c](n-r,0,1,i):o>0&&n>a-o&&l===t?ru[u](n-(a-o),1,-1,o):1}function su(e){let t=e.length>0?[cu(e[0])]:[],n=0,r=0;for(let i=1;i<e.length;++i){let a=cu(e[i]);n+=lu(e[i-1].center[0],a.center[0]),r+=lu(e[i-1].bearing,a.bearing),a.center[0]+=n*360,a.x+=n,a.bearing+=r*360,t.push(a)}return t}function cu(e){return{...e,center:[e.center[0],e.center[1]]}}function lu(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 uu(e){return 2**-e}function du(e){return e.length>0?e[e.length-1].time:0}function fu(e){return P(e,23.976)?24e3/1001:P(e,29.97)?3e4/1001:P(e,59.94)?6e4/1001:e}function pu(e){return e<0?-1:1}function mu(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(pu(a)+pu(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function hu(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function gu(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 _u(e){this._context=e}_u.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:gu(this,this._t0,hu(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,gu(this,hu(this,n=mu(this,e,t)),n);break;default:gu(this,this._t0,n=mu(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function vu(e){this._context=new yu(e)}(vu.prototype=Object.create(_u.prototype)).point=function(e,t){_u.prototype.point.call(this,t,e)};function yu(e){this._context=e}yu.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 bu(e){return new _u(e)}function xu(e){return e}var{cbrt:Su,sqrt:Cu,PI:wu}=Math,Tu=(e,t,n,r,i)=>{let a=t+n*e,o=a**2+r;if(o>0){let e=Cu(o);return Su(a+e)+Su(a-e)-i}let s=Su(Cu(a*a-o)),c=a?Math.atan(Cu(-o)/a):-wu/2,l;return l=n<0?(a>0?2*wu:wu)-c:i<0?(a>0?2*wu:-3*wu)+c:(a>0?0:wu)+c,2*s*Math.cos(l/3)-i},Eu=(e,t,n,r)=>((t*e+3*n)*e+r)*e;function Du(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 xu;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?Tu:xu;return function(e){return e===0||e===1?e:Eu(_(e,u,p,f,l),m,h,g)}}var Ou=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),ku=class{segments;constructor(e){this.segments=[];let t=new Au,n=bu(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=j(t.startX,t.endX,e);return t.startY!==t.endY&&t.easing!==void 0?A(t.startY,t.endY,t.easing(n)):A(t.startY,t.endY,n)}solve(e,t){let n=(0,Ou.default)(t=>this.sample(t)-e,t);return n===!1?t:n}},Au=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:Du((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(){}},ju=class{script;xCurve;yCurve;fovCurve;zoomCurve;pitchCurve;bearingCurve;altitudeCurve;elevationCurve;constructor(e){this.script=su(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(uu(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=j(o.time,s.time,e),a=j(o.time,s.time,r),c=this.getKeyframeValue(s,t);n.push({x:e,y:A(l,c,i)}),n.push({x:r,y:A(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 ku(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=ee($l(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=ee($l(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`?uu(e.zoom):e[t]}},Mu=Nu;function Nu(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 Pu=class{mcMap;cameraCurve;jobObject;svgs;svgCache;duration;mapstyle;overlays;layerInfo;playhead;playbackContext;constructor(e,t,n,r,i,a,o){this.mcMap=e,this.playhead=0,this.playbackContext=void 0;let s=(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=du(s),this.cameraCurve=new ju(s),this.jobObject=t,this.svgs=n,this.svgCache=r,this.mapstyle=i,this.overlays=a,this.layerInfo=o}play(){this.playbackContext===void 0&&this.duration>0&&(this.playhead>=this.duration&&(this.playhead=0),this.playbackContext={startTime:Date.now(),startPlayhead:this.playhead},this.mcMap.fire(`playstart`,{time:this.playhead}),this.playFrame())}pause(){this.playbackContext!==void 0&&(this.playbackContext=void 0,this.mcMap.fire(`playend`,{time:this.playhead}))}seekTo(e){this.duration>0&&(e=ee(e,0,this.duration),this.prepareForPlayback(),this.setCamera(e),this.playbackContext!==void 0&&(this.playbackContext={startTime:Date.now(),startPlayhead:e}))}async*frames(){let e=this.mcMap.map,t=fu(this.jobObject.export?.frameRate??60),n=Math.ceil(this.duration*t/1e3);e._fadeDuration=0,e.style.stylesheet.transition={duration:0,delay:0},e.setCenterClampedToGround(!1);let r=e.getCanvas(),{width:i,height:a}=r,o=new OffscreenCanvas(i,a).getContext(`2d`,{desynchronized:!0,willReadFrequently:!0});for(let e=0;e<n;e++)yield this.captureFrame(e*1e3/t,r,o,i,a);e._fadeDuration=300,e.style.stylesheet.transition=void 0,e.setCenterClampedToGround(!0)}async captureFrame(e,t,n,r,i){return this.setCamera(e),await this.mcMap.map.once(`idle`),n.fillStyle=`#ffffff`,n.fillRect(0,0,r,i),n.drawImage(t,0,0),n.getImageData(0,0,r,i)}playFrame(){if(this.playbackContext!==void 0){let e=this.playbackContext.startPlayhead+(Date.now()-this.playbackContext.startTime);this.prepareForPlayback(),e>this.duration?(this.setCamera(this.duration),this.playbackContext=void 0,this.mcMap.fire(`playend`,{time:this.playhead})):(this.setCamera(e),requestAnimationFrame(()=>this.playFrame()))}}setCamera(e){this.playhead=e;let t=this.mcMap.map,n=this.cameraCurve.sample(e),r=t.getCenter(),i=t.getZoom(),a=t.getBearing(),o=t.getPitch(),s=t.getCenterElevation(),c=t.getVerticalFieldOfView();n.center.lat!==r.lat||n.center.lng!==r.lng||n.zoom!==i||n.bearing!==a||n.pitch!==o||n.elevation!==s||n.fov!==c?(t.setVerticalFieldOfView(n.fov),t.jumpTo(n)):t.triggerRepaint(),this.applyAnimations(e),this.mcMap.fire(`play`,{time:e})}applyAnimations(e){let t=this.mcMap.map,{svgs:n,svgCache:r}=this,i=this.jobObject.video?.animations??[];for(let n of i){let{target:r}=n;if(r.type===`model`&&iu(n)){let{modelType:i,groupId:a,modelId:o}=r,s=ou(n,`fade`,e);(i===`polygon`||i===`circle`||i===`line`||i===`marker`||i===`dot`)&&(o===void 0?t.setGlobalStateProperty(`opacity-${a}`,s===1?null:s):t.setFeatureState({source:a,id:C(o)},{opacity:s}))}}for(let n of this.jobObject.registry?.models?.area??[]){let{groupAnimation:r,modelAnimations:a}=this.getGroupAnimations(i,`area`,n.id,`opacity`);if(!(r===void 0&&a.size===0))if(r!==void 0&&a.size===0){let i=ou(r,`fade`,e);n.models.reduce((e,t)=>e.add(sr(n.id,t)),new Set).forEach(e=>{t.setPaintProperty(e,`fill-opacity`,i),t.setPaintProperty(`${e}-outline`,`line-opacity`,i),t.setPaintProperty(`${e}-pattern`,`fill-opacity`,i)})}else{let i=r===void 0?1:ou(r,`fade`,e),o={};for(let t of n.models){let r=t.featureId===void 0?t.id:String(t.featureId),s=sr(n.id,t),c=a.get(t.id),l=c===void 0?i:ou(c,`fade`,e);o[s]??={},o[s][r]=l}for(let[e,n]of Object.entries(o)){let r=[`get`,[`case`,[`==`,[`typeof`,[`get`,`id`]],`number`],[`to-string`,[`get`,`id`]],[`get`,`id`]],[`literal`,n]];t.setPaintProperty(e,`fill-opacity`,r),t.setPaintProperty(`${e}-outline`,`line-opacity`,r),t.setPaintProperty(`${e}-pattern`,`fill-opacity`,r)}}}for(let a of this.jobObject.registry?.models?.circle??[]){let{groupAnimation:o,modelAnimations:s}=this.getGroupAnimations(i,`circle`,a.id,`scale`),c=o===void 0?1:ou(o,`grow`,e);(o!==void 0||s.size>0)&&t.getSource(a.id).setData({type:`FeatureCollection`,features:a.models.filter(e=>e.visible??!0).map(t=>{let i=s.get(t.id);return vl(a,t,i===void 0?c:ou(i,`grow`,e),n,r)})})}for(let n of this.jobObject.registry?.models?.line??[]){let{groupAnimation:a,modelAnimations:o}=this.getGroupAnimations(i,`line`,n.id,`scale`),s=a===void 0?1:ou(a,`grow`,e);(a!==void 0||o.size>0)&&t.getSource(n.id).setData({type:`FeatureCollection`,features:n.models.filter(e=>e.visible??!0).map(i=>{let a=o.get(i.id);return ql(t,n,i,a===void 0?s:ou(a,`grow`,e),r)})})}for(let a of this.jobObject.registry?.models?.marker??[]){let{groupAnimation:o,modelAnimations:s}=this.getGroupAnimations(i,`marker`,a.id,`scale`),c=o===void 0?1:ou(o,`grow`,e);(o!==void 0||s.size>0)&&t.getSource(a.id).setData({type:`FeatureCollection`,features:a.models.filter(e=>e.visible??!0).map(t=>{let i=s.get(t.id);return Sl(a,t,i===void 0?c:ou(i,`grow`,e),n,r)})})}let a=this.cameraCurve.sampleAutoHideOpacity(e);for(let t of this.mapstyle.layers){let n=this.getLayerOpacity(i,t,e,void 0);n===void 0?t.type===`symbol`&&this.setLayerOpacity(t,a):this.setLayerOpacity(t,n)}for(let[t,n]of this.overlays)for(let r of n.layers){let n=this.getLayerOpacity(i,r,e,t);n===void 0?this.resetLayerOpacity(r):this.setLayerOpacity(r,n)}}prepareForPlayback(){let e=this.mcMap.map;e.setCenterClampedToGround(!1),e.style?.stylesheet&&(e.style.stylesheet.transition={duration:0,delay:0}),this.restoreAfterPlayback()}restoreAfterPlayback=Mu(()=>{let e=this.mcMap.map;e.setCenterClampedToGround(!0),e.style?.stylesheet&&(e.style.stylesheet.transition=void 0)},300);getGroupAnimations(e,t,n,r){let i,a=new Map;for(let o of e){let{target:e}=o;e.type===`model`&&e.modelType===t&&e.groupId===n&&(r===`opacity`&&iu(o)||r===`scale`&&au(o))&&(e.modelId===void 0?i=o:a.set(e.modelId,o))}return{groupAnimation:i,modelAnimations:a}}getLayerOpacity(e,t,n,r){let i,a,o=1/0;r!==void 0&&(i=e.find(e=>e.target.type===`overlay`&&e.target.id===r));for(let n of e){let{target:e}=n;e.type===`layer`&&e.ids.includes(t.id)&&e.ids.length<o&&(a=n,o=e.ids.length)}return a===void 0?i===void 0?void 0:ou(i,`fade`,n):ou(a,`fade`,n)}setLayerOpacity(e,t){let n=this.mcMap.map;e.type===`fill`?n.setPaintProperty(e.id,`fill-opacity`,t):e.type===`line`?n.setPaintProperty(e.id,`line-opacity`,t):e.type===`circle`?(n.setPaintProperty(e.id,`circle-opacity`,t),n.setPaintProperty(e.id,`circle-stroke-opacity`,t)):e.type===`heatmap`?n.setPaintProperty(e.id,`heatmap-opacity`,t):e.type===`fill-extrusion`?n.setPaintProperty(e.id,`fill-extrusion-opacity`,t):e.type===`symbol`?(n.setPaintProperty(e.id,`icon-opacity`,t),n.setPaintProperty(e.id,`text-opacity`,t)):e.type===`raster`?n.setPaintProperty(e.id,`raster-opacity`,t):e.type===`hillshade`?n.setPaintProperty(e.id,`hillshade-exaggeration`,t*.5):e.type===`color-relief`?n.setPaintProperty(e.id,`color-relief-opacity`,t):e.type===`background`&&n.setPaintProperty(e.id,`background-opacity`,t),n.setLayoutProperty(e.id,`visibility`,t===0?`none`:this.layerInfo[e.id]?.visibility?`visible`:`none`)}resetLayerOpacity(e){let t=this.mcMap.map;e.type===`fill`?t.setPaintProperty(e.id,`fill-opacity`,e.paint?.[`fill-opacity`]??1):e.type===`line`?t.setPaintProperty(e.id,`line-opacity`,e.paint?.[`line-opacity`]??1):e.type===`circle`?(t.setPaintProperty(e.id,`circle-opacity`,e.paint?.[`circle-opacity`]??1),t.setPaintProperty(e.id,`circle-stroke-opacity`,e.paint?.[`circle-stroke-opacity`]??1)):e.type===`heatmap`?t.setPaintProperty(e.id,`heatmap-opacity`,e.paint?.[`heatmap-opacity`]??1):e.type===`fill-extrusion`?t.setPaintProperty(e.id,`fill-extrusion-opacity`,e.paint?.[`fill-extrusion-opacity`]??1):e.type===`symbol`?(t.setPaintProperty(e.id,`icon-opacity`,e.paint?.[`icon-opacity`]??1),t.setPaintProperty(e.id,`text-opacity`,e.paint?.[`text-opacity`]??1)):e.type===`raster`?t.setPaintProperty(e.id,`raster-opacity`,e.paint?.[`raster-opacity`]??1):e.type===`hillshade`?t.setPaintProperty(e.id,`hillshade-exaggeration`,e.paint?.[`hillshade-exaggeration`]??.5):e.type===`color-relief`?t.setPaintProperty(e.id,`color-relief-opacity`,e.paint?.[`color-relief-opacity`]??1):e.type===`background`&&t.setPaintProperty(e.id,`background-opacity`,e.paint?.[`background-opacity`]??1),t.setLayoutProperty(e.id,`visibility`,this.layerInfo[e.id]?.visibility?`visible`:`none`)}},Fu=class extends u.Evented{map;video;constructor(e,t,n,r,i,a,o){super(),this.map=e,this.video=new Pu(this,t,n,r,i,a,o)}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.video.play()}pause(){this.video.pause()}seekTo(e){this.video.seekTo(e)}frames(){return this.video.frames()}};async function Iu(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 Lu(e.job,a,t):e.job;await Ru();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":Bi(`windowsHelpText`),"CooperativeGesturesHandler.MacHelpText":Bi(`macHelpText`),"CooperativeGesturesHandler.MobileHelpText":Bi(`mobileHelpText`)},canvasContextAttributes:{preserveDrawingBuffer:n===`video`}}),c=s.getContainer();c.classList.add(`mc-map`),c.classList.add(`mc-mode-${n}`);let l=new zr(s),f=new Ul(s,n),{map:{language:m,pitch:g=0,rotation:v=0,center:y,hideBasemap: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:j={}}=T;Vu(r,i,t),s.resize(),n===`app`&&(document.title=O?`${O} - Mapcreator`:`Mapcreator`),s.setPitch(g),s.setBearing(v);let ee=N(o,c),M,P;if(n===`video`?(P=o.map.zoom-x,M=ee):(P=o.map.zoom-x+Math.log2(ee),M=1),s.setScale(M),s.setZoom(P),s.setCenter(y),s.setDetailLevel(x),s.setMinZoom(x),s.addControl(new u.AttributionControl({compact:!1})),n===`app`&&s.cooperativeGestures.enable(),ul(o,D??_,s,{center:y,zoom:P,pitch:g,rotation:v},i,a,t,M,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,y)}let te=await fetch(`${i}/styles/${o.meta.mapstyleSet}.json?access_token=${t}`).then(e=>e.json());s.setStyle(null),s.setStyle(te),await s.once(`style.load`),n===`app`&&Hu(s.getStyle().metadata?.customCssFilePath,t),d(m,s);let F=await Cl(o.map.overlays??[],o.meta.layers??[],s,i,t,te.metadata?.styleOverride),ne=(o.map.overlays??[]).reduce((e,t,n)=>e.set(t,F[n]),new Map);Gu(s,l,k,A,j,i,t),d(m,s),f.setPublication(te.metadata?.publication),f.setpopupElements(),f.setHighlightManager(),s.setProjection({type:S===`globe`?`globe`:`mercator`}),zu(s,S),C&&Bu(s,i,t,w);let I=Uu(o.map.layerInfo,te,F);return Wu(s,I,!b),new Fu(s,o,j,l,te,ne,I)}function Lu(e,t,n){return fetch(`${t}/jobs/${e}.json?access_token=${n}`).then(e=>e.json())}function Ru(){return new Promise(e=>{let t=()=>{window.innerWidth>0&&window.innerHeight>0&&(window.removeEventListener(`resize`,t),e())};window.addEventListener(`resize`,t),t()})}function zu(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??g),e.setLight({position:[1.15,210,45]})}function Bu(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 Vu(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 Hu(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 Uu(e,t,n){let r=e?.reduce((e,t)=>(e[t.id]={visibility:t.visibility},e),{})??{},i={};for(let e of t.layers)i[e.id]=r[e.id]??{visibility:(e.layout?.visibility??`visible`)===`visible`};for(let e of n)for(let t of e.layers)i[t.id]=r[t.id]??{visibility:!1};return i}function Wu(e,t,n){for(let r in t)e.getLayer(r)!==void 0&&e.setLayoutProperty(r,`visibility`,t[r].visibility&&n?`visible`:`none`)}function Gu(e,t,n,r,i,a,o){let{beforeNone:s=[],beforeNames:c=[],beforeBoundaries:l=[],beforeWaters:u=[]}=r;s.forEach(r=>{Ku(e,t,n,r,i,`mc-before-none`,a,o)}),c.forEach(r=>{Ku(e,t,n,r,i,`mc-before-names`,a,o)}),l.forEach(r=>{Ku(e,t,n,r,i,`mc-before-boundaries`,a,o)}),u.forEach(r=>{Ku(e,t,n,r,i,`mc-before-waters`,a,o)})}function Ku(e,t,n,r,i,a,o,s){if(r.type===`marker`){let o=n.marker?.find(e=>e.id===r.groupId);o&&bl(e,o,a,i,t)}else if(r.type===`polygon`){let o=n.polygon?.find(e=>e.id===r.groupId);o&&hl(e,o,a,i,t)}else if(r.type===`circle`){let o=n.circle?.find(e=>e.id===r.groupId);o&&_l(e,o,a,i,t)}else if(r.type===`line`){let i=n.line?.find(e=>e.id===r.groupId);i&&Kl(e,i,a,t)}else if(r.type===`dot`){let t=n.dot?.find(e=>e.id===r.groupId);t&&Xl(e,t,a)}else if(r.type===`area`){let c=n.area?.find(e=>e.id===r.groupId);c&&Yl(e,c,a,i,t,o,s)}}e.initMap=Iu,e.setRTLTextPlugin=u.setRTLTextPlugin});