@homepages/concrete 9.0.0 → 9.1.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 (67) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +2 -2
  3. package/codemods/manifest.json +4 -0
  4. package/dist/artifact/playground/client/assets/index-BOYbgBnP.js +1259 -0
  5. package/dist/artifact/playground/client/index.html +1 -1
  6. package/dist/artifact/playground/host.mjs +24 -24
  7. package/dist/cli/check/stages/workspace.js +2 -0
  8. package/dist/cli/check/template-key.js +16 -0
  9. package/dist/fixtures/resolve.js +4 -7
  10. package/dist/packages/external/concrete/package.js +1 -1
  11. package/dist/packages/internal/capture-settle/dist/island-markers.d.ts +1 -1
  12. package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +8 -22
  13. package/dist/packages/internal/fill-bake/dist/compute-reads.js +4 -8
  14. package/dist/packages/internal/fill-bake/dist/derive-source.js +7 -14
  15. package/dist/packages/internal/fill-bake/dist/index.js +3 -2
  16. package/dist/packages/internal/fill-bake/dist/item-merge.js +4 -10
  17. package/dist/packages/internal/fill-bake/dist/item-overrides.js +1 -28
  18. package/dist/packages/internal/fill-bake/dist/linked-merge.js +1 -3
  19. package/dist/packages/internal/fill-bake/dist/list-grammar.js +10 -11
  20. package/dist/packages/internal/fill-bake/dist/stored-row-reader.js +1 -0
  21. package/dist/packages/internal/fill-vocabulary/dist/resolved-decision.js +11 -38
  22. package/dist/packages/internal/fill-vocabulary/dist/verbs.js +2 -17
  23. package/dist/packages/internal/media-resolution/dist/image.js +6 -8
  24. package/dist/packages/internal/media-resolution/dist/list.js +1 -1
  25. package/dist/packages/internal/media-resolution/dist/slot.js +4 -1
  26. package/dist/packages/internal/media-resolution/dist/tour.js +1 -1
  27. package/dist/packages/internal/media-resolution/dist/video.js +1 -1
  28. package/dist/packages/internal/property-facts/dist/registry-facts.js +2 -1
  29. package/dist/packages/internal/section-contracts/dist/catalog.js +1 -5
  30. package/dist/packages/internal/section-contracts/dist/directly-linked-list-contract.js +4 -10
  31. package/dist/packages/internal/section-contracts/dist/fill-spec-view.js +1 -5
  32. package/dist/packages/internal/section-contracts/dist/fill-verb-contract.js +2 -2
  33. package/dist/packages/internal/section-contracts/dist/grammar-scope.js +1 -1
  34. package/dist/packages/internal/section-contracts/dist/index.js +0 -1
  35. package/dist/packages/internal/section-contracts/dist/list-fill-contract.js +0 -29
  36. package/dist/packages/internal/section-contracts/dist/list-scalar-contract.js +2 -16
  37. package/dist/packages/internal/section-contracts/dist/nested-slot-contract.js +6 -6
  38. package/dist/packages/internal/section-contracts/dist/poi-curation-contract.js +6 -2
  39. package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +0 -14
  40. package/dist/packages/internal/section-contracts/dist/row-rule-contract.js +3 -6
  41. package/dist/packages/internal/section-contracts/dist/runners.js +4 -9
  42. package/dist/packages/internal/section-contracts/dist/source-contract.js +10 -73
  43. package/dist/packages/internal/section-contracts/dist/writer-reads-fact-contract.js +5 -10
  44. package/dist/packages/internal/source-resolution/dist/index.js +7 -8
  45. package/dist/packages/internal/template-contracts/dist/decision-fills.js +2 -6
  46. package/dist/packages/internal/template-contracts/dist/fact-registry.js +4 -4
  47. package/dist/packages/internal/template-contracts/dist/fill-spec-schema.js +3 -68
  48. package/dist/packages/internal/template-contracts/dist/list-editing.js +0 -1
  49. package/dist/packages/internal/template-contracts/dist/media-candidates.js +1 -1
  50. package/dist/packages/internal/template-contracts/dist/primitive-descriptors.js +2 -2
  51. package/dist/packages/internal/template-contracts/dist/read-graph.js +9 -19
  52. package/dist/packages/internal/template-contracts/dist/ref-locate.js +8 -24
  53. package/dist/packages/internal/template-contracts/dist/registry-facts.d.ts +2 -0
  54. package/dist/packages/internal/template-contracts/dist/row-ref.d.ts +2 -8
  55. package/dist/packages/internal/template-contracts/dist/row-sources.js +3 -13
  56. package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +1 -32
  57. package/dist/packages/internal/template-contracts/dist/slot-catalog.js +0 -4
  58. package/dist/packages/internal/template-contracts/dist/slot-types.js +1 -2
  59. package/dist/packages/internal/template-contracts/dist/slot-value.d.ts +7 -9
  60. package/dist/primitives/slot-bindings.js +2 -2
  61. package/dist/rules/registry.js +6 -0
  62. package/dist/section/section.d.ts +2 -2
  63. package/guide/reference/rules/INDEX.md +2 -2
  64. package/package.json +1 -1
  65. package/dist/artifact/playground/client/assets/index-BUmdDDX5.js +0 -1259
  66. package/dist/packages/internal/fill-vocabulary/dist/row-reads.js +0 -15
  67. package/dist/packages/internal/section-contracts/dist/group-contract.js +0 -19
