@gryt/ui 0.24.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,13 +1,13 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),X=require("@base-ui/react/tooltip"),i=require("react"),c=require("@gryt/theme"),st=require("@base-ui/react/button"),$t=require("clsx"),Dt=require("tailwind-merge"),fe=require("@base-ui/react/field"),k=require("@phosphor-icons/react"),Re=require("@base-ui/react/avatar"),Ge=require("@gryt/owl"),Ve=require("@base-ui/react/checkbox"),Ue=require("@base-ui/react/radio"),It=require("@base-ui/react/radio-group"),Xe=require("@base-ui/react/switch"),se=require("@base-ui/react/slider"),$=require("@base-ui/react/select"),Ot=require("@base-ui/react/separator"),ke=require("@base-ui/react/progress"),z=require("@base-ui/react/dialog"),I=require("@base-ui/react/drawer"),W=require("@base-ui/react/menu"),me=require("@base-ui/react/tabs"),ue=require("@base-ui/react/accordion"),E=require("@base-ui/react/context-menu"),G=require("@base-ui/react/popover"),F=require("@base-ui/react/toast"),ne=require("@base-ui/react/scroll-area"),Lt=require("@base-ui/react/toggle"),Gt=require("@base-ui/react/toggle-group"),ie=require("@base-ui/react/meter"),B=require("@base-ui/react/alert-dialog"),R=require("@base-ui/react/autocomplete"),T=require("@base-ui/react/combobox"),Ft=require("@base-ui/react/checkbox-group"),ze=require("@base-ui/react/collapsible"),Ht=require("@base-ui/react/form"),it=require("@base-ui/react/fieldset"),_t=require("@base-ui/react/menubar"),D=require("@base-ui/react/navigation-menu"),V=require("@base-ui/react/number-field"),We=require("@base-ui/react/otp-field"),re=require("@base-ui/react/preview-card"),oe=require("@base-ui/react/toolbar"),lt=i.createContext(void 0);function ct(){return i.useContext(lt)}function Et(n){return Object.keys(n).some(t=>t.startsWith("--"))}function zt({children:n,className:t,theme:e,tooltipDelay:o=400,containOverlays:a=!1}){const d=i.useRef(null),u=e===void 0?void 0:Et(e)?e:c.createGrytTheme(e);return r.jsx("div",{className:t,style:u,ref:d,children:r.jsx(lt.Provider,{value:a?d:void 0,children:r.jsx(X.Tooltip.Provider,{delay:o,children:n})})})}function s(...n){return Dt.twMerge($t.clsx(n))}const Bt={primary:"bg-gryt-accent text-gryt-on-accent hover:not-data-disabled:bg-gryt-accent-light data-disabled:bg-gryt-surface-raised data-disabled:text-gryt-muted",secondary:"bg-gryt-secondary text-gryt-on-secondary hover:not-data-disabled:bg-gryt-secondary-light data-disabled:bg-gryt-surface-raised data-disabled:text-gryt-muted",neutral:"bg-gryt-surface-raised text-gryt-text hover:not-data-disabled:bg-gryt-surface-hover data-disabled:text-gryt-muted",danger:"bg-gryt-danger text-gryt-on-danger hover:not-data-disabled:bg-gryt-danger-light data-disabled:bg-gryt-surface-raised data-disabled:text-gryt-muted",ghost:"bg-transparent text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text"},qt={xsmall:"min-h-8 px-3 text-xs",small:"min-h-9 px-4 text-sm",medium:"min-h-10 px-5 text-sm",large:"min-h-12 px-6 text-base"},ge=i.forwardRef(function({children:t,className:e,endIcon:o,size:a="medium",startIcon:d,tone:u="primary",...p},m){return r.jsxs(st.Button,{ref:m,className:s("gryt-button","inline-flex cursor-pointer items-center justify-center gap-2 border-0 shadow-none","rounded-(--gryt-radius-full) font-semibold whitespace-nowrap select-none","transition-[scale,background-color,color]","duration-(--gryt-dur-spring) ease-spring","motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.03]","motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.96]","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light","data-disabled:cursor-not-allowed data-disabled:opacity-60",qt[a],Bt[u],e),...p,children:[d,t,o]})}),A="focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",Yt="has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-gryt-accent-light",dt=["w-full rounded-(--gryt-radius-xl) border bg-gryt-surface-raised","text-gryt-text outline-none placeholder:text-gryt-muted","transition-colors duration-150 motion-reduce:transition-none","hover:border-gryt-accent-light focus:border-gryt-accent","disabled:cursor-not-allowed disabled:opacity-60"].join(" "),ut={small:"min-h-9 px-3 py-1.5 text-sm",medium:"min-h-11 px-4 py-2.5 text-sm"},J="rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text",q=["transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0"].join(" "),ae="cursor-pointer data-disabled:cursor-not-allowed data-disabled:opacity-50",Vt={primary:"data-checked:bg-gryt-accent data-checked:text-gryt-on-accent",secondary:"data-checked:bg-gryt-secondary data-checked:text-gryt-on-secondary",neutral:"data-checked:bg-gryt-surface-hover data-checked:text-gryt-text",danger:"data-checked:bg-gryt-danger data-checked:text-gryt-on-danger",success:"data-checked:bg-gryt-success data-checked:text-gryt-on-accent",warning:"data-checked:bg-gryt-warning data-checked:text-gryt-on-accent"},gt={primary:"bg-gryt-accent",secondary:"bg-gryt-secondary",neutral:"bg-gryt-surface-hover",danger:"bg-gryt-danger",success:"bg-gryt-success",warning:"bg-gryt-warning"},Ut={primary:"data-checked:border-gryt-accent",secondary:"data-checked:border-gryt-secondary",neutral:"data-checked:border-gryt-muted",danger:"data-checked:border-gryt-danger",success:"data-checked:border-gryt-success",warning:"data-checked:border-gryt-warning"},Xt={primary:"data-checked:bg-gryt-accent",secondary:"data-checked:bg-gryt-secondary",neutral:"data-checked:bg-gryt-surface-hover",danger:"data-checked:bg-gryt-danger",success:"data-checked:bg-gryt-success",warning:"data-checked:bg-gryt-warning"},Wt={primary:"text-gryt-accent-11 hover:not-data-disabled:bg-gryt-accent-3",secondary:"text-gryt-secondary-11 hover:not-data-disabled:bg-gryt-secondary-3",neutral:"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text",danger:"text-gryt-danger-11 hover:not-data-disabled:bg-gryt-danger-3",ghost:"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text"},Kt={xsmall:"h-8 w-8",small:"h-9 w-9",medium:"h-10 w-10",large:"h-12 w-12"},Jt=i.forwardRef(function({className:t,size:e="medium",tone:o="neutral",...a},d){return r.jsx(st.Button,{ref:d,className:s("gryt-icon-button","inline-flex shrink-0 items-center justify-center border-0 bg-transparent p-0","rounded-(--gryt-radius-full) select-none","transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring","motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.06]","motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.94]",A,ae,Kt[e],Wt[o],t),...a})}),Qt=i.forwardRef(function({className:t,elevated:e=!1,...o},a){return r.jsx("div",{ref:a,className:s("gryt-surface rounded-(--gryt-radius-lg) border border-gryt-border p-4 text-gryt-text",e?"bg-gryt-surface-raised":"bg-gryt-surface",t),...o})}),Zt=i.forwardRef(function({children:t,className:e,from:o="assistant",...a},d){return r.jsx("div",{ref:d,className:s("gryt-message-bubble",o==="user"&&"ml-auto bg-gryt-accent text-gryt-on-accent",o==="assistant"&&"mr-auto border border-gryt-border bg-gryt-surface text-gryt-text",o==="system"&&"mx-auto border border-dashed border-gryt-border bg-transparent text-gryt-muted",e),...a,children:t})}),we=i.forwardRef(function({className:t,error:e=!1,fieldClassName:o,helperText:a,label:d,minRows:u=3,multiline:p=!1,size:m="medium",...f},x){const y=r.jsx(fe.Field.Control,{ref:x,render:p?r.jsx("textarea",{rows:u}):void 0,className:s("gryt-text-field-control",dt,p&&"resize-y leading-6",e?"border-gryt-danger":"border-gryt-border",ut[m],t),...f});return r.jsxs(fe.Field.Root,{className:s("gryt-text-field flex w-full flex-col gap-1.5",o),children:[d?r.jsx(fe.Field.Label,{className:"text-xs font-medium text-gryt-muted",children:d}):null,y,a?r.jsx(fe.Field.Description,{className:s("text-xs",e?"text-gryt-danger-11":"text-gryt-muted"),children:a}):null]})}),er=i.forwardRef(function({className:t,disabled:e=!1,maxRows:o=8,minRows:a=1,onSubmit:d,placeholder:u="Message Gryt",submitLabel:p="Send",...m},f){const x=i.useRef(null),y=i.useCallback(()=>{const h=x.current;if(!h)return;const w=window.getComputedStyle(h),j=parseFloat(w.lineHeight)||24,P=parseFloat(w.paddingTop)+parseFloat(w.paddingBottom);h.style.height="auto",h.style.height=`${Math.min(Math.max(h.scrollHeight,j*a+P),j*o+P)}px`},[o,a]);i.useLayoutEffect(y,[y,m.value]);function b(h){if(!d){h.preventDefault();return}d(h)}return r.jsxs("form",{className:s("gryt-composer",t),onSubmit:b,children:[r.jsx("textarea",{ref:h=>{x.current=h,typeof f=="function"?f(h):f&&(f.current=h)},rows:a,disabled:e,placeholder:u,onInput:y,className:"gryt-composer-textarea disabled:cursor-not-allowed disabled:opacity-60",...m}),r.jsx(ge,{type:"submit",disabled:e,size:"small",endIcon:r.jsx(k.PaperPlaneTilt,{size:14,weight:"fill"}),children:p})]})}),tr={small:"h-8 w-8 text-xs",medium:"h-10 w-10 text-sm",large:"h-12 w-12 text-base"},Ke=256,mt=i.forwardRef(function({alt:t,children:e,className:o,fallback:a,seed:d,eggSeed:u,size:p="medium",src:m,...f},x){const y=i.useMemo(()=>d?Ge.owlAvatarDataUri(d,{size:Ke}):void 0,[d]),b=i.useMemo(()=>u?Ge.eggAvatarDataUri(u,{size:Ke}):void 0,[u]),h=y??b;return r.jsxs(Re.Avatar.Root,{ref:x,className:s("gryt-avatar inline-flex shrink-0 items-center justify-center overflow-hidden align-middle select-none","rounded-(--gryt-radius-full) bg-gryt-surface-raised font-medium text-gryt-text ring-1 ring-gryt-border",tr[p],o),...f,children:[m?r.jsx(Re.Avatar.Image,{src:m,alt:t,className:"h-full w-full object-cover"}):null,r.jsx(Re.Avatar.Fallback,{className:"flex h-full w-full items-center justify-center",children:h?r.jsx("img",{src:h,alt:t,className:"h-full w-full object-cover"}):a??e})]})}),rr=i.forwardRef(function({active:t=!1,avatar:e,className:o,subtitle:a,title:d,...u},p){return r.jsxs("button",{ref:p,type:"button",className:s("gryt-conversation-item enabled:cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",t?"bg-gryt-accent text-gryt-on-accent":"text-gryt-text hover:bg-white/5",o),...u,children:[e??r.jsx(mt,{size:"small",className:s(t?"bg-gryt-on-accent text-gryt-accent-9 ring-transparent":"bg-gryt-surface-raised text-gryt-text"),children:d.slice(0,1).toUpperCase()}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm font-semibold",children:d}),a?r.jsx("span",{className:s("block truncate text-xs",t?"text-gryt-on-accent/85":"text-gryt-muted"),children:a}):null]})]})}),or=i.forwardRef(function({badgeContent:t,children:e,className:o,max:a=99,showZero:d=!1,...u},p){const m=typeof t=="number"?t:null,f=m!==null&&m===0&&!d,x=m!==null&&m>a?`${a}+`:t;return r.jsxs("span",{ref:p,className:s("gryt-badge relative inline-flex",o),...u,children:[e,t!==void 0&&!f?r.jsx("span",{className:s("gryt-badge-dot absolute -top-1 -right-1 z-10 inline-flex items-center justify-center","min-w-5 rounded-(--gryt-radius-full) px-1.5 py-0.5","bg-gryt-accent text-[0.65rem] leading-none font-semibold text-gryt-on-accent","ring-2 ring-gryt-bg"),children:x}):null]})}),nr={neutral:"border-gryt-border bg-gryt-surface-raised text-gryt-text",primary:"border-gryt-accent-6 bg-gryt-accent-3 text-gryt-accent-11",secondary:"border-gryt-secondary-6 bg-gryt-secondary-3 text-gryt-secondary-11",success:"border-gryt-success-6 bg-gryt-success-3 text-gryt-success-11",warning:"border-gryt-warning-6 bg-gryt-warning-3 text-gryt-warning-11",danger:"border-gryt-danger-6 bg-gryt-danger-3 text-gryt-danger-11"},ar=i.forwardRef(function({children:t,className:e,icon:o,label:a,onDelete:d,tone:u="neutral",...p},m){return r.jsxs("span",{ref:m,className:s("gryt-chip inline-flex items-center gap-1.5 rounded-(--gryt-radius-full) border px-3 py-1 text-xs font-medium",nr[u],e),...p,children:[o,a??t,d?r.jsx("button",{type:"button","aria-label":"Remove",onClick:d,className:s("-mr-1 inline-flex h-4 w-4 cursor-pointer items-center justify-center rounded-(--gryt-radius-full)","opacity-70 transition-opacity hover:opacity-100",A),children:r.jsx(k.X,{size:10,weight:"bold","aria-hidden":"true"})}):null]})}),Fe=i.forwardRef(function({className:t,tone:e="primary",...o},a){return r.jsx(Ve.Checkbox.Root,{ref:a,className:s("gryt-checkbox flex h-5 w-5 shrink-0 items-center justify-center","rounded-(--gryt-radius-sm) border border-gryt-border bg-gryt-surface-raised","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","data-checked:border-transparent","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.08]","motion-safe:active:not-data-disabled:scale-[0.92]",A,ae,Vt[e],t),...o,children:r.jsx(Ve.Checkbox.Indicator,{keepMounted:!0,className:s("flex origin-center","transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring","data-unchecked:scale-0 data-unchecked:opacity-0","motion-reduce:transition-none"),children:r.jsx(k.Check,{size:12,weight:"bold"})})})}),sr=i.forwardRef(function({className:t,tone:e="primary",...o},a){return r.jsx(Ue.Radio.Root,{ref:a,className:s("gryt-radio flex h-5 w-5 shrink-0 items-center justify-center","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.08]","motion-safe:active:not-data-disabled:scale-[0.92]",A,ae,Ut[e],t),...o,children:r.jsx(Ue.Radio.Indicator,{keepMounted:!0,className:s("h-2.5 w-2.5 origin-center rounded-(--gryt-radius-full)","transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring","data-unchecked:scale-0 data-unchecked:opacity-0","motion-reduce:transition-none",gt[e])})})}),ir=i.forwardRef(function({className:t,...e},o){return r.jsx(It.RadioGroup,{ref:o,className:s("gryt-radio-group flex flex-col gap-2",t),...e})}),lr=i.forwardRef(function({className:t,tone:e="primary",...o},a){return r.jsx(Xe.Switch.Root,{ref:a,className:s("gryt-switch relative inline-flex h-6 w-10 shrink-0 items-center","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised p-0.5","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","data-checked:border-transparent","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.05]","motion-safe:active:not-data-disabled:scale-[0.95]",A,ae,Xt[e],t),...o,children:r.jsx(Xe.Switch.Thumb,{className:s("h-4.5 w-4.5 rounded-(--gryt-radius-full) bg-gryt-text","transition-transform duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-checked:translate-x-4 data-checked:bg-gryt-bg")})})}),Je=3;function Be({className:n,tone:t="primary","aria-label":e,...o}){const[a,d]=i.useState(!1),u=i.useRef(null);i.useEffect(()=>{if(!a&&u.current===null)return;const x=()=>{u.current=null,d(!1)};return window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x),()=>{window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x)}},[a]);function p(x){u.current={x:x.clientX,y:x.clientY}}function m(x){const y=u.current;if(y===null||a)return;(Math.abs(x.clientX-y.x)>Je||Math.abs(x.clientY-y.y)>Je)&&d(!0)}const f=a?"transition-none":"duration-(--gryt-dur-spring) ease-spring-tight motion-reduce:transition-none";return r.jsx(se.Slider.Root,{className:s("gryt-slider w-full",n),...o,children:r.jsx(se.Slider.Control,{className:"flex w-full cursor-pointer touch-none items-center py-2 select-none",onPointerDown:p,onPointerMove:m,children:r.jsxs(se.Slider.Track,{className:"h-1.5 w-full rounded-(--gryt-radius-full) bg-gryt-surface-raised select-none",children:[r.jsx(se.Slider.Indicator,{className:s("h-full rounded-(--gryt-radius-full) select-none","transition-[width]",f,gt[t])}),r.jsx(se.Slider.Thumb,{"aria-label":e,className:s("group h-4 w-4 rounded-(--gryt-radius-full) select-none","transition-[inset-inline-start]",f,Yt),children:r.jsx("span",{className:s("block h-full w-full rounded-(--gryt-radius-full) bg-gryt-text","transition-[scale] duration-(--gryt-dur-spring) ease-spring","motion-safe:group-hover:scale-[1.12] motion-safe:group-active:scale-[0.94]","motion-reduce:transition-none")})})]})})})}const cr={small:"min-h-9 px-3 text-sm",medium:"min-h-11 px-4 text-sm"};function ve({className:n,label:t,options:e=[],placeholder:o="Select",size:a="medium",...d}){const u=ct();return r.jsxs($.Select.Root,{items:e,...d,children:[r.jsxs("div",{className:s("gryt-select flex w-full flex-col gap-1.5",n),children:[t?r.jsx($.Select.Label,{className:"text-xs font-medium text-gryt-muted",children:t}):null,r.jsxs($.Select.Trigger,{className:s("flex w-full cursor-pointer items-center justify-between gap-2","rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface-raised","text-gryt-text select-none","transition-colors duration-150 hover:border-gryt-accent-light","data-disabled:cursor-not-allowed data-disabled:opacity-60",A,cr[a]),children:[r.jsx($.Select.Value,{placeholder:o}),r.jsx($.Select.Icon,{className:"shrink-0 text-gryt-muted",children:r.jsx(k.CaretUpDown,{size:16})})]})]}),r.jsx($.Select.Portal,{container:u,children:r.jsx($.Select.Positioner,{sideOffset:6,className:"gryt-select-positioner outline-none",children:r.jsx($.Select.Popup,{className:s("min-w-(--anchor-width) p-1",J,q),children:r.jsx($.Select.List,{children:e.map(p=>r.jsxs($.Select.Item,{value:p.value,disabled:p.disabled,className:s("flex cursor-pointer items-center justify-between gap-2","rounded-(--gryt-radius-md) px-3 py-2 text-sm text-gryt-text","outline-none select-none data-highlighted:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50"),children:[r.jsx($.Select.ItemText,{children:p.label}),r.jsx($.Select.ItemIndicator,{className:"text-gryt-accent-11",children:r.jsx(k.Check,{size:14,weight:"bold"})})]},String(p.value)))})})})})]})}function dr({children:n,className:t,side:e="top",sideOffset:o=8,title:a}){const d=ct();return r.jsxs(X.Tooltip.Root,{children:[r.jsx(X.Tooltip.Trigger,{render:n}),r.jsx(X.Tooltip.Portal,{container:d,children:r.jsx(X.Tooltip.Positioner,{side:e,sideOffset:o,className:"gryt-tooltip-positioner",children:r.jsx(X.Tooltip.Popup,{className:s("gryt-tooltip rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface-raised","px-2.5 py-1.5 text-xs text-gryt-text",q,t),children:a})})})]})}const ur=X.Tooltip.Provider,gr=i.forwardRef(function({className:t,orientation:e="horizontal",...o},a){return r.jsx(Ot.Separator,{ref:a,orientation:e,className:s("gryt-divider bg-gryt-border",e==="vertical"?"h-full w-px":"h-px w-full",t),...o})}),mr=i.forwardRef(function({className:t,...e},o){return r.jsx("div",{ref:o,className:s("gryt-card rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text",t),...e})});function pr({children:n,className:t,subheader:e,title:o,...a}){return r.jsxs("div",{className:s("gryt-card-header flex flex-col gap-1 p-4",t),...a,children:[o?r.jsx("span",{className:"text-base font-semibold text-gryt-text",children:o}):null,e?r.jsx("span",{className:"text-sm text-gryt-muted",children:e}):null,n]})}function fr({className:n,...t}){return r.jsx("div",{className:s("gryt-card-content px-4 pb-4 text-sm text-gryt-muted",n),...t})}function xr({className:n,...t}){return r.jsx("div",{className:s("gryt-card-actions flex items-center gap-2 px-4 pb-4",n),...t})}const yr={info:"border-gryt-secondary-6 bg-gryt-secondary-3 text-gryt-secondary-11",success:"border-gryt-success-6 bg-gryt-success-3 text-gryt-success-11",warning:"border-gryt-warning-6 bg-gryt-warning-3 text-gryt-warning-11",error:"border-gryt-danger-6 bg-gryt-danger-3 text-gryt-danger-11"},br=i.forwardRef(function({className:t,severity:e="info",...o},a){return r.jsx("div",{ref:a,role:"alert",className:s("gryt-alert rounded-(--gryt-radius-lg) border px-4 py-3 text-sm",yr[e],t),...o})});function hr({className:n,value:t=null,...e}){return r.jsx(ke.Progress.Root,{value:t,className:s("gryt-progress w-full",n),...e,children:r.jsx(ke.Progress.Track,{className:"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised",children:r.jsx(ke.Progress.Indicator,{className:s("h-full rounded-(--gryt-radius-full) bg-gryt-accent","transition-[width] duration-300 ease-out motion-reduce:transition-none",t===null&&"gryt-progress-indeterminate")})})})}function wr({className:n,size:t=24,"aria-label":e="Loading"}){return r.jsx(k.CircleNotch,{role:"status","aria-label":e,size:t,weight:"bold",className:s("gryt-spinner text-gryt-accent-11 motion-safe:animate-spin",n)})}const vr={text:"h-4 rounded-(--gryt-radius-sm)",rounded:"rounded-(--gryt-radius-lg)",circular:"rounded-(--gryt-radius-full)",rectangular:"rounded-none"};function jr({className:n,height:t,style:e,variant:o="text",width:a,...d}){const u={width:a,height:t,...e};return r.jsx("div",{"aria-hidden":"true",className:s("gryt-skeleton bg-white/9 motion-safe:animate-pulse",vr[o],n),style:u,...d})}const pt="transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none",Nr=i.forwardRef(function({className:t,...e},o){return r.jsx(z.Dialog.Backdrop,{ref:o,className:s("gryt-dialog-backdrop fixed inset-0 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)",pt,"data-starting-style:opacity-0 data-ending-style:opacity-0",t),...e})}),Tr=i.forwardRef(function({className:t,...e},o){return r.jsx(z.Dialog.Popup,{ref:o,className:s("gryt-dialog fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2","flex w-[32rem] max-w-[calc(100vw-3rem)] flex-col gap-4","rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text",pt,"data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0",t),...e})}),Sr=i.forwardRef(function({className:t,...e},o){return r.jsx(z.Dialog.Title,{ref:o,className:s("gryt-dialog-title text-base font-semibold text-gryt-text",t),...e})}),Pr=i.forwardRef(function({className:t,...e},o){return r.jsx(z.Dialog.Description,{ref:o,className:s("gryt-dialog-description text-sm text-gryt-muted",t),...e})}),Cr=i.forwardRef(function({className:t,...e},o){return r.jsx("div",{ref:o,className:s("gryt-dialog-footer flex justify-end gap-3",t),...e})}),Rr={Root:z.Dialog.Root,Trigger:z.Dialog.Trigger,Portal:z.Dialog.Portal,Close:z.Dialog.Close,Backdrop:Nr,Popup:Tr,Title:Sr,Description:Pr,Footer:Cr},kr=()=>()=>{};function ft(n){const t=i.useCallback(o=>{if(typeof window>"u"||!window.matchMedia)return kr();const a=window.matchMedia(n);return a.addEventListener("change",o),()=>a.removeEventListener("change",o)},[n]),e=i.useCallback(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(n).matches,[n]);return i.useSyncExternalStore(t,e,()=>!1)}const Ar={left:"left",right:"right",top:"up",bottom:"down"},je=i.createContext("right"),Mr={left:"items-stretch justify-start",right:"items-stretch justify-end",top:"items-start justify-center",bottom:"items-end justify-center"},$r={left:"rounded-r-(--gryt-radius-xl)",right:"rounded-l-(--gryt-radius-xl)",top:"rounded-b-(--gryt-radius-xl)",bottom:"rounded-t-(--gryt-radius-xl)"},Dr={left:["h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]","-ml-(--gryt-drawer-bleed) border-r py-5 pr-5 pl-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateX(var(--drawer-swipe-movement-x))]","data-starting-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]"].join(" "),right:["h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]","-mr-(--gryt-drawer-bleed) border-l py-5 pl-5 pr-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateX(var(--drawer-swipe-movement-x))]","data-starting-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]"].join(" "),top:["w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]","-mt-(--gryt-drawer-bleed) border-b px-5 pb-5 pt-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateY(var(--drawer-swipe-movement-y))]","data-starting-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]"].join(" "),bottom:["w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]","-mb-(--gryt-drawer-bleed) border-t px-5 pt-5 pb-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateY(var(--drawer-swipe-movement-y))]","data-starting-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]"].join(" ")};function Ir({side:n="right",sheetOnMobile:t=!0,children:e,...o}){const a=ft("(max-width: 767px)"),d=t&&a?"bottom":n;return r.jsx(je.Provider,{value:d,children:r.jsx(I.Drawer.Root,{swipeDirection:Ar[d],...o,children:e})})}const Or=i.forwardRef(function({className:t,...e},o){const a=i.useContext(je);return r.jsx(I.Drawer.Viewport,{ref:o,className:s("gryt-drawer-viewport fixed inset-0 z-50 flex",Mr[a],t),...e})}),Lr=i.forwardRef(function({className:t,...e},o){const a=i.useContext(je);return r.jsx(I.Drawer.Popup,{ref:o,className:s("gryt-drawer flex flex-col gap-4 border-gryt-border bg-gryt-surface text-gryt-text","overflow-y-auto overscroll-contain outline-none","transition-transform duration-(--gryt-dur-spring-soft) ease-spring-tight","data-swiping:duration-0 data-swiping:select-none","motion-reduce:transition-none",Dr[a],$r[a],t),...e})}),Gr=i.forwardRef(function({className:t,...e},o){return r.jsx(I.Drawer.Backdrop,{ref:o,className:s("gryt-drawer-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)","[opacity:calc(1-var(--drawer-swipe-progress,0))]","transition-opacity duration-(--gryt-dur-spring-soft) ease-spring-tight","data-swiping:duration-0","data-starting-style:opacity-0 data-ending-style:opacity-0","motion-reduce:transition-none",t),...e})});function Fr({className:n}){const t=i.useContext(je);return t!=="bottom"&&t!=="top"?null:r.jsx("div",{"aria-hidden":!0,className:s("gryt-drawer-grabber mx-auto h-1.5 w-10 shrink-0 rounded-(--gryt-radius-full) bg-gryt-border",t==="top"&&"order-last",n)})}const Hr={Root:Ir,Trigger:I.Drawer.Trigger,Portal:I.Drawer.Portal,Backdrop:Gr,Viewport:Or,Popup:Lr,Content:I.Drawer.Content,Grabber:Fr,Close:I.Drawer.Close,Title:I.Drawer.Title,Description:I.Drawer.Description},_r=i.forwardRef(function({className:t,sideOffset:e=8,...o},a){return r.jsx(W.Menu.Positioner,{ref:a,sideOffset:e,className:s("gryt-menu-positioner outline-none",t),...o})}),Er=i.forwardRef(function({className:t,...e},o){return r.jsx(W.Menu.Popup,{ref:o,className:s("gryt-menu min-w-44 p-1 outline-none",J,q,t),...e})}),zr=i.forwardRef(function({className:t,...e},o){return r.jsx(W.Menu.Item,{ref:o,className:s("gryt-menu-item flex cursor-pointer items-center gap-2 rounded-(--gryt-radius-md)","px-3 py-2 text-sm text-gryt-text outline-none select-none","data-highlighted:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50",t),...e})}),Br=i.forwardRef(function({className:t,...e},o){return r.jsx(W.Menu.Separator,{ref:o,className:s("gryt-menu-separator my-1 h-px bg-gryt-border",t),...e})}),be={Root:W.Menu.Root,Trigger:W.Menu.Trigger,Portal:W.Menu.Portal,Positioner:_r,Popup:Er,Item:zr,Separator:Br},qr=i.forwardRef(function({className:t,...e},o){return r.jsx(me.Tabs.Root,{ref:o,className:s("gryt-tabs","data-[orientation=vertical]:flex data-[orientation=vertical]:items-stretch",t),...e})}),Yr=i.forwardRef(function({className:t,...e},o){return r.jsx(me.Tabs.List,{ref:o,className:s("gryt-tabs-list relative inline-flex items-center gap-1 rounded-(--gryt-radius-full) bg-gryt-surface-raised p-1","data-[orientation=vertical]:flex data-[orientation=vertical]:shrink-0","data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch","data-[orientation=vertical]:rounded-(--gryt-radius-lg)",t),...e})}),xt=i.forwardRef(function({className:t,...e},o){return r.jsx(me.Tabs.Tab,{ref:o,className:s("gryt-tab inline-flex min-h-8 cursor-pointer items-center justify-center whitespace-nowrap","rounded-(--gryt-radius-full) border-0 bg-transparent px-4 py-1.5","text-sm font-medium text-gryt-muted select-none","relative z-10 hover:text-gryt-text","transition-[scale,color,background-color] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:scale-[1.03] motion-safe:active:scale-[0.96]","motion-reduce:transition-colors motion-reduce:duration-150","data-active:text-gryt-on-accent","data-[orientation=vertical]:min-h-9 data-[orientation=vertical]:justify-start","data-[orientation=vertical]:gap-2.5 data-[orientation=vertical]:px-3","data-[orientation=vertical]:rounded-(--gryt-radius-md)","data-disabled:cursor-not-allowed data-disabled:opacity-50",A,t),...e})}),Vr=i.forwardRef(function({className:t,...e},o){return r.jsx(me.Tabs.Indicator,{ref:o,renderBeforeHydration:!0,className:s("gryt-tabs-indicator absolute top-1 left-0 z-0 h-[calc(100%-0.5rem)]","w-(--active-tab-width) translate-x-(--active-tab-left)","rounded-(--gryt-radius-full) bg-gryt-accent","transition-[translate,width] duration-(--gryt-dur-spring) ease-spring","motion-reduce:transition-none","[[data-orientation=vertical]_&]:top-0 [[data-orientation=vertical]_&]:left-1","[[data-orientation=vertical]_&]:h-(--active-tab-height)","[[data-orientation=vertical]_&]:w-[calc(100%-0.5rem)]","[[data-orientation=vertical]_&]:translate-x-0","[[data-orientation=vertical]_&]:translate-y-(--active-tab-top)","[[data-orientation=vertical]_&]:rounded-(--gryt-radius-md)","[[data-orientation=vertical]_&]:transition-[translate,height]",t),...e})}),Ur=i.forwardRef(function({className:t,...e},o){return r.jsx(me.Tabs.Panel,{ref:o,className:s("gryt-tabs-panel pt-3 text-sm text-gryt-text","data-[orientation=vertical]:min-w-0 data-[orientation=vertical]:flex-1","data-[orientation=vertical]:pt-0 data-[orientation=vertical]:pl-4",t),...e})}),Xr=Object.assign(qr,{List:Yr,Tab:xt,Panel:Ur,Indicator:Vr}),Wr=i.forwardRef(function({className:t,...e},o){return r.jsx(ue.Accordion.Root,{ref:o,className:s("gryt-accordion flex w-full flex-col gap-2 rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface p-2",t),...e})}),Kr=i.forwardRef(function({className:t,...e},o){return r.jsx(ue.Accordion.Item,{ref:o,className:s("gryt-accordion-item",t),...e})}),Jr=i.forwardRef(function({children:t,className:e,expandIcon:o,...a},d){return r.jsx(ue.Accordion.Header,{className:"gryt-accordion-header m-0",children:r.jsxs(ue.Accordion.Trigger,{ref:d,className:s("gryt-accordion-trigger flex w-full cursor-pointer items-center justify-between gap-3","rounded-(--gryt-radius-lg) border-0 bg-transparent px-3 py-2.5","text-left text-sm font-medium text-gryt-text select-none","transition-colors duration-150 hover:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50",A,e),...a,children:[t,o===void 0?r.jsx(k.CaretDown,{size:16,className:"shrink-0 transition-transform duration-(--gryt-dur-spring) ease-spring data-panel-open:rotate-180 motion-reduce:transition-none"}):o]})})}),Qr=i.forwardRef(function({children:t,className:e,...o},a){return r.jsx(ue.Accordion.Panel,{ref:a,className:s("gryt-accordion-panel overflow-hidden text-sm text-gryt-muted","h-[var(--accordion-panel-height)] transition-[height] duration-(--gryt-dur-spring-soft) ease-spring","data-starting-style:h-0 data-ending-style:h-0","motion-reduce:transition-none",e),...o,children:r.jsx("div",{className:"px-3 pt-1 pb-3",children:t})})}),Zr=Object.assign(Wr,{Item:Kr,Trigger:Jr,Panel:Qr}),eo=i.forwardRef(function({className:t,sideOffset:e=2,...o},a){return r.jsx(E.ContextMenu.Positioner,{ref:a,sideOffset:e,className:s("gryt-context-menu-positioner outline-none",t),...o})}),to={Root:E.ContextMenu.Root,Trigger:E.ContextMenu.Trigger,Portal:E.ContextMenu.Portal,Positioner:eo,Popup:be.Popup,Item:be.Item,Separator:be.Separator,Group:E.ContextMenu.Group,GroupLabel:E.ContextMenu.GroupLabel,SubmenuRoot:E.ContextMenu.SubmenuRoot,SubmenuTrigger:E.ContextMenu.SubmenuTrigger},ro=i.forwardRef(function({className:t,sideOffset:e=8,...o},a){return r.jsx(G.Popover.Positioner,{ref:a,sideOffset:e,className:s("gryt-popover-positioner outline-none",t),...o})}),oo=i.forwardRef(function({className:t,...e},o){return r.jsx(G.Popover.Popup,{ref:o,className:s("gryt-popover max-w-[min(20rem,calc(100vw-2rem))] p-4 outline-none",J,q,t),...e})}),no=i.forwardRef(function({className:t,...e},o){return r.jsx(G.Popover.Title,{ref:o,className:s("gryt-popover-title text-sm font-semibold text-gryt-text",t),...e})}),ao=i.forwardRef(function({className:t,...e},o){return r.jsx(G.Popover.Description,{ref:o,className:s("gryt-popover-description mt-1 text-sm leading-6 text-gryt-muted",t),...e})}),so={Root:G.Popover.Root,Trigger:G.Popover.Trigger,Portal:G.Popover.Portal,Positioner:ro,Popup:oo,Title:no,Description:ao,Close:G.Popover.Close,Arrow:G.Popover.Arrow},io={neutral:"border-white/8 bg-gryt-surface",info:"border-gryt-secondary-6 bg-gryt-secondary-2",success:"border-gryt-success-6 bg-gryt-success-2",warning:"border-gryt-warning-6 bg-gryt-warning-2",danger:"border-gryt-danger-6 bg-gryt-danger-2"},lo=i.forwardRef(function({className:t,...e},o){return r.jsx(F.Toast.Viewport,{ref:o,className:s("gryt-toast-viewport fixed right-4 bottom-4 z-50 flex w-[min(22rem,calc(100vw-2rem))]","flex-col gap-2 outline-none",t),...e})}),co=i.forwardRef(function({className:t,severity:e="neutral",...o},a){return r.jsx(F.Toast.Root,{ref:a,className:s("gryt-toast relative flex flex-col p-3 pr-9","rounded-(--gryt-radius-xl) border text-gryt-text",io[e],"transition-[opacity,transform] duration-(--gryt-dur-spring) ease-spring","data-starting-style:translate-y-2 data-starting-style:opacity-0","data-ending-style:translate-y-2 data-ending-style:opacity-0","motion-reduce:transition-none",t),...o})}),uo=i.forwardRef(function({className:t,...e},o){return r.jsx(F.Toast.Title,{ref:o,className:s("gryt-toast-title text-sm font-semibold text-gryt-text",t),...e})}),go=i.forwardRef(function({className:t,...e},o){return r.jsx(F.Toast.Description,{ref:o,className:s("gryt-toast-description mt-0.5 text-sm leading-6 text-gryt-muted",t),...e})}),mo=i.forwardRef(function({className:t,children:e,...o},a){return r.jsx(F.Toast.Close,{ref:a,"aria-label":"Close",className:s("gryt-toast-close absolute top-2.5 right-2.5 inline-flex h-6 w-6 items-center justify-center","rounded-(--gryt-radius-full) border-0 bg-transparent text-gryt-muted","transition-colors hover:bg-white/8 hover:text-gryt-text motion-reduce:transition-none","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",t),...o,children:e??r.jsx(k.X,{size:14,weight:"bold"})})}),po=i.forwardRef(function({className:t,...e},o){return r.jsx(F.Toast.Action,{ref:o,className:s("gryt-toast-action mt-2 self-start rounded-(--gryt-radius-full) border-0","bg-gryt-accent px-3 py-1.5 text-sm font-medium text-gryt-on-accent","transition-[scale] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:scale-[1.04] motion-safe:active:scale-[0.96]","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",t),...e})}),fo={Provider:F.Toast.Provider,Portal:F.Toast.Portal,Viewport:lo,Root:co,Title:uo,Description:go,Close:mo,Action:po},xo=F.Toast.useToastManager,yo=i.forwardRef(function({className:t,...e},o){return r.jsx(ne.ScrollArea.Root,{ref:o,className:s("gryt-scroll-area relative",t),...e})}),bo=i.forwardRef(function({className:t,...e},o){return r.jsx(ne.ScrollArea.Viewport,{ref:o,className:s("gryt-scroll-area-viewport h-full w-full overscroll-contain","focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-gryt-accent-light",t),...e})}),ho=i.forwardRef(function({className:t,orientation:e,...o},a){return r.jsx(ne.ScrollArea.Scrollbar,{ref:a,orientation:e,className:s("gryt-scroll-area-scrollbar flex touch-none p-0.5 select-none","opacity-0 transition-opacity duration-(--gryt-dur-fast)","data-hovering:opacity-100 data-scrolling:opacity-100","motion-reduce:transition-none",e==="horizontal"?"h-2 flex-col":"w-2",t),...o,children:r.jsx(ne.ScrollArea.Thumb,{className:"flex-1 rounded-(--gryt-radius-full) bg-gryt-border transition-colors hover:bg-gryt-muted motion-reduce:transition-none"})})}),wo={Root:yo,Viewport:bo,Scrollbar:ho,Content:ne.ScrollArea.Content,Corner:ne.ScrollArea.Corner},vo={primary:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-accent data-pressed:text-gryt-on-accent","data-pressed:hover:not-data-disabled:bg-gryt-accent"].join(" "),secondary:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-secondary data-pressed:text-gryt-on-secondary","data-pressed:hover:not-data-disabled:bg-gryt-secondary"].join(" "),neutral:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-surface-hover data-pressed:text-gryt-text"].join(" "),danger:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-danger data-pressed:text-gryt-on-danger","data-pressed:hover:not-data-disabled:bg-gryt-danger"].join(" ")},jo={xsmall:"h-8 min-w-8 px-2 text-xs",small:"h-9 min-w-9 px-2.5 text-sm",medium:"h-10 min-w-10 px-3 text-sm",large:"h-12 min-w-12 px-4 text-base"},He=i.forwardRef(function({className:t,size:e="medium",tone:o="primary",...a},d){return r.jsx(Lt.Toggle,{ref:d,className:s("gryt-toggle","inline-flex shrink-0 items-center justify-center gap-2 border-0 bg-transparent","rounded-(--gryt-radius-full) font-medium select-none","transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:not-data-disabled:scale-[1.06]","motion-safe:active:not-data-disabled:scale-[0.94]",A,ae,jo[e],vo[o],t),...a})}),yt=i.forwardRef(function({className:t,...e},o){return r.jsx(Gt.ToggleGroup,{ref:o,className:s("gryt-toggle-group inline-flex items-center gap-1","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1",t),...e})}),bt=c.GRYT_RADIUS_KEYS,No=c.grytTheme;function _e(n,t){return t==="light"&&n.lightHue!==null?"lightHue":"hue"}const he=c.grytThemeHues;function ht(n){return{hue:{...n.hue},lightHue:n.lightHue===null?null:{...n.lightHue},dark:{...n.dark},light:{...n.light},radius:{...n.radius}}}function To(n,t){return{...he(n,t),...n[t]}}function wt(n,t){return c.createGrytTheme(c.grytThemeToOptions(n,t))}function L(n,t){const e=n;return Array.from({length:12},(o,a)=>e[`--gryt-${t}-${a+1}`])}function Qe(n){return JSON.stringify(n)}const Ae={accent:"Accent",accentLight:"Accent, light",secondary:"Secondary",secondaryLight:"Secondary, light",success:"Success",danger:"Danger",dangerLight:"Danger, light",warning:"Warning",onAccent:"Text on accent",onSecondary:"Text on secondary",onDanger:"Text on danger"},Ze={bg:"Page",surface:"Surface",surfaceRaised:"Raised surface",surfaceHover:"Surface, hovered",border:"Border",muted:"Muted text",text:"Text"},et={sm:"Small",md:"Medium",lg:"Large",xl:"Extra large",full:"Full"},So={sm:"Chips, swatches, small insets",md:"Menu rows, list items",lg:"Cards and panels",xl:"Dialogs, composers, bubbles",full:"Buttons, fields, avatars"};function le({label:n,value:t,onChange:e,warning:o,disabled:a=!1}){const d=i.useId(),[u,p]=i.useState(t),[m,f]=i.useState(t);t!==m&&(f(t),p(t));function x(y){p(y),c.isHexColor(y)&&e(c.normalizeHexColor(y))}return r.jsxs("div",{className:"min-w-0",children:[r.jsxs("span",{className:"mb-1 flex items-center gap-1.5 text-xs font-medium text-gryt-muted",id:`${d}-label`,children:[r.jsx("span",{className:"truncate",children:n}),o?r.jsx("span",{className:"inline-flex shrink-0 text-gryt-warning-11",title:o,children:r.jsx(k.Warning,{"aria-label":o,size:13})}):null]}),r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx("input",{"aria-label":`${n}, colour picker`,className:"docs-swatch disabled:cursor-not-allowed disabled:opacity-60",disabled:a,onChange:y=>x(y.target.value),type:"color",value:c.normalizeHexColor(t)}),r.jsx(we,{"aria-label":`${n}, hex value`,className:"font-mono",disabled:a,onBlur:()=>p(t),onChange:y=>x(y.target.value),size:"small",spellCheck:!1,value:u})]})]})}const Z="ui-sans-serif, system-ui, sans-serif",Me="ui-serif, Georgia, serif",xe="ui-monospace, Menlo, Consolas, monospace",Ee=[{label:"Atkinson Hyperlegible",stack:`"Atkinson Hyperlegible Next", ${Z}`,remote:!1,note:"What Gryt ships. Drawn so letterforms cannot be confused."},{label:"System",stack:Z,remote:!1,note:"Whatever this machine uses. Nothing to load."},{label:"System serif",stack:Me,remote:!1,note:"The machine's serif. Nothing to load."},{label:"Atkinson Hyperlegible Mono",stack:`"Atkinson Hyperlegible Mono", ${xe}`,remote:!1,note:"The monospace Gryt ships."},{label:"System mono",stack:xe,remote:!1,note:"The machine's monospace. Nothing to load."},{label:"Inter",stack:`"Inter", ${Z}`,remote:!0,note:"The default interface grotesque. Neutral to a fault."},{label:"Geist",stack:`"Geist", ${Z}`,remote:!0,note:"Vercel's. What shadcn/ui is set in."},{label:"IBM Plex Sans",stack:`"IBM Plex Sans", ${Z}`,remote:!0,note:"Technical and a little cold, with a real mono to match."},{label:"Archivo",stack:`"Archivo", ${Z}`,remote:!0,note:"Grotesque with weight. Good for headings that carry."},{label:"Fraunces",stack:`"Fraunces", ${Me}`,remote:!0,note:"A serif with opinions. Headings rather than body."},{label:"Source Serif 4",stack:`"Source Serif 4", ${Me}`,remote:!0,note:"A serif you can read a paragraph in."},{label:"JetBrains Mono",stack:`"JetBrains Mono", ${xe}`,remote:!0,note:"Monospace with a tall x-height. Made for code."},{label:"IBM Plex Mono",stack:`"IBM Plex Mono", ${xe}`,remote:!0,note:"The mono beside IBM Plex Sans."}],Po={body:"Body",display:"Headings",mono:"Code and numbers"},Co={body:"Messages, labels, everything you read.",display:"Headings and titles. Defaults to the body face.",mono:"Code, hex values, timestamps, fingerprints."};function Ro(n){return Ee.find(t=>t.stack===n)}function ko(n){return(n.split(",")[0]?.trim()??"").replace(/^["']|["']$/g,"")}const $e="custom";function Ao({role:n,fonts:t,onChange:e,remoteAllowed:o=!0}){const a=t?.[n]??c.grytFonts[n],d=Ro(a),[u,p]=i.useState(()=>d===void 0?ko(a):""),m=n==="mono"?"ui-monospace, Menlo, Consolas, monospace":"ui-sans-serif, system-ui, sans-serif";function f(b){if(b===$e){const w=u.trim();w!==""&&x(w);return}const h=Ee.find(w=>w.label===b);h!==void 0&&e(h.stack)}function x(b){const h=`"${b}", ${m}`;c.isFontStack(h)&&e(h)}const y=d?.remote===!0&&!o;return r.jsxs("div",{className:"min-w-0 flex flex-col gap-1.5",children:[r.jsx(ve,{label:Po[n],onValueChange:b=>f(String(b)),options:[...Ee.map(b=>({label:b.remote?`${b.label} · fetched`:b.label,value:b.label})),{label:"Something else…",value:$e}],size:"small",value:d?.label??$e}),d===void 0?r.jsx(we,{label:"Family name",onChange:b=>{p(b.target.value);const h=b.target.value.trim();h!==""&&x(h)},placeholder:"Bodoni Moda",size:"small",value:u}):null,r.jsx("p",{className:"m-0 text-[11px] leading-4 text-gryt-muted",children:d?.note??Co[n]}),y?r.jsx("p",{className:"m-0 text-[11px] leading-4 text-gryt-warning-11",children:"This one is fetched from Google, which is off on this machine. It will fall back until you turn it on."}):null,r.jsx("p",{className:"m-0 truncate text-sm text-gryt-text",style:{fontFamily:a},children:"The quick brown fox — 0123456789"})]})}const tt=.45,H={min:-tt,size:1+tt*2};function rt({value:n,onChange:t,reference:e,samples:o}){const a=o!==void 0,d=i.useRef(null),[u,p]=i.useState(null),[m,f,x,y]=n,b=i.useCallback((v,S)=>{const M=d.current?.getBoundingClientRect();if(M===void 0||M.width===0)return null;const O=H.min+(v-M.left)/M.width*H.size,Q=H.min+(M.bottom-S)/M.height*H.size;return{x:O,y:Q}},[]),h=i.useCallback(v=>{if(u===null)return;const S=b(v.clientX,v.clientY);if(S===null)return;const M=Math.min(1,Math.max(0,Number(S.x.toFixed(3)))),O=Number(S.y.toFixed(3));t(u===0?[M,O,x,y]:[m,f,M,O])},[u,t,b,m,f,x,y]),w=v=>v,j=v=>1-v,P=`M 0 ${j(0)} C ${w(m)} ${j(f)}, ${w(x)} ${j(y)}, 1 ${j(1)}`;return r.jsxs("svg",{className:"w-full touch-none rounded-(--gryt-radius-sm) border border-gryt-border bg-gryt-surface-raised",onPointerDown:v=>{if(a)return;const S=b(v.clientX,v.clientY);if(S===null)return;const M=(O,Q)=>(S.x-O)**2+(S.y-Q)**2;p(M(m,f)<=M(x,y)?0:1),v.currentTarget.setPointerCapture(v.pointerId)},onPointerMove:h,onPointerUp:v=>{p(null),v.currentTarget.releasePointerCapture(v.pointerId)},preserveAspectRatio:"none",ref:d,role:a?"img":"application","aria-label":"Timing curve",style:{height:132},viewBox:`${H.min} ${H.min} ${H.size} ${H.size}`,children:[r.jsx("rect",{fill:"none",height:1,stroke:"var(--gryt-border)",strokeWidth:.004,width:1,x:0,y:0}),e!==void 0?r.jsx("polyline",{fill:"none",opacity:.35,points:e.map((v,S)=>`${S/(e.length-1)},${j(v)}`).join(" "),stroke:"var(--gryt-muted)",strokeWidth:.008}):null,a?r.jsx("polyline",{fill:"none",points:o.map((v,S)=>`${S/(o.length-1)},${j(v)}`).join(" "),stroke:"var(--gryt-accent)",strokeWidth:.014}):r.jsxs(r.Fragment,{children:[r.jsx("line",{stroke:"var(--gryt-muted)",strokeWidth:.005,x1:0,x2:w(m),y1:j(0),y2:j(f)}),r.jsx("line",{stroke:"var(--gryt-muted)",strokeWidth:.005,x1:1,x2:w(x),y1:j(1),y2:j(y)}),r.jsx("path",{d:P,fill:"none",stroke:"var(--gryt-accent)",strokeWidth:.014}),r.jsx("circle",{cx:w(m),cy:j(f),fill:"var(--gryt-accent)",r:u===0?.035:.026}),r.jsx("circle",{cx:w(x),cy:j(y),fill:"var(--gryt-accent)",r:u===1?.035:.026})]})]})}const De="custom",Mo=[.22,1,.36,1];function $o({motion:n,onChange:t}){const e=n??c.grytMotion,o=c.isBezier(e.curve)?e.curve:null,[a,d]=i.useState(o??Mo);function u(m){t({...e,curve:m})}const p=e.scale===0;return r.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"mb-1 flex items-baseline justify-between gap-2",children:[r.jsx("span",{className:"text-xs font-medium text-gryt-muted",children:"Speed"}),r.jsx("span",{className:"font-mono text-[11px] text-gryt-muted",children:p?"off":`${e.scale.toFixed(2)}× · ${Math.round(c.grytDurations.spring*e.scale)}ms`})]}),r.jsx(Be,{"aria-label":"Animation speed",max:c.GRYT_MOTION_SCALE_MAX,min:0,onValueChange:m=>t({...e,scale:Number(Number(m).toFixed(2))}),step:.05,value:e.scale}),r.jsx("p",{className:"m-0 pt-1 text-[11px] leading-4 text-gryt-muted",children:p?"Nothing animates. A real choice, not a broken one — some people find movement unpleasant.":"One multiplier over every tier, so a drawer stays slower than a button."})]}),r.jsx("div",{className:"min-w-0",children:r.jsx(ve,{label:"Curve",onValueChange:m=>{const f=String(m);u(f===De?a:f)},options:[{label:"Spring — overshoots and settles",value:"spring"},{label:"Smooth — settles without passing",value:"smooth"},{label:"Linear — no easing at all",value:"linear"},{label:"Draw one…",value:De}],size:"small",value:o===null?e.curve:De})}),o!==null?r.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[r.jsx(rt,{onChange:m=>{d(m),u(m)},reference:c.springSamples,value:o}),r.jsxs("p",{className:"m-0 font-mono text-[11px] text-gryt-muted",children:["cubic-bezier(",o.join(", "),")"]}),r.jsx("p",{className:"m-0 text-[11px] leading-4 text-gryt-muted",children:"The faint line is the shipped spring, to compare against. Anything drawn above the box overshoots — fine on a button, and it throws a drawer outside its own edge, because one curve now does both jobs."})]}):r.jsx(rt,{onChange:u,samples:e.curve==="smooth"?c.springTightSamples:e.curve==="linear"?[0,1]:c.springSamples,value:a}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("span",{className:"text-xs font-medium text-gryt-muted",children:"Preview"}),r.jsx("div",{className:"mt-1 overflow-hidden rounded-(--gryt-radius-sm) border border-gryt-border bg-gryt-surface-raised p-2",children:r.jsx("div",{className:"h-4 w-4 rounded-(--gryt-radius-sm) bg-gryt-accent",style:{animation:p?"none":`gryt-motion-preview ${Math.round(c.grytDurations.springSoft*e.scale)}ms var(--ease-spring) infinite alternate`}},`${e.scale}-${String(e.curve)}`)})]})]})}const Do={pass:k.Check,tight:k.Warning,fail:k.X},ot={pass:"text-gryt-success-11",tight:"text-gryt-warning-11",fail:"text-gryt-danger-11"};function Io({checks:n,onRepair:t}){const e=n.filter(o=>!o.advisory&&o.level==="fail").length;return r.jsxs("section",{className:"min-w-0",children:[r.jsxs("header",{className:"flex items-center justify-between gap-2 pb-2",children:[r.jsx("h2",{className:"m-0 text-[11px] font-semibold uppercase tracking-wider text-gryt-muted",children:"Contrast"}),e>0?r.jsxs("span",{className:"text-xs text-gryt-danger-11",children:[e," of ",n.length]}):r.jsxs("span",{className:"text-xs text-gryt-muted",children:[n.length," checks pass"]})]}),r.jsx("ul",{className:"m-0 list-none space-y-1 p-0",children:n.map(o=>{const a=o.advisory&&o.level==="fail"?"tight":o.level,d=Do[a];return r.jsxs("li",{className:"flex items-center justify-between gap-2 text-xs",children:[r.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[r.jsx(d,{"aria-hidden":"true",className:ot[a],size:12}),r.jsx("span",{className:"truncate text-gryt-muted",children:o.label})]}),r.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-gryt-muted",children:[r.jsx("span",{className:a==="pass"?"text-gryt-text":ot[a],children:o.ratio.toFixed(1)}),r.jsxs("span",{"aria-hidden":"true",children:[" / ",o.min]}),r.jsxs("span",{className:"sr-only",children:[" against a minimum of ",o.min]}),!o.advisory&&o.ratio>=7?r.jsx("span",{className:"pl-1.5 text-[10px] text-gryt-success-11",children:"AAA"}):null]})]},o.id)})}),t?r.jsx("div",{className:"pt-3",children:r.jsx(ge,{onClick:t,size:"small",tone:"neutral",children:"Fix the text colours"})}):null]})}function ee({label:n,steps:t}){return r.jsxs("div",{className:"min-w-0",children:[r.jsx("span",{className:"mb-1 block text-[11px] font-medium tracking-wide text-gryt-muted",children:n}),r.jsx("ol",{className:"m-0 flex list-none gap-px overflow-hidden rounded-(--gryt-radius-sm) border border-gryt-border p-0",children:t.map((e,o)=>r.jsx("li",{className:"h-6 min-w-0 flex-1",style:{backgroundColor:e},title:`${n} ${o+1} · ${e}`},`${n}-${o}`))})]})}const Oo=[{family:"accent",label:"Accent"},{family:"secondary",label:"Secondary"},{family:"success",label:"Success"},{family:"danger",label:"Danger"},{family:"warning",label:"Warning"}];function Lo(n,t){return n<t?"fail":n<t*1.1?"tight":"pass"}function U(n,t,e,o,a,d,u=!1){const p=c.contrast(e,o);return{id:n,label:t,foreground:e,background:o,ratio:p,min:a,level:Lo(p,a),advisory:u,paths:d}}function Go(n,t,e){const o=L(t,"neutral"),a=o[0],d=o[1],u=o[11],p=o[10],m=o[5],f=e,x=_e(n,e),y=he(n,e),b=[U("text-page","Text on the page",u,a,4.5,[`${f}.text`,`${f}.bg`]),U("text-surface","Text on a surface",u,d,4.5,[`${f}.text`,`${f}.surface`]),U("muted-page","Muted text on the page",p,a,4.5,[`${f}.muted`,`${f}.bg`]),U("muted-surface","Muted text on a surface",p,d,4.5,[`${f}.muted`,`${f}.surface`])];for(const{family:w,label:j}of Oo){const P=L(t,w);b.push(U(`${w}-text`,`${j} text on the page`,P[10],a,4.5,[`${x}.${w}`,`${f}.bg`]))}const h=[{family:"accent",on:"onAccent",label:"Label on a filled button"},{family:"secondary",on:"onSecondary",label:"Label on a secondary button"},{family:"danger",on:"onDanger",label:"Label on a danger button"}];for(const{family:w,on:j,label:P}of h)b.push(U(`${j}-fill`,P,y[j],L(t,w)[8],4.5,[`${x}.${j}`,`${x}.${w}`]));return b.push(U("border-page","Border against the page",m,a,1.15,[`${f}.border`,`${f}.bg`],!0)),b}function N(n,t){return n+Math.random()*(t-n)}function Ie(n){return n[Math.floor(Math.random()*n.length)]}const Fo=[{sm:8,md:12,lg:20,xl:28,full:999},{sm:6,md:8,lg:14,xl:18,full:999},{sm:4,md:6,lg:10,xl:14,full:8},{sm:2,md:4,lg:6,xl:8,full:4},{sm:10,md:16,lg:24,xl:32,full:999}];function Ho(){const n=N(0,360),t=Ie([.4,.8,1.4,2.2]),e=n+Ie([-1,1])*N(110,200),o=(b,h,w=n)=>c.oklchToHex({l:b,c:h*t,h:w}),a=N(.15,.21),d={bg:o(a,.011),surface:o(a+.045,.014),surfaceRaised:o(a+.062,.016),surfaceHover:o(a+.125,.022),border:o(a+.125,.024),muted:o(N(.62,.665),.008),text:o(N(.9,.925),.008)},u=N(.95,.968),p={bg:o(u,.006),surface:o(N(.995,1),.001),surfaceRaised:o(u+.016,.004),surfaceHover:o(u-.035,.01),border:o(N(.878,.9),.014),muted:o(N(.46,.5),.014),text:o(N(.23,.27),.014)},m=c.oklchToHex({l:N(.67,.74),c:N(.13,.17),h:n}),f=c.oklchToHex({l:N(.79,.85),c:N(.09,.13),h:e}),x=c.oklchToHex({l:N(.67,.72),c:N(.15,.19),h:N(18,30)}),y={accent:m,accentLight:Oe(m,.085),secondary:f,secondaryLight:Oe(f,.07),success:c.oklchToHex({l:N(.8,.85),c:N(.15,.19),h:N(140,156)}),danger:x,dangerLight:Oe(x,.08),warning:c.oklchToHex({l:N(.82,.86),c:N(.14,.17),h:N(72,90)}),onAccent:"",onSecondary:"",onDanger:""};return y.onAccent=K(m),y.onSecondary=K(f),y.onDanger=K(x),{hue:y,lightHue:null,dark:d,light:p,radius:{...Ie(Fo)}}}function Oe(n,t){const{l:e,c:o,h:a}=c.hexToOklch(n);return c.oklchToHex({l:Math.min(.97,e+t),c:o*.85,h:a})}function K(n){const{c:t,h:e}=c.hexToOklch(n),o=c.oklchToHex({l:.17,c:Math.min(.05,t*.3),h:e}),a=c.oklchToHex({l:.97,c:Math.min(.03,t*.2),h:e}),d=c.contrast(o,n)>=c.contrast(a,n)?o:a;return de(d,n,7)}function ce(n){return{...n,onAccent:K(n.accent),onSecondary:K(n.secondary),onDanger:K(n.danger)}}function te(n){const t=ce(n);return t.onAccent===n.onAccent&&t.onSecondary===n.onSecondary&&t.onDanger===n.onDanger}function de(n,t,e){if(c.contrast(n,t)>=e)return n;const{l:o,c:a,h:d}=c.hexToOklch(n),u=o>=c.hexToOklch(t).l?1:-1;let p=o;for(let m=0;m<120;m++){p=Math.min(1,Math.max(0,p+u*.008));const f=c.oklchToHex({l:p,c:a,h:d});if(c.contrast(f,t)>=e)return f;if(p===0||p===1)break}return u===1?"#ffffff":"#000000"}function _o(n){const t=ht(n);for(const e of["dark","light"])t[e].text=de(t[e].text,t[e].bg,7),t[e].text=de(t[e].text,t[e].surface,7),t[e].muted=de(t[e].muted,t[e].bg,4.5),t[e].muted=de(t[e].muted,t[e].surface,4.5);for(const e of[t.hue,t.lightHue])if(e!==null)for(const[o,a]of[["onAccent","accent"],["onSecondary","secondary"],["onDanger","danger"]]){const d=e[a];c.contrast(e[o],d)<7&&(e[o]=K(d))}return t}function Eo(n){return n==="light"?{...c.grytTokens.color,...c.grytLightTokens}:{...c.grytTokens.color}}function zo(n,t){const e=Eo(t);return Object.entries(To(n,t)).filter(([o,a])=>c.normalizeHexColor(a)!==c.normalizeHexColor(e[o]??""))}function Bo(n){return bt.filter(t=>n.radius[t]!==c.grytTokens.radius[t]).map(t=>[t,n.radius[t]])}function nt(n,t){const e=[];t==="light"&&e.push(' appearance: "light",');const o=zo(n,t);o.length>0&&(e.push(" color: {"),o.forEach(([u,p],m)=>{const f=m===o.length-1?"":",";e.push(` ${u}: "${c.normalizeHexColor(p)}"${f}`)}),e.push(" },"));const a=Bo(n);a.length>0&&e.push(` radius: { ${a.map(([u,p])=>`${u}: ${p}`).join(", ")} }`);const d=e.length-1;return d>=0&&(e[d]=e[d].replace(/,$/,"")),e.length===0?"":`{
2
- ${e.join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),oe=require("@base-ui/react/tooltip"),s=require("react"),u=require("@gryt/theme"),Ct=require("@base-ui/react/button"),ir=require("clsx"),lr=require("tailwind-merge"),Ae=require("@base-ui/react/field"),S=require("@phosphor-icons/react"),_e=require("@base-ui/react/avatar"),w=require("@gryt/owl"),it=require("@base-ui/react/checkbox"),lt=require("@base-ui/react/radio"),cr=require("@base-ui/react/radio-group"),ct=require("@base-ui/react/switch"),he=require("@base-ui/react/slider"),L=require("@base-ui/react/select"),dr=require("@base-ui/react/separator"),ze=require("@base-ui/react/progress"),J=require("@base-ui/react/dialog"),H=require("@base-ui/react/drawer"),ne=require("@base-ui/react/menu"),Pe=require("@base-ui/react/tabs"),Ce=require("@base-ui/react/accordion"),K=require("@base-ui/react/context-menu"),Y=require("@base-ui/react/popover"),U=require("@base-ui/react/toast"),fe=require("@base-ui/react/scroll-area"),ur=require("@base-ui/react/toggle"),gr=require("@base-ui/react/toggle-group"),we=require("@base-ui/react/meter"),Z=require("@base-ui/react/alert-dialog"),I=require("@base-ui/react/autocomplete"),R=require("@base-ui/react/combobox"),mr=require("@base-ui/react/checkbox-group"),rt=require("@base-ui/react/collapsible"),fr=require("@base-ui/react/form"),Pt=require("@base-ui/react/fieldset"),xr=require("@base-ui/react/menubar"),F=require("@base-ui/react/navigation-menu"),te=require("@base-ui/react/number-field"),dt=require("@base-ui/react/otp-field"),ge=require("@base-ui/react/preview-card"),me=require("@base-ui/react/toolbar"),kt=s.createContext(void 0);function Rt(){return s.useContext(kt)}function pr(o){return Object.keys(o).some(r=>r.startsWith("--"))}function yr({children:o,className:r,theme:t,tooltipDelay:n=400,containOverlays:a=!1}){const l=s.useRef(null),c=t===void 0?void 0:pr(t)?t:u.createGrytTheme(t);return e.jsx("div",{className:r,style:c,ref:l,children:e.jsx(kt.Provider,{value:a?l:void 0,children:e.jsx(oe.Tooltip.Provider,{delay:n,children:o})})})}function i(...o){return lr.twMerge(ir.clsx(o))}const br={primary:"bg-gryt-accent text-gryt-on-accent hover:not-data-disabled:bg-gryt-accent-light data-disabled:bg-gryt-surface-raised data-disabled:text-gryt-muted",secondary:"bg-gryt-secondary text-gryt-on-secondary hover:not-data-disabled:bg-gryt-secondary-light data-disabled:bg-gryt-surface-raised data-disabled:text-gryt-muted",neutral:"bg-gryt-surface-raised text-gryt-text hover:not-data-disabled:bg-gryt-surface-hover data-disabled:text-gryt-muted",danger:"bg-gryt-danger text-gryt-on-danger hover:not-data-disabled:bg-gryt-danger-light data-disabled:bg-gryt-surface-raised data-disabled:text-gryt-muted",ghost:"bg-transparent text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text"},hr={xsmall:"min-h-8 px-3 text-xs",small:"min-h-9 px-4 text-sm",medium:"min-h-10 px-5 text-sm",large:"min-h-12 px-6 text-base"},Q=s.forwardRef(function({children:r,className:t,endIcon:n,size:a="medium",startIcon:l,tone:c="primary",...g},m){return e.jsxs(Ct.Button,{ref:m,className:i("gryt-button","inline-flex cursor-pointer items-center justify-center gap-2 border-0 shadow-none","rounded-(--gryt-radius-full) font-semibold whitespace-nowrap select-none","transition-[scale,background-color,color]","duration-(--gryt-dur-spring) ease-spring","motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.03]","motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.96]","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light","data-disabled:cursor-not-allowed data-disabled:opacity-60",hr[a],br[c],t),...g,children:[l,r,n]})}),D="focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",wr="has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-gryt-accent-light",At=["w-full rounded-(--gryt-radius-xl) border bg-gryt-surface-raised","text-gryt-text outline-none placeholder:text-gryt-muted","transition-colors duration-150 motion-reduce:transition-none","hover:border-gryt-accent-light focus:border-gryt-accent","disabled:cursor-not-allowed disabled:opacity-60"].join(" "),Mt={small:"min-h-9 px-3 py-1.5 text-sm",medium:"min-h-11 px-4 py-2.5 text-sm"},se="rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text",ee=["transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0"].join(" "),xe="cursor-pointer data-disabled:cursor-not-allowed data-disabled:opacity-50",vr={primary:"data-checked:bg-gryt-accent data-checked:text-gryt-on-accent",secondary:"data-checked:bg-gryt-secondary data-checked:text-gryt-on-secondary",neutral:"data-checked:bg-gryt-surface-hover data-checked:text-gryt-text",danger:"data-checked:bg-gryt-danger data-checked:text-gryt-on-danger",success:"data-checked:bg-gryt-success data-checked:text-gryt-on-accent",warning:"data-checked:bg-gryt-warning data-checked:text-gryt-on-accent"},$t={primary:"bg-gryt-accent",secondary:"bg-gryt-secondary",neutral:"bg-gryt-surface-hover",danger:"bg-gryt-danger",success:"bg-gryt-success",warning:"bg-gryt-warning"},jr={primary:"data-checked:border-gryt-accent",secondary:"data-checked:border-gryt-secondary",neutral:"data-checked:border-gryt-muted",danger:"data-checked:border-gryt-danger",success:"data-checked:border-gryt-success",warning:"data-checked:border-gryt-warning"},Nr={primary:"data-checked:bg-gryt-accent",secondary:"data-checked:bg-gryt-secondary",neutral:"data-checked:bg-gryt-surface-hover",danger:"data-checked:bg-gryt-danger",success:"data-checked:bg-gryt-success",warning:"data-checked:bg-gryt-warning"},Tr={primary:"text-gryt-accent-11 hover:not-data-disabled:bg-gryt-accent-3",secondary:"text-gryt-secondary-11 hover:not-data-disabled:bg-gryt-secondary-3",neutral:"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text",danger:"text-gryt-danger-11 hover:not-data-disabled:bg-gryt-danger-3",ghost:"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text"},Sr={xsmall:"h-8 w-8",small:"h-9 w-9",medium:"h-10 w-10",large:"h-12 w-12"},Cr=s.forwardRef(function({className:r,size:t="medium",tone:n="neutral",...a},l){return e.jsx(Ct.Button,{ref:l,className:i("gryt-icon-button","inline-flex shrink-0 items-center justify-center border-0 bg-transparent p-0","rounded-(--gryt-radius-full) select-none","transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring","motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.06]","motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.94]",D,xe,Sr[t],Tr[n],r),...a})}),Pr=s.forwardRef(function({className:r,elevated:t=!1,...n},a){return e.jsx("div",{ref:a,className:i("gryt-surface rounded-(--gryt-radius-lg) border border-gryt-border p-4 text-gryt-text",t?"bg-gryt-surface-raised":"bg-gryt-surface",r),...n})}),kr=s.forwardRef(function({children:r,className:t,from:n="assistant",...a},l){return e.jsx("div",{ref:l,className:i("gryt-message-bubble",n==="user"&&"ml-auto bg-gryt-accent text-gryt-on-accent",n==="assistant"&&"mr-auto border border-gryt-border bg-gryt-surface text-gryt-text",n==="system"&&"mx-auto border border-dashed border-gryt-border bg-transparent text-gryt-muted",t),...a,children:r})}),De=s.forwardRef(function({className:r,error:t=!1,fieldClassName:n,helperText:a,label:l,minRows:c=3,multiline:g=!1,size:m="medium",...f},y){const b=e.jsx(Ae.Field.Control,{ref:y,render:g?e.jsx("textarea",{rows:c}):void 0,className:i("gryt-text-field-control",At,g&&"resize-y leading-6",t?"border-gryt-danger":"border-gryt-border",Mt[m],r),...f});return e.jsxs(Ae.Field.Root,{className:i("gryt-text-field flex w-full flex-col gap-1.5",n),children:[l?e.jsx(Ae.Field.Label,{className:"text-xs font-medium text-gryt-muted",children:l}):null,b,a?e.jsx(Ae.Field.Description,{className:i("text-xs",t?"text-gryt-danger-11":"text-gryt-muted"),children:a}):null]})}),Rr=s.forwardRef(function({className:r,disabled:t=!1,maxRows:n=8,minRows:a=1,onSubmit:l,placeholder:c="Message Gryt",submitLabel:g="Send",...m},f){const y=s.useRef(null),b=s.useCallback(()=>{const v=y.current;if(!v)return;const j=window.getComputedStyle(v),N=parseFloat(j.lineHeight)||24,k=parseFloat(j.paddingTop)+parseFloat(j.paddingBottom);v.style.height="auto",v.style.height=`${Math.min(Math.max(v.scrollHeight,N*a+k),N*n+k)}px`},[n,a]);s.useLayoutEffect(b,[b,m.value]);function h(v){if(!l){v.preventDefault();return}l(v)}return e.jsxs("form",{className:i("gryt-composer",r),onSubmit:h,children:[e.jsx("textarea",{ref:v=>{y.current=v,typeof f=="function"?f(v):f&&(f.current=v)},rows:a,disabled:t,placeholder:c,onInput:b,className:"gryt-composer-textarea disabled:cursor-not-allowed disabled:opacity-60",...m}),e.jsx(Q,{type:"submit",disabled:t,size:"small",endIcon:e.jsx(S.PaperPlaneTilt,{size:14,weight:"fill"}),children:g})]})}),Ar={small:"h-8 w-8 text-xs",medium:"h-10 w-10 text-sm",large:"h-12 w-12 text-base"},ut=256,It=s.forwardRef(function({alt:r,children:t,className:n,fallback:a,seed:l,eggSeed:c,size:g="medium",src:m,...f},y){const b=s.useMemo(()=>l?w.owlAvatarDataUri(l,{size:ut}):void 0,[l]),h=s.useMemo(()=>c?w.eggAvatarDataUri(c,{size:ut}):void 0,[c]),v=b??h;return e.jsxs(_e.Avatar.Root,{ref:y,className:i("gryt-avatar inline-flex shrink-0 items-center justify-center overflow-hidden align-middle select-none","rounded-(--gryt-radius-full) bg-gryt-surface-raised font-medium text-gryt-text ring-1 ring-gryt-border",Ar[g],n),...f,children:[m?e.jsx(_e.Avatar.Image,{src:m,alt:r,className:"h-full w-full object-cover"}):null,e.jsx(_e.Avatar.Fallback,{className:"flex h-full w-full items-center justify-center",children:v?e.jsx("img",{src:v,alt:r,className:"h-full w-full object-cover"}):a??t})]})}),Mr=s.forwardRef(function({active:r=!1,avatar:t,className:n,subtitle:a,title:l,...c},g){return e.jsxs("button",{ref:g,type:"button",className:i("gryt-conversation-item enabled:cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",r?"bg-gryt-accent text-gryt-on-accent":"text-gryt-text hover:bg-white/5",n),...c,children:[t??e.jsx(It,{size:"small",className:i(r?"bg-gryt-on-accent text-gryt-accent-9 ring-transparent":"bg-gryt-surface-raised text-gryt-text"),children:l.slice(0,1).toUpperCase()}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-sm font-semibold",children:l}),a?e.jsx("span",{className:i("block truncate text-xs",r?"text-gryt-on-accent/85":"text-gryt-muted"),children:a}):null]})]})}),$r=s.forwardRef(function({badgeContent:r,children:t,className:n,max:a=99,showZero:l=!1,...c},g){const m=typeof r=="number"?r:null,f=m!==null&&m===0&&!l,y=m!==null&&m>a?`${a}+`:r;return e.jsxs("span",{ref:g,className:i("gryt-badge relative inline-flex",n),...c,children:[t,r!==void 0&&!f?e.jsx("span",{className:i("gryt-badge-dot absolute -top-1 -right-1 z-10 inline-flex items-center justify-center","min-w-5 rounded-(--gryt-radius-full) px-1.5 py-0.5","bg-gryt-accent text-[0.65rem] leading-none font-semibold text-gryt-on-accent","ring-2 ring-gryt-bg"),children:y}):null]})}),Ir={neutral:"border-gryt-border bg-gryt-surface-raised text-gryt-text",primary:"border-gryt-accent-6 bg-gryt-accent-3 text-gryt-accent-11",secondary:"border-gryt-secondary-6 bg-gryt-secondary-3 text-gryt-secondary-11",success:"border-gryt-success-6 bg-gryt-success-3 text-gryt-success-11",warning:"border-gryt-warning-6 bg-gryt-warning-3 text-gryt-warning-11",danger:"border-gryt-danger-6 bg-gryt-danger-3 text-gryt-danger-11"},Dr=s.forwardRef(function({children:r,className:t,icon:n,label:a,onDelete:l,tone:c="neutral",...g},m){return e.jsxs("span",{ref:m,className:i("gryt-chip inline-flex items-center gap-1.5 rounded-(--gryt-radius-full) border px-3 py-1 text-xs font-medium",Ir[c],t),...g,children:[n,a??r,l?e.jsx("button",{type:"button","aria-label":"Remove",onClick:l,className:i("-mr-1 inline-flex h-4 w-4 cursor-pointer items-center justify-center rounded-(--gryt-radius-full)","opacity-70 transition-opacity hover:opacity-100",D),children:e.jsx(S.X,{size:10,weight:"bold","aria-hidden":"true"})}):null]})}),Ke=s.forwardRef(function({className:r,tone:t="primary",...n},a){return e.jsx(it.Checkbox.Root,{ref:a,className:i("gryt-checkbox flex h-5 w-5 shrink-0 items-center justify-center","rounded-(--gryt-radius-sm) border border-gryt-border bg-gryt-surface-raised","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","data-checked:border-transparent","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.08]","motion-safe:active:not-data-disabled:scale-[0.92]",D,xe,vr[t],r),...n,children:e.jsx(it.Checkbox.Indicator,{keepMounted:!0,className:i("flex origin-center","transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring","data-unchecked:scale-0 data-unchecked:opacity-0","motion-reduce:transition-none"),children:e.jsx(S.Check,{size:12,weight:"bold"})})})}),Er=s.forwardRef(function({className:r,tone:t="primary",...n},a){return e.jsx(lt.Radio.Root,{ref:a,className:i("gryt-radio flex h-5 w-5 shrink-0 items-center justify-center","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.08]","motion-safe:active:not-data-disabled:scale-[0.92]",D,xe,jr[t],r),...n,children:e.jsx(lt.Radio.Indicator,{keepMounted:!0,className:i("h-2.5 w-2.5 origin-center rounded-(--gryt-radius-full)","transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring","data-unchecked:scale-0 data-unchecked:opacity-0","motion-reduce:transition-none",$t[t])})})}),Or=s.forwardRef(function({className:r,...t},n){return e.jsx(cr.RadioGroup,{ref:n,className:i("gryt-radio-group flex flex-col gap-2",r),...t})}),Lr=s.forwardRef(function({className:r,tone:t="primary",...n},a){return e.jsx(ct.Switch.Root,{ref:a,className:i("gryt-switch relative inline-flex h-6 w-10 shrink-0 items-center","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised p-0.5","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","data-checked:border-transparent","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.05]","motion-safe:active:not-data-disabled:scale-[0.95]",D,xe,Nr[t],r),...n,children:e.jsx(ct.Switch.Thumb,{className:i("h-4.5 w-4.5 rounded-(--gryt-radius-full) bg-gryt-text","transition-transform duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-checked:translate-x-4 data-checked:bg-gryt-bg")})})}),gt=3;function ot({className:o,tone:r="primary","aria-label":t,...n}){const[a,l]=s.useState(!1),c=s.useRef(null);s.useEffect(()=>{if(!a&&c.current===null)return;const y=()=>{c.current=null,l(!1)};return window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y),()=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y)}},[a]);function g(y){c.current={x:y.clientX,y:y.clientY}}function m(y){const b=c.current;if(b===null||a)return;(Math.abs(y.clientX-b.x)>gt||Math.abs(y.clientY-b.y)>gt)&&l(!0)}const f=a?"transition-none":"duration-(--gryt-dur-spring) ease-spring-tight motion-reduce:transition-none";return e.jsx(he.Slider.Root,{className:i("gryt-slider w-full",o),...n,children:e.jsx(he.Slider.Control,{className:"flex w-full cursor-pointer touch-none items-center py-2 select-none",onPointerDown:g,onPointerMove:m,children:e.jsxs(he.Slider.Track,{className:"h-1.5 w-full rounded-(--gryt-radius-full) bg-gryt-surface-raised select-none",children:[e.jsx(he.Slider.Indicator,{className:i("h-full rounded-(--gryt-radius-full) select-none","transition-[width]",f,$t[r])}),e.jsx(he.Slider.Thumb,{"aria-label":t,className:i("group h-4 w-4 rounded-(--gryt-radius-full) select-none","transition-[inset-inline-start]",f,wr),children:e.jsx("span",{className:i("block h-full w-full rounded-(--gryt-radius-full) bg-gryt-text","transition-[scale] duration-(--gryt-dur-spring) ease-spring","motion-safe:group-hover:scale-[1.12] motion-safe:group-active:scale-[0.94]","motion-reduce:transition-none")})})]})})})}const Fr={small:"min-h-9 px-3 text-sm",medium:"min-h-11 px-4 text-sm"};function Ee({className:o,label:r,options:t=[],placeholder:n="Select",size:a="medium",...l}){const c=Rt();return e.jsxs(L.Select.Root,{items:t,...l,children:[e.jsxs("div",{className:i("gryt-select flex w-full flex-col gap-1.5",o),children:[r?e.jsx(L.Select.Label,{className:"text-xs font-medium text-gryt-muted",children:r}):null,e.jsxs(L.Select.Trigger,{className:i("flex w-full cursor-pointer items-center justify-between gap-2","rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface-raised","text-gryt-text select-none","transition-colors duration-150 hover:border-gryt-accent-light","data-disabled:cursor-not-allowed data-disabled:opacity-60",D,Fr[a]),children:[e.jsx(L.Select.Value,{placeholder:n}),e.jsx(L.Select.Icon,{className:"shrink-0 text-gryt-muted",children:e.jsx(S.CaretUpDown,{size:16})})]})]}),e.jsx(L.Select.Portal,{container:c,children:e.jsx(L.Select.Positioner,{sideOffset:6,className:"gryt-select-positioner outline-none",children:e.jsx(L.Select.Popup,{className:i("min-w-(--anchor-width) p-1",se,ee),children:e.jsx(L.Select.List,{children:t.map(g=>e.jsxs(L.Select.Item,{value:g.value,disabled:g.disabled,className:i("flex cursor-pointer items-center justify-between gap-2","rounded-(--gryt-radius-md) px-3 py-2 text-sm text-gryt-text","outline-none select-none data-highlighted:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50"),children:[e.jsx(L.Select.ItemText,{children:g.label}),e.jsx(L.Select.ItemIndicator,{className:"text-gryt-accent-11",children:e.jsx(S.Check,{size:14,weight:"bold"})})]},String(g.value)))})})})})]})}function Je({children:o,className:r,side:t="top",sideOffset:n=8,title:a}){const l=Rt();return e.jsxs(oe.Tooltip.Root,{children:[e.jsx(oe.Tooltip.Trigger,{render:o}),e.jsx(oe.Tooltip.Portal,{container:l,children:e.jsx(oe.Tooltip.Positioner,{side:t,sideOffset:n,className:"gryt-tooltip-positioner",children:e.jsx(oe.Tooltip.Popup,{className:i("gryt-tooltip rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface-raised","px-2.5 py-1.5 text-xs text-gryt-text",ee,r),children:a})})})]})}const Gr=oe.Tooltip.Provider,_r=s.forwardRef(function({className:r,orientation:t="horizontal",...n},a){return e.jsx(dr.Separator,{ref:a,orientation:t,className:i("gryt-divider bg-gryt-border",t==="vertical"?"h-full w-px":"h-px w-full",r),...n})}),zr=s.forwardRef(function({className:r,...t},n){return e.jsx("div",{ref:n,className:i("gryt-card rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text",r),...t})});function Hr({children:o,className:r,subheader:t,title:n,...a}){return e.jsxs("div",{className:i("gryt-card-header flex flex-col gap-1 p-4",r),...a,children:[n?e.jsx("span",{className:"text-base font-semibold text-gryt-text",children:n}):null,t?e.jsx("span",{className:"text-sm text-gryt-muted",children:t}):null,o]})}function Br({className:o,...r}){return e.jsx("div",{className:i("gryt-card-content px-4 pb-4 text-sm text-gryt-muted",o),...r})}function qr({className:o,...r}){return e.jsx("div",{className:i("gryt-card-actions flex items-center gap-2 px-4 pb-4",o),...r})}const Yr={info:"border-gryt-secondary-6 bg-gryt-secondary-3 text-gryt-secondary-11",success:"border-gryt-success-6 bg-gryt-success-3 text-gryt-success-11",warning:"border-gryt-warning-6 bg-gryt-warning-3 text-gryt-warning-11",error:"border-gryt-danger-6 bg-gryt-danger-3 text-gryt-danger-11"},Dt=s.forwardRef(function({className:r,severity:t="info",...n},a){return e.jsx("div",{ref:a,role:"alert",className:i("gryt-alert rounded-(--gryt-radius-lg) border px-4 py-3 text-sm",Yr[t],r),...n})});function Ur({className:o,value:r=null,...t}){return e.jsx(ze.Progress.Root,{value:r,className:i("gryt-progress w-full",o),...t,children:e.jsx(ze.Progress.Track,{className:"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised",children:e.jsx(ze.Progress.Indicator,{className:i("h-full rounded-(--gryt-radius-full) bg-gryt-accent","transition-[width] duration-300 ease-out motion-reduce:transition-none",r===null&&"gryt-progress-indeterminate")})})})}function Vr({className:o,size:r=24,"aria-label":t="Loading"}){return e.jsx(S.CircleNotch,{role:"status","aria-label":t,size:r,weight:"bold",className:i("gryt-spinner text-gryt-accent-11 motion-safe:animate-spin",o)})}const Wr={text:"h-4 rounded-(--gryt-radius-sm)",rounded:"rounded-(--gryt-radius-lg)",circular:"rounded-(--gryt-radius-full)",rectangular:"rounded-none"};function Xr({className:o,height:r,style:t,variant:n="text",width:a,...l}){const c={width:a,height:r,...t};return e.jsx("div",{"aria-hidden":"true",className:i("gryt-skeleton bg-white/9 motion-safe:animate-pulse",Wr[n],o),style:c,...l})}const Et="transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none",Kr=s.forwardRef(function({className:r,...t},n){return e.jsx(J.Dialog.Backdrop,{ref:n,className:i("gryt-dialog-backdrop fixed inset-0 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)",Et,"data-starting-style:opacity-0 data-ending-style:opacity-0",r),...t})}),Jr=s.forwardRef(function({className:r,...t},n){return e.jsx(J.Dialog.Popup,{ref:n,className:i("gryt-dialog fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2","flex w-[32rem] max-w-[calc(100vw-3rem)] flex-col gap-4","rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text",Et,"data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0",r),...t})}),Zr=s.forwardRef(function({className:r,...t},n){return e.jsx(J.Dialog.Title,{ref:n,className:i("gryt-dialog-title text-base font-semibold text-gryt-text",r),...t})}),Qr=s.forwardRef(function({className:r,...t},n){return e.jsx(J.Dialog.Description,{ref:n,className:i("gryt-dialog-description text-sm text-gryt-muted",r),...t})}),eo=s.forwardRef(function({className:r,...t},n){return e.jsx("div",{ref:n,className:i("gryt-dialog-footer flex justify-end gap-3",r),...t})}),G={Root:J.Dialog.Root,Trigger:J.Dialog.Trigger,Portal:J.Dialog.Portal,Close:J.Dialog.Close,Backdrop:Kr,Popup:Jr,Title:Zr,Description:Qr,Footer:eo},to=()=>()=>{};function Ot(o){const r=s.useCallback(n=>{if(typeof window>"u"||!window.matchMedia)return to();const a=window.matchMedia(o);return a.addEventListener("change",n),()=>a.removeEventListener("change",n)},[o]),t=s.useCallback(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(o).matches,[o]);return s.useSyncExternalStore(r,t,()=>!1)}const ro={left:"left",right:"right",top:"up",bottom:"down"},Oe=s.createContext("right"),oo={left:"items-stretch justify-start",right:"items-stretch justify-end",top:"items-start justify-center",bottom:"items-end justify-center"},no={left:"rounded-r-(--gryt-radius-xl)",right:"rounded-l-(--gryt-radius-xl)",top:"rounded-b-(--gryt-radius-xl)",bottom:"rounded-t-(--gryt-radius-xl)"},ao={left:["h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]","-ml-(--gryt-drawer-bleed) border-r py-5 pr-5 pl-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateX(var(--drawer-swipe-movement-x))]","data-starting-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]"].join(" "),right:["h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]","-mr-(--gryt-drawer-bleed) border-l py-5 pl-5 pr-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateX(var(--drawer-swipe-movement-x))]","data-starting-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]"].join(" "),top:["w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]","-mt-(--gryt-drawer-bleed) border-b px-5 pb-5 pt-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateY(var(--drawer-swipe-movement-y))]","data-starting-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]"].join(" "),bottom:["w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]","-mb-(--gryt-drawer-bleed) border-t px-5 pt-5 pb-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateY(var(--drawer-swipe-movement-y))]","data-starting-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]"].join(" ")};function so({side:o="right",sheetOnMobile:r=!0,children:t,...n}){const a=Ot("(max-width: 767px)"),l=r&&a?"bottom":o;return e.jsx(Oe.Provider,{value:l,children:e.jsx(H.Drawer.Root,{swipeDirection:ro[l],...n,children:t})})}const io=s.forwardRef(function({className:r,...t},n){const a=s.useContext(Oe);return e.jsx(H.Drawer.Viewport,{ref:n,className:i("gryt-drawer-viewport fixed inset-0 z-50 flex",oo[a],r),...t})}),lo=s.forwardRef(function({className:r,...t},n){const a=s.useContext(Oe);return e.jsx(H.Drawer.Popup,{ref:n,className:i("gryt-drawer flex flex-col gap-4 border-gryt-border bg-gryt-surface text-gryt-text","overflow-y-auto overscroll-contain outline-none","transition-transform duration-(--gryt-dur-spring-soft) ease-spring-tight","data-swiping:duration-0 data-swiping:select-none","motion-reduce:transition-none",ao[a],no[a],r),...t})}),co=s.forwardRef(function({className:r,...t},n){return e.jsx(H.Drawer.Backdrop,{ref:n,className:i("gryt-drawer-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)","[opacity:calc(1-var(--drawer-swipe-progress,0))]","transition-opacity duration-(--gryt-dur-spring-soft) ease-spring-tight","data-swiping:duration-0","data-starting-style:opacity-0 data-ending-style:opacity-0","motion-reduce:transition-none",r),...t})});function uo({className:o}){const r=s.useContext(Oe);return r!=="bottom"&&r!=="top"?null:e.jsx("div",{"aria-hidden":!0,className:i("gryt-drawer-grabber mx-auto h-1.5 w-10 shrink-0 rounded-(--gryt-radius-full) bg-gryt-border",r==="top"&&"order-last",o)})}const go={Root:so,Trigger:H.Drawer.Trigger,Portal:H.Drawer.Portal,Backdrop:co,Viewport:io,Popup:lo,Content:H.Drawer.Content,Grabber:uo,Close:H.Drawer.Close,Title:H.Drawer.Title,Description:H.Drawer.Description},mo=s.forwardRef(function({className:r,sideOffset:t=8,...n},a){return e.jsx(ne.Menu.Positioner,{ref:a,sideOffset:t,className:i("gryt-menu-positioner outline-none",r),...n})}),fo=s.forwardRef(function({className:r,...t},n){return e.jsx(ne.Menu.Popup,{ref:n,className:i("gryt-menu min-w-44 p-1 outline-none",se,ee,r),...t})}),xo=s.forwardRef(function({className:r,...t},n){return e.jsx(ne.Menu.Item,{ref:n,className:i("gryt-menu-item flex cursor-pointer items-center gap-2 rounded-(--gryt-radius-md)","px-3 py-2 text-sm text-gryt-text outline-none select-none","data-highlighted:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50",r),...t})}),po=s.forwardRef(function({className:r,...t},n){return e.jsx(ne.Menu.Separator,{ref:n,className:i("gryt-menu-separator my-1 h-px bg-gryt-border",r),...t})}),B={Root:ne.Menu.Root,Trigger:ne.Menu.Trigger,Portal:ne.Menu.Portal,Positioner:mo,Popup:fo,Item:xo,Separator:po},yo=s.forwardRef(function({className:r,...t},n){return e.jsx(Pe.Tabs.Root,{ref:n,className:i("gryt-tabs","data-[orientation=vertical]:flex data-[orientation=vertical]:items-stretch",r),...t})}),bo=s.forwardRef(function({className:r,...t},n){return e.jsx(Pe.Tabs.List,{ref:n,className:i("gryt-tabs-list relative inline-flex items-center gap-1 rounded-(--gryt-radius-full) bg-gryt-surface-raised p-1","data-[orientation=vertical]:flex data-[orientation=vertical]:shrink-0","data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch","data-[orientation=vertical]:rounded-(--gryt-radius-lg)",r),...t})}),Lt=s.forwardRef(function({className:r,...t},n){return e.jsx(Pe.Tabs.Tab,{ref:n,className:i("gryt-tab inline-flex min-h-8 cursor-pointer items-center justify-center whitespace-nowrap","rounded-(--gryt-radius-full) border-0 bg-transparent px-4 py-1.5","text-sm font-medium text-gryt-muted select-none","relative z-10 hover:text-gryt-text","transition-[scale,color,background-color] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:scale-[1.03] motion-safe:active:scale-[0.96]","motion-reduce:transition-colors motion-reduce:duration-150","data-active:text-gryt-on-accent","data-[orientation=vertical]:min-h-9 data-[orientation=vertical]:justify-start","data-[orientation=vertical]:gap-2.5 data-[orientation=vertical]:px-3","data-[orientation=vertical]:rounded-(--gryt-radius-md)","data-disabled:cursor-not-allowed data-disabled:opacity-50",D,r),...t})}),ho=s.forwardRef(function({className:r,...t},n){return e.jsx(Pe.Tabs.Indicator,{ref:n,renderBeforeHydration:!0,className:i("gryt-tabs-indicator absolute top-1 left-0 z-0 h-[calc(100%-0.5rem)]","w-(--active-tab-width) translate-x-(--active-tab-left)","rounded-(--gryt-radius-full) bg-gryt-accent","transition-[translate,width] duration-(--gryt-dur-spring) ease-spring","motion-reduce:transition-none","[[data-orientation=vertical]_&]:top-0 [[data-orientation=vertical]_&]:left-1","[[data-orientation=vertical]_&]:h-(--active-tab-height)","[[data-orientation=vertical]_&]:w-[calc(100%-0.5rem)]","[[data-orientation=vertical]_&]:translate-x-0","[[data-orientation=vertical]_&]:translate-y-(--active-tab-top)","[[data-orientation=vertical]_&]:rounded-(--gryt-radius-md)","[[data-orientation=vertical]_&]:transition-[translate,height]",r),...t})}),wo=s.forwardRef(function({className:r,...t},n){return e.jsx(Pe.Tabs.Panel,{ref:n,className:i("gryt-tabs-panel pt-3 text-sm text-gryt-text","data-[orientation=vertical]:min-w-0 data-[orientation=vertical]:flex-1","data-[orientation=vertical]:pt-0 data-[orientation=vertical]:pl-4",r),...t})}),ue=Object.assign(yo,{List:bo,Tab:Lt,Panel:wo,Indicator:ho}),vo=s.forwardRef(function({className:r,...t},n){return e.jsx(Ce.Accordion.Root,{ref:n,className:i("gryt-accordion flex w-full flex-col gap-2 rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface p-2",r),...t})}),jo=s.forwardRef(function({className:r,...t},n){return e.jsx(Ce.Accordion.Item,{ref:n,className:i("gryt-accordion-item",r),...t})}),No=s.forwardRef(function({children:r,className:t,expandIcon:n,...a},l){return e.jsx(Ce.Accordion.Header,{className:"gryt-accordion-header m-0",children:e.jsxs(Ce.Accordion.Trigger,{ref:l,className:i("gryt-accordion-trigger flex w-full cursor-pointer items-center justify-between gap-3","rounded-(--gryt-radius-lg) border-0 bg-transparent px-3 py-2.5","text-left text-sm font-medium text-gryt-text select-none","transition-colors duration-150 hover:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50",D,t),...a,children:[r,n===void 0?e.jsx(S.CaretDown,{size:16,className:"shrink-0 transition-transform duration-(--gryt-dur-spring) ease-spring data-panel-open:rotate-180 motion-reduce:transition-none"}):n]})})}),To=s.forwardRef(function({children:r,className:t,...n},a){return e.jsx(Ce.Accordion.Panel,{ref:a,className:i("gryt-accordion-panel overflow-hidden text-sm text-gryt-muted","h-[var(--accordion-panel-height)] transition-[height] duration-(--gryt-dur-spring-soft) ease-spring","data-starting-style:h-0 data-ending-style:h-0","motion-reduce:transition-none",t),...n,children:e.jsx("div",{className:"px-3 pt-1 pb-3",children:r})})}),So=Object.assign(vo,{Item:jo,Trigger:No,Panel:To}),Co=s.forwardRef(function({className:r,sideOffset:t=2,...n},a){return e.jsx(K.ContextMenu.Positioner,{ref:a,sideOffset:t,className:i("gryt-context-menu-positioner outline-none",r),...n})}),Po={Root:K.ContextMenu.Root,Trigger:K.ContextMenu.Trigger,Portal:K.ContextMenu.Portal,Positioner:Co,Popup:B.Popup,Item:B.Item,Separator:B.Separator,Group:K.ContextMenu.Group,GroupLabel:K.ContextMenu.GroupLabel,SubmenuRoot:K.ContextMenu.SubmenuRoot,SubmenuTrigger:K.ContextMenu.SubmenuTrigger},ko=s.forwardRef(function({className:r,sideOffset:t=8,...n},a){return e.jsx(Y.Popover.Positioner,{ref:a,sideOffset:t,className:i("gryt-popover-positioner outline-none",r),...n})}),Ro=s.forwardRef(function({className:r,...t},n){return e.jsx(Y.Popover.Popup,{ref:n,className:i("gryt-popover max-w-[min(20rem,calc(100vw-2rem))] p-4 outline-none",se,ee,r),...t})}),Ao=s.forwardRef(function({className:r,...t},n){return e.jsx(Y.Popover.Title,{ref:n,className:i("gryt-popover-title text-sm font-semibold text-gryt-text",r),...t})}),Mo=s.forwardRef(function({className:r,...t},n){return e.jsx(Y.Popover.Description,{ref:n,className:i("gryt-popover-description mt-1 text-sm leading-6 text-gryt-muted",r),...t})}),$o={Root:Y.Popover.Root,Trigger:Y.Popover.Trigger,Portal:Y.Popover.Portal,Positioner:ko,Popup:Ro,Title:Ao,Description:Mo,Close:Y.Popover.Close,Arrow:Y.Popover.Arrow},Io={neutral:"border-white/8 bg-gryt-surface",info:"border-gryt-secondary-6 bg-gryt-secondary-2",success:"border-gryt-success-6 bg-gryt-success-2",warning:"border-gryt-warning-6 bg-gryt-warning-2",danger:"border-gryt-danger-6 bg-gryt-danger-2"},Do=s.forwardRef(function({className:r,...t},n){return e.jsx(U.Toast.Viewport,{ref:n,className:i("gryt-toast-viewport fixed right-4 bottom-4 z-50 flex w-[min(22rem,calc(100vw-2rem))]","flex-col gap-2 outline-none",r),...t})}),Eo=s.forwardRef(function({className:r,severity:t="neutral",...n},a){return e.jsx(U.Toast.Root,{ref:a,className:i("gryt-toast relative flex flex-col p-3 pr-9","rounded-(--gryt-radius-xl) border text-gryt-text",Io[t],"transition-[opacity,transform] duration-(--gryt-dur-spring) ease-spring","data-starting-style:translate-y-2 data-starting-style:opacity-0","data-ending-style:translate-y-2 data-ending-style:opacity-0","motion-reduce:transition-none",r),...n})}),Oo=s.forwardRef(function({className:r,...t},n){return e.jsx(U.Toast.Title,{ref:n,className:i("gryt-toast-title text-sm font-semibold text-gryt-text",r),...t})}),Lo=s.forwardRef(function({className:r,...t},n){return e.jsx(U.Toast.Description,{ref:n,className:i("gryt-toast-description mt-0.5 text-sm leading-6 text-gryt-muted",r),...t})}),Fo=s.forwardRef(function({className:r,children:t,...n},a){return e.jsx(U.Toast.Close,{ref:a,"aria-label":"Close",className:i("gryt-toast-close absolute top-2.5 right-2.5 inline-flex h-6 w-6 items-center justify-center","rounded-(--gryt-radius-full) border-0 bg-transparent text-gryt-muted","transition-colors hover:bg-white/8 hover:text-gryt-text motion-reduce:transition-none","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",r),...n,children:t??e.jsx(S.X,{size:14,weight:"bold"})})}),Go=s.forwardRef(function({className:r,...t},n){return e.jsx(U.Toast.Action,{ref:n,className:i("gryt-toast-action mt-2 self-start rounded-(--gryt-radius-full) border-0","bg-gryt-accent px-3 py-1.5 text-sm font-medium text-gryt-on-accent","transition-[scale] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:scale-[1.04] motion-safe:active:scale-[0.96]","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",r),...t})}),_o={Provider:U.Toast.Provider,Portal:U.Toast.Portal,Viewport:Do,Root:Eo,Title:Oo,Description:Lo,Close:Fo,Action:Go},zo=U.Toast.useToastManager,Ho=s.forwardRef(function({className:r,...t},n){return e.jsx(fe.ScrollArea.Root,{ref:n,className:i("gryt-scroll-area relative",r),...t})}),Bo=s.forwardRef(function({className:r,...t},n){return e.jsx(fe.ScrollArea.Viewport,{ref:n,className:i("gryt-scroll-area-viewport h-full w-full overscroll-contain","focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-gryt-accent-light",r),...t})}),qo=s.forwardRef(function({className:r,orientation:t,...n},a){return e.jsx(fe.ScrollArea.Scrollbar,{ref:a,orientation:t,className:i("gryt-scroll-area-scrollbar flex touch-none p-0.5 select-none","opacity-0 transition-opacity duration-(--gryt-dur-fast)","data-hovering:opacity-100 data-scrolling:opacity-100","motion-reduce:transition-none",t==="horizontal"?"h-2 flex-col":"w-2",r),...n,children:e.jsx(fe.ScrollArea.Thumb,{className:"flex-1 rounded-(--gryt-radius-full) bg-gryt-border transition-colors hover:bg-gryt-muted motion-reduce:transition-none"})})}),Yo={Root:Ho,Viewport:Bo,Scrollbar:qo,Content:fe.ScrollArea.Content,Corner:fe.ScrollArea.Corner},Uo={primary:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-accent data-pressed:text-gryt-on-accent","data-pressed:hover:not-data-disabled:bg-gryt-accent"].join(" "),secondary:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-secondary data-pressed:text-gryt-on-secondary","data-pressed:hover:not-data-disabled:bg-gryt-secondary"].join(" "),neutral:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-surface-hover data-pressed:text-gryt-text"].join(" "),danger:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-danger data-pressed:text-gryt-on-danger","data-pressed:hover:not-data-disabled:bg-gryt-danger"].join(" ")},Vo={xsmall:"h-8 min-w-8 px-2 text-xs",small:"h-9 min-w-9 px-2.5 text-sm",medium:"h-10 min-w-10 px-3 text-sm",large:"h-12 min-w-12 px-4 text-base"},Ze=s.forwardRef(function({className:r,size:t="medium",tone:n="primary",...a},l){return e.jsx(ur.Toggle,{ref:l,className:i("gryt-toggle","inline-flex shrink-0 items-center justify-center gap-2 border-0 bg-transparent","rounded-(--gryt-radius-full) font-medium select-none","transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:not-data-disabled:scale-[1.06]","motion-safe:active:not-data-disabled:scale-[0.94]",D,xe,Vo[t],Uo[n],r),...a})}),Ft=s.forwardRef(function({className:r,...t},n){return e.jsx(gr.ToggleGroup,{ref:n,className:i("gryt-toggle-group inline-flex items-center gap-1","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1",r),...t})}),Gt=u.GRYT_RADIUS_KEYS,Wo=u.grytTheme;function Qe(o,r){return r==="light"&&o.lightHue!==null?"lightHue":"hue"}const Ie=u.grytThemeHues;function _t(o){return{hue:{...o.hue},lightHue:o.lightHue===null?null:{...o.lightHue},dark:{...o.dark},light:{...o.light},radius:{...o.radius}}}function Xo(o,r){return{...Ie(o,r),...o[r]}}function zt(o,r){return u.createGrytTheme(u.grytThemeToOptions(o,r))}function q(o,r){const t=o;return Array.from({length:12},(n,a)=>t[`--gryt-${r}-${a+1}`])}function mt(o){return JSON.stringify(o)}const He={accent:"Accent",accentLight:"Accent, light",secondary:"Secondary",secondaryLight:"Secondary, light",success:"Success",danger:"Danger",dangerLight:"Danger, light",warning:"Warning",onAccent:"Text on accent",onSecondary:"Text on secondary",onDanger:"Text on danger"},ft={bg:"Page",surface:"Surface",surfaceRaised:"Raised surface",surfaceHover:"Surface, hovered",border:"Border",muted:"Muted text",text:"Text"},xt={sm:"Small",md:"Medium",lg:"Large",xl:"Extra large",full:"Full"},Ko={sm:"Chips, swatches, small insets",md:"Menu rows, list items",lg:"Cards and panels",xl:"Dialogs, composers, bubbles",full:"Buttons, fields, avatars"};function ve({label:o,value:r,onChange:t,warning:n,disabled:a=!1}){const l=s.useId(),[c,g]=s.useState(r),[m,f]=s.useState(r);r!==m&&(f(r),g(r));function y(b){g(b),u.isHexColor(b)&&t(u.normalizeHexColor(b))}return e.jsxs("div",{className:"min-w-0",children:[e.jsxs("span",{className:"mb-1 flex items-center gap-1.5 text-xs font-medium text-gryt-muted",id:`${l}-label`,children:[e.jsx("span",{className:"truncate",children:o}),n?e.jsx("span",{className:"inline-flex shrink-0 text-gryt-warning-11",title:n,children:e.jsx(S.Warning,{"aria-label":n,size:13})}):null]}),e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("input",{"aria-label":`${o}, colour picker`,className:"docs-swatch disabled:cursor-not-allowed disabled:opacity-60",disabled:a,onChange:b=>y(b.target.value),type:"color",value:u.normalizeHexColor(r)}),e.jsx(De,{"aria-label":`${o}, hex value`,className:"font-mono",disabled:a,onBlur:()=>g(r),onChange:b=>y(b.target.value),size:"small",spellCheck:!1,value:c})]})]})}const le="ui-sans-serif, system-ui, sans-serif",Be="ui-serif, Georgia, serif",Me="ui-monospace, Menlo, Consolas, monospace",et=[{label:"Atkinson Hyperlegible",stack:`"Atkinson Hyperlegible Next", ${le}`,remote:!1,note:"What Gryt ships. Drawn so letterforms cannot be confused."},{label:"System",stack:le,remote:!1,note:"Whatever this machine uses. Nothing to load."},{label:"System serif",stack:Be,remote:!1,note:"The machine's serif. Nothing to load."},{label:"Atkinson Hyperlegible Mono",stack:`"Atkinson Hyperlegible Mono", ${Me}`,remote:!1,note:"The monospace Gryt ships."},{label:"System mono",stack:Me,remote:!1,note:"The machine's monospace. Nothing to load."},{label:"Inter",stack:`"Inter", ${le}`,remote:!0,note:"The default interface grotesque. Neutral to a fault."},{label:"Geist",stack:`"Geist", ${le}`,remote:!0,note:"Vercel's. What shadcn/ui is set in."},{label:"IBM Plex Sans",stack:`"IBM Plex Sans", ${le}`,remote:!0,note:"Technical and a little cold, with a real mono to match."},{label:"Archivo",stack:`"Archivo", ${le}`,remote:!0,note:"Grotesque with weight. Good for headings that carry."},{label:"Fraunces",stack:`"Fraunces", ${Be}`,remote:!0,note:"A serif with opinions. Headings rather than body."},{label:"Source Serif 4",stack:`"Source Serif 4", ${Be}`,remote:!0,note:"A serif you can read a paragraph in."},{label:"JetBrains Mono",stack:`"JetBrains Mono", ${Me}`,remote:!0,note:"Monospace with a tall x-height. Made for code."},{label:"IBM Plex Mono",stack:`"IBM Plex Mono", ${Me}`,remote:!0,note:"The mono beside IBM Plex Sans."}],Jo={body:"Body",display:"Headings",mono:"Code and numbers"},Zo={body:"Messages, labels, everything you read.",display:"Headings and titles. Defaults to the body face.",mono:"Code, hex values, timestamps, fingerprints."};function Qo(o){return et.find(r=>r.stack===o)}function en(o){return(o.split(",")[0]?.trim()??"").replace(/^["']|["']$/g,"")}const qe="custom";function tn({role:o,fonts:r,onChange:t,remoteAllowed:n=!0}){const a=r?.[o]??u.grytFonts[o],l=Qo(a),[c,g]=s.useState(()=>l===void 0?en(a):""),m=o==="mono"?"ui-monospace, Menlo, Consolas, monospace":"ui-sans-serif, system-ui, sans-serif";function f(h){if(h===qe){const j=c.trim();j!==""&&y(j);return}const v=et.find(j=>j.label===h);v!==void 0&&t(v.stack)}function y(h){const v=`"${h}", ${m}`;u.isFontStack(v)&&t(v)}const b=l?.remote===!0&&!n;return e.jsxs("div",{className:"min-w-0 flex flex-col gap-1.5",children:[e.jsx(Ee,{label:Jo[o],onValueChange:h=>f(String(h)),options:[...et.map(h=>({label:h.remote?`${h.label} · fetched`:h.label,value:h.label})),{label:"Something else…",value:qe}],size:"small",value:l?.label??qe}),l===void 0?e.jsx(De,{label:"Family name",onChange:h=>{g(h.target.value);const v=h.target.value.trim();v!==""&&y(v)},placeholder:"Bodoni Moda",size:"small",value:c}):null,e.jsx("p",{className:"m-0 text-[11px] leading-4 text-gryt-muted",children:l?.note??Zo[o]}),b?e.jsx("p",{className:"m-0 text-[11px] leading-4 text-gryt-warning-11",children:"This one is fetched from Google, which is off on this machine. It will fall back until you turn it on."}):null,e.jsx("p",{className:"m-0 truncate text-sm text-gryt-text",style:{fontFamily:a},children:"The quick brown fox — 0123456789"})]})}const pt=.45,W={min:-pt,size:1+pt*2};function yt({value:o,onChange:r,reference:t,samples:n}){const a=n!==void 0,l=s.useRef(null),[c,g]=s.useState(null),[m,f,y,b]=o,h=s.useCallback((T,P)=>{const A=l.current?.getBoundingClientRect();if(A===void 0||A.width===0)return null;const E=W.min+(T-A.left)/A.width*W.size,V=W.min+(A.bottom-P)/A.height*W.size;return{x:E,y:V}},[]),v=s.useCallback(T=>{if(c===null)return;const P=h(T.clientX,T.clientY);if(P===null)return;const A=Math.min(1,Math.max(0,Number(P.x.toFixed(3)))),E=Number(P.y.toFixed(3));r(c===0?[A,E,y,b]:[m,f,A,E])},[c,r,h,m,f,y,b]),j=T=>T,N=T=>1-T,k=`M 0 ${N(0)} C ${j(m)} ${N(f)}, ${j(y)} ${N(b)}, 1 ${N(1)}`;return e.jsxs("svg",{className:"w-full touch-none rounded-(--gryt-radius-sm) border border-gryt-border bg-gryt-surface-raised",onPointerDown:T=>{if(a)return;const P=h(T.clientX,T.clientY);if(P===null)return;const A=(E,V)=>(P.x-E)**2+(P.y-V)**2;g(A(m,f)<=A(y,b)?0:1),T.currentTarget.setPointerCapture(T.pointerId)},onPointerMove:v,onPointerUp:T=>{g(null),T.currentTarget.releasePointerCapture(T.pointerId)},preserveAspectRatio:"none",ref:l,role:a?"img":"application","aria-label":"Timing curve",style:{height:132},viewBox:`${W.min} ${W.min} ${W.size} ${W.size}`,children:[e.jsx("rect",{fill:"none",height:1,stroke:"var(--gryt-border)",strokeWidth:.004,width:1,x:0,y:0}),t!==void 0?e.jsx("polyline",{fill:"none",opacity:.35,points:t.map((T,P)=>`${P/(t.length-1)},${N(T)}`).join(" "),stroke:"var(--gryt-muted)",strokeWidth:.008}):null,a?e.jsx("polyline",{fill:"none",points:n.map((T,P)=>`${P/(n.length-1)},${N(T)}`).join(" "),stroke:"var(--gryt-accent)",strokeWidth:.014}):e.jsxs(e.Fragment,{children:[e.jsx("line",{stroke:"var(--gryt-muted)",strokeWidth:.005,x1:0,x2:j(m),y1:N(0),y2:N(f)}),e.jsx("line",{stroke:"var(--gryt-muted)",strokeWidth:.005,x1:1,x2:j(y),y1:N(1),y2:N(b)}),e.jsx("path",{d:k,fill:"none",stroke:"var(--gryt-accent)",strokeWidth:.014}),e.jsx("circle",{cx:j(m),cy:N(f),fill:"var(--gryt-accent)",r:c===0?.035:.026}),e.jsx("circle",{cx:j(y),cy:N(b),fill:"var(--gryt-accent)",r:c===1?.035:.026})]})]})}const Ye="custom",rn=[.22,1,.36,1];function on({motion:o,onChange:r}){const t=o??u.grytMotion,n=u.isBezier(t.curve)?t.curve:null,[a,l]=s.useState(n??rn);function c(m){r({...t,curve:m})}const g=t.scale===0;return e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"mb-1 flex items-baseline justify-between gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-gryt-muted",children:"Speed"}),e.jsx("span",{className:"font-mono text-[11px] text-gryt-muted",children:g?"off":`${t.scale.toFixed(2)}× · ${Math.round(u.grytDurations.spring*t.scale)}ms`})]}),e.jsx(ot,{"aria-label":"Animation speed",max:u.GRYT_MOTION_SCALE_MAX,min:0,onValueChange:m=>r({...t,scale:Number(Number(m).toFixed(2))}),step:.05,value:t.scale}),e.jsx("p",{className:"m-0 pt-1 text-[11px] leading-4 text-gryt-muted",children:g?"Nothing animates. A real choice, not a broken one — some people find movement unpleasant.":"One multiplier over every tier, so a drawer stays slower than a button."})]}),e.jsx("div",{className:"min-w-0",children:e.jsx(Ee,{label:"Curve",onValueChange:m=>{const f=String(m);c(f===Ye?a:f)},options:[{label:"Spring — overshoots and settles",value:"spring"},{label:"Smooth — settles without passing",value:"smooth"},{label:"Linear — no easing at all",value:"linear"},{label:"Draw one…",value:Ye}],size:"small",value:n===null?t.curve:Ye})}),n!==null?e.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[e.jsx(yt,{onChange:m=>{l(m),c(m)},reference:u.springSamples,value:n}),e.jsxs("p",{className:"m-0 font-mono text-[11px] text-gryt-muted",children:["cubic-bezier(",n.join(", "),")"]}),e.jsx("p",{className:"m-0 text-[11px] leading-4 text-gryt-muted",children:"The faint line is the shipped spring, to compare against. Anything drawn above the box overshoots — fine on a button, and it throws a drawer outside its own edge, because one curve now does both jobs."})]}):e.jsx(yt,{onChange:c,samples:t.curve==="smooth"?u.springTightSamples:t.curve==="linear"?[0,1]:u.springSamples,value:a}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"text-xs font-medium text-gryt-muted",children:"Preview"}),e.jsx("div",{className:"mt-1 overflow-hidden rounded-(--gryt-radius-sm) border border-gryt-border bg-gryt-surface-raised p-2",children:e.jsx("div",{className:"h-4 w-4 rounded-(--gryt-radius-sm) bg-gryt-accent",style:{animation:g?"none":`gryt-motion-preview ${Math.round(u.grytDurations.springSoft*t.scale)}ms var(--ease-spring) infinite alternate`}},`${t.scale}-${String(t.curve)}`)})]})]})}const nn={pass:S.Check,tight:S.Warning,fail:S.X},bt={pass:"text-gryt-success-11",tight:"text-gryt-warning-11",fail:"text-gryt-danger-11"};function an({checks:o,onRepair:r}){const t=o.filter(n=>!n.advisory&&n.level==="fail").length;return e.jsxs("section",{className:"min-w-0",children:[e.jsxs("header",{className:"flex items-center justify-between gap-2 pb-2",children:[e.jsx("h2",{className:"m-0 text-[11px] font-semibold uppercase tracking-wider text-gryt-muted",children:"Contrast"}),t>0?e.jsxs("span",{className:"text-xs text-gryt-danger-11",children:[t," of ",o.length]}):e.jsxs("span",{className:"text-xs text-gryt-muted",children:[o.length," checks pass"]})]}),e.jsx("ul",{className:"m-0 list-none space-y-1 p-0",children:o.map(n=>{const a=n.advisory&&n.level==="fail"?"tight":n.level,l=nn[a];return e.jsxs("li",{className:"flex items-center justify-between gap-2 text-xs",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[e.jsx(l,{"aria-hidden":"true",className:bt[a],size:12}),e.jsx("span",{className:"truncate text-gryt-muted",children:n.label})]}),e.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-gryt-muted",children:[e.jsx("span",{className:a==="pass"?"text-gryt-text":bt[a],children:n.ratio.toFixed(1)}),e.jsxs("span",{"aria-hidden":"true",children:[" / ",n.min]}),e.jsxs("span",{className:"sr-only",children:[" against a minimum of ",n.min]}),!n.advisory&&n.ratio>=7?e.jsx("span",{className:"pl-1.5 text-[10px] text-gryt-success-11",children:"AAA"}):null]})]},n.id)})}),r?e.jsx("div",{className:"pt-3",children:e.jsx(Q,{onClick:r,size:"small",tone:"neutral",children:"Fix the text colours"})}):null]})}function ce({label:o,steps:r}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"mb-1 block text-[11px] font-medium tracking-wide text-gryt-muted",children:o}),e.jsx("ol",{className:"m-0 flex list-none gap-px overflow-hidden rounded-(--gryt-radius-sm) border border-gryt-border p-0",children:r.map((t,n)=>e.jsx("li",{className:"h-6 min-w-0 flex-1",style:{backgroundColor:t},title:`${o} ${n+1} · ${t}`},`${o}-${n}`))})]})}const sn=[{family:"accent",label:"Accent"},{family:"secondary",label:"Secondary"},{family:"success",label:"Success"},{family:"danger",label:"Danger"},{family:"warning",label:"Warning"}];function ln(o,r){return o<r?"fail":o<r*1.1?"tight":"pass"}function re(o,r,t,n,a,l,c=!1){const g=u.contrast(t,n);return{id:o,label:r,foreground:t,background:n,ratio:g,min:a,level:ln(g,a),advisory:c,paths:l}}function cn(o,r,t){const n=q(r,"neutral"),a=n[0],l=n[1],c=n[11],g=n[10],m=n[5],f=t,y=Qe(o,t),b=Ie(o,t),h=[re("text-page","Text on the page",c,a,4.5,[`${f}.text`,`${f}.bg`]),re("text-surface","Text on a surface",c,l,4.5,[`${f}.text`,`${f}.surface`]),re("muted-page","Muted text on the page",g,a,4.5,[`${f}.muted`,`${f}.bg`]),re("muted-surface","Muted text on a surface",g,l,4.5,[`${f}.muted`,`${f}.surface`])];for(const{family:j,label:N}of sn){const k=q(r,j);h.push(re(`${j}-text`,`${N} text on the page`,k[10],a,4.5,[`${y}.${j}`,`${f}.bg`]))}const v=[{family:"accent",on:"onAccent",label:"Label on a filled button"},{family:"secondary",on:"onSecondary",label:"Label on a secondary button"},{family:"danger",on:"onDanger",label:"Label on a danger button"}];for(const{family:j,on:N,label:k}of v)h.push(re(`${N}-fill`,k,b[N],q(r,j)[8],4.5,[`${y}.${N}`,`${y}.${j}`]));return h.push(re("border-page","Border against the page",m,a,1.15,[`${f}.border`,`${f}.bg`],!0)),h}function C(o,r){return o+Math.random()*(r-o)}function Ue(o){return o[Math.floor(Math.random()*o.length)]}const dn=[{sm:8,md:12,lg:20,xl:28,full:999},{sm:6,md:8,lg:14,xl:18,full:999},{sm:4,md:6,lg:10,xl:14,full:8},{sm:2,md:4,lg:6,xl:8,full:4},{sm:10,md:16,lg:24,xl:32,full:999}];function un(){const o=C(0,360),r=Ue([.4,.8,1.4,2.2]),t=o+Ue([-1,1])*C(110,200),n=(h,v,j=o)=>u.oklchToHex({l:h,c:v*r,h:j}),a=C(.15,.21),l={bg:n(a,.011),surface:n(a+.045,.014),surfaceRaised:n(a+.062,.016),surfaceHover:n(a+.125,.022),border:n(a+.125,.024),muted:n(C(.62,.665),.008),text:n(C(.9,.925),.008)},c=C(.95,.968),g={bg:n(c,.006),surface:n(C(.995,1),.001),surfaceRaised:n(c+.016,.004),surfaceHover:n(c-.035,.01),border:n(C(.878,.9),.014),muted:n(C(.46,.5),.014),text:n(C(.23,.27),.014)},m=u.oklchToHex({l:C(.67,.74),c:C(.13,.17),h:o}),f=u.oklchToHex({l:C(.79,.85),c:C(.09,.13),h:t}),y=u.oklchToHex({l:C(.67,.72),c:C(.15,.19),h:C(18,30)}),b={accent:m,accentLight:Ve(m,.085),secondary:f,secondaryLight:Ve(f,.07),success:u.oklchToHex({l:C(.8,.85),c:C(.15,.19),h:C(140,156)}),danger:y,dangerLight:Ve(y,.08),warning:u.oklchToHex({l:C(.82,.86),c:C(.14,.17),h:C(72,90)}),onAccent:"",onSecondary:"",onDanger:""};return b.onAccent=ae(m),b.onSecondary=ae(f),b.onDanger=ae(y),{hue:b,lightHue:null,dark:l,light:g,radius:{...Ue(dn)}}}function Ve(o,r){const{l:t,c:n,h:a}=u.hexToOklch(o);return u.oklchToHex({l:Math.min(.97,t+r),c:n*.85,h:a})}function ae(o){const{c:r,h:t}=u.hexToOklch(o),n=u.oklchToHex({l:.17,c:Math.min(.05,r*.3),h:t}),a=u.oklchToHex({l:.97,c:Math.min(.03,r*.2),h:t}),l=u.contrast(n,o)>=u.contrast(a,o)?n:a;return Te(l,o,7)}function Ne(o){return{...o,onAccent:ae(o.accent),onSecondary:ae(o.secondary),onDanger:ae(o.danger)}}function de(o){const r=Ne(o);return r.onAccent===o.onAccent&&r.onSecondary===o.onSecondary&&r.onDanger===o.onDanger}function Te(o,r,t){if(u.contrast(o,r)>=t)return o;const{l:n,c:a,h:l}=u.hexToOklch(o),c=n>=u.hexToOklch(r).l?1:-1;let g=n;for(let m=0;m<120;m++){g=Math.min(1,Math.max(0,g+c*.008));const f=u.oklchToHex({l:g,c:a,h:l});if(u.contrast(f,r)>=t)return f;if(g===0||g===1)break}return c===1?"#ffffff":"#000000"}function gn(o){const r=_t(o);for(const t of["dark","light"])r[t].text=Te(r[t].text,r[t].bg,7),r[t].text=Te(r[t].text,r[t].surface,7),r[t].muted=Te(r[t].muted,r[t].bg,4.5),r[t].muted=Te(r[t].muted,r[t].surface,4.5);for(const t of[r.hue,r.lightHue])if(t!==null)for(const[n,a]of[["onAccent","accent"],["onSecondary","secondary"],["onDanger","danger"]]){const l=t[a];u.contrast(t[n],l)<7&&(t[n]=ae(l))}return r}function mn(o){return o==="light"?{...u.grytTokens.color,...u.grytLightTokens}:{...u.grytTokens.color}}function fn(o,r){const t=mn(r);return Object.entries(Xo(o,r)).filter(([n,a])=>u.normalizeHexColor(a)!==u.normalizeHexColor(t[n]??""))}function xn(o){return Gt.filter(r=>o.radius[r]!==u.grytTokens.radius[r]).map(r=>[r,o.radius[r]])}function ht(o,r){const t=[];r==="light"&&t.push(' appearance: "light",');const n=fn(o,r);n.length>0&&(t.push(" color: {"),n.forEach(([c,g],m)=>{const f=m===n.length-1?"":",";t.push(` ${c}: "${u.normalizeHexColor(g)}"${f}`)}),t.push(" },"));const a=xn(o);a.length>0&&t.push(` radius: { ${a.map(([c,g])=>`${c}: ${g}`).join(", ")} }`);const l=t.length-1;return l>=0&&(t[l]=t[l].replace(/,$/,"")),t.length===0?"":`{
2
+ ${t.join(`
3
3
  `)}
4
- }`}function qo(n){const t=nt(n,"dark"),e=nt(n,"light");return`import { createGrytTheme, GrytProvider } from "@gryt/ui";
4
+ }`}function pn(o){const r=ht(o,"dark"),t=ht(o,"light");return`import { createGrytTheme, GrytProvider } from "@gryt/ui";
5
5
 
