@polyxd/verifier 0.2.1 → 0.2.2

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.
@@ -53,4 +53,4 @@ Error generating stack: `+e.message+`
53
53
  `)+`
54
54
  `;case`div`:case`p`:case`li`:return n()+`
55
55
  `;default:return n()}}function jh(e){let t=[],n=/\*\*([^*]+)\*\*|\*([^*]+)\*/g,r=0;for(let i=n.exec(e);i;i=n.exec(e)){i.index>r&&t.push(document.createTextNode(e.slice(r,i.index)));let n=document.createElement(i[1]?`strong`:`em`);n.textContent=i[1]??i[2],t.push(n),r=i.index+i[0].length}return r<e.length&&t.push(document.createTextNode(e.slice(r))),t}function Mh(e){let t=[],n=null;for(let r of e.split(`
56
- `)){let e=/^(-|\d+\.)\s+(.*)$/.exec(r);if(e){let r=e[1]===`-`?`ul`:`ol`;(!n||n.tagName.toLowerCase()!==r)&&(n=document.createElement(r),t.push(n));let i=document.createElement(`li`);i.append(...jh(e[2])),n.append(i);continue}n=null;let i=document.createElement(`div`);r?i.append(...jh(r)):i.append(document.createElement(`br`)),t.push(i)}return t}function Nh({node:e,field:t,common:n}){let r=P(),i=(0,v.useRef)(null),a=String(r.value(e.value)??``);(0,v.useEffect)(()=>{let e=i.current;e&&!e.dataset.ready&&(e.dataset.ready=`1`,e.replaceChildren(...Mh(a)))},[a]);let o=()=>i.current&&r.write(e.value,Ah(i.current).replace(/\n+$/,``)),s=e=>t=>{t.preventDefault(),i.current?.focus(),document.execCommand(e),o()},{id:c,className:l,required:u,autoComplete:d,...f}=n;return(0,R.jsx)(Ch,{...t,children:(0,R.jsxs)(`div`,{className:`pxd-richtext`,children:[(0,R.jsxs)(`div`,{className:`pxd-richtext-toolbar`,role:`toolbar`,"aria-label":`Formatting`,children:[(0,R.jsx)(`button`,{type:`button`,className:`pxd-richtext-control`,"aria-label":`Bold`,onMouseDown:s(`bold`),children:(0,R.jsx)(`strong`,{children:`B`})}),(0,R.jsx)(`button`,{type:`button`,className:`pxd-richtext-control`,"aria-label":`Italic`,onMouseDown:s(`italic`),children:(0,R.jsx)(`em`,{children:`I`})}),(0,R.jsx)(`button`,{type:`button`,className:`pxd-richtext-control`,"aria-label":`Bulleted list`,onMouseDown:s(`insertUnorderedList`),children:(0,R.jsx)(Q,{name:`menu`,size:16})})]}),(0,R.jsx)(`div`,{...f,id:c,ref:i,className:`pxd-input pxd-richtext-area`,contentEditable:!0,role:`textbox`,"aria-multiline":`true`,"aria-label":t.label,onInput:o,onBlur:o})]})})}function Ph({node:e,field:t,common:n}){let r=P(),i=String(r.value(e.value)??``),[a,o]=(0,v.useState)(null),s=()=>{a!==null&&r.write(e.value,a),o(null)};return a===null?(0,R.jsxs)(`div`,{className:`pxd-inline-edit`,children:[(0,R.jsx)(`span`,{className:`pxd-field-label`,children:t.label}),(0,R.jsxs)(`button`,{type:`button`,className:`pxd-inline-value`,"aria-label":`Edit ${t.label}`,onClick:()=>o(i),children:[(0,R.jsx)(`span`,{className:i?void 0:`pxd-inline-empty`,children:i||`Not set`}),(0,R.jsx)(`span`,{className:`pxd-inline-hint`,"aria-hidden":`true`,children:`Edit`})]})]}):(0,R.jsx)(Ch,{...t,children:(0,R.jsx)(`input`,{...n,type:`text`,autoFocus:!0,value:a,onChange:e=>o(e.target.value),onBlur:s,onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),s()):e.key===`Escape`&&o(null)}})})}function Fh(e,t,n,r){let i=e.options;if(Array.isArray(i))return i.map(e=>({value:e.value,label:r(e.label),description:e.description===void 0?void 0:r(e.description)}));let a=w(i.path,n);return O(E(t,a)).map((e,n)=>{let r={pointer:T(a,n)},o=e=>e?E(t,w(e,r)):void 0;return{value:o(i.valuePath),label:String(o(i.labelPath)??``),description:i.descriptionPath&&String(o(i.descriptionPath)??``)||void 0,avatar:i.avatarPath||i.imagePath?o(i.avatarPath??i.imagePath)??``:void 0,recent:i.recentPath?!!o(i.recentPath):!1}})}function Ih(e){let t=P();return Fh(e,N().data,t.scope,t.text)}function Lh({id:e,label:t,description:n}){return(0,R.jsxs)(`div`,{className:`pxd-option-text`,children:[(0,R.jsx)(`label`,{htmlFor:e,children:t}),n&&(0,R.jsx)(`span`,{className:`pxd-option-description`,id:`${e}-desc`,children:n})]})}function Rh({node:e}){let t=P(),n=(0,v.useId)(),r=(0,v.useId)(),i=Ih(e),[a,o]=(0,v.useState)(``),s=e.mode===`multiple`,c=t.value(e.value),l=e=>JSON.stringify(e),u=e=>`${n}-${encodeURIComponent(l(e)).replace(/%/g,`_`)}`,d=e.help===void 0?void 0:t.text(e.help),f=i.some(e=>e.avatar!==void 0),p=i.length>10||f&&i.length>6,m=e=>!a||`${e.label} ${e.description??``}`.toLowerCase().includes(a.toLowerCase()),h=!f&&i.length<=6&&i.every(e=>e.label.length<=24&&!e.description),g=$(e),_=t.text(e.label),y=(0,R.jsxs)(`div`,{className:`pxd-field-label`,id:n,children:[_,e.required&&(0,R.jsx)(Sh,{})]}),b=p&&(0,R.jsxs)(`div`,{className:`pxd-search pxd-search-compact`,children:[(0,R.jsx)(Q,{name:`search`}),(0,R.jsx)(`input`,{type:`search`,className:`pxd-search-input`,placeholder:f?`Search by name`:`Filter options`,"aria-label":`Search ${_}`,value:a,onChange:e=>o(e.target.value)})]});if(s){let o=Array.isArray(c)?c:[],s=e=>o.some(t=>l(t)===l(e)),v=n=>t.write(e.value,s(n)?o.filter(e=>l(e)!==l(n)):[...o,n]);if(h)return(0,R.jsxs)(`div`,{className:`pxd-field pxd-choice`,role:`group`,"aria-labelledby":n,"aria-describedby":d?r:void 0,...g,children:[y,d&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:r,children:d}),(0,R.jsx)(`div`,{className:`pxd-chips`,children:i.map(e=>(0,R.jsxs)(pa,{className:`pxd-chip`,checked:s(e.value),onCheckedChange:()=>v(e.value),children:[(0,R.jsx)(ha,{className:`pxd-chip-check`,children:(0,R.jsx)(Q,{name:`check`,size:18})}),e.label]},l(e.value)))})]});if(f){let e=a?[]:i.filter(e=>e.recent),t=i.filter(e=>a?m(e):!e.recent);return(0,R.jsxs)(`fieldset`,{className:`pxd-field pxd-choice pxd-people`,"aria-describedby":d?r:void 0,...g,children:[(0,R.jsx)(`legend`,{className:`pxd-field-label`,id:n,children:_}),d&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:r,children:d}),b,(0,R.jsxs)(`div`,{className:`pxd-people-group`,children:[e.length>0&&(0,R.jsx)(`div`,{className:`pxd-people-recent`,children:e.map(e=>(0,R.jsxs)(pa,{className:`pxd-person-tile`,checked:s(e.value),onCheckedChange:()=>v(e.value),"aria-label":e.label,children:[(0,R.jsxs)(`span`,{className:`pxd-person-face`,children:[(0,R.jsx)(Im,{value:e.avatar,name:e.label,size:56}),(0,R.jsx)(ha,{className:`pxd-person-tick`,children:(0,R.jsx)(Q,{name:`check`,size:14})})]}),(0,R.jsx)(`span`,{className:`pxd-person-name`,"aria-hidden":`true`,children:e.label.split(` `)[0]})]},l(e.value)))}),(0,R.jsx)(`div`,{className:`pxd-people-list`,children:t.map(e=>{let t=u(e.value);return(0,R.jsxs)(pa,{id:t,className:`pxd-person-row`,checked:s(e.value),onCheckedChange:()=>v(e.value),"aria-labelledby":`${t}-name`,"aria-describedby":e.description?`${t}-desc`:void 0,children:[(0,R.jsx)(Im,{value:e.avatar,name:e.label}),(0,R.jsxs)(`span`,{className:`pxd-person-text`,children:[(0,R.jsx)(`span`,{id:`${t}-name`,children:e.label}),e.description&&(0,R.jsx)(`span`,{className:`pxd-option-description`,id:`${t}-desc`,children:e.description})]}),(0,R.jsx)(ha,{className:`pxd-person-check`,children:(0,R.jsx)(Q,{name:`check`})})]},l(e.value))})})]})]})}return(0,R.jsxs)(`fieldset`,{className:`pxd-field pxd-choice`,"aria-describedby":d?r:void 0,...g,children:[(0,R.jsx)(`legend`,{className:`pxd-field-label`,id:n,children:_}),d&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:r,children:d}),b,(0,R.jsx)(`div`,{className:`pxd-choice-list${p?` pxd-choice-scroll`:``}`,children:i.filter(m).map(e=>{let t=u(e.value);return(0,R.jsxs)(`div`,{className:`pxd-choice-option`,children:[e.avatar!==void 0&&(0,R.jsx)(Im,{value:e.avatar,name:e.label,size:32}),(0,R.jsx)(pa,{id:t,className:`pxd-checkbox`,checked:s(e.value),onCheckedChange:()=>v(e.value),"aria-describedby":e.description?`${t}-desc`:void 0,children:(0,R.jsx)(ha,{className:`pxd-checkbox-indicator`,children:`✓`})}),(0,R.jsx)(Lh,{id:t,label:e.label,description:e.description})]},l(e.value))})})]})}let x=c==null?``:l(c),S=n=>t.write(e.value,i.find(e=>l(e.value)===n)?.value);if(h)return(0,R.jsxs)(`div`,{className:`pxd-field pxd-choice`,...g,children:[y,d&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:r,children:d}),(0,R.jsx)(qf,{className:`pxd-chips`,"aria-labelledby":n,"aria-describedby":d?r:void 0,"aria-required":e.required||void 0,value:x,onValueChange:S,orientation:`horizontal`,children:i.map(e=>(0,R.jsxs)(Qf,{value:l(e.value),className:`pxd-chip`,children:[(0,R.jsx)(ep,{className:`pxd-chip-check`,children:(0,R.jsx)(Q,{name:`check`,size:18})}),e.label]},l(e.value)))})]});if(f){let t=a?[]:i.filter(e=>e.recent),o=i.filter(e=>a?m(e):!e.recent);return(0,R.jsxs)(`div`,{className:`pxd-field pxd-choice pxd-people`,...g,children:[y,d&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:r,children:d}),b,(0,R.jsxs)(qf,{"aria-labelledby":n,"aria-describedby":d?r:void 0,"aria-required":e.required||void 0,value:x,onValueChange:S,className:`pxd-people-group`,children:[t.length>0&&(0,R.jsx)(`div`,{className:`pxd-people-recent`,role:`presentation`,children:t.map(e=>(0,R.jsxs)(Qf,{value:l(e.value),className:`pxd-person-tile`,"aria-label":e.label,children:[(0,R.jsx)(Im,{value:e.avatar,name:e.label,size:56}),(0,R.jsx)(`span`,{className:`pxd-person-name`,"aria-hidden":`true`,children:e.label.split(` `)[0]})]},l(e.value)))}),(0,R.jsx)(`div`,{className:`pxd-people-list`,role:`presentation`,children:o.map(e=>{let t=u(e.value);return(0,R.jsxs)(Qf,{id:t,value:l(e.value),className:`pxd-person-row`,"aria-labelledby":`${t}-name`,"aria-describedby":e.description?`${t}-desc`:void 0,children:[(0,R.jsx)(Im,{value:e.avatar,name:e.label}),(0,R.jsxs)(`span`,{className:`pxd-person-text`,children:[(0,R.jsx)(`span`,{id:`${t}-name`,children:e.label}),e.description&&(0,R.jsx)(`span`,{className:`pxd-option-description`,id:`${t}-desc`,children:e.description})]}),(0,R.jsx)(ep,{className:`pxd-person-check`,children:(0,R.jsx)(Q,{name:`check`})})]},l(e.value))})})]})]})}return(0,R.jsxs)(`div`,{className:`pxd-field pxd-choice`,...g,children:[y,d&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:r,children:d}),b,(0,R.jsx)(qf,{className:`pxd-choice-list${p?` pxd-choice-scroll`:``}`,"aria-labelledby":n,"aria-describedby":d?r:void 0,"aria-required":e.required||void 0,value:x,onValueChange:S,orientation:`vertical`,children:i.filter(m).map(e=>{let t=u(e.value);return(0,R.jsxs)(`div`,{className:`pxd-choice-option`,children:[(0,R.jsx)(Qf,{id:t,value:l(e.value),className:`pxd-radio`,"aria-describedby":e.description?`${t}-desc`:void 0,children:(0,R.jsx)(ep,{className:`pxd-radio-indicator`})}),(0,R.jsx)(Lh,{id:t,label:e.label,description:e.description})]},l(e.value))})})]})}function zh({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=(0,v.useId)(),a=!!t.value(e.value),o=e.description===void 0?void 0:t.text(e.description),s=r=>{if(t.write(e.value,r),e.action){let i=t.pointer(e.value),a=Object.fromEntries(Object.entries(e.action.event.context??{}).map(([e,n])=>[e,n&&typeof n==`object`&&`path`in n&&w(n.path,t.scope)===i?r:t.value(n)]));n.dispatch({event:{name:e.action.event.name,context:a}},{pointer:``},e.id)}},c=$(e);return(0,R.jsxs)(`div`,{className:`pxd-toggle`,children:[e.action?(0,R.jsx)(em,{id:r,className:`pxd-switch`,checked:a,onCheckedChange:s,"aria-describedby":o?i:void 0,...c,children:(0,R.jsx)(nm,{className:`pxd-switch-thumb`})}):(0,R.jsx)(pa,{id:r,className:`pxd-checkbox`,checked:a,onCheckedChange:e=>s(e===!0),"aria-describedby":o?i:void 0,...c,children:(0,R.jsx)(ha,{className:`pxd-checkbox-indicator`,children:`✓`})}),(0,R.jsxs)(`div`,{className:`pxd-toggle-text`,children:[(0,R.jsx)(`label`,{htmlFor:r,className:`pxd-toggle-label`,children:t.text(e.label)}),o&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:i,children:o})]})]})}var Bh={date:`date`,time:`time`,datetime:`datetime-local`,month:`month`};function Vh({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=(0,v.useId)(),a=e.kind??`date`,o=e.help===void 0?void 0:t.text(e.help),s=t.value(e.value),c=e.min===void 0?void 0:t.text(e.min),l=e.max===void 0?void 0:t.text(e.max),u=$(e);if(e.multiple&&a!==`dateRange`){let d=Array.isArray(s)?s.map(String):[],f=e=>j(e,{type:a===`month`?`date`:a===`time`?`time`:a===`datetime`?`datetime`:`date`},n.locale),p=n=>n&&!d.includes(n)&&t.write(e.value,[...d,n].sort());return(0,R.jsxs)(`fieldset`,{className:`pxd-field pxd-date-multiple`,...u,children:[(0,R.jsxs)(`legend`,{className:`pxd-field-label`,children:[t.text(e.label),e.required&&(0,R.jsx)(Sh,{})]}),o&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:i,children:o}),d.length>0&&(0,R.jsx)(`ul`,{className:`pxd-tags-list`,"aria-label":`Chosen ${t.text(e.label)}`,children:d.map(n=>(0,R.jsxs)(`li`,{className:`pxd-tag-chip`,children:[a===`year`||a===`month`?n:f(n),(0,R.jsx)(`button`,{type:`button`,className:`pxd-tag-remove`,"aria-label":`Remove ${n}`,onClick:()=>t.write(e.value,d.filter(e=>e!==n)),children:(0,R.jsx)(Q,{name:`close`,size:14})})]},n))}),(0,R.jsxs)(`label`,{className:`pxd-date-add`,htmlFor:r,children:[(0,R.jsx)(`span`,{className:`pxd-sr-only`,children:`Add a date`}),a===`year`?(0,R.jsx)(`input`,{id:r,className:`pxd-input pxd-input-year`,inputMode:`numeric`,pattern:`[0-9]{4}`,maxLength:4,placeholder:`YYYY`,"aria-describedby":o?i:void 0,onKeyDown:e=>e.key===`Enter`&&(e.preventDefault(),p(e.currentTarget.value),e.currentTarget.value=``),onBlur:e=>(p(e.currentTarget.value),e.currentTarget.value=``)}):(0,R.jsx)(`input`,{id:r,className:`pxd-input pxd-input-date`,type:Bh[a],min:c,max:l,"aria-describedby":o?i:void 0,onChange:e=>(p(e.target.value),e.target.value=``)})]})]})}if(a===`year`)return(0,R.jsx)(Ch,{label:t.text(e.label),help:o,required:e.required,id:r,helpId:i,children:(0,R.jsx)(`input`,{id:r,className:`pxd-input pxd-input-year`,inputMode:`numeric`,pattern:`[0-9]{4}`,maxLength:4,placeholder:`YYYY`,value:s??``,min:c,max:l,required:e.required,"aria-describedby":o?i:void 0,onChange:n=>t.write(e.value,n.target.value.replace(/\D/g,``).slice(0,4)||null),...u})});if(a===`dateRange`){let[n,r]=Array.isArray(s)?s:[],i=(i,a)=>{let o=[n??null,r??null];o[i]=a||null,t.write(e.value,o)};return(0,R.jsxs)(`fieldset`,{className:`pxd-field`,...u,children:[(0,R.jsx)(`legend`,{className:`pxd-field-label`,children:t.text(e.label)}),o&&(0,R.jsx)(`p`,{className:`pxd-field-help`,children:o}),(0,R.jsxs)(`div`,{className:`pxd-date-range`,children:[(0,R.jsxs)(`label`,{children:[`From`,(0,R.jsx)(`input`,{className:`pxd-input`,type:`date`,value:n??``,min:c,max:l,required:e.required,onChange:e=>i(0,e.target.value)})]}),(0,R.jsxs)(`label`,{children:[`To`,(0,R.jsx)(`input`,{className:`pxd-input`,type:`date`,value:r??``,min:n??c,max:l,required:e.required,onChange:e=>i(1,e.target.value)})]})]})]})}return(0,R.jsx)(Ch,{label:t.text(e.label),help:o,required:e.required,id:r,helpId:i,children:(0,R.jsx)(`input`,{id:r,className:`pxd-input pxd-input-date${a===`month`?` pxd-input-month`:``}`,type:Bh[a],value:s??``,min:c,max:l,required:e.required,"aria-describedby":o?i:void 0,onChange:n=>t.write(e.value,n.target.value||null),...u})})}function Hh({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=(0,v.useId)(),a=(0,v.useId)(),o=r=>j(r,ae(e.format??{type:`number`},n.data,t.scope),n.locale),s=$(e);if(e.mode===`range`){let n=t.value(e.value),[c,l]=Array.isArray(n)?n.map(Number):[e.min,e.max],u=(n,r)=>t.write(e.value,[Math.max(e.min,Math.min(n,r)),Math.min(e.max,Math.max(n,r))]);return(0,R.jsxs)(`div`,{className:`pxd-field pxd-range`,role:`group`,"aria-labelledby":r,...s,children:[(0,R.jsxs)(`div`,{className:`pxd-range-header`,children:[(0,R.jsx)(`span`,{className:`pxd-field-label`,id:r,children:t.text(e.label)}),(0,R.jsxs)(`output`,{className:`pxd-range-value`,"aria-live":`polite`,children:[o(c),` – `,o(l)]})]}),(0,R.jsxs)(pp,{className:`pxd-slider`,min:e.min,max:e.max,step:e.step??1,value:[c,l],minStepsBetweenThumbs:1,onValueChange:([e,t])=>u(e,t),children:[(0,R.jsx)(bp,{className:`pxd-slider-track`,children:(0,R.jsx)(Sp,{className:`pxd-slider-range`})}),(0,R.jsx)(kp,{className:`pxd-slider-thumb`,"aria-label":`Minimum`,"aria-valuetext":o(c)}),(0,R.jsx)(kp,{className:`pxd-slider-thumb`,"aria-label":`Maximum`,"aria-valuetext":o(l)})]}),(0,R.jsxs)(`div`,{className:`pxd-range-fields`,children:[(0,R.jsxs)(`label`,{htmlFor:i,children:[(0,R.jsx)(`span`,{children:`Minimum`}),(0,R.jsx)(`input`,{id:i,className:`pxd-input`,inputMode:`numeric`,value:c,onChange:t=>u(Number(t.target.value)||e.min,l)})]}),(0,R.jsx)(`span`,{"aria-hidden":`true`,children:`–`}),(0,R.jsxs)(`label`,{htmlFor:a,children:[(0,R.jsx)(`span`,{children:`Maximum`}),(0,R.jsx)(`input`,{id:a,className:`pxd-input`,inputMode:`numeric`,value:l,onChange:t=>u(c,Number(t.target.value)||e.max)})]})]})]})}let c=Number(t.value(e.value)??e.min);return(0,R.jsxs)(`div`,{className:`pxd-field pxd-range`,...s,children:[(0,R.jsxs)(`div`,{className:`pxd-range-header`,children:[(0,R.jsx)(`span`,{className:`pxd-field-label`,id:r,children:t.text(e.label)}),(0,R.jsx)(`output`,{className:`pxd-range-value`,"aria-live":`polite`,children:o(c)})]}),(0,R.jsxs)(pp,{className:`pxd-slider`,min:e.min,max:e.max,step:e.step??1,value:[c],onValueChange:([n])=>t.write(e.value,n),children:[(0,R.jsx)(bp,{className:`pxd-slider-track`,children:(0,R.jsx)(Sp,{className:`pxd-slider-range`})}),(0,R.jsx)(kp,{className:`pxd-slider-thumb`,"aria-labelledby":r,"aria-valuetext":o(c)})]}),(0,R.jsxs)(`div`,{className:`pxd-range-bounds`,"aria-hidden":`true`,children:[(0,R.jsx)(`span`,{children:o(e.min)}),(0,R.jsx)(`span`,{children:o(e.max)})]})]})}function Uh(e){return(e.labels?.[0]?.textContent??e.getAttribute(`aria-label`)??e.closest(`.pxd-field`)?.querySelector(`.pxd-field-label, legend`)?.textContent??``).replace(/\*\s*$/,``).trim()}function Wh(e,t){let n=new Set,r=[];for(let i of Array.from(e.elements))if(i.willValidate&&!i.validity.valid){if(i.type===`radio`&&i.name){if(n.has(i.name))continue;n.add(i.name)}i.id||=`${t}-${r.length}`,r.push(i)}return r}function Gh({node:e}){let t=P(),n=N(),r=Math.min((0,v.useContext)(re),6),i=(0,v.useId)(),a=(0,v.useRef)(null),o=(0,v.useRef)([]),[s,c]=(0,v.useState)([]),l=(e.children??[]).some(e=>n.byId.get(e)?.required);(0,v.useEffect)(()=>{s.length&&a.current?.focus()},[s]);let u=()=>{for(let e of o.current)e.removeAttribute(`aria-invalid`),e.pxdDescribed?e.setAttribute(`aria-describedby`,e.pxdDescribed):e.removeAttribute(`aria-describedby`),e.pxdNote?.remove(),e.pxdNote=void 0;o.current=[]},d=e=>{for(let t of e){t.setAttribute(`aria-invalid`,`true`);let e=t.closest(`.pxd-field`);if(e&&!e.querySelector(`.pxd-field-error`)){let n=e.ownerDocument.createElement(`p`);n.className=`pxd-field-error`,n.id=`${t.id}-error`,n.textContent=t.validationMessage,e.append(n),t.pxdNote=n,t.pxdDescribed=t.getAttribute(`aria-describedby`),t.setAttribute(`aria-describedby`,[t.pxdDescribed,n.id].filter(Boolean).join(` `))}}o.current=e},f=e=>{let t=a.current?.ownerDocument.getElementById(e);t&&(t.scrollIntoView({block:`center`}),t.focus(),t.ownerDocument.activeElement!==t&&t.closest(`.pxd-field`)?.querySelector(`[role='radio'], button, input:not([aria-hidden]), textarea, select`)?.focus())};return(0,R.jsxs)(`form`,{className:`pxd-form${e.aside?` pxd-form-with-aside`:``}${e.layout===`horizontal`?` pxd-form-horizontal`:``}`,noValidate:!0,onSubmit:r=>{r.preventDefault();let a=r.currentTarget;if(u(),!a.checkValidity()){let e=Wh(a,i);return d(e),c(e.map(e=>({id:e.id,label:Uh(e),message:e.validationMessage})))}c([]),n.dispatch(e.submit.action,t.scope,e.id)},...$(e),children:[e.aside&&(0,R.jsx)(`aside`,{className:`pxd-form-aside`,children:(0,R.jsx)(c_,{id:e.aside})}),(0,R.jsxs)(`div`,{className:`pxd-stack pxd-form-fields`,children:[s.length>0&&(0,R.jsxs)(`section`,{ref:a,className:`pxd-error-summary`,role:`alert`,tabIndex:-1,"aria-labelledby":i,children:[(0,v.createElement)(`h${r}`,{id:i,className:`pxd-error-summary-title`},`Check these fields before continuing`),(0,R.jsx)(`ul`,{className:`pxd-error-summary-list`,children:s.map(e=>(0,R.jsx)(`li`,{children:(0,R.jsx)(`a`,{href:`#${e.id}`,className:`pxd-link`,onClick:t=>{t.preventDefault(),f(e.id)},children:e.label?`${e.label}: ${e.message}`:e.message})},e.id))})]}),l&&(0,R.jsxs)(`p`,{className:`pxd-required-legend`,children:[(0,R.jsx)(`span`,{className:`pxd-required`,"aria-hidden":`true`,children:`*`}),` `,`Required`]}),(0,R.jsx)(Om,{ids:e.children})]}),(0,R.jsxs)(`div`,{className:`pxd-action-bar`,children:[(0,R.jsx)(`button`,{type:`submit`,className:`pxd-button pxd-button-primary`,children:t.text(e.submit.label)}),e.cancel&&(0,R.jsx)(`button`,{type:`button`,className:`pxd-button pxd-button-secondary`,onClick:()=>n.dispatch(e.cancel.action,t.scope,e.id),children:t.text(e.cancel.label)})]})]})}var Kh={ctrl:[`⌃`,`Ctrl`,`Control`,`ctrlKey`],alt:[`⌥`,`Alt`,`Alt`,`altKey`],shift:[`⇧`,`Shift`,`Shift`,`shiftKey`],enter:[`↵`,`Enter`,`Enter`,`enter`],escape:[`⎋`,`Esc`,`Escape`,`escape`],space:[`Space`,`Space`,`Space`,` `],tab:[`⇥`,`Tab`,`Tab`,`tab`],backspace:[`⌫`,`Backspace`,`Backspace`,`backspace`],delete:[`⌦`,`Del`,`Delete`,`delete`],arrowup:[`↑`,`↑`,`ArrowUp`,`arrowup`],arrowdown:[`↓`,`↓`,`ArrowDown`,`arrowdown`],arrowleft:[`←`,`←`,`ArrowLeft`,`arrowleft`],arrowright:[`→`,`→`,`ArrowRight`,`arrowright`],home:[`Home`,`Home`,`Home`,`home`],end:[`End`,`End`,`End`,`end`],slash:[`/`,`/`,`/`,`/`],comma:[`,`,`,`,`,`,`,`],period:[`.`,`.`,`.`,`.`]},qh=[`metaKey`,`ctrlKey`,`altKey`,`shiftKey`];function Jh(e,t){let n=e.toLowerCase().split(`+`),r=n.pop(),i=[],a=[],o=new Set;for(let e of n){let[n,r,s,c]=e===`mod`?t?[`⌘`,`Ctrl`,`Meta`,`metaKey`]:Kh.ctrl:Kh[e];i.push(t?n:r),a.push(s),o.add(c)}let s=Kh[r];return i.push(s?t?s[0]:s[1]:r.toUpperCase()),a.push(s?s[2]:r.toUpperCase()),{hint:i,aria:a.join(`+`),flags:o,key:s?s[3]:r}}var Yh=()=>/mac|iphone|ipad|ipod/i.test(navigator.userAgentData?.platform??navigator.platform??``),Xh=()=>()=>{},Zh=()=>(0,v.useSyncExternalStore)(Xh,Yh,()=>!1);function Qh(e){return e instanceof HTMLElement?e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName):!1}function $h({node:e}){let t=P(),n=N(),r=(0,v.useContext)(ie),i=(0,v.useId)(),[a,o]=(0,v.useState)(!1),s=e.disabled!==void 0&&!!t.value(e.disabled),c=e.tone===`danger`?` pxd-button-danger`:``,l=e.description===void 0?void 0:t.text(e.description),u=Zh(),d=typeof e.shortcut==`string`&&e.shortcut?Jh(e.shortcut,u):void 0,f=()=>{let i=e.action.event.name;if(i===`ui.back`&&r)return r.back();if(i===`ui.next`&&r)return r.next();if(i===`ui.copy`){let n=e.copy===void 0?String(t.context(e.action.event.context).text??``):t.text(e.copy),r=()=>{o(!0),setTimeout(()=>o(!1),2e3)};typeof navigator<`u`&&navigator.clipboard?.writeText?navigator.clipboard.writeText(n).then(r,()=>void 0):r()}n.dispatch(e.action,t.scope,e.id)},p=(0,v.useRef)(f);p.current=f;let m=n.root;return(0,v.useEffect)(()=>{if(!d||s||!m)return;let e=e=>{if(e.defaultPrevented||e.repeat||!m.contains(document.activeElement)&&!(e.target instanceof HTMLElement&&m.contains(e.target))||!qh.every(t=>e[t]===d.flags.has(t))||!d.flags.has(`metaKey`)&&!d.flags.has(`ctrlKey`)&&!d.flags.has(`altKey`)&&Qh(e.target))return;let t=/^[a-z0-9]$/.test(d.key)&&e.code.toLowerCase()===(/\d/.test(d.key)?`digit${d.key}`:`key${d.key}`);(e.key.toLowerCase()===d.key||t)&&(e.preventDefault(),p.current())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[e.shortcut,u,s,m]),(0,R.jsxs)(`button`,{type:`button`,className:`pxd-button pxd-button-${e.emphasis??`secondary`}${c}${l?` pxd-button-described`:``}`,disabled:s,"aria-describedby":l?i:void 0,"aria-keyshortcuts":d?.aria,onClick:f,...$(e),children:[(0,R.jsx)(`span`,{className:`pxd-button-label`,children:a?`Copied`:t.text(e.label)}),d&&(0,R.jsx)(`span`,{className:`pxd-kbd-hint`,"aria-hidden":`true`,children:d.hint.map((e,t)=>(0,R.jsx)(`kbd`,{className:`pxd-kbd`,children:e},t))}),l&&(0,R.jsx)(`span`,{className:`pxd-button-description`,id:i,children:l}),e.action.event.name===`ui.copy`&&(0,R.jsx)(`span`,{className:`pxd-sr-only`,"aria-live":`polite`,children:a?`Copied`:``})]})}var eg={todo:{label:`Not started`,tone:`neutral`},inProgress:{label:`In progress`,tone:`info`},done:{label:`Completed`,tone:`success`},blocked:{label:`Cannot start yet`,tone:`neutral`}};function tg({node:e}){let t=P(),n=N(),[r,i]=(0,v.useState)(null),a=e.current===void 0?void 0:t.value(e.current),[o,s]=(0,v.useState)(typeof a==`number`?a:0),c=e.kind??`wizard`,l=(0,R.jsx)(`div`,{className:`pxd-action-bar`,children:(0,R.jsx)(`button`,{type:`button`,className:`pxd-button pxd-button-primary`,onClick:()=>n.dispatch(e.finish.action,t.scope,e.id),children:t.text(e.finish.label)})});if(c===`guide`)return(0,R.jsxs)(`div`,{className:`pxd-steps pxd-guide`,...$(e),children:[(0,R.jsx)(`ol`,{className:`pxd-guide-list`,children:e.steps.map((e,n)=>(0,R.jsxs)(`li`,{className:`pxd-guide-step`,children:[(0,R.jsx)(`span`,{className:`pxd-guide-number`,"aria-hidden":`true`,children:n+1}),(0,R.jsxs)(`div`,{className:`pxd-guide-body`,children:[(0,R.jsx)(km,{className:`pxd-guide-title`,children:t.text(e.title)}),(0,R.jsx)(c_,{id:e.content})]})]},e.key))}),l]});if(c===`tasklist`){let n=e=>eg[e.status===void 0?`todo`:t.text(e.status)]??eg.todo,a=e.steps.filter(e=>n(e)===eg.done).length;return(0,R.jsxs)(`div`,{className:`pxd-steps pxd-tasklist`,...$(e),children:[(0,R.jsx)(`p`,{className:`pxd-steps-progress`,children:`${a} of ${e.steps.length} tasks completed`}),(0,R.jsx)(`ul`,{className:`pxd-tasklist-list`,children:e.steps.map(e=>{let a=r===e.key,{label:o,tone:s}=n(e),c=s===`neutral`&&o===eg.blocked.label;return(0,R.jsxs)(`li`,{className:`pxd-task${a?` pxd-task-open`:``}`,children:[(0,R.jsxs)(`div`,{className:`pxd-task-row`,children:[(0,R.jsx)(`button`,{type:`button`,className:`pxd-task-title`,"aria-expanded":a,disabled:c,onClick:()=>i(a?null:e.key),children:t.text(e.title)}),(0,R.jsx)(`span`,{className:`pxd-badge pxd-tone-${s} pxd-task-status`,children:o})]}),a&&(0,R.jsx)(`div`,{className:`pxd-task-content`,children:(0,R.jsx)(c_,{id:e.content})})]},e.key)})}),l]})}let u=typeof a==`number`&&e.current?.path?a:o,d=e.steps.length,f=n=>{let r=Math.max(0,Math.min(d-1,n));e.current?.path?t.write(e.current,r):s(r)},p=e.steps[u],m=u===d-1;return(0,R.jsx)(ie.Provider,{value:{back:()=>f(u-1),next:()=>f(u+1)},children:(0,R.jsxs)(`div`,{className:`pxd-steps`,...$(e),children:[(0,R.jsx)(`p`,{className:`pxd-steps-progress`,children:`Step ${u+1} of ${d}`}),(0,R.jsx)(`ol`,{className:`pxd-steps-list`,children:e.steps.map((e,n)=>(0,R.jsx)(`li`,{"aria-current":n===u?`step`:void 0,className:n<u?`pxd-step-done`:n===u?`pxd-step-current`:void 0,children:t.text(e.title)},e.key))}),(0,R.jsxs)(`form`,{className:`pxd-steps-content`,onSubmit:r=>{r.preventDefault(),m?n.dispatch(e.finish.action,t.scope,e.id):f(u+1)},children:[(0,R.jsx)(km,{className:`pxd-steps-title`,children:t.text(p.title)}),(0,R.jsx)(c_,{id:p.content},p.key),(0,R.jsxs)(`div`,{className:`pxd-action-bar`,children:[(0,R.jsx)(`button`,{type:`submit`,className:`pxd-button pxd-button-primary`,children:m?t.text(e.finish.label):`Continue`}),u>0&&(0,R.jsx)(`button`,{type:`button`,className:`pxd-button pxd-button-secondary`,onClick:()=>f(u-1),children:`Back`})]})]})]})})}function ng({node:e}){let t=P(),n=N(),r=n.doc.root===e.id,[i,a]=(0,v.useState)(!0),[o,s]=(0,v.useState)(``),c=(0,v.useId)(),l=(0,v.useId)(),u=e.typeToConfirm===void 0?void 0:t.text(e.typeToConfirm),d=!u||o.trim()===u,f=e.severity===`destructive`,p=$(e),m=(0,v.useRef)(null);(0,v.useEffect)(()=>{r&&m.current?.focus({preventScroll:!0})},[r]);let h=()=>{r||a(!1),n.dispatch(e.cancel?.action??{event:{name:`ui.dismiss`}},t.scope,e.id)},g=()=>d&&n.dispatch(e.confirm.action,t.scope,e.id),_=e.subject&&(0,R.jsxs)(`div`,{className:`pxd-dialog-subject`,children:[(0,R.jsx)(Im,{value:e.subject.avatar===void 0?void 0:t.value(e.subject.avatar),name:t.text(e.subject.title),size:56}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`pxd-dialog-subject-title`,children:t.text(e.subject.title)}),e.subject.subtitle!==void 0&&(0,R.jsx)(`div`,{className:`pxd-dialog-subject-sub`,children:t.text(e.subject.subtitle)})]})]}),y=e.amount&&(0,R.jsx)(`div`,{className:`pxd-dialog-amount`,children:t.text(e.amount.value,e.amount.format)}),b=Array.isArray(e.consequences)&&(0,R.jsx)(`ul`,{className:`pxd-consequences`,children:e.consequences.map((e,n)=>(0,R.jsxs)(`li`,{children:[(0,R.jsx)(`span`,{className:`pxd-consequence-icon`,children:(0,R.jsx)(Q,{name:e.icon??`info`})}),(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`span`,{className:`pxd-consequence-title`,children:t.text(e.title)}),e.detail!==void 0&&(0,R.jsx)(`span`,{className:`pxd-consequence-detail`,children:t.text(e.detail)})]})]},n))}),x=(0,R.jsx)(`div`,{className:`pxd-dialog-description`,id:l,children:e.message!==void 0&&(0,R.jsx)(`p`,{children:t.text(e.message)})}),S=e.consequence!==void 0&&(0,R.jsxs)(`p`,{className:`pxd-dialog-consequence`,id:`${l}-consequence`,children:[(0,R.jsx)(Q,{name:`info`,size:18}),(0,R.jsx)(`span`,{children:t.text(e.consequence)})]}),C=(t,n)=>(0,R.jsxs)(R.Fragment,{children:[b,e.summary&&(0,R.jsx)(c_,{id:e.summary}),u&&(0,R.jsxs)(`div`,{className:`pxd-field`,children:[(0,R.jsxs)(`label`,{className:`pxd-field-label`,htmlFor:`${e.id}-type`,children:[`Type `,(0,R.jsx)(`strong`,{children:u}),` to confirm`]}),(0,R.jsx)(`input`,{id:`${e.id}-type`,className:`pxd-input`,autoComplete:`off`,value:o,onChange:e=>s(e.target.value)})]}),S,(0,R.jsxs)(`div`,{className:`pxd-action-bar`,children:[t,n]})]}),w=(0,R.jsx)(`button`,{type:`button`,className:`pxd-button pxd-button-primary${f?` pxd-button-danger`:``}`,disabled:!d,onClick:g,children:t.text(e.confirm.label)}),T=e.cancel?t.text(e.cancel.label):`Cancel`;return r?(0,R.jsxs)(`div`,{role:`alertdialog`,"aria-modal":`false`,"aria-labelledby":c,"aria-describedby":e.consequence===void 0?l:`${l} ${l}-consequence`,className:`pxd-dialog pxd-dialog-inline${f?` pxd-dialog-destructive`:``}`,onKeyDown:e=>e.key===`Escape`&&h(),...p,children:[(0,R.jsx)(`h1`,{className:`pxd-dialog-title`,id:c,children:t.text(e.title)}),y,_,x,C(w,(0,R.jsx)(`button`,{type:`button`,ref:m,className:`pxd-button pxd-button-secondary`,onClick:h,children:T}))]}):(0,R.jsx)(qi,{open:i,onOpenChange:e=>e?a(!0):h(),children:(0,R.jsxs)(Ji,{container:n.portal,children:[(0,R.jsx)(Yi,{className:`pxd-overlay`}),(0,R.jsxs)(Xi,{className:`pxd-dialog${f?` pxd-dialog-destructive`:``}`,"aria-describedby":e.consequence===void 0?l:`${l} ${l}-consequence`,...p,children:[(0,R.jsx)($i,{className:`pxd-dialog-title`,children:t.text(e.title)}),y,_,(0,R.jsx)(ea,{asChild:!0,children:x}),C((0,R.jsx)(Zi,{asChild:!0,onClick:e=>(e.preventDefault(),g()),children:w}),(0,R.jsx)(Qi,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,className:`pxd-button pxd-button-secondary`,autoFocus:!0,children:T})}))]})]})})}function rg({node:e}){let t=P(),n=N(),r=w(e.items.path,t.scope),i=O(E(n.data,r)),a=i.map((e,t)=>({pointer:T(r,t)})),o=(e,t)=>E(n.data,w(e,a[t])),s=e.recommended===void 0?void 0:t.text(e.recommended),c=e.recommendedReason===void 0?void 0:t.text(e.recommendedReason),l=new Map;for(let t of e.attributes){if(!t.better||t.better===`none`)continue;let e=i.map((e,n)=>Number(o(t.path,n))),n=t.better===`higher`?Math.max(...e):Math.min(...e);e.filter(e=>e===n).length===1&&l.set(t.key,e.indexOf(n))}let u=[];for(let n of e.attributes){let e=n.group===void 0?void 0:t.text(n.group),r=u.find(t=>t.label===e);r?r.attributes.push(n):u.push({label:e,attributes:[n]})}let d=i.map((e,t)=>t),f=d.findIndex(t=>String(o(e.itemTitle,t)??``)===s);f>0&&d.unshift(...d.splice(f,1));let p=(e,r)=>{let i=o(e.path,r);return typeof i==`boolean`?i?(0,R.jsxs)(`span`,{className:`pxd-yes`,children:[(0,R.jsx)(Q,{name:`check`,size:18}),(0,R.jsx)(`span`,{className:`pxd-sr-only`,children:`Included`})]}):(0,R.jsxs)(`span`,{className:`pxd-no`,children:[(0,R.jsx)(Q,{name:`dash`,size:18}),(0,R.jsx)(`span`,{className:`pxd-sr-only`,children:`Not included`})]}):j(i,ae(e.format,n.data,t.scope),n.locale)};return(0,R.jsxs)(`div`,{className:`pxd-comparison`,...$(e),children:[e.summary!==void 0&&(0,R.jsx)(`p`,{className:`pxd-comparison-summary`,children:t.text(e.summary)}),(0,R.jsx)(`ul`,{className:`pxd-comparison-items`,children:d.map(r=>{let i=String(o(e.itemTitle,r)??``),d=s===i;return(0,R.jsxs)(`li`,{className:`pxd-comparison-item${d?` pxd-recommended`:``}`,children:[d&&(0,R.jsxs)(`p`,{className:`pxd-recommendation`,children:[(0,R.jsx)(`span`,{className:`pxd-badge pxd-tone-info`,children:`Recommended`}),c&&(0,R.jsx)(`span`,{className:`pxd-recommendation-reason`,children:c})]}),(0,R.jsx)(km,{className:`pxd-comparison-title`,children:i}),u.map((e,n)=>(0,R.jsxs)(`div`,{className:`pxd-comparison-group`,children:[e.label&&(0,R.jsx)(`p`,{className:`pxd-comparison-group-label`,children:e.label}),(0,R.jsx)(`dl`,{children:e.attributes.map(e=>(0,R.jsxs)(`div`,{className:`pxd-detail-row`,children:[(0,R.jsx)(`dt`,{children:t.text(e.label)}),(0,R.jsxs)(`dd`,{children:[p(e,r),l.get(e.key)===r&&(0,R.jsx)(`span`,{className:`pxd-best`,children:` Best`})]})]},e.key))})]},n)),e.choose&&(0,R.jsxs)(`button`,{type:`button`,className:`pxd-button ${d?`pxd-button-primary`:`pxd-button-secondary`}`,onClick:()=>n.dispatch(e.choose.action,a[r],e.id),children:[t.text(e.choose.label),` `,(0,R.jsx)(`span`,{className:`pxd-sr-only`,children:i})]})]},r)})})]})}var ig=`More actions`,ag=44;function og({node:e}){let t=N(),n=e.children??[],r=(0,v.useRef)(null),i=(0,v.useRef)(null),a=(0,v.useRef)(new Map),o=(0,v.useRef)(ag),s=(0,v.useRef)(-1),[c,l]=(0,v.useState)(n.length),u=e=>t.byId.get(e)?.component===`Action`,d=1;for(let e=n.length-1;e>0;e--)if(!u(n[e])){d=e+1;break}let f=()=>{let e=r.current;if(!e)return;if(n.length<=2||getComputedStyle(e).flexDirection===`column`)return l(n.length);for(let t of e.querySelectorAll(`:scope > [data-pxd-id]`))t.offsetWidth&&a.current.set(t.dataset.pxdId,t.offsetWidth);i.current?.offsetWidth&&(o.current=i.current.offsetWidth);let t=parseFloat(getComputedStyle(e).columnGap)||0,s=e.clientWidth,c=e=>a.current.get(e)??0,u=0,f=0;for(;f<n.length&&u+(f?t:0)+c(n[f])<=s;)u+=(f?t:0)+c(n[f++]);if(f<n.length){for(;f>d&&u+t+o.current>s;)u-=t+c(n[--f]);f=Math.max(f,d)}l(f)};(0,v.useLayoutEffect)(f),(0,v.useLayoutEffect)(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(([e])=>{let t=e.contentRect.width;t!==s.current&&(s.current=t,f())});return t.observe(e),()=>t.disconnect()});let p=n.slice(0,Math.min(c,n.length)),m=n.slice(p.length);return(0,R.jsxs)(`div`,{ref:r,className:`pxd-action-bar`,role:`group`,"aria-label":`Actions`,...$(e),children:[p.map(e=>(0,R.jsx)(c_,{id:e},e)),m.length>0&&(0,R.jsxs)(wd,{children:[(0,R.jsx)(Td,{ref:i,className:`pxd-icon-button pxd-action-menu-trigger pxd-action-menu-overflow pxd-action-bar-more`,"aria-label":ig,children:(0,R.jsx)(Q,{name:`dots`,size:18})}),(0,R.jsx)(Ed,{container:t.portal,children:(0,R.jsx)(Dd,{className:`pxd-menu pxd-action-menu`,align:`start`,sideOffset:4,children:(0,R.jsx)(sg,{ids:m})})})]})]})}function sg({ids:e}){let t=P(),n=N(),r=e.map(e=>n.byId.get(e)).filter(e=>!!e&&e.component===`Action`&&(e.visible===void 0||t.value(e.visible)!==!1)),i=r.filter(e=>e.tone!==`danger`),a=r.filter(e=>e.tone===`danger`),o=e=>(0,R.jsx)(Ad,{className:`pxd-menu-item${e.tone===`danger`?` pxd-menu-item-danger`:``}`,disabled:e.disabled===void 0?void 0:!!t.value(e.disabled),onSelect:()=>n.dispatch(e.action,t.scope,e.id),"data-pxd-id":e.id,"data-pxd-component":e.component,children:t.text(e.label)},e.id);return(0,R.jsxs)(R.Fragment,{children:[i.map(o),a.length>0&&i.length>0&&(0,R.jsx)(Fd,{className:`pxd-menu-separator`}),a.map(o)]})}var cg=640;function lg({node:e}){let t=P(),n=N(),r=(0,v.useRef)(null),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1),c=$(e);(0,v.useLayoutEffect)(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>a(e.getBoundingClientRect().width<cg);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let l=e.label===void 0?`Filters`:t.text(e.label),u=(e.children??[]).map(e=>n.byId.get(e)).filter(Boolean),d=u.filter(e=>e.component===`TextInput`&&e.kind===`search`),f=u.filter(e=>!d.includes(e)),p=ug(f,n,t),m=e.resultCount===void 0?void 0:t.value(e.resultCount),h=m===void 0?void 0:`${j(m,{type:`number`},n.locale)} ${m===1?`result`:`results`}`,g=()=>{for(let e of p)e.remove();e.clear&&n.dispatch(e.clear,t.scope,e.id)},_=f.map(e=>(0,R.jsx)(c_,{id:e.id},e.id)),y=(0,R.jsxs)(`div`,{className:`pxd-filter-results`,children:[d.map(e=>(0,R.jsx)(c_,{id:e.id},e.id)),(0,R.jsxs)(`div`,{className:`pxd-filter-status`,children:[i&&(0,R.jsxs)(ui,{className:`pxd-chip pxd-filter-trigger`,children:[(0,R.jsx)(Q,{name:`filter`,size:18}),l,p.length>0&&(0,R.jsxs)(`span`,{"aria-hidden":`true`,children:[` · `,p.length]}),p.length>0&&(0,R.jsxs)(`span`,{className:`pxd-sr-only`,children:[`, `,p.length,` active`]})]}),h&&(0,R.jsx)(`p`,{className:`pxd-filter-count`,"aria-live":`polite`,children:h})]}),p.length>0&&(0,R.jsxs)(`ul`,{className:`pxd-filter-chips`,"aria-label":`Active filters`,children:[p.map(e=>(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,className:`pxd-chip pxd-filter-chip`,onClick:e.remove,"aria-label":`Remove filter: ${e.label}`,children:[e.label,(0,R.jsx)(Q,{name:`close`,size:16})]})},e.key)),(0,R.jsx)(`li`,{children:(0,R.jsx)(`button`,{type:`button`,className:`pxd-button pxd-button-tertiary pxd-filter-clear`,onClick:g,children:`Clear all`})})]}),(0,R.jsx)(c_,{id:e.results})]});return(0,R.jsx)(`div`,{ref:r,className:`pxd-filter-panel${i?` pxd-filter-compact`:``}`,...c,children:i?(0,R.jsxs)(ci,{open:o,onOpenChange:s,children:[y,(0,R.jsxs)(mi,{container:n.portal,children:[(0,R.jsx)(gi,{className:`pxd-overlay`}),(0,R.jsxs)(bi,{className:`pxd-sheet`,"aria-describedby":void 0,children:[(0,R.jsxs)(`div`,{className:`pxd-sheet-header`,children:[(0,R.jsx)(Ti,{className:`pxd-sheet-title`,children:l}),(0,R.jsx)(ki,{className:`pxd-icon-button`,"aria-label":`Close`,children:(0,R.jsx)(Q,{name:`close`})})]}),(0,R.jsx)(`div`,{className:`pxd-sheet-body pxd-stack`,children:_}),(0,R.jsxs)(`div`,{className:`pxd-sheet-footer`,children:[p.length>0&&(0,R.jsx)(`button`,{type:`button`,className:`pxd-button pxd-button-secondary`,onClick:g,children:`Clear all`}),(0,R.jsx)(ki,{className:`pxd-button pxd-button-primary`,children:h?`Show ${h}`:`Show results`})]})]})]})]}):(0,R.jsxs)(`div`,{className:`pxd-filter-layout`,children:[(0,R.jsxs)(`section`,{className:`pxd-filter-sidebar`,"aria-label":l,children:[(0,R.jsx)(km,{className:`pxd-filter-title`,children:l}),(0,R.jsx)(`div`,{className:`pxd-stack`,children:_})]}),y]})})}function ug(e,t,n){let r=[];for(let i of e){if(!i.value||typeof i.value!=`object`||!(`path`in i.value))continue;let e=n.value(i.value),a=n.text(i.label),o=e=>j(e,ae(i.format??{type:`number`},t.data,n.scope),t.locale);switch(i.component){case`Choice`:{let a=Fh(i,t.data,n.scope,n.text),o=e=>a.find(t=>t.value===e)?.label??String(e);if(Array.isArray(e))for(let t of e)r.push({key:`${i.id}:${t}`,label:o(t),remove:()=>n.write(i.value,e.filter(e=>e!==t))});else e!=null&&e!==``&&r.push({key:i.id,label:o(e),remove:()=>n.write(i.value,null)});break}case`RangeInput`:if(i.mode===`range`&&Array.isArray(e)){let[t,s]=e.map(Number);(t>i.min||s<i.max)&&r.push({key:i.id,label:`${a}: ${o(t)} – ${o(s)}`,remove:()=>n.write(i.value,[i.min,i.max])})}else typeof e==`number`&&e<i.max&&r.push({key:i.id,label:`${a}: ${o(e)}`,remove:()=>n.write(i.value,i.max)});break;case`Toggle`:e===!0&&r.push({key:i.id,label:a,remove:()=>n.write(i.value,!1)});break;case`TextInput`:typeof e==`string`&&e.trim()&&r.push({key:i.id,label:`${a}: ${e}`,remove:()=>n.write(i.value,``)});break;case`DateInput`:e&&r.push({key:i.id,label:`${a}: ${String(e)}`,remove:()=>n.write(i.value,null)})}}return r}var dg=900;function fg({node:e}){let t=P(),n=N(),r=(0,v.useRef)(null),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)({}),u=t.value(e.current),d=e.kind??`main`,f=e.label===void 0?d===`breadcrumb`?`Breadcrumb`:d===`toc`?`On this page`:`Main`:t.text(e.label),p=$(e);(0,v.useLayoutEffect)(()=>{if(d!==`main`)return;let e=r.current?.closest(`.pxd-surface`)??r.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>a(e.getBoundingClientRect().width<dg);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[d]);let m=r=>{s(!1),n.dispatch(r.action,t.scope,e.id)},h=e=>{let n=e.badge===void 0?void 0:t.value(e.badge);return n?(0,R.jsxs)(`span`,{className:`pxd-nav-badge`,children:[n,(0,R.jsx)(`span`,{className:`pxd-sr-only`,children:` needing attention`})]}):null};if(d===`breadcrumb`)return(0,R.jsx)(`nav`,{className:`pxd-nav-breadcrumb`,"aria-label":f,...p,children:(0,R.jsx)(`ol`,{children:e.items.map((n,r)=>{let i=r===e.items.length-1,a=n.key===u||u===void 0&&i;return(0,R.jsx)(`li`,{children:a?(0,R.jsx)(`span`,{className:`pxd-nav-breadcrumb-current`,"aria-current":`page`,children:t.text(n.label)}):(0,R.jsx)(`button`,{type:`button`,className:`pxd-link`,onClick:()=>m(n),children:t.text(n.label)})},n.key)})})});if(d===`toc`)return(0,R.jsxs)(`nav`,{className:`pxd-nav-toc`,"aria-label":f,...p,children:[(0,R.jsx)(`p`,{className:`pxd-nav-toc-label`,"aria-hidden":`true`,children:f}),(0,R.jsx)(`ol`,{children:e.items.map(r=>{let i=r.key===u;return(0,R.jsx)(`li`,{children:(0,R.jsx)(`a`,{href:`#${r.key}`,className:`pxd-nav-toc-link${i?` pxd-nav-current`:``}`,"aria-current":i?`true`:void 0,onClick:()=>n.dispatch(r.action,t.scope,e.id),children:t.text(r.label)})},r.key)})})]});if(d===`local`)return(0,R.jsx)(`nav`,{className:`pxd-nav-local`,"aria-label":f,...p,children:(0,R.jsx)(`ul`,{children:e.items.map(e=>{let n=e.key===u;return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,className:`pxd-nav-local-item${n?` pxd-nav-current`:``}`,"aria-current":n?`page`:void 0,onClick:()=>m(e),children:[e.icon&&(0,R.jsx)(Q,{name:e.icon,size:16}),(0,R.jsx)(`span`,{className:`pxd-nav-label`,children:t.text(e.label)}),h(e)]})},e.key)})})});let g=[];for(let n of e.items){let e=n.group===void 0?void 0:t.text(n.group),r=g.find(t=>t.label===e);r?r.items.push(n):g.push({label:e,items:[n]})}let _=d===`nested`,y=e=>e.label&&e.label in c?c[e.label]:!e.label||e.items.some(e=>e.key===u),b=e=>(0,R.jsx)(`ul`,{children:e.map(e=>{let n=e.key===u;return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,className:`pxd-nav-item${n?` pxd-nav-current`:``}`,"aria-current":n?`page`:void 0,onClick:()=>m(e),children:[e.icon&&(0,R.jsx)(Q,{name:e.icon,size:18}),(0,R.jsx)(`span`,{className:`pxd-nav-label`,children:t.text(e.label)}),h(e)]})},e.key)})}),x=(0,R.jsx)(`nav`,{className:`pxd-nav${_?` pxd-nav-nested`:``}`,"aria-label":f,children:g.map((e,t)=>(0,R.jsxs)(`div`,{className:`pxd-nav-group`,children:[e.label&&(_?(0,R.jsxs)(`button`,{type:`button`,className:`pxd-nav-group-toggle`,"aria-expanded":y(e),onClick:()=>l(t=>({...t,[e.label]:!y(e)})),children:[(0,R.jsx)(Q,{name:y(e)?`sortUp`:`sortDown`,size:16}),(0,R.jsx)(`span`,{className:`pxd-nav-group-label`,children:e.label})]}):(0,R.jsx)(`p`,{className:`pxd-nav-group-label`,children:e.label})),(!_||y(e))&&b(e.items)]},t))});return(0,R.jsx)(`div`,{ref:r,className:`pxd-nav-wrap`,...p,children:i?(0,R.jsxs)(ci,{open:o,onOpenChange:s,children:[(0,R.jsx)(ui,{className:`pxd-icon-button pxd-nav-menu`,"aria-label":`${f} menu`,children:(0,R.jsx)(Q,{name:`menu`})}),(0,R.jsxs)(mi,{container:n.portal,children:[(0,R.jsx)(gi,{className:`pxd-overlay`}),(0,R.jsxs)(bi,{className:`pxd-nav-drawer`,"aria-describedby":void 0,children:[(0,R.jsxs)(`div`,{className:`pxd-sheet-header`,children:[(0,R.jsx)(Ti,{className:`pxd-sheet-title`,children:f}),(0,R.jsx)(ki,{className:`pxd-icon-button`,"aria-label":`Close`,children:(0,R.jsx)(Q,{name:`close`})})]}),x]})]})]}):x})}function pg(e,t,n,r){if(!n.action)return;let i=t.pointer(n.value),a=Object.fromEntries(Object.entries(n.action.event.context??{}).map(([e,n])=>[e,n&&typeof n==`object`&&`path`in n&&w(n.path,t.scope)===i?r:t.value(n)]));e.dispatch({event:{name:n.action.event.name,context:a}},{pointer:``},n.id)}function mg({node:e}){let t=P(),n=N(),r=t.text(e.label),i=e.kind??`label`,a=i===`status`?e.tone??`neutral`:`neutral`,o=$(e),s=`pxd-tag pxd-tag-${i} pxd-tag-${a}${e.remove?` pxd-tag-removable`:``}`;if(i===`count`){let n=t.text(e.count,{type:`number`});return(0,R.jsxs)(`span`,{className:s,title:r,...o,children:[(0,R.jsxs)(`span`,{className:`pxd-sr-only`,children:[r,`: `]}),(0,R.jsx)(`span`,{className:`pxd-tag-number`,children:n})]})}return(0,R.jsxs)(`span`,{className:s,title:r,...o,children:[(0,R.jsx)(`span`,{className:`pxd-tag-text`,children:r}),e.remove&&(0,R.jsx)(`button`,{type:`button`,className:`pxd-tag-remove`,"aria-label":`Remove ${r}`,onClick:()=>n.dispatch(e.remove,t.scope,e.id),children:(0,R.jsx)(Q,{name:`close`,size:12})})]})}var hg={small:24,default:40,large:64};function gg({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=(0,v.useId)(),a=$(e),o=e.kind??`person`,s=e.size??`default`,c=hg[s]??hg.default,l=t.text(e.name),u=e.detail===void 0?void 0:t.text(e.detail),d={"--polyxd-identity-size":`${c}px`},f=`pxd-identity pxd-identity-${s} pxd-identity-${o}${e.group?` pxd-identity-group`:``}`,p,m=l;if(e.group){let r=w(e.group.path,t.scope),i=O(E(n.data,r)).map((t,i)=>{let a={pointer:T(r,i)},o=e=>e?E(n.data,w(e,a)):void 0;return{name:String(o(e.group.namePath)??``),image:o(e.group.imagePath)}}),a=e.group.max??4,o=i.slice(0,a),s=i.slice(a),l=e=>e.split(/\s+/)[0]||e;m||=s.length?`${o.map(e=>l(e.name)).join(`, `)} and ${s.length} more`:o.map(e=>l(e.name)).join(`, `),p=(0,R.jsxs)(`span`,{className:`pxd-identity-faces`,children:[o.map((e,t)=>(0,R.jsxs)(`span`,{className:`pxd-identity-face`,children:[(0,R.jsx)(Im,{value:e.image,name:e.name,size:c}),(0,R.jsx)(`span`,{className:`pxd-sr-only`,children:e.name})]},t)),s.length>0&&(0,R.jsx)(`span`,{className:`pxd-identity-face pxd-identity-more`,role:`img`,title:s.map(e=>e.name).join(`, `),"aria-label":`${s.length} more: ${s.map(e=>e.name).join(`, `)}`,children:(0,R.jsxs)(`span`,{"aria-hidden":`true`,children:[`+`,s.length]})})]})}else p=(0,R.jsx)(Im,{value:t.value(e.image),name:l,size:c});let h=(0,R.jsxs)(R.Fragment,{children:[p,(0,R.jsxs)(`span`,{className:`pxd-identity-text`,children:[(0,R.jsx)(`span`,{className:`pxd-identity-name`,id:r,children:m}),u&&(0,R.jsx)(`span`,{className:`pxd-identity-detail`,id:i,children:u})]})]});return e.action?(0,R.jsx)(`button`,{type:`button`,className:`${f} pxd-identity-button`,style:d,"aria-labelledby":r,"aria-describedby":u?i:void 0,onClick:()=>n.dispatch(e.action,t.scope,e.id),...a,children:h}):(0,R.jsx)(`div`,{className:f,style:d,role:`group`,"aria-labelledby":r,"aria-describedby":u?i:void 0,...a,children:h})}function _g(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 vg({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=$(e),a=e.kind??`bar`,o=t.text(e.label),s=!!t.value(e.indeterminate),c=t.value(e.value),l=typeof c==`number`?c:Number(c),u=e.max===void 0?void 0:Number(t.value(e.max)),d=u!==void 0&&Number.isFinite(u)&&u>0?u:void 0,f=Number.isFinite(l)?Math.max(0,Math.min(1,d===void 0?l:l/d)):0,p=e.format?j(c,ae(e.format,n.data,t.scope),n.locale):j(f,{type:`percent`,precision:0},n.locale),m=e.caption===void 0?void 0:t.text(e.caption),h=a===`meter`,g=h?_g(f,e.thresholds):{},_=e.tone??g.tone,y=h?g.hint:void 0,b=[p,m,y].filter(Boolean).join(`, `),x=Math.round(f*100),S=s?{"aria-busy":!0}:d===void 0?{"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":x,"aria-valuetext":b}:{"aria-valuemin":0,"aria-valuemax":d,"aria-valuenow":Number.isFinite(l)?l:0,"aria-valuetext":b},C=h?`meter`:`progressbar`,w=`pxd-gauge pxd-gauge-${a}${_&&_!==`neutral`?` pxd-gauge-${_}`:``}${s?` pxd-gauge-indeterminate`:``}`,T=(0,R.jsxs)(`div`,{className:`pxd-gauge-header`,children:[(0,R.jsx)(`span`,{className:`pxd-gauge-label`,id:r,children:o}),(0,R.jsxs)(`span`,{className:`pxd-gauge-readout`,children:[!s&&(0,R.jsx)(`span`,{className:`pxd-gauge-value`,children:p}),m&&(0,R.jsx)(`span`,{className:`pxd-gauge-caption`,children:m}),y&&(0,R.jsx)(`span`,{className:`pxd-gauge-hint`,children:y})]})]});return a===`ring`?(0,R.jsxs)(`div`,{className:w,...i,children:[(0,R.jsx)(`div`,{className:`pxd-gauge-ring-graphic`,role:C,"aria-labelledby":r,...S,children:(0,R.jsxs)(`svg`,{className:`pxd-gauge-ring-svg`,viewBox:`0 0 36 36`,"aria-hidden":`true`,focusable:`false`,children:[(0,R.jsx)(`circle`,{className:`pxd-gauge-ring-track`,cx:`18`,cy:`18`,r:`16`,fill:`none`,strokeWidth:`4`}),(0,R.jsx)(`circle`,{className:`pxd-gauge-ring-fill`,cx:`18`,cy:`18`,r:`16`,fill:`none`,strokeWidth:`4`,pathLength:100,strokeDasharray:s?`25 100`:`${x} 100`,strokeLinecap:`round`})]})}),T]}):(0,R.jsxs)(`div`,{className:w,...i,children:[T,(0,R.jsx)(`div`,{className:`pxd-gauge-track`,role:C,"aria-labelledby":r,...S,children:(0,R.jsx)(`div`,{className:`pxd-gauge-fill`,style:s?void 0:{width:`${x}%`}})})]})}var yg=`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`;function bg({fill:e}){let t=Math.round(Math.max(0,Math.min(1,e))*100);return(0,R.jsxs)(`span`,{className:`pxd-rating-star-shape`,"aria-hidden":`true`,children:[(0,R.jsx)(`svg`,{className:`pxd-rating-star-empty`,viewBox:`0 0 24 24`,focusable:`false`,children:(0,R.jsx)(`path`,{d:yg})}),(0,R.jsx)(`span`,{className:`pxd-rating-star-fill`,style:{width:`${t}%`},children:(0,R.jsx)(`svg`,{viewBox:`0 0 24 24`,focusable:`false`,children:(0,R.jsx)(`path`,{d:yg})})})]})}var xg=e=>`${e} ${e===1?`star`:`stars`}`;function Sg({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=(0,v.useId)(),[a,o]=(0,v.useState)(null),s=$(e),c=e.max??5,l=t.text(e.label),u=t.value(e.value),d=u==null||u===``?void 0:Number(u),f=d!==void 0&&Number.isFinite(d)?Math.max(0,Math.min(c,d)):void 0,p=!!t.value(e.readOnly),m=e.count===void 0?void 0:t.value(e.count),h=m==null?void 0:j(m,{type:`number`},n.locale),g=e.help===void 0?void 0:t.text(e.help),_=f===void 0?void 0:j(f,{type:`number`,precision:+!Number.isInteger(f)},n.locale),y=m==null?void 0:`from ${h} ${Number(m)===1?`rating`:`ratings`}`;if(p){let e=f===void 0?`not yet rated`:`${_} out of ${c}`;return(0,R.jsxs)(`div`,{className:`pxd-rating pxd-rating-readonly`,...s,children:[(0,R.jsx)(`span`,{className:`pxd-rating-label`,children:l}),(0,R.jsx)(`span`,{className:`pxd-rating-stars`,role:`img`,"aria-label":e,children:Array.from({length:c},(e,t)=>(0,R.jsx)(bg,{fill:(f??0)-t},t))}),(0,R.jsxs)(`span`,{className:`pxd-rating-readout`,children:[_&&(0,R.jsx)(`span`,{className:`pxd-rating-value`,"aria-hidden":`true`,children:_}),h&&(0,R.jsxs)(`span`,{className:`pxd-rating-count`,children:[(0,R.jsxs)(`span`,{"aria-hidden":`true`,children:[`(`,h,`)`]}),(0,R.jsx)(`span`,{className:`pxd-sr-only`,children:y})]})]})]})}let b=f===void 0?0:Math.round(f),x=a??b,S=r=>{let i=Number(r);t.write(e.value,i),pg(n,t,e,i)};return(0,R.jsxs)(`div`,{className:`pxd-field pxd-rating`,...s,children:[(0,R.jsxs)(`div`,{className:`pxd-field-label`,id:r,children:[l,e.required&&(0,R.jsx)(`span`,{className:`pxd-required`,"aria-hidden":`true`,children:`*`})]}),g&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:i,children:g}),(0,R.jsxs)(`div`,{className:`pxd-rating-row`,children:[(0,R.jsx)(qf,{className:`pxd-rating-stars`,orientation:`horizontal`,"aria-labelledby":r,"aria-describedby":g?i:void 0,"aria-required":e.required||void 0,value:b?String(b):``,onValueChange:S,onMouseLeave:()=>o(null),children:Array.from({length:c},(e,t)=>t+1).map(e=>(0,R.jsx)(Qf,{value:String(e),className:`pxd-rating-star${e<=x?` pxd-rating-star-on`:``}`,"aria-label":xg(e),onMouseEnter:()=>o(e),onFocus:()=>o(null),children:(0,R.jsx)(bg,{fill:+(e<=x)})},e))}),(0,R.jsxs)(`span`,{className:`pxd-rating-readout`,"aria-hidden":`true`,children:[_&&(0,R.jsx)(`span`,{className:`pxd-rating-value`,children:_}),h&&(0,R.jsxs)(`span`,{className:`pxd-rating-count`,children:[`(`,h,`)`]})]}),y&&(0,R.jsx)(`span`,{className:`pxd-sr-only`,children:y})]})]})}var Cg=2e3;function wg({node:e}){let t=P(),n=(0,v.useId)(),r=$(e),i=t.text(e.text),a=e.label===void 0?void 0:t.text(e.label),o=!!t.value(e.secret),s=e.copyable!==!1,[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),f=(0,v.useRef)(null);(0,v.useEffect)(()=>()=>{f.current&&clearTimeout(f.current)},[]);let p=e=>{d(e),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>d(``),Cg)},m=()=>{let e=typeof navigator<`u`?navigator.clipboard:void 0;if(!e?.writeText)return p(`Couldn't copy`);e.writeText(i).then(()=>p(`Copied`),()=>p(`Couldn't copy`))},h=o&&!c,g=h?i.replace(/[^\s]/g,`•`):i,_=a??`code`,y=a??(e.language?`${e.language} code`:`Code`);return(0,R.jsxs)(`section`,{className:`pxd-code${e.wrap?` pxd-code-wrap`:``}${o?` pxd-code-secret`:``}`,"aria-labelledby":a===void 0?void 0:n,"aria-label":a===void 0?y:void 0,...r,children:[(0,R.jsxs)(`div`,{className:`pxd-code-header`,children:[a!==void 0&&(0,R.jsx)(`span`,{className:`pxd-code-label`,id:n,children:a}),(0,R.jsxs)(`div`,{className:`pxd-code-controls`,children:[o&&(0,R.jsx)(`button`,{type:`button`,className:`pxd-button pxd-button-tertiary pxd-code-control`,"aria-label":`${c?`Hide`:`Show`} ${_}`,onClick:()=>l(e=>!e),children:c?`Hide`:`Show`}),s&&(0,R.jsxs)(`button`,{type:`button`,className:`pxd-button pxd-button-tertiary pxd-code-control`,"aria-label":`Copy ${_}`,onClick:m,children:[u===`Copied`&&(0,R.jsx)(Q,{name:`check`,size:16}),u===`Copied`?`Copied`:`Copy`]}),(0,R.jsx)(`span`,{className:`pxd-sr-only`,role:`status`,"aria-live":`polite`,children:u})]})]}),(0,R.jsx)(`pre`,{className:`pxd-code-pre`,tabIndex:0,"data-language":e.language,"data-masked":h||void 0,children:(0,R.jsx)(`code`,{className:e.language?`language-${e.language}`:void 0,translate:`no`,children:g})})]})}var Tg=e=>typeof e==`object`&&!!e&&typeof e.path==`string`;function Eg(){return(0,R.jsx)(`svg`,{className:`pxd-action-menu-chevron`,width:16,height:16,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,R.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}function Dg({node:e}){let t=P(),n=N(),r=$(e),i=e.kind??`overflow`,a=t.text(e.label),o=r[`aria-label`]??a,s=(e.children??[]).map(e=>n.byId.get(e)).filter(e=>!!e&&(e.visible===void 0||t.value(e.visible)!==!1)),c=s.filter(e=>e.tone!==`danger`),l=s.filter(e=>e.tone===`danger`),u=e=>{let r=r=>(0,R.jsx)(e.Item,{className:`pxd-menu-item${r.tone===`danger`?` pxd-menu-item-danger`:``}`,disabled:r.disabled===void 0?void 0:!!t.value(r.disabled),onSelect:()=>n.dispatch(r.action,t.scope,r.id),"data-pxd-id":r.id,"data-pxd-component":r.component,children:t.text(r.label)},r.id);return(0,R.jsxs)(R.Fragment,{children:[c.map(r),l.length>0&&c.length>0&&(0,R.jsx)(e.Separator,{className:`pxd-menu-separator`}),l.map(r)]})},d=(0,R.jsx)(Td,{className:`pxd-icon-button pxd-action-menu-trigger pxd-action-menu-overflow`,...r,"aria-label":o,children:(0,R.jsx)(Q,{name:`dots`,size:18})}),f=(0,R.jsx)(Ed,{container:n.portal,children:(0,R.jsx)(Dd,{className:`pxd-menu pxd-action-menu`,align:`end`,sideOffset:4,children:u($u)})});if(i===`dropdown`)return(0,R.jsxs)(wd,{children:[(0,R.jsxs)(Td,{className:`pxd-button pxd-button-secondary pxd-action-menu-trigger pxd-action-menu-dropdown`,...r,"aria-label":r[`aria-label`],children:[a,(0,R.jsx)(Eg,{})]}),f]});if(i===`split`){let t=(e.primary?n.byId.get(e.primary):void 0)?.emphasis??`secondary`;return(0,R.jsxs)(wd,{children:[(0,R.jsxs)(`div`,{className:`pxd-split`,role:`group`,...r,"aria-label":o,children:[e.primary&&(0,R.jsx)(c_,{id:e.primary}),(0,R.jsx)(Td,{className:`pxd-button pxd-button-${t} pxd-action-menu-trigger pxd-split-menu`,"aria-label":`${a}: more options`,children:(0,R.jsx)(Eg,{})})]}),f]})}return i===`context`?(0,R.jsxs)(Ru,{children:[(0,R.jsx)(zu,{asChild:!0,children:(0,R.jsx)(`span`,{className:`pxd-context-target`,children:(0,R.jsxs)(wd,{children:[d,f]})})}),(0,R.jsx)(Bu,{container:n.portal,children:(0,R.jsx)(Vu,{className:`pxd-menu pxd-action-menu`,"aria-label":o,children:u(lu)})})]}):(0,R.jsxs)(wd,{children:[d,f]})}function Og(e,t,n){let r=(0,v.useRef)(null),i=()=>{r.current=null,t.current&&(t.current.style.transform=``,t.current.style.transition=``)};return e?{onPointerDown:e=>{(e.pointerType!==`mouse`||e.button===0)&&(r.current=e.clientY,e.currentTarget.setPointerCapture(e.pointerId))},onPointerMove:e=>{if(r.current===null||!t.current)return;let n=Math.max(0,e.clientY-r.current);t.current.style.transition=`none`,t.current.style.transform=`translateY(${n}px)`},onPointerUp:e=>{if(r.current===null)return;let t=e.clientY-r.current;i(),t>80&&n()},onPointerCancel:i}:{}}function kg({node:e}){let t=P(),n=N(),r=$(e),i=Math.min((0,v.useContext)(re),6),a=(0,v.useId)(),o=(0,v.useRef)(null),s=e.kind??`dialog`,c=e.size??`default`,l=e.dismissible!==!1,u=Tg(e.open),[d,f]=(0,v.useState)(!0),p=u?!!t.value(e.open):d&&e.open!==!1,m=()=>{u?t.write(e.open,!1):f(!1),n.dispatch({event:{name:`ui.dismiss`}},t.scope,e.id)},h=e=>{e||m()},g=l?{}:{onEscapeKeyDown:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault()},_=Og(s===`sheet`&&l,o,m),y=t.text(e.title),b=`pxd-panel pxd-panel-${s} pxd-panel-size-${c}`,x=(0,R.jsx)(re.Provider,{value:i+1,children:(0,R.jsx)(`div`,{className:`pxd-panel-body pxd-stack`,children:(0,R.jsx)(Om,{ids:e.children})})}),S=e.actions&&(0,R.jsx)(`div`,{className:`pxd-panel-footer`,children:(0,R.jsx)(c_,{id:e.actions})});return s===`popover`?(0,R.jsxs)(vf,{open:p,onOpenChange:h,children:[(0,R.jsx)(yf,{className:`pxd-panel-anchor`}),(0,R.jsx)(bf,{container:n.portal,children:(0,R.jsxs)(xf,{className:b,"aria-labelledby":a,sideOffset:8,collisionPadding:8,...g,...r,children:[(0,R.jsxs)(`div`,{className:`pxd-panel-header`,children:[(0,v.createElement)(`h${i}`,{id:a,className:`pxd-panel-title`},y),l&&(0,R.jsx)(Sf,{className:`pxd-icon-button pxd-panel-close`,"aria-label":`Close`,children:(0,R.jsx)(Q,{name:`close`})})]}),x,S,(0,R.jsx)(Cf,{className:`pxd-panel-arrow`,width:16,height:8})]})})]}):(0,R.jsx)(ci,{open:p,onOpenChange:h,children:(0,R.jsxs)(mi,{container:n.portal,children:[(0,R.jsx)(gi,{className:`pxd-overlay pxd-panel-backdrop`}),(0,R.jsxs)(bi,{ref:o,className:b,"aria-describedby":void 0,...g,...r,children:[(0,R.jsxs)(`div`,{className:`pxd-panel-header`,..._,children:[s===`sheet`&&(0,R.jsx)(`span`,{className:`pxd-panel-grip`,"aria-hidden":`true`}),(0,R.jsx)(Ti,{asChild:!0,children:(0,v.createElement)(`h${i}`,{className:`pxd-panel-title`},y)}),l&&(0,R.jsx)(ki,{className:`pxd-icon-button pxd-panel-close`,"aria-label":`Close`,children:(0,R.jsx)(Q,{name:`close`})})]}),x,S]})]})})}var Ag=()=>(0,R.jsx)(`span`,{className:`pxd-required`,"aria-hidden":`true`,children:`*`});function jg(e,t,n,r){let i=t.pointer(n.value),a=Object.fromEntries(Object.entries(n.action.event.context??{}).map(([e,n])=>[e,n&&typeof n==`object`&&`path`in n&&w(n.path,t.scope)===i?r:t.value(n)]));e.dispatch({event:{name:n.action.event.name,context:a}},{pointer:``},n.id)}var Mg=(...e)=>e.filter(Boolean).join(` `)||void 0,Ng=[`byte`,`kilobyte`,`megabyte`,`gigabyte`];function Pg(e,t){let n=0,r=e;for(;r>=1024&&n<Ng.length-1;)r/=1024,n++;try{return new Intl.NumberFormat(t,{style:`unit`,unit:Ng[n],unitDisplay:`short`,maximumFractionDigits:+(r<10)}).format(r)}catch{return`${Math.round(r*10)/10} ${[`B`,`KB`,`MB`,`GB`][n]}`}}function Fg(e){let t=e.trim().toLowerCase();if(t.startsWith(`.`))return t.slice(1).toUpperCase();let n={"image/*":`images`,"video/*":`videos`,"audio/*":`audio`,"text/*":`text files`};if(n[t])return n[t];if(t===`application/pdf`)return`PDF`;let r=t.split(`/`)[1];return r?r.replace(/^(x-|vnd\.)/,``).toUpperCase():e}function Ig(e){return e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} or ${e[e.length-1]}`}function Lg(e,t){if(t.length===0)return!0;let n=e.name.toLowerCase(),r=e.type.toLowerCase();return t.some(e=>{let t=e.trim().toLowerCase();return t.startsWith(`.`)?n.endsWith(t):t.endsWith(`/*`)?r.startsWith(t.slice(0,-1)):r===t})}var Rg=e=>{typeof e.ref==`string`&&e.ref.startsWith(`blob:`)&&URL.revokeObjectURL(e.ref)};function zg({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=(0,v.useId)(),a=(0,v.useId)(),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1),u=t.value(e.value),d=Array.isArray(u)?u:[],f=Array.isArray(e.accept)?e.accept:[],p=e.maxSize,m=!!e.multiple,h=t.text(e.label),g=f.length?Ig(f.map(Fg)):``,_=[g&&`Accepts ${g}.`,p&&`Up to ${Pg(p,n.locale)}${m?` each`:``}.`].filter(Boolean).join(` `),y=[e.help===void 0?``:t.text(e.help),_].filter(Boolean).join(` `)||void 0,b=r=>{if(!r)return;let i=Array.from(r),a=[],o=[];for(let e of m?i:i.slice(0,1))p&&e.size>p?o.push(`${e.name} is ${Pg(e.size,n.locale)}; the limit is ${Pg(p,n.locale)}.`):Lg(e,f)?a.push({name:e.name,size:e.size,type:e.type,ref:URL.createObjectURL(e)}):o.push(`${e.name} isn't an accepted type${g?` (${g})`:``}.`);if(s(o.length?o.join(` `):null),a.length!==0){if(m){let n=a.filter(e=>!d.some(t=>t.name===e.name&&t.size===e.size));a.filter(e=>!n.includes(e)).forEach(Rg),n.length&&t.write(e.value,[...d,...n])}else d.forEach(Rg),t.write(e.value,a)}},x=n=>{Rg(d[n]),t.write(e.value,d.filter((e,t)=>t!==n)),s(null)};return(0,R.jsxs)(`div`,{className:`pxd-field pxd-file`,children:[(0,R.jsxs)(`label`,{className:`pxd-field-label`,htmlFor:r,children:[h,e.required&&(0,R.jsx)(Ag,{})]}),y&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:i,children:y}),(0,R.jsxs)(`div`,{className:`pxd-dropzone`,"data-dragging":c||void 0,onDrop:e=>{e.preventDefault(),l(!1),b(e.dataTransfer.files)},onDragOver:e=>{e.preventDefault(),c||l(!0)},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||l(!1)},children:[(0,R.jsx)(`input`,{id:r,className:`pxd-dropzone-input`,type:`file`,accept:f.length?f.join(`,`):void 0,multiple:m,required:e.required&&d.length===0,"aria-describedby":Mg(y&&i,o&&a),"aria-invalid":o?!0:void 0,onChange:e=>{b(e.target.files),e.target.value=``},...$(e)}),(0,R.jsx)(`span`,{className:`pxd-dropzone-icon`,"aria-hidden":`true`,children:(0,R.jsx)(Q,{name:`file`,size:24})}),(0,R.jsxs)(`span`,{className:`pxd-dropzone-text`,children:[(0,R.jsx)(`span`,{className:`pxd-dropzone-action`,children:m?`Choose files`:`Choose a file`}),(0,R.jsx)(`span`,{className:`pxd-dropzone-hint`,children:m?`or drop them here`:`or drop it here`})]})]}),o&&(0,R.jsx)(`p`,{className:`pxd-field-error`,id:a,role:`alert`,children:o}),d.length>0&&(0,R.jsx)(`ul`,{className:`pxd-file-list`,children:d.map((e,t)=>(0,R.jsxs)(`li`,{className:`pxd-file-item`,children:[(0,R.jsx)(`span`,{className:`pxd-file-icon`,"aria-hidden":`true`,children:(0,R.jsx)(Q,{name:`file`,size:18})}),(0,R.jsxs)(`span`,{className:`pxd-file-text`,children:[(0,R.jsx)(`span`,{className:`pxd-file-name`,children:e.name}),(0,R.jsx)(`span`,{className:`pxd-file-size`,children:Pg(e.size,n.locale)}),typeof e.progress==`number`&&e.progress<1&&(0,R.jsx)(`progress`,{className:`pxd-file-progress`,value:e.progress,max:1,"aria-label":`Uploading ${e.name}`})]}),(0,R.jsx)(`button`,{type:`button`,className:`pxd-file-remove`,"aria-label":`Remove ${e.name}`,onClick:()=>x(t),children:(0,R.jsx)(Q,{name:`close`,size:18})})]},`${e.name}-${e.size}-${t}`))})]})}var Bg=(e,t,n)=>Math.min(n,Math.max(t,e)),Vg=e=>Bg(Math.round(e),0,255).toString(16).padStart(2,`0`),Hg=e=>e===void 0?1:Bg(e.endsWith(`%`)?parseFloat(e)/100:parseFloat(e),0,1),Ug=e=>e.endsWith(`%`)?parseFloat(e)/100*255:parseFloat(e);function Wg(e,t,n){let r=(e%360+360)%360/360;if(t===0)return[n*255,n*255,n*255];let i=n<.5?n*(1+t):n+t-n*t,a=2*n-i,o=e=>(e<0&&(e+=1),e>1&&--e,e<1/6?a+(i-a)*6*e:e<1/2?i:e<2/3?a+(i-a)*(2/3-e)*6:a);return[o(r+1/3)*255,o(r)*255,o(r-1/3)*255]}function Gg(e,t,n){let r=e/255,i=t/255,a=n/255,o=Math.max(r,i,a),s=Math.min(r,i,a),c=(o+s)/2;if(o===s)return[0,0,c];let l=o-s,u=c>.5?l/(2-o-s):l/(o+s),d=o===r?(i-a)/l+(i<a?6:0):o===i?(a-r)/l+2:(r-i)/l+4;return d/=6,[d*360,u,c]}function Kg(e){if(typeof e!=`string`)return null;let t=e.trim(),n=/^#([0-9a-f]{3,8})$/i.exec(t);if(n){let e=n[1];if(e.length===3||e.length===4){let[t,n,r,i]=e.split(``).map(e=>parseInt(e+e,16));return{r:t,g:n,b:r,a:e.length===4?i/255:1}}if(e.length===6||e.length===8){let t=t=>parseInt(e.slice(t,t+2),16);return{r:t(0),g:t(2),b:t(4),a:e.length===8?t(6)/255:1}}return null}let r=/^(rgba?|hsla?)\(\s*([^)]+?)\s*\)$/i.exec(t);if(!r)return null;let i=r[2].split(/\s*[,/]\s*|\s+/).filter(Boolean);if(i.length<3||i.length>4)return null;let a=Hg(i[3]);if(Number.isNaN(a))return null;if(r[1].toLowerCase().startsWith(`rgb`)){let[e,t,n]=i.slice(0,3).map(Ug);return[e,t,n].some(Number.isNaN)?null:{r:Bg(e,0,255),g:Bg(t,0,255),b:Bg(n,0,255),a}}let o=parseFloat(i[0]),s=parseFloat(i[1])/100,c=parseFloat(i[2])/100;if([o,s,c].some(Number.isNaN))return null;let[l,u,d]=Wg(o,Bg(s,0,1),Bg(c,0,1));return{r:l,g:u,b:d,a}}function qg(e,t,n){let r=n?Math.round(e.a*100)/100:1,i=Math.round(e.r),a=Math.round(e.g),o=Math.round(e.b);if(t===`rgb`)return r<1?`rgba(${i}, ${a}, ${o}, ${r})`:`rgb(${i}, ${a}, ${o})`;if(t===`hsl`){let[e,t,n]=Gg(i,a,o),s=Math.round(e),c=Math.round(t*100),l=Math.round(n*100);return r<1?`hsla(${s}, ${c}%, ${l}%, ${r})`:`hsl(${s}, ${c}%, ${l}%)`}return`#${Vg(i)}${Vg(a)}${Vg(o)}${r<1?Vg(r*255):``}`}var Jg=e=>e?`#${Vg(e.r)}${Vg(e.g)}${Vg(e.b)}`:`#000000`,Yg=`__other`;function Xg({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=(0,v.useId)(),a=(0,v.useId)(),o=(0,v.useId)(),s=(0,v.useId)(),c=e.format??`hex`,l=!!e.alpha,u=t.text(e.label),d=e.help===void 0?void 0:t.text(e.help),f=t.value(e.value),p=f==null?``:String(f),m=Kg(p),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)(!1),b=$(e),x=e.swatches?Fh({...e,options:e.swatches},n.data,t.scope,t.text):[],S=x.length>0,C=n=>t.write(e.value,qg(n,c,l)),w=e=>{g(e);let t=Kg(e);t&&C(t)},T=(e,t)=>!!(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)&&(!l||Math.abs(e.a-t.a)<.005)),E=x.findIndex(e=>m?T(Kg(e.value),m):String(e.value)===p&&p!==``),D=_?Yg:E>=0?String(E):p?Yg:``,O=!S||D===Yg,k=(0,R.jsxs)(`div`,{className:`pxd-color-picker`,children:[(0,R.jsx)(`input`,{id:a,className:`pxd-color-native`,type:`color`,value:Jg(m),"aria-label":`${u}: pick`,"aria-describedby":Mg(d&&i),onChange:e=>{let t=Kg(e.target.value);t&&(g(null),C({...t,a:m?.a??1}))}}),(0,R.jsx)(`input`,{id:o,className:`pxd-input pxd-input-mono pxd-color-text`,type:`text`,inputMode:`text`,autoComplete:`off`,spellCheck:!1,placeholder:c===`hex`?`#000000`:c===`rgb`?`rgb(0, 0, 0)`:`hsl(0, 0%, 0%)`,value:h??p,"aria-label":`${u}: value`,"aria-describedby":Mg(d&&i),"aria-invalid":h!==null&&h!==``&&!Kg(h)||void 0,required:!S&&e.required,onChange:e=>w(e.target.value),onBlur:()=>g(null)}),l&&(0,R.jsxs)(`label`,{className:`pxd-color-alpha`,htmlFor:s,children:[(0,R.jsx)(`span`,{className:`pxd-color-alpha-label`,children:`Opacity`}),(0,R.jsx)(`input`,{id:s,type:`range`,min:0,max:100,step:1,value:Math.round((m?.a??1)*100),disabled:!m,"aria-valuetext":`${Math.round((m?.a??1)*100)}%`,onChange:e=>{m&&(g(null),C({...m,a:Number(e.target.value)/100}))}}),(0,R.jsxs)(`output`,{className:`pxd-color-alpha-value`,htmlFor:s,"aria-hidden":`true`,children:[Math.round((m?.a??1)*100),`%`]})]})]});return S?(0,R.jsxs)(`div`,{className:`pxd-field pxd-color`,...b,children:[(0,R.jsxs)(`div`,{className:`pxd-field-label`,id:r,children:[u,e.required&&(0,R.jsx)(Ag,{})]}),d&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:i,children:d}),(0,R.jsxs)(qf,{className:`pxd-swatches`,"aria-labelledby":r,"aria-describedby":Mg(d&&i),"aria-required":e.required||void 0,value:D,orientation:`horizontal`,onValueChange:n=>{if(n===Yg)return y(!0);y(!1),g(null);let r=x[Number(n)],i=Kg(r.value);t.write(e.value,i?qg(i,c,l):r.value)},children:[x.map((e,t)=>(0,R.jsxs)(Qf,{value:String(t),className:`pxd-swatch`,title:e.label,children:[(0,R.jsx)(`span`,{className:`pxd-swatch-color`,style:{background:String(e.value)},"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`pxd-swatch-name`,children:e.label})]},String(t))),(0,R.jsxs)(Qf,{value:Yg,className:`pxd-swatch pxd-swatch-other`,title:`Other`,children:[(0,R.jsx)(`span`,{className:`pxd-swatch-color`,style:D===Yg&&m?{background:p}:void 0,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`pxd-swatch-name`,children:`Other`})]})]}),O&&k]}):(0,R.jsxs)(`div`,{className:`pxd-field pxd-color`,role:`group`,"aria-labelledby":r,"aria-describedby":Mg(d&&i),...b,children:[(0,R.jsxs)(`div`,{className:`pxd-field-label`,id:r,children:[u,e.required&&(0,R.jsx)(Ag,{})]}),d&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:i,children:d}),k]})}var Zg=(e,t)=>Array.from({length:t},(t,n)=>e[n]??``);function Qg({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=(0,v.useId)(),a=Bg(Number(e.length)||6,4,12),o=(e.kind??`numeric`)===`numeric`,s=e.required??!0,c=t.text(e.label),l=e.help===void 0?void 0:t.text(e.help),u=t.value(e.value),d=u==null?``:String(u),[f,p]=(0,v.useState)(()=>Zg(d,a)),[m,h]=(0,v.useState)(d);d!==m&&(h(d),d!==f.join(``)&&p(Zg(d,a)));let[g,_]=(0,v.useState)(null),y=(0,v.useRef)([]),b=$(e),x=e=>e.replace(o?/[^0-9]/g:/[^0-9a-zA-Z]/g,``),S=e=>y.current[Bg(e,0,a-1)]?.focus(),C=r=>{p(r);let i=r.join(``);h(i),t.write(e.value,i),e.action&&r.every(Boolean)&&i!==g&&(_(i),jg(n,t,e,i))},w=(e,t)=>{let n=x(t);if(!n)return;let r=[...f],i=e;for(let e of n){if(i>=a)break;r[i++]=e}C(r),S(i)},T=(e,t)=>{let n=f[e],r=t.target.value;if(n&&r.length>1&&(r=r.startsWith(n)?r.slice(n.length):r.endsWith(n)?r.slice(0,-n.length):r),r===``){let t=[...f];return t[e]=``,C(t)}w(x(r).length>=a?0:e,r)},E=(e,t)=>{if(t.key===`Backspace`&&!f[e]&&e>0){t.preventDefault();let n=[...f];n[e-1]=``,C(n),S(e-1)}else t.key===`ArrowLeft`?(t.preventDefault(),S(e-1)):t.key===`ArrowRight`&&(t.preventDefault(),S(e+1))},D=(e,t)=>{t.preventDefault();let n=t.clipboardData.getData(`text`);w(x(n).length>=a?0:e,n)},O=a>6?a%4==0?4:3:a,k=[];for(let e=0;e<a;e+=O)k.push(Array.from({length:Math.min(O,a-e)},(t,n)=>e+n));return(0,R.jsxs)(`div`,{className:`pxd-field pxd-code`,role:`group`,"aria-labelledby":r,"aria-describedby":Mg(l&&i),...b,children:[(0,R.jsxs)(`div`,{className:`pxd-field-label`,id:r,children:[c,s&&(0,R.jsx)(Ag,{})]}),l&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:i,children:l}),(0,R.jsx)(`div`,{className:`pxd-code-boxes`,children:k.map((e,t)=>(0,R.jsx)(`div`,{className:`pxd-code-group`,children:e.map(e=>(0,R.jsx)(`input`,{ref:t=>{y.current[e]=t},className:`pxd-code-box`,type:`text`,inputMode:o?`numeric`:`text`,pattern:o?`[0-9]*`:`[0-9A-Za-z]*`,autoComplete:e===0?`one-time-code`:`off`,autoCapitalize:o?void 0:`characters`,spellCheck:!1,"aria-label":`Digit ${e+1} of ${a}`,value:f[e],"data-filled":f[e]?``:void 0,required:s,onFocus:e=>e.target.select(),onChange:t=>T(e,t),onKeyDown:t=>E(e,t),onPaste:t=>D(e,t)},e))},t))})]})}var $g=200,e_=10,t_=40,n_=500,r_=e=>e==null?``:String(e);function i_({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=(0,v.useRef)(null),a=(0,v.useRef)(null),o=w(e.items.path,t.scope),s=O(E(n.data,o)),c=e.selection??`none`,l=c!==`none`&&!!e.selected,u=e.expanded?O(t.value(e.expanded)):void 0,[d,f]=(0,v.useState)(null),p=(0,v.useMemo)(()=>u?new Set(u):d,[u,d]),m=(0,v.useCallback)((e,t)=>p?p.has(e):t===1,[p]),h=l?t.value(e.selected):void 0,g=e=>Array.isArray(h)?h.includes(e):h!==void 0&&h===e,_=(0,v.useCallback)(t=>{let r=r_(E(n.data,w(e.labelPath,t))),i=(e.valuePath?E(n.data,w(e.valuePath,t)):r)??(r||t.pointer),a=e.detailPath?E(n.data,w(e.detailPath,t)):void 0;return{label:r,value:i,detail:a==null||a===``?void 0:String(a),children:O(E(n.data,w(e.childrenPath,t)))}},[n.data,e.labelPath,e.valuePath,e.detailPath,e.childrenPath]),{rows:y,indexByKey:b,topValues:x}=(0,v.useMemo)(()=>{let t=[],n=new Map,r=[],i=(a,o,s,c)=>{a.forEach((l,u)=>{let d={pointer:T(o,u)},{label:f,value:p,detail:h,children:g}=_(d);s===1&&r.push(p);let v=g.length>0,y=v&&m(p,s),b=t.length;n.set(d.pointer,b),t.push({key:d.pointer,scope:d,level:s,setsize:a.length,posinset:u+1,label:f,value:p,detail:h,hasChildren:v,expanded:y,parent:c}),y&&i(g,w(e.childrenPath,d),s+1,b)})};return i(s,o,1,-1),{rows:t,indexByKey:n,topValues:r}},[s,o,_,m,e.childrenPath]),[S,C]=(0,v.useState)(null),D=(S===null?void 0:b.get(S))??0,k=(0,v.useRef)(null),A=y.length>$g,[j,ee]=(0,v.useState)(t_),[te,ne]=(0,v.useState)(480),[re,ie]=(0,v.useState)(0),ae=A?Math.max(0,Math.floor(re/j)-e_):0,oe=A?Math.min(y.length,Math.ceil((re+te)/j)+e_):y.length;(0,v.useLayoutEffect)(()=>{if(!A)return;let e=a.current,t=i.current?.querySelector(`.pxd-tree-item`);if(t&&t.offsetHeight>0&&ee(t.offsetHeight),!e)return;let n=()=>ne(e.clientHeight||480);if(n(),typeof ResizeObserver>`u`)return;let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[A]);let se=e=>{A&&ie(e.currentTarget.scrollTop)},ce=e=>{if(!y.length)return;let t=Math.max(0,Math.min(y.length-1,e));C(y[t].key);let n=i.current?.querySelector(`[data-index="${t}"]`);if(n){n.focus();return}k.current=t;let r=a.current;if(A&&r){let e=Math.max(0,t*j-(te-j)/2);r.scrollTop=e,ie(e)}};(0,v.useEffect)(()=>{if(k.current===null)return;let e=i.current?.querySelector(`[data-index="${k.current}"]`);e&&(k.current=null,e.focus())});let le=(n,r)=>{if(e.expanded){let i=u??[],a=r?[...i,...n.filter(e=>!i.includes(e))]:i.filter(e=>!n.includes(e));t.write(e.expanded,a);return}f(e=>{let t=new Set(e??x);for(let e of n)r?t.add(e):t.delete(e);return t})},F=e=>le([e.value],!e.expanded),ue=n=>{if(!l)return;if(c===`single`){t.write(e.selected,n.value);return}let r=Array.isArray(h)?h:[];t.write(e.selected,r.includes(n.value)?r.filter(e=>e!==n.value):[...r,n.value])},de=t=>{ue(t),e.action&&n.dispatch(e.action,t.scope,e.id)},fe=(0,v.useRef)({buffer:``,at:0}),pe=e=>{let t=Date.now(),n=fe.current;n.buffer=t-n.at<n_?n.buffer+e.toLowerCase():e.toLowerCase(),n.at=t;let r=e=>{for(let t=1;t<=y.length;t++){let n=(D+t)%y.length;if(y[n].label.toLowerCase().startsWith(e))return n}return-1},i=n.buffer.length>1&&[...n.buffer].every(e=>e===n.buffer[0])?r(n.buffer[0]):r(n.buffer);i<0&&n.buffer.length>1&&(i=r(n.buffer[0])),i>=0&&ce(i)},me=e=>{let t=y[D];if(!t)return;let n=!0;switch(e.key){case`ArrowDown`:ce(D+1);break;case`ArrowUp`:ce(D-1);break;case`ArrowRight`:t.hasChildren&&!t.expanded?F(t):t.expanded&&ce(D+1);break;case`ArrowLeft`:t.expanded?F(t):t.parent>=0&&ce(t.parent);break;case`Home`:ce(0);break;case`End`:ce(y.length-1);break;case`Enter`:de(t);break;case` `:ue(t);break;case`*`:le(y.filter(e=>e.parent===t.parent&&e.hasChildren).map(e=>e.value),!0);break;default:e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey?pe(e.key):n=!1}n&&(e.preventDefault(),e.stopPropagation())},I=t.text(e.label),L=A?{paddingTop:ae*j,paddingBottom:(y.length-oe)*j}:void 0,he=(0,R.jsx)(`ul`,{ref:i,role:`tree`,className:`pxd-tree-list`,"aria-labelledby":r,"aria-multiselectable":c===`multiple`||void 0,style:L,onKeyDown:me,children:y.slice(ae,oe).map((t,r)=>{let i=ae+r,a=l?g(t.value):void 0;return(0,R.jsx)(`li`,{role:`treeitem`,className:`pxd-tree-item${a?` pxd-tree-item-selected`:``}`,style:{"--polyxd-tree-depth":t.level-1},"data-index":i,tabIndex:i===D?0:-1,"aria-level":t.level,"aria-setsize":t.setsize,"aria-posinset":t.posinset,"aria-expanded":t.hasChildren?t.expanded:void 0,"aria-selected":a,onFocus:e=>{e.target===e.currentTarget&&C(t.key)},onClick:e=>{e.stopPropagation(),ce(i),l?ue(t):t.hasChildren&&F(t)},onDoubleClick:r=>{r.stopPropagation(),e.action?n.dispatch(e.action,t.scope,e.id):t.hasChildren&&F(t)},children:(0,R.jsx)(M.Provider,{value:t.scope,children:(0,R.jsxs)(`div`,{className:`pxd-tree-row`,children:[t.hasChildren?(0,R.jsx)(`button`,{type:`button`,className:`pxd-tree-expander${t.expanded?` pxd-tree-expander-open`:``}`,tabIndex:-1,"aria-hidden":`true`,onClick:e=>{e.stopPropagation(),ce(i),F(t)},onDoubleClick:e=>e.stopPropagation(),children:(0,R.jsx)(Q,{name:`chevronRight`,size:16})}):(0,R.jsx)(`span`,{className:`pxd-tree-expander pxd-tree-expander-leaf`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`pxd-tree-text`,children:t.label}),t.detail!==void 0&&(0,R.jsx)(`span`,{className:`pxd-tree-detail`,children:t.detail})]})})},t.key)})});return(0,R.jsxs)(`div`,{className:`pxd-tree`,...$(e),children:[(0,R.jsx)(`div`,{className:`pxd-tree-caption`,id:r,children:I}),A?(0,R.jsx)(`div`,{ref:a,className:`pxd-tree-viewport`,onScroll:se,children:he}):he]})}var a_={Section:Am,Group:jm,Card:Mm,Disclosure:Pm,Views:Fm,Navigation:fg,Text:Jm,Metric:Ym,DetailList:Xm,Collection:$m,Table:Hm,Chart:yh,Media:eh,Status:dh,TextInput:Th,Choice:Rh,Toggle:zh,DateInput:Vh,RangeInput:Hh,Form:Gh,Action:$h,ActionBar:og,Steps:tg,Confirm:ng,Comparison:rg,FilterPanel:lg,Tag:mg,Identity:gg,Progress:vg,Rating:Sg,Code:wg,Tree:i_,ActionMenu:Dg,Panel:kg,FileInput:zg,ColorInput:Xg,CodeInput:Qg};function o_({document:e,data:t,onAction:n,onDataChange:r,onDismiss:i,theme:a,mode:o,density:s,disclosure:c=`progressive`,locale:l=`en-GB`,resolveMedia:u,components:d,className:f}){let[p,m]=(0,v.useState)(()=>t??e.data??{}),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)(null),b=(0,v.useMemo)(()=>new Map(e.components.map(e=>[e.id,e])),[e]),x=(0,v.useMemo)(()=>({...a_,...d}),[d]),S={doc:e,byId:b,data:p,setValue:(0,v.useCallback)((e,t)=>m(n=>{let i=D(n,e,t);return r?.(i),i}),[r]),dispatch:(0,v.useCallback)((e,t,r)=>{if(!e)return;let{name:a,context:o}=e.event;if(a===`ui.dismiss`)return i?.();n?.({name:a,context:A(o,p,t),source:r})},[p,n,i]),locale:l,resolveMedia:u,portal:h,root:_,components:x,disclosure:c},C=b.get(e.root)?.component===`Confirm`,w=e.components.find(e=>e.component===`Navigation`&&(!e.kind||e.kind===`main`));return(0,R.jsx)(ne.Provider,{value:S,children:(0,R.jsxs)(`div`,{ref:y,className:[`pxd-surface`,e.surface.presentation===`panel`?`pxd-surface-panel`:null,w?`pxd-surface-with-nav`:null,f].filter(Boolean).join(` `),"data-pxd-theme":a,"data-pxd-mode":o,"data-pxd-density":s,"data-pxd-surface":e.surface.id,lang:l,children:[w&&(0,R.jsx)(c_,{id:w.id}),(0,R.jsxs)(`div`,{className:`pxd-surface-main`,children:[!C&&(0,R.jsx)(s_,{}),(0,R.jsx)(c_,{id:e.root})]}),(0,R.jsx)(`div`,{ref:g,className:`pxd-portal`})]})})}function s_(){let e=N(),{title:t,subtitle:n,breadcrumbs:r,badge:i,avatar:a,actions:o}=e.doc.surface,s=t=>String(k(t,e.data,b)??``);return!n&&!r&&!i&&!a&&!o?(0,R.jsx)(`h1`,{className:`pxd-surface-title`,children:t}):(0,R.jsxs)(`header`,{className:`pxd-page-header`,children:[r&&(0,R.jsx)(`nav`,{className:`pxd-breadcrumbs`,"aria-label":`Breadcrumb`,children:(0,R.jsx)(`ol`,{children:r.map((t,n)=>(0,R.jsx)(`li`,{children:t.action?(0,R.jsx)(`button`,{type:`button`,className:`pxd-link`,onClick:()=>e.dispatch(t.action,b,e.doc.surface.id),children:s(t.label)}):s(t.label)},n))})}),(0,R.jsxs)(`div`,{className:`pxd-page-header-main`,children:[a!==void 0&&(0,R.jsx)(Im,{value:s(a),name:t,size:48}),(0,R.jsxs)(`div`,{className:`pxd-page-header-text`,children:[(0,R.jsxs)(`h1`,{className:`pxd-surface-title`,children:[t,i&&(0,R.jsx)(`span`,{className:`pxd-badge pxd-tone-${i.tone??`neutral`}`,children:s(i.text)})]}),n&&(0,R.jsx)(`p`,{className:`pxd-surface-subtitle`,children:n})]}),o&&(0,R.jsx)(`div`,{className:`pxd-page-header-actions`,children:(0,R.jsx)(c_,{id:o})})]})]})}function c_({id:e,scope:t}){let n=N(),r=(0,v.useContext)(M),i=n.byId.get(e);if(!i)return null;let a=t??r;if(i.visible!==void 0&&k(i.visible,n.data,a)===!1)return null;let o=n.components[i.component],s=o?(0,R.jsx)(o,{node:i}):(0,R.jsx)(l_,{node:i});return t?(0,R.jsx)(M.Provider,{value:t,children:s}):s}function l_({node:e}){return(0,R.jsxs)(`div`,{className:`pxd-unknown`,role:`note`,children:[`Unsupported component “`,e.component,`”`]})}function $(e){let t=N(),n=(0,v.useContext)(M),r=e.accessibility,i={"data-pxd-id":e.id,"data-pxd-component":e.component};if(!r)return i;let a=e=>{let r=k(e,t.data,n);return r===void 0?void 0:String(r)};return{...i,"aria-label":r.label===void 0?void 0:a(r.label),"aria-description":r.description===void 0?void 0:a(r.description),"aria-live":r.live,"aria-hidden":r.hidden||void 0}}window.__pxdActions=[],window.__pxdDismissed=0;var{document:u_,theme:d_,mode:f_}=window.__PXD__;(0,y.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(o_,{document:u_,theme:d_,mode:f_,onAction:e=>window.__pxdActions.push(e),onDismiss:()=>window.__pxdDismissed+=1,resolveMedia: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>${e}</title></svg>`)}`})),requestAnimationFrame(()=>requestAnimationFrame(()=>window.__pxdReady=!0));
56
+ `)){let e=/^(-|\d+\.)\s+(.*)$/.exec(r);if(e){let r=e[1]===`-`?`ul`:`ol`;(!n||n.tagName.toLowerCase()!==r)&&(n=document.createElement(r),t.push(n));let i=document.createElement(`li`);i.append(...jh(e[2])),n.append(i);continue}n=null;let i=document.createElement(`div`);r?i.append(...jh(r)):i.append(document.createElement(`br`)),t.push(i)}return t}function Nh({node:e,field:t,common:n}){let r=P(),i=(0,v.useRef)(null),a=String(r.value(e.value)??``);(0,v.useEffect)(()=>{let e=i.current;e&&!e.dataset.ready&&(e.dataset.ready=`1`,e.replaceChildren(...Mh(a)))},[a]);let o=()=>i.current&&r.write(e.value,Ah(i.current).replace(/\n+$/,``)),s=e=>t=>{t.preventDefault(),i.current?.focus(),document.execCommand(e),o()},{id:c,className:l,required:u,autoComplete:d,...f}=n;return(0,R.jsx)(Ch,{...t,children:(0,R.jsxs)(`div`,{className:`pxd-richtext`,children:[(0,R.jsxs)(`div`,{className:`pxd-richtext-toolbar`,role:`toolbar`,"aria-label":`Formatting`,children:[(0,R.jsx)(`button`,{type:`button`,className:`pxd-richtext-control`,"aria-label":`Bold`,onMouseDown:s(`bold`),children:(0,R.jsx)(`strong`,{children:`B`})}),(0,R.jsx)(`button`,{type:`button`,className:`pxd-richtext-control`,"aria-label":`Italic`,onMouseDown:s(`italic`),children:(0,R.jsx)(`em`,{children:`I`})}),(0,R.jsx)(`button`,{type:`button`,className:`pxd-richtext-control`,"aria-label":`Bulleted list`,onMouseDown:s(`insertUnorderedList`),children:(0,R.jsx)(Q,{name:`menu`,size:16})})]}),(0,R.jsx)(`div`,{...f,id:c,ref:i,className:`pxd-input pxd-richtext-area`,contentEditable:!0,role:`textbox`,"aria-multiline":`true`,"aria-label":t.label,onInput:o,onBlur:o})]})})}function Ph({node:e,field:t,common:n}){let r=P(),i=String(r.value(e.value)??``),[a,o]=(0,v.useState)(null),s=()=>{a!==null&&r.write(e.value,a),o(null)};return a===null?(0,R.jsxs)(`div`,{className:`pxd-inline-edit`,children:[(0,R.jsx)(`span`,{className:`pxd-field-label`,children:t.label}),(0,R.jsxs)(`button`,{type:`button`,className:`pxd-inline-value`,"aria-label":`Edit ${t.label}`,onClick:()=>o(i),children:[(0,R.jsx)(`span`,{className:i?void 0:`pxd-inline-empty`,children:i||`Not set`}),(0,R.jsx)(`span`,{className:`pxd-inline-hint`,"aria-hidden":`true`,children:`Edit`})]})]}):(0,R.jsx)(Ch,{...t,children:(0,R.jsx)(`input`,{...n,type:`text`,autoFocus:!0,value:a,onChange:e=>o(e.target.value),onBlur:s,onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),s()):e.key===`Escape`&&o(null)}})})}function Fh(e,t,n,r){let i=e.options;if(Array.isArray(i))return i.map(e=>({value:e.value,label:r(e.label),description:e.description===void 0?void 0:r(e.description)}));let a=w(i.path,n);return O(E(t,a)).map((e,n)=>{let r={pointer:T(a,n)},o=e=>e?E(t,w(e,r)):void 0;return{value:o(i.valuePath),label:String(o(i.labelPath)??``),description:i.descriptionPath&&String(o(i.descriptionPath)??``)||void 0,avatar:i.avatarPath||i.imagePath?o(i.avatarPath??i.imagePath)??``:void 0,recent:i.recentPath?!!o(i.recentPath):!1}})}function Ih(e){let t=P();return Fh(e,N().data,t.scope,t.text)}function Lh({id:e,label:t,description:n}){return(0,R.jsxs)(`div`,{className:`pxd-option-text`,children:[(0,R.jsx)(`label`,{htmlFor:e,children:t}),n&&(0,R.jsx)(`span`,{className:`pxd-option-description`,id:`${e}-desc`,children:n})]})}function Rh({node:e}){let t=P(),n=(0,v.useId)(),r=(0,v.useId)(),i=Ih(e),[a,o]=(0,v.useState)(``),s=e.mode===`multiple`,c=t.value(e.value),l=e=>JSON.stringify(e),u=e=>`${n}-${encodeURIComponent(l(e)).replace(/%/g,`_`)}`,d=e.help===void 0?void 0:t.text(e.help),f=i.some(e=>e.avatar!==void 0),p=i.length>10||f&&i.length>6,m=e=>!a||`${e.label} ${e.description??``}`.toLowerCase().includes(a.toLowerCase()),h=!f&&i.length<=6&&i.every(e=>e.label.length<=24&&!e.description),g=$(e),_=t.text(e.label),y=(0,R.jsxs)(`div`,{className:`pxd-field-label`,id:n,children:[_,e.required&&(0,R.jsx)(Sh,{})]}),b=p&&(0,R.jsxs)(`div`,{className:`pxd-search pxd-search-compact`,children:[(0,R.jsx)(Q,{name:`search`}),(0,R.jsx)(`input`,{type:`search`,className:`pxd-search-input`,placeholder:f?`Search by name`:`Filter options`,"aria-label":`Search ${_}`,value:a,onChange:e=>o(e.target.value)})]});if(s){let o=Array.isArray(c)?c:[],s=e=>o.some(t=>l(t)===l(e)),v=n=>t.write(e.value,s(n)?o.filter(e=>l(e)!==l(n)):[...o,n]);if(h)return(0,R.jsxs)(`div`,{className:`pxd-field pxd-choice`,role:`group`,"aria-labelledby":n,"aria-describedby":d?r:void 0,...g,children:[y,d&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:r,children:d}),(0,R.jsx)(`div`,{className:`pxd-chips`,children:i.map(e=>(0,R.jsxs)(pa,{className:`pxd-chip`,checked:s(e.value),onCheckedChange:()=>v(e.value),children:[(0,R.jsx)(ha,{className:`pxd-chip-check`,children:(0,R.jsx)(Q,{name:`check`,size:18})}),e.label]},l(e.value)))})]});if(f){let e=a?[]:i.filter(e=>e.recent),t=i.filter(e=>a?m(e):!e.recent);return(0,R.jsxs)(`fieldset`,{className:`pxd-field pxd-choice pxd-people`,"aria-describedby":d?r:void 0,...g,children:[(0,R.jsx)(`legend`,{className:`pxd-field-label`,id:n,children:_}),d&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:r,children:d}),b,(0,R.jsxs)(`div`,{className:`pxd-people-group`,children:[e.length>0&&(0,R.jsx)(`div`,{className:`pxd-people-recent`,children:e.map(e=>(0,R.jsxs)(pa,{className:`pxd-person-tile`,checked:s(e.value),onCheckedChange:()=>v(e.value),"aria-label":e.label,children:[(0,R.jsxs)(`span`,{className:`pxd-person-face`,children:[(0,R.jsx)(Im,{value:e.avatar,name:e.label,size:56}),(0,R.jsx)(ha,{className:`pxd-person-tick`,children:(0,R.jsx)(Q,{name:`check`,size:14})})]}),(0,R.jsx)(`span`,{className:`pxd-person-name`,"aria-hidden":`true`,children:e.label.split(` `)[0]})]},l(e.value)))}),(0,R.jsx)(`div`,{className:`pxd-people-list`,children:t.map(e=>{let t=u(e.value);return(0,R.jsxs)(pa,{id:t,className:`pxd-person-row`,checked:s(e.value),onCheckedChange:()=>v(e.value),"aria-labelledby":`${t}-name`,"aria-describedby":e.description?`${t}-desc`:void 0,children:[(0,R.jsx)(Im,{value:e.avatar,name:e.label}),(0,R.jsxs)(`span`,{className:`pxd-person-text`,children:[(0,R.jsx)(`span`,{id:`${t}-name`,children:e.label}),e.description&&(0,R.jsx)(`span`,{className:`pxd-option-description`,id:`${t}-desc`,children:e.description})]}),(0,R.jsx)(ha,{className:`pxd-person-check`,children:(0,R.jsx)(Q,{name:`check`})})]},l(e.value))})})]})]})}return(0,R.jsxs)(`fieldset`,{className:`pxd-field pxd-choice`,"aria-describedby":d?r:void 0,...g,children:[(0,R.jsx)(`legend`,{className:`pxd-field-label`,id:n,children:_}),d&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:r,children:d}),b,(0,R.jsx)(`div`,{className:`pxd-choice-list${p?` pxd-choice-scroll`:``}`,children:i.filter(m).map(e=>{let t=u(e.value);return(0,R.jsxs)(`div`,{className:`pxd-choice-option`,children:[e.avatar!==void 0&&(0,R.jsx)(Im,{value:e.avatar,name:e.label,size:32}),(0,R.jsx)(pa,{id:t,className:`pxd-checkbox`,checked:s(e.value),onCheckedChange:()=>v(e.value),"aria-describedby":e.description?`${t}-desc`:void 0,children:(0,R.jsx)(ha,{className:`pxd-checkbox-indicator`,children:`✓`})}),(0,R.jsx)(Lh,{id:t,label:e.label,description:e.description})]},l(e.value))})})]})}let x=c==null?``:l(c),S=n=>t.write(e.value,i.find(e=>l(e.value)===n)?.value);if(h)return(0,R.jsxs)(`div`,{className:`pxd-field pxd-choice`,...g,children:[y,d&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:r,children:d}),(0,R.jsx)(qf,{className:`pxd-chips`,"aria-labelledby":n,"aria-describedby":d?r:void 0,"aria-required":e.required||void 0,value:x,onValueChange:S,orientation:`horizontal`,children:i.map(e=>(0,R.jsxs)(Qf,{value:l(e.value),className:`pxd-chip`,children:[(0,R.jsx)(ep,{className:`pxd-chip-check`,children:(0,R.jsx)(Q,{name:`check`,size:18})}),e.label]},l(e.value)))})]});if(f){let t=a?[]:i.filter(e=>e.recent),o=i.filter(e=>a?m(e):!e.recent);return(0,R.jsxs)(`div`,{className:`pxd-field pxd-choice pxd-people`,...g,children:[y,d&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:r,children:d}),b,(0,R.jsxs)(qf,{"aria-labelledby":n,"aria-describedby":d?r:void 0,"aria-required":e.required||void 0,value:x,onValueChange:S,className:`pxd-people-group`,children:[t.length>0&&(0,R.jsx)(`div`,{className:`pxd-people-recent`,role:`presentation`,children:t.map(e=>(0,R.jsxs)(Qf,{value:l(e.value),className:`pxd-person-tile`,"aria-label":e.label,children:[(0,R.jsx)(Im,{value:e.avatar,name:e.label,size:56}),(0,R.jsx)(`span`,{className:`pxd-person-name`,"aria-hidden":`true`,children:e.label.split(` `)[0]})]},l(e.value)))}),(0,R.jsx)(`div`,{className:`pxd-people-list`,role:`presentation`,children:o.map(e=>{let t=u(e.value);return(0,R.jsxs)(Qf,{id:t,value:l(e.value),className:`pxd-person-row`,"aria-labelledby":`${t}-name`,"aria-describedby":e.description?`${t}-desc`:void 0,children:[(0,R.jsx)(Im,{value:e.avatar,name:e.label}),(0,R.jsxs)(`span`,{className:`pxd-person-text`,children:[(0,R.jsx)(`span`,{id:`${t}-name`,children:e.label}),e.description&&(0,R.jsx)(`span`,{className:`pxd-option-description`,id:`${t}-desc`,children:e.description})]}),(0,R.jsx)(ep,{className:`pxd-person-check`,children:(0,R.jsx)(Q,{name:`check`})})]},l(e.value))})})]})]})}return(0,R.jsxs)(`div`,{className:`pxd-field pxd-choice`,...g,children:[y,d&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:r,children:d}),b,(0,R.jsx)(qf,{className:`pxd-choice-list${p?` pxd-choice-scroll`:``}`,"aria-labelledby":n,"aria-describedby":d?r:void 0,"aria-required":e.required||void 0,value:x,onValueChange:S,orientation:`vertical`,children:i.filter(m).map(e=>{let t=u(e.value);return(0,R.jsxs)(`div`,{className:`pxd-choice-option`,children:[(0,R.jsx)(Qf,{id:t,value:l(e.value),className:`pxd-radio`,"aria-describedby":e.description?`${t}-desc`:void 0,children:(0,R.jsx)(ep,{className:`pxd-radio-indicator`})}),(0,R.jsx)(Lh,{id:t,label:e.label,description:e.description})]},l(e.value))})})]})}function zh({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=(0,v.useId)(),a=!!t.value(e.value),o=e.description===void 0?void 0:t.text(e.description),s=r=>{if(t.write(e.value,r),e.action){let i=t.pointer(e.value),a=Object.fromEntries(Object.entries(e.action.event.context??{}).map(([e,n])=>[e,n&&typeof n==`object`&&`path`in n&&w(n.path,t.scope)===i?r:t.value(n)]));n.dispatch({event:{name:e.action.event.name,context:a}},{pointer:``},e.id)}},c=$(e);return(0,R.jsxs)(`div`,{className:`pxd-toggle`,children:[e.action?(0,R.jsx)(em,{id:r,className:`pxd-switch`,checked:a,onCheckedChange:s,"aria-describedby":o?i:void 0,...c,children:(0,R.jsx)(nm,{className:`pxd-switch-thumb`})}):(0,R.jsx)(pa,{id:r,className:`pxd-checkbox`,checked:a,onCheckedChange:e=>s(e===!0),"aria-describedby":o?i:void 0,...c,children:(0,R.jsx)(ha,{className:`pxd-checkbox-indicator`,children:`✓`})}),(0,R.jsxs)(`div`,{className:`pxd-toggle-text`,children:[(0,R.jsx)(`label`,{htmlFor:r,className:`pxd-toggle-label`,children:t.text(e.label)}),o&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:i,children:o})]})]})}var Bh={date:`date`,time:`time`,datetime:`datetime-local`,month:`month`};function Vh({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=(0,v.useId)(),a=e.kind??`date`,o=e.help===void 0?void 0:t.text(e.help),s=t.value(e.value),c=e.min===void 0?void 0:t.text(e.min),l=e.max===void 0?void 0:t.text(e.max),u=$(e);if(e.multiple&&a!==`dateRange`){let d=Array.isArray(s)?s.map(String):[],f=e=>j(e,{type:a===`month`?`date`:a===`time`?`time`:a===`datetime`?`datetime`:`date`},n.locale),p=n=>n&&!d.includes(n)&&t.write(e.value,[...d,n].sort());return(0,R.jsxs)(`fieldset`,{className:`pxd-field pxd-date-multiple`,...u,children:[(0,R.jsxs)(`legend`,{className:`pxd-field-label`,children:[t.text(e.label),e.required&&(0,R.jsx)(Sh,{})]}),o&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:i,children:o}),d.length>0&&(0,R.jsx)(`ul`,{className:`pxd-tags-list`,"aria-label":`Chosen ${t.text(e.label)}`,children:d.map(n=>(0,R.jsxs)(`li`,{className:`pxd-tag-chip`,children:[a===`year`||a===`month`?n:f(n),(0,R.jsx)(`button`,{type:`button`,className:`pxd-tag-remove`,"aria-label":`Remove ${n}`,onClick:()=>t.write(e.value,d.filter(e=>e!==n)),children:(0,R.jsx)(Q,{name:`close`,size:14})})]},n))}),(0,R.jsxs)(`label`,{className:`pxd-date-add`,htmlFor:r,children:[(0,R.jsx)(`span`,{className:`pxd-sr-only`,children:`Add a date`}),a===`year`?(0,R.jsx)(`input`,{id:r,className:`pxd-input pxd-input-year`,inputMode:`numeric`,pattern:`[0-9]{4}`,maxLength:4,placeholder:`YYYY`,"aria-describedby":o?i:void 0,onKeyDown:e=>e.key===`Enter`&&(e.preventDefault(),p(e.currentTarget.value),e.currentTarget.value=``),onBlur:e=>(p(e.currentTarget.value),e.currentTarget.value=``)}):(0,R.jsx)(`input`,{id:r,className:`pxd-input pxd-input-date`,type:Bh[a],min:c,max:l,"aria-describedby":o?i:void 0,onChange:e=>(p(e.target.value),e.target.value=``)})]})]})}if(a===`year`)return(0,R.jsx)(Ch,{label:t.text(e.label),help:o,required:e.required,id:r,helpId:i,children:(0,R.jsx)(`input`,{id:r,className:`pxd-input pxd-input-year`,inputMode:`numeric`,pattern:`[0-9]{4}`,maxLength:4,placeholder:`YYYY`,value:s??``,min:c,max:l,required:e.required,"aria-describedby":o?i:void 0,onChange:n=>t.write(e.value,n.target.value.replace(/\D/g,``).slice(0,4)||null),...u})});if(a===`dateRange`){let[n,r]=Array.isArray(s)?s:[],i=(i,a)=>{let o=[n??null,r??null];o[i]=a||null,t.write(e.value,o)};return(0,R.jsxs)(`fieldset`,{className:`pxd-field`,...u,children:[(0,R.jsx)(`legend`,{className:`pxd-field-label`,children:t.text(e.label)}),o&&(0,R.jsx)(`p`,{className:`pxd-field-help`,children:o}),(0,R.jsxs)(`div`,{className:`pxd-date-range`,children:[(0,R.jsxs)(`label`,{children:[`From`,(0,R.jsx)(`input`,{className:`pxd-input`,type:`date`,value:n??``,min:c,max:l,required:e.required,onChange:e=>i(0,e.target.value)})]}),(0,R.jsxs)(`label`,{children:[`To`,(0,R.jsx)(`input`,{className:`pxd-input`,type:`date`,value:r??``,min:n??c,max:l,required:e.required,onChange:e=>i(1,e.target.value)})]})]})]})}return(0,R.jsx)(Ch,{label:t.text(e.label),help:o,required:e.required,id:r,helpId:i,children:(0,R.jsx)(`input`,{id:r,className:`pxd-input pxd-input-date${a===`month`?` pxd-input-month`:``}`,type:Bh[a],value:s??``,min:c,max:l,required:e.required,"aria-describedby":o?i:void 0,onChange:n=>t.write(e.value,n.target.value||null),...u})})}function Hh({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=(0,v.useId)(),a=(0,v.useId)(),o=r=>j(r,ae(e.format??{type:`number`},n.data,t.scope),n.locale),s=$(e);if(e.mode===`range`){let n=t.value(e.value),[c,l]=Array.isArray(n)?n.map(Number):[e.min,e.max],u=(n,r)=>t.write(e.value,[Math.max(e.min,Math.min(n,r)),Math.min(e.max,Math.max(n,r))]);return(0,R.jsxs)(`div`,{className:`pxd-field pxd-range`,role:`group`,"aria-labelledby":r,...s,children:[(0,R.jsxs)(`div`,{className:`pxd-range-header`,children:[(0,R.jsx)(`span`,{className:`pxd-field-label`,id:r,children:t.text(e.label)}),(0,R.jsxs)(`output`,{className:`pxd-range-value`,"aria-live":`polite`,children:[o(c),` – `,o(l)]})]}),(0,R.jsxs)(pp,{className:`pxd-slider`,min:e.min,max:e.max,step:e.step??1,value:[c,l],minStepsBetweenThumbs:1,onValueChange:([e,t])=>u(e,t),children:[(0,R.jsx)(bp,{className:`pxd-slider-track`,children:(0,R.jsx)(Sp,{className:`pxd-slider-range`})}),(0,R.jsx)(kp,{className:`pxd-slider-thumb`,"aria-label":`Minimum`,"aria-valuetext":o(c)}),(0,R.jsx)(kp,{className:`pxd-slider-thumb`,"aria-label":`Maximum`,"aria-valuetext":o(l)})]}),(0,R.jsxs)(`div`,{className:`pxd-range-fields`,children:[(0,R.jsxs)(`label`,{htmlFor:i,children:[(0,R.jsx)(`span`,{children:`Minimum`}),(0,R.jsx)(`input`,{id:i,className:`pxd-input`,inputMode:`numeric`,value:c,onChange:t=>u(Number(t.target.value)||e.min,l)})]}),(0,R.jsx)(`span`,{"aria-hidden":`true`,children:`–`}),(0,R.jsxs)(`label`,{htmlFor:a,children:[(0,R.jsx)(`span`,{children:`Maximum`}),(0,R.jsx)(`input`,{id:a,className:`pxd-input`,inputMode:`numeric`,value:l,onChange:t=>u(c,Number(t.target.value)||e.max)})]})]})]})}let c=Number(t.value(e.value)??e.min);return(0,R.jsxs)(`div`,{className:`pxd-field pxd-range`,...s,children:[(0,R.jsxs)(`div`,{className:`pxd-range-header`,children:[(0,R.jsx)(`span`,{className:`pxd-field-label`,id:r,children:t.text(e.label)}),(0,R.jsx)(`output`,{className:`pxd-range-value`,"aria-live":`polite`,children:o(c)})]}),(0,R.jsxs)(pp,{className:`pxd-slider`,min:e.min,max:e.max,step:e.step??1,value:[c],onValueChange:([n])=>t.write(e.value,n),children:[(0,R.jsx)(bp,{className:`pxd-slider-track`,children:(0,R.jsx)(Sp,{className:`pxd-slider-range`})}),(0,R.jsx)(kp,{className:`pxd-slider-thumb`,"aria-labelledby":r,"aria-valuetext":o(c)})]}),(0,R.jsxs)(`div`,{className:`pxd-range-bounds`,"aria-hidden":`true`,children:[(0,R.jsx)(`span`,{children:o(e.min)}),(0,R.jsx)(`span`,{children:o(e.max)})]})]})}function Uh(e){return(e.labels?.[0]?.textContent??e.getAttribute(`aria-label`)??e.closest(`.pxd-field`)?.querySelector(`.pxd-field-label, legend`)?.textContent??``).replace(/\*\s*$/,``).trim()}function Wh(e,t){let n=new Set,r=[];for(let i of Array.from(e.elements))if(i.willValidate&&!i.validity.valid){if(i.type===`radio`&&i.name){if(n.has(i.name))continue;n.add(i.name)}i.id||=`${t}-${r.length}`,r.push(i)}return r}function Gh({node:e}){let t=P(),n=N(),r=Math.min((0,v.useContext)(re),6),i=(0,v.useId)(),a=(0,v.useRef)(null),o=(0,v.useRef)([]),[s,c]=(0,v.useState)([]),l=(e.children??[]).some(e=>n.byId.get(e)?.required);(0,v.useEffect)(()=>{s.length&&a.current?.focus()},[s]);let u=()=>{for(let e of o.current)e.removeAttribute(`aria-invalid`),e.pxdDescribed?e.setAttribute(`aria-describedby`,e.pxdDescribed):e.removeAttribute(`aria-describedby`),e.pxdNote?.remove(),e.pxdNote=void 0;o.current=[]},d=e=>{for(let t of e){t.setAttribute(`aria-invalid`,`true`);let e=t.closest(`.pxd-field`);if(e&&!e.querySelector(`.pxd-field-error`)){let n=e.ownerDocument.createElement(`p`);n.className=`pxd-field-error`,n.id=`${t.id}-error`,n.textContent=t.validationMessage,e.append(n),t.pxdNote=n,t.pxdDescribed=t.getAttribute(`aria-describedby`),t.setAttribute(`aria-describedby`,[t.pxdDescribed,n.id].filter(Boolean).join(` `))}}o.current=e},f=e=>{let t=a.current?.ownerDocument.getElementById(e);t&&(t.scrollIntoView({block:`center`}),t.focus(),t.ownerDocument.activeElement!==t&&t.closest(`.pxd-field`)?.querySelector(`[role='radio'], button, input:not([aria-hidden]), textarea, select`)?.focus())};return(0,R.jsxs)(`form`,{className:`pxd-form${e.aside?` pxd-form-with-aside`:``}${e.layout===`horizontal`?` pxd-form-horizontal`:``}`,noValidate:!0,onSubmit:r=>{r.preventDefault();let a=r.currentTarget;if(u(),!a.checkValidity()){let e=Wh(a,i);return d(e),c(e.map(e=>({id:e.id,label:Uh(e),message:e.validationMessage})))}c([]),n.dispatch(e.submit.action,t.scope,e.id)},...$(e),children:[e.aside&&(0,R.jsx)(`aside`,{className:`pxd-form-aside`,children:(0,R.jsx)(c_,{id:e.aside})}),(0,R.jsxs)(`div`,{className:`pxd-stack pxd-form-fields`,children:[s.length>0&&(0,R.jsxs)(`section`,{ref:a,className:`pxd-error-summary`,role:`alert`,tabIndex:-1,"aria-labelledby":i,children:[(0,v.createElement)(`h${r}`,{id:i,className:`pxd-error-summary-title`},`Check these fields before continuing`),(0,R.jsx)(`ul`,{className:`pxd-error-summary-list`,children:s.map(e=>(0,R.jsx)(`li`,{children:(0,R.jsx)(`a`,{href:`#${e.id}`,className:`pxd-link`,onClick:t=>{t.preventDefault(),f(e.id)},children:e.label?`${e.label}: ${e.message}`:e.message})},e.id))})]}),l&&(0,R.jsxs)(`p`,{className:`pxd-required-legend`,children:[(0,R.jsx)(`span`,{className:`pxd-required`,"aria-hidden":`true`,children:`*`}),` `,`Required`]}),(0,R.jsx)(Om,{ids:e.children})]}),(0,R.jsxs)(`div`,{className:`pxd-action-bar`,children:[(0,R.jsx)(`button`,{type:`submit`,className:`pxd-button pxd-button-primary`,children:t.text(e.submit.label)}),e.cancel&&(0,R.jsx)(`button`,{type:`button`,className:`pxd-button pxd-button-secondary`,onClick:()=>n.dispatch(e.cancel.action,t.scope,e.id),children:t.text(e.cancel.label)})]})]})}var Kh={ctrl:[`⌃`,`Ctrl`,`Control`,`ctrlKey`],alt:[`⌥`,`Alt`,`Alt`,`altKey`],shift:[`⇧`,`Shift`,`Shift`,`shiftKey`],enter:[`↵`,`Enter`,`Enter`,`enter`],escape:[`⎋`,`Esc`,`Escape`,`escape`],space:[`Space`,`Space`,`Space`,` `],tab:[`⇥`,`Tab`,`Tab`,`tab`],backspace:[`⌫`,`Backspace`,`Backspace`,`backspace`],delete:[`⌦`,`Del`,`Delete`,`delete`],arrowup:[`↑`,`↑`,`ArrowUp`,`arrowup`],arrowdown:[`↓`,`↓`,`ArrowDown`,`arrowdown`],arrowleft:[`←`,`←`,`ArrowLeft`,`arrowleft`],arrowright:[`→`,`→`,`ArrowRight`,`arrowright`],home:[`Home`,`Home`,`Home`,`home`],end:[`End`,`End`,`End`,`end`],slash:[`/`,`/`,`/`,`/`],comma:[`,`,`,`,`,`,`,`],period:[`.`,`.`,`.`,`.`]},qh=[`metaKey`,`ctrlKey`,`altKey`,`shiftKey`];function Jh(e,t){let n=e.toLowerCase().split(`+`),r=n.pop(),i=[],a=[],o=new Set;for(let e of n){let[n,r,s,c]=e===`mod`?t?[`⌘`,`Ctrl`,`Meta`,`metaKey`]:Kh.ctrl:Kh[e];i.push(t?n:r),a.push(s),o.add(c)}let s=Kh[r];return i.push(s?t?s[0]:s[1]:r.toUpperCase()),a.push(s?s[2]:r.toUpperCase()),{hint:i,aria:a.join(`+`),flags:o,key:s?s[3]:r}}var Yh=()=>/mac|iphone|ipad|ipod/i.test(navigator.userAgentData?.platform??navigator.platform??``),Xh=()=>()=>{},Zh=()=>(0,v.useSyncExternalStore)(Xh,Yh,()=>!1);function Qh(e){return e instanceof HTMLElement?e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName):!1}function $h({node:e}){let t=P(),n=N(),r=(0,v.useContext)(ie),i=(0,v.useId)(),[a,o]=(0,v.useState)(!1),s=e.disabled!==void 0&&!!t.value(e.disabled),c=e.tone===`danger`?` pxd-button-danger`:``,l=e.description===void 0?void 0:t.text(e.description),u=Zh(),d=typeof e.shortcut==`string`&&e.shortcut?Jh(e.shortcut,u):void 0,f=()=>{let i=e.action.event.name;if(i===`ui.back`&&r)return r.back();if(i===`ui.next`&&r)return r.next();if(i===`ui.copy`){let n=e.copy===void 0?String(t.context(e.action.event.context).text??``):t.text(e.copy),r=()=>{o(!0),setTimeout(()=>o(!1),2e3)};typeof navigator<`u`&&navigator.clipboard?.writeText?navigator.clipboard.writeText(n).then(r,()=>void 0):r()}n.dispatch(e.action,t.scope,e.id)},p=(0,v.useRef)(f);p.current=f;let m=n.root;return(0,v.useEffect)(()=>{if(!d||s||!m)return;let e=e=>{if(e.defaultPrevented||e.repeat||!m.contains(document.activeElement)&&!(e.target instanceof HTMLElement&&m.contains(e.target))||!qh.every(t=>e[t]===d.flags.has(t))||!d.flags.has(`metaKey`)&&!d.flags.has(`ctrlKey`)&&!d.flags.has(`altKey`)&&Qh(e.target))return;let t=/^[a-z0-9]$/.test(d.key)&&e.code.toLowerCase()===(/\d/.test(d.key)?`digit${d.key}`:`key${d.key}`);(e.key.toLowerCase()===d.key||t)&&(e.preventDefault(),p.current())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[e.shortcut,u,s,m]),(0,R.jsxs)(`button`,{type:`button`,className:`pxd-button pxd-button-${e.emphasis??`secondary`}${c}${l?` pxd-button-described`:``}`,disabled:s,"aria-describedby":l?i:void 0,"aria-keyshortcuts":d?.aria,onClick:f,...$(e),children:[(0,R.jsx)(`span`,{className:`pxd-button-label`,children:a?`Copied`:t.text(e.label)}),d&&(0,R.jsx)(`span`,{className:`pxd-kbd-hint`,"aria-hidden":`true`,children:d.hint.map((e,t)=>(0,R.jsx)(`kbd`,{className:`pxd-kbd`,children:e},t))}),l&&(0,R.jsx)(`span`,{className:`pxd-button-description`,id:i,children:l}),e.action.event.name===`ui.copy`&&(0,R.jsx)(`span`,{className:`pxd-sr-only`,"aria-live":`polite`,children:a?`Copied`:``})]})}var eg={todo:{label:`Not started`,tone:`neutral`},inProgress:{label:`In progress`,tone:`info`},done:{label:`Completed`,tone:`success`},blocked:{label:`Cannot start yet`,tone:`neutral`}};function tg({node:e}){let t=P(),n=N(),[r,i]=(0,v.useState)(null),a=e.current===void 0?void 0:t.value(e.current),[o,s]=(0,v.useState)(typeof a==`number`?a:0),c=e.kind??`wizard`,l=(0,R.jsx)(`div`,{className:`pxd-action-bar`,children:(0,R.jsx)(`button`,{type:`button`,className:`pxd-button pxd-button-primary`,onClick:()=>n.dispatch(e.finish.action,t.scope,e.id),children:t.text(e.finish.label)})});if(c===`guide`)return(0,R.jsxs)(`div`,{className:`pxd-steps pxd-guide`,...$(e),children:[(0,R.jsx)(`ol`,{className:`pxd-guide-list`,children:e.steps.map((e,n)=>(0,R.jsxs)(`li`,{className:`pxd-guide-step`,children:[(0,R.jsx)(`span`,{className:`pxd-guide-number`,"aria-hidden":`true`,children:n+1}),(0,R.jsxs)(`div`,{className:`pxd-guide-body`,children:[(0,R.jsx)(km,{className:`pxd-guide-title`,children:t.text(e.title)}),(0,R.jsx)(c_,{id:e.content})]})]},e.key))}),l]});if(c===`tasklist`){let n=e=>eg[e.status===void 0?`todo`:t.text(e.status)]??eg.todo,a=e.steps.filter(e=>n(e)===eg.done).length;return(0,R.jsxs)(`div`,{className:`pxd-steps pxd-tasklist`,...$(e),children:[(0,R.jsx)(`p`,{className:`pxd-steps-progress`,children:`${a} of ${e.steps.length} tasks completed`}),(0,R.jsx)(`ul`,{className:`pxd-tasklist-list`,children:e.steps.map(e=>{let a=r===e.key,{label:o,tone:s}=n(e),c=s===`neutral`&&o===eg.blocked.label;return(0,R.jsxs)(`li`,{className:`pxd-task${a?` pxd-task-open`:``}`,children:[(0,R.jsxs)(`div`,{className:`pxd-task-row`,children:[(0,R.jsx)(`button`,{type:`button`,className:`pxd-task-title`,"aria-expanded":a,disabled:c,onClick:()=>i(a?null:e.key),children:t.text(e.title)}),(0,R.jsx)(`span`,{className:`pxd-badge pxd-tone-${s} pxd-task-status`,children:o})]}),a&&(0,R.jsx)(`div`,{className:`pxd-task-content`,children:(0,R.jsx)(c_,{id:e.content})})]},e.key)})}),l]})}let u=typeof a==`number`&&e.current?.path?a:o,d=e.steps.length,f=n=>{let r=Math.max(0,Math.min(d-1,n));e.current?.path?t.write(e.current,r):s(r)},p=e.steps[u],m=u===d-1;return(0,R.jsx)(ie.Provider,{value:{back:()=>f(u-1),next:()=>f(u+1)},children:(0,R.jsxs)(`div`,{className:`pxd-steps`,...$(e),children:[(0,R.jsx)(`p`,{className:`pxd-steps-progress`,children:`Step ${u+1} of ${d}`}),(0,R.jsx)(`ol`,{className:`pxd-steps-list`,children:e.steps.map((e,n)=>(0,R.jsx)(`li`,{"aria-current":n===u?`step`:void 0,className:n<u?`pxd-step-done`:n===u?`pxd-step-current`:void 0,children:t.text(e.title)},e.key))}),(0,R.jsxs)(`form`,{className:`pxd-steps-content`,onSubmit:r=>{r.preventDefault(),m?n.dispatch(e.finish.action,t.scope,e.id):f(u+1)},children:[(0,R.jsx)(km,{className:`pxd-steps-title`,children:t.text(p.title)}),(0,R.jsx)(c_,{id:p.content},p.key),(0,R.jsxs)(`div`,{className:`pxd-action-bar`,children:[(0,R.jsx)(`button`,{type:`submit`,className:`pxd-button pxd-button-primary`,children:m?t.text(e.finish.label):`Continue`}),u>0&&(0,R.jsx)(`button`,{type:`button`,className:`pxd-button pxd-button-secondary`,onClick:()=>f(u-1),children:`Back`})]})]})]})})}function ng({node:e}){let t=P(),n=N(),r=n.doc.root===e.id,[i,a]=(0,v.useState)(!0),[o,s]=(0,v.useState)(``),c=(0,v.useId)(),l=(0,v.useId)(),u=e.typeToConfirm===void 0?void 0:t.text(e.typeToConfirm),d=!u||o.trim()===u,f=e.severity===`destructive`,p=$(e),m=(0,v.useRef)(null);(0,v.useEffect)(()=>{r&&m.current?.focus({preventScroll:!0})},[r]);let h=()=>{r||a(!1),n.dispatch(e.cancel?.action??{event:{name:`ui.dismiss`}},t.scope,e.id)},g=()=>d&&n.dispatch(e.confirm.action,t.scope,e.id),_=e.subject&&(0,R.jsxs)(`div`,{className:`pxd-dialog-subject`,children:[(0,R.jsx)(Im,{value:e.subject.avatar===void 0?void 0:t.value(e.subject.avatar),name:t.text(e.subject.title),size:56}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`pxd-dialog-subject-title`,children:t.text(e.subject.title)}),e.subject.subtitle!==void 0&&(0,R.jsx)(`div`,{className:`pxd-dialog-subject-sub`,children:t.text(e.subject.subtitle)})]})]}),y=e.amount&&(0,R.jsx)(`div`,{className:`pxd-dialog-amount`,children:t.text(e.amount.value,e.amount.format)}),b=Array.isArray(e.consequences)&&(0,R.jsx)(`ul`,{className:`pxd-consequences`,children:e.consequences.map((e,n)=>(0,R.jsxs)(`li`,{children:[(0,R.jsx)(`span`,{className:`pxd-consequence-icon`,children:(0,R.jsx)(Q,{name:e.icon??`info`})}),(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`span`,{className:`pxd-consequence-title`,children:t.text(e.title)}),e.detail!==void 0&&(0,R.jsx)(`span`,{className:`pxd-consequence-detail`,children:t.text(e.detail)})]})]},n))}),x=(0,R.jsx)(`div`,{className:`pxd-dialog-description`,id:l,children:e.message!==void 0&&(0,R.jsx)(`p`,{children:t.text(e.message)})}),S=e.consequence!==void 0&&(0,R.jsxs)(`p`,{className:`pxd-dialog-consequence`,id:`${l}-consequence`,children:[(0,R.jsx)(Q,{name:`info`,size:18}),(0,R.jsx)(`span`,{children:t.text(e.consequence)})]}),C=(t,n)=>(0,R.jsxs)(R.Fragment,{children:[b,e.summary&&(0,R.jsx)(c_,{id:e.summary}),u&&(0,R.jsxs)(`div`,{className:`pxd-field`,children:[(0,R.jsxs)(`label`,{className:`pxd-field-label`,htmlFor:`${e.id}-type`,children:[`Type `,(0,R.jsx)(`strong`,{children:u}),` to confirm`]}),(0,R.jsx)(`input`,{id:`${e.id}-type`,className:`pxd-input`,autoComplete:`off`,value:o,onChange:e=>s(e.target.value)})]}),S,(0,R.jsxs)(`div`,{className:`pxd-action-bar`,children:[t,n]})]}),w=(0,R.jsx)(`button`,{type:`button`,className:`pxd-button pxd-button-primary${f?` pxd-button-danger`:``}`,disabled:!d,onClick:g,children:t.text(e.confirm.label)}),T=e.cancel?t.text(e.cancel.label):`Cancel`;return r?(0,R.jsxs)(`div`,{role:`alertdialog`,"aria-modal":`false`,"aria-labelledby":c,"aria-describedby":e.consequence===void 0?l:`${l} ${l}-consequence`,className:`pxd-dialog pxd-dialog-inline${f?` pxd-dialog-destructive`:``}`,onKeyDown:e=>e.key===`Escape`&&h(),...p,children:[(0,R.jsx)(`h1`,{className:`pxd-dialog-title`,id:c,children:t.text(e.title)}),y,_,x,C(w,(0,R.jsx)(`button`,{type:`button`,ref:m,className:`pxd-button pxd-button-secondary`,onClick:h,children:T}))]}):(0,R.jsx)(qi,{open:i,onOpenChange:e=>e?a(!0):h(),children:(0,R.jsxs)(Ji,{container:n.portal,children:[(0,R.jsx)(Yi,{className:`pxd-overlay`}),(0,R.jsxs)(Xi,{className:`pxd-dialog${f?` pxd-dialog-destructive`:``}`,"aria-describedby":e.consequence===void 0?l:`${l} ${l}-consequence`,...p,children:[(0,R.jsx)($i,{className:`pxd-dialog-title`,children:t.text(e.title)}),y,_,(0,R.jsx)(ea,{asChild:!0,children:x}),C((0,R.jsx)(Zi,{asChild:!0,onClick:e=>(e.preventDefault(),g()),children:w}),(0,R.jsx)(Qi,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,className:`pxd-button pxd-button-secondary`,autoFocus:!0,children:T})}))]})]})})}function rg({node:e}){let t=P(),n=N(),r=w(e.items.path,t.scope),i=O(E(n.data,r)),a=i.map((e,t)=>({pointer:T(r,t)})),o=(e,t)=>E(n.data,w(e,a[t])),s=e.recommended===void 0?void 0:t.text(e.recommended),c=e.recommendedReason===void 0?void 0:t.text(e.recommendedReason),l=new Map;for(let t of e.attributes){if(!t.better||t.better===`none`)continue;let e=i.map((e,n)=>Number(o(t.path,n))),n=t.better===`higher`?Math.max(...e):Math.min(...e);e.filter(e=>e===n).length===1&&l.set(t.key,e.indexOf(n))}let u=[];for(let n of e.attributes){let e=n.group===void 0?void 0:t.text(n.group),r=u.find(t=>t.label===e);r?r.attributes.push(n):u.push({label:e,attributes:[n]})}let d=i.map((e,t)=>t),f=d.findIndex(t=>String(o(e.itemTitle,t)??``)===s);f>0&&d.unshift(...d.splice(f,1));let p=(e,r)=>{let i=o(e.path,r);return typeof i==`boolean`?i?(0,R.jsxs)(`span`,{className:`pxd-yes`,children:[(0,R.jsx)(Q,{name:`check`,size:18}),(0,R.jsx)(`span`,{className:`pxd-sr-only`,children:`Included`})]}):(0,R.jsxs)(`span`,{className:`pxd-no`,children:[(0,R.jsx)(Q,{name:`dash`,size:18}),(0,R.jsx)(`span`,{className:`pxd-sr-only`,children:`Not included`})]}):j(i,ae(e.format,n.data,t.scope),n.locale)};return(0,R.jsxs)(`div`,{className:`pxd-comparison`,...$(e),children:[e.summary!==void 0&&(0,R.jsx)(`p`,{className:`pxd-comparison-summary`,children:t.text(e.summary)}),(0,R.jsx)(`ul`,{className:`pxd-comparison-items`,children:d.map(r=>{let i=String(o(e.itemTitle,r)??``),d=s===i;return(0,R.jsxs)(`li`,{className:`pxd-comparison-item${d?` pxd-recommended`:``}`,children:[d&&(0,R.jsxs)(`p`,{className:`pxd-recommendation`,children:[(0,R.jsx)(`span`,{className:`pxd-badge pxd-tone-info`,children:`Recommended`}),c&&(0,R.jsx)(`span`,{className:`pxd-recommendation-reason`,children:c})]}),(0,R.jsx)(km,{className:`pxd-comparison-title`,children:i}),u.map((e,n)=>(0,R.jsxs)(`div`,{className:`pxd-comparison-group`,children:[e.label&&(0,R.jsx)(`p`,{className:`pxd-comparison-group-label`,children:e.label}),(0,R.jsx)(`dl`,{children:e.attributes.map(e=>(0,R.jsxs)(`div`,{className:`pxd-detail-row`,children:[(0,R.jsx)(`dt`,{children:t.text(e.label)}),(0,R.jsxs)(`dd`,{children:[p(e,r),l.get(e.key)===r&&(0,R.jsx)(`span`,{className:`pxd-best`,children:` Best`})]})]},e.key))})]},n)),e.choose&&(0,R.jsxs)(`button`,{type:`button`,className:`pxd-button ${d?`pxd-button-primary`:`pxd-button-secondary`}`,onClick:()=>n.dispatch(e.choose.action,a[r],e.id),children:[t.text(e.choose.label),` `,(0,R.jsx)(`span`,{className:`pxd-sr-only`,children:i})]})]},r)})})]})}var ig=`More actions`,ag=44;function og({node:e}){let t=N(),n=e.children??[],r=(0,v.useRef)(null),i=(0,v.useRef)(null),a=(0,v.useRef)(new Map),o=(0,v.useRef)(ag),s=(0,v.useRef)(-1),[c,l]=(0,v.useState)(n.length),u=e=>t.byId.get(e)?.component===`Action`,d=1;for(let e=n.length-1;e>0;e--)if(!u(n[e])){d=e+1;break}let f=()=>{let e=r.current;if(!e)return;if(n.length<=2||getComputedStyle(e).flexDirection===`column`)return l(n.length);for(let t of e.querySelectorAll(`:scope > [data-pxd-id]`))t.offsetWidth&&a.current.set(t.dataset.pxdId,t.offsetWidth);i.current?.offsetWidth&&(o.current=i.current.offsetWidth);let t=parseFloat(getComputedStyle(e).columnGap)||0,s=e.clientWidth,c=e=>a.current.get(e)??0,u=0,f=0;for(;f<n.length&&u+(f?t:0)+c(n[f])<=s;)u+=(f?t:0)+c(n[f++]);if(f<n.length){for(;f>d&&u+t+o.current>s;)u-=t+c(n[--f]);f=Math.max(f,d)}l(f)};(0,v.useLayoutEffect)(f),(0,v.useLayoutEffect)(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(([e])=>{let t=e.contentRect.width;t!==s.current&&(s.current=t,f())});return t.observe(e),()=>t.disconnect()});let p=n.slice(0,Math.min(c,n.length)),m=n.slice(p.length);return(0,R.jsxs)(`div`,{ref:r,className:`pxd-action-bar`,role:`group`,"aria-label":`Actions`,...$(e),children:[p.map(e=>(0,R.jsx)(c_,{id:e},e)),m.length>0&&(0,R.jsxs)(wd,{children:[(0,R.jsx)(Td,{ref:i,className:`pxd-icon-button pxd-action-menu-trigger pxd-action-menu-overflow pxd-action-bar-more`,"aria-label":ig,children:(0,R.jsx)(Q,{name:`dots`,size:18})}),(0,R.jsx)(Ed,{container:t.portal,children:(0,R.jsx)(Dd,{className:`pxd-menu pxd-action-menu`,align:`start`,sideOffset:4,children:(0,R.jsx)(sg,{ids:m})})})]})]})}function sg({ids:e}){let t=P(),n=N(),r=e.map(e=>n.byId.get(e)).filter(e=>!!e&&e.component===`Action`&&(e.visible===void 0||t.value(e.visible)!==!1)),i=r.filter(e=>e.tone!==`danger`),a=r.filter(e=>e.tone===`danger`),o=e=>(0,R.jsx)(Ad,{className:`pxd-menu-item${e.tone===`danger`?` pxd-menu-item-danger`:``}`,disabled:e.disabled===void 0?void 0:!!t.value(e.disabled),onSelect:()=>n.dispatch(e.action,t.scope,e.id),"data-pxd-id":e.id,"data-pxd-component":e.component,children:t.text(e.label)},e.id);return(0,R.jsxs)(R.Fragment,{children:[i.map(o),a.length>0&&i.length>0&&(0,R.jsx)(Fd,{className:`pxd-menu-separator`}),a.map(o)]})}var cg=640;function lg({node:e}){let t=P(),n=N(),r=(0,v.useRef)(null),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1),c=$(e);(0,v.useLayoutEffect)(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>a(e.getBoundingClientRect().width<cg);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let l=e.label===void 0?`Filters`:t.text(e.label),u=(e.children??[]).map(e=>n.byId.get(e)).filter(Boolean),d=u.filter(e=>e.component===`TextInput`&&e.kind===`search`),f=u.filter(e=>!d.includes(e)),p=ug(f,n,t),m=e.resultCount===void 0?void 0:t.value(e.resultCount),h=m===void 0?void 0:`${j(m,{type:`number`},n.locale)} ${m===1?`result`:`results`}`,g=()=>{for(let e of p)e.remove();e.clear&&n.dispatch(e.clear,t.scope,e.id)},_=f.map(e=>(0,R.jsx)(c_,{id:e.id},e.id)),y=(0,R.jsxs)(`div`,{className:`pxd-filter-results`,children:[d.map(e=>(0,R.jsx)(c_,{id:e.id},e.id)),(0,R.jsxs)(`div`,{className:`pxd-filter-status`,children:[i&&(0,R.jsxs)(ui,{className:`pxd-chip pxd-filter-trigger`,children:[(0,R.jsx)(Q,{name:`filter`,size:18}),l,p.length>0&&(0,R.jsxs)(`span`,{"aria-hidden":`true`,children:[` · `,p.length]}),p.length>0&&(0,R.jsxs)(`span`,{className:`pxd-sr-only`,children:[`, `,p.length,` active`]})]}),h&&(0,R.jsx)(`p`,{className:`pxd-filter-count`,"aria-live":`polite`,children:h})]}),p.length>0&&(0,R.jsxs)(`ul`,{className:`pxd-filter-chips`,"aria-label":`Active filters`,children:[p.map(e=>(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,className:`pxd-chip pxd-filter-chip`,onClick:e.remove,"aria-label":`Remove filter: ${e.label}`,children:[e.label,(0,R.jsx)(Q,{name:`close`,size:16})]})},e.key)),(0,R.jsx)(`li`,{children:(0,R.jsx)(`button`,{type:`button`,className:`pxd-button pxd-button-tertiary pxd-filter-clear`,onClick:g,children:`Clear all`})})]}),(0,R.jsx)(c_,{id:e.results})]});return(0,R.jsx)(`div`,{ref:r,className:`pxd-filter-panel${i?` pxd-filter-compact`:``}`,...c,children:i?(0,R.jsxs)(ci,{open:o,onOpenChange:s,children:[y,(0,R.jsxs)(mi,{container:n.portal,children:[(0,R.jsx)(gi,{className:`pxd-overlay`}),(0,R.jsxs)(bi,{className:`pxd-sheet`,"aria-describedby":void 0,children:[(0,R.jsxs)(`div`,{className:`pxd-sheet-header`,children:[(0,R.jsx)(Ti,{className:`pxd-sheet-title`,children:l}),(0,R.jsx)(ki,{className:`pxd-icon-button`,"aria-label":`Close`,children:(0,R.jsx)(Q,{name:`close`})})]}),(0,R.jsx)(`div`,{className:`pxd-sheet-body pxd-stack`,children:_}),(0,R.jsxs)(`div`,{className:`pxd-sheet-footer`,children:[p.length>0&&(0,R.jsx)(`button`,{type:`button`,className:`pxd-button pxd-button-secondary`,onClick:g,children:`Clear all`}),(0,R.jsx)(ki,{className:`pxd-button pxd-button-primary`,children:h?`Show ${h}`:`Show results`})]})]})]})]}):(0,R.jsxs)(`div`,{className:`pxd-filter-layout`,children:[(0,R.jsxs)(`section`,{className:`pxd-filter-sidebar`,"aria-label":l,children:[(0,R.jsx)(km,{className:`pxd-filter-title`,children:l}),(0,R.jsx)(`div`,{className:`pxd-stack`,children:_})]}),y]})})}function ug(e,t,n){let r=[];for(let i of e){if(!i.value||typeof i.value!=`object`||!(`path`in i.value))continue;let e=n.value(i.value),a=n.text(i.label),o=e=>j(e,ae(i.format??{type:`number`},t.data,n.scope),t.locale);switch(i.component){case`Choice`:{let a=Fh(i,t.data,n.scope,n.text),o=e=>a.find(t=>t.value===e)?.label??String(e);if(Array.isArray(e))for(let t of e)r.push({key:`${i.id}:${t}`,label:o(t),remove:()=>n.write(i.value,e.filter(e=>e!==t))});else e!=null&&e!==``&&r.push({key:i.id,label:o(e),remove:()=>n.write(i.value,null)});break}case`RangeInput`:if(i.mode===`range`&&Array.isArray(e)){let[t,s]=e.map(Number);(t>i.min||s<i.max)&&r.push({key:i.id,label:`${a}: ${o(t)} – ${o(s)}`,remove:()=>n.write(i.value,[i.min,i.max])})}else typeof e==`number`&&e<i.max&&r.push({key:i.id,label:`${a}: ${o(e)}`,remove:()=>n.write(i.value,i.max)});break;case`Toggle`:e===!0&&r.push({key:i.id,label:a,remove:()=>n.write(i.value,!1)});break;case`TextInput`:typeof e==`string`&&e.trim()&&r.push({key:i.id,label:`${a}: ${e}`,remove:()=>n.write(i.value,``)});break;case`DateInput`:e&&r.push({key:i.id,label:`${a}: ${String(e)}`,remove:()=>n.write(i.value,null)})}}return r}var dg=900;function fg({node:e}){let t=P(),n=N(),r=(0,v.useRef)(null),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)({}),u=t.value(e.current),d=e.kind??`main`,f=e.label===void 0?d===`breadcrumb`?`Breadcrumb`:d===`toc`?`On this page`:`Main`:t.text(e.label),p=$(e);(0,v.useLayoutEffect)(()=>{if(d!==`main`)return;let e=r.current?.closest(`.pxd-surface`)??r.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>a(e.getBoundingClientRect().width<dg);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[d]);let m=r=>{s(!1),n.dispatch(r.action,t.scope,e.id)},h=e=>{let n=e.badge===void 0?void 0:t.value(e.badge);return n?(0,R.jsxs)(`span`,{className:`pxd-nav-badge`,children:[n,(0,R.jsx)(`span`,{className:`pxd-sr-only`,children:` needing attention`})]}):null};if(d===`breadcrumb`)return(0,R.jsx)(`nav`,{className:`pxd-nav-breadcrumb`,"aria-label":f,...p,children:(0,R.jsx)(`ol`,{children:e.items.map((n,r)=>{let i=r===e.items.length-1,a=n.key===u||u===void 0&&i;return(0,R.jsx)(`li`,{children:a?(0,R.jsx)(`span`,{className:`pxd-nav-breadcrumb-current`,"aria-current":`page`,children:t.text(n.label)}):(0,R.jsx)(`button`,{type:`button`,className:`pxd-link`,onClick:()=>m(n),children:t.text(n.label)})},n.key)})})});if(d===`toc`)return(0,R.jsxs)(`nav`,{className:`pxd-nav-toc`,"aria-label":f,...p,children:[(0,R.jsx)(`p`,{className:`pxd-nav-toc-label`,"aria-hidden":`true`,children:f}),(0,R.jsx)(`ol`,{children:e.items.map(r=>{let i=r.key===u;return(0,R.jsx)(`li`,{children:(0,R.jsx)(`a`,{href:`#${r.key}`,className:`pxd-nav-toc-link${i?` pxd-nav-current`:``}`,"aria-current":i?`true`:void 0,onClick:()=>n.dispatch(r.action,t.scope,e.id),children:t.text(r.label)})},r.key)})})]});if(d===`local`)return(0,R.jsx)(`nav`,{className:`pxd-nav-local`,"aria-label":f,...p,children:(0,R.jsx)(`ul`,{children:e.items.map(e=>{let n=e.key===u;return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,className:`pxd-nav-local-item${n?` pxd-nav-current`:``}`,"aria-current":n?`page`:void 0,onClick:()=>m(e),children:[e.icon&&(0,R.jsx)(Q,{name:e.icon,size:16}),(0,R.jsx)(`span`,{className:`pxd-nav-label`,children:t.text(e.label)}),h(e)]})},e.key)})})});let g=[];for(let n of e.items){let e=n.group===void 0?void 0:t.text(n.group),r=g.find(t=>t.label===e);r?r.items.push(n):g.push({label:e,items:[n]})}let _=d===`nested`,y=e=>e.label&&e.label in c?c[e.label]:!e.label||e.items.some(e=>e.key===u),b=e=>(0,R.jsx)(`ul`,{children:e.map(e=>{let n=e.key===u;return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,className:`pxd-nav-item${n?` pxd-nav-current`:``}`,"aria-current":n?`page`:void 0,onClick:()=>m(e),children:[e.icon&&(0,R.jsx)(Q,{name:e.icon,size:18}),(0,R.jsx)(`span`,{className:`pxd-nav-label`,children:t.text(e.label)}),h(e)]})},e.key)})}),x=(0,R.jsx)(`nav`,{className:`pxd-nav${_?` pxd-nav-nested`:``}`,"aria-label":f,children:g.map((e,t)=>(0,R.jsxs)(`div`,{className:`pxd-nav-group`,children:[e.label&&(_?(0,R.jsxs)(`button`,{type:`button`,className:`pxd-nav-group-toggle`,"aria-expanded":y(e),onClick:()=>l(t=>({...t,[e.label]:!y(e)})),children:[(0,R.jsx)(Q,{name:y(e)?`sortUp`:`sortDown`,size:16}),(0,R.jsx)(`span`,{className:`pxd-nav-group-label`,children:e.label})]}):(0,R.jsx)(`p`,{className:`pxd-nav-group-label`,children:e.label})),(!_||y(e))&&b(e.items)]},t))});return(0,R.jsx)(`div`,{ref:r,className:`pxd-nav-wrap`,...p,children:i?(0,R.jsxs)(ci,{open:o,onOpenChange:s,children:[(0,R.jsx)(ui,{className:`pxd-icon-button pxd-nav-menu`,"aria-label":`${f} menu`,children:(0,R.jsx)(Q,{name:`menu`})}),(0,R.jsxs)(mi,{container:n.portal,children:[(0,R.jsx)(gi,{className:`pxd-overlay`}),(0,R.jsxs)(bi,{className:`pxd-nav-drawer`,"aria-describedby":void 0,children:[(0,R.jsxs)(`div`,{className:`pxd-sheet-header`,children:[(0,R.jsx)(Ti,{className:`pxd-sheet-title`,children:f}),(0,R.jsx)(ki,{className:`pxd-icon-button`,"aria-label":`Close`,children:(0,R.jsx)(Q,{name:`close`})})]}),x]})]})]}):x})}function pg(e,t,n,r){if(!n.action)return;let i=t.pointer(n.value),a=Object.fromEntries(Object.entries(n.action.event.context??{}).map(([e,n])=>[e,n&&typeof n==`object`&&`path`in n&&w(n.path,t.scope)===i?r:t.value(n)]));e.dispatch({event:{name:n.action.event.name,context:a}},{pointer:``},n.id)}function mg({node:e}){let t=P(),n=N(),r=t.text(e.label),i=e.kind??`label`,a=i===`status`?e.tone??`neutral`:`neutral`,o=$(e),s=`pxd-tag pxd-tag-${i} pxd-tag-${a}${e.remove?` pxd-tag-removable`:``}`;if(i===`count`){let n=t.text(e.count,{type:`number`});return(0,R.jsxs)(`span`,{className:s,title:r,...o,children:[(0,R.jsxs)(`span`,{className:`pxd-sr-only`,children:[r,`: `]}),(0,R.jsx)(`span`,{className:`pxd-tag-number`,children:n})]})}return(0,R.jsxs)(`span`,{className:s,title:r,...o,children:[(0,R.jsx)(`span`,{className:`pxd-tag-text`,children:r}),e.remove&&(0,R.jsx)(`button`,{type:`button`,className:`pxd-tag-remove`,"aria-label":`Remove ${r}`,onClick:()=>n.dispatch(e.remove,t.scope,e.id),children:(0,R.jsx)(Q,{name:`close`,size:12})})]})}var hg={small:24,default:40,large:64};function gg({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=(0,v.useId)(),a=$(e),o=e.kind??`person`,s=e.size??`default`,c=hg[s]??hg.default,l=t.text(e.name),u=e.detail===void 0?void 0:t.text(e.detail),d={"--polyxd-identity-size":`${c}px`},f=`pxd-identity pxd-identity-${s} pxd-identity-${o}${e.group?` pxd-identity-group`:``}`,p,m=l;if(e.group){let r=w(e.group.path,t.scope),i=O(E(n.data,r)).map((t,i)=>{let a={pointer:T(r,i)},o=e=>e?E(n.data,w(e,a)):void 0;return{name:String(o(e.group.namePath)??``),image:o(e.group.imagePath)}}),a=e.group.max??4,o=i.slice(0,a),s=i.slice(a),l=e=>e.split(/\s+/)[0]||e;m||=s.length?`${o.map(e=>l(e.name)).join(`, `)} and ${s.length} more`:o.map(e=>l(e.name)).join(`, `),p=(0,R.jsxs)(`span`,{className:`pxd-identity-faces`,children:[o.map((e,t)=>(0,R.jsxs)(`span`,{className:`pxd-identity-face`,children:[(0,R.jsx)(Im,{value:e.image,name:e.name,size:c}),(0,R.jsx)(`span`,{className:`pxd-sr-only`,children:e.name})]},t)),s.length>0&&(0,R.jsx)(`span`,{className:`pxd-identity-face pxd-identity-more`,role:`img`,title:s.map(e=>e.name).join(`, `),"aria-label":`${s.length} more: ${s.map(e=>e.name).join(`, `)}`,children:(0,R.jsxs)(`span`,{"aria-hidden":`true`,children:[`+`,s.length]})})]})}else p=(0,R.jsx)(Im,{value:t.value(e.image),name:l,size:c});let h=(0,R.jsxs)(R.Fragment,{children:[p,(0,R.jsxs)(`span`,{className:`pxd-identity-text`,children:[(0,R.jsx)(`span`,{className:`pxd-identity-name`,id:r,children:m}),u&&(0,R.jsx)(`span`,{className:`pxd-identity-detail`,id:i,children:u})]})]});return e.action?(0,R.jsx)(`button`,{type:`button`,className:`${f} pxd-identity-button`,style:d,"aria-labelledby":r,"aria-describedby":u?i:void 0,onClick:()=>n.dispatch(e.action,t.scope,e.id),...a,children:h}):(0,R.jsx)(`div`,{className:f,style:d,role:`group`,"aria-labelledby":r,"aria-describedby":u?i:void 0,...a,children:h})}function _g(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 vg({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=$(e),a=e.kind??`bar`,o=t.text(e.label),s=!!t.value(e.indeterminate),c=t.value(e.value),l=typeof c==`number`?c:Number(c),u=e.max===void 0?void 0:Number(t.value(e.max)),d=u!==void 0&&Number.isFinite(u)&&u>0?u:void 0,f=Number.isFinite(l)?Math.max(0,Math.min(1,d===void 0?l:l/d)):0,p=e.format?j(c,ae(e.format,n.data,t.scope),n.locale):j(f,{type:`percent`,precision:0},n.locale),m=e.caption===void 0?void 0:t.text(e.caption),h=a===`meter`,g=h?_g(f,e.thresholds):{},_=e.tone??g.tone,y=h?g.hint:void 0,b=[p,m,y].filter(Boolean).join(`, `),x=Math.round(f*100),S=s?{"aria-busy":!0}:d===void 0?{"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":x,"aria-valuetext":b}:{"aria-valuemin":0,"aria-valuemax":d,"aria-valuenow":Number.isFinite(l)?l:0,"aria-valuetext":b},C=h?`meter`:`progressbar`,w=`pxd-gauge pxd-gauge-${a}${_&&_!==`neutral`?` pxd-gauge-${_}`:``}${s?` pxd-gauge-indeterminate`:``}`,T=(0,R.jsxs)(`div`,{className:`pxd-gauge-header`,children:[(0,R.jsx)(`span`,{className:`pxd-gauge-label`,id:r,children:o}),(0,R.jsxs)(`span`,{className:`pxd-gauge-readout`,children:[!s&&(0,R.jsx)(`span`,{className:`pxd-gauge-value`,children:p}),m&&(0,R.jsx)(`span`,{className:`pxd-gauge-caption`,children:m}),y&&(0,R.jsx)(`span`,{className:`pxd-gauge-hint`,children:y})]})]});return a===`ring`?(0,R.jsxs)(`div`,{className:w,...i,children:[(0,R.jsx)(`div`,{className:`pxd-gauge-ring-graphic`,role:C,"aria-labelledby":r,...S,children:(0,R.jsxs)(`svg`,{className:`pxd-gauge-ring-svg`,viewBox:`0 0 36 36`,"aria-hidden":`true`,focusable:`false`,children:[(0,R.jsx)(`circle`,{className:`pxd-gauge-ring-track`,cx:`18`,cy:`18`,r:`16`,fill:`none`,strokeWidth:`4`}),(0,R.jsx)(`circle`,{className:`pxd-gauge-ring-fill`,cx:`18`,cy:`18`,r:`16`,fill:`none`,strokeWidth:`4`,pathLength:100,strokeDasharray:s?`25 100`:`${x} 100`,strokeLinecap:`round`})]})}),T]}):(0,R.jsxs)(`div`,{className:w,...i,children:[T,(0,R.jsx)(`div`,{className:`pxd-gauge-track`,role:C,"aria-labelledby":r,...S,children:(0,R.jsx)(`div`,{className:`pxd-gauge-fill`,style:s?void 0:{width:`${x}%`}})})]})}var yg=`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`;function bg({fill:e}){let t=Math.round(Math.max(0,Math.min(1,e))*100);return(0,R.jsxs)(`span`,{className:`pxd-rating-star-shape`,"aria-hidden":`true`,children:[(0,R.jsx)(`svg`,{className:`pxd-rating-star-empty`,viewBox:`0 0 24 24`,focusable:`false`,children:(0,R.jsx)(`path`,{d:yg})}),(0,R.jsx)(`span`,{className:`pxd-rating-star-fill`,style:{width:`${t}%`},children:(0,R.jsx)(`svg`,{viewBox:`0 0 24 24`,focusable:`false`,children:(0,R.jsx)(`path`,{d:yg})})})]})}var xg=e=>`${e} ${e===1?`star`:`stars`}`;function Sg({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=(0,v.useId)(),[a,o]=(0,v.useState)(null),s=$(e),c=e.max??5,l=t.text(e.label),u=t.value(e.value),d=u==null||u===``?void 0:Number(u),f=d!==void 0&&Number.isFinite(d)?Math.max(0,Math.min(c,d)):void 0,p=!!t.value(e.readOnly),m=e.count===void 0?void 0:t.value(e.count),h=m==null?void 0:j(m,{type:`number`},n.locale),g=e.help===void 0?void 0:t.text(e.help),_=f===void 0?void 0:j(f,{type:`number`,precision:+!Number.isInteger(f)},n.locale),y=m==null?void 0:`from ${h} ${Number(m)===1?`rating`:`ratings`}`;if(p){let e=f===void 0?`not yet rated`:`${_} out of ${c}`;return(0,R.jsxs)(`div`,{className:`pxd-rating pxd-rating-readonly`,...s,children:[(0,R.jsx)(`span`,{className:`pxd-rating-label`,children:l}),(0,R.jsx)(`span`,{className:`pxd-rating-stars`,role:`img`,"aria-label":e,children:Array.from({length:c},(e,t)=>(0,R.jsx)(bg,{fill:(f??0)-t},t))}),(0,R.jsxs)(`span`,{className:`pxd-rating-readout`,children:[_&&(0,R.jsx)(`span`,{className:`pxd-rating-value`,"aria-hidden":`true`,children:_}),h&&(0,R.jsxs)(`span`,{className:`pxd-rating-count`,children:[(0,R.jsxs)(`span`,{"aria-hidden":`true`,children:[`(`,h,`)`]}),(0,R.jsx)(`span`,{className:`pxd-sr-only`,children:y})]})]})]})}let b=f===void 0?0:Math.round(f),x=a??b,S=r=>{let i=Number(r);t.write(e.value,i),pg(n,t,e,i)};return(0,R.jsxs)(`div`,{className:`pxd-field pxd-rating`,...s,children:[(0,R.jsxs)(`div`,{className:`pxd-field-label`,id:r,children:[l,e.required&&(0,R.jsx)(`span`,{className:`pxd-required`,"aria-hidden":`true`,children:`*`})]}),g&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:i,children:g}),(0,R.jsxs)(`div`,{className:`pxd-rating-row`,children:[(0,R.jsx)(qf,{className:`pxd-rating-stars`,orientation:`horizontal`,"aria-labelledby":r,"aria-describedby":g?i:void 0,"aria-required":e.required||void 0,value:b?String(b):``,onValueChange:S,onMouseLeave:()=>o(null),children:Array.from({length:c},(e,t)=>t+1).map(e=>(0,R.jsx)(Qf,{value:String(e),className:`pxd-rating-star${e<=x?` pxd-rating-star-on`:``}`,"aria-label":xg(e),onMouseEnter:()=>o(e),onFocus:()=>o(null),children:(0,R.jsx)(bg,{fill:+(e<=x)})},e))}),(0,R.jsxs)(`span`,{className:`pxd-rating-readout`,"aria-hidden":`true`,children:[_&&(0,R.jsx)(`span`,{className:`pxd-rating-value`,children:_}),h&&(0,R.jsxs)(`span`,{className:`pxd-rating-count`,children:[`(`,h,`)`]})]}),y&&(0,R.jsx)(`span`,{className:`pxd-sr-only`,children:y})]})]})}var Cg=2e3;function wg({node:e}){let t=P(),n=(0,v.useId)(),r=$(e),i=t.text(e.text),a=e.label===void 0?void 0:t.text(e.label),o=!!t.value(e.secret),s=e.copyable!==!1,[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),f=(0,v.useRef)(null);(0,v.useEffect)(()=>()=>{f.current&&clearTimeout(f.current)},[]);let p=e=>{d(e),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>d(``),Cg)},m=()=>{let e=typeof navigator<`u`?navigator.clipboard:void 0;if(!e?.writeText)return p(`Couldn't copy`);e.writeText(i).then(()=>p(`Copied`),()=>p(`Couldn't copy`))},h=o&&!c,g=h?i.replace(/[^\s]/g,`•`):i,_=a??`code`,y=a??(e.language?`${e.language} code`:`Code`);return(0,R.jsxs)(`section`,{className:`pxd-code${e.wrap?` pxd-code-wrap`:``}${o?` pxd-code-secret`:``}`,"aria-labelledby":a===void 0?void 0:n,"aria-label":a===void 0?y:void 0,...r,children:[(0,R.jsxs)(`div`,{className:`pxd-code-header`,children:[a!==void 0&&(0,R.jsx)(`span`,{className:`pxd-code-label`,id:n,children:a}),(0,R.jsxs)(`div`,{className:`pxd-code-controls`,children:[o&&(0,R.jsx)(`button`,{type:`button`,className:`pxd-button pxd-button-tertiary pxd-code-control`,"aria-label":`${c?`Hide`:`Show`} ${_}`,onClick:()=>l(e=>!e),children:c?`Hide`:`Show`}),s&&(0,R.jsxs)(`button`,{type:`button`,className:`pxd-button pxd-button-tertiary pxd-code-control`,"aria-label":`Copy ${_}`,onClick:m,children:[u===`Copied`&&(0,R.jsx)(Q,{name:`check`,size:16}),u===`Copied`?`Copied`:`Copy`]}),(0,R.jsx)(`span`,{className:`pxd-sr-only`,role:`status`,"aria-live":`polite`,children:u})]})]}),(0,R.jsx)(`pre`,{className:`pxd-code-pre`,tabIndex:0,"data-language":e.language,"data-masked":h||void 0,children:(0,R.jsx)(`code`,{className:e.language?`language-${e.language}`:void 0,translate:`no`,children:g})})]})}var Tg=e=>typeof e==`object`&&!!e&&typeof e.path==`string`;function Eg(){return(0,R.jsx)(`svg`,{className:`pxd-action-menu-chevron`,width:16,height:16,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,R.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}function Dg({node:e}){let t=P(),n=N(),r=$(e),i=e.kind??`overflow`,a=t.text(e.label),o=r[`aria-label`]??a,s=(e.children??[]).map(e=>n.byId.get(e)).filter(e=>!!e&&(e.visible===void 0||t.value(e.visible)!==!1)),c=s.filter(e=>e.tone!==`danger`),l=s.filter(e=>e.tone===`danger`),u=e=>{let r=r=>(0,R.jsx)(e.Item,{className:`pxd-menu-item${r.tone===`danger`?` pxd-menu-item-danger`:``}`,disabled:r.disabled===void 0?void 0:!!t.value(r.disabled),onSelect:()=>n.dispatch(r.action,t.scope,r.id),"data-pxd-id":r.id,"data-pxd-component":r.component,children:t.text(r.label)},r.id);return(0,R.jsxs)(R.Fragment,{children:[c.map(r),l.length>0&&c.length>0&&(0,R.jsx)(e.Separator,{className:`pxd-menu-separator`}),l.map(r)]})},d=(0,R.jsx)(Td,{className:`pxd-icon-button pxd-action-menu-trigger pxd-action-menu-overflow`,...r,"aria-label":o,children:(0,R.jsx)(Q,{name:`dots`,size:18})}),f=(0,R.jsx)(Ed,{container:n.portal,children:(0,R.jsx)(Dd,{className:`pxd-menu pxd-action-menu`,align:`end`,sideOffset:4,children:u($u)})});if(i===`dropdown`)return(0,R.jsxs)(wd,{children:[(0,R.jsxs)(Td,{className:`pxd-button pxd-button-secondary pxd-action-menu-trigger pxd-action-menu-dropdown`,...r,"aria-label":r[`aria-label`],children:[a,(0,R.jsx)(Eg,{})]}),f]});if(i===`split`){let t=(e.primary?n.byId.get(e.primary):void 0)?.emphasis??`secondary`;return(0,R.jsxs)(wd,{children:[(0,R.jsxs)(`div`,{className:`pxd-split`,role:`group`,...r,"aria-label":o,children:[e.primary&&(0,R.jsx)(c_,{id:e.primary}),(0,R.jsx)(Td,{className:`pxd-button pxd-button-${t} pxd-action-menu-trigger pxd-split-menu`,"aria-label":`${a}: more options`,children:(0,R.jsx)(Eg,{})})]}),f]})}return i===`context`?(0,R.jsxs)(Ru,{children:[(0,R.jsx)(zu,{asChild:!0,children:(0,R.jsx)(`span`,{className:`pxd-context-target`,children:(0,R.jsxs)(wd,{children:[d,f]})})}),(0,R.jsx)(Bu,{container:n.portal,children:(0,R.jsx)(Vu,{className:`pxd-menu pxd-action-menu`,"aria-label":o,children:u(lu)})})]}):(0,R.jsxs)(wd,{children:[d,f]})}function Og(e,t,n){let r=(0,v.useRef)(null),i=()=>{r.current=null,t.current&&(t.current.style.transform=``,t.current.style.transition=``)};return e?{onPointerDown:e=>{(e.pointerType!==`mouse`||e.button===0)&&(r.current=e.clientY,e.currentTarget.setPointerCapture(e.pointerId))},onPointerMove:e=>{if(r.current===null||!t.current)return;let n=Math.max(0,e.clientY-r.current);t.current.style.transition=`none`,t.current.style.transform=`translateY(${n}px)`},onPointerUp:e=>{if(r.current===null)return;let t=e.clientY-r.current;i(),t>80&&n()},onPointerCancel:i}:{}}function kg({node:e}){let t=P(),n=N(),r=$(e),i=Math.min((0,v.useContext)(re),6),a=(0,v.useId)(),o=(0,v.useRef)(null),s=e.kind??`dialog`,c=e.size??`default`,l=e.dismissible!==!1,u=Tg(e.open),[d,f]=(0,v.useState)(!0),p=u?!!t.value(e.open):d&&e.open!==!1,m=()=>{u?t.write(e.open,!1):f(!1),n.dispatch({event:{name:`ui.dismiss`}},t.scope,e.id)},h=e=>{e||m()},g=l?{}:{onEscapeKeyDown:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault()},_=Og(s===`sheet`&&l,o,m),y=t.text(e.title),b=`pxd-panel pxd-panel-${s} pxd-panel-size-${c}`,x=(0,R.jsx)(re.Provider,{value:i+1,children:(0,R.jsx)(`div`,{className:`pxd-panel-body pxd-stack`,children:(0,R.jsx)(Om,{ids:e.children})})}),S=e.actions&&(0,R.jsx)(`div`,{className:`pxd-panel-footer`,children:(0,R.jsx)(c_,{id:e.actions})});return s===`popover`?(0,R.jsxs)(vf,{open:p,onOpenChange:h,children:[(0,R.jsx)(yf,{className:`pxd-panel-anchor`}),(0,R.jsx)(bf,{container:n.portal,children:(0,R.jsxs)(xf,{className:b,"aria-labelledby":a,sideOffset:8,collisionPadding:8,...g,...r,children:[(0,R.jsxs)(`div`,{className:`pxd-panel-header`,children:[(0,v.createElement)(`h${i}`,{id:a,className:`pxd-panel-title`},y),l&&(0,R.jsx)(Sf,{className:`pxd-icon-button pxd-panel-close`,"aria-label":`Close`,children:(0,R.jsx)(Q,{name:`close`})})]}),x,S,(0,R.jsx)(Cf,{className:`pxd-panel-arrow`,width:16,height:8})]})})]}):(0,R.jsx)(ci,{open:p,onOpenChange:h,children:(0,R.jsxs)(mi,{container:n.portal,children:[(0,R.jsx)(gi,{className:`pxd-overlay pxd-panel-backdrop`}),(0,R.jsxs)(bi,{ref:o,className:b,"aria-describedby":void 0,...g,...r,children:[(0,R.jsxs)(`div`,{className:`pxd-panel-header`,..._,children:[s===`sheet`&&(0,R.jsx)(`span`,{className:`pxd-panel-grip`,"aria-hidden":`true`}),(0,R.jsx)(Ti,{asChild:!0,children:(0,v.createElement)(`h${i}`,{className:`pxd-panel-title`},y)}),l&&(0,R.jsx)(ki,{className:`pxd-icon-button pxd-panel-close`,"aria-label":`Close`,children:(0,R.jsx)(Q,{name:`close`})})]}),x,S]})]})})}var Ag=()=>(0,R.jsx)(`span`,{className:`pxd-required`,"aria-hidden":`true`,children:`*`});function jg(e,t,n,r){let i=t.pointer(n.value),a=Object.fromEntries(Object.entries(n.action.event.context??{}).map(([e,n])=>[e,n&&typeof n==`object`&&`path`in n&&w(n.path,t.scope)===i?r:t.value(n)]));e.dispatch({event:{name:n.action.event.name,context:a}},{pointer:``},n.id)}var Mg=(...e)=>e.filter(Boolean).join(` `)||void 0,Ng=[`byte`,`kilobyte`,`megabyte`,`gigabyte`];function Pg(e,t){let n=0,r=e;for(;r>=1024&&n<Ng.length-1;)r/=1024,n++;try{return new Intl.NumberFormat(t,{style:`unit`,unit:Ng[n],unitDisplay:`short`,maximumFractionDigits:+(r<10)}).format(r)}catch{return`${Math.round(r*10)/10} ${[`B`,`KB`,`MB`,`GB`][n]}`}}function Fg(e){let t=e.trim().toLowerCase();if(t.startsWith(`.`))return t.slice(1).toUpperCase();let n={"image/*":`images`,"video/*":`videos`,"audio/*":`audio`,"text/*":`text files`};if(n[t])return n[t];if(t===`application/pdf`)return`PDF`;let r=t.split(`/`)[1];return r?r.replace(/^(x-|vnd\.)/,``).toUpperCase():e}function Ig(e){return e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} or ${e[e.length-1]}`}function Lg(e,t){if(t.length===0)return!0;let n=e.name.toLowerCase(),r=e.type.toLowerCase();return t.some(e=>{let t=e.trim().toLowerCase();return t.startsWith(`.`)?n.endsWith(t):t.endsWith(`/*`)?r.startsWith(t.slice(0,-1)):r===t})}var Rg=e=>{typeof e.ref==`string`&&e.ref.startsWith(`blob:`)&&URL.revokeObjectURL(e.ref)};function zg({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=(0,v.useId)(),a=(0,v.useId)(),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1),u=t.value(e.value),d=Array.isArray(u)?u:[],f=Array.isArray(e.accept)?e.accept:[],p=e.maxSize,m=!!e.multiple,h=t.text(e.label),g=f.length?Ig(f.map(Fg)):``,_=[g&&`Accepts ${g}.`,p&&`Up to ${Pg(p,n.locale)}${m?` each`:``}.`].filter(Boolean).join(` `),y=[e.help===void 0?``:t.text(e.help),_].filter(Boolean).join(` `)||void 0,b=r=>{if(!r)return;let i=Array.from(r),a=[],o=[];for(let e of m?i:i.slice(0,1))p&&e.size>p?o.push(`${e.name} is ${Pg(e.size,n.locale)}; the limit is ${Pg(p,n.locale)}.`):Lg(e,f)?a.push({name:e.name,size:e.size,type:e.type,ref:URL.createObjectURL(e)}):o.push(`${e.name} isn't an accepted type${g?` (${g})`:``}.`);if(s(o.length?o.join(` `):null),a.length!==0){if(m){let n=a.filter(e=>!d.some(t=>t.name===e.name&&t.size===e.size));a.filter(e=>!n.includes(e)).forEach(Rg),n.length&&t.write(e.value,[...d,...n])}else d.forEach(Rg),t.write(e.value,a)}},x=n=>{Rg(d[n]),t.write(e.value,d.filter((e,t)=>t!==n)),s(null)};return(0,R.jsxs)(`div`,{className:`pxd-field pxd-file`,children:[(0,R.jsxs)(`label`,{className:`pxd-field-label`,htmlFor:r,children:[h,e.required&&(0,R.jsx)(Ag,{})]}),y&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:i,children:y}),(0,R.jsxs)(`div`,{className:`pxd-dropzone`,"data-dragging":c||void 0,onDrop:e=>{e.preventDefault(),l(!1),b(e.dataTransfer.files)},onDragOver:e=>{e.preventDefault(),c||l(!0)},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||l(!1)},children:[(0,R.jsx)(`input`,{id:r,className:`pxd-dropzone-input`,type:`file`,accept:f.length?f.join(`,`):void 0,multiple:m,required:e.required&&d.length===0,"aria-describedby":Mg(y&&i,o&&a),"aria-invalid":o?!0:void 0,onChange:e=>{b(e.target.files),e.target.value=``},...$(e)}),(0,R.jsx)(`span`,{className:`pxd-dropzone-icon`,"aria-hidden":`true`,children:(0,R.jsx)(Q,{name:`file`,size:24})}),(0,R.jsxs)(`span`,{className:`pxd-dropzone-text`,children:[(0,R.jsx)(`span`,{className:`pxd-dropzone-action`,children:m?`Choose files`:`Choose a file`}),(0,R.jsx)(`span`,{className:`pxd-dropzone-hint`,children:m?`or drop them here`:`or drop it here`})]})]}),o&&(0,R.jsx)(`p`,{className:`pxd-field-error`,id:a,role:`alert`,children:o}),d.length>0&&(0,R.jsx)(`ul`,{className:`pxd-file-list`,children:d.map((e,t)=>(0,R.jsxs)(`li`,{className:`pxd-file-item`,children:[(0,R.jsx)(`span`,{className:`pxd-file-icon`,"aria-hidden":`true`,children:(0,R.jsx)(Q,{name:`file`,size:18})}),(0,R.jsxs)(`span`,{className:`pxd-file-text`,children:[(0,R.jsx)(`span`,{className:`pxd-file-name`,children:e.name}),(0,R.jsx)(`span`,{className:`pxd-file-size`,children:Pg(e.size,n.locale)}),typeof e.progress==`number`&&e.progress<1&&(0,R.jsx)(`progress`,{className:`pxd-file-progress`,value:e.progress,max:1,"aria-label":`Uploading ${e.name}`})]}),(0,R.jsx)(`button`,{type:`button`,className:`pxd-file-remove`,"aria-label":`Remove ${e.name}`,onClick:()=>x(t),children:(0,R.jsx)(Q,{name:`close`,size:18})})]},`${e.name}-${e.size}-${t}`))})]})}var Bg=(e,t,n)=>Math.min(n,Math.max(t,e)),Vg=e=>Bg(Math.round(e),0,255).toString(16).padStart(2,`0`),Hg=e=>e===void 0?1:Bg(e.endsWith(`%`)?parseFloat(e)/100:parseFloat(e),0,1),Ug=e=>e.endsWith(`%`)?parseFloat(e)/100*255:parseFloat(e);function Wg(e,t,n){let r=(e%360+360)%360/360;if(t===0)return[n*255,n*255,n*255];let i=n<.5?n*(1+t):n+t-n*t,a=2*n-i,o=e=>(e<0&&(e+=1),e>1&&--e,e<1/6?a+(i-a)*6*e:e<1/2?i:e<2/3?a+(i-a)*(2/3-e)*6:a);return[o(r+1/3)*255,o(r)*255,o(r-1/3)*255]}function Gg(e,t,n){let r=e/255,i=t/255,a=n/255,o=Math.max(r,i,a),s=Math.min(r,i,a),c=(o+s)/2;if(o===s)return[0,0,c];let l=o-s,u=c>.5?l/(2-o-s):l/(o+s),d=o===r?(i-a)/l+(i<a?6:0):o===i?(a-r)/l+2:(r-i)/l+4;return d/=6,[d*360,u,c]}function Kg(e){if(typeof e!=`string`)return null;let t=e.trim(),n=/^#([0-9a-f]{3,8})$/i.exec(t);if(n){let e=n[1];if(e.length===3||e.length===4){let[t,n,r,i]=e.split(``).map(e=>parseInt(e+e,16));return{r:t,g:n,b:r,a:e.length===4?i/255:1}}if(e.length===6||e.length===8){let t=t=>parseInt(e.slice(t,t+2),16);return{r:t(0),g:t(2),b:t(4),a:e.length===8?t(6)/255:1}}return null}let r=/^(rgba?|hsla?)\(\s*([^)]+?)\s*\)$/i.exec(t);if(!r)return null;let i=r[2].split(/\s*[,/]\s*|\s+/).filter(Boolean);if(i.length<3||i.length>4)return null;let a=Hg(i[3]);if(Number.isNaN(a))return null;if(r[1].toLowerCase().startsWith(`rgb`)){let[e,t,n]=i.slice(0,3).map(Ug);return[e,t,n].some(Number.isNaN)?null:{r:Bg(e,0,255),g:Bg(t,0,255),b:Bg(n,0,255),a}}let o=parseFloat(i[0]),s=parseFloat(i[1])/100,c=parseFloat(i[2])/100;if([o,s,c].some(Number.isNaN))return null;let[l,u,d]=Wg(o,Bg(s,0,1),Bg(c,0,1));return{r:l,g:u,b:d,a}}function qg(e,t,n){let r=n?Math.round(e.a*100)/100:1,i=Math.round(e.r),a=Math.round(e.g),o=Math.round(e.b);if(t===`rgb`)return r<1?`rgba(${i}, ${a}, ${o}, ${r})`:`rgb(${i}, ${a}, ${o})`;if(t===`hsl`){let[e,t,n]=Gg(i,a,o),s=Math.round(e),c=Math.round(t*100),l=Math.round(n*100);return r<1?`hsla(${s}, ${c}%, ${l}%, ${r})`:`hsl(${s}, ${c}%, ${l}%)`}return`#${Vg(i)}${Vg(a)}${Vg(o)}${r<1?Vg(r*255):``}`}var Jg=e=>e?`#${Vg(e.r)}${Vg(e.g)}${Vg(e.b)}`:`#000000`,Yg=`__other`;function Xg({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=(0,v.useId)(),a=(0,v.useId)(),o=(0,v.useId)(),s=(0,v.useId)(),c=e.format??`hex`,l=!!e.alpha,u=t.text(e.label),d=e.help===void 0?void 0:t.text(e.help),f=t.value(e.value),p=f==null?``:String(f),m=Kg(p),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)(!1),b=$(e),x=e.swatches?Fh({...e,options:e.swatches},n.data,t.scope,t.text):[],S=x.length>0,C=n=>t.write(e.value,qg(n,c,l)),w=e=>{g(e);let t=Kg(e);t&&C(t)},T=(e,t)=>!!(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)&&(!l||Math.abs(e.a-t.a)<.005)),E=x.findIndex(e=>m?T(Kg(e.value),m):String(e.value)===p&&p!==``),D=_?Yg:E>=0?String(E):p?Yg:``,O=!S||D===Yg,k=(0,R.jsxs)(`div`,{className:`pxd-color-picker`,children:[(0,R.jsx)(`input`,{id:a,className:`pxd-color-native`,type:`color`,value:Jg(m),"aria-label":`${u}: pick`,"aria-describedby":Mg(d&&i),onChange:e=>{let t=Kg(e.target.value);t&&(g(null),C({...t,a:m?.a??1}))}}),(0,R.jsx)(`input`,{id:o,className:`pxd-input pxd-input-mono pxd-color-text`,type:`text`,inputMode:`text`,autoComplete:`off`,spellCheck:!1,placeholder:c===`hex`?`#000000`:c===`rgb`?`rgb(0, 0, 0)`:`hsl(0, 0%, 0%)`,value:h??p,"aria-label":`${u}: value`,"aria-describedby":Mg(d&&i),"aria-invalid":h!==null&&h!==``&&!Kg(h)||void 0,required:!S&&e.required,onChange:e=>w(e.target.value),onBlur:()=>g(null)}),l&&(0,R.jsxs)(`label`,{className:`pxd-color-alpha`,htmlFor:s,children:[(0,R.jsx)(`span`,{className:`pxd-color-alpha-label`,children:`Opacity`}),(0,R.jsx)(`input`,{id:s,type:`range`,min:0,max:100,step:1,value:Math.round((m?.a??1)*100),disabled:!m,"aria-valuetext":`${Math.round((m?.a??1)*100)}%`,onChange:e=>{m&&(g(null),C({...m,a:Number(e.target.value)/100}))}}),(0,R.jsxs)(`output`,{className:`pxd-color-alpha-value`,htmlFor:s,"aria-hidden":`true`,children:[Math.round((m?.a??1)*100),`%`]})]})]});return S?(0,R.jsxs)(`div`,{className:`pxd-field pxd-color`,...b,children:[(0,R.jsxs)(`div`,{className:`pxd-field-label`,id:r,children:[u,e.required&&(0,R.jsx)(Ag,{})]}),d&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:i,children:d}),(0,R.jsxs)(qf,{className:`pxd-swatches`,"aria-labelledby":r,"aria-describedby":Mg(d&&i),"aria-required":e.required||void 0,value:D,orientation:`horizontal`,onValueChange:n=>{if(n===Yg)return y(!0);y(!1),g(null);let r=x[Number(n)],i=Kg(r.value);t.write(e.value,i?qg(i,c,l):r.value)},children:[x.map((e,t)=>(0,R.jsxs)(Qf,{value:String(t),className:`pxd-swatch`,title:e.label,children:[(0,R.jsx)(`span`,{className:`pxd-swatch-color`,style:{background:String(e.value)},"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`pxd-swatch-name`,children:e.label})]},String(t))),(0,R.jsxs)(Qf,{value:Yg,className:`pxd-swatch pxd-swatch-other`,title:`Other`,children:[(0,R.jsx)(`span`,{className:`pxd-swatch-color`,style:D===Yg&&m?{background:p}:void 0,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`pxd-swatch-name`,children:`Other`})]})]}),O&&k]}):(0,R.jsxs)(`div`,{className:`pxd-field pxd-color`,role:`group`,"aria-labelledby":r,"aria-describedby":Mg(d&&i),...b,children:[(0,R.jsxs)(`div`,{className:`pxd-field-label`,id:r,children:[u,e.required&&(0,R.jsx)(Ag,{})]}),d&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:i,children:d}),k]})}var Zg=(e,t)=>Array.from({length:t},(t,n)=>e[n]??``);function Qg({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=(0,v.useId)(),a=Bg(Number(e.length)||6,4,12),o=(e.kind??`numeric`)===`numeric`,s=e.required??!0,c=t.text(e.label),l=e.help===void 0?void 0:t.text(e.help),u=t.value(e.value),d=u==null?``:String(u),[f,p]=(0,v.useState)(()=>Zg(d,a)),[m,h]=(0,v.useState)(d);d!==m&&(h(d),d!==f.join(``)&&p(Zg(d,a)));let[g,_]=(0,v.useState)(null),y=(0,v.useRef)([]),b=$(e),x=e=>e.replace(o?/[^0-9]/g:/[^0-9a-zA-Z]/g,``),S=e=>y.current[Bg(e,0,a-1)]?.focus(),C=r=>{p(r);let i=r.join(``);h(i),t.write(e.value,i),e.action&&r.every(Boolean)&&i!==g&&(_(i),jg(n,t,e,i))},w=(e,t)=>{let n=x(t);if(!n)return;let r=[...f],i=e;for(let e of n){if(i>=a)break;r[i++]=e}C(r),S(i)},T=(e,t)=>{let n=f[e],r=t.target.value;if(n&&r.length>1&&(r=r.startsWith(n)?r.slice(n.length):r.endsWith(n)?r.slice(0,-n.length):r),r===``){let t=[...f];return t[e]=``,C(t)}w(x(r).length>=a?0:e,r)},E=(e,t)=>{if(t.key===`Backspace`&&!f[e]&&e>0){t.preventDefault();let n=[...f];n[e-1]=``,C(n),S(e-1)}else t.key===`ArrowLeft`?(t.preventDefault(),S(e-1)):t.key===`ArrowRight`&&(t.preventDefault(),S(e+1))},D=(e,t)=>{t.preventDefault();let n=t.clipboardData.getData(`text`);w(x(n).length>=a?0:e,n)},O=a>6?a%4==0?4:3:a,k=[];for(let e=0;e<a;e+=O)k.push(Array.from({length:Math.min(O,a-e)},(t,n)=>e+n));return(0,R.jsxs)(`div`,{className:`pxd-field pxd-code`,role:`group`,"aria-labelledby":r,"aria-describedby":Mg(l&&i),...b,children:[(0,R.jsxs)(`div`,{className:`pxd-field-label`,id:r,children:[c,s&&(0,R.jsx)(Ag,{})]}),l&&(0,R.jsx)(`p`,{className:`pxd-field-help`,id:i,children:l}),(0,R.jsx)(`div`,{className:`pxd-code-boxes`,children:k.map((e,t)=>(0,R.jsx)(`div`,{className:`pxd-code-group`,children:e.map(e=>(0,R.jsx)(`input`,{ref:t=>{y.current[e]=t},className:`pxd-code-box`,type:`text`,inputMode:o?`numeric`:`text`,pattern:o?`[0-9]*`:`[0-9A-Za-z]*`,autoComplete:e===0?`one-time-code`:`off`,autoCapitalize:o?void 0:`characters`,spellCheck:!1,"aria-label":`Digit ${e+1} of ${a}`,value:f[e],"data-filled":f[e]?``:void 0,required:s,onFocus:e=>e.target.select(),onChange:t=>T(e,t),onKeyDown:t=>E(e,t),onPaste:t=>D(e,t)},e))},t))})]})}var $g=200,e_=10,t_=40,n_=500,r_=e=>e==null?``:String(e);function i_({node:e}){let t=P(),n=N(),r=(0,v.useId)(),i=(0,v.useRef)(null),a=(0,v.useRef)(null),o=w(e.items.path,t.scope),s=O(E(n.data,o)),c=e.selection??`none`,l=c!==`none`&&!!e.selected,u=e.expanded?O(t.value(e.expanded)):void 0,[d,f]=(0,v.useState)(null),p=(0,v.useMemo)(()=>u?new Set(u):d,[u,d]),m=(0,v.useCallback)((e,t)=>p?p.has(e):t===1,[p]),h=l?t.value(e.selected):void 0,g=e=>Array.isArray(h)?h.includes(e):h!==void 0&&h===e,_=(0,v.useCallback)(t=>{let r=r_(E(n.data,w(e.labelPath,t))),i=(e.valuePath?E(n.data,w(e.valuePath,t)):r)??(r||t.pointer),a=e.detailPath?E(n.data,w(e.detailPath,t)):void 0;return{label:r,value:i,detail:a==null||a===``?void 0:String(a),children:O(E(n.data,w(e.childrenPath,t)))}},[n.data,e.labelPath,e.valuePath,e.detailPath,e.childrenPath]),{rows:y,indexByKey:b,topValues:x}=(0,v.useMemo)(()=>{let t=[],n=new Map,r=[],i=(a,o,s,c)=>{a.forEach((l,u)=>{let d={pointer:T(o,u)},{label:f,value:p,detail:h,children:g}=_(d);s===1&&r.push(p);let v=g.length>0,y=v&&m(p,s),b=t.length;n.set(d.pointer,b),t.push({key:d.pointer,scope:d,level:s,setsize:a.length,posinset:u+1,label:f,value:p,detail:h,hasChildren:v,expanded:y,parent:c}),y&&i(g,w(e.childrenPath,d),s+1,b)})};return i(s,o,1,-1),{rows:t,indexByKey:n,topValues:r}},[s,o,_,m,e.childrenPath]),[S,C]=(0,v.useState)(null),D=(S===null?void 0:b.get(S))??0,k=(0,v.useRef)(null),A=y.length>$g,[j,ee]=(0,v.useState)(t_),[te,ne]=(0,v.useState)(480),[re,ie]=(0,v.useState)(0),ae=A?Math.max(0,Math.floor(re/j)-e_):0,oe=A?Math.min(y.length,Math.ceil((re+te)/j)+e_):y.length;(0,v.useLayoutEffect)(()=>{if(!A)return;let e=a.current,t=i.current?.querySelector(`.pxd-tree-item`);if(t&&t.offsetHeight>0&&ee(t.offsetHeight),!e)return;let n=()=>ne(e.clientHeight||480);if(n(),typeof ResizeObserver>`u`)return;let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[A]);let se=e=>{A&&ie(e.currentTarget.scrollTop)},ce=e=>{if(!y.length)return;let t=Math.max(0,Math.min(y.length-1,e));C(y[t].key);let n=i.current?.querySelector(`[data-index="${t}"]`);if(n){n.focus();return}k.current=t;let r=a.current;if(A&&r){let e=Math.max(0,t*j-(te-j)/2);r.scrollTop=e,ie(e)}};(0,v.useEffect)(()=>{if(k.current===null)return;let e=i.current?.querySelector(`[data-index="${k.current}"]`);e&&(k.current=null,e.focus())});let le=(n,r)=>{if(e.expanded){let i=u??[],a=r?[...i,...n.filter(e=>!i.includes(e))]:i.filter(e=>!n.includes(e));t.write(e.expanded,a);return}f(e=>{let t=new Set(e??x);for(let e of n)r?t.add(e):t.delete(e);return t})},F=e=>le([e.value],!e.expanded),ue=n=>{if(!l)return;if(c===`single`){t.write(e.selected,n.value);return}let r=Array.isArray(h)?h:[];t.write(e.selected,r.includes(n.value)?r.filter(e=>e!==n.value):[...r,n.value])},de=t=>{ue(t),e.action&&n.dispatch(e.action,t.scope,e.id)},fe=(0,v.useRef)({buffer:``,at:0}),pe=e=>{let t=Date.now(),n=fe.current;n.buffer=t-n.at<n_?n.buffer+e.toLowerCase():e.toLowerCase(),n.at=t;let r=e=>{for(let t=1;t<=y.length;t++){let n=(D+t)%y.length;if(y[n].label.toLowerCase().startsWith(e))return n}return-1},i=n.buffer.length>1&&[...n.buffer].every(e=>e===n.buffer[0])?r(n.buffer[0]):r(n.buffer);i<0&&n.buffer.length>1&&(i=r(n.buffer[0])),i>=0&&ce(i)},me=e=>{let t=y[D];if(!t)return;let n=!0;switch(e.key){case`ArrowDown`:ce(D+1);break;case`ArrowUp`:ce(D-1);break;case`ArrowRight`:t.hasChildren&&!t.expanded?F(t):t.expanded&&ce(D+1);break;case`ArrowLeft`:t.expanded?F(t):t.parent>=0&&ce(t.parent);break;case`Home`:ce(0);break;case`End`:ce(y.length-1);break;case`Enter`:de(t);break;case` `:ue(t);break;case`*`:le(y.filter(e=>e.parent===t.parent&&e.hasChildren).map(e=>e.value),!0);break;default:e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey?pe(e.key):n=!1}n&&(e.preventDefault(),e.stopPropagation())},I=t.text(e.label),L=A?{paddingTop:ae*j,paddingBottom:(y.length-oe)*j}:void 0,he=(0,R.jsx)(`ul`,{ref:i,role:`tree`,className:`pxd-tree-list`,"aria-labelledby":r,"aria-multiselectable":c===`multiple`||void 0,style:L,onKeyDown:me,children:y.slice(ae,oe).map((t,r)=>{let i=ae+r,a=l?g(t.value):void 0;return(0,R.jsx)(`li`,{role:`treeitem`,className:`pxd-tree-item${a?` pxd-tree-item-selected`:``}`,style:{"--polyxd-tree-depth":t.level-1},"data-index":i,tabIndex:i===D?0:-1,"aria-level":t.level,"aria-setsize":t.setsize,"aria-posinset":t.posinset,"aria-expanded":t.hasChildren?t.expanded:void 0,"aria-selected":a,onFocus:e=>{e.target===e.currentTarget&&C(t.key)},onClick:e=>{e.stopPropagation(),ce(i),l?ue(t):t.hasChildren&&F(t)},onDoubleClick:r=>{r.stopPropagation(),e.action?n.dispatch(e.action,t.scope,e.id):t.hasChildren&&F(t)},children:(0,R.jsx)(M.Provider,{value:t.scope,children:(0,R.jsxs)(`div`,{className:`pxd-tree-row`,children:[t.hasChildren?(0,R.jsx)(`button`,{type:`button`,className:`pxd-tree-expander${t.expanded?` pxd-tree-expander-open`:``}`,tabIndex:-1,"aria-hidden":`true`,onClick:e=>{e.stopPropagation(),ce(i),F(t)},onDoubleClick:e=>e.stopPropagation(),children:(0,R.jsx)(Q,{name:`chevronRight`,size:16})}):(0,R.jsx)(`span`,{className:`pxd-tree-expander pxd-tree-expander-leaf`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`pxd-tree-text`,children:t.label}),t.detail!==void 0&&(0,R.jsx)(`span`,{className:`pxd-tree-detail`,children:t.detail})]})})},t.key)})});return(0,R.jsxs)(`div`,{className:`pxd-tree`,...$(e),children:[(0,R.jsx)(`div`,{className:`pxd-tree-caption`,id:r,children:I}),A?(0,R.jsx)(`div`,{ref:a,className:`pxd-tree-viewport`,onScroll:se,children:he}):he]})}var a_={Section:Am,Group:jm,Card:Mm,Disclosure:Pm,Views:Fm,Navigation:fg,Text:Jm,Metric:Ym,DetailList:Xm,Collection:$m,Table:Hm,Chart:yh,Media:eh,Status:dh,TextInput:Th,Choice:Rh,Toggle:zh,DateInput:Vh,RangeInput:Hh,Form:Gh,Action:$h,ActionBar:og,Steps:tg,Confirm:ng,Comparison:rg,FilterPanel:lg,Tag:mg,Identity:gg,Progress:vg,Rating:Sg,Code:wg,Tree:i_,ActionMenu:Dg,Panel:kg,FileInput:zg,ColorInput:Xg,CodeInput:Qg};function o_({document:e,data:t,onAction:n,onDataChange:r,derive:i,onDismiss:a,theme:o,mode:s,density:c,disclosure:l=`progressive`,locale:u=`en-GB`,resolveMedia:d,components:f,className:p}){let[m,h]=(0,v.useState)(()=>t??e.data??{}),[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(null),x=(0,v.useMemo)(()=>new Map(e.components.map(e=>[e.id,e])),[e]),S=(0,v.useMemo)(()=>({...a_,...f}),[f]),C={doc:e,byId:x,data:m,setValue:(0,v.useCallback)((e,t)=>h(n=>{let a=D(n,e,t),o=i?.(a)??a;return r?.(o),o}),[r,i]),dispatch:(0,v.useCallback)((e,t,r)=>{if(!e)return;let{name:i,context:o}=e.event;if(i===`ui.dismiss`)return a?.();n?.({name:i,context:A(o,m,t),source:r})},[m,n,a]),locale:u,resolveMedia:d,portal:g,root:y,components:S,disclosure:l},w=x.get(e.root)?.component===`Confirm`,T=e.components.find(e=>e.component===`Navigation`&&(!e.kind||e.kind===`main`));return(0,R.jsx)(ne.Provider,{value:C,children:(0,R.jsxs)(`div`,{ref:b,className:[`pxd-surface`,e.surface.presentation===`panel`?`pxd-surface-panel`:null,T?`pxd-surface-with-nav`:null,p].filter(Boolean).join(` `),"data-pxd-theme":o,"data-pxd-mode":s,"data-pxd-density":c,"data-pxd-surface":e.surface.id,lang:u,children:[T&&(0,R.jsx)(c_,{id:T.id}),(0,R.jsxs)(`div`,{className:`pxd-surface-main`,children:[!w&&(0,R.jsx)(s_,{}),(0,R.jsx)(c_,{id:e.root})]}),(0,R.jsx)(`div`,{ref:_,className:`pxd-portal`})]})})}function s_(){let e=N(),{title:t,subtitle:n,breadcrumbs:r,badge:i,avatar:a,actions:o}=e.doc.surface,s=t=>String(k(t,e.data,b)??``);return!n&&!r&&!i&&!a&&!o?(0,R.jsx)(`h1`,{className:`pxd-surface-title`,children:t}):(0,R.jsxs)(`header`,{className:`pxd-page-header`,children:[r&&(0,R.jsx)(`nav`,{className:`pxd-breadcrumbs`,"aria-label":`Breadcrumb`,children:(0,R.jsx)(`ol`,{children:r.map((t,n)=>(0,R.jsx)(`li`,{children:t.action?(0,R.jsx)(`button`,{type:`button`,className:`pxd-link`,onClick:()=>e.dispatch(t.action,b,e.doc.surface.id),children:s(t.label)}):s(t.label)},n))})}),(0,R.jsxs)(`div`,{className:`pxd-page-header-main`,children:[a!==void 0&&(0,R.jsx)(Im,{value:s(a),name:t,size:48}),(0,R.jsxs)(`div`,{className:`pxd-page-header-text`,children:[(0,R.jsxs)(`h1`,{className:`pxd-surface-title`,children:[t,i&&(0,R.jsx)(`span`,{className:`pxd-badge pxd-tone-${i.tone??`neutral`}`,children:s(i.text)})]}),n&&(0,R.jsx)(`p`,{className:`pxd-surface-subtitle`,children:n})]}),o&&(0,R.jsx)(`div`,{className:`pxd-page-header-actions`,children:(0,R.jsx)(c_,{id:o})})]})]})}function c_({id:e,scope:t}){let n=N(),r=(0,v.useContext)(M),i=n.byId.get(e);if(!i)return null;let a=t??r;if(i.visible!==void 0&&k(i.visible,n.data,a)===!1)return null;let o=n.components[i.component],s=o?(0,R.jsx)(o,{node:i}):(0,R.jsx)(l_,{node:i});return t?(0,R.jsx)(M.Provider,{value:t,children:s}):s}function l_({node:e}){return(0,R.jsxs)(`div`,{className:`pxd-unknown`,role:`note`,children:[`Unsupported component “`,e.component,`”`]})}function $(e){let t=N(),n=(0,v.useContext)(M),r=e.accessibility,i={"data-pxd-id":e.id,"data-pxd-component":e.component};if(!r)return i;let a=e=>{let r=k(e,t.data,n);return r===void 0?void 0:String(r)};return{...i,"aria-label":r.label===void 0?void 0:a(r.label),"aria-description":r.description===void 0?void 0:a(r.description),"aria-live":r.live,"aria-hidden":r.hidden||void 0}}window.__pxdActions=[],window.__pxdDismissed=0;var{document:u_,theme:d_,mode:f_}=window.__PXD__;(0,y.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(o_,{document:u_,theme:d_,mode:f_,onAction:e=>window.__pxdActions.push(e),onDismiss:()=>window.__pxdDismissed+=1,resolveMedia: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>${e}</title></svg>`)}`})),requestAnimationFrame(()=>requestAnimationFrame(()=>window.__pxdReady=!0));