@seatlayer/js 0.107.0 → 0.109.0
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/{channelsMode-DV9D-48T.d.cts → channelsMode-BbYRQd0-.d.cts} +12 -0
- package/dist/{channelsMode-DV9D-48T.d.ts → channelsMode-BbYRQd0-.d.ts} +12 -0
- package/dist/chunk-U2Z2AGRX.js +1 -0
- package/dist/index.cjs +32 -22
- package/dist/index.d.cts +222 -16
- package/dist/index.d.ts +222 -16
- package/dist/index.js +21 -21
- package/dist/manager.cjs +46 -46
- package/dist/manager.d.cts +2 -2
- package/dist/manager.d.ts +2 -2
- package/dist/manager.js +18 -18
- package/dist/{managerExtras-K2UGS5TD.js → managerExtras-CHNB5GFR.js} +1 -1
- package/dist/pickerSalesClose-AVOFKQPC.js +11 -0
- package/package.json +2 -2
- package/dist/chunk-X7FRGMS2.js +0 -1
|
@@ -1404,6 +1404,12 @@ interface SeatManagerOptions {
|
|
|
1404
1404
|
* `unavailableObjects`, e.g. `'Kept for renewal'`. Default `'Unavailable'`.
|
|
1405
1405
|
*/
|
|
1406
1406
|
unavailableObjectsReason?: string;
|
|
1407
|
+
/**
|
|
1408
|
+
* Seats and tables with their own price, by label: each wears a violet ring
|
|
1409
|
+
* on the map so it can be found again. Display only; status, selection and
|
|
1410
|
+
* hover are unchanged. Replace the list with `setPricedObjects()`.
|
|
1411
|
+
*/
|
|
1412
|
+
pricedObjects?: readonly string[];
|
|
1407
1413
|
/**
|
|
1408
1414
|
* The price the map's seat and section hover show, per category key, in the
|
|
1409
1415
|
* same units as the chart's category prices. For a host that sells at a
|
|
@@ -1837,6 +1843,8 @@ declare class SeatManager {
|
|
|
1837
1843
|
private reserving;
|
|
1838
1844
|
private reservationWheres;
|
|
1839
1845
|
private reservedIds;
|
|
1846
|
+
/** Seat ids wearing the own-price ring (`pricedObjects`). */
|
|
1847
|
+
private pricedIds;
|
|
1840
1848
|
private reservationsTimer;
|
|
1841
1849
|
/** Find blocked's groups, read for Watch's blocked-seat card and ⌘K's "N reasons"; re-read when blocks change. */
|
|
1842
1850
|
private blockGroups;
|
|
@@ -2233,6 +2241,10 @@ declare class SeatManager {
|
|
|
2233
2241
|
* them; seats joining it repaint as held and leave the selection.
|
|
2234
2242
|
*/
|
|
2235
2243
|
setUnavailableObjects(labels: readonly string[], reason?: string): void;
|
|
2244
|
+
/** Replace the seats and tables that wear the own-price ring, without remounting. */
|
|
2245
|
+
setPricedObjects(labels: readonly string[]): void;
|
|
2246
|
+
/** `setChart` drops every mark, so a rebuild resets `pricedIds` before this. */
|
|
2247
|
+
private applyPricedMarks;
|
|
2236
2248
|
/**
|
|
2237
2249
|
* Replace the prices the map's seat and section hover show, without
|
|
2238
2250
|
* remounting: a map overrides those categories, `null` hides the price, and
|
|
@@ -1404,6 +1404,12 @@ interface SeatManagerOptions {
|
|
|
1404
1404
|
* `unavailableObjects`, e.g. `'Kept for renewal'`. Default `'Unavailable'`.
|
|
1405
1405
|
*/
|
|
1406
1406
|
unavailableObjectsReason?: string;
|
|
1407
|
+
/**
|
|
1408
|
+
* Seats and tables with their own price, by label: each wears a violet ring
|
|
1409
|
+
* on the map so it can be found again. Display only; status, selection and
|
|
1410
|
+
* hover are unchanged. Replace the list with `setPricedObjects()`.
|
|
1411
|
+
*/
|
|
1412
|
+
pricedObjects?: readonly string[];
|
|
1407
1413
|
/**
|
|
1408
1414
|
* The price the map's seat and section hover show, per category key, in the
|
|
1409
1415
|
* same units as the chart's category prices. For a host that sells at a
|
|
@@ -1837,6 +1843,8 @@ declare class SeatManager {
|
|
|
1837
1843
|
private reserving;
|
|
1838
1844
|
private reservationWheres;
|
|
1839
1845
|
private reservedIds;
|
|
1846
|
+
/** Seat ids wearing the own-price ring (`pricedObjects`). */
|
|
1847
|
+
private pricedIds;
|
|
1840
1848
|
private reservationsTimer;
|
|
1841
1849
|
/** Find blocked's groups, read for Watch's blocked-seat card and ⌘K's "N reasons"; re-read when blocks change. */
|
|
1842
1850
|
private blockGroups;
|
|
@@ -2233,6 +2241,10 @@ declare class SeatManager {
|
|
|
2233
2241
|
* them; seats joining it repaint as held and leave the selection.
|
|
2234
2242
|
*/
|
|
2235
2243
|
setUnavailableObjects(labels: readonly string[], reason?: string): void;
|
|
2244
|
+
/** Replace the seats and tables that wear the own-price ring, without remounting. */
|
|
2245
|
+
setPricedObjects(labels: readonly string[]): void;
|
|
2246
|
+
/** `setChart` drops every mark, so a rebuild resets `pricedIds` before this. */
|
|
2247
|
+
private applyPricedMarks;
|
|
2236
2248
|
/**
|
|
2237
2249
|
* Replace the prices the map's seat and section hover show, without
|
|
2238
2250
|
* remounting: a map overrides those categories, `null` hides the price, and
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as L}from"@seatlayer/core";import{cdnAssetUrl as Y,importCdnAsset as v}from"@seatlayer/core/core/cdnAsset";var A=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,S=/[\s"'<>`\\]/;function T(i){return i.startsWith("//")?!1:i.startsWith("/")||i.startsWith("./")||i.startsWith("../")}function E(){try{let i=typeof location>"u"?"":location.origin;return i&&i!=="null"?i:null}catch{return null}}function x(i){if(typeof i!="string"||!i||i.length>2e6||i!==i.trim())return!1;if(i.startsWith("data:"))return A.test(i);if(S.test(i))return!1;let t=E();if(T(i)){if(!t)return!1;try{let n=new URL(i,t);return n.origin===t&&!n.username&&!n.password}catch{return!1}}try{let n=new URL(i);return n.username||n.password?!1:n.protocol==="https:"||t!=null&&n.origin===t}catch{return!1}}import{SEATLAYER_MODULE_URL as le}from"@seatlayer/core/core/cdnAsset";function h(i,t){let n=L(i);return n===i?t:n}function B(){return globalThis.matchMedia?.("(pointer: coarse)").matches??!1?h("picker.dragToLookTouch","Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close"):h("picker.dragToLookMouse","Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function X(){return{rotate:h("picker.dragToRotateVenue","Drag to rotate the venue"),move:h("picker.dragToMoveVenue","Drag to move the venue"),zoomIn:h("picker.zoomIn","Zoom in"),zoomOut:h("picker.zoomOut","Zoom out"),fitView:h("picker.fitWholeVenue","Show whole venue")}}function G(i,t){let n=t?i.toLocaleUpperCase(t):i.toLocaleUpperCase(),e=t?i.toLocaleLowerCase(t):i.toLocaleLowerCase();if(i!==n||n===e)return i;let o=[...e][0]??"";return(t?o.toLocaleUpperCase(t):o.toLocaleUpperCase())+e.slice(o.length)}function j(i){if(typeof i=="string"){let t=document.querySelector(i);if(!t)throw new Error(`seatmap: container "${i}" not found`);return t}if(!(i instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return i}function q(i){return String(i??"").replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}function K(i,t,n){let e=t.find(s=>x(s))??null;if(i.replaceChildren(),!e)return i.textContent=n.slice(0,1).toUpperCase(),null;let o=document.createElement("img");return o.alt="",o.referrerPolicy="no-referrer",o.src=e,i.appendChild(o),e}var y=null;function Z(){if(y!==null)return y;try{if(typeof document>"u")return y=!1;y=!!document.createElement("canvas").getContext("webgl2")}catch{y=!1}return y}var b=null;function _(){return b||(b=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?v("seatlayer-view3d.mjs"):import("@seatlayer/core/view3d")).catch(t=>{throw b=null,t}),b)}function z(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||_().catch(()=>{})}async function J(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?v("seatlayer-panorama.mjs"):import("@seatlayer/core")}async function Q(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?v("seatlayer-checkout.mjs"):import("./hostedCheckout-XSQ7ISQC.js")}async function ee(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?v("seatlayer-sales.mjs"):import("./pickerSalesClose-AVOFKQPC.js")}function te(i){return i==="unavailable_for_event"||i==="payments_off_for_event"?i:"not_configured"}function ne(i){return i.lineItems.reduce((t,n)=>t+n.quantity,0)}function M(i,t){if(i.objectType!=="ga")return i.displayLabel??i.label;let n=t.find(e=>e.id===i.objectId);return i.displayLabel??n?.displayLabel??n?.label??h("picker.generalAdmission","General admission")}function P(i,t){let n=new Map;for(let e of i){let o=e.rowLabel&&e.seatNumber?[e.sectionLabel,`${h("picker.row","Row")} ${e.rowLabel}`,`${h("picker.seat","Seat")} ${e.seatNumber}`].filter(Boolean).join(" \xB7 "):M(e,t),s=[e.categoryLabel,e.tierLabel].filter(Boolean).join(" \xB7 "),u=Math.max(1,Math.floor(e.quantity||1)),a=`${o}\0${s}`,c=n.get(a)??{label:o,detail:s,units:0,amount:0};c.units+=u,c.amount+=e.unitPrice*u,n.set(a,c)}return[...n.values()].map(e=>({label:e.units>1?`${e.label} \xD7${e.units}`:e.label,...e.detail?{detail:e.detail}:{},amount:e.amount}))}var C=(i,t,n)=>L("picker.bookingForm.guestOfCount",{label:i,index:t,total:n});function R(i,t,n=[]){let e=new Map,o=[];for(let l of i.lineItems){let r=M(l,n),f=Math.max(1,Math.floor(l.quantity)||1);if(l.objectType!=="ga"&&!(l.objectType==="table"&&f>1)){o.push({key:l.label,name:r,unitIndex:1,quantity:1});continue}for(let d=1;d<=f;d+=1){let m=(e.get(l.label)??0)+1;e.set(l.label,m),o.push({key:`${l.label}#${m}`,name:r,unitIndex:d,quantity:f})}}let s=t?.ticketKeyDetails??[],u=t?.ticketKeys??s.map(l=>l.ticketKey),a=(u.length===o.length?u:o.map(l=>l.key)).map(l=>{let r=o.find(d=>d.key===l),f=s.find(d=>d.ticketKey===l);return{key:l,name:f?.displayLabel??r?.name,unitIndex:f?.unitIndex??r?.unitIndex??1,quantity:f?.quantity??r?.quantity??1}}),c=new Map;for(let l of a)l.name&&l.quantity<=1&&c.set(l.name,(c.get(l.name)??0)+1);let p=new Map;return a.map(({key:l,name:r,unitIndex:f,quantity:d})=>{if(!r)return{key:l};if(d>1)return{key:l,title:C(r,f,d)};let m=(p.get(r)??0)+1;p.set(r,m);let g=c.get(r)??1;return{key:l,title:g>1?C(r,m,g):r}})}function ie(i,t,n,e,o=[]){let s=new Map;for(let u of i.lineItems){let a=M(u,o);s.set(a,(s.get(a)??0)+1)}return{kind:"pay",provider:t,order:{holdId:i.holdId,expiresAt:i.expiresAt,currency:i.currency,total:i.total,labels:[...s].map(([u,a])=>a>1?`${u} \xD7${a}`:u),tickets:R(i,e,o),lines:P(i.lineItems,o)},bookingForm:n?.bookingForm??null,...n?.bookingMode==="free"?{free:!0}:{}}}function oe(i){return String(i?.code).startsWith("booking_form_")}function re(i,t,n){let e={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},o=new Date(i);if(t)try{return o.toLocaleString(n,{...e,timeZone:t})}catch{}return o.toLocaleString(n,e)}function ce(i){return i.focusedSection!==null?i.deeperThanSectionFrame===!1?"venue":"section":i.atVenueFit!==void 0?i.atVenueFit?"none":"venue":i.seatsRevealed?"venue":"none"}import{pointInPolygon as I}from"@seatlayer/core";import{createMinimapTransform as D,minimapPointToWorld as H,minimapViewportPlan as O}from"@seatlayer/core/picker/minimapGeometry";function V(i){let t={inactive:0,available:1,selected:2},n=new Map;for(let o of i){let s=n.get(o.id);(!s||t[o.state]>t[s])&&n.set(o.id,o.state)}let e={selected:0,available:0,inactive:0};for(let o of n.values())e[o]+=1;return e}function N(i,t){return i.x<=t.x&&i.y<=t.y&&i.x+i.width>=t.x+t.width&&i.y+i.height>=t.y+t.height}function he(i,t){let n=new w(i);return n.build(t),n}var w=class{constructor(t){this.host=t;this.miniCanvas=null;this.miniBase=null;this.miniWrap=null;this.miniToggle=null;this.miniLabel=null;this.miniTf=null;this.miniDrag=null;this.miniSuppressClick=!1;this.userClosed=!1}dispose(){this.miniToggle?.remove(),this.miniWrap?.remove(),this.miniToggle=null,this.miniWrap=null,this.miniCanvas=null,this.miniBase=null,this.miniLabel=null,this.miniTf=null,this.miniDrag=null,this.host.root()?.removeAttribute("data-minimap-open")}build(t){if(!this.host.controller.getViewport())return;let e=document.createElement("button");e.type="button",e.className="sl-minimap-toggle",e.setAttribute("aria-label",h("picker.openVenueMap","Open venue overview map")),e.setAttribute("aria-expanded","false"),e.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 6l5-2 8 3 5-2v13l-5 2-8-3-5 2zM8 4v13M16 7v13"/></svg>',t.appendChild(e),this.miniToggle=e;let o=document.createElement("div");o.className="sl-minimap",o.setAttribute("role","group");let s=document.createElement("div");s.className="sl-minimap-bar";let u=document.createElement("span");u.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",h("picker.minimapStateKey","Focused, selected, available, and inactive sections")),a.innerHTML='<i class="focused" title="Focused"></i><i class="selected" title="Selected"></i><i title="Available"></i><i class="inactive" title="Inactive"></i>';let c=document.createElement("button");c.type="button",c.className="sl-minimap-close",c.setAttribute("aria-label",h("picker.closeVenueMap","Close venue overview map")),c.textContent="\xD7",s.append(u,a,c);let p=document.createElement("canvas");p.tabIndex=0,p.setAttribute("role","application"),p.setAttribute("aria-label",h("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),o.append(s,p),t.appendChild(o),this.miniWrap=o,this.miniLabel=u,this.miniCanvas=p;let l=document.createElement("canvas");this.miniBase=l,e.addEventListener("click",()=>{let r=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=r,this.setMinimapOpen(!r)}),c.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),p.addEventListener("click",r=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(r)}),p.addEventListener("pointerdown",r=>this.minimapPointerDown(r)),p.addEventListener("pointermove",r=>this.minimapPointerMove(r)),p.addEventListener("pointerup",r=>this.minimapPointerUp(r)),p.addEventListener("pointercancel",r=>this.minimapPointerUp(r)),p.addEventListener("keydown",r=>this.minimapKeydown(r)),this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect()}setAutoOpen(t){if(this.miniWrap){if(!t){this.userClosed=!1,this.host.root()?.dataset.minimapOpen==="true"&&this.setMinimapOpen(!1,!1);return}this.userClosed||this.host.root()?.dataset.minimapOpen==="true"||this.setMinimapOpen(!0,!1)}}setMinimapOpen(t,n=!0){this.host.root()?.setAttribute("data-minimap-open",String(t)),this.miniToggle?.setAttribute("aria-expanded",String(t)),n&&(t?this.miniCanvas?.focus():this.miniToggle?.focus())}layoutMinimap(){let t=this.miniCanvas,n=this.miniBase,e=this.host.controller.getViewport()?.bounds;if(!t||!n||!e||!(e.width>0&&e.height>0))return;let o=196,s=146,u=6,a=e.width/Math.max(1,e.height),c=o,p=Math.round(o/a);p>s&&(p=s,c=Math.round(s*a)),c=Math.max(64,c),p=Math.max(48,p);let l=Math.min(2,window.devicePixelRatio||1);t.width=Math.round(c*l),t.height=Math.round(p*l),t.style.width=`${c}px`,t.style.height=`${p}px`,n.width=t.width,n.height=t.height,this.miniTf=D(e,t.width,t.height,l,u)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let t=this.host.controller.getFloors(),n=this.host.controller.isFloorOverview()?h("picker.allFloors","All floors"):t.find(l=>l.id===this.host.controller.getActiveFloorId())?.name??h("picker.venueOverview","Venue overview"),e=this.host.controller.getMinimapSnapshot().sections,s=e.find(l=>l.active)?.label??this.host.focusedSectionLabel(),u=s?`${n} \xB7 ${s}`:n;this.miniLabel.textContent=u;let{selected:a,available:c,inactive:p}=V(e);this.miniWrap.setAttribute("aria-label",e.length?`${u}. ${a} selected, ${c} available, ${p} inactive sections.`:u),this.miniCanvas?.setAttribute("aria-label",e.length?`${u}. ${a} selected, ${c} available, ${p} inactive sections. ${h("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${u}. ${h("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click elsewhere, or use arrow keys to pan.")}`)}refreshMinimap(){this.miniBase&&(this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect())}drawMinimapStatic(){let t=this.miniBase,n=this.miniTf;if(!t||!n)return;let e=t.getContext("2d");if(!e)return;e.clearRect(0,0,t.width,t.height);let o=r=>r*n.scale+n.offX,s=r=>r*n.scale+n.offY,u=this.host.cssVar("--sl-line")||"rgba(139,147,167,.5)",a=this.host.cssVar("--sl-muted")||"#8b93a7",c=this.host.cssVar("--sl-accent")||"#6e7bff",p=this.host.cssVar("--sl-success")||"#22a06b",l=this.host.controller.getMinimapSnapshot();for(let r of l.sections){if(r.outline.length<3)continue;e.beginPath(),r.outline.forEach((d,m)=>m===0?e.moveTo(o(d.x),s(d.y)):e.lineTo(o(d.x),s(d.y))),e.closePath();let f=r.paint;if(e.globalAlpha=r.state==="inactive"?.5:.92,f?e.fillStyle=f.fill:(e.globalAlpha=r.state==="inactive"?.18:r.state==="selected"?.72:.34,e.fillStyle=r.state==="inactive"?a:r.state==="selected"?c:p),e.fill(),e.globalAlpha=.82,e.lineWidth=Math.max(1,n.dpr),e.strokeStyle=f?.stroke||u,e.stroke(),r.owned){e.globalAlpha=1,e.lineWidth=Math.max(2,n.dpr*1.5),e.strokeStyle=c,e.stroke();let d=r.outline.reduce((m,g)=>({x:m.x+g.x,y:m.y+g.y}),{x:0,y:0});e.beginPath(),e.arc(o(d.x/r.outline.length),s(d.y/r.outline.length),Math.max(1.5,n.dpr*1.6),0,Math.PI*2),e.fillStyle=c,e.fill(),e.beginPath(),r.outline.forEach((m,g)=>g===0?e.moveTo(o(m.x),s(m.y)):e.lineTo(o(m.x),s(m.y))),e.closePath()}r.active&&(e.globalAlpha=1,e.lineJoin="round",e.lineWidth=Math.max(4,n.dpr*3.5),e.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",e.stroke(),e.lineWidth=Math.max(2,n.dpr*1.75),e.strokeStyle=c,e.stroke())}if(e.globalAlpha=1,!l.sections.length){let r=Math.max(1,n.dpr),f=new Map,d=m=>{let g=f.get(m);if(g)return g;let k=this.host.tint?.(m)||p;return f.set(m,k),k};for(let m of l.seats)e.globalAlpha=m.state==="inactive"?.22:.78,e.fillStyle=m.state==="inactive"?a:m.state==="selected"?c:d(m.categoryKey),e.beginPath(),e.arc(o(m.x),s(m.y),r,0,Math.PI*2),e.fill();e.globalAlpha=1}}drawMinimapRect(){let t=this.miniCanvas,n=this.miniBase,e=this.miniTf;if(!t||!n||!e)return;let o=t.getContext("2d");if(!o)return;o.clearRect(0,0,t.width,t.height),o.drawImage(n,0,0);let s=this.host.controller.getViewport();if(!s)return;let u=N(s.visible,s.bounds);if(this.host.root()?.toggleAttribute("data-minimap-idle",u),u)return;let a=O(s.visible,e,t.width,t.height,Math.max(2,e.dpr*2)),c=this.host.cssVar("--sl-text")||"#12151c",p=this.host.cssVar("--sl-surface")||"#fff";o.save(),o.globalAlpha=.1,o.fillStyle=c,o.fillRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),o.globalAlpha=.9,o.lineJoin="round",o.lineWidth=Math.max(4,e.dpr*3.25),o.strokeStyle=p,o.strokeRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),o.globalAlpha=1,o.lineWidth=Math.max(2,e.dpr*1.75),o.strokeStyle=c,o.strokeRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),a.clipped&&Object.values(a.clippedEdges).some(Boolean)&&(o.setLineDash([Math.max(3,e.dpr*3),Math.max(2,e.dpr*2)]),o.strokeRect(a.clipped.x,a.clipped.y,a.clipped.width,a.clipped.height)),o.restore()}minimapWorldPoint(t){let n=this.miniCanvas,e=this.miniTf;if(!n||!e)return null;let o=n.getBoundingClientRect(),s=(t.clientX-o.left)*(n.width/Math.max(1,o.width)),u=(t.clientY-o.top)*(n.height/Math.max(1,o.height));return{...H({x:s,y:u},e),px:s,py:u}}minimapPointerDown(t){let n=this.minimapWorldPoint(t),e=this.host.controller.getViewport()?.visible;!n||!e||!(n.x>=e.x&&n.x<=e.x+e.width&&n.y>=e.y&&n.y<=e.y+e.height)||(this.miniDrag={pointerId:t.pointerId,offsetX:n.x-(e.x+e.width/2),offsetY:n.y-(e.y+e.height/2),startX:t.clientX,startY:t.clientY,moved:!1},this.miniCanvas?.setPointerCapture(t.pointerId),this.miniCanvas?.classList.add("sl-dragging"),t.preventDefault())}minimapPointerMove(t){let n=this.miniDrag;if(!n||n.pointerId!==t.pointerId)return;let e=this.minimapWorldPoint(t);e&&(!n.moved&&Math.hypot(t.clientX-n.startX,t.clientY-n.startY)>2&&(n.moved=!0,this.host.controller.clearSectionFocus()),this.host.controller.panToWorld({x:e.x-n.offsetX,y:e.y-n.offsetY}),t.preventDefault())}minimapPointerUp(t){let n=this.miniDrag;!n||n.pointerId!==t.pointerId||(this.miniSuppressClick=n.moved,this.miniDrag=null,this.miniCanvas?.classList.remove("sl-dragging"),this.miniCanvas?.hasPointerCapture(t.pointerId)&&this.miniCanvas.releasePointerCapture(t.pointerId))}minimapKeydown(t){let n=this.host.controller.getViewport()?.visible;if(!n)return;if(t.key==="Home"){this.host.controller.overview(),t.preventDefault();return}let e=t.key==="ArrowLeft"?-n.width*.2:t.key==="ArrowRight"?n.width*.2:0,o=t.key==="ArrowUp"?-n.height*.2:t.key==="ArrowDown"?n.height*.2:0;!e&&!o||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:n.x+n.width/2+e,y:n.y+n.height/2+o}),t.preventDefault())}minimapJump(t){let n=this.minimapWorldPoint(t);if(n){for(let e of this.host.controller.getMinimapSnapshot().sections)if(!(e.state==="inactive"||e.outline.length<3)&&I(n,e.outline)){this.host.controller.focusSection(e.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(n)}}};export{x as a,h as b,B as c,X as d,G as e,j as f,q as g,K as h,Z as i,_ as j,z as k,J as l,Q as m,ee as n,te as o,ne as p,ie as q,oe as r,re as s,ce as t,he as u};
|