@seatlayer/core 0.103.0 → 0.104.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/{categoryInventory-D_gpkfsq.d.cts → categoryInventory-DYcNVyxN.d.cts} +1 -1
- package/dist/{categoryInventory-i-mGCBD3.d.ts → categoryInventory-QTVDRqNG.d.ts} +1 -1
- package/dist/{chunk-GPZFVQXV.js → chunk-4522UUXG.js} +1 -1
- package/dist/chunk-6YTPIDLM.js +1 -0
- package/dist/{chunk-2STEWCI2.js → chunk-BF3XROP5.js} +1 -1
- package/dist/{chunk-JRZHC75P.js → chunk-EE2CVYFJ.js} +1 -1
- package/dist/{chunk-33SRM2CP.js → chunk-GUNNA5LB.js} +1 -1
- package/dist/{chunk-QG7ZFUNX.js → chunk-HIU4MMID.js} +1 -1
- package/dist/chunk-HKVCBUON.js +1 -0
- package/dist/{chunk-76AUT55N.js → chunk-IEBXXGQC.js} +1 -1
- package/dist/{chunk-UEYHH7Y5.js → chunk-KYPY7GWB.js} +1 -1
- package/dist/{chunk-FAY7ARLB.js → chunk-O4ZAGGMP.js} +1 -1
- package/dist/{chunk-RF4QU72N.js → chunk-P2BTUNG6.js} +1 -1
- package/dist/{chunk-NWRHKTMV.js → chunk-P6ASVG3X.js} +1 -1
- package/dist/{chunk-WKWXU5QM.js → chunk-PBXGWYB4.js} +1 -1
- package/dist/{chunk-B75VUM6L.js → chunk-QFX6XSO6.js} +1 -1
- package/dist/{chunk-WH2EVBIG.js → chunk-UKODEMIM.js} +1 -1
- package/dist/{chunk-UEDS3HJ3.js → chunk-URW7MSCJ.js} +1 -1
- package/dist/core/chart-ops/index.cjs +1 -1
- package/dist/core/chart-ops/index.d.cts +4 -4
- package/dist/core/chart-ops/index.d.ts +4 -4
- package/dist/core/chart-ops/index.js +1 -1
- package/dist/core/inventory/index.d.cts +4 -4
- package/dist/core/inventory/index.d.ts +4 -4
- package/dist/core/inventory/index.js +1 -1
- package/dist/core/layout/index.cjs +1 -1
- package/dist/core/layout/index.d.cts +6 -72
- package/dist/core/layout/index.d.ts +6 -72
- package/dist/core/layout/index.js +1 -1
- package/dist/core/quality/index.d.cts +3 -3
- package/dist/core/quality/index.d.ts +3 -3
- package/dist/core/quality/index.js +1 -1
- package/dist/core/render-assets/index.d.cts +2 -2
- package/dist/core/render-assets/index.d.ts +2 -2
- package/dist/core/render-assets/index.js +1 -1
- package/dist/core/seatConfidence.d.cts +1 -1
- package/dist/core/seatConfidence.d.ts +1 -1
- package/dist/core/sections/index.d.cts +5 -5
- package/dist/core/sections/index.d.ts +5 -5
- package/dist/core/sections/index.js +1 -1
- package/dist/{eventConfigurations-C0x_OtjQ.d.cts → eventConfigurations-1sMqxBpq.d.cts} +1 -1
- package/dist/{eventConfigurations-CDPqKz_8.d.ts → eventConfigurations-B7vGmmD3.d.ts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +36 -118
- package/dist/index.d.ts +36 -118
- package/dist/index.js +1 -1
- package/dist/{labeling-DW_pEMgl.d.cts → labeling-B-FQz2d2.d.cts} +1 -1
- package/dist/{labeling-20iLar-Q.d.ts → labeling-DqyXzIgw.d.ts} +1 -1
- package/dist/{renderedQuality-BIWwSRMS.d.cts → renderedQuality-D62MKRV8.d.cts} +1 -1
- package/dist/{renderedQuality-CdpKQidA.d.ts → renderedQuality-DZOIkUX_.d.ts} +1 -1
- package/dist/{renderer-BurPZ2Io.d.ts → renderer-BIR1jJrt.d.cts} +10 -18
- package/dist/{renderer-BSjyHBDK.d.cts → renderer-CiPst9uA.d.ts} +10 -18
- package/dist/{seatTypeIcons-BlEzPXFf.d.cts → seatTypeIcons-BTw3K-yP.d.cts} +1 -1
- package/dist/{seatTypeIcons-D_T5HfJs.d.ts → seatTypeIcons-qlLxwByo.d.ts} +1 -1
- package/dist/{sections-DXUcW0ZT.d.cts → sections-Cr6f5csG.d.cts} +1 -1
- package/dist/{sections-BySKMsFE.d.ts → sections-dqlb491l.d.ts} +1 -1
- package/dist/{segmentedRowModel-C5qFY6jJ.d.ts → segmentedRowModel-BSXPftwU.d.ts} +1 -1
- package/dist/{segmentedRowModel-CyW-LFuI.d.cts → segmentedRowModel-Dy_zNI1E.d.cts} +1 -1
- package/dist/{tableSizing-Bos5ueqg.d.cts → tableSizing-BnlXRH_v.d.ts} +39 -8
- package/dist/{tableSizing-CAiE_oii.d.ts → tableSizing-DuRJVaJs.d.cts} +39 -8
- package/dist/{ticketRestrictions-DKdJWh9u.d.cts → ticketRestrictions-BBZ5mbsi.d.cts} +2 -2
- package/dist/{ticketRestrictions-DRDtAVKw.d.ts → ticketRestrictions-BEHxDUyd.d.ts} +2 -2
- package/dist/{types-ZviQR7ch.d.ts → types-CB1llwVg.d.cts} +4 -6
- package/dist/{types-ZviQR7ch.d.cts → types-CB1llwVg.d.ts} +4 -6
- package/dist/view3d/crossfade/panorama.d.cts +1 -1
- package/dist/view3d/crossfade/panorama.d.ts +1 -1
- package/dist/view3d/index.cjs +2 -2
- package/dist/view3d/index.d.cts +8 -3
- package/dist/view3d/index.d.ts +8 -3
- package/dist/view3d/index.js +5 -5
- package/dist/view3d/scene/scene.worker.cjs +1 -1
- package/dist/view3d/scene/scene.worker.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-3W4ZMU4G.js +0 -1
- package/dist/chunk-R2TRYVOY.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as f,F as d}from"../../chunk-
|
|
1
|
+
import{C as f,F as d}from"../../chunk-P6ASVG3X.js";import"../../chunk-KYPY7GWB.js";import"../../chunk-O4ZAGGMP.js";import"../../chunk-PBXGWYB4.js";import"../../chunk-HIU4MMID.js";import"../../chunk-IEBXXGQC.js";import"../../chunk-QFX6XSO6.js";import"../../chunk-P2BTUNG6.js";import"../../chunk-4N5CHKHD.js";import"../../chunk-GUNNA5LB.js";import"../../chunk-TFYAMLCK.js";import"../../chunk-EE2CVYFJ.js";import"../../chunk-URW7MSCJ.js";import"../../chunk-UKODEMIM.js";import{eb as i}from"../../chunk-HKVCBUON.js";import"../../chunk-KTMZ3QAO.js";import"../../chunk-JBOTRSMY.js";import"../../chunk-CRCGO52K.js";function p(e){return[e.solids.position,e.solids.normal,e.solids.color,e.solids.floor,e.solids.material,e.seats.iPosition,e.seats.iState,e.seats.iCategory,e.seats.iMaxRadius,e.seats.iRing,e.seats.iFloor,e.seats.iYaw,e.seats.iChairWidth,e.seats.iGlyph,e.seats.iPhysicalSeat].map(t=>t.buffer)}var c=self;c.onmessage=e=>{let s=performance.now(),t=!e.data.seats,r=e.data.seats??i(e.data.doc),{input:u,estimate:a}=d({doc:e.data.doc,seats:r,eventConfigurationId:e.data.eventConfigurationId,eventConfiguration:e.data.eventConfiguration,registeredShellGlb:e.data.registeredShellGlb,estimate:e.data.estimate}),o=f(u),n=p(o);a&&n.push(a.eyeHeightM.buffer,a.focal.buffer),c.postMessage({model:o,buildMs:performance.now()-s,...t?{seats:r}:{},...a?{estimate:a}:{}},n)};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seatlayer/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.104.0",
|
|
4
4
|
"description": "SeatLayer's seat map rendering engine — the seating chart runtime behind @seatlayer/js and the React, Vue, and Angular SDKs.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": {
|
package/dist/chunk-3W4ZMU4G.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as Ae,i as he,m as Ne,o as Le}from"./chunk-KTMZ3QAO.js";import{c as je}from"./chunk-CRCGO52K.js";var uo=2e6,Nt=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Lt=/[\s"'<>`\\]/;function jt(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return Nt.test(e);if(Lt.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}function Fe(e){let t=e.trim();return jt(t)?t:null}var Ft=2e5,ho=1e5,Dt="large_venue_inventory";function mo(e){return e?.includes(Dt)?2e5:1e5}var te="seatlayer.event-configuration/1",me="seatlayer.event-configuration-export/1",G=100,Vt=120,Ht=2e5,Ut=1e4,Ve=/^[a-f0-9]{64}$/,Gt=new Set(["stage","screen","barrier","camera_platform","sound_desk","rigging_truss"]);function z(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function H(e,t){return typeof e=="string"&&e.length>=1&&e.length<=t&&e.normalize("NFKC").trim()===e}function He(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}function De(e){return!Array.isArray(e)||e.length>Ht||!e.every(t=>H(t,G))?null:[...new Set(e)].sort()}function Ue(e){return!z(e)||!H(e.chartId,G)||!H(e.version,G)||e.sha256!==void 0&&(typeof e.sha256!="string"||!Ve.test(e.sha256))?null:{chartId:e.chartId,version:e.version,...typeof e.sha256=="string"?{sha256:e.sha256}:{}}}function pe(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=t&&e<=n}function Xt(e){return z(e)?e.mode==="none"||e.mode==="opaque"?e.opacity===void 0?{mode:e.mode}:null:e.mode==="partial"&&pe(e.opacity,.01,.99)?{mode:"partial",opacity:e.opacity}:null:null}function Kt(e,t){if(e===void 0)return;if(!Array.isArray(e)||e.length>Ut)return null;let n=new Set(t),i=new Set,o=new Set,r=0,s=[];for(let l of e){if(!z(l)||!H(l.id,G)||!H(l.objectId,G)||!n.has(l.objectId)||!Gt.has(String(l.kind))||!pe(l.heightM,.05,50)||l.baseElevationM!==void 0&&!pe(l.baseElevationM,-10,100))return null;let h=Xt(l.occlusion);if(!h||i.has(l.id)||o.has(l.objectId))return null;let a=l.contentImageUrl===void 0?void 0:typeof l.contentImageUrl=="string"?Fe(l.contentImageUrl):null;if(l.contentImageUrl!==void 0&&(!a||l.kind!=="screen"||++r>1))return null;i.add(l.id),o.add(l.objectId),s.push({id:l.id,objectId:l.objectId,kind:l.kind,heightM:l.heightM,...l.baseElevationM!==void 0?{baseElevationM:l.baseElevationM}:{},occlusion:h,...a?{contentImageUrl:a}:{}})}return s.sort((l,h)=>l.id.localeCompare(h.id))}function Ge(e){let t=[];if(!z(e))return{issues:[{code:"invalid_export",path:"configuration",message:"Configuration must be an object"}]};e.schema!==te&&t.push({code:"unsupported_schema",path:"configuration.schema",message:`Configuration schema must be ${te}`}),H(e.id,G)||t.push({code:"invalid_id",path:"configuration.id",message:"Configuration id must contain 1 to 100 normalized characters"}),H(e.label,Vt)||t.push({code:"invalid_label",path:"configuration.label",message:"Configuration label must contain 1 to 120 normalized characters"}),He(e.version)||t.push({code:"invalid_version",path:"configuration.version",message:"Configuration version must be a positive integer"});let n=Ue(e.baseVenue);n||t.push({code:"invalid_base_venue",path:"configuration.baseVenue",message:"Base venue must identify one normalized chart id and exact version"});let i=z(e.overlay)?e.overlay:null,o=De(i?.objectIds),r=De(i?.productionKillSeatIds),s=o?Kt(i?.productionElements,o):null;return(!i||!o||!r)&&t.push({code:"invalid_overlay",path:"configuration.overlay",message:"Overlay ids must be bounded arrays of normalized stable ids"}),s===null&&t.push({code:"invalid_production_element",path:"configuration.overlay.productionElements",message:"Production elements must be unique, bounded semantics over referenced base-venue objects"}),t.length||!n||!o||!r||s===null?{issues:t}:{issues:t,value:{schema:te,id:e.id,label:e.label,version:e.version,baseVenue:n,overlay:{objectIds:o,productionKillSeatIds:r,...s!==void 0?{productionElements:s}:{}}}}}function bo(e){let t=Ge(e);return t.value?{ok:!0,value:t.value}:{ok:!1,issues:t.issues}}function go(e){if(!z(e))return{ok:!1,issues:[{code:"invalid_export",path:"",message:"Export must be an object"}]};let t=[];e.schema!==me&&t.push({code:"unsupported_schema",path:"schema",message:`Export schema must be ${me}`}),(typeof e.contentSha256!="string"||!Ve.test(e.contentSha256))&&t.push({code:"invalid_checksum",path:"contentSha256",message:"Export checksum must be a lowercase SHA-256 digest"});let n=Ge(e.configuration);return t.push(...n.issues),t.length||!n.value||typeof e.contentSha256!="string"?{ok:!1,issues:t}:{ok:!0,value:{schema:me,configuration:n.value,contentSha256:e.contentSha256}}}function xo(e){return JSON.stringify({schema:te,id:e.id,label:e.label,version:e.version,baseVenue:{chartId:e.baseVenue.chartId,version:e.baseVenue.version,...e.baseVenue.sha256?{sha256:e.baseVenue.sha256}:{}},overlay:{objectIds:[...new Set(e.overlay.objectIds)].sort(),productionKillSeatIds:[...new Set(e.overlay.productionKillSeatIds)].sort(),...e.overlay.productionElements!==void 0?{productionElements:[...e.overlay.productionElements].sort((t,n)=>t.id.localeCompare(n.id)).map(t=>({id:t.id,objectId:t.objectId,kind:t.kind,heightM:t.heightM,...t.baseElevationM!==void 0?{baseElevationM:t.baseElevationM}:{},occlusion:t.occlusion,...t.contentImageUrl?{contentImageUrl:t.contentImageUrl}:{}}))}:{}}})}function So(e,t){let n=[];e.baseVenue.chartId!==t.chartId&&n.push({code:"base_venue_mismatch",message:"Configuration belongs to a different base venue"}),e.baseVenue.version!==t.version&&n.push({code:"base_venue_version_mismatch",message:"Configuration was authored against a different venue version"}),e.baseVenue.sha256&&!t.sha256?n.push({code:"base_venue_checksum_missing",message:"Venue checksum is required for this configuration"}):e.baseVenue.sha256&&e.baseVenue.sha256!==t.sha256&&n.push({code:"base_venue_checksum_mismatch",message:"Venue bytes do not match the configuration base"});let i=new Set(t.objectIds);for(let r of e.overlay.objectIds)i.has(r)||n.push({code:"overlay_object_missing",message:`Production object ${r} is missing from the base venue`,targetId:r});if(t.objectTypes)for(let r of e.overlay.productionElements??[])t.objectTypes.get(r.objectId)!=="shape"&&n.push({code:"production_element_not_shape",message:`Production element ${r.id} must reference base-venue shape geometry`,targetId:r.objectId});let o=new Set(t.seatIds);for(let r of e.overlay.productionKillSeatIds)o.has(r)||n.push({code:"production_kill_seat_missing",message:`Production-kill seat ${r} is missing from the base venue`,targetId:r});return{compatible:n.length===0,issues:n}}var Bt={draft:new Set(["review","archived"]),review:new Set(["draft","approved","archived"]),approved:new Set(["published","archived"]),published:new Set(["archived"]),archived:new Set};function Mo(e,t){return e===t||Bt[e].has(t)}function Po(e,t,n){return!He(n)||n>=t.version?null:e.find(i=>i.id===t.id&&i.version===n&&i.status==="published")??null}function Yt(e){return e.floors?.length?e.floors.flatMap(t=>t.objects):e.objects}function ye(e,t,n){if(!(!e||typeof e!="object")){if(Array.isArray(e)){for(let i of e)ye(i,t,n);return}for(let[i,o]of Object.entries(e)){if(i==="eventConfigurationId"){H(o,G)?t.add(o):o!==void 0&&n.add(String(o));continue}if(i==="eventConfigurationIds"){if(!Array.isArray(o))n.add(String(o));else for(let r of o)H(r,G)?t.add(r):n.add(String(r));continue}ye(o,t,n)}}}function vo(e,t){let n=Ue(t);if(!n)return{ok:!1,invalidIds:["baseVenue"]};let i=new Set,o=new Set;if(ye(e,i,o),o.size)return{ok:!1,invalidIds:[...o].sort()};let r=Yt(e);return{ok:!0,configurations:[...i].sort().map(s=>({schema:te,id:s,label:s,version:1,baseVenue:n,overlay:{objectIds:r.filter(l=>l.type==="shape"&&l.eventConfigurationIds?.includes(s)).map(l=>l.id).sort(),productionKillSeatIds:[]}}))}}var Io=40,wo=1200,Co=.8,_o=3,Oo=-2,ko=20,Ro=.1,To=40,Ao=40,Xe=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function zt(e,t){let n=e.text.split(/\r?\n/);if(!e.width)return Math.max(1,n.length);let i=Math.max(1,Math.floor(t/Xe(e))),o=0;for(let r of n){if(!r.length){o+=1;continue}let s=0;for(let l of r.split(/\s+/)){let h=l.length;s&&s+1+h<=i?s+=1+h:(o+=Math.max(1,Math.ceil(h/i)),s=h%i)}}return Math.max(1,o)}function Ke(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),i=Math.max(1,...n.map(l=>l.length))*Xe(e),o=e.width??i+t*2,r=Math.max(1,o-t*2),s=zt(e,r);return{width:o,height:s*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:s,padding:t}}var Be=Math.PI/180;function R(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Ye(e,t,n){let i=Math.cos(n),o=Math.sin(n),r=e.x-t.x,s=e.y-t.y;return{x:t.x+r*i-s*o,y:t.y+r*o+s*i}}function Lo(e,t,n){return n?Ye(e,t,n*Be):e}function jo(e,t){return Ye(e,{x:0,y:0},t*Be)}function j(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Wt(e){let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;let i=e.length||1;return{x:t/i,y:n/i}}function Fo(e){return e.length?Wt(e):null}function be(e,t){let n=1-t,i=n*n*n,o=3*n*n*t,r=3*n*t*t,s=t*t*t;return{x:i*e.start.x+o*e.control1.x+r*e.control2.x+s*e.end.x,y:i*e.start.y+o*e.control1.y+r*e.control2.y+s*e.end.y}}function Ho(e,t,n){let i={x:(e.x+t.x)/2,y:(e.y+t.y)/2},o={x:(n.x-i.x)*4/3,y:(n.y-i.y)*4/3};return{start:{...e},control1:{x:e.x+(t.x-e.x)/3+o.x,y:e.y+(t.y-e.y)/3+o.y},control2:{x:e.x+(t.x-e.x)*2/3+o.x,y:e.y+(t.y-e.y)*2/3+o.y},end:{...t}}}function $e(e,t,n=192){if(!Number.isInteger(t)||t<1)throw new Error("Path point count must be a positive integer");if(t===1)return[be(e,.5)];let i=Array.from({length:n+1},(h,a)=>be(e,a/n)),o=new Float64Array(i.length);for(let h=1;h<i.length;h+=1){let a=i[h].x-i[h-1].x,c=i[h].y-i[h-1].y;o[h]=o[h-1]+Math.hypot(a,c)}let r=o[o.length-1];if(r<=1e-9)return Array.from({length:t},()=>({...e.start}));let s=[],l=1;for(let h=0;h<t;h+=1){let a=r*h/(t-1);for(;l<o.length-1&&o[l]<a;)l+=1;let c=o[l-1],u=o[l],m=u===c?0:(a-c)/(u-c);s.push({x:i[l-1].x+(i[l].x-i[l-1].x)*m,y:i[l-1].y+(i[l].y-i[l-1].y)*m})}return s}function F(e,t){return{x:e.x+t.x,y:e.y+t.y}}function ne(e,t){return{x:e.x-t.x,y:e.y-t.y}}function D(e,t){return{x:e.x*t,y:e.y*t}}function se(e,t=13){return Array.from({length:t},(n,i)=>be(e,i/(t-1)))}function ze(e,t){let n=Math.max(0,Math.min(1,t))*(e.length-1),i=Math.min(e.length-2,Math.floor(n));return j(e[i],e[i+1],n-i)}function We(e,t,n){let i=Math.max(0,Math.min(1,t)),o=Math.max(i,Math.min(1,n)),r=[ze(e,i)];for(let s=1;s<e.length-1;s+=1){let l=s/(e.length-1);l>i+1e-9&&l<o-1e-9&&r.push(e[s])}return r.push(ze(e,o)),r}function qe(e,t){let n=[[0,1],[1,2],[2,3],[3,0]],i=0,o=Number.POSITIVE_INFINITY;n.forEach(([m,d],y)=>{let f=R(j(e[m],e[d],.5),t);f<o&&(o=f,i=y)});let r=e[i],s=e[(i+1)%4],l=e[(i+2)%4],h=e[(i+3)%4],a=j(r,s,.5),c=ne(t,a),u=Math.max(1e-9,Math.hypot(c.x,c.y));return{p0:r,p1:s,p2:l,p3:h,normal:D(c,1/u),depth:(R(r,h)+R(s,l))/2}}function Qe(e){let{p0:t,p1:n,p2:i,p3:o,normal:r,depth:s}=e,l=ne(n,t),h=ne(i,o),a=s*.22,c=s*.12;return{nearPath:{start:t,control1:F(F(t,D(l,1/3)),D(r,a)),control2:F(F(t,D(l,2/3)),D(r,a)),end:n},farPath:{start:i,control1:F(F(o,D(h,2/3)),D(r,c)),control2:F(F(o,D(h,1/3)),D(r,c)),end:o}}}function Uo(e,t,n){if(e.length!==4)throw new Error("A section shell requires four mapped bounds corners");let i=e.reduce((y,f)=>F(y,f),{x:0,y:0});i.x/=4,i.y/=4;let o=R(e[0],e[1]),r=R(e[0],e[3]),s=n==="auto"?o>r*1.25&&R(i,t)>r?"bezier":"tapered":n;if(s==="rectangle")return{mode:s,outline:e.map(y=>({...y}))};let l=qe(e,t),{p0:h,p1:a,p2:c,p3:u}=l;if(s==="tapered")return{mode:s,outline:[F(h,D(ne(a,h),.14)),F(h,D(ne(a,h),1-.14)),c,u]};let{nearPath:m,farPath:d}=Qe(l);return{mode:s,outline:[...se(m),...se(d).slice(1)]}}function Go(e,t,n,i){if(e.length!==4)throw new Error("Aisle generation requires four mapped bounds corners");if(!Number.isInteger(n)||n<0||n>3)throw new Error("Aisle count must be an integer from 0 to 3");if(n===0)return[];let o=qe(e,t),{p0:r,p1:s,p2:l,p3:h}=o,a=i==="bezier"?Qe(o):null,c=a?se(a.nearPath):null,u=a?se(a.farPath).reverse():null,m=Math.min(.055,.18/(n+1));return Array.from({length:n},(d,y)=>{let f=(y+1)/(n+1),g=f-m/2,v=f+m/2;return c&&u?[...We(c,g,v),...We(u,g,v).reverse()]:[j(r,s,g),j(r,s,v),j(h,l,v),j(h,l,g)]})}function $t(e,t,n){let i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,s=r?Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)):0;return Math.hypot(e.x-(t.x+s*i),e.y-(t.y+s*o))}function qt(e,t){let n=1/0;for(let i of t)if(!(i.length<2))for(let o=0,r=i.length-1;o<i.length;r=o++){let s=$t(e,i[r],i[o]);s<n&&(n=s)}return n}function Je(e,t){let n=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){let r=t[i].x,s=t[i].y,l=t[o].x,h=t[o].y;s>e.y!=h>e.y&&e.x<(l-r)*(e.y-s)/(h-s)+r&&(n=!n)}return n}function et(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function Qt(e,t,n){let i=Je(e,t)&&!n.some(r=>Je(e,r)),o=qt(e,[t,...n]);return i?o:-o}function W(e,t,n,i,o){let r=Qt({x:e,y:t},i,o);return{x:e,y:t,h:n,d:r,max:r+n*Math.SQRT2}}var ge=class{constructor(){this.items=[]}get size(){return this.items.length}push(t){let n=this.items;n.push(t);let i=n.length-1;for(;i>0;){let o=i-1>>1;if(n[o].max>=n[i].max)break;[n[o],n[i]]=[n[i],n[o]],i=o}}pop(){let t=this.items,n=t[0],i=t.pop();if(t.length&&i){t[0]=i;let o=0;for(;;){let r=o*2+1,s=r+1,l=o;if(r<t.length&&t[r].max>t[l].max&&(l=r),s<t.length&&t[s].max>t[l].max&&(l=s),l===o)break;[t[l],t[o]]=[t[o],t[l]],o=l}}return n}};function Ze(e){if(e.length<3)return 0;let t=0;for(let n=0,i=e.length-1;n<e.length;i=n++)t+=(e[i].x+e[n].x)*(e[i].y-e[n].y);return Math.abs(t)/2}function Ko(e,t){return Math.max(0,Ze(e)-et(t).reduce((n,i)=>n+Ze(i),0))}function tt(e,t){let n=et(t);if(!e.length)return{point:{x:0,y:0},radius:0};if(e.length<3){let f=e.reduce((v,E)=>v+E.x,0)/e.length,g=e.reduce((v,E)=>v+E.y,0)/e.length;return{point:{x:f,y:g},radius:0}}let i=1/0,o=1/0,r=-1/0,s=-1/0;for(let f of e)f.x<i&&(i=f.x),f.y<o&&(o=f.y),f.x>r&&(r=f.x),f.y>s&&(s=f.y);let l=r-i,h=s-o,a=Math.min(l,h);if(!(a>0))return{point:{x:(i+r)/2,y:(o+s)/2},radius:0};let c=Math.max(l,h)/150,u=new ge,m=a/2;for(let f=i;f<r;f+=a)for(let g=o;g<s;g+=a)u.push(W(f+m,g+m,m,e,n));let d=W(i+l/2,o+h/2,0,e,n),y=0;for(;u.size;){let f=u.pop();if(!f)break;f.d>d.d&&(d=f),!(f.max-d.d<=c)&&(y>=4e3||(y+=1,m=f.h/2,u.push(W(f.x-m,f.y-m,m,e,n)),u.push(W(f.x+m,f.y-m,m,e,n)),u.push(W(f.x-m,f.y+m,m,e,n)),u.push(W(f.x+m,f.y+m,m,e,n))))}return{point:{x:d.x,y:d.y},radius:Math.max(0,d.d)}}function Jt(e,t,n){return Math.max(t,Math.min(n,e))}function Yo(e,t,n){return e<t?t:e>n?n:e}function Zt(e){return Jt(e,0,1)}function nt(e){let t=Zt(e);return t*t*(3-2*t)}var $=Math.PI*2;function q(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function en(e,t,n){let i=t-e;if(n){for(;i<0;)i+=$;for(;i>=$;)i-=$}else{for(;i>0;)i-=$;for(;i<=-$;)i+=$}return i}function qo(e){return e.end}function rt(e){if(e.version!==1||e.closed!==!0||!q(e.start)||!Array.isArray(e.segments)||e.segments.length<2||e.segments.length>512)return!1;let t=e.start;for(let n of e.segments){if(!n||!q(n.end))return!1;if(n.kind==="line"){if(R(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!q(n.control1)||!q(n.control2)||R(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!q(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(R(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(R(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||R(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return R(t,e.start)<=1e-4}function tn(e,t,n){let i=1-n;return{x:i**3*e.x+3*i**2*n*t.control1.x+3*i*n**2*t.control2.x+n**3*t.end.x,y:i**3*e.y+3*i**2*n*t.control1.y+3*i*n**2*t.control2.y+n**3*t.end.y}}function st(e,t=2){if(!rt(e))throw new Error("Section outline path is invalid");let n=Math.max(.25,t),i=[{...e.start}],o=e.start;for(let r of e.segments){if(r.kind==="line")i.push({...r.end});else if(r.kind==="arc"){let s=Math.atan2(o.y-r.center.y,o.x-r.center.x),l=Math.atan2(r.end.y-r.center.y,r.end.x-r.center.x),h=en(s,l,r.clockwise),a=Math.max(2,Math.ceil(Math.abs(h)*r.radius/n));for(let c=1;c<=a;c+=1){let u=s+h*c/a;i.push({x:r.center.x+Math.cos(u)*r.radius,y:r.center.y+Math.sin(u)*r.radius})}}else{let s=R(o,r.control1)+R(r.control1,r.control2)+R(r.control2,r.end),l=Math.max(2,Math.ceil(s/n));for(let h=1;h<=l;h+=1)i.push(tn(o,r,h/l))}o=r.end}return R(i[i.length-1],i[0])<=1e-4&&i.pop(),i}function at(e,t,n){return nn(e,o=>({x:o.x+t,y:o.y+n}))}function nn(e,t,n=1,i=!1){return{...e,start:t(e.start),segments:e.segments.map(o=>o.kind==="line"?{...o,end:t(o.end)}:o.kind==="arc"?{...o,center:t(o.center),radius:o.radius*Math.abs(n),clockwise:i?!o.clockwise:o.clockwise,end:t(o.end)}:{...o,control1:t(o.control1),control2:t(o.control2),end:t(o.end)})}}function Qo(e){return e.map(t=>t===0?0:-t)}var on=45,xe=150,rn=60;function sn(e){let t=on/100;if(e<=t)return xe;let n=Math.min(1,(e-t)/(1-t));return xe-n*(xe-rn)}var ot=.5523;function it(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function an(e){let t=[],n=[];for(e.forEach((i,o)=>{q(i)&&(t.length&&it(t[t.length-1],i)||(t.push({x:i.x,y:i.y}),n.push(o)))});t.length>1&&it(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}function Jo(e,t,n){return Se(e,{cornerSmoothing:t,...n})}var cn=.5,ln=4/3;function un(e,t,n){let i=t.x-e.x,o=t.y-e.y,r=Math.hypot(i,o);if(r<=1e-9)return{kind:"line",end:{...t}};let s=-o/r,l=i/r,h=n*ln;return{kind:"bezier",control1:{x:e.x+i/3+s*h,y:e.y+o/3+l*h},control2:{x:e.x+i*2/3+s*h,y:e.y+o*2/3+l*h},end:{...t}}}function Se(e,t){let{points:n,sourceIndex:i}=an(e),o=n.length;if(o<3)return null;let r=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,s=t.edgeCurvature,l=new Array(o).fill(0);if(s?.length)for(let x=0;x<o;x+=1){let S=s[i[x]];l[x]=Number.isFinite(S)?Math.min(100,Math.max(-100,S))/100:0}let h=l.some(x=>Math.abs(x)>1e-6);if(r<=0&&!h)return null;let a=t.wideAngleThresholdDeg??sn(r),c=[];for(let x=0;x<o;x+=1)c[x]=R(n[x],n[(x+1)%o]);let u=new Array(o).fill(0);for(let x=0;x<o;x+=1){let S=n[(x-1+o)%o],p=n[x],b=n[(x+1)%o],P={x:S.x-p.x,y:S.y-p.y},M={x:b.x-p.x,y:b.y-p.y},C=Math.hypot(P.x,P.y),T=Math.hypot(M.x,M.y);if(C<=1e-9||T<=1e-9)continue;let I=Math.min(1,Math.max(-1,(P.x*M.x+P.y*M.y)/(C*T))),_=Math.acos(I)*180/Math.PI;if(_<a)continue;let O=nt((_-a)/(180-a));u[x]=r*O*.5*Math.min(C,T)}for(let x=0;x<o;x+=1){let S=(x+1)%o,p=u[x]+u[S];if(p>c[x]&&p>1e-9){let b=c[x]/p;u[x]*=b,u[S]*=b}}let m=new Array(o),d=new Array(o);for(let x=0;x<o;x+=1){let S=n[(x-1+o)%o],p=n[x],b=n[(x+1)%o];if(u[x]<=1e-6){m[x]={...p},d[x]={...p};continue}let P=R(p,S)||1,M=R(p,b)||1;m[x]={x:p.x+(S.x-p.x)/P*u[x],y:p.y+(S.y-p.y)/P*u[x]},d[x]={x:p.x+(b.x-p.x)/M*u[x],y:p.y+(b.y-p.y)/M*u[x]}}if(u.every(x=>x<=1e-6)&&!h)return null;let y=[],f={...d[0]},g=f,v=(x,S)=>{if(R(g,x)<=1e-9)return;let p=l[S];Math.abs(p)>1e-6?y.push(un(g,x,p*cn*c[S])):y.push({kind:"line",end:{...x}}),g=x};for(let x=1;x<=o;x+=1){let S=x%o,p=n[S];v(m[S],(x-1)%o),u[S]>1e-6&&R(m[S],d[S])>1e-9&&(y.push({kind:"bezier",control1:j(m[S],p,ot),control2:j(d[S],p,ot),end:{...d[S]}}),g=d[S])}if(!y.length)return null;let E=y[y.length-1];R(E.end,f)>1e-9&&(E.kind==="line"?E.end={...f}:y.push({kind:"line",end:{...f}}));let w={version:1,closed:!0,start:f,segments:y};return rt(w)?w:null}function Zo(e){let t=[],n=e.start;for(let o of e.segments)t.push(n),n=o.end;let i=[];for(let o=e.segments.length-1;o>=0;o-=1){let r=e.segments[o],s=t[o];r.kind==="line"?i.push({kind:"line",end:{...s}}):r.kind==="arc"?i.push({kind:"arc",center:{...r.center},radius:r.radius,clockwise:!r.clockwise,end:{...s}}):i.push({kind:"bezier",control1:{...r.control2},control2:{...r.control1},end:{...s}})}return{version:1,closed:!0,start:{...e.start},segments:i}}function ti(e,t,n){let i=[];for(let o=0;o<e.length-1;o+=1){let r=e[o],s=e[o+1],l=Math.hypot(s.x-r.x,s.y-r.y);if(l<=0)continue;let h=Math.max(1,Math.round(l/n)),a=l/h,c=Math.atan2(s.y-r.y,s.x-r.x),u=o===0,d=(o>0?t[o-1]:void 0)==="break"?2:1,y=u?{...r}:{x:r.x+Math.cos(c)*a*d,y:r.y+Math.sin(c)*a*d},f=u?h+1:Math.max(1,h-(d-1));i.push({origin:y,rotation:c*180/Math.PI,seatCount:f,seatSpacing:a})}return i}function ni(e){let t=e.rotation*Math.PI/180,n={x:Math.cos(t),y:Math.sin(t)};return Array.from({length:e.seatCount},(i,o)=>({x:e.origin.x+n.x*o*e.seatSpacing,y:e.origin.y+n.y*o*e.seatSpacing}))}function oi(e){return e.reduce((t,n)=>t+n.seatCount,0)}function ct(e){let t=new Map,n=new Map;for(let i of e){if(i.type!=="row"||!i.segmentedRow)continue;let o=n.get(i.segmentedRow.groupId)??[];o.push(i),n.set(i.segmentedRow.groupId,o)}for(let[i,o]of n){let r=o.slice().sort((m,d)=>m.segmentedRow.componentIndex-d.segmentedRow.componentIndex),s=r[0]?.segmentedRow?.componentCount??0,l=r[0]?.segmentedRow;if(!l||!(s>=2&&r.length===s&&l?.boundaryBefore==="start"&&r.every((m,d)=>m.segmentedRow?.kind==="segmented-row-v1"&&m.segmentedRow.groupId===i&&m.segmentedRow.componentCount===s&&m.segmentedRow.componentIndex===d&&m.segmentedRow.repeatLabelOnComponents===l.repeatLabelOnComponents&&(d===0?m.segmentedRow.boundaryBefore==="start":m.segmentedRow.boundaryBefore!=="start")&&m.segmentedRow.displayLabel===l.displayLabel)))continue;let a=r.reduce((m,d)=>m+d.seatCount,0),c=0,u=0;for(let m of r)m.segmentedRow.boundaryBefore==="break"&&(c+=1),t.set(m.id,{groupId:i,adjacencyOffset:c,displayOffset:u,displayLabel:l.displayLabel,totalSeats:a,canonical:r[0],viewFromSeatUrl:l.viewFromSeatUrl,viewFromSeatMeta:l.viewFromSeatMeta,confidenceEvidence:l.confidenceEvidence}),c+=m.seatCount,u+=m.seatCount}return t}var Q=.02291666666666667,ve=1/Q,dn=58,fn=dn*Q,lt=0,dt=3,ut=0,Me=120,hn=0,mn=45,pn=7,J=1.2;function Pe(e,t,n,i){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):i}function ri(e){return Number.isFinite(e)?Math.max(lt,Math.min(dt,Math.round(e))):lt}function yn(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=pn?e:dt}function ft(e,t={}){let n=Pe(t.floorBaseHeightM,ut,Me,0),i=Math.min(Me,n+yn(e.elevation)*fn),o=e.height===void 0?i:Pe(e.height,ut,Me,i),r=Pe(e.rake,hn,mn,0);return{height:o,rake:r}}function ht(e){let t=e.length;return t<=3?[...e]:[e[Math.floor(t*.25)],e[Math.floor(t*.5)],e[Math.floor(t*.75)]]}function mt(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let i=1/0;for(let o=0;o+1<e.length;o++){let r=e[o],s=e[o+1],l=s.x-r.x,h=s.y-r.y,a=l*l+h*h,c=a>1e-12?((t-r.x)*l+(n-r.y)*h)/a:0;c<0?c=0:c>1&&(c=1);let u=t-(r.x+c*l),m=n-(r.y+c*h);if(Math.abs(u)>=i||Math.abs(m)>=i)continue;let d=Math.hypot(u,m);d<i&&(i=d)}return i}function bn(e){let t=0,n=0;for(let r of e)t+=r.x,n+=r.y;let i=e.length||1;t/=i,n/=i;let o=0;for(let r of e){let s=Math.hypot(r.x-t,r.y-n);s>o&&(o=s)}return{cx:t,cy:n,r:o}}function pt(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function Ee(e,t){let n=1/0;for(let i of ht(e)){let o=mt(t,i.x,i.y);o<n&&(n=o)}for(let i of ht(t)){let o=mt(e,i.x,i.y);o<n&&(n=o)}return n}function gn(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,i=0;for(let c of e)n+=c.x,i+=c.y;n/=e.length,i/=e.length;let o=-1,r=e[0];for(let c of e){let u=Math.hypot(c.x-n,c.y-i);u>o&&(o=u,r=c)}let s=r.x-n,l=r.y-i,h=Math.hypot(s,l);h>1e-9?(s/=h,l/=h):(s=1,l=0);let a=e.map((c,u)=>({p:c,i:u,t:(c.x-n)*s+(c.y-i)*l})).sort((c,u)=>c.t-u.t);return{pts:a.map(c=>c.p),seatIndices:a.map(c=>t[c.i])}}function xn(e){let t=e.length;if(t<3)return null;let n=0,i=0;for(let E of e)n+=E.x,i+=E.y;n/=t,i/=t;let o=0,r=0,s=0,l=0,h=0,a=0,c=0;for(let E of e){let w=E.x-n,x=E.y-i;o+=w*w,s+=x*x,r+=w*x,l+=w*w*w,h+=x*x*x,a+=w*x*x,c+=x*w*w}let u=o*s-r*r;if(Math.abs(u)<1e-9)return null;let m=(l+a)/2,d=(h+c)/2,y=(m*s-d*r)/u,f=(d*o-m*r)/u,g=y+n,v=f+i;return!Number.isFinite(g)||!Number.isFinite(v)?null:{cx:g,cy:v}}var Sn=.15;function Mn(e){if(e.length<2)return null;let t=e.map(S=>{let p=0,b=0;for(let P of S.pts)p+=P.x,b+=P.y;return{x:p/S.pts.length,y:b/S.pts.length}}),n=0,i=0;for(let S of t)n+=S.x,i+=S.y;n/=t.length,i/=t.length;let o=0,r=0,s=0;for(let S of t){let p=S.x-n,b=S.y-i;o+=p*p,r+=p*b,s+=b*b}let l=o+s,h=o*s-r*r,a=l/2+Math.sqrt(Math.max(0,l*l/4-h)),c,u;Math.abs(r)>1e-12?(c=a-s,u=r):o>=s?(c=1,u=0):(c=0,u=1);let m=Math.hypot(c,u);if(!(m>1e-12))return null;c/=m,u/=m;let d=0,y=0,f=0;for(let S of e){if(S.pts.length<2)continue;let p=S.pts[0],b=S.pts[S.pts.length-1],P=b.x-p.x,M=b.y-p.y,C=Math.hypot(P,M);if(!(C>1e-9))continue;let T=P/C,I=M/C;d+=(T*T-I*I)*C,y+=2*T*I*C,f+=C}if(f>0&&Math.hypot(d,y)>=vn*f){let S=Math.atan2(y,d)/2,p=Math.cos(S),b=Math.sin(S);Math.abs(c*p+u*b)>En&&(c=-b,u=p)}let g=1/0,v=-1/0,E=[];for(let S of e){let p=1/0,b=-1/0;for(let P of S.pts){let M=P.x*c+P.y*u;M<p&&(p=M),M>b&&(b=M),M<g&&(g=M),M>v&&(v=M)}E.push(b-p)}let w=v-g;return w>1e-9?(E.sort((S,p)=>S-p),E[Math.min(E.length-1,Math.floor(E.length*.9))]/w<=Pn?{x:c,y:u}:null):null}var Pn=.35,vn=.8,En=.7;function yt(e,t,n,i){let o=new Map;for(let p of n){let b=t[p],P=b.rowId||`__seat-${p}`,M=o.get(P);M||(M={pts:[],idx:[]},o.set(P,M)),M.pts.push({x:b.x,y:b.y}),M.idx.push(p)}if(!o.size)return{sectionId:e,rows:[],blockCount:0};let r=[];for(let[p,b]of o){let P=gn(b.pts,b.idx),M=0;for(let C of P.pts)M+=Math.hypot(C.x-i.x,C.y-i.y);r.push({id:p,pts:P.pts,seatIndices:P.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:M/P.pts.length})}let s=r.map(p=>bn(p.pts)),l=r.length<=256?r.length*(r.length-1)/2:0,h=l?new Float64Array(l):null;h?.fill(Number.NaN);let a=h?new Map(r.map((p,b)=>[p,b])):null,c=(p,b)=>(p>b&&([p,b]=[b,p]),p*(2*r.length-p-1)/2+(b-p-1)),u=(p,b)=>{if(!h)return Ee(r[p].pts,r[b].pts);let P=c(p,b),M=h[P];if(!Number.isNaN(M))return M;let C=Ee(r[p].pts,r[b].pts);return h[P]=C,C},m=(p,b)=>a?u(a.get(p),a.get(b)):Ee(p.pts,b.pts),d=[];for(let p=0;p<r.length;p++){let b=1/0;for(let P=0;P<r.length;P++){if(p===P||pt(s[p],s[P])>=b)continue;let M=u(p,P);M<b&&(b=M)}Number.isFinite(b)&&d.push(b)}d.sort((p,b)=>p-b);let y=d.length?d[Math.floor(d.length/2)]:1,f=Math.max(y*1.8,1e-6),g=r.map(()=>[]);for(let p=0;p<r.length;p++)for(let b=p+1;b<r.length;b++)pt(s[p],s[b])>f||u(p,b)<=f&&(g[p].push(b),g[b].push(p));let v=0;for(let p=0;p<r.length;p++){if(r[p].blockId!==-1)continue;let b=v++,P=[p];for(r[p].blockId=b;P.length;){let M=P.pop();for(let C of g[M])r[C].blockId===-1&&(r[C].blockId=b,P.push(C))}}let E=new Map;for(let p of r){let b=E.get(p.blockId)??[];b.push(p),E.set(p.blockId,b)}let w=[];for(let p of r){if(p.pts.length<4)continue;let b=xn(p.pts);b&&(!Number.isFinite(b.cx)||!Number.isFinite(b.cy)||w.push({x:b.cx,y:b.cy}))}let x=w.length>=2?(()=>{let p=w.map(M=>M.x).sort((M,C)=>M-C),b=w.map(M=>M.y).sort((M,C)=>M-C),P=Math.floor(w.length/2);return{cx:p[P],cy:b[P]}})():null;if(x){let p=I=>Math.hypot(I.x-x.cx,I.y-x.cy),b=1/0,P=-1/0,M=[];for(let I of r){let _=1/0,O=-1/0;for(let N of I.pts){let A=p(N);A<_&&(_=A),A>O&&(O=A)}M.push(O-_),_<b&&(b=_),O>P&&(P=O)}let C=P-b;M.sort((I,_)=>I-_);let T=M[Math.min(M.length-1,Math.floor(M.length*.9))];if(C>1e-9&&T/C<=Sn){let I=r.map(k=>{let re=0;for(let At of k.pts)re+=p(At);return{row:k,radius:re/k.pts.length}}),_=0,O=0;for(let k of I)_+=k.radius,O+=k.row.focalDistance;_/=I.length,O/=I.length;let N=0;for(let k of I)N+=(k.radius-_)*(k.row.focalDistance-O);if(N<0)for(let k of I)k.radius=-k.radius;let L=1/0;for(let k of I)k.radius<L&&(L=k.radius);I.sort((k,re)=>k.radius-re.radius);let V=-1,Y=-1/0,Tt=C/Math.max(1,I.length)*.5,Te=[];for(let k of I)k.radius-Y>Tt&&(V++,Y=k.radius),k.row.ordinal=V,k.row.blockDepth=k.radius-L,Te.push(k.row);return{sectionId:e,rows:Te,blockCount:v}}}let S=[];for(let[,p]of E){let b=Mn(p);if(b){let P=I=>{let _=0;for(let O of I.pts)_+=O.x*b.x+O.y*b.y;return _/I.pts.length};p.sort((I,_)=>P(I)-P(_)),p.length>=2&&p[0].focalDistance>p[p.length-1].focalDistance&&p.reverse();let M=[],C=y*.5;for(let I of p){let _=M[M.length-1];_&&Math.abs(P(I)-P(_[0]))<C?_.push(I):M.push([I])}let T=0;for(let I=0;I<M.length;I++){if(I>0){let _=1/0;for(let O of M[I-1])for(let N of M[I])_=Math.min(_,m(O,N));T+=_}for(let _ of M[I])_.ordinal=I,_.blockDepth=T,S.push(_)}}else{let P=1/0;for(let M of p)M.focalDistance<P&&(P=M.focalDistance);p.sort((M,C)=>M.focalDistance-C.focalDistance);for(let M=0;M<p.length;M++)p[M].ordinal=M,p[M].blockDepth=Math.max(0,p[M].focalDistance-P),S.push(p[M])}}return{sectionId:e,rows:S,blockCount:v}}function In(e,t){return Math.abs(e.x-t.x)<=1e-7&&Math.abs(e.y-t.y)<=1e-7}function oe(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function ae(e,t,n){let i=oe(t,n,e);return Math.abs(i)>1e-7?!1:e.x>=Math.min(t.x,n.x)-1e-7&&e.x<=Math.max(t.x,n.x)+1e-7&&e.y>=Math.min(t.y,n.y)-1e-7&&e.y<=Math.max(t.y,n.y)+1e-7}function wn(e,t,n,i){let o=oe(e,t,n),r=oe(e,t,i),s=oe(n,i,e),l=oe(n,i,t);return(o>1e-7&&r<-1e-7||o<-1e-7&&r>1e-7)&&(s>1e-7&&l<-1e-7||s<-1e-7&&l>1e-7)?!0:Math.abs(o)<=1e-7&&ae(n,e,t)||Math.abs(r)<=1e-7&&ae(i,e,t)||Math.abs(s)<=1e-7&&ae(e,n,i)||Math.abs(l)<=1e-7&&ae(t,n,i)}function Cn(e){return e.reduce((t,n,i)=>{let o=e[(i+1)%e.length];return t+n.x*o.y-o.x*n.y},0)}function _n(e){for(let t=0;t<e.length;t+=1){let n=(t+1)%e.length;for(let i=t+1;i<e.length;i+=1){let o=(i+1)%e.length;if(!(t===i||n===i||o===t)&&wn(e[t],e[n],e[i],e[o]))return!0}}return!1}function ci(e){return e.length<3?{ok:!1,code:"too_few_vertices",message:"Add at least three vertices to create a polygon."}:e.length>256?{ok:!1,code:"too_many_vertices",message:"A polygon can contain at most 256 vertices."}:e.some(t=>!Number.isFinite(t.x)||!Number.isFinite(t.y)||Math.abs(t.x)>1e7||Math.abs(t.y)>1e7)?{ok:!1,code:"invalid_coordinate",message:"Every polygon vertex must use a finite coordinate inside the safe chart range."}:e.some((t,n)=>In(t,e[(n+1)%e.length]))?{ok:!1,code:"duplicate_vertex",message:"Move or remove duplicate neighbouring vertices."}:Math.abs(Cn(e))<2?{ok:!1,code:"degenerate_polygon",message:"The polygon needs a visible enclosed area."}:_n(e)?{ok:!1,code:"self_intersection",message:"Polygon edges cannot cross or touch each other."}:{ok:!0}}var fi=64;function On(e){let t=e.points??[];if(e.kind!=="polygon"||t.length<3||!Array.isArray(e.edgeCurvature))return[];let n=t.map((i,o)=>{let r=e.edgeCurvature[o];return Number.isFinite(r)?Math.min(100,Math.max(-100,r)):0});return n.some(i=>Math.abs(i)>.5)?n:[]}function kn(e){let t=On(e);return t.length?Se(e.points,{edgeCurvature:t}):null}function ie(e,t=2){let n=kn(e);return n?st(n,t):e.points??[]}function hi(e){return e.kind==="polygon"?X(e.holes):[]}function mi(e,t){let n=ie(e);return n.length<3||t.length<3||!t.flatMap((o,r)=>{let s=t[(r+1)%t.length];return[o,{x:(o.x+s.x)/2,y:(o.y+s.y)/2}]}).every(o=>Z(o,n)||Ie(o,n))?!1:!t.some((o,r)=>{let s=t[(r+1)%t.length];return n.some((l,h)=>bt(o,s,l,n[(h+1)%n.length]))})}function bt(e,t,n,i){let o=(a,c,u)=>(c.x-a.x)*(u.y-a.y)-(c.y-a.y)*(u.x-a.x),r=o(e,t,n),s=o(e,t,i),l=o(n,i,e),h=o(n,i,t);return r*s<-1e-9&&l*h<-1e-9}function pi(e,t){return Z(e[0],t)||Z(t[0],e)?!0:e.some((n,i)=>{let o=e[(i+1)%e.length];return t.some((r,s)=>bt(n,o,r,t[(s+1)%t.length]))})}var gi=[{key:"rect",label:"Flat stage",blurb:"Classic proscenium box."},{key:"rounded",label:"Rounded",blurb:"Softened corners."},{key:"arc",label:"Curved front",blurb:"Front edge bows toward the audience."},{key:"thrust",label:"Thrust (T)",blurb:"Central tongue projects into the crowd."},{key:"runway",label:"Runway",blurb:"Long catwalk into the audience."},{key:"round",label:"In the round",blurb:"Central platform, audience all around."},{key:"pitch-football",label:"Football pitch",blurb:"105 \xD7 68 m pitch with centre circle and penalty boxes."},{key:"rink-hockey",label:"Hockey rink",blurb:"60 \xD7 30 m ice rink with blue lines and faceoff circles."},{key:"track-athletics",label:"Athletics track",blurb:"400 m track: two straights, two semicircles, eight lanes."},{key:"oval-cricket",label:"Cricket oval",blurb:"~150 \xD7 140 m oval with boundary rope and pitch strip."},{key:"pitch-rugby",label:"Rugby pitch",blurb:"100 \xD7 70 m field of play with in-goal areas, 22 m and 10 m lines."},{key:"diamond-baseball",label:"Baseball field",blurb:"Diamond, infield, mound and foul lines out to 99 m poles."},{key:"court-basketball",label:"Basketball court",blurb:"28 \xD7 15 m court with keys and three-point lines."},{key:"court-tennis",label:"Tennis court",blurb:"23.77 \xD7 10.97 m doubles court with run-off and net."},{key:"ring-boxing",label:"Boxing ring",blurb:"Raised ring, 6.1 m inside the ropes, coloured corners."}],Rn=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing"]),Tn=new Set(["pitch-football","track-athletics","oval-cricket","pitch-rugby","diamond-baseball"]);function An(e){return!!e&&Rn.has(e)}function xi(e){return!!e&&Tn.has(e)}var Ce=1.1;function Si(e){return ce(e)?e==="ring-boxing"?Ce:.06:1}var gt={"pitch-football":{width:105,height:68},"rink-hockey":{width:60,height:30},"track-athletics":{width:176.9,height:92.5},"oval-cricket":{width:150,height:140},"pitch-rugby":{width:120,height:70},"diamond-baseball":{width:140,height:140},"court-basketball":{width:32,height:19},"court-tennis":{width:36.57,height:18.29},"ring-boxing":{width:7.8,height:7.8}},xt={"pitch-football":"#2f7d4f","rink-hockey":"#e8f1f8","track-athletics":"#a4472f","oval-cricket":"#3d8a53","pitch-rugby":"#2f7d4f","diamond-baseball":"#2f7d4f","court-basketball":"#c8894f","court-tennis":"#3f7a5a","ring-boxing":"#2a4d8f"};function Mi(e){let t=gt[e];return t?{width:t.width*ve,height:t.height*ve}:{width:300,height:70}}var Nn="#232c40",St=Math.PI*2;function Mt(e,t,n,i,o,r){return{x:o+e*n-t*i,y:r+e*i+t*n}}function Ln(e){let{kind:t,cx:n,cy:i,width:o,height:r}=e,s=(e.rotation??0)*Math.PI/180,l=Math.cos(s),h=Math.sin(s),a=o/2,c=r/2,u=[],m=(d,y)=>{u.push({x:d,y})};switch(t){case"rect":{m(-a,-c),m(a,-c),m(a,c),m(-a,c);break}case"rounded":{let d=Math.min(o,r)*.18,y=5,f=(g,v,E)=>{for(let w=0;w<=y;w++){let x=E+w/y*(Math.PI/2);m(g+d*Math.cos(x),v+d*Math.sin(x))}};f(a-d,-c+d,-Math.PI/2),f(a-d,c-d,0),f(-a+d,c-d,Math.PI/2),f(-a+d,-c+d,Math.PI);break}case"arc":{let d=r*.45;m(-a,-c),m(a,-c);let y=24;for(let f=0;f<=y;f++){let g=f/y,v=a-g*o,E=c+d*(1-Math.pow(2*v/o,2));m(v,E)}break}case"thrust":{let d=o*.18,y=r*1.1;m(-a,-c),m(a,-c),m(a,c),m(d,c),m(d,c+y),m(-d,c+y),m(-d,c),m(-a,c);break}case"runway":{let d=o*.1,y=r*3;m(-a,-c),m(a,-c),m(a,c),m(d,c),m(d,c+y),m(-d,c+y),m(-d,c),m(-a,c);break}case"round":case"oval-cricket":{for(let y=0;y<40;y++){let f=y/40*St;m(a*Math.cos(f),c*Math.sin(f))}break}case"pitch-football":case"pitch-rugby":case"court-basketball":case"court-tennis":case"ring-boxing":{m(-a,-c),m(a,-c),m(a,c),m(-a,c);break}case"diamond-baseball":{for(let d of Fn(a,c))m(d.x,d.y);break}case"rink-hockey":{for(let d of jn(a,c,a*(8.5/60),c*(8.5/30)))m(d.x,d.y);break}case"track-athletics":{for(let d of we(a,c))m(d.x,d.y);break}}return u.map(d=>Mt(d.x,d.y,l,h,n,i))}function Pi(e,t="stage"){return{type:"shape",id:t,kind:"polygon",points:Ln(e),fill:e.fill??xt[e.kind]??Nn,label:e.label??"STAGE",role:"stage",stageKind:e.kind}}function jn(e,t,n,i){let o=[],s=(l,h,a)=>{for(let c=0;c<=8;c++){let u=a+c/8*(Math.PI/2);o.push({x:l+n*Math.cos(u),y:h+i*Math.sin(u)})}};return s(e-n,-t+i,-Math.PI/2),s(e-n,t-i,0),s(-e+n,t-i,Math.PI/2),s(-e+n,-t+i,Math.PI),o}function we(e,t){let n=Math.max(0,e-t),i=[],o=20;for(let r=0;r<=o;r++){let s=-Math.PI/2+r/o*Math.PI;i.push({x:n+t*Math.cos(s),y:t*Math.sin(s)})}for(let r=0;r<=o;r++){let s=Math.PI/2+r/o*Math.PI;i.push({x:-n+t*Math.cos(s),y:t*Math.sin(s)})}return i}var B=(()=>{let t={x:0,y:52},n=25,i={x:70,y:t.y-70},o=(i.x*i.x+i.y*i.y-4900)/(2*(i.y+70)),r=o+70,s=[],l=Math.atan2(i.y-o,i.x),h=Math.atan2(i.y-o,-i.x);for(let a=0;a<=24;a++){let c=l+(h-l)*a/24;s.push({x:r*Math.cos(c),y:o+r*Math.sin(c)})}return{half:70,home:t,backstop:n,fence:s}})();function Fn(e,t){let n=e/B.half,i=t/B.half;return[{x:-B.backstop*n,y:t},{x:B.backstop*n,y:t},...B.fence.map(o=>({x:o.x*n,y:o.y*i}))]}var Dn="#f1f5f9";function vi(e){switch(e){case"pitch-football":return"PITCH";case"rink-hockey":return"RINK";case"track-athletics":return"TRACK";case"oval-cricket":return"OVAL";case"pitch-rugby":return"PITCH";case"diamond-baseball":return"FIELD";case"court-basketball":case"court-tennis":return"COURT";case"ring-boxing":return"RING";default:return"STAGE"}}function ce(e){return An(e)}function K(e,t,n,i,o=32){let r=[];for(let s=0;s<o;s++){let l=s/o*St;r.push({x:e+n*Math.cos(l),y:t+i*Math.sin(l)})}return r}function U(e,t,n,i){return[{x:e-n,y:t-i},{x:e+n,y:t-i},{x:e+n,y:t+i},{x:e-n,y:t+i}]}function Vn(e){let{kind:t,cx:n,cy:i,width:o,height:r}=e,s=(e.rotation??0)*Math.PI/180,l=Math.cos(s),h=Math.sin(s),a=o/2,c=r/2,u=[],m=gt[t],d=f=>m?f/m.width*o:0,y=f=>m?f/m.height*r:0;switch(t){case"pitch-football":{u.push({points:[{x:0,y:-c},{x:0,y:c}],closed:!1}),u.push({points:K(0,0,d(9.15),y(9.15)),closed:!0});for(let f of[-1,1])u.push({points:U(f*(a-d(16.5)/2),0,d(16.5)/2,y(40.32)/2),closed:!0}),u.push({points:U(f*(a-d(5.5)/2),0,d(5.5)/2,y(18.32)/2),closed:!0});break}case"rink-hockey":{u.push({points:[{x:0,y:-c},{x:0,y:c}],closed:!1,ink:"#d63b3b"});for(let f of[-1,1]){u.push({points:[{x:f*d(7.5),y:-c},{x:f*d(7.5),y:c}],closed:!1,ink:"#2f6ecb"}),u.push({points:[{x:f*(a-d(4)),y:-y(11)},{x:f*(a-d(4)),y:y(11)}],closed:!1,ink:"#d63b3b"});for(let g of[-1,1])u.push({points:K(f*d(20.5),g*y(7),d(4.5),y(4.5)),closed:!0,ink:"#2f6ecb"})}u.push({points:K(0,0,d(4.5),y(4.5)),closed:!0,ink:"#2f6ecb"});break}case"track-athletics":{let g=c-y(1.22)*8;g>0&&u.push({points:we(a-d(1.22)*8,g),closed:!0,fill:"#2f7d4f"});for(let v=1;v<8;v++){let E=y(1.22)*v,w=c-E;if(w<=0)break;u.push({points:we(a-d(1.22)*v,w),closed:!0})}break}case"oval-cricket":{u.push({points:K(0,0,d(27.4),y(27.4+20.12/2),40),closed:!0}),u.push({points:U(0,0,d(3.05)/2,y(20.12)/2),closed:!0,ink:"#d8cfae"});break}case"pitch-rugby":{let f=g=>({points:[{x:d(g),y:-c},{x:d(g),y:c}],closed:!1});u.push(f(0));for(let g of[-1,1]){u.push(f(g*50),f(g*28));for(let v=-35;v<35;v+=4)u.push({points:[{x:d(g*10),y:y(v)},{x:d(g*10),y:y(Math.min(35,v+2))}],closed:!1})}break}case"diamond-baseball":{let f=(A,L)=>({x:d(A),y:y(L)}),{home:g}=B,v=27.43,E=v/Math.SQRT2,w={x:g.x+E,y:g.y-E},x={x:g.x,y:g.y-2*E},S={x:g.x-E,y:g.y-E},p={x:g.x,y:g.y-18.44},b="#b98a59",P=xt["diamond-baseball"],M=38.94,C=[f(g.x,g.y)],T=Math.atan2(g.y-M/Math.SQRT2-p.y,M/Math.SQRT2),I=Math.PI-T;for(let A=0;A<=16;A++){let L=T-(T+Math.PI*2-I)%(Math.PI*2)*(A/16);C.push(f(p.x+29*Math.cos(L),p.y+29*Math.sin(L)))}u.push({points:C,closed:!0,fill:b,ink:b});let _={x:g.x,y:g.y-E},O=[{x:g.x,y:g.y},w,x,S].map(A=>f(_.x+(A.x-_.x)*.84,_.y+(A.y-_.y)*.84));u.push({points:O,closed:!0,fill:P,ink:P}),u.push({points:K(d(p.x),y(p.y),d(2.74),y(2.74),20),closed:!0,fill:b,ink:b}),u.push({points:K(d(g.x),y(g.y),d(3.96),y(3.96),20),closed:!0,fill:b,ink:b});let N=B.fence;u.push({points:[f(g.x,g.y),f(N[0].x,N[0].y)],closed:!1}),u.push({points:[f(g.x,g.y),f(N[N.length-1].x,N[N.length-1].y)],closed:!1});for(let A of[w,x,S])u.push({points:U(d(A.x),y(A.y),d(.3),y(.3)),closed:!0,fill:Dn});break}case"court-basketball":{u.push({points:U(0,0,d(14),y(7.5)),closed:!0}),u.push({points:[{x:0,y:-y(7.5)},{x:0,y:y(7.5)}],closed:!1}),u.push({points:K(0,0,d(1.8),y(1.8),24),closed:!0});for(let f of[-1,1]){let g=f*14,v=f*(14-5.8),E=f*(14-1.575);u.push({points:U(d((g+v)/2),0,d(2.9),y(2.45)),closed:!0,fill:"#2f5d8a"}),u.push({points:K(d(v),0,d(1.8),y(1.8),24),closed:!0});let w=Math.sqrt(6.75*6.75-6.6*6.6),x=[{x:d(g),y:-y(6.6)}],S=Math.atan2(-6.6,-f*w),p=2*Math.atan2(6.6,w);for(let b=0;b<=16;b++){let P=S-f*p*(b/16);x.push({x:d(E+6.75*Math.cos(P)),y:y(6.75*Math.sin(P))})}x.push({x:d(g),y:y(6.6)}),u.push({points:x,closed:!1})}break}case"court-tennis":{u.push({points:U(0,0,d(11.885),y(5.485)),closed:!0,fill:"#2b5f99"});for(let f of[-1,1])u.push({points:[{x:-d(11.885),y:f*y(4.115)},{x:d(11.885),y:f*y(4.115)}],closed:!1}),u.push({points:[{x:f*d(6.4),y:-y(4.115)},{x:f*d(6.4),y:y(4.115)}],closed:!1});u.push({points:[{x:-d(6.4),y:0},{x:d(6.4),y:0}],closed:!1}),u.push({points:[{x:0,y:-y(6.4)},{x:0,y:y(6.4)}],closed:!1,ink:"#d1d5db"});break}case"ring-boxing":{u.push({points:U(0,0,d(3.05),y(3.05)),closed:!0});let v=[[-1,-1,"#c53030"],[1,1,"#2b6cb0"],[1,-1,"#e2e8f0"],[-1,1,"#e2e8f0"]];for(let[E,w,x]of v)u.push({points:U(E*d(3.05),w*y(3.05),d(.3),y(.3)),closed:!0,fill:x,ink:x});break}default:return[]}return u.map(f=>({...f,points:f.points.map(g=>Mt(g.x,g.y,l,h,n,i))}))}function Ei(e){if(e.role!=="stage"||!ce(e.stageKind))return[];let t=null;if(e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null&&e.width>0&&e.height>0&&[e.x,e.y,e.width,e.height].every(Number.isFinite))t={cx:e.x+e.width/2,cy:e.y+e.height/2,width:e.width,height:e.height};else if(e.points&&e.points.length>=3&&e.points.every(n=>Number.isFinite(n.x)&&Number.isFinite(n.y))){let n=e.points.map(c=>c.x),i=e.points.map(c=>c.y),o=Math.min(...n),r=Math.max(...n),s=Math.min(...i),l=Math.max(...i),h=Math.max(1,r-o),a=Math.max(1,l-s);t={cx:o+h/2,cy:s+a/2,width:h,height:a}}return t?Vn({kind:e.stageKind,...t}):[]}function Hn(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.kind==="polygon"?ie(e,6):e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,i=e.width,o=e.height;return[{x:t,y:n},{x:t+i,y:n},{x:t+i,y:n+o},{x:t,y:n+o}]}function Un(e,t,n){let i=n*Math.PI/180,o=Math.cos(i),r=Math.sin(i),s=e.x-t.x,l=e.y-t.y;return{x:t.x+s*o-l*r,y:t.y+s*r+l*o}}function Pt(e){let t=Hn(e);if(!t||t.length<2)return null;let n=e.rotation??0,i=Math.abs(n)<1e-6?t:t.map(h=>Un(h,{x:t.reduce((a,c)=>a+c.x,0)/t.length,y:t.reduce((a,c)=>a+c.y,0)/t.length},n)),o=1/0,r=1/0,s=-1/0,l=-1/0;for(let h of i)o=Math.min(o,h.x),r=Math.min(r,h.y),s=Math.max(s,h.x),l=Math.max(l,h.y);return!Number.isFinite(o)||s-o<1e-6||l-r<1e-6?null:{minX:o,minY:r,maxX:s,maxY:l}}var Gn=5,Xn=3,Kn=.92,Bn=1.9,Yn=2,zn=.6,Wn=1,$n=.06;function qn(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?Ce:ce(e.stageKind)?$n:Wn}function vt(e){let t=1/0,n=1/0,i=-1/0,o=-1/0,r=-1/0;for(let s of _e(e)){let l=s.baseHeightM??0;for(let h of s.objects){if(h.type!=="shape"||h.role!=="stage")continue;let a=Pt(h);a&&(t=Math.min(t,a.minX),n=Math.min(n,a.minY),i=Math.max(i,a.maxX),o=Math.max(o,a.maxY),r=Math.max(r,l+qn(h)))}}return!Number.isFinite(t)||!Number.isFinite(r)?null:{minX:t,minY:n,maxX:i,maxY:o,deckTopM:r}}function Qn(e,t,n,i){let o=1/0,r=1/0,s=-1/0,l=-1/0;for(let d of e)Number.isFinite(d.eyeHeightM)&&(o=Math.min(o,d.x),s=Math.max(s,d.x),r=Math.min(r,d.y),l=Math.max(l,d.y));if(!Number.isFinite(o))return null;let h=o*t,a=r*t,c=Math.max(1,Math.ceil((s-o)*t/n)+1),u=Math.max(1,Math.ceil((l-r)*t/n)+1),m=new Float64Array(c*u).fill(-1/0);for(let d of e){if(!Number.isFinite(d.eyeHeightM))continue;let y=d.eyeHeightM-J,f=Math.min(c-1,Math.max(0,Math.floor((d.x*t-h)/n))),v=Math.min(u-1,Math.max(0,Math.floor((d.y*t-a)/n)))*c+f,E=y+i;E>m[v]&&(m[v]=E)}return{cellM:n,minX:h,minY:a,cols:c,rows:u,top:m}}function Jn(e,t,n){let i=Math.floor((t-e.minX)/e.cellM),o=Math.floor((n-e.minY)/e.cellM);return i<0||o<0||i>=e.cols||o>=e.rows?-1/0:e.top[o*e.cols+i]}function Et(e,t,n={}){let i=new Map;if(!t||!e.length)return i;let o=n.metresPerChartUnit??Q,r=n.cellM??zn,s=n.chairBackM??Kn,l=n.selfRowSkipM??Yn,h=n.clearThreshold??.9,a=n.partialThreshold??.25,c=Math.max(1,n.columns??Gn),u=Math.max(1,n.rows??Xn),m=Qn(e,o,r,s);if(!m)return i;let d=(t.maxX-t.minX)*o,y=(t.maxY-t.minY)*o,f=d>=y,g=(t.minX+t.maxX)/2*o,v=(t.minY+t.maxY)/2*o,E=[];for(let x=0;x<c;x++){let S=(x+.5)/c-.5,p=f?g+S*d:g,b=f?v:v+S*y;for(let P=0;P<u;P++){let M=t.deckTopM+(u===1?0:P/(u-1)*Bn);E.push({x:p,y:b,z:M})}}let w=r/2;for(let x of e){if(!Number.isFinite(x.eyeHeightM))continue;let S=x.x*o,p=x.y*o,b=x.eyeHeightM,P=0,M=1/0;for(let T of E){let I=T.x-S,_=T.y-p,O=Math.hypot(I,_);if(!(O>l)){P++;continue}let N=I/O,A=_/O,L=0;for(let V=l;V<O;V+=w){let Y=Jn(m,S+N*V,p+A*V);if(!(!Number.isFinite(Y)||Y>=b)&&Y>b+(T.z-b)*V/O){L=V;break}}L?M=Math.min(M,L):P++}let C=P/E.length;C>=h||i.set(x.id,{seatId:x.id,mark:C<a?"obstructedView":"restrictedView",visibleFraction:C,totalRays:E.length,atDistanceM:Number.isFinite(M)?M:0})}return i}function It(e,t){if(!t.size)return 0;let n=0;for(let i of e){let o=t.get(i.id);if(!o)continue;let r=i.commercial;r?.restrictedView!==void 0||r?.obstructedView!==void 0||(i.commercial={...r,[o.mark]:!0},n++)}return n}function Oe(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var de=Math.PI/180,Zn=9,ee=16;function ke(e,t,n,i){let o=n*de,r=Math.cos(o),s=Math.sin(o);return{x:i.x+e*r-t*s,y:i.y+e*s+t*r}}function Re(e){let{seatCount:t,seatSpacing:n,curve:i,rotation:o,origin:r}=e,s=[];if(e.path)return $e(e.path,t);if(t<=1)return t===1&&s.push({x:r.x,y:r.y}),s;if(i===0){for(let a=0;a<t;a++)s.push(ke(a*n,0,o,r));return s}let l=i/(t-1)*de,h=n/(2*Math.sin(Math.abs(l)/2));for(let a=0;a<t;a++){let c=a*l,u=h*Math.sin(c),m=-h+h*Math.cos(c);s.push(ke(u,m,o,r))}return s}function Ot(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function $i(e){let t=new Set((e.overrides??[]).filter(n=>n.skip&&Number.isInteger(n.index)&&n.index>=0&&n.index<e.seatCount).map(n=>n.index));return Math.max(0,e.seatCount-t.size)}function eo(e,t){let n=Ot(e);return Re(e).map((i,o)=>{let r=n.get(o),s=Oe(r),l=Ae(e,o,r),h={...e.commercial,...r?.commercial};return{index:o,x:i.x+(r?.dx??0),y:i.y+(r?.dy??0),label:l,displayLabel:he(e,o,t,r),categoryKey:r?.categoryKey??e.categoryKey,skipped:!!r?.skip,accessible:s.length>0,accessibility:s,wheelchairSpaceType:r?.wheelchairSpaceType,commercial:Object.values(h).some(a=>a!==void 0&&a!==!1&&a!=="")?h:void 0,glyph:r?.glyph,viewUrl:r?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:r?.viewFromSeatUrl?r.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:r?.labelStyle??e.seatLabelStyle}})}function to(e){let t=[];for(let n of eo(e))n.skipped||t.push({id:`${e.id}:${n.index}`,label:n.label,displayLabel:n.displayLabel===n.label?void 0:n.displayLabel,x:n.x,y:n.y,rowId:e.id,categoryKey:n.categoryKey,accessible:n.accessible||void 0,accessibility:n.accessibility.length?n.accessibility:void 0,wheelchairSpaceType:n.wheelchairSpaceType,commercial:n.commercial,glyph:n.glyph,viewUrl:n.viewUrl,viewMeta:n.viewMeta,labelStyle:n.labelStyle});return t}function no(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(r=>t.includes(r)),i={top:0,bottom:0,left:0,right:0};if(!n.length)return i;let o=Math.max(0,Math.round(e.seatCount));for(let r=0;r<o;r++)i[n[r%n.length]]+=1;return i}function kt(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let i=new Map((e.overrides??[]).map(c=>[c.index,c])),o=(c,u,m,d)=>{let y=i.get(c),f=Oe(y),g=y?.label??Ne(e,c);return{index:c,label:g,displayLabel:y?.displayLabel??Le(e,c),x:u+(y?.dx??0),y:m+(y?.dy??0),categoryKey:y?.categoryKey??e.categoryKey,skipped:!!y?.skip,accessible:f.length>0,accessibility:f,wheelchairSpaceType:y?.wheelchairSpaceType,commercial:y?.commercial,glyph:y?.glyph,viewUrl:y?.viewFromSeatUrl,viewMeta:y?.viewFromSeatUrl?y.viewFromSeatMeta:void 0,labelStyle:y?.labelStyle,...d?{side:d}:{}}};if(e.shape==="round"){let c=(e.radius??40)+ee,u=e.rotation*de,m=Math.max(0,Math.min(360,e.seatArc??360));if(m>=360||n===1){for(let g=0;g<n;g++){let v=u+g/n*2*Math.PI;t.push(o(g,e.center.x+c*Math.cos(v),e.center.y+c*Math.sin(v)))}return t}let d=m*de,y=(2*Math.PI-d)/2,f=u+y;for(let g=0;g<n;g++){let v=f+g/(n-1)*d;t.push(o(g,e.center.x+c*Math.cos(v),e.center.y+c*Math.sin(v)))}return t}let r=e.width??80,s=e.height??50,l=no(e),h=["top","bottom","left","right"],a=0;for(let c of h){let u=l[c];for(let m=0;m<u;m++){let d,y;c==="top"?(d=-r/2+(m+.5)*r/u,y=-s/2-ee):c==="bottom"?(d=-r/2+(m+.5)*r/u,y=s/2+ee):c==="left"?(d=-r/2-ee,y=-s/2+(m+.5)*s/u):(d=r/2+ee,y=-s/2+(m+.5)*s/u);let f=ke(d,y,e.rotation,e.center);t.push(o(a++,f.x,f.y,c))}}return t}function qi(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):kt(e).filter(t=>!t.skipped).length}function oo(e){return kt(e).filter(t=>!t.skipped).map(t=>({id:`${e.id}:${t.index}`,label:t.label,...t.displayLabel!==t.label?{displayLabel:t.displayLabel}:{},x:t.x,y:t.y,rowId:e.id,categoryKey:t.categoryKey,...t.accessible?{accessible:!0}:{},...t.accessibility.length?{accessibility:t.accessibility}:{},...t.wheelchairSpaceType?{wheelchairSpaceType:t.wheelchairSpaceType}:{},...t.commercial?{commercial:t.commercial}:{},...t.glyph?{glyph:t.glyph}:{},...t.viewUrl?{viewUrl:t.viewUrl}:{},...t.viewUrl&&t.viewMeta?{viewMeta:t.viewMeta}:{},...t.labelStyle?{labelStyle:t.labelStyle}:{}}))}function io(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth",...e.commercial?.note?{commercial:{note:e.commercial.note}}:{}}]}function Z(e,t){let n=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){let r=t[i].x,s=t[i].y,l=t[o].x,h=t[o].y;s>e.y!=h>e.y&&e.x<(l-r)*(e.y-s)/(h-s)+r&&(n=!n)}return n}function Ie(e,t){return t.some((n,i)=>{let o=t[(i+1)%t.length],r=(e.y-n.y)*(o.x-n.x)-(e.x-n.x)*(o.y-n.y);if(Math.abs(r)>1e-7)return!1;let s=(e.x-n.x)*(o.x-n.x)+(e.y-n.y)*(o.y-n.y),l=(o.x-n.x)**2+(o.y-n.y)**2;return s>=-1e-7&&s<=l+1e-7})}function X(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function fe(e,t,n){return Z(e,t)&&!X(n).some(i=>Z(e,i)||Ie(e,i))}function Qi(e,t){return tt(e,t).point}function ue(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;return{x:t/e.length,y:n/e.length}}function Rt(e){switch(e.type){case"row":{let t=Re(e),n=Ot(e),i=0,o=0,r=0;for(let s=0;s<t.length;s++){let l=n.get(s);l?.skip||(i+=t[s].x+(l?.dx??0),o+=t[s].y+(l?.dy??0),r++)}return r?{x:i/r,y:o/r}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return ue(e.points);case"section":return ue(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?ue(e.points):e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null?{x:e.x+e.width/2,y:e.y+e.height/2}:{x:e.x??0,y:e.y??0};case"decorImage":return{x:e.x+e.width/2,y:e.y+e.height/2}}}function wt(e,t){return e.length===t.length&&e.every((n,i)=>n.x===t[i].x&&n.y===t[i].y)}function ro(e,t){if(e.type!=="gaArea"||!wt(e.points,t.outline))return!1;let n=X(e.holes),i=X(t.holes);return n.length===i.length&&n.every((o,r)=>wt(o,i[r]))}function so(e,t,n=e.filter(o=>o.type==="section"),i=Rt(t)){let o="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(o?n.find(s=>(s.logicalSectionId??s.id)===o&&(ro(t,s)||fe(i,s.outline,s.holes))):void 0)??n.find(s=>fe(i,s.outline,s.holes))}function _e(e){return e.floors&&e.floors.length?e.floors:[{id:"floor-0",name:"Main",objects:e.objects,focalPoint:e.focalPoint,referenceImage:e.referenceImage,backgroundImage:e.backgroundImage}]}function Ji(e,t){let n=_e(e);return(t?n.find(i=>i.id===t):n[0])?.objects??[]}function ao(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function co(e,t,n){let i=r=>({x:r.x+t,y:r.y+n}),o=r=>r.map(i);switch(e.type){case"row":return{...e,origin:i(e.origin)};case"table":case"booth":return{...e,center:i(e.center)};case"gaArea":return{...e,points:o(e.points),...e.holes?{holes:X(e.holes).map(o)}:{}};case"section":return{...e,outline:o(e.outline),...e.outlinePath?{outlinePath:at(e.outlinePath,t,n)}:{},...e.holes?{holes:X(e.holes).map(o)}:{}};case"text":return{...e,position:i(e.position)};case"shape":return{...e,...e.points?{points:o(e.points)}:{},...e.holes?{holes:X(e.holes).map(o)}:{},...e.x!=null?{x:e.x+t}:{},...e.y!=null?{y:e.y+n}:{}};case"decorImage":return{...e,x:e.x+t,y:e.y+n}}}function Zi(e,t=900){if(!e.floors||e.floors.length<2)return e;let n=[];return e.floors.forEach((i,o)=>{let r=-o*t;for(let s of i.objects)n.push(r===0?s:co(s,0,r))}),{...e,objects:n,floors:void 0}}function Ct(e,t,n,i,o,r,s,l,h){let a=[],c=e.filter(f=>f.type==="section"),u=ct(e),m=f=>!f?.eventConfigurationId||f.eventConfigurationId===i&&(f.eventConfigurationVersion===void 0||f.eventConfigurationVersion===h),d=f=>je(f,{activeConfigurationId:i,activeConfigurationVersion:h,activeBasisSha256:o,now:l}),y=(f,g)=>d(f)?{...f,coverage:g}:void 0;for(let f of e){let g=[];if(f.type==="row"?g=to(f):f.type==="table"?g=oo(f):f.type==="booth"&&(g=io(f)),!g.length)continue;for(let S of g)S.viewUrl&&!m(S.viewMeta)&&(S.viewUrl=void 0,S.viewMeta=void 0);if(f.type==="row"){let S=u.get(f.id);if(S){let p=new Map((f.overrides??[]).map(b=>[b.index,b]));for(let b of g){let P=Number(b.id.slice(b.id.lastIndexOf(":")+1));if(!Number.isInteger(P))continue;b.logicalRowId=S.groupId,b.logicalSeatIndex=S.adjacencyOffset+P,p.get(P)?.displayLabel||(b.displayLabel=he(f,P,S)),!b.viewUrl&&S.viewFromSeatUrl&&m(S.viewFromSeatMeta)&&(b.viewUrl=S.viewFromSeatUrl,b.viewMeta=S.viewFromSeatMeta);let M=p.get(P)?.confidenceEvidence;b.confidenceEvidence=y(M,"exact-seat")??y(f.confidenceEvidence,"row-representative")??y(S.confidenceEvidence,"row-representative")}}}let v=so(e,f,c,f.type==="row"?ue(g):Rt(f)),E=v?.viewFromSeatUrl,x=(v?.zone?t?.find(S=>S.id===v.zone):void 0)?.focalPoint??n;for(let S of g){if(!S.confidenceEvidence){let p=Number(S.id.slice(S.id.lastIndexOf(":")+1)),b=(f.type==="row"||f.type==="table")&&Number.isInteger(p)?f.overrides?.find(P=>P.index===p)?.confidenceEvidence:void 0;S.confidenceEvidence=y(b,"exact-seat")??(f.type==="row"?y(f.confidenceEvidence,"row-representative"):void 0)}S.confidenceEvidence??=y(v?.confidenceEvidence,"section-representative")??(s?y(s.evidence,s.coverage):void 0),!S.viewUrl&&E&&m(v?.viewFromSeatMeta)&&(S.viewUrl=E,S.viewMeta=v?.viewFromSeatMeta),!S.viewUrl&&r&&m(r.meta)&&(S.viewUrl=r.url,S.viewMeta=r.meta),v&&(S.sectionId=v.logicalSectionId??v.id),v?.zone&&(S.zoneId=v.zone),x&&(S.focalPoint={...x})}a.push(...g)}return a}function er(e,t={}){if(e.floors?.length){let i=[];for(let o of e.floors){let r=o.focalPoint??e.focalPoint,s=o.viewFromSeatUrl?{url:o.viewFromSeatUrl,meta:o.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,l=o.confidenceEvidence?{evidence:o.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,h=Ct(o.objects,e.zones,r,e.eventConfigurationId,e.confidenceBasisSha256,s,l,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&_t(o.objects,o.focalPoint??e.focalPoint,o.baseHeightM??0,h);for(let a of h)a.floorId=o.id;for(let a of h)i.push(a)}return i}let n=Ct(e.objects,e.zones,e.focalPoint,e.eventConfigurationId,e.confidenceBasisSha256,e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);return t.resolveEyeHeights!==!1&&_t(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),lo(e,n,t)}function lo(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||It(t,Et(t,vt(e))),t}function _t(e,t,n,i){let o=e.filter(u=>u.type==="section"),r=n>0||o.some(u=>u.height!==void 0||u.rake!==void 0||(u.elevation??0)>0);if(!o.length||!r||!t){for(let u of i)u.eyeHeightM=n+J;return}let s=new Array(i.length),l=new Map;for(let u of o)l.has(u.id)||l.set(u.id,u);let h=new Map,a=new Map;for(let u=0;u<i.length;u++){let m=i[u],y=(m.sectionId?l.get(m.sectionId)??o.find(g=>g.logicalSectionId===m.sectionId&&fe({x:m.x,y:m.y},g.outline,g.holes)):void 0)??o.find(g=>fe({x:m.x,y:m.y},g.outline,g.holes))??null;if(s[u]=y,!y)continue;h.has(y.id)||h.set(y.id,ft(y,{floorBaseHeightM:n}));let f=a.get(y.id);f?f.push(u):a.set(y.id,[u])}let c=new Array(i.length).fill(void 0);for(let[u,m]of a){let d=h.get(u);if(!d)continue;let y=d.rake>0?Math.tan(d.rake*Math.PI/180):0,f=yt(u,i,m,t);for(let g of f.rows){let v=g.blockDepth*Q*y,E=d.height+v;for(let w of g.seatIndices)c[w]=E}}for(let u=0;u<i.length;u++){let m=i[u],d=s[u];if(!d){m.eyeHeightM=n+J;continue}let y=h.get(d.id);m.eyeHeightM=(c[u]??y.height)+J}}var le=40;function tr(e,t){let n=t?.freeText==="exclude",i=1/0,o=1/0,r=-1/0,s=-1/0,l=(a,c)=>{a<i&&(i=a),c<o&&(o=c),a>r&&(r=a),c>s&&(s=c)},h=a=>{if(Array.isArray(a))for(let c of a)!c||typeof c!="object"||l(c.x,c.y)};for(let a of ao(e))if(a.type==="row"){let c=new Map((a.overrides??[]).map(u=>[u.index,u]));Re(a).forEach((u,m)=>{let d=c.get(m);d?.skip||l(u.x+(d?.dx??0),u.y+(d?.dy??0))})}else if(a.type==="gaArea")h(a.points);else if(a.type==="section")h(a.outline);else if(a.type==="decorImage")l(a.x,a.y),l(a.x+a.width,a.y+a.height);else if(a.type==="shape")a.points&&a.points.length?h(ie(a)):a.x!=null&&a.y!=null&&a.width!=null&&a.height!=null&&(l(a.x,a.y),l(a.x+a.width,a.y+a.height));else if(a.type==="table"){let c=ee+Zn,u=a.shape==="round"?(a.radius??40)+c:Math.max((a.width??80)/2,(a.height??50)/2)+c;l(a.center.x-u,a.center.y-u),l(a.center.x+u,a.center.y+u)}else if(a.type==="booth"){let c=Math.max(a.width,a.height)/2;l(a.center.x-c,a.center.y-c),l(a.center.x+c,a.center.y+c)}else if(a.type==="text"){if(n)continue;let c=Ke(a);l(a.position.x,a.position.y),l(a.position.x+c.width,a.position.y+c.height)}for(let a of[e.referenceImage,e.backgroundImage]){if(!a)continue;let{center:c,width:u}=a;if(!c||!Number.isFinite(c.x)||!Number.isFinite(c.y)||!Number.isFinite(u))continue;let m=u*3/4;l(c.x-u/2,c.y-m/2),l(c.x+u/2,c.y+m/2)}if(!isFinite(i)){let a=e.focalPoint??{x:0,y:0};return{x:a.x-200,y:a.y-200,width:400,height:400}}return{x:i-le,y:o-le,width:r-i+le*2,height:s-o+le*2}}export{uo as a,jt as b,Fe as c,Ft as d,ho as e,Dt as f,mo as g,te as h,me as i,bo as j,go as k,xo as l,So as m,Mo as n,Po as o,vo as p,Io as q,wo as r,Co as s,_o as t,Oo as u,ko as v,Ro as w,To as x,Ao as y,Ke as z,Lo as A,jo as B,Wt as C,Fo as D,be as E,Ho as F,$e as G,Uo as H,Go as I,qt as J,Ze as K,Ko as L,tt as M,Jt as N,Yo as O,qo as P,rt as Q,st as R,at as S,nn as T,Qo as U,on as V,sn as W,Jo as X,cn as Y,Se as Z,Zo as _,ci as $,fi as aa,kn as ba,ie as ca,hi as da,mi as ea,pi as fa,ti as ga,ni as ha,oi as ia,ct as ja,Q as ka,ve as la,fn as ma,lt as na,dt as oa,ut as pa,Me as qa,hn as ra,mn as sa,pn as ta,J as ua,ri as va,ft as wa,mt as xa,xn as ya,yt as za,gi as Aa,An as Ba,xi as Ca,Si as Da,Mi as Ea,Ln as Fa,Pi as Ga,Dn as Ha,vi as Ia,Ei as Ja,Oe as Ka,ee as La,Re as Ma,$i as Na,eo as Oa,to as Pa,no as Qa,kt as Ra,qi as Sa,oo as Ta,io as Ua,Z as Va,Ie as Wa,X as Xa,fe as Ya,Qi as Za,Rt as _a,so as $a,_e as ab,Ji as bb,ao as cb,co as db,Zi as eb,er as fb,tr as gb};
|
package/dist/chunk-R2TRYVOY.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as E}from"./chunk-TFYAMLCK.js";import{O as R,db as B,gb as v}from"./chunk-3W4ZMU4G.js";var T=.08,Y=.045;function L(t){return`__floor__:${encodeURIComponent(t)}`}function X(t,e,o){return{...t,objects:e,floors:void 0,...o?{focalPoint:o}:{},referenceImage:void 0,backgroundImage:void 0}}function j(t,e,o){let s=t.focalPoint??e.focalPoint;return s?s.x:o.x+o.width/2}function Q(t){let e=t.floors??[];if(!e.length)return[];let o=e.map(n=>v(X(t,n.objects,n.focalPoint),{freeText:"exclude"})),a=Math.max(1,...o.map(n=>n.width))*T,r=0;return e.map((n,c)=>{let h=o[c],u=r-(h.y+h.height);return r-=h.height+a,{floorId:n.id,label:n.name??n.id,level:c,levelBadge:c===0?"G":String(c),translation:{x:-j(n,t,h),y:u},bounds:h}})}function z(t,e,o,s){let a=e==="name"?t.label:t.levelBadge;if(!a)return[];let r=Math.max(1,o*Y),n=t.bounds.x+t.translation.x,c=t.bounds.y+t.translation.y+r*.4,h=`floor-level-${t.floorId}`,u={type:"text",id:`${h}-text`,text:a,position:{x:n,y:c},fontSize:r,rotation:0,color:s,bold:!0};if(e==="name")return[u];let d=r*.95;return[{type:"shape",id:`${h}-badge`,kind:"ellipse",x:n-d*.35,y:c-d*.3,width:d*2,height:d*2,fill:"transparent",stroke:{color:s,width:Math.max(1,r*.09)},opacity:.8},u]}function W(t,e={}){let o=t.floors;if(!o||o.length<2)return t;let s=Q(t),a=[];o.forEach((u,d)=>{let{x:y,y:S}=s[d].translation;for(let I of u.objects)d>0&&I.type==="shape"&&I.role==="stage"||a.push(B(I,y,S))});let r={...t,objects:a,floors:void 0},n=v(r,{freeText:"exclude"}),c=Math.max(1,n.width,n.height),h=t.theme?.textColor??"#94a3b8";for(let u of s)a.push(...z(u,e.labelStyle??"number",c,h));return{...r,objects:a,referenceImage:void 0,backgroundImage:void 0}}function H(t){if(!t.floors||t.floors.length<2)return t;let e=!t.zones?.length,o=new Set,s=t.floors.flatMap(r=>r.objects.flatMap(n=>{if(n.type==="shape"&&n.role==="stage"){let c=JSON.stringify([n.kind,n.x,n.y,n.width,n.height,n.points,n.rotation??0,n.label,n.heightM,n.eventConfigurationIds]);if(o.has(c))return[];o.add(c)}return e&&n.type==="section"?[{...n,zone:L(r.id)}]:[n]})),a=e?t.floors.map(r=>({id:L(r.id),label:r.name,focalPoint:{...r.focalPoint}})):t.zones;return{...t,objects:s,zones:a,floors:void 0,referenceImage:void 0,backgroundImage:E(t)}}function J(t){let e=t.floors;if(!e?.length)return null;let o=e.find(r=>r.objects.some(n=>n.type==="shape"&&n.role==="stage"));if(o)return o.id;let s=e[0],a=-1;for(let r of e){let n=v(X(t,r.objects,r.focalPoint),{freeText:"exclude"}),c=n.width*n.height;c>a&&(a=c,s=r)}return s.id}var V=640;function tt(t,e){return(t.floors?.length??0)<2?null:"all"}var U=9;function Z(t){if(t.kind==="circle")return{hx:t.r,hy:t.r};let e=t.width/2,o=t.height/2,s=t.rotation??0;if(!s)return{hx:e,hy:o};let a=s*Math.PI/180,r=Math.abs(Math.cos(a)),n=Math.abs(Math.sin(a));return{hx:e*r+o*n,hy:e*n+o*r}}function $(t,e,o){let s=e-t.seat.x,a=o-t.seat.y;if(t.shape.kind==="circle")return s*s+a*a<=t.shape.r*t.shape.r;let r=t.shape.rotation??0,n=s,c=a;if(r){let h=-r*Math.PI/180,u=Math.cos(h),d=Math.sin(h);n=s*u-a*d,c=s*d+a*u}return Math.abs(n)<=t.shape.width/2&&Math.abs(c)<=t.shape.height/2}function N(t,e,o,s,a){if(t.shape.kind==="circle"){let f=Math.min(Math.max(t.seat.x,e),s),x=Math.min(Math.max(t.seat.y,o),a),m=t.seat.x-f,p=t.seat.y-x;return m*m+p*p<=t.shape.r*t.shape.r}let r=t.shape.rotation??0;if(!r)return t.seat.x-t.hx<=s&&t.seat.x+t.hx>=e&&t.seat.y-t.hy<=a&&t.seat.y+t.hy>=o;let n=r*Math.PI/180,c=Math.cos(n),h=Math.sin(n),u=t.shape.width/2,d=t.shape.height/2,y=[[-u,-d],[u,-d],[u,d],[-u,d]].map(([f,x])=>[t.seat.x+f*c-x*h,t.seat.y+f*h+x*c]),S=[[e,o],[s,o],[s,a],[e,a]],I=[[1,0],[0,1],[c,h],[-h,c]];for(let[f,x]of I){let m=1/0,p=-1/0;for(let[w,O]of y){let i=w*f+O*x;i<m&&(m=i),i>p&&(p=i)}let M=1/0,P=-1/0;for(let[w,O]of S){let i=w*f+O*x;i<M&&(M=i),i>P&&(P=i)}if(p<M||P<m)return!1}return!0}function ot(t,e={}){let o=e.seatRadius??U,s=t.length,a=new Array(s),r=1/0,n=1/0,c=-1/0,h=-1/0,u=0;for(let i=0;i<s;i++){let l=t[i],D=e.shapeOf?.(l)??{kind:"circle",r:o},{hx:g,hy:b}=Z(D);a[i]={seat:l,shape:D,hx:g,hy:b},l.x-g<r&&(r=l.x-g),l.y-b<n&&(n=l.y-b),l.x+g>c&&(c=l.x+g),l.y+b>h&&(h=l.y+b),g>u&&(u=g),b>u&&(u=b)}s===0&&(r=0,n=0,c=0,h=0);let d=u>0?u*4:1,y=Math.max(c-r,0),S=Math.max(h-n,0),I=Math.max(64,e.maxCells??s*4),f=d,x=Math.max(1,Math.ceil(y/f)||1),m=Math.max(1,Math.ceil(S/f)||1);for(;x*m>I&&(x>1||m>1);)f*=2,x=Math.max(1,Math.ceil(y/f)||1),m=Math.max(1,Math.ceil(S/f)||1);let p=x*m,M=new Int32Array(p+1),P=0;for(let i=0;i<s;i++){let l=a[i],D=R(Math.floor((l.seat.x-l.hx-r)/f),0,x-1),g=R(Math.floor((l.seat.x+l.hx-r)/f),0,x-1),b=R(Math.floor((l.seat.y-l.hy-n)/f),0,m-1),F=R(Math.floor((l.seat.y+l.hy-n)/f),0,m-1);for(let A=b;A<=F;A++)for(let C=D;C<=g;C++)M[A*x+C+1]++,P++}for(let i=0;i<p;i++)M[i+1]+=M[i];let w=new Int32Array(P),O=M.slice(0,p);for(let i=0;i<s;i++){let l=a[i],D=R(Math.floor((l.seat.x-l.hx-r)/f),0,x-1),g=R(Math.floor((l.seat.x+l.hx-r)/f),0,x-1),b=R(Math.floor((l.seat.y-l.hy-n)/f),0,m-1),F=R(Math.floor((l.seat.y+l.hy-n)/f),0,m-1);for(let A=b;A<=F;A++)for(let C=D;C<=g;C++){let k=A*x+C;w[O[k]++]=i}}return{seats:t,entries:a,minX:r,minY:n,cell:f,cols:x,rows:m,cellStart:M,items:w,stamp:new Int32Array(s),epoch:0}}function rt(t,e,o={}){let{cols:s,rows:a,cell:r,minX:n,minY:c,cellStart:h,items:u,entries:d}=t,y=Math.floor((e.x-n)/r),S=Math.floor((e.y-c)/r);if(y<0||S<0||y>=s||S>=a)return null;let I=S*s+y,f=h[I+1],x=-1,m=1/0;for(let p=h[I];p<f;p++){let M=u[p],P=d[M];if(o.filter&&!o.filter(P.seat.id,P.seat)||!$(P,e.x,e.y))continue;let w=e.x-P.seat.x,O=e.y-P.seat.y,i=w*w+O*O;(i<m||i===m&&M<x)&&(m=i,x=M)}return x<0?null:d[x].seat.id}function st(t,e,o,s={}){if(!(o>0))return null;let{cols:a,rows:r,cell:n,minX:c,minY:h,cellStart:u,items:d,entries:y}=t,S=Math.max(0,Math.floor((e.x-o-c)/n)),I=Math.min(a-1,Math.floor((e.x+o-c)/n)),f=Math.max(0,Math.floor((e.y-o-h)/n)),x=Math.min(r-1,Math.floor((e.y+o-h)/n));if(S>I||f>x)return null;let m=-1,p=o*o,M=t.stamp,P=++t.epoch;for(let w=f;w<=x;w++){let O=w*a;for(let i=S;i<=I;i++){let l=O+i,D=u[l+1];for(let g=u[l];g<D;g++){let b=d[g];if(M[b]===P)continue;M[b]=P;let F=y[b];if(s.filter&&!s.filter(F.seat.id,F.seat))continue;let A=e.x-F.seat.x,C=e.y-F.seat.y,k=A*A+C*C;(k<p||k===p&&b<m)&&(p=k,m=b)}}}return m<0?null:y[m].seat.id}function at(t,e,o={}){let s=Math.min(e.x,e.x+e.width),a=Math.max(e.x,e.x+e.width),r=Math.min(e.y,e.y+e.height),n=Math.max(e.y,e.y+e.height),c=o.mode??"center",{cols:h,rows:u,cell:d,minX:y,minY:S,cellStart:I,items:f,entries:x}=t,m=Math.max(0,Math.floor((s-y)/d)),p=Math.min(h-1,Math.floor((a-y)/d)),M=Math.max(0,Math.floor((r-S)/d)),P=Math.min(u-1,Math.floor((n-S)/d));if(m>p||M>P)return[];let w=[],O=t.stamp,i=++t.epoch;for(let l=M;l<=P;l++){let D=l*h;for(let g=m;g<=p;g++){let b=D+g,F=I[b+1];for(let A=I[b];A<F;A++){let C=f[A];if(O[C]===i)continue;O[C]=i;let k=x[C];if(o.filter&&!o.filter(k.seat.id,k.seat))continue;(c==="center"?k.seat.x>=s&&k.seat.x<=a&&k.seat.y>=r&&k.seat.y<=n:N(k,s,r,a,n))&&w.push(C)}}}return w.sort((l,D)=>l-D),w.map(l=>x[l].seat.id)}function ct(t){let e=t.cols*t.rows,o=0,s=0;for(let r=0;r<e;r++){let n=t.cellStart[r+1]-t.cellStart[r];n>0&&o++,n>s&&(s=n)}let a=t.items.length;return{cell:t.cell,cols:t.cols,rows:t.rows,cells:e,occupiedCells:o,refs:a,maxPerCell:s,meanPerOccupiedCell:o?a/o:0}}function lt(t,e=0){let o=Math.max(1,t.width,t.height),s={x:t.x+t.width/2,y:t.y+t.height/2},a=o*1.55,r=Math.max(o*.82,Math.max(0,e)+o*.45);return{target:s,distance:a,height:r,focalLength:Math.hypot(a,r),yawRad:-8*Math.PI/180}}function _(t,e,o=0){let s=e.x-t.target.x,a=e.y-t.target.y,r=Math.cos(t.yawRad),n=Math.sin(t.yawRad),c=s*r-a*n,u=s*n+a*r-t.distance,d=o-t.height,y=Math.hypot(t.distance,t.height),S=(-t.distance*u-t.height*d)/y,I=(-t.height*u+t.distance*d)/y,f=Math.max(y*.08,S),x=t.focalLength/f;return{x:t.target.x+c*x,y:t.target.y-I*x,depth:f,scale:x}}function ht(t,e){return{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function ut(t){let e=t.a*t.d-t.b*t.c;if(!Number.isFinite(e)||Math.abs(e)<1e-9)throw new Error("perspective projection produced a singular affine");let o=t.d/e,s=-t.b/e,a=-t.c/e,r=t.a/e;return{a:o,b:s,c:a,d:r,e:-(o*t.e+a*t.f),f:-(s*t.e+r*t.f)}}function xt(t,e){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}function dt(t,e,o=()=>0){let s=_(t,e,o(e)),a={x:e.x+1,y:e.y},r={x:e.x,y:e.y+1},n=_(t,a,o(a)),c=_(t,r,o(r)),h=n.x-s.x,u=n.y-s.y,d=c.x-s.x,y=c.y-s.y;return{a:h,b:u,c:d,d:y,e:s.x-h*e.x-d*e.y,f:s.y-u*e.x-y*e.y}}function ft(t){let e=Math.hypot(t.a,t.b),o=t.a*t.d-t.b*t.c;return{rotationDeg:Math.atan2(t.b,t.a)*180/Math.PI,scaleX:e,scaleY:o/Math.max(e,1e-9),skewX:(t.a*t.c+t.b*t.d)/Math.max(o,1e-9)}}export{T as a,L as b,Q as c,W as d,H as e,J as f,V as g,tt as h,U as i,ot as j,rt as k,st as l,at as m,ct as n,lt as o,_ as p,ht as q,ut as r,xt as s,dt as t,ft as u};
|