@seatlayer/core 0.89.2 → 0.90.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.
Files changed (45) hide show
  1. package/dist/{chunk-A4GTB3SG.js → chunk-52CBK5HX.js} +1 -1
  2. package/dist/{chunk-R7TV7RYQ.js → chunk-77QFA3F4.js} +1 -1
  3. package/dist/{chunk-FVTW2IBN.js → chunk-EH47GKSO.js} +1 -1
  4. package/dist/{chunk-PMBS3VZM.js → chunk-FMPQZEXD.js} +1 -1
  5. package/dist/{chunk-66Q5LOBH.js → chunk-GISLORLL.js} +1 -1
  6. package/dist/{chunk-BCMCXHLH.js → chunk-K4TZQOTG.js} +1 -1
  7. package/dist/{chunk-WAGKI44J.js → chunk-OYKT5CCU.js} +1 -1
  8. package/dist/chunk-W4RS6OW7.js +1 -0
  9. package/dist/{chunk-PI3UH2EN.js → chunk-YAWJTFYK.js} +1 -1
  10. package/dist/core/chart-ops/index.cjs +1 -1
  11. package/dist/core/chart-ops/index.js +1 -1
  12. package/dist/core/inventory/index.cjs +1 -1
  13. package/dist/core/inventory/index.d.cts +2 -2
  14. package/dist/core/inventory/index.d.ts +2 -2
  15. package/dist/core/inventory/index.js +1 -1
  16. package/dist/core/layout/index.cjs +1 -1
  17. package/dist/core/layout/index.d.cts +2 -2
  18. package/dist/core/layout/index.d.ts +2 -2
  19. package/dist/core/layout/index.js +1 -1
  20. package/dist/core/quality/index.d.cts +2 -2
  21. package/dist/core/quality/index.d.ts +2 -2
  22. package/dist/core/sections/index.cjs +1 -1
  23. package/dist/core/sections/index.d.cts +1 -1
  24. package/dist/core/sections/index.d.ts +1 -1
  25. package/dist/core/sections/index.js +1 -1
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.d.cts +18 -8
  28. package/dist/index.d.ts +18 -8
  29. package/dist/index.js +1 -1
  30. package/dist/{renderedQuality-CrlBXHzi.d.ts → renderedQuality-CHm4mIjB.d.ts} +1 -1
  31. package/dist/{renderedQuality-CeSE6pEM.d.cts → renderedQuality-x1_lUJYV.d.cts} +1 -1
  32. package/dist/{renderer-B1mEhbA7.d.cts → renderer-DLTYfHV2.d.cts} +6 -2
  33. package/dist/{renderer-BwZhXv8G.d.ts → renderer-DN1yCX7-.d.ts} +6 -2
  34. package/dist/{tableSizing-wnW3HNga.d.cts → tableSizing-f-hh6kCg.d.cts} +2 -2
  35. package/dist/{tableSizing-DyS3UAha.d.ts → tableSizing-oDI0D8c2.d.ts} +2 -2
  36. package/dist/{ticketRestrictions-DuYWl2uy.d.ts → ticketRestrictions-BXtFOUqJ.d.ts} +1 -1
  37. package/dist/{ticketRestrictions-BTTN-LzH.d.cts → ticketRestrictions-Bc08-Hip.d.cts} +1 -1
  38. package/dist/view3d/index.cjs +12 -12
  39. package/dist/view3d/index.d.cts +1 -1
  40. package/dist/view3d/index.d.ts +1 -1
  41. package/dist/view3d/index.js +1 -1
  42. package/dist/view3d/scene/scene.worker.cjs +1 -1
  43. package/dist/view3d/scene/scene.worker.js +1 -1
  44. package/package.json +1 -1
  45. package/dist/chunk-E7TOTX6I.js +0 -1
