@homepages/concrete 3.0.0 → 4.0.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.
@@ -4,7 +4,7 @@
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <title>Playground</title>
7
- <script type="module" crossorigin src="./assets/index-B3eNADCe.js"></script>
7
+ <script type="module" crossorigin src="./assets/index-D1fwOGVK.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="./assets/index-CckS2ONm.css">
9
9
  </head>
10
10
  <body>
@@ -1,4 +1,4 @@
1
- var Xe=/^(\d+(?:\.\d+)?)(in|mm)$/;function Y(e){let t=Xe.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 N(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};let t=e,n=Y(t.width),r=Y(t.height),o=t.bleed===void 0?0:Y(t.bleed),l=n*96,u=r*96,d=o*96,a=l+2*d,h=u+2*d,v=t.dpi/96;return{frameWidth:l,frameHeight:u,bleed:d,viewportWidth:a,viewportHeight:h,deviceScaleFactor:v,pixelWidth:Math.round(a*v),pixelHeight:Math.round(h*v),pointWidth:(n+2*o)*72,pointHeight:(r+2*o)*72,bleedPoints:o*72}}var $="tr-frame";function O(e){let t=N(e);return{"--frame-w":`${t.frameWidth}px`,"--frame-h":`${t.frameHeight}px`,"--frame-bleed":`${t.bleed}px`}}var J=`(function () {
1
+ var Ke=/^(\d+(?:\.\d+)?)(in|mm)$/;function X(e){let t=Ke.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 O(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};let t=e,n=X(t.width),r=X(t.height),o=t.bleed===void 0?0:X(t.bleed),s=n*96,u=r*96,d=o*96,a=s+2*d,h=u+2*d,v=t.dpi/96;return{frameWidth:s,frameHeight:u,bleed:d,viewportWidth:a,viewportHeight:h,deviceScaleFactor:v,pixelWidth:Math.round(a*v),pixelHeight:Math.round(h*v),pointWidth:(n+2*o)*72,pointHeight:(r+2*o)*72,bleedPoints:o*72}}var C="concrete-frame";function N(e){let t=O(e);return{"--frame-w":`${t.frameWidth}px`,"--frame-h":`${t.frameHeight}px`,"--frame-bleed":`${t.bleed}px`}}var K=`(function () {
2
2
  function CaptureIntersectionObserver(callback, options) {
3
3
  var opts = options || {};
4
4
  this.root = opts.root || null;
@@ -46,23 +46,23 @@ var Xe=/^(\d+(?:\.\d+)?)(in|mm)$/;function Y(e){let t=Xe.exec(e),[,n,r]=t??[];if
46
46
  return entries;
47
47
  };
48
48
  window.IntersectionObserver = CaptureIntersectionObserver;
49
- })();`;var K="__trIslandsReady",Ke=`(async () => {
50
- const ready = window.${K};
49
+ })();`;var J="__trIslandsReady",Ze=`(async () => {
50
+ const ready = window.${J};
51
51
  if (ready === undefined) {
52
52
  throw new Error(
53
53
  "capture blocked: the page ships island markers but its host published no " +
54
- "window.${K} \u2014 the island runtime never ran",
54
+ "window.${J} \u2014 the island runtime never ran",
55
55
  );
56
56
  }
57
57
  await ready;
58
- })()`;var le=400;var Je=`(async () => {
58
+ })()`;var le=400;var et=`(async () => {
59
59
  await new Promise((resolve) => {
60
60
  setTimeout(resolve, ${le});
61
61
  });
62
62
  await new Promise((resolve) => {
63
63
  requestAnimationFrame(() => resolve(undefined));
64
64
  });
65
- })()`,ce=5,Qe=`(async () => {
65
+ })()`,ce=5,tt=`(async () => {
66
66
  const frame = () => new Promise((resolve) => {
67
67
  requestAnimationFrame(() => resolve(undefined));
68
68
  });
@@ -83,14 +83,14 @@ var Xe=/^(\d+(?:\.\d+)?)(in|mm)$/;function Y(e){let t=Xe.exec(e),[,n,r]=t??[];if
83
83
  await frame();
84
84
  }
85
85
  await frame();
86
- })()`;function M(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function y(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function de(e){return ue(e.id,{...O(e)})}function ue(e,t){let n=Object.entries(t).map(([r,o])=>`${r}:${o}`).join(";");return{class:$,dataFormat:e,style:n}}function L(e,t){let n=de(e);return`<div class="${y(n.class)}" data-format="${y(n.dataFormat)}" style="${y(n.style)}">${t.join("")}</div>`}function C(e){switch(e.destination){case"published":return Ze(e);case"artifact":return et(e);case"preview":return tt(e);case"diff":return nt(e)}}function pe(e){return e.kind==="none"||Object.keys(e.islandMap).length===0?[]:[`<script>${J}</script>`]}var me="html, body { margin: 0; padding: 0; }";function fe(e){let t=[`rel="${e.rel}"`,`href="${y(e.href)}"`];return e.sizes!==void 0&&t.push(`sizes="${y(e.sizes)}"`),e.type!==void 0&&t.push(`type="${y(e.type)}"`),`<link ${t.join(" ")} />`}function Ze(e){let{meta:t}=e,n=['<meta charset="utf-8" />','<meta name="viewport" content="width=device-width, initial-scale=1" />',`<title>${y(t.title)}</title>`,`<meta name="description" content="${y(t.description)}" />`];t.canonical&&n.push(`<link rel="canonical" href="${y(t.canonical)}" />`);for(let o of t.icons??[])n.push(fe(o));n.push('<meta property="og:type" content="website" />'),t.siteName&&n.push(`<meta property="og:site_name" content="${y(t.siteName)}" />`),n.push(`<meta property="og:title" content="${y(t.title)}" />`),n.push(`<meta property="og:description" content="${y(t.description)}" />`),t.ogUrl&&n.push(`<meta property="og:url" content="${y(t.ogUrl)}" />`),t.ogImage&&(n.push(`<meta property="og:image" content="${y(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="${y(t.ogImageType)}" />`),t.ogImageAlt&&n.push(`<meta property="og:image:alt" content="${y(t.ogImageAlt)}" />`),n.push('<meta name="twitter:card" content="summary_large_image" />'),n.push(`<meta name="twitter:title" content="${y(t.title)}" />`),n.push(`<meta name="twitter:description" content="${y(t.description)}" />`),n.push(`<meta name="twitter:image" content="${y(t.ogImage)}" />`)),n.push(...q(e.stylesheets)),n.push(...Z(e.islands)),e.prefetchUrls&&e.prefetchUrls.length>0&&n.push(`<script type="speculationrules">${M({prefetch:[{source:"list",urls:[...e.prefetchUrls]}]})}</script>`);let r=e.siteConfig?`
87
- <script type="application/json" id="tr-site-config">${M(e.siteConfig)}</script>`:"";return j({lang:t.lang??"en",head:n,body:` <body class="tr-root">
88
- ${e.root.bodyHtml}${r}${ee(e.islands,"viewport")}
86
+ })()`;function M(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function y(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}var de="tr-frame",ue="tr-root",pe="tr-site-config";function me(e){return fe(e.id,{...N(e)})}function fe(e,t){let n=Object.entries(t).map(([r,o])=>`${r}:${o}`).join(";");return{class:`${C} ${de}`,dataFormat:e,style:n}}function L(e,t){let n=me(e);return`<div class="${y(n.class)}" data-format="${y(n.dataFormat)}" style="${y(n.style)}">${t.join("")}</div>`}var nt="concrete-root",rt="concrete-site-config";function $(e){switch(e.destination){case"published":return ot(e);case"artifact":return it(e);case"preview":return at(e);case"diff":return st(e)}}function ge(e){return e.kind==="none"||Object.keys(e.islandMap).length===0?[]:[`<script>${K}</script>`]}var ye="html, body { margin: 0; padding: 0; }";function he(e){let t=[`rel="${e.rel}"`,`href="${y(e.href)}"`];return e.sizes!==void 0&&t.push(`sizes="${y(e.sizes)}"`),e.type!==void 0&&t.push(`type="${y(e.type)}"`),`<link ${t.join(" ")} />`}function ot(e){let{meta:t}=e,n=['<meta charset="utf-8" />','<meta name="viewport" content="width=device-width, initial-scale=1" />',`<title>${y(t.title)}</title>`,`<meta name="description" content="${y(t.description)}" />`];t.canonical&&n.push(`<link rel="canonical" href="${y(t.canonical)}" />`);for(let s of t.icons??[])n.push(he(s));n.push('<meta property="og:type" content="website" />'),t.siteName&&n.push(`<meta property="og:site_name" content="${y(t.siteName)}" />`),n.push(`<meta property="og:title" content="${y(t.title)}" />`),n.push(`<meta property="og:description" content="${y(t.description)}" />`),t.ogUrl&&n.push(`<meta property="og:url" content="${y(t.ogUrl)}" />`),t.ogImage&&(n.push(`<meta property="og:image" content="${y(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="${y(t.ogImageType)}" />`),t.ogImageAlt&&n.push(`<meta property="og:image:alt" content="${y(t.ogImageAlt)}" />`),n.push('<meta name="twitter:card" content="summary_large_image" />'),n.push(`<meta name="twitter:title" content="${y(t.title)}" />`),n.push(`<meta name="twitter:description" content="${y(t.description)}" />`),n.push(`<meta name="twitter:image" content="${y(t.ogImage)}" />`)),n.push(...q(e.stylesheets)),n.push(...Z(e.islands)),e.prefetchUrls&&e.prefetchUrls.length>0&&n.push(`<script type="speculationrules">${M({prefetch:[{source:"list",urls:[...e.prefetchUrls]}]})}</script>`);let r=e.siteConfig?M(e.siteConfig):null,o=r===null?"":[rt,pe].map(s=>`
87
+ <script type="application/json" id="${s}">${r}</script>`).join("");return j({lang:t.lang??"en",head:n,body:` <body class="${nt} ${ue}">
88
+ ${e.root.bodyHtml}${o}${ee(e.islands,"viewport")}
89
89
  <script type="module" src="${y(e.analyticsJs.url)}"></script>
