@domphy/ui 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core-theme-ui.global.js +3 -3
- package/dist/core-theme-ui.global.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var He=Object.defineProperty,zt=Object.defineProperties,$t=Object.getOwnPropertyDescriptor,Mt=Object.getOwnPropertyDescriptors,Nt=Object.getOwnPropertyNames,nt=Object.getOwnPropertySymbols;var lt=Object.prototype.hasOwnProperty,Rt=Object.prototype.propertyIsEnumerable;var it=(n,o,t)=>o in n?He(n,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[o]=t,at=(n,o)=>{for(var t in o||(o={}))lt.call(o,t)&&it(n,t,o[t]);if(nt)for(var t of nt(o))Rt.call(o,t)&&it(n,t,o[t]);return n},st=(n,o)=>zt(n,Mt(o));var Lt=(n,o)=>{for(var t in o)He(n,t,{get:o[t],enumerable:!0})},Dt=(n,o,t,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of Nt(o))!lt.call(n,r)&&r!==t&&He(n,r,{get:()=>o[r],enumerable:!(e=$t(o,r))||e.enumerable});return n};var Ht=n=>Dt(He({},"__esModule",{value:!0}),n);var pr={};Lt(pr,{FieldState:()=>Le,FormState:()=>ot,abbreviation:()=>Ot,alert:()=>Ut,avatar:()=>Xt,badge:()=>Jt,blockquote:()=>oo,breadcrumb:()=>Qt,breadcrumbEllipsis:()=>Zt,button:()=>ro,buttonSwitch:()=>Fo,card:()=>Bt,code:()=>io,combobox:()=>to,command:()=>Wt,commandItem:()=>jt,commandSearch:()=>Kt,descriptionList:()=>ao,details:()=>lo,dialog:()=>so,divider:()=>Jo,drawer:()=>Zo,emphasis:()=>mo,field:()=>cr,figure:()=>co,form:()=>mr,formGroup:()=>uo,heading:()=>ho,horizontalRule:()=>fo,icon:()=>bo,image:()=>go,inputCheckbox:()=>no,inputColor:()=>yo,inputDateTime:()=>Co,inputFile:()=>vo,inputNumber:()=>ko,inputOTP:()=>Gt,inputRadio:()=>Mo,inputRange:()=>So,inputSearch:()=>xo,inputSwitch:()=>Bo,inputText:()=>Eo,keyboard:()=>To,label:()=>Po,link:()=>wo,mark:()=>Io,menu:()=>ar,menuItem:()=>sr,orderedList:()=>Go,pagination:()=>Xo,paragraph:()=>_o,popover:()=>er,popoverArrow:()=>Qe,preformated:()=>zo,progress:()=>$o,select:()=>No,selectBox:()=>Oo,selectItem:()=>Ho,selectList:()=>Do,skeleton:()=>Ro,small:()=>Vo,spinner:()=>Lo,splitter:()=>Ft,splitterHandle:()=>At,splitterPanel:()=>Vt,strong:()=>Ao,subscript:()=>Wo,superscript:()=>Ko,tab:()=>ir,tabPanel:()=>lr,table:()=>jo,tabs:()=>nr,tag:()=>ze,textarea:()=>qo,toast:()=>tr,toggle:()=>qt,toggleGroup:()=>Yt,tooltip:()=>or,transitionGroup:()=>rr,unorderedList:()=>Yo});module.exports=Ht(pr);var be=require("@domphy/theme");function Ot(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{color:e=>(0,be.themeColor)(e,"shift-7",o),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:e=>(0,be.themeColor)(e,"shift-4",o),textUnderlineOffset:(0,be.themeSpacing)(.72),cursor:"help","&:hover":{color:e=>(0,be.themeColor)(e,"shift-8",t),textDecorationColor:e=>(0,be.themeColor)(e,"shift-6",t)}}}}var E=require("@domphy/theme");function Bt(n={}){let{color:o="neutral"}=n;return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:t=>(0,E.themeSpacing)((0,E.themeDensity)(t)*2),backgroundColor:t=>(0,E.themeColor)(t,"inherit",o),color:t=>(0,E.themeColor)(t,"shift-7",o),outline:t=>`1px solid ${(0,E.themeColor)(t,"shift-3",o)}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:t=>(0,E.themeSpacing)((0,E.themeDensity)(t)*2),paddingInline:t=>(0,E.themeSpacing)((0,E.themeDensity)(t)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:t=>(0,E.themeSpacing)((0,E.themeDensity)(t)*4),color:t=>(0,E.themeColor)(t,"shift-6",o),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:t=>(0,E.themeSpacing)((0,E.themeDensity)(t)*2),height:"auto"},"& > div":{gridArea:"content",padding:t=>(0,E.themeSpacing)((0,E.themeDensity)(t)*4),color:t=>(0,E.themeColor)(t,"shift-7",o)},"& > footer":{gridArea:"footer",display:"flex",gap:(0,E.themeSpacing)(2),paddingBlock:t=>(0,E.themeSpacing)((0,E.themeDensity)(t)*2),paddingInline:t=>(0,E.themeSpacing)((0,E.themeDensity)(t)*4),borderTop:t=>`1px solid ${(0,E.themeColor)(t,"shift-2",o)}`}}}}var Oe=require("@domphy/core"),Se=require("@domphy/theme");function Ft(n={}){let{direction:o="horizontal",defaultSize:t=50,min:e=10,max:r=90}=n;return{_onSchedule:(i,s)=>{(0,Oe.merge)(s,{_context:{splitter:{direction:o,size:(0,Oe.toState)(t),min:e,max:r}}})},style:{display:"flex",flexDirection:o==="horizontal"?"row":"column",overflow:"hidden"}}}function Vt(){return{_onMount:n=>{let o=n.getContext("splitter"),t=n.domElement,e=o.direction==="horizontal"?"width":"height";t.style[e]=`${o.size.get()}%`,t.style.flexShrink="0",t.style.overflow="auto";let r=o.size.onChange(i=>{t.style[e]=`${i}%`});n.addHook("Remove",r)}}}function At(){return{_onMount:n=>{let o=n.getContext("splitter"),t=n.domElement,e=o.direction==="horizontal";t.style.cursor=e?"col-resize":"row-resize";let r=i=>{i.preventDefault();let s=t.parentElement,a=m=>{let c=s.getBoundingClientRect(),d=e?(m.clientX-c.left)/c.width*100:(m.clientY-c.top)/c.height*100;o.size.set(Math.min(Math.max(d,o.min),o.max))},l=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",l)};t.addEventListener("mousedown",r),n.addHook("Remove",()=>t.removeEventListener("mousedown",r))},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:n=>(0,Se.themeColor)(n,"shift-2"),"&:hover":{backgroundColor:n=>(0,Se.themeColor)(n,"shift-3")},"&::after":{content:'""',borderRadius:(0,Se.themeSpacing)(999),backgroundColor:n=>(0,Se.themeColor)(n,"shift-4")}}}}var Be=require("@domphy/core"),k=require("@domphy/theme");function Wt(){return{_onSchedule:(n,o)=>{(0,Be.merge)(o,{_context:{command:{query:(0,Be.toState)("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function Kt(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:e=>{let r=e.getContext("command"),i=e.domElement,s=()=>r.query.set(i.value);i.addEventListener("input",s),e.addHook("Remove",()=>i.removeEventListener("input",s))},style:{fontFamily:"inherit",fontSize:e=>(0,k.themeSize)(e,"inherit"),paddingInline:e=>(0,k.themeSpacing)((0,k.themeDensity)(e)*3),paddingBlock:e=>(0,k.themeSpacing)((0,k.themeDensity)(e)*2),border:"none",borderBottom:e=>`1px solid ${(0,k.themeColor)(e,"shift-2",o)}`,outline:"none",color:e=>(0,k.themeColor)(e,"shift-7",o),backgroundColor:e=>(0,k.themeColor)(e,"inherit",o),"&::placeholder":{color:e=>(0,k.themeColor)(e,"shift-4")},"&:focus-visible":{borderBottomColor:e=>(0,k.themeColor)(e,"shift-5",t)}}}}function jt(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{role:"option",_onMount:e=>{var l,m;let r=e.getContext("command"),i=e.domElement,s=(m=(l=i.textContent)==null?void 0:l.toLowerCase())!=null?m:"",a=r.query.onChange(c=>{i.hidden=c.length>0&&!s.includes(c.toLowerCase())});e.addHook("Remove",a)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:e=>(0,k.themeSize)(e,"inherit"),height:e=>(0,k.themeSpacing)(6+(0,k.themeDensity)(e)*2),paddingInline:e=>(0,k.themeSpacing)((0,k.themeDensity)(e)*3),border:"none",outline:"none",color:e=>(0,k.themeColor)(e,"shift-6",o),backgroundColor:e=>(0,k.themeColor)(e,"inherit",o),"&:hover:not([disabled])":{backgroundColor:e=>(0,k.themeColor)(e,"shift-1",o)},"&:focus-visible":{outline:e=>`${(0,k.themeSpacing)(.5)} solid ${(0,k.themeColor)(e,"shift-5",t)}`,outlineOffset:`-${(0,k.themeSpacing)(.5)}`}}}}var q=require("@domphy/theme");function qt(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{role:"button",_onInsert:e=>{var l;e.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let r=e.getContext("toggleGroup"),s=((l=e.parent)==null?void 0:l.children.items).filter(m=>m.type==="ElementNode"&&m.attributes.get("role")==="button"),a=String(s.findIndex(m=>m===e));e.attributes.set("ariaPressed",m=>{let c=r.value.get(m);return Array.isArray(c)?c.includes(a):c===a}),e.addEvent("click",()=>{let m=r.value.get();if(r.multiple){let c=Array.isArray(m)?[...m]:[];r.value.set(c.includes(a)?c.filter(d=>d!==a):[...c,a])}else r.value.set(m===a?"":a)})},style:{cursor:"pointer",fontSize:e=>(0,q.themeSize)(e,"inherit"),height:(0,q.themeSpacing)(6),paddingBlock:(0,q.themeSpacing)(1),paddingInline:(0,q.themeSpacing)(2),border:"none",borderRadius:(0,q.themeSpacing)(1),color:e=>(0,q.themeColor)(e,"shift-6",o),backgroundColor:e=>(0,q.themeColor)(e,"inherit",o),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:e=>(0,q.themeColor)(e,"shift-1",o)},"&[aria-pressed=true]":{backgroundColor:e=>(0,q.themeColor)(e,"shift-1",o)},"&:focus-visible":{outline:e=>`${(0,q.themeSpacing)(.5)} solid ${(0,q.themeColor)(e,"shift-5",t)}`,outlineOffset:`-${(0,q.themeSpacing)(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}var mt=require("@domphy/core"),ne=require("@domphy/theme");function Yt(n={}){var e;let{multiple:o=!1,color:t="neutral"}=n;return{role:"group",dataTone:"shift-1",_context:{toggleGroup:{value:(0,mt.toState)((e=n.value)!=null?e:o?[]:""),multiple:o}},style:{display:"flex",paddingBlock:(0,ne.themeSpacing)(1),paddingInline:(0,ne.themeSpacing)(1),gap:(0,ne.themeSpacing)(1),borderRadius:(0,ne.themeSpacing)(2),fontSize:r=>(0,ne.themeSize)(r,"inherit"),backgroundColor:r=>(0,ne.themeColor)(r,"inherit",t),outline:r=>`1px solid ${(0,ne.themeColor)(r,"shift-1",t)}`,outlineOffset:"-1px"}}}var Xe=require("@domphy/theme");function Gt(){return{style:{display:"flex",alignItems:"center",gap:(0,Xe.themeSpacing)(2),"& > *":{minWidth:(0,Xe.themeSpacing)(8)+"!important"}},_onMount:n=>{let o=n.domElement,t=()=>Array.from(o.querySelectorAll("input")),e=s=>{let a=t(),l=s.target,m=a.indexOf(l);l.value&&m<a.length-1&&a[m+1].focus()},r=s=>{let a=t(),l=s.target,m=a.indexOf(l);s.key==="Backspace"&&!l.value&&m>0&&a[m-1].focus(),s.key==="ArrowLeft"&&m>0&&a[m-1].focus(),s.key==="ArrowRight"&&m<a.length-1&&a[m+1].focus()},i=s=>{var d,u,b;s.preventDefault();let a=(u=(d=s.clipboardData)==null?void 0:d.getData("text"))!=null?u:"",l=t(),m=l.indexOf(s.target);[...a].forEach((h,g)=>{l[m+g]&&(l[m+g].value=h)});let c=Math.min(m+a.length-1,l.length-1);(b=l[c])==null||b.focus()};o.addEventListener("input",e),o.addEventListener("keydown",r),o.addEventListener("paste",i),n.addHook("Remove",()=>{o.removeEventListener("input",e),o.removeEventListener("keydown",r),o.removeEventListener("paste",i)})}}}var G=require("@domphy/theme");function Ut(n={}){let{color:o="primary"}=n;return{role:"alert",style:{display:"flex",alignItems:"flex-start",gap:(0,G.themeSpacing)(3),paddingBlock:t=>(0,G.themeSpacing)((0,G.themeDensity)(t)*2),paddingInline:t=>(0,G.themeSpacing)((0,G.themeDensity)(t)*4),boxShadow:t=>`inset ${(0,G.themeSpacing)(1)} 0 0 0 ${(0,G.themeColor)(t,"shift-5",o)}`,backgroundColor:t=>(0,G.themeColor)(t,"shift-1",o),color:t=>(0,G.themeColor)(t,"shift-7",o),fontSize:t=>(0,G.themeSize)(t,"inherit")}}}var he=require("@domphy/theme");function Xt(n={}){let{color:o="primary"}=n;return{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:(0,he.themeSpacing)(8),height:(0,he.themeSpacing)(8),fontSize:t=>(0,he.themeSize)(t,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:t=>(0,he.themeColor)(t,"shift-3",o),color:t=>(0,he.themeColor)(t,"shift-8",o),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}var ct=require("@domphy/core"),ce=require("@domphy/theme");function Jt(n={}){let{color:o="danger",label:t=999}=n,e=(0,ct.toState)(t);return{style:{position:"relative","&::after":{content:r=>`"${e.get(r)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:(0,ce.themeSpacing)(1),minWidth:(0,ce.themeSpacing)(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:r=>(0,ce.themeSize)(r,"decrease-1"),borderRadius:(0,ce.themeSpacing)(999),backgroundColor:r=>(0,ce.themeColor)(r,"shift-6",o),color:r=>(0,ce.themeColor)(r,"shift-0",o)}}}}var oe=require("@domphy/theme");function Qt(n={}){let{color:o="neutral",separator:t="/"}=n;return{_onInsert:e=>{e.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:e=>(0,oe.themeSize)(e,"inherit"),gap:(0,oe.themeSpacing)(1),color:e=>(0,oe.themeColor)(e,"shift-6",o),backgroundColor:e=>(0,oe.themeColor)(e,"inherit",o),"& > *":{display:"inline-flex",alignItems:"center",color:e=>(0,oe.themeColor)(e,"shift-5",o)},"& > *:not(:last-child)::after":{content:`"${t}"`,color:e=>(0,oe.themeColor)(e,"shift-3",o),paddingInlineStart:(0,oe.themeSpacing)(1)},"& > [aria-current=page]":{color:e=>(0,oe.themeColor)(e,"shift-7",o),pointerEvents:"none"}}}}var Q=require("@domphy/theme");function Zt(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:t=>(0,Q.themeSize)(t,"inherit"),paddingInline:(0,Q.themeSpacing)(1),border:"none",background:"none",cursor:"pointer",color:t=>(0,Q.themeColor)(t,"shift-5",o),borderRadius:(0,Q.themeSpacing)(1),"&:hover":{color:t=>(0,Q.themeColor)(t,"shift-7",o),backgroundColor:t=>(0,Q.themeColor)(t,"shift-1",o)},"&:focus-visible":{outline:t=>`${(0,Q.themeSpacing)(.5)} solid ${(0,Q.themeColor)(t,"shift-5",o)}`,outlineOffset:(0,Q.themeSpacing)(.5)}}}}var ye=require("@domphy/core"),z=require("@domphy/theme");var F=require("@domphy/theme"),eo='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.707 5.293l5.293 5.292l5.293 -5.292a1 1 0 0 1 1.414 1.414l-5.292 5.293l5.292 5.293a1 1 0 0 1 -1.414 1.414l-5.293 -5.292l-5.293 5.292a1 1 0 1 1 -1.414 -1.414l5.292 -5.293l-5.292 -5.293a1 1 0 0 1 1.414 -1.414" /></svg>';function ze(n={}){let{color:o="neutral",removable:t=!1}=n;return{dataTone:"shift-1",_onInit:e=>{let r={span:eo,onClick:i=>{i.stopPropagation(),e.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:(0,F.themeSpacing)(1),width:(0,F.themeSpacing)(4),height:(0,F.themeSpacing)(4),flexShrink:0,"&:hover":{backgroundColor:i=>(0,F.themeColor)(i,"shift-3",o)}}};t&&e.children.insert(r)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:(0,F.themeSpacing)(6),paddingBlock:"0px",borderRadius:(0,F.themeSpacing)(1),paddingInlineStart:(0,F.themeSpacing)(2),paddingInlineEnd:t?(0,F.themeSpacing)(1):(0,F.themeSpacing)(2),gap:(0,F.themeSpacing)(2),fontSize:e=>(0,F.themeSize)(e,"inherit"),backgroundColor:e=>(0,F.themeColor)(e,"inherit",o),color:e=>(0,F.themeColor)(e,"shift-6",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${(0,F.themeColor)(e,"shift-3",o)}`}}}var $e=require("@domphy/core"),ie=require("@floating-ui/dom");function fe(n){let{open:o=!1,placement:t="bottom"}=n,e=null,r=null,i=null,s=null,a=(0,$e.toState)(o),l=(0,$e.toState)(t),m=()=>{i&&s&&(r&&r(),r=(0,ie.autoUpdate)(i,s,()=>{(0,ie.computePosition)(i,s,{placement:l.get(),middleware:[(0,ie.offset)(12),(0,ie.flip)(),(0,ie.shift)()],strategy:"fixed"}).then(({x:g,y:p,placement:L})=>{var B;Object.assign(s.style,{left:`${g}px`,top:`${p}px`}),L!==l.get()&&l.set(L),(B=n.onPlacement)==null||B.call(n,i,s,L)})}),a.set(!0))},c=()=>{r&&r(),r=null,a.set(!1)},d=()=>{e&&clearTimeout(e),e=setTimeout(m,100)},u=()=>{e&&clearTimeout(e),e=setTimeout(c,100)},b={style:{position:"fixed",pointerEvents:"auto",visibility:g=>a.get(g)?"visible":"hidden"},_onMount:g=>s=g.domElement,_portal:g=>{let p=g.domElement.querySelector("#domphy-floating");if(!p){let L={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};p=g.children.insert(L).domElement}return p}};return(0,$e.merge)(n.content,b),{show:d,hide:u,anchorPartial:{onKeyDown:g=>g.key==="Escape"&&u(),_onSchedule:g=>{let p=null;g.getRoot().addHook("Init",L=>{p=L.children.insert(n.content)}),g.addHook("BeforeRemove",()=>{u(),e&&clearTimeout(e),p&&p.remove()})},_onMount:g=>{i=g.domElement;let p=L=>{if(!a.get()||!i||!s)return;let B=L.target;!i.contains(B)&&!s.contains(B)&&u()};g.getRoot().domElement.addEventListener("click",p),g.addHook("BeforeRemove",()=>g.getRoot().domElement.removeEventListener("click",p))}}}}function to(n){let{options:o=[],placement:t="bottom",color:e="neutral",open:r=!1,multiple:i=!1}=n,s=(0,ye.toState)(n.value),a=(0,ye.toState)(r),{show:l,hide:m,anchorPartial:c}=fe({open:a,placement:t,content:n.content,onPlacement:n.onPlacement}),d={onClick:()=>!i&&m()};(0,ye.merge)(n.content,d);let u={border:"none",outline:"none",padding:0,margin:0,flex:1,height:(0,z.themeSpacing)(6),marginInlineStart:(0,z.themeSpacing)(2),fontSize:p=>(0,z.themeSize)(p,"inherit"),color:p=>(0,z.themeColor)(p,"shift-6",e),backgroundColor:p=>(0,z.themeColor)(p,"inherit",e)},b;n.input?((0,ye.merge)(n.input,{onFocus:()=>l(),style:u,_key:"combobox-input"}),b=n.input):b={input:null,onFocus:()=>l(),value:p=>(s.get(p),""),style:u,_key:"combobox-input"};let h={div:p=>{let L=s.get(p),B=Array.isArray(L)?L:[L],te=o.filter(Ee=>B.includes(Ee.value)).map(Ee=>({span:Ee.label,$:[ze({color:e,removable:!0})],_key:Ee.value,_onRemove:Ue=>{let _e=s.get(),rt=(Array.isArray(_e)?_e:[_e]).filter(_t=>_t!==Ee.value);i?s.set(rt):s.set(rt[0])}}));return te.push(b),te},style:{display:"flex",flexWrap:"wrap",gap:(0,z.themeSpacing)(1)}},g={_onInsert:p=>{p.tagName!="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:p=>p.children.insert(h),style:{minWidth:(0,z.themeSpacing)(32),outlineOffset:"-1px",outline:p=>`1px solid ${(0,z.themeColor)(p,"shift-3","neutral")}`,paddingBlock:p=>(0,z.themeSpacing)((0,z.themeDensity)(p)*1),paddingInline:p=>(0,z.themeSpacing)((0,z.themeDensity)(p)*1),borderRadius:p=>(0,z.themeSpacing)((0,z.themeDensity)(p)*1),fontSize:p=>(0,z.themeSize)(p,"inherit"),color:p=>(0,z.themeColor)(p,"shift-6",e),backgroundColor:p=>(0,z.themeColor)(p,"inherit",e)}};return(0,ye.merge)(c,g),c}var Je=require("@domphy/core"),Ce=require("@domphy/theme");function Qe(n={}){let{placement:o="bottom-end",color:t="neutral",sideOffset:e=(0,Ce.themeSpacing)(6),bordered:r=!0}=n,i=(0,Je.toState)(o),s={top:"bottom",bottom:"top",left:"right",right:"left","top-start":"bottom-end","top-end":"bottom-start","bottom-start":"top-end","bottom-end":"top-start","left-start":"right-end","left-end":"right-start","right-start":"left-end","right-end":"left-start"},a=(0,Je.toState)(s[i.get()]);i.onChange(c=>a.set(s[c]));let l=c=>c.includes("start")?e:c.includes("end")?"auto":"50%",m=c=>c.includes("end")?e:c.includes("start")?"auto":"50%";return{style:{position:"relative","&::after":{content:'""',position:"absolute",width:(0,Ce.themeSpacing)(1.5),height:(0,Ce.themeSpacing)(1.5),backgroundColor:c=>(0,Ce.themeColor)(c,"inherit",t),borderWidth:r?"0px":"1px",borderColor:c=>(0,Ce.themeColor)(c,"inherit",t),borderTopStyle:c=>{let d=a.get(c);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:c=>{let d=a.get(c);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:c=>{let d=a.get(c);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:c=>{let d=a.get(c);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:c=>{let d=a.get(c);return d.includes("top")?0:d.includes("bottom")?"auto":l(d)},right:c=>{let d=a.get(c);return d.includes("right")?0:d.includes("left")?"auto":m(d)},bottom:c=>{let d=a.get(c);return d.includes("bottom")?0:d.includes("top")?"auto":m(d)},left:c=>{let d=a.get(c);return d.includes("left")?0:d.includes("right")?"auto":l(d)},transform:c=>{let d=a.get(c),u=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",b=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${u},${b}) rotate(45deg)`}}}}}var Z=require("@domphy/theme");function oo(n={}){let{color:o="inherit"}=n;return{_onInsert:t=>{t.tagName!="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-1",style:{fontSize:t=>(0,Z.themeSize)(t,"inherit"),backgroundColor:t=>(0,Z.themeColor)(t,"inherit",o),boxShadow:t=>`inset ${(0,Z.themeSpacing)(1)} 0 0 0 ${(0,Z.themeColor)(t,"shift-3",o)}`,border:"none",paddingBlock:t=>(0,Z.themeSpacing)((0,Z.themeDensity)(t)*2),paddingInline:t=>(0,Z.themeSpacing)((0,Z.themeDensity)(t)*4),margin:0}}}var $=require("@domphy/theme");function ro(n={}){let{color:o="primary"}=n;return{_onInsert:t=>{t.tagName!="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:t=>(0,$.themeSize)(t,"inherit"),paddingBlock:t=>(0,$.themeSpacing)((0,$.themeDensity)(t)*1),paddingInline:t=>(0,$.themeSpacing)((0,$.themeDensity)(t)*3),borderRadius:t=>(0,$.themeSpacing)((0,$.themeDensity)(t)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:t=>`1px solid ${(0,$.themeColor)(t,"shift-3",o)}`,color:t=>(0,$.themeColor)(t,"shift-6",o),backgroundColor:t=>(0,$.themeColor)(t,"inherit",o),"&:hover:not([disabled]):not([aria-busy=true])":{color:t=>(0,$.themeColor)(t,"shift-7",o),backgroundColor:t=>(0,$.themeColor)(t,"shift-1",o)},"&:focus-visible":{boxShadow:t=>`inset 0 0 0 ${(0,$.themeSpacing)(.5)} ${(0,$.themeColor)(t,"shift-6",o)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:t=>(0,$.themeColor)(t,"shift-1","neutral"),outline:t=>`1px solid ${(0,$.themeColor)(t,"shift-3","neutral")}`,color:t=>(0,$.themeColor)(t,"shift-5","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}var T=require("@domphy/theme");function no(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"checkbox",_onInsert:e=>{e.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:e=>(0,T.themeSize)(e,"inherit"),display:"inline-flex",position:"relative",width:(0,T.themeSpacing)(6),height:(0,T.themeSpacing)(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:(0,T.themeSpacing)(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${(0,T.themeColor)(e,"shift-4",o)}`,color:e=>(0,T.themeColor)(e,"shift-6",o),width:(0,T.themeSpacing)(4),height:(0,T.themeSpacing)(4)},"&:hover::before":{backgroundColor:e=>(0,T.themeColor)(e,"shift-2",o)},"&:checked::before":{outline:e=>`1px solid ${(0,T.themeColor)(e,"shift-5",t)}`,backgroundColor:e=>(0,T.themeColor)(e,"shift-5",t)},"&:checked:hover:not([disabled])::before":{backgroundColor:e=>(0,T.themeColor)(e,"shift-4",t)},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:e=>`${(0,T.themeSpacing)(.5)} solid ${(0,T.themeColor)(e,"inherit",t)}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:e=>`1px solid ${(0,T.themeColor)(e,"shift-4",t)}`,backgroundColor:e=>(0,T.themeColor)(e,"inherit",t)},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:e=>(0,T.themeColor)(e,"shift-5",t)},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:e=>(0,T.themeColor)(e,"shift-4",t)},"&:focus-visible":{borderRadius:(0,T.themeSpacing)(1.5),outline:e=>`${(0,T.themeSpacing)(.5)} solid ${(0,T.themeColor)(e,"shift-5",t)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:e=>(0,T.themeColor)(e,"shift-3","neutral"),pointerEvents:"none"}}}}var de=require("@domphy/theme");function io(n={}){let{color:o="neutral"}=n;return{dataTone:"shift-2",_onInsert:t=>{t.tagName!="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",fontSize:t=>(0,de.themeSize)(t,"inherit"),color:t=>(0,de.themeColor)(t,"shift-6",o),backgroundColor:t=>(0,de.themeColor)(t,"inherit",o),height:(0,de.themeSpacing)(6),paddingInline:(0,de.themeSpacing)(1.5),borderRadius:(0,de.themeSpacing)(1)}}}var f=require("@domphy/theme");function lo(n={}){let{color:o="neutral",accentColor:t="primary",duration:e=240}=n;return{_onInsert:r=>{r.tagName!="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:r=>(0,f.themeSize)(r,"inherit"),color:r=>(0,f.themeColor)(r,"shift-6",o),backgroundColor:r=>(0,f.themeColor)(r,"inherit",o),overflow:"hidden","& > summary":{backgroundColor:r=>(0,f.themeColor)(r,"shift-1",o),color:r=>(0,f.themeColor)(r,"shift-7",o),fontSize:r=>(0,f.themeSize)(r,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:(0,f.themeSpacing)(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:r=>(0,f.themeSpacing)((0,f.themeDensity)(r)*4),height:(0,f.themeSpacing)(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:(0,f.themeSpacing)(2),height:(0,f.themeSpacing)(2),flexShrink:0,marginTop:`-${(0,f.themeSpacing)(.5)}`,borderInlineEnd:r=>`${(0,f.themeSpacing)(.5)} solid ${(0,f.themeColor)(r,"shift-6",o)}`,borderBottom:r=>`${(0,f.themeSpacing)(.5)} solid ${(0,f.themeColor)(r,"shift-6",o)}`,transform:"rotate(45deg)",transition:`transform ${e}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:r=>(0,f.themeColor)(r,"shift-2",o)},"& > summary:focus-visible":{borderRadius:r=>(0,f.themeSpacing)((0,f.themeDensity)(r)*2),outlineOffset:`-${(0,f.themeSpacing)(.5)}`,outline:r=>`${(0,f.themeSpacing)(.5)} solid ${(0,f.themeColor)(r,"shift-5",t)}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:r=>(0,f.themeSpacing)((0,f.themeDensity)(r)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${e}ms ease, opacity ${e}ms ease, padding ${e}ms ease`},"&[open] > :not(summary)":{maxHeight:(0,f.themeSpacing)(250),opacity:1,paddingTop:r=>(0,f.themeSpacing)((0,f.themeDensity)(r)*1),paddingBottom:r=>(0,f.themeSpacing)((0,f.themeDensity)(r)*3)}}}}var ue=require("@domphy/theme");function ao(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${(0,ue.themeSpacing)(24)}, max-content) 1fr`,columnGap:(0,ue.themeSpacing)(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:t=>(0,ue.themeSize)(t,"inherit"),color:t=>(0,ue.themeColor)(t,"shift-7",o)},"& dd":{margin:0,fontSize:t=>(0,ue.themeSize)(t,"inherit"),color:t=>(0,ue.themeColor)(t,"shift-6",o)}}}}var dt=require("@domphy/core"),U=require("@domphy/theme");function so(n={}){let{color:o="neutral",open:t=!1}=n,e=(0,dt.toState)(t);return{_onInsert:r=>{r.tagName!="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(r,i)=>{if(r.target!==i.domElement)return;let s=i.domElement.getBoundingClientRect();r.clientX>=s.left&&r.clientX<=s.right&&r.clientY>=s.top&&r.clientY<=s.bottom||e.set(!1)},onTransitionEnd:(r,i)=>{let s=i.domElement;s.style.opacity==="0"&&(s.close(),document.body.style.overflow="")},_onMount:r=>{let i=r.domElement,s=a=>{a?(i.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{i.style.opacity="1";let l=i.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');l==null||l.focus()})):i.style.opacity="0"};s(e.get()),e.onChange(s)},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:r=>(0,U.themeSize)(r,"inherit"),color:r=>(0,U.themeColor)(r,"shift-7",o),backgroundColor:r=>(0,U.themeColor)(r,"inherit",o),border:"none",padding:r=>(0,U.themeSpacing)((0,U.themeDensity)(r)*3),boxShadow:r=>`0 ${(0,U.themeSpacing)(8)} ${(0,U.themeSpacing)(16)} ${(0,U.themeColor)(r,"shift-3","neutral")}`,"&::backdrop":{backgroundColor:r=>(0,U.themeColor)(r,"shift-1","neutral"),opacity:.75}}}}var Fe=require("@domphy/theme");function mo(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:t=>(0,Fe.themeSize)(t,"inherit"),fontStyle:"italic",color:t=>(0,Fe.themeColor)(t,"shift-7",o)}}}var le=require("@domphy/theme");function co(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:(0,le.themeSpacing)(2),marginInline:0,marginTop:(0,le.themeSpacing)(3),marginBottom:(0,le.themeSpacing)(3),color:t=>(0,le.themeColor)(t,"shift-6",o),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:(0,le.themeSpacing)(2)},"& figcaption":{fontSize:t=>(0,le.themeSize)(t,"decrease-1"),color:t=>(0,le.themeColor)(t,"shift-5",o),lineHeight:1.45}}}}var S=require("@domphy/theme");function uo(n={}){let{color:o="neutral",layout:t="horizontal"}=n,e=t==="vertical";return{_onInsert:r=>{r.tagName!="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:r=>(0,S.themeSpacing)((0,S.themeDensity)(r)*3),paddingBlock:r=>(0,S.themeSpacing)((0,S.themeDensity)(r)*3),border:"none",borderRadius:r=>(0,S.themeSpacing)((0,S.themeDensity)(r)*2),fontSize:r=>(0,S.themeSize)(r,"inherit"),backgroundColor:r=>(0,S.themeColor)(r,"inherit",o),display:"grid",gridTemplateColumns:e?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:(0,S.themeSpacing)(4),rowGap:(0,S.themeSpacing)(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:r=>(0,S.themeSize)(r,"inherit"),fontWeight:600,paddingBlock:r=>(0,S.themeSpacing)((0,S.themeDensity)(r)*1),borderRadius:r=>(0,S.themeSpacing)((0,S.themeDensity)(r)*2),color:r=>(0,S.themeColor)(r,"shift-6",o),backgroundColor:r=>(0,S.themeColor)(r,"inherit",o)},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:r=>e?"0px":(0,S.themeSpacing)((0,S.themeDensity)(r)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:e?"auto":"span 2"},"& > :not(legend, label, p)":{gridColumn:e?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > p":{gridColumn:e?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${(0,S.themeSpacing)(2)} * -1)`,fontSize:r=>(0,S.themeSize)(r,"decrease-1"),color:r=>(0,S.themeColor)(r,"shift-6",o)}}}}var ke=require("@domphy/theme"),po={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function ho(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{["h1","h2","h3","h4","h5","h6"].includes(t.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:t=>(0,ke.themeColor)(t,"shift-8",o),marginTop:0,marginBottom:(0,ke.themeSpacing)(2),fontSize:t=>{let e=po[t.elementNode.tagName]||"inherit";return(0,ke.themeSize)(t,e)}}}}var Me=require("@domphy/theme");function fo(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:(0,Me.themeSpacing)(3),marginBottom:(0,Me.themeSpacing)(3),backgroundColor:t=>(0,Me.themeColor)(t,"shift-3",o)}}}var Ve=require("@domphy/theme");function go(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:(0,Ve.themeSpacing)(2),backgroundColor:t=>(0,Ve.themeColor)(t,"shift-1",o)}}}var Ze=require("@domphy/theme");function bo(){return{_onInsert:n=>{n.tagName!="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",verticalAlign:"middle",width:(0,Ze.themeSpacing)(6),height:(0,Ze.themeSpacing)(6)}}}var D=require("@domphy/theme");function yo(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"color",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputColor" primitive patch must use input tag'),r.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:e=>(0,D.themeSize)(e,"inherit"),paddingBlock:e=>(0,D.themeSpacing)((0,D.themeDensity)(e)*1),paddingInline:e=>(0,D.themeSpacing)((0,D.themeDensity)(e)*1),blockSize:e=>(0,D.themeSpacing)(6+(0,D.themeDensity)(e)*2),inlineSize:e=>(0,D.themeSpacing)(6+(0,D.themeDensity)(e)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:e=>(0,D.themeSpacing)((0,D.themeDensity)(e)*1)},"&::-moz-color-swatch":{borderRadius:e=>(0,D.themeSpacing)((0,D.themeDensity)(e)*1)},"&:hover:not([disabled]), &:focus-visible":{},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:e=>(0,D.themeColor)(e,"shift-1","neutral"),outline:e=>`1px solid ${(0,D.themeColor)(e,"shift-3","neutral")}`}}}}var M=require("@domphy/theme");function Co(n={}){let{mode:o="datetime-local",color:t="neutral",accentColor:e="primary"}=n;return{type:o,_onSchedule:(r,i)=>{r.tagName!="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),i.type=o},style:{fontFamily:"inherit",fontSize:r=>(0,M.themeSize)(r,"inherit"),lineHeight:"inherit",color:r=>(0,M.themeColor)(r,"shift-6",t),backgroundColor:r=>(0,M.themeColor)(r,"inherit",t),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${(0,M.themeColor)(r,"shift-3",t)}`,borderRadius:r=>(0,M.themeSpacing)((0,M.themeDensity)(r)*1),paddingInline:r=>(0,M.themeSpacing)((0,M.themeDensity)(r)*3),height:r=>(0,M.themeSpacing)(6+(0,M.themeDensity)(r)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:r=>`${(0,M.themeSpacing)(.5)} solid ${(0,M.themeColor)(r,"shift-5",e)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:r=>(0,M.themeColor)(r,"shift-5","neutral"),backgroundColor:r=>(0,M.themeColor)(r,"shift-1","neutral"),outline:r=>`1px solid ${(0,M.themeColor)(r,"shift-3","neutral")}`},"&:invalid":{outline:r=>`${(0,M.themeSpacing)(.5)} solid ${(0,M.themeColor)(r,"shift-5","error")}`}}}}var y=require("@domphy/theme");function vo(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"file",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputFile" primitive patch must use input tag'),r.type="file"},style:{fontFamily:"inherit",fontSize:e=>(0,y.themeSize)(e,"inherit"),lineHeight:"inherit",color:e=>(0,y.themeColor)(e,"shift-6",o),backgroundColor:e=>(0,y.themeColor)(e,"inherit",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${(0,y.themeColor)(e,"shift-3",o)}`,borderRadius:e=>(0,y.themeSpacing)((0,y.themeDensity)(e)*1),height:e=>(0,y.themeSpacing)(6+(0,y.themeDensity)(e)*2),paddingInline:e=>(0,y.themeSpacing)((0,y.themeDensity)(e)*1),"&::file-selector-button":{marginBlock:"auto",fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:(0,y.themeSpacing)(1),height:(0,y.themeSpacing)(6),paddingInline:(0,y.themeSpacing)(2),cursor:"pointer",color:e=>(0,y.themeColor)(e,"shift-7",t),backgroundColor:e=>(0,y.themeColor)(e,"shift-2",t)},"&::-webkit-file-upload-button":{marginTop:(0,y.themeSpacing)(1),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:(0,y.themeSpacing)(1),height:(0,y.themeSpacing)(6),paddingInline:(0,y.themeSpacing)(2),cursor:"pointer",color:e=>(0,y.themeColor)(e,"shift-7",o),backgroundColor:e=>(0,y.themeColor)(e,"shift-2",o)},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${(0,y.themeSpacing)(.5)} solid ${(0,y.themeColor)(e,"shift-5",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>(0,y.themeColor)(e,"shift-5","neutral"),outline:e=>`1px solid ${(0,y.themeColor)(e,"shift-3","neutral")}`,backgroundColor:e=>(0,y.themeColor)(e,"shift-1","neutral")},"&[disabled]::file-selector-button, &[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:e=>(0,y.themeColor)(e,"shift-5","neutral"),backgroundColor:e=>(0,y.themeColor)(e,"shift-2","neutral")}}}}var N=require("@domphy/theme");function xo(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"search",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputSearch" primitive patch must use input tag'),r.type="search"},style:{fontFamily:"inherit",fontSize:e=>(0,N.themeSize)(e,"inherit"),lineHeight:"inherit",color:e=>(0,N.themeColor)(e,"shift-6",o),backgroundColor:e=>(0,N.themeColor)(e,"inherit",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${(0,N.themeColor)(e,"shift-3",o)}`,borderRadius:e=>(0,N.themeSpacing)((0,N.themeDensity)(e)*1),minWidth:(0,N.themeSpacing)(32),paddingInline:e=>(0,N.themeSpacing)((0,N.themeDensity)(e)*3),paddingBlock:e=>(0,N.themeSpacing)((0,N.themeDensity)(e)*1),"&::placeholder":{color:e=>(0,N.themeColor)(e,"shift-4",o)},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${(0,N.themeSpacing)(.5)} solid ${(0,N.themeColor)(e,"shift-5",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>(0,N.themeColor)(e,"shift-5","neutral"),backgroundColor:e=>(0,N.themeColor)(e,"shift-1","neutral"),outline:e=>`1px solid ${(0,N.themeColor)(e,"shift-3","neutral")}`}}}}var C=require("@domphy/theme");function Eo(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"text",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),r.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:(0,C.themeSpacing)(32),paddingInline:e=>(0,C.themeSpacing)((0,C.themeDensity)(e)*3),paddingBlock:e=>(0,C.themeSpacing)((0,C.themeDensity)(e)*1),borderRadius:e=>(0,C.themeSpacing)((0,C.themeDensity)(e)*1),fontSize:e=>(0,C.themeSize)(e,"inherit"),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${(0,C.themeColor)(e,"shift-3",o)}`,color:e=>(0,C.themeColor)(e,"shift-6",o),backgroundColor:e=>(0,C.themeColor)(e,"inherit",o),"&::placeholder":{color:e=>(0,C.themeColor)(e,"shift-4")},"&:not(:placeholder-shown)":{color:e=>(0,C.themeColor)(e,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${(0,C.themeSpacing)(.5)} solid ${(0,C.themeColor)(e,"shift-5",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:e=>(0,C.themeColor)(e,"shift-1","neutral"),outline:e=>`1px solid ${(0,C.themeColor)(e,"shift-3","neutral")}`,color:e=>(0,C.themeColor)(e,"shift-5","neutral")},"&:invalid:not(:placeholder-shown)":{outline:e=>`${(0,C.themeSpacing)(.5)} solid ${(0,C.themeColor)(e,"shift-5","error")}`},"&[data-status=error]":{outline:e=>`${(0,C.themeSpacing)(.5)} solid ${(0,C.themeColor)(e,"shift-5","error")}`},"&[data-status=warning]":{outline:e=>`${(0,C.themeSpacing)(.5)} solid ${(0,C.themeColor)(e,"shift-5","warning")}`}}}}var P=require("@domphy/theme");function So(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"range",_onInsert:e=>{e.tagName!="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:(0,P.themeSpacing)(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:(0,P.themeSpacing)(1.5),borderRadius:(0,P.themeSpacing)(999),backgroundColor:e=>(0,P.themeColor)(e,"shift-2",o)},"&::-moz-range-track":{height:(0,P.themeSpacing)(1.5),borderRadius:(0,P.themeSpacing)(999),backgroundColor:e=>(0,P.themeColor)(e,"shift-2",o)},"&::-webkit-slider-thumb":{appearance:"none",width:(0,P.themeSpacing)(4),height:(0,P.themeSpacing)(4),borderRadius:(0,P.themeSpacing)(999),border:"none",marginTop:`calc((${(0,P.themeSpacing)(1.5)} - ${(0,P.themeSpacing)(4)}) / 2)`,backgroundColor:e=>(0,P.themeColor)(e,"shift-6",t)},"&::-moz-range-thumb":{width:(0,P.themeSpacing)(4),height:(0,P.themeSpacing)(4),borderRadius:(0,P.themeSpacing)(999),border:"none",backgroundColor:e=>(0,P.themeColor)(e,"shift-6",t)},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:e=>(0,P.themeColor)(e,"shift-7",t)},"&:hover:not([disabled])::-moz-range-thumb":{backgroundColor:e=>(0,P.themeColor)(e,"shift-7",t)},"&:focus-visible":{outline:e=>`${(0,P.themeSpacing)(.5)} solid ${(0,P.themeColor)(e,"shift-4",t)}`,outlineOffset:(0,P.themeSpacing)(1),borderRadius:(0,P.themeSpacing)(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}var R=require("@domphy/theme");function ko(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"number",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputNumber" primitive patch must use input tag'),r.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:(0,R.themeSpacing)(32),paddingInline:e=>(0,R.themeSpacing)((0,R.themeDensity)(e)*3),paddingBlock:e=>(0,R.themeSpacing)((0,R.themeDensity)(e)*1),borderRadius:e=>(0,R.themeSpacing)((0,R.themeDensity)(e)*1),fontSize:e=>(0,R.themeSize)(e,"inherit"),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${(0,R.themeColor)(e,"shift-3",o)}`,color:e=>(0,R.themeColor)(e,"shift-6",o),backgroundColor:e=>(0,R.themeColor)(e,"inherit",o),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${(0,R.themeSpacing)(.5)} solid ${(0,R.themeColor)(e,"shift-5",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:e=>(0,R.themeColor)(e,"shift-1","neutral"),outline:e=>`1px solid ${(0,R.themeColor)(e,"shift-3","neutral")}`,color:e=>(0,R.themeColor)(e,"shift-5","neutral")}}}}var ae=require("@domphy/theme");function To(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:t=>(0,ae.themeSize)(t,"inherit"),color:t=>(0,ae.themeColor)(t,"shift-6",o),backgroundColor:t=>(0,ae.themeColor)(t,"inherit",o),paddingBlock:(0,ae.themeSpacing)(.5),paddingInline:(0,ae.themeSpacing)(1.5),borderRadius:(0,ae.themeSpacing)(1),outline:t=>`1px solid ${(0,ae.themeColor)(t,"shift-3",o)}`}}}var ge=require("@domphy/theme");function Po(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:(0,ge.themeSpacing)(2),fontSize:e=>(0,ge.themeSize)(e,"inherit"),color:e=>(0,ge.themeColor)(e,"shift-6",o),cursor:"pointer","&:focus-within":{color:e=>(0,ge.themeColor)(e,"shift-7",t)},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:e=>(0,ge.themeColor)(e,"shift-5","neutral")}}}}var ee=require("@domphy/theme");function wo(n={}){let{color:o="primary",accentColor:t="secondary"}=n;return{_onInsert:e=>{e.tagName!="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:e=>(0,ee.themeSize)(e,"inherit"),color:e=>(0,ee.themeColor)(e,"shift-6",o),textDecoration:"none","&:visited":{color:e=>(0,ee.themeColor)(e,"shift-6",t)},"&:hover:not([disabled])":{color:e=>(0,ee.themeColor)(e,"shift-7",o),textDecoration:"underline"},"&:focus-visible":{borderRadius:(0,ee.themeSpacing)(1),outlineOffset:(0,ee.themeSpacing)(1),outline:e=>`${(0,ee.themeSpacing)(.5)} solid ${(0,ee.themeColor)(e,"shift-6",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>(0,ee.themeColor)(e,"shift-5","neutral")}}}}var pe=require("@domphy/theme");function Io(n={}){let{accentColor:o="highlight",tone:t="shift-1"}=n;return{_onInsert:e=>{e.tagName!="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:t,style:{display:"inline-flex",alignItems:"center",fontSize:e=>(0,pe.themeSize)(e,"inherit"),color:e=>(0,pe.themeColor)(e,"shift-6",o),backgroundColor:e=>(0,pe.themeColor)(e,"inherit",o),height:(0,pe.themeSpacing)(6),borderRadius:(0,pe.themeSpacing)(1),paddingInline:(0,pe.themeSpacing)(1.5)}}}var Ae=require("@domphy/theme");function _o(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:t=>(0,Ae.themeSize)(t,"inherit"),color:t=>(0,Ae.themeColor)(t,"shift-6",o),lineHeight:1.5,marginTop:0,marginBottom:0}}}var X=require("@domphy/theme");function zo(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:t=>(0,X.themeSize)(t,"inherit"),color:t=>(0,X.themeColor)(t,"shift-6",o),backgroundColor:t=>(0,X.themeColor)(t,"shift-1",o),border:"none",paddingBlock:t=>(0,X.themeSpacing)((0,X.themeDensity)(t)*2),paddingInline:t=>(0,X.themeSpacing)((0,X.themeDensity)(t)*3),borderRadius:t=>(0,X.themeSpacing)((0,X.themeDensity)(t)*2)}}}var re=require("@domphy/theme");function $o(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:(0,re.themeSpacing)(2),border:0,borderRadius:(0,re.themeSpacing)(999),overflow:"hidden",backgroundColor:e=>(0,re.themeColor)(e,"shift-2",o),"&::-webkit-progress-bar":{backgroundColor:e=>(0,re.themeColor)(e,"shift-2",o),borderRadius:(0,re.themeSpacing)(999)},"&::-webkit-progress-value":{backgroundColor:e=>(0,re.themeColor)(e,"shift-6",t),borderRadius:(0,re.themeSpacing)(999),transition:"width 220ms ease"},"&::-moz-progress-bar":{backgroundColor:e=>(0,re.themeColor)(e,"shift-6",t),borderRadius:(0,re.themeSpacing)(999)}}}}var V=require("@domphy/theme");function Mo(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"radio",_onInsert:e=>{if(e.tagName!="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:e=>(0,V.themeSize)(e,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:(0,V.themeSpacing)(6),height:(0,V.themeSpacing)(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:"50%",lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${(0,V.themeColor)(e,"shift-4",o)}`,color:e=>(0,V.themeColor)(e,"shift-6",o),width:(0,V.themeSpacing)(4),height:(0,V.themeSpacing)(4)},"&:hover::before":{backgroundColor:e=>(0,V.themeColor)(e,"shift-2",o)},"&:checked::before":{outline:e=>`1px solid ${(0,V.themeColor)(e,"shift-5",t)}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:e=>(0,V.themeColor)(e,"shift-5",t)},"&:checked:hover:not([disabled])::before":{backgroundColor:e=>(0,V.themeColor)(e,"shift-4",t)},"&:focus-visible":{borderRadius:"50%",outline:e=>`${(0,V.themeSpacing)(.5)} solid ${(0,V.themeColor)(e,"shift-5",t)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:e=>(0,V.themeColor)(e,"shift-3","neutral"),pointerEvents:"none"}}}}var x=require("@domphy/theme");function No(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="select"&&console.warn('"select" primitive patch must use select tag')},style:{fontFamily:"inherit",fontSize:e=>(0,x.themeSize)(e,"inherit"),lineHeight:"inherit",color:e=>(0,x.themeColor)(e,"shift-6",o),backgroundColor:e=>(0,x.themeColor)(e,"inherit",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${(0,x.themeColor)(e,"shift-3",o)}`,borderRadius:e=>(0,x.themeSpacing)((0,x.themeDensity)(e)*1),paddingBlock:e=>(0,x.themeSpacing)((0,x.themeDensity)(e)*1),paddingLeft:e=>(0,x.themeSpacing)((0,x.themeDensity)(e)*3),paddingRight:e=>(0,x.themeSpacing)((0,x.themeDensity)(e)*1),"&:not([multiple])":{height:e=>(0,x.themeSpacing)(6+(0,x.themeDensity)(e)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:e=>`${(0,x.themeSpacing)(.5)} solid ${(0,x.themeColor)(e,"shift-4",t)}`},"&:focus-visible":{outline:e=>`${(0,x.themeSpacing)(.5)} solid ${(0,x.themeColor)(e,"shift-5",t)}`},"& optgroup":{color:e=>(0,x.themeColor)(e,"shift-8",o)},"& option[disabled]":{color:e=>(0,x.themeColor)(e,"shift-4","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>(0,x.themeColor)(e,"shift-5","neutral"),outline:e=>`1px solid ${(0,x.themeColor)(e,"shift-3","neutral")}`,backgroundColor:e=>(0,x.themeColor)(e,"shift-1","neutral")}}}}var ut=require("@domphy/core"),Ne=require("@domphy/theme");function Ro(n={}){let{color:o="neutral"}=n,t={"0%,100%":{opacity:1},"50%":{opacity:.4}},e=(0,ut.hashString)(JSON.stringify(t));return{ariaHidden:"true",style:{height:(0,Ne.themeSpacing)(6),display:"block",borderRadius:(0,Ne.themeSpacing)(1),backgroundColor:r=>(0,Ne.themeColor)(r,"shift-2",o),animation:`${e} 1.5s ease-in-out infinite`,[`@keyframes ${e}`]:t}}}var ht=require("@domphy/core"),ve=require("@domphy/theme"),ft={to:{transform:"rotate(360deg)"}},pt=(0,ht.hashString)(JSON.stringify(ft));function Lo(n={}){let{color:o="neutral"}=n;return{role:"status",ariaLabel:"loading",_onInsert:t=>{t.tagName!="span"&&console.warn('"spinner" patch must use span tag')},style:{display:"inline-block",margin:0,flexShrink:0,width:(0,ve.themeSpacing)(6),height:(0,ve.themeSpacing)(6),borderRadius:"50%",border:t=>`${(0,ve.themeSpacing)(.5)} solid ${(0,ve.themeColor)(t,"shift-3",o)}`,borderTopColor:t=>(0,ve.themeColor)(t,"shift-6",o),boxSizing:"border-box",padding:0,animation:`${pt} 0.7s linear infinite`,[`@keyframes ${pt}`]:ft}}}var gt=require("@domphy/core"),se=require("@domphy/theme");function Do(n={}){var s;let{color:o="neutral",multiple:t=!1}=n,e=(0,gt.toState)((s=n.value)!=null?s:t?[]:null),r={div:a=>{let l=e.get(a);return(Array.isArray(l)?l:[l]).map(c=>({input:null,name:n.name,value:c||""}))},hidden:!0};return{dataTone:"shift-11",_context:{select:{value:e,multiple:t}},_onInit:a=>{a.tagName!="div"&&console.warn('"selectList" patch must use a div tag'),a.children.insert(r)},style:{display:"flex",flexDirection:"column",paddingBlock:a=>(0,se.themeSpacing)((0,se.themeDensity)(a)*2),paddingInline:a=>(0,se.themeSpacing)((0,se.themeDensity)(a)*2),fontSize:a=>(0,se.themeSize)(a,"inherit"),backgroundColor:a=>(0,se.themeColor)(a,"inherit",o)}}}var A=require("@domphy/theme");function Ho(n={}){let{accentColor:o="primary",color:t="neutral",value:e=null}=n;return{role:"option",_onInit:i=>{i.tagName!="div"&&console.warn('"selectItem" patch must use div tag');let s=i.getContext("select");if(s){let a=s.value;i.attributes.set("ariaSelected",l=>{let m=a.get(l);return s.multiple?m.includes(e):m==e}),i.addEvent("click",()=>{let l=a.get();s.multiple?l.includes(e)?a.set(l.filter(m=>m!==e)):a.set(l.concat([e])):l!=e&&a.set(e)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:i=>(0,A.themeSize)(i,"inherit"),height:i=>(0,A.themeSpacing)(6+(0,A.themeDensity)(i)*2),paddingInline:i=>(0,A.themeSpacing)((0,A.themeDensity)(i)*3),border:"none",outline:"none",color:i=>(0,A.themeColor)(i,"shift-6",t),backgroundColor:i=>(0,A.themeColor)(i,"inherit",t),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:i=>(0,A.themeColor)(i,"shift-1",t)},"&[aria-selected=true]":{backgroundColor:i=>(0,A.themeColor)(i,"shift-2",o),color:i=>(0,A.themeColor)(i,"shift-8")},"&:focus-visible":{outline:i=>`${(0,A.themeSpacing)(.5)} solid ${(0,A.themeColor)(i,"shift-5",o)}`,outlineOffset:`-${(0,A.themeSpacing)(.5)}`}}}}var Te=require("@domphy/core"),j=require("@domphy/theme");function Oo(n){let{options:o=[],placement:t="bottom",color:e="neutral",open:r=!1,multiple:i=!1}=n,s=(0,Te.toState)(n.value),a=(0,Te.toState)(r),{show:l,hide:m,anchorPartial:c}=fe({open:a,placement:t,content:n.content,onPlacement:n.onPlacement}),d={onClick:()=>!i&&m()};(0,Te.merge)(n.content,d);let u={div:h=>{let g=s.get(h),p=Array.isArray(g)?g:[g];return o.filter(B=>p.includes(B.value)).map(B=>({span:B.label,$:[ze({color:e,removable:i})],_key:B.value,_onRemove:De=>{let te=s.get(),Ue=(Array.isArray(te)?te:[te]).filter(_e=>_e!==B.value);i?s.set(Ue):s.set(Ue[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:(0,j.themeSpacing)(1),flex:1}},b={_onInsert:h=>{h.tagName!="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:h=>h.children.insert(u),onClick:()=>a.get()?m():l(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:h=>(0,j.themeSpacing)(6+(0,j.themeDensity)(h)*2),minWidth:(0,j.themeSpacing)(32),outlineOffset:"-1px",outline:h=>`1px solid ${(0,j.themeColor)(h,"shift-3","neutral")}`,paddingInline:h=>(0,j.themeSpacing)((0,j.themeDensity)(h)*2),borderRadius:h=>(0,j.themeSpacing)((0,j.themeDensity)(h)*1),fontSize:h=>(0,j.themeSize)(h,"inherit"),color:h=>(0,j.themeColor)(h,"shift-6",e),backgroundColor:h=>(0,j.themeColor)(h,"inherit",e)}};return(0,Te.merge)(c,b),c}var W=require("@domphy/theme");function Bo(n={}){let{accentColor:o="primary"}=n;return{dataTone:"increase-2",type:"checkbox",_onSchedule:t=>{if(t.tagName!="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:t=>(0,W.themeSize)(t,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:(0,W.themeSpacing)(8),height:(0,W.themeSpacing)(6),cursor:"pointer",margin:"0",paddingBlock:(0,W.themeSpacing)(1),"&:checked":{"&::before":{backgroundColor:t=>(0,W.themeColor)(t,"increase-3",o)},"&::after":{left:`calc(100% - ${(0,W.themeSpacing)(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:(0,W.themeSpacing)(3),height:(0,W.themeSpacing)(3),borderRadius:(0,W.themeSpacing)(999),left:(0,W.themeSpacing)(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:t=>(0,W.themeColor)(t,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:(0,W.themeSpacing)(999),display:"inline-block",fontSize:t=>(0,W.themeSize)(t,"inherit"),lineHeight:1,backgroundColor:t=>(0,W.themeColor)(t)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}var bt=require("@domphy/core"),I=require("@domphy/theme");function Fo(n={}){let{checked:o=!1,accentColor:t="primary",color:e="neutral"}=n,r=(0,bt.toState)(o);return{_onSchedule:i=>{i.tagName!="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:i=>r.get(i),dataTone:"increase-2",onClick:()=>r.set(!r.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:i=>(0,I.themeSize)(i),border:"none",outlineWidth:"1px",outline:i=>`1px solid ${(0,I.themeColor)(i,"shift-2",e)}`,minWidth:(0,I.themeSpacing)(12),minHeight:(0,I.themeSpacing)(6),borderRadius:(0,I.themeSpacing)(999),paddingLeft:(0,I.themeSpacing)(7),paddingRight:(0,I.themeSpacing)(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:i=>(0,I.themeColor)(i,"inherit",e),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:(0,I.themeSpacing)(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:(0,I.themeSpacing)(5),height:(0,I.themeSpacing)(5),borderRadius:(0,I.themeSpacing)(999),color:i=>(0,I.themeColor)(i,"shift-6"),backgroundColor:i=>(0,I.themeColor)(i,"decrease-2",e)},"&[aria-checked=true]":{backgroundColor:i=>(0,I.themeColor)(i,"increase-3",t),outline:"none",color:i=>(0,I.themeColor)(i,"decrease-2"),paddingLeft:(0,I.themeSpacing)(2),paddingRight:(0,I.themeSpacing)(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${(0,I.themeSpacing)(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}var We=require("@domphy/theme");function Vo(n={}){let{color:o="neutral"}=n;return{dataSize:"decrease-1",_onInsert:t=>{t.tagName!="small"&&console.warn('"small" primitive patch must use small tag')},style:{fontSize:t=>(0,We.themeSize)(t,"inherit"),color:t=>(0,We.themeColor)(t,"shift-6",o)}}}var Ke=require("@domphy/theme");function Ao(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:t=>(0,Ke.themeSize)(t,"inherit"),fontWeight:700,color:t=>(0,Ke.themeColor)(t,"shift-8",o)}}}var je=require("@domphy/theme");function Wo(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:t=>(0,je.themeSize)(t,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:t=>(0,je.themeColor)(t,"shift-6",o)}}}var qe=require("@domphy/theme");function Ko(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:t=>(0,qe.themeSize)(t,"decrease-1"),verticalAlign:"super",lineHeight:0,color:t=>(0,qe.themeColor)(t,"shift-6",o)}}}var v=require("@domphy/theme");function jo(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:t=>(0,v.themeSize)(t,"inherit"),color:t=>(0,v.themeColor)(t,"shift-6",o),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:t=>(0,v.themeSpacing)((0,v.themeDensity)(t)*3),paddingBlock:t=>(0,v.themeSpacing)((0,v.themeDensity)(t)*1),color:t=>(0,v.themeColor)(t,"shift-7",o),backgroundColor:t=>(0,v.themeColor)(t,"inherit")},"& td":{textAlign:"left",paddingInline:t=>(0,v.themeSpacing)((0,v.themeDensity)(t)*3),paddingBlock:t=>(0,v.themeSpacing)((0,v.themeDensity)(t)*1),color:t=>(0,v.themeColor)(t,"shift-6",o),boxShadow:t=>`inset 0 1px 0 ${(0,v.themeColor)(t,"shift-3",o)}`,fontSize:t=>(0,v.themeSize)(t,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:t=>(0,v.themeSpacing)((0,v.themeDensity)(t)*3),paddingBlock:t=>(0,v.themeSpacing)((0,v.themeDensity)(t)*1),color:t=>(0,v.themeColor)(t,"shift-7",o),backgroundColor:t=>(0,v.themeColor)(t,"inherit"),boxShadow:t=>`inset 0 -1px 0 ${(0,v.themeColor)(t,"shift-3",o)}`},"& tr":{backgroundColor:t=>(0,v.themeColor)(t,"inherit")},"& tbody tr:hover":{backgroundColor:t=>(0,v.themeColor)(t,"shift-2")+"!important"}}}}var w=require("@domphy/theme");function qo(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:e=>(0,w.themeSpacing)((0,w.themeDensity)(e)*4),paddingBlock:e=>(0,w.themeSpacing)((0,w.themeDensity)(e)*2),border:"none",borderRadius:e=>(0,w.themeSpacing)((0,w.themeDensity)(e)*2),fontSize:e=>(0,w.themeSize)(e,"inherit"),color:e=>(0,w.themeColor)(e,"shift-6",o),outlineOffset:"-1px",outline:e=>`1px solid ${(0,w.themeColor)(e,"shift-3",o)}`,backgroundColor:e=>(0,w.themeColor)(e,"inherit",o),"&::placeholder":{color:e=>(0,w.themeColor)(e,"shift-4")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:e=>`${(0,w.themeSpacing)(.5)} solid ${(0,w.themeColor)(e,"shift-4",t)}`},"&:focus-visible":{outline:e=>`${(0,w.themeSpacing)(.5)} solid ${(0,w.themeColor)(e,"shift-5",t)}`},"&:invalid":{outline:e=>`${(0,w.themeSpacing)(.5)} solid ${(0,w.themeColor)(e,"shift-4","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>(0,w.themeColor)(e,"shift-5","neutral"),outline:e=>`1px solid ${(0,w.themeColor)(e,"shift-3","neutral")}`,backgroundColor:e=>(0,w.themeColor)(e,"shift-1","neutral")}}}}var Pe=require("@domphy/theme");function Yo(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:t=>(0,Pe.themeSize)(t,"inherit"),color:t=>(0,Pe.themeColor)(t,"shift-6",o),marginTop:0,marginBottom:0,paddingLeft:(0,Pe.themeSpacing)(3),listStyleType:"disc",listStylePosition:"outside"}}}var we=require("@domphy/theme");function Go(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:t=>(0,we.themeSize)(t,"inherit"),color:t=>(0,we.themeColor)(t,"shift-6",o),marginTop:0,marginBottom:0,paddingLeft:(0,we.themeSpacing)(3),listStyleType:"decimal",listStylePosition:"outside"}}}var yt=require("@domphy/core"),_=require("@domphy/theme");function Uo(n,o){if(o<=7)return Array.from({length:o},(i,s)=>s+1);let t=[1];n>3&&t.push("...");let e=Math.max(2,n-1),r=Math.min(o-1,n+1);for(let i=e;i<=r;i++)t.push(i);return n<o-2&&t.push("..."),t.push(o),t}function Xo(n){var a;let{total:o,color:t="neutral",accentColor:e="primary"}=n,r=(0,yt.toState)((a=n.value)!=null?a:1),i={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:l=>(0,_.themeSpacing)(6+(0,_.themeDensity)(l)*2),height:l=>(0,_.themeSpacing)(6+(0,_.themeDensity)(l)*2),paddingInline:l=>(0,_.themeSpacing)((0,_.themeDensity)(l)*2),borderRadius:l=>(0,_.themeSpacing)((0,_.themeDensity)(l)*1),border:"none",cursor:"pointer",fontSize:l=>(0,_.themeSize)(l,"inherit"),backgroundColor:"transparent",color:l=>(0,_.themeColor)(l,"shift-6",t),"&:hover:not([disabled])":{backgroundColor:l=>(0,_.themeColor)(l,"shift-1",t)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},s=st(at({},i),{backgroundColor:l=>(0,_.themeColor)(l,"shift-2",e),color:l=>(0,_.themeColor)(l,"shift-8",e),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:l=>(0,_.themeColor)(l,"shift-2",e)}});return{_onInsert:l=>{l.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:l=>{let m={div:c=>{let d=r.get(c),u=[];u.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&r.set(d-1),style:i});for(let b of Uo(d,o))if(b==="...")u.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:h=>(0,_.themeSpacing)((0,_.themeDensity)(h)*2),color:h=>(0,_.themeColor)(h,"shift-4",t)}});else{let h=b===d;u.push({button:String(b),type:"button",ariaLabel:`Page ${b}`,ariaCurrent:h?"page":void 0,disabled:h,onClick:()=>r.set(b),style:h?s:i})}return u.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:d>=o,onClick:()=>d<o&&r.set(d+1),style:i}),u},style:{display:"flex",alignItems:"center",gap:(0,_.themeSpacing)(1)}};l.children.insert(m)},style:{display:"inline-flex"}}}var xe=require("@domphy/theme");function Jo(n={}){let{color:o="neutral"}=n;return{role:"separator",_onInsert:t=>{t.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:(0,xe.themeSpacing)(2),fontSize:t=>(0,xe.themeSize)(t,"inherit"),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:t=>(0,xe.themeColor)(t,"shift-3",o),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:t=>(0,xe.themeColor)(t,"shift-3",o),borderWidth:"1px",borderBottomStyle:"solid"}}}}var vt=require("@domphy/core"),Y=require("@domphy/theme"),Ct={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},Qo={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},et=n=>n==="left"||n==="right";function Zo(n={}){let{color:o="neutral",open:t=!1,placement:e="right",size:r}=n,i=(0,vt.toState)(t),s=et(e)?(0,Y.themeSpacing)(80):(0,Y.themeSpacing)(64),a=r!=null?r:s;return{_onInsert:l=>{l.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(l,m)=>{l.target===m.domElement&&i.set(!1)},onTransitionEnd:(l,m)=>{let c=m.domElement;i.get()||(c.close(),document.body.style.overflow="")},_onMount:l=>{let m=l.domElement,c=d=>{d?(m.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{m.style.transform="translate(0, 0)"})):m.style.transform=Ct[e]};c(i.get()),i.onChange(c)},style:{transform:Ct[e],transition:"transform 0.25s ease",fontSize:l=>(0,Y.themeSize)(l,"inherit"),color:l=>(0,Y.themeColor)(l,"shift-7",o),backgroundColor:l=>(0,Y.themeColor)(l,"inherit",o),border:"none",padding:l=>(0,Y.themeSpacing)((0,Y.themeDensity)(l)*3),margin:Qo[e],width:et(e)?a:"100dvw",height:et(e)?"100dvh":a,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:l=>`0 ${(0,Y.themeSpacing)(4)} ${(0,Y.themeSpacing)(12)} ${(0,Y.themeColor)(l,"shift-3","neutral")}`,"&::backdrop":{backgroundColor:l=>(0,Y.themeColor)(l,"shift-1","neutral"),opacity:.75}}}}var Re=require("@domphy/core");function er(n){let{open:o=!1,placement:t="bottom",openOn:e="click"}=n,r=null,i=(0,Re.toState)(o),{show:s,hide:a,anchorPartial:l}=fe({open:i,placement:t,content:n.content,onPlacement:n.onPlacement}),m={role:"dialog",dataTone:"shift-6",onMouseEnter:()=>e==="hover"&&s(),onMouseLeave:()=>e==="hover"&&a(),_onInsert:d=>{let u=d.attributes.get("id");r=u||d.nodeId,!u&&d.attributes.set("id",r)}};return(0,Re.merge)(n.content,m),(0,Re.merge)(l,{ariaHaspopup:"dialog",ariaExpanded:d=>i.get(d),onMouseEnter:()=>e==="hover"&&s(),onMouseLeave:()=>e==="hover"&&a(),onClick:()=>e==="click"&&(i.get()?a():s()),onFocus:()=>s(),onBlur:()=>a(),_onMount:d=>r&&d.attributes.set("ariaControls",r)}),l}var xt=require("@domphy/core"),H=require("@domphy/theme");function tr(n={}){let{position:o="top-center",color:t="neutral"}=n,e=(0,xt.toState)(!1),r=o.startsWith("top"),i=o.endsWith("center"),s=o.endsWith("right"),a={div:[],id:`domphy-toast-${o}`,style:{position:"fixed",display:"flex",flexDirection:r?"column":"column-reverse",alignItems:i?"center":s?"end":"start",inset:0,gap:(0,H.themeSpacing)(4),zIndex:30,padding:(0,H.themeSpacing)(6),pointerEvents:"none"}};return{_portal:l=>{let m=l.domElement.querySelector(`#domphy-toast-${o}`);return m||(m=l.children.insert(a).domElement),m},role:"status",ariaAtomic:"true",style:{minWidth:(0,H.themeSpacing)(32),pointerEvents:"auto",paddingBlock:l=>(0,H.themeSpacing)((0,H.themeDensity)(l)*2),paddingInline:l=>(0,H.themeSpacing)((0,H.themeDensity)(l)*4),borderRadius:l=>(0,H.themeSpacing)((0,H.themeDensity)(l)*2),fontSize:l=>(0,H.themeSize)(l,"inherit"),color:l=>(0,H.themeColor)(l,"shift-1",t),backgroundColor:l=>(0,H.themeColor)(l,"shift-9",t),boxShadow:l=>`0 ${(0,H.themeSpacing)(2)} ${(0,H.themeSpacing)(8)} ${(0,H.themeColor)(l,"shift-3","neutral")}`,opacity:l=>Number(e.get(l)),transform:l=>e.get(l)?"translateY(0)":r?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>e.set(!0)),_onBeforeRemove:(l,m)=>{let c=d=>{d.propertyName==="transform"&&(l.domElement.removeEventListener("transitionend",c),m())};l.domElement.addEventListener("transitionend",c),e.set(!1)}}}var Ye=require("@domphy/core"),J=require("@domphy/theme");function or(n={}){let{open:o=!1,placement:t="top",content:e="Tooltip Content"}=n,r=null,i=(0,Ye.toState)(t),s=typeof e=="string"?{span:e}:e,{show:a,hide:l,anchorPartial:m}=fe({open:o,placement:t,content:s}),c={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-11",_onInsert:u=>{let b=u.attributes.get("id");r=b||u.nodeId,!b&&u.attributes.set("id",r)},style:{paddingBlock:u=>(0,J.themeSpacing)((0,J.themeDensity)(u)*1),paddingInline:u=>(0,J.themeSpacing)((0,J.themeDensity)(u)*3),borderRadius:u=>(0,J.themeSpacing)((0,J.themeDensity)(u)*1),color:u=>(0,J.themeColor)(u,"shift-6"),backgroundColor:u=>(0,J.themeColor)(u),fontSize:u=>(0,J.themeSize)(u,"inherit")},$:[Qe({placement:t,bordered:!1})]};return s.$||(s.$=[]),s.$.push(c),(0,Ye.merge)(m,{onMouseEnter:()=>a(),onMouseLeave:()=>l(),onFocus:()=>a(),onBlur:()=>l(),onKeyDown:u=>u.key==="Escape"&&l(),_onMount:u=>r&&u.attributes.set("ariaDescribedby",r)}),m}var tt=require("@domphy/core");function Et(n,o){return n.key!==void 0&&n.key!==null?String(n.key):`index-${o}`}function rr(n={}){let{duration:o=300,delay:t=0}=n,e=new Map;return{_onBeforeUpdate:r=>{e=new Map,r.children.items.forEach((i,s)=>{if(!(i instanceof tt.ElementNode))return;let a=i.domElement;a&&e.set(Et(i,s),a.getBoundingClientRect())})},_onUpdate:r=>{r.children.items.forEach((i,s)=>{if(!(i instanceof tt.ElementNode))return;let a=i.domElement;if(!a)return;let l=Et(i,s),m=e.get(l);if(!m)return;let c=a.getBoundingClientRect(),d=m.left-c.left,u=m.top-c.top;if(Math.abs(d)<.5&&Math.abs(u)<.5)return;let b=a.style.transition,h=a.style.transform;a.style.transition="none",a.style.transform=`translate(${d}px, ${u}px)`,a.getBoundingClientRect(),requestAnimationFrame(()=>{a.style.transition=`transform ${o}ms ease ${t}ms`,a.style.transform="translate(0px, 0px)"});let g=()=>{a.style.transition=b,a.style.transform=h,a.removeEventListener("transitionend",p)},p=L=>{L.propertyName==="transform"&&g()};a.addEventListener("transitionend",p),setTimeout(g,o+t+34)}),e.clear()}}}var St=require("@domphy/core"),kt=require("@domphy/core");function nr(n={}){return{role:"tablist",_onSchedule:(t,e)=>{let r={_context:{tabs:{activeKey:(0,kt.toState)(n.activeKey||0)}}};(0,St.merge)(e,r)}}}var O=require("@domphy/theme");function ir(n={}){let{accentColor:o="primary",color:t="neutral"}=n;return{role:"tab",_onInsert:r=>{var m;r.tagName!="button"&&console.warn('"tab" patch must use button tag');let i=r.getContext("tabs"),s=(m=r.parent)==null?void 0:m.children.items;s=s.filter(c=>c.type=="ElementNode"&&c.attributes.get("role")=="tab");let a=r.key||s.findIndex(c=>c==r),l={id:"tab"+r.parent.nodeId+a,ariaControls:"tabpanel"+r.parent.nodeId+a,ariaSelected:c=>i.activeKey.get(c)==a,onClick:()=>i.activeKey.set(a),onKeyDown:c=>{var p,L,B,De;let d=c.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(d))return;c.preventDefault();let u=((L=(p=r.parent)==null?void 0:p.children.items)!=null?L:[]).filter(te=>te.type==="ElementNode"&&te.attributes.get("role")==="tab"),b=u.findIndex(te=>te===r),h=b;d==="ArrowRight"?h=(b+1)%u.length:d==="ArrowLeft"?h=(b-1+u.length)%u.length:d==="Home"?h=0:d==="End"&&(h=u.length-1);let g=u[h];i.activeKey.set((B=g.key)!=null?B:h),(De=g.domElement)==null||De.focus()}};r.merge(l)},style:{cursor:"pointer",fontSize:r=>(0,O.themeSize)(r,"inherit"),height:r=>(0,O.themeSpacing)(6+(0,O.themeDensity)(r)*2),paddingInline:r=>(0,O.themeSpacing)((0,O.themeDensity)(r)*4),border:"none",outline:"none",color:r=>(0,O.themeColor)(r,"shift-6"),backgroundColor:r=>(0,O.themeColor)(r,"inherit"),boxShadow:r=>`inset 0 -${(0,O.themeSpacing)(.5)} 0 0 ${(0,O.themeColor)(r,"shift-2",t)}`,"&:hover:not([disabled])":{boxShadow:r=>`inset 0 -${(0,O.themeSpacing)(.5)} 0 0 ${(0,O.themeColor)(r,"shift-3",t)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:r=>`inset 0 -${(0,O.themeSpacing)(.5)} 0 0 ${(0,O.themeColor)(r,"shift-4",o)}`},"&:focus-visible":{boxShadow:r=>`inset 0 -${(0,O.themeSpacing)(.5)} 0 0 ${(0,O.themeColor)(r,"shift-6",o)}`}}}}var Ie=require("@domphy/theme");function lr(){return{role:"tabpanel",style:{paddingBlock:o=>(0,Ie.themeSpacing)((0,Ie.themeDensity)(o)*2),paddingInline:o=>(0,Ie.themeSpacing)((0,Ie.themeDensity)(o)*2)},_onInsert:o=>{var s;let t=o.getContext("tabs"),e=(s=o.parent)==null?void 0:s.children.items;e=e.filter(a=>a.type=="ElementNode"&&a.attributes.get("role")=="tabpanel");let r=o.key||e.findIndex(a=>a==o),i={id:"tabpanel"+o.parent.nodeId+r,ariaLabelledby:"tab"+o.parent.nodeId+r,hidden:a=>t.activeKey.get(a)!=r};o.merge(i)}}}var Tt=require("@domphy/core"),Pt=require("@domphy/core"),me=require("@domphy/theme");function ar(n={}){let{color:o="neutral"}=n;return{role:"menu",dataTone:"shift-11",_onSchedule:(e,r)=>{let i={_context:{menu:{activeKey:(0,Pt.toState)(n.activeKey||0)}}};(0,Tt.merge)(r,i)},style:{display:"flex",flexDirection:"column",paddingBlock:e=>(0,me.themeSpacing)((0,me.themeDensity)(e)*2),paddingInline:e=>(0,me.themeSpacing)((0,me.themeDensity)(e)*2),fontSize:e=>(0,me.themeSize)(e,"inherit"),backgroundColor:e=>(0,me.themeColor)(e,"inherit",o)}}}var K=require("@domphy/theme");function sr(n={}){let{accentColor:o="primary",color:t="neutral"}=n;return{role:"menuitem",_onInsert:r=>{var l;r.tagName!="button"&&console.warn('"menuItem" patch must use button tag');let i=r.getContext("menu"),s=(l=r.parent)==null?void 0:l.children.items;s=s.filter(m=>m.type=="ElementNode"&&m.attributes.get("role")=="menuitem");let a=r.key||s.findIndex(m=>m==r);r.attributes.set("ariaCurrent",m=>i.activeKey.get(m)==a||void 0),r.addEvent("click",()=>i.activeKey.set(a))},onKeyDown:(r,i)=>{var c,d,u;let s=r.key;if(!["ArrowDown","ArrowUp","Home","End"].includes(s))return;r.preventDefault();let a=((d=(c=i.parent)==null?void 0:c.children.items)!=null?d:[]).filter(b=>b.type==="ElementNode"&&b.attributes.get("role")==="menuitem"),l=a.findIndex(b=>b===i),m=l;s==="ArrowDown"?m=(l+1)%a.length:s==="ArrowUp"?m=(l-1+a.length)%a.length:s==="Home"?m=0:s==="End"&&(m=a.length-1),(u=a[m].domElement)==null||u.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:r=>(0,K.themeSize)(r,"inherit"),height:r=>(0,K.themeSpacing)(6+(0,K.themeDensity)(r)*2),paddingInline:r=>(0,K.themeSpacing)((0,K.themeDensity)(r)*3),border:"none",outline:"none",color:r=>(0,K.themeColor)(r,"shift-6"),backgroundColor:r=>(0,K.themeColor)(r,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:r=>(0,K.themeColor)(r,"shift-1")},"&[aria-current=true]":{backgroundColor:r=>(0,K.themeColor)(r,"shift-1",o),color:r=>(0,K.themeColor)(r,"shift-7")},"&:focus-visible":{outline:r=>`${(0,K.themeSpacing)(.5)} solid ${(0,K.themeColor)(r,"shift-5",o)}`,outlineOffset:`-${(0,K.themeSpacing)(.5)}`}}}}var wt=require("@domphy/core");function mr(n){return{_onSchedule:(o,t)=>{(0,wt.merge)(t,{_context:{form:n}})}}}function cr(n,o){return{_onInsert:t=>{let r=t.getContext("form").setField(n,void 0,o),i=t.tagName,s=t.attributes.get("type");["input","select","textarea"].includes(i)||console.warn('"field" patch must use input, select, or textarea tag');let a={onBlur:()=>r.setTouched(),ariaInvalid:l=>!!r.message("error",l)||void 0,dataStatus:l=>r.status(l)};i==="input"&&s==="checkbox"?(a.checked=r.value(),a.onChange=l=>r.setValue(l.target.checked)):i==="input"&&s==="radio"?a.onChange=l=>r.setValue(l.target.value):i==="select"?(a.value=r.value(),a.onChange=l=>r.setValue(l.target.value)):i==="textarea"?(a.value=r.value(),a.onInput=l=>r.setValue(l.target.value)):(a.value=r.value(),a.onInput=l=>r.setValue(l.target.value)),t.merge(a)}}}var It=require("@domphy/core");function dr(n){return!!n&&typeof n.then=="function"}var Le=class{constructor(o,t){this._notifier=new It.Notifier;this._messages={};this._touched=!1;this._pending=!1;this._validationToken=0;this._value=o,this._initValue=o,this._validator=t,t&&this.validate()}value(o){return o&&this._notifier.addListener("value",o),this._value}setValue(o){this._value=o,this._notifier.notify("value",o),this._notifier.notify("dirty",o!==this._initValue),this.validate()}dirty(o){return o&&this._notifier.addListener("dirty",o),this._value!==this._initValue}touched(o){return o&&this._notifier.addListener("touched",o),this._touched}setTouched(){this._touched||(this._touched=!0,this._notifier.notify("touched",!0))}configure(o,t){let e=!1;o!==void 0&&this._value===void 0&&this._initValue===void 0&&(this._value=o,this._initValue=o,this._notifier.notify("value",o),this._notifier.notify("dirty",!1),e=!0),t!==void 0&&t!==this._validator&&(this._validator=t,e=!0),e&&this.validate()}message(o,t){return t&&this._notifier.addListener(o,t),this._messages[o]}status(o){return o&&this._notifier.addListener("status",o),Ge(this._messages)}setMessages(o){let t=this._messages;this._messages=o;for(let e of["error","warning","success"])t[e]!==o[e]&&this._notifier.notify(e,o[e]);Ge(t)!==Ge(o)&&this._notifier.notify("status",Ge(o))}reset(){this._value=this._initValue,this._touched=!1,this._notifier.notify("value",this._value),this._notifier.notify("dirty",!1),this._notifier.notify("touched",!1),this.setMessages({}),this.validate()}validate(){let o=++this._validationToken;if(!this._validator){this._pending=!1,this.setMessages({});return}try{let t=this._validator(this._value);dr(t)?(this._pending=!0,Promise.resolve(t).then(e=>{o===this._validationToken&&(this._pending=!1,this.setMessages(e!=null?e:{}))}).catch(e=>{o===this._validationToken&&(this._pending=!1,console.error(e))})):(this._pending=!1,this.setMessages(t!=null?t:{}))}catch(t){o===this._validationToken&&(this._pending=!1),console.error(t)}}_dispose(){this._validationToken+=1,this._pending=!1,this._notifier._dispose()}};function Ge(n){if(n.error)return"error";if(n.warning)return"warning";if(n.success)return"success"}var ot=class{constructor(){this.fields=new Map}setField(o,t,e){let r=this.fields.get(o);return r?r.configure(t,e):(r=new Le(t,e),this.fields.set(o,r)),r}getField(o){return this.setField(o)}removeField(o){var t;(t=this.fields.get(o))==null||t._dispose(),this.fields.delete(o)}get valid(){for(let o of this.fields.values())if(o._pending||o._messages.error)return!1;return!0}reset(){for(let o of this.fields.values())o.reset()}snapshot(){let o={};for(let[t,e]of this.fields)ur(o,t,e._value);return o}_dispose(){for(let o of this.fields.values())o._dispose();this.fields.clear()}};function ur(n,o,t){let e=o.split("."),r=n;for(let i=0;i<e.length-1;i++){let s=e[i];r[s]==null&&(r[s]=isNaN(Number(e[i+1]))?{}:[]),r=r[s]}r[e[e.length-1]]=t}0&&(module.exports={FieldState,FormState,abbreviation,alert,avatar,badge,blockquote,breadcrumb,breadcrumbEllipsis,button,buttonSwitch,card,code,combobox,command,commandItem,commandSearch,descriptionList,details,dialog,divider,drawer,emphasis,field,figure,form,formGroup,heading,horizontalRule,icon,image,inputCheckbox,inputColor,inputDateTime,inputFile,inputNumber,inputOTP,inputRadio,inputRange,inputSearch,inputSwitch,inputText,keyboard,label,link,mark,menu,menuItem,orderedList,pagination,paragraph,popover,popoverArrow,preformated,progress,select,selectBox,selectItem,selectList,skeleton,small,spinner,splitter,splitterHandle,splitterPanel,strong,subscript,superscript,tab,tabPanel,table,tabs,tag,textarea,toast,toggle,toggleGroup,tooltip,transitionGroup,unorderedList});
|
|
1
|
+
"use strict";var Oe=Object.defineProperty,zt=Object.defineProperties,$t=Object.getOwnPropertyDescriptor,Mt=Object.getOwnPropertyDescriptors,Nt=Object.getOwnPropertyNames,nt=Object.getOwnPropertySymbols;var lt=Object.prototype.hasOwnProperty,Rt=Object.prototype.propertyIsEnumerable;var it=(n,o,t)=>o in n?Oe(n,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[o]=t,at=(n,o)=>{for(var t in o||(o={}))lt.call(o,t)&&it(n,t,o[t]);if(nt)for(var t of nt(o))Rt.call(o,t)&&it(n,t,o[t]);return n},st=(n,o)=>zt(n,Mt(o));var Lt=(n,o)=>{for(var t in o)Oe(n,t,{get:o[t],enumerable:!0})},Dt=(n,o,t,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of Nt(o))!lt.call(n,r)&&r!==t&&Oe(n,r,{get:()=>o[r],enumerable:!(e=$t(o,r))||e.enumerable});return n};var Ht=n=>Dt(Oe({},"__esModule",{value:!0}),n);var hr={};Lt(hr,{FieldState:()=>De,FormState:()=>ot,abbreviation:()=>Ot,alert:()=>Ut,avatar:()=>Xt,badge:()=>Jt,blockquote:()=>oo,breadcrumb:()=>Qt,breadcrumbEllipsis:()=>Zt,button:()=>ro,buttonSwitch:()=>Fo,card:()=>Bt,code:()=>io,combobox:()=>to,command:()=>Wt,commandItem:()=>jt,commandSearch:()=>Kt,descriptionList:()=>ao,details:()=>lo,dialog:()=>so,divider:()=>Jo,drawer:()=>Zo,emphasis:()=>mo,field:()=>cr,figure:()=>co,form:()=>mr,formGroup:()=>uo,heading:()=>po,horizontalRule:()=>fo,icon:()=>bo,image:()=>go,inputCheckbox:()=>no,inputColor:()=>yo,inputDateTime:()=>Co,inputFile:()=>vo,inputNumber:()=>ko,inputOTP:()=>Gt,inputRadio:()=>Mo,inputRange:()=>Eo,inputSearch:()=>xo,inputSwitch:()=>Bo,inputText:()=>So,keyboard:()=>To,label:()=>Po,link:()=>wo,mark:()=>Io,menu:()=>ar,menuItem:()=>sr,orderedList:()=>Go,pagination:()=>Xo,paragraph:()=>_o,popover:()=>er,popoverArrow:()=>Ze,preformated:()=>zo,progress:()=>$o,select:()=>No,selectBox:()=>Oo,selectItem:()=>Ho,selectList:()=>Do,skeleton:()=>Ro,small:()=>Vo,spinner:()=>Lo,splitter:()=>Ft,splitterHandle:()=>At,splitterPanel:()=>Vt,strong:()=>Ao,subscript:()=>Wo,superscript:()=>Ko,tab:()=>ir,tabPanel:()=>lr,table:()=>jo,tabs:()=>nr,tag:()=>Me,textarea:()=>qo,toast:()=>tr,toggle:()=>qt,toggleGroup:()=>Yt,tooltip:()=>or,transitionGroup:()=>rr,unorderedList:()=>Yo});module.exports=Ht(hr);var le=require("@domphy/theme");function Ot(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:e=>(0,le.themeSize)(e),backgroundColor:e=>(0,le.themeColor)(e),color:e=>(0,le.themeColor)(e,"shift-10",o),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:e=>(0,le.themeColor)(e,"shift-7",o),textUnderlineOffset:(0,le.themeSpacing)(.72),cursor:"help","&:hover":{color:e=>(0,le.themeColor)(e,"shift-11",t),textDecorationColor:e=>(0,le.themeColor)(e,"shift-9",t)}}}}var S=require("@domphy/theme");function Bt(n={}){let{color:o="neutral"}=n;return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:t=>(0,S.themeSpacing)((0,S.themeDensity)(t)*2),backgroundColor:t=>(0,S.themeColor)(t,"inherit",o),color:t=>(0,S.themeColor)(t,"shift-10",o),outline:t=>`1px solid ${(0,S.themeColor)(t,"shift-4",o)}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:t=>(0,S.themeSpacing)((0,S.themeDensity)(t)*2),paddingInline:t=>(0,S.themeSpacing)((0,S.themeDensity)(t)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:t=>(0,S.themeSpacing)((0,S.themeDensity)(t)*4),color:t=>(0,S.themeColor)(t,"shift-9",o),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:t=>(0,S.themeSpacing)((0,S.themeDensity)(t)*2),height:"auto"},"& > div":{gridArea:"content",padding:t=>(0,S.themeSpacing)((0,S.themeDensity)(t)*4),color:t=>(0,S.themeColor)(t,"shift-10",o)},"& > footer":{gridArea:"footer",display:"flex",gap:(0,S.themeSpacing)(2),paddingBlock:t=>(0,S.themeSpacing)((0,S.themeDensity)(t)*2),paddingInline:t=>(0,S.themeSpacing)((0,S.themeDensity)(t)*4),borderTop:t=>`1px solid ${(0,S.themeColor)(t,"shift-3",o)}`}}}}var Be=require("@domphy/core"),we=require("@domphy/theme");function Ft(n={}){let{direction:o="horizontal",defaultSize:t=50,min:e=10,max:r=90}=n;return{_onSchedule:(i,s)=>{(0,Be.merge)(s,{_context:{splitter:{direction:o,size:(0,Be.toState)(t),min:e,max:r}}})},style:{display:"flex",flexDirection:o==="horizontal"?"row":"column",overflow:"hidden"}}}function Vt(){return{_onMount:n=>{let o=n.getContext("splitter"),t=n.domElement,e=o.direction==="horizontal"?"width":"height";t.style[e]=`${o.size.get()}%`,t.style.flexShrink="0",t.style.overflow="auto";let r=o.size.onChange(i=>{t.style[e]=`${i}%`});n.addHook("Remove",r)}}}function At(){return{_onMount:n=>{let o=n.getContext("splitter"),t=n.domElement,e=o.direction==="horizontal";t.style.cursor=e?"col-resize":"row-resize";let r=i=>{i.preventDefault();let s=t.parentElement,a=c=>{let m=s.getBoundingClientRect(),d=e?(c.clientX-m.left)/m.width*100:(c.clientY-m.top)/m.height*100;o.size.set(Math.min(Math.max(d,o.min),o.max))},l=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",l)};t.addEventListener("mousedown",r),n.addHook("Remove",()=>t.removeEventListener("mousedown",r))},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:n=>(0,we.themeColor)(n,"shift-2"),"&:hover":{backgroundColor:n=>(0,we.themeColor)(n,"shift-3")},"&::after":{content:'""',borderRadius:(0,we.themeSpacing)(999),backgroundColor:n=>(0,we.themeColor)(n,"shift-4")}}}}var Fe=require("@domphy/core"),k=require("@domphy/theme");function Wt(){return{_onSchedule:(n,o)=>{(0,Fe.merge)(o,{_context:{command:{query:(0,Fe.toState)("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function Kt(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:e=>{let r=e.getContext("command"),i=e.domElement,s=()=>r.query.set(i.value);i.addEventListener("input",s),e.addHook("Remove",()=>i.removeEventListener("input",s))},style:{fontFamily:"inherit",fontSize:e=>(0,k.themeSize)(e,"inherit"),paddingInline:e=>(0,k.themeSpacing)((0,k.themeDensity)(e)*3),paddingBlock:e=>(0,k.themeSpacing)((0,k.themeDensity)(e)*2),border:"none",borderBottom:e=>`1px solid ${(0,k.themeColor)(e,"shift-3",o)}`,outline:"none",color:e=>(0,k.themeColor)(e,"shift-10",o),backgroundColor:e=>(0,k.themeColor)(e,"inherit",o),"&::placeholder":{color:e=>(0,k.themeColor)(e,"shift-7")},"&:focus-visible":{borderBottomColor:e=>(0,k.themeColor)(e,"shift-6",t)}}}}function jt(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{role:"option",_onMount:e=>{var l,c;let r=e.getContext("command"),i=e.domElement,s=(c=(l=i.textContent)==null?void 0:l.toLowerCase())!=null?c:"",a=r.query.onChange(m=>{i.hidden=m.length>0&&!s.includes(m.toLowerCase())});e.addHook("Remove",a)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:e=>(0,k.themeSize)(e,"inherit"),height:e=>(0,k.themeSpacing)(6+(0,k.themeDensity)(e)*2),paddingInline:e=>(0,k.themeSpacing)((0,k.themeDensity)(e)*3),border:"none",outline:"none",color:e=>(0,k.themeColor)(e,"shift-9",o),backgroundColor:e=>(0,k.themeColor)(e,"inherit",o),"&:hover:not([disabled])":{backgroundColor:e=>(0,k.themeColor)(e,"shift-2",o)},"&:focus-visible":{outline:e=>`${(0,k.themeSpacing)(.5)} solid ${(0,k.themeColor)(e,"shift-6",t)}`,outlineOffset:`-${(0,k.themeSpacing)(.5)}`}}}}var j=require("@domphy/theme");function qt(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{role:"button",_onInsert:e=>{var l;e.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let r=e.getContext("toggleGroup"),s=((l=e.parent)==null?void 0:l.children.items).filter(c=>c.type==="ElementNode"&&c.attributes.get("role")==="button"),a=String(s.findIndex(c=>c===e));e.attributes.set("ariaPressed",c=>{let m=r.value.get(c);return Array.isArray(m)?m.includes(a):m===a}),e.addEvent("click",()=>{let c=r.value.get();if(r.multiple){let m=Array.isArray(c)?[...c]:[];r.value.set(m.includes(a)?m.filter(d=>d!==a):[...m,a])}else r.value.set(c===a?"":a)})},style:{cursor:"pointer",fontSize:e=>(0,j.themeSize)(e,"inherit"),height:(0,j.themeSpacing)(6),paddingBlock:(0,j.themeSpacing)(1),paddingInline:(0,j.themeSpacing)(2),border:"none",borderRadius:(0,j.themeSpacing)(1),color:e=>(0,j.themeColor)(e,"shift-9",o),backgroundColor:e=>(0,j.themeColor)(e,"inherit",o),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:e=>(0,j.themeColor)(e,"shift-2",o)},"&[aria-pressed=true]":{backgroundColor:e=>(0,j.themeColor)(e,"shift-6",t),color:e=>(0,j.themeColor)(e,"shift-11",t)},"&:focus-visible":{outline:e=>`${(0,j.themeSpacing)(.5)} solid ${(0,j.themeColor)(e,"shift-6",t)}`,outlineOffset:`-${(0,j.themeSpacing)(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}var mt=require("@domphy/core"),ae=require("@domphy/theme");function Yt(n={}){var e;let{multiple:o=!1,color:t="neutral"}=n;return{role:"group",dataTone:"shift-2",_context:{toggleGroup:{value:(0,mt.toState)((e=n.value)!=null?e:o?[]:""),multiple:o}},style:{display:"flex",paddingBlock:(0,ae.themeSpacing)(1),paddingInline:(0,ae.themeSpacing)(1),gap:(0,ae.themeSpacing)(1),borderRadius:(0,ae.themeSpacing)(2),fontSize:r=>(0,ae.themeSize)(r,"inherit"),backgroundColor:r=>(0,ae.themeColor)(r,"inherit",t),outline:r=>`1px solid ${(0,ae.themeColor)(r,"shift-3",t)}`,outlineOffset:"-1px"}}}var Je=require("@domphy/theme");function Gt(){return{style:{display:"flex",alignItems:"center",gap:(0,Je.themeSpacing)(2),"& > *":{minWidth:(0,Je.themeSpacing)(9)+"!important"}},_onMount:n=>{let o=n.domElement,t=()=>Array.from(o.querySelectorAll("input")),e=s=>{let a=t(),l=s.target,c=a.indexOf(l);l.value&&c<a.length-1&&a[c+1].focus()},r=s=>{let a=t(),l=s.target,c=a.indexOf(l);s.key==="Backspace"&&!l.value&&c>0&&a[c-1].focus(),s.key==="ArrowLeft"&&c>0&&a[c-1].focus(),s.key==="ArrowRight"&&c<a.length-1&&a[c+1].focus()},i=s=>{var d,u,b;s.preventDefault();let a=(u=(d=s.clipboardData)==null?void 0:d.getData("text"))!=null?u:"",l=t(),c=l.indexOf(s.target);[...a].forEach((p,g)=>{l[c+g]&&(l[c+g].value=p)});let m=Math.min(c+a.length-1,l.length-1);(b=l[m])==null||b.focus()};o.addEventListener("input",e),o.addEventListener("keydown",r),o.addEventListener("paste",i),n.addHook("Remove",()=>{o.removeEventListener("input",e),o.removeEventListener("keydown",r),o.removeEventListener("paste",i)})}}}var G=require("@domphy/theme");function Ut(n={}){let{color:o="primary"}=n;return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:(0,G.themeSpacing)(3),paddingBlock:t=>(0,G.themeSpacing)((0,G.themeDensity)(t)*2),paddingInline:t=>(0,G.themeSpacing)((0,G.themeDensity)(t)*4),boxShadow:t=>`inset ${(0,G.themeSpacing)(1)} 0 0 0 ${(0,G.themeColor)(t,"shift-8",o)}`,backgroundColor:t=>(0,G.themeColor)(t,"inherit",o),color:t=>(0,G.themeColor)(t,"shift-10",o),fontSize:t=>(0,G.themeSize)(t,"inherit")}}}var ye=require("@domphy/theme");function Xt(n={}){let{color:o="primary"}=n;return{dataTone:"shift-2",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:(0,ye.themeSpacing)(9),height:(0,ye.themeSpacing)(9),fontSize:t=>(0,ye.themeSize)(t,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:t=>(0,ye.themeColor)(t,"inherit",o),color:t=>(0,ye.themeColor)(t,"shift-11",o),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}var ct=require("@domphy/core"),he=require("@domphy/theme");function Jt(n={}){let{color:o="danger",label:t=999}=n,e=(0,ct.toState)(t);return{style:{position:"relative","&::after":{content:r=>`"${e.get(r)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:(0,he.themeSpacing)(1),minWidth:(0,he.themeSpacing)(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:r=>(0,he.themeSize)(r,"decrease-1"),borderRadius:(0,he.themeSpacing)(999),backgroundColor:r=>(0,he.themeColor)(r,"shift-9",o),color:r=>(0,he.themeColor)(r,"shift-0",o)}}}}var oe=require("@domphy/theme");function Qt(n={}){let{color:o="neutral",separator:t="/"}=n;return{_onInsert:e=>{e.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:e=>(0,oe.themeSize)(e,"inherit"),gap:(0,oe.themeSpacing)(1),color:e=>(0,oe.themeColor)(e,"shift-9",o),backgroundColor:e=>(0,oe.themeColor)(e,"inherit",o),"& > *":{display:"inline-flex",alignItems:"center",color:e=>(0,oe.themeColor)(e,"shift-8",o)},"& > *:not(:last-child)::after":{content:`"${t}"`,color:e=>(0,oe.themeColor)(e,"shift-4",o),paddingInlineStart:(0,oe.themeSpacing)(1)},"& > [aria-current=page]":{color:e=>(0,oe.themeColor)(e,"shift-10",o),pointerEvents:"none"}}}}var Z=require("@domphy/theme");function Zt(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:t=>(0,Z.themeSize)(t,"inherit"),paddingInline:(0,Z.themeSpacing)(1),border:"none",background:"none",cursor:"pointer",color:t=>(0,Z.themeColor)(t,"shift-8",o),borderRadius:(0,Z.themeSpacing)(1),"&:hover":{color:t=>(0,Z.themeColor)(t,"shift-10",o),backgroundColor:t=>(0,Z.themeColor)(t,"shift-2",o)},"&:focus-visible":{outline:t=>`${(0,Z.themeSpacing)(.5)} solid ${(0,Z.themeColor)(t,"shift-6",o)}`,outlineOffset:(0,Z.themeSpacing)(.5)}}}}var Ee=require("@domphy/core"),z=require("@domphy/theme");var F=require("@domphy/theme"),eo='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.707 5.293l5.293 5.292l5.293 -5.292a1 1 0 0 1 1.414 1.414l-5.292 5.293l5.292 5.293a1 1 0 0 1 -1.414 1.414l-5.293 -5.292l-5.293 5.292a1 1 0 1 1 -1.414 -1.414l5.292 -5.293l-5.292 -5.293a1 1 0 0 1 1.414 -1.414" /></svg>';function Me(n={}){let{color:o="neutral",removable:t=!1}=n;return{dataTone:"shift-2",_onInit:e=>{let r={span:eo,onClick:i=>{i.stopPropagation(),e.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:(0,F.themeSpacing)(1),width:(0,F.themeSpacing)(4),height:(0,F.themeSpacing)(4),flexShrink:0,"&:hover":{backgroundColor:i=>(0,F.themeColor)(i,"shift-4",o)}}};t&&e.children.insert(r)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:(0,F.themeSpacing)(6),paddingBlock:"0px",borderRadius:(0,F.themeSpacing)(1),paddingInlineStart:(0,F.themeSpacing)(2),paddingInlineEnd:t?(0,F.themeSpacing)(1):(0,F.themeSpacing)(2),gap:(0,F.themeSpacing)(2),fontSize:e=>(0,F.themeSize)(e,"inherit"),backgroundColor:e=>(0,F.themeColor)(e,"inherit",o),color:e=>(0,F.themeColor)(e,"shift-9",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${(0,F.themeColor)(e,"shift-4",o)}`}}}var Ne=require("@domphy/core"),se=require("@floating-ui/dom");function Ce(n){let{open:o=!1,placement:t="bottom"}=n,e=null,r=null,i=null,s=null,a=(0,Ne.toState)(o),l=(0,Ne.toState)(t),c=()=>{i&&s&&(r&&r(),r=(0,se.autoUpdate)(i,s,()=>{(0,se.computePosition)(i,s,{placement:l.get(),middleware:[(0,se.offset)(12),(0,se.flip)(),(0,se.shift)()],strategy:"fixed"}).then(({x:g,y:h,placement:L})=>{var B;Object.assign(s.style,{left:`${g}px`,top:`${h}px`}),L!==l.get()&&l.set(L),(B=n.onPlacement)==null||B.call(n,i,s,L)})}),a.set(!0))},m=()=>{r&&r(),r=null,a.set(!1)},d=()=>{e&&clearTimeout(e),e=setTimeout(c,100)},u=()=>{e&&clearTimeout(e),e=setTimeout(m,100)},b={style:{position:"fixed",pointerEvents:"auto",visibility:g=>a.get(g)?"visible":"hidden"},_onMount:g=>s=g.domElement,_portal:g=>{let h=g.domElement.querySelector("#domphy-floating");if(!h){let L={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};h=g.children.insert(L).domElement}return h}};return(0,Ne.merge)(n.content,b),{show:d,hide:u,anchorPartial:{onKeyDown:g=>g.key==="Escape"&&u(),_onSchedule:g=>{let h=null;g.getRoot().addHook("Init",L=>{h=L.children.insert(n.content)}),g.addHook("BeforeRemove",()=>{u(),e&&clearTimeout(e),h&&h.remove()})},_onMount:g=>{i=g.domElement;let h=L=>{if(!a.get()||!i||!s)return;let B=L.target;!i.contains(B)&&!s.contains(B)&&u()};g.getRoot().domElement.addEventListener("click",h),g.addHook("BeforeRemove",()=>g.getRoot().domElement.removeEventListener("click",h))}}}}function to(n){let{options:o=[],placement:t="bottom",color:e="neutral",open:r=!1,multiple:i=!1}=n,s=(0,Ee.toState)(n.value),a=(0,Ee.toState)(r),{show:l,hide:c,anchorPartial:m}=Ce({open:a,placement:t,content:n.content,onPlacement:n.onPlacement}),d={onClick:()=>!i&&c()};(0,Ee.merge)(n.content,d);let u={border:"none",outline:"none",padding:0,margin:0,flex:1,height:(0,z.themeSpacing)(6),marginInlineStart:(0,z.themeSpacing)(2),fontSize:h=>(0,z.themeSize)(h,"inherit"),color:h=>(0,z.themeColor)(h,"shift-9",e),backgroundColor:h=>(0,z.themeColor)(h,"inherit",e)},b;n.input?((0,Ee.merge)(n.input,{onFocus:()=>l(),style:u,_key:"combobox-input"}),b=n.input):b={input:null,onFocus:()=>l(),value:h=>(s.get(h),""),style:u,_key:"combobox-input"};let p={div:h=>{let L=s.get(h),B=Array.isArray(L)?L:[L],te=o.filter(Pe=>B.includes(Pe.value)).map(Pe=>({span:Pe.label,$:[Me({color:e,removable:!0})],_key:Pe.value,_onRemove:Xe=>{let $e=s.get(),rt=(Array.isArray($e)?$e:[$e]).filter(_t=>_t!==Pe.value);i?s.set(rt):s.set(rt[0])}}));return te.push(b),te},style:{display:"flex",flexWrap:"wrap",gap:(0,z.themeSpacing)(1)}},g={_onInsert:h=>{h.tagName!="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:h=>h.children.insert(p),style:{minWidth:(0,z.themeSpacing)(32),outlineOffset:"-1px",outline:h=>`1px solid ${(0,z.themeColor)(h,"shift-4","neutral")}`,paddingBlock:h=>(0,z.themeSpacing)((0,z.themeDensity)(h)*1),paddingInline:h=>(0,z.themeSpacing)((0,z.themeDensity)(h)*1),borderRadius:h=>(0,z.themeSpacing)((0,z.themeDensity)(h)*1),fontSize:h=>(0,z.themeSize)(h,"inherit"),color:h=>(0,z.themeColor)(h,"shift-9",e),backgroundColor:h=>(0,z.themeColor)(h,"inherit",e)}};return(0,Ee.merge)(m,g),m}var Qe=require("@domphy/core"),re=require("@domphy/theme");function Ze(n={}){let{placement:o="bottom-end",color:t="neutral",sideOffset:e=(0,re.themeSpacing)(6),bordered:r=!0}=n,i=(0,Qe.toState)(o),s={top:"bottom",bottom:"top",left:"right",right:"left","top-start":"bottom-end","top-end":"bottom-start","bottom-start":"top-end","bottom-end":"top-start","left-start":"right-end","left-end":"right-start","right-start":"left-end","right-end":"left-start"},a=(0,Qe.toState)(s[i.get()]);i.onChange(m=>a.set(s[m]));let l=m=>m.includes("start")?e:m.includes("end")?"auto":"50%",c=m=>m.includes("end")?e:m.includes("start")?"auto":"50%";return{style:{fontSize:m=>(0,re.themeSize)(m),backgroundColor:m=>(0,re.themeColor)(m),color:m=>(0,re.themeColor)(m,"shift-9",t),position:"relative","&::after":{content:'""',position:"absolute",width:(0,re.themeSpacing)(1.5),height:(0,re.themeSpacing)(1.5),backgroundColor:m=>(0,re.themeColor)(m,"inherit",t),borderWidth:r?"0px":"1px",borderColor:m=>(0,re.themeColor)(m,"inherit",t),borderTopStyle:m=>{let d=a.get(m);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:m=>{let d=a.get(m);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:m=>{let d=a.get(m);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:m=>{let d=a.get(m);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:m=>{let d=a.get(m);return d.includes("top")?0:d.includes("bottom")?"auto":l(d)},right:m=>{let d=a.get(m);return d.includes("right")?0:d.includes("left")?"auto":c(d)},bottom:m=>{let d=a.get(m);return d.includes("bottom")?0:d.includes("top")?"auto":c(d)},left:m=>{let d=a.get(m);return d.includes("left")?0:d.includes("right")?"auto":l(d)},transform:m=>{let d=a.get(m),u=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",b=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${u},${b}) rotate(45deg)`}}}}}var ee=require("@domphy/theme");function oo(n={}){let{color:o="inherit"}=n;return{_onInsert:t=>{t.tagName!="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-2",style:{fontSize:t=>(0,ee.themeSize)(t,"inherit"),backgroundColor:t=>(0,ee.themeColor)(t,"inherit",o),boxShadow:t=>`inset ${(0,ee.themeSpacing)(1)} 0 0 0 ${(0,ee.themeColor)(t,"shift-4",o)}`,border:"none",paddingBlock:t=>(0,ee.themeSpacing)((0,ee.themeDensity)(t)*2),paddingInline:t=>(0,ee.themeSpacing)((0,ee.themeDensity)(t)*4),margin:0}}}var $=require("@domphy/theme");function ro(n={}){let{color:o="primary"}=n;return{_onInsert:t=>{t.tagName!="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:t=>(0,$.themeSize)(t,"inherit"),paddingBlock:t=>(0,$.themeSpacing)((0,$.themeDensity)(t)*1),paddingInline:t=>(0,$.themeSpacing)((0,$.themeDensity)(t)*3),borderRadius:t=>(0,$.themeSpacing)((0,$.themeDensity)(t)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:t=>`1px solid ${(0,$.themeColor)(t,"shift-4",o)}`,color:t=>(0,$.themeColor)(t,"shift-9",o),backgroundColor:t=>(0,$.themeColor)(t,"inherit",o),"&:hover:not([disabled]):not([aria-busy=true])":{color:t=>(0,$.themeColor)(t,"shift-10",o),backgroundColor:t=>(0,$.themeColor)(t,"shift-2",o)},"&:focus-visible":{boxShadow:t=>`inset 0 0 0 ${(0,$.themeSpacing)(.5)} ${(0,$.themeColor)(t,"shift-6",o)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:t=>(0,$.themeColor)(t,"shift-2","neutral"),outline:t=>`1px solid ${(0,$.themeColor)(t,"shift-4","neutral")}`,color:t=>(0,$.themeColor)(t,"shift-8","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}var T=require("@domphy/theme");function no(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"checkbox",_onInsert:e=>{e.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:e=>(0,T.themeSize)(e,"inherit"),display:"inline-flex",position:"relative",width:(0,T.themeSpacing)(6),height:(0,T.themeSpacing)(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:(0,T.themeSpacing)(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${(0,T.themeColor)(e,"shift-4",o)}`,color:e=>(0,T.themeColor)(e,"shift-9",o),width:(0,T.themeSpacing)(4),height:(0,T.themeSpacing)(4)},"&:hover::before":{backgroundColor:e=>(0,T.themeColor)(e,"shift-2",o)},"&:checked::before":{outline:e=>`1px solid ${(0,T.themeColor)(e,"shift-6",t)}`,backgroundColor:e=>(0,T.themeColor)(e,"shift-8",t)},"&:checked:hover:not([disabled])::before":{backgroundColor:e=>(0,T.themeColor)(e,"shift-7",t)},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:e=>`${(0,T.themeSpacing)(.5)} solid ${(0,T.themeColor)(e,"inherit",t)}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:e=>`1px solid ${(0,T.themeColor)(e,"shift-6",t)}`,backgroundColor:e=>(0,T.themeColor)(e,"shift-3",t)},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:e=>(0,T.themeColor)(e,"shift-8",t)},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:e=>(0,T.themeColor)(e,"shift-7",t)},"&:focus-visible":{borderRadius:(0,T.themeSpacing)(1.5),outline:e=>`${(0,T.themeSpacing)(.5)} solid ${(0,T.themeColor)(e,"shift-6",t)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:e=>(0,T.themeColor)(e,"shift-4","neutral"),pointerEvents:"none"}}}}var pe=require("@domphy/theme");function io(n={}){let{color:o="neutral"}=n;return{dataTone:"shift-2",_onInsert:t=>{t.tagName!="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",fontSize:t=>(0,pe.themeSize)(t,"inherit"),color:t=>(0,pe.themeColor)(t,"shift-9",o),backgroundColor:t=>(0,pe.themeColor)(t,"inherit",o),height:(0,pe.themeSpacing)(6),paddingInline:(0,pe.themeSpacing)(1.5),borderRadius:(0,pe.themeSpacing)(1)}}}var f=require("@domphy/theme");function lo(n={}){let{color:o="neutral",accentColor:t="primary",duration:e=240}=n;return{_onInsert:r=>{r.tagName!="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:r=>(0,f.themeSize)(r,"inherit"),color:r=>(0,f.themeColor)(r,"shift-9",o),backgroundColor:r=>(0,f.themeColor)(r,"inherit",o),overflow:"hidden","& > summary":{backgroundColor:r=>(0,f.themeColor)(r,"shift-2",o),color:r=>(0,f.themeColor)(r,"shift-10",o),fontSize:r=>(0,f.themeSize)(r,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:(0,f.themeSpacing)(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:r=>(0,f.themeSpacing)((0,f.themeDensity)(r)*4),height:(0,f.themeSpacing)(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:(0,f.themeSpacing)(2),height:(0,f.themeSpacing)(2),flexShrink:0,marginTop:`-${(0,f.themeSpacing)(.5)}`,borderInlineEnd:r=>`${(0,f.themeSpacing)(.5)} solid ${(0,f.themeColor)(r,"shift-9",o)}`,borderBottom:r=>`${(0,f.themeSpacing)(.5)} solid ${(0,f.themeColor)(r,"shift-9",o)}`,transform:"rotate(45deg)",transition:`transform ${e}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:r=>(0,f.themeColor)(r,"shift-3",o)},"& > summary:focus-visible":{borderRadius:r=>(0,f.themeSpacing)((0,f.themeDensity)(r)*2),outlineOffset:`-${(0,f.themeSpacing)(.5)}`,outline:r=>`${(0,f.themeSpacing)(.5)} solid ${(0,f.themeColor)(r,"shift-6",t)}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:r=>(0,f.themeSpacing)((0,f.themeDensity)(r)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${e}ms ease, opacity ${e}ms ease, padding ${e}ms ease`},"&[open] > :not(summary)":{maxHeight:(0,f.themeSpacing)(250),opacity:1,paddingTop:r=>(0,f.themeSpacing)((0,f.themeDensity)(r)*1),paddingBottom:r=>(0,f.themeSpacing)((0,f.themeDensity)(r)*3)}}}}var fe=require("@domphy/theme");function ao(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${(0,fe.themeSpacing)(24)}, max-content) 1fr`,columnGap:(0,fe.themeSpacing)(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:t=>(0,fe.themeSize)(t,"inherit"),color:t=>(0,fe.themeColor)(t,"shift-10",o)},"& dd":{margin:0,fontSize:t=>(0,fe.themeSize)(t,"inherit"),color:t=>(0,fe.themeColor)(t,"shift-9",o)}}}}var dt=require("@domphy/core"),U=require("@domphy/theme");function so(n={}){let{color:o="neutral",open:t=!1}=n,e=(0,dt.toState)(t);return{_onInsert:r=>{r.tagName!="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(r,i)=>{if(r.target!==i.domElement)return;let s=i.domElement.getBoundingClientRect();r.clientX>=s.left&&r.clientX<=s.right&&r.clientY>=s.top&&r.clientY<=s.bottom||e.set(!1)},onTransitionEnd:(r,i)=>{let s=i.domElement;s.style.opacity==="0"&&(s.close(),document.body.style.overflow="")},_onMount:r=>{let i=r.domElement,s=a=>{a?(i.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{i.style.opacity="1";let l=i.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');l==null||l.focus()})):i.style.opacity="0"};s(e.get()),e.onChange(s)},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:r=>(0,U.themeSize)(r,"inherit"),color:r=>(0,U.themeColor)(r,"shift-10",o),backgroundColor:r=>(0,U.themeColor)(r,"inherit",o),border:"none",padding:r=>(0,U.themeSpacing)((0,U.themeDensity)(r)*3),boxShadow:r=>`0 ${(0,U.themeSpacing)(9)} ${(0,U.themeSpacing)(16)} ${(0,U.themeColor)(r,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:r=>(0,U.themeColor)(r,"shift-2","neutral"),opacity:.75}}}}var Ve=require("@domphy/theme");function mo(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:t=>(0,Ve.themeSize)(t,"inherit"),fontStyle:"italic",color:t=>(0,Ve.themeColor)(t,"shift-10",o)}}}var me=require("@domphy/theme");function co(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:(0,me.themeSpacing)(2),marginInline:0,marginTop:(0,me.themeSpacing)(3),marginBottom:(0,me.themeSpacing)(3),color:t=>(0,me.themeColor)(t,"shift-9",o),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:(0,me.themeSpacing)(2)},"& figcaption":{fontSize:t=>(0,me.themeSize)(t,"decrease-1"),color:t=>(0,me.themeColor)(t,"shift-8",o),lineHeight:1.45}}}}var E=require("@domphy/theme");function uo(n={}){let{color:o="neutral",layout:t="horizontal"}=n,e=t==="vertical";return{_onInsert:r=>{r.tagName!="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:r=>(0,E.themeSpacing)((0,E.themeDensity)(r)*3),paddingBlock:r=>(0,E.themeSpacing)((0,E.themeDensity)(r)*3),border:"none",borderRadius:r=>(0,E.themeSpacing)((0,E.themeDensity)(r)*2),fontSize:r=>(0,E.themeSize)(r,"inherit"),backgroundColor:r=>(0,E.themeColor)(r,"inherit",o),display:"grid",gridTemplateColumns:e?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:(0,E.themeSpacing)(4),rowGap:(0,E.themeSpacing)(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:r=>(0,E.themeSize)(r,"inherit"),fontWeight:600,paddingBlock:r=>(0,E.themeSpacing)((0,E.themeDensity)(r)*1),borderRadius:r=>(0,E.themeSpacing)((0,E.themeDensity)(r)*2),color:r=>(0,E.themeColor)(r,"shift-9",o),backgroundColor:r=>(0,E.themeColor)(r,"inherit",o)},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:r=>e?"0px":(0,E.themeSpacing)((0,E.themeDensity)(r)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:e?"auto":"span 2"},"& > :not(legend, label, p)":{gridColumn:e?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > p":{gridColumn:e?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${(0,E.themeSpacing)(2)} * -1)`,fontSize:r=>(0,E.themeSize)(r,"decrease-1"),color:r=>(0,E.themeColor)(r,"shift-9",o)}}}}var Ie=require("@domphy/theme"),ho={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function po(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{["h1","h2","h3","h4","h5","h6"].includes(t.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:t=>(0,Ie.themeColor)(t,"shift-11",o),marginTop:0,marginBottom:(0,Ie.themeSpacing)(2),fontSize:t=>{let e=ho[t.elementNode.tagName]||"inherit";return(0,Ie.themeSize)(t,e)}}}}var Re=require("@domphy/theme");function fo(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:(0,Re.themeSpacing)(3),marginBottom:(0,Re.themeSpacing)(3),backgroundColor:t=>(0,Re.themeColor)(t,"shift-4",o)}}}var Ae=require("@domphy/theme");function go(n={}){let{color:o="neutral"}=n;return{dataTone:"shift-2",_onInsert:t=>{t.tagName!="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:(0,Ae.themeSpacing)(2),backgroundColor:t=>(0,Ae.themeColor)(t,"inherit",o)}}}var ve=require("@domphy/theme");function bo(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",verticalAlign:"middle",width:(0,ve.themeSpacing)(6),height:(0,ve.themeSpacing)(6),fontSize:t=>(0,ve.themeSize)(t),backgroundColor:t=>(0,ve.themeColor)(t),color:t=>(0,ve.themeColor)(t,"shift-9",o)}}}var D=require("@domphy/theme");function yo(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"color",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputColor" primitive patch must use input tag'),r.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:e=>(0,D.themeSize)(e,"inherit"),paddingBlock:e=>(0,D.themeSpacing)((0,D.themeDensity)(e)*1),paddingInline:e=>(0,D.themeSpacing)((0,D.themeDensity)(e)*1),blockSize:e=>(0,D.themeSpacing)(6+(0,D.themeDensity)(e)*2),inlineSize:e=>(0,D.themeSpacing)(6+(0,D.themeDensity)(e)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:e=>(0,D.themeSpacing)((0,D.themeDensity)(e)*1)},"&::-moz-color-swatch":{borderRadius:e=>(0,D.themeSpacing)((0,D.themeDensity)(e)*1)},"&:hover:not([disabled]), &:focus-visible":{},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:e=>(0,D.themeColor)(e,"shift-2","neutral"),outline:e=>`1px solid ${(0,D.themeColor)(e,"shift-4","neutral")}`}}}}var M=require("@domphy/theme");function Co(n={}){let{mode:o="datetime-local",color:t="neutral",accentColor:e="primary"}=n;return{type:o,_onSchedule:(r,i)=>{r.tagName!="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),i.type=o},style:{fontFamily:"inherit",fontSize:r=>(0,M.themeSize)(r,"inherit"),lineHeight:"inherit",color:r=>(0,M.themeColor)(r,"shift-9",t),backgroundColor:r=>(0,M.themeColor)(r,"inherit",t),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${(0,M.themeColor)(r,"shift-4",t)}`,borderRadius:r=>(0,M.themeSpacing)((0,M.themeDensity)(r)*1),paddingInline:r=>(0,M.themeSpacing)((0,M.themeDensity)(r)*3),height:r=>(0,M.themeSpacing)(6+(0,M.themeDensity)(r)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:r=>`${(0,M.themeSpacing)(.5)} solid ${(0,M.themeColor)(r,"shift-6",e)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:r=>(0,M.themeColor)(r,"shift-8","neutral"),backgroundColor:r=>(0,M.themeColor)(r,"shift-2","neutral"),outline:r=>`1px solid ${(0,M.themeColor)(r,"shift-4","neutral")}`},"&:invalid":{outline:r=>`${(0,M.themeSpacing)(.5)} solid ${(0,M.themeColor)(r,"shift-6","error")}`}}}}var y=require("@domphy/theme");function vo(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"file",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputFile" primitive patch must use input tag'),r.type="file"},style:{fontFamily:"inherit",fontSize:e=>(0,y.themeSize)(e,"inherit"),lineHeight:"inherit",color:e=>(0,y.themeColor)(e,"shift-9",o),backgroundColor:e=>(0,y.themeColor)(e,"inherit",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${(0,y.themeColor)(e,"shift-4",o)}`,borderRadius:e=>(0,y.themeSpacing)((0,y.themeDensity)(e)*1),height:e=>(0,y.themeSpacing)(6+(0,y.themeDensity)(e)*2),paddingInline:e=>(0,y.themeSpacing)((0,y.themeDensity)(e)*1),"&::file-selector-button":{marginBlock:"auto",fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:(0,y.themeSpacing)(1),height:(0,y.themeSpacing)(6),paddingInline:(0,y.themeSpacing)(2),cursor:"pointer",color:e=>(0,y.themeColor)(e,"shift-10",t),backgroundColor:e=>(0,y.themeColor)(e,"shift-3",t)},"&::-webkit-file-upload-button":{marginTop:(0,y.themeSpacing)(1),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:(0,y.themeSpacing)(1),height:(0,y.themeSpacing)(6),paddingInline:(0,y.themeSpacing)(2),cursor:"pointer",color:e=>(0,y.themeColor)(e,"shift-10",o),backgroundColor:e=>(0,y.themeColor)(e,"shift-3",o)},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${(0,y.themeSpacing)(.5)} solid ${(0,y.themeColor)(e,"shift-6",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>(0,y.themeColor)(e,"shift-8","neutral"),outline:e=>`1px solid ${(0,y.themeColor)(e,"shift-4","neutral")}`,backgroundColor:e=>(0,y.themeColor)(e,"shift-2","neutral")},"&[disabled]::file-selector-button, &[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:e=>(0,y.themeColor)(e,"shift-8","neutral"),backgroundColor:e=>(0,y.themeColor)(e,"shift-3","neutral")}}}}var N=require("@domphy/theme");function xo(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"search",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputSearch" primitive patch must use input tag'),r.type="search"},style:{fontFamily:"inherit",fontSize:e=>(0,N.themeSize)(e,"inherit"),lineHeight:"inherit",color:e=>(0,N.themeColor)(e,"shift-9",o),backgroundColor:e=>(0,N.themeColor)(e,"inherit",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${(0,N.themeColor)(e,"shift-4",o)}`,borderRadius:e=>(0,N.themeSpacing)((0,N.themeDensity)(e)*1),minWidth:(0,N.themeSpacing)(32),paddingInline:e=>(0,N.themeSpacing)((0,N.themeDensity)(e)*3),paddingBlock:e=>(0,N.themeSpacing)((0,N.themeDensity)(e)*1),"&::placeholder":{color:e=>(0,N.themeColor)(e,"shift-7",o)},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${(0,N.themeSpacing)(.5)} solid ${(0,N.themeColor)(e,"shift-6",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>(0,N.themeColor)(e,"shift-8","neutral"),backgroundColor:e=>(0,N.themeColor)(e,"shift-2","neutral"),outline:e=>`1px solid ${(0,N.themeColor)(e,"shift-4","neutral")}`}}}}var C=require("@domphy/theme");function So(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"text",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),r.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:(0,C.themeSpacing)(32),paddingInline:e=>(0,C.themeSpacing)((0,C.themeDensity)(e)*3),paddingBlock:e=>(0,C.themeSpacing)((0,C.themeDensity)(e)*1),borderRadius:e=>(0,C.themeSpacing)((0,C.themeDensity)(e)*1),fontSize:e=>(0,C.themeSize)(e,"inherit"),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${(0,C.themeColor)(e,"shift-4",o)}`,color:e=>(0,C.themeColor)(e,"shift-9",o),backgroundColor:e=>(0,C.themeColor)(e,"inherit",o),"&::placeholder":{color:e=>(0,C.themeColor)(e,"shift-7")},"&:not(:placeholder-shown)":{color:e=>(0,C.themeColor)(e,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${(0,C.themeSpacing)(.5)} solid ${(0,C.themeColor)(e,"shift-6",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:e=>(0,C.themeColor)(e,"shift-2","neutral"),outline:e=>`1px solid ${(0,C.themeColor)(e,"shift-4","neutral")}`,color:e=>(0,C.themeColor)(e,"shift-8","neutral")},"&:invalid:not(:placeholder-shown)":{outline:e=>`${(0,C.themeSpacing)(.5)} solid ${(0,C.themeColor)(e,"shift-6","error")}`},"&[data-status=error]":{outline:e=>`${(0,C.themeSpacing)(.5)} solid ${(0,C.themeColor)(e,"shift-6","error")}`},"&[data-status=warning]":{outline:e=>`${(0,C.themeSpacing)(.5)} solid ${(0,C.themeColor)(e,"shift-6","warning")}`}}}}var P=require("@domphy/theme");function Eo(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"range",_onInsert:e=>{e.tagName!="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:(0,P.themeSpacing)(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:(0,P.themeSpacing)(1.5),borderRadius:(0,P.themeSpacing)(999),backgroundColor:e=>(0,P.themeColor)(e,"shift-3",o)},"&::-moz-range-track":{height:(0,P.themeSpacing)(1.5),borderRadius:(0,P.themeSpacing)(999),backgroundColor:e=>(0,P.themeColor)(e,"shift-3",o)},"&::-webkit-slider-thumb":{appearance:"none",width:(0,P.themeSpacing)(4),height:(0,P.themeSpacing)(4),borderRadius:(0,P.themeSpacing)(999),border:"none",marginTop:`calc((${(0,P.themeSpacing)(1.5)} - ${(0,P.themeSpacing)(4)}) / 2)`,backgroundColor:e=>(0,P.themeColor)(e,"shift-9",t)},"&::-moz-range-thumb":{width:(0,P.themeSpacing)(4),height:(0,P.themeSpacing)(4),borderRadius:(0,P.themeSpacing)(999),border:"none",backgroundColor:e=>(0,P.themeColor)(e,"shift-9",t)},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:e=>(0,P.themeColor)(e,"shift-10",t)},"&:hover:not([disabled])::-moz-range-thumb":{backgroundColor:e=>(0,P.themeColor)(e,"shift-10",t)},"&:focus-visible":{outline:e=>`${(0,P.themeSpacing)(.5)} solid ${(0,P.themeColor)(e,"shift-6",t)}`,outlineOffset:(0,P.themeSpacing)(1),borderRadius:(0,P.themeSpacing)(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}var R=require("@domphy/theme");function ko(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"number",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputNumber" primitive patch must use input tag'),r.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:(0,R.themeSpacing)(32),paddingInline:e=>(0,R.themeSpacing)((0,R.themeDensity)(e)*3),paddingBlock:e=>(0,R.themeSpacing)((0,R.themeDensity)(e)*1),borderRadius:e=>(0,R.themeSpacing)((0,R.themeDensity)(e)*1),fontSize:e=>(0,R.themeSize)(e,"inherit"),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${(0,R.themeColor)(e,"shift-4",o)}`,color:e=>(0,R.themeColor)(e,"shift-9",o),backgroundColor:e=>(0,R.themeColor)(e,"inherit",o),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${(0,R.themeSpacing)(.5)} solid ${(0,R.themeColor)(e,"shift-6",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:e=>(0,R.themeColor)(e,"shift-2","neutral"),outline:e=>`1px solid ${(0,R.themeColor)(e,"shift-4","neutral")}`,color:e=>(0,R.themeColor)(e,"shift-8","neutral")}}}}var ce=require("@domphy/theme");function To(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:t=>(0,ce.themeSize)(t,"inherit"),color:t=>(0,ce.themeColor)(t,"shift-9",o),backgroundColor:t=>(0,ce.themeColor)(t,"inherit",o),paddingBlock:(0,ce.themeSpacing)(.5),paddingInline:(0,ce.themeSpacing)(1.5),borderRadius:(0,ce.themeSpacing)(1),outline:t=>`1px solid ${(0,ce.themeColor)(t,"shift-4",o)}`}}}var xe=require("@domphy/theme");function Po(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:(0,xe.themeSpacing)(2),fontSize:e=>(0,xe.themeSize)(e,"inherit"),color:e=>(0,xe.themeColor)(e,"shift-9",o),cursor:"pointer","&:focus-within":{color:e=>(0,xe.themeColor)(e,"shift-10",t)},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:e=>(0,xe.themeColor)(e,"shift-8","neutral")}}}}var X=require("@domphy/theme");function wo(n={}){let{color:o="primary",accentColor:t="secondary"}=n;return{_onInsert:e=>{e.tagName!="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:e=>(0,X.themeSize)(e,"inherit"),backgroundColor:e=>(0,X.themeColor)(e),color:e=>(0,X.themeColor)(e,"shift-9",o),textDecoration:"none","&:visited":{color:e=>(0,X.themeColor)(e,"shift-9",t)},"&:hover:not([disabled])":{color:e=>(0,X.themeColor)(e,"shift-10",o),textDecoration:"underline"},"&:focus-visible":{borderRadius:(0,X.themeSpacing)(1),outlineOffset:(0,X.themeSpacing)(1),outline:e=>`${(0,X.themeSpacing)(.5)} solid ${(0,X.themeColor)(e,"shift-6",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>(0,X.themeColor)(e,"shift-8","neutral")}}}}var ge=require("@domphy/theme");function Io(n={}){let{accentColor:o="highlight"}=n;return{_onInsert:t=>{t.tagName!="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:"shift-2",style:{display:"inline-flex",alignItems:"center",fontSize:t=>(0,ge.themeSize)(t,"inherit"),color:t=>(0,ge.themeColor)(t,"shift-9",o),backgroundColor:t=>(0,ge.themeColor)(t,"inherit",o),height:(0,ge.themeSpacing)(6),borderRadius:(0,ge.themeSpacing)(1),paddingInline:(0,ge.themeSpacing)(1.5)}}}var We=require("@domphy/theme");function _o(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:t=>(0,We.themeSize)(t,"inherit"),color:t=>(0,We.themeColor)(t,"shift-9",o),lineHeight:1.5,marginTop:0,marginBottom:0}}}var J=require("@domphy/theme");function zo(n={}){let{color:o="neutral"}=n;return{dataTone:"shift-2",_onInsert:t=>{t.tagName!="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:t=>(0,J.themeSize)(t,"inherit"),color:t=>(0,J.themeColor)(t,"shift-9",o),backgroundColor:t=>(0,J.themeColor)(t,"inherit",o),border:"none",paddingBlock:t=>(0,J.themeSpacing)((0,J.themeDensity)(t)*2),paddingInline:t=>(0,J.themeSpacing)((0,J.themeDensity)(t)*3),borderRadius:t=>(0,J.themeSpacing)((0,J.themeDensity)(t)*2)}}}var ne=require("@domphy/theme");function $o(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:(0,ne.themeSpacing)(2),border:0,borderRadius:(0,ne.themeSpacing)(999),overflow:"hidden",backgroundColor:e=>(0,ne.themeColor)(e,"shift-3",o),"&::-webkit-progress-bar":{backgroundColor:e=>(0,ne.themeColor)(e,"shift-3",o),borderRadius:(0,ne.themeSpacing)(999)},"&::-webkit-progress-value":{backgroundColor:e=>(0,ne.themeColor)(e,"shift-9",t),borderRadius:(0,ne.themeSpacing)(999),transition:"width 220ms ease"},"&::-moz-progress-bar":{backgroundColor:e=>(0,ne.themeColor)(e,"shift-9",t),borderRadius:(0,ne.themeSpacing)(999)}}}}var V=require("@domphy/theme");function Mo(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"radio",_onInsert:e=>{if(e.tagName!="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:e=>(0,V.themeSize)(e,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:(0,V.themeSpacing)(6),height:(0,V.themeSpacing)(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:"50%",lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${(0,V.themeColor)(e,"shift-4",o)}`,color:e=>(0,V.themeColor)(e,"shift-9",o),width:(0,V.themeSpacing)(4),height:(0,V.themeSpacing)(4)},"&:hover::before":{backgroundColor:e=>(0,V.themeColor)(e,"shift-2",o)},"&:checked::before":{outline:e=>`1px solid ${(0,V.themeColor)(e,"shift-6",t)}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:e=>(0,V.themeColor)(e,"shift-8",t)},"&:checked:hover:not([disabled])::before":{backgroundColor:e=>(0,V.themeColor)(e,"shift-7",t)},"&:focus-visible":{borderRadius:"50%",outline:e=>`${(0,V.themeSpacing)(.5)} solid ${(0,V.themeColor)(e,"shift-6",t)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:e=>(0,V.themeColor)(e,"shift-4","neutral"),pointerEvents:"none"}}}}var x=require("@domphy/theme");function No(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="select"&&console.warn('"select" primitive patch must use select tag')},style:{fontFamily:"inherit",fontSize:e=>(0,x.themeSize)(e,"inherit"),lineHeight:"inherit",color:e=>(0,x.themeColor)(e,"shift-9",o),backgroundColor:e=>(0,x.themeColor)(e,"inherit",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${(0,x.themeColor)(e,"shift-4",o)}`,borderRadius:e=>(0,x.themeSpacing)((0,x.themeDensity)(e)*1),paddingBlock:e=>(0,x.themeSpacing)((0,x.themeDensity)(e)*1),paddingLeft:e=>(0,x.themeSpacing)((0,x.themeDensity)(e)*3),paddingRight:e=>(0,x.themeSpacing)((0,x.themeDensity)(e)*1),"&:not([multiple])":{height:e=>(0,x.themeSpacing)(6+(0,x.themeDensity)(e)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:e=>`${(0,x.themeSpacing)(.5)} solid ${(0,x.themeColor)(e,"shift-5",t)}`},"&:focus-visible":{outline:e=>`${(0,x.themeSpacing)(.5)} solid ${(0,x.themeColor)(e,"shift-6",t)}`},"& optgroup":{color:e=>(0,x.themeColor)(e,"shift-11",o)},"& option[disabled]":{color:e=>(0,x.themeColor)(e,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>(0,x.themeColor)(e,"shift-8","neutral"),outline:e=>`1px solid ${(0,x.themeColor)(e,"shift-4","neutral")}`,backgroundColor:e=>(0,x.themeColor)(e,"shift-2","neutral")}}}}var ut=require("@domphy/core"),Se=require("@domphy/theme");function Ro(n={}){let{color:o="neutral"}=n,t={"0%,100%":{opacity:1},"50%":{opacity:.4}},e=(0,ut.hashString)(JSON.stringify(t));return{ariaHidden:"true",dataTone:"shift-2",style:{fontSize:r=>(0,Se.themeSize)(r),color:r=>(0,Se.themeColor)(r,"shift-9",o),height:(0,Se.themeSpacing)(6),display:"block",borderRadius:(0,Se.themeSpacing)(1),backgroundColor:r=>(0,Se.themeColor)(r,"inherit",o),animation:`${e} 1.5s ease-in-out infinite`,[`@keyframes ${e}`]:t}}}var pt=require("@domphy/core"),ie=require("@domphy/theme"),ft={to:{transform:"rotate(360deg)"}},ht=(0,pt.hashString)(JSON.stringify(ft));function Lo(n={}){let{color:o="neutral"}=n;return{role:"status",ariaLabel:"loading",_onInsert:t=>{t.tagName!="span"&&console.warn('"spinner" patch must use span tag')},style:{fontSize:t=>(0,ie.themeSize)(t),backgroundColor:t=>(0,ie.themeColor)(t),color:t=>(0,ie.themeColor)(t,"shift-9",o),display:"inline-block",margin:0,flexShrink:0,width:(0,ie.themeSpacing)(6),height:(0,ie.themeSpacing)(6),borderRadius:"50%",border:t=>`${(0,ie.themeSpacing)(.5)} solid ${(0,ie.themeColor)(t,"shift-4",o)}`,borderTopColor:t=>(0,ie.themeColor)(t,"shift-9",o),boxSizing:"border-box",padding:0,animation:`${ht} 0.7s linear infinite`,[`@keyframes ${ht}`]:ft}}}var gt=require("@domphy/core"),de=require("@domphy/theme");function Do(n={}){var s;let{color:o="neutral",multiple:t=!1}=n,e=(0,gt.toState)((s=n.value)!=null?s:t?[]:null),r={div:a=>{let l=e.get(a);return(Array.isArray(l)?l:[l]).map(m=>({input:null,name:n.name,value:m||""}))},hidden:!0};return{dataTone:"shift-17",_context:{select:{value:e,multiple:t}},_onInit:a=>{a.tagName!="div"&&console.warn('"selectList" patch must use a div tag'),a.children.insert(r)},style:{display:"flex",flexDirection:"column",paddingBlock:a=>(0,de.themeSpacing)((0,de.themeDensity)(a)*2),paddingInline:a=>(0,de.themeSpacing)((0,de.themeDensity)(a)*2),fontSize:a=>(0,de.themeSize)(a,"inherit"),backgroundColor:a=>(0,de.themeColor)(a,"inherit",o)}}}var A=require("@domphy/theme");function Ho(n={}){let{accentColor:o="primary",color:t="neutral",value:e=null}=n;return{role:"option",_onInit:i=>{i.tagName!="div"&&console.warn('"selectItem" patch must use div tag');let s=i.getContext("select");if(s){let a=s.value;i.attributes.set("ariaSelected",l=>{let c=a.get(l);return s.multiple?c.includes(e):c==e}),i.addEvent("click",()=>{let l=a.get();s.multiple?l.includes(e)?a.set(l.filter(c=>c!==e)):a.set(l.concat([e])):l!=e&&a.set(e)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:i=>(0,A.themeSize)(i,"inherit"),height:i=>(0,A.themeSpacing)(6+(0,A.themeDensity)(i)*2),paddingInline:i=>(0,A.themeSpacing)((0,A.themeDensity)(i)*3),border:"none",outline:"none",color:i=>(0,A.themeColor)(i,"shift-9",t),backgroundColor:i=>(0,A.themeColor)(i,"inherit",t),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:i=>(0,A.themeColor)(i,"shift-2",t)},"&[aria-selected=true]":{backgroundColor:i=>(0,A.themeColor)(i,"shift-6",o),color:i=>(0,A.themeColor)(i,"shift-11")},"&:focus-visible":{outline:i=>`${(0,A.themeSpacing)(.5)} solid ${(0,A.themeColor)(i,"shift-6",o)}`,outlineOffset:`-${(0,A.themeSpacing)(.5)}`}}}}var _e=require("@domphy/core"),q=require("@domphy/theme");function Oo(n){let{options:o=[],placement:t="bottom",color:e="neutral",open:r=!1,multiple:i=!1}=n,s=(0,_e.toState)(n.value),a=(0,_e.toState)(r),{show:l,hide:c,anchorPartial:m}=Ce({open:a,placement:t,content:n.content,onPlacement:n.onPlacement}),d={onClick:()=>!i&&c()};(0,_e.merge)(n.content,d);let u={div:p=>{let g=s.get(p),h=Array.isArray(g)?g:[g];return o.filter(B=>h.includes(B.value)).map(B=>({span:B.label,$:[Me({color:e,removable:i})],_key:B.value,_onRemove:He=>{let te=s.get(),Xe=(Array.isArray(te)?te:[te]).filter($e=>$e!==B.value);i?s.set(Xe):s.set(Xe[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:(0,q.themeSpacing)(1),flex:1}},b={_onInsert:p=>{p.tagName!="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:p=>p.children.insert(u),onClick:()=>a.get()?c():l(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:p=>(0,q.themeSpacing)(6+(0,q.themeDensity)(p)*2),minWidth:(0,q.themeSpacing)(32),outlineOffset:"-1px",outline:p=>`1px solid ${(0,q.themeColor)(p,"shift-4","neutral")}`,paddingInline:p=>(0,q.themeSpacing)((0,q.themeDensity)(p)*2),borderRadius:p=>(0,q.themeSpacing)((0,q.themeDensity)(p)*1),fontSize:p=>(0,q.themeSize)(p,"inherit"),color:p=>(0,q.themeColor)(p,"shift-9",e),backgroundColor:p=>(0,q.themeColor)(p,"inherit",e)}};return(0,_e.merge)(m,b),m}var W=require("@domphy/theme");function Bo(n={}){let{accentColor:o="primary"}=n;return{dataTone:"shift-2",type:"checkbox",_onSchedule:t=>{if(t.tagName!="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:t=>(0,W.themeSize)(t,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:(0,W.themeSpacing)(9),height:(0,W.themeSpacing)(6),cursor:"pointer",margin:"0",paddingBlock:(0,W.themeSpacing)(1),"&:checked":{"&::before":{backgroundColor:t=>(0,W.themeColor)(t,"increase-3",o)},"&::after":{left:`calc(100% - ${(0,W.themeSpacing)(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:(0,W.themeSpacing)(3),height:(0,W.themeSpacing)(3),borderRadius:(0,W.themeSpacing)(999),left:(0,W.themeSpacing)(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:t=>(0,W.themeColor)(t,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:(0,W.themeSpacing)(999),display:"inline-block",fontSize:t=>(0,W.themeSize)(t,"inherit"),lineHeight:1,backgroundColor:t=>(0,W.themeColor)(t)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}var bt=require("@domphy/core"),I=require("@domphy/theme");function Fo(n={}){let{checked:o=!1,accentColor:t="primary",color:e="neutral"}=n,r=(0,bt.toState)(o);return{_onSchedule:i=>{i.tagName!="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:i=>r.get(i),dataTone:"shift-2",onClick:()=>r.set(!r.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:i=>(0,I.themeSize)(i),border:"none",outlineWidth:"1px",outline:i=>`1px solid ${(0,I.themeColor)(i,"shift-3",e)}`,minWidth:(0,I.themeSpacing)(12),minHeight:(0,I.themeSpacing)(6),borderRadius:(0,I.themeSpacing)(999),paddingLeft:(0,I.themeSpacing)(7),paddingRight:(0,I.themeSpacing)(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:i=>(0,I.themeColor)(i,"inherit",e),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:(0,I.themeSpacing)(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:(0,I.themeSpacing)(5),height:(0,I.themeSpacing)(5),borderRadius:(0,I.themeSpacing)(999),color:i=>(0,I.themeColor)(i,"shift-9"),backgroundColor:i=>(0,I.themeColor)(i,"decrease-2",e)},"&[aria-checked=true]":{backgroundColor:i=>(0,I.themeColor)(i,"increase-3",t),outline:"none",color:i=>(0,I.themeColor)(i,"decrease-2"),paddingLeft:(0,I.themeSpacing)(2),paddingRight:(0,I.themeSpacing)(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${(0,I.themeSpacing)(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}var Ke=require("@domphy/theme");function Vo(n={}){let{color:o="neutral"}=n;return{dataSize:"decrease-1",_onInsert:t=>{t.tagName!="small"&&console.warn('"small" primitive patch must use small tag')},style:{fontSize:t=>(0,Ke.themeSize)(t,"inherit"),color:t=>(0,Ke.themeColor)(t,"shift-9",o)}}}var je=require("@domphy/theme");function Ao(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:t=>(0,je.themeSize)(t,"inherit"),fontWeight:700,color:t=>(0,je.themeColor)(t,"shift-11",o)}}}var qe=require("@domphy/theme");function Wo(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:t=>(0,qe.themeSize)(t,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:t=>(0,qe.themeColor)(t,"shift-9",o)}}}var Ye=require("@domphy/theme");function Ko(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:t=>(0,Ye.themeSize)(t,"decrease-1"),verticalAlign:"super",lineHeight:0,color:t=>(0,Ye.themeColor)(t,"shift-9",o)}}}var v=require("@domphy/theme");function jo(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:t=>(0,v.themeSize)(t,"inherit"),color:t=>(0,v.themeColor)(t,"shift-9",o),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:t=>(0,v.themeSpacing)((0,v.themeDensity)(t)*3),paddingBlock:t=>(0,v.themeSpacing)((0,v.themeDensity)(t)*1),color:t=>(0,v.themeColor)(t,"shift-10",o),backgroundColor:t=>(0,v.themeColor)(t,"inherit")},"& td":{textAlign:"left",paddingInline:t=>(0,v.themeSpacing)((0,v.themeDensity)(t)*3),paddingBlock:t=>(0,v.themeSpacing)((0,v.themeDensity)(t)*1),color:t=>(0,v.themeColor)(t,"shift-9",o),boxShadow:t=>`inset 0 1px 0 ${(0,v.themeColor)(t,"shift-4",o)}`,fontSize:t=>(0,v.themeSize)(t,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:t=>(0,v.themeSpacing)((0,v.themeDensity)(t)*3),paddingBlock:t=>(0,v.themeSpacing)((0,v.themeDensity)(t)*1),color:t=>(0,v.themeColor)(t,"shift-10",o),backgroundColor:t=>(0,v.themeColor)(t,"inherit"),boxShadow:t=>`inset 0 -1px 0 ${(0,v.themeColor)(t,"shift-4",o)}`},"& tr":{backgroundColor:t=>(0,v.themeColor)(t,"inherit")},"& tbody tr:hover":{backgroundColor:t=>(0,v.themeColor)(t,"shift-3")+"!important"}}}}var w=require("@domphy/theme");function qo(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:e=>(0,w.themeSpacing)((0,w.themeDensity)(e)*4),paddingBlock:e=>(0,w.themeSpacing)((0,w.themeDensity)(e)*2),border:"none",borderRadius:e=>(0,w.themeSpacing)((0,w.themeDensity)(e)*2),fontSize:e=>(0,w.themeSize)(e,"inherit"),color:e=>(0,w.themeColor)(e,"shift-9",o),outlineOffset:"-1px",outline:e=>`1px solid ${(0,w.themeColor)(e,"shift-4",o)}`,backgroundColor:e=>(0,w.themeColor)(e,"inherit",o),"&::placeholder":{color:e=>(0,w.themeColor)(e,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:e=>`${(0,w.themeSpacing)(.5)} solid ${(0,w.themeColor)(e,"shift-5",t)}`},"&:focus-visible":{outline:e=>`${(0,w.themeSpacing)(.5)} solid ${(0,w.themeColor)(e,"shift-6",t)}`},"&:invalid":{outline:e=>`${(0,w.themeSpacing)(.5)} solid ${(0,w.themeColor)(e,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>(0,w.themeColor)(e,"shift-8","neutral"),outline:e=>`1px solid ${(0,w.themeColor)(e,"shift-4","neutral")}`,backgroundColor:e=>(0,w.themeColor)(e,"shift-2","neutral")}}}}var ke=require("@domphy/theme");function Yo(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:t=>(0,ke.themeSize)(t,"inherit"),backgroundColor:t=>(0,ke.themeColor)(t),color:t=>(0,ke.themeColor)(t,"shift-9",o),marginTop:0,marginBottom:0,paddingLeft:(0,ke.themeSpacing)(3),listStyleType:"disc",listStylePosition:"outside"}}}var Te=require("@domphy/theme");function Go(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:t=>(0,Te.themeSize)(t,"inherit"),backgroundColor:t=>(0,Te.themeColor)(t),color:t=>(0,Te.themeColor)(t,"shift-9",o),marginTop:0,marginBottom:0,paddingLeft:(0,Te.themeSpacing)(3),listStyleType:"decimal",listStylePosition:"outside"}}}var yt=require("@domphy/core"),_=require("@domphy/theme");function Uo(n,o){if(o<=7)return Array.from({length:o},(i,s)=>s+1);let t=[1];n>3&&t.push("...");let e=Math.max(2,n-1),r=Math.min(o-1,n+1);for(let i=e;i<=r;i++)t.push(i);return n<o-2&&t.push("..."),t.push(o),t}function Xo(n){var a;let{total:o,color:t="neutral",accentColor:e="primary"}=n,r=(0,yt.toState)((a=n.value)!=null?a:1),i={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:l=>(0,_.themeSpacing)(6+(0,_.themeDensity)(l)*2),height:l=>(0,_.themeSpacing)(6+(0,_.themeDensity)(l)*2),paddingInline:l=>(0,_.themeSpacing)((0,_.themeDensity)(l)*2),borderRadius:l=>(0,_.themeSpacing)((0,_.themeDensity)(l)*1),border:"none",cursor:"pointer",fontSize:l=>(0,_.themeSize)(l,"inherit"),backgroundColor:"transparent",color:l=>(0,_.themeColor)(l,"shift-9",t),"&:hover:not([disabled])":{backgroundColor:l=>(0,_.themeColor)(l,"shift-2",t)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},s=st(at({},i),{backgroundColor:l=>(0,_.themeColor)(l,"shift-6",e),color:l=>(0,_.themeColor)(l,"shift-11",e),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:l=>(0,_.themeColor)(l,"shift-6",e)}});return{_onInsert:l=>{l.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:l=>{let c={div:m=>{let d=r.get(m),u=[];u.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&r.set(d-1),style:i});for(let b of Uo(d,o))if(b==="...")u.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:p=>(0,_.themeSpacing)((0,_.themeDensity)(p)*2),color:p=>(0,_.themeColor)(p,"shift-7",t)}});else{let p=b===d;u.push({button:String(b),type:"button",ariaLabel:`Page ${b}`,ariaCurrent:p?"page":void 0,disabled:p,onClick:()=>r.set(b),style:p?s:i})}return u.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:d>=o,onClick:()=>d<o&&r.set(d+1),style:i}),u},style:{display:"flex",alignItems:"center",gap:(0,_.themeSpacing)(1)}};l.children.insert(c)},style:{display:"inline-flex"}}}var be=require("@domphy/theme");function Jo(n={}){let{color:o="neutral"}=n;return{role:"separator",_onInsert:t=>{t.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:(0,be.themeSpacing)(2),fontSize:t=>(0,be.themeSize)(t,"inherit"),backgroundColor:t=>(0,be.themeColor)(t),color:t=>(0,be.themeColor)(t,"shift-9",o),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:t=>(0,be.themeColor)(t,"shift-4",o),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:t=>(0,be.themeColor)(t,"shift-4",o),borderWidth:"1px",borderBottomStyle:"solid"}}}}var vt=require("@domphy/core"),Y=require("@domphy/theme"),Ct={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},Qo={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},et=n=>n==="left"||n==="right";function Zo(n={}){let{color:o="neutral",open:t=!1,placement:e="right",size:r}=n,i=(0,vt.toState)(t),s=et(e)?(0,Y.themeSpacing)(80):(0,Y.themeSpacing)(64),a=r!=null?r:s;return{_onInsert:l=>{l.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(l,c)=>{l.target===c.domElement&&i.set(!1)},onTransitionEnd:(l,c)=>{let m=c.domElement;i.get()||(m.close(),document.body.style.overflow="")},_onMount:l=>{let c=l.domElement,m=d=>{d?(c.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{c.style.transform="translate(0, 0)"})):c.style.transform=Ct[e]};m(i.get()),i.onChange(m)},style:{transform:Ct[e],transition:"transform 0.25s ease",fontSize:l=>(0,Y.themeSize)(l,"inherit"),color:l=>(0,Y.themeColor)(l,"shift-10",o),backgroundColor:l=>(0,Y.themeColor)(l,"inherit",o),border:"none",padding:l=>(0,Y.themeSpacing)((0,Y.themeDensity)(l)*3),margin:Qo[e],width:et(e)?a:"100dvw",height:et(e)?"100dvh":a,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:l=>`0 ${(0,Y.themeSpacing)(4)} ${(0,Y.themeSpacing)(12)} ${(0,Y.themeColor)(l,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:l=>(0,Y.themeColor)(l,"shift-2","neutral"),opacity:.75}}}}var Le=require("@domphy/core");function er(n){let{open:o=!1,placement:t="bottom",openOn:e="click"}=n,r=null,i=(0,Le.toState)(o),{show:s,hide:a,anchorPartial:l}=Ce({open:i,placement:t,content:n.content,onPlacement:n.onPlacement}),c={role:"dialog",dataTone:"shift-17",onMouseEnter:()=>e==="hover"&&s(),onMouseLeave:()=>e==="hover"&&a(),_onInsert:d=>{let u=d.attributes.get("id");r=u||d.nodeId,!u&&d.attributes.set("id",r)}};return(0,Le.merge)(n.content,c),(0,Le.merge)(l,{ariaHaspopup:"dialog",ariaExpanded:d=>i.get(d),onMouseEnter:()=>e==="hover"&&s(),onMouseLeave:()=>e==="hover"&&a(),onClick:()=>e==="click"&&(i.get()?a():s()),onFocus:()=>s(),onBlur:()=>a(),_onMount:d=>r&&d.attributes.set("ariaControls",r)}),l}var xt=require("@domphy/core"),H=require("@domphy/theme");function tr(n={}){let{position:o="top-center",color:t="neutral"}=n,e=(0,xt.toState)(!1),r=o.startsWith("top"),i=o.endsWith("center"),s=o.endsWith("right"),a={div:[],id:`domphy-toast-${o}`,style:{position:"fixed",display:"flex",flexDirection:r?"column":"column-reverse",alignItems:i?"center":s?"end":"start",inset:0,gap:(0,H.themeSpacing)(4),zIndex:30,padding:(0,H.themeSpacing)(6),pointerEvents:"none"}};return{_portal:l=>{let c=l.domElement.querySelector(`#domphy-toast-${o}`);return c||(c=l.children.insert(a).domElement),c},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:(0,H.themeSpacing)(32),pointerEvents:"auto",paddingBlock:l=>(0,H.themeSpacing)((0,H.themeDensity)(l)*2),paddingInline:l=>(0,H.themeSpacing)((0,H.themeDensity)(l)*4),borderRadius:l=>(0,H.themeSpacing)((0,H.themeDensity)(l)*2),fontSize:l=>(0,H.themeSize)(l,"inherit"),color:l=>(0,H.themeColor)(l,"shift-9",t),backgroundColor:l=>(0,H.themeColor)(l,"inherit",t),boxShadow:l=>`0 ${(0,H.themeSpacing)(2)} ${(0,H.themeSpacing)(9)} ${(0,H.themeColor)(l,"shift-4","neutral")}`,opacity:l=>Number(e.get(l)),transform:l=>e.get(l)?"translateY(0)":r?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>e.set(!0)),_onBeforeRemove:(l,c)=>{let m=d=>{d.propertyName==="transform"&&(l.domElement.removeEventListener("transitionend",m),c())};l.domElement.addEventListener("transitionend",m),e.set(!1)}}}var Ge=require("@domphy/core"),Q=require("@domphy/theme");function or(n={}){let{open:o=!1,placement:t="top",content:e="Tooltip Content"}=n,r=null,i=(0,Ge.toState)(t),s=typeof e=="string"?{span:e}:e,{show:a,hide:l,anchorPartial:c}=Ce({open:o,placement:t,content:s}),m={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",_onInsert:u=>{let b=u.attributes.get("id");r=b||u.nodeId,!b&&u.attributes.set("id",r)},style:{paddingBlock:u=>(0,Q.themeSpacing)((0,Q.themeDensity)(u)*1),paddingInline:u=>(0,Q.themeSpacing)((0,Q.themeDensity)(u)*3),borderRadius:u=>(0,Q.themeSpacing)((0,Q.themeDensity)(u)*1),color:u=>(0,Q.themeColor)(u,"shift-9"),backgroundColor:u=>(0,Q.themeColor)(u),fontSize:u=>(0,Q.themeSize)(u,"inherit")},$:[Ze({placement:t,bordered:!1})]};return s.$||(s.$=[]),s.$.push(m),(0,Ge.merge)(c,{onMouseEnter:()=>a(),onMouseLeave:()=>l(),onFocus:()=>a(),onBlur:()=>l(),onKeyDown:u=>u.key==="Escape"&&l(),_onMount:u=>r&&u.attributes.set("ariaDescribedby",r)}),c}var tt=require("@domphy/core");function St(n,o){return n.key!==void 0&&n.key!==null?String(n.key):`index-${o}`}function rr(n={}){let{duration:o=300,delay:t=0}=n,e=new Map;return{_onBeforeUpdate:r=>{e=new Map,r.children.items.forEach((i,s)=>{if(!(i instanceof tt.ElementNode))return;let a=i.domElement;a&&e.set(St(i,s),a.getBoundingClientRect())})},_onUpdate:r=>{r.children.items.forEach((i,s)=>{if(!(i instanceof tt.ElementNode))return;let a=i.domElement;if(!a)return;let l=St(i,s),c=e.get(l);if(!c)return;let m=a.getBoundingClientRect(),d=c.left-m.left,u=c.top-m.top;if(Math.abs(d)<.5&&Math.abs(u)<.5)return;let b=a.style.transition,p=a.style.transform;a.style.transition="none",a.style.transform=`translate(${d}px, ${u}px)`,a.getBoundingClientRect(),requestAnimationFrame(()=>{a.style.transition=`transform ${o}ms ease ${t}ms`,a.style.transform="translate(0px, 0px)"});let g=()=>{a.style.transition=b,a.style.transform=p,a.removeEventListener("transitionend",h)},h=L=>{L.propertyName==="transform"&&g()};a.addEventListener("transitionend",h),setTimeout(g,o+t+34)}),e.clear()}}}var Et=require("@domphy/core"),kt=require("@domphy/core");function nr(n={}){return{role:"tablist",_onSchedule:(t,e)=>{let r={_context:{tabs:{activeKey:(0,kt.toState)(n.activeKey||0)}}};(0,Et.merge)(e,r)}}}var O=require("@domphy/theme");function ir(n={}){let{accentColor:o="primary",color:t="neutral"}=n;return{role:"tab",_onInsert:r=>{var c;r.tagName!="button"&&console.warn('"tab" patch must use button tag');let i=r.getContext("tabs"),s=(c=r.parent)==null?void 0:c.children.items;s=s.filter(m=>m.type=="ElementNode"&&m.attributes.get("role")=="tab");let a=r.key||s.findIndex(m=>m==r),l={id:"tab"+r.parent.nodeId+a,ariaControls:"tabpanel"+r.parent.nodeId+a,ariaSelected:m=>i.activeKey.get(m)==a,onClick:()=>i.activeKey.set(a),onKeyDown:m=>{var h,L,B,He;let d=m.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(d))return;m.preventDefault();let u=((L=(h=r.parent)==null?void 0:h.children.items)!=null?L:[]).filter(te=>te.type==="ElementNode"&&te.attributes.get("role")==="tab"),b=u.findIndex(te=>te===r),p=b;d==="ArrowRight"?p=(b+1)%u.length:d==="ArrowLeft"?p=(b-1+u.length)%u.length:d==="Home"?p=0:d==="End"&&(p=u.length-1);let g=u[p];i.activeKey.set((B=g.key)!=null?B:p),(He=g.domElement)==null||He.focus()}};r.merge(l)},style:{cursor:"pointer",fontSize:r=>(0,O.themeSize)(r,"inherit"),height:r=>(0,O.themeSpacing)(6+(0,O.themeDensity)(r)*2),paddingInline:r=>(0,O.themeSpacing)((0,O.themeDensity)(r)*4),border:"none",outline:"none",color:r=>(0,O.themeColor)(r,"shift-9"),backgroundColor:r=>(0,O.themeColor)(r,"inherit"),boxShadow:r=>`inset 0 -${(0,O.themeSpacing)(.5)} 0 0 ${(0,O.themeColor)(r,"shift-1",t)}`,"&:hover:not([disabled])":{boxShadow:r=>`inset 0 -${(0,O.themeSpacing)(.5)} 0 0 ${(0,O.themeColor)(r,"shift-2",t)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:r=>`inset 0 -${(0,O.themeSpacing)(.5)} 0 0 ${(0,O.themeColor)(r,"shift-6",o)}`},"&:focus-visible":{boxShadow:r=>`inset 0 -${(0,O.themeSpacing)(.5)} 0 0 ${(0,O.themeColor)(r,"shift-6",o)}`}}}}var ze=require("@domphy/theme");function lr(){return{role:"tabpanel",style:{paddingBlock:o=>(0,ze.themeSpacing)((0,ze.themeDensity)(o)*2),paddingInline:o=>(0,ze.themeSpacing)((0,ze.themeDensity)(o)*2)},_onInsert:o=>{var s;let t=o.getContext("tabs"),e=(s=o.parent)==null?void 0:s.children.items;e=e.filter(a=>a.type=="ElementNode"&&a.attributes.get("role")=="tabpanel");let r=o.key||e.findIndex(a=>a==o),i={id:"tabpanel"+o.parent.nodeId+r,ariaLabelledby:"tab"+o.parent.nodeId+r,hidden:a=>t.activeKey.get(a)!=r};o.merge(i)}}}var Tt=require("@domphy/core"),Pt=require("@domphy/core"),ue=require("@domphy/theme");function ar(n={}){let{color:o="neutral"}=n;return{role:"menu",dataTone:"shift-17",_onSchedule:(e,r)=>{let i={_context:{menu:{activeKey:(0,Pt.toState)(n.activeKey||0)}}};(0,Tt.merge)(r,i)},style:{display:"flex",flexDirection:"column",paddingBlock:e=>(0,ue.themeSpacing)((0,ue.themeDensity)(e)*2),paddingInline:e=>(0,ue.themeSpacing)((0,ue.themeDensity)(e)*2),fontSize:e=>(0,ue.themeSize)(e,"inherit"),backgroundColor:e=>(0,ue.themeColor)(e,"inherit",o)}}}var K=require("@domphy/theme");function sr(n={}){let{accentColor:o="primary",color:t="neutral"}=n;return{role:"menuitem",_onInsert:r=>{var l;r.tagName!="button"&&console.warn('"menuItem" patch must use button tag');let i=r.getContext("menu"),s=(l=r.parent)==null?void 0:l.children.items;s=s.filter(c=>c.type=="ElementNode"&&c.attributes.get("role")=="menuitem");let a=r.key||s.findIndex(c=>c==r);r.attributes.set("ariaCurrent",c=>i.activeKey.get(c)==a||void 0),r.addEvent("click",()=>i.activeKey.set(a))},onKeyDown:(r,i)=>{var m,d,u;let s=r.key;if(!["ArrowDown","ArrowUp","Home","End"].includes(s))return;r.preventDefault();let a=((d=(m=i.parent)==null?void 0:m.children.items)!=null?d:[]).filter(b=>b.type==="ElementNode"&&b.attributes.get("role")==="menuitem"),l=a.findIndex(b=>b===i),c=l;s==="ArrowDown"?c=(l+1)%a.length:s==="ArrowUp"?c=(l-1+a.length)%a.length:s==="Home"?c=0:s==="End"&&(c=a.length-1),(u=a[c].domElement)==null||u.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:r=>(0,K.themeSize)(r,"inherit"),height:r=>(0,K.themeSpacing)(6+(0,K.themeDensity)(r)*2),paddingInline:r=>(0,K.themeSpacing)((0,K.themeDensity)(r)*3),border:"none",outline:"none",color:r=>(0,K.themeColor)(r,"shift-9"),backgroundColor:r=>(0,K.themeColor)(r,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:r=>(0,K.themeColor)(r,"shift-2")},"&[aria-current=true]":{backgroundColor:r=>(0,K.themeColor)(r,"shift-3",o),color:r=>(0,K.themeColor)(r,"shift-10")},"&:focus-visible":{outline:r=>`${(0,K.themeSpacing)(.5)} solid ${(0,K.themeColor)(r,"shift-6",o)}`,outlineOffset:`-${(0,K.themeSpacing)(.5)}`}}}}var wt=require("@domphy/core");function mr(n){return{_onSchedule:(o,t)=>{(0,wt.merge)(t,{_context:{form:n}})}}}function cr(n,o){return{_onInsert:t=>{let r=t.getContext("form").setField(n,void 0,o),i=t.tagName,s=t.attributes.get("type");["input","select","textarea"].includes(i)||console.warn('"field" patch must use input, select, or textarea tag');let a={onBlur:()=>r.setTouched(),ariaInvalid:l=>!!r.message("error",l)||void 0,dataStatus:l=>r.status(l)};i==="input"&&s==="checkbox"?(a.checked=r.value(),a.onChange=l=>r.setValue(l.target.checked)):i==="input"&&s==="radio"?a.onChange=l=>r.setValue(l.target.value):i==="select"?(a.value=r.value(),a.onChange=l=>r.setValue(l.target.value)):i==="textarea"?(a.value=r.value(),a.onInput=l=>r.setValue(l.target.value)):(a.value=r.value(),a.onInput=l=>r.setValue(l.target.value)),t.merge(a)}}}var It=require("@domphy/core");function dr(n){return!!n&&typeof n.then=="function"}var De=class{constructor(o,t){this._notifier=new It.Notifier;this._messages={};this._touched=!1;this._pending=!1;this._validationToken=0;this._value=o,this._initValue=o,this._validator=t,t&&this.validate()}value(o){return o&&this._notifier.addListener("value",o),this._value}setValue(o){this._value=o,this._notifier.notify("value",o),this._notifier.notify("dirty",o!==this._initValue),this.validate()}dirty(o){return o&&this._notifier.addListener("dirty",o),this._value!==this._initValue}touched(o){return o&&this._notifier.addListener("touched",o),this._touched}setTouched(){this._touched||(this._touched=!0,this._notifier.notify("touched",!0))}configure(o,t){let e=!1;o!==void 0&&this._value===void 0&&this._initValue===void 0&&(this._value=o,this._initValue=o,this._notifier.notify("value",o),this._notifier.notify("dirty",!1),e=!0),t!==void 0&&t!==this._validator&&(this._validator=t,e=!0),e&&this.validate()}message(o,t){return t&&this._notifier.addListener(o,t),this._messages[o]}status(o){return o&&this._notifier.addListener("status",o),Ue(this._messages)}setMessages(o){let t=this._messages;this._messages=o;for(let e of["error","warning","success"])t[e]!==o[e]&&this._notifier.notify(e,o[e]);Ue(t)!==Ue(o)&&this._notifier.notify("status",Ue(o))}reset(){this._value=this._initValue,this._touched=!1,this._notifier.notify("value",this._value),this._notifier.notify("dirty",!1),this._notifier.notify("touched",!1),this.setMessages({}),this.validate()}validate(){let o=++this._validationToken;if(!this._validator){this._pending=!1,this.setMessages({});return}try{let t=this._validator(this._value);dr(t)?(this._pending=!0,Promise.resolve(t).then(e=>{o===this._validationToken&&(this._pending=!1,this.setMessages(e!=null?e:{}))}).catch(e=>{o===this._validationToken&&(this._pending=!1,console.error(e))})):(this._pending=!1,this.setMessages(t!=null?t:{}))}catch(t){o===this._validationToken&&(this._pending=!1),console.error(t)}}_dispose(){this._validationToken+=1,this._pending=!1,this._notifier._dispose()}};function Ue(n){if(n.error)return"error";if(n.warning)return"warning";if(n.success)return"success"}var ot=class{constructor(){this.fields=new Map}setField(o,t,e){let r=this.fields.get(o);return r?r.configure(t,e):(r=new De(t,e),this.fields.set(o,r)),r}getField(o){return this.setField(o)}removeField(o){var t;(t=this.fields.get(o))==null||t._dispose(),this.fields.delete(o)}get valid(){for(let o of this.fields.values())if(o._pending||o._messages.error)return!1;return!0}reset(){for(let o of this.fields.values())o.reset()}snapshot(){let o={};for(let[t,e]of this.fields)ur(o,t,e._value);return o}_dispose(){for(let o of this.fields.values())o._dispose();this.fields.clear()}};function ur(n,o,t){let e=o.split("."),r=n;for(let i=0;i<e.length-1;i++){let s=e[i];r[s]==null&&(r[s]=isNaN(Number(e[i+1]))?{}:[]),r=r[s]}r[e[e.length-1]]=t}0&&(module.exports={FieldState,FormState,abbreviation,alert,avatar,badge,blockquote,breadcrumb,breadcrumbEllipsis,button,buttonSwitch,card,code,combobox,command,commandItem,commandSearch,descriptionList,details,dialog,divider,drawer,emphasis,field,figure,form,formGroup,heading,horizontalRule,icon,image,inputCheckbox,inputColor,inputDateTime,inputFile,inputNumber,inputOTP,inputRadio,inputRange,inputSearch,inputSwitch,inputText,keyboard,label,link,mark,menu,menuItem,orderedList,pagination,paragraph,popover,popoverArrow,preformated,progress,select,selectBox,selectItem,selectList,skeleton,small,spinner,splitter,splitterHandle,splitterPanel,strong,subscript,superscript,tab,tabPanel,table,tabs,tag,textarea,toast,toggle,toggleGroup,tooltip,transitionGroup,unorderedList});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|