@polyxd/mcp 0.4.0 → 0.4.1

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/NOTICE CHANGED
@@ -2,9 +2,7 @@ Polyxd
2
2
  Copyright 2026 the Polyxd authors
3
3
 
4
4
  This product includes software developed at Polyxd, licensed under the Apache
5
- License, Version 2.0 (see LICENSE), except Polyxd Studio (apps/studio), which is
6
- licensed under the Functional Source License, Version 1.1, ALv2 Future License
7
- (see apps/studio/LICENSE).
5
+ License, Version 2.0 (see LICENSE).
8
6
 
9
7
  It also includes material from the projects below. Each is used under its own
10
8
  licence, and each licence is included in full beside the material it covers.
@@ -201,6 +199,8 @@ Apache-2.0: playwright
201
199
  MIT: react, react-dom, radix-ui, ajv, ajv-formats, vite, @vitejs/plugin-react,
202
200
  marked, lenis, @types/react, @types/react-dom
203
201
  MIT OR Apache-2.0: wrangler, @cloudflare/workers-types
202
+ Apache-2.0 AND MIT: posthog-js (the analytics on polyxd.com and in Studio, only
203
+ when a PostHog key is set; the site's build copies it out of node_modules)
204
204
 
205
205
  Two need a word.
206
206
 
package/README.md CHANGED
@@ -109,7 +109,7 @@ The transport is the SDK's `createMcpHandler`, stateless: a fresh server per req
109
109
 
110
110
  ## The hosted server
111
111
 
112
- `https://mcp.polyxd.com/mcp` is `apps/mcp`, a Cloudflare Worker: `/mcp` is the handler above, `/health` answers JSON, and `/` redirects to the docs. The view is bundled into the Worker as text (about 2.4 MB in all, 385 KB gzipped). Its rate limit is Cloudflare's rate limiting binding, 600 requests a minute per IP address. That binding counts per Cloudflare location, so it guards against floods rather than enforcing an exact quota. Claude and ChatGPT call from their own servers, which is why the limit is generous. Cloudflare's invocation logs, traces and Issues are off in `wrangler.jsonc`, so the Worker's own lines are all that is kept.
112
+ `https://mcp.polyxd.com/mcp` is `apps/mcp`, a Cloudflare Worker: `/mcp` is the handler above, `/health` answers JSON, and `/` redirects to the docs. The view is bundled into the Worker as text (about 2.4 MB in all, 385 KB gzipped). Its rate limit is Cloudflare's rate limiting binding, 600 requests a minute per IP address. That binding counts per Cloudflare location, so it guards against floods rather than enforcing an exact quota. Claude and ChatGPT call from their own servers, which is why the limit is generous. Cloudflare's invocation logs, traces and Issues are off in `wrangler.jsonc`, so the Worker's own lines are all that is kept. With a `POSTHOG_KEY` secret set, the hosted Worker also counts initializes and tool calls anonymously (`apps/mcp/src/analytics.ts`): names and counts only, never a document, its data or an address. This package, and `npx @polyxd/mcp`, send nothing anywhere.
113
113
 
114
114
  ```sh
115
115
  npm run dev -w @polyxd/mcp-remote # wrangler dev on http://127.0.0.1:8787/mcp
package/dist/bin.js CHANGED
File without changes
package/dist/server.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  */
10
10
  import { McpServer } from "@modelcontextprotocol/server";
11
11
  import { PACKS } from "./packs.generated.ts";
12
- export declare const VERSION = "0.4.0";
12
+ export declare const VERSION = "0.4.1";
13
13
  /** The MCP App resource every shown screen renders in. */
14
14
  export declare const VIEW_URI = "ui://polyxd/surface.html";
15
15
  /** MCP Apps' HTML profile. */
package/dist/server.js CHANGED
@@ -13,7 +13,7 @@ import { guide, SPEC_VERSION } from "./prompt.js";
13
13
  import { PACKS } from "./packs.generated.js";
14
14
  import { componentDefinitions, componentNamed, exampleDirections, exampleDocuments } from "./spec.js";
15
15
  import { componentsOutput, guideOutput, packsOutput, showOutput, validateOutput, verifyOutput } from "./output-schemas.js";
16
- export const VERSION = "0.4.0";
16
+ export const VERSION = "0.4.1";
17
17
  /** The MCP App resource every shown screen renders in. */
18
18
  export const VIEW_URI = "ui://polyxd/surface.html";
19
19
  /** MCP Apps' HTML profile. */
package/dist/view.html CHANGED
@@ -19,15 +19,15 @@ html,body{margin:0;background:var(--pxd-color-surface-default,Canvas);color:var(
19
19
  <body>
20
20
  <main id="root" data-polyxd-mcp-view></main>
21
21
  <p id="note" role="status" aria-live="polite" hidden></p>
22
- <script>(()=>{var wt=e=>new Map(e.components.map(t=>[t.id,t])),St=e=>e.surface.kind==="shell"?void 0:e.components.find(t=>t.component==="Navigation"&&(!t.kind||t.kind==="main"));var re={pointer:""},Io=e=>e.replace(/~1/g,"/").replace(/~0/g,"~"),ld=e=>e.replace(/~/g,"~0").replace(/\//g,"~1"),fe=e=>!!e&&typeof e=="object"&&!Array.isArray(e)&&typeof e.path=="string";function O(e,t){return e.startsWith("/")?e:`${t.pointer}/${e}`}function K(e,t){return`${e}/${ld(String(t))}`}function q(e,t){if(t==="")return e;let a=e;for(let r of t.slice(1).split("/").map(Io)){if(a===null||typeof a!="object")return;a=a[r]}return a}function tt(e,t,a){let r=t.slice(1).split("/").map(Io),d=(p,i)=>{let l=r[i],n=Array.isArray(p)?[...p]:{...p??{}};return i===r.length-1?n[l]=a:n[l]=d(p?.[l]??(/^\d+$/.test(r[i+1])?[]:{}),i+1),n};return d(e,0)}var Z=e=>Array.isArray(e)?e:[];function W(e,t,a){return fe(e)?q(t,O(e.path,a)):e}function we(e,t,a){return Object.fromEntries(Object.entries(e??{}).map(([r,d])=>[r,W(d,t,a)]))}function We(e,t,a){return fe(e)?W(e,t,a):Array.isArray(e)?e.map(r=>We(r,t,a)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([r,d])=>[r,We(d,t,a)])):e}function G(e,t,a,r=Date.now()){if(e==null||e==="")return"\u2014";if(!t||t.type==="text")return Array.isArray(e)?e.join(", "):String(e);let d=typeof e=="number"?e:Number(e),p=t.precision===void 0?{}:{minimumFractionDigits:t.precision,maximumFractionDigits:t.precision};try{switch(t.type){case"number":return new Intl.NumberFormat(a,p).format(d);case"currency":return new Intl.NumberFormat(a,{style:"currency",currency:typeof t.currency=="string"?t.currency:"USD",...p}).format(d);case"percent":return new Intl.NumberFormat(a,{style:"percent",maximumFractionDigits:t.precision??1}).format(d);case"date":return new Intl.DateTimeFormat(a,{dateStyle:"medium",timeZone:"UTC"}).format(new Date(String(e)));case"time":return new Intl.DateTimeFormat(a,{timeStyle:"short",timeZone:"UTC"}).format(new Date(String(e)));case"datetime":return new Intl.DateTimeFormat(a,{dateStyle:"medium",timeStyle:"short",timeZone:"UTC"}).format(new Date(String(e)));case"relativeTime":{let i=(new Date(String(e)).getTime()-r)/1e3,l=[["year",31536e3],["month",2592e3],["day",86400],["hour",3600],["minute",60]],n=new Intl.RelativeTimeFormat(a,{numeric:"auto"});for(let[c,s]of l)if(Math.abs(i)>=s)return n.format(Math.round(i/s),c);return n.format(Math.round(i),"second")}case"duration":{let i=Math.round(d/60);return i>=60?`${Math.floor(i/60)} h ${i%60} min`:`${i} min`}case"color":return String(e).trim();case"bytes":{let i=["byte","kilobyte","megabyte","gigabyte","terabyte"],l=0,n=Math.abs(d);for(;n>=1e3&&l<i.length-1;)n/=1e3,l++;return l===0?`${new Intl.NumberFormat(a,{maximumFractionDigits:0}).format(d)} B`:new Intl.NumberFormat(a,{style:"unit",unit:i[l],unitDisplay:"short",maximumFractionDigits:t.precision??1}).format(d<0?-n:n)}}}catch{return String(e)}}function Ee(e){let t=String(e??"").trim();return/^(#[0-9a-f]{3,8}|[a-z]{3,20}|(rgb|rgba|hsl|hsla|oklch|oklab|lab|lch|hwb)\([\d.,%\s\/-]+\))$/i.test(t)?t:void 0}function at(e,t){try{return new Intl.NumberFormat(t,{style:"currency",currency:e}).formatToParts(0).find(a=>a.type==="currency")?.value??e}catch{return e}}function X(e,t,a){return!e?.currency||typeof e.currency=="string"?e:{...e,currency:W(e.currency,t,a)}}var Be=(e,t)=>new Intl.NumberFormat(t).format(e),zt=(e,t)=>new Intl.NumberFormat(t,{style:"percent",maximumFractionDigits:0}).format(e);function Se(e,t,a,r){let d=e.options;if(Array.isArray(d))return d.map(l=>({value:l.value,label:r(l.label),description:l.description!==void 0?r(l.description):void 0}));let p=O(d.path,a);return Z(q(t,p)).map((l,n)=>{let c={pointer:K(p,n)},s=u=>u?q(t,O(u,c)):void 0;return{value:s(d.valuePath),label:String(s(d.labelPath)??""),description:d.descriptionPath&&String(s(d.descriptionPath)??"")||void 0,avatar:d.avatarPath||d.imagePath?s(d.avatarPath??d.imagePath)??"":void 0,recent:d.recentPath?!!s(d.recentPath):!1}})}function Ct(e,t){let a=e.some(p=>p.avatar!==void 0),r=e.length>10||a&&e.length>6;return{control:!a&&e.length<=6&&e.every(p=>p.label.length<=24&&!p.description)?"chips":a?"people":"list",multiple:t==="multiple",searchable:r,withFaces:a}}var ge=e=>JSON.stringify(e),ot=(e,t)=>!t||`${e.label} ${e.description??""}`.toLowerCase().includes(t.toLowerCase());function rt(e,t){return{recent:t?[]:e.filter(a=>a.recent),rest:e.filter(a=>t?ot(a,t):!a.recent)}}function At(e,t){let a=Array.isArray(e)?e:[],r=ge(t);return a.some(d=>ge(d)===r)?a.filter(d=>ge(d)!==r):[...a,t]}var Mt=(e,t)=>{let a=ge(t);return Array.isArray(e)?e.some(r=>ge(r)===a):e!=null&&ge(e)===a},It=e=>e?"Search by name":"Filter options";var Et=(e,t)=>`${e}-${encodeURIComponent(JSON.stringify(t)).replace(/%/g,"_")}`;var Eo=(e,t)=>Math.max(0,Math.min(t-1,e));function Tt(e,t){let a=t.type==="back"?e.index-1:t.type==="next"?e.index+1:t.index;return{...e,index:Eo(a,e.total)}}var Rt=(e,t)=>({index:typeof e=="number"?Eo(e,t):0,total:t}),Ut=e=>e.index===e.total-1,Ht=e=>`Step ${e.index+1} of ${e.total}`,Nt={todo:{label:"Not started",tone:"neutral"},inProgress:{label:"In progress",tone:"info"},done:{label:"Completed",tone:"success"},blocked:{label:"Cannot start yet",tone:"neutral"}},Ft=e=>Nt[e??"todo"]??Nt.todo,$t=(e,t)=>e===t?null:t,Bt=(e,t)=>`${e} of ${t} tasks completed`;function jt(e,t,a){return typeof t=="string"&&t?t:a??e[0]?.key}var No=640,Pt={narrow:33.333,balanced:50,wide:66.667},Ke=20,Xe=80,Dt=e=>({compact:!1,listShown:!1,share:Pt[e??"narrow"]??Pt.narrow}),Lt=e=>Math.min(Xe,Math.max(Ke,e));function dt(e,t){switch(t.type){case"measure":return{...e,compact:t.width<No};case"back":return{...e,listShown:!0};case"selected":return{...e,listShown:!1};case"share":return{...e,share:Lt(t.value)};case"key":{let a=t.shift?10:5,r=t.key==="ArrowLeft"?e.share-a:t.key==="ArrowRight"?e.share+a:t.key==="Home"?Ke:t.key==="End"?Xe:void 0;return r===void 0?e:{...e,share:Lt(r)}}}}function Vt(e,t){let a=!e.compact||t&&!e.listShown;return{showList:!e.compact||!a,showDetail:a}}var To=(e,t,a,r,d)=>a?q(r,O(a,{pointer:d})):e&&typeof e=="object"&&"id"in e?e.id:t;function Ot(e,t,a,r){let d=W(e.selected,a,r),p=d!=null&&d!=="",i=t.get(e.primary),l=i?.component==="Table"?i.rows?.path:i?.items?.path,n=typeof l=="string"?O(l,r):void 0,c=n?Z(q(a,n)):[],s=n?c.findIndex((y,h)=>To(y,h,i?.rowValuePath,a,K(n,h))===d):-1,u=n&&s>=0?{pointer:K(n,s)}:void 0,x=i?.items?.componentId?t.get(i.items.componentId):void 0,m=s>=0?c[s]:void 0,g=u&&x?.title!==void 0?W(x.title,a,u):void 0,f=p?String(g??m?.name??m?.title??m?.label??d):void 0;return{has:p,index:s,scope:u,name:f}}var Ro={"multi-step-form":"form","filter-and-browse":"list","undo-over-confirm":"list","compare-and-choose":"compare","confirm-destructive":"dialog","review-and-submit":"detail"},_t=(e,t)=>t??(e?Ro[e]:void 0)??"detail",J=(e,t)=>({block:e,size:t}),de=(e,t)=>({group:e,parts:t}),je=(e,t)=>Array.from({length:e},(a,r)=>t(r)),qt={list:[J("field","full"),...je(5,e=>de("row",[J("square"),de("lines",[J("line",e%2?"medium":"long"),J("small","short")])]))],form:[...je(4,e=>de("lines",[J("small","short"),J("field",e===1?"medium":"long")])),de("actions",[J("button"),J("button")])],detail:[de("row",[J("circle"),de("lines",[de("row",[J("line","medium"),J("badge")]),J("small","short")])]),de("dl",je(6,e=>de("row",[J("small","short"),J("line",e%3===2?"medium":"long")])))],dashboard:[de("cards",je(3,()=>de("card",[J("small","short"),J("value","medium")]))),J("chart","full")],dialog:[J("line","long"),J("line","medium"),de("actions",[J("button"),J("button")])],compare:[de("cards",je(3,()=>de("card",[J("line","medium"),...je(5,e=>J("small",e%2?"short":"long"))])))]},Gt={row:"pxd-skeleton-row",lines:"pxd-skeleton-lines",actions:"pxd-skeleton-actions",dl:"pxd-skeleton-dl",cards:"pxd-skeleton-cards",card:"pxd-skeleton-card"},Wt=e=>e?`Preparing ${e}`:"Preparing";var Kt=720,Uo=[10,25,50,100],nd=new Set(["number","currency","percent","duration"]),it=e=>e.align==="end"||e.align!=="start"&&(e.kind==="number"||e.kind==="currency"||nd.has(e.format?.type));function Xt(e){let[t,...a]=e;return{first:t,status:a.find(r=>r.kind==="status"),details:a.filter(r=>r.kind!=="status").slice(0,3)}}var Yt=(e,t,a,r,d)=>e.rowValuePath?q(r,O(e.rowValuePath,d)):t[a]?.id??a;var pt=(e,t)=>e.includes(t)?e.filter(a=>a!==t):[...e,t],Jt=(e,t,a)=>e===t&&a==="ascending"?"descending":"ascending",Zt=(e,t,a)=>e.columns.length+(t?1:0)+(a?1:0)+(e.rowActions||e.rowAction?1:0);function Qt(e,t,a,r){let d=typeof e=="number"?e:1,p=typeof t=="number"?t:r,i=typeof a=="number"?a:r,l=Math.max(1,Math.ceil(i/(p||1)));return{index:d,size:p,total:i,pages:l,from:i===0?0:(d-1)*p+1,to:Math.min(d*p,i),sizes:[...new Set([...Uo,p])].sort((n,c)=>n-c)}}function ea(e,t,a,r,d){if(!e)return;let{name:p,context:i}=e.event;if(p==="ui.dismiss")return d.onDismiss?.();d.onAction?.({name:p,context:we(i,r,t),source:a})}function Ne(e,t,a,r){let d=O(e.value.path,a);return Object.fromEntries(Object.entries(e.action?.event?.context??{}).map(([p,i])=>[p,fe(i)&&O(i.path,a)===d?r:W(i,t,a)]))}function ta(e,t,a,r){return e.copy!==void 0?r(e.copy):String(we(e.action?.event?.context,t,a).text??"")}var aa=(e,t)=>({event:{name:e.event.name,context:{key:t,...e.event.context??{}}}});var lt={ctrl:["\u2303","Ctrl","Control","ctrlKey"],alt:["\u2325","Alt","Alt","altKey"],shift:["\u21E7","Shift","Shift","shiftKey"],enter:["\u21B5","Enter","Enter","enter"],escape:["\u238B","Esc","Escape","escape"],space:["Space","Space","Space"," "],tab:["\u21E5","Tab","Tab","tab"],backspace:["\u232B","Backspace","Backspace","backspace"],delete:["\u2326","Del","Delete","delete"],arrowup:["\u2191","\u2191","ArrowUp","arrowup"],arrowdown:["\u2193","\u2193","ArrowDown","arrowdown"],arrowleft:["\u2190","\u2190","ArrowLeft","arrowleft"],arrowright:["\u2192","\u2192","ArrowRight","arrowright"],home:["Home","Home","Home","home"],end:["End","End","End","end"],slash:["/","/","/","/"],comma:[",",",",",",","],period:[".",".",".","."]},Ho=["metaKey","ctrlKey","altKey","shiftKey"];function oa(e,t){let a=e.toLowerCase().split("+"),r=a.pop(),d=[],p=[],i=new Set;for(let n of a){let[c,s,u,x]=n==="mod"?t?["\u2318","Ctrl","Meta","metaKey"]:lt.ctrl:lt[n];d.push(t?c:s),p.push(u),i.add(x)}let l=lt[r];return d.push(l?t?l[0]:l[1]:r.toUpperCase()),p.push(l?l[2]:r.toUpperCase()),{hint:d,aria:p.join("+"),flags:i,key:l?l[3]:r}}function ra(e,t){if(!Ho.every(r=>t[r]===e.flags.has(r)))return!1;let a=/^[a-z0-9]$/.test(e.key)&&t.code.toLowerCase()===(/\d/.test(e.key)?`digit${e.key}`:`key${e.key}`);return t.key.toLowerCase()===e.key||a}var da=e=>!e.flags.has("metaKey")&&!e.flags.has("ctrlKey")&&!e.flags.has("altKey"),ia=e=>/mac|iphone|ipad|ipod/i.test(e);var pa=e=>e>=1024?"wide":e>=640?"medium":"compact";function la(e,t,a){let r=a<=5;return e==="bar"?r?"bar":"drawer":e==="drawer"?"drawer":t==="compact"?r?"bar":"drawer":e==="side"||e==="rail"?e:t==="wide"?"side":"rail"}var na=(e,t,a)=>t&&a?a:e;var cd=/^(https?:|mailto:|tel:|\/|#)/i;function Pe(e){let t=[],a="",r=0,d=()=>{a&&t.push(a),a=""};for(;r<e.length;){if(e[r]==="`"){let p=e.indexOf("`",r+1);if(p>r+1){d(),t.push({kind:"code",text:e.slice(r+1,p)}),r=p+1;continue}}if(e.startsWith("**",r)){let p=e.indexOf("**",r+2);if(p>r+2){d(),t.push({kind:"strong",children:Pe(e.slice(r+2,p))}),r=p+2;continue}}if(e[r]==="*"){let p=e.indexOf("*",r+1);if(p>r+1){d(),t.push({kind:"em",children:Pe(e.slice(r+1,p))}),r=p+1;continue}}if(e[r]==="["){let p=/^\[([^\]]+)\]\(([^)\s]+)\)/.exec(e.slice(r));if(p){d(),t.push({kind:"link",href:cd.test(p[2])?p[2]:void 0,children:Pe(p[1])}),r+=p[0].length;continue}}a+=e[r++]}return d(),t}function sa(e,t,a=!1){let r=t.replace(/[^A-Za-z0-9]/g,"").split(""),d="",p=0;for(let i of e){if(p>=r.length)break;if(i==="#"||i==="A"||i==="*"){let l=i==="#"?/\d/:i==="A"?/[A-Za-z]/:/./;for(;p<r.length&&!l.test(r[p]);)p++;if(p>=r.length)break;d+=r[p++]}else d+=i}if(a)for(;d.length&&!/[#A*]/.test(e[d.length-1]);)d=d.slice(0,-1);return d}var ca=e=>!/[A*]/.test(e);function xa(e){let t=Number(e.replace(/[^\d.-]/g,""));return e.trim()===""||Number.isNaN(t)?null:t}var ua=(e,t)=>e==null?"":t==="currency"&&typeof e=="number"?e.toFixed(2):String(e);function fa(e,t){let a=t.trim().replace(/,$/,"").trim();return a&&!e.includes(a)?[...e,a]:e}var se=(e,t,a)=>Math.min(a,Math.max(t,e)),Te=e=>se(Math.round(e),0,255).toString(16).padStart(2,"0"),xd=e=>e===void 0?1:se(e.endsWith("%")?parseFloat(e)/100:parseFloat(e),0,1),ud=e=>e.endsWith("%")?parseFloat(e)/100*255:parseFloat(e);function Fo(e,t,a){let r=(e%360+360)%360/360;if(t===0)return[a*255,a*255,a*255];let d=a<.5?a*(1+t):a+t-a*t,p=2*a-d,i=l=>(l<0&&(l+=1),l>1&&(l-=1),l<1/6?p+(d-p)*6*l:l<1/2?d:l<2/3?p+(d-p)*(2/3-l)*6:p);return[i(r+1/3)*255,i(r)*255,i(r-1/3)*255]}function $o(e,t,a){let r=e/255,d=t/255,p=a/255,i=Math.max(r,d,p),l=Math.min(r,d,p),n=(i+l)/2;if(i===l)return[0,0,n];let c=i-l,s=n>.5?c/(2-i-l):c/(i+l),u=i===r?(d-p)/c+(d<p?6:0):i===d?(p-r)/c+2:(r-d)/c+4;return u/=6,[u*360,s,n]}function ze(e){if(typeof e!="string")return null;let t=e.trim(),a=/^#([0-9a-f]{3,8})$/i.exec(t);if(a){let x=a[1];if(x.length===3||x.length===4){let[m,g,f,y]=x.split("").map(h=>parseInt(h+h,16));return{r:m,g,b:f,a:x.length===4?y/255:1}}if(x.length===6||x.length===8){let m=g=>parseInt(x.slice(g,g+2),16);return{r:m(0),g:m(2),b:m(4),a:x.length===8?m(6)/255:1}}return null}let r=/^(rgba?|hsla?)\(\s*([^)]+?)\s*\)$/i.exec(t);if(!r)return null;let d=r[2].split(/\s*[,/]\s*|\s+/).filter(Boolean);if(d.length<3||d.length>4)return null;let p=xd(d[3]);if(Number.isNaN(p))return null;if(r[1].toLowerCase().startsWith("rgb")){let[x,m,g]=d.slice(0,3).map(ud);return[x,m,g].some(Number.isNaN)?null:{r:se(x,0,255),g:se(m,0,255),b:se(g,0,255),a:p}}let i=parseFloat(d[0]),l=parseFloat(d[1])/100,n=parseFloat(d[2])/100;if([i,l,n].some(Number.isNaN))return null;let[c,s,u]=Fo(i,se(l,0,1),se(n,0,1));return{r:c,g:s,b:u,a:p}}function nt(e,t,a){let r=a?Math.round(e.a*100)/100:1,d=Math.round(e.r),p=Math.round(e.g),i=Math.round(e.b);if(t==="rgb")return r<1?`rgba(${d}, ${p}, ${i}, ${r})`:`rgb(${d}, ${p}, ${i})`;if(t==="hsl"){let[l,n,c]=$o(d,p,i),s=Math.round(l),u=Math.round(n*100),x=Math.round(c*100);return r<1?`hsla(${s}, ${u}%, ${x}%, ${r})`:`hsl(${s}, ${u}%, ${x}%)`}return`#${Te(d)}${Te(p)}${Te(i)}${r<1?Te(r*255):""}`}var ga=e=>e?`#${Te(e.r)}${Te(e.g)}${Te(e.b)}`:"#000000",ma=(e,t,a)=>!!(e&&t&&Math.round(e.r)===Math.round(t.r)&&Math.round(e.g)===Math.round(t.g)&&Math.round(e.b)===Math.round(t.b)&&(!a||Math.abs(e.a-t.a)<.005)),ya=e=>e==="hex"?"#000000":e==="rgb"?"rgb(0, 0, 0)":"hsl(0, 0%, 0%)";var Bo=["byte","kilobyte","megabyte","gigabyte"];function Le(e,t){let a=0,r=e;for(;r>=1024&&a<Bo.length-1;)r/=1024,a++;try{return new Intl.NumberFormat(t,{style:"unit",unit:Bo[a],unitDisplay:"short",maximumFractionDigits:r<10?1:0}).format(r)}catch{return`${Math.round(r*10)/10} ${["B","KB","MB","GB"][a]}`}}function ba(e){let t=e.trim().toLowerCase();if(t.startsWith("."))return t.slice(1).toUpperCase();let a={"image/*":"images","video/*":"videos","audio/*":"audio","text/*":"text files"};if(a[t])return a[t];if(t==="application/pdf")return"PDF";let r=t.split("/")[1];return r?r.replace(/^(x-|vnd\.)/,"").toUpperCase():e}function ha(e){return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`}function jo(e,t){if(t.length===0)return!0;let a=e.name.toLowerCase(),r=e.type.toLowerCase();return t.some(d=>{let p=d.trim().toLowerCase();return p.startsWith(".")?a.endsWith(p):p.endsWith("/*")?r.startsWith(p.slice(0,-1)):r===p})}function va(e,t,a,r){let d=e.length?ha(e.map(ba)):"";return[d&&`Accepts ${d}.`,t&&`Up to ${Le(t,r)}${a?" each":""}.`].filter(Boolean).join(" ")}function ka(e,t,a,r){if(a&&e.size>a)return`${e.name} is ${Le(e.size,r)}; the limit is ${Le(a,r)}.`;let d=t.length?ha(t.map(ba)):"";if(!jo(e,t))return`${e.name} isn't an accepted type${d?` (${d})`:""}.`}function wa(e,t,a,r){if(typeof e!="number")return;let d=t??"increase",p=e>0?"up":e<0?"down":"unchanged",i=d==="none"||e===0?"neutral":e>0==(d==="increase")?"positive":"negative",l=G(Math.abs(e),a,r);return{text:`${e>0?"\u25B2":e<0?"\u25BC":"\u25A0"} ${l}`,spoken:p==="unchanged"?"unchanged":`${p} ${l}`,tone:i}}function Po(e,t){return e>=1?{tone:"danger",hint:"full"}:t?.danger!==void 0&&e>=t.danger?{tone:"danger",hint:"nearly full"}:t?.warning!==void 0&&e>=t.warning?{tone:"warning",hint:"getting full"}:{}}function Sa(e,t,a,r,d,p){let i=typeof t=="number"?t:Number(t),l=a!==void 0?Number(a):void 0,n=l!==void 0&&Number.isFinite(l)&&l>0?l:void 0,c=Number.isFinite(i)?Math.max(0,Math.min(1,n!==void 0?i/n:i)):0,s=e.format?G(t,e.format,p):G(c,{type:"percent",precision:0},p),u=e.kind==="meter",x=u?Po(c,e.thresholds):{},m=e.tone??x.tone,g=u?x.hint:void 0,f=[s,d,g].filter(Boolean).join(", "),y=Math.round(c*100),h=r?{"aria-busy":!0}:n!==void 0?{"aria-valuemin":0,"aria-valuemax":n,"aria-valuenow":Number.isFinite(i)?i:0,"aria-valuetext":f}:{"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":y,"aria-valuetext":f};return{fraction:c,percent:y,valueProps:h,readout:s,tone:m,hint:g,valuetext:f,indeterminate:r}}var za=e=>`${e} ${e===1?"star":"stars"}`,Ca=(e,t)=>e!==void 0?`${e} out of ${t}`:"not yet rated",Aa=e=>e.replace(/[^\s]/g,"\u2022"),st={small:24,default:40,large:64};function Ma(e,t){let a=p=>p.split(/\s+/)[0]||p,r=e.slice(0,t),d=e.slice(t);return d.length?`${r.map(p=>a(p.name)).join(", ")} and ${d.length} more`:r.map(p=>a(p.name)).join(", ")}var Lo=["primary","secondary","tertiary","success","warning"];function Ea(e){return Lo[[...e].reduce((t,a)=>t*31+a.charCodeAt(0)>>>0,7)%Lo.length]}function Na(e,t){return(e&&e.length<=3?e:t.split(/\s+/).map(a=>a[0]).join("").slice(0,2)).toUpperCase()}var Ta=e=>e.length>3,Ia={search:"M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14zM21 21l-4.3-4.3",check:"M20 6 9 17l-5-5",info:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 16v-4M12 8h.01",lock:"M5 11h14v10H5zM8 11V7a4 4 0 0 1 8 0v4",trash:"M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6",clock:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 7v5l3 2",tag:"M20.6 13.4 13.4 20.6a2 2 0 0 1-2.8 0L3 13V3h10l7.6 7.6a2 2 0 0 1 0 2.8z",alert:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h16.9a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0zM12 9v4M12 17h.01",mail:"M3 5h18v14H3zM3 7l9 6 9-6",shield:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",book:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z",inbox:"M22 12h-6l-2 3h-4l-2-3H2M5.5 5h13L22 12v7H2v-7z",filter:"M3 5h18l-7 8v6l-4 2v-8z",close:"M18 6 6 18M6 6l12 12",dash:"M6 12h12",menu:"M4 6h16M4 12h16M4 18h16",home:"M4 11 12 4l8 7M6 10v10h12V10",settings:"M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6zM19.4 15a1.7 1.7 0 0 0 .3 1.8 2 2 0 1 1-2.8 2.8 1.7 1.7 0 0 0-2.9 1.2 2 2 0 1 1-4 0 1.7 1.7 0 0 0-2.9-1.2 2 2 0 1 1-2.8-2.8A1.7 1.7 0 0 0 2.1 14a2 2 0 1 1 0-4 1.7 1.7 0 0 0 1.2-2.9 2 2 0 1 1 2.8-2.8A1.7 1.7 0 0 0 9 3.1a2 2 0 1 1 4 0 1.7 1.7 0 0 0 2.9 1.2 2 2 0 1 1 2.8 2.8A1.7 1.7 0 0 0 21 10a2 2 0 1 1 0 4 1.7 1.7 0 0 0-1.6 1z",chart:"M4 20V10M10 20V4M16 20v-7M22 20H2",people:"M9 4.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7zM2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 7M18 14a6.5 6.5 0 0 1 3.5 6",card:"M2 6h20v13H2zM2 10h20",file:"M6 3h8l4 4v14H6zM14 3v4h4",dots:"M12 5h.01M12 12h.01M12 19h.01",sort:"M8 9l4-4 4 4M8 15l4 4 4-4",sortUp:"M12 19V5M6 11l6-6 6 6",sortDown:"M12 5v14M6 13l6 6 6-6",chevronLeft:"M15 5l-7 7 7 7",chevronRight:"M9 5l7 7-7 7",chevronDown:"m6 9 6 6 6-6",orders:"M6 3h12v18l-3-2-3 2-3-2-3 2zM9 8h6M9 12h6",products:"M12 3 3 7.5v9L12 21l9-4.5v-9zM3 7.5l9 4.5 9-4.5M12 12v9",customers:"M12 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM4 21a8 8 0 0 1 16 0",discounts:"M19 5 5 19M7.5 6a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM16.5 15a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z",analytics:"M3 17l5-6 4 3 5-7 4 4M3 21h18",calendar:"M4 6h16v14H4zM4 10h16M8 3v4M16 3v4",bell:"M6 16V11a6 6 0 0 1 12 0v5l2 2H4zM10 21h4",help:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.7.3-1 .9-1 1.7M12 17h.01",folder:"M3 6h6l2 2h10v11H3z",star:"m12 3 2.8 5.7 6.2.9-4.5 4.4 1.1 6.2L12 17.3 6.4 20.2l1.1-6.2L3 9.6l6.2-.9z",grid:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z",layers:"m12 3 9 5-9 5-9-5zM3 13l9 5 9-5M3 17l9 5 9-5"},Ra=e=>Ia[e]??Ia.info,Ua={info:"info",success:"check",warning:"alert",error:"alert",empty:"inbox",undo:"check"},ct="M12 2.5l2.9 6.2 6.8.8-5 4.7 1.3 6.8L12 17.6 6 21l1.3-6.8-5-4.7 6.8-.8z";var Ha=(e,t)=>e&&typeof e=="object"&&"id"in e?e.id:t;function Fa(e,t){let a=e.layout??"auto";return{grid:a==="grid"||a==="auto"&&t?.component==="Card"&&!!t.media,timeline:a==="timeline",carousel:a==="carousel",calendar:a==="calendar"}}function $a(e,t){let a=e.map((d,p)=>p);if(!Array.isArray(t))return a;let r=d=>{let p=t.indexOf(e[d]);return p<0?t.length+d:p};return a.sort((d,p)=>r(d)-r(p))}function Ba(e,t,a,r){if(r<0||r>=e.length||a===r)return;let d=[...e];return d.splice(r,0,...d.splice(a,1)),d.map(p=>t[p])}function ja(e){if(e==null||e==="")return;let t=new Date(String(e));return Number.isNaN(t.getTime())?void 0:{y:t.getUTCFullYear(),m:t.getUTCMonth(),d:t.getUTCDate()}}var Pa=(e,t,a=new Date)=>e??(t?{y:t.y,m:t.m}:{y:a.getUTCFullYear(),m:a.getUTCMonth()});function xt(e,t){let a=new Date(Date.UTC(e.y,e.m+t,1));return{y:a.getUTCFullYear(),m:a.getUTCMonth()}}function La(e,t){let a=new Intl.DateTimeFormat(t,{month:"long",year:"numeric",timeZone:"UTC"}).format(new Date(Date.UTC(e.y,e.m,1))),r=Array.from({length:7},(n,c)=>new Intl.DateTimeFormat(t,{weekday:"short",timeZone:"UTC"}).format(new Date(Date.UTC(2024,0,1+c)))),d=(new Date(Date.UTC(e.y,e.m,1)).getUTCDay()+6)%7,p=new Date(Date.UTC(e.y,e.m+1,0)).getUTCDate(),i=[...Array(d).fill(null),...Array.from({length:p},(n,c)=>c+1)];for(;i.length%7;)i.push(null);let l=Array.from({length:i.length/7},(n,c)=>i.slice(c*7,c*7+7));return{...e,monthName:a,weekdays:r,weeks:l}}function Da(e,t){let a=0;return e.forEach((r,d)=>{Math.abs(r-t)<Math.abs(e[a]-t)&&(a=d)}),a}function Va(e,t,a){let r=new Map;for(let d of e){if(!d.better||d.better==="none")continue;let p=Array.from({length:t},(l,n)=>Number(a(d.path,n))),i=d.better==="higher"?Math.max(...p):Math.min(...p);p.filter(l=>l===i).length===1&&r.set(d.key,p.indexOf(i))}return r}function Oa(e,t){let a=[];for(let r of e){let d=r.group!==void 0?t(r.group):void 0,p=a.find(i=>i.label===d);p?p.attributes.push(r):a.push({label:d,attributes:[r]})}return a}function _a(e,t){let a=e.map((d,p)=>p),r=a.findIndex(d=>e[d]===t);return r>0&&a.unshift(...a.splice(r,1)),a}function qa(e,t){let a=[];for(let r of e){let d=r.group!==void 0?t(r.group):void 0,p=a.find(i=>i.label===d);p?p.items.push(r):a.push({label:d,items:[r]})}return a}var Ga=e=>e==="breadcrumb"?"Breadcrumb":e==="toc"?"On this page":"Main";var Q={top:16,right:16,bottom:32,left:56},De=["circle","square","diamond","triangle","circle","square"],ee=e=>`var(--pxd-color-data-categorical-${e%6+1})`;function Ve(e){if(e<=0)return 1;let t=10**Math.floor(Math.log10(e));return Math.ceil(e/t)*t}function ut(e,t,a){if(t==="date"||t==="datetime"){let r=new Date(String(e));if(!Number.isNaN(r.getTime())){let d=r.getUTCDate()===1?{month:"short",timeZone:"UTC"}:{month:"short",day:"numeric",timeZone:"UTC"};return new Intl.DateTimeFormat(a,d).format(r)}}return String(e??"").slice(0,12)}function Wa(e,t,a){let r=e.reduce((x,m)=>x+m,0),d=e.map(()=>null);if(r<=0)return d;let p=e.map((x,m)=>m).filter(x=>e[x]>0).sort((x,m)=>e[m]-e[x]),i=x=>e[x]/r*t*a,l=0,n=0,c=t,s=a,u=0;for(;u<p.length&&c>0&&s>0;){let x=c>=s,m=x?s:c,g=[],f=0,y=1/0;for(;u<p.length;){let I=[...g,p[u]],S=f+i(p[u]),N=S/m,M=Math.max(...I.map(F=>{let j=i(F)/N;return Math.max(j/N,N/j)}));if(M>y&&g.length)break;g=I,f=S,y=M,u++}let h=f/m,k=0;for(let I of g){let S=i(I)/h;d[I]=x?{x:l,y:n+k,w:h,h:S}:{x:l+k,y:n,w:S,h},k+=S}x?(l+=h,c-=h):(n+=h,s-=h)}return d}function Ka(e,t){let a=Ve(Math.max(0,...e)),r=t?Math.min(0,...e):0,d=t&&e.length?Math.max(r,Math.min(...e)-(Math.max(...e)-Math.min(...e))*.2):r,p=t?Math.floor(d):0;return{lo:p,max:a,ticks:[0,.5,1].map(i=>p+(a-p)*i)}}function Xa(e,t,a){return e==="square"?{tag:"rect",attrs:{x:t-4,y:a-4,width:8,height:8}}:e==="diamond"?{tag:"path",attrs:{d:`M${t} ${a-5}L${t+5} ${a}L${t} ${a+5}L${t-5} ${a}Z`}}:e==="triangle"?{tag:"path",attrs:{d:`M${t} ${a-5}L${t+5} ${a+4}L${t-5} ${a+4}Z`}}:{tag:"circle",attrs:{cx:t,cy:a,r:4}}}function Ya(e,t,a){let r=e.map(x=>x.reduce((m,g)=>m+g,0)),d=Array.from({length:t},(x,m)=>e.reduce((g,f)=>g+f[m],0)),p=r.reduce((x,m)=>x+m,0)||1,i=6,n=(a-i*(Math.max(e.length,t)-1))/p,c=[],s=[],u=0;return r.forEach(x=>(c.push(u),u+=x*n+i)),u=0,d.forEach(x=>(s.push(u),u+=x*n+i)),{leftY:c,rightY:s,leftTotals:r,rightTotals:d,scale:n}}var ft=200,Ja=10,Za=500,fd=e=>e==null?"":String(e);function Qa(e,t,a,r){let d=[],p=new Map,i=[],l=(s,u)=>r?r.has(s):u===1,n=(s,u,x,m)=>{s.forEach((g,f)=>{let y={pointer:K(u,f)},h=fd(q(t,O(e.labelPath,y))),k=e.valuePath?q(t,O(e.valuePath,y)):h,I=k??(h||y.pointer),S=e.detailPath?q(t,O(e.detailPath,y)):void 0,N=S==null||S===""?void 0:String(S),M=Z(q(t,O(e.childrenPath,y)));x===1&&i.push(I);let F=M.length>0,j=F&&l(I,x),T=d.length;p.set(y.pointer,T),d.push({key:y.pointer,scope:y,level:x,setsize:s.length,posinset:f+1,label:h,value:I,detail:N,hasChildren:F,expanded:j,parent:m}),j&&n(M,O(e.childrenPath,y),x+1,T)})},c=O(e.items.path,a);return n(Z(q(t,c)),c,1,-1),{rows:d,indexByKey:p,topValues:i}}function eo(e,t,a){let r=i=>{for(let l=1;l<=e.length;l++){let n=(t+l)%e.length;if(e[n].label.toLowerCase().startsWith(i))return n}return-1},d=a.length>1&&[...a].every(i=>i===a[0]),p=r(d?a[0]:a);return p<0&&a.length>1&&(p=r(a[0])),p}function to(e,t,a){let r=e[t];if(r)switch(a.key){case"ArrowDown":return{focus:Math.min(e.length-1,t+1)};case"ArrowUp":return{focus:Math.max(0,t-1)};case"ArrowRight":return r.hasChildren&&!r.expanded?{toggle:!0}:r.expanded?{focus:Math.min(e.length-1,t+1)}:void 0;case"ArrowLeft":return r.expanded?{toggle:!0}:r.parent>=0?{focus:r.parent}:void 0;case"Home":return{focus:0};case"End":return{focus:e.length-1};case"Enter":return{activate:!0};case" ":return{select:!0};case"*":return{expandSiblings:!0};default:return a.key.length===1&&!a.ctrlKey&&!a.metaKey&&!a.altKey?{typeAhead:a.key}:void 0}}function ao(e,t,a,r){return e<=ft?{start:0,end:e}:{start:Math.max(0,Math.floor(t/a)-Ja),end:Math.min(e,Math.ceil((t+r)/a)+Ja)}}function oo(e,t,a,r,d){let p=[];for(let i of e){if(!fe(i.value))continue;let l=i.value,n=W(i.value,t,a),c=d(i.label),s=u=>G(u,X(i.format??{type:"number"},t,a),r);switch(i.component){case"Choice":{let u=Se(i,t,a,d),x=m=>u.find(g=>g.value===m)?.label??String(m);if(Array.isArray(n))for(let m of n)p.push({key:`${i.id}:${m}`,label:x(m),binding:l,cleared:n.filter(g=>g!==m)});else n!=null&&n!==""&&p.push({key:i.id,label:x(n),binding:l,cleared:null});break}case"RangeInput":{if(i.mode==="range"&&Array.isArray(n)){let[u,x]=n.map(Number);(u>i.min||x<i.max)&&p.push({key:i.id,label:`${c}: ${s(u)} \u2013 ${s(x)}`,binding:l,cleared:[i.min,i.max]})}else typeof n=="number"&&n<i.max&&p.push({key:i.id,label:`${c}: ${s(n)}`,binding:l,cleared:i.max});break}case"Toggle":n===!0&&p.push({key:i.id,label:c,binding:l,cleared:!1});break;case"TextInput":typeof n=="string"&&n.trim()&&p.push({key:i.id,label:`${c}: ${n}`,binding:l,cleared:""});break;case"DateInput":n&&p.push({key:i.id,label:`${c}: ${String(n)}`,binding:l,cleared:null});break}}return p}var ro=640,io=(e,t)=>e===void 0?void 0:`${G(e,{type:"number"},t)} ${e===1?"result":"results"}`;var Do=[[10,[[1,16]]],[16,[[1,28]]],[26,[[1,44]]],[18,[[2,32]]],[24,[[2,43]]],[16,[[4,27]]],[18,[[4,31]]],[22,[[2,38],[2,39]]],[22,[[3,36],[2,37]]],[26,[[4,43],[1,44]]]],gd=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50]];function po(e,t){let a=0;for(let r=7;r>=0;r--)a=a<<1^(a>>>7)*285,a^=(t>>>r&1)*e;return a&255}function md(e,t){let a=new Array(t).fill(0);a[t-1]=1;let r=1;for(let p=0;p<t;p++){for(let i=0;i<t;i++)a[i]=po(a[i],r),i+1<t&&(a[i]^=a[i+1]);r=po(r,2)}let d=new Array(t).fill(0);for(let p of e){let i=p^d.shift();d.push(0),a.forEach((l,n)=>d[n]^=po(l,i))}return d}var yd=[(e,t)=>(e+t)%2===0,(e,t)=>t%2===0,e=>e%3===0,(e,t)=>(e+t)%3===0,(e,t)=>(Math.floor(e/3)+Math.floor(t/2))%2===0,(e,t)=>e*t%2+e*t%3===0,(e,t)=>(e*t%2+e*t%3)%2===0,(e,t)=>((e+t)%2+e*t%3)%2===0];function lo(e){let t=Array.from(new TextEncoder().encode(e)),a=0,r=0;for(let v=1;v<=10&&!a;v++){let b=Do[v-1][1].reduce((z,[C,E])=>z+C*E,0);4+(v<10?8:16)+t.length*8<=b*8&&(a=v,r=b)}if(!a)return;let[d,p]=Do[a-1],i=[],l=(v,b)=>{for(let z=b-1;z>=0;z--)i.push(v>>>z&1)};l(4,4),l(t.length,a<10?8:16);for(let v of t)l(v,8);let n=r*8;for(l(0,Math.min(4,n-i.length));i.length%8;)i.push(0);for(let v=236;i.length<n;v^=253)l(v,8);let c=[];for(let v=0;v<i.length;v+=8)c.push(i.slice(v,v+8).reduce((b,z)=>b<<1|z,0));let s=[],u=0;for(let[v,b]of p)for(let z=0;z<v;z++){let C=c.slice(u,u+b);s.push({d:C,e:md(C,d)}),u+=b}let x=[],m=Math.max(...s.map(v=>v.d.length));for(let v=0;v<m;v++)for(let b of s)v<b.d.length&&x.push(b.d[v]);for(let v=0;v<d;v++)for(let b of s)x.push(b.e[v]);let g=a*4+17,f=Array.from({length:g},()=>new Array(g).fill(!1)),y=Array.from({length:g},()=>new Array(g).fill(!1)),h=(v,b,z)=>{v>=0&&b>=0&&v<g&&b<g&&(f[b][v]=z,y[b][v]=!0)};for(let v=0;v<g;v++)h(6,v,v%2===0),h(v,6,v%2===0);let k=(v,b)=>{for(let z=-4;z<=4;z++)for(let C=-4;C<=4;C++){let E=Math.max(Math.abs(C),Math.abs(z));h(v+C,b+z,E!==2&&E!==4)}};k(3,3),k(g-4,3),k(3,g-4);let I=gd[a-1],S=I.length-1;I.forEach((v,b)=>I.forEach((z,C)=>{if(!(b===0&&C===0||b===0&&C===S||b===S&&C===0))for(let E=-2;E<=2;E++)for(let A=-2;A<=2;A++)h(v+A,z+E,Math.max(Math.abs(A),Math.abs(E))!==1)}));let N=v=>{let b=v,z=b;for(let A=0;A<10;A++)z=z<<1^(z>>>9)*1335;let C=(b<<10|z)^21522,E=A=>(C>>>A&1)===1;for(let A=0;A<=5;A++)h(8,A,E(A));h(8,7,E(6)),h(8,8,E(7)),h(7,8,E(8));for(let A=9;A<15;A++)h(14-A,8,E(A));for(let A=0;A<8;A++)h(g-1-A,8,E(A));for(let A=8;A<15;A++)h(8,g-15+A,E(A));h(8,g-8,!0)};if(N(0),a>=7){let v=a;for(let z=0;z<12;z++)v=v<<1^(v>>>11)*7973;let b=a<<12|v;for(let z=0;z<18;z++){let C=(b>>>z&1)===1,E=g-11+z%3,A=Math.floor(z/3);h(E,A,C),h(A,E,C)}}let M=0;for(let v=g-1;v>=1;v-=2){v===6&&(v=5);for(let b=0;b<g;b++)for(let z=0;z<2;z++){let C=v-z,E=(v+1&2)===0?g-1-b:b;!y[E][C]&&M<x.length*8&&(f[E][C]=(x[M>>>3]>>>7-(M&7)&1)===1,M++)}}let F=v=>{for(let b=0;b<g;b++)for(let z=0;z<g;z++)!y[b][z]&&yd[v](z,b)&&(f[b][z]=!f[b][z])},j=()=>{let v=0,b=E=>{let A=0,B=null;E.forEach((H,L)=>{if(H===B?(A++,A===5?v+=3:A>5&&(v+=1)):(B=H,A=1),L+7<=E.length){let V=E.slice(L,L+7),U=V[0]&&!V[1]&&V[2]&&V[3]&&V[4]&&!V[5]&&V[6],D=L>=4&&E.slice(L-4,L).every(R=>!R),$=L+11<=E.length&&E.slice(L+7,L+11).every(R=>!R);U&&(D||$)&&(v+=40)}})};for(let E=0;E<g;E++)b(f[E]),b(f.map(A=>A[E]));for(let E=0;E<g-1;E++)for(let A=0;A<g-1;A++)f[E][A]===f[E][A+1]&&f[E][A]===f[E+1][A]&&f[E][A]===f[E+1][A+1]&&(v+=3);let z=f.flat().filter(Boolean).length,C=g*g;return v+=(Math.ceil(Math.abs(z*20-C*10)/C)-1)*10,v},T=0,w=1/0;for(let v=0;v<8;v++){N(v),F(v);let b=j();F(v),b<w&&(w=b,T=v)}return N(T),F(T),f}var no="More actions";function so(e,t){for(let a=e.length-1;a>0;a--)if(t.get(e[a])?.component!=="Action")return a+1;return 1}function co(e,t,a,r,d,p){if(e.length<=2)return e.length;let i=0,l=0;for(;l<e.length&&i+(l?a:0)+t(e[l])<=r;)i+=(l?a:0)+t(e[l++]);if(l<e.length){for(;l>p&&i+a+d>r;)i-=a+t(e[--l]);l=Math.max(l,p)}return l}function Ye(e){let t=e.filter(r=>r.tone!=="danger"),a=e.filter(r=>r.tone==="danger");return{usual:t,danger:a,divider:a.length>0&&t.length>0}}function xo(e,t={}){let a=t.data??e.data??{},r=new Set,d=t.locale??"en-GB",p=()=>r.forEach(l=>l(a)),i={document:e,byId:wt(e),get data(){return a},locale:d,setValue(l,n){let c=tt(a,l,n);a=t.derive?.(c)??c,t.onDataChange?.(a),p()},replaceData(l){a=l,p()},dispatch:(l,n,c)=>ea(l,n,c,a,t),subscribe(l){return r.add(l),()=>r.delete(l)},resolve:(l,n=re)=>W(l,a,n),text(l,n,c=re){let s=W(l,a,c);return n?G(s,X(n,a,c),d):s==null?"":String(s)},pointer:(l,n=re)=>O(l.path,n),write:(l,n,c=re)=>i.setValue(O(l.path,c),n),context:(l,n=re)=>we(l,a,n),visible:(l,n=re)=>l.visible===void 0||W(l.visible,a,n)!==!1};return i}function uo(e,t){let a={"data-pxd-id":e.id,"data-pxd-component":e.component},r=e.accessibility;return r?{...a,"aria-label":r.label!==void 0?t(r.label):void 0,"aria-description":r.description!==void 0?t(r.description):void 0,"aria-live":r.live,"aria-hidden":r.hidden||void 0}:a}var bd="http://www.w3.org/2000/svg",Go=new Set(["svg","path","circle","rect","line","polyline","polygon","g","text"]),hd=new Set(["value","checked","selected","indeterminate","textContent"]),vd=new Set(["list","form","type","autocomplete","for","role","tabindex","lang","dir","translate","spellcheck","autocapitalize","autocorrect","inputmode","enterkeyhint","colspan","rowspan","scope","title","width","height","size","min","max","step","pattern","placeholder","maxlength","minlength","accept","alt","src","href","rel","poster","controls","name","contenteditable","draggable","autofocus"]);function o(e,t,...a){let r=t??{};return{tag:e,props:r,children:a,key:r.key}}var Oe=(e,t)=>({dom:e,key:t}),Re=e=>!!e&&typeof e=="object"&&"dom"in e;function gt(e,t=[]){for(let a of e)a==null||a===!1||(Array.isArray(a)?gt(a,t):typeof a=="number"?t.push(String(a)):t.push(a));return t}function kd(e,t,a){if(typeof t=="string"){e.style.cssText=t;return}let r=t??{},d=typeof a=="object"&&a||{};for(let p of Object.keys(d))p in r||(p.startsWith("--")?e.style.removeProperty(p):e.style[p]="");for(let[p,i]of Object.entries(r))i==null?p.startsWith("--")?e.style.removeProperty(p):e.style[p]="":p.startsWith("--")?e.style.setProperty(p,String(i)):e.style[p]=typeof i=="number"&&!/^(opacity|zIndex|flex|lineHeight|fontWeight|order)$/.test(p)?`${i}px`:String(i)}function fo(e,t,a,r,d){if(t==="key"||t==="children")return;if(t==="ref"){e.__ref=a;return}if(t.startsWith("on")&&(typeof a=="function"||a===void 0)){let i=t.slice(2).toLowerCase(),l=e.__on??={};a&&!l[i]&&e.addEventListener(i,n=>e.__on?.[i]?.(n)),a?l[i]=a:delete l[i];return}if(t==="style")return kd(e,a,r);if(t==="class"||t==="className"){let i=a==null||a===!1?"":String(a);d?i?e.setAttribute("class",i):e.removeAttribute("class"):e.className!==i&&(e.className=i);return}let p=t.toLowerCase();if(!d&&hd.has(t)){let i=a??(typeof e[t]=="boolean"?!1:"");e[t]!==i&&(e[t]=i);return}if(!d&&!t.includes("-")&&!vd.has(p)&&t in e&&typeof e[t]!="function"&&typeof e[t]=="boolean"){e[t]=!!a;return}a==null||a===!1&&!t.startsWith("aria-")?e.removeAttribute(p==="classname"?"class":t):e.setAttribute(t,a===!0?t.startsWith("aria-")||t==="draggable"||t==="contenteditable"?"true":"":String(a))}function Wo(e,t){if(typeof e=="string"){let d=document.createTextNode(e);return d.__vnode=e,d}if(Re(e))return e.dom.__vnode=e,e.dom;let a=t||Go.has(e.tag),r=a?document.createElementNS(bd,e.tag):document.createElement(e.tag);for(let[d,p]of Object.entries(e.props))fo(r,d,p,void 0,a);for(let d of gt(e.children))r.appendChild(Wo(d,a));return r.__vnode=e,r}function Ko(e){let t=e;if(t.nodeType===1){t.__ref?.(t);for(let a of Array.from(t.childNodes))(!a.__vnode||!Re(a.__vnode))&&Ko(a)}}function go(e){let t=e;if(t.nodeType===1&&!Re(t.__vnode)){t.__ref?.(null);for(let a of Array.from(t.childNodes))go(a)}}var Je=e=>e&&typeof e=="object"?e.key:void 0,qo=(e,t)=>e!==void 0&&typeof e==typeof t&&(typeof e=="string"||(Re(e)?Re(t)&&e.dom===t.dom:!Re(t)&&e.tag===t.tag&&Je(e)===Je(t)));function wd(e,t,a){let r=e,d=r.__vnode;if(typeof t=="string"){e.textContent!==t&&(e.textContent=t),r.__vnode=t;return}if(Re(t))return;let p=d?.props??{},i=a||Go.has(t.tag);for(let l of Object.keys(p))l in t.props||fo(r,l,void 0,p[l],i);for(let[l,n]of Object.entries(t.props))(l==="style"||l==="ref"||p[l]!==n)&&fo(r,l,n,p[l],i);r.__vnode=t,Xo(r,gt(t.children),i)}function Xo(e,t,a){let r=Array.from(e.childNodes),d=new Map;for(let l of r){let n=Je(l.__vnode);n!==void 0&&d.set(n,l)}let p=new Set,i=r[0]??null;for(let l of t){let n=Je(l),c;if(n!==void 0?c=d.get(n):i&&!p.has(i)&&Je(i.__vnode)===void 0&&qo(i.__vnode,l)&&(c=i),c&&qo(c.__vnode,l))p.add(c),c!==i?e.insertBefore(c,i):i=i.nextSibling??null,wd(c,l,a);else{let s=Wo(l,a);e.insertBefore(s,i),Ko(s)}}for(let l of r)p.has(l)||(go(l),l.remove())}function mo(e,t){Xo(e,gt(t),!1)}function yo(e){for(let t of Array.from(e.childNodes))go(t),t.remove()}var Jo=e=>e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function xe(e,...t){let{checked:a,onCheckedChange:r,indicator:d,...p}=e,i=a==="indeterminate"?"indeterminate":a?"checked":"unchecked";return o("button",{type:"button",role:"checkbox","aria-checked":a==="indeterminate"?"mixed":a,"data-state":i,value:"on",...p,onClick:()=>r(a==="indeterminate"?!0:!a)},i!=="unchecked"?d:null,...t)}function Ce(e,...t){let{value:a,onValueChange:r,orientation:d,...p}=e;return o("div",{role:"radiogroup","aria-orientation":d,dir:"ltr",tabindex:"0",style:{outline:"none"},...p,"data-value":a,onKeydown:n=>{let c=n.currentTarget,s=Array.from(c.querySelectorAll('[role="radio"]:not(:disabled)')),u=s.indexOf(document.activeElement);if(u<0||!s.length)return;let x=n.key==="ArrowDown"||n.key==="ArrowRight",m=n.key==="ArrowUp"||n.key==="ArrowLeft";if(!x&&!m)return;n.preventDefault();let g=s[(u+(x?1:s.length-1))%s.length];g.focus(),g.click()},onFocus:n=>{let c=n.currentTarget;if(n.target!==c)return;let s=Array.from(c.querySelectorAll('[role="radio"]:not(:disabled)'));(s.find(u=>u.getAttribute("aria-checked")==="true")??s[0])?.focus()},onFocusin:n=>n.currentTarget.tabIndex=-1,onFocusout:n=>{let c=n.currentTarget;c.contains(n.relatedTarget)||(c.tabIndex=0)}},...t)}function Ue(e,...t){let{value:a,group:r,first:d,onSelect:p,indicator:i,...l}=e,n=r===a;return o("button",{type:"button",role:"radio","aria-checked":n,"data-state":n?"checked":"unchecked",value:a,tabindex:n||r===""&&d?"0":"-1",...l,onClick:()=>!n&&p()},n?i:null,...t)}function Zo(e){let{checked:t,onCheckedChange:a,...r}=e,d=t?"checked":"unchecked";return o("button",{type:"button",role:"switch","aria-checked":t,"data-state":d,value:"on",...r,onClick:()=>a(!t)},o("span",{"data-state":d,class:"pxd-switch-thumb"}))}var Yo=20;function bo(e){let{min:t,max:a,step:r}=e,d=a-t||1,p=f=>(f-t)/d*100,i=f=>Math.min(a,Math.max(t,f)),l=f=>i(t+Math.round((f-t)/r)*r),n=(f,y)=>{let h=[...e.values];h[f]=l(y);let k=(e.minStepsBetweenThumbs??0)*r;h.length===2&&(f===0?h[0]=Math.min(h[0],h[1]-k):h[1]=Math.max(h[1],h[0]+k)),e.onValueChange(h)},c=f=>y=>{let h=e.values[f],k=r*10,I=y.key==="ArrowRight"||y.key==="ArrowUp"?h+r:y.key==="ArrowLeft"||y.key==="ArrowDown"?h-r:y.key==="PageUp"?h+k:y.key==="PageDown"?h-k:y.key==="Home"?t:y.key==="End"?a:void 0;I!==void 0&&(y.preventDefault(),n(f,I))},s=f=>{if(f.pointerType==="mouse"&&f.button!==0)return;let y=f.currentTarget,h=y.querySelector(".pxd-slider-track"),k=F=>{let j=h.getBoundingClientRect();return t+Math.min(1,Math.max(0,(F-j.left)/(j.width||1)))*d},I=k(f.clientX),S=0;e.values.forEach((F,j)=>{Math.abs(F-I)<Math.abs(e.values[S]-I)&&(S=j)}),f.preventDefault(),y.querySelectorAll('[role="slider"]')[S]?.focus(),n(S,I);let N=F=>n(S,k(F.clientX)),M=()=>{document.removeEventListener("pointermove",N),document.removeEventListener("pointerup",M)};document.addEventListener("pointermove",N),document.addEventListener("pointerup",M)},u=p(e.values[0]),x=p(e.values[e.values.length-1]),m=e.values.length===1?{left:"0%",right:`${100-x}%`}:{left:`${u}%`,right:`${100-x}%`},g=f=>Yo/2-f/50*(Yo/2);return o("span",{dir:"ltr","data-orientation":"horizontal",class:"pxd-slider",style:{"--radix-slider-thumb-transform":"translateX(-50%)"},onPointerdown:s},o("span",{"data-orientation":"horizontal",class:"pxd-slider-track"},o("span",{"data-orientation":"horizontal",class:"pxd-slider-range",style:m})),...e.values.map((f,y)=>o("span",{key:y,style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",left:`calc(${p(f)}% + ${g(p(f))}px)`}},o("span",{role:"slider","aria-label":e.thumbs[y]?.["aria-label"],"aria-labelledby":e.thumbs[y]?.["aria-labelledby"],"aria-valuemin":t,"aria-valuenow":f,"aria-valuemax":a,"aria-valuetext":e.thumbs[y]?.["aria-valuetext"],"aria-orientation":"horizontal","data-orientation":"horizontal",tabindex:"0",class:"pxd-slider-thumb",onKeydown:c(y)}))))}function Qo(e){let t=a=>{let r=a.currentTarget,d=Array.from(r.querySelectorAll('[role="tab"]')),p=d.indexOf(document.activeElement);if(p<0)return;let i=a.key==="ArrowRight"?(p+1)%d.length:a.key==="ArrowLeft"?(p+d.length-1)%d.length:a.key==="Home"?0:a.key==="End"?d.length-1:-1;i<0||(a.preventDefault(),d[i].focus(),d[i].click())};return o("div",{dir:"ltr","data-orientation":"horizontal",class:e.rootClass,...e.rootProps??{}},o("div",{role:"tablist","aria-orientation":"horizontal",class:e.listClass,tabindex:"-1","data-orientation":"horizontal",style:{outline:"none"},onKeydown:t},...e.tabs.map(a=>{let r=a.key===e.value;return o("button",{key:a.key,type:"button",role:"tab","aria-selected":r,"aria-controls":`${e.id}-content-${a.key}`,"data-state":r?"active":"inactive",id:`${e.id}-trigger-${a.key}`,tabindex:r?"0":"-1","data-orientation":"horizontal",class:e.tabClass,onClick:()=>e.onValueChange(a.key)},...a.label)})),...e.tabs.map(a=>{let r=a.key===e.value;return o("div",{key:a.key,"data-state":r?"active":"inactive","data-orientation":"horizontal",role:"tabpanel","aria-labelledby":`${e.id}-trigger-${a.key}`,id:`${e.id}-content-${a.key}`,tabindex:"0",class:e.panelClass,hidden:!r,style:{animationDuration:"0s"}},r?a.content:null)}))}function ue(e,...t){let a=e.dismissible!==!1;e.ctx.r.modals++;let r=p=>{let i=p;if(i&&!i.open)try{i.showModal()}catch{i.setAttribute("open","")}e.ref?.(i)},d=p=>{p.open&&p.close(),e.onClose()};return[o("div",{key:`${e.id}-overlay`,"data-state":"open",class:e.overlayClass??"pxd-overlay","aria-hidden":"true",style:{pointerEvents:"auto"}}),o("dialog",{key:e.id,role:e.role??"dialog","data-state":"open",class:e.class,tabindex:"-1","data-pxd-modal":"",...e.props??{},ref:r,onCancel:p=>{p.preventDefault(),a&&d(p.currentTarget)},onClick:p=>{let i=p.currentTarget;if(p.target!==i)return;let l=i.getBoundingClientRect();!(p.clientX>=l.left&&p.clientX<=l.right&&p.clientY>=l.top&&p.clientY<=l.bottom)&&a&&d(i)},onClose:()=>e.onClose()},...t)]}var me=(e,t,...a)=>o("button",{type:"button",...t,onClick:r=>{let d=r.currentTarget.closest("dialog");d?.open&&d.close(),e()}},...a),ye=()=>({open:!1,x:0,y:0,align:"end"});function _e(e,t,a,r,d){let p=(i,l)=>{let n=i.getBoundingClientRect();a({open:!0,x:r==="end"?n.right:n.left,y:n.bottom+4,keyboard:l,align:r})};return{id:`${e}-trigger`,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":t.open?`${e}-content`:void 0,"data-state":t.open?"open":"closed",...d,onPointerdown:i=>{i.button!==0||i.ctrlKey||(i.preventDefault(),t.open?a(ye()):p(i.currentTarget,!1))},onKeydown:i=>{(i.key==="Enter"||i.key===" "||i.key==="ArrowDown")&&(i.preventDefault(),p(i.currentTarget,!0))}}}function He(e,t,a,r,d,p){if(!a.open)return;let i=(s=!0)=>{r(ye()),s&&(document.getElementById(`${t}-trigger`)??e.r.root?.querySelector(`[data-pxd-menu-trigger="${t}"]`))?.focus()},l=s=>{let u=s.currentTarget,x=Array.from(u.querySelectorAll('[role="menuitem"]:not([data-disabled])')),m=x.indexOf(document.activeElement);if(s.key==="Escape")return s.preventDefault(),i();if(s.key==="Tab")return i(!1);let g=s.key==="ArrowDown"?(m+1)%x.length:s.key==="ArrowUp"?(m+x.length-1)%x.length:s.key==="Home"?0:s.key==="End"?x.length-1:-1;g>=0&&x.length&&(s.preventDefault(),x[g].focus())},n=null,c=s=>{if(!s){n&&document.removeEventListener("pointerdown",n,!0),n=null;return}let u=s,x=u.getBoundingClientRect(),m=u.parentElement,g=a.align==="end"?Math.max(8,a.x-x.width):Math.min(a.x,window.innerWidth-x.width-8),f=a.y+x.height>window.innerHeight?Math.max(8,a.y-x.height-8):a.y;m.style.transform=`translate(${Math.round(g)}px, ${Math.round(f)}px)`;let y=u.querySelector('[role="menuitem"]:not([data-disabled])');(a.keyboard&&y?y:u).focus({preventScroll:!0}),n=h=>{!u.contains(h.target)&&!h.target.closest?.(`#${CSS.escape(`${t}-trigger`)}`)&&i(!1)},document.addEventListener("pointerdown",n,!0)};e.portal(o("div",{key:`${t}-menu`,"data-radix-popper-content-wrapper":"",style:{position:"fixed",left:"0px",top:"0px",minWidth:"max-content",zIndex:12}},o("div",{role:"menu","aria-orientation":"vertical","data-state":"open",dir:"ltr",id:`${t}-content`,"aria-labelledby":`${t}-trigger`,tabindex:"-1",style:{outline:"none"},...p,ref:c,onKeydown:l},...d.map((s,u)=>s==="separator"?o("div",{key:`sep-${u}`,role:"separator","aria-orientation":"horizontal",class:"pxd-menu-separator"}):o("div",{key:s.key,role:"menuitem",class:s.class,tabindex:"-1","data-orientation":"vertical","aria-disabled":s.disabled||void 0,"data-disabled":s.disabled?"":void 0,...s.props??{},onPointermove:x=>{x.currentTarget.focus()},onFocus:x=>{for(let m of x.currentTarget.parentElement.querySelectorAll("[data-highlighted]"))m.removeAttribute("data-highlighted");x.currentTarget.setAttribute("data-highlighted","")},onBlur:x=>x.currentTarget.removeAttribute("data-highlighted"),onClick:()=>{s.disabled||(i(),s.onSelect())},onKeydown:x=>{(x.key==="Enter"||x.key===" ")&&!s.disabled&&(x.preventDefault(),i(),s.onSelect())}},...s.label)))))}function er(e,t,a,r,d,p,...i){let l=null,n=null,c=s=>{if(!s){l&&document.removeEventListener("pointerdown",l,!0),n&&document.removeEventListener("keydown",n),l=n=null;return}let u=s,x=u.parentElement,m=e.r.root?.querySelector(a),g=m?.getBoundingClientRect()??{left:8,bottom:8,width:0},f=u.getBoundingClientRect(),y=Math.max(8,Math.min(g.left+g.width/2-f.width/2,window.innerWidth-f.width-8)),h=g.bottom+8+f.height>window.innerHeight?Math.max(8,(m?.getBoundingClientRect().top??0)-8-f.height):g.bottom+8;x.style.transform=`translate(${Math.round(y)}px, ${Math.round(h)}px)`,(u.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])")??u).focus({preventScroll:!0}),d&&(l=k=>{u.contains(k.target)||r()},n=k=>k.key==="Escape"&&r(),document.addEventListener("pointerdown",l,!0),document.addEventListener("keydown",n))};e.portal(o("div",{key:`${t}-popover`,"data-radix-popper-content-wrapper":"",style:{position:"fixed",left:"0px",top:"0px",minWidth:"max-content",zIndex:12}},o("div",{"data-side":"bottom","data-align":"center","data-state":"open",role:"dialog",id:`${t}-content`,tabindex:"-1",...p,ref:c},...i)))}var be=(e,t)=>(t??[]).map(a=>e.render(a));function he(e,t,...a){return o(`h${Math.min(e.heading,6)}`,{class:t},...a)}function tr(e,t){let a=t.b,r=t.id(e,"heading");return o("section",{class:"pxd-section","aria-labelledby":r,...t.a11y(e)},o("div",{class:"pxd-section-header"},o(`h${Math.min(t.heading,6)}`,{id:r,class:"pxd-section-title"},a.text(e.title)),e.description!==void 0&&o("p",{class:"pxd-section-description"},a.text(e.description))),o("div",{class:"pxd-stack"},...be(t.with({heading:t.heading+1}),e.children)))}function ar(e,t){let a=(e.children??[]).map(i=>t.r.byId.get(i)),r=a.length>1&&a.every(i=>i?.component==="Metric"),d=e.arrangement??"auto";return o("div",{class:`pxd-group pxd-stack${d==="inline"?" pxd-group-inline":d==="grid"?" pxd-group-grid":r?" pxd-metric-row":""}`,...t.a11y(e)},...be(t,e.children))}function or(e,t){return o("div",{class:`pxd-columns pxd-columns-${e.layout??"two-thirds"} pxd-columns-collapse-${e.collapse??"compact"} pxd-columns-align-${e.align??"stretch"}`,...t.a11y(e)},...be(t,e.children))}function rr(e,t){let a=t.b,r=a.text(e.title),d=e.badge?.tone??"neutral";return o("article",{class:`pxd-card${e.action?" pxd-card-actionable":""}`,...t.a11y(e)},e.media&&o("div",{class:"pxd-card-media"},t.render(e.media)),o("div",{class:"pxd-card-body"},o("div",{class:"pxd-card-header"},he(t,"pxd-card-title",e.action?o("button",{type:"button",class:"pxd-card-link",onClick:()=>t.r.dispatch(e.action,a.scope,e.id)},r):r),e.badge&&o("span",{class:`pxd-badge pxd-tone-${d}`},a.text(e.badge.text))),e.subtitle!==void 0&&o("p",{class:"pxd-card-subtitle"},a.text(e.subtitle)),e.progress&&Sd(a.value(e.progress.value),e.progress.label!==void 0&&a.text(e.progress.label)||void 0,r,t.r.locale),e.children&&o("div",{class:"pxd-stack pxd-stack-tight pxd-card-children"},...be(t,e.children))))}function Sd(e,t,a,r){let d=Math.max(0,Math.min(1,Number(e)||0)),p=zt(d,r);return o("div",{class:"pxd-progress"},o("div",{class:"pxd-progress-track",role:"progressbar","aria-label":`Progress: ${a}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(d*100),"aria-valuetext":t??p},o("div",{class:"pxd-progress-fill",style:{width:`${d*100}%`}})),o("span",{class:"pxd-progress-label"},t??p))}function dr(e,t){let a=t.b,[r,d]=t.state(e,"open",()=>e.open??t.r.disclosure==="show-everything"),p=t.id(e,"content"),i=r?"open":"closed";return o("div",{"data-state":i,class:"pxd-disclosure",...t.a11y(e)},o("button",{type:"button","aria-controls":r?p:void 0,"aria-expanded":r,"data-state":i,class:"pxd-disclosure-trigger",onClick:()=>d(!r)},o("span",{class:"pxd-disclosure-icon","aria-hidden":"true"},r?"\u25BE":"\u25B8"),a.text(e.summary)),o("div",{"data-state":i,id:p,hidden:!r,class:"pxd-disclosure-content"},r?o("div",{class:"pxd-stack"},...be(t,e.children)):null))}function ir(e,t){let a=t.b,r=e.selected?a.value(e.selected):void 0,[d,p]=t.state(e,"view",void 0),i=jt(e.views,r,d),l=n=>e.selected?a.write(e.selected,n):p(n);return Qo({id:t.id(e),value:i,onValueChange:l,rootClass:`pxd-views pxd-views-${e.variant??"tabs"}`,rootProps:t.a11y(e),listClass:"pxd-views-list",tabClass:"pxd-views-tab",panelClass:"pxd-views-panel",tabs:e.views.map(n=>{let c=n.count!==void 0?a.value(n.count):void 0;return{key:n.key,label:[a.text(n.label),c!==void 0&&o("span",{class:"pxd-views-count"},Be(c,t.r.locale))],content:t.render(n.content)}})})}function oe(e,{value:t,name:a,size:r=40}){let d=typeof t=="string"?t:"",p=Ta(d)?e.r.props.resolveMedia?.(d):void 0,i=Na(d,a),l=Ea(a);return p?o("img",{class:"pxd-avatar",src:p,alt:"",width:r,height:r,style:{width:r,height:r}}):o("span",{class:`pxd-avatar pxd-avatar-${l}`,"aria-hidden":"true",style:{width:r,height:r,fontSize:Math.round(r*.38)}},i)}function P(e,t=20){return o("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},o("path",{d:Ra(e)}))}function pr(e,t){let a=t.b,[r,d]=t.state(e,"split",()=>Dt(e.ratio)),[p,i]=t.state(e,"previous",()=>a.value(e.selected)),l=a.value(e.selected),{has:n,scope:c,name:s}=Ot(e,t.r.byId,t.r.data,a.scope),u=k=>d(I=>dt(I,k)),x=!1;l!==p&&(i(l),r.listShown&&u({type:"selected"}),x=r.compact&&n);let{showList:m,showDetail:g}=Vt(r,n),f=k=>{if(k.pointerType==="mouse"&&k.button!==0)return;let I=k.currentTarget,S=I.parentElement;I.setPointerCapture(k.pointerId);let N=S.getBoundingClientRect(),M=getComputedStyle(S).direction==="rtl",F=T=>{let w=M?N.right-T.clientX:T.clientX-N.left;u({type:"share",value:w/N.width*100})},j=()=>{S.removeEventListener("pointermove",F),S.removeEventListener("pointerup",j),S.removeEventListener("pointercancel",j)};S.addEventListener("pointermove",F),S.addEventListener("pointerup",j),S.addEventListener("pointercancel",j)},y=!!e.resizable&&!r.compact,h=k=>{if(!k)return;let I=k.closest(".pxd-surface")??k;t.r.observeWidth(I,`${e.id}:split`,S=>u({type:"measure",width:S}))};return x&&t.after(()=>t.r.root?.querySelector(`[data-pxd-id="${e.id}"] > .pxd-split-detail`)?.focus()),o("div",{class:`pxd-split pxd-split-${e.ratio??"narrow"}${r.compact?" pxd-split-compact":""}${y?" pxd-split-resizable":""}`,style:y?{"--polyxd-split-share":`${r.share}%`}:void 0,...t.a11y(e),ref:h},o("div",{class:"pxd-split-primary",hidden:!m},t.render(e.primary)),y&&o("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize the list","aria-valuenow":Math.round(r.share),"aria-valuemin":Ke,"aria-valuemax":Xe,tabindex:"0",class:"pxd-split-handle",onKeydown:k=>{let I=dt(r,{type:"key",key:k.key,shift:k.shiftKey});I!==r&&(k.preventDefault(),d(I))},onPointerdown:f},o("span",{class:"pxd-split-handle-line","aria-hidden":"true"})),g&&o("div",{class:"pxd-split-detail",tabindex:"-1","aria-label":s},r.compact&&o("button",{type:"button",class:"pxd-button pxd-button-tertiary pxd-split-back",onClick:()=>u({type:"back"})},P("chevronLeft",18),"Back"),n?t.render(e.detail,c):e.empty?t.render(e.empty):null),o("span",{class:"pxd-sr-only","aria-live":"polite"},r.compact&&n&&!r.listShown?s:""))}function ho(e){return"block"in e?o("span",{class:`pxd-skeleton-block pxd-skeleton-${e.block}${e.size?` pxd-skeleton-${e.size}`:""}`}):o("div",{class:Gt[e.group]},...e.parts.map(ho))}function vo({title:e,pattern:t,shape:a,theme:r,mode:d,density:p,locale:i="en-GB",className:l}){let n=_t(t,a);return o("div",{class:["pxd-surface","pxd-skeleton",`pxd-skeleton-${n}`,l].filter(Boolean).join(" "),"data-pxd-theme":r,"data-pxd-mode":d,"data-pxd-density":p,lang:i,role:"status","aria-busy":"true"},o("span",{class:"pxd-sr-only"},Wt(e)),o("div",{class:"pxd-skeleton-body","aria-hidden":"true"},ho({block:"title",size:n==="dialog"?"short":"medium"}),...qt[n].map(ho)))}function nr(e,t){let a=t.r,r=t.id(e,"main"),[d,p]=t.state(e,"width","wide"),[i,l]=t.state(e,"drawer",!1),n=e.navigation?a.byId.get(e.navigation):void 0,c=la(n?.placement,d,n?.items?.length??0),s=f=>String(W(f,a.data,re)??"");c!=="drawer"&&i&&l(!1);let u={navigation:c,compact:d==="compact",mainId:r,navigationId:n?.id,navigationLabel:n?n.label!==void 0?s(n.label):"Main":void 0,current:a.props.current,drawerOpen:i,setDrawerOpen:l},x=t.with({frame:u}),m=e.header?a.byId.get(e.header):void 0,g=e.aside?a.byId.get(e.aside):void 0;return o("div",{class:`pxd-frame pxd-frame-width-${e.width??"contained"}`,"data-pxd-layout":d,"data-pxd-nav":c,"data-pxd-appbar":m?.component==="AppBar"&&m.sticky!==!1?m.variant??"standard":void 0,...t.a11y(e),ref:f=>f&&a.observeWidth(f,`${e.id}:frame`,y=>p(pa(y)))},e.skipTarget!==!1&&o("a",{class:"pxd-skip-link",href:`#${r}`,onClick:f=>{f.preventDefault(),document.getElementById(r)?.focus()}},"Skip to main content"),e.banner&&o("div",{class:"pxd-frame-banner"},x.render(e.banner)),e.header&&x.render(e.header),o("div",{class:"pxd-frame-body"},n&&o("div",{class:"pxd-frame-nav"},x.render(n.id)),o("div",{class:"pxd-frame-main"},x.render(e.main)),g&&o("aside",{class:"pxd-frame-aside","aria-label":g.title!==void 0?s(g.title):"Aside"},x.render(g.id))),e.footer&&x.render(e.footer))}function zd(e,t,a){let r=typeof t=="string"?t:"",d=r.length>3?e.r.props.resolveMedia?.(r):void 0;if(d)return o("img",{class:"pxd-appbar-logo",src:d,alt:""});let p=(r&&r.length<=3?r:a.split(/\s+/).map(i=>i[0]).join("").slice(0,2)).toUpperCase();return o("span",{class:"pxd-appbar-mark","aria-hidden":"true"},p)}function sr(e,t){let a=t.b,r=t.frame,[d,p]=t.state(e,"scrolled",!1),[i,l]=t.state(e,"search",!1),n=e.variant??"standard",c=e.sticky!==!1,s=r?.compact??!1,u=a.text(e.title),x=na(u,s,r?.current?.title),m=r?.navigation==="drawer",g=new WeakMap,f=h=>{if(!h||!c||typeof IntersectionObserver>"u"||g.has(h))return;let k=new IntersectionObserver(([I])=>p(!I.isIntersecting));k.observe(h),g.set(h,k)},y=h=>o("div",{class:`pxd-appbar-search${h?" pxd-appbar-search-row":""}`,role:"search","aria-label":"Search",ref:h?k=>k&&i&&!k.dataset.focused&&(k.dataset.focused="1",k.querySelector("input, button")?.focus()):void 0},t.render(e.search));return[o("div",{class:"pxd-appbar-sentinel","aria-hidden":"true",ref:f}),o("header",{class:`pxd-appbar pxd-appbar-${n}${c?" pxd-appbar-sticky":""}`,"data-pxd-scrolled":d||void 0,...t.a11y(e)},o("div",{class:"pxd-appbar-row"},m?o("button",{type:"button",class:"pxd-icon-button pxd-appbar-menu","aria-label":`${r.navigationLabel??"Main"} menu`,"aria-expanded":r.drawerOpen,onClick:()=>r.setDrawerOpen(!0)},P("menu")):e.leading&&o("div",{class:"pxd-appbar-leading"},t.render(e.leading)),o("div",{class:"pxd-appbar-brand"},e.brand!==void 0&&zd(t,a.value(e.brand),u),(n!=="large"||s)&&o("span",{class:"pxd-appbar-title"},x)),e.search&&(s?o("button",{type:"button",class:"pxd-icon-button pxd-appbar-search-toggle","aria-label":i?"Close search":"Search","aria-expanded":i,onClick:()=>l(!i)},P(i?"close":"search")):y(!1)),(e.actions||e.account)&&o("div",{class:"pxd-appbar-end"},e.actions&&o("div",{class:"pxd-appbar-actions"},t.render(e.actions)),e.account&&o("div",{class:"pxd-appbar-account"},t.render(e.account)))),e.search&&s&&i&&y(!0),n==="large"&&!s&&o("div",{class:"pxd-appbar-headline"},x))]}function cr(e,t){let a=t.b,r=Math.min(t.heading,6),d=e.groups??[];return o("footer",{class:"pxd-footer",...t.a11y(e)},d.length>0&&o("div",{class:"pxd-footer-groups"},...d.map(p=>{let i=t.id(e,p.key);return o("nav",{key:p.key,class:"pxd-footer-group","aria-labelledby":i},o(`h${r}`,{id:i,class:"pxd-footer-heading"},a.text(p.label)),o("ul",null,...p.items.map(l=>o("li",{key:l.key},o("button",{type:"button",class:"pxd-link pxd-footer-link",onClick:()=>t.r.dispatch(l.action,a.scope,e.id)},a.text(l.label))))))})),o("div",{class:"pxd-footer-legal"},o("p",{class:"pxd-footer-legal-text"},a.text(e.legal)),e.aside&&o("div",{class:"pxd-footer-aside"},t.render(e.aside))))}function xr(e,t){let a=t.b,r=t.r,d=t.frame,p=!!r.props.loading,i=`${r.props.current?.key??""}\0${r.props.current?.title??""}`,[l,n]=t.state(e,"shown",i);l!==i&&(n(i),p||t.after(()=>{let s=document.getElementById(d?.mainId??"");if(!s)return;let u=s.querySelector("h1");u&&!u.hasAttribute("tabindex")&&(u.tabIndex=-1),(u??s).focus()}));let c=r.props.outlet;return o("main",{id:d?.mainId,class:"pxd-outlet",tabindex:"-1","aria-label":e.label!==void 0?a.text(e.label):void 0,...t.a11y(e)},p?e.loading?t.render(e.loading):vo({title:r.props.current?.title,className:"pxd-outlet-skeleton"}):c?Oe(c,"outlet"):null)}var lr=new Set;function ur(e,t){let a=t.b,r=t.r.components[e.name];if(!r)return lr.has(e.name)||(lr.add(e.name),console.warn(`[polyxd] No host component named "${e.name}"; rendering its fallback. Pass one in the surface's components.`)),e.fallback?t.render(e.fallback):null;let d=We(e.props??{},t.r.data,a.scope)??{},p=r({...d,node:e}),i=p instanceof Element?Oe(p,e.id):p;return e.label===void 0?i:o("div",{class:"pxd-custom",role:"group","aria-label":a.text(e.label),...t.a11y(e)},i)}function fr(e,t){let a=t.b,r=t.r,[d,p]=t.state(e,"compact",!1),i=O(e.rows.path,a.scope),l=Z(q(r.data,i)),n=a.text(e.caption),c=!!e.detail&&e.expandable!==!1,[s,u]=t.state(e,"expanded",()=>[]),x=A=>s.includes(A),m=A=>u(B=>pt(B,A)),g=(A,B)=>o("button",{type:"button",class:"pxd-icon-button pxd-table-expander","aria-expanded":x(A),"aria-label":`${x(A)?"Hide":"Show"} details for ${B}`,onClick:()=>m(A)},P(x(A)?"sortUp":"sortDown",16)),f=e.selection==="multiple",y=f&&e.selected?a.value(e.selected)??[]:[],h=(A,B)=>Yt(e,l,B,r.data,A),k=A=>a.write(e.selected,pt(y,A)),I=l.map((A,B)=>h({pointer:K(i,B)},B)),S=l.length>0&&I.every(A=>y.includes(A)),N=()=>a.write(e.selected,S?[]:I),M=e.sort?.column?a.value(e.sort.column):void 0,F=e.sort?.direction?a.value(e.sort.direction):"ascending",j=A=>{let B=Jt(A,M,F);e.sort?.column&&a.write(e.sort.column,A),e.sort?.direction&&a.write(e.sort.direction,B),e.sort?.action&&r.dispatch(e.sort.action,a.scope,e.id)},T=A=>o("span",{"data-state":"checked",style:{pointerEvents:"none"}},A),w=(A,B)=>{let H=q(r.data,O(A.path,B)),L=G(H,X(A.format,r.data,a.scope),r.locale);if(A.kind==="status")return o("span",{class:`pxd-badge pxd-tone-${A.tones?.[String(H)]??"neutral"}`},L);if(A.format?.type==="color")return o("span",{class:"pxd-color-value"},o("span",{class:`pxd-swatch${Ee(L)?"":" pxd-swatch-unknown"}`,style:Ee(L)?{background:Ee(L)}:void 0,"aria-hidden":"true"}),L);if(A.kind==="entity"){let V=A.secondaryPath?String(q(r.data,O(A.secondaryPath,B))??""):"";return o("span",{class:"pxd-entity"},A.avatarPath&&oe(t,{value:q(r.data,O(A.avatarPath,B)),name:L,size:28}),o("span",{class:"pxd-entity-text"},e.rowAction?o("button",{type:"button",class:"pxd-link",onClick:()=>r.dispatch(e.rowAction,B,e.id)},L):o("span",{class:"pxd-entity-name"},L),V&&o("span",{class:"pxd-entity-secondary"},V)))}return A.kind==="link"&&e.rowAction?o("button",{type:"button",class:"pxd-link",onClick:()=>r.dispatch(e.rowAction,B,e.id)},L):L},v=(A,B,H)=>{let V=(r.byId.get(e.rowActions)?.children??[]).map(R=>r.byId.get(R)).filter(R=>!!R&&(R.visible===void 0||W(R.visible,r.data,A)!==!1));if(!V.length)return null;let U=t.id(e,`row-${H}-menu`),[D,$]=t.state(e,`menu:${H}`,ye);return He(t,U,D,$,V.map(R=>({key:R.id,label:[a.text(R.label)],class:`pxd-menu-item${R.tone==="danger"?" pxd-menu-item-danger":""}`,onSelect:()=>r.dispatch(R.action,A,R.id)})),{class:"pxd-menu"}),o("button",{type:"button",..._e(U,D,$,"end",{class:"pxd-icon-button","aria-label":`Actions for ${B}`})},P("dots",18))},b=[e.views&&Cd(e,t),(e.search||e.toolbar||f&&y.length>0)&&o("div",{class:`pxd-table-toolbar${y.length>0?" pxd-table-bulk":""}`,role:"toolbar","aria-label":y.length>0?`Actions for ${y.length} selected`:"Table tools"},...y.length>0?[o("p",{class:"pxd-bulk-count","aria-live":"polite"},`${y.length} selected`),e.bulkActions&&t.render(e.bulkActions),o("button",{type:"button",class:"pxd-button pxd-button-tertiary",onClick:()=>a.write(e.selected,[])},"Cancel")]:[e.search&&t.render(e.search),o("span",{class:"pxd-table-toolbar-spacer"}),e.toolbar&&t.render(e.toolbar)])],z=()=>o("ul",{class:"pxd-row-list","aria-label":n},...l.map((A,B)=>{let H={pointer:K(i,B)},{first:L,status:V,details:U}=Xt(e.columns),D=G(q(r.data,O(L.path,H)),X(L.format,r.data,a.scope),r.locale),$=h(H,B);return o("li",{key:String($),class:"pxd-row-item"},f&&e.selected&&xe({class:"pxd-checkbox",checked:y.includes($),onCheckedChange:()=>k($),"aria-label":`Select ${D}`,indicator:T(P("check",14))}),c&&g($,D),o("div",{class:"pxd-row-main"},o("div",{class:"pxd-row-title"},w(L,H)),o("p",{class:"pxd-row-details"},...U.map((R,_)=>o("span",{key:R.key},_>0&&o("span",{"aria-hidden":"true"}," \xB7 "),o("span",{class:"pxd-sr-only"},`${a.text(R.label)}: `),G(q(r.data,O(R.path,H)),X(R.format,r.data,a.scope),r.locale))))),V&&w(V,H),e.rowActions?v(H,D,B):e.rowAction&&!e.columns[0].kind?o("button",{type:"button",class:"pxd-button pxd-button-tertiary",onClick:()=>r.dispatch(e.rowAction,H,e.id)},"Select",o("span",{class:"pxd-sr-only"},` ${D}`)):null,c&&x($)&&o("div",{class:"pxd-row-detail"},t.render(e.detail,H)))})),C=()=>o("div",{class:"pxd-table-scroll"},o("table",{class:"pxd-table"},o("caption",{class:e.views||e.search?"pxd-sr-only":void 0},n),o("thead",null,o("tr",null,c&&o("th",{scope:"col",class:"pxd-table-expand"},o("span",{class:"pxd-sr-only"},"Details")),f&&e.selected&&o("th",{scope:"col",class:"pxd-table-select"},xe({class:"pxd-checkbox",checked:S?!0:y.length>0?"indeterminate":!1,onCheckedChange:N,"aria-label":"Select all rows",indicator:o("span",{"data-state":S?"checked":"indeterminate",style:{pointerEvents:"none"}},P(S?"check":"dash",14))})),...e.columns.map(A=>{let B=A.key===M;return o("th",{key:A.key,scope:"col",class:it(A)?"pxd-num":void 0,"aria-sort":A.sortable?B?F:"none":void 0},A.sortable?o("button",{type:"button",class:"pxd-sort",onClick:()=>j(A.key)},a.text(A.label),P(B?F==="descending"?"sortDown":"sortUp":"sort",16)):a.text(A.label))}),(e.rowActions||e.rowAction)&&o("th",{scope:"col"},o("span",{class:"pxd-sr-only"},"Actions")))),o("tbody",null,...l.flatMap((A,B)=>{let H={pointer:K(i,B)},L=h(H,B),V=G(q(r.data,O(e.columns[0].path,H)),X(e.columns[0].format,r.data,a.scope),r.locale);return[o("tr",{key:String(L),class:y.includes(L)?"pxd-row-selected":void 0,"aria-selected":f?y.includes(L):void 0},c&&o("td",{class:"pxd-table-expand"},g(L,V)),f&&e.selected&&o("td",{class:"pxd-table-select"},xe({class:"pxd-checkbox",checked:y.includes(L),onCheckedChange:()=>k(L),"aria-label":`Select ${V}`,indicator:T(P("check",14))})),...e.columns.map((U,D)=>o(D===0?"th":"td",{key:U.key,scope:D===0?"row":void 0,"data-label":a.text(U.label),class:it(U)?"pxd-num":void 0},w(U,H))),(e.rowActions||e.rowAction)&&o("td",{class:"pxd-table-action"},e.rowActions?v(H,V,B):o("button",{type:"button",class:"pxd-button pxd-button-tertiary",onClick:()=>r.dispatch(e.rowAction,H,e.id)},"Select",o("span",{class:"pxd-sr-only"},` ${V}`)))),c&&x(L)&&o("tr",{key:`${String(L)}-detail`,class:"pxd-table-detail"},o("td",{colspan:Zt(e,c,!!(f&&e.selected))},t.render(e.detail,H)))]})))),E=!l.length&&e.empty?t.render(e.empty):d?z():C();return o("div",{class:"pxd-table-wrap",...t.a11y(e),ref:A=>A&&r.observeWidth(A,`${e.id}:table`,B=>p(B<Kt))},...b,E,e.page&&ko(e,t,l.length))}function Cd(e,t){let a=t.b,r=e.view?a.value(e.view):e.views[0].key;return o("div",{class:"pxd-table-views",role:"tablist","aria-label":"Saved views"},...e.views.map(d=>{let p=d.count!==void 0?a.value(d.count):void 0,i=d.key===r;return o("button",{key:d.key,type:"button",role:"tab","aria-selected":i,class:`pxd-table-view${i?" pxd-table-view-current":""}`,onClick:()=>{e.view&&a.write(e.view,d.key),t.r.dispatch(d.action,a.scope,e.id)}},a.text(d.label),p!==void 0&&o("span",{class:"pxd-views-count"},Be(p,t.r.locale)))}))}function ko(e,t,a){let r=t.b,d=e.page,{index:p,size:i,total:l,pages:n,from:c,to:s,sizes:u}=Qt(d.index?r.value(d.index):void 0,d.size?r.value(d.size):void 0,d.total?r.value(d.total):void 0,a),x=g=>Be(g,t.r.locale),m=g=>{d.index&&r.write(d.index,g),t.r.dispatch(d.action,r.scope,e.id)};return o("div",{class:"pxd-paging"},d.size&&o("label",{class:"pxd-paging-size"},"Rows per page",o("select",{value:String(i),onChange:g=>{r.write(d.size,Number(g.target.value)),d.index&&r.write(d.index,1),t.r.dispatch(d.action,r.scope,e.id)}},...u.map(g=>o("option",{key:g,value:String(g),selected:g===i},String(g))))),o("p",{class:"pxd-paging-range","aria-live":"polite"},`${x(c)}\u2013${x(s)} of ${x(l)}`),o("div",{class:"pxd-paging-controls"},o("button",{type:"button",class:"pxd-icon-button","aria-label":"Previous page",disabled:p<=1,onClick:()=>m(p-1)},P("chevronLeft",18)),o("span",{class:"pxd-paging-page"},`Page ${x(p)} of ${x(n)}`),o("button",{type:"button",class:"pxd-icon-button","aria-label":"Next page",disabled:p>=n,onClick:()=>m(p+1)},P("chevronRight",18))))}function mr(e){let t=Ee(e);return o("span",{class:`pxd-swatch${t?"":" pxd-swatch-unknown"}`,style:t?{background:t}:void 0,"aria-hidden":"true"})}function Ze(e){return e.map(t=>typeof t=="string"?t:t.kind==="code"?o("code",null,t.text):t.kind==="strong"?o("strong",null,...Ze(t.children)):t.kind==="em"?o("em",null,...Ze(t.children)):t.kind!=="link"?null:t.href?o("a",{href:t.href,rel:"noopener noreferrer"},...Ze(t.children)):o("span",null,...Ze(t.children)))}function yr(e,t){let a=t.b,r=t.a11y(e),d=e.variant??"body",p=e.format?.type==="color",i=(l,n=e.format)=>{let c=a.text(l,n);return n?.type==="color"?[mr(c),c]:[c]};if(d==="rich")return o("p",{class:"pxd-text pxd-text-body pxd-text-rich",...r},...Ze(Pe(a.text(e.text))));if(d==="quote")return o("figure",{class:"pxd-text-quote",...r},o("blockquote",null,o("p",{class:"pxd-text pxd-text-body"},...i(e.text))),e.cite!==void 0&&o("figcaption",{class:"pxd-text-cite"},a.text(e.cite)));if(d==="list"){let l=e.items?O(e.items.path,a.scope):void 0,n=l?Z(q(t.r.data,l)):[],c=a.text(e.text);return o("div",{class:"pxd-text-list",...r},c&&o("p",{class:"pxd-text pxd-text-body"},c),o(e.ordered?"ol":"ul",{class:`pxd-text-list-items${e.ordered?" pxd-text-list-ordered":""}`},...n.map((s,u)=>{let x=e.itemPath&&l?q(t.r.data,O(e.itemPath,{pointer:K(l,u)})):s;return o("li",{key:u},...i(x))})))}return o("p",{class:`pxd-text pxd-text-${d}${p?" pxd-text-color":""}`,...r},...i(e.text))}function br(e,t){let a=t.b,r=a.text(e.label),d=a.text(e.value,e.format),p=e.change?wa(a.value(e.change.value),e.change.favorable,X(e.change.format,t.r.data,a.scope),t.r.locale):void 0,i=e.caption!==void 0?a.text(e.caption):void 0;return o("div",{class:"pxd-metric",role:"group","aria-label":r,...t.a11y(e)},o("div",{class:"pxd-metric-label"},r),o("div",{class:"pxd-metric-value"},d),p&&o("div",{class:`pxd-metric-change pxd-data-${p.tone}`},o("span",{"aria-hidden":"true"},p.text),o("span",{class:"pxd-sr-only"},p.spoken)),i&&o("div",{class:"pxd-metric-caption"},i))}function hr(e,t){let a=t.b,r=e.variant==="receipt",d=n=>{let c=a.value(n.value);return r&&n.format?.type==="currency"&&c===0&&!n.total?{text:"Free",free:!0,color:!1}:{text:a.text(n.value,n.format),free:!1,color:n.format?.type==="color"}},p=(n,c)=>e.rowAction?o("button",{type:"button",class:"pxd-link pxd-detail-change",onClick:()=>t.r.dispatch(aa(e.rowAction,n.key??c),a.scope,e.id)},"Change",o("span",{class:"pxd-sr-only"},` ${c}`)):null,i=e.items.filter(n=>!n.total),l=e.items.filter(n=>n.total);return o("div",{class:`pxd-detail-list${r?" pxd-receipt":""}${e.layout==="grid"?" pxd-detail-grid":""}${e.rowAction?" pxd-detail-actions":""}`,...t.a11y(e)},e.title!==void 0&&he(t,"pxd-detail-title",a.text(e.title)),o("dl",null,...i.map((n,c)=>{let s=d(n),u=a.text(n.label);return o("div",{class:"pxd-detail-row",key:n.key??c},o("dt",null,u),o("dd",{class:s.free?"pxd-free":void 0},s.color&&mr(s.text),s.text),e.rowAction&&o("dd",{class:"pxd-detail-row-action"},p(n,u)))}),...l.map((n,c)=>o("div",{class:"pxd-detail-row pxd-total",key:n.key??`t${c}`},o("dt",null,a.text(n.label)),o("dd",null,d(n).text),e.rowAction&&o("dd",{class:"pxd-detail-row-action"})))))}function vr(e,t){let a=t.b,r=t.r,d=t.id(e,"label"),p=O(e.items.path,a.scope),i=Z(q(r.data,p)),l=e.selection??"none",n=l!=="none"&&e.selected?a.value(e.selected):void 0,c=$=>Array.isArray(n)?n.includes($):n===$,s=$=>{if(!e.selected)return;if(l==="single")return a.write(e.selected,$);let R=Array.isArray(n)?n:[];a.write(e.selected,R.includes($)?R.filter(_=>_!==$):[...R,$])},u=Array.isArray(n)?n.length:0,x=a.text(e.label),m=r.byId.get(e.items.componentId),{grid:g,timeline:f,carousel:y,calendar:h}=Fa(e,m),k=e.reorderable===!0,I=k&&e.order?a.value(e.order):void 0,S=i.map(($,R)=>Ha($,R)),N=$a(S,I),M=($,R)=>{let _=e.order?Ba(N,S,$,R):void 0;_&&a.write(e.order,_)},[F,j]=t.state(e,"dragging",null),[T,w]=t.state(e,"position",0),v=()=>r.root?.querySelector(`[data-pxd-id="${CSS.escape(e.id)}"] .pxd-carousel-track`),b=$=>Array.from($.children),z=$=>{let R=$.currentTarget;w(Da(b(R).map(_=>_.offsetLeft-R.offsetLeft),R.scrollLeft))},C=$=>{let R=v(),_=R&&b(R)[Math.max(0,Math.min(i.length-1,$))];R&&_&&R.scrollTo({left:_.offsetLeft-R.offsetLeft,behavior:"smooth"})},E=h?i.map(($,R)=>ja(e.datePath?q(r.data,O(e.datePath,{pointer:K(p,R)})):void 0)):[],[A,B]=t.state(e,"month",null),H=Pa(A,E.find(Boolean));if(!i.length&&e.empty)return t.render(e.empty);let L=($,R)=>o("input",{type:l==="single"?"radio":"checkbox",class:"pxd-collection-select",name:l==="single"?`${e.id}-selection`:void 0,checked:c($),onChange:()=>s($),"aria-label":R}),V=($,R)=>{let _=S[$],Y={pointer:K(p,$)};return o("li",{key:String(_),class:`pxd-collection-item${F===R?" pxd-collection-dragging":""}`,draggable:k||void 0,onDragstart:k?()=>j(R):void 0,onDragover:k?le=>le.preventDefault():void 0,onDrop:k?()=>{F!==null&&M(F,R),j(null)}:void 0,onDragend:k?()=>j(null):void 0},k&&o("div",{class:"pxd-collection-reorder"},o("span",{class:"pxd-collection-handle","aria-hidden":"true"},P("menu",16)),o("button",{type:"button",class:"pxd-icon-button pxd-collection-move","aria-label":`Move item ${R+1} up`,disabled:R===0,onClick:()=>M(R,R-1)},P("sortUp",16)),o("button",{type:"button",class:"pxd-icon-button pxd-collection-move","aria-label":`Move item ${R+1} down`,disabled:R===i.length-1,onClick:()=>M(R,R+1)},P("sortDown",16))),l!=="none"&&L(_,`Select item ${R+1} of ${i.length}`),o("div",{class:"pxd-collection-content"},t.render(e.items.componentId,Y)))},U=l==="multiple"&&u>0&&o("div",{class:"pxd-table-toolbar pxd-table-bulk",role:"toolbar","aria-label":`Actions for ${u} selected`},o("p",{class:"pxd-bulk-count","aria-live":"polite"},`${u} selected`),e.bulkActions&&t.render(e.bulkActions),o("button",{type:"button",class:"pxd-button pxd-button-tertiary",onClick:()=>a.write(e.selected,[])},"Cancel")),D;if(y)D=o("div",{class:"pxd-carousel",role:"group","aria-roledescription":"carousel","aria-labelledby":d},o("ul",{class:"pxd-collection-list pxd-carousel-track","aria-labelledby":d,onScroll:z},...N.map(($,R)=>V($,R))),o("div",{class:"pxd-carousel-controls"},o("button",{type:"button",class:"pxd-icon-button","aria-label":"Previous item",disabled:T<=0,onClick:()=>C(T-1)},P("chevronLeft",18)),o("p",{class:"pxd-carousel-position","aria-live":"polite"},`${T+1} of ${i.length}`),o("button",{type:"button",class:"pxd-icon-button","aria-label":"Next item",disabled:T>=i.length-1,onClick:()=>C(T+1)},P("chevronRight",18))));else if(h){let{monthName:$,weekdays:R,weeks:_}=La(H,r.locale),Y=le=>N.filter(ne=>E[ne]&&E[ne].y===H.y&&E[ne].m===H.m&&E[ne].d===le);D=o("div",{class:"pxd-calendar"},o("div",{class:"pxd-calendar-header"},o("button",{type:"button",class:"pxd-icon-button","aria-label":"Previous month",onClick:()=>B(xt(H,-1))},P("chevronLeft",18)),o("p",{class:"pxd-calendar-month","aria-live":"polite"},$),o("button",{type:"button",class:"pxd-icon-button","aria-label":"Next month",onClick:()=>B(xt(H,1))},P("chevronRight",18))),o("table",{class:"pxd-calendar-grid"},o("caption",{class:"pxd-sr-only"},`${x}, ${$}`),o("thead",null,o("tr",null,...R.map(le=>o("th",{key:le,scope:"col"},le)))),o("tbody",null,..._.map((le,ne)=>o("tr",{key:ne},...le.map((pe,Ie)=>pe===null?o("td",{key:Ie,class:"pxd-calendar-empty"}):o("td",{key:Ie,class:`pxd-calendar-day${Y(pe).length?" pxd-calendar-has-items":""}`},o("span",{class:"pxd-calendar-date"},pe),Y(pe).length>0&&o("ul",{class:"pxd-calendar-items"},...Y(pe).map(ke=>o("li",{key:String(S[ke]),class:"pxd-collection-item"},l!=="none"&&L(S[ke],`Select item on ${pe}`),o("div",{class:"pxd-collection-content"},t.render(e.items.componentId,{pointer:K(p,ke)}))))))))))))}else D=o("ul",{class:`pxd-collection-list${g?" pxd-collection-grid":""}${f?" pxd-timeline":""}${k?" pxd-collection-reorderable":""}`,"aria-labelledby":d},...N.map(($,R)=>V($,R)));return o("div",{class:"pxd-collection",...t.a11y(e)},o("div",{class:"pxd-collection-label",id:d},`${x} `,o("span",{class:"pxd-count"},`(${i.length})`)),U,D,e.page&&ko(e,t,i.length))}function kr(e,t){let a=t.b,r=t.r,d=t.a11y(e),[p,i]=t.state(e,"open",null),l=e.kind??"image",n=e.src?a.value(e.src):void 0,c=n?r.props.resolveMedia?.(n):void 0,s=e.decorative?"":a.text(e.alt),u=`pxd-media pxd-media-${e.aspect??"auto"}`;if(l==="qr")return Md(t,e,a.text(e.value),s,d);if(l==="gallery"){let x=e.items?O(e.items.path,a.scope):void 0,g=(x?Z(q(r.data,x)):[]).map((y,h)=>{let k={pointer:K(x,h)},I=e.imagePath?q(r.data,O(e.imagePath,k)):void 0,S=I?r.props.resolveMedia?.(String(I)):void 0,N=e.altPath?String(q(r.data,O(e.altPath,k))??""):"";return{src:S,alt:N}}),f=g.filter(y=>!!y.src);return p!==null&&f[p]&&Ad(t,e,s,f,p,i),o("ul",{class:"pxd-gallery","aria-label":s||void 0,...d},...g.map((y,h)=>{let k=f.indexOf(y);return o("li",{key:h},k>=0?o("button",{type:"button",class:"pxd-gallery-item","aria-label":y.alt?`Open ${y.alt}`:`Open image ${k+1} of ${f.length}`,onClick:()=>i(k)},o("img",{class:`${u} pxd-gallery-image`,src:y.src,alt:y.alt})):o("div",{class:`${u} pxd-media-placeholder pxd-gallery-image`,role:"img","aria-label":y.alt||void 0}))}))}if(l==="video"||l==="audio"){let x=e.transcript!==void 0?a.text(e.transcript):void 0,m=e.poster!==void 0?a.text(e.poster):void 0,g=m?r.props.resolveMedia?.(m):void 0;return o("figure",{class:`pxd-media-player pxd-media-${l}`,...d},l==="video"?c?o("video",{class:u,controls:!0,src:c,poster:g,"aria-label":s||void 0}):o("div",{class:`${u} pxd-media-placeholder`,role:"img","aria-label":s||void 0}):c?o("audio",{class:"pxd-media-audio-player",controls:!0,src:c,"aria-label":s||void 0}):o("div",{class:"pxd-media-placeholder pxd-media-audio-placeholder",role:"img","aria-label":s||void 0}),s&&o("figcaption",{class:"pxd-media-caption"},s),x&&o("details",{class:"pxd-media-transcript"},o("summary",null,"Transcript"),o("p",{class:"pxd-text pxd-text-body"},x)))}return c?o("img",{class:u,src:c,alt:s,...d}):o("div",{class:`${u} pxd-media-placeholder`,role:e.decorative?"presentation":"img","aria-label":s||void 0})}var gr=e=>o("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},o("path",{d:e==="left"?"m15 6-6 6 6 6":"m9 6 6 6-6 6"}));function Ad(e,t,a,r,d,p){let i=r.length,{src:l,alt:n}=r[d],c=x=>p(Math.max(0,Math.min(i-1,x))),s=e.id(t,"viewer-title"),u=()=>p(null);e.after(()=>{let x=document.activeElement;x?.disabled&&x.classList.contains("pxd-viewer-step")&&((x.nextElementSibling??x.previousElementSibling)?.dispatchEvent(new Event("noop")),(x.nextElementSibling??x.previousElementSibling)?.focus())}),e.portal(ue({ctx:e,id:e.id(t,"viewer"),class:"pxd-viewer",onClose:u,props:{"aria-labelledby":s,onKeydown:x=>x.key==="ArrowLeft"?c(d-1):x.key==="ArrowRight"?c(d+1):void 0}},o("h2",{id:s,class:"pxd-sr-only"},a||"Pictures"),o("div",{class:"pxd-viewer-bar"},o("span",{class:"pxd-viewer-counter","aria-live":"polite"},`${d+1} of ${i}`),me(u,{class:"pxd-icon-button pxd-viewer-close","aria-label":"Close"},P("close"))),o("figure",{class:"pxd-viewer-figure"},o("img",{class:"pxd-viewer-image",src:l,alt:n}),n&&o("figcaption",{class:"pxd-viewer-caption"},n)),o("div",{class:"pxd-viewer-bar pxd-viewer-nav"},o("button",{type:"button",class:"pxd-icon-button pxd-viewer-step","aria-label":"Previous picture",disabled:d===0,onClick:()=>c(d-1)},gr("left")),o("button",{type:"button",class:"pxd-icon-button pxd-viewer-step","aria-label":"Next picture",disabled:d===i-1,onClick:()=>c(d+1)},gr("right")))))}function Md(e,t,a,r,d){let p=a?lo(a):void 0;if(!p)return o("div",{class:"pxd-qr pxd-qr-placeholder",role:"img","aria-label":r||`QR code: ${a}`,...d},o("span",{class:"pxd-qr-mark","aria-hidden":"true"},"QR"),o("span",{class:"pxd-qr-text"},a));let i=l=>{let n=l;if(!n||n.dataset.text===a)return;n.dataset.text=a;let c=4,s=4,u=p.length;n.width=n.height=(u+s*2)*c;let x=n.getContext("2d");if(!x)return;let m=getComputedStyle(n),g=m.getPropertyValue("--pxd-color-text-default").trim()||"#000",f=m.getPropertyValue("--pxd-color-surface-default").trim()||"#fff";x.fillStyle=f,x.fillRect(0,0,n.width,n.height),x.fillStyle=g,p.forEach((y,h)=>y.forEach((k,I)=>k&&x.fillRect((I+s)*c,(h+s)*c,c,c)))};return e.after(()=>i(e.r.root?.querySelector(`canvas[data-pxd-id="${CSS.escape(t.id)}"]`)??null)),o("canvas",{class:"pxd-qr",role:"img","aria-label":r||`QR code: ${a}`,...d,ref:i})}function wr(e,t){let a=t.b,r=e.kind==="error",d=t.a11y(e);return e.kind==="undo"?o("div",{class:"pxd-snackbar",role:"status",...d},o("p",{class:"pxd-snackbar-text"},a.text(e.title),e.message!==void 0&&o("span",{class:"pxd-snackbar-message"},` ${a.text(e.message)}`)),e.action&&t.render(e.action)):o("div",{class:`pxd-status pxd-status-${e.kind}${e.variant==="inline"?" pxd-status-notice":""}`,role:r?"alert":"status",...d},e.kind==="loading"?o("span",{class:"pxd-spinner","aria-hidden":"true"}):o("span",{class:"pxd-status-icon","aria-hidden":"true"},P(e.icon??Ua[e.kind],e.kind==="empty"?28:16)),o("div",{class:"pxd-status-body"},o("p",{class:"pxd-status-title"},a.text(e.title)),e.message!==void 0&&o("p",{class:"pxd-status-message"},a.text(e.message)),e.action&&e.variant!=="inline"&&o("div",{class:"pxd-status-action"},t.render(e.action))),e.action&&e.variant==="inline"&&o("div",{class:"pxd-status-action"},t.render(e.action)))}var mt=(e,t,a,r)=>{let{tag:d,attrs:p}=Xa(e,t,a);return o(d,{...p,fill:r})};function Sr(e,t){let a=t.b,r=t.r,d=t.id(e,"title"),p=t.id(e,"summary"),i=O(e.data.path,a.scope),l=Z(q(r.data,i)).map((b,z)=>K(i,z)),n=b=>q(r.data,O(e.x.path,{pointer:b})),c=(b,z)=>Number(q(r.data,O(z.path,{pointer:b})))||0,s=e.series,u=t.a11y(e),x=(b,z)=>G(b,X(z,r.data,a.scope),r.locale),m=b=>x(n(b),e.x.format),g=600-Q.left-Q.right,f=240-Q.top-Q.bottom,y=()=>o("details",{class:"pxd-chart-data"},o("summary",null,"Show data"),o("table",{class:"pxd-table"},o("thead",null,o("tr",null,o("th",{scope:"col"},a.text(e.x.label)),...s.map((b,z)=>o("th",{scope:"col",key:z,class:"pxd-num"},a.text(b.label))))),o("tbody",null,...l.map(b=>o("tr",{key:b},o("th",{scope:"row"},x(n(b),e.x.format)),...s.map((z,C)=>o("td",{key:C,class:"pxd-num"},x(c(b,z),z.format)))))))),h=(b,z)=>o("figure",{class:"pxd-chart","aria-labelledby":d,"aria-describedby":p,...u},o("figcaption",null,o("span",{class:"pxd-chart-title",id:d},a.text(e.title)),o("span",{class:"pxd-chart-summary",id:p},a.text(e.summary))),b,z,y()),k=s.length>1&&o("ul",{class:"pxd-chart-legend"},...s.map((b,z)=>o("li",{key:z},o("svg",{width:"12",height:"12","aria-hidden":"true"},mt(De[z],6,6,ee(z))),a.text(b.label)))),I=(b,z,...C)=>o("svg",{viewBox:b,class:z,"aria-hidden":"true"},...C);if(e.intent==="relationship"){let b=l.map(H=>Number(n(H))||0),z=l.flatMap(H=>s.map(L=>c(H,L))),C=Ve(Math.max(0,...b)),E=Ve(Math.max(0,...z)),A=H=>Q.left+H/(C||1)*g,B=H=>Q.top+f-H/(E||1)*f;return h(I(`0 0 ${600} ${240}`,"pxd-chart-svg",o("g",{class:"pxd-chart-axis"},...[0,.5,1].map(H=>o("g",{key:H},o("line",{x1:Q.left,x2:600-Q.right,y1:B(E*H),y2:B(E*H),class:"pxd-chart-grid"}),o("text",{x:Q.left-8,y:B(E*H)+4,"text-anchor":"end"},x(E*H,{...s[0].format??{type:"number"},precision:0})))),...[0,.5,1].map(H=>o("text",{key:`x${H}`,x:A(C*H),y:230,"text-anchor":H===0?"start":H===1?"end":"middle"},x(C*H,{...e.x.format??{type:"number"},precision:0})))),...s.map((H,L)=>o("g",{key:L},...l.map((V,U)=>mt(De[L],A(b[U]),B(c(V,H)),ee(L)))))),k)}if(e.intent==="range"){let z=Q.top+l.length*28+24,C=l.map(V=>c(V,s[0])),E=l.map(V=>c(V,s[1]??s[0])),A=Math.min(0,...C),B=Ve(Math.max(...E,1)),H=120,L=V=>H+(V-A)/(B-A||1)*(600-H-Q.right);return h(I(`0 0 ${600} ${z}`,"pxd-chart-svg",o("g",{class:"pxd-chart-axis"},...[0,.5,1].map(V=>{let U=A+(B-A)*V;return o("g",{key:V},o("line",{x1:L(U),x2:L(U),y1:Q.top,y2:z-20,class:"pxd-chart-grid"}),o("text",{x:L(U),y:z-4,"text-anchor":"middle"},x(U,{...s[0].format??{type:"number"},precision:0})))})),...l.map((V,U)=>{let D=Q.top+U*28;return o("g",{key:V},o("text",{x:H-8,y:D+28/2+4,"text-anchor":"end",class:"pxd-chart-range-label"},ut(n(V),e.x.format?.type,r.locale)),o("line",{x1:L(C[U]),x2:L(E[U]),y1:D+28/2,y2:D+28/2,stroke:ee(0),"stroke-width":10,"stroke-linecap":"round"}),o("circle",{cx:L(C[U]),cy:D+28/2,r:4,fill:ee(1)}),o("circle",{cx:L(E[U]),cy:D+28/2,r:4,fill:ee(2)}))})),o("ul",{class:"pxd-chart-legend"},o("li",null,o("span",{class:"pxd-chart-swatch",style:{background:ee(1)},"aria-hidden":"true"}),a.text(s[0].label)),s[1]&&o("li",null,o("span",{class:"pxd-chart-swatch",style:{background:ee(2)},"aria-hidden":"true"}),a.text(s[1].label))))}if(e.intent==="matrix"){let b=l.map(C=>s.map(E=>c(C,E))),z=Math.max(1,...b.flat());return h(o("div",{class:"pxd-heatmap-scroll","aria-hidden":"true"},o("table",{class:"pxd-heatmap"},o("thead",null,o("tr",null,o("th",null),...s.map((C,E)=>o("th",{key:E,scope:"col"},a.text(C.label))))),o("tbody",null,...l.map((C,E)=>o("tr",{key:C},o("th",{scope:"row"},m(C)),...s.map((A,B)=>{let H=Math.round(b[E][B]/z*100);return o("td",{key:B,class:`pxd-heatmap-cell${H>=60?" pxd-heatmap-strong":""}`,style:{background:`color-mix(in srgb, var(--pxd-color-data-categorical-1) ${H}%, var(--pxd-color-surface-subtle))`}},x(b[E][B],A.format))})))))))}if(e.intent==="hierarchy"){let b=l.map(C=>Math.max(0,c(C,s[0]))),z=Wa(b,600,240);return h(I(`0 0 ${600} ${240}`,"pxd-chart-svg pxd-chart-treemap",...z.map((C,E)=>C&&o("g",{key:E},o("rect",{x:C.x+1,y:C.y+1,width:Math.max(C.w-2,0),height:Math.max(C.h-2,0),fill:ee(E),rx:2}),C.w>48&&C.h>24&&o("text",{x:C.x+8,y:C.y+18,class:"pxd-chart-tile-label"},m(l[E]).slice(0,Math.floor(C.w/8)))))),o("ul",{class:"pxd-chart-legend"},...l.map((C,E)=>o("li",{key:C},o("span",{class:"pxd-chart-swatch",style:{background:ee(E)},"aria-hidden":"true"}),`${m(C)}: ${x(b[E],s[0].format)}`))))}if(e.intent==="flow"){let b=l.map(_=>s.map(Y=>Math.max(0,c(_,Y)))),{leftY:z,rightY:C,leftTotals:E,rightTotals:A,scale:B}=Ya(b,s.length,240),H=12,L=110,V=L,U=600-L,D=[...z],$=[...C],R=(V+U)/2;return h(I(`0 0 ${600} ${240}`,"pxd-chart-svg pxd-chart-flow",...b.flatMap((_,Y)=>_.map((le,ne)=>{if(le<=0)return null;let pe=le*B,Ie=D[Y],ke=$[ne];D[Y]+=pe,$[ne]+=pe;let pd=`M${V+H} ${Ie} C${R} ${Ie}, ${R} ${ke}, ${U-H} ${ke} L${U-H} ${ke+pe} C${R} ${ke+pe}, ${R} ${Ie+pe}, ${V+H} ${Ie+pe} Z`;return o("path",{key:`${Y}-${ne}`,d:pd,fill:ee(ne),opacity:.45})})),...l.map((_,Y)=>o("g",{key:_},o("rect",{x:V,y:z[Y],width:H,height:Math.max(E[Y]*B,1),fill:"var(--pxd-color-border-strong)"}),o("text",{x:V-8,y:z[Y]+E[Y]*B/2+4,"text-anchor":"end",class:"pxd-chart-flow-label"},m(_)))),...s.map((_,Y)=>o("g",{key:`s${Y}`},o("rect",{x:U-H,y:C[Y],width:H,height:Math.max(A[Y]*B,1),fill:ee(Y)}),o("text",{x:U+8,y:C[Y]+A[Y]*B/2+4,class:"pxd-chart-flow-label"},a.text(_.label))))),k)}if(e.intent==="composition"){let b=l.map(B=>c(B,s[0])),z=b.reduce((B,H)=>B+H,0)||1,C=0,E=b.map((B,H)=>{let L=B/z*598,V=o("rect",{key:H,x:1+C,y:4,width:Math.max(L-2,0),height:40,fill:ee(H),rx:2});return C+=L,V}),A=l.map((B,H)=>({label:G(n(B),X(e.x.format,r.data,a.scope),r.locale),value:b[H],color:ee(H),share:b[H]/z}));return o("figure",{class:"pxd-chart","aria-labelledby":d,"aria-describedby":p,...u},o("figcaption",null,o("span",{class:"pxd-chart-title",id:d},a.text(e.title)),o("span",{class:"pxd-chart-summary",id:p},a.text(e.summary))),o("svg",{viewBox:`0 0 ${600} 48`,class:"pxd-chart-svg pxd-chart-bar","aria-hidden":"true",preserveAspectRatio:"none"},o("g",null,...E)),o("ul",{class:"pxd-chart-legend"},...A.map(B=>o("li",{key:B.label},o("span",{class:"pxd-chart-swatch",style:{background:B.color},"aria-hidden":"true"}),`${B.label}: ${G(B.value,X(s[0].format,r.data,a.scope),r.locale)} (${G(B.share,{type:"percent",precision:0},r.locale)})`))),y())}let S=l.flatMap(b=>s.map(z=>c(b,z))),{lo:N,max:M,ticks:F}=Ka(S,e.intent==="trend"),j=b=>Q.top+f-(b-N)/(M-N||1)*f,T=g/Math.max(l.length,1),w=o("g",{class:"pxd-chart-axis"},...F.map(b=>o("g",{key:b},o("line",{x1:Q.left,x2:600-Q.right,y1:j(b),y2:j(b),class:"pxd-chart-grid"}),o("text",{x:Q.left-8,y:j(b)+4,"text-anchor":"end"},G(b,{...X(s[0].format,r.data,a.scope)??{type:"number"},precision:0},r.locale)))),...l.map((b,z)=>o("text",{key:b,x:Q.left+T*z+T/2,y:230,"text-anchor":"middle"},ut(n(b),e.x.format?.type,r.locale)))),v;if(e.intent==="trend")v=s.map((b,z)=>{let C=l.map((E,A)=>[Q.left+T*A+T/2,j(c(E,b))]);return o("g",{key:z},o("polyline",{points:C.map(([E,A])=>`${E},${A}`).join(" "),fill:"none",stroke:ee(z),"stroke-width":2.5}),...C.map(([E,A])=>mt(De[z],E,A,ee(z))))});else{let b=e.intent==="distribution",z=b?1:.7,C=T*z/s.length;v=l.flatMap((E,A)=>s.map((B,H)=>{let L=c(E,B),V=j(Math.max(L,0));return o("rect",{key:`${A}-${H}`,x:Q.left+T*A+T*((1-z)/2)+C*H,y:V,width:C-(b?1:2),height:Math.max(j(0)-V,1),fill:ee(H),rx:b?0:2})}))}return o("figure",{class:"pxd-chart","aria-labelledby":d,"aria-describedby":p,...u},o("figcaption",null,o("span",{class:"pxd-chart-title",id:d},a.text(e.title)),o("span",{class:"pxd-chart-summary",id:p},a.text(e.summary))),I(`0 0 ${600} ${240}`,"pxd-chart-svg",w,...v),s.length>1&&o("ul",{class:"pxd-chart-legend"},...s.map((b,z)=>o("li",{key:z},o("svg",{width:"12",height:"12","aria-hidden":"true"},mt(De[z],6,6,ee(z))),a.text(b.label)))),y())}var Ae=()=>o("span",{class:"pxd-required","aria-hidden":"true"},"*");function ve({label:e,help:t,required:a,id:r,helpId:d},...p){return o("div",{class:"pxd-field"},o("label",{class:"pxd-field-label",for:r},e,a&&Ae()),t&&o("p",{class:"pxd-field-help",id:d},t),...p)}var Id={email:"email",phone:"tel",url:"url",search:"search",number:"text",currency:"text",text:"text"},te=e=>e.target.value;function Mr(e,t){let a=t.b,r=t.r,d=t.id(e),p=t.id(e,"help"),i=e.kind??"text",l=a.value(e.value),n=i==="number"||i==="currency",[c,s]=t.state(e,"draft",null),u=ua(l,i),x=c??u,m=e.validation??{},g=e.help!==void 0?a.text(e.help):void 0,f={id:d,class:"pxd-input","aria-describedby":g?p:void 0,required:e.required,autocomplete:e.autocomplete,...t.a11y(e)},y=M=>{if(!n)return a.write(e.value,M);s(M),a.write(e.value,xa(M))},h=M=>{m.message&&M.currentTarget.setCustomValidity(a.text(m.message))},k=M=>M.currentTarget.setCustomValidity(""),S={label:a.text(e.label),help:g,required:e.required,id:d,helpId:p};if(i==="suggestions"||i==="mentions")return Nd(e,t,S,f,i==="mentions");if(i==="tags")return Td(e,t,S,f);if(i==="richtext")return Ud(e,t,S,f);if(i==="inline")return Hd(e,t,S,f);if(i==="masked"){let M=typeof e.mask=="string"?e.mask:"";return ve(S,o("input",{...f,class:"pxd-input pxd-input-masked",type:"text",inputmode:ca(M)?"numeric":void 0,placeholder:M||void 0,value:u,maxlength:M.length||void 0,onInput:F=>(k(F),a.write(e.value,sa(M,te(F),te(F).length<u.length))),onInvalid:h}))}if(i==="code")return ve(S,o("textarea",{...f,class:"pxd-input pxd-input-code",rows:4,spellcheck:"false",autocorrect:"off",autocapitalize:"off",value:x,maxlength:m.maxLength,minlength:m.minLength,onInput:M=>(k(M),y(te(M))),onInvalid:h}));if(i==="search"){let M=e.placeholder!==void 0?a.text(e.placeholder):void 0;return o("div",{class:"pxd-search"},o("label",{class:"pxd-sr-only",for:d},a.text(e.label)),P("search"),o("input",{...f,class:"pxd-search-input",type:"search",placeholder:M,value:x,onInput:F=>y(te(F))}))}if(e.size==="hero"&&n)return o("div",{class:"pxd-hero-field"},o("label",{class:"pxd-hero-label",for:d},a.text(e.label)),o("div",{class:"pxd-hero-input"},i==="currency"&&o("span",{class:"pxd-hero-symbol","aria-hidden":"true"},at(a.text(e.currency)||"USD",r.locale)),o("input",{...f,class:"pxd-hero-value",type:"text",inputmode:i==="currency"?"decimal":"numeric",pattern:"-?[0-9]*[.,]?[0-9]*",placeholder:"0",size:Math.max(1,x.length||1),value:x,onInput:M=>(k(M),y(te(M))),onBlur:()=>s(null),onInvalid:h})),g&&o("p",{class:"pxd-field-help pxd-hero-help",id:p},g));let N=i==="multiline"?o("textarea",{...f,rows:3,value:x,maxlength:m.maxLength,minlength:m.minLength,onInput:M=>(k(M),y(te(M))),onInvalid:h}):o("div",{class:i==="currency"?"pxd-input-adorned":void 0},i==="currency"&&o("span",{class:"pxd-input-prefix","aria-hidden":"true"},at(a.text(e.currency)||"USD",r.locale)),o("input",{...f,type:Id[i]??"text",inputmode:i==="currency"?"decimal":i==="number"?"numeric":void 0,pattern:n?"-?[0-9]*[.,]?[0-9]*":void 0,value:x,maxlength:m.maxLength,minlength:m.minLength,onInput:M=>(k(M),y(te(M))),onBlur:()=>s(null),onInvalid:h}));return ve(S,N)}function Ed(e,t,a,r){let d=t.id(e,"list"),[p,i]=t.state(e,"open",!1),[l,n]=t.state(e,"active",-1),c=p&&a.length>0,s=m=>{if(!c){m.key==="ArrowDown"&&a.length&&(i(!0),n(0),m.preventDefault());return}m.key==="ArrowDown"?(n(g=>(g+1)%a.length),m.preventDefault()):m.key==="ArrowUp"?(n(g=>(g-1+a.length)%a.length),m.preventDefault()):m.key==="Enter"&&l>=0?(r(a[l]),i(!1),m.preventDefault()):m.key==="Escape"&&i(!1)},u={role:"combobox","aria-expanded":c,"aria-controls":d,"aria-autocomplete":"list","aria-activedescendant":c&&l>=0?`${d}-${l}`:void 0,autocomplete:"off",onKeydown:s,onBlur:()=>i(!1)};return{list:c?o("ul",{id:d,role:"listbox",class:"pxd-combobox-list"},...a.map((m,g)=>o("li",{key:String(m.value),id:`${d}-${g}`,role:"option","aria-selected":g===l,class:`pxd-combobox-option${g===l?" pxd-combobox-active":""}`,onMousedown:f=>(f.preventDefault(),r(m),i(!1))},m.label,m.description&&o("span",{class:"pxd-option-description"},m.description)))):null,inputProps:u,show:m=>(i(m),n(-1))}}function Nd(e,t,a,r,d){let p=t.b,i=Se(e,t.r.data,p.scope,p.text),l=String(p.value(e.value)??""),n=d?/@([^\s@]*)$/.exec(l):null,c=d?n?n[1]:null:l,s=c===null?[]:i.filter(x=>x.label.toLowerCase().includes(c.toLowerCase())).slice(0,8),u=Ed(e,t,s,x=>p.write(e.value,d&&n?`${l.slice(0,n.index)}@${x.label} `:x.label));return ve(a,o("div",{class:"pxd-combobox"},o("input",{...r,...u.inputProps,type:"text",value:l,onInput:x=>{let m=te(x);p.write(e.value,m),u.show(d?/@[^\s@]*$/.test(m):m.length>0)},onFocus:()=>u.show(!d&&l.length>0)}),u.list))}function Td(e,t,a,r){let d=t.b,p=d.value(e.value),i=Array.isArray(p)?p.map(String):[],[l,n]=t.state(e,"tags",""),c=(u=l)=>{let x=fa(i,u);x!==i&&d.write(e.value,x),n("")},s=u=>d.write(e.value,i.filter((x,m)=>m!==u));return ve(a,o("div",{class:"pxd-tags",role:"group","aria-label":a.label},o("ul",{class:"pxd-tags-list"},...i.map((u,x)=>o("li",{key:`${u}-${x}`,class:"pxd-tag-chip"},u,o("button",{type:"button",class:"pxd-tag-remove","aria-label":`Remove ${u}`,onClick:()=>s(x)},P("close",14))))),o("input",{...r,class:"pxd-tags-input",type:"text",value:l,onInput:u=>te(u).endsWith(",")?c(te(u)):n(te(u)),onKeydown:u=>{u.key==="Enter"?(u.preventDefault(),c()):u.key==="Backspace"&&l===""&&i.length&&s(i.length-1)},onBlur:()=>c()})))}function Ir(e){if(e.nodeType===3)return e.textContent??"";if(e.nodeType!==1)return"";let t=e,a=(r=t)=>Array.from(r.childNodes).map(Ir).join("");switch(t.tagName.toLowerCase()){case"b":case"strong":return`**${a()}**`;case"i":case"em":return`*${a()}*`;case"br":return`
22
+ <script>(()=>{var We=e=>new Map(e.components.map(t=>[t.id,t])),Et=e=>e.surface.kind==="shell"?void 0:e.components.find(t=>t.component==="Navigation"&&(!t.kind||t.kind==="main"));var de={pointer:""},$o=e=>e.replace(/~1/g,"/").replace(/~0/g,"~"),yd=e=>e.replace(/~/g,"~0").replace(/\//g,"~1"),ge=e=>!!e&&typeof e=="object"&&!Array.isArray(e)&&typeof e.path=="string";function O(e,t){return e.startsWith("/")?e:`${t.pointer}/${e}`}function K(e,t){return`${e}/${yd(String(t))}`}function _(e,t){if(t==="")return e;let a=e;for(let r of t.slice(1).split("/").map($o)){if(a===null||typeof a!="object")return;a=a[r]}return a}function rt(e,t,a){let r=t.slice(1).split("/").map($o),d=(p,i)=>{let n=r[i],l=Array.isArray(p)?[...p]:{...p??{}};return i===r.length-1?l[n]=a:l[n]=d(p?.[n]??(/^\d+$/.test(r[i+1])?[]:{}),i+1),l};return d(e,0)}var Z=e=>Array.isArray(e)?e:[];function W(e,t,a){return ge(e)?_(t,O(e.path,a)):e}function we(e,t,a){return Object.fromEntries(Object.entries(e??{}).map(([r,d])=>[r,W(d,t,a)]))}function Ke(e,t,a){return ge(e)?W(e,t,a):Array.isArray(e)?e.map(r=>Ke(r,t,a)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([r,d])=>[r,Ke(d,t,a)])):e}function G(e,t,a,r=Date.now()){if(e==null||e==="")return"\u2014";if(!t||t.type==="text")return Array.isArray(e)?e.join(", "):String(e);let d=typeof e=="number"?e:Number(e),p=t.precision===void 0?{}:{minimumFractionDigits:t.precision,maximumFractionDigits:t.precision};try{switch(t.type){case"number":return new Intl.NumberFormat(a,p).format(d);case"currency":return new Intl.NumberFormat(a,{style:"currency",currency:typeof t.currency=="string"?t.currency:"USD",...p}).format(d);case"percent":return new Intl.NumberFormat(a,{style:"percent",maximumFractionDigits:t.precision??1}).format(d);case"date":return new Intl.DateTimeFormat(a,{dateStyle:"medium",timeZone:"UTC"}).format(new Date(String(e)));case"time":return new Intl.DateTimeFormat(a,{timeStyle:"short",timeZone:"UTC"}).format(new Date(String(e)));case"datetime":return new Intl.DateTimeFormat(a,{dateStyle:"medium",timeStyle:"short",timeZone:"UTC"}).format(new Date(String(e)));case"relativeTime":{let i=(new Date(String(e)).getTime()-r)/1e3,n=[["year",31536e3],["month",2592e3],["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(a,{numeric:"auto"});for(let[c,s]of n)if(Math.abs(i)>=s)return l.format(Math.round(i/s),c);return l.format(Math.round(i),"second")}case"duration":{let i=Math.round(d/60);return i>=60?`${Math.floor(i/60)} h ${i%60} min`:`${i} min`}case"color":return String(e).trim();case"bytes":{let i=["byte","kilobyte","megabyte","gigabyte","terabyte"],n=0,l=Math.abs(d);for(;l>=1e3&&n<i.length-1;)l/=1e3,n++;return n===0?`${new Intl.NumberFormat(a,{maximumFractionDigits:0}).format(d)} B`:new Intl.NumberFormat(a,{style:"unit",unit:i[n],unitDisplay:"short",maximumFractionDigits:t.precision??1}).format(d<0?-l:l)}}}catch{return String(e)}}function Ie(e){let t=String(e??"").trim();return/^(#[0-9a-f]{3,8}|[a-z]{3,20}|(rgb|rgba|hsl|hsla|oklch|oklab|lab|lch|hwb)\([\d.,%\s\/-]+\))$/i.test(t)?t:void 0}function dt(e,t){try{return new Intl.NumberFormat(t,{style:"currency",currency:e}).formatToParts(0).find(a=>a.type==="currency")?.value??e}catch{return e}}function X(e,t,a){return!e?.currency||typeof e.currency=="string"?e:{...e,currency:W(e.currency,t,a)}}var Pe=(e,t)=>new Intl.NumberFormat(t).format(e),Mt=(e,t)=>new Intl.NumberFormat(t,{style:"percent",maximumFractionDigits:0}).format(e);function Se(e,t,a,r){let d=e.options;if(Array.isArray(d))return d.map(n=>({value:n.value,label:r(n.label),description:n.description!==void 0?r(n.description):void 0}));let p=O(d.path,a);return Z(_(t,p)).map((n,l)=>{let c={pointer:K(p,l)},s=u=>u?_(t,O(u,c)):void 0;return{value:s(d.valuePath),label:String(s(d.labelPath)??""),description:d.descriptionPath&&String(s(d.descriptionPath)??"")||void 0,avatar:d.avatarPath||d.imagePath?s(d.avatarPath??d.imagePath)??"":void 0,recent:d.recentPath?!!s(d.recentPath):!1}})}function At(e,t){let a=e.some(p=>p.avatar!==void 0),r=e.length>10||a&&e.length>6;return{control:!a&&e.length<=6&&e.every(p=>p.label.length<=24&&!p.description)?"chips":a?"people":"list",multiple:t==="multiple",searchable:r,withFaces:a}}var me=e=>JSON.stringify(e),it=(e,t)=>!t||`${e.label} ${e.description??""}`.toLowerCase().includes(t.toLowerCase());function pt(e,t){return{recent:t?[]:e.filter(a=>a.recent),rest:e.filter(a=>t?it(a,t):!a.recent)}}function It(e,t){let a=Array.isArray(e)?e:[],r=me(t);return a.some(d=>me(d)===r)?a.filter(d=>me(d)!==r):[...a,t]}var Nt=(e,t)=>{let a=me(t);return Array.isArray(e)?e.some(r=>me(r)===a):e!=null&&me(e)===a},Tt=e=>e?"Search by name":"Filter options";var Rt=(e,t)=>`${e}-${encodeURIComponent(JSON.stringify(t)).replace(/%/g,"_")}`;var Po=(e,t)=>Math.max(0,Math.min(t-1,e));function Ht(e,t){let a=t.type==="back"?e.index-1:t.type==="next"?e.index+1:t.index;return{...e,index:Po(a,e.total)}}var Ft=(e,t)=>({index:typeof e=="number"?Po(e,t):0,total:t}),$t=e=>e.index===e.total-1,Pt=e=>`Step ${e.index+1} of ${e.total}`,Ut={todo:{label:"Not started",tone:"neutral"},inProgress:{label:"In progress",tone:"info"},done:{label:"Completed",tone:"success"},blocked:{label:"Cannot start yet",tone:"neutral"}},Bt=e=>Ut[e??"todo"]??Ut.todo,jt=(e,t)=>e===t?null:t,Lt=(e,t)=>`${e} of ${t} tasks completed`;function Dt(e,t,a){return typeof t=="string"&&t?t:a??e[0]?.key}var Bo=640,Vt={narrow:33.333,balanced:50,wide:66.667},Xe=20,Ye=80,_t=e=>({compact:!1,listShown:!1,share:Vt[e??"narrow"]??Vt.narrow}),Ot=e=>Math.min(Ye,Math.max(Xe,e));function nt(e,t){switch(t.type){case"measure":return{...e,compact:t.width<Bo};case"back":return{...e,listShown:!0};case"selected":return{...e,listShown:!1};case"share":return{...e,share:Ot(t.value)};case"key":{let a=t.shift?10:5,r=t.key==="ArrowLeft"?e.share-a:t.key==="ArrowRight"?e.share+a:t.key==="Home"?Xe:t.key==="End"?Ye:void 0;return r===void 0?e:{...e,share:Ot(r)}}}}function qt(e,t){let a=!e.compact||t&&!e.listShown;return{showList:!e.compact||!a,showDetail:a}}var jo=(e,t,a,r,d)=>a?_(r,O(a,{pointer:d})):e&&typeof e=="object"&&"id"in e?e.id:t;function Gt(e,t,a,r){let d=W(e.selected,a,r),p=d!=null&&d!=="",i=t.get(e.primary),n=i?.component==="Table"?i.rows?.path:i?.items?.path,l=typeof n=="string"?O(n,r):void 0,c=l?Z(_(a,l)):[],s=l?c.findIndex((y,h)=>jo(y,h,i?.rowValuePath,a,K(l,h))===d):-1,u=l&&s>=0?{pointer:K(l,s)}:void 0,x=i?.items?.componentId?t.get(i.items.componentId):void 0,m=s>=0?c[s]:void 0,g=u&&x?.title!==void 0?W(x.title,a,u):void 0,f=p?String(g??m?.name??m?.title??m?.label??d):void 0;return{has:p,index:s,scope:u,name:f}}var Lo={"multi-step-form":"form","filter-and-browse":"list","undo-over-confirm":"list","compare-and-choose":"compare","confirm-destructive":"dialog","review-and-submit":"detail"},Wt=(e,t)=>t??(e?Lo[e]:void 0)??"detail",J=(e,t)=>({block:e,size:t}),ie=(e,t)=>({group:e,parts:t}),Be=(e,t)=>Array.from({length:e},(a,r)=>t(r)),Kt={list:[J("field","full"),...Be(5,e=>ie("row",[J("square"),ie("lines",[J("line",e%2?"medium":"long"),J("small","short")])]))],form:[...Be(4,e=>ie("lines",[J("small","short"),J("field",e===1?"medium":"long")])),ie("actions",[J("button"),J("button")])],detail:[ie("row",[J("circle"),ie("lines",[ie("row",[J("line","medium"),J("badge")]),J("small","short")])]),ie("dl",Be(6,e=>ie("row",[J("small","short"),J("line",e%3===2?"medium":"long")])))],dashboard:[ie("cards",Be(3,()=>ie("card",[J("small","short"),J("value","medium")]))),J("chart","full")],dialog:[J("line","long"),J("line","medium"),ie("actions",[J("button"),J("button")])],compare:[ie("cards",Be(3,()=>ie("card",[J("line","medium"),...Be(5,e=>J("small",e%2?"short":"long"))])))]},Xt={row:"pxd-skeleton-row",lines:"pxd-skeleton-lines",actions:"pxd-skeleton-actions",dl:"pxd-skeleton-dl",cards:"pxd-skeleton-cards",card:"pxd-skeleton-card"},Yt=e=>e?`Preparing ${e}`:"Preparing";var Jt=720,Do=[10,25,50,100],bd=new Set(["number","currency","percent","duration"]),lt=e=>e.align==="end"||e.align!=="start"&&(e.kind==="number"||e.kind==="currency"||bd.has(e.format?.type));function Zt(e){let[t,...a]=e;return{first:t,status:a.find(r=>r.kind==="status"),details:a.filter(r=>r.kind!=="status").slice(0,3)}}var Qt=(e,t,a,r,d)=>e.rowValuePath?_(r,O(e.rowValuePath,d)):t[a]?.id??a;var st=(e,t)=>e.includes(t)?e.filter(a=>a!==t):[...e,t],ea=(e,t,a)=>e===t&&a==="ascending"?"descending":"ascending",ta=(e,t,a)=>e.columns.length+(t?1:0)+(a?1:0)+(e.rowActions||e.rowAction?1:0);function aa(e,t,a,r){let d=typeof e=="number"?e:1,p=typeof t=="number"?t:r,i=typeof a=="number"?a:r,n=Math.max(1,Math.ceil(i/(p||1)));return{index:d,size:p,total:i,pages:n,from:i===0?0:(d-1)*p+1,to:Math.min(d*p,i),sizes:[...new Set([...Do,p])].sort((l,c)=>l-c)}}function oa(e,t,a,r,d){if(!e)return;let{name:p,context:i}=e.event;if(d.events?.action(e,a),p==="ui.dismiss")return d.onDismiss?.();d.onAction?.({name:p,context:we(i,r,t),source:a})}function Ne(e,t,a,r){let d=O(e.value.path,a);return Object.fromEntries(Object.entries(e.action?.event?.context??{}).map(([p,i])=>[p,ge(i)&&O(i.path,a)===d?r:W(i,t,a)]))}function ra(e,t,a,r){return e.copy!==void 0?r(e.copy):String(we(e.action?.event?.context,t,a).text??"")}var da=(e,t)=>({event:{name:e.event.name,context:{key:t,...e.event.context??{}}}});var ct={ctrl:["\u2303","Ctrl","Control","ctrlKey"],alt:["\u2325","Alt","Alt","altKey"],shift:["\u21E7","Shift","Shift","shiftKey"],enter:["\u21B5","Enter","Enter","enter"],escape:["\u238B","Esc","Escape","escape"],space:["Space","Space","Space"," "],tab:["\u21E5","Tab","Tab","tab"],backspace:["\u232B","Backspace","Backspace","backspace"],delete:["\u2326","Del","Delete","delete"],arrowup:["\u2191","\u2191","ArrowUp","arrowup"],arrowdown:["\u2193","\u2193","ArrowDown","arrowdown"],arrowleft:["\u2190","\u2190","ArrowLeft","arrowleft"],arrowright:["\u2192","\u2192","ArrowRight","arrowright"],home:["Home","Home","Home","home"],end:["End","End","End","end"],slash:["/","/","/","/"],comma:[",",",",",",","],period:[".",".",".","."]},Vo=["metaKey","ctrlKey","altKey","shiftKey"];function ia(e,t){let a=e.toLowerCase().split("+"),r=a.pop(),d=[],p=[],i=new Set;for(let l of a){let[c,s,u,x]=l==="mod"?t?["\u2318","Ctrl","Meta","metaKey"]:ct.ctrl:ct[l];d.push(t?c:s),p.push(u),i.add(x)}let n=ct[r];return d.push(n?t?n[0]:n[1]:r.toUpperCase()),p.push(n?n[2]:r.toUpperCase()),{hint:d,aria:p.join("+"),flags:i,key:n?n[3]:r}}function pa(e,t){if(!Vo.every(r=>t[r]===e.flags.has(r)))return!1;let a=/^[a-z0-9]$/.test(e.key)&&t.code.toLowerCase()===(/\d/.test(e.key)?`digit${e.key}`:`key${e.key}`);return t.key.toLowerCase()===e.key||a}var na=e=>!e.flags.has("metaKey")&&!e.flags.has("ctrlKey")&&!e.flags.has("altKey"),la=e=>/mac|iphone|ipad|ipod/i.test(e);var sa=e=>e>=1024?"wide":e>=640?"medium":"compact";function ca(e,t,a){let r=a<=5;return e==="bar"?r?"bar":"drawer":e==="drawer"?"drawer":t==="compact"?r?"bar":"drawer":e==="side"||e==="rail"?e:t==="wide"?"side":"rail"}var xa=(e,t,a)=>t&&a?a:e;var vd=/^(https?:|mailto:|tel:|\/|#)/i;function je(e){let t=[],a="",r=0,d=()=>{a&&t.push(a),a=""};for(;r<e.length;){if(e[r]==="`"){let p=e.indexOf("`",r+1);if(p>r+1){d(),t.push({kind:"code",text:e.slice(r+1,p)}),r=p+1;continue}}if(e.startsWith("**",r)){let p=e.indexOf("**",r+2);if(p>r+2){d(),t.push({kind:"strong",children:je(e.slice(r+2,p))}),r=p+2;continue}}if(e[r]==="*"){let p=e.indexOf("*",r+1);if(p>r+1){d(),t.push({kind:"em",children:je(e.slice(r+1,p))}),r=p+1;continue}}if(e[r]==="["){let p=/^\[([^\]]+)\]\(([^)\s]+)\)/.exec(e.slice(r));if(p){d(),t.push({kind:"link",href:vd.test(p[2])?p[2]:void 0,children:je(p[1])}),r+=p[0].length;continue}}a+=e[r++]}return d(),t}function ua(e,t,a=!1){let r=t.replace(/[^A-Za-z0-9]/g,"").split(""),d="",p=0;for(let i of e){if(p>=r.length)break;if(i==="#"||i==="A"||i==="*"){let n=i==="#"?/\d/:i==="A"?/[A-Za-z]/:/./;for(;p<r.length&&!n.test(r[p]);)p++;if(p>=r.length)break;d+=r[p++]}else d+=i}if(a)for(;d.length&&!/[#A*]/.test(e[d.length-1]);)d=d.slice(0,-1);return d}var fa=e=>!/[A*]/.test(e);function ga(e){let t=Number(e.replace(/[^\d.-]/g,""));return e.trim()===""||Number.isNaN(t)?null:t}var ma=(e,t)=>e==null?"":t==="currency"&&typeof e=="number"?e.toFixed(2):String(e);function ya(e,t){let a=t.trim().replace(/,$/,"").trim();return a&&!e.includes(a)?[...e,a]:e}var ne=(e,t,a)=>Math.min(a,Math.max(t,e)),Te=e=>ne(Math.round(e),0,255).toString(16).padStart(2,"0"),kd=e=>e===void 0?1:ne(e.endsWith("%")?parseFloat(e)/100:parseFloat(e),0,1),wd=e=>e.endsWith("%")?parseFloat(e)/100*255:parseFloat(e);function Oo(e,t,a){let r=(e%360+360)%360/360;if(t===0)return[a*255,a*255,a*255];let d=a<.5?a*(1+t):a+t-a*t,p=2*a-d,i=n=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?p+(d-p)*6*n:n<1/2?d:n<2/3?p+(d-p)*(2/3-n)*6:p);return[i(r+1/3)*255,i(r)*255,i(r-1/3)*255]}function _o(e,t,a){let r=e/255,d=t/255,p=a/255,i=Math.max(r,d,p),n=Math.min(r,d,p),l=(i+n)/2;if(i===n)return[0,0,l];let c=i-n,s=l>.5?c/(2-i-n):c/(i+n),u=i===r?(d-p)/c+(d<p?6:0):i===d?(p-r)/c+2:(r-d)/c+4;return u/=6,[u*360,s,l]}function ze(e){if(typeof e!="string")return null;let t=e.trim(),a=/^#([0-9a-f]{3,8})$/i.exec(t);if(a){let x=a[1];if(x.length===3||x.length===4){let[m,g,f,y]=x.split("").map(h=>parseInt(h+h,16));return{r:m,g,b:f,a:x.length===4?y/255:1}}if(x.length===6||x.length===8){let m=g=>parseInt(x.slice(g,g+2),16);return{r:m(0),g:m(2),b:m(4),a:x.length===8?m(6)/255:1}}return null}let r=/^(rgba?|hsla?)\(\s*([^)]+?)\s*\)$/i.exec(t);if(!r)return null;let d=r[2].split(/\s*[,/]\s*|\s+/).filter(Boolean);if(d.length<3||d.length>4)return null;let p=kd(d[3]);if(Number.isNaN(p))return null;if(r[1].toLowerCase().startsWith("rgb")){let[x,m,g]=d.slice(0,3).map(wd);return[x,m,g].some(Number.isNaN)?null:{r:ne(x,0,255),g:ne(m,0,255),b:ne(g,0,255),a:p}}let i=parseFloat(d[0]),n=parseFloat(d[1])/100,l=parseFloat(d[2])/100;if([i,n,l].some(Number.isNaN))return null;let[c,s,u]=Oo(i,ne(n,0,1),ne(l,0,1));return{r:c,g:s,b:u,a:p}}function xt(e,t,a){let r=a?Math.round(e.a*100)/100:1,d=Math.round(e.r),p=Math.round(e.g),i=Math.round(e.b);if(t==="rgb")return r<1?`rgba(${d}, ${p}, ${i}, ${r})`:`rgb(${d}, ${p}, ${i})`;if(t==="hsl"){let[n,l,c]=_o(d,p,i),s=Math.round(n),u=Math.round(l*100),x=Math.round(c*100);return r<1?`hsla(${s}, ${u}%, ${x}%, ${r})`:`hsl(${s}, ${u}%, ${x}%)`}return`#${Te(d)}${Te(p)}${Te(i)}${r<1?Te(r*255):""}`}var ba=e=>e?`#${Te(e.r)}${Te(e.g)}${Te(e.b)}`:"#000000",ha=(e,t,a)=>!!(e&&t&&Math.round(e.r)===Math.round(t.r)&&Math.round(e.g)===Math.round(t.g)&&Math.round(e.b)===Math.round(t.b)&&(!a||Math.abs(e.a-t.a)<.005)),va=e=>e==="hex"?"#000000":e==="rgb"?"rgb(0, 0, 0)":"hsl(0, 0%, 0%)";var qo=["byte","kilobyte","megabyte","gigabyte"];function Le(e,t){let a=0,r=e;for(;r>=1024&&a<qo.length-1;)r/=1024,a++;try{return new Intl.NumberFormat(t,{style:"unit",unit:qo[a],unitDisplay:"short",maximumFractionDigits:r<10?1:0}).format(r)}catch{return`${Math.round(r*10)/10} ${["B","KB","MB","GB"][a]}`}}function ka(e){let t=e.trim().toLowerCase();if(t.startsWith("."))return t.slice(1).toUpperCase();let a={"image/*":"images","video/*":"videos","audio/*":"audio","text/*":"text files"};if(a[t])return a[t];if(t==="application/pdf")return"PDF";let r=t.split("/")[1];return r?r.replace(/^(x-|vnd\.)/,"").toUpperCase():e}function wa(e){return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`}function Go(e,t){if(t.length===0)return!0;let a=e.name.toLowerCase(),r=e.type.toLowerCase();return t.some(d=>{let p=d.trim().toLowerCase();return p.startsWith(".")?a.endsWith(p):p.endsWith("/*")?r.startsWith(p.slice(0,-1)):r===p})}function Sa(e,t,a,r){let d=e.length?wa(e.map(ka)):"";return[d&&`Accepts ${d}.`,t&&`Up to ${Le(t,r)}${a?" each":""}.`].filter(Boolean).join(" ")}function za(e,t,a,r){if(a&&e.size>a)return`${e.name} is ${Le(e.size,r)}; the limit is ${Le(a,r)}.`;let d=t.length?wa(t.map(ka)):"";if(!Go(e,t))return`${e.name} isn't an accepted type${d?` (${d})`:""}.`}function Ca(e,t,a,r){if(typeof e!="number")return;let d=t??"increase",p=e>0?"up":e<0?"down":"unchanged",i=d==="none"||e===0?"neutral":e>0==(d==="increase")?"positive":"negative",n=G(Math.abs(e),a,r);return{text:`${e>0?"\u25B2":e<0?"\u25BC":"\u25A0"} ${n}`,spoken:p==="unchanged"?"unchanged":`${p} ${n}`,tone:i}}function Wo(e,t){return e>=1?{tone:"danger",hint:"full"}:t?.danger!==void 0&&e>=t.danger?{tone:"danger",hint:"nearly full"}:t?.warning!==void 0&&e>=t.warning?{tone:"warning",hint:"getting full"}:{}}function Ea(e,t,a,r,d,p){let i=typeof t=="number"?t:Number(t),n=a!==void 0?Number(a):void 0,l=n!==void 0&&Number.isFinite(n)&&n>0?n:void 0,c=Number.isFinite(i)?Math.max(0,Math.min(1,l!==void 0?i/l:i)):0,s=e.format?G(t,e.format,p):G(c,{type:"percent",precision:0},p),u=e.kind==="meter",x=u?Wo(c,e.thresholds):{},m=e.tone??x.tone,g=u?x.hint:void 0,f=[s,d,g].filter(Boolean).join(", "),y=Math.round(c*100),h=r?{"aria-busy":!0}:l!==void 0?{"aria-valuemin":0,"aria-valuemax":l,"aria-valuenow":Number.isFinite(i)?i:0,"aria-valuetext":f}:{"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":y,"aria-valuetext":f};return{fraction:c,percent:y,valueProps:h,readout:s,tone:m,hint:g,valuetext:f,indeterminate:r}}var Ma=e=>`${e} ${e===1?"star":"stars"}`,Aa=(e,t)=>e!==void 0?`${e} out of ${t}`:"not yet rated",Ia=e=>e.replace(/[^\s]/g,"\u2022"),ut={small:24,default:40,large:64};function Na(e,t){let a=p=>p.split(/\s+/)[0]||p,r=e.slice(0,t),d=e.slice(t);return d.length?`${r.map(p=>a(p.name)).join(", ")} and ${d.length} more`:r.map(p=>a(p.name)).join(", ")}var Ko=["primary","secondary","tertiary","success","warning"];function Ra(e){return Ko[[...e].reduce((t,a)=>t*31+a.charCodeAt(0)>>>0,7)%Ko.length]}function Ua(e,t){return(e&&e.length<=3?e:t.split(/\s+/).map(a=>a[0]).join("").slice(0,2)).toUpperCase()}var Ha=e=>e.length>3,Ta={search:"M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14zM21 21l-4.3-4.3",check:"M20 6 9 17l-5-5",info:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 16v-4M12 8h.01",lock:"M5 11h14v10H5zM8 11V7a4 4 0 0 1 8 0v4",trash:"M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6",clock:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 7v5l3 2",tag:"M20.6 13.4 13.4 20.6a2 2 0 0 1-2.8 0L3 13V3h10l7.6 7.6a2 2 0 0 1 0 2.8z",alert:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h16.9a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0zM12 9v4M12 17h.01",mail:"M3 5h18v14H3zM3 7l9 6 9-6",shield:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",book:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z",inbox:"M22 12h-6l-2 3h-4l-2-3H2M5.5 5h13L22 12v7H2v-7z",filter:"M3 5h18l-7 8v6l-4 2v-8z",close:"M18 6 6 18M6 6l12 12",dash:"M6 12h12",menu:"M4 6h16M4 12h16M4 18h16",home:"M4 11 12 4l8 7M6 10v10h12V10",settings:"M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6zM19.4 15a1.7 1.7 0 0 0 .3 1.8 2 2 0 1 1-2.8 2.8 1.7 1.7 0 0 0-2.9 1.2 2 2 0 1 1-4 0 1.7 1.7 0 0 0-2.9-1.2 2 2 0 1 1-2.8-2.8A1.7 1.7 0 0 0 2.1 14a2 2 0 1 1 0-4 1.7 1.7 0 0 0 1.2-2.9 2 2 0 1 1 2.8-2.8A1.7 1.7 0 0 0 9 3.1a2 2 0 1 1 4 0 1.7 1.7 0 0 0 2.9 1.2 2 2 0 1 1 2.8 2.8A1.7 1.7 0 0 0 21 10a2 2 0 1 1 0 4 1.7 1.7 0 0 0-1.6 1z",chart:"M4 20V10M10 20V4M16 20v-7M22 20H2",people:"M9 4.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7zM2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 7M18 14a6.5 6.5 0 0 1 3.5 6",card:"M2 6h20v13H2zM2 10h20",file:"M6 3h8l4 4v14H6zM14 3v4h4",dots:"M12 5h.01M12 12h.01M12 19h.01",sort:"M8 9l4-4 4 4M8 15l4 4 4-4",sortUp:"M12 19V5M6 11l6-6 6 6",sortDown:"M12 5v14M6 13l6 6 6-6",chevronLeft:"M15 5l-7 7 7 7",chevronRight:"M9 5l7 7-7 7",chevronDown:"m6 9 6 6 6-6",orders:"M6 3h12v18l-3-2-3 2-3-2-3 2zM9 8h6M9 12h6",products:"M12 3 3 7.5v9L12 21l9-4.5v-9zM3 7.5l9 4.5 9-4.5M12 12v9",customers:"M12 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM4 21a8 8 0 0 1 16 0",discounts:"M19 5 5 19M7.5 6a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM16.5 15a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z",analytics:"M3 17l5-6 4 3 5-7 4 4M3 21h18",calendar:"M4 6h16v14H4zM4 10h16M8 3v4M16 3v4",bell:"M6 16V11a6 6 0 0 1 12 0v5l2 2H4zM10 21h4",help:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.7.3-1 .9-1 1.7M12 17h.01",folder:"M3 6h6l2 2h10v11H3z",star:"m12 3 2.8 5.7 6.2.9-4.5 4.4 1.1 6.2L12 17.3 6.4 20.2l1.1-6.2L3 9.6l6.2-.9z",grid:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z",layers:"m12 3 9 5-9 5-9-5zM3 13l9 5 9-5M3 17l9 5 9-5"},Fa=e=>Ta[e]??Ta.info,$a={info:"info",success:"check",warning:"alert",error:"alert",empty:"inbox",undo:"check"},ft="M12 2.5l2.9 6.2 6.8.8-5 4.7 1.3 6.8L12 17.6 6 21l1.3-6.8-5-4.7 6.8-.8z";var Pa=(e,t)=>e&&typeof e=="object"&&"id"in e?e.id:t;function Ba(e,t){let a=e.layout??"auto";return{grid:a==="grid"||a==="auto"&&t?.component==="Card"&&!!t.media,timeline:a==="timeline",carousel:a==="carousel",calendar:a==="calendar"}}function ja(e,t){let a=e.map((d,p)=>p);if(!Array.isArray(t))return a;let r=d=>{let p=t.indexOf(e[d]);return p<0?t.length+d:p};return a.sort((d,p)=>r(d)-r(p))}function La(e,t,a,r){if(r<0||r>=e.length||a===r)return;let d=[...e];return d.splice(r,0,...d.splice(a,1)),d.map(p=>t[p])}function Da(e){if(e==null||e==="")return;let t=new Date(String(e));return Number.isNaN(t.getTime())?void 0:{y:t.getUTCFullYear(),m:t.getUTCMonth(),d:t.getUTCDate()}}var Va=(e,t,a=new Date)=>e??(t?{y:t.y,m:t.m}:{y:a.getUTCFullYear(),m:a.getUTCMonth()});function gt(e,t){let a=new Date(Date.UTC(e.y,e.m+t,1));return{y:a.getUTCFullYear(),m:a.getUTCMonth()}}function Oa(e,t){let a=new Intl.DateTimeFormat(t,{month:"long",year:"numeric",timeZone:"UTC"}).format(new Date(Date.UTC(e.y,e.m,1))),r=Array.from({length:7},(l,c)=>new Intl.DateTimeFormat(t,{weekday:"short",timeZone:"UTC"}).format(new Date(Date.UTC(2024,0,1+c)))),d=(new Date(Date.UTC(e.y,e.m,1)).getUTCDay()+6)%7,p=new Date(Date.UTC(e.y,e.m+1,0)).getUTCDate(),i=[...Array(d).fill(null),...Array.from({length:p},(l,c)=>c+1)];for(;i.length%7;)i.push(null);let n=Array.from({length:i.length/7},(l,c)=>i.slice(c*7,c*7+7));return{...e,monthName:a,weekdays:r,weeks:n}}function _a(e,t){let a=0;return e.forEach((r,d)=>{Math.abs(r-t)<Math.abs(e[a]-t)&&(a=d)}),a}function qa(e,t,a){let r=new Map;for(let d of e){if(!d.better||d.better==="none")continue;let p=Array.from({length:t},(n,l)=>Number(a(d.path,l))),i=d.better==="higher"?Math.max(...p):Math.min(...p);p.filter(n=>n===i).length===1&&r.set(d.key,p.indexOf(i))}return r}function Ga(e,t){let a=[];for(let r of e){let d=r.group!==void 0?t(r.group):void 0,p=a.find(i=>i.label===d);p?p.attributes.push(r):a.push({label:d,attributes:[r]})}return a}function Wa(e,t){let a=e.map((d,p)=>p),r=a.findIndex(d=>e[d]===t);return r>0&&a.unshift(...a.splice(r,1)),a}function Ka(e,t){let a=[];for(let r of e){let d=r.group!==void 0?t(r.group):void 0,p=a.find(i=>i.label===d);p?p.items.push(r):a.push({label:d,items:[r]})}return a}var Xa=e=>e==="breadcrumb"?"Breadcrumb":e==="toc"?"On this page":"Main";var Q={top:16,right:16,bottom:32,left:56},De=["circle","square","diamond","triangle","circle","square"],ee=e=>`var(--pxd-color-data-categorical-${e%6+1})`;function Ve(e){if(e<=0)return 1;let t=10**Math.floor(Math.log10(e));return Math.ceil(e/t)*t}function mt(e,t,a){if(t==="date"||t==="datetime"){let r=new Date(String(e));if(!Number.isNaN(r.getTime())){let d=r.getUTCDate()===1?{month:"short",timeZone:"UTC"}:{month:"short",day:"numeric",timeZone:"UTC"};return new Intl.DateTimeFormat(a,d).format(r)}}return String(e??"").slice(0,12)}function Ya(e,t){if(e.length<2)return 1;let a=Math.max(...e.map(r=>r.length))*7+8;return Math.max(1,Math.ceil(a/(t/e.length)))}function Ja(e,t,a){let r=e.reduce((x,m)=>x+m,0),d=e.map(()=>null);if(r<=0)return d;let p=e.map((x,m)=>m).filter(x=>e[x]>0).sort((x,m)=>e[m]-e[x]),i=x=>e[x]/r*t*a,n=0,l=0,c=t,s=a,u=0;for(;u<p.length&&c>0&&s>0;){let x=c>=s,m=x?s:c,g=[],f=0,y=1/0;for(;u<p.length;){let A=[...g,p[u]],C=f+i(p[u]),I=C/m,E=Math.max(...A.map(F=>{let $=i(F)/I;return Math.max($/I,I/$)}));if(E>y&&g.length)break;g=A,f=C,y=E,u++}let h=f/m,k=0;for(let A of g){let C=i(A)/h;d[A]=x?{x:n,y:l+k,w:h,h:C}:{x:n+k,y:l,w:C,h},k+=C}x?(n+=h,c-=h):(l+=h,s-=h)}return d}function Za(e,t){let a=Ve(Math.max(0,...e)),r=t?Math.min(0,...e):0,d=t&&e.length?Math.max(r,Math.min(...e)-(Math.max(...e)-Math.min(...e))*.2):r,p=t?Math.floor(d):0;return{lo:p,max:a,ticks:[0,.5,1].map(i=>p+(a-p)*i)}}function Qa(e,t,a){return e==="square"?{tag:"rect",attrs:{x:t-4,y:a-4,width:8,height:8}}:e==="diamond"?{tag:"path",attrs:{d:`M${t} ${a-5}L${t+5} ${a}L${t} ${a+5}L${t-5} ${a}Z`}}:e==="triangle"?{tag:"path",attrs:{d:`M${t} ${a-5}L${t+5} ${a+4}L${t-5} ${a+4}Z`}}:{tag:"circle",attrs:{cx:t,cy:a,r:4}}}function eo(e,t,a){let r=e.map(x=>x.reduce((m,g)=>m+g,0)),d=Array.from({length:t},(x,m)=>e.reduce((g,f)=>g+f[m],0)),p=r.reduce((x,m)=>x+m,0)||1,i=6,l=(a-i*(Math.max(e.length,t)-1))/p,c=[],s=[],u=0;return r.forEach(x=>(c.push(u),u+=x*l+i)),u=0,d.forEach(x=>(s.push(u),u+=x*l+i)),{leftY:c,rightY:s,leftTotals:r,rightTotals:d,scale:l}}var yt=200,to=10,ao=500,Sd=e=>e==null?"":String(e);function oo(e,t,a,r){let d=[],p=new Map,i=[],n=(s,u)=>r?r.has(s):u===1,l=(s,u,x,m)=>{s.forEach((g,f)=>{let y={pointer:K(u,f)},h=Sd(_(t,O(e.labelPath,y))),k=e.valuePath?_(t,O(e.valuePath,y)):h,A=k??(h||y.pointer),C=e.detailPath?_(t,O(e.detailPath,y)):void 0,I=C==null||C===""?void 0:String(C),E=Z(_(t,O(e.childrenPath,y)));x===1&&i.push(A);let F=E.length>0,$=F&&n(A,x),T=d.length;p.set(y.pointer,T),d.push({key:y.pointer,scope:y,level:x,setsize:s.length,posinset:f+1,label:h,value:A,detail:I,hasChildren:F,expanded:$,parent:m}),$&&l(E,O(e.childrenPath,y),x+1,T)})},c=O(e.items.path,a);return l(Z(_(t,c)),c,1,-1),{rows:d,indexByKey:p,topValues:i}}function ro(e,t,a){let r=i=>{for(let n=1;n<=e.length;n++){let l=(t+n)%e.length;if(e[l].label.toLowerCase().startsWith(i))return l}return-1},d=a.length>1&&[...a].every(i=>i===a[0]),p=r(d?a[0]:a);return p<0&&a.length>1&&(p=r(a[0])),p}function io(e,t,a){let r=e[t];if(r)switch(a.key){case"ArrowDown":return{focus:Math.min(e.length-1,t+1)};case"ArrowUp":return{focus:Math.max(0,t-1)};case"ArrowRight":return r.hasChildren&&!r.expanded?{toggle:!0}:r.expanded?{focus:Math.min(e.length-1,t+1)}:void 0;case"ArrowLeft":return r.expanded?{toggle:!0}:r.parent>=0?{focus:r.parent}:void 0;case"Home":return{focus:0};case"End":return{focus:e.length-1};case"Enter":return{activate:!0};case" ":return{select:!0};case"*":return{expandSiblings:!0};default:return a.key.length===1&&!a.ctrlKey&&!a.metaKey&&!a.altKey?{typeAhead:a.key}:void 0}}function po(e,t,a,r){return e<=yt?{start:0,end:e}:{start:Math.max(0,Math.floor(t/a)-to),end:Math.min(e,Math.ceil((t+r)/a)+to)}}function no(e,t,a,r,d){let p=[];for(let i of e){if(!ge(i.value))continue;let n=i.value,l=W(i.value,t,a),c=d(i.label),s=u=>G(u,X(i.format??{type:"number"},t,a),r);switch(i.component){case"Choice":{let u=Se(i,t,a,d),x=m=>u.find(g=>g.value===m)?.label??String(m);if(Array.isArray(l))for(let m of l)p.push({key:`${i.id}:${m}`,label:x(m),binding:n,cleared:l.filter(g=>g!==m)});else l!=null&&l!==""&&p.push({key:i.id,label:x(l),binding:n,cleared:null});break}case"RangeInput":{if(i.mode==="range"&&Array.isArray(l)){let[u,x]=l.map(Number);(u>i.min||x<i.max)&&p.push({key:i.id,label:`${c}: ${s(u)} \u2013 ${s(x)}`,binding:n,cleared:[i.min,i.max]})}else typeof l=="number"&&l<i.max&&p.push({key:i.id,label:`${c}: ${s(l)}`,binding:n,cleared:i.max});break}case"Toggle":l===!0&&p.push({key:i.id,label:c,binding:n,cleared:!1});break;case"TextInput":typeof l=="string"&&l.trim()&&p.push({key:i.id,label:`${c}: ${l}`,binding:n,cleared:""});break;case"DateInput":l&&p.push({key:i.id,label:`${c}: ${String(l)}`,binding:n,cleared:null});break}}return p}var lo=640,so=(e,t)=>e===void 0?void 0:`${G(e,{type:"number"},t)} ${e===1?"result":"results"}`;var Xo=[[10,[[1,16]]],[16,[[1,28]]],[26,[[1,44]]],[18,[[2,32]]],[24,[[2,43]]],[16,[[4,27]]],[18,[[4,31]]],[22,[[2,38],[2,39]]],[22,[[3,36],[2,37]]],[26,[[4,43],[1,44]]]],zd=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50]];function co(e,t){let a=0;for(let r=7;r>=0;r--)a=a<<1^(a>>>7)*285,a^=(t>>>r&1)*e;return a&255}function Cd(e,t){let a=new Array(t).fill(0);a[t-1]=1;let r=1;for(let p=0;p<t;p++){for(let i=0;i<t;i++)a[i]=co(a[i],r),i+1<t&&(a[i]^=a[i+1]);r=co(r,2)}let d=new Array(t).fill(0);for(let p of e){let i=p^d.shift();d.push(0),a.forEach((n,l)=>d[l]^=co(n,i))}return d}var Ed=[(e,t)=>(e+t)%2===0,(e,t)=>t%2===0,e=>e%3===0,(e,t)=>(e+t)%3===0,(e,t)=>(Math.floor(e/3)+Math.floor(t/2))%2===0,(e,t)=>e*t%2+e*t%3===0,(e,t)=>(e*t%2+e*t%3)%2===0,(e,t)=>((e+t)%2+e*t%3)%2===0];function xo(e){let t=Array.from(new TextEncoder().encode(e)),a=0,r=0;for(let v=1;v<=10&&!a;v++){let w=Xo[v-1][1].reduce((N,[z,M])=>N+z*M,0);4+(v<10?8:16)+t.length*8<=w*8&&(a=v,r=w)}if(!a)return;let[d,p]=Xo[a-1],i=[],n=(v,w)=>{for(let N=w-1;N>=0;N--)i.push(v>>>N&1)};n(4,4),n(t.length,a<10?8:16);for(let v of t)n(v,8);let l=r*8;for(n(0,Math.min(4,l-i.length));i.length%8;)i.push(0);for(let v=236;i.length<l;v^=253)n(v,8);let c=[];for(let v=0;v<i.length;v+=8)c.push(i.slice(v,v+8).reduce((w,N)=>w<<1|N,0));let s=[],u=0;for(let[v,w]of p)for(let N=0;N<v;N++){let z=c.slice(u,u+w);s.push({d:z,e:Cd(z,d)}),u+=w}let x=[],m=Math.max(...s.map(v=>v.d.length));for(let v=0;v<m;v++)for(let w of s)v<w.d.length&&x.push(w.d[v]);for(let v=0;v<d;v++)for(let w of s)x.push(w.e[v]);let g=a*4+17,f=Array.from({length:g},()=>new Array(g).fill(!1)),y=Array.from({length:g},()=>new Array(g).fill(!1)),h=(v,w,N)=>{v>=0&&w>=0&&v<g&&w<g&&(f[w][v]=N,y[w][v]=!0)};for(let v=0;v<g;v++)h(6,v,v%2===0),h(v,6,v%2===0);let k=(v,w)=>{for(let N=-4;N<=4;N++)for(let z=-4;z<=4;z++){let M=Math.max(Math.abs(z),Math.abs(N));h(v+z,w+N,M!==2&&M!==4)}};k(3,3),k(g-4,3),k(3,g-4);let A=zd[a-1],C=A.length-1;A.forEach((v,w)=>A.forEach((N,z)=>{if(!(w===0&&z===0||w===0&&z===C||w===C&&z===0))for(let M=-2;M<=2;M++)for(let S=-2;S<=2;S++)h(v+S,N+M,Math.max(Math.abs(S),Math.abs(M))!==1)}));let I=v=>{let w=v,N=w;for(let S=0;S<10;S++)N=N<<1^(N>>>9)*1335;let z=(w<<10|N)^21522,M=S=>(z>>>S&1)===1;for(let S=0;S<=5;S++)h(8,S,M(S));h(8,7,M(6)),h(8,8,M(7)),h(7,8,M(8));for(let S=9;S<15;S++)h(14-S,8,M(S));for(let S=0;S<8;S++)h(g-1-S,8,M(S));for(let S=8;S<15;S++)h(8,g-15+S,M(S));h(8,g-8,!0)};if(I(0),a>=7){let v=a;for(let N=0;N<12;N++)v=v<<1^(v>>>11)*7973;let w=a<<12|v;for(let N=0;N<18;N++){let z=(w>>>N&1)===1,M=g-11+N%3,S=Math.floor(N/3);h(M,S,z),h(S,M,z)}}let E=0;for(let v=g-1;v>=1;v-=2){v===6&&(v=5);for(let w=0;w<g;w++)for(let N=0;N<2;N++){let z=v-N,M=(v+1&2)===0?g-1-w:w;!y[M][z]&&E<x.length*8&&(f[M][z]=(x[E>>>3]>>>7-(E&7)&1)===1,E++)}}let F=v=>{for(let w=0;w<g;w++)for(let N=0;N<g;N++)!y[w][N]&&Ed[v](N,w)&&(f[w][N]=!f[w][N])},$=()=>{let v=0,w=M=>{let S=0,P=null;M.forEach((V,j)=>{if(V===P?(S++,S===5?v+=3:S>5&&(v+=1)):(P=V,S=1),j+7<=M.length){let B=M.slice(j,j+7),H=B[0]&&!B[1]&&B[2]&&B[3]&&B[4]&&!B[5]&&B[6],L=j>=4&&M.slice(j-4,j).every(R=>!R),U=j+11<=M.length&&M.slice(j+7,j+11).every(R=>!R);H&&(L||U)&&(v+=40)}})};for(let M=0;M<g;M++)w(f[M]),w(f.map(S=>S[M]));for(let M=0;M<g-1;M++)for(let S=0;S<g-1;S++)f[M][S]===f[M][S+1]&&f[M][S]===f[M+1][S]&&f[M][S]===f[M+1][S+1]&&(v+=3);let N=f.flat().filter(Boolean).length,z=g*g;return v+=(Math.ceil(Math.abs(N*20-z*10)/z)-1)*10,v},T=0,b=1/0;for(let v=0;v<8;v++){I(v),F(v);let w=$();F(v),w<b&&(b=w,T=v)}return I(T),F(T),f}var uo="More actions";function fo(e,t){for(let a=e.length-1;a>0;a--)if(t.get(e[a])?.component!=="Action")return a+1;return 1}function go(e,t,a,r,d,p){if(e.length<=2)return e.length;let i=0,n=0;for(;n<e.length&&i+(n?a:0)+t(e[n])<=r;)i+=(n?a:0)+t(e[n++]);if(n<e.length){for(;n>p&&i+a+d>r;)i-=a+t(e[--n]);n=Math.max(n,p)}return n}function Je(e){let t=e.filter(r=>r.tone!=="danger"),a=e.filter(r=>r.tone==="danger");return{usual:t,danger:a,divider:a.length>0&&t.length>0}}function mo(e,t={}){let a=t.data??e.data??{},r=new Set,d=t.locale??"en-GB",p=()=>r.forEach(n=>n(a)),i={document:e,byId:We(e),get data(){return a},locale:d,setValue(n,l){let c=rt(a,n,l);t.events?.edited(n),a=t.derive?.(c)??c,t.onDataChange?.(a),p()},replaceData(n){a=n,p()},dispatch:(n,l,c)=>oa(n,l,c,a,t),subscribe(n){return r.add(n),()=>r.delete(n)},resolve:(n,l=de)=>W(n,a,l),text(n,l,c=de){let s=W(n,a,c);return l?G(s,X(l,a,c),d):s==null?"":String(s)},pointer:(n,l=de)=>O(n.path,l),write:(n,l,c=de)=>i.setValue(O(n.path,c),l),context:(n,l=de)=>we(n,a,l),visible:(n,l=de)=>n.visible===void 0||W(n.visible,a,l)!==!1};return i}function yo(e,t){let a={"data-pxd-id":e.id,"data-pxd-component":e.component},r=e.accessibility;return r?{...a,"aria-label":r.label!==void 0?t(r.label):void 0,"aria-description":r.description!==void 0?t(r.description):void 0,"aria-live":r.live,"aria-hidden":r.hidden||void 0}:a}var Md=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,bt=e=>typeof e=="string"&&Md.test(e)?e:void 0,Ad=[["valueMissing","required"],["typeMismatch","type"],["patternMismatch","pattern"],["tooShort","too-short"],["tooLong","too-long"],["rangeUnderflow","too-low"],["rangeOverflow","too-high"],["stepMismatch","step"],["badInput","bad-input"],["customError","custom"]];function ho(e){for(let[t,a]of Ad)if(e?.[t])return a;return"invalid"}function vo(e,t){return t&&e.size>t?"file-too-large":"file-type"}function Id(){let e=globalThis.crypto;return e?.randomUUID?e.randomUUID():`s_${Date.now().toString(36)}${Math.random().toString(36).slice(2,10)}`}function Nd(){return{kind:globalThis.navigator?.webdriver===!0?"agent":"human"}}function bo(e,t){return e?{id:e.id,...typeof e.key=="string"?{key:e.key}:{},type:e.component}:{id:t}}function Yo(e,t){let a=e?t.get(e):void 0;return a?a.component==="ActionBar"?(a.children??[]).flatMap(r=>Yo(r,t)):[a.id]:[]}function Td(e,t){if(!e)return!1;let r=(e.component==="Form"?e.submit:e.component==="Confirm"?e.confirm:e.component==="Steps"?e.finish:void 0)?.action;if(!r)return!1;if(r===t)return!0;let d=e.cancel?.action;return r.event.name===t.event.name&&d?.event?.name!==t.event.name}function ko(e,t,a={}){let r=a.now??Date.now,d=a.sessionId??Id(),p=a.actor?{kind:a.actor.kind==="agent"?"agent":"human",...typeof a.actor.assistiveTech=="boolean"?{assistiveTech:a.actor.assistiveTech}:{}}:Nd(),i=We(e),n=e.surface,l=a.journey?.id??n.journey,c={id:n.id,intent:n.intent??n.id,...n.pattern?{pattern:n.pattern}:{},...l?{journey:l}:{},...e.specVersion?{specVersion:e.specVersion}:{},...a.generator?{generator:a.generator}:{},...a.direction?{direction:a.direction}:{},...a.experiment?{experiment:Object.fromEntries(Object.entries(a.experiment).filter(([,b])=>typeof b=="string"))}:{}},s=n.kind==="shell",u=new Set(e.components.filter(b=>b.component==="Status"&&b.kind==="undo").flatMap(b=>Yo(b.action,i))),x=new Map((a.journey?.checkpoints??[]).filter(b=>b.event).map(b=>[b.event,b.key])),m=a.journey?.done?.event,g,f=0,y,h=!1,k=!1,A=!1,C=!1,I=new Set,E=(b,v={})=>{b!=="surface.shown"&&g===void 0&&T();let w=r(),N={type:b,timestamp:new Date(w).toISOString(),sessionId:d,surface:c,actor:p,...v};b==="surface.shown"?g=w:(N.durationMs=Math.max(0,Math.round(w-(g??w))),N.steps=f);try{t(N)}catch{}},F=b=>bo(i.get(b),b),$=b=>{A||(A=!0,!(b==="unmount"&&(h||k))&&(E("surface.dismissed",{reason:b}),!s&&f>0&&!h&&!k&&E("task.abandoned",{reason:b})))};function T(){g===void 0&&E("surface.shown")}return{sessionId:d,shown(){C=!1,T()},action(b,v){if(!b?.event?.name)return;T();let w=b.event.name,N=i.get(v);if(w==="ui.dismiss"){N&&(N.component==="Panel"||N.component==="Confirm")&&e.root!==N.id||$("dismiss");return}f++,y=void 0;let z=F(v);E("action.taken",{component:z,capability:w});let M=x.get(w);M!==void 0&&!I.has(M)&&(I.add(M),k=!0,E("checkpoint.reached",{component:z,capability:w,checkpoint:M}));let S=Td(N,b);(s?!1:m!==void 0?w===m:S)&&!h?(h=!0,E("task.completed",{component:z,capability:w})):S&&!s&&(k=!0),u.has(v)&&E("undo",{component:z,capability:w})},edited(b){b!==y&&(y=b,f++)},inputError(b,v){let w=typeof b=="string"?i.get(b):b,N=typeof b=="string"?b:b.id;E("input.error",{component:bo(w,N),reason:bt(v)??"invalid"})},statusShown(b){let v=bt(b.kind);E("status.shown",{component:bo(b,b.id),...v?{reason:v}:{}})},feedback(b,v){if(b!==-1&&b!==0&&b!==1)return;let w=bt(v);E("feedback",{rating:b,...w?{reason:w}:{}})},regenerated(b){if(A)return;A=!0;let v=bt(b);E("surface.regenerated",v?{reason:v}:{})},unmounted(b=!0){if(!A){if(!b)return C=!1,$("unmount");C||(C=!0,queueMicrotask(()=>{C&&$("unmount"),C=!1}))}}}}var Rd="http://www.w3.org/2000/svg",tr=new Set(["svg","path","circle","rect","line","polyline","polygon","g","text"]),Ud=new Set(["value","checked","selected","indeterminate","textContent"]),Hd=new Set(["list","form","type","autocomplete","for","role","tabindex","lang","dir","translate","spellcheck","autocapitalize","autocorrect","inputmode","enterkeyhint","colspan","rowspan","scope","title","width","height","size","min","max","step","pattern","placeholder","maxlength","minlength","accept","alt","src","href","rel","poster","controls","name","contenteditable","draggable","autofocus"]);function o(e,t,...a){let r=t??{};return{tag:e,props:r,children:a,key:r.key}}var Oe=(e,t)=>({dom:e,key:t}),Re=e=>!!e&&typeof e=="object"&&"dom"in e;function ht(e,t=[]){for(let a of e)a==null||a===!1||(Array.isArray(a)?ht(a,t):typeof a=="number"?t.push(String(a)):t.push(a));return t}function Fd(e,t,a){if(typeof t=="string"){e.style.cssText=t;return}let r=t??{},d=typeof a=="object"&&a||{};for(let p of Object.keys(d))p in r||(p.startsWith("--")?e.style.removeProperty(p):e.style[p]="");for(let[p,i]of Object.entries(r))i==null?p.startsWith("--")?e.style.removeProperty(p):e.style[p]="":p.startsWith("--")?e.style.setProperty(p,String(i)):e.style[p]=typeof i=="number"&&!/^(opacity|zIndex|flex|lineHeight|fontWeight|order)$/.test(p)?`${i}px`:String(i)}function wo(e,t,a,r,d){if(t==="key"||t==="children")return;if(t==="ref"){e.__ref=a;return}if(t.startsWith("on")&&(typeof a=="function"||a===void 0)){let i=t.slice(2).toLowerCase(),n=e.__on??={};a&&!n[i]&&e.addEventListener(i,l=>e.__on?.[i]?.(l)),a?n[i]=a:delete n[i];return}if(t==="style")return Fd(e,a,r);if(t==="class"||t==="className"){let i=a==null||a===!1?"":String(a);d?i?e.setAttribute("class",i):e.removeAttribute("class"):e.className!==i&&(e.className=i);return}let p=t.toLowerCase();if(!d&&Ud.has(t)){let i=a??(typeof e[t]=="boolean"?!1:"");e[t]!==i&&(e[t]=i);return}if(!d&&!t.includes("-")&&!Hd.has(p)&&t in e&&typeof e[t]!="function"&&typeof e[t]=="boolean"){e[t]=!!a;return}a==null||a===!1&&!t.startsWith("aria-")?e.removeAttribute(p==="classname"?"class":t):e.setAttribute(t,a===!0?t.startsWith("aria-")||t==="draggable"||t==="contenteditable"?"true":"":String(a))}function ar(e,t){if(typeof e=="string"){let d=document.createTextNode(e);return d.__vnode=e,d}if(Re(e))return e.dom.__vnode=e,e.dom;let a=t||tr.has(e.tag),r=a?document.createElementNS(Rd,e.tag):document.createElement(e.tag);for(let[d,p]of Object.entries(e.props))wo(r,d,p,void 0,a);for(let d of ht(e.children))r.appendChild(ar(d,a));return r.__vnode=e,r}function or(e){let t=e;if(t.nodeType===1){t.__ref?.(t);for(let a of Array.from(t.childNodes))(!a.__vnode||!Re(a.__vnode))&&or(a)}}function So(e){let t=e;if(t.nodeType===1&&!Re(t.__vnode)){t.__ref?.(null);for(let a of Array.from(t.childNodes))So(a)}}var Ze=e=>e&&typeof e=="object"?e.key:void 0,er=(e,t)=>e!==void 0&&typeof e==typeof t&&(typeof e=="string"||(Re(e)?Re(t)&&e.dom===t.dom:!Re(t)&&e.tag===t.tag&&Ze(e)===Ze(t)));function $d(e,t,a){let r=e,d=r.__vnode;if(typeof t=="string"){e.textContent!==t&&(e.textContent=t),r.__vnode=t;return}if(Re(t))return;let p=d?.props??{},i=a||tr.has(t.tag);for(let n of Object.keys(p))n in t.props||wo(r,n,void 0,p[n],i);for(let[n,l]of Object.entries(t.props))(n==="style"||n==="ref"||p[n]!==l)&&wo(r,n,l,p[n],i);r.__vnode=t,rr(r,ht(t.children),i)}function rr(e,t,a){let r=Array.from(e.childNodes),d=new Map;for(let n of r){let l=Ze(n.__vnode);l!==void 0&&d.set(l,n)}let p=new Set,i=r[0]??null;for(let n of t){let l=Ze(n),c;if(l!==void 0?c=d.get(l):i&&!p.has(i)&&Ze(i.__vnode)===void 0&&er(i.__vnode,n)&&(c=i),c&&er(c.__vnode,n))p.add(c),c!==i?e.insertBefore(c,i):i=i.nextSibling??null,$d(c,n,a);else{let s=ar(n,a);e.insertBefore(s,i),or(s)}}for(let n of r)p.has(n)||(So(n),n.remove())}function zo(e,t){rr(e,ht(t),!1)}function Co(e){for(let t of Array.from(e.childNodes))So(t),t.remove()}var ir=e=>e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function xe(e,...t){let{checked:a,onCheckedChange:r,indicator:d,...p}=e,i=a==="indeterminate"?"indeterminate":a?"checked":"unchecked";return o("button",{type:"button",role:"checkbox","aria-checked":a==="indeterminate"?"mixed":a,"data-state":i,value:"on",...p,onClick:()=>r(a==="indeterminate"?!0:!a)},i!=="unchecked"?d:null,...t)}function Ce(e,...t){let{value:a,onValueChange:r,orientation:d,...p}=e;return o("div",{role:"radiogroup","aria-orientation":d,dir:"ltr",tabindex:"0",style:{outline:"none"},...p,"data-value":a,onKeydown:l=>{let c=l.currentTarget,s=Array.from(c.querySelectorAll('[role="radio"]:not(:disabled)')),u=s.indexOf(document.activeElement);if(u<0||!s.length)return;let x=l.key==="ArrowDown"||l.key==="ArrowRight",m=l.key==="ArrowUp"||l.key==="ArrowLeft";if(!x&&!m)return;l.preventDefault();let g=s[(u+(x?1:s.length-1))%s.length];g.focus(),g.click()},onFocus:l=>{let c=l.currentTarget;if(l.target!==c)return;let s=Array.from(c.querySelectorAll('[role="radio"]:not(:disabled)'));(s.find(u=>u.getAttribute("aria-checked")==="true")??s[0])?.focus()},onFocusin:l=>l.currentTarget.tabIndex=-1,onFocusout:l=>{let c=l.currentTarget;c.contains(l.relatedTarget)||(c.tabIndex=0)}},...t)}function Ue(e,...t){let{value:a,group:r,first:d,onSelect:p,indicator:i,...n}=e,l=r===a;return o("button",{type:"button",role:"radio","aria-checked":l,"data-state":l?"checked":"unchecked",value:a,tabindex:l||r===""&&d?"0":"-1",...n,onClick:()=>!l&&p()},l?i:null,...t)}function pr(e){let{checked:t,onCheckedChange:a,...r}=e,d=t?"checked":"unchecked";return o("button",{type:"button",role:"switch","aria-checked":t,"data-state":d,value:"on",...r,onClick:()=>a(!t)},o("span",{"data-state":d,class:"pxd-switch-thumb"}))}var dr=20;function Eo(e){let{min:t,max:a,step:r}=e,d=a-t||1,p=f=>(f-t)/d*100,i=f=>Math.min(a,Math.max(t,f)),n=f=>i(t+Math.round((f-t)/r)*r),l=(f,y)=>{let h=[...e.values];h[f]=n(y);let k=(e.minStepsBetweenThumbs??0)*r;h.length===2&&(f===0?h[0]=Math.min(h[0],h[1]-k):h[1]=Math.max(h[1],h[0]+k)),e.onValueChange(h)},c=f=>y=>{let h=e.values[f],k=r*10,A=y.key==="ArrowRight"||y.key==="ArrowUp"?h+r:y.key==="ArrowLeft"||y.key==="ArrowDown"?h-r:y.key==="PageUp"?h+k:y.key==="PageDown"?h-k:y.key==="Home"?t:y.key==="End"?a:void 0;A!==void 0&&(y.preventDefault(),l(f,A))},s=f=>{if(f.pointerType==="mouse"&&f.button!==0)return;let y=f.currentTarget,h=y.querySelector(".pxd-slider-track"),k=F=>{let $=h.getBoundingClientRect();return t+Math.min(1,Math.max(0,(F-$.left)/($.width||1)))*d},A=k(f.clientX),C=0;e.values.forEach((F,$)=>{Math.abs(F-A)<Math.abs(e.values[C]-A)&&(C=$)}),f.preventDefault(),y.querySelectorAll('[role="slider"]')[C]?.focus(),l(C,A);let I=F=>l(C,k(F.clientX)),E=()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",E)};document.addEventListener("pointermove",I),document.addEventListener("pointerup",E)},u=p(e.values[0]),x=p(e.values[e.values.length-1]),m=e.values.length===1?{left:"0%",right:`${100-x}%`}:{left:`${u}%`,right:`${100-x}%`},g=f=>dr/2-f/50*(dr/2);return o("span",{dir:"ltr","data-orientation":"horizontal",class:"pxd-slider",style:{"--radix-slider-thumb-transform":"translateX(-50%)"},onPointerdown:s},o("span",{"data-orientation":"horizontal",class:"pxd-slider-track"},o("span",{"data-orientation":"horizontal",class:"pxd-slider-range",style:m})),...e.values.map((f,y)=>o("span",{key:y,style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",left:`calc(${p(f)}% + ${g(p(f))}px)`}},o("span",{role:"slider","aria-label":e.thumbs[y]?.["aria-label"],"aria-labelledby":e.thumbs[y]?.["aria-labelledby"],"aria-valuemin":t,"aria-valuenow":f,"aria-valuemax":a,"aria-valuetext":e.thumbs[y]?.["aria-valuetext"],"aria-orientation":"horizontal","data-orientation":"horizontal",tabindex:"0",class:"pxd-slider-thumb",onKeydown:c(y)}))))}function nr(e){let t=a=>{let r=a.currentTarget,d=Array.from(r.querySelectorAll('[role="tab"]')),p=d.indexOf(document.activeElement);if(p<0)return;let i=a.key==="ArrowRight"?(p+1)%d.length:a.key==="ArrowLeft"?(p+d.length-1)%d.length:a.key==="Home"?0:a.key==="End"?d.length-1:-1;i<0||(a.preventDefault(),d[i].focus(),d[i].click())};return o("div",{dir:"ltr","data-orientation":"horizontal",class:e.rootClass,...e.rootProps??{}},o("div",{role:"tablist","aria-orientation":"horizontal",class:e.listClass,tabindex:"-1","data-orientation":"horizontal",style:{outline:"none"},onKeydown:t},...e.tabs.map(a=>{let r=a.key===e.value;return o("button",{key:a.key,type:"button",role:"tab","aria-selected":r,"aria-controls":`${e.id}-content-${a.key}`,"data-state":r?"active":"inactive",id:`${e.id}-trigger-${a.key}`,tabindex:r?"0":"-1","data-orientation":"horizontal",class:e.tabClass,onClick:()=>e.onValueChange(a.key)},...a.label)})),...e.tabs.map(a=>{let r=a.key===e.value;return o("div",{key:a.key,"data-state":r?"active":"inactive","data-orientation":"horizontal",role:"tabpanel","aria-labelledby":`${e.id}-trigger-${a.key}`,id:`${e.id}-content-${a.key}`,tabindex:"0",class:e.panelClass,hidden:!r,style:{animationDuration:"0s"}},r?a.content:null)}))}function ue(e,...t){let a=e.dismissible!==!1;e.ctx.r.modals++;let r=p=>{let i=p;if(i&&!i.open)try{i.showModal()}catch{i.setAttribute("open","")}e.ref?.(i)},d=p=>{p.open&&p.close(),e.onClose()};return[o("div",{key:`${e.id}-overlay`,"data-state":"open",class:e.overlayClass??"pxd-overlay","aria-hidden":"true",style:{pointerEvents:"auto"}}),o("dialog",{key:e.id,role:e.role??"dialog","data-state":"open",class:e.class,tabindex:"-1","data-pxd-modal":"",...e.props??{},ref:r,onCancel:p=>{p.preventDefault(),a&&d(p.currentTarget)},onClick:p=>{let i=p.currentTarget;if(p.target!==i)return;let n=i.getBoundingClientRect();!(p.clientX>=n.left&&p.clientX<=n.right&&p.clientY>=n.top&&p.clientY<=n.bottom)&&a&&d(i)},onClose:()=>e.onClose()},...t)]}var ye=(e,t,...a)=>o("button",{type:"button",...t,onClick:r=>{let d=r.currentTarget.closest("dialog");d?.open&&d.close(),e()}},...a),be=()=>({open:!1,x:0,y:0,align:"end"});function _e(e,t,a,r,d){let p=(i,n)=>{let l=i.getBoundingClientRect();a({open:!0,x:r==="end"?l.right:l.left,y:l.bottom+4,keyboard:n,align:r})};return{id:`${e}-trigger`,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":t.open?`${e}-content`:void 0,"data-state":t.open?"open":"closed",...d,onPointerdown:i=>{i.button!==0||i.ctrlKey||(i.preventDefault(),t.open?a(be()):p(i.currentTarget,!1))},onKeydown:i=>{(i.key==="Enter"||i.key===" "||i.key==="ArrowDown")&&(i.preventDefault(),p(i.currentTarget,!0))}}}function He(e,t,a,r,d,p){if(!a.open)return;let i=(s=!0)=>{r(be()),s&&(document.getElementById(`${t}-trigger`)??e.r.root?.querySelector(`[data-pxd-menu-trigger="${t}"]`))?.focus()},n=s=>{let u=s.currentTarget,x=Array.from(u.querySelectorAll('[role="menuitem"]:not([data-disabled])')),m=x.indexOf(document.activeElement);if(s.key==="Escape")return s.preventDefault(),i();if(s.key==="Tab")return i(!1);let g=s.key==="ArrowDown"?(m+1)%x.length:s.key==="ArrowUp"?(m+x.length-1)%x.length:s.key==="Home"?0:s.key==="End"?x.length-1:-1;g>=0&&x.length&&(s.preventDefault(),x[g].focus())},l=null,c=s=>{if(!s){l&&document.removeEventListener("pointerdown",l,!0),l=null;return}let u=s,x=u.getBoundingClientRect(),m=u.parentElement,g=a.align==="end"?Math.max(8,a.x-x.width):Math.min(a.x,window.innerWidth-x.width-8),f=a.y+x.height>window.innerHeight?Math.max(8,a.y-x.height-8):a.y;m.style.transform=`translate(${Math.round(g)}px, ${Math.round(f)}px)`;let y=u.querySelector('[role="menuitem"]:not([data-disabled])');(a.keyboard&&y?y:u).focus({preventScroll:!0}),l=h=>{!u.contains(h.target)&&!h.target.closest?.(`#${CSS.escape(`${t}-trigger`)}`)&&i(!1)},document.addEventListener("pointerdown",l,!0)};e.portal(o("div",{key:`${t}-menu`,"data-radix-popper-content-wrapper":"",style:{position:"fixed",left:"0px",top:"0px",minWidth:"max-content",zIndex:12}},o("div",{role:"menu","aria-orientation":"vertical","data-state":"open",dir:"ltr",id:`${t}-content`,"aria-labelledby":`${t}-trigger`,tabindex:"-1",style:{outline:"none"},...p,ref:c,onKeydown:n},...d.map((s,u)=>s==="separator"?o("div",{key:`sep-${u}`,role:"separator","aria-orientation":"horizontal",class:"pxd-menu-separator"}):o("div",{key:s.key,role:"menuitem",class:s.class,tabindex:"-1","data-orientation":"vertical","aria-disabled":s.disabled||void 0,"data-disabled":s.disabled?"":void 0,...s.props??{},onPointermove:x=>{x.currentTarget.focus()},onFocus:x=>{for(let m of x.currentTarget.parentElement.querySelectorAll("[data-highlighted]"))m.removeAttribute("data-highlighted");x.currentTarget.setAttribute("data-highlighted","")},onBlur:x=>x.currentTarget.removeAttribute("data-highlighted"),onClick:()=>{s.disabled||(i(),s.onSelect())},onKeydown:x=>{(x.key==="Enter"||x.key===" ")&&!s.disabled&&(x.preventDefault(),i(),s.onSelect())}},...s.label)))))}function lr(e,t,a,r,d,p,...i){let n=null,l=null,c=s=>{if(!s){n&&document.removeEventListener("pointerdown",n,!0),l&&document.removeEventListener("keydown",l),n=l=null;return}let u=s,x=u.parentElement,m=e.r.root?.querySelector(a),g=m?.getBoundingClientRect()??{left:8,bottom:8,width:0},f=u.getBoundingClientRect(),y=Math.max(8,Math.min(g.left+g.width/2-f.width/2,window.innerWidth-f.width-8)),h=g.bottom+8+f.height>window.innerHeight?Math.max(8,(m?.getBoundingClientRect().top??0)-8-f.height):g.bottom+8;x.style.transform=`translate(${Math.round(y)}px, ${Math.round(h)}px)`,(u.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])")??u).focus({preventScroll:!0}),d&&(n=k=>{u.contains(k.target)||r()},l=k=>k.key==="Escape"&&r(),document.addEventListener("pointerdown",n,!0),document.addEventListener("keydown",l))};e.portal(o("div",{key:`${t}-popover`,"data-radix-popper-content-wrapper":"",style:{position:"fixed",left:"0px",top:"0px",minWidth:"max-content",zIndex:12}},o("div",{"data-side":"bottom","data-align":"center","data-state":"open",role:"dialog",id:`${t}-content`,tabindex:"-1",...p,ref:c},...i)))}var he=(e,t)=>(t??[]).map(a=>e.render(a));function ve(e,t,...a){return o(`h${Math.min(e.heading,6)}`,{class:t},...a)}function sr(e,t){let a=t.b,r=t.id(e,"heading");return o("section",{class:"pxd-section","aria-labelledby":r,...t.a11y(e)},o("div",{class:"pxd-section-header"},o(`h${Math.min(t.heading,6)}`,{id:r,class:"pxd-section-title"},a.text(e.title)),e.description!==void 0&&o("p",{class:"pxd-section-description"},a.text(e.description))),o("div",{class:"pxd-stack"},...he(t.with({heading:t.heading+1}),e.children)))}function cr(e,t){let a=(e.children??[]).map(i=>t.r.byId.get(i)),r=a.length>1&&a.every(i=>i?.component==="Metric"),d=e.arrangement??"auto";return o("div",{class:`pxd-group pxd-stack${d==="inline"?" pxd-group-inline":d==="grid"?" pxd-group-grid":r?" pxd-metric-row":""}`,...t.a11y(e)},...he(t,e.children))}function xr(e,t){return o("div",{class:`pxd-columns pxd-columns-${e.layout??"two-thirds"} pxd-columns-collapse-${e.collapse??"compact"} pxd-columns-align-${e.align??"stretch"}`,...t.a11y(e)},...he(t,e.children))}function ur(e,t){let a=t.b,r=a.text(e.title),d=e.badge?.tone??"neutral";return o("article",{class:`pxd-card${e.action?" pxd-card-actionable":""}`,...t.a11y(e)},e.media&&o("div",{class:"pxd-card-media"},t.render(e.media)),o("div",{class:"pxd-card-body"},o("div",{class:"pxd-card-header"},ve(t,"pxd-card-title",e.action?o("button",{type:"button",class:"pxd-card-link",onClick:()=>t.r.dispatch(e.action,a.scope,e.id)},r):r),e.badge&&o("span",{class:`pxd-badge pxd-tone-${d}`},a.text(e.badge.text))),e.subtitle!==void 0&&o("p",{class:"pxd-card-subtitle"},a.text(e.subtitle)),e.progress&&Pd(a.value(e.progress.value),e.progress.label!==void 0&&a.text(e.progress.label)||void 0,r,t.r.locale),e.children&&o("div",{class:"pxd-stack pxd-stack-tight pxd-card-children"},...he(t,e.children))))}function Pd(e,t,a,r){let d=Math.max(0,Math.min(1,Number(e)||0)),p=Mt(d,r);return o("div",{class:"pxd-progress"},o("div",{class:"pxd-progress-track",role:"progressbar","aria-label":`Progress: ${a}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(d*100),"aria-valuetext":t??p},o("div",{class:"pxd-progress-fill",style:{width:`${d*100}%`}})),o("span",{class:"pxd-progress-label"},t??p))}function fr(e,t){let a=t.b,[r,d]=t.state(e,"open",()=>e.open??t.r.disclosure==="show-everything"),p=t.id(e,"content"),i=r?"open":"closed";return o("div",{"data-state":i,class:"pxd-disclosure",...t.a11y(e)},o("button",{type:"button","aria-controls":r?p:void 0,"aria-expanded":r,"data-state":i,class:"pxd-disclosure-trigger",onClick:()=>d(!r)},o("span",{class:"pxd-disclosure-icon","aria-hidden":"true"},r?"\u25BE":"\u25B8"),a.text(e.summary)),o("div",{"data-state":i,id:p,hidden:!r,class:"pxd-disclosure-content"},r?o("div",{class:"pxd-stack"},...he(t,e.children)):null))}function gr(e,t){let a=t.b,r=e.selected?a.value(e.selected):void 0,[d,p]=t.state(e,"view",void 0),i=Dt(e.views,r,d),n=l=>e.selected?a.write(e.selected,l):p(l);return nr({id:t.id(e),value:i,onValueChange:n,rootClass:`pxd-views pxd-views-${e.variant??"tabs"}`,rootProps:t.a11y(e),listClass:"pxd-views-list",tabClass:"pxd-views-tab",panelClass:"pxd-views-panel",tabs:e.views.map(l=>{let c=l.count!==void 0?a.value(l.count):void 0;return{key:l.key,label:[a.text(l.label),c!==void 0&&o("span",{class:"pxd-views-count"},Pe(c,t.r.locale))],content:t.render(l.content)}})})}function re(e,{value:t,name:a,size:r=40}){let d=typeof t=="string"?t:"",p=Ha(d)?e.r.props.resolveMedia?.(d):void 0,i=Ua(d,a),n=Ra(a);return p?o("img",{class:"pxd-avatar",src:p,alt:"",width:r,height:r,style:{width:r,height:r}}):o("span",{class:`pxd-avatar pxd-avatar-${n}`,"aria-hidden":"true",style:{width:r,height:r,fontSize:Math.round(r*.38)}},i)}function D(e,t=20){return o("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},o("path",{d:Fa(e)}))}function mr(e,t){let a=t.b,[r,d]=t.state(e,"split",()=>_t(e.ratio)),[p,i]=t.state(e,"previous",()=>a.value(e.selected)),n=a.value(e.selected),{has:l,scope:c,name:s}=Gt(e,t.r.byId,t.r.data,a.scope),u=k=>d(A=>nt(A,k)),x=!1;n!==p&&(i(n),r.listShown&&u({type:"selected"}),x=r.compact&&l);let{showList:m,showDetail:g}=qt(r,l),f=k=>{if(k.pointerType==="mouse"&&k.button!==0)return;let A=k.currentTarget,C=A.parentElement;A.setPointerCapture(k.pointerId);let I=C.getBoundingClientRect(),E=getComputedStyle(C).direction==="rtl",F=T=>{let b=E?I.right-T.clientX:T.clientX-I.left;u({type:"share",value:b/I.width*100})},$=()=>{C.removeEventListener("pointermove",F),C.removeEventListener("pointerup",$),C.removeEventListener("pointercancel",$)};C.addEventListener("pointermove",F),C.addEventListener("pointerup",$),C.addEventListener("pointercancel",$)},y=!!e.resizable&&!r.compact,h=k=>{if(!k)return;let A=k.closest(".pxd-surface")??k;t.r.observeWidth(A,`${e.id}:split`,C=>u({type:"measure",width:C}))};return x&&t.after(()=>t.r.root?.querySelector(`[data-pxd-id="${e.id}"] > .pxd-split-detail`)?.focus()),o("div",{class:`pxd-split pxd-split-${e.ratio??"narrow"}${r.compact?" pxd-split-compact":""}${y?" pxd-split-resizable":""}`,style:y?{"--polyxd-split-share":`${r.share}%`}:void 0,...t.a11y(e),ref:h},o("div",{class:"pxd-split-primary",hidden:!m},t.render(e.primary)),y&&o("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize the list","aria-valuenow":Math.round(r.share),"aria-valuemin":Xe,"aria-valuemax":Ye,tabindex:"0",class:"pxd-split-handle",onKeydown:k=>{let A=nt(r,{type:"key",key:k.key,shift:k.shiftKey});A!==r&&(k.preventDefault(),d(A))},onPointerdown:f},o("span",{class:"pxd-split-handle-line","aria-hidden":"true"})),g&&o("div",{class:"pxd-split-detail",tabindex:"-1","aria-label":s},r.compact&&o("button",{type:"button",class:"pxd-button pxd-button-tertiary pxd-split-back",onClick:()=>u({type:"back"})},D("chevronLeft",18),"Back"),l?t.render(e.detail,c):e.empty?t.render(e.empty):null),o("span",{class:"pxd-sr-only","aria-live":"polite"},r.compact&&l&&!r.listShown?s:""))}function Mo(e){return"block"in e?o("span",{class:`pxd-skeleton-block pxd-skeleton-${e.block}${e.size?` pxd-skeleton-${e.size}`:""}`}):o("div",{class:Xt[e.group]},...e.parts.map(Mo))}function Ao({title:e,pattern:t,shape:a,theme:r,mode:d,density:p,locale:i="en-GB",className:n}){let l=Wt(t,a);return o("div",{class:["pxd-surface","pxd-skeleton",`pxd-skeleton-${l}`,n].filter(Boolean).join(" "),"data-pxd-theme":r,"data-pxd-mode":d,"data-pxd-density":p,lang:i,role:"status","aria-busy":"true"},o("span",{class:"pxd-sr-only"},Yt(e)),o("div",{class:"pxd-skeleton-body","aria-hidden":"true"},Mo({block:"title",size:l==="dialog"?"short":"medium"}),...Kt[l].map(Mo)))}function br(e,t){let a=t.r,r=t.id(e,"main"),[d,p]=t.state(e,"width","wide"),[i,n]=t.state(e,"drawer",!1),l=e.navigation?a.byId.get(e.navigation):void 0,c=ca(l?.placement,d,l?.items?.length??0),s=f=>String(W(f,a.data,de)??"");c!=="drawer"&&i&&n(!1);let u={navigation:c,compact:d==="compact",mainId:r,navigationId:l?.id,navigationLabel:l?l.label!==void 0?s(l.label):"Main":void 0,current:a.props.current,drawerOpen:i,setDrawerOpen:n},x=t.with({frame:u}),m=e.header?a.byId.get(e.header):void 0,g=e.aside?a.byId.get(e.aside):void 0;return o("div",{class:`pxd-frame pxd-frame-width-${e.width??"contained"}`,"data-pxd-layout":d,"data-pxd-nav":c,"data-pxd-appbar":m?.component==="AppBar"&&m.sticky!==!1?m.variant??"standard":void 0,...t.a11y(e),ref:f=>f&&a.observeWidth(f,`${e.id}:frame`,y=>p(sa(y)))},e.skipTarget!==!1&&o("a",{class:"pxd-skip-link",href:`#${r}`,onClick:f=>{f.preventDefault(),document.getElementById(r)?.focus()}},"Skip to main content"),e.banner&&o("div",{class:"pxd-frame-banner"},x.render(e.banner)),e.header&&x.render(e.header),o("div",{class:"pxd-frame-body"},l&&o("div",{class:"pxd-frame-nav"},x.render(l.id)),o("div",{class:"pxd-frame-main"},x.render(e.main)),g&&o("aside",{class:"pxd-frame-aside","aria-label":g.title!==void 0?s(g.title):"Aside"},x.render(g.id))),e.footer&&x.render(e.footer))}function Bd(e,t,a){let r=typeof t=="string"?t:"",d=r.length>3?e.r.props.resolveMedia?.(r):void 0;if(d)return o("img",{class:"pxd-appbar-logo",src:d,alt:""});let p=(r&&r.length<=3?r:a.split(/\s+/).map(i=>i[0]).join("").slice(0,2)).toUpperCase();return o("span",{class:"pxd-appbar-mark","aria-hidden":"true"},p)}function hr(e,t){let a=t.b,r=t.frame,[d,p]=t.state(e,"scrolled",!1),[i,n]=t.state(e,"search",!1),l=e.variant??"standard",c=e.sticky!==!1,s=r?.compact??!1,u=a.text(e.title),x=xa(u,s,r?.current?.title),m=r?.navigation==="drawer",g=new WeakMap,f=h=>{if(!h||!c||typeof IntersectionObserver>"u"||g.has(h))return;let k=new IntersectionObserver(([A])=>p(!A.isIntersecting));k.observe(h),g.set(h,k)},y=h=>o("div",{class:`pxd-appbar-search${h?" pxd-appbar-search-row":""}`,role:"search","aria-label":"Search",ref:h?k=>k&&i&&!k.dataset.focused&&(k.dataset.focused="1",k.querySelector("input, button")?.focus()):void 0},t.render(e.search));return[o("div",{class:"pxd-appbar-sentinel","aria-hidden":"true",ref:f}),o("header",{class:`pxd-appbar pxd-appbar-${l}${c?" pxd-appbar-sticky":""}`,"data-pxd-scrolled":d||void 0,...t.a11y(e)},o("div",{class:"pxd-appbar-row"},m?o("button",{type:"button",class:"pxd-icon-button pxd-appbar-menu","aria-label":`${r.navigationLabel??"Main"} menu`,"aria-expanded":r.drawerOpen,onClick:()=>r.setDrawerOpen(!0)},D("menu")):e.leading&&o("div",{class:"pxd-appbar-leading"},t.render(e.leading)),o("div",{class:"pxd-appbar-brand"},e.brand!==void 0&&Bd(t,a.value(e.brand),u),(l!=="large"||s)&&o("span",{class:"pxd-appbar-title"},x)),e.search&&(s?o("button",{type:"button",class:"pxd-icon-button pxd-appbar-search-toggle","aria-label":i?"Close search":"Search","aria-expanded":i,onClick:()=>n(!i)},D(i?"close":"search")):y(!1)),(e.actions||e.account)&&o("div",{class:"pxd-appbar-end"},e.actions&&o("div",{class:"pxd-appbar-actions"},t.render(e.actions)),e.account&&o("div",{class:"pxd-appbar-account"},t.render(e.account)))),e.search&&s&&i&&y(!0),l==="large"&&!s&&o("div",{class:"pxd-appbar-headline"},x))]}function vr(e,t){let a=t.b,r=Math.min(t.heading,6),d=e.groups??[];return o("footer",{class:"pxd-footer",...t.a11y(e)},d.length>0&&o("div",{class:"pxd-footer-groups"},...d.map(p=>{let i=t.id(e,p.key);return o("nav",{key:p.key,class:"pxd-footer-group","aria-labelledby":i},o(`h${r}`,{id:i,class:"pxd-footer-heading"},a.text(p.label)),o("ul",null,...p.items.map(n=>o("li",{key:n.key},o("button",{type:"button",class:"pxd-link pxd-footer-link",onClick:()=>t.r.dispatch(n.action,a.scope,e.id)},a.text(n.label))))))})),o("div",{class:"pxd-footer-legal"},o("p",{class:"pxd-footer-legal-text"},a.text(e.legal)),e.aside&&o("div",{class:"pxd-footer-aside"},t.render(e.aside))))}function kr(e,t){let a=t.b,r=t.r,d=t.frame,p=!!r.props.loading,i=`${r.props.current?.key??""}\0${r.props.current?.title??""}`,[n,l]=t.state(e,"shown",i);n!==i&&(l(i),p||t.after(()=>{let s=document.getElementById(d?.mainId??"");if(!s)return;let u=s.querySelector("h1");u&&!u.hasAttribute("tabindex")&&(u.tabIndex=-1),(u??s).focus()}));let c=r.props.outlet;return o("main",{id:d?.mainId,class:"pxd-outlet",tabindex:"-1","aria-label":e.label!==void 0?a.text(e.label):void 0,...t.a11y(e)},p?e.loading?t.render(e.loading):Ao({title:r.props.current?.title,className:"pxd-outlet-skeleton"}):c?Oe(c,"outlet"):null)}var yr=new Set;function wr(e,t){let a=t.b,r=t.r.components[e.name];if(!r)return yr.has(e.name)||(yr.add(e.name),console.warn(`[polyxd] No host component named "${e.name}"; rendering its fallback. Pass one in the surface's components.`)),e.fallback?t.render(e.fallback):null;let d=Ke(e.props??{},t.r.data,a.scope)??{},p=r({...d,node:e}),i=p instanceof Element?Oe(p,e.id):p;return e.label===void 0?i:o("div",{class:"pxd-custom",role:"group","aria-label":a.text(e.label),...t.a11y(e)},i)}function Sr(e,t){let a=t.b,r=t.r,[d,p]=t.state(e,"compact",!1),i=O(e.rows.path,a.scope),n=Z(_(r.data,i)),l=a.text(e.caption),c=!!e.detail&&e.expandable!==!1,[s,u]=t.state(e,"expanded",()=>[]),x=S=>s.includes(S),m=S=>u(P=>st(P,S)),g=(S,P)=>o("button",{type:"button",class:"pxd-icon-button pxd-table-expander","aria-expanded":x(S),"aria-label":`${x(S)?"Hide":"Show"} details for ${P}`,onClick:()=>m(S)},D(x(S)?"sortUp":"sortDown",16)),f=e.selection==="multiple",y=f&&e.selected?a.value(e.selected)??[]:[],h=(S,P)=>Qt(e,n,P,r.data,S),k=S=>a.write(e.selected,st(y,S)),A=n.map((S,P)=>h({pointer:K(i,P)},P)),C=n.length>0&&A.every(S=>y.includes(S)),I=()=>a.write(e.selected,C?[]:A),E=e.sort?.column?a.value(e.sort.column):void 0,F=e.sort?.direction?a.value(e.sort.direction):"ascending",$=S=>{let P=ea(S,E,F);e.sort?.column&&a.write(e.sort.column,S),e.sort?.direction&&a.write(e.sort.direction,P),e.sort?.action&&r.dispatch(e.sort.action,a.scope,e.id)},T=S=>o("span",{"data-state":"checked",style:{pointerEvents:"none"}},S),b=(S,P)=>{let V=_(r.data,O(S.path,P)),j=G(V,X(S.format,r.data,a.scope),r.locale);if(S.kind==="status")return o("span",{class:`pxd-badge pxd-tone-${S.tones?.[String(V)]??"neutral"}`},j);if(S.format?.type==="color")return o("span",{class:"pxd-color-value"},o("span",{class:`pxd-swatch${Ie(j)?"":" pxd-swatch-unknown"}`,style:Ie(j)?{background:Ie(j)}:void 0,"aria-hidden":"true"}),j);if(S.kind==="entity"){let B=S.secondaryPath?String(_(r.data,O(S.secondaryPath,P))??""):"";return o("span",{class:"pxd-entity"},S.avatarPath&&re(t,{value:_(r.data,O(S.avatarPath,P)),name:j,size:28}),o("span",{class:"pxd-entity-text"},e.rowAction?o("button",{type:"button",class:"pxd-link",onClick:()=>r.dispatch(e.rowAction,P,e.id)},j):o("span",{class:"pxd-entity-name"},j),B&&o("span",{class:"pxd-entity-secondary"},B)))}return S.kind==="link"&&e.rowAction?o("button",{type:"button",class:"pxd-link",onClick:()=>r.dispatch(e.rowAction,P,e.id)},j):j},v=(S,P,V)=>{let B=(r.byId.get(e.rowActions)?.children??[]).map(R=>r.byId.get(R)).filter(R=>!!R&&(R.visible===void 0||W(R.visible,r.data,S)!==!1));if(!B.length)return null;let H=t.id(e,`row-${V}-menu`),[L,U]=t.state(e,`menu:${V}`,be);return He(t,H,L,U,B.map(R=>({key:R.id,label:[a.text(R.label)],class:`pxd-menu-item${R.tone==="danger"?" pxd-menu-item-danger":""}`,onSelect:()=>r.dispatch(R.action,S,R.id)})),{class:"pxd-menu"}),o("button",{type:"button",..._e(H,L,U,"end",{class:"pxd-icon-button","aria-label":`Actions for ${P}`})},D("dots",18))},w=[e.views&&jd(e,t),(e.search||e.toolbar||f&&y.length>0)&&o("div",{class:`pxd-table-toolbar${y.length>0?" pxd-table-bulk":""}`,role:"toolbar","aria-label":y.length>0?`Actions for ${y.length} selected`:"Table tools"},...y.length>0?[o("p",{class:"pxd-bulk-count","aria-live":"polite"},`${y.length} selected`),e.bulkActions&&t.render(e.bulkActions),o("button",{type:"button",class:"pxd-button pxd-button-tertiary",onClick:()=>a.write(e.selected,[])},"Cancel")]:[e.search&&t.render(e.search),o("span",{class:"pxd-table-toolbar-spacer"}),e.toolbar&&t.render(e.toolbar)])],N=()=>o("ul",{class:"pxd-row-list","aria-label":l},...n.map((S,P)=>{let V={pointer:K(i,P)},{first:j,status:B,details:H}=Zt(e.columns),L=G(_(r.data,O(j.path,V)),X(j.format,r.data,a.scope),r.locale),U=h(V,P);return o("li",{key:String(U),class:"pxd-row-item"},f&&e.selected&&xe({class:"pxd-checkbox",checked:y.includes(U),onCheckedChange:()=>k(U),"aria-label":`Select ${L}`,indicator:T(D("check",14))}),c&&g(U,L),o("div",{class:"pxd-row-main"},o("div",{class:"pxd-row-title"},b(j,V)),o("p",{class:"pxd-row-details"},...H.map((R,q)=>o("span",{key:R.key},q>0&&o("span",{"aria-hidden":"true"}," \xB7 "),o("span",{class:"pxd-sr-only"},`${a.text(R.label)}: `),G(_(r.data,O(R.path,V)),X(R.format,r.data,a.scope),r.locale))))),B&&b(B,V),e.rowActions?v(V,L,P):e.rowAction&&!e.columns[0].kind?o("button",{type:"button",class:"pxd-button pxd-button-tertiary",onClick:()=>r.dispatch(e.rowAction,V,e.id)},"Select",o("span",{class:"pxd-sr-only"},` ${L}`)):null,c&&x(U)&&o("div",{class:"pxd-row-detail"},t.render(e.detail,V)))})),z=()=>o("div",{class:"pxd-table-scroll"},o("table",{class:"pxd-table"},o("caption",{class:e.views||e.search?"pxd-sr-only":void 0},l),o("thead",null,o("tr",null,c&&o("th",{scope:"col",class:"pxd-table-expand"},o("span",{class:"pxd-sr-only"},"Details")),f&&e.selected&&o("th",{scope:"col",class:"pxd-table-select"},xe({class:"pxd-checkbox",checked:C?!0:y.length>0?"indeterminate":!1,onCheckedChange:I,"aria-label":"Select all rows",indicator:o("span",{"data-state":C?"checked":"indeterminate",style:{pointerEvents:"none"}},D(C?"check":"dash",14))})),...e.columns.map(S=>{let P=S.key===E;return o("th",{key:S.key,scope:"col",class:lt(S)?"pxd-num":void 0,"aria-sort":S.sortable?P?F:"none":void 0},S.sortable?o("button",{type:"button",class:"pxd-sort",onClick:()=>$(S.key)},a.text(S.label),D(P?F==="descending"?"sortDown":"sortUp":"sort",16)):a.text(S.label))}),(e.rowActions||e.rowAction)&&o("th",{scope:"col"},o("span",{class:"pxd-sr-only"},"Actions")))),o("tbody",null,...n.flatMap((S,P)=>{let V={pointer:K(i,P)},j=h(V,P),B=G(_(r.data,O(e.columns[0].path,V)),X(e.columns[0].format,r.data,a.scope),r.locale);return[o("tr",{key:String(j),class:y.includes(j)?"pxd-row-selected":void 0,"aria-selected":f?y.includes(j):void 0},c&&o("td",{class:"pxd-table-expand"},g(j,B)),f&&e.selected&&o("td",{class:"pxd-table-select"},xe({class:"pxd-checkbox",checked:y.includes(j),onCheckedChange:()=>k(j),"aria-label":`Select ${B}`,indicator:T(D("check",14))})),...e.columns.map((H,L)=>o(L===0?"th":"td",{key:H.key,scope:L===0?"row":void 0,"data-label":a.text(H.label),class:lt(H)?"pxd-num":void 0},b(H,V))),(e.rowActions||e.rowAction)&&o("td",{class:"pxd-table-action"},e.rowActions?v(V,B,P):o("button",{type:"button",class:"pxd-button pxd-button-tertiary",onClick:()=>r.dispatch(e.rowAction,V,e.id)},"Select",o("span",{class:"pxd-sr-only"},` ${B}`)))),c&&x(j)&&o("tr",{key:`${String(j)}-detail`,class:"pxd-table-detail"},o("td",{colspan:ta(e,c,!!(f&&e.selected))},t.render(e.detail,V)))]})))),M=!n.length&&e.empty?t.render(e.empty):d?N():z();return o("div",{class:"pxd-table-wrap",...t.a11y(e),ref:S=>S&&r.observeWidth(S,`${e.id}:table`,P=>p(P<Jt))},...w,M,e.page&&Io(e,t,n.length))}function jd(e,t){let a=t.b,r=e.view?a.value(e.view):e.views[0].key;return o("div",{class:"pxd-table-views",role:"tablist","aria-label":"Saved views"},...e.views.map(d=>{let p=d.count!==void 0?a.value(d.count):void 0,i=d.key===r;return o("button",{key:d.key,type:"button",role:"tab","aria-selected":i,class:`pxd-table-view${i?" pxd-table-view-current":""}`,onClick:()=>{e.view&&a.write(e.view,d.key),t.r.dispatch(d.action,a.scope,e.id)}},a.text(d.label),p!==void 0&&o("span",{class:"pxd-views-count"},Pe(p,t.r.locale)))}))}function Io(e,t,a){let r=t.b,d=e.page,{index:p,size:i,total:n,pages:l,from:c,to:s,sizes:u}=aa(d.index?r.value(d.index):void 0,d.size?r.value(d.size):void 0,d.total?r.value(d.total):void 0,a),x=g=>Pe(g,t.r.locale),m=g=>{d.index&&r.write(d.index,g),t.r.dispatch(d.action,r.scope,e.id)};return o("div",{class:"pxd-paging"},d.size&&o("label",{class:"pxd-paging-size"},"Rows per page",o("select",{value:String(i),onChange:g=>{r.write(d.size,Number(g.target.value)),d.index&&r.write(d.index,1),t.r.dispatch(d.action,r.scope,e.id)}},...u.map(g=>o("option",{key:g,value:String(g),selected:g===i},String(g))))),o("p",{class:"pxd-paging-range","aria-live":"polite"},`${x(c)}\u2013${x(s)} of ${x(n)}`),o("div",{class:"pxd-paging-controls"},o("button",{type:"button",class:"pxd-icon-button","aria-label":"Previous page",disabled:p<=1,onClick:()=>m(p-1)},D("chevronLeft",18)),o("span",{class:"pxd-paging-page"},`Page ${x(p)} of ${x(l)}`),o("button",{type:"button",class:"pxd-icon-button","aria-label":"Next page",disabled:p>=l,onClick:()=>m(p+1)},D("chevronRight",18))))}function Cr(e){let t=Ie(e);return o("span",{class:`pxd-swatch${t?"":" pxd-swatch-unknown"}`,style:t?{background:t}:void 0,"aria-hidden":"true"})}function Qe(e){return e.map(t=>typeof t=="string"?t:t.kind==="code"?o("code",null,t.text):t.kind==="strong"?o("strong",null,...Qe(t.children)):t.kind==="em"?o("em",null,...Qe(t.children)):t.kind!=="link"?null:t.href?o("a",{href:t.href,rel:"noopener noreferrer"},...Qe(t.children)):o("span",null,...Qe(t.children)))}function Er(e,t){let a=t.b,r=t.a11y(e),d=e.variant??"body",p=e.format?.type==="color",i=(n,l=e.format)=>{let c=a.text(n,l);return l?.type==="color"?[Cr(c),c]:[c]};if(d==="rich")return o("p",{class:"pxd-text pxd-text-body pxd-text-rich",...r},...Qe(je(a.text(e.text))));if(d==="quote")return o("figure",{class:"pxd-text-quote",...r},o("blockquote",null,o("p",{class:"pxd-text pxd-text-body"},...i(e.text))),e.cite!==void 0&&o("figcaption",{class:"pxd-text-cite"},a.text(e.cite)));if(d==="list"){let n=e.items?O(e.items.path,a.scope):void 0,l=n?Z(_(t.r.data,n)):[],c=a.text(e.text);return o("div",{class:"pxd-text-list",...r},c&&o("p",{class:"pxd-text pxd-text-body"},c),o(e.ordered?"ol":"ul",{class:`pxd-text-list-items${e.ordered?" pxd-text-list-ordered":""}`},...l.map((s,u)=>{let x=e.itemPath&&n?_(t.r.data,O(e.itemPath,{pointer:K(n,u)})):s;return o("li",{key:u},...i(x))})))}return o("p",{class:`pxd-text pxd-text-${d}${p?" pxd-text-color":""}`,...r},...i(e.text))}function Mr(e,t){let a=t.b,r=a.text(e.label),d=a.text(e.value,e.format),p=e.change?Ca(a.value(e.change.value),e.change.favorable,X(e.change.format,t.r.data,a.scope),t.r.locale):void 0,i=e.caption!==void 0?a.text(e.caption):void 0;return o("div",{class:"pxd-metric",role:"group","aria-label":r,...t.a11y(e)},o("div",{class:"pxd-metric-label"},r),o("div",{class:"pxd-metric-value"},d),p&&o("div",{class:`pxd-metric-change pxd-data-${p.tone}`},o("span",{"aria-hidden":"true"},p.text),o("span",{class:"pxd-sr-only"},p.spoken)),i&&o("div",{class:"pxd-metric-caption"},i))}function Ar(e,t){let a=t.b,r=e.variant==="receipt",d=l=>{let c=a.value(l.value);return r&&l.format?.type==="currency"&&c===0&&!l.total?{text:"Free",free:!0,color:!1}:{text:a.text(l.value,l.format),free:!1,color:l.format?.type==="color"}},p=(l,c)=>e.rowAction?o("button",{type:"button",class:"pxd-link pxd-detail-change",onClick:()=>t.r.dispatch(da(e.rowAction,l.key??c),a.scope,e.id)},"Change",o("span",{class:"pxd-sr-only"},` ${c}`)):null,i=e.items.filter(l=>!l.total),n=e.items.filter(l=>l.total);return o("div",{class:`pxd-detail-list${r?" pxd-receipt":""}${e.layout==="grid"?" pxd-detail-grid":""}${e.rowAction?" pxd-detail-actions":""}`,...t.a11y(e)},e.title!==void 0&&ve(t,"pxd-detail-title",a.text(e.title)),o("dl",null,...i.map((l,c)=>{let s=d(l),u=a.text(l.label);return o("div",{class:"pxd-detail-row",key:l.key??c},o("dt",null,u),o("dd",{class:s.free?"pxd-free":void 0},s.color&&Cr(s.text),s.text),e.rowAction&&o("dd",{class:"pxd-detail-row-action"},p(l,u)))}),...n.map((l,c)=>o("div",{class:"pxd-detail-row pxd-total",key:l.key??`t${c}`},o("dt",null,a.text(l.label)),o("dd",null,d(l).text),e.rowAction&&o("dd",{class:"pxd-detail-row-action"})))))}function Ir(e,t){let a=t.b,r=t.r,d=t.id(e,"label"),p=O(e.items.path,a.scope),i=Z(_(r.data,p)),n=e.selection??"none",l=n!=="none"&&e.selected?a.value(e.selected):void 0,c=U=>Array.isArray(l)?l.includes(U):l===U,s=U=>{if(!e.selected)return;if(n==="single")return a.write(e.selected,U);let R=Array.isArray(l)?l:[];a.write(e.selected,R.includes(U)?R.filter(q=>q!==U):[...R,U])},u=Array.isArray(l)?l.length:0,x=a.text(e.label),m=r.byId.get(e.items.componentId),{grid:g,timeline:f,carousel:y,calendar:h}=Ba(e,m),k=e.reorderable===!0,A=k&&e.order?a.value(e.order):void 0,C=i.map((U,R)=>Pa(U,R)),I=ja(C,A),E=(U,R)=>{let q=e.order?La(I,C,U,R):void 0;q&&a.write(e.order,q)},[F,$]=t.state(e,"dragging",null),[T,b]=t.state(e,"position",0),v=()=>r.root?.querySelector(`[data-pxd-id="${CSS.escape(e.id)}"] .pxd-carousel-track`),w=U=>Array.from(U.children),N=U=>{let R=U.currentTarget;b(_a(w(R).map(q=>q.offsetLeft-R.offsetLeft),R.scrollLeft))},z=U=>{let R=v(),q=R&&w(R)[Math.max(0,Math.min(i.length-1,U))];R&&q&&R.scrollTo({left:q.offsetLeft-R.offsetLeft,behavior:"smooth"})},M=h?i.map((U,R)=>Da(e.datePath?_(r.data,O(e.datePath,{pointer:K(p,R)})):void 0)):[],[S,P]=t.state(e,"month",null),V=Va(S,M.find(Boolean));if(!i.length&&e.empty)return t.render(e.empty);let j=(U,R)=>o("input",{type:n==="single"?"radio":"checkbox",class:"pxd-collection-select",name:n==="single"?`${e.id}-selection`:void 0,checked:c(U),onChange:()=>s(U),"aria-label":R}),B=(U,R)=>{let q=C[U],le={pointer:K(p,U)};return o("li",{key:String(q),class:`pxd-collection-item${F===R?" pxd-collection-dragging":""}`,draggable:k||void 0,onDragstart:k?()=>$(R):void 0,onDragover:k?oe=>oe.preventDefault():void 0,onDrop:k?()=>{F!==null&&E(F,R),$(null)}:void 0,onDragend:k?()=>$(null):void 0},k&&o("div",{class:"pxd-collection-reorder"},o("span",{class:"pxd-collection-handle","aria-hidden":"true"},D("menu",16)),o("button",{type:"button",class:"pxd-icon-button pxd-collection-move","aria-label":`Move item ${R+1} up`,disabled:R===0,onClick:()=>E(R,R-1)},D("sortUp",16)),o("button",{type:"button",class:"pxd-icon-button pxd-collection-move","aria-label":`Move item ${R+1} down`,disabled:R===i.length-1,onClick:()=>E(R,R+1)},D("sortDown",16))),n!=="none"&&j(q,`Select item ${R+1} of ${i.length}`),o("div",{class:"pxd-collection-content"},t.render(e.items.componentId,le)))},H=n==="multiple"&&u>0&&o("div",{class:"pxd-table-toolbar pxd-table-bulk",role:"toolbar","aria-label":`Actions for ${u} selected`},o("p",{class:"pxd-bulk-count","aria-live":"polite"},`${u} selected`),e.bulkActions&&t.render(e.bulkActions),o("button",{type:"button",class:"pxd-button pxd-button-tertiary",onClick:()=>a.write(e.selected,[])},"Cancel")),L;if(y)L=o("div",{class:"pxd-carousel",role:"group","aria-roledescription":"carousel","aria-labelledby":d},o("ul",{class:"pxd-collection-list pxd-carousel-track","aria-labelledby":d,onScroll:N},...I.map((U,R)=>B(U,R))),o("div",{class:"pxd-carousel-controls"},o("button",{type:"button",class:"pxd-icon-button","aria-label":"Previous item",disabled:T<=0,onClick:()=>z(T-1)},D("chevronLeft",18)),o("p",{class:"pxd-carousel-position","aria-live":"polite"},`${T+1} of ${i.length}`),o("button",{type:"button",class:"pxd-icon-button","aria-label":"Next item",disabled:T>=i.length-1,onClick:()=>z(T+1)},D("chevronRight",18))));else if(h){let{monthName:U,weekdays:R,weeks:q}=Oa(V,r.locale),le=oe=>I.filter(Y=>M[Y]&&M[Y].y===V.y&&M[Y].m===V.m&&M[Y].d===oe);L=o("div",{class:"pxd-calendar"},o("div",{class:"pxd-calendar-header"},o("button",{type:"button",class:"pxd-icon-button","aria-label":"Previous month",onClick:()=>P(gt(V,-1))},D("chevronLeft",18)),o("p",{class:"pxd-calendar-month","aria-live":"polite"},U),o("button",{type:"button",class:"pxd-icon-button","aria-label":"Next month",onClick:()=>P(gt(V,1))},D("chevronRight",18))),o("table",{class:"pxd-calendar-grid"},o("caption",{class:"pxd-sr-only"},`${x}, ${U}`),o("thead",null,o("tr",null,...R.map(oe=>o("th",{key:oe,scope:"col"},oe)))),o("tbody",null,...q.map((oe,Y)=>o("tr",{key:Y},...oe.map((fe,Ae)=>fe===null?o("td",{key:Ae,class:"pxd-calendar-empty"}):o("td",{key:Ae,class:`pxd-calendar-day${le(fe).length?" pxd-calendar-has-items":""}`},o("span",{class:"pxd-calendar-date"},fe),le(fe).length>0&&o("ul",{class:"pxd-calendar-items"},...le(fe).map(se=>o("li",{key:String(C[se]),class:"pxd-collection-item"},n!=="none"&&j(C[se],`Select item on ${fe}`),o("div",{class:"pxd-collection-content"},t.render(e.items.componentId,{pointer:K(p,se)}))))))))))))}else L=o("ul",{class:`pxd-collection-list${g?" pxd-collection-grid":""}${f?" pxd-timeline":""}${k?" pxd-collection-reorderable":""}`,"aria-labelledby":d},...I.map((U,R)=>B(U,R)));return o("div",{class:"pxd-collection",...t.a11y(e)},o("div",{class:"pxd-collection-label",id:d},`${x} `,o("span",{class:"pxd-count"},`(${i.length})`)),H,L,e.page&&Io(e,t,i.length))}function Nr(e,t){let a=t.b,r=t.r,d=t.a11y(e),[p,i]=t.state(e,"open",null),n=e.kind??"image",l=e.src?a.value(e.src):void 0,c=l?r.props.resolveMedia?.(l):void 0,s=e.decorative?"":a.text(e.alt),u=`pxd-media pxd-media-${e.aspect??"auto"}`;if(n==="qr")return Dd(t,e,a.text(e.value),s,d);if(n==="gallery"){let x=e.items?O(e.items.path,a.scope):void 0,g=(x?Z(_(r.data,x)):[]).map((y,h)=>{let k={pointer:K(x,h)},A=e.imagePath?_(r.data,O(e.imagePath,k)):void 0,C=A?r.props.resolveMedia?.(String(A)):void 0,I=e.altPath?String(_(r.data,O(e.altPath,k))??""):"";return{src:C,alt:I}}),f=g.filter(y=>!!y.src);return p!==null&&f[p]&&Ld(t,e,s,f,p,i),o("ul",{class:"pxd-gallery","aria-label":s||void 0,...d},...g.map((y,h)=>{let k=f.indexOf(y);return o("li",{key:h},k>=0?o("button",{type:"button",class:"pxd-gallery-item","aria-label":y.alt?`Open ${y.alt}`:`Open image ${k+1} of ${f.length}`,onClick:()=>i(k)},o("img",{class:`${u} pxd-gallery-image`,src:y.src,alt:y.alt})):o("div",{class:`${u} pxd-media-placeholder pxd-gallery-image`,role:"img","aria-label":y.alt||void 0}))}))}if(n==="video"||n==="audio"){let x=e.transcript!==void 0?a.text(e.transcript):void 0,m=e.poster!==void 0?a.text(e.poster):void 0,g=m?r.props.resolveMedia?.(m):void 0;return o("figure",{class:`pxd-media-player pxd-media-${n}`,...d},n==="video"?c?o("video",{class:u,controls:!0,src:c,poster:g,"aria-label":s||void 0}):o("div",{class:`${u} pxd-media-placeholder`,role:"img","aria-label":s||void 0}):c?o("audio",{class:"pxd-media-audio-player",controls:!0,src:c,"aria-label":s||void 0}):o("div",{class:"pxd-media-placeholder pxd-media-audio-placeholder",role:"img","aria-label":s||void 0}),s&&o("figcaption",{class:"pxd-media-caption"},s),x&&o("details",{class:"pxd-media-transcript"},o("summary",null,"Transcript"),o("p",{class:"pxd-text pxd-text-body"},x)))}return c?o("img",{class:u,src:c,alt:s,...d}):o("div",{class:`${u} pxd-media-placeholder`,role:e.decorative?"presentation":"img","aria-label":s||void 0})}var zr=e=>o("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},o("path",{d:e==="left"?"m15 6-6 6 6 6":"m9 6 6 6-6 6"}));function Ld(e,t,a,r,d,p){let i=r.length,{src:n,alt:l}=r[d],c=x=>p(Math.max(0,Math.min(i-1,x))),s=e.id(t,"viewer-title"),u=()=>p(null);e.after(()=>{let x=document.activeElement;x?.disabled&&x.classList.contains("pxd-viewer-step")&&((x.nextElementSibling??x.previousElementSibling)?.dispatchEvent(new Event("noop")),(x.nextElementSibling??x.previousElementSibling)?.focus())}),e.portal(ue({ctx:e,id:e.id(t,"viewer"),class:"pxd-viewer",onClose:u,props:{"aria-labelledby":s,onKeydown:x=>x.key==="ArrowLeft"?c(d-1):x.key==="ArrowRight"?c(d+1):void 0}},o("h2",{id:s,class:"pxd-sr-only"},a||"Pictures"),o("div",{class:"pxd-viewer-bar"},o("span",{class:"pxd-viewer-counter","aria-live":"polite"},`${d+1} of ${i}`),ye(u,{class:"pxd-icon-button pxd-viewer-close","aria-label":"Close"},D("close"))),o("figure",{class:"pxd-viewer-figure"},o("img",{class:"pxd-viewer-image",src:n,alt:l}),l&&o("figcaption",{class:"pxd-viewer-caption"},l)),o("div",{class:"pxd-viewer-bar pxd-viewer-nav"},o("button",{type:"button",class:"pxd-icon-button pxd-viewer-step","aria-label":"Previous picture",disabled:d===0,onClick:()=>c(d-1)},zr("left")),o("button",{type:"button",class:"pxd-icon-button pxd-viewer-step","aria-label":"Next picture",disabled:d===i-1,onClick:()=>c(d+1)},zr("right")))))}function Dd(e,t,a,r,d){let p=a?xo(a):void 0;if(!p)return o("div",{class:"pxd-qr pxd-qr-placeholder",role:"img","aria-label":r||`QR code: ${a}`,...d},o("span",{class:"pxd-qr-mark","aria-hidden":"true"},"QR"),o("span",{class:"pxd-qr-text"},a));let i=n=>{let l=n;if(!l||l.dataset.text===a)return;l.dataset.text=a;let c=4,s=4,u=p.length;l.width=l.height=(u+s*2)*c;let x=l.getContext("2d");if(!x)return;let m=getComputedStyle(l),g=m.getPropertyValue("--pxd-color-text-default").trim()||"#000",f=m.getPropertyValue("--pxd-color-surface-default").trim()||"#fff";x.fillStyle=f,x.fillRect(0,0,l.width,l.height),x.fillStyle=g,p.forEach((y,h)=>y.forEach((k,A)=>k&&x.fillRect((A+s)*c,(h+s)*c,c,c)))};return e.after(()=>i(e.r.root?.querySelector(`canvas[data-pxd-id="${CSS.escape(t.id)}"]`)??null)),o("canvas",{class:"pxd-qr",role:"img","aria-label":r||`QR code: ${a}`,...d,ref:i})}function Tr(e,t){let a=t.b,r=e.kind==="error",d=t.a11y(e);return t.r.statusDrawn(e,t.scope),e.kind==="undo"?o("div",{class:"pxd-snackbar",role:"status",...d},o("p",{class:"pxd-snackbar-text"},a.text(e.title),e.message!==void 0&&o("span",{class:"pxd-snackbar-message"},` ${a.text(e.message)}`)),e.action&&t.render(e.action)):o("div",{class:`pxd-status pxd-status-${e.kind}${e.variant==="inline"?" pxd-status-notice":""}`,role:r?"alert":"status",...d},e.kind==="loading"?o("span",{class:"pxd-spinner","aria-hidden":"true"}):o("span",{class:"pxd-status-icon","aria-hidden":"true"},D(e.icon??$a[e.kind],e.kind==="empty"?28:16)),o("div",{class:"pxd-status-body"},o("p",{class:"pxd-status-title"},a.text(e.title)),e.message!==void 0&&o("p",{class:"pxd-status-message"},a.text(e.message)),e.action&&e.variant!=="inline"&&o("div",{class:"pxd-status-action"},t.render(e.action))),e.action&&e.variant==="inline"&&o("div",{class:"pxd-status-action"},t.render(e.action)))}var vt=(e,t,a,r)=>{let{tag:d,attrs:p}=Qa(e,t,a);return o(d,{...p,fill:r})};function Rr(e,t){let a=t.b,r=t.r,d=t.id(e,"title"),p=t.id(e,"summary"),i=O(e.data.path,a.scope),n=Z(_(r.data,i)).map((z,M)=>K(i,M)),l=z=>_(r.data,O(e.x.path,{pointer:z})),c=(z,M)=>Number(_(r.data,O(M.path,{pointer:z})))||0,s=e.series,u=t.a11y(e),x=(z,M)=>G(z,X(M,r.data,a.scope),r.locale),m=z=>x(l(z),e.x.format),g=600-Q.left-Q.right,f=240-Q.top-Q.bottom,y=()=>o("details",{class:"pxd-chart-data"},o("summary",null,"Show data"),o("table",{class:"pxd-table"},o("thead",null,o("tr",null,o("th",{scope:"col"},a.text(e.x.label)),...s.map((z,M)=>o("th",{scope:"col",key:M,class:"pxd-num"},a.text(z.label))))),o("tbody",null,...n.map(z=>o("tr",{key:z},o("th",{scope:"row"},x(l(z),e.x.format)),...s.map((M,S)=>o("td",{key:S,class:"pxd-num"},x(c(z,M),M.format)))))))),h=(z,M)=>o("figure",{class:"pxd-chart","aria-labelledby":d,"aria-describedby":p,...u},o("figcaption",null,o("span",{class:"pxd-chart-title",id:d},a.text(e.title)),o("span",{class:"pxd-chart-summary",id:p},a.text(e.summary))),z,M,y()),k=s.length>1&&o("ul",{class:"pxd-chart-legend"},...s.map((z,M)=>o("li",{key:M},o("svg",{width:"12",height:"12","aria-hidden":"true"},vt(De[M],6,6,ee(M))),a.text(z.label)))),A=(z,M,...S)=>o("svg",{viewBox:z,class:M,"aria-hidden":"true"},...S);if(e.intent==="relationship"){let z=n.map(B=>Number(l(B))||0),M=n.flatMap(B=>s.map(H=>c(B,H))),S=Ve(Math.max(0,...z)),P=Ve(Math.max(0,...M)),V=B=>Q.left+B/(S||1)*g,j=B=>Q.top+f-B/(P||1)*f;return h(A(`0 0 ${600} ${240}`,"pxd-chart-svg",o("g",{class:"pxd-chart-axis"},...[0,.5,1].map(B=>o("g",{key:B},o("line",{x1:Q.left,x2:600-Q.right,y1:j(P*B),y2:j(P*B),class:"pxd-chart-grid"}),o("text",{x:Q.left-8,y:j(P*B)+4,"text-anchor":"end"},x(P*B,{...s[0].format??{type:"number"},precision:0})))),...[0,.5,1].map(B=>o("text",{key:`x${B}`,x:V(S*B),y:230,"text-anchor":B===0?"start":B===1?"end":"middle"},x(S*B,{...e.x.format??{type:"number"},precision:0})))),...s.map((B,H)=>o("g",{key:H},...n.map((L,U)=>vt(De[H],V(z[U]),j(c(L,B)),ee(H)))))),k)}if(e.intent==="range"){let M=Q.top+n.length*28+24,S=n.map(L=>c(L,s[0])),P=n.map(L=>c(L,s[1]??s[0])),V=Math.min(0,...S),j=Ve(Math.max(...P,1)),B=120,H=L=>B+(L-V)/(j-V||1)*(600-B-Q.right);return h(A(`0 0 ${600} ${M}`,"pxd-chart-svg",o("g",{class:"pxd-chart-axis"},...[0,.5,1].map(L=>{let U=V+(j-V)*L;return o("g",{key:L},o("line",{x1:H(U),x2:H(U),y1:Q.top,y2:M-20,class:"pxd-chart-grid"}),o("text",{x:H(U),y:M-4,"text-anchor":"middle"},x(U,{...s[0].format??{type:"number"},precision:0})))})),...n.map((L,U)=>{let R=Q.top+U*28;return o("g",{key:L},o("text",{x:B-8,y:R+28/2+4,"text-anchor":"end",class:"pxd-chart-range-label"},mt(l(L),e.x.format?.type,r.locale)),o("line",{x1:H(S[U]),x2:H(P[U]),y1:R+28/2,y2:R+28/2,stroke:ee(0),"stroke-width":10,"stroke-linecap":"round"}),o("circle",{cx:H(S[U]),cy:R+28/2,r:4,fill:ee(1)}),o("circle",{cx:H(P[U]),cy:R+28/2,r:4,fill:ee(2)}))})),o("ul",{class:"pxd-chart-legend"},o("li",null,o("span",{class:"pxd-chart-swatch",style:{background:ee(1)},"aria-hidden":"true"}),a.text(s[0].label)),s[1]&&o("li",null,o("span",{class:"pxd-chart-swatch",style:{background:ee(2)},"aria-hidden":"true"}),a.text(s[1].label))))}if(e.intent==="matrix"){let z=n.map(S=>s.map(P=>c(S,P))),M=Math.max(1,...z.flat());return h(o("div",{class:"pxd-heatmap-scroll","aria-hidden":"true"},o("table",{class:"pxd-heatmap"},o("thead",null,o("tr",null,o("th",null),...s.map((S,P)=>o("th",{key:P,scope:"col"},a.text(S.label))))),o("tbody",null,...n.map((S,P)=>o("tr",{key:S},o("th",{scope:"row"},m(S)),...s.map((V,j)=>{let B=Math.round(z[P][j]/M*100);return o("td",{key:j,class:`pxd-heatmap-cell${B>=60?" pxd-heatmap-strong":""}`,style:{background:`color-mix(in srgb, var(--pxd-color-data-categorical-1) ${B}%, var(--pxd-color-surface-subtle))`}},x(z[P][j],V.format))})))))))}if(e.intent==="hierarchy"){let z=n.map(S=>Math.max(0,c(S,s[0]))),M=Ja(z,600,240);return h(A(`0 0 ${600} ${240}`,"pxd-chart-svg pxd-chart-treemap",...M.map((S,P)=>S&&o("g",{key:P},o("rect",{x:S.x+1,y:S.y+1,width:Math.max(S.w-2,0),height:Math.max(S.h-2,0),fill:ee(P),rx:2}),S.w>48&&S.h>24&&o("text",{x:S.x+8,y:S.y+18,class:"pxd-chart-tile-label"},m(n[P]).slice(0,Math.floor(S.w/8)))))),o("ul",{class:"pxd-chart-legend"},...n.map((S,P)=>o("li",{key:S},o("span",{class:"pxd-chart-swatch",style:{background:ee(P)},"aria-hidden":"true"}),`${m(S)}: ${x(z[P],s[0].format)}`))))}if(e.intent==="flow"){let z=n.map(oe=>s.map(Y=>Math.max(0,c(oe,Y)))),{leftY:M,rightY:S,leftTotals:P,rightTotals:V,scale:j}=eo(z,s.length,240),B=12,H=110,L=H,U=600-H,R=[...M],q=[...S],le=(L+U)/2;return h(A(`0 0 ${600} ${240}`,"pxd-chart-svg pxd-chart-flow",...z.flatMap((oe,Y)=>oe.map((fe,Ae)=>{if(fe<=0)return null;let se=fe*j,at=R[Y],ot=q[Ae];R[Y]+=se,q[Ae]+=se;let md=`M${L+B} ${at} C${le} ${at}, ${le} ${ot}, ${U-B} ${ot} L${U-B} ${ot+se} C${le} ${ot+se}, ${le} ${at+se}, ${L+B} ${at+se} Z`;return o("path",{key:`${Y}-${Ae}`,d:md,fill:ee(Ae),opacity:.45})})),...n.map((oe,Y)=>o("g",{key:oe},o("rect",{x:L,y:M[Y],width:B,height:Math.max(P[Y]*j,1),fill:"var(--pxd-color-border-strong)"}),o("text",{x:L-8,y:M[Y]+P[Y]*j/2+4,"text-anchor":"end",class:"pxd-chart-flow-label"},m(oe)))),...s.map((oe,Y)=>o("g",{key:`s${Y}`},o("rect",{x:U-B,y:S[Y],width:B,height:Math.max(V[Y]*j,1),fill:ee(Y)}),o("text",{x:U+8,y:S[Y]+V[Y]*j/2+4,class:"pxd-chart-flow-label"},a.text(oe.label))))),k)}if(e.intent==="composition"){let z=n.map(j=>c(j,s[0])),M=z.reduce((j,B)=>j+B,0)||1,S=0,P=z.map((j,B)=>{let H=j/M*598,L=o("rect",{key:B,x:1+S,y:4,width:Math.max(H-2,0),height:40,fill:ee(B),rx:2});return S+=H,L}),V=n.map((j,B)=>({label:G(l(j),X(e.x.format,r.data,a.scope),r.locale),value:z[B],color:ee(B),share:z[B]/M}));return o("figure",{class:"pxd-chart","aria-labelledby":d,"aria-describedby":p,...u},o("figcaption",null,o("span",{class:"pxd-chart-title",id:d},a.text(e.title)),o("span",{class:"pxd-chart-summary",id:p},a.text(e.summary))),o("svg",{viewBox:`0 0 ${600} 48`,class:"pxd-chart-svg pxd-chart-bar","aria-hidden":"true",preserveAspectRatio:"none"},o("g",null,...P)),o("ul",{class:"pxd-chart-legend"},...V.map(j=>o("li",{key:j.label},o("span",{class:"pxd-chart-swatch",style:{background:j.color},"aria-hidden":"true"}),`${j.label}: ${G(j.value,X(s[0].format,r.data,a.scope),r.locale)} (${G(j.share,{type:"percent",precision:0},r.locale)})`))),y())}let C=n.flatMap(z=>s.map(M=>c(z,M))),{lo:I,max:E,ticks:F}=Za(C,e.intent==="trend"),$=z=>Q.top+f-(z-I)/(E-I||1)*f,T=g/Math.max(n.length,1),b=n.map(z=>mt(l(z),e.x.format?.type,r.locale)),v=Ya(b,g),w=o("g",{class:"pxd-chart-axis"},...F.map(z=>o("g",{key:z},o("line",{x1:Q.left,x2:600-Q.right,y1:$(z),y2:$(z),class:"pxd-chart-grid"}),o("text",{x:Q.left-8,y:$(z)+4,"text-anchor":"end"},G(z,{...X(s[0].format,r.data,a.scope)??{type:"number"},precision:0},r.locale)))),...b.flatMap((z,M)=>M%v?[]:[o("text",{key:n[M],x:Q.left+T*M+T/2,y:230,"text-anchor":"middle"},z)])),N;if(e.intent==="trend")N=s.map((z,M)=>{let S=n.map((P,V)=>[Q.left+T*V+T/2,$(c(P,z))]);return o("g",{key:M},o("polyline",{points:S.map(([P,V])=>`${P},${V}`).join(" "),fill:"none",stroke:ee(M),"stroke-width":2.5}),...S.map(([P,V])=>vt(De[M],P,V,ee(M))))});else{let z=e.intent==="distribution",M=z?1:.7,S=T*M/s.length;N=n.flatMap((P,V)=>s.map((j,B)=>{let H=c(P,j),L=$(Math.max(H,0));return o("rect",{key:`${V}-${B}`,x:Q.left+T*V+T*((1-M)/2)+S*B,y:L,width:S-(z?1:2),height:Math.max($(0)-L,1),fill:ee(B),rx:z?0:2})}))}return o("figure",{class:"pxd-chart","aria-labelledby":d,"aria-describedby":p,...u},o("figcaption",null,o("span",{class:"pxd-chart-title",id:d},a.text(e.title)),o("span",{class:"pxd-chart-summary",id:p},a.text(e.summary))),A(`0 0 ${600} ${240}`,"pxd-chart-svg",w,...N),s.length>1&&o("ul",{class:"pxd-chart-legend"},...s.map((z,M)=>o("li",{key:M},o("svg",{width:"12",height:"12","aria-hidden":"true"},vt(De[M],6,6,ee(M))),a.text(z.label)))),y())}var Ee=()=>o("span",{class:"pxd-required","aria-hidden":"true"},"*");function ke({label:e,help:t,required:a,id:r,helpId:d},...p){return o("div",{class:"pxd-field"},o("label",{class:"pxd-field-label",for:r},e,a&&Ee()),t&&o("p",{class:"pxd-field-help",id:d},t),...p)}var Vd={email:"email",phone:"tel",url:"url",search:"search",number:"text",currency:"text",text:"text"},te=e=>e.target.value;function $r(e,t){let a=t.b,r=t.r,d=t.id(e),p=t.id(e,"help"),i=e.kind??"text",n=a.value(e.value),l=i==="number"||i==="currency",[c,s]=t.state(e,"draft",null),u=ma(n,i),x=c??u,m=e.validation??{},g=e.help!==void 0?a.text(e.help):void 0,f={id:d,class:"pxd-input","aria-describedby":g?p:void 0,required:e.required,autocomplete:e.autocomplete,...t.a11y(e)},y=E=>{if(!l)return a.write(e.value,E);s(E),a.write(e.value,ga(E))},h=E=>{m.message&&E.currentTarget.setCustomValidity(a.text(m.message))},k=E=>E.currentTarget.setCustomValidity(""),C={label:a.text(e.label),help:g,required:e.required,id:d,helpId:p};if(i==="suggestions"||i==="mentions")return _d(e,t,C,f,i==="mentions");if(i==="tags")return qd(e,t,C,f);if(i==="richtext")return Wd(e,t,C,f);if(i==="inline")return Kd(e,t,C,f);if(i==="masked"){let E=typeof e.mask=="string"?e.mask:"";return ke(C,o("input",{...f,class:"pxd-input pxd-input-masked",type:"text",inputmode:fa(E)?"numeric":void 0,placeholder:E||void 0,value:u,maxlength:E.length||void 0,onInput:F=>(k(F),a.write(e.value,ua(E,te(F),te(F).length<u.length))),onInvalid:h}))}if(i==="code")return ke(C,o("textarea",{...f,class:"pxd-input pxd-input-code",rows:4,spellcheck:"false",autocorrect:"off",autocapitalize:"off",value:x,maxlength:m.maxLength,minlength:m.minLength,onInput:E=>(k(E),y(te(E))),onInvalid:h}));if(i==="search"){let E=e.placeholder!==void 0?a.text(e.placeholder):void 0;return o("div",{class:"pxd-search"},o("label",{class:"pxd-sr-only",for:d},a.text(e.label)),D("search"),o("input",{...f,class:"pxd-search-input",type:"search",placeholder:E,value:x,onInput:F=>y(te(F))}))}if(e.size==="hero"&&l)return o("div",{class:"pxd-hero-field"},o("label",{class:"pxd-hero-label",for:d},a.text(e.label)),o("div",{class:"pxd-hero-input"},i==="currency"&&o("span",{class:"pxd-hero-symbol","aria-hidden":"true"},dt(a.text(e.currency)||"USD",r.locale)),o("input",{...f,class:"pxd-hero-value",type:"text",inputmode:i==="currency"?"decimal":"numeric",pattern:"-?[0-9]*[.,]?[0-9]*",placeholder:"0",size:Math.max(1,x.length||1),value:x,onInput:E=>(k(E),y(te(E))),onBlur:()=>s(null),onInvalid:h})),g&&o("p",{class:"pxd-field-help pxd-hero-help",id:p},g));let I=i==="multiline"?o("textarea",{...f,rows:3,value:x,maxlength:m.maxLength,minlength:m.minLength,onInput:E=>(k(E),y(te(E))),onInvalid:h}):o("div",{class:i==="currency"?"pxd-input-adorned":void 0},i==="currency"&&o("span",{class:"pxd-input-prefix","aria-hidden":"true"},dt(a.text(e.currency)||"USD",r.locale)),o("input",{...f,type:Vd[i]??"text",inputmode:i==="currency"?"decimal":i==="number"?"numeric":void 0,pattern:l?"-?[0-9]*[.,]?[0-9]*":void 0,value:x,maxlength:m.maxLength,minlength:m.minLength,onInput:E=>(k(E),y(te(E))),onBlur:()=>s(null),onInvalid:h}));return ke(C,I)}function Od(e,t,a,r){let d=t.id(e,"list"),[p,i]=t.state(e,"open",!1),[n,l]=t.state(e,"active",-1),c=p&&a.length>0,s=m=>{if(!c){m.key==="ArrowDown"&&a.length&&(i(!0),l(0),m.preventDefault());return}m.key==="ArrowDown"?(l(g=>(g+1)%a.length),m.preventDefault()):m.key==="ArrowUp"?(l(g=>(g-1+a.length)%a.length),m.preventDefault()):m.key==="Enter"&&n>=0?(r(a[n]),i(!1),m.preventDefault()):m.key==="Escape"&&i(!1)},u={role:"combobox","aria-expanded":c,"aria-controls":d,"aria-autocomplete":"list","aria-activedescendant":c&&n>=0?`${d}-${n}`:void 0,autocomplete:"off",onKeydown:s,onBlur:()=>i(!1)};return{list:c?o("ul",{id:d,role:"listbox",class:"pxd-combobox-list"},...a.map((m,g)=>o("li",{key:String(m.value),id:`${d}-${g}`,role:"option","aria-selected":g===n,class:`pxd-combobox-option${g===n?" pxd-combobox-active":""}`,onMousedown:f=>(f.preventDefault(),r(m),i(!1))},m.label,m.description&&o("span",{class:"pxd-option-description"},m.description)))):null,inputProps:u,show:m=>(i(m),l(-1))}}function _d(e,t,a,r,d){let p=t.b,i=Se(e,t.r.data,p.scope,p.text),n=String(p.value(e.value)??""),l=d?/@([^\s@]*)$/.exec(n):null,c=d?l?l[1]:null:n,s=c===null?[]:i.filter(x=>x.label.toLowerCase().includes(c.toLowerCase())).slice(0,8),u=Od(e,t,s,x=>p.write(e.value,d&&l?`${n.slice(0,l.index)}@${x.label} `:x.label));return ke(a,o("div",{class:"pxd-combobox"},o("input",{...r,...u.inputProps,type:"text",value:n,onInput:x=>{let m=te(x);p.write(e.value,m),u.show(d?/@[^\s@]*$/.test(m):m.length>0)},onFocus:()=>u.show(!d&&n.length>0)}),u.list))}function qd(e,t,a,r){let d=t.b,p=d.value(e.value),i=Array.isArray(p)?p.map(String):[],[n,l]=t.state(e,"tags",""),c=(u=n)=>{let x=ya(i,u);x!==i&&d.write(e.value,x),l("")},s=u=>d.write(e.value,i.filter((x,m)=>m!==u));return ke(a,o("div",{class:"pxd-tags",role:"group","aria-label":a.label},o("ul",{class:"pxd-tags-list"},...i.map((u,x)=>o("li",{key:`${u}-${x}`,class:"pxd-tag-chip"},u,o("button",{type:"button",class:"pxd-tag-remove","aria-label":`Remove ${u}`,onClick:()=>s(x)},D("close",14))))),o("input",{...r,class:"pxd-tags-input",type:"text",value:n,onInput:u=>te(u).endsWith(",")?c(te(u)):l(te(u)),onKeydown:u=>{u.key==="Enter"?(u.preventDefault(),c()):u.key==="Backspace"&&n===""&&i.length&&s(i.length-1)},onBlur:()=>c()})))}function Pr(e){if(e.nodeType===3)return e.textContent??"";if(e.nodeType!==1)return"";let t=e,a=(r=t)=>Array.from(r.childNodes).map(Pr).join("");switch(t.tagName.toLowerCase()){case"b":case"strong":return`**${a()}**`;case"i":case"em":return`*${a()}*`;case"br":return`
23
23
  `;case"ul":return Array.from(t.children).map(r=>`- ${a(r)}`).join(`
24
24
  `)+`
25
25
  `;case"ol":return Array.from(t.children).map((r,d)=>`${d+1}. ${a(r)}`).join(`
26
26
  `)+`
27
27
  `;case"div":case"p":case"li":return a()+`
28
- `;default:return a()}}function zr(e){let t=[],a=/\*\*([^*]+)\*\*|\*([^*]+)\*/g,r=0;for(let d=a.exec(e);d;d=a.exec(e)){d.index>r&&t.push(document.createTextNode(e.slice(r,d.index)));let p=document.createElement(d[1]?"strong":"em");p.textContent=d[1]??d[2],t.push(p),r=d.index+d[0].length}return r<e.length&&t.push(document.createTextNode(e.slice(r))),t}function Rd(e){let t=[],a=null;for(let r of e.split(`
29
- `)){let d=/^(-|\d+\.)\s+(.*)$/.exec(r);if(d){let i=d[1]==="-"?"ul":"ol";(!a||a.tagName.toLowerCase()!==i)&&(a=document.createElement(i),t.push(a));let l=document.createElement("li");l.append(...zr(d[2])),a.append(l);continue}a=null;let p=document.createElement("div");r?p.append(...zr(r)):p.append(document.createElement("br")),t.push(p)}return t}function Ud(e,t,a,r){let d=t.b,p=String(d.value(e.value)??""),i=m=>d.write(e.value,Ir(m).replace(/\n+$/,"")),l=m=>g=>{g.preventDefault();let f=g.currentTarget.closest(".pxd-richtext")?.querySelector(".pxd-richtext-area");f&&(f.focus(),document.execCommand(m),i(f))},{id:n,class:c,required:s,autocomplete:u,...x}=r;return ve(a,o("div",{class:"pxd-richtext"},o("div",{class:"pxd-richtext-toolbar",role:"toolbar","aria-label":"Formatting"},o("button",{type:"button",class:"pxd-richtext-control","aria-label":"Bold",onMousedown:l("bold")},o("strong",null,"B")),o("button",{type:"button",class:"pxd-richtext-control","aria-label":"Italic",onMousedown:l("italic")},o("em",null,"I")),o("button",{type:"button",class:"pxd-richtext-control","aria-label":"Bulleted list",onMousedown:l("insertUnorderedList")},P("menu",16))),o("div",{...x,id:n,class:"pxd-input pxd-richtext-area",contenteditable:"true",role:"textbox","aria-multiline":"true","aria-label":a.label,ref:m=>{let g=m;!g||g.dataset.ready||(g.dataset.ready="1",g.replaceChildren(...Rd(p)))},onInput:m=>i(m.currentTarget),onBlur:m=>i(m.currentTarget)})))}function Hd(e,t,a,r){let d=t.b,p=String(d.value(e.value)??""),[i,l]=t.state(e,"inline",null),n=()=>{i!==null&&d.write(e.value,i),l(null)};return i===null?o("div",{class:"pxd-inline-edit"},o("span",{class:"pxd-field-label"},a.label),o("button",{type:"button",class:"pxd-inline-value","aria-label":`Edit ${a.label}`,onClick:()=>l(p)},o("span",{class:p?void 0:"pxd-inline-empty"},p||"Not set"),o("span",{class:"pxd-inline-hint","aria-hidden":"true"},"Edit"))):ve(a,o("input",{...r,type:"text",value:i,ref:c=>c&&!c.dataset.focused&&(c.dataset.focused="1",c.focus()),onInput:c=>l(te(c)),onBlur:n,onKeydown:c=>{c.key==="Enter"?(c.preventDefault(),n()):c.key==="Escape"&&l(null)}}))}var Cr=(e,t,a)=>o("div",{class:"pxd-option-text"},o("label",{for:e},t),a&&o("span",{class:"pxd-option-description",id:`${e}-desc`},a)),Fe=(e,...t)=>o("span",{"data-state":"checked",class:e,style:{pointerEvents:"none"}},...t);function Er(e,t){let a=t.b,r=t.id(e,"label"),d=t.id(e,"help"),p=Se(e,t.r.data,a.scope,a.text),[i,l]=t.state(e,"query",""),n=Ct(p,e.mode),{multiple:c,withFaces:s,searchable:u}=n,x=n.control==="chips",m=a.value(e.value),g=ge,f=w=>Et(r,w),y=e.help!==void 0?a.text(e.help):void 0,h=t.a11y(e),k=a.text(e.label),I=o("div",{class:"pxd-field-label",id:r},k,e.required&&Ae()),S=y&&o("p",{class:"pxd-field-help",id:d},y),N=u&&o("div",{class:"pxd-search pxd-search-compact"},P("search"),o("input",{type:"search",class:"pxd-search-input",placeholder:It(s),"aria-label":`Search ${k}`,value:i,onInput:w=>l(te(w))})),M=w=>ot(w,i);if(c){let w=b=>Mt(m,b),v=b=>a.write(e.value,At(m,b));if(x)return o("div",{class:"pxd-field pxd-choice",role:"group","aria-labelledby":r,"aria-describedby":y?d:void 0,...h},I,S,o("div",{class:"pxd-chips"},...p.map(b=>xe({key:g(b.value),class:"pxd-chip",checked:w(b.value),onCheckedChange:()=>v(b.value),indicator:Fe("pxd-chip-check",P("check",18))},b.label))));if(s){let{recent:b,rest:z}=rt(p,i);return o("fieldset",{class:"pxd-field pxd-choice pxd-people","aria-describedby":y?d:void 0,...h},o("legend",{class:"pxd-field-label",id:r},k),S,N,o("div",{class:"pxd-people-group"},b.length>0&&o("div",{class:"pxd-people-recent"},...b.map(C=>xe({key:g(C.value),class:"pxd-person-tile",checked:w(C.value),onCheckedChange:()=>v(C.value),"aria-label":C.label,indicator:null},o("span",{class:"pxd-person-face"},oe(t,{value:C.avatar,name:C.label,size:56}),w(C.value)&&Fe("pxd-person-tick",P("check",14))),o("span",{class:"pxd-person-name","aria-hidden":"true"},C.label.split(" ")[0])))),o("div",{class:"pxd-people-list"},...z.map(C=>{let E=f(C.value);return xe({key:g(C.value),id:E,class:"pxd-person-row",checked:w(C.value),onCheckedChange:()=>v(C.value),"aria-labelledby":`${E}-name`,"aria-describedby":C.description?`${E}-desc`:void 0,indicator:null},oe(t,{value:C.avatar,name:C.label}),o("span",{class:"pxd-person-text"},o("span",{id:`${E}-name`},C.label),C.description&&o("span",{class:"pxd-option-description",id:`${E}-desc`},C.description)),w(C.value)&&Fe("pxd-person-check",P("check")))}))))}return o("fieldset",{class:"pxd-field pxd-choice","aria-describedby":y?d:void 0,...h},o("legend",{class:"pxd-field-label",id:r},k),S,N,o("div",{class:`pxd-choice-list${u?" pxd-choice-scroll":""}`},...p.filter(M).map(b=>{let z=f(b.value);return o("div",{class:"pxd-choice-option",key:g(b.value)},b.avatar!==void 0&&oe(t,{value:b.avatar,name:b.label,size:32}),xe({id:z,class:"pxd-checkbox",checked:w(b.value),onCheckedChange:()=>v(b.value),"aria-describedby":b.description?`${z}-desc`:void 0,indicator:Fe("pxd-checkbox-indicator","\u2713")}),Cr(z,b.label,b.description))})))}let F=m==null?"":g(m),j=w=>a.write(e.value,p.find(v=>g(v.value)===w)?.value),T=(w,v,b,z,...C)=>Ue({key:g(w.value),value:g(w.value),group:F,first:v===0,onSelect:()=>j(g(w.value)),indicator:z,...b},...C);if(x)return o("div",{class:"pxd-field pxd-choice",...h},I,S,Ce({class:"pxd-chips","aria-labelledby":r,"aria-describedby":y?d:void 0,"aria-required":e.required||void 0,value:F,onValueChange:j,orientation:"horizontal"},...p.map((w,v)=>T(w,v,{class:"pxd-chip","data-orientation":"horizontal"},Fe("pxd-chip-check",P("check",18)),w.label))));if(s){let{recent:w,rest:v}=rt(p,i);return o("div",{class:"pxd-field pxd-choice pxd-people",...h},I,S,N,Ce({"aria-labelledby":r,"aria-describedby":y?d:void 0,"aria-required":e.required||void 0,value:F,onValueChange:j,class:"pxd-people-group"},w.length>0&&o("div",{class:"pxd-people-recent",role:"presentation"},...w.map((b,z)=>T(b,z,{class:"pxd-person-tile","aria-label":b.label},null,oe(t,{value:b.avatar,name:b.label,size:56}),o("span",{class:"pxd-person-name","aria-hidden":"true"},b.label.split(" ")[0])))),o("div",{class:"pxd-people-list",role:"presentation"},...v.map((b,z)=>{let C=f(b.value);return T(b,w.length+z,{id:C,class:"pxd-person-row","aria-labelledby":`${C}-name`,"aria-describedby":b.description?`${C}-desc`:void 0},null,oe(t,{value:b.avatar,name:b.label}),o("span",{class:"pxd-person-text"},o("span",{id:`${C}-name`},b.label),b.description&&o("span",{class:"pxd-option-description",id:`${C}-desc`},b.description)),F===g(b.value)&&Fe("pxd-person-check",P("check")))}))))}return o("div",{class:"pxd-field pxd-choice",...h},I,S,N,Ce({class:`pxd-choice-list${u?" pxd-choice-scroll":""}`,"aria-labelledby":r,"aria-describedby":y?d:void 0,"aria-required":e.required||void 0,value:F,onValueChange:j,orientation:"vertical"},...p.filter(M).map((w,v)=>{let b=f(w.value);return o("div",{class:"pxd-choice-option",key:g(w.value)},T(w,v,{id:b,class:"pxd-radio","aria-describedby":w.description?`${b}-desc`:void 0,"data-orientation":"vertical"},o("span",{"data-state":"checked",class:"pxd-radio-indicator",style:{pointerEvents:"none"}})),Cr(b,w.label,w.description))})))}function Nr(e,t){let a=t.b,r=t.id(e),d=t.id(e,"desc"),p=!!a.value(e.value),i=e.description!==void 0?a.text(e.description):void 0,l=c=>{a.write(e.value,c),e.action&&t.r.dispatch({event:{name:e.action.event.name,context:Ne(e,t.r.data,a.scope,c)}},{pointer:""},e.id)},n=t.a11y(e);return o("div",{class:"pxd-toggle"},e.action?Zo({id:r,class:"pxd-switch",checked:p,onCheckedChange:l,"aria-describedby":i?d:void 0,...n}):xe({id:r,class:"pxd-checkbox",checked:p,onCheckedChange:c=>l(c===!0),"aria-describedby":i?d:void 0,...n,indicator:Fe("pxd-checkbox-indicator","\u2713")}),o("div",{class:"pxd-toggle-text"},o("label",{for:r,class:"pxd-toggle-label"},a.text(e.label)),i&&o("p",{class:"pxd-field-help",id:d},i)))}var Ar={date:"date",time:"time",datetime:"datetime-local",month:"month"};function Tr(e,t){let a=t.b,r=t.r,d=t.id(e),p=t.id(e,"help"),i=e.kind??"date",l=e.help!==void 0?a.text(e.help):void 0,n=a.value(e.value),c=e.min!==void 0?a.text(e.min):void 0,s=e.max!==void 0?a.text(e.max):void 0,u=t.a11y(e),x=a.text(e.label);if(e.multiple&&i!=="dateRange"){let m=Array.isArray(n)?n.map(String):[],g=h=>G(h,{type:i==="month"?"date":i==="time"?"time":i==="datetime"?"datetime":"date"},r.locale),f=h=>h&&!m.includes(h)&&a.write(e.value,[...m,h].sort()),y=h=>{let k=h.currentTarget;f(k.value),k.value=""};return o("fieldset",{class:"pxd-field pxd-date-multiple",...u},o("legend",{class:"pxd-field-label"},x,e.required&&Ae()),l&&o("p",{class:"pxd-field-help",id:p},l),m.length>0&&o("ul",{class:"pxd-tags-list","aria-label":`Chosen ${x}`},...m.map(h=>o("li",{key:h,class:"pxd-tag-chip"},i==="year"||i==="month"?h:g(h),o("button",{type:"button",class:"pxd-tag-remove","aria-label":`Remove ${h}`,onClick:()=>a.write(e.value,m.filter(k=>k!==h))},P("close",14))))),o("label",{class:"pxd-date-add",for:d},o("span",{class:"pxd-sr-only"},"Add a date"),i==="year"?o("input",{id:d,class:"pxd-input pxd-input-year",inputmode:"numeric",pattern:"[0-9]{4}",maxlength:4,placeholder:"YYYY","aria-describedby":l?p:void 0,onKeydown:h=>h.key==="Enter"&&(h.preventDefault(),y(h)),onBlur:y}):o("input",{id:d,class:"pxd-input pxd-input-date",type:Ar[i],min:c,max:s,"aria-describedby":l?p:void 0,onChange:y})))}if(i==="year")return ve({label:x,help:l,required:e.required,id:d,helpId:p},o("input",{id:d,class:"pxd-input pxd-input-year",inputmode:"numeric",pattern:"[0-9]{4}",maxlength:4,placeholder:"YYYY",value:n??"",min:c,max:s,required:e.required,"aria-describedby":l?p:void 0,onInput:m=>a.write(e.value,te(m).replace(/\D/g,"").slice(0,4)||null),...u}));if(i==="dateRange"){let[m,g]=Array.isArray(n)?n:[],f=(y,h)=>{let k=[m??null,g??null];k[y]=h||null,a.write(e.value,k)};return o("fieldset",{class:"pxd-field",...u},o("legend",{class:"pxd-field-label"},x),l&&o("p",{class:"pxd-field-help"},l),o("div",{class:"pxd-date-range"},o("label",null,"From",o("input",{class:"pxd-input",type:"date",value:m??"",min:c,max:s,required:e.required,onChange:y=>f(0,te(y))})),o("label",null,"To",o("input",{class:"pxd-input",type:"date",value:g??"",min:m??c,max:s,required:e.required,onChange:y=>f(1,te(y))}))))}return ve({label:x,help:l,required:e.required,id:d,helpId:p},o("input",{id:d,class:`pxd-input pxd-input-date${i==="month"?" pxd-input-month":""}`,type:Ar[i],value:n??"",min:c,max:s,required:e.required,"aria-describedby":l?p:void 0,onChange:m=>a.write(e.value,te(m)||null),...u}))}function Rr(e,t){let a=t.b,r=t.r,d=t.id(e,"label"),p=t.id(e,"min"),i=t.id(e,"max"),l=s=>G(s,X(e.format??{type:"number"},r.data,a.scope),r.locale),n=t.a11y(e);if(e.mode==="range"){let s=a.value(e.value),[u,x]=Array.isArray(s)?s.map(Number):[e.min,e.max],m=(g,f)=>a.write(e.value,[Math.max(e.min,Math.min(g,f)),Math.min(e.max,Math.max(g,f))]);return o("div",{class:"pxd-field pxd-range",role:"group","aria-labelledby":d,...n},o("div",{class:"pxd-range-header"},o("span",{class:"pxd-field-label",id:d},a.text(e.label)),o("output",{class:"pxd-range-value","aria-live":"polite"},`${l(u)} \u2013 ${l(x)}`)),bo({min:e.min,max:e.max,step:e.step??1,values:[u,x],minStepsBetweenThumbs:1,onValueChange:([g,f])=>m(g,f),thumbs:[{"aria-label":"Minimum","aria-valuetext":l(u)},{"aria-label":"Maximum","aria-valuetext":l(x)}]}),o("div",{class:"pxd-range-fields"},o("label",{for:p},o("span",null,"Minimum"),o("input",{id:p,class:"pxd-input",inputmode:"numeric",value:String(u),onInput:g=>m(Number(te(g))||e.min,x)})),o("span",{"aria-hidden":"true"},"\u2013"),o("label",{for:i},o("span",null,"Maximum"),o("input",{id:i,class:"pxd-input",inputmode:"numeric",value:String(x),onInput:g=>m(u,Number(te(g))||e.max)}))))}let c=Number(a.value(e.value)??e.min);return o("div",{class:"pxd-field pxd-range",...n},o("div",{class:"pxd-range-header"},o("span",{class:"pxd-field-label",id:d},a.text(e.label)),o("output",{class:"pxd-range-value","aria-live":"polite"},l(c))),bo({min:e.min,max:e.max,step:e.step??1,values:[c],onValueChange:([s])=>a.write(e.value,s),thumbs:[{"aria-labelledby":d,"aria-valuetext":l(c)}]}),o("div",{class:"pxd-range-bounds","aria-hidden":"true"},o("span",null,l(e.min)),o("span",null,l(e.max))))}function Fd(e){return(e.labels?.[0]?.textContent??e.getAttribute("aria-label")??e.closest(".pxd-field")?.querySelector(".pxd-field-label, legend")?.textContent??"").replace(/\*\s*$/,"").trim()}function $d(e,t){let a=new Set,r=[];for(let d of Array.from(e.elements))if(!(!d.willValidate||d.validity.valid)){if(d.type==="radio"&&d.name){if(a.has(d.name))continue;a.add(d.name)}d.id||(d.id=`${t}-${r.length}`),r.push(d)}return r}function Ur(e,t){let a=t.b,r=t.r,d=Math.min(t.heading,6),p=t.id(e,"summary"),[i,l]=t.state(e,"problems",()=>[]),[n]=t.state(e,"marked",()=>({current:[]})),c=(e.children??[]).some(f=>r.byId.get(f)?.required),s=()=>{for(let f of n.current)f.removeAttribute("aria-invalid"),f.pxdDescribed?f.setAttribute("aria-describedby",f.pxdDescribed):f.removeAttribute("aria-describedby"),f.pxdNote?.remove(),f.pxdNote=void 0;n.current=[]},u=f=>{for(let y of f){y.setAttribute("aria-invalid","true");let h=y.closest(".pxd-field");if(h&&!h.querySelector(".pxd-field-error")){let k=h.ownerDocument.createElement("p");k.className="pxd-field-error",k.id=`${y.id}-error`,k.textContent=y.validationMessage,h.append(k),y.pxdNote=k,y.pxdDescribed=y.getAttribute("aria-describedby"),y.setAttribute("aria-describedby",[y.pxdDescribed,k.id].filter(Boolean).join(" "))}}n.current=f},x=f=>{let y=document.getElementById(f);y&&(y.scrollIntoView({block:"center"}),y.focus(),document.activeElement!==y&&y.closest(".pxd-field")?.querySelector("[role='radio'], button, input:not([aria-hidden]), textarea, select")?.focus())},[m,g]=t.state(e,"announced",null);return i!==m&&(g(i),i.length&&t.after(()=>r.root?.querySelector(`[data-pxd-id="${CSS.escape(e.id)}"] .pxd-error-summary`)?.focus())),o("form",{class:`pxd-form${e.aside?" pxd-form-with-aside":""}${e.layout==="horizontal"?" pxd-form-horizontal":""}`,novalidate:!0,onSubmit:f=>{f.preventDefault();let y=f.currentTarget;if(s(),!y.checkValidity()){let h=$d(y,p);return u(h),l(h.map(k=>({id:k.id,label:Fd(k),message:k.validationMessage})))}l([]),r.dispatch(e.submit.action,a.scope,e.id)},...t.a11y(e)},e.aside&&o("aside",{class:"pxd-form-aside"},t.render(e.aside)),o("div",{class:"pxd-stack pxd-form-fields"},i.length>0&&o("section",{class:"pxd-error-summary",role:"alert",tabindex:"-1","aria-labelledby":p},o(`h${d}`,{id:p,class:"pxd-error-summary-title"},"Check these fields before continuing"),o("ul",{class:"pxd-error-summary-list"},...i.map(f=>o("li",{key:f.id},o("a",{href:`#${f.id}`,class:"pxd-link",onClick:y=>(y.preventDefault(),x(f.id))},f.label?`${f.label}: ${f.message}`:f.message))))),c&&o("p",{class:"pxd-required-legend"},o("span",{class:"pxd-required","aria-hidden":"true"},"*")," ","Required"),...be(t,e.children)),o("div",{class:"pxd-action-bar"},o("button",{type:"submit",class:"pxd-button pxd-button-primary"},a.text(e.submit.label)),e.cancel&&o("button",{type:"button",class:"pxd-button pxd-button-secondary",onClick:()=>r.dispatch(e.cancel.action,a.scope,e.id)},a.text(e.cancel.label))))}var Bd=()=>ia(navigator.userAgentData?.platform??navigator.platform??"");function Hr(e,t){let a=t.b,r=t.r,d=t.id(e,"desc"),[p,i]=t.state(e,"copied",!1),l=e.disabled!==void 0?!!a.value(e.disabled):!1,n=e.tone==="danger"?" pxd-button-danger":"",c=e.description!==void 0?a.text(e.description):void 0,s=typeof e.shortcut=="string"&&e.shortcut?oa(e.shortcut,Bd()):void 0,u=()=>{let g=e.action.event.name;if(g==="ui.back"&&t.steps)return t.steps.back();if(g==="ui.next"&&t.steps)return t.steps.next();if(g==="ui.copy"){let f=ta(e,r.data,a.scope,a.text),y=()=>{i(!0),setTimeout(()=>i(!1),2e3)};typeof navigator<"u"&&navigator.clipboard?.writeText?navigator.clipboard.writeText(f).then(y,()=>{}):y()}r.dispatch(e.action,a.scope,e.id)},x=r.doc.surface.kind==="shell",m=g=>{let f=g;f&&(f.pxdKey&&document.removeEventListener("keydown",f.pxdKey),!(!s||l)&&(f.pxdKey=y=>{let h=r.root;y.defaultPrevented||y.repeat||!h||!f.isConnected||!x&&!h.contains(document.activeElement)&&!(y.target instanceof HTMLElement&&h.contains(y.target))||ra(s,y)&&(da(s)&&Jo(y.target)||(y.preventDefault(),f.click()))},document.addEventListener("keydown",f.pxdKey),r.onDispose(()=>f.pxdKey&&document.removeEventListener("keydown",f.pxdKey))))};return o("button",{type:"button",class:`pxd-button pxd-button-${e.emphasis??"secondary"}${n}${c?" pxd-button-described":""}`,disabled:l,"aria-describedby":c?d:void 0,"aria-keyshortcuts":s?.aria,onClick:u,...t.a11y(e),ref:m},o("span",{class:"pxd-button-label"},p?"Copied":a.text(e.label)),s&&o("span",{class:"pxd-kbd-hint","aria-hidden":"true"},...s.hint.map((g,f)=>o("kbd",{key:f,class:"pxd-kbd"},g))),c&&o("span",{class:"pxd-button-description",id:d},c),e.action.event.name==="ui.copy"&&o("span",{class:"pxd-sr-only","aria-live":"polite"},p?"Copied":""))}function Fr(e,t){let a=t.b,r=t.r,[d,p]=t.state(e,"task",null),i=e.current!==void 0?a.value(e.current):void 0,[l,n]=t.state(e,"step",()=>Rt(i,e.steps.length)),c=e.kind??"wizard",s=o("div",{class:"pxd-action-bar"},o("button",{type:"button",class:"pxd-button pxd-button-primary",onClick:()=>r.dispatch(e.finish.action,a.scope,e.id)},a.text(e.finish.label)));if(c==="guide")return o("div",{class:"pxd-steps pxd-guide",...t.a11y(e)},o("ol",{class:"pxd-guide-list"},...e.steps.map((k,I)=>o("li",{key:k.key,class:"pxd-guide-step"},o("span",{class:"pxd-guide-number","aria-hidden":"true"},I+1),o("div",{class:"pxd-guide-body"},he(t,"pxd-guide-title",a.text(k.title)),t.render(k.content))))),s);if(c==="tasklist"){let k=S=>Ft(S.status!==void 0?a.text(S.status):"todo"),I=e.steps.filter(S=>k(S).label==="Completed").length;return o("div",{class:"pxd-steps pxd-tasklist",...t.a11y(e)},o("p",{class:"pxd-steps-progress"},Bt(I,e.steps.length)),o("ul",{class:"pxd-tasklist-list"},...e.steps.map(S=>{let N=d===S.key,{label:M,tone:F}=k(S),j=M==="Cannot start yet";return o("li",{key:S.key,class:`pxd-task${N?" pxd-task-open":""}`},o("div",{class:"pxd-task-row"},o("button",{type:"button",class:"pxd-task-title","aria-expanded":N,disabled:j,onClick:()=>p($t(d,S.key))},a.text(S.title)),o("span",{class:`pxd-badge pxd-tone-${F} pxd-task-status`},M)),N&&o("div",{class:"pxd-task-content"},t.render(S.content)))})),s)}let u=e.steps.length,x=typeof i=="number"&&e.current?.path?{index:Math.max(0,Math.min(u-1,i)),total:u}:{...l,total:u},m=k=>{let I=Tt(x,{type:"go",index:k});e.current?.path?a.write(e.current,I.index):n(I)},g=x.index,f=e.steps[g],y=Ut(x),h=t.with({steps:{back:()=>m(g-1),next:()=>m(g+1)}});return o("div",{class:"pxd-steps",...t.a11y(e)},o("p",{class:"pxd-steps-progress"},Ht(x)),o("ol",{class:"pxd-steps-list"},...e.steps.map((k,I)=>o("li",{key:k.key,"aria-current":I===g?"step":void 0,class:I<g?"pxd-step-done":I===g?"pxd-step-current":void 0},a.text(k.title)))),o("form",{class:"pxd-steps-content",onSubmit:k=>{k.preventDefault(),y?r.dispatch(e.finish.action,a.scope,e.id):m(g+1)}},he(h,"pxd-steps-title",a.text(f.title)),h.render(f.content),o("div",{class:"pxd-action-bar"},o("button",{type:"submit",class:"pxd-button pxd-button-primary"},y?a.text(e.finish.label):"Continue"),g>0&&o("button",{type:"button",class:"pxd-button pxd-button-secondary",onClick:()=>m(g-1)},"Back"))))}function $r(e,t){let a=t.b,r=t.r,d=r.doc.root===e.id,[p,i]=t.state(e,"open",!0),[l,n]=t.state(e,"typed",""),c=t.id(e,"title"),s=t.id(e,"desc"),u=e.typeToConfirm!==void 0?a.text(e.typeToConfirm):void 0,x=!u||l.trim()===u,m=e.severity==="destructive",g=t.a11y(e),f=()=>{d||i(!1),r.dispatch(e.cancel?.action??{event:{name:"ui.dismiss"}},a.scope,e.id)},y=()=>x&&r.dispatch(e.confirm.action,a.scope,e.id),h=e.subject&&o("div",{class:"pxd-dialog-subject"},oe(t,{value:e.subject.avatar!==void 0?a.value(e.subject.avatar):void 0,name:a.text(e.subject.title),size:56}),o("div",null,o("div",{class:"pxd-dialog-subject-title"},a.text(e.subject.title)),e.subject.subtitle!==void 0&&o("div",{class:"pxd-dialog-subject-sub"},a.text(e.subject.subtitle)))),k=e.amount&&o("div",{class:"pxd-dialog-amount"},a.text(e.amount.value,e.amount.format)),I=Array.isArray(e.consequences)&&o("ul",{class:"pxd-consequences"},...e.consequences.map((w,v)=>o("li",{key:v},o("span",{class:"pxd-consequence-icon"},P(w.icon??"info")),o("span",null,o("span",{class:"pxd-consequence-title"},a.text(w.title)),w.detail!==void 0&&o("span",{class:"pxd-consequence-detail"},a.text(w.detail)))))),S=o("div",{class:"pxd-dialog-description",id:s},e.message!==void 0&&o("p",null,a.text(e.message))),N=e.consequence!==void 0&&o("p",{class:"pxd-dialog-consequence",id:`${s}-consequence`},P("info",18),o("span",null,a.text(e.consequence))),M=(w,v)=>[I,e.summary&&t.render(e.summary),u&&o("div",{class:"pxd-field"},o("label",{class:"pxd-field-label",for:`${e.id}-type`},"Type ",o("strong",null,u)," to confirm"),o("input",{id:`${e.id}-type`,class:"pxd-input",autocomplete:"off",value:l,onInput:b=>n(b.target.value)})),N,o("div",{class:"pxd-action-bar"},w,v)],F=o("button",{type:"button",class:`pxd-button pxd-button-primary${m?" pxd-button-danger":""}`,disabled:!x,onClick:y},a.text(e.confirm.label)),j=e.cancel?a.text(e.cancel.label):"Cancel",T=e.consequence!==void 0?`${s} ${s}-consequence`:s;if(d){let[w,v]=t.state(e,"focused",!1);return w||(v(!0),t.after(()=>r.root?.querySelector(`[data-pxd-id="${CSS.escape(e.id)}"] > .pxd-action-bar > .pxd-button-secondary`)?.focus({preventScroll:!0}))),o("div",{role:"alertdialog","aria-modal":"false","aria-labelledby":c,"aria-describedby":T,class:`pxd-dialog pxd-dialog-inline${m?" pxd-dialog-destructive":""}`,onKeydown:b=>b.key==="Escape"&&f(),...g},o("h1",{class:"pxd-dialog-title",id:c},a.text(e.title)),k,h,S,...M(F,o("button",{type:"button",class:"pxd-button pxd-button-secondary",onClick:f},j)))}return p&&t.portal(ue({ctx:t,id:t.id(e,"dialog"),role:"alertdialog",class:`pxd-dialog${m?" pxd-dialog-destructive":""}`,onClose:f,props:{"aria-labelledby":c,"aria-describedby":T,...g}},o("h2",{id:c,class:"pxd-dialog-title"},a.text(e.title)),k,h,S,...M(F,o("button",{type:"button",class:"pxd-button pxd-button-secondary",autofocus:!0,onClick:f},j)))),null}function Br(e,t){let a=t.b,r=t.r,d=O(e.items.path,a.scope),p=Z(q(r.data,d)),i=p.map((g,f)=>({pointer:K(d,f)})),l=(g,f)=>q(r.data,O(g,i[f])),n=e.recommended!==void 0?a.text(e.recommended):void 0,c=e.recommendedReason!==void 0?a.text(e.recommendedReason):void 0,s=Va(e.attributes,p.length,l),u=Oa(e.attributes,a.text),x=_a(p.map((g,f)=>String(l(e.itemTitle,f)??"")),n),m=(g,f)=>{let y=l(g.path,f);return typeof y=="boolean"?y?o("span",{class:"pxd-yes"},P("check",18),o("span",{class:"pxd-sr-only"},"Included")):o("span",{class:"pxd-no"},P("dash",18),o("span",{class:"pxd-sr-only"},"Not included")):G(y,X(g.format,r.data,a.scope),r.locale)};return o("div",{class:"pxd-comparison",...t.a11y(e)},e.summary!==void 0&&o("p",{class:"pxd-comparison-summary"},a.text(e.summary)),o("ul",{class:"pxd-comparison-items"},...x.map(g=>{let f=String(l(e.itemTitle,g)??""),y=n===f;return o("li",{key:g,class:`pxd-comparison-item${y?" pxd-recommended":""}`},y&&o("p",{class:"pxd-recommendation"},o("span",{class:"pxd-badge pxd-tone-info"},"Recommended"),c&&o("span",{class:"pxd-recommendation-reason"},c)),he(t,"pxd-comparison-title",f),...u.map((h,k)=>o("div",{class:"pxd-comparison-group",key:k},h.label&&o("p",{class:"pxd-comparison-group-label"},h.label),o("dl",null,...h.attributes.map(I=>o("div",{class:"pxd-detail-row",key:I.key},o("dt",null,a.text(I.label)),o("dd",null,m(I,g),s.get(I.key)===g&&o("span",{class:"pxd-best"}," Best"))))))),e.choose&&o("button",{type:"button",class:`pxd-button ${y?"pxd-button-primary":"pxd-button-secondary"}`,onClick:()=>r.dispatch(e.choose.action,i[g],e.id)},`${a.text(e.choose.label)} `,o("span",{class:"pxd-sr-only"},f)))})))}function jr(e,t){let a=t.r,r=e.children??[],[d,p]=t.state(e,"shown",r.length),[i]=t.state(e,"widths",()=>new Map),[l]=t.state(e,"measured",()=>({trigger:44,width:-1})),[n,c]=t.state(e,"menu",ye),s=so(r,a.byId),u=t.id(e,"more"),x=y=>{if(r.length<=2||getComputedStyle(y).flexDirection==="column")return p(r.length);for(let I of y.querySelectorAll(":scope > [data-pxd-id]"))I.offsetWidth&&i.set(I.dataset.pxdId,I.offsetWidth);let h=y.querySelector(":scope > .pxd-action-bar-more");h?.offsetWidth&&(l.trigger=h.offsetWidth);let k=parseFloat(getComputedStyle(y).columnGap)||0;p(co(r,I=>i.get(I)??0,k,y.clientWidth,l.trigger,s))},m=y=>{y&&a.observeWidth(y,`${e.id}:bar`,h=>{h!==l.width&&(l.width=h,x(y))})};t.after(()=>{let y=a.root?.querySelector(`[data-pxd-id="${CSS.escape(e.id)}"].pxd-action-bar`);y&&x(y)});let g=r.slice(0,Math.min(d,r.length)),f=r.slice(g.length);return f.length&&He(t,u,n,c,jd(t,f),{class:"pxd-menu pxd-action-menu"}),o("div",{class:"pxd-action-bar",role:"group","aria-label":"Actions",...t.a11y(e),ref:m},...g.map(y=>t.render(y)),f.length>0&&o("button",{type:"button",..._e(u,n,c,"start",{class:"pxd-icon-button pxd-action-menu-trigger pxd-action-menu-overflow pxd-action-bar-more","aria-label":no})},P("dots",18)))}function jd(e,t){let a=e.b,r=t.map(n=>e.r.byId.get(n)).filter(n=>!!n&&n.component==="Action"&&(n.visible===void 0||a.value(n.visible)!==!1)),{usual:d,danger:p,divider:i}=Ye(r),l=n=>({key:n.id,label:[a.text(n.label)],class:`pxd-menu-item${n.tone==="danger"?" pxd-menu-item-danger":""}`,disabled:n.disabled!==void 0?!!a.value(n.disabled):void 0,onSelect:()=>e.r.dispatch(n.action,a.scope,n.id),props:{"data-pxd-id":n.id,"data-pxd-component":n.component}});return[...d.map(l),...i?["separator"]:[],...p.map(l)]}function Pr(e,t){let a=t.b,r=t.r,[d,p]=t.state(e,"compact",!1),[i,l]=t.state(e,"open",!1),n=t.a11y(e),c=t.id(e,"sheet"),s=e.label!==void 0?a.text(e.label):"Filters",u=(e.children??[]).map(M=>r.byId.get(M)).filter(Boolean),x=u.filter(M=>M.component==="TextInput"&&M.kind==="search"),m=u.filter(M=>!x.includes(M)),g=oo(m,r.data,a.scope,r.locale,a.text),f=M=>r.surface.write(M.binding,M.cleared,a.scope),y=e.resultCount!==void 0?a.value(e.resultCount):void 0,h=io(y,r.locale),k=()=>{for(let M of g)f(M);e.clear&&r.dispatch(e.clear,a.scope,e.id)},I=()=>l(!1),S=()=>m.map(M=>t.render(M.id)),N=o("div",{class:"pxd-filter-results"},...x.map(M=>t.render(M.id)),o("div",{class:"pxd-filter-status"},d&&o("button",{type:"button",class:"pxd-chip pxd-filter-trigger","aria-haspopup":"dialog","aria-expanded":i,"aria-controls":i?c:void 0,"data-state":i?"open":"closed",onClick:()=>l(!0)},P("filter",18),s,g.length>0&&o("span",{"aria-hidden":"true"},` \xB7 ${g.length}`),g.length>0&&o("span",{class:"pxd-sr-only"},`, ${g.length} active`)),h&&o("p",{class:"pxd-filter-count","aria-live":"polite"},h)),g.length>0&&o("ul",{class:"pxd-filter-chips","aria-label":"Active filters"},...g.map(M=>o("li",{key:M.key},o("button",{type:"button",class:"pxd-chip pxd-filter-chip",onClick:()=>f(M),"aria-label":`Remove filter: ${M.label}`},M.label,P("close",16)))),o("li",null,o("button",{type:"button",class:"pxd-button pxd-button-tertiary pxd-filter-clear",onClick:k},"Clear all"))),t.render(e.results));if(d&&i){let M=t.id(e,"sheet-title");t.portal(ue({ctx:t,id:c,class:"pxd-sheet",onClose:I,props:{id:c,"aria-labelledby":M}},o("div",{class:"pxd-sheet-header"},o("h2",{id:M,class:"pxd-sheet-title"},s),me(I,{class:"pxd-icon-button","aria-label":"Close"},P("close"))),o("div",{class:"pxd-sheet-body pxd-stack"},...S()),o("div",{class:"pxd-sheet-footer"},g.length>0&&o("button",{type:"button",class:"pxd-button pxd-button-secondary",onClick:k},"Clear all"),me(I,{class:"pxd-button pxd-button-primary"},h?`Show ${h}`:"Show results"))))}return o("div",{class:`pxd-filter-panel${d?" pxd-filter-compact":""}`,...n,ref:M=>M&&r.observeWidth(M,`${e.id}:filter`,F=>p(F<ro))},d?N:o("div",{class:"pxd-filter-layout"},o("section",{class:"pxd-filter-sidebar","aria-label":s},he(t,"pxd-filter-title",s),o("div",{class:"pxd-stack"},...S())),N))}function Lr(e,t){let a=t.b,r=t.r,d=t.frame,[p,i]=t.state(e,"compact",!1),[l,n]=t.state(e,"open",!1),[c,s]=t.state(e,"toggled",()=>({})),u=e.kind??"main",x=d&&d.navigationId===e.id&&u==="main"?d.navigation:void 0,m=a.value(e.current),g=x&&d?.current?.key!==void 0?d.current.key:m,f=e.label!==void 0?a.text(e.label):Ga(u),y=t.a11y(e),h=t.id(e,"drawer"),k=w=>{n(!1),d?.setDrawerOpen(!1),r.dispatch(w.action,a.scope,e.id)},I=w=>{let v=w.badge!==void 0?a.value(w.badge):void 0;return v?o("span",{class:"pxd-nav-badge"},v,o("span",{class:"pxd-sr-only"}," needing attention")):null};if(u==="breadcrumb")return o("nav",{class:"pxd-nav-breadcrumb","aria-label":f,...y},o("ol",null,...e.items.map((w,v)=>{let b=v===e.items.length-1,z=w.key===g||g===void 0&&b;return o("li",{key:w.key},z?o("span",{class:"pxd-nav-breadcrumb-current","aria-current":"page"},a.text(w.label)):o("button",{type:"button",class:"pxd-link",onClick:()=>k(w)},a.text(w.label)))})));if(u==="toc")return o("nav",{class:"pxd-nav-toc","aria-label":f,...y},o("p",{class:"pxd-nav-toc-label","aria-hidden":"true"},f),o("ol",null,...e.items.map(w=>{let v=w.key===g;return o("li",{key:w.key},o("a",{href:`#${w.key}`,class:`pxd-nav-toc-link${v?" pxd-nav-current":""}`,"aria-current":v?"true":void 0,onClick:()=>r.dispatch(w.action,a.scope,e.id)},a.text(w.label)))})));if(u==="local")return o("nav",{class:"pxd-nav-local","aria-label":f,...y},o("ul",null,...e.items.map(w=>{let v=w.key===g;return o("li",{key:w.key},o("button",{type:"button",class:`pxd-nav-local-item${v?" pxd-nav-current":""}`,"aria-current":v?"page":void 0,onClick:()=>k(w)},w.icon&&P(w.icon,16),o("span",{class:"pxd-nav-label"},a.text(w.label)),I(w)))})));let S=qa(e.items,a.text),N=u==="nested",M=w=>w.label&&w.label in c?c[w.label]:!w.label||w.items.some(v=>v.key===g),F=w=>o("ul",null,...w.map(v=>{let b=v.key===g;return o("li",{key:v.key},o("button",{type:"button",class:`pxd-nav-item${b?" pxd-nav-current":""}`,"aria-current":b?"page":void 0,onClick:()=>k(v)},v.icon&&P(v.icon,18),o("span",{class:"pxd-nav-label"},a.text(v.label)),I(v)))})),j=o("nav",{class:`pxd-nav${N?" pxd-nav-nested":""}${x==="side"?" pxd-nav-side":""}`,"aria-label":f,...x==="side"?y:{}},...S.map((w,v)=>o("div",{class:"pxd-nav-group",key:v},w.label&&(N?o("button",{type:"button",class:"pxd-nav-group-toggle","aria-expanded":M(w),onClick:()=>s({...c,[w.label]:!M(w)})},P(M(w)?"sortUp":"sortDown",16),o("span",{class:"pxd-nav-group-label"},w.label)):o("p",{class:"pxd-nav-group-label"},w.label)),(!N||M(w))&&F(w.items))));if(x==="side")return j;if(x==="rail"||x==="bar"){let w=x==="bar"?e.items.slice(0,5):e.items;return o("nav",{class:`pxd-nav-${x}`,"aria-label":f,...y},o("ul",null,...w.map(v=>{let b=v.key===g,z=a.text(v.label);return o("li",{key:v.key},o("button",{type:"button",class:`pxd-nav-${x}-item${b?" pxd-nav-current":""}`,"aria-current":b?"page":void 0,onClick:()=>k(v)},o("span",{class:`pxd-nav-${x}-icon`},v.icon?P(v.icon,24):o("span",{class:"pxd-nav-glyph","aria-hidden":"true"},z.slice(0,1)),I(v)),o("span",{class:"pxd-nav-label"},z)))})))}let T=(w,v,b)=>{if(!w)return;let z=t.id(e,"drawer-title");t.portal(ue({ctx:t,id:h,class:"pxd-nav-drawer",onClose:v,props:{id:h,"aria-labelledby":z,...b}},o("div",{class:"pxd-sheet-header"},o("h2",{id:z,class:"pxd-sheet-title"},f),me(v,{class:"pxd-icon-button","aria-label":"Close"},P("close"))),j))};return x==="drawer"&&d?(T(d.drawerOpen,()=>d.setDrawerOpen(!1),y),null):(T(p&&l,()=>n(!1),{}),o("div",{class:"pxd-nav-wrap",...y,ref:w=>{if(!w||u!=="main"||x)return;let v=w.closest(".pxd-surface")??w;r.observeWidth(v,`${e.id}:nav`,b=>i(b<900))}},p?o("button",{type:"button",class:"pxd-icon-button pxd-nav-menu","aria-label":`${f} menu`,"aria-haspopup":"dialog","aria-expanded":l,"aria-controls":l?h:void 0,"data-state":l?"open":"closed",onClick:()=>n(!0)},P("menu")):j))}function Pd(e,t,a){t.action&&e.r.dispatch({event:{name:t.action.event.name,context:Ne(t,e.r.data,e.scope,a)}},{pointer:""},t.id)}function Vr(e,t){let a=t.b,r=a.text(e.label),d=e.kind??"label",p=d==="status"?e.tone??"neutral":"neutral",i=t.a11y(e),l=`pxd-tag pxd-tag-${d} pxd-tag-${p}${e.remove?" pxd-tag-removable":""}`;return d==="count"?o("span",{class:l,title:r,...i},o("span",{class:"pxd-sr-only"},`${r}: `),o("span",{class:"pxd-tag-number"},a.text(e.count,{type:"number"}))):o("span",{class:l,title:r,...i},o("span",{class:"pxd-tag-text"},r),e.remove&&o("button",{type:"button",class:"pxd-tag-remove","aria-label":`Remove ${r}`,onClick:()=>t.r.dispatch(e.remove,a.scope,e.id)},P("close",12)))}function Or(e,t){let a=t.b,r=t.r,d=t.id(e,"name"),p=t.id(e,"detail"),i=t.a11y(e),l=e.kind??"person",n=e.size??"default",c=st[n]??st.default,s=a.text(e.name),u=e.detail!==void 0?a.text(e.detail):void 0,x={"--polyxd-identity-size":`${c}px`},m=`pxd-identity pxd-identity-${n} pxd-identity-${l}${e.group?" pxd-identity-group":""}`,g,f=s;if(e.group){let h=O(e.group.path,a.scope),k=Z(q(r.data,h)).map((M,F)=>{let j={pointer:K(h,F)},T=w=>w?q(r.data,O(w,j)):void 0;return{name:String(T(e.group.namePath)??""),image:T(e.group.imagePath)}}),I=e.group.max??4,S=k.slice(0,I),N=k.slice(I);f||(f=Ma(k,I)),g=o("span",{class:"pxd-identity-faces"},...S.map((M,F)=>o("span",{class:"pxd-identity-face",key:F},oe(t,{value:M.image,name:M.name,size:c}),o("span",{class:"pxd-sr-only"},M.name))),N.length>0&&o("span",{class:"pxd-identity-face pxd-identity-more",role:"img",title:N.map(M=>M.name).join(", "),"aria-label":`${N.length} more: ${N.map(M=>M.name).join(", ")}`},o("span",{"aria-hidden":"true"},`+${N.length}`)))}else g=oe(t,{value:a.value(e.image),name:s,size:c});let y=[g,o("span",{class:"pxd-identity-text"},o("span",{class:"pxd-identity-name",id:d},f),u&&o("span",{class:"pxd-identity-detail",id:p},u))];return e.action?o("button",{type:"button",class:`${m} pxd-identity-button`,style:x,"aria-labelledby":d,"aria-describedby":u?p:void 0,onClick:()=>r.dispatch(e.action,a.scope,e.id),...i},...y):o("div",{class:m,style:x,role:"group","aria-labelledby":d,"aria-describedby":u?p:void 0,...i},...y)}function _r(e,t){let a=t.b,r=t.id(e,"label"),d=t.a11y(e),p=e.kind??"bar",i=a.text(e.label),l=e.caption!==void 0?a.text(e.caption):void 0,n=Sa({kind:p,thresholds:e.thresholds,tone:e.tone,format:X(e.format,t.r.data,a.scope)},a.value(e.value),e.max!==void 0?a.value(e.max):void 0,!!a.value(e.indeterminate),l,t.r.locale),c=p==="meter"?"meter":"progressbar",s=`pxd-gauge pxd-gauge-${p}${n.tone&&n.tone!=="neutral"?` pxd-gauge-${n.tone}`:""}${n.indeterminate?" pxd-gauge-indeterminate":""}`,u=o("div",{class:"pxd-gauge-header"},o("span",{class:"pxd-gauge-label",id:r},i),o("span",{class:"pxd-gauge-readout"},!n.indeterminate&&o("span",{class:"pxd-gauge-value"},n.readout),l&&o("span",{class:"pxd-gauge-caption"},l),n.hint&&o("span",{class:"pxd-gauge-hint"},n.hint)));return p==="ring"?o("div",{class:s,...d},o("div",{class:"pxd-gauge-ring-graphic",role:c,"aria-labelledby":r,...n.valueProps},o("svg",{class:"pxd-gauge-ring-svg",viewBox:"0 0 36 36","aria-hidden":"true",focusable:"false"},o("circle",{class:"pxd-gauge-ring-track",cx:"18",cy:"18",r:"16",fill:"none","stroke-width":"4"}),o("circle",{class:"pxd-gauge-ring-fill",cx:"18",cy:"18",r:"16",fill:"none","stroke-width":"4",pathLength:100,"stroke-dasharray":n.indeterminate?"25 100":`${n.percent} 100`,"stroke-linecap":"round"}))),u):o("div",{class:s,...d},u,o("div",{class:"pxd-gauge-track",role:c,"aria-labelledby":r,...n.valueProps},o("div",{class:"pxd-gauge-fill",style:n.indeterminate?void 0:{width:`${n.percent}%`}})))}function Dr(e){let t=Math.round(Math.max(0,Math.min(1,e))*100);return o("span",{class:"pxd-rating-star-shape","aria-hidden":"true"},o("svg",{class:"pxd-rating-star-empty",viewBox:"0 0 24 24",focusable:"false"},o("path",{d:ct})),o("span",{class:"pxd-rating-star-fill",style:{width:`${t}%`}},o("svg",{viewBox:"0 0 24 24",focusable:"false"},o("path",{d:ct}))))}function qr(e,t){let a=t.b,r=t.r,d=t.id(e,"label"),p=t.id(e,"help"),[i,l]=t.state(e,"hover",null),n=t.a11y(e),c=e.max??5,s=a.text(e.label),u=a.value(e.value),x=u==null||u===""?void 0:Number(u),m=x!==void 0&&Number.isFinite(x)?Math.max(0,Math.min(c,x)):void 0,g=!!a.value(e.readOnly),f=e.count!==void 0?a.value(e.count):void 0,y=f!=null?G(f,{type:"number"},r.locale):void 0,h=e.help!==void 0?a.text(e.help):void 0,k=m!==void 0?G(m,{type:"number",precision:Number.isInteger(m)?0:1},r.locale):void 0,I=f!=null?`from ${y} ${Number(f)===1?"rating":"ratings"}`:void 0;if(g)return o("div",{class:"pxd-rating pxd-rating-readonly",...n},o("span",{class:"pxd-rating-label"},s),o("span",{class:"pxd-rating-stars",role:"img","aria-label":Ca(k,c)},...Array.from({length:c},(F,j)=>Dr((m??0)-j))),o("span",{class:"pxd-rating-readout"},k&&o("span",{class:"pxd-rating-value","aria-hidden":"true"},k),y&&o("span",{class:"pxd-rating-count"},o("span",{"aria-hidden":"true"},`(${y})`),o("span",{class:"pxd-sr-only"},I))));let S=m!==void 0?Math.round(m):0,N=i??S,M=F=>{let j=Number(F);a.write(e.value,j),Pd(t,e,j)};return o("div",{class:"pxd-field pxd-rating",...n},o("div",{class:"pxd-field-label",id:d},s,e.required&&o("span",{class:"pxd-required","aria-hidden":"true"},"*")),h&&o("p",{class:"pxd-field-help",id:p},h),o("div",{class:"pxd-rating-row"},Ce({class:"pxd-rating-stars",orientation:"horizontal","aria-labelledby":d,"aria-describedby":h?p:void 0,"aria-required":e.required||void 0,value:S?String(S):"",onValueChange:M,onMouseleave:()=>l(null)},...Array.from({length:c},(F,j)=>j+1).map(F=>Ue({key:F,value:String(F),group:S?String(S):"",first:F===1,onSelect:()=>M(String(F)),class:`pxd-rating-star${F<=N?" pxd-rating-star-on":""}`,"aria-label":za(F),"data-orientation":"horizontal",onMouseenter:()=>l(F),onFocus:()=>l(null)},Dr(F<=N?1:0)))),o("span",{class:"pxd-rating-readout","aria-hidden":"true"},k&&o("span",{class:"pxd-rating-value"},k),y&&o("span",{class:"pxd-rating-count"},`(${y})`)),I&&o("span",{class:"pxd-sr-only"},I)))}var Ld=2e3;function Gr(e,t){let a=t.b,r=t.id(e,"label"),d=t.a11y(e),p=a.text(e.text),i=e.label!==void 0?a.text(e.label):void 0,l=!!a.value(e.secret),n=e.copyable!==!1,[c,s]=t.state(e,"revealed",!1),[u,x]=t.state(e,"status",""),[m]=t.state(e,"timer",()=>({id:null})),g=S=>{x(S),m.id&&clearTimeout(m.id),m.id=setTimeout(()=>x(""),Ld)},f=()=>{let S=typeof navigator<"u"?navigator.clipboard:void 0;if(!S?.writeText)return g("Couldn't copy");S.writeText(p).then(()=>g("Copied"),()=>g("Couldn't copy"))},y=l&&!c,h=y?Aa(p):p,k=i??"code",I=i??(e.language?`${e.language} code`:"Code");return o("section",{class:`pxd-code${e.wrap?" pxd-code-wrap":""}${l?" pxd-code-secret":""}`,"aria-labelledby":i!==void 0?r:void 0,"aria-label":i===void 0?I:void 0,...d},o("div",{class:"pxd-code-header"},i!==void 0&&o("span",{class:"pxd-code-label",id:r},i),o("div",{class:"pxd-code-controls"},l&&o("button",{type:"button",class:"pxd-button pxd-button-tertiary pxd-code-control","aria-label":`${c?"Hide":"Show"} ${k}`,onClick:()=>s(!c)},c?"Hide":"Show"),n&&o("button",{type:"button",class:"pxd-button pxd-button-tertiary pxd-code-control","aria-label":`Copy ${k}`,onClick:f},u==="Copied"&&P("check",16),u==="Copied"?"Copied":"Copy"),o("span",{class:"pxd-sr-only",role:"status","aria-live":"polite"},u))),o("pre",{class:"pxd-code-pre",tabindex:"0","data-language":e.language,"data-masked":y||void 0},o("code",{class:e.language?`language-${e.language}`:void 0,translate:"no"},h)))}var Wr=()=>o("svg",{class:"pxd-action-menu-chevron",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},o("path",{d:"m6 9 6 6 6-6"}));function Kr(e,t){let a=t.b,r=t.r,d=t.a11y(e),p=e.kind??"overflow",i=a.text(e.label),l=d["aria-label"]??i,n=t.id(e,"menu"),[c,s]=t.state(e,"menu",ye),[u,x]=t.state(e,"context",ye),m=(e.children??[]).map(N=>r.byId.get(N)).filter(N=>!!N&&(N.visible===void 0||a.value(N.visible)!==!1)),{usual:g,danger:f,divider:y}=Ye(m),h=N=>({key:N.id,label:[a.text(N.label)],class:`pxd-menu-item${N.tone==="danger"?" pxd-menu-item-danger":""}`,disabled:N.disabled!==void 0?!!a.value(N.disabled):void 0,onSelect:()=>r.dispatch(N.action,a.scope,N.id),props:{"data-pxd-id":N.id,"data-pxd-component":N.component}}),k=[...g.map(h),...y?["separator"]:[],...f.map(h)];He(t,n,c,s,k,{class:"pxd-menu pxd-action-menu"});let I=(N,M,...F)=>o("button",{type:"button",..._e(n,c,s,M,N)},...F),S=()=>I({class:"pxd-icon-button pxd-action-menu-trigger pxd-action-menu-overflow",...d,"aria-label":l},"end",P("dots",18));if(p==="dropdown")return I({class:"pxd-button pxd-button-secondary pxd-action-menu-trigger pxd-action-menu-dropdown",...d,"aria-label":d["aria-label"]},"end",i,Wr());if(p==="split"){let M=(e.primary?r.byId.get(e.primary):void 0)?.emphasis??"secondary";return o("div",{class:"pxd-split",role:"group",...d,"aria-label":l},e.primary&&t.render(e.primary),I({class:`pxd-button pxd-button-${M} pxd-action-menu-trigger pxd-split-menu`,"aria-label":`${i}: more options`},"end",Wr()))}return p==="context"?(He(t,`${n}-context`,u,x,k,{class:"pxd-menu pxd-action-menu","aria-label":l}),o("span",{class:"pxd-context-target","data-state":u.open?"open":"closed",style:{WebkitTouchCallout:"none"},onContextmenu:N=>{N.preventDefault(),x({open:!0,x:N.clientX,y:N.clientY,align:"start"})}},S())):S()}function Xr(e,t){let a=t.b,r=t.r,d=t.a11y(e),p=Math.min(t.heading,6),i=t.id(e,"title"),l=t.id(e,"panel"),n=e.kind??"dialog",c=e.size??"default",s=e.dismissible!==!1,u=fe(e.open),[x,m]=t.state(e,"open",!0),g=u?!!a.value(e.open):x&&e.open!==!1,f=()=>{u?a.write(e.open,!1):m(!1),r.dispatch({event:{name:"ui.dismiss"}},a.scope,e.id)},y=a.text(e.title),h=`pxd-panel pxd-panel-${n} pxd-panel-size-${c}`,k=t.with({heading:p+1}),I=()=>o("div",{class:"pxd-panel-body pxd-stack"},...be(k,e.children)),S=()=>e.actions&&o("div",{class:"pxd-panel-footer"},t.render(e.actions));if(n==="popover")return g&&er(t,l,`.pxd-panel-anchor[data-pxd-anchor="${CSS.escape(e.id)}"]`,f,s,{class:h,"aria-labelledby":i,...d},o("div",{class:"pxd-panel-header"},o(`h${p}`,{id:i,class:"pxd-panel-title"},y),s&&o("button",{type:"button",class:"pxd-icon-button pxd-panel-close","aria-label":"Close",onClick:f},P("close"))),I(),S(),o("span",{style:{position:"absolute",left:"50%",top:"100%",transform:"translateX(-50%)"}},o("svg",{class:"pxd-panel-arrow",width:16,height:8,viewBox:"0 0 30 10",preserveAspectRatio:"none"},o("polygon",{points:"0,0 30,0 15,10"})))),o("span",{class:"pxd-panel-anchor","data-pxd-anchor":e.id});if(!g)return null;let N=n==="sheet"&&s?Dd(f):{};return t.portal(ue({ctx:t,id:l,class:h,overlayClass:"pxd-overlay pxd-panel-backdrop",dismissible:s,onClose:f,props:{"aria-labelledby":i,...d}},o("div",{class:"pxd-panel-header",...N},n==="sheet"&&o("span",{class:"pxd-panel-grip","aria-hidden":"true"}),o(`h${p}`,{id:i,class:"pxd-panel-title"},y),s&&me(f,{class:"pxd-icon-button pxd-panel-close","aria-label":"Close"},P("close"))),I(),S())),null}function Dd(e){let t=null,a=d=>d.currentTarget.closest("dialog"),r=d=>{t=null;let p=a(d);p&&(p.style.transform="",p.style.transition="")};return{onPointerdown:d=>{d.pointerType==="mouse"&&d.button!==0||(t=d.clientY,d.currentTarget.setPointerCapture(d.pointerId))},onPointermove:d=>{let p=a(d);if(t===null||!p)return;let i=Math.max(0,d.clientY-t);p.style.transition="none",p.style.transform=`translateY(${i}px)`},onPointerup:d=>{if(t===null)return;let p=d.clientY-t,i=a(d);r(d),p>80&&(i?.open&&i.close(),e())},onPointercancel:r}}var qe=(...e)=>e.filter(Boolean).join(" ")||void 0,wo=e=>e.target.value,So=e=>{typeof e.ref=="string"&&e.ref.startsWith("blob:")&&URL.revokeObjectURL(e.ref)};function Jr(e,t){let a=t.b,r=t.r,d=t.id(e),p=t.id(e,"help"),i=t.id(e,"error"),[l,n]=t.state(e,"error",null),[c,s]=t.state(e,"dragging",!1),u=a.value(e.value),x=Array.isArray(u)?u:[],m=Array.isArray(e.accept)?e.accept:[],g=e.maxSize,f=!!e.multiple,y=a.text(e.label),h=[e.help!==void 0?a.text(e.help):"",va(m,g,f,r.locale)].filter(Boolean).join(" ")||void 0,k=S=>{if(!S)return;let N=Array.from(S),M=[],F=[];for(let j of f?N:N.slice(0,1)){let T=ka(j,m,g,r.locale);T?F.push(T):M.push({name:j.name,size:j.size,type:j.type,ref:URL.createObjectURL(j)})}if(n(F.length?F.join(" "):null),M.length!==0)if(f){let j=M.filter(T=>!x.some(w=>w.name===T.name&&w.size===T.size));M.filter(T=>!j.includes(T)).forEach(So),j.length&&a.write(e.value,[...x,...j])}else x.forEach(So),a.write(e.value,M)},I=S=>{So(x[S]),a.write(e.value,x.filter((N,M)=>M!==S)),n(null)};return o("div",{class:"pxd-field pxd-file"},o("label",{class:"pxd-field-label",for:d},y,e.required&&Ae()),h&&o("p",{class:"pxd-field-help",id:p},h),o("div",{class:"pxd-dropzone","data-dragging":c||void 0,onDrop:S=>{S.preventDefault(),s(!1),k(S.dataTransfer?.files??null)},onDragover:S=>{S.preventDefault(),c||s(!0)},onDragleave:S=>{S.currentTarget.contains(S.relatedTarget)||s(!1)}},o("input",{id:d,class:"pxd-dropzone-input",type:"file",accept:m.length?m.join(","):void 0,multiple:f,required:e.required&&x.length===0,"aria-describedby":qe(h&&p,l&&i),"aria-invalid":l?!0:void 0,onChange:S=>{let N=S.target;k(N.files),N.value=""},...t.a11y(e)}),o("span",{class:"pxd-dropzone-icon","aria-hidden":"true"},P("file",24)),o("span",{class:"pxd-dropzone-text"},o("span",{class:"pxd-dropzone-action"},f?"Choose files":"Choose a file"),o("span",{class:"pxd-dropzone-hint"},f?"or drop them here":"or drop it here"))),l&&o("p",{class:"pxd-field-error",id:i,role:"alert"},l),x.length>0&&o("ul",{class:"pxd-file-list"},...x.map((S,N)=>o("li",{class:"pxd-file-item",key:`${S.name}-${S.size}-${N}`},o("span",{class:"pxd-file-icon","aria-hidden":"true"},P("file",18)),o("span",{class:"pxd-file-text"},o("span",{class:"pxd-file-name"},S.name),o("span",{class:"pxd-file-size"},Le(S.size,r.locale)),typeof S.progress=="number"&&S.progress<1&&o("progress",{class:"pxd-file-progress",value:S.progress,max:1,"aria-label":`Uploading ${S.name}`})),o("button",{type:"button",class:"pxd-file-remove","aria-label":`Remove ${S.name}`,onClick:()=>I(N)},P("close",18))))))}var Me="__other";function Zr(e,t){let a=t.b,r=t.id(e,"label"),d=t.id(e,"help"),p=t.id(e,"picker"),i=t.id(e,"text"),l=t.id(e,"alpha"),n=e.format??"hex",c=!!e.alpha,s=a.text(e.label),u=e.help!==void 0?a.text(e.help):void 0,x=a.value(e.value),m=x==null?"":String(x),g=ze(m),[f,y]=t.state(e,"draft",null),[h,k]=t.state(e,"other",!1),I=t.a11y(e),S=e.swatches?Se({...e,options:e.swatches},t.r.data,a.scope,a.text):[],N=S.length>0,M=C=>a.write(e.value,nt(C,n,c)),F=C=>{y(C);let E=ze(C);E&&M(E)},j=S.findIndex(C=>g?ma(ze(C.value),g,c):String(C.value)===m&&m!==""),T=h?Me:j>=0?String(j):m?Me:"",w=!N||T===Me,v=Math.round((g?.a??1)*100),b=()=>o("div",{class:"pxd-color-picker"},o("input",{id:p,class:"pxd-color-native",type:"color",value:ga(g),"aria-label":`${s}: pick`,"aria-describedby":qe(u&&d),onInput:C=>{let E=ze(wo(C));E&&(y(null),M({...E,a:g?.a??1}))}}),o("input",{id:i,class:"pxd-input pxd-input-mono pxd-color-text",type:"text",inputmode:"text",autocomplete:"off",spellcheck:"false",placeholder:ya(n),value:f??m,"aria-label":`${s}: value`,"aria-describedby":qe(u&&d),"aria-invalid":f!==null&&f!==""&&!ze(f)?!0:void 0,required:!N&&e.required,onInput:C=>F(wo(C)),onBlur:()=>y(null)}),c&&o("label",{class:"pxd-color-alpha",for:l},o("span",{class:"pxd-color-alpha-label"},"Opacity"),o("input",{id:l,type:"range",min:0,max:100,step:1,value:String(v),disabled:!g,"aria-valuetext":`${v}%`,onInput:C=>{g&&(y(null),M({...g,a:Number(wo(C))/100}))}}),o("output",{class:"pxd-color-alpha-value",for:l,"aria-hidden":"true"},`${v}%`)));if(!N)return o("div",{class:"pxd-field pxd-color",role:"group","aria-labelledby":r,"aria-describedby":qe(u&&d),...I},o("div",{class:"pxd-field-label",id:r},s,e.required&&Ae()),u&&o("p",{class:"pxd-field-help",id:d},u),b());let z=C=>{if(C===Me)return k(!0);k(!1),y(null);let E=S[Number(C)],A=ze(E.value);a.write(e.value,A?nt(A,n,c):E.value)};return o("div",{class:"pxd-field pxd-color",...I},o("div",{class:"pxd-field-label",id:r},s,e.required&&Ae()),u&&o("p",{class:"pxd-field-help",id:d},u),Ce({class:"pxd-swatches","aria-labelledby":r,"aria-describedby":qe(u&&d),"aria-required":e.required||void 0,value:T,orientation:"horizontal",onValueChange:z},...S.map((C,E)=>Ue({key:String(E),value:String(E),group:T,first:E===0,onSelect:()=>z(String(E)),class:"pxd-swatch",title:C.label,"data-orientation":"horizontal"},o("span",{class:"pxd-swatch-color",style:{background:String(C.value)},"aria-hidden":"true"}),o("span",{class:"pxd-swatch-name"},C.label))),Ue({key:Me,value:Me,group:T,onSelect:()=>z(Me),class:"pxd-swatch pxd-swatch-other",title:"Other","data-orientation":"horizontal"},o("span",{class:"pxd-swatch-color",style:T===Me&&g?{background:m}:void 0,"aria-hidden":"true"}),o("span",{class:"pxd-swatch-name"},"Other"))),w&&b())}var Yr=(e,t)=>Array.from({length:t},(a,r)=>e[r]??"");function Qr(e,t){let a=t.b,r=t.id(e,"label"),d=t.id(e,"help"),p=se(Number(e.length)||6,4,12),i=(e.kind??"numeric")==="numeric",l=e.required??!0,n=a.text(e.label),c=e.help!==void 0?a.text(e.help):void 0,s=a.value(e.value),u=s==null?"":String(s),[x]=t.state(e,"code",()=>({chars:Yr(u,p),seen:u,fired:null}));u!==x.seen&&(x.seen=u,u!==x.chars.join("")&&(x.chars=Yr(u,p)));let m=x.chars,g=t.a11y(e),f=()=>Array.from(t.r.root?.querySelectorAll(`[data-pxd-id="${CSS.escape(e.id)}"] .pxd-code-box`)??[]),y=T=>T.replace(i?/[^0-9]/g:/[^0-9a-zA-Z]/g,""),h=T=>f()[se(T,0,p-1)]?.focus(),k=T=>{x.chars=T;let w=T.join("");x.seen=w,a.write(e.value,w),e.action&&T.every(Boolean)&&w!==x.fired&&(x.fired=w,t.r.dispatch({event:{name:e.action.event.name,context:Ne(e,t.r.data,a.scope,w)}},{pointer:""},e.id)),t.r.schedule()},I=(T,w)=>{let v=y(w);if(!v)return;let b=[...m],z=T;for(let C of v){if(z>=p)break;b[z++]=C}k(b),h(z)},S=(T,w)=>{let v=m[T],b=w.target.value;if(v&&b.length>1&&(b=b.startsWith(v)?b.slice(v.length):b.endsWith(v)?b.slice(0,-v.length):b),b===""){let z=[...m];return z[T]="",k(z)}I(y(b).length>=p?0:T,b)},N=(T,w)=>{if(w.key==="Backspace"&&!m[T]&&T>0){w.preventDefault();let v=[...m];v[T-1]="",k(v),h(T-1)}else w.key==="ArrowLeft"?(w.preventDefault(),h(T-1)):w.key==="ArrowRight"&&(w.preventDefault(),h(T+1))},M=(T,w)=>{w.preventDefault();let v=w.clipboardData?.getData("text")??"";I(y(v).length>=p?0:T,v)},F=p>6?p%4===0?4:3:p,j=[];for(let T=0;T<p;T+=F)j.push(Array.from({length:Math.min(F,p-T)},(w,v)=>T+v));return o("div",{class:"pxd-field pxd-code",role:"group","aria-labelledby":r,"aria-describedby":qe(c&&d),...g},o("div",{class:"pxd-field-label",id:r},n,l&&Ae()),c&&o("p",{class:"pxd-field-help",id:d},c),o("div",{class:"pxd-code-boxes"},...j.map((T,w)=>o("div",{class:"pxd-code-group",key:w},...T.map(v=>o("input",{key:v,class:"pxd-code-box",type:"text",inputmode:i?"numeric":"text",pattern:i?"[0-9]*":"[0-9A-Za-z]*",autocomplete:v===0?"one-time-code":"off",autocapitalize:i?void 0:"characters",spellcheck:"false","aria-label":`Digit ${v+1} of ${p}`,value:m[v],"data-filled":m[v]?"":void 0,required:l,onFocus:b=>b.target.select(),onInput:b=>S(v,b),onKeydown:b=>N(v,b),onPaste:b=>M(v,b)}))))))}var ed=40;function td(e,t){let a=t.b,r=t.r,d=t.id(e,"caption"),p=e.selection??"none",i=p!=="none"&&!!e.selected,l=e.expanded?Z(a.value(e.expanded)):void 0,[n,c]=t.state(e,"expanded",null),s=l?new Set(l):n,u=i?a.value(e.selected):void 0,x=U=>Array.isArray(u)?u.includes(U):u!==void 0&&u===U,{rows:m,indexByKey:g,topValues:f}=Qa(e,r.data,a.scope,s),[y,h]=t.state(e,"focus",null),k=(y!==null?g.get(y):void 0)??0,[I]=t.state(e,"pending",()=>({index:null})),S=m.length>ft,[N,M]=t.state(e,"geometry",()=>({rowHeight:ed,viewportHeight:ed*12,scrollTop:0})),{start:F,end:j}=ao(m.length,N.scrollTop,N.rowHeight,N.viewportHeight),T=()=>r.root?.querySelector(`[data-pxd-id="${CSS.escape(e.id)}"] .pxd-tree-list`),w=U=>{if(!m.length)return;let D=Math.max(0,Math.min(m.length-1,U));h(m[D].key);let $=T()?.querySelector(`[data-index="${D}"]`);if($)return $.focus();I.index=D;let R=T()?.parentElement;if(S&&R?.classList.contains("pxd-tree-viewport")){let _=Math.max(0,D*N.rowHeight-(N.viewportHeight-N.rowHeight)/2);R.scrollTop=_,M({...N,scrollTop:_})}};t.after(()=>{if(I.index===null)return;let U=T()?.querySelector(`[data-index="${I.index}"]`);if(U&&(I.index=null,U.focus()),S){let D=T()?.querySelector(".pxd-tree-item"),$=T()?.parentElement,R=D&&D.offsetHeight>0?D.offsetHeight:N.rowHeight,_=$?.clientHeight||N.viewportHeight;(R!==N.rowHeight||_!==N.viewportHeight)&&M({...N,rowHeight:R,viewportHeight:_})}});let v=(U,D)=>{if(e.expanded){let R=l??[];a.write(e.expanded,D?[...R,...U.filter(_=>!R.includes(_))]:R.filter(_=>!U.includes(_)));return}let $=new Set(n??f);for(let R of U)D?$.add(R):$.delete(R);c($)},b=U=>v([U.value],!U.expanded),z=U=>{if(!i)return;if(p==="single")return a.write(e.selected,U.value);let D=Array.isArray(u)?u:[];a.write(e.selected,D.includes(U.value)?D.filter($=>$!==U.value):[...D,U.value])},C=U=>{z(U),e.action&&r.dispatch(e.action,U.scope,e.id)},[E]=t.state(e,"typed",()=>({buffer:"",at:0})),A=U=>{let D=Date.now();E.buffer=D-E.at<Za?E.buffer+U.toLowerCase():U.toLowerCase(),E.at=D;let $=eo(m,k,E.buffer);$>=0&&w($)},B=U=>{let D=m[k],$=to(m,k,U);!D||!$||(U.preventDefault(),U.stopPropagation(),"focus"in $?w($.focus):"toggle"in $?b(D):"activate"in $?C(D):"select"in $?z(D):"expandSiblings"in $?v(m.filter(R=>R.parent===D.parent&&R.hasChildren).map(R=>R.value),!0):"typeAhead"in $&&A($.typeAhead))},H=a.text(e.label),L=S?{paddingTop:F*N.rowHeight,paddingBottom:(m.length-j)*N.rowHeight}:void 0,V=o("ul",{role:"tree",class:"pxd-tree-list","aria-labelledby":d,"aria-multiselectable":p==="multiple"?!0:void 0,style:L,onKeydown:B},...m.slice(F,j).map((U,D)=>{let $=F+D,R=i?x(U.value):void 0;return o("li",{key:U.key,role:"treeitem",class:`pxd-tree-item${R?" pxd-tree-item-selected":""}`,style:{"--polyxd-tree-depth":U.level-1},"data-index":$,tabindex:$===k?"0":"-1","aria-level":U.level,"aria-setsize":U.setsize,"aria-posinset":U.posinset,"aria-expanded":U.hasChildren?U.expanded:void 0,"aria-selected":R,onFocus:_=>{_.target===_.currentTarget&&h(U.key)},onClick:_=>{_.stopPropagation(),w($),i?z(U):U.hasChildren&&b(U)},onDblclick:_=>{_.stopPropagation(),e.action?r.dispatch(e.action,U.scope,e.id):U.hasChildren&&b(U)}},o("div",{class:"pxd-tree-row"},U.hasChildren?o("button",{type:"button",class:`pxd-tree-expander${U.expanded?" pxd-tree-expander-open":""}`,tabindex:"-1","aria-hidden":"true",onClick:_=>{_.stopPropagation(),w($),b(U)},onDblclick:_=>_.stopPropagation()},P("chevronRight",16)):o("span",{class:"pxd-tree-expander pxd-tree-expander-leaf","aria-hidden":"true"}),o("span",{class:"pxd-tree-text"},U.label),U.detail!==void 0&&o("span",{class:"pxd-tree-detail"},U.detail)))}));return o("div",{class:"pxd-tree",...t.a11y(e)},o("div",{class:"pxd-tree-caption",id:d},H),S?o("div",{class:"pxd-tree-viewport",onScroll:U=>M({...N,scrollTop:U.currentTarget.scrollTop})},V):V)}var yt={Section:tr,Group:ar,Card:rr,Disclosure:dr,Views:ir,Navigation:Lr,Text:yr,Metric:br,DetailList:hr,Collection:vr,Table:fr,Chart:Sr,Media:kr,Status:wr,TextInput:Mr,Choice:Er,Toggle:Nr,DateInput:Tr,RangeInput:Rr,Form:Ur,Action:Hr,ActionBar:jr,Steps:Fr,Confirm:$r,Comparison:Br,FilterPanel:Pr,Tag:Vr,Identity:Or,Progress:_r,Rating:qr,Code:Gr,Tree:td,ActionMenu:Kr,Panel:Xr,FileInput:Jr,ColorInput:Zr,CodeInput:Qr,Columns:or,Split:pr,Frame:nr,AppBar:sr,Footer:cr,Outlet:xr,Custom:ur};var Qe=class{surface;props;host;root=null;portalEl=null;components;states=new Map;effects=[];portals=[];modals=0;scheduled=!1;unsubscribe;observers=new Map;drawing=!1;disposers=[];constructor(t,a){this.host=t,this.props=a,this.components={...yt,...a.components??{}},this.surface=this.makeSurface(a),this.unsubscribe=this.surface.subscribe(()=>this.schedule())}makeSurface(t){return xo(t.document,{data:t.data,locale:t.locale??"en-GB",derive:t.derive,onAction:a=>this.props.onAction?.(a),onDataChange:a=>this.props.onDataChange?.(a),onDismiss:()=>this.props.onDismiss?.()})}get locale(){return this.surface.locale}get doc(){return this.surface.document}get data(){return this.surface.data}get byId(){return this.surface.byId}get disclosure(){return this.props.disclosure??"progressive"}update(t){let a=this.props;if(this.props=t,this.components={...yt,...t.components??{}},t.document!==a.document||(t.locale??"en-GB")!==a.locale)this.unsubscribe(),this.states.clear(),this.surface=this.makeSurface(t),this.unsubscribe=this.surface.subscribe(()=>this.schedule());else if(t.data&&t.data!==a.data&&t.document.surface.kind==="shell"){this.surface.replaceData(t.data);return}this.schedule()}dispose(){this.unsubscribe();for(let t of this.disposers)t();for(let t of this.observers.values())t.disconnect();yo(this.host)}onDispose(t){this.disposers.push(t)}schedule(){this.scheduled||(this.scheduled=!0,queueMicrotask(()=>{this.scheduled=!1,this.draw()}))}observeWidth(t,a,r){if(!t||this.observers.has(t)||typeof ResizeObserver>"u")return;let d=()=>r(t.getBoundingClientRect().width),p=new ResizeObserver(d);p.observe(t),this.observers.set(t,p),d()}unobserve(t){this.observers.get(t)?.disconnect(),this.observers.delete(t)}bindings(t){let a=this.surface;return{scope:t,value:r=>W(r,a.data,t),text:(r,d)=>{let p=W(r,a.data,t);return d?G(p,X(d,a.data,t),a.locale):p==null?"":String(p)},pointer:r=>O(r.path,t),write:(r,d)=>a.setValue(O(r.path,t),d),context:r=>we(r,a.data,t)}}dispatch(t,a,r){this.surface.dispatch(t,a,r)}ctx(t){let a=this,r=(p,i)=>`${t.scope.pointer}#${p.id}:${i}`,d={r:a,scope:t.scope,heading:t.heading,steps:t.steps,frame:t.frame,b:a.bindings(t.scope),render:(p,i)=>a.renderNode(p,i?d.with({scope:i}):d),a11y:p=>uo(p,i=>{let l=W(i,a.data,t.scope);return l===void 0?void 0:String(l)}),id:(p,i="")=>`pxd-${(t.scope.pointer+"-"+p.id+(i?"-"+i:"")).replace(/[^A-Za-z0-9_-]+/g,"_")}`,state:(p,i,l)=>{let n=r(p,i);a.states.has(n)||a.states.set(n,typeof l=="function"?l():l);let c=s=>{let u=a.states.get(n),x=typeof s=="function"?s(u):s;Object.is(x,u)||(a.states.set(n,x),a.schedule())};return[a.states.get(n),c]},after:p=>a.effects.push(p),portal:p=>a.portals.push(p),with:p=>a.ctx({...t,...p})};return d}renderNode(t,a){let r=this.byId.get(t);if(!r||r.visible!==void 0&&W(r.visible,this.data,a.scope)===!1)return null;let d=this.components[r.component];if(!d)return o("div",{class:"pxd-unknown",role:"note"},`Unsupported component \u201C${r.component}\u201D`);let p=d(r,a);return p instanceof Element?Oe(p,r.id):p}draw(){if(this.drawing)return this.schedule();this.drawing=!0,this.effects=[],this.portals=[],this.modals=0;try{let t=this.surfaceTree();mo(this.host,[t]),this.root=this.host.querySelector(":scope > .pxd-surface"),this.portalEl=this.root?.querySelector(":scope > .pxd-portal")??null;let a=this.effects;this.effects=[];for(let r of a)r()}finally{this.drawing=!1}}surfaceTree(){let t=this.doc,a=this.props,r=this.ctx({scope:re,heading:2}),d=this.byId.get(t.root)?.component==="Confirm",p=t.surface.kind==="shell",i=St(t),l=p?r.render(t.root):o("div",{class:"pxd-surface-main"},!d&&this.header(r),r.render(t.root)),n=i?r.render(i.id):null,c=o("div",{class:"pxd-portal"},...this.portals),s=this.modals>0?"true":void 0;for(let u of[n,l])u&&typeof u=="object"&&"props"in u&&(u.props["aria-hidden"]=s);return o("div",{class:["pxd-surface",p?"pxd-surface-shell":null,t.surface.presentation==="panel"?"pxd-surface-panel":null,i?"pxd-surface-with-nav":null,a.className].filter(Boolean).join(" "),"data-pxd-theme":a.theme,"data-pxd-mode":a.mode,"data-pxd-density":a.density,"data-pxd-surface":t.surface.id,lang:this.locale},n,l,c)}header(t){let{title:a,subtitle:r,breadcrumbs:d,badge:p,avatar:i,actions:l}=this.doc.surface,n=s=>String(W(s,this.data,re)??"");return!r&&!d&&!p&&!i&&!l?o("h1",{class:"pxd-surface-title"},a):o("header",{class:"pxd-page-header"},d&&o("nav",{class:"pxd-breadcrumbs","aria-label":"Breadcrumb"},o("ol",null,d.map((s,u)=>o("li",{key:u},s.action?o("button",{type:"button",class:"pxd-link",onClick:()=>this.dispatch(s.action,re,this.doc.surface.id)},n(s.label)):n(s.label))))),o("div",{class:"pxd-page-header-main"},i!==void 0&&oe(t,{value:n(i),name:a,size:48}),o("div",{class:"pxd-page-header-text"},o("h1",{class:"pxd-surface-title"},a,p&&o("span",{class:`pxd-badge pxd-tone-${p.tone??"neutral"}`},n(p.text))),r!==void 0&&o("p",{class:"pxd-surface-subtitle"},n(r))),l&&o("div",{class:"pxd-page-header-actions"},t.render(l))))}};function zo(e,t){let a=new Qe(e,t);a.draw();let r=t;return{update:d=>{r={...r,...d},a.update(r),a.draw()},unmount:()=>a.dispose(),get data(){return a.data}}}var Vd="2026-01-26",Od={name:"Polyxd",version:"0.4.0"},_d=1,Co=new Map,et=e=>window.parent.postMessage({jsonrpc:"2.0",...e},"*");function rd(e,t){let a=_d++;return et({id:a,method:e,params:t}),new Promise((r,d)=>Co.set(a,{resolve:r,reject:d}))}var dd=(e,t={})=>et({method:e,params:t});window.addEventListener("message",e=>{if(e.source!==window.parent)return;let t=e.data;if(!(!t||t.jsonrpc!=="2.0")){if(t.method===void 0&&t.id!==void 0){let a=Co.get(t.id);if(!a)return;Co.delete(t.id),t.error?a.reject(new Error(t.error.message??String(t.error))):a.resolve(t.result);return}if(typeof t.method=="string"){if(t.id!==void 0)return void qd(t.id,t.method);Xd(t.method,t.params??{})}}});function qd(e,t){if(t==="ping")return et({id:e,result:{}});if(t==="ui/resource-teardown")return $e?.unmount(),$e=void 0,et({id:e,result:{}});et({id:e,error:{code:-32601,message:`Method not found: ${t}`}})}var Ge={},ae,$e,vt=document.getElementById("root"),ad=document.getElementById("note"),Ao=e=>e?.mode??Ge.theme??(window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"),Gd=e=>"data:image/svg+xml;utf8,"+encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><rect width="10" height="10" fill="#999"/><title>${String(e).replace(/[<&]/g,"")}</title></svg>`);function Mo(){let e=document.documentElement;e.dataset.pxdTheme=ae?.pack??"material3",e.dataset.pxdMode=Ao(ae),e.style.colorScheme=Ao(ae);let t=Ge.containerDimensions;t&&(t.height!==void 0?e.style.height="100vh":t.maxHeight&&(e.style.maxHeight=`${t.maxHeight}px`),t.width!==void 0?e.style.width="100vw":t.maxWidth&&(e.style.maxWidth=`${t.maxWidth}px`))}function bt(e){ad.textContent=e,ad.hidden=!e}function kt(e,t,a){$e?.unmount(),$e=void 0,vt.replaceChildren();let r=document.createElement("div");r.className="pxd-mcp-status";let d=document.createElement("p");if(d.className="pxd-mcp-status-title",d.textContent=e,r.append(d),t){let p=document.createElement("p");p.textContent=t,r.append(p)}if(a?.length){let p=document.createElement("ul");for(let i of a){let l=document.createElement("li");l.textContent=i,p.append(l)}r.append(p)}vt.append(r)}function ht(){if(Mo(),!ae)return kt("Preparing the screen\u2026");if(!ae.shown||!ae.document){let t=(ae.issues??[]).filter(a=>a.severity==="error");return kt("The document has errors, so there is nothing to show yet.",void 0,t.map(a=>`${a.pointer}: ${a.message}`))}let e={document:ae.document,data:ae.document.data??{},theme:ae.pack,mode:Ao(ae),locale:Ge.locale,resolveMedia:Gd,onAction:t=>{od(Kd(t))},onDismiss:()=>{od(`[Polyxd] I closed the "${id()}" screen.`)}};$e?$e.update(e):(vt.replaceChildren(),$e=zo(vt,e))}var id=()=>String(ae?.document?.surface?.title??ae?.document?.surface?.id??"Polyxd");function Wd(e){let t=(ae?.document?.components??[]).find(a=>a.id===e.source);if(t){if(typeof t.label=="string"&&t.action?.event?.name===e.name)return t.label;for(let a of["submit","confirm","cancel","finish","action","primary","secondary"]){let r=t[a];if(r?.action?.event?.name===e.name&&typeof r.label=="string")return r.label}return typeof t.label=="string"?t.label:void 0}}function Kd(e){let t=Wd(e),a=e.context&&Object.keys(e.context).length?`
30
- Context: ${JSON.stringify(e.context)}`:"";return`[Polyxd] In the "${id()}" screen I pressed ${t?`"${t}" `:""}(action ${e.name}).${a}`}async function od(e){bt("Sending to the chat\u2026");try{let t=await rd("ui/message",{role:"user",content:[{type:"text",text:e}]});bt(t?.isError?"The chat did not accept the message.":"Sent to the chat.")}catch(t){bt(`Could not send to the chat: ${t.message}`)}}function Xd(e,t){switch(e){case"ui/notifications/tool-input":ae||ht();return;case"ui/notifications/tool-result":{let a=t.structuredContent;return a&&typeof a.shown=="boolean"?ae=a:ae={shown:!1,issues:[{severity:"error",pointer:"/",message:Yd(t)??"The tool returned no screen."}]},bt(""),ht()}case"ui/notifications/tool-cancelled":return kt("The screen was cancelled.",typeof t.reason=="string"?t.reason:void 0);case"ui/notifications/host-context-changed":return Ge={...Ge,...t},ae?.shown?ht():Mo()}}var Yd=e=>Array.isArray(e.content)?e.content.find(t=>t?.type==="text")?.text:void 0;function Jd(){let e=!1,t={width:0,height:0},a=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let d=document.documentElement,p=d.style.height;d.style.height="max-content";let i=Math.ceil(d.getBoundingClientRect().height);d.style.height=p;let l=Math.ceil(window.innerWidth);l===t.width&&i===t.height||(t={width:l,height:i},dd("ui/notifications/size-changed",t))}))};a();let r=new ResizeObserver(a);r.observe(document.documentElement),r.observe(document.body)}async function Zd(){Mo(),Ge=(await rd("ui/initialize",{appInfo:Od,appCapabilities:{availableDisplayModes:["inline"]},protocolVersion:Vd}))?.hostContext??{},dd("ui/notifications/initialized"),ht(),Jd()}Zd().catch(e=>kt("This screen could not connect to the chat.",e.message));})();
28
+ `;default:return a()}}function Ur(e){let t=[],a=/\*\*([^*]+)\*\*|\*([^*]+)\*/g,r=0;for(let d=a.exec(e);d;d=a.exec(e)){d.index>r&&t.push(document.createTextNode(e.slice(r,d.index)));let p=document.createElement(d[1]?"strong":"em");p.textContent=d[1]??d[2],t.push(p),r=d.index+d[0].length}return r<e.length&&t.push(document.createTextNode(e.slice(r))),t}function Gd(e){let t=[],a=null;for(let r of e.split(`
29
+ `)){let d=/^(-|\d+\.)\s+(.*)$/.exec(r);if(d){let i=d[1]==="-"?"ul":"ol";(!a||a.tagName.toLowerCase()!==i)&&(a=document.createElement(i),t.push(a));let n=document.createElement("li");n.append(...Ur(d[2])),a.append(n);continue}a=null;let p=document.createElement("div");r?p.append(...Ur(r)):p.append(document.createElement("br")),t.push(p)}return t}function Wd(e,t,a,r){let d=t.b,p=String(d.value(e.value)??""),i=m=>d.write(e.value,Pr(m).replace(/\n+$/,"")),n=m=>g=>{g.preventDefault();let f=g.currentTarget.closest(".pxd-richtext")?.querySelector(".pxd-richtext-area");f&&(f.focus(),document.execCommand(m),i(f))},{id:l,class:c,required:s,autocomplete:u,...x}=r;return ke(a,o("div",{class:"pxd-richtext"},o("div",{class:"pxd-richtext-toolbar",role:"toolbar","aria-label":"Formatting"},o("button",{type:"button",class:"pxd-richtext-control","aria-label":"Bold",onMousedown:n("bold")},o("strong",null,"B")),o("button",{type:"button",class:"pxd-richtext-control","aria-label":"Italic",onMousedown:n("italic")},o("em",null,"I")),o("button",{type:"button",class:"pxd-richtext-control","aria-label":"Bulleted list",onMousedown:n("insertUnorderedList")},D("menu",16))),o("div",{...x,id:l,class:"pxd-input pxd-richtext-area",contenteditable:"true",role:"textbox","aria-multiline":"true","aria-label":a.label,ref:m=>{let g=m;!g||g.dataset.ready||(g.dataset.ready="1",g.replaceChildren(...Gd(p)))},onInput:m=>i(m.currentTarget),onBlur:m=>i(m.currentTarget)})))}function Kd(e,t,a,r){let d=t.b,p=String(d.value(e.value)??""),[i,n]=t.state(e,"inline",null),l=()=>{i!==null&&d.write(e.value,i),n(null)};return i===null?o("div",{class:"pxd-inline-edit"},o("span",{class:"pxd-field-label"},a.label),o("button",{type:"button",class:"pxd-inline-value","aria-label":`Edit ${a.label}`,onClick:()=>n(p)},o("span",{class:p?void 0:"pxd-inline-empty"},p||"Not set"),o("span",{class:"pxd-inline-hint","aria-hidden":"true"},"Edit"))):ke(a,o("input",{...r,type:"text",value:i,ref:c=>c&&!c.dataset.focused&&(c.dataset.focused="1",c.focus()),onInput:c=>n(te(c)),onBlur:l,onKeydown:c=>{c.key==="Enter"?(c.preventDefault(),l()):c.key==="Escape"&&n(null)}}))}var Hr=(e,t,a)=>o("div",{class:"pxd-option-text"},o("label",{for:e},t),a&&o("span",{class:"pxd-option-description",id:`${e}-desc`},a)),Fe=(e,...t)=>o("span",{"data-state":"checked",class:e,style:{pointerEvents:"none"}},...t);function Br(e,t){let a=t.b,r=t.id(e,"label"),d=t.id(e,"help"),p=Se(e,t.r.data,a.scope,a.text),[i,n]=t.state(e,"query",""),l=At(p,e.mode),{multiple:c,withFaces:s,searchable:u}=l,x=l.control==="chips",m=a.value(e.value),g=me,f=b=>Rt(r,b),y=e.help!==void 0?a.text(e.help):void 0,h=t.a11y(e),k=a.text(e.label),A=o("div",{class:"pxd-field-label",id:r},k,e.required&&Ee()),C=y&&o("p",{class:"pxd-field-help",id:d},y),I=u&&o("div",{class:"pxd-search pxd-search-compact"},D("search"),o("input",{type:"search",class:"pxd-search-input",placeholder:Tt(s),"aria-label":`Search ${k}`,value:i,onInput:b=>n(te(b))})),E=b=>it(b,i);if(c){let b=w=>Nt(m,w),v=w=>a.write(e.value,It(m,w));if(x)return o("div",{class:"pxd-field pxd-choice",role:"group","aria-labelledby":r,"aria-describedby":y?d:void 0,...h},A,C,o("div",{class:"pxd-chips"},...p.map(w=>xe({key:g(w.value),class:"pxd-chip",checked:b(w.value),onCheckedChange:()=>v(w.value),indicator:Fe("pxd-chip-check",D("check",18))},w.label))));if(s){let{recent:w,rest:N}=pt(p,i);return o("fieldset",{class:"pxd-field pxd-choice pxd-people","aria-describedby":y?d:void 0,...h},o("legend",{class:"pxd-field-label",id:r},k),C,I,o("div",{class:"pxd-people-group"},w.length>0&&o("div",{class:"pxd-people-recent"},...w.map(z=>xe({key:g(z.value),class:"pxd-person-tile",checked:b(z.value),onCheckedChange:()=>v(z.value),"aria-label":z.label,indicator:null},o("span",{class:"pxd-person-face"},re(t,{value:z.avatar,name:z.label,size:56}),b(z.value)&&Fe("pxd-person-tick",D("check",14))),o("span",{class:"pxd-person-name","aria-hidden":"true"},z.label.split(" ")[0])))),o("div",{class:"pxd-people-list"},...N.map(z=>{let M=f(z.value);return xe({key:g(z.value),id:M,class:"pxd-person-row",checked:b(z.value),onCheckedChange:()=>v(z.value),"aria-labelledby":`${M}-name`,"aria-describedby":z.description?`${M}-desc`:void 0,indicator:null},re(t,{value:z.avatar,name:z.label}),o("span",{class:"pxd-person-text"},o("span",{id:`${M}-name`},z.label),z.description&&o("span",{class:"pxd-option-description",id:`${M}-desc`},z.description)),b(z.value)&&Fe("pxd-person-check",D("check")))}))))}return o("fieldset",{class:"pxd-field pxd-choice","aria-describedby":y?d:void 0,...h},o("legend",{class:"pxd-field-label",id:r},k),C,I,o("div",{class:`pxd-choice-list${u?" pxd-choice-scroll":""}`},...p.filter(E).map(w=>{let N=f(w.value);return o("div",{class:"pxd-choice-option",key:g(w.value)},w.avatar!==void 0&&re(t,{value:w.avatar,name:w.label,size:32}),xe({id:N,class:"pxd-checkbox",checked:b(w.value),onCheckedChange:()=>v(w.value),"aria-describedby":w.description?`${N}-desc`:void 0,indicator:Fe("pxd-checkbox-indicator","\u2713")}),Hr(N,w.label,w.description))})))}let F=m==null?"":g(m),$=b=>a.write(e.value,p.find(v=>g(v.value)===b)?.value),T=(b,v,w,N,...z)=>Ue({key:g(b.value),value:g(b.value),group:F,first:v===0,onSelect:()=>$(g(b.value)),indicator:N,...w},...z);if(x)return o("div",{class:"pxd-field pxd-choice",...h},A,C,Ce({class:"pxd-chips","aria-labelledby":r,"aria-describedby":y?d:void 0,"aria-required":e.required||void 0,value:F,onValueChange:$,orientation:"horizontal"},...p.map((b,v)=>T(b,v,{class:"pxd-chip","data-orientation":"horizontal"},Fe("pxd-chip-check",D("check",18)),b.label))));if(s){let{recent:b,rest:v}=pt(p,i);return o("div",{class:"pxd-field pxd-choice pxd-people",...h},A,C,I,Ce({"aria-labelledby":r,"aria-describedby":y?d:void 0,"aria-required":e.required||void 0,value:F,onValueChange:$,class:"pxd-people-group"},b.length>0&&o("div",{class:"pxd-people-recent",role:"presentation"},...b.map((w,N)=>T(w,N,{class:"pxd-person-tile","aria-label":w.label},null,re(t,{value:w.avatar,name:w.label,size:56}),o("span",{class:"pxd-person-name","aria-hidden":"true"},w.label.split(" ")[0])))),o("div",{class:"pxd-people-list",role:"presentation"},...v.map((w,N)=>{let z=f(w.value);return T(w,b.length+N,{id:z,class:"pxd-person-row","aria-labelledby":`${z}-name`,"aria-describedby":w.description?`${z}-desc`:void 0},null,re(t,{value:w.avatar,name:w.label}),o("span",{class:"pxd-person-text"},o("span",{id:`${z}-name`},w.label),w.description&&o("span",{class:"pxd-option-description",id:`${z}-desc`},w.description)),F===g(w.value)&&Fe("pxd-person-check",D("check")))}))))}return o("div",{class:"pxd-field pxd-choice",...h},A,C,I,Ce({class:`pxd-choice-list${u?" pxd-choice-scroll":""}`,"aria-labelledby":r,"aria-describedby":y?d:void 0,"aria-required":e.required||void 0,value:F,onValueChange:$,orientation:"vertical"},...p.filter(E).map((b,v)=>{let w=f(b.value);return o("div",{class:"pxd-choice-option",key:g(b.value)},T(b,v,{id:w,class:"pxd-radio","aria-describedby":b.description?`${w}-desc`:void 0,"data-orientation":"vertical"},o("span",{"data-state":"checked",class:"pxd-radio-indicator",style:{pointerEvents:"none"}})),Hr(w,b.label,b.description))})))}function jr(e,t){let a=t.b,r=t.id(e),d=t.id(e,"desc"),p=!!a.value(e.value),i=e.description!==void 0?a.text(e.description):void 0,n=c=>{a.write(e.value,c),e.action&&t.r.dispatch({event:{name:e.action.event.name,context:Ne(e,t.r.data,a.scope,c)}},{pointer:""},e.id)},l=t.a11y(e);return o("div",{class:"pxd-toggle"},e.action?pr({id:r,class:"pxd-switch",checked:p,onCheckedChange:n,"aria-describedby":i?d:void 0,...l}):xe({id:r,class:"pxd-checkbox",checked:p,onCheckedChange:c=>n(c===!0),"aria-describedby":i?d:void 0,...l,indicator:Fe("pxd-checkbox-indicator","\u2713")}),o("div",{class:"pxd-toggle-text"},o("label",{for:r,class:"pxd-toggle-label"},a.text(e.label)),i&&o("p",{class:"pxd-field-help",id:d},i)))}var Fr={date:"date",time:"time",datetime:"datetime-local",month:"month"};function Lr(e,t){let a=t.b,r=t.r,d=t.id(e),p=t.id(e,"help"),i=e.kind??"date",n=e.help!==void 0?a.text(e.help):void 0,l=a.value(e.value),c=e.min!==void 0?a.text(e.min):void 0,s=e.max!==void 0?a.text(e.max):void 0,u=t.a11y(e),x=a.text(e.label);if(e.multiple&&i!=="dateRange"){let m=Array.isArray(l)?l.map(String):[],g=h=>G(h,{type:i==="month"?"date":i==="time"?"time":i==="datetime"?"datetime":"date"},r.locale),f=h=>h&&!m.includes(h)&&a.write(e.value,[...m,h].sort()),y=h=>{let k=h.currentTarget;f(k.value),k.value=""};return o("fieldset",{class:"pxd-field pxd-date-multiple",...u},o("legend",{class:"pxd-field-label"},x,e.required&&Ee()),n&&o("p",{class:"pxd-field-help",id:p},n),m.length>0&&o("ul",{class:"pxd-tags-list","aria-label":`Chosen ${x}`},...m.map(h=>o("li",{key:h,class:"pxd-tag-chip"},i==="year"||i==="month"?h:g(h),o("button",{type:"button",class:"pxd-tag-remove","aria-label":`Remove ${h}`,onClick:()=>a.write(e.value,m.filter(k=>k!==h))},D("close",14))))),o("label",{class:"pxd-date-add",for:d},o("span",{class:"pxd-sr-only"},"Add a date"),i==="year"?o("input",{id:d,class:"pxd-input pxd-input-year",inputmode:"numeric",pattern:"[0-9]{4}",maxlength:4,placeholder:"YYYY","aria-describedby":n?p:void 0,onKeydown:h=>h.key==="Enter"&&(h.preventDefault(),y(h)),onBlur:y}):o("input",{id:d,class:"pxd-input pxd-input-date",type:Fr[i],min:c,max:s,"aria-describedby":n?p:void 0,onChange:y})))}if(i==="year")return ke({label:x,help:n,required:e.required,id:d,helpId:p},o("input",{id:d,class:"pxd-input pxd-input-year",inputmode:"numeric",pattern:"[0-9]{4}",maxlength:4,placeholder:"YYYY",value:l??"",min:c,max:s,required:e.required,"aria-describedby":n?p:void 0,onInput:m=>a.write(e.value,te(m).replace(/\D/g,"").slice(0,4)||null),...u}));if(i==="dateRange"){let[m,g]=Array.isArray(l)?l:[],f=(y,h)=>{let k=[m??null,g??null];k[y]=h||null,a.write(e.value,k)};return o("fieldset",{class:"pxd-field",...u},o("legend",{class:"pxd-field-label"},x),n&&o("p",{class:"pxd-field-help"},n),o("div",{class:"pxd-date-range"},o("label",null,"From",o("input",{class:"pxd-input",type:"date",value:m??"",min:c,max:s,required:e.required,onChange:y=>f(0,te(y))})),o("label",null,"To",o("input",{class:"pxd-input",type:"date",value:g??"",min:m??c,max:s,required:e.required,onChange:y=>f(1,te(y))}))))}return ke({label:x,help:n,required:e.required,id:d,helpId:p},o("input",{id:d,class:`pxd-input pxd-input-date${i==="month"?" pxd-input-month":""}`,type:Fr[i],value:l??"",min:c,max:s,required:e.required,"aria-describedby":n?p:void 0,onChange:m=>a.write(e.value,te(m)||null),...u}))}function Dr(e,t){let a=t.b,r=t.r,d=t.id(e,"label"),p=t.id(e,"min"),i=t.id(e,"max"),n=s=>G(s,X(e.format??{type:"number"},r.data,a.scope),r.locale),l=t.a11y(e);if(e.mode==="range"){let s=a.value(e.value),[u,x]=Array.isArray(s)?s.map(Number):[e.min,e.max],m=(g,f)=>a.write(e.value,[Math.max(e.min,Math.min(g,f)),Math.min(e.max,Math.max(g,f))]);return o("div",{class:"pxd-field pxd-range",role:"group","aria-labelledby":d,...l},o("div",{class:"pxd-range-header"},o("span",{class:"pxd-field-label",id:d},a.text(e.label)),o("output",{class:"pxd-range-value","aria-live":"polite"},`${n(u)} \u2013 ${n(x)}`)),Eo({min:e.min,max:e.max,step:e.step??1,values:[u,x],minStepsBetweenThumbs:1,onValueChange:([g,f])=>m(g,f),thumbs:[{"aria-label":"Minimum","aria-valuetext":n(u)},{"aria-label":"Maximum","aria-valuetext":n(x)}]}),o("div",{class:"pxd-range-fields"},o("label",{for:p},o("span",null,"Minimum"),o("input",{id:p,class:"pxd-input",inputmode:"numeric",value:String(u),onInput:g=>m(Number(te(g))||e.min,x)})),o("span",{"aria-hidden":"true"},"\u2013"),o("label",{for:i},o("span",null,"Maximum"),o("input",{id:i,class:"pxd-input",inputmode:"numeric",value:String(x),onInput:g=>m(u,Number(te(g))||e.max)}))))}let c=Number(a.value(e.value)??e.min);return o("div",{class:"pxd-field pxd-range",...l},o("div",{class:"pxd-range-header"},o("span",{class:"pxd-field-label",id:d},a.text(e.label)),o("output",{class:"pxd-range-value","aria-live":"polite"},n(c))),Eo({min:e.min,max:e.max,step:e.step??1,values:[c],onValueChange:([s])=>a.write(e.value,s),thumbs:[{"aria-labelledby":d,"aria-valuetext":n(c)}]}),o("div",{class:"pxd-range-bounds","aria-hidden":"true"},o("span",null,n(e.min)),o("span",null,n(e.max))))}function Xd(e){return(e.labels?.[0]?.textContent??e.getAttribute("aria-label")??e.closest(".pxd-field")?.querySelector(".pxd-field-label, legend")?.textContent??"").replace(/\*\s*$/,"").trim()}function Yd(e,t){let a=new Set,r=[];for(let d of Array.from(e.elements))if(!(!d.willValidate||d.validity.valid)){if(d.type==="radio"&&d.name){if(a.has(d.name))continue;a.add(d.name)}d.id||(d.id=`${t}-${r.length}`),r.push(d)}return r}function Vr(e,t){let a=t.b,r=t.r,d=Math.min(t.heading,6),p=t.id(e,"summary"),[i,n]=t.state(e,"problems",()=>[]),[l]=t.state(e,"marked",()=>({current:[]})),c=(e.children??[]).some(f=>r.byId.get(f)?.required),s=()=>{for(let f of l.current)f.removeAttribute("aria-invalid"),f.pxdDescribed?f.setAttribute("aria-describedby",f.pxdDescribed):f.removeAttribute("aria-describedby"),f.pxdNote?.remove(),f.pxdNote=void 0;l.current=[]},u=f=>{for(let y of f){y.setAttribute("aria-invalid","true");let h=y.closest(".pxd-field");if(h&&!h.querySelector(".pxd-field-error")){let k=h.ownerDocument.createElement("p");k.className="pxd-field-error",k.id=`${y.id}-error`,k.textContent=y.validationMessage,h.append(k),y.pxdNote=k,y.pxdDescribed=y.getAttribute("aria-describedby"),y.setAttribute("aria-describedby",[y.pxdDescribed,k.id].filter(Boolean).join(" "))}}l.current=f},x=f=>{let y=document.getElementById(f);y&&(y.scrollIntoView({block:"center"}),y.focus(),document.activeElement!==y&&y.closest(".pxd-field")?.querySelector("[role='radio'], button, input:not([aria-hidden]), textarea, select")?.focus())},[m,g]=t.state(e,"announced",null);return i!==m&&(g(i),i.length&&t.after(()=>r.root?.querySelector(`[data-pxd-id="${CSS.escape(e.id)}"] .pxd-error-summary`)?.focus())),o("form",{class:`pxd-form${e.aside?" pxd-form-with-aside":""}${e.layout==="horizontal"?" pxd-form-horizontal":""}`,novalidate:!0,onSubmit:f=>{f.preventDefault();let y=f.currentTarget;if(s(),!y.checkValidity()){let h=Yd(y,p);return u(h),n(h.map(k=>({id:k.id,label:Xd(k),message:k.validationMessage})))}n([]),r.dispatch(e.submit.action,a.scope,e.id)},...t.a11y(e)},e.aside&&o("aside",{class:"pxd-form-aside"},t.render(e.aside)),o("div",{class:"pxd-stack pxd-form-fields"},i.length>0&&o("section",{class:"pxd-error-summary",role:"alert",tabindex:"-1","aria-labelledby":p},o(`h${d}`,{id:p,class:"pxd-error-summary-title"},"Check these fields before continuing"),o("ul",{class:"pxd-error-summary-list"},...i.map(f=>o("li",{key:f.id},o("a",{href:`#${f.id}`,class:"pxd-link",onClick:y=>(y.preventDefault(),x(f.id))},f.label?`${f.label}: ${f.message}`:f.message))))),c&&o("p",{class:"pxd-required-legend"},o("span",{class:"pxd-required","aria-hidden":"true"},"*")," ","Required"),...he(t,e.children)),o("div",{class:"pxd-action-bar"},o("button",{type:"submit",class:"pxd-button pxd-button-primary"},a.text(e.submit.label)),e.cancel&&o("button",{type:"button",class:"pxd-button pxd-button-secondary",onClick:()=>r.dispatch(e.cancel.action,a.scope,e.id)},a.text(e.cancel.label))))}var Jd=()=>la(navigator.userAgentData?.platform??navigator.platform??"");function Or(e,t){let a=t.b,r=t.r,d=t.id(e,"desc"),[p,i]=t.state(e,"copied",!1),n=e.disabled!==void 0?!!a.value(e.disabled):!1,l=e.tone==="danger"?" pxd-button-danger":"",c=e.description!==void 0?a.text(e.description):void 0,s=typeof e.shortcut=="string"&&e.shortcut?ia(e.shortcut,Jd()):void 0,u=()=>{let g=e.action.event.name;if(g==="ui.back"&&t.steps)return t.steps.back();if(g==="ui.next"&&t.steps)return t.steps.next();if(g==="ui.copy"){let f=ra(e,r.data,a.scope,a.text),y=()=>{i(!0),setTimeout(()=>i(!1),2e3)};typeof navigator<"u"&&navigator.clipboard?.writeText?navigator.clipboard.writeText(f).then(y,()=>{}):y()}r.dispatch(e.action,a.scope,e.id)},x=r.doc.surface.kind==="shell",m=g=>{let f=g;f&&(f.pxdKey&&document.removeEventListener("keydown",f.pxdKey),!(!s||n)&&(f.pxdKey=y=>{let h=r.root;y.defaultPrevented||y.repeat||!h||!f.isConnected||!x&&!h.contains(document.activeElement)&&!(y.target instanceof HTMLElement&&h.contains(y.target))||pa(s,y)&&(na(s)&&ir(y.target)||(y.preventDefault(),f.click()))},document.addEventListener("keydown",f.pxdKey),r.onDispose(()=>f.pxdKey&&document.removeEventListener("keydown",f.pxdKey))))};return o("button",{type:"button",class:`pxd-button pxd-button-${e.emphasis??"secondary"}${l}${c?" pxd-button-described":""}`,disabled:n,"aria-describedby":c?d:void 0,"aria-keyshortcuts":s?.aria,onClick:u,...t.a11y(e),ref:m},o("span",{class:"pxd-button-label"},p?"Copied":a.text(e.label)),s&&o("span",{class:"pxd-kbd-hint","aria-hidden":"true"},...s.hint.map((g,f)=>o("kbd",{key:f,class:"pxd-kbd"},g))),c&&o("span",{class:"pxd-button-description",id:d},c),e.action.event.name==="ui.copy"&&o("span",{class:"pxd-sr-only","aria-live":"polite"},p?"Copied":""))}function _r(e,t){let a=t.b,r=t.r,[d,p]=t.state(e,"task",null),i=e.current!==void 0?a.value(e.current):void 0,[n,l]=t.state(e,"step",()=>Ft(i,e.steps.length)),c=e.kind??"wizard",s=o("div",{class:"pxd-action-bar"},o("button",{type:"button",class:"pxd-button pxd-button-primary",onClick:()=>r.dispatch(e.finish.action,a.scope,e.id)},a.text(e.finish.label)));if(c==="guide")return o("div",{class:"pxd-steps pxd-guide",...t.a11y(e)},o("ol",{class:"pxd-guide-list"},...e.steps.map((k,A)=>o("li",{key:k.key,class:"pxd-guide-step"},o("span",{class:"pxd-guide-number","aria-hidden":"true"},A+1),o("div",{class:"pxd-guide-body"},ve(t,"pxd-guide-title",a.text(k.title)),t.render(k.content))))),s);if(c==="tasklist"){let k=C=>Bt(C.status!==void 0?a.text(C.status):"todo"),A=e.steps.filter(C=>k(C).label==="Completed").length;return o("div",{class:"pxd-steps pxd-tasklist",...t.a11y(e)},o("p",{class:"pxd-steps-progress"},Lt(A,e.steps.length)),o("ul",{class:"pxd-tasklist-list"},...e.steps.map(C=>{let I=d===C.key,{label:E,tone:F}=k(C),$=E==="Cannot start yet";return o("li",{key:C.key,class:`pxd-task${I?" pxd-task-open":""}`},o("div",{class:"pxd-task-row"},o("button",{type:"button",class:"pxd-task-title","aria-expanded":I,disabled:$,onClick:()=>p(jt(d,C.key))},a.text(C.title)),o("span",{class:`pxd-badge pxd-tone-${F} pxd-task-status`},E)),I&&o("div",{class:"pxd-task-content"},t.render(C.content)))})),s)}let u=e.steps.length,x=typeof i=="number"&&e.current?.path?{index:Math.max(0,Math.min(u-1,i)),total:u}:{...n,total:u},m=k=>{let A=Ht(x,{type:"go",index:k});e.current?.path?a.write(e.current,A.index):l(A)},g=x.index,f=e.steps[g],y=$t(x),h=t.with({steps:{back:()=>m(g-1),next:()=>m(g+1)}});return o("div",{class:"pxd-steps",...t.a11y(e)},o("p",{class:"pxd-steps-progress"},Pt(x)),o("ol",{class:"pxd-steps-list"},...e.steps.map((k,A)=>o("li",{key:k.key,"aria-current":A===g?"step":void 0,class:A<g?"pxd-step-done":A===g?"pxd-step-current":void 0},a.text(k.title)))),o("form",{class:"pxd-steps-content",onSubmit:k=>{k.preventDefault(),y?r.dispatch(e.finish.action,a.scope,e.id):m(g+1)}},ve(h,"pxd-steps-title",a.text(f.title)),h.render(f.content),o("div",{class:"pxd-action-bar"},o("button",{type:"submit",class:"pxd-button pxd-button-primary"},y?a.text(e.finish.label):"Continue"),g>0&&o("button",{type:"button",class:"pxd-button pxd-button-secondary",onClick:()=>m(g-1)},"Back"))))}function qr(e,t){let a=t.b,r=t.r,d=r.doc.root===e.id,[p,i]=t.state(e,"open",!0),[n,l]=t.state(e,"typed",""),c=t.id(e,"title"),s=t.id(e,"desc"),u=e.typeToConfirm!==void 0?a.text(e.typeToConfirm):void 0,x=!u||n.trim()===u,m=e.severity==="destructive",g=t.a11y(e),f=()=>{d||i(!1),r.dispatch(e.cancel?.action??{event:{name:"ui.dismiss"}},a.scope,e.id)},y=()=>x&&r.dispatch(e.confirm.action,a.scope,e.id),h=e.subject&&o("div",{class:"pxd-dialog-subject"},re(t,{value:e.subject.avatar!==void 0?a.value(e.subject.avatar):void 0,name:a.text(e.subject.title),size:56}),o("div",null,o("div",{class:"pxd-dialog-subject-title"},a.text(e.subject.title)),e.subject.subtitle!==void 0&&o("div",{class:"pxd-dialog-subject-sub"},a.text(e.subject.subtitle)))),k=e.amount&&o("div",{class:"pxd-dialog-amount"},a.text(e.amount.value,e.amount.format)),A=Array.isArray(e.consequences)&&o("ul",{class:"pxd-consequences"},...e.consequences.map((b,v)=>o("li",{key:v},o("span",{class:"pxd-consequence-icon"},D(b.icon??"info")),o("span",null,o("span",{class:"pxd-consequence-title"},a.text(b.title)),b.detail!==void 0&&o("span",{class:"pxd-consequence-detail"},a.text(b.detail)))))),C=o("div",{class:"pxd-dialog-description",id:s},e.message!==void 0&&o("p",null,a.text(e.message))),I=e.consequence!==void 0&&o("p",{class:"pxd-dialog-consequence",id:`${s}-consequence`},D("info",18),o("span",null,a.text(e.consequence))),E=(b,v)=>[A,e.summary&&t.render(e.summary),u&&o("div",{class:"pxd-field"},o("label",{class:"pxd-field-label",for:`${e.id}-type`},"Type ",o("strong",null,u)," to confirm"),o("input",{id:`${e.id}-type`,class:"pxd-input",autocomplete:"off",value:n,onInput:w=>l(w.target.value)})),I,o("div",{class:"pxd-action-bar"},b,v)],F=o("button",{type:"button",class:`pxd-button pxd-button-primary${m?" pxd-button-danger":""}`,disabled:!x,onClick:y},a.text(e.confirm.label)),$=e.cancel?a.text(e.cancel.label):"Cancel",T=e.consequence!==void 0?`${s} ${s}-consequence`:s;if(d){let[b,v]=t.state(e,"focused",!1);return b||(v(!0),t.after(()=>r.root?.querySelector(`[data-pxd-id="${CSS.escape(e.id)}"] > .pxd-action-bar > .pxd-button-secondary`)?.focus({preventScroll:!0}))),o("div",{role:"alertdialog","aria-modal":"false","aria-labelledby":c,"aria-describedby":T,class:`pxd-dialog pxd-dialog-inline${m?" pxd-dialog-destructive":""}`,onKeydown:w=>w.key==="Escape"&&f(),...g},o("h1",{class:"pxd-dialog-title",id:c},a.text(e.title)),k,h,C,...E(F,o("button",{type:"button",class:"pxd-button pxd-button-secondary",onClick:f},$)))}return p&&t.portal(ue({ctx:t,id:t.id(e,"dialog"),role:"alertdialog",class:`pxd-dialog${m?" pxd-dialog-destructive":""}`,onClose:f,props:{"aria-labelledby":c,"aria-describedby":T,...g}},o("h2",{id:c,class:"pxd-dialog-title"},a.text(e.title)),k,h,C,...E(F,o("button",{type:"button",class:"pxd-button pxd-button-secondary",autofocus:!0,onClick:f},$)))),null}function Gr(e,t){let a=t.b,r=t.r,d=O(e.items.path,a.scope),p=Z(_(r.data,d)),i=p.map((g,f)=>({pointer:K(d,f)})),n=(g,f)=>_(r.data,O(g,i[f])),l=e.recommended!==void 0?a.text(e.recommended):void 0,c=e.recommendedReason!==void 0?a.text(e.recommendedReason):void 0,s=qa(e.attributes,p.length,n),u=Ga(e.attributes,a.text),x=Wa(p.map((g,f)=>String(n(e.itemTitle,f)??"")),l),m=(g,f)=>{let y=n(g.path,f);return typeof y=="boolean"?y?o("span",{class:"pxd-yes"},D("check",18),o("span",{class:"pxd-sr-only"},"Included")):o("span",{class:"pxd-no"},D("dash",18),o("span",{class:"pxd-sr-only"},"Not included")):G(y,X(g.format,r.data,a.scope),r.locale)};return o("div",{class:"pxd-comparison",...t.a11y(e)},e.summary!==void 0&&o("p",{class:"pxd-comparison-summary"},a.text(e.summary)),o("ul",{class:"pxd-comparison-items"},...x.map(g=>{let f=String(n(e.itemTitle,g)??""),y=l===f;return o("li",{key:g,class:`pxd-comparison-item${y?" pxd-recommended":""}`},y&&o("p",{class:"pxd-recommendation"},o("span",{class:"pxd-badge pxd-tone-info"},"Recommended"),c&&o("span",{class:"pxd-recommendation-reason"},c)),ve(t,"pxd-comparison-title",f),...u.map((h,k)=>o("div",{class:"pxd-comparison-group",key:k},h.label&&o("p",{class:"pxd-comparison-group-label"},h.label),o("dl",null,...h.attributes.map(A=>o("div",{class:"pxd-detail-row",key:A.key},o("dt",null,a.text(A.label)),o("dd",null,m(A,g),s.get(A.key)===g&&o("span",{class:"pxd-best"}," Best"))))))),e.choose&&o("button",{type:"button",class:`pxd-button ${y?"pxd-button-primary":"pxd-button-secondary"}`,onClick:()=>r.dispatch(e.choose.action,i[g],e.id)},`${a.text(e.choose.label)} `,o("span",{class:"pxd-sr-only"},f)))})))}function Wr(e,t){let a=t.r,r=e.children??[],[d,p]=t.state(e,"shown",r.length),[i]=t.state(e,"widths",()=>new Map),[n]=t.state(e,"measured",()=>({trigger:44,width:-1})),[l,c]=t.state(e,"menu",be),s=fo(r,a.byId),u=t.id(e,"more"),x=y=>{if(r.length<=2||getComputedStyle(y).flexDirection==="column")return p(r.length);for(let A of y.querySelectorAll(":scope > [data-pxd-id]"))A.offsetWidth&&i.set(A.dataset.pxdId,A.offsetWidth);let h=y.querySelector(":scope > .pxd-action-bar-more");h?.offsetWidth&&(n.trigger=h.offsetWidth);let k=parseFloat(getComputedStyle(y).columnGap)||0;p(go(r,A=>i.get(A)??0,k,y.clientWidth,n.trigger,s))},m=y=>{y&&a.observeWidth(y,`${e.id}:bar`,h=>{h!==n.width&&(n.width=h,x(y))})};t.after(()=>{let y=a.root?.querySelector(`[data-pxd-id="${CSS.escape(e.id)}"].pxd-action-bar`);y&&x(y)});let g=r.slice(0,Math.min(d,r.length)),f=r.slice(g.length);return f.length&&He(t,u,l,c,Zd(t,f),{class:"pxd-menu pxd-action-menu"}),o("div",{class:"pxd-action-bar",role:"group","aria-label":"Actions",...t.a11y(e),ref:m},...g.map(y=>t.render(y)),f.length>0&&o("button",{type:"button",..._e(u,l,c,"start",{class:"pxd-icon-button pxd-action-menu-trigger pxd-action-menu-overflow pxd-action-bar-more","aria-label":uo})},D("dots",18)))}function Zd(e,t){let a=e.b,r=t.map(l=>e.r.byId.get(l)).filter(l=>!!l&&l.component==="Action"&&(l.visible===void 0||a.value(l.visible)!==!1)),{usual:d,danger:p,divider:i}=Je(r),n=l=>({key:l.id,label:[a.text(l.label)],class:`pxd-menu-item${l.tone==="danger"?" pxd-menu-item-danger":""}`,disabled:l.disabled!==void 0?!!a.value(l.disabled):void 0,onSelect:()=>e.r.dispatch(l.action,a.scope,l.id),props:{"data-pxd-id":l.id,"data-pxd-component":l.component}});return[...d.map(n),...i?["separator"]:[],...p.map(n)]}function Kr(e,t){let a=t.b,r=t.r,[d,p]=t.state(e,"compact",!1),[i,n]=t.state(e,"open",!1),l=t.a11y(e),c=t.id(e,"sheet"),s=e.label!==void 0?a.text(e.label):"Filters",u=(e.children??[]).map(E=>r.byId.get(E)).filter(Boolean),x=u.filter(E=>E.component==="TextInput"&&E.kind==="search"),m=u.filter(E=>!x.includes(E)),g=no(m,r.data,a.scope,r.locale,a.text),f=E=>r.surface.write(E.binding,E.cleared,a.scope),y=e.resultCount!==void 0?a.value(e.resultCount):void 0,h=so(y,r.locale),k=()=>{for(let E of g)f(E);e.clear&&r.dispatch(e.clear,a.scope,e.id)},A=()=>n(!1),C=()=>m.map(E=>t.render(E.id)),I=o("div",{class:"pxd-filter-results"},...x.map(E=>t.render(E.id)),o("div",{class:"pxd-filter-status"},d&&o("button",{type:"button",class:"pxd-chip pxd-filter-trigger","aria-haspopup":"dialog","aria-expanded":i,"aria-controls":i?c:void 0,"data-state":i?"open":"closed",onClick:()=>n(!0)},D("filter",18),s,g.length>0&&o("span",{"aria-hidden":"true"},` \xB7 ${g.length}`),g.length>0&&o("span",{class:"pxd-sr-only"},`, ${g.length} active`)),h&&o("p",{class:"pxd-filter-count","aria-live":"polite"},h)),g.length>0&&o("ul",{class:"pxd-filter-chips","aria-label":"Active filters"},...g.map(E=>o("li",{key:E.key},o("button",{type:"button",class:"pxd-chip pxd-filter-chip",onClick:()=>f(E),"aria-label":`Remove filter: ${E.label}`},E.label,D("close",16)))),o("li",null,o("button",{type:"button",class:"pxd-button pxd-button-tertiary pxd-filter-clear",onClick:k},"Clear all"))),t.render(e.results));if(d&&i){let E=t.id(e,"sheet-title");t.portal(ue({ctx:t,id:c,class:"pxd-sheet",onClose:A,props:{id:c,"aria-labelledby":E}},o("div",{class:"pxd-sheet-header"},o("h2",{id:E,class:"pxd-sheet-title"},s),ye(A,{class:"pxd-icon-button","aria-label":"Close"},D("close"))),o("div",{class:"pxd-sheet-body pxd-stack"},...C()),o("div",{class:"pxd-sheet-footer"},g.length>0&&o("button",{type:"button",class:"pxd-button pxd-button-secondary",onClick:k},"Clear all"),ye(A,{class:"pxd-button pxd-button-primary"},h?`Show ${h}`:"Show results"))))}return o("div",{class:`pxd-filter-panel${d?" pxd-filter-compact":""}`,...l,ref:E=>E&&r.observeWidth(E,`${e.id}:filter`,F=>p(F<lo))},d?I:o("div",{class:"pxd-filter-layout"},o("section",{class:"pxd-filter-sidebar","aria-label":s},ve(t,"pxd-filter-title",s),o("div",{class:"pxd-stack"},...C())),I))}function Xr(e,t){let a=t.b,r=t.r,d=t.frame,[p,i]=t.state(e,"compact",!1),[n,l]=t.state(e,"open",!1),[c,s]=t.state(e,"toggled",()=>({})),u=e.kind??"main",x=d&&d.navigationId===e.id&&u==="main"?d.navigation:void 0,m=a.value(e.current),g=x&&d?.current?.key!==void 0?d.current.key:m,f=e.label!==void 0?a.text(e.label):Xa(u),y=t.a11y(e),h=t.id(e,"drawer"),k=b=>{l(!1),d?.setDrawerOpen(!1),r.dispatch(b.action,a.scope,e.id)},A=b=>{let v=b.badge!==void 0?a.value(b.badge):void 0;return v?o("span",{class:"pxd-nav-badge"},v,o("span",{class:"pxd-sr-only"}," needing attention")):null};if(u==="breadcrumb")return o("nav",{class:"pxd-nav-breadcrumb","aria-label":f,...y},o("ol",null,...e.items.map((b,v)=>{let w=v===e.items.length-1,N=b.key===g||g===void 0&&w;return o("li",{key:b.key},N?o("span",{class:"pxd-nav-breadcrumb-current","aria-current":"page"},a.text(b.label)):o("button",{type:"button",class:"pxd-link",onClick:()=>k(b)},a.text(b.label)))})));if(u==="toc")return o("nav",{class:"pxd-nav-toc","aria-label":f,...y},o("p",{class:"pxd-nav-toc-label","aria-hidden":"true"},f),o("ol",null,...e.items.map(b=>{let v=b.key===g;return o("li",{key:b.key},o("a",{href:`#${b.key}`,class:`pxd-nav-toc-link${v?" pxd-nav-current":""}`,"aria-current":v?"true":void 0,onClick:()=>r.dispatch(b.action,a.scope,e.id)},a.text(b.label)))})));if(u==="local")return o("nav",{class:"pxd-nav-local","aria-label":f,...y},o("ul",null,...e.items.map(b=>{let v=b.key===g;return o("li",{key:b.key},o("button",{type:"button",class:`pxd-nav-local-item${v?" pxd-nav-current":""}`,"aria-current":v?"page":void 0,onClick:()=>k(b)},b.icon&&D(b.icon,16),o("span",{class:"pxd-nav-label"},a.text(b.label)),A(b)))})));let C=Ka(e.items,a.text),I=u==="nested",E=b=>b.label&&b.label in c?c[b.label]:!b.label||b.items.some(v=>v.key===g),F=b=>o("ul",null,...b.map(v=>{let w=v.key===g;return o("li",{key:v.key},o("button",{type:"button",class:`pxd-nav-item${w?" pxd-nav-current":""}`,"aria-current":w?"page":void 0,onClick:()=>k(v)},v.icon&&D(v.icon,18),o("span",{class:"pxd-nav-label"},a.text(v.label)),A(v)))})),$=o("nav",{class:`pxd-nav${I?" pxd-nav-nested":""}${x==="side"?" pxd-nav-side":""}`,"aria-label":f,...x==="side"?y:{}},...C.map((b,v)=>o("div",{class:"pxd-nav-group",key:v},b.label&&(I?o("button",{type:"button",class:"pxd-nav-group-toggle","aria-expanded":E(b),onClick:()=>s({...c,[b.label]:!E(b)})},D(E(b)?"sortUp":"sortDown",16),o("span",{class:"pxd-nav-group-label"},b.label)):o("p",{class:"pxd-nav-group-label"},b.label)),(!I||E(b))&&F(b.items))));if(x==="side")return $;if(x==="rail"||x==="bar"){let b=x==="bar"?e.items.slice(0,5):e.items;return o("nav",{class:`pxd-nav-${x}`,"aria-label":f,...y},o("ul",null,...b.map(v=>{let w=v.key===g,N=a.text(v.label);return o("li",{key:v.key},o("button",{type:"button",class:`pxd-nav-${x}-item${w?" pxd-nav-current":""}`,"aria-current":w?"page":void 0,onClick:()=>k(v)},o("span",{class:`pxd-nav-${x}-icon`},v.icon?D(v.icon,24):o("span",{class:"pxd-nav-glyph","aria-hidden":"true"},N.slice(0,1)),A(v)),o("span",{class:"pxd-nav-label"},N)))})))}let T=(b,v,w)=>{if(!b)return;let N=t.id(e,"drawer-title");t.portal(ue({ctx:t,id:h,class:"pxd-nav-drawer",onClose:v,props:{id:h,"aria-labelledby":N,...w}},o("div",{class:"pxd-sheet-header"},o("h2",{id:N,class:"pxd-sheet-title"},f),ye(v,{class:"pxd-icon-button","aria-label":"Close"},D("close"))),$))};return x==="drawer"&&d?(T(d.drawerOpen,()=>d.setDrawerOpen(!1),y),null):(T(p&&n,()=>l(!1),{}),o("div",{class:"pxd-nav-wrap",...y,ref:b=>{if(!b||u!=="main"||x)return;let v=b.closest(".pxd-surface")??b;r.observeWidth(v,`${e.id}:nav`,w=>i(w<900))}},p?o("button",{type:"button",class:"pxd-icon-button pxd-nav-menu","aria-label":`${f} menu`,"aria-haspopup":"dialog","aria-expanded":n,"aria-controls":n?h:void 0,"data-state":n?"open":"closed",onClick:()=>l(!0)},D("menu")):$))}function Qd(e,t,a){t.action&&e.r.dispatch({event:{name:t.action.event.name,context:Ne(t,e.r.data,e.scope,a)}},{pointer:""},t.id)}function Jr(e,t){let a=t.b,r=a.text(e.label),d=e.kind??"label",p=d==="status"?e.tone??"neutral":"neutral",i=t.a11y(e),n=`pxd-tag pxd-tag-${d} pxd-tag-${p}${e.remove?" pxd-tag-removable":""}`;return d==="count"?o("span",{class:n,title:r,...i},o("span",{class:"pxd-sr-only"},`${r}: `),o("span",{class:"pxd-tag-number"},a.text(e.count,{type:"number"}))):o("span",{class:n,title:r,...i},o("span",{class:"pxd-tag-text"},r),e.remove&&o("button",{type:"button",class:"pxd-tag-remove","aria-label":`Remove ${r}`,onClick:()=>t.r.dispatch(e.remove,a.scope,e.id)},D("close",12)))}function Zr(e,t){let a=t.b,r=t.r,d=t.id(e,"name"),p=t.id(e,"detail"),i=t.a11y(e),n=e.kind??"person",l=e.size??"default",c=ut[l]??ut.default,s=a.text(e.name),u=e.detail!==void 0?a.text(e.detail):void 0,x={"--polyxd-identity-size":`${c}px`},m=`pxd-identity pxd-identity-${l} pxd-identity-${n}${e.group?" pxd-identity-group":""}`,g,f=s;if(e.group){let h=O(e.group.path,a.scope),k=Z(_(r.data,h)).map((E,F)=>{let $={pointer:K(h,F)},T=b=>b?_(r.data,O(b,$)):void 0;return{name:String(T(e.group.namePath)??""),image:T(e.group.imagePath)}}),A=e.group.max??4,C=k.slice(0,A),I=k.slice(A);f||(f=Na(k,A)),g=o("span",{class:"pxd-identity-faces"},...C.map((E,F)=>o("span",{class:"pxd-identity-face",key:F},re(t,{value:E.image,name:E.name,size:c}),o("span",{class:"pxd-sr-only"},E.name))),I.length>0&&o("span",{class:"pxd-identity-face pxd-identity-more",role:"img",title:I.map(E=>E.name).join(", "),"aria-label":`${I.length} more: ${I.map(E=>E.name).join(", ")}`},o("span",{"aria-hidden":"true"},`+${I.length}`)))}else g=re(t,{value:a.value(e.image),name:s,size:c});let y=[g,o("span",{class:"pxd-identity-text"},o("span",{class:"pxd-identity-name",id:d},f),u&&o("span",{class:"pxd-identity-detail",id:p},u))];return e.action?o("button",{type:"button",class:`${m} pxd-identity-button`,style:x,"aria-labelledby":d,"aria-describedby":u?p:void 0,onClick:()=>r.dispatch(e.action,a.scope,e.id),...i},...y):o("div",{class:m,style:x,role:"group","aria-labelledby":d,"aria-describedby":u?p:void 0,...i},...y)}function Qr(e,t){let a=t.b,r=t.id(e,"label"),d=t.a11y(e),p=e.kind??"bar",i=a.text(e.label),n=e.caption!==void 0?a.text(e.caption):void 0,l=Ea({kind:p,thresholds:e.thresholds,tone:e.tone,format:X(e.format,t.r.data,a.scope)},a.value(e.value),e.max!==void 0?a.value(e.max):void 0,!!a.value(e.indeterminate),n,t.r.locale),c=p==="meter"?"meter":"progressbar",s=`pxd-gauge pxd-gauge-${p}${l.tone&&l.tone!=="neutral"?` pxd-gauge-${l.tone}`:""}${l.indeterminate?" pxd-gauge-indeterminate":""}`,u=o("div",{class:"pxd-gauge-header"},o("span",{class:"pxd-gauge-label",id:r},i),o("span",{class:"pxd-gauge-readout"},!l.indeterminate&&o("span",{class:"pxd-gauge-value"},l.readout),n&&o("span",{class:"pxd-gauge-caption"},n),l.hint&&o("span",{class:"pxd-gauge-hint"},l.hint)));return p==="ring"?o("div",{class:s,...d},o("div",{class:"pxd-gauge-ring-graphic",role:c,"aria-labelledby":r,...l.valueProps},o("svg",{class:"pxd-gauge-ring-svg",viewBox:"0 0 36 36","aria-hidden":"true",focusable:"false"},o("circle",{class:"pxd-gauge-ring-track",cx:"18",cy:"18",r:"16",fill:"none","stroke-width":"4"}),o("circle",{class:"pxd-gauge-ring-fill",cx:"18",cy:"18",r:"16",fill:"none","stroke-width":"4",pathLength:100,"stroke-dasharray":l.indeterminate?"25 100":`${l.percent} 100`,"stroke-linecap":"round"}))),u):o("div",{class:s,...d},u,o("div",{class:"pxd-gauge-track",role:c,"aria-labelledby":r,...l.valueProps},o("div",{class:"pxd-gauge-fill",style:l.indeterminate?void 0:{width:`${l.percent}%`}})))}function Yr(e){let t=Math.round(Math.max(0,Math.min(1,e))*100);return o("span",{class:"pxd-rating-star-shape","aria-hidden":"true"},o("svg",{class:"pxd-rating-star-empty",viewBox:"0 0 24 24",focusable:"false"},o("path",{d:ft})),o("span",{class:"pxd-rating-star-fill",style:{width:`${t}%`}},o("svg",{viewBox:"0 0 24 24",focusable:"false"},o("path",{d:ft}))))}function ed(e,t){let a=t.b,r=t.r,d=t.id(e,"label"),p=t.id(e,"help"),[i,n]=t.state(e,"hover",null),l=t.a11y(e),c=e.max??5,s=a.text(e.label),u=a.value(e.value),x=u==null||u===""?void 0:Number(u),m=x!==void 0&&Number.isFinite(x)?Math.max(0,Math.min(c,x)):void 0,g=!!a.value(e.readOnly),f=e.count!==void 0?a.value(e.count):void 0,y=f!=null?G(f,{type:"number"},r.locale):void 0,h=e.help!==void 0?a.text(e.help):void 0,k=m!==void 0?G(m,{type:"number",precision:Number.isInteger(m)?0:1},r.locale):void 0,A=f!=null?`from ${y} ${Number(f)===1?"rating":"ratings"}`:void 0;if(g)return o("div",{class:"pxd-rating pxd-rating-readonly",...l},o("span",{class:"pxd-rating-label"},s),o("span",{class:"pxd-rating-stars",role:"img","aria-label":Aa(k,c)},...Array.from({length:c},(F,$)=>Yr((m??0)-$))),o("span",{class:"pxd-rating-readout"},k&&o("span",{class:"pxd-rating-value","aria-hidden":"true"},k),y&&o("span",{class:"pxd-rating-count"},o("span",{"aria-hidden":"true"},`(${y})`),o("span",{class:"pxd-sr-only"},A))));let C=m!==void 0?Math.round(m):0,I=i??C,E=F=>{let $=Number(F);a.write(e.value,$),Qd(t,e,$)};return o("div",{class:"pxd-field pxd-rating",...l},o("div",{class:"pxd-field-label",id:d},s,e.required&&o("span",{class:"pxd-required","aria-hidden":"true"},"*")),h&&o("p",{class:"pxd-field-help",id:p},h),o("div",{class:"pxd-rating-row"},Ce({class:"pxd-rating-stars",orientation:"horizontal","aria-labelledby":d,"aria-describedby":h?p:void 0,"aria-required":e.required||void 0,value:C?String(C):"",onValueChange:E,onMouseleave:()=>n(null)},...Array.from({length:c},(F,$)=>$+1).map(F=>Ue({key:F,value:String(F),group:C?String(C):"",first:F===1,onSelect:()=>E(String(F)),class:`pxd-rating-star${F<=I?" pxd-rating-star-on":""}`,"aria-label":Ma(F),"data-orientation":"horizontal",onMouseenter:()=>n(F),onFocus:()=>n(null)},Yr(F<=I?1:0)))),o("span",{class:"pxd-rating-readout","aria-hidden":"true"},k&&o("span",{class:"pxd-rating-value"},k),y&&o("span",{class:"pxd-rating-count"},`(${y})`)),A&&o("span",{class:"pxd-sr-only"},A)))}var ei=2e3;function td(e,t){let a=t.b,r=t.id(e,"label"),d=t.a11y(e),p=a.text(e.text),i=e.label!==void 0?a.text(e.label):void 0,n=!!a.value(e.secret),l=e.copyable!==!1,[c,s]=t.state(e,"revealed",!1),[u,x]=t.state(e,"status",""),[m]=t.state(e,"timer",()=>({id:null})),g=C=>{x(C),m.id&&clearTimeout(m.id),m.id=setTimeout(()=>x(""),ei)},f=()=>{let C=typeof navigator<"u"?navigator.clipboard:void 0;if(!C?.writeText)return g("Couldn't copy");C.writeText(p).then(()=>g("Copied"),()=>g("Couldn't copy"))},y=n&&!c,h=y?Ia(p):p,k=i??"code",A=i??(e.language?`${e.language} code`:"Code");return o("section",{class:`pxd-code${e.wrap?" pxd-code-wrap":""}${n?" pxd-code-secret":""}`,"aria-labelledby":i!==void 0?r:void 0,"aria-label":i===void 0?A:void 0,...d},o("div",{class:"pxd-code-header"},i!==void 0&&o("span",{class:"pxd-code-label",id:r},i),o("div",{class:"pxd-code-controls"},n&&o("button",{type:"button",class:"pxd-button pxd-button-tertiary pxd-code-control","aria-label":`${c?"Hide":"Show"} ${k}`,onClick:()=>s(!c)},c?"Hide":"Show"),l&&o("button",{type:"button",class:"pxd-button pxd-button-tertiary pxd-code-control","aria-label":`Copy ${k}`,onClick:f},u==="Copied"&&D("check",16),u==="Copied"?"Copied":"Copy"),o("span",{class:"pxd-sr-only",role:"status","aria-live":"polite"},u))),o("pre",{class:"pxd-code-pre",tabindex:"0","data-language":e.language,"data-masked":y||void 0},o("code",{class:e.language?`language-${e.language}`:void 0,translate:"no"},h)))}var ad=()=>o("svg",{class:"pxd-action-menu-chevron",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},o("path",{d:"m6 9 6 6 6-6"}));function od(e,t){let a=t.b,r=t.r,d=t.a11y(e),p=e.kind??"overflow",i=a.text(e.label),n=d["aria-label"]??i,l=t.id(e,"menu"),[c,s]=t.state(e,"menu",be),[u,x]=t.state(e,"context",be),m=(e.children??[]).map(I=>r.byId.get(I)).filter(I=>!!I&&(I.visible===void 0||a.value(I.visible)!==!1)),{usual:g,danger:f,divider:y}=Je(m),h=I=>({key:I.id,label:[a.text(I.label)],class:`pxd-menu-item${I.tone==="danger"?" pxd-menu-item-danger":""}`,disabled:I.disabled!==void 0?!!a.value(I.disabled):void 0,onSelect:()=>r.dispatch(I.action,a.scope,I.id),props:{"data-pxd-id":I.id,"data-pxd-component":I.component}}),k=[...g.map(h),...y?["separator"]:[],...f.map(h)];He(t,l,c,s,k,{class:"pxd-menu pxd-action-menu"});let A=(I,E,...F)=>o("button",{type:"button",..._e(l,c,s,E,I)},...F),C=()=>A({class:"pxd-icon-button pxd-action-menu-trigger pxd-action-menu-overflow",...d,"aria-label":n},"end",D("dots",18));if(p==="dropdown")return A({class:"pxd-button pxd-button-secondary pxd-action-menu-trigger pxd-action-menu-dropdown",...d,"aria-label":d["aria-label"]},"end",i,ad());if(p==="split"){let E=(e.primary?r.byId.get(e.primary):void 0)?.emphasis??"secondary";return o("div",{class:"pxd-split",role:"group",...d,"aria-label":n},e.primary&&t.render(e.primary),A({class:`pxd-button pxd-button-${E} pxd-action-menu-trigger pxd-split-menu`,"aria-label":`${i}: more options`},"end",ad()))}return p==="context"?(He(t,`${l}-context`,u,x,k,{class:"pxd-menu pxd-action-menu","aria-label":n}),o("span",{class:"pxd-context-target","data-state":u.open?"open":"closed",style:{WebkitTouchCallout:"none"},onContextmenu:I=>{I.preventDefault(),x({open:!0,x:I.clientX,y:I.clientY,align:"start"})}},C())):C()}function rd(e,t){let a=t.b,r=t.r,d=t.a11y(e),p=Math.min(t.heading,6),i=t.id(e,"title"),n=t.id(e,"panel"),l=e.kind??"dialog",c=e.size??"default",s=e.dismissible!==!1,u=ge(e.open),[x,m]=t.state(e,"open",!0),g=u?!!a.value(e.open):x&&e.open!==!1,f=()=>{u?a.write(e.open,!1):m(!1),r.dispatch({event:{name:"ui.dismiss"}},a.scope,e.id)},y=a.text(e.title),h=`pxd-panel pxd-panel-${l} pxd-panel-size-${c}`,k=t.with({heading:p+1}),A=()=>o("div",{class:"pxd-panel-body pxd-stack"},...he(k,e.children)),C=()=>e.actions&&o("div",{class:"pxd-panel-footer"},t.render(e.actions));if(l==="popover")return g&&lr(t,n,`.pxd-panel-anchor[data-pxd-anchor="${CSS.escape(e.id)}"]`,f,s,{class:h,"aria-labelledby":i,...d},o("div",{class:"pxd-panel-header"},o(`h${p}`,{id:i,class:"pxd-panel-title"},y),s&&o("button",{type:"button",class:"pxd-icon-button pxd-panel-close","aria-label":"Close",onClick:f},D("close"))),A(),C(),o("span",{style:{position:"absolute",left:"50%",top:"100%",transform:"translateX(-50%)"}},o("svg",{class:"pxd-panel-arrow",width:16,height:8,viewBox:"0 0 30 10",preserveAspectRatio:"none"},o("polygon",{points:"0,0 30,0 15,10"})))),o("span",{class:"pxd-panel-anchor","data-pxd-anchor":e.id});if(!g)return null;let I=l==="sheet"&&s?ti(f):{};return t.portal(ue({ctx:t,id:n,class:h,overlayClass:"pxd-overlay pxd-panel-backdrop",dismissible:s,onClose:f,props:{"aria-labelledby":i,...d}},o("div",{class:"pxd-panel-header",...I},l==="sheet"&&o("span",{class:"pxd-panel-grip","aria-hidden":"true"}),o(`h${p}`,{id:i,class:"pxd-panel-title"},y),s&&ye(f,{class:"pxd-icon-button pxd-panel-close","aria-label":"Close"},D("close"))),A(),C())),null}function ti(e){let t=null,a=d=>d.currentTarget.closest("dialog"),r=d=>{t=null;let p=a(d);p&&(p.style.transform="",p.style.transition="")};return{onPointerdown:d=>{d.pointerType==="mouse"&&d.button!==0||(t=d.clientY,d.currentTarget.setPointerCapture(d.pointerId))},onPointermove:d=>{let p=a(d);if(t===null||!p)return;let i=Math.max(0,d.clientY-t);p.style.transition="none",p.style.transform=`translateY(${i}px)`},onPointerup:d=>{if(t===null)return;let p=d.clientY-t,i=a(d);r(d),p>80&&(i?.open&&i.close(),e())},onPointercancel:r}}var qe=(...e)=>e.filter(Boolean).join(" ")||void 0,No=e=>e.target.value,To=e=>{typeof e.ref=="string"&&e.ref.startsWith("blob:")&&URL.revokeObjectURL(e.ref)};function id(e,t){let a=t.b,r=t.r,d=t.id(e),p=t.id(e,"help"),i=t.id(e,"error"),[n,l]=t.state(e,"error",null),[c,s]=t.state(e,"dragging",!1),u=a.value(e.value),x=Array.isArray(u)?u:[],m=Array.isArray(e.accept)?e.accept:[],g=e.maxSize,f=!!e.multiple,y=a.text(e.label),h=[e.help!==void 0?a.text(e.help):"",Sa(m,g,f,r.locale)].filter(Boolean).join(" ")||void 0,k=C=>{if(!C)return;let I=Array.from(C),E=[],F=[];for(let $ of f?I:I.slice(0,1)){let T=za($,m,g,r.locale);T?(F.push(T),r.events?.inputError(e,vo($,g))):E.push({name:$.name,size:$.size,type:$.type,ref:URL.createObjectURL($)})}if(l(F.length?F.join(" "):null),E.length!==0)if(f){let $=E.filter(T=>!x.some(b=>b.name===T.name&&b.size===T.size));E.filter(T=>!$.includes(T)).forEach(To),$.length&&a.write(e.value,[...x,...$])}else x.forEach(To),a.write(e.value,E)},A=C=>{To(x[C]),a.write(e.value,x.filter((I,E)=>E!==C)),l(null)};return o("div",{class:"pxd-field pxd-file"},o("label",{class:"pxd-field-label",for:d},y,e.required&&Ee()),h&&o("p",{class:"pxd-field-help",id:p},h),o("div",{class:"pxd-dropzone","data-dragging":c||void 0,onDrop:C=>{C.preventDefault(),s(!1),k(C.dataTransfer?.files??null)},onDragover:C=>{C.preventDefault(),c||s(!0)},onDragleave:C=>{C.currentTarget.contains(C.relatedTarget)||s(!1)}},o("input",{id:d,class:"pxd-dropzone-input",type:"file",accept:m.length?m.join(","):void 0,multiple:f,required:e.required&&x.length===0,"aria-describedby":qe(h&&p,n&&i),"aria-invalid":n?!0:void 0,onChange:C=>{let I=C.target;k(I.files),I.value=""},...t.a11y(e)}),o("span",{class:"pxd-dropzone-icon","aria-hidden":"true"},D("file",24)),o("span",{class:"pxd-dropzone-text"},o("span",{class:"pxd-dropzone-action"},f?"Choose files":"Choose a file"),o("span",{class:"pxd-dropzone-hint"},f?"or drop them here":"or drop it here"))),n&&o("p",{class:"pxd-field-error",id:i,role:"alert"},n),x.length>0&&o("ul",{class:"pxd-file-list"},...x.map((C,I)=>o("li",{class:"pxd-file-item",key:`${C.name}-${C.size}-${I}`},o("span",{class:"pxd-file-icon","aria-hidden":"true"},D("file",18)),o("span",{class:"pxd-file-text"},o("span",{class:"pxd-file-name"},C.name),o("span",{class:"pxd-file-size"},Le(C.size,r.locale)),typeof C.progress=="number"&&C.progress<1&&o("progress",{class:"pxd-file-progress",value:C.progress,max:1,"aria-label":`Uploading ${C.name}`})),o("button",{type:"button",class:"pxd-file-remove","aria-label":`Remove ${C.name}`,onClick:()=>A(I)},D("close",18))))))}var Me="__other";function pd(e,t){let a=t.b,r=t.id(e,"label"),d=t.id(e,"help"),p=t.id(e,"picker"),i=t.id(e,"text"),n=t.id(e,"alpha"),l=e.format??"hex",c=!!e.alpha,s=a.text(e.label),u=e.help!==void 0?a.text(e.help):void 0,x=a.value(e.value),m=x==null?"":String(x),g=ze(m),[f,y]=t.state(e,"draft",null),[h,k]=t.state(e,"other",!1),A=t.a11y(e),C=e.swatches?Se({...e,options:e.swatches},t.r.data,a.scope,a.text):[],I=C.length>0,E=z=>a.write(e.value,xt(z,l,c)),F=z=>{y(z);let M=ze(z);M&&E(M)},$=C.findIndex(z=>g?ha(ze(z.value),g,c):String(z.value)===m&&m!==""),T=h?Me:$>=0?String($):m?Me:"",b=!I||T===Me,v=Math.round((g?.a??1)*100),w=()=>o("div",{class:"pxd-color-picker"},o("input",{id:p,class:"pxd-color-native",type:"color",value:ba(g),"aria-label":`${s}: pick`,"aria-describedby":qe(u&&d),onInput:z=>{let M=ze(No(z));M&&(y(null),E({...M,a:g?.a??1}))}}),o("input",{id:i,class:"pxd-input pxd-input-mono pxd-color-text",type:"text",inputmode:"text",autocomplete:"off",spellcheck:"false",placeholder:va(l),value:f??m,"aria-label":`${s}: value`,"aria-describedby":qe(u&&d),"aria-invalid":f!==null&&f!==""&&!ze(f)?!0:void 0,required:!I&&e.required,onInput:z=>F(No(z)),onBlur:()=>y(null)}),c&&o("label",{class:"pxd-color-alpha",for:n},o("span",{class:"pxd-color-alpha-label"},"Opacity"),o("input",{id:n,type:"range",min:0,max:100,step:1,value:String(v),disabled:!g,"aria-valuetext":`${v}%`,onInput:z=>{g&&(y(null),E({...g,a:Number(No(z))/100}))}}),o("output",{class:"pxd-color-alpha-value",for:n,"aria-hidden":"true"},`${v}%`)));if(!I)return o("div",{class:"pxd-field pxd-color",role:"group","aria-labelledby":r,"aria-describedby":qe(u&&d),...A},o("div",{class:"pxd-field-label",id:r},s,e.required&&Ee()),u&&o("p",{class:"pxd-field-help",id:d},u),w());let N=z=>{if(z===Me)return k(!0);k(!1),y(null);let M=C[Number(z)],S=ze(M.value);a.write(e.value,S?xt(S,l,c):M.value)};return o("div",{class:"pxd-field pxd-color",...A},o("div",{class:"pxd-field-label",id:r},s,e.required&&Ee()),u&&o("p",{class:"pxd-field-help",id:d},u),Ce({class:"pxd-swatches","aria-labelledby":r,"aria-describedby":qe(u&&d),"aria-required":e.required||void 0,value:T,orientation:"horizontal",onValueChange:N},...C.map((z,M)=>Ue({key:String(M),value:String(M),group:T,first:M===0,onSelect:()=>N(String(M)),class:"pxd-swatch",title:z.label,"data-orientation":"horizontal"},o("span",{class:"pxd-swatch-color",style:{background:String(z.value)},"aria-hidden":"true"}),o("span",{class:"pxd-swatch-name"},z.label))),Ue({key:Me,value:Me,group:T,onSelect:()=>N(Me),class:"pxd-swatch pxd-swatch-other",title:"Other","data-orientation":"horizontal"},o("span",{class:"pxd-swatch-color",style:T===Me&&g?{background:m}:void 0,"aria-hidden":"true"}),o("span",{class:"pxd-swatch-name"},"Other"))),b&&w())}var dd=(e,t)=>Array.from({length:t},(a,r)=>e[r]??"");function nd(e,t){let a=t.b,r=t.id(e,"label"),d=t.id(e,"help"),p=ne(Number(e.length)||6,4,12),i=(e.kind??"numeric")==="numeric",n=e.required??!0,l=a.text(e.label),c=e.help!==void 0?a.text(e.help):void 0,s=a.value(e.value),u=s==null?"":String(s),[x]=t.state(e,"code",()=>({chars:dd(u,p),seen:u,fired:null}));u!==x.seen&&(x.seen=u,u!==x.chars.join("")&&(x.chars=dd(u,p)));let m=x.chars,g=t.a11y(e),f=()=>Array.from(t.r.root?.querySelectorAll(`[data-pxd-id="${CSS.escape(e.id)}"] .pxd-code-box`)??[]),y=T=>T.replace(i?/[^0-9]/g:/[^0-9a-zA-Z]/g,""),h=T=>f()[ne(T,0,p-1)]?.focus(),k=T=>{x.chars=T;let b=T.join("");x.seen=b,a.write(e.value,b),e.action&&T.every(Boolean)&&b!==x.fired&&(x.fired=b,t.r.dispatch({event:{name:e.action.event.name,context:Ne(e,t.r.data,a.scope,b)}},{pointer:""},e.id)),t.r.schedule()},A=(T,b)=>{let v=y(b);if(!v)return;let w=[...m],N=T;for(let z of v){if(N>=p)break;w[N++]=z}k(w),h(N)},C=(T,b)=>{let v=m[T],w=b.target.value;if(v&&w.length>1&&(w=w.startsWith(v)?w.slice(v.length):w.endsWith(v)?w.slice(0,-v.length):w),w===""){let N=[...m];return N[T]="",k(N)}A(y(w).length>=p?0:T,w)},I=(T,b)=>{if(b.key==="Backspace"&&!m[T]&&T>0){b.preventDefault();let v=[...m];v[T-1]="",k(v),h(T-1)}else b.key==="ArrowLeft"?(b.preventDefault(),h(T-1)):b.key==="ArrowRight"&&(b.preventDefault(),h(T+1))},E=(T,b)=>{b.preventDefault();let v=b.clipboardData?.getData("text")??"";A(y(v).length>=p?0:T,v)},F=p>6?p%4===0?4:3:p,$=[];for(let T=0;T<p;T+=F)$.push(Array.from({length:Math.min(F,p-T)},(b,v)=>T+v));return o("div",{class:"pxd-field pxd-code",role:"group","aria-labelledby":r,"aria-describedby":qe(c&&d),...g},o("div",{class:"pxd-field-label",id:r},l,n&&Ee()),c&&o("p",{class:"pxd-field-help",id:d},c),o("div",{class:"pxd-code-boxes"},...$.map((T,b)=>o("div",{class:"pxd-code-group",key:b},...T.map(v=>o("input",{key:v,class:"pxd-code-box",type:"text",inputmode:i?"numeric":"text",pattern:i?"[0-9]*":"[0-9A-Za-z]*",autocomplete:v===0?"one-time-code":"off",autocapitalize:i?void 0:"characters",spellcheck:"false","aria-label":`Digit ${v+1} of ${p}`,value:m[v],"data-filled":m[v]?"":void 0,required:n,onFocus:w=>w.target.select(),onInput:w=>C(v,w),onKeydown:w=>I(v,w),onPaste:w=>E(v,w)}))))))}var ld=40;function sd(e,t){let a=t.b,r=t.r,d=t.id(e,"caption"),p=e.selection??"none",i=p!=="none"&&!!e.selected,n=e.expanded?Z(a.value(e.expanded)):void 0,[l,c]=t.state(e,"expanded",null),s=n?new Set(n):l,u=i?a.value(e.selected):void 0,x=H=>Array.isArray(u)?u.includes(H):u!==void 0&&u===H,{rows:m,indexByKey:g,topValues:f}=oo(e,r.data,a.scope,s),[y,h]=t.state(e,"focus",null),k=(y!==null?g.get(y):void 0)??0,[A]=t.state(e,"pending",()=>({index:null})),C=m.length>yt,[I,E]=t.state(e,"geometry",()=>({rowHeight:ld,viewportHeight:ld*12,scrollTop:0})),{start:F,end:$}=po(m.length,I.scrollTop,I.rowHeight,I.viewportHeight),T=()=>r.root?.querySelector(`[data-pxd-id="${CSS.escape(e.id)}"] .pxd-tree-list`),b=H=>{if(!m.length)return;let L=Math.max(0,Math.min(m.length-1,H));h(m[L].key);let U=T()?.querySelector(`[data-index="${L}"]`);if(U)return U.focus();A.index=L;let R=T()?.parentElement;if(C&&R?.classList.contains("pxd-tree-viewport")){let q=Math.max(0,L*I.rowHeight-(I.viewportHeight-I.rowHeight)/2);R.scrollTop=q,E({...I,scrollTop:q})}};t.after(()=>{if(A.index===null)return;let H=T()?.querySelector(`[data-index="${A.index}"]`);if(H&&(A.index=null,H.focus()),C){let L=T()?.querySelector(".pxd-tree-item"),U=T()?.parentElement,R=L&&L.offsetHeight>0?L.offsetHeight:I.rowHeight,q=U?.clientHeight||I.viewportHeight;(R!==I.rowHeight||q!==I.viewportHeight)&&E({...I,rowHeight:R,viewportHeight:q})}});let v=(H,L)=>{if(e.expanded){let R=n??[];a.write(e.expanded,L?[...R,...H.filter(q=>!R.includes(q))]:R.filter(q=>!H.includes(q)));return}let U=new Set(l??f);for(let R of H)L?U.add(R):U.delete(R);c(U)},w=H=>v([H.value],!H.expanded),N=H=>{if(!i)return;if(p==="single")return a.write(e.selected,H.value);let L=Array.isArray(u)?u:[];a.write(e.selected,L.includes(H.value)?L.filter(U=>U!==H.value):[...L,H.value])},z=H=>{N(H),e.action&&r.dispatch(e.action,H.scope,e.id)},[M]=t.state(e,"typed",()=>({buffer:"",at:0})),S=H=>{let L=Date.now();M.buffer=L-M.at<ao?M.buffer+H.toLowerCase():H.toLowerCase(),M.at=L;let U=ro(m,k,M.buffer);U>=0&&b(U)},P=H=>{let L=m[k],U=io(m,k,H);!L||!U||(H.preventDefault(),H.stopPropagation(),"focus"in U?b(U.focus):"toggle"in U?w(L):"activate"in U?z(L):"select"in U?N(L):"expandSiblings"in U?v(m.filter(R=>R.parent===L.parent&&R.hasChildren).map(R=>R.value),!0):"typeAhead"in U&&S(U.typeAhead))},V=a.text(e.label),j=C?{paddingTop:F*I.rowHeight,paddingBottom:(m.length-$)*I.rowHeight}:void 0,B=o("ul",{role:"tree",class:"pxd-tree-list","aria-labelledby":d,"aria-multiselectable":p==="multiple"?!0:void 0,style:j,onKeydown:P},...m.slice(F,$).map((H,L)=>{let U=F+L,R=i?x(H.value):void 0;return o("li",{key:H.key,role:"treeitem",class:`pxd-tree-item${R?" pxd-tree-item-selected":""}`,style:{"--polyxd-tree-depth":H.level-1},"data-index":U,tabindex:U===k?"0":"-1","aria-level":H.level,"aria-setsize":H.setsize,"aria-posinset":H.posinset,"aria-expanded":H.hasChildren?H.expanded:void 0,"aria-selected":R,onFocus:q=>{q.target===q.currentTarget&&h(H.key)},onClick:q=>{q.stopPropagation(),b(U),i?N(H):H.hasChildren&&w(H)},onDblclick:q=>{q.stopPropagation(),e.action?r.dispatch(e.action,H.scope,e.id):H.hasChildren&&w(H)}},o("div",{class:"pxd-tree-row"},H.hasChildren?o("button",{type:"button",class:`pxd-tree-expander${H.expanded?" pxd-tree-expander-open":""}`,tabindex:"-1","aria-hidden":"true",onClick:q=>{q.stopPropagation(),b(U),w(H)},onDblclick:q=>q.stopPropagation()},D("chevronRight",16)):o("span",{class:"pxd-tree-expander pxd-tree-expander-leaf","aria-hidden":"true"}),o("span",{class:"pxd-tree-text"},H.label),H.detail!==void 0&&o("span",{class:"pxd-tree-detail"},H.detail)))}));return o("div",{class:"pxd-tree",...t.a11y(e)},o("div",{class:"pxd-tree-caption",id:d},V),C?o("div",{class:"pxd-tree-viewport",onScroll:H=>E({...I,scrollTop:H.currentTarget.scrollTop})},B):B)}var kt={Section:sr,Group:cr,Card:ur,Disclosure:fr,Views:gr,Navigation:Xr,Text:Er,Metric:Mr,DetailList:Ar,Collection:Ir,Table:Sr,Chart:Rr,Media:Nr,Status:Tr,TextInput:$r,Choice:Br,Toggle:jr,DateInput:Lr,RangeInput:Dr,Form:Vr,Action:Or,ActionBar:Wr,Steps:_r,Confirm:qr,Comparison:Gr,FilterPanel:Kr,Tag:Jr,Identity:Zr,Progress:Qr,Rating:ed,Code:td,Tree:sd,ActionMenu:od,Panel:rd,FileInput:id,ColorInput:pd,CodeInput:nd,Columns:xr,Split:mr,Frame:br,AppBar:hr,Footer:vr,Outlet:kr,Custom:wr};var et=class{surface;props;host;root=null;portalEl=null;components;states=new Map;effects=[];portals=[];modals=0;scheduled=!1;unsubscribe;observers=new Map;drawing=!1;disposers=[];events;statuses=new Map;statusesBefore=new Map;constructor(t,a){this.host=t,this.props=a,this.components={...kt,...a.components??{}},this.surface=this.makeSurface(a),this.events=this.makeEvents(a),this.unsubscribe=this.surface.subscribe(()=>this.schedule());let r=d=>{if(!this.events)return;let p=d.target,i=p?.closest?.("[data-pxd-id]")?.getAttribute("data-pxd-id");i&&this.events.inputError(this.byId.get(i)??i,ho(p?.validity))};t.addEventListener("invalid",r,!0),this.disposers.push(()=>t.removeEventListener("invalid",r,!0))}makeSurface(t){let a=this;return mo(t.document,{data:t.data,locale:t.locale??"en-GB",derive:t.derive,onAction:r=>this.props.onAction?.(r),onDataChange:r=>this.props.onDataChange?.(r),onDismiss:()=>this.props.onDismiss?.(),get events(){return a.events}})}makeEvents(t){return t.onEvent?ko(t.document,a=>this.props.onEvent?.(a),t.events):void 0}statusDrawn(t,a){this.events&&this.statuses.set(`${a.pointer}#${t.id}`,t)}get locale(){return this.surface.locale}get doc(){return this.surface.document}get data(){return this.surface.data}get byId(){return this.surface.byId}get disclosure(){return this.props.disclosure??"progressive"}update(t){let a=this.props;this.props=t,this.components={...kt,...t.components??{}};let r=t.document!==a.document;if(r&&(this.events?.unmounted(!1),this.events=void 0),!!t.onEvent!=!!this.events&&(this.events=this.makeEvents(t),this.statusesBefore.clear()),r||(t.locale??"en-GB")!==a.locale)this.unsubscribe(),this.states.clear(),this.surface=this.makeSurface(t),this.unsubscribe=this.surface.subscribe(()=>this.schedule());else if(t.data&&t.data!==a.data&&t.document.surface.kind==="shell"){this.surface.replaceData(t.data);return}this.schedule()}dispose(){this.events?.unmounted(!1),this.events=void 0,this.unsubscribe();for(let t of this.disposers)t();for(let t of this.observers.values())t.disconnect();Co(this.host)}onDispose(t){this.disposers.push(t)}schedule(){this.scheduled||(this.scheduled=!0,queueMicrotask(()=>{this.scheduled=!1,this.draw()}))}observeWidth(t,a,r){if(!t||this.observers.has(t)||typeof ResizeObserver>"u")return;let d=()=>r(t.getBoundingClientRect().width),p=new ResizeObserver(d);p.observe(t),this.observers.set(t,p),d()}unobserve(t){this.observers.get(t)?.disconnect(),this.observers.delete(t)}bindings(t){let a=this.surface;return{scope:t,value:r=>W(r,a.data,t),text:(r,d)=>{let p=W(r,a.data,t);return d?G(p,X(d,a.data,t),a.locale):p==null?"":String(p)},pointer:r=>O(r.path,t),write:(r,d)=>a.setValue(O(r.path,t),d),context:r=>we(r,a.data,t)}}dispatch(t,a,r){this.surface.dispatch(t,a,r)}ctx(t){let a=this,r=(p,i)=>`${t.scope.pointer}#${p.id}:${i}`,d={r:a,scope:t.scope,heading:t.heading,steps:t.steps,frame:t.frame,b:a.bindings(t.scope),render:(p,i)=>a.renderNode(p,i?d.with({scope:i}):d),a11y:p=>yo(p,i=>{let n=W(i,a.data,t.scope);return n===void 0?void 0:String(n)}),id:(p,i="")=>`pxd-${(t.scope.pointer+"-"+p.id+(i?"-"+i:"")).replace(/[^A-Za-z0-9_-]+/g,"_")}`,state:(p,i,n)=>{let l=r(p,i);a.states.has(l)||a.states.set(l,typeof n=="function"?n():n);let c=s=>{let u=a.states.get(l),x=typeof s=="function"?s(u):s;Object.is(x,u)||(a.states.set(l,x),a.schedule())};return[a.states.get(l),c]},after:p=>a.effects.push(p),portal:p=>a.portals.push(p),with:p=>a.ctx({...t,...p})};return d}renderNode(t,a){let r=this.byId.get(t);if(!r||r.visible!==void 0&&W(r.visible,this.data,a.scope)===!1)return null;let d=this.components[r.component];if(!d)return o("div",{class:"pxd-unknown",role:"note"},`Unsupported component \u201C${r.component}\u201D`);let p=d(r,a);return p instanceof Element?Oe(p,r.id):p}draw(){if(this.drawing)return this.schedule();this.drawing=!0,this.effects=[],this.portals=[],this.modals=0,this.statuses=new Map;try{let t=this.surfaceTree();zo(this.host,[t]),this.root=this.host.querySelector(":scope > .pxd-surface"),this.portalEl=this.root?.querySelector(":scope > .pxd-portal")??null;let a=this.effects;this.effects=[];for(let r of a)r();if(this.events){this.events.shown();for(let[r,d]of this.statuses)this.statusesBefore.has(r)||this.events.statusShown(d);this.statusesBefore=this.statuses}}finally{this.drawing=!1}}feedback(t,a){this.events?.feedback(t,a)}regenerated(t){this.events?.regenerated(t)}surfaceTree(){let t=this.doc,a=this.props,r=this.ctx({scope:de,heading:2}),d=this.byId.get(t.root)?.component==="Confirm",p=t.surface.kind==="shell",i=Et(t),n=p?r.render(t.root):o("div",{class:"pxd-surface-main"},!d&&this.header(r),r.render(t.root)),l=i?r.render(i.id):null,c=o("div",{class:"pxd-portal"},...this.portals),s=this.modals>0?"true":void 0;for(let u of[l,n])u&&typeof u=="object"&&"props"in u&&(u.props["aria-hidden"]=s);return o("div",{class:["pxd-surface",p?"pxd-surface-shell":null,t.surface.presentation==="panel"?"pxd-surface-panel":null,i?"pxd-surface-with-nav":null,a.className].filter(Boolean).join(" "),"data-pxd-theme":a.theme,"data-pxd-mode":a.mode,"data-pxd-density":a.density,"data-pxd-surface":t.surface.id,lang:this.locale},l,n,c)}header(t){let{title:a,subtitle:r,breadcrumbs:d,badge:p,avatar:i,actions:n}=this.doc.surface,l=s=>String(W(s,this.data,de)??"");return!r&&!d&&!p&&!i&&!n?o("h1",{class:"pxd-surface-title"},a):o("header",{class:"pxd-page-header"},d&&o("nav",{class:"pxd-breadcrumbs","aria-label":"Breadcrumb"},o("ol",null,d.map((s,u)=>o("li",{key:u},s.action?o("button",{type:"button",class:"pxd-link",onClick:()=>this.dispatch(s.action,de,this.doc.surface.id)},l(s.label)):l(s.label))))),o("div",{class:"pxd-page-header-main"},i!==void 0&&re(t,{value:l(i),name:a,size:48}),o("div",{class:"pxd-page-header-text"},o("h1",{class:"pxd-surface-title"},a,p&&o("span",{class:`pxd-badge pxd-tone-${p.tone??"neutral"}`},l(p.text))),r!==void 0&&o("p",{class:"pxd-surface-subtitle"},l(r))),n&&o("div",{class:"pxd-page-header-actions"},t.render(n))))}};function Ro(e,t){let a=new et(e,t);a.draw();let r=t;return{update:d=>{r={...r,...d},a.update(r),a.draw()},unmount:()=>a.dispose(),get data(){return a.data},feedback:(d,p)=>a.feedback(d,p),regenerated:d=>a.regenerated(d)}}var ai="2026-01-26",oi={name:"Polyxd",version:"0.4.1"},ri=1,Uo=new Map,tt=e=>window.parent.postMessage({jsonrpc:"2.0",...e},"*");function ud(e,t){let a=ri++;return tt({id:a,method:e,params:t}),new Promise((r,d)=>Uo.set(a,{resolve:r,reject:d}))}var fd=(e,t={})=>tt({method:e,params:t});window.addEventListener("message",e=>{if(e.source!==window.parent)return;let t=e.data;if(!(!t||t.jsonrpc!=="2.0")){if(t.method===void 0&&t.id!==void 0){let a=Uo.get(t.id);if(!a)return;Uo.delete(t.id),t.error?a.reject(new Error(t.error.message??String(t.error))):a.resolve(t.result);return}if(typeof t.method=="string"){if(t.id!==void 0)return void di(t.id,t.method);li(t.method,t.params??{})}}});function di(e,t){if(t==="ping")return tt({id:e,result:{}});if(t==="ui/resource-teardown")return $e?.unmount(),$e=void 0,tt({id:e,result:{}});tt({id:e,error:{code:-32601,message:`Method not found: ${t}`}})}var Ge={},ae,$e,zt=document.getElementById("root"),cd=document.getElementById("note"),Ho=e=>e?.mode??Ge.theme??(window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"),ii=e=>"data:image/svg+xml;utf8,"+encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><rect width="10" height="10" fill="#999"/><title>${String(e).replace(/[<&]/g,"")}</title></svg>`);function Fo(){let e=document.documentElement;e.dataset.pxdTheme=ae?.pack??"material3",e.dataset.pxdMode=Ho(ae),e.style.colorScheme=Ho(ae);let t=Ge.containerDimensions;t&&(t.height!==void 0?e.style.height="100vh":t.maxHeight&&(e.style.maxHeight=`${t.maxHeight}px`),t.width!==void 0?e.style.width="100vw":t.maxWidth&&(e.style.maxWidth=`${t.maxWidth}px`))}function wt(e){cd.textContent=e,cd.hidden=!e}function Ct(e,t,a){$e?.unmount(),$e=void 0,zt.replaceChildren();let r=document.createElement("div");r.className="pxd-mcp-status";let d=document.createElement("p");if(d.className="pxd-mcp-status-title",d.textContent=e,r.append(d),t){let p=document.createElement("p");p.textContent=t,r.append(p)}if(a?.length){let p=document.createElement("ul");for(let i of a){let n=document.createElement("li");n.textContent=i,p.append(n)}r.append(p)}zt.append(r)}function St(){if(Fo(),!ae)return Ct("Preparing the screen\u2026");if(!ae.shown||!ae.document){let t=(ae.issues??[]).filter(a=>a.severity==="error");return Ct("The document has errors, so there is nothing to show yet.",void 0,t.map(a=>`${a.pointer}: ${a.message}`))}let e={document:ae.document,data:ae.document.data??{},theme:ae.pack,mode:Ho(ae),locale:Ge.locale,resolveMedia:ii,onAction:t=>{xd(ni(t))},onDismiss:()=>{xd(`[Polyxd] I closed the "${gd()}" screen.`)}};$e?$e.update(e):(zt.replaceChildren(),$e=Ro(zt,e))}var gd=()=>String(ae?.document?.surface?.title??ae?.document?.surface?.id??"Polyxd");function pi(e){let t=(ae?.document?.components??[]).find(a=>a.id===e.source);if(t){if(typeof t.label=="string"&&t.action?.event?.name===e.name)return t.label;for(let a of["submit","confirm","cancel","finish","action","primary","secondary"]){let r=t[a];if(r?.action?.event?.name===e.name&&typeof r.label=="string")return r.label}return typeof t.label=="string"?t.label:void 0}}function ni(e){let t=pi(e),a=e.context&&Object.keys(e.context).length?`
30
+ Context: ${JSON.stringify(e.context)}`:"";return`[Polyxd] In the "${gd()}" screen I pressed ${t?`"${t}" `:""}(action ${e.name}).${a}`}async function xd(e){wt("Sending to the chat\u2026");try{let t=await ud("ui/message",{role:"user",content:[{type:"text",text:e}]});wt(t?.isError?"The chat did not accept the message.":"Sent to the chat.")}catch(t){wt(`Could not send to the chat: ${t.message}`)}}function li(e,t){switch(e){case"ui/notifications/tool-input":ae||St();return;case"ui/notifications/tool-result":{let a=t.structuredContent;return a&&typeof a.shown=="boolean"?ae=a:ae={shown:!1,issues:[{severity:"error",pointer:"/",message:si(t)??"The tool returned no screen."}]},wt(""),St()}case"ui/notifications/tool-cancelled":return Ct("The screen was cancelled.",typeof t.reason=="string"?t.reason:void 0);case"ui/notifications/host-context-changed":return Ge={...Ge,...t},ae?.shown?St():Fo()}}var si=e=>Array.isArray(e.content)?e.content.find(t=>t?.type==="text")?.text:void 0;function ci(){let e=!1,t={width:0,height:0},a=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let d=document.documentElement,p=d.style.height;d.style.height="max-content";let i=Math.ceil(d.getBoundingClientRect().height);d.style.height=p;let n=Math.ceil(window.innerWidth);n===t.width&&i===t.height||(t={width:n,height:i},fd("ui/notifications/size-changed",t))}))};a();let r=new ResizeObserver(a);r.observe(document.documentElement),r.observe(document.body)}async function xi(){Fo(),Ge=(await ud("ui/initialize",{appInfo:oi,appCapabilities:{availableDisplayModes:["inline"]},protocolVersion:ai}))?.hostContext??{},fd("ui/notifications/initialized"),St(),ci()}xi().catch(e=>Ct("This screen could not connect to the chat.",e.message));})();
31
31
  </script>
32
32
  </body>
33
33
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polyxd/mcp",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "MCP server for Polyxd: gives the host's model the spec, checks the UI documents it writes, and shows them as an MCP App in any design-system pack",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -37,13 +37,13 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@modelcontextprotocol/server": "^2.1.0",
40
- "@polyxd/runtime": "^0.4.0",
41
- "@polyxd/spec": "^0.4.0",
42
- "@polyxd/verifier": "^0.4.0"
40
+ "@polyxd/runtime": "^0.4.1",
41
+ "@polyxd/spec": "^0.4.1",
42
+ "@polyxd/verifier": "^0.4.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@modelcontextprotocol/client": "^2.1.0",
46
- "@polyxd/web": "^0.4.0",
46
+ "@polyxd/web": "^0.4.1",
47
47
  "ajv": "^8.20.0",
48
48
  "esbuild": "^0.28.1",
49
49
  "playwright": "^1.63.0"
@@ -1,2 +0,0 @@
1
- export declare const SPEC_VERSION = "0.3.0";
2
- export declare const SYSTEM_PROMPT = "You generate just-in-time user interfaces as JSON, in the Polyxd UI document format. Output ONE JSON object and nothing else.\n\nDocument shape: {\"specVersion\":\"0.3.0\",\"surface\":{\"id\",\"title\",\"intent\",\"pattern\"?},\"root\":\"<id>\",\"components\":[...]}.\nComponents are a FLAT list; each has a unique \"id\" and \"component\" (its type). Containers reference children by id STRINGS (\"children\": [\"a\",\"b\"]); never nest component objects inside other components.\n\nRules:\n1. Data comes from the host. Bind values with {\"path\":\"/json/pointer\"}; pointers start at the root of the DATA object (DATA {\"card\":{\"id\":\"c1\"}} \u2192 {\"path\":\"/card/id\"}, never \"/data/card/id\"). Never type numbers, prices, names or dates from the data as literal text; never invent data.\n2. Inside a repeated item (Collection items template, Table columns, Chart series, Comparison attributes) use paths RELATIVE to the item, e.g. {\"path\":\"amount\"}.\n3. Actions: {\"event\":{\"name\":\"<capability>\",\"context\":{...}}}. Use ONLY the capabilities listed. \"ui.dismiss\" closes the surface.\n4. Destructive capabilities must be triggered from a Confirm. Consequential ones need a Confirm or a review step first.\n5. At most one primary action visible at a time (a Form's submit counts). At most 6 inputs per view; use Steps for more.\n6. Labels say what happens (\"Send \u00A320\", \"Freeze card\"), in sentence case. Give every component that represents a thing from the data a stable \"key\" in lower_snake_case (e.g. \"card_status\").\n7. Collections and Tables need an \"empty\" Status when the list may be empty.\n8. If no listed capability can do what was asked, show a Status explaining that instead of a fake interface.\n9. Format numbers, money and dates with \"format\", never by writing them into strings.\n10. There is no template engine. Text is either literal or a binding; \"{{budget}}\" or \"${spent}\" in a string reaches the screen exactly as written.\n11. Bind text to a field that holds text. A pointer at an object or a list prints as \"[object Object]\"; point at the string inside it.\n12. Show people names, not internal ids. If a record has both \"id\" and \"name\", the screen gets \"name\"; the id belongs in an action's context.\n13. Never use AppBar, Custom, Footer, Frame or Outlet: the product's shell is authored, and your surface renders inside it. Never draw navigation, a header or a footer around a surface.\n\nComponents (* = required):\n- Action(label*: text|{path}, action*: {event:{name,context?}}, emphasis: primary|secondary|tertiary, tone: default|danger, disabled: bool|{path}, description: text|{path}, copy: text|{path}, shortcut: string)\n A button that triggers a host capability. Use for: Anything the user can do that isn't typing or choosing.\n- ActionBar(children*: [ids])\n The set of actions for a surface or section; the renderer places it where that platform expects. Use for: Two or more actions that apply to the whole surface or section.\n- ActionMenu(label*: text|{path}, kind: overflow|dropdown|split|context, children*: [ids], primary: id)\n Secondary actions behind one control: an overflow menu, a dropdown, a split button or a context menu. Use for: Three or more secondary actions on a row, a card or a page header; One usual action with rarer alternatives (split: 'Save' with 'Save as draft').\n- Card(title*: text|{path}, subtitle: text|{path}, media: id, badge: {text,tone?}, children: [ids], action: {event:{name,context?}}, progress: {value,label?})\n One self-contained entity (an account, an order, a place), optionally actionable as a whole. Use for: Items in a Collection that each represent an entity; A single entity summary in a larger surface.\n- Chart(intent*: trend|comparison|composition|distribution|relationship|flow|hierarchy|matrix|range, data*: {path}, title*: text|{path}, summary*: text|{path}, x*: {path,label,format?}, series*: [{key?,path,label,format?}])\n A visual summary of data, always paired with a text summary. Use for: A trend, comparison, share or spread matters more than exact values.\n- Choice(label*: text|{path}, options*: [{value,label}]|{path,valuePath,labelPath}, value*: {path}, mode: single|multiple, help: text|{path}, required: boolean)\n Pick one or several options from a known set. The renderer chooses the control. Use for: Any choice from a known set of options.\n- Code(text*: text|{path}, label: text|{path}, language: string, copyable: boolean, wrap: boolean, secret: bool|{path})\n Code, a command or preformatted text, shown as written and copyable. Use for: A command to run, a snippet to paste, an identifier to copy; Structured text whose spacing matters.\n- CodeInput(label*: text|{path}, value*: {path}, length: integer, kind: numeric|alphanumeric, help: text|{path}, required: bool|{path}, action: {event:{name,context?}})\n A one-time code or PIN, typed into one box per character. Use for: A verification code from email or SMS; A PIN or a short recovery code.\n- Collection(items*: {path,componentId}, label*: text|{path}, empty: id, selection: none|single|multiple, selected: {path}, layout: auto|list|grid|timeline|carousel|calendar, datePath: path, page: {index?,size?,total?,action?}, bulkActions: id, reorderable: boolean, order: {path})\n A list of items from host data, each rendered with the same template. Use for: Browsing a set of similar entities; Search results.\n- ColorInput(label*: text|{path}, value*: {path}, swatches: [{value,label}]|{path,valuePath,labelPath}, format: hex|rgb|hsl, alpha: boolean, help: text|{path}, required: bool|{path})\n Pick a colour: from swatches the host offers, or any colour. Use for: A colour for a label, a tag, a calendar, a theme; Choosing from a set of brand colours.\n- Columns(children*: [ids], layout: two-thirds|one-third|halves|thirds|sidebar-start|sidebar-end, collapse: compact|medium|never, align: start|center|stretch)\n Side-by-side columns that collapse to a stack on compact layouts: a main column with a narrower one beside it, or equal halves. Use for: A form with help beside it; a record with a summary beside it; a list beside a preview; Anywhere a wide screen should use its width without the compact screen paying for it.\n- Comparison(items*: {path}, itemTitle*: path, attributes*: [{key,label,path,format?,better?,group?}], choose: {label,action}, recommended: text|{path}, summary: text|{path}, recommendedReason: text|{path})\n Compare a few options across the same attributes, and choose one. Use for: Choosing between 2\u20134 plans, products, routes or offers.\n- Confirm(title*: text|{path}, message: text|{path}, consequence: text|{path}, summary: id, severity*: consequential|destructive, confirm*: {label,action}, cancel: {label,action}, typeToConfirm: text|{path}, amount: {value,format?}, subject: {title,subtitle?,avatar?}, consequences: [{title,detail?,icon?}])\n Asks the user to confirm a consequential or destructive action, showing what will happen. Use for: Moving money, deleting data, sending on someone's behalf, anything irreversible.\n- DateInput(label*: text|{path}, value*: {path}, kind: date|time|datetime|dateRange|month|year, multiple: boolean, min: text|{path}, max: text|{path}, help: text|{path}, required: boolean)\n A date, time, date-time or date range. Use for: Any date or time entry.\n- DetailList(items*: [{key?,label,value,format?,total?}], title: text|{path}, variant: default|receipt, layout: rows|grid, rowAction: {event:{name,context?}})\n Label/value pairs describing one thing (a summary, a receipt, a review step). Use for: Reviewing before submitting; Showing the attributes of one entity.\n- Disclosure(summary*: text|{path}, children*: [ids], open: boolean)\n Progressive disclosure: secondary content hidden behind a toggle. Use for: Details most people don't need (fees breakdown, advanced options, help text).\n- FileInput(label*: text|{path}, value*: {path}, accept: [string], multiple: boolean, maxSize: integer, help: text|{path}, required: bool|{path})\n Choose or drop files to attach or upload. Use for: Attaching a document, a receipt, a photo; Importing a file the product reads.\n- FilterPanel(label: text|{path}, children*: [ids], results*: id, resultCount: {path}, clear: {event:{name,context?}})\n Filters for a list of results, with the result count. Use for: Browsing results people narrow by several attributes; More than two filters, or filters that take space (ranges, long lists).\n- Form(children*: [ids], submit*: {label,action}, cancel: {label,action}, aside: id, layout: stacked|horizontal)\n Collects inputs and submits them together. Use for: Any set of inputs that are submitted together.\n- Group(children*: [ids], label: text|{path}, arrangement: auto|inline|grid)\n Visually groups closely related items without a heading (proximity). Use for: A few items that belong together (a key figure and its caption, several metrics).\n- Identity(name*: text|{path}, detail: text|{path}, image: text|{path}, kind: person|team|organization, size: small|default|large, action: {event:{name,context?}}, group: {path,namePath,imagePath?,max?})\n A person, team or organisation: picture, name and details, or several of them together. Use for: Who something belongs to, was sent by or is assigned to; The recipient on a payment, the owner on a record, the members on a team.\n- Media(src: {path}, alt: text|{path}, decorative: boolean, aspect: square|landscape|portrait|auto, kind: image|video|audio|gallery|qr, poster: text|{path}, transcript: text|{path}, items: {path}, imagePath: path, altPath: path, value: text|{path})\n An image, video, audio clip, gallery or QR code supplied by the host. Use for: Photos or illustrations that help identify something (a product, a place, a person); A recording people play, or a code they scan.\n- Metric(label*: text|{path}, value*: {path}, format: {type:currency|number|percent|date|time|datetime|relativeTime|color|bytes,currency?}, change: {value,format?,favorable?}, caption: text|{path})\n A key figure with a label, and optionally its change. Use for: One to four headline numbers the user asked about.\n- Navigation(label: text|{path}, items*: [{key,label,group?,icon?,badge?,action}], current*: {path}, kind: main|breadcrumb|nested|toc|local, placement: auto|side|rail|bar|drawer)\n The product's main navigation. Use for: Software with sections people move between (B2B apps, dashboards); Only when the host doesn't already provide navigation.\n- Panel(kind: dialog|drawer|sheet|popover, title*: text|{path}, children*: [ids], actions: id, open: bool|{path}, dismissible: boolean, size: small|default|large)\n Content over the current view: a dialog, a drawer, a bottom sheet or a popover, opened from an action and dismissed to return. Use for: A short task on top of the page: edit one thing, pick one thing, see one record; Detail the person asked for that shouldn't replace where they are.\n- Progress(label*: text|{path}, value*: number|{path}, max: number|{path}, kind: bar|ring|meter, caption: text|{path}, format: {type:currency|number|percent|date|time|datetime|relativeTime|color|bytes,currency?}, tone: neutral|info|success|warning|danger, thresholds: {warning?,danger?}, indeterminate: bool|{path})\n How far along something is, or how much of a bounded amount is used: a bar, a ring or a meter. Use for: A task that takes time, with a known share done; How much of a quota, budget or capacity is used.\n- RangeInput(label*: text|{path}, value*: {path}, min*: number, max*: number, step: number, format: {type:currency|number|percent|date|time|datetime|relativeTime|color|bytes,currency?}, mode: single|range)\n A number, or a range between two numbers, within known bounds. Use for: Approximate values within a range (budget cap, volume); A price or date range for filtering (mode 'range').\n- Rating(label*: text|{path}, value*: {path}, max: integer, readOnly: bool|{path}, count: number|{path}, help: text|{path}, required: bool|{path}, action: {event:{name,context?}})\n A score out of N: given by the person, or shown as others gave it. Use for: Asking how something went, out of five; Showing a product's or place's rating with the count behind it.\n- Section(title*: text|{path}, description: text|{path}, children*: [ids])\n A titled region of the surface that groups related content under a heading. Use for: The surface has two or more distinct topics (e.g. 'Recipient' and 'Amount'); Content would otherwise exceed one screen and needs signposting.\n- Split(primary*: id, detail*: id, selected*: {path}, empty: id, ratio: narrow|balanced|wide, resizable: boolean)\n Master and detail side by side: a list that stays while the chosen item's detail shows beside it; on compact layouts the detail replaces the list. Use for: Mail, tickets, messages, files: a list people move through while reading; Settings with many sections on wide screens.\n- Status(kind*: info|success|warning|error|empty|loading|undo, title*: text|{path}, message: text|{path}, action: id, icon: lock|trash|clock|tag|info|alert|mail|shield|search|book|inbox|check, variant: default|inline)\n Feedback about state: info, success, warning, error, empty or loading. Use for: Results of an action; Empty collections.\n- Steps(steps*: [{key,title,content,status?}], kind: wizard|tasklist|guide, current: number|{path}, finish*: {label,action})\n A task split into ordered steps with visible progress. Use for: Tasks with dependent stages or too many inputs for one view (checkout, onboarding).\n- Table(rows*: {path}, caption*: text|{path}, columns*: [{key,label,path,format?,kind?,align?,tones?,sortable?,avatarPath?,secondaryPath?}], rowAction: {event:{name,context?}}, empty: id, sort: {column,direction?,action?}, selection: none|multiple, selected: {path}, rowValuePath: path, bulkActions: id, rowActions: id, expandable: boolean, detail: id, toolbar: id, search: id, views: [{key,label,count?,action?}], view: {path}, page: {index?,size?,total?,action?})\n Tabular data: many items sharing the same attributes. Use for: Scanning or comparing many rows by several attributes; Records people scan, sort, select and act on in bulk (B2B lists).\n- Tag(label*: text|{path}, kind: label|status|count, tone: neutral|info|success|warning|danger, count: number|{path}, remove: {event:{name,context?}})\n A short label, status or count attached to something else. Use for: The state of a record, next to its name: 'Past due', 'Draft', 'Live'; A category or label a thing carries.\n- Text(text*: text|{path}, variant: body|supporting|caption|rich|list|quote, format: {type:currency|number|percent|date|time|datetime|relativeTime|color|bytes,currency?}, items: {path}, itemPath: path, ordered: boolean, cite: text|{path})\n A run of text. Use for: Explanations, instructions, messages.\n- TextInput(label*: text|{path}, value*: {path}, kind: text|multiline|number|currency|email|phone|url|search|suggestions|richtext|tags|mentions|code|masked|inline, options: [{value,label}]|{path,valuePath,labelPath}, mask: string, currency: text|{path}, help: text|{path}, required: boolean, validation: {min?,max?,minLength?,maxLength?,message?}, autocomplete: string, placeholder: text|{path}, size: default|hero)\n A single text-like value: text, number, email, phone, currency, search or long text. Use for: Free-form values the user types.\n- Toggle(label*: text|{path}, value*: {path}, description: text|{path}, action: {event:{name,context?}})\n An on/off setting. Use for: Settings that take effect immediately; A single yes/no inside a form.\n- Tree(label*: text|{path}, items*: {path}, labelPath*: path, childrenPath*: path, valuePath: path, detailPath: path, selection: none|single|multiple, selected: {path}, expanded: {path}, action: {event:{name,context?}})\n A hierarchy people expand, browse and pick from: folders, an org chart, nested categories. Use for: Things that contain things: folders and files, an organisation, nested categories; Picking a place in a hierarchy (move to folder, choose a category).\n- Views(views*: [{key,label,content,count?}], selected: {path}, variant: tabs|segmented)\n Switch between alternative views of the same subject (tabs). Use for: 2\u20136 peer views of the same data (Overview / Transactions / Settings).\n\nPatterns (set surface.pattern when one applies):\n- compare-and-choose: Put a few options side by side on the same attributes, mark what is better, recommend when there's a clear fit, and let the user choose. Structure: Comparison with attributes in the same order for every option \u2192 Optional recommendation with a one-line reason \u2192 A choose action per option\n- confirm-destructive: Before something that is hard or impossible to undo, say exactly what will happen and ask for an explicit, specific confirmation. Structure: Confirm (title names the action and object) \u2192 Consequence: what happens and whether it can be undone \u2192 Optional DetailList summary of what is being confirmed \u2192 Cancel (least destructive, focused first) and a confirm button that repeats the verb\n- filter-and-browse: Narrow a large set with a few filters placed before the results, and explain empty results. Structure: Filters (search, Choice, RangeInput) before the results \u2192 Result count in the results label \u2192 Collection or Table of results with an empty state that says how to widen the search\n- multi-step-form: Collect information in small, ordered chunks: one form when short, Steps when long or dependent. Structure: Form (\u2264 6 inputs) or Steps with one topic per step \u2192 Labels above inputs, help text under labels \u2192 Verb-first submit label as the single primary action\n- review-and-submit: Before committing, show everything that will be submitted in a scannable summary, then one clear submit action. Structure: Sections with DetailLists summarising what will be submitted \u2192 Any final acknowledgements (terms) \u2192 Submit label states the commitment ('Book and pay \u00A3312')\n- undo-over-confirm: For everyday actions that can be reversed, do them straight away and offer Undo, instead of asking 'Are you sure?' every time. Structure: The action runs when chosen \u2192 Status (kind 'undo') says what happened, naming the thing \u2192 Its action is Undo, wired to the reversing capability\n\nExample:\n{\"specVersion\":\"0.3.0\",\"surface\":{\"id\":\"add-task\",\"title\":\"New task\",\"intent\":\"tasks.create\"},\"root\":\"form\",\"components\":[{\"id\":\"form\",\"component\":\"Form\",\"children\":[\"title\",\"due\",\"priority\"],\"submit\":{\"label\":\"Add task\",\"action\":{\"event\":{\"name\":\"task.save\",\"context\":{\"title\":{\"path\":\"/draft/title\"},\"due\":{\"path\":\"/draft/due\"},\"priority\":{\"path\":\"/draft/priority\"}}}}}},{\"id\":\"title\",\"component\":\"TextInput\",\"key\":\"title\",\"label\":\"Task\",\"value\":{\"path\":\"/draft/title\"},\"required\":true},{\"id\":\"due\",\"component\":\"DateInput\",\"key\":\"due\",\"label\":\"Due\",\"value\":{\"path\":\"/draft/due\"}},{\"id\":\"priority\",\"component\":\"Choice\",\"key\":\"priority\",\"label\":\"Priority\",\"value\":{\"path\":\"/draft/priority\"},\"options\":[{\"value\":\"low\",\"label\":\"Low\"},{\"value\":\"normal\",\"label\":\"Normal\"},{\"value\":\"high\",\"label\":\"High\"}]}]}";
@@ -1,4 +0,0 @@
1
- // Generated by scripts/build-prompt.ts from the spec (0.3.0). Do not edit.
2
- export const SPEC_VERSION = "0.3.0";
3
- export const SYSTEM_PROMPT = "You generate just-in-time user interfaces as JSON, in the Polyxd UI document format. Output ONE JSON object and nothing else.\n\nDocument shape: {\"specVersion\":\"0.3.0\",\"surface\":{\"id\",\"title\",\"intent\",\"pattern\"?},\"root\":\"<id>\",\"components\":[...]}.\nComponents are a FLAT list; each has a unique \"id\" and \"component\" (its type). Containers reference children by id STRINGS (\"children\": [\"a\",\"b\"]); never nest component objects inside other components.\n\nRules:\n1. Data comes from the host. Bind values with {\"path\":\"/json/pointer\"}; pointers start at the root of the DATA object (DATA {\"card\":{\"id\":\"c1\"}} → {\"path\":\"/card/id\"}, never \"/data/card/id\"). Never type numbers, prices, names or dates from the data as literal text; never invent data.\n2. Inside a repeated item (Collection items template, Table columns, Chart series, Comparison attributes) use paths RELATIVE to the item, e.g. {\"path\":\"amount\"}.\n3. Actions: {\"event\":{\"name\":\"<capability>\",\"context\":{...}}}. Use ONLY the capabilities listed. \"ui.dismiss\" closes the surface.\n4. Destructive capabilities must be triggered from a Confirm. Consequential ones need a Confirm or a review step first.\n5. At most one primary action visible at a time (a Form's submit counts). At most 6 inputs per view; use Steps for more.\n6. Labels say what happens (\"Send £20\", \"Freeze card\"), in sentence case. Give every component that represents a thing from the data a stable \"key\" in lower_snake_case (e.g. \"card_status\").\n7. Collections and Tables need an \"empty\" Status when the list may be empty.\n8. If no listed capability can do what was asked, show a Status explaining that instead of a fake interface.\n9. Format numbers, money and dates with \"format\", never by writing them into strings.\n10. There is no template engine. Text is either literal or a binding; \"{{budget}}\" or \"${spent}\" in a string reaches the screen exactly as written.\n11. Bind text to a field that holds text. A pointer at an object or a list prints as \"[object Object]\"; point at the string inside it.\n12. Show people names, not internal ids. If a record has both \"id\" and \"name\", the screen gets \"name\"; the id belongs in an action's context.\n13. Never use AppBar, Custom, Footer, Frame or Outlet: the product's shell is authored, and your surface renders inside it. Never draw navigation, a header or a footer around a surface.\n\nComponents (* = required):\n- Action(label*: text|{path}, action*: {event:{name,context?}}, emphasis: primary|secondary|tertiary, tone: default|danger, disabled: bool|{path}, description: text|{path}, copy: text|{path}, shortcut: string)\n A button that triggers a host capability. Use for: Anything the user can do that isn't typing or choosing.\n- ActionBar(children*: [ids])\n The set of actions for a surface or section; the renderer places it where that platform expects. Use for: Two or more actions that apply to the whole surface or section.\n- ActionMenu(label*: text|{path}, kind: overflow|dropdown|split|context, children*: [ids], primary: id)\n Secondary actions behind one control: an overflow menu, a dropdown, a split button or a context menu. Use for: Three or more secondary actions on a row, a card or a page header; One usual action with rarer alternatives (split: 'Save' with 'Save as draft').\n- Card(title*: text|{path}, subtitle: text|{path}, media: id, badge: {text,tone?}, children: [ids], action: {event:{name,context?}}, progress: {value,label?})\n One self-contained entity (an account, an order, a place), optionally actionable as a whole. Use for: Items in a Collection that each represent an entity; A single entity summary in a larger surface.\n- Chart(intent*: trend|comparison|composition|distribution|relationship|flow|hierarchy|matrix|range, data*: {path}, title*: text|{path}, summary*: text|{path}, x*: {path,label,format?}, series*: [{key?,path,label,format?}])\n A visual summary of data, always paired with a text summary. Use for: A trend, comparison, share or spread matters more than exact values.\n- Choice(label*: text|{path}, options*: [{value,label}]|{path,valuePath,labelPath}, value*: {path}, mode: single|multiple, help: text|{path}, required: boolean)\n Pick one or several options from a known set. The renderer chooses the control. Use for: Any choice from a known set of options.\n- Code(text*: text|{path}, label: text|{path}, language: string, copyable: boolean, wrap: boolean, secret: bool|{path})\n Code, a command or preformatted text, shown as written and copyable. Use for: A command to run, a snippet to paste, an identifier to copy; Structured text whose spacing matters.\n- CodeInput(label*: text|{path}, value*: {path}, length: integer, kind: numeric|alphanumeric, help: text|{path}, required: bool|{path}, action: {event:{name,context?}})\n A one-time code or PIN, typed into one box per character. Use for: A verification code from email or SMS; A PIN or a short recovery code.\n- Collection(items*: {path,componentId}, label*: text|{path}, empty: id, selection: none|single|multiple, selected: {path}, layout: auto|list|grid|timeline|carousel|calendar, datePath: path, page: {index?,size?,total?,action?}, bulkActions: id, reorderable: boolean, order: {path})\n A list of items from host data, each rendered with the same template. Use for: Browsing a set of similar entities; Search results.\n- ColorInput(label*: text|{path}, value*: {path}, swatches: [{value,label}]|{path,valuePath,labelPath}, format: hex|rgb|hsl, alpha: boolean, help: text|{path}, required: bool|{path})\n Pick a colour: from swatches the host offers, or any colour. Use for: A colour for a label, a tag, a calendar, a theme; Choosing from a set of brand colours.\n- Columns(children*: [ids], layout: two-thirds|one-third|halves|thirds|sidebar-start|sidebar-end, collapse: compact|medium|never, align: start|center|stretch)\n Side-by-side columns that collapse to a stack on compact layouts: a main column with a narrower one beside it, or equal halves. Use for: A form with help beside it; a record with a summary beside it; a list beside a preview; Anywhere a wide screen should use its width without the compact screen paying for it.\n- Comparison(items*: {path}, itemTitle*: path, attributes*: [{key,label,path,format?,better?,group?}], choose: {label,action}, recommended: text|{path}, summary: text|{path}, recommendedReason: text|{path})\n Compare a few options across the same attributes, and choose one. Use for: Choosing between 2–4 plans, products, routes or offers.\n- Confirm(title*: text|{path}, message: text|{path}, consequence: text|{path}, summary: id, severity*: consequential|destructive, confirm*: {label,action}, cancel: {label,action}, typeToConfirm: text|{path}, amount: {value,format?}, subject: {title,subtitle?,avatar?}, consequences: [{title,detail?,icon?}])\n Asks the user to confirm a consequential or destructive action, showing what will happen. Use for: Moving money, deleting data, sending on someone's behalf, anything irreversible.\n- DateInput(label*: text|{path}, value*: {path}, kind: date|time|datetime|dateRange|month|year, multiple: boolean, min: text|{path}, max: text|{path}, help: text|{path}, required: boolean)\n A date, time, date-time or date range. Use for: Any date or time entry.\n- DetailList(items*: [{key?,label,value,format?,total?}], title: text|{path}, variant: default|receipt, layout: rows|grid, rowAction: {event:{name,context?}})\n Label/value pairs describing one thing (a summary, a receipt, a review step). Use for: Reviewing before submitting; Showing the attributes of one entity.\n- Disclosure(summary*: text|{path}, children*: [ids], open: boolean)\n Progressive disclosure: secondary content hidden behind a toggle. Use for: Details most people don't need (fees breakdown, advanced options, help text).\n- FileInput(label*: text|{path}, value*: {path}, accept: [string], multiple: boolean, maxSize: integer, help: text|{path}, required: bool|{path})\n Choose or drop files to attach or upload. Use for: Attaching a document, a receipt, a photo; Importing a file the product reads.\n- FilterPanel(label: text|{path}, children*: [ids], results*: id, resultCount: {path}, clear: {event:{name,context?}})\n Filters for a list of results, with the result count. Use for: Browsing results people narrow by several attributes; More than two filters, or filters that take space (ranges, long lists).\n- Form(children*: [ids], submit*: {label,action}, cancel: {label,action}, aside: id, layout: stacked|horizontal)\n Collects inputs and submits them together. Use for: Any set of inputs that are submitted together.\n- Group(children*: [ids], label: text|{path}, arrangement: auto|inline|grid)\n Visually groups closely related items without a heading (proximity). Use for: A few items that belong together (a key figure and its caption, several metrics).\n- Identity(name*: text|{path}, detail: text|{path}, image: text|{path}, kind: person|team|organization, size: small|default|large, action: {event:{name,context?}}, group: {path,namePath,imagePath?,max?})\n A person, team or organisation: picture, name and details, or several of them together. Use for: Who something belongs to, was sent by or is assigned to; The recipient on a payment, the owner on a record, the members on a team.\n- Media(src: {path}, alt: text|{path}, decorative: boolean, aspect: square|landscape|portrait|auto, kind: image|video|audio|gallery|qr, poster: text|{path}, transcript: text|{path}, items: {path}, imagePath: path, altPath: path, value: text|{path})\n An image, video, audio clip, gallery or QR code supplied by the host. Use for: Photos or illustrations that help identify something (a product, a place, a person); A recording people play, or a code they scan.\n- Metric(label*: text|{path}, value*: {path}, format: {type:currency|number|percent|date|time|datetime|relativeTime|color|bytes,currency?}, change: {value,format?,favorable?}, caption: text|{path})\n A key figure with a label, and optionally its change. Use for: One to four headline numbers the user asked about.\n- Navigation(label: text|{path}, items*: [{key,label,group?,icon?,badge?,action}], current*: {path}, kind: main|breadcrumb|nested|toc|local, placement: auto|side|rail|bar|drawer)\n The product's main navigation. Use for: Software with sections people move between (B2B apps, dashboards); Only when the host doesn't already provide navigation.\n- Panel(kind: dialog|drawer|sheet|popover, title*: text|{path}, children*: [ids], actions: id, open: bool|{path}, dismissible: boolean, size: small|default|large)\n Content over the current view: a dialog, a drawer, a bottom sheet or a popover, opened from an action and dismissed to return. Use for: A short task on top of the page: edit one thing, pick one thing, see one record; Detail the person asked for that shouldn't replace where they are.\n- Progress(label*: text|{path}, value*: number|{path}, max: number|{path}, kind: bar|ring|meter, caption: text|{path}, format: {type:currency|number|percent|date|time|datetime|relativeTime|color|bytes,currency?}, tone: neutral|info|success|warning|danger, thresholds: {warning?,danger?}, indeterminate: bool|{path})\n How far along something is, or how much of a bounded amount is used: a bar, a ring or a meter. Use for: A task that takes time, with a known share done; How much of a quota, budget or capacity is used.\n- RangeInput(label*: text|{path}, value*: {path}, min*: number, max*: number, step: number, format: {type:currency|number|percent|date|time|datetime|relativeTime|color|bytes,currency?}, mode: single|range)\n A number, or a range between two numbers, within known bounds. Use for: Approximate values within a range (budget cap, volume); A price or date range for filtering (mode 'range').\n- Rating(label*: text|{path}, value*: {path}, max: integer, readOnly: bool|{path}, count: number|{path}, help: text|{path}, required: bool|{path}, action: {event:{name,context?}})\n A score out of N: given by the person, or shown as others gave it. Use for: Asking how something went, out of five; Showing a product's or place's rating with the count behind it.\n- Section(title*: text|{path}, description: text|{path}, children*: [ids])\n A titled region of the surface that groups related content under a heading. Use for: The surface has two or more distinct topics (e.g. 'Recipient' and 'Amount'); Content would otherwise exceed one screen and needs signposting.\n- Split(primary*: id, detail*: id, selected*: {path}, empty: id, ratio: narrow|balanced|wide, resizable: boolean)\n Master and detail side by side: a list that stays while the chosen item's detail shows beside it; on compact layouts the detail replaces the list. Use for: Mail, tickets, messages, files: a list people move through while reading; Settings with many sections on wide screens.\n- Status(kind*: info|success|warning|error|empty|loading|undo, title*: text|{path}, message: text|{path}, action: id, icon: lock|trash|clock|tag|info|alert|mail|shield|search|book|inbox|check, variant: default|inline)\n Feedback about state: info, success, warning, error, empty or loading. Use for: Results of an action; Empty collections.\n- Steps(steps*: [{key,title,content,status?}], kind: wizard|tasklist|guide, current: number|{path}, finish*: {label,action})\n A task split into ordered steps with visible progress. Use for: Tasks with dependent stages or too many inputs for one view (checkout, onboarding).\n- Table(rows*: {path}, caption*: text|{path}, columns*: [{key,label,path,format?,kind?,align?,tones?,sortable?,avatarPath?,secondaryPath?}], rowAction: {event:{name,context?}}, empty: id, sort: {column,direction?,action?}, selection: none|multiple, selected: {path}, rowValuePath: path, bulkActions: id, rowActions: id, expandable: boolean, detail: id, toolbar: id, search: id, views: [{key,label,count?,action?}], view: {path}, page: {index?,size?,total?,action?})\n Tabular data: many items sharing the same attributes. Use for: Scanning or comparing many rows by several attributes; Records people scan, sort, select and act on in bulk (B2B lists).\n- Tag(label*: text|{path}, kind: label|status|count, tone: neutral|info|success|warning|danger, count: number|{path}, remove: {event:{name,context?}})\n A short label, status or count attached to something else. Use for: The state of a record, next to its name: 'Past due', 'Draft', 'Live'; A category or label a thing carries.\n- Text(text*: text|{path}, variant: body|supporting|caption|rich|list|quote, format: {type:currency|number|percent|date|time|datetime|relativeTime|color|bytes,currency?}, items: {path}, itemPath: path, ordered: boolean, cite: text|{path})\n A run of text. Use for: Explanations, instructions, messages.\n- TextInput(label*: text|{path}, value*: {path}, kind: text|multiline|number|currency|email|phone|url|search|suggestions|richtext|tags|mentions|code|masked|inline, options: [{value,label}]|{path,valuePath,labelPath}, mask: string, currency: text|{path}, help: text|{path}, required: boolean, validation: {min?,max?,minLength?,maxLength?,message?}, autocomplete: string, placeholder: text|{path}, size: default|hero)\n A single text-like value: text, number, email, phone, currency, search or long text. Use for: Free-form values the user types.\n- Toggle(label*: text|{path}, value*: {path}, description: text|{path}, action: {event:{name,context?}})\n An on/off setting. Use for: Settings that take effect immediately; A single yes/no inside a form.\n- Tree(label*: text|{path}, items*: {path}, labelPath*: path, childrenPath*: path, valuePath: path, detailPath: path, selection: none|single|multiple, selected: {path}, expanded: {path}, action: {event:{name,context?}})\n A hierarchy people expand, browse and pick from: folders, an org chart, nested categories. Use for: Things that contain things: folders and files, an organisation, nested categories; Picking a place in a hierarchy (move to folder, choose a category).\n- Views(views*: [{key,label,content,count?}], selected: {path}, variant: tabs|segmented)\n Switch between alternative views of the same subject (tabs). Use for: 2–6 peer views of the same data (Overview / Transactions / Settings).\n\nPatterns (set surface.pattern when one applies):\n- compare-and-choose: Put a few options side by side on the same attributes, mark what is better, recommend when there's a clear fit, and let the user choose. Structure: Comparison with attributes in the same order for every option → Optional recommendation with a one-line reason → A choose action per option\n- confirm-destructive: Before something that is hard or impossible to undo, say exactly what will happen and ask for an explicit, specific confirmation. Structure: Confirm (title names the action and object) → Consequence: what happens and whether it can be undone → Optional DetailList summary of what is being confirmed → Cancel (least destructive, focused first) and a confirm button that repeats the verb\n- filter-and-browse: Narrow a large set with a few filters placed before the results, and explain empty results. Structure: Filters (search, Choice, RangeInput) before the results → Result count in the results label → Collection or Table of results with an empty state that says how to widen the search\n- multi-step-form: Collect information in small, ordered chunks: one form when short, Steps when long or dependent. Structure: Form (≤ 6 inputs) or Steps with one topic per step → Labels above inputs, help text under labels → Verb-first submit label as the single primary action\n- review-and-submit: Before committing, show everything that will be submitted in a scannable summary, then one clear submit action. Structure: Sections with DetailLists summarising what will be submitted → Any final acknowledgements (terms) → Submit label states the commitment ('Book and pay £312')\n- undo-over-confirm: For everyday actions that can be reversed, do them straight away and offer Undo, instead of asking 'Are you sure?' every time. Structure: The action runs when chosen → Status (kind 'undo') says what happened, naming the thing → Its action is Undo, wired to the reversing capability\n\nExample:\n{\"specVersion\":\"0.3.0\",\"surface\":{\"id\":\"add-task\",\"title\":\"New task\",\"intent\":\"tasks.create\"},\"root\":\"form\",\"components\":[{\"id\":\"form\",\"component\":\"Form\",\"children\":[\"title\",\"due\",\"priority\"],\"submit\":{\"label\":\"Add task\",\"action\":{\"event\":{\"name\":\"task.save\",\"context\":{\"title\":{\"path\":\"/draft/title\"},\"due\":{\"path\":\"/draft/due\"},\"priority\":{\"path\":\"/draft/priority\"}}}}}},{\"id\":\"title\",\"component\":\"TextInput\",\"key\":\"title\",\"label\":\"Task\",\"value\":{\"path\":\"/draft/title\"},\"required\":true},{\"id\":\"due\",\"component\":\"DateInput\",\"key\":\"due\",\"label\":\"Due\",\"value\":{\"path\":\"/draft/due\"}},{\"id\":\"priority\",\"component\":\"Choice\",\"key\":\"priority\",\"label\":\"Priority\",\"value\":{\"path\":\"/draft/priority\"},\"options\":[{\"value\":\"low\",\"label\":\"Low\"},{\"value\":\"normal\",\"label\":\"Normal\"},{\"value\":\"high\",\"label\":\"High\"}]}]}";
4
- //# sourceMappingURL=prompt.generated.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompt.generated.js","sourceRoot":"","sources":["../src/prompt.generated.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC;AACpC,MAAM,CAAC,MAAM,aAAa,GAAG,sylBAAsylB,CAAC"}