90
- </body>`})}function et(e){let t=['<meta charset="utf-8" />'];e.title!==void 0&&t.push(`<title>${y(e.title)}</title>`),t.push(...q(e.stylesheets));let n=[me,...ot(e.root)];return t.push(Q(n)),t.push(...pe(e.islands)),t.push(...Z(e.islands)),j({lang:"en",head:t,body:` <body>${rt(e.root)}${ee(e.islands,"eager")}</body>`})}function tt(e){let t=['<meta charset="utf-8" />','<meta name="viewport" content="width=device-width, initial-scale=1" />',`<title>${y(e.title)}</title>`,...e.icon===void 0?[]:[fe({rel:"icon",href:e.icon})],...q(e.stylesheets),Q([me,...e.extraCss??[]]),...e.capture===!0?pe(e.islands):[],...Z(e.islands)],n=(e.devScripts??[]).map(r=>`
90
+ </body>`})}function it(e){let t=['<meta charset="utf-8" />'];e.title!==void 0&&t.push(`<title>${y(e.title)}</title>`),t.push(...q(e.stylesheets));let n=[ye,...ct(e.root)];return t.push(Q(n)),t.push(...ge(e.islands)),t.push(...Z(e.islands)),j({lang:"en",head:t,body:` <body>${lt(e.root)}${ee(e.islands,"eager")}</body>`})}function at(e){let t=['<meta charset="utf-8" />','<meta name="viewport" content="width=device-width, initial-scale=1" />',`<title>${y(e.title)}</title>`,...e.icon===void 0?[]:[he({rel:"icon",href:e.icon})],...q(e.stylesheets),Q([ye,...e.extraCss??[]]),...e.capture===!0?ge(e.islands):[],...Z(e.islands)],n=(e.devScripts??[]).map(r=>`
91
91
  ${r}`).join("");return j({lang:"en",head:t,body:` <body>
92
92
  ${e.root.bodyHtml}${ee(e.islands,e.capture===!0?"eager":"viewport")}${n}
93
- </body>`})}function nt(e){let t=['<meta charset="utf-8" />',`<meta name="viewport" content="width=${e.viewportWidth}, initial-scale=1" />`,`<title>${y(e.title)}</title>`,...q(e.stylesheets),Q([`html, body { margin: 0; padding: 0; width: ${e.viewportWidth}px; }`])];return j({lang:"en",head:t,body:` <body>${e.root.bodyHtml}</body>`})}function j(e){let t=e.head.map(n=>` ${n}`).join(`
93
+ </body>`})}function st(e){let t=['<meta charset="utf-8" />',`<meta name="viewport" content="width=${e.viewportWidth}, initial-scale=1" />`,`<title>${y(e.title)}</title>`,...q(e.stylesheets),Q([`html, body { margin: 0; padding: 0; width: ${e.viewportWidth}px; }`])];return j({lang:"en",head:t,body:` <body>${e.root.bodyHtml}</body>`})}function j(e){let t=e.head.map(n=>` ${n}`).join(`
94
94
  `);return`<!doctype html>
95
95
  <html lang="${y(e.lang)}">
96
96
  <head>
@@ -98,22 +98,22 @@ ${t}
98
98
  </head>
99
99
  ${e.body}
100
100
  </html>
101
- `}function rt(e){return e.kind==="frame"?L(e.format,e.sectionHtml):e.pages.map(t=>L(e.format,t)).join(`
102
- `)}function ot(e){return e.kind!=="frameStack"?[]:[`body > .${$} { break-after: page; }`,`body > .${$}:last-child { break-after: auto; }`]}function q(e){return e.kind==="links"?e.hrefs.map(t=>`<link rel="stylesheet" href="${y(t)}" />`):e.css.map(t=>`<style>${t}</style>`)}function Q(e){let[t,...n]=e;return t===void 0?"<style></style>":n.length===0?`<style>${t}</style>`:`<style>${t}
101
+ `}function lt(e){return e.kind==="frame"?L(e.format,e.sectionHtml):e.pages.map(t=>L(e.format,t)).join(`
102
+ `)}function ct(e){return e.kind!=="frameStack"?[]:[`body > .${C} { break-after: page; }`,`body > .${C}:last-child { break-after: auto; }`]}function q(e){return e.kind==="links"?e.hrefs.map(t=>`<link rel="stylesheet" href="${y(t)}" />`):e.css.map(t=>`<style>${t}</style>`)}function Q(e){let[t,...n]=e;return t===void 0?"<style></style>":n.length===0?`<style>${t}</style>`:`<style>${t}
103
103
  ${n.join(`
104
104
  `)}
