@seatlayer/core 0.101.0 → 0.103.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/ar-D6ASWQBI.js +1 -0
- package/dist/be-T23MSCFC.js +1 -0
- package/dist/bg-2MMSY43I.js +1 -0
- package/dist/ca-EXRTYE33.js +1 -0
- package/dist/{categoryInventory-H77A_8pF.d.cts → categoryInventory-D_gpkfsq.d.cts} +1 -1
- package/dist/{categoryInventory-DZ5IcDOy.d.ts → categoryInventory-i-mGCBD3.d.ts} +1 -1
- package/dist/chunk-2STEWCI2.js +1 -0
- package/dist/chunk-33SRM2CP.js +1 -0
- package/dist/chunk-3W4ZMU4G.js +1 -0
- package/dist/chunk-76AUT55N.js +1 -0
- package/dist/chunk-B75VUM6L.js +1 -0
- package/dist/{chunk-L34T3APU.js → chunk-FAY7ARLB.js} +1 -1
- package/dist/{chunk-2RNZOV5I.js → chunk-GPZFVQXV.js} +1 -1
- package/dist/chunk-JRZHC75P.js +1 -0
- package/dist/chunk-KTMZ3QAO.js +1 -0
- package/dist/chunk-NWRHKTMV.js +1 -0
- package/dist/{chunk-5HXTEMRE.js → chunk-QG7ZFUNX.js} +1 -1
- package/dist/{chunk-GLGXP5I7.js → chunk-R2TRYVOY.js} +1 -1
- package/dist/chunk-RF4QU72N.js +1 -0
- package/dist/chunk-TFYAMLCK.js +1 -0
- package/dist/chunk-TZBJCAXH.js +1 -0
- package/dist/chunk-UEDS3HJ3.js +1 -0
- package/dist/chunk-UEYHH7Y5.js +1 -0
- package/dist/chunk-WH2EVBIG.js +1 -0
- package/dist/chunk-WKWXU5QM.js +1 -0
- package/dist/{chunk-P4J57TK6.js → chunk-YPVYZYMH.js} +1 -1
- package/dist/core/chart-ops/index.cjs +1 -1
- package/dist/core/chart-ops/index.d.cts +491 -18
- package/dist/core/chart-ops/index.d.ts +491 -18
- package/dist/core/chart-ops/index.js +1 -1
- package/dist/core/color.d.cts +1 -1
- package/dist/core/color.d.ts +1 -1
- package/dist/core/inventory/index.cjs +1 -1
- package/dist/core/inventory/index.d.cts +72 -5
- package/dist/core/inventory/index.d.ts +72 -5
- package/dist/core/inventory/index.js +1 -1
- package/dist/core/layout/index.cjs +1 -1
- package/dist/core/layout/index.d.cts +63 -6
- package/dist/core/layout/index.d.ts +63 -6
- package/dist/core/layout/index.js +1 -1
- package/dist/core/quality/index.cjs +1 -1
- package/dist/core/quality/index.d.cts +18 -4
- package/dist/core/quality/index.d.ts +18 -4
- package/dist/core/quality/index.js +1 -1
- package/dist/core/render-assets/index.cjs +1 -1
- package/dist/core/render-assets/index.d.cts +45 -5
- package/dist/core/render-assets/index.d.ts +45 -5
- 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.cjs +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/cs-L5EG7LLR.js +1 -0
- package/dist/cy-AB2Q6XHI.js +1 -0
- package/dist/da-EGJO7W4Q.js +1 -0
- package/dist/de-Q56NNVPD.js +1 -0
- package/dist/el-JW2YADAL.js +1 -0
- package/dist/es-N35HVHMD.js +1 -0
- package/dist/et-53UYPQR7.js +1 -0
- package/dist/{eventConfigurations-ClFqXQi9.d.cts → eventConfigurations-C0x_OtjQ.d.cts} +1 -1
- package/dist/{eventConfigurations-B6aS6c-_.d.ts → eventConfigurations-CDPqKz_8.d.ts} +1 -1
- package/dist/fa-JL3HW42Q.js +1 -0
- package/dist/fi-ZFWROLPU.js +1 -0
- package/dist/fr-6EKBGKIT.js +1 -0
- package/dist/he-KSOTIRJW.js +1 -0
- package/dist/hi-RWHSYCVV.js +1 -0
- package/dist/hr-ECH5LYKR.js +1 -0
- package/dist/hu-BAXHRRWC.js +1 -0
- package/dist/id-ECFNLK3G.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +65 -17
- package/dist/index.d.ts +65 -17
- package/dist/index.js +1 -1
- package/dist/it-HT57FDFI.js +1 -0
- package/dist/ja-LHVHSM5J.js +1 -0
- package/dist/ko-G2HVHBKT.js +1 -0
- package/dist/ku-MNPV6BJJ.js +1 -0
- package/dist/{labeling-ByEZkLee.d.cts → labeling-20iLar-Q.d.ts} +11 -3
- package/dist/{labeling-CP3GhUrf.d.ts → labeling-DW_pEMgl.d.cts} +11 -3
- package/dist/localeLoaders-L36RHPNS.js +1 -0
- package/dist/lt-GB2GJDNS.js +1 -0
- package/dist/lv-3ZE6IM47.js +1 -0
- package/dist/ms-YH2PYOHG.js +1 -0
- package/dist/nl-D4FX7T7U.js +1 -0
- package/dist/no-5YNLYHN4.js +1 -0
- package/dist/pl-RUXCR6JV.js +1 -0
- package/dist/pt-TKFGIUL6.js +1 -0
- package/dist/{renderedQuality--H0toc-2.d.cts → renderedQuality-BIWwSRMS.d.cts} +1 -1
- package/dist/{renderedQuality-Bo4k99GE.d.ts → renderedQuality-CdpKQidA.d.ts} +1 -1
- package/dist/{renderer-BPhSZUGh.d.cts → renderer-BSjyHBDK.d.cts} +8 -1
- package/dist/{renderer-CWbam_zr.d.ts → renderer-BurPZ2Io.d.ts} +8 -1
- package/dist/ro-UFIOIOVH.js +1 -0
- package/dist/ru-VMRD53B7.js +1 -0
- package/dist/{seatTypeIcons-CSt1isBY.d.ts → seatTypeIcons-BlEzPXFf.d.cts} +2 -2
- package/dist/{seatTypeIcons-B2tvcQ0H.d.cts → seatTypeIcons-D_T5HfJs.d.ts} +2 -2
- package/dist/{sections-C_AKwOIh.d.cts → sections-BySKMsFE.d.ts} +5 -2
- package/dist/{sections-JHox6Lsw.d.ts → sections-DXUcW0ZT.d.cts} +5 -2
- package/dist/{segmentedRowModel-DQO0vHR1.d.ts → segmentedRowModel-C5qFY6jJ.d.ts} +1 -1
- package/dist/{segmentedRowModel-CZ0Ciea-.d.cts → segmentedRowModel-CyW-LFuI.d.cts} +1 -1
- package/dist/sk-XIK2KO3F.js +1 -0
- package/dist/sl-CDZGH6C6.js +1 -0
- package/dist/sr-A3TESNV3.js +1 -0
- package/dist/sv-HKGKDGSG.js +1 -0
- package/dist/{tableSizing-ClgbhNks.d.ts → tableSizing-Bos5ueqg.d.cts} +5 -4
- package/dist/{tableSizing-Cp5T_6Lw.d.cts → tableSizing-CAiE_oii.d.ts} +5 -4
- package/dist/th-ZPGRIY7D.js +1 -0
- package/dist/{ticketRestrictions-DUdzkp4F.d.ts → ticketRestrictions-DKdJWh9u.d.cts} +39 -3
- package/dist/{ticketRestrictions-BHNbxzFT.d.cts → ticketRestrictions-DRDtAVKw.d.ts} +39 -3
- package/dist/tr-IUB54G3R.js +1 -0
- package/dist/{types-5AlKCD4j.d.ts → types-ZviQR7ch.d.cts} +194 -9
- package/dist/{types-5AlKCD4j.d.cts → types-ZviQR7ch.d.ts} +194 -9
- package/dist/uk-JQKEV42K.js +1 -0
- package/dist/vi-KRM5S2Q7.js +1 -0
- package/dist/view3d/crossfade/panorama.d.cts +1 -1
- package/dist/view3d/crossfade/panorama.d.ts +1 -1
- package/dist/view3d/index.cjs +54 -54
- package/dist/view3d/index.d.cts +13 -3
- package/dist/view3d/index.d.ts +13 -3
- package/dist/view3d/index.js +44 -44
- package/dist/view3d/scene/scene.worker.cjs +1 -1
- package/dist/view3d/scene/scene.worker.js +1 -1
- package/dist/zh-Hans-FEUYIOYS.js +1 -0
- package/dist/zh-Hant-PK2XOE2G.js +1 -0
- package/package.json +1 -1
- package/dist/ar-Q44JP5JY.js +0 -1
- package/dist/be-CGFFSIQL.js +0 -1
- package/dist/bg-WOYK6OLH.js +0 -1
- package/dist/ca-77ZVI3X5.js +0 -1
- package/dist/chunk-52XO3LA7.js +0 -1
- package/dist/chunk-5BMXWOE7.js +0 -1
- package/dist/chunk-5ITK5236.js +0 -1
- package/dist/chunk-5N4H3KMR.js +0 -1
- package/dist/chunk-5PFYIYM5.js +0 -1
- package/dist/chunk-CTIGUXXK.js +0 -1
- package/dist/chunk-D723OZEY.js +0 -1
- package/dist/chunk-FLZKBXHA.js +0 -1
- package/dist/chunk-HO4MFTVX.js +0 -1
- package/dist/chunk-JK3DUFRX.js +0 -1
- package/dist/chunk-N4J4CT6P.js +0 -1
- package/dist/chunk-NO6OLVTT.js +0 -1
- package/dist/chunk-TQN2VWQO.js +0 -1
- package/dist/chunk-UISTXRO5.js +0 -1
- package/dist/cs-OSBZYCSR.js +0 -1
- package/dist/cy-ZCOJW2WH.js +0 -1
- package/dist/da-2PDK6JTR.js +0 -1
- package/dist/de-R5LLVFUU.js +0 -1
- package/dist/el-ZPFVDCWA.js +0 -1
- package/dist/es-7YASJP32.js +0 -1
- package/dist/et-J4TV6KQL.js +0 -1
- package/dist/fa-4TEO7UGM.js +0 -1
- package/dist/fi-GIUDDKMH.js +0 -1
- package/dist/fr-J5J2XJLA.js +0 -1
- package/dist/he-OCEHSVUJ.js +0 -1
- package/dist/hi-EK5CTBW5.js +0 -1
- package/dist/hr-SLDTQOYC.js +0 -1
- package/dist/hu-2QNE77NO.js +0 -1
- package/dist/id-LGDAFQJK.js +0 -1
- package/dist/it-DT4Y3IYB.js +0 -1
- package/dist/ja-D5EY2XCQ.js +0 -1
- package/dist/ko-DD2NV45Q.js +0 -1
- package/dist/ku-KZCMVLBE.js +0 -1
- package/dist/localeLoaders-GGAKX22E.js +0 -1
- package/dist/lt-QWGTJ47Y.js +0 -1
- package/dist/lv-LYAIG3VK.js +0 -1
- package/dist/ms-XTF4KNGD.js +0 -1
- package/dist/nl-QEXY6XHS.js +0 -1
- package/dist/no-HCOXN2CN.js +0 -1
- package/dist/pl-BWY53TSD.js +0 -1
- package/dist/pt-2UJUBCPL.js +0 -1
- package/dist/ro-GGXOLTED.js +0 -1
- package/dist/ru-ZTFK3WCU.js +0 -1
- package/dist/sk-KU543Y2U.js +0 -1
- package/dist/sl-FT576R7A.js +0 -1
- package/dist/sr-WE3J46JE.js +0 -1
- package/dist/sv-YEAOPSEB.js +0 -1
- package/dist/th-BEBRDHJA.js +0 -1
- package/dist/tr-LOAHUPSH.js +0 -1
- package/dist/uk-2GMICSHN.js +0 -1
- package/dist/vi-TC5B6AUR.js +0 -1
- package/dist/zh-Hans-TSZWTZQY.js +0 -1
- package/dist/zh-Hant-TLB4FZYM.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as ht,e as V,i as vt,j as St,m as xt,n as Ct,o as $t}from"./chunk-B75VUM6L.js";import{c as rt,d as bt}from"./chunk-RF4QU72N.js";import{p as ae,r as It,s as wt,t as ke,x as Ae}from"./chunk-33SRM2CP.js";import{o as ot}from"./chunk-TFYAMLCK.js";import{A as je,E as pt,a as ft,c as gt,k as $e,l as yt,r as mt}from"./chunk-JRZHC75P.js";import{e as q,k as pe,l as be,n as Ke}from"./chunk-UEDS3HJ3.js";import{b as H,c as xe,e as st,g as Ce,i as at,k as ct,u as lt}from"./chunk-WH2EVBIG.js";import{$ as Xe,B as Ve,C as ve,N as oe,Na as nt,Pa as K,Q as Qe,Qa as it,R as He,Ta as ee,Ya as te,_a as se,aa as We,ab as G,b as he,e as Ue,ea as qe,fa as Ye,la as re,na as Ie,oa as Y,pa as Z,q as un,qa as J,r as fn,ra as we,s as gn,sa as Se,t as yn,ta as et,u as mn,v as pn,w as ze,wa as tt,x as bn,y as hn,z as Ge}from"./chunk-3W4ZMU4G.js";import{h as Ze,p as Je}from"./chunk-KTMZ3QAO.js";import{a as dt,i as ut,n as _}from"./chunk-JBOTRSMY.js";var Oe=[{key:"row-seats",label:"row seats",suffix:"rows",labelSuffix:"Rows",creationWord:"Seats",objectType:"row"},{key:"table-chairs",label:"table chairs",suffix:"tables",labelSuffix:"Tables",creationWord:"Tables",objectType:"table"},{key:"booth-units",label:"booth units",suffix:"booths",labelSuffix:"Booths",creationWord:"Booths",objectType:"booth"},{key:"ga-capacity",label:"GA capacity",suffix:"ga",labelSuffix:"GA",creationWord:"Standing",objectType:"gaArea"}];function jt(e){return e.floors?.length?e.floors:[{id:"floor-0",objects:e.objects}]}function vn(e){return Oe.find(n=>n.key===e)}function le(e){let n=new Map,o=Math.max(0,Math.floor(e.seatCount)),i=new Map((e.overrides??[]).filter(r=>Number.isInteger(r.index)&&r.index>=0&&r.index<e.seatCount).map(r=>[r.index,r])),s=(r,d=1)=>{r&&d>0&&n.set(r,(n.get(r)??0)+d)};s(e.categoryKey,o-i.size);for(let r of i.values())r.skip||s(r.categoryKey??e.categoryKey);return n}function In(e){return e.type==="row"||e.type==="table"?[...le(e).keys()]:e.type==="booth"?e.categoryKey?[e.categoryKey]:[]:e.type==="gaArea"?e.capacity>0&&e.categoryKey?[e.categoryKey]:[]:[]}function kt(e){return Oe.find(n=>n.objectType===e.type)??null}function At(e){return e.type==="row"||e.type==="table"||e.type==="booth"||e.type==="gaArea"}function ce(e){let n=new Map;for(let s of jt(e))for(let r of s.objects){if(!At(r))continue;let d=kt(r);for(let p of In(r)){let g=n.get(p)??new Map,l=g.get(d.key)??[];if(!l.some(c=>c.id===r.id)){let c=r.displayLabel||r.label||r.id;l.push({id:r.id,label:c,type:d.objectType,floorId:s.id})}g.set(d.key,l),n.set(p,g)}}let o=new Map(e.categories.map(s=>[s.key,s.label]));return[...e.categories.map(s=>s.key),...[...n.keys()].filter(s=>!o.has(s)).sort()].flatMap(s=>{let r=n.get(s);if(!r||r.size<2)return[];let d=Oe.flatMap(p=>{let g=r.get(p.key);return g?.length?[{family:p.key,label:p.label,objectType:p.objectType,targets:g}]:[]});return[{categoryKey:s,categoryLabel:o.get(s)??s,families:d,objectIds:[...new Set(d.flatMap(p=>p.targets.map(g=>g.id)))]}]})}function Ot(e){let n=e.families.map(o=>`${o.label} (${o.targets.map(i=>i.label).join(", ")})`).join(" and ");return`Category \u201C${e.categoryLabel}\u201D is used by more than one kind of inventory: ${n}. Each category can belong to only one kind. Use the safe split to separate them (prices, ticket tiers, accessibility, and provenance are preserved).`}function Tt(e){return e.normalize("NFKC").trim().toLocaleLowerCase("en")}function wn(e,n,o){for(let i=1;i<=1e4;i+=1){let s=i===1?`--${n}`:`--${n}-${i}`,d=`${e.slice(0,Math.max(1,160-s.length))}${s}`;if(!o.has(d))return o.add(d),d}throw new Error(`Unable to allocate a category key for ${e} (${n})`)}function Sn(e,n,o){for(let i=1;i<=1e4;i+=1){let s=i===1?` (${n})`:` (${n} ${i})`,d=`${e.normalize("NFKC").trim().slice(0,Math.max(1,80-s.length)).trimEnd()}${s}`,p=Tt(d);if(!o.has(p))return o.add(p),d}throw new Error(`Unable to allocate a category label for ${e} (${n})`)}function xn(e,n,o,i){let s=vn(n);return{...structuredClone(e),key:wn(e.key,s.suffix,o),label:Sn(e.label,s.labelSuffix,i)}}function Cn(e,n,o){let i=[];for(let s of jt(e))for(let r of s.objects){if(!At(r))continue;let d=kt(r),p=o.get(d.key);if(!(!p||p===n))if(r.type==="row"||r.type==="table"){let g=[];r.categoryKey===n&&(r.categoryKey=p);for(let l of r.overrides??[])l.categoryKey===n&&(l.categoryKey=p,g.push(l.index));(r.categoryKey===p||g.length)&&i.push({family:d.key,floorId:s.id,objectId:r.id,objectType:d.objectType,fromCategoryKey:n,toCategoryKey:p,...g.length?{seatOverrideIndices:g.sort((l,c)=>l-c)}:{}})}else r.categoryKey===n&&(r.categoryKey=p,i.push({family:d.key,floorId:s.id,objectId:r.id,objectType:d.objectType,fromCategoryKey:n,toCategoryKey:p}))}return i}function Et(e){let n=structuredClone(e),o=ce(n);if(!o.length)return{doc:n,changed:!1,changes:[],before:o,after:o};let i=new Set(n.categories.map(p=>p.key)),s=new Set(n.categories.map(p=>Tt(p.label))),r=[];for(let p of o){let g=n.categories.findIndex(w=>w.key===p.categoryKey);if(g<0)continue;let l=n.categories[g],c=p.families[0].family,y=new Map([[c,l.key]]),m=p.families.slice(1).map(w=>{let C=xn(l,w.family,i,s);return y.set(w.family,C.key),{family:w.family,key:C.key,label:C.label,category:C}});n.categories.splice(g+1,0,...m.map(w=>w.category));let b=Cn(n,l.key,y);r.push({categoryKey:l.key,categoryLabel:l.label,retainedFamily:c,clones:m.map(({family:w,key:C,label:v})=>({family:w,key:C,label:v})),reassignments:b})}n.floors?.length&&(n.objects=n.floors[0].objects);let d=ce(n);return{doc:n,changed:r.length>0,changes:r,before:o,after:d}}function Mt(e){return e.notForSale===!0?!0:e.tiers?.length?e.tiers.every(n=>Number.isFinite(n.price)&&n.price>=0):e.price!=null}function z(e){return e.length>=3&&e.every(n=>Number.isFinite(n.x)&&Number.isFinite(n.y))}function X(e,n,o){let i=(e.y-n.y)*(o.x-n.x)-(e.x-n.x)*(o.y-n.y);if(Math.abs(i)>1e-7)return!1;let s=(e.x-n.x)*(o.x-n.x)+(e.y-n.y)*(o.y-n.y);if(s<-1e-7)return!1;let r=(o.x-n.x)**2+(o.y-n.y)**2;return s<=r+1e-7}function W(e,n){let o=!1;for(let i=0,s=n.length-1;i<n.length;s=i++){let r=n[s],d=n[i];if(X(e,r,d))return!0;r.y>e.y!=d.y>e.y&&e.x<(d.x-r.x)*(e.y-r.y)/(d.y-r.y)+r.x&&(o=!o)}return o}function U(e,n,o){return(n.x-e.x)*(o.y-e.y)-(n.y-e.y)*(o.x-e.x)}function Rt(e,n,o,i){let s=U(e,n,o),r=U(e,n,i),d=U(o,i,e),p=U(o,i,n);return(s>1e-7&&r<-1e-7||s<-1e-7&&r>1e-7)&&(d>1e-7&&p<-1e-7||d<-1e-7&&p>1e-7)?!0:Math.abs(s)<=1e-7&&X(o,e,n)||Math.abs(r)<=1e-7&&X(i,e,n)||Math.abs(d)<=1e-7&&X(e,o,i)||Math.abs(p)<=1e-7&&X(n,o,i)}function Q(e){for(let n=0;n<e.length;n+=1){let o=(n+1)%e.length;for(let i=n+1;i<e.length;i+=1){let s=(i+1)%e.length;if(!(n===i||o===i||s===n)&&Rt(e[n],e[o],e[i],e[s]))return!0}}return!1}function ne(e,n){for(let o=0;o<e.length;o+=1)for(let i=0;i<n.length;i+=1)if(Rt(e[o],e[(o+1)%e.length],n[i],n[(i+1)%n.length]))return!0;return W(e[0],n)||W(n[0],e)}function Ft(e,n){return!n.some((o,i)=>X(e,o,n[(i+1)%n.length]))&&W(e,n)}function Lt(e){let n=e.outlinePath;if(!n?.segments.length)return;let o=r=>Number.isFinite(r.x)&&Number.isFinite(r.y),i=(r,d)=>Math.hypot(r.x-d.x,r.y-d.y);if(!o(n.start))return 0;let s=n.start;for(let r=0;r<n.segments.length;r++){let d=n.segments[r];if(!d||!o(d.end)||i(s,d.end)<=1e-9||d.kind==="bezier"&&(!o(d.control1)||!o(d.control2)))return r;if(d.kind==="arc"){if(!o(d.center)||!Number.isFinite(d.radius)||d.radius<=1e-6)return r;let p=Math.max(1e-4,d.radius*1e-4);if(Math.abs(i(s,d.center)-d.radius)>p||Math.abs(i(d.end,d.center)-d.radius)>p)return r}s=d.end}return i(s,n.start)>1e-4,n.segments.length-1}function $n(e,n,o,i){let s=U(e,n,o),r=U(e,n,i),d=U(o,i,e),p=U(o,i,n);return(s>1e-7&&r<-1e-7||s<-1e-7&&r>1e-7)&&(d>1e-7&&p<-1e-7||d<-1e-7&&p>1e-7)}function Nt(e,n){for(let o=0;o<e.length;o+=1)for(let i=0;i<n.length;i+=1)if($n(e[o],e[(o+1)%e.length],n[i],n[(i+1)%n.length]))return!0;return e.some(o=>Ft(o,n))||n.some(o=>Ft(o,e))}function Pt(e){return e.role!=="reference-focal"||!e.points||!z(e.points)?null:e.points}var Te=(e,n)=>typeof e=="string"&&e===e.normalize("NFKC").trim()&&e.length>=1&&e.length<=n,Ee=e=>e===void 0||typeof e=="boolean";function jn(e){let n=e.gate;if(!n||typeof n!="object")return"has an unreadable gate record";let o=n;return St.includes(o.use)?e.kind==="line"||e.kind==="polyline"?"must be a closed shape":e.role!==Ct(o.use)?"must be an entrance (in, both) or an exit (out)":Te(e.label,40)?o.opens!==void 0&&!Te(o.opens,40)?`must say when it opens in 1 to ${40} characters`:!Ee(o.stepFree)||!Ee(o.hideFromBuyers)?"has a step-free or buyer setting that is not on or off":null:`needs a name of 1 to ${40} characters`:"must be used for in, out or both"}function kn(e){let n=e.route;return!n||typeof n!="object"?"has an unreadable route record":e.kind!=="line"&&e.kind!=="polyline"?"must be a line or path":Te(e.label,40)?Ee(n.stepFree)?null:"has a step-free setting that is not on or off":`needs a name of 1 to ${40} characters`}function Me(e,n,o){let i=G(e).flatMap(r=>r.objects),s=new Set;for(let r of i)if(r.type==="shape"){if(r.gate!==void 0){s.add(r.id);let d=jn(r);d&&n.push({severity:"error",code:"invalid-gate",message:`Gate "${r.label??r.id}" ${d}`,objectId:r.id})}if(r.route!==void 0){let d=kn(r);d&&n.push({severity:"error",code:"invalid-route",message:`Route "${r.label??r.id}" ${d}`,objectId:r.id})}}for(let r of i){if(!xt(r)||r.entranceGateId===void 0)continue;let d=r.entranceGateId;typeof d!="string"||!d.trim()?n.push({severity:"error",code:"invalid-entrance-gate",message:`"${r.label}" has an empty entrance gate`,objectId:r.id}):s.has(d)||o.push({severity:"warning",code:"unknown-entrance-gate",message:`"${r.label}" enters by a gate that is no longer on the map`,objectId:r.id})}}function zt(e,n){if(e.displayLabel!==void 0){let o=e.displayLabel.normalize("NFKC").trim();!(e.type==="row"&&e.displayLabel==="")&&(!o||o!==e.displayLabel||o.length>80)&&n.push({severity:"error",code:"invalid-display-label",message:`${e.type==="gaArea"?"GA area":e.type} "${e.label}" must use a normalized buyer label of 1 to 80 characters`,objectId:e.id})}if(e.displayType!==void 0){let o=e.displayType.normalize("NFKC").trim();(!o||o!==e.displayType||o.length>24)&&n.push({severity:"error",code:"invalid-display-type",message:`${e.type==="gaArea"?"GA area":e.type} "${e.label}" must use a normalized buyer type of 1 to 24 characters`,objectId:e.id})}e.type!=="row"&&An(e,n)}var Kt=(e,n)=>typeof e=="string"&&e===e.normalize("NFKC").trim()&&e.length>=1&&e.length<=n;function An(e,n){let o=e.type==="gaArea"?"GA area":e.type==="table"?"Table":"Booth",i=(r,d)=>n.push({severity:"error",code:r,message:`${o} "${e.label}" ${d}`,objectId:e.id});e.entrance!==void 0&&!Kt(e.entrance,40)&&i("invalid-entrance","must use a normalized entrance of 1 to 40 characters");let s=e.labelPresentation;if(s!==void 0){let r=s?.labelStyle?.size,d=r!==void 0&&(!Number.isFinite(r)||r<pe||r>be);(!s||typeof s!="object"||s.visible!==void 0&&typeof s.visible!="boolean"||d)&&i("invalid-label-presentation",`has an invalid name-on-map setting (size ${pe}\u2013${be})`)}if(e.type==="table"){let r=Je(e.chairNumbering);r&&i("invalid-chair-numbering",`has invalid chair numbering: ${r}`)}e.type==="booth"&&(e.boothType!==void 0&&!Ke.includes(e.boothType)&&i("invalid-booth-type","must use inline, corner, peninsula or island as its booth type"),e.commercial!==void 0&&(!e.commercial||typeof e.commercial!="object"||Object.keys(e.commercial).some(r=>r!=="note")||e.commercial.note!==void 0&&!Kt(e.commercial.note,160))&&i("invalid-booth-note","must use a normalized buyer note of 1 to 160 characters"))}function Ut(e,n,o,i){let s=e.crop,r=s&&(!Number.isFinite(s.x)||!Number.isFinite(s.y)||!Number.isFinite(s.width)||!Number.isFinite(s.height)||s.x<0||s.y<0||s.width<=0||s.height<=0||s.x+s.width>1.000001||s.y+s.height>1.000001);(!Number.isFinite(e.center?.x)||!Number.isFinite(e.center?.y)||!Number.isFinite(e.width)||e.width<=0||!Number.isFinite(e.opacity)||e.opacity<0||e.opacity>1||e.rotation!==void 0&&!Number.isFinite(e.rotation)||r)&&o.push({severity:"error",code:"invalid-background-placement",message:`The ${n} image has an invalid position, size, opacity, rotation, or crop`,...i?{floorId:i}:{}})}function Fe(e,n,o,i){let s=e.referenceImage,r=e.backgroundImage;s&&(Ut(s,"reference",n,i),!s.assetId&&!s.url&&n.push({severity:"error",code:"invalid-reference-image",message:"A trace reference must identify a private asset or self-contained image",...i?{floorId:i}:{}})),r&&(Ut(r,r.assetId?"legacy reference":"buyer background",n,i),!r.assetId&&!r.url&&n.push({severity:"error",code:"invalid-buyer-background",message:"A buyer background must contain a renderable image URL",...i?{floorId:i}:{}}),r.assetId&&o.push({severity:"warning",code:"legacy-reference-background",message:"This legacy asset-backed background is trace-only and will migrate to the private reference layer when edited",...i?{floorId:i}:{}})),ot(e)&&n.push({severity:"error",code:"conflicting-reference-images",message:"The canonical reference and legacy asset-backed background identify different private sources",...i?{floorId:i}:{}})}function ie(e){let n=new Set(q.map(o=>o.key));return!e||/^ref_[0-9a-f-]{36}$/.test(e.assetId)&&!!e.logicalSectionId.trim()&&["user-confirmed","authoritative-source"].includes(e.evidence)&&!!e.sourceDescription.trim()&&(e.derivation===void 0||["explicit-inventory","server-synthesized-from-aggregate"].includes(e.derivation))&&(e.aggregateEvidence===void 0||["user-confirmed","authoritative-source"].includes(e.aggregateEvidence))&&(e.derivation!=="server-synthesized-from-aggregate"||e.evidence==="user-confirmed")&&(e.sectionAssignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(e.sectionAssignmentEvidence))&&e.sectionAssignmentEvidence===void 0==!e.sectionAssignmentSourceDescription?.trim()&&(e.sectionAssignmentSourceDescription?.trim().length??0)<=240&&(e.numberingEvidence===void 0||e.numberingEvidence==="user-confirmed")&&e.numberingEvidence===void 0==!e.numberingSourceDescription?.trim()&&(e.numberingSourceDescription?.trim().length??0)<=240&&(!e.accessibility||e.accessibility.placementDerivation==="server-synthesized-row-edges"&&e.accessibility.groupLogicalSectionIds.length>0&&e.accessibility.groupLogicalSectionIds.length<=100&&new Set(e.accessibility.groupLogicalSectionIds).size===e.accessibility.groupLogicalSectionIds.length&&e.accessibility.groupLogicalSectionIds.includes(e.logicalSectionId)&&e.accessibility.groupLogicalSectionIds.every(o=>!!o.trim()&&o.length<=160)&&["user-confirmed","authoritative-source"].includes(e.accessibility.assignmentEvidence)&&!!e.accessibility.assignmentSourceDescription.trim()&&e.accessibility.assignmentSourceDescription.trim().length<=240&&e.accessibility.counts.length>0&&e.accessibility.counts.length<=q.length&&new Set(e.accessibility.counts.map(o=>o.type)).size===e.accessibility.counts.length&&e.accessibility.counts.every(o=>n.has(o.type)&&Number.isInteger(o.count)&&o.count>0&&["user-confirmed","authoritative-source"].includes(o.evidence)&&!!o.sourceDescription.trim()&&o.sourceDescription.trim().length<=240))}function Gt(e){let n=e.referenceInventoryExclusion;return!n||typeof n.assetId=="string"&&/^ref_[0-9a-f-]{36}$/.test(n.assetId)&&n.assetId===e.referenceSource?.assetId&&typeof n.logicalSectionId=="string"&&n.logicalSectionId===(e.logicalSectionId??e.id)&&typeof n.reason=="string"&&!!n.reason.trim()&&n.reason.trim().length<=80&&["user-confirmed","authoritative-source"].includes(n.evidence)&&typeof n.sourceDescription=="string"&&!!n.sourceDescription.trim()&&n.sourceDescription.trim().length<=240}function Vt(e){let n=e.referenceCategorySource;return!n||/^ref_[0-9a-f-]{36}$/.test(n.assetId)&&/^#[0-9a-f]{6}$/i.test(n.sourceColor)&&(n.sourceColors===void 0||n.sourceColors.length>0&&n.sourceColors.includes(n.sourceColor)&&new Set(n.sourceColors).size===n.sourceColors.length&&n.sourceColors.every(o=>/^#[0-9a-f]{6}$/i.test(o)&&`${o[1]}${o[3]}${o[5]}`.toLowerCase()===`${n.sourceColor[1]}${n.sourceColor[3]}${n.sourceColor[5]}`.toLowerCase()))&&(n.logicalSectionIds===void 0||n.logicalSectionIds.length>0&&new Set(n.logicalSectionIds).size===n.logicalSectionIds.length&&n.logicalSectionIds.every(o=>!!o.trim()&&o.length<=160))&&(n.assignmentDerivation===void 0||["source-color-class","confirmed-logical-sections"].includes(n.assignmentDerivation))&&n.assignmentEvidence===void 0==!n.assignmentSourceDescription?.trim()&&(n.assignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(n.assignmentEvidence))&&(n.assignmentSourceDescription?.trim().length??0)<=240&&(n.assignmentDerivation!=="confirmed-logical-sections"||n.assignmentEvidence!==void 0&&!!n.assignmentSourceDescription?.trim())&&n.sourcePaletteColor===void 0==(n.sourcePaletteColorEvidence===void 0)&&n.sourcePaletteColorEvidence===void 0==!n.sourcePaletteColorSourceDescription?.trim()&&(n.sourcePaletteColor===void 0||/^#[0-9a-f]{6}$/i.test(n.sourcePaletteColor))&&(n.sourcePaletteColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(n.sourcePaletteColorEvidence))&&(n.sourcePaletteColorSourceDescription?.trim().length??0)<=240&&["user-confirmed","authoritative-source"].includes(n.labelEvidence)&&!!n.labelSourceDescription.trim()&&n.labelSourceDescription.trim().length<=240&&e.price!==void 0&&["user-confirmed","authoritative-source"].includes(n.priceEvidence)&&!!n.priceSourceDescription.trim()&&n.priceSourceDescription.trim().length<=240&&n.outputColorEvidence===void 0==!n.outputColorSourceDescription?.trim()&&(n.outputColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(n.outputColorEvidence))&&(n.outputColorSourceDescription?.trim().length??0)<=240&&(e.color.toLowerCase()===(n.sourcePaletteColor??n.sourceColor).toLowerCase()&&new Set((n.sourceColors??[n.sourceColor]).map(o=>`${o[1]}${o[3]}${o[5]}`.toLowerCase())).size===1||n.outputColorEvidence!==void 0&&["user-confirmed","authoritative-source"].includes(n.outputColorEvidence))}function Qt(e){let n=e.referenceDirectSeatImport;return!n||/^ref_[0-9a-f-]{36}$/.test(n.assetId)&&/^source-color:(?:#[0-9a-f]{6}(?:\+#[0-9a-f]{6})*|unclassified)$/i.test(n.familyId)}function Ht(e,n){let o=e.floors?.length?e.floors.map(r=>({id:r.id,objects:r.objects})):[{id:"floor-0",objects:e.objects}],i=new Map,s=new Map;for(let r of o){let d=r.objects.filter(l=>l.type==="row"),p=new Map,g=new Map;for(let l of d){if(l.segmentedRow){let c=p.get(l.segmentedRow.groupId)??[];c.push(l),p.set(l.segmentedRow.groupId,c)}if(l.rowBlockGeneration){let c=g.get(l.rowBlockGeneration.groupId)??[];c.push(l),g.set(l.rowBlockGeneration.groupId,c)}l.segmentedRow&&l.rowBlockGeneration&&n.push({severity:"error",code:"invalid-row-group-membership",message:`Row "${l.label}" cannot be both a segmented-row component and a generated row-block member`,objectId:l.id,floorId:r.id})}for(let[l,c]of p){let y=i.get(l);y&&y!==r.id&&n.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${l}" cannot span multiple floors`,objectId:c[0].id,floorId:r.id}),i.set(l,r.id);let m=c.slice().sort((j,A)=>j.segmentedRow.componentIndex-A.segmentedRow.componentIndex),b=m[0]?.segmentedRow,w=b?.componentCount??0,C=b?JSON.stringify({displayLabel:b.displayLabel,repeatLabelOnComponents:b.repeatLabelOnComponents,displayType:b.displayType,labelPresentation:b.labelPresentation,viewFromSeatUrl:b.viewFromSeatUrl,viewFromSeatMeta:b.viewFromSeatMeta,confidenceEvidence:b.confidenceEvidence,smoothing:b.smoothing}):"";b&&w>=2&&w<=64&&m.length===w&&b.boundaryBefore==="start"&&m.every((j,A)=>{let $=j.segmentedRow;return $.kind==="segmented-row-v1"&&$.groupId===l&&$.componentCount===w&&$.componentIndex===A&&(A===0?$.boundaryBefore==="start":$.boundaryBefore!=="start")&&$.displayLabel.normalize("NFKC").trim()===$.displayLabel&&$.displayLabel.length>0&&$.displayLabel.length<=80&&JSON.stringify({displayLabel:$.displayLabel,repeatLabelOnComponents:$.repeatLabelOnComponents,displayType:$.displayType,labelPresentation:$.labelPresentation,viewFromSeatUrl:$.viewFromSeatUrl,viewFromSeatMeta:$.viewFromSeatMeta,confidenceEvidence:$.confidenceEvidence,smoothing:$.smoothing})===C})||n.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${l}" has missing, duplicated, cyclic, or inconsistent component metadata`,objectId:c[0]?.id,floorId:r.id})}for(let[l,c]of g){let y=s.get(l);y&&y!==r.id&&n.push({severity:"error",code:"invalid-row-block-generation",message:"A generated row block cannot span multiple floors",objectId:c[0].id,floorId:r.id}),s.set(l,r.id)}}}function Xt(e,n){let o=(r,d)=>n.push({severity:"error",code:r,message:`GA area "${e.label}" ${d}`,objectId:e.id});e.bookAsWhole!==void 0&&typeof e.bookAsWhole!="boolean"&&o("invalid-ga-booking","has an invalid whole-area setting"),e.variableOccupancy!==void 0&&typeof e.variableOccupancy!="boolean"&&o("invalid-ga-booking","has an invalid party-size setting"),e.bookAsWhole===!0&&e.variableOccupancy===!0&&o("invalid-ga-booking","cannot be sold whole and by party size at the same time");let i=at(e);if(i&&e.inventorySegments!==void 0&&o("invalid-ga-booking","was joined from other areas and must be sold per person, not as one box"),i&&e.capacity>Ce&&o("invalid-ga-booking",`is sold to one party but holds ${e.capacity} guests; at most ${Ce} can book in one go`),i&&H(e.label)&&o("reserved-seat-label",`uses SeatLayer's reserved GA namespace for its box label "${e.label}"`),i==="variable"){let r=e.minOccupancy,d=e.maxOccupancy;(!Number.isInteger(r)||!Number.isInteger(d)||r<1||d<r||d>e.capacity)&&o("invalid-ga-occupancy",`needs whole-number fewest and most guests from 1 to its ${e.capacity}-person capacity`)}else(e.minOccupancy!==void 0||e.maxOccupancy!==void 0)&&o("invalid-ga-occupancy","has guest bounds without party-size selling");let s=e.wheelchairPlaces;s!==void 0&&(!Number.isInteger(s)||s<0||s>e.capacity)&&o("invalid-ga-wheelchair-places",`must have from 0 to ${e.capacity} wheelchair places`)}function Wt(e){return e==="m"||e==="ft"}function On(e){return e==="ft"?.3048:1}function de(e,n){return e/On(n)}var Tn=e=>Math.abs(e)<1e-9?0:e;function ue(e,n="m"){let o=Tn(de(e,n)),i=Math.abs(o);return n==="ft"?i<100?`${o.toFixed(1)} ft`:`${Math.round(o)} ft`:i<1?`${o.toFixed(2)} m`:i<100?`${o.toFixed(1)} m`:`${Math.round(o)} m`}var En=.5,Mn=5e3,Fn=e=>typeof e=="number"&&Number.isFinite(e),Rn=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function qt(e){let n=e?.designerSettings;return Rn(n)?n:null}function fe(e){let n=qt(e)?.units;return Wt(n)?n:"m"}function ge(e){let n=qt(e)?.unitsPerMetre;return Fn(n)&&n>=En&&n<=Mn?n:null}function Re(e,n){let o=n/(ge(e)??re),i=fe(e);return i==="ft"&&de(o,"ft")<.1?`${de(o,"ft").toFixed(2)} ft`:ue(o,i)}function Ln(e){return e.type==="row"||e.type==="table"||e.type==="booth"}function Nn(e){let n=[],o=new Map((e.overrides??[]).map(i=>[i.index,i]));for(let i=0;i<e.seatCount;i++){let s=o.get(i);s?.skip||n.push({label:Ze(e,i,s),index:i})}return n}function Yt(e){let n=[],o=new Map((e.overrides??[]).map(i=>[i.index,i]));for(let i=0;i<e.seatCount;i++){let s=o.get(i);s?.skip||n.push({label:s?.label??`${e.label}-${i+1}`,index:i})}return n}function Le(e){return Array.isArray(e)&&e.every(n=>!!n&&typeof n=="object")}function Ne(e){return Array.isArray(e)&&e.every(n=>Array.isArray(n)&&n.every(o=>!!o&&typeof o=="object"))}function Zt(e,n={}){let o=n.maxInventory??1e5,i=[];e.floorOverview!==void 0&&e.floorOverview!=="combined"&&e.floorOverview!=="separated"&&i.push({severity:"error",code:"invalid-floor-overview",message:"Whole venue view must be Combined plan or Separate levels"}),e.eventConfigurationId!==void 0&&(typeof e.eventConfigurationId!="string"||e.eventConfigurationId.normalize("NFKC").trim()!==e.eventConfigurationId||e.eventConfigurationId.length<1||e.eventConfigurationId.length>100)&&i.push({severity:"error",code:"invalid-event-configuration",message:"Active event configuration must contain 1 to 100 normalized characters"});let s=[],r=new Set(e.categories.map(t=>t.key)),d=new Set(q.map(t=>t.key)),p=new Map(e.categories.map(t=>[t.key,Mt(t)])),g=new Set;Fe(e,i,s),Me(e,i,s),e.theme?.sectionDetail!==void 0&&!["rows","seats"].includes(e.theme.sectionDetail)&&i.push({severity:"error",code:"invalid-section-detail",message:"Section detail must be rows or seats"}),e.theme?.logoUrl!==void 0&&!he(e.theme.logoUrl)&&i.push({severity:"error",code:"invalid-theme-logo-url",message:"The buyer-facing theme logo URL is invalid"});let l=he,c=(t,x,a,u={})=>{if(x===void 0)return;if(!x||typeof x!="object"||Array.isArray(x)){i.push({severity:"error",code:"invalid-seat-view-metadata",message:`${a} view metadata is invalid`,...u});return}let f=x;t||s.push({severity:"warning",code:"orphaned-seat-view-metadata",message:`${a} view metadata has no image`,...u});let I=new Set(["exact-seat","row-representative","section-representative","floor-representative","venue-representative"]);f.projection!==void 0&&f.projection!=="equirectangular"&&i.push({severity:"error",code:"invalid-seat-view-projection",message:`${a} view projection must be equirectangular`,...u}),f.coverage!==void 0&&!I.has(f.coverage)&&i.push({severity:"error",code:"invalid-seat-view-coverage",message:`${a} view coverage is invalid`,...u});let h=(S,k,O)=>typeof S=="number"&&Number.isFinite(S)&&S>=k&&S<=O;if(f.initialBearingDeg!==void 0&&!h(f.initialBearingDeg,-360,360)&&i.push({severity:"error",code:"invalid-seat-view-bearing",message:`${a} view bearing must be between -360\xB0 and 360\xB0`,...u}),f.initialPitchDeg!==void 0&&!h(f.initialPitchDeg,-90,90)&&i.push({severity:"error",code:"invalid-seat-view-pitch",message:`${a} view pitch must be between -90\xB0 and 90\xB0`,...u}),f.capturedAt!==void 0&&(typeof f.capturedAt!="string"||f.capturedAt.length>40||!Number.isFinite(Date.parse(f.capturedAt)))&&i.push({severity:"error",code:"invalid-seat-view-capture-date",message:`${a} view capture date is invalid`,...u}),f.sourceLabel!==void 0&&(typeof f.sourceLabel!="string"||f.sourceLabel.trim().length>100)&&i.push({severity:"error",code:"invalid-seat-view-source",message:`${a} view source label is invalid`,...u}),f.previewUrl!==void 0&&!l(f.previewUrl)&&i.push({severity:"error",code:"invalid-seat-view-preview-url",message:`${a} view preview URL is invalid`,...u}),f.variants!==void 0){let S=Array.isArray(f.variants)?f.variants:[];if(!Array.isArray(f.variants)||S.length<1||S.length>4)i.push({severity:"error",code:"invalid-seat-view-variants",message:`${a} view variants must contain between 1 and 4 tiers`,...u});else{let k=new Set;for(let O of S){if(!O||typeof O!="object"||!l(O.url)||!Number.isInteger(O.width)||O.width<1||O.width>12e3||!Number.isInteger(O.height)||O.height<1||O.height>12e3||O.width!==O.height*2||typeof O.sha256!="string"||!/^[a-f0-9]{64}$/.test(O.sha256)||k.has(O.width)){i.push({severity:"error",code:"invalid-seat-view-variant",message:`${a} view variant is not a unique immutable 2:1 equirectangular tier`,...u});break}k.add(O.width)}}}for(let[S,k]of[["width",f.sourceWidth],["height",f.sourceHeight],["preview width",f.previewWidth],["preview height",f.previewHeight]])k!==void 0&&(!Number.isInteger(k)||k<1||k>32768)&&i.push({severity:"error",code:"invalid-seat-view-dimensions",message:`${a} view source ${S} is invalid`,...u});f.captureEyeHeightM!==void 0&&!h(f.captureEyeHeightM,.5,3)&&i.push({severity:"error",code:"invalid-seat-view-eye-height",message:`${a} capture eye height must be between 0.5 m and 3 m`,...u}),f.eventConfigurationId!==void 0&&(typeof f.eventConfigurationId!="string"||!f.eventConfigurationId.trim()||f.eventConfigurationId.length>100)&&i.push({severity:"error",code:"invalid-seat-view-configuration",message:`${a} event configuration id is invalid`,...u}),f.eventConfigurationVersion!==void 0&&(!Number.isInteger(f.eventConfigurationVersion)||f.eventConfigurationVersion<1)&&i.push({severity:"error",code:"invalid-seat-view-configuration-version",message:`${a} event configuration version is invalid`,...u}),f.eventConfigurationVersion!==void 0&&!f.eventConfigurationId&&i.push({severity:"error",code:"invalid-seat-view-configuration-pin",message:`${a} event configuration version requires an id`,...u})},y=(t,x,a={})=>{if(t===void 0)return;let u=k=>{i.push({severity:"error",code:"invalid-seat-confidence-evidence",message:`${x} confidence evidence ${k}`,...a})};if(!t||typeof t!="object"||Array.isArray(t)){u("is invalid");return}let f=t;f.schema!=="seatlayer.seat-confidence/1"&&u("has an unsupported schema");let I=(k,O)=>typeof k=="string"&&k.normalize("NFKC").trim()===k&&k.length>0&&k.length<=O;I(f.evidenceId,120)||u("has an invalid evidence id"),I(f.modelVersion,120)||u("has an invalid model version"),new Set(["synthetic-model","organizer-approved","calibrated-provider"]).has(f.evidenceKind)||u("has an invalid evidence kind"),new Set(["generated","geometry-verified","configuration-verified"]).has(f.modelLevel)||u("has an invalid model level");let h=f.realityLevel??"none";new Set(["none","comparable-build-reference","actual-build-checked"]).has(h)||u("has an invalid reality level"),f.eventConfigurationId!==void 0&&!I(f.eventConfigurationId,100)&&u("has an invalid event configuration id"),f.eventConfigurationVersion!==void 0&&(!Number.isInteger(f.eventConfigurationVersion)||f.eventConfigurationVersion<1)&&u("has an invalid event configuration version"),f.status!==void 0&&!new Set(["draft","approved","retracted"]).has(f.status)&&u("has an invalid publication status"),f.basisSha256!==void 0&&!/^[a-f0-9]{64}$/.test(f.basisSha256)&&u("has an invalid venue basis SHA-256"),f.basisSha256!==void 0&&f.status!=="approved"&&u("can carry a venue basis SHA-256 only after approval");for(let[k,O]of[["assessment",f.assessedAt],["expiry",f.validUntil]])O!==void 0&&(!I(O,40)||!Number.isFinite(Date.parse(O)))&&u(`has an invalid ${k} date`);f.approvedByRole!==void 0&&!I(f.approvedByRole,100)&&u("has an invalid approving organization or role"),f.sourceLabel!==void 0&&!I(f.sourceLabel,120)&&u("has an invalid source label"),f.limitations!==void 0&&(!Array.isArray(f.limitations)||f.limitations.length>6||f.limitations.some(k=>!I(k,160)))&&u("has invalid limitations"),f.evidenceKind==="synthetic-model"&&(f.modelLevel!=="generated"||h!=="none")&&u("cannot describe synthetic data as verified or reality checked"),f.modelLevel!=="generated"&&(!f.assessedAt||!f.approvedByRole)&&u("requires an assessment date and approving organization or role for verified model levels"),f.modelLevel==="configuration-verified"&&!f.eventConfigurationId&&u("requires an event configuration id for configuration verification"),h!=="none"&&(!f.assessedAt||!f.sourceLabel)&&u("requires an assessment date and source for reality evidence"),h==="actual-build-checked"&&(f.modelLevel!=="configuration-verified"||!f.eventConfigurationId)&&u("requires a configuration-verified model and event configuration for an actual-build check");let S=f.modeledTarget;S!==void 0&&(!S||typeof S!="object"||Array.isArray(S)?u("has an invalid modeled target"):((!I(S.label,80)||!I(S.methodLabel,100))&&u("has invalid modeled-target labels"),(!Number.isInteger(S.totalRayCount)||S.totalRayCount<1||S.totalRayCount>1e3||!Number.isInteger(S.clearRayCount)||S.clearRayCount<0||S.clearRayCount>S.totalRayCount)&&u("has invalid modeled-target ray counts"),new Set(["clear","partial","obstructed"]).has(S.classification)||u("has an invalid modeled-target classification"),S.occluderLabels!==void 0&&(!Array.isArray(S.occluderLabels)||S.occluderLabels.length>10||S.occluderLabels.some(k=>!I(k,100)))&&u("has invalid modeled-target occluders")))};c(e.viewFromSeatUrl,e.viewFromSeatMeta,"Venue"),y(e.confidenceEvidence,"Venue"),e.viewFromSeatUrl!==void 0&&!l(e.viewFromSeatUrl)&&i.push({severity:"error",code:"invalid-venue-view-url",message:"The whole-venue view-from-seat image URL is invalid"});for(let t of e.floors??[])t.viewFromSeatUrl!==void 0&&!l(t.viewFromSeatUrl)&&i.push({severity:"error",code:"invalid-floor-view-url",message:`Floor "${t.name}" has an invalid view-from-seat image URL`}),c(t.viewFromSeatUrl,t.viewFromSeatMeta,`Floor "${t.name}"`,{floorId:t.id}),y(t.confidenceEvidence,`Floor "${t.name}"`,{floorId:t.id});let m=e.floors?.length?e.floors.flatMap(t=>t.objects):e.objects;for(let t of m)if((t.type==="row"||t.type==="section")&&(t.viewFromSeatUrl!==void 0&&!l(t.viewFromSeatUrl)&&i.push({severity:"error",code:t.type==="row"?"invalid-row-view-url":"invalid-section-view-url",message:`${t.type==="row"?"Row":"Section"} "${t.label}" has an invalid view-from-seat image URL`,objectId:t.id}),c(t.viewFromSeatUrl,t.viewFromSeatMeta,`${t.type==="row"?"Row":"Section"} "${t.label}"`,{objectId:t.id}),y(t.confidenceEvidence,`${t.type==="row"?"Row":"Section"} "${t.label}"`,{objectId:t.id})),t.type==="row"&&t.segmentedRow&&(t.segmentedRow.viewFromSeatUrl!==void 0&&!l(t.segmentedRow.viewFromSeatUrl)&&i.push({severity:"error",code:"invalid-segmented-row-view-url",message:`Segmented row "${t.segmentedRow.displayLabel}" has an invalid view-from-seat image URL`,objectId:t.id}),c(t.segmentedRow.viewFromSeatUrl,t.segmentedRow.viewFromSeatMeta,`Segmented row "${t.segmentedRow.displayLabel}"`,{objectId:t.id}),y(t.segmentedRow.confidenceEvidence,`Segmented row "${t.segmentedRow.displayLabel}"`,{objectId:t.id})),t.type==="row"||t.type==="table")for(let x of t.overrides??[])x.viewFromSeatUrl!==void 0&&!l(x.viewFromSeatUrl)&&i.push({severity:"error",code:"invalid-seat-view-url",message:`Seat ${x.index+1} has an invalid view-from-seat image URL`,objectId:t.id,seatIndices:[x.index]}),c(x.viewFromSeatUrl,x.viewFromSeatMeta,`Seat ${x.index+1}`,{objectId:t.id,seatIndices:[x.index]}),y(x.confidenceEvidence,`Seat ${x.index+1}`,{objectId:t.id,seatIndices:[x.index]});let b=new Set;for(let t of e.categories){b.has(t.key)&&i.push({severity:"error",code:"duplicate-category-key",message:`Category key "${t.key}" is used more than once`,categoryKey:t.key}),b.add(t.key);let x=new Set;for(let a of t.tiers??[]){if(x.has(a.id)&&i.push({severity:"error",code:"duplicate-category-tier-id",message:`Ticket tier id "${a.id}" is used more than once in category "${t.key}"`,categoryKey:t.key}),a.restriction!=null&&!["companion","child","senior","student","membership","custom"].includes(a.restriction)&&i.push({severity:"error",code:"invalid-category-tier-restriction",message:`Ticket tier "${a.name}" has an unknown restriction`,categoryKey:t.key}),a.buyerMessage!=null&&(!a.buyerMessage.trim()||a.buyerMessage.length>240)&&i.push({severity:"error",code:"invalid-category-tier-buyer-message",message:`Ticket tier "${a.name}" buyer guidance must contain 1 to 240 characters`,categoryKey:t.key}),a.currency!=null&&!/^[A-Z]{3}$/.test(a.currency)&&i.push({severity:"error",code:"invalid-category-tier-currency",message:`Ticket tier "${a.name}" must use a three-letter ISO currency`,categoryKey:t.key}),a.applicability!=null){let u=a.applicability.seatLabels,f=a.applicability.accessibility;(u!==void 0&&(!Array.isArray(u)||!u.length||u.length>1e4||u.some(I=>typeof I!="string"||!I.trim()||I.length>160)||new Set(u).size!==u.length)||f!==void 0&&(!Array.isArray(f)||!f.length||f.some(I=>!d.has(I))||new Set(f).size!==f.length))&&i.push({severity:"error",code:"invalid-category-tier-applicability",message:`Ticket tier "${a.name}" has invalid seat applicability`,categoryKey:t.key})}a.evidence!=null&&(!["public-host","public-event","user-confirmed"].includes(a.evidence.provenance)||!a.evidence.sourceDescription.trim()||a.evidence.sourceDescription.length>240||a.evidence.capturedAt!==void 0&&(a.evidence.capturedAt.length>40||!Number.isFinite(Date.parse(a.evidence.capturedAt))))&&i.push({severity:"error",code:"invalid-category-tier-evidence",message:`Ticket tier "${a.name}" has invalid evidence provenance`,categoryKey:t.key}),x.add(a.id)}Vt(t)||i.push({severity:"error",code:"invalid-reference-category-source",message:`Category ${t.label||t.key} has incomplete or invalid reference evidence`,categoryKey:t.key}),Qt(t)||i.push({severity:"error",code:"invalid-reference-direct-seat-import",message:`Category ${t.label||t.key} has invalid direct-seat import provenance`,categoryKey:t.key})}let w=new Map,C=new Map,v=[],j=new Map,A=0,$=0,R=new Set;for(let t of e.floors??[])Fe(t,i,s,t.id),R.has(t.id)&&i.push({severity:"error",code:"duplicate-floor-id",message:`Floor id "${t.id}" is used more than once`,floorId:t.id}),R.add(t.id),t.baseHeightM!==void 0&&(!Number.isFinite(t.baseHeightM)||t.baseHeightM<Z||t.baseHeightM>J)&&i.push({severity:"error",code:"invalid-floor-base-height",message:`Floor "${t.name}" base height must be between ${Z} and ${J} metres`,floorId:t.id});let N=e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects;Ht(e,i);let E=new Set;for(let t of N)E.has(t.id)&&i.push({severity:"error",code:"duplicate-object-id",message:`Object id "${t.id}" is used more than once`,objectId:t.id}),E.add(t.id);let P=new Set;for(let t of e.zones??[])P.has(t.id)&&i.push({severity:"error",code:"duplicate-zone-id",message:`Zone id "${t.id}" is used more than once`}),P.add(t.id),t.focalPoint!==void 0&&(!Number.isFinite(t.focalPoint.x)||!Number.isFinite(t.focalPoint.y))&&i.push({severity:"error",code:"invalid-zone-focal-point",message:`Zone "${t.label}" must use a finite focal point`});let L=new Map;for(let t of N)if(!(t.type!=="section"||!t.zone)){if(e.zones?.length&&!P.has(t.zone)){i.push({severity:"error",code:"unknown-section-zone",message:`Section "${t.displayLabel??t.label}" references unknown zone "${t.zone}"`,objectId:t.id});continue}L.has(t.zone)||L.set(t.zone,t)}for(let[t,x]of L){let a=e.zones?.find(u=>u.id===t);a&&(a?.focalPoint||s.push({severity:"warning",code:"missing-zone-focal-point",message:`Zone "${a?.label??t}" uses the legacy floor focal; set its own focal point before publishing`,objectId:x.id}))}for(let t of N)if((t.type==="row"||t.type==="table"||t.type==="booth"||t.type==="gaArea")&&zt(t,i),Ln(t)){if(A++,$+=t.type==="booth"?1:t.type==="row"?nt(t):t.bookAsWhole||t.variableOccupancy?t.seatCount:Yt(t).length,w.get(t.label)!==void 0?t.type!=="row"&&i.push({severity:"error",code:"duplicate-object-label",message:`Label "${t.label}" is used by more than one object`,objectId:t.id}):w.set(t.label,t.id),r.has(t.categoryKey)?g.add(t.categoryKey):i.push({severity:"error",code:"unknown-category",message:`"${t.label}" references unknown category "${t.categoryKey}"`,objectId:t.id,categoryKey:t.categoryKey}),t.type==="row"){ie(t.referenceInventorySource)||i.push({severity:"error",code:"invalid-reference-inventory-source",message:`Row "${t.label}" has invalid reference-inventory provenance`,objectId:t.id}),t.seatCount<1&&i.push({severity:"error",code:"empty-row",message:`Row "${t.label}" has no seats`,objectId:t.id}),t.aisleSeats!==void 0&&!bt(t.aisleSeats)&&i.push({severity:"error",code:"invalid-row-aisle-seats",message:`Row "${t.label}" must mark its aisle seats at the start, end, both or none`,objectId:t.id});let a=new Set;for(let u of t.overrides??[]){(u.accessibility??[]).filter(S=>!d.has(S)).length&&i.push({severity:"error",code:"invalid-accessibility-type",message:`Row "${t.label}" seat ${u.index+1} uses an unknown accessibility type`,objectId:t.id,seatIndices:[u.index]}),(!Number.isInteger(u.index)||u.index<0||u.index>=t.seatCount||a.has(u.index))&&i.push({severity:"error",code:"invalid-seat-override",message:`Row "${t.label}" has a duplicated or out-of-range seat override`,objectId:t.id,...Number.isInteger(u.index)?{seatIndices:[u.index]}:{}}),a.add(u.index);let I=u.wheelchairSpaceType,h=u.accessible===!0||u.accessibility?.includes("wheelchair");I!==void 0&&I!=="seat-present"&&I!=="no-seat"?i.push({severity:"error",code:"invalid-wheelchair-space",message:`Row "${t.label}" seat ${u.index+1} has an invalid wheelchair-space type`,objectId:t.id,seatIndices:[u.index]}):I&&(!h||u.skip)&&i.push({severity:"error",code:"invalid-wheelchair-space",message:u.skip?`Row "${t.label}" seat ${u.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Row "${t.label}" seat ${u.index+1} must include wheelchair accessibility for its physical-space type`,objectId:t.id,seatIndices:[u.index]})}for(let u of Nn(t))H(u.label)&&i.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${u.label}" uses SeatLayer's reserved GA namespace`,objectId:t.id,seatIndices:[u.index]}),C.get(u.label)!==void 0?v.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${u.label}" is used more than once`,objectId:t.id,seatIndices:[u.index]}):C.set(u.label,t.id)}else if(t.type==="table"){let a=t.bookAsWhole===!0||t.variableOccupancy===!0;if(t.fill!==void 0&&!dt(t.fill)&&i.push({severity:"error",code:"invalid-table-fill",message:`Table "${t.label}" has an invalid surface color`,objectId:t.id}),t.automaticRadius!==void 0&&typeof t.automaticRadius!="boolean"?i.push({severity:"error",code:"invalid-table-automatic-radius",message:`Table "${t.label}" has an invalid automatic-radius setting`,objectId:t.id}):t.automaticRadius===!0&&(t.shape!=="round"||t.radius!==rt(t.seatCount,t.seatArc))&&i.push({severity:"error",code:"invalid-table-automatic-radius",message:`Table "${t.label}" needs a radius that matches its automatic chair spacing`,objectId:t.id}),t.seatCountsBySide){let h=["top","bottom","left","right"],S=Object.keys(t.seatCountsBySide),k=h.every(B=>Number.isInteger(t.seatCountsBySide[B])&&t.seatCountsBySide[B]>=0&&t.seatCountsBySide[B]<=40),O=k?h.reduce((B,dn)=>B+t.seatCountsBySide[dn],0):Number.NaN;(t.shape!=="rect"||S.length!==h.length||S.some(B=>!h.includes(B))||!k||O!==t.seatCount||O<1||O>40)&&i.push({severity:"error",code:"invalid-table-side-counts",message:`Table "${t.label}" needs top, bottom, left, and right whole-number chair counts totaling its ${t.seatCount}-chair capacity`,objectId:t.id})}a&&t.overrides?.length&&i.push({severity:"error",code:"grouped-table-chair-overrides",message:`Grouped table "${t.label}" cannot carry individual-chair overrides`,objectId:t.id,seatIndices:t.overrides.map(h=>h.index)});let u=new Set;for(let h of t.overrides??[]){(h.accessibility??[]).filter(B=>!d.has(B)).length&&i.push({severity:"error",code:"invalid-accessibility-type",message:`Table "${t.label}" chair ${h.index+1} uses an unknown accessibility type`,objectId:t.id,seatIndices:[h.index]}),(!Number.isInteger(h.index)||h.index<0||h.index>=t.seatCount||u.has(h.index))&&i.push({severity:"error",code:"invalid-seat-override",message:`Table "${t.label}" has a duplicated or out-of-range chair override`,objectId:t.id,...Number.isInteger(h.index)?{seatIndices:[h.index]}:{}}),u.add(h.index),h.categoryKey&&!r.has(h.categoryKey)?i.push({severity:"error",code:"unknown-category",message:`Table "${t.label}" chair ${h.index+1} references unknown category "${h.categoryKey}"`,objectId:t.id,seatIndices:[h.index],categoryKey:h.categoryKey}):h.categoryKey&&g.add(h.categoryKey);let k=h.wheelchairSpaceType,O=h.accessible===!0||h.accessibility?.includes("wheelchair");k!==void 0&&k!=="seat-present"&&k!=="no-seat"?i.push({severity:"error",code:"invalid-wheelchair-space",message:`Table "${t.label}" chair ${h.index+1} has an invalid wheelchair-space type`,objectId:t.id,seatIndices:[h.index]}):k&&(!O||h.skip)&&i.push({severity:"error",code:"invalid-wheelchair-space",message:h.skip?`Table "${t.label}" chair ${h.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Table "${t.label}" chair ${h.index+1} must include wheelchair accessibility for its physical-space type`,objectId:t.id,seatIndices:[h.index]})}t.bookAsWhole&&t.variableOccupancy?i.push({severity:"error",code:"invalid-table-booking-mode",message:`Table "${t.label}" cannot be sold both as a whole table and with variable occupancy`,objectId:t.id}):t.variableOccupancy?(!Number.isInteger(t.minOccupancy)||!Number.isInteger(t.maxOccupancy)||t.minOccupancy<1||t.maxOccupancy<t.minOccupancy||t.maxOccupancy>t.seatCount)&&i.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${t.label}" needs whole-number minimum and maximum guests from 1 to its ${t.seatCount}-chair capacity`,objectId:t.id}):(t.minOccupancy!=null||t.maxOccupancy!=null)&&i.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${t.label}" has guest bounds without variable-occupancy selling`,objectId:t.id}),ie(t.referenceInventorySource)||i.push({severity:"error",code:"invalid-reference-inventory-source",message:`Table "${t.label}" has invalid reference-inventory provenance`,objectId:t.id}),(t.shape==="round"&&t.radius==null||t.shape==="rect"&&(t.width==null||t.height==null)||t.seatCount<1)&&i.push({severity:"error",code:"bad-table",message:`Table "${t.label}" is missing required dimensions or seats`,objectId:t.id});let I=a?[{label:t.label,index:void 0}]:Yt(t);for(let h of I)H(h.label)&&i.push({severity:"error",code:"reserved-seat-label",message:`Inventory label "${h.label}" uses SeatLayer's reserved GA namespace`,objectId:t.id}),C.get(h.label)!==void 0?v.push({severity:"error",code:"duplicate-seat-label",message:`Inventory label "${h.label}" is used more than once; grouped table labels must be unique`,objectId:t.id,...h.index===void 0?{}:{seatIndices:[h.index]}}):C.set(h.label,t.id)}else if(t.type==="booth"){ie(t.referenceInventorySource)||i.push({severity:"error",code:"invalid-reference-inventory-source",message:`Booth "${t.label}" has invalid reference-inventory provenance`,objectId:t.id});let a=t.label;H(a)&&i.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${a}" uses SeatLayer's reserved GA namespace`,objectId:t.id}),C.get(a)!==void 0?v.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${a}" is used more than once`,objectId:t.id}):C.set(a,t.id)}}else if(t.type==="gaArea"){if(Xt(t,i),!st(t))i.push({severity:"error",code:"invalid-ga-inventory-segments",message:`GA area "${t.label}" has invalid joined-area inventory provenance`,objectId:t.id});else for(let u of ct(t))C.get(u)!==void 0?v.push({severity:"error",code:"duplicate-seat-label",message:`GA inventory label "${u}" is used more than once`,objectId:t.id}):C.set(u,t.id);if(ie(t.referenceInventorySource)||i.push({severity:"error",code:"invalid-reference-inventory-source",message:`GA area "${t.label}" has invalid reference-inventory provenance`,objectId:t.id}),!Le(t.points)){i.push({severity:"error",code:"invalid-polygon-points",message:`GA area "${t.label}" outline must be a list of points`,objectId:t.id});continue}(!z(t.points)||Math.abs(V(t.points))<=1e-7||Q(t.points))&&i.push({severity:"error",code:"invalid-ga-outline",message:`GA area "${t.label}" must have a finite, non-self-intersecting polygon outline`,objectId:t.id});let a=t.holes??[];if(!Ne(a))i.push({severity:"error",code:"invalid-hole-collection",message:`GA area "${t.label}" cutouts must be a list of point lists`,objectId:t.id});else{let u=a.length<=64?a.findIndex(f=>f.length>512||!z(f)||Math.abs(V(f))<=1e-7||Q(f)?!0:!f.flatMap((h,S)=>{let k=f[(S+1)%f.length];return[h,{x:(h.x+k.x)/2,y:(h.y+k.y)/2}]}).every(h=>W(h,t.points))):0;if(u>=0)i.push({severity:"error",code:"invalid-ga-hole",message:`GA area "${t.label}" has a cutout outside its outline or with invalid geometry`,objectId:t.id,holeIndex:u});else if(a.some((f,I)=>a.slice(I+1).some(h=>ne(f,h)))){let f=a.findIndex((I,h)=>a.slice(h+1).some(S=>ne(I,S)));i.push({severity:"error",code:"overlapping-ga-holes",message:`GA area "${t.label}" has overlapping cutout polygons`,objectId:t.id,holeIndex:f})}}r.has(t.categoryKey)?g.add(t.categoryKey):i.push({severity:"error",code:"unknown-category",message:`"${t.label}" references unknown category "${t.categoryKey}"`,objectId:t.id,categoryKey:t.categoryKey}),t.capacity<1&&i.push({severity:"error",code:"empty-ga",message:`GA area "${t.label}" has zero capacity`,objectId:t.id}),(!Number.isInteger(t.capacity)||t.capacity>xe)&&i.push({severity:"error",code:"invalid-ga-capacity",message:`GA area "${t.label}" capacity must be a whole number from 1 to ${xe}`,objectId:t.id}),A++,$+=Math.max(0,Math.floor(t.capacity))}else if(t.type==="section"){if(t.displayLabel!==void 0){let u=t.displayLabel.normalize("NFKC").trim();u?(u!==t.displayLabel||u.length>80)&&i.push({severity:"error",code:"invalid-display-label",message:`Section "${t.label}" must use a normalized buyer label of 1 to 80 characters`,objectId:t.id}):i.push({severity:"error",code:"unnamed-section",message:`${t.label} has no buyer name`,objectId:t.id})}if(t.editor?.defaultCategoryKey&&!r.has(t.editor.defaultCategoryKey)&&i.push({severity:"error",code:"unknown-category",message:`Section "${t.label}" references unknown future-seat category "${t.editor.defaultCategoryKey}"`,objectId:t.id}),t.elevation!==void 0&&(!Number.isInteger(t.elevation)||t.elevation<Ie||t.elevation>Y)){let u=Number.isInteger(t.elevation)&&t.elevation>Y&&t.elevation<=et;s.push({severity:"warning",code:u?"legacy-section-elevation":"invalid-section-elevation",message:u?`Section "${t.label}" uses legacy tier ${t.elevation}; set an exact height before normalizing it to tier ${Y}`:`Section "${t.label}" elevation must be a whole-number tier from ${Ie} to ${Y}`,objectId:t.id})}if(t.height!==void 0&&(!Number.isFinite(t.height)||t.height<Z||t.height>J)&&i.push({severity:"error",code:"invalid-section-height",message:`Section "${t.label}" exact height must be between ${Z} and ${J} metres`,objectId:t.id}),t.rake!==void 0&&(!Number.isFinite(t.rake)||t.rake<we||t.rake>Se)&&i.push({severity:"error",code:"invalid-section-rake",message:`Section "${t.label}" rake must be between ${we}\xB0 and ${Se}\xB0`,objectId:t.id}),t.surfaceKind!==void 0&&t.surfaceKind!=="flat"&&t.surfaceKind!=="rakedRows"&&i.push({severity:"error",code:"invalid-section-surface-kind",message:`Section "${t.label}" surfaceKind must be 'flat' or 'rakedRows'`,objectId:t.id}),!Le(t.outline)){i.push({severity:"error",code:"invalid-polygon-points",message:`Section "${t.label}" outline must be a list of points`,objectId:t.id});continue}if(!z(t.outline)||Math.abs(V(t.outline))<=1e-7||Q(t.outline)){i.push({severity:"error",code:"invalid-section-outline",message:`Section "${t.label}" must have a finite, non-self-intersecting polygon outline`,objectId:t.id});continue}if(t.outlinePath){let u=[];try{u=He(t.outlinePath)}catch{}(!Qe(t.outlinePath)||!u.length||Math.hypot(t.outlinePath.start.x-t.outline[0].x,t.outlinePath.start.y-t.outline[0].y)>1e-4||!z(u)||Math.abs(V(u))<=1e-7||Q(u))&&i.push({severity:"error",code:"invalid-section-outline-path",message:`Section "${t.label}" has an invalid or inconsistent curved outline path`,objectId:t.id,edgeIndex:Lt(t)})}if(t.referenceSource&&(!/^ref_[0-9a-f-]{36}$/.test(t.referenceSource.assetId)||!/^(?:reg|ai)_[0-9a-f]{16}$/.test(t.referenceSource.regionId))&&i.push({severity:"error",code:"invalid-section-reference-source",message:`Section "${t.label}" has invalid opaque reference provenance`,objectId:t.id}),Gt(t)||i.push({severity:"error",code:"invalid-section-inventory-exclusion",message:`Section "${t.label}" has incomplete or mismatched non-sellable evidence`,objectId:t.id}),t.logicalSectionId!==void 0&&!t.logicalSectionId.trim())i.push({severity:"error",code:"invalid-logical-section-id",message:`Section "${t.label}" has an empty logical section id`,objectId:t.id});else if(t.logicalSectionId){let u=JSON.stringify({displayLabel:t.displayLabel??null,entrance:t.entrance??null,viewFromSeatUrl:t.viewFromSeatUrl??null,viewFromSeatMeta:t.viewFromSeatMeta??null,confidenceEvidence:t.confidenceEvidence??null,zone:t.zone??null,labelStyle:t.labelPresentation?.labelStyle??null,labelVisible:t.labelPresentation?.visible!==!1}),f=j.get(t.logicalSectionId);f&&(f.label!==t.label||f.semanticSignature!==u)?i.push({severity:"error",code:"inconsistent-logical-section",message:`Logical section "${t.logicalSectionId}" must use one technical label and buyer-facing presentation across every component`,objectId:t.id}):f||j.set(t.logicalSectionId,{label:t.label,semanticSignature:u})}let x=t.holes??[];if(!Ne(x)){i.push({severity:"error",code:"invalid-hole-collection",message:`Section "${t.label}" openings must be a list of point lists`,objectId:t.id});continue}if(x.length>64){i.push({severity:"error",code:"invalid-section-hole",message:`Section "${t.label}" has an invalid opening collection`,objectId:t.id});continue}let a=-1;for(let u=0;u<x.length;u++){let f=x[u];if(f.length>512||!z(f)||Math.abs(V(f))<=1e-7||Q(f)){a=u;break}if(!f.flatMap((h,S)=>{let k=f[(S+1)%f.length];return[h,{x:(h.x+k.x)/2,y:(h.y+k.y)/2}]}).every(h=>W(h,t.outline))){a=u;break}}if(a>=0)i.push({severity:"error",code:"invalid-section-hole",message:`Section "${t.label}" has an opening outside its outline or with an invalid shape`,objectId:t.id,holeIndex:a});else if(x.some((u,f)=>x.slice(f+1).some(I=>ne(u,I)))){let u=x.findIndex((f,I)=>x.slice(I+1).some(h=>ne(f,h)));i.push({severity:"error",code:"overlapping-section-holes",message:`Section "${t.label}" has overlapping openings`,objectId:t.id,holeIndex:u})}}let D=e.floors?.length?e.floors.map(t=>t.objects):[e.objects];for(let t of D){let x=t.filter(a=>a.type==="section");for(let a of t.filter(u=>u.type==="text")){let u=a.iconKey;u!==void 0&&!ae(u)&&i.push({severity:"error",code:"invalid-icon-key",message:`Venue icon "${a.text||a.id}" references an unknown symbol`,objectId:a.id});let f=a.fontFamily;f!==void 0&&(typeof f!="string"||f.normalize("NFKC").trim()!==f||f.length<1||f.length>120)&&i.push({severity:"error",code:"invalid-text-font-family",message:`Text "${a.text||a.id}" font family must contain 1 to 120 normalized characters`,objectId:a.id});let I=a.background;(a.width!==void 0&&(!Number.isFinite(a.width)||a.width<40||a.width>1200)||a.align!==void 0&&!["left","center","right"].includes(a.align)||a.lineHeight!==void 0&&(!Number.isFinite(a.lineHeight)||a.lineHeight<.8||a.lineHeight>3)||a.letterSpacing!==void 0&&(!Number.isFinite(a.letterSpacing)||a.letterSpacing<-2||a.letterSpacing>20)||a.opacity!==void 0&&(!Number.isFinite(a.opacity)||a.opacity<.1||a.opacity>1)||I!==void 0&&(!/^#[0-9a-f]{6}$/i.test(I.color)||I.padding!==void 0&&(!Number.isFinite(I.padding)||I.padding<0||I.padding>40)||I.cornerRadius!==void 0&&(!Number.isFinite(I.cornerRadius)||I.cornerRadius<0||I.cornerRadius>40)||I.opacity!==void 0&&(!Number.isFinite(I.opacity)||I.opacity<.1||I.opacity>1)))&&i.push({severity:"error",code:"invalid-text-layout",message:`Text "${a.text||a.id}" has invalid width, spacing, opacity, alignment, or background layout`,objectId:a.id})}for(let a of t.filter(u=>u.type==="shape")){if(a.eventConfigurationIds!==void 0){let I=a.eventConfigurationIds;Array.isArray(I)&&I.length>0&&I.length<=20&&I.every(S=>typeof S=="string"&&S.normalize("NFKC").trim()===S&&S.length>=1&&S.length<=100)&&new Set(I).size===I.length||i.push({severity:"error",code:"invalid-shape-configurations",message:`Shape "${a.label||a.id}" must reference 1 to 20 unique event configuration ids`,objectId:a.id})}if(a.heightM!==void 0&&(!Number.isFinite(a.heightM)||a.heightM<.05||a.heightM>50)&&i.push({severity:"error",code:"invalid-shape-height",message:`Shape "${a.label||a.id}" height must be between 0.05 m and 50 m`,objectId:a.id}),a.stroke!==void 0&&(!a.stroke||typeof a.stroke.color!="string"||!/^#[0-9a-f]{6}$/i.test(a.stroke.color)||!Number.isFinite(a.stroke.width)||a.stroke.width<.5||a.stroke.width>40)&&i.push({severity:"error",code:"invalid-shape-stroke",objectId:a.id,message:`Shape "${a.label||a.id}" stroke must use a six-digit colour and a width from ${Re(e,.5)} to ${Re(e,40)}`}),(a.lineCap!==void 0||a.lineJoin!==void 0||a.startEnding!==void 0||a.endEnding!==void 0)&&!Ae(a.kind)?i.push({severity:"error",code:"invalid-shape-line-style-applicability",message:`Shape "${a.label||a.id}" may use line caps, joins, and end decorations only when it is an open line or polyline`,objectId:a.id}):Ae(a.kind)&&(a.lineCap!==void 0&&!It.includes(a.lineCap)||a.lineJoin!==void 0&&!wt.includes(a.lineJoin)||a.startEnding!==void 0&&!ke.includes(a.startEnding)||a.endEnding!==void 0&&!ke.includes(a.endEnding))&&i.push({severity:"error",code:"invalid-shape-line-style",message:`Shape "${a.label||a.id}" has an unsupported line cap, join, or ending`,objectId:a.id}),a.points!==void 0&&!Le(a.points)){i.push({severity:"error",code:"invalid-polygon-points",message:`Shape "${a.label||a.id}" points must be a list of points`,objectId:a.id});continue}if(a.kind==="polygon"){let I=Xe(a.points??[]);if(!I.ok)i.push({severity:"error",code:"invalid-shape-polygon",message:`Shape "${a.label||a.id}" has invalid polygon geometry: ${I.message}`,objectId:a.id});else{let h=Pn(a);h&&i.push({severity:"error",code:"invalid-shape-outline",message:`Shape "${a.label||a.id}" ${h}`,objectId:a.id})}}else(a.edgeCurvature!==void 0||a.holes!==void 0)&&i.push({severity:"error",code:"invalid-shape-outline",message:`Shape "${a.label||a.id}" has curved sides or cut-outs, which only a custom outline can have`,objectId:a.id});let f=Pt(a);if(f){for(let I of x)if(Nt(f,I.outline)){i.push({severity:"error",code:"reference-focal-overlaps-section",message:`Reference focal area "${a.label??a.id}" overlaps section "${I.label}"`,objectId:a.id});break}}}}$>o&&i.push({severity:"error",code:"inventory-capacity-exceeded",message:`Chart has ${$} bookable units; the maximum is ${o}`}),i.push(...v.slice(0,5)),v.length>5&&i.push({severity:"error",code:"duplicate-seat-label",message:`${v.length} seats share a label with another seat; the first 5 are listed above. Seat labels must be unique across the whole chart.`});for(let t of ce(e)){let x=t.families[0]?.targets[0];s.push({severity:"warning",code:"category-inventory-family-conflict",message:Ot(t),categoryKey:t.categoryKey,...x?{objectId:x.id,floorId:x.floorId}:{},relatedObjectIds:t.objectIds,categoryInventoryFamilies:t.families})}e.focalPoint||s.push({severity:"warning",code:"missing-focal-point",message:"Chart has no focal point set"}),A===0&&s.push({severity:"warning",code:"no-bookables",message:"Chart has no rows, tables, booths, or GA areas"});for(let t of g)if(p.get(t)===!1){let x=e.categories.find(a=>a.key===t);s.push({severity:"warning",code:"unpriced-category",message:`Category "${x?.label??t}" is used but has no price`,categoryKey:t})}return[...i,...s]}function Pn(e){let n=e.points??[];if(e.edgeCurvature!==void 0&&(!Array.isArray(e.edgeCurvature)||e.edgeCurvature.length!==n.length||e.edgeCurvature.some(o=>typeof o!="number"||!Number.isFinite(o)||o<-100||o>100)))return"needs one side curve from -100 to 100 for each side";if(e.holes===void 0)return null;if(!Ne(e.holes)||e.holes.length>We)return"has an invalid cut-out collection";for(let o=0;o<e.holes.length;o+=1){let i=e.holes[o];if(i.length<3||i.length>512||!z(i)||Math.abs(V(i))<=1e-7||Q(i))return`has an invalid cut-out ${o+1}`;if(!qe(e,i))return`has cut-out ${o+1} outside its outline`;for(let s=0;s<o;s+=1){let r=e.holes[s];if(Ye(i,r))return`has cut-outs ${s+1} and ${o+1} overlapping`}}return null}var Jt=e=>!!("entrance"in e&&e.entrance?.trim()||"entranceGateId"in e&&e.entranceGateId);function _n(e){return e.type==="row"||e.type==="table"?e.seatCount:e.type==="booth"?1:e.type==="gaArea"?e.capacity??0:0}function Dn(e){let n=$t(e).size,o=[];if(!n)return{gates:n,gaps:o,missingAreas:0,missingPlaces:0};let i=lt(e);for(let s of G(e)){let r=new Map;for(let g of s.objects){if(g.type!=="section")continue;let l=g.logicalSectionId??g.id;r.set(l,[...r.get(l)??[],g])}let d={floorId:s.id,selectIds:[],names:[],places:0},p=new Set;for(let g of s.objects){if(g.type!=="row"&&g.type!=="table"&&g.type!=="booth"&&g.type!=="gaArea"||Jt(g))continue;let l=i.get(g.id),c=l?r.get(l):void 0;if(!c?.some(Jt))if(d.places+=_n(g),c){if(p.has(l))continue;p.add(l),d.selectIds.push(...c.map(y=>y.id)),d.names.push(c[0].displayLabel??c[0].label)}else d.selectIds.push(g.id),d.names.push(g.label||g.id)}d.names.length&&o.push(d)}return{gates:n,gaps:o,missingAreas:o.reduce((s,r)=>s+r.names.length,0),missingPlaces:o.reduce((s,r)=>s+r.places,0)}}function Bn(e){let n=e.slice(0,3).map(i=>`\u201C${i}\u201D`),o=e.length-n.length;return o>0?`${n.join(", ")} and ${o} more`:n.join(n.length===2?" and ":", ")}function en(e,n){for(let o of Dn(e).gaps){let i=o.names.length;n.push({severity:"warning",code:"entrance-missing",dimension:"navigation",source:"quality",title:`${i} ${i===1?"area has":"areas have"} no entrance`,message:`Buyers in ${Bn(o.names)} are not told which gate to use.`,action:"Select them, then choose a gate for them in the Gate panel, or use Pick on the map there.",objectId:o.selectIds[0],relatedObjectIds:o.selectIds,floorId:o.floorId,autoFixable:!1})}}var Kn=9,sn="#f7f8fb",Un="#f5f6f8",an="#8b93a7",zn="#0b1220",Gn="#0b1220",Vn="#ffffff",Qn=100,De=e=>e.semanticKind==="icon"&&ae(e.iconKey);function T(e,n=2){let o=10**n;return Math.round(e*o)/o}function M(e){return{source:"quality",...e}}function Hn(e){return e.code==="missing-focal-point"||e.code==="missing-zone-focal-point"?"navigation":"structure"}function Be(e){return Kn*vt(e.theme?.seatScale)}function cn(e){let n=[];for(let o of e.objects)o.type==="row"?n.push(...K(o)):o.type==="table"&&n.push(...ee(o));return n}function Xn(e){let n={rowSeats:0,tableSeats:0,booths:0,gaCapacity:0};for(let o of e)for(let i of o.objects)i.type==="row"?n.rowSeats+=K(i).length:i.type==="table"?n.tableSeats+=ee(i).length:i.type==="booth"?n.booths+=1:i.type==="gaArea"&&(n.gaCapacity+=Math.max(0,Math.floor(i.capacity)));return{inventoryByKind:n,bookableUnits:n.rowSeats+n.tableSeats+n.booths+n.gaCapacity}}function F(e,n){e.filter(o=>o.code===n.code).length<Qn&&e.push(n)}function Wn(e,n,o){let i=Be(e),s=2*i,r=2.3*i,d=0,p=0,g=1/0;for(let l of n){let c=new Map(l.objects.filter(v=>v.type==="row").map(v=>[v.id,v])),y=v=>{let j=l.objects.find(E=>E.id===v);if(!j||j.type!=="row"&&j.type!=="table")return"another seating object";let A=j.type==="row"?K(j):ee(j),$=A.length?{x:A.reduce((E,P)=>E+P.x,0)/A.length,y:A.reduce((E,P)=>E+P.y,0)/A.length}:j.type==="row"?j.origin:j.center,R=l.objects.find(E=>E.type==="section"&&te($,E.outline,E.holes)),N=j.type==="row"?`Row \u201C${j.label}\u201D`:`Table \u201C${j.label}\u201D`;return R?.type==="section"?`${N} in \u201C${R.label}\u201D`:N},m=cn(l);d+=m.length;let b=r,w=new Map,C=new Map;for(let v of m){let j=Math.floor(v.x/b),A=Math.floor(v.y/b);for(let N=-1;N<=1;N++)for(let E=-1;E<=1;E++){let P=w.get(`${j+N}:${A+E}`)??[];for(let L of P){p++;let D=Math.hypot(v.x-L.x,v.y-L.y);if(g=Math.min(g,D),D>=r)continue;let x=(v.rowId<L.rowId?[v.rowId,L.rowId]:[L.rowId,v.rowId]).join("|"),a=C.get(x);(!a||D<a.distance)&&C.set(x,{a:v,b:L,distance:D})}}let $=`${j}:${A}`,R=w.get($)??[];R.push(v),w.set($,R)}for(let v of C.values()){let j=v.a.rowId===v.b.rowId,A=c.get(v.a.rowId),$=c.get(v.b.rowId),R=!j&&A?.segmentedRow?.repeatLabelOnComponents===!0&&$?.segmentedRow?.repeatLabelOnComponents===!0&&A.segmentedRow.groupId===$.segmentedRow.groupId,N=!!A?.referenceScan&&!!$?.referenceScan&&A.referenceScan.assetId===$.referenceScan.assetId&&A.referenceScan.sectionId===$.referenceScan.sectionId,E=v.distance<s;if((R||N)&&!E)continue;let P=E?"seat-overlap":"seat-cramped",L=y(v.a.rowId),D=y(v.b.rowId),t=T(E?s:r);F(o,M({severity:"warning",code:P,dimension:"geometry",title:E?j?`${L} has overlapping seats`:`${L} and ${D} overlap`:j?`${L} has seats too close together`:`${L} and ${D} are too close together`,message:E?`The closest seats are ${ye(e,v.distance)} apart, so their markers overlap on the buyer map; at least ${ye(e,t)} keeps them apart.`:`The closest seats are ${ye(e,v.distance)} apart; at least ${ye(e,t)} is needed.`,action:j?`Increase the seat spacing for ${L}, or use Review safe fixes.`:`Move ${L} or ${D} until they no longer overlap.`,objectId:v.a.rowId,relatedObjectIds:j?[v.a.rowId]:[v.a.rowId,v.b.rowId],floorId:l.id,measured:T(v.distance),minimum:t,autoFixable:j}))}}return{seats:d,checkedSeatPairs:p,minimumSeatDistance:Number.isFinite(g)?T(g):null}}function me(e){let{width:n,height:o}=De(e)?{width:e.fontSize,height:e.fontSize}:Ge(e);if(!e.rotation)return{x:e.position.x,y:e.position.y,width:n,height:o};let i=[{x:0,y:0},{x:n,y:0},{x:n,y:o},{x:0,y:o}].map(s=>{let r=Ve(s,e.rotation);return{x:e.position.x+r.x,y:e.position.y+r.y}});return ht(i)}function ln(e,n,o=0){return e.x<n.x+n.width+o&&e.x+e.width+o>n.x&&e.y<n.y+n.height+o&&e.y+e.height+o>n.y}function _e(e,n,o){let i=oe(n.x,e.x,e.x+e.width),s=oe(n.y,e.y,e.y+e.height);return(n.x-i)**2+(n.y-s)**2<o**2}function qn(e,n,o){let i=Be(e),s=0;for(let r of n){let d=r.objects.filter(g=>g.type==="text"),p=cn(r);s+=d.length;for(let g=0;g<d.length;g++){let l=d[g],c=me(l),y=p.find(m=>_e(c,m,i));y&&F(o,M({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${l.text}\u201D overlaps seat ${y.label}`,objectId:l.id,relatedObjectIds:[l.id,y.rowId],floorId:r.id,autoFixable:!0}));for(let m=0;m<g;m++){let b=d[m];ln(c,me(b),2)&&F(o,M({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${l.text}\u201D overlaps text \u201C${b.text}\u201D`,objectId:l.id,relatedObjectIds:[l.id,b.id],floorId:r.id,autoFixable:!0}))}}}return s}function Yn(e,n){let o=!e.categoryKey.trim();if(e.type==="booth")return{places:o?1:0};if(e.type==="gaArea")return{places:o?Math.max(1,Math.floor(e.capacity)):0};if(e.type==="table"&&(e.bookAsWhole||e.variableOccupancy))return{places:o?e.seatCount:0};let i=new Map((e.overrides??[]).map(d=>[d.index,d])),s=[],r=0;for(let d=0;d<e.seatCount;d+=1){let p=i.get(d);if(p?.skip)continue;r+=1;let g=p?.categoryKey;(g===void 0?o:!g.trim()||!n.has(g))&&s.push(d)}return s.length?s.length===r?{places:r}:{places:s.length,seatIndices:s}:{places:0}}function Pe(e){return e.normalize("NFKC").trim().toLowerCase().replace(/\s+/g," ")}function Zn(e,n,o){let i=new Map,s=new Set(e.categories.map(g=>g.key));for(let g of n)for(let l of g.objects){let c=l.type,y=c==="row"||c==="table"||c==="booth"||c==="gaArea",m=y||c==="section",b=y?Yn(l,s):null;if(y&&b&&b.places>0){let C=`${c==="gaArea"?"GA area":c==="row"?"Row":c==="table"?"Table":"Booth"} \u201C${l.label||l.id}\u201D`,v=c==="gaArea"?"place":c==="table"?"chair":c==="booth"?"booth":"seat",j=`${b.places} ${v}${b.places===1?"":"s"}`;F(o,M({severity:"warning",code:"object-uncategorized",dimension:"structure",title:b.seatIndices?`${C} has ${j} with no category`:`${C} has no category`,message:b.seatIndices?`${j} in ${C} have no category, so buyers see no price or colour for them.`:`${C} is not assigned to any category (${j}), so buyers see no price or colour for it.`,action:"Select it and pick a category on the Categories bar, or create one there first.",objectId:l.id,floorId:g.id,autoFixable:!1,...b.seatIndices?{seatIndices:b.seatIndices}:{}}))}if(m){let w=(l.type==="section"?l.displayLabel??l.label:l.label)??"";if(w.trim()){if(c==="table"||c==="booth"||c==="gaArea"){let C=Pe(w),v=i.get(C);v&&v.raw!==w?F(o,M({severity:"warning",code:"duplicate-object-label-normalized",dimension:"labels",title:`\u201C${w}\u201D and \u201C${v.raw}\u201D read as the same label`,message:`Labels \u201C${w}\u201D and \u201C${v.raw}\u201D differ only by case, spacing, or accents, so buyers cannot tell them apart.`,action:"Make the two labels visibly distinct.",objectId:l.id,relatedObjectIds:[l.id,v.id],floorId:g.id,autoFixable:!1})):v||i.set(C,{id:l.id,raw:w})}}else{let C=c==="gaArea"?"A GA area":c==="section"?"A section":c==="row"?"A row":c==="table"?"A table":"A booth";F(o,M({severity:"warning",code:"object-unlabeled",dimension:"labels",title:`${C} has no label`,message:`${C} has an empty label; buyers rely on labels to identify what they are booking.`,action:"Give this object a short, unique label in the inspector.",objectId:l.id,floorId:g.id,autoFixable:!1}))}}}let r=[];for(let g of n){let l=g.objects.filter(c=>c.type==="row"||c.type==="table"||c.type==="booth"||c.type==="gaArea");for(let c of g.objects)if(!(c.type!=="section"||c.referenceInventoryExclusion||l.some(m=>te(se(m),c.outline,c.holes)))){if(c.referenceSource){r.push({id:c.id,floorId:g.id});continue}F(o,M({severity:"warning",code:"empty-section",dimension:"structure",title:`Section \u201C${c.displayLabel??c.label}\u201D is empty`,message:`Section \u201C${c.displayLabel??c.label}\u201D contains no rows, tables, booths, or GA areas.`,action:"Add seating inside this section (Fill with rows), or remove the empty section.",objectId:c.id,floorId:g.id,autoFixable:!1}))}}r.length&&F(o,M({severity:"warning",code:"empty-section",dimension:"structure",title:r.length===1?"1 traced section has no seating yet":`${r.length} traced sections have no seating yet`,message:`${r.length} section${r.length===1?"":"s"} traced from the reference image contain${r.length===1?"s":""} no rows, tables, booths, or GA areas.`,action:"Fill them with rows, or remove the ones the venue does not sell.",objectId:r[0].id,relatedObjectIds:r.map(g=>g.id),floorId:r[0].floorId,autoFixable:!1}));let d=new Map,p=new Map;for(let g of n){let l=[];for(let c of g.objects)c.type!=="section"||c.outline.length<3||l.push({id:c.logicalSectionId??c.id,outline:c.outline,...c.holes?{holes:c.holes}:{},bounds:ii(c.outline)});for(let c of g.objects){if(c.type!=="row")continue;let y=(c.segmentedRow?.displayLabel??c.displayLabel??c.label??"").trim(),m=(c.displayType??"").trim(),b=y&&m&&Pe(m)!=="row"?`${m} ${y}`:y,w="";if(l.length){let A=se(c),$=l.find(R=>A.x>=R.bounds.minX&&A.x<=R.bounds.maxX&&A.y>=R.bounds.minY&&A.y<=R.bounds.maxY&&te(A,R.outline,R.holes));$&&(w=$.id)}let C=`${g.id}\0${w}\0${Pe(b)}`,v=c.segmentedRow?.groupId??c.id;if(!b){let A=`${g.id}\0${w}`,$=p.get(A);$?($.ids.push(c.id),$.logical.set(v,[...$.logical.get(v)??[],c])):p.set(A,{ids:[c.id],logical:new Map([[v,[c]]]),floorId:g.id});continue}let j=d.get(C);j?(j.ids.push(c.id),j.logical.set(v,[...j.logical.get(v)??[],c])):d.set(C,{ids:[c.id],logical:new Map([[v,[c]]]),floorId:g.id,raw:b})}}for(let{ids:g,logical:l,floorId:c,raw:y}of d.values()){let m=l.size;m<2||tn([...l.values()])&&F(o,M({severity:"warning",code:"duplicate-row-label",dimension:"labels",title:`${m} rows share the name \u201C${y}\u201D`,message:`${m} rows share the label \u201C${y}\u201D, so buyers cannot tell which row a seat belongs to.`,action:"Rename them so each row reads differently: for example the section or box each belongs to.",objectId:g[0],relatedObjectIds:g,floorId:c,autoFixable:!1}))}for(let{ids:g,logical:l,floorId:c}of p.values()){let y=l.size;y<2||tn([...l.values()])&&F(o,M({severity:"warning",code:"unnamed-row-collision",dimension:"labels",title:`${y} rows have no name`,message:`${y} rows in the same area have no name and repeat each other\u2019s seat numbers, so buyers cannot tell which row a seat belongs to.`,action:"Give each of these rows a name, for example the box each belongs to, so a ticket can say which row a seat is in.",objectId:g[0],relatedObjectIds:g,floorId:c,autoFixable:!1}))}if(e.floors&&e.floors.length>1)for(let g of e.floors)g.objects.length===0&&F(o,M({severity:"warning",code:"unused-floor",dimension:"structure",title:`${rn(g.name)} is empty`,message:`${rn(g.name)} has nothing on it yet.`,action:"Add seating to this floor, copy the floor below, or remove it in Structure.",floorId:g.id,autoFixable:!1}))}var Jn=5,ei=16;function ti(e,n,o){for(let i of n){let s=i.focalPoint??e.focalPoint;if(s)for(let r of i.objects){if(r.type!=="section"||r.outline.length<3)continue;let{rake:d}=tt(r);if(d<Jn)continue;let p=r.outline.map(m=>Math.hypot(m.x-s.x,m.y-s.y)),g=Math.max(...p);if(g<=0)continue;let l=(g-Math.min(...p))/g;if(d*l<=ei)continue;let y=r.displayLabel??r.label;F(o,M({severity:"warning",code:"section-rake-inconsistent",dimension:"geometry",title:`Section \u201C${y}\u201D is too deep for a single rake`,message:`Section \u201C${y}\u201D spans ${Math.round(l*100)}% of its distance to the stage at a ${Math.round(d)}\xB0 rake, so one rake can't represent its sightlines faithfully: a real tier this deep changes slope at a cross-aisle.`,action:"Split this section at the cross-aisle into two sections, each with its own rake.",objectId:r.id,floorId:i.id,autoFixable:!1}))}}}function ni(e,n,o){let i=e.theme?.background??sn,s=Un,r=new Map;for(let l of n)for(let c of l.objects){if(c.type!=="gaArea")continue;let y=r.get(c.categoryKey)??[];y.push({id:c.id,floorId:l.id}),r.set(c.categoryKey,y)}for(let l of e.categories){let c=_(l.color,i),y=_(l.color,s);if(c==null||y==null){F(o,M({severity:"error",code:"invalid-category-color",dimension:"contrast",message:`Category \u201C${l.label}\u201D does not use a supported hex color`,categoryKey:l.key}));continue}let m=Math.min(c,y);m<3&&F(o,M({severity:"warning",code:"category-contrast-low",dimension:"contrast",title:`Category \u201C${l.label}\u201D is hard to see`,message:`Its colour is too close to light or dark chart backgrounds (${T(m)}:1, needs 3:1). Pick a stronger colour.`,action:`Choose a lighter or darker color for \u201C${l.label}\u201D until this warning clears.`,categoryKey:l.key,measured:T(m),minimum:3,autoFixable:!1}));let b=r.get(l.key)??[];if(b.length){let w=je(l.color,i,$e),C=je(l.color,s,$e),v=Math.min(_(w,i)??0,_(C,s)??0);v<3&&F(o,M({severity:"warning",code:"ga-contrast-low",dimension:"contrast",title:`Standing areas in \u201C${l.label}\u201D are hard to see`,message:`Their pale fill is too close to the chart background (${T(v)}:1, needs 3:1). Pick a stronger colour for \u201C${l.label}\u201D.`,objectId:b[0].id,categoryKey:l.key,floorId:b[0].floorId,relatedObjectIds:b.map(j=>j.id),measured:T(v),minimum:3,autoFixable:!1}))}}for(let l=0;l<e.categories.length;l++)for(let c=0;c<l;c++){let y=e.categories[l],m=e.categories[c],b=ut(y.color,m.color);b!=null&&b<25&&F(o,M({severity:"warning",code:"category-colors-too-similar",dimension:"contrast",title:`\u201C${y.label}\u201D and \u201C${m.label}\u201D look too similar`,message:`Categories \u201C${y.label}\u201D and \u201C${m.label}\u201D are only \u0394E ${T(b)} apart; 25 is required`,action:"Pick a visibly different color for either category so buyers can tell them apart.",categoryKey:y.key,measured:T(b),minimum:25,autoFixable:!1}))}for(let l of n){let c=l.objects.filter(y=>y.type==="text");for(let y of c){if(De(y))continue;let m=y.color??e.theme?.textColor??an,b=_(m,i),w=y.fontSize>=18?3:4.5;(b==null||b<w)&&F(o,M({severity:"warning",code:"text-contrast-low",dimension:"contrast",message:`Text \u201C${y.text}\u201D has ${T(b??0)}:1 contrast against the chart background; ${w}:1 is required`,objectId:y.id,floorId:l.id,measured:T(b??0),minimum:w,autoFixable:!0}))}}if(e.theme?.selectionColor){let l=_(e.theme.selectionColor,i);(l==null||l<3)&&F(o,M({severity:"warning",code:"selection-contrast-low",dimension:"contrast",title:"The selection color is hard to see",message:`Selection rings have ${T(l??0)}:1 contrast against the chart background; 3:1 is required.`,action:"In Theme, choose a Selection color that stands out clearly from the Background color.",measured:T(l??0),minimum:3,autoFixable:!1}))}if(e.theme?.textColor){let l=_(e.theme.textColor,i);(l==null||l<3)&&F(o,M({severity:"warning",code:"theme-text-contrast-low",dimension:"contrast",title:"The theme text color is hard to read",message:`Theme text has ${T(l??0)}:1 contrast against the chart background; 3:1 is required.`,action:"In Theme, choose a Text color with stronger contrast against the Background color.",measured:T(l??0),minimum:3,autoFixable:!1}))}let d=e.theme?.seatLabelColor??zn,p=new Map,g=(l,c,y)=>{let m=p.get(l)??new Map,b=m.get(c)??[];b.push(y),m.set(c,b),p.set(l,m)};for(let l of n)for(let c of l.objects)if(c.type==="row")for(let y of le(c).keys())g(y,"seat",c.id);else if(c.type==="table")for(let y of le(c).keys())g(y,"table seat",c.id);else c.type==="booth"&&g(c.categoryKey,"booth",c.id);for(let l of e.categories){let c=p.get(l.key);if(c)for(let[y,m]of c){let b=y==="booth"?gt:ft,w=mt(yt,600),C=pt(l.color,d),v=_(C,l.color);(v==null||v<w)&&F(o,M({severity:"warning",code:"bookable-label-contrast-low",dimension:"contrast",message:`${y==="booth"?"Booth":y==="seat"?"Seat":"Table-seat"} labels use ${b}u type and have ${T(v??0)}:1 contrast on category \u201C${l.label}\u201D; ${w}:1 is required for small text`,objectId:m[0],relatedObjectIds:m,measured:T(v??0),minimum:w,autoFixable:!0}))}}}function tn(e){if(e.length>24)return!0;let n=new Set;for(let o of e){let i=new Set;for(let s of o)for(let r of K(s)){let d=r.label,p=d.lastIndexOf("-");i.add(p>=0?d.slice(p+1):d)}if(!i.size)return!0;for(let s of i)if(n.has(s))return!0;for(let s of i)n.add(s)}return!1}function ii(e){let n=1/0,o=1/0,i=-1/0,s=-1/0;for(let r of e)r.x<n&&(n=r.x),r.y<o&&(o=r.y),r.x>i&&(i=r.x),r.y>s&&(s=r.y);return{minX:n,minY:o,maxX:i,maxY:s}}function oi(e,n){for(let o of e){let i=o.objects.filter(s=>s.type==="section");if(!(i.length<2))for(let s of o.objects){if(!(s.type==="row"||s.type==="table"||s.type==="booth"||s.type==="gaArea"))continue;let d=se(s),p=i.filter(b=>te(d,b.outline,b.holes)),g=new Map;for(let b of p){let w=b.logicalSectionId??b.id,C=g.get(w)??[];C.push(b),g.set(w,C)}if(g.size<2)continue;let l=[...g.values()],c=l.map(b=>`Section \u201C${b[0].displayLabel??b[0].label}\u201D`),y=c.length===2?c.join(" and "):`${c.slice(0,-1).join(", ")}, and ${c[c.length-1]}`,m=s.type==="gaArea"?"GA area":s.type==="row"?"Row":s.type==="table"?"Table":"Booth";F(n,M({severity:"warning",code:"ambiguous-section-ownership",dimension:"structure",title:`${m} \u201C${s.label}\u201D belongs to more than one section`,message:`${m} \u201C${s.label}\u201D has its center inside ${y}, so its buyer section is unclear.`,action:"Adjust the boundaries until this object sits in one Section. If the overlapping shapes are meant to form one Section, combine them first.",objectId:s.id,relatedObjectIds:[s.id,...l.flatMap(b=>b.map(w=>w.id))],floorId:o.id,autoFixable:!1}))}}}var ri={structure:20,geometry:30,contrast:25,labels:15,navigation:10},si={"seat-overlap":15,"seat-cramped":4,"label-collision":4,"category-contrast-low":3,"ga-contrast-low":3,"category-colors-too-similar":3,"invalid-category-color":10,"text-contrast-low":4,"bookable-label-contrast-low":3,"selection-contrast-low":3,"theme-text-contrast-low":3,"missing-focal-point":10,"object-uncategorized":3,"object-unlabeled":3,"duplicate-object-label-normalized":2,"empty-section":2,"unused-floor":2,"ambiguous-section-ownership":4,"category-inventory-family-conflict":10};function ai(e){let n={...ri};for(let s of e){let r=s.severity==="error"?10:2;n[s.dimension]=Math.max(0,n[s.dimension]-(si[s.code]??r))}let o=Object.values(n).reduce((s,r)=>s+r,0),i=o>=95?"A":o>=85?"B":o>=70?"C":o>=55?"D":"F";return{overall:o,dimensions:n,errorFree:e.every(s=>s.severity!=="error"),grade:i}}var ci=new Set(["unpriced-category","object-uncategorized"]);function nn(e,n={}){let o=G(e),i=Zt(e,{maxInventory:n.maxInventory}).filter(c=>c.code!=="missing-zone-focal-point"||n.requireExplicitZoneFocals).map(c=>{let y=c.objectId?o.find(w=>w.objects.some(C=>C.id===c.objectId))?.id:void 0,m=c.code==="category-inventory-family-conflict",b=m?e.categories.find(w=>w.key===c.categoryKey):void 0;return M({...c,...m?{severity:"error",title:`Category \u201C${b?.label??c.categoryKey??"Unknown"}\u201D spans incompatible inventory types`,action:"Show the affected objects, then review the safe category split. The repair preserves price, ticket tiers, accessibility assignments, and source provenance."}:{},...n.requireExplicitZoneFocals&&c.code==="missing-zone-focal-point"?{severity:"error"}:{},...y?{floorId:y}:{},source:"structural",dimension:Hn(c),autoFixable:m})}),s=Wn(e,o,i),r=Xn(o),d=qn(e,o,i);if(Zn(e,o,i),oi(o,i),ti(e,o,i),ni(e,o,i),en(e,i),o.reduce((c,y)=>c+y.objects.filter(m=>m.type==="row"||m.type==="table"||m.type==="booth"||m.type==="gaArea").length,0)===0){let c=new Set(["missing-focal-point","no-bookables"]);for(let y=i.length-1;y>=0;y--)c.has(i[y].code)&&i.splice(y,1)}if(n.requirePricedInventory)for(let c=0;c<i.length;c++)ci.has(i[c].code)&&(i[c]={...i[c],severity:"error"});let g=i.filter(c=>c.severity==="error"),l=i.filter(c=>c.severity==="warning");return{issues:i,errors:g,warnings:l,metrics:{floors:o.length,objects:o.reduce((c,y)=>c+y.objects.length,0),seats:s.seats,bookableUnits:r.bookableUnits,inventoryByKind:r.inventoryByKind,categories:e.categories.length,freeTextLabels:d,checkedSeatPairs:s.checkedSeatPairs,minimumSeatDistance:s.minimumSeatDistance},score:ai(i),deferredRules:["rendered-row-label-decollision","rendered-bookable-state-contrast","section-focus-opacity-and-backdrop","24px-pointer-hit-target","reference-image-diff","sightline-blocked","ga-density-high"]}}function li(e,n){if(e.seatCount<2||e.seatSpacing>=n)return!1;let o=ve(K(e));e.seatSpacing=T(n,3);let i=ve(K(e));return e.origin.x=T(e.origin.x+o.x-i.x,3),e.origin.y=T(e.origin.y+o.y-i.y,3),!0}function di(e,n){if(e.seatCount<2)return!1;let o=!1;if(e.shape==="round"){let i=oe(e.seatArc??360,0,360),s=(i>=360?360/e.seatCount:i/(e.seatCount-1))*Math.PI/180;if(s>0){let r=n/(2*Math.sin(s/2)),d=Math.max(1,r-16);(e.radius??40)<d&&(e.radius=T(d,3),o=!0)}}else{let i=it(e),s=Math.max(i.top,i.bottom),r=Math.max(i.left,i.right);s>1&&(e.width??80)/s<n&&(e.width=T(s*n,3),o=!0),r>1&&(e.height??50)/r<n&&(e.height=T(r*n,3),o=!0)}return o}function ui(e){return[Gn,Vn].map(o=>({color:o,minimum:Math.min(...e.map(i=>_(o,i)??0))})).sort((o,i)=>i.minimum-o.minimum)[0].color}function on(e,n,o){let i=me(e),s=0;for(let r of n)r.type==="row"?s+=K(r).filter(d=>_e(i,d,o)).length:r.type==="table"?s+=ee(r).filter(d=>_e(i,d,o)).length:r.type==="text"&&r.id!==e.id&&ln(i,me(r),2)&&s++;return s}function fi(e,n,o){if(on(e,n,o)===0)return!1;let s={...e.position},r=Math.max(12,e.fontSize*1.25),d=[[0,-1],[1,0],[0,1],[-1,0],[1,-1],[1,1],[-1,1],[-1,-1]];for(let p=1;p<=12;p++)for(let[g,l]of d)if(e.position={x:T(s.x+g*r*p,3),y:T(s.y+l*r*p,3)},on(e,n,o)===0)return!0;return e.position=s,!1}function Co(e,n={}){let o=JSON.parse(JSON.stringify(e)),i=nn(o,n),s=[],r=Et(o);if(r.changed){o=r.doc;for(let y of r.changes){let m=r.before.find(w=>w.categoryKey===y.categoryKey),b=m?.families.map(w=>w.label).join(", ")??"inventory families";s.push({code:"category-inventory-family-conflict",objectId:m?.objectIds[0],message:`Split category \u201C${y.categoryLabel}\u201D across ${b}; preserved its commercial metadata and reassigned ${y.reassignments.length} affected object${y.reassignments.length===1?"":"s"}`})}}let d=Be(o),p=2.5*d,g=G(o);for(let y of g)for(let m of y.objects)if(m.type==="row"){let b=m.seatSpacing;li(m,p)&&s.push({code:b<2*d?"seat-overlap":"seat-cramped",objectId:m.id,message:`Expanded ${m.id} to the ${T(p)}u target pitch while preserving its centre`})}else m.type==="table"&&di(m,p)&&s.push({code:"seat-cramped",objectId:m.id,message:`Expanded ${m.id} so its perimeter seats meet the ${T(p)}u target pitch`});let l=o.theme?.background??sn;for(let y of g)for(let m of y.objects){if(m.type!=="text"||De(m))continue;let b=m.color??o.theme?.textColor??an,w=m.fontSize>=18?3:4.5;(_(b,l)??0)<w&&(m.color=ui([l]),s.push({code:"text-contrast-low",objectId:m.id,message:`Changed ${m.id} to the highest-contrast black/white ink`}))}for(let y of g){let m=y.objects.filter(b=>b.type==="text");for(let b of m)fi(b,y.objects,d)&&s.push({code:"label-collision",objectId:b.id,message:`Moved ${b.id} to the nearest collision-free deterministic label position`})}o.floors?.length&&(o.objects=o.floors[0].objects);let c=nn(o,n);return{doc:o,changed:s.length>0,fixes:s,before:i,after:c}}function rn(e){let n=e.trim();return/^\d+( copy)?$/.test(n)?`Floor ${n}`:`\u201C${n}\u201D`}function ye(e,n){return ue(n/(ge(e)??re),fe(e))}export{Oe as a,le as b,ce as c,Ot as d,Et as e,Co as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{N as c}from"./chunk-3W4ZMU4G.js";function s(e){let t=0;for(let n=0,o=e.length;n<o;n+=1){let i=e[n],a=e[(n+1)%o];t+=i.x*a.y-a.x*i.y}return t/2}function g(e){return s(e)*2}function X(e,t,n){let o=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){let r=e[i],u=e[a];r.y>n!=u.y>n&&t<(u.x-r.x)*(n-r.y)/(u.y-r.y)+r.x&&(o=!o)}return o}var l=.15,x=1.6;function O(e){return c(e??1,l,x)}var Y=["in","out","both"];function p(e){return e?.type==="shape"&&e.gate!=null&&typeof e.gate=="object"}function T(e){return e?.type==="shape"&&!e.gate&&(e.role==="entrance"||e.role==="exit")&&e.kind!=="line"&&e.kind!=="polyline"}function C(e){return e.type==="row"||e.type==="section"||e.type==="table"||e.type==="booth"||e.type==="gaArea"}function B(e){return e==="out"?"exit":"entrance"}function m(e){return e.floors?.length?e.floors.flatMap(t=>t.objects):e.objects}function f(e){let t=new Map;for(let n of m(e))p(n)&&t.set(n.id,n);return t}function I(e){if(e.gate.hideFromBuyers)return;let t=e.label?.normalize("NFKC").trim();return t?t.slice(0,40):void 0}function R(e){let t=new Set([...f(e).values()].map(n=>n.label?.trim().toLowerCase()));for(let n=0;n<26;n++){let o=`Gate ${String.fromCharCode(65+n)}`;if(!t.has(o.toLowerCase()))return o}for(let n=27;;n++)if(!t.has(`gate ${n}`))return`Gate ${n}`}function _(e,t,n){let o=t*.46,i=Math.max(e.length,2)*o*.6,a=n?o*1.25:0;return Math.round(i+a+t)}function d(e){let t=1/0,n=1/0,o=-1/0,i=-1/0,a=!1;for(let r of e)!Number.isFinite(r.x)||!Number.isFinite(r.y)||(a=!0,r.x<t&&(t=r.x),r.y<n&&(n=r.y),r.x>o&&(o=r.x),r.y>i&&(i=r.y));return a?{minX:t,minY:n,maxX:o,maxY:i}:null}function j(e){let t=d(e);return t?y(t):null}function y(e){return{x:e.minX,y:e.minY,width:e.maxX-e.minX,height:e.maxY-e.minY}}function w(e,t){return e.minX<=t.maxX&&t.minX<=e.maxX&&e.minY<=t.maxY&&t.minY<=e.maxY}export{d as a,j as b,w as c,s as d,g as e,X as f,l as g,x as h,O as i,Y as j,p as k,T as l,C as m,B as n,f as o,I as p,R as q,_ as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ya as Y}from"./chunk-3W4ZMU4G.js";function nn(c){return{kind:"radial",rowCount:0,rows:[],nearestRow:()=>-1,depthAt:(l,a)=>Math.hypot(l-c.x,a-c.y),gradientAt:(l,a)=>{let e=l-c.x,f=a-c.y,i=Math.hypot(e,f);return i<1e-9?[0,0]:[e/i,f/i]}}}function tn(c,l){if(!c.length)return null;let a=0,e=0,f=0;for(let n of c)a+=n.x,e+=n.y,f+=Math.hypot(n.x-l.x,n.y-l.y);let i=c.length;a/=i,e/=i,f/=i;let u=c[0],R=-1;for(let n of c){let o=Math.hypot(n.x-a,n.y-e);o>R&&(R=o,u=n)}let b=u.x-a,m=u.y-e,d=Math.hypot(b,m);d>1e-9?(b/=d,m/=d):(b=1,m=0);let y=[...c].sort((n,o)=>(n.x-a)*b+(n.y-e)*m-((o.x-a)*b+(o.y-e)*m)),t=0;for(let n of y){let o=Math.hypot(n.x-a,n.y-e);o>t&&(t=o)}return{pts:y,cx:a,cy:e,radius:t,depth:f}}function Z(c,l,a){let e=c.pts;if(e.length===1)return Math.hypot(l-e[0].x,a-e[0].y);let f=1/0;for(let i=0;i+1<e.length;i++){let u=e[i],R=e[i+1],b=R.x-u.x,m=R.y-u.y,d=b*b+m*m,y=d>1e-12?((l-u.x)*b+(a-u.y)*m)/d:0;y<0?y=0:y>1&&(y=1);let t=Math.hypot(l-(u.x+y*b),a-(u.y+y*m));t<f&&(f=t)}return f}var U=8;function en(c,l,a){let e=new Array(U).fill(1/0),f=new Array(U).fill(-1);for(let d=0;d<c.length;d++){let y=c[d],t=Math.hypot(l-y.cx,a-y.cy)-y.radius;for(let n=0;n<U;n++)if(t<e[n]){for(let o=U-1;o>n;o--)e[o]=e[o-1],f[o]=f[o-1];e[n]=t,f[n]=d;break}}let i=new Array(3).fill(1/0),u=new Array(3).fill(-1);for(let d of f){if(d<0)continue;let y=Z(c[d],l,a);for(let t=0;t<3;t++)if(y<i[t]){for(let n=2;n>t;n--)i[n]=i[n-1],u[n]=u[n-1];i[t]=y,u[t]=d;break}}if(u[0]<0)return 0;if(i[0]<1e-6)return c[u[0]].depth;let R=i[0]*2.2,b=0,m=0;for(let d=0;d<3;d++){let y=u[d];if(y<0||i[d]>R)continue;let t=1/(i[d]*i[d]);b+=t*c[y].depth,m+=t}return m>0?b/m:c[u[0]].depth}function on(c){let l=(e,f)=>en(c,e,f),a=(e,f)=>{let i=1/0,u=-1;for(let R=0;R<c.length;R++){let b=c[R];if(Math.hypot(e-b.cx,f-b.cy)-b.radius>=i)continue;let m=Z(b,e,f);m<i&&(i=m,u=R)}return u};return{kind:"rows",rowCount:c.length,rows:c,nearestRow:a,depthAt:l,gradientAt:(e,f)=>{let i=(l(e+.5,f)-l(e-.5,f))/1,u=(l(e,f+.5)-l(e,f-.5))/(2*.5),R=Math.hypot(i,u);return R<1e-9?[0,0]:[i/R,u/R]}}}function bn(c,l){let a=[];for(let e of c){let f=tn(e.points,l);f&&a.push(f)}return a.length<2?nn(l):(a.sort((e,f)=>e.depth-f.depth),on(a))}var rn=Math.PI/180,h=96,sn=6,ln=60,cn=150,$=.2,an=.35;function fn(c,l){let a=Math.atan2(l.x-c.x,l.y-c.y)/rn;return a<0?a+360:a}function z(c){if(!c.length)return NaN;let l=[...c].sort((a,e)=>a-e);return l[Math.floor(l.length/2)]}function J(c,l,a=2){let e=c.length,f=new Float64Array(e);for(let i=0;i<e;i++){let u=0,R=0;for(let b=-a;b<=a;b++){let m=i+b;if(l)m=(m%e+e)%e;else if(m<0||m>=e)continue;u+=c[m],R++}f[i]=u/R}return f}function hn(c,l){let a=c.filter(t=>t.rows.length>=1);if(a.length<1)return null;let e=[],f=0,i=0,u=0;for(let t of a)for(let n of t.rows){for(let o of n.pts)f+=o.x,i+=o.y,u++;if(n.pts.length>=4){let o=Y(n.pts);o&&Number.isFinite(o.cx)&&Number.isFinite(o.cy)&&e.push({x:o.cx,y:o.cy})}}if(!u)return null;let R={x:f/u,y:i/u},b=R;if(e.length>=8){let t=z(e.map(D=>D.x)),n=z(e.map(D=>D.y)),o=0;for(let D of a)for(let j of D.rows)for(let F of j.pts){let W=Math.hypot(F.x-R.x,F.y-R.y);W>o&&(o=W)}let B=0,S=o*.2;for(let D of a)for(let j of D.rows)for(let F of j.pts)Math.hypot(F.x-t,F.y-n)<S&&B++;Math.hypot(t-R.x,n-R.y)<=o&&B/u<.01&&(b={x:t,y:n})}let m=[];for(let t of a){let n={sectionId:t.sectionId,rMin:1/0,rMax:-1/0,samples:[]};for(let o of t.rows)for(let B of o.pts){let S=Math.hypot(B.x-b.x,B.y-b.y),D=Math.min(h-1,Math.floor(fn(b,B)/(360/h)));n.samples.push({r:S,bin:D,levelM:o.levelM}),S<n.rMin&&(n.rMin=S),S>n.rMax&&(n.rMax=S)}n.samples.length&&m.push(n)}if(!m.length)return null;m.sort((t,n)=>t.rMin+t.rMax-(n.rMin+n.rMax));let d=[];for(let t of m){let n=!1;for(let o of d){let B=Math.min(t.rMax,o.rMax)-Math.max(t.rMin,o.rMin),S=Math.min(t.rMax-t.rMin,o.rMax-o.rMin);if(S>1e-9&&B>=an*S){o.members.push(t),o.rMin=Math.min(o.rMin,t.rMin),o.rMax=Math.max(o.rMax,t.rMax),n=!0;break}}n||d.push({members:[t],rMin:t.rMin,rMax:t.rMax})}let y=[];for(let t of d){let n=new Array(h).fill(null);for(let r of t.members)for(let p of r.samples){let x=n[p.bin];x||(x={samples:[]},n[p.bin]=x),x.samples.push({r:p.r,levelM:p.levelM})}let o=n.map(r=>!!r);if(!o.filter(Boolean).length)continue;let S=[],D=[];for(let r of n){if(!r)continue;let p=1/0,x=-1/0;for(let A of r.samples)A.r<p&&(p=A.r),A.r>x&&(x=A.r);S.push(p),D.push(x)}let j=z(S),F=z(D);if(!(j>=$*F)||!(F>0))continue;let W=[...S].sort((r,p)=>r-p);if(!(W[Math.floor(W.length*.1)]>=$*F))continue;let V=n.map(r=>{if(!r)return null;let p=[...r.samples].sort((w,k)=>w.r-k.r),x=p[0].r,A=p[p.length-1].r,P=p[0].levelM,N=-1/0;for(let w of p)w.levelM>N&&(N=w.levelM);let M=[];for(let w of p){let k={r:w.r,l:w.levelM};for(;M.length&&Math.abs(M[M.length-1].r-k.r)<1e-9;){if(M[M.length-1].l<=k.l){k.skip=!0;break}M.pop()}if(!k.skip){for(;M.length>=2;){let L=M[M.length-2],v=M[M.length-1];if((v.r-L.r)*(k.l-L.l)-(v.l-L.l)*(k.r-L.r)<=0)M.pop();else break}M.push(k)}}let C=M.map(w=>w.r),_=M.map(w=>w.l);return{inner:x,outer:A,front:P,top:N,profile:{rs:C,ls:_}}}),O=o.slice();for(let r=0;r<h;r++){if(O[r])continue;let p=-1,x=-1,A=0;for(let s=1;s<=h;s++){let g=(r-s+h*2)%h;if(O[g]){p=g;break}}for(let s=1;s<=h;s++){let g=(r+s)%h;if(O[g]){x=g,A=s;break}}if(p<0||x<0)continue;let P=0;for(let s=1;s<=h;s++){let g=(r-s+h*2)%h;if(o[g]){P=s;break}}if(P-1+A>sn)continue;let M=V[p],C=V[x],_=P/(P+A),w=M.inner+(C.inner-M.inner)*_,k=M.outer+(C.outer-M.outer)*_,L=M.front+(C.front-M.front)*_,v=M.top+(C.top-M.top)*_;V[r]={inner:w,outer:k,front:L,top:v,profile:{rs:[w,k],ls:[L,v]}}}for(let r=0;r<h;r++)V[r]&&(O[r]=!0);let X=360/h,K=[],q=O.filter(Boolean).length,Q=[];if(q===h)Q.push({start:0,len:h});else{let r=0;for(;O[r];)r=(r+1)%h;let p=-1;for(let x=0;x<=h;x++){let A=(r+x)%h,P=x<h&&O[A];if(P&&p<0)p=A;else if(!P&&p>=0){let N=(A-p+h)%h||h;Q.push({start:p,len:N}),p=-1}}}for(let r of Q){if(r.len*X<ln&&r.len<h)continue;let p=r.len===h,x=new Float64Array(r.len),A=new Float64Array(r.len),P=new Float64Array(r.len),N=new Float64Array(r.len),M=[];for(let s=0;s<r.len;s++){let g=V[(r.start+s)%h];x[s]=g.inner,A[s]=g.outer,P[s]=g.front,N[s]=g.top,M.push(g.profile??{rs:[g.inner,g.outer],ls:[g.front,g.top]})}let C=J(x,p),_=J(A,p),w=J(P,p),k=J(N,p);for(let s=0;s<r.len;s++)C[s]>x[s]&&(C[s]=x[s]),_[s]<A[s]&&(_[s]=A[s]),C[s]>_[s]-1e-6&&(C[s]=Math.max(0,_[s]-1e-6)),k[s]<w[s]&&(k[s]=w[s]);let L={startBin:r.start,binCount:r.len,closed:p,innerR:C,outerR:_,frontLevelM:w,topLevelM:k,profiles:M},v=(s,g,I)=>{let H=M[s],T=H.rs,E=H.ls;if(g<=T[0]){E[0]>I&&(E[0]=I);return}if(g>=T[T.length-1]){E[E.length-1]>I&&(E[E.length-1]=I);return}for(let G=0;G+1<T.length;G++)if(g<=T[G+1]){E[G]>I&&(E[G]=I),E[G+1]>I&&(E[G+1]=I);return}};for(let s=0;s<r.len;s++){let g=n[(r.start+s)%h];if(g)for(let I of g.samples){v(s,I.r,I.levelM);let H=p?(s-1+r.len)%r.len:s-1,T=p?(s+1)%r.len:s+1;H>=0&&v(H,I.r,I.levelM),T<r.len&&v(T,I.r,I.levelM)}}K.push(L)}K.reduce((r,p)=>r+p.binCount*X,0)<cn||y.push({arcs:K,sectionIds:t.members.map(r=>r.sectionId),innerRMedian:j,outerRMedian:F})}if(!y.length)return null;if(y.sort((t,n)=>t.innerRMedian-n.innerRMedian),l){let t=y[y.length-1].outerRMedian;if(Math.hypot(l.x-b.x,l.y-b.y)>.9*t)return null}return{centre:b,binCount:h,binStepDeg:360/h,rings:y}}function dn(c,l,a,e){let f=c.binStepDeg,i=a/f-.5-l.startBin;i=(i%c.binCount+c.binCount)%c.binCount,i>l.binCount-1&&(l.closed?i=i-l.binCount<l.binCount-i?0:l.binCount-1:i=i-(l.binCount-1)<c.binCount-i?l.binCount-1:0);let u=Math.floor(i),R=l.closed?(u+1)%l.binCount:Math.min(l.binCount-1,u+1),b=i-u,m=d=>{let y=l.profiles[d],t=y.rs,n=y.ls;if(e<=t[0])return n[0];if(e>=t[t.length-1])return n[n.length-1];for(let o=0;o+1<t.length;o++)if(e<=t[o+1]){let B=t[o+1]-t[o],S=B>1e-9?(e-t[o])/B:0;return n[o]+(n[o+1]-n[o])*S}return n[n.length-1]};return m(u)*(1-b)+m(R)*b}export{bn as a,fn as b,hn as c,dn as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{K as m,w as V,y as H}from"./chunk-52XO3LA7.js";var ie=3,k=4.5,T=3,$=24,re=20;function A(t){return t.filter(a=>a.visible&&!!a.screenBox)}function y(t,a){return t.x<a.x+a.width&&t.x+t.width>a.x&&t.y<a.y+a.height&&t.y+t.height>a.y}function p(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function o(t,a,s){return s.length?{code:t,message:a,count:s.length,samples:s.slice(0,re)}:null}function B(t,a,s){return{primaryId:t.seatId,primaryLabel:t.label,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function F(t,a,s){return{primaryId:t.id,primaryLabel:t.label,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function D(t,a,s){return{primaryId:t.objectId,primaryLabel:t.text,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function g(t,a,s,l){return{primaryId:t,primaryLabel:a,secondaryId:s,secondaryLabel:l}}function ae(t,a="overview",s=null){let l=A(t.labels),c=A(t.hierarchyLabels),d=A(t.freeTextLabels),f=A(t.rowLabels),C=t.gaAreas.filter(e=>e.visible),W=l.map(e=>m(e.ink,e.fill)??0),X=c.map(e=>m(e.ink,e.fill)??0),Y=d.map(e=>m(e.ink,e.background)??0),q=C.map(e=>m(e.effectiveBackground,t.canvasBackground)??0),u=s?t.labels.filter(e=>e.categoryKey===s):t.labels,v=s?t.gaAreas.filter(e=>e.categoryKey===s):t.gaAreas,h=u.filter(e=>e.selected),x=u.filter(e=>e.status==="held"),w=u.filter(e=>e.status==="booked"),R=u.filter(e=>e.pointerTarget.active),M=new Set([...t.labels.filter(e=>e.visible&&(e.opacity>.25||e.selected||e.status!=="free")).map(e=>e.categoryKey),...t.gaAreas.filter(e=>e.visible&&e.opacity>.1).map(e=>e.categoryKey)]),S=h.length?p(h.map(e=>m(e.selectionRingColor??t.selectionRingColor,e.fill)??0)):null,n=[],I=(e,i)=>Array.from({length:e},(b,L)=>({primaryId:`overview:${L+1}`,primaryLabel:i}));a==="overview"&&t.rung==="sections"&&(n.push(o("overview-section-category-paint","Section overview shells must use the neutral hierarchy palette, not category paint",I(t.overviewStyle.categoryPaintedSectionShells,"category-painted section shell"))),n.push(o("overview-category-detail-visible","Category-tinted section detail must wait until section focus or seat zoom",I(t.overviewStyle.visibleCategoryDetailOutlines,"category detail outline"))),n.push(o("overview-row-hints-visible","Row and seat patterns must not clutter the section overview",I(t.overviewStyle.visibleSectionRowHints,"section row hint"))),n.push(o("overview-availability-clutter","Live availability counts belong in focused detail, not on section overview shells",I(t.overviewStyle.visibleSectionAvailabilityLabels,"section availability label"))),n.push(o("overview-ga-detail-visible","Section-contained standing paint belongs in focused detail, not on section overview shells",I(t.overviewStyle.visibleSectionGADetails,"section-contained GA detail")))),n.push(o("bookable-label-undersized","Visible bookable labels must meet the rendered small-text size floor",l.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>B(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),n.push(o("bookable-label-viewport-clipped","Visible interaction labels must remain fully inside the buyer viewport",a==="interaction"?l.filter(e=>e.screenBox.x<0||e.screenBox.y<0||e.screenBox.x+e.screenBox.width>t.viewport.width||e.screenBox.y+e.screenBox.height>t.viewport.height).map(e=>B(e)):[])),n.push(o("row-label-viewport-clipped","Visible interaction row labels must remain fully inside the buyer viewport",a==="interaction"?f.flatMap((e,i)=>{let b=e.screenBox;return b.x<0||b.y<0||b.x+b.width>t.viewport.width||b.y+b.height>t.viewport.height?[{primaryId:`row-label-${i}`,primaryLabel:e.text}]:[]}):[]));let _=[];if(a==="interaction")for(let e=0;e<f.length;e+=1)for(let i=0;i<e;i+=1)y(f[e].screenBox,f[i].screenBox)&&_.push(g(`row-label-${i}`,f[i].text,`row-label-${e}`,f[e].text));if(n.push(o("row-label-collision","Visible interaction row labels must not overlap",_)),a==="interaction"){let e=u.length>0,i=v.length>0,b=e||i,L=v.filter(r=>r.visible),J=new Set([...u.flatMap(r=>r.sectionId?[r.sectionId]:[]),...v.flatMap(r=>r.sectionId?[r.sectionId]:[])]),Z=new Set([...t.labels.map(r=>r.categoryKey),...t.gaAreas.map(r=>r.categoryKey)]),P=r=>r.screenCenter.x>=0&&r.screenCenter.x<=t.viewport.width&&r.screenCenter.y>=0&&r.screenCenter.y<=t.viewport.height;n.push(o("detail-rung-missing","Interaction evidence with bookable inventory must render the seat-detail rung",b&&t.rung!=="seats"?[{primaryId:"renderer",primaryLabel:t.rung}]:[])),n.push(o("detail-inventory-not-visible","Interaction evidence must frame at least one real bookable unit",b&&!u.some(P)&&!L.length?[{primaryId:"renderer",primaryLabel:"no target inventory in viewport"}]:[])),n.push(o("pointer-target-inactive","Interaction evidence must expose a live production pointer target",e&&!R.some(P)||!e&&i&&!L.some(r=>r.interactive)?[{primaryId:"renderer",primaryLabel:"no active pointer target in viewport"}]:[])),n.push(o("pointer-target-undersized","Every active production pointer target must reach at least 24 CSS pixels",R.filter(r=>P(r)&&r.pointerTarget.effectiveMinimumPx<$).map(r=>B(r,r.pointerTarget.effectiveMinimumPx,$)))),n.push(o("selected-state-missing","Interaction evidence must paint a selected unit and its renderer-owned ring",e&&(!h.length||!h.some(r=>t.selectionRingSeatIds.includes(r.seatId)))?[{primaryId:"renderer",primaryLabel:"selected state"}]:[])),n.push(o("selected-state-contrast-low","The selected-state ring must maintain 3:1 graphical contrast with the seat paint",h.length&&(S??0)<T?[{primaryId:h[0].seatId,primaryLabel:h[0].label,measured:Math.round((S??0)*100)/100,minimum:T}]:[])),n.push(o("held-state-missing","Interaction evidence must paint a held state when the floor has at least two status-managed units",u.length>=2&&!x.length?[{primaryId:"renderer",primaryLabel:"held state"}]:[])),n.push(o("booked-state-missing","Interaction evidence must paint a taken state when the floor has at least three status-managed units",u.length>=3&&!w.length?[{primaryId:"renderer",primaryLabel:"booked state"}]:[]));let ee=new Set(x.map(r=>`${r.fill.toLowerCase()}:${r.opacity}`)),te=new Set(w.map(r=>`${r.fill.toLowerCase()}:${r.opacity}`));n.push(o("status-state-indistinct","Held and taken evidence must resolve to distinct renderer paint",x.length&&w.length&&[...ee].some(r=>te.has(r))?[{primaryId:x[0].seatId,primaryLabel:x[0].label,secondaryId:w[0].seatId,secondaryLabel:w[0].label}]:[])),n.push(o("section-focus-missing","Interaction evidence must exercise section focus and its backdrop when section membership exists",J.size&&(!t.focusedSectionId||!t.focusBackdropVisible)?[{primaryId:"renderer",primaryLabel:"section focus"}]:[])),n.push(o("category-filter-missing","Interaction evidence must exercise a category filter when multiple categories exist",Z.size>=2&&(!t.categoryFilterKeys||!t.categoryFilterKeys.length)?[{primaryId:"renderer",primaryLabel:"category filter"}]:[]));let E=t.labels.filter(r=>r.status==="free"&&!r.selected&&t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(r.categoryKey)),Q=t.gaAreas.filter(r=>t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(r.categoryKey));n.push(o("category-filter-ineffective","The active category filter must visibly dim excluded free inventory",(E.length||Q.length)&&!E.some(r=>r.opacity<=.25)&&!Q.some(r=>r.opacity<=.1)?[...E.map(r=>B(r,r.opacity)),...Q.map(r=>({primaryId:r.areaId,primaryLabel:r.label,measured:r.opacity}))]:[])),n.push(o("target-category-not-visible","A category-specific interaction scene must visibly paint its exact target category",s&&!M.has(s)?[{primaryId:s,primaryLabel:s}]:[])),n.push(o("target-category-filter-mismatch","A category-specific interaction scene must bind its filter to only the exact target category",s&&(t.categoryFilterKeys?.length!==1||t.categoryFilterKeys[0]!==s)?[{primaryId:s,primaryLabel:s}]:[]))}n.push(o("bookable-label-contrast-low","Visible bookable labels must meet 4.5:1 contrast against their actual paint",l.flatMap(e=>{let i=m(e.ink,e.fill)??0;return i<k?[B(e,i,k)]:[]})));let z=[];for(let e=0;e<l.length;e+=1)for(let i=0;i<e;i+=1)y(l[e].screenBox,l[i].screenBox)&&z.push(g(l[i].seatId,l[i].label,l[e].seatId,l[e].label));n.push(o("bookable-label-collision","Visible bookable labels must not overlap",z)),n.push(o("hierarchy-label-undersized","Visible section and zone labels must meet the rendered small-text size floor",c.filter(e=>e.renderedFontPx<(e.sizeFloorPx??V)).map(e=>F(e,e.renderedFontPx,e.sizeFloorPx??V)))),n.push(o("hierarchy-label-contrast-low","Visible section and zone labels must meet 4.5:1 contrast against their backing paint",c.flatMap(e=>{let i=m(e.ink,e.fill)??0,b=e.kind==="section"&&e.role==="name"?H:k;return i<b?[F(e,i,b)]:[]}))),n.push(o("hierarchy-label-viewport-clipped","Visible overview hierarchy labels must remain fully inside the buyer viewport",a==="overview"?c.filter(e=>e.screenBox.x<0||e.screenBox.y<0||e.screenBox.x+e.screenBox.width>t.viewport.width||e.screenBox.y+e.screenBox.height>t.viewport.height).map(e=>F(e)):[])),n.push(o("hierarchy-label-outside-section","Visible section labels must remain inside the filled section surface and outside holes",c.filter(e=>e.kind==="section"&&e.fitsContainer===!1).map(e=>F(e))));let K=[];for(let e=0;e<c.length;e+=1)for(let i=0;i<e;i+=1)y(c[e].screenBox,c[i].screenBox)&&K.push(g(c[i].id,c[i].label,c[e].id,c[e].label));n.push(o("hierarchy-label-collision","Visible hierarchy labels must not overlap each other",K));let N=[];for(let e of c)for(let i of l)y(e.screenBox,i.screenBox)&&N.push(g(e.id,e.label,i.seatId,i.label));n.push(o("hierarchy-bookable-collision","Visible hierarchy labels must not overlap bookable labels",N)),n.push(o("free-text-undersized","Visible chart text must meet the rendered small-text size floor",d.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>D(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),n.push(o("free-text-contrast-low","Visible chart text must meet 4.5:1 contrast against its measured background",d.flatMap(e=>{let i=m(e.ink,e.background)??0;return i<k?[D(e,i,k)]:[]})));let G=[];for(let e=0;e<d.length;e+=1)for(let i=0;i<e;i+=1)y(d[e].screenBox,d[i].screenBox)&&G.push(g(d[i].objectId,d[i].text,d[e].objectId,d[e].text));n.push(o("free-text-collision","Visible chart text labels must not overlap each other",G));let O=[];for(let e of d)for(let i of l)y(e.screenBox,i.screenBox)&&O.push(g(e.objectId,e.text,i.seatId,i.label));n.push(o("free-text-bookable-collision","Visible chart text must not overlap bookable labels",O));let U=[];for(let e of d)for(let i of c)y(e.screenBox,i.screenBox)&&U.push(g(e.objectId,e.text,i.id,i.label));n.push(o("free-text-hierarchy-collision","Visible chart text must not overlap hierarchy labels",U)),n.push(o("ga-contrast-low","Visible GA surfaces must maintain 3:1 graphical contrast with the canvas",C.flatMap(e=>{let i=m(e.effectiveBackground,t.canvasBackground)??0;return i<T?[{primaryId:e.areaId,primaryLabel:e.label,measured:Math.round(i*100)/100,minimum:T}]:[]})));let j=n.filter(e=>!!e);return{version:ie,passed:j.length===0,state:a,targetCategoryKey:s,resolvedRules:["rendered-overview-label-size","rendered-overview-label-contrast","rendered-overview-label-collision","rendered-overview-hierarchy-viewport","rendered-overview-hierarchy-containment","rendered-overview-section-first-style","rendered-overview-ga-contrast",...a==="interaction"?["rendered-detail-label-viewport","rendered-detail-inventory","rendered-pointer-target","rendered-selected-held-taken-states","rendered-section-focus","rendered-category-filter"]:[]],viewport:t.viewport,canvasBackground:t.canvasBackground,effectiveScale:t.effectiveScale,rung:t.rung,inventory:{totalBookableUnits:t.totalBookableUnits,totalLabelledBookableUnits:t.totalLabelledBookableUnits,visibleBookableLabels:l.length,hiddenBookableLabels:t.hiddenLabels,visibleHierarchyLabels:c.length,visibleFreeTextLabels:d.length,visibleGAAreas:C.length},overviewStyle:t.overviewStyle,composition:{hierarchy:t.hierarchyLabels.filter(e=>e.role==="name").map(e=>({id:e.id,kind:e.kind,label:e.label,visible:e.visible})).sort((e,i)=>e.kind.localeCompare(i.kind)||e.id.localeCompare(i.id)),labelledObjects:t.freeTextLabels.map(e=>({objectId:e.objectId,kind:e.kind,text:e.text,visible:e.visible})).sort((e,i)=>e.objectId.localeCompare(i.objectId)||e.kind.localeCompare(i.kind)),gaAreas:t.gaAreas.map(e=>({areaId:e.areaId,label:e.label,categoryKey:e.categoryKey,...e.sectionId?{sectionId:e.sectionId}:{},visible:e.visible})).sort((e,i)=>e.areaId.localeCompare(i.areaId)),bookableSectionIds:[...new Set(t.labels.flatMap(e=>e.sectionId?[e.sectionId]:[]))].sort(),categoryKeys:[...new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)])].sort(),activeCategoryKeys:[...M].sort()},metrics:{minimumRenderedBookableLabelPx:p(l.map(e=>e.renderedFontPx)),minimumBookableLabelContrast:p(W),minimumRenderedHierarchyLabelPx:p(c.map(e=>e.renderedFontPx)),minimumHierarchyLabelContrast:p(X),minimumRenderedFreeTextPx:p(d.map(e=>e.renderedFontPx)),minimumFreeTextContrast:p(Y),minimumGAContrast:p(q),minimumEffectivePointerTargetPx:p(R.map(e=>e.pointerTarget.effectiveMinimumPx)),selectedRingContrast:S==null?null:Math.round(S*100)/100},interaction:{applicable:{detail:u.length>0||v.length>0,pointer:u.length>0||v.length>0,held:u.length>=2,booked:u.length>=3,sectionFocus:u.some(e=>!!e.sectionId)||v.some(e=>!!e.sectionId),categoryFilter:new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)]).size>=2},selectedUnits:h.length,heldUnits:x.length,bookedUnits:w.length,activePointerTargets:R.length,focusedSectionId:t.focusedSectionId,focusBackdropVisible:t.focusBackdropVisible,categoryFilterKeys:t.categoryFilterKeys},findings:j}}export{ie as a,$ as b,ae as c};
|
|
1
|
+
import{l as V,n as H,z as m}from"./chunk-JRZHC75P.js";var ie=3,k=4.5,T=3,$=24,re=20;function A(t){return t.filter(a=>a.visible&&!!a.screenBox)}function y(t,a){return t.x<a.x+a.width&&t.x+t.width>a.x&&t.y<a.y+a.height&&t.y+t.height>a.y}function p(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function o(t,a,s){return s.length?{code:t,message:a,count:s.length,samples:s.slice(0,re)}:null}function B(t,a,s){return{primaryId:t.seatId,primaryLabel:t.label,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function F(t,a,s){return{primaryId:t.id,primaryLabel:t.label,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function D(t,a,s){return{primaryId:t.objectId,primaryLabel:t.text,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function g(t,a,s,l){return{primaryId:t,primaryLabel:a,secondaryId:s,secondaryLabel:l}}function ae(t,a="overview",s=null){let l=A(t.labels),c=A(t.hierarchyLabels),d=A(t.freeTextLabels),f=A(t.rowLabels),C=t.gaAreas.filter(e=>e.visible),W=l.map(e=>m(e.ink,e.fill)??0),X=c.map(e=>m(e.ink,e.fill)??0),Y=d.map(e=>m(e.ink,e.background)??0),q=C.map(e=>m(e.effectiveBackground,t.canvasBackground)??0),u=s?t.labels.filter(e=>e.categoryKey===s):t.labels,v=s?t.gaAreas.filter(e=>e.categoryKey===s):t.gaAreas,h=u.filter(e=>e.selected),x=u.filter(e=>e.status==="held"),w=u.filter(e=>e.status==="booked"),R=u.filter(e=>e.pointerTarget.active),M=new Set([...t.labels.filter(e=>e.visible&&(e.opacity>.25||e.selected||e.status!=="free")).map(e=>e.categoryKey),...t.gaAreas.filter(e=>e.visible&&e.opacity>.1).map(e=>e.categoryKey)]),S=h.length?p(h.map(e=>m(e.selectionRingColor??t.selectionRingColor,e.fill)??0)):null,n=[],I=(e,i)=>Array.from({length:e},(b,L)=>({primaryId:`overview:${L+1}`,primaryLabel:i}));a==="overview"&&t.rung==="sections"&&(n.push(o("overview-section-category-paint","Section overview shells must use the neutral hierarchy palette, not category paint",I(t.overviewStyle.categoryPaintedSectionShells,"category-painted section shell"))),n.push(o("overview-category-detail-visible","Category-tinted section detail must wait until section focus or seat zoom",I(t.overviewStyle.visibleCategoryDetailOutlines,"category detail outline"))),n.push(o("overview-row-hints-visible","Row and seat patterns must not clutter the section overview",I(t.overviewStyle.visibleSectionRowHints,"section row hint"))),n.push(o("overview-availability-clutter","Live availability counts belong in focused detail, not on section overview shells",I(t.overviewStyle.visibleSectionAvailabilityLabels,"section availability label"))),n.push(o("overview-ga-detail-visible","Section-contained standing paint belongs in focused detail, not on section overview shells",I(t.overviewStyle.visibleSectionGADetails,"section-contained GA detail")))),n.push(o("bookable-label-undersized","Visible bookable labels must meet the rendered small-text size floor",l.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>B(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),n.push(o("bookable-label-viewport-clipped","Visible interaction labels must remain fully inside the buyer viewport",a==="interaction"?l.filter(e=>e.screenBox.x<0||e.screenBox.y<0||e.screenBox.x+e.screenBox.width>t.viewport.width||e.screenBox.y+e.screenBox.height>t.viewport.height).map(e=>B(e)):[])),n.push(o("row-label-viewport-clipped","Visible interaction row labels must remain fully inside the buyer viewport",a==="interaction"?f.flatMap((e,i)=>{let b=e.screenBox;return b.x<0||b.y<0||b.x+b.width>t.viewport.width||b.y+b.height>t.viewport.height?[{primaryId:`row-label-${i}`,primaryLabel:e.text}]:[]}):[]));let _=[];if(a==="interaction")for(let e=0;e<f.length;e+=1)for(let i=0;i<e;i+=1)y(f[e].screenBox,f[i].screenBox)&&_.push(g(`row-label-${i}`,f[i].text,`row-label-${e}`,f[e].text));if(n.push(o("row-label-collision","Visible interaction row labels must not overlap",_)),a==="interaction"){let e=u.length>0,i=v.length>0,b=e||i,L=v.filter(r=>r.visible),J=new Set([...u.flatMap(r=>r.sectionId?[r.sectionId]:[]),...v.flatMap(r=>r.sectionId?[r.sectionId]:[])]),Z=new Set([...t.labels.map(r=>r.categoryKey),...t.gaAreas.map(r=>r.categoryKey)]),P=r=>r.screenCenter.x>=0&&r.screenCenter.x<=t.viewport.width&&r.screenCenter.y>=0&&r.screenCenter.y<=t.viewport.height;n.push(o("detail-rung-missing","Interaction evidence with bookable inventory must render the seat-detail rung",b&&t.rung!=="seats"?[{primaryId:"renderer",primaryLabel:t.rung}]:[])),n.push(o("detail-inventory-not-visible","Interaction evidence must frame at least one real bookable unit",b&&!u.some(P)&&!L.length?[{primaryId:"renderer",primaryLabel:"no target inventory in viewport"}]:[])),n.push(o("pointer-target-inactive","Interaction evidence must expose a live production pointer target",e&&!R.some(P)||!e&&i&&!L.some(r=>r.interactive)?[{primaryId:"renderer",primaryLabel:"no active pointer target in viewport"}]:[])),n.push(o("pointer-target-undersized","Every active production pointer target must reach at least 24 CSS pixels",R.filter(r=>P(r)&&r.pointerTarget.effectiveMinimumPx<$).map(r=>B(r,r.pointerTarget.effectiveMinimumPx,$)))),n.push(o("selected-state-missing","Interaction evidence must paint a selected unit and its renderer-owned ring",e&&(!h.length||!h.some(r=>t.selectionRingSeatIds.includes(r.seatId)))?[{primaryId:"renderer",primaryLabel:"selected state"}]:[])),n.push(o("selected-state-contrast-low","The selected-state ring must maintain 3:1 graphical contrast with the seat paint",h.length&&(S??0)<T?[{primaryId:h[0].seatId,primaryLabel:h[0].label,measured:Math.round((S??0)*100)/100,minimum:T}]:[])),n.push(o("held-state-missing","Interaction evidence must paint a held state when the floor has at least two status-managed units",u.length>=2&&!x.length?[{primaryId:"renderer",primaryLabel:"held state"}]:[])),n.push(o("booked-state-missing","Interaction evidence must paint a taken state when the floor has at least three status-managed units",u.length>=3&&!w.length?[{primaryId:"renderer",primaryLabel:"booked state"}]:[]));let ee=new Set(x.map(r=>`${r.fill.toLowerCase()}:${r.opacity}`)),te=new Set(w.map(r=>`${r.fill.toLowerCase()}:${r.opacity}`));n.push(o("status-state-indistinct","Held and taken evidence must resolve to distinct renderer paint",x.length&&w.length&&[...ee].some(r=>te.has(r))?[{primaryId:x[0].seatId,primaryLabel:x[0].label,secondaryId:w[0].seatId,secondaryLabel:w[0].label}]:[])),n.push(o("section-focus-missing","Interaction evidence must exercise section focus and its backdrop when section membership exists",J.size&&(!t.focusedSectionId||!t.focusBackdropVisible)?[{primaryId:"renderer",primaryLabel:"section focus"}]:[])),n.push(o("category-filter-missing","Interaction evidence must exercise a category filter when multiple categories exist",Z.size>=2&&(!t.categoryFilterKeys||!t.categoryFilterKeys.length)?[{primaryId:"renderer",primaryLabel:"category filter"}]:[]));let E=t.labels.filter(r=>r.status==="free"&&!r.selected&&t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(r.categoryKey)),Q=t.gaAreas.filter(r=>t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(r.categoryKey));n.push(o("category-filter-ineffective","The active category filter must visibly dim excluded free inventory",(E.length||Q.length)&&!E.some(r=>r.opacity<=.25)&&!Q.some(r=>r.opacity<=.1)?[...E.map(r=>B(r,r.opacity)),...Q.map(r=>({primaryId:r.areaId,primaryLabel:r.label,measured:r.opacity}))]:[])),n.push(o("target-category-not-visible","A category-specific interaction scene must visibly paint its exact target category",s&&!M.has(s)?[{primaryId:s,primaryLabel:s}]:[])),n.push(o("target-category-filter-mismatch","A category-specific interaction scene must bind its filter to only the exact target category",s&&(t.categoryFilterKeys?.length!==1||t.categoryFilterKeys[0]!==s)?[{primaryId:s,primaryLabel:s}]:[]))}n.push(o("bookable-label-contrast-low","Visible bookable labels must meet 4.5:1 contrast against their actual paint",l.flatMap(e=>{let i=m(e.ink,e.fill)??0;return i<k?[B(e,i,k)]:[]})));let z=[];for(let e=0;e<l.length;e+=1)for(let i=0;i<e;i+=1)y(l[e].screenBox,l[i].screenBox)&&z.push(g(l[i].seatId,l[i].label,l[e].seatId,l[e].label));n.push(o("bookable-label-collision","Visible bookable labels must not overlap",z)),n.push(o("hierarchy-label-undersized","Visible section and zone labels must meet the rendered small-text size floor",c.filter(e=>e.renderedFontPx<(e.sizeFloorPx??V)).map(e=>F(e,e.renderedFontPx,e.sizeFloorPx??V)))),n.push(o("hierarchy-label-contrast-low","Visible section and zone labels must meet 4.5:1 contrast against their backing paint",c.flatMap(e=>{let i=m(e.ink,e.fill)??0,b=e.kind==="section"&&e.role==="name"?H:k;return i<b?[F(e,i,b)]:[]}))),n.push(o("hierarchy-label-viewport-clipped","Visible overview hierarchy labels must remain fully inside the buyer viewport",a==="overview"?c.filter(e=>e.screenBox.x<0||e.screenBox.y<0||e.screenBox.x+e.screenBox.width>t.viewport.width||e.screenBox.y+e.screenBox.height>t.viewport.height).map(e=>F(e)):[])),n.push(o("hierarchy-label-outside-section","Visible section labels must remain inside the filled section surface and outside holes",c.filter(e=>e.kind==="section"&&e.fitsContainer===!1).map(e=>F(e))));let K=[];for(let e=0;e<c.length;e+=1)for(let i=0;i<e;i+=1)y(c[e].screenBox,c[i].screenBox)&&K.push(g(c[i].id,c[i].label,c[e].id,c[e].label));n.push(o("hierarchy-label-collision","Visible hierarchy labels must not overlap each other",K));let N=[];for(let e of c)for(let i of l)y(e.screenBox,i.screenBox)&&N.push(g(e.id,e.label,i.seatId,i.label));n.push(o("hierarchy-bookable-collision","Visible hierarchy labels must not overlap bookable labels",N)),n.push(o("free-text-undersized","Visible chart text must meet the rendered small-text size floor",d.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>D(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),n.push(o("free-text-contrast-low","Visible chart text must meet 4.5:1 contrast against its measured background",d.flatMap(e=>{let i=m(e.ink,e.background)??0;return i<k?[D(e,i,k)]:[]})));let G=[];for(let e=0;e<d.length;e+=1)for(let i=0;i<e;i+=1)y(d[e].screenBox,d[i].screenBox)&&G.push(g(d[i].objectId,d[i].text,d[e].objectId,d[e].text));n.push(o("free-text-collision","Visible chart text labels must not overlap each other",G));let O=[];for(let e of d)for(let i of l)y(e.screenBox,i.screenBox)&&O.push(g(e.objectId,e.text,i.seatId,i.label));n.push(o("free-text-bookable-collision","Visible chart text must not overlap bookable labels",O));let U=[];for(let e of d)for(let i of c)y(e.screenBox,i.screenBox)&&U.push(g(e.objectId,e.text,i.id,i.label));n.push(o("free-text-hierarchy-collision","Visible chart text must not overlap hierarchy labels",U)),n.push(o("ga-contrast-low","Visible GA surfaces must maintain 3:1 graphical contrast with the canvas",C.flatMap(e=>{let i=m(e.effectiveBackground,t.canvasBackground)??0;return i<T?[{primaryId:e.areaId,primaryLabel:e.label,measured:Math.round(i*100)/100,minimum:T}]:[]})));let j=n.filter(e=>!!e);return{version:ie,passed:j.length===0,state:a,targetCategoryKey:s,resolvedRules:["rendered-overview-label-size","rendered-overview-label-contrast","rendered-overview-label-collision","rendered-overview-hierarchy-viewport","rendered-overview-hierarchy-containment","rendered-overview-section-first-style","rendered-overview-ga-contrast",...a==="interaction"?["rendered-detail-label-viewport","rendered-detail-inventory","rendered-pointer-target","rendered-selected-held-taken-states","rendered-section-focus","rendered-category-filter"]:[]],viewport:t.viewport,canvasBackground:t.canvasBackground,effectiveScale:t.effectiveScale,rung:t.rung,inventory:{totalBookableUnits:t.totalBookableUnits,totalLabelledBookableUnits:t.totalLabelledBookableUnits,visibleBookableLabels:l.length,hiddenBookableLabels:t.hiddenLabels,visibleHierarchyLabels:c.length,visibleFreeTextLabels:d.length,visibleGAAreas:C.length},overviewStyle:t.overviewStyle,composition:{hierarchy:t.hierarchyLabels.filter(e=>e.role==="name").map(e=>({id:e.id,kind:e.kind,label:e.label,visible:e.visible})).sort((e,i)=>e.kind.localeCompare(i.kind)||e.id.localeCompare(i.id)),labelledObjects:t.freeTextLabels.map(e=>({objectId:e.objectId,kind:e.kind,text:e.text,visible:e.visible})).sort((e,i)=>e.objectId.localeCompare(i.objectId)||e.kind.localeCompare(i.kind)),gaAreas:t.gaAreas.map(e=>({areaId:e.areaId,label:e.label,categoryKey:e.categoryKey,...e.sectionId?{sectionId:e.sectionId}:{},visible:e.visible})).sort((e,i)=>e.areaId.localeCompare(i.areaId)),bookableSectionIds:[...new Set(t.labels.flatMap(e=>e.sectionId?[e.sectionId]:[]))].sort(),categoryKeys:[...new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)])].sort(),activeCategoryKeys:[...M].sort()},metrics:{minimumRenderedBookableLabelPx:p(l.map(e=>e.renderedFontPx)),minimumBookableLabelContrast:p(W),minimumRenderedHierarchyLabelPx:p(c.map(e=>e.renderedFontPx)),minimumHierarchyLabelContrast:p(X),minimumRenderedFreeTextPx:p(d.map(e=>e.renderedFontPx)),minimumFreeTextContrast:p(Y),minimumGAContrast:p(q),minimumEffectivePointerTargetPx:p(R.map(e=>e.pointerTarget.effectiveMinimumPx)),selectedRingContrast:S==null?null:Math.round(S*100)/100},interaction:{applicable:{detail:u.length>0||v.length>0,pointer:u.length>0||v.length>0,held:u.length>=2,booked:u.length>=3,sectionFocus:u.some(e=>!!e.sectionId)||v.some(e=>!!e.sectionId),categoryFilter:new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)]).size>=2},selectedUnits:h.length,heldUnits:x.length,bookedUnits:w.length,activePointerTargets:R.length,focusedSectionId:t.focusedSectionId,focusBackdropVisible:t.focusBackdropVisible,categoryFilterKeys:t.categoryFilterKeys},findings:j}}export{ie as a,$ as b,ae as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as g}from"./chunk-UEDS3HJ3.js";import{c as M,k as A,n as m,t as _}from"./chunk-JBOTRSMY.js";var F=7,G=10,x=10,h=.39,d=.8,I=.62;function v(t){let n=Math.min(Math.abs(t.width),Math.abs(t.height));if(!(n>0))return x;let e=Math.max(1,t.text.length),r=Math.abs(t.width)*d/(e*I);return Math.max(x,Math.min(n*h,r))}var w=15,K=11,X=12;function Y(t){return t.labelPresentation?.visible!==!1}function D(t){let n=t.labelPresentation?.labelStyle?.size;return typeof n=="number"&&Number.isFinite(n)?n:void 0}var U=.85,O=12,l=4.5,V=3,S=3,o="#000000",i="#ffffff",Z=24,B=18.67;function W(t,n=400){return t>=Z||n>=700&&t>=B?S:l}function $(t,n){return t*n>=O}var j=24,C={wheelchair:"M7.8 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM8 7L10.5 7L10.5 15L8 15ZM8 12.5L18 12.5L18 15L8 15ZM16 15L18 15L18 18L16 18ZM5.5 16a5.5 5.5 0 1 0 11 0a5.5 5.5 0 1 0 -11 0zM8 16a3 3 0 1 1 6 0a3 3 0 1 1 -6 0z",companion:"M5.5 6.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM4.5 18.5L6 11.5L11 11.5L12.5 18.5ZM12.5 7.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM11.5 19L13 12.5L18 12.5L19.5 19Z","semi-ambulatory":"M8.3 3.8a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM9 6.2L12 6.6L11 13.5L8.6 13L9 6.2ZM8.6 13L11 13L9.5 21L7 21ZM10.4 13L12.6 13L13.6 21L11.2 21ZM11.2 7.2L14 8L14.6 9.6L11.9 8.9ZM14.4 6.8L15.9 6.8L16.4 21L14.8 21Z","designated-aisle":"M3 5L6 5L6 14L3 14ZM3 12L13 12L13 15L3 15ZM5 15L7 15L7 20L5 20ZM11 15L13 15L13 20L11 20ZM13 7L20 7L17 4L19 4L23 8.5L19 13L17 13L20 10L13 10Z","step-free":"M4 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM4.4 7L7.5 7L7.5 13L11 15L9.5 17L5 14L4.4 7ZM2 19L8 19L17 10L22 10L22 13L18 13L10 21L2 21Z",hearing:"M15.5 3.5C9 2.2 5.5 6 5.5 11.5C5.5 16 8 19.5 10.5 21C13.2 22.6 16.4 20.8 15.4 18C14.8 16.4 12.9 16.1 13 14C13.1 11.9 15.8 11.4 15.8 8.5C15.8 5.4 13 4 15.5 3.5Z",cart:"M5.5 6L18.5 6a2.5 2.5 0 0 1 2.5 2.5L21 15.5a2.5 2.5 0 0 1 -2.5 2.5L11 18L7 20.5L7.5 18L5.5 18a2.5 2.5 0 0 1 -2.5 -2.5L3 8.5a2.5 2.5 0 0 1 2.5 -2.5zM6.5 11L17.5 11L17.5 12.6L6.5 12.6zM6.5 14L17.5 14L17.5 15.6L6.5 15.6z","sign-language":"M7 11L17 11L17 18a2 2 0 0 1 -2 2L9 20a2 2 0 0 1 -2 -2zM7.6 5L9.4 5L9.4 12L7.6 12zM9.9 3.5L11.7 3.5L11.7 12L9.9 12zM12.3 3.5L14.1 3.5L14.1 12L12.3 12zM14.6 5L16.4 5L16.4 12L14.6 12zM7.2 12.5L5 10.2L6.4 8.9L8.6 11.2Z","low-vision":"M2.5 12C6 6 18 6 21.5 12C18 18 6 18 2.5 12ZM9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM17.5 3L19 3L19 6L17.5 6ZM19 4L22 4L22 5.5L19 5.5Z","sensory-friendly":"M4 11C4 5 7 2.5 12 2.5S20 5 20 11L17 11C17 7 15.5 5.5 12 5.5S7 7 7 11ZM3 10L8 10L8 19L5 19a2 2 0 0 1 -2 -2ZM16 10L21 10L21 17a2 2 0 0 1 -2 2L16 19ZM9 12L15 12L15 14L9 14ZM10 16L14 16L14 18L10 18Z","plus-size":"M9.4 4.3a2.6 2.6 0 1 0 5.2 0a2.6 2.6 0 1 0 -5.2 0zM5 20L4 13C4 10.5 7 9.5 12 9.5C17 9.5 20 10.5 20 13L19 20Z","lift-armrest":"M5 6L8 6L8 19L5 19zM5 16L18 16L18 19L5 19zM8 12L17 12L17 14.5L8 14.5zM14 7L16 7L16 12L14 12zM12 7L18 7L15 3Z"},Q=C.wheelchair;function q(t){if(!t?.length)return null;let n=t.includes("wheelchair")?"wheelchair":t[0];return C[n]??null}function J(t,n){return n.colorblind?N(n.canvasBackground):g(t)}function t1(t){return/-(\d{1,5})$/.exec(t)?.[1]??t}var s=m;function n1(t,n,e){let r=M(t),a=M(n);if(!r||!a)return n;let L=Math.max(0,Math.min(1,e));return`#${r.map((c,p)=>Math.round(c*L+a[p]*(1-L))).map(c=>c.toString(16).padStart(2,"0")).join("")}`}var e1=3;function r1(t){let n=s(i,t)??0,e=s(o,t)??0;return n>=l?i:e>=l&&_(t)||_(t)?o:i}function N(t){return _(t)?o:i}function E(t,n,e=l){let r=s(n,t);if(r!=null&&r>=e)return n;let a=s(o,t)??0,L=s(i,t)??0;return a===0&&L===0?n:a>=L?o:i}function L1(t,n,e,r=l){return n??E(t,e,r)}var z=3;function o1(t){let n=s("#ffffff",t);if(n!=null&&n>=z)return"#ffffff";let e=s(o,t)??0,r=s(i,t)??0;return e===0&&r===0?"#ffffff":e>=r?o:i}var T=/^#[0-9a-f]{6}$/i;function k(t){let n=M(t);return n!=null&&A(n)>.5}var y="#e5e7eb",R="#273142";function i1(t){return k(t)?y:R}function s1(t,n,e=l){let r=T.test(t.trim()),a=t.trim().toLowerCase(),L=0,u=0,c=null;for(let b of n){if(!r||!T.test(b.trim()))continue;L+=1;let f=E(b,t,e);f.toLowerCase()!==a&&(u+=1,c=f)}return{total:L,overridden:u,status:L===0?"none":u===0?"applies":u===L?"overridden":"mixed",overrideInk:c}}export{F as a,G as b,x as c,h as d,v as e,w as f,K as g,X as h,Y as i,D as j,U as k,O as l,l as m,V as n,S as o,o as p,i as q,W as r,$ as s,j as t,C as u,Q as v,q as w,J as x,t1 as y,s as z,n1 as A,e1 as B,r1 as C,N as D,E,L1 as F,o1 as G,k as H,y as I,R as J,i1 as K,s1 as L};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var g="ABCDEFGHIJKLMNOPQRSTUVWXYZ",k="ABCDEFGHJKLMNPQRSTUVWXYZ",x="abcdefghijklmnopqrstuvwxyz";function p(e,t){let r=t.length,n=e+1,a="";for(;n>0;){n-=1;let i=n%r;a=t[i]+a,n=Math.floor(n/r)}return a}function y(e,t){let r=t.startAt-1,n=e+r;if(t.scheme==="numbers")return String(n+1);let a=t.skipAmbiguous?k:g;return p(n,a)}function l(e,t=!1){let r=t?x:g;return p(Math.max(0,Math.floor(e)-1),r)}var A=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function h(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),r="";for(let[n,a]of A)for(;t>=n;)r+=a,t-=n;return r}function j(e,t){let r=e.length;return e.map((n,a)=>{let i=t.reverse?r-1-a:a;return{...n,label:y(i,t)}})}function C(e){let t=new Array(e);return Array.from({length:e},(r,n)=>n).sort((r,n)=>Math.abs(2*r-(e-1))-Math.abs(2*n-(e-1))||r-n).forEach((r,n)=>t[r]=n),t}function m(e,t){let r=e.seatLabelStart??1,n=e.seatNumbering?.direction??"ltr",a=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",f=e.seatNumbering?.prefix??"",d=e.seatNumbering?.endAt,b=e.seatCount;if(i==="updown"||i==="updown-descending"){let o=Math.ceil(b/2),R=i==="updown"?t<o?r+2*t:r-1+2*(b-t):t<o?r+2*(o-1-t):r+1+2*(t-o);return`${f}${R}`}let L=i==="odd"||i==="even"?2:a,s=d!=null&&Number.isFinite(d)?d-(b-1)*L:r,c=n==="center"?C(b)[t]:n==="rtl"?b-1-t:t,u;switch(i){case"odd":{let o=s%2===1?s:s+1;u=String(o+c*2);break}case"even":{let o=s%2===0?s:s+1;u=String(o+c*2);break}case"roman":u=h(s+c*a);break;case"letters-upper":u=l(s+c*a,!1);break;case"letters-lower":u=l(s+c*a,!0);break;default:u=String(s+c*a);break}return`${f}${u}`}function O(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function B(e,t,r){return r?.label??`${e.seatLabelBase??e.label}-${m(e,t)}`}function E(e,t,r,n){if(n?.displayLabel)return n.displayLabel;if(e.seatDisplayLabelMode==="number")return m(e,t);if(!r)return`${e.displayLabel||e.label}-${m(e,t)}`;let a=O(r),i=r.displayOffset+t;return`${r.displayLabel}-${m(a,i)}`}var N=999,S=["clockwise","anticlockwise"],M=["table-number","number","letter"];function D(e,t){return`${e.label}-${t+1}`}function T(e,t,r){return e?.direction==="anticlockwise"?Math.max(0,t-1-r):r}function w(e,t){let r=e.chairNumbering,n=r?.start??1,a=T(r,Math.max(0,Math.round(e.seatCount)),t);return r?.format==="letter"?l(Math.max(1,n)+a):String(n+a)}function H(e,t){let r=w(e,t);return(e.chairNumbering?.format??"table-number")==="table-number"?`${e.displayLabel??e.label}-${r}`:r}function F(e){if(e===void 0)return null;if(!e||typeof e!="object"||Array.isArray(e))return"chairNumbering must be an object";let t=e,r=Object.keys(t).filter(n=>!["start","direction","format"].includes(n));return r.length?`chairNumbering has unsupported field(s): ${r.join(", ")}`:t.start!==void 0&&(!Number.isInteger(t.start)||t.start<0||t.start>N)?`chairNumbering.start must be a whole number from 0 to ${N}`:t.direction!==void 0&&!S.includes(t.direction)?"chairNumbering.direction must be clockwise or anticlockwise":t.format!==void 0&&!M.includes(t.format)?"chairNumbering.format must be table-number, number or letter":null}function X(e){let t={};return e.start!==void 0&&e.start!==1&&(t.start=e.start),e.direction==="anticlockwise"&&(t.direction="anticlockwise"),e.format&&e.format!=="table-number"&&(t.format=e.format),Object.keys(t).length?t:void 0}export{p as a,y as b,l as c,h as d,j as e,m as f,O as g,B as h,E as i,N as j,S as k,M as l,D as m,w as n,H as o,F as p,X as q};
|