@seatlayer/core 0.93.0 → 0.95.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dist/ar-ACDAWDG3.js +1 -0
  2. package/dist/be-MMLNJEJ2.js +1 -0
  3. package/dist/bg-ULTV77R3.js +1 -0
  4. package/dist/ca-2NRQWAFI.js +1 -0
  5. package/dist/{chunk-4I2VWFJY.js → chunk-F2EXXZSZ.js} +1 -1
  6. package/dist/{chunk-HC3U5BWH.js → chunk-LAX7F5ML.js} +1 -1
  7. package/dist/{chunk-ZFWHAKAI.js → chunk-LFJUXTIO.js} +1 -1
  8. package/dist/{chunk-ZDETFCDH.js → chunk-M7JA4BGP.js} +1 -1
  9. package/dist/{chunk-LVIAHZ4N.js → chunk-Q3MSDG4S.js} +1 -1
  10. package/dist/core/chart-ops/index.cjs +1 -1
  11. package/dist/core/chart-ops/index.d.cts +18 -3
  12. package/dist/core/chart-ops/index.d.ts +18 -3
  13. package/dist/core/chart-ops/index.js +1 -1
  14. package/dist/core/inventory/index.d.cts +2 -2
  15. package/dist/core/inventory/index.d.ts +2 -2
  16. package/dist/core/inventory/index.js +1 -1
  17. package/dist/core/layout/index.d.cts +2 -2
  18. package/dist/core/layout/index.d.ts +2 -2
  19. package/dist/core/quality/index.d.cts +2 -2
  20. package/dist/core/quality/index.d.ts +2 -2
  21. package/dist/core/quality/index.js +1 -1
  22. package/dist/core/sections/index.d.cts +1 -1
  23. package/dist/core/sections/index.d.ts +1 -1
  24. package/dist/cs-B3WL73W4.js +1 -0
  25. package/dist/cy-3EP6TX65.js +1 -0
  26. package/dist/da-YFCIQ5IW.js +1 -0
  27. package/dist/de-Y6HGIGLE.js +1 -0
  28. package/dist/el-7XNCC4HQ.js +1 -0
  29. package/dist/es-HOHSNNC5.js +1 -0
  30. package/dist/et-4XG3F3L2.js +1 -0
  31. package/dist/fa-LGZETRFZ.js +1 -0
  32. package/dist/fi-EJ7WAJ6Y.js +1 -0
  33. package/dist/fr-2AYVLJIX.js +1 -0
  34. package/dist/he-AW5ARPXB.js +1 -0
  35. package/dist/hr-TWJE7W7B.js +1 -0
  36. package/dist/hu-RJSTAAQ7.js +1 -0
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.d.cts +34 -17
  39. package/dist/index.d.ts +34 -17
  40. package/dist/index.js +1 -1
  41. package/dist/it-CMJGPQEI.js +1 -0
  42. package/dist/ja-ADBJEN56.js +1 -0
  43. package/dist/ku-EUUAH5EO.js +1 -0
  44. package/dist/localeLoaders-E6HOKVNP.js +1 -0
  45. package/dist/lt-5IPKKDZP.js +1 -0
  46. package/dist/lv-6D3FN6DH.js +1 -0
  47. package/dist/nl-QVZAZWDH.js +1 -0
  48. package/dist/no-PEVS2KFB.js +1 -0
  49. package/dist/pl-ZZFOX74N.js +1 -0
  50. package/dist/pt-NKA7SU2B.js +1 -0
  51. package/dist/{renderedQuality-D5G1fHtR.d.ts → renderedQuality-BrCnk3-x.d.ts} +1 -1
  52. package/dist/{renderedQuality-DThBK6x4.d.cts → renderedQuality-CXlWvz_l.d.cts} +1 -1
  53. package/dist/{renderer-B7IrAGHP.d.ts → renderer-DbnKKo5K.d.ts} +100 -1
  54. package/dist/{renderer-BePADdjE.d.cts → renderer-fetXkaDe.d.cts} +100 -1
  55. package/dist/ro-NMCKGNBF.js +1 -0
  56. package/dist/ru-HPOD5UXT.js +1 -0
  57. package/dist/sk-GRJUAHE4.js +1 -0
  58. package/dist/sl-WZMICIEW.js +1 -0
  59. package/dist/sr-5DMHZCZI.js +1 -0
  60. package/dist/sv-G3NNXEWJ.js +1 -0
  61. package/dist/{tableSizing-DmZYe2v2.d.ts → tableSizing-CPYpm4iH.d.ts} +1 -1
  62. package/dist/{tableSizing-Blb9Z_Tt.d.cts → tableSizing-DKo6Zlt_.d.cts} +1 -1
  63. package/dist/{ticketRestrictions-5qEU-1eK.d.cts → ticketRestrictions-CEgj821Q.d.cts} +1 -1
  64. package/dist/{ticketRestrictions-rrajqzOB.d.ts → ticketRestrictions-le9Yoa10.d.ts} +1 -1
  65. package/dist/tr-HJ2KMOJD.js +1 -0
  66. package/dist/uk-FVJDE2SG.js +1 -0
  67. package/dist/view3d/index.d.cts +1 -1
  68. package/dist/view3d/index.d.ts +1 -1
  69. package/dist/view3d/index.js +1 -1
  70. package/dist/view3d/scene/scene.worker.js +1 -1
  71. package/dist/zh-Hans-HPO7O27I.js +1 -0
  72. package/dist/zh-Hant-55X4MZZC.js +1 -0
  73. package/package.json +1 -1
  74. package/dist/ar-ALH3NJ5S.js +0 -1
  75. package/dist/be-L2ARGVAN.js +0 -1
  76. package/dist/bg-7664YNCK.js +0 -1
  77. package/dist/ca-FAFWDJLI.js +0 -1
  78. package/dist/cs-X2R3ZSIS.js +0 -1
  79. package/dist/cy-TZAP42PI.js +0 -1
  80. package/dist/da-TXXYTHRV.js +0 -1
  81. package/dist/de-QTBBGD7H.js +0 -1
  82. package/dist/el-D5FP7YYV.js +0 -1
  83. package/dist/es-WBASDRVC.js +0 -1
  84. package/dist/et-DI4AFGPJ.js +0 -1
  85. package/dist/fa-475UAFRJ.js +0 -1
  86. package/dist/fi-VLWI3PVM.js +0 -1
  87. package/dist/fr-RIEQP5R4.js +0 -1
  88. package/dist/he-LMIQFGT5.js +0 -1
  89. package/dist/hr-HWWXJXMT.js +0 -1
  90. package/dist/hu-EGRPKEMV.js +0 -1
  91. package/dist/it-QU2BONLV.js +0 -1
  92. package/dist/ja-GTPGN7AW.js +0 -1
  93. package/dist/ku-Q3XMN7GH.js +0 -1
  94. package/dist/localeLoaders-X2DDK7KL.js +0 -1
  95. package/dist/lt-ZGTEWYU4.js +0 -1
  96. package/dist/lv-3SV4YW2L.js +0 -1
  97. package/dist/nl-ALCHLVP2.js +0 -1
  98. package/dist/no-WRBQJCLX.js +0 -1
  99. package/dist/pl-4G6VEQZ3.js +0 -1
  100. package/dist/pt-OLA6ELAW.js +0 -1
  101. package/dist/ro-H5GU4DVI.js +0 -1
  102. package/dist/ru-BM3TYI5V.js +0 -1
  103. package/dist/sk-VU45GJYV.js +0 -1
  104. package/dist/sl-SYNAWIPU.js +0 -1
  105. package/dist/sr-6ZNE7HDN.js +0 -1
  106. package/dist/sv-52BO3IXQ.js +0 -1
  107. package/dist/tr-SZJCCTGR.js +0 -1
  108. package/dist/uk-OSWQK4LA.js +0 -1
  109. package/dist/zh-Hans-JK2SPHB6.js +0 -1
  110. package/dist/zh-Hant-BYGBT56E.js +0 -1