105
105
  </style>`}function Z(e){if(e.kind!=="bundles")return[];let t=[],n=e.reactVendorMap;if(n&&Object.keys(n).length>0&&t.push(`<script type="importmap">${M({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="${y(r)}" />`);return t}function ee(e,t){if(e.kind==="none"||Object.keys(e.islandMap).length===0)return"";let n=M(e.islandMap),r=t==="eager"?' window.__TR_ISLAND_SCHEDULE = "eager";':"";return e.kind==="bundles"?`
106
106
  <script>window.__TR_ISLAND_MAP=${n};${r}</script>
107
107
  <script type="module" src="${y(e.runtime.url)}"></script>`:`
108
- ${it}
108
+ ${dt}
109
109
  <script>window.__TR_ISLAND_MAP = ${n};${r}</script>
110
- <script type="module" src="${y(e.bootstrapUrl)}"></script>`}var it=`<script type="module">
110
+ <script type="module" src="${y(e.bootstrapUrl)}"></script>`}var dt=`<script type="module">
111
111
  import RefreshRuntime from "/@react-refresh";
112
112
  RefreshRuntime.injectIntoGlobalHook(window);
113
113
  window.$RefreshReg$ = () => {};
114
114
  window.$RefreshSig$ = () => (type) => type;
115
115
  window.__vite_plugin_react_preamble_installed__ = true;
116
- </script>`;function ge(){let e={};return new Proxy(e,{get:(t,n)=>typeof n!="string"||n in e||n==="then"||n==="toJSON"?e[n]:`#${n}`})}function ye(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 T={catalog:"api/catalog",render:"api/render",media:e=>`api/media${ye({fixture:e})}`,capture:(e,t)=>`api/capture/${e}${ye({fixture:t.fixture,format:t.format,page:t.page,canvas:t.canvas})}`,live:(e,t)=>`fixtures/${encodeURIComponent(e)}/live${t==="/"?"/":`${t}/`}`,hmr:"__hmr"};var g=class extends Error{constructor(n,r){super(r);this.status=n}status};function at(e){return e.split("-").map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}function he(e){let{variant:t}=e;return{required:e.required,variant:t===null?null:{cases:t.cases.map(n=>({value:n,label:at(n)})),locked:t.locked}}}function _e(e){return Object.fromEntries(e.map(t=>[t.instance_id,{enabled:t.enabled,...t.variant===void 0?{}:{variant:t.variant}}]))}function be(e){if(e==null)return{};if(typeof e!="object"||Array.isArray(e))throw new g(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 g(400,`The display state of "${n}" is not an object.`);let{enabled:o,variant:l}=r;if(o!==void 0&&typeof o!="boolean")throw new g(400,`The display state of "${n}" has a non-boolean enabled.`);if(l!==void 0&&typeof l!="string")throw new g(400,`The display state of "${n}" has a non-string variant.`);t[n]={...o===void 0?{}:{enabled:o},...l===void 0?{}:{variant:l}}}return t}function ve(e,t){for(let[n,r]of Object.entries(t)){let o=e.instances.find(u=>u.instanceId===n);if(o===void 0)throw new g(400,`The composition places no instance "${n}".`);if(r.enabled===!1&&o.display.required)throw new g(400,`Section instance "${n}" is required and cannot be hidden.`);if(r.variant===void 0)continue;let l=o.display.variant;if(l===null)throw new g(400,`Section instance "${n}" declares no display variant.`);if(l.locked)throw new g(400,`Section instance "${n}" declares a locked variant, which the user cannot switch.`);if(!l.cases.includes(r.variant))throw new g(400,`"${r.variant}" is not a declared case of section instance "${n}" (declared: ${l.cases.join(", ")}).`)}}function we(e,t){return new Map(e.instances.map(n=>[n.instance_id,t[n.instance_id]?.enabled??n.enabled]))}function xe(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[l,u]of Object.entries(t))l in o||(u.variant===void 0||u.variant.cases.includes(r))&&(o[l]=u.type==="list"?[]:null);return{...e,variant:r,slots:o}}function Re(e){return Array.isArray(e)?e.length:0}function Se(e){return typeof e=="string"&&e!==""?e:null}function st(e){return{propertyType:Se(e.property_type),listingIntent:Se(e.listing_intent),units:Re(e.units),photos:Re(e.photos)}}function lt(e){let t=JSON.stringify(e),n=3735928559,r=1103547991;for(let o=0;o<t.length;o++){let l=t.charCodeAt(o);n=Math.imul(n^l,2654435761),r=Math.imul(r^l,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 ke(e){return{id:e.id,label:e.label,summary:st(e.facts),doc:lt(e.instances),display:_e(e.instances)}}function Ie(e,t){let n=e.replace(/\/+$/,"");return t==="/"?`${n}/`:`${n}${t}/`}function Pe(e){let{pages:t,currentPageId:n,basePath:r}=e,o=t.find(d=>d.id===n);if(!o)throw new Error(`nav: page "${n}" is not one of the declared pages (${t.map(d=>d.id).join(", ")}).`);let l=[o,...t.filter(d=>d.id!==o.id&&d.enabled!==!1)],u={};for(let d of l)for(let a of d.sections)a.enabled===!1||a.key in u||(u[a.key]=d.id===o.id?`#${a.anchor}`:`${Ie(r,d.path)}#${a.anchor}`);return{anchors:u,pages:t.filter(d=>d.enabled!==!1).map(d=>({id:d.id,label:d.label,href:Ie(r,d.path),current:d.id===o.id}))}}function W(e,t){return e.pages?.[t]?.enabled!==!1}function te(e,t){return t.filter(n=>W(e,n.id))}var D={base:"stylesheets/base.css",template:"stylesheets/template.css"},k={frame:"__capture/frame",print:"__capture/print"};function Ee(e){return new URLSearchParams(e).toString()}function ne(e,t,n){return`${k.frame}?${Ee({fixture:e,page:t,format:n})}`}function Te(e,t){return`${k.print}?${Ee({fixture:e,format:t})}`}var ct=["text","number","select","image","list","poi","url","video","tour","document"],dt=[],wn=[...ct,...dt];var ut=["address","type","intent","describe","uploads","units","comparables","contacts"];var pt={address:"always",type:"always",intent:"always",describe:"always",uploads:"always",units:"derived",comparables:"derived",contacts:"derived"},xn=ut.filter(e=>pt[e]==="always");var mt={matterport:{kind:"tour",label:"Matterport",pattern:/(^|\.)matterport\.com$/i,strategy:"api"},biganto:{kind:"tour",label:"Biganto",pattern:/(^|\.)biganto\.com$/i,strategy:"opengraph"},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 $e(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(mt))if(r.pattern.test(t.hostname)&&!(r.path&&!r.path.test(t.pathname)))return n;return null}var ft="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 Ce(e){let t=e.trim();if(!t)return null;let n=$e(t);if(n==="vimeo"){let r=t.match(/vimeo\.com\/(?:.*\/)?(\d+)/);return r?`https://player.vimeo.com/video/${r[1]}?${ft}`: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 Ae(e){let t=e.trim();if(!t)return null;let n=$e(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==="biganto"?t:null}var V=e=>e<0?0:e>1?1:e;function F(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(a=>typeof a=="number"&&Number.isFinite(a)))return null;let l=V(t),u=V(n),d={nx:l,ny:u,nw:Math.min(V(r),1-l),nh:Math.min(V(o),1-u)};return d.nw<=0||d.nh<=0||d.nx===0&&d.ny===0&&d.nw===1&&d.nh===1?null:d}var z={file(e){return typeof e=="string"?{url:e,responsive:null}:{url:e.url,responsive:e.responsive}}};function gt(e){if(typeof e!="object"||e===null)return null;let t=e.asset_id;return typeof t=="string"&&t!==""?t:null}function yt(e,t,n){if(e.file===null)return null;let r=n.crop===void 0?null:F(t.rect),o=n.crop===void 0?null:F(t.mobile_rect),l=n.file(e.file),u=r===null?{photo_id:e.id,url:l.url,alt:e.alt,responsive:l.responsive}:{photo_id:e.id,url:n.crop(e.file,r),alt:e.alt,responsive:null,rect:r};return o!==null&&(u.mobile={url:n.crop(e.file,o),responsive:null}),u}function He(e,t){if(e.posterFile!==void 0){let n=t.file(e.posterFile);return n.responsive===null?{poster:n.url}:{poster:n.url,poster_responsive:n.responsive}}return{poster:e.posterUrl??""}}function ht(e,t){let n=He(e,t);return e.file===null?{video_id:e.id,url:Ce(e.url??"")??"",...n,alt:e.alt,source:"link",...e.provider===null?{}:{provider:e.provider}}:{video_id:e.id,url:t.file(e.file).url,...n,alt:e.alt,source:"upload"}}function _t(e,t){return{tour_id:e.id,url:Ae(e.url??"")??"",...He(e,t),alt:e.alt,...e.provider===null?{}:{provider:e.provider}}}function bt(e,t){return e.file===null?null:{asset_id:e.id,url:t.file(e.file).url,filename:e.filename,content_type:e.mime,size_bytes:0}}function vt(e,t,n,r){let o=gt(t),l=o===null?void 0:n.get(o);if(l===void 0||l.kind!==e)return null;switch(e){case"image":return yt(l,t,r);case"video":return ht(l,r);case"tour":return _t(l,r);case"document":return bt(l,r);default:return null}}var wt=new Set(["image","video","tour","document"]),xt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function Rt(e,t,n){let r=typeof e.id=="string"?e.id:"",o=typeof e.floor_label=="string"?e.floor_label:null,l=r===""?void 0:t.get(r),u=l?.kind==="image"&&l.file!==null?n.file(l.file):null;return{id:r,...typeof e.upload_id=="string"?{upload_id:e.upload_id}:{},url:u?.url??"",alt:o??"Floor plan",floor_label:o,position:typeof e.position=="number"?e.position:0,...u?.responsive?{responsive:u.responsive}:{}}}function St(e,t,n,r){return e.type==="image"&&Array.isArray(t)?t.filter(xt).map(o=>Rt(o,n,r)):re(e,t,n,r)}function re(e,t,n,r){if(t==null)return t;if(wt.has(e.type))return vt(e.type,t,n,r);if(e.type!=="list"||!Array.isArray(t))return t;let o=t;if(e.fields!==void 0){let l=e.fields;return o.map(u=>{if(typeof u!="object"||u===null)return u;let d={...u};for(let[a,h]of Object.entries(l))d[a]=St(h,d[a],n,r);return d})}if(e.element!==void 0){let l=e.element;return o.map(u=>re(l,u,n,r))}return o}function Ne(e,t,n,r=z){let o={};for(let[l,u]of Object.entries(e.slots)){let d=t.schema.slots[l];o[l]=d===void 0?u:re(d,u,n,r)}return o}function Oe(e){return typeof e=="string"?e:e.url}function kt(e,t){return e.split(",").map(n=>{let[r="",...o]=n.trim().split(/\s+/);return[t(r),...o].join(" ")}).join(", ")}function It(e){return{file(t){let n=z.file(t),r=n.responsive===null?null:{...n.responsive,sources:n.responsive.sources.map(o=>({...o,srcset:kt(o.srcset,e)}))};return{url:e(n.url),responsive:r}},crop(t,n){return e(z.file(t).url,{crop:n})}}}function A(e){return Array.isArray(e)?e:[]}function Me(e,t){let{facts:n}=e,r=a=>e.media[a],o=a=>a?.file===null||a?.file===void 0?"":t(Oe(a.file)),l=a=>a?.posterFile!==void 0?t(Oe(a.posterFile)):a?.posterUrl??"",u=[];for(let a of A(n.photos)){let h=r(a.id);u.push({id:a.id,kind:"photo",name:h?.filename||a.id,size:"",src:o(h),caption:a.caption??null})}for(let a of A(n.floor_plans)){let h=r(a.id);u.push({id:a.id,kind:"plan",name:h?.filename||a.id,size:"",src:o(h)})}for(let a of A(n.videos)){let h=a.provider??void 0;u.push({id:a.id,kind:"video",name:a.caption??r(a.id)?.filename??a.id,size:"",src:l(r(a.id)),caption:a.caption??null,ready:!0,durationMs:a.duration_ms??null,...h===void 0?{}:{provider:h}})}for(let a of A(n.tours))u.push({id:a.id,kind:"tour",name:`${a.provider??"Tour"} ${a.id}`,size:"",src:l(r(a.id)),ready:!0,provider:a.provider??""});for(let a of A(n.documents)){let h=r(a.id)?.sizeBytes;u.push({id:a.id,kind:"document",name:a.filename??a.id,size:"",src:"",mime:a.mime??"",...h===void 0?{}:{sizeBytes:h}})}let d=[["avatar_upload_id","headshot"],["logo_dark_upload_id","logo (dark)"],["logo_light_upload_id","logo (light)"]];for(let a of A(n.contacts)){let h=typeof a.name=="string"?a.name:"Contact";for(let[v,E]of d){let S=a[v];typeof S=="string"&&u.push({id:S,kind:"library",name:`${h} \u2014 ${E}`,size:"",src:o(r(S)),caption:h})}}return u}var Pt={image:["photo_id","asset_id"],video:["video_id","asset_id"],tour:["tour_id","asset_id"],document:["asset_id"]};function Et(e){return e.filter(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)).map(({id:t,upload_id:n,floor_label:r,position:o})=>({id:typeof t=="string"?t:"",...typeof n=="string"?{upload_id:n}:{},floor_label:typeof r=="string"?r:null,position:typeof o=="number"?o:0}))}function oe(e,t){if(t==null)return t;let n=Pt[e.type];if(n!==void 0){if(typeof t!="object")return null;let o=t,l=n.map(a=>o[a]).find(a=>typeof a=="string"&&a!=="");if(typeof l!="string")return null;if(e.type!=="image")return{asset_id:l};let u=F(o.rect),d=typeof o.mobile=="object"&&o.mobile!==null?F(o.mobile.rect):null;return{asset_id:l,...u===null?{}:{rect:u},...d===null?{}:{mobile_rect:d}}}if(e.type!=="list"||!Array.isArray(t))return t;let r=t;if(e.fields!==void 0){let o=e.fields;return r.map(l=>{if(typeof l!="object"||l===null)return l;let u={...l};for(let[d,a]of Object.entries(o))d in u&&(u[d]=a.type==="image"&&Array.isArray(u[d])?Et(u[d]):oe(a,u[d]));return u})}if(e.element!==void 0){let o=e.element;return r.map(l=>oe(o,l))}return r}function De(e){let{instance:t,slots:n,fixture:r,session:o,assetUrl:l}=e,u={...t.slots},d={},a=r.provenance[t.instance_id]??{};for(let v of Object.keys(n))d[v]=a[v]??{kind:"empty"};for(let[v,E]of Object.entries(o??{})){let S=n[v];S!==void 0&&(u[v]=oe(S,E),d[v]={kind:"session"})}let h=new Map(Object.entries(r.media));return{slots:Ne({...t,slots:u},{schema:{slots:n}},h,It(l)),provenance:d}}var Fe=1024*1024;function $t(e){let t=N(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:{...O(e)}}}function Ct(e,t){return new Response(t,{status:e,headers:{"content-type":"text/plain; charset=utf-8"}})}function ie(e){return new Response(JSON.stringify(e),{headers:{"content-type":"application/json; charset=utf-8"}})}function ae(e){return new Response(e,{headers:{"content-type":"text/html; charset=utf-8"}})}function At(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 U(e,t,n){let r=e.searchParams.get(t);if(r===null||r==="")throw new g(400,`${n} needs a ${t} parameter.`);return r}function Ht(e){return`<script>
116
+ </script>`;function _e(){let e={};return new Proxy(e,{get:(t,n)=>typeof n!="string"||n in e||n==="then"||n==="toJSON"?e[n]:`#${n}`})}function be(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 T={catalog:"api/catalog",render:"api/render",media:e=>`api/media${be({fixture:e})}`,capture:(e,t)=>`api/capture/${e}${be({fixture:t.fixture,format:t.format,page:t.page,canvas:t.canvas})}`,live:(e,t)=>`fixtures/${encodeURIComponent(e)}/live${t==="/"?"/":`${t}/`}`,hmr:"__hmr"};var g=class extends Error{constructor(n,r){super(r);this.status=n}status};function ut(e){return e.split("-").map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}function ve(e){let{variant:t}=e;return{required:e.required,variant:t===null?null:{cases:t.cases.map(n=>({value:n,label:ut(n)})),locked:t.locked}}}function we(e){return Object.fromEntries(e.map(t=>[t.instance_id,{enabled:t.enabled,...t.variant===void 0?{}:{variant:t.variant}}]))}function xe(e){if(e==null)return{};if(typeof e!="object"||Array.isArray(e))throw new g(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 g(400,`The display state of "${n}" is not an object.`);let{enabled:o,variant:s}=r;if(o!==void 0&&typeof o!="boolean")throw new g(400,`The display state of "${n}" has a non-boolean enabled.`);if(s!==void 0&&typeof s!="string")throw new g(400,`The display state of "${n}" has a non-string variant.`);t[n]={...o===void 0?{}:{enabled:o},...s===void 0?{}:{variant:s}}}return t}function Re(e,t){for(let[n,r]of Object.entries(t)){let o=e.instances.find(u=>u.instanceId===n);if(o===void 0)throw new g(400,`The composition places no instance "${n}".`);if(r.enabled===!1&&o.display.required)throw new g(400,`Section instance "${n}" is required and cannot be hidden.`);if(r.variant===void 0)continue;let s=o.display.variant;if(s===null)throw new g(400,`Section instance "${n}" declares no display variant.`);if(s.locked)throw new g(400,`Section instance "${n}" declares a locked variant, which the user cannot switch.`);if(!s.cases.includes(r.variant))throw new g(400,`"${r.variant}" is not a declared case of section instance "${n}" (declared: ${s.cases.join(", ")}).`)}}function Se(e,t){return new Map(e.instances.map(n=>[n.instance_id,t[n.instance_id]?.enabled??n.enabled]))}function ke(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[s,u]of Object.entries(t))s in o||(u.variant===void 0||u.variant.cases.includes(r))&&(o[s]=u.type==="list"?[]:null);return{...e,variant:r,slots:o}}function Ie(e){return Array.isArray(e)?e.length:0}function Ee(e){return typeof e=="string"&&e!==""?e:null}function pt(e){return{propertyType:Ee(e.property_type),listingIntent:Ee(e.listing_intent),units:Ie(e.units),photos:Ie(e.photos)}}function mt(e){let t=JSON.stringify(e),n=3735928559,r=1103547991;for(let o=0;o<t.length;o++){let s=t.charCodeAt(o);n=Math.imul(n^s,2654435761),r=Math.imul(r^s,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 Pe(e){return{id:e.id,label:e.label,summary:pt(e.facts),doc:mt(e.instances),display:we(e.instances)}}function Te(e,t){let n=e.replace(/\/+$/,"");return t==="/"?`${n}/`:`${n}${t}/`}function Ce(e){let{pages:t,currentPageId:n,basePath:r}=e,o=t.find(d=>d.id===n);if(!o)throw new Error(`nav: page "${n}" is not one of the declared pages (${t.map(d=>d.id).join(", ")}).`);let s=[o,...t.filter(d=>d.id!==o.id&&d.enabled!==!1)],u={};for(let d of s)for(let a of d.sections)a.enabled===!1||a.key in u||(u[a.key]=d.id===o.id?`#${a.anchor}`:`${Te(r,d.path)}#${a.anchor}`);return{anchors:u,pages:t.filter(d=>d.enabled!==!1).map(d=>({id:d.id,label:d.label,href:Te(r,d.path),current:d.id===o.id}))}}function W(e,t){return e.pages?.[t]?.enabled!==!1}function te(e,t){return t.filter(n=>W(e,n.id))}var D={base:"stylesheets/base.css",template:"stylesheets/template.css"},k={frame:"__capture/frame",print:"__capture/print"};function $e(e){return new URLSearchParams(e).toString()}function ne(e,t,n){return`${k.frame}?${$e({fixture:e,page:t,format:n})}`}function Ae(e,t){return`${k.print}?${$e({fixture:e,format:t})}`}var ft=["text","number","select","image","list","poi","url","video","tour","document"],gt=[],Tn=[...ft,...gt];var yt=["address","type","intent","describe","uploads","units","comparables","contacts"];var ht={address:"always",type:"always",intent:"always",describe:"always",uploads:"always",units:"derived",comparables:"derived",contacts:"derived"},Cn=yt.filter(e=>ht[e]==="always");var _t={matterport:{kind:"tour",label:"Matterport",pattern:/(^|\.)matterport\.com$/i,strategy:"api"},biganto:{kind:"tour",label:"Biganto",pattern:/(^|\.)biganto\.com$/i,strategy:"opengraph"},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 He(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(_t))if(r.pattern.test(t.hostname)&&!(r.path&&!r.path.test(t.pathname)))return n;return null}var bt="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 Oe(e){let t=e.trim();if(!t)return null;let n=He(t);if(n==="vimeo"){let r=t.match(/vimeo\.com\/(?:.*\/)?(\d+)/);return r?`https://player.vimeo.com/video/${r[1]}?${bt}`: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 Ne(e){let t=e.trim();if(!t)return null;let n=He(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==="biganto"?t:null}var V=e=>e<0?0:e>1?1:e;function F(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(a=>typeof a=="number"&&Number.isFinite(a)))return null;let s=V(t),u=V(n),d={nx:s,ny:u,nw:Math.min(V(r),1-s),nh:Math.min(V(o),1-u)};return d.nw<=0||d.nh<=0||d.nx===0&&d.ny===0&&d.nw===1&&d.nh===1?null:d}var G={file(e){return typeof e=="string"?{url:e,responsive:null}:{url:e.url,responsive:e.responsive}}};function vt(e){if(typeof e!="object"||e===null)return null;let t=e.asset_id;return typeof t=="string"&&t!==""?t:null}function wt(e,t,n){if(e.file===null)return null;let r=n.crop===void 0?null:F(t.rect),o=n.crop===void 0?null:F(t.mobile_rect),s=n.file(e.file),u=r===null?{photo_id:e.id,url:s.url,alt:e.alt,responsive:s.responsive}:{photo_id:e.id,url:n.crop(e.file,r),alt:e.alt,responsive:null,rect:r};return o!==null&&(u.mobile={url:n.crop(e.file,o),responsive:null}),u}function Me(e,t){if(e.posterFile!==void 0){let n=t.file(e.posterFile);return n.responsive===null?{poster:n.url}:{poster:n.url,poster_responsive:n.responsive}}return{poster:e.posterUrl??""}}function xt(e,t){let n=Me(e,t);return e.file===null?{video_id:e.id,url:Oe(e.url??"")??"",...n,alt:e.alt,source:"link",...e.provider===null?{}:{provider:e.provider}}:{video_id:e.id,url:t.file(e.file).url,...n,alt:e.alt,source:"upload"}}function Rt(e,t){return{tour_id:e.id,url:Ne(e.url??"")??"",...Me(e,t),alt:e.alt,...e.provider===null?{}:{provider:e.provider}}}function St(e,t){return e.file===null?null:{asset_id:e.id,url:t.file(e.file).url,filename:e.filename,content_type:e.mime,size_bytes:0}}function kt(e,t,n,r){let o=vt(t),s=o===null?void 0:n.get(o);if(s===void 0||s.kind!==e)return null;switch(e){case"image":return wt(s,t,r);case"video":return xt(s,r);case"tour":return Rt(s,r);case"document":return St(s,r);default:return null}}var It=new Set(["image","video","tour","document"]),Et=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function Pt(e,t,n){let r=typeof e.id=="string"?e.id:"",o=typeof e.floor_label=="string"?e.floor_label:null,s=r===""?void 0:t.get(r),u=s?.kind==="image"&&s.file!==null?n.file(s.file):null;return{id:r,...typeof e.upload_id=="string"?{upload_id:e.upload_id}:{},url:u?.url??"",alt:o??"Floor plan",floor_label:o,position:typeof e.position=="number"?e.position:0,...u?.responsive?{responsive:u.responsive}:{}}}function Tt(e,t,n,r){return e.type==="image"&&Array.isArray(t)?t.filter(Et).map(o=>Pt(o,n,r)):re(e,t,n,r)}function re(e,t,n,r){if(t==null)return t;if(It.has(e.type))return kt(e.type,t,n,r);if(e.type!=="list"||!Array.isArray(t))return t;let o=t;if(e.fields!==void 0){let s=e.fields;return o.map(u=>{if(typeof u!="object"||u===null)return u;let d={...u};for(let[a,h]of Object.entries(s))d[a]=Tt(h,d[a],n,r);return d})}if(e.element!==void 0){let s=e.element;return o.map(u=>re(s,u,n,r))}return o}function De(e,t,n,r=G){let o={};for(let[s,u]of Object.entries(e.slots)){let d=t.schema.slots[s];o[s]=d===void 0?u:re(d,u,n,r)}return o}function Fe(e){return typeof e=="string"?e:e.url}function Ct(e,t){return e.split(",").map(n=>{let[r="",...o]=n.trim().split(/\s+/);return[t(r),...o].join(" ")}).join(", ")}function $t(e){return{file(t){let n=G.file(t),r=n.responsive===null?null:{...n.responsive,sources:n.responsive.sources.map(o=>({...o,srcset:Ct(o.srcset,e)}))};return{url:e(n.url),responsive:r}},crop(t,n){return e(G.file(t).url,{crop:n})}}}function A(e){return Array.isArray(e)?e:[]}function Ue(e,t){let{facts:n}=e,r=a=>e.media[a],o=a=>a?.file===null||a?.file===void 0?"":t(Fe(a.file)),s=a=>a?.posterFile!==void 0?t(Fe(a.posterFile)):a?.posterUrl??"",u=[];for(let a of A(n.photos)){let h=r(a.id);u.push({id:a.id,kind:"photo",name:h?.filename||a.id,size:"",src:o(h),caption:a.caption??null})}for(let a of A(n.floor_plans)){let h=r(a.id);u.push({id:a.id,kind:"plan",name:h?.filename||a.id,size:"",src:o(h)})}for(let a of A(n.videos)){let h=a.provider??void 0;u.push({id:a.id,kind:"video",name:a.caption??r(a.id)?.filename??a.id,size:"",src:s(r(a.id)),caption:a.caption??null,ready:!0,durationMs:a.duration_ms??null,...h===void 0?{}:{provider:h}})}for(let a of A(n.tours))u.push({id:a.id,kind:"tour",name:`${a.provider??"Tour"} ${a.id}`,size:"",src:s(r(a.id)),ready:!0,provider:a.provider??""});for(let a of A(n.documents)){let h=r(a.id)?.sizeBytes;u.push({id:a.id,kind:"document",name:a.filename??a.id,size:"",src:"",mime:a.mime??"",...h===void 0?{}:{sizeBytes:h}})}let d=[["avatar_upload_id","headshot"],["logo_dark_upload_id","logo (dark)"],["logo_light_upload_id","logo (light)"]];for(let a of A(n.contacts)){let h=typeof a.name=="string"?a.name:"Contact";for(let[v,P]of d){let S=a[v];typeof S=="string"&&u.push({id:S,kind:"library",name:`${h} \u2014 ${P}`,size:"",src:o(r(S)),caption:h})}}return u}var At={image:["photo_id","asset_id"],video:["video_id","asset_id"],tour:["tour_id","asset_id"],document:["asset_id"]};function Ht(e){return e.filter(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)).map(({id:t,upload_id:n,floor_label:r,position:o})=>({id:typeof t=="string"?t:"",...typeof n=="string"?{upload_id:n}:{},floor_label:typeof r=="string"?r:null,position:typeof o=="number"?o:0}))}function oe(e,t){if(t==null)return t;let n=At[e.type];if(n!==void 0){if(typeof t!="object")return null;let o=t,s=n.map(a=>o[a]).find(a=>typeof a=="string"&&a!=="");if(typeof s!="string")return null;if(e.type!=="image")return{asset_id:s};let u=F(o.rect),d=typeof o.mobile=="object"&&o.mobile!==null?F(o.mobile.rect):null;return{asset_id:s,...u===null?{}:{rect:u},...d===null?{}:{mobile_rect:d}}}if(e.type!=="list"||!Array.isArray(t))return t;let r=t;if(e.fields!==void 0){let o=e.fields;return r.map(s=>{if(typeof s!="object"||s===null)return s;let u={...s};for(let[d,a]of Object.entries(o))d in u&&(u[d]=a.type==="image"&&Array.isArray(u[d])?Ht(u[d]):oe(a,u[d]));return u})}if(e.element!==void 0){let o=e.element;return r.map(s=>oe(o,s))}return r}function Le(e){let{instance:t,slots:n,fixture:r,session:o,assetUrl:s}=e,u={...t.slots},d={},a=r.provenance[t.instance_id]??{};for(let v of Object.keys(n))d[v]=a[v]??{kind:"empty"};for(let[v,P]of Object.entries(o??{})){let S=n[v];S!==void 0&&(u[v]=oe(S,P),d[v]={kind:"session"})}let h=new Map(Object.entries(r.media));return{slots:De({...t,slots:u},{schema:{slots:n}},h,$t(s)),provenance:d}}var je=1024*1024;function Nt(e){let t=O(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:{...N(e)}}}function Mt(e,t){return new Response(t,{status:e,headers:{"content-type":"text/plain; charset=utf-8"}})}function ie(e){return new Response(JSON.stringify(e),{headers:{"content-type":"application/json; charset=utf-8"}})}function ae(e){return new Response(e,{headers:{"content-type":"text/html; charset=utf-8"}})}function Dt(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 U(e,t,n){let r=e.searchParams.get(t);if(r===null||r==="")throw new g(400,`${n} needs a ${t} parameter.`);return r}function Ft(e){return`<script>
117
117
  (function () {
118
118
  try {
119
119
  var src = new EventSource(${JSON.stringify(e)});
@@ -122,6 +122,6 @@ ${e.body}
122
122
  });
123
123
  } catch (e) { /* no change channel; the page stays as it is */ }
124
124
  })();
125
- </script>`}function Nt(e){if(e===T.catalog||e==="api/media"||e.startsWith("api/capture/")||e===k.frame||e===k.print)return!0;let[t,n,r]=e.split("/").filter(Boolean);return t==="fixtures"&&n!==void 0&&r==="live"}function Un(e){let{reader:t,assetUrl:n,renderer:r}=e,o=(e.base??"/").endsWith("/")?e.base??"/":`${e.base??"/"}/`,l=p=>/^([a-z][a-z0-9+.-]*:|\/)/i.test(p)?p:`${o}${p}`,u=()=>[D.base,D.template].map(p=>l(n(p)));async function d(p){let{fixtures:s}=await t.fixtures(),i=s.find(c=>c.id===p);if(i===void 0){let c=s.map(f=>f.id).join(", ")||"none";throw new g(404,`There is no fixture "${p}" (have: ${c}).`)}return i}function a(p,s){let i=p.instances.find(c=>c.instance_id===s);if(i===void 0)throw new g(400,`The composition places no instance "${s}".`);return i}function h(p,s,i,c,f){if(p.output!=="website")return{selfAnchor:c,anchors:ge(),pages:[]};let m=we(s,f),_=p.pages.map(R=>({id:R.id,label:R.label,path:R.path??`/${R.id}`,sections:R.sections.map(I=>({key:I.section,anchor:I.section,enabled:m.get(I.instanceId)!==!1}))})),b=`${o}${T.live(s.id,"/").replace(/\/$/,"")}`,w=Pe({pages:_,currentPageId:i,basePath:b});return{selfAnchor:c,anchors:w.anchors,pages:w.pages}}async function v(p,s,i,c,f,m){let _=p.instances.find(X=>X.instanceId===c.instance_id);if(_===void 0)throw new Error(`The composition places no section "${c.section_key}".`);let b=xe(c,_.sectionSchema.slots,m),{slots:w,provenance:R}=De({instance:b,slots:_.sectionSchema.slots,fixture:s,session:f,assetUrl:n}),I=h(p,s,i,b.section_key,m),x=b.variant,H=await r.section(b.section_key);return{html:r.renderToString(r.createElement(H,{slots:w,nav:I,variant:x??""}),{identifierPrefix:b.instance_id}),resolvedProps:{slots:w,nav:I,variant:x},provenance:R}}async function E(p,s,i){let c=[];for(let f of i.sections){let m=a(s,f.instanceId);m.enabled&&c.push((await v(p,s,i.id,m,void 0,{})).html)}return c}function S(p,s,i){let c=p.pages.find(f=>f.id===s);if(c===void 0)throw new g(i,`The template declares no page "${s}".`);return c}function G(p,s){if(p.output==="website")throw new g(404,`"${p.key}" is a website \u2014 captures are for rendered templates; open its pages live instead.`);let i=s===null?p.formats[0]:p.formats.find(c=>c.id===s);if(i===void 0)throw new g(404,`The template declares no format "${s??""}" (have: ${p.formats.map(c=>c.id).join(", ")}).`);return i}async function Ue(){let p=await t.islands(),s={wire:1,islands:{map:{...p.map},hostScript:p.canvasHost,importMap:{...p.importMap}},stylesheets:[D.base,D.template].map(m=>n(m))},i,c;try{i=await t.template(),c=await t.fixtures()}catch(m){return{...s,template:{key:"",name:"",output:"website",formats:[],pages:[],canvases:[],instances:[]},fixtures:[],capabilities:{hmr:t.live,capture:!1},error:m instanceof Error?m.message:String(m)}}let f=c.problems!==void 0&&c.fixtures.length===0?`No fixture could be rendered:
126
- ${c.problems}`:void 0;return{...s,template:{key:i.key,name:i.name,output:i.output,formats:i.output==="website"?[]:i.formats.map($t),pages:i.pages.map(m=>({id:m.id,label:m.label,...m.path===void 0?{}:{path:m.path},instanceIds:m.sections.map(_=>_.instanceId)})),canvases:i.canvases.map(m=>({id:m.id,label:m.label,pages:[...m.pages]})),instances:i.instances.map(m=>({...m,display:he(m.display)}))},fixtures:c.fixtures.map(ke),capabilities:{hmr:t.live,capture:i.output!=="website"&&t.capture!==void 0},...f===void 0?{}:{error:f}}}async function Le(p){if(p.method!=="POST")throw new g(405,`POST a render request to ${T.render}.`);let s=await p.text();if(new TextEncoder().encode(s).byteLength>Fe)throw new g(413,`request body exceeds ${Fe} bytes`);let i;try{i=s===""?void 0:JSON.parse(s)}catch(w){throw new g(400,`request body is not JSON: ${w instanceof Error?w.message:String(w)}`)}if(i===void 0||typeof i.page!="string"||typeof i.instance!="string"||typeof i.fixture!="string")throw new g(400,"A render request names a page, an instance and a fixture.");let c=typeof i.session=="object"&&i.session!==null?i.session:{},f=be(i.display),m=await t.template(),_=await d(i.fixture),b=S(m,i.page,400);return ve(m,f),v(m,_,b.id,a(_,i.instance),c.slots,f)}async function je(p){let s=await d(U(p,"fixture","api/media"));return{items:Me(s,n)}}async function qe(p,s){let i=await t.template();if(i.output!=="website")throw new g(404,`"${i.key}" is a rendered ${i.output} template and has no live pages \u2014 preview it on the canvas.`);let c=i.pages.find(_=>_.path===s);if(c===void 0){let _=i.pages.map(b=>b.path??b.id).join(", ");throw new g(404,`The template declares no page at "${s}" (have: ${_}).`)}let f=await d(p),m=await E(i,f,c);return C({destination:"preview",root:{kind:"plain",bodyHtml:m.join(`
127
- `)},islands:(await t.islands()).documentLoader,stylesheets:{kind:"links",hrefs:u()},title:`${i.name} - ${c.label}`,extraCss:["html, body { background: #fff; }"],...t.live?{devScripts:[Ht(`${o}${T.hmr}`)]}:{}})}function se(p,s,i){let c=S(p,i,404);if(!W(s,c.id))throw new g(404,`The fixture "${s.id}" switches the page "${c.id}" off, so it has no capture.`);return c}async function We(p){let s=k.frame,i=await t.template(),c=G(i,p.searchParams.get("format")),f=await d(U(p,"fixture",s)),m=se(i,f,U(p,"page",s));return C({destination:"artifact",root:{kind:"frame",format:c,sectionHtml:await E(i,f,m)},islands:(await t.islands()).documentLoader,stylesheets:{kind:"links",hrefs:u()},title:`${i.name} \u2014 ${m.id}`})}async function Ve(p){let s=await t.template(),i=G(s,p.searchParams.get("format"));if(s.output!=="document")throw new g(404,`"${s.key}" is an ${s.output} template \u2014 a PDF is for the document class; download its pages as a zip.`);let c=await d(U(p,"fixture",k.print)),f=[];for(let m of te(c,s.pages))f.push(await E(s,c,m));if(f.length===0)throw new g(404,`The fixture "${c.id}" switches every page off, so it has no PDF.`);return C({destination:"artifact",root:{kind:"frameStack",format:i,pages:f},islands:(await t.islands()).documentLoader,stylesheets:{kind:"links",hrefs:u()},title:`${s.name} \u2014 print`})}async function ze(p,s){let i=p;if(i!=="screenshot"&&i!=="bundle"&&i!=="print")throw new g(404,`There is no capture at ${s.pathname}.`);let c=U(s,"fixture",`api/capture/${i}`),f=await t.template(),m=G(f,s.searchParams.get("format")),_=await d(c),b,w,R;if(i==="screenshot"){let x=s.searchParams.get("page")??te(_,f.pages)[0]?.id;if(x===void 0)throw new g(404,`The fixture "${c}" leaves no page on.`);se(f,_,x),b={kind:i,fixture:c,format:m,documents:[{path:ne(c,x,m.id),page:x,name:`${x}.png`}]},w="image/png",R=`${f.key}-${x}-${m.id}.png`}else if(i==="bundle"){if(f.output!=="image")throw new g(404,`"${f.key}" is a ${f.output} template \u2014 the zip is for the image class; a document downloads its PDF.`);let x=s.searchParams.get("canvas"),H=x===null?f.canvases[0]:f.canvases.find(P=>P.id===x);if(H===void 0)throw new g(404,`The template declares no canvas "${x??""}".`);let B=H.pages.filter(P=>W(_,P));if(B.length===0)throw new g(404,`The fixture "${c}" switches every page of the canvas "${H.id}" off, so it has no zip.`);let X=B.map(P=>({path:ne(c,P,m.id),page:P,name:`${f.pages.find(Be=>Be.id===P)?.label||P}.png`}));b={kind:i,fixture:c,format:m,documents:X},w="application/zip",R=`${f.key}-${m.id}.zip`}else{if(f.output!=="document")throw new g(404,`"${f.key}" is an ${f.output} template \u2014 a PDF is for the document class; download its pages as a zip.`);b={kind:i,fixture:c,format:m,documents:[{path:Te(c,m.id),page:null,name:`${f.key}.pdf`}]},w="application/pdf",R=`${f.key}.pdf`}if(t.capture===void 0)throw new g(501,"This playground has no captures to give.");let I=await t.capture(b);return new Response(new Uint8Array(I),{headers:{"content-type":w,"content-disposition":`attachment; filename="${encodeURIComponent(R)}"`}})}async function Ge(p,s,i){if(i===T.render)return ie(await Le(p));if(p.method!=="GET"&&p.method!=="HEAD"&&Nt(i))throw new g(405,`${i} only reads; the playground accepts no uploads and writes nothing.`);if(i===T.catalog)return ie(await Ue());if(i==="api/media")return ie(await je(s));if(i.startsWith("api/capture/"))return ze(i.slice(12),s);if(i===k.frame)return ae(await We(s));if(i===k.print)return ae(await Ve(s));let[c,f,m,_,...b]=i.split("/").filter(Boolean);if(c==="fixtures"&&f!==void 0&&m==="live"){if(b.length>0)throw new g(404,`There is no route at ${s.pathname}.`);return ae(await qe(decodeURIComponent(f),_===void 0?"/":`/${decodeURIComponent(_)}`))}return null}return{async handle(p){let s=new URL(p.url);if(!s.pathname.startsWith(o)&&`${s.pathname}/`!==o)return null;let i=s.pathname.slice(o.length);try{return await Ge(p,s,i)}catch(c){let f=At(c);if(f===null)throw c;return Ct(f,c instanceof Error?c.message:String(c))}}}}export{Un as createHost};
125
+ </script>`}function Ut(e){if(e===T.catalog||e==="api/media"||e.startsWith("api/capture/")||e===k.frame||e===k.print)return!0;let[t,n,r]=e.split("/").filter(Boolean);return t==="fixtures"&&n!==void 0&&r==="live"}function Bn(e){let{reader:t,assetUrl:n,renderer:r}=e,o=(e.base??"/").endsWith("/")?e.base??"/":`${e.base??"/"}/`,s=p=>/^([a-z][a-z0-9+.-]*:|\/)/i.test(p)?p:`${o}${p}`,u=()=>[D.base,D.template].map(p=>s(n(p)));async function d(p){let{fixtures:l}=await t.fixtures(),i=l.find(c=>c.id===p);if(i===void 0){let c=l.map(f=>f.id).join(", ")||"none";throw new g(404,`There is no fixture "${p}" (have: ${c}).`)}return i}function a(p,l){let i=p.instances.find(c=>c.instance_id===l);if(i===void 0)throw new g(400,`The composition places no instance "${l}".`);return i}function h(p,l,i,c,f){if(p.output!=="website")return{selfAnchor:c,anchors:_e(),pages:[]};let m=Se(l,f),_=p.pages.map(R=>({id:R.id,label:R.label,path:R.path??`/${R.id}`,sections:R.sections.map(I=>({key:I.section,anchor:I.section,enabled:m.get(I.instanceId)!==!1}))})),b=`${o}${T.live(l.id,"/").replace(/\/$/,"")}`,w=Ce({pages:_,currentPageId:i,basePath:b});return{selfAnchor:c,anchors:w.anchors,pages:w.pages}}async function v(p,l,i,c,f,m){let _=p.instances.find(Y=>Y.instanceId===c.instance_id);if(_===void 0)throw new Error(`The composition places no section "${c.section_key}".`);let b=ke(c,_.sectionSchema.slots,m),{slots:w,provenance:R}=Le({instance:b,slots:_.sectionSchema.slots,fixture:l,session:f,assetUrl:n}),I=h(p,l,i,b.section_key,m),x=b.variant,H=await r.section(b.section_key);return{html:r.renderToString(r.createElement(H,{slots:w,nav:I,variant:x??""}),{identifierPrefix:b.instance_id}),resolvedProps:{slots:w,nav:I,variant:x},provenance:R}}async function P(p,l,i){let c=[];for(let f of i.sections){let m=a(l,f.instanceId);m.enabled&&c.push((await v(p,l,i.id,m,void 0,{})).html)}return c}function S(p,l,i){let c=p.pages.find(f=>f.id===l);if(c===void 0)throw new g(i,`The template declares no page "${l}".`);return c}function z(p,l){if(p.output==="website")throw new g(404,`"${p.key}" is a website \u2014 captures are for rendered templates; open its pages live instead.`);let i=l===null?p.formats[0]:p.formats.find(c=>c.id===l);if(i===void 0)throw new g(404,`The template declares no format "${l??""}" (have: ${p.formats.map(c=>c.id).join(", ")}).`);return i}async function qe(){let p=await t.islands(),l={wire:1,islands:{map:{...p.map},hostScript:p.canvasHost,importMap:{...p.importMap}},stylesheets:[D.base,D.template].map(m=>n(m))},i,c;try{i=await t.template(),c=await t.fixtures()}catch(m){return{...l,template:{key:"",name:"",output:"website",formats:[],pages:[],canvases:[],instances:[]},fixtures:[],capabilities:{hmr:t.live,capture:!1},error:m instanceof Error?m.message:String(m)}}let f=c.problems!==void 0&&c.fixtures.length===0?`No fixture could be rendered:
126
+ ${c.problems}`:void 0;return{...l,template:{key:i.key,name:i.name,output:i.output,formats:i.output==="website"?[]:i.formats.map(Nt),pages:i.pages.map(m=>({id:m.id,label:m.label,...m.path===void 0?{}:{path:m.path},instanceIds:m.sections.map(_=>_.instanceId)})),canvases:i.canvases.map(m=>({id:m.id,label:m.label,pages:[...m.pages]})),instances:i.instances.map(m=>({...m,display:ve(m.display)}))},fixtures:c.fixtures.map(Pe),capabilities:{hmr:t.live,capture:i.output!=="website"&&t.capture!==void 0},...f===void 0?{}:{error:f}}}async function We(p){if(p.method!=="POST")throw new g(405,`POST a render request to ${T.render}.`);let l=await p.text();if(new TextEncoder().encode(l).byteLength>je)throw new g(413,`request body exceeds ${je} bytes`);let i;try{i=l===""?void 0:JSON.parse(l)}catch(w){throw new g(400,`request body is not JSON: ${w instanceof Error?w.message:String(w)}`)}if(i===void 0||typeof i.page!="string"||typeof i.instance!="string"||typeof i.fixture!="string")throw new g(400,"A render request names a page, an instance and a fixture.");let c=typeof i.session=="object"&&i.session!==null?i.session:{},f=xe(i.display),m=await t.template(),_=await d(i.fixture),b=S(m,i.page,400);return Re(m,f),v(m,_,b.id,a(_,i.instance),c.slots,f)}async function Ve(p){let l=await d(U(p,"fixture","api/media"));return{items:Ue(l,n)}}async function Ge(p,l){let i=await t.template();if(i.output!=="website")throw new g(404,`"${i.key}" is a rendered ${i.output} template and has no live pages \u2014 preview it on the canvas.`);let c=i.pages.find(_=>_.path===l);if(c===void 0){let _=i.pages.map(b=>b.path??b.id).join(", ");throw new g(404,`The template declares no page at "${l}" (have: ${_}).`)}let f=await d(p),m=await P(i,f,c);return $({destination:"preview",root:{kind:"plain",bodyHtml:m.join(`
127
+ `)},islands:(await t.islands()).documentLoader,stylesheets:{kind:"links",hrefs:u()},title:`${i.name} - ${c.label}`,extraCss:["html, body { background: #fff; }"],...t.live?{devScripts:[Ft(`${o}${T.hmr}`)]}:{}})}function se(p,l,i){let c=S(p,i,404);if(!W(l,c.id))throw new g(404,`The fixture "${l.id}" switches the page "${c.id}" off, so it has no capture.`);return c}async function ze(p){let l=k.frame,i=await t.template(),c=z(i,p.searchParams.get("format")),f=await d(U(p,"fixture",l)),m=se(i,f,U(p,"page",l));return $({destination:"artifact",root:{kind:"frame",format:c,sectionHtml:await P(i,f,m)},islands:(await t.islands()).documentLoader,stylesheets:{kind:"links",hrefs:u()},title:`${i.name} \u2014 ${m.id}`})}async function Be(p){let l=await t.template(),i=z(l,p.searchParams.get("format"));if(l.output!=="document")throw new g(404,`"${l.key}" is an ${l.output} template \u2014 a PDF is for the document class; download its pages as a zip.`);let c=await d(U(p,"fixture",k.print)),f=[];for(let m of te(c,l.pages))f.push(await P(l,c,m));if(f.length===0)throw new g(404,`The fixture "${c.id}" switches every page off, so it has no PDF.`);return $({destination:"artifact",root:{kind:"frameStack",format:i,pages:f},islands:(await t.islands()).documentLoader,stylesheets:{kind:"links",hrefs:u()},title:`${l.name} \u2014 print`})}async function Ye(p,l){let i=p;if(i!=="screenshot"&&i!=="bundle"&&i!=="print")throw new g(404,`There is no capture at ${l.pathname}.`);let c=U(l,"fixture",`api/capture/${i}`),f=await t.template(),m=z(f,l.searchParams.get("format")),_=await d(c),b,w,R;if(i==="screenshot"){let x=l.searchParams.get("page")??te(_,f.pages)[0]?.id;if(x===void 0)throw new g(404,`The fixture "${c}" leaves no page on.`);se(f,_,x),b={kind:i,fixture:c,format:m,documents:[{path:ne(c,x,m.id),page:x,name:`${x}.png`}]},w="image/png",R=`${f.key}-${x}-${m.id}.png`}else if(i==="bundle"){if(f.output!=="image")throw new g(404,`"${f.key}" is a ${f.output} template \u2014 the zip is for the image class; a document downloads its PDF.`);let x=l.searchParams.get("canvas"),H=x===null?f.canvases[0]:f.canvases.find(E=>E.id===x);if(H===void 0)throw new g(404,`The template declares no canvas "${x??""}".`);let B=H.pages.filter(E=>W(_,E));if(B.length===0)throw new g(404,`The fixture "${c}" switches every page of the canvas "${H.id}" off, so it has no zip.`);let Y=B.map(E=>({path:ne(c,E,m.id),page:E,name:`${f.pages.find(Je=>Je.id===E)?.label||E}.png`}));b={kind:i,fixture:c,format:m,documents:Y},w="application/zip",R=`${f.key}-${m.id}.zip`}else{if(f.output!=="document")throw new g(404,`"${f.key}" is an ${f.output} template \u2014 a PDF is for the document class; download its pages as a zip.`);b={kind:i,fixture:c,format:m,documents:[{path:Ae(c,m.id),page:null,name:`${f.key}.pdf`}]},w="application/pdf",R=`${f.key}.pdf`}if(t.capture===void 0)throw new g(501,"This playground has no captures to give.");let I=await t.capture(b);return new Response(new Uint8Array(I),{headers:{"content-type":w,"content-disposition":`attachment; filename="${encodeURIComponent(R)}"`}})}async function Xe(p,l,i){if(i===T.render)return ie(await We(p));if(p.method!=="GET"&&p.method!=="HEAD"&&Ut(i))throw new g(405,`${i} only reads; the playground accepts no uploads and writes nothing.`);if(i===T.catalog)return ie(await qe());if(i==="api/media")return ie(await Ve(l));if(i.startsWith("api/capture/"))return Ye(i.slice(12),l);if(i===k.frame)return ae(await ze(l));if(i===k.print)return ae(await Be(l));let[c,f,m,_,...b]=i.split("/").filter(Boolean);if(c==="fixtures"&&f!==void 0&&m==="live"){if(b.length>0)throw new g(404,`There is no route at ${l.pathname}.`);return ae(await Ge(decodeURIComponent(f),_===void 0?"/":`/${decodeURIComponent(_)}`))}return null}return{async handle(p){let l=new URL(p.url);if(!l.pathname.startsWith(o)&&`${l.pathname}/`!==o)return null;let i=l.pathname.slice(o.length);try{return await Xe(p,l,i)}catch(c){let f=Dt(c);if(f===null)throw c;return Mt(f,c instanceof Error?c.message:String(c))}}}}export{Bn as createHost};
package/dist/base.css CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  /* @homepages/concrete — the base stylesheet every template's page loads.
4
4
  *
5
- * Exported as `@homepages/concrete/base.css`. It is NOT part of the Tailwind
5
+ * Not an `exports` subpath: the build copies these bytes into the artifact as a
6
+ * page-level asset (`src/cli/build/static.ts`). It is NOT part of the Tailwind
6
7
  * entry (that is styles.css); it ships as its own stylesheet on the page.
7
8
  *
8
9
  * Contains:
@@ -22,7 +23,7 @@
22
23
  * layers are gone; `check` refuses author CSS that declares them.
23
24
  * - The three reset gaps Tailwind's preflight leaves (below)
24
25
  * - The section box model (.concrete-section, emitted by the <Section> primitive)
25
- * - The frame shell's static half (.tr-frame, emitted by the <FrameShell> primitive)
26
+ * - The frame shell's static half (.concrete-frame, emitted by the <FrameShell> primitive)
26
27
  * and the window witness that holds every host to the geometry it owes that shell
27
28
  * - The <Image>/<Video>/<Tour> box's geometry default (.concrete-image-block), layered so
28
29
  * an author's own width utility beats it
@@ -32,10 +33,10 @@
32
33
  * EVERY NAME THIS FILE OWNS SPELLS `concrete-`, token and class alike, so a template
33
34
  * author reading `.concrete-section` or `var(--concrete-window-h)` knows whose it is
34
35
  * without a comment. `--concrete-image-frame-bg` is the one token here a template sets;
35
- * every other `--concrete-*` is declared here and only read. The lone exception is
36
- * `.tr-frame`, which is the FRAME CONTRACT's class and not concrete's — it is derived
37
- * in one place and stamped by every capture surface on both runtimes, so it renames
38
- * with the rest of that contract's names rather than with this file.
36
+ * every other `--concrete-*` is declared here and only read. `.concrete-frame` spells
37
+ * the namespace too but is the FRAME CONTRACT's class rather than this file's: it is
38
+ * derived once, in `@homepages/format-geometry`, and stamped by every capture surface,
39
+ * so this file styles it and never names it.
39
40
  *
40
41
  * REQUIRES A TAILWIND ENTRY ON THE PAGE. Your entry's `@import "tailwindcss"` brings
41
42
  * Tailwind's preflight, and preflight does the reset: box-sizing, margin/padding,
@@ -97,12 +98,17 @@
97
98
 
98
99
  /* The frame shell's static half, emitted by the <FrameShell> primitive.
99
100
  *
100
- * `.tr-frame` is the one `tr-` name left in this file, and it is not concrete's: it
101
- * is FRAME_ROOT_CLASS, derived once and stamped by every capture surface — the
102
- * published page shell, the render worker, the editing canvas and both runtimes'
103
- * <FrameShell>. Renaming it here alone would strand every one of them, so it moves
104
- * with `.tr-root` and `#tr-site-config` in one change of its own. The private custom
105
- * properties and counters below ARE concrete's, so they already spell `concrete-`.
101
+ * `.concrete-frame` spells this file's namespace but is not this file's to name: it
102
+ * is FRAME_ROOT_CLASS, derived once in `@homepages/format-geometry` and stamped by
103
+ * every capture surface — the published page shell, the render worker, the editing
104
+ * canvas and <FrameShell>. This file only styles it, so a change to the spelling
105
+ * belongs at that derivation point and nowhere else. The private custom properties
106
+ * and counters below ARE concrete's.
107
+ *
108
+ * `.tr-frame` is its pre-4.0.0 spelling, styled alongside for a transition window
109
+ * only: a template built on this version can be captured by a platform that still
110
+ * stamps the old class. `:is()` keeps the specificity of a single class. It goes
111
+ * when every capture surface stamps the new class alone.
106
112
  *
107
113
  * The frame is a viewport: every host owes a frame document a window that is exactly the
108
114
  * format's BLEED box, and the root fills it — viewport units and geometry @media in
@@ -115,7 +121,7 @@
115
121
  * against a box identical to the one it would otherwise use (the root fills the
116
122
  * window exactly), so it moves no author content; what it buys is a stacked print
117
123
  * document, where each shell then anchors its own witness on its own sheet. */