@@ -1,4 +1,4 @@
1
- var Fo=/^(\d+(?:\.\d+)?)(in|mm)$/;function kt(e){let t=Fo.exec(e),[,n,r]=t??[];if(n===void 0||r===void 0)throw new Error(`malformed physical length: "${e}"`);let o=Number.parseFloat(n);return r==="mm"?o/25.4:o}function W(e){if(typeof e.width=="number"&&typeof e.height=="number")return{frameWidth:e.width,frameHeight:e.height,bleed:0,viewportWidth:e.width,viewportHeight:e.height,deviceScaleFactor:1,pixelWidth:e.width,pixelHeight:e.height,pointWidth:e.width/96*72,pointHeight:e.height/96*72,bleedPoints:0,panels:1,sheetWidth:e.width,sheetHeight:e.height,sheetPointWidth:e.width/96*72,sheetPointHeight:e.height/96*72};let t=e,n=kt(t.width),r=kt(t.height),o=t.bleed===void 0?0:kt(t.bleed),i=n*96,s=r*96,a=o*96,l=i+2*a,d=s+2*a,m=t.dpi/96,g=t.panels??1;return{frameWidth:i,frameHeight:s,bleed:a,viewportWidth:l,viewportHeight:d,deviceScaleFactor:m,pixelWidth:Math.round(l*m),pixelHeight:Math.round(d*m),pointWidth:(n+2*o)*72,pointHeight:(r+2*o)*72,bleedPoints:o*72,panels:g,sheetWidth:g*i+2*a,sheetHeight:d,sheetPointWidth:(g*n+2*o)*72,sheetPointHeight:(r+2*o)*72}}var Pe="concrete-frame",Ce="concrete-sheet";function Fe(e){let t=W(e);return{"--frame-w":`${t.frameWidth}px`,"--frame-h":`${t.frameHeight}px`,"--frame-bleed":`${t.bleed}px`}}function xt(e){let t=W(e);return{"--sheet-w":`${t.panels*t.frameWidth}px`,"--sheet-h":`${t.frameHeight}px`,"--frame-bleed":`${t.bleed}px`}}var Xe="data-tr-island",In="__trCaptureHolds";var St=`(function () {
1
+ var Co=/^(\d+(?:\.\d+)?)(in|mm)$/;function _t(e){let t=Co.exec(e),[,n,r]=t??[];if(n===void 0||r===void 0)throw new Error(`malformed physical length: "${e}"`);let o=Number.parseFloat(n);return r==="mm"?o/25.4:o}function W(e){if(typeof e.width=="number"&&typeof e.height=="number")return{frameWidth:e.width,frameHeight:e.height,bleed:0,viewportWidth:e.width,viewportHeight:e.height,deviceScaleFactor:1,pixelWidth:e.width,pixelHeight:e.height,pointWidth:e.width/96*72,pointHeight:e.height/96*72,bleedPoints:0,panels:1,sheetWidth:e.width,sheetHeight:e.height,sheetPointWidth:e.width/96*72,sheetPointHeight:e.height/96*72};let t=e,n=_t(t.width),r=_t(t.height),o=t.bleed===void 0?0:_t(t.bleed),i=n*96,s=r*96,a=o*96,l=i+2*a,d=s+2*a,m=t.dpi/96,g=t.panels??1;return{frameWidth:i,frameHeight:s,bleed:a,viewportWidth:l,viewportHeight:d,deviceScaleFactor:m,pixelWidth:Math.round(l*m),pixelHeight:Math.round(d*m),pointWidth:(n+2*o)*72,pointHeight:(r+2*o)*72,bleedPoints:o*72,panels:g,sheetWidth:g*i+2*a,sheetHeight:d,sheetPointWidth:(g*n+2*o)*72,sheetPointHeight:(r+2*o)*72}}var Te="concrete-frame",Pe="concrete-sheet";function Ce(e){let t=W(e);return{"--frame-w":`${t.frameWidth}px`,"--frame-h":`${t.frameHeight}px`,"--frame-bleed":`${t.bleed}px`}}function xt(e){let t=W(e);return{"--sheet-w":`${t.panels*t.frameWidth}px`,"--sheet-h":`${t.frameHeight}px`,"--frame-bleed":`${t.bleed}px`}}var Ye="data-tr-island",An="__trCaptureHolds";var St=`(function () {
2
2
  function CaptureIntersectionObserver(callback, options) {
3
3
  var opts = options || {};
4
4
  this.root = opts.root || null;
@@ -46,7 +46,7 @@ var Fo=/^(\d+(?:\.\d+)?)(in|mm)$/;function kt(e){let t=Fo.exec(e),[,n,r]=t??[];i
46
46
  return entries;
47
47
  };
48
48
  window.IntersectionObserver = CaptureIntersectionObserver;
49
- })();`,Lo=`!!document.querySelector("[${Xe}]")`,vt="__trIslandsReady",No=`(async () => {
49
+ })();`,Mo=`!!document.querySelector("[${Ye}]")`,vt="__trIslandsReady",Lo=`(async () => {
50
50
  const ready = window.${vt};
51
51
  if (ready === undefined) {
52
52
  throw new Error(
@@ -56,20 +56,20 @@ var Fo=/^(\d+(?:\.\d+)?)(in|mm)$/;function kt(e){let t=Fo.exec(e),[,n,r]=t??[];i
56
56
  }
57
57
  await ready;
58
58
  })()`,Wa=`(() => {
59
- const holds = window.${In};
59
+ const holds = window.${An};
60
60
  const keys = [...new Set(Array.from(
61
- document.querySelectorAll("[${Xe}]"),
62
- (el) => el.getAttribute("${Xe}"),
61
+ document.querySelectorAll("[${Ye}]"),
62
+ (el) => el.getAttribute("${Ye}"),
63
63
  ))];
64
64
  return JSON.stringify({ openHolds: holds ? holds.size : 0, islands: keys });
65
- })()`;var Tn=400;var Do=`(async () => {
65
+ })()`;var In=400;var No=`(async () => {
66
66
  await new Promise((resolve) => {
67
- setTimeout(resolve, ${Tn});
67
+ setTimeout(resolve, ${In});
68
68
  });
69
69
  await new Promise((resolve) => {
70
70
  requestAnimationFrame(() => resolve(undefined));
71
71
  });
72
- })()`,jn=5,Ho=`(async () => {
72
+ })()`,jn=5,Do=`(async () => {
73
73
  const frame = () => new Promise((resolve) => {
74
74
  requestAnimationFrame(() => resolve(undefined));
75
75
  });
@@ -90,14 +90,14 @@ var Fo=/^(\d+(?:\.\d+)?)(in|mm)$/;function kt(e){let t=Fo.exec(e),[,n,r]=t??[];i
90
90
  await frame();
91
91
  }
92
92
  await frame();
93
- })()`;function b(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function ne(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function Pn(e){return Je(e.id,{...Fe(e)})}function Je(e,t){let n=Object.entries(t).map(([r,o])=>`${r}:${o}`).join(";");return{class:Pe,dataFormat:e,style:n}}function Ze(e,t){let n=Pn(e);return`<div class="${b(n.class)}" data-format="${b(n.dataFormat)}" style="${b(n.style)}">${t.join("")}</div>`}function Rt(e,t){let n=Object.entries(xt(e)).map(([r,o])=>`${r}:${o}`).join(";");return`<div class="${b(Ce)}" style="${b(n)}">${t.join("")}</div>`}function we(e){switch(e.destination){case"published":return Uo(e);case"artifact":return qo(e);case"preview":return Ko(e);case"canvas":return Bo(e)}}function Cn(e){return e.kind==="none"||Object.keys(e.islandMap).length===0?[]:[`<script>${St}</script>`]}var Fn="html, body { margin: 0; padding: 0; }";function Mn(e){let t=[`rel="${e.rel}"`,`href="${b(e.href)}"`];return e.sizes!==void 0&&t.push(`sizes="${b(e.sizes)}"`),e.type!==void 0&&t.push(`type="${b(e.type)}"`),`<link ${t.join(" ")} />`}function Uo(e){let{meta:t}=e,n=['<meta charset="utf-8" />','<meta name="viewport" content="width=device-width, initial-scale=1" />',`<title>${b(t.title)}</title>`,`<meta name="description" content="${b(t.description)}" />`];t.canonical&&n.push(`<link rel="canonical" href="${b(t.canonical)}" />`);for(let o of t.icons??[])n.push(Mn(o));n.push('<meta property="og:type" content="website" />'),t.siteName&&n.push(`<meta property="og:site_name" content="${b(t.siteName)}" />`),n.push(`<meta property="og:title" content="${b(t.title)}" />`),n.push(`<meta property="og:description" content="${b(t.description)}" />`),t.ogUrl&&n.push(`<meta property="og:url" content="${b(t.ogUrl)}" />`),t.ogImage&&(n.push(`<meta property="og:image" content="${b(t.ogImage)}" />`),t.ogImageWidth&&n.push(`<meta property="og:image:width" content="${t.ogImageWidth}" />`),t.ogImageHeight&&n.push(`<meta property="og:image:height" content="${t.ogImageHeight}" />`),t.ogImageType&&n.push(`<meta property="og:image:type" content="${b(t.ogImageType)}" />`),t.ogImageAlt&&n.push(`<meta property="og:image:alt" content="${b(t.ogImageAlt)}" />`),n.push('<meta name="twitter:card" content="summary_large_image" />'),n.push(`<meta name="twitter:title" content="${b(t.title)}" />`),n.push(`<meta name="twitter:description" content="${b(t.description)}" />`),n.push(`<meta name="twitter:image" content="${b(t.ogImage)}" />`)),n.push(...$t(e.stylesheets)),n.push(...Ot(e.islands)),e.prefetchUrls&&e.prefetchUrls.length>0&&n.push(`<script type="speculationrules">${ne({prefetch:[{source:"list",urls:[...e.prefetchUrls]}]})}</script>`);let r=e.siteConfig?`
93
+ })()`;function b(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function ne(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function Tn(e){return Xe(e.id,{...Ce(e)})}function Xe(e,t){let n=Object.entries(t).map(([r,o])=>`${r}:${o}`).join(";");return{class:Te,dataFormat:e,style:n}}function Je(e,t){let n=Tn(e);return`<div class="${b(n.class)}" data-format="${b(n.dataFormat)}" style="${b(n.style)}">${t.join("")}</div>`}function Rt(e,t){let n=Object.entries(xt(e)).map(([r,o])=>`${r}:${o}`).join(";");return`<div class="${b(Pe)}" style="${b(n)}">${t.join("")}</div>`}function we(e){switch(e.destination){case"published":return Ho(e);case"artifact":return Uo(e);case"preview":return qo(e);case"canvas":return Ko(e)}}function Pn(e){return e.kind==="none"||Object.keys(e.islandMap).length===0?[]:[`<script>${St}</script>`]}var Cn="html, body { margin: 0; padding: 0; }";function Fn(e){let t=[`rel="${e.rel}"`,`href="${b(e.href)}"`];return e.sizes!==void 0&&t.push(`sizes="${b(e.sizes)}"`),e.type!==void 0&&t.push(`type="${b(e.type)}"`),`<link ${t.join(" ")} />`}function Ho(e){let{meta:t}=e,n=['<meta charset="utf-8" />','<meta name="viewport" content="width=device-width, initial-scale=1" />',`<title>${b(t.title)}</title>`,`<meta name="description" content="${b(t.description)}" />`];t.canonical&&n.push(`<link rel="canonical" href="${b(t.canonical)}" />`);for(let o of t.icons??[])n.push(Fn(o));n.push('<meta property="og:type" content="website" />'),t.siteName&&n.push(`<meta property="og:site_name" content="${b(t.siteName)}" />`),n.push(`<meta property="og:title" content="${b(t.title)}" />`),n.push(`<meta property="og:description" content="${b(t.description)}" />`),t.ogUrl&&n.push(`<meta property="og:url" content="${b(t.ogUrl)}" />`),t.ogImage&&(n.push(`<meta property="og:image" content="${b(t.ogImage)}" />`),t.ogImageWidth&&n.push(`<meta property="og:image:width" content="${t.ogImageWidth}" />`),t.ogImageHeight&&n.push(`<meta property="og:image:height" content="${t.ogImageHeight}" />`),t.ogImageType&&n.push(`<meta property="og:image:type" content="${b(t.ogImageType)}" />`),t.ogImageAlt&&n.push(`<meta property="og:image:alt" content="${b(t.ogImageAlt)}" />`),n.push('<meta name="twitter:card" content="summary_large_image" />'),n.push(`<meta name="twitter:title" content="${b(t.title)}" />`),n.push(`<meta name="twitter:description" content="${b(t.description)}" />`),n.push(`<meta name="twitter:image" content="${b(t.ogImage)}" />`)),n.push(...$t(e.stylesheets)),n.push(...Ot(e.islands)),e.prefetchUrls&&e.prefetchUrls.length>0&&n.push(`<script type="speculationrules">${ne({prefetch:[{source:"list",urls:[...e.prefetchUrls]}]})}</script>`);let r=e.siteConfig?`
94
94
  <script type="application/json" id="concrete-site-config">${ne(e.siteConfig)}</script>`:"";return Et({lang:t.lang??"en",head:n,body:` <body class="concrete-root">
95
95
  ${e.root.bodyHtml}${r}${At(e.islands,"viewport")}
96
96
  <script type="module" src="${b(e.analyticsJs.url)}"></script>
97
- </body>`})}function qo(e){let t=['<meta charset="utf-8" />'];e.title!==void 0&&t.push(`<title>${b(e.title)}</title>`),t.push(...$t(e.stylesheets));let n=[Fn,...Go(e.root)];return t.push(Ln(n)),t.push(...Cn(e.islands)),t.push(...Ot(e.islands)),Et({lang:"en",head:t,body:` <body>${zo(e.root)}${At(e.islands,"eager")}</body>`})}function Ko(e){let t=['<meta charset="utf-8" />','<meta name="viewport" content="width=device-width, initial-scale=1" />',`<title>${b(e.title)}</title>`,...e.icon===void 0?[]:[Mn({rel:"icon",href:e.icon})],...$t(e.stylesheets),Ln([Fn,...e.extraCss??[]]),...e.capture===!0?Cn(e.islands):[],...Ot(e.islands)],n=(e.devScripts??[]).map(r=>`
97
+ </body>`})}function Uo(e){let t=['<meta charset="utf-8" />'];e.title!==void 0&&t.push(`<title>${b(e.title)}</title>`),t.push(...$t(e.stylesheets));let n=[Cn,...zo(e.root)];return t.push(Mn(n)),t.push(...Pn(e.islands)),t.push(...Ot(e.islands)),Et({lang:"en",head:t,body:` <body>${Vo(e.root)}${At(e.islands,"eager")}</body>`})}function qo(e){let t=['<meta charset="utf-8" />','<meta name="viewport" content="width=device-width, initial-scale=1" />',`<title>${b(e.title)}</title>`,...e.icon===void 0?[]:[Fn({rel:"icon",href:e.icon})],...$t(e.stylesheets),Mn([Cn,...e.extraCss??[]]),...e.capture===!0?Pn(e.islands):[],...Ot(e.islands)],n=(e.devScripts??[]).map(r=>`
98
98
  ${r}`).join("");return Et({lang:"en",head:t,body:` <body>
99
99
  ${e.root.bodyHtml}${At(e.islands,e.capture===!0?"eager":"viewport")}${n}
100
- </body>`})}function Bo(e){let t=e.stylesheets.hrefs.map(n=>`<link rel="stylesheet" href="${b(n)}">`).join("");return`<!doctype html>
100
+ </body>`})}function Ko(e){let t=e.stylesheets.hrefs.map(n=>`<link rel="stylesheet" href="${b(n)}">`).join("");return`<!doctype html>
101
101
  <html>
102
102
  <head>
103
103
  <meta charset="utf-8">
@@ -107,13 +107,13 @@ ${e.root.bodyHtml}${r}${At(e.islands,"viewport")}
107
107
  so their layer is pre-declared here, before any template stylesheet,
108
108
  pinning it below every layer those go on to declare. -->
109
109
  <style>@layer ${e.defaultsLayer};</style>
110
- ${t}${Vo(e.islands)}
110
+ ${t}${Wo(e.islands)}
111
111
  <style>${e.frameCss}</style>
112
112
  </head>
113
113
  <body>
114
- <div id="${b(e.root.id)}"${Wo(e.root)}></div>
114
+ <div id="${b(e.root.id)}"${Bo(e.root)}></div>
115
115
  </body>
116
- </html>`}function Wo(e){if(!e.pageBox)return"";let t=Je(e.pageBox.formatId,e.pageBox.tokens);return` class="${b(t.class)}" data-format="${b(t.dataFormat)}" style="${b(t.style)}"`}function Vo(e){if(e.kind==="none"||Object.keys(e.islandMap).length===0)return"";let t=e.hostScriptSrc?`
116
+ </html>`}function Bo(e){if(!e.pageBox)return"";let t=Xe(e.pageBox.formatId,e.pageBox.tokens);return` class="${b(t.class)}" data-format="${b(t.dataFormat)}" style="${b(t.style)}"`}function Wo(e){if(e.kind==="none"||Object.keys(e.islandMap).length===0)return"";let t=e.hostScriptSrc?`
117
117
  <script id="tr-island-host" type="module" src="${b(e.hostScriptSrc)}"></script>`:"";return`${Object.keys(e.importMap).length===0?"":`
118
118
  <script type="importmap">${ne({imports:e.importMap})}</script>`}
119
119
  <script>window.__TR_ISLAND_MAP=${ne(e.islandMap)};</script>
@@ -127,27 +127,27 @@ ${t}
127
127
  </head>
128
128
  ${e.body}
129
129
  </html>
130
- `}function zo(e){if(e.kind==="frame")return Ze(e.format,e.sectionHtml);let t=e.pages.map(o=>Ze(e.format,o)),{panels:n}=W(e.format);if(n===1)return t.join(`
130
+ `}function Vo(e){if(e.kind==="frame")return Je(e.format,e.sectionHtml);let t=e.pages.map(o=>Je(e.format,o)),{panels:n}=W(e.format);if(n===1)return t.join(`
131
131
  `);if(t.length%n!==0)throw new Error(`page-shell: format "${e.format.id}" folds ${n} panels to a sheet, but the stack has ${t.length} pages, not a whole number of sheets`);let r=[];for(let o=0;o<t.length;o+=n)r.push(Rt(e.format,t.slice(o,o+n)));return r.join(`
132
- `)}function Go(e){if(e.kind!=="frameStack")return[];let t=W(e.format).panels===1?Pe:Ce;return[`body > .${t} { break-after: page; }`,`body > .${t}:last-child { break-after: auto; }`]}function $t(e){return e.kind==="links"?e.hrefs.map(t=>`<link rel="stylesheet" href="${b(t)}" />`):e.css.map(t=>`<style>${t}</style>`)}function Ln(e){let[t,...n]=e;return t===void 0?"<style></style>":n.length===0?`<style>${t}</style>`:`<style>${t}
132
+ `)}function zo(e){if(e.kind!=="frameStack")return[];let t=W(e.format).panels===1?Te:Pe;return[`body > .${t} { break-after: page; }`,`body > .${t}:last-child { break-after: auto; }`]}function $t(e){return e.kind==="links"?e.hrefs.map(t=>`<link rel="stylesheet" href="${b(t)}" />`):e.css.map(t=>`<style>${t}</style>`)}function Mn(e){let[t,...n]=e;return t===void 0?"<style></style>":n.length===0?`<style>${t}</style>`:`<style>${t}
133
133
  ${n.join(`
134
134
  `)}
135
135
  </style>`}function Ot(e){if(e.kind!=="bundles")return[];let t=[],n=e.reactVendorMap;if(n&&Object.keys(n).length>0&&t.push(`<script type="importmap">${ne({imports:n})}</script>`),Object.keys(e.islandMap).length===0)return t;for(let r of[e.runtime.url,...Object.values(n??{}),...e.reactVendorCore?[e.reactVendorCore.url]:[]])t.push(`<link rel="modulepreload" href="${b(r)}" />`);return t}function At(e,t){if(e.kind==="none"||Object.keys(e.islandMap).length===0)return"";let n=ne(e.islandMap),r=t==="eager"?' window.__TR_ISLAND_SCHEDULE = "eager";':"";return e.kind==="bundles"?`
136
136
  <script>window.__TR_ISLAND_MAP=${n};${r}</script>
137
137
  <script type="module" src="${b(e.runtime.url)}"></script>`:`
138
- ${Yo}
138
+ ${Go}
139
139
  <script>window.__TR_ISLAND_MAP = ${n};${r}</script>
140
- <script type="module" src="${b(e.bootstrapUrl)}"></script>`}var Yo=`<script type="module">
140
+ <script type="module" src="${b(e.bootstrapUrl)}"></script>`}var Go=`<script type="module">
141
141
  import RefreshRuntime from "/@react-refresh";
142
142
  RefreshRuntime.injectIntoGlobalHook(window);
143
143
  window.$RefreshReg$ = () => {};
144
144
  window.$RefreshSig$ = () => (type) => type;
145
145
  window.__vite_plugin_react_preamble_installed__ = true;
146
- </script>`;function Nn(){let e={};return new Proxy(e,{get:(t,n)=>typeof n!="string"||n in e||n==="then"||n==="toJSON"?e[n]:`#${n}`})}function Dn(e){let t=new URLSearchParams;for(let[r,o]of Object.entries(e))o!=null&&o!==""&&t.set(r,o);let n=t.toString();return n===""?"":`?${n}`}var fe={catalog:"api/catalog",render:"api/render",media:e=>`api/media${Dn({fixture:e})}`,capture:(e,t)=>`api/capture/${e}${Dn({fixture:t.fixture,format:t.format,page:t.page,canvas:t.canvas})}`,live:(e,t)=>`fixtures/${encodeURIComponent(e)}/live${t==="/"?"/":`${t}/`}`,hmr:"__hmr"};var Xo=["text","number","select","image","list","poi","url","date","email","phone","address","video","tour","document","media"],Jo=[],yl=[...Xo,...Jo];var It=["id","slot","index","def","value","present","enclosing"],Qe=["image","video","tour","document"];function F(e){return Qe.includes(e)}var _e={cutout:{label:"Background removed",kinds:["image"],site:"holder",options:{enclosed:{required:!1,type:"string",values:["clear","keep"]}}},autocrop:{label:"Cropped to its subject",kinds:["image"],site:"holder",options:{brief:{required:!0,type:"string"}}},probe:{label:"Probed",kinds:["image","video","document"],site:"kind",options:{}},understand:{label:"Understood",kinds:["image","video","document","tour"],site:"kind",options:{}},preview:{label:"Preview",kinds:["image","video","document"],site:"kind",options:{}},ladder:{label:"Renditions",kinds:["image","video","document"],site:"kind",options:{}},transcode:{label:"Transcoded",kinds:["video"],site:"kind",options:{}},poster:{label:"Poster",kinds:["video","document"],site:"kind",options:{}},rasterize:{label:"Pages rasterized",kinds:["document"],site:"kind",options:{}},fetch:{label:"Link fetched",kinds:["video","tour"],site:"kind",options:{}},tour_details:{label:"Tour details",kinds:["tour"],site:"kind",options:{}},crop:{label:"Cut to its crop",kinds:["image"],site:"place",options:{}}},Kn=Object.keys(_e),Zo=Kn.filter(e=>_e[e].site==="holder"),gl=Kn.filter(e=>_e[e].site==="kind");function Hn(e){return typeof e=="string"&&Object.hasOwn(_e,e)}function Qo(e){if(typeof e=="string")return Hn(e)?{kind:"process",verb:e}:null;if(typeof e!="object"||e===null||Array.isArray(e))return null;let{kind:t,verb:n}=e;return t==="process"&&Hn(n)?e:null}function Tt(e){let t=_e[e.verb],n=Object.keys(t.options),r=n.length>0?`it takes ${n.map(o=>`\`${o}\``).join(", ")}`:"it takes none";for(let[o,i]of Object.entries(e)){if(o==="kind"||o==="verb"||i===void 0)continue;if(o==="reads")return`\`${e.verb}\` takes no \`reads\` \u2014 a process is about one asset, never the property`;let s=t.options[o];if(s===void 0){let a=o==="aspect"&&e.verb==="autocrop"?"; its aspect is the holder's `crop` \u2014 the aspect it locks, free form where it locks none":"";return`\`${e.verb}\` takes no option "${o}" \u2014 ${r}${a}`}if(s.values!==void 0){if(typeof i!="string"||!s.values.includes(i))return`\`${e.verb}\`'s \`${o}\` is one of ${s.values.map(a=>`"${a}"`).join(", ")}`;continue}if(typeof i!==s.type||typeof i=="string"&&i.trim()==="")return`\`${e.verb}\`'s \`${o}\` is a non-empty ${s.type}`}for(let[o,i]of Object.entries(t.options))if(i.required&&e[o]===void 0)return`\`${e.verb}\` requires \`${o}\``;return null}function V(e){let{type:t,kinds:n}=e;if(t==="media"){let r=Array.isArray(n)?n.filter(o=>typeof o=="string"&&F(o)):[];return r.length>0?r:Qe}return typeof t=="string"&&F(t)?[t]:[]}function jt(e){let{kinds:t,process:n}=e;if(t!==void 0){if(e.type!=="media")return"declares `kinds` \u2014 only `media()` leaves its kind open; a kind's own builder fixes it";if(!Array.isArray(t)||t.length===0||!t.every(i=>typeof i=="string"&&F(i)))return`declares \`kinds\` ${JSON.stringify(t)} \u2014 a non-empty list of ${Qe.join(", ")}`}if(n===void 0)return null;let r=Zo.map(i=>`process.${i}()`).join(", ");if(!Array.isArray(n)||n.length===0)return`declares \`process\` ${JSON.stringify(n)} \u2014 a non-empty list of processes (${r})`;let o=new Set;for(let i of n){let s=Qo(i);if(s===null)return`processes ${JSON.stringify(i)}, which is no process (${r})`;let{verb:a}=s,l=_e[a];if(l.site==="kind")return`processes "${a}", which every ${l.kinds.join(", ")} gets from birth on its kind's row \u2014 never a holder's to declare`;if(l.site==="place")return`processes "${a}", which every ${l.kinds.join(", ")} place gets wherever its value carries a crop \u2014 never a holder's to declare`;if(o.has(a))return`processes "${a}" twice \u2014 a holder declares each process once`;o.add(a);let d=Tt(s);if(d!==null)return`processes "${a}" with options that do not fit: ${d}`;let m=V(e).filter(g=>!l.kinds.includes(g));if(m.length>0)return`processes "${a}", which applies to ${l.kinds.join(", ")} and not to ${m.join(", ")}`}return null}var ei={property:{latitude:"lat",longitude:"lon"},contact:{address:"contact_address"}},ti={address:{role:"bindable",container:"property",value_type:"text",fields:{display:{value_type:"text"},street:{value_type:"text"},street_no_type:{value_type:"text"},city:{value_type:"text"},state:{value_type:"text"},postal:{value_type:"text"},unit:{value_type:"text"}}},address_street:{role:"bindable",container:"property",value_type:"text"},address_unit:{role:"bindable",container:"property",value_type:"text"},address_city:{role:"bindable",container:"property",value_type:"text"},address_state:{role:"bindable",container:"property",value_type:"text"},address_postal:{role:"bindable",container:"property",value_type:"text"},listing_intent:{role:"bindable",container:"property",value_type:"text",writeback:{kind:"property",column:"listing_intent"}},lat:{role:"bindable",container:"property",value_type:"number"},lon:{role:"bindable",container:"property",value_type:"number"}},Bn={units:{role:"bindable",container:"property",value_type:"unit_list",row:{unit_id:{path:"unit_id",value_type:"text"},position:{path:"position",value_type:"number"},floor_plans:{path:"floor_plans",value_type:"image_list",row:{id:{value_type:"text"},floor_label:{value_type:"text"},position:{value_type:"number"}}},unit_label:{path:"unit_label",value_type:"text",primary:!0,writeback:{column:"unit_label"}},beds:{path:"beds",value_type:"number",primary:!0,writeback:{column:"beds"}},baths:{path:"baths",value_type:"number",primary:!0,writeback:{column:"baths"}},sqft:{path:"sqft",value_type:"number",primary:!0,writeback:{column:"sqft"}},price:{path:"price",value_type:"text",primary:!0,writeback:{column:"price"}}}},comparables:{role:"bindable",container:"property",value_type:"comparable_list",row:{id:{path:"id",value_type:"text"},address_street:{path:"address_street",value_type:"text"},address_city:{path:"address_city",value_type:"text"},address_state:{path:"address_state",value_type:"text"},address_postal:{path:"address_postal",value_type:"text"},address:{path:"address",value_type:"text"},lat:{path:"lat",value_type:"number"},lng:{path:"lng",value_type:"number"},distance_m:{path:"distance_m",value_type:"number"},status:{path:"status",value_type:"text"},price:{path:"price",value_type:"number",writeback:{column:"price"}},price_period:{path:"price_period",value_type:"text"},sale_date:{path:"sale_date",value_type:"text",writeback:{column:"sale_date"}},beds:{path:"beds",value_type:"number",writeback:{column:"beds"}},baths:{path:"baths",value_type:"number",writeback:{column:"baths"}},sqft:{path:"sqft",value_type:"number",writeback:{column:"sqft"}},photo:{path:"photo_upload_id",value_type:"image"},year_built:{path:"year_built",value_type:"number"},lot_sqft:{path:"lot_sqft",value_type:"number"},stories:{path:"stories",value_type:"number"},units:{path:"units",value_type:"number"},hoa_monthly:{path:"hoa_monthly",value_type:"number"},list_price:{path:"list_price",value_type:"number"},listed_date:{path:"listed_date",value_type:"text"},mls_number:{path:"mls_number",value_type:"text"},description:{path:"description",value_type:"text"}}},contacts:{role:"bindable",container:"property",value_type:"contact_list",row:{id:{path:"id",value_type:"text"},primary:{path:"primary",value_type:"boolean"},name:{path:"name",value_type:"text",primary:!0,writeback:{column:"name"}},title:{path:"title",value_type:"text",primary:!0,writeback:{column:"title"}},org_name:{path:"org_name",value_type:"text",primary:!0,writeback:{column:"org_name"}},bio:{path:"bio",value_type:"text",primary:!0,writeback:{column:"bio"}},address:{path:"address",value_type:"text",primary:!0},email:{path:"email",value_type:"text",primary:!0,writeback:{column:"email"}},phone:{path:"phone",value_type:"text",primary:!0,writeback:{column:"phone"}},website:{path:"website_url",value_type:"text",primary:!0,writeback:{column:"website"}},instagram:{path:"instagram_url",value_type:"text",primary:!0,writeback:{column:"socials.instagram"}},linkedin:{path:"linkedin_url",value_type:"text",primary:!0,writeback:{column:"socials.linkedin"}},x:{path:"x_url",value_type:"text",primary:!0,writeback:{column:"socials.x"}},facebook:{path:"facebook_url",value_type:"text",primary:!0,writeback:{column:"socials.facebook"}},headshot:{path:"avatar_upload_id",value_type:"image",primary:!0},logo_dark:{path:"logo_dark_upload_id",value_type:"image",primary:!0},logo_light:{path:"logo_light_upload_id",value_type:"image",primary:!0}}}},Wn={description:{role:"readable",path:"narrative.description",value_type:"text"},unit:{role:"readable",path:"units",value_type:"row",primary_of:"units"},contact:{role:"readable",path:"contacts",value_type:"row",primary_of:"contacts"}};function Un(e){let t=Bn[Wn[e].primary_of],n=ei[e]??{},r={};for(let[o,i]of Object.entries(t.row)){if(i.primary!==!0)continue;let s={role:"bindable",container:e,value_type:i.value_type};i.value_type==="image"&&(s.image=!0),i.writeback!==void 0&&(s.writeback=e==="unit"?{kind:"unit",column:i.writeback.column}:{kind:"contact",field:i.writeback.column}),r[n[o]??o]=s}return r}function ni(){return{...ti,...Un("unit"),...Bn,...Un("contact"),...Wn}}var Me=ni();var ke={units:{idKey:"unit_id",ownership:"property"},contacts:{idKey:"id",cap:12,min:1,ownership:"library"},comparables:{idKey:"id",ownership:"property"}},ri={units:"property.units",contacts:"property.contacts",comparables:"property.comparables",commercial_spaces:"property.commercial_spaces"},Pt={contacts:"library.contacts"};function Ct(e){return Object.hasOwn(ke,e)}var qn=Object.fromEntries([...Object.entries(ri),...Object.entries(Pt)].map(([e,t])=>[t,e]));function S(e){if(typeof e!="string")return null;if(Object.hasOwn(ke,e))return{table:e,reading:"legacy"};let t=Object.hasOwn(qn,e)?qn[e]:void 0;return t===void 0?null:{table:t,reading:"registry"}}var oi={matterport:{kind:"tour",label:"Matterport",pattern:/(^|\.)matterport\.com$/i,strategy:"api"},biganto:{kind:"tour",label:"Biganto",pattern:/(^|\.)biganto\.com$/i,strategy:"opengraph"},iguide:{kind:"tour",label:"iGUIDE",pattern:/(^|\.)youriguide\.com$/i,strategy:"opengraph"},kuula:{kind:"tour",label:"Kuula",pattern:/(^|\.)kuula\.co$/i,strategy:"opengraph"},momento360:{kind:"tour",label:"Momento360",pattern:/(^|\.)momento360\.com$/i,strategy:"opengraph"},cloudpano:{kind:"tour",label:"CloudPano",pattern:/(^|\.)cloudpano\.com$/i,strategy:"none"},asteroom:{kind:"tour",label:"Asteroom",pattern:/(^|\.)asteroom\.com$/i,strategy:"none"},zillow3d:{kind:"tour",label:"Zillow 3D Home",pattern:/(^|\.)zillow\.com$/i,path:/^\/view-3d-home\//i,strategy:"none"},youtube:{kind:"video",label:"YouTube",pattern:/(^|\.)(youtube\.com|youtu\.be)$/i,strategy:"oembed"},vimeo:{kind:"video",label:"Vimeo",pattern:/(^|\.)vimeo\.com$/i,strategy:"oembed"},zillow:{kind:"listing",label:"Zillow",pattern:/(^|\.)zillow\.com$/i,strategy:"none"},redfin:{kind:"listing",label:"Redfin",pattern:/(^|\.)redfin\.com$/i,strategy:"none"},dropbox:{kind:"file",label:"Dropbox",pattern:/(^|\.)dropbox\.com$/i,strategy:"none"},drive:{kind:"file",label:"Google Drive",pattern:/^drive\.google\.com$/i,strategy:"none"},maps:{kind:"map",label:"Google Maps",pattern:/(^|\.)google\.com$/i,path:/^\/maps(\/|$)/i,strategy:"none"}};function Vn(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!=="http:"&&t.protocol!=="https:")return null;for(let[n,r]of Object.entries(oi))if(r.pattern.test(t.hostname)&&!(r.path&&!r.path.test(t.pathname)))return n;return null}var ii="badge=0&autopause=0&player_id=0&title=0&byline=0&portrait=0&sidedock=0&vimeo_logo=0&pip=0&chromecast=0&quality_selector=0&progress_bar=1";function zn(e){let t=e.trim();if(!t)return null;let n=Vn(t);if(n==="vimeo"){let r=t.match(/vimeo\.com\/(?:.*\/)?(\d+)/);return r?`https://player.vimeo.com/video/${r[1]}?${ii}`:null}if(n==="youtube"){let r=t.match(/youtu\.be\/([A-Za-z0-9_-]{11})/)??t.match(/[?&]v=([A-Za-z0-9_-]{11})/)??t.match(/youtube\.com\/(?:embed|shorts)\/([A-Za-z0-9_-]{11})/);return r?`https://www.youtube.com/embed/${r[1]}?rel=0`:null}return null}function Gn(e){let t=e.trim();if(!t)return null;let n=Vn(t);if(n==="matterport"){let r=new URL(t).searchParams.get("m");return r!==null&&/^[A-Za-z0-9]+$/.test(r)?`https://my.matterport.com/show/?m=${r}&nt=1`:null}return n!==null&&si.has(n)?t:null}var si=new Set(["biganto","iguide","kuula","momento360","cloudpano","asteroom","zillow3d"]);var ai=["crop","cutout","mask_white","mask_black"];function Mt(e){return e!==null&&!(e.x<=0&&e.y<=0&&e.width>=1&&e.height>=1)}function li(e){return e.url!==null?e.url.replace(/^[a-z][a-z0-9+.-]*:\/\//i,""):e.key?.split("/").pop()??e.id}function Lt(e,t){let{id:n,renditions:r,...o}=e,i=e.kind==="image";return{...o,id:t.id,file:t.file,crop:i?t.crop:null,name:t.name!==null&&t.name!==""?t.name:li(e),renditions:{...r,crop:i?t.renditions.crop:null,cutout:i?t.renditions.cutout:null,mask_white:i?t.renditions.mask_white:null,mask_black:i?t.renditions.mask_black:null}}}function Yn(e){return e.url===null?"upload":"link"}function z(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Xn(e){if(!z(e))return!1;let{id:t,kind:n,renditions:r}=e;return typeof t=="string"&&typeof n=="string"&&F(n)&&z(r)}function Jn(e){return z(e)&&typeof e.id=="string"&&typeof e.file=="string"&&z(e.renditions)&&!("kind"in e)}function ci(e){return z(e)&&typeof e.file=="string"&&"picked"in e&&z(e.renditions)&&!("id"in e)}function et(e){return z(e)&&typeof e.media=="string"&&e.media!==""}function di(e){let t=e.asset_id;return typeof t=="string"&&t!==""?t:void 0}function xe(e){if(z(e))return et(e)?e.media:Jn(e)||Xn(e)?e.id:ci(e)?e.picked??e.file:di(e)}function Ft(e,t){if(Array.isArray(e))for(let n of e)Ft(n,t);else if(Jn(e))t.has(e.id)||t.set(e.id,e);else if(z(e)&&!Xn(e))for(let n of Object.values(e))Ft(n,t)}function tt(e){let t=new Map;for(let[n,r]of Object.entries(e))n!=="files"&&Ft(r,t);return t}function ui(e,t){return Object.hasOwn(e.files,t)?e.files[t]:void 0}function fi(e,t){let n=ui(t,e.file);return n===void 0?null:Lt(n,e)}function Zn(e){let t={};for(let[n,r]of tt(e)){let o=fi(r,e);o!==null&&(t[n]=o)}return t}function pi(e){return Object.hasOwn(e,"crop")||e.renditions!==void 0}function mi(e,t){let n=Object.hasOwn(t,"crop"),r=t.renditions??{},o=n?null:e.renditions,i=Object.fromEntries(ai.map(s=>[s,Object.hasOwn(r,s)?r[s]??null:o?.[s]??null]));return{crop:n?t.crop??null:e.crop,renditions:i}}function Nt(e,t){return pi(t)?{...e,...mi({crop:e.crop,renditions:e.renditions},t)}:e}var Le="property.uploads";function Qn(e){if(typeof e=="string"&&e!=="")return[e];if(!(!Array.isArray(e)||e.length===0||!e.every(t=>typeof t=="string"&&t!=="")))return[...e]}function Dt(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function hi(e){if(xe(e)!==void 0||!Dt(e))return e;for(let t of Object.values(e))if(xe(t)!==void 0)return t}function Ht(e,t){let[n,...r]=t.split(".");if(n!=="property"||r.length===0)return null;let o=e;for(let i of r)if(o=Array.isArray(o)?o.find(s=>Dt(s)&&s.id===i):Dt(o)&&Object.hasOwn(o,i)?o[i]:void 0,o===void 0)return null;return Array.isArray(o)?o.flatMap(i=>{let s=hi(i),a=xe(s);return a===void 0?[]:[{id:a,value:s}]}):null}function er(e,t){return Ht(e,t)?.map(({id:n})=>n)??null}function yi(e,t){let n=tt(e),r=new Set,o=[];for(let i of Qn(t.from)??[])for(let{id:s,value:a}of Ht(e,i)??[]){if(r.has(s))continue;let l=n.get(s),d=l===void 0||!Object.hasOwn(e.files,l.file)?void 0:e.files[l.file];if(l===void 0||d===void 0||!t.kinds.includes(d.kind))continue;r.add(s);let m=et(a)?Nt(l,a):l;o.push({id:s,value:m,file:d,list:i})}return o}function gi(e,t){return yi(e,t).map(({value:n,file:r,list:o})=>({asset:Lt(r,n),list:o}))}function re(e,t){return gi(e,t).map(({asset:n})=>n)}var w=class extends Error{constructor(n,r){super(r);this.status=n}status};function bi(e){return e.split("-").map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}function tr(e){let{variant:t}=e;return{required:e.required,variant:t===null?null:{cases:t.cases.map(n=>({value:n,label:bi(n)})),locked:t.locked}}}function nr(e){return Object.fromEntries(e.map(t=>[t.instance_id,{enabled:t.enabled,...t.variant===void 0?{}:{variant:t.variant}}]))}function rr(e){if(e==null)return{};if(typeof e!="object"||Array.isArray(e))throw new w(400,"A render request's display is an object keyed by instance id.");let t={};for(let[n,r]of Object.entries(e)){if(typeof r!="object"||r===null||Array.isArray(r))throw new w(400,`The display state of "${n}" is not an object.`);let{enabled:o,variant:i}=r;if(o!==void 0&&typeof o!="boolean")throw new w(400,`The display state of "${n}" has a non-boolean enabled.`);if(i!==void 0&&typeof i!="string")throw new w(400,`The display state of "${n}" has a non-string variant.`);t[n]={...o===void 0?{}:{enabled:o},...i===void 0?{}:{variant:i}}}return t}function or(e,t){for(let[n,r]of Object.entries(t)){let o=e.instances.find(s=>s.instanceId===n);if(o===void 0)throw new w(400,`The composition places no instance "${n}".`);if(r.enabled===!1&&o.display.required)throw new w(400,`Section instance "${n}" is required and cannot be hidden.`);if(r.variant===void 0)continue;let i=o.display.variant;if(i===null)throw new w(400,`Section instance "${n}" declares no display variant.`);if(i.locked)throw new w(400,`Section instance "${n}" declares a locked variant, which the user cannot switch.`);if(!i.cases.includes(r.variant))throw new w(400,`"${r.variant}" is not a declared case of section instance "${n}" (declared: ${i.cases.join(", ")}).`)}}function ir(e,t){return new Map(e.instances.map(n=>[n.instance_id,t[n.instance_id]?.enabled??n.enabled]))}function sr(e,t,n){let r=n[e.instance_id]?.variant;if(r===void 0||r===e.variant)return e;let o={...e.slots};for(let[i,s]of Object.entries(t))i in o||(s.variant===void 0||s.variant.cases.includes(r))&&(o[i]=s.type==="list"?[]:null);return{...e,variant:r,slots:o}}function wi(e){return typeof e=="string"&&e!==""?e:null}function _i(e){return{listingIntent:wi(e.listing_intent),units:e.units.length,photos:re(e,{kinds:["image"],from:["property.property_media"]}).length}}function ki(e){let t=JSON.stringify(e),n=3735928559,r=1103547991;for(let o=0;o<t.length;o++){let i=t.charCodeAt(o);n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677)}return n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(16).padStart(14,"0")}function ar(e){return{id:e.id,label:e.label,summary:_i(e.facts),doc:ki(e.instances),display:nr(e.instances)}}function lr(e,t){let n=e.replace(/\/+$/,"");return t==="/"?`${n}/`:`${n}${t}/`}function cr(e){let{pages:t,currentPageId:n,basePath:r}=e,o=t.find(a=>a.id===n);if(!o)throw new Error(`nav: page "${n}" is not one of the declared pages (${t.map(a=>a.id).join(", ")}).`);let i=[o,...t.filter(a=>a.id!==o.id&&a.enabled!==!1)],s={};for(let a of i)for(let l of a.sections)l.enabled===!1||l.key in s||(s[l.key]=a.id===o.id?`#${l.anchor}`:`${lr(r,a.path)}#${l.anchor}`);return{anchors:s,pages:t.filter(a=>a.enabled!==!1).map(a=>({id:a.id,label:a.label,href:lr(r,a.path),current:a.id===o.id}))}}function nt(e,t){return e.pages?.[t]?.enabled!==!1}function Ut(e,t){return t.filter(n=>nt(e,n.id))}var Ne={base:"stylesheets/base.css",template:"stylesheets/template.css"},G={frame:"__capture/frame",print:"__capture/print"};function dr(e){return new URLSearchParams(e).toString()}function qt(e,t,n){return`${G.frame}?${dr({fixture:e,page:t,format:n})}`}function ur(e,t){return`${G.print}?${dr({fixture:e,format:t})}`}var Kt=Symbol.for("@homepages/concrete:row:of"),Bt=Symbol.for("@homepages/concrete:element:of");function ve(e){return typeof e=="object"&&e!==null&&e.kind==="sibling"&&R(e.of)}function xi(e,t){return e===t||_(e)&&_(t)&&e.key===t.key}function rt(e,t){let n=[...e];for(let r of t??[])n.some(o=>xi(o,r))||n.push(r);return n}function M(e){return typeof e=="object"&&e!==null&&"section"in e&&typeof e.section=="string"&&"slot"in e&&typeof e.slot=="string"}function Wt(e){return typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="row"&&"field"in e&&typeof e.field=="string"}function Y(e){if(!Wt(e))return;let t=e[Kt];return typeof t=="object"&&t!==null?t:void 0}function L(e){return typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="element"}function fr(e){if(!L(e))return;let t=e[Bt];return typeof t=="object"&&t!==null?t:void 0}function _(e){return typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="home"&&"key"in e&&typeof e.key=="string"}function pr(e){return typeof e=="object"&&e!==null&&"head"in e&&typeof e.head=="object"&&"declaration"in e&&R(e.declaration)}function R(e){return typeof e=="object"&&e!==null&&"type"in e&&typeof e.type=="string"}function ot(e,t){if(typeof e=="function")return{kind:"compute",fn:e,reads:[]};let n=t;if(e.requires===void 0)return{kind:"compute",fn:n,reads:[...e.reads]};if(!Array.isArray(e.requires)||e.requires.length===0)throw new Error("compute(): `requires` names at least one read \u2014 omit it when the value needs none.");return{kind:"compute",fn:n,reads:rt(e.reads,e.requires),requires:[...e.requires]}}function T(e){return typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="compute"&&"fn"in e&&typeof e.fn=="function"}function Vt(e){return typeof e=="object"&&e!==null&&e.kind==="compute"&&typeof e.fn=="function"}var vi="written-without-pick-none",Si={write:new Set(["brief","reads","requires","none"]),pick:new Set(["brief","reads","requires","unique"]),find:new Set(["brief","reads","requires","none"])};function zt(e,t){let n=`fill.${e}()`;if(typeof t.brief!="string"||t.brief.trim()==="")throw new Error(`${n}: \`brief\` is required \u2014 it is the whole instruction the model is given.`);let r=Si[e],o={kind:"fill",verb:e};for(let[s,a]of Object.entries(t)){if(!r.has(s)){let l=s==="none"&&e==="pick"?` A pick judges every candidate, so selecting none is already an outcome its brief steers \u2014 \`concrete upgrade\` drops \`none\` from every \`fill.pick\` (the \`${vi}\` codemod).`:s==="count"?" A fill takes no count: the list's own `min` and `max` bound how many items it fills.":s==="cap"?" A write's budget is its holder's `cap` \u2014 a text slot's own, or a list's `item: text.short({ cap })`.":s==="of"&&e==="find"?" A find names no candidates: the platform's lookup for its holder's kind supplies the value.":s==="of"&&e==="pick"?" A pick chooses from its holder's candidates \u2014 a select's values, a media slot's `from` list of its kinds, a row's table, a list's item's.":s==="of"?" The kind a write produces is its holder's \u2014 a text slot's own, a list's `item`, a label's text slot.":"";throw new Error(`${n}: "${s}" is not an option \u2014 it takes ${[...r].map(d=>`\`${d}\``).join(", ")}, and everything the model should know goes in the brief.${l}`)}if(s==="none"&&a!==void 0&&a!==!0)throw new Error(`${n}: \`none\` is \`true\` or absent \u2014 it admits the empty answer, and the brief's last sentence says when nothing is right.`);if(s==="unique"&&a!==void 0&&typeof a!="boolean")throw new Error(`${n}: \`unique\` is a boolean \u2014 \`false\` lets a pick repeat an element.`);if(s==="requires"&&a!==void 0&&(!Array.isArray(a)||a.length===0))throw new Error(`${n}: \`requires\` names at least one read \u2014 omit it when the fill needs none.`);a!==void 0&&(o[s]=s==="reads"||s==="requires"?[...a]:a)}let i=o.requires;return i!==void 0&&(o.reads=rt(o.reads??[],i)),o}function Ri(e){return zt("write",e)}function Ei(e){return zt("pick",e)}function $i(e){return zt("find",e)}var N={write:Ri,pick:Ei,find:$i};function D(e,t){if(K(e))return[e];if(!Array.isArray(e)||!e.every(o=>typeof o=="object"&&o!==null))return;if(e.length===0)throw new Error(`${t} declares \`source: []\` \u2014 a list of fills names at least one fill, and a holder nothing fills declares no \`source\`.`);let n=e.filter(o=>!K(o)).length;if(n===0)return e;let r=n<e.length?"a derivation beside a fill":n>1?"several derivations":"a derivation in a list";throw new Error(`${t}'s \`source\` lists ${r} \u2014 \`source\` takes one derivation (a fact, a slot, a row's member, the element, a \`compute()\`) or an ordered list of fills: a holder has one write path, and a derived value has no writer beside it.`)}function pe(e){return K(e)||Array.isArray(e)&&e.length>0&&e.every(K)}function K(e){return typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="fill"&&"verb"in e&&(e.verb==="write"||e.verb==="pick"||e.verb==="find")&&"brief"in e&&typeof e.brief=="string"}var it=Symbol.for("@homepages/concrete:fill:declaration");function mr(e){return pe(e)?{[it]:K(e)?[e]:[...e]}:{}}function H(e){if(!(typeof e!="object"||e===null))return e[it]}var hr=["Basement","Ground","1st floor","2nd floor","3rd floor","4th floor","Penthouse"];var Oi=["street","unit","city","state","postal"],yr=[...Oi,"latitude","longitude"];function Gt(e){return yr.includes(e)}var gr=new Map;function Yt(e){gr.set(e.home,e)}function Ai(e){let t=gr.get(e);if(t===void 0)throw new Error(`fact registry: the ${e} registry is not declared yet \u2014 import @homepages/template-contracts/fact-registry (or ./fact-keys, ./table-members) before reading it.`);return t}var br=new Set(["text","select","email","phone","url","date"]);function Se(e){switch(e.type){case"number":case"image":case"address":return e.type;case"list":return Ii(e.element);default:return br.has(e.type)?"text":null}}function Ii(e){return e.type==="object"?"row_list":e.type==="image"?"image_list":e.type==="number"?"number_list":br.has(e.type)?"text_list":null}function Ti(e){return Object.hasOwn(Pt,e)?"library":"property"}function ji(e,t){let n=e.pages[t],r=n?.declaration.type==="list"?n.declaration.element:void 0;if(r?.type!=="object")throw new Error(`fact registry: the ${e.home} registry declares no list of objects "${t}"`);return r.fields}function me(e){return ji(Ai(Ti(e)),e)}function Re(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function wr(e){if(typeof e!="string")return null;let t=e.lastIndexOf(".");if(t<=0)return null;let n=S(e.slice(0,t));if(n?.reading!=="registry")return null;let r=e.slice(t+1),o=Re(me(n.table),r);return o!==void 0&&Se(o)==="row_list"?{table:n,member:r}:null}var st=["type","label","from","source","locked","when"],Xt=new Set(st),at=Symbol.for("@homepages/concrete:table-of");function lt(e,t){return Object.defineProperty(e,at,{value:t,enumerable:!1})}function He(e){if(typeof e!="object"||e===null)return null;let t=e[at];return typeof t=="object"&&t!==null?t:null}function Pi(e){if(e.reading==="registry")return Object.keys(me(e.table));let t=Me[e.table].row;return Object.keys(t).filter(n=>n!==ke[e.table].idKey&&!Xt.has(n))}function De(e,t){return Object.freeze({kind:"row",field:t,[Kt]:e})}function Ci(e,t){return new Proxy(De(e,t),{get(n,r,o){return typeof r=="string"&&!(r in n)&&Gt(r)?De(e,`${t}.${r}`):Reflect.get(n,r,o)}})}var kr=Symbol.for("@homepages/concrete:row:definition");function j(e){let t=e[kr];return typeof t=="object"&&t!==null?t:e}function Fi(e,t){if(e.reading==="legacy")return!1;let n=Re(me(e.table),t);return n!==void 0&&Se(n)==="address"}function _r(e,t){if(e.reading==="legacy"){let r=Me[e.table].row;return Object.hasOwn(r,t)?String(r[t].value_type):void 0}let n=Re(me(e.table),t);return n===void 0?void 0:String(Se(n)??"")}var Mi=new Set(["then","toJSON","$$typeof","asymmetricMatch","nodeType","tagName","@@iterator"]);function xr(e,t,n=[]){let r=t===null?null:new Set(Pi(t)),o=new Proxy(e,{get(i,s,a){if(s===kr)return i;if(typeof s!="string")return Reflect.get(i,s,a);if(t!==null&&r!==null){let l=[t,...n],d=l.map(g=>g===t?r.has(s)?_r(t,s):void 0:_r(g,s));if(d.every(g=>g===void 0))return Reflect.get(i,s,a);let m=d.findIndex(g=>g===void 0||g!==d[0]);if(m===-1)return Fi(t,s)?Ci(o,s):De(o,s);if(s in i||Xt.has(s))return Reflect.get(i,s,a);throw new Error(`row: "${String(i.label)}" reads the member "${s}", which its \`from\` table ${l[m].table} ${d[m]===void 0?"lacks":"holds at another kind"} \u2014 every table a row names carries every member its readers read, at one kind.`)}return s in i||Xt.has(s)?Reflect.get(i,s,a):Mi.has(s)?void 0:De(o,s)}});return o}function vr(e){let t=new Proxy(e,{get(n,r,o){return typeof r=="string"&&!(r in n)&&Gt(r)?De(t,r):Reflect.get(n,r,o)}});return t}function Sr(e,t){let n=e.map(t);return n.some((r,o)=>r!==e[o])?n:void 0}function Rr(e,t){let n=e.reads===void 0?void 0:Sr(e.reads,t),r=e.requires===void 0?void 0:Sr(e.requires,t);return n===void 0&&r===void 0?e:{...e,...n===void 0?{}:{reads:n},...r===void 0?{}:{requires:r}}}function X(e,t){let n=j(e),r,o=n.source;if(o!==void 0)if(T(o)){let s=Rr(o,t);s!==o&&(r={...n,source:s})}else{let s=t(o);s!==o&&(r={...n,source:s})}let i=H(n);if(i!==void 0){let s=!1,a=i.map(l=>{let d=Rr(l,t);return d!==l&&(s=!0),d});s&&(r={...r??n,[it]:a})}return r??n}function Er(e){return t=>{let n=Y(t);if(n===void 0)return t;let r=e.get(n);return r===void 0?t:{kind:"row",slot:r,field:t.field}}}var $r=new Set(["row","address"]);function Or(e){let t=new Map;for(let[n,r]of Object.entries(e))typeof r=="object"&&r!==null&&$r.has(r.type)&&t.set(r,n);return t}function Ar(e,t,n){let r=[e.source];X(e,o=>(r.push(o),o));for(let[o,i]of t)if(!(o===e||i===n))for(let s of st){let a=o[s];if(a!==void 0&&r.includes(a))return`${i}.${s}`}}function Ir(e){let t=e.slice(e.indexOf(".")+1);return`reads \`${e}\`, which is the row's own \`${t}\`, not a member \u2014 a row's ${st.map(n=>`\`${n}\``).join(", ")} are its slot definition's, and its table has no member named \`${t}\`.`}function oe(e){return $r.has(e.type)?{...j(e)}:e}var Li={"property.listing_intent":"listing_intent","property.description":"description","property.address":"address","property.address.street":"address_street","property.address.unit":"address_unit","property.address.city":"address_city","property.address.state":"address_state","property.address.postal":"address_postal","property.address.latitude":"lat","property.address.longitude":"lon"};function Tr(e){let t=Li;if(Object.hasOwn(t,e))return t[e];let n=S(e)?.table;return n!==void 0&&Ct(n)?n:e}function Zt(e,t){for(let n of D(t,e)??[])if(!(n.verb!=="pick"||n.of===void 0))throw new Error(`${e}'s \`fill.pick\` states \`of\` \u2014 a pick chooses from its holder's \`from\`; remove \`of\` and name the candidates in \`from\`.`)}function Ni(e){return M(e)?{kind:"section",section:e.section,slot:e.slot}:R(e)?{kind:"sibling",of:e}:_(e)?{kind:"home",key:e.key}:e}function U(e){return Ue(e,Ni)}function Di(e,t,n){if(!(t!==!0||n===void 0)){if(T(n)){if(n.requires!==void 0&&n.requires.length>0)return;throw new Error(`${e} is \`required\` and sourced by a \`compute()\` naming no \`requires\` \u2014 nothing to require. Name the reads the value cannot do without: \`compute({ reads, requires: [fact.property.address] }, \u2026)\`.`)}if(M(n)||R(n)||ve(n))throw new Error(`${e} is \`required\` and mirrors another slot \u2014 a mirror requires its upstream; mark that slot \`required\` instead.`)}}function Ue(e,t){let n=e.source;Di(e.label??"a slot",e.required,n);let r=n!==void 0&&D(n,e.label??"a slot")===void 0;return{...e.locked===!0?{locked:!0}:{},...e.required===!0?{required:!0}:{},...r?{source:t(n)}:{},...mr(n),...e.label!==void 0?{label:e.label}:{},...e.placeholder!==void 0?{placeholder:e.placeholder}:{},...e.when!==void 0?{when:e.when}:{}}}function Jt(e){return t=>({type:"text",size:e,...U(t),...t.cap!==void 0?{cap:t.cap}:{}})}var $={short:Jt("short"),medium:Jt("medium"),long:Jt("long")};function E(e){return{type:"number",...U(e),...e.thousandsSep!==void 0?{thousandsSep:e.thousandsSep}:{},...e.decimals!==void 0?{decimals:e.decimals}:{},...e.maxDigits!==void 0?{maxDigits:e.maxDigits}:{}}}function Hi(e){let t=e.source;return{type:"select",...U(e),..._(t)?{options:{source:Tr(t.key)}}:{},...e.creatable!==void 0?{creatable:e.creatable}:{}}}function Ui(e){if(_(e.source))throw new Error(`select: "${e.label}" declares both \`from\` and a fact \`source\` \u2014 a select takes exactly one set of choices.`);return Zt(`select: "${e.label}"`,e.source),{type:"select",...U(e),values:[...e.from],...e.creatable!==void 0?{creatable:e.creatable}:{}}}function qi(e,t){if(K(t.source)&&t.source.verb!=="pick")throw new Error(`select: a display entry is filled by \`fill.pick\` \u2014 the model picks one of its cases \u2014 never \`fill.${t.source.verb}\`.`);return Zt("select: a display entry",t.source),{cases:[...e],...t.locked===!0?{locked:!0}:{},...t.source!==void 0?{source:t.source}:{}}}function Ki(e){if(Array.isArray(e))throw new Error("select: takes one options object \u2014 write the choices as `from`: `select({ from: [...], \u2026 })`.");if(e.options!==void 0)throw new Error("select: declares `options` \u2014 a select names its choices in `from`: `select({ from: [...], \u2026 })`.");return e.label===void 0&&Array.isArray(e.from)?qi(e.from,e):e.from!==void 0?Ui(e):Hi(e)}var qe=Ki;function he(e){return{type:"url",...U(e),...e.accepts!==void 0?{accepts:e.accepts}:{}}}function Qt(e){return{type:"date",...U(e)}}function jr(e){return{type:"email",...U(e)}}function Pr(e){return{type:"phone",...U(e)}}function ct(e={}){return vr({type:"address",...U(e)})}function Cr(e,t){let n=`${e}: "${t.label??e}"`;if(Zt(n,t.source),"category"in t)throw new Error(`${n} declares \`category\` \u2014 a media declaration names the list it picks from in \`from\` (\`from: fact.property.property_media\`, \`fact.property.floor_plans\`, \`fact.property.uploads\`), or owns its asset without one.`);if("sources"in t)throw new Error(`${n} declares \`sources\` \u2014 a media slot takes a pasted link wherever a link provider claims its kind (a video, a tour), and declares nothing for it. \`concrete upgrade\` removes it.`);let r=jt({type:e,kinds:t.kinds,process:t.process});if(r!==null)throw new Error(`${n} ${r}.`);let o=D(t.source,n),i=t.source!==void 0&&o===void 0&&!T(t.source);if(i&&t.from!==void 0)throw new Error(`${n} picks \`from\` a media list and declares a \`source\` \u2014 a slot bound to a fact holds what that fact holds.`);if((i||T(t.source))&&t.process!==void 0)throw new Error(`${n} declares \`process\` beside a \`source\` that derives its value \u2014 a derived slot holds what it derives from, processed where that is declared.`);if(o?.some(l=>l.verb==="pick")===!0&&t.from===void 0)throw new Error(`${n} is picked by a \`fill.pick\` and names no \`from\` \u2014 a pick chooses from its holder's \`from\` (\`from: fact.property.property_media\`); a media declaration without one owns its asset.`);let a=Bi(n,e,t.kinds,t.from)?.map(l=>_(l)?l.key:l);return{...a!==void 0?{from:a.length===1?a[0]:a}:{},...t.process!==void 0?{process:t.process.map(l=>({...l}))}:{}}}function Bi(e,t,n,r){if(r===void 0)return;let o=Array.isArray(r)?r:[r];if(o.length===0)throw new Error(`${e} declares \`from: []\` \u2014 name the media list it picks from, or omit \`from\` and the declaration owns its asset.`);let i=V({type:t,kinds:n}),s=new Set;for(let a of o){let l=typeof a=="object"&&a!==null&&!_(a),d=_(a)?a.key:l&&"declaration"in a?a.declaration:a;if(s.has(d))throw new Error(`${e} picks \`from\` one media list twice \u2014 each list is named once; an asset two lists hold is one candidate, attributed to the first.`);if(s.add(d),!l)continue;let m=V(d.element);if(m.length>0&&!i.some(g=>m.includes(g)))throw new Error(`${e} picks \`from\` a list of ${m.join(", ")}, whose items can never be ${i.join(" or ")} \u2014 each list it picks from holds items of its kinds.`)}return o}function J(e={}){return{type:"image",...U(e),...e.crop!==void 0?{crop:e.crop}:{},...Cr("image",e)}}function dt(e={}){return{type:"media",...U(e),...e.kinds!==void 0?{kinds:[...e.kinds]}:{},...Cr("media",e)}}var tn=Symbol.for("@homepages/concrete:object:declared-fields");function ie(e){return e[tn]}function nn(e,t){let n=ie(t);return n!==void 0&&Object.defineProperty(e,tn,{value:n,enumerable:!1}),e}var Fr="a label is a source, as a text slot takes one",en="`label: text.short({ cap: 60, source: fill.write({ reads, brief }) })`",Wi=new Set(["type","size","cap","locked"]);function Vi(e,t,n){if(typeof t=="string")throw new Error(`${e} declares the label ${JSON.stringify(t)} \u2014 ${Fr}: write \`label: compute(() => ${JSON.stringify(t)})\`.`);if(R(t)){let r=Object.entries(n).find(([,o])=>o===t);if(r===void 0)return zi(e,t);if(t.type!=="text"&&t.type!=="address")throw new Error(`${e} label names its field "${r[0]}", a "${t.type}" \u2014 a label names a text or an address field.`);return{field:r[0]}}if(pe(t)){let r=K(t)?`\`fill.${t.verb}\``:"list of fills";throw new Error(`${e} label is a bare ${r} \u2014 the label is the fill's holder, so it states the kind the fill writes: ${en}.`)}return $.short({locked:!0,source:t})}function zi(e,t){let n=H(t);if(n===void 0||n.some(s=>s.verb!=="write")||t.type!=="text")throw new Error(`${e} declares a slot as its label that is none of its fields \u2014 ${Fr}: write what that slot read as the label (\`label: comp.address.street\`, \`label: compute(() => "Listing agent")\`), a written label as ${en}; a title the user edits is a field, which the label names by its const.`);let r=Object.keys(t).filter(s=>!Wi.has(s));if(r.length>0)throw new Error(`${e} label is a written text slot declaring ${r.map(s=>`\`${s}\``).join(", ")} \u2014 a label states only its kind and cap: ${en}; a title the user edits is a field, which the label names by its const.`);let{size:o,cap:i}=t;return $[o]({locked:!0,source:n.length===1?n[0]:n,...i!==void 0?{cap:i}:{}})}function Gi(e){let{type:t,element:n}=e;if(t==="object")return"an object \u2014 an object never holds another; flatten its fields into this one";if(t==="list"&&n?.type==="object")return Yi(e);if(t==="list"&&n?.type==="row")return"a list of rows \u2014 declare the selection at the top level instead"}var Ke="declare the list at the top level instead";function Yi(e){let t=H(e);if(t!==void 0&&t.some(o=>o.verb!=="pick")||t===void 0&&pe(e.source))return`a list of objects declaring a fill other than a pick \u2014 no fill but a pick writes a list inside an object; ${Ke}`;let n=e.source;if(_(n))return`a list of objects sourced by the fact "${n.key}" \u2014 its items carry their own minted ids, so it lists a row's member, a \`compute()\` or authored items; ${Ke}`;if(M(n)||ve(n)||R(n))return`a list of objects sourced by another list slot \u2014 its items carry their own minted ids, so it lists a row's member, a \`compute()\` or authored items; ${Ke}`;let r=e.element.fields;for(let[o,i]of Object.entries(r)){let s=Xi(i,r);if(s!==void 0)return`a list of objects whose item field "${o}" is ${s}`}}function Xi(e,t){if(e.type==="list"&&e.element?.type==="object")return"a list of objects \u2014 a list of objects nests one level; flatten the inner list's fields into this item or declare it beside the outer list";if(H(e)!==void 0)return`filled \u2014 no fill writes into a list inside an object; ${Ke}`;let n=e.source;if(n===void 0)return;if(T(n))return`a \`compute()\` \u2014 an item of a list inside an object reads its element, or a row \`from\` its member; ${Ke}`;let{kind:r,slot:o}=n;if(r==="element"&&e.type==="row"&&S(e.from)!==null)return"a table's row holding the element \u2014 the element of a list inside an object is a member's item: hold it in a row `from` that member (`row({ label, from: unit.floor_plans, source: entry })`)";if(r!=="element"&&!(e.type!=="row"&&r==="row"&&typeof o=="string"&&t[o]?.type==="row"))return"bound to something outside its item \u2014 an item of a list inside an object reads its element, a row `from` its member, or a row beside it"}function Ee(e){let t="object";if(e.source!==void 0)throw new Error(`${t} declares \`source\`, but an object is a pure container with no value of its own \u2014 declare it on the field that holds the value.`);if(Object.hasOwn(e.fields,"label")&&e.fields.label!==e.label)throw new Error(`${t} declares a field keyed "label" \u2014 the key is reserved for the object's label: write its source as \`label\`, beside \`fields\`.`);let n=It.find(m=>Object.hasOwn(e.fields,m));if(n!==void 0)throw new Error(`${t} field "${n}" is named like its binding's own \`${n}\` \u2014 a field is read straight off its object's binding, which owns ${It.map(m=>`\`${m}\``).join(", ")}. Rename the field.`);let r=e.label===void 0?void 0:Vi(t,e.label,e.fields),o=r!==void 0&&!("type"in r)?r:void 0,i={...r===void 0||o!==void 0?{}:{label:r},...e.fields};if(Object.keys(i).length===0)throw new Error(`${t} declares no fields \u2014 an object groups at least one.`);for(let[m,g]of Object.entries(i)){let v=Gi(g);if(v!==void 0)throw new Error(`${t} field "${m}" is ${v}.`);if(m!=="label"&&g.label===void 0)throw new Error(`${t} field "${m}" declares no \`label\` \u2014 every field of an object states the name the editor shows it by.`)}let s=Or(i);for(let[m,g]of Object.entries(i)){let v=Ar(g,s);if(v!==void 0)throw new Error(`${t} field "${m}" ${Ir(v)}`)}let a=Er(s),l={};for(let[m,g]of Object.entries(i))l[m]=oe(X(g,a));let d={type:"object",...e.locked===!0?{locked:!0}:{},...o!==void 0?{label:o}:{},fields:l,...e.when!==void 0?{when:e.when}:{}};return Object.defineProperty(d,tn,{value:i,enumerable:!1}),d}var Lr=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);function Ji(e){return S(e.from)}function Zi(e){if(!Array.isArray(e.from)){let t=Ji(e);return t===null?[]:[t]}return e.from.flatMap(t=>S(t)??[])}function Qi(e){if(e===void 0)return;if(Mr(e.source))return e;if(e.type!=="object"||!Lr(e.fields))return;let t=Object.values(e.fields).filter(n=>Mr(n.source));return t.length===1?t[0]:void 0}function Nr(e){let t=Qi(e);return t?.type==="row"?Zi(t):[]}function Mr(e){return Lr(e)&&e.kind==="element"}var Mc=[...new Set(Object.values(ke).map(e=>e.idKey))].filter(e=>e!=="id");function es(e,t){if(_(e)){if(S(e.key)===null)throw new Error(`list: "${t}" is sourced by the fact "${e.key}", which is no table \u2014 a list's source is a table, a list slot, a list-valued member, a \`compute()\` or a fill; a list of the property's media is picked (\`fill.pick\`) from its item's \`from\`, or computed over a media list (\`compute({ reads: [fact.property.property_media] }, \u2026)\`).`);return{kind:"home",key:e.key}}if(M(e))return{kind:"section",section:e.section,slot:e.slot};if(R(e))return{kind:"sibling",of:e};if(Y(e)!==void 0||T(e))return e;throw new Error(`list: "${t}" declares a source that is no list.`)}function Ur(e){return _(e)?S(e.key):R(e)&&e.type==="list"?He(e):null}var ts=new Set(["label","locked","placeholder","when","source"]);function ns(e){let t={};for(let[n,r]of Object.entries(e))ts.has(n)||(t[n]=r);return t}function rs(e,t){if(_(e)&&S(e.key)!==null)return{type:"row",from:e.key,source:{kind:"element"}};for(let r of D(e,`list: "${t}"`)??[]){if(r.verb==="write")throw new Error(qr(t,"declares no `item`"));if(r.verb==="pick")throw new Error(on(t,"declares no `item`"))}if(pe(e))return{type:"poi"};if(R(e)&&e.type==="list")return is(e,t);let n=Y(e);if(n!==void 0){let r=He(n);if(r!==null&&os(r,e.field)==="image_list")return{type:"image"}}throw new Error(`list: "${t}" declares no \`item\`, and its source does not say what its elements are \u2014 declare \`item\`: a plain slot (\`item: image()\`), or a function of the element (\`item: (el) => object({ \u2026 })\`).`)}function os(e,t){if(e.reading==="legacy"){let r=Me[e.table].row;return Object.hasOwn(r,t)?r[t].value_type:void 0}let n=Re(me(e.table),t);return n===void 0?void 0:Se(n)??void 0}function qr(e,t){return`list: "${e}" is written by a \`fill.write\` and ${t} \u2014 the item is the kind every written element is: a value slot (\`item: text.short({ cap: 80 })\`), an object exactly one field of which holds the element (\`question: text.medium({ label: "Question", cap: 48, source: el })\`), or an object declared plainly whose members the write answers (\`item: object({ label: text.short({ label: "Unit" }), fields: { \u2026 } })\`).`}function Kr(e){if(typeof e!="object"||e===null||e.type!=="object")return!1;let t=e.fields??{};return!Object.values(t).some(n=>L(n.source))}function Dr(e,t){if(e.type!=="object")return;let n=Object.entries(e.fields).filter(([,r])=>r.type!=="row"&&r.source?.kind==="element");if(n.length!==1)throw new Error(qr(t,n.length===0?"its object item holds the element in no field":`its object item holds the element in ${String(n.length)} fields (${n.map(([r])=>`"${r}"`).join(", ")}) \u2014 one field holds it`))}function is(e,t){let n=e.element;if(n===void 0||n.type==="object")throw new Error(`list: "${t}" lists the items of a list of objects \u2014 declare \`item\` to say what each item holds.`);return n.type==="row"?{type:"row",from:n.from,source:{kind:"element"}}:ns(n)}function on(e,t){return`list: "${e}" is picked by a \`fill.pick\` and ${t} \u2014 the item holds the pick in the field holding its candidates: a candidate holder itself (\`item: image({ from: fact.property.property_media })\`, \`item: row({ label: "Agent", from: fact.property.contacts })\`), or an object exactly one field of which holds candidates and no source, which its siblings read by its const (\`const photo = image({ label: "Photo", from: fact.property.property_media }); object({ fields: { photo, caption: text.short({ label: "Caption", source: fill.write({ reads: [photo], brief }) }) } })\`).`}function sn(e){let t=j(e);return t.type==="row"?typeof t.from=="string":t.type==="select"?Array.isArray(t.values):typeof t.type=="string"&&(F(t.type)||t.type==="media")&&t.from!==void 0}function an(e){return j(e).source===void 0&&H(e)===void 0}function Br(e,t){if(e.type!=="object")return sn(e)&&an(e)?null:void 0;let n=ie(e)??e.fields??{},r=Object.entries(n).filter(([,s])=>typeof s=="object"&&s!==null&&sn(s)&&an(s)),o=r.filter(([,s])=>j(s).type!=="select"),i=o.length>0?o:r;if(i.length>1)throw new Error(`list: "${t}"'s item declares ${String(i.length)} fields with \`from\` and no source (${i.map(([s])=>`"${s}"`).join(", ")}) \u2014 a picked list's item holds its pick in exactly one; give the others a source of their own.`);return i.length===1?i[0][0]:void 0}function Hr(e){return{...oe(e),source:{kind:"element"}}}function rn(e,t){if(t===void 0)return null;let n=t===null?e:(ie(e)??e.fields)[t],r=j(n);return r.type==="row"?S(r.from):null}function ss(e,t){if(t===null)return Hr(e);let n=e,r=(ie(e)??n.fields)[t],o=s=>s===r||typeof s=="object"&&s!==null&&j(s)===j(r)?{kind:"element"}:s,i={};for(let[s,a]of Object.entries(n.fields))i[s]=s===t?Hr(a):X(a,o);return nn({...n,fields:i},n)}function as(e,t,n){let r=i=>{if(!L(i))return i;if(fr(i)!==t)throw new Error(`list: "${n}"'s item reads the element of another list \u2014 an element is read only inside its own list's item.`);return{kind:"element"}};if(e.type==="object"){let i=e,s={},a=!1;for(let[l,d]of Object.entries(i.fields))s[l]=oe(X(d,r)),s[l]!==d&&(a=!0);return a?nn({...i,fields:s},i):i}return oe(X(e,r))}function Wr(e,t){let n=e.type==="object"?Object.entries(e.fields):[["",e]];for(let[r,o]of n){let i=o.source;if(i?.kind==="home")throw new Error(`list: "${t}"'s item${r===""?"":` field "${r}"`} is bound to the fact "${String(i.key)}", which is the same value in every item \u2014 read the element or a row's member instead; a property fact belongs in a fill's or a \`compute()\`'s \`reads\`.`)}}function ls(e,t){if(e.item===void 0)return rs(e.source,t);let n=new Set((D(e.source,`list: "${t}"`)??[]).map(l=>l.verb));if(n.has("pick")){let l=cs(e.item,t);return n.has("write")&&Dr(l,t),l}let r={},o=Object.freeze({kind:"element",[Bt]:r,[at]:Ur(e.source)}),i=typeof e.item=="function"?e.item(o):e.item;if(typeof i!="object"||i===null||typeof i.type!="string")throw new Error(`list: "${t}"'s item is no slot \u2014 return a value slot, a row or an object.`);if(i.type==="list")throw new Error(`list: "${t}"'s item is a list \u2014 a list's item is a value slot, a row or an object; a list never holds lists.`);if(i.type!=="object"&&H(i)!==void 0)throw new Error(`list: "${t}"'s item declares a fill \u2014 one decision produces the whole list, so the fill belongs on the list's \`source:\`; a field of an object item may carry its own.`);Wr(i,t);let s=as(i,r,t);if(n.has("write")&&!Kr(e.item)&&Dr(s,t),s.type==="object"||s.type==="row")return s;let a={...s};return delete a.locked,a}function cs(e,t){if(typeof e=="function")throw new Error(on(t,"declares its item as a function"));if(typeof e!="object"||e===null||typeof e.type!="string")throw new Error(`list: "${t}"'s item is no slot \u2014 return a value slot, a row or an object.`);let n=Br(e,t);if(n===void 0)throw new Error(on(t,"its item declares no field with `from` and no source"));Wr(e,t);let r=ss(e,n);if(r.type==="object"||r.type==="row")return r;let o={...r};return delete o.locked,o}function ds(e,t){let n=e.source;if(!(n===void 0||(D(n,"list")??[]).some(i=>i.verb==="pick"))||typeof e.item!="object"||e.item===null)return Ur(n);let o=e.item;if(n===void 0){if(o.type!=="object")return rn(o,sn(o)?null:void 0);let i=Object.entries(ie(o)??{}).filter(([,s])=>j(s).type==="row"&&an(s));return i.length===1?rn(o,i[0][0]):null}return rn(o,Br(o,t))}function P(e){let t=e.label??"list";for(let d of["fields","title","unique","count"]){if(e[d]===void 0)continue;let m={fields:"declare `item: (el) => object({ fields })` \u2014 an item function returning an object",title:"give the item's object a `label` \u2014 a string, or a text slot",unique:"a pick is unique by default (`fill.pick({ unique: false })` lifts it)",count:"`min` and `max` bound how many items any source yields"};throw new Error(`list: "${t}" declares \`${d}\`, which a list no longer takes \u2014 ${m[d]}.`)}let n=e.source,r=D(n,`list: "${t}"`),o=Kr(e.item),i=r?.every(d=>d.verb==="pick"||d.verb==="write"&&o)===!0;if(r!==void 0&&e.max===void 0&&!i)throw new Error(`list: "${t}" is filled but declares no \`max\` \u2014 a fill is an open supply, so the list bounds it.`);for(let d of r??[])if(d.verb==="pick"&&d.of!==void 0)throw new Error(`list: "${t}"'s \`fill.pick\` states \`of\` \u2014 a list's pick chooses from its item's \`from\`; remove \`of\`.`);let s={type:"list",...Ue(e,d=>es(d,t)),element:ls(e,t),...e.min!==void 0?{min:e.min}:{},...e.max!==void 0?{max:e.max}:{}},a=T(n)?Nr(s.element):void 0,l=a===void 0?ds(e,t):a.length===1?a[0]:null;return lt(s,l)}function ut(e,t){if(t!==void 0&&(typeof t!="object"||t===null||Array.isArray(t)))throw new Error(`process.${e}(): takes an options object, or nothing.`);let n={kind:"process",verb:e};for(let[o,i]of Object.entries(t??{}))i!==void 0&&(n[o]=i);let r=Tt(n);if(r!==null)throw new Error(`process.${e}(): ${r}.`);return n}function us(e){return ut("cutout",e)}function fs(e){return ut("autocrop",e)}function Z(e,t){return ut(e,t)}function ps(e){return Z("probe",e)}function ms(e){return Z("understand",e)}function hs(e){return Z("preview",e)}function ys(e){return Z("ladder",e)}function gs(e){return Z("transcode",e)}function bs(e){return Z("poster",e)}function ws(e){return Z("rasterize",e)}function _s(e){return Z("fetch",e)}function ks(e){return Z("tour_details",e)}function xs(e){return ut("crop",e)}var vs={cutout:us,autocrop:fs},ft={...vs,probe:ps,understand:ms,preview:hs,ladder:ys,transcode:gs,poster:bs,rasterize:ws,fetch:_s,tour_details:ks,crop:xs};function Ss(e,t="a list"){return`${e} is sourced by ${t} \u2014 a row's slot source names a row, which it mirrors. A list's first row is a \`compute()\` over the list: \`source: compute({ reads: [list] }, (rows) => rows[0] ?? null)\`.`}function Rs(e,t){if(_(e))throw new Error(`row: "${t}" is sourced by the fact "${e.key}" \u2014 a table is a row's \`from\`, never its source: \`row({ label, from: fact.${e.key} })\` holds its first row, which the user may re-pick.`);if(M(e))return{kind:"section",section:e.section,slot:e.slot};if(R(e))return{kind:"sibling",of:e};if(L(e)||T(e))return Object.freeze({...e});throw new Error(`row: "${t}" declares a source that is no element, slot, compute or pick.`)}function Es(e,t){if(Array.isArray(e))return $s(e,t);let n=_(e)?S(e.key):null;if(n!==null)return{key:e.key,tables:[n]};let r=Y(e);if(r!==void 0){let o=`${String(j(r).from)}.${e.field}`;if(wr(o)!==null)return{key:o,tables:[]}}throw new Error(e===void 0?`row: "${t}" declares no \`from\` \u2014 a row names its fact data: a table (\`row({ label, from: fact.property.contacts })\`) or a row's list-valued member (\`from: unit.floor_plans\`).`:`row: "${t}"'s \`from\` is ${_(e)?`the fact "${e.key}", which is not a table`:"no table or list-valued member"} \u2014 a row's \`from\` is a fact table (\`fact.property.contacts\`) or a table row's list-valued member (\`unit.floor_plans\`).`)}function $s(e,t){if(e.length===0)throw new Error(`row: "${t}" declares \`from: []\` \u2014 a row names the table it is a row of.`);let n=[],r=[];for(let o of e){let i=_(o)?S(o.key):null;if(i===null)throw new Error(`row: "${t}"'s \`from\` lists ${_(o)?`the fact "${o.key}", which is not a table`:"something that is no table"} \u2014 a row's list of \`from\` names tables (\`[fact.property.contacts, \u2026]\`); a list-valued member is a row's only \`from\`.`);if(r.some(s=>s.table===i.table))throw new Error(`row: "${t}" names the ${i.table} table twice in \`from\` \u2014 each table is named once.`);n.push(o.key),r.push(i)}return{key:n.length===1?n[0]:n,tables:r}}function Os(e,t,n){let r=He(R(e)||L(e)?e:void 0);if(!(r===null||t.some(o=>r.table===o.table)))throw new Error(`row: "${n}" is \`from\` the ${t.map(o=>o.table).join(", ")} table${t.length===1?"":"s"} but its source holds a row of ${r.table} \u2014 a row's source yields a row of its own \`from\`.`)}function Vr(e){let{key:t,tables:n}=Es(e.from,e.label),r=n[0]??null;if(r===null&&!L(e.source))throw new Error(`row: "${e.label}" is \`from\` the list-valued member "${t}" but its source is no element \u2014 a row from a member holds an item of it, the element of the list over that member: \`source: entry\`.`);if(R(e.source)&&e.source.type==="list")throw new Error(Ss(`row: "${e.label}"`));let o=D(e.source,`row: "${e.label}"`);for(let a of o??[]){if(a.verb!=="pick")throw new Error(`row: "${e.label}" is filled by \`fill.${a.verb}\` \u2014 a row holds a row that exists, which only a \`fill.pick({ brief })\` out of its \`from\` yields.`);if(a.of!==void 0)throw new Error(`row: "${e.label}"'s \`fill.pick\` states \`of\` \u2014 a row's pick chooses from its \`from\`; remove \`of\`.`)}o===void 0&&e.source!==void 0&&r!==null&&Os(e.source,n,e.label);let i=Ue(e,a=>Rs(a,e.label)),s=lt({type:"row",from:t,...i},r);return xr(s,r,n.slice(1))}var As=["property","library"];function Q(e,t){if("label"in e)throw new Error("fact registry: a page head holds no `label` \u2014 the declaration states the fact's name");for(let n of["title","description"]){let r=e[n];if(typeof r=="string"&&r.trim()==="")throw new Error(`fact registry: a page declares an empty ${n}`)}return{head:e,declaration:t}}var Is=new Set(["home","item"]);function dn(e,t,n){let r=typeof t=="object"&&t!==null?n.pages.get(t):void 0;if(r!==void 0)return{kind:"home",key:`${n.home}.${r}`};if(pr(t)){let i=n.pages.get(t);if(i===void 0)throw new Error(`${e} reads a page that is not one of this registry's \u2014 a registry reads its own facts by their page's const.`);return{kind:"home",key:`${n.home}.${i}`}}let o=ve(t)?t.of:t;if(R(o)){let i=n.fields?.get(o);if(i===void 0)throw new Error(`${e} reads the declaration "${o.label??o.type}", which is not a field of the same item \u2014 a field reads its siblings by their consts, and a top-level fact by its page's const.`);return{kind:"item",field:i}}if(_(t)&&[...n.pages.values()].some(i=>t.key===`${n.home}.${i}`))return{kind:"home",key:t.key};if(_(t))throw new Error(`${e} is bound to the fact "${t.key}" \u2014 a registry declares the facts; it reads a sibling page by its const and binds none.`);if(M(t))throw new Error(`${e} reads a section's slot \u2014 a registry reads no section.`);if(L(t)&&n.picked===!0)return{kind:"element"};if(L(t))throw new Error(`${e} reads the element \u2014 a registry's list nothing picks is built by the user, so its item's fields read one another by const.`);if(Y(t)!==void 0)throw new Error(`${e} reads the member "${t.field}" of a row that is not a field of the same item.`);if(Wt(t)&&typeof t.slot=="string")return{kind:"row",slot:t.slot,field:t.field};if(typeof t=="object"&&t!==null&&Is.has(String(t.kind)))return t;throw new Error(`${e} declares a read a registry cannot answer.`)}function Ts(e,t,n){return Array.isArray(t)?t.length===1?ln(e,t[0],n):t.map(r=>ln(e,r,n)):ln(e,t,n)}function ln(e,t,n){let r=typeof t=="object"&&t!==null?n.pages.get(t):void 0,o=typeof t=="string"?t:r===void 0?void 0:`${n.home}.${r}`;if(o===void 0||!n.mediaLists.has(o))throw new Error(`${e} picks \`from\` something other than one of this registry's media lists \u2014 a media field picks from a list of media (the \`uploads\` page, a sorted list), by its const, or owns its asset.`);return o}function un(e,t,n){let r=t.reads.map(o=>dn(e,o,n));return t.requires===void 0?{kind:"compute",fn:t.fn,reads:r}:{kind:"compute",fn:t.fn,reads:r,requires:t.requires.map(o=>dn(e,o,n))}}function js(e,t){if(t.when!==void 0)throw new Error(`${e} declares \`when\` \u2014 a registry has no display variant; a page is drawn when a template reads it.`);if(t.required!==void 0)throw new Error(`${e} declares \`required\` \u2014 a fact requires nothing on its own account; what a property must answer is what its templates require.`);if(t.type==="poi")throw new Error(`${e} is a poi \u2014 a place the platform builds is no fact.`)}function Ps(e,t){let{type:n,fields:r}=t;if(n!=="object"||r===void 0)return;let o=Object.entries(r).filter(([,i])=>i.type==="row");if(o.length>0)throw new Error(`${e} holds a picked row in ${o.map(([i])=>`"${i}"`).join(", ")} \u2014 a list picking rows declares the row as its item (\`item: row({ from })\`), whose members are the row's.`)}function Cs(e){let t=new Map,n=e.fields;for(let r of[n,ie(e)??{}])for(let[o,i]of Object.entries(r))typeof i=="object"&&i!==null&&t.set(i,o);return t}function fn(e,t,n){js(e,t);let r=oe(X(t,o=>dn(e,o,n)));switch(r.from!==void 0&&(F(String(r.type))||r.type==="media")&&(r={...r,from:Ts(e,t.from,n)}),r.type){case"object":{let o={},i={...n,fields:Cs(r)};for(let[s,a]of Object.entries(r.fields))o[s]=fn(`${e}.${s}`,a,i);r={...r,fields:o};break}case"list":{let o=r.max,i={home:n.home,pages:n.pages,mediaLists:n.mediaLists},s=H(t)?.some(l=>l.verb==="pick")===!0,a=fn(`${e}[]`,r.element,s?{...i,picked:!0}:i);Ps(`${e}[]`,a),r={...r,element:a,...Vt(o)?{max:un(`${e}.max`,o,i)}:{}};break}default:break}return r}function Fs(e,t,n,r){let o=`${e}.${t}`,i=fn(o,n.declaration,r);if(i.type==="object")throw new Error(`${o} is an object \u2014 a top-level fact is a value or a list; a group of fields is a list's item.`);if(i.label===void 0)throw new Error(`${o} declares no \`label\` \u2014 a top-level fact states the name its page and its Details section show it by.`);if(n.head===null)return{head:null,declaration:i};let{title:s,description:a}=n.head;return{head:{title:typeof s=="string"?s:un(`${o}.title`,s,r),description:typeof a=="string"?a:un(`${o}.description`,a,r)},declaration:i}}var Ms=["home","pages"];function Ls(e){return"head"in e&&"declaration"in e}function Ns(e){let t=e.element;return e.type==="list"&&typeof t?.type=="string"&&(F(t.type)||t.type==="media")}function Gr(e,t){if(!As.includes(e))throw new Error(`fact registry: "${e}" is not a home`);let n=new Map,r=new Set,o={};for(let[l,d]of Object.entries(t)){if(Ms.includes(l))throw new Error(`fact registry: ${e} declares a page keyed "${l}", a registry's own key`);n.set(d,l);let m=Ls(d)?d:{head:null,declaration:d};o[l]=m,Ns(m.declaration)&&r.add(`${e}.${l}`)}let i={home:e,pages:n,mediaLists:r},s={};for(let[l,d]of Object.entries(o))s[l]=Fs(e,l,d,i);let a={home:e,pages:s};for(let l of Object.keys(t))a[l]={kind:"home",key:`${e}.${l}`};return a}var Ds=[{value:"for_sale",label:"For sale",icon:"tag",description:"List price, finance details, and a sold-ready layout."},{value:"for_rent",label:"For rent",icon:"key",description:"Monthly rent, lease terms, pets, and utilities."}],Hs=["sold","active"],Us=["total","monthly"];function qs(e){return e==null?"active":"sold"}function Ks(e){return e==="for_rent"?"monthly":"total"}var Bs=6371e3;function Ws(e,t,n,r){let o=l=>l*Math.PI/180,i=o(n-e),s=o(r-t),a=Math.sin(i/2)**2+Math.cos(o(e))*Math.cos(o(n))*Math.sin(s/2)**2;return 2*Bs*Math.asin(Math.sqrt(a))}function Vs(e,t){return e?.latitude==null||e.longitude==null||t?.latitude==null||t.longitude==null?null:Math.round(Ws(t.latitude,t.longitude,e.latitude,e.longitude))}var Yr=Gr("library",{contacts:Q({title:"Your contacts",description:"The people your listings name, with the headshots and logos they carry."},P({label:"Contacts",item:()=>{let e=$.short({label:"Name",cap:256});return Ee({label:e,fields:{headshot:J({label:"Headshot"}),name:e,title:$.short({label:"Title",cap:128}),org_name:$.short({label:"Organization",cap:256}),email:jr({label:"Email"}),phone:Pr({label:"Phone"}),website:he({label:"Website"}),address:ct({label:"Address"}),bio:$.long({label:"Bio",cap:4e3}),logo_dark:J({label:"Logo for light backgrounds",process:[ft.cutout()]}),logo_light:J({label:"Logo for dark backgrounds",process:[ft.cutout()]}),instagram:he({label:"Instagram"}),linkedin:he({label:"LinkedIn"}),x:he({label:"X"}),facebook:he({label:"Facebook"})}})}}))});Yt(Yr);var pn=Q({title:"What\u2019s the address?",description:"We\u2019ll build your map and neighborhood details from this."},ct({label:"Address"})),Xr=Q({title:"For sale or for rent?",description:"This adjusts the pricing details we ask for."},qe({label:"Listing intent",from:[...Ds]})),se=Q({title:"Add photos, docs, and links",description:"Everything you add helps fill and enrich your website."},P({label:"Uploads",item:dt()})),mn=P({label:"Media",item:dt({kinds:["image","video","tour"],from:se}),source:N.pick({brief:"Does this upload show the property? It belongs when its name or account says it is a photograph, a rendering, a video or a virtual tour of the property: its building, rooms, grounds, amenities, surroundings or views. It does not belong when its name or account says it is a floor plan or another diagram; a logo, wordmark or brand graphic; a headshot, portrait or other photograph of a person or people; a flyer, ad, business card, slide or other image that is mostly text; a screenshot; a map; or a scanned document page. When neither its name nor its account says what it is, you cannot tell. Order what belongs as a walk through the property: aerial and street views first, then the approach and entry, then the interiors room by room (living spaces, kitchen and dining, bedrooms, bathrooms), then outdoor spaces, amenities, surroundings and views, with every shot of one space together. A video or tour sits with the space it shows, and one of the whole property comes first."})}),Jr=P({label:"Floor plans",item:J({label:"Floor plan",from:se,process:[ft.cutout({enclosed:"keep"})]}),source:N.pick({brief:"Is this upload exactly one floor plan? A floor plan is a top-down view of one floor of a dwelling's rooms and walls \u2014 drawn or rendered, flat or in 3D, at any size. It belongs when its name or account says it shows one floor plan, whatever title, figures or text are printed around it. It does not belong when its name or account says it holds two or more plans, or says it is something else: a building key or locator diagram (the building's outline with one unit shaded), a site, plot, parking or driveway diagram, a standalone legend, scale bar or north arrow, a logo, a photograph, or plain text. When neither its name nor its account says what it is, or how many plans it holds, you cannot tell. Order what belongs from the lowest floor to the highest; plans of several units go in the order the units are numbered, each unit's floors together."})}),zs=P({label:"Documents",item:dt({kinds:["document","image","video"],from:se}),source:N.pick({brief:"Does this upload set out the property's specifics? It belongs when its name or account says it records its figures, finances, terms, legal record, condition or plans: an offering memorandum, brochure, listing sheet, rent roll, financials, comparables, lease, survey, site plan, plan set, disclosure or report. It does not belong when its name or account says it is a photograph, rendering, video or tour showing the property; an image of floor plans or elevations; a logo; a photograph of people; an ad, sign or announcement; a map; or notes for whoever makes the marketing. When neither its name nor its account says what it is, you cannot tell. Order what belongs as a buyer reads it: the offering memorandum, brochure or listing sheet first, then the financials, rent roll and comparables, then the leases, legal record and disclosures, then the reports, surveys and plans."})}),Gs=J({label:"Hero",from:mn,source:N.pick({brief:"Choose the single cover photo for the property's page. The cover is a wide banner above the property's address, so it must stand for the whole property at a glance. Only an image whose name or account says it is a photograph of the property can be chosen. Never choose a logo, wordmark or other brand graphic; an agent, team or company headshot; a flyer, ad, business card, slide or any image that is mostly text; a screenshot; a map; a scanned document or brochure page; or a floor plan or other diagram \u2014 nor an image whose name and account do not say what it is. Among the photographs of the property prefer, in order: a front exterior of the building; another exterior or aerial view; the widest, brightest shot of the main living space. Rank close-up details, bathrooms, utility spaces, empty rooms and anything that reads as a fragment rather than a place last: they are weaker covers, never excluded, so when they are the only photographs of the property, choose the best of them. If not one candidate is a photograph of the property, choose none: no banner beats a banner that is not the property."})}),Ys=he({label:"Website"}),Xs=`Is this floor plan labelled for this unit? Its label is read from its name and the text printed on it, never from the rooms drawn or any figures. It belongs when its label names this unit: the unit's label or a plain variant of it ("Unit 3", "#3", "Apt 3" and "Residence 3" all label "Unit 3"); a descriptor the unit's label carries in brackets, like "(PH)", may be left off. A plan labelling several units, such as a shared floor printed "Unit 1/2/3", belongs to each of them. It is excluded when it labels other units and not this one. When it labels no unit, you cannot tell. Order what belongs from the lowest floor to the highest.`,Js=`Is this photo labelled for this unit? Its label is read from its name, the text printed on it and a caption its account records, never from the rooms it shows, any figures, how much it looks like the unit or where it falls among the uploads. It belongs when its label names this unit: the unit's label or a plain variant of it ("Unit 3", "#3", "Apt 3" and "Residence 3" all label "Unit 3"); a descriptor the unit's label carries in brackets, like "(PH)", may be left off. A photo labelled for several units belongs to each of them. It is excluded when it labels other units and not this one. When it labels no unit, you cannot tell.`,Zs=[`List every dwelling the uploads present with its own specs printed \u2014 its beds, baths, square feet, asking price or rent written out for that dwelling: the home a listing describes, or each unit a building's documents name or number. A dwelling the uploads only name, picture or mark with a status, with no specs of its own, is not listed. A plan or row printed for several units ("Unit 4/6") lists each of those units, each with what is printed for it. A dwelling named in several uploads, or on several pages, is one item carrying everything they print for it. A unit-mix row standing for several unnamed units is not a dwelling; neither is a whole building, a comparable property, a market average or a portfolio total.`,"Every member is what an upload prints as text for that dwelling, and nothing else. An upload's own text, as its account quotes it (a document's or a sheet's content, an image's printed words), is what it prints; the account's description of what a drawing, a photo or a map shows (the rooms, the doors, the spaces) is never a member's source. Never count rooms; never compute, round or convert a figure; never carry one across from another dwelling, a unit-mix average or the building's totals; never add what is usual for a dwelling of its kind. A figure printed for a neighbourhood, a development or the building is never a dwelling's, and a count or fee is 0 only where the uploads print none for that dwelling. A member no upload prints for that dwelling is null, and a null is always better than a guess.",`label: the unit's own name as printed \u2014 its unit number or name ("201", "Residence 201", "4B", "Penthouse 501"), without a word marking its status ("model", "available") \u2014 and never its street address. A dwelling presented alone, with no unit name, is always labelled "Home", whatever name the uploads print for the home itself.`,"beds, baths, sqft: exactly as printed for that dwelling; a studio has one bedroom.",'price: the asking price or monthly rent as written for that dwelling, or its status word ("Sold", "Leased", "Request for Info").','floor: the floor of its building the dwelling sits on, as printed ("3", "PH", "Ground", "3 to 4"); never read off its unit number.',"hoa_monthly: the HOA, condo or strata fee printed per month for that dwelling. A fee printed for another period, or for the building, is null.",'parking: the number of parking spaces printed for that dwelling ("1 deeded space" is 1, "two-car garage" is 2). Parking printed with no count, or for the building, is null.',"lot_sqft: the lot size printed in square feet for that dwelling: a home's own lot. A lot in another unit, or the lot of a building several dwellings share, is null.",'amenities: the real selling points of that dwelling, the qualitative features a client would notice that its beds, baths, size, floor, parking and price do not already say, such as "Private roof deck", "Harbor views", "Corner exposure". Name only what an upload says about that dwelling, in a few words. Never make one up and never add one just to fill the list: a feature the whole building shares, a routine fitting or finish, a note printed on a plan (which way a door opens, extra space) or a restated size is not a selling point. Most dwellings have none to three; leave the list empty when nothing stands out.',"When the uploads present no dwelling with its own specs printed, return no items."].join(`
146
+ </script>`;function Ln(){let e={};return new Proxy(e,{get:(t,n)=>typeof n!="string"||n in e||n==="then"||n==="toJSON"?e[n]:`#${n}`})}function Nn(e){let t=new URLSearchParams;for(let[r,o]of Object.entries(e))o!=null&&o!==""&&t.set(r,o);let n=t.toString();return n===""?"":`?${n}`}var fe={catalog:"api/catalog",render:"api/render",media:e=>`api/media${Nn({fixture:e})}`,capture:(e,t)=>`api/capture/${e}${Nn({fixture:t.fixture,format:t.format,page:t.page,canvas:t.canvas})}`,live:(e,t)=>`fixtures/${encodeURIComponent(e)}/live${t==="/"?"/":`${t}/`}`,hmr:"__hmr"};var Yo=["text","number","select","image","list","poi","url","date","email","phone","address","video","tour","document","media"],Xo=[],yl=[...Yo,...Xo];var It=["id","slot","index","def","value","present","enclosing"],Ze=["image","video","tour","document"];function F(e){return Ze.includes(e)}var ke={cutout:{label:"Background removed",kinds:["image"],site:"holder",options:{enclosed:{required:!1,type:"string",values:["clear","keep"]}}},autocrop:{label:"Cropped to its subject",kinds:["image"],site:"holder",options:{brief:{required:!0,type:"string"}}},probe:{label:"Probed",kinds:["image","video","document"],site:"kind",options:{}},understand:{label:"Understood",kinds:["image","video","document","tour"],site:"kind",options:{}},preview:{label:"Preview",kinds:["image","video","document"],site:"kind",options:{}},ladder:{label:"Renditions",kinds:["image","video","document"],site:"kind",options:{}},transcode:{label:"Transcoded",kinds:["video"],site:"kind",options:{}},poster:{label:"Poster",kinds:["video","document"],site:"kind",options:{}},rasterize:{label:"Pages rasterized",kinds:["document"],site:"kind",options:{}},fetch:{label:"Link fetched",kinds:["video","tour"],site:"kind",options:{}},tour_details:{label:"Tour details",kinds:["tour"],site:"kind",options:{}},crop:{label:"Cut to its crop",kinds:["image"],site:"place",options:{}}},Un=Object.keys(ke),Jo=Un.filter(e=>ke[e].site==="holder"),gl=Un.filter(e=>ke[e].site==="kind");function Zo(e){return typeof e=="string"&&Object.hasOwn(ke,e)}function Qo(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;let{kind:t,verb:n}=e;return t==="process"&&Zo(n)?e:null}function jt(e){let t=ke[e.verb],n=Object.keys(t.options),r=n.length>0?`it takes ${n.map(o=>`\`${o}\``).join(", ")}`:"it takes none";for(let[o,i]of Object.entries(e)){if(o==="kind"||o==="verb"||i===void 0)continue;if(o==="reads")return`\`${e.verb}\` takes no \`reads\` \u2014 a process is about one asset, never the property`;let s=t.options[o];if(s===void 0){let a=o==="aspect"&&e.verb==="autocrop"?"; its aspect is the holder's `crop` \u2014 the aspect it locks, free form where it locks none":"";return`\`${e.verb}\` takes no option "${o}" \u2014 ${r}${a}`}if(s.values!==void 0){if(typeof i!="string"||!s.values.includes(i))return`\`${e.verb}\`'s \`${o}\` is one of ${s.values.map(a=>`"${a}"`).join(", ")}`;continue}if(typeof i!==s.type||typeof i=="string"&&i.trim()==="")return`\`${e.verb}\`'s \`${o}\` is a non-empty ${s.type}`}for(let[o,i]of Object.entries(t.options))if(i.required&&e[o]===void 0)return`\`${e.verb}\` requires \`${o}\``;return null}function V(e){let{type:t,kinds:n}=e;if(t==="media"){let r=Array.isArray(n)?n.filter(o=>typeof o=="string"&&F(o)):[];return r.length>0?r:Ze}return typeof t=="string"&&F(t)?[t]:[]}function Tt(e){let{kinds:t,process:n}=e;if(t!==void 0){if(e.type!=="media")return"declares `kinds` \u2014 only `media()` leaves its kind open; a kind's own builder fixes it";if(!Array.isArray(t)||t.length===0||!t.every(i=>typeof i=="string"&&F(i)))return`declares \`kinds\` ${JSON.stringify(t)} \u2014 a non-empty list of ${Ze.join(", ")}`}if(n===void 0)return null;let r=Jo.map(i=>`process.${i}()`).join(", ");if(!Array.isArray(n)||n.length===0)return`declares \`process\` ${JSON.stringify(n)} \u2014 a non-empty list of processes (${r})`;let o=new Set;for(let i of n){let s=Qo(i);if(s===null)return`processes ${JSON.stringify(i)}, which is no process (${r})`;let{verb:a}=s,l=ke[a];if(l.site==="kind")return`processes "${a}", which every ${l.kinds.join(", ")} gets from birth on its kind's row \u2014 never a holder's to declare`;if(l.site==="place")return`processes "${a}", which every ${l.kinds.join(", ")} place gets wherever its value carries a crop \u2014 never a holder's to declare`;if(o.has(a))return`processes "${a}" twice \u2014 a holder declares each process once`;o.add(a);let d=jt(s);if(d!==null)return`processes "${a}" with options that do not fit: ${d}`;let m=V(e).filter(g=>!l.kinds.includes(g));if(m.length>0)return`processes "${a}", which applies to ${l.kinds.join(", ")} and not to ${m.join(", ")}`}return null}var ei={property:{latitude:"lat",longitude:"lon"},contact:{address:"contact_address"}},ti={address:{role:"bindable",container:"property",value_type:"text",fields:{display:{value_type:"text"},street:{value_type:"text"},street_no_type:{value_type:"text"},city:{value_type:"text"},state:{value_type:"text"},postal:{value_type:"text"},unit:{value_type:"text"}}},address_street:{role:"bindable",container:"property",value_type:"text"},address_unit:{role:"bindable",container:"property",value_type:"text"},address_city:{role:"bindable",container:"property",value_type:"text"},address_state:{role:"bindable",container:"property",value_type:"text"},address_postal:{role:"bindable",container:"property",value_type:"text"},listing_intent:{role:"bindable",container:"property",value_type:"text",writeback:{kind:"property",column:"listing_intent"}},lat:{role:"bindable",container:"property",value_type:"number"},lon:{role:"bindable",container:"property",value_type:"number"}},qn={units:{role:"bindable",container:"property",value_type:"unit_list",row:{unit_id:{path:"unit_id",value_type:"text"},position:{path:"position",value_type:"number"},floor_plans:{path:"floor_plans",value_type:"image_list",row:{id:{value_type:"text"},floor_label:{value_type:"text"},position:{value_type:"number"}}},unit_label:{path:"unit_label",value_type:"text",primary:!0,writeback:{column:"unit_label"}},beds:{path:"beds",value_type:"number",primary:!0,writeback:{column:"beds"}},baths:{path:"baths",value_type:"number",primary:!0,writeback:{column:"baths"}},sqft:{path:"sqft",value_type:"number",primary:!0,writeback:{column:"sqft"}},price:{path:"price",value_type:"text",primary:!0,writeback:{column:"price"}}}},comparables:{role:"bindable",container:"property",value_type:"comparable_list",row:{id:{path:"id",value_type:"text"},address_street:{path:"address_street",value_type:"text"},address_city:{path:"address_city",value_type:"text"},address_state:{path:"address_state",value_type:"text"},address_postal:{path:"address_postal",value_type:"text"},address:{path:"address",value_type:"text"},lat:{path:"lat",value_type:"number"},lng:{path:"lng",value_type:"number"},distance_m:{path:"distance_m",value_type:"number"},status:{path:"status",value_type:"text"},price:{path:"price",value_type:"number",writeback:{column:"price"}},price_period:{path:"price_period",value_type:"text"},sale_date:{path:"sale_date",value_type:"text",writeback:{column:"sale_date"}},beds:{path:"beds",value_type:"number",writeback:{column:"beds"}},baths:{path:"baths",value_type:"number",writeback:{column:"baths"}},sqft:{path:"sqft",value_type:"number",writeback:{column:"sqft"}},photo:{path:"photo_upload_id",value_type:"image"},year_built:{path:"year_built",value_type:"number"},lot_sqft:{path:"lot_sqft",value_type:"number"},stories:{path:"stories",value_type:"number"},units:{path:"units",value_type:"number"},hoa_monthly:{path:"hoa_monthly",value_type:"number"},list_price:{path:"list_price",value_type:"number"},listed_date:{path:"listed_date",value_type:"text"},mls_number:{path:"mls_number",value_type:"text"},description:{path:"description",value_type:"text"}}},contacts:{role:"bindable",container:"property",value_type:"contact_list",row:{id:{path:"id",value_type:"text"},primary:{path:"primary",value_type:"boolean"},name:{path:"name",value_type:"text",primary:!0,writeback:{column:"name"}},title:{path:"title",value_type:"text",primary:!0,writeback:{column:"title"}},org_name:{path:"org_name",value_type:"text",primary:!0,writeback:{column:"org_name"}},bio:{path:"bio",value_type:"text",primary:!0,writeback:{column:"bio"}},address:{path:"address",value_type:"text",primary:!0},email:{path:"email",value_type:"text",primary:!0,writeback:{column:"email"}},phone:{path:"phone",value_type:"text",primary:!0,writeback:{column:"phone"}},website:{path:"website_url",value_type:"text",primary:!0,writeback:{column:"website"}},instagram:{path:"instagram_url",value_type:"text",primary:!0,writeback:{column:"socials.instagram"}},linkedin:{path:"linkedin_url",value_type:"text",primary:!0,writeback:{column:"socials.linkedin"}},x:{path:"x_url",value_type:"text",primary:!0,writeback:{column:"socials.x"}},facebook:{path:"facebook_url",value_type:"text",primary:!0,writeback:{column:"socials.facebook"}},headshot:{path:"avatar_upload_id",value_type:"image",primary:!0},logo_dark:{path:"logo_dark_upload_id",value_type:"image",primary:!0},logo_light:{path:"logo_light_upload_id",value_type:"image",primary:!0}}}},Kn={description:{role:"readable",path:"narrative.description",value_type:"text"},unit:{role:"readable",path:"units",value_type:"row",primary_of:"units"},contact:{role:"readable",path:"contacts",value_type:"row",primary_of:"contacts"}};function Dn(e){let t=qn[Kn[e].primary_of],n=ei[e]??{},r={};for(let[o,i]of Object.entries(t.row)){if(i.primary!==!0)continue;let s={role:"bindable",container:e,value_type:i.value_type};i.value_type==="image"&&(s.image=!0),i.writeback!==void 0&&(s.writeback=e==="unit"?{kind:"unit",column:i.writeback.column}:{kind:"contact",field:i.writeback.column}),r[n[o]??o]=s}return r}function ni(){return{...ti,...Dn("unit"),...qn,...Dn("contact"),...Kn}}var Fe=ni();var Qe={units:{idKey:"unit_id",ownership:"property"},contacts:{idKey:"id",cap:12,min:1,ownership:"library"},comparables:{idKey:"id",ownership:"property"}},ri={units:"property.units",contacts:"property.contacts",comparables:"property.comparables",commercial_spaces:"property.commercial_spaces"},Pt={contacts:"library.contacts"};function Bn(e){return Object.hasOwn(Qe,e)}var Hn=Object.fromEntries([...Object.entries(ri),...Object.entries(Pt)].map(([e,t])=>[t,e]));function S(e){if(typeof e!="string")return null;if(Object.hasOwn(Qe,e))return{table:e,reading:"legacy"};let t=Object.hasOwn(Hn,e)?Hn[e]:void 0;return t===void 0?null:{table:t,reading:"registry"}}var oi={matterport:{kind:"tour",label:"Matterport",pattern:/(^|\.)matterport\.com$/i,strategy:"api"},biganto:{kind:"tour",label:"Biganto",pattern:/(^|\.)biganto\.com$/i,strategy:"opengraph"},iguide:{kind:"tour",label:"iGUIDE",pattern:/(^|\.)youriguide\.com$/i,strategy:"opengraph"},kuula:{kind:"tour",label:"Kuula",pattern:/(^|\.)kuula\.co$/i,strategy:"opengraph"},momento360:{kind:"tour",label:"Momento360",pattern:/(^|\.)momento360\.com$/i,strategy:"opengraph"},cloudpano:{kind:"tour",label:"CloudPano",pattern:/(^|\.)cloudpano\.com$/i,strategy:"none"},asteroom:{kind:"tour",label:"Asteroom",pattern:/(^|\.)asteroom\.com$/i,strategy:"none"},zillow3d:{kind:"tour",label:"Zillow 3D Home",pattern:/(^|\.)zillow\.com$/i,path:/^\/view-3d-home\//i,strategy:"none"},youtube:{kind:"video",label:"YouTube",pattern:/(^|\.)(youtube\.com|youtu\.be)$/i,strategy:"oembed"},vimeo:{kind:"video",label:"Vimeo",pattern:/(^|\.)vimeo\.com$/i,strategy:"oembed"},zillow:{kind:"listing",label:"Zillow",pattern:/(^|\.)zillow\.com$/i,strategy:"none"},redfin:{kind:"listing",label:"Redfin",pattern:/(^|\.)redfin\.com$/i,strategy:"none"},dropbox:{kind:"file",label:"Dropbox",pattern:/(^|\.)dropbox\.com$/i,strategy:"none"},drive:{kind:"file",label:"Google Drive",pattern:/^drive\.google\.com$/i,strategy:"none"},maps:{kind:"map",label:"Google Maps",pattern:/(^|\.)google\.com$/i,path:/^\/maps(\/|$)/i,strategy:"none"}};function Wn(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!=="http:"&&t.protocol!=="https:")return null;for(let[n,r]of Object.entries(oi))if(r.pattern.test(t.hostname)&&!(r.path&&!r.path.test(t.pathname)))return n;return null}var ii="badge=0&autopause=0&player_id=0&title=0&byline=0&portrait=0&sidedock=0&vimeo_logo=0&pip=0&chromecast=0&quality_selector=0&progress_bar=1";function Vn(e){let t=e.trim();if(!t)return null;let n=Wn(t);if(n==="vimeo"){let r=t.match(/vimeo\.com\/(?:.*\/)?(\d+)/);return r?`https://player.vimeo.com/video/${r[1]}?${ii}`:null}if(n==="youtube"){let r=t.match(/youtu\.be\/([A-Za-z0-9_-]{11})/)??t.match(/[?&]v=([A-Za-z0-9_-]{11})/)??t.match(/youtube\.com\/(?:embed|shorts)\/([A-Za-z0-9_-]{11})/);return r?`https://www.youtube.com/embed/${r[1]}?rel=0`:null}return null}function zn(e){let t=e.trim();if(!t)return null;let n=Wn(t);if(n==="matterport"){let r=new URL(t).searchParams.get("m");return r!==null&&/^[A-Za-z0-9]+$/.test(r)?`https://my.matterport.com/show/?m=${r}&nt=1`:null}return n!==null&&si.has(n)?t:null}var si=new Set(["biganto","iguide","kuula","momento360","cloudpano","asteroom","zillow3d"]);var ai=["crop","cutout","mask_white","mask_black"];function Ft(e){return e!==null&&!(e.x<=0&&e.y<=0&&e.width>=1&&e.height>=1)}function li(e){return e.url!==null?e.url.replace(/^[a-z][a-z0-9+.-]*:\/\//i,""):e.key?.split("/").pop()??e.id}function Mt(e,t){let{id:n,renditions:r,...o}=e,i=e.kind==="image";return{...o,id:t.id,file:t.file,crop:i?t.crop:null,name:t.name!==null&&t.name!==""?t.name:li(e),renditions:{...r,crop:i?t.renditions.crop:null,cutout:i?t.renditions.cutout:null,mask_white:i?t.renditions.mask_white:null,mask_black:i?t.renditions.mask_black:null}}}function Gn(e){return e.url===null?"upload":"link"}function z(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Yn(e){if(!z(e))return!1;let{id:t,kind:n,renditions:r}=e;return typeof t=="string"&&typeof n=="string"&&F(n)&&z(r)}function Xn(e){return z(e)&&typeof e.id=="string"&&typeof e.file=="string"&&z(e.renditions)&&!("kind"in e)}function ci(e){return z(e)&&typeof e.file=="string"&&"picked"in e&&z(e.renditions)&&!("id"in e)}function et(e){return z(e)&&typeof e.media=="string"&&e.media!==""}function di(e){let t=e.asset_id;return typeof t=="string"&&t!==""?t:void 0}function _e(e){if(z(e))return et(e)?e.media:Xn(e)||Yn(e)?e.id:ci(e)?e.picked??e.file:di(e)}function Ct(e,t){if(Array.isArray(e))for(let n of e)Ct(n,t);else if(Xn(e))t.has(e.id)||t.set(e.id,e);else if(z(e)&&!Yn(e))for(let n of Object.values(e))Ct(n,t)}function tt(e){let t=new Map;for(let[n,r]of Object.entries(e))n!=="files"&&Ct(r,t);return t}function ui(e,t){return Object.hasOwn(e.files,t)?e.files[t]:void 0}function fi(e,t){let n=ui(t,e.file);return n===void 0?null:Mt(n,e)}function Jn(e){let t={};for(let[n,r]of tt(e)){let o=fi(r,e);o!==null&&(t[n]=o)}return t}function pi(e){return Object.hasOwn(e,"crop")||e.renditions!==void 0}function mi(e,t){let n=Object.hasOwn(t,"crop"),r=t.renditions??{},o=n?null:e.renditions,i=Object.fromEntries(ai.map(s=>[s,Object.hasOwn(r,s)?r[s]??null:o?.[s]??null]));return{crop:n?t.crop??null:e.crop,renditions:i}}function Lt(e,t){return pi(t)?{...e,...mi({crop:e.crop,renditions:e.renditions},t)}:e}var Me="property.uploads";function Zn(e){if(typeof e=="string"&&e!=="")return[e];if(!(!Array.isArray(e)||e.length===0||!e.every(t=>typeof t=="string"&&t!=="")))return[...e]}function Nt(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function hi(e){if(_e(e)!==void 0||!Nt(e))return e;for(let t of Object.values(e))if(_e(t)!==void 0)return t}function Dt(e,t){let[n,...r]=t.split(".");if(n!=="property"||r.length===0)return null;let o=e;for(let i of r)if(o=Array.isArray(o)?o.find(s=>Nt(s)&&s.id===i):Nt(o)&&Object.hasOwn(o,i)?o[i]:void 0,o===void 0)return null;return Array.isArray(o)?o.flatMap(i=>{let s=hi(i),a=_e(s);return a===void 0?[]:[{id:a,value:s}]}):null}function Qn(e,t){return Dt(e,t)?.map(({id:n})=>n)??null}function yi(e,t){let n=tt(e),r=new Set,o=[];for(let i of Zn(t.from)??[])for(let{id:s,value:a}of Dt(e,i)??[]){if(r.has(s))continue;let l=n.get(s),d=l===void 0||!Object.hasOwn(e.files,l.file)?void 0:e.files[l.file];if(l===void 0||d===void 0||!t.kinds.includes(d.kind))continue;r.add(s);let m=et(a)?Lt(l,a):l;o.push({id:s,value:m,file:d,list:i})}return o}function gi(e,t){return yi(e,t).map(({value:n,file:r,list:o})=>({asset:Mt(r,n),list:o}))}function re(e,t){return gi(e,t).map(({asset:n})=>n)}var w=class extends Error{constructor(n,r){super(r);this.status=n}status};function bi(e){return e.split("-").map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}function er(e){let{variant:t}=e;return{required:e.required,variant:t===null?null:{cases:t.cases.map(n=>({value:n,label:bi(n)})),locked:t.locked}}}function tr(e){return Object.fromEntries(e.map(t=>[t.instance_id,{enabled:t.enabled,...t.variant===void 0?{}:{variant:t.variant}}]))}function nr(e){if(e==null)return{};if(typeof e!="object"||Array.isArray(e))throw new w(400,"A render request's display is an object keyed by instance id.");let t={};for(let[n,r]of Object.entries(e)){if(typeof r!="object"||r===null||Array.isArray(r))throw new w(400,`The display state of "${n}" is not an object.`);let{enabled:o,variant:i}=r;if(o!==void 0&&typeof o!="boolean")throw new w(400,`The display state of "${n}" has a non-boolean enabled.`);if(i!==void 0&&typeof i!="string")throw new w(400,`The display state of "${n}" has a non-string variant.`);t[n]={...o===void 0?{}:{enabled:o},...i===void 0?{}:{variant:i}}}return t}function rr(e,t){for(let[n,r]of Object.entries(t)){let o=e.instances.find(s=>s.instanceId===n);if(o===void 0)throw new w(400,`The composition places no instance "${n}".`);if(r.enabled===!1&&o.display.required)throw new w(400,`Section instance "${n}" is required and cannot be hidden.`);if(r.variant===void 0)continue;let i=o.display.variant;if(i===null)throw new w(400,`Section instance "${n}" declares no display variant.`);if(i.locked)throw new w(400,`Section instance "${n}" declares a locked variant, which the user cannot switch.`);if(!i.cases.includes(r.variant))throw new w(400,`"${r.variant}" is not a declared case of section instance "${n}" (declared: ${i.cases.join(", ")}).`)}}function or(e,t){return new Map(e.instances.map(n=>[n.instance_id,t[n.instance_id]?.enabled??n.enabled]))}function ir(e,t,n){let r=n[e.instance_id]?.variant;if(r===void 0||r===e.variant)return e;let o={...e.slots};for(let[i,s]of Object.entries(t))i in o||(s.variant===void 0||s.variant.cases.includes(r))&&(o[i]=s.type==="list"?[]:null);return{...e,variant:r,slots:o}}function wi(e){return typeof e=="string"&&e!==""?e:null}function ki(e){return{listingIntent:wi(e.listing_intent),units:e.units.length,photos:re(e,{kinds:["image"],from:["property.property_media"]}).length}}function _i(e){let t=JSON.stringify(e),n=3735928559,r=1103547991;for(let o=0;o<t.length;o++){let i=t.charCodeAt(o);n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677)}return n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(16).padStart(14,"0")}function sr(e){return{id:e.id,label:e.label,summary:ki(e.facts),doc:_i(e.instances),display:tr(e.instances)}}function ar(e,t){let n=e.replace(/\/+$/,"");return t==="/"?`${n}/`:`${n}${t}/`}function lr(e){let{pages:t,currentPageId:n,basePath:r}=e,o=t.find(a=>a.id===n);if(!o)throw new Error(`nav: page "${n}" is not one of the declared pages (${t.map(a=>a.id).join(", ")}).`);let i=[o,...t.filter(a=>a.id!==o.id&&a.enabled!==!1)],s={};for(let a of i)for(let l of a.sections)l.enabled===!1||l.key in s||(s[l.key]=a.id===o.id?`#${l.anchor}`:`${ar(r,a.path)}#${l.anchor}`);return{anchors:s,pages:t.filter(a=>a.enabled!==!1).map(a=>({id:a.id,label:a.label,href:ar(r,a.path),current:a.id===o.id}))}}function nt(e,t){return e.pages?.[t]?.enabled!==!1}function Ht(e,t){return t.filter(n=>nt(e,n.id))}var Le={base:"stylesheets/base.css",template:"stylesheets/template.css"},G={frame:"__capture/frame",print:"__capture/print"};function cr(e){return new URLSearchParams(e).toString()}function Ut(e,t,n){return`${G.frame}?${cr({fixture:e,page:t,format:n})}`}function dr(e,t){return`${G.print}?${cr({fixture:e,format:t})}`}var qt=Symbol.for("@homepages/concrete:row:of"),Kt=Symbol.for("@homepages/concrete:element:of");function xe(e){return typeof e=="object"&&e!==null&&e.kind==="sibling"&&R(e.of)}function xi(e,t){return e===t||k(e)&&k(t)&&e.key===t.key}function rt(e,t){let n=[...e];for(let r of t??[])n.some(o=>xi(o,r))||n.push(r);return n}function M(e){return typeof e=="object"&&e!==null&&"section"in e&&typeof e.section=="string"&&"slot"in e&&typeof e.slot=="string"}function Bt(e){return typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="row"&&"field"in e&&typeof e.field=="string"}function Y(e){if(!Bt(e))return;let t=e[qt];return typeof t=="object"&&t!==null?t:void 0}function L(e){return typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="element"}function ur(e){if(!L(e))return;let t=e[Kt];return typeof t=="object"&&t!==null?t:void 0}function k(e){return typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="home"&&"key"in e&&typeof e.key=="string"}function fr(e){return typeof e=="object"&&e!==null&&"head"in e&&typeof e.head=="object"&&"declaration"in e&&R(e.declaration)}function R(e){return typeof e=="object"&&e!==null&&"type"in e&&typeof e.type=="string"}function ot(e,t){if(typeof e=="function")return{kind:"compute",fn:e,reads:[]};let n=t;if(e.requires===void 0)return{kind:"compute",fn:n,reads:[...e.reads]};if(!Array.isArray(e.requires)||e.requires.length===0)throw new Error("compute(): `requires` names at least one read \u2014 omit it when the value needs none.");return{kind:"compute",fn:n,reads:rt(e.reads,e.requires),requires:[...e.requires]}}function j(e){return typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="compute"&&"fn"in e&&typeof e.fn=="function"}function Wt(e){return typeof e=="object"&&e!==null&&e.kind==="compute"&&typeof e.fn=="function"}var vi="written-without-pick-none",Si={write:new Set(["brief","reads","requires","none"]),pick:new Set(["brief","reads","requires","unique"]),find:new Set(["brief","reads","requires","none"])};function Vt(e,t){let n=`fill.${e}()`;if(typeof t.brief!="string"||t.brief.trim()==="")throw new Error(`${n}: \`brief\` is required \u2014 it is the whole instruction the model is given.`);let r=Si[e],o={kind:"fill",verb:e};for(let[s,a]of Object.entries(t)){if(!r.has(s)){let l=s==="none"&&e==="pick"?` A pick judges every candidate, so selecting none is already an outcome its brief steers \u2014 \`concrete upgrade\` drops \`none\` from every \`fill.pick\` (the \`${vi}\` codemod).`:s==="count"?" A fill takes no count: the list's own `min` and `max` bound how many items it fills.":s==="cap"?" A write's budget is its holder's `cap` \u2014 a text slot's own, or a list's `item: text.short({ cap })`.":s==="of"&&e==="find"?" A find names no candidates: the platform's lookup for its holder's kind supplies the value.":s==="of"&&e==="pick"?" A pick chooses from its holder's candidates \u2014 a select's values, a media slot's `from` list of its kinds, a row's table, a list's item's.":s==="of"?" The kind a write produces is its holder's \u2014 a text slot's own, a list's `item`, a label's text slot.":"";throw new Error(`${n}: "${s}" is not an option \u2014 it takes ${[...r].map(d=>`\`${d}\``).join(", ")}, and everything the model should know goes in the brief.${l}`)}if(s==="none"&&a!==void 0&&a!==!0)throw new Error(`${n}: \`none\` is \`true\` or absent \u2014 it admits the empty answer, and the brief's last sentence says when nothing is right.`);if(s==="unique"&&a!==void 0&&typeof a!="boolean")throw new Error(`${n}: \`unique\` is a boolean \u2014 \`false\` lets a pick repeat an element.`);if(s==="requires"&&a!==void 0&&(!Array.isArray(a)||a.length===0))throw new Error(`${n}: \`requires\` names at least one read \u2014 omit it when the fill needs none.`);a!==void 0&&(o[s]=s==="reads"||s==="requires"?[...a]:a)}let i=o.requires;return i!==void 0&&(o.reads=rt(o.reads??[],i)),o}function Ri(e){return Vt("write",e)}function Ei(e){return Vt("pick",e)}function $i(e){return Vt("find",e)}var N={write:Ri,pick:Ei,find:$i};function D(e,t){if(K(e))return[e];if(!Array.isArray(e)||!e.every(o=>typeof o=="object"&&o!==null))return;if(e.length===0)throw new Error(`${t} declares \`source: []\` \u2014 a list of fills names at least one fill, and a holder nothing fills declares no \`source\`.`);let n=e.filter(o=>!K(o)).length;if(n===0)return e;let r=n<e.length?"a derivation beside a fill":n>1?"several derivations":"a derivation in a list";throw new Error(`${t}'s \`source\` lists ${r} \u2014 \`source\` takes one derivation (a fact, a slot, a row's member, the element, a \`compute()\`) or an ordered list of fills: a holder has one write path, and a derived value has no writer beside it.`)}function pe(e){return K(e)||Array.isArray(e)&&e.length>0&&e.every(K)}function K(e){return typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="fill"&&"verb"in e&&(e.verb==="write"||e.verb==="pick"||e.verb==="find")&&"brief"in e&&typeof e.brief=="string"}var it=Symbol.for("@homepages/concrete:fill:declaration");function pr(e){return pe(e)?{[it]:K(e)?[e]:[...e]}:{}}function H(e){if(!(typeof e!="object"||e===null))return e[it]}var mr=["Basement","Ground","1st floor","2nd floor","3rd floor","4th floor","Penthouse"];var Oi=["street","unit","city","state","postal"],hr=[...Oi,"latitude","longitude"];function zt(e){return hr.includes(e)}var yr=new Map;function Gt(e){yr.set(e.home,e)}function Ai(e){let t=yr.get(e);if(t===void 0)throw new Error(`fact registry: the ${e} registry is not declared yet \u2014 import @homepages/template-contracts/fact-registry (or ./fact-keys, ./table-members) before reading it.`);return t}var gr=new Set(["text","select","email","phone","url","date"]);function ve(e){switch(e.type){case"number":case"image":case"address":return e.type;case"list":return Ii(e.element);default:return gr.has(e.type)?"text":null}}function Ii(e){return e.type==="object"?"row_list":e.type==="image"?"image_list":e.type==="number"?"number_list":gr.has(e.type)?"text_list":null}function ji(e){return Object.hasOwn(Pt,e)?"library":"property"}function Ti(e,t){let n=e.pages[t],r=n?.declaration.type==="list"?n.declaration.element:void 0;if(r?.type!=="object")throw new Error(`fact registry: the ${e.home} registry declares no list of objects "${t}"`);return r.fields}function me(e){return Ti(Ai(ji(e)),e)}function Se(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function br(e){if(typeof e!="string")return null;let t=e.lastIndexOf(".");if(t<=0)return null;let n=S(e.slice(0,t));if(n?.reading!=="registry")return null;let r=e.slice(t+1),o=Se(me(n.table),r);return o!==void 0&&ve(o)==="row_list"?{table:n,member:r}:null}var st=["type","label","from","source","locked","when"],Yt=new Set(st),at=Symbol.for("@homepages/concrete:table-of");function lt(e,t){return Object.defineProperty(e,at,{value:t,enumerable:!1})}function De(e){if(typeof e!="object"||e===null)return null;let t=e[at];return typeof t=="object"&&t!==null?t:null}function Pi(e){if(e.reading==="registry")return Object.keys(me(e.table));let t=Fe[e.table].row;return Object.keys(t).filter(n=>n!==Qe[e.table].idKey&&!Yt.has(n))}function Ne(e,t){return Object.freeze({kind:"row",field:t,[qt]:e})}function Ci(e,t){return new Proxy(Ne(e,t),{get(n,r,o){return typeof r=="string"&&!(r in n)&&zt(r)?Ne(e,`${t}.${r}`):Reflect.get(n,r,o)}})}var kr=Symbol.for("@homepages/concrete:row:definition");function T(e){let t=e[kr];return typeof t=="object"&&t!==null?t:e}function Fi(e,t){if(e.reading==="legacy")return!1;let n=Se(me(e.table),t);return n!==void 0&&ve(n)==="address"}function wr(e,t){if(e.reading==="legacy"){let r=Fe[e.table].row;return Object.hasOwn(r,t)?String(r[t].value_type):void 0}let n=Se(me(e.table),t);return n===void 0?void 0:String(ve(n)??"")}var Mi=new Set(["then","toJSON","$$typeof","asymmetricMatch","nodeType","tagName","@@iterator"]);function _r(e,t,n=[]){let r=t===null?null:new Set(Pi(t)),o=new Proxy(e,{get(i,s,a){if(s===kr)return i;if(typeof s!="string")return Reflect.get(i,s,a);if(t!==null&&r!==null){let l=[t,...n],d=l.map(g=>g===t?r.has(s)?wr(t,s):void 0:wr(g,s));if(d.every(g=>g===void 0))return Reflect.get(i,s,a);let m=d.findIndex(g=>g===void 0||g!==d[0]);if(m===-1)return Fi(t,s)?Ci(o,s):Ne(o,s);if(s in i||Yt.has(s))return Reflect.get(i,s,a);throw new Error(`row: "${String(i.label)}" reads the member "${s}", which its \`from\` table ${l[m].table} ${d[m]===void 0?"lacks":"holds at another kind"} \u2014 every table a row names carries every member its readers read, at one kind.`)}return s in i||Yt.has(s)?Reflect.get(i,s,a):Mi.has(s)?void 0:Ne(o,s)}});return o}function xr(e){let t=new Proxy(e,{get(n,r,o){return typeof r=="string"&&!(r in n)&&zt(r)?Ne(t,r):Reflect.get(n,r,o)}});return t}function vr(e,t){let n=e.map(t);return n.some((r,o)=>r!==e[o])?n:void 0}function Sr(e,t){let n=e.reads===void 0?void 0:vr(e.reads,t),r=e.requires===void 0?void 0:vr(e.requires,t);return n===void 0&&r===void 0?e:{...e,...n===void 0?{}:{reads:n},...r===void 0?{}:{requires:r}}}function X(e,t){let n=T(e),r,o=n.source;if(o!==void 0)if(j(o)){let s=Sr(o,t);s!==o&&(r={...n,source:s})}else{let s=t(o);s!==o&&(r={...n,source:s})}let i=H(n);if(i!==void 0){let s=!1,a=i.map(l=>{let d=Sr(l,t);return d!==l&&(s=!0),d});s&&(r={...r??n,[it]:a})}return r??n}function Rr(e){return t=>{let n=Y(t);if(n===void 0)return t;let r=e.get(n);return r===void 0?t:{kind:"row",slot:r,field:t.field}}}var Er=new Set(["row","address"]);function $r(e){let t=new Map;for(let[n,r]of Object.entries(e))typeof r=="object"&&r!==null&&Er.has(r.type)&&t.set(r,n);return t}function Or(e,t,n){let r=[e.source];X(e,o=>(r.push(o),o));for(let[o,i]of t)if(!(o===e||i===n))for(let s of st){let a=o[s];if(a!==void 0&&r.includes(a))return`${i}.${s}`}}function Ar(e){let t=e.slice(e.indexOf(".")+1);return`reads \`${e}\`, which is the row's own \`${t}\`, not a member \u2014 a row's ${st.map(n=>`\`${n}\``).join(", ")} are its slot definition's, and its table has no member named \`${t}\`.`}function oe(e){return Er.has(e.type)?{...T(e)}:e}var Li={"property.listing_intent":"listing_intent","property.description":"description","property.address":"address","property.address.street":"address_street","property.address.unit":"address_unit","property.address.city":"address_city","property.address.state":"address_state","property.address.postal":"address_postal","property.address.latitude":"lat","property.address.longitude":"lon"};function Ir(e){let t=Li;if(Object.hasOwn(t,e))return t[e];let n=S(e)?.table;return n!==void 0&&Bn(n)?n:e}function Jt(e,t){for(let n of D(t,e)??[])if(!(n.verb!=="pick"||n.of===void 0))throw new Error(`${e}'s \`fill.pick\` states \`of\` \u2014 a pick chooses from its holder's \`from\`; remove \`of\` and name the candidates in \`from\`.`)}function Ni(e){return M(e)?{kind:"section",section:e.section,slot:e.slot}:R(e)?{kind:"sibling",of:e}:k(e)?{kind:"home",key:e.key}:e}function U(e){return He(e,Ni)}function Di(e,t,n){if(!(t!==!0||n===void 0)){if(j(n)){if(n.requires!==void 0&&n.requires.length>0)return;throw new Error(`${e} is \`required\` and sourced by a \`compute()\` naming no \`requires\` \u2014 nothing to require. Name the reads the value cannot do without: \`compute({ reads, requires: [fact.property.address] }, \u2026)\`.`)}if(M(n)||R(n)||xe(n))throw new Error(`${e} is \`required\` and mirrors another slot \u2014 a mirror requires its upstream; mark that slot \`required\` instead.`)}}function He(e,t){let n=e.source;Di(e.label??"a slot",e.required,n);let r=n!==void 0&&D(n,e.label??"a slot")===void 0;return{...e.locked===!0?{locked:!0}:{},...e.required===!0?{required:!0}:{},...r?{source:t(n)}:{},...pr(n),...e.label!==void 0?{label:e.label}:{},...e.placeholder!==void 0?{placeholder:e.placeholder}:{},...e.when!==void 0?{when:e.when}:{}}}function Xt(e){return t=>({type:"text",size:e,...U(t),...t.cap!==void 0?{cap:t.cap}:{}})}var $={short:Xt("short"),medium:Xt("medium"),long:Xt("long")};function E(e){return{type:"number",...U(e),...e.thousandsSep!==void 0?{thousandsSep:e.thousandsSep}:{},...e.decimals!==void 0?{decimals:e.decimals}:{},...e.maxDigits!==void 0?{maxDigits:e.maxDigits}:{}}}function Hi(e){let t=e.source;return{type:"select",...U(e),...k(t)?{options:{source:Ir(t.key)}}:{},...e.creatable!==void 0?{creatable:e.creatable}:{}}}function Ui(e){if(k(e.source))throw new Error(`select: "${e.label}" declares both \`from\` and a fact \`source\` \u2014 a select takes exactly one set of choices.`);return Jt(`select: "${e.label}"`,e.source),{type:"select",...U(e),values:[...e.from],...e.creatable!==void 0?{creatable:e.creatable}:{}}}function qi(e,t){if(K(t.source)&&t.source.verb!=="pick")throw new Error(`select: a display entry is filled by \`fill.pick\` \u2014 the model picks one of its cases \u2014 never \`fill.${t.source.verb}\`.`);return Jt("select: a display entry",t.source),{cases:[...e],...t.locked===!0?{locked:!0}:{},...t.source!==void 0?{source:t.source}:{}}}function Ki(e){if(Array.isArray(e))throw new Error("select: takes one options object \u2014 write the choices as `from`: `select({ from: [...], \u2026 })`.");if(e.options!==void 0)throw new Error("select: declares `options` \u2014 a select names its choices in `from`: `select({ from: [...], \u2026 })`.");return e.label===void 0&&Array.isArray(e.from)?qi(e.from,e):e.from!==void 0?Ui(e):Hi(e)}var Ue=Ki;function he(e){return{type:"url",...U(e),...e.accepts!==void 0?{accepts:e.accepts}:{}}}function Zt(e){return{type:"date",...U(e)}}function jr(e){return{type:"email",...U(e)}}function Tr(e){return{type:"phone",...U(e)}}function ct(e={}){return xr({type:"address",...U(e)})}function Pr(e,t){let n=`${e}: "${t.label??e}"`;if(Jt(n,t.source),"category"in t)throw new Error(`${n} declares \`category\` \u2014 a media declaration names the list it picks from in \`from\` (\`from: fact.property.property_media\`, \`fact.property.floor_plans\`, \`fact.property.uploads\`), or owns its asset without one.`);if("sources"in t)throw new Error(`${n} declares \`sources\` \u2014 a media slot takes a pasted link wherever a link provider claims its kind (a video, a tour), and declares nothing for it. \`concrete upgrade\` removes it.`);let r=Tt({type:e,kinds:t.kinds,process:t.process});if(r!==null)throw new Error(`${n} ${r}.`);let o=D(t.source,n),i=t.source!==void 0&&o===void 0&&!j(t.source);if(i&&t.from!==void 0)throw new Error(`${n} picks \`from\` a media list and declares a \`source\` \u2014 a slot bound to a fact holds what that fact holds.`);if((i||j(t.source))&&t.process!==void 0)throw new Error(`${n} declares \`process\` beside a \`source\` that derives its value \u2014 a derived slot holds what it derives from, processed where that is declared.`);if(o?.some(l=>l.verb==="pick")===!0&&t.from===void 0)throw new Error(`${n} is picked by a \`fill.pick\` and names no \`from\` \u2014 a pick chooses from its holder's \`from\` (\`from: fact.property.property_media\`); a media declaration without one owns its asset.`);let a=Bi(n,e,t.kinds,t.from)?.map(l=>k(l)?l.key:l);return{...a!==void 0?{from:a.length===1?a[0]:a}:{},...t.process!==void 0?{process:t.process.map(l=>({...l}))}:{}}}function Bi(e,t,n,r){if(r===void 0)return;let o=Array.isArray(r)?r:[r];if(o.length===0)throw new Error(`${e} declares \`from: []\` \u2014 name the media list it picks from, or omit \`from\` and the declaration owns its asset.`);let i=V({type:t,kinds:n}),s=new Set;for(let a of o){let l=typeof a=="object"&&a!==null&&!k(a),d=k(a)?a.key:l&&"declaration"in a?a.declaration:a;if(s.has(d))throw new Error(`${e} picks \`from\` one media list twice \u2014 each list is named once; an asset two lists hold is one candidate, attributed to the first.`);if(s.add(d),!l)continue;let m=V(d.element);if(m.length>0&&!i.some(g=>m.includes(g)))throw new Error(`${e} picks \`from\` a list of ${m.join(", ")}, whose items can never be ${i.join(" or ")} \u2014 each list it picks from holds items of its kinds.`)}return o}function J(e={}){return{type:"image",...U(e),...e.crop!==void 0?{crop:e.crop}:{},...Pr("image",e)}}function dt(e={}){return{type:"media",...U(e),...e.kinds!==void 0?{kinds:[...e.kinds]}:{},...Pr("media",e)}}var en=Symbol.for("@homepages/concrete:object:declared-fields");function ie(e){return e[en]}function tn(e,t){let n=ie(t);return n!==void 0&&Object.defineProperty(e,en,{value:n,enumerable:!1}),e}var Cr="a label is a source, as a text slot takes one",Qt="`label: text.short({ cap: 60, source: fill.write({ reads, brief }) })`",Wi=new Set(["type","size","cap","locked"]);function Vi(e,t,n){if(typeof t=="string")throw new Error(`${e} declares the label ${JSON.stringify(t)} \u2014 ${Cr}: write \`label: compute(() => ${JSON.stringify(t)})\`.`);if(R(t)){let r=Object.entries(n).find(([,o])=>o===t);if(r===void 0)return zi(e,t);if(t.type!=="text"&&t.type!=="address")throw new Error(`${e} label names its field "${r[0]}", a "${t.type}" \u2014 a label names a text or an address field.`);return{field:r[0]}}if(pe(t)){let r=K(t)?`\`fill.${t.verb}\``:"list of fills";throw new Error(`${e} label is a bare ${r} \u2014 the label is the fill's holder, so it states the kind the fill writes: ${Qt}.`)}return $.short({locked:!0,source:t})}function zi(e,t){let n=H(t);if(n===void 0||n.some(s=>s.verb!=="write")||t.type!=="text")throw new Error(`${e} declares a slot as its label that is none of its fields \u2014 ${Cr}: write what that slot read as the label (\`label: comp.address.street\`, \`label: compute(() => "Listing agent")\`), a written label as ${Qt}; a title the user edits is a field, which the label names by its const.`);let r=Object.keys(t).filter(s=>!Wi.has(s));if(r.length>0)throw new Error(`${e} label is a written text slot declaring ${r.map(s=>`\`${s}\``).join(", ")} \u2014 a label states only its kind and cap: ${Qt}; a title the user edits is a field, which the label names by its const.`);let{size:o,cap:i}=t;return $[o]({locked:!0,source:n.length===1?n[0]:n,...i!==void 0?{cap:i}:{}})}function Gi(e){let{type:t,element:n}=e;if(t==="object")return"an object \u2014 an object never holds another; flatten its fields into this one";if(t==="list"&&n?.type==="object")return Yi(e);if(t==="list"&&n?.type==="row")return"a list of rows \u2014 declare the selection at the top level instead"}var qe="declare the list at the top level instead";function Yi(e){let t=H(e);if(t!==void 0&&t.some(o=>o.verb!=="pick")||t===void 0&&pe(e.source))return`a list of objects declaring a fill other than a pick \u2014 no fill but a pick writes a list inside an object; ${qe}`;let n=e.source;if(k(n))return`a list of objects sourced by the fact "${n.key}" \u2014 its items carry their own minted ids, so it lists a row's member, a \`compute()\` or authored items; ${qe}`;if(M(n)||xe(n)||R(n))return`a list of objects sourced by another list slot \u2014 its items carry their own minted ids, so it lists a row's member, a \`compute()\` or authored items; ${qe}`;let r=e.element.fields;for(let[o,i]of Object.entries(r)){let s=Xi(i,r);if(s!==void 0)return`a list of objects whose item field "${o}" is ${s}`}}function Xi(e,t){if(e.type==="list"&&e.element?.type==="object")return"a list of objects \u2014 a list of objects nests one level; flatten the inner list's fields into this item or declare it beside the outer list";if(H(e)!==void 0)return`filled \u2014 no fill writes into a list inside an object; ${qe}`;let n=e.source;if(n===void 0)return;if(j(n))return`a \`compute()\` \u2014 an item of a list inside an object reads its element, or a row \`from\` its member; ${qe}`;let{kind:r,slot:o}=n;if(r==="element"&&e.type==="row"&&S(e.from)!==null)return"a table's row holding the element \u2014 the element of a list inside an object is a member's item: hold it in a row `from` that member (`row({ label, from: unit.floor_plans, source: entry })`)";if(r!=="element"&&!(e.type!=="row"&&r==="row"&&typeof o=="string"&&t[o]?.type==="row"))return"bound to something outside its item \u2014 an item of a list inside an object reads its element, a row `from` its member, or a row beside it"}function Re(e){let t="object";if(e.source!==void 0)throw new Error(`${t} declares \`source\`, but an object is a pure container with no value of its own \u2014 declare it on the field that holds the value.`);if(Object.hasOwn(e.fields,"label")&&e.fields.label!==e.label)throw new Error(`${t} declares a field keyed "label" \u2014 the key is reserved for the object's label: write its source as \`label\`, beside \`fields\`.`);let n=It.find(m=>Object.hasOwn(e.fields,m));if(n!==void 0)throw new Error(`${t} field "${n}" is named like its binding's own \`${n}\` \u2014 a field is read straight off its object's binding, which owns ${It.map(m=>`\`${m}\``).join(", ")}. Rename the field.`);let r=e.label===void 0?void 0:Vi(t,e.label,e.fields),o=r!==void 0&&!("type"in r)?r:void 0,i={...r===void 0||o!==void 0?{}:{label:r},...e.fields};if(Object.keys(i).length===0)throw new Error(`${t} declares no fields \u2014 an object groups at least one.`);for(let[m,g]of Object.entries(i)){let v=Gi(g);if(v!==void 0)throw new Error(`${t} field "${m}" is ${v}.`);if(m!=="label"&&g.label===void 0)throw new Error(`${t} field "${m}" declares no \`label\` \u2014 every field of an object states the name the editor shows it by.`)}let s=$r(i);for(let[m,g]of Object.entries(i)){let v=Or(g,s);if(v!==void 0)throw new Error(`${t} field "${m}" ${Ar(v)}`)}let a=Rr(s),l={};for(let[m,g]of Object.entries(i))l[m]=oe(X(g,a));let d={type:"object",...e.locked===!0?{locked:!0}:{},...o!==void 0?{label:o}:{},fields:l,...e.when!==void 0?{when:e.when}:{}};return Object.defineProperty(d,en,{value:i,enumerable:!1}),d}var Mr=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);function Ji(e){return S(e.from)}function Zi(e){if(!Array.isArray(e.from)){let t=Ji(e);return t===null?[]:[t]}return e.from.flatMap(t=>S(t)??[])}function Qi(e){if(e===void 0)return;if(Fr(e.source))return e;if(e.type!=="object"||!Mr(e.fields))return;let t=Object.values(e.fields).filter(n=>Fr(n.source));return t.length===1?t[0]:void 0}function Lr(e){let t=Qi(e);return t?.type==="row"?Zi(t):[]}function Fr(e){return Mr(e)&&e.kind==="element"}function es(e,t){if(k(e)){if(S(e.key)===null)throw new Error(`list: "${t}" is sourced by the fact "${e.key}", which is no table \u2014 a list's source is a table, a list slot, a list-valued member, a \`compute()\` or a fill; a list of the property's media is picked (\`fill.pick\`) from its item's \`from\`, or computed over a media list (\`compute({ reads: [fact.property.property_media] }, \u2026)\`).`);return{kind:"home",key:e.key}}if(M(e))return{kind:"section",section:e.section,slot:e.slot};if(R(e))return{kind:"sibling",of:e};if(Y(e)!==void 0||j(e))return e;throw new Error(`list: "${t}" declares a source that is no list.`)}function Hr(e){return k(e)?S(e.key):R(e)&&e.type==="list"?De(e):null}var ts=new Set(["label","locked","placeholder","when","source"]);function ns(e){let t={};for(let[n,r]of Object.entries(e))ts.has(n)||(t[n]=r);return t}function rs(e,t){if(k(e)&&S(e.key)!==null)return{type:"row",from:e.key,source:{kind:"element"}};for(let r of D(e,`list: "${t}"`)??[]){if(r.verb==="write")throw new Error(Ur(t,"declares no `item`"));if(r.verb==="pick")throw new Error(rn(t,"declares no `item`"))}if(pe(e))return{type:"poi"};if(R(e)&&e.type==="list")return is(e,t);let n=Y(e);if(n!==void 0){let r=De(n);if(r!==null&&os(r,e.field)==="image_list")return{type:"image"}}throw new Error(`list: "${t}" declares no \`item\`, and its source does not say what its elements are \u2014 declare \`item\`: a plain slot (\`item: image()\`), or a function of the element (\`item: (el) => object({ \u2026 })\`).`)}function os(e,t){if(e.reading==="legacy"){let r=Fe[e.table].row;return Object.hasOwn(r,t)?r[t].value_type:void 0}let n=Se(me(e.table),t);return n===void 0?void 0:ve(n)??void 0}function Ur(e,t){return`list: "${e}" is written by a \`fill.write\` and ${t} \u2014 the item is the kind every written element is: a value slot (\`item: text.short({ cap: 80 })\`), an object exactly one field of which holds the element (\`question: text.medium({ label: "Question", cap: 48, source: el })\`), or an object declared plainly whose members the write answers (\`item: object({ label: text.short({ label: "Unit" }), fields: { \u2026 } })\`).`}function qr(e){if(typeof e!="object"||e===null||e.type!=="object")return!1;let t=e.fields??{};return!Object.values(t).some(n=>L(n.source))}function Nr(e,t){if(e.type!=="object")return;let n=Object.entries(e.fields).filter(([,r])=>r.type!=="row"&&r.source?.kind==="element");if(n.length!==1)throw new Error(Ur(t,n.length===0?"its object item holds the element in no field":`its object item holds the element in ${String(n.length)} fields (${n.map(([r])=>`"${r}"`).join(", ")}) \u2014 one field holds it`))}function is(e,t){let n=e.element;if(n===void 0||n.type==="object")throw new Error(`list: "${t}" lists the items of a list of objects \u2014 declare \`item\` to say what each item holds.`);return n.type==="row"?{type:"row",from:n.from,source:{kind:"element"}}:ns(n)}function rn(e,t){return`list: "${e}" is picked by a \`fill.pick\` and ${t} \u2014 the item holds the pick in the field holding its candidates: a candidate holder itself (\`item: image({ from: fact.property.property_media })\`, \`item: row({ label: "Agent", from: fact.property.contacts })\`), or an object exactly one field of which holds candidates and no source, which its siblings read by its const (\`const photo = image({ label: "Photo", from: fact.property.property_media }); object({ fields: { photo, caption: text.short({ label: "Caption", source: fill.write({ reads: [photo], brief }) }) } })\`).`}function on(e){let t=T(e);return t.type==="row"?typeof t.from=="string":t.type==="select"?Array.isArray(t.values):typeof t.type=="string"&&(F(t.type)||t.type==="media")&&t.from!==void 0}function sn(e){return T(e).source===void 0&&H(e)===void 0}function Kr(e,t){if(e.type!=="object")return on(e)&&sn(e)?null:void 0;let n=ie(e)??e.fields??{},r=Object.entries(n).filter(([,s])=>typeof s=="object"&&s!==null&&on(s)&&sn(s)),o=r.filter(([,s])=>T(s).type!=="select"),i=o.length>0?o:r;if(i.length>1)throw new Error(`list: "${t}"'s item declares ${String(i.length)} fields with \`from\` and no source (${i.map(([s])=>`"${s}"`).join(", ")}) \u2014 a picked list's item holds its pick in exactly one; give the others a source of their own.`);return i.length===1?i[0][0]:void 0}function Dr(e){return{...oe(e),source:{kind:"element"}}}function nn(e,t){if(t===void 0)return null;let n=t===null?e:(ie(e)??e.fields)[t],r=T(n);return r.type==="row"?S(r.from):null}function ss(e,t){if(t===null)return Dr(e);let n=e,r=(ie(e)??n.fields)[t],o=s=>s===r||typeof s=="object"&&s!==null&&T(s)===T(r)?{kind:"element"}:s,i={};for(let[s,a]of Object.entries(n.fields))i[s]=s===t?Dr(a):X(a,o);return tn({...n,fields:i},n)}function as(e,t,n){let r=i=>{if(!L(i))return i;if(ur(i)!==t)throw new Error(`list: "${n}"'s item reads the element of another list \u2014 an element is read only inside its own list's item.`);return{kind:"element"}};if(e.type==="object"){let i=e,s={},a=!1;for(let[l,d]of Object.entries(i.fields))s[l]=oe(X(d,r)),s[l]!==d&&(a=!0);return a?tn({...i,fields:s},i):i}return oe(X(e,r))}function Br(e,t){let n=e.type==="object"?Object.entries(e.fields):[["",e]];for(let[r,o]of n){let i=o.source;if(i?.kind==="home")throw new Error(`list: "${t}"'s item${r===""?"":` field "${r}"`} is bound to the fact "${String(i.key)}", which is the same value in every item \u2014 read the element or a row's member instead; a property fact belongs in a fill's or a \`compute()\`'s \`reads\`.`)}}function ls(e,t){if(e.item===void 0)return rs(e.source,t);let n=new Set((D(e.source,`list: "${t}"`)??[]).map(l=>l.verb));if(n.has("pick")){let l=cs(e.item,t);return n.has("write")&&Nr(l,t),l}let r={},o=Object.freeze({kind:"element",[Kt]:r,[at]:Hr(e.source)}),i=typeof e.item=="function"?e.item(o):e.item;if(typeof i!="object"||i===null||typeof i.type!="string")throw new Error(`list: "${t}"'s item is no slot \u2014 return a value slot, a row or an object.`);if(i.type==="list")throw new Error(`list: "${t}"'s item is a list \u2014 a list's item is a value slot, a row or an object; a list never holds lists.`);if(i.type!=="object"&&H(i)!==void 0)throw new Error(`list: "${t}"'s item declares a fill \u2014 one decision produces the whole list, so the fill belongs on the list's \`source:\`; a field of an object item may carry its own.`);Br(i,t);let s=as(i,r,t);if(n.has("write")&&!qr(e.item)&&Nr(s,t),s.type==="object"||s.type==="row")return s;let a={...s};return delete a.locked,a}function cs(e,t){if(typeof e=="function")throw new Error(rn(t,"declares its item as a function"));if(typeof e!="object"||e===null||typeof e.type!="string")throw new Error(`list: "${t}"'s item is no slot \u2014 return a value slot, a row or an object.`);let n=Kr(e,t);if(n===void 0)throw new Error(rn(t,"its item declares no field with `from` and no source"));Br(e,t);let r=ss(e,n);if(r.type==="object"||r.type==="row")return r;let o={...r};return delete o.locked,o}function ds(e,t){let n=e.source;if(!(n===void 0||(D(n,"list")??[]).some(i=>i.verb==="pick"))||typeof e.item!="object"||e.item===null)return Hr(n);let o=e.item;if(n===void 0){if(o.type!=="object")return nn(o,on(o)?null:void 0);let i=Object.entries(ie(o)??{}).filter(([,s])=>T(s).type==="row"&&sn(s));return i.length===1?nn(o,i[0][0]):null}return nn(o,Kr(o,t))}function P(e){let t=e.label??"list";for(let d of["fields","title","unique","count"]){if(e[d]===void 0)continue;let m={fields:"declare `item: (el) => object({ fields })` \u2014 an item function returning an object",title:"give the item's object a `label` \u2014 a string, or a text slot",unique:"a pick is unique by default (`fill.pick({ unique: false })` lifts it)",count:"`min` and `max` bound how many items any source yields"};throw new Error(`list: "${t}" declares \`${d}\`, which a list no longer takes \u2014 ${m[d]}.`)}let n=e.source,r=D(n,`list: "${t}"`),o=qr(e.item),i=r?.every(d=>d.verb==="pick"||d.verb==="write"&&o)===!0;if(r!==void 0&&e.max===void 0&&!i)throw new Error(`list: "${t}" is filled but declares no \`max\` \u2014 a fill is an open supply, so the list bounds it.`);for(let d of r??[])if(d.verb==="pick"&&d.of!==void 0)throw new Error(`list: "${t}"'s \`fill.pick\` states \`of\` \u2014 a list's pick chooses from its item's \`from\`; remove \`of\`.`);let s={type:"list",...He(e,d=>es(d,t)),element:ls(e,t),...e.min!==void 0?{min:e.min}:{},...e.max!==void 0?{max:e.max}:{}},a=j(n)?Lr(s.element):void 0,l=a===void 0?ds(e,t):a.length===1?a[0]:null;return lt(s,l)}function ut(e,t){if(t!==void 0&&(typeof t!="object"||t===null||Array.isArray(t)))throw new Error(`process.${e}(): takes an options object, or nothing.`);let n={kind:"process",verb:e};for(let[o,i]of Object.entries(t??{}))i!==void 0&&(n[o]=i);let r=jt(n);if(r!==null)throw new Error(`process.${e}(): ${r}.`);return n}function us(e){return ut("cutout",e)}function fs(e){return ut("autocrop",e)}function Z(e,t){return ut(e,t)}function ps(e){return Z("probe",e)}function ms(e){return Z("understand",e)}function hs(e){return Z("preview",e)}function ys(e){return Z("ladder",e)}function gs(e){return Z("transcode",e)}function bs(e){return Z("poster",e)}function ws(e){return Z("rasterize",e)}function ks(e){return Z("fetch",e)}function _s(e){return Z("tour_details",e)}function xs(e){return ut("crop",e)}var vs={cutout:us,autocrop:fs},ft={...vs,probe:ps,understand:ms,preview:hs,ladder:ys,transcode:gs,poster:bs,rasterize:ws,fetch:ks,tour_details:_s,crop:xs};function Ss(e,t="a list"){return`${e} is sourced by ${t} \u2014 a row's slot source names a row, which it mirrors. A list's first row is a \`compute()\` over the list: \`source: compute({ reads: [list] }, (rows) => rows[0] ?? null)\`.`}function Rs(e,t){if(k(e))throw new Error(`row: "${t}" is sourced by the fact "${e.key}" \u2014 a table is a row's \`from\`, never its source: \`row({ label, from: fact.${e.key} })\` holds its first row, which the user may re-pick.`);if(M(e))return{kind:"section",section:e.section,slot:e.slot};if(R(e))return{kind:"sibling",of:e};if(L(e)||j(e))return Object.freeze({...e});throw new Error(`row: "${t}" declares a source that is no element, slot, compute or pick.`)}function Es(e,t){if(Array.isArray(e))return $s(e,t);let n=k(e)?S(e.key):null;if(n!==null)return{key:e.key,tables:[n]};let r=Y(e);if(r!==void 0){let o=`${String(T(r).from)}.${e.field}`;if(br(o)!==null)return{key:o,tables:[]}}throw new Error(e===void 0?`row: "${t}" declares no \`from\` \u2014 a row names its fact data: a table (\`row({ label, from: fact.property.contacts })\`) or a row's list-valued member (\`from: unit.floor_plans\`).`:`row: "${t}"'s \`from\` is ${k(e)?`the fact "${e.key}", which is not a table`:"no table or list-valued member"} \u2014 a row's \`from\` is a fact table (\`fact.property.contacts\`) or a table row's list-valued member (\`unit.floor_plans\`).`)}function $s(e,t){if(e.length===0)throw new Error(`row: "${t}" declares \`from: []\` \u2014 a row names the table it is a row of.`);let n=[],r=[];for(let o of e){let i=k(o)?S(o.key):null;if(i===null)throw new Error(`row: "${t}"'s \`from\` lists ${k(o)?`the fact "${o.key}", which is not a table`:"something that is no table"} \u2014 a row's list of \`from\` names tables (\`[fact.property.contacts, \u2026]\`); a list-valued member is a row's only \`from\`.`);if(r.some(s=>s.table===i.table))throw new Error(`row: "${t}" names the ${i.table} table twice in \`from\` \u2014 each table is named once.`);n.push(o.key),r.push(i)}return{key:n.length===1?n[0]:n,tables:r}}function Os(e,t,n){let r=De(R(e)||L(e)?e:void 0);if(!(r===null||t.some(o=>r.table===o.table)))throw new Error(`row: "${n}" is \`from\` the ${t.map(o=>o.table).join(", ")} table${t.length===1?"":"s"} but its source holds a row of ${r.table} \u2014 a row's source yields a row of its own \`from\`.`)}function Wr(e){let{key:t,tables:n}=Es(e.from,e.label),r=n[0]??null;if(r===null&&!L(e.source))throw new Error(`row: "${e.label}" is \`from\` the list-valued member "${t}" but its source is no element \u2014 a row from a member holds an item of it, the element of the list over that member: \`source: entry\`.`);if(R(e.source)&&e.source.type==="list")throw new Error(Ss(`row: "${e.label}"`));let o=D(e.source,`row: "${e.label}"`);for(let a of o??[]){if(a.verb!=="pick")throw new Error(`row: "${e.label}" is filled by \`fill.${a.verb}\` \u2014 a row holds a row that exists, which only a \`fill.pick({ brief })\` out of its \`from\` yields.`);if(a.of!==void 0)throw new Error(`row: "${e.label}"'s \`fill.pick\` states \`of\` \u2014 a row's pick chooses from its \`from\`; remove \`of\`.`)}o===void 0&&e.source!==void 0&&r!==null&&Os(e.source,n,e.label);let i=He(e,a=>Rs(a,e.label)),s=lt({type:"row",from:t,...i},r);return _r(s,r,n.slice(1))}var As=["property","library"];function Q(e,t){if("label"in e)throw new Error("fact registry: a page head holds no `label` \u2014 the declaration states the fact's name");for(let n of["title","description"]){let r=e[n];if(typeof r=="string"&&r.trim()==="")throw new Error(`fact registry: a page declares an empty ${n}`)}return{head:e,declaration:t}}var Is=new Set(["home","item"]);function cn(e,t,n){let r=typeof t=="object"&&t!==null?n.pages.get(t):void 0;if(r!==void 0)return{kind:"home",key:`${n.home}.${r}`};if(fr(t)){let i=n.pages.get(t);if(i===void 0)throw new Error(`${e} reads a page that is not one of this registry's \u2014 a registry reads its own facts by their page's const.`);return{kind:"home",key:`${n.home}.${i}`}}let o=xe(t)?t.of:t;if(R(o)){let i=n.fields?.get(o);if(i===void 0)throw new Error(`${e} reads the declaration "${o.label??o.type}", which is not a field of the same item \u2014 a field reads its siblings by their consts, and a top-level fact by its page's const.`);return{kind:"item",field:i}}if(k(t)&&[...n.pages.values()].some(i=>t.key===`${n.home}.${i}`))return{kind:"home",key:t.key};if(k(t))throw new Error(`${e} is bound to the fact "${t.key}" \u2014 a registry declares the facts; it reads a sibling page by its const and binds none.`);if(M(t))throw new Error(`${e} reads a section's slot \u2014 a registry reads no section.`);if(L(t)&&n.picked===!0)return{kind:"element"};if(L(t))throw new Error(`${e} reads the element \u2014 a registry's list nothing picks is built by the user, so its item's fields read one another by const.`);if(Y(t)!==void 0)throw new Error(`${e} reads the member "${t.field}" of a row that is not a field of the same item.`);if(Bt(t)&&typeof t.slot=="string")return{kind:"row",slot:t.slot,field:t.field};if(typeof t=="object"&&t!==null&&Is.has(String(t.kind)))return t;throw new Error(`${e} declares a read a registry cannot answer.`)}function js(e,t,n){return Array.isArray(t)?t.length===1?an(e,t[0],n):t.map(r=>an(e,r,n)):an(e,t,n)}function an(e,t,n){let r=typeof t=="object"&&t!==null?n.pages.get(t):void 0,o=typeof t=="string"?t:r===void 0?void 0:`${n.home}.${r}`;if(o===void 0||!n.mediaLists.has(o))throw new Error(`${e} picks \`from\` something other than one of this registry's media lists \u2014 a media field picks from a list of media (the \`uploads\` page, a sorted list), by its const, or owns its asset.`);return o}function dn(e,t,n){let r=t.reads.map(o=>cn(e,o,n));return t.requires===void 0?{kind:"compute",fn:t.fn,reads:r}:{kind:"compute",fn:t.fn,reads:r,requires:t.requires.map(o=>cn(e,o,n))}}function Ts(e,t){if(t.when!==void 0)throw new Error(`${e} declares \`when\` \u2014 a registry has no display variant; a page is drawn when a template reads it.`);if(t.required!==void 0)throw new Error(`${e} declares \`required\` \u2014 a fact requires nothing on its own account; what a property must answer is what its templates require.`);if(t.type==="poi")throw new Error(`${e} is a poi \u2014 a place the platform builds is no fact.`)}function Ps(e,t){let{type:n,fields:r}=t;if(n!=="object"||r===void 0)return;let o=Object.entries(r).filter(([,i])=>i.type==="row");if(o.length>0)throw new Error(`${e} holds a picked row in ${o.map(([i])=>`"${i}"`).join(", ")} \u2014 a list picking rows declares the row as its item (\`item: row({ from })\`), whose members are the row's.`)}function Cs(e){let t=new Map,n=e.fields;for(let r of[n,ie(e)??{}])for(let[o,i]of Object.entries(r))typeof i=="object"&&i!==null&&t.set(i,o);return t}function un(e,t,n){Ts(e,t);let r=oe(X(t,o=>cn(e,o,n)));switch(r.from!==void 0&&(F(String(r.type))||r.type==="media")&&(r={...r,from:js(e,t.from,n)}),r.type){case"object":{let o={},i={...n,fields:Cs(r)};for(let[s,a]of Object.entries(r.fields))o[s]=un(`${e}.${s}`,a,i);r={...r,fields:o};break}case"list":{let o=r.max,i={home:n.home,pages:n.pages,mediaLists:n.mediaLists},s=H(t)?.some(l=>l.verb==="pick")===!0,a=un(`${e}[]`,r.element,s?{...i,picked:!0}:i);Ps(`${e}[]`,a),r={...r,element:a,...Wt(o)?{max:dn(`${e}.max`,o,i)}:{}};break}default:break}return r}function Fs(e,t,n,r){let o=`${e}.${t}`,i=un(o,n.declaration,r);if(i.type==="object")throw new Error(`${o} is an object \u2014 a top-level fact is a value or a list; a group of fields is a list's item.`);if(i.label===void 0)throw new Error(`${o} declares no \`label\` \u2014 a top-level fact states the name its page and its Details section show it by.`);if(n.head===null)return{head:null,declaration:i};let{title:s,description:a}=n.head;return{head:{title:typeof s=="string"?s:dn(`${o}.title`,s,r),description:typeof a=="string"?a:dn(`${o}.description`,a,r)},declaration:i}}var Ms=["home","pages"];function Ls(e){return"head"in e&&"declaration"in e}function Ns(e){let t=e.element;return e.type==="list"&&typeof t?.type=="string"&&(F(t.type)||t.type==="media")}function zr(e,t){if(!As.includes(e))throw new Error(`fact registry: "${e}" is not a home`);let n=new Map,r=new Set,o={};for(let[l,d]of Object.entries(t)){if(Ms.includes(l))throw new Error(`fact registry: ${e} declares a page keyed "${l}", a registry's own key`);n.set(d,l);let m=Ls(d)?d:{head:null,declaration:d};o[l]=m,Ns(m.declaration)&&r.add(`${e}.${l}`)}let i={home:e,pages:n,mediaLists:r},s={};for(let[l,d]of Object.entries(o))s[l]=Fs(e,l,d,i);let a={home:e,pages:s};for(let l of Object.keys(t))a[l]={kind:"home",key:`${e}.${l}`};return a}var Ds=[{value:"for_sale",label:"For sale",icon:"tag",description:"List price, finance details, and a sold-ready layout."},{value:"for_rent",label:"For rent",icon:"key",description:"Monthly rent, lease terms, pets, and utilities."}],Hs=["sold","active"],Us=["total","monthly"];function qs(e){return e==null?"active":"sold"}function Ks(e){return e==="for_rent"?"monthly":"total"}var Bs=6371e3;function Ws(e,t,n,r){let o=l=>l*Math.PI/180,i=o(n-e),s=o(r-t),a=Math.sin(i/2)**2+Math.cos(o(e))*Math.cos(o(n))*Math.sin(s/2)**2;return 2*Bs*Math.asin(Math.sqrt(a))}function Vs(e,t){return e?.latitude==null||e.longitude==null||t?.latitude==null||t.longitude==null?null:Math.round(Ws(t.latitude,t.longitude,e.latitude,e.longitude))}var Gr=zr("library",{contacts:Q({title:"Your contacts",description:"The people your listings name, with the headshots and logos they carry."},P({label:"Contacts",item:()=>{let e=$.short({label:"Name",cap:256});return Re({label:e,fields:{headshot:J({label:"Headshot"}),name:e,title:$.short({label:"Title",cap:128}),org_name:$.short({label:"Organization",cap:256}),email:jr({label:"Email"}),phone:Tr({label:"Phone"}),website:he({label:"Website"}),address:ct({label:"Address"}),bio:$.long({label:"Bio",cap:4e3}),logo_dark:J({label:"Logo for light backgrounds",process:[ft.cutout()]}),logo_light:J({label:"Logo for dark backgrounds",process:[ft.cutout()]}),instagram:he({label:"Instagram"}),linkedin:he({label:"LinkedIn"}),x:he({label:"X"}),facebook:he({label:"Facebook"})}})}}))});Gt(Gr);var fn=Q({title:"What\u2019s the address?",description:"We\u2019ll build your map and neighborhood details from this."},ct({label:"Address"})),Yr=Q({title:"For sale or for rent?",description:"This adjusts the pricing details we ask for."},Ue({label:"Listing intent",from:[...Ds]})),se=Q({title:"Add photos, docs, and links",description:"Everything you add helps fill and enrich your website."},P({label:"Uploads",item:dt()})),pn=P({label:"Media",item:dt({kinds:["image","video","tour"],from:se}),source:N.pick({brief:"Does this upload show the property? It belongs when its name or account says it is a photograph, a rendering, a video or a virtual tour of the property: its building, rooms, grounds, amenities, surroundings or views. It does not belong when its name or account says it is a floor plan or another diagram; a logo, wordmark or brand graphic; a headshot, portrait or other photograph of a person or people; a flyer, ad, business card, slide or other image that is mostly text; a screenshot; a map; or a scanned document page. When neither its name nor its account says what it is, you cannot tell. Order what belongs as a walk through the property: aerial and street views first, then the approach and entry, then the interiors room by room (living spaces, kitchen and dining, bedrooms, bathrooms), then outdoor spaces, amenities, surroundings and views, with every shot of one space together. A video or tour sits with the space it shows, and one of the whole property comes first."})}),Xr=P({label:"Floor plans",item:J({label:"Floor plan",from:se,process:[ft.cutout({enclosed:"keep"})]}),source:N.pick({brief:"Is this upload exactly one floor plan? A floor plan is a top-down view of one floor of a dwelling's rooms and walls \u2014 drawn or rendered, flat or in 3D, at any size. It belongs when its name or account says it shows one floor plan, whatever title, figures or text are printed around it. It does not belong when its name or account says it holds two or more plans, or says it is something else: a building key or locator diagram (the building's outline with one unit shaded), a site, plot, parking or driveway diagram, a standalone legend, scale bar or north arrow, a logo, a photograph, or plain text. When neither its name nor its account says what it is, or how many plans it holds, you cannot tell. Order what belongs from the lowest floor to the highest; plans of several units go in the order the units are numbered, each unit's floors together."})}),zs=P({label:"Documents",item:dt({kinds:["document","image","video"],from:se}),source:N.pick({brief:"Does this upload set out the property's specifics? It belongs when its name or account says it records its figures, finances, terms, legal record, condition or plans: an offering memorandum, brochure, listing sheet, rent roll, financials, comparables, lease, survey, site plan, plan set, disclosure or report. It does not belong when its name or account says it is a photograph, rendering, video or tour showing the property; an image of floor plans or elevations; a logo; a photograph of people; an ad, sign or announcement; a map; or notes for whoever makes the marketing. When neither its name nor its account says what it is, you cannot tell. Order what belongs as a buyer reads it: the offering memorandum, brochure or listing sheet first, then the financials, rent roll and comparables, then the leases, legal record and disclosures, then the reports, surveys and plans."})}),Gs=J({label:"Hero",from:pn,source:N.pick({brief:"Choose the single cover photo for the property's page. The cover is a wide banner above the property's address, so it must stand for the whole property at a glance. Only an image whose name or account says it is a photograph of the property can be chosen. Never choose a logo, wordmark or other brand graphic; an agent, team or company headshot; a flyer, ad, business card, slide or any image that is mostly text; a screenshot; a map; a scanned document or brochure page; or a floor plan or other diagram \u2014 nor an image whose name and account do not say what it is. Among the photographs of the property prefer, in order: a front exterior of the building; another exterior or aerial view; the widest, brightest shot of the main living space. Rank close-up details, bathrooms, utility spaces, empty rooms and anything that reads as a fragment rather than a place last: they are weaker covers, never excluded, so when they are the only photographs of the property, choose the best of them. If not one candidate is a photograph of the property, choose none: no banner beats a banner that is not the property."})}),Ys=he({label:"Website"}),Xs=`Is this floor plan labelled for this unit? Its label is read from its name and the text printed on it, never from the rooms drawn or any figures. It belongs when its label names this unit: the unit's label or a plain variant of it ("Unit 3", "#3", "Apt 3" and "Residence 3" all label "Unit 3"); a descriptor the unit's label carries in brackets, like "(PH)", may be left off. A plan labelling several units, such as a shared floor printed "Unit 1/2/3", belongs to each of them. It is excluded when it labels other units and not this one. When it labels no unit, you cannot tell. Order what belongs from the lowest floor to the highest.`,Js=`Is this photo labelled for this unit? Its label is read from its name, the text printed on it and a caption its account records, never from the rooms it shows, any figures, how much it looks like the unit or where it falls among the uploads. It belongs when its label names this unit: the unit's label or a plain variant of it ("Unit 3", "#3", "Apt 3" and "Residence 3" all label "Unit 3"); a descriptor the unit's label carries in brackets, like "(PH)", may be left off. A photo labelled for several units belongs to each of them. It is excluded when it labels other units and not this one. When it labels no unit, you cannot tell.`,Zs=[`List every dwelling the uploads present with its own specs printed \u2014 its beds, baths, square feet, asking price or rent written out for that dwelling: the home a listing describes, or each unit a building's documents name or number. A dwelling the uploads only name, picture or mark with a status, with no specs of its own, is not listed. A plan or row printed for several units ("Unit 4/6") lists each of those units, each with what is printed for it. A dwelling named in several uploads, or on several pages, is one item carrying everything they print for it. A unit-mix row standing for several unnamed units is not a dwelling; neither is a commercial space, a whole building, a comparable property, a market average or a portfolio total.`,"Every member is what an upload prints as text for that dwelling, and nothing else. An upload's own text, as its account quotes it (a document's or a sheet's content, an image's printed words), is what it prints; the account's description of what a drawing, a photo or a map shows (the rooms, the doors, the spaces) is never a member's source. Never count rooms; never compute, round or convert a figure; never carry one across from another dwelling, a unit-mix average or the building's totals; never add what is usual for a dwelling of its kind. A figure printed for a neighbourhood, a development or the building is never a dwelling's, and a count or fee is 0 only where the uploads print none for that dwelling. A member no upload prints for that dwelling is null, and a null is always better than a guess.",`label: the unit's own name as printed \u2014 its unit number or name ("201", "Residence 201", "4B", "Penthouse 501"), without a word marking its status ("model", "available") \u2014 and never its street address. A dwelling presented alone, with no unit name, is always labelled "Home", whatever name the uploads print for the home itself.`,"beds, baths, sqft: exactly as printed for that dwelling; a studio has one bedroom.",'price: the asking price or monthly rent as written for that dwelling, or its status word ("Sold", "Leased", "Request for Info").','floor: the floor of its building the dwelling sits on, as printed ("3", "PH", "Ground", "3 to 4"); never read off its unit number.',"hoa_monthly: the HOA, condo or strata fee printed per month for that dwelling. A fee printed for another period, or for the building, is null.",'parking: the number of parking spaces printed for that dwelling ("1 deeded space" is 1, "two-car garage" is 2). Parking printed with no count, or for the building, is null.',"lot_sqft: the lot size printed in square feet for that dwelling: a home's own lot. A lot in another unit, or the lot of a building several dwellings share, is null.",`amenities: a feature this dwelling has that the other dwellings in its building do not, in a few words as an upload states it, such as "Private roof deck", "Corner unit", "Harbor views". Check each one against the other dwellings: a feature printed for two of them, or for the building, is the building's and goes on no dwelling, however a sheet praises it; a routine fitting or finish, a note printed on a plan, or what its other members already say sets nothing apart. Most dwellings have none. Leave the list empty when nothing is this one's alone.`,"When the uploads present no dwelling with its own specs printed, return no items."].join(`
147
147
 
148
- `),pt=$.short({label:"Unit"}),Qs=E({label:"Beds"}),ea=E({label:"Baths",decimals:!0}),Zr=E({label:"Sq ft",thousandsSep:!0}),Qr=$.short({label:"Price",cap:40}),eo=$.short({label:"Building floor(s)",cap:20}),to=E({label:"Parking spaces"}),no=P({label:"Amenities",max:12,item:$.short({cap:40})});function ro(e,t){return P({label:"Floor plans",source:N.pick({reads:[e],brief:t}),item:Ee({fields:{image:J({label:"Floor plan",from:Jr}),floor:qe({label:"Floor",from:[...hr],creatable:!0})}})})}function oo(e,t){return P({label:"Photos",source:N.pick({reads:[e],brief:t}),item:J({label:"Photo",from:mn})})}var ta=Q({title:"Tell us about the units",description:"Add each unit\u2019s details and floor plans so they appear on your website."},P({label:"Units",source:N.write({reads:[se],brief:Zs}),item:Ee({label:pt,fields:{label:pt,beds:Qs,baths:ea,sqft:Zr,price:Qr,floor:eo,hoa_monthly:E({label:"Monthly HOA fee"}),parking:to,lot_sqft:E({label:"Lot sq ft",thousandsSep:!0}),amenities:no,floor_plans:ro(pt,Xs),photos:oo(pt,Js)}})})),na=`Is this floor plan labelled for this space? Its label is read from its name and the text printed on it, never from the rooms drawn or any figures. It belongs when its label names this space: the space's label or a plain variant of it ("Suite 200", "Ste 200" and "#200" all label "Suite 200"); a descriptor the space's label carries in brackets may be left off. A plan labelling several spaces belongs to each of them. It is excluded when it labels other spaces and not this one. When it labels no space, you cannot tell. Order what belongs from the lowest floor to the highest.`,ra=`Is this photo labelled for this space? Its label is read from its name, the text printed on it and a caption its account records, never from what it shows, any figures, how much it looks like the space or where it falls among the uploads. It belongs when its label names this space: the space's label or a plain variant of it ("Suite 200", "Ste 200" and "#200" all label "Suite 200"); a descriptor the space's label carries in brackets may be left off. A photo labelled for several spaces belongs to each of them. It is excluded when it labels other spaces and not this one. When it labels no space, you cannot tell.`,oa=["List every commercial space the uploads present with its own specs printed \u2014 its use, square feet, rent or price written out for that space: each shop, office suite, restaurant or other non-residential space a building's documents name or number. A space the uploads only name, picture or mark with a status, with no specs of its own, is not listed. A space named in several uploads, or on several pages, is one item carrying everything they print for it. A dwelling is never a commercial space; neither is a whole building, a comparable property, a market average or a portfolio total.","Every member is what an upload prints as text for that space, and nothing else. An upload's own text, as its account quotes it (a document's or a sheet's content, an image's printed words), is what it prints; the account's description of what a drawing, a photo or a map shows is never a member's source. Never compute, round or convert a figure; never carry one across from another space or the building's totals; never add what is usual for a space of its kind. A member no upload prints for that space is null, and a null is always better than a guess.",`label: the space's own name as printed ("Retail A", "Suite 200", "Ground-floor restaurant"), without a word marking its status ("available", "leased"), and never its street address.`,'use: what the space is for, as printed ("Retail", "Office", "Restaurant").',"sqft: the square feet printed for that space.",'price: the rent or price as written for that space ("$45/SF/yr", "$8,500/mo"), or its status word ("Leased", "Call for pricing").','floor: the floor of its building the space sits on, as printed ("1", "Ground", "Mezzanine"); never read off its suite number.',"parking: the number of parking spaces printed for that space. Parking printed with no count, or for the building, is null.",'amenities: the real selling points of that space, the qualitative features a tenant would notice that its use, size, floor, parking and price do not already say, such as "Corner frontage", "Drive-thru", "Grease trap". Name only what an upload says about that space, in a few words. Never make one up and never add one just to fill the list: a feature the whole building shares, a routine fitting or finish, a note printed on a plan or a restated size is not a selling point. Most spaces have none to three; leave the list empty when nothing stands out.',"When the uploads present no commercial space with its own specs printed, return no items."].join(`
148
+ `),pt=$.short({label:"Unit"}),Qs=E({label:"Beds"}),ea=E({label:"Baths",decimals:!0}),Jr=E({label:"Sq ft",thousandsSep:!0}),Zr=$.short({label:"Price",cap:40}),Qr=$.short({label:"Building floor(s)",cap:20}),eo=E({label:"Parking spaces"}),to=P({label:"Amenities",max:12,item:$.short({cap:40})});function no(e,t){return P({label:"Floor plans",source:N.pick({reads:[e],brief:t}),item:Re({fields:{image:J({label:"Floor plan",from:Xr}),floor:Ue({label:"Floor",from:[...mr],creatable:!0})}})})}function ro(e,t){return P({label:"Photos",source:N.pick({reads:[e],brief:t}),item:J({label:"Photo",from:pn})})}var ta=Q({title:"Tell us about the units",description:"Add each unit\u2019s details and floor plans so they appear on your website."},P({label:"Units",source:N.write({reads:[se],brief:Zs}),item:Re({label:pt,fields:{label:pt,beds:Qs,baths:ea,sqft:Jr,price:Zr,floor:Qr,hoa_monthly:E({label:"Monthly HOA fee"}),parking:eo,lot_sqft:E({label:"Lot sq ft",thousandsSep:!0}),amenities:to,floor_plans:no(pt,Xs),photos:ro(pt,Js)}})})),na=`Is this floor plan labelled for this space? Its label is read from its name and the text printed on it, never from the rooms drawn or any figures. It belongs when its label names this space: the space's label or a plain variant of it ("Suite 200", "Ste 200" and "#200" all label "Suite 200"); a descriptor the space's label carries in brackets may be left off. A plan labelling several spaces belongs to each of them. It is excluded when it labels other spaces and not this one. When it labels no space, you cannot tell. Order what belongs from the lowest floor to the highest.`,ra=`Is this photo labelled for this space? Its label is read from its name, the text printed on it and a caption its account records, never from what it shows, any figures, how much it looks like the space or where it falls among the uploads. It belongs when its label names this space: the space's label or a plain variant of it ("Suite 200", "Ste 200" and "#200" all label "Suite 200"); a descriptor the space's label carries in brackets may be left off. A photo labelled for several spaces belongs to each of them. It is excluded when it labels other spaces and not this one. When it labels no space, you cannot tell.`,oa=["List every commercial space the uploads present with its own specs printed \u2014 its use, square feet, rent or price written out for that space: each shop, office suite, restaurant or other non-residential space a building's documents name or number. A space the uploads only name, picture or mark with a status, with no specs of its own, is not listed. A space named in several uploads, or on several pages, is one item carrying everything they print for it. A dwelling is never a commercial space; neither is a whole building, a comparable property, a market average or a portfolio total.","Every member is what an upload prints as text for that space, and nothing else. An upload's own text, as its account quotes it (a document's or a sheet's content, an image's printed words), is what it prints; the account's description of what a drawing, a photo or a map shows is never a member's source. Never compute, round or convert a figure; never carry one across from another space or the building's totals; never add what is usual for a space of its kind. A member no upload prints for that space is null, and a null is always better than a guess.",`label: the space's own name as printed ("Retail A", "Suite 200", "Ground-floor restaurant"), without a word marking its status ("available", "leased"), and never its street address.`,'use: what the space is for, as printed ("Retail", "Office", "Restaurant").',"sqft: the square feet printed for that space.",'price: the rent or price as written for that space ("$45/SF/yr", "$8,500/mo"), or its status word ("Leased", "Call for pricing").','floor: the floor of its building the space sits on, as printed ("1", "Ground", "Mezzanine"); never read off its suite number.',"parking: the number of parking spaces printed for that space. Parking printed with no count, or for the building, is null.",`amenities: a feature this space has that the other spaces in its building do not, in a few words as an upload states it, such as "Corner frontage", "Drive-thru", "Grease trap". Check each one against the other spaces: a feature printed for two of them, or for the building, is the building's and goes on no space, however a sheet praises it; a routine fitting or finish, a note printed on a plan, or what its other members already say sets nothing apart. Most spaces have none. Leave the list empty when nothing is this one's alone.`,"When the uploads present no commercial space with its own specs printed, return no items."].join(`
149
149
 
150
- `),mt=$.short({label:"Space"}),ia=Q({title:"Tell us about the commercial spaces",description:"Add each space\u2019s details and floor plans so they appear on your website."},P({label:"Commercial spaces",source:N.write({reads:[se],brief:oa}),item:Ee({label:mt,fields:{label:mt,use:$.short({label:"Use",cap:40}),sqft:Zr,price:Qr,floor:eo,parking:to,amenities:no,floor_plans:ro(mt,na),photos:oo(mt,ra)}})})),sa="The uploads may present comparable properties \u2014 other properties set beside the one being marketed for comparison. Find every one and return it as an item. A comparable may appear as a row in a sales or rent comparables table, as a panel with its own photo and figures, as a numbered pin in a map legend, or as a line in a survey of recent trades. Read every upload whole, including tables that continue from one page to the next. Copy each figure exactly as an upload states it for that property, and each listing's remarks word for word. Specs come only from what is printed as text: never count rooms or take a figure from what a floor plan drawing, a photo or a map shows; a studio has one bedroom. Never compute one: not by multiplying a price per unit by a unit count, not by dividing a price by a size, not by counting the days between two dates, not by converting a yearly fee to a monthly one, not by averaging rows, and never by carrying a figure across from a neighbouring row, a summary or the subject. If a property is listed in more than one place \u2014 on several pages, or in several uploads \u2014 return one item carrying every figure those places state. A figure no upload states for that property is null; a null is always better than a guess. Do not return the subject property \u2014 the one at the read address, which the uploads are marketing \u2014 even where it appears in a comparables table or at the centre of a comparables map, and do not return a market, submarket or area average, a portfolio total, or anything that is not an individual property. When no upload presents a comparable property, return no items.",cn=ct({label:"Address"}),zr=Qt({label:"Sale date"}),aa=Q({title:"Which properties compare?",description:"Recently sold or listed homes like this one shape the pricing story."},P({label:"Comparables",max:50,source:N.write({reads:[se,pn],brief:sa}),item:Ee({label:cn,fields:{address:cn,price:E({label:"Price"}),sale_date:zr,beds:E({label:"Beds"}),baths:E({label:"Baths",decimals:!0}),sqft:E({label:"Sq ft"}),photo:J({label:"Photo"}),year_built:E({label:"Year built"}),lot_sqft:E({label:"Lot sq ft"}),stories:E({label:"Stories",decimals:!0}),units:E({label:"Units"}),hoa_monthly:E({label:"HOA per month"}),list_price:E({label:"List price"}),listed_date:Qt({label:"Listed date"}),mls_number:$.short({label:"MLS number"}),description:$.long({label:"Description"}),status:qe({label:"Status",from:[...Hs],locked:!0,source:ot({reads:[zr]},e=>qs(e))}),distance_m:E({label:"Distance (m)",locked:!0,source:ot({reads:[cn,pn]},(e,t)=>Vs(e,t))}),price_period:qe({label:"Price period",from:[...Us],locked:!0,source:ot({reads:[Xr]},e=>Ks(e))})}})})),la=Q({title:"Who\u2019s on this listing?",description:"Add the contacts for this property, and drag them into the order your marketing shows them."},P({label:"Contacts",min:1,max:12,source:N.pick({reads:[se],brief:"Choose this listing's contacts from the library's contacts, judging each one's name, title, organisation, email and phone against the read uploads' names and accounts. A contact may be chosen only when an upload's name or account says it prints their email or phone, or their full name, as a contact for this listing \u2014 an agent, broker, or sales or leasing contact. A contact the uploads leave out, where their accounts name the listing's contacts, is not chosen. A shared organisation, a matching first name, or a name printed in another role (an architect, a photographer, a seller) is not evidence. When no upload's account names any contact, choose none. Order those chosen as the uploads present them for this listing, the first or most prominent first."}),item:Vr({label:"Contact",from:Yr.contacts})})),hn=Gr("property",{address:pn,listing_intent:Xr,description:Q({title:"Describe the property",description:"Talk it up like you would to a buyer, and our AI writes your website copy."},$.long({label:"Description"})),uploads:se,property_media:mn,floor_plans:Jr,property_documents:zs,hero:Gs,site_url:Ys,units:ta,commercial_spaces:ia,contacts:la,comparables:aa});Yt(hn);function io(e,t){return`${e}.${t}`}function ca(e){let t=e.indexOf(".");return t<=0||t===e.length-1||e.includes(".",t+1)?null:{object:e.slice(0,t),field:e.slice(t+1)}}function so(e,t){let n=ca(t);if(n===null)return e[t];let r=e[n.object];return r!==null&&typeof r=="object"&&!Array.isArray(r)?r[n.field]:void 0}function Be(e){return/^processed\/crops\/([^/]+)\//.exec(e)?.[1]??null}var da={responsiveFor:()=>Promise.resolve(null)};async function ae(e,t){try{let n=await e.ladder(t);return{responsiveFor:async r=>{try{return await n.responsiveFor(r)}catch{return null}}}}catch{return da}}var We={asset_id:"",url:"",filename:"",content_type:"",size_bytes:0,poster:""};async function ua(e,t,n){if(!t)return e;try{e.poster=await n.fileUrl(t)}catch(i){return n.log?.warn({asset_id:e.asset_id,err:i.message},"resolve-document-slot: preview presign failed; no poster"),e}let o=await(await ae(n,[t])).responsiveFor(t);return o&&(e.poster_responsive=o),e}async function le(e,t,n){if(e===null)return null;if(typeof e!="object")return We;let r=e,o=typeof r.asset_id=="string"?r.asset_id:"";if(!o)return We;let i=t.get(o);if(i===void 0)return n.log?.warn({asset_id:o},"resolve-document-slot: no asset the render may reach"),We;let s=i.key;if(s===null)return n.log?.warn({asset_id:o},"resolve-document-slot: asset has no stored object"),We;try{let a=i.name,l={asset_id:o,url:n.namedFileUrl?await n.namedFileUrl(s,a):await n.fileUrl(s),filename:a,content_type:i.mime??"",size_bytes:i.bytes??0,poster:""};return await ua(l,i.renditions.poster?.key??null,n)}catch(a){return n.log?.error({asset_id:o,err:a.message},"resolve-document-slot: presign failed; soft-empty document"),We}}var ao=16/10;function ce(e){if(e===null||typeof e!="object")return{mode:"free",aspect:ao};let t=e,n=typeof t.aspect=="number"&&t.aspect>0?t.aspect:ao,r=t.mobile?.aspect,o=typeof r=="number"&&r>0&&Math.abs(r-n)>1e-4?r:void 0;return{mode:t.mode==="free"?"free":"locked",aspect:n,...o===void 0?{}:{mobileAspect:o}}}function fa(e,t){if(e===null||t===null)return e===t;let n=r=>Math.round(r*1e4)/1e4;return n(e.x)===n(t.x)&&n(e.y)===n(t.y)&&n(e.width)===n(t.width)&&n(e.height)===n(t.height)}function pa(e,t){if(e===null||!(e>0)||!(t>0))return null;let n=Math.min(1,t/e),r=Math.min(1,e/t),o={x:(1-n)/2,y:0,width:n,height:r};return fa(o,{x:0,y:0,width:1,height:1})?null:o}function lo(e,t,n,r){if(e!==null||n.mode==="free")return e;let o=r==="mobile"?n.mobileAspect:n.aspect;return o===void 0?null:pa(t,o)}function ye(){return{photo_id:"",url:"",alt:""}}function co(e,t){let n=t===void 0?void 0:e.renditions[t==="white"?"mask_white":"mask_black"]?.key,r=Mt(e.crop)?e.renditions.crop?.key:void 0;return n??e.renditions.cutout?.key??r??e.key}async function gn(e,t,n,r){if(t===void 0)return n.log?.warn({id:e},"resolve-asset-id: no image asset the render may reach; no asset"),null;if(t.kind!=="image")return n.log?.warn({id:e,kind:t.kind},"resolve-asset-id: asset is not an image; no asset"),null;try{let o=co(t,r?.mask);return{url:await n.servedUrl(o),source_key:o}}catch(o){return n.log?.error({id:e,err:o.message},"resolve-asset-id: presign failed; no asset"),null}}function ht(e){return e<0?0:e>1?1:e}function bn(e){let t=typeof e.nx=="number"?e.nx:0,n=typeof e.ny=="number"?e.ny:0,r=typeof e.nw=="number"?e.nw:1,o=typeof e.nh=="number"?e.nh:1;if(![t,n,r,o].every(Number.isFinite))return null;let i={nx:ht(t),ny:ht(n),nw:ht(r),nh:ht(o)};return i.nx===0&&i.ny===0&&i.nw===1&&i.nh===1?null:i}function uo(e){let t=e&&typeof e=="object"?e.key:void 0;return typeof t=="string"&&t.length>0?t:null}function fo(e,t,n){let r=e.rect&&typeof e.rect=="object"?bn(e.rect):null,o=r===null?null:{x:r.nx,y:r.ny,width:r.nw,height:r.nh};return t===void 0?o:lo(o,t.imageAspect,t.aspects,n)}function po(e,t,n){if(!Mt(n))return null;let r=e.renditions&&typeof e.renditions=="object"?e.renditions:{},o=uo(r.crop)??(typeof e.crop_key=="string"&&e.crop_key.length>0?e.crop_key:null);return o!==null&&Be(o)===t?o:null}function mo(e,t){return po(e,yt(e),fo(e,t))}function ho(e,t){let n=e.mobile&&typeof e.mobile=="object"?e.mobile:t===void 0?null:{};return n===null?null:po(n,yt(e),fo(n,t,"mobile"))}async function ma(e,t){try{return{url:await t.servedUrl(e)}}catch{return null}}function ha(e,t,n){let r=yt(e),o=e.renditions&&typeof e.renditions=="object"?e.renditions:{},i=a=>{let l=uo(o[a]);return l!==null&&l.startsWith(`processed/cutout/${r}/`)?l:null};return(t===null?null:i(t==="white"?"mask_white":"mask_black"))??i("cutout")??(t===null?mo(e,n):null)}function yt(e){return typeof e.photo_id=="string"&&e.photo_id?e.photo_id:typeof e.asset_id=="string"&&e.asset_id?e.asset_id:""}async function $e(e,t,n,r){if(e===null)return{value:null,desktopKey:null,mobileKey:null};if(!e||typeof e!="object")return{value:ye(),desktopKey:null,mobileKey:null};let o=e,i=o.rect&&typeof o.rect=="object"?bn(o.rect):null,s=typeof o.ar=="number"?o.ar:null,a=yt(o),l=o.mask==="white"||o.mask==="black"?o.mask:null,d=a?t.get(a):void 0,m=r===void 0?void 0:{aspects:r,imageAspect:ya(d,s)},g=a?ho(o,m):null,v=g?await ma(g,n):null,A=typeof o.alt=="string"?o.alt:"",Te=a?ha(o,l,m):null,ee,be;if(Te){ee={photo_id:a,url:await n.servedUrl(Te),alt:A},be=Te;let B=await gn(a,d,n);B&&B.url!==ee.url&&(ee.download_url=B.url)}else if(a){let B=await gn(a,d,n,l?{mask:l}:void 0);if(!B)return{value:yn(ye(),o),desktopKey:null,mobileKey:g};ee={photo_id:a,url:B.url,alt:A},be=B.source_key}else if(typeof o.url=="string"&&o.url.length>0)ee={photo_id:"",url:o.url,alt:A},be=null;else return{value:yn(ye(),o),desktopKey:null,mobileKey:null};return{value:yn(ga(ee,i,s,v),o),desktopKey:be,mobileKey:v?g:null}}function ya(e,t){return e?.kind==="image"&&e.width!==null&&e.height!==null&&e.width>0&&e.height>0?e.width/e.height:t!==null&&t>0?t:null}async function Ve(e,t){let n=e.flatMap(o=>[o.desktopKey,o.mobileKey]).filter(o=>!!o),r=await ae(t,n);for(let o of e){if(!o.value)continue;let i=await r.responsiveFor(o.desktopKey);if(i&&(o.value.responsive=i),o.value.mobile&&o.mobileKey){let s=await r.responsiveFor(o.mobileKey);s&&(o.value.mobile={...o.value.mobile,responsive:s})}}}async function ze(e,t,n,r){let o=await $e(e,t,n,r);return await Ve([o],n),o.value}function yn(e,t){let n=t.unit_id,r=t.unit_label;if(typeof n=="string"?e.unit_id=n:n===null&&(e.unit_id=null),typeof r=="string"?e.unit_label=r:r===null&&(e.unit_label=null),"floor_label"in t){let o=typeof t.floor_label=="string"?t.floor_label:null;e.floor_label=o,e.alt===""&&(e.alt=o??"Floor plan")}return e}function ga(e,t,n,r){return t&&(e.rect=t),n&&(e.ar=n),r&&(e.mobile=r),e}var Oe={tour_id:"",url:"",poster:"",alt:""};async function ba(e,t,n){if(!t||!e.poster)return e;let o=await(await ae(n,[t])).responsiveFor(t);return o&&(e.poster_responsive=o),e}async function de(e,t,n){if(e===null)return null;if(typeof e!="object")return Oe;let r=e,o=typeof r.tour_id=="string"&&r.tour_id?r.tour_id:typeof r.asset_id=="string"&&r.asset_id?r.asset_id:"";if(!o)return Oe;let i=t.get(o);if(i===void 0)return n.log?.warn({tour_id:o},"resolve-tour-slot: no tour asset the render may reach"),Oe;if(i.kind!=="tour")return n.log?.warn({tour_id:o,kind:i.kind},"resolve-tour-slot: asset is not a tour"),Oe;try{let s=Gn(i.url);if(s===null)return n.log?.warn({tour_id:o},"resolve-tour-slot: tour link embeds nowhere"),Oe;let a=i.renditions.poster?.key??null,l={tour_id:o,url:s,poster:a?await n.fileUrl(a):"",alt:typeof r.alt=="string"?r.alt:"",provider:i.provider};return ba(l,a,n)}catch(s){return n.log?.error({tour_id:o,err:s.message},"resolve-tour-slot: presign failed; soft-empty tour"),Oe}}var Ae={video_id:"",url:"",poster:"",alt:""};async function wn(e,t,n){if(!t||!e.poster)return e;let o=await(await ae(n,[t])).responsiveFor(t);return o&&(e.poster_responsive=o),e}async function ue(e,t,n){if(e===null)return null;if(typeof e!="object")return Ae;let r=e,o=typeof r.video_id=="string"&&r.video_id?r.video_id:typeof r.asset_id=="string"&&r.asset_id?r.asset_id:"";if(!o)return Ae;let i=t.get(o);if(i===void 0)return n.log?.warn({video_id:o},"resolve-video-slot: no video asset the render may reach"),Ae;if(i.kind!=="video")return n.log?.warn({video_id:o,kind:i.kind},"resolve-video-slot: asset is not a video"),Ae;let s=i.renditions.poster?.key??null,a=typeof r.alt=="string"?r.alt:"";try{if(Yn(i)==="link"){let g=i.url,v=zn(g);if(!v)return n.log?.warn({video_id:o},"resolve-video-slot: link upload embeds nowhere"),Ae;let A={video_id:o,url:v,poster:s?await n.fileUrl(s):"",alt:a,source:"link"};return i.provider!==null&&(A.provider=i.provider),wn(A,s,n)}let l=s?await n.fileUrl(s):"",d=i.renditions.encode;if(d===null)return n.log?.warn({video_id:o,state:i.state},"resolve-video-slot: no encode; poster-only"),i.state!=="failed"&&n.notePending?.({kind:"video",id:o}),wn({video_id:o,url:"",poster:l,alt:a},s,n);let m={video_id:o,url:await n.fileUrl(d.key),poster:l,alt:a};return d.width!==null&&(m.width=d.width),d.height!==null&&(m.height=d.height),wn(m,s,n)}catch(l){return n.log?.error({video_id:o,err:l.message},"resolve-video-slot: presign failed; soft-empty video"),Ae}}async function Ie(e,t,n,r){if(e===null||typeof e!="object")return null;let o=e.asset_id;if(typeof o!="string"||o==="")return null;let i=n.get(o);if(i===void 0)return r.log?.warn({asset_id:o},"resolve-media-slot: no asset the render may reach"),null;if(!V(t).includes(i.kind))return r.log?.warn({asset_id:o,kind:i.kind},"resolve-media-slot: asset is of a kind the slot does not hold"),null;let s={asset_id:o};switch(i.kind){case"image":{let a=await ze(e,n,r,ce(t.crop));return a===null?null:{...a,kind:"image"}}case"video":{let a=await ue(s,n,r);return a===null?null:{...a,kind:"video"}}case"tour":{let a=await de(s,n,r);return a===null?null:{...a,kind:"tour"}}case"document":{let a=await le(s,n,r);return a===null?null:{...a,kind:"document"}}}}function _n(e){return e==="image"?"image":e==="video"?"video":e==="tour"?"tour":e==="document"?"document":e==="media"?"media":e==="poi"?"poi":"scalar"}function ge(e){if(e?.type!=="list")return null;let t=e.fields??(e.element?.type==="object"?e.element?.fields:void 0);return t!=null?{kind:"record",fields:t}:{kind:"primitive",primitive:_n(e.element?.type)}}async function gt(e,t,n){if(!Array.isArray(e))return[];let r=ge(t);return r===null?e:r.kind==="record"?wa(e,r.fields,n):yo(e,r.primitive,n,t.element)}async function yo(e,t,n,r){switch(t){case"image":{let o=[];for(let i of e)o.push(await $e(i,n.assets,n.store,ce(r?.crop)));return await Ve(o,n.store),o.map(i=>i.value??ye())}case"video":return(await Promise.all(e.map(i=>ue(i,n.assets,n.store)))).filter(i=>i!==null);case"tour":return(await Promise.all(e.map(i=>de(i,n.assets,n.store)))).filter(i=>i!==null);case"document":return(await Promise.all(e.map(i=>le(i,n.assets,n.store)))).filter(i=>i!==null);case"media":return(await Promise.all(e.map(i=>Ie(i,r??{},n.assets,n.store)))).filter(i=>i!==null);case"poi":return e.map(o=>n.resolvePoi(o));case"scalar":return e}}async function wa(e,t,n){if(!Object.values(t).some(kn))return e;let r=[],o=await go(e,t,n,r);return await Ve(r,n.store),o}async function go(e,t,n,r){let o=Object.entries(t).filter(([,s])=>kn(s));if(o.length===0)return e;let i=[];for(let s of e){if(!s||typeof s!="object"||Array.isArray(s)){i.push(s);continue}let a={...s};for(let[l,d]of o)l in a&&(a[l]=await _a(a[l],d,n,r));i.push(a)}return i}function kn(e){if(_n(e.type)!=="scalar")return!0;let t=ge(e);return t===null?!1:t.kind==="record"?Object.values(t.fields).some(kn):t.primitive!=="scalar"}async function _a(e,t,n,r){if(ge(t)!==null)return ka(e,t,n,r);switch(_n(t.type)){case"image":{let o=await $e(e,n.assets,n.store,ce(t.crop));return r.push(o),o.value}case"video":return ue(e,n.assets,n.store);case"tour":return de(e,n.assets,n.store);case"document":return le(e,n.assets,n.store);case"media":return Ie(e,t,n.assets,n.store);case"poi":return n.resolvePoi(e);case"scalar":return e}}async function ka(e,t,n,r){if(!Array.isArray(e))return[];let o=ge(t);if(o===null)return e;if(o.kind==="record")return go(e,o.fields,n,r);if(o.primitive!=="image")return yo(e,o.primitive,n,t.element);let i=[];for(let s of e)i.push(await $e(s,n.assets,n.store,ce(t.element?.crop)));return r.push(...i),i.map(s=>s.value??ye())}function xn(e){return new Map(Object.entries(e??{}))}async function vn(e,t,n){if(t===void 0)return e;if(ge(t)!==null)return gt(e,t,n);switch(t.type){case"image":return ze(e,n.assets,n.store,ce(t.crop));case"video":return ue(e,n.assets,n.store);case"tour":return de(e,n.assets,n.store);case"document":return le(e,n.assets,n.store);case"media":return Ie(e,t,n.assets,n.store);case"poi":return n.resolvePoi(e);case"object":return xa(e,t,n);default:return e}}async function xa(e,t,n){if(t.fields==null||!e||typeof e!="object"||Array.isArray(e))return e;let[r]=await gt([e],{type:"list",fields:t.fields},n);return r}var bt=e=>e<0?0:e>1?1:e;function wt(e){if(typeof e!="object"||e===null)return null;let{nx:t=0,ny:n=0,nw:r=1,nh:o=1}=e;if(![t,n,r,o].every(l=>typeof l=="number"&&Number.isFinite(l)))return null;let i=bt(t),s=bt(n),a={nx:i,ny:s,nw:Math.min(bt(r),1-i),nh:Math.min(bt(o),1-s)};return a.nw<=0||a.nh<=0||a.nx===0&&a.ny===0&&a.nw===1&&a.nh===1?null:a}var va=/^processed\/crops\/([^/]+)\/(-?[\d.e-]+)_(-?[\d.e-]+)_(-?[\d.e-]+)_(-?[\d.e-]+)$/;function bo(e,t){return`processed/crops/${e}/${t.nx}_${t.ny}_${t.nw}_${t.nh}`}function Sa(e){let t=va.exec(e);if(t===null||Be(e)===null)return null;let n=wt({nx:Number(t[2]),ny:Number(t[3]),nw:Number(t[4]),nh:Number(t[5])});return n===null?null:{id:t[1],rect:n}}function Sn(e){return e==null?null:typeof e=="string"?e:e.url}function wo(e,t={}){let n=t.url??(s=>s),r=new Map;for(let s of e.values())for(let a of[s.file,s.posterFile]){let l=Sn(a);l!==null&&r.set(l,a)}let o=s=>r.has(s)?n(s):s,i=s=>{let a=s===null?void 0:r.get(s);return a===void 0||typeof a=="string"||a.responsive===null?null:{...a.responsive,sources:a.responsive.sources.map(l=>({...l,srcset:Ra(l.srcset,n)}))}};return{servedUrl:s=>{let a=Sa(s);if(a===null)return Promise.resolve(o(s));let l=Sn(e.get(a.id)?.file);return l===null?Promise.reject(new Error(`no image "${a.id}" to crop`)):Promise.resolve(t.crop===void 0?n(l):t.crop(l,a.rect))},fileUrl:s=>Promise.resolve(o(s)),ladder:()=>Promise.resolve({responsiveFor:s=>Promise.resolve(i(s))})}}function Ra(e,t){return e.split(",").map(n=>{let[r="",...o]=n.trim().split(/\s+/);return[t(r),...o].join(" ")}).join(", ")}function _o(e,t,n){let r=xn(e===null?null:Zn(e)),o=new Map;for(let i of t.values()){let s=Sn(i.file);s!==null&&i.sizeBytes!==void 0&&o.set(s,i.sizeBytes)}return new Map([...r].map(([i,s])=>{let a=s.bytes??(s.key===null?void 0:o.get(s.key)??n?.(s.key));return[i,a===void 0||a===s.bytes?s:{...s,bytes:a}]}))}async function ko(e){let t={store:e.store,assets:e.assets,resolvePoi:r=>r},n={};for(let[r,o]of Object.entries(e.slots)){let i=e.declared[r];n[r]=await vn(o,i,t)}return n}function Rn(e){return typeof e=="string"?e:e.url}function So(e,t){let{facts:n}=e,r=a=>e.media[a],o=a=>a?.file===null||a?.file===void 0?"":t(Rn(a.file)),i=a=>a?.posterFile!==void 0?t(Rn(a.posterFile)):a?.posterUrl??"",s=[];for(let a of re(n,{kinds:["image"],from:["property.property_media"]})){let l=r(a.id);s.push({id:a.id,kind:"photo",name:l?.filename||a.id,size:"",src:o(l)})}for(let a of re(n,{kinds:["image"],from:["property.floor_plans"]})){let l=r(a.id);s.push({id:a.id,kind:"plan",name:l?.filename||a.id,size:"",src:o(l)})}for(let a of re(n,{kinds:["video"],from:[Le]})){let l=a.provider??void 0;s.push({id:a.id,kind:"video",name:r(a.id)?.filename||a.name||a.id,size:"",src:i(r(a.id)),ready:!0,durationMs:a.duration_ms??null,...l===void 0?{}:{provider:l}})}for(let a of re(n,{kinds:["tour"],from:[Le]}))s.push({id:a.id,kind:"tour",name:`${a.provider??"Tour"} ${a.id}`,size:"",src:i(r(a.id)),url:a.url??"",provider:a.provider??""});for(let a of re(n,{kinds:["document"],from:[Le]})){let l=r(a.id)?.sizeBytes;s.push({id:a.id,kind:"document",name:a.name===""?a.id:a.name,size:"",src:"",mime:a.mime??"",...l===void 0?{}:{sizeBytes:l}})}return s}function Ro(e){let t={};for(let[n,r]of Object.entries(hn.pages)){let o=r.declaration;if(o.type!=="list"||V(o.element).length===0)continue;let i=`property.${n}`;t[i]=er(e.facts,i)??[]}return t}var Ea=["headshot","logo_dark","logo_light"];function Eo(e,t){return e.facts.contacts.map(n=>{let r={};for(let o of Ea){let i=xe(n[o]),s=i===void 0?void 0:e.media[i]?.file;i!==void 0&&s!==null&&s!==void 0&&(r[i]=t(Rn(s)))}return{id:n.id,images:r}})}function xo(e,t){let n={crop:{x:t.nx,y:t.ny,width:t.nw,height:t.nh},options:{}};return{key:bo(e,t),mime:null,width:null,height:null,bytes:null,over:n}}var $a={image:["asset_id","photo_id"],video:["asset_id","video_id"],tour:["asset_id","tour_id"],document:["asset_id"],media:["asset_id"]};function En(e,t){if(t==null)return t;let n=$a[e.type];if(n!==void 0){if(typeof t!="object")return null;let i=t,s=n.map(m=>i[m]).find(m=>typeof m=="string"&&m!=="");if(typeof s!="string")return null;if(e.type!=="image")return{asset_id:s};let a=wt(i.rect),l=typeof i.mobile=="object"&&i.mobile!==null?wt(i.mobile.rect):null,d="floor_label"in i?{floor_label:typeof i.floor_label=="string"?i.floor_label:null}:{};return{asset_id:s,...a===null?{}:{rect:a,renditions:{crop:xo(s,a)}},...l===null?{}:{mobile:{rect:l,renditions:{crop:xo(s,l)}}},...d}}if(e.type==="object")return vo(e.fields??{},t);if(e.type!=="list"||!Array.isArray(t))return t;let r=t,o=e.element;return o===void 0?r:o.type==="object"?r.map(i=>vo(o.fields??{},i)):r.map(i=>En(o,i))}function vo(e,t){if(typeof t!="object"||t===null)return t;let n={...t};for(let[r,o]of Object.entries(e))r in n&&(n[r]=En(o,n[r]));return n}async function $o(e){let{instance:t,slots:n,fixture:r,session:o,assetUrl:i}=e,s={...t.slots},a={},l=r.provenance[t.instance_id]??{};for(let g of Object.keys(n))a[g]=l[g]??{kind:"empty"};for(let[g,v]of Object.entries(o??{})){let A=n[g];A!==void 0&&(s[g]=En(A,v),a[g]={kind:"session"})}let d=new Map(Object.entries(r.media)),m=wo(d,{url:g=>i(g),crop:(g,v)=>i(g,{crop:v})});return{slots:await ko({slots:s,declared:n,assets:_o(r.facts,d),store:m}),provenance:a}}function Oo(e,t){let n={},r=o=>o.source?.kind==="derived";for(let[o,i]of Object.entries(e)){if(i.type==="object"){for(let[s,a]of Object.entries(i.fields??{})){let l=io(o,s);r(a)&&(n[l]=so(t,l))}continue}r(i)&&(n[o]=t[o])}return n}var Ao=1024*1024;function Aa(e){let t=W(e),n=typeof e.width=="string"?`${e.width} \xD7 ${String(e.height)}`:void 0;return{id:e.id,label:e.label,cssWidth:t.viewportWidth,cssHeight:t.viewportHeight,bleed:t.bleed,pixelWidth:t.pixelWidth,pixelHeight:t.pixelHeight,...n===void 0?{}:{physical:n},tokens:{...Fe(e)}}}function Ia(e,t){return new Response(t,{status:e,headers:{"content-type":"text/plain; charset=utf-8"}})}function $n(e){return new Response(JSON.stringify(e),{headers:{"content-type":"application/json; charset=utf-8"}})}function On(e){return new Response(e,{headers:{"content-type":"text/html; charset=utf-8"}})}function Ta(e){if(typeof e!="object"||e===null)return null;let t=e.status;return typeof t=="number"&&Number.isInteger(t)&&t>=400&&t<600?t:null}function Ge(e,t,n){let r=e.searchParams.get(t);if(r===null||r==="")throw new w(400,`${n} needs a ${t} parameter.`);return r}function ja(e){return`<script>
150
+ `),mt=$.short({label:"Space"}),ia=Q({title:"Tell us about the commercial spaces",description:"Add each space\u2019s details and floor plans so they appear on your website."},P({label:"Commercial spaces",source:N.write({reads:[se],brief:oa}),item:Re({label:mt,fields:{label:mt,use:$.short({label:"Use",cap:40}),sqft:Jr,price:Zr,floor:Qr,parking:eo,amenities:to,floor_plans:no(mt,na),photos:ro(mt,ra)}})})),sa="The uploads may present comparable properties: other properties an upload sets beside the subject for comparison. The subject is the property the uploads are marketing, at the read address; in a building, that is the building and every unit the uploads market in it. Find every comparable and return it as an item. A property is a comparable because an upload compares it with the subject, and it may appear as a row in a sales or rent comparables table, as a panel with its own photo and figures, as a numbered pin in a map legend, or as a line in a survey of recent trades. An upload presenting the subject or one of its units for itself, such as its listing sheet, brochure, price list or market history, presents the subject, whatever unit line it prints beside the read street. Read every upload whole, including tables that continue from one page to the next. Copy each figure exactly as an upload states it for that property, and each listing's remarks word for word. Specs come only from what is printed as text: never count rooms or take a figure from what a floor plan drawing, a photo or a map shows; a studio has one bedroom. Never compute one: not by multiplying a price per unit by a unit count, not by dividing a price by a size, not by counting the days between two dates, not by converting a yearly fee to a monthly one, not by averaging rows, and never by carrying a figure across from a neighbouring row, a summary or the subject. If a property is listed in more than one place \u2014 on several pages, or in several uploads \u2014 return one item carrying every figure those places state. A figure no upload states for that property is null; a null is always better than a guess. Never return the subject, even where it appears in a comparables table or at the centre of a comparables map. Another unit of the subject's building is a comparable only where an upload sets it beside the subject as one, such as a sister unit's earlier sale in a comps table. Do not return a market, submarket or area average, a portfolio total, or anything that is not an individual property. When no upload compares another property with the subject, return no items.",ln=ct({label:"Address"}),Vr=Zt({label:"Sale date"}),aa=Q({title:"Which properties compare?",description:"Recently sold or listed homes like this one shape the pricing story."},P({label:"Comparables",max:50,source:N.write({reads:[se,fn],brief:sa}),item:Re({label:ln,fields:{address:ln,price:E({label:"Price"}),sale_date:Vr,beds:E({label:"Beds"}),baths:E({label:"Baths",decimals:!0}),sqft:E({label:"Sq ft"}),photo:J({label:"Photo"}),year_built:E({label:"Year built"}),lot_sqft:E({label:"Lot sq ft"}),stories:E({label:"Stories",decimals:!0}),units:E({label:"Units"}),hoa_monthly:E({label:"HOA per month"}),list_price:E({label:"List price"}),listed_date:Zt({label:"Listed date"}),mls_number:$.short({label:"MLS number"}),description:$.long({label:"Description"}),status:Ue({label:"Status",from:[...Hs],locked:!0,source:ot({reads:[Vr]},e=>qs(e))}),distance_m:E({label:"Distance (m)",locked:!0,source:ot({reads:[ln,fn]},(e,t)=>Vs(e,t))}),price_period:Ue({label:"Price period",from:[...Us],locked:!0,source:ot({reads:[Yr]},e=>Ks(e))})}})})),la=Q({title:"Who\u2019s on this listing?",description:"Add the contacts for this property, and drag them into the order your marketing shows them."},P({label:"Contacts",min:1,max:12,source:N.pick({reads:[se],brief:"Choose this listing's contacts from the library's contacts, judging each one's name, title, organisation, email and phone against the read uploads' names and accounts. A contact may be chosen only when an upload's name or account says it prints their email or phone, or their full name, as a contact for this listing \u2014 an agent, broker, or sales or leasing contact. A contact the uploads leave out, where their accounts name the listing's contacts, is not chosen. A shared organisation, a matching first name, or a name printed in another role (an architect, a photographer, a seller) is not evidence. When no upload's account names any contact, choose none. Order those chosen as the uploads present them for this listing, the first or most prominent first."}),item:Wr({label:"Contact",from:Gr.contacts})})),mn=zr("property",{address:fn,listing_intent:Yr,description:Q({title:"Describe the property",description:"Talk it up like you would to a buyer, and our AI writes your website copy."},$.long({label:"Description"})),uploads:se,property_media:pn,floor_plans:Xr,property_documents:zs,hero:Gs,site_url:Ys,units:ta,commercial_spaces:ia,contacts:la,comparables:aa});Gt(mn);function oo(e,t){return`${e}.${t}`}function ca(e){let t=e.indexOf(".");return t<=0||t===e.length-1||e.includes(".",t+1)?null:{object:e.slice(0,t),field:e.slice(t+1)}}function io(e,t){let n=ca(t);if(n===null)return e[t];let r=e[n.object];return r!==null&&typeof r=="object"&&!Array.isArray(r)?r[n.field]:void 0}function Ke(e){return/^processed\/crops\/([^/]+)\//.exec(e)?.[1]??null}var da={responsiveFor:()=>Promise.resolve(null)};async function ae(e,t){try{let n=await e.ladder(t);return{responsiveFor:async r=>{try{return await n.responsiveFor(r)}catch{return null}}}}catch{return da}}var Be={asset_id:"",url:"",filename:"",content_type:"",size_bytes:0,poster:""};async function ua(e,t,n){if(!t)return e;try{e.poster=await n.fileUrl(t)}catch(i){return n.log?.warn({asset_id:e.asset_id,err:i.message},"resolve-document-slot: preview presign failed; no poster"),e}let o=await(await ae(n,[t])).responsiveFor(t);return o&&(e.poster_responsive=o),e}async function le(e,t,n){if(e===null)return null;if(typeof e!="object")return Be;let r=e,o=typeof r.asset_id=="string"?r.asset_id:"";if(!o)return Be;let i=t.get(o);if(i===void 0)return n.log?.warn({asset_id:o},"resolve-document-slot: no asset the render may reach"),Be;let s=i.key;if(s===null)return n.log?.warn({asset_id:o},"resolve-document-slot: asset has no stored object"),Be;try{let a=i.name,l={asset_id:o,url:n.namedFileUrl?await n.namedFileUrl(s,a):await n.fileUrl(s),filename:a,content_type:i.mime??"",size_bytes:i.bytes??0,poster:""};return await ua(l,i.renditions.poster?.key??null,n)}catch(a){return n.log?.error({asset_id:o,err:a.message},"resolve-document-slot: presign failed; soft-empty document"),Be}}var so=16/10;function ce(e){if(e===null||typeof e!="object")return{mode:"free",aspect:so};let t=e,n=typeof t.aspect=="number"&&t.aspect>0?t.aspect:so,r=t.mobile?.aspect,o=typeof r=="number"&&r>0&&Math.abs(r-n)>1e-4?r:void 0;return{mode:t.mode==="free"?"free":"locked",aspect:n,...o===void 0?{}:{mobileAspect:o}}}function fa(e,t){if(e===null||t===null)return e===t;let n=r=>Math.round(r*1e4)/1e4;return n(e.x)===n(t.x)&&n(e.y)===n(t.y)&&n(e.width)===n(t.width)&&n(e.height)===n(t.height)}function pa(e,t){if(e===null||!(e>0)||!(t>0))return null;let n=Math.min(1,t/e),r=Math.min(1,e/t),o={x:(1-n)/2,y:0,width:n,height:r};return fa(o,{x:0,y:0,width:1,height:1})?null:o}function ao(e,t,n,r){if(e!==null||n.mode==="free")return e;let o=r==="mobile"?n.mobileAspect:n.aspect;return o===void 0?null:pa(t,o)}function ye(){return{photo_id:"",url:"",alt:""}}function lo(e,t){let n=t===void 0?void 0:e.renditions[t==="white"?"mask_white":"mask_black"]?.key,r=Ft(e.crop)?e.renditions.crop?.key:void 0;return n??e.renditions.cutout?.key??r??e.key}async function yn(e,t,n,r){if(t===void 0)return n.log?.warn({id:e},"resolve-asset-id: no image asset the render may reach; no asset"),null;if(t.kind!=="image")return n.log?.warn({id:e,kind:t.kind},"resolve-asset-id: asset is not an image; no asset"),null;try{let o=lo(t,r?.mask);return{url:await n.servedUrl(o),source_key:o}}catch(o){return n.log?.error({id:e,err:o.message},"resolve-asset-id: presign failed; no asset"),null}}function ht(e){return e<0?0:e>1?1:e}function gn(e){let t=typeof e.nx=="number"?e.nx:0,n=typeof e.ny=="number"?e.ny:0,r=typeof e.nw=="number"?e.nw:1,o=typeof e.nh=="number"?e.nh:1;if(![t,n,r,o].every(Number.isFinite))return null;let i={nx:ht(t),ny:ht(n),nw:ht(r),nh:ht(o)};return i.nx===0&&i.ny===0&&i.nw===1&&i.nh===1?null:i}function co(e){let t=e&&typeof e=="object"?e.key:void 0;return typeof t=="string"&&t.length>0?t:null}function uo(e,t,n){let r=e.rect&&typeof e.rect=="object"?gn(e.rect):null,o=r===null?null:{x:r.nx,y:r.ny,width:r.nw,height:r.nh};return t===void 0?o:ao(o,t.imageAspect,t.aspects,n)}function fo(e,t,n){if(!Ft(n))return null;let r=e.renditions&&typeof e.renditions=="object"?e.renditions:{},o=co(r.crop)??(typeof e.crop_key=="string"&&e.crop_key.length>0?e.crop_key:null);return o!==null&&Ke(o)===t?o:null}function po(e,t){return fo(e,yt(e),uo(e,t))}function mo(e,t){let n=e.mobile&&typeof e.mobile=="object"?e.mobile:t===void 0?null:{};return n===null?null:fo(n,yt(e),uo(n,t,"mobile"))}async function ma(e,t){try{return{url:await t.servedUrl(e)}}catch{return null}}function ha(e,t,n){let r=yt(e),o=e.renditions&&typeof e.renditions=="object"?e.renditions:{},i=a=>{let l=co(o[a]);return l!==null&&l.startsWith(`processed/cutout/${r}/`)?l:null};return(t===null?null:i(t==="white"?"mask_white":"mask_black"))??i("cutout")??(t===null?po(e,n):null)}function yt(e){return typeof e.asset_id=="string"?e.asset_id:""}async function Ee(e,t,n,r){if(e===null)return{value:null,desktopKey:null,mobileKey:null};if(!e||typeof e!="object")return{value:ye(),desktopKey:null,mobileKey:null};let o=e,i=o.rect&&typeof o.rect=="object"?gn(o.rect):null,s=typeof o.ar=="number"?o.ar:null,a=yt(o),l=o.mask==="white"||o.mask==="black"?o.mask:null,d=a?t.get(a):void 0,m=r===void 0?void 0:{aspects:r,imageAspect:ya(d,s)},g=a?mo(o,m):null,v=g?await ma(g,n):null,A=typeof o.alt=="string"?o.alt:"",Ie=a?ha(o,l,m):null,ee,be;if(Ie){ee={photo_id:a,url:await n.servedUrl(Ie),alt:A},be=Ie;let B=await yn(a,d,n);B&&B.url!==ee.url&&(ee.download_url=B.url)}else if(a){let B=await yn(a,d,n,l?{mask:l}:void 0);if(!B)return{value:hn(ye(),o),desktopKey:null,mobileKey:g};ee={photo_id:a,url:B.url,alt:A},be=B.source_key}else if(typeof o.url=="string"&&o.url.length>0)ee={photo_id:"",url:o.url,alt:A},be=null;else return{value:hn(ye(),o),desktopKey:null,mobileKey:null};return{value:hn(ga(ee,i,s,v),o),desktopKey:be,mobileKey:v?g:null}}function ya(e,t){return e?.kind==="image"&&e.width!==null&&e.height!==null&&e.width>0&&e.height>0?e.width/e.height:t!==null&&t>0?t:null}async function We(e,t){let n=e.flatMap(o=>[o.desktopKey,o.mobileKey]).filter(o=>!!o),r=await ae(t,n);for(let o of e){if(!o.value)continue;let i=await r.responsiveFor(o.desktopKey);if(i&&(o.value.responsive=i),o.value.mobile&&o.mobileKey){let s=await r.responsiveFor(o.mobileKey);s&&(o.value.mobile={...o.value.mobile,responsive:s})}}}async function Ve(e,t,n,r){let o=await Ee(e,t,n,r);return await We([o],n),o.value}function hn(e,t){let n=t.unit_id,r=t.unit_label;if(typeof n=="string"?e.unit_id=n:n===null&&(e.unit_id=null),typeof r=="string"?e.unit_label=r:r===null&&(e.unit_label=null),"floor_label"in t){let o=typeof t.floor_label=="string"?t.floor_label:null;e.floor_label=o,e.alt===""&&(e.alt=o??"Floor plan")}return e}function ga(e,t,n,r){return t&&(e.rect=t),n&&(e.ar=n),r&&(e.mobile=r),e}var $e={tour_id:"",url:"",poster:"",alt:""};async function ba(e,t,n){if(!t||!e.poster)return e;let o=await(await ae(n,[t])).responsiveFor(t);return o&&(e.poster_responsive=o),e}async function de(e,t,n){if(e===null)return null;if(typeof e!="object")return $e;let r=e,o=typeof r.asset_id=="string"?r.asset_id:"";if(!o)return $e;let i=t.get(o);if(i===void 0)return n.log?.warn({tour_id:o},"resolve-tour-slot: no tour asset the render may reach"),$e;if(i.kind!=="tour")return n.log?.warn({tour_id:o,kind:i.kind},"resolve-tour-slot: asset is not a tour"),$e;try{let s=zn(i.url);if(s===null)return n.log?.warn({tour_id:o},"resolve-tour-slot: tour link embeds nowhere"),$e;let a=i.renditions.poster?.key??null,l={tour_id:o,url:s,poster:a?await n.fileUrl(a):"",alt:typeof r.alt=="string"?r.alt:"",provider:i.provider};return ba(l,a,n)}catch(s){return n.log?.error({tour_id:o,err:s.message},"resolve-tour-slot: presign failed; soft-empty tour"),$e}}var Oe={video_id:"",url:"",poster:"",alt:""};async function bn(e,t,n){if(!t||!e.poster)return e;let o=await(await ae(n,[t])).responsiveFor(t);return o&&(e.poster_responsive=o),e}async function ue(e,t,n){if(e===null)return null;if(typeof e!="object")return Oe;let r=e,o=typeof r.asset_id=="string"?r.asset_id:"";if(!o)return Oe;let i=t.get(o);if(i===void 0)return n.log?.warn({video_id:o},"resolve-video-slot: no video asset the render may reach"),Oe;if(i.kind!=="video")return n.log?.warn({video_id:o,kind:i.kind},"resolve-video-slot: asset is not a video"),Oe;let s=i.renditions.poster?.key??null,a=typeof r.alt=="string"?r.alt:"";try{if(Gn(i)==="link"){let g=i.url,v=Vn(g);if(!v)return n.log?.warn({video_id:o},"resolve-video-slot: link upload embeds nowhere"),Oe;let A={video_id:o,url:v,poster:s?await n.fileUrl(s):"",alt:a,source:"link"};return i.provider!==null&&(A.provider=i.provider),bn(A,s,n)}let l=s?await n.fileUrl(s):"",d=i.renditions.encode;if(d===null)return n.log?.warn({video_id:o,state:i.state},"resolve-video-slot: no encode; poster-only"),i.state!=="failed"&&n.notePending?.({kind:"video",id:o}),bn({video_id:o,url:"",poster:l,alt:a},s,n);let m={video_id:o,url:await n.fileUrl(d.key),poster:l,alt:a};return d.width!==null&&(m.width=d.width),d.height!==null&&(m.height=d.height),bn(m,s,n)}catch(l){return n.log?.error({video_id:o,err:l.message},"resolve-video-slot: presign failed; soft-empty video"),Oe}}async function Ae(e,t,n,r){if(e===null||typeof e!="object")return null;let o=e.asset_id;if(typeof o!="string"||o==="")return null;let i=n.get(o);if(i===void 0)return r.log?.warn({asset_id:o},"resolve-media-slot: no asset the render may reach"),null;if(!V(t).includes(i.kind))return r.log?.warn({asset_id:o,kind:i.kind},"resolve-media-slot: asset is of a kind the slot does not hold"),null;let s={asset_id:o};switch(i.kind){case"image":{let a=await Ve(e,n,r,ce(t.crop));return a===null?null:{...a,kind:"image"}}case"video":{let a=await ue(s,n,r);return a===null?null:{...a,kind:"video"}}case"tour":{let a=await de(s,n,r);return a===null?null:{...a,kind:"tour"}}case"document":{let a=await le(s,n,r);return a===null?null:{...a,kind:"document"}}}}function wn(e){return e==="image"?"image":e==="video"?"video":e==="tour"?"tour":e==="document"?"document":e==="media"?"media":e==="poi"?"poi":"scalar"}function ge(e){if(e?.type!=="list")return null;let t=e.element?.type==="object"?e.element?.fields:void 0;return t!=null?{kind:"record",fields:t}:{kind:"primitive",primitive:wn(e.element?.type)}}async function gt(e,t,n){if(!Array.isArray(e))return[];let r=ge(t);return r===null?e:r.kind==="record"?wa(e,r.fields,n):ho(e,r.primitive,n,t.element)}async function ho(e,t,n,r){switch(t){case"image":{let o=[];for(let i of e)o.push(await Ee(i,n.assets,n.store,ce(r?.crop)));return await We(o,n.store),o.map(i=>i.value??ye())}case"video":return(await Promise.all(e.map(i=>ue(i,n.assets,n.store)))).filter(i=>i!==null);case"tour":return(await Promise.all(e.map(i=>de(i,n.assets,n.store)))).filter(i=>i!==null);case"document":return(await Promise.all(e.map(i=>le(i,n.assets,n.store)))).filter(i=>i!==null);case"media":return(await Promise.all(e.map(i=>Ae(i,r??{},n.assets,n.store)))).filter(i=>i!==null);case"poi":return e.map(o=>n.resolvePoi(o));case"scalar":return e}}async function wa(e,t,n){if(!Object.values(t).some(kn))return e;let r=[],o=await yo(e,t,n,r);return await We(r,n.store),o}async function yo(e,t,n,r){let o=Object.entries(t).filter(([,s])=>kn(s));if(o.length===0)return e;let i=[];for(let s of e){if(!s||typeof s!="object"||Array.isArray(s)){i.push(s);continue}let a={...s};for(let[l,d]of o)l in a&&(a[l]=await ka(a[l],d,n,r));i.push(a)}return i}function kn(e){if(wn(e.type)!=="scalar")return!0;let t=ge(e);return t===null?!1:t.kind==="record"?Object.values(t.fields).some(kn):t.primitive!=="scalar"}async function ka(e,t,n,r){if(ge(t)!==null)return _a(e,t,n,r);switch(wn(t.type)){case"image":{let o=await Ee(e,n.assets,n.store,ce(t.crop));return r.push(o),o.value}case"video":return ue(e,n.assets,n.store);case"tour":return de(e,n.assets,n.store);case"document":return le(e,n.assets,n.store);case"media":return Ae(e,t,n.assets,n.store);case"poi":return n.resolvePoi(e);case"scalar":return e}}async function _a(e,t,n,r){if(!Array.isArray(e))return[];let o=ge(t);if(o===null)return e;if(o.kind==="record")return yo(e,o.fields,n,r);if(o.primitive!=="image")return ho(e,o.primitive,n,t.element);let i=[];for(let s of e)i.push(await Ee(s,n.assets,n.store,ce(t.element?.crop)));return r.push(...i),i.map(s=>s.value??ye())}function _n(e){return new Map(Object.entries(e??{}))}async function xn(e,t,n){if(t===void 0)return e;if(ge(t)!==null)return gt(e,t,n);switch(t.type){case"image":return Ve(e,n.assets,n.store,ce(t.crop));case"video":return ue(e,n.assets,n.store);case"tour":return de(e,n.assets,n.store);case"document":return le(e,n.assets,n.store);case"media":return Ae(e,t,n.assets,n.store);case"poi":return n.resolvePoi(e);case"object":return xa(e,t,n);default:return e}}async function xa(e,t,n){if(t.fields==null||!e||typeof e!="object"||Array.isArray(e))return e;let[r]=await gt([e],{type:"list",element:{type:"object",fields:t.fields}},n);return r}var bt=e=>e<0?0:e>1?1:e;function wt(e){if(typeof e!="object"||e===null)return null;let{nx:t=0,ny:n=0,nw:r=1,nh:o=1}=e;if(![t,n,r,o].every(l=>typeof l=="number"&&Number.isFinite(l)))return null;let i=bt(t),s=bt(n),a={nx:i,ny:s,nw:Math.min(bt(r),1-i),nh:Math.min(bt(o),1-s)};return a.nw<=0||a.nh<=0||a.nx===0&&a.ny===0&&a.nw===1&&a.nh===1?null:a}var va=/^processed\/crops\/([^/]+)\/(-?[\d.e-]+)_(-?[\d.e-]+)_(-?[\d.e-]+)_(-?[\d.e-]+)$/;function go(e,t){return`processed/crops/${e}/${t.nx}_${t.ny}_${t.nw}_${t.nh}`}function Sa(e){let t=va.exec(e);if(t===null||Ke(e)===null)return null;let n=wt({nx:Number(t[2]),ny:Number(t[3]),nw:Number(t[4]),nh:Number(t[5])});return n===null?null:{id:t[1],rect:n}}function vn(e){return e==null?null:typeof e=="string"?e:e.url}function bo(e,t={}){let n=t.url??(s=>s),r=new Map;for(let s of e.values())for(let a of[s.file,s.posterFile]){let l=vn(a);l!==null&&r.set(l,a)}let o=s=>r.has(s)?n(s):s,i=s=>{let a=s===null?void 0:r.get(s);return a===void 0||typeof a=="string"||a.responsive===null?null:{...a.responsive,sources:a.responsive.sources.map(l=>({...l,srcset:Ra(l.srcset,n)}))}};return{servedUrl:s=>{let a=Sa(s);if(a===null)return Promise.resolve(o(s));let l=vn(e.get(a.id)?.file);return l===null?Promise.reject(new Error(`no image "${a.id}" to crop`)):Promise.resolve(t.crop===void 0?n(l):t.crop(l,a.rect))},fileUrl:s=>Promise.resolve(o(s)),ladder:()=>Promise.resolve({responsiveFor:s=>Promise.resolve(i(s))})}}function Ra(e,t){return e.split(",").map(n=>{let[r="",...o]=n.trim().split(/\s+/);return[t(r),...o].join(" ")}).join(", ")}function wo(e,t,n){let r=_n(e===null?null:Jn(e)),o=new Map;for(let i of t.values()){let s=vn(i.file);s!==null&&i.sizeBytes!==void 0&&o.set(s,i.sizeBytes)}return new Map([...r].map(([i,s])=>{let a=s.bytes??(s.key===null?void 0:o.get(s.key)??n?.(s.key));return[i,a===void 0||a===s.bytes?s:{...s,bytes:a}]}))}async function ko(e){let t={store:e.store,assets:e.assets,resolvePoi:r=>r},n={};for(let[r,o]of Object.entries(e.slots)){let i=e.declared[r];n[r]=await xn(o,i,t)}return n}function Sn(e){return typeof e=="string"?e:e.url}function vo(e,t){let{facts:n}=e,r=a=>e.media[a],o=a=>a?.file===null||a?.file===void 0?"":t(Sn(a.file)),i=a=>a?.posterFile!==void 0?t(Sn(a.posterFile)):a?.posterUrl??"",s=[];for(let a of re(n,{kinds:["image"],from:["property.property_media"]})){let l=r(a.id);s.push({id:a.id,kind:"photo",name:l?.filename||a.id,size:"",src:o(l)})}for(let a of re(n,{kinds:["image"],from:["property.floor_plans"]})){let l=r(a.id);s.push({id:a.id,kind:"plan",name:l?.filename||a.id,size:"",src:o(l)})}for(let a of re(n,{kinds:["video"],from:[Me]})){let l=a.provider??void 0;s.push({id:a.id,kind:"video",name:r(a.id)?.filename||a.name||a.id,size:"",src:i(r(a.id)),ready:!0,durationMs:a.duration_ms??null,...l===void 0?{}:{provider:l}})}for(let a of re(n,{kinds:["tour"],from:[Me]}))s.push({id:a.id,kind:"tour",name:`${a.provider??"Tour"} ${a.id}`,size:"",src:i(r(a.id)),url:a.url??"",provider:a.provider??""});for(let a of re(n,{kinds:["document"],from:[Me]})){let l=r(a.id)?.sizeBytes;s.push({id:a.id,kind:"document",name:a.name===""?a.id:a.name,size:"",src:"",mime:a.mime??"",...l===void 0?{}:{sizeBytes:l}})}return s}function So(e){let t={};for(let[n,r]of Object.entries(mn.pages)){let o=r.declaration;if(o.type!=="list"||V(o.element).length===0)continue;let i=`property.${n}`;t[i]=Qn(e.facts,i)??[]}return t}var Ea=["headshot","logo_dark","logo_light"];function Ro(e,t){return e.facts.contacts.map(n=>{let r={};for(let o of Ea){let i=_e(n[o]),s=i===void 0?void 0:e.media[i]?.file;i!==void 0&&s!==null&&s!==void 0&&(r[i]=t(Sn(s)))}return{id:n.id,images:r}})}function _o(e,t){let n={crop:{x:t.nx,y:t.ny,width:t.nw,height:t.nh},options:{}};return{key:go(e,t),mime:null,width:null,height:null,bytes:null,over:n}}var $a={image:["asset_id","photo_id"],video:["asset_id","video_id"],tour:["asset_id","tour_id"],document:["asset_id"],media:["asset_id"]};function Rn(e,t){if(t==null)return t;let n=$a[e.type];if(n!==void 0){if(typeof t!="object")return null;let i=t,s=n.map(m=>i[m]).find(m=>typeof m=="string"&&m!=="");if(typeof s!="string")return null;if(e.type!=="image")return{asset_id:s};let a=wt(i.rect),l=typeof i.mobile=="object"&&i.mobile!==null?wt(i.mobile.rect):null,d="floor_label"in i?{floor_label:typeof i.floor_label=="string"?i.floor_label:null}:{};return{asset_id:s,...a===null?{}:{rect:a,renditions:{crop:_o(s,a)}},...l===null?{}:{mobile:{rect:l,renditions:{crop:_o(s,l)}}},...d}}if(e.type==="object")return xo(e.fields??{},t);if(e.type!=="list"||!Array.isArray(t))return t;let r=t,o=e.element;return o===void 0?r:o.type==="object"?r.map(i=>xo(o.fields??{},i)):r.map(i=>Rn(o,i))}function xo(e,t){if(typeof t!="object"||t===null)return t;let n={...t};for(let[r,o]of Object.entries(e))r in n&&(n[r]=Rn(o,n[r]));return n}async function Eo(e){let{instance:t,slots:n,fixture:r,session:o,assetUrl:i}=e,s={...t.slots},a={},l=r.provenance[t.instance_id]??{};for(let g of Object.keys(n))a[g]=l[g]??{kind:"empty"};for(let[g,v]of Object.entries(o??{})){let A=n[g];A!==void 0&&(s[g]=Rn(A,v),a[g]={kind:"session"})}let d=new Map(Object.entries(r.media)),m=bo(d,{url:g=>i(g),crop:(g,v)=>i(g,{crop:v})});return{slots:await ko({slots:s,declared:n,assets:wo(r.facts,d),store:m}),provenance:a}}function $o(e,t){let n={},r=o=>o.source?.kind==="derived";for(let[o,i]of Object.entries(e)){if(i.type==="object"){for(let[s,a]of Object.entries(i.fields??{})){let l=oo(o,s);r(a)&&(n[l]=io(t,l))}continue}r(i)&&(n[o]=t[o])}return n}var Oo=1024*1024;function Aa(e){let t=W(e),n=typeof e.width=="string"?`${e.width} \xD7 ${String(e.height)}`:void 0;return{id:e.id,label:e.label,cssWidth:t.viewportWidth,cssHeight:t.viewportHeight,bleed:t.bleed,pixelWidth:t.pixelWidth,pixelHeight:t.pixelHeight,...n===void 0?{}:{physical:n},tokens:{...Ce(e)}}}function Ia(e,t){return new Response(t,{status:e,headers:{"content-type":"text/plain; charset=utf-8"}})}function En(e){return new Response(JSON.stringify(e),{headers:{"content-type":"application/json; charset=utf-8"}})}function $n(e){return new Response(e,{headers:{"content-type":"text/html; charset=utf-8"}})}function ja(e){if(typeof e!="object"||e===null)return null;let t=e.status;return typeof t=="number"&&Number.isInteger(t)&&t>=400&&t<600?t:null}function ze(e,t,n){let r=e.searchParams.get(t);if(r===null||r==="")throw new w(400,`${n} needs a ${t} parameter.`);return r}function Ta(e){return`<script>
151
151
  (function () {
152
152
  try {
153
153
  var src = new EventSource(${JSON.stringify(e)});
@@ -156,6 +156,6 @@ ${e.body}
156
156
  });
157
157
  } catch (e) { /* no change channel; the page stays as it is */ }
158
158
  })();