@@ -1 +1 @@
1
- import{c as De}from"./chunk-TKYTTEJ2.js";import{B as He,a as Ge,c as Ve,h as pe,i as Qe,o as qe,x as he}from"./chunk-HC3U5BWH.js";import{i as We,k as Ze,l as Je,m as ve,q as Ie}from"./chunk-TQN2VWQO.js";import{o as _e}from"./chunk-5BMXWOE7.js";import{b as re,c as be,e as Ke,g as Be}from"./chunk-CEIVHWRB.js";import{b as Xe,e as G,i as Ye}from"./chunk-M5X6G7FD.js";import{c as H}from"./chunk-4I2VWFJY.js";import{A as Te,B as ue,Ba as B,Ca as Ne,Fa as Z,Ja as J,La as ie,M as ne,Na as me,P as Ee,Q as Re,b as de,e as ke,ea as fe,fa as X,ga as Y,ha as W,ia as ye,ja as ge,ka as Me,na as Fe,q as At,r as Tt,s as Et,t as Rt,u as Lt,v as Mt,w as Oe,x as Ft,y as Pt,z as Ae,za as Pe}from"./chunk-F7TP67LK.js";import{h as Le}from"./chunk-5ITK5236.js";import{a as ze,i as Ue,n as N}from"./chunk-JBOTRSMY.js";var we=[{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 et(e){return e.floors?.length?e.floors:[{id:"floor-0",objects:e.objects}]}function Nt(e){return we.find(o=>o.key===e)}function se(e){let o=new Map,i=Math.max(0,Math.floor(e.seatCount)),n=new Map((e.overrides??[]).filter(s=>Number.isInteger(s.index)&&s.index>=0&&s.index<e.seatCount).map(s=>[s.index,s])),r=(s,y=1)=>{s&&y>0&&o.set(s,(o.get(s)??0)+y)};r(e.categoryKey,i-n.size);for(let s of n.values())s.skip||r(s.categoryKey??e.categoryKey);return o}function _t(e){return e.type==="row"||e.type==="table"?[...se(e).keys()]:e.type==="booth"?e.categoryKey?[e.categoryKey]:[]:e.type==="gaArea"?e.capacity>0&&e.categoryKey?[e.categoryKey]:[]:[]}function tt(e){return we.find(o=>o.objectType===e.type)??null}function ot(e){return e.type==="row"||e.type==="table"||e.type==="booth"||e.type==="gaArea"}function ae(e){let o=new Map;for(let r of et(e))for(let s of r.objects){if(!ot(s))continue;let y=tt(s);for(let f of _t(s)){let m=o.get(f)??new Map,a=m.get(y.key)??[];if(!a.some(u=>u.id===s.id)){let u=s.displayLabel||s.label||s.id;a.push({id:s.id,label:u,type:y.objectType,floorId:r.id})}m.set(y.key,a),o.set(f,m)}}let i=new Map(e.categories.map(r=>[r.key,r.label]));return[...e.categories.map(r=>r.key),...[...o.keys()].filter(r=>!i.has(r)).sort()].flatMap(r=>{let s=o.get(r);if(!s||s.size<2)return[];let y=we.flatMap(f=>{let m=s.get(f.key);return m?.length?[{family:f.key,label:f.label,objectType:f.objectType,targets:m}]:[]});return[{categoryKey:r,categoryLabel:i.get(r)??r,families:y,objectIds:[...new Set(y.flatMap(f=>f.targets.map(m=>m.id)))]}]})}function nt(e){let o=e.families.map(i=>`${i.label} (${i.targets.map(n=>n.label).join(", ")})`).join(" and ");return`Category \u201C${e.categoryLabel}\u201D is used by more than one kind of inventory: ${o}. Each category can belong to only one kind. Use the safe split to separate them (prices, ticket tiers, accessibility, and provenance are preserved).`}function it(e){return e.normalize("NFKC").trim().toLocaleLowerCase("en")}function Dt(e,o,i){for(let n=1;n<=1e4;n+=1){let r=n===1?`--${o}`:`--${o}-${n}`,y=`${e.slice(0,Math.max(1,160-r.length))}${r}`;if(!i.has(y))return i.add(y),y}throw new Error(`Unable to allocate a category key for ${e} (${o})`)}function Kt(e,o,i){for(let n=1;n<=1e4;n+=1){let r=n===1?` (${o})`:` (${o} ${n})`,y=`${e.normalize("NFKC").trim().slice(0,Math.max(1,80-r.length)).trimEnd()}${r}`,f=it(y);if(!i.has(f))return i.add(f),y}throw new Error(`Unable to allocate a category label for ${e} (${o})`)}function Bt(e,o,i,n){let r=Nt(o);return{...structuredClone(e),key:Dt(e.key,r.suffix,i),label:Kt(e.label,r.labelSuffix,n)}}function zt(e,o,i){let n=[];for(let r of et(e))for(let s of r.objects){if(!ot(s))continue;let y=tt(s),f=i.get(y.key);if(!(!f||f===o))if(s.type==="row"||s.type==="table"){let m=[];s.categoryKey===o&&(s.categoryKey=f);for(let a of s.overrides??[])a.categoryKey===o&&(a.categoryKey=f,m.push(a.index));(s.categoryKey===f||m.length)&&n.push({family:y.key,floorId:r.id,objectId:s.id,objectType:y.objectType,fromCategoryKey:o,toCategoryKey:f,...m.length?{seatOverrideIndices:m.sort((a,u)=>a-u)}:{}})}else s.categoryKey===o&&(s.categoryKey=f,n.push({family:y.key,floorId:r.id,objectId:s.id,objectType:y.objectType,fromCategoryKey:o,toCategoryKey:f}))}return n}function rt(e){let o=structuredClone(e),i=ae(o);if(!i.length)return{doc:o,changed:!1,changes:[],before:i,after:i};let n=new Set(o.categories.map(f=>f.key)),r=new Set(o.categories.map(f=>it(f.label))),s=[];for(let f of i){let m=o.categories.findIndex(I=>I.key===f.categoryKey);if(m<0)continue;let a=o.categories[m],u=f.families[0].family,g=new Map([[u,a.key]]),b=f.families.slice(1).map(I=>{let $=Bt(a,I.family,n,r);return g.set(I.family,$.key),{family:I.family,key:$.key,label:$.label,category:$}});o.categories.splice(m+1,0,...b.map(I=>I.category));let p=zt(o,a.key,g);s.push({categoryKey:a.key,categoryLabel:a.label,retainedFamily:u,clones:b.map(({family:I,key:$,label:w})=>({family:I,key:$,label:w})),reassignments:p})}o.floors?.length&&(o.objects=o.floors[0].objects);let y=ae(o);return{doc:o,changed:s.length>0,changes:s,before:i,after:y}}function xo(e){let o=(e%360+360)%360,i=o>=180?o-360:o;return Object.is(i,-0)||Math.abs(i)<1e-9?0:i}function Ut(e,o){return Math.abs(e.x-o.x)<=1e-7&&Math.abs(e.y-o.y)<=1e-7}function ee(e,o,i){return(o.x-e.x)*(i.y-e.y)-(o.y-e.y)*(i.x-e.x)}function ce(e,o,i){let n=ee(o,i,e);return Math.abs(n)>1e-7?!1:e.x>=Math.min(o.x,i.x)-1e-7&&e.x<=Math.max(o.x,i.x)+1e-7&&e.y>=Math.min(o.y,i.y)-1e-7&&e.y<=Math.max(o.y,i.y)+1e-7}function Gt(e,o,i,n){let r=ee(e,o,i),s=ee(e,o,n),y=ee(i,n,e),f=ee(i,n,o);return(r>1e-7&&s<-1e-7||r<-1e-7&&s>1e-7)&&(y>1e-7&&f<-1e-7||y<-1e-7&&f>1e-7)?!0:Math.abs(r)<=1e-7&&ce(i,e,o)||Math.abs(s)<=1e-7&&ce(n,e,o)||Math.abs(y)<=1e-7&&ce(e,i,n)||Math.abs(f)<=1e-7&&ce(o,i,n)}function Vt(e){return e.reduce((o,i,n)=>{let r=e[(n+1)%e.length];return o+i.x*r.y-r.x*i.y},0)}function Qt(e){for(let o=0;o<e.length;o+=1){let i=(o+1)%e.length;for(let n=o+1;n<e.length;n+=1){let r=(n+1)%e.length;if(!(o===n||i===n||r===o)&&Gt(e[o],e[i],e[n],e[r]))return!0}}return!1}function at(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(o=>!Number.isFinite(o.x)||!Number.isFinite(o.y)||Math.abs(o.x)>1e7||Math.abs(o.y)>1e7)?{ok:!1,code:"invalid_coordinate",message:"Every polygon vertex must use a finite coordinate inside the safe chart range."}:e.some((o,i)=>Ut(o,e[(i+1)%e.length]))?{ok:!1,code:"duplicate_vertex",message:"Move or remove duplicate neighbouring vertices."}:Math.abs(Vt(e))<2?{ok:!1,code:"degenerate_polygon",message:"The polygon needs a visible enclosed area."}:Qt(e)?{ok:!1,code:"self_intersection",message:"Polygon edges cannot cross or touch each other."}:{ok:!0}}function U(e){return e.length>=3&&e.every(o=>Number.isFinite(o.x)&&Number.isFinite(o.y))}function V(e,o,i){let n=(e.y-o.y)*(i.x-o.x)-(e.x-o.x)*(i.y-o.y);if(Math.abs(n)>1e-7)return!1;let r=(e.x-o.x)*(i.x-o.x)+(e.y-o.y)*(i.y-o.y);if(r<-1e-7)return!1;let s=(i.x-o.x)**2+(i.y-o.y)**2;return r<=s+1e-7}function Q(e,o){let i=!1;for(let n=0,r=o.length-1;n<o.length;r=n++){let s=o[r],y=o[n];if(V(e,s,y))return!0;s.y>e.y!=y.y>e.y&&e.x<(y.x-s.x)*(e.y-s.y)/(y.y-s.y)+s.x&&(i=!i)}return i}function z(e,o,i){return(o.x-e.x)*(i.y-e.y)-(o.y-e.y)*(i.x-e.x)}function ct(e,o,i,n){let r=z(e,o,i),s=z(e,o,n),y=z(i,n,e),f=z(i,n,o);return(r>1e-7&&s<-1e-7||r<-1e-7&&s>1e-7)&&(y>1e-7&&f<-1e-7||y<-1e-7&&f>1e-7)?!0:Math.abs(r)<=1e-7&&V(i,e,o)||Math.abs(s)<=1e-7&&V(n,e,o)||Math.abs(y)<=1e-7&&V(e,i,n)||Math.abs(f)<=1e-7&&V(o,i,n)}function q(e){for(let o=0;o<e.length;o+=1){let i=(o+1)%e.length;for(let n=o+1;n<e.length;n+=1){let r=(n+1)%e.length;if(!(o===n||i===n||r===o)&&ct(e[o],e[i],e[n],e[r]))return!0}}return!1}function te(e,o){for(let i=0;i<e.length;i+=1)for(let n=0;n<o.length;n+=1)if(ct(e[i],e[(i+1)%e.length],o[n],o[(n+1)%o.length]))return!0;return Q(e[0],o)||Q(o[0],e)}function st(e,o){return!o.some((i,n)=>V(e,i,o[(n+1)%o.length]))&&Q(e,o)}function lt(e){let o=e.outlinePath;if(!o?.segments.length)return;let i=s=>Number.isFinite(s.x)&&Number.isFinite(s.y),n=(s,y)=>Math.hypot(s.x-y.x,s.y-y.y);if(!i(o.start))return 0;let r=o.start;for(let s=0;s<o.segments.length;s++){let y=o.segments[s];if(!y||!i(y.end)||n(r,y.end)<=1e-9||y.kind==="bezier"&&(!i(y.control1)||!i(y.control2)))return s;if(y.kind==="arc"){if(!i(y.center)||!Number.isFinite(y.radius)||y.radius<=1e-6)return s;let f=Math.max(1e-4,y.radius*1e-4);if(Math.abs(n(r,y.center)-y.radius)>f||Math.abs(n(y.end,y.center)-y.radius)>f)return s}r=y.end}return n(r,o.start)>1e-4,o.segments.length-1}function qt(e,o,i,n){let r=z(e,o,i),s=z(e,o,n),y=z(i,n,e),f=z(i,n,o);return(r>1e-7&&s<-1e-7||r<-1e-7&&s>1e-7)&&(y>1e-7&&f<-1e-7||y<-1e-7&&f>1e-7)}function dt(e,o){for(let i=0;i<e.length;i+=1)for(let n=0;n<o.length;n+=1)if(qt(e[i],e[(i+1)%e.length],o[n],o[(n+1)%o.length]))return!0;return e.some(i=>st(i,o))||o.some(i=>st(i,e))}function ut(e){return e.role!=="reference-focal"||!e.points||!U(e.points)?null:e.points}function yt(e,o){if(e.displayLabel!==void 0){let i=e.displayLabel.normalize("NFKC").trim();!(e.type==="row"&&e.displayLabel==="")&&(!i||i!==e.displayLabel||i.length>80)&&o.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 i=e.displayType.normalize("NFKC").trim();(!i||i!==e.displayType||i.length>24)&&o.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})}}function ft(e,o,i,n){let r=e.crop,s=r&&(!Number.isFinite(r.x)||!Number.isFinite(r.y)||!Number.isFinite(r.width)||!Number.isFinite(r.height)||r.x<0||r.y<0||r.width<=0||r.height<=0||r.x+r.width>1.000001||r.y+r.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)||s)&&i.push({severity:"error",code:"invalid-background-placement",message:`The ${o} image has an invalid position, size, opacity, rotation, or crop`,...n?{floorId:n}:{}})}function Se(e,o,i,n){let r=e.referenceImage,s=e.backgroundImage;r&&(ft(r,"reference",o,n),!r.assetId&&!r.url&&o.push({severity:"error",code:"invalid-reference-image",message:"A trace reference must identify a private asset or self-contained image",...n?{floorId:n}:{}})),s&&(ft(s,s.assetId?"legacy reference":"buyer background",o,n),!s.assetId&&!s.url&&o.push({severity:"error",code:"invalid-buyer-background",message:"A buyer background must contain a renderable image URL",...n?{floorId:n}:{}}),s.assetId&&i.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",...n?{floorId:n}:{}})),_e(e)&&o.push({severity:"error",code:"conflicting-reference-images",message:"The canonical reference and legacy asset-backed background identify different private sources",...n?{floorId:n}:{}})}function oe(e){let o=new Set(H.map(i=>i.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(i=>!!i.trim()&&i.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<=H.length&&new Set(e.accessibility.counts.map(i=>i.type)).size===e.accessibility.counts.length&&e.accessibility.counts.every(i=>o.has(i.type)&&Number.isInteger(i.count)&&i.count>0&&["user-confirmed","authoritative-source"].includes(i.evidence)&&!!i.sourceDescription.trim()&&i.sourceDescription.trim().length<=240))}function gt(e){let o=e.referenceInventoryExclusion;return!o||typeof o.assetId=="string"&&/^ref_[0-9a-f-]{36}$/.test(o.assetId)&&o.assetId===e.referenceSource?.assetId&&typeof o.logicalSectionId=="string"&&o.logicalSectionId===(e.logicalSectionId??e.id)&&typeof o.reason=="string"&&!!o.reason.trim()&&o.reason.trim().length<=80&&["user-confirmed","authoritative-source"].includes(o.evidence)&&typeof o.sourceDescription=="string"&&!!o.sourceDescription.trim()&&o.sourceDescription.trim().length<=240}function mt(e){let o=e.referenceCategorySource;return!o||/^ref_[0-9a-f-]{36}$/.test(o.assetId)&&/^#[0-9a-f]{6}$/i.test(o.sourceColor)&&(o.sourceColors===void 0||o.sourceColors.length>0&&o.sourceColors.includes(o.sourceColor)&&new Set(o.sourceColors).size===o.sourceColors.length&&o.sourceColors.every(i=>/^#[0-9a-f]{6}$/i.test(i)&&`${i[1]}${i[3]}${i[5]}`.toLowerCase()===`${o.sourceColor[1]}${o.sourceColor[3]}${o.sourceColor[5]}`.toLowerCase()))&&(o.logicalSectionIds===void 0||o.logicalSectionIds.length>0&&new Set(o.logicalSectionIds).size===o.logicalSectionIds.length&&o.logicalSectionIds.every(i=>!!i.trim()&&i.length<=160))&&(o.assignmentDerivation===void 0||["source-color-class","confirmed-logical-sections"].includes(o.assignmentDerivation))&&o.assignmentEvidence===void 0==!o.assignmentSourceDescription?.trim()&&(o.assignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(o.assignmentEvidence))&&(o.assignmentSourceDescription?.trim().length??0)<=240&&(o.assignmentDerivation!=="confirmed-logical-sections"||o.assignmentEvidence!==void 0&&!!o.assignmentSourceDescription?.trim())&&o.sourcePaletteColor===void 0==(o.sourcePaletteColorEvidence===void 0)&&o.sourcePaletteColorEvidence===void 0==!o.sourcePaletteColorSourceDescription?.trim()&&(o.sourcePaletteColor===void 0||/^#[0-9a-f]{6}$/i.test(o.sourcePaletteColor))&&(o.sourcePaletteColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(o.sourcePaletteColorEvidence))&&(o.sourcePaletteColorSourceDescription?.trim().length??0)<=240&&["user-confirmed","authoritative-source"].includes(o.labelEvidence)&&!!o.labelSourceDescription.trim()&&o.labelSourceDescription.trim().length<=240&&e.price!==void 0&&["user-confirmed","authoritative-source"].includes(o.priceEvidence)&&!!o.priceSourceDescription.trim()&&o.priceSourceDescription.trim().length<=240&&o.outputColorEvidence===void 0==!o.outputColorSourceDescription?.trim()&&(o.outputColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(o.outputColorEvidence))&&(o.outputColorSourceDescription?.trim().length??0)<=240&&(e.color.toLowerCase()===(o.sourcePaletteColor??o.sourceColor).toLowerCase()&&new Set((o.sourceColors??[o.sourceColor]).map(i=>`${i[1]}${i[3]}${i[5]}`.toLowerCase())).size===1||o.outputColorEvidence!==void 0&&["user-confirmed","authoritative-source"].includes(o.outputColorEvidence))}function bt(e){let o=e.referenceDirectSeatImport;return!o||/^ref_[0-9a-f-]{36}$/.test(o.assetId)&&/^source-color:(?:#[0-9a-f]{6}(?:\+#[0-9a-f]{6})*|unclassified)$/i.test(o.familyId)}function pt(e,o){let i=e.floors?.length?e.floors.map(s=>({id:s.id,objects:s.objects})):[{id:"floor-0",objects:e.objects}],n=new Map,r=new Map;for(let s of i){let y=s.objects.filter(a=>a.type==="row"),f=new Map,m=new Map;for(let a of y){if(a.segmentedRow){let u=f.get(a.segmentedRow.groupId)??[];u.push(a),f.set(a.segmentedRow.groupId,u)}if(a.rowBlockGeneration){let u=m.get(a.rowBlockGeneration.groupId)??[];u.push(a),m.set(a.rowBlockGeneration.groupId,u)}a.segmentedRow&&a.rowBlockGeneration&&o.push({severity:"error",code:"invalid-row-group-membership",message:`Row "${a.label}" cannot be both a segmented-row component and a generated row-block member`,objectId:a.id,floorId:s.id})}for(let[a,u]of f){let g=n.get(a);g&&g!==s.id&&o.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${a}" cannot span multiple floors`,objectId:u[0].id,floorId:s.id}),n.set(a,s.id);let b=u.slice().sort((j,O)=>j.segmentedRow.componentIndex-O.segmentedRow.componentIndex),p=b[0]?.segmentedRow,I=p?.componentCount??0,$=p?JSON.stringify({displayLabel:p.displayLabel,repeatLabelOnComponents:p.repeatLabelOnComponents,displayType:p.displayType,labelPresentation:p.labelPresentation,viewFromSeatUrl:p.viewFromSeatUrl,viewFromSeatMeta:p.viewFromSeatMeta,confidenceEvidence:p.confidenceEvidence,smoothing:p.smoothing}):"";p&&I>=2&&I<=64&&b.length===I&&p.boundaryBefore==="start"&&b.every((j,O)=>{let C=j.segmentedRow;return C.kind==="segmented-row-v1"&&C.groupId===a&&C.componentCount===I&&C.componentIndex===O&&(O===0?C.boundaryBefore==="start":C.boundaryBefore!=="start")&&C.displayLabel.normalize("NFKC").trim()===C.displayLabel&&C.displayLabel.length>0&&C.displayLabel.length<=80&&JSON.stringify({displayLabel:C.displayLabel,repeatLabelOnComponents:C.repeatLabelOnComponents,displayType:C.displayType,labelPresentation:C.labelPresentation,viewFromSeatUrl:C.viewFromSeatUrl,viewFromSeatMeta:C.viewFromSeatMeta,confidenceEvidence:C.confidenceEvidence,smoothing:C.smoothing})===$})||o.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${a}" has missing, duplicated, cyclic, or inconsistent component metadata`,objectId:u[0]?.id,floorId:s.id})}for(let[a,u]of m){let g=r.get(a);g&&g!==s.id&&o.push({severity:"error",code:"invalid-row-block-generation",message:"A generated row block cannot span multiple floors",objectId:u[0].id,floorId:s.id}),r.set(a,s.id)}}}function Ht(e){return e.type==="row"||e.type==="table"||e.type==="booth"}function Xt(e){let o=[],i=new Map((e.overrides??[]).map(n=>[n.index,n]));for(let n=0;n<e.seatCount;n++){let r=i.get(n);r?.skip||o.push({label:Le(e,n,r),index:n})}return o}function ht(e){let o=[],i=new Map((e.overrides??[]).map(n=>[n.index,n]));for(let n=0;n<e.seatCount;n++){let r=i.get(n);r?.skip||o.push({label:r?.label??`${e.label}-${n+1}`,index:n})}return o}function xe(e){return Array.isArray(e)&&e.every(o=>!!o&&typeof o=="object")}function vt(e){return Array.isArray(e)&&e.every(o=>Array.isArray(o)&&o.every(i=>!!i&&typeof i=="object"))}function It(e,o={}){let i=o.maxInventory??1e5,n=[];e.floorOverview!==void 0&&e.floorOverview!=="combined"&&e.floorOverview!=="separated"&&n.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)&&n.push({severity:"error",code:"invalid-event-configuration",message:"Active event configuration must contain 1 to 100 normalized characters"});let r=[],s=new Set(e.categories.map(t=>t.key)),y=new Set(H.map(t=>t.key)),f=new Map(e.categories.map(t=>[t.key,t.price!=null||t.notForSale===!0])),m=new Set;Se(e,n,r),e.theme?.sectionDetail!==void 0&&!["rows","seats"].includes(e.theme.sectionDetail)&&n.push({severity:"error",code:"invalid-section-detail",message:"Section detail must be rows or seats"}),e.theme?.logoUrl!==void 0&&!de(e.theme.logoUrl)&&n.push({severity:"error",code:"invalid-theme-logo-url",message:"The buyer-facing theme logo URL is invalid"});let a=de,u=(t,x,c,l={})=>{if(x===void 0)return;if(!x||typeof x!="object"||Array.isArray(x)){n.push({severity:"error",code:"invalid-seat-view-metadata",message:`${c} view metadata is invalid`,...l});return}let d=x;t||r.push({severity:"warning",code:"orphaned-seat-view-metadata",message:`${c} view metadata has no image`,...l});let v=new Set(["exact-seat","row-representative","section-representative","floor-representative","venue-representative"]);d.projection!==void 0&&d.projection!=="equirectangular"&&n.push({severity:"error",code:"invalid-seat-view-projection",message:`${c} view projection must be equirectangular`,...l}),d.coverage!==void 0&&!v.has(d.coverage)&&n.push({severity:"error",code:"invalid-seat-view-coverage",message:`${c} view coverage is invalid`,...l});let h=(S,k,A)=>typeof S=="number"&&Number.isFinite(S)&&S>=k&&S<=A;if(d.initialBearingDeg!==void 0&&!h(d.initialBearingDeg,-360,360)&&n.push({severity:"error",code:"invalid-seat-view-bearing",message:`${c} view bearing must be between -360\xB0 and 360\xB0`,...l}),d.initialPitchDeg!==void 0&&!h(d.initialPitchDeg,-90,90)&&n.push({severity:"error",code:"invalid-seat-view-pitch",message:`${c} view pitch must be between -90\xB0 and 90\xB0`,...l}),d.capturedAt!==void 0&&(typeof d.capturedAt!="string"||d.capturedAt.length>40||!Number.isFinite(Date.parse(d.capturedAt)))&&n.push({severity:"error",code:"invalid-seat-view-capture-date",message:`${c} view capture date is invalid`,...l}),d.sourceLabel!==void 0&&(typeof d.sourceLabel!="string"||d.sourceLabel.trim().length>100)&&n.push({severity:"error",code:"invalid-seat-view-source",message:`${c} view source label is invalid`,...l}),d.previewUrl!==void 0&&!a(d.previewUrl)&&n.push({severity:"error",code:"invalid-seat-view-preview-url",message:`${c} view preview URL is invalid`,...l}),d.variants!==void 0){let S=Array.isArray(d.variants)?d.variants:[];if(!Array.isArray(d.variants)||S.length<1||S.length>4)n.push({severity:"error",code:"invalid-seat-view-variants",message:`${c} view variants must contain between 1 and 4 tiers`,...l});else{let k=new Set;for(let A of S){if(!A||typeof A!="object"||!a(A.url)||!Number.isInteger(A.width)||A.width<1||A.width>12e3||!Number.isInteger(A.height)||A.height<1||A.height>12e3||A.width!==A.height*2||typeof A.sha256!="string"||!/^[a-f0-9]{64}$/.test(A.sha256)||k.has(A.width)){n.push({severity:"error",code:"invalid-seat-view-variant",message:`${c} view variant is not a unique immutable 2:1 equirectangular tier`,...l});break}k.add(A.width)}}}for(let[S,k]of[["width",d.sourceWidth],["height",d.sourceHeight],["preview width",d.previewWidth],["preview height",d.previewHeight]])k!==void 0&&(!Number.isInteger(k)||k<1||k>32768)&&n.push({severity:"error",code:"invalid-seat-view-dimensions",message:`${c} view source ${S} is invalid`,...l});d.captureEyeHeightM!==void 0&&!h(d.captureEyeHeightM,.5,3)&&n.push({severity:"error",code:"invalid-seat-view-eye-height",message:`${c} capture eye height must be between 0.5 m and 3 m`,...l}),d.eventConfigurationId!==void 0&&(typeof d.eventConfigurationId!="string"||!d.eventConfigurationId.trim()||d.eventConfigurationId.length>100)&&n.push({severity:"error",code:"invalid-seat-view-configuration",message:`${c} event configuration id is invalid`,...l}),d.eventConfigurationVersion!==void 0&&(!Number.isInteger(d.eventConfigurationVersion)||d.eventConfigurationVersion<1)&&n.push({severity:"error",code:"invalid-seat-view-configuration-version",message:`${c} event configuration version is invalid`,...l}),d.eventConfigurationVersion!==void 0&&!d.eventConfigurationId&&n.push({severity:"error",code:"invalid-seat-view-configuration-pin",message:`${c} event configuration version requires an id`,...l})},g=(t,x,c={})=>{if(t===void 0)return;let l=k=>{n.push({severity:"error",code:"invalid-seat-confidence-evidence",message:`${x} confidence evidence ${k}`,...c})};if(!t||typeof t!="object"||Array.isArray(t)){l("is invalid");return}let d=t;d.schema!=="seatlayer.seat-confidence/1"&&l("has an unsupported schema");let v=(k,A)=>typeof k=="string"&&k.normalize("NFKC").trim()===k&&k.length>0&&k.length<=A;v(d.evidenceId,120)||l("has an invalid evidence id"),v(d.modelVersion,120)||l("has an invalid model version"),new Set(["synthetic-model","organizer-approved","calibrated-provider"]).has(d.evidenceKind)||l("has an invalid evidence kind"),new Set(["generated","geometry-verified","configuration-verified"]).has(d.modelLevel)||l("has an invalid model level");let h=d.realityLevel??"none";new Set(["none","comparable-build-reference","actual-build-checked"]).has(h)||l("has an invalid reality level"),d.eventConfigurationId!==void 0&&!v(d.eventConfigurationId,100)&&l("has an invalid event configuration id"),d.eventConfigurationVersion!==void 0&&(!Number.isInteger(d.eventConfigurationVersion)||d.eventConfigurationVersion<1)&&l("has an invalid event configuration version"),d.status!==void 0&&!new Set(["draft","approved","retracted"]).has(d.status)&&l("has an invalid publication status"),d.basisSha256!==void 0&&!/^[a-f0-9]{64}$/.test(d.basisSha256)&&l("has an invalid venue basis SHA-256"),d.basisSha256!==void 0&&d.status!=="approved"&&l("can carry a venue basis SHA-256 only after approval");for(let[k,A]of[["assessment",d.assessedAt],["expiry",d.validUntil]])A!==void 0&&(!v(A,40)||!Number.isFinite(Date.parse(A)))&&l(`has an invalid ${k} date`);d.approvedByRole!==void 0&&!v(d.approvedByRole,100)&&l("has an invalid approving organization or role"),d.sourceLabel!==void 0&&!v(d.sourceLabel,120)&&l("has an invalid source label"),d.limitations!==void 0&&(!Array.isArray(d.limitations)||d.limitations.length>6||d.limitations.some(k=>!v(k,160)))&&l("has invalid limitations"),d.evidenceKind==="synthetic-model"&&(d.modelLevel!=="generated"||h!=="none")&&l("cannot describe synthetic data as verified or reality checked"),d.modelLevel!=="generated"&&(!d.assessedAt||!d.approvedByRole)&&l("requires an assessment date and approving organization or role for verified model levels"),d.modelLevel==="configuration-verified"&&!d.eventConfigurationId&&l("requires an event configuration id for configuration verification"),h!=="none"&&(!d.assessedAt||!d.sourceLabel)&&l("requires an assessment date and source for reality evidence"),h==="actual-build-checked"&&(d.modelLevel!=="configuration-verified"||!d.eventConfigurationId)&&l("requires a configuration-verified model and event configuration for an actual-build check");let S=d.modeledTarget;S!==void 0&&(!S||typeof S!="object"||Array.isArray(S)?l("has an invalid modeled target"):((!v(S.label,80)||!v(S.methodLabel,100))&&l("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)&&l("has invalid modeled-target ray counts"),new Set(["clear","partial","obstructed"]).has(S.classification)||l("has an invalid modeled-target classification"),S.occluderLabels!==void 0&&(!Array.isArray(S.occluderLabels)||S.occluderLabels.length>10||S.occluderLabels.some(k=>!v(k,100)))&&l("has invalid modeled-target occluders")))};u(e.viewFromSeatUrl,e.viewFromSeatMeta,"Venue"),g(e.confidenceEvidence,"Venue"),e.viewFromSeatUrl!==void 0&&!a(e.viewFromSeatUrl)&&n.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&&!a(t.viewFromSeatUrl)&&n.push({severity:"error",code:"invalid-floor-view-url",message:`Floor "${t.name}" has an invalid view-from-seat image URL`}),u(t.viewFromSeatUrl,t.viewFromSeatMeta,`Floor "${t.name}"`,{floorId:t.id}),g(t.confidenceEvidence,`Floor "${t.name}"`,{floorId:t.id});let b=e.floors?.length?e.floors.flatMap(t=>t.objects):e.objects;for(let t of b)if((t.type==="row"||t.type==="section")&&(t.viewFromSeatUrl!==void 0&&!a(t.viewFromSeatUrl)&&n.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}),u(t.viewFromSeatUrl,t.viewFromSeatMeta,`${t.type==="row"?"Row":"Section"} "${t.label}"`,{objectId:t.id}),g(t.confidenceEvidence,`${t.type==="row"?"Row":"Section"} "${t.label}"`,{objectId:t.id})),t.type==="row"&&t.segmentedRow&&(t.segmentedRow.viewFromSeatUrl!==void 0&&!a(t.segmentedRow.viewFromSeatUrl)&&n.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}),u(t.segmentedRow.viewFromSeatUrl,t.segmentedRow.viewFromSeatMeta,`Segmented row "${t.segmentedRow.displayLabel}"`,{objectId:t.id}),g(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&&!a(x.viewFromSeatUrl)&&n.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]}),u(x.viewFromSeatUrl,x.viewFromSeatMeta,`Seat ${x.index+1}`,{objectId:t.id,seatIndices:[x.index]}),g(x.confidenceEvidence,`Seat ${x.index+1}`,{objectId:t.id,seatIndices:[x.index]});let p=new Set;for(let t of e.categories){p.has(t.key)&&n.push({severity:"error",code:"duplicate-category-key",message:`Category key "${t.key}" is used more than once`,categoryKey:t.key}),p.add(t.key);let x=new Set;for(let c of t.tiers??[]){if(x.has(c.id)&&n.push({severity:"error",code:"duplicate-category-tier-id",message:`Ticket tier id "${c.id}" is used more than once in category "${t.key}"`,categoryKey:t.key}),c.restriction!=null&&!["companion","child","senior","student","membership","custom"].includes(c.restriction)&&n.push({severity:"error",code:"invalid-category-tier-restriction",message:`Ticket tier "${c.name}" has an unknown restriction`,categoryKey:t.key}),c.buyerMessage!=null&&(!c.buyerMessage.trim()||c.buyerMessage.length>240)&&n.push({severity:"error",code:"invalid-category-tier-buyer-message",message:`Ticket tier "${c.name}" buyer guidance must contain 1 to 240 characters`,categoryKey:t.key}),c.currency!=null&&!/^[A-Z]{3}$/.test(c.currency)&&n.push({severity:"error",code:"invalid-category-tier-currency",message:`Ticket tier "${c.name}" must use a three-letter ISO currency`,categoryKey:t.key}),c.applicability!=null){let l=c.applicability.seatLabels,d=c.applicability.accessibility;(l!==void 0&&(!Array.isArray(l)||!l.length||l.length>1e4||l.some(v=>typeof v!="string"||!v.trim()||v.length>160)||new Set(l).size!==l.length)||d!==void 0&&(!Array.isArray(d)||!d.length||d.some(v=>!y.has(v))||new Set(d).size!==d.length))&&n.push({severity:"error",code:"invalid-category-tier-applicability",message:`Ticket tier "${c.name}" has invalid seat applicability`,categoryKey:t.key})}c.evidence!=null&&(!["public-host","public-event","user-confirmed"].includes(c.evidence.provenance)||!c.evidence.sourceDescription.trim()||c.evidence.sourceDescription.length>240||c.evidence.capturedAt!==void 0&&(c.evidence.capturedAt.length>40||!Number.isFinite(Date.parse(c.evidence.capturedAt))))&&n.push({severity:"error",code:"invalid-category-tier-evidence",message:`Ticket tier "${c.name}" has invalid evidence provenance`,categoryKey:t.key}),x.add(c.id)}mt(t)||n.push({severity:"error",code:"invalid-reference-category-source",message:`Category ${t.label||t.key} has incomplete or invalid reference evidence`,categoryKey:t.key}),bt(t)||n.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 I=new Map,$=new Map,w=[],j=new Map,O=0,C=0,_=new Set;for(let t of e.floors??[])Se(t,n,r,t.id),_.has(t.id)&&n.push({severity:"error",code:"duplicate-floor-id",message:`Floor id "${t.id}" is used more than once`,floorId:t.id}),_.add(t.id),t.baseHeightM!==void 0&&(!Number.isFinite(t.baseHeightM)||t.baseHeightM<Y||t.baseHeightM>W)&&n.push({severity:"error",code:"invalid-floor-base-height",message:`Floor "${t.name}" base height must be between ${Y} and ${W} metres`,floorId:t.id});let F=e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects;pt(e,n);let E=new Set;for(let t of F)E.has(t.id)&&n.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)&&n.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))&&n.push({severity:"error",code:"invalid-zone-focal-point",message:`Zone "${t.label}" must use a finite focal point`});let M=new Map;for(let t of F)if(!(t.type!=="section"||!t.zone)){if(e.zones?.length&&!P.has(t.zone)){n.push({severity:"error",code:"unknown-section-zone",message:`Section "${t.displayLabel??t.label}" references unknown zone "${t.zone}"`,objectId:t.id});continue}M.has(t.zone)||M.set(t.zone,t)}for(let[t,x]of M){let c=e.zones?.find(l=>l.id===t);c&&(c?.focalPoint||r.push({severity:"warning",code:"missing-zone-focal-point",message:`Zone "${c?.label??t}" uses the legacy floor focal; set its own focal point before publishing`,objectId:x.id}))}for(let t of F)if((t.type==="row"||t.type==="table"||t.type==="booth"||t.type==="gaArea")&&yt(t,n),Ht(t)){if(O++,C+=t.type==="booth"?1:t.type==="row"?Pe(t):t.bookAsWhole||t.variableOccupancy?t.seatCount:ht(t).length,I.get(t.label)!==void 0?t.type!=="row"&&n.push({severity:"error",code:"duplicate-object-label",message:`Label "${t.label}" is used by more than one object`,objectId:t.id}):I.set(t.label,t.id),s.has(t.categoryKey)?m.add(t.categoryKey):n.push({severity:"error",code:"unknown-category",message:`"${t.label}" references unknown category "${t.categoryKey}"`,objectId:t.id,categoryKey:t.categoryKey}),t.type==="row"){oe(t.referenceInventorySource)||n.push({severity:"error",code:"invalid-reference-inventory-source",message:`Row "${t.label}" has invalid reference-inventory provenance`,objectId:t.id}),t.seatCount<1&&n.push({severity:"error",code:"empty-row",message:`Row "${t.label}" has no seats`,objectId:t.id});let c=new Set;for(let l of t.overrides??[]){(l.accessibility??[]).filter(S=>!y.has(S)).length&&n.push({severity:"error",code:"invalid-accessibility-type",message:`Row "${t.label}" seat ${l.index+1} uses an unknown accessibility type`,objectId:t.id,seatIndices:[l.index]}),(!Number.isInteger(l.index)||l.index<0||l.index>=t.seatCount||c.has(l.index))&&n.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(l.index)?{seatIndices:[l.index]}:{}}),c.add(l.index);let v=l.wheelchairSpaceType,h=l.accessible===!0||l.accessibility?.includes("wheelchair");v!==void 0&&v!=="seat-present"&&v!=="no-seat"?n.push({severity:"error",code:"invalid-wheelchair-space",message:`Row "${t.label}" seat ${l.index+1} has an invalid wheelchair-space type`,objectId:t.id,seatIndices:[l.index]}):v&&(!h||l.skip)&&n.push({severity:"error",code:"invalid-wheelchair-space",message:l.skip?`Row "${t.label}" seat ${l.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Row "${t.label}" seat ${l.index+1} must include wheelchair accessibility for its physical-space type`,objectId:t.id,seatIndices:[l.index]})}for(let l of Xt(t))re(l.label)&&n.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${l.label}" uses SeatLayer's reserved GA namespace`,objectId:t.id,seatIndices:[l.index]}),$.get(l.label)!==void 0?w.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${l.label}" is used more than once`,objectId:t.id,seatIndices:[l.index]}):$.set(l.label,t.id)}else if(t.type==="table"){let c=t.bookAsWhole===!0||t.variableOccupancy===!0;if(t.fill!==void 0&&!ze(t.fill)&&n.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"?n.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!==De(t.seatCount,t.seatArc))&&n.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(K=>Number.isInteger(t.seatCountsBySide[K])&&t.seatCountsBySide[K]>=0&&t.seatCountsBySide[K]<=40),A=k?h.reduce((K,Ot)=>K+t.seatCountsBySide[Ot],0):Number.NaN;(t.shape!=="rect"||S.length!==h.length||S.some(K=>!h.includes(K))||!k||A!==t.seatCount||A<1||A>40)&&n.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})}c&&t.overrides?.length&&n.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 l=new Set;for(let h of t.overrides??[]){(h.accessibility??[]).filter(K=>!y.has(K)).length&&n.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||l.has(h.index))&&n.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]}:{}}),l.add(h.index),h.categoryKey&&!s.has(h.categoryKey)?n.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&&m.add(h.categoryKey);let k=h.wheelchairSpaceType,A=h.accessible===!0||h.accessibility?.includes("wheelchair");k!==void 0&&k!=="seat-present"&&k!=="no-seat"?n.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&&(!A||h.skip)&&n.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?n.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)&&n.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)&&n.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${t.label}" has guest bounds without variable-occupancy selling`,objectId:t.id}),oe(t.referenceInventorySource)||n.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)&&n.push({severity:"error",code:"bad-table",message:`Table "${t.label}" is missing required dimensions or seats`,objectId:t.id});let v=c?[{label:t.label,index:void 0}]:ht(t);for(let h of v)re(h.label)&&n.push({severity:"error",code:"reserved-seat-label",message:`Inventory label "${h.label}" uses SeatLayer's reserved GA namespace`,objectId:t.id}),$.get(h.label)!==void 0?w.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]}}):$.set(h.label,t.id)}else if(t.type==="booth"){oe(t.referenceInventorySource)||n.push({severity:"error",code:"invalid-reference-inventory-source",message:`Booth "${t.label}" has invalid reference-inventory provenance`,objectId:t.id});let c=t.label;re(c)&&n.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${c}" uses SeatLayer's reserved GA namespace`,objectId:t.id}),$.get(c)!==void 0?w.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${c}" is used more than once`,objectId:t.id}):$.set(c,t.id)}}else if(t.type==="gaArea"){if(!Ke(t))n.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 l of Be(t))$.get(l)!==void 0?w.push({severity:"error",code:"duplicate-seat-label",message:`GA inventory label "${l}" is used more than once`,objectId:t.id}):$.set(l,t.id);if(oe(t.referenceInventorySource)||n.push({severity:"error",code:"invalid-reference-inventory-source",message:`GA area "${t.label}" has invalid reference-inventory provenance`,objectId:t.id}),!xe(t.points)){n.push({severity:"error",code:"invalid-polygon-points",message:`GA area "${t.label}" outline must be a list of points`,objectId:t.id});continue}(!U(t.points)||Math.abs(G(t.points))<=1e-7||q(t.points))&&n.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 c=t.holes??[];if(!vt(c))n.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 l=c.length<=64?c.findIndex(d=>d.length>512||!U(d)||Math.abs(G(d))<=1e-7||q(d)?!0:!d.flatMap((h,S)=>{let k=d[(S+1)%d.length];return[h,{x:(h.x+k.x)/2,y:(h.y+k.y)/2}]}).every(h=>Q(h,t.points))):0;if(l>=0)n.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:l});else if(c.some((d,v)=>c.slice(v+1).some(h=>te(d,h)))){let d=c.findIndex((v,h)=>c.slice(h+1).some(S=>te(v,S)));n.push({severity:"error",code:"overlapping-ga-holes",message:`GA area "${t.label}" has overlapping cutout polygons`,objectId:t.id,holeIndex:d})}}s.has(t.categoryKey)?m.add(t.categoryKey):n.push({severity:"error",code:"unknown-category",message:`"${t.label}" references unknown category "${t.categoryKey}"`,objectId:t.id,categoryKey:t.categoryKey}),t.capacity<1&&n.push({severity:"error",code:"empty-ga",message:`GA area "${t.label}" has zero capacity`,objectId:t.id}),(!Number.isInteger(t.capacity)||t.capacity>be)&&n.push({severity:"error",code:"invalid-ga-capacity",message:`GA area "${t.label}" capacity must be a whole number from 1 to ${be}`,objectId:t.id}),O++,C+=Math.max(0,Math.floor(t.capacity))}else if(t.type==="section"){if(t.displayLabel!==void 0){let l=t.displayLabel.normalize("NFKC").trim();l?(l!==t.displayLabel||l.length>80)&&n.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}):n.push({severity:"error",code:"unnamed-section",message:`Section "${t.label}" needs a buyer-facing name before seats are added`,objectId:t.id})}if(t.editor?.defaultCategoryKey&&!s.has(t.editor.defaultCategoryKey)&&n.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<fe||t.elevation>X)){let l=Number.isInteger(t.elevation)&&t.elevation>X&&t.elevation<=Me;r.push({severity:"warning",code:l?"legacy-section-elevation":"invalid-section-elevation",message:l?`Section "${t.label}" uses legacy tier ${t.elevation}; set an exact height before normalizing it to tier ${X}`:`Section "${t.label}" elevation must be a whole-number tier from ${fe} to ${X}`,objectId:t.id})}if(t.height!==void 0&&(!Number.isFinite(t.height)||t.height<Y||t.height>W)&&n.push({severity:"error",code:"invalid-section-height",message:`Section "${t.label}" exact height must be between ${Y} and ${W} metres`,objectId:t.id}),t.rake!==void 0&&(!Number.isFinite(t.rake)||t.rake<ye||t.rake>ge)&&n.push({severity:"error",code:"invalid-section-rake",message:`Section "${t.label}" rake must be between ${ye}\xB0 and ${ge}\xB0`,objectId:t.id}),t.surfaceKind!==void 0&&t.surfaceKind!=="flat"&&t.surfaceKind!=="rakedRows"&&n.push({severity:"error",code:"invalid-section-surface-kind",message:`Section "${t.label}" surfaceKind must be 'flat' or 'rakedRows'`,objectId:t.id}),!xe(t.outline)){n.push({severity:"error",code:"invalid-polygon-points",message:`Section "${t.label}" outline must be a list of points`,objectId:t.id});continue}if(!U(t.outline)||Math.abs(G(t.outline))<=1e-7||q(t.outline)){n.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 l=[];try{l=Re(t.outlinePath)}catch{}(!Ee(t.outlinePath)||!l.length||Math.hypot(t.outlinePath.start.x-t.outline[0].x,t.outlinePath.start.y-t.outline[0].y)>1e-4||!U(l)||Math.abs(G(l))<=1e-7||q(l))&&n.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))&&n.push({severity:"error",code:"invalid-section-reference-source",message:`Section "${t.label}" has invalid opaque reference provenance`,objectId:t.id}),gt(t)||n.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())n.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 l=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}),d=j.get(t.logicalSectionId);d&&(d.label!==t.label||d.semanticSignature!==l)?n.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}):d||j.set(t.logicalSectionId,{label:t.label,semanticSignature:l})}let x=t.holes??[];if(!vt(x)){n.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){n.push({severity:"error",code:"invalid-section-hole",message:`Section "${t.label}" has an invalid opening collection`,objectId:t.id});continue}let c=-1;for(let l=0;l<x.length;l++){let d=x[l];if(d.length>512||!U(d)||Math.abs(G(d))<=1e-7||q(d)){c=l;break}if(!d.flatMap((h,S)=>{let k=d[(S+1)%d.length];return[h,{x:(h.x+k.x)/2,y:(h.y+k.y)/2}]}).every(h=>Q(h,t.outline))){c=l;break}}if(c>=0)n.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:c});else if(x.some((l,d)=>x.slice(d+1).some(v=>te(l,v)))){let l=x.findIndex((d,v)=>x.slice(v+1).some(h=>te(d,h)));n.push({severity:"error",code:"overlapping-section-holes",message:`Section "${t.label}" has overlapping openings`,objectId:t.id,holeIndex:l})}}let D=e.floors?.length?e.floors.map(t=>t.objects):[e.objects];for(let t of D){let x=t.filter(c=>c.type==="section");for(let c of t.filter(l=>l.type==="text")){let l=c.iconKey;l!==void 0&&!We(l)&&n.push({severity:"error",code:"invalid-icon-key",message:`Venue icon "${c.text||c.id}" references an unknown symbol`,objectId:c.id});let d=c.fontFamily;d!==void 0&&(typeof d!="string"||d.normalize("NFKC").trim()!==d||d.length<1||d.length>120)&&n.push({severity:"error",code:"invalid-text-font-family",message:`Text "${c.text||c.id}" font family must contain 1 to 120 normalized characters`,objectId:c.id});let v=c.background;(c.width!==void 0&&(!Number.isFinite(c.width)||c.width<40||c.width>1200)||c.align!==void 0&&!["left","center","right"].includes(c.align)||c.lineHeight!==void 0&&(!Number.isFinite(c.lineHeight)||c.lineHeight<.8||c.lineHeight>3)||c.letterSpacing!==void 0&&(!Number.isFinite(c.letterSpacing)||c.letterSpacing<-2||c.letterSpacing>20)||c.opacity!==void 0&&(!Number.isFinite(c.opacity)||c.opacity<.1||c.opacity>1)||v!==void 0&&(!/^#[0-9a-f]{6}$/i.test(v.color)||v.padding!==void 0&&(!Number.isFinite(v.padding)||v.padding<0||v.padding>40)||v.cornerRadius!==void 0&&(!Number.isFinite(v.cornerRadius)||v.cornerRadius<0||v.cornerRadius>40)||v.opacity!==void 0&&(!Number.isFinite(v.opacity)||v.opacity<.1||v.opacity>1)))&&n.push({severity:"error",code:"invalid-text-layout",message:`Text "${c.text||c.id}" has invalid width, spacing, opacity, alignment, or background layout`,objectId:c.id})}for(let c of t.filter(l=>l.type==="shape")){if(c.eventConfigurationIds!==void 0){let v=c.eventConfigurationIds;Array.isArray(v)&&v.length>0&&v.length<=20&&v.every(S=>typeof S=="string"&&S.normalize("NFKC").trim()===S&&S.length>=1&&S.length<=100)&&new Set(v).size===v.length||n.push({severity:"error",code:"invalid-shape-configurations",message:`Shape "${c.label||c.id}" must reference 1 to 20 unique event configuration ids`,objectId:c.id})}if(c.heightM!==void 0&&(!Number.isFinite(c.heightM)||c.heightM<.05||c.heightM>50)&&n.push({severity:"error",code:"invalid-shape-height",message:`Shape "${c.label||c.id}" height must be between 0.05 m and 50 m`,objectId:c.id}),c.stroke!==void 0&&(!c.stroke||typeof c.stroke.color!="string"||!/^#[0-9a-f]{6}$/i.test(c.stroke.color)||!Number.isFinite(c.stroke.width)||c.stroke.width<.5||c.stroke.width>40)&&n.push({severity:"error",code:"invalid-shape-stroke",message:`Shape "${c.label||c.id}" stroke must use a six-digit color and width from 0.5 to 40 chart units`,objectId:c.id}),(c.lineCap!==void 0||c.lineJoin!==void 0||c.startEnding!==void 0||c.endEnding!==void 0)&&!Ie(c.kind)?n.push({severity:"error",code:"invalid-shape-line-style-applicability",message:`Shape "${c.label||c.id}" may use line caps, joins, and end decorations only when it is an open line or polyline`,objectId:c.id}):Ie(c.kind)&&(c.lineCap!==void 0&&!Ze.includes(c.lineCap)||c.lineJoin!==void 0&&!Je.includes(c.lineJoin)||c.startEnding!==void 0&&!ve.includes(c.startEnding)||c.endEnding!==void 0&&!ve.includes(c.endEnding))&&n.push({severity:"error",code:"invalid-shape-line-style",message:`Shape "${c.label||c.id}" has an unsupported line cap, join, or ending`,objectId:c.id}),c.points!==void 0&&!xe(c.points)){n.push({severity:"error",code:"invalid-polygon-points",message:`Shape "${c.label||c.id}" points must be a list of points`,objectId:c.id});continue}if(c.kind==="polygon"){let v=at(c.points??[]);v.ok||n.push({severity:"error",code:"invalid-shape-polygon",message:`Shape "${c.label||c.id}" has invalid polygon geometry: ${v.message}`,objectId:c.id})}let d=ut(c);if(d){for(let v of x)if(dt(d,v.outline)){n.push({severity:"error",code:"reference-focal-overlaps-section",message:`Reference focal area "${c.label??c.id}" overlaps section "${v.label}"`,objectId:c.id});break}}}}C>i&&n.push({severity:"error",code:"inventory-capacity-exceeded",message:`Chart has ${C} bookable units; the maximum is ${i}`}),n.push(...w.slice(0,5)),w.length>5&&n.push({severity:"error",code:"duplicate-seat-label",message:`${w.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 ae(e)){let x=t.families[0]?.targets[0];r.push({severity:"warning",code:"category-inventory-family-conflict",message:nt(t),categoryKey:t.categoryKey,...x?{objectId:x.id,floorId:x.floorId}:{},relatedObjectIds:t.objectIds,categoryInventoryFamilies:t.families})}e.focalPoint||r.push({severity:"warning",code:"missing-focal-point",message:"Chart has no focal point set"}),O===0&&r.push({severity:"warning",code:"no-bookables",message:"Chart has no rows, tables, booths, or GA areas"});for(let t of m)if(f.get(t)===!1){let x=e.categories.find(c=>c.key===t);r.push({severity:"warning",code:"unpriced-category",message:`Category "${x?.label??t}" is used but has no price`,categoryKey:t})}return[...n,...r]}var Yt=9,Ct="#f7f8fb",Wt="#f5f6f8",jt="#8b93a7",Zt="#0b1220",Jt="#0b1220",eo="#ffffff",to=100;function T(e,o=2){let i=10**o;return Math.round(e*i)/i}function R(e){return{source:"quality",...e}}function oo(e){return e.code==="missing-focal-point"||e.code==="missing-zone-focal-point"?"navigation":"structure"}function $e(e){return Yt*Ye(e.theme?.seatScale)}function $t(e){let o=[];for(let i of e.objects)i.type==="row"?o.push(...B(i)):i.type==="table"&&o.push(...Z(i));return o}function no(e){let o={rowSeats:0,tableSeats:0,booths:0,gaCapacity:0};for(let i of e)for(let n of i.objects)n.type==="row"?o.rowSeats+=B(n).length:n.type==="table"?o.tableSeats+=Z(n).length:n.type==="booth"?o.booths+=1:n.type==="gaArea"&&(o.gaCapacity+=Math.max(0,Math.floor(n.capacity)));return{inventoryByKind:o,bookableUnits:o.rowSeats+o.tableSeats+o.booths+o.gaCapacity}}function L(e,o){e.filter(i=>i.code===o.code).length<to&&e.push(o)}function io(e,o,i){let n=$e(e),r=2*n,s=2.3*n,y=0,f=0,m=1/0;for(let a of o){let u=new Map(a.objects.filter(w=>w.type==="row").map(w=>[w.id,w])),g=w=>{let j=a.objects.find(E=>E.id===w);if(!j||j.type!=="row"&&j.type!=="table")return"another seating object";let O=j.type==="row"?B(j):Z(j),C=O.length?{x:O.reduce((E,P)=>E+P.x,0)/O.length,y:O.reduce((E,P)=>E+P.y,0)/O.length}:j.type==="row"?j.origin:j.center,_=a.objects.find(E=>E.type==="section"&&J(C,E.outline,E.holes)),F=j.type==="row"?`Row \u201C${j.label}\u201D`:`Table \u201C${j.label}\u201D`;return _?.type==="section"?`${F} in \u201C${_.label}\u201D`:F},b=$t(a);y+=b.length;let p=s,I=new Map,$=new Map;for(let w of b){let j=Math.floor(w.x/p),O=Math.floor(w.y/p);for(let F=-1;F<=1;F++)for(let E=-1;E<=1;E++){let P=I.get(`${j+F}:${O+E}`)??[];for(let M of P){f++;let D=Math.hypot(w.x-M.x,w.y-M.y);if(m=Math.min(m,D),D>=s)continue;let x=(w.rowId<M.rowId?[w.rowId,M.rowId]:[M.rowId,w.rowId]).join("|"),c=$.get(x);(!c||D<c.distance)&&$.set(x,{a:w,b:M,distance:D})}}let C=`${j}:${O}`,_=I.get(C)??[];_.push(w),I.set(C,_)}for(let w of $.values()){let j=w.a.rowId===w.b.rowId,O=u.get(w.a.rowId),C=u.get(w.b.rowId),_=!j&&O?.segmentedRow?.repeatLabelOnComponents===!0&&C?.segmentedRow?.repeatLabelOnComponents===!0&&O.segmentedRow.groupId===C.segmentedRow.groupId,F=!!O?.referenceScan&&!!C?.referenceScan&&O.referenceScan.assetId===C.referenceScan.assetId&&O.referenceScan.sectionId===C.referenceScan.sectionId,E=w.distance<r;if((_||F)&&!E)continue;let P=E?"seat-overlap":"seat-cramped",M=g(w.a.rowId),D=g(w.b.rowId),t=T(E?r:s);L(i,R({severity:"warning",code:P,dimension:"geometry",title:E?j?`${M} has overlapping seats`:`${M} and ${D} overlap`:j?`${M} has seats too close together`:`${M} and ${D} are too close together`,message:E?`The closest seats are ${T(w.distance)} chart units apart, so their markers overlap on the buyer map; at least ${t} keeps them apart.`:`The closest seats are ${T(w.distance)} chart units apart; at least ${t} are required.`,action:j?`Increase the seat spacing for ${M}, or use Review safe fixes.`:`Move ${M} or ${D} until they no longer overlap.`,objectId:w.a.rowId,relatedObjectIds:j?[w.a.rowId]:[w.a.rowId,w.b.rowId],floorId:a.id,measured:T(w.distance),minimum:t,autoFixable:j}))}}return{seats:y,checkedSeatPairs:f,minimumSeatDistance:Number.isFinite(m)?T(m):null}}function le(e){let{width:o,height:i}=Ae(e);if(!e.rotation)return{x:e.position.x,y:e.position.y,width:o,height:i};let n=[{x:0,y:0},{x:o,y:0},{x:o,y:i},{x:0,y:i}].map(r=>{let s=Te(r,e.rotation);return{x:e.position.x+s.x,y:e.position.y+s.y}});return Xe(n)}function kt(e,o,i=0){return e.x<o.x+o.width+i&&e.x+e.width+i>o.x&&e.y<o.y+o.height+i&&e.y+e.height+i>o.y}function je(e,o,i){let n=ne(o.x,e.x,e.x+e.width),r=ne(o.y,e.y,e.y+e.height);return(o.x-n)**2+(o.y-r)**2<i**2}function ro(e,o,i){let n=$e(e),r=0;for(let s of o){let y=s.objects.filter(m=>m.type==="text"),f=$t(s);r+=y.length;for(let m=0;m<y.length;m++){let a=y[m],u=le(a),g=f.find(b=>je(u,b,n));g&&L(i,R({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${a.text}\u201D overlaps seat ${g.label}`,objectId:a.id,relatedObjectIds:[a.id,g.rowId],floorId:s.id,autoFixable:!0}));for(let b=0;b<m;b++){let p=y[b];kt(u,le(p),2)&&L(i,R({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${a.text}\u201D overlaps text \u201C${p.text}\u201D`,objectId:a.id,relatedObjectIds:[a.id,p.id],floorId:s.id,autoFixable:!0}))}}}return r}function Ce(e){return e.normalize("NFKC").trim().toLowerCase().replace(/\s+/g," ")}function ao(e,o,i){let n=new Map;for(let f of o)for(let m of f.objects){let a=m.type,u=a==="row"||a==="table"||a==="booth"||a==="gaArea",g=u||a==="section";if(u&&!m.categoryKey.trim()){let b=a==="gaArea"?"GA area":a==="row"?"Row":a==="table"?"Table":"Booth";L(i,R({severity:"warning",code:"object-uncategorized",dimension:"structure",title:`${b} \u201C${m.label||m.id}\u201D has no category`,message:`${b} \u201C${m.label||m.id}\u201D is not assigned to any category, so buyers see no price or colour for it.`,action:"Assign a category to this object in the inspector, or create one in the Categories tab first.",objectId:m.id,floorId:f.id,autoFixable:!1}))}if(g){let b=(m.type==="section"?m.displayLabel??m.label:m.label)??"";if(b.trim()){if(a==="table"||a==="booth"||a==="gaArea"){let p=Ce(b),I=n.get(p);I&&I.raw!==b?L(i,R({severity:"warning",code:"duplicate-object-label-normalized",dimension:"labels",title:`\u201C${b}\u201D and \u201C${I.raw}\u201D read as the same label`,message:`Labels \u201C${b}\u201D and \u201C${I.raw}\u201D differ only by case, spacing, or accents, so buyers cannot tell them apart.`,action:"Make the two labels visibly distinct.",objectId:m.id,relatedObjectIds:[m.id,I.id],floorId:f.id,autoFixable:!1})):I||n.set(p,{id:m.id,raw:b})}}else{let p=a==="gaArea"?"A GA area":a==="section"?"A section":a==="row"?"A row":a==="table"?"A table":"A booth";L(i,R({severity:"warning",code:"object-unlabeled",dimension:"labels",title:`${p} has no label`,message:`${p} 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:m.id,floorId:f.id,autoFixable:!1}))}}}let r=[];for(let f of o){let m=f.objects.filter(a=>a.type==="row"||a.type==="table"||a.type==="booth"||a.type==="gaArea");for(let a of f.objects)if(!(a.type!=="section"||a.referenceInventoryExclusion||m.some(g=>J(ie(g),a.outline,a.holes)))){if(a.referenceSource){r.push({id:a.id,floorId:f.id});continue}L(i,R({severity:"warning",code:"empty-section",dimension:"structure",title:`Section \u201C${a.displayLabel??a.label}\u201D is empty`,message:`Section \u201C${a.displayLabel??a.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:a.id,floorId:f.id,autoFixable:!1}))}}r.length&&L(i,R({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(f=>f.id),floorId:r[0].floorId,autoFixable:!1}));let s=new Map,y=new Map;for(let f of o){let m=[];for(let a of f.objects)a.type!=="section"||a.outline.length<3||m.push({id:a.logicalSectionId??a.id,outline:a.outline,...a.holes?{holes:a.holes}:{},bounds:fo(a.outline)});for(let a of f.objects){if(a.type!=="row")continue;let u=(a.segmentedRow?.displayLabel??a.displayLabel??a.label??"").trim(),g=(a.displayType??"").trim(),b=u&&g&&Ce(g)!=="row"?`${g} ${u}`:u,p="";if(m.length){let j=ie(a),O=m.find(C=>j.x>=C.bounds.minX&&j.x<=C.bounds.maxX&&j.y>=C.bounds.minY&&j.y<=C.bounds.maxY&&J(j,C.outline,C.holes));O&&(p=O.id)}let I=`${f.id}\0${p}\0${Ce(b)}`,$=a.segmentedRow?.groupId??a.id;if(!b){let j=`${f.id}\0${p}`,O=y.get(j);O?(O.ids.push(a.id),O.logical.set($,[...O.logical.get($)??[],a])):y.set(j,{ids:[a.id],logical:new Map([[$,[a]]]),floorId:f.id});continue}let w=s.get(I);w?(w.ids.push(a.id),w.logical.set($,[...w.logical.get($)??[],a])):s.set(I,{ids:[a.id],logical:new Map([[$,[a]]]),floorId:f.id,raw:b})}}for(let{ids:f,logical:m,floorId:a,raw:u}of s.values()){let g=m.size;g<2||wt([...m.values()])&&L(i,R({severity:"warning",code:"duplicate-row-label",dimension:"labels",title:`${g} rows share the name \u201C${u}\u201D`,message:`${g} rows share the label \u201C${u}\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:f[0],relatedObjectIds:f,floorId:a,autoFixable:!1}))}for(let{ids:f,logical:m,floorId:a}of y.values()){let u=m.size;u<2||wt([...m.values()])&&L(i,R({severity:"warning",code:"unnamed-row-collision",dimension:"labels",title:`${u} rows have no name`,message:`${u} 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:f[0],relatedObjectIds:f,floorId:a,autoFixable:!1}))}if(e.floors&&e.floors.length>1)for(let f of e.floors)f.objects.length===0&&L(i,R({severity:"warning",code:"unused-floor",dimension:"structure",title:`Floor \u201C${f.name}\u201D is empty`,message:`Floor \u201C${f.name}\u201D has no objects on it.`,action:"Add seating to this floor, or delete it from the floor list below the canvas.",floorId:f.id,autoFixable:!1}))}var so=5,co=16;function lo(e,o,i){for(let n of o){let r=n.focalPoint??e.focalPoint;if(r)for(let s of n.objects){if(s.type!=="section"||s.outline.length<3)continue;let{rake:y}=Fe(s);if(y<so)continue;let f=s.outline.map(b=>Math.hypot(b.x-r.x,b.y-r.y)),m=Math.max(...f);if(m<=0)continue;let a=(m-Math.min(...f))/m;if(y*a<=co)continue;let g=s.displayLabel??s.label;L(i,R({severity:"warning",code:"section-rake-inconsistent",dimension:"geometry",title:`Section \u201C${g}\u201D is too deep for a single rake`,message:`Section \u201C${g}\u201D spans ${Math.round(a*100)}% of its distance to the stage at a ${Math.round(y)}\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:s.id,floorId:n.id,autoFixable:!1}))}}}function uo(e,o,i){let n=e.theme?.background??Ct,r=Wt,s=new Map;for(let a of o)for(let u of a.objects){if(u.type!=="gaArea")continue;let g=s.get(u.categoryKey)??[];g.push({id:u.id,floorId:a.id}),s.set(u.categoryKey,g)}for(let a of e.categories){let u=N(a.color,n),g=N(a.color,r);if(u==null||g==null){L(i,R({severity:"error",code:"invalid-category-color",dimension:"contrast",message:`Category \u201C${a.label}\u201D does not use a supported hex color`,categoryKey:a.key}));continue}let b=Math.min(u,g);b<3&&L(i,R({severity:"warning",code:"category-contrast-low",dimension:"contrast",title:`Category \u201C${a.label}\u201D is hard to see`,message:`Category \u201C${a.label}\u201D reaches only ${T(b)}:1 across dark and light chart backgrounds; 3:1 is required`,action:`Choose a lighter or darker color for \u201C${a.label}\u201D until this warning clears.`,categoryKey:a.key,measured:T(b),minimum:3,autoFixable:!1}));let p=s.get(a.key)??[];if(p.length){let I=he(a.color,n,pe),$=he(a.color,r,pe),w=Math.min(N(I,n)??0,N($,r)??0);w<3&&L(i,R({severity:"warning",code:"ga-contrast-low",dimension:"contrast",message:`GA category \u201C${a.label}\u201D reaches only ${T(w)}:1 after its rendered opacity is composited; 3:1 is required`,objectId:p[0].id,categoryKey:a.key,floorId:p[0].floorId,relatedObjectIds:p.map(j=>j.id),measured:T(w),minimum:3,autoFixable:!1}))}}for(let a=0;a<e.categories.length;a++)for(let u=0;u<a;u++){let g=e.categories[a],b=e.categories[u],p=Ue(g.color,b.color);p!=null&&p<25&&L(i,R({severity:"warning",code:"category-colors-too-similar",dimension:"contrast",title:`\u201C${g.label}\u201D and \u201C${b.label}\u201D look too similar`,message:`Categories \u201C${g.label}\u201D and \u201C${b.label}\u201D are only \u0394E ${T(p)} apart; 25 is required`,action:"Pick a visibly different color for either category so buyers can tell them apart.",categoryKey:g.key,measured:T(p),minimum:25,autoFixable:!1}))}for(let a of o){let u=a.objects.filter(g=>g.type==="text");for(let g of u){let b=g.color??e.theme?.textColor??jt,p=N(b,n),I=g.fontSize>=18?3:4.5;(p==null||p<I)&&L(i,R({severity:"warning",code:"text-contrast-low",dimension:"contrast",message:`Text \u201C${g.text}\u201D has ${T(p??0)}:1 contrast against the chart background; ${I}:1 is required`,objectId:g.id,floorId:a.id,measured:T(p??0),minimum:I,autoFixable:!0}))}}if(e.theme?.selectionColor){let a=N(e.theme.selectionColor,n);(a==null||a<3)&&L(i,R({severity:"warning",code:"selection-contrast-low",dimension:"contrast",title:"The selection color is hard to see",message:`Selection rings have ${T(a??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(a??0),minimum:3,autoFixable:!1}))}if(e.theme?.textColor){let a=N(e.theme.textColor,n);(a==null||a<3)&&L(i,R({severity:"warning",code:"theme-text-contrast-low",dimension:"contrast",title:"The theme text color is hard to read",message:`Theme text has ${T(a??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(a??0),minimum:3,autoFixable:!1}))}let y=e.theme?.seatLabelColor??Zt,f=new Map,m=(a,u,g)=>{let b=f.get(a)??new Map,p=b.get(u)??[];p.push(g),b.set(u,p),f.set(a,b)};for(let a of o)for(let u of a.objects)if(u.type==="row")for(let g of se(u).keys())m(g,"seat",u.id);else if(u.type==="table")for(let g of se(u).keys())m(g,"table seat",u.id);else u.type==="booth"&&m(u.categoryKey,"booth",u.id);for(let a of e.categories){let u=f.get(a.key);if(u)for(let[g,b]of u){let p=g==="booth"?Ve:Ge,I=qe(Qe,600),$=He(a.color,y),w=N($,a.color);(w==null||w<I)&&L(i,R({severity:"warning",code:"bookable-label-contrast-low",dimension:"contrast",message:`${g==="booth"?"Booth":g==="seat"?"Seat":"Table-seat"} labels use ${p}u type and have ${T(w??0)}:1 contrast on category \u201C${a.label}\u201D; ${I}:1 is required for small text`,objectId:b[0],relatedObjectIds:b,measured:T(w??0),minimum:I,autoFixable:!0}))}}}function wt(e){if(e.length>24)return!0;let o=new Set;for(let i of e){let n=new Set;for(let r of i)for(let s of B(r)){let y=s.label,f=y.lastIndexOf("-");n.add(f>=0?y.slice(f+1):y)}if(!n.size)return!0;for(let r of n)if(o.has(r))return!0;for(let r of n)o.add(r)}return!1}function fo(e){let o=1/0,i=1/0,n=-1/0,r=-1/0;for(let s of e)s.x<o&&(o=s.x),s.y<i&&(i=s.y),s.x>n&&(n=s.x),s.y>r&&(r=s.y);return{minX:o,minY:i,maxX:n,maxY:r}}function yo(e,o){for(let i of e){let n=i.objects.filter(r=>r.type==="section");if(!(n.length<2))for(let r of i.objects){if(!(r.type==="row"||r.type==="table"||r.type==="booth"||r.type==="gaArea"))continue;let y=ie(r),f=n.filter(p=>J(y,p.outline,p.holes)),m=new Map;for(let p of f){let I=p.logicalSectionId??p.id,$=m.get(I)??[];$.push(p),m.set(I,$)}if(m.size<2)continue;let a=[...m.values()],u=a.map(p=>`Section \u201C${p[0].displayLabel??p[0].label}\u201D`),g=u.length===2?u.join(" and "):`${u.slice(0,-1).join(", ")}, and ${u[u.length-1]}`,b=r.type==="gaArea"?"GA area":r.type==="row"?"Row":r.type==="table"?"Table":"Booth";L(o,R({severity:"warning",code:"ambiguous-section-ownership",dimension:"structure",title:`${b} \u201C${r.label}\u201D belongs to more than one section`,message:`${b} \u201C${r.label}\u201D has its center inside ${g}, 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:r.id,relatedObjectIds:[r.id,...a.flatMap(p=>p.map(I=>I.id))],floorId:i.id,autoFixable:!1}))}}}var go={structure:20,geometry:30,contrast:25,labels:15,navigation:10},mo={"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 bo(e){let o={...go};for(let r of e){let s=r.severity==="error"?10:2;o[r.dimension]=Math.max(0,o[r.dimension]-(mo[r.code]??s))}let i=Object.values(o).reduce((r,s)=>r+s,0),n=i>=95?"A":i>=85?"B":i>=70?"C":i>=55?"D":"F";return{overall:i,dimensions:o,errorFree:e.every(r=>r.severity!=="error"),grade:n}}var po=new Set(["unpriced-category","object-uncategorized"]);function St(e,o={}){let i=me(e),n=It(e,{maxInventory:o.maxInventory}).filter(u=>u.code!=="missing-zone-focal-point"||o.requireExplicitZoneFocals).map(u=>{let g=u.objectId?i.find(I=>I.objects.some($=>$.id===u.objectId))?.id:void 0,b=u.code==="category-inventory-family-conflict",p=b?e.categories.find(I=>I.key===u.categoryKey):void 0;return R({...u,...b?{severity:"error",title:`Category \u201C${p?.label??u.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."}:{},...o.requireExplicitZoneFocals&&u.code==="missing-zone-focal-point"?{severity:"error"}:{},...g?{floorId:g}:{},source:"structural",dimension:oo(u),autoFixable:b})}),r=io(e,i,n),s=no(i),y=ro(e,i,n);if(ao(e,i,n),yo(i,n),lo(e,i,n),uo(e,i,n),i.reduce((u,g)=>u+g.objects.filter(b=>b.type==="row"||b.type==="table"||b.type==="booth"||b.type==="gaArea").length,0)===0){let u=new Set(["missing-focal-point","no-bookables"]);for(let g=n.length-1;g>=0;g--)u.has(n[g].code)&&n.splice(g,1)}if(o.requirePricedInventory)for(let u=0;u<n.length;u++)po.has(n[u].code)&&(n[u]={...n[u],severity:"error"});let m=n.filter(u=>u.severity==="error"),a=n.filter(u=>u.severity==="warning");return{issues:n,errors:m,warnings:a,metrics:{floors:i.length,objects:i.reduce((u,g)=>u+g.objects.length,0),seats:r.seats,bookableUnits:s.bookableUnits,inventoryByKind:s.inventoryByKind,categories:e.categories.length,freeTextLabels:y,checkedSeatPairs:r.checkedSeatPairs,minimumSeatDistance:r.minimumSeatDistance},score:bo(n),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 ho(e,o){if(e.seatCount<2||e.seatSpacing>=o)return!1;let i=ue(B(e));e.seatSpacing=T(o,3);let n=ue(B(e));return e.origin.x=T(e.origin.x+i.x-n.x,3),e.origin.y=T(e.origin.y+i.y-n.y,3),!0}function vo(e,o){if(e.seatCount<2)return!1;let i=!1;if(e.shape==="round"){let n=ne(e.seatArc??360,0,360),r=(n>=360?360/e.seatCount:n/(e.seatCount-1))*Math.PI/180;if(r>0){let s=o/(2*Math.sin(r/2)),y=Math.max(1,s-16);(e.radius??40)<y&&(e.radius=T(y,3),i=!0)}}else{let n=Ne(e),r=Math.max(n.top,n.bottom),s=Math.max(n.left,n.right);r>1&&(e.width??80)/r<o&&(e.width=T(r*o,3),i=!0),s>1&&(e.height??50)/s<o&&(e.height=T(s*o,3),i=!0)}return i}function Io(e){return[Jt,eo].map(i=>({color:i,minimum:Math.min(...e.map(n=>N(i,n)??0))})).sort((i,n)=>n.minimum-i.minimum)[0].color}function xt(e,o,i){let n=le(e),r=0;for(let s of o)s.type==="row"?r+=B(s).filter(y=>je(n,y,i)).length:s.type==="table"?r+=Z(s).filter(y=>je(n,y,i)).length:s.type==="text"&&s.id!==e.id&&kt(n,le(s),2)&&r++;return r}function wo(e,o,i){if(xt(e,o,i)===0)return!1;let r={...e.position},s=Math.max(12,e.fontSize*1.25),y=[[0,-1],[1,0],[0,1],[-1,0],[1,-1],[1,1],[-1,1],[-1,-1]];for(let f=1;f<=12;f++)for(let[m,a]of y)if(e.position={x:T(r.x+m*s*f,3),y:T(r.y+a*s*f,3)},xt(e,o,i)===0)return!0;return e.position=r,!1}function sn(e,o={}){let i=JSON.parse(JSON.stringify(e)),n=St(i,o),r=[],s=rt(i);if(s.changed){i=s.doc;for(let g of s.changes){let b=s.before.find(I=>I.categoryKey===g.categoryKey),p=b?.families.map(I=>I.label).join(", ")??"inventory families";r.push({code:"category-inventory-family-conflict",objectId:b?.objectIds[0],message:`Split category \u201C${g.categoryLabel}\u201D across ${p}; preserved its commercial metadata and reassigned ${g.reassignments.length} affected object${g.reassignments.length===1?"":"s"}`})}}let y=$e(i),f=2.5*y,m=me(i);for(let g of m)for(let b of g.objects)if(b.type==="row"){let p=b.seatSpacing;ho(b,f)&&r.push({code:p<2*y?"seat-overlap":"seat-cramped",objectId:b.id,message:`Expanded ${b.id} to the ${T(f)}u target pitch while preserving its centre`})}else b.type==="table"&&vo(b,f)&&r.push({code:"seat-cramped",objectId:b.id,message:`Expanded ${b.id} so its perimeter seats meet the ${T(f)}u target pitch`});let a=i.theme?.background??Ct;for(let g of m)for(let b of g.objects){if(b.type!=="text")continue;let p=b.color??i.theme?.textColor??jt,I=b.fontSize>=18?3:4.5;(N(p,a)??0)<I&&(b.color=Io([a]),r.push({code:"text-contrast-low",objectId:b.id,message:`Changed ${b.id} to the highest-contrast black/white ink`}))}for(let g of m){let b=g.objects.filter(p=>p.type==="text");for(let p of b)wo(p,g.objects,y)&&r.push({code:"label-collision",objectId:p.id,message:`Moved ${p.id} to the nearest collision-free deterministic label position`})}i.floors?.length&&(i.objects=i.floors[0].objects);let u=St(i,o);return{doc:i,changed:r.length>0,fixes:r,before:n,after:u}}export{we as a,se as b,ae as c,nt as d,rt as e,xo as f,at as g,sn as h};
1
+ import{c as De}from"./chunk-TKYTTEJ2.js";import{B as He,a as Ge,c as Ve,h as pe,i as Qe,o as qe,x as he}from"./chunk-LAX7F5ML.js";import{i as We,k as Ze,l as Je,m as ve,q as Ie}from"./chunk-TQN2VWQO.js";import{o as _e}from"./chunk-5BMXWOE7.js";import{b as re,c as be,e as Ke,g as Be}from"./chunk-CEIVHWRB.js";import{b as Xe,e as G,i as Ye}from"./chunk-M5X6G7FD.js";import{c as H}from"./chunk-F2EXXZSZ.js";import{A as Te,B as ue,Ba as B,Ca as Ne,Fa as Z,Ja as J,La as ie,M as ne,Na as me,P as Ee,Q as Re,b as de,e as ke,ea as fe,fa as X,ga as Y,ha as W,ia as ye,ja as ge,ka as Me,na as Fe,q as At,r as Tt,s as Et,t as Rt,u as Lt,v as Mt,w as Oe,x as Ft,y as Pt,z as Ae,za as Pe}from"./chunk-F7TP67LK.js";import{h as Le}from"./chunk-5ITK5236.js";import{a as ze,i as Ue,n as N}from"./chunk-JBOTRSMY.js";var we=[{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 et(e){return e.floors?.length?e.floors:[{id:"floor-0",objects:e.objects}]}function Nt(e){return we.find(o=>o.key===e)}function se(e){let o=new Map,i=Math.max(0,Math.floor(e.seatCount)),n=new Map((e.overrides??[]).filter(s=>Number.isInteger(s.index)&&s.index>=0&&s.index<e.seatCount).map(s=>[s.index,s])),r=(s,y=1)=>{s&&y>0&&o.set(s,(o.get(s)??0)+y)};r(e.categoryKey,i-n.size);for(let s of n.values())s.skip||r(s.categoryKey??e.categoryKey);return o}function _t(e){return e.type==="row"||e.type==="table"?[...se(e).keys()]:e.type==="booth"?e.categoryKey?[e.categoryKey]:[]:e.type==="gaArea"?e.capacity>0&&e.categoryKey?[e.categoryKey]:[]:[]}function tt(e){return we.find(o=>o.objectType===e.type)??null}function ot(e){return e.type==="row"||e.type==="table"||e.type==="booth"||e.type==="gaArea"}function ae(e){let o=new Map;for(let r of et(e))for(let s of r.objects){if(!ot(s))continue;let y=tt(s);for(let f of _t(s)){let m=o.get(f)??new Map,a=m.get(y.key)??[];if(!a.some(u=>u.id===s.id)){let u=s.displayLabel||s.label||s.id;a.push({id:s.id,label:u,type:y.objectType,floorId:r.id})}m.set(y.key,a),o.set(f,m)}}let i=new Map(e.categories.map(r=>[r.key,r.label]));return[...e.categories.map(r=>r.key),...[...o.keys()].filter(r=>!i.has(r)).sort()].flatMap(r=>{let s=o.get(r);if(!s||s.size<2)return[];let y=we.flatMap(f=>{let m=s.get(f.key);return m?.length?[{family:f.key,label:f.label,objectType:f.objectType,targets:m}]:[]});return[{categoryKey:r,categoryLabel:i.get(r)??r,families:y,objectIds:[...new Set(y.flatMap(f=>f.targets.map(m=>m.id)))]}]})}function nt(e){let o=e.families.map(i=>`${i.label} (${i.targets.map(n=>n.label).join(", ")})`).join(" and ");return`Category \u201C${e.categoryLabel}\u201D is used by more than one kind of inventory: ${o}. Each category can belong to only one kind. Use the safe split to separate them (prices, ticket tiers, accessibility, and provenance are preserved).`}function it(e){return e.normalize("NFKC").trim().toLocaleLowerCase("en")}function Dt(e,o,i){for(let n=1;n<=1e4;n+=1){let r=n===1?`--${o}`:`--${o}-${n}`,y=`${e.slice(0,Math.max(1,160-r.length))}${r}`;if(!i.has(y))return i.add(y),y}throw new Error(`Unable to allocate a category key for ${e} (${o})`)}function Kt(e,o,i){for(let n=1;n<=1e4;n+=1){let r=n===1?` (${o})`:` (${o} ${n})`,y=`${e.normalize("NFKC").trim().slice(0,Math.max(1,80-r.length)).trimEnd()}${r}`,f=it(y);if(!i.has(f))return i.add(f),y}throw new Error(`Unable to allocate a category label for ${e} (${o})`)}function Bt(e,o,i,n){let r=Nt(o);return{...structuredClone(e),key:Dt(e.key,r.suffix,i),label:Kt(e.label,r.labelSuffix,n)}}function zt(e,o,i){let n=[];for(let r of et(e))for(let s of r.objects){if(!ot(s))continue;let y=tt(s),f=i.get(y.key);if(!(!f||f===o))if(s.type==="row"||s.type==="table"){let m=[];s.categoryKey===o&&(s.categoryKey=f);for(let a of s.overrides??[])a.categoryKey===o&&(a.categoryKey=f,m.push(a.index));(s.categoryKey===f||m.length)&&n.push({family:y.key,floorId:r.id,objectId:s.id,objectType:y.objectType,fromCategoryKey:o,toCategoryKey:f,...m.length?{seatOverrideIndices:m.sort((a,u)=>a-u)}:{}})}else s.categoryKey===o&&(s.categoryKey=f,n.push({family:y.key,floorId:r.id,objectId:s.id,objectType:y.objectType,fromCategoryKey:o,toCategoryKey:f}))}return n}function rt(e){let o=structuredClone(e),i=ae(o);if(!i.length)return{doc:o,changed:!1,changes:[],before:i,after:i};let n=new Set(o.categories.map(f=>f.key)),r=new Set(o.categories.map(f=>it(f.label))),s=[];for(let f of i){let m=o.categories.findIndex(I=>I.key===f.categoryKey);if(m<0)continue;let a=o.categories[m],u=f.families[0].family,g=new Map([[u,a.key]]),b=f.families.slice(1).map(I=>{let $=Bt(a,I.family,n,r);return g.set(I.family,$.key),{family:I.family,key:$.key,label:$.label,category:$}});o.categories.splice(m+1,0,...b.map(I=>I.category));let p=zt(o,a.key,g);s.push({categoryKey:a.key,categoryLabel:a.label,retainedFamily:u,clones:b.map(({family:I,key:$,label:w})=>({family:I,key:$,label:w})),reassignments:p})}o.floors?.length&&(o.objects=o.floors[0].objects);let y=ae(o);return{doc:o,changed:s.length>0,changes:s,before:i,after:y}}function xo(e){let o=(e%360+360)%360,i=o>=180?o-360:o;return Object.is(i,-0)||Math.abs(i)<1e-9?0:i}function Ut(e,o){return Math.abs(e.x-o.x)<=1e-7&&Math.abs(e.y-o.y)<=1e-7}function ee(e,o,i){return(o.x-e.x)*(i.y-e.y)-(o.y-e.y)*(i.x-e.x)}function ce(e,o,i){let n=ee(o,i,e);return Math.abs(n)>1e-7?!1:e.x>=Math.min(o.x,i.x)-1e-7&&e.x<=Math.max(o.x,i.x)+1e-7&&e.y>=Math.min(o.y,i.y)-1e-7&&e.y<=Math.max(o.y,i.y)+1e-7}function Gt(e,o,i,n){let r=ee(e,o,i),s=ee(e,o,n),y=ee(i,n,e),f=ee(i,n,o);return(r>1e-7&&s<-1e-7||r<-1e-7&&s>1e-7)&&(y>1e-7&&f<-1e-7||y<-1e-7&&f>1e-7)?!0:Math.abs(r)<=1e-7&&ce(i,e,o)||Math.abs(s)<=1e-7&&ce(n,e,o)||Math.abs(y)<=1e-7&&ce(e,i,n)||Math.abs(f)<=1e-7&&ce(o,i,n)}function Vt(e){return e.reduce((o,i,n)=>{let r=e[(n+1)%e.length];return o+i.x*r.y-r.x*i.y},0)}function Qt(e){for(let o=0;o<e.length;o+=1){let i=(o+1)%e.length;for(let n=o+1;n<e.length;n+=1){let r=(n+1)%e.length;if(!(o===n||i===n||r===o)&&Gt(e[o],e[i],e[n],e[r]))return!0}}return!1}function at(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(o=>!Number.isFinite(o.x)||!Number.isFinite(o.y)||Math.abs(o.x)>1e7||Math.abs(o.y)>1e7)?{ok:!1,code:"invalid_coordinate",message:"Every polygon vertex must use a finite coordinate inside the safe chart range."}:e.some((o,i)=>Ut(o,e[(i+1)%e.length]))?{ok:!1,code:"duplicate_vertex",message:"Move or remove duplicate neighbouring vertices."}:Math.abs(Vt(e))<2?{ok:!1,code:"degenerate_polygon",message:"The polygon needs a visible enclosed area."}:Qt(e)?{ok:!1,code:"self_intersection",message:"Polygon edges cannot cross or touch each other."}:{ok:!0}}function U(e){return e.length>=3&&e.every(o=>Number.isFinite(o.x)&&Number.isFinite(o.y))}function V(e,o,i){let n=(e.y-o.y)*(i.x-o.x)-(e.x-o.x)*(i.y-o.y);if(Math.abs(n)>1e-7)return!1;let r=(e.x-o.x)*(i.x-o.x)+(e.y-o.y)*(i.y-o.y);if(r<-1e-7)return!1;let s=(i.x-o.x)**2+(i.y-o.y)**2;return r<=s+1e-7}function Q(e,o){let i=!1;for(let n=0,r=o.length-1;n<o.length;r=n++){let s=o[r],y=o[n];if(V(e,s,y))return!0;s.y>e.y!=y.y>e.y&&e.x<(y.x-s.x)*(e.y-s.y)/(y.y-s.y)+s.x&&(i=!i)}return i}function z(e,o,i){return(o.x-e.x)*(i.y-e.y)-(o.y-e.y)*(i.x-e.x)}function ct(e,o,i,n){let r=z(e,o,i),s=z(e,o,n),y=z(i,n,e),f=z(i,n,o);return(r>1e-7&&s<-1e-7||r<-1e-7&&s>1e-7)&&(y>1e-7&&f<-1e-7||y<-1e-7&&f>1e-7)?!0:Math.abs(r)<=1e-7&&V(i,e,o)||Math.abs(s)<=1e-7&&V(n,e,o)||Math.abs(y)<=1e-7&&V(e,i,n)||Math.abs(f)<=1e-7&&V(o,i,n)}function q(e){for(let o=0;o<e.length;o+=1){let i=(o+1)%e.length;for(let n=o+1;n<e.length;n+=1){let r=(n+1)%e.length;if(!(o===n||i===n||r===o)&&ct(e[o],e[i],e[n],e[r]))return!0}}return!1}function te(e,o){for(let i=0;i<e.length;i+=1)for(let n=0;n<o.length;n+=1)if(ct(e[i],e[(i+1)%e.length],o[n],o[(n+1)%o.length]))return!0;return Q(e[0],o)||Q(o[0],e)}function st(e,o){return!o.some((i,n)=>V(e,i,o[(n+1)%o.length]))&&Q(e,o)}function lt(e){let o=e.outlinePath;if(!o?.segments.length)return;let i=s=>Number.isFinite(s.x)&&Number.isFinite(s.y),n=(s,y)=>Math.hypot(s.x-y.x,s.y-y.y);if(!i(o.start))return 0;let r=o.start;for(let s=0;s<o.segments.length;s++){let y=o.segments[s];if(!y||!i(y.end)||n(r,y.end)<=1e-9||y.kind==="bezier"&&(!i(y.control1)||!i(y.control2)))return s;if(y.kind==="arc"){if(!i(y.center)||!Number.isFinite(y.radius)||y.radius<=1e-6)return s;let f=Math.max(1e-4,y.radius*1e-4);if(Math.abs(n(r,y.center)-y.radius)>f||Math.abs(n(y.end,y.center)-y.radius)>f)return s}r=y.end}return n(r,o.start)>1e-4,o.segments.length-1}function qt(e,o,i,n){let r=z(e,o,i),s=z(e,o,n),y=z(i,n,e),f=z(i,n,o);return(r>1e-7&&s<-1e-7||r<-1e-7&&s>1e-7)&&(y>1e-7&&f<-1e-7||y<-1e-7&&f>1e-7)}function dt(e,o){for(let i=0;i<e.length;i+=1)for(let n=0;n<o.length;n+=1)if(qt(e[i],e[(i+1)%e.length],o[n],o[(n+1)%o.length]))return!0;return e.some(i=>st(i,o))||o.some(i=>st(i,e))}function ut(e){return e.role!=="reference-focal"||!e.points||!U(e.points)?null:e.points}function yt(e,o){if(e.displayLabel!==void 0){let i=e.displayLabel.normalize("NFKC").trim();!(e.type==="row"&&e.displayLabel==="")&&(!i||i!==e.displayLabel||i.length>80)&&o.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 i=e.displayType.normalize("NFKC").trim();(!i||i!==e.displayType||i.length>24)&&o.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})}}function ft(e,o,i,n){let r=e.crop,s=r&&(!Number.isFinite(r.x)||!Number.isFinite(r.y)||!Number.isFinite(r.width)||!Number.isFinite(r.height)||r.x<0||r.y<0||r.width<=0||r.height<=0||r.x+r.width>1.000001||r.y+r.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)||s)&&i.push({severity:"error",code:"invalid-background-placement",message:`The ${o} image has an invalid position, size, opacity, rotation, or crop`,...n?{floorId:n}:{}})}function Se(e,o,i,n){let r=e.referenceImage,s=e.backgroundImage;r&&(ft(r,"reference",o,n),!r.assetId&&!r.url&&o.push({severity:"error",code:"invalid-reference-image",message:"A trace reference must identify a private asset or self-contained image",...n?{floorId:n}:{}})),s&&(ft(s,s.assetId?"legacy reference":"buyer background",o,n),!s.assetId&&!s.url&&o.push({severity:"error",code:"invalid-buyer-background",message:"A buyer background must contain a renderable image URL",...n?{floorId:n}:{}}),s.assetId&&i.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",...n?{floorId:n}:{}})),_e(e)&&o.push({severity:"error",code:"conflicting-reference-images",message:"The canonical reference and legacy asset-backed background identify different private sources",...n?{floorId:n}:{}})}function oe(e){let o=new Set(H.map(i=>i.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(i=>!!i.trim()&&i.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<=H.length&&new Set(e.accessibility.counts.map(i=>i.type)).size===e.accessibility.counts.length&&e.accessibility.counts.every(i=>o.has(i.type)&&Number.isInteger(i.count)&&i.count>0&&["user-confirmed","authoritative-source"].includes(i.evidence)&&!!i.sourceDescription.trim()&&i.sourceDescription.trim().length<=240))}function gt(e){let o=e.referenceInventoryExclusion;return!o||typeof o.assetId=="string"&&/^ref_[0-9a-f-]{36}$/.test(o.assetId)&&o.assetId===e.referenceSource?.assetId&&typeof o.logicalSectionId=="string"&&o.logicalSectionId===(e.logicalSectionId??e.id)&&typeof o.reason=="string"&&!!o.reason.trim()&&o.reason.trim().length<=80&&["user-confirmed","authoritative-source"].includes(o.evidence)&&typeof o.sourceDescription=="string"&&!!o.sourceDescription.trim()&&o.sourceDescription.trim().length<=240}function mt(e){let o=e.referenceCategorySource;return!o||/^ref_[0-9a-f-]{36}$/.test(o.assetId)&&/^#[0-9a-f]{6}$/i.test(o.sourceColor)&&(o.sourceColors===void 0||o.sourceColors.length>0&&o.sourceColors.includes(o.sourceColor)&&new Set(o.sourceColors).size===o.sourceColors.length&&o.sourceColors.every(i=>/^#[0-9a-f]{6}$/i.test(i)&&`${i[1]}${i[3]}${i[5]}`.toLowerCase()===`${o.sourceColor[1]}${o.sourceColor[3]}${o.sourceColor[5]}`.toLowerCase()))&&(o.logicalSectionIds===void 0||o.logicalSectionIds.length>0&&new Set(o.logicalSectionIds).size===o.logicalSectionIds.length&&o.logicalSectionIds.every(i=>!!i.trim()&&i.length<=160))&&(o.assignmentDerivation===void 0||["source-color-class","confirmed-logical-sections"].includes(o.assignmentDerivation))&&o.assignmentEvidence===void 0==!o.assignmentSourceDescription?.trim()&&(o.assignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(o.assignmentEvidence))&&(o.assignmentSourceDescription?.trim().length??0)<=240&&(o.assignmentDerivation!=="confirmed-logical-sections"||o.assignmentEvidence!==void 0&&!!o.assignmentSourceDescription?.trim())&&o.sourcePaletteColor===void 0==(o.sourcePaletteColorEvidence===void 0)&&o.sourcePaletteColorEvidence===void 0==!o.sourcePaletteColorSourceDescription?.trim()&&(o.sourcePaletteColor===void 0||/^#[0-9a-f]{6}$/i.test(o.sourcePaletteColor))&&(o.sourcePaletteColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(o.sourcePaletteColorEvidence))&&(o.sourcePaletteColorSourceDescription?.trim().length??0)<=240&&["user-confirmed","authoritative-source"].includes(o.labelEvidence)&&!!o.labelSourceDescription.trim()&&o.labelSourceDescription.trim().length<=240&&e.price!==void 0&&["user-confirmed","authoritative-source"].includes(o.priceEvidence)&&!!o.priceSourceDescription.trim()&&o.priceSourceDescription.trim().length<=240&&o.outputColorEvidence===void 0==!o.outputColorSourceDescription?.trim()&&(o.outputColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(o.outputColorEvidence))&&(o.outputColorSourceDescription?.trim().length??0)<=240&&(e.color.toLowerCase()===(o.sourcePaletteColor??o.sourceColor).toLowerCase()&&new Set((o.sourceColors??[o.sourceColor]).map(i=>`${i[1]}${i[3]}${i[5]}`.toLowerCase())).size===1||o.outputColorEvidence!==void 0&&["user-confirmed","authoritative-source"].includes(o.outputColorEvidence))}function bt(e){let o=e.referenceDirectSeatImport;return!o||/^ref_[0-9a-f-]{36}$/.test(o.assetId)&&/^source-color:(?:#[0-9a-f]{6}(?:\+#[0-9a-f]{6})*|unclassified)$/i.test(o.familyId)}function pt(e,o){let i=e.floors?.length?e.floors.map(s=>({id:s.id,objects:s.objects})):[{id:"floor-0",objects:e.objects}],n=new Map,r=new Map;for(let s of i){let y=s.objects.filter(a=>a.type==="row"),f=new Map,m=new Map;for(let a of y){if(a.segmentedRow){let u=f.get(a.segmentedRow.groupId)??[];u.push(a),f.set(a.segmentedRow.groupId,u)}if(a.rowBlockGeneration){let u=m.get(a.rowBlockGeneration.groupId)??[];u.push(a),m.set(a.rowBlockGeneration.groupId,u)}a.segmentedRow&&a.rowBlockGeneration&&o.push({severity:"error",code:"invalid-row-group-membership",message:`Row "${a.label}" cannot be both a segmented-row component and a generated row-block member`,objectId:a.id,floorId:s.id})}for(let[a,u]of f){let g=n.get(a);g&&g!==s.id&&o.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${a}" cannot span multiple floors`,objectId:u[0].id,floorId:s.id}),n.set(a,s.id);let b=u.slice().sort((j,O)=>j.segmentedRow.componentIndex-O.segmentedRow.componentIndex),p=b[0]?.segmentedRow,I=p?.componentCount??0,$=p?JSON.stringify({displayLabel:p.displayLabel,repeatLabelOnComponents:p.repeatLabelOnComponents,displayType:p.displayType,labelPresentation:p.labelPresentation,viewFromSeatUrl:p.viewFromSeatUrl,viewFromSeatMeta:p.viewFromSeatMeta,confidenceEvidence:p.confidenceEvidence,smoothing:p.smoothing}):"";p&&I>=2&&I<=64&&b.length===I&&p.boundaryBefore==="start"&&b.every((j,O)=>{let C=j.segmentedRow;return C.kind==="segmented-row-v1"&&C.groupId===a&&C.componentCount===I&&C.componentIndex===O&&(O===0?C.boundaryBefore==="start":C.boundaryBefore!=="start")&&C.displayLabel.normalize("NFKC").trim()===C.displayLabel&&C.displayLabel.length>0&&C.displayLabel.length<=80&&JSON.stringify({displayLabel:C.displayLabel,repeatLabelOnComponents:C.repeatLabelOnComponents,displayType:C.displayType,labelPresentation:C.labelPresentation,viewFromSeatUrl:C.viewFromSeatUrl,viewFromSeatMeta:C.viewFromSeatMeta,confidenceEvidence:C.confidenceEvidence,smoothing:C.smoothing})===$})||o.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${a}" has missing, duplicated, cyclic, or inconsistent component metadata`,objectId:u[0]?.id,floorId:s.id})}for(let[a,u]of m){let g=r.get(a);g&&g!==s.id&&o.push({severity:"error",code:"invalid-row-block-generation",message:"A generated row block cannot span multiple floors",objectId:u[0].id,floorId:s.id}),r.set(a,s.id)}}}function Ht(e){return e.type==="row"||e.type==="table"||e.type==="booth"}function Xt(e){let o=[],i=new Map((e.overrides??[]).map(n=>[n.index,n]));for(let n=0;n<e.seatCount;n++){let r=i.get(n);r?.skip||o.push({label:Le(e,n,r),index:n})}return o}function ht(e){let o=[],i=new Map((e.overrides??[]).map(n=>[n.index,n]));for(let n=0;n<e.seatCount;n++){let r=i.get(n);r?.skip||o.push({label:r?.label??`${e.label}-${n+1}`,index:n})}return o}function xe(e){return Array.isArray(e)&&e.every(o=>!!o&&typeof o=="object")}function vt(e){return Array.isArray(e)&&e.every(o=>Array.isArray(o)&&o.every(i=>!!i&&typeof i=="object"))}function It(e,o={}){let i=o.maxInventory??1e5,n=[];e.floorOverview!==void 0&&e.floorOverview!=="combined"&&e.floorOverview!=="separated"&&n.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)&&n.push({severity:"error",code:"invalid-event-configuration",message:"Active event configuration must contain 1 to 100 normalized characters"});let r=[],s=new Set(e.categories.map(t=>t.key)),y=new Set(H.map(t=>t.key)),f=new Map(e.categories.map(t=>[t.key,t.price!=null||t.notForSale===!0])),m=new Set;Se(e,n,r),e.theme?.sectionDetail!==void 0&&!["rows","seats"].includes(e.theme.sectionDetail)&&n.push({severity:"error",code:"invalid-section-detail",message:"Section detail must be rows or seats"}),e.theme?.logoUrl!==void 0&&!de(e.theme.logoUrl)&&n.push({severity:"error",code:"invalid-theme-logo-url",message:"The buyer-facing theme logo URL is invalid"});let a=de,u=(t,x,c,l={})=>{if(x===void 0)return;if(!x||typeof x!="object"||Array.isArray(x)){n.push({severity:"error",code:"invalid-seat-view-metadata",message:`${c} view metadata is invalid`,...l});return}let d=x;t||r.push({severity:"warning",code:"orphaned-seat-view-metadata",message:`${c} view metadata has no image`,...l});let v=new Set(["exact-seat","row-representative","section-representative","floor-representative","venue-representative"]);d.projection!==void 0&&d.projection!=="equirectangular"&&n.push({severity:"error",code:"invalid-seat-view-projection",message:`${c} view projection must be equirectangular`,...l}),d.coverage!==void 0&&!v.has(d.coverage)&&n.push({severity:"error",code:"invalid-seat-view-coverage",message:`${c} view coverage is invalid`,...l});let h=(S,k,A)=>typeof S=="number"&&Number.isFinite(S)&&S>=k&&S<=A;if(d.initialBearingDeg!==void 0&&!h(d.initialBearingDeg,-360,360)&&n.push({severity:"error",code:"invalid-seat-view-bearing",message:`${c} view bearing must be between -360\xB0 and 360\xB0`,...l}),d.initialPitchDeg!==void 0&&!h(d.initialPitchDeg,-90,90)&&n.push({severity:"error",code:"invalid-seat-view-pitch",message:`${c} view pitch must be between -90\xB0 and 90\xB0`,...l}),d.capturedAt!==void 0&&(typeof d.capturedAt!="string"||d.capturedAt.length>40||!Number.isFinite(Date.parse(d.capturedAt)))&&n.push({severity:"error",code:"invalid-seat-view-capture-date",message:`${c} view capture date is invalid`,...l}),d.sourceLabel!==void 0&&(typeof d.sourceLabel!="string"||d.sourceLabel.trim().length>100)&&n.push({severity:"error",code:"invalid-seat-view-source",message:`${c} view source label is invalid`,...l}),d.previewUrl!==void 0&&!a(d.previewUrl)&&n.push({severity:"error",code:"invalid-seat-view-preview-url",message:`${c} view preview URL is invalid`,...l}),d.variants!==void 0){let S=Array.isArray(d.variants)?d.variants:[];if(!Array.isArray(d.variants)||S.length<1||S.length>4)n.push({severity:"error",code:"invalid-seat-view-variants",message:`${c} view variants must contain between 1 and 4 tiers`,...l});else{let k=new Set;for(let A of S){if(!A||typeof A!="object"||!a(A.url)||!Number.isInteger(A.width)||A.width<1||A.width>12e3||!Number.isInteger(A.height)||A.height<1||A.height>12e3||A.width!==A.height*2||typeof A.sha256!="string"||!/^[a-f0-9]{64}$/.test(A.sha256)||k.has(A.width)){n.push({severity:"error",code:"invalid-seat-view-variant",message:`${c} view variant is not a unique immutable 2:1 equirectangular tier`,...l});break}k.add(A.width)}}}for(let[S,k]of[["width",d.sourceWidth],["height",d.sourceHeight],["preview width",d.previewWidth],["preview height",d.previewHeight]])k!==void 0&&(!Number.isInteger(k)||k<1||k>32768)&&n.push({severity:"error",code:"invalid-seat-view-dimensions",message:`${c} view source ${S} is invalid`,...l});d.captureEyeHeightM!==void 0&&!h(d.captureEyeHeightM,.5,3)&&n.push({severity:"error",code:"invalid-seat-view-eye-height",message:`${c} capture eye height must be between 0.5 m and 3 m`,...l}),d.eventConfigurationId!==void 0&&(typeof d.eventConfigurationId!="string"||!d.eventConfigurationId.trim()||d.eventConfigurationId.length>100)&&n.push({severity:"error",code:"invalid-seat-view-configuration",message:`${c} event configuration id is invalid`,...l}),d.eventConfigurationVersion!==void 0&&(!Number.isInteger(d.eventConfigurationVersion)||d.eventConfigurationVersion<1)&&n.push({severity:"error",code:"invalid-seat-view-configuration-version",message:`${c} event configuration version is invalid`,...l}),d.eventConfigurationVersion!==void 0&&!d.eventConfigurationId&&n.push({severity:"error",code:"invalid-seat-view-configuration-pin",message:`${c} event configuration version requires an id`,...l})},g=(t,x,c={})=>{if(t===void 0)return;let l=k=>{n.push({severity:"error",code:"invalid-seat-confidence-evidence",message:`${x} confidence evidence ${k}`,...c})};if(!t||typeof t!="object"||Array.isArray(t)){l("is invalid");return}let d=t;d.schema!=="seatlayer.seat-confidence/1"&&l("has an unsupported schema");let v=(k,A)=>typeof k=="string"&&k.normalize("NFKC").trim()===k&&k.length>0&&k.length<=A;v(d.evidenceId,120)||l("has an invalid evidence id"),v(d.modelVersion,120)||l("has an invalid model version"),new Set(["synthetic-model","organizer-approved","calibrated-provider"]).has(d.evidenceKind)||l("has an invalid evidence kind"),new Set(["generated","geometry-verified","configuration-verified"]).has(d.modelLevel)||l("has an invalid model level");let h=d.realityLevel??"none";new Set(["none","comparable-build-reference","actual-build-checked"]).has(h)||l("has an invalid reality level"),d.eventConfigurationId!==void 0&&!v(d.eventConfigurationId,100)&&l("has an invalid event configuration id"),d.eventConfigurationVersion!==void 0&&(!Number.isInteger(d.eventConfigurationVersion)||d.eventConfigurationVersion<1)&&l("has an invalid event configuration version"),d.status!==void 0&&!new Set(["draft","approved","retracted"]).has(d.status)&&l("has an invalid publication status"),d.basisSha256!==void 0&&!/^[a-f0-9]{64}$/.test(d.basisSha256)&&l("has an invalid venue basis SHA-256"),d.basisSha256!==void 0&&d.status!=="approved"&&l("can carry a venue basis SHA-256 only after approval");for(let[k,A]of[["assessment",d.assessedAt],["expiry",d.validUntil]])A!==void 0&&(!v(A,40)||!Number.isFinite(Date.parse(A)))&&l(`has an invalid ${k} date`);d.approvedByRole!==void 0&&!v(d.approvedByRole,100)&&l("has an invalid approving organization or role"),d.sourceLabel!==void 0&&!v(d.sourceLabel,120)&&l("has an invalid source label"),d.limitations!==void 0&&(!Array.isArray(d.limitations)||d.limitations.length>6||d.limitations.some(k=>!v(k,160)))&&l("has invalid limitations"),d.evidenceKind==="synthetic-model"&&(d.modelLevel!=="generated"||h!=="none")&&l("cannot describe synthetic data as verified or reality checked"),d.modelLevel!=="generated"&&(!d.assessedAt||!d.approvedByRole)&&l("requires an assessment date and approving organization or role for verified model levels"),d.modelLevel==="configuration-verified"&&!d.eventConfigurationId&&l("requires an event configuration id for configuration verification"),h!=="none"&&(!d.assessedAt||!d.sourceLabel)&&l("requires an assessment date and source for reality evidence"),h==="actual-build-checked"&&(d.modelLevel!=="configuration-verified"||!d.eventConfigurationId)&&l("requires a configuration-verified model and event configuration for an actual-build check");let S=d.modeledTarget;S!==void 0&&(!S||typeof S!="object"||Array.isArray(S)?l("has an invalid modeled target"):((!v(S.label,80)||!v(S.methodLabel,100))&&l("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)&&l("has invalid modeled-target ray counts"),new Set(["clear","partial","obstructed"]).has(S.classification)||l("has an invalid modeled-target classification"),S.occluderLabels!==void 0&&(!Array.isArray(S.occluderLabels)||S.occluderLabels.length>10||S.occluderLabels.some(k=>!v(k,100)))&&l("has invalid modeled-target occluders")))};u(e.viewFromSeatUrl,e.viewFromSeatMeta,"Venue"),g(e.confidenceEvidence,"Venue"),e.viewFromSeatUrl!==void 0&&!a(e.viewFromSeatUrl)&&n.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&&!a(t.viewFromSeatUrl)&&n.push({severity:"error",code:"invalid-floor-view-url",message:`Floor "${t.name}" has an invalid view-from-seat image URL`}),u(t.viewFromSeatUrl,t.viewFromSeatMeta,`Floor "${t.name}"`,{floorId:t.id}),g(t.confidenceEvidence,`Floor "${t.name}"`,{floorId:t.id});let b=e.floors?.length?e.floors.flatMap(t=>t.objects):e.objects;for(let t of b)if((t.type==="row"||t.type==="section")&&(t.viewFromSeatUrl!==void 0&&!a(t.viewFromSeatUrl)&&n.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}),u(t.viewFromSeatUrl,t.viewFromSeatMeta,`${t.type==="row"?"Row":"Section"} "${t.label}"`,{objectId:t.id}),g(t.confidenceEvidence,`${t.type==="row"?"Row":"Section"} "${t.label}"`,{objectId:t.id})),t.type==="row"&&t.segmentedRow&&(t.segmentedRow.viewFromSeatUrl!==void 0&&!a(t.segmentedRow.viewFromSeatUrl)&&n.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}),u(t.segmentedRow.viewFromSeatUrl,t.segmentedRow.viewFromSeatMeta,`Segmented row "${t.segmentedRow.displayLabel}"`,{objectId:t.id}),g(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&&!a(x.viewFromSeatUrl)&&n.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]}),u(x.viewFromSeatUrl,x.viewFromSeatMeta,`Seat ${x.index+1}`,{objectId:t.id,seatIndices:[x.index]}),g(x.confidenceEvidence,`Seat ${x.index+1}`,{objectId:t.id,seatIndices:[x.index]});let p=new Set;for(let t of e.categories){p.has(t.key)&&n.push({severity:"error",code:"duplicate-category-key",message:`Category key "${t.key}" is used more than once`,categoryKey:t.key}),p.add(t.key);let x=new Set;for(let c of t.tiers??[]){if(x.has(c.id)&&n.push({severity:"error",code:"duplicate-category-tier-id",message:`Ticket tier id "${c.id}" is used more than once in category "${t.key}"`,categoryKey:t.key}),c.restriction!=null&&!["companion","child","senior","student","membership","custom"].includes(c.restriction)&&n.push({severity:"error",code:"invalid-category-tier-restriction",message:`Ticket tier "${c.name}" has an unknown restriction`,categoryKey:t.key}),c.buyerMessage!=null&&(!c.buyerMessage.trim()||c.buyerMessage.length>240)&&n.push({severity:"error",code:"invalid-category-tier-buyer-message",message:`Ticket tier "${c.name}" buyer guidance must contain 1 to 240 characters`,categoryKey:t.key}),c.currency!=null&&!/^[A-Z]{3}$/.test(c.currency)&&n.push({severity:"error",code:"invalid-category-tier-currency",message:`Ticket tier "${c.name}" must use a three-letter ISO currency`,categoryKey:t.key}),c.applicability!=null){let l=c.applicability.seatLabels,d=c.applicability.accessibility;(l!==void 0&&(!Array.isArray(l)||!l.length||l.length>1e4||l.some(v=>typeof v!="string"||!v.trim()||v.length>160)||new Set(l).size!==l.length)||d!==void 0&&(!Array.isArray(d)||!d.length||d.some(v=>!y.has(v))||new Set(d).size!==d.length))&&n.push({severity:"error",code:"invalid-category-tier-applicability",message:`Ticket tier "${c.name}" has invalid seat applicability`,categoryKey:t.key})}c.evidence!=null&&(!["public-host","public-event","user-confirmed"].includes(c.evidence.provenance)||!c.evidence.sourceDescription.trim()||c.evidence.sourceDescription.length>240||c.evidence.capturedAt!==void 0&&(c.evidence.capturedAt.length>40||!Number.isFinite(Date.parse(c.evidence.capturedAt))))&&n.push({severity:"error",code:"invalid-category-tier-evidence",message:`Ticket tier "${c.name}" has invalid evidence provenance`,categoryKey:t.key}),x.add(c.id)}mt(t)||n.push({severity:"error",code:"invalid-reference-category-source",message:`Category ${t.label||t.key} has incomplete or invalid reference evidence`,categoryKey:t.key}),bt(t)||n.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 I=new Map,$=new Map,w=[],j=new Map,O=0,C=0,_=new Set;for(let t of e.floors??[])Se(t,n,r,t.id),_.has(t.id)&&n.push({severity:"error",code:"duplicate-floor-id",message:`Floor id "${t.id}" is used more than once`,floorId:t.id}),_.add(t.id),t.baseHeightM!==void 0&&(!Number.isFinite(t.baseHeightM)||t.baseHeightM<Y||t.baseHeightM>W)&&n.push({severity:"error",code:"invalid-floor-base-height",message:`Floor "${t.name}" base height must be between ${Y} and ${W} metres`,floorId:t.id});let F=e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects;pt(e,n);let E=new Set;for(let t of F)E.has(t.id)&&n.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)&&n.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))&&n.push({severity:"error",code:"invalid-zone-focal-point",message:`Zone "${t.label}" must use a finite focal point`});let M=new Map;for(let t of F)if(!(t.type!=="section"||!t.zone)){if(e.zones?.length&&!P.has(t.zone)){n.push({severity:"error",code:"unknown-section-zone",message:`Section "${t.displayLabel??t.label}" references unknown zone "${t.zone}"`,objectId:t.id});continue}M.has(t.zone)||M.set(t.zone,t)}for(let[t,x]of M){let c=e.zones?.find(l=>l.id===t);c&&(c?.focalPoint||r.push({severity:"warning",code:"missing-zone-focal-point",message:`Zone "${c?.label??t}" uses the legacy floor focal; set its own focal point before publishing`,objectId:x.id}))}for(let t of F)if((t.type==="row"||t.type==="table"||t.type==="booth"||t.type==="gaArea")&&yt(t,n),Ht(t)){if(O++,C+=t.type==="booth"?1:t.type==="row"?Pe(t):t.bookAsWhole||t.variableOccupancy?t.seatCount:ht(t).length,I.get(t.label)!==void 0?t.type!=="row"&&n.push({severity:"error",code:"duplicate-object-label",message:`Label "${t.label}" is used by more than one object`,objectId:t.id}):I.set(t.label,t.id),s.has(t.categoryKey)?m.add(t.categoryKey):n.push({severity:"error",code:"unknown-category",message:`"${t.label}" references unknown category "${t.categoryKey}"`,objectId:t.id,categoryKey:t.categoryKey}),t.type==="row"){oe(t.referenceInventorySource)||n.push({severity:"error",code:"invalid-reference-inventory-source",message:`Row "${t.label}" has invalid reference-inventory provenance`,objectId:t.id}),t.seatCount<1&&n.push({severity:"error",code:"empty-row",message:`Row "${t.label}" has no seats`,objectId:t.id});let c=new Set;for(let l of t.overrides??[]){(l.accessibility??[]).filter(S=>!y.has(S)).length&&n.push({severity:"error",code:"invalid-accessibility-type",message:`Row "${t.label}" seat ${l.index+1} uses an unknown accessibility type`,objectId:t.id,seatIndices:[l.index]}),(!Number.isInteger(l.index)||l.index<0||l.index>=t.seatCount||c.has(l.index))&&n.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(l.index)?{seatIndices:[l.index]}:{}}),c.add(l.index);let v=l.wheelchairSpaceType,h=l.accessible===!0||l.accessibility?.includes("wheelchair");v!==void 0&&v!=="seat-present"&&v!=="no-seat"?n.push({severity:"error",code:"invalid-wheelchair-space",message:`Row "${t.label}" seat ${l.index+1} has an invalid wheelchair-space type`,objectId:t.id,seatIndices:[l.index]}):v&&(!h||l.skip)&&n.push({severity:"error",code:"invalid-wheelchair-space",message:l.skip?`Row "${t.label}" seat ${l.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Row "${t.label}" seat ${l.index+1} must include wheelchair accessibility for its physical-space type`,objectId:t.id,seatIndices:[l.index]})}for(let l of Xt(t))re(l.label)&&n.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${l.label}" uses SeatLayer's reserved GA namespace`,objectId:t.id,seatIndices:[l.index]}),$.get(l.label)!==void 0?w.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${l.label}" is used more than once`,objectId:t.id,seatIndices:[l.index]}):$.set(l.label,t.id)}else if(t.type==="table"){let c=t.bookAsWhole===!0||t.variableOccupancy===!0;if(t.fill!==void 0&&!ze(t.fill)&&n.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"?n.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!==De(t.seatCount,t.seatArc))&&n.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(K=>Number.isInteger(t.seatCountsBySide[K])&&t.seatCountsBySide[K]>=0&&t.seatCountsBySide[K]<=40),A=k?h.reduce((K,Ot)=>K+t.seatCountsBySide[Ot],0):Number.NaN;(t.shape!=="rect"||S.length!==h.length||S.some(K=>!h.includes(K))||!k||A!==t.seatCount||A<1||A>40)&&n.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})}c&&t.overrides?.length&&n.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 l=new Set;for(let h of t.overrides??[]){(h.accessibility??[]).filter(K=>!y.has(K)).length&&n.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||l.has(h.index))&&n.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]}:{}}),l.add(h.index),h.categoryKey&&!s.has(h.categoryKey)?n.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&&m.add(h.categoryKey);let k=h.wheelchairSpaceType,A=h.accessible===!0||h.accessibility?.includes("wheelchair");k!==void 0&&k!=="seat-present"&&k!=="no-seat"?n.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&&(!A||h.skip)&&n.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?n.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)&&n.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)&&n.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${t.label}" has guest bounds without variable-occupancy selling`,objectId:t.id}),oe(t.referenceInventorySource)||n.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)&&n.push({severity:"error",code:"bad-table",message:`Table "${t.label}" is missing required dimensions or seats`,objectId:t.id});let v=c?[{label:t.label,index:void 0}]:ht(t);for(let h of v)re(h.label)&&n.push({severity:"error",code:"reserved-seat-label",message:`Inventory label "${h.label}" uses SeatLayer's reserved GA namespace`,objectId:t.id}),$.get(h.label)!==void 0?w.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]}}):$.set(h.label,t.id)}else if(t.type==="booth"){oe(t.referenceInventorySource)||n.push({severity:"error",code:"invalid-reference-inventory-source",message:`Booth "${t.label}" has invalid reference-inventory provenance`,objectId:t.id});let c=t.label;re(c)&&n.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${c}" uses SeatLayer's reserved GA namespace`,objectId:t.id}),$.get(c)!==void 0?w.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${c}" is used more than once`,objectId:t.id}):$.set(c,t.id)}}else if(t.type==="gaArea"){if(!Ke(t))n.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 l of Be(t))$.get(l)!==void 0?w.push({severity:"error",code:"duplicate-seat-label",message:`GA inventory label "${l}" is used more than once`,objectId:t.id}):$.set(l,t.id);if(oe(t.referenceInventorySource)||n.push({severity:"error",code:"invalid-reference-inventory-source",message:`GA area "${t.label}" has invalid reference-inventory provenance`,objectId:t.id}),!xe(t.points)){n.push({severity:"error",code:"invalid-polygon-points",message:`GA area "${t.label}" outline must be a list of points`,objectId:t.id});continue}(!U(t.points)||Math.abs(G(t.points))<=1e-7||q(t.points))&&n.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 c=t.holes??[];if(!vt(c))n.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 l=c.length<=64?c.findIndex(d=>d.length>512||!U(d)||Math.abs(G(d))<=1e-7||q(d)?!0:!d.flatMap((h,S)=>{let k=d[(S+1)%d.length];return[h,{x:(h.x+k.x)/2,y:(h.y+k.y)/2}]}).every(h=>Q(h,t.points))):0;if(l>=0)n.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:l});else if(c.some((d,v)=>c.slice(v+1).some(h=>te(d,h)))){let d=c.findIndex((v,h)=>c.slice(h+1).some(S=>te(v,S)));n.push({severity:"error",code:"overlapping-ga-holes",message:`GA area "${t.label}" has overlapping cutout polygons`,objectId:t.id,holeIndex:d})}}s.has(t.categoryKey)?m.add(t.categoryKey):n.push({severity:"error",code:"unknown-category",message:`"${t.label}" references unknown category "${t.categoryKey}"`,objectId:t.id,categoryKey:t.categoryKey}),t.capacity<1&&n.push({severity:"error",code:"empty-ga",message:`GA area "${t.label}" has zero capacity`,objectId:t.id}),(!Number.isInteger(t.capacity)||t.capacity>be)&&n.push({severity:"error",code:"invalid-ga-capacity",message:`GA area "${t.label}" capacity must be a whole number from 1 to ${be}`,objectId:t.id}),O++,C+=Math.max(0,Math.floor(t.capacity))}else if(t.type==="section"){if(t.displayLabel!==void 0){let l=t.displayLabel.normalize("NFKC").trim();l?(l!==t.displayLabel||l.length>80)&&n.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}):n.push({severity:"error",code:"unnamed-section",message:`Section "${t.label}" needs a buyer-facing name before seats are added`,objectId:t.id})}if(t.editor?.defaultCategoryKey&&!s.has(t.editor.defaultCategoryKey)&&n.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<fe||t.elevation>X)){let l=Number.isInteger(t.elevation)&&t.elevation>X&&t.elevation<=Me;r.push({severity:"warning",code:l?"legacy-section-elevation":"invalid-section-elevation",message:l?`Section "${t.label}" uses legacy tier ${t.elevation}; set an exact height before normalizing it to tier ${X}`:`Section "${t.label}" elevation must be a whole-number tier from ${fe} to ${X}`,objectId:t.id})}if(t.height!==void 0&&(!Number.isFinite(t.height)||t.height<Y||t.height>W)&&n.push({severity:"error",code:"invalid-section-height",message:`Section "${t.label}" exact height must be between ${Y} and ${W} metres`,objectId:t.id}),t.rake!==void 0&&(!Number.isFinite(t.rake)||t.rake<ye||t.rake>ge)&&n.push({severity:"error",code:"invalid-section-rake",message:`Section "${t.label}" rake must be between ${ye}\xB0 and ${ge}\xB0`,objectId:t.id}),t.surfaceKind!==void 0&&t.surfaceKind!=="flat"&&t.surfaceKind!=="rakedRows"&&n.push({severity:"error",code:"invalid-section-surface-kind",message:`Section "${t.label}" surfaceKind must be 'flat' or 'rakedRows'`,objectId:t.id}),!xe(t.outline)){n.push({severity:"error",code:"invalid-polygon-points",message:`Section "${t.label}" outline must be a list of points`,objectId:t.id});continue}if(!U(t.outline)||Math.abs(G(t.outline))<=1e-7||q(t.outline)){n.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 l=[];try{l=Re(t.outlinePath)}catch{}(!Ee(t.outlinePath)||!l.length||Math.hypot(t.outlinePath.start.x-t.outline[0].x,t.outlinePath.start.y-t.outline[0].y)>1e-4||!U(l)||Math.abs(G(l))<=1e-7||q(l))&&n.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))&&n.push({severity:"error",code:"invalid-section-reference-source",message:`Section "${t.label}" has invalid opaque reference provenance`,objectId:t.id}),gt(t)||n.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())n.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 l=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}),d=j.get(t.logicalSectionId);d&&(d.label!==t.label||d.semanticSignature!==l)?n.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}):d||j.set(t.logicalSectionId,{label:t.label,semanticSignature:l})}let x=t.holes??[];if(!vt(x)){n.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){n.push({severity:"error",code:"invalid-section-hole",message:`Section "${t.label}" has an invalid opening collection`,objectId:t.id});continue}let c=-1;for(let l=0;l<x.length;l++){let d=x[l];if(d.length>512||!U(d)||Math.abs(G(d))<=1e-7||q(d)){c=l;break}if(!d.flatMap((h,S)=>{let k=d[(S+1)%d.length];return[h,{x:(h.x+k.x)/2,y:(h.y+k.y)/2}]}).every(h=>Q(h,t.outline))){c=l;break}}if(c>=0)n.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:c});else if(x.some((l,d)=>x.slice(d+1).some(v=>te(l,v)))){let l=x.findIndex((d,v)=>x.slice(v+1).some(h=>te(d,h)));n.push({severity:"error",code:"overlapping-section-holes",message:`Section "${t.label}" has overlapping openings`,objectId:t.id,holeIndex:l})}}let D=e.floors?.length?e.floors.map(t=>t.objects):[e.objects];for(let t of D){let x=t.filter(c=>c.type==="section");for(let c of t.filter(l=>l.type==="text")){let l=c.iconKey;l!==void 0&&!We(l)&&n.push({severity:"error",code:"invalid-icon-key",message:`Venue icon "${c.text||c.id}" references an unknown symbol`,objectId:c.id});let d=c.fontFamily;d!==void 0&&(typeof d!="string"||d.normalize("NFKC").trim()!==d||d.length<1||d.length>120)&&n.push({severity:"error",code:"invalid-text-font-family",message:`Text "${c.text||c.id}" font family must contain 1 to 120 normalized characters`,objectId:c.id});let v=c.background;(c.width!==void 0&&(!Number.isFinite(c.width)||c.width<40||c.width>1200)||c.align!==void 0&&!["left","center","right"].includes(c.align)||c.lineHeight!==void 0&&(!Number.isFinite(c.lineHeight)||c.lineHeight<.8||c.lineHeight>3)||c.letterSpacing!==void 0&&(!Number.isFinite(c.letterSpacing)||c.letterSpacing<-2||c.letterSpacing>20)||c.opacity!==void 0&&(!Number.isFinite(c.opacity)||c.opacity<.1||c.opacity>1)||v!==void 0&&(!/^#[0-9a-f]{6}$/i.test(v.color)||v.padding!==void 0&&(!Number.isFinite(v.padding)||v.padding<0||v.padding>40)||v.cornerRadius!==void 0&&(!Number.isFinite(v.cornerRadius)||v.cornerRadius<0||v.cornerRadius>40)||v.opacity!==void 0&&(!Number.isFinite(v.opacity)||v.opacity<.1||v.opacity>1)))&&n.push({severity:"error",code:"invalid-text-layout",message:`Text "${c.text||c.id}" has invalid width, spacing, opacity, alignment, or background layout`,objectId:c.id})}for(let c of t.filter(l=>l.type==="shape")){if(c.eventConfigurationIds!==void 0){let v=c.eventConfigurationIds;Array.isArray(v)&&v.length>0&&v.length<=20&&v.every(S=>typeof S=="string"&&S.normalize("NFKC").trim()===S&&S.length>=1&&S.length<=100)&&new Set(v).size===v.length||n.push({severity:"error",code:"invalid-shape-configurations",message:`Shape "${c.label||c.id}" must reference 1 to 20 unique event configuration ids`,objectId:c.id})}if(c.heightM!==void 0&&(!Number.isFinite(c.heightM)||c.heightM<.05||c.heightM>50)&&n.push({severity:"error",code:"invalid-shape-height",message:`Shape "${c.label||c.id}" height must be between 0.05 m and 50 m`,objectId:c.id}),c.stroke!==void 0&&(!c.stroke||typeof c.stroke.color!="string"||!/^#[0-9a-f]{6}$/i.test(c.stroke.color)||!Number.isFinite(c.stroke.width)||c.stroke.width<.5||c.stroke.width>40)&&n.push({severity:"error",code:"invalid-shape-stroke",message:`Shape "${c.label||c.id}" stroke must use a six-digit color and width from 0.5 to 40 chart units`,objectId:c.id}),(c.lineCap!==void 0||c.lineJoin!==void 0||c.startEnding!==void 0||c.endEnding!==void 0)&&!Ie(c.kind)?n.push({severity:"error",code:"invalid-shape-line-style-applicability",message:`Shape "${c.label||c.id}" may use line caps, joins, and end decorations only when it is an open line or polyline`,objectId:c.id}):Ie(c.kind)&&(c.lineCap!==void 0&&!Ze.includes(c.lineCap)||c.lineJoin!==void 0&&!Je.includes(c.lineJoin)||c.startEnding!==void 0&&!ve.includes(c.startEnding)||c.endEnding!==void 0&&!ve.includes(c.endEnding))&&n.push({severity:"error",code:"invalid-shape-line-style",message:`Shape "${c.label||c.id}" has an unsupported line cap, join, or ending`,objectId:c.id}),c.points!==void 0&&!xe(c.points)){n.push({severity:"error",code:"invalid-polygon-points",message:`Shape "${c.label||c.id}" points must be a list of points`,objectId:c.id});continue}if(c.kind==="polygon"){let v=at(c.points??[]);v.ok||n.push({severity:"error",code:"invalid-shape-polygon",message:`Shape "${c.label||c.id}" has invalid polygon geometry: ${v.message}`,objectId:c.id})}let d=ut(c);if(d){for(let v of x)if(dt(d,v.outline)){n.push({severity:"error",code:"reference-focal-overlaps-section",message:`Reference focal area "${c.label??c.id}" overlaps section "${v.label}"`,objectId:c.id});break}}}}C>i&&n.push({severity:"error",code:"inventory-capacity-exceeded",message:`Chart has ${C} bookable units; the maximum is ${i}`}),n.push(...w.slice(0,5)),w.length>5&&n.push({severity:"error",code:"duplicate-seat-label",message:`${w.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 ae(e)){let x=t.families[0]?.targets[0];r.push({severity:"warning",code:"category-inventory-family-conflict",message:nt(t),categoryKey:t.categoryKey,...x?{objectId:x.id,floorId:x.floorId}:{},relatedObjectIds:t.objectIds,categoryInventoryFamilies:t.families})}e.focalPoint||r.push({severity:"warning",code:"missing-focal-point",message:"Chart has no focal point set"}),O===0&&r.push({severity:"warning",code:"no-bookables",message:"Chart has no rows, tables, booths, or GA areas"});for(let t of m)if(f.get(t)===!1){let x=e.categories.find(c=>c.key===t);r.push({severity:"warning",code:"unpriced-category",message:`Category "${x?.label??t}" is used but has no price`,categoryKey:t})}return[...n,...r]}var Yt=9,Ct="#f7f8fb",Wt="#f5f6f8",jt="#8b93a7",Zt="#0b1220",Jt="#0b1220",eo="#ffffff",to=100;function T(e,o=2){let i=10**o;return Math.round(e*i)/i}function R(e){return{source:"quality",...e}}function oo(e){return e.code==="missing-focal-point"||e.code==="missing-zone-focal-point"?"navigation":"structure"}function $e(e){return Yt*Ye(e.theme?.seatScale)}function $t(e){let o=[];for(let i of e.objects)i.type==="row"?o.push(...B(i)):i.type==="table"&&o.push(...Z(i));return o}function no(e){let o={rowSeats:0,tableSeats:0,booths:0,gaCapacity:0};for(let i of e)for(let n of i.objects)n.type==="row"?o.rowSeats+=B(n).length:n.type==="table"?o.tableSeats+=Z(n).length:n.type==="booth"?o.booths+=1:n.type==="gaArea"&&(o.gaCapacity+=Math.max(0,Math.floor(n.capacity)));return{inventoryByKind:o,bookableUnits:o.rowSeats+o.tableSeats+o.booths+o.gaCapacity}}function L(e,o){e.filter(i=>i.code===o.code).length<to&&e.push(o)}function io(e,o,i){let n=$e(e),r=2*n,s=2.3*n,y=0,f=0,m=1/0;for(let a of o){let u=new Map(a.objects.filter(w=>w.type==="row").map(w=>[w.id,w])),g=w=>{let j=a.objects.find(E=>E.id===w);if(!j||j.type!=="row"&&j.type!=="table")return"another seating object";let O=j.type==="row"?B(j):Z(j),C=O.length?{x:O.reduce((E,P)=>E+P.x,0)/O.length,y:O.reduce((E,P)=>E+P.y,0)/O.length}:j.type==="row"?j.origin:j.center,_=a.objects.find(E=>E.type==="section"&&J(C,E.outline,E.holes)),F=j.type==="row"?`Row \u201C${j.label}\u201D`:`Table \u201C${j.label}\u201D`;return _?.type==="section"?`${F} in \u201C${_.label}\u201D`:F},b=$t(a);y+=b.length;let p=s,I=new Map,$=new Map;for(let w of b){let j=Math.floor(w.x/p),O=Math.floor(w.y/p);for(let F=-1;F<=1;F++)for(let E=-1;E<=1;E++){let P=I.get(`${j+F}:${O+E}`)??[];for(let M of P){f++;let D=Math.hypot(w.x-M.x,w.y-M.y);if(m=Math.min(m,D),D>=s)continue;let x=(w.rowId<M.rowId?[w.rowId,M.rowId]:[M.rowId,w.rowId]).join("|"),c=$.get(x);(!c||D<c.distance)&&$.set(x,{a:w,b:M,distance:D})}}let C=`${j}:${O}`,_=I.get(C)??[];_.push(w),I.set(C,_)}for(let w of $.values()){let j=w.a.rowId===w.b.rowId,O=u.get(w.a.rowId),C=u.get(w.b.rowId),_=!j&&O?.segmentedRow?.repeatLabelOnComponents===!0&&C?.segmentedRow?.repeatLabelOnComponents===!0&&O.segmentedRow.groupId===C.segmentedRow.groupId,F=!!O?.referenceScan&&!!C?.referenceScan&&O.referenceScan.assetId===C.referenceScan.assetId&&O.referenceScan.sectionId===C.referenceScan.sectionId,E=w.distance<r;if((_||F)&&!E)continue;let P=E?"seat-overlap":"seat-cramped",M=g(w.a.rowId),D=g(w.b.rowId),t=T(E?r:s);L(i,R({severity:"warning",code:P,dimension:"geometry",title:E?j?`${M} has overlapping seats`:`${M} and ${D} overlap`:j?`${M} has seats too close together`:`${M} and ${D} are too close together`,message:E?`The closest seats are ${T(w.distance)} chart units apart, so their markers overlap on the buyer map; at least ${t} keeps them apart.`:`The closest seats are ${T(w.distance)} chart units apart; at least ${t} are required.`,action:j?`Increase the seat spacing for ${M}, or use Review safe fixes.`:`Move ${M} or ${D} until they no longer overlap.`,objectId:w.a.rowId,relatedObjectIds:j?[w.a.rowId]:[w.a.rowId,w.b.rowId],floorId:a.id,measured:T(w.distance),minimum:t,autoFixable:j}))}}return{seats:y,checkedSeatPairs:f,minimumSeatDistance:Number.isFinite(m)?T(m):null}}function le(e){let{width:o,height:i}=Ae(e);if(!e.rotation)return{x:e.position.x,y:e.position.y,width:o,height:i};let n=[{x:0,y:0},{x:o,y:0},{x:o,y:i},{x:0,y:i}].map(r=>{let s=Te(r,e.rotation);return{x:e.position.x+s.x,y:e.position.y+s.y}});return Xe(n)}function kt(e,o,i=0){return e.x<o.x+o.width+i&&e.x+e.width+i>o.x&&e.y<o.y+o.height+i&&e.y+e.height+i>o.y}function je(e,o,i){let n=ne(o.x,e.x,e.x+e.width),r=ne(o.y,e.y,e.y+e.height);return(o.x-n)**2+(o.y-r)**2<i**2}function ro(e,o,i){let n=$e(e),r=0;for(let s of o){let y=s.objects.filter(m=>m.type==="text"),f=$t(s);r+=y.length;for(let m=0;m<y.length;m++){let a=y[m],u=le(a),g=f.find(b=>je(u,b,n));g&&L(i,R({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${a.text}\u201D overlaps seat ${g.label}`,objectId:a.id,relatedObjectIds:[a.id,g.rowId],floorId:s.id,autoFixable:!0}));for(let b=0;b<m;b++){let p=y[b];kt(u,le(p),2)&&L(i,R({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${a.text}\u201D overlaps text \u201C${p.text}\u201D`,objectId:a.id,relatedObjectIds:[a.id,p.id],floorId:s.id,autoFixable:!0}))}}}return r}function Ce(e){return e.normalize("NFKC").trim().toLowerCase().replace(/\s+/g," ")}function ao(e,o,i){let n=new Map;for(let f of o)for(let m of f.objects){let a=m.type,u=a==="row"||a==="table"||a==="booth"||a==="gaArea",g=u||a==="section";if(u&&!m.categoryKey.trim()){let b=a==="gaArea"?"GA area":a==="row"?"Row":a==="table"?"Table":"Booth";L(i,R({severity:"warning",code:"object-uncategorized",dimension:"structure",title:`${b} \u201C${m.label||m.id}\u201D has no category`,message:`${b} \u201C${m.label||m.id}\u201D is not assigned to any category, so buyers see no price or colour for it.`,action:"Assign a category to this object in the inspector, or create one in the Categories tab first.",objectId:m.id,floorId:f.id,autoFixable:!1}))}if(g){let b=(m.type==="section"?m.displayLabel??m.label:m.label)??"";if(b.trim()){if(a==="table"||a==="booth"||a==="gaArea"){let p=Ce(b),I=n.get(p);I&&I.raw!==b?L(i,R({severity:"warning",code:"duplicate-object-label-normalized",dimension:"labels",title:`\u201C${b}\u201D and \u201C${I.raw}\u201D read as the same label`,message:`Labels \u201C${b}\u201D and \u201C${I.raw}\u201D differ only by case, spacing, or accents, so buyers cannot tell them apart.`,action:"Make the two labels visibly distinct.",objectId:m.id,relatedObjectIds:[m.id,I.id],floorId:f.id,autoFixable:!1})):I||n.set(p,{id:m.id,raw:b})}}else{let p=a==="gaArea"?"A GA area":a==="section"?"A section":a==="row"?"A row":a==="table"?"A table":"A booth";L(i,R({severity:"warning",code:"object-unlabeled",dimension:"labels",title:`${p} has no label`,message:`${p} 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:m.id,floorId:f.id,autoFixable:!1}))}}}let r=[];for(let f of o){let m=f.objects.filter(a=>a.type==="row"||a.type==="table"||a.type==="booth"||a.type==="gaArea");for(let a of f.objects)if(!(a.type!=="section"||a.referenceInventoryExclusion||m.some(g=>J(ie(g),a.outline,a.holes)))){if(a.referenceSource){r.push({id:a.id,floorId:f.id});continue}L(i,R({severity:"warning",code:"empty-section",dimension:"structure",title:`Section \u201C${a.displayLabel??a.label}\u201D is empty`,message:`Section \u201C${a.displayLabel??a.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:a.id,floorId:f.id,autoFixable:!1}))}}r.length&&L(i,R({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(f=>f.id),floorId:r[0].floorId,autoFixable:!1}));let s=new Map,y=new Map;for(let f of o){let m=[];for(let a of f.objects)a.type!=="section"||a.outline.length<3||m.push({id:a.logicalSectionId??a.id,outline:a.outline,...a.holes?{holes:a.holes}:{},bounds:fo(a.outline)});for(let a of f.objects){if(a.type!=="row")continue;let u=(a.segmentedRow?.displayLabel??a.displayLabel??a.label??"").trim(),g=(a.displayType??"").trim(),b=u&&g&&Ce(g)!=="row"?`${g} ${u}`:u,p="";if(m.length){let j=ie(a),O=m.find(C=>j.x>=C.bounds.minX&&j.x<=C.bounds.maxX&&j.y>=C.bounds.minY&&j.y<=C.bounds.maxY&&J(j,C.outline,C.holes));O&&(p=O.id)}let I=`${f.id}\0${p}\0${Ce(b)}`,$=a.segmentedRow?.groupId??a.id;if(!b){let j=`${f.id}\0${p}`,O=y.get(j);O?(O.ids.push(a.id),O.logical.set($,[...O.logical.get($)??[],a])):y.set(j,{ids:[a.id],logical:new Map([[$,[a]]]),floorId:f.id});continue}let w=s.get(I);w?(w.ids.push(a.id),w.logical.set($,[...w.logical.get($)??[],a])):s.set(I,{ids:[a.id],logical:new Map([[$,[a]]]),floorId:f.id,raw:b})}}for(let{ids:f,logical:m,floorId:a,raw:u}of s.values()){let g=m.size;g<2||wt([...m.values()])&&L(i,R({severity:"warning",code:"duplicate-row-label",dimension:"labels",title:`${g} rows share the name \u201C${u}\u201D`,message:`${g} rows share the label \u201C${u}\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:f[0],relatedObjectIds:f,floorId:a,autoFixable:!1}))}for(let{ids:f,logical:m,floorId:a}of y.values()){let u=m.size;u<2||wt([...m.values()])&&L(i,R({severity:"warning",code:"unnamed-row-collision",dimension:"labels",title:`${u} rows have no name`,message:`${u} 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:f[0],relatedObjectIds:f,floorId:a,autoFixable:!1}))}if(e.floors&&e.floors.length>1)for(let f of e.floors)f.objects.length===0&&L(i,R({severity:"warning",code:"unused-floor",dimension:"structure",title:`Floor \u201C${f.name}\u201D is empty`,message:`Floor \u201C${f.name}\u201D has no objects on it.`,action:"Add seating to this floor, or delete it from the floor list below the canvas.",floorId:f.id,autoFixable:!1}))}var so=5,co=16;function lo(e,o,i){for(let n of o){let r=n.focalPoint??e.focalPoint;if(r)for(let s of n.objects){if(s.type!=="section"||s.outline.length<3)continue;let{rake:y}=Fe(s);if(y<so)continue;let f=s.outline.map(b=>Math.hypot(b.x-r.x,b.y-r.y)),m=Math.max(...f);if(m<=0)continue;let a=(m-Math.min(...f))/m;if(y*a<=co)continue;let g=s.displayLabel??s.label;L(i,R({severity:"warning",code:"section-rake-inconsistent",dimension:"geometry",title:`Section \u201C${g}\u201D is too deep for a single rake`,message:`Section \u201C${g}\u201D spans ${Math.round(a*100)}% of its distance to the stage at a ${Math.round(y)}\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:s.id,floorId:n.id,autoFixable:!1}))}}}function uo(e,o,i){let n=e.theme?.background??Ct,r=Wt,s=new Map;for(let a of o)for(let u of a.objects){if(u.type!=="gaArea")continue;let g=s.get(u.categoryKey)??[];g.push({id:u.id,floorId:a.id}),s.set(u.categoryKey,g)}for(let a of e.categories){let u=N(a.color,n),g=N(a.color,r);if(u==null||g==null){L(i,R({severity:"error",code:"invalid-category-color",dimension:"contrast",message:`Category \u201C${a.label}\u201D does not use a supported hex color`,categoryKey:a.key}));continue}let b=Math.min(u,g);b<3&&L(i,R({severity:"warning",code:"category-contrast-low",dimension:"contrast",title:`Category \u201C${a.label}\u201D is hard to see`,message:`Category \u201C${a.label}\u201D reaches only ${T(b)}:1 across dark and light chart backgrounds; 3:1 is required`,action:`Choose a lighter or darker color for \u201C${a.label}\u201D until this warning clears.`,categoryKey:a.key,measured:T(b),minimum:3,autoFixable:!1}));let p=s.get(a.key)??[];if(p.length){let I=he(a.color,n,pe),$=he(a.color,r,pe),w=Math.min(N(I,n)??0,N($,r)??0);w<3&&L(i,R({severity:"warning",code:"ga-contrast-low",dimension:"contrast",message:`GA category \u201C${a.label}\u201D reaches only ${T(w)}:1 after its rendered opacity is composited; 3:1 is required`,objectId:p[0].id,categoryKey:a.key,floorId:p[0].floorId,relatedObjectIds:p.map(j=>j.id),measured:T(w),minimum:3,autoFixable:!1}))}}for(let a=0;a<e.categories.length;a++)for(let u=0;u<a;u++){let g=e.categories[a],b=e.categories[u],p=Ue(g.color,b.color);p!=null&&p<25&&L(i,R({severity:"warning",code:"category-colors-too-similar",dimension:"contrast",title:`\u201C${g.label}\u201D and \u201C${b.label}\u201D look too similar`,message:`Categories \u201C${g.label}\u201D and \u201C${b.label}\u201D are only \u0394E ${T(p)} apart; 25 is required`,action:"Pick a visibly different color for either category so buyers can tell them apart.",categoryKey:g.key,measured:T(p),minimum:25,autoFixable:!1}))}for(let a of o){let u=a.objects.filter(g=>g.type==="text");for(let g of u){let b=g.color??e.theme?.textColor??jt,p=N(b,n),I=g.fontSize>=18?3:4.5;(p==null||p<I)&&L(i,R({severity:"warning",code:"text-contrast-low",dimension:"contrast",message:`Text \u201C${g.text}\u201D has ${T(p??0)}:1 contrast against the chart background; ${I}:1 is required`,objectId:g.id,floorId:a.id,measured:T(p??0),minimum:I,autoFixable:!0}))}}if(e.theme?.selectionColor){let a=N(e.theme.selectionColor,n);(a==null||a<3)&&L(i,R({severity:"warning",code:"selection-contrast-low",dimension:"contrast",title:"The selection color is hard to see",message:`Selection rings have ${T(a??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(a??0),minimum:3,autoFixable:!1}))}if(e.theme?.textColor){let a=N(e.theme.textColor,n);(a==null||a<3)&&L(i,R({severity:"warning",code:"theme-text-contrast-low",dimension:"contrast",title:"The theme text color is hard to read",message:`Theme text has ${T(a??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(a??0),minimum:3,autoFixable:!1}))}let y=e.theme?.seatLabelColor??Zt,f=new Map,m=(a,u,g)=>{let b=f.get(a)??new Map,p=b.get(u)??[];p.push(g),b.set(u,p),f.set(a,b)};for(let a of o)for(let u of a.objects)if(u.type==="row")for(let g of se(u).keys())m(g,"seat",u.id);else if(u.type==="table")for(let g of se(u).keys())m(g,"table seat",u.id);else u.type==="booth"&&m(u.categoryKey,"booth",u.id);for(let a of e.categories){let u=f.get(a.key);if(u)for(let[g,b]of u){let p=g==="booth"?Ve:Ge,I=qe(Qe,600),$=He(a.color,y),w=N($,a.color);(w==null||w<I)&&L(i,R({severity:"warning",code:"bookable-label-contrast-low",dimension:"contrast",message:`${g==="booth"?"Booth":g==="seat"?"Seat":"Table-seat"} labels use ${p}u type and have ${T(w??0)}:1 contrast on category \u201C${a.label}\u201D; ${I}:1 is required for small text`,objectId:b[0],relatedObjectIds:b,measured:T(w??0),minimum:I,autoFixable:!0}))}}}function wt(e){if(e.length>24)return!0;let o=new Set;for(let i of e){let n=new Set;for(let r of i)for(let s of B(r)){let y=s.label,f=y.lastIndexOf("-");n.add(f>=0?y.slice(f+1):y)}if(!n.size)return!0;for(let r of n)if(o.has(r))return!0;for(let r of n)o.add(r)}return!1}function fo(e){let o=1/0,i=1/0,n=-1/0,r=-1/0;for(let s of e)s.x<o&&(o=s.x),s.y<i&&(i=s.y),s.x>n&&(n=s.x),s.y>r&&(r=s.y);return{minX:o,minY:i,maxX:n,maxY:r}}function yo(e,o){for(let i of e){let n=i.objects.filter(r=>r.type==="section");if(!(n.length<2))for(let r of i.objects){if(!(r.type==="row"||r.type==="table"||r.type==="booth"||r.type==="gaArea"))continue;let y=ie(r),f=n.filter(p=>J(y,p.outline,p.holes)),m=new Map;for(let p of f){let I=p.logicalSectionId??p.id,$=m.get(I)??[];$.push(p),m.set(I,$)}if(m.size<2)continue;let a=[...m.values()],u=a.map(p=>`Section \u201C${p[0].displayLabel??p[0].label}\u201D`),g=u.length===2?u.join(" and "):`${u.slice(0,-1).join(", ")}, and ${u[u.length-1]}`,b=r.type==="gaArea"?"GA area":r.type==="row"?"Row":r.type==="table"?"Table":"Booth";L(o,R({severity:"warning",code:"ambiguous-section-ownership",dimension:"structure",title:`${b} \u201C${r.label}\u201D belongs to more than one section`,message:`${b} \u201C${r.label}\u201D has its center inside ${g}, 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:r.id,relatedObjectIds:[r.id,...a.flatMap(p=>p.map(I=>I.id))],floorId:i.id,autoFixable:!1}))}}}var go={structure:20,geometry:30,contrast:25,labels:15,navigation:10},mo={"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 bo(e){let o={...go};for(let r of e){let s=r.severity==="error"?10:2;o[r.dimension]=Math.max(0,o[r.dimension]-(mo[r.code]??s))}let i=Object.values(o).reduce((r,s)=>r+s,0),n=i>=95?"A":i>=85?"B":i>=70?"C":i>=55?"D":"F";return{overall:i,dimensions:o,errorFree:e.every(r=>r.severity!=="error"),grade:n}}var po=new Set(["unpriced-category","object-uncategorized"]);function St(e,o={}){let i=me(e),n=It(e,{maxInventory:o.maxInventory}).filter(u=>u.code!=="missing-zone-focal-point"||o.requireExplicitZoneFocals).map(u=>{let g=u.objectId?i.find(I=>I.objects.some($=>$.id===u.objectId))?.id:void 0,b=u.code==="category-inventory-family-conflict",p=b?e.categories.find(I=>I.key===u.categoryKey):void 0;return R({...u,...b?{severity:"error",title:`Category \u201C${p?.label??u.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."}:{},...o.requireExplicitZoneFocals&&u.code==="missing-zone-focal-point"?{severity:"error"}:{},...g?{floorId:g}:{},source:"structural",dimension:oo(u),autoFixable:b})}),r=io(e,i,n),s=no(i),y=ro(e,i,n);if(ao(e,i,n),yo(i,n),lo(e,i,n),uo(e,i,n),i.reduce((u,g)=>u+g.objects.filter(b=>b.type==="row"||b.type==="table"||b.type==="booth"||b.type==="gaArea").length,0)===0){let u=new Set(["missing-focal-point","no-bookables"]);for(let g=n.length-1;g>=0;g--)u.has(n[g].code)&&n.splice(g,1)}if(o.requirePricedInventory)for(let u=0;u<n.length;u++)po.has(n[u].code)&&(n[u]={...n[u],severity:"error"});let m=n.filter(u=>u.severity==="error"),a=n.filter(u=>u.severity==="warning");return{issues:n,errors:m,warnings:a,metrics:{floors:i.length,objects:i.reduce((u,g)=>u+g.objects.length,0),seats:r.seats,bookableUnits:s.bookableUnits,inventoryByKind:s.inventoryByKind,categories:e.categories.length,freeTextLabels:y,checkedSeatPairs:r.checkedSeatPairs,minimumSeatDistance:r.minimumSeatDistance},score:bo(n),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 ho(e,o){if(e.seatCount<2||e.seatSpacing>=o)return!1;let i=ue(B(e));e.seatSpacing=T(o,3);let n=ue(B(e));return e.origin.x=T(e.origin.x+i.x-n.x,3),e.origin.y=T(e.origin.y+i.y-n.y,3),!0}function vo(e,o){if(e.seatCount<2)return!1;let i=!1;if(e.shape==="round"){let n=ne(e.seatArc??360,0,360),r=(n>=360?360/e.seatCount:n/(e.seatCount-1))*Math.PI/180;if(r>0){let s=o/(2*Math.sin(r/2)),y=Math.max(1,s-16);(e.radius??40)<y&&(e.radius=T(y,3),i=!0)}}else{let n=Ne(e),r=Math.max(n.top,n.bottom),s=Math.max(n.left,n.right);r>1&&(e.width??80)/r<o&&(e.width=T(r*o,3),i=!0),s>1&&(e.height??50)/s<o&&(e.height=T(s*o,3),i=!0)}return i}function Io(e){return[Jt,eo].map(i=>({color:i,minimum:Math.min(...e.map(n=>N(i,n)??0))})).sort((i,n)=>n.minimum-i.minimum)[0].color}function xt(e,o,i){let n=le(e),r=0;for(let s of o)s.type==="row"?r+=B(s).filter(y=>je(n,y,i)).length:s.type==="table"?r+=Z(s).filter(y=>je(n,y,i)).length:s.type==="text"&&s.id!==e.id&&kt(n,le(s),2)&&r++;return r}function wo(e,o,i){if(xt(e,o,i)===0)return!1;let r={...e.position},s=Math.max(12,e.fontSize*1.25),y=[[0,-1],[1,0],[0,1],[-1,0],[1,-1],[1,1],[-1,1],[-1,-1]];for(let f=1;f<=12;f++)for(let[m,a]of y)if(e.position={x:T(r.x+m*s*f,3),y:T(r.y+a*s*f,3)},xt(e,o,i)===0)return!0;return e.position=r,!1}function sn(e,o={}){let i=JSON.parse(JSON.stringify(e)),n=St(i,o),r=[],s=rt(i);if(s.changed){i=s.doc;for(let g of s.changes){let b=s.before.find(I=>I.categoryKey===g.categoryKey),p=b?.families.map(I=>I.label).join(", ")??"inventory families";r.push({code:"category-inventory-family-conflict",objectId:b?.objectIds[0],message:`Split category \u201C${g.categoryLabel}\u201D across ${p}; preserved its commercial metadata and reassigned ${g.reassignments.length} affected object${g.reassignments.length===1?"":"s"}`})}}let y=$e(i),f=2.5*y,m=me(i);for(let g of m)for(let b of g.objects)if(b.type==="row"){let p=b.seatSpacing;ho(b,f)&&r.push({code:p<2*y?"seat-overlap":"seat-cramped",objectId:b.id,message:`Expanded ${b.id} to the ${T(f)}u target pitch while preserving its centre`})}else b.type==="table"&&vo(b,f)&&r.push({code:"seat-cramped",objectId:b.id,message:`Expanded ${b.id} so its perimeter seats meet the ${T(f)}u target pitch`});let a=i.theme?.background??Ct;for(let g of m)for(let b of g.objects){if(b.type!=="text")continue;let p=b.color??i.theme?.textColor??jt,I=b.fontSize>=18?3:4.5;(N(p,a)??0)<I&&(b.color=Io([a]),r.push({code:"text-contrast-low",objectId:b.id,message:`Changed ${b.id} to the highest-contrast black/white ink`}))}for(let g of m){let b=g.objects.filter(p=>p.type==="text");for(let p of b)wo(p,g.objects,y)&&r.push({code:"label-collision",objectId:p.id,message:`Moved ${p.id} to the nearest collision-free deterministic label position`})}i.floors?.length&&(i.objects=i.floors[0].objects);let u=St(i,o);return{doc:i,changed:r.length>0,fixes:r,before:n,after:u}}export{we as a,se as b,ae as c,nt as d,rt as e,xo as f,at as g,sn as h};
@@ -1 +1 @@
1
- import{i as V,k as H,w as m}from"./chunk-HC3U5BWH.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{i as V,k as H,w as m}from"./chunk-LAX7F5ML.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};