@@ -1 +0,0 @@
1
- import{h as xe,i as ne}from"./chunk-5ITK5236.js";import{c as Se}from"./chunk-CRCGO52K.js";var kn=2e6,ut=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,dt=/[\s"'<>`\\]/;function ft(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return ut.test(e);if(dt.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}function Me(e){let t=e.trim();return ft(t)?t:null}var Y="seatlayer.event-configuration/1",oe="seatlayer.event-configuration-export/1",D=100,ht=120,mt=1e5,pt=1e4,we=/^[a-f0-9]{64}$/,bt=new Set(["stage","screen","barrier","camera_platform","sound_desk","rigging_truss"]);function V(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function j(e,t){return typeof e=="string"&&e.length>=1&&e.length<=t&&e.normalize("NFKC").trim()===e}function Ee(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}function ve(e){return!Array.isArray(e)||e.length>mt||!e.every(t=>j(t,D))?null:[...new Set(e)].sort()}function Ie(e){return!V(e)||!j(e.chartId,D)||!j(e.version,D)||e.sha256!==void 0&&(typeof e.sha256!="string"||!we.test(e.sha256))?null:{chartId:e.chartId,version:e.version,...typeof e.sha256=="string"?{sha256:e.sha256}:{}}}function ie(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=t&&e<=n}function yt(e){return V(e)?e.mode==="none"||e.mode==="opaque"?e.opacity===void 0?{mode:e.mode}:null:e.mode==="partial"&&ie(e.opacity,.01,.99)?{mode:"partial",opacity:e.opacity}:null:null}function gt(e,t){if(e===void 0)return;if(!Array.isArray(e)||e.length>pt)return null;let n=new Set(t),i=new Set,o=new Set,r=0,s=[];for(let l of e){if(!V(l)||!j(l.id,D)||!j(l.objectId,D)||!n.has(l.objectId)||!bt.has(String(l.kind))||!ie(l.heightM,.05,50)||l.baseElevationM!==void 0&&!ie(l.baseElevationM,-10,100))return null;let c=yt(l.occlusion);if(!c||i.has(l.id)||o.has(l.objectId))return null;let u=l.contentImageUrl===void 0?void 0:typeof l.contentImageUrl=="string"?Me(l.contentImageUrl):null;if(l.contentImageUrl!==void 0&&(!u||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:c,...u?{contentImageUrl:u}:{}})}return s.sort((l,c)=>l.id.localeCompare(c.id))}function Pe(e){let t=[];if(!V(e))return{issues:[{code:"invalid_export",path:"configuration",message:"Configuration must be an object"}]};e.schema!==Y&&t.push({code:"unsupported_schema",path:"configuration.schema",message:`Configuration schema must be ${Y}`}),j(e.id,D)||t.push({code:"invalid_id",path:"configuration.id",message:"Configuration id must contain 1 to 100 normalized characters"}),j(e.label,ht)||t.push({code:"invalid_label",path:"configuration.label",message:"Configuration label must contain 1 to 120 normalized characters"}),Ee(e.version)||t.push({code:"invalid_version",path:"configuration.version",message:"Configuration version must be a positive integer"});let n=Ie(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=V(e.overlay)?e.overlay:null,o=ve(i?.objectIds),r=ve(i?.productionKillSeatIds),s=o?gt(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:Y,id:e.id,label:e.label,version:e.version,baseVenue:n,overlay:{objectIds:o,productionKillSeatIds:r,...s!==void 0?{productionElements:s}:{}}}}}function On(e){let t=Pe(e);return t.value?{ok:!0,value:t.value}:{ok:!1,issues:t.issues}}function An(e){if(!V(e))return{ok:!1,issues:[{code:"invalid_export",path:"",message:"Export must be an object"}]};let t=[];e.schema!==oe&&t.push({code:"unsupported_schema",path:"schema",message:`Export schema must be ${oe}`}),(typeof e.contentSha256!="string"||!we.test(e.contentSha256))&&t.push({code:"invalid_checksum",path:"contentSha256",message:"Export checksum must be a lowercase SHA-256 digest"});let n=Pe(e.configuration);return t.push(...n.issues),t.length||!n.value||typeof e.contentSha256!="string"?{ok:!1,issues:t}:{ok:!0,value:{schema:oe,configuration:n.value,contentSha256:e.contentSha256}}}function jn(e){return JSON.stringify({schema:Y,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 Ln(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 xt={draft:new Set(["review","archived"]),review:new Set(["draft","approved","archived"]),approved:new Set(["published","archived"]),published:new Set(["archived"]),archived:new Set};function Nn(e,t){return e===t||xt[e].has(t)}function Fn(e,t,n){return!Ee(n)||n>=t.version?null:e.find(i=>i.id===t.id&&i.version===n&&i.status==="published")??null}function St(e){return e.floors?.length?e.floors.flatMap(t=>t.objects):e.objects}function re(e,t,n){if(!(!e||typeof e!="object")){if(Array.isArray(e)){for(let i of e)re(i,t,n);return}for(let[i,o]of Object.entries(e)){if(i==="eventConfigurationId"){j(o,D)?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)j(r,D)?t.add(r):n.add(String(r));continue}re(o,t,n)}}}function Dn(e,t){let n=Ie(t);if(!n)return{ok:!1,invalidIds:["baseVenue"]};let i=new Set,o=new Set;if(re(e,i,o),o.size)return{ok:!1,invalidIds:[...o].sort()};let r=St(e);return{ok:!0,configurations:[...i].sort().map(s=>({schema:Y,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 Vn=40,Un=1200,Kn=.8,Xn=3,Gn=-2,Bn=20,zn=.1,Yn=40,Wn=40,Ce=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function Mt(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/Ce(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 c=l.length;s&&s+1+c<=i?s+=1+c:(o+=Math.max(1,Math.ceil(c/i)),s=c%i)}}return Math.max(1,o)}function _e(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),i=Math.max(1,...n.map(l=>l.length))*Ce(e),o=e.width??i+t*2,r=Math.max(1,o-t*2),s=Mt(e,r);return{width:o,height:s*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:s,padding:t}}var vt=Math.PI/180;function P(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function wt(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 qn(e,t){return wt(e,{x:0,y:0},t*vt)}function R(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Et(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 Jn(e){return e.length?Et(e):null}function se(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 eo(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 Te(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[se(e,.5)];let i=Array.from({length:n+1},(c,u)=>se(e,u/n)),o=new Float64Array(i.length);for(let c=1;c<i.length;c+=1){let u=i[c].x-i[c-1].x,a=i[c].y-i[c-1].y;o[c]=o[c-1]+Math.hypot(u,a)}let r=o[o.length-1];if(r<=1e-9)return Array.from({length:t},()=>({...e.start}));let s=[],l=1;for(let c=0;c<t;c+=1){let u=r*c/(t-1);for(;l<o.length-1&&o[l]<u;)l+=1;let a=o[l-1],m=o[l],h=m===a?0:(u-a)/(m-a);s.push({x:i[l-1].x+(i[l].x-i[l-1].x)*h,y:i[l-1].y+(i[l].y-i[l-1].y)*h})}return s}function T(e,t){return{x:e.x+t.x,y:e.y+t.y}}function W(e,t){return{x:e.x-t.x,y:e.y-t.y}}function O(e,t){return{x:e.x*t,y:e.y*t}}function q(e,t=13){return Array.from({length:t},(n,i)=>se(e,i/(t-1)))}function ke(e,t){let n=Math.max(0,Math.min(1,t))*(e.length-1),i=Math.min(e.length-2,Math.floor(n));return R(e[i],e[i+1],n-i)}function Re(e,t,n){let i=Math.max(0,Math.min(1,t)),o=Math.max(i,Math.min(1,n)),r=[ke(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(ke(e,o)),r}function Oe(e,t){let n=[[0,1],[1,2],[2,3],[3,0]],i=0,o=Number.POSITIVE_INFINITY;n.forEach(([h,f],b)=>{let y=P(R(e[h],e[f],.5),t);y<o&&(o=y,i=b)});let r=e[i],s=e[(i+1)%4],l=e[(i+2)%4],c=e[(i+3)%4],u=R(r,s,.5),a=W(t,u),m=Math.max(1e-9,Math.hypot(a.x,a.y));return{p0:r,p1:s,p2:l,p3:c,normal:O(a,1/m),depth:(P(r,c)+P(s,l))/2}}function Ae(e){let{p0:t,p1:n,p2:i,p3:o,normal:r,depth:s}=e,l=W(n,t),c=W(i,o),u=s*.22,a=s*.12;return{nearPath:{start:t,control1:T(T(t,O(l,1/3)),O(r,u)),control2:T(T(t,O(l,2/3)),O(r,u)),end:n},farPath:{start:i,control1:T(T(o,O(c,2/3)),O(r,a)),control2:T(T(o,O(c,1/3)),O(r,a)),end:o}}}function to(e,t,n){if(e.length!==4)throw new Error("A section shell requires four mapped bounds corners");let i=e.reduce((b,y)=>T(b,y),{x:0,y:0});i.x/=4,i.y/=4;let o=P(e[0],e[1]),r=P(e[0],e[3]),s=n==="auto"?o>r*1.25&&P(i,t)>r?"bezier":"tapered":n;if(s==="rectangle")return{mode:s,outline:e.map(b=>({...b}))};let l=Oe(e,t),{p0:c,p1:u,p2:a,p3:m}=l;if(s==="tapered")return{mode:s,outline:[T(c,O(W(u,c),.14)),T(c,O(W(u,c),1-.14)),a,m]};let{nearPath:h,farPath:f}=Ae(l);return{mode:s,outline:[...q(h),...q(f).slice(1)]}}function no(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=Oe(e,t),{p0:r,p1:s,p2:l,p3:c}=o,u=i==="bezier"?Ae(o):null,a=u?q(u.nearPath):null,m=u?q(u.farPath).reverse():null,h=Math.min(.055,.18/(n+1));return Array.from({length:n},(f,b)=>{let y=(b+1)/(n+1),p=y-h/2,g=y+h/2;return a&&m?[...Re(a,p,g),...Re(m,p,g).reverse()]:[R(r,s,p),R(r,s,g),R(c,l,g),R(c,l,p)]})}function It(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 Pt(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=It(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,c=t[o].y;s>e.y!=c>e.y&&e.x<(l-r)*(e.y-s)/(c-s)+r&&(n=!n)}return n}function Ct(e,t,n){let i=je(e,t)&&!n.some(r=>je(e,r)),o=Pt(e,[t,...n]);return i?o:-o}function U(e,t,n,i,o){let r=Ct({x:e,y:t},i,o);return{x:e,y:t,h:n,d:r,max:r+n*Math.SQRT2}}var ae=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 Le(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 io(e,t){return Math.max(0,Le(e)-(t??[]).reduce((n,i)=>n+Le(i),0))}function Ne(e,t){let n=t??[];if(!e.length)return{point:{x:0,y:0},radius:0};if(e.length<3){let y=e.reduce((g,S)=>g+S.x,0)/e.length,p=e.reduce((g,S)=>g+S.y,0)/e.length;return{point:{x:y,y:p},radius:0}}let i=1/0,o=1/0,r=-1/0,s=-1/0;for(let y of e)y.x<i&&(i=y.x),y.y<o&&(o=y.y),y.x>r&&(r=y.x),y.y>s&&(s=y.y);let l=r-i,c=s-o,u=Math.min(l,c);if(!(u>0))return{point:{x:(i+r)/2,y:(o+s)/2},radius:0};let a=Math.max(l,c)/150,m=new ae,h=u/2;for(let y=i;y<r;y+=u)for(let p=o;p<s;p+=u)m.push(U(y+h,p+h,h,e,n));let f=U(i+l/2,o+c/2,0,e,n),b=0;for(;m.size;){let y=m.pop();if(!y)break;y.d>f.d&&(f=y),!(y.max-f.d<=a)&&(b>=4e3||(b+=1,h=y.h/2,m.push(U(y.x-h,y.y-h,h,e,n)),m.push(U(y.x+h,y.y-h,h,e,n)),m.push(U(y.x-h,y.y+h,h,e,n)),m.push(U(y.x+h,y.y+h,h,e,n))))}return{point:{x:f.x,y:f.y},radius:Math.max(0,f.d)}}function _t(e,t,n){return Math.max(t,Math.min(n,e))}function so(e,t,n){return e<t?t:e>n?n:e}function kt(e){return _t(e,0,1)}function Fe(e){let t=kt(e);return t*t*(3-2*t)}var K=Math.PI*2;function X(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function Rt(e,t,n){let i=t-e;if(n){for(;i<0;)i+=K;for(;i>=K;)i-=K}else{for(;i>0;)i-=K;for(;i<=-K;)i+=K}return i}function uo(e){return e.end}function Ve(e){if(e.version!==1||e.closed!==!0||!X(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||!X(n.end))return!1;if(n.kind==="line"){if(P(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!X(n.control1)||!X(n.control2)||P(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!X(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(P(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(P(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||P(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return P(t,e.start)<=1e-4}function Tt(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 fo(e,t=2){if(!Ve(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),c=Rt(s,l,r.clockwise),u=Math.max(2,Math.ceil(Math.abs(c)*r.radius/n));for(let a=1;a<=u;a+=1){let m=s+c*a/u;i.push({x:r.center.x+Math.cos(m)*r.radius,y:r.center.y+Math.sin(m)*r.radius})}}else{let s=P(o,r.control1)+P(r.control1,r.control2)+P(r.control2,r.end),l=Math.max(2,Math.ceil(s/n));for(let c=1;c<=l;c+=1)i.push(Tt(o,r,c/l))}o=r.end}return P(i[i.length-1],i[0])<=1e-4&&i.pop(),i}function Ue(e,t,n){return Ot(e,o=>({x:o.x+t,y:o.y+n}))}function Ot(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)})}}var At=45,ce=150,jt=60;function Lt(e){let t=At/100;if(e<=t)return ce;let n=Math.min(1,(e-t)/(1-t));return ce-n*(ce-jt)}var De=.5523;function He(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function Nt(e){let t=[],n=[];for(e.forEach((i,o)=>{X(i)&&(t.length&&He(t[t.length-1],i)||(t.push({x:i.x,y:i.y}),n.push(o)))});t.length>1&&He(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}function ho(e,t,n){return Vt(e,{cornerSmoothing:t,...n})}var Ft=.5,Dt=4/3;function Ht(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,c=n*Dt;return{kind:"bezier",control1:{x:e.x+i/3+s*c,y:e.y+o/3+l*c},control2:{x:e.x+i*2/3+s*c,y:e.y+o*2/3+l*c},end:{...t}}}function Vt(e,t){let{points:n,sourceIndex:i}=Nt(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 d=0;d<o;d+=1){let v=s[i[d]];l[d]=Number.isFinite(v)?Math.min(100,Math.max(-100,v))/100:0}let c=l.some(d=>Math.abs(d)>1e-6);if(r<=0&&!c)return null;let u=t.wideAngleThresholdDeg??Lt(r),a=[];for(let d=0;d<o;d+=1)a[d]=P(n[d],n[(d+1)%o]);let m=new Array(o).fill(0);for(let d=0;d<o;d+=1){let v=n[(d-1+o)%o],M=n[d],w=n[(d+1)%o],E={x:v.x-M.x,y:v.y-M.y},C={x:w.x-M.x,y:w.y-M.y},_=Math.hypot(E.x,E.y),k=Math.hypot(C.x,C.y);if(_<=1e-9||k<=1e-9)continue;let H=Math.min(1,Math.max(-1,(E.x*C.x+E.y*C.y)/(_*k))),L=Math.acos(H)*180/Math.PI;if(L<u)continue;let A=Fe((L-u)/(180-u));m[d]=r*A*.5*Math.min(_,k)}for(let d=0;d<o;d+=1){let v=(d+1)%o,M=m[d]+m[v];if(M>a[d]&&M>1e-9){let w=a[d]/M;m[d]*=w,m[v]*=w}}let h=new Array(o),f=new Array(o);for(let d=0;d<o;d+=1){let v=n[(d-1+o)%o],M=n[d],w=n[(d+1)%o];if(m[d]<=1e-6){h[d]={...M},f[d]={...M};continue}let E=P(M,v)||1,C=P(M,w)||1;h[d]={x:M.x+(v.x-M.x)/E*m[d],y:M.y+(v.y-M.y)/E*m[d]},f[d]={x:M.x+(w.x-M.x)/C*m[d],y:M.y+(w.y-M.y)/C*m[d]}}if(m.every(d=>d<=1e-6)&&!c)return null;let b=[],y={...f[0]},p=y,g=(d,v)=>{if(P(p,d)<=1e-9)return;let M=l[v];Math.abs(M)>1e-6?b.push(Ht(p,d,M*Ft*a[v])):b.push({kind:"line",end:{...d}}),p=d};for(let d=1;d<=o;d+=1){let v=d%o,M=n[v];g(h[v],(d-1)%o),m[v]>1e-6&&P(h[v],f[v])>1e-9&&(b.push({kind:"bezier",control1:R(h[v],M,De),control2:R(f[v],M,De),end:{...f[v]}}),p=f[v])}if(!b.length)return null;let S=b[b.length-1];P(S.end,y)>1e-9&&(S.kind==="line"?S.end={...y}:b.push({kind:"line",end:{...y}}));let x={version:1,closed:!0,start:y,segments:b};return Ve(x)?x:null}function mo(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 bo(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 c=Math.max(1,Math.round(l/n)),u=l/c,a=Math.atan2(s.y-r.y,s.x-r.x),m=o===0,f=(o>0?t[o-1]:void 0)==="break"?2:1,b=m?{...r}:{x:r.x+Math.cos(a)*u*f,y:r.y+Math.sin(a)*u*f},y=m?c+1:Math.max(1,c-(f-1));i.push({origin:b,rotation:a*180/Math.PI,seatCount:y,seatSpacing:u})}return i}function yo(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 go(e){return e.reduce((t,n)=>t+n.seatCount,0)}function Ke(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((h,f)=>h.segmentedRow.componentIndex-f.segmentedRow.componentIndex),s=r[0]?.segmentedRow?.componentCount??0,l=r[0]?.segmentedRow;if(!l||!(s>=2&&r.length===s&&l?.boundaryBefore==="start"&&r.every((h,f)=>h.segmentedRow?.kind==="segmented-row-v1"&&h.segmentedRow.groupId===i&&h.segmentedRow.componentCount===s&&h.segmentedRow.componentIndex===f&&h.segmentedRow.repeatLabelOnComponents===l.repeatLabelOnComponents&&(f===0?h.segmentedRow.boundaryBefore==="start":h.segmentedRow.boundaryBefore!=="start")&&h.segmentedRow.displayLabel===l.displayLabel)))continue;let u=r.reduce((h,f)=>h+f.seatCount,0),a=0,m=0;for(let h of r)h.segmentedRow.boundaryBefore==="break"&&(a+=1),t.set(h.id,{groupId:i,adjacencyOffset:a,displayOffset:m,displayLabel:l.displayLabel,totalSeats:u,canonical:r[0],viewFromSeatUrl:l.viewFromSeatUrl,viewFromSeatMeta:l.viewFromSeatMeta,confidenceEvidence:l.confidenceEvidence}),a+=h.seatCount,m+=h.seatCount}return t}var G=.02291666666666667,So=1/G,Ut=58,Kt=Ut*G,Xe=0,Be=3,Ge=0,le=120,Xt=0,Gt=45,Bt=7,B=1.2;function ue(e,t,n,i){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):i}function Mo(e){return Number.isFinite(e)?Math.max(Xe,Math.min(Be,Math.round(e))):Xe}function zt(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Bt?e:Be}function ze(e,t={}){let n=ue(t.floorBaseHeightM,Ge,le,0),i=Math.min(le,n+zt(e.elevation)*Kt),o=e.height===void 0?i:ue(e.height,Ge,le,i),r=ue(e.rake,Xt,Gt,0);return{height:o,rake:r}}function Ye(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 We(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,c=s.y-r.y,u=l*l+c*c,a=u>1e-12?((t-r.x)*l+(n-r.y)*c)/u:0;a<0?a=0:a>1&&(a=1);let m=Math.hypot(t-(r.x+a*l),n-(r.y+a*c));m<i&&(i=m)}return i}function Yt(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 $e(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function de(e,t){let n=1/0;for(let i of Ye(e)){let o=We(t,i.x,i.y);o<n&&(n=o)}for(let i of Ye(t)){let o=We(e,i.x,i.y);o<n&&(n=o)}return n}function Wt(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,i=0;for(let a of e)n+=a.x,i+=a.y;n/=e.length,i/=e.length;let o=-1,r=e[0];for(let a of e){let m=Math.hypot(a.x-n,a.y-i);m>o&&(o=m,r=a)}let s=r.x-n,l=r.y-i,c=Math.hypot(s,l);c>1e-9?(s/=c,l/=c):(s=1,l=0);let u=e.map((a,m)=>({p:a,i:m,t:(a.x-n)*s+(a.y-i)*l})).sort((a,m)=>a.t-m.t);return{pts:u.map(a=>a.p),seatIndices:u.map(a=>t[a.i])}}function $t(e){let t=e.length;if(t<3)return null;let n=0,i=0;for(let S of e)n+=S.x,i+=S.y;n/=t,i/=t;let o=0,r=0,s=0,l=0,c=0,u=0,a=0;for(let S of e){let x=S.x-n,d=S.y-i;o+=x*x,s+=d*d,r+=x*d,l+=x*x*x,c+=d*d*d,u+=x*d*d,a+=d*x*x}let m=o*s-r*r;if(Math.abs(m)<1e-9)return null;let h=(l+u)/2,f=(c+a)/2,b=(h*s-f*r)/m,y=(f*o-h*r)/m,p=b+n,g=y+i;return!Number.isFinite(p)||!Number.isFinite(g)?null:{cx:p,cy:g}}var qt=.15;function Jt(e){if(e.length<2)return null;let t=e.map(S=>{let x=0,d=0;for(let v of S.pts)x+=v.x,d+=v.y;return{x:x/S.pts.length,y:d/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 x=S.x-n,d=S.y-i;o+=x*x,r+=x*d,s+=d*d}let l=o+s,c=o*s-r*r,u=l/2+Math.sqrt(Math.max(0,l*l/4-c)),a,m;Math.abs(r)>1e-12?(a=u-s,m=r):o>=s?(a=1,m=0):(a=0,m=1);let h=Math.hypot(a,m);if(!(h>1e-12))return null;a/=h,m/=h;let f=1/0,b=-1/0,y=[];for(let S of e){let x=1/0,d=-1/0;for(let v of S.pts){let M=v.x*a+v.y*m;M<x&&(x=M),M>d&&(d=M),M<f&&(f=M),M>b&&(b=M)}y.push(d-x)}let p=b-f;return p>1e-9?(y.sort((S,x)=>S-x),y[Math.min(y.length-1,Math.floor(y.length*.9))]/p<=Zt?{x:a,y:m}:null):null}var Zt=.35;function qe(e,t,n,i){let o=new Map;for(let p of n){let g=t[p],S=g.rowId||`__seat-${p}`,x=o.get(S);x||(x={pts:[],idx:[]},o.set(S,x)),x.pts.push({x:g.x,y:g.y}),x.idx.push(p)}if(!o.size)return{sectionId:e,rows:[],blockCount:0};let r=[];for(let[p,g]of o){let S=Wt(g.pts,g.idx),x=0;for(let d of S.pts)x+=Math.hypot(d.x-i.x,d.y-i.y);r.push({id:p,pts:S.pts,seatIndices:S.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:x/S.pts.length})}let s=r.map(p=>Yt(p.pts)),l=[];for(let p=0;p<r.length;p++){let g=1/0;for(let S=0;S<r.length;S++){if(p===S||$e(s[p],s[S])>=g)continue;let x=de(r[p].pts,r[S].pts);x<g&&(g=x)}Number.isFinite(g)&&l.push(g)}l.sort((p,g)=>p-g);let c=l.length?l[Math.floor(l.length/2)]:1,u=Math.max(c*1.8,1e-6),a=r.map(()=>[]);for(let p=0;p<r.length;p++)for(let g=p+1;g<r.length;g++)$e(s[p],s[g])>u||de(r[p].pts,r[g].pts)<=u&&(a[p].push(g),a[g].push(p));let m=0;for(let p=0;p<r.length;p++){if(r[p].blockId!==-1)continue;let g=m++,S=[p];for(r[p].blockId=g;S.length;){let x=S.pop();for(let d of a[x])r[d].blockId===-1&&(r[d].blockId=g,S.push(d))}}let h=new Map;for(let p of r){let g=h.get(p.blockId)??[];g.push(p),h.set(p.blockId,g)}let f=[];for(let p of r){if(p.pts.length<4)continue;let g=$t(p.pts);g&&(!Number.isFinite(g.cx)||!Number.isFinite(g.cy)||f.push({x:g.cx,y:g.cy}))}let b=f.length>=2?(()=>{let p=f.map(x=>x.x).sort((x,d)=>x-d),g=f.map(x=>x.y).sort((x,d)=>x-d),S=Math.floor(f.length/2);return{cx:p[S],cy:g[S]}})():null;if(b){let p=M=>Math.hypot(M.x-b.cx,M.y-b.cy),g=1/0,S=-1/0,x=[];for(let M of r){let w=1/0,E=-1/0;for(let C of M.pts){let _=p(C);_<w&&(w=_),_>E&&(E=_)}x.push(E-w),w<g&&(g=w),E>S&&(S=E)}let d=S-g;x.sort((M,w)=>M-w);let v=x[Math.min(x.length-1,Math.floor(x.length*.9))];if(d>1e-9&&v/d<=qt){let M=r.map(I=>{let N=0;for(let F of I.pts)N+=p(F);return{row:I,radius:N/I.pts.length}}),w=0,E=0;for(let I of M)w+=I.radius,E+=I.row.focalDistance;w/=M.length,E/=M.length;let C=0;for(let I of M)C+=(I.radius-w)*(I.row.focalDistance-E);if(C<0)for(let I of M)I.radius=-I.radius;let k=1/0;for(let I of M)I.radius<k&&(k=I.radius);M.sort((I,N)=>I.radius-N.radius);let H=-1,L=-1/0,A=d/Math.max(1,M.length)*.5,$=[];for(let I of M)I.radius-L>A&&(H++,L=I.radius),I.row.ordinal=H,I.row.blockDepth=I.radius-k,$.push(I.row);return{sectionId:e,rows:$,blockCount:m}}}let y=[];for(let[,p]of h){let g=Jt(p);if(g){let S=d=>{let v=0;for(let M of d.pts)v+=M.x*g.x+M.y*g.y;return v/d.pts.length};p.sort((d,v)=>S(d)-S(v)),p.length>=2&&p[0].focalDistance>p[p.length-1].focalDistance&&p.reverse();let x=0;for(let d=0;d<p.length;d++)d>0&&(x+=de(p[d-1].pts,p[d].pts)),p[d].ordinal=d,p[d].blockDepth=x,y.push(p[d])}else{let S=1/0;for(let x of p)x.focalDistance<S&&(S=x.focalDistance);p.sort((x,d)=>x.focalDistance-d.focalDistance);for(let x=0;x<p.length;x++)p[x].ordinal=x,p[x].blockDepth=Math.max(0,p[x].focalDistance-S),y.push(p[x])}}return{sectionId:e,rows:y,blockCount:m}}var Eo=[{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."}],Qt={"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}};var Je=Math.PI*2;function Ze(e,t,n,i,o,r){return{x:o+e*n-t*i,y:r+e*i+t*n}}function Io(e){let{kind:t,cx:n,cy:i,width:o,height:r}=e,s=(e.rotation??0)*Math.PI/180,l=Math.cos(s),c=Math.sin(s),u=o/2,a=r/2,m=[],h=(f,b)=>{m.push({x:f,y:b})};switch(t){case"rect":{h(-u,-a),h(u,-a),h(u,a),h(-u,a);break}case"rounded":{let f=Math.min(o,r)*.18,b=5,y=(p,g,S)=>{for(let x=0;x<=b;x++){let d=S+x/b*(Math.PI/2);h(p+f*Math.cos(d),g+f*Math.sin(d))}};y(u-f,-a+f,-Math.PI/2),y(u-f,a-f,0),y(-u+f,a-f,Math.PI/2),y(-u+f,-a+f,Math.PI);break}case"arc":{let f=r*.45;h(-u,-a),h(u,-a);let b=24;for(let y=0;y<=b;y++){let p=y/b,g=u-p*o,S=a+f*(1-Math.pow(2*g/o,2));h(g,S)}break}case"thrust":{let f=o*.18,b=r*1.1;h(-u,-a),h(u,-a),h(u,a),h(f,a),h(f,a+b),h(-f,a+b),h(-f,a),h(-u,a);break}case"runway":{let f=o*.1,b=r*3;h(-u,-a),h(u,-a),h(u,a),h(f,a),h(f,a+b),h(-f,a+b),h(-f,a),h(-u,a);break}case"round":case"oval-cricket":{for(let b=0;b<40;b++){let y=b/40*Je;h(u*Math.cos(y),a*Math.sin(y))}break}case"pitch-football":{h(-u,-a),h(u,-a),h(u,a),h(-u,a);break}case"rink-hockey":{for(let f of en(u,a,u*(8.5/60),a*(8.5/30)))h(f.x,f.y);break}case"track-athletics":{for(let f of he(u,a))h(f.x,f.y);break}}return m.map(f=>Ze(f.x,f.y,l,c,n,i))}function en(e,t,n,i){let o=[],s=(l,c,u)=>{for(let a=0;a<=8;a++){let m=u+a/8*(Math.PI/2);o.push({x:l+n*Math.cos(m),y:c+i*Math.sin(m)})}};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 he(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 Po="#f1f5f9";function me(e){return e==="pitch-football"||e==="rink-hockey"||e==="track-athletics"||e==="oval-cricket"}function J(e,t,n,i,o=32){let r=[];for(let s=0;s<o;s++){let l=s/o*Je;r.push({x:e+n*Math.cos(l),y:t+i*Math.sin(l)})}return r}function fe(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 tn(e){let{kind:t,cx:n,cy:i,width:o,height:r}=e,s=(e.rotation??0)*Math.PI/180,l=Math.cos(s),c=Math.sin(s),u=o/2,a=r/2,m=[],h=Qt[t],f=y=>h?y/h.width*o:0,b=y=>h?y/h.height*r:0;switch(t){case"pitch-football":{m.push({points:[{x:0,y:-a},{x:0,y:a}],closed:!1}),m.push({points:J(0,0,f(9.15),b(9.15)),closed:!0});for(let y of[-1,1])m.push({points:fe(y*(u-f(16.5)/2),0,f(16.5)/2,b(40.32)/2),closed:!0}),m.push({points:fe(y*(u-f(5.5)/2),0,f(5.5)/2,b(18.32)/2),closed:!0});break}case"rink-hockey":{m.push({points:[{x:0,y:-a},{x:0,y:a}],closed:!1,ink:"#d63b3b"});for(let y of[-1,1]){m.push({points:[{x:y*f(7.5),y:-a},{x:y*f(7.5),y:a}],closed:!1,ink:"#2f6ecb"}),m.push({points:[{x:y*(u-f(4)),y:-b(11)},{x:y*(u-f(4)),y:b(11)}],closed:!1,ink:"#d63b3b"});for(let p of[-1,1])m.push({points:J(y*f(20.5),p*b(7),f(4.5),b(4.5)),closed:!0,ink:"#2f6ecb"})}m.push({points:J(0,0,f(4.5),b(4.5)),closed:!0,ink:"#2f6ecb"});break}case"track-athletics":{let p=a-b(1.22)*8;p>0&&m.push({points:he(u-f(1.22)*8,p),closed:!0,fill:"#2f7d4f"});for(let g=1;g<8;g++){let S=b(1.22)*g,x=a-S;if(x<=0)break;m.push({points:he(u-f(1.22)*g,x),closed:!0})}break}case"oval-cricket":{m.push({points:J(0,0,f(27.4),b(27.4+20.12/2),40),closed:!0}),m.push({points:fe(0,0,f(3.05)/2,b(20.12)/2),closed:!0,ink:"#d8cfae"});break}default:return[]}return m.map(y=>({...y,points:y.points.map(p=>Ze(p.x,p.y,l,c,n,i))}))}function Co(e){if(e.role!=="stage"||!me(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(a=>a.x),i=e.points.map(a=>a.y),o=Math.min(...n),r=Math.max(...n),s=Math.min(...i),l=Math.max(...i),c=Math.max(1,r-o),u=Math.max(1,l-s);t={cx:o+c/2,cy:s+u/2,width:c,height:u}}return t?tn({kind:e.stageKind,...t}):[]}function nn(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return 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 on(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 Qe(e){let t=nn(e);if(!t||t.length<2)return null;let n=e.rotation??0,i=Math.abs(n)<1e-6?t:t.map(c=>on(c,{x:t.reduce((u,a)=>u+a.x,0)/t.length,y:t.reduce((u,a)=>u+a.y,0)/t.length},n)),o=1/0,r=1/0,s=-1/0,l=-1/0;for(let c of i)o=Math.min(o,c.x),r=Math.min(r,c.y),s=Math.max(s,c.x),l=Math.max(l,c.y);return!Number.isFinite(o)||s-o<1e-6||l-r<1e-6?null:{minX:o,minY:r,maxX:s,maxY:l}}var rn=5,sn=3,an=.92,cn=1.9,ln=2,un=.6,dn=1,fn=.06;function hn(e){return e.heightM!==void 0?e.heightM:me(e.stageKind)?fn:dn}function et(e){let t=1/0,n=1/0,i=-1/0,o=-1/0,r=-1/0;for(let s of pe(e)){let l=s.baseHeightM??0;for(let c of s.objects){if(c.type!=="shape"||c.role!=="stage")continue;let u=Qe(c);u&&(t=Math.min(t,u.minX),n=Math.min(n,u.minY),i=Math.max(i,u.maxX),o=Math.max(o,u.maxY),r=Math.max(r,l+hn(c)))}}return!Number.isFinite(t)||!Number.isFinite(r)?null:{minX:t,minY:n,maxX:i,maxY:o,deckTopM:r}}function mn(e,t,n,i){let o=1/0,r=1/0,s=-1/0,l=-1/0;for(let f of e)Number.isFinite(f.eyeHeightM)&&(o=Math.min(o,f.x),s=Math.max(s,f.x),r=Math.min(r,f.y),l=Math.max(l,f.y));if(!Number.isFinite(o))return null;let c=o*t,u=r*t,a=Math.max(1,Math.ceil((s-o)*t/n)+1),m=Math.max(1,Math.ceil((l-r)*t/n)+1),h=new Float64Array(a*m).fill(-1/0);for(let f of e){if(!Number.isFinite(f.eyeHeightM))continue;let b=f.eyeHeightM-B,y=Math.min(a-1,Math.max(0,Math.floor((f.x*t-c)/n))),g=Math.min(m-1,Math.max(0,Math.floor((f.y*t-u)/n)))*a+y,S=b+i;S>h[g]&&(h[g]=S)}return{cellM:n,minX:c,minY:u,cols:a,rows:m,top:h}}function pn(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 tt(e,t,n={}){let i=new Map;if(!t||!e.length)return i;let o=n.metresPerChartUnit??G,r=n.cellM??un,s=n.chairBackM??an,l=n.selfRowSkipM??ln,c=n.clearThreshold??.9,u=n.partialThreshold??.25,a=Math.max(1,n.columns??rn),m=Math.max(1,n.rows??sn),h=mn(e,o,r,s);if(!h)return i;let f=(t.maxX-t.minX)*o,b=(t.maxY-t.minY)*o,y=f>=b,p=(t.minX+t.maxX)/2*o,g=(t.minY+t.maxY)/2*o,S=[];for(let d=0;d<a;d++){let v=(d+.5)/a-.5,M=y?p+v*f:p,w=y?g:g+v*b;for(let E=0;E<m;E++){let C=t.deckTopM+(m===1?0:E/(m-1)*cn);S.push({x:M,y:w,z:C})}}let x=r/2;for(let d of e){if(!Number.isFinite(d.eyeHeightM))continue;let v=d.x*o,M=d.y*o,w=d.eyeHeightM,E=0,C=1/0;for(let k of S){let H=k.x-v,L=k.y-M,A=Math.hypot(H,L);if(!(A>l)){E++;continue}let $=H/A,I=L/A,N=0;for(let F=l;F<A;F+=x){let te=pn(h,v+$*F,M+I*F);if(!(!Number.isFinite(te)||te>=w)&&te>w+(k.z-w)*F/A){N=F;break}}N?C=Math.min(C,N):E++}let _=E/S.length;_>=c||i.set(d.id,{seatId:d.id,mark:_<u?"obstructedView":"restrictedView",visibleFraction:_,totalRays:S.length,atDistanceM:Number.isFinite(C)?C:0})}return i}function nt(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 be(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var Q=Math.PI/180,bn=9,z=16;function ge(e,t,n,i){let o=n*Q,r=Math.cos(o),s=Math.sin(o);return{x:i.x+e*r-t*s,y:i.y+e*s+t*r}}function at(e){let{seatCount:t,seatSpacing:n,curve:i,rotation:o,origin:r}=e,s=[];if(e.path)return Te(e.path,t);if(t<=1)return t===1&&s.push({x:r.x,y:r.y}),s;if(i===0){for(let u=0;u<t;u++)s.push(ge(u*n,0,o,r));return s}let l=i/(t-1)*Q,c=n/(2*Math.sin(Math.abs(l)/2));for(let u=0;u<t;u++){let a=u*l,m=c*Math.sin(a),h=-c+c*Math.cos(a);s.push(ge(m,h,o,r))}return s}function yn(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function $o(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 gn(e,t){let n=yn(e);return at(e).map((i,o)=>{let r=n.get(o),s=be(r),l=xe(e,o,r),c={...e.commercial,...r?.commercial};return{index:o,x:i.x+(r?.dx??0),y:i.y+(r?.dy??0),label:l,displayLabel:ne(e,o,t,r),categoryKey:r?.categoryKey??e.categoryKey,skipped:!!r?.skip,accessible:s.length>0,accessibility:s,wheelchairSpaceType:r?.wheelchairSpaceType,commercial:Object.values(c).some(u=>u!==void 0&&u!==!1&&u!=="")?c:void 0,glyph:r?.glyph,viewUrl:r?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:r?.viewFromSeatUrl?r.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:r?.labelStyle??e.seatLabelStyle}})}function ct(e){let t=[];for(let n of gn(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 xn(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 lt(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let i=new Map((e.overrides??[]).map(a=>[a.index,a])),o=(a,m,h,f)=>{let b=i.get(a),y=be(b),p=b?.label??`${e.label}-${a+1}`,g=e.displayLabel??e.label;return{index:a,label:p,displayLabel:b?.displayLabel??`${g}-${a+1}`,x:m+(b?.dx??0),y:h+(b?.dy??0),categoryKey:b?.categoryKey??e.categoryKey,skipped:!!b?.skip,accessible:y.length>0,accessibility:y,wheelchairSpaceType:b?.wheelchairSpaceType,commercial:b?.commercial,glyph:b?.glyph,viewUrl:b?.viewFromSeatUrl,viewMeta:b?.viewFromSeatUrl?b.viewFromSeatMeta:void 0,labelStyle:b?.labelStyle,...f?{side:f}:{}}};if(e.shape==="round"){let a=(e.radius??40)+z,m=e.rotation*Q,h=Math.max(0,Math.min(360,e.seatArc??360));if(h>=360||n===1){for(let p=0;p<n;p++){let g=m+p/n*2*Math.PI;t.push(o(p,e.center.x+a*Math.cos(g),e.center.y+a*Math.sin(g)))}return t}let f=h*Q,b=(2*Math.PI-f)/2,y=m+b;for(let p=0;p<n;p++){let g=y+p/(n-1)*f;t.push(o(p,e.center.x+a*Math.cos(g),e.center.y+a*Math.sin(g)))}return t}let r=e.width??80,s=e.height??50,l=xn(e),c=["top","bottom","left","right"],u=0;for(let a of c){let m=l[a];for(let h=0;h<m;h++){let f,b;a==="top"?(f=-r/2+(h+.5)*r/m,b=-s/2-z):a==="bottom"?(f=-r/2+(h+.5)*r/m,b=s/2+z):a==="left"?(f=-r/2-z,b=-s/2+(h+.5)*s/m):(f=r/2+z,b=-s/2+(h+.5)*s/m);let y=ge(f,b,e.rotation,e.center);t.push(o(u++,y.x,y.y,a))}}return t}function qo(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):lt(e).filter(t=>!t.skipped).length}function Sn(e){return lt(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 Mn(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"}]}function ot(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,c=t[o].y;s>e.y!=c>e.y&&e.x<(l-r)*(e.y-s)/(c-s)+r&&(n=!n)}return n}function vn(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 ee(e,t,n){return ot(e,t)&&!(n??[]).some(i=>ot(e,i)||vn(e,i))}function Jo(e,t){return Ne(e,t).point}function ye(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 wn(e){switch(e.type){case"row":{let t=ct(e);if(!t.length)return{x:e.origin.x,y:e.origin.y};let n=0,i=0;for(let o of t)n+=o.x,i+=o.y;return{x:n/t.length,y:i/t.length}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return ye(e.points);case"section":return ye(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?ye(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 it(e,t){return e.length===t.length&&e.every((n,i)=>n.x===t[i].x&&n.y===t[i].y)}function En(e,t){if(e.type!=="gaArea"||!it(e.points,t.outline))return!1;let n=e.holes??[],i=t.holes??[];return n.length===i.length&&n.every((o,r)=>it(o,i[r]))}function In(e,t){let n=e.filter(s=>s.type==="section"),i="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0,o=wn(t);return(i?n.find(s=>(s.logicalSectionId??s.id)===i&&(En(t,s)||ee(o,s.outline,s.holes))):void 0)??n.find(s=>ee(o,s.outline,s.holes))}function pe(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 Zo(e,t){let n=pe(e);return(t?n.find(i=>i.id===t):n[0])?.objects??[]}function Pn(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function Cn(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:e.holes.map(o)}:{}};case"section":return{...e,outline:o(e.outline),...e.outlinePath?{outlinePath:Ue(e.outlinePath,t,n)}:{},...e.holes?{holes:e.holes.map(o)}:{}};case"text":return{...e,position:i(e.position)};case"shape":return{...e,...e.points?{points:o(e.points)}:{},...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 Qo(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:Cn(s,0,r))}),{...e,objects:n,floors:void 0}}function rt(e,t,n,i,o,r,s,l,c){let u=[],a=Ke(e),m=b=>!b?.eventConfigurationId||b.eventConfigurationId===i&&(b.eventConfigurationVersion===void 0||b.eventConfigurationVersion===c),h=b=>Se(b,{activeConfigurationId:i,activeConfigurationVersion:c,activeBasisSha256:o,now:l}),f=(b,y)=>h(b)?{...b,coverage:y}:void 0;for(let b of e){let y=[];if(b.type==="row"?y=ct(b):b.type==="table"?y=Sn(b):b.type==="booth"&&(y=Mn(b)),!y.length)continue;for(let d of y)d.viewUrl&&!m(d.viewMeta)&&(d.viewUrl=void 0,d.viewMeta=void 0);if(b.type==="row"){let d=a.get(b.id);if(d){let v=new Map((b.overrides??[]).map(M=>[M.index,M]));for(let M of y){let w=Number(M.id.slice(M.id.lastIndexOf(":")+1));if(!Number.isInteger(w))continue;M.logicalRowId=d.groupId,M.logicalSeatIndex=d.adjacencyOffset+w,v.get(w)?.displayLabel||(M.displayLabel=ne(b,w,d)),!M.viewUrl&&d.viewFromSeatUrl&&m(d.viewFromSeatMeta)&&(M.viewUrl=d.viewFromSeatUrl,M.viewMeta=d.viewFromSeatMeta);let E=v.get(w)?.confidenceEvidence;M.confidenceEvidence=f(E,"exact-seat")??f(b.confidenceEvidence,"row-representative")??f(d.confidenceEvidence,"row-representative")}}}let p=In(e,b),g=p?.viewFromSeatUrl,x=(p?.zone?t?.find(d=>d.id===p.zone):void 0)?.focalPoint??n;for(let d of y){if(!d.confidenceEvidence){let v=Number(d.id.slice(d.id.lastIndexOf(":")+1)),M=(b.type==="row"||b.type==="table")&&Number.isInteger(v)?b.overrides?.find(w=>w.index===v)?.confidenceEvidence:void 0;d.confidenceEvidence=f(M,"exact-seat")??(b.type==="row"?f(b.confidenceEvidence,"row-representative"):void 0)}d.confidenceEvidence??=f(p?.confidenceEvidence,"section-representative")??(s?f(s.evidence,s.coverage):void 0),!d.viewUrl&&g&&m(p?.viewFromSeatMeta)&&(d.viewUrl=g,d.viewMeta=p?.viewFromSeatMeta),!d.viewUrl&&r&&m(r.meta)&&(d.viewUrl=r.url,d.viewMeta=r.meta),p&&(d.sectionId=p.logicalSectionId??p.id),p?.zone&&(d.zoneId=p.zone),x&&(d.focalPoint={...x})}u.push(...y)}return u}function ei(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,c=rt(o.objects,e.zones,r,e.eventConfigurationId,e.confidenceBasisSha256,s,l,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&st(o.objects,o.focalPoint??e.focalPoint,o.baseHeightM??0,c);for(let u of c)u.floorId=o.id;i.push(...c)}return i}let n=rt(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&&st(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),_n(e,n,t)}function _n(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||nt(t,tt(t,et(e))),t}function st(e,t,n,i){let o=e.filter(a=>a.type==="section"),r=n>0||o.some(a=>a.height!==void 0||a.rake!==void 0||(a.elevation??0)>0);if(!o.length||!r||!t){for(let a of i)a.eyeHeightM=n+B;return}let s=new Array(i.length),l=new Map,c=new Map;for(let a=0;a<i.length;a++){let m=i[a],f=(m.sectionId?o.find(y=>y.id===m.sectionId)??o.find(y=>y.logicalSectionId===m.sectionId&&ee({x:m.x,y:m.y},y.outline,y.holes)):void 0)??o.find(y=>ee({x:m.x,y:m.y},y.outline,y.holes))??null;if(s[a]=f,!f)continue;l.has(f.id)||l.set(f.id,ze(f,{floorBaseHeightM:n}));let b=c.get(f.id);b?b.push(a):c.set(f.id,[a])}let u=new Array(i.length).fill(void 0);for(let[a,m]of c){let h=l.get(a);if(!h)continue;let f=h.rake>0?Math.tan(h.rake*Math.PI/180):0,b=qe(a,i,m,t);for(let y of b.rows){let p=y.blockDepth*G*f,g=h.height+p;for(let S of y.seatIndices)u[S]=g}}for(let a=0;a<i.length;a++){let m=i[a],h=s[a];if(!h){m.eyeHeightM=n+B;continue}let f=l.get(h.id);m.eyeHeightM=(u[a]??f.height)+B}}var Z=40;function ti(e,t){let n=t?.freeText==="exclude",i=1/0,o=1/0,r=-1/0,s=-1/0,l=(c,u)=>{c<i&&(i=c),u<o&&(o=u),c>r&&(r=c),u>s&&(s=u)};for(let c of Pn(e))if(c.type==="row"){let u=new Map((c.overrides??[]).map(a=>[a.index,a]));at(c).forEach((a,m)=>{let h=u.get(m);h?.skip||l(a.x+(h?.dx??0),a.y+(h?.dy??0))})}else if(c.type==="gaArea")for(let u of c.points)l(u.x,u.y);else if(c.type==="section")for(let u of c.outline)l(u.x,u.y);else if(c.type==="decorImage")l(c.x,c.y),l(c.x+c.width,c.y+c.height);else if(c.type==="shape")if(c.points&&c.points.length)for(let u of c.points)l(u.x,u.y);else c.x!=null&&c.y!=null&&c.width!=null&&c.height!=null&&(l(c.x,c.y),l(c.x+c.width,c.y+c.height));else if(c.type==="table"){let u=z+bn,a=c.shape==="round"?(c.radius??40)+u:Math.max((c.width??80)/2,(c.height??50)/2)+u;l(c.center.x-a,c.center.y-a),l(c.center.x+a,c.center.y+a)}else if(c.type==="booth"){let u=Math.max(c.width,c.height)/2;l(c.center.x-u,c.center.y-u),l(c.center.x+u,c.center.y+u)}else if(c.type==="text"){if(n)continue;let u=_e(c);l(c.position.x,c.position.y),l(c.position.x+u.width,c.position.y+u.height)}for(let c of[e.referenceImage,e.backgroundImage]){if(!c)continue;let{center:u,width:a}=c,m=a*3/4;l(u.x-a/2,u.y-m/2),l(u.x+a/2,u.y+m/2)}if(!isFinite(i)){let c=e.focalPoint??{x:0,y:0};return{x:c.x-200,y:c.y-200,width:400,height:400}}return{x:i-Z,y:o-Z,width:r-i+Z*2,height:s-o+Z*2}}export{kn as a,ft as b,Me as c,Y as d,oe as e,On as f,An as g,jn as h,Ln as i,Nn as j,Fn as k,Dn as l,Vn as m,Un as n,Kn as o,Xn as p,Gn as q,Bn as r,zn as s,Yn as t,Wn as u,_e as v,qn as w,Et as x,Jn as y,se as z,eo as A,Te as B,to as C,no as D,Pt as E,Le as F,io as G,Ne as H,_t as I,so as J,uo as K,Ve as L,fo as M,Ue as N,Ot as O,At as P,Lt as Q,ho as R,Ft as S,Vt as T,mo as U,bo as V,yo as W,go as X,Ke as Y,G as Z,So as _,Kt as $,Xe as aa,Be as ba,Ge as ca,le as da,Xt as ea,Gt as fa,Bt as ga,B as ha,Mo as ia,ze as ja,We as ka,$t as la,qe as ma,Eo as na,Io as oa,Po as pa,me as qa,Co as ra,be as sa,z as ta,at as ua,$o as va,gn as wa,ct as xa,xn as ya,lt as za,qo as Aa,Sn as Ba,Mn as Ca,ot as Da,ee as Ea,Jo as Fa,wn as Ga,In as Ha,pe as Ia,Zo as Ja,Pn as Ka,Cn as La,Qo as Ma,ei as Na,ti as Oa};