159
- </script>`}function Pa(e){if(e===fe.catalog||e==="api/media"||e.startsWith("api/capture/")||e===G.frame||e===G.print)return!0;let[t,n,r]=e.split("/").filter(Boolean);return t==="fixtures"&&n!==void 0&&r==="live"}function Yu(e){let{reader:t,assetUrl:n,renderer:r}=e,o=(e.base??"/").endsWith("/")?e.base??"/":`${e.base??"/"}/`,i=p=>/^([a-z][a-z0-9+.-]*:|\/)/i.test(p)?p:`${o}${p}`,s=()=>[Ne.base,Ne.template].map(p=>i(n(p)));async function a(p){let{fixtures:u}=await t.fixtures(),c=u.find(f=>f.id===p);if(c===void 0){let f=u.map(y=>y.id).join(", ")||"none";throw new w(404,`There is no fixture "${p}" (have: ${f}).`)}return c}function l(p,u){let c=p.instances.find(f=>f.instance_id===u);if(c===void 0)throw new w(400,`The composition places no instance "${u}".`);return c}function d(p,u,c,f,y){if(p.output!=="website")return{selfAnchor:f,anchors:Nn(),pages:[]};let h=ir(u,y),k=p.pages.map(C=>({id:C.id,label:C.label,path:C.path??`/${C.id}`,sections:C.sections.map(te=>({key:te.section,anchor:te.section,enabled:h.get(te.instanceId)!==!1}))})),x=`${o}${fe.live(u.id,"/").replace(/\/$/,"")}`,O=cr({pages:k,currentPageId:c,basePath:x});return{selfAnchor:f,anchors:O.anchors,pages:O.pages}}async function m(p,u,c,f,y,h){let k=p.instances.find(q=>q.instanceId===f.instance_id);if(k===void 0)throw new Error(`The composition places no section "${f.section_key}".`);let x=sr(f,k.sectionSchema.slots,h),{slots:O,provenance:C}=await $o({instance:x,slots:k.sectionSchema.slots,fixture:u,session:y,assetUrl:n}),te=d(p,u,c,x.section_key,h),I=x.variant,je=await r.section(x.section_key),Ye=r.renderToString(r.createElement(je,{slots:O,nav:te,variant:I??""}),{identifierPrefix:x.instance_id}),_t=Oo(k.sectionSchema.slots,f.slots);return{html:Ye,resolvedProps:{slots:O,nav:te,variant:I},provenance:C,facts:u.facts,computed:_t}}async function g(p,u,c){let f=[];for(let y of c.sections){let h=l(u,y.instanceId);h.enabled&&f.push((await m(p,u,c.id,h,void 0,{})).html)}return f}function v(p,u,c){let f=p.pages.find(y=>y.id===u);if(f===void 0)throw new w(c,`The template declares no page "${u}".`);return f}function A(p,u){if(p.output==="website")throw new w(404,`"${p.key}" is a website \u2014 captures are for rendered templates; open its pages live instead.`);let c=u===null?p.formats[0]:p.formats.find(f=>f.id===u);if(c===void 0)throw new w(404,`The template declares no format "${u??""}" (have: ${p.formats.map(f=>f.id).join(", ")}).`);return c}async function Te(){let p=await t.islands(),u={wire:1,islands:{map:{...p.map},hostScript:p.canvasHost,importMap:{...p.importMap}},stylesheets:[Ne.base,Ne.template].map(h=>n(h))},c,f;try{c=await t.template(),f=await t.fixtures()}catch(h){return{...u,template:{key:"",name:"",output:"website",formats:[],pages:[],canvases:[],instances:[]},fixtures:[],capabilities:{hmr:t.live,capture:!1},error:h instanceof Error?h.message:String(h)}}let y=f.problems!==void 0&&f.fixtures.length===0?`No fixture could be rendered:
160
- ${f.problems}`:void 0;return{...u,template:{key:c.key,name:c.name,output:c.output,formats:c.output==="website"?[]:c.formats.map(Aa),pages:c.pages.map(h=>({id:h.id,label:h.label,...h.path===void 0?{}:{path:h.path},instanceIds:h.sections.map(k=>k.instanceId)})),canvases:c.canvases.map(h=>({id:h.id,label:h.label,pages:[...h.pages]})),instances:c.instances.map(h=>({...h,display:tr(h.display)}))},fixtures:f.fixtures.map(ar),capabilities:{hmr:t.live,capture:c.output!=="website"&&t.capture!==void 0},...y===void 0?{}:{error:y}}}async function ee(p){if(p.method!=="POST")throw new w(405,`POST a render request to ${fe.render}.`);let u=await p.text();if(new TextEncoder().encode(u).byteLength>Ao)throw new w(413,`request body exceeds ${Ao} bytes`);let c;try{c=u===""?void 0:JSON.parse(u)}catch(O){throw new w(400,`request body is not JSON: ${O instanceof Error?O.message:String(O)}`)}if(c===void 0||typeof c.page!="string"||typeof c.instance!="string"||typeof c.fixture!="string")throw new w(400,"A render request names a page, an instance and a fixture.");let f=typeof c.session=="object"&&c.session!==null?c.session:{},y=rr(c.display),h=await t.template(),k=await a(c.fixture),x=v(h,c.page,400);return or(h,y),m(h,k,x.id,l(k,c.instance),f.slots,y)}async function be(p){let u=await a(Ge(p,"fixture","api/media"));return{items:So(u,n),contacts:Eo(u,n),lists:Ro(u)}}async function B(p,u){let c=await t.template();if(c.output!=="website")throw new w(404,`"${c.key}" is a rendered ${c.output} template and has no live pages \u2014 preview it on the canvas.`);let f=c.pages.find(k=>k.path===u);if(f===void 0){let k=c.pages.map(x=>x.path??x.id).join(", ");throw new w(404,`The template declares no page at "${u}" (have: ${k}).`)}let y=await a(p),h=await g(c,y,f);return we({destination:"preview",root:{kind:"plain",bodyHtml:h.join(`
161
- `)},islands:(await t.islands()).documentLoader,stylesheets:{kind:"links",hrefs:s()},title:`${c.name} - ${f.label}`,extraCss:["html, body { background: #fff; }"],...t.live?{devScripts:[ja(`${o}${fe.hmr}`)]}:{}})}function An(p,u,c){let f=v(p,c,404);if(!nt(u,f.id))throw new w(404,`The fixture "${u.id}" switches the page "${f.id}" off, so it has no capture.`);return f}async function Io(p){let u=G.frame,c=await t.template(),f=A(c,p.searchParams.get("format")),y=await a(Ge(p,"fixture",u)),h=An(c,y,Ge(p,"page",u));return we({destination:"artifact",root:{kind:"frame",format:f,sectionHtml:await g(c,y,h)},islands:(await t.islands()).documentLoader,stylesheets:{kind:"links",hrefs:s()},title:`${c.name} \u2014 ${h.id}`})}async function To(p){let u=await t.template(),c=A(u,p.searchParams.get("format"));if(u.output!=="document")throw new w(404,`"${u.key}" is an ${u.output} template \u2014 a PDF is for the document class; download its pages as a zip.`);let f=await a(Ge(p,"fixture",G.print)),y=[];for(let h of Ut(f,u.pages))y.push(await g(u,f,h));if(y.length===0)throw new w(404,`The fixture "${f.id}" switches every page off, so it has no PDF.`);return we({destination:"artifact",root:{kind:"frameStack",format:c,pages:y},islands:(await t.islands()).documentLoader,stylesheets:{kind:"links",hrefs:s()},title:`${u.name} \u2014 print`})}async function jo(p,u){let c=p;if(c!=="screenshot"&&c!=="bundle"&&c!=="print")throw new w(404,`There is no capture at ${u.pathname}.`);let f=Ge(u,"fixture",`api/capture/${c}`),y=await t.template(),h=A(y,u.searchParams.get("format")),k=await a(f),x,O,C;if(c==="screenshot"){let I=u.searchParams.get("page")??Ut(k,y.pages)[0]?.id;if(I===void 0)throw new w(404,`The fixture "${f}" leaves no page on.`);An(y,k,I),x={kind:c,fixture:f,format:h,documents:[{path:qt(f,I,h.id),page:I,name:`${I}.png`}]},O="image/png",C=`${y.key}-${I}-${h.id}.png`}else if(c==="bundle"){if(y.output!=="image")throw new w(404,`"${y.key}" is a ${y.output} template \u2014 the zip is for the image class; a document downloads its PDF.`);let I=u.searchParams.get("canvas"),je=I===null?y.canvases[0]:y.canvases.find(q=>q.id===I);if(je===void 0)throw new w(404,`The template declares no canvas "${I??""}".`);let Ye=je.pages.filter(q=>nt(k,q));if(Ye.length===0)throw new w(404,`The fixture "${f}" switches every page of the canvas "${je.id}" off, so it has no zip.`);let _t=Ye.map(q=>({path:qt(f,q,h.id),page:q,name:`${y.pages.find(Co=>Co.id===q)?.label||q}.png`}));x={kind:c,fixture:f,format:h,documents:_t},O="application/zip",C=`${y.key}-${h.id}.zip`}else{if(y.output!=="document")throw new w(404,`"${y.key}" is an ${y.output} template \u2014 a PDF is for the document class; download its pages as a zip.`);x={kind:c,fixture:f,format:h,documents:[{path:ur(f,h.id),page:null,name:`${y.key}.pdf`}]},O="application/pdf",C=`${y.key}.pdf`}if(t.capture===void 0)throw new w(501,"This playground has no captures to give.");let te=await t.capture(x);return new Response(new Uint8Array(te),{headers:{"content-type":O,"content-disposition":`attachment; filename="${encodeURIComponent(C)}"`}})}async function Po(p,u,c){if(c===fe.render)return $n(await ee(p));if(p.method!=="GET"&&p.method!=="HEAD"&&Pa(c))throw new w(405,`${c} only reads; the playground accepts no uploads and writes nothing.`);if(c===fe.catalog)return $n(await Te());if(c==="api/media")return $n(await be(u));if(c.startsWith("api/capture/"))return jo(c.slice(12),u);if(c===G.frame)return On(await Io(u));if(c===G.print)return On(await To(u));let[f,y,h,k,...x]=c.split("/").filter(Boolean);if(f==="fixtures"&&y!==void 0&&h==="live"){if(x.length>0)throw new w(404,`There is no route at ${u.pathname}.`);return On(await B(decodeURIComponent(y),k===void 0?"/":`/${decodeURIComponent(k)}`))}return null}return{async handle(p){let u=new URL(p.url);if(!u.pathname.startsWith(o)&&`${u.pathname}/`!==o)return null;let c=u.pathname.slice(o.length);try{return await Po(p,u,c)}catch(f){let y=Ta(f);if(y===null)throw f;return Ia(y,f instanceof Error?f.message:String(f))}}}}export{Yu as createHost};
159
+ </script>`}function Pa(e){if(e===fe.catalog||e==="api/media"||e.startsWith("api/capture/")||e===G.frame||e===G.print)return!0;let[t,n,r]=e.split("/").filter(Boolean);return t==="fixtures"&&n!==void 0&&r==="live"}function Gu(e){let{reader:t,assetUrl:n,renderer:r}=e,o=(e.base??"/").endsWith("/")?e.base??"/":`${e.base??"/"}/`,i=p=>/^([a-z][a-z0-9+.-]*:|\/)/i.test(p)?p:`${o}${p}`,s=()=>[Le.base,Le.template].map(p=>i(n(p)));async function a(p){let{fixtures:u}=await t.fixtures(),c=u.find(f=>f.id===p);if(c===void 0){let f=u.map(y=>y.id).join(", ")||"none";throw new w(404,`There is no fixture "${p}" (have: ${f}).`)}return c}function l(p,u){let c=p.instances.find(f=>f.instance_id===u);if(c===void 0)throw new w(400,`The composition places no instance "${u}".`);return c}function d(p,u,c,f,y){if(p.output!=="website")return{selfAnchor:f,anchors:Ln(),pages:[]};let h=or(u,y),_=p.pages.map(C=>({id:C.id,label:C.label,path:C.path??`/${C.id}`,sections:C.sections.map(te=>({key:te.section,anchor:te.section,enabled:h.get(te.instanceId)!==!1}))})),x=`${o}${fe.live(u.id,"/").replace(/\/$/,"")}`,O=lr({pages:_,currentPageId:c,basePath:x});return{selfAnchor:f,anchors:O.anchors,pages:O.pages}}async function m(p,u,c,f,y,h){let _=p.instances.find(q=>q.instanceId===f.instance_id);if(_===void 0)throw new Error(`The composition places no section "${f.section_key}".`);let x=ir(f,_.sectionSchema.slots,h),{slots:O,provenance:C}=await Eo({instance:x,slots:_.sectionSchema.slots,fixture:u,session:y,assetUrl:n}),te=d(p,u,c,x.section_key,h),I=x.variant,je=await r.section(x.section_key),Ge=r.renderToString(r.createElement(je,{slots:O,nav:te,variant:I??""}),{identifierPrefix:x.instance_id}),kt=$o(_.sectionSchema.slots,f.slots);return{html:Ge,resolvedProps:{slots:O,nav:te,variant:I},provenance:C,facts:u.facts,computed:kt}}async function g(p,u,c){let f=[];for(let y of c.sections){let h=l(u,y.instanceId);h.enabled&&f.push((await m(p,u,c.id,h,void 0,{})).html)}return f}function v(p,u,c){let f=p.pages.find(y=>y.id===u);if(f===void 0)throw new w(c,`The template declares no page "${u}".`);return f}function A(p,u){if(p.output==="website")throw new w(404,`"${p.key}" is a website \u2014 captures are for rendered templates; open its pages live instead.`);let c=u===null?p.formats[0]:p.formats.find(f=>f.id===u);if(c===void 0)throw new w(404,`The template declares no format "${u??""}" (have: ${p.formats.map(f=>f.id).join(", ")}).`);return c}async function Ie(){let p=await t.islands(),u={wire:1,islands:{map:{...p.map},hostScript:p.canvasHost,importMap:{...p.importMap}},stylesheets:[Le.base,Le.template].map(h=>n(h))},c,f;try{c=await t.template(),f=await t.fixtures()}catch(h){return{...u,template:{key:"",name:"",output:"website",formats:[],pages:[],canvases:[],instances:[]},fixtures:[],capabilities:{hmr:t.live,capture:!1},error:h instanceof Error?h.message:String(h)}}let y=f.problems!==void 0&&f.fixtures.length===0?`No fixture could be rendered:
160
+ ${f.problems}`:void 0;return{...u,template:{key:c.key,name:c.name,output:c.output,formats:c.output==="website"?[]:c.formats.map(Aa),pages:c.pages.map(h=>({id:h.id,label:h.label,...h.path===void 0?{}:{path:h.path},instanceIds:h.sections.map(_=>_.instanceId)})),canvases:c.canvases.map(h=>({id:h.id,label:h.label,pages:[...h.pages]})),instances:c.instances.map(h=>({...h,display:er(h.display)}))},fixtures:f.fixtures.map(sr),capabilities:{hmr:t.live,capture:c.output!=="website"&&t.capture!==void 0},...y===void 0?{}:{error:y}}}async function ee(p){if(p.method!=="POST")throw new w(405,`POST a render request to ${fe.render}.`);let u=await p.text();if(new TextEncoder().encode(u).byteLength>Oo)throw new w(413,`request body exceeds ${Oo} bytes`);let c;try{c=u===""?void 0:JSON.parse(u)}catch(O){throw new w(400,`request body is not JSON: ${O instanceof Error?O.message:String(O)}`)}if(c===void 0||typeof c.page!="string"||typeof c.instance!="string"||typeof c.fixture!="string")throw new w(400,"A render request names a page, an instance and a fixture.");let f=typeof c.session=="object"&&c.session!==null?c.session:{},y=nr(c.display),h=await t.template(),_=await a(c.fixture),x=v(h,c.page,400);return rr(h,y),m(h,_,x.id,l(_,c.instance),f.slots,y)}async function be(p){let u=await a(ze(p,"fixture","api/media"));return{items:vo(u,n),contacts:Ro(u,n),lists:So(u)}}async function B(p,u){let c=await t.template();if(c.output!=="website")throw new w(404,`"${c.key}" is a rendered ${c.output} template and has no live pages \u2014 preview it on the canvas.`);let f=c.pages.find(_=>_.path===u);if(f===void 0){let _=c.pages.map(x=>x.path??x.id).join(", ");throw new w(404,`The template declares no page at "${u}" (have: ${_}).`)}let y=await a(p),h=await g(c,y,f);return we({destination:"preview",root:{kind:"plain",bodyHtml:h.join(`
161
+ `)},islands:(await t.islands()).documentLoader,stylesheets:{kind:"links",hrefs:s()},title:`${c.name} - ${f.label}`,extraCss:["html, body { background: #fff; }"],...t.live?{devScripts:[Ta(`${o}${fe.hmr}`)]}:{}})}function On(p,u,c){let f=v(p,c,404);if(!nt(u,f.id))throw new w(404,`The fixture "${u.id}" switches the page "${f.id}" off, so it has no capture.`);return f}async function Ao(p){let u=G.frame,c=await t.template(),f=A(c,p.searchParams.get("format")),y=await a(ze(p,"fixture",u)),h=On(c,y,ze(p,"page",u));return we({destination:"artifact",root:{kind:"frame",format:f,sectionHtml:await g(c,y,h)},islands:(await t.islands()).documentLoader,stylesheets:{kind:"links",hrefs:s()},title:`${c.name} \u2014 ${h.id}`})}async function Io(p){let u=await t.template(),c=A(u,p.searchParams.get("format"));if(u.output!=="document")throw new w(404,`"${u.key}" is an ${u.output} template \u2014 a PDF is for the document class; download its pages as a zip.`);let f=await a(ze(p,"fixture",G.print)),y=[];for(let h of Ht(f,u.pages))y.push(await g(u,f,h));if(y.length===0)throw new w(404,`The fixture "${f.id}" switches every page off, so it has no PDF.`);return we({destination:"artifact",root:{kind:"frameStack",format:c,pages:y},islands:(await t.islands()).documentLoader,stylesheets:{kind:"links",hrefs:s()},title:`${u.name} \u2014 print`})}async function jo(p,u){let c=p;if(c!=="screenshot"&&c!=="bundle"&&c!=="print")throw new w(404,`There is no capture at ${u.pathname}.`);let f=ze(u,"fixture",`api/capture/${c}`),y=await t.template(),h=A(y,u.searchParams.get("format")),_=await a(f),x,O,C;if(c==="screenshot"){let I=u.searchParams.get("page")??Ht(_,y.pages)[0]?.id;if(I===void 0)throw new w(404,`The fixture "${f}" leaves no page on.`);On(y,_,I),x={kind:c,fixture:f,format:h,documents:[{path:Ut(f,I,h.id),page:I,name:`${I}.png`}]},O="image/png",C=`${y.key}-${I}-${h.id}.png`}else if(c==="bundle"){if(y.output!=="image")throw new w(404,`"${y.key}" is a ${y.output} template \u2014 the zip is for the image class; a document downloads its PDF.`);let I=u.searchParams.get("canvas"),je=I===null?y.canvases[0]:y.canvases.find(q=>q.id===I);if(je===void 0)throw new w(404,`The template declares no canvas "${I??""}".`);let Ge=je.pages.filter(q=>nt(_,q));if(Ge.length===0)throw new w(404,`The fixture "${f}" switches every page of the canvas "${je.id}" off, so it has no zip.`);let kt=Ge.map(q=>({path:Ut(f,q,h.id),page:q,name:`${y.pages.find(Po=>Po.id===q)?.label||q}.png`}));x={kind:c,fixture:f,format:h,documents:kt},O="application/zip",C=`${y.key}-${h.id}.zip`}else{if(y.output!=="document")throw new w(404,`"${y.key}" is an ${y.output} template \u2014 a PDF is for the document class; download its pages as a zip.`);x={kind:c,fixture:f,format:h,documents:[{path:dr(f,h.id),page:null,name:`${y.key}.pdf`}]},O="application/pdf",C=`${y.key}.pdf`}if(t.capture===void 0)throw new w(501,"This playground has no captures to give.");let te=await t.capture(x);return new Response(new Uint8Array(te),{headers:{"content-type":O,"content-disposition":`attachment; filename="${encodeURIComponent(C)}"`}})}async function To(p,u,c){if(c===fe.render)return En(await ee(p));if(p.method!=="GET"&&p.method!=="HEAD"&&Pa(c))throw new w(405,`${c} only reads; the playground accepts no uploads and writes nothing.`);if(c===fe.catalog)return En(await Ie());if(c==="api/media")return En(await be(u));if(c.startsWith("api/capture/"))return jo(c.slice(12),u);if(c===G.frame)return $n(await Ao(u));if(c===G.print)return $n(await Io(u));let[f,y,h,_,...x]=c.split("/").filter(Boolean);if(f==="fixtures"&&y!==void 0&&h==="live"){if(x.length>0)throw new w(404,`There is no route at ${u.pathname}.`);return $n(await B(decodeURIComponent(y),_===void 0?"/":`/${decodeURIComponent(_)}`))}return null}return{async handle(p){let u=new URL(p.url);if(!u.pathname.startsWith(o)&&`${u.pathname}/`!==o)return null;let c=u.pathname.slice(o.length);try{return await To(p,u,c)}catch(f){let y=ja(f);if(y===null)throw f;return Ia(y,f instanceof Error?f.message:String(f))}}}}export{Gu as createHost};