118
- .tr-frame {
124
+ :is(.concrete-frame, .tr-frame) {
119
125
  position: relative;
120
126
  width: 100vw;
121
127
  height: 100vh;
@@ -158,7 +164,7 @@
158
164
  * pixels and identical layout to one with no witness at all. On a mismatch it covers
159
165
  * the artifact and names both geometries, because a frame measured against the wrong
160
166
  * box is not a preview of anything and must not read as one. */
161
- .tr-frame::after {
167
+ :is(.concrete-frame, .tr-frame)::after {
162
168
  counter-reset:
163
169
  concrete-frame-owed-w calc(var(--concrete-frame-window-w) / 1px)
164
170
  concrete-frame-owed-h calc(var(--concrete-frame-window-h) / 1px)
@@ -186,7 +192,7 @@
186
192
  /* Imposed from OUTSIDE <Section>, which stays byte-identical across output classes:
187
193
  * without it flexbox would compress an overflowing stack to fit, hiding the overflow
188
194
  * the author must be able to see. */
189
- .tr-frame > * {
195
+ :is(.concrete-frame, .tr-frame) > * {
190
196
  flex-shrink: 0;
191
197
  }
192
198
 
@@ -5,7 +5,7 @@ interface SiteConfig {
5
5
  siteSecret: string;
6
6
  ingestBase: string;
7
7
  }
8
- /** Read the per-site config a published page embeds as `#tr-site-config`. Null when absent or incomplete. */
8
+ /** Read the per-site config a published page embeds as `#concrete-site-config`. Null when absent or incomplete. */
9
9
  declare function readSiteConfig(): SiteConfig | null;
10
10
  /** HMAC-SHA256 a message with a hex-encoded secret, returning the signature as lowercase hex. */
11
11
  declare function hmacHex(secretHex: string, message: string): Promise<string>;
@@ -1,7 +1,8 @@
1
1
  //#region src/browser/site-config.ts
2
- /** Read the per-site config a published page embeds as `#tr-site-config`. Null when absent or incomplete. */
2
+ const LEGACY_SITE_CONFIG_ID = "tr-site-config";
3
+ /** Read the per-site config a published page embeds as `#concrete-site-config`. Null when absent or incomplete. */
3
4
  function readSiteConfig() {
4
- const el = document.getElementById("tr-site-config");
5
+ const el = document.getElementById("concrete-site-config") ?? document.getElementById(LEGACY_SITE_CONFIG_ID);
5
6
  if (!el?.textContent) return null;
6
7
  try {
7
8
  const config = JSON.parse(el.textContent);
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "3.0.0";
2
+ var version = "4.0.0";
3
3
 
4
4
  //#endregion
5
5
  export { version };
@@ -56,7 +56,7 @@ function bakePropertyRefSlots(schema, facts, ctx) {
56
56
  * null, a display entry falls back to its first declared case.
57
57
  */
58
58
  function resolveDerivedHandle(derivedHandle, deriveFacts, ctx, target) {
59
- const authored = ctx?.computed?.[derivedHandle];
59
+ const authored = ctx?.computed[derivedHandle];
60
60
  try {
61
61
  if (authored === void 0) throw new Error(`derived handle "${derivedHandle}" is not in the section's computed map`);
62
62
  return { value: authored(deriveFacts()) };
@@ -3,11 +3,11 @@ import { resolveFormatGeometry } from "./geometry.js";
3
3
  //#region ../../internal/format-geometry/dist/capture.js
4
4
  /**
5
5
  * The frame shell's root class — the static half of the frame contract, laid
6
- * out and clipped by the authoring kit's base stylesheet. Shared so a canvas
7
- * host or a capturing worker can stamp the identical class on its own page
8
- * root and resolve the frame from the same stylesheet the captured page uses.
6
+ * out and clipped by Concrete's base stylesheet. Shared so a canvas host or a
7
+ * capturing worker can stamp the identical class on its own page root and
8
+ * resolve the frame from the same stylesheet the captured page uses.
9
9
  */
10
- const FRAME_ROOT_CLASS = "tr-frame";
10
+ const FRAME_ROOT_CLASS = "concrete-frame";
11
11
  /** The frame shell's per-format tokens: trim box + bleed, exact CSS px. */
12
12
  function frameTokens(format) {
13
13
  const geometry = resolveFormatGeometry(format);
@@ -105,7 +105,7 @@ interface IslandEditor {
105
105
  * together with that island's own `editor` declaration.
106
106
  *
107
107
  * ```tsx
108
- * import type { IslandEditor, IslandServerFrame } from "@homepages/template-kit";
108
+ * import type { IslandEditor, IslandServerFrame } from "@homepages/concrete";
109
109
  *
110
110
  * export const editor = { live: true } satisfies IslandEditor;
111
111
  * export const serverFrame = false satisfies IslandServerFrame<typeof editor>;
@@ -11,9 +11,9 @@ function assertRecordCollectionContract(schema, sectionKey) {
11
11
  const collection = collectionForSlot(slot);
12
12
  if (collection === null) {
13
13
  const legal = Object.keys(COLLECTIONS).map((field) => `fact.property.${field}`).join(" / ");
14
- throw new Error(`Section "${sectionKey}": ${label} source.field "${source.field ?? "?"}" is not a known collection. COLLECTIONS is a closed registry owned by @homepages/template-kit — a workspace cannot add to it. A direct-sourced collection may only bind a registry array (${legal}); for any other repeating data, drop \`source\` and give the slot a fill decision instead.`);
14
+ throw new Error(`Section "${sectionKey}": ${label} source.field "${source.field ?? "?"}" is not a known collection. COLLECTIONS is a closed registry owned by @homepages/concrete — a workspace cannot add to it. A direct-sourced collection may only bind a registry array (${legal}); for any other repeating data, drop \`source\` and give the slot a fill decision instead.`);
15
15
  }
16
- if (!COLLECTIONS[collection].ownership) throw new Error(`Section "${sectionKey}": ${label} collection "${collection}" declares no ownership in COLLECTIONS. COLLECTIONS is a closed registry owned by @homepages/template-kit — this is a kit defect, not something a workspace can fix.`);
16
+ if (!COLLECTIONS[collection].ownership) throw new Error(`Section "${sectionKey}": ${label} collection "${collection}" declares no ownership in COLLECTIONS. COLLECTIONS is a closed registry owned by @homepages/concrete — this is a framework defect, not something a workspace can fix.`);
17
17
  const inherited = collectionBounds(collection);
18
18
  if (inherited.max !== void 0 && slot.max !== void 0 && slot.max >= inherited.max) throw new Error(`Section "${sectionKey}": ${label} declares max ${slot.max}, but collection "${collection}" already caps membership at ${inherited.max}. An explicit max is legal only if it is strictly lower; drop it to inherit ${inherited.max}.`);
19
19
  if (inherited.min !== void 0 && slot.min !== void 0 && slot.min <= inherited.min) throw new Error(`Section "${sectionKey}": ${label} declares min ${slot.min}, but collection "${collection}" already requires at least ${inherited.min}. An explicit min is legal only if it is strictly higher; drop it to inherit ${inherited.min}.`);
@@ -10,7 +10,7 @@ type Props = {
10
10
  * The frame shell — the rendered-class page root, the frame analog of the
11
11
  * website page shell. The frame is a viewport: every host owes a frame
12
12
  * document a window that is exactly the format's bleed box, and the static
13
- * half of the contract (`.tr-frame`, from the framework's base stylesheet) fills
13
+ * half of the contract (`.concrete-frame`, from the base stylesheet) fills
14
14
  * that window, clips at the shell's own edge, and lays sections out as a
15
15
  * rigid flex column (`flex-shrink: 0` on every direct child, so an
16
16
  * overflowing stack overflows measurably instead of being silently
@@ -7,7 +7,7 @@ import { jsx } from "react/jsx-runtime";
7
7
  * The frame shell — the rendered-class page root, the frame analog of the
8
8
  * website page shell. The frame is a viewport: every host owes a frame
9
9
  * document a window that is exactly the format's bleed box, and the static
10
- * half of the contract (`.tr-frame`, from the framework's base stylesheet) fills
10
+ * half of the contract (`.concrete-frame`, from the base stylesheet) fills
11
11
  * that window, clips at the shell's own edge, and lays sections out as a
12
12
  * rigid flex column (`flex-shrink: 0` on every direct child, so an
13
13
  * overflowing stack overflows measurably instead of being silently
@@ -3,7 +3,7 @@ purpose: Every `concrete` command, with its full flag surface, exit codes and co
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=3.0.0 <4.0.0"
6
+ applies_to: "@homepages/concrete >=4.0.0 <5.0.0"
7
7
  related: [INDEX.md]
8
8
  ---
9
9
  # Command reference
@@ -73,7 +73,7 @@ of its flags.
73
73
 
74
74
  ## Versions
75
75
 
76
- These pages describe `@homepages/concrete` **>=3.0.0 <4.0.0**. The range, rather than
76
+ These pages describe `@homepages/concrete` **>=4.0.0 <5.0.0**. The range, rather than
77
77
  the exact version they were generated from: this reference is committed build output,
78
78
  so a page stamped with a patch version would be stale the day it shipped.
79
79
  `concrete --version` prints the installed one.
@@ -3,7 +3,7 @@ purpose: The `concrete build` command — its flags, exit codes and constraints.
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=3.0.0 <4.0.0"
6
+ applies_to: "@homepages/concrete >=4.0.0 <5.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete build
@@ -3,7 +3,7 @@ purpose: The `concrete check` command — its flags, exit codes and constraints.
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=3.0.0 <4.0.0"
6
+ applies_to: "@homepages/concrete >=4.0.0 <5.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete check
@@ -3,7 +3,7 @@ purpose: The `concrete dev` command — its flags, exit codes and constraints.
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=3.0.0 <4.0.0"
6
+ applies_to: "@homepages/concrete >=4.0.0 <5.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete dev
@@ -3,7 +3,7 @@ purpose: The `concrete property add` command — its flags, exit codes and const
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=3.0.0 <4.0.0"
6
+ applies_to: "@homepages/concrete >=4.0.0 <5.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete property add
@@ -3,7 +3,7 @@ purpose: The `concrete property list` command — its flags, exit codes and cons
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=3.0.0 <4.0.0"
6
+ applies_to: "@homepages/concrete >=4.0.0 <5.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete property list
@@ -3,7 +3,7 @@ purpose: The `concrete publish` command — its flags, exit codes and constraint
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=3.0.0 <4.0.0"
6
+ applies_to: "@homepages/concrete >=4.0.0 <5.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete publish
@@ -3,7 +3,7 @@ purpose: The `concrete upgrade` command — its flags, exit codes and constraint
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=3.0.0 <4.0.0"
6
+ applies_to: "@homepages/concrete >=4.0.0 <5.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete upgrade
@@ -3,7 +3,7 @@ purpose: Every rule `concrete check` grades, by the stage that grades it, in the
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete rule registry
6
- applies_to: "@homepages/concrete >=3.0.0 <4.0.0"
6
+ applies_to: "@homepages/concrete >=4.0.0 <5.0.0"
7
7
  related: [reference/cli/check.md]
8
8
  ---
9
9
  # Rule reference
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homepages/concrete",
3
- "version": "3.0.0",
3
+ "version": "4.0.0",
4
4
  "description": "Concrete, the HomePages template framework: the authoring API, the contract primitives, the styles, the lint preset and the `concrete` command in one package that owns its whole toolchain.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -94,7 +94,6 @@
94
94
  "@homepages/api-contracts": "workspace:*",
95
95
  "@homepages/canvas-core": "workspace:*",
96
96
  "@homepages/editor-tokens": "workspace:*",
97
- "@homepages/effective-version": "workspace:*",
98
97
  "@homepages/fill-bake": "workspace:*",
99
98
  "@homepages/fill-vocabulary": "workspace:*",
100
99
  "@homepages/format-geometry": "workspace:*",
@@ -115,7 +114,6 @@
115
114
  "@homepages/static-assets-binding": "workspace:*",
116
115
  "@homepages/template-artifact": "workspace:*",
117
116
  "@homepages/template-contracts": "workspace:*",
118
- "@homepages/template-rule-registry": "workspace:*",
119
117
  "@playwright/test": "^1.62.1",
120
118
  "@tailwindcss/cli": "^4.3.0",
121
119
  "@tanstack/react-query": "^5.101.4",