6
6
  // One call per appearance. The scales are regenerated from these anchors, so
7
7
  // every component moves with them — not just the tokens named here.
8
- const dark = createGrytTheme(${t});
8
+ const dark = createGrytTheme(${r});
9
9
 
10
- const light = createGrytTheme(${e});
10
+ const light = createGrytTheme(${t});
11
11
 
12
12
  export function App({ appearance }: { appearance: "dark" | "light" }) {
13
13
  return (
@@ -15,5 +15,5 @@ export function App({ appearance }: { appearance: "dark" | "light" }) {
15
15
  {/* your app */}
16
16
  </GrytProvider>
17
17
  );
18
- }`}function Yo(n){return JSON.stringify(n,null,2)}function vt(n){const t=n.trim();if(t==="")return{error:"Nothing to import."};const e=c.decodeGrytTheme(t);return e===null?{error:t.startsWith("{")?"No theme in that JSON.":"No theme in that link."}:{draft:e.theme,appearance:e.appearance}}const ye={sm:24,md:32,lg:48,xl:64,full:40},Le=999,Vo=["bg","surface","surfaceRaised","surfaceHover","border"],Uo=["text","muted"];function Xo({value:n,onChange:t,appearance:e,onAppearanceChange:o,remoteFontsAllowed:a=!0,actions:d,footer:u,className:p}){const[m,f]=i.useState(()=>te(n.hue)&&(n.lightHue===null||te(n.lightHue))),[x,y]=i.useState(null);if(x!==null&&x!==n){y(null);const l=te(n.hue)&&(n.lightHue===null||te(n.lightHue));l!==m&&f(l)}const[b,h]=i.useState(""),[w,j]=i.useState(null),P=i.useMemo(()=>wt(n,e),[n,e]),v=i.useMemo(()=>Go(n,P,e),[n,P,e]),S=i.useMemo(()=>{const l=new Map;for(const g of v)if(!(g.advisory||g.level!=="fail"))for(const C of g.paths)l.has(C)||l.set(C,`${g.label}: ${g.ratio.toFixed(1)}, needs ${g.min}`);return l},[v]),M=Qe(n),O=c.grytPresets.find(l=>Qe(l.theme)===M)?.id??"custom",Q=n[e],Ne=_e(n,e),Te=he(n,e),Tt=v.filter(l=>!l.advisory&&l.level==="fail").length;function pe(l){y(l),t(l)}function Y(l){const g=l(n);pe(m?{...g,hue:ce(g.hue),lightHue:g.lightHue===null?null:ce(g.lightHue)}:g)}function Se(l){f(te(l.hue)&&(l.lightHue===null||te(l.lightHue))),pe(l)}function Pe(l,g){Y(C=>{const Ce=_e(C,e);return{...C,[Ce]:{...he(C,e),[l]:g}}})}function St(l){Y(g=>({...g,lightHue:l?{...g.hue}:null}))}function Pt(l){f(l),l&&pe({...n,hue:ce(n.hue),lightHue:n.lightHue===null?null:ce(n.lightHue)})}function qe(l,g){Y(C=>({...C,[e]:{...C[e],[l]:g}}))}function Ct(l){Y(g=>({...g,name:l===""?void 0:l}))}function Rt(l,g){Y(C=>({...C,fonts:{...C.fonts??c.grytFonts,[l]:g}}))}function kt(l){Y(g=>({...g,motion:l}))}function At(l,g){Y(C=>({...C,radius:{...C.radius,[l]:g}}))}function Mt(l){const g=vt(l);if(g.error!==void 0||g.draft===void 0){j(g.error??"That did not look like a theme.");return}Se(g.draft),g.appearance!==void 0&&o(g.appearance),j(null),h("")}return r.jsxs("div",{className:s("flex min-w-0 flex-col gap-(--space-md)",p),children:[r.jsxs("div",{className:"flex flex-wrap items-end gap-3 border-y border-gryt-border py-3",children:[r.jsx("div",{className:"w-52",children:r.jsx(ve,{label:"Preset",onValueChange:l=>{const g=c.grytPresetsById.get(String(l));g&&Se(g.theme)},options:[...c.grytPresets.map(l=>({label:l.name,value:l.id})),...O==="custom"?[{label:"Custom",value:"custom"}]:[]],size:"small",value:O})}),r.jsx("div",{className:"w-48",children:r.jsx(we,{label:"Name",maxLength:c.GRYT_THEME_NAME_MAX,onChange:l=>Ct(l.target.value),placeholder:"Untitled theme",size:"small",value:n.name??""})}),r.jsxs(ge,{onClick:()=>Se(Ho()),size:"small",tone:"neutral",children:[r.jsx(k.ArrowsClockwise,{"aria-hidden":"true",size:15}),"Generate"]}),r.jsxs("div",{className:"ml-auto flex items-end gap-3",children:[r.jsxs(yt,{"aria-label":"Appearance",onValueChange:l=>{const g=l[l.length-1];(g==="dark"||g==="light")&&o(g)},value:[e],children:[r.jsx(He,{size:"small",value:"dark",children:"Dark"}),r.jsx(He,{size:"small",value:"light",children:"Light"})]}),d]})]}),r.jsxs("p",{className:"m-0 text-xs text-gryt-muted",children:["Editing the ",e," half. The neutrals below belong to it",n.lightHue===null?"; the hues are shared, because step 9 is the same colour in both.":" and so do the hues."]}),r.jsxs("div",{className:"flex flex-col gap-2",children:[e==="light"?r.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-gryt-muted",children:[r.jsx(Fe,{checked:n.lightHue!==null,onCheckedChange:St}),"Light has its own hues"]}):null,r.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-gryt-muted",children:[r.jsx(Fe,{checked:m,onCheckedChange:Pt}),"Pick label colours automatically"]})]}),r.jsxs("div",{className:"flex flex-col gap-(--space-md)",children:[r.jsxs(_,{title:"Surfaces",children:[Vo.map(l=>r.jsx(le,{label:Ze[l],onChange:g=>qe(l,g),value:Q[l],warning:S.get(`${e}.${l}`)},l)),r.jsx(ee,{label:"neutral",steps:L(P,"neutral")})]}),r.jsx(_,{title:"Text",children:Uo.map(l=>r.jsx(le,{label:Ze[l],onChange:g=>qe(l,g),value:Q[l],warning:S.get(`${e}.${l}`)},l))}),r.jsxs(_,{title:"Accent",children:[["accent","accentLight","onAccent"].map(l=>r.jsx(le,{disabled:m&&l==="onAccent",label:Ae[l],onChange:g=>Pe(l,g),value:Te[l],warning:S.get(`${Ne}.${l}`)},l)),r.jsx(ee,{label:"accent",steps:L(P,"accent")})]}),r.jsxs(_,{title:"Secondary",children:[["secondary","secondaryLight","onSecondary"].map(l=>r.jsx(le,{disabled:m&&l==="onSecondary",label:Ae[l],onChange:g=>Pe(l,g),value:Te[l],warning:S.get(`${Ne}.${l}`)},l)),r.jsx(ee,{label:"secondary",steps:L(P,"secondary")})]}),r.jsxs(_,{title:"Status",children:[["success","danger","dangerLight","onDanger","warning"].map(l=>r.jsx(le,{disabled:m&&l==="onDanger",label:Ae[l],onChange:g=>Pe(l,g),value:Te[l],warning:S.get(`${Ne}.${l}`)},l)),r.jsx(ee,{label:"success",steps:L(P,"success")}),r.jsx(ee,{label:"danger",steps:L(P,"danger")}),r.jsx(ee,{label:"warning",steps:L(P,"warning")})]}),r.jsx(_,{title:"Type",children:c.GRYT_FONT_KEYS.map(l=>r.jsx(Ao,{fonts:n.fonts,onChange:g=>Rt(l,g),remoteAllowed:a,role:l},l))}),r.jsx(_,{title:"Motion",children:r.jsx($o,{motion:n.motion,onChange:kt})}),r.jsx(_,{title:"Radius",children:bt.map(l=>{const g=n.radius[l],C=l==="full"&&g>=Le?ye.full:g;return r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"mb-1 flex items-baseline justify-between gap-2",children:[r.jsx("span",{className:"text-xs font-medium text-gryt-muted",children:et[l]}),r.jsx("span",{className:"font-mono text-[11px] text-gryt-muted",children:g>=Le?"pill":`${g}px`})]}),r.jsx(Be,{"aria-label":`${et[l]} radius`,max:ye[l],min:0,onValueChange:Ce=>{const Ye=Number(Ce);At(l,l==="full"&&Ye>=ye.full?Le:Ye)},value:Math.min(C,ye[l])}),r.jsx("p",{className:"m-0 pt-1 text-[11px] text-gryt-muted",children:So[l]})]},l)})}),r.jsx(Io,{checks:v,onRepair:Tt>0?()=>pe(_o(n)):void 0}),r.jsxs("section",{className:"min-w-0",children:[r.jsx("h2",{className:"m-0 pb-2 text-[11px] font-semibold uppercase tracking-wider text-gryt-muted",children:"Load one back"}),r.jsx("p",{className:"m-0 pb-2 text-sm text-gryt-muted",children:"Paste a theme’s JSON, or a link somebody sent you."}),r.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[r.jsx("textarea",{"aria-label":"Theme JSON or a shared link",className:"min-h-11 flex-1 rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface-raised px-4 py-2.5 font-mono text-sm text-gryt-text outline-none placeholder:text-gryt-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",onChange:l=>h(l.target.value),placeholder:"{ …",rows:2,spellCheck:!1,value:b}),r.jsx(ge,{onClick:()=>Mt(b),tone:"neutral",children:"Load"})]}),w?r.jsx("p",{className:"m-0 pt-2 text-sm text-gryt-danger-11",children:w}):null]}),u]})]})}function _({title:n,children:t}){return r.jsxs("section",{className:"min-w-0",children:[r.jsx("h2",{className:"m-0 pb-2 text-[11px] font-semibold uppercase tracking-wider text-gryt-muted",children:n}),r.jsx("div",{className:"flex flex-col gap-3",children:t})]})}const Wo={primary:"bg-gryt-accent",success:"bg-gryt-success",warning:"bg-gryt-warning",danger:"bg-gryt-danger"};function Ko({className:n,value:t,label:e,showValue:o=!1,tone:a="primary",...d}){return r.jsxs(ie.Meter.Root,{value:t,className:s("gryt-meter flex w-full flex-col gap-1.5",n),...d,children:[(e||o)&&r.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[e?r.jsx(ie.Meter.Label,{className:"text-sm text-gryt-muted",children:e}):r.jsx("span",{}),o&&r.jsx(ie.Meter.Value,{className:"font-mono text-xs text-gryt-muted tabular-nums"})]}),r.jsx(ie.Meter.Track,{className:"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised",children:r.jsx(ie.Meter.Indicator,{className:s("h-full rounded-(--gryt-radius-full)","transition-[width] duration-120 ease-out motion-reduce:transition-none",Wo[a])})})]})}const Jo=i.forwardRef(function({className:t,...e},o){return r.jsx(B.AlertDialog.Popup,{ref:o,className:s("gryt-alert-dialog fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2","flex w-[32rem] max-w-[calc(100vw-3rem)] flex-col gap-4","rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text","outline-none","transition-[opacity,scale] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0",t),...e})}),Qo=i.forwardRef(function({className:t,...e},o){return r.jsx(B.AlertDialog.Backdrop,{ref:o,className:s("gryt-alert-dialog-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)","transition-opacity duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:opacity-0 data-ending-style:opacity-0",t),...e})}),Zo=i.forwardRef(function({className:t,...e},o){return r.jsx(B.AlertDialog.Title,{ref:o,className:s("gryt-alert-dialog-title text-lg font-semibold text-gryt-text",t),...e})}),en=i.forwardRef(function({className:t,...e},o){return r.jsx(B.AlertDialog.Description,{ref:o,className:s("gryt-alert-dialog-description text-sm leading-6 text-gryt-muted",t),...e})}),tn={Root:B.AlertDialog.Root,Trigger:B.AlertDialog.Trigger,Portal:B.AlertDialog.Portal,Backdrop:Qo,Popup:Jo,Title:Zo,Description:en,Close:B.AlertDialog.Close},jt=["flex cursor-default items-center gap-2 rounded-(--gryt-radius-md)","px-3 py-2 text-sm text-gryt-text outline-none select-none","data-highlighted:bg-gryt-surface-raised","data-selected:text-gryt-accent-11","data-disabled:cursor-not-allowed data-disabled:opacity-50"].join(" "),Nt=[dt,ut.medium,"border-gryt-border",A].join(" "),rn=i.forwardRef(function({className:t,...e},o){return r.jsx(T.Combobox.Input,{ref:o,className:s("gryt-combobox-input",Nt,t),...e})}),on=i.forwardRef(function({className:t,sideOffset:e=6,...o},a){return r.jsx(T.Combobox.Positioner,{ref:a,sideOffset:e,className:s("gryt-combobox-positioner outline-none",t),...o})}),nn=i.forwardRef(function({className:t,...e},o){return r.jsx(T.Combobox.Popup,{ref:o,className:s("gryt-combobox max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none",J,q,t),...e})}),an=i.forwardRef(function({className:t,...e},o){return r.jsx(T.Combobox.Item,{ref:o,className:s("gryt-combobox-item",jt,t),...e})}),sn=i.forwardRef(function({className:t,...e},o){return r.jsx(T.Combobox.Empty,{ref:o,className:s("gryt-combobox-empty px-3 py-2 text-sm text-gryt-muted",t),...e})}),ln={Root:T.Combobox.Root,Input:rn,InputGroup:T.Combobox.InputGroup,Trigger:T.Combobox.Trigger,Icon:T.Combobox.Icon,Clear:T.Combobox.Clear,Value:T.Combobox.Value,Chips:T.Combobox.Chips,Chip:T.Combobox.Chip,ChipRemove:T.Combobox.ChipRemove,Portal:T.Combobox.Portal,Positioner:on,Popup:nn,List:T.Combobox.List,Item:an,ItemIndicator:T.Combobox.ItemIndicator,Group:T.Combobox.Group,GroupLabel:T.Combobox.GroupLabel,Empty:sn,Separator:T.Combobox.Separator},cn=i.forwardRef(function({className:t,...e},o){return r.jsx(R.Autocomplete.Input,{ref:o,className:s("gryt-autocomplete-input",Nt,t),...e})}),dn=i.forwardRef(function({className:t,sideOffset:e=6,...o},a){return r.jsx(R.Autocomplete.Positioner,{ref:a,sideOffset:e,className:s("gryt-autocomplete-positioner outline-none",t),...o})}),un=i.forwardRef(function({className:t,...e},o){return r.jsx(R.Autocomplete.Popup,{ref:o,className:s("gryt-autocomplete max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none",J,q,t),...e})}),gn=i.forwardRef(function({className:t,...e},o){return r.jsx(R.Autocomplete.Item,{ref:o,className:s("gryt-autocomplete-item",jt,t),...e})}),mn=i.forwardRef(function({className:t,...e},o){return r.jsx(R.Autocomplete.Empty,{ref:o,className:s("gryt-autocomplete-empty px-3 py-2 text-sm text-gryt-muted",t),...e})}),pn={Root:R.Autocomplete.Root,Input:cn,InputGroup:R.Autocomplete.InputGroup,Trigger:R.Autocomplete.Trigger,Icon:R.Autocomplete.Icon,Clear:R.Autocomplete.Clear,Value:R.Autocomplete.Value,Portal:R.Autocomplete.Portal,Positioner:dn,Popup:un,List:R.Autocomplete.List,Item:gn,Group:R.Autocomplete.Group,GroupLabel:R.Autocomplete.GroupLabel,Empty:mn,Separator:R.Autocomplete.Separator},fn=i.forwardRef(function({className:t,...e},o){return r.jsx(Ft.CheckboxGroup,{ref:o,className:s("gryt-checkbox-group flex flex-col gap-2",t),...e})}),xn=i.forwardRef(function({className:t,...e},o){return r.jsx(ze.Collapsible.Trigger,{ref:o,className:s("gryt-collapsible-trigger flex w-full items-center justify-between gap-2","rounded-(--gryt-radius-md) border-0 bg-transparent px-2 py-2 text-left","text-sm font-medium text-gryt-text select-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none",A,t),...e})}),yn=i.forwardRef(function({className:t,...e},o){return r.jsx(ze.Collapsible.Panel,{ref:o,className:s("gryt-collapsible-panel overflow-hidden","h-(--collapsible-panel-height) transition-[height] duration-(--gryt-dur-spring) ease-spring","data-starting-style:h-0 data-ending-style:h-0","motion-reduce:transition-none",t),...e})}),bn={Root:ze.Collapsible.Root,Trigger:xn,Panel:yn},hn=i.forwardRef(function({className:t,...e},o){return r.jsx(Ht.Form,{ref:o,className:s("gryt-form flex flex-col gap-(--gryt-space-lg)",t),...e})}),wn=i.forwardRef(function({className:t,...e},o){return r.jsx(it.Fieldset.Root,{ref:o,className:s("gryt-fieldset flex min-w-0 flex-col gap-3 border-0 p-0",t),...e})}),vn=i.forwardRef(function({className:t,...e},o){return r.jsx(it.Fieldset.Legend,{ref:o,className:s("gryt-fieldset-legend text-sm font-semibold text-gryt-text",t),...e})}),jn={Root:wn,Legend:vn},Nn=i.forwardRef(function({className:t,...e},o){return r.jsx(_t.Menubar,{ref:o,className:s("gryt-menubar flex items-center gap-1","rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface p-1",t),...e})}),Tn=i.forwardRef(function({className:t,...e},o){return r.jsx(D.NavigationMenu.Trigger,{ref:o,className:s("gryt-navigation-menu-trigger flex items-center gap-1.5 rounded-(--gryt-radius-md)","border-0 bg-transparent px-3 py-2 text-sm font-medium text-gryt-text select-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none","data-popup-open:bg-gryt-surface-raised",A,t),...e})}),Sn=i.forwardRef(function({className:t,...e},o){return r.jsx(D.NavigationMenu.Popup,{ref:o,className:s("gryt-navigation-menu-popup outline-none",J,q,t),...e})}),Pn=i.forwardRef(function({className:t,...e},o){return r.jsx(D.NavigationMenu.Positioner,{ref:o,className:s("gryt-navigation-menu-positioner outline-none",t),...e})}),Cn=i.forwardRef(function({className:t,...e},o){return r.jsx(D.NavigationMenu.Viewport,{ref:o,className:s("gryt-navigation-menu-viewport relative overflow-hidden",t),...e})}),Rn=i.forwardRef(function({className:t,...e},o){return r.jsx(D.NavigationMenu.Link,{ref:o,className:s("gryt-navigation-menu-link block rounded-(--gryt-radius-md) px-3 py-2","text-sm text-gryt-text no-underline outline-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none",A,t),...e})}),kn={Root:D.NavigationMenu.Root,List:D.NavigationMenu.List,Item:D.NavigationMenu.Item,Trigger:Tn,Content:D.NavigationMenu.Content,Portal:D.NavigationMenu.Portal,Positioner:Pn,Viewport:Cn,Popup:Sn,Link:Rn,Icon:D.NavigationMenu.Icon,Arrow:D.NavigationMenu.Arrow},at="flex h-9 w-9 shrink-0 items-center justify-center border-0 bg-transparent text-gryt-muted transition-colors hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text motion-reduce:transition-none disabled:cursor-not-allowed disabled:opacity-50",An=i.forwardRef(function({className:t,label:e,scrubbable:o=!1,...a},d){return r.jsxs(V.NumberField.Root,{ref:d,className:s("gryt-number-field flex flex-col gap-1.5",t),...a,children:[e&&(o?r.jsxs(V.NumberField.ScrubArea,{className:"cursor-ew-resize text-sm text-gryt-muted select-none",children:[e,r.jsx(V.NumberField.ScrubAreaCursor,{})]}):r.jsx("span",{className:"text-sm text-gryt-muted",children:e})),r.jsxs(V.NumberField.Group,{className:s("flex w-fit items-center overflow-hidden rounded-(--gryt-radius-full)","border border-gryt-border bg-gryt-surface-raised","focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-gryt-accent-light",ae),children:[r.jsx(V.NumberField.Decrement,{"aria-label":"Decrease",className:s(at,"rounded-l-(--gryt-radius-full)"),children:r.jsx(k.Minus,{size:14,weight:"bold"})}),r.jsx(V.NumberField.Input,{className:s("w-16 border-0 bg-transparent px-1 py-2 text-center","font-mono text-sm text-gryt-text tabular-nums outline-none",A)}),r.jsx(V.NumberField.Increment,{"aria-label":"Increase",className:s(at,"rounded-r-(--gryt-radius-full)"),children:r.jsx(k.Plus,{size:14,weight:"bold"})})]})]})}),Mn=i.forwardRef(function({className:t,length:e=6,...o},a){return r.jsx(We.OTPField.Root,{ref:a,length:e,className:s("gryt-otp-field flex gap-2",t),...o,children:Array.from({length:e},(d,u)=>r.jsx(We.OTPField.Input,{className:s("gryt-otp-input h-12 w-10 rounded-(--gryt-radius-md) text-center","border border-gryt-border bg-gryt-surface-raised","font-mono text-lg text-gryt-text tabular-nums outline-none","transition-colors duration-(--gryt-dur-fast) motion-reduce:transition-none","data-filled:border-gryt-accent",A)},u))})}),$n=i.forwardRef(function({className:t,sideOffset:e=8,...o},a){return r.jsx(re.PreviewCard.Positioner,{ref:a,sideOffset:e,className:s("gryt-preview-card-positioner outline-none",t),...o})}),Dn=i.forwardRef(function({className:t,...e},o){return r.jsx(re.PreviewCard.Popup,{ref:o,className:s("gryt-preview-card w-64 max-w-[calc(100vw-2rem)] p-4 outline-none",J,q,t),...e})}),In={Root:re.PreviewCard.Root,Trigger:re.PreviewCard.Trigger,Portal:re.PreviewCard.Portal,Positioner:$n,Popup:Dn,Arrow:re.PreviewCard.Arrow},On=i.forwardRef(function({className:t,...e},o){return r.jsx(oe.Toolbar.Root,{ref:o,className:s("gryt-toolbar flex items-center gap-1","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1",t),...e})}),Ln=i.forwardRef(function({className:t,...e},o){return r.jsx(oe.Toolbar.Separator,{ref:o,className:s("gryt-toolbar-separator mx-1 h-6 w-px bg-gryt-border",t),...e})}),Gn={Root:On,Group:oe.Toolbar.Group,Button:oe.Toolbar.Button,Link:oe.Toolbar.Link,Input:oe.Toolbar.Input,Separator:Ln};Object.defineProperty(exports,"GRYT_FONT_KEYS",{enumerable:!0,get:()=>c.GRYT_FONT_KEYS});Object.defineProperty(exports,"GRYT_FONT_STACK_MAX",{enumerable:!0,get:()=>c.GRYT_FONT_STACK_MAX});Object.defineProperty(exports,"GRYT_HUE_KEYS",{enumerable:!0,get:()=>c.GRYT_HUE_KEYS});Object.defineProperty(exports,"GRYT_MOTION_CURVES",{enumerable:!0,get:()=>c.GRYT_MOTION_CURVES});Object.defineProperty(exports,"GRYT_MOTION_SCALE_MAX",{enumerable:!0,get:()=>c.GRYT_MOTION_SCALE_MAX});Object.defineProperty(exports,"GRYT_NEUTRAL_KEYS",{enumerable:!0,get:()=>c.GRYT_NEUTRAL_KEYS});Object.defineProperty(exports,"GRYT_RADIUS_KEYS",{enumerable:!0,get:()=>c.GRYT_RADIUS_KEYS});Object.defineProperty(exports,"GRYT_THEME_NAME_MAX",{enumerable:!0,get:()=>c.GRYT_THEME_NAME_MAX});Object.defineProperty(exports,"alphaScale",{enumerable:!0,get:()=>c.alphaScale});Object.defineProperty(exports,"cloneGrytTheme",{enumerable:!0,get:()=>c.cloneGrytTheme});Object.defineProperty(exports,"contrast",{enumerable:!0,get:()=>c.contrast});Object.defineProperty(exports,"createGrytTheme",{enumerable:!0,get:()=>c.createGrytTheme});Object.defineProperty(exports,"decodeGrytTheme",{enumerable:!0,get:()=>c.decodeGrytTheme});Object.defineProperty(exports,"encodeDraft",{enumerable:!0,get:()=>c.encodeGrytTheme});Object.defineProperty(exports,"encodeGrytTheme",{enumerable:!0,get:()=>c.encodeGrytTheme});Object.defineProperty(exports,"grytAlphaScales",{enumerable:!0,get:()=>c.grytAlphaScales});Object.defineProperty(exports,"grytAlphaScalesLight",{enumerable:!0,get:()=>c.grytAlphaScalesLight});Object.defineProperty(exports,"grytFonts",{enumerable:!0,get:()=>c.grytFonts});Object.defineProperty(exports,"grytLightTokens",{enumerable:!0,get:()=>c.grytLightTokens});Object.defineProperty(exports,"grytMotion",{enumerable:!0,get:()=>c.grytMotion});Object.defineProperty(exports,"grytPresets",{enumerable:!0,get:()=>c.grytPresets});Object.defineProperty(exports,"grytPresetsById",{enumerable:!0,get:()=>c.grytPresetsById});Object.defineProperty(exports,"grytScales",{enumerable:!0,get:()=>c.grytScales});Object.defineProperty(exports,"grytScalesLight",{enumerable:!0,get:()=>c.grytScalesLight});Object.defineProperty(exports,"grytTheme",{enumerable:!0,get:()=>c.grytTheme});Object.defineProperty(exports,"grytThemeHues",{enumerable:!0,get:()=>c.grytThemeHues});Object.defineProperty(exports,"grytThemeToOptions",{enumerable:!0,get:()=>c.grytThemeToOptions});Object.defineProperty(exports,"grytTokens",{enumerable:!0,get:()=>c.grytTokens});Object.defineProperty(exports,"hexToOklch",{enumerable:!0,get:()=>c.hexToOklch});Object.defineProperty(exports,"hexToRgb",{enumerable:!0,get:()=>c.hexToRgb});Object.defineProperty(exports,"hueScale",{enumerable:!0,get:()=>c.hueScale});Object.defineProperty(exports,"hueScaleLight",{enumerable:!0,get:()=>c.hueScaleLight});Object.defineProperty(exports,"isBezier",{enumerable:!0,get:()=>c.isBezier});Object.defineProperty(exports,"isFontStack",{enumerable:!0,get:()=>c.isFontStack});Object.defineProperty(exports,"isHexColor",{enumerable:!0,get:()=>c.isHexColor});Object.defineProperty(exports,"isValidBezier",{enumerable:!0,get:()=>c.isValidBezier});Object.defineProperty(exports,"neutralScale",{enumerable:!0,get:()=>c.neutralScale});Object.defineProperty(exports,"neutralScaleLight",{enumerable:!0,get:()=>c.neutralScaleLight});Object.defineProperty(exports,"normalizeHexColor",{enumerable:!0,get:()=>c.normalizeHexColor});Object.defineProperty(exports,"normalizeThemeName",{enumerable:!0,get:()=>c.normalizeThemeName});Object.defineProperty(exports,"oklchToHex",{enumerable:!0,get:()=>c.oklchToHex});Object.defineProperty(exports,"rgbToHex",{enumerable:!0,get:()=>c.rgbToHex});Object.defineProperty(exports,"avatarSeed",{enumerable:!0,get:()=>Ge.avatarSeed});exports.Accordion=Zr;exports.Alert=br;exports.AlertDialog=tn;exports.Autocomplete=pn;exports.Avatar=mt;exports.Badge=or;exports.Button=ge;exports.Card=mr;exports.CardActions=xr;exports.CardContent=fr;exports.CardHeader=pr;exports.Checkbox=Fe;exports.CheckboxGroup=fn;exports.Chip=ar;exports.Collapsible=bn;exports.Combobox=ln;exports.Composer=er;exports.ContextMenu=to;exports.ConversationItem=rr;exports.Dialog=Rr;exports.Divider=gr;exports.Drawer=Hr;exports.Fieldset=jn;exports.Form=hn;exports.GrytProvider=zt;exports.IconButton=Jt;exports.Menu=be;exports.Menubar=Nn;exports.MessageBubble=Zt;exports.Meter=Ko;exports.NavigationMenu=kn;exports.NumberField=An;exports.OtpField=Mn;exports.Popover=so;exports.PreviewCard=In;exports.Progress=hr;exports.Radio=sr;exports.RadioGroup=ir;exports.ScrollArea=wo;exports.Select=ve;exports.Skeleton=jr;exports.Slider=Be;exports.Spinner=wr;exports.Surface=Qt;exports.Switch=lr;exports.Tab=xt;exports.Tabs=Xr;exports.TextField=we;exports.ThemeEditor=Xo;exports.Toast=fo;exports.Toggle=He;exports.ToggleGroup=yt;exports.Toolbar=Gn;exports.Tooltip=dr;exports.TooltipProvider=ur;exports.cloneDraft=ht;exports.cn=s;exports.grytDraft=No;exports.importTheme=vt;exports.themeCode=qo;exports.themeJson=Yo;exports.themeStyle=wt;exports.useMediaQuery=ft;exports.useToastManager=xo;
18
+ }`}function yn(o){return JSON.stringify(o,null,2)}function Ht(o){const r=o.trim();if(r==="")return{error:"Nothing to import."};const t=u.decodeGrytTheme(r);return t===null?{error:r.startsWith("{")?"No theme in that JSON.":"No theme in that link."}:{draft:t.theme,appearance:t.appearance}}const $e={sm:24,md:32,lg:48,xl:64,full:40},We=999,bn=["bg","surface","surfaceRaised","surfaceHover","border"],hn=["text","muted"];function wn({value:o,onChange:r,appearance:t,onAppearanceChange:n,remoteFontsAllowed:a=!0,actions:l,footer:c,className:g}){const[m,f]=s.useState(()=>de(o.hue)&&(o.lightHue===null||de(o.lightHue))),[y,b]=s.useState(null);if(y!==null&&y!==o){b(null);const d=de(o.hue)&&(o.lightHue===null||de(o.lightHue));d!==m&&f(d)}const[h,v]=s.useState(""),[j,N]=s.useState(null),k=s.useMemo(()=>zt(o,t),[o,t]),T=s.useMemo(()=>cn(o,k,t),[o,k,t]),P=s.useMemo(()=>{const d=new Map;for(const x of T)if(!(x.advisory||x.level!=="fail"))for(const $ of x.paths)d.has($)||d.set($,`${x.label}: ${x.ratio.toFixed(1)}, needs ${x.min}`);return d},[T]),A=mt(o),E=u.grytPresets.find(d=>mt(d.theme)===A)?.id??"custom",V=o[t],pe=Qe(o,t),ie=Ie(o,t),Le=T.filter(d=>!d.advisory&&d.level==="fail").length;function O(d){b(d),r(d)}function z(d){const x=d(o);O(m?{...x,hue:Ne(x.hue),lightHue:x.lightHue===null?null:Ne(x.lightHue)}:x)}function ye(d){f(de(d.hue)&&(d.lightHue===null||de(d.lightHue))),O(d)}function p(d,x){z($=>{const Ge=Qe($,t);return{...$,[Ge]:{...Ie($,t),[d]:x}}})}function M(d){z(x=>({...x,lightHue:d?{...x.hue}:null}))}function _(d){f(d),d&&O({...o,hue:Ne(o.hue),lightHue:o.lightHue===null?null:Ne(o.lightHue)})}function Re(d,x){z($=>({...$,[t]:{...$[t],[d]:x}}))}function be(d){z(x=>({...x,name:d===""?void 0:d}))}function Fe(d,x){z($=>({...$,fonts:{...$.fonts??u.grytFonts,[d]:x}}))}function nr(d){z(x=>({...x,motion:d}))}function ar(d,x){z($=>({...$,radius:{...$.radius,[d]:x}}))}function sr(d){const x=Ht(d);if(x.error!==void 0||x.draft===void 0){N(x.error??"That did not look like a theme.");return}ye(x.draft),x.appearance!==void 0&&n(x.appearance),N(null),v("")}return e.jsxs("div",{className:i("flex min-w-0 flex-col gap-(--space-md)",g),children:[e.jsxs("div",{className:"flex flex-wrap items-end gap-3 border-y border-gryt-border py-3",children:[e.jsx("div",{className:"w-52",children:e.jsx(Ee,{label:"Preset",onValueChange:d=>{const x=u.grytPresetsById.get(String(d));x&&ye(x.theme)},options:[...u.grytPresets.map(d=>({label:d.name,value:d.id})),...E==="custom"?[{label:"Custom",value:"custom"}]:[]],size:"small",value:E})}),e.jsx("div",{className:"w-48",children:e.jsx(De,{label:"Name",maxLength:u.GRYT_THEME_NAME_MAX,onChange:d=>be(d.target.value),placeholder:"Untitled theme",size:"small",value:o.name??""})}),e.jsxs(Q,{onClick:()=>ye(un()),size:"small",tone:"neutral",children:[e.jsx(S.ArrowsClockwise,{"aria-hidden":"true",size:15}),"Generate"]}),e.jsxs("div",{className:"ml-auto flex items-end gap-3",children:[e.jsxs(Ft,{"aria-label":"Appearance",onValueChange:d=>{const x=d[d.length-1];(x==="dark"||x==="light")&&n(x)},value:[t],children:[e.jsx(Ze,{size:"small",value:"dark",children:"Dark"}),e.jsx(Ze,{size:"small",value:"light",children:"Light"})]}),l]})]}),e.jsxs("p",{className:"m-0 text-xs text-gryt-muted",children:["Editing the ",t," half. The neutrals below belong to it",o.lightHue===null?"; the hues are shared, because step 9 is the same colour in both.":" and so do the hues."]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[t==="light"?e.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-gryt-muted",children:[e.jsx(Ke,{checked:o.lightHue!==null,onCheckedChange:M}),"Light has its own hues"]}):null,e.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-gryt-muted",children:[e.jsx(Ke,{checked:m,onCheckedChange:_}),"Pick label colours automatically"]})]}),e.jsxs("div",{className:"flex flex-col gap-(--space-md)",children:[e.jsxs(X,{title:"Surfaces",children:[bn.map(d=>e.jsx(ve,{label:ft[d],onChange:x=>Re(d,x),value:V[d],warning:P.get(`${t}.${d}`)},d)),e.jsx(ce,{label:"neutral",steps:q(k,"neutral")})]}),e.jsx(X,{title:"Text",children:hn.map(d=>e.jsx(ve,{label:ft[d],onChange:x=>Re(d,x),value:V[d],warning:P.get(`${t}.${d}`)},d))}),e.jsxs(X,{title:"Accent",children:[["accent","accentLight","onAccent"].map(d=>e.jsx(ve,{disabled:m&&d==="onAccent",label:He[d],onChange:x=>p(d,x),value:ie[d],warning:P.get(`${pe}.${d}`)},d)),e.jsx(ce,{label:"accent",steps:q(k,"accent")})]}),e.jsxs(X,{title:"Secondary",children:[["secondary","secondaryLight","onSecondary"].map(d=>e.jsx(ve,{disabled:m&&d==="onSecondary",label:He[d],onChange:x=>p(d,x),value:ie[d],warning:P.get(`${pe}.${d}`)},d)),e.jsx(ce,{label:"secondary",steps:q(k,"secondary")})]}),e.jsxs(X,{title:"Status",children:[["success","danger","dangerLight","onDanger","warning"].map(d=>e.jsx(ve,{disabled:m&&d==="onDanger",label:He[d],onChange:x=>p(d,x),value:ie[d],warning:P.get(`${pe}.${d}`)},d)),e.jsx(ce,{label:"success",steps:q(k,"success")}),e.jsx(ce,{label:"danger",steps:q(k,"danger")}),e.jsx(ce,{label:"warning",steps:q(k,"warning")})]}),e.jsx(X,{title:"Type",children:u.GRYT_FONT_KEYS.map(d=>e.jsx(tn,{fonts:o.fonts,onChange:x=>Fe(d,x),remoteAllowed:a,role:d},d))}),e.jsx(X,{title:"Motion",children:e.jsx(on,{motion:o.motion,onChange:nr})}),e.jsx(X,{title:"Radius",children:Gt.map(d=>{const x=o.radius[d],$=d==="full"&&x>=We?$e.full:x;return e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"mb-1 flex items-baseline justify-between gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-gryt-muted",children:xt[d]}),e.jsx("span",{className:"font-mono text-[11px] text-gryt-muted",children:x>=We?"pill":`${x}px`})]}),e.jsx(ot,{"aria-label":`${xt[d]} radius`,max:$e[d],min:0,onValueChange:Ge=>{const st=Number(Ge);ar(d,d==="full"&&st>=$e.full?We:st)},value:Math.min($,$e[d])}),e.jsx("p",{className:"m-0 pt-1 text-[11px] text-gryt-muted",children:Ko[d]})]},d)})}),e.jsx(an,{checks:T,onRepair:Le>0?()=>O(gn(o)):void 0}),e.jsxs("section",{className:"min-w-0",children:[e.jsx("h2",{className:"m-0 pb-2 text-[11px] font-semibold uppercase tracking-wider text-gryt-muted",children:"Load one back"}),e.jsx("p",{className:"m-0 pb-2 text-sm text-gryt-muted",children:"Paste a theme’s JSON, or a link somebody sent you."}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx("textarea",{"aria-label":"Theme JSON or a shared link",className:"min-h-11 flex-1 rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface-raised px-4 py-2.5 font-mono text-sm text-gryt-text outline-none placeholder:text-gryt-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",onChange:d=>v(d.target.value),placeholder:"{ …",rows:2,spellCheck:!1,value:h}),e.jsx(Q,{onClick:()=>sr(h),tone:"neutral",children:"Load"})]}),j?e.jsx("p",{className:"m-0 pt-2 text-sm text-gryt-danger-11",children:j}):null]}),c]})]})}function X({title:o,children:r}){return e.jsxs("section",{className:"min-w-0",children:[e.jsx("h2",{className:"m-0 pb-2 text-[11px] font-semibold uppercase tracking-wider text-gryt-muted",children:o}),e.jsx("div",{className:"flex flex-col gap-3",children:r})]})}const Se=1024,Bt=[{id:"svg",label:"SVG",hint:"Any size, a few kB",extension:"svg",mime:"image/svg+xml"},{id:"png",label:"PNG",hint:`${Se}px, transparent`,extension:"png",mime:"image/png"},{id:"webp",label:"WebP",hint:`${Se}px, smaller`,extension:"webp",mime:"image/webp"},{id:"jpeg",label:"JPEG",hint:`${Se}px, no transparency`,extension:"jpg",mime:"image/jpeg"}];async function qt(o,r,t,n=Se){const a={...w.wornToOptions(r),size:n};if(t.id==="svg")return new Blob([w.owlAvatarSvg(o,a)],{type:t.mime});const l=new Image;await new Promise((m,f)=>{l.onload=()=>m(),l.onerror=()=>f(new Error("could not draw the owl")),l.src=w.owlAvatarDataUri(o,a)});const c=document.createElement("canvas");c.width=n,c.height=n;const g=c.getContext("2d");if(!g)throw new Error("no 2d context");return g.drawImage(l,0,0,n,n),await new Promise((m,f)=>{c.toBlob(y=>{if(!y){f(new Error(`this browser cannot write ${t.label}`));return}m(y)},t.mime,.92)})}function Yt(o,r){return`${o.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32)||"gryt"}-owl.${r.extension}`}function vn(o,r){const t=URL.createObjectURL(o),n=document.createElement("a");n.href=t,n.download=r,document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e4)}const Ut="gryt.owlSeen";function Vt(){try{const o=localStorage.getItem(Ut);if(!o)return null;const r=JSON.parse(o);return Array.isArray(r)?new Set(r.filter(t=>typeof t=="string")):null}catch{return null}}function nt(o){try{localStorage.setItem(Ut,JSON.stringify([...o]))}catch{}}function Wt(o){const r=Vt();if(!r)return nt(new Set(o)),new Set;const t=new Set;for(const n of o)r.has(n)||t.add(n);return t}function Xt(o,r){const t=Vt()??new Set(r);t.add(o),nt(t);const n=new Set;for(const a of r)t.has(a)||n.add(a);return n}function jn(o){return nt(new Set(o)),new Set}const Kt="gryt.owlWardrobe",Nn=20;function ke(){try{const o=localStorage.getItem(Kt);if(!o)return[];const r=JSON.parse(o);return Array.isArray(r)?r.filter(t=>typeof t=="object"&&t!==null&&typeof t.worn=="string"&&typeof t.at=="number"):[]}catch{return[]}}function Jt(o){try{localStorage.setItem(Kt,JSON.stringify(o))}catch{}}function Zt(o){const r=ke().filter(n=>n.worn!==o),t=[{worn:o,at:Date.now()},...r].slice(0,Nn);return Jt(t),t}function Qt(o){const r=ke().filter(t=>t.worn!==o);return Jt(r),r}function Tn({size:o=18}){return e.jsxs("svg",{"aria-hidden":"true",height:o,viewBox:"0 0 256 256",width:o,fill:"currentColor",children:[e.jsx("path",{d:"M104 96 44 66a14 14 0 0 0-20 12v100a14 14 0 0 0 20 12l60-30Z"}),e.jsx("path",{d:"M152 96 212 66a14 14 0 0 1 20 12v100a14 14 0 0 1-20 12l-60-30Z"}),e.jsx("rect",{x:"100",y:"96",width:"56",height:"64",rx:"16"})]})}const tt=[{slot:"expression",label:"Expression",Icon:({size:o=18})=>e.jsx(S.Eyes,{weight:"fill",size:o})},{slot:"eyewear",label:"Glasses",Icon:({size:o=18})=>e.jsx(S.Eyeglasses,{weight:"fill",size:o})},{slot:"head",label:"Head",Icon:({size:o=18})=>e.jsx(S.BaseballCap,{weight:"fill",size:o})},{slot:"neck",label:"Neck",Icon:Tn},{slot:"body",label:"Clothes",Icon:({size:o=18})=>e.jsx(S.Hoodie,{weight:"fill",size:o})}],je="colour";function Xe(o){return o.replace(/^[a-z]+-/,"").replace(/-/g," ")}const at={expression:null,eyewear:null,head:null,neck:null,body:null};function er(o){const r=w.resolveOwl(o);return{palette:r.paletteName,scheme:r.scheme,ears:r.ears,wearing:{...at,...r.wearing}}}function wt(o){if(o)return er(o);const[r]=ke();return(r&&w.decodeWorn(r.worn))??{palette:w.PALETTE_NAMES[0],scheme:"day",ears:"tufts",wearing:{...at}}}function Sn(){const o=t=>t[Math.floor(Math.random()*t.length)],r={...at};for(const{slot:t}of tt){const n=w.accessoriesIn(t);r[t]=Math.random()<.34||n.length===0?null:o(n).name}return{palette:o(w.PALETTE_NAMES),scheme:o(w.PALETTE_SCHEMES),ears:o(w.EAR_STYLES),wearing:r}}async function Cn(o,r,t=512){const n=w.owlAvatarDataUri(o,{...w.wornToOptions(r),size:t}),a=new Image;await new Promise((g,m)=>{a.onload=()=>g(),a.onerror=()=>m(new Error("could not draw the owl")),a.src=n});const l=document.createElement("canvas");l.width=t,l.height=t;const c=l.getContext("2d");if(!c)throw new Error("no 2d context");return c.drawImage(a,0,0,t,t),await new Promise((g,m)=>{l.toBlob(f=>f?g(f):m(new Error("could not encode the owl")),"image/png")})}function Pn({src:o,className:r}){const[t,n]=s.useState([]),a=s.useRef(0);s.useEffect(()=>{o&&n(c=>c.length>0&&c[c.length-1].src===o?c:[...c,{src:o,id:a.current++}])},[o]);const l=s.useCallback(c=>{n(g=>{const m=g.findIndex(f=>f.id===c);return m<=0?g:g.slice(m)})},[]);return e.jsx("div",{className:`relative ${r??""}`,children:t.map((c,g)=>e.jsx(kn,{immediate:g===0,onSettled:()=>l(c.id),src:c.src},c.id))})}const vt="transition-[scale,color,background-color] duration-(--gryt-dur-spring) ease-spring motion-safe:hover:scale-[1.03] motion-safe:active:scale-[0.96] motion-reduce:transition-none",jt=250;function kn({src:o,immediate:r,onSettled:t}){const[n,a]=s.useState(r),l=s.useCallback(()=>{r||requestAnimationFrame(()=>requestAnimationFrame(()=>a(!0)))},[r]);return s.useEffect(()=>{if(!n)return;const c=setTimeout(t,r?0:jt);return()=>clearTimeout(c)},[n,r,t]),e.jsx("img",{alt:"",className:"absolute inset-0 h-full w-full rounded-full object-contain motion-reduce:transition-none",onLoad:l,src:o,style:{opacity:n?1:0,transition:`opacity ${jt}ms ease-out`}})}function Rn({seed:o,look:r,nickname:t}){const[n,a]=s.useState(null),[l,c]=s.useState(null),g=s.useCallback(async m=>{if(o){a(m.id),c(null);try{const f=await qt(o,r,m);vn(f,Yt(t,m))}catch(f){c(f instanceof Error?f.message:"Could not save the owl")}finally{a(null)}}},[o,r,t]);return e.jsxs(e.Fragment,{children:[l&&e.jsx(Dt,{className:"mb-2",severity:"warning",children:l}),e.jsxs(B.Root,{children:[e.jsxs(B.Trigger,{render:e.jsx(Q,{disabled:n!==null,size:"small",tone:"neutral"}),children:[e.jsx(S.DownloadSimple,{weight:"bold",size:15}),n?"Saving...":"Save as"]}),e.jsx(B.Portal,{children:e.jsx(B.Positioner,{align:"end",side:"top",sideOffset:6,children:e.jsx(B.Popup,{children:Bt.map(m=>e.jsxs(B.Item,{onClick:()=>{g(m)},children:[e.jsx("span",{className:"font-medium",children:m.label}),e.jsx("span",{className:"ml-auto pl-4 text-xs text-gryt-muted",children:m.hint})]},m.id))})})})]})]})}function An({open:o,nickname:r,onOpenChange:t,onUpload:n,onDesign:a}){const l=w.avatarSeed(r)??"",c=s.useMemo(()=>l?w.owlAvatarDataUri(l,{size:96}):void 0,[l]);return e.jsx(G.Root,{open:o,onOpenChange:t,children:e.jsxs(G.Portal,{children:[e.jsx(G.Backdrop,{forceRender:!0}),e.jsxs(G.Popup,{className:"w-[30rem] max-w-[calc(100vw-2rem)]",children:[e.jsx(G.Title,{children:"Your avatar"}),e.jsx(G.Description,{className:"mt-2 mb-4",children:"Gryt draws you an owl from your name. Choose how it looks, or use a picture instead."}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("button",{type:"button",onClick:a,className:"flex cursor-pointer flex-col items-center justify-center gap-3 rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-center transition-colors hover:bg-gryt-surface-hover",children:[e.jsx("img",{alt:"",className:"size-16 rounded-full",src:c}),e.jsx("span",{className:"text-sm font-semibold text-gryt-text",children:"Design your owl"}),e.jsx("span",{className:"text-xs text-gryt-muted",children:"Its colours, its expression, and what it is wearing."})]}),e.jsxs("button",{type:"button",onClick:()=>{t(!1),n()},className:"flex cursor-pointer flex-col items-center justify-center gap-3 rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-center transition-colors hover:bg-gryt-surface-hover",children:[e.jsx("span",{className:"flex size-16 items-center justify-center rounded-full bg-gryt-surface-raised",children:e.jsx(S.Camera,{weight:"fill","aria-hidden":!0,size:24})}),e.jsx("span",{className:"text-sm font-semibold text-gryt-text",children:"Upload a picture"}),e.jsx("span",{className:"text-xs text-gryt-muted",children:"PNG, JPG, WebP or GIF."})]})]})]})]})})}function tr({nickname:o,saving:r,onSave:t,onCancel:n,active:a=!0,followSeed:l=!1}){const c=w.avatarSeed(o)??"",[g,m]=s.useState(()=>wt(l?w.avatarSeed(o)??"":void 0)),[f,y]=s.useState(!1),b=s.useCallback(p=>{y(!0),m(p)},[]),[h,v]=s.useState("expression"),[j,N]=s.useState([]),[k,T]=s.useState(()=>new Set),P=s.useRef(null),A=s.useMemo(()=>w.ACCESSORIES.map(p=>p.name),[]);s.useEffect(()=>{a&&(m(wt(l?c:void 0)),y(!1),v("expression"),N(ke()),T(Wt(A)))},[a,A,l]),s.useEffect(()=>{!l||f||!c||m(er(c))},[l,f,c]);const E=s.useMemo(()=>w.encodeWorn(g),[g]),V=s.useMemo(()=>c?w.owlAvatarDataUri(c,{...w.wornToOptions(g),size:320}):void 0,[c,g]),pe=s.useCallback(p=>w.owlAvatarDataUri(c,{...w.wornToOptions({...g,...p,wearing:{...g.wearing,...p.wearing}}),size:128}),[c,g]),ie=s.useCallback((p,M)=>{b(_=>({..._,wearing:{..._.wearing,[p]:M}})),M&&T(Xt(M,A))},[A,b]),Le=s.useCallback(async()=>{N(Zt(E)),t(await Cn(c,g),E)},[g,E,c,t]),O=h===je?null:h,z=O?w.accessoriesIn(O):[],ye=tt.find(p=>p.slot===h)?.label??"Colour";return e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto md:flex-row",children:[e.jsx(ue,{className:"shrink-0 border-b border-gryt-border bg-gryt-surface md:w-48 md:border-r md:border-b-0",onValueChange:p=>v(String(p)),orientation:"vertical",value:h,children:e.jsxs(ue.List,{"aria-label":"What to change",className:"gap-1 p-3",children:[tt.map(({slot:p,label:M,Icon:_})=>{const Re=!!g.wearing[p],be=w.accessoriesIn(p).filter(Fe=>k.has(Fe.name)).length;return e.jsxs(ue.Tab,{className:vt,value:p,children:[e.jsx(_,{size:18}),e.jsx("span",{children:M}),Re&&h!==p&&e.jsx("span",{className:"size-1.5 rounded-full bg-gryt-accent","aria-hidden":!0}),be>0?e.jsxs("span",{className:"ml-auto rounded-full bg-gryt-accent px-1.5 font-mono text-[0.65rem] text-gryt-on-accent",title:`${be} new`,children:["+",be]}):e.jsx("span",{className:"ml-auto pl-2 font-mono text-[0.65rem] opacity-70",children:w.accessoriesIn(p).length})]},p)}),e.jsxs(ue.Tab,{className:vt,value:je,children:[e.jsx(S.Palette,{weight:"fill",size:18}),e.jsx("span",{children:"Colour"}),e.jsx("span",{className:"ml-auto pl-2 font-mono text-[0.65rem] opacity-70",children:w.PALETTE_NAMES.length})]}),e.jsx(ue.Indicator,{})]})}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3 p-4",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[e.jsx("h3",{className:"text-base font-semibold",children:ye}),e.jsx("span",{className:"text-xs text-gryt-muted",children:h===je?`${w.PALETTE_NAMES.length} palettes`:`${z.length} drawn`})]}),e.jsxs("div",{ref:P,className:"-mx-1.5 grid max-h-[min(30rem,calc(100dvh-18rem))] grid-cols-[repeat(auto-fill,minmax(4.25rem,1fr))] gap-2 overflow-y-auto p-1.5",children:[O&&e.jsx("button",{type:"button",onClick:()=>ie(O,null),className:"flex aspect-square cursor-pointer flex-col items-center justify-center rounded-(--gryt-radius-md) text-[0.65rem] transition-[scale,outline-color,background-color] duration-(--gryt-dur-spring) ease-spring motion-safe:hover:scale-[1.03] motion-safe:active:scale-[0.96] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light "+(g.wearing[O]?"outline outline-1 outline-dashed outline-gryt-border text-gryt-muted hover:bg-gryt-surface-hover":"outline outline-[3px] outline-offset-[-1.5px] outline-gryt-accent bg-gryt-surface-raised text-gryt-text motion-safe:scale-[1.04] motion-safe:hover:scale-[1.06]"),children:"Nothing"}),O&&z.map(p=>{const M=g.wearing[O]===p.name,_=k.has(p.name);return e.jsx(Je,{title:_?`${Xe(p.name)} — new`:Xe(p.name),children:e.jsxs("div",{className:"relative",children:[e.jsx("button",{type:"button",onClick:()=>ie(O,p.name),"aria-label":Xe(p.name),className:"block w-full cursor-pointer overflow-hidden rounded-(--gryt-radius-md) transition-[scale,outline-color,background-color] duration-(--gryt-dur-spring) ease-spring motion-safe:hover:scale-[1.03] motion-safe:active:scale-[0.96] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light "+(M?"outline outline-[3px] outline-offset-[-1.5px] outline-gryt-accent bg-gryt-surface-raised motion-safe:scale-[1.04] motion-safe:hover:scale-[1.06]":"outline outline-0 outline-transparent hover:bg-gryt-surface-hover"),children:e.jsx("img",{alt:"",className:"block aspect-square w-full",src:pe({wearing:{[O]:p.name}})})}),_&&e.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute -top-0.5 -right-0.5 size-2.5 rounded-full bg-gryt-accent ring-2 ring-gryt-surface"})]})},p.name)}),h===je&&w.PALETTE_NAMES.map(p=>{const M=g.palette===p;return e.jsx(Je,{title:p,children:e.jsx("button",{type:"button",onClick:()=>b(_=>({..._,palette:p})),"aria-label":p,className:"cursor-pointer overflow-hidden rounded-(--gryt-radius-md) transition-[scale,outline-color,background-color] duration-(--gryt-dur-spring) ease-spring motion-safe:hover:scale-[1.03] motion-safe:active:scale-[0.96] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light "+(M?"outline outline-[3px] outline-offset-[-1.5px] outline-gryt-accent bg-gryt-surface-raised motion-safe:scale-[1.04] motion-safe:hover:scale-[1.06]":"outline outline-0 outline-transparent hover:bg-gryt-surface-hover"),children:e.jsx("img",{alt:"",className:"block aspect-square w-full",src:w.owlAvatarDataUri(c,{...w.wornToOptions(g),palette:p,size:128})})})},p)})]}),h===je&&e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx(Nt,{label:"Time of day",children:w.PALETTE_SCHEMES.map(p=>e.jsx(Tt,{on:g.scheme===p,onClick:()=>b(M=>({...M,scheme:p})),children:p},p))}),e.jsx(Nt,{label:"Ears",children:w.EAR_STYLES.map(p=>e.jsx(Tt,{on:g.ears===p,onClick:()=>b(M=>({...M,ears:p})),children:p},p))})]}),j.length>0&&e.jsxs("div",{className:"flex flex-col gap-1.5 border-t border-gryt-border pt-3",children:[e.jsx("span",{className:"text-[0.65rem] font-semibold tracking-wider text-gryt-muted uppercase",children:"Worn before"}),e.jsx("div",{className:"-mx-1.5 flex gap-2 overflow-x-auto p-1.5",children:j.map(p=>{const M=w.decodeWorn(p.worn);return M?e.jsxs("div",{className:"group relative shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>b(M),"aria-label":"Wear this again",className:"block cursor-pointer overflow-hidden rounded-(--gryt-radius-md) transition-[scale,outline-color] duration-(--gryt-dur-spring) ease-spring motion-safe:hover:scale-[1.03] motion-safe:active:scale-[0.96] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light "+(p.worn===E?"outline outline-[3px] outline-offset-[-1.5px] outline-gryt-accent":"outline outline-1 outline-gryt-border hover:outline-gryt-accent"),children:e.jsx("img",{alt:"",className:"block size-14",src:w.owlAvatarDataUri(c,{...w.wornToOptions(M),size:128})})}),e.jsx("button",{type:"button",onClick:()=>N(Qt(p.worn)),"aria-label":"Forget this look",className:"absolute -top-1.5 -right-1.5 hidden size-5 cursor-pointer items-center justify-center rounded-full border border-gryt-border bg-gryt-surface-raised text-gryt-muted hover:text-gryt-text group-hover:flex",children:e.jsx(S.Trash,{weight:"fill",size:10})})]},p.worn):null})})]})]}),e.jsxs("div",{className:"flex shrink-0 flex-col items-center gap-3 border-t border-gryt-border bg-gryt-surface p-4 md:w-56 md:border-t-0 md:border-l",children:[e.jsx(Pn,{className:"h-40 w-40",src:V}),e.jsx("span",{className:"text-xs text-gryt-muted",children:o}),e.jsxs("div",{className:"mt-auto flex w-full flex-col gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>b(Sn()),className:"flex cursor-pointer items-center justify-center gap-2 rounded-full border border-gryt-border px-4 py-2 text-sm text-gryt-text transition-colors hover:bg-gryt-surface-hover",children:[e.jsx(S.Shuffle,{weight:"bold",size:15}),"Surprise me"]}),e.jsx(Q,{disabled:r,onClick:()=>{Le()},size:"small",children:r?"Saving...":"Use this owl"}),e.jsx(Rn,{look:g,nickname:o,seed:c}),n&&e.jsx(Q,{disabled:r,onClick:n,size:"small",tone:"neutral",children:"Cancel"})]})]})]})}function Mn({open:o,nickname:r,saving:t,onOpenChange:n,onSave:a}){return e.jsx(G.Root,{open:o,onOpenChange:n,children:e.jsxs(G.Portal,{children:[e.jsx(G.Backdrop,{forceRender:!0}),e.jsxs(G.Popup,{className:"flex max-h-[min(46rem,calc(100dvh-2rem))] w-[64rem] max-w-[calc(100vw-2rem)] flex-col overflow-hidden p-0",children:[e.jsx(G.Title,{className:"sr-only",children:"Design your owl"}),e.jsx(tr,{active:o,nickname:r,onCancel:()=>n(!1),onSave:a,saving:t})]})]})})}function Nt({label:o,children:r}){return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[0.65rem] font-semibold tracking-wider text-gryt-muted uppercase",children:o}),e.jsx("div",{className:"flex gap-1.5",children:r})]})}function Tt({on:o,onClick:r,children:t}){return e.jsx("button",{type:"button",onClick:r,className:`cursor-pointer rounded-full px-3 py-1 text-xs capitalize transition-colors ${o?"bg-gryt-accent text-gryt-on-accent font-semibold":"border border-gryt-border text-gryt-muted hover:bg-gryt-surface-hover"}`,children:t})}const $n={primary:"bg-gryt-accent",success:"bg-gryt-success",warning:"bg-gryt-warning",danger:"bg-gryt-danger"};function In({className:o,value:r,label:t,showValue:n=!1,tone:a="primary",...l}){return e.jsxs(we.Meter.Root,{value:r,className:i("gryt-meter flex w-full flex-col gap-1.5",o),...l,children:[(t||n)&&e.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[t?e.jsx(we.Meter.Label,{className:"text-sm text-gryt-muted",children:t}):e.jsx("span",{}),n&&e.jsx(we.Meter.Value,{className:"font-mono text-xs text-gryt-muted tabular-nums"})]}),e.jsx(we.Meter.Track,{className:"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised",children:e.jsx(we.Meter.Indicator,{className:i("h-full rounded-(--gryt-radius-full)","transition-[width] duration-120 ease-out motion-reduce:transition-none",$n[a])})})]})}const Dn=s.forwardRef(function({className:r,...t},n){return e.jsx(Z.AlertDialog.Popup,{ref:n,className:i("gryt-alert-dialog fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2","flex w-[32rem] max-w-[calc(100vw-3rem)] flex-col gap-4","rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text","outline-none","transition-[opacity,scale] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0",r),...t})}),En=s.forwardRef(function({className:r,...t},n){return e.jsx(Z.AlertDialog.Backdrop,{ref:n,className:i("gryt-alert-dialog-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)","transition-opacity duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:opacity-0 data-ending-style:opacity-0",r),...t})}),On=s.forwardRef(function({className:r,...t},n){return e.jsx(Z.AlertDialog.Title,{ref:n,className:i("gryt-alert-dialog-title text-lg font-semibold text-gryt-text",r),...t})}),Ln=s.forwardRef(function({className:r,...t},n){return e.jsx(Z.AlertDialog.Description,{ref:n,className:i("gryt-alert-dialog-description text-sm leading-6 text-gryt-muted",r),...t})}),Fn={Root:Z.AlertDialog.Root,Trigger:Z.AlertDialog.Trigger,Portal:Z.AlertDialog.Portal,Backdrop:En,Popup:Dn,Title:On,Description:Ln,Close:Z.AlertDialog.Close},rr=["flex cursor-default items-center gap-2 rounded-(--gryt-radius-md)","px-3 py-2 text-sm text-gryt-text outline-none select-none","data-highlighted:bg-gryt-surface-raised","data-selected:text-gryt-accent-11","data-disabled:cursor-not-allowed data-disabled:opacity-50"].join(" "),or=[At,Mt.medium,"border-gryt-border",D].join(" "),Gn=s.forwardRef(function({className:r,...t},n){return e.jsx(R.Combobox.Input,{ref:n,className:i("gryt-combobox-input",or,r),...t})}),_n=s.forwardRef(function({className:r,sideOffset:t=6,...n},a){return e.jsx(R.Combobox.Positioner,{ref:a,sideOffset:t,className:i("gryt-combobox-positioner outline-none",r),...n})}),zn=s.forwardRef(function({className:r,...t},n){return e.jsx(R.Combobox.Popup,{ref:n,className:i("gryt-combobox max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none",se,ee,r),...t})}),Hn=s.forwardRef(function({className:r,...t},n){return e.jsx(R.Combobox.Item,{ref:n,className:i("gryt-combobox-item",rr,r),...t})}),Bn=s.forwardRef(function({className:r,...t},n){return e.jsx(R.Combobox.Empty,{ref:n,className:i("gryt-combobox-empty px-3 py-2 text-sm text-gryt-muted",r),...t})}),qn={Root:R.Combobox.Root,Input:Gn,InputGroup:R.Combobox.InputGroup,Trigger:R.Combobox.Trigger,Icon:R.Combobox.Icon,Clear:R.Combobox.Clear,Value:R.Combobox.Value,Chips:R.Combobox.Chips,Chip:R.Combobox.Chip,ChipRemove:R.Combobox.ChipRemove,Portal:R.Combobox.Portal,Positioner:_n,Popup:zn,List:R.Combobox.List,Item:Hn,ItemIndicator:R.Combobox.ItemIndicator,Group:R.Combobox.Group,GroupLabel:R.Combobox.GroupLabel,Empty:Bn,Separator:R.Combobox.Separator},Yn=s.forwardRef(function({className:r,...t},n){return e.jsx(I.Autocomplete.Input,{ref:n,className:i("gryt-autocomplete-input",or,r),...t})}),Un=s.forwardRef(function({className:r,sideOffset:t=6,...n},a){return e.jsx(I.Autocomplete.Positioner,{ref:a,sideOffset:t,className:i("gryt-autocomplete-positioner outline-none",r),...n})}),Vn=s.forwardRef(function({className:r,...t},n){return e.jsx(I.Autocomplete.Popup,{ref:n,className:i("gryt-autocomplete max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none",se,ee,r),...t})}),Wn=s.forwardRef(function({className:r,...t},n){return e.jsx(I.Autocomplete.Item,{ref:n,className:i("gryt-autocomplete-item",rr,r),...t})}),Xn=s.forwardRef(function({className:r,...t},n){return e.jsx(I.Autocomplete.Empty,{ref:n,className:i("gryt-autocomplete-empty px-3 py-2 text-sm text-gryt-muted",r),...t})}),Kn={Root:I.Autocomplete.Root,Input:Yn,InputGroup:I.Autocomplete.InputGroup,Trigger:I.Autocomplete.Trigger,Icon:I.Autocomplete.Icon,Clear:I.Autocomplete.Clear,Value:I.Autocomplete.Value,Portal:I.Autocomplete.Portal,Positioner:Un,Popup:Vn,List:I.Autocomplete.List,Item:Wn,Group:I.Autocomplete.Group,GroupLabel:I.Autocomplete.GroupLabel,Empty:Xn,Separator:I.Autocomplete.Separator},Jn=s.forwardRef(function({className:r,...t},n){return e.jsx(mr.CheckboxGroup,{ref:n,className:i("gryt-checkbox-group flex flex-col gap-2",r),...t})}),Zn=s.forwardRef(function({className:r,...t},n){return e.jsx(rt.Collapsible.Trigger,{ref:n,className:i("gryt-collapsible-trigger flex w-full items-center justify-between gap-2","rounded-(--gryt-radius-md) border-0 bg-transparent px-2 py-2 text-left","text-sm font-medium text-gryt-text select-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none",D,r),...t})}),Qn=s.forwardRef(function({className:r,...t},n){return e.jsx(rt.Collapsible.Panel,{ref:n,className:i("gryt-collapsible-panel overflow-hidden","h-(--collapsible-panel-height) transition-[height] duration-(--gryt-dur-spring) ease-spring","data-starting-style:h-0 data-ending-style:h-0","motion-reduce:transition-none",r),...t})}),ea={Root:rt.Collapsible.Root,Trigger:Zn,Panel:Qn},ta=s.forwardRef(function({className:r,...t},n){return e.jsx(fr.Form,{ref:n,className:i("gryt-form flex flex-col gap-(--gryt-space-lg)",r),...t})}),ra=s.forwardRef(function({className:r,...t},n){return e.jsx(Pt.Fieldset.Root,{ref:n,className:i("gryt-fieldset flex min-w-0 flex-col gap-3 border-0 p-0",r),...t})}),oa=s.forwardRef(function({className:r,...t},n){return e.jsx(Pt.Fieldset.Legend,{ref:n,className:i("gryt-fieldset-legend text-sm font-semibold text-gryt-text",r),...t})}),na={Root:ra,Legend:oa},aa=s.forwardRef(function({className:r,...t},n){return e.jsx(xr.Menubar,{ref:n,className:i("gryt-menubar flex items-center gap-1","rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface p-1",r),...t})}),sa=s.forwardRef(function({className:r,...t},n){return e.jsx(F.NavigationMenu.Trigger,{ref:n,className:i("gryt-navigation-menu-trigger flex items-center gap-1.5 rounded-(--gryt-radius-md)","border-0 bg-transparent px-3 py-2 text-sm font-medium text-gryt-text select-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none","data-popup-open:bg-gryt-surface-raised",D,r),...t})}),ia=s.forwardRef(function({className:r,...t},n){return e.jsx(F.NavigationMenu.Popup,{ref:n,className:i("gryt-navigation-menu-popup outline-none",se,ee,r),...t})}),la=s.forwardRef(function({className:r,...t},n){return e.jsx(F.NavigationMenu.Positioner,{ref:n,className:i("gryt-navigation-menu-positioner outline-none",r),...t})}),ca=s.forwardRef(function({className:r,...t},n){return e.jsx(F.NavigationMenu.Viewport,{ref:n,className:i("gryt-navigation-menu-viewport relative overflow-hidden",r),...t})}),da=s.forwardRef(function({className:r,...t},n){return e.jsx(F.NavigationMenu.Link,{ref:n,className:i("gryt-navigation-menu-link block rounded-(--gryt-radius-md) px-3 py-2","text-sm text-gryt-text no-underline outline-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none",D,r),...t})}),ua={Root:F.NavigationMenu.Root,List:F.NavigationMenu.List,Item:F.NavigationMenu.Item,Trigger:sa,Content:F.NavigationMenu.Content,Portal:F.NavigationMenu.Portal,Positioner:la,Viewport:ca,Popup:ia,Link:da,Icon:F.NavigationMenu.Icon,Arrow:F.NavigationMenu.Arrow},St="flex h-9 w-9 shrink-0 items-center justify-center border-0 bg-transparent text-gryt-muted transition-colors hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text motion-reduce:transition-none disabled:cursor-not-allowed disabled:opacity-50",ga=s.forwardRef(function({className:r,label:t,scrubbable:n=!1,...a},l){return e.jsxs(te.NumberField.Root,{ref:l,className:i("gryt-number-field flex flex-col gap-1.5",r),...a,children:[t&&(n?e.jsxs(te.NumberField.ScrubArea,{className:"cursor-ew-resize text-sm text-gryt-muted select-none",children:[t,e.jsx(te.NumberField.ScrubAreaCursor,{})]}):e.jsx("span",{className:"text-sm text-gryt-muted",children:t})),e.jsxs(te.NumberField.Group,{className:i("flex w-fit items-center overflow-hidden rounded-(--gryt-radius-full)","border border-gryt-border bg-gryt-surface-raised","focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-gryt-accent-light",xe),children:[e.jsx(te.NumberField.Decrement,{"aria-label":"Decrease",className:i(St,"rounded-l-(--gryt-radius-full)"),children:e.jsx(S.Minus,{size:14,weight:"bold"})}),e.jsx(te.NumberField.Input,{className:i("w-16 border-0 bg-transparent px-1 py-2 text-center","font-mono text-sm text-gryt-text tabular-nums outline-none",D)}),e.jsx(te.NumberField.Increment,{"aria-label":"Increase",className:i(St,"rounded-r-(--gryt-radius-full)"),children:e.jsx(S.Plus,{size:14,weight:"bold"})})]})]})}),ma=s.forwardRef(function({className:r,length:t=6,...n},a){return e.jsx(dt.OTPField.Root,{ref:a,length:t,className:i("gryt-otp-field flex gap-2",r),...n,children:Array.from({length:t},(l,c)=>e.jsx(dt.OTPField.Input,{className:i("gryt-otp-input h-12 w-10 rounded-(--gryt-radius-md) text-center","border border-gryt-border bg-gryt-surface-raised","font-mono text-lg text-gryt-text tabular-nums outline-none","transition-colors duration-(--gryt-dur-fast) motion-reduce:transition-none","data-filled:border-gryt-accent",D)},c))})}),fa=s.forwardRef(function({className:r,sideOffset:t=8,...n},a){return e.jsx(ge.PreviewCard.Positioner,{ref:a,sideOffset:t,className:i("gryt-preview-card-positioner outline-none",r),...n})}),xa=s.forwardRef(function({className:r,...t},n){return e.jsx(ge.PreviewCard.Popup,{ref:n,className:i("gryt-preview-card w-64 max-w-[calc(100vw-2rem)] p-4 outline-none",se,ee,r),...t})}),pa={Root:ge.PreviewCard.Root,Trigger:ge.PreviewCard.Trigger,Portal:ge.PreviewCard.Portal,Positioner:fa,Popup:xa,Arrow:ge.PreviewCard.Arrow},ya=s.forwardRef(function({className:r,...t},n){return e.jsx(me.Toolbar.Root,{ref:n,className:i("gryt-toolbar flex items-center gap-1","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1",r),...t})}),ba=s.forwardRef(function({className:r,...t},n){return e.jsx(me.Toolbar.Separator,{ref:n,className:i("gryt-toolbar-separator mx-1 h-6 w-px bg-gryt-border",r),...t})}),ha={Root:ya,Group:me.Toolbar.Group,Button:me.Toolbar.Button,Link:me.Toolbar.Link,Input:me.Toolbar.Input,Separator:ba};Object.defineProperty(exports,"GRYT_FONT_KEYS",{enumerable:!0,get:()=>u.GRYT_FONT_KEYS});Object.defineProperty(exports,"GRYT_FONT_STACK_MAX",{enumerable:!0,get:()=>u.GRYT_FONT_STACK_MAX});Object.defineProperty(exports,"GRYT_HUE_KEYS",{enumerable:!0,get:()=>u.GRYT_HUE_KEYS});Object.defineProperty(exports,"GRYT_MOTION_CURVES",{enumerable:!0,get:()=>u.GRYT_MOTION_CURVES});Object.defineProperty(exports,"GRYT_MOTION_SCALE_MAX",{enumerable:!0,get:()=>u.GRYT_MOTION_SCALE_MAX});Object.defineProperty(exports,"GRYT_NEUTRAL_KEYS",{enumerable:!0,get:()=>u.GRYT_NEUTRAL_KEYS});Object.defineProperty(exports,"GRYT_RADIUS_KEYS",{enumerable:!0,get:()=>u.GRYT_RADIUS_KEYS});Object.defineProperty(exports,"GRYT_THEME_NAME_MAX",{enumerable:!0,get:()=>u.GRYT_THEME_NAME_MAX});Object.defineProperty(exports,"alphaScale",{enumerable:!0,get:()=>u.alphaScale});Object.defineProperty(exports,"cloneGrytTheme",{enumerable:!0,get:()=>u.cloneGrytTheme});Object.defineProperty(exports,"contrast",{enumerable:!0,get:()=>u.contrast});Object.defineProperty(exports,"createGrytTheme",{enumerable:!0,get:()=>u.createGrytTheme});Object.defineProperty(exports,"decodeGrytTheme",{enumerable:!0,get:()=>u.decodeGrytTheme});Object.defineProperty(exports,"encodeDraft",{enumerable:!0,get:()=>u.encodeGrytTheme});Object.defineProperty(exports,"encodeGrytTheme",{enumerable:!0,get:()=>u.encodeGrytTheme});Object.defineProperty(exports,"grytAlphaScales",{enumerable:!0,get:()=>u.grytAlphaScales});Object.defineProperty(exports,"grytAlphaScalesLight",{enumerable:!0,get:()=>u.grytAlphaScalesLight});Object.defineProperty(exports,"grytFonts",{enumerable:!0,get:()=>u.grytFonts});Object.defineProperty(exports,"grytLightTokens",{enumerable:!0,get:()=>u.grytLightTokens});Object.defineProperty(exports,"grytMotion",{enumerable:!0,get:()=>u.grytMotion});Object.defineProperty(exports,"grytPresets",{enumerable:!0,get:()=>u.grytPresets});Object.defineProperty(exports,"grytPresetsById",{enumerable:!0,get:()=>u.grytPresetsById});Object.defineProperty(exports,"grytScales",{enumerable:!0,get:()=>u.grytScales});Object.defineProperty(exports,"grytScalesLight",{enumerable:!0,get:()=>u.grytScalesLight});Object.defineProperty(exports,"grytTheme",{enumerable:!0,get:()=>u.grytTheme});Object.defineProperty(exports,"grytThemeHues",{enumerable:!0,get:()=>u.grytThemeHues});Object.defineProperty(exports,"grytThemeToOptions",{enumerable:!0,get:()=>u.grytThemeToOptions});Object.defineProperty(exports,"grytTokens",{enumerable:!0,get:()=>u.grytTokens});Object.defineProperty(exports,"hexToOklch",{enumerable:!0,get:()=>u.hexToOklch});Object.defineProperty(exports,"hexToRgb",{enumerable:!0,get:()=>u.hexToRgb});Object.defineProperty(exports,"hueScale",{enumerable:!0,get:()=>u.hueScale});Object.defineProperty(exports,"hueScaleLight",{enumerable:!0,get:()=>u.hueScaleLight});Object.defineProperty(exports,"isBezier",{enumerable:!0,get:()=>u.isBezier});Object.defineProperty(exports,"isFontStack",{enumerable:!0,get:()=>u.isFontStack});Object.defineProperty(exports,"isHexColor",{enumerable:!0,get:()=>u.isHexColor});Object.defineProperty(exports,"isValidBezier",{enumerable:!0,get:()=>u.isValidBezier});Object.defineProperty(exports,"neutralScale",{enumerable:!0,get:()=>u.neutralScale});Object.defineProperty(exports,"neutralScaleLight",{enumerable:!0,get:()=>u.neutralScaleLight});Object.defineProperty(exports,"normalizeHexColor",{enumerable:!0,get:()=>u.normalizeHexColor});Object.defineProperty(exports,"normalizeThemeName",{enumerable:!0,get:()=>u.normalizeThemeName});Object.defineProperty(exports,"oklchToHex",{enumerable:!0,get:()=>u.oklchToHex});Object.defineProperty(exports,"rgbToHex",{enumerable:!0,get:()=>u.rgbToHex});Object.defineProperty(exports,"avatarSeed",{enumerable:!0,get:()=>w.avatarSeed});exports.Accordion=So;exports.Alert=Dt;exports.AlertDialog=Fn;exports.Autocomplete=Kn;exports.Avatar=It;exports.AvatarChoiceDialog=An;exports.Badge=$r;exports.Button=Q;exports.Card=zr;exports.CardActions=qr;exports.CardContent=Br;exports.CardHeader=Hr;exports.Checkbox=Ke;exports.CheckboxGroup=Jn;exports.Chip=Dr;exports.Collapsible=ea;exports.Combobox=qn;exports.Composer=Rr;exports.ContextMenu=Po;exports.ConversationItem=Mr;exports.Dialog=G;exports.Divider=_r;exports.Drawer=go;exports.EXPORT_FORMATS=Bt;exports.EXPORT_SIZE=Se;exports.Fieldset=na;exports.Form=ta;exports.GrytProvider=yr;exports.IconButton=Cr;exports.Menu=B;exports.Menubar=aa;exports.MessageBubble=kr;exports.Meter=In;exports.NavigationMenu=ua;exports.NumberField=ga;exports.OtpField=ma;exports.OwlDesigner=tr;exports.OwlDesignerDialog=Mn;exports.Popover=$o;exports.PreviewCard=pa;exports.Progress=Ur;exports.Radio=Er;exports.RadioGroup=Or;exports.ScrollArea=Yo;exports.Select=Ee;exports.Skeleton=Xr;exports.Slider=ot;exports.Spinner=Vr;exports.Surface=Pr;exports.Switch=Lr;exports.Tab=Lt;exports.Tabs=ue;exports.TextField=De;exports.ThemeEditor=wn;exports.Toast=_o;exports.Toggle=Ze;exports.ToggleGroup=Ft;exports.Toolbar=ha;exports.Tooltip=Je;exports.TooltipProvider=Gr;exports.cloneDraft=_t;exports.cn=i;exports.exportFilename=Yt;exports.forgetLook=Qt;exports.grytDraft=Wo;exports.importTheme=Ht;exports.markAllCosmeticsSeen=jn;exports.markCosmeticSeen=Xt;exports.readNewCosmetics=Wt;exports.readWardrobe=ke;exports.rememberLook=Zt;exports.renderOwl=qt;exports.themeCode=pn;exports.themeJson=yn;exports.themeStyle=zt;exports.useMediaQuery=Ot;exports.useToastManager=zo;
19
19
  //# sourceMappingURL=index.cjs.map