@peripheries/core 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{Children as e,Fragment as t,cloneElement as n,createContext as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useId as c,useLayoutEffect as l,useMemo as u,useReducer as d,useRef as f,useState as p,useSyncExternalStore as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";var v=new Set(["baseProps","data","status","actions","_traversal","isLoading","error","navigate","onNavigate","size","store"]);function y(e2){let t2={};for(let n2 in e2)v.has(n2)||(t2[n2]=e2[n2]);return t2}var b=(...e2)=>e2.filter(Boolean).join(" ")||void 0,x=e2=>e2===void 0?void 0:typeof e2=="number"?`${e2}px`:e2;function S(e2,t2){let n2=Object.fromEntries(Object.entries(e2).filter(([,e3])=>e3!==void 0));return Object.keys(n2).length||t2?{...n2,...t2}:void 0}var C=Symbol.for("peripheries.embed.context.v1"),w=globalThis,T=w[C]??=r(false);function E(){return o(T)}function D({as:e2,className:t2,children:n2,...r2}){return g(e2??"div",{className:b("core-box",t2),...y(r2),children:n2})}function O({minHeight:e2,className:t2,style:n2,children:r2,...i2}){return g(D,{...i2,className:b("core-center",t2),style:S({"--core-center-min-height":x(e2)},n2),children:r2})}function k({name:e2,className:t2,style:n2,children:r2,...i2}){return g(D,{...i2,className:b("core-container",t2),style:S({"--core-container-name":e2},n2),children:r2})}function A({orientation:e2="horizontal",weight:t2="subtle",spacing:n2,className:r2,style:i2,ref:a2,...o2}){let s2={className:b("core-divider",r2),"data-weight":t2,"data-orientation":e2,style:S({"--core-divider-spacing":x(n2)},i2)};return e2==="vertical"?g("span",{role:"separator","aria-orientation":"vertical",...s2}):g("hr",{ref:a2,...y(o2),...s2})}function j({when:e2,children:t2,as:n2="span"}){return g(n2,{className:"core-hide","data-when":e2,children:t2})}function M({gap:e2,align:t2="center",justify:n2="start",wrap:r2=true,stackWhen:i2,className:a2,style:o2,children:s2,...c2}){return g(D,{...c2,className:b("core-inline",a2),"data-align":t2,"data-justify":n2,"data-wrap":r2?"true":"false","data-stack-when":i2,style:S({"--core-inline-gap":x(e2)},o2),children:s2})}var N=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","summary",'[contenteditable=""]','[contenteditable="true"]','[tabindex]:not([tabindex="-1"])'].join(",");function P(e2){return[...e2.querySelectorAll(N)].filter(e3=>!e3.closest("[inert]")&&!e3.hidden&&e3.getAttribute("aria-hidden")!=="true")}var F=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,I=2;function L({label:t2,snap:n2="start",children:r2,className:i2,...o2}){let c2=f(null),[l2,u2]=p({prev:false,next:false}),[d2,m2]=p(false),h2=a(()=>{let e2=c2.current;if(!e2)return;let t3=e2.scrollLeft>I,n3=e2.scrollWidth-e2.clientWidth-e2.scrollLeft>I;u2(e3=>e3.prev===t3&&e3.next===n3?e3:{prev:t3,next:n3}),m2(e2.scrollWidth>e2.clientWidth&&P(e2).length===0)},[]);s(()=>{let e2=c2.current;if(!e2)return;h2();let t3=new ResizeObserver(h2);t3.observe(e2);for(let n3 of Array.from(e2.children))t3.observe(n3);return()=>t3.disconnect()},[h2,r2]);let v2=e2=>{let t3=c2.current;t3&&t3.scrollBy({left:e2*t3.clientWidth*.8,behavior:F()?"auto":"smooth"})};return _("div",{...y(o2),className:b("core-rail",i2),"data-snap":n2,"data-prev":l2.prev?"":void 0,"data-next":l2.next?"":void 0,children:[g("button",{type:"button",className:"core-rail__arrow","data-direction":"prev","aria-label":`Scroll ${t2} back`,hidden:!l2.prev,onClick:()=>v2(-1),children:g("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:g("path",{d:"M10 3 5 8l5 5"})})}),g("ul",{ref:c2,role:"list","aria-label":t2,className:"core-rail__track",tabIndex:d2?0:void 0,onScroll:h2,children:e.toArray(r2).map((e2,t3)=>g("li",{className:"core-rail__item",children:e2},t3))}),g("button",{type:"button",className:"core-rail__arrow","data-direction":"next","aria-label":`Scroll ${t2} forward`,hidden:!l2.next,onClick:()=>v2(1),children:g("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:g("path",{d:"m6 3 5 5-5 5"})})})]})}function R({when:e2,children:t2,as:n2="span"}){return g(n2,{className:"core-show","data-when":e2,children:t2})}function z(e2,t2,n2){let[r2,i2]=p(t2),o2=e2!==void 0,s2=o2?e2:r2,c2=f(n2);return c2.current=n2,[s2,a(e3=>{o2||i2(e3),c2.current?.(e3)},[o2])]}function B(...e2){return t2=>{for(let n2 of e2)typeof n2=="function"?n2(t2):n2&&(n2.current=t2)}}function ee(e2){let[t2,n2]=p(()=>typeof matchMedia=="function"&&matchMedia(e2).matches);return s(()=>{if(typeof matchMedia!="function")return;let t3=matchMedia(e2),r2=()=>n2(t3.matches);return r2(),t3.addEventListener("change",r2),()=>t3.removeEventListener("change",r2)},[e2]),t2}var V="core-overlay-dismiss",H=Symbol.for("peripheries.overlay.host.v1"),U=globalThis,W=U[H]??=r(null);function G(e2){let t2=e2&&typeof e2=="object"?e2:{},n2=typeof HTMLElement<"u"&&t2.mount instanceof HTMLElement?t2.mount:void 0,r2=typeof t2.portal=="function"?t2.portal:void 0;return{format:t2.format==="desktop"?"desktop":"mobile",...n2?{mount:n2}:{},...r2?{portal:r2}:{}}}function K({value:e2,children:t2}){return g(W.Provider,{value:G(e2),children:t2})}function te(){return o(W)}var ne="(max-width: 640px)";function re(){let e2=te(),t2=ee(ne);return e2?e2.format:t2?"mobile":"desktop"}var ie=(e2,t2,n2)=>Math.max(t2,Math.min(e2,n2));function q({anchor:e2,size:t2,viewport:n2,placement:r2,gap:i2=4,margin:a2=8}){let[o2,s2="center"]=r2.split("-"),c2=n2.height-a2-e2.bottom-i2,l2=e2.top-i2-a2,u2=e3=>t2.height<=e3,d2=o2;o2==="bottom"&&!u2(c2)&&l2>c2?d2="top":o2==="top"&&!u2(l2)&&c2>l2&&(d2="bottom");let f2=d2==="bottom"?e2.bottom+i2:e2.top-i2-t2.height;return{x:ie(s2==="start"?e2.left:s2==="end"?e2.right-t2.width:(e2.left+e2.right)/2-t2.width/2,a2,Math.max(a2,n2.width-a2-t2.width)),y:ie(f2,a2,Math.max(a2,n2.height-a2-t2.height)),placement:s2==="center"?d2:`${d2}-${s2}`}}function ae(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("anchor-name","--a")}var oe=4;function se({trigger:e2,label:t2,placement:r2="bottom-start",open:i2,defaultOpen:a2=false,onOpenChange:o2,popupRole:u2="dialog",initialFocus:d2,onTriggerKeyDown:m2,children:v2,className:y2}){let[x2,S2]=z(i2,a2,o2),C2=c(),w2=`--core-a${C2.replace(/\W/g,"")}`,T2=f(null),E2=f(null),[D2]=p(ae),O2=f(x2);O2.current=x2;let k2=f("closed");l(()=>{let e3=T2.current;if(e3){if(x2&&k2.current==="closed")k2.current="open",e3.showPopover();else if(!x2&&k2.current==="open"){k2.current="closed";let t3=document.activeElement;(!t3||t3===document.body||e3.contains(t3))&&E2.current?.focus({preventScroll:true}),e3.hidePopover()}}},[x2]),s(()=>{let e3=T2.current;if(!e3)return;let t3=t4=>{let n3=t4.newState;if(k2.current=n3==="open"?"open":"closed",n3==="open"&&!O2.current&&S2(true),n3==="closed"&&O2.current){S2(false);let t5=document.activeElement;(!t5||t5===document.body||e3.contains(t5))&&E2.current?.focus({preventScroll:true})}},n2=t4=>{if(t4.newState!=="open"||d2===false)return;let n3=(typeof d2=="function"?d2(e3):d2?e3.querySelector(d2):null)??P(e3)[0];n3?n3.focus({preventScroll:true}):(e3.tabIndex=-1,e3.focus({preventScroll:true}))};return e3.addEventListener("beforetoggle",t3),e3.addEventListener("toggle",n2),()=>{e3.removeEventListener("beforetoggle",t3),e3.removeEventListener("toggle",n2)}},[S2,d2]),l(()=>{let e3=T2.current,t3=E2.current;if(D2||!x2||!e3||!t3)return;let n2=()=>{let n3=q({anchor:t3.getBoundingClientRect(),size:{width:e3.offsetWidth,height:e3.offsetHeight},viewport:{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight},placement:r2,gap:oe});e3.style.setProperty("--core-popover-x",`${n3.x}px`),e3.style.setProperty("--core-popover-y",`${n3.y}px`),e3.dataset.placement=n3.placement,e3.dataset.placed=""};n2();let i3=new ResizeObserver(n2);return i3.observe(e3),window.addEventListener("resize",n2),window.addEventListener("scroll",n2,true),()=>{delete e3.dataset.placed,i3.disconnect(),window.removeEventListener("resize",n2),window.removeEventListener("scroll",n2,true)}},[D2,x2,r2]);let A2=()=>S2(false),j2=e2.props,M2={ref:B(E2,j2.ref),popoverTarget:C2,"aria-haspopup":u2,"aria-expanded":x2,"aria-controls":C2,className:b(j2.className,"core-popover-anchor"),style:{...j2.style,"--core-popover-anchor":w2},onKeyDown:e3=>{m2?.(e3),j2.onKeyDown?.(e3)}};return _(h,{children:[n(e2,M2),g("div",{ref:T2,id:C2,popover:"auto",role:u2==="menu"?void 0:u2,"aria-label":u2==="menu"?void 0:t2,className:b("core-popover",y2),"data-placement":r2,"data-placer":D2?"anchor":"script",style:{"--core-popover-anchor":w2},onBlur:e3=>{let t3=e3.relatedTarget;t3&&!e3.currentTarget.contains(t3)&&t3!==E2.current&&A2()},children:x2?typeof v2=="function"?v2({close:A2}):v2:null})]})}var ce=Symbol.for("peripheries.overlay.scrollLock.v1"),le=globalThis;function ue(){if(typeof document>"u")return()=>{};let e2=le[ce]??={count:0,overflow:""};e2.count===0&&(e2.overflow=document.body.style.overflow,document.body.style.overflow="hidden"),e2.count+=1;let t2=false;return()=>{t2||(t2=true,--e2.count,e2.count===0&&(document.body.style.overflow=e2.overflow))}}function de(e2){let t2=te();return t2?g(me,{...e2,host:t2}):g(he,{...e2})}var fe={dialog:"center","sheet-bottom":"bottom","sheet-end":"end"};function pe(e2,t2){let n2=f({onClose:e2,onOpenChange:t2});return n2.current={onClose:e2,onOpenChange:t2},f(()=>{n2.current.onOpenChange?.(false),n2.current.onClose?.()}).current}function me({variant:e2,kind:t2,open:n2,onClose:r2,onOpenChange:i2,title:a2,label:o2,description:l2,role:u2="dialog",initialFocus:d2,dismissOnBackdrop:p2=true,headerStart:m2,headerTools:v2,footer:y2,children:x2,className:S2,host:C2}){let w2=f(null),T2=pe(r2,i2),E2=`core-overlay-${c().replace(/:/g,"")}`,D2=`${E2}-title`,O2=`${E2}-description`;if(s(()=>{let e3=w2.current;if(!e3||!n2)return;let t3=(d2?e3.querySelector(d2):null)??P(e3)[0];t3?t3.focus({preventScroll:true}):e3.focus({preventScroll:true})},[n2,d2]),s(()=>{let e3=w2.current;if(!e3||!n2)return;let t3=t4=>{t4.target===e3&&T2()};return e3.addEventListener(V,t3),()=>e3.removeEventListener(V,t3)},[n2,T2]),!n2)return null;let k2=o2??(typeof a2=="string"?a2:"dialog"),A2=_(h,{children:[g("div",{className:"core-overlay-scrim","data-overlay-scrim":"","aria-hidden":"true",onClick:()=>p2&&T2()}),g("div",{ref:w2,id:E2,className:b("core-overlay",S2),"data-overlay":t2??(e2==="dialog"?"dialog":"sheet"),"data-placement":fe[e2],role:u2==="alertdialog"?"alertdialog":"dialog","aria-modal":"true","aria-labelledby":D2,"aria-describedby":l2?O2:void 0,tabIndex:-1,children:_("div",{className:"core-modal__surface",children:[_("header",{className:"core-modal__header",children:[m2,g("h2",{id:D2,className:"core-modal__title",children:a2}),g("div",{className:"core-modal__tools",children:v2}),g("button",{type:"button",className:"core-modal__close","aria-label":`Close ${k2}`,onClick:T2,children:g("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:g("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]}),_("div",{className:"core-modal__body",children:[l2?g("p",{id:O2,className:"core-modal__description",children:l2}):null,x2]}),y2?g("footer",{className:"core-modal__footer",children:y2}):null]})},"root")]}),j2=C2.mount??(typeof document>"u"?null:document.body);return C2.portal&&j2?g(h,{children:C2.portal(A2,j2)}):A2}function he({variant:e2,open:t2,onClose:n2,onOpenChange:r2,title:i2,label:a2,description:o2,role:l2="dialog",initialFocus:u2,dismissOnBackdrop:d2=true,headerStart:p2,headerTools:m2,footer:h2,children:v2,className:y2}){let x2=f(null),S2=f(null),C2=pe(n2,r2),w2=c(),T2=c();s(()=>{let e3=x2.current;if(!e3||!t2)return;let n3=document.activeElement;e3.showModal();let r3=ue(),i3=(u2?e3.querySelector(u2):null)??P(e3)[0];i3?i3.focus({preventScroll:true}):e3.focus({preventScroll:true});let a3=e4=>{e4.preventDefault(),C2()};return e3.addEventListener("cancel",a3),()=>{e3.removeEventListener("cancel",a3),r3(),e3.open&&e3.close();let t3=document.activeElement;(!t3||t3===document.body)&&n3?.isConnected&&n3.focus({preventScroll:true})}},[t2,u2]);let E2=a2??(typeof i2=="string"?i2:"dialog");return g("dialog",{ref:x2,className:b("core-modal",y2),"data-variant":e2,role:l2==="alertdialog"?"alertdialog":void 0,"aria-labelledby":w2,"aria-describedby":o2?T2:void 0,tabIndex:-1,onKeyDown:e3=>{if(e3.key!=="Tab"||e3.defaultPrevented||e3.target.closest("dialog")!==e3.currentTarget)return;let t3=P(e3.currentTarget),n3=t3[0],r3=t3[t3.length-1];if(!n3||!r3)return e3.preventDefault();let i3=document.activeElement;e3.shiftKey&&(i3===n3||i3===e3.currentTarget)?(e3.preventDefault(),r3.focus()):!e3.shiftKey&&i3===r3&&(e3.preventDefault(),n3.focus())},onPointerDown:e3=>{S2.current=e3.target},onClick:e3=>{d2&&e3.target===e3.currentTarget&&S2.current===e3.currentTarget&&C2()},children:t2&&_("div",{className:"core-modal__surface",children:[_("header",{className:"core-modal__header",children:[p2,g("h2",{id:w2,className:"core-modal__title",children:i2}),g("div",{className:"core-modal__tools",children:m2}),g("button",{type:"button",className:"core-modal__close","aria-label":`Close ${E2}`,onClick:C2,children:g("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:g("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]}),_("div",{className:"core-modal__body",children:[o2?g("p",{id:T2,className:"core-modal__description",children:o2}):null,v2]}),h2?g("footer",{className:"core-modal__footer",children:h2}):null]})})}function J({side:e2="bottom",back:t2,...n2}){return e2==="auto"?g(ge,{back:t2,...n2}):g(_e,{side:e2,back:t2,...n2})}function ge({back:e2,...t2}){let n2=re()==="mobile";return g(_e,{side:n2?"bottom":"center",back:e2,...t2})}function _e({side:e2,back:t2,...n2}){let r2=t2?g("button",{type:"button",className:"core-modal__back","aria-label":`Back to ${t2.label}`,onClick:t2.onBack,children:g("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:g("path",{d:"M13 8H3M7 4 3 8l4 4"})})}):void 0;return g(de,{variant:e2==="end"?"sheet-end":e2==="center"?"dialog":"sheet-bottom",kind:"sheet",headerStart:r2,...n2})}var ve='[role="menuitem"], [role="menuitemcheckbox"]',ye=600,be=e2=>"type"in e2;function xe({items:e2,label:t2,onChoose:n2,onTab:r2,className:i2}){let a2=f(null),o2=f({text:"",at:0}),s2=()=>[...a2.current?.querySelectorAll(ve)??[]];return g("div",{ref:a2,role:"menu","aria-label":t2,className:b("core-menu",i2),onKeyDown:e3=>{let t3=s2(),n3=t3.indexOf(document.activeElement),i3=n4=>{e3.preventDefault(),t3[(n4+t3.length)%t3.length]?.focus({preventScroll:true})};if(e3.key==="ArrowDown")i3(n3+1);else if(e3.key==="ArrowUp")i3(n3<0?-1:n3-1);else if(e3.key==="Home")i3(0);else if(e3.key==="End")i3(-1);else if(e3.key==="Tab")r2();else if(e3.key.length===1&&!e3.ctrlKey&&!e3.metaKey&&!e3.altKey&&e3.key!==" "){let r3=Date.now();o2.current.text=r3-o2.current.at>ye?e3.key.toLowerCase():o2.current.text+e3.key.toLowerCase(),o2.current.at=r3;let i4=o2.current.text,a3=[...t3.slice(n3+1),...t3.slice(0,n3+1)],s3=[...i4].every(e4=>e4===i4[0]),c2=a3.find(e4=>e4.textContent?.trim().toLowerCase().startsWith(i4))??(s3?a3.find(e4=>e4.textContent?.trim().toLowerCase().startsWith(i4[0]??"")):void 0);c2&&(e3.preventDefault(),c2.focus({preventScroll:true}))}},children:e2.map(e3=>{if(be(e3))return g("div",{role:"separator",className:"core-menu__separator"},e3.id);let t3=typeof e3.checked=="boolean"&&!e3.href,r3={role:t3?"menuitemcheckbox":"menuitem","aria-checked":t3?e3.checked:void 0,tabIndex:-1,className:"core-menu__item","data-tone":e3.tone,"aria-disabled":e3.disabled||void 0,onClick:t4=>{if(e3.disabled)return t4.preventDefault();n2(e3)}},i3=_(h,{children:[e3.icon?g("span",{className:"core-menu__icon","aria-hidden":"true",children:e3.icon}):null,g("span",{className:"core-menu__label",children:e3.label})]});return e3.href&&!e3.disabled?g("a",{...r3,href:e3.href,children:i3},e3.id):g("button",{...r3,type:"button",children:i3},e3.id)})})}function Se({trigger:e2,items:t2,label:r2,placement:i2="bottom-start",presentation:a2="auto",defaultOpen:o2=false,onOpenChange:s2,className:c2}){let l2=re()==="mobile",u2=a2==="sheet"||a2==="auto"&&l2,[d2,f2]=z(void 0,o2,s2),[m2,v2]=p("first"),y2=g(xe,{items:t2,label:r2,onChoose:e3=>{e3.onSelect?.(),f2(false)},onTab:()=>f2(false),className:c2}),b2=e3=>{(e3.key==="ArrowDown"||e3.key==="ArrowUp")&&(e3.preventDefault(),v2(e3.key==="ArrowUp"?"last":"first"),f2(true))};if(u2){let t3=e2.props;return _(h,{children:[n(e2,{"aria-haspopup":"menu","aria-expanded":d2,onClick:e3=>{t3.onClick?.(e3),v2("first"),f2(true)},onKeyDown:e3=>{b2(e3),t3.onKeyDown?.(e3)}}),g(J,{open:d2,onClose:()=>f2(false),title:r2,initialFocus:ve,className:"core-menu-sheet",children:y2})]})}return g(se,{trigger:e2,label:r2,placement:i2,open:d2,onOpenChange:f2,popupRole:"menu",initialFocus:e3=>{let t3=e3.querySelectorAll(ve);return(m2==="last"?t3[t3.length-1]:t3[0])??null},onTriggerKeyDown:b2,className:"core-menu-popover",children:y2})}var Ce=new Set;function we(e2,t2){Ce.has(e2)||(Ce.add(e2),typeof console<"u"&&console.warn(t2))}var Te={title:120,description:280,label:40,visible:4,perSource:2,burst:5,windowMs:1e4,defaultDuration:6e3},Ee=1,De=Symbol.for("peripheries.toast.v1"),Oe=["neutral","info","success","warning","danger"],ke=globalThis;function Ae(){let e2=ke[De];if(e2===void 0){let e3={version:Ee,snapshot:{toasts:[],actions:[]},listeners:new Set,handlers:new Map,sent:new Map,regionClaim:null,next:1};return ke[De]=e3,e3}return e2.version!==Ee||!e2.listeners||!e2.handlers?(we("toast:version",`[toast] A toast store of version ${String(e2.version)} is on this page; this copy expects ${Ee}. Toasts from this copy are ignored.`),null):e2}function je(e2,t2){e2.snapshot={toasts:t2,actions:[...e2.handlers.keys()]};for(let t3 of[...e2.listeners])t3()}var Me=(e2,t2)=>e2.length>t2?`${e2.slice(0,t2-1)}…`:e2;function Ne(e2){let t2=Ae();if(!t2)return null;if(!e2||typeof e2.title!="string"||e2.title.trim()==="")return we("toast:title","[toast] A toast needs a title of text; nothing was shown."),null;if(t2.regionClaim===null)return we("toast:region","[toast] No ToastRegion is mounted, so the toast was not shown. Mount <ToastRegion /> once, in the shell."),null;let n2=typeof e2.source=="string"&&e2.source?Me(e2.source,40):"app",r2=Date.now(),i2=(t2.sent.get(n2)??[]).filter(e3=>r2-e3<Te.windowMs);if(i2.length>=Te.burst)return we(`toast:burst:${n2}`,`[toast] "${n2}" sent more than ${Te.burst} toasts in ${Te.windowMs/1e3}s; the rest are dropped.`),t2.sent.set(n2,i2),null;t2.sent.set(n2,[...i2,r2]);let a2=Oe.includes(e2.tone)?e2.tone:"neutral",o2=Me(e2.title.trim(),Te.title),s2=typeof e2.description=="string"&&e2.description.trim()?Me(e2.description.trim(),Te.description):void 0,c2=e2.action&&typeof e2.action.id=="string"&&typeof e2.action.label=="string"&&e2.action.label.trim()?{id:e2.action.id,label:Me(e2.action.label.trim(),Te.label)}:void 0,l2=typeof e2.id=="string"&&e2.id?e2.id:`${a2}|${o2}|${s2??""}`,u2=c2?0:typeof e2.duration=="number"&&e2.duration>=0?e2.duration:Te.defaultDuration,d2=[...t2.snapshot.toasts],f2=d2.findIndex(e3=>e3.id===l2);if(f2>=0){let e3=d2[f2];d2[f2]={id:l2,title:o2,description:s2,tone:a2,duration:u2,action:c2,source:n2,revision:e3.revision+1}}else{for(d2.push({id:l2,title:o2,description:s2,tone:a2,duration:u2,action:c2,source:n2,revision:0});d2.filter(e3=>e3.source===n2).length>Te.perSource;)d2.splice(d2.findIndex(e3=>e3.source===n2),1);for(;d2.length>Te.visible;)d2=d2.slice(1)}return je(t2,d2),l2}function Pe(e2){let t2=Ae();t2&&t2.snapshot.toasts.some(t3=>t3.id===e2)&&je(t2,t2.snapshot.toasts.filter(t3=>t3.id!==e2))}function Fe(e2){let t2=Ae()?.handlers.get(e2);return t2?.(),!!t2}var Ie={toasts:[],actions:[]},Le=e2=>{let t2=Ae();return t2?.listeners.add(e2),()=>void t2?.listeners.delete(e2)},Re=()=>Ae()?.snapshot??Ie;function ze(){let e2=Ae();if(!e2)return null;if(e2.regionClaim!==null)return we("toast:second-region","[toast] A second ToastRegion was mounted; it does nothing, and its actions are ignored. Mount one per page."),null;let t2=Symbol("region");return e2.regionClaim=t2,{release(){e2.regionClaim===t2&&(e2.regionClaim=null,e2.handlers.clear(),je(e2,[]))},setActions(n2){e2.regionClaim===t2&&(e2.handlers=new Map(Object.entries(n2)),je(e2,e2.snapshot.toasts))}}}function Be(){return{toast:Ne,dismiss:Pe}}function Ve({toast:e2,actionAvailable:t2=false,onAction:n2,onDismiss:r2,className:i2,...a2}){return _("div",{...a2,className:b("core-toast",i2),"data-tone":e2.tone,children:[_("div",{className:"core-toast__text",children:[g("p",{className:"core-toast__title",children:e2.title}),e2.description?g("p",{className:"core-toast__description",children:e2.description}):null]}),e2.action&&t2?g("button",{type:"button",className:"core-toast__action",onClick:n2,children:e2.action.label}):null,g("button",{type:"button",className:"core-toast__dismiss","aria-label":"Dismiss notification",onClick:r2,children:g("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:g("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]})}function He({item:e2,actionAvailable:t2}){let[n2,r2]=p(false);return s(()=>{if(e2.duration===0||n2)return;let t3=setTimeout(()=>Pe(e2.id),e2.duration);return()=>clearTimeout(t3)},[e2.id,e2.duration,e2.revision,n2]),g("div",{className:"core-toast-slot",onPointerEnter:()=>r2(true),onPointerLeave:()=>r2(false),onFocus:()=>r2(true),onBlur:e3=>{e3.currentTarget.contains(e3.relatedTarget)||r2(false)},children:g(Ve,{toast:e2,actionAvailable:t2,onAction:()=>{e2.action&&Fe(e2.action.id),Pe(e2.id)},onDismiss:()=>Pe(e2.id)})})}function Ue({className:e2,actions:t2}){let[n2,r2]=p(false),i2=f(null),a2=f(t2);a2.current=t2;let o2=Object.keys(t2??{}).sort().join("\n"),c2=f(null),l2=f(false),{toasts:u2,actions:d2}=m(Le,Re,Re);s(()=>{let e3=ze();return i2.current=e3,r2(e3!==null),()=>{e3?.release(),i2.current=null}},[]),s(()=>{i2.current?.setActions(Object.fromEntries((o2?o2.split("\n"):[]).map(e3=>[e3,()=>a2.current?.[e3]?.()])))},[o2,n2]);let h2=u2[u2.length-1],v2=h2?`${h2.id}:${h2.revision}`:"";if(s(()=>{let e3=c2.current;e3&&(l2.current&&e3.hidePopover(),l2.current=v2!=="",l2.current&&e3.showPopover())},[v2,n2]),!n2)return null;let y2=e3=>u2.filter(e3).map(e4=>g(He,{item:e4,actionAvailable:!!e4.action&&d2.includes(e4.action.id)},e4.id));return _("div",{ref:c2,popover:"manual",role:"region","aria-label":"Notifications",className:b("core-toast-region",e2),children:[g("div",{role:"status","aria-live":"polite",className:"core-toast-region__list",children:y2(e3=>e3.tone!=="danger")}),g("div",{role:"alert","aria-live":"assertive",className:"core-toast-region__list",children:y2(e3=>e3.tone==="danger")})]})}function We({role:e2="dialog",dismissOnBackdrop:t2,...n2}){return g(de,{variant:"dialog",role:e2,dismissOnBackdrop:t2??e2!=="alertdialog",...n2})}function Ge({size:e2,className:t2,style:n2}){return g("span",{"aria-hidden":true,className:b("core-spacer",t2),style:S({"--core-spacer-size":x(e2)},n2)})}function Ke({gap:e2,align:t2="stretch",justify:n2="start",className:r2,style:i2,children:a2,...o2}){return g(D,{...o2,className:b("core-stack",r2),"data-align":t2,"data-justify":n2,style:S({"--core-stack-gap":x(e2)},i2),children:a2})}var qe=e2=>e2.startsWith("/")&&!e2.startsWith("//")&&!e2.includes("\\"),Je=e2=>/^#[A-Za-z][\w:.-]*$/.test(e2);function Ye({href:e2,action:t2,input:n2,actions:r2,navigate:i2,onClick:a2}){let[o2,s2]=p(false),c2=r2&&t2?r2[t2]:void 0;return{busy:o2,onClick:t3=>{if(a2)return a2(t3);if(c2){t3.preventDefault(),s2(true),c2(n2).finally(()=>s2(false));return}e2&&i2&&qe(e2)&&t3.button===0&&!t3.metaKey&&!t3.ctrlKey&&!t3.shiftKey&&!t3.altKey&&(t3.preventDefault(),i2(e2))},external:!!e2&&!qe(e2)&&!Je(e2)}}function Xe({title:e2,titleLevel:t2,meta:n2,leading:r2,value:i2,trailing:a2,badge:o2,detail:s2,actions:c2,selected:l2,href:u2,navigate:d2,onClick:f2,as:p2="div",className:m2,...h2}){let v2=Ye({href:u2,navigate:d2,onClick:f2}),x2=p2,S2=u2?g("a",{className:"core-list-row__title core-list-row__link",href:u2,onClick:v2.onClick,"aria-current":l2?"true":void 0,...v2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:e2}):g("span",{className:"core-list-row__title",children:e2}),C2=typeof t2=="number"&&Number.isInteger(t2)&&t2>=2&&t2<=6?t2:void 0,w2=C2?`h${C2}`:void 0,T2=w2?g(w2,{className:"core-list-row__heading",children:S2}):S2;return _(x2,{...y(h2),className:b("core-list-row",m2),"data-selected":l2?"":void 0,"aria-current":l2&&!u2?"true":void 0,children:[r2!=null&&g("div",{className:"core-list-row__leading",children:r2}),_("div",{className:"core-list-row__main",children:[o2==null?T2:_("div",{className:"core-list-row__head",children:[T2,g("span",{className:"core-list-row__badge",children:o2})]}),n2!=null&&g("span",{className:"core-list-row__meta",children:n2}),s2!=null&&g("div",{className:"core-list-row__detail",children:s2})]}),i2!=null&&g("div",{className:"core-list-row__value",children:i2}),a2!=null&&g("div",{className:"core-list-row__trailing",children:a2}),c2!=null&&g("div",{className:"core-list-row__actions",children:c2})]})}function Ze({header:e2,children:t2,measure:n2="page",className:r2,...i2}){return g("div",{...y(i2),className:b("core-page-frame",r2),"data-measure":n2,children:_("div",{className:"core-page-frame__column",children:[e2!=null&&g("header",{className:"core-page-frame__header",children:e2}),t2]})})}var Qe=["neutral","strong","accent","info","success","warning","danger"],$e=()=>typeof process>"u"||false;function et(e2,t2="neutral"){return typeof e2=="string"&&Qe.includes(e2)?e2:(typeof e2=="string"&&e2&&$e()&&we(`unknown-tone:${e2}`,`[core] "${e2}" is not a tone (${Qe.join(", ")}); using "${t2}".`),t2)}var tt=["subtle","on-dark","inherit"];function nt(e2,t2){return typeof e2=="string"&&(tt.includes(e2)||Qe.includes(e2))?e2:t2}function rt(e2){return{"data-tone":e2,toned:!tt.includes(e2)}}function it({children:e2,as:t2="span",tone:n2,tabular:r2=false,className:i2,style:a2}){let{toned:o2,...s2}=rt(nt(n2,"subtle"));return g(t2,{className:b("core-eyebrow",o2&&"core-toned",i2),...s2,"data-tabular":r2?"true":void 0,style:a2,children:e2})}var at=6,ot=100,st=e2=>(Array.isArray(e2)?e2:[]).map(e3=>typeof e3=="string"?e3.replace(/\s+/g," ").trim():"").filter(Boolean).map(e3=>e3.length>ot?`${e3.slice(0,99)}…`:e3).slice(0,at);function ct({title:e2,level:t2=2,eyebrow:n2,meta:r2,intro:i2,actions:a2,className:o2,...s2}){let c2=t2===1?"h1":"h2",l2=st(r2);return _("header",{...y(s2),className:b("core-page-head",o2),children:[n2&&g(it,{as:"p",children:n2}),_("div",{className:"core-page-head__row",children:[g(c2,{className:"core-page-head__title","data-page-title":t2===1?void 0:"",children:e2}),a2!=null&&g("div",{className:"core-page-head__actions",children:a2})]}),l2.length>0&&g("p",{className:"core-page-head__meta",children:l2.map((e3,t3)=>g("span",{children:e3},`${t3}-${e3}`))}),i2!=null&&g("p",{className:"core-page-head__intro",children:i2})]})}var lt=Symbol.for("peripheries.viewer.context.v1"),ut=20,dt=/^[a-z0-9]+(?:[-_][a-z0-9]+)*$/,ft=Object.freeze({audience:"client",roles:Object.freeze([])});function pt(e2){if(!e2||typeof e2!="object")return ft;let t2=e2,n2=[...new Set((Array.isArray(t2.roles)?t2.roles:[]).filter(e3=>typeof e3=="string"&&dt.test(e3)&&e3.length<=40))].sort().slice(0,ut);return{audience:t2.audience==="staff"?"staff":"client",roles:n2,...t2.previewing===true?{previewing:true}:{}}}var mt=globalThis,ht=mt[lt]??=r(ft);function gt({value:e2,children:t2}){return g(ht.Provider,{value:pt(e2),children:t2})}function _t(){return o(ht)}var vt=e2=>e2.audience==="staff",yt=(e2,t2)=>e2.roles.includes(t2);function bt(e2,t2,n2){return e2.cardComponent&&typeof t2=="function"?t2(e2.cardComponent,{...n2,event:e2})??null:null}function xt(e2){return e2?typeof e2=="string"?e2:e2.map(e3=>e3&&typeof e3.message=="string"?e3.message:"").filter(Boolean).join(" "):""}var St=["accepted","tentative","declined"],Ct=(e2,t2)=>new Intl.DateTimeFormat(e2,{weekday:"short",month:"short",day:"numeric",timeZone:t2}),wt=(e2,t2)=>new Intl.DateTimeFormat(e2,{hour:"numeric",minute:"2-digit",timeZone:t2}),Tt=e2=>{try{return new Intl.DateTimeFormat("en",{timeZone:e2}).resolvedOptions().timeZone}catch{return}};function Et(e2,t2,n2,r2){let i2=e2.tzid?Tt(e2.tzid):void 0,a2=Tt(r2);return!i2||!a2||i2===a2?"":new Intl.DateTimeFormat(n2,{hour:"numeric",timeZoneName:"short",timeZone:r2}).formatToParts(t2).find(e3=>e3.type==="timeZoneName")?.value??""}function Dt(e2,t2,n2){if(e2.startOn){let n3=new Date(`${e2.startOn}T00:00:00Z`),r3=Ct(t2,"UTC").format(n3);if(!e2.endOn)return`${r3} (all day)`;let i3=new Date(new Date(`${e2.endOn}T00:00:00Z`).getTime()-864e5);return i3.getTime()<=n3.getTime()?`${r3} (all day)`:`${r3} – ${Ct(t2,"UTC").format(i3)}`}if(!e2.startsAt)return"";let r2=new Date(e2.startsAt);if(Number.isNaN(r2.getTime()))return"";let i2=Ct(t2,n2).format(r2),a2=wt(t2,n2).format(r2),o2=Et(e2,r2,t2,n2),s2=o2?` ${o2}`:"";if(!e2.endsAt)return`${i2} · ${a2}${s2}`;let c2=new Date(e2.endsAt);return Number.isNaN(c2.getTime())||c2.getTime()===r2.getTime()?`${i2} · ${a2}${s2}`:`${i2} · ${a2} – ${wt(t2,n2).format(c2)}${s2}`}var Ot=()=>Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC";function kt(e2){if(!e2)return;let t2=new Date(e2);return Number.isNaN(t2.getTime())?void 0:t2.toISOString()}function At(){let e2=new Date;return e2.setMinutes(e2.getMinutes()-e2.getTimezoneOffset()),e2.toISOString().slice(0,16)}function jt(e2){return e2.success?"":e2.code==="DENIED"?"You can't do that here.":e2.code==="CONFLICT"?"Someone changed this first. Reload and try again.":e2.code==="INVALID"?xt(e2.errors)||"Some details are missing or not valid.":xt(e2.errors)||"Something went wrong. Try again."}function Mt(e2,t2){let n2=typeof e2=="string"?new Date(e2):e2;return new Intl.DateTimeFormat("en-CA",{timeZone:t2,year:"numeric",month:"2-digit",day:"2-digit"}).format(n2)}function Y(e2,t2){let n2=new Date(`${e2}T00:00:00Z`);return n2.setUTCDate(n2.getUTCDate()+t2),n2.toISOString().slice(0,10)}function Nt(e2){return Y(e2,-((new Date(`${e2}T00:00:00Z`).getUTCDay()+6)%7))}function Pt(e2,t2){if(e2.startOn){let t3=e2.endOn&&e2.endOn>e2.startOn?e2.endOn:Y(e2.startOn,1),n2=[];for(let r2=e2.startOn;r2<t3&&n2.length<62;r2=Y(r2,1))n2.push(r2);return n2}return e2.startsAt?[Mt(e2.startsAt,t2)]:[]}var Ft=(e2,t2)=>e2&&t2?e2.split("{id}").join(encodeURIComponent(t2)):void 0;function X(e2){if(typeof e2!="string")return;let t2=e2.replace(/\s+/g," ").trim();if(t2!=="")return t2.length>60?`${t2.slice(0,59)}…`:t2}var It="This can’t be done from here yet.";function Lt(e2){let[t2,n2]=p(null),[r2,i2]=p(""),o2=f(false),s2=typeof e2=="function";return{run:a(async(t3,r3)=>{if(typeof e2!="function"||o2.current)return{ok:false};o2.current=true,n2(t3),i2("");try{let n3=await e2(r3?{action:t3,values:r3}:{action:t3});return n3&&typeof n3=="object"&&n3.success===false?(i2(jt(n3)||"Something went wrong. Try again."),{ok:false,result:n3}):{ok:true,result:n3}}catch{return i2("Something went wrong. Try again."),{ok:false}}finally{o2.current=false,n2(null)}},[e2]),busy:t2,message:r2,available:s2,clearMessage:()=>i2("")}}function Rt(e2){if(typeof e2!="string")return;let t2=e2.trim();if(t2===""||/[\\\u0000-\u001f]/.test(t2))return;let n2=t2;for(let e3=0;e3<3;e3++)try{let e4=decodeURIComponent(n2);if(e4===n2)break;n2=e4}catch{return}if(/[\\\u0000-\u001f]/.test(n2)||n2.startsWith("//")||/^[a-z][a-z0-9+.-]*:/i.test(n2))return;let r2=n2.split(/[?#]/)[0]??"";if(!(/^\/(auth|api)(\/|$)/i.test(r2.replace(/\/\.\//g,"/"))||/(^|\/)\.\.(\/|$)/.test(r2)))return/^[/?#]/.test(t2)?t2:void 0}var zt={unreleased:"wait",released:"shared",changed:"ready",staff:"stop",withdrawn:"out"};function Bt(e2){if(e2?.state==="staff_only")return{words:"Staff only",mark:zt.staff};if(e2?.state==="withdrawn")return{words:"Withdrawn · not visible to client",mark:zt.withdrawn};if(e2?.state!=="released")return{words:"Not released yet",mark:zt.unreleased};let t2=e2.number,n2=e2.hasChanges===true;return{words:`Visible to client${typeof t2=="number"&&Number.isInteger(t2)&&t2>0?` · release ${t2}`:""}${n2?" · edited since":""}`,mark:n2?zt.changed:zt.released}}function Vt(e2){let{release:t2,canRelease:n2=true,onIntent:r2,className:i2,style:a2}=e2,o2=c(),s2=vt(_t()),{run:l2,busy:u2,message:d2,available:f2}=Lt(r2);if(!s2)return null;let{words:p2,mark:m2}=Bt(t2),h2=e2.busy===true||u2==="release",v2=Rt(e2.versionsHref),y2=Rt(e2.viewAsHref),x2=t2?.state==="staff_only",S2=n2!==false&&f2&&!x2,C2=h2?"Releasing…":t2?.state==="withdrawn"?"Release again":t2?.state==="released"&&t2.hasChanges===true?"Release changes":"Release",w2=[];(v2||f2)&&w2.push({id:"versions",label:"Versions",href:v2,action:"view_versions"}),!x2&&(y2||f2)&&w2.push({id:"view-as",label:"View as client",href:y2,action:"view_as_client"}),f2&&w2.push({id:"edit",label:"Edit with the assistant",action:"edit_with_assistant"});let T2=w2.map(e3=>({id:e3.id,label:e3.label,...e3.href?{href:e3.href}:{onSelect:()=>void l2(e3.action)}}));return _("div",{className:b("core-page-staff-tools",i2),style:a2,role:"group","aria-label":"Staff tools for this page","data-state":x2?"staff_only":t2?.state==="released"?"released":"unreleased","aria-busy":h2||void 0,children:[_("div",{className:"core-page-staff-tools__bar",children:[_("span",{className:"core-page-staff-tools__pill",role:"status",children:[g("span",{className:"core-page-staff-tools__mark","data-mark":m2,"aria-hidden":"true"}),p2]}),_("div",{className:"core-page-staff-tools__actions",children:[S2?g("button",{type:"button",className:"core-page-staff-tools__button","data-primary":"",disabled:h2,"aria-describedby":`${o2}-note`,onClick:()=>void l2("release"),children:C2}):null,w2.map(e3=>e3.href?g("a",{className:"core-page-staff-tools__button core-page-staff-tools__other",href:e3.href,children:e3.label},e3.id):g("button",{type:"button",className:"core-page-staff-tools__button core-page-staff-tools__other",onClick:()=>void l2(e3.action),children:e3.label},e3.id)),T2.length>0?g(Se,{label:"Staff tools",placement:"bottom-end",items:T2,trigger:g("button",{type:"button",className:"core-page-staff-tools__button core-page-staff-tools__more","aria-label":"More staff tools",children:"More"})}):null]})]}),g("span",{id:`${o2}-note`,className:"core-page-staff-tools__sr",children:S2?t2?.state==="released"?"Release makes the latest changes visible to the client.":"Release makes this page visible to the client.":""}),d2?g("p",{className:"core-page-staff-tools__message",role:"alert",children:d2}):null]})}function Ht({label:e2,actions:t2,children:n2,rail:r2=false,anchor:i2,className:a2,...o2}){return g("section",{...y(o2),id:i2,"aria-label":e2,className:b("core-rule-section",a2),"data-rail":r2||void 0,children:_("div",{className:"core-rule-section__grid",children:[_("div",{className:"core-rule-section__head",children:[e2&&g(it,{as:"p",children:e2}),t2!=null&&g("div",{className:"core-rule-section__actions",children:t2})]}),g("div",{className:"core-rule-section__body",children:n2})]})})}function Ut({label:e2,children:t2,arrow:n2=true,className:r2,href:i2,action:a2,input:o2,actions:s2,navigate:c2,onClick:l2,...u2}){let d2=Ye({href:i2,action:a2,input:o2,actions:s2,navigate:c2,onClick:l2}),f2=_(h,{children:[g("span",{className:"core-underlined-action__label",children:t2??e2}),n2&&g("svg",{className:"core-underlined-action__arrow",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:g("path",{d:"M5 12h14M13 6l6 6-6 6"})})]}),p2={...y(u2),className:b("core-underlined-action",r2)};return i2?g("a",{...p2,href:i2,onClick:d2.onClick,...d2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:f2}):g("button",{...p2,type:"button",onClick:d2.onClick,disabled:d2.busy,children:f2})}var Wt=(e2="")=>e2.trim().split(/\s+/).filter(Boolean).map(e3=>e3[0].toUpperCase()).filter((e3,t2,n2)=>t2===0||t2===n2.length-1).join("").slice(0,2);function Gt({name:e2,initials:t2,src:n2,alt:r2,size:i2="md",tone:a2,title:o2,className:s2,...c2}){let[l2,u2]=p(false),d2=o2??r2??e2??"";return g("span",{...y(c2),className:b("core-avatar",a2!==void 0&&"core-toned",s2),"data-size":i2,"data-tone":a2===void 0?void 0:et(a2),role:"img","aria-label":d2||void 0,children:n2&&!l2?g("img",{src:n2,alt:"",onError:()=>u2(true)}):g("span",{"aria-hidden":"true",children:t2??Wt(e2)})})}function Kt({code:e2,children:t2,block:n2=false,className:r2,...i2}){let a2=t2??e2;return n2?g("pre",{...y(i2),className:b("core-code",r2),"data-block":"",children:g("code",{children:a2})}):g("code",{...y(i2),className:b("core-code",r2),children:a2})}var qt={1:"lg",2:"md",3:"sm",4:"xs",5:"xs",6:"xs"};function Jt({text:e2,children:t2,level:n2=2,size:r2,anchor:i2,className:a2,...o2}){let s2=Math.min(6,Math.max(1,Math.round(n2))),c2=`h${s2}`;return g(c2,{...y(o2),id:i2,className:b("core-heading",a2),"data-size":r2??qt[s2],children:t2??e2})}var Yt={xs:"eyebrow",sm:"body-sm",md:"body",lg:"title-sm",xl:"title-md"};function Xt({text:e2,children:t2,as:n2="span",size:r2="md",weight:i2="normal",tone:a2="default",align:o2="start",truncate:s2=false,lines:c2,className:l2,...u2}){let d2=n2,f2=c2&&c2>0?Math.min(6,Math.round(c2)):void 0;return g(d2,{...y(u2),className:b("core-text",l2),"data-role":Yt[r2]??"body","data-weight":i2,"data-tone":a2,"data-align":o2,"data-truncate":s2||void 0,"data-lines":f2,children:t2??e2})}function Zt({label:e2,hint:t2,helperText:n2,error:r2,required:i2,optional:a2,htmlFor:o2,id:s2,hintId:l2,errorId:u2,as:d2="div",children:f2,className:p2,style:m2}){let h2=t2??n2,v2=o2??s2,y2=c().replace(/:/g,""),x2=l2??(h2?`${v2??y2}-hint`:void 0),S2=u2??(r2?`${v2??y2}-error`:void 0),C2=d2,w2=d2==="fieldset"?"legend":"label";return _(C2,{className:b("core-field",p2),style:m2,"data-invalid":r2?"":void 0,children:[e2&&_(w2,{className:"core-field__label",...w2==="label"&&v2?{htmlFor:v2}:{},children:[e2,i2&&_("span",{className:"core-field__required","aria-hidden":"true",children:[" ","*"]}),a2&&!i2&&g("span",{className:"core-field__optional",children:" (optional)"})]}),h2&&g("p",{className:"core-field__hint",id:x2,children:h2}),f2,r2&&g("p",{className:"core-field__error",id:S2,role:"alert",children:r2})]})}function Qt(e2,t2,n2){let r2=c(),i2=e2??`f${r2.replace(/:/g,"")}`,a2=t2?`${i2}-hint`:void 0,o2=n2?`${i2}-error`:void 0;return{control:i2,hintId:a2,errorId:o2,aria:{"aria-describedby":[a2,o2].filter(Boolean).join(" ")||void 0,"aria-invalid":n2?true:void 0}}}function $t(e2){let t2={};for(let[n2,r2]of Object.entries(e2))(n2==="title"||n2==="autoFocus"||n2.startsWith("aria-")||n2.startsWith("data-"))&&(t2[n2]=r2);return t2}function en(e2,t2){return{"aria-describedby":[t2["aria-describedby"],e2.aria["aria-describedby"]].filter(Boolean).join(" ")||void 0,"aria-invalid":e2.aria["aria-invalid"]??t2["aria-invalid"]}}function tn(e2,t2){return n2=>{e2?.(n2),t2?.(n2)}}function nn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,children:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:f2,onBlur:m2,onFocus:h2,className:v2,wrapperClassName:y2,style:x2,ref:S2,...C2}){let w2=Qt(i2,c2,l2),T2=$t(C2),[E2,D2]=p(t2??false),O2=e2??E2,k2=tn(n2,r2);return g(Zt,{className:b("core-checkbox",y2),style:x2,hint:c2,error:l2,hintId:w2.hintId,errorId:w2.errorId,children:_("label",{className:"core-choices__option","data-disabled":d2?"":void 0,children:[g("input",{...T2,ref:S2,id:w2.control,type:"checkbox",className:v2,name:a2,checked:O2,required:u2,"aria-required":u2||void 0,disabled:d2,"aria-readonly":f2||void 0,onChange:t3=>{f2||(e2===void 0&&D2(t3.target.checked),k2(t3.target.checked))},onBlur:m2,onFocus:h2,...en(w2,T2)}),_("span",{children:[s2??o2,u2&&g("span",{className:"core-field__required","aria-hidden":"true",children:" *"})]})]})})}function rn({options:e2,value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:o2,label:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:f2,orientation:m2="vertical",min:h2,max:v2,className:y2,style:x2,ref:S2}){let C2=[h2===void 0?"":`at least ${h2}`,v2===void 0?"":`at most ${v2}`].filter(Boolean).join(", "),w2=[c2,C2?`Choose ${C2}.`:""].filter(Boolean).join(" ")||void 0,T2=Qt(a2,w2,l2),[E2,D2]=p(n2??[]),O2=t2??E2,k2=tn(r2,i2),A2=v2!==void 0&&O2.length>=v2;return g(Zt,{as:"fieldset",className:b("core-choices",y2),style:x2,label:s2,hint:w2,error:l2,required:u2,hintId:T2.hintId,errorId:T2.errorId,children:g("div",{className:"core-choices__list","data-orientation":m2,role:"group",...T2.aria,children:e2.map((n3,r3)=>{let i3=O2.includes(n3.value);return _("label",{className:"core-choices__option","data-disabled":n3.disabled||d2?"":void 0,children:[g("input",{ref:r3===0?S2:void 0,id:r3===0?T2.control:void 0,type:"checkbox",name:o2,value:n3.value,checked:i3,disabled:n3.disabled||d2||!i3&&A2||f2&&!i3,"aria-readonly":f2||void 0,onChange:()=>{if(f2)return;let r4=e2.map(e3=>e3.value).filter(e3=>e3===n3.value?!i3:O2.includes(e3));t2===void 0&&D2(r4),k2(r4)}}),g("span",{children:n3.label})]},n3.value)})})})}function an({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,required:l2,disabled:u2,readOnly:d2,min:f2,max:m2,fromLabel:h2="From",toLabel:v2="To",className:y2,style:x2,ref:S2}){let C2=Qt(i2,s2,c2),[w2,T2]=p(t2??{from:null,to:null}),E2=e2??w2,D2=tn(n2,r2),O2=(t3,n3)=>{if(d2)return;let r3={...E2,[t3]:n3===""?null:n3};e2===void 0&&T2(r3),D2(r3)},k2={disabled:u2,readOnly:d2,required:l2,"aria-required":l2||void 0,className:"core-input",...C2.aria};return g(Zt,{as:"fieldset",className:b("core-date-range",y2),style:x2,label:o2,hint:s2,error:c2,required:l2,hintId:C2.hintId,errorId:C2.errorId,children:_("div",{className:"core-date-range__row",children:[_("label",{className:"core-date-range__part",children:[g("span",{className:"core-date-range__label",children:h2}),g("input",{ref:S2,id:C2.control,type:"date",name:a2?`${a2}.from`:void 0,value:E2.from??"",min:f2,max:E2.to??m2,onChange:e3=>O2("from",e3.target.value),...k2})]}),_("label",{className:"core-date-range__part",children:[g("span",{className:"core-date-range__label",children:v2}),g("input",{type:"date",name:a2?`${a2}.to`:void 0,value:E2.to??"",min:E2.from??f2,max:m2,onChange:e3=>O2("to",e3.target.value),...k2})]})]})})}function on(e2){return!Number.isFinite(e2)||e2<0?"":e2<1024?`${e2} B`:e2<1048576?`${(e2/1024).toFixed(+(e2<10240))} KB`:`${(e2/1048576).toFixed(1)} MB`}function sn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,required:l2,disabled:u2,readOnly:d2,upload:m2,accept:v2,hash:y2=false,className:x2,style:S2,ref:C2}){let w2=Qt(i2,s2,c2),[T2,E2]=p(t2??null),D2=e2===void 0?T2:e2,O2=tn(n2,r2),[k2,A2]=p({busy:false,dragging:false}),j2=f(null),M2=t3=>{e2===void 0&&E2(t3),O2(t3)},N2=async e3=>{if(e3&&m2&&!d2&&!u2){A2({busy:true,dragging:false});try{let t3=await m2(e3,{hash:y2});"error"in t3?A2({busy:false,failed:t3.error,dragging:false}):(A2({busy:false,dragging:false}),M2(t3))}catch{A2({busy:false,failed:"That file couldn’t be stored. Try again.",dragging:false})}}},P2=e3=>{e3.preventDefault(),N2(e3.dataTransfer.files?.[0])},F2=c2??k2.failed;return g(Zt,{className:b("core-file-field",x2),style:S2,label:o2,hint:s2,error:F2,required:l2,htmlFor:w2.control,hintId:w2.hintId,errorId:F2?`${w2.control}-error`:void 0,children:_("div",{className:"core-file-field__box","data-dragging":k2.dragging?"":void 0,"data-busy":k2.busy?"":void 0,onDragOver:e3=>{d2||u2||!m2||(e3.preventDefault(),k2.dragging||A2(e4=>({...e4,dragging:true})))},onDragLeave:()=>A2(e3=>({...e3,dragging:false})),onDrop:P2,children:[D2?_("div",{className:"core-file-field__file",children:[g("span",{className:"core-file-field__name",children:D2.file.name}),g("span",{className:"core-file-field__size",children:on(D2.file.size)}),!d2&&!u2&&g("button",{type:"button",className:"core-file-field__button",onClick:()=>M2(null),"aria-label":`Remove ${D2.file.name}`,children:"Remove"})]}):k2.busy?g("span",{className:"core-file-field__status",role:"status",children:"Uploading…"}):_(h,{children:[g("button",{ref:C2,id:w2.control,type:"button",className:"core-file-field__button",disabled:u2||d2||!m2,"aria-required":l2||void 0,"aria-describedby":[w2.hintId,F2?`${w2.control}-error`:void 0].filter(Boolean).join(" ")||void 0,"aria-invalid":F2?true:void 0,onClick:()=>j2.current?.click(),children:"Choose file"}),g("span",{className:"core-file-field__drop",children:"or drop it here"})]}),g("input",{ref:j2,type:"file",name:a2,accept:v2,hidden:true,tabIndex:-1,onChange:e3=>void N2(e3.target.files?.[0])})]})})}function cn({options:e2,value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:o2,label:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:f2,orientation:m2="vertical",className:h2,wrapperClassName:v2,style:y2,ref:x2,...S2}){let C2=Qt(a2,c2,l2),w2=$t(S2),[T2,E2]=p(n2??null),D2=t2===void 0?T2:t2,O2=tn(r2,i2),k2=o2??C2.control;return g(Zt,{as:"fieldset",className:b("core-choices",v2),style:y2,label:s2,hint:c2,error:l2,required:u2,hintId:C2.hintId,errorId:C2.errorId,children:g("div",{...w2,className:b("core-choices__list",h2),"data-orientation":m2,role:"radiogroup","aria-required":u2||void 0,...en(C2,w2),children:e2.map((e3,n3)=>_("label",{className:"core-choices__option","data-disabled":e3.disabled||d2?"":void 0,children:[g("input",{ref:n3===0?x2:void 0,id:n3===0?C2.control:void 0,type:"radio",name:k2,value:e3.value,checked:D2===e3.value,disabled:e3.disabled||d2||f2&&D2!==e3.value,onChange:()=>{f2||(t2===void 0&&E2(e3.value),O2(e3.value))}}),g("span",{children:e3.label})]},e3.value))})})}var ln=e2=>{if(e2.trim()==="")return null;let t2=Number(e2);return Number.isFinite(t2)?t2:null};function un({type:e2="text",value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:o2,label:c2,hint:l2,error:u2,required:d2,disabled:f2,readOnly:m2,placeholder:h2,inputMode:v2,autoComplete:y2,min:x2,max:S2,step:C2,prefix:w2,suffix:T2,onEnter:E2,onKeyDown:D2,onBlur:O2,onFocus:k2,className:A2,wrapperClassName:j2,style:M2,ref:N2,...P2}){let F2=Qt(a2,l2,u2),I2=$t(P2),[L2,R2]=p(n2),z2=t2===void 0?L2:t2,B2=tn(r2,i2),ee2=e3=>e3==null?"":String(e3),[V2,H2]=p(ee2(z2));s(()=>{e2==="number"&&ln(V2)!==(z2??null)&&H2(ee2(z2))},[z2]);let U2=e3=>{D2?.(e3),!e3.defaultPrevented&&E2&&e3.key==="Enter"&&!e3.shiftKey&&!e3.nativeEvent.isComposing&&e3.keyCode!==229&&E2(e3)},W2=g("input",{...I2,ref:N2,id:F2.control,name:o2,type:e2==="number"?"text":e2,className:b("core-input core-text-field__input",A2),value:e2==="number"?V2:ee2(z2),onChange:n3=>{let r3=n3.target.value,i3=e2==="number"?ln(r3):r3;e2==="number"&&H2(r3),t2===void 0&&R2(i3),B2(i3)},onKeyDown:U2,onBlur:O2,onFocus:k2,placeholder:h2,inputMode:v2??(e2==="number"?"decimal":void 0),autoComplete:y2,min:x2,max:S2,step:C2,required:d2,"aria-required":d2||void 0,disabled:f2,readOnly:m2,...en(F2,I2)}),G2=w2||T2?_("div",{className:"core-text-field__affixed",children:[w2&&g("span",{className:"core-text-field__affix","aria-hidden":"true",children:w2}),W2,T2&&g("span",{className:"core-text-field__affix","aria-hidden":"true",children:T2})]}):W2;return g(Zt,{className:b("core-text-field",j2),style:M2,label:c2,hint:l2,error:u2,required:d2,htmlFor:F2.control,hintId:F2.hintId,errorId:F2.errorId,children:G2})}function dn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,label:i2="Search",onSearch:a2,onClear:o2,size:s2="md",className:c2,wrapperClassName:l2,...u2}){let[d2,f2]=p(t2??""),m2=e2??d2,h2=t3=>{e2===void 0&&f2(t3),n2?.(t3),r2?.(t3)};return _("div",{className:b("core-search-field",l2),"data-filled":m2?"":void 0,"data-size":s2,children:[g(un,{...u2,label:i2,value:m2,onChange:e3=>h2(typeof e3=="string"?e3:""),onEnter:()=>a2?.(m2),type:"search",inputMode:"search",className:c2,wrapperClassName:"core-search-field__field"}),_("svg",{className:"core-search-field__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:[g("circle",{cx:"11",cy:"11",r:"6.5"}),g("path",{d:"M16 16l4 4"})]}),m2&&!u2.disabled&&!u2.readOnly&&g("button",{type:"button",className:"core-search-field__clear","aria-label":"Clear search",onClick:()=>{h2(""),o2?.()},children:g("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:g("path",{d:"M6 6l12 12M18 6L6 18"})})})]})}function fn({options:e2,value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:o2,label:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:f2,placeholder:m2="Choose…",onBlur:h2,onFocus:v2,className:y2,wrapperClassName:x2,style:S2,ref:C2,...w2}){let T2=Qt(a2,c2,l2),E2=$t(w2),[D2,O2]=p(n2??null),k2=t2===void 0?D2:t2,A2=tn(r2,i2);return g(Zt,{className:b("core-select",x2),style:S2,label:s2,hint:c2,error:l2,required:u2,htmlFor:T2.control,hintId:T2.hintId,errorId:T2.errorId,children:_("select",{...E2,ref:C2,id:T2.control,name:o2,className:b("core-input core-select__input",y2),value:k2??"",onChange:e3=>{let n3=e3.target.value===""?null:e3.target.value;t2===void 0&&O2(n3),A2(n3)},required:u2,"aria-required":u2||void 0,disabled:d2||f2,"aria-readonly":f2||void 0,onBlur:h2,onFocus:v2,...en(T2,E2),children:[g("option",{value:"",children:m2}),e2.map(e3=>g("option",{value:e3.value,disabled:e3.disabled,children:e3.label},e3.value))]})})}function pn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,required:l2,disabled:u2,readOnly:d2,min:f2=0,max:m2=100,step:h2=1,format:v2=String,onBlur:y2,onFocus:x2,className:S2,wrapperClassName:C2,style:w2,ref:T2,...E2}){let D2=Qt(i2,s2,c2),O2=$t(E2),[k2,A2]=p(t2??f2),j2=e2??k2,M2=tn(n2,r2);return g(Zt,{className:b("core-slider",C2),style:w2,label:o2,hint:s2,error:c2,required:l2,htmlFor:D2.control,hintId:D2.hintId,errorId:D2.errorId,children:_("div",{className:"core-slider__row",children:[g("input",{...O2,ref:T2,id:D2.control,name:a2,type:"range",className:b("core-slider__input",S2),min:f2,max:m2,step:h2,value:j2,disabled:u2,"aria-readonly":d2||void 0,"aria-valuetext":v2(j2),onChange:t3=>{if(d2)return;let n3=Number(t3.target.value);e2===void 0&&A2(n3),M2(n3)},onBlur:y2,onFocus:x2,...en(D2,O2)}),g("output",{className:"core-slider__value",htmlFor:D2.control,children:v2(j2)})]})})}function mn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,disabled:l2,readOnly:u2,onBlur:d2,onFocus:f2,className:m2,wrapperClassName:h2,style:v2,ref:y2,...x2}){let S2=Qt(i2,s2,c2),C2=$t(x2),[w2,T2]=p(t2??false),E2=e2??w2,D2=tn(n2,r2);return _("div",{className:b("core-switch",h2),style:v2,children:[_("button",{...C2,ref:y2,id:S2.control,name:a2,type:"button",role:"switch","aria-checked":E2,"aria-readonly":u2||void 0,disabled:l2,className:b("core-switch__control",m2),onClick:()=>{u2||(e2===void 0&&T2(!E2),D2(!E2))},onBlur:d2,onFocus:f2,...en(S2,C2),children:[g("span",{className:"core-switch__track","aria-hidden":"true",children:g("span",{className:"core-switch__thumb"})}),g("span",{className:"core-switch__label",children:o2})]}),s2&&g("p",{className:"core-field__hint",id:S2.hintId,children:s2}),c2&&g("p",{className:"core-field__error",id:S2.errorId,role:"alert",children:c2})]})}function hn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,required:u2,disabled:d2,readOnly:m2,placeholder:h2,rows:v2=3,autoGrow:y2=true,maxLength:x2,onKeyDown:S2,onBlur:C2,onFocus:w2,className:T2,wrapperClassName:E2,style:D2,ref:O2,...k2}){let A2=Qt(i2,s2,c2),j2=$t(k2),[M2,N2]=p(t2??""),P2=e2??M2,F2=tn(n2,r2),I2=f(null);return l(()=>{let e3=I2.current;y2&&e3&&(e3.style.height="auto",e3.style.height=`${e3.scrollHeight+2}px`)},[P2,y2]),_(Zt,{className:b("core-text-area",E2),style:D2,label:o2,hint:s2,error:c2,required:u2,htmlFor:A2.control,hintId:A2.hintId,errorId:A2.errorId,children:[g("textarea",{...j2,ref:e3=>{I2.current=e3,typeof O2=="function"?O2(e3):O2&&(O2.current=e3)},id:A2.control,name:a2,className:b("core-input core-text-area__input",T2),rows:v2,value:P2,onChange:t3=>{e2===void 0&&N2(t3.target.value),F2(t3.target.value)},onKeyDown:S2,onBlur:C2,onFocus:w2,placeholder:h2,maxLength:x2,required:u2,"aria-required":u2||void 0,disabled:d2,readOnly:m2,...en(A2,j2)}),x2!==void 0&&_("span",{className:"core-field__hint","aria-live":"polite",children:[P2.length," / ",x2]})]})}function gn({label:e2,children:t2,tone:n2,variant:r2="soft",className:i2,...a2}){return g("span",{...y(a2),className:b("core-badge","core-toned",i2),"data-tone":et(n2),"data-variant":r2,children:t2??e2})}function _n({message:e2,title:t2,action:n2,className:r2,...i2}){return _("div",{...y(i2),className:b("core-empty-state",r2),role:"status",children:[t2&&g("p",{className:"core-empty-state__title",children:t2}),g("p",{className:"core-empty-state__message",children:e2}),n2!=null&&g("div",{className:"core-empty-state__action",children:n2})]})}var vn={info:"M12 16v-5M12 8h.01M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z",success:"M8 12.5l2.5 2.5L16 9.5M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z",warning:"M12 9v4M12 17h.01M10.3 3.9L2.2 18a2 2 0 0 0 1.7 3h16.2a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",danger:"M12 8v5M12 16h.01M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z"};function yn({title:e2,message:t2,children:n2,tone:r2,action:i2,onDismiss:a2,className:o2,...s2}){let c2=et(r2,"info"),l2=c2==="warning"||c2==="danger";return _("div",{...y(s2),role:l2?"alert":"status",className:b("core-notice","core-toned",o2),"data-tone":c2,children:[g("svg",{className:"core-notice__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:g("path",{d:vn[c2]??vn.info})}),_("div",{className:"core-notice__body",children:[e2&&g("p",{className:"core-notice__title",children:e2}),g("div",{className:"core-notice__message",children:n2??t2})]}),i2&&g("div",{className:"core-notice__action",children:i2}),a2&&g("button",{type:"button",className:"core-notice__dismiss","aria-label":"Dismiss",onClick:a2,children:g("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:g("path",{d:"M6 6l12 12M18 6L6 18"})})})]})}function bn({value:e2,max:t2=100,label:n2,showValue:r2=false,tone:i2,size:a2="md",className:o2,style:s2,...c2}){let l2=typeof e2=="number"&&Number.isFinite(e2)&&t2>0,u2=l2?Math.max(0,Math.min(100,e2/t2*100)):0;return _("div",{...y(c2),className:b("core-progress","core-toned",o2),"data-tone":et(i2,"accent"),"data-size":a2,style:s2,children:[(n2||r2&&l2)&&_("div",{className:"core-progress__head",children:[n2&&g("span",{className:"core-progress__label",children:n2}),r2&&l2&&_("span",{className:"core-progress__value",children:[Math.round(u2),"%"]})]}),g("div",{className:"core-progress__track",role:"progressbar","aria-label":n2,"aria-valuemin":0,"aria-valuemax":l2?t2:void 0,"aria-valuenow":l2?e2:void 0,"data-indeterminate":l2?void 0:"",style:S({"--core-progress-fill":`${u2}%`}),children:g("div",{className:"core-progress__fill"})})]})}function xn({shape:e2="text",lines:t2=3,width:n2,height:r2,className:i2,style:a2,...o2}){let s2=S({"--core-skeleton-w":x(n2),"--core-skeleton-h":x(r2)},a2);if(e2!=="text")return g("span",{...y(o2),"aria-hidden":"true",className:b("core-skeleton",i2),"data-shape":e2,style:s2});let c2=Math.max(1,Math.min(12,Math.round(t2)));return g("span",{...y(o2),"aria-hidden":"true",className:b("core-skeleton-lines",i2),style:s2,children:Array.from({length:c2},(e3,t3)=>g("span",{className:"core-skeleton","data-shape":"line","data-last":t3===c2-1&&c2>1?"":void 0},t3))})}function Sn({label:e2="Loading",size:t2="md",className:n2,...r2}){return g("span",{...y(r2),role:"status","aria-label":e2,className:b("core-spinner",n2),"data-size":t2})}function Cn({content:e2,text:t2,children:n2,side:r2="top",className:i2,...a2}){let[o2,l2]=p(false),u2=c();return s(()=>{if(!o2)return;let e3=e4=>{e4.key==="Escape"&&l2(false)};return document.addEventListener("keydown",e3),()=>document.removeEventListener("keydown",e3)},[o2]),_("span",{...y(a2),className:b("core-tooltip",i2),"aria-describedby":u2,onMouseEnter:()=>l2(true),onMouseLeave:()=>l2(false),onFocus:()=>l2(true),onBlur:()=>l2(false),children:[n2,g("span",{id:u2,role:"tooltip",className:"core-tooltip__bubble","data-side":r2,"data-open":o2?"":void 0,children:e2??t2})]})}function wn({children:t2,className:r2,style:a2,...o2}){let s2=e.toArray(t2),c2=s2.length===1?s2[0]:null;if(!i(c2))return null;let l2=c2.props??{},u2={...o2,...l2},d2=[r2,l2.className].filter(Boolean).join(" ");d2&&(u2.className=d2),(a2||l2.style)&&(u2.style={...a2,...l2.style});for(let e2 of Object.keys(o2)){let t3=o2[e2],n2=l2[e2];/^on[A-Z]/.test(e2)&&typeof t3=="function"&&typeof n2=="function"&&(u2[e2]=e3=>{t3(e3)!==false&&n2(e3)})}return n(c2,u2)}function Tn({children:e2,label:t2,variant:n2="primary",size:r2="md",tone:i2="neutral",iconLeft:a2,iconRight:o2,loading:s2=false,disabled:c2=false,type:l2="button",fullWidth:u2=false,asChild:d2=false,className:f2,href:p2,action:m2,input:v2,actions:x2,navigate:S2,onClick:C2,...w2}){let T2=Ye({href:p2,action:m2,input:v2,actions:x2,navigate:S2,onClick:C2}),E2=s2||T2.busy,D2={...y(w2),className:b("core-button",f2),"data-variant":n2,"data-size":r2,"data-tone":i2,"data-full":u2||void 0,"data-busy":E2||void 0},O2=_(h,{children:[E2?g("span",{className:"core-button__spinner","aria-hidden":"true"}):a2,g("span",{className:"core-button__label",children:e2??t2}),o2]});if(d2){let t3=c2||E2,n3=e3=>t3?(e3.preventDefault(),false):T2.onClick(e3);return g(wn,{...D2,"aria-disabled":t3||void 0,"aria-busy":E2||void 0,onClick:n3,children:e2})}return p2&&!c2?g("a",{...D2,href:p2,onClick:T2.onClick,"aria-busy":E2||void 0,...T2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:O2}):g("button",{...D2,type:l2,disabled:c2||E2,"aria-busy":E2||void 0,onClick:T2.onClick,children:O2})}function En({children:e2,label:t2,variant:n2="prompt",size:r2="md",selected:i2,onToggle:a2,iconLeft:o2,disabled:s2=false,className:c2,href:l2,action:u2,input:d2,actions:f2,navigate:p2,onClick:m2,...h2}){let v2=i2!==void 0||a2!==void 0,x2=Ye({href:l2,action:u2,input:d2,actions:f2,navigate:p2,onClick:m2??(a2?()=>a2(!i2):void 0)});return l2&&!s2&&!v2?_("a",{...y(h2),className:b("core-chip",c2),"data-variant":n2,"data-size":r2,href:l2,onClick:x2.onClick,...x2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:[o2,g("span",{className:"core-chip__label",children:e2??t2})]}):_("button",{...y(h2),type:"button",className:b("core-chip",c2),"data-variant":n2,"data-size":r2,"aria-pressed":v2?!!i2:void 0,disabled:s2||x2.busy,onClick:x2.onClick,children:[o2,g("span",{className:"core-chip__label",children:e2??t2})]})}function Dn({icon:e2,children:t2,label:n2,size:r2="md",variant:i2="ghost",pressed:a2,disabled:o2=false,className:s2,href:c2,action:l2,input:u2,actions:d2,navigate:f2,onClick:p2,...m2}){let h2=Ye({href:c2,action:l2,input:u2,actions:d2,navigate:f2,onClick:p2}),_2={...y(m2),className:b("core-icon-button",s2),"data-size":r2,"data-variant":i2,"aria-label":n2,title:n2},v2=g("span",{className:"core-icon-button__glyph","aria-hidden":"true",children:e2??t2});return c2&&!o2?g("a",{..._2,href:c2,onClick:h2.onClick,...h2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:v2}):g("button",{..._2,type:"button","aria-pressed":a2,disabled:o2||h2.busy,onClick:h2.onClick,children:v2})}function On({href:e2,children:t2,label:n2,variant:r2="default","aria-current":i2,className:a2,navigate:o2,onClick:s2,...c2}){let l2=Ye({href:e2,navigate:o2,onClick:s2});return qe(e2)||Je(e2)||/^(https?:|mailto:)/i.test(e2)?_("a",{...y(c2),className:b("core-link",a2),"data-variant":r2,"aria-current":i2,href:e2,onClick:l2.onClick,...l2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:[t2??n2,l2.external&&_(h,{children:[g("svg",{className:"core-link__away",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:g("path",{d:"M7 17L17 7M8 7h9v9"})}),g("span",{className:"core-link__note",children:" (opens in a new tab)"})]})]}):g("span",{className:b("core-link",a2),children:t2??n2})}function kn(e2){let{param:t2="kind",keep:n2,label:r2="Filter",onChange:i2,className:a2,style:o2}=e2,s2=(Array.isArray(e2.options)?e2.options:[]).filter(e3=>e3&&typeof e3.id=="string"&&typeof e3.label=="string"&&e3.label!=="");if(s2.length===0)return null;let c2=typeof e2.selected=="string"&&s2.some(t3=>t3.id===e2.selected)?e2.selected:s2[0].id;return g("form",{className:"core-filter-chips-form",method:"get",action:"",onSubmit:e3=>{if(!i2)return;e3.preventDefault();let t3=e3.nativeEvent.submitter;t3?.value&&i2(t3.value)},children:_("div",{className:b("core-filter-chips",a2),style:o2,role:"group","aria-label":r2,children:[Object.entries(n2??{}).map(([e3,t3])=>g("input",{type:"hidden",name:e3,value:t3},e3)),s2.map(e3=>g("button",{type:"submit",name:t2,value:e3.id,className:"core-chip","data-variant":"toggle","data-size":"sm","aria-pressed":e3.id===c2,children:g("span",{className:"core-chip__label",children:e3.label})},e3.id))]})})}function An({options:e2,value:t2,defaultValue:n2,onChange:r2,label:i2,fullWidth:a2=false,size:o2="md",className:s2,setValue:l2,...u2}){let[d2,m2]=p(n2??e2[0]?.value),h2=t2??d2,_2=c(),v2=f([]),x2=e3=>{t2===void 0&&m2(e3),r2?.(e3),l2?.(e3)},S2=e2.map((e3,t3)=>e3.disabled?-1:t3).filter(e3=>e3>=0),C2=(t3,n3)=>{let r3=t3.key==="ArrowRight"||t3.key==="ArrowDown"?1:t3.key==="ArrowLeft"||t3.key==="ArrowUp"?-1:0;if(!r3||!S2.length)return;t3.preventDefault();let i3=S2.indexOf(n3),a3=S2[(i3+r3+S2.length)%S2.length];v2.current[a3]?.focus(),x2(e2[a3].value)};return g("div",{...y(u2),role:"radiogroup","aria-label":i2,className:b("core-segmented",s2),"data-full":a2||void 0,"data-size":o2,children:e2.map((e3,t3)=>{let n3=e3.value===h2;return g("button",{ref:e4=>{v2.current[t3]=e4},type:"button",role:"radio",name:_2,"aria-checked":n3,tabIndex:n3||h2===void 0&&t3===S2[0]?0:-1,disabled:e3.disabled,className:"core-segmented__option",onClick:()=>x2(e3.value),onKeyDown:e4=>C2(e4,t3),children:e3.label},e3.value)})})}function jn({items:e2=[],children:t2,numbered:n2=false,single:r2=false,rules:i2="subtle",value:a2,onValueChange:o2,className:l2,...u2}){let d2=c(),p2=f(null),m2=n2?"ol":"ul",h2=(e3,t3)=>e3.id??String(t3),v2=a2!==void 0,x2=v2?new Set(a2):void 0,S2=()=>{x2&&p2.current&&p2.current.querySelectorAll("details[data-item]").forEach(e3=>{let t3=x2.has(e3.dataset.item);e3.open!==t3&&(e3.open=t3)})};s(S2);let C2=()=>{if(!p2.current)return;let t3=[...p2.current.querySelectorAll("details[data-item]")].filter(e3=>e3.open).map(e3=>e3.dataset.item),n3=v2?e2.map(h2).filter(e3=>x2.has(e3)):void 0;n3&&n3.length===t3.length&&n3.every((e3,n4)=>e3===t3[n4])||(o2?.(t3),v2&&queueMicrotask(()=>requestAnimationFrame(S2)))};return _("div",{...y(u2),ref:p2,className:b("core-accordion",l2),"data-rules":i2,children:[e2.length>0&&g(m2,{className:"core-accordion__list","data-numbered":n2||void 0,children:e2.map((e3,t3)=>g("li",{className:"core-accordion__item",children:_("details",{className:"core-disclosure",name:r2?d2:void 0,open:v2?void 0:e3.open||void 0,...v2||o2?{"data-item":h2(e3,t3),onToggle:C2}:{},children:[_("summary",{className:"core-disclosure__summary",children:[n2&&g("span",{className:"core-accordion__number",children:t3+1}),e3.question]}),g("div",{className:"core-disclosure__content",children:e3.answer})]})},e3.id??t3))}),t2]})}function Mn({media:e2,header:t2,body:n2,footer:r2,children:i2,tone:a2="plain",className:o2,...s2}){return _("article",{...y(s2),className:b("core-card",o2),"data-tone":a2,children:[e2!=null&&g("div",{className:"core-card__media",children:e2}),t2!=null&&g("header",{className:"core-card__header",children:t2}),(n2!=null||i2!=null)&&_("div",{className:"core-card__body",children:[n2,i2]}),r2!=null&&g("footer",{className:"core-card__footer",children:r2})]})}var Nn={"1:1":"1fr 1fr","2:1":"2fr 1fr","1:2":"1fr 2fr","3:1":"3fr 1fr","1:3":"1fr 3fr"};function Pn({start:e2,end:t2,children:n2,ratio:r2="1:1",gap:i2,stackBelow:a2="compact",className:o2,...s2}){return _("div",{...y(s2),className:b("core-columns",o2),"data-stack":a2,children:[_("div",{className:"core-columns__grid",style:S({"--core-columns-template":Nn[r2]??Nn["1:1"],"--core-columns-gap":x(i2)}),children:[g("div",{className:"core-columns__start",children:e2}),g("div",{className:"core-columns__end",children:t2})]}),n2]})}var Fn=Pn;function In({summary:e2,content:t2,children:n2,open:r2=false,onToggle:i2,className:a2,...o2}){return _("details",{...y(o2),className:b("core-disclosure",a2),open:r2||void 0,onToggle:i2?e3=>i2(e3.currentTarget.open):void 0,children:[g("summary",{className:"core-disclosure__summary",children:e2}),_("div",{className:"core-disclosure__content",children:[t2,n2]})]})}function Ln({items:t2,children:n2,min:r2,columns:i2,gap:a2,className:o2,style:s2,...c2}){let l2=[...e.toArray(t2),...e.toArray(n2)];return g("div",{...y(c2),className:b("core-grid",o2),"data-capped":i2&&i2>0?"":void 0,style:S({"--core-grid-min":x(r2),"--core-grid-gap":x(a2),"--core-grid-cols":i2&&i2>0?String(Math.round(i2)):void 0},s2),children:l2})}function Rn({item:t2,each:n2,as:r2,layout:i2="stack",gap:a2,min:o2,empty:s2,className:c2,style:l2,...u2}){let d2=e.toArray(t2);return d2.length?g("div",{...y(u2),className:b("core-repeat",c2),"data-layout":i2,style:S({"--core-repeat-gap":x(a2),"--core-repeat-min":x(o2)},l2),children:d2}):s2?g("p",{className:"core-repeat__empty",children:s2}):null}var zn=["page-x-of-y","page-number","page-count"],Bn={display:{size:46,lineHeight:.98,weight:500,tracking:"-0.032em"},heading:{size:28,lineHeight:1.05,weight:500,tracking:"-0.03em"},subhead:{size:20,lineHeight:1.15,weight:500,tracking:"-0.02em"},title:{size:17,lineHeight:1.3,weight:500,tracking:"-0.018em"},body:{size:15,lineHeight:1.65,weight:400,tracking:"-0.012em"},bodySmall:{size:13,lineHeight:1.65,weight:400,tracking:"-0.012em"},label:{size:13,lineHeight:1.4,weight:500,tracking:"-0.015em"},note:{size:12,lineHeight:1.7,weight:400,tracking:"-0.012em"},eyebrow:{size:12,lineHeight:1,weight:600,tracking:"0.14em",uppercase:true}},Vn={full:"var(--color-text)",muted:"var(--color-text-muted)",subtle:"var(--color-text-subtle)",border:"var(--color-border)",accent:"var(--color-accent)",accentText:"var(--color-link)",sunken:"var(--color-surface-sunken)"},Hn=["cover","what-this-is","told-us","meaning","next-steps","talk-it-through","notes","footer"],Un=[{id:"workbook",label:"Workbook",sheet:{width:"8.5in",height:"11in"},margins:{top:"0.60in",right:"0.70in",bottom:"0.55in",left:"0.95in"},measure:"6.85in",bodyMeasureCh:64,rail:{placement:"strip"},ink:Vn,rules:{head:"2px",structural:"1px",row:"1px",hairline:"1px"},type:Bn,floorPx:12,depth:{max:1,indent:["0"],numbering:"none"},fills:true,regions:{"page-footer":{left:"member-ref",centre:"document-id",right:"page-x-of-y"}},sections:{known:Hn,required:["next-steps","talk-it-through"]}},{id:"report",extends:"workbook",label:"Report",regions:{"page-footer":{right:"page-x-of-y"}},requiredBindings:[],sections:{known:Hn,required:["next-steps","talk-it-through"]}},{id:"instrument",extends:"workbook",label:"Instrument",sheet:{width:"8.5in",height:"11in"},margins:{top:"1.00in",right:"1.00in",bottom:"1.00in",left:"1.25in"},measure:"4.50in",bodyMeasureCh:void 0,rail:{placement:"column",axis:"4.75in",width:"1.50in",gutter:"0.25in"},ink:{full:"#000000",muted:"rgba(0,0,0,0.70)",subtle:"rgba(0,0,0,0.62)",border:"rgba(0,0,0,0.45)",accent:"#000000",accentText:"#000000",sunken:"transparent"},rules:{structural:"0.75pt",hairline:"0.25pt"},type:{...Bn,eyebrow:{...Bn.eyebrow,tracking:"0.08em"}},depth:{max:3,indent:["0","0.375in","0.75in"],numbering:"ladder"},fills:false,regions:{"page-footer":{left:"execution-state",right:"page-x-of-y"}},requiredBindings:["execution-state"],sections:{required:[]}}],Wn=new Map;function Gn(e2){Wn.set(e2.id,e2)}for(let e2 of Un)Gn(e2);function Kn(){return[...Wn.keys()].sort()}function qn(e2){let t2=Wn.get(e2);if(!t2)throw Error(`[document-profile] unknown profile "${e2}". Registered: ${Kn().join(", ")}`);if(!t2.extends)return t2;let n2=Wn.get(t2.extends);if(!n2)throw Error(`[document-profile] "${e2}" extends unknown profile "${t2.extends}"`);if(n2.extends)throw Error(`[document-profile] "${e2}" extends "${n2.id}", which extends "${n2.extends}": inheritance is one level deep.`);return{...n2,...t2,id:t2.id,extends:t2.extends}}function Jn(){let e2={};for(let t2 of Kn())try{e2[t2]=qn(t2)}catch(e3){console.warn(`[document-profile] skipping "${t2}": ${e3 instanceof Error?e3.message:String(e3)}`)}return e2}var Yn=Object.freeze(Jn()),Xn="workbook";function Zn(e2,t2){try{return qn(e2)}catch{return we(`unknown-profile:${e2}`,`[document-profile] unknown profile "${e2}" (first seen in ${t2}): rendering with fallback values.`),null}}function Z(e2,t2){return e2===void 0?(we("no-profile",`[document-profile] no profileId supplied (first seen in ${t2}): falling back to "${Xn}". If this document is an instrument, its numbering and depth are being dropped.`),Zn(Xn,t2)):Zn(e2,t2)}var Qn=e2=>e2.replace(/[A-Z]/g,e3=>`-${e3.toLowerCase()}`),$n=["full","muted","subtle","border","accent","accentText","sunken"],er=["structural","hairline","head","row"],tr=["display","heading","subhead","title","body","bodySmall","label","note","eyebrow"],nr=3,rr="initial";function ir(e2){let t2={"--doc-sheet-width":e2.sheet.width,"--doc-sheet-height":e2.sheet.height,"--doc-margin-top":e2.margins.top,"--doc-margin-right":e2.margins.right,"--doc-margin-bottom":e2.margins.bottom,"--doc-margin-left":e2.margins.left,"--doc-measure":e2.measure,"--doc-body-measure":e2.bodyMeasureCh?`${e2.bodyMeasureCh}ch`:"none","--doc-rail-axis":e2.rail.axis??rr,"--doc-rail-width":e2.rail.width??rr,"--doc-rail-gutter":e2.rail.gutter??rr,"--doc-floor":`${e2.floorPx}px`};for(let n2 of $n)t2[`--doc-ink-${Qn(n2)}`]=e2.ink[n2];for(let n2 of er)t2[`--doc-rule-${n2}`]=e2.rules[n2]??rr;for(let n2 of tr){let r2=e2.type[n2],i2=`--doc-type-${Qn(n2)}`;t2[`${i2}-size`]=`${r2.size}px`,t2[`${i2}-leading`]=String(r2.lineHeight),t2[`${i2}-weight`]=String(r2.weight),t2[`${i2}-tracking`]=r2.tracking,t2[`${i2}-case`]=r2.uppercase?"uppercase":"none"}for(let n2=1;n2<=nr;n2++)t2[`--doc-indent-${n2}`]=e2.depth.indent[n2-1]??rr;return t2}var ar=(e2,t2)=>`${e2} {
1
+ import{Children as e,Fragment as t,cloneElement as n,createContext as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useId as c,useLayoutEffect as l,useMemo as u,useReducer as d,useRef as f,useState as p,useSyncExternalStore as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";var v=new Set(["baseProps","data","status","actions","_traversal","isLoading","error","navigate","onNavigate","size","store"]);function y(e2){let t2={};for(let n2 in e2)v.has(n2)||(t2[n2]=e2[n2]);return t2}var b=(...e2)=>e2.filter(Boolean).join(" ")||void 0,x=e2=>e2===void 0?void 0:typeof e2=="number"?`${e2}px`:e2;function S(e2,t2){let n2=Object.fromEntries(Object.entries(e2).filter(([,e3])=>e3!==void 0));return Object.keys(n2).length||t2?{...n2,...t2}:void 0}var C=Symbol.for("peripheries.embed.context.v1"),w=globalThis,T=w[C]??=r(false);function E(){return o(T)}function D({as:e2,className:t2,children:n2,...r2}){return g(e2??"div",{className:b("core-box",t2),...y(r2),children:n2})}function O({minHeight:e2,className:t2,style:n2,children:r2,...i2}){return g(D,{...i2,className:b("core-center",t2),style:S({"--core-center-min-height":x(e2)},n2),children:r2})}function k({name:e2,className:t2,style:n2,children:r2,...i2}){return g(D,{...i2,className:b("core-container",t2),style:S({"--core-container-name":e2},n2),children:r2})}function A({orientation:e2="horizontal",weight:t2="subtle",spacing:n2,className:r2,style:i2,ref:a2,...o2}){let s2={className:b("core-divider",r2),"data-weight":t2,"data-orientation":e2,style:S({"--core-divider-spacing":x(n2)},i2)};return e2==="vertical"?g("span",{role:"separator","aria-orientation":"vertical",...s2}):g("hr",{ref:a2,...y(o2),...s2})}function j({when:e2,children:t2,as:n2="span"}){return g(n2,{className:"core-hide","data-when":e2,children:t2})}function M({gap:e2,align:t2="center",justify:n2="start",wrap:r2=true,stackWhen:i2,className:a2,style:o2,children:s2,...c2}){return g(D,{...c2,className:b("core-inline",a2),"data-align":t2,"data-justify":n2,"data-wrap":r2?"true":"false","data-stack-when":i2,style:S({"--core-inline-gap":x(e2)},o2),children:s2})}var N=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","summary",'[contenteditable=""]','[contenteditable="true"]','[tabindex]:not([tabindex="-1"])'].join(",");function P(e2){return[...e2.querySelectorAll(N)].filter(e3=>!e3.closest("[inert]")&&!e3.hidden&&e3.getAttribute("aria-hidden")!=="true")}var F=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,I=2;function L({label:t2,snap:n2="start",children:r2,className:i2,...o2}){let c2=f(null),[l2,u2]=p({prev:false,next:false}),[d2,m2]=p(false),h2=a(()=>{let e2=c2.current;if(!e2)return;let t3=e2.scrollLeft>I,n3=e2.scrollWidth-e2.clientWidth-e2.scrollLeft>I;u2(e3=>e3.prev===t3&&e3.next===n3?e3:{prev:t3,next:n3}),m2(e2.scrollWidth>e2.clientWidth&&P(e2).length===0)},[]);s(()=>{let e2=c2.current;if(!e2)return;h2();let t3=new ResizeObserver(h2);t3.observe(e2);for(let n3 of Array.from(e2.children))t3.observe(n3);return()=>t3.disconnect()},[h2,r2]);let v2=e2=>{let t3=c2.current;t3&&t3.scrollBy({left:e2*t3.clientWidth*.8,behavior:F()?"auto":"smooth"})};return _("div",{...y(o2),className:b("core-rail",i2),"data-snap":n2,"data-prev":l2.prev?"":void 0,"data-next":l2.next?"":void 0,children:[g("button",{type:"button",className:"core-rail__arrow","data-direction":"prev","aria-label":`Scroll ${t2} back`,hidden:!l2.prev,onClick:()=>v2(-1),children:g("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:g("path",{d:"M10 3 5 8l5 5"})})}),g("ul",{ref:c2,role:"list","aria-label":t2,className:"core-rail__track",tabIndex:d2?0:void 0,onScroll:h2,children:e.toArray(r2).map((e2,t3)=>g("li",{className:"core-rail__item",children:e2},t3))}),g("button",{type:"button",className:"core-rail__arrow","data-direction":"next","aria-label":`Scroll ${t2} forward`,hidden:!l2.next,onClick:()=>v2(1),children:g("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:g("path",{d:"m6 3 5 5-5 5"})})})]})}function R({when:e2,children:t2,as:n2="span"}){return g(n2,{className:"core-show","data-when":e2,children:t2})}function z(e2,t2,n2){let[r2,i2]=p(t2),o2=e2!==void 0,s2=o2?e2:r2,c2=f(n2);return c2.current=n2,[s2,a(e3=>{o2||i2(e3),c2.current?.(e3)},[o2])]}function B(...e2){return t2=>{for(let n2 of e2)typeof n2=="function"?n2(t2):n2&&(n2.current=t2)}}function ee(e2){let[t2,n2]=p(()=>typeof matchMedia=="function"&&matchMedia(e2).matches);return s(()=>{if(typeof matchMedia!="function")return;let t3=matchMedia(e2),r2=()=>n2(t3.matches);return r2(),t3.addEventListener("change",r2),()=>t3.removeEventListener("change",r2)},[e2]),t2}var te="core-overlay-dismiss",V=Symbol.for("peripheries.overlay.host.v1"),H=globalThis,U=H[V]??=r(null);function W(e2){let t2=e2&&typeof e2=="object"?e2:{},n2=typeof HTMLElement<"u"&&t2.mount instanceof HTMLElement?t2.mount:void 0,r2=typeof t2.portal=="function"?t2.portal:void 0;return{format:t2.format==="desktop"?"desktop":"mobile",...n2?{mount:n2}:{},...r2?{portal:r2}:{}}}function G({value:e2,children:t2}){return g(U.Provider,{value:W(e2),children:t2})}function ne(){return o(U)}var re="(max-width: 640px)";function K(){let e2=ne(),t2=ee(re);return e2?e2.format:t2?"mobile":"desktop"}var ie=(e2,t2,n2)=>Math.max(t2,Math.min(e2,n2));function q({anchor:e2,size:t2,viewport:n2,placement:r2,gap:i2=4,margin:a2=8}){let[o2,s2="center"]=r2.split("-"),c2=n2.height-a2-e2.bottom-i2,l2=e2.top-i2-a2,u2=e3=>t2.height<=e3,d2=o2;o2==="bottom"&&!u2(c2)&&l2>c2?d2="top":o2==="top"&&!u2(l2)&&c2>l2&&(d2="bottom");let f2=d2==="bottom"?e2.bottom+i2:e2.top-i2-t2.height;return{x:ie(s2==="start"?e2.left:s2==="end"?e2.right-t2.width:(e2.left+e2.right)/2-t2.width/2,a2,Math.max(a2,n2.width-a2-t2.width)),y:ie(f2,a2,Math.max(a2,n2.height-a2-t2.height)),placement:s2==="center"?d2:`${d2}-${s2}`}}function ae(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("anchor-name","--a")}var oe=4;function se({trigger:e2,label:t2,placement:r2="bottom-start",open:i2,defaultOpen:a2=false,onOpenChange:o2,popupRole:u2="dialog",initialFocus:d2,onTriggerKeyDown:m2,children:v2,className:y2}){let[x2,S2]=z(i2,a2,o2),C2=c(),w2=`--core-a${C2.replace(/\W/g,"")}`,T2=f(null),E2=f(null),[D2]=p(ae),O2=f(x2);O2.current=x2;let k2=f("closed");l(()=>{let e3=T2.current;if(e3){if(x2&&k2.current==="closed")k2.current="open",e3.showPopover();else if(!x2&&k2.current==="open"){k2.current="closed";let t3=document.activeElement;(!t3||t3===document.body||e3.contains(t3))&&E2.current?.focus({preventScroll:true}),e3.hidePopover()}}},[x2]),s(()=>{let e3=T2.current;if(!e3)return;let t3=t4=>{let n3=t4.newState;if(k2.current=n3==="open"?"open":"closed",n3==="open"&&!O2.current&&S2(true),n3==="closed"&&O2.current){S2(false);let t5=document.activeElement;(!t5||t5===document.body||e3.contains(t5))&&E2.current?.focus({preventScroll:true})}},n2=t4=>{if(t4.newState!=="open"||d2===false)return;let n3=(typeof d2=="function"?d2(e3):d2?e3.querySelector(d2):null)??P(e3)[0];n3?n3.focus({preventScroll:true}):(e3.tabIndex=-1,e3.focus({preventScroll:true}))};return e3.addEventListener("beforetoggle",t3),e3.addEventListener("toggle",n2),()=>{e3.removeEventListener("beforetoggle",t3),e3.removeEventListener("toggle",n2)}},[S2,d2]),l(()=>{let e3=T2.current,t3=E2.current;if(D2||!x2||!e3||!t3)return;let n2=()=>{let n3=q({anchor:t3.getBoundingClientRect(),size:{width:e3.offsetWidth,height:e3.offsetHeight},viewport:{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight},placement:r2,gap:oe});e3.style.setProperty("--core-popover-x",`${n3.x}px`),e3.style.setProperty("--core-popover-y",`${n3.y}px`),e3.dataset.placement=n3.placement,e3.dataset.placed=""};n2();let i3=new ResizeObserver(n2);return i3.observe(e3),window.addEventListener("resize",n2),window.addEventListener("scroll",n2,true),()=>{delete e3.dataset.placed,i3.disconnect(),window.removeEventListener("resize",n2),window.removeEventListener("scroll",n2,true)}},[D2,x2,r2]);let A2=()=>S2(false),j2=e2.props,M2={ref:B(E2,j2.ref),popoverTarget:C2,"aria-haspopup":u2,"aria-expanded":x2,"aria-controls":C2,className:b(j2.className,"core-popover-anchor"),style:{...j2.style,"--core-popover-anchor":w2},onKeyDown:e3=>{m2?.(e3),j2.onKeyDown?.(e3)}};return _(h,{children:[n(e2,M2),g("div",{ref:T2,id:C2,popover:"auto",role:u2==="menu"?void 0:u2,"aria-label":u2==="menu"?void 0:t2,className:b("core-popover",y2),"data-placement":r2,"data-placer":D2?"anchor":"script",style:{"--core-popover-anchor":w2},onBlur:e3=>{let t3=e3.relatedTarget;t3&&!e3.currentTarget.contains(t3)&&t3!==E2.current&&A2()},children:x2?typeof v2=="function"?v2({close:A2}):v2:null})]})}var ce=Symbol.for("peripheries.overlay.scrollLock.v1"),le=globalThis;function ue(){if(typeof document>"u")return()=>{};let e2=le[ce]??={count:0,overflow:""};e2.count===0&&(e2.overflow=document.body.style.overflow,document.body.style.overflow="hidden"),e2.count+=1;let t2=false;return()=>{t2||(t2=true,--e2.count,e2.count===0&&(document.body.style.overflow=e2.overflow))}}function de(e2){let t2=ne();return t2?g(me,{...e2,host:t2}):g(he,{...e2})}var fe={dialog:"center","sheet-bottom":"bottom","sheet-end":"end"};function pe(e2,t2){let n2=f({onClose:e2,onOpenChange:t2});return n2.current={onClose:e2,onOpenChange:t2},f(()=>{n2.current.onOpenChange?.(false),n2.current.onClose?.()}).current}function me({variant:e2,kind:t2,open:n2,onClose:r2,onOpenChange:i2,title:a2,label:o2,description:l2,role:u2="dialog",initialFocus:d2,dismissOnBackdrop:p2=true,headerStart:m2,headerTools:v2,footer:y2,children:x2,className:S2,host:C2}){let w2=f(null),T2=pe(r2,i2),E2=`core-overlay-${c().replace(/:/g,"")}`,D2=`${E2}-title`,O2=`${E2}-description`;if(s(()=>{let e3=w2.current;if(!e3||!n2)return;let t3=(d2?e3.querySelector(d2):null)??P(e3)[0];t3?t3.focus({preventScroll:true}):e3.focus({preventScroll:true})},[n2,d2]),s(()=>{let e3=w2.current;if(!e3||!n2)return;let t3=t4=>{t4.target===e3&&T2()};return e3.addEventListener(te,t3),()=>e3.removeEventListener(te,t3)},[n2,T2]),!n2)return null;let k2=o2??(typeof a2=="string"?a2:"dialog"),A2=_(h,{children:[g("div",{className:"core-overlay-scrim","data-overlay-scrim":"","aria-hidden":"true",onClick:()=>p2&&T2()}),g("div",{ref:w2,id:E2,className:b("core-overlay",S2),"data-overlay":t2??(e2==="dialog"?"dialog":"sheet"),"data-placement":fe[e2],role:u2==="alertdialog"?"alertdialog":"dialog","aria-modal":"true","aria-labelledby":D2,"aria-describedby":l2?O2:void 0,tabIndex:-1,children:_("div",{className:"core-modal__surface",children:[_("header",{className:"core-modal__header",children:[m2,g("h2",{id:D2,className:"core-modal__title",children:a2}),g("div",{className:"core-modal__tools",children:v2}),g("button",{type:"button",className:"core-modal__close","aria-label":`Close ${k2}`,onClick:T2,children:g("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:g("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]}),_("div",{className:"core-modal__body",children:[l2?g("p",{id:O2,className:"core-modal__description",children:l2}):null,x2]}),y2?g("footer",{className:"core-modal__footer",children:y2}):null]})},"root")]}),j2=C2.mount??(typeof document>"u"?null:document.body);return C2.portal&&j2?g(h,{children:C2.portal(A2,j2)}):A2}function he({variant:e2,open:t2,onClose:n2,onOpenChange:r2,title:i2,label:a2,description:o2,role:l2="dialog",initialFocus:u2,dismissOnBackdrop:d2=true,headerStart:p2,headerTools:m2,footer:h2,children:v2,className:y2}){let x2=f(null),S2=f(null),C2=pe(n2,r2),w2=c(),T2=c();s(()=>{let e3=x2.current;if(!e3||!t2)return;let n3=document.activeElement;e3.showModal();let r3=ue(),i3=(u2?e3.querySelector(u2):null)??P(e3)[0];i3?i3.focus({preventScroll:true}):e3.focus({preventScroll:true});let a3=e4=>{e4.preventDefault(),C2()};return e3.addEventListener("cancel",a3),()=>{e3.removeEventListener("cancel",a3),r3(),e3.open&&e3.close();let t3=document.activeElement;(!t3||t3===document.body)&&n3?.isConnected&&n3.focus({preventScroll:true})}},[t2,u2]);let E2=a2??(typeof i2=="string"?i2:"dialog");return g("dialog",{ref:x2,className:b("core-modal",y2),"data-variant":e2,role:l2==="alertdialog"?"alertdialog":void 0,"aria-labelledby":w2,"aria-describedby":o2?T2:void 0,tabIndex:-1,onKeyDown:e3=>{if(e3.key!=="Tab"||e3.defaultPrevented||e3.target.closest("dialog")!==e3.currentTarget)return;let t3=P(e3.currentTarget),n3=t3[0],r3=t3[t3.length-1];if(!n3||!r3)return e3.preventDefault();let i3=document.activeElement;e3.shiftKey&&(i3===n3||i3===e3.currentTarget)?(e3.preventDefault(),r3.focus()):!e3.shiftKey&&i3===r3&&(e3.preventDefault(),n3.focus())},onPointerDown:e3=>{S2.current=e3.target},onClick:e3=>{d2&&e3.target===e3.currentTarget&&S2.current===e3.currentTarget&&C2()},children:t2&&_("div",{className:"core-modal__surface",children:[_("header",{className:"core-modal__header",children:[p2,g("h2",{id:w2,className:"core-modal__title",children:i2}),g("div",{className:"core-modal__tools",children:m2}),g("button",{type:"button",className:"core-modal__close","aria-label":`Close ${E2}`,onClick:C2,children:g("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:g("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]}),_("div",{className:"core-modal__body",children:[o2?g("p",{id:T2,className:"core-modal__description",children:o2}):null,v2]}),h2?g("footer",{className:"core-modal__footer",children:h2}):null]})})}function J({side:e2="bottom",back:t2,...n2}){return e2==="auto"?g(ge,{back:t2,...n2}):g(_e,{side:e2,back:t2,...n2})}function ge({back:e2,...t2}){let n2=K()==="mobile";return g(_e,{side:n2?"bottom":"center",back:e2,...t2})}function _e({side:e2,back:t2,...n2}){let r2=t2?g("button",{type:"button",className:"core-modal__back","aria-label":`Back to ${t2.label}`,onClick:t2.onBack,children:g("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:g("path",{d:"M13 8H3M7 4 3 8l4 4"})})}):void 0;return g(de,{variant:e2==="end"?"sheet-end":e2==="center"?"dialog":"sheet-bottom",kind:"sheet",headerStart:r2,...n2})}var ve='[role="menuitem"], [role="menuitemcheckbox"]',ye=600,be=e2=>"type"in e2;function xe({items:e2,label:t2,onChoose:n2,onTab:r2,className:i2}){let a2=f(null),o2=f({text:"",at:0}),s2=()=>[...a2.current?.querySelectorAll(ve)??[]];return g("div",{ref:a2,role:"menu","aria-label":t2,className:b("core-menu",i2),onKeyDown:e3=>{let t3=s2(),n3=t3.indexOf(document.activeElement),i3=n4=>{e3.preventDefault(),t3[(n4+t3.length)%t3.length]?.focus({preventScroll:true})};if(e3.key==="ArrowDown")i3(n3+1);else if(e3.key==="ArrowUp")i3(n3<0?-1:n3-1);else if(e3.key==="Home")i3(0);else if(e3.key==="End")i3(-1);else if(e3.key==="Tab")r2();else if(e3.key.length===1&&!e3.ctrlKey&&!e3.metaKey&&!e3.altKey&&e3.key!==" "){let r3=Date.now();o2.current.text=r3-o2.current.at>ye?e3.key.toLowerCase():o2.current.text+e3.key.toLowerCase(),o2.current.at=r3;let i4=o2.current.text,a3=[...t3.slice(n3+1),...t3.slice(0,n3+1)],s3=[...i4].every(e4=>e4===i4[0]),c2=a3.find(e4=>e4.textContent?.trim().toLowerCase().startsWith(i4))??(s3?a3.find(e4=>e4.textContent?.trim().toLowerCase().startsWith(i4[0]??"")):void 0);c2&&(e3.preventDefault(),c2.focus({preventScroll:true}))}},children:e2.map(e3=>{if(be(e3))return g("div",{role:"separator",className:"core-menu__separator"},e3.id);let t3=typeof e3.checked=="boolean"&&!e3.href,r3={role:t3?"menuitemcheckbox":"menuitem","aria-checked":t3?e3.checked:void 0,tabIndex:-1,className:"core-menu__item","data-tone":e3.tone,"aria-disabled":e3.disabled||void 0,onClick:t4=>{if(e3.disabled)return t4.preventDefault();n2(e3)}},i3=_(h,{children:[e3.icon?g("span",{className:"core-menu__icon","aria-hidden":"true",children:e3.icon}):null,g("span",{className:"core-menu__label",children:e3.label})]});return e3.href&&!e3.disabled?g("a",{...r3,href:e3.href,children:i3},e3.id):g("button",{...r3,type:"button",children:i3},e3.id)})})}function Se({trigger:e2,items:t2,label:r2,placement:i2="bottom-start",presentation:a2="auto",defaultOpen:o2=false,onOpenChange:s2,className:c2}){let l2=K()==="mobile",u2=a2==="sheet"||a2==="auto"&&l2,[d2,f2]=z(void 0,o2,s2),[m2,v2]=p("first"),y2=g(xe,{items:t2,label:r2,onChoose:e3=>{e3.onSelect?.(),f2(false)},onTab:()=>f2(false),className:c2}),b2=e3=>{(e3.key==="ArrowDown"||e3.key==="ArrowUp")&&(e3.preventDefault(),v2(e3.key==="ArrowUp"?"last":"first"),f2(true))};if(u2){let t3=e2.props;return _(h,{children:[n(e2,{"aria-haspopup":"menu","aria-expanded":d2,onClick:e3=>{t3.onClick?.(e3),v2("first"),f2(true)},onKeyDown:e3=>{b2(e3),t3.onKeyDown?.(e3)}}),g(J,{open:d2,onClose:()=>f2(false),title:r2,initialFocus:ve,className:"core-menu-sheet",children:y2})]})}return g(se,{trigger:e2,label:r2,placement:i2,open:d2,onOpenChange:f2,popupRole:"menu",initialFocus:e3=>{let t3=e3.querySelectorAll(ve);return(m2==="last"?t3[t3.length-1]:t3[0])??null},onTriggerKeyDown:b2,className:"core-menu-popover",children:y2})}var Ce=new Set;function we(e2,t2){Ce.has(e2)||(Ce.add(e2),typeof console<"u"&&console.warn(t2))}var Te={title:120,description:280,label:40,visible:4,perSource:2,burst:5,windowMs:1e4,defaultDuration:6e3},Ee=1,De=Symbol.for("peripheries.toast.v1"),Oe=["neutral","info","success","warning","danger"],ke=globalThis;function Ae(){let e2=ke[De];if(e2===void 0){let e3={version:Ee,snapshot:{toasts:[],actions:[]},listeners:new Set,handlers:new Map,sent:new Map,regionClaim:null,next:1};return ke[De]=e3,e3}return e2.version!==Ee||!e2.listeners||!e2.handlers?(we("toast:version",`[toast] A toast store of version ${String(e2.version)} is on this page; this copy expects ${Ee}. Toasts from this copy are ignored.`),null):e2}function je(e2,t2){e2.snapshot={toasts:t2,actions:[...e2.handlers.keys()]};for(let t3 of[...e2.listeners])t3()}var Me=(e2,t2)=>e2.length>t2?`${e2.slice(0,t2-1)}…`:e2;function Ne(e2){let t2=Ae();if(!t2)return null;if(!e2||typeof e2.title!="string"||e2.title.trim()==="")return we("toast:title","[toast] A toast needs a title of text; nothing was shown."),null;if(t2.regionClaim===null)return we("toast:region","[toast] No ToastRegion is mounted, so the toast was not shown. Mount <ToastRegion /> once, in the shell."),null;let n2=typeof e2.source=="string"&&e2.source?Me(e2.source,40):"app",r2=Date.now(),i2=(t2.sent.get(n2)??[]).filter(e3=>r2-e3<Te.windowMs);if(i2.length>=Te.burst)return we(`toast:burst:${n2}`,`[toast] "${n2}" sent more than ${Te.burst} toasts in ${Te.windowMs/1e3}s; the rest are dropped.`),t2.sent.set(n2,i2),null;t2.sent.set(n2,[...i2,r2]);let a2=Oe.includes(e2.tone)?e2.tone:"neutral",o2=Me(e2.title.trim(),Te.title),s2=typeof e2.description=="string"&&e2.description.trim()?Me(e2.description.trim(),Te.description):void 0,c2=e2.action&&typeof e2.action.id=="string"&&typeof e2.action.label=="string"&&e2.action.label.trim()?{id:e2.action.id,label:Me(e2.action.label.trim(),Te.label)}:void 0,l2=typeof e2.id=="string"&&e2.id?e2.id:`${a2}|${o2}|${s2??""}`,u2=c2?0:typeof e2.duration=="number"&&e2.duration>=0?e2.duration:Te.defaultDuration,d2=[...t2.snapshot.toasts],f2=d2.findIndex(e3=>e3.id===l2);if(f2>=0){let e3=d2[f2];d2[f2]={id:l2,title:o2,description:s2,tone:a2,duration:u2,action:c2,source:n2,revision:e3.revision+1}}else{for(d2.push({id:l2,title:o2,description:s2,tone:a2,duration:u2,action:c2,source:n2,revision:0});d2.filter(e3=>e3.source===n2).length>Te.perSource;)d2.splice(d2.findIndex(e3=>e3.source===n2),1);for(;d2.length>Te.visible;)d2=d2.slice(1)}return je(t2,d2),l2}function Pe(e2){let t2=Ae();t2&&t2.snapshot.toasts.some(t3=>t3.id===e2)&&je(t2,t2.snapshot.toasts.filter(t3=>t3.id!==e2))}function Fe(e2){let t2=Ae()?.handlers.get(e2);return t2?.(),!!t2}var Ie={toasts:[],actions:[]},Le=e2=>{let t2=Ae();return t2?.listeners.add(e2),()=>void t2?.listeners.delete(e2)},Re=()=>Ae()?.snapshot??Ie;function ze(){let e2=Ae();if(!e2)return null;if(e2.regionClaim!==null)return we("toast:second-region","[toast] A second ToastRegion was mounted; it does nothing, and its actions are ignored. Mount one per page."),null;let t2=Symbol("region");return e2.regionClaim=t2,{release(){e2.regionClaim===t2&&(e2.regionClaim=null,e2.handlers.clear(),je(e2,[]))},setActions(n2){e2.regionClaim===t2&&(e2.handlers=new Map(Object.entries(n2)),je(e2,e2.snapshot.toasts))}}}function Be(){return{toast:Ne,dismiss:Pe}}function Ve({toast:e2,actionAvailable:t2=false,onAction:n2,onDismiss:r2,className:i2,...a2}){return _("div",{...a2,className:b("core-toast",i2),"data-tone":e2.tone,children:[_("div",{className:"core-toast__text",children:[g("p",{className:"core-toast__title",children:e2.title}),e2.description?g("p",{className:"core-toast__description",children:e2.description}):null]}),e2.action&&t2?g("button",{type:"button",className:"core-toast__action",onClick:n2,children:e2.action.label}):null,g("button",{type:"button",className:"core-toast__dismiss","aria-label":"Dismiss notification",onClick:r2,children:g("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:g("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]})}function He({item:e2,actionAvailable:t2}){let[n2,r2]=p(false);return s(()=>{if(e2.duration===0||n2)return;let t3=setTimeout(()=>Pe(e2.id),e2.duration);return()=>clearTimeout(t3)},[e2.id,e2.duration,e2.revision,n2]),g("div",{className:"core-toast-slot",onPointerEnter:()=>r2(true),onPointerLeave:()=>r2(false),onFocus:()=>r2(true),onBlur:e3=>{e3.currentTarget.contains(e3.relatedTarget)||r2(false)},children:g(Ve,{toast:e2,actionAvailable:t2,onAction:()=>{e2.action&&Fe(e2.action.id),Pe(e2.id)},onDismiss:()=>Pe(e2.id)})})}function Ue({className:e2,actions:t2}){let[n2,r2]=p(false),i2=f(null),a2=f(t2);a2.current=t2;let o2=Object.keys(t2??{}).sort().join("\n"),c2=f(null),l2=f(false),{toasts:u2,actions:d2}=m(Le,Re,Re);s(()=>{let e3=ze();return i2.current=e3,r2(e3!==null),()=>{e3?.release(),i2.current=null}},[]),s(()=>{i2.current?.setActions(Object.fromEntries((o2?o2.split("\n"):[]).map(e3=>[e3,()=>a2.current?.[e3]?.()])))},[o2,n2]);let h2=u2[u2.length-1],v2=h2?`${h2.id}:${h2.revision}`:"";if(s(()=>{let e3=c2.current;e3&&(l2.current&&e3.hidePopover(),l2.current=v2!=="",l2.current&&e3.showPopover())},[v2,n2]),!n2)return null;let y2=e3=>u2.filter(e3).map(e4=>g(He,{item:e4,actionAvailable:!!e4.action&&d2.includes(e4.action.id)},e4.id));return _("div",{ref:c2,popover:"manual",role:"region","aria-label":"Notifications",className:b("core-toast-region",e2),children:[g("div",{role:"status","aria-live":"polite",className:"core-toast-region__list",children:y2(e3=>e3.tone!=="danger")}),g("div",{role:"alert","aria-live":"assertive",className:"core-toast-region__list",children:y2(e3=>e3.tone==="danger")})]})}function We({role:e2="dialog",dismissOnBackdrop:t2,...n2}){return g(de,{variant:"dialog",role:e2,dismissOnBackdrop:t2??e2!=="alertdialog",...n2})}function Ge({size:e2,className:t2,style:n2}){return g("span",{"aria-hidden":true,className:b("core-spacer",t2),style:S({"--core-spacer-size":x(e2)},n2)})}function Ke({gap:e2,align:t2="stretch",justify:n2="start",className:r2,style:i2,children:a2,...o2}){return g(D,{...o2,className:b("core-stack",r2),"data-align":t2,"data-justify":n2,style:S({"--core-stack-gap":x(e2)},i2),children:a2})}var qe=e2=>e2.startsWith("/")&&!e2.startsWith("//")&&!e2.includes("\\"),Je=e2=>/^#[A-Za-z][\w:.-]*$/.test(e2);function Ye({href:e2,action:t2,input:n2,actions:r2,navigate:i2,onClick:a2}){let[o2,s2]=p(false),c2=r2&&t2?r2[t2]:void 0;return{busy:o2,onClick:t3=>{if(a2)return a2(t3);if(c2){t3.preventDefault(),s2(true),c2(n2).finally(()=>s2(false));return}e2&&i2&&qe(e2)&&t3.button===0&&!t3.metaKey&&!t3.ctrlKey&&!t3.shiftKey&&!t3.altKey&&(t3.preventDefault(),i2(e2))},external:!!e2&&!qe(e2)&&!Je(e2)}}function Xe({title:e2,titleLevel:t2,meta:n2,leading:r2,value:i2,trailing:a2,badge:o2,detail:s2,actions:c2,selected:l2,href:u2,navigate:d2,onClick:f2,as:p2="div",className:m2,...h2}){let v2=Ye({href:u2,navigate:d2,onClick:f2}),x2=p2,S2=u2?g("a",{className:"core-list-row__title core-list-row__link",href:u2,onClick:v2.onClick,"aria-current":l2?"true":void 0,...v2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:e2}):g("span",{className:"core-list-row__title",children:e2}),C2=typeof t2=="number"&&Number.isInteger(t2)&&t2>=2&&t2<=6?t2:void 0,w2=C2?`h${C2}`:void 0,T2=w2?g(w2,{className:"core-list-row__heading",children:S2}):S2;return _(x2,{...y(h2),className:b("core-list-row",m2),"data-selected":l2?"":void 0,"aria-current":l2&&!u2?"true":void 0,children:[r2!=null&&g("div",{className:"core-list-row__leading",children:r2}),_("div",{className:"core-list-row__main",children:[o2==null?T2:_("div",{className:"core-list-row__head",children:[T2,g("span",{className:"core-list-row__badge",children:o2})]}),n2!=null&&g("span",{className:"core-list-row__meta",children:n2}),s2!=null&&g("div",{className:"core-list-row__detail",children:s2})]}),i2!=null&&g("div",{className:"core-list-row__value",children:i2}),a2!=null&&g("div",{className:"core-list-row__trailing",children:a2}),c2!=null&&g("div",{className:"core-list-row__actions",children:c2})]})}function Ze({header:e2,children:t2,measure:n2="page",className:r2,...i2}){return g("div",{...y(i2),className:b("core-page-frame",r2),"data-measure":n2,children:_("div",{className:"core-page-frame__column",children:[e2!=null&&g("header",{className:"core-page-frame__header",children:e2}),t2]})})}var Qe=["neutral","strong","accent","info","success","warning","danger"],$e=()=>typeof process>"u"||false;function et(e2,t2="neutral"){return typeof e2=="string"&&Qe.includes(e2)?e2:(typeof e2=="string"&&e2&&$e()&&we(`unknown-tone:${e2}`,`[core] "${e2}" is not a tone (${Qe.join(", ")}); using "${t2}".`),t2)}var tt=["subtle","on-dark","inherit"];function nt(e2,t2){return typeof e2=="string"&&(tt.includes(e2)||Qe.includes(e2))?e2:t2}function rt(e2){return{"data-tone":e2,toned:!tt.includes(e2)}}function it({children:e2,as:t2="span",tone:n2,tabular:r2=false,className:i2,style:a2}){let{toned:o2,...s2}=rt(nt(n2,"subtle"));return g(t2,{className:b("core-eyebrow",o2&&"core-toned",i2),...s2,"data-tabular":r2?"true":void 0,style:a2,children:e2})}var at=6,ot=100,st=e2=>(Array.isArray(e2)?e2:[]).map(e3=>typeof e3=="string"?e3.replace(/\s+/g," ").trim():"").filter(Boolean).map(e3=>e3.length>ot?`${e3.slice(0,99)}…`:e3).slice(0,at);function ct({title:e2,level:t2=2,eyebrow:n2,meta:r2,intro:i2,actions:a2,className:o2,...s2}){let c2=t2===1?"h1":"h2",l2=st(r2);return _("header",{...y(s2),className:b("core-page-head",o2),children:[n2&&g(it,{as:"p",children:n2}),_("div",{className:"core-page-head__row",children:[g(c2,{className:"core-page-head__title","data-page-title":t2===1?void 0:"",children:e2}),a2!=null&&g("div",{className:"core-page-head__actions",children:a2})]}),l2.length>0&&g("p",{className:"core-page-head__meta",children:l2.map((e3,t3)=>g("span",{children:e3},`${t3}-${e3}`))}),i2!=null&&g("p",{className:"core-page-head__intro",children:i2})]})}var lt=Symbol.for("peripheries.viewer.context.v1"),ut=20,dt=/^[a-z0-9]+(?:[-_][a-z0-9]+)*$/,ft=Object.freeze({audience:"client",roles:Object.freeze([])});function pt(e2){if(!e2||typeof e2!="object")return ft;let t2=e2,n2=[...new Set((Array.isArray(t2.roles)?t2.roles:[]).filter(e3=>typeof e3=="string"&&dt.test(e3)&&e3.length<=40))].sort().slice(0,ut);return{audience:t2.audience==="staff"?"staff":"client",roles:n2,...t2.previewing===true?{previewing:true}:{}}}var mt=globalThis,ht=mt[lt]??=r(ft);function gt({value:e2,children:t2}){return g(ht.Provider,{value:pt(e2),children:t2})}function _t(){return o(ht)}var vt=e2=>e2.audience==="staff",yt=(e2,t2)=>e2.roles.includes(t2);function bt(e2,t2,n2){return e2.cardComponent&&typeof t2=="function"?t2(e2.cardComponent,{...n2,event:e2})??null:null}function xt(e2){return e2?typeof e2=="string"?e2:e2.map(e3=>e3&&typeof e3.message=="string"?e3.message:"").filter(Boolean).join(" "):""}var St=["accepted","tentative","declined"],Ct=(e2,t2)=>new Intl.DateTimeFormat(e2,{weekday:"short",month:"short",day:"numeric",timeZone:t2}),wt=(e2,t2)=>new Intl.DateTimeFormat(e2,{hour:"numeric",minute:"2-digit",timeZone:t2}),Tt=e2=>{try{return new Intl.DateTimeFormat("en",{timeZone:e2}).resolvedOptions().timeZone}catch{return}};function Et(e2,t2,n2,r2){let i2=e2.tzid?Tt(e2.tzid):void 0,a2=Tt(r2);return!i2||!a2||i2===a2?"":new Intl.DateTimeFormat(n2,{hour:"numeric",timeZoneName:"short",timeZone:r2}).formatToParts(t2).find(e3=>e3.type==="timeZoneName")?.value??""}function Dt(e2,t2,n2){if(e2.startOn){let n3=new Date(`${e2.startOn}T00:00:00Z`),r3=Ct(t2,"UTC").format(n3);if(!e2.endOn)return`${r3} (all day)`;let i3=new Date(new Date(`${e2.endOn}T00:00:00Z`).getTime()-864e5);return i3.getTime()<=n3.getTime()?`${r3} (all day)`:`${r3} – ${Ct(t2,"UTC").format(i3)}`}if(!e2.startsAt)return"";let r2=new Date(e2.startsAt);if(Number.isNaN(r2.getTime()))return"";let i2=Ct(t2,n2).format(r2),a2=wt(t2,n2).format(r2),o2=Et(e2,r2,t2,n2),s2=o2?` ${o2}`:"";if(!e2.endsAt)return`${i2} · ${a2}${s2}`;let c2=new Date(e2.endsAt);return Number.isNaN(c2.getTime())||c2.getTime()===r2.getTime()?`${i2} · ${a2}${s2}`:`${i2} · ${a2} – ${wt(t2,n2).format(c2)}${s2}`}var Ot=()=>Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC";function kt(e2){if(!e2)return;let t2=new Date(e2);return Number.isNaN(t2.getTime())?void 0:t2.toISOString()}function At(){let e2=new Date;return e2.setMinutes(e2.getMinutes()-e2.getTimezoneOffset()),e2.toISOString().slice(0,16)}function jt(e2){return e2.success?"":e2.code==="DENIED"?"You can't do that here.":e2.code==="CONFLICT"?"Someone changed this first. Reload and try again.":e2.code==="INVALID"?xt(e2.errors)||"Some details are missing or not valid.":xt(e2.errors)||"Something went wrong. Try again."}function Mt(e2,t2){let n2=typeof e2=="string"?new Date(e2):e2;return new Intl.DateTimeFormat("en-CA",{timeZone:t2,year:"numeric",month:"2-digit",day:"2-digit"}).format(n2)}function Y(e2,t2){let n2=new Date(`${e2}T00:00:00Z`);return n2.setUTCDate(n2.getUTCDate()+t2),n2.toISOString().slice(0,10)}function Nt(e2){return Y(e2,-((new Date(`${e2}T00:00:00Z`).getUTCDay()+6)%7))}function Pt(e2,t2){if(e2.startOn){let t3=e2.endOn&&e2.endOn>e2.startOn?e2.endOn:Y(e2.startOn,1),n2=[];for(let r2=e2.startOn;r2<t3&&n2.length<62;r2=Y(r2,1))n2.push(r2);return n2}return e2.startsAt?[Mt(e2.startsAt,t2)]:[]}var Ft=(e2,t2)=>e2&&t2?e2.split("{id}").join(encodeURIComponent(t2)):void 0;function X(e2){if(typeof e2!="string")return;let t2=e2.replace(/\s+/g," ").trim();if(t2!=="")return t2.length>60?`${t2.slice(0,59)}…`:t2}var It="This can’t be done from here yet.";function Lt(e2){let[t2,n2]=p(null),[r2,i2]=p(""),o2=f(false),s2=typeof e2=="function",c2=f(e2);return typeof e2=="function"&&(c2.current=e2),{run:a(async(e3,t3)=>{let r3=c2.current;if(typeof r3!="function"||o2.current)return{ok:false};o2.current=true,n2(e3),i2("");try{let n3=await r3(t3?{action:e3,values:t3}:{action:e3});return n3&&typeof n3=="object"&&n3.success===false?(i2(jt(n3)||"Something went wrong. Try again."),{ok:false,result:n3}):{ok:true,result:n3}}catch{return i2("Something went wrong. Try again."),{ok:false}}finally{o2.current=false,n2(null)}},[]),busy:t2,message:r2,available:s2,clearMessage:()=>i2("")}}function Rt(){let[e2,t2]=p(null);return{held:e2,ask:e3=>t2(e3),clear:()=>t2(null)}}function zt(e2){if(typeof e2!="string")return;let t2=e2.trim();if(t2===""||/[\\\u0000-\u001f]/.test(t2))return;let n2=t2;for(let e3=0;e3<3;e3++)try{let e4=decodeURIComponent(n2);if(e4===n2)break;n2=e4}catch{return}if(/[\\\u0000-\u001f]/.test(n2)||n2.startsWith("//")||/^[a-z][a-z0-9+.-]*:/i.test(n2))return;let r2=n2.split(/[?#]/)[0]??"";if(!(/^\/(auth|api)(\/|$)/i.test(r2.replace(/\/\.\//g,"/"))||/(^|\/)\.\.(\/|$)/.test(r2)))return/^[/?#]/.test(t2)?t2:void 0}var Bt={unreleased:"wait",released:"shared",changed:"ready",staff:"stop",withdrawn:"out"};function Vt(e2){if(e2?.state==="staff_only")return{words:"Staff only",mark:Bt.staff};if(e2?.state==="withdrawn")return{words:"Withdrawn · not visible to client",mark:Bt.withdrawn};if(e2?.state!=="released")return{words:"Not released yet",mark:Bt.unreleased};let t2=e2.number,n2=e2.hasChanges===true;return{words:`Visible to client${typeof t2=="number"&&Number.isInteger(t2)&&t2>0?` · release ${t2}`:""}${n2?" · edited since":""}`,mark:n2?Bt.changed:Bt.released}}function Ht(e2){let{release:t2,canRelease:n2=true,onIntent:r2,className:i2,style:a2}=e2,o2=c(),s2=vt(_t()),{run:l2,busy:u2,message:d2,available:f2}=Lt(r2);if(!s2)return null;let{words:p2,mark:m2}=Vt(t2),h2=e2.busy===true||u2==="release",v2=zt(e2.versionsHref),y2=zt(e2.viewAsHref),x2=t2?.state==="staff_only",S2=n2!==false&&f2&&!x2,C2=h2?"Releasing…":t2?.state==="withdrawn"?"Release again":t2?.state==="released"&&t2.hasChanges===true?"Release changes":"Release",w2=[];(v2||f2)&&w2.push({id:"versions",label:"Versions",href:v2,action:"view_versions"}),!x2&&(y2||f2)&&w2.push({id:"view-as",label:"View as client",href:y2,action:"view_as_client"}),f2&&w2.push({id:"edit",label:"Edit with the assistant",action:"edit_with_assistant"});let T2=w2.map(e3=>({id:e3.id,label:e3.label,...e3.href?{href:e3.href}:{onSelect:()=>void l2(e3.action)}}));return _("div",{className:b("core-page-staff-tools",i2),style:a2,role:"group","aria-label":"Staff tools for this page","data-state":x2?"staff_only":t2?.state==="released"?"released":"unreleased","aria-busy":h2||void 0,children:[_("div",{className:"core-page-staff-tools__bar",children:[_("span",{className:"core-page-staff-tools__pill",role:"status",children:[g("span",{className:"core-page-staff-tools__mark","data-mark":m2,"aria-hidden":"true"}),p2]}),_("div",{className:"core-page-staff-tools__actions",children:[S2?g("button",{type:"button",className:"core-page-staff-tools__button","data-primary":"",disabled:h2,"aria-describedby":`${o2}-note`,onClick:()=>void l2("release"),children:C2}):null,w2.map(e3=>e3.href?g("a",{className:"core-page-staff-tools__button core-page-staff-tools__other",href:e3.href,children:e3.label},e3.id):g("button",{type:"button",className:"core-page-staff-tools__button core-page-staff-tools__other",onClick:()=>void l2(e3.action),children:e3.label},e3.id)),T2.length>0?g(Se,{label:"Staff tools",placement:"bottom-end",items:T2,trigger:g("button",{type:"button",className:"core-page-staff-tools__button core-page-staff-tools__more","aria-label":"More staff tools",children:"More"})}):null]})]}),g("span",{id:`${o2}-note`,className:"core-page-staff-tools__sr",children:S2?t2?.state==="released"?"Release makes the latest changes visible to the client.":"Release makes this page visible to the client.":""}),d2?g("p",{className:"core-page-staff-tools__message",role:"alert",children:d2}):null]})}function Ut({label:e2,actions:t2,children:n2,rail:r2=false,anchor:i2,className:a2,...o2}){return g("section",{...y(o2),id:i2,"aria-label":e2,className:b("core-rule-section",a2),"data-rail":r2||void 0,children:_("div",{className:"core-rule-section__grid",children:[_("div",{className:"core-rule-section__head",children:[e2&&g(it,{as:"p",children:e2}),t2!=null&&g("div",{className:"core-rule-section__actions",children:t2})]}),g("div",{className:"core-rule-section__body",children:n2})]})})}function Wt({label:e2,children:t2,arrow:n2=true,className:r2,href:i2,action:a2,input:o2,actions:s2,navigate:c2,onClick:l2,...u2}){let d2=Ye({href:i2,action:a2,input:o2,actions:s2,navigate:c2,onClick:l2}),f2=_(h,{children:[g("span",{className:"core-underlined-action__label",children:t2??e2}),n2&&g("svg",{className:"core-underlined-action__arrow",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:g("path",{d:"M5 12h14M13 6l6 6-6 6"})})]}),p2={...y(u2),className:b("core-underlined-action",r2)};return i2?g("a",{...p2,href:i2,onClick:d2.onClick,...d2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:f2}):g("button",{...p2,type:"button",onClick:d2.onClick,disabled:d2.busy,children:f2})}var Gt=(e2="")=>e2.trim().split(/\s+/).filter(Boolean).map(e3=>e3[0].toUpperCase()).filter((e3,t2,n2)=>t2===0||t2===n2.length-1).join("").slice(0,2);function Kt({name:e2,initials:t2,src:n2,alt:r2,size:i2="md",tone:a2,title:o2,className:s2,...c2}){let[l2,u2]=p(false),d2=o2??r2??e2??"";return g("span",{...y(c2),className:b("core-avatar",a2!==void 0&&"core-toned",s2),"data-size":i2,"data-tone":a2===void 0?void 0:et(a2),role:"img","aria-label":d2||void 0,children:n2&&!l2?g("img",{src:n2,alt:"",onError:()=>u2(true)}):g("span",{"aria-hidden":"true",children:t2??Gt(e2)})})}function qt({code:e2,children:t2,block:n2=false,className:r2,...i2}){let a2=t2??e2;return n2?g("pre",{...y(i2),className:b("core-code",r2),"data-block":"",children:g("code",{children:a2})}):g("code",{...y(i2),className:b("core-code",r2),children:a2})}var Jt={1:"lg",2:"md",3:"sm",4:"xs",5:"xs",6:"xs"};function Yt({text:e2,children:t2,level:n2=2,size:r2,anchor:i2,className:a2,...o2}){let s2=Math.min(6,Math.max(1,Math.round(n2))),c2=`h${s2}`;return g(c2,{...y(o2),id:i2,className:b("core-heading",a2),"data-size":r2??Jt[s2],children:t2??e2})}var Xt={xs:"eyebrow",sm:"body-sm",md:"body",lg:"title-sm",xl:"title-md"};function Zt({text:e2,children:t2,as:n2="span",size:r2="md",weight:i2="normal",tone:a2="default",align:o2="start",truncate:s2=false,lines:c2,className:l2,...u2}){let d2=n2,f2=c2&&c2>0?Math.min(6,Math.round(c2)):void 0;return g(d2,{...y(u2),className:b("core-text",l2),"data-role":Xt[r2]??"body","data-weight":i2,"data-tone":a2,"data-align":o2,"data-truncate":s2||void 0,"data-lines":f2,children:t2??e2})}function Qt({label:e2,hint:t2,helperText:n2,error:r2,required:i2,optional:a2,htmlFor:o2,id:s2,hintId:l2,errorId:u2,as:d2="div",children:f2,className:p2,style:m2}){let h2=t2??n2,v2=o2??s2,y2=c().replace(/:/g,""),x2=l2??(h2?`${v2??y2}-hint`:void 0),S2=u2??(r2?`${v2??y2}-error`:void 0),C2=d2,w2=d2==="fieldset"?"legend":"label";return _(C2,{className:b("core-field",p2),style:m2,"data-invalid":r2?"":void 0,children:[e2&&_(w2,{className:"core-field__label",...w2==="label"&&v2?{htmlFor:v2}:{},children:[e2,i2&&_("span",{className:"core-field__required","aria-hidden":"true",children:[" ","*"]}),a2&&!i2&&g("span",{className:"core-field__optional",children:" (optional)"})]}),h2&&g("p",{className:"core-field__hint",id:x2,children:h2}),f2,r2&&g("p",{className:"core-field__error",id:S2,role:"alert",children:r2})]})}function $t(e2,t2,n2){let r2=c(),i2=e2??`f${r2.replace(/:/g,"")}`,a2=t2?`${i2}-hint`:void 0,o2=n2?`${i2}-error`:void 0;return{control:i2,hintId:a2,errorId:o2,aria:{"aria-describedby":[a2,o2].filter(Boolean).join(" ")||void 0,"aria-invalid":n2?true:void 0}}}function en(e2){let t2={};for(let[n2,r2]of Object.entries(e2))(n2==="title"||n2==="autoFocus"||n2.startsWith("aria-")||n2.startsWith("data-"))&&(t2[n2]=r2);return t2}function tn(e2,t2){return{"aria-describedby":[t2["aria-describedby"],e2.aria["aria-describedby"]].filter(Boolean).join(" ")||void 0,"aria-invalid":e2.aria["aria-invalid"]??t2["aria-invalid"]}}function nn(e2,t2){return n2=>{e2?.(n2),t2?.(n2)}}function rn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,children:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:f2,onBlur:m2,onFocus:h2,className:v2,wrapperClassName:y2,style:x2,ref:S2,...C2}){let w2=$t(i2,c2,l2),T2=en(C2),[E2,D2]=p(t2??false),O2=e2??E2,k2=nn(n2,r2);return g(Qt,{className:b("core-checkbox",y2),style:x2,hint:c2,error:l2,hintId:w2.hintId,errorId:w2.errorId,children:_("label",{className:"core-choices__option","data-disabled":d2?"":void 0,children:[g("input",{...T2,ref:S2,id:w2.control,type:"checkbox",className:v2,name:a2,checked:O2,required:u2,"aria-required":u2||void 0,disabled:d2,"aria-readonly":f2||void 0,onChange:t3=>{f2||(e2===void 0&&D2(t3.target.checked),k2(t3.target.checked))},onBlur:m2,onFocus:h2,...tn(w2,T2)}),_("span",{children:[s2??o2,u2&&g("span",{className:"core-field__required","aria-hidden":"true",children:" *"})]})]})})}function an({options:e2,value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:o2,label:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:f2,orientation:m2="vertical",min:h2,max:v2,className:y2,style:x2,ref:S2}){let C2=[h2===void 0?"":`at least ${h2}`,v2===void 0?"":`at most ${v2}`].filter(Boolean).join(", "),w2=[c2,C2?`Choose ${C2}.`:""].filter(Boolean).join(" ")||void 0,T2=$t(a2,w2,l2),[E2,D2]=p(n2??[]),O2=t2??E2,k2=nn(r2,i2),A2=v2!==void 0&&O2.length>=v2;return g(Qt,{as:"fieldset",className:b("core-choices",y2),style:x2,label:s2,hint:w2,error:l2,required:u2,hintId:T2.hintId,errorId:T2.errorId,children:g("div",{className:"core-choices__list","data-orientation":m2,role:"group",...T2.aria,children:e2.map((n3,r3)=>{let i3=O2.includes(n3.value);return _("label",{className:"core-choices__option","data-disabled":n3.disabled||d2?"":void 0,children:[g("input",{ref:r3===0?S2:void 0,id:r3===0?T2.control:void 0,type:"checkbox",name:o2,value:n3.value,checked:i3,disabled:n3.disabled||d2||!i3&&A2||f2&&!i3,"aria-readonly":f2||void 0,onChange:()=>{if(f2)return;let r4=e2.map(e3=>e3.value).filter(e3=>e3===n3.value?!i3:O2.includes(e3));t2===void 0&&D2(r4),k2(r4)}}),g("span",{children:n3.label})]},n3.value)})})})}function on({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,required:l2,disabled:u2,readOnly:d2,min:f2,max:m2,fromLabel:h2="From",toLabel:v2="To",className:y2,style:x2,ref:S2}){let C2=$t(i2,s2,c2),[w2,T2]=p(t2??{from:null,to:null}),E2=e2??w2,D2=nn(n2,r2),O2=(t3,n3)=>{if(d2)return;let r3={...E2,[t3]:n3===""?null:n3};e2===void 0&&T2(r3),D2(r3)},k2={disabled:u2,readOnly:d2,required:l2,"aria-required":l2||void 0,className:"core-input",...C2.aria};return g(Qt,{as:"fieldset",className:b("core-date-range",y2),style:x2,label:o2,hint:s2,error:c2,required:l2,hintId:C2.hintId,errorId:C2.errorId,children:_("div",{className:"core-date-range__row",children:[_("label",{className:"core-date-range__part",children:[g("span",{className:"core-date-range__label",children:h2}),g("input",{ref:S2,id:C2.control,type:"date",name:a2?`${a2}.from`:void 0,value:E2.from??"",min:f2,max:E2.to??m2,onChange:e3=>O2("from",e3.target.value),...k2})]}),_("label",{className:"core-date-range__part",children:[g("span",{className:"core-date-range__label",children:v2}),g("input",{type:"date",name:a2?`${a2}.to`:void 0,value:E2.to??"",min:E2.from??f2,max:m2,onChange:e3=>O2("to",e3.target.value),...k2})]})]})})}function sn(e2){return!Number.isFinite(e2)||e2<0?"":e2<1024?`${e2} B`:e2<1048576?`${(e2/1024).toFixed(+(e2<10240))} KB`:`${(e2/1048576).toFixed(1)} MB`}function cn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,required:l2,disabled:u2,readOnly:d2,upload:m2,accept:v2,hash:y2=false,className:x2,style:S2,ref:C2}){let w2=$t(i2,s2,c2),[T2,E2]=p(t2??null),D2=e2===void 0?T2:e2,O2=nn(n2,r2),[k2,A2]=p({busy:false,dragging:false}),j2=f(null),M2=t3=>{e2===void 0&&E2(t3),O2(t3)},N2=async e3=>{if(e3&&m2&&!d2&&!u2){A2({busy:true,dragging:false});try{let t3=await m2(e3,{hash:y2});"error"in t3?A2({busy:false,failed:t3.error,dragging:false}):(A2({busy:false,dragging:false}),M2(t3))}catch{A2({busy:false,failed:"That file couldn’t be stored. Try again.",dragging:false})}}},P2=e3=>{e3.preventDefault(),N2(e3.dataTransfer.files?.[0])},F2=c2??k2.failed;return g(Qt,{className:b("core-file-field",x2),style:S2,label:o2,hint:s2,error:F2,required:l2,htmlFor:w2.control,hintId:w2.hintId,errorId:F2?`${w2.control}-error`:void 0,children:_("div",{className:"core-file-field__box","data-dragging":k2.dragging?"":void 0,"data-busy":k2.busy?"":void 0,onDragOver:e3=>{d2||u2||!m2||(e3.preventDefault(),k2.dragging||A2(e4=>({...e4,dragging:true})))},onDragLeave:()=>A2(e3=>({...e3,dragging:false})),onDrop:P2,children:[D2?_("div",{className:"core-file-field__file",children:[g("span",{className:"core-file-field__name",children:D2.file.name}),g("span",{className:"core-file-field__size",children:sn(D2.file.size)}),!d2&&!u2&&g("button",{type:"button",className:"core-file-field__button",onClick:()=>M2(null),"aria-label":`Remove ${D2.file.name}`,children:"Remove"})]}):k2.busy?g("span",{className:"core-file-field__status",role:"status",children:"Uploading…"}):_(h,{children:[g("button",{ref:C2,id:w2.control,type:"button",className:"core-file-field__button",disabled:u2||d2||!m2,"aria-required":l2||void 0,"aria-describedby":[w2.hintId,F2?`${w2.control}-error`:void 0].filter(Boolean).join(" ")||void 0,"aria-invalid":F2?true:void 0,onClick:()=>j2.current?.click(),children:"Choose file"}),g("span",{className:"core-file-field__drop",children:"or drop it here"})]}),g("input",{ref:j2,type:"file",name:a2,accept:v2,hidden:true,tabIndex:-1,onChange:e3=>void N2(e3.target.files?.[0])})]})})}function ln({options:e2,value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:o2,label:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:f2,orientation:m2="vertical",className:h2,wrapperClassName:v2,style:y2,ref:x2,...S2}){let C2=$t(a2,c2,l2),w2=en(S2),[T2,E2]=p(n2??null),D2=t2===void 0?T2:t2,O2=nn(r2,i2),k2=o2??C2.control;return g(Qt,{as:"fieldset",className:b("core-choices",v2),style:y2,label:s2,hint:c2,error:l2,required:u2,hintId:C2.hintId,errorId:C2.errorId,children:g("div",{...w2,className:b("core-choices__list",h2),"data-orientation":m2,role:"radiogroup","aria-required":u2||void 0,...tn(C2,w2),children:e2.map((e3,n3)=>_("label",{className:"core-choices__option","data-disabled":e3.disabled||d2?"":void 0,children:[g("input",{ref:n3===0?x2:void 0,id:n3===0?C2.control:void 0,type:"radio",name:k2,value:e3.value,checked:D2===e3.value,disabled:e3.disabled||d2||f2&&D2!==e3.value,onChange:()=>{f2||(t2===void 0&&E2(e3.value),O2(e3.value))}}),g("span",{children:e3.label})]},e3.value))})})}var un=e2=>{if(e2.trim()==="")return null;let t2=Number(e2);return Number.isFinite(t2)?t2:null};function dn({type:e2="text",value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:o2,label:c2,hint:l2,error:u2,required:d2,disabled:f2,readOnly:m2,placeholder:h2,inputMode:v2,autoComplete:y2,min:x2,max:S2,step:C2,prefix:w2,suffix:T2,onEnter:E2,onKeyDown:D2,onBlur:O2,onFocus:k2,className:A2,wrapperClassName:j2,style:M2,ref:N2,...P2}){let F2=$t(a2,l2,u2),I2=en(P2),[L2,R2]=p(n2),z2=t2===void 0?L2:t2,B2=nn(r2,i2),ee2=e3=>e3==null?"":String(e3),[te2,V2]=p(ee2(z2));s(()=>{e2==="number"&&un(te2)!==(z2??null)&&V2(ee2(z2))},[z2]);let H2=e3=>{D2?.(e3),!e3.defaultPrevented&&E2&&e3.key==="Enter"&&!e3.shiftKey&&!e3.nativeEvent.isComposing&&e3.keyCode!==229&&E2(e3)},U2=g("input",{...I2,ref:N2,id:F2.control,name:o2,type:e2==="number"?"text":e2,className:b("core-input core-text-field__input",A2),value:e2==="number"?te2:ee2(z2),onChange:n3=>{let r3=n3.target.value,i3=e2==="number"?un(r3):r3;e2==="number"&&V2(r3),t2===void 0&&R2(i3),B2(i3)},onKeyDown:H2,onBlur:O2,onFocus:k2,placeholder:h2,inputMode:v2??(e2==="number"?"decimal":void 0),autoComplete:y2,min:x2,max:S2,step:C2,required:d2,"aria-required":d2||void 0,disabled:f2,readOnly:m2,...tn(F2,I2)}),W2=w2||T2?_("div",{className:"core-text-field__affixed",children:[w2&&g("span",{className:"core-text-field__affix","aria-hidden":"true",children:w2}),U2,T2&&g("span",{className:"core-text-field__affix","aria-hidden":"true",children:T2})]}):U2;return g(Qt,{className:b("core-text-field",j2),style:M2,label:c2,hint:l2,error:u2,required:d2,htmlFor:F2.control,hintId:F2.hintId,errorId:F2.errorId,children:W2})}function fn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,label:i2="Search",onSearch:a2,onClear:o2,size:s2="md",className:c2,wrapperClassName:l2,...u2}){let[d2,f2]=p(t2??""),m2=e2??d2,h2=t3=>{e2===void 0&&f2(t3),n2?.(t3),r2?.(t3)};return _("div",{className:b("core-search-field",l2),"data-filled":m2?"":void 0,"data-size":s2,children:[g(dn,{...u2,label:i2,value:m2,onChange:e3=>h2(typeof e3=="string"?e3:""),onEnter:()=>a2?.(m2),type:"search",inputMode:"search",className:c2,wrapperClassName:"core-search-field__field"}),_("svg",{className:"core-search-field__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:[g("circle",{cx:"11",cy:"11",r:"6.5"}),g("path",{d:"M16 16l4 4"})]}),m2&&!u2.disabled&&!u2.readOnly&&g("button",{type:"button",className:"core-search-field__clear","aria-label":"Clear search",onClick:()=>{h2(""),o2?.()},children:g("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:g("path",{d:"M6 6l12 12M18 6L6 18"})})})]})}function pn({options:e2,value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:o2,label:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:f2,placeholder:m2="Choose…",onBlur:h2,onFocus:v2,className:y2,wrapperClassName:x2,style:S2,ref:C2,...w2}){let T2=$t(a2,c2,l2),E2=en(w2),[D2,O2]=p(n2??null),k2=t2===void 0?D2:t2,A2=nn(r2,i2);return g(Qt,{className:b("core-select",x2),style:S2,label:s2,hint:c2,error:l2,required:u2,htmlFor:T2.control,hintId:T2.hintId,errorId:T2.errorId,children:_("select",{...E2,ref:C2,id:T2.control,name:o2,className:b("core-input core-select__input",y2),value:k2??"",onChange:e3=>{let n3=e3.target.value===""?null:e3.target.value;t2===void 0&&O2(n3),A2(n3)},required:u2,"aria-required":u2||void 0,disabled:d2||f2,"aria-readonly":f2||void 0,onBlur:h2,onFocus:v2,...tn(T2,E2),children:[g("option",{value:"",children:m2}),e2.map(e3=>g("option",{value:e3.value,disabled:e3.disabled,children:e3.label},e3.value))]})})}function mn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,required:l2,disabled:u2,readOnly:d2,min:f2=0,max:m2=100,step:h2=1,format:v2=String,onBlur:y2,onFocus:x2,className:S2,wrapperClassName:C2,style:w2,ref:T2,...E2}){let D2=$t(i2,s2,c2),O2=en(E2),[k2,A2]=p(t2??f2),j2=e2??k2,M2=nn(n2,r2);return g(Qt,{className:b("core-slider",C2),style:w2,label:o2,hint:s2,error:c2,required:l2,htmlFor:D2.control,hintId:D2.hintId,errorId:D2.errorId,children:_("div",{className:"core-slider__row",children:[g("input",{...O2,ref:T2,id:D2.control,name:a2,type:"range",className:b("core-slider__input",S2),min:f2,max:m2,step:h2,value:j2,disabled:u2,"aria-readonly":d2||void 0,"aria-valuetext":v2(j2),onChange:t3=>{if(d2)return;let n3=Number(t3.target.value);e2===void 0&&A2(n3),M2(n3)},onBlur:y2,onFocus:x2,...tn(D2,O2)}),g("output",{className:"core-slider__value",htmlFor:D2.control,children:v2(j2)})]})})}function hn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,disabled:l2,readOnly:u2,onBlur:d2,onFocus:f2,className:m2,wrapperClassName:h2,style:v2,ref:y2,...x2}){let S2=$t(i2,s2,c2),C2=en(x2),[w2,T2]=p(t2??false),E2=e2??w2,D2=nn(n2,r2);return _("div",{className:b("core-switch",h2),style:v2,children:[_("button",{...C2,ref:y2,id:S2.control,name:a2,type:"button",role:"switch","aria-checked":E2,"aria-readonly":u2||void 0,disabled:l2,className:b("core-switch__control",m2),onClick:()=>{u2||(e2===void 0&&T2(!E2),D2(!E2))},onBlur:d2,onFocus:f2,...tn(S2,C2),children:[g("span",{className:"core-switch__track","aria-hidden":"true",children:g("span",{className:"core-switch__thumb"})}),g("span",{className:"core-switch__label",children:o2})]}),s2&&g("p",{className:"core-field__hint",id:S2.hintId,children:s2}),c2&&g("p",{className:"core-field__error",id:S2.errorId,role:"alert",children:c2})]})}function gn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,required:u2,disabled:d2,readOnly:m2,placeholder:h2,rows:v2=3,autoGrow:y2=true,maxLength:x2,onKeyDown:S2,onBlur:C2,onFocus:w2,className:T2,wrapperClassName:E2,style:D2,ref:O2,...k2}){let A2=$t(i2,s2,c2),j2=en(k2),[M2,N2]=p(t2??""),P2=e2??M2,F2=nn(n2,r2),I2=f(null);return l(()=>{let e3=I2.current;y2&&e3&&(e3.style.height="auto",e3.style.height=`${e3.scrollHeight+2}px`)},[P2,y2]),_(Qt,{className:b("core-text-area",E2),style:D2,label:o2,hint:s2,error:c2,required:u2,htmlFor:A2.control,hintId:A2.hintId,errorId:A2.errorId,children:[g("textarea",{...j2,ref:e3=>{I2.current=e3,typeof O2=="function"?O2(e3):O2&&(O2.current=e3)},id:A2.control,name:a2,className:b("core-input core-text-area__input",T2),rows:v2,value:P2,onChange:t3=>{e2===void 0&&N2(t3.target.value),F2(t3.target.value)},onKeyDown:S2,onBlur:C2,onFocus:w2,placeholder:h2,maxLength:x2,required:u2,"aria-required":u2||void 0,disabled:d2,readOnly:m2,...tn(A2,j2)}),x2!==void 0&&_("span",{className:"core-field__hint","aria-live":"polite",children:[P2.length," / ",x2]})]})}function _n({label:e2,children:t2,tone:n2,variant:r2="soft",className:i2,...a2}){return g("span",{...y(a2),className:b("core-badge","core-toned",i2),"data-tone":et(n2),"data-variant":r2,children:t2??e2})}function vn({message:e2,title:t2,action:n2,className:r2,...i2}){return _("div",{...y(i2),className:b("core-empty-state",r2),role:"status",children:[t2&&g("p",{className:"core-empty-state__title",children:t2}),g("p",{className:"core-empty-state__message",children:e2}),n2!=null&&g("div",{className:"core-empty-state__action",children:n2})]})}var yn={info:"M12 16v-5M12 8h.01M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z",success:"M8 12.5l2.5 2.5L16 9.5M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z",warning:"M12 9v4M12 17h.01M10.3 3.9L2.2 18a2 2 0 0 0 1.7 3h16.2a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",danger:"M12 8v5M12 16h.01M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z"};function bn({title:e2,message:t2,children:n2,tone:r2,action:i2,onDismiss:a2,className:o2,...s2}){let c2=et(r2,"info"),l2=c2==="warning"||c2==="danger";return _("div",{...y(s2),role:l2?"alert":"status",className:b("core-notice","core-toned",o2),"data-tone":c2,children:[g("svg",{className:"core-notice__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:g("path",{d:yn[c2]??yn.info})}),_("div",{className:"core-notice__body",children:[e2&&g("p",{className:"core-notice__title",children:e2}),g("div",{className:"core-notice__message",children:n2??t2})]}),i2&&g("div",{className:"core-notice__action",children:i2}),a2&&g("button",{type:"button",className:"core-notice__dismiss","aria-label":"Dismiss",onClick:a2,children:g("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:g("path",{d:"M6 6l12 12M18 6L6 18"})})})]})}function xn({value:e2,max:t2=100,label:n2,showValue:r2=false,tone:i2,size:a2="md",className:o2,style:s2,...c2}){let l2=typeof e2=="number"&&Number.isFinite(e2)&&t2>0,u2=l2?Math.max(0,Math.min(100,e2/t2*100)):0;return _("div",{...y(c2),className:b("core-progress","core-toned",o2),"data-tone":et(i2,"accent"),"data-size":a2,style:s2,children:[(n2||r2&&l2)&&_("div",{className:"core-progress__head",children:[n2&&g("span",{className:"core-progress__label",children:n2}),r2&&l2&&_("span",{className:"core-progress__value",children:[Math.round(u2),"%"]})]}),g("div",{className:"core-progress__track",role:"progressbar","aria-label":n2,"aria-valuemin":0,"aria-valuemax":l2?t2:void 0,"aria-valuenow":l2?e2:void 0,"data-indeterminate":l2?void 0:"",style:S({"--core-progress-fill":`${u2}%`}),children:g("div",{className:"core-progress__fill"})})]})}function Sn({shape:e2="text",lines:t2=3,width:n2,height:r2,className:i2,style:a2,...o2}){let s2=S({"--core-skeleton-w":x(n2),"--core-skeleton-h":x(r2)},a2);if(e2!=="text")return g("span",{...y(o2),"aria-hidden":"true",className:b("core-skeleton",i2),"data-shape":e2,style:s2});let c2=Math.max(1,Math.min(12,Math.round(t2)));return g("span",{...y(o2),"aria-hidden":"true",className:b("core-skeleton-lines",i2),style:s2,children:Array.from({length:c2},(e3,t3)=>g("span",{className:"core-skeleton","data-shape":"line","data-last":t3===c2-1&&c2>1?"":void 0},t3))})}function Cn({label:e2="Loading",size:t2="md",className:n2,...r2}){return g("span",{...y(r2),role:"status","aria-label":e2,className:b("core-spinner",n2),"data-size":t2})}function wn({content:e2,text:t2,children:n2,side:r2="top",className:i2,...a2}){let[o2,l2]=p(false),u2=c();return s(()=>{if(!o2)return;let e3=e4=>{e4.key==="Escape"&&l2(false)};return document.addEventListener("keydown",e3),()=>document.removeEventListener("keydown",e3)},[o2]),_("span",{...y(a2),className:b("core-tooltip",i2),"aria-describedby":u2,onMouseEnter:()=>l2(true),onMouseLeave:()=>l2(false),onFocus:()=>l2(true),onBlur:()=>l2(false),children:[n2,g("span",{id:u2,role:"tooltip",className:"core-tooltip__bubble","data-side":r2,"data-open":o2?"":void 0,children:e2??t2})]})}function Tn({children:t2,className:r2,style:a2,...o2}){let s2=e.toArray(t2),c2=s2.length===1?s2[0]:null;if(!i(c2))return null;let l2=c2.props??{},u2={...o2,...l2},d2=[r2,l2.className].filter(Boolean).join(" ");d2&&(u2.className=d2),(a2||l2.style)&&(u2.style={...a2,...l2.style});for(let e2 of Object.keys(o2)){let t3=o2[e2],n2=l2[e2];/^on[A-Z]/.test(e2)&&typeof t3=="function"&&typeof n2=="function"&&(u2[e2]=e3=>{t3(e3)!==false&&n2(e3)})}return n(c2,u2)}function En({children:e2,label:t2,variant:n2="primary",size:r2="md",tone:i2="neutral",iconLeft:a2,iconRight:o2,loading:s2=false,disabled:c2=false,type:l2="button",fullWidth:u2=false,asChild:d2=false,className:f2,href:p2,action:m2,input:v2,actions:x2,navigate:S2,onClick:C2,...w2}){let T2=Ye({href:p2,action:m2,input:v2,actions:x2,navigate:S2,onClick:C2}),E2=s2||T2.busy,D2={...y(w2),className:b("core-button",f2),"data-variant":n2,"data-size":r2,"data-tone":i2,"data-full":u2||void 0,"data-busy":E2||void 0},O2=_(h,{children:[E2?g("span",{className:"core-button__spinner","aria-hidden":"true"}):a2,g("span",{className:"core-button__label",children:e2??t2}),o2]});if(d2){let t3=c2||E2,n3=e3=>t3?(e3.preventDefault(),false):T2.onClick(e3);return g(Tn,{...D2,"aria-disabled":t3||void 0,"aria-busy":E2||void 0,onClick:n3,children:e2})}return p2&&!c2?g("a",{...D2,href:p2,onClick:T2.onClick,"aria-busy":E2||void 0,...T2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:O2}):g("button",{...D2,type:l2,disabled:c2||E2,"aria-busy":E2||void 0,onClick:T2.onClick,children:O2})}function Dn({children:e2,label:t2,variant:n2="prompt",size:r2="md",selected:i2,onToggle:a2,iconLeft:o2,disabled:s2=false,className:c2,href:l2,action:u2,input:d2,actions:f2,navigate:p2,onClick:m2,...h2}){let v2=i2!==void 0||a2!==void 0,x2=Ye({href:l2,action:u2,input:d2,actions:f2,navigate:p2,onClick:m2??(a2?()=>a2(!i2):void 0)});return l2&&!s2&&!v2?_("a",{...y(h2),className:b("core-chip",c2),"data-variant":n2,"data-size":r2,href:l2,onClick:x2.onClick,...x2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:[o2,g("span",{className:"core-chip__label",children:e2??t2})]}):_("button",{...y(h2),type:"button",className:b("core-chip",c2),"data-variant":n2,"data-size":r2,"aria-pressed":v2?!!i2:void 0,disabled:s2||x2.busy,onClick:x2.onClick,children:[o2,g("span",{className:"core-chip__label",children:e2??t2})]})}function On({icon:e2,children:t2,label:n2,size:r2="md",variant:i2="ghost",pressed:a2,disabled:o2=false,className:s2,href:c2,action:l2,input:u2,actions:d2,navigate:f2,onClick:p2,...m2}){let h2=Ye({href:c2,action:l2,input:u2,actions:d2,navigate:f2,onClick:p2}),_2={...y(m2),className:b("core-icon-button",s2),"data-size":r2,"data-variant":i2,"aria-label":n2,title:n2},v2=g("span",{className:"core-icon-button__glyph","aria-hidden":"true",children:e2??t2});return c2&&!o2?g("a",{..._2,href:c2,onClick:h2.onClick,...h2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:v2}):g("button",{..._2,type:"button","aria-pressed":a2,disabled:o2||h2.busy,onClick:h2.onClick,children:v2})}function kn({href:e2,children:t2,label:n2,variant:r2="default","aria-current":i2,className:a2,navigate:o2,onClick:s2,...c2}){let l2=Ye({href:e2,navigate:o2,onClick:s2});return qe(e2)||Je(e2)||/^(https?:|mailto:)/i.test(e2)?_("a",{...y(c2),className:b("core-link",a2),"data-variant":r2,"aria-current":i2,href:e2,onClick:l2.onClick,...l2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:[t2??n2,l2.external&&_(h,{children:[g("svg",{className:"core-link__away",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:g("path",{d:"M7 17L17 7M8 7h9v9"})}),g("span",{className:"core-link__note",children:" (opens in a new tab)"})]})]}):g("span",{className:b("core-link",a2),children:t2??n2})}function An(e2){let{param:t2="kind",keep:n2,label:r2="Filter",onChange:i2,className:a2,style:o2}=e2,s2=(Array.isArray(e2.options)?e2.options:[]).filter(e3=>e3&&typeof e3.id=="string"&&typeof e3.label=="string"&&e3.label!=="");if(s2.length===0)return null;let c2=typeof e2.selected=="string"&&s2.some(t3=>t3.id===e2.selected)?e2.selected:s2[0].id;return g("form",{className:"core-filter-chips-form",method:"get",action:"",onSubmit:e3=>{if(!i2)return;e3.preventDefault();let t3=e3.nativeEvent.submitter;t3?.value&&i2(t3.value)},children:_("div",{className:b("core-filter-chips",a2),style:o2,role:"group","aria-label":r2,children:[Object.entries(n2??{}).map(([e3,t3])=>g("input",{type:"hidden",name:e3,value:t3},e3)),s2.map(e3=>g("button",{type:"submit",name:t2,value:e3.id,className:"core-chip","data-variant":"toggle","data-size":"sm","aria-pressed":e3.id===c2,children:g("span",{className:"core-chip__label",children:e3.label})},e3.id))]})})}function jn({options:e2,value:t2,defaultValue:n2,onChange:r2,label:i2,fullWidth:a2=false,size:o2="md",className:s2,setValue:l2,...u2}){let[d2,m2]=p(n2??e2[0]?.value),h2=t2??d2,_2=c(),v2=f([]),x2=e3=>{t2===void 0&&m2(e3),r2?.(e3),l2?.(e3)},S2=e2.map((e3,t3)=>e3.disabled?-1:t3).filter(e3=>e3>=0),C2=(t3,n3)=>{let r3=t3.key==="ArrowRight"||t3.key==="ArrowDown"?1:t3.key==="ArrowLeft"||t3.key==="ArrowUp"?-1:0;if(!r3||!S2.length)return;t3.preventDefault();let i3=S2.indexOf(n3),a3=S2[(i3+r3+S2.length)%S2.length];v2.current[a3]?.focus(),x2(e2[a3].value)};return g("div",{...y(u2),role:"radiogroup","aria-label":i2,className:b("core-segmented",s2),"data-full":a2||void 0,"data-size":o2,children:e2.map((e3,t3)=>{let n3=e3.value===h2;return g("button",{ref:e4=>{v2.current[t3]=e4},type:"button",role:"radio",name:_2,"aria-checked":n3,tabIndex:n3||h2===void 0&&t3===S2[0]?0:-1,disabled:e3.disabled,className:"core-segmented__option",onClick:()=>x2(e3.value),onKeyDown:e4=>C2(e4,t3),children:e3.label},e3.value)})})}function Mn({items:e2=[],children:t2,numbered:n2=false,single:r2=false,rules:i2="subtle",value:a2,onValueChange:o2,className:l2,...u2}){let d2=c(),p2=f(null),m2=n2?"ol":"ul",h2=(e3,t3)=>e3.id??String(t3),v2=a2!==void 0,x2=v2?new Set(a2):void 0,S2=()=>{x2&&p2.current&&p2.current.querySelectorAll("details[data-item]").forEach(e3=>{let t3=x2.has(e3.dataset.item);e3.open!==t3&&(e3.open=t3)})};s(S2);let C2=()=>{if(!p2.current)return;let t3=[...p2.current.querySelectorAll("details[data-item]")].filter(e3=>e3.open).map(e3=>e3.dataset.item),n3=v2?e2.map(h2).filter(e3=>x2.has(e3)):void 0;n3&&n3.length===t3.length&&n3.every((e3,n4)=>e3===t3[n4])||(o2?.(t3),v2&&queueMicrotask(()=>requestAnimationFrame(S2)))};return _("div",{...y(u2),ref:p2,className:b("core-accordion",l2),"data-rules":i2,children:[e2.length>0&&g(m2,{className:"core-accordion__list","data-numbered":n2||void 0,children:e2.map((e3,t3)=>g("li",{className:"core-accordion__item",children:_("details",{className:"core-disclosure",name:r2?d2:void 0,open:v2?void 0:e3.open||void 0,...v2||o2?{"data-item":h2(e3,t3),onToggle:C2}:{},children:[_("summary",{className:"core-disclosure__summary",children:[n2&&g("span",{className:"core-accordion__number",children:t3+1}),e3.question]}),g("div",{className:"core-disclosure__content",children:e3.answer})]})},e3.id??t3))}),t2]})}function Nn({media:e2,header:t2,body:n2,footer:r2,children:i2,tone:a2="plain",className:o2,...s2}){return _("article",{...y(s2),className:b("core-card",o2),"data-tone":a2,children:[e2!=null&&g("div",{className:"core-card__media",children:e2}),t2!=null&&g("header",{className:"core-card__header",children:t2}),(n2!=null||i2!=null)&&_("div",{className:"core-card__body",children:[n2,i2]}),r2!=null&&g("footer",{className:"core-card__footer",children:r2})]})}var Pn={"1:1":"1fr 1fr","2:1":"2fr 1fr","1:2":"1fr 2fr","3:1":"3fr 1fr","1:3":"1fr 3fr"};function Fn({start:e2,end:t2,children:n2,ratio:r2="1:1",gap:i2,stackBelow:a2="compact",className:o2,...s2}){return _("div",{...y(s2),className:b("core-columns",o2),"data-stack":a2,children:[_("div",{className:"core-columns__grid",style:S({"--core-columns-template":Pn[r2]??Pn["1:1"],"--core-columns-gap":x(i2)}),children:[g("div",{className:"core-columns__start",children:e2}),g("div",{className:"core-columns__end",children:t2})]}),n2]})}var In=Fn;function Ln({summary:e2,content:t2,children:n2,open:r2=false,onToggle:i2,className:a2,...o2}){return _("details",{...y(o2),className:b("core-disclosure",a2),open:r2||void 0,onToggle:i2?e3=>i2(e3.currentTarget.open):void 0,children:[g("summary",{className:"core-disclosure__summary",children:e2}),_("div",{className:"core-disclosure__content",children:[t2,n2]})]})}function Rn({items:t2,children:n2,min:r2,columns:i2,gap:a2,className:o2,style:s2,...c2}){let l2=[...e.toArray(t2),...e.toArray(n2)];return g("div",{...y(c2),className:b("core-grid",o2),"data-capped":i2&&i2>0?"":void 0,style:S({"--core-grid-min":x(r2),"--core-grid-gap":x(a2),"--core-grid-cols":i2&&i2>0?String(Math.round(i2)):void 0},s2),children:l2})}function zn({item:t2,each:n2,as:r2,layout:i2="stack",gap:a2,min:o2,empty:s2,className:c2,style:l2,...u2}){let d2=e.toArray(t2);return d2.length?g("div",{...y(u2),className:b("core-repeat",c2),"data-layout":i2,style:S({"--core-repeat-gap":x(a2),"--core-repeat-min":x(o2)},l2),children:d2}):s2?g("p",{className:"core-repeat__empty",children:s2}):null}var Bn=["page-x-of-y","page-number","page-count"],Vn={display:{size:46,lineHeight:.98,weight:500,tracking:"-0.032em"},heading:{size:28,lineHeight:1.05,weight:500,tracking:"-0.03em"},subhead:{size:20,lineHeight:1.15,weight:500,tracking:"-0.02em"},title:{size:17,lineHeight:1.3,weight:500,tracking:"-0.018em"},body:{size:15,lineHeight:1.65,weight:400,tracking:"-0.012em"},bodySmall:{size:13,lineHeight:1.65,weight:400,tracking:"-0.012em"},label:{size:13,lineHeight:1.4,weight:500,tracking:"-0.015em"},note:{size:12,lineHeight:1.7,weight:400,tracking:"-0.012em"},eyebrow:{size:12,lineHeight:1,weight:600,tracking:"0.14em",uppercase:true}},Hn={full:"var(--color-text)",muted:"var(--color-text-muted)",subtle:"var(--color-text-subtle)",border:"var(--color-border)",accent:"var(--color-accent)",accentText:"var(--color-link)",sunken:"var(--color-surface-sunken)"},Un=["cover","what-this-is","told-us","meaning","next-steps","talk-it-through","notes","footer"],Wn=[{id:"workbook",label:"Workbook",sheet:{width:"8.5in",height:"11in"},margins:{top:"0.60in",right:"0.70in",bottom:"0.55in",left:"0.95in"},measure:"6.85in",bodyMeasureCh:64,rail:{placement:"strip"},ink:Hn,rules:{head:"2px",structural:"1px",row:"1px",hairline:"1px"},type:Vn,floorPx:12,depth:{max:1,indent:["0"],numbering:"none"},fills:true,regions:{"page-footer":{left:"member-ref",centre:"document-id",right:"page-x-of-y"}},sections:{known:Un,required:["next-steps","talk-it-through"]}},{id:"report",extends:"workbook",label:"Report",regions:{"page-footer":{right:"page-x-of-y"}},requiredBindings:[],sections:{known:Un,required:["next-steps","talk-it-through"]}},{id:"instrument",extends:"workbook",label:"Instrument",sheet:{width:"8.5in",height:"11in"},margins:{top:"1.00in",right:"1.00in",bottom:"1.00in",left:"1.25in"},measure:"4.50in",bodyMeasureCh:void 0,rail:{placement:"column",axis:"4.75in",width:"1.50in",gutter:"0.25in"},ink:{full:"#000000",muted:"rgba(0,0,0,0.70)",subtle:"rgba(0,0,0,0.62)",border:"rgba(0,0,0,0.45)",accent:"#000000",accentText:"#000000",sunken:"transparent"},rules:{structural:"0.75pt",hairline:"0.25pt"},type:{...Vn,eyebrow:{...Vn.eyebrow,tracking:"0.08em"}},depth:{max:3,indent:["0","0.375in","0.75in"],numbering:"ladder"},fills:false,regions:{"page-footer":{left:"execution-state",right:"page-x-of-y"}},requiredBindings:["execution-state"],sections:{required:[]}}],Gn=new Map;function Kn(e2){Gn.set(e2.id,e2)}for(let e2 of Wn)Kn(e2);function qn(){return[...Gn.keys()].sort()}function Jn(e2){let t2=Gn.get(e2);if(!t2)throw Error(`[document-profile] unknown profile "${e2}". Registered: ${qn().join(", ")}`);if(!t2.extends)return t2;let n2=Gn.get(t2.extends);if(!n2)throw Error(`[document-profile] "${e2}" extends unknown profile "${t2.extends}"`);if(n2.extends)throw Error(`[document-profile] "${e2}" extends "${n2.id}", which extends "${n2.extends}": inheritance is one level deep.`);return{...n2,...t2,id:t2.id,extends:t2.extends}}function Yn(){let e2={};for(let t2 of qn())try{e2[t2]=Jn(t2)}catch(e3){console.warn(`[document-profile] skipping "${t2}": ${e3 instanceof Error?e3.message:String(e3)}`)}return e2}var Xn=Object.freeze(Yn()),Zn="workbook";function Qn(e2,t2){try{return Jn(e2)}catch{return we(`unknown-profile:${e2}`,`[document-profile] unknown profile "${e2}" (first seen in ${t2}): rendering with fallback values.`),null}}function Z(e2,t2){return e2===void 0?(we("no-profile",`[document-profile] no profileId supplied (first seen in ${t2}): falling back to "${Zn}". If this document is an instrument, its numbering and depth are being dropped.`),Qn(Zn,t2)):Qn(e2,t2)}var $n=e2=>e2.replace(/[A-Z]/g,e3=>`-${e3.toLowerCase()}`),er=["full","muted","subtle","border","accent","accentText","sunken"],tr=["structural","hairline","head","row"],nr=["display","heading","subhead","title","body","bodySmall","label","note","eyebrow"],rr=3,ir="initial";function ar(e2){let t2={"--doc-sheet-width":e2.sheet.width,"--doc-sheet-height":e2.sheet.height,"--doc-margin-top":e2.margins.top,"--doc-margin-right":e2.margins.right,"--doc-margin-bottom":e2.margins.bottom,"--doc-margin-left":e2.margins.left,"--doc-measure":e2.measure,"--doc-body-measure":e2.bodyMeasureCh?`${e2.bodyMeasureCh}ch`:"none","--doc-rail-axis":e2.rail.axis??ir,"--doc-rail-width":e2.rail.width??ir,"--doc-rail-gutter":e2.rail.gutter??ir,"--doc-floor":`${e2.floorPx}px`};for(let n2 of er)t2[`--doc-ink-${$n(n2)}`]=e2.ink[n2];for(let n2 of tr)t2[`--doc-rule-${n2}`]=e2.rules[n2]??ir;for(let n2 of nr){let r2=e2.type[n2],i2=`--doc-type-${$n(n2)}`;t2[`${i2}-size`]=`${r2.size}px`,t2[`${i2}-leading`]=String(r2.lineHeight),t2[`${i2}-weight`]=String(r2.weight),t2[`${i2}-tracking`]=r2.tracking,t2[`${i2}-case`]=r2.uppercase?"uppercase":"none"}for(let n2=1;n2<=rr;n2++)t2[`--doc-indent-${n2}`]=e2.depth.indent[n2-1]??ir;return t2}var or=(e2,t2)=>`${e2} {
2
2
  ${Object.entries(t2).map(([e3,t3])=>` ${e3}: ${t3};`).join("\n")}
3
- }`;function or(e2,t2){return e2.map(e3=>ar(e3.id===t2?`:root,
4
- [data-profile='${e3.id}']`:`[data-profile='${e3.id}']`,ir(e3))).join("\n\n")}var sr=["prose","clause","definitions","table","notice","figure","execution"],cr=/\{\{ref:([^}|]+?)(?:\|(title|full|number))?\}\}/g,lr="[a-z0-9][a-z0-9_-]*",ur=RegExp(`^(?:(${lr}):)?(${lr}(?:\\.${lr})*)(?:#(${lr}))?$`);RegExp(`^${lr}$`);function dr(e2,t2){let n2=e2.trim(),r2=ur.exec(n2);return r2?{key:n2,...r2[1]?{doc:r2[1]}:{},unit:r2[2],...r2[3]?{element:r2[3]}:{},...t2?{form:t2}:{}}:null}function fr(e2){let t2=e2.lastIndexOf(".");return t2<0?e2:e2.slice(t2+1)}function pr(e2){let t2=[],n2=0;for(let r2 of e2.matchAll(new RegExp(cr.source,"g"))){let i2=dr(r2[1],r2[2]);i2&&(r2.index>n2&&t2.push({kind:"text",text:e2.slice(n2,r2.index)}),t2.push({kind:"ref",...i2}),n2=r2.index+r2[0].length)}return n2<e2.length&&t2.push({kind:"text",text:e2.slice(n2)}),t2}function mr(e2){return e2.includes("{{ref:")}var Q=e2=>e2?{"data-profile":e2}:{},hr=e2=>e2?.fills===false?{"data-fills":"none"}:{},gr={note:"ⓘ",tip:"💡",warning:"⚠️",important:"❗"};function _r({children:e2,tone:t2="note",title:n2,profileId:r2,profile:i2,className:a2,style:o2}){let s2=i2??Z(r2,"Aside"),c2=s2?.fills===false;return _("aside",{role:"note",className:b("core-aside",a2),"data-tone":t2,...Q(i2?.id??r2),...hr(s2),style:o2,children:[c2?null:g("span",{className:"core-aside__icon","aria-hidden":true,children:gr[t2]}),_("div",{className:"core-aside__body",children:[n2&&g("div",{className:"core-aside__title",children:n2}),g("div",{className:"core-aside__text",children:e2})]})]})}function vr({children:e2,profileId:t2,profile:n2,full:r2=false,className:i2,style:a2}){return n2||Z(t2,"Prose"),g("div",{className:b("core-prose",i2),"data-full":r2?"":void 0,...Q(n2?.id??t2),style:a2,children:e2})}function yr({children:e2,citation:t2,className:n2,style:r2}){return _("figure",{className:b("core-quote",n2),style:r2,children:[g("blockquote",{className:"core-quote__body",children:e2}),t2&&_("figcaption",{className:"core-quote__citation",children:["— ",t2]})]})}function br({term:e2,description:t2,pairs:n2,profileId:r2,profile:i2,className:a2,style:o2}){i2||Z(r2,"Definition");let s2=n2??(e2===void 0?[]:[{term:e2,description:t2}]);return g("dl",{className:b("core-definition",a2),...Q(i2?.id??r2),style:o2,children:s2.map((e3,t3)=>_("div",{className:"core-definition__item",children:[g("dt",{className:"core-definition__term",children:e3.term}),g("dd",{className:"core-definition__description",children:e3.description})]},t3))})}var xr="katex";function Sr(e2){if(typeof document>"u")return false;for(let t2 of document.querySelectorAll('script[type="importmap"]'))try{if(JSON.parse(t2.textContent??"").imports?.[e2])return true}catch{}return false}var Cr=e2=>import(e2),wr;function Tr(){return wr??=Sr(xr)?Cr(xr).then(e2=>{let t2=e2,n2=t2.default??t2;return typeof n2.render=="function"?n2:null},()=>null):Promise.resolve(null),wr}function Er({children:e2="",mode:t2="inline",className:n2}){let r2=f(null),[i2,a2]=p(null),[o2,c2]=p(null),l2=`${t2}:${e2}`;return s(()=>{let e3=true;return Tr().then(t3=>{e3&&t3&&a2(()=>t3)}),()=>{e3=false}},[]),s(()=>{if(i2&&r2.current&&o2!==l2)try{i2.render(e2,r2.current,{displayMode:t2==="block",throwOnError:false})}catch{c2(l2)}},[i2,e2,t2,l2,o2]),!i2||o2===l2?g("span",{className:b("core-math",n2),"data-mode":t2,"data-fallback":"",title:"KaTeX not available — showing TeX source",children:e2}):g("span",{ref:r2,className:b("core-math",n2),"data-mode":t2})}function Dr(e2,t2){switch(t2.type){case"register":return e2.footnotes.some(e3=>e3.id===t2.entry.id)?e2:{footnotes:[...e2.footnotes,t2.entry]};case"unregister":return{footnotes:e2.footnotes.filter(e3=>e3.id!==t2.id)};default:return e2}}var Or=r(null);function kr(){return o(Or)}function Ar({children:e2}){let[t2,n2]=d(Dr,{footnotes:[]}),r2=f(0),i2=a(e3=>{r2.current+=1;let t3=r2.current;return n2({type:"register",entry:{...e3,number:t3}}),t3},[]),o2=a(e3=>n2({type:"unregister",id:e3}),[]),s2=u(()=>({state:t2,registerFootnote:i2,unregisterFootnote:o2}),[t2,i2,o2]);return g(Or.Provider,{value:s2,children:e2})}function jr({children:e2}){let t2=c(),n2=kr(),[r2,i2]=p(null);return s(()=>{if(!n2)return;let r3=n2.registerFootnote({id:t2,content:e2});return i2(r3),()=>n2.unregisterFootnote(t2)},[t2]),n2?r2===null?null:g("sup",{id:`core-footnote-ref-${r2}`,className:"core-footnote",children:_("a",{href:`#core-footnote-${r2}`,className:"core-footnote__link",children:["[",r2,"]"]})}):_("span",{className:"core-footnote","data-fallback":"",children:[" ","(",e2,")"]})}function Mr({children:e2,caption:t2,profileId:n2,profile:r2,className:i2,style:a2}){return r2||Z(n2,"Figure"),_("figure",{className:b("core-figure",i2),...Q(r2?.id??n2),style:a2,children:[g("div",{className:"core-figure__body",children:e2}),t2&&g("figcaption",{className:"core-figure__caption",children:t2})]})}function Nr({className:e2}){return g("div",{className:b("core-page-break",e2),"aria-hidden":true})}function Pr({children:e2,as:t2="div",profileId:n2,profile:r2,tone:i2="subtle",className:a2,style:o2}){return r2||Z(n2,"DocumentLabel"),g(t2,{className:b("core-document-label",a2),"data-tone":i2,...Q(r2?.id??n2),style:o2,children:e2})}var Fr=["one","two","three","four","five","six","seven","eight","nine","ten"];function Ir(e2){if(e2.length!==1)return null;let t2=e2[0],n2=Fr[t2-1];return n2?`Article ${n2}`:`Article ${t2}`}function Lr(e2){return e2.length===0?null:e2.length===1?`Article ${e2[0]}`:e2.join(".")}function Rr(e2,t2,n2){let r2=n2==="ladder"&&e2!==void 0&&e2.length>0,i2=[];return t2.map(({level:t3,marker:n3})=>{let a2=Math.min(Number.isInteger(t3)&&t3>=1?t3:1,i2.length+1);return i2.length=a2,i2[a2-1]=(i2[a2-1]??0)+1,n3===void 0?r2?[...e2,...i2].join("."):void 0:n3})}function zr(e2,t2){return e2?.[t2]??t2}function Br({target:e2,form:t2,sectionReferences:n2,sectionNumbers:r2,sectionTitles:i2,sectionAnchors:a2,profileId:o2,profile:s2,className:c2,style:l2}){let u2=s2??Z(o2,"Reference"),d2=dr(e2),f2=n2?.[e2],p2=f2?.openable===false,m2=d2!==null&&d2.doc===void 0,h2=d2?fr(d2.unit):e2,_2=f2?.number??(m2&&d2.element===void 0?r2?.[h2]:void 0),v2=f2?.title??(m2&&d2.element===void 0?i2?.[h2]:void 0),y2=null;if(d2?.element!==void 0){let e3=f2?.element;y2=e3?Rr(f2.number,e3.shape,u2?.depth.numbering)[e3.index]??null:null}else _2&&(y2=Lr(_2));let x2=t2==="full"||d2?.doc!==void 0&&t2!=="title",S2;S2=p2?null:t2==="title"?v2??y2:x2&&y2&&v2&&d2?.element===void 0?`${y2} (${v2})`:y2??v2??null;let C2=S2!==null,w2=C2?f2?f2.href:`#${zr(a2,h2)}`:void 0,T2={className:b("core-reference",c2),"data-target":e2,"data-unresolved":C2||p2?void 0:"","data-closed":p2?"":void 0,...Q(s2?.id??o2),style:l2};return w2?g("a",{href:w2,...T2,children:S2}):g("span",{...T2,children:S2??e2})}function Vr({columns:e2,rows:t2,caption:n2,profileId:r2,profile:i2,className:a2,style:o2}){return i2||Z(r2,"DocumentTable"),e2.length===0?null:_("div",{className:b("core-document-table",a2),...Q(i2?.id??r2),style:o2,children:[n2===void 0?null:g("div",{className:"core-document-table__caption",children:n2}),_("table",{className:"core-document-table__table",children:[g("thead",{children:g("tr",{children:e2.map((e3,t3)=>g("th",{scope:"col",className:"core-document-table__head","data-align":e3.align??"left",children:e3.header},t3))})}),g("tbody",{children:t2.map((t3,n3)=>g("tr",{children:e2.map((e3,n4)=>g("td",{className:"core-document-table__cell","data-align":e3.align??"left",children:t3[n4]??null},n4))},n3))})]})]})}var Hr={locale:"en-CA",currency:"CAD"},Ur=e2=>{if(typeof e2!="string"||!e2)return false;try{return Intl.NumberFormat.supportedLocalesOf(e2).length>0}catch{return false}},Wr=e2=>{if(typeof e2!="string"||!/^[A-Za-z]{3}$/.test(e2))return false;try{return new Intl.NumberFormat("en-CA",{style:"currency",currency:e2}),true}catch{return false}};function Gr(e2){let t2=typeof e2=="object"&&e2?e2:{};return{locale:Ur(t2.locale)?t2.locale:Hr.locale,currency:Wr(t2.currency)?t2.currency.toUpperCase():Hr.currency}}var Kr=new Map;function qr(e2){let t2=`${e2.locale}|${e2.currency}`,n2=Kr.get(t2);if(!n2){let r2=new Intl.NumberFormat(e2.locale,{style:"currency",currency:e2.currency,maximumFractionDigits:0}).formatToParts(1),i2=r2.findIndex(e3=>e3.type==="integer"),a2=r2.length-1-[...r2].reverse().findIndex(e3=>e3.type==="integer");n2={prefix:r2.slice(0,i2).filter(e3=>e3.type!=="minusSign"&&e3.type!=="plusSign").map(e3=>e3.value).join(""),suffix:r2.slice(a2+1).map(e3=>e3.value).join("")},Kr.set(t2,n2)}return n2}function Jr(e2,t2){if(e2==null)return"";if(typeof e2=="string")return e2;let n2=e2.precision??(e2.format==="number"?Yr(e2.value):void 0),r2=Xr(e2.format,e2.value,{precision:n2,signed:e2.signed,locale:t2});return e2.unit&&r2!=="—"?`${r2} ${e2.unit}`:r2}function Yr(e2){if(typeof e2!="number"||!Number.isFinite(e2))return 0;let t2=String(Number(e2.toFixed(3))),n2=t2.indexOf(".");return n2===-1||t2.includes("e")?0:t2.length-n2-1}function Xr(e2,t2,n2={}){if(!Number.isFinite(t2))return"—";let r2=n2.signed===true,i2=t2<0,a2=Math.abs(t2),o2=i2?"-":r2?"+":"",s2=n2.locale??Hr,c2=(e3,t3)=>e3.toLocaleString(s2.locale,{minimumFractionDigits:t3,maximumFractionDigits:t3}),l2=(e3,t3="")=>{let{prefix:n3,suffix:r3}=qr(s2);return`${o2}${n3}${e3}${t3}${r3}`};switch(e2){case"currency":return l2(c2(a2,n2.precision??0));case"currency-k":{let e3=n2.precision??0;return a2>=1e3?l2((a2/1e3).toFixed(e3),"k"):l2(a2.toFixed(0))}case"currency-m":{let e3=n2.precision??1;return a2>=1e6?l2((a2/1e6).toFixed(e3),"M"):a2>=1e3?l2((a2/1e3).toFixed(0),"k"):l2(a2.toFixed(0))}case"currency-compact":return a2>=1e9?l2((a2/1e9).toFixed(n2.precision??1),"B"):a2>=1e6?l2((a2/1e6).toFixed(n2.precision??1),"M"):a2>=1e3?l2((a2/1e3).toFixed(n2.precision??1),"k"):l2(a2.toFixed(n2.precision??0));case"currency-monthly":return`${l2(c2(a2,n2.precision??0))}/mo`;case"percent":{let e3=n2.precision??1;return`${o2}${a2.toFixed(e3)}%`}case"fraction-percent":return`${o2}${new Intl.NumberFormat(s2.locale,{style:"percent",minimumFractionDigits:n2.precision??0,maximumFractionDigits:n2.precision??1}).format(a2)}`;case"age":return`Age ${Math.round(t2)}`;case"years":{let e3=n2.precision??0;return`${o2}${a2.toFixed(e3)} yrs`}case"year":return String(Math.round(t2));case"number":return`${o2}${c2(a2,n2.precision??0)}`;default:{let e3=n2.precision??0;return l2((a2/1e3).toFixed(e3),"k")}}}var Zr=e2=>!!(e2&&typeof e2=="object"&&"value"in e2&&"format"in e2);function Qr({items:e2,profileId:t2,profile:n2,markerWidth:r2=44,secondaryWidth:i2=190,missingLabel:a2="Not answered yet",baseProps:o2,className:s2,style:c2}){if(n2||Z(t2,"RowList"),!Array.isArray(e2)||e2.length===0)return null;let l2=Gr(o2),u2=e3=>Zr(e3)?Jr(e3,l2):e3;return g("div",{className:b("core-row-list",s2),...Q(n2?.id??t2),style:S({"--core-row-list-marker-width":x(r2),"--core-row-list-secondary-width":x(i2)},c2),children:e2.map((e3,t3)=>_("div",{className:"core-row-list__row",children:[e3.marker!==void 0&&g("div",{className:"core-row-list__marker",children:u2(e3.marker)}),g("div",{className:"core-row-list__primary",children:e3.primary}),(e3.secondary!==void 0||e3.missing)&&g("div",{className:"core-row-list__secondary","data-missing":e3.missing?"":void 0,children:e3.missing?a2:u2(e3.secondary)})]},t3))})}var $r=190;function ei({items:e2,profileId:t2,profile:n2,missingLabel:r2="Not answered yet",answerWidth:i2=190,className:a2,style:o2}){let s2=e2.map(e3=>{let t3=typeof e3.answer=="string"&&e3.answer.trim().length>0;return{marker:e3.reference,primary:e3.question,secondary:t3?e3.answer:void 0,missing:!t3}});return g("div",{className:b("core-answer-rows",a2),...Q(n2?.id??t2),style:o2,children:g(Qr,{items:s2,profileId:t2,profile:n2,secondaryWidth:i2,missingLabel:r2})})}var ti=40;function ni({bars:e2,target:t2,targetLabel:n2,max:r2,profileId:i2,profile:a2,baseProps:o2,className:s2,style:c2}){let l2=Gr(o2),u2=a2??Z(i2,"ComparisonBars");if(e2.length===0)return null;let d2=e2.map(e3=>e3.value),f2=r2??Math.max(...d2,t2??0);if(!Number.isFinite(f2)||f2<=0)return we("ComparisonBars:no-scale","[ComparisonBars] every value is zero or negative, so there is no scale to draw against. Rendering nothing rather than a full-width or zero-width bar, either of which reads as a chart and is not one."),null;let p2=t2!==void 0&&t2>0&&t2<=f2?t2/f2*100:void 0;return _("figure",{className:b("core-comparison-bars",s2),...Q(a2?.id??i2),...hr(u2),style:c2,children:[e2.map(e3=>{let t3=Math.max(0,Math.min(100,e3.value/f2*100));return _("div",{className:"core-comparison-bars__bar",style:S({"--core-comparison-bars-value":`${t3}%`}),children:[g("div",{className:"core-comparison-bars__label",children:e3.label}),_("div",{className:"core-comparison-bars__track",style:S({"--core-comparison-bars-target":p2===void 0?void 0:`${p2}%`}),children:[g("div",{className:"core-comparison-bars__fill"}),g("span",{className:"core-comparison-bars__value","data-placement":t3>ti?"inside":"outside",children:Jr(e3.display,l2)}),p2!==void 0&&g("div",{className:"core-comparison-bars__target","aria-hidden":"true"})]})]},e3.label)}),t2!==void 0&&n2&&g("figcaption",{className:"core-comparison-bars__target-label",children:n2})]})}var ri=3,ii=5;function ai({items:e2,profileId:t2,profile:n2,checkboxes:r2=true,className:i2,style:a2}){return n2||Z(t2,"NextSteps"),e2.length===0?null:((e2.length<ri||e2.length>ii)&&we(`NextSteps:count:${e2.length}`,`[NextSteps] ${e2.length} step(s). A next-steps list takes three to five: fewer reads as an afterthought, more stops being a list a reader acts on this week. Rendering anyway — a document with six steps is far better than one with none.`),g("ol",{className:b("core-next-steps",i2),...Q(n2?.id??t2),style:a2,children:e2.map((e3,t3)=>_("li",{className:"core-next-steps__step",children:[g("span",{className:"core-next-steps__marker",children:e3.marker??String(t3+1).padStart(2,"0")}),r2&&g("span",{className:"core-next-steps__box","aria-hidden":"true"}),g("span",{className:"core-next-steps__body",children:e3.body})]},t3))}))}var oi=38;function si({title:e2="Notes",lines:t2=4,profileId:n2,profile:r2,className:i2,style:a2}){return r2||Z(n2,"Notes"),t2<1?null:_("section",{className:b("core-notes",i2),...Q(r2?.id??n2),style:a2,children:[g("div",{className:"core-notes__title",children:e2}),g("div",{className:"core-notes__lines","aria-hidden":"true",children:Array.from({length:t2},(e3,t3)=>g("div",{className:"core-notes__line"},t3))})]})}var ci="You left this section open, so it is not covered here.";function li({wouldTell:e2,openingLine:t2=ci,profileId:n2,profile:r2,className:i2,style:a2}){return r2||Z(n2,"SkippedSection"),_("div",{className:b("core-skipped-section",i2),...Q(r2?.id??n2),style:a2,children:[g("span",{className:"core-skipped-section__standard",children:t2})," ",g("span",{className:"core-skipped-section__would-tell",children:e2})]})}var ui="Nothing here is settled. If a number looks wrong, or a step does not fit your situation, say so and we will work through it together.";function di({advisor:e2,title:t2="Talk it through",invitation:n2=ui,profileId:r2,profile:i2,className:a2,style:o2}){if(i2||Z(r2,"TalkItThrough"),!e2?.name?.trim())return we("TalkItThrough:no-advisor","[TalkItThrough] no advisor name — rendering NOTHING rather than an empty box. This section is mandatory in an approved output because it is the door to a human; a door with nobody behind it passes a structural check and fails the reader."),null;let s2=[e2.phone,e2.email].filter(e3=>typeof e3=="string"&&e3.trim().length>0);return s2.length===0&&we("TalkItThrough:no-contact",`[TalkItThrough] "${e2.name}" has no phone and no email. The section is the advisor's name, HOW TO REACH THEM, and an open invitation — a name alone is not a route. Rendering, because a named advisor is still better than a dropped section.`),_("section",{className:b("core-talk-it-through",a2),...Q(i2?.id??r2),style:o2,children:[g("h3",{className:"core-talk-it-through__title",children:t2}),g("p",{className:"core-talk-it-through__invitation",children:n2}),_("div",{className:"core-talk-it-through__advisor",children:[g("div",{className:"core-talk-it-through__name",children:e2.name}),e2.role&&g("div",{className:"core-talk-it-through__role",children:e2.role}),s2.length>0&&g("div",{className:"core-talk-it-through__contact",children:s2.map(e3=>g("span",{children:e3},e3))})]})]})}var fi=38;function pi({question:e2,answer:t2,lines:n2=1,profileId:r2,profile:i2,className:a2,style:o2}){i2||Z(r2,"WriteInField");let s2=typeof t2=="string"&&t2.trim().length>0,c2=Math.max(1,n2);return _("div",{className:b("core-write-in-field",a2),"data-answered":s2?"":void 0,...Q(i2?.id??r2),style:o2,children:[e2&&g("div",{className:"core-write-in-field__question",children:e2}),s2?g("div",{className:"core-write-in-field__answer",children:t2}):Array.from({length:c2},(e3,t3)=>g("div",{className:"core-write-in-field__line","aria-hidden":"true"},t3))]})}function mi({mark:e2,identity:t2,codes:n2,profileId:r2,profile:i2,className:a2,style:o2}){return i2||Z(r2,"Masthead"),e2===void 0&&t2===void 0&&n2===void 0?null:_("header",{className:b("core-masthead",a2),"data-page-region":"page-header",...Q(i2?.id??r2),style:o2,children:[e2!==void 0&&g("div",{className:"core-masthead__mark","data-slot":"mark",children:e2}),t2!==void 0&&g("div",{className:"core-masthead__identity","data-slot":"identity",children:t2}),n2!==void 0&&g("div",{className:"core-masthead__codes","data-slot":"codes",children:n2})]})}var hi=4;function gi({fields:e2,profileId:t2,profile:n2,className:r2,style:i2}){let a2=(n2??Z(t2,"MetaRail"))?.rail.placement??"strip";return a2==="none"||e2.length===0?null:(a2!=="column"&&e2.length>hi&&typeof console<"u"&&console.warn(`[MetaRail] ${e2.length} fields in a strip; the spec allows ${hi}. Rendering all of them — check the layout.`),g("div",{className:b("core-meta-rail",r2),"data-placement":a2,...Q(n2?.id??t2),style:i2,children:e2.map(e3=>_("div",{className:"core-meta-rail__field",children:[g("div",{className:"core-meta-rail__label",children:e3.label}),g("div",{className:"core-meta-rail__value",children:e3.value})]},`${e3.label}:${e3.value}`))}))}var _i={left:"bottom-left",centre:"bottom-center",right:"bottom-right"};function vi({left:e2,centre:t2,right:n2,profileId:r2,profile:i2,className:a2,style:o2}){i2||Z(r2,"RunningFooter");let s2=[["left",e2],["centre",t2],["right",n2]].filter(([,e3])=>e3!=null);return s2.length===0?null:g("footer",{className:b("core-running-footer",a2),"data-page-region":"page-footer",...Q(i2?.id??r2),style:o2,children:s2.map(([e3,t3])=>g("span",{className:"core-running-footer__slot","data-region-slot":e3,"data-margin-box":_i[e3],children:t3},e3))})}function yi({children:e2,rail:t2,profileId:n2,profile:r2,className:i2,style:a2}){let o2=r2??Z(n2,"DocumentShell"),s2=o2?.rail.placement==="column"&&t2!==void 0;return g(Ar,{children:_("div",{className:b("core-document-shell",i2),...Q(o2?.id??n2),"data-has-rail":s2?"":void 0,style:a2,children:[g("div",{className:"core-document-shell__body",children:e2}),s2&&_(h,{children:[g("div",{className:"core-document-shell__gutter","aria-hidden":true}),g("aside",{className:"core-document-shell__rail",children:t2})]})]})})}function bi(e2,t2){return!e2||e2.length===0?null:t2===0?String(e2[0]).padStart(2,"0"):e2.join(".")}function xi({entries:e2,depth:t2,title:n2,profileId:r2,profile:i2,className:a2,style:o2}){let s2=i2??Z(r2,"Contents"),c2=s2?.depth.max??Infinity,l2=e2??[],u2=t2===void 0?l2:l2.filter(e3=>e3.level<t2);if(u2.length===0)return null;let d2=s2?.depth.numbering??"none",f2=u2.some(e3=>e3.page!==void 0);return _("nav",{"aria-label":"Table of contents",className:b("core-contents",a2),...Q(i2?.id??r2),style:o2,children:[n2&&g("div",{className:"core-contents__title",children:n2}),g("ol",{className:"core-contents__list",children:u2.map(e3=>{let t3=d2==="none"?null:bi(e3.ordinal,e3.level);return _("li",{className:"core-contents__entry","data-level":e3.level,"data-overdeep":e3.level>=c2?"":void 0,style:S({"--core-contents-level":String(e3.level)}),children:[t3&&g("span",{className:"core-contents__ordinal",children:t3}),g("a",{href:`#${e3.id}`,className:"core-contents__link",children:e3.title}),f2&&g("span",{className:"core-contents__page",children:e3.page??""})]},e3.id)})})]})}function Si({s:e2,dated:t2}){return _("div",{className:"core-execution-block__signature",children:[_("div",{className:"core-execution-block__lines",children:[g("div",{className:"core-execution-block__line","data-line":"sign"}),t2?g("div",{className:"core-execution-block__line","data-line":"date"}):null]}),_("div",{className:"core-execution-block__captions",children:[_("div",{className:"core-execution-block__party",children:[e2.role?g("div",{className:"core-execution-block__role",children:e2.role}):null,e2.name?g("div",{className:"core-execution-block__name",children:e2.name}):null,e2.detail?g("div",{className:"core-execution-block__detail",children:e2.detail}):null]}),t2?g("div",{className:"core-execution-block__date-label",children:"Date"}):null]})]})}function Ci({attestation:e2,label:t2,signatories:n2,columns:r2=1,note:i2,profileId:a2,profile:o2,className:s2,style:c2}){o2||Z(a2,"ExecutionBlock");let l2=Array.isArray(n2)?n2:[];return _("section",{className:b("core-execution-block",s2),...Q(o2?.id??a2),style:c2,children:[t2?g("div",{className:"core-execution-block__label",children:t2}):null,e2?g("div",{className:"core-execution-block__attestation",children:e2}):null,g("div",{className:"core-execution-block__signatories","data-columns":r2,children:l2.map((e3,t3)=>g(Si,{s:e3,dated:e3.dated===true},t3))}),i2?g("div",{className:"core-execution-block__note",children:i2}):null]})}function wi({kind:e2}){return _("div",{className:"core-document-blocks__unrenderable","data-unrenderable-block":e2,role:"alert",children:[g("strong",{children:"This provision could not be rendered."})," The document contains a block of type “",e2,"”, which this bundle has no renderer for. Nothing has been omitted silently — the content is present in the source document and is missing only from this page. Do not sign or rely on this document until it renders in full."]})}function Ti({blocks:e2,profileId:t2,sectionNumbers:n2,sectionAnchors:r2,sectionTitles:i2,sectionReferences:a2,sectionOrdinal:o2,className:s2,style:c2}){let l2=Z(t2,"DocumentBlocks");if(e2.length===0)return null;let u2=Rr(o2,e2.flatMap(e3=>e3.kind==="clause"?e3.items:[]),l2?.depth.numbering),d2=0,f2=(e3,o3)=>mr(e3)?pr(e3).map((e4,s3)=>e4.kind==="text"?e4.text:g(Br,{target:e4.key,form:e4.form,sectionReferences:a2,sectionNumbers:n2,sectionTitles:i2,sectionAnchors:r2,profileId:t2},`${o3}-ref-${s3}`)):e3,p2=e2.some(e3=>e3.kind==="execution");return g("div",{className:b("core-document-blocks",s2),"data-pinned":p2?"execution":void 0,...Q(t2),style:c2,children:e2.map((e3,n3)=>{let r3=`${e3.kind}-${n3}`;switch(e3.kind){case"prose":return g(vr,{profileId:t2,full:e3.full,children:f2(e3.text,r3)},r3);case"clause":return g(Qr,{profileId:t2,items:e3.items.map((e4,t3)=>({marker:u2[d2++],primary:f2(e4.text,`${r3}-${t3}`),secondary:e4.note?f2(e4.note,`${r3}-${t3}-n`):void 0,missing:e4.missing}))},r3);case"definitions":return g(br,{profileId:t2,pairs:e3.pairs.map((e4,t3)=>({term:e4.term,description:f2(e4.description,`${r3}-${t3}`)}))},r3);case"table":return g(Vr,{profileId:t2,caption:e3.caption?f2(e3.caption,`${r3}-cap`):void 0,columns:e3.columns,rows:e3.rows.map((e4,t3)=>e4.map((e5,n4)=>f2(e5,`${r3}-${t3}-${n4}`)))},r3);case"notice":return g(_r,{profileId:t2,tone:e3.tone,title:e3.title,children:f2(e3.text,r3)},r3);case"figure":return g(Mr,{profileId:t2,caption:f2(e3.caption,r3),children:e3.placeholder??null},r3);case"execution":return g(Ci,{profileId:t2,label:e3.label,attestation:e3.attestation,signatories:e3.signatories,columns:e3.columns,note:e3.note},r3);default:return g(wi,{kind:String(e3.kind)},r3)}})})}var Ei=["h2","h3","h4","h5","h6"];function Di({sectionId:e2,title:t2,level:n2=0,ordinal:r2,sectionNumbers:i2,sectionAnchors:a2,sectionTitles:o2,sectionReferences:s2,sectionLevels:c2,continued:l2=false,continuedCount:u2,children:d2,blocks:f2,profileId:p2,profile:m2,className:h2,style:v2}){let y2=m2??Z(p2,"DocumentSection"),x2=i2?.[e2],C2=c2?.[e2],w2=x2??r2,T2=C2===void 0?n2:Math.max(0,C2-1),E2=T2>=(y2?.depth.max??Infinity),D2=Math.min(T2,(y2?.depth.indent.length??1)-1)+1,O2=y2?.depth.numbering==="ladder"&&w2!==void 0&&w2.length>0,k2=O2?Ir(w2):null,A2=Ei[Math.min(T2,Ei.length-1)],j2=zr(a2,e2),M2=`${j2}-doc-heading`;return _("section",{id:j2,className:b("core-document-section",h2),"data-level":T2,"data-ordinal-source":w2?x2?"derived":"baked":void 0,"data-overdeep":E2?"":void 0,"aria-labelledby":M2,...Q(m2?.id??p2),style:S({"--core-document-section-indent":`var(--doc-indent-${D2}, 0)`},v2),children:[k2&&g("div",{className:"core-document-section__article",children:k2}),_(A2,{id:M2,className:"core-document-section__heading",children:[O2&&!k2&&g("span",{className:"core-document-section__ordinal",children:w2.join(".")}),t2,l2&&g("span",{className:"core-document-section__continued",children:"continued"})]}),l2&&u2&&g("div",{className:"core-document-section__count",children:`Items ${u2.from} to ${u2.to} of ${u2.of}`}),g("div",{className:"core-document-section__body",children:d2??(f2?g(Ti,{blocks:f2,profileId:p2,sectionNumbers:i2,sectionAnchors:a2,sectionTitles:o2,sectionReferences:s2,sectionOrdinal:O2?w2:void 0}):null)})]})}var Oi={prose:{type:"object",required:["kind","text"],additionalProperties:false,properties:{kind:{const:"prose"},text:{type:"string",description:"ONE paragraph. Two paragraphs in one value run together on the page: emit a second prose block instead."},full:{type:"boolean",description:"Fill the measure rather than the reading-width cap. For a caption or text beside a table."}}},clause:{type:"object",required:["kind","items"],additionalProperties:false,properties:{kind:{const:"clause"},items:{type:"array",minItems:1,items:{type:"object",required:["text"],additionalProperties:false,properties:{marker:{type:"string",description:'An explicit number that overrides the derived one, only for numbering fixed by statute or a standard form. Omit it and the renderer numbers the clause from its article ("6.3").'},level:{type:"integer",minimum:1,description:"Depth within the section: 1 a clause, 2 a sub-clause, 3 a sub-sub-clause. Default 1."},id:{type:"string",pattern:"^[a-z0-9][a-z0-9_-]*$",description:"A slug, unique in the document, written only when prose cites this clause as {{ref:<section>#<id>}}. Keep it stable across edits."},text:{type:"string"},note:{type:"string",description:"A parenthetical, cross-reference or jurisdictional note set beside the text."},missing:{type:"boolean",description:"The value is not yet known. Use this instead of writing a [REQUIRED: ...] marker into the text."}}}}}},definitions:{type:"object",required:["kind","pairs"],additionalProperties:false,properties:{kind:{const:"definitions"},pairs:{type:"array",minItems:1,items:{type:"object",required:["term","description"],additionalProperties:false,properties:{term:{type:"string"},description:{type:"string"}}}}}},table:{type:"object",required:["kind","columns","rows"],additionalProperties:false,properties:{kind:{const:"table"},caption:{type:"string"},columns:{type:"array",minItems:1,items:{type:"object",required:["header"],additionalProperties:false,properties:{header:{type:"string"},align:{enum:["left","right","center"],description:"Right-align money and any other figure column."}}}},rows:{type:"array",items:{type:"array",items:{type:"string"}},description:"One array per row, each EXACTLY as long as columns. A short row is refused: a table that loses its last column loses data."}}},notice:{type:"object",required:["kind","tone","text"],additionalProperties:false,properties:{kind:{const:"notice"},tone:{enum:["note","warning","important"]},title:{type:"string"},text:{type:"string"}}},figure:{type:"object",required:["kind","caption"],additionalProperties:false,properties:{kind:{const:"figure"},caption:{type:"string",description:"Required. An uncaptioned exhibit cannot be cited from the text that relies on it."},src:{type:"string",description:"Reference the host resolves. Never a data URI."},placeholder:{type:"string",description:"Text stand-in when src is absent, so a figure never renders empty."}}},execution:{type:"object",required:["kind","signatories"],additionalProperties:false,properties:{kind:{const:"execution"},label:{type:"string"},attestation:{type:"string",description:"The attestation clause, as running text."},signatories:{type:"array",minItems:1,items:{type:"object",required:["role"],additionalProperties:false,properties:{role:{type:"string",description:'Capacity: "Testator", "Witness", "Grantor".'},name:{type:"string",description:"Printed BELOW the signing rule, never on it."},detail:{type:"string"},dated:{type:"boolean",description:"Add a second, shorter rule for the date."}}}},columns:{enum:[1,2]},note:{type:"string"}}}},ki=["md","lg","xl"],Ai=5;function ji(e2){let t2=ki.indexOf(e2);return t2>0?ki[t2-1]:e2}var Mi=e2=>typeof e2=="object"&&!!e2&&"format"in e2&&"value"in e2;function Ni(e2){let t2=Number(e2);return Number.isFinite(t2)?Math.max(0,Math.min(100,t2)):0}function Pi({value:e2,label:t2,size:n2="lg",tone:r2,progress:i2,progressLabel:a2,autoStepDown:o2=true,baseProps:s2,className:c2,style:l2}){let u2=Mi(e2)?Jr(e2,Gr(s2)):e2,d2=typeof u2=="string"||typeof u2=="number"?String(u2).length:0,f2=o2&&d2>Ai?ji(n2):n2,p2=nt(r2,"strong"),{toned:m2,...h2}=rt(p2),v2=i2==null?null:Ni(i2);return _("div",{className:b("core-stat",m2&&"core-toned",c2),...h2,"data-size":f2,style:l2,children:[g("div",{className:"core-stat__value",children:u2}),t2!=null&&g(it,{className:"core-stat__label",tone:p2==="on-dark"||p2==="inherit"?p2:"subtle",children:t2}),v2!==null&&g("div",{className:"core-stat__progress",role:"progressbar","aria-label":a2??(typeof t2=="string"?t2:"Progress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":v2,style:S({"--core-stat-progress":`${v2}%`}),children:g("div",{className:"core-stat__progress-fill"})})]})}function Fi({children:e2,minColumnWidth:t2=200,maxColumns:n2=4,gap:r2=32,className:i2,style:a2}){return g("div",{className:b("core-stat-group",i2),style:S({"--core-stat-group-min":`${t2}px`,"--core-stat-group-max":String(Math.max(1,n2)),"--core-stat-group-gap":`${r2}px`},a2),children:e2})}var Ii={up:[0,28],left:[-40,0],right:[40,0],none:[0,0]};function Li({direction:e2="up",delay:t2=0,duration:n2=.5,threshold:r2=.15,once:i2=true,className:a2,style:o2,children:c2}){let l2=f(null),[u2,d2]=p(false);s(()=>{let e3=l2.current;if(!e3)return;if(typeof IntersectionObserver>"u"){d2(true);return}let t3=new IntersectionObserver(e4=>{let n3=e4[e4.length-1];n3&&(n3.isIntersecting?(d2(true),i2&&t3.disconnect()):i2||d2(false))},{threshold:Math.min(1,Math.max(0,r2))});return t3.observe(e3),()=>t3.disconnect()},[i2,r2]);let[m2,h2]=Ii[e2];return g("div",{ref:l2,className:b("core-reveal",a2),"data-revealed":u2?"true":"false",style:S({"--core-reveal-x":`${m2}px`,"--core-reveal-y":`${h2}px`,"--core-reveal-duration":`${n2}s`,"--core-reveal-delay":`${t2}s`},o2),children:c2})}function Ri({eyebrow:e2,title:t2,description:n2,trailing:r2,level:i2=2,revealDelay:a2=0,className:o2,style:s2}){let c2=i2===3,l2=c2?"h3":"h2";return g(Li,{direction:"up",delay:a2,className:b("core-section-header",o2),style:s2,children:_("div",{className:"core-section-header__inner","data-described":n2?"true":void 0,"data-level":c2?"3":void 0,children:[_("div",{className:"core-section-header__text",children:[e2?g(it,{className:"core-section-header__eyebrow",children:e2}):null,g(l2,{className:"core-section-header__title",children:t2}),n2?g("p",{className:"core-section-header__description",children:n2}):null]}),r2!=null&&r2!==""?g("div",{className:"core-section-header__trailing",children:r2}):null]})})}function zi({tone:e2,label:t2,headline:n2,children:r2,trailing:i2,className:a2,style:o2}){let s2=et(e2,"accent"),c2=i2!=null&&i2!=="";return _("div",{className:b("core-highlight-box","core-toned",a2),"data-tone":s2,style:o2,children:[_("div",{className:"core-highlight-box__text",children:[t2?g("div",{className:"core-highlight-box__label",children:t2}):null,n2?g("div",{className:"core-highlight-box__headline",children:n2}):null,r2!=null&&r2!==""?g("div",{className:"core-highlight-box__body",children:r2}):null]}),c2?g("div",{className:"core-highlight-box__trailing",children:i2}):null]})}var Bi=60,Vi=400,Hi=12,Ui=(e2,t2)=>{if(typeof e2!="string")return"";let n2=e2.replace(/\s+/g," ").trim();return n2.length>t2?`${n2.slice(0,t2-1)}…`:n2},Wi=e2=>typeof e2=="string"&&/^\/(?![/\\])[^\s\u0000-\u001f]*$/.test(e2)?e2:null,Gi=e2=>typeof e2=="number"&&Number.isFinite(e2)&&e2>0?Math.round(e2):void 0;function Ki({name:e2,description:t2,takes:n2,sketch:r2,className:i2,style:a2}){let o2=Ui(e2,Bi);if(!o2)return null;let s2=Ui(t2,Vi),c2=(Array.isArray(n2)?n2:[]).map(e3=>({name:Ui(e3?.name,Bi),type:Ui(e3?.type,60),note:Ui(e3?.note,160)})).filter(e3=>e3.name).slice(0,Hi),l2=Wi(r2?.src),u2=Gi(r2?.w),d2=Gi(r2?.h);return _("section",{className:b("core-proposed-component",i2),style:a2,"aria-label":`Proposed component: ${o2}`,children:[g("p",{className:"core-proposed-component__mark",children:"Proposed"}),g("h3",{className:"core-proposed-component__name",children:o2}),s2?g("p",{className:"core-proposed-component__description",children:s2}):null,l2?g("img",{className:"core-proposed-component__sketch",src:l2,alt:Ui(r2?.alt,160),loading:"lazy",...u2&&d2?{width:u2,height:d2}:{}}):null,c2.length?_("div",{className:"core-proposed-component__takes",children:[g("p",{className:"core-proposed-component__heading",children:"Would take"}),g("ul",{children:c2.map(e3=>_("li",{children:[g("code",{children:e3.name}),e3.type?g("span",{className:"core-proposed-component__type",children:e3.type}):null,e3.note?g("span",{className:"core-proposed-component__note",children:e3.note}):null]},e3.name))})]}):null]})}function qi({label:e2,children:t2,className:n2,style:r2}){return _("div",{className:b("core-disclaimer-block",n2),style:r2,children:[e2?_(h,{children:[g("strong",{className:"core-disclaimer-block__label",children:e2})," "]}):null,t2]})}function Ji(e2){let t2=Number(e2);return Number.isFinite(t2)?Math.max(0,Math.min(100,t2)):0}function Yi({label:e2,value:t2,fillPercent:n2,subtitle:r2,tone:i2,baseProps:a2,className:o2,style:s2}){let c2=Gr(a2),l2=Ji(n2);return _("div",{className:b("core-stat-strip","core-toned",o2),"data-tone":et(i2,"info"),style:S({"--core-stat-strip-fill":`${l2}%`},s2),children:[_("div",{className:"core-stat-strip__row",children:[g("span",{className:"core-stat-strip__label",children:e2}),g("span",{className:"core-stat-strip__value",children:Jr(t2,c2)})]}),g("div",{className:"core-stat-strip__track",children:g("div",{className:"core-stat-strip__fill"})}),r2?g("div",{className:"core-stat-strip__subtitle",children:Jr(r2,c2)}):null]})}function Xi({text:e2,tone:t2,locale:n2,className:r2}){return g("span",{className:b("core-value-badge","core-toned",r2),"data-tone":et(t2),children:Jr(e2,n2)})}var Zi=8,Qi={good:"success",warn:"warning",critical:"danger"};function $i(e2,t2,n2){let r2={series:String(n2%Zi+1)},i2=e2??t2;if(typeof i2!="string"||i2==="")return r2;if(i2==="muted")return{series:"muted"};let a2=/^series-([1-9]\d*)$/.exec(i2);if(a2)return{series:String((Number(a2[1])-1)%Zi+1)};let o2=Qi[i2];return o2?{tone:o2}:Qe.includes(i2)?{tone:i2}:(we("OptionCard:colour",`[OptionCard] bar fill "${i2}" is not a tone or a series slot; using the chart series by position. Name a tone (success, danger, …) or a slot (series-1…series-8).`),r2)}function ea(e2){return typeof e2=="number"&&Number.isFinite(e2)?{text:String(e2).padStart(2,"0"),kind:"numeral"}:typeof e2!="string"||e2.trim()===""?null:/^\d+$/.test(e2.trim())?{text:e2.trim().padStart(2,"0"),kind:"numeral"}:{text:e2,kind:"label"}}function ta(e2){let{number:t2,title:n2,description:r2,badgeText:i2,badgeTone:a2,bars:o2,tone:s2,isSelected:c2=false,className:l2,style:u2}=e2,d2=Gr(e2.baseProps),f2=Array.isArray(o2)?o2:[],p2=ea(t2);return _("div",{className:b("core-option-card",l2),"data-selected":c2?"true":void 0,"data-described":r2?"true":void 0,style:u2,children:[_("div",{className:"core-option-card__head",children:[p2?g("div",{className:"core-option-card__number","data-kind":p2.kind,children:p2.text}):g("span",{}),i2!=null&&i2!==""?g(Xi,{text:i2,tone:et(a2),locale:d2}):null]}),n2?g("div",{className:"core-option-card__title",children:n2}):null,r2?g("p",{className:"core-option-card__description",children:r2}):null,f2.map((e3,t3)=>{let n3=$i(e3.tone,s2,t3),r3=Math.min(100,Math.max(0,Number(e3.fillPercent)||0)),i3=e3.valueTone===void 0||e3.valueTone==="default"?void 0:et(e3.valueTone);return _("div",{className:"core-option-card__bar",children:[_("div",{className:"core-option-card__bar-head",children:[g("span",{className:"core-option-card__bar-label",children:e3.label}),g("span",{className:b("core-option-card__bar-value",i3&&"core-toned"),"data-tone":i3,children:Jr(e3.value,d2)})]}),g("div",{className:"core-option-card__track",children:g("div",{className:b("core-option-card__fill","tone"in n3&&"core-toned"),"data-tone":"tone"in n3?n3.tone:void 0,"data-series":"series"in n3?n3.series:void 0,style:S({"--core-option-card-fill":`${r3}%`})})})]},t3)})]})}function na(e2){let{title:t2,subtitle:n2,rows:r2,className:i2,style:a2}=e2,o2=Gr(e2.baseProps),s2=e2.tone??"info",c2=s2==="none",l2=Array.isArray(r2)?r2:[];return _("div",{className:b("core-profile-card",!c2&&"core-toned",i2),"data-tone":c2?void 0:et(s2,"info"),"data-marker":c2?"none":void 0,style:a2,children:[_("div",{className:"core-profile-card__head",children:[g("div",{className:"core-profile-card__title",children:t2}),n2?g("div",{className:"core-profile-card__subtitle",children:n2}):null]}),l2.map((e3,t3)=>_("div",{className:"core-profile-card__row",children:[g("span",{className:"core-profile-card__label",children:e3.label}),_("div",{className:"core-profile-card__end",children:[g("span",{className:"core-profile-card__value",children:Jr(e3.value,o2)}),e3.badge?g(Xi,{text:e3.badge.text,tone:et(e3.badge.tone),locale:o2}):null]})]},t3))]})}function ra(e2){if(typeof e2=="string"){let t2=e2.trim();return t2.startsWith("+")?"up":t2.startsWith("-")||t2.startsWith("−")?"down":"flat"}return e2&&typeof e2=="object"&&typeof e2.value=="number"?e2.value>0?"up":e2.value<0?"down":"flat":"flat"}var ia={up:"▲",down:"▼",flat:"—"},aa={up:"success",down:"danger",flat:void 0},oa=e2=>e2!=null&&e2!=="";function sa(e2){let{columns:t2=4,gap:n2="tight",minColumnWidth:r2,className:i2,style:a2}=e2,o2=Gr(e2.baseProps),s2=Array.isArray(e2.cards)?e2.cards:[],c2=Math.max(1,Math.min(6,Math.round(Number(t2))||4));return g("div",{className:b("core-kpi-card-grid",i2),"data-gap":n2==="normal"?"normal":"tight",style:S({"--core-kpi-card-grid-columns":String(c2),"--core-kpi-card-grid-min":typeof r2=="number"&&r2>0?`${r2}px`:void 0},a2),children:s2.map((e3,t3)=>{let{subtitle:n3,badge:r3}=e3,i3=oa(e3.tone)?et(e3.tone):void 0,a3=oa(e3.delta)?ra(e3.delta):void 0,s3=a3?aa[a3]:void 0;return g(Li,{direction:"up",className:"core-kpi-card-grid__item",children:_("div",{className:b("core-kpi-card-grid__card",i3&&"core-toned"),"data-tone":i3,children:[_("div",{className:"core-kpi-card-grid__head",children:[g("div",{className:"core-kpi-card-grid__label",children:e3.label}),r3&&oa(r3.text)?g(Xi,{text:r3.text,tone:et(r3.tone),locale:o2}):null]}),g("div",{className:"core-kpi-card-grid__value",children:Jr(e3.value,o2)}),a3?_("div",{className:b("core-kpi-card-grid__delta",s3&&"core-toned"),"data-tone":s3,"data-direction":a3,children:[g("span",{"aria-hidden":"true",children:ia[a3]})," ",Jr(e3.delta,o2)]}):null,oa(n3)?g("div",{className:"core-kpi-card-grid__subtitle",children:Jr(n3,o2)}):null]})},t3)})})}var ca=new Set(["http:","https:","mailto:","tel:"]);function la(e2){let t2=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e2.replace(/[\u0000- ]/g,""));return t2?`${t2[1].toLowerCase()}:`:null}function ua(e2){if(typeof e2!="string"||!e2.trim())return null;let t2=la(e2.trim());return t2===null||ca.has(t2)?e2.trim():(we(`unsafe-href:${t2}`,`Refused a link with the "${t2}" scheme; links are relative, http(s):, mailto: or tel:`),null)}function da(e2){if(typeof e2!="string"||!e2.trim())return null;let t2=e2.trim(),n2=la(t2);return n2===null||n2==="https:"||n2==="data:"&&/^data:image\//i.test(t2.replace(/[\u0000- ]/g,""))?t2:(we(`unsafe-src:${n2}`,`Refused an image with the "${n2}" scheme; images are relative, https: or data:image/`),null)}var fa=["title","meta","badge","value"];function pa(e2){if(typeof e2=="string"&&e2!==""&&e2!=="default")return et(e2)}var ma=e2=>!!(e2&&typeof e2=="object"&&"value"in e2&&"format"in e2),ha=e2=>!!(e2&&typeof e2=="object"&&!Array.isArray(e2)&&!i(e2)&&"value"in e2&&!("format"in e2));function ga(e2){return ha(e2)?e2:{value:e2}}var _a=/^\d{4}-\d{2}-\d{2}$/,va=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?)?$/;function ya(e2,t2,n2){if(!va.test(e2))return e2;let r2=_a.test(e2),i2=new Date(r2?`${e2}T00:00:00Z`:e2.replace(" ","T"));return Number.isNaN(i2.getTime())?e2:i2.toLocaleString(n2,{year:"numeric",month:"short",day:"numeric",...t2==="datetime"&&!r2?{hour:"numeric",minute:"2-digit"}:{},...r2?{timeZone:"UTC"}:{}})}function ba(e2){if(!/^[a-z][a-z0-9]*([_-][a-z0-9]+)+$/.test(e2))return e2;let t2=e2.replace(/[_-]+/g," ");return t2[0].toUpperCase()+t2.slice(1)}var xa=new Set(["currency","currency-k","currency-m","currency-compact","currency-monthly","percent","fraction-percent","age","years","year","number"]),Sa={fraction:"fraction-percent"};function Ca(e2,t2,n2,r2){if(t2==="unit"){let t3=typeof n2=="string"?n2.trim():"",i2=Sa[t3]??(xa.has(t3)?t3:void 0);return Jr(i2?{value:e2,format:i2}:{value:e2,format:"number",...t3?{unit:t3}:{}},r2)}return t2&&xa.has(t2)?Xr(t2,e2,{locale:r2}):String(e2)}function wa(e2,t2,n2,r2){return typeof e2=="string"&&t2==="raw"?e2:typeof e2=="string"&&(t2==="date"||t2==="datetime")?ya(e2,t2,r2.locale):typeof e2=="string"?Jr(ba(e2),r2):ma(e2)?Jr(e2,r2):typeof e2=="number"?Ca(e2,t2,n2,r2):i(e2)?e2:null}function Ta({title:e2,subtitle:t2,columns:n2,rows:r2,baseProps:i2,rowHeadingLevel:a2,actionsWidth:o2,className:s2,style:l2}){let u2=Gr(i2),d2=`${c()}-title`,f2=Array.isArray(n2)?n2:[],p2=Array.isArray(r2)?r2:[],m2=e3=>f2[e3]?.align??(e3===0?"left":"right"),h2=e3=>{let t3=e3.cells;return Array.isArray(t3)?t3:t3&&typeof t3=="object"?f2.map(e4=>t3[e4.key]):[]},v2=e3=>e3&&fa.includes(e3.role)?e3.role:void 0;return f2.some(e3=>v2(e3))?g(Oa,{title:e2,subtitle:t2,titleId:d2,safeColumns:f2,safeRows:p2,loc:u2,rowHeadingLevel:a2,actionsWidth:o2,className:s2,style:l2,cellsOf:h2,roleOf:v2}):g(Li,{direction:"up",children:_("div",{className:b("core-data-table",s2),style:l2,children:[e2||t2?_("div",{className:"core-data-table__head",children:[e2?g("div",{id:d2,className:"core-data-table__title",children:e2}):null,t2?g("div",{className:"core-data-table__subtitle",children:t2}):null]}):null,g("div",{className:"core-data-table__scroll",role:"region","aria-label":e2?void 0:"Data table, scrollable","aria-labelledby":e2?d2:void 0,tabIndex:0,children:_("table",{className:"core-data-table__table",children:[g("thead",{children:g("tr",{children:f2.map((e3,t3)=>_("th",{scope:"col",className:"core-data-table__col","data-align":m2(t3),style:S({"--core-data-table-min":typeof e3.minWidth=="number"&&e3.minWidth>0?`${e3.minWidth}px`:void 0}),children:[e3.header,e3.sublabel?g("span",{className:"core-data-table__sublabel",children:e3.sublabel}):null]},t3))})}),g("tbody",{children:p2.map((e3,t3)=>{let{highlighted:n3,total:r3}=e3,i3=h2(e3);return g("tr",{className:"core-data-table__row","data-highlighted":n3?"true":void 0,"data-total":r3?"true":void 0,children:i3.map((t4,n4)=>{let r4=ga(t4),i4=pa(r4.tone),a3={className:b("core-data-table__cell",i4&&"core-toned"),"data-align":m2(n4),"data-tone":i4};return n4===0?g("th",{scope:"row",...a3,children:wa(r4.value,f2[n4]?.format,e3.unit,u2)},n4):g("td",{...a3,children:wa(r4.value,f2[n4]?.format,e3.unit,u2)},n4)})},t3)})})]})})]})})}var Ea=e2=>e2!=null&&e2!==false&&e2!=="",Da=e2=>typeof e2=="number"&&Number.isInteger(e2)&&e2>=2&&e2<=6?e2:void 0;function Oa({title:e2,subtitle:n2,titleId:r2,safeColumns:i2,safeRows:a2,loc:o2,rowHeadingLevel:s2,actionsWidth:c2,className:l2,style:u2,cellsOf:d2,roleOf:f2}){let p2=i2.map(e3=>f2(e3)),m2=Math.max(0,p2.indexOf("title")),v2=p2.findIndex((e3,t2)=>e3==="badge"&&t2!==m2),y2=p2.findIndex((e3,t2)=>e3==="value"&&t2!==m2),x2=i2.map((e3,t2)=>t2).filter(e3=>e3!==m2&&e3!==v2&&e3!==y2),S2=i2.some(e3=>Ea(e3.header)),C2=e2?{"aria-labelledby":r2}:{"aria-label":"Data table"},w2=Da(s2),T2=a2.some(e3=>Ea(e3.actions)),E2=typeof c2=="number"&&c2>0?c2:6,D2=i2.reduce((e3,t2)=>e3+(typeof t2.width=="number"&&t2.width>0?t2.width:0),0)+(T2?E2:0),O2=i2.map(e3=>typeof e3.width=="number"&&e3.width>0?0:typeof e3.weight=="number"&&e3.weight>0?e3.weight:1),k2=O2.reduce((e3,t2)=>e3+t2,0)||1,A2=e3=>{let t2=i2[e3]?.width;if(typeof t2=="number"&&t2>0)return`${t2}rem`;let n3=(O2[e3]??1)/k2;return D2>0?`calc((100% - ${D2}rem) * ${n3.toFixed(4)})`:`${(n3*100).toFixed(3)}%`},j2=e3=>i2[e3]?.align??"left";return g(Li,{direction:"up",children:_("div",{className:b("core-data-table",l2),style:u2,"data-records":"",children:[e2||n2?_("div",{className:"core-data-table__head",children:[e2?g("div",{id:r2,className:"core-data-table__title",children:e2}):null,n2?g("div",{className:"core-data-table__subtitle",children:n2}):null]}):null,g("div",{className:"core-data-table__wide",children:_("table",{className:"core-data-table__table",...C2,children:[_("colgroup",{children:[i2.map((e3,t2)=>g("col",{style:{width:A2(t2)}},t2)),T2?g("col",{style:{width:`${E2}rem`}}):null]}),S2?g("thead",{children:_("tr",{children:[i2.map((e3,t2)=>g("th",{scope:"col",className:"core-data-table__col","data-align":j2(t2),children:e3.header},t2)),T2?g("th",{scope:"col",className:"core-data-table__col","data-align":"right",children:g("span",{className:"core-data-table__sr",children:"Actions"})}):null]})}):null,g("tbody",{children:a2.map((e3,t2)=>{let n3=d2(e3),r3=ua(e3.href);return _("tr",{className:"core-data-table__row","data-highlighted":e3.highlighted?"true":void 0,"data-total":e3.total?"true":void 0,children:[i2.map((t3,i3)=>{let a3=ga(n3[i3]),s3=pa(a3.tone),c3=wa(a3.value,t3.format,e3.unit,o2),l3={className:b("core-data-table__cell",s3&&"core-toned"),"data-align":j2(i3),"data-tone":s3};if(i3===m2){let t4=r3&&Ea(c3)?g("a",{className:"core-data-table__link",href:r3,children:c3}):c3;return g("th",{scope:"row","data-role":"title",...l3,children:Ea(e3.leading)?_("div",{className:"core-data-table__titlecell",children:[g("span",{className:"core-data-table__lead",children:e3.leading}),t4]}):t4},i3)}let u3=p2[i3]??"meta";return g("td",{"data-role":u3,title:(u3==="badge"||u3==="value")&&typeof a3.value=="string"&&typeof c3=="string"?c3:void 0,...l3,children:c3},i3)}),T2?g("td",{className:"core-data-table__cell","data-role":"actions","data-align":"right",children:Ea(e3.actions)?e3.actions:null}):null]},t2)})})]})}),g("ul",{className:"core-data-table__records",...C2,children:a2.map((e3,n3)=>{let r3=d2(e3),a3=t2=>t2<0?null:wa(ga(r3[t2]).value,i2[t2]?.format,e3.unit,o2),s3=x2.map(a3).filter(Ea);return g(Xe,{as:"li",title:a3(m2),titleLevel:w2,href:ua(e3.href)??void 0,leading:Ea(e3.leading)?e3.leading:void 0,actions:Ea(e3.actions)?e3.actions:void 0,badge:Ea(a3(v2))?g("span",{className:"core-data-table__badge-text",title:typeof ga(r3[v2]).value=="string"&&typeof a3(v2)=="string"?a3(v2):void 0,children:a3(v2)}):void 0,meta:s3.length?g(h,{children:s3.map((e4,n4)=>_(t,{children:[n4>0?" · ":null,e4]},n4))}):void 0,value:a3(y2)||void 0},n3)})})]})})}function ka(e2){let{event:t2,href:n2,locale:r2,timeZone:i2,size:a2,className:o2,style:s2}=e2,c2=t2&&typeof t2=="object"?t2:{name:""},l2=Dt(c2,r2,i2),u2=c2.status&&c2.status!=="confirmed"?c2.status:void 0,d2=_(h,{children:[_("div",{className:"core-event-card__top",children:[c2.typeName?g("span",{className:"core-event-card__type",children:c2.typeName}):null,u2?g("span",{className:"core-event-card__status","data-status":u2,children:u2}):null]}),g("div",{className:"core-event-card__name",children:c2.name}),l2?g("div",{className:"core-event-card__when",children:l2}):null,c2.location?g("div",{className:"core-event-card__where",children:c2.location}):null]});return g("div",{className:b("core-event-card",o2),"data-kind":c2.kind,"data-status":c2.status,"data-size":a2==="compact"?"compact":void 0,style:s2,children:n2?g("a",{className:"core-event-card__link",href:n2,children:d2}):d2})}var Aa={accepted:"Accept",tentative:"Maybe",declined:"Decline"};function ja(e2){let{actions:t2,className:n2,style:r2}=e2,[i2,a2]=p(e2.response),[o2,s2]=p(false),[c2,l2]=p(""),u2=t2?.respond,d2=async e3=>{if(!u2||o2)return;s2(true),l2("");let t3=await u2({response:e3});s2(false),t3.success?a2(e3):l2(jt(t3))};return _("div",{className:b("core-event-respond",n2),style:r2,children:[g("div",{className:"core-event-respond__choices",role:"group","aria-label":"Your response",children:St.map(e3=>g("button",{type:"button",className:"core-event-respond__choice","aria-pressed":i2===e3,disabled:!u2||o2,onClick:()=>void d2(e3),children:Aa[e3]},e3))}),c2?g("p",{className:"core-event-respond__message",role:"alert",children:c2}):null]})}function Ma(e2){let{event:t2,actions:n2,viewerResponse:r2,locale:i2,timeZone:a2,className:o2,style:s2}=e2,c2=[["Edit",e2.editHref],["Reschedule",e2.rescheduleHref],["Add note",e2.noteHref],["Cancel the event",e2.cancelHref]].filter(e3=>typeof e3[1]=="string"&&e3[1]!==""),l2=t2&&typeof t2=="object"?t2:{name:""},u2=Array.isArray(e2.notes)?e2.notes:[],d2=Array.isArray(e2.participants)?e2.participants:[],f2=Dt(l2,i2,a2);return _("article",{className:b("core-event-detail",o2),"data-status":l2.status,style:s2,children:[_("header",{className:"core-event-detail__head",children:[l2.typeName?g("div",{className:"core-event-detail__type",children:l2.typeName}):null,g("h2",{className:"core-event-detail__name",children:l2.name}),f2?g("div",{className:"core-event-detail__meta",children:f2}):null,l2.location?g("div",{className:"core-event-detail__meta",children:l2.location}):null,l2.status&&l2.status!=="confirmed"?g("div",{className:"core-event-detail__status",children:l2.status}):null]}),c2.length>0?g("div",{className:"core-event-detail__manage",role:"group","aria-label":"Change this event",children:c2.map(([e3,t3])=>g("a",{className:"core-event-detail__action",href:t3,children:e3},e3))}):null,r2===void 0?null:g(ja,{response:r2,actions:n2,className:"core-event-detail__respond"}),d2.length?_("section",{className:"core-event-detail__section","aria-label":"Participants",children:[g("h3",{className:"core-event-detail__heading",children:"Participants"}),g("ul",{className:"core-event-detail__list",children:d2.map((e3,t3)=>_("li",{className:"core-event-detail__person",children:[g("span",{children:e3.name}),g("span",{className:"core-event-detail__muted",children:[e3.role,e3.response&&e3.response!=="needs_action"?e3.response:void 0].filter(Boolean).join(" · ")})]},t3))})]}):null,u2.length?_("section",{className:"core-event-detail__section","aria-label":"Notes",children:[g("h3",{className:"core-event-detail__heading",children:"Notes"}),u2.map((e3,t3)=>_("div",{className:"core-event-detail__note","data-audience":e3.audience,children:[e3.audience==="staff"?g("div",{className:"core-event-detail__badge",children:"Staff only"}):null,g("p",{className:"core-event-detail__body",children:e3.body}),e3.author||e3.createdAt?g("div",{className:"core-event-detail__muted",children:[e3.author,e3.createdAt?new Date(e3.createdAt).toLocaleString(i2,{timeZone:a2}):void 0].filter(Boolean).join(" · ")}):null]},t3))]}):null]})}var Na=e2=>{let t2=e2?.dataSchema?.properties??{},n2=new Set(e2?.dataSchema?.required??[]);return Object.entries(t2).map(([e3,t3])=>[e3,t3,n2.has(e3)])};function Pa(e2){let{orgId:t2,projectId:n2,actions:r2,onDone:i2,canWriteStaffNotes:a2,className:o2,style:s2}=e2,l2=Array.isArray(e2.types)?e2.types:[],d2=c(),[f2,m2]=p(e2.defaultTypeId??l2[0]?.id??""),h2=l2.find(e3=>e3.id===f2),v2=h2?.kind==="scheduled",[y2,x2]=p(""),[S2,C2]=p(At()),[w2,T2]=p(""),[E2,D2]=p(""),[O2,k2]=p({}),[A2,j2]=p(""),[M2,N2]=p(!!a2),[P2,F2]=p(false),[I2,L2]=p(""),R2=u(()=>Na(h2),[h2]);if(!l2.length)return g("p",{className:b("core-event-log","core-event-log__empty",o2),style:s2,children:"There's nothing you can log here."});let z2=async o3=>{if(o3.preventDefault(),!r2?.logEvent||P2||!h2)return;F2(true),L2("");let s3=kt(S2),c2={event_type_id:h2.id,org_id:t2,name:y2.trim()||h2.name,starts_at:s3,tzid:Ot(),data:O2,subjects:e2.subjects?[...e2.subjects]:[]};n2&&(c2.project_id=n2),v2&&w2&&(c2.ends_at=kt(w2)),E2.trim()&&(c2.location=E2.trim());let l3=A2.trim()?[{body:A2.trim(),audience:a2&&M2?"staff":"shared"}]:void 0,u2=await r2.logEvent(l3?{event:c2,notes:l3}:{event:c2});F2(false),u2.success?(x2(""),j2(""),k2({}),i2?.(u2)):L2(jt(u2))},B2=(e3,t3)=>k2(n3=>({...n3,[e3]:t3}));return _("form",{className:b("core-event-log",o2),style:s2,onSubmit:e3=>void z2(e3),children:[_("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:"Type"}),g("select",{value:f2,onChange:e3=>{m2(e3.target.value),k2({})},children:l2.map(e3=>g("option",{value:e3.id,children:e3.name},e3.id))})]}),_("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:"Title"}),g("input",{value:y2,onChange:e3=>x2(e3.target.value),placeholder:h2?.name})]}),_("div",{className:"core-event-log__row",children:[_("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:v2?"Starts":"When"}),g("input",{type:"datetime-local",required:true,value:S2,onChange:e3=>C2(e3.target.value)})]}),v2?_("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:"Ends"}),g("input",{type:"datetime-local",value:w2,min:S2,onChange:e3=>T2(e3.target.value)})]}):null]}),_("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:"Where"}),g("input",{value:E2,onChange:e3=>D2(e3.target.value)})]}),R2.map(([e3,t3,n3])=>{let r3=t3.title??e3;if(t3.enum)return _("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:r3}),_("select",{required:n3,value:String(O2[e3]??""),onChange:t4=>B2(e3,t4.target.value||void 0),children:[g("option",{value:"",children:"—"}),t3.enum.map(e4=>g("option",{value:e4,children:e4},e4))]})]},e3);if(t3.type==="boolean")return _("label",{className:"core-event-log__check",children:[g("input",{type:"checkbox",checked:!!O2[e3],onChange:t4=>B2(e3,t4.target.checked)}),g("span",{children:r3})]},e3);let i3=t3.type==="number"||t3.type==="integer";return _("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:r3}),g("input",{type:i3?"number":"text",step:t3.type==="integer"?1:"any",required:n3,value:O2[e3]===void 0?"":String(O2[e3]),onChange:t4=>B2(e3,t4.target.value===""?void 0:i3?Number(t4.target.value):t4.target.value)})]},e3)}),_("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:"Note"}),g("textarea",{rows:3,value:A2,onChange:e3=>j2(e3.target.value)})]}),a2&&A2.trim()?_("label",{className:"core-event-log__check",children:[g("input",{type:"checkbox",checked:M2,onChange:e3=>N2(e3.target.checked)}),g("span",{children:"Staff only: the client won't see this note"})]}):null,I2?g("p",{id:`${d2}-error`,className:"core-event-log__message",role:"alert",children:I2}):null,g("div",{className:"core-event-log__actions",children:g("button",{type:"submit",className:"core-event-log__submit",disabled:P2||!r2?.logEvent,children:P2?"Saving…":v2?"Schedule":"Log"})})]})}var Fa=(e2,t2)=>new Intl.DateTimeFormat(t2,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`));function Ia(e2){let t2=E(),{view:n2="week",weekParam:r2="week",linkParams:i2,eventHref:a2="?panel=event:{id}",locale:o2,timeZone:s2,renderComponent:c2,label:l2="Schedule",className:u2,style:d2}=e2,f2=e3=>`?${i2?new URLSearchParams({...i2,[r2]:e3}).toString():`${r2}=${e3}`}`,p2=Array.isArray(e2.occurrences)?e2.occurrences:[],m2=Mt(new Date,s2),h2=Nt(/^\d{4}-\d{2}-\d{2}$/.test(e2.weekOf??"")?e2.weekOf:m2),v2=Array.from({length:7},(e3,t3)=>Y(h2,t3)),y2=new Map(v2.map(e3=>[e3,[]]));for(let e3 of p2)for(let t3 of Pt(e3,s2))y2.get(t3)?.push(e3);for(let e3 of y2.values())e3.sort((e4,t3)=>+!e4.startOn-!t3.startOn||(e4.startsAt??"").localeCompare(t3.startsAt??""));let x2=n2==="agenda"?v2.filter(e3=>y2.get(e3).length):v2;return _("section",{className:b("core-event-schedule",u2),"data-view":n2,style:d2,"aria-label":l2,children:[_("div",{className:"core-event-schedule__nav",children:[t2?null:g("a",{className:"core-event-schedule__step",href:f2(Y(h2,-7)),"aria-label":"Previous week",children:"‹"}),g("span",{className:"core-event-schedule__range",children:`${Fa(v2[0],o2)} – ${Fa(v2[6],o2)}`}),t2?null:g("a",{className:"core-event-schedule__step",href:f2(Y(h2,7)),"aria-label":"Next week",children:"›"})]}),x2.length===0?g("p",{className:"core-event-schedule__empty",children:"Nothing scheduled this week."}):null,g("ol",{className:"core-event-schedule__days",children:x2.map(e3=>{let t3=y2.get(e3);return _("li",{className:"core-event-schedule__day","data-today":e3===m2||void 0,children:[g("h3",{className:"core-event-schedule__date",children:Fa(e3,o2)}),t3.length?g("ul",{className:"core-event-schedule__events",children:t3.map((e4,t4)=>g("li",{children:bt(e4,c2,{href:Ft(a2,e4.id),locale:o2,timeZone:s2})??g(ka,{event:e4,href:Ft(a2,e4.id),locale:o2,timeZone:s2})},`${e4.id??t4}-${e4.startsAt??e4.startOn??t4}`))}):g("p",{className:"core-event-schedule__none",children:"—"})]},e3)})})]})}var La=(e2,t2)=>new Intl.DateTimeFormat(t2,{weekday:"long",month:"long",day:"numeric",year:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`));function Ra(e2){let{eventHref:t2="?panel=event:{id}",emptyText:n2="No activity yet.",locale:r2,timeZone:i2,renderComponent:a2,className:o2,style:s2}=e2,c2=[...(Array.isArray(e2.items)?e2.items:[]).filter(e3=>e3&&!Number.isNaN(new Date(e3.at).getTime()))].sort((e3,t3)=>new Date(t3.at).getTime()-new Date(e3.at).getTime()),l2=[];for(let e3 of c2){let t3=Mt(e3.at,i2),n3=l2[l2.length-1];n3&&n3[0]===t3?n3[1].push(e3):l2.push([t3,[e3]])}let u2=new Intl.DateTimeFormat(r2,{hour:"numeric",minute:"2-digit",timeZone:i2});return _("section",{className:b("core-event-timeline",o2),style:s2,"aria-label":"Activity",children:[l2.length===0?g("p",{className:"core-event-timeline__empty",children:n2}):null,l2.map(([e3,n3])=>_("section",{className:"core-event-timeline__day",children:[g("h3",{className:"core-event-timeline__date",children:La(e3,r2)}),g("ol",{className:"core-event-timeline__items",children:n3.map((e4,n4)=>_("li",{className:"core-event-timeline__item","data-op":e4.op||void 0,children:[_("div",{className:"core-event-timeline__line",children:[g("time",{className:"core-event-timeline__time",dateTime:e4.at,children:u2.format(new Date(e4.at))}),e4.summary?g("span",{className:"core-event-timeline__summary",children:e4.summary}):null,e4.actor?g("span",{className:"core-event-timeline__actor",children:e4.actor}):null]}),e4.event?bt(e4.event,a2,{href:Ft(t2,e4.event.id),locale:r2,timeZone:i2})??g(ka,{event:e4.event,href:Ft(t2,e4.event.id),locale:r2,timeZone:i2}):null]},e4.id??`${e4.at}-${n4}`))})]},e3))]})}var za=1440;function Ba(e2){return new Intl.DateTimeFormat("en-CA",{timeZone:e2,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Va(e2,t2){let n2=e2 instanceof Date?e2:new Date(e2);if(Number.isNaN(n2.getTime()))return null;let r2=Object.fromEntries(Ba(t2).formatToParts(n2).map(e3=>[e3.type,e3.value]));return{date:`${r2.year}-${r2.month}-${r2.day}`,minutes:Number(r2.hour)*60+Number(r2.minute)+Number(r2.second)/60}}var Ha=e2=>e2.busyOnly===true;function Ua(e2,t2){if(!e2.startsAt)return null;let n2=Va(e2.startsAt,t2);if(!n2)return null;let r2=new Date(e2.startsAt).getTime(),i2=e2.endsAt?new Date(e2.endsAt).getTime():NaN,a2=Va(Number.isFinite(i2)&&i2>r2?i2:r2+18e5,t2);return a2?{start:n2,end:a2}:null}function Wa(e2,t2,{timeZone:n2,minMinutes:r2=42}={}){let i2=[],a2=[];for(let r3 of e2){if(!r3||typeof r3!="object")continue;if(r3.startOn){Pt(r3).includes(t2)&&i2.push(r3);continue}let e3=Ua(r3,n2);if(!e3||e3.start.date>t2||e3.end.date<t2||e3.end.date===t2&&e3.end.minutes===0&&e3.start.date<t2)continue;let o3=e3.start.date<t2?0:e3.start.minutes,s3=e3.end.date>t2?za:e3.end.minutes;a2.push({event:r3,startMin:o3,endMin:Math.max(s3,o3+1),continuesBefore:e3.start.date<t2,continuesAfter:e3.end.date>t2,busyOnly:Ha(r3)})}a2.sort((e3,t3)=>e3.startMin-t3.startMin||t3.endMin-e3.endMin);let o2=[],s2=[],c2=-1,l2=[],u2=()=>{for(let e4 of s2)e4.cols=l2.length;let e3=s2.filter(e4=>!e4.busyOnly);for(let t3 of e3)t3.overlaps=e3.some(e4=>e4!==t3&&e4.startMin<t3.endMin&&t3.startMin<e4.endMin);o2.push(...s2),s2=[],l2=[],c2=-1};for(let e3 of a2){s2.length&&e3.startMin>=c2&&u2();let t3=Math.min(Math.max(e3.endMin,e3.startMin+r2),za),n3=l2.findIndex(t4=>t4<=e3.startMin);n3<0&&(n3=l2.length),l2[n3]=t3,c2=Math.max(c2,t3),s2.push({...e3,shownEndMin:t3,col:n3,cols:1,overlaps:false})}return u2(),i2.sort((e3,t3)=>(e3.name??"").localeCompare(t3.name??"")),{date:t2,blocks:o2,allDay:i2}}function Ga(e2,t2=7,n2=19){let r2=Math.max(0,Math.min(23,t2))*60,i2=Math.max(r2/60+1,Math.min(24,n2))*60;for(let t3 of e2)for(let e3 of t3.blocks)r2=Math.min(r2,Math.floor(e3.startMin/60)*60),i2=Math.max(i2,Math.ceil(e3.shownEndMin/60)*60);return{fromMin:r2,toMin:Math.min(i2,za)}}function Ka(e2,t2=1){let n2=Y(Nt(e2),(t2%7+6)%7);return n2>e2&&(n2=Y(n2,-7)),Array.from({length:7},(e3,t3)=>Y(n2,t3))}function qa(e2,t2,n2){return t2.filter(t3=>Wa(e2,t3,{timeZone:n2,minMinutes:0}).blocks.some(e3=>e3.overlaps))}var Ja=["circle","square","triangle","diamond","plus","hexagon"],Ya={circle:"M5 1.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7z",square:"M1.5 1.5h7v7h-7z",triangle:"M5 1.2 9 8.5H1z",diamond:"M5 .8 9.2 5 5 9.2.8 5z",plus:"M3.5 1h3v2.5H9v3H6.5V9h-3V6.5H1v-3h2.5z",hexagon:"M5 .8 8.6 2.9v4.2L5 9.2 1.4 7.1V2.9z"},Xa=e2=>Ja[(Math.max(1,Math.floor(e2))-1)%Ja.length],Za=e2=>typeof e2=="number"&&Number.isFinite(e2)&&e2>=1?(Math.floor(e2)-1)%8+1:1;function Qa({series:e2,className:t2}){let n2=Za(e2);return g("svg",{className:t2?`core-series-glyph ${t2}`:"core-series-glyph",viewBox:"0 0 10 10","aria-hidden":"true",focusable:"false","data-series":n2,"data-shape":Xa(n2),children:g("path",{d:Ya[Xa(n2)]})})}var $a=44,eo=28,to=(e2,t2,n2)=>`${((e2-t2)/n2*100).toFixed(3)}%`;function no(e2){let t2=e2===void 0?void 0:typeof e2=="number"?e2:new Date(e2).getTime(),[n2,r2]=p(()=>Date.now());return s(()=>{if(t2!==void 0)return;let e3=setInterval(()=>r2(Date.now()),6e4);return()=>clearInterval(e3)},[t2]),t2!==void 0&&Number.isFinite(t2)?t2:n2}function ro(e2){let{label:t2="Schedule",startHour:n2=7,endHour:r2=19,hourHeight:i2=64,eventHref:a2="?panel=event:{id}",locale:o2,timeZone:c2,className:l2,style:u2}=e2,d2=(Array.isArray(e2.columns)?e2.columns:[]).filter(e3=>e3&&typeof e3.date=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e3.date)),m2=no(e2.now),v2=f(null),[y2,x2]=p(false);s(()=>{let e3=v2.current;if(!e3)return;let t3=()=>x2(e3.scrollWidth>e3.clientWidth+1);t3();let n3=new ResizeObserver(t3);return n3.observe(e3),()=>n3.disconnect()},[d2.length]);let C2=Va(m2,c2),w2=Math.ceil($a/Math.max(i2,24)*60),T2=d2.map(e3=>Wa(Array.isArray(e3.events)?e3.events:[],e3.date,{timeZone:c2,minMinutes:w2})),E2=T2.map(e3=>Math.max($a,eo*Math.max(1,...e3.blocks.map(e4=>e4.cols)))),{fromMin:D2,toMin:O2}=Ga(T2,n2,r2),k2=O2-D2,A2=Array.from({length:Math.floor(k2/60)+1},(e3,t3)=>D2+t3*60),j2=new Intl.DateTimeFormat(o2,{hour:"numeric",timeZone:"UTC"}),M2=new Intl.DateTimeFormat(o2,{hour:"numeric",minute:"2-digit",timeZone:"UTC"}),N2=e3=>M2.format(new Date(Date.UTC(2e3,0,1,0,Math.min(e3,za-1)))),P2=e3=>e3.continuesBefore?e3.continuesAfter?"All day":`Until ${N2(e3.endMin)}`:e3.continuesAfter?`From ${N2(e3.startMin)}`:`${N2(e3.startMin)} – ${N2(e3.endMin)}`;return _("div",{ref:v2,className:b("core-hour-grid",l2),role:"group","aria-label":t2,tabIndex:y2?0:void 0,style:S({"--core-hour-grid-cols":String(d2.length),"--core-hour-grid-tracks":E2.map(e3=>`minmax(${e3}px, 1fr)`).join(" "),"--core-hour-grid-min":`${E2.reduce((e3,t3)=>e3+t3,0)}px`,"--core-hour-grid-hour":`${i2}px`,"--core-hour-grid-hours":String(k2/60)},u2),children:[_("div",{className:"core-hour-grid__head",children:[g("span",{className:"core-hour-grid__corner","aria-hidden":"true"}),d2.map(e3=>{let t3=C2?.date===e3.date,n3=_(h,{children:[g("span",{className:"core-hour-grid__label",children:e3.label}),e3.sublabel?g("span",{className:"core-hour-grid__sublabel",children:e3.sublabel}):null]}),r3=Rt(e3.href);return r3?g("a",{className:"core-hour-grid__day",href:r3,"data-today":t3||void 0,"aria-current":t3?"date":void 0,children:n3},e3.id):g("div",{className:"core-hour-grid__day","data-today":t3||void 0,"aria-current":t3?"date":void 0,children:n3},e3.id)})]}),T2.some(e3=>e3.allDay.length)?_("div",{className:"core-hour-grid__allday",children:[g("span",{className:"core-hour-grid__corner","aria-hidden":"true"}),T2.map((e3,t3)=>g("ul",{className:"core-hour-grid__chips","aria-label":`All day, ${d2[t3].label}`,children:e3.allDay.map((e4,t4)=>{let n3=io(e4)?void 0:Rt(Ft(a2,e4.id));return g("li",{className:"core-hour-grid__chip","data-busy":io(e4)||void 0,children:io(e4)?g("span",{className:"core-hour-grid__sr",children:"Busy all day"}):n3?g("a",{href:n3,children:e4.name}):e4.name},`${e4.id??t4}`)})},d2[t3].id))]}):null,_("div",{className:"core-hour-grid__body",children:[g("div",{className:"core-hour-grid__axis","aria-hidden":"true",children:A2.map((e3,t3)=>g("span",{className:"core-hour-grid__tick",style:{top:to(e3,D2,k2)},"data-first":t3===0||void 0,children:t3===0?"":j2.format(new Date(Date.UTC(2e3,0,1,e3/60)))},e3))}),T2.map((e3,t3)=>{let n3=d2[t3],r3=C2?.date===n3.date;return _("section",{className:"core-hour-grid__col","aria-label":n3.label,"data-today":r3||void 0,children:[g("ol",{className:"core-hour-grid__events",children:e3.blocks.map((e4,t4)=>{let n4=e4.event,r4={"--core-hour-grid-top":to(e4.startMin,D2,k2),"--core-hour-grid-height":`${((e4.shownEndMin-e4.startMin)/k2*100).toFixed(3)}%`,"--core-hour-grid-left":`${(e4.col/e4.cols*100).toFixed(3)}%`,"--core-hour-grid-width":`${(100/e4.cols).toFixed(3)}%`};if(e4.busyOnly)return g("li",{className:"core-hour-grid__block","data-busy":"",style:S(r4),children:g("span",{className:"core-hour-grid__sr",children:`Busy, ${P2(e4)}`})},t4);let i3=Rt(Ft(a2,n4.id)),o3=e4.endMin-e4.startMin,s2=o3<45?"short":o3<90?"medium":"long",c3=_(h,{children:[e4.overlaps?g("span",{className:"core-hour-grid__overlap",children:"Overlaps"}):null,_("span",{className:"core-hour-grid__name",children:[typeof n4.series=="number"?g(Qa,{series:n4.series,className:"core-hour-grid__series"}):null,n4.name]}),g("span",{className:"core-hour-grid__time",children:P2(e4)}),s2==="long"&&n4.typeName?g("span",{className:"core-hour-grid__type",children:n4.typeName}):null]}),l3={className:"core-hour-grid__event","data-kind":n4.kind,"data-status":n4.status,"data-size":s2,"data-overlaps":e4.overlaps||void 0};return g("li",{className:"core-hour-grid__block","data-before":e4.continuesBefore||void 0,"data-after":e4.continuesAfter||void 0,style:S(r4),children:i3?g("a",{...l3,href:i3,children:c3}):g("div",{...l3,children:c3})},`${n4.id??"e"}-${t4}`)})}),r3&&C2&&C2.minutes>=D2&&C2.minutes<=O2?g("div",{className:"core-hour-grid__now","aria-hidden":"true",style:{top:to(C2.minutes,D2,k2)}}):null]},n3.id)})]})]})}var io=e2=>e2.busyOnly===true,$=/^\d{4}-\d{2}-\d{2}$/,ao=/^\d{2}:\d{2}$/,oo=(e2,t2)=>!e2||!$.test(e2)?"":new Intl.DateTimeFormat(t2,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`)),so=(e2,t2)=>new Intl.DateTimeFormat(t2,{hour:"numeric",minute:"2-digit",timeZone:"UTC"}).format(new Date(`1970-01-01T${e2}:00Z`));function co(e2,t2){if(!e2)return null;let n2=new Date(e2);if(Number.isNaN(n2.getTime()))return null;let r2=new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23",timeZone:t2}),i2=Object.fromEntries(r2.formatToParts(n2).map(e3=>[e3.type,e3.value]));return{date:`${i2.year}-${i2.month}-${i2.day}`,time:`${i2.hour}:${i2.minute}`}}function lo(e2,t2){if(!$.test(e2)||!ao.test(t2))return;let n2=new Date(`${e2}T${t2}:00`);if(Number.isNaN(n2.getTime()))return;let r2=-n2.getTimezoneOffset(),i2=r2<0?"-":"+",a2=Math.abs(r2);return`${e2}T${t2}:00${i2}${String(Math.floor(a2/60)).padStart(2,"0")}:${String(a2%60).padStart(2,"0")}`}function uo(e2,t2){let n2=co(new Date(t2).toISOString(),e2);if(!n2)return 0;let[r2,i2,a2]=n2.date.split("-").map(Number),[o2,s2]=n2.time.split(":").map(Number);return Math.round((Date.UTC(r2,i2-1,a2,o2,s2)-Math.floor(t2/6e4)*6e4)/6e4)}function fo(e2,t2,n2){if($.test(e2)&&ao.test(t2)){if(!n2)return lo(e2,t2);try{let[r2,i2,a2]=e2.split("-").map(Number),[o2,s2]=t2.split(":").map(Number),c2=Date.UTC(r2,i2-1,a2,o2,s2),l2=c2;for(let e3=0;e3<4;e3++){let e4=c2-uo(n2,l2)*6e4;if(e4===l2)break;l2=e4}let u2=uo(n2,l2),d2=u2<0?"-":"+",f2=Math.abs(u2);return`${e2}T${t2}:00${d2}${String(Math.floor(f2/60)).padStart(2,"0")}:${String(f2%60).padStart(2,"0")}`}catch{return lo(e2,t2)}}}function po(e2,t2=Date.now()){let n2=e3=>new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",...e3?{timeZone:e3}:{}}).format(t2);try{return n2(e2)}catch{return n2()}}var mo=(e2,t2,n2,r2)=>`?${new URLSearchParams({...r2,[n2]:"day",[t2]:e2}).toString()}`;function ho({days:e2,param:t2="date",viewParam:n2="view",keep:r2,locale:i2,className:a2,style:o2}){let s2=E(),c2=[...new Set(e2.filter(e3=>$.test(e3)))].sort();if(c2.length===0)return null;let l2=c2.length===1,u2=l2?`Events overlap on ${oo(c2[0],i2)}.`:`Events overlap on ${c2.length} days.`;return g("div",{className:b("core-overlap-notice",a2),style:o2,children:g(yn,{tone:"warning",message:u2,action:s2?void 0:_("span",{className:"core-overlap-notice__links",children:[l2?null:g("span",{className:"core-overlap-notice__lead",children:"Review:"}),c2.map(e3=>g("a",{className:"core-overlap-notice__review",href:mo(e3,t2,n2,r2),"aria-label":`Review ${oo(e3,i2)}`,children:l2?"Review":oo(e3,i2)},e3))]})})})}function go(e2){let{param:t2="type",cancelledParam:n2="cancelled",keep:r2,label:i2="Show",onChange:a2,className:o2,style:s2}=e2,l2=(Array.isArray(e2.types)?e2.types:[]).filter(e3=>e3&&typeof e3.id=="string"&&typeof e3.label=="string"&&e3.label!==""),u2=c(),d2=l2.map(e3=>e3.id),f2=Array.isArray(e2.selected)?e2.selected:d2,p2=e2.showCancelled===true;if(l2.length===0)return null;let m2=e3=>{let r3=new FormData(e3);return{selected:r3.getAll(t2).map(String),showCancelled:r3.has(n2)}};return _("form",{className:b("core-calendar-filters",o2),style:s2,method:"get",action:"",onChange:e3=>{a2?a2(m2(e3.currentTarget)):typeof e3.currentTarget.requestSubmit=="function"&&e3.currentTarget.requestSubmit()},onSubmit:e3=>a2&&e3.preventDefault(),children:[Object.entries(r2??{}).map(([e3,t3])=>g("input",{type:"hidden",name:e3,value:t3},e3)),_("fieldset",{className:"core-calendar-filters__set",children:[g("legend",{className:"core-calendar-filters__legend",children:i2}),l2.map((e3,n3)=>_("label",{className:"core-calendar-filters__option",children:[g("input",{type:"checkbox",name:t2,value:e3.id,defaultChecked:f2.includes(e3.id)}),g(Qa,{series:Za(e3.series??n3+1)}),g("span",{className:"core-calendar-filters__label",children:e3.label})]},e3.id)),_("label",{className:"core-calendar-filters__option core-calendar-filters__option--cancelled",children:[g("input",{type:"checkbox",name:n2,value:"1",defaultChecked:p2}),g("span",{className:"core-calendar-filters__label",children:"Cancelled"})]})]}),g("button",{type:"submit",className:"core-calendar-filters__apply",id:`${u2}-apply`,children:"Apply"})]})}var _o=(e2,t2,n2)=>`?${new URLSearchParams({...e2??{},[t2]:n2}).toString()}`,vo=(e2,t2)=>{let[n2,r2]=e2.split("-").map(Number),i2=new Date(Date.UTC(n2,r2-1+t2,1));return`${i2.getUTCFullYear()}-${String(i2.getUTCMonth()+1).padStart(2,"0")}`};function yo({month:e2,date:t2,highlight:n2="week",occurrences:r2,weekStartsOn:i2=1,param:a2="date",monthParam:o2="month",keep:s2,locale:c2,timeZone:l2,now:u2,className:d2,style:m2}){let h2=E(),v2=h2?"span":"a",y2=u2===void 0?Date.now():typeof u2=="number"?u2:new Date(u2).getTime(),x2=Va(Number.isFinite(y2)?y2:Date.now(),l2)?.date??"1970-01-01",S2=t2&&/^\d{4}-\d{2}-\d{2}$/.test(t2)?t2:x2,C2=e2&&/^\d{4}-\d{2}$/.test(e2)?e2:S2.slice(0,7),w2=`${C2}-01`,T2=Ka(w2,i2)[0],D2=Array.from({length:42},(e3,t3)=>Y(T2,t3)),O2=Array.from({length:6},(e3,t3)=>D2.slice(t3*7,t3*7+7)),k2=n2==="week"?new Set(Ka(S2,i2)):new Set([S2]),A2=Array.isArray(r2)?r2:[],j2=new Map(D2.map(e3=>{let t3=Wa(A2,e3,{timeZone:l2,minMinutes:0});return[e3,t3.blocks.length+t3.allDay.length]})),M2=(e3,t3)=>new Intl.DateTimeFormat(c2,{...e3,timeZone:"UTC"}).format(new Date(`${t3}T00:00:00Z`)),N2=M2({month:"long",year:"numeric"},w2),P2=O2[0].map(e3=>({short:M2({weekday:"narrow"},e3),long:M2({weekday:"long"},e3)})),F2=D2.includes(S2)?S2:D2.includes(x2)?x2:w2,[I2,L2]=p(null),R2=I2&&D2.includes(I2)?I2:F2,z2=f(null),B2=e3=>{D2.includes(e3)&&(L2(e3),z2.current?.querySelector(`[data-date="${e3}"]`)?.focus())};return _("div",{className:b("core-mini-month",d2),style:m2,children:[_("div",{className:"core-mini-month__head",children:[h2?null:g("a",{className:"core-mini-month__step","data-step":"prev",href:_o(s2,o2,vo(C2,-1)),"aria-label":"Previous month",children:"‹"}),g("div",{className:"core-mini-month__title",id:`mm-${C2}`,"aria-live":"polite",children:N2}),h2?null:g("a",{className:"core-mini-month__step","data-step":"next",href:_o(s2,o2,vo(C2,1)),"aria-label":"Next month",children:"›"})]}),_("div",{ref:z2,role:"grid","aria-labelledby":`mm-${C2}`,className:"core-mini-month__grid",onKeyDown:e3=>{let t3=e3.target.closest("[data-date]")?.dataset.date;if(!t3)return;let n3=O2.find(e4=>e4.includes(t3)),r3={ArrowLeft:Y(t3,-1),ArrowRight:Y(t3,1),ArrowUp:Y(t3,-7),ArrowDown:Y(t3,7),Home:n3[0],End:n3[6]};r3[e3.key]?(e3.preventDefault(),B2(r3[e3.key])):(e3.key==="PageUp"||e3.key==="PageDown")&&(e3.preventDefault(),z2.current?.parentElement?.querySelector(`a[data-step="${e3.key==="PageUp"?"prev":"next"}"]`)?.click())},children:[g("div",{role:"row",className:"core-mini-month__row core-mini-month__row--head",children:P2.map((e3,t3)=>g("span",{role:"columnheader","aria-label":e3.long,className:"core-mini-month__weekday",children:e3.short},t3))}),O2.map(e3=>g("div",{role:"row",className:"core-mini-month__row",children:e3.map(e4=>{let t3=j2.get(e4)??0,n3=`${M2({weekday:"long",month:"long",day:"numeric"},e4)}${e4===x2?", today":""}${t3?`, ${t3} ${t3===1?"event":"events"}`:""}`;return g("span",{role:"gridcell","aria-selected":e4===S2,className:"core-mini-month__cell","data-range":k2.has(e4)||void 0,"data-outside":e4.slice(0,7)!==C2||void 0,children:_(v2,{className:"core-mini-month__day",href:h2?void 0:_o(s2,a2,e4),"data-date":e4,"data-today":e4===x2||void 0,"data-selected":e4===S2||void 0,"aria-current":e4===S2?"date":void 0,"aria-label":h2?void 0:n3,tabIndex:h2?void 0:e4===R2?0:-1,onFocus:()=>L2(e4),children:[h2?g("span",{className:"core-mini-month__sr",children:n3}):null,g("span",{"aria-hidden":"true",children:Number(e4.slice(8))}),g("span",{className:"core-mini-month__dot","aria-hidden":"true","data-has":t3>0||void 0})]})},e4)})},e3[0]))]})]})}var bo=(e2,t2,n2)=>`?${new URLSearchParams({...n2??{},[e2]:t2}).toString()}`;function xo({date:e2,occurrences:t2,weekStartsOn:n2=1,param:r2="date",steps:i2=true,keep:a2,locale:o2,timeZone:s2,now:c2,className:l2,style:u2}){let d2=E(),f2=d2?"span":"a",p2=c2===void 0?Date.now():typeof c2=="number"?c2:new Date(c2).getTime(),m2=Va(Number.isFinite(p2)?p2:Date.now(),s2)?.date??"1970-01-01",h2=e2&&/^\d{4}-\d{2}-\d{2}$/.test(e2)?e2:m2,v2=Ka(h2,n2),y2=Array.isArray(t2)?t2:[],x2=new Intl.DateTimeFormat(o2,{weekday:"short",timeZone:"UTC"}),S2=new Intl.DateTimeFormat(o2,{weekday:"long",month:"long",day:"numeric",timeZone:"UTC"}),C2=e3=>new Date(`${e3}T00:00:00Z`),w2=(e3,t3)=>`${S2.format(C2(e3))}${e3===m2?", today":""}${t3?`, ${t3} ${t3===1?"event":"events"}`:""}`,T2=new Map(v2.map(e3=>{let t3=Wa(y2,e3,{timeZone:s2});return[e3,t3.blocks.length+t3.allDay.length]}));return g("nav",{className:b("core-week-strip",l2),style:u2,"aria-label":"Week",children:_("div",{className:"core-week-strip__frame",children:[i2&&!d2?g("a",{className:"core-week-strip__step",href:bo(r2,Y(h2,-7),a2),"aria-label":"Previous week",children:"‹"}):null,g("ol",{className:"core-week-strip__days",children:v2.map(e3=>{let t3=T2.get(e3)??0;return g("li",{children:_(f2,{className:"core-week-strip__day",href:d2?void 0:bo(r2,e3,a2),"aria-current":e3===h2?"date":void 0,"aria-label":d2?void 0:w2(e3,t3),"data-selected":e3===h2||void 0,"data-today":e3===m2||void 0,children:[d2?g("span",{className:"core-week-strip__sr",children:w2(e3,t3)}):null,g("span",{className:"core-week-strip__weekday","aria-hidden":"true",children:x2.format(C2(e3))}),g("span",{className:"core-week-strip__date","aria-hidden":"true",children:Number(e3.slice(8))}),g("span",{className:"core-week-strip__mark","aria-hidden":"true","data-has":t3>0||void 0})]})},e3)})}),i2&&!d2?g("a",{className:"core-week-strip__step",href:bo(r2,Y(h2,7),a2),"aria-label":"Next week",children:"›"}):null]})})}var So=[["day","Day"],["week","Week"],["agenda","Agenda"]];function Co(e2){let t2=E(),{weekStartsOn:n2=1,viewParam:r2="view",dateParam:i2="date",eventHref:a2,newEventHref:o2,summary:s2,notice:c2,startHour:l2,endHour:u2,locale:d2,timeZone:f2,className:p2,style:m2}=e2,v2=e2.view==="day"||e2.view==="agenda"?e2.view:"week",y2=Array.isArray(e2.occurrences)?e2.occurrences:[],x2=e2.now===void 0?Date.now():typeof e2.now=="number"?e2.now:new Date(e2.now).getTime(),S2=Va(Number.isFinite(x2)?x2:Date.now(),f2)?.date??"1970-01-01",C2=e2.date&&/^\d{4}-\d{2}-\d{2}$/.test(e2.date)?e2.date:S2,w2=(e3,t3)=>`?${new URLSearchParams({[r2]:e3,[i2]:t3}).toString()}`,T2=v2==="day"?1:7,D2=Rt(o2),O2=(e3,t3)=>new Intl.DateTimeFormat(d2,{...e3,timeZone:"UTC"}).format(new Date(`${t3}T00:00:00Z`)),k2=Ka(C2,n2),A2=v2==="day"?O2({weekday:"long",month:"long",day:"numeric"},C2):`${O2({month:"short",day:"numeric"},k2[0])} – ${O2({month:"short",day:"numeric",year:"numeric"},k2[6])}`,j2=(t3,n3)=>g(ro,{columns:t3,label:n3,eventHref:a2,startHour:l2,endHour:u2,locale:d2,timeZone:f2,now:e2.now}),M2=e3=>({id:e3,date:e3,label:`${O2({weekday:"short"},e3)} ${Number(e3.slice(8))}`,sublabel:e3===S2?"Today":void 0,events:y2}),N2=k2.map(e3=>({...M2(e3),href:t2?void 0:w2("day",e3)}));return _("section",{className:b("core-calendar","core-calendar-view",p2),style:m2,"aria-label":"Schedule","data-view":v2,children:[_("header",{className:"core-calendar__head",children:[g("h2",{className:"core-calendar__title",children:A2}),t2?null:_("nav",{className:"core-calendar__nav","aria-label":"Calendar",children:[v2==="agenda"?null:g("a",{className:"core-calendar__step",href:w2(v2,Y(C2,-T2)),"aria-label":v2==="day"?"Previous day":"Previous week",children:"‹"}),g("a",{className:"core-calendar__today",href:w2(v2,S2),"aria-current":C2===S2||k2.includes(S2)?"date":void 0,children:"Today"}),v2==="agenda"?null:g("a",{className:"core-calendar__step",href:w2(v2,Y(C2,T2)),"aria-label":v2==="day"?"Next day":"Next week",children:"›"})]}),t2?null:g("nav",{className:"core-calendar__views","aria-label":"View",children:So.map(([e3,t3])=>g("a",{className:"core-calendar__view",href:w2(e3,C2),"aria-current":e3===v2?"page":void 0,children:t3},e3))}),D2?g("a",{className:"core-calendar__new",href:D2,children:"New event"}):null]}),s2?g("p",{className:"core-calendar__summary",children:s2}):null,c2?g("div",{className:"core-calendar__notice",children:c2}):null,v2==="day"?j2([M2(C2)],O2({weekday:"long",month:"long",day:"numeric"},C2)):null,v2==="week"?_(h,{children:[g("div",{className:"core-calendar__wide",children:j2(N2,`Week of ${O2({month:"long",day:"numeric"},k2[0])}`)}),_("div",{className:"core-calendar__narrow",children:[g(xo,{date:C2,occurrences:y2,weekStartsOn:n2,param:i2,steps:false,keep:{[r2]:"week"},locale:d2,timeZone:f2,now:e2.now}),j2([M2(C2)],O2({weekday:"long",month:"long",day:"numeric"},C2))]})]}):null,v2==="agenda"?g(Ia,{label:"Agenda",occurrences:y2,view:"agenda",weekOf:C2,weekParam:i2,linkParams:{[r2]:"agenda"},eventHref:a2,locale:d2,timeZone:f2}):null]})}var wo=new Set(["field","select","expand"]),To=(e2,t2)=>{let n2=e2.replace(/\s+/g," ").trim();return n2.length>t2?`${n2.slice(0,t2-1)}…`:n2};function Eo(e2,t2){if(typeof e2!="function"||!wo.has(t2.kind)||typeof t2.name!="string")return;let n2=To(t2.name,80);if(n2==="")return;let r2=t2.value,i2=typeof r2=="string"?To(r2,200):typeof r2=="boolean"||typeof r2=="number"&&Number.isFinite(r2)?r2:void 0;try{e2(i2===void 0?{kind:t2.kind,name:n2}:{kind:t2.kind,name:n2,value:i2})}catch{}}var Do=["private","team","client"];function Oo(e2){let t2=Array.isArray(e2?.audiences)?e2.audiences:[];return Do.filter(e3=>t2.includes(e3))}function ko(e2,t2){if(t2.length!==0)return t2.includes(e2)?e2:t2.includes("team")?"team":t2[0]}function Ao(e2,t2="team"){let[n2,r2]=p(t2);return{value:ko(n2,e2),setValue:r2}}function jo(e2,t2){if(e2==="private")return"Only me and the people I add";if(e2==="team")return"My team";let n2=X(t2);return n2?`My team and ${n2}`:"My team and the client"}function Mo(e2){return e2==="client"?" The client can see it.":e2==="private"?" Only you and the people you add can see it.":""}function No({id:e2,audiences:t2,value:n2,onChange:r2,subjectName:i2,disabled:a2}){return t2.length===0||!n2?null:t2.length===1?_("p",{className:"core-intent-card__audience-fixed","data-audience":n2,children:[g("span",{className:"core-intent-card__label",children:"Who can see it"})," ",jo(n2,i2)]}):_("fieldset",{className:"core-intent-card__audience",disabled:a2,children:[g("legend",{className:"core-intent-card__label",children:"Who can see it"}),t2.map(t3=>_("label",{className:"core-intent-card__audience-row",children:[g("input",{type:"radio",name:`${e2}-audience`,value:t3,checked:n2===t3,onChange:()=>r2(t3)}),g("span",{children:jo(t3,i2)})]},t3))]})}var Po=50,Fo=["project","process","run","node","event"],Io=e2=>typeof e2=="string"&&e2.trim()!=="",Lo=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&Io(e3.name)).slice(0,Po),Ro=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&Io(e3.name)).slice(0,Po),zo=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3=="object"&&Fo.includes(e3.kind)&&typeof e3.id=="string"&&Io(e3.label)).slice(0,Po);function Bo(e2){let t2=Lo(e2.people),n2=Ro(e2.assignees),r2=zo(e2.linkCandidates),[i2,a2]=p(new Set((Array.isArray(e2.attendeeIds)?e2.attendeeIds:[]).filter(e3=>typeof e3=="string"))),[o2,s2]=p(typeof e2.assigneeId=="string"&&n2.some(t3=>t3.id===e2.assigneeId)?e2.assigneeId:""),[c2,l2]=p(()=>zo(e2.links).slice(0,10)),u2=t2.filter(e3=>i2.has(e3.id)),d2=n2.find(e3=>e3.id===o2),f2=r2.length>0?c2:[];return{people:t2,assignees:n2,candidates:r2,guests:i2,setGuests:a2,assigneeId:o2,setAssigneeId:s2,links:f2,setLinks:l2,picked:u2,assignee:d2,write(e3){u2.length&&(e3.attendeeIds=u2.map(e4=>e4.id)),d2&&(e3.assigneeId=d2.id),f2.length&&(e3.links=f2.slice(0,10).map(e4=>({kind:e4.kind,id:e4.id})))}}}function Vo({extras:e2,disabled:t2}){let n2=c(),{people:r2,assignees:i2,candidates:a2,guests:o2,setGuests:s2,assigneeId:l2,setAssigneeId:u2,links:d2,setLinks:f2}=e2,p2=a2.filter(e3=>!d2.some(t3=>t3.kind===e3.kind&&t3.id===e3.id));return _(h,{children:[r2.length>0?_("fieldset",{className:"core-intent-card__people",disabled:t2,children:[g("legend",{className:"core-intent-card__label",children:"Attendees (optional)"}),r2.map(e3=>_("label",{className:"core-intent-card__person",children:[g("input",{type:"checkbox",checked:o2.has(e3.id),onChange:t3=>s2(n3=>t3.target.checked?new Set([...n3,e3.id]):new Set([...n3].filter(t4=>t4!==e3.id)))}),g("span",{className:"core-intent-card__person-name",children:e3.name}),e3.role?g("span",{className:"core-intent-card__person-role",children:X(e3.role)}):null]},e3.id))]}):null,i2.length>0?g("div",{className:"core-intent-card__row",children:_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Assigned to (optional)"}),_("select",{value:l2,disabled:t2,onChange:e3=>u2(e3.target.value),children:[g("option",{value:"",children:"No one"}),i2.map(e3=>g("option",{value:e3.id,children:e3.name},e3.id))]})]})}):null,a2.length>0?_("fieldset",{className:"core-intent-card__links",disabled:t2,children:[g("legend",{className:"core-intent-card__label",children:"Linked to (optional)"}),d2.length>0?g("ul",{className:"core-intent-card__chips",children:d2.map(e3=>_("li",{className:"core-intent-card__chip",children:[g("span",{className:"core-intent-card__chip-label",children:e3.label}),g("button",{type:"button",className:"core-intent-card__chip-remove","aria-label":`Remove link: ${e3.label}`,onClick:()=>f2(t3=>t3.filter(t4=>t4.kind!==e3.kind||t4.id!==e3.id)),children:g("span",{"aria-hidden":"true",children:"×"})})]},`${e3.kind}:${e3.id}`))}):null,p2.length>0&&d2.length<10?_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",id:`${n2}-add`,children:"Add a link"}),_("select",{"aria-labelledby":`${n2}-add`,value:"",onChange:e3=>{let t3=p2.find(t4=>`${t4.kind}:${t4.id}`===e3.target.value);t3&&f2(e4=>[...e4,t3])},children:[g("option",{value:"",children:"Choose…"}),p2.map(e3=>g("option",{value:`${e3.kind}:${e3.id}`,children:e3.label},`${e3.kind}:${e3.id}`))]})]}):null]}):null]})}var Ho=[5,10,15,20,30,45,60,90],Uo={line:300,note:2e3},Wo=(e2,t2)=>typeof e2=="string"?e2.slice(0,t2):"";function Go(e2){if(!e2)return At();let t2=new Date(e2);return Number.isNaN(t2.getTime())?At():(t2.setMinutes(t2.getMinutes()-t2.getTimezoneOffset()),t2.toISOString().slice(0,16))}function Ko(e2){let{canWriteStaffNotes:t2=false,onIntent:n2,className:r2,style:i2}=e2,a2=X(e2.subjectName),o2=Array.isArray(e2.types)?e2.types.filter(e3=>e3&&typeof e3.id=="string"):[],l2=e2.prefill&&typeof e2.prefill=="object"?e2.prefill:{},u2=c(),{run:d2,busy:m2,message:h2,available:v2}=Lt(n2),[y2,x2]=p(o2.find(e3=>e3.id===l2.typeId)?.id??o2[0]?.id??""),S2=Oo(o2.find(e3=>e3.id===y2)),C2=Ao(S2),[w2,T2]=p(Go(l2.startsAt)),[E2,D2]=p(typeof l2.durationMin=="number"&&l2.durationMin>0?String(Math.round(l2.durationMin)):""),O2=Bo({people:e2.people,assignees:e2.assignees,linkCandidates:e2.linkCandidates,links:e2.links,attendeeIds:l2.attendeeIds}),[k2,A2]=p(Wo(l2.outcome,Uo.line)),[j2,M2]=p(Wo(l2.followUp,Uo.line)),[N2,P2]=p(Wo(l2.note,Uo.note)),[F2,I2]=p(t2),[L2,R2]=p(null),z2=f(null);s(()=>{L2&&z2.current?.focus({preventScroll:true})},[L2]);let B2=L2??(e2.logged&&typeof e2.logged=="object"?e2.logged:null);if(B2){let e3=Rt(B2.href);return _("div",{ref:z2,tabIndex:-1,role:"group","aria-labelledby":`${u2}-status`,className:b("core-intent-card","core-log-card",r2),style:i2,"data-state":"logged",children:[_("div",{className:"core-intent-card__head",children:[_("span",{id:`${u2}-status`,className:"core-intent-card__eyebrow",children:["Logged",a2?` · ${a2}`:""]}),g("p",{className:"core-intent-card__title",children:B2.name??"Logged"})]}),e3?g("a",{className:"core-log-card__go",href:e3,children:"Go to event"}):null]})}if(o2.length===0)return g("p",{className:b("core-intent-card","core-log-card","core-log-card__empty",r2),style:i2,children:"There’s nothing you can log here."});let ee2=o2.find(e3=>e3.id===y2),V2=v2&&m2===null,H2=v2&&!!a2&&!!ee2&&!!w2,U2=v2?a2?"":"Choose who this is about before logging.":It,W2=async e3=>{if(e3.preventDefault(),!H2||m2!==null||!ee2)return;let n3={typeId:ee2.id,startsAt:kt(w2),tzid:Ot()};C2.value&&(n3.audience=C2.value),E2&&(n3.durationMin=Number(E2)),O2.write(n3),k2.trim()&&(n3.outcome=k2.trim()),j2.trim()&&(n3.followUp=j2.trim()),N2.trim()&&(n3.note=N2.trim(),n3.staffOnly=t2&&F2);let{ok:r3,result:i3}=await d2("log_event",n3);r3&&R2({name:ee2.name,href:i3&&typeof i3=="object"?i3.data?.href:void 0})},G2=!V2;return _("form",{className:b("core-intent-card","core-log-card",r2),style:i2,"data-state":v2?"editing":"display",onSubmit:e3=>void W2(e3),"aria-busy":m2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[g("span",{className:"core-intent-card__eyebrow",children:"Log"}),g("p",{className:"core-intent-card__title",children:a2??"Who is this about?"})]}),_("div",{className:"core-intent-card__row",children:[_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Type"}),g("select",{value:y2,disabled:G2,onChange:e3=>x2(e3.target.value),children:o2.map(e3=>g("option",{value:e3.id,children:e3.name},e3.id))})]}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"When"}),g("input",{type:"datetime-local",required:true,value:w2,readOnly:G2,onChange:e3=>T2(e3.target.value)})]})]}),g("div",{className:"core-intent-card__row",children:_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"How long"}),_("select",{value:E2,disabled:G2,onChange:e3=>D2(e3.target.value),children:[g("option",{value:"",children:"—"}),[...new Set([...Ho,...E2?[Number(E2)]:[]])].sort((e3,t3)=>e3-t3).map(e3=>g("option",{value:e3,children:`${e3} min`},e3))]})]})}),g(Vo,{extras:O2,disabled:G2}),g(No,{id:u2,audiences:S2,value:C2.value,onChange:C2.setValue,subjectName:a2,disabled:G2}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Outcome"}),g("input",{value:k2,maxLength:Uo.line,readOnly:G2,onChange:e3=>A2(e3.target.value)})]}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Follow-up"}),g("input",{value:j2,maxLength:Uo.line,readOnly:G2,onChange:e3=>M2(e3.target.value)})]}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Note"}),g("textarea",{rows:Math.min(10,Math.max(2,N2.split("\n").length+Math.floor(N2.length/40))),maxLength:Uo.note,value:N2,readOnly:G2,onChange:e3=>P2(e3.target.value)})]}),t2&&N2.trim()?_("label",{className:"core-log-card__check",children:[g("input",{type:"checkbox",checked:F2,disabled:G2,onChange:e3=>I2(e3.target.checked)}),g("span",{children:"Staff only: the client won’t see this note"})]}):null,h2?g("p",{id:`${u2}-message`,className:"core-intent-card__message",role:"alert",children:h2}):null,g("p",{className:"core-intent-card__does",id:`${u2}-does`,children:H2?`Log saves this to ${a2}’s file.`:U2}),g("div",{className:"core-intent-card__actions",children:g("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!H2||m2!==null,"aria-describedby":`${u2}-does`,children:m2==="log_event"?"Logging…":"Log"})})]})}var qo=250,Jo=500,Yo=(e2,t2)=>{let n2=t2.trim().toLowerCase();return n2===""||e2.label.toLowerCase().includes(n2)||!!e2.description?.toLowerCase().includes(n2)};function Xo({label:e2,options:t2,loadOptions:n2,value:r2,defaultValue:i2="",onValueChange:o2,onSelect:l2,orientation:d2="vertical",debounceMs:m2=150,minChars:h2=0,closeOnSelect:g2=true,fillOnSelect:_2=false,openOnFocus:v2=false,defaultOpen:y2=false,emptyText:b2="No results",errorText:x2="Could not load results"}){let S2=c(),C2=`${S2}-list`,[w2,T2]=p(i2),E2=r2??w2,[D2,O2]=p(y2),[k2,A2]=p(y2),[j2,M2]=p([]),[N2,P2]=p("idle"),[F2,I2]=p(null),[L2,R2]=p(""),z2=f(0),B2=f({onValueChange:o2,onSelect:l2,loadOptions:n2});B2.current={onValueChange:o2,onSelect:l2,loadOptions:n2};let ee2=u(()=>n2?j2:(t2??[]).filter(e3=>Yo(e3,E2)),[n2,j2,t2,E2]),V2=!!n2,H2=E2.trim().length>=h2,U2=H2?ee2:[];s(()=>{if(!V2||!D2)return;if(!H2){z2.current+=1,M2([]),P2("idle");return}let e3=++z2.current,t3=new AbortController;P2("loading");let n3=setTimeout(()=>{B2.current.loadOptions?.(E2,t3.signal).then(t4=>{e3===z2.current&&(M2(t4),P2(t4.length?"ready":"empty"))},t4=>{e3===z2.current&&t4?.name!=="AbortError"&&(M2([]),P2("error"))})},m2);return()=>{clearTimeout(n3),t3.abort()}},[E2,D2,H2,V2,m2]);let W2=V2?N2:!D2||!H2?"idle":U2.length?"ready":"empty";s(()=>{F2!==null&&!U2.some(e3=>e3.id===F2)&&I2(null)},[U2,F2]),s(()=>{if(!k2||W2==="idle"){R2("");return}let e3=E2.trim().slice(0,60),t3=W2==="loading"?"Loading results":W2==="error"?x2.split("{query}").join(e3):W2==="empty"?b2.split("{query}").join(e3):`${U2.length} ${U2.length===1?"result":"results"}`,n3=setTimeout(()=>R2(t3),W2==="loading"?Jo:qo);return()=>clearTimeout(n3)},[W2,U2.length,k2,E2,b2,x2]);let G2=a(e3=>{r2===void 0&&T2(e3),B2.current.onValueChange?.(e3)},[r2]),K2=a(()=>{A2(false),I2(null)},[]),te2=a(e3=>{e3.disabled||(_2&&G2(e3.label),B2.current.onSelect?.(e3),g2&&K2())},[_2,G2,g2,K2]),ne2=e3=>`${S2}-opt-${e3.id}`,re2=k2&&U2.length>0,ie2=re2?U2.find(e3=>e3.id===F2):void 0,q2=e3=>{if(U2.length===0)return;let t3=U2.filter(e4=>!e4.disabled);if(t3.length===0)return;let n3=t3.findIndex(e4=>e4.id===F2),r3=n3<0?e3===1?0:t3.length-1:(n3+e3+t3.length)%t3.length;I2(t3[r3].id)};return{options:U2,status:W2,statusText:L2,open:re2,activeId:F2,close:K2,inputProps:{role:"combobox","aria-label":e2,"aria-expanded":re2,"aria-controls":C2,"aria-autocomplete":"list","aria-activedescendant":ie2?ne2(ie2):void 0,autoComplete:"off",value:E2,onChange:e3=>{O2(true),A2(true),I2(null),G2(e3.target.value)},onKeyDown:e3=>{if(e3.nativeEvent.isComposing||e3.altKey||e3.ctrlKey||e3.metaKey)return;let t3=d2==="horizontal"?"ArrowRight":"ArrowDown",n3=d2==="horizontal"?"ArrowLeft":"ArrowUp";e3.key==="ArrowDown"||e3.key==="ArrowUp"?(e3.preventDefault(),O2(true),k2?q2(e3.key==="ArrowDown"?1:-1):A2(true)):(e3.key===t3||e3.key===n3)&&re2&&ie2?(e3.preventDefault(),q2(e3.key===t3?1:-1)):e3.key==="Enter"&&ie2?(e3.preventDefault(),te2(ie2)):e3.key==="Escape"&&k2?(e3.preventDefault(),e3.stopPropagation(),K2()):e3.key==="Tab"&&K2()},onFocus:()=>{v2&&(O2(true),A2(true))},onBlur:()=>K2()},listboxProps:{id:C2,role:"listbox","aria-label":e2,"aria-orientation":d2},statusProps:{role:"status","aria-live":"polite","aria-atomic":true},getOptionProps:e3=>({id:ne2(e3),role:"option","aria-selected":e3.id===ie2?.id,"aria-disabled":e3.disabled||void 0,"data-active":e3.id===ie2?.id?"":void 0,onPointerDown:e4=>e4.preventDefault(),onClick:()=>te2(e3)}),query:E2}}function Zo({text:e2,match:t2}){let n2=t2?e2.toLowerCase().indexOf(t2.trim().toLowerCase()):-1;if(n2<0||!t2.trim())return g(h,{children:e2});let r2=n2+t2.trim().length;return _(h,{children:[e2.slice(0,n2),g("mark",{className:"core-combobox__match",children:e2.slice(n2,r2)}),e2.slice(r2)]})}function Qo({placeholder:e2,emptyText:t2="No results",errorText:n2="Could not load results",renderOption:r2,className:i2,style:a2,...o2}){let l2=Xo({...o2,emptyText:t2,errorText:n2}),u2=l2.query.trim().slice(0,60),d2=f(null),p2=o2.orientation==="horizontal",m2=c(),v2=[];for(let e3 of l2.options){let t3=p2?void 0:e3.group,n3=v2[v2.length-1];n3&&n3.group===t3?n3.options.push(e3):v2.push({group:t3,options:[e3]})}s(()=>{l2.activeId!==null&&d2.current?.querySelector("[data-active]")?.scrollIntoView({block:"nearest",inline:"nearest"})},[l2.activeId]);let y2=l2.status==="empty"?t2.split("{query}").join(u2):l2.status==="error"?n2.split("{query}").join(u2):l2.status==="loading"?"Loading…":null;return _("div",{className:b("core-combobox",i2),style:a2,"data-orientation":o2.orientation??"vertical","data-status":l2.status,children:[g("input",{...l2.inputProps,type:"text",className:"core-combobox__input",placeholder:e2}),g("ul",{ref:d2,...l2.listboxProps,className:"core-combobox__list",hidden:!l2.open,children:v2.map((e3,t3)=>{let n3=e3.options.map(e4=>g("li",{...l2.getOptionProps(e4),className:"core-combobox__option",children:r2?r2(e4,l2.query):_(h,{children:[g("span",{className:"core-combobox__label",children:g(Zo,{text:e4.label,match:e4.highlight??l2.query})}),e4.description?g("span",{className:"core-combobox__description",children:e4.description}):null]})},e4.id));return e3.group?_("li",{role:"presentation",className:"core-combobox__section",children:[g("span",{id:`${m2}-${t3}`,className:"core-combobox__heading",children:e3.group}),g("ul",{role:"group","aria-labelledby":`${m2}-${t3}`,className:"core-combobox__group",children:n3})]},`g${t3}`):n3})}),y2&&!l2.open?g("p",{className:"core-combobox__note","data-status":l2.status,"aria-hidden":"true",children:y2}):null,g("span",{...l2.statusProps,className:"core-combobox__status",children:l2.statusText})]})}var $o=["saved","assigned","event","archived","discarded","unavailable"],es=6e3;function ts(e2){let{locale:t2,timeZone:n2,searchTargets:r2,onIntent:i2,className:a2,style:o2}=e2,l2=e2.note&&typeof e2.note=="object"&&(e2.note.state==="unavailable"||typeof e2.note.body=="string")?e2.note:null,u2=c(),{run:d2,busy:m2,message:v2,available:y2}=Lt(i2),[x2,S2]=p(null),C2=l2?.state&&$o.includes(l2.state)?l2.state:"saved",w2=x2&&C2==="saved"?x2:C2,[T2,E2]=p(false),D2=f(null),O2=f(null),k2=f(null);s(()=>()=>{D2.current&&clearTimeout(D2.current),O2.current?.()},[]),s(()=>{T2&&k2.current?.focus({preventScroll:true})},[T2]);let[A2,j2]=p(false),[M2,N2]=p(false),P2=f(null);s(()=>{M2&&P2.current?.focus({preventScroll:true})},[M2]);let[F2,I2]=p(void 0),[L2,R2]=p(false),z2=f(null);if(s(()=>{x2&&z2.current?.focus({preventScroll:true})},[x2]),!l2)return null;if(C2==="unavailable")return g("div",{role:"group","aria-label":"Note",className:b("core-intent-card","core-quick-note-card","core-note-card",a2),style:o2,"data-state":"unavailable",children:g("p",{className:"core-note-card__unavailable",children:"This note is no longer available"})});let B2=w2==="saved"&&!T2,ee2=l2.createdAt&&!Number.isNaN(new Date(l2.createdAt).getTime())?new Intl.DateTimeFormat(t2,{weekday:"short",hour:"numeric",minute:"2-digit",timeZone:n2}).format(new Date(l2.createdAt)):"",V2=Rt(l2.eventHref),H2=m2===null,U2=async e3=>{let{ok:t3}=await d2("assign",{targetId:e3.id,...A2?{keepPrivate:true}:{},...e3.data&&typeof e3.data=="object"&&"kind"in e3.data?{targetKind:e3.data.kind}:{}});t3&&(I2(e3.label),S2("assigned"),R2(false))},W2=async()=>{let{ok:e3}=await d2("make_event");e3&&S2("started")},G2=()=>{let e3=async()=>{O2.current=null,D2.current=null;let{ok:e4}=await d2("archive");E2(false),e4&&S2("archived")};O2.current=()=>void e3(),D2.current=setTimeout(()=>void e3(),es),E2(true)},K2=()=>{D2.current&&clearTimeout(D2.current),D2.current=null,O2.current=null,E2(false)},te2=async()=>{let{ok:e3}=await d2("discard");N2(false),e3&&S2("discarded")},ne2=async()=>{let{ok:e3}=await d2("ask_instead");e3&&S2("asked")},re2=T2?"Archived":B2?"Saved as note":w2==="asked"?"Sent to the assistant instead":w2==="assigned"?`Assigned${F2??l2.assignedToName?` to ${F2??l2.assignedToName}`:""}`:w2==="event"?"Made into an event":w2==="started"?"Event started below":w2==="discarded"?"Discarded":"Archived";return _("div",{ref:z2,tabIndex:-1,role:"group","aria-labelledby":`${u2}-status`,className:b("core-intent-card","core-quick-note-card","core-note-card",a2),style:o2,"data-state":T2?"archived":w2,"aria-busy":m2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[g("span",{id:`${u2}-status`,className:"core-intent-card__eyebrow",children:re2}),g("p",{className:"core-note-card__body",children:l2.body}),_("span",{className:"core-note-card__private",children:["Private",ee2?` · saved ${ee2}`:""]})]}),w2==="event"&&V2?g("a",{className:"core-note-card__go",href:V2,children:"Go to event"}):null,v2?g("p",{className:"core-intent-card__message",role:"alert",children:v2}):null,T2?g("div",{className:"core-intent-card__actions",children:g("button",{ref:k2,type:"button",className:"core-intent-card__button",onClick:K2,children:"Undo"})}):null,B2?_(h,{children:[L2&&r2?_("div",{className:"core-note-card__picker",children:[g(Qo,{label:"Assign to a client or project",placeholder:"Search clients and projects",loadOptions:r2,onSelect:e3=>void U2(e3),defaultOpen:false}),_("label",{className:"core-note-card__private-check",children:[g("input",{type:"checkbox",checked:A2,disabled:!H2,onChange:e3=>j2(e3.target.checked)}),g("span",{children:"Keep this note private"})]})]}):null,g("p",{className:"core-intent-card__does",id:`${u2}-does`,children:(e3=>y2?e3:It)("Assign moves this note to the client or project you choose. Make event turns it into an event. Archive takes it out of Needs me, and you can undo it for a few seconds. Discard deletes it for good.")}),_("div",{className:"core-intent-card__actions",children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!y2||!r2||!H2,"aria-expanded":L2,"aria-describedby":`${u2}-does`,onClick:()=>R2(e3=>!e3),children:"Assign"}),g("button",{type:"button",className:"core-intent-card__button",disabled:!y2||!H2,"aria-describedby":`${u2}-does`,onClick:()=>void W2(),children:"Make event"}),g("button",{type:"button",className:"core-intent-card__button",disabled:!y2||!H2,"aria-describedby":`${u2}-does`,onClick:G2,children:"Archive"}),g("button",{type:"button",className:"core-intent-card__button",disabled:!y2||!H2,"aria-describedby":`${u2}-does`,onClick:()=>N2(true),children:"Discard"})]}),M2?_("div",{className:"core-note-card__confirm",role:"group","aria-label":"Discard this note",children:[g("p",{className:"core-intent-card__does",children:"Discard this note? It can’t be brought back from here."}),_("div",{className:"core-intent-card__actions",children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!H2,onClick:()=>void te2(),children:m2==="discard"?"Discarding…":"Yes, discard"}),g("button",{ref:P2,type:"button",className:"core-intent-card__button",disabled:!H2,onClick:()=>N2(false),children:"Cancel"})]})]}):null,g("button",{type:"button",className:"core-note-card__instead",disabled:!y2||!H2,onClick:()=>void ne2(),children:"Ask the assistant instead"})]}):null]})}var ns=[15,30,45,60,90],rs=30,is=200,as=3,os=e2=>e2%60==0&&e2>=60?`${e2/60} h`:`${e2} min`;function ss(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,o2=X(e2.subjectName),l2=(Array.isArray(e2.types)?e2.types:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&typeof e3.name=="string"&&e3.name.trim()!==""&&e3.kind!=="record"),u2=e2.prefill&&typeof e2.prefill=="object"?e2.prefill:{},d2=c(),{run:m2,busy:v2,message:y2,available:x2}=Lt(r2),S2=co(u2.startsAt,n2),[C2,w2]=p(l2.find(e3=>e3.id===u2.typeId)?.id??l2[0]?.id??""),[T2,E2]=p((typeof u2.title=="string"?u2.title:"").slice(0,is)),D2=n2??Ot(),O2=!(typeof u2.startOn=="string"&&$.test(u2.startOn))&&!S2,[k2,A2]=p(typeof u2.startOn=="string"&&$.test(u2.startOn)?u2.startOn:S2?.date??po(D2)),[j2,M2]=p(S2?.time??""),[N2,P2]=p(String(typeof u2.durationMin=="number"&&u2.durationMin>0?Math.round(u2.durationMin):rs)),F2=Bo({people:e2.people,assignees:e2.assignees,linkCandidates:e2.linkCandidates,links:e2.links,attendeeIds:u2.attendeeIds}),I2=Oo(l2.find(e3=>e3.id===C2)),L2=Ao(I2),[R2,z2]=p(false),[B2,ee2]=p(null),V2=f(null),H2=f(null),U2=f(false);s(()=>{if(U2.current)return;if(O2){A2(po(D2));return}if(!u2.startsAt)return;let e3=co(u2.startsAt,n2);e3&&(A2(e3.date),M2(e3.time))},[u2.startsAt,n2,O2,D2]),s(()=>{R2&&H2.current?.focus({preventScroll:true})},[R2]),s(()=>{B2&&V2.current?.focus({preventScroll:true})},[B2]);let W2=B2??(e2.booked&&typeof e2.booked=="object"?e2.booked:null);if(W2){let e3=Rt(W2.href);return _("section",{ref:V2,tabIndex:-1,"aria-labelledby":`${d2}-status`,className:b("core-intent-card","core-book-event-card",i2),style:a2,"data-state":"booked",children:[_("div",{className:"core-intent-card__head",children:[_("span",{id:`${d2}-status`,className:"core-intent-card__eyebrow",children:["Booked",o2?` · ${o2}`:""]}),g("p",{className:"core-intent-card__title",children:W2.name??"Booked"}),W2.when?g("span",{className:"core-book-event-card__when",children:W2.when}):null]}),e3?g("a",{className:"core-book-event-card__go",href:e3,children:"Go to event"}):null]})}if(l2.length===0)return g("p",{className:b("core-intent-card","core-book-event-card","core-book-event-card__empty",i2),style:a2,children:"There’s nothing you can book here."});let G2=l2.find(e3=>e3.id===C2),K2=x2&&v2===null,te2=x2&&!!o2&&!!G2&&$.test(k2),ne2=x2?o2?k2?"":"Choose a day to book.":"Choose whose file this goes in first.":It,re2=$.test(k2)&&/^\d{2}:\d{2}$/.test(j2),ie2=re2?fo(k2,j2,D2):void 0,q2=Number(N2),ae2=ie2?new Date(ie2).getTime()<Date.now():$.test(k2)?k2<new Intl.DateTimeFormat("en-CA").format(new Date):false,oe2=[...new Set([...ns,...Number.isInteger(q2)&&q2>0?[q2]:[]])].sort((e3,t3)=>e3-t3),se2=F2.picked,ce2=`${oo(k2,t2)}${re2?`, ${so(j2,t2)}`:""}`,le2=re2?` (${os(q2||rs)})`:" (all day)",ue2=se2.length?` With ${se2.slice(0,as).map(e3=>e3.name).join(", ")}${se2.length>as?` and ${se2.length-as} more`:""}.`:"",de2=F2.assignee,fe2=`Book this? It goes on the schedule for ${ce2}${le2}.${ue2}${de2?` Assigned to ${de2.name}.`:""}${Mo(L2.value)}${e2.invitesSent===true&&se2.length?" They are invited.":""}`,pe2=async()=>{if(!te2||v2!==null||!G2)return;let e3={typeId:G2.id};T2.trim()&&(e3.title=T2.trim()),e3.tzid=D2,ie2?(e3.startsAt=ie2,e3.durationMin=q2>0?q2:rs):e3.startOn=k2,L2.value&&(e3.audience=L2.value),F2.write(e3);let{ok:t3,result:n3}=await m2("book_event",e3);z2(false),t3&&ee2({name:T2.trim()||G2.name,when:ce2,href:n3&&typeof n3=="object"?n3.data?.href:void 0})},me2=e3=>{e3.preventDefault(),te2&&v2===null&&z2(true)},he2=e3=>t3=>{U2.current=true,e3(t3)};return _("form",{tabIndex:-1,ref:V2,"aria-labelledby":`${d2}-status`,className:b("core-intent-card","core-book-event-card",i2),style:a2,"data-state":R2?"confirming":"proposed",onSubmit:me2,"aria-busy":v2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:_("span",{id:`${d2}-status`,className:"core-intent-card__eyebrow",children:["Book a meeting",o2?` · ${o2}`:""]})}),_("div",{className:"core-intent-card__row",children:[l2.length>1?_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Type"}),g("select",{value:C2,disabled:!K2||R2,onChange:e3=>w2(e3.target.value),children:l2.map(e3=>g("option",{value:e3.id,children:e3.name},e3.id))})]}):null,_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Title (optional)"}),g("input",{value:T2,maxLength:is,readOnly:!K2||R2,placeholder:G2?.name,onChange:e3=>E2(e3.target.value)})]})]}),_("div",{className:"core-intent-card__row",children:[_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Day"}),g("input",{type:"date",value:k2,required:true,readOnly:!K2||R2,onChange:e3=>he2(A2)(e3.target.value)})]}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Time (optional)"}),g("input",{type:"time",value:k2?j2:"",readOnly:!K2||R2,disabled:!k2,onChange:e3=>he2(M2)(e3.target.value)})]})]}),g("div",{className:"core-intent-card__row",children:_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"How long"}),g("select",{value:N2,disabled:!K2||R2||!re2,onChange:e3=>P2(e3.target.value),children:oe2.map(e3=>g("option",{value:e3,children:os(e3)},e3))})]})}),g(Vo,{extras:F2,disabled:!K2||R2}),g(No,{id:d2,audiences:I2,value:L2.value,onChange:L2.setValue,subjectName:o2,disabled:!K2||R2}),ae2&&!R2?g("p",{className:"core-book-event-card__note",children:"That time has passed."}):null,y2?g("p",{className:"core-intent-card__message",role:"alert",children:y2}):null,R2?_(h,{children:[g("p",{className:"core-intent-card__does",id:`${d2}-does`,role:"group","aria-label":"Confirm booking",children:fe2}),_("div",{className:"core-intent-card__actions",children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:v2!==null,onClick:()=>void pe2(),children:v2==="book_event"?"Booking…":"Yes, book"}),g("button",{ref:H2,type:"button",className:"core-intent-card__button",disabled:v2!==null,onClick:()=>z2(false),children:"Cancel"})]},"confirm-actions")]}):_(h,{children:[ne2?g("p",{className:"core-intent-card__does",id:`${d2}-does`,children:ne2}):null,g("div",{className:"core-intent-card__actions",children:g("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!te2||v2!==null,"aria-describedby":ne2?`${d2}-does`:void 0,children:"Book"})},"book-actions")]})]})}var cs=[15,30,45,60,90],ls=30,us=200,ds=200,fs=e2=>e2%60==0&&e2>=60?`${e2/60} h`:`${e2} min`,ps={title:"title",name:"title",startsAt:"when",startOn:"when",date:"when",time:"when",durationMin:"duration",assigneeId:"assignee",location:"location",audience:"audience"};function ms(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,o2=X(e2.subjectName),l2=e2.current&&typeof e2.current=="object"?e2.current:{},u2=e2.prefill&&typeof e2.prefill=="object"?e2.prefill:{},d2=c(),{run:m2,busy:v2,message:y2,available:x2}=Lt(r2),S2=n2??l2.tzid??Ot(),C2=co(l2.startsAt,S2),w2=C2?.date??(typeof l2.startOn=="string"&&$.test(l2.startOn)?l2.startOn:""),T2=C2?.time??"",E2=typeof l2.durationMin=="number"&&l2.durationMin>0?Math.round(l2.durationMin):ls,D2=(typeof l2.name=="string"?l2.name:"").slice(0,us),O2=(Array.isArray(e2.assignees)?e2.assignees:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&typeof e3.name=="string"),k2=l2.assigneeId?O2.find(e3=>e3.id===l2.assigneeId)?.id??"":O2.find(e3=>e3.name===l2.assigneeName)?.id??"",A2=co(u2.startsAt,S2),j2=typeof u2.startOn=="string"&&$.test(u2.startOn)?u2.startOn:void 0,[M2,N2]=p(typeof u2.title=="string"?u2.title.slice(0,us):D2),[P2,F2]=p(A2?.date??j2??w2),[I2,L2]=p(A2?A2.time:j2?"":T2),R2=(typeof l2.location=="string"?l2.location:"").slice(0,ds),[z2,B2]=p(typeof u2.location=="string"?u2.location.slice(0,ds):R2),[ee2,V2]=p(String(typeof u2.durationMin=="number"&&u2.durationMin>0?Math.round(u2.durationMin):E2)),H2=Bo({assignees:O2,assigneeId:typeof u2.assigneeId=="string"?u2.assigneeId:k2}),U2=Oo((Array.isArray(e2.types)?e2.types:[]).find(e3=>e3&&typeof e3=="object"&&(e3.id===l2.typeId||!l2.typeId&&e3.name===l2.typeName))),W2=Ao(U2,U2.includes(l2.audience)?l2.audience:"team"),[G2,K2]=p(false),[te2,ne2]=p(null),re2=f(null),ie2=f(null);s(()=>{G2&&ie2.current?.focus({preventScroll:true})},[G2]),s(()=>{te2&&re2.current?.focus({preventScroll:true})},[te2]);let q2=te2??(e2.updated&&typeof e2.updated=="object"?{kind:"updated",...e2.updated}:e2.cancelled&&typeof e2.cancelled=="object"?{kind:"cancelled",...e2.cancelled}:e2.assigned&&typeof e2.assigned=="object"?{kind:"assigned",...e2.assigned}:l2.status==="cancelled"?{kind:"cancelled",name:l2.name}:null);if(q2){let e3=q2.kind==="updated"?Rt(q2.href):void 0;return _("section",{ref:re2,tabIndex:-1,"aria-labelledby":`${d2}-status`,className:b("core-intent-card","core-book-event-card","core-edit-event-card",i2),style:a2,"data-state":q2.kind,children:[_("div",{className:"core-intent-card__head",children:[_("span",{id:`${d2}-status`,className:"core-intent-card__eyebrow",children:[q2.kind==="updated"?"Updated":q2.kind==="assigned"?"Assigned to you":"Cancelled",o2?` · ${o2}`:""]}),g("p",{className:b("core-intent-card__title",q2.kind==="cancelled"&&"core-edit-event-card__struck"),children:q2.name??l2.name??"Done"})]}),e3?g("a",{className:"core-book-event-card__go",href:e3,children:"Go to event"}):null]})}let ae2=!(x2&&v2===null)||G2,oe2=$.test(P2)&&/^\d{2}:\d{2}$/.test(I2),se2=Number(ee2),ce2=[...new Set([...cs,...Number.isInteger(se2)&&se2>0?[se2]:[],E2])].sort((e3,t3)=>e3-t3),le2=new Set((Array.isArray(e2.changed)?e2.changed:[]).map(e3=>ps[e3]).filter(Boolean)),ue2=P2!==w2||I2!==T2,de2=oe2&&se2!==E2,fe2=H2.assigneeId!==k2,pe2=W2.value!==void 0&&W2.value!==(U2.includes(l2.audience)?l2.audience:"team"),me2=M2.trim()!==D2.trim(),he2=z2.trim()!==R2.trim(),J2={title:me2||le2.has("title"),when:ue2||le2.has("when"),duration:de2||le2.has("duration"),location:he2||le2.has("location"),assignee:fe2||le2.has("assignee"),audience:pe2||le2.has("audience")},ge2=me2||ue2||de2||he2||fe2||pe2,_e2=x2&&!!$.test(P2)&&M2.trim()!==""&&ge2,ve2=x2?M2.trim()?$.test(P2)?ge2?"":"Change something to save it.":"Choose a day.":"The event needs a title.":It,ye2=w2?`${oo(w2,t2)}${T2?`, ${so(T2,t2)}`:" (all day)"}`:"No time set",be2=(e3,t3,n3)=>J2[e3]?_("span",{className:"core-edit-event-card__was",id:n3,children:[g("span",{className:"core-edit-event-card__was-label",children:"Was"})," ",t3]}):null,xe2=e3=>b("core-intent-card__field",J2[e3]&&"core-edit-event-card__changed"),Se2=async()=>{if(!_e2||v2!==null)return;let e3={};me2&&(e3.title=M2.trim()),ue2&&(S2!==l2.tzid&&(e3.tzid=S2),oe2?e3.startsAt=fo(P2,I2,S2):e3.startOn=P2),de2&&(e3.durationMin=se2>0?se2:ls),he2&&(e3.location=z2.trim()),fe2&&(e3.assigneeId=H2.assigneeId===""?null:H2.assigneeId),pe2&&W2.value&&(e3.audience=W2.value);let{ok:t3,result:n3}=await m2("update_event",e3);t3&&ne2({kind:"updated",name:M2.trim()||D2,href:n3&&typeof n3=="object"?n3.data?.href:void 0})},Ce2=!l2.assigneeId&&!l2.assigneeName,we2=async()=>{if(v2!==null)return;let{ok:e3}=await m2("assign_self");e3&&ne2({kind:"assigned",name:D2})},Te2=async()=>{if(v2!==null)return;let{ok:e3}=await m2("cancel_event");K2(false),e3&&ne2({kind:"cancelled",name:D2})};return _("form",{tabIndex:-1,ref:re2,"aria-labelledby":`${d2}-status`,className:b("core-intent-card","core-book-event-card","core-edit-event-card",i2),style:a2,"data-state":G2?"cancelling":"editing",onSubmit:e3=>{e3.preventDefault(),_e2&&v2===null&&Se2()},"aria-busy":v2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:_("span",{id:`${d2}-status`,className:"core-intent-card__eyebrow",children:["Change a meeting",o2?` · ${o2}`:""]})}),_("div",{className:"core-intent-card__row",children:[l2.typeName?_("div",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Type"}),g("span",{className:"core-edit-event-card__fixed",children:l2.typeName})]}):null,_("div",{className:xe2("title"),"data-changed":J2.title?"":void 0,children:[g("label",{className:"core-intent-card__label",htmlFor:`${d2}-title`,children:"Title"}),g("input",{id:`${d2}-title`,value:M2,maxLength:us,readOnly:ae2,placeholder:l2.typeName,"aria-describedby":J2.title?`${d2}-title-was`:void 0,onChange:e3=>N2(e3.target.value)}),be2("title",D2||"No title",`${d2}-title-was`)]})]}),_("div",{className:"core-intent-card__row",children:[_("div",{className:xe2("when"),"data-changed":J2.when?"":void 0,children:[g("label",{className:"core-intent-card__label",htmlFor:`${d2}-day`,children:"Day"}),g("input",{id:`${d2}-day`,type:"date",value:P2,required:true,readOnly:ae2,"aria-describedby":J2.when?`${d2}-when-was`:void 0,onChange:e3=>F2(e3.target.value)}),be2("when",ye2,`${d2}-when-was`)]}),_("div",{className:xe2("when"),"data-changed":J2.when?"":void 0,children:[g("label",{className:"core-intent-card__label",htmlFor:`${d2}-time`,children:"Time (optional)"}),g("input",{id:`${d2}-time`,type:"time",value:P2?I2:"",readOnly:ae2,disabled:!P2,"aria-describedby":J2.when?`${d2}-when-was`:void 0,onChange:e3=>L2(e3.target.value)})]})]}),g("div",{className:"core-intent-card__row",children:_("div",{className:xe2("duration"),"data-changed":J2.duration?"":void 0,children:[g("label",{className:"core-intent-card__label",htmlFor:`${d2}-length`,children:"How long"}),g("select",{id:`${d2}-length`,value:ee2,disabled:ae2||!oe2,"aria-describedby":J2.duration?`${d2}-duration-was`:void 0,onChange:e3=>V2(e3.target.value),children:ce2.map(e3=>g("option",{value:e3,children:fs(e3)},e3))}),be2("duration",T2?fs(E2):"All day",`${d2}-duration-was`)]})}),g("div",{className:"core-intent-card__row",children:_("div",{className:xe2("location"),"data-changed":J2.location?"":void 0,children:[g("label",{className:"core-intent-card__label",htmlFor:`${d2}-location`,children:"Location (optional)"}),g("input",{id:`${d2}-location`,value:z2,maxLength:ds,readOnly:ae2,"aria-describedby":J2.location?`${d2}-location-was`:void 0,onChange:e3=>B2(e3.target.value)}),be2("location",R2||"No location",`${d2}-location-was`)]})}),_("div",{className:b(J2.assignee&&"core-edit-event-card__changed-block"),"data-changed":J2.assignee?"":void 0,children:[g(Vo,{extras:H2,disabled:ae2}),be2("assignee",l2.assigneeName??"No one")]}),_("div",{className:b(J2.audience&&"core-edit-event-card__changed-block"),"data-changed":J2.audience?"":void 0,children:[g(No,{id:d2,audiences:U2,value:W2.value,onChange:W2.setValue,subjectName:o2,disabled:ae2}),be2("audience",l2.audience?jo(l2.audience,o2):"")]}),y2?g("p",{className:"core-intent-card__message",role:"alert",children:y2}):null,G2?_(h,{children:[g("p",{className:"core-intent-card__does",id:`${d2}-does`,role:"group","aria-label":"Confirm cancelling",children:"Cancel this event? It can’t be undone from here."}),_("div",{className:"core-intent-card__actions",children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:v2!==null,onClick:()=>void Te2(),children:v2==="cancel_event"?"Cancelling…":"Yes, cancel the event"}),g("button",{ref:ie2,type:"button",className:"core-intent-card__button",disabled:v2!==null,onClick:()=>K2(false),children:"Keep it"})]},"cancel-actions")]}):_(h,{children:[ve2?g("p",{className:"core-intent-card__does",id:`${d2}-does`,children:ve2}):null,_("div",{className:"core-intent-card__actions",children:[g("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!_e2||v2!==null,"aria-describedby":ve2?`${d2}-does`:void 0,children:v2==="update_event"?"Saving…":"Save changes"}),Ce2?g("button",{type:"button",className:"core-intent-card__button",disabled:!x2||v2!==null,onClick:()=>void we2(),children:v2==="assign_self"?"Assigning…":"Assign to me"}):null,g("button",{type:"button",className:"core-intent-card__button",disabled:!x2||v2!==null,onClick:()=>K2(true),children:"Cancel the event"})]},"save-actions")]})]})}var hs=4e3;function gs(e2){let{onIntent:t2,className:n2,style:r2}=e2,i2=X(e2.eventName),a2=X(e2.subjectName),o2=c(),{run:l2,busy:u2,message:d2,available:m2}=Lt(t2),[h2,v2]=p((typeof e2.body=="string"?e2.body:"").slice(0,hs)),[y2,x2]=p(false),[S2,C2]=p(null),w2=f(null);s(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]);let T2=S2??(e2.noted&&typeof e2.noted=="object"?e2.noted:null);if(T2){let e3=Rt(T2.href);return _("section",{ref:w2,tabIndex:-1,"aria-labelledby":`${o2}-status`,className:b("core-intent-card","core-book-event-card","core-event-note-card",n2),style:r2,"data-state":"noted",children:[_("div",{className:"core-intent-card__head",children:[_("span",{id:`${o2}-status`,className:"core-intent-card__eyebrow",children:["Noted",i2?` · ${i2}`:""]}),g("p",{className:"core-intent-card__title",children:T2.name??i2??"Noted"})]}),e3?g("a",{className:"core-book-event-card__go",href:e3,children:"Go to event"}):null]})}let E2=m2&&u2===null,D2=m2&&!!i2&&h2.trim()!=="",O2=m2?i2?h2.trim()===""?"Write the note first.":"":"Choose the event first.":It,k2=async()=>{if(!D2||u2!==null)return;let e3={body:h2.trim()};y2&&(e3.audience="client");let{ok:t3,result:n3}=await l2("add_note",e3);t3&&C2({name:i2,href:n3&&typeof n3=="object"?n3.data?.href:void 0})};return _("form",{tabIndex:-1,ref:w2,"aria-labelledby":`${o2}-status`,className:b("core-intent-card","core-book-event-card","core-event-note-card",n2),style:r2,"data-state":"proposed",onSubmit:e3=>{e3.preventDefault(),k2()},"aria-busy":u2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:_("span",{id:`${o2}-status`,className:"core-intent-card__eyebrow",children:["Add a note",i2?` · ${i2}`:""]})}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Note"}),g("textarea",{value:h2,rows:4,maxLength:hs,readOnly:!E2,onChange:e3=>v2(e3.target.value)})]}),a2?_("label",{className:"core-intent-card__person",children:[g("input",{type:"checkbox",checked:y2,disabled:!E2,onChange:e3=>x2(e3.target.checked)}),_("span",{className:"core-intent-card__person-name",children:["Share with ",a2]})]}):null,g("p",{className:"core-intent-card__does",id:`${o2}-does`,children:O2||(y2?`${a2} will see this note.`:"Only staff will see this note.")}),d2?g("p",{className:"core-intent-card__message",role:"alert",children:d2}):null,g("div",{className:"core-intent-card__actions",children:g("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!D2||u2!==null,"aria-describedby":`${o2}-does`,children:u2==="add_note"?"Adding…":"Add note"})},"note-actions")]})}var _s=["proposed","created","done"],vs=200;function ys(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,o2=(Array.isArray(e2.types)?e2.types:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&typeof e3.name=="string"&&e3.name.trim()!==""),l2=X(e2.subjectName),u2=e2.task&&typeof e2.task=="object"&&typeof e2.task.title=="string"?e2.task:null,d2=c(),{run:m2,busy:v2,message:y2,available:x2}=Lt(r2),[S2,C2]=p((u2?.title??"").slice(0,vs)),w2=co(u2?.dueAt,n2),T2=n2??Ot(),E2=!(u2?.dueOn&&$.test(u2.dueOn))&&!w2,[D2,O2]=p(u2?.dueOn&&$.test(u2.dueOn)?u2.dueOn:w2?.date??po(T2)),[k2,A2]=p(w2?.time??""),j2=f(false);s(()=>{if(j2.current)return;if(E2){O2(po(T2));return}if(!u2?.dueAt)return;let e3=co(u2.dueAt,n2);e3&&(u2.dueOn&&$.test(u2.dueOn)||O2(e3.date),A2(e3.time))},[u2?.dueAt,u2?.dueOn,n2,E2,T2]);let M2=Bo({people:e2.people,assignees:e2.assignees,linkCandidates:e2.linkCandidates,links:e2.links}),[N2,P2]=p(o2.find(e3=>e3.id===u2?.typeId)?.id??o2[0]?.id??""),F2=Oo(o2.find(e3=>e3.id===N2)),I2=Ao(F2),[L2,R2]=p(null),z2=u2?.state&&_s.includes(u2.state)?u2.state:"proposed",B2=L2&&_s.indexOf(L2)>_s.indexOf(z2)?L2:z2,ee2=f(null),V2=f(null),[H2,U2]=p(false);if(s(()=>{H2&&V2.current?.focus({preventScroll:true})},[H2]),s(()=>{L2&&ee2.current?.focus({preventScroll:true})},[L2]),!u2)return null;let W2=B2==="proposed"&&x2&&v2===null,G2=x2&&!!l2&&S2.trim()!=="",K2=async e3=>{if(e3.preventDefault(),!G2||v2!==null)return;let t3=D2||po(T2),n3=k2?fo(t3,k2,T2):void 0,r3={title:S2.trim(),...o2.length>0&&N2?{typeId:N2}:{},dueOn:t3,...n3?{dueAt:n3}:{},...I2.value?{audience:I2.value}:{},tzid:T2};M2.write(r3);let{ok:i3}=await m2("log_event",r3);i3&&R2("created")},te2=async()=>{let{ok:e3}=await m2("complete");U2(false),e3&&R2("done")},ne2=B2==="proposed"?{date:D2||po(T2),time:k2}:{date:u2.dueOn&&$.test(u2.dueOn)?u2.dueOn:co(u2.dueAt,n2)?.date??"",time:co(u2.dueAt,n2)?.time??""},re2=[ne2.date===po(T2)?"today":oo(ne2.date,t2),ne2.date&&ne2.time?so(ne2.time,t2):""].filter(Boolean).join(", "),ie2=B2==="proposed"?"Task · suggested":B2==="done"?"Task · done":"Task",q2=B2==="proposed"?G2?`Create task adds this to ${l2}’s tasks.`:x2?l2?"":"Choose whose file this goes in first.":It:B2==="created"?H2?"Mark this task done? It can’t be reopened from here.":"Mark done closes this task.":"";return _("form",{ref:ee2,tabIndex:-1,"aria-labelledby":`${d2}-status`,className:b("core-intent-card","core-task-card",i2),style:a2,"data-state":B2,onSubmit:e3=>void K2(e3),"aria-busy":v2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[_("span",{id:`${d2}-status`,className:"core-intent-card__eyebrow",children:[ie2,l2?` · ${l2}`:""]}),B2==="proposed"&&o2.length>1?_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Type"}),g("select",{value:N2,disabled:!W2,onChange:e3=>P2(e3.target.value),children:o2.map(e3=>g("option",{value:e3.id,children:e3.name},e3.id))})]}):null,B2==="proposed"?_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"What needs doing"}),g("input",{value:S2,maxLength:vs,readOnly:!W2,onChange:e3=>C2(e3.target.value),required:true})]}):g("p",{className:"core-intent-card__title core-task-card__title","data-done":B2==="done"?"":void 0,children:u2.title})]}),B2==="proposed"?_("div",{className:"core-intent-card__row",children:[_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Due"}),g("input",{type:"date",value:D2,readOnly:!W2,onChange:e3=>(j2.current=true,O2(e3.target.value))})]}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Time (optional)"}),g("input",{type:"time",value:D2?k2:"",readOnly:!W2,disabled:!D2,onChange:e3=>(j2.current=true,A2(e3.target.value))})]})]}):null,B2==="proposed"?g(Vo,{extras:M2,disabled:!W2}):null,B2==="proposed"?g(No,{id:d2,audiences:F2,value:I2.value,onChange:I2.setValue,subjectName:l2,disabled:!W2}):null,g("p",{className:"core-task-card__meta",children:[re2?`Due ${re2}`:"",u2.assigneeName?`For ${u2.assigneeName}`:""].filter(Boolean).join(" · ")||(B2==="proposed"?"":"No due date")}),y2?g("p",{className:"core-intent-card__message",role:"alert",children:y2}):null,q2?g("p",{className:"core-intent-card__does",id:`${d2}-does`,children:q2}):null,B2==="done"?null:g("div",{className:"core-intent-card__actions",children:B2==="proposed"?g("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!G2||v2!==null,"aria-describedby":`${d2}-does`,children:v2==="log_event"?"Creating…":"Create task"}):H2?_(h,{children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:v2!==null,onClick:()=>void te2(),children:v2==="complete"?"Saving…":"Yes, mark done"}),g("button",{ref:V2,type:"button",className:"core-intent-card__button",disabled:v2!==null,onClick:()=>U2(false),children:"Cancel"})]}):g("button",{type:"button",className:"core-intent-card__button",disabled:!x2||v2!==null,"aria-describedby":`${d2}-does`,onClick:()=>U2(true),children:"Mark done"})})]})}function bs(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,o2=X(e2.scopeName),l2=c(),{run:u2,busy:d2,message:m2,available:v2}=Lt(r2),[y2,x2]=p(null),S2=f(null);if(s(()=>{y2&&S2.current?.focus({preventScroll:true})},[y2]),!o2)return null;let C2=e2.pointer&&typeof e2.pointer=="object"?e2.pointer:void 0,w2="";if(C2?.kind==="conversation"){let e3=typeof C2.at=="string"?new Date(C2.at):null;w2=e3&&!Number.isNaN(e3.getTime())?`Conversation · ${new Intl.DateTimeFormat(t2,{month:"short",day:"numeric",timeZone:n2}).format(e3)}`:"Conversation"}else C2?.kind==="event"&&(w2=X(C2.name)??"Event");let T2=d2===null,E2=async e3=>{let{ok:t3}=await u2(e3);t3&&x2(e3==="dismiss"?"dismissed":"continued")},D2=y2==="continued"?"Picked up":y2==="dismissed"?"Dismissed":"Pick up where you left off";return _("div",{ref:S2,tabIndex:-1,role:"group","aria-labelledby":`${l2}-status`,className:b("core-intent-card","core-handover-card",i2),style:a2,"data-state":y2??(v2?"offered":"display"),"aria-busy":d2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[g("span",{id:`${l2}-status`,className:"core-intent-card__eyebrow",children:D2}),g("p",{className:"core-intent-card__title",children:o2}),w2?g("span",{className:"core-handover-card__where",children:w2}):null]}),m2?g("p",{className:"core-intent-card__message",role:"alert",children:m2}):null,y2?null:_(h,{children:[g("p",{className:"core-intent-card__does",id:`${l2}-does`,children:v2?`Continue opens your earlier conversation about ${o2}. Dismiss hides this.`:It}),_("div",{className:"core-intent-card__actions",children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!v2||!T2,"aria-describedby":`${l2}-does`,onClick:()=>void E2("handover_continue"),children:d2==="handover_continue"?"Opening…":"Continue"}),g("button",{type:"button",className:"core-intent-card__button",disabled:!v2||!T2,"aria-describedby":`${l2}-does`,onClick:()=>void E2("dismiss"),children:"Dismiss"})]})]})]})}var xs=12,Ss=(e2,t2=200)=>typeof e2=="string"?e2.replace(/\s+/g," ").trim().slice(0,t2):"";function Cs(e2){let{typicalTime:t2,typicalCost:n2,costCap:r2,onIntent:i2,className:a2,style:o2}=e2,l2=X(e2.processName),u2=X(e2.subjectName),d2=c(),{run:m2,busy:v2,message:y2,available:x2}=Lt(i2),[S2,C2]=p(false),w2=f(null);if(s(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]),!l2)return null;let T2=Ss(e2.description),E2=(Array.isArray(e2.needs)?e2.needs:[]).filter(e3=>e3&&typeof e3=="object"&&Ss(e3.label)).slice(0,xs),D2=[t2&&`Typical time: ${Ss(t2,60)}`,n2&&`Typical cost: ${Ss(n2,60)}`,r2&&`Cost cap: ${Ss(r2,60)}`].filter(Boolean).join(" · "),O2=e2.running&&typeof e2.running=="object"?e2.running:null,k2=Rt(O2?.href),A2=x2&&!!u2,j2=x2?u2?"":"Choose who this is for before starting.":It,M2=S2?"Started":O2?"Running":"Start a service",N2=async()=>{if(!A2||v2!==null)return;let{ok:e3}=await m2("start_process");e3&&C2(true)};return _("div",{ref:w2,tabIndex:-1,role:"group","aria-labelledby":`${d2}-status`,className:b("core-intent-card","core-start-process-card",a2),style:o2,"data-state":S2?"started":O2?"running":x2?"offered":"display","aria-busy":v2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[g("span",{id:`${d2}-status`,className:"core-intent-card__eyebrow",children:M2}),g("p",{className:"core-intent-card__title",children:l2}),u2?_("span",{className:"core-start-process-card__for",children:["For ",u2]}):null]}),T2?g("p",{className:"core-start-process-card__description",children:T2}):null,E2.length>0?_("div",{className:"core-start-process-card__needs",children:[g("span",{className:"core-start-process-card__label",children:"What it needs"}),g("ul",{children:E2.map((e3,t3)=>_("li",{"data-have":e3.have===true?"":void 0,children:[g("span",{className:"core-start-process-card__mark","aria-hidden":"true"}),g("span",{children:Ss(e3.label)}),g("span",{className:"core-start-process-card__have",children:e3.have===true?"Have":"Needed"})]},t3))})]}):null,D2?g("p",{className:"core-start-process-card__meta",children:D2}):null,y2?g("p",{className:"core-intent-card__message",role:"alert",children:y2}):null,S2?g("p",{className:"core-intent-card__does",children:"Started. Progress will arrive in the conversation."}):O2?k2?g("a",{className:"core-start-process-card__go",href:k2,children:"Open"}):null:_(h,{children:[g("p",{className:"core-intent-card__does",id:`${d2}-does`,children:A2?`Start begins ${l2} for ${u2}. Nothing is shared with ${u2} until you choose to share it.`:j2}),g("div",{className:"core-intent-card__actions",children:g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!A2||v2!==null,"aria-describedby":`${d2}-does`,onClick:()=>void N2(),children:v2==="start_process"?"Starting…":"Start"})})]})]})}var ws=12,Ts=8,Es=600;function Ds(e2){let{onIntent:t2,className:n2,style:r2}=e2,i2=c(),{run:a2,busy:o2,message:l2,available:u2}=Lt(t2),[d2,m2]=p({}),[v2,y2]=p({}),[x2,S2]=p(null),C2=f(null),w2=f(false);s(()=>{w2.current&&C2.current?.focus({preventScroll:true})},[d2]);let T2=new Set,E2=(Array.isArray(e2.parts)?e2.parts:[]).filter(e3=>!e3||typeof e3!="object"||typeof e3.id!="string"||typeof e3.text!="string"||!e3.text.trim()||T2.has(e3.id)?false:(T2.add(e3.id),true)).slice(0,ws);if(E2.length===0)return null;let D2=e3=>(Array.isArray(e3.matches)?e3.matches:[]).filter(e4=>e4&&typeof e4.id=="string"&&X(e4.name)&&(e4.kind==="client"||e4.kind==="project")).slice(0,Ts),O2=e3=>d2[e3.id]??(e3.state==="assigned"||e3.state==="dropped"?{state:e3.state,name:X(e3.assignedToName)}:null),k2=E2.filter(e3=>!O2(e3)),A2=k2.length===0,j2=async(e3,t3)=>{S2(e3.id);let{ok:n3}=await a2("confirm_part",{partId:e3.id,targetId:t3.id,targetKind:t3.kind});n3&&(w2.current=true,m2(n4=>({...n4,[e3.id]:{state:"assigned",name:X(t3.name)}})))},M2=async e3=>{S2(e3.id);let{ok:t3}=await a2("drop_part",{partId:e3.id});t3&&(w2.current=true,m2(t4=>({...t4,[e3.id]:{state:"dropped"}})))},N2=o2===null;return _("div",{ref:C2,tabIndex:-1,role:"group","aria-labelledby":`${i2}-status`,className:b("core-intent-card","core-note-split-card",n2),style:r2,"data-state":A2?"sorted":u2?"open":"display","aria-busy":o2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[g("span",{id:`${i2}-status`,className:"core-intent-card__eyebrow",children:A2?"Note sorted":"Note to sort"}),g("p",{className:"core-intent-card__title",children:A2?"Every part is sorted":`${k2.length} of ${E2.length} ${E2.length===1?"part":"parts"} to sort`})]}),g("ol",{className:"core-note-split-card__parts",children:E2.map((e3,t3)=>{let n3=O2(e3),r3=D2(e3),a3=v2[e3.id]??(r3.length===1?r3[0].id:""),s2=r3.find(e4=>e4.id===a3),c2=e3.text.length>Es?`${e3.text.slice(0,599)}…`:e3.text,d3=`Part ${t3+1}`;return _("li",{className:"core-note-split-card__part","data-state":n3?.state??"open",children:[g("span",{className:"core-note-split-card__label",children:d3}),g("p",{className:"core-note-split-card__text",children:c2}),n3?g("p",{className:"core-note-split-card__result",children:n3.state==="dropped"?"Dropped":`Assigned${n3.name?` to ${n3.name}`:""}`}):_(h,{children:[r3.length===0?g("p",{className:"core-note-split-card__hint",children:"No client or project matches. You can drop this part."}):r3.length===1?_("p",{className:"core-note-split-card__hint",children:["Looks like ",g("strong",{children:X(r3[0].name)}),r3[0].detail?` · ${X(r3[0].detail)}`:"",". Confirm it, or drop the part."]}):_("fieldset",{className:"core-note-split-card__choices",disabled:!u2||!N2,children:[_("legend",{className:"core-note-split-card__hint",children:[r3.length," match: choose who this is for."]}),r3.map(t4=>_("label",{className:"core-note-split-card__choice",children:[g("input",{type:"radio",name:`${i2}-${e3.id}`,value:t4.id,checked:a3===t4.id,onChange:()=>y2(n4=>({...n4,[e3.id]:t4.id}))}),_("span",{children:[g("span",{className:"core-note-split-card__name",children:X(t4.name)}),g("span",{className:"core-note-split-card__detail",children:[t4.kind==="project"?"Project":"Client",X(t4.detail)].filter(Boolean).join(" · ")})]})]},t4.id))]}),x2===e3.id&&l2?g("p",{className:"core-intent-card__message",role:"alert",children:l2}):null,_("div",{className:"core-intent-card__actions",children:[r3.length>0?g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!u2||!N2||!s2,"aria-label":`Confirm ${d3}${s2?` for ${X(s2.name)}`:""}`,onClick:()=>s2&&void j2(e3,s2),children:o2==="confirm_part"&&x2===e3.id?"Confirming…":"Confirm"}):null,g("button",{type:"button",className:"core-intent-card__button",disabled:!u2||!N2,"aria-label":`Drop ${d3}`,onClick:()=>void M2(e3),children:"Drop"})]})]})]},e3.id)})}),A2?null:g("p",{className:"core-intent-card__does",children:u2?"Confirm sends that part to the client or project you choose. Drop leaves it out. The original note stays as the record.":It})]})}var Os=20;function ks(e2){let{onIntent:t2,onCancel:n2,className:r2,style:i2}=e2,a2=e2.mode==="withdraw"?"withdraw":"share",o2=X(e2.clientName),l2=c(),{run:u2,busy:d2,message:m2,available:v2}=Lt(t2),[y2,x2]=p(false),[S2,C2]=p(false),w2=f(null);s(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]);let T2=(Array.isArray(e2.items)?e2.items:[]).filter(e3=>e3&&typeof e3=="object"&&X(e3.name)).slice(0,Os);if(T2.length===0)return null;let E2=a2==="share",D2=v2&&!!o2&&(!E2||y2),O2=v2?o2?E2&&!y2?"Tick “I’ve reviewed this” to share.":"":"Choose who this is for before sending.":It,k2=E2?"Share":"Stop sharing",A2=S2?E2?"Shared":"Sharing stopped":E2?"Share for approval":"Stop sharing",j2=async()=>{if(!D2||d2!==null)return;let{ok:e3}=await u2(E2?"share":"withdraw",E2?{reviewed:true}:void 0);e3&&C2(true)};return _("div",{ref:w2,tabIndex:-1,role:"group","aria-labelledby":`${l2}-status`,className:b("core-intent-card","core-share-approval-card",r2),style:i2,"data-state":S2?"done":v2?"asking":"display","data-mode":a2,"aria-busy":d2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[g("span",{id:`${l2}-status`,className:"core-intent-card__eyebrow",children:A2}),g("p",{className:"core-intent-card__title",children:o2?E2?`Share with ${o2}`:`Stop sharing with ${o2}`:E2?"Share with whom?":"Stop sharing with whom?"})]}),g("ul",{className:"core-share-approval-card__items",children:T2.map((e3,t3)=>_("li",{children:[g("span",{className:"core-share-approval-card__name",children:X(e3.name)}),X(e3.projectName)?g("span",{className:"core-share-approval-card__project",children:X(e3.projectName)}):null]},t3))}),m2?g("p",{className:"core-intent-card__message",role:"alert",children:m2}):null,S2?g("p",{className:"core-intent-card__does",children:E2?`${T2.length===1?"This is":"These are"} now shared with ${o2}.`:`${T2.length===1?"This is":"These are"} no longer shared with ${o2}.`}):_(h,{children:[g("p",{className:"core-intent-card__does",id:`${l2}-does`,children:o2?E2?`Sharing makes ${T2.length===1?"this":"these"} visible to ${o2} in their portal. You can stop sharing later.`:`Stop sharing takes ${T2.length===1?"this":"these"} out of ${o2}’s portal.`:O2}),E2?_("label",{className:"core-share-approval-card__review",children:[g("input",{type:"checkbox",checked:y2,disabled:!v2||d2!==null,onChange:e3=>x2(e3.target.checked)}),g("span",{children:"I’ve reviewed this"})]}):null,O2&&o2?g("p",{className:"core-share-approval-card__reason",id:`${l2}-reason`,children:O2}):null,_("div",{className:"core-intent-card__actions",children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!D2||d2!==null,"aria-describedby":`${l2}-does`,onClick:()=>void j2(),children:d2===null?k2:"Saving…"}),typeof n2=="function"?g("button",{type:"button",className:"core-intent-card__button",disabled:d2!==null,onClick:n2,children:"Not now"}):null]})]})]})}var As={save_as_note:{label:"Save as note",busy:"Saving…",done:"Saved as note"},make_follow_up:{label:"Make follow-up",busy:"Making…",done:"Follow-up made"}},js=["save_as_note","make_follow_up"];function Ms(e2){let{onIntent:t2,className:n2,style:r2}=e2,i2=Array.isArray(e2.actions)?js.filter(t3=>e2.actions.includes(t3)):js,a2=c(),{run:o2,busy:s2,message:l2,available:u2}=Lt(t2),[d2,f2]=p(new Set);if(i2.length===0)return null;let m2=async e3=>{let{ok:t3}=await o2(e3);t3&&f2(t4=>new Set(t4).add(e3))};return _("div",{role:"group","aria-label":"Suggested actions",className:b("core-suggested-actions",n2),style:r2,"aria-busy":s2!==null||void 0,children:[g("div",{className:"core-suggested-actions__row",children:i2.map(e3=>{let t3=d2.has(e3);return g("button",{type:"button",className:"core-suggested-actions__chip","data-done":t3||void 0,disabled:!u2||s2!==null||t3,"aria-describedby":u2?void 0:`${a2}-does`,onClick:()=>void m2(e3),children:t3?As[e3].done:s2===e3?As[e3].busy:As[e3].label},e3)})}),l2?g("p",{className:"core-intent-card__message",role:"alert",children:l2}):null,u2?null:g("p",{id:`${a2}-does`,className:"core-suggested-actions__does",children:It})]})}var Ns=e2=>!!e2&&typeof e2=="object"&&typeof e2.label=="string"&&ua(e2.href)!==null;function Ps(e2){return(Array.isArray(e2)?e2:e2?[e2]:[]).filter(Ns)}function Fs({action:e2,className:t2}){let n2=ua(e2.href);if(n2===null)return null;let r2=e2.variant==="secondary"?"secondary":"primary";return g("a",{className:b("core-public-action",t2),"data-variant":r2,href:n2,children:e2.label})}function Is({actions:e2,className:t2}){return e2.length?g("div",{className:b("core-public-actions",t2),children:e2.map((e3,t3)=>g(Fs,{action:e3},`${e3.href}-${t3}`))}):null}function Ls(e2){if(!e2||typeof e2!="object")return null;let t2=e2,n2=da(t2.src);return n2===null?null:{src:n2,alt:t2.decorative?"":typeof t2.alt=="string"?t2.alt:""}}function Rs({eyebrow:e2,title:t2,intro:n2,actions:r2,media:i2,align:a2,className:o2,style:s2}){let c2=Ls(i2),l2=a2==="center";return _("section",{className:b("core-hero",o2),"data-align":l2?"center":"start","data-media":c2?"yes":"no",style:s2,children:[_("div",{className:"core-hero__text",children:[e2?g("p",{className:"core-hero__eyebrow",children:e2}):null,g("h1",{className:"core-hero__title",children:t2}),n2?g("p",{className:"core-hero__intro",children:n2}):null,g(Is,{actions:Ps(r2).slice(0,2),className:"core-hero__actions"})]}),c2?g("div",{className:"core-hero__media",children:g("img",{src:c2.src,alt:c2.alt,loading:"eager",decoding:"async"})}):null]})}function zs({text:e2,src:t2,href:n2,size:r2,className:i2,style:a2}){let o2=r2==="sm"||r2==="lg"?r2:"md",s2=da(t2),c2=ua(n2),l2=s2?g("img",{className:"core-logo-mark__img",src:s2,alt:e2}):g("span",{className:"core-logo-mark__text",children:e2});return c2?g("a",{className:b("core-logo-mark",i2),"data-size":o2,href:c2,style:a2,children:l2}):g("span",{className:b("core-logo-mark",i2),"data-size":o2,style:a2,children:l2})}var Bs=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.label=="string"&&ua(e3.href)!==null).map(e3=>({label:e3.label,href:ua(e3.href)}));function Vs({logo:e2,links:t2,signIn:n2,className:r2,style:i2}){let a2=Bs(t2).slice(0,5),o2=n2===false?null:{label:"Sign in",href:"/auth/login",variant:"secondary",...n2??{}};return _("header",{className:b("core-public-header",r2),style:i2,children:[e2?g(zs,{...e2}):g("span",{}),a2.length?_("nav",{className:"core-public-header__nav","aria-label":"Main",children:[g("ul",{className:"core-public-header__links",children:a2.map(e3=>g("li",{children:g("a",{href:e3.href,children:e3.label})},e3.href))}),_("details",{className:"core-public-header__menu",children:[g("summary",{children:"Menu"}),g("ul",{children:a2.map(e3=>g("li",{children:g("a",{href:e3.href,children:e3.label})},e3.href))})]})]}):null,o2?g(Fs,{action:o2,className:"core-public-header__sign-in"}):null]})}var Hs=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.title=="string"&&Array.isArray(e3.links)).map(e3=>({title:e3.title,links:Bs(e3.links)}));function Us({logo:e2,groups:t2,legal:n2,className:r2,style:i2}){let a2=Hs(t2).slice(0,4);return _("footer",{className:b("core-public-footer",r2),style:i2,children:[_("div",{className:"core-public-footer__top",children:[e2?g(zs,{size:"sm",...e2}):null,a2.length?g("div",{className:"core-public-footer__groups",children:a2.map(e3=>_("nav",{"aria-label":e3.title,className:"core-public-footer__group",children:[g("p",{className:"core-public-footer__title",children:e3.title}),g("ul",{children:e3.links.map(e4=>g("li",{children:g("a",{href:e4.href,children:e4.label})},e4.href))})]},e3.title))}):null]}),n2?g("p",{className:"core-public-footer__legal",children:n2}):null]})}var Ws=/^\d+(\.\d+)?\s*\/\s*\d+(\.\d+)?$/;function Gs({src:e2,alt:t2,decorative:n2,ratio:r2,caption:i2,priority:a2,className:o2,style:s2}){let c2=da(e2);if(c2===null)return null;!n2&&!t2&&we(`image-alt:${e2}`,`Image: "${e2}" has no alt text; give alt or set decorative`);let l2=r2&&Ws.test(r2)?{aspectRatio:r2.replace(/\s/g,"")}:void 0;return _("figure",{className:b("core-image",o2),style:s2,children:[g("div",{className:"core-image__frame","data-ratio":l2?"set":"auto",style:l2,children:g("img",{src:c2,alt:n2?"":t2??"",loading:a2?"eager":"lazy",decoding:"async"})}),i2?g("figcaption",{className:"core-image__caption",children:i2}):null]})}var Ks=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.title=="string");function qs({title:e2,intro:t2,items:n2,columns:r2,className:i2,style:a2}){let o2=Ks(n2);if(!o2.length)return null;let s2=r2===2||r2===4?r2:3;return _("section",{className:b("core-feature-grid",i2),"data-columns":s2,style:a2,children:[e2||t2?_("div",{className:"core-feature-grid__head",children:[e2?g("h2",{className:"core-feature-grid__title",children:e2}):null,t2?g("p",{className:"core-feature-grid__intro",children:t2}):null]}):null,g("ul",{className:"core-feature-grid__items",children:o2.map((e3,t3)=>_("li",{className:"core-feature-grid__item",children:[e3.icon?g("span",{className:"core-feature-grid__icon","aria-hidden":"true",children:e3.icon}):null,g("h3",{className:"core-feature-grid__item-title",children:e3.title}),e3.text?g("p",{className:"core-feature-grid__text",children:e3.text}):null]},`${e3.title}-${t3}`))})]})}var Js=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.name=="string"),Ys=e2=>e2.split(/\s+/).filter(Boolean).slice(0,2).map(e3=>e3[0].toUpperCase()).join("");function Xs({title:e2,intro:t2,members:n2,className:r2,style:i2}){let a2=Js(n2);return a2.length?_("section",{className:b("core-team-grid",r2),style:i2,children:[e2||t2?_("div",{className:"core-team-grid__head",children:[e2?g("h2",{className:"core-team-grid__title",children:e2}):null,t2?g("p",{className:"core-team-grid__intro",children:t2}):null]}):null,g("ul",{className:"core-team-grid__members",children:a2.map((e3,t3)=>{let n3=Ls(e3.photo);return _("li",{className:"core-team-grid__member",children:[g("div",{className:"core-team-grid__photo",children:n3?g("img",{src:n3.src,alt:n3.alt||e3.name,loading:"lazy",decoding:"async"}):g("span",{"aria-hidden":"true",children:Ys(e3.name)})}),g("p",{className:"core-team-grid__name",children:e3.name}),e3.role?g("p",{className:"core-team-grid__role",children:e3.role}):null,e3.bio?g("p",{className:"core-team-grid__bio",children:e3.bio}):null]},`${e3.name}-${t3}`)})})]}):null}function Zs({quote:e2,name:t2,role:n2,photo:r2,className:i2,style:a2}){if(typeof e2!="string"||!e2)return null;let o2=Ls(r2);return _("figure",{className:b("core-testimonial",i2),style:a2,children:[g("blockquote",{className:"core-testimonial__quote",children:g("p",{children:e2})}),_("figcaption",{className:"core-testimonial__by",children:[o2?g("img",{className:"core-testimonial__photo",src:o2.src,alt:o2.alt||t2,loading:"lazy",decoding:"async"}):null,_("span",{children:[g("span",{className:"core-testimonial__name",children:t2}),n2?g("span",{className:"core-testimonial__role",children:n2}):null]})]})]})}function Qs({title:e2,text:t2,actions:n2,tone:r2,className:i2,style:a2}){let o2=r2==="strong"||r2==="neutral"?r2:"accent";return _("section",{className:b("core-cta-band",i2),"data-tone":o2,style:a2,children:[_("div",{className:"core-cta-band__text",children:[g("h2",{className:"core-cta-band__title",children:e2}),t2?g("p",{className:"core-cta-band__body",children:t2}):null]}),g(Is,{actions:Ps(n2).slice(0,2)})]})}function $s({title:e2,intro:t2,askPhone:n2,consent:r2,submitLabel:i2,thanks:a2,actions:o2,className:s2,style:l2}){let u2=c(),[d2,f2]=p({name:"",email:"",phone:"",message:"",consent:false,website:""}),[m2,h2]=p(false),[v2,y2]=p(false),[x2,S2]=p(""),C2=o2?.submitRequest,w2=e3=>t3=>f2(n3=>({...n3,[e3]:t3.target.type==="checkbox"?!!t3.target.checked:t3.target.value}));return v2?g("section",{className:b("core-contact-form",s2),style:l2,children:g("p",{className:"core-contact-form__thanks",role:"status",children:a2||"Thanks. We'll be in touch within one business day."})}):_("section",{className:b("core-contact-form",s2),style:l2,children:[e2?g("h2",{className:"core-contact-form__title",children:e2}):null,t2?g("p",{className:"core-contact-form__intro",children:t2}):null,_("form",{className:"core-contact-form__form",onSubmit:async e3=>{if(e3.preventDefault(),C2&&!m2){if(!d2.consent){S2("Please tick the box to agree to be contacted.");return}h2(true),S2("");try{let e4=await C2({name:d2.name.trim(),email:d2.email.trim(),...n2&&d2.phone.trim()?{phone:d2.phone.trim()}:{},...d2.message.trim()?{message:d2.message.trim()}:{},consent:d2.consent,website:d2.website});e4.success?y2(true):S2(jt(e4))}catch{S2("Something went wrong. Try again.")}finally{h2(false)}}},children:[_("div",{className:"core-contact-form__row",children:[_("label",{className:"core-contact-form__field",children:[g("span",{children:"Name"}),g("input",{name:"name",autoComplete:"name",required:true,value:d2.name,onChange:w2("name")})]}),_("label",{className:"core-contact-form__field",children:[g("span",{children:"Email"}),g("input",{name:"email",type:"email",autoComplete:"email",required:true,value:d2.email,onChange:w2("email")})]})]}),n2?_("label",{className:"core-contact-form__field",children:[g("span",{children:"Phone (optional)"}),g("input",{name:"phone",type:"tel",autoComplete:"tel",value:d2.phone,onChange:w2("phone")})]}):null,_("label",{className:"core-contact-form__field",children:[g("span",{children:"Message (optional)"}),g("textarea",{name:"message",rows:4,value:d2.message,onChange:w2("message")})]}),_("div",{className:"core-contact-form__trap","aria-hidden":"true",children:[g("label",{htmlFor:`${u2}-website`,children:"Website"}),g("input",{id:`${u2}-website`,name:"website",tabIndex:-1,autoComplete:"off",value:d2.website,onChange:w2("website")})]}),_("label",{className:"core-contact-form__check",children:[g("input",{type:"checkbox",name:"consent",checked:d2.consent,onChange:w2("consent")}),g("span",{children:r2||"I agree to be contacted about my request."})]}),x2?g("p",{className:"core-contact-form__error",role:"alert",children:x2}):null,C2?null:g("p",{className:"core-contact-form__error",children:"This form isn't connected yet."}),g("div",{className:"core-contact-form__actions",children:g("button",{type:"submit",className:"core-contact-form__submit",disabled:m2||!C2,children:m2?"Sending…":i2||"Send"})})]})]})}function ec({length:e2=6,label:t2,value:n2,onChange:r2,onComplete:i2,error:a2,disabled:o2,autoFocus:s2,name:l2="code",className:u2,style:d2}){let f2=c(),m2=Number.isInteger(e2)&&e2>0&&e2<=12?e2:6,[h2,v2]=p(""),y2=(n2??h2).replace(/\D/g,"").slice(0,m2),x2=e3=>{let t3=e3.target.value.replace(/\D/g,"").slice(0,m2);n2===void 0&&v2(t3),r2?.(t3),t3.length===m2&&y2.length!==m2&&i2?.(t3)};return _("div",{className:b("core-code-field",u2),style:{...d2,"--core-code-field-n":m2},children:[g("label",{className:"core-code-field__label",htmlFor:f2,children:t2||"Code"}),_("div",{className:"core-code-field__boxes","data-error":a2?"yes":"no",children:[g("input",{id:f2,className:"core-code-field__input",name:l2,value:y2,onChange:x2,inputMode:"numeric",autoComplete:"one-time-code",pattern:`\\d{${m2}}`,maxLength:m2,disabled:o2,autoFocus:s2,"aria-invalid":a2?true:void 0,"aria-describedby":a2?`${f2}-error`:void 0}),g("div",{className:"core-code-field__cells","aria-hidden":"true",children:Array.from({length:m2},(e3,t3)=>g("span",{className:"core-code-field__cell","data-filled":t3<y2.length?"yes":"no","data-caret":t3===Math.min(y2.length,m2-1)?"yes":"no",children:y2[t3]??""},t3))})]}),a2?g("p",{id:`${f2}-error`,className:"core-code-field__error",role:"alert",children:a2}):null]})}export{$r as ANSWER_COLUMN_PX,jn as Accordion,Fs as ActionLink,Is as ActionRow,ei as AnswerRows,_r as Aside,Gt as Avatar,sr as BLOCK_KINDS,Oi as BLOCK_SCHEMAS,gn as Badge,ss as BookEventCard,D as Box,Tn as Button,go as CalendarFilters,Co as CalendarView,Mn as Card,O as Center,nn as Checkbox,rn as CheckboxGroup,En as Chip,Kt as Code,ec as CodeField,Pn as Columns,Qo as Combobox,ni as ComparisonBars,$s as ContactForm,k as Container,xi as Contents,Qs as CtaBand,za as DAY_MINUTES,Hr as DEFAULT_DISPLAY_LOCALE,Xn as DEFAULT_PROFILE_ID,ft as DEFAULT_VIEWER,Ta as DataTable,an as DateRange,br as Definition,We as Dialog,qi as DisclaimerBlock,In as Disclosure,A as Divider,Ti as DocumentBlocks,Pr as DocumentLabel,Di as DocumentSection,yi as DocumentShell,Vr as DocumentTable,ms as EditEventCard,T as EmbedContext,_n as EmptyState,ka as EventCard,Ma as EventDetail,Pa as EventLogForm,gs as EventNoteCard,ja as EventRespond,Ia as EventSchedule,Ra as EventTimeline,Ci as ExecutionBlock,it as Eyebrow,qs as FeatureGrid,Mr as Figure,sn as FileField,kn as FilterChips,jr as Footnote,Zt as FormField,Ln as Grid,bs as HandoverCard,Jt as Heading,Rs as Hero,j as Hide,zi as HighlightBox,Zo as Highlighted,ro as HourGrid,Dn as IconButton,Gs as Image,M as Inline,sa as KpiCardGrid,On as Link,Xe as ListRow,Ko as LogCard,zs as LogoMark,mi as Masthead,Er as Math,Se as Menu,gi as MetaRail,yo as MiniMonth,It as NOT_AVAILABLE,ai as NextSteps,Ds as NoteSplitCard,si as Notes,yn as Notice,V as OVERLAY_DISMISS_EVENT,ta as OptionCard,ho as OverlapNotice,K as OverlayHost,zn as PAGINATOR_BINDINGS,Nr as PageBreak,Ze as PageFrame,ct as PageHead,Vt as PageStaffTools,se as Popover,na as ProfileCard,bn as Progress,Ki as ProposedComponent,vr as Prose,Us as PublicFooter,Vs as PublicHeader,ts as QuickNoteCard,yr as Quote,cn as RadioGroup,L as Rail,Br as Reference,Rn as Repeat,Qr as RowList,Ht as RuleSection,vi as RunningFooter,Ja as SERIES_SHAPES,dn as SearchField,Ri as SectionHeader,An as SegmentedControl,fn as Select,Qa as SeriesGlyph,ks as ShareApprovalCard,J as Sheet,R as Show,xn as Skeleton,li as SkippedSection,pn as Slider,Ge as Spacer,Sn as Spinner,Fn as Split,Ke as Stack,Cs as StartProcessCard,Pi as Stat,Fi as StatGroup,Yi as StatStrip,Ms as SuggestedActions,mn as Switch,Qe as TONES,di as TalkItThrough,ys as TaskCard,Xs as TeamGrid,Zs as Testimonial,Xt as Text,hn as TextArea,un as TextField,Ve as Toast,Ue as ToastRegion,Cn as Tooltip,Ut as UnderlinedAction,gt as ViewerProvider,fi as WRITE_HEIGHT_PX,oi as WRITE_LINE_HEIGHT_PX,xo as WeekStrip,pi as WriteInField,Ps as actionsOf,b as cx,Pe as dismissToast,Gr as displayLocale,Yn as documentProfiles,Dt as eventWhen,on as fileSize,Xr as formatValue,yt as hasRole,Ft as hrefFrom,Ls as imageOf,Wt as initialsOf,nt as inkToneOf,Eo as interact,Ha as isBusyOnly,vt as isStaff,Wa as layoutDay,x as length,lo as localWithOffset,pt as normalizeViewer,qa as overlapDays,or as profileCss,Kn as profileIds,ir as profileTokens,Gn as registerProfile,Jr as renderFormatted,qn as resolveProfile,Jn as resolvedProfiles,Rt as sameOriginPath,Za as seriesNumber,Xa as seriesShape,ln as toNumber,Ne as toast,et as toneOf,bt as typeCard,Xo as useCombobox,E as useEmbedded,Lt as useIntent,re as useOverlayFormat,te as useOverlayHost,Be as useToast,_t as useViewer,S as vars,Ga as visibleRange,Va as wallOf,Ka as weekDates};
3
+ }`;function sr(e2,t2){return e2.map(e3=>or(e3.id===t2?`:root,
4
+ [data-profile='${e3.id}']`:`[data-profile='${e3.id}']`,ar(e3))).join("\n\n")}var cr=["prose","clause","definitions","table","notice","figure","execution"],lr=/\{\{ref:([^}|]+?)(?:\|(title|full|number))?\}\}/g,ur="[a-z0-9][a-z0-9_-]*",dr=RegExp(`^(?:(${ur}):)?(${ur}(?:\\.${ur})*)(?:#(${ur}))?$`);RegExp(`^${ur}$`);function fr(e2,t2){let n2=e2.trim(),r2=dr.exec(n2);return r2?{key:n2,...r2[1]?{doc:r2[1]}:{},unit:r2[2],...r2[3]?{element:r2[3]}:{},...t2?{form:t2}:{}}:null}function pr(e2){let t2=e2.lastIndexOf(".");return t2<0?e2:e2.slice(t2+1)}function mr(e2){let t2=[],n2=0;for(let r2 of e2.matchAll(new RegExp(lr.source,"g"))){let i2=fr(r2[1],r2[2]);i2&&(r2.index>n2&&t2.push({kind:"text",text:e2.slice(n2,r2.index)}),t2.push({kind:"ref",...i2}),n2=r2.index+r2[0].length)}return n2<e2.length&&t2.push({kind:"text",text:e2.slice(n2)}),t2}function hr(e2){return e2.includes("{{ref:")}var Q=e2=>e2?{"data-profile":e2}:{},gr=e2=>e2?.fills===false?{"data-fills":"none"}:{},_r={note:"ⓘ",tip:"💡",warning:"⚠️",important:"❗"};function vr({children:e2,tone:t2="note",title:n2,profileId:r2,profile:i2,className:a2,style:o2}){let s2=i2??Z(r2,"Aside"),c2=s2?.fills===false;return _("aside",{role:"note",className:b("core-aside",a2),"data-tone":t2,...Q(i2?.id??r2),...gr(s2),style:o2,children:[c2?null:g("span",{className:"core-aside__icon","aria-hidden":true,children:_r[t2]}),_("div",{className:"core-aside__body",children:[n2&&g("div",{className:"core-aside__title",children:n2}),g("div",{className:"core-aside__text",children:e2})]})]})}function yr({children:e2,profileId:t2,profile:n2,full:r2=false,className:i2,style:a2}){return n2||Z(t2,"Prose"),g("div",{className:b("core-prose",i2),"data-full":r2?"":void 0,...Q(n2?.id??t2),style:a2,children:e2})}function br({children:e2,citation:t2,className:n2,style:r2}){return _("figure",{className:b("core-quote",n2),style:r2,children:[g("blockquote",{className:"core-quote__body",children:e2}),t2&&_("figcaption",{className:"core-quote__citation",children:["— ",t2]})]})}function xr({term:e2,description:t2,pairs:n2,profileId:r2,profile:i2,className:a2,style:o2}){i2||Z(r2,"Definition");let s2=n2??(e2===void 0?[]:[{term:e2,description:t2}]);return g("dl",{className:b("core-definition",a2),...Q(i2?.id??r2),style:o2,children:s2.map((e3,t3)=>_("div",{className:"core-definition__item",children:[g("dt",{className:"core-definition__term",children:e3.term}),g("dd",{className:"core-definition__description",children:e3.description})]},t3))})}var Sr="katex";function Cr(e2){if(typeof document>"u")return false;for(let t2 of document.querySelectorAll('script[type="importmap"]'))try{if(JSON.parse(t2.textContent??"").imports?.[e2])return true}catch{}return false}var wr=e2=>import(e2),Tr;function Er(){return Tr??=Cr(Sr)?wr(Sr).then(e2=>{let t2=e2,n2=t2.default??t2;return typeof n2.render=="function"?n2:null},()=>null):Promise.resolve(null),Tr}function Dr({children:e2="",mode:t2="inline",className:n2}){let r2=f(null),[i2,a2]=p(null),[o2,c2]=p(null),l2=`${t2}:${e2}`;return s(()=>{let e3=true;return Er().then(t3=>{e3&&t3&&a2(()=>t3)}),()=>{e3=false}},[]),s(()=>{if(i2&&r2.current&&o2!==l2)try{i2.render(e2,r2.current,{displayMode:t2==="block",throwOnError:false})}catch{c2(l2)}},[i2,e2,t2,l2,o2]),!i2||o2===l2?g("span",{className:b("core-math",n2),"data-mode":t2,"data-fallback":"",title:"KaTeX not available — showing TeX source",children:e2}):g("span",{ref:r2,className:b("core-math",n2),"data-mode":t2})}function Or(e2,t2){switch(t2.type){case"register":return e2.footnotes.some(e3=>e3.id===t2.entry.id)?e2:{footnotes:[...e2.footnotes,t2.entry]};case"unregister":return{footnotes:e2.footnotes.filter(e3=>e3.id!==t2.id)};default:return e2}}var kr=r(null);function Ar(){return o(kr)}function jr({children:e2}){let[t2,n2]=d(Or,{footnotes:[]}),r2=f(0),i2=a(e3=>{r2.current+=1;let t3=r2.current;return n2({type:"register",entry:{...e3,number:t3}}),t3},[]),o2=a(e3=>n2({type:"unregister",id:e3}),[]),s2=u(()=>({state:t2,registerFootnote:i2,unregisterFootnote:o2}),[t2,i2,o2]);return g(kr.Provider,{value:s2,children:e2})}function Mr({children:e2}){let t2=c(),n2=Ar(),[r2,i2]=p(null);return s(()=>{if(!n2)return;let r3=n2.registerFootnote({id:t2,content:e2});return i2(r3),()=>n2.unregisterFootnote(t2)},[t2]),n2?r2===null?null:g("sup",{id:`core-footnote-ref-${r2}`,className:"core-footnote",children:_("a",{href:`#core-footnote-${r2}`,className:"core-footnote__link",children:["[",r2,"]"]})}):_("span",{className:"core-footnote","data-fallback":"",children:[" ","(",e2,")"]})}function Nr({children:e2,caption:t2,profileId:n2,profile:r2,className:i2,style:a2}){return r2||Z(n2,"Figure"),_("figure",{className:b("core-figure",i2),...Q(r2?.id??n2),style:a2,children:[g("div",{className:"core-figure__body",children:e2}),t2&&g("figcaption",{className:"core-figure__caption",children:t2})]})}function Pr({className:e2}){return g("div",{className:b("core-page-break",e2),"aria-hidden":true})}function Fr({children:e2,as:t2="div",profileId:n2,profile:r2,tone:i2="subtle",className:a2,style:o2}){return r2||Z(n2,"DocumentLabel"),g(t2,{className:b("core-document-label",a2),"data-tone":i2,...Q(r2?.id??n2),style:o2,children:e2})}var Ir=["one","two","three","four","five","six","seven","eight","nine","ten"];function Lr(e2){if(e2.length!==1)return null;let t2=e2[0],n2=Ir[t2-1];return n2?`Article ${n2}`:`Article ${t2}`}function Rr(e2){return e2.length===0?null:e2.length===1?`Article ${e2[0]}`:e2.join(".")}function zr(e2,t2,n2){let r2=n2==="ladder"&&e2!==void 0&&e2.length>0,i2=[];return t2.map(({level:t3,marker:n3})=>{let a2=Math.min(Number.isInteger(t3)&&t3>=1?t3:1,i2.length+1);return i2.length=a2,i2[a2-1]=(i2[a2-1]??0)+1,n3===void 0?r2?[...e2,...i2].join("."):void 0:n3})}function Br(e2,t2){return e2?.[t2]??t2}function Vr({target:e2,form:t2,sectionReferences:n2,sectionNumbers:r2,sectionTitles:i2,sectionAnchors:a2,profileId:o2,profile:s2,className:c2,style:l2}){let u2=s2??Z(o2,"Reference"),d2=fr(e2),f2=n2?.[e2],p2=f2?.openable===false,m2=d2!==null&&d2.doc===void 0,h2=d2?pr(d2.unit):e2,_2=f2?.number??(m2&&d2.element===void 0?r2?.[h2]:void 0),v2=f2?.title??(m2&&d2.element===void 0?i2?.[h2]:void 0),y2=null;if(d2?.element!==void 0){let e3=f2?.element;y2=e3?zr(f2.number,e3.shape,u2?.depth.numbering)[e3.index]??null:null}else _2&&(y2=Rr(_2));let x2=t2==="full"||d2?.doc!==void 0&&t2!=="title",S2;S2=p2?null:t2==="title"?v2??y2:x2&&y2&&v2&&d2?.element===void 0?`${y2} (${v2})`:y2??v2??null;let C2=S2!==null,w2=C2?f2?f2.href:`#${Br(a2,h2)}`:void 0,T2={className:b("core-reference",c2),"data-target":e2,"data-unresolved":C2||p2?void 0:"","data-closed":p2?"":void 0,...Q(s2?.id??o2),style:l2};return w2?g("a",{href:w2,...T2,children:S2}):g("span",{...T2,children:S2??e2})}function Hr({columns:e2,rows:t2,caption:n2,profileId:r2,profile:i2,className:a2,style:o2}){return i2||Z(r2,"DocumentTable"),e2.length===0?null:_("div",{className:b("core-document-table",a2),...Q(i2?.id??r2),style:o2,children:[n2===void 0?null:g("div",{className:"core-document-table__caption",children:n2}),_("table",{className:"core-document-table__table",children:[g("thead",{children:g("tr",{children:e2.map((e3,t3)=>g("th",{scope:"col",className:"core-document-table__head","data-align":e3.align??"left",children:e3.header},t3))})}),g("tbody",{children:t2.map((t3,n3)=>g("tr",{children:e2.map((e3,n4)=>g("td",{className:"core-document-table__cell","data-align":e3.align??"left",children:t3[n4]??null},n4))},n3))})]})]})}var Ur={locale:"en-CA",currency:"CAD"},Wr=e2=>{if(typeof e2!="string"||!e2)return false;try{return Intl.NumberFormat.supportedLocalesOf(e2).length>0}catch{return false}},Gr=e2=>{if(typeof e2!="string"||!/^[A-Za-z]{3}$/.test(e2))return false;try{return new Intl.NumberFormat("en-CA",{style:"currency",currency:e2}),true}catch{return false}};function Kr(e2){let t2=typeof e2=="object"&&e2?e2:{};return{locale:Wr(t2.locale)?t2.locale:Ur.locale,currency:Gr(t2.currency)?t2.currency.toUpperCase():Ur.currency}}var qr=new Map;function Jr(e2){let t2=`${e2.locale}|${e2.currency}`,n2=qr.get(t2);if(!n2){let r2=new Intl.NumberFormat(e2.locale,{style:"currency",currency:e2.currency,maximumFractionDigits:0}).formatToParts(1),i2=r2.findIndex(e3=>e3.type==="integer"),a2=r2.length-1-[...r2].reverse().findIndex(e3=>e3.type==="integer");n2={prefix:r2.slice(0,i2).filter(e3=>e3.type!=="minusSign"&&e3.type!=="plusSign").map(e3=>e3.value).join(""),suffix:r2.slice(a2+1).map(e3=>e3.value).join("")},qr.set(t2,n2)}return n2}function Yr(e2,t2){if(e2==null)return"";if(typeof e2=="string")return e2;let n2=e2.precision??(e2.format==="number"?Xr(e2.value):void 0),r2=Zr(e2.format,e2.value,{precision:n2,signed:e2.signed,locale:t2});return e2.unit&&r2!=="—"?`${r2} ${e2.unit}`:r2}function Xr(e2){if(typeof e2!="number"||!Number.isFinite(e2))return 0;let t2=String(Number(e2.toFixed(3))),n2=t2.indexOf(".");return n2===-1||t2.includes("e")?0:t2.length-n2-1}function Zr(e2,t2,n2={}){if(!Number.isFinite(t2))return"—";let r2=n2.signed===true,i2=t2<0,a2=Math.abs(t2),o2=i2?"-":r2?"+":"",s2=n2.locale??Ur,c2=(e3,t3)=>e3.toLocaleString(s2.locale,{minimumFractionDigits:t3,maximumFractionDigits:t3}),l2=(e3,t3="")=>{let{prefix:n3,suffix:r3}=Jr(s2);return`${o2}${n3}${e3}${t3}${r3}`};switch(e2){case"currency":return l2(c2(a2,n2.precision??0));case"currency-k":{let e3=n2.precision??0;return a2>=1e3?l2((a2/1e3).toFixed(e3),"k"):l2(a2.toFixed(0))}case"currency-m":{let e3=n2.precision??1;return a2>=1e6?l2((a2/1e6).toFixed(e3),"M"):a2>=1e3?l2((a2/1e3).toFixed(0),"k"):l2(a2.toFixed(0))}case"currency-compact":return a2>=1e9?l2((a2/1e9).toFixed(n2.precision??1),"B"):a2>=1e6?l2((a2/1e6).toFixed(n2.precision??1),"M"):a2>=1e3?l2((a2/1e3).toFixed(n2.precision??1),"k"):l2(a2.toFixed(n2.precision??0));case"currency-monthly":return`${l2(c2(a2,n2.precision??0))}/mo`;case"percent":{let e3=n2.precision??1;return`${o2}${a2.toFixed(e3)}%`}case"fraction-percent":return`${o2}${new Intl.NumberFormat(s2.locale,{style:"percent",minimumFractionDigits:n2.precision??0,maximumFractionDigits:n2.precision??1}).format(a2)}`;case"age":return`Age ${Math.round(t2)}`;case"years":{let e3=n2.precision??0;return`${o2}${a2.toFixed(e3)} yrs`}case"year":return String(Math.round(t2));case"number":return`${o2}${c2(a2,n2.precision??0)}`;default:{let e3=n2.precision??0;return l2((a2/1e3).toFixed(e3),"k")}}}var Qr=e2=>!!(e2&&typeof e2=="object"&&"value"in e2&&"format"in e2);function $r({items:e2,profileId:t2,profile:n2,markerWidth:r2=44,secondaryWidth:i2=190,missingLabel:a2="Not answered yet",baseProps:o2,className:s2,style:c2}){if(n2||Z(t2,"RowList"),!Array.isArray(e2)||e2.length===0)return null;let l2=Kr(o2),u2=e3=>Qr(e3)?Yr(e3,l2):e3;return g("div",{className:b("core-row-list",s2),...Q(n2?.id??t2),style:S({"--core-row-list-marker-width":x(r2),"--core-row-list-secondary-width":x(i2)},c2),children:e2.map((e3,t3)=>_("div",{className:"core-row-list__row",children:[e3.marker!==void 0&&g("div",{className:"core-row-list__marker",children:u2(e3.marker)}),g("div",{className:"core-row-list__primary",children:e3.primary}),(e3.secondary!==void 0||e3.missing)&&g("div",{className:"core-row-list__secondary","data-missing":e3.missing?"":void 0,children:e3.missing?a2:u2(e3.secondary)})]},t3))})}var ei=190;function ti({items:e2,profileId:t2,profile:n2,missingLabel:r2="Not answered yet",answerWidth:i2=190,className:a2,style:o2}){let s2=e2.map(e3=>{let t3=typeof e3.answer=="string"&&e3.answer.trim().length>0;return{marker:e3.reference,primary:e3.question,secondary:t3?e3.answer:void 0,missing:!t3}});return g("div",{className:b("core-answer-rows",a2),...Q(n2?.id??t2),style:o2,children:g($r,{items:s2,profileId:t2,profile:n2,secondaryWidth:i2,missingLabel:r2})})}var ni=40;function ri({bars:e2,target:t2,targetLabel:n2,max:r2,profileId:i2,profile:a2,baseProps:o2,className:s2,style:c2}){let l2=Kr(o2),u2=a2??Z(i2,"ComparisonBars");if(e2.length===0)return null;let d2=e2.map(e3=>e3.value),f2=r2??Math.max(...d2,t2??0);if(!Number.isFinite(f2)||f2<=0)return we("ComparisonBars:no-scale","[ComparisonBars] every value is zero or negative, so there is no scale to draw against. Rendering nothing rather than a full-width or zero-width bar, either of which reads as a chart and is not one."),null;let p2=t2!==void 0&&t2>0&&t2<=f2?t2/f2*100:void 0;return _("figure",{className:b("core-comparison-bars",s2),...Q(a2?.id??i2),...gr(u2),style:c2,children:[e2.map(e3=>{let t3=Math.max(0,Math.min(100,e3.value/f2*100));return _("div",{className:"core-comparison-bars__bar",style:S({"--core-comparison-bars-value":`${t3}%`}),children:[g("div",{className:"core-comparison-bars__label",children:e3.label}),_("div",{className:"core-comparison-bars__track",style:S({"--core-comparison-bars-target":p2===void 0?void 0:`${p2}%`}),children:[g("div",{className:"core-comparison-bars__fill"}),g("span",{className:"core-comparison-bars__value","data-placement":t3>ni?"inside":"outside",children:Yr(e3.display,l2)}),p2!==void 0&&g("div",{className:"core-comparison-bars__target","aria-hidden":"true"})]})]},e3.label)}),t2!==void 0&&n2&&g("figcaption",{className:"core-comparison-bars__target-label",children:n2})]})}var ii=3,ai=5;function oi({items:e2,profileId:t2,profile:n2,checkboxes:r2=true,className:i2,style:a2}){return n2||Z(t2,"NextSteps"),e2.length===0?null:((e2.length<ii||e2.length>ai)&&we(`NextSteps:count:${e2.length}`,`[NextSteps] ${e2.length} step(s). A next-steps list takes three to five: fewer reads as an afterthought, more stops being a list a reader acts on this week. Rendering anyway — a document with six steps is far better than one with none.`),g("ol",{className:b("core-next-steps",i2),...Q(n2?.id??t2),style:a2,children:e2.map((e3,t3)=>_("li",{className:"core-next-steps__step",children:[g("span",{className:"core-next-steps__marker",children:e3.marker??String(t3+1).padStart(2,"0")}),r2&&g("span",{className:"core-next-steps__box","aria-hidden":"true"}),g("span",{className:"core-next-steps__body",children:e3.body})]},t3))}))}var si=38;function ci({title:e2="Notes",lines:t2=4,profileId:n2,profile:r2,className:i2,style:a2}){return r2||Z(n2,"Notes"),t2<1?null:_("section",{className:b("core-notes",i2),...Q(r2?.id??n2),style:a2,children:[g("div",{className:"core-notes__title",children:e2}),g("div",{className:"core-notes__lines","aria-hidden":"true",children:Array.from({length:t2},(e3,t3)=>g("div",{className:"core-notes__line"},t3))})]})}var li="You left this section open, so it is not covered here.";function ui({wouldTell:e2,openingLine:t2=li,profileId:n2,profile:r2,className:i2,style:a2}){return r2||Z(n2,"SkippedSection"),_("div",{className:b("core-skipped-section",i2),...Q(r2?.id??n2),style:a2,children:[g("span",{className:"core-skipped-section__standard",children:t2})," ",g("span",{className:"core-skipped-section__would-tell",children:e2})]})}var di="Nothing here is settled. If a number looks wrong, or a step does not fit your situation, say so and we will work through it together.";function fi({advisor:e2,title:t2="Talk it through",invitation:n2=di,profileId:r2,profile:i2,className:a2,style:o2}){if(i2||Z(r2,"TalkItThrough"),!e2?.name?.trim())return we("TalkItThrough:no-advisor","[TalkItThrough] no advisor name — rendering NOTHING rather than an empty box. This section is mandatory in an approved output because it is the door to a human; a door with nobody behind it passes a structural check and fails the reader."),null;let s2=[e2.phone,e2.email].filter(e3=>typeof e3=="string"&&e3.trim().length>0);return s2.length===0&&we("TalkItThrough:no-contact",`[TalkItThrough] "${e2.name}" has no phone and no email. The section is the advisor's name, HOW TO REACH THEM, and an open invitation — a name alone is not a route. Rendering, because a named advisor is still better than a dropped section.`),_("section",{className:b("core-talk-it-through",a2),...Q(i2?.id??r2),style:o2,children:[g("h3",{className:"core-talk-it-through__title",children:t2}),g("p",{className:"core-talk-it-through__invitation",children:n2}),_("div",{className:"core-talk-it-through__advisor",children:[g("div",{className:"core-talk-it-through__name",children:e2.name}),e2.role&&g("div",{className:"core-talk-it-through__role",children:e2.role}),s2.length>0&&g("div",{className:"core-talk-it-through__contact",children:s2.map(e3=>g("span",{children:e3},e3))})]})]})}var pi=38;function mi({question:e2,answer:t2,lines:n2=1,profileId:r2,profile:i2,className:a2,style:o2}){i2||Z(r2,"WriteInField");let s2=typeof t2=="string"&&t2.trim().length>0,c2=Math.max(1,n2);return _("div",{className:b("core-write-in-field",a2),"data-answered":s2?"":void 0,...Q(i2?.id??r2),style:o2,children:[e2&&g("div",{className:"core-write-in-field__question",children:e2}),s2?g("div",{className:"core-write-in-field__answer",children:t2}):Array.from({length:c2},(e3,t3)=>g("div",{className:"core-write-in-field__line","aria-hidden":"true"},t3))]})}function hi({mark:e2,identity:t2,codes:n2,profileId:r2,profile:i2,className:a2,style:o2}){return i2||Z(r2,"Masthead"),e2===void 0&&t2===void 0&&n2===void 0?null:_("header",{className:b("core-masthead",a2),"data-page-region":"page-header",...Q(i2?.id??r2),style:o2,children:[e2!==void 0&&g("div",{className:"core-masthead__mark","data-slot":"mark",children:e2}),t2!==void 0&&g("div",{className:"core-masthead__identity","data-slot":"identity",children:t2}),n2!==void 0&&g("div",{className:"core-masthead__codes","data-slot":"codes",children:n2})]})}var gi=4;function _i({fields:e2,profileId:t2,profile:n2,className:r2,style:i2}){let a2=(n2??Z(t2,"MetaRail"))?.rail.placement??"strip";return a2==="none"||e2.length===0?null:(a2!=="column"&&e2.length>gi&&typeof console<"u"&&console.warn(`[MetaRail] ${e2.length} fields in a strip; the spec allows ${gi}. Rendering all of them — check the layout.`),g("div",{className:b("core-meta-rail",r2),"data-placement":a2,...Q(n2?.id??t2),style:i2,children:e2.map(e3=>_("div",{className:"core-meta-rail__field",children:[g("div",{className:"core-meta-rail__label",children:e3.label}),g("div",{className:"core-meta-rail__value",children:e3.value})]},`${e3.label}:${e3.value}`))}))}var vi={left:"bottom-left",centre:"bottom-center",right:"bottom-right"};function yi({left:e2,centre:t2,right:n2,profileId:r2,profile:i2,className:a2,style:o2}){i2||Z(r2,"RunningFooter");let s2=[["left",e2],["centre",t2],["right",n2]].filter(([,e3])=>e3!=null);return s2.length===0?null:g("footer",{className:b("core-running-footer",a2),"data-page-region":"page-footer",...Q(i2?.id??r2),style:o2,children:s2.map(([e3,t3])=>g("span",{className:"core-running-footer__slot","data-region-slot":e3,"data-margin-box":vi[e3],children:t3},e3))})}function bi({children:e2,rail:t2,profileId:n2,profile:r2,className:i2,style:a2}){let o2=r2??Z(n2,"DocumentShell"),s2=o2?.rail.placement==="column"&&t2!==void 0;return g(jr,{children:_("div",{className:b("core-document-shell",i2),...Q(o2?.id??n2),"data-has-rail":s2?"":void 0,style:a2,children:[g("div",{className:"core-document-shell__body",children:e2}),s2&&_(h,{children:[g("div",{className:"core-document-shell__gutter","aria-hidden":true}),g("aside",{className:"core-document-shell__rail",children:t2})]})]})})}function xi(e2,t2){return!e2||e2.length===0?null:t2===0?String(e2[0]).padStart(2,"0"):e2.join(".")}function Si({entries:e2,depth:t2,title:n2,profileId:r2,profile:i2,className:a2,style:o2}){let s2=i2??Z(r2,"Contents"),c2=s2?.depth.max??Infinity,l2=e2??[],u2=t2===void 0?l2:l2.filter(e3=>e3.level<t2);if(u2.length===0)return null;let d2=s2?.depth.numbering??"none",f2=u2.some(e3=>e3.page!==void 0);return _("nav",{"aria-label":"Table of contents",className:b("core-contents",a2),...Q(i2?.id??r2),style:o2,children:[n2&&g("div",{className:"core-contents__title",children:n2}),g("ol",{className:"core-contents__list",children:u2.map(e3=>{let t3=d2==="none"?null:xi(e3.ordinal,e3.level);return _("li",{className:"core-contents__entry","data-level":e3.level,"data-overdeep":e3.level>=c2?"":void 0,style:S({"--core-contents-level":String(e3.level)}),children:[t3&&g("span",{className:"core-contents__ordinal",children:t3}),g("a",{href:`#${e3.id}`,className:"core-contents__link",children:e3.title}),f2&&g("span",{className:"core-contents__page",children:e3.page??""})]},e3.id)})})]})}function Ci({s:e2,dated:t2}){return _("div",{className:"core-execution-block__signature",children:[_("div",{className:"core-execution-block__lines",children:[g("div",{className:"core-execution-block__line","data-line":"sign"}),t2?g("div",{className:"core-execution-block__line","data-line":"date"}):null]}),_("div",{className:"core-execution-block__captions",children:[_("div",{className:"core-execution-block__party",children:[e2.role?g("div",{className:"core-execution-block__role",children:e2.role}):null,e2.name?g("div",{className:"core-execution-block__name",children:e2.name}):null,e2.detail?g("div",{className:"core-execution-block__detail",children:e2.detail}):null]}),t2?g("div",{className:"core-execution-block__date-label",children:"Date"}):null]})]})}function wi({attestation:e2,label:t2,signatories:n2,columns:r2=1,note:i2,profileId:a2,profile:o2,className:s2,style:c2}){o2||Z(a2,"ExecutionBlock");let l2=Array.isArray(n2)?n2:[];return _("section",{className:b("core-execution-block",s2),...Q(o2?.id??a2),style:c2,children:[t2?g("div",{className:"core-execution-block__label",children:t2}):null,e2?g("div",{className:"core-execution-block__attestation",children:e2}):null,g("div",{className:"core-execution-block__signatories","data-columns":r2,children:l2.map((e3,t3)=>g(Ci,{s:e3,dated:e3.dated===true},t3))}),i2?g("div",{className:"core-execution-block__note",children:i2}):null]})}function Ti({kind:e2}){return _("div",{className:"core-document-blocks__unrenderable","data-unrenderable-block":e2,role:"alert",children:[g("strong",{children:"This provision could not be rendered."})," The document contains a block of type “",e2,"”, which this bundle has no renderer for. Nothing has been omitted silently — the content is present in the source document and is missing only from this page. Do not sign or rely on this document until it renders in full."]})}function Ei({blocks:e2,profileId:t2,sectionNumbers:n2,sectionAnchors:r2,sectionTitles:i2,sectionReferences:a2,sectionOrdinal:o2,className:s2,style:c2}){let l2=Z(t2,"DocumentBlocks");if(e2.length===0)return null;let u2=zr(o2,e2.flatMap(e3=>e3.kind==="clause"?e3.items:[]),l2?.depth.numbering),d2=0,f2=(e3,o3)=>hr(e3)?mr(e3).map((e4,s3)=>e4.kind==="text"?e4.text:g(Vr,{target:e4.key,form:e4.form,sectionReferences:a2,sectionNumbers:n2,sectionTitles:i2,sectionAnchors:r2,profileId:t2},`${o3}-ref-${s3}`)):e3,p2=e2.some(e3=>e3.kind==="execution");return g("div",{className:b("core-document-blocks",s2),"data-pinned":p2?"execution":void 0,...Q(t2),style:c2,children:e2.map((e3,n3)=>{let r3=`${e3.kind}-${n3}`;switch(e3.kind){case"prose":return g(yr,{profileId:t2,full:e3.full,children:f2(e3.text,r3)},r3);case"clause":return g($r,{profileId:t2,items:e3.items.map((e4,t3)=>({marker:u2[d2++],primary:f2(e4.text,`${r3}-${t3}`),secondary:e4.note?f2(e4.note,`${r3}-${t3}-n`):void 0,missing:e4.missing}))},r3);case"definitions":return g(xr,{profileId:t2,pairs:e3.pairs.map((e4,t3)=>({term:e4.term,description:f2(e4.description,`${r3}-${t3}`)}))},r3);case"table":return g(Hr,{profileId:t2,caption:e3.caption?f2(e3.caption,`${r3}-cap`):void 0,columns:e3.columns,rows:e3.rows.map((e4,t3)=>e4.map((e5,n4)=>f2(e5,`${r3}-${t3}-${n4}`)))},r3);case"notice":return g(vr,{profileId:t2,tone:e3.tone,title:e3.title,children:f2(e3.text,r3)},r3);case"figure":return g(Nr,{profileId:t2,caption:f2(e3.caption,r3),children:e3.placeholder??null},r3);case"execution":return g(wi,{profileId:t2,label:e3.label,attestation:e3.attestation,signatories:e3.signatories,columns:e3.columns,note:e3.note},r3);default:return g(Ti,{kind:String(e3.kind)},r3)}})})}var Di=["h2","h3","h4","h5","h6"];function Oi({sectionId:e2,title:t2,level:n2=0,ordinal:r2,sectionNumbers:i2,sectionAnchors:a2,sectionTitles:o2,sectionReferences:s2,sectionLevels:c2,continued:l2=false,continuedCount:u2,children:d2,blocks:f2,profileId:p2,profile:m2,className:h2,style:v2}){let y2=m2??Z(p2,"DocumentSection"),x2=i2?.[e2],C2=c2?.[e2],w2=x2??r2,T2=C2===void 0?n2:Math.max(0,C2-1),E2=T2>=(y2?.depth.max??Infinity),D2=Math.min(T2,(y2?.depth.indent.length??1)-1)+1,O2=y2?.depth.numbering==="ladder"&&w2!==void 0&&w2.length>0,k2=O2?Lr(w2):null,A2=Di[Math.min(T2,Di.length-1)],j2=Br(a2,e2),M2=`${j2}-doc-heading`;return _("section",{id:j2,className:b("core-document-section",h2),"data-level":T2,"data-ordinal-source":w2?x2?"derived":"baked":void 0,"data-overdeep":E2?"":void 0,"aria-labelledby":M2,...Q(m2?.id??p2),style:S({"--core-document-section-indent":`var(--doc-indent-${D2}, 0)`},v2),children:[k2&&g("div",{className:"core-document-section__article",children:k2}),_(A2,{id:M2,className:"core-document-section__heading",children:[O2&&!k2&&g("span",{className:"core-document-section__ordinal",children:w2.join(".")}),t2,l2&&g("span",{className:"core-document-section__continued",children:"continued"})]}),l2&&u2&&g("div",{className:"core-document-section__count",children:`Items ${u2.from} to ${u2.to} of ${u2.of}`}),g("div",{className:"core-document-section__body",children:d2??(f2?g(Ei,{blocks:f2,profileId:p2,sectionNumbers:i2,sectionAnchors:a2,sectionTitles:o2,sectionReferences:s2,sectionOrdinal:O2?w2:void 0}):null)})]})}var ki={prose:{type:"object",required:["kind","text"],additionalProperties:false,properties:{kind:{const:"prose"},text:{type:"string",description:"ONE paragraph. Two paragraphs in one value run together on the page: emit a second prose block instead."},full:{type:"boolean",description:"Fill the measure rather than the reading-width cap. For a caption or text beside a table."}}},clause:{type:"object",required:["kind","items"],additionalProperties:false,properties:{kind:{const:"clause"},items:{type:"array",minItems:1,items:{type:"object",required:["text"],additionalProperties:false,properties:{marker:{type:"string",description:'An explicit number that overrides the derived one, only for numbering fixed by statute or a standard form. Omit it and the renderer numbers the clause from its article ("6.3").'},level:{type:"integer",minimum:1,description:"Depth within the section: 1 a clause, 2 a sub-clause, 3 a sub-sub-clause. Default 1."},id:{type:"string",pattern:"^[a-z0-9][a-z0-9_-]*$",description:"A slug, unique in the document, written only when prose cites this clause as {{ref:<section>#<id>}}. Keep it stable across edits."},text:{type:"string"},note:{type:"string",description:"A parenthetical, cross-reference or jurisdictional note set beside the text."},missing:{type:"boolean",description:"The value is not yet known. Use this instead of writing a [REQUIRED: ...] marker into the text."}}}}}},definitions:{type:"object",required:["kind","pairs"],additionalProperties:false,properties:{kind:{const:"definitions"},pairs:{type:"array",minItems:1,items:{type:"object",required:["term","description"],additionalProperties:false,properties:{term:{type:"string"},description:{type:"string"}}}}}},table:{type:"object",required:["kind","columns","rows"],additionalProperties:false,properties:{kind:{const:"table"},caption:{type:"string"},columns:{type:"array",minItems:1,items:{type:"object",required:["header"],additionalProperties:false,properties:{header:{type:"string"},align:{enum:["left","right","center"],description:"Right-align money and any other figure column."}}}},rows:{type:"array",items:{type:"array",items:{type:"string"}},description:"One array per row, each EXACTLY as long as columns. A short row is refused: a table that loses its last column loses data."}}},notice:{type:"object",required:["kind","tone","text"],additionalProperties:false,properties:{kind:{const:"notice"},tone:{enum:["note","warning","important"]},title:{type:"string"},text:{type:"string"}}},figure:{type:"object",required:["kind","caption"],additionalProperties:false,properties:{kind:{const:"figure"},caption:{type:"string",description:"Required. An uncaptioned exhibit cannot be cited from the text that relies on it."},src:{type:"string",description:"Reference the host resolves. Never a data URI."},placeholder:{type:"string",description:"Text stand-in when src is absent, so a figure never renders empty."}}},execution:{type:"object",required:["kind","signatories"],additionalProperties:false,properties:{kind:{const:"execution"},label:{type:"string"},attestation:{type:"string",description:"The attestation clause, as running text."},signatories:{type:"array",minItems:1,items:{type:"object",required:["role"],additionalProperties:false,properties:{role:{type:"string",description:'Capacity: "Testator", "Witness", "Grantor".'},name:{type:"string",description:"Printed BELOW the signing rule, never on it."},detail:{type:"string"},dated:{type:"boolean",description:"Add a second, shorter rule for the date."}}}},columns:{enum:[1,2]},note:{type:"string"}}}},Ai=["md","lg","xl"],ji=5;function Mi(e2){let t2=Ai.indexOf(e2);return t2>0?Ai[t2-1]:e2}var Ni=e2=>typeof e2=="object"&&!!e2&&"format"in e2&&"value"in e2;function Pi(e2){let t2=Number(e2);return Number.isFinite(t2)?Math.max(0,Math.min(100,t2)):0}function Fi({value:e2,label:t2,size:n2="lg",tone:r2,progress:i2,progressLabel:a2,autoStepDown:o2=true,baseProps:s2,className:c2,style:l2}){let u2=Ni(e2)?Yr(e2,Kr(s2)):e2,d2=typeof u2=="string"||typeof u2=="number"?String(u2).length:0,f2=o2&&d2>ji?Mi(n2):n2,p2=nt(r2,"strong"),{toned:m2,...h2}=rt(p2),v2=i2==null?null:Pi(i2);return _("div",{className:b("core-stat",m2&&"core-toned",c2),...h2,"data-size":f2,style:l2,children:[g("div",{className:"core-stat__value",children:u2}),t2!=null&&g(it,{className:"core-stat__label",tone:p2==="on-dark"||p2==="inherit"?p2:"subtle",children:t2}),v2!==null&&g("div",{className:"core-stat__progress",role:"progressbar","aria-label":a2??(typeof t2=="string"?t2:"Progress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":v2,style:S({"--core-stat-progress":`${v2}%`}),children:g("div",{className:"core-stat__progress-fill"})})]})}function Ii({children:e2,minColumnWidth:t2=200,maxColumns:n2=4,gap:r2=32,className:i2,style:a2}){return g("div",{className:b("core-stat-group",i2),style:S({"--core-stat-group-min":`${t2}px`,"--core-stat-group-max":String(Math.max(1,n2)),"--core-stat-group-gap":`${r2}px`},a2),children:e2})}var Li={up:[0,28],left:[-40,0],right:[40,0],none:[0,0]};function Ri({direction:e2="up",delay:t2=0,duration:n2=.5,threshold:r2=.15,once:i2=true,className:a2,style:o2,children:c2}){let l2=f(null),[u2,d2]=p(false);s(()=>{let e3=l2.current;if(!e3)return;if(typeof IntersectionObserver>"u"){d2(true);return}let t3=new IntersectionObserver(e4=>{let n3=e4[e4.length-1];n3&&(n3.isIntersecting?(d2(true),i2&&t3.disconnect()):i2||d2(false))},{threshold:Math.min(1,Math.max(0,r2))});return t3.observe(e3),()=>t3.disconnect()},[i2,r2]);let[m2,h2]=Li[e2];return g("div",{ref:l2,className:b("core-reveal",a2),"data-revealed":u2?"true":"false",style:S({"--core-reveal-x":`${m2}px`,"--core-reveal-y":`${h2}px`,"--core-reveal-duration":`${n2}s`,"--core-reveal-delay":`${t2}s`},o2),children:c2})}function zi({eyebrow:e2,title:t2,description:n2,trailing:r2,level:i2=2,revealDelay:a2=0,className:o2,style:s2}){let c2=i2===3,l2=c2?"h3":"h2";return g(Ri,{direction:"up",delay:a2,className:b("core-section-header",o2),style:s2,children:_("div",{className:"core-section-header__inner","data-described":n2?"true":void 0,"data-level":c2?"3":void 0,children:[_("div",{className:"core-section-header__text",children:[e2?g(it,{className:"core-section-header__eyebrow",children:e2}):null,g(l2,{className:"core-section-header__title",children:t2}),n2?g("p",{className:"core-section-header__description",children:n2}):null]}),r2!=null&&r2!==""?g("div",{className:"core-section-header__trailing",children:r2}):null]})})}function Bi({tone:e2,label:t2,headline:n2,children:r2,trailing:i2,className:a2,style:o2}){let s2=et(e2,"accent"),c2=i2!=null&&i2!=="";return _("div",{className:b("core-highlight-box","core-toned",a2),"data-tone":s2,style:o2,children:[_("div",{className:"core-highlight-box__text",children:[t2?g("div",{className:"core-highlight-box__label",children:t2}):null,n2?g("div",{className:"core-highlight-box__headline",children:n2}):null,r2!=null&&r2!==""?g("div",{className:"core-highlight-box__body",children:r2}):null]}),c2?g("div",{className:"core-highlight-box__trailing",children:i2}):null]})}var Vi=60,Hi=400,Ui=12,Wi=(e2,t2)=>{if(typeof e2!="string")return"";let n2=e2.replace(/\s+/g," ").trim();return n2.length>t2?`${n2.slice(0,t2-1)}…`:n2},Gi=e2=>typeof e2=="string"&&/^\/(?![/\\])[^\s\u0000-\u001f]*$/.test(e2)?e2:null,Ki=e2=>typeof e2=="number"&&Number.isFinite(e2)&&e2>0?Math.round(e2):void 0;function qi({name:e2,description:t2,takes:n2,sketch:r2,className:i2,style:a2}){let o2=Wi(e2,Vi);if(!o2)return null;let s2=Wi(t2,Hi),c2=(Array.isArray(n2)?n2:[]).map(e3=>({name:Wi(e3?.name,Vi),type:Wi(e3?.type,60),note:Wi(e3?.note,160)})).filter(e3=>e3.name).slice(0,Ui),l2=Gi(r2?.src),u2=Ki(r2?.w),d2=Ki(r2?.h);return _("section",{className:b("core-proposed-component",i2),style:a2,"aria-label":`Proposed component: ${o2}`,children:[g("p",{className:"core-proposed-component__mark",children:"Proposed"}),g("h3",{className:"core-proposed-component__name",children:o2}),s2?g("p",{className:"core-proposed-component__description",children:s2}):null,l2?g("img",{className:"core-proposed-component__sketch",src:l2,alt:Wi(r2?.alt,160),loading:"lazy",...u2&&d2?{width:u2,height:d2}:{}}):null,c2.length?_("div",{className:"core-proposed-component__takes",children:[g("p",{className:"core-proposed-component__heading",children:"Would take"}),g("ul",{children:c2.map(e3=>_("li",{children:[g("code",{children:e3.name}),e3.type?g("span",{className:"core-proposed-component__type",children:e3.type}):null,e3.note?g("span",{className:"core-proposed-component__note",children:e3.note}):null]},e3.name))})]}):null]})}function Ji({label:e2,children:t2,className:n2,style:r2}){return _("div",{className:b("core-disclaimer-block",n2),style:r2,children:[e2?_(h,{children:[g("strong",{className:"core-disclaimer-block__label",children:e2})," "]}):null,t2]})}function Yi(e2){let t2=Number(e2);return Number.isFinite(t2)?Math.max(0,Math.min(100,t2)):0}function Xi({label:e2,value:t2,fillPercent:n2,subtitle:r2,tone:i2,baseProps:a2,className:o2,style:s2}){let c2=Kr(a2),l2=Yi(n2);return _("div",{className:b("core-stat-strip","core-toned",o2),"data-tone":et(i2,"info"),style:S({"--core-stat-strip-fill":`${l2}%`},s2),children:[_("div",{className:"core-stat-strip__row",children:[g("span",{className:"core-stat-strip__label",children:e2}),g("span",{className:"core-stat-strip__value",children:Yr(t2,c2)})]}),g("div",{className:"core-stat-strip__track",children:g("div",{className:"core-stat-strip__fill"})}),r2?g("div",{className:"core-stat-strip__subtitle",children:Yr(r2,c2)}):null]})}function Zi({text:e2,tone:t2,locale:n2,className:r2}){return g("span",{className:b("core-value-badge","core-toned",r2),"data-tone":et(t2),children:Yr(e2,n2)})}var Qi=8,$i={good:"success",warn:"warning",critical:"danger"};function ea(e2,t2,n2){let r2={series:String(n2%Qi+1)},i2=e2??t2;if(typeof i2!="string"||i2==="")return r2;if(i2==="muted")return{series:"muted"};let a2=/^series-([1-9]\d*)$/.exec(i2);if(a2)return{series:String((Number(a2[1])-1)%Qi+1)};let o2=$i[i2];return o2?{tone:o2}:Qe.includes(i2)?{tone:i2}:(we("OptionCard:colour",`[OptionCard] bar fill "${i2}" is not a tone or a series slot; using the chart series by position. Name a tone (success, danger, …) or a slot (series-1…series-8).`),r2)}function ta(e2){return typeof e2=="number"&&Number.isFinite(e2)?{text:String(e2).padStart(2,"0"),kind:"numeral"}:typeof e2!="string"||e2.trim()===""?null:/^\d+$/.test(e2.trim())?{text:e2.trim().padStart(2,"0"),kind:"numeral"}:{text:e2,kind:"label"}}function na(e2){let{number:t2,title:n2,description:r2,badgeText:i2,badgeTone:a2,bars:o2,tone:s2,isSelected:c2=false,className:l2,style:u2}=e2,d2=Kr(e2.baseProps),f2=Array.isArray(o2)?o2:[],p2=ta(t2);return _("div",{className:b("core-option-card",l2),"data-selected":c2?"true":void 0,"data-described":r2?"true":void 0,style:u2,children:[_("div",{className:"core-option-card__head",children:[p2?g("div",{className:"core-option-card__number","data-kind":p2.kind,children:p2.text}):g("span",{}),i2!=null&&i2!==""?g(Zi,{text:i2,tone:et(a2),locale:d2}):null]}),n2?g("div",{className:"core-option-card__title",children:n2}):null,r2?g("p",{className:"core-option-card__description",children:r2}):null,f2.map((e3,t3)=>{let n3=ea(e3.tone,s2,t3),r3=Math.min(100,Math.max(0,Number(e3.fillPercent)||0)),i3=e3.valueTone===void 0||e3.valueTone==="default"?void 0:et(e3.valueTone);return _("div",{className:"core-option-card__bar",children:[_("div",{className:"core-option-card__bar-head",children:[g("span",{className:"core-option-card__bar-label",children:e3.label}),g("span",{className:b("core-option-card__bar-value",i3&&"core-toned"),"data-tone":i3,children:Yr(e3.value,d2)})]}),g("div",{className:"core-option-card__track",children:g("div",{className:b("core-option-card__fill","tone"in n3&&"core-toned"),"data-tone":"tone"in n3?n3.tone:void 0,"data-series":"series"in n3?n3.series:void 0,style:S({"--core-option-card-fill":`${r3}%`})})})]},t3)})]})}function ra(e2){let{title:t2,subtitle:n2,rows:r2,className:i2,style:a2}=e2,o2=Kr(e2.baseProps),s2=e2.tone??"info",c2=s2==="none",l2=Array.isArray(r2)?r2:[];return _("div",{className:b("core-profile-card",!c2&&"core-toned",i2),"data-tone":c2?void 0:et(s2,"info"),"data-marker":c2?"none":void 0,style:a2,children:[_("div",{className:"core-profile-card__head",children:[g("div",{className:"core-profile-card__title",children:t2}),n2?g("div",{className:"core-profile-card__subtitle",children:n2}):null]}),l2.map((e3,t3)=>_("div",{className:"core-profile-card__row",children:[g("span",{className:"core-profile-card__label",children:e3.label}),_("div",{className:"core-profile-card__end",children:[g("span",{className:"core-profile-card__value",children:Yr(e3.value,o2)}),e3.badge?g(Zi,{text:e3.badge.text,tone:et(e3.badge.tone),locale:o2}):null]})]},t3))]})}function ia(e2){if(typeof e2=="string"){let t2=e2.trim();return t2.startsWith("+")?"up":t2.startsWith("-")||t2.startsWith("−")?"down":"flat"}return e2&&typeof e2=="object"&&typeof e2.value=="number"?e2.value>0?"up":e2.value<0?"down":"flat":"flat"}var aa={up:"▲",down:"▼",flat:"—"},oa={up:"success",down:"danger",flat:void 0},sa=e2=>e2!=null&&e2!=="";function ca(e2){let{columns:t2=4,gap:n2="tight",minColumnWidth:r2,className:i2,style:a2}=e2,o2=Kr(e2.baseProps),s2=Array.isArray(e2.cards)?e2.cards:[],c2=Math.max(1,Math.min(6,Math.round(Number(t2))||4));return g("div",{className:b("core-kpi-card-grid",i2),"data-gap":n2==="normal"?"normal":"tight",style:S({"--core-kpi-card-grid-columns":String(c2),"--core-kpi-card-grid-min":typeof r2=="number"&&r2>0?`${r2}px`:void 0},a2),children:s2.map((e3,t3)=>{let{subtitle:n3,badge:r3}=e3,i3=sa(e3.tone)?et(e3.tone):void 0,a3=sa(e3.delta)?ia(e3.delta):void 0,s3=a3?oa[a3]:void 0;return g(Ri,{direction:"up",className:"core-kpi-card-grid__item",children:_("div",{className:b("core-kpi-card-grid__card",i3&&"core-toned"),"data-tone":i3,children:[_("div",{className:"core-kpi-card-grid__head",children:[g("div",{className:"core-kpi-card-grid__label",children:e3.label}),r3&&sa(r3.text)?g(Zi,{text:r3.text,tone:et(r3.tone),locale:o2}):null]}),g("div",{className:"core-kpi-card-grid__value",children:Yr(e3.value,o2)}),a3?_("div",{className:b("core-kpi-card-grid__delta",s3&&"core-toned"),"data-tone":s3,"data-direction":a3,children:[g("span",{"aria-hidden":"true",children:aa[a3]})," ",Yr(e3.delta,o2)]}):null,sa(n3)?g("div",{className:"core-kpi-card-grid__subtitle",children:Yr(n3,o2)}):null]})},t3)})})}var la=/\{([A-Za-z_][A-Za-z0-9_]*)\}/g;function ua(e2,t2){if(typeof e2!="string"||e2==="")return;let n2=false,r2=e2.replace(la,(e3,r3)=>{let i2=t2[r3];return i2==null||i2===""?(n2=true,""):encodeURIComponent(String(i2))});return n2?void 0:r2}var da=new Set(["http:","https:","mailto:","tel:"]);function fa(e2){let t2=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e2.replace(/[\u0000- ]/g,""));return t2?`${t2[1].toLowerCase()}:`:null}function pa(e2){if(typeof e2!="string"||!e2.trim())return null;let t2=fa(e2.trim());return t2===null||da.has(t2)?e2.trim():(we(`unsafe-href:${t2}`,`Refused a link with the "${t2}" scheme; links are relative, http(s):, mailto: or tel:`),null)}function ma(e2){if(typeof e2!="string"||!e2.trim())return null;let t2=e2.trim(),n2=fa(t2);return n2===null||n2==="https:"||n2==="data:"&&/^data:image\//i.test(t2.replace(/[\u0000- ]/g,""))?t2:(we(`unsafe-src:${n2}`,`Refused an image with the "${n2}" scheme; images are relative, https: or data:image/`),null)}var ha=["title","meta","badge","value"];function ga(e2){if(typeof e2=="string"&&e2!==""&&e2!=="default")return et(e2)}var _a=e2=>!!(e2&&typeof e2=="object"&&"value"in e2&&"format"in e2),va=e2=>!!(e2&&typeof e2=="object"&&!Array.isArray(e2)&&!i(e2)&&"value"in e2&&!("format"in e2));function ya(e2){return va(e2)?e2:{value:e2}}var ba=/^\d{4}-\d{2}-\d{2}$/,xa=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?)?$/;function Sa(e2,t2,n2){if(!xa.test(e2))return e2;let r2=ba.test(e2),i2=new Date(r2?`${e2}T00:00:00Z`:e2.replace(" ","T"));return Number.isNaN(i2.getTime())?e2:i2.toLocaleString(n2,{year:"numeric",month:"short",day:"numeric",...t2==="datetime"&&!r2?{hour:"numeric",minute:"2-digit"}:{},...r2?{timeZone:"UTC"}:{}})}function Ca(e2){if(!/^[a-z][a-z0-9]*([_-][a-z0-9]+)+$/.test(e2))return e2;let t2=e2.replace(/[_-]+/g," ");return t2[0].toUpperCase()+t2.slice(1)}var wa=new Set(["currency","currency-k","currency-m","currency-compact","currency-monthly","percent","fraction-percent","age","years","year","number"]),Ta={fraction:"fraction-percent"};function Ea(e2,t2,n2,r2){if(t2==="unit"){let t3=typeof n2=="string"?n2.trim():"",i2=Ta[t3]??(wa.has(t3)?t3:void 0);return Yr(i2?{value:e2,format:i2}:{value:e2,format:"number",...t3?{unit:t3}:{}},r2)}return t2&&wa.has(t2)?Zr(t2,e2,{locale:r2}):String(e2)}function Da(e2,t2,n2,r2){return typeof e2=="string"&&t2==="raw"?e2:typeof e2=="string"&&(t2==="date"||t2==="datetime")?Sa(e2,t2,r2.locale):typeof e2=="string"?Yr(Ca(e2),r2):_a(e2)?Yr(e2,r2):typeof e2=="number"?Ea(e2,t2,n2,r2):i(e2)?e2:null}function Oa({title:e2,subtitle:t2,columns:n2,rows:r2,baseProps:i2,hrefTemplate:a2,rowHeadingLevel:o2,actionsWidth:s2,className:l2,style:u2}){let d2=Kr(i2),f2=`${c()}-title`,p2=Array.isArray(n2)?n2:[],m2=Array.isArray(r2)?r2:[],h2=a2?m2.map(e3=>pa(e3.href)?e3:{...e3,href:ua(a2,{id:e3.id})}):m2,v2=e3=>p2[e3]?.align??(e3===0?"left":"right"),y2=e3=>{let t3=e3.cells;return Array.isArray(t3)?t3:t3&&typeof t3=="object"?p2.map(e4=>t3[e4.key]):[]},x2=e3=>e3&&ha.includes(e3.role)?e3.role:void 0;return p2.some(e3=>x2(e3))?g(ja,{title:e2,subtitle:t2,titleId:f2,safeColumns:p2,safeRows:h2,loc:d2,rowHeadingLevel:o2,actionsWidth:s2,className:l2,style:u2,cellsOf:y2,roleOf:x2}):g(Ri,{direction:"up",children:_("div",{className:b("core-data-table",l2),style:u2,children:[e2||t2?_("div",{className:"core-data-table__head",children:[e2?g("div",{id:f2,className:"core-data-table__title",children:e2}):null,t2?g("div",{className:"core-data-table__subtitle",children:t2}):null]}):null,g("div",{className:"core-data-table__scroll",role:"region","aria-label":e2?void 0:"Data table, scrollable","aria-labelledby":e2?f2:void 0,tabIndex:0,children:_("table",{className:"core-data-table__table",children:[g("thead",{children:g("tr",{children:p2.map((e3,t3)=>_("th",{scope:"col",className:"core-data-table__col","data-align":v2(t3),style:S({"--core-data-table-min":typeof e3.minWidth=="number"&&e3.minWidth>0?`${e3.minWidth}px`:void 0}),children:[e3.header,e3.sublabel?g("span",{className:"core-data-table__sublabel",children:e3.sublabel}):null]},t3))})}),g("tbody",{children:h2.map((e3,t3)=>{let{highlighted:n3,total:r3}=e3,i3=y2(e3);return g("tr",{className:"core-data-table__row","data-highlighted":n3?"true":void 0,"data-total":r3?"true":void 0,children:i3.map((t4,n4)=>{let r4=ya(t4),i4=ga(r4.tone),a3={className:b("core-data-table__cell",i4&&"core-toned"),"data-align":v2(n4),"data-tone":i4};return n4===0?g("th",{scope:"row",...a3,children:Da(r4.value,p2[n4]?.format,e3.unit,d2)},n4):g("td",{...a3,children:Da(r4.value,p2[n4]?.format,e3.unit,d2)},n4)})},t3)})})]})})]})})}var ka=e2=>e2!=null&&e2!==false&&e2!=="",Aa=e2=>typeof e2=="number"&&Number.isInteger(e2)&&e2>=2&&e2<=6?e2:void 0;function ja({title:e2,subtitle:n2,titleId:r2,safeColumns:i2,safeRows:a2,loc:o2,rowHeadingLevel:s2,actionsWidth:c2,className:l2,style:u2,cellsOf:d2,roleOf:f2}){let p2=i2.map(e3=>f2(e3)),m2=Math.max(0,p2.indexOf("title")),v2=p2.findIndex((e3,t2)=>e3==="badge"&&t2!==m2),y2=p2.findIndex((e3,t2)=>e3==="value"&&t2!==m2),x2=i2.map((e3,t2)=>t2).filter(e3=>e3!==m2&&e3!==v2&&e3!==y2),S2=i2.some(e3=>ka(e3.header)),C2=e2?{"aria-labelledby":r2}:{"aria-label":"Data table"},w2=Aa(s2),T2=a2.some(e3=>ka(e3.actions)),E2=typeof c2=="number"&&c2>0?c2:6,D2=i2.reduce((e3,t2)=>e3+(typeof t2.width=="number"&&t2.width>0?t2.width:0),0)+(T2?E2:0),O2=i2.map(e3=>typeof e3.width=="number"&&e3.width>0?0:typeof e3.weight=="number"&&e3.weight>0?e3.weight:1),k2=O2.reduce((e3,t2)=>e3+t2,0)||1,A2=e3=>{let t2=i2[e3]?.width;if(typeof t2=="number"&&t2>0)return`${t2}rem`;let n3=(O2[e3]??1)/k2;return D2>0?`calc((100% - ${D2}rem) * ${n3.toFixed(4)})`:`${(n3*100).toFixed(3)}%`},j2=e3=>i2[e3]?.align??"left";return g(Ri,{direction:"up",children:_("div",{className:b("core-data-table",l2),style:u2,"data-records":"",children:[e2||n2?_("div",{className:"core-data-table__head",children:[e2?g("div",{id:r2,className:"core-data-table__title",children:e2}):null,n2?g("div",{className:"core-data-table__subtitle",children:n2}):null]}):null,g("div",{className:"core-data-table__wide",children:_("table",{className:"core-data-table__table",...C2,children:[_("colgroup",{children:[i2.map((e3,t2)=>g("col",{style:{width:A2(t2)}},t2)),T2?g("col",{style:{width:`${E2}rem`}}):null]}),S2?g("thead",{children:_("tr",{children:[i2.map((e3,t2)=>g("th",{scope:"col",className:"core-data-table__col","data-align":j2(t2),children:e3.header},t2)),T2?g("th",{scope:"col",className:"core-data-table__col","data-align":"right",children:g("span",{className:"core-data-table__sr",children:"Actions"})}):null]})}):null,g("tbody",{children:a2.map((e3,t2)=>{let n3=d2(e3),r3=pa(e3.href);return _("tr",{className:"core-data-table__row","data-highlighted":e3.highlighted?"true":void 0,"data-total":e3.total?"true":void 0,children:[i2.map((t3,i3)=>{let a3=ya(n3[i3]),s3=ga(a3.tone),c3=Da(a3.value,t3.format,e3.unit,o2),l3={className:b("core-data-table__cell",s3&&"core-toned"),"data-align":j2(i3),"data-tone":s3};if(i3===m2){let t4=r3&&ka(c3)?g("a",{className:"core-data-table__link",href:r3,children:c3}):c3;return g("th",{scope:"row","data-role":"title",...l3,children:ka(e3.leading)?_("div",{className:"core-data-table__titlecell",children:[g("span",{className:"core-data-table__lead",children:e3.leading}),t4]}):t4},i3)}let u3=p2[i3]??"meta";return g("td",{"data-role":u3,title:(u3==="badge"||u3==="value")&&typeof a3.value=="string"&&typeof c3=="string"?c3:void 0,...l3,children:c3},i3)}),T2?g("td",{className:"core-data-table__cell","data-role":"actions","data-align":"right",children:ka(e3.actions)?e3.actions:null}):null]},t2)})})]})}),g("ul",{className:"core-data-table__records",...C2,children:a2.map((e3,n3)=>{let r3=d2(e3),a3=t2=>t2<0?null:Da(ya(r3[t2]).value,i2[t2]?.format,e3.unit,o2),s3=x2.map(a3).filter(ka);return g(Xe,{as:"li",title:a3(m2),titleLevel:w2,href:pa(e3.href)??void 0,leading:ka(e3.leading)?e3.leading:void 0,actions:ka(e3.actions)?e3.actions:void 0,badge:ka(a3(v2))?g("span",{className:"core-data-table__badge-text",title:typeof ya(r3[v2]).value=="string"&&typeof a3(v2)=="string"?a3(v2):void 0,children:a3(v2)}):void 0,meta:s3.length?g(h,{children:s3.map((e4,n4)=>_(t,{children:[n4>0?" · ":null,e4]},n4))}):void 0,value:a3(y2)||void 0},n3)})})]})})}function Ma(e2){let{event:t2,href:n2,locale:r2,timeZone:i2,size:a2,className:o2,style:s2}=e2,c2=t2&&typeof t2=="object"?t2:{name:""},l2=Dt(c2,r2,i2),u2=c2.status&&c2.status!=="confirmed"?c2.status:void 0,d2=_(h,{children:[_("div",{className:"core-event-card__top",children:[c2.typeName?g("span",{className:"core-event-card__type",children:c2.typeName}):null,u2?g("span",{className:"core-event-card__status","data-status":u2,children:u2}):null]}),g("div",{className:"core-event-card__name",children:c2.name}),l2?g("div",{className:"core-event-card__when",children:l2}):null,c2.location?g("div",{className:"core-event-card__where",children:c2.location}):null]});return g("div",{className:b("core-event-card",o2),"data-kind":c2.kind,"data-status":c2.status,"data-size":a2==="compact"?"compact":void 0,style:s2,children:n2?g("a",{className:"core-event-card__link",href:n2,children:d2}):d2})}var Na={accepted:"Accept",tentative:"Maybe",declined:"Decline"};function Pa(e2){let{actions:t2,className:n2,style:r2}=e2,[i2,a2]=p(e2.response),[o2,s2]=p(false),[c2,l2]=p(""),u2=t2?.respond,d2=async e3=>{if(!u2||o2)return;s2(true),l2("");let t3=await u2({response:e3});s2(false),t3.success?a2(e3):l2(jt(t3))};return _("div",{className:b("core-event-respond",n2),style:r2,children:[g("div",{className:"core-event-respond__choices",role:"group","aria-label":"Your response",children:St.map(e3=>g("button",{type:"button",className:"core-event-respond__choice","aria-pressed":i2===e3,disabled:!u2||o2,onClick:()=>void d2(e3),children:Na[e3]},e3))}),c2?g("p",{className:"core-event-respond__message",role:"alert",children:c2}):null]})}function Fa(e2){let{event:t2,actions:n2,viewerResponse:r2,locale:i2,timeZone:a2,className:o2,style:s2}=e2,c2=[["Edit",e2.editHref],["Reschedule",e2.rescheduleHref],["Add note",e2.noteHref],["Cancel the event",e2.cancelHref]].filter(e3=>typeof e3[1]=="string"&&e3[1]!==""),l2=t2&&typeof t2=="object"?t2:{name:""},u2=Array.isArray(e2.notes)?e2.notes:[],d2=Array.isArray(e2.participants)?e2.participants:[],f2=Dt(l2,i2,a2);return _("article",{className:b("core-event-detail",o2),"data-status":l2.status,style:s2,children:[_("header",{className:"core-event-detail__head",children:[l2.typeName?g("div",{className:"core-event-detail__type",children:l2.typeName}):null,g("h2",{className:"core-event-detail__name",children:l2.name}),f2?g("div",{className:"core-event-detail__meta",children:f2}):null,l2.location?g("div",{className:"core-event-detail__meta",children:l2.location}):null,l2.status&&l2.status!=="confirmed"?g("div",{className:"core-event-detail__status",children:l2.status}):null]}),c2.length>0?g("div",{className:"core-event-detail__manage",role:"group","aria-label":"Change this event",children:c2.map(([e3,t3])=>g("a",{className:"core-event-detail__action",href:t3,children:e3},e3))}):null,r2===void 0?null:g(Pa,{response:r2,actions:n2,className:"core-event-detail__respond"}),d2.length?_("section",{className:"core-event-detail__section","aria-label":"Participants",children:[g("h3",{className:"core-event-detail__heading",children:"Participants"}),g("ul",{className:"core-event-detail__list",children:d2.map((e3,t3)=>_("li",{className:"core-event-detail__person",children:[g("span",{children:e3.name}),g("span",{className:"core-event-detail__muted",children:[e3.role,e3.response&&e3.response!=="needs_action"?e3.response:void 0].filter(Boolean).join(" · ")})]},t3))})]}):null,u2.length?_("section",{className:"core-event-detail__section","aria-label":"Notes",children:[g("h3",{className:"core-event-detail__heading",children:"Notes"}),u2.map((e3,t3)=>_("div",{className:"core-event-detail__note","data-audience":e3.audience,children:[e3.audience==="staff"?g("div",{className:"core-event-detail__badge",children:"Staff only"}):null,g("p",{className:"core-event-detail__body",children:e3.body}),e3.author||e3.createdAt?g("div",{className:"core-event-detail__muted",children:[e3.author,e3.createdAt?new Date(e3.createdAt).toLocaleString(i2,{timeZone:a2}):void 0].filter(Boolean).join(" · ")}):null]},t3))]}):null]})}var Ia=e2=>{let t2=e2?.dataSchema?.properties??{},n2=new Set(e2?.dataSchema?.required??[]);return Object.entries(t2).map(([e3,t3])=>[e3,t3,n2.has(e3)])};function La(e2){let{orgId:t2,projectId:n2,actions:r2,onDone:i2,canWriteStaffNotes:a2,className:o2,style:s2}=e2,l2=Array.isArray(e2.types)?e2.types:[],d2=c(),[f2,m2]=p(e2.defaultTypeId??l2[0]?.id??""),h2=l2.find(e3=>e3.id===f2),v2=h2?.kind==="scheduled",[y2,x2]=p(""),[S2,C2]=p(At()),[w2,T2]=p(""),[E2,D2]=p(""),[O2,k2]=p({}),[A2,j2]=p(""),[M2,N2]=p(!!a2),[P2,F2]=p(false),[I2,L2]=p(""),R2=u(()=>Ia(h2),[h2]);if(!l2.length)return g("p",{className:b("core-event-log","core-event-log__empty",o2),style:s2,children:"There's nothing you can log here."});let z2=async o3=>{if(o3.preventDefault(),!r2?.logEvent||P2||!h2)return;F2(true),L2("");let s3=kt(S2),c2={event_type_id:h2.id,org_id:t2,name:y2.trim()||h2.name,starts_at:s3,tzid:Ot(),data:O2,subjects:e2.subjects?[...e2.subjects]:[]};n2&&(c2.project_id=n2),v2&&w2&&(c2.ends_at=kt(w2)),E2.trim()&&(c2.location=E2.trim());let l3=A2.trim()?[{body:A2.trim(),audience:a2&&M2?"staff":"shared"}]:void 0,u2=await r2.logEvent(l3?{event:c2,notes:l3}:{event:c2});F2(false),u2.success?(x2(""),j2(""),k2({}),i2?.(u2)):L2(jt(u2))},B2=(e3,t3)=>k2(n3=>({...n3,[e3]:t3}));return _("form",{className:b("core-event-log",o2),style:s2,onSubmit:e3=>void z2(e3),children:[_("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:"Type"}),g("select",{value:f2,onChange:e3=>{m2(e3.target.value),k2({})},children:l2.map(e3=>g("option",{value:e3.id,children:e3.name},e3.id))})]}),_("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:"Title"}),g("input",{value:y2,onChange:e3=>x2(e3.target.value),placeholder:h2?.name})]}),_("div",{className:"core-event-log__row",children:[_("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:v2?"Starts":"When"}),g("input",{type:"datetime-local",required:true,value:S2,onChange:e3=>C2(e3.target.value)})]}),v2?_("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:"Ends"}),g("input",{type:"datetime-local",value:w2,min:S2,onChange:e3=>T2(e3.target.value)})]}):null]}),_("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:"Where"}),g("input",{value:E2,onChange:e3=>D2(e3.target.value)})]}),R2.map(([e3,t3,n3])=>{let r3=t3.title??e3;if(t3.enum)return _("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:r3}),_("select",{required:n3,value:String(O2[e3]??""),onChange:t4=>B2(e3,t4.target.value||void 0),children:[g("option",{value:"",children:"—"}),t3.enum.map(e4=>g("option",{value:e4,children:e4},e4))]})]},e3);if(t3.type==="boolean")return _("label",{className:"core-event-log__check",children:[g("input",{type:"checkbox",checked:!!O2[e3],onChange:t4=>B2(e3,t4.target.checked)}),g("span",{children:r3})]},e3);let i3=t3.type==="number"||t3.type==="integer";return _("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:r3}),g("input",{type:i3?"number":"text",step:t3.type==="integer"?1:"any",required:n3,value:O2[e3]===void 0?"":String(O2[e3]),onChange:t4=>B2(e3,t4.target.value===""?void 0:i3?Number(t4.target.value):t4.target.value)})]},e3)}),_("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:"Note"}),g("textarea",{rows:3,value:A2,onChange:e3=>j2(e3.target.value)})]}),a2&&A2.trim()?_("label",{className:"core-event-log__check",children:[g("input",{type:"checkbox",checked:M2,onChange:e3=>N2(e3.target.checked)}),g("span",{children:"Staff only: the client won't see this note"})]}):null,I2?g("p",{id:`${d2}-error`,className:"core-event-log__message",role:"alert",children:I2}):null,g("div",{className:"core-event-log__actions",children:g("button",{type:"submit",className:"core-event-log__submit",disabled:P2||!r2?.logEvent,children:P2?"Saving…":v2?"Schedule":"Log"})})]})}var Ra=(e2,t2)=>new Intl.DateTimeFormat(t2,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`));function za(e2){let t2=E(),{view:n2="week",weekParam:r2="week",linkParams:i2,eventHref:a2="?panel=event:{id}",locale:o2,timeZone:s2,renderComponent:c2,label:l2="Schedule",className:u2,style:d2}=e2,f2=e3=>`?${i2?new URLSearchParams({...i2,[r2]:e3}).toString():`${r2}=${e3}`}`,p2=Array.isArray(e2.occurrences)?e2.occurrences:[],m2=Mt(new Date,s2),h2=Nt(/^\d{4}-\d{2}-\d{2}$/.test(e2.weekOf??"")?e2.weekOf:m2),v2=Array.from({length:7},(e3,t3)=>Y(h2,t3)),y2=new Map(v2.map(e3=>[e3,[]]));for(let e3 of p2)for(let t3 of Pt(e3,s2))y2.get(t3)?.push(e3);for(let e3 of y2.values())e3.sort((e4,t3)=>+!e4.startOn-!t3.startOn||(e4.startsAt??"").localeCompare(t3.startsAt??""));let x2=n2==="agenda"?v2.filter(e3=>y2.get(e3).length):v2;return _("section",{className:b("core-event-schedule",u2),"data-view":n2,style:d2,"aria-label":l2,children:[_("div",{className:"core-event-schedule__nav",children:[t2?null:g("a",{className:"core-event-schedule__step",href:f2(Y(h2,-7)),"aria-label":"Previous week",children:"‹"}),g("span",{className:"core-event-schedule__range",children:`${Ra(v2[0],o2)} – ${Ra(v2[6],o2)}`}),t2?null:g("a",{className:"core-event-schedule__step",href:f2(Y(h2,7)),"aria-label":"Next week",children:"›"})]}),x2.length===0?g("p",{className:"core-event-schedule__empty",children:"Nothing scheduled this week."}):null,g("ol",{className:"core-event-schedule__days",children:x2.map(e3=>{let t3=y2.get(e3);return _("li",{className:"core-event-schedule__day","data-today":e3===m2||void 0,children:[g("h3",{className:"core-event-schedule__date",children:Ra(e3,o2)}),t3.length?g("ul",{className:"core-event-schedule__events",children:t3.map((e4,t4)=>g("li",{children:bt(e4,c2,{href:Ft(a2,e4.id),locale:o2,timeZone:s2})??g(Ma,{event:e4,href:Ft(a2,e4.id),locale:o2,timeZone:s2})},`${e4.id??t4}-${e4.startsAt??e4.startOn??t4}`))}):g("p",{className:"core-event-schedule__none",children:"—"})]},e3)})})]})}var Ba=(e2,t2)=>new Intl.DateTimeFormat(t2,{weekday:"long",month:"long",day:"numeric",year:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`));function Va(e2){let{eventHref:t2="?panel=event:{id}",emptyText:n2="No activity yet.",locale:r2,timeZone:i2,renderComponent:a2,className:o2,style:s2}=e2,c2=[...(Array.isArray(e2.items)?e2.items:[]).filter(e3=>e3&&!Number.isNaN(new Date(e3.at).getTime()))].sort((e3,t3)=>new Date(t3.at).getTime()-new Date(e3.at).getTime()),l2=[];for(let e3 of c2){let t3=Mt(e3.at,i2),n3=l2[l2.length-1];n3&&n3[0]===t3?n3[1].push(e3):l2.push([t3,[e3]])}let u2=new Intl.DateTimeFormat(r2,{hour:"numeric",minute:"2-digit",timeZone:i2});return _("section",{className:b("core-event-timeline",o2),style:s2,"aria-label":"Activity",children:[l2.length===0?g("p",{className:"core-event-timeline__empty",children:n2}):null,l2.map(([e3,n3])=>_("section",{className:"core-event-timeline__day",children:[g("h3",{className:"core-event-timeline__date",children:Ba(e3,r2)}),g("ol",{className:"core-event-timeline__items",children:n3.map((e4,n4)=>_("li",{className:"core-event-timeline__item","data-op":e4.op||void 0,children:[_("div",{className:"core-event-timeline__line",children:[g("time",{className:"core-event-timeline__time",dateTime:e4.at,children:u2.format(new Date(e4.at))}),e4.summary?g("span",{className:"core-event-timeline__summary",children:e4.summary}):null,e4.actor?g("span",{className:"core-event-timeline__actor",children:e4.actor}):null]}),e4.event?bt(e4.event,a2,{href:Ft(t2,e4.event.id),locale:r2,timeZone:i2})??g(Ma,{event:e4.event,href:Ft(t2,e4.event.id),locale:r2,timeZone:i2}):null]},e4.id??`${e4.at}-${n4}`))})]},e3))]})}var Ha=1440;function Ua(e2){return new Intl.DateTimeFormat("en-CA",{timeZone:e2,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Wa(e2,t2){let n2=e2 instanceof Date?e2:new Date(e2);if(Number.isNaN(n2.getTime()))return null;let r2=Object.fromEntries(Ua(t2).formatToParts(n2).map(e3=>[e3.type,e3.value]));return{date:`${r2.year}-${r2.month}-${r2.day}`,minutes:Number(r2.hour)*60+Number(r2.minute)+Number(r2.second)/60}}var Ga=e2=>e2.busyOnly===true;function Ka(e2,t2){if(!e2.startsAt)return null;let n2=Wa(e2.startsAt,t2);if(!n2)return null;let r2=new Date(e2.startsAt).getTime(),i2=e2.endsAt?new Date(e2.endsAt).getTime():NaN,a2=Wa(Number.isFinite(i2)&&i2>r2?i2:r2+18e5,t2);return a2?{start:n2,end:a2}:null}function qa(e2,t2,{timeZone:n2,minMinutes:r2=42}={}){let i2=[],a2=[];for(let r3 of e2){if(!r3||typeof r3!="object")continue;if(r3.startOn){Pt(r3).includes(t2)&&i2.push(r3);continue}let e3=Ka(r3,n2);if(!e3||e3.start.date>t2||e3.end.date<t2||e3.end.date===t2&&e3.end.minutes===0&&e3.start.date<t2)continue;let o3=e3.start.date<t2?0:e3.start.minutes,s3=e3.end.date>t2?Ha:e3.end.minutes;a2.push({event:r3,startMin:o3,endMin:Math.max(s3,o3+1),continuesBefore:e3.start.date<t2,continuesAfter:e3.end.date>t2,busyOnly:Ga(r3)})}a2.sort((e3,t3)=>e3.startMin-t3.startMin||t3.endMin-e3.endMin);let o2=[],s2=[],c2=-1,l2=[],u2=()=>{for(let e4 of s2)e4.cols=l2.length;let e3=s2.filter(e4=>!e4.busyOnly);for(let t3 of e3)t3.overlaps=e3.some(e4=>e4!==t3&&e4.startMin<t3.endMin&&t3.startMin<e4.endMin);o2.push(...s2),s2=[],l2=[],c2=-1};for(let e3 of a2){s2.length&&e3.startMin>=c2&&u2();let t3=Math.min(Math.max(e3.endMin,e3.startMin+r2),Ha),n3=l2.findIndex(t4=>t4<=e3.startMin);n3<0&&(n3=l2.length),l2[n3]=t3,c2=Math.max(c2,t3),s2.push({...e3,shownEndMin:t3,col:n3,cols:1,overlaps:false})}return u2(),i2.sort((e3,t3)=>(e3.name??"").localeCompare(t3.name??"")),{date:t2,blocks:o2,allDay:i2}}function Ja(e2,t2=7,n2=19){let r2=Math.max(0,Math.min(23,t2))*60,i2=Math.max(r2/60+1,Math.min(24,n2))*60;for(let t3 of e2)for(let e3 of t3.blocks)r2=Math.min(r2,Math.floor(e3.startMin/60)*60),i2=Math.max(i2,Math.ceil(e3.shownEndMin/60)*60);return{fromMin:r2,toMin:Math.min(i2,Ha)}}function Ya(e2,t2=1){let n2=Y(Nt(e2),(t2%7+6)%7);return n2>e2&&(n2=Y(n2,-7)),Array.from({length:7},(e3,t3)=>Y(n2,t3))}function Xa(e2,t2,n2){return t2.filter(t3=>qa(e2,t3,{timeZone:n2,minMinutes:0}).blocks.some(e3=>e3.overlaps))}var Za=["circle","square","triangle","diamond","plus","hexagon"],Qa={circle:"M5 1.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7z",square:"M1.5 1.5h7v7h-7z",triangle:"M5 1.2 9 8.5H1z",diamond:"M5 .8 9.2 5 5 9.2.8 5z",plus:"M3.5 1h3v2.5H9v3H6.5V9h-3V6.5H1v-3h2.5z",hexagon:"M5 .8 8.6 2.9v4.2L5 9.2 1.4 7.1V2.9z"},$a=e2=>Za[(Math.max(1,Math.floor(e2))-1)%Za.length],eo=e2=>typeof e2=="number"&&Number.isFinite(e2)&&e2>=1?(Math.floor(e2)-1)%8+1:1;function to({series:e2,className:t2}){let n2=eo(e2);return g("svg",{className:t2?`core-series-glyph ${t2}`:"core-series-glyph",viewBox:"0 0 10 10","aria-hidden":"true",focusable:"false","data-series":n2,"data-shape":$a(n2),children:g("path",{d:Qa[$a(n2)]})})}var no=44,ro=28,io=(e2,t2,n2)=>`${((e2-t2)/n2*100).toFixed(3)}%`;function ao(e2){let t2=e2===void 0?void 0:typeof e2=="number"?e2:new Date(e2).getTime(),[n2,r2]=p(()=>Date.now());return s(()=>{if(t2!==void 0)return;let e3=setInterval(()=>r2(Date.now()),6e4);return()=>clearInterval(e3)},[t2]),t2!==void 0&&Number.isFinite(t2)?t2:n2}function oo(e2){let{label:t2="Schedule",startHour:n2=7,endHour:r2=19,hourHeight:i2=64,eventHref:a2="?panel=event:{id}",locale:o2,timeZone:c2,className:l2,style:u2}=e2,d2=(Array.isArray(e2.columns)?e2.columns:[]).filter(e3=>e3&&typeof e3.date=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e3.date)),m2=ao(e2.now),v2=f(null),[y2,x2]=p(false);s(()=>{let e3=v2.current;if(!e3)return;let t3=()=>x2(e3.scrollWidth>e3.clientWidth+1);t3();let n3=new ResizeObserver(t3);return n3.observe(e3),()=>n3.disconnect()},[d2.length]);let C2=Wa(m2,c2),w2=Math.ceil(no/Math.max(i2,24)*60),T2=d2.map(e3=>qa(Array.isArray(e3.events)?e3.events:[],e3.date,{timeZone:c2,minMinutes:w2})),E2=T2.map(e3=>Math.max(no,ro*Math.max(1,...e3.blocks.map(e4=>e4.cols)))),{fromMin:D2,toMin:O2}=Ja(T2,n2,r2),k2=O2-D2,A2=Array.from({length:Math.floor(k2/60)+1},(e3,t3)=>D2+t3*60),j2=new Intl.DateTimeFormat(o2,{hour:"numeric",timeZone:"UTC"}),M2=new Intl.DateTimeFormat(o2,{hour:"numeric",minute:"2-digit",timeZone:"UTC"}),N2=e3=>M2.format(new Date(Date.UTC(2e3,0,1,0,Math.min(e3,Ha-1)))),P2=e3=>e3.continuesBefore?e3.continuesAfter?"All day":`Until ${N2(e3.endMin)}`:e3.continuesAfter?`From ${N2(e3.startMin)}`:`${N2(e3.startMin)} – ${N2(e3.endMin)}`;return _("div",{ref:v2,className:b("core-hour-grid",l2),role:"group","aria-label":t2,tabIndex:y2?0:void 0,style:S({"--core-hour-grid-cols":String(d2.length),"--core-hour-grid-tracks":E2.map(e3=>`minmax(${e3}px, 1fr)`).join(" "),"--core-hour-grid-min":`${E2.reduce((e3,t3)=>e3+t3,0)}px`,"--core-hour-grid-hour":`${i2}px`,"--core-hour-grid-hours":String(k2/60)},u2),children:[_("div",{className:"core-hour-grid__head",children:[g("span",{className:"core-hour-grid__corner","aria-hidden":"true"}),d2.map(e3=>{let t3=C2?.date===e3.date,n3=_(h,{children:[g("span",{className:"core-hour-grid__label",children:e3.label}),e3.sublabel?g("span",{className:"core-hour-grid__sublabel",children:e3.sublabel}):null]}),r3=zt(e3.href);return r3?g("a",{className:"core-hour-grid__day",href:r3,"data-today":t3||void 0,"aria-current":t3?"date":void 0,children:n3},e3.id):g("div",{className:"core-hour-grid__day","data-today":t3||void 0,"aria-current":t3?"date":void 0,children:n3},e3.id)})]}),T2.some(e3=>e3.allDay.length)?_("div",{className:"core-hour-grid__allday",children:[g("span",{className:"core-hour-grid__corner","aria-hidden":"true"}),T2.map((e3,t3)=>g("ul",{className:"core-hour-grid__chips","aria-label":`All day, ${d2[t3].label}`,children:e3.allDay.map((e4,t4)=>{let n3=so(e4)?void 0:zt(Ft(a2,e4.id));return g("li",{className:"core-hour-grid__chip","data-busy":so(e4)||void 0,children:so(e4)?g("span",{className:"core-hour-grid__sr",children:"Busy all day"}):n3?g("a",{href:n3,children:e4.name}):e4.name},`${e4.id??t4}`)})},d2[t3].id))]}):null,_("div",{className:"core-hour-grid__body",children:[g("div",{className:"core-hour-grid__axis","aria-hidden":"true",children:A2.map((e3,t3)=>g("span",{className:"core-hour-grid__tick",style:{top:io(e3,D2,k2)},"data-first":t3===0||void 0,children:t3===0?"":j2.format(new Date(Date.UTC(2e3,0,1,e3/60)))},e3))}),T2.map((e3,t3)=>{let n3=d2[t3],r3=C2?.date===n3.date;return _("section",{className:"core-hour-grid__col","aria-label":n3.label,"data-today":r3||void 0,children:[g("ol",{className:"core-hour-grid__events",children:e3.blocks.map((e4,t4)=>{let n4=e4.event,r4={"--core-hour-grid-top":io(e4.startMin,D2,k2),"--core-hour-grid-height":`${((e4.shownEndMin-e4.startMin)/k2*100).toFixed(3)}%`,"--core-hour-grid-left":`${(e4.col/e4.cols*100).toFixed(3)}%`,"--core-hour-grid-width":`${(100/e4.cols).toFixed(3)}%`};if(e4.busyOnly)return g("li",{className:"core-hour-grid__block","data-busy":"",style:S(r4),children:g("span",{className:"core-hour-grid__sr",children:`Busy, ${P2(e4)}`})},t4);let i3=zt(Ft(a2,n4.id)),o3=e4.endMin-e4.startMin,s2=o3<45?"short":o3<90?"medium":"long",c3=_(h,{children:[e4.overlaps?g("span",{className:"core-hour-grid__overlap",children:"Overlaps"}):null,_("span",{className:"core-hour-grid__name",children:[typeof n4.series=="number"?g(to,{series:n4.series,className:"core-hour-grid__series"}):null,n4.name]}),g("span",{className:"core-hour-grid__time",children:P2(e4)}),s2==="long"&&n4.typeName?g("span",{className:"core-hour-grid__type",children:n4.typeName}):null]}),l3={className:"core-hour-grid__event","data-kind":n4.kind,"data-status":n4.status,"data-size":s2,"data-overlaps":e4.overlaps||void 0};return g("li",{className:"core-hour-grid__block","data-before":e4.continuesBefore||void 0,"data-after":e4.continuesAfter||void 0,style:S(r4),children:i3?g("a",{...l3,href:i3,children:c3}):g("div",{...l3,children:c3})},`${n4.id??"e"}-${t4}`)})}),r3&&C2&&C2.minutes>=D2&&C2.minutes<=O2?g("div",{className:"core-hour-grid__now","aria-hidden":"true",style:{top:io(C2.minutes,D2,k2)}}):null]},n3.id)})]})]})}var so=e2=>e2.busyOnly===true,$=/^\d{4}-\d{2}-\d{2}$/,co=/^\d{2}:\d{2}$/,lo=(e2,t2)=>!e2||!$.test(e2)?"":new Intl.DateTimeFormat(t2,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`)),uo=(e2,t2)=>new Intl.DateTimeFormat(t2,{hour:"numeric",minute:"2-digit",timeZone:"UTC"}).format(new Date(`1970-01-01T${e2}:00Z`));function fo(e2,t2){if(!e2)return null;let n2=new Date(e2);if(Number.isNaN(n2.getTime()))return null;let r2=new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23",timeZone:t2}),i2=Object.fromEntries(r2.formatToParts(n2).map(e3=>[e3.type,e3.value]));return{date:`${i2.year}-${i2.month}-${i2.day}`,time:`${i2.hour}:${i2.minute}`}}function po(e2,t2){if(!$.test(e2)||!co.test(t2))return;let n2=new Date(`${e2}T${t2}:00`);if(Number.isNaN(n2.getTime()))return;let r2=-n2.getTimezoneOffset(),i2=r2<0?"-":"+",a2=Math.abs(r2);return`${e2}T${t2}:00${i2}${String(Math.floor(a2/60)).padStart(2,"0")}:${String(a2%60).padStart(2,"0")}`}function mo(e2,t2){let n2=fo(new Date(t2).toISOString(),e2);if(!n2)return 0;let[r2,i2,a2]=n2.date.split("-").map(Number),[o2,s2]=n2.time.split(":").map(Number);return Math.round((Date.UTC(r2,i2-1,a2,o2,s2)-Math.floor(t2/6e4)*6e4)/6e4)}function ho(e2,t2,n2){if($.test(e2)&&co.test(t2)){if(!n2)return po(e2,t2);try{let[r2,i2,a2]=e2.split("-").map(Number),[o2,s2]=t2.split(":").map(Number),c2=Date.UTC(r2,i2-1,a2,o2,s2),l2=c2;for(let e3=0;e3<4;e3++){let e4=c2-mo(n2,l2)*6e4;if(e4===l2)break;l2=e4}let u2=mo(n2,l2),d2=u2<0?"-":"+",f2=Math.abs(u2);return`${e2}T${t2}:00${d2}${String(Math.floor(f2/60)).padStart(2,"0")}:${String(f2%60).padStart(2,"0")}`}catch{return po(e2,t2)}}}function go(e2,t2=Date.now()){let n2=e3=>new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",...e3?{timeZone:e3}:{}}).format(t2);try{return n2(e2)}catch{return n2()}}var _o=(e2,t2,n2,r2)=>`?${new URLSearchParams({...r2,[n2]:"day",[t2]:e2}).toString()}`;function vo({days:e2,param:t2="date",viewParam:n2="view",keep:r2,locale:i2,className:a2,style:o2}){let s2=E(),c2=[...new Set(e2.filter(e3=>$.test(e3)))].sort();if(c2.length===0)return null;let l2=c2.length===1,u2=l2?`Events overlap on ${lo(c2[0],i2)}.`:`Events overlap on ${c2.length} days.`;return g("div",{className:b("core-overlap-notice",a2),style:o2,children:g(bn,{tone:"warning",message:u2,action:s2?void 0:_("span",{className:"core-overlap-notice__links",children:[l2?null:g("span",{className:"core-overlap-notice__lead",children:"Review:"}),c2.map(e3=>g("a",{className:"core-overlap-notice__review",href:_o(e3,t2,n2,r2),"aria-label":`Review ${lo(e3,i2)}`,children:l2?"Review":lo(e3,i2)},e3))]})})})}function yo(e2){let{param:t2="type",cancelledParam:n2="cancelled",keep:r2,label:i2="Show",onChange:a2,className:o2,style:s2}=e2,l2=(Array.isArray(e2.types)?e2.types:[]).filter(e3=>e3&&typeof e3.id=="string"&&typeof e3.label=="string"&&e3.label!==""),u2=c(),d2=l2.map(e3=>e3.id),f2=Array.isArray(e2.selected)?e2.selected:d2,p2=e2.showCancelled===true;if(l2.length===0)return null;let m2=e3=>{let r3=new FormData(e3);return{selected:r3.getAll(t2).map(String),showCancelled:r3.has(n2)}};return _("form",{className:b("core-calendar-filters",o2),style:s2,method:"get",action:"",onChange:e3=>{a2?a2(m2(e3.currentTarget)):typeof e3.currentTarget.requestSubmit=="function"&&e3.currentTarget.requestSubmit()},onSubmit:e3=>a2&&e3.preventDefault(),children:[Object.entries(r2??{}).map(([e3,t3])=>g("input",{type:"hidden",name:e3,value:t3},e3)),_("fieldset",{className:"core-calendar-filters__set",children:[g("legend",{className:"core-calendar-filters__legend",children:i2}),l2.map((e3,n3)=>_("label",{className:"core-calendar-filters__option",children:[g("input",{type:"checkbox",name:t2,value:e3.id,defaultChecked:f2.includes(e3.id)}),g(to,{series:eo(e3.series??n3+1)}),g("span",{className:"core-calendar-filters__label",children:e3.label})]},e3.id)),_("label",{className:"core-calendar-filters__option core-calendar-filters__option--cancelled",children:[g("input",{type:"checkbox",name:n2,value:"1",defaultChecked:p2}),g("span",{className:"core-calendar-filters__label",children:"Cancelled"})]})]}),g("button",{type:"submit",className:"core-calendar-filters__apply",id:`${u2}-apply`,children:"Apply"})]})}var bo=(e2,t2,n2)=>`?${new URLSearchParams({...e2??{},[t2]:n2}).toString()}`,xo=(e2,t2)=>{let[n2,r2]=e2.split("-").map(Number),i2=new Date(Date.UTC(n2,r2-1+t2,1));return`${i2.getUTCFullYear()}-${String(i2.getUTCMonth()+1).padStart(2,"0")}`};function So({month:e2,date:t2,highlight:n2="week",occurrences:r2,weekStartsOn:i2=1,param:a2="date",monthParam:o2="month",keep:s2,locale:c2,timeZone:l2,now:u2,className:d2,style:m2}){let h2=E(),v2=h2?"span":"a",y2=u2===void 0?Date.now():typeof u2=="number"?u2:new Date(u2).getTime(),x2=Wa(Number.isFinite(y2)?y2:Date.now(),l2)?.date??"1970-01-01",S2=t2&&/^\d{4}-\d{2}-\d{2}$/.test(t2)?t2:x2,C2=e2&&/^\d{4}-\d{2}$/.test(e2)?e2:S2.slice(0,7),w2=`${C2}-01`,T2=Ya(w2,i2)[0],D2=Array.from({length:42},(e3,t3)=>Y(T2,t3)),O2=Array.from({length:6},(e3,t3)=>D2.slice(t3*7,t3*7+7)),k2=n2==="week"?new Set(Ya(S2,i2)):new Set([S2]),A2=Array.isArray(r2)?r2:[],j2=new Map(D2.map(e3=>{let t3=qa(A2,e3,{timeZone:l2,minMinutes:0});return[e3,t3.blocks.length+t3.allDay.length]})),M2=(e3,t3)=>new Intl.DateTimeFormat(c2,{...e3,timeZone:"UTC"}).format(new Date(`${t3}T00:00:00Z`)),N2=M2({month:"long",year:"numeric"},w2),P2=O2[0].map(e3=>({short:M2({weekday:"narrow"},e3),long:M2({weekday:"long"},e3)})),F2=D2.includes(S2)?S2:D2.includes(x2)?x2:w2,[I2,L2]=p(null),R2=I2&&D2.includes(I2)?I2:F2,z2=f(null),B2=e3=>{D2.includes(e3)&&(L2(e3),z2.current?.querySelector(`[data-date="${e3}"]`)?.focus())};return _("div",{className:b("core-mini-month",d2),style:m2,children:[_("div",{className:"core-mini-month__head",children:[h2?null:g("a",{className:"core-mini-month__step","data-step":"prev",href:bo(s2,o2,xo(C2,-1)),"aria-label":"Previous month",children:"‹"}),g("div",{className:"core-mini-month__title",id:`mm-${C2}`,"aria-live":"polite",children:N2}),h2?null:g("a",{className:"core-mini-month__step","data-step":"next",href:bo(s2,o2,xo(C2,1)),"aria-label":"Next month",children:"›"})]}),_("div",{ref:z2,role:"grid","aria-labelledby":`mm-${C2}`,className:"core-mini-month__grid",onKeyDown:e3=>{let t3=e3.target.closest("[data-date]")?.dataset.date;if(!t3)return;let n3=O2.find(e4=>e4.includes(t3)),r3={ArrowLeft:Y(t3,-1),ArrowRight:Y(t3,1),ArrowUp:Y(t3,-7),ArrowDown:Y(t3,7),Home:n3[0],End:n3[6]};r3[e3.key]?(e3.preventDefault(),B2(r3[e3.key])):(e3.key==="PageUp"||e3.key==="PageDown")&&(e3.preventDefault(),z2.current?.parentElement?.querySelector(`a[data-step="${e3.key==="PageUp"?"prev":"next"}"]`)?.click())},children:[g("div",{role:"row",className:"core-mini-month__row core-mini-month__row--head",children:P2.map((e3,t3)=>g("span",{role:"columnheader","aria-label":e3.long,className:"core-mini-month__weekday",children:e3.short},t3))}),O2.map(e3=>g("div",{role:"row",className:"core-mini-month__row",children:e3.map(e4=>{let t3=j2.get(e4)??0,n3=`${M2({weekday:"long",month:"long",day:"numeric"},e4)}${e4===x2?", today":""}${t3?`, ${t3} ${t3===1?"event":"events"}`:""}`;return g("span",{role:"gridcell","aria-selected":e4===S2,className:"core-mini-month__cell","data-range":k2.has(e4)||void 0,"data-outside":e4.slice(0,7)!==C2||void 0,children:_(v2,{className:"core-mini-month__day",href:h2?void 0:bo(s2,a2,e4),"data-date":e4,"data-today":e4===x2||void 0,"data-selected":e4===S2||void 0,"aria-current":e4===S2?"date":void 0,"aria-label":h2?void 0:n3,tabIndex:h2?void 0:e4===R2?0:-1,onFocus:()=>L2(e4),children:[h2?g("span",{className:"core-mini-month__sr",children:n3}):null,g("span",{"aria-hidden":"true",children:Number(e4.slice(8))}),g("span",{className:"core-mini-month__dot","aria-hidden":"true","data-has":t3>0||void 0})]})},e4)})},e3[0]))]})]})}var Co=(e2,t2,n2)=>`?${new URLSearchParams({...n2??{},[e2]:t2}).toString()}`;function wo({date:e2,occurrences:t2,weekStartsOn:n2=1,param:r2="date",steps:i2=true,keep:a2,locale:o2,timeZone:s2,now:c2,className:l2,style:u2}){let d2=E(),f2=d2?"span":"a",p2=c2===void 0?Date.now():typeof c2=="number"?c2:new Date(c2).getTime(),m2=Wa(Number.isFinite(p2)?p2:Date.now(),s2)?.date??"1970-01-01",h2=e2&&/^\d{4}-\d{2}-\d{2}$/.test(e2)?e2:m2,v2=Ya(h2,n2),y2=Array.isArray(t2)?t2:[],x2=new Intl.DateTimeFormat(o2,{weekday:"short",timeZone:"UTC"}),S2=new Intl.DateTimeFormat(o2,{weekday:"long",month:"long",day:"numeric",timeZone:"UTC"}),C2=e3=>new Date(`${e3}T00:00:00Z`),w2=(e3,t3)=>`${S2.format(C2(e3))}${e3===m2?", today":""}${t3?`, ${t3} ${t3===1?"event":"events"}`:""}`,T2=new Map(v2.map(e3=>{let t3=qa(y2,e3,{timeZone:s2});return[e3,t3.blocks.length+t3.allDay.length]}));return g("nav",{className:b("core-week-strip",l2),style:u2,"aria-label":"Week",children:_("div",{className:"core-week-strip__frame",children:[i2&&!d2?g("a",{className:"core-week-strip__step",href:Co(r2,Y(h2,-7),a2),"aria-label":"Previous week",children:"‹"}):null,g("ol",{className:"core-week-strip__days",children:v2.map(e3=>{let t3=T2.get(e3)??0;return g("li",{children:_(f2,{className:"core-week-strip__day",href:d2?void 0:Co(r2,e3,a2),"aria-current":e3===h2?"date":void 0,"aria-label":d2?void 0:w2(e3,t3),"data-selected":e3===h2||void 0,"data-today":e3===m2||void 0,children:[d2?g("span",{className:"core-week-strip__sr",children:w2(e3,t3)}):null,g("span",{className:"core-week-strip__weekday","aria-hidden":"true",children:x2.format(C2(e3))}),g("span",{className:"core-week-strip__date","aria-hidden":"true",children:Number(e3.slice(8))}),g("span",{className:"core-week-strip__mark","aria-hidden":"true","data-has":t3>0||void 0})]})},e3)})}),i2&&!d2?g("a",{className:"core-week-strip__step",href:Co(r2,Y(h2,7),a2),"aria-label":"Next week",children:"›"}):null]})})}var To=[["day","Day"],["week","Week"],["agenda","Agenda"]];function Eo(e2){let t2=E(),{weekStartsOn:n2=1,viewParam:r2="view",dateParam:i2="date",eventHref:a2,newEventHref:o2,summary:s2,notice:c2,startHour:l2,endHour:u2,locale:d2,timeZone:f2,className:p2,style:m2}=e2,v2=e2.view==="day"||e2.view==="agenda"?e2.view:"week",y2=Array.isArray(e2.occurrences)?e2.occurrences:[],x2=e2.now===void 0?Date.now():typeof e2.now=="number"?e2.now:new Date(e2.now).getTime(),S2=Wa(Number.isFinite(x2)?x2:Date.now(),f2)?.date??"1970-01-01",C2=e2.date&&/^\d{4}-\d{2}-\d{2}$/.test(e2.date)?e2.date:S2,w2=(e3,t3)=>`?${new URLSearchParams({[r2]:e3,[i2]:t3}).toString()}`,T2=v2==="day"?1:7,D2=zt(o2),O2=(e3,t3)=>new Intl.DateTimeFormat(d2,{...e3,timeZone:"UTC"}).format(new Date(`${t3}T00:00:00Z`)),k2=Ya(C2,n2),A2=v2==="day"?O2({weekday:"long",month:"long",day:"numeric"},C2):`${O2({month:"short",day:"numeric"},k2[0])} – ${O2({month:"short",day:"numeric",year:"numeric"},k2[6])}`,j2=(t3,n3)=>g(oo,{columns:t3,label:n3,eventHref:a2,startHour:l2,endHour:u2,locale:d2,timeZone:f2,now:e2.now}),M2=e3=>({id:e3,date:e3,label:`${O2({weekday:"short"},e3)} ${Number(e3.slice(8))}`,sublabel:e3===S2?"Today":void 0,events:y2}),N2=k2.map(e3=>({...M2(e3),href:t2?void 0:w2("day",e3)}));return _("section",{className:b("core-calendar","core-calendar-view",p2),style:m2,"aria-label":"Schedule","data-view":v2,children:[_("header",{className:"core-calendar__head",children:[g("h2",{className:"core-calendar__title",children:A2}),t2?null:_("nav",{className:"core-calendar__nav","aria-label":"Calendar",children:[v2==="agenda"?null:g("a",{className:"core-calendar__step",href:w2(v2,Y(C2,-T2)),"aria-label":v2==="day"?"Previous day":"Previous week",children:"‹"}),g("a",{className:"core-calendar__today",href:w2(v2,S2),"aria-current":C2===S2||k2.includes(S2)?"date":void 0,children:"Today"}),v2==="agenda"?null:g("a",{className:"core-calendar__step",href:w2(v2,Y(C2,T2)),"aria-label":v2==="day"?"Next day":"Next week",children:"›"})]}),t2?null:g("nav",{className:"core-calendar__views","aria-label":"View",children:To.map(([e3,t3])=>g("a",{className:"core-calendar__view",href:w2(e3,C2),"aria-current":e3===v2?"page":void 0,children:t3},e3))}),D2?g("a",{className:"core-calendar__new",href:D2,children:"New event"}):null]}),s2?g("p",{className:"core-calendar__summary",children:s2}):null,c2?g("div",{className:"core-calendar__notice",children:c2}):null,v2==="day"?j2([M2(C2)],O2({weekday:"long",month:"long",day:"numeric"},C2)):null,v2==="week"?_(h,{children:[g("div",{className:"core-calendar__wide",children:j2(N2,`Week of ${O2({month:"long",day:"numeric"},k2[0])}`)}),_("div",{className:"core-calendar__narrow",children:[g(wo,{date:C2,occurrences:y2,weekStartsOn:n2,param:i2,steps:false,keep:{[r2]:"week"},locale:d2,timeZone:f2,now:e2.now}),j2([M2(C2)],O2({weekday:"long",month:"long",day:"numeric"},C2))]})]}):null,v2==="agenda"?g(za,{label:"Agenda",occurrences:y2,view:"agenda",weekOf:C2,weekParam:i2,linkParams:{[r2]:"agenda"},eventHref:a2,locale:d2,timeZone:f2}):null]})}var Do=new Set(["field","select","expand"]),Oo=(e2,t2)=>{let n2=e2.replace(/\s+/g," ").trim();return n2.length>t2?`${n2.slice(0,t2-1)}…`:n2};function ko(e2,t2){if(typeof e2!="function"||!Do.has(t2.kind)||typeof t2.name!="string")return;let n2=Oo(t2.name,80);if(n2==="")return;let r2=t2.value,i2=typeof r2=="string"?Oo(r2,200):typeof r2=="boolean"||typeof r2=="number"&&Number.isFinite(r2)?r2:void 0;try{e2(i2===void 0?{kind:t2.kind,name:n2}:{kind:t2.kind,name:n2,value:i2})}catch{}}var Ao=["private","team","client"];function jo(e2){let t2=Array.isArray(e2?.audiences)?e2.audiences:[];return Ao.filter(e3=>t2.includes(e3))}function Mo(e2,t2){if(t2.length!==0)return t2.includes(e2)?e2:t2.includes("team")?"team":t2[0]}function No(e2,t2="team"){let[n2,r2]=p(t2);return{value:Mo(n2,e2),setValue:r2}}function Po(e2,t2){if(e2==="private")return"Only me and the people I add";if(e2==="team")return"My team";let n2=X(t2);return n2?`My team and ${n2}`:"My team and the client"}function Fo(e2){return e2==="client"?" The client can see it.":e2==="private"?" Only you and the people you add can see it.":""}function Io({id:e2,audiences:t2,value:n2,onChange:r2,subjectName:i2,disabled:a2}){return t2.length===0||!n2?null:t2.length===1?_("p",{className:"core-intent-card__audience-fixed","data-audience":n2,children:[g("span",{className:"core-intent-card__label",children:"Who can see it"})," ",Po(n2,i2)]}):_("fieldset",{className:"core-intent-card__audience",disabled:a2,children:[g("legend",{className:"core-intent-card__label",children:"Who can see it"}),t2.map(t3=>_("label",{className:"core-intent-card__audience-row",children:[g("input",{type:"radio",name:`${e2}-audience`,value:t3,checked:n2===t3,onChange:()=>r2(t3)}),g("span",{children:Po(t3,i2)})]},t3))]})}var Lo=50,Ro=["project","process","run","node","event"],zo=e2=>typeof e2=="string"&&e2.trim()!=="",Bo=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&zo(e3.name)).slice(0,Lo),Vo=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&zo(e3.name)).slice(0,Lo),Ho=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3=="object"&&Ro.includes(e3.kind)&&typeof e3.id=="string"&&zo(e3.label)).slice(0,Lo);function Uo(e2){let t2=Bo(e2.people),n2=Vo(e2.assignees),r2=Ho(e2.linkCandidates),[i2,a2]=p(new Set((Array.isArray(e2.attendeeIds)?e2.attendeeIds:[]).filter(e3=>typeof e3=="string"))),[o2,s2]=p(typeof e2.assigneeId=="string"&&n2.some(t3=>t3.id===e2.assigneeId)?e2.assigneeId:""),[c2,l2]=p(()=>Ho(e2.links).slice(0,10)),u2=t2.filter(e3=>i2.has(e3.id)),d2=n2.find(e3=>e3.id===o2),f2=r2.length>0?c2:[];return{people:t2,assignees:n2,candidates:r2,guests:i2,setGuests:a2,assigneeId:o2,setAssigneeId:s2,links:f2,setLinks:l2,picked:u2,assignee:d2,write(e3){u2.length&&(e3.attendeeIds=u2.map(e4=>e4.id)),d2&&(e3.assigneeId=d2.id),f2.length&&(e3.links=f2.slice(0,10).map(e4=>({kind:e4.kind,id:e4.id})))}}}function Wo({extras:e2,disabled:t2}){let n2=c(),{people:r2,assignees:i2,candidates:a2,guests:o2,setGuests:s2,assigneeId:l2,setAssigneeId:u2,links:d2,setLinks:f2}=e2,p2=a2.filter(e3=>!d2.some(t3=>t3.kind===e3.kind&&t3.id===e3.id));return _(h,{children:[r2.length>0?_("fieldset",{className:"core-intent-card__people",disabled:t2,children:[g("legend",{className:"core-intent-card__label",children:"Attendees (optional)"}),r2.map(e3=>_("label",{className:"core-intent-card__person",children:[g("input",{type:"checkbox",checked:o2.has(e3.id),onChange:t3=>s2(n3=>t3.target.checked?new Set([...n3,e3.id]):new Set([...n3].filter(t4=>t4!==e3.id)))}),g("span",{className:"core-intent-card__person-name",children:e3.name}),e3.role?g("span",{className:"core-intent-card__person-role",children:X(e3.role)}):null]},e3.id))]}):null,i2.length>0?g("div",{className:"core-intent-card__row",children:_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Assigned to (optional)"}),_("select",{value:l2,disabled:t2,onChange:e3=>u2(e3.target.value),children:[g("option",{value:"",children:"No one"}),i2.map(e3=>g("option",{value:e3.id,children:e3.name},e3.id))]})]})}):null,a2.length>0?_("fieldset",{className:"core-intent-card__links",disabled:t2,children:[g("legend",{className:"core-intent-card__label",children:"Linked to (optional)"}),d2.length>0?g("ul",{className:"core-intent-card__chips",children:d2.map(e3=>_("li",{className:"core-intent-card__chip",children:[g("span",{className:"core-intent-card__chip-label",children:e3.label}),g("button",{type:"button",className:"core-intent-card__chip-remove","aria-label":`Remove link: ${e3.label}`,onClick:()=>f2(t3=>t3.filter(t4=>t4.kind!==e3.kind||t4.id!==e3.id)),children:g("span",{"aria-hidden":"true",children:"×"})})]},`${e3.kind}:${e3.id}`))}):null,p2.length>0&&d2.length<10?_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",id:`${n2}-add`,children:"Add a link"}),_("select",{"aria-labelledby":`${n2}-add`,value:"",onChange:e3=>{let t3=p2.find(t4=>`${t4.kind}:${t4.id}`===e3.target.value);t3&&f2(e4=>[...e4,t3])},children:[g("option",{value:"",children:"Choose…"}),p2.map(e3=>g("option",{value:`${e3.kind}:${e3.id}`,children:e3.label},`${e3.kind}:${e3.id}`))]})]}):null]}):null]})}var Go=[5,10,15,20,30,45,60,90],Ko={line:300,note:2e3},qo=(e2,t2)=>typeof e2=="string"?e2.slice(0,t2):"";function Jo(e2){if(!e2)return At();let t2=new Date(e2);return Number.isNaN(t2.getTime())?At():(t2.setMinutes(t2.getMinutes()-t2.getTimezoneOffset()),t2.toISOString().slice(0,16))}function Yo(e2){let{canWriteStaffNotes:t2=false,onIntent:n2,className:r2,style:i2}=e2,a2=X(e2.subjectName),o2=Array.isArray(e2.types)?e2.types.filter(e3=>e3&&typeof e3.id=="string"):[],l2=e2.prefill&&typeof e2.prefill=="object"?e2.prefill:{},u2=c(),{run:d2,busy:m2,message:h2,available:v2}=Lt(n2),[y2,x2]=p(o2.find(e3=>e3.id===l2.typeId)?.id??o2[0]?.id??""),S2=jo(o2.find(e3=>e3.id===y2)),C2=No(S2),[w2,T2]=p(Jo(l2.startsAt)),[E2,D2]=p(typeof l2.durationMin=="number"&&l2.durationMin>0?String(Math.round(l2.durationMin)):""),O2=Uo({people:e2.people,assignees:e2.assignees,linkCandidates:e2.linkCandidates,links:e2.links,attendeeIds:l2.attendeeIds}),[k2,A2]=p(qo(l2.outcome,Ko.line)),[j2,M2]=p(qo(l2.followUp,Ko.line)),[N2,P2]=p(qo(l2.note,Ko.note)),[F2,I2]=p(t2),[L2,R2]=p(null),z2=f(null);s(()=>{L2&&z2.current?.focus({preventScroll:true})},[L2]);let B2=L2??(e2.logged&&typeof e2.logged=="object"?e2.logged:null);if(B2){let e3=zt(B2.href);return _("div",{ref:z2,tabIndex:-1,role:"group","aria-labelledby":`${u2}-status`,className:b("core-intent-card","core-log-card",r2),style:i2,"data-state":"logged",children:[_("div",{className:"core-intent-card__head",children:[_("span",{id:`${u2}-status`,className:"core-intent-card__eyebrow",children:["Logged",a2?` · ${a2}`:""]}),g("p",{className:"core-intent-card__title",children:B2.name??"Logged"})]}),e3?g("a",{className:"core-log-card__go",href:e3,children:"Go to event"}):null]})}if(o2.length===0)return g("p",{className:b("core-intent-card","core-log-card","core-log-card__empty",r2),style:i2,children:"There’s nothing you can log here."});let ee2=o2.find(e3=>e3.id===y2),te2=v2&&m2===null,V2=v2&&!!a2&&!!ee2&&!!w2,H2=v2?a2?"":"Choose who this is about before logging.":It,U2=async e3=>{if(e3.preventDefault(),!V2||m2!==null||!ee2)return;let n3={typeId:ee2.id,startsAt:kt(w2),tzid:Ot()};C2.value&&(n3.audience=C2.value),E2&&(n3.durationMin=Number(E2)),O2.write(n3),k2.trim()&&(n3.outcome=k2.trim()),j2.trim()&&(n3.followUp=j2.trim()),N2.trim()&&(n3.note=N2.trim(),n3.staffOnly=t2&&F2);let{ok:r3,result:i3}=await d2("log_event",n3);r3&&R2({name:ee2.name,href:i3&&typeof i3=="object"?i3.data?.href:void 0})},W2=!te2;return _("form",{className:b("core-intent-card","core-log-card",r2),style:i2,"data-state":v2?"editing":"display",onSubmit:e3=>void U2(e3),"aria-busy":m2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[g("span",{className:"core-intent-card__eyebrow",children:"Log"}),g("p",{className:"core-intent-card__title",children:a2??"Who is this about?"})]}),_("div",{className:"core-intent-card__row",children:[_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Type"}),g("select",{value:y2,disabled:W2,onChange:e3=>x2(e3.target.value),children:o2.map(e3=>g("option",{value:e3.id,children:e3.name},e3.id))})]}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"When"}),g("input",{type:"datetime-local",required:true,value:w2,readOnly:W2,onChange:e3=>T2(e3.target.value)})]})]}),g("div",{className:"core-intent-card__row",children:_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"How long"}),_("select",{value:E2,disabled:W2,onChange:e3=>D2(e3.target.value),children:[g("option",{value:"",children:"—"}),[...new Set([...Go,...E2?[Number(E2)]:[]])].sort((e3,t3)=>e3-t3).map(e3=>g("option",{value:e3,children:`${e3} min`},e3))]})]})}),g(Wo,{extras:O2,disabled:W2}),g(Io,{id:u2,audiences:S2,value:C2.value,onChange:C2.setValue,subjectName:a2,disabled:W2}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Outcome"}),g("input",{value:k2,maxLength:Ko.line,readOnly:W2,onChange:e3=>A2(e3.target.value)})]}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Follow-up"}),g("input",{value:j2,maxLength:Ko.line,readOnly:W2,onChange:e3=>M2(e3.target.value)})]}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Note"}),g("textarea",{rows:Math.min(10,Math.max(2,N2.split("\n").length+Math.floor(N2.length/40))),maxLength:Ko.note,value:N2,readOnly:W2,onChange:e3=>P2(e3.target.value)})]}),t2&&N2.trim()?_("label",{className:"core-log-card__check",children:[g("input",{type:"checkbox",checked:F2,disabled:W2,onChange:e3=>I2(e3.target.checked)}),g("span",{children:"Staff only: the client won’t see this note"})]}):null,h2?g("p",{id:`${u2}-message`,className:"core-intent-card__message",role:"alert",children:h2}):null,g("p",{className:"core-intent-card__does",id:`${u2}-does`,children:V2?`Log saves this to ${a2}’s file.`:H2}),g("div",{className:"core-intent-card__actions",children:g("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!V2||m2!==null,"aria-describedby":`${u2}-does`,children:m2==="log_event"?"Logging…":"Log"})})]})}var Xo=250,Zo=500,Qo=(e2,t2)=>{let n2=t2.trim().toLowerCase();return n2===""||e2.label.toLowerCase().includes(n2)||!!e2.description?.toLowerCase().includes(n2)};function $o({label:e2,options:t2,loadOptions:n2,value:r2,defaultValue:i2="",onValueChange:o2,onSelect:l2,orientation:d2="vertical",debounceMs:m2=150,minChars:h2=0,closeOnSelect:g2=true,fillOnSelect:_2=false,openOnFocus:v2=false,defaultOpen:y2=false,emptyText:b2="No results",errorText:x2="Could not load results"}){let S2=c(),C2=`${S2}-list`,[w2,T2]=p(i2),E2=r2??w2,[D2,O2]=p(y2),[k2,A2]=p(y2),[j2,M2]=p([]),[N2,P2]=p("idle"),[F2,I2]=p(null),[L2,R2]=p(""),z2=f(0),B2=f({onValueChange:o2,onSelect:l2,loadOptions:n2});B2.current={onValueChange:o2,onSelect:l2,loadOptions:n2};let ee2=u(()=>n2?j2:(t2??[]).filter(e3=>Qo(e3,E2)),[n2,j2,t2,E2]),te2=!!n2,V2=E2.trim().length>=h2,H2=V2?ee2:[];s(()=>{if(!te2||!D2)return;if(!V2){z2.current+=1,M2([]),P2("idle");return}let e3=++z2.current,t3=new AbortController;P2("loading");let n3=setTimeout(()=>{B2.current.loadOptions?.(E2,t3.signal).then(t4=>{e3===z2.current&&(M2(t4),P2(t4.length?"ready":"empty"))},t4=>{e3===z2.current&&t4?.name!=="AbortError"&&(M2([]),P2("error"))})},m2);return()=>{clearTimeout(n3),t3.abort()}},[E2,D2,V2,te2,m2]);let U2=te2?N2:!D2||!V2?"idle":H2.length?"ready":"empty";s(()=>{F2!==null&&!H2.some(e3=>e3.id===F2)&&I2(null)},[H2,F2]),s(()=>{if(!k2||U2==="idle"){R2("");return}let e3=E2.trim().slice(0,60),t3=U2==="loading"?"Loading results":U2==="error"?x2.split("{query}").join(e3):U2==="empty"?b2.split("{query}").join(e3):`${H2.length} ${H2.length===1?"result":"results"}`,n3=setTimeout(()=>R2(t3),U2==="loading"?Zo:Xo);return()=>clearTimeout(n3)},[U2,H2.length,k2,E2,b2,x2]);let W2=a(e3=>{r2===void 0&&T2(e3),B2.current.onValueChange?.(e3)},[r2]),G2=a(()=>{A2(false),I2(null)},[]),ne2=a(e3=>{e3.disabled||(_2&&W2(e3.label),B2.current.onSelect?.(e3),g2&&G2())},[_2,W2,g2,G2]),re2=e3=>`${S2}-opt-${e3.id}`,K2=k2&&H2.length>0,ie2=K2?H2.find(e3=>e3.id===F2):void 0,q2=e3=>{if(H2.length===0)return;let t3=H2.filter(e4=>!e4.disabled);if(t3.length===0)return;let n3=t3.findIndex(e4=>e4.id===F2),r3=n3<0?e3===1?0:t3.length-1:(n3+e3+t3.length)%t3.length;I2(t3[r3].id)};return{options:H2,status:U2,statusText:L2,open:K2,activeId:F2,close:G2,inputProps:{role:"combobox","aria-label":e2,"aria-expanded":K2,"aria-controls":C2,"aria-autocomplete":"list","aria-activedescendant":ie2?re2(ie2):void 0,autoComplete:"off",value:E2,onChange:e3=>{O2(true),A2(true),I2(null),W2(e3.target.value)},onKeyDown:e3=>{if(e3.nativeEvent.isComposing||e3.altKey||e3.ctrlKey||e3.metaKey)return;let t3=d2==="horizontal"?"ArrowRight":"ArrowDown",n3=d2==="horizontal"?"ArrowLeft":"ArrowUp";e3.key==="ArrowDown"||e3.key==="ArrowUp"?(e3.preventDefault(),O2(true),k2?q2(e3.key==="ArrowDown"?1:-1):A2(true)):(e3.key===t3||e3.key===n3)&&K2&&ie2?(e3.preventDefault(),q2(e3.key===t3?1:-1)):e3.key==="Enter"&&ie2?(e3.preventDefault(),ne2(ie2)):e3.key==="Escape"&&k2?(e3.preventDefault(),e3.stopPropagation(),G2()):e3.key==="Tab"&&G2()},onFocus:()=>{v2&&(O2(true),A2(true))},onBlur:()=>G2()},listboxProps:{id:C2,role:"listbox","aria-label":e2,"aria-orientation":d2},statusProps:{role:"status","aria-live":"polite","aria-atomic":true},getOptionProps:e3=>({id:re2(e3),role:"option","aria-selected":e3.id===ie2?.id,"aria-disabled":e3.disabled||void 0,"data-active":e3.id===ie2?.id?"":void 0,onPointerDown:e4=>e4.preventDefault(),onClick:()=>ne2(e3)}),query:E2}}function es({text:e2,match:t2}){let n2=t2?e2.toLowerCase().indexOf(t2.trim().toLowerCase()):-1;if(n2<0||!t2.trim())return g(h,{children:e2});let r2=n2+t2.trim().length;return _(h,{children:[e2.slice(0,n2),g("mark",{className:"core-combobox__match",children:e2.slice(n2,r2)}),e2.slice(r2)]})}function ts({placeholder:e2,emptyText:t2="No results",errorText:n2="Could not load results",renderOption:r2,className:i2,style:a2,...o2}){let l2=$o({...o2,emptyText:t2,errorText:n2}),u2=l2.query.trim().slice(0,60),d2=f(null),p2=o2.orientation==="horizontal",m2=c(),v2=[];for(let e3 of l2.options){let t3=p2?void 0:e3.group,n3=v2[v2.length-1];n3&&n3.group===t3?n3.options.push(e3):v2.push({group:t3,options:[e3]})}s(()=>{l2.activeId!==null&&d2.current?.querySelector("[data-active]")?.scrollIntoView({block:"nearest",inline:"nearest"})},[l2.activeId]);let y2=l2.status==="empty"?t2.split("{query}").join(u2):l2.status==="error"?n2.split("{query}").join(u2):l2.status==="loading"?"Loading…":null;return _("div",{className:b("core-combobox",i2),style:a2,"data-orientation":o2.orientation??"vertical","data-status":l2.status,children:[g("input",{...l2.inputProps,type:"text",className:"core-combobox__input",placeholder:e2}),g("ul",{ref:d2,...l2.listboxProps,className:"core-combobox__list",hidden:!l2.open,children:v2.map((e3,t3)=>{let n3=e3.options.map(e4=>g("li",{...l2.getOptionProps(e4),className:"core-combobox__option",children:r2?r2(e4,l2.query):_(h,{children:[g("span",{className:"core-combobox__label",children:g(es,{text:e4.label,match:e4.highlight??l2.query})}),e4.description?g("span",{className:"core-combobox__description",children:e4.description}):null]})},e4.id));return e3.group?_("li",{role:"presentation",className:"core-combobox__section",children:[g("span",{id:`${m2}-${t3}`,className:"core-combobox__heading",children:e3.group}),g("ul",{role:"group","aria-labelledby":`${m2}-${t3}`,className:"core-combobox__group",children:n3})]},`g${t3}`):n3})}),y2&&!l2.open?g("p",{className:"core-combobox__note","data-status":l2.status,"aria-hidden":"true",children:y2}):null,g("span",{...l2.statusProps,className:"core-combobox__status",children:l2.statusText})]})}var ns=["saved","assigned","event","archived","discarded","unavailable"],rs=6e3;function is(e2){let{locale:t2,timeZone:n2,searchTargets:r2,onIntent:i2,className:a2,style:o2}=e2,l2=e2.note&&typeof e2.note=="object"&&(e2.note.state==="unavailable"||typeof e2.note.body=="string")?e2.note:null,u2=c(),{run:d2,busy:m2,message:v2,available:y2}=Lt(i2),[x2,S2]=p(null),C2=l2?.state&&ns.includes(l2.state)?l2.state:"saved",w2=x2&&C2==="saved"?x2:C2,[T2,E2]=p(false),D2=f(null),O2=f(null),k2=f(null);s(()=>()=>{D2.current&&clearTimeout(D2.current),O2.current?.()},[]),s(()=>{T2&&k2.current?.focus({preventScroll:true})},[T2]);let[A2,j2]=p(false),[M2,N2]=p(false),P2=f(null);s(()=>{M2&&P2.current?.focus({preventScroll:true})},[M2]);let[F2,I2]=p(void 0),[L2,R2]=p(false),z2=f(null);if(s(()=>{x2&&z2.current?.focus({preventScroll:true})},[x2]),!l2)return null;if(C2==="unavailable")return g("div",{role:"group","aria-label":"Note",className:b("core-intent-card","core-quick-note-card","core-note-card",a2),style:o2,"data-state":"unavailable",children:g("p",{className:"core-note-card__unavailable",children:"This note is no longer available"})});let B2=w2==="saved"&&!T2,ee2=l2.createdAt&&!Number.isNaN(new Date(l2.createdAt).getTime())?new Intl.DateTimeFormat(t2,{weekday:"short",hour:"numeric",minute:"2-digit",timeZone:n2}).format(new Date(l2.createdAt)):"",te2=zt(l2.eventHref),V2=m2===null,H2=async e3=>{let{ok:t3}=await d2("assign",{targetId:e3.id,...A2?{keepPrivate:true}:{},...e3.data&&typeof e3.data=="object"&&"kind"in e3.data?{targetKind:e3.data.kind}:{}});t3&&(I2(e3.label),S2("assigned"),R2(false))},U2=async()=>{let{ok:e3}=await d2("make_event");e3&&S2("started")},W2=()=>{let e3=async()=>{O2.current=null,D2.current=null;let{ok:e4}=await d2("archive");E2(false),e4&&S2("archived")};O2.current=()=>void e3(),D2.current=setTimeout(()=>void e3(),rs),E2(true)},G2=()=>{D2.current&&clearTimeout(D2.current),D2.current=null,O2.current=null,E2(false)},ne2=async()=>{let{ok:e3}=await d2("discard");N2(false),e3&&S2("discarded")},re2=async()=>{let{ok:e3}=await d2("ask_instead");e3&&S2("asked")},K2=T2?"Archived":B2?"Saved as note":w2==="asked"?"Sent to the assistant instead":w2==="assigned"?`Assigned${F2??l2.assignedToName?` to ${F2??l2.assignedToName}`:""}`:w2==="event"?"Made into an event":w2==="started"?"Event started below":w2==="discarded"?"Discarded":"Archived";return _("div",{ref:z2,tabIndex:-1,role:"group","aria-labelledby":`${u2}-status`,className:b("core-intent-card","core-quick-note-card","core-note-card",a2),style:o2,"data-state":T2?"archived":w2,"aria-busy":m2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[g("span",{id:`${u2}-status`,className:"core-intent-card__eyebrow",children:K2}),g("p",{className:"core-note-card__body",children:l2.body}),_("span",{className:"core-note-card__private",children:["Private",ee2?` · saved ${ee2}`:""]})]}),w2==="event"&&te2?g("a",{className:"core-note-card__go",href:te2,children:"Go to event"}):null,v2?g("p",{className:"core-intent-card__message",role:"alert",children:v2}):null,T2?g("div",{className:"core-intent-card__actions",children:g("button",{ref:k2,type:"button",className:"core-intent-card__button",onClick:G2,children:"Undo"})}):null,B2?_(h,{children:[L2&&r2?_("div",{className:"core-note-card__picker",children:[g(ts,{label:"Assign to a client or project",placeholder:"Search clients and projects",loadOptions:r2,onSelect:e3=>void H2(e3),defaultOpen:false}),_("label",{className:"core-note-card__private-check",children:[g("input",{type:"checkbox",checked:A2,disabled:!V2,onChange:e3=>j2(e3.target.checked)}),g("span",{children:"Keep this note private"})]})]}):null,g("p",{className:"core-intent-card__does",id:`${u2}-does`,children:(e3=>y2?e3:It)("Assign moves this note to the client or project you choose. Make event turns it into an event. Archive takes it out of Needs me, and you can undo it for a few seconds. Discard deletes it for good.")}),_("div",{className:"core-intent-card__actions",children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!y2||!r2||!V2,"aria-expanded":L2,"aria-describedby":`${u2}-does`,onClick:()=>R2(e3=>!e3),children:"Assign"}),g("button",{type:"button",className:"core-intent-card__button",disabled:!y2||!V2,"aria-describedby":`${u2}-does`,onClick:()=>void U2(),children:"Make event"}),g("button",{type:"button",className:"core-intent-card__button",disabled:!y2||!V2,"aria-describedby":`${u2}-does`,onClick:W2,children:"Archive"}),g("button",{type:"button",className:"core-intent-card__button",disabled:!y2||!V2,"aria-describedby":`${u2}-does`,onClick:()=>N2(true),children:"Discard"})]}),M2?_("div",{className:"core-note-card__confirm",role:"group","aria-label":"Discard this note",children:[g("p",{className:"core-intent-card__does",children:"Discard this note? It can’t be brought back from here."}),_("div",{className:"core-intent-card__actions",children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!V2,onClick:()=>void ne2(),children:m2==="discard"?"Discarding…":"Yes, discard"}),g("button",{ref:P2,type:"button",className:"core-intent-card__button",disabled:!V2,onClick:()=>N2(false),children:"Cancel"})]})]}):null,g("button",{type:"button",className:"core-note-card__instead",disabled:!y2||!V2,onClick:()=>void re2(),children:"Ask the assistant instead"})]}):null]})}var as=[15,30,45,60,90],os=30,ss=200,cs=3,ls=e2=>e2%60==0&&e2>=60?`${e2/60} h`:`${e2} min`;function us(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,o2=X(e2.subjectName),l2=(Array.isArray(e2.types)?e2.types:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&typeof e3.name=="string"&&e3.name.trim()!==""&&e3.kind!=="record"),u2=e2.prefill&&typeof e2.prefill=="object"?e2.prefill:{},d2=c(),{run:m2,busy:v2,message:y2,available:x2}=Lt(r2),S2=fo(u2.startsAt,n2),[C2,w2]=p(l2.find(e3=>e3.id===u2.typeId)?.id??l2[0]?.id??""),[T2,E2]=p((typeof u2.title=="string"?u2.title:"").slice(0,ss)),D2=n2??Ot(),O2=!(typeof u2.startOn=="string"&&$.test(u2.startOn))&&!S2,[k2,A2]=p(typeof u2.startOn=="string"&&$.test(u2.startOn)?u2.startOn:S2?.date??go(D2)),[j2,M2]=p(S2?.time??""),[N2,P2]=p(String(typeof u2.durationMin=="number"&&u2.durationMin>0?Math.round(u2.durationMin):os)),F2=Uo({people:e2.people,assignees:e2.assignees,linkCandidates:e2.linkCandidates,links:e2.links,attendeeIds:u2.attendeeIds}),I2=jo(l2.find(e3=>e3.id===C2)),L2=No(I2),R2=Rt(),z2=R2.held!==null,[B2,ee2]=p(null),te2=f(null),V2=f(null),H2=f(false);s(()=>{if(H2.current)return;if(O2){A2(go(D2));return}if(!u2.startsAt)return;let e3=fo(u2.startsAt,n2);e3&&(A2(e3.date),M2(e3.time))},[u2.startsAt,n2,O2,D2]),s(()=>{z2&&V2.current?.focus({preventScroll:true})},[z2]),s(()=>{B2&&te2.current?.focus({preventScroll:true})},[B2]);let U2=B2??(e2.booked&&typeof e2.booked=="object"?e2.booked:null);if(U2){let e3=zt(U2.href);return _("section",{ref:te2,tabIndex:-1,"aria-labelledby":`${d2}-status`,className:b("core-intent-card","core-book-event-card",i2),style:a2,"data-state":"booked",children:[_("div",{className:"core-intent-card__head",children:[_("span",{id:`${d2}-status`,className:"core-intent-card__eyebrow",children:["Booked",o2?` · ${o2}`:""]}),g("p",{className:"core-intent-card__title",children:U2.name??"Booked"}),U2.when?g("span",{className:"core-book-event-card__when",children:U2.when}):null]}),e3?g("a",{className:"core-book-event-card__go",href:e3,children:"Go to event"}):null]})}if(l2.length===0)return g("p",{className:b("core-intent-card","core-book-event-card","core-book-event-card__empty",i2),style:a2,children:"There’s nothing you can book here."});let W2=l2.find(e3=>e3.id===C2),G2=x2&&v2===null,ne2=x2&&!!o2&&!!W2&&$.test(k2),re2=x2?o2?k2?"":"Choose a day to book.":"Choose whose file this goes in first.":It,K2=$.test(k2)&&/^\d{2}:\d{2}$/.test(j2),ie2=K2?ho(k2,j2,D2):void 0,q2=Number(N2),ae2=ie2?new Date(ie2).getTime()<Date.now():$.test(k2)?k2<new Intl.DateTimeFormat("en-CA").format(new Date):false,oe2=[...new Set([...as,...Number.isInteger(q2)&&q2>0?[q2]:[]])].sort((e3,t3)=>e3-t3),se2=F2.picked,ce2=`${lo(k2,t2)}${K2?`, ${uo(j2,t2)}`:""}`,le2=K2?` (${ls(q2||os)})`:" (all day)",ue2=se2.length?` With ${se2.slice(0,cs).map(e3=>e3.name).join(", ")}${se2.length>cs?` and ${se2.length-cs} more`:""}.`:"",de2=F2.assignee,fe2=`Book this? It goes on the schedule for ${ce2}${le2}.${ue2}${de2?` Assigned to ${de2.name}.`:""}${Fo(L2.value)}${e2.invitesSent===true&&se2.length?" They are invited.":""}`,pe2=()=>{if(!ne2||v2!==null||!W2)return;let e3={typeId:W2.id};T2.trim()&&(e3.title=T2.trim()),e3.tzid=D2,ie2?(e3.startsAt=ie2,e3.durationMin=q2>0?q2:os):e3.startOn=k2,L2.value&&(e3.audience=L2.value),F2.write(e3),H2.current=true,R2.ask({values:e3,words:fe2,name:T2.trim()||W2.name,when:ce2})},me2=async()=>{let e3=R2.held;if(!e3||v2!==null)return;let{ok:t3,result:n3}=await m2("book_event",e3.values);R2.clear(),t3&&ee2({name:e3.name,when:e3.when,href:n3&&typeof n3=="object"?n3.data?.href:void 0})},he2=e3=>{e3.preventDefault(),pe2()},J2=e3=>t3=>{H2.current=true,e3(t3)};return _("form",{tabIndex:-1,ref:te2,"aria-labelledby":`${d2}-status`,className:b("core-intent-card","core-book-event-card",i2),style:a2,"data-state":z2?"confirming":"proposed",onSubmit:he2,"aria-busy":v2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:_("span",{id:`${d2}-status`,className:"core-intent-card__eyebrow",children:["Book a meeting",o2?` · ${o2}`:""]})}),_("div",{className:"core-intent-card__row",children:[l2.length>1?_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Type"}),g("select",{value:C2,disabled:!G2||z2,onChange:e3=>w2(e3.target.value),children:l2.map(e3=>g("option",{value:e3.id,children:e3.name},e3.id))})]}):null,_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Title (optional)"}),g("input",{value:T2,maxLength:ss,readOnly:!G2||z2,placeholder:W2?.name,onChange:e3=>E2(e3.target.value)})]})]}),_("div",{className:"core-intent-card__row",children:[_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Day"}),g("input",{type:"date",value:k2,required:true,readOnly:!G2||z2,onChange:e3=>J2(A2)(e3.target.value)})]}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Time (optional)"}),g("input",{type:"time",value:k2?j2:"",readOnly:!G2||z2,disabled:!k2,onChange:e3=>J2(M2)(e3.target.value)})]})]}),g("div",{className:"core-intent-card__row",children:_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"How long"}),g("select",{value:N2,disabled:!G2||z2||!K2,onChange:e3=>P2(e3.target.value),children:oe2.map(e3=>g("option",{value:e3,children:ls(e3)},e3))})]})}),g(Wo,{extras:F2,disabled:!G2||z2}),g(Io,{id:d2,audiences:I2,value:L2.value,onChange:L2.setValue,subjectName:o2,disabled:!G2||z2}),ae2&&!z2?g("p",{className:"core-book-event-card__note",children:"That time has passed."}):null,y2?g("p",{className:"core-intent-card__message",role:"alert",children:y2}):null,z2?_(h,{children:[g("p",{className:"core-intent-card__does",id:`${d2}-does`,role:"group","aria-label":"Confirm booking",children:R2.held?.words}),_("div",{className:"core-intent-card__actions",children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:v2!==null,onClick:()=>void me2(),children:v2==="book_event"?"Booking…":"Yes, book"}),g("button",{ref:V2,type:"button",className:"core-intent-card__button",disabled:v2!==null,onClick:R2.clear,children:"Cancel"})]},"confirm-actions")]}):_(h,{children:[re2?g("p",{className:"core-intent-card__does",id:`${d2}-does`,children:re2}):null,g("div",{className:"core-intent-card__actions",children:g("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!ne2||v2!==null,"aria-describedby":re2?`${d2}-does`:void 0,children:"Book"})},"book-actions")]})]})}var ds=[15,30,45,60,90],fs=30,ps=200,ms=200,hs=e2=>e2%60==0&&e2>=60?`${e2/60} h`:`${e2} min`,gs={title:"title",name:"title",startsAt:"when",startOn:"when",date:"when",time:"when",durationMin:"duration",assigneeId:"assignee",location:"location",audience:"audience"};function _s(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,o2=X(e2.subjectName),l2=e2.current&&typeof e2.current=="object"?e2.current:{},u2=e2.prefill&&typeof e2.prefill=="object"?e2.prefill:{},d2=c(),{run:m2,busy:v2,message:y2,available:x2}=Lt(r2),S2=n2??l2.tzid??Ot(),C2=fo(l2.startsAt,S2),w2=C2?.date??(typeof l2.startOn=="string"&&$.test(l2.startOn)?l2.startOn:""),T2=C2?.time??"",E2=typeof l2.durationMin=="number"&&l2.durationMin>0?Math.round(l2.durationMin):fs,D2=(typeof l2.name=="string"?l2.name:"").slice(0,ps),O2=(Array.isArray(e2.assignees)?e2.assignees:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&typeof e3.name=="string"),k2=l2.assigneeId?O2.find(e3=>e3.id===l2.assigneeId)?.id??"":O2.find(e3=>e3.name===l2.assigneeName)?.id??"",A2=fo(u2.startsAt,S2),j2=typeof u2.startOn=="string"&&$.test(u2.startOn)?u2.startOn:void 0,[M2,N2]=p(typeof u2.title=="string"?u2.title.slice(0,ps):D2),[P2,F2]=p(A2?.date??j2??w2),[I2,L2]=p(A2?A2.time:j2?"":T2),R2=(typeof l2.location=="string"?l2.location:"").slice(0,ms),[z2,B2]=p(typeof u2.location=="string"?u2.location.slice(0,ms):R2),[ee2,te2]=p(String(typeof u2.durationMin=="number"&&u2.durationMin>0?Math.round(u2.durationMin):E2)),V2=Uo({assignees:O2,assigneeId:typeof u2.assigneeId=="string"?u2.assigneeId:k2}),H2=jo((Array.isArray(e2.types)?e2.types:[]).find(e3=>e3&&typeof e3=="object"&&(e3.id===l2.typeId||!l2.typeId&&e3.name===l2.typeName))),U2=No(H2,H2.includes(l2.audience)?l2.audience:"team"),[W2,G2]=p(false),[ne2,re2]=p(null),K2=f(null),ie2=f(null);s(()=>{W2&&ie2.current?.focus({preventScroll:true})},[W2]),s(()=>{ne2&&K2.current?.focus({preventScroll:true})},[ne2]);let q2=ne2??(e2.updated&&typeof e2.updated=="object"?{kind:"updated",...e2.updated}:e2.cancelled&&typeof e2.cancelled=="object"?{kind:"cancelled",...e2.cancelled}:e2.assigned&&typeof e2.assigned=="object"?{kind:"assigned",...e2.assigned}:l2.status==="cancelled"?{kind:"cancelled",name:l2.name}:null);if(q2){let e3=q2.kind==="updated"?zt(q2.href):void 0;return _("section",{ref:K2,tabIndex:-1,"aria-labelledby":`${d2}-status`,className:b("core-intent-card","core-book-event-card","core-edit-event-card",i2),style:a2,"data-state":q2.kind,children:[_("div",{className:"core-intent-card__head",children:[_("span",{id:`${d2}-status`,className:"core-intent-card__eyebrow",children:[q2.kind==="updated"?"Updated":q2.kind==="assigned"?"Assigned to you":"Cancelled",o2?` · ${o2}`:""]}),g("p",{className:b("core-intent-card__title",q2.kind==="cancelled"&&"core-edit-event-card__struck"),children:q2.name??l2.name??"Done"})]}),e3?g("a",{className:"core-book-event-card__go",href:e3,children:"Go to event"}):null]})}let ae2=!(x2&&v2===null)||W2,oe2=$.test(P2)&&/^\d{2}:\d{2}$/.test(I2),se2=Number(ee2),ce2=[...new Set([...ds,...Number.isInteger(se2)&&se2>0?[se2]:[],E2])].sort((e3,t3)=>e3-t3),le2=new Set((Array.isArray(e2.changed)?e2.changed:[]).map(e3=>gs[e3]).filter(Boolean)),ue2=P2!==w2||I2!==T2,de2=oe2&&se2!==E2,fe2=V2.assigneeId!==k2,pe2=U2.value!==void 0&&U2.value!==(H2.includes(l2.audience)?l2.audience:"team"),me2=M2.trim()!==D2.trim(),he2=z2.trim()!==R2.trim(),J2={title:me2||le2.has("title"),when:ue2||le2.has("when"),duration:de2||le2.has("duration"),location:he2||le2.has("location"),assignee:fe2||le2.has("assignee"),audience:pe2||le2.has("audience")},ge2=me2||ue2||de2||he2||fe2||pe2,_e2=x2&&!!$.test(P2)&&M2.trim()!==""&&ge2,ve2=x2?M2.trim()?$.test(P2)?ge2?"":"Change something to save it.":"Choose a day.":"The event needs a title.":It,ye2=w2?`${lo(w2,t2)}${T2?`, ${uo(T2,t2)}`:" (all day)"}`:"No time set",be2=(e3,t3,n3)=>J2[e3]?_("span",{className:"core-edit-event-card__was",id:n3,children:[g("span",{className:"core-edit-event-card__was-label",children:"Was"})," ",t3]}):null,xe2=e3=>b("core-intent-card__field",J2[e3]&&"core-edit-event-card__changed"),Se2=async()=>{if(!_e2||v2!==null)return;let e3={};me2&&(e3.title=M2.trim()),ue2&&(S2!==l2.tzid&&(e3.tzid=S2),oe2?e3.startsAt=ho(P2,I2,S2):e3.startOn=P2),de2&&(e3.durationMin=se2>0?se2:fs),he2&&(e3.location=z2.trim()),fe2&&(e3.assigneeId=V2.assigneeId===""?null:V2.assigneeId),pe2&&U2.value&&(e3.audience=U2.value);let{ok:t3,result:n3}=await m2("update_event",e3);t3&&re2({kind:"updated",name:M2.trim()||D2,href:n3&&typeof n3=="object"?n3.data?.href:void 0})},Ce2=!l2.assigneeId&&!l2.assigneeName,we2=async()=>{if(v2!==null)return;let{ok:e3}=await m2("assign_self");e3&&re2({kind:"assigned",name:D2})},Te2=async()=>{if(v2!==null)return;let{ok:e3}=await m2("cancel_event");G2(false),e3&&re2({kind:"cancelled",name:D2})};return _("form",{tabIndex:-1,ref:K2,"aria-labelledby":`${d2}-status`,className:b("core-intent-card","core-book-event-card","core-edit-event-card",i2),style:a2,"data-state":W2?"cancelling":"editing",onSubmit:e3=>{e3.preventDefault(),_e2&&v2===null&&Se2()},"aria-busy":v2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:_("span",{id:`${d2}-status`,className:"core-intent-card__eyebrow",children:["Change a meeting",o2?` · ${o2}`:""]})}),_("div",{className:"core-intent-card__row",children:[l2.typeName?_("div",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Type"}),g("span",{className:"core-edit-event-card__fixed",children:l2.typeName})]}):null,_("div",{className:xe2("title"),"data-changed":J2.title?"":void 0,children:[g("label",{className:"core-intent-card__label",htmlFor:`${d2}-title`,children:"Title"}),g("input",{id:`${d2}-title`,value:M2,maxLength:ps,readOnly:ae2,placeholder:l2.typeName,"aria-describedby":J2.title?`${d2}-title-was`:void 0,onChange:e3=>N2(e3.target.value)}),be2("title",D2||"No title",`${d2}-title-was`)]})]}),_("div",{className:"core-intent-card__row",children:[_("div",{className:xe2("when"),"data-changed":J2.when?"":void 0,children:[g("label",{className:"core-intent-card__label",htmlFor:`${d2}-day`,children:"Day"}),g("input",{id:`${d2}-day`,type:"date",value:P2,required:true,readOnly:ae2,"aria-describedby":J2.when?`${d2}-when-was`:void 0,onChange:e3=>F2(e3.target.value)}),be2("when",ye2,`${d2}-when-was`)]}),_("div",{className:xe2("when"),"data-changed":J2.when?"":void 0,children:[g("label",{className:"core-intent-card__label",htmlFor:`${d2}-time`,children:"Time (optional)"}),g("input",{id:`${d2}-time`,type:"time",value:P2?I2:"",readOnly:ae2,disabled:!P2,"aria-describedby":J2.when?`${d2}-when-was`:void 0,onChange:e3=>L2(e3.target.value)})]})]}),g("div",{className:"core-intent-card__row",children:_("div",{className:xe2("duration"),"data-changed":J2.duration?"":void 0,children:[g("label",{className:"core-intent-card__label",htmlFor:`${d2}-length`,children:"How long"}),g("select",{id:`${d2}-length`,value:ee2,disabled:ae2||!oe2,"aria-describedby":J2.duration?`${d2}-duration-was`:void 0,onChange:e3=>te2(e3.target.value),children:ce2.map(e3=>g("option",{value:e3,children:hs(e3)},e3))}),be2("duration",T2?hs(E2):"All day",`${d2}-duration-was`)]})}),g("div",{className:"core-intent-card__row",children:_("div",{className:xe2("location"),"data-changed":J2.location?"":void 0,children:[g("label",{className:"core-intent-card__label",htmlFor:`${d2}-location`,children:"Location (optional)"}),g("input",{id:`${d2}-location`,value:z2,maxLength:ms,readOnly:ae2,"aria-describedby":J2.location?`${d2}-location-was`:void 0,onChange:e3=>B2(e3.target.value)}),be2("location",R2||"No location",`${d2}-location-was`)]})}),_("div",{className:b(J2.assignee&&"core-edit-event-card__changed-block"),"data-changed":J2.assignee?"":void 0,children:[g(Wo,{extras:V2,disabled:ae2}),be2("assignee",l2.assigneeName??"No one")]}),_("div",{className:b(J2.audience&&"core-edit-event-card__changed-block"),"data-changed":J2.audience?"":void 0,children:[g(Io,{id:d2,audiences:H2,value:U2.value,onChange:U2.setValue,subjectName:o2,disabled:ae2}),be2("audience",l2.audience?Po(l2.audience,o2):"")]}),y2?g("p",{className:"core-intent-card__message",role:"alert",children:y2}):null,W2?_(h,{children:[g("p",{className:"core-intent-card__does",id:`${d2}-does`,role:"group","aria-label":"Confirm cancelling",children:"Cancel this event? It can’t be undone from here."}),_("div",{className:"core-intent-card__actions",children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:v2!==null,onClick:()=>void Te2(),children:v2==="cancel_event"?"Cancelling…":"Yes, cancel the event"}),g("button",{ref:ie2,type:"button",className:"core-intent-card__button",disabled:v2!==null,onClick:()=>G2(false),children:"Keep it"})]},"cancel-actions")]}):_(h,{children:[ve2?g("p",{className:"core-intent-card__does",id:`${d2}-does`,children:ve2}):null,_("div",{className:"core-intent-card__actions",children:[g("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!_e2||v2!==null,"aria-describedby":ve2?`${d2}-does`:void 0,children:v2==="update_event"?"Saving…":"Save changes"}),Ce2?g("button",{type:"button",className:"core-intent-card__button",disabled:!x2||v2!==null,onClick:()=>void we2(),children:v2==="assign_self"?"Assigning…":"Assign to me"}):null,g("button",{type:"button",className:"core-intent-card__button",disabled:!x2||v2!==null,onClick:()=>G2(true),children:"Cancel the event"})]},"save-actions")]})]})}var vs=4e3;function ys(e2){let{onIntent:t2,className:n2,style:r2}=e2,i2=X(e2.eventName),a2=X(e2.subjectName),o2=c(),{run:l2,busy:u2,message:d2,available:m2}=Lt(t2),[h2,v2]=p((typeof e2.body=="string"?e2.body:"").slice(0,vs)),[y2,x2]=p(false),[S2,C2]=p(null),w2=f(null);s(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]);let T2=S2??(e2.noted&&typeof e2.noted=="object"?e2.noted:null);if(T2){let e3=zt(T2.href);return _("section",{ref:w2,tabIndex:-1,"aria-labelledby":`${o2}-status`,className:b("core-intent-card","core-book-event-card","core-event-note-card",n2),style:r2,"data-state":"noted",children:[_("div",{className:"core-intent-card__head",children:[_("span",{id:`${o2}-status`,className:"core-intent-card__eyebrow",children:["Noted",i2?` · ${i2}`:""]}),g("p",{className:"core-intent-card__title",children:T2.name??i2??"Noted"})]}),e3?g("a",{className:"core-book-event-card__go",href:e3,children:"Go to event"}):null]})}let E2=m2&&u2===null,D2=m2&&!!i2&&h2.trim()!=="",O2=m2?i2?h2.trim()===""?"Write the note first.":"":"Choose the event first.":It,k2=async()=>{if(!D2||u2!==null)return;let e3={body:h2.trim()};y2&&(e3.audience="client");let{ok:t3,result:n3}=await l2("add_note",e3);t3&&C2({name:i2,href:n3&&typeof n3=="object"?n3.data?.href:void 0})};return _("form",{tabIndex:-1,ref:w2,"aria-labelledby":`${o2}-status`,className:b("core-intent-card","core-book-event-card","core-event-note-card",n2),style:r2,"data-state":"proposed",onSubmit:e3=>{e3.preventDefault(),k2()},"aria-busy":u2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:_("span",{id:`${o2}-status`,className:"core-intent-card__eyebrow",children:["Add a note",i2?` · ${i2}`:""]})}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Note"}),g("textarea",{value:h2,rows:4,maxLength:vs,readOnly:!E2,onChange:e3=>v2(e3.target.value)})]}),a2?_("label",{className:"core-intent-card__person",children:[g("input",{type:"checkbox",checked:y2,disabled:!E2,onChange:e3=>x2(e3.target.checked)}),_("span",{className:"core-intent-card__person-name",children:["Share with ",a2]})]}):null,g("p",{className:"core-intent-card__does",id:`${o2}-does`,children:O2||(y2?`${a2} will see this note.`:"Only staff will see this note.")}),d2?g("p",{className:"core-intent-card__message",role:"alert",children:d2}):null,g("div",{className:"core-intent-card__actions",children:g("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!D2||u2!==null,"aria-describedby":`${o2}-does`,children:u2==="add_note"?"Adding…":"Add note"})},"note-actions")]})}var bs=["proposed","created","done"],xs=200;function Ss(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,o2=(Array.isArray(e2.types)?e2.types:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&typeof e3.name=="string"&&e3.name.trim()!==""),l2=X(e2.subjectName),u2=e2.task&&typeof e2.task=="object"&&typeof e2.task.title=="string"?e2.task:null,d2=c(),{run:m2,busy:v2,message:y2,available:x2}=Lt(r2),[S2,C2]=p((u2?.title??"").slice(0,xs)),w2=fo(u2?.dueAt,n2),T2=n2??Ot(),E2=!(u2?.dueOn&&$.test(u2.dueOn))&&!w2,[D2,O2]=p(u2?.dueOn&&$.test(u2.dueOn)?u2.dueOn:w2?.date??go(T2)),[k2,A2]=p(w2?.time??""),j2=f(false);s(()=>{if(j2.current)return;if(E2){O2(go(T2));return}if(!u2?.dueAt)return;let e3=fo(u2.dueAt,n2);e3&&(u2.dueOn&&$.test(u2.dueOn)||O2(e3.date),A2(e3.time))},[u2?.dueAt,u2?.dueOn,n2,E2,T2]);let M2=Uo({people:e2.people,assignees:e2.assignees,linkCandidates:e2.linkCandidates,links:e2.links}),[N2,P2]=p(o2.find(e3=>e3.id===u2?.typeId)?.id??o2[0]?.id??""),F2=jo(o2.find(e3=>e3.id===N2)),I2=No(F2),[L2,R2]=p(null),z2=u2?.state&&bs.includes(u2.state)?u2.state:"proposed",B2=L2&&bs.indexOf(L2)>bs.indexOf(z2)?L2:z2,ee2=f(null),te2=f(null),[V2,H2]=p(false);if(s(()=>{V2&&te2.current?.focus({preventScroll:true})},[V2]),s(()=>{L2&&ee2.current?.focus({preventScroll:true})},[L2]),!u2)return null;let U2=B2==="proposed"&&x2&&v2===null,W2=x2&&!!l2&&S2.trim()!=="",G2=async e3=>{if(e3.preventDefault(),!W2||v2!==null)return;let t3=D2||go(T2),n3=k2?ho(t3,k2,T2):void 0,r3={title:S2.trim(),...o2.length>0&&N2?{typeId:N2}:{},dueOn:t3,...n3?{dueAt:n3}:{},...I2.value?{audience:I2.value}:{},tzid:T2};M2.write(r3);let{ok:i3}=await m2("log_event",r3);i3&&R2("created")},ne2=async()=>{let{ok:e3}=await m2("complete");H2(false),e3&&R2("done")},re2=B2==="proposed"?{date:D2||go(T2),time:k2}:{date:u2.dueOn&&$.test(u2.dueOn)?u2.dueOn:fo(u2.dueAt,n2)?.date??"",time:fo(u2.dueAt,n2)?.time??""},K2=[re2.date===go(T2)?"today":lo(re2.date,t2),re2.date&&re2.time?uo(re2.time,t2):""].filter(Boolean).join(", "),ie2=B2==="proposed"?"Task · suggested":B2==="done"?"Task · done":"Task",q2=B2==="proposed"?W2?`Create task adds this to ${l2}’s tasks.`:x2?l2?"":"Choose whose file this goes in first.":It:B2==="created"?V2?"Mark this task done? It can’t be reopened from here.":"Mark done closes this task.":"";return _("form",{ref:ee2,tabIndex:-1,"aria-labelledby":`${d2}-status`,className:b("core-intent-card","core-task-card",i2),style:a2,"data-state":B2,onSubmit:e3=>void G2(e3),"aria-busy":v2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[_("span",{id:`${d2}-status`,className:"core-intent-card__eyebrow",children:[ie2,l2?` · ${l2}`:""]}),B2==="proposed"&&o2.length>1?_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Type"}),g("select",{value:N2,disabled:!U2,onChange:e3=>P2(e3.target.value),children:o2.map(e3=>g("option",{value:e3.id,children:e3.name},e3.id))})]}):null,B2==="proposed"?_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"What needs doing"}),g("input",{value:S2,maxLength:xs,readOnly:!U2,onChange:e3=>C2(e3.target.value),required:true})]}):g("p",{className:"core-intent-card__title core-task-card__title","data-done":B2==="done"?"":void 0,children:u2.title})]}),B2==="proposed"?_("div",{className:"core-intent-card__row",children:[_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Due"}),g("input",{type:"date",value:D2,readOnly:!U2,onChange:e3=>(j2.current=true,O2(e3.target.value))})]}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Time (optional)"}),g("input",{type:"time",value:D2?k2:"",readOnly:!U2,disabled:!D2,onChange:e3=>(j2.current=true,A2(e3.target.value))})]})]}):null,B2==="proposed"?g(Wo,{extras:M2,disabled:!U2}):null,B2==="proposed"?g(Io,{id:d2,audiences:F2,value:I2.value,onChange:I2.setValue,subjectName:l2,disabled:!U2}):null,g("p",{className:"core-task-card__meta",children:[K2?`Due ${K2}`:"",u2.assigneeName?`For ${u2.assigneeName}`:""].filter(Boolean).join(" · ")||(B2==="proposed"?"":"No due date")}),y2?g("p",{className:"core-intent-card__message",role:"alert",children:y2}):null,q2?g("p",{className:"core-intent-card__does",id:`${d2}-does`,children:q2}):null,B2==="done"?null:g("div",{className:"core-intent-card__actions",children:B2==="proposed"?g("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!W2||v2!==null,"aria-describedby":`${d2}-does`,children:v2==="log_event"?"Creating…":"Create task"}):V2?_(h,{children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:v2!==null,onClick:()=>void ne2(),children:v2==="complete"?"Saving…":"Yes, mark done"}),g("button",{ref:te2,type:"button",className:"core-intent-card__button",disabled:v2!==null,onClick:()=>H2(false),children:"Cancel"})]}):g("button",{type:"button",className:"core-intent-card__button",disabled:!x2||v2!==null,"aria-describedby":`${d2}-does`,onClick:()=>H2(true),children:"Mark done"})})]})}function Cs(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,o2=X(e2.scopeName),l2=c(),{run:u2,busy:d2,message:m2,available:v2}=Lt(r2),[y2,x2]=p(null),S2=f(null);if(s(()=>{y2&&S2.current?.focus({preventScroll:true})},[y2]),!o2)return null;let C2=e2.pointer&&typeof e2.pointer=="object"?e2.pointer:void 0,w2="";if(C2?.kind==="conversation"){let e3=typeof C2.at=="string"?new Date(C2.at):null;w2=e3&&!Number.isNaN(e3.getTime())?`Conversation · ${new Intl.DateTimeFormat(t2,{month:"short",day:"numeric",timeZone:n2}).format(e3)}`:"Conversation"}else C2?.kind==="event"&&(w2=X(C2.name)??"Event");let T2=d2===null,E2=async e3=>{let{ok:t3}=await u2(e3);t3&&x2(e3==="dismiss"?"dismissed":"continued")},D2=y2==="continued"?"Picked up":y2==="dismissed"?"Dismissed":"Pick up where you left off";return _("div",{ref:S2,tabIndex:-1,role:"group","aria-labelledby":`${l2}-status`,className:b("core-intent-card","core-handover-card",i2),style:a2,"data-state":y2??(v2?"offered":"display"),"aria-busy":d2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[g("span",{id:`${l2}-status`,className:"core-intent-card__eyebrow",children:D2}),g("p",{className:"core-intent-card__title",children:o2}),w2?g("span",{className:"core-handover-card__where",children:w2}):null]}),m2?g("p",{className:"core-intent-card__message",role:"alert",children:m2}):null,y2?null:_(h,{children:[g("p",{className:"core-intent-card__does",id:`${l2}-does`,children:v2?`Continue opens your earlier conversation about ${o2}. Dismiss hides this.`:It}),_("div",{className:"core-intent-card__actions",children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!v2||!T2,"aria-describedby":`${l2}-does`,onClick:()=>void E2("handover_continue"),children:d2==="handover_continue"?"Opening…":"Continue"}),g("button",{type:"button",className:"core-intent-card__button",disabled:!v2||!T2,"aria-describedby":`${l2}-does`,onClick:()=>void E2("dismiss"),children:"Dismiss"})]})]})]})}var ws=12,Ts=(e2,t2=200)=>typeof e2=="string"?e2.replace(/\s+/g," ").trim().slice(0,t2):"";function Es(e2){let{typicalTime:t2,typicalCost:n2,costCap:r2,onIntent:i2,className:a2,style:o2}=e2,l2=X(e2.processName),u2=X(e2.subjectName),d2=c(),{run:m2,busy:v2,message:y2,available:x2}=Lt(i2),[S2,C2]=p(false),w2=f(null);if(s(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]),!l2)return null;let T2=Ts(e2.description),E2=(Array.isArray(e2.needs)?e2.needs:[]).filter(e3=>e3&&typeof e3=="object"&&Ts(e3.label)).slice(0,ws),D2=[t2&&`Typical time: ${Ts(t2,60)}`,n2&&`Typical cost: ${Ts(n2,60)}`,r2&&`Cost cap: ${Ts(r2,60)}`].filter(Boolean).join(" · "),O2=e2.running&&typeof e2.running=="object"?e2.running:null,k2=zt(O2?.href),A2=x2&&!!u2,j2=x2?u2?"":"Choose who this is for before starting.":It,M2=S2?"Started":O2?"Running":"Start a service",N2=async()=>{if(!A2||v2!==null)return;let{ok:e3}=await m2("start_process");e3&&C2(true)};return _("div",{ref:w2,tabIndex:-1,role:"group","aria-labelledby":`${d2}-status`,className:b("core-intent-card","core-start-process-card",a2),style:o2,"data-state":S2?"started":O2?"running":x2?"offered":"display","aria-busy":v2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[g("span",{id:`${d2}-status`,className:"core-intent-card__eyebrow",children:M2}),g("p",{className:"core-intent-card__title",children:l2}),u2?_("span",{className:"core-start-process-card__for",children:["For ",u2]}):null]}),T2?g("p",{className:"core-start-process-card__description",children:T2}):null,E2.length>0?_("div",{className:"core-start-process-card__needs",children:[g("span",{className:"core-start-process-card__label",children:"What it needs"}),g("ul",{children:E2.map((e3,t3)=>_("li",{"data-have":e3.have===true?"":void 0,children:[g("span",{className:"core-start-process-card__mark","aria-hidden":"true"}),g("span",{children:Ts(e3.label)}),g("span",{className:"core-start-process-card__have",children:e3.have===true?"Have":"Needed"})]},t3))})]}):null,D2?g("p",{className:"core-start-process-card__meta",children:D2}):null,y2?g("p",{className:"core-intent-card__message",role:"alert",children:y2}):null,S2?g("p",{className:"core-intent-card__does",children:"Started. Progress will arrive in the conversation."}):O2?k2?g("a",{className:"core-start-process-card__go",href:k2,children:"Open"}):null:_(h,{children:[g("p",{className:"core-intent-card__does",id:`${d2}-does`,children:A2?`Start begins ${l2} for ${u2}. Nothing is shared with ${u2} until you choose to share it.`:j2}),g("div",{className:"core-intent-card__actions",children:g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!A2||v2!==null,"aria-describedby":`${d2}-does`,onClick:()=>void N2(),children:v2==="start_process"?"Starting…":"Start"})})]})]})}var Ds=12,Os=8,ks=600;function As(e2){let{onIntent:t2,className:n2,style:r2}=e2,i2=c(),{run:a2,busy:o2,message:l2,available:u2}=Lt(t2),[d2,m2]=p({}),[v2,y2]=p({}),[x2,S2]=p(null),C2=f(null),w2=f(false);s(()=>{w2.current&&C2.current?.focus({preventScroll:true})},[d2]);let T2=new Set,E2=(Array.isArray(e2.parts)?e2.parts:[]).filter(e3=>!e3||typeof e3!="object"||typeof e3.id!="string"||typeof e3.text!="string"||!e3.text.trim()||T2.has(e3.id)?false:(T2.add(e3.id),true)).slice(0,Ds);if(E2.length===0)return null;let D2=e3=>(Array.isArray(e3.matches)?e3.matches:[]).filter(e4=>e4&&typeof e4.id=="string"&&X(e4.name)&&(e4.kind==="client"||e4.kind==="project")).slice(0,Os),O2=e3=>d2[e3.id]??(e3.state==="assigned"||e3.state==="dropped"?{state:e3.state,name:X(e3.assignedToName)}:null),k2=E2.filter(e3=>!O2(e3)),A2=k2.length===0,j2=async(e3,t3)=>{S2(e3.id);let{ok:n3}=await a2("confirm_part",{partId:e3.id,targetId:t3.id,targetKind:t3.kind});n3&&(w2.current=true,m2(n4=>({...n4,[e3.id]:{state:"assigned",name:X(t3.name)}})))},M2=async e3=>{S2(e3.id);let{ok:t3}=await a2("drop_part",{partId:e3.id});t3&&(w2.current=true,m2(t4=>({...t4,[e3.id]:{state:"dropped"}})))},N2=o2===null;return _("div",{ref:C2,tabIndex:-1,role:"group","aria-labelledby":`${i2}-status`,className:b("core-intent-card","core-note-split-card",n2),style:r2,"data-state":A2?"sorted":u2?"open":"display","aria-busy":o2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[g("span",{id:`${i2}-status`,className:"core-intent-card__eyebrow",children:A2?"Note sorted":"Note to sort"}),g("p",{className:"core-intent-card__title",children:A2?"Every part is sorted":`${k2.length} of ${E2.length} ${E2.length===1?"part":"parts"} to sort`})]}),g("ol",{className:"core-note-split-card__parts",children:E2.map((e3,t3)=>{let n3=O2(e3),r3=D2(e3),a3=v2[e3.id]??(r3.length===1?r3[0].id:""),s2=r3.find(e4=>e4.id===a3),c2=e3.text.length>ks?`${e3.text.slice(0,599)}…`:e3.text,d3=`Part ${t3+1}`;return _("li",{className:"core-note-split-card__part","data-state":n3?.state??"open",children:[g("span",{className:"core-note-split-card__label",children:d3}),g("p",{className:"core-note-split-card__text",children:c2}),n3?g("p",{className:"core-note-split-card__result",children:n3.state==="dropped"?"Dropped":`Assigned${n3.name?` to ${n3.name}`:""}`}):_(h,{children:[r3.length===0?g("p",{className:"core-note-split-card__hint",children:"No client or project matches. You can drop this part."}):r3.length===1?_("p",{className:"core-note-split-card__hint",children:["Looks like ",g("strong",{children:X(r3[0].name)}),r3[0].detail?` · ${X(r3[0].detail)}`:"",". Confirm it, or drop the part."]}):_("fieldset",{className:"core-note-split-card__choices",disabled:!u2||!N2,children:[_("legend",{className:"core-note-split-card__hint",children:[r3.length," match: choose who this is for."]}),r3.map(t4=>_("label",{className:"core-note-split-card__choice",children:[g("input",{type:"radio",name:`${i2}-${e3.id}`,value:t4.id,checked:a3===t4.id,onChange:()=>y2(n4=>({...n4,[e3.id]:t4.id}))}),_("span",{children:[g("span",{className:"core-note-split-card__name",children:X(t4.name)}),g("span",{className:"core-note-split-card__detail",children:[t4.kind==="project"?"Project":"Client",X(t4.detail)].filter(Boolean).join(" · ")})]})]},t4.id))]}),x2===e3.id&&l2?g("p",{className:"core-intent-card__message",role:"alert",children:l2}):null,_("div",{className:"core-intent-card__actions",children:[r3.length>0?g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!u2||!N2||!s2,"aria-label":`Confirm ${d3}${s2?` for ${X(s2.name)}`:""}`,onClick:()=>s2&&void j2(e3,s2),children:o2==="confirm_part"&&x2===e3.id?"Confirming…":"Confirm"}):null,g("button",{type:"button",className:"core-intent-card__button",disabled:!u2||!N2,"aria-label":`Drop ${d3}`,onClick:()=>void M2(e3),children:"Drop"})]})]})]},e3.id)})}),A2?null:g("p",{className:"core-intent-card__does",children:u2?"Confirm sends that part to the client or project you choose. Drop leaves it out. The original note stays as the record.":It})]})}var js=20;function Ms(e2){let{onIntent:t2,onCancel:n2,className:r2,style:i2}=e2,a2=e2.mode==="withdraw"?"withdraw":"share",o2=X(e2.clientName),l2=c(),{run:u2,busy:d2,message:m2,available:v2}=Lt(t2),[y2,x2]=p(false),[S2,C2]=p(false),w2=f(null);s(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]);let T2=(Array.isArray(e2.items)?e2.items:[]).filter(e3=>e3&&typeof e3=="object"&&X(e3.name)).slice(0,js);if(T2.length===0)return null;let E2=a2==="share",D2=v2&&!!o2&&(!E2||y2),O2=v2?o2?E2&&!y2?"Tick “I’ve reviewed this” to share.":"":"Choose who this is for before sending.":It,k2=E2?"Share":"Stop sharing",A2=S2?E2?"Shared":"Sharing stopped":E2?"Share for approval":"Stop sharing",j2=async()=>{if(!D2||d2!==null)return;let{ok:e3}=await u2(E2?"share":"withdraw",E2?{reviewed:true}:void 0);e3&&C2(true)};return _("div",{ref:w2,tabIndex:-1,role:"group","aria-labelledby":`${l2}-status`,className:b("core-intent-card","core-share-approval-card",r2),style:i2,"data-state":S2?"done":v2?"asking":"display","data-mode":a2,"aria-busy":d2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[g("span",{id:`${l2}-status`,className:"core-intent-card__eyebrow",children:A2}),g("p",{className:"core-intent-card__title",children:o2?E2?`Share with ${o2}`:`Stop sharing with ${o2}`:E2?"Share with whom?":"Stop sharing with whom?"})]}),g("ul",{className:"core-share-approval-card__items",children:T2.map((e3,t3)=>_("li",{children:[g("span",{className:"core-share-approval-card__name",children:X(e3.name)}),X(e3.projectName)?g("span",{className:"core-share-approval-card__project",children:X(e3.projectName)}):null]},t3))}),m2?g("p",{className:"core-intent-card__message",role:"alert",children:m2}):null,S2?g("p",{className:"core-intent-card__does",children:E2?`${T2.length===1?"This is":"These are"} now shared with ${o2}.`:`${T2.length===1?"This is":"These are"} no longer shared with ${o2}.`}):_(h,{children:[g("p",{className:"core-intent-card__does",id:`${l2}-does`,children:o2?E2?`Sharing makes ${T2.length===1?"this":"these"} visible to ${o2} in their portal. You can stop sharing later.`:`Stop sharing takes ${T2.length===1?"this":"these"} out of ${o2}’s portal.`:O2}),E2?_("label",{className:"core-share-approval-card__review",children:[g("input",{type:"checkbox",checked:y2,disabled:!v2||d2!==null,onChange:e3=>x2(e3.target.checked)}),g("span",{children:"I’ve reviewed this"})]}):null,O2&&o2?g("p",{className:"core-share-approval-card__reason",id:`${l2}-reason`,children:O2}):null,_("div",{className:"core-intent-card__actions",children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!D2||d2!==null,"aria-describedby":`${l2}-does`,onClick:()=>void j2(),children:d2===null?k2:"Saving…"}),typeof n2=="function"?g("button",{type:"button",className:"core-intent-card__button",disabled:d2!==null,onClick:n2,children:"Not now"}):null]})]})]})}var Ns={save_as_note:{label:"Save as note",busy:"Saving…",done:"Saved as note"},make_follow_up:{label:"Make follow-up",busy:"Making…",done:"Follow-up made"}},Ps=["save_as_note","make_follow_up"];function Fs(e2){let{onIntent:t2,className:n2,style:r2}=e2,i2=Array.isArray(e2.actions)?Ps.filter(t3=>e2.actions.includes(t3)):Ps,a2=c(),{run:o2,busy:s2,message:l2,available:u2}=Lt(t2),[d2,f2]=p(new Set);if(i2.length===0)return null;let m2=async e3=>{let{ok:t3}=await o2(e3);t3&&f2(t4=>new Set(t4).add(e3))};return _("div",{role:"group","aria-label":"Suggested actions",className:b("core-suggested-actions",n2),style:r2,"aria-busy":s2!==null||void 0,children:[g("div",{className:"core-suggested-actions__row",children:i2.map(e3=>{let t3=d2.has(e3);return g("button",{type:"button",className:"core-suggested-actions__chip","data-done":t3||void 0,disabled:!u2||s2!==null||t3,"aria-describedby":u2?void 0:`${a2}-does`,onClick:()=>void m2(e3),children:t3?Ns[e3].done:s2===e3?Ns[e3].busy:Ns[e3].label},e3)})}),l2?g("p",{className:"core-intent-card__message",role:"alert",children:l2}):null,u2?null:g("p",{id:`${a2}-does`,className:"core-suggested-actions__does",children:It})]})}var Is=e2=>!!e2&&typeof e2=="object"&&typeof e2.label=="string"&&pa(e2.href)!==null;function Ls(e2){return(Array.isArray(e2)?e2:e2?[e2]:[]).filter(Is)}function Rs({action:e2,className:t2}){let n2=pa(e2.href);if(n2===null)return null;let r2=e2.variant==="secondary"?"secondary":"primary";return g("a",{className:b("core-public-action",t2),"data-variant":r2,href:n2,children:e2.label})}function zs({actions:e2,className:t2}){return e2.length?g("div",{className:b("core-public-actions",t2),children:e2.map((e3,t3)=>g(Rs,{action:e3},`${e3.href}-${t3}`))}):null}function Bs(e2){if(!e2||typeof e2!="object")return null;let t2=e2,n2=ma(t2.src);return n2===null?null:{src:n2,alt:t2.decorative?"":typeof t2.alt=="string"?t2.alt:""}}function Vs({eyebrow:e2,title:t2,intro:n2,actions:r2,media:i2,align:a2,className:o2,style:s2}){let c2=Bs(i2),l2=a2==="center";return _("section",{className:b("core-hero",o2),"data-align":l2?"center":"start","data-media":c2?"yes":"no",style:s2,children:[_("div",{className:"core-hero__text",children:[e2?g("p",{className:"core-hero__eyebrow",children:e2}):null,g("h1",{className:"core-hero__title",children:t2}),n2?g("p",{className:"core-hero__intro",children:n2}):null,g(zs,{actions:Ls(r2).slice(0,2),className:"core-hero__actions"})]}),c2?g("div",{className:"core-hero__media",children:g("img",{src:c2.src,alt:c2.alt,loading:"eager",decoding:"async"})}):null]})}function Hs({text:e2,src:t2,href:n2,size:r2,className:i2,style:a2}){let o2=r2==="sm"||r2==="lg"?r2:"md",s2=ma(t2),c2=pa(n2),l2=s2?g("img",{className:"core-logo-mark__img",src:s2,alt:e2}):g("span",{className:"core-logo-mark__text",children:e2});return c2?g("a",{className:b("core-logo-mark",i2),"data-size":o2,href:c2,style:a2,children:l2}):g("span",{className:b("core-logo-mark",i2),"data-size":o2,style:a2,children:l2})}var Us=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.label=="string"&&pa(e3.href)!==null).map(e3=>({label:e3.label,href:pa(e3.href)}));function Ws({logo:e2,links:t2,signIn:n2,className:r2,style:i2}){let a2=Us(t2).slice(0,5),o2=n2===false?null:{label:"Sign in",href:"/auth/login",variant:"secondary",...n2??{}};return _("header",{className:b("core-public-header",r2),style:i2,children:[e2?g(Hs,{...e2}):g("span",{}),a2.length?_("nav",{className:"core-public-header__nav","aria-label":"Main",children:[g("ul",{className:"core-public-header__links",children:a2.map(e3=>g("li",{children:g("a",{href:e3.href,children:e3.label})},e3.href))}),_("details",{className:"core-public-header__menu",children:[g("summary",{children:"Menu"}),g("ul",{children:a2.map(e3=>g("li",{children:g("a",{href:e3.href,children:e3.label})},e3.href))})]})]}):null,o2?g(Rs,{action:o2,className:"core-public-header__sign-in"}):null]})}var Gs=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.title=="string"&&Array.isArray(e3.links)).map(e3=>({title:e3.title,links:Us(e3.links)}));function Ks({logo:e2,groups:t2,legal:n2,className:r2,style:i2}){let a2=Gs(t2).slice(0,4);return _("footer",{className:b("core-public-footer",r2),style:i2,children:[_("div",{className:"core-public-footer__top",children:[e2?g(Hs,{size:"sm",...e2}):null,a2.length?g("div",{className:"core-public-footer__groups",children:a2.map(e3=>_("nav",{"aria-label":e3.title,className:"core-public-footer__group",children:[g("p",{className:"core-public-footer__title",children:e3.title}),g("ul",{children:e3.links.map(e4=>g("li",{children:g("a",{href:e4.href,children:e4.label})},e4.href))})]},e3.title))}):null]}),n2?g("p",{className:"core-public-footer__legal",children:n2}):null]})}var qs=/^\d+(\.\d+)?\s*\/\s*\d+(\.\d+)?$/;function Js({src:e2,alt:t2,decorative:n2,ratio:r2,caption:i2,priority:a2,className:o2,style:s2}){let c2=ma(e2);if(c2===null)return null;!n2&&!t2&&we(`image-alt:${e2}`,`Image: "${e2}" has no alt text; give alt or set decorative`);let l2=r2&&qs.test(r2)?{aspectRatio:r2.replace(/\s/g,"")}:void 0;return _("figure",{className:b("core-image",o2),style:s2,children:[g("div",{className:"core-image__frame","data-ratio":l2?"set":"auto",style:l2,children:g("img",{src:c2,alt:n2?"":t2??"",loading:a2?"eager":"lazy",decoding:"async"})}),i2?g("figcaption",{className:"core-image__caption",children:i2}):null]})}var Ys=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.title=="string");function Xs({title:e2,intro:t2,items:n2,columns:r2,className:i2,style:a2}){let o2=Ys(n2);if(!o2.length)return null;let s2=r2===2||r2===4?r2:3;return _("section",{className:b("core-feature-grid",i2),"data-columns":s2,style:a2,children:[e2||t2?_("div",{className:"core-feature-grid__head",children:[e2?g("h2",{className:"core-feature-grid__title",children:e2}):null,t2?g("p",{className:"core-feature-grid__intro",children:t2}):null]}):null,g("ul",{className:"core-feature-grid__items",children:o2.map((e3,t3)=>_("li",{className:"core-feature-grid__item",children:[e3.icon?g("span",{className:"core-feature-grid__icon","aria-hidden":"true",children:e3.icon}):null,g("h3",{className:"core-feature-grid__item-title",children:e3.title}),e3.text?g("p",{className:"core-feature-grid__text",children:e3.text}):null]},`${e3.title}-${t3}`))})]})}var Zs=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.name=="string"),Qs=e2=>e2.split(/\s+/).filter(Boolean).slice(0,2).map(e3=>e3[0].toUpperCase()).join("");function $s({title:e2,intro:t2,members:n2,className:r2,style:i2}){let a2=Zs(n2);return a2.length?_("section",{className:b("core-team-grid",r2),style:i2,children:[e2||t2?_("div",{className:"core-team-grid__head",children:[e2?g("h2",{className:"core-team-grid__title",children:e2}):null,t2?g("p",{className:"core-team-grid__intro",children:t2}):null]}):null,g("ul",{className:"core-team-grid__members",children:a2.map((e3,t3)=>{let n3=Bs(e3.photo);return _("li",{className:"core-team-grid__member",children:[g("div",{className:"core-team-grid__photo",children:n3?g("img",{src:n3.src,alt:n3.alt||e3.name,loading:"lazy",decoding:"async"}):g("span",{"aria-hidden":"true",children:Qs(e3.name)})}),g("p",{className:"core-team-grid__name",children:e3.name}),e3.role?g("p",{className:"core-team-grid__role",children:e3.role}):null,e3.bio?g("p",{className:"core-team-grid__bio",children:e3.bio}):null]},`${e3.name}-${t3}`)})})]}):null}function ec({quote:e2,name:t2,role:n2,photo:r2,className:i2,style:a2}){if(typeof e2!="string"||!e2)return null;let o2=Bs(r2);return _("figure",{className:b("core-testimonial",i2),style:a2,children:[g("blockquote",{className:"core-testimonial__quote",children:g("p",{children:e2})}),_("figcaption",{className:"core-testimonial__by",children:[o2?g("img",{className:"core-testimonial__photo",src:o2.src,alt:o2.alt||t2,loading:"lazy",decoding:"async"}):null,_("span",{children:[g("span",{className:"core-testimonial__name",children:t2}),n2?g("span",{className:"core-testimonial__role",children:n2}):null]})]})]})}function tc({title:e2,text:t2,actions:n2,tone:r2,className:i2,style:a2}){let o2=r2==="strong"||r2==="neutral"?r2:"accent";return _("section",{className:b("core-cta-band",i2),"data-tone":o2,style:a2,children:[_("div",{className:"core-cta-band__text",children:[g("h2",{className:"core-cta-band__title",children:e2}),t2?g("p",{className:"core-cta-band__body",children:t2}):null]}),g(zs,{actions:Ls(n2).slice(0,2)})]})}function nc({title:e2,intro:t2,askPhone:n2,consent:r2,submitLabel:i2,thanks:a2,actions:o2,className:s2,style:l2}){let u2=c(),[d2,f2]=p({name:"",email:"",phone:"",message:"",consent:false,website:""}),[m2,h2]=p(false),[v2,y2]=p(false),[x2,S2]=p(""),C2=o2?.submitRequest,w2=e3=>t3=>f2(n3=>({...n3,[e3]:t3.target.type==="checkbox"?!!t3.target.checked:t3.target.value}));return v2?g("section",{className:b("core-contact-form",s2),style:l2,children:g("p",{className:"core-contact-form__thanks",role:"status",children:a2||"Thanks. We'll be in touch within one business day."})}):_("section",{className:b("core-contact-form",s2),style:l2,children:[e2?g("h2",{className:"core-contact-form__title",children:e2}):null,t2?g("p",{className:"core-contact-form__intro",children:t2}):null,_("form",{className:"core-contact-form__form",onSubmit:async e3=>{if(e3.preventDefault(),C2&&!m2){if(!d2.consent){S2("Please tick the box to agree to be contacted.");return}h2(true),S2("");try{let e4=await C2({name:d2.name.trim(),email:d2.email.trim(),...n2&&d2.phone.trim()?{phone:d2.phone.trim()}:{},...d2.message.trim()?{message:d2.message.trim()}:{},consent:d2.consent,website:d2.website});e4.success?y2(true):S2(jt(e4))}catch{S2("Something went wrong. Try again.")}finally{h2(false)}}},children:[_("div",{className:"core-contact-form__row",children:[_("label",{className:"core-contact-form__field",children:[g("span",{children:"Name"}),g("input",{name:"name",autoComplete:"name",required:true,value:d2.name,onChange:w2("name")})]}),_("label",{className:"core-contact-form__field",children:[g("span",{children:"Email"}),g("input",{name:"email",type:"email",autoComplete:"email",required:true,value:d2.email,onChange:w2("email")})]})]}),n2?_("label",{className:"core-contact-form__field",children:[g("span",{children:"Phone (optional)"}),g("input",{name:"phone",type:"tel",autoComplete:"tel",value:d2.phone,onChange:w2("phone")})]}):null,_("label",{className:"core-contact-form__field",children:[g("span",{children:"Message (optional)"}),g("textarea",{name:"message",rows:4,value:d2.message,onChange:w2("message")})]}),_("div",{className:"core-contact-form__trap","aria-hidden":"true",children:[g("label",{htmlFor:`${u2}-website`,children:"Website"}),g("input",{id:`${u2}-website`,name:"website",tabIndex:-1,autoComplete:"off",value:d2.website,onChange:w2("website")})]}),_("label",{className:"core-contact-form__check",children:[g("input",{type:"checkbox",name:"consent",checked:d2.consent,onChange:w2("consent")}),g("span",{children:r2||"I agree to be contacted about my request."})]}),x2?g("p",{className:"core-contact-form__error",role:"alert",children:x2}):null,C2?null:g("p",{className:"core-contact-form__error",children:"This form isn't connected yet."}),g("div",{className:"core-contact-form__actions",children:g("button",{type:"submit",className:"core-contact-form__submit",disabled:m2||!C2,children:m2?"Sending…":i2||"Send"})})]})]})}function rc({length:e2=6,label:t2,value:n2,onChange:r2,onComplete:i2,error:a2,disabled:o2,autoFocus:s2,name:l2="code",className:u2,style:d2}){let f2=c(),m2=Number.isInteger(e2)&&e2>0&&e2<=12?e2:6,[h2,v2]=p(""),y2=(n2??h2).replace(/\D/g,"").slice(0,m2),x2=e3=>{let t3=e3.target.value.replace(/\D/g,"").slice(0,m2);n2===void 0&&v2(t3),r2?.(t3),t3.length===m2&&y2.length!==m2&&i2?.(t3)};return _("div",{className:b("core-code-field",u2),style:{...d2,"--core-code-field-n":m2},children:[g("label",{className:"core-code-field__label",htmlFor:f2,children:t2||"Code"}),_("div",{className:"core-code-field__boxes","data-error":a2?"yes":"no",children:[g("input",{id:f2,className:"core-code-field__input",name:l2,value:y2,onChange:x2,inputMode:"numeric",autoComplete:"one-time-code",pattern:`\\d{${m2}}`,maxLength:m2,disabled:o2,autoFocus:s2,"aria-invalid":a2?true:void 0,"aria-describedby":a2?`${f2}-error`:void 0}),g("div",{className:"core-code-field__cells","aria-hidden":"true",children:Array.from({length:m2},(e3,t3)=>g("span",{className:"core-code-field__cell","data-filled":t3<y2.length?"yes":"no","data-caret":t3===Math.min(y2.length,m2-1)?"yes":"no",children:y2[t3]??""},t3))})]}),a2?g("p",{id:`${f2}-error`,className:"core-code-field__error",role:"alert",children:a2}):null]})}export{ei as ANSWER_COLUMN_PX,Mn as Accordion,Rs as ActionLink,zs as ActionRow,ti as AnswerRows,vr as Aside,Kt as Avatar,cr as BLOCK_KINDS,ki as BLOCK_SCHEMAS,_n as Badge,us as BookEventCard,D as Box,En as Button,yo as CalendarFilters,Eo as CalendarView,Nn as Card,O as Center,rn as Checkbox,an as CheckboxGroup,Dn as Chip,qt as Code,rc as CodeField,Fn as Columns,ts as Combobox,ri as ComparisonBars,nc as ContactForm,k as Container,Si as Contents,tc as CtaBand,Ha as DAY_MINUTES,Ur as DEFAULT_DISPLAY_LOCALE,Zn as DEFAULT_PROFILE_ID,ft as DEFAULT_VIEWER,Oa as DataTable,on as DateRange,xr as Definition,We as Dialog,Ji as DisclaimerBlock,Ln as Disclosure,A as Divider,Ei as DocumentBlocks,Fr as DocumentLabel,Oi as DocumentSection,bi as DocumentShell,Hr as DocumentTable,_s as EditEventCard,T as EmbedContext,vn as EmptyState,Ma as EventCard,Fa as EventDetail,La as EventLogForm,ys as EventNoteCard,Pa as EventRespond,za as EventSchedule,Va as EventTimeline,wi as ExecutionBlock,it as Eyebrow,Xs as FeatureGrid,Nr as Figure,cn as FileField,An as FilterChips,Mr as Footnote,Qt as FormField,Rn as Grid,Cs as HandoverCard,Yt as Heading,Vs as Hero,j as Hide,Bi as HighlightBox,es as Highlighted,oo as HourGrid,On as IconButton,Js as Image,M as Inline,ca as KpiCardGrid,kn as Link,Xe as ListRow,Yo as LogCard,Hs as LogoMark,hi as Masthead,Dr as Math,Se as Menu,_i as MetaRail,So as MiniMonth,It as NOT_AVAILABLE,oi as NextSteps,As as NoteSplitCard,ci as Notes,bn as Notice,te as OVERLAY_DISMISS_EVENT,na as OptionCard,vo as OverlapNotice,G as OverlayHost,Bn as PAGINATOR_BINDINGS,Pr as PageBreak,Ze as PageFrame,ct as PageHead,Ht as PageStaffTools,se as Popover,ra as ProfileCard,xn as Progress,qi as ProposedComponent,yr as Prose,Ks as PublicFooter,Ws as PublicHeader,is as QuickNoteCard,br as Quote,ln as RadioGroup,L as Rail,Vr as Reference,zn as Repeat,$r as RowList,Ut as RuleSection,yi as RunningFooter,Za as SERIES_SHAPES,fn as SearchField,zi as SectionHeader,jn as SegmentedControl,pn as Select,to as SeriesGlyph,Ms as ShareApprovalCard,J as Sheet,R as Show,Sn as Skeleton,ui as SkippedSection,mn as Slider,Ge as Spacer,Cn as Spinner,In as Split,Ke as Stack,Es as StartProcessCard,Fi as Stat,Ii as StatGroup,Xi as StatStrip,Fs as SuggestedActions,hn as Switch,Qe as TONES,fi as TalkItThrough,Ss as TaskCard,$s as TeamGrid,ec as Testimonial,Zt as Text,gn as TextArea,dn as TextField,Ve as Toast,Ue as ToastRegion,wn as Tooltip,Wt as UnderlinedAction,gt as ViewerProvider,pi as WRITE_HEIGHT_PX,si as WRITE_LINE_HEIGHT_PX,wo as WeekStrip,mi as WriteInField,Ls as actionsOf,b as cx,Pe as dismissToast,Kr as displayLocale,Xn as documentProfiles,Dt as eventWhen,sn as fileSize,Zr as formatValue,yt as hasRole,Ft as hrefFrom,Bs as imageOf,Gt as initialsOf,nt as inkToneOf,ko as interact,Ga as isBusyOnly,vt as isStaff,qa as layoutDay,x as length,po as localWithOffset,pt as normalizeViewer,Xa as overlapDays,sr as profileCss,qn as profileIds,ar as profileTokens,Kn as registerProfile,Yr as renderFormatted,Jn as resolveProfile,Yn as resolvedProfiles,zt as sameOriginPath,eo as seriesNumber,$a as seriesShape,un as toNumber,Ne as toast,et as toneOf,bt as typeCard,$o as useCombobox,E as useEmbedded,Lt as useIntent,K as useOverlayFormat,ne as useOverlayHost,Be as useToast,_t as useViewer,S as vars,Ja as visibleRange,Wa as wallOf,Ya as weekDates};