visits-style 2.1.2 → 2.1.3
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.js +70 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.es.js +2559 -676
- package/package.json +1 -6
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1,70 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("clsx"),ie=require("tailwind-merge"),s=require("react/jsx-runtime"),n=require("react"),d=require("@floating-ui/react"),le=require("react-dom");function N(e,t){return t?ie.twMerge(e,t):e}function Y({className:e,...t}){const o=n.useMemo(()=>g("leading-none peer-disabled:opacity-70",e),[e]);return s.jsx("label",{className:o,...t})}function ae({label:e,children:t,required:o,htmlFor:r,error:l,help:i,helpBefore:a,className:c,innerClass:p,...f}){const m=n.useMemo(()=>g("font-medium",o?'after:content-["*"] after:text-danger after:text-sm after:pl-0.5':""),[o]),x=n.useMemo(()=>N("flex flex-col space-y-2",c),[c]);return s.jsxs("div",{className:x,...f,children:[e?s.jsx(Y,{className:m,htmlFor:r,children:e}):null,i&&a?s.jsx("p",{className:"text-xs text-muted pb-2",children:i}):null,s.jsx("div",{className:p,children:ue(t,!!l)}),i&&!a&&!l?s.jsx("p",{className:"text-xs text-muted",children:i}):null,l?s.jsx("p",{className:"text-xs text-danger",children:l}):null]})}function ue(e,t){const o=n.Children.count(e);if(!o)return null;if(o===1)return n.cloneElement(e,{error:t});const r=n.Children.toArray(e);return r[0]=n.cloneElement(r[0],{error:t}),r}function ce({error:e,unstyled:t,className:o,...r}){const l=n.useMemo(()=>t?o:N(g("flex rounded-md border bg-background px-3 py-2 w-full [&_input]:placeholder:text-muted","[&_input]:disabled:opacity-50 [&_input]:focus-visible:outline-none",e?"border-danger hover:border-danger-fore":"border-input"),o),[o,e,t]);return s.jsx("div",{className:l,...r})}const z=n.forwardRef(({className:e,type:t,error:o,unstyled:r,...l},i)=>{const a=n.useMemo(()=>r?e:N(g("flex rounded-md border bg-background px-3 py-2 w-full placeholder:text-muted","disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",o?"border-danger hover:border-danger-fore":"border-input not-disabled:hover:border-input-fore",t==="file"?"file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground":null),e),[e,t,o,r]);return s.jsx("input",{ref:i,type:t,className:a,...l})});z.displayName="Input";const Z=n.forwardRef(({className:e,error:t,unstyled:o,...r},l)=>{const i=n.useMemo(()=>o?e:N(g("flex rounded-md border bg-background px-3 py-2 w-full","disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",t?"border-danger hover:border-danger-fore":"border-input not-disabled:hover:border-input-fore"),e),[e,t,o]);return s.jsx("textarea",{ref:l,className:i,...r})});Z.displayName="Textarea";function de(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",children:s.jsx("rect",{width:"20",height:"3",y:"13.5",x:"4.5",fill:"currentColor",stroke:"none",rx:"2"})})}function fe({checked:e,indeterminate:t,className:o,id:r,name:l,onChange:i,value:a,checkIcon:c,...p}){const f=n.useMemo(()=>N(g("inline-flex justify-center items-center border w-4.5 h-4.5 rounded","cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",e||t?"bg-primary text-inverted disabled:text-text disabled:bg-input disabled:border-input":"border-input not-disabled:hover:border-input-fore"),o),[e,t,o]),m=()=>{p.disabled||i?.(!e)};return s.jsxs("button",{type:"button",role:"checkbox",id:r||l,className:f,onClick:m,"aria-checked":e,...p,children:[e?c:null,t&&!e?s.jsx(de,{}):null,s.jsx("input",{type:"checkbox","aria-hidden":"true",name:l,checked:e,value:a,onChange:m,disabled:p.disabled,style:{position:"absolute",pointerEvents:"none",top:0,left:0,width:1,height:1,opacity:0}})]})}const pe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",q=pe?n.useLayoutEffect:n.useEffect;function E({children:e,container:t,disabled:o}){const[r,l]=n.useState(null);return q(()=>{if(!t){let i=document.getElementById("visits-style-portals");return i||(i=document.createElement("div"),i.id="visits-style-portals",document.body.appendChild(i)),l(i)}l(t)},[t]),o||!r?null:le.createPortal(e,r)}function $(e){e&&(e.stopPropagation(),e.preventDefault())}const me={open:150,close:75},H=n.forwardRef(({position:e,label:t,children:o,disabled:r,offset:l={x:0,y:6},onOpen:i,onClose:a,onManualClose:c,timeout:p=me,unstyled:f,zIndex:m=9996,role:x,...h},C)=>{const[y,u]=n.useState(!1),M=d.useId(),j=n.useRef(i),w=n.useRef(a),{refs:v,floatingStyles:S,context:T}=d.useFloating({nodeId:M,placement:e,middleware:[d.shift(),d.flip({fallbackAxisSideDirection:"end"}),d.offset({mainAxis:l.y,crossAxis:l.x})],open:y,onOpenChange:R=>{R?j.current?.(v.reference.current,v.floating.current):w.current?.(v.reference.current,v.floating.current),u(R)},whileElementsMounted:d.autoUpdate}),{isMounted:P,styles:O}=d.useTransitionStyles(T,{duration:p,initial({side:R}){let I="";return R==="top"?I="translateY(5%) scale(0.95)":R==="bottom"?I="translateY(-5%) scale(0.95)":R==="left"?I="translateX(5%) scale(0.95)":I="translateX(-5%) scale(0.95)",{opacity:0,transform:I}}}),A=n.useCallback(R=>{if($(R),c)return c();u(!1),w.current?.(v.reference.current,v.floating.current)},[c]);n.useEffect(()=>{if(r&&y)return u(!1)},[r,y]),n.useImperativeHandle(C,()=>({open:()=>{u(!0),j.current?.(v.reference.current,v.floating.current)},close:()=>{u(!1),w.current?.(v.reference.current,v.floating.current)}}),[]);const{getFloatingProps:D,getReferenceProps:_}=d.useInteractions([d.useClick(T,{enabled:!r})]);return j.current=i,w.current=a,s.jsxs(s.Fragment,{children:[n.cloneElement(n.Children.only(t),_({ref:v.setReference,tabIndex:0,role:"button","aria-expanded":y,disabled:r,onClick:$})),s.jsx(E,{disabled:r||!P,children:s.jsx(d.FloatingOverlay,{"data-testid":"vs-popover-shadow",onClick:A,style:{zIndex:m},autoFocus:!0,children:s.jsx("div",{role:x||"region",ref:v.setFloating,style:S,children:s.jsx(G,{unstyled:f,styles:O,...D({...h,onClick:$}),children:o})})})})]})});H.displayName="Popover";const G=n.forwardRef(({className:e,unstyled:t,styles:o,style:r={},...l},i)=>{const a=n.useMemo(()=>N(g("z-20 w-auto h-auto outline-none transition-transform ease-in-out",t?null:"border border-accent rounded-md shadow-lg p-1 bg-background"),e),[e,t]);return s.jsx("div",{ref:i,className:a,style:{...o,...r},...l})});G.displayName="PopoverContent";function be({className:e,placeholder:t="",options:o=[],error:r,unstyled:l,disabled:i,value:a,maxHeight:c=408,arrowIcon:p,closeIcon:f,checkIcon:m,onChange:x,onClear:h,renderItem:C,sectionLabelStyle:y,buttonAreaStyle:u,clearLabelText:M,optionStyle:j,...w}){const v=n.useRef(null),[S,T]=n.useState(0),P=n.useMemo(()=>l?e:N(g("flex items-center justify-between rounded-md border bg-background px-3 py-2 w-full overflow-hidden cursor-pointer","disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",r?"border-danger hover:border-danger-fore":"border-input not-disabled:hover:border-input-fore"),e),[e,r,l]),O=n.useMemo(()=>Array.isArray(a),[]),A=n.useCallback(b=>{x?.(b),O||v.current?.close()},[x,O]),D=n.useCallback(b=>Array.isArray(a)?a.indexOf(b)>-1:a===b,[a]),_=n.useMemo(()=>{const b={},F=o.filter(k=>typeof k!="string");for(let k=0,B=F.length;k<B;k+=1){const X=F[k];b[`${X.value}`]=X.label}return b},[o]),R=n.useMemo(()=>{if(!a)return t;if(Array.isArray(a)){if(!a.length)return t;const b=[...a].sort(),F=[];for(let k=0,B=b.length;k<B;k+=1)F[k]=_[`${b[k]}`]||"";return F.filter(Boolean).join(",")||t}return _[`${a}`]||t},[t,a,_]),I=R===t,re=n.useMemo(()=>g("overflow-hidden overflow-ellipsis whitespace-nowrap",I?"text-muted":"text-text"),[I]),oe=n.useCallback((b,F)=>C?typeof b=="string"?C(b,{index:F,selected:!1,onChange:()=>{}}):C(b,{index:F,selected:D(b.value),onChange:()=>A(b.value)}):typeof b=="string"?s.jsx("h5",{className:g("font-normal py-1 px-2 text-muted",y),children:b},`optionheader-${F}`):s.jsx(ge,{selected:D(b.value),onChange:A,checkIcon:m,className:j,...b},b.label),[C,A,D,y,j,m]),se=n.useMemo(()=>g("relative flex items-center pr-4 space-x-2",u),[u]);return s.jsx(H,{label:s.jsxs("button",{type:"button",className:P,disabled:i,...w,children:[s.jsx("span",{className:re,children:R}),s.jsxs("div",{className:se,children:[h&&!I?s.jsx("div",{tabIndex:-1,role:"button",className:"size-6 p-1.5 rounded hover:bg-accent cursor-pointer","aria-label":M,onKeyDown:b=>{b.key!=="Enter"&&b.key!=="Space"||h()},onClick:b=>{b.stopPropagation(),h()},children:f}):null,p]})]}),ref:v,onOpen:b=>T(b?.getBoundingClientRect().width||0),disabled:i,children:s.jsx("ul",{className:"overflow-y-auto flex flex-col",role:"listbox",style:{minWidth:S,maxWidth:"calc(100vw - 3rem)",maxHeight:c},children:o.map(oe)})})}function ge({className:e,value:t,label:o,selected:r,checkIcon:l,onChange:i}){const a=n.useMemo(()=>g("flex items-center w-full hover:bg-accent rounded p-1 cursor-pointer",e),[e]);return s.jsxs("button",{type:"button",role:"option",className:a,"aria-selected":r,onClick:()=>i?.(t),children:[r&&l?l:s.jsx("div",{className:"w-5 h-1 mr-1"}),o]})}function xe({checked:e,className:t,id:o,name:r,onChange:l,value:i,...a}){const c=n.useMemo(()=>g("relative inline-flex justify-center items-center border border-input w-4.5 h-4.5 rounded-full","cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed not-disabled:hover:border-input-fore",e?"[&_i]:bg-primary disabled:[&_i]:bg-text disabled:border-input":"",t),[t,e]),p=()=>{a.disabled||l?.(!e)};return s.jsxs("button",{type:"button",role:"radio",id:o||r,className:c,onClick:p,"aria-checked":e,...a,children:[s.jsx("i",{className:"block w-2.5 h-2.5 rounded-full transition-transform",style:{transform:e?"":"scale(0.8)",opacity:e?1:0}}),s.jsx("input",{type:"radio","aria-hidden":"true",name:r,checked:e,value:i,onChange:p,disabled:a.disabled,style:{position:"absolute",pointerEvents:"none",top:0,left:0,width:1,height:1,opacity:0}})]})}const K=n.forwardRef(({className:e,checked:t,onChange:o,value:r,id:l,name:i,...a},c)=>{const p=n.useMemo(()=>N(g("inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50","w-11",t?"bg-primary":"bg-input"),e),[e,t]),f=n.useMemo(()=>N("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",e),[e]),m=()=>{a.disabled||o?.(!t)};return s.jsxs("button",{type:"button",role:"switch",id:l||i,className:p,onClick:m,"aria-checked":t,...a,children:[s.jsx("span",{className:f,style:{transform:t?"translateX(100%)":""}}),s.jsx("input",{ref:c,type:"checkbox","aria-hidden":"true",name:i,checked:t,value:r,onChange:m,disabled:a.disabled,style:{position:"absolute",pointerEvents:"none",top:0,left:0,width:1,height:1,opacity:0}})]})});K.displayName="Switch";function he({header:e,show:t,children:o,timeout:r=300,...l}){const i=n.useRef(null),a=n.useRef(0),c=n.useRef(0),p=n.useRef(!0);return n.useEffect(()=>{c.current=r},[r]),q(()=>{if(!i.current)return;if(i.current.style.overflow="hidden",i.current.style.opacity="1",p.current){p.current=!1,i.current.style.height=t?"auto":"0px",t?window.requestAnimationFrame(()=>{i.current&&(a.current=i.current.offsetHeight)}):(window.requestAnimationFrame(()=>{i.current&&(i.current.style.height="auto",a.current=i.current.offsetHeight,i.current.style.height="0px")}),i.current.style.opacity="0");return}t||(i.current.style.height=`${a.current}px`);const f=[];f[0]=window.requestAnimationFrame(()=>{f[1]=window.requestAnimationFrame(()=>{i.current&&(i.current.style.height=`${t?a.current:0}px`,i.current.style.opacity=t?"1":"0")})});let m;const x=()=>{i.current&&(t?(i.current.style.height="auto",i.current.style.overflow="",i.current.style.opacity="",window.requestAnimationFrame(()=>{i.current&&(a.current=i.current.offsetHeight)})):i.current.style.height="0px")};return c.current===0?x():m=window.setTimeout(x,c.current),()=>{f.forEach(window.cancelAnimationFrame),m&&window.clearTimeout(m)}},[t]),s.jsxs("div",{...l,children:[e,s.jsx("div",{className:"transition-all ease-in-out overflow-hidden",role:"region","aria-hidden":!t,ref:i,style:{transitionDuration:`${r}ms`},children:o})]})}const U=n.forwardRef(({children:e,position:t="bottom",label:o,className:r,timeout:l=150,offset:i={x:0,y:6},clientPoint:a=!1,disabled:c},p)=>{const[f,m]=n.useState(!1),x=d.useId(),{refs:h,floatingStyles:C,context:y}=d.useFloating({nodeId:x,open:f,placement:t,middleware:[d.shift(),d.flip(),d.offset({mainAxis:i.y,crossAxis:i.x})],whileElementsMounted:c?void 0:d.autoUpdate,onOpenChange:m}),{getReferenceProps:u,getFloatingProps:M}=d.useInteractions([d.useHover(y,{enabled:!c}),d.useClientPoint(y,{enabled:a})]),{isMounted:j,styles:w}=d.useTransitionStyles(y,{duration:l,initial:{opacity:0,transform:"scale(0.8)"}});n.useImperativeHandle(p,()=>({floating:h.floating,reference:h.reference,open:()=>m(!0),close:()=>m(!1)})),n.useEffect(()=>{c&&m(!1)},[c]);const v=typeof e=="string"?s.jsx("span",{children:e}):e;return s.jsxs(s.Fragment,{children:[n.cloneElement(n.Children.only(v),{ref:h.setReference,...u()}),s.jsx(E,{disabled:c||!j,children:s.jsx("div",{role:"tooltip",className:"z-[9999]",ref:h.setFloating,...M({style:C}),children:s.jsx(J,{className:r,style:w,children:o})})})]})});U.displayName="Tooltip";const J=n.forwardRef(({className:e,custom:t,...o},r)=>{const l=n.useMemo(()=>N(g("relative w-auto h-auto outline-none transition-transform ease-in-out whitespace-pre",t?null:"border border-accent rounded shadow-md px-3 py-1 bg-background"),e),[e,t]);return s.jsx("div",{ref:r,className:l,...o})});J.displayName="TooltipContent";function Q({variant:e,size:t}){return g("inline-flex items-center justify-center whitespace-nowrap transition-colors rounded-md cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-auto",{"bg-primary text-inverted hover:bg-primary-fore":!e||e==="primary","bg-info text-inverted hover:bg-info-fore":e==="info","bg-warn text-inverted hover:bg-warn-fore":e==="warn","bg-danger text-inverted hover:bg-danger-fore":e==="danger","hover:bg-accent":e==="ghost","hover:underline":e==="link","border border-input hover:bg-accent":e==="outline"},{"px-2 py-1":!t,"p-1.5":t==="icon"})}function ye({size:e,variant:t,className:o,...r}){const l=n.useMemo(()=>g(Q({size:e,variant:t}),o),[e,t,o]);return s.jsx("button",{className:l,type:"button",...r})}function we({open:e,children:t,timeout:o=150,padding:r="0.85rem",verticalAlign:l="center",closeOnOverlay:i,closeOnEsc:a,onExited:c,className:p,onOpenChange:f,size:m,...x}){const h=n.useRef(c),C=n.useRef(!1),y=d.useId(),{refs:u,context:M}=d.useFloating({open:e,onOpenChange:f,nodeId:y}),{getFloatingProps:j}=d.useInteractions([d.useDismiss(M,{enabled:a,escapeKey:a,outsidePress:!1})]),{isMounted:w,styles:v}=d.useTransitionStyles(M,{duration:o,initial:{opacity:0,transform:"scale(0.8)"}});n.useEffect(()=>{C.current!==w&&(C.current=w,!w&&h.current?.())},[w]);const S=n.useCallback(()=>{i&&f?.(!1)},[f,i]);h.current=c;const T=n.useMemo(()=>g("grid bg-backdrop z-40 justify-items-center",{"place-items-start items-start":l==="start","place-items-end":l==="end","place-items-center":l==="center"||!l}),[l]),P=n.useMemo(()=>N("transition ease-in-out",p),[p]);return s.jsx(E,{disabled:!w,children:s.jsx(d.FloatingOverlay,{className:T,"data-testid":"vs-dialog-overlay",onClick:S,style:{padding:r,opacity:v.opacity},lockScroll:!0,children:s.jsx(V,{ref:u.setFloating,className:P,role:"dialog",size:m,style:v,onClick:$,...j({...x}),children:t})})})}const V=n.forwardRef(({size:e,className:t,...o},r)=>{const l=n.useMemo(()=>g(e?"flex flex-col bg-background shadow-lg p-5 rounded":null,{"w-full max-w-dialog-sm":e==="small","w-full max-w-dialog-md":e==="medium","w-full max-w-dialog-lg":e==="large"},t),[e,t]);return s.jsx("div",{ref:r,className:l,...o})});V.displayName="DialogContent";const ve={open:250,close:150};function je({open:e,timeout:t=ve,onOpenChange:o,position:r="right",overlay:l,onExited:i,...a}){const c=d.useId(),p=n.useRef(!1),f=n.useRef(i),{refs:m,context:x}=d.useFloating({open:e,onOpenChange:o,nodeId:c}),{isMounted:h,styles:C}=d.useTransitionStyles(x,{duration:t,initial(){let u="translateX(75%)";return r==="left"?u="translateX(-75%)":r==="top"?u="translateY(-75%)":r==="bottom"&&(u="translateY(75%)"),{opacity:0,transform:u}}});n.useEffect(()=>{p.current!==h&&(p.current=h,!h&&f.current?.())},[h]);const y=n.useMemo(()=>g("fixed transition-transform z-30",{"top-0 right-0 h-full max-h-screen":r==="right","top-0 left-0 h-full max-h-screen":r==="left","top-0 left-0 right-0 w-full max-w-screen":r==="top","bottom-0 left-0 right-0 w-full max-w-screen":r==="bottom"}),[r]);return f.current=i,s.jsxs(E,{disabled:!h,children:[l?s.jsx(d.FloatingOverlay,{className:"bg-backdrop",style:{opacity:C.opacity},onClick:()=>o?.(!1)}):null,s.jsx("div",{ref:m.setFloating,className:y,role:"dialog",style:C,children:s.jsx(Ce,{...a})})]})}function Ce({className:e,unstyled:t,...o}){const r=n.useMemo(()=>t?e:N(g("relative bg-background min-w-full min-h-full border border-input shadow-lg"),e),[t,e]);return s.jsx("div",{className:r,...o})}function ee({size:e=20,label:t="Loading...",...o}){return s.jsxs("div",{role:"status",...o,children:[s.jsxs("svg",{"aria-hidden":"true",className:"text-accent animate-spin fill-primary",width:e,height:e,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{d:"M100 50.6a50 50 0 1 1-100 0 50 50 0 0 1 100 0Zm-91 0a41 41 0 1 0 82 0 41 41 0 0 0-82 0Z",fill:"currentColor"}),s.jsx("path",{d:"M94 39a4.2 4.2 0 0 0 3-5.4A50 50 0 0 0 41.7 1.3c-2.4.4-3.9 2.9-3.2 5.3a5 5 0 0 0 5.6 3.5A41 41 0 0 1 88 36 5 5 0 0 0 94 39Z",fill:"currentFill"})]}),s.jsx("span",{className:"sr-only",children:t})]})}function te({type:e,label:t,message:o}){const{icons:r}=Re();return s.jsxs("div",{className:"flex items-center px-4 py-3 w-80 text-sm bg-background border border-input rounded-lg shadow-md m-2",children:[e?s.jsxs("figure",{className:"mr-2",children:[e==="success"&&r?.success?r.success:null,e==="info"&&r?.info?r.info:null,e==="error"&&r?.error?r.error:null,e==="warn"&&r?.warn?r.warn:null,e==="loading"?s.jsx(ee,{size:20}):null]}):null,s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"font-medium leading-none",children:t}),o?s.jsx("p",{children:o}):null]})]})}function W(){}class Me{notify=W;lastId=0;subscribe=t=>(this.notify=t,()=>{this.notify=W});add=(t,o={})=>{this.lastId+=1;const r=`${this.lastId}`;return this.notify({id:r,type:"add",config:{id:r,label:t,...o}}),r};update=(t,o)=>{this.notify({id:t,type:"update",config:o})};remove=t=>{this.notify({id:t,type:"remove"})};clear=()=>{this.lastId=0}}const L=new Me;function Ne({id:e,type:t,index:o,duration:r=5e3,className:l,children:i,inverted:a,timeout:c=250,max:p=3}){const f=n.useRef(!1),[m,x]=n.useState(!1),{context:h,refs:C}=d.useFloating({open:m,onOpenChange:x,nodeId:e}),{isMounted:y,styles:u}=d.useTransitionStyles(h,{duration:c,initial:{opacity:0,transform:`translateY(${a?"":"-"}50%)`}});n.useLayoutEffect(()=>{x(o<=p)},[o,p]),n.useEffect(()=>{f.current!==y&&(y||L.remove(e),f.current=y)},[y,e]),n.useEffect(()=>{if(!r)return;const w=window.setTimeout(()=>x(!1),r);return()=>window.clearTimeout(w)},[r,e]);const M=n.useCallback(()=>{t!=="loading"&&x(!1)},[t]),j=n.useMemo(()=>g("relative flex w-fit transition-transform ease-in-out cursor-pointer",l),[l]);return y?s.jsx("li",{role:"log",tabIndex:-1,ref:C.setFloating,className:j,style:u,onClick:M,children:i}):null}const ne=n.createContext({});function Re(){return n.useContext(ne)}function ke({className:e,margin:t=16,position:o="top-left",max:r,ListItem:l=te,icons:i}){const a=n.useMemo(()=>{const u={position:"fixed"};return o.indexOf("top")>-1?u.top=t:o.indexOf("bottom")>-1&&(u.bottom=t),o.indexOf("left")>-1?(u.left=t,u.alignItems="flex-start"):o.indexOf("right")>-1?(u.right=t,u.alignItems="flex-end"):(u.left="50%",u.alignItems="center",u.transform="translateX(-50%)"),u},[t,o]),c=n.useMemo(()=>g("flex flex-col z-40 overflow-hidden",e),[e]),p=n.useMemo(()=>o?.startsWith("bottom")||!1,[o]),f=n.useRef(new Map),[m,x]=n.useState([]),h=n.useState(0)[1];q(()=>L.subscribe(u=>{n.startTransition(()=>{if(u.type==="add")f.current.set(u.id,u.config),x(M=>[...M,u.id]);else if(u.type==="remove"){if(!f.current.delete(u.id))return;x(j=>{const w=new Set(j);return w.has(u.id)?(w.delete(u.id),Array.from(w)):j})}else if(u.type==="update"){const M=f.current.get(u.id);if(!M)return;f.current.set(u.id,{...M,...u.config}),h(j=>j+1)}})}),[]);const C=n.useMemo(()=>({icons:i}),[i]),y=m.length;return s.jsx(E,{children:s.jsx("ol",{className:c,style:a,"aria-live":"polite",children:s.jsx(ne.Provider,{value:C,children:m.map((u,M)=>{const j=f.current.get(u);if(!j)return null;const{className:w,duration:v,...S}=j;return s.jsx(Ne,{id:u,index:y-M,className:w,duration:v,inverted:p,max:r,children:n.createElement(l,S)},u)})})})})}function Ie({className:e,...t}){const o=n.useMemo(()=>N("inline-block animate-pulse rounded-md bg-accent",e),[e]);return s.jsx("div",{className:o,...t})}function Fe({className:e,...t}){const o=n.useMemo(()=>g("flex items-center justify-center","[&_button]:rounded-none [&_:first-child]:rounded-bl [&_:first-child]:rounded-tl [&_:last-child]:rounded-br [&_:last-child]:rounded-tr","[&_:first-child]:border-r-0 [&_:last-child]:border-l-0",e),[e]);return s.jsx("div",{role:"group",className:o,...t})}function Se({value:e,max:t,className:o,...r}){const l=n.useMemo(()=>e?Math.round(e/t*100):0,[e,t]),i=n.useMemo(()=>N("relative overflow-hidden rounded-full bg-primary",o),[o]);return s.jsx("div",{role:"progressbar",className:i,"aria-valuemax":t,"aria-valuemin":0,...r,children:s.jsx("div",{className:"h-full w-full flex-1 bg-input transition-all origin-right",style:{transform:`translateX(${l>100?100:l}%)`}})})}function Te({className:e,orientation:t="horizontal",...o}){const r=n.useMemo(()=>N(g("border-0 p-0 shrink-0 bg-input",t==="horizontal"?"h-[1px] w-full":"w-[1px] h-full"),e),[e,t]);return s.jsx("hr",{className:r,role:"none",...o})}exports.clsx=g;exports.Accordion=he;exports.Button=ye;exports.ButtonGroup=Fe;exports.Checkbox=fe;exports.Dialog=we;exports.Divider=Te;exports.FormField=ae;exports.FormLabel=Y;exports.Input=z;exports.InputField=ce;exports.Popover=H;exports.Portal=E;exports.Progress=Se;exports.Radio=xe;exports.Select=be;exports.Sheet=je;exports.Skeleton=Ie;exports.Spinner=ee;exports.Switch=K;exports.Textarea=Z;exports.Toast=ke;exports.ToastItem=te;exports.Tooltip=U;exports.merge=N;exports.toast=L;exports.varientButton=Q;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("clsx"),_t=require("tailwind-merge"),F=require("@floating-ui/react");function ee(o,r){return r?_t.twMerge(o,r):o}var Te={exports:{}},ge={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Ge;function Et(){if(Ge)return ge;Ge=1;var o=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function l(a,m,f){var v=null;if(f!==void 0&&(v=""+f),m.key!==void 0&&(v=""+m.key),"key"in m){f={};for(var O in m)O!=="key"&&(f[O]=m[O])}else f=m;return m=f.ref,{$$typeof:o,type:a,key:v,ref:m!==void 0?m:null,props:f}}return ge.Fragment=r,ge.jsx=l,ge.jsxs=l,ge}var ye={},Oe={exports:{}},j={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Ve;function wt(){if(Ve)return j;Ve=1;var o=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),v=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),i=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),c=Symbol.iterator;function s(t){return t===null||typeof t!="object"?null:(t=c&&t[c]||t["@@iterator"],typeof t=="function"?t:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,R={};function $(t,u,E){this.props=t,this.context=u,this.refs=R,this.updater=E||b}$.prototype.isReactComponent={},$.prototype.setState=function(t,u){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,u,"setState")},$.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function U(){}U.prototype=$.prototype;function q(t,u,E){this.props=t,this.context=u,this.refs=R,this.updater=E||b}var Y=q.prototype=new U;Y.constructor=q,S(Y,$.prototype),Y.isPureReactComponent=!0;var te=Array.isArray,M={H:null,A:null,T:null,S:null,V:null},ne=Object.prototype.hasOwnProperty;function ie(t,u,E,w,x,H){return E=H.ref,{$$typeof:o,type:t,key:u,ref:E!==void 0?E:null,props:H}}function X(t,u){return ie(t.type,u,void 0,void 0,void 0,t.props)}function K(t){return typeof t=="object"&&t!==null&&t.$$typeof===o}function ae(t){var u={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(E){return u[E]})}var N=/\/+/g;function G(t,u){return typeof t=="object"&&t!==null&&t.key!=null?ae(""+t.key):u.toString(36)}function ce(){}function oe(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(ce,ce):(t.status="pending",t.then(function(u){t.status==="pending"&&(t.status="fulfilled",t.value=u)},function(u){t.status==="pending"&&(t.status="rejected",t.reason=u)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function Q(t,u,E,w,x){var H=typeof t;(H==="undefined"||H==="boolean")&&(t=null);var C=!1;if(t===null)C=!0;else switch(H){case"bigint":case"string":case"number":C=!0;break;case"object":switch(t.$$typeof){case o:case r:C=!0;break;case _:return C=t._init,Q(C(t._payload),u,E,w,x)}}if(C)return x=x(t),C=w===""?"."+G(t,0):w,te(x)?(E="",C!=null&&(E=C.replace(N,"$&/")+"/"),Q(x,u,E,"",function(se){return se})):x!=null&&(K(x)&&(x=X(x,E+(x.key==null||t&&t.key===x.key?"":(""+x.key).replace(N,"$&/")+"/")+C)),u.push(x)),1;C=0;var re=w===""?".":w+":";if(te(t))for(var A=0;A<t.length;A++)w=t[A],H=re+G(w,A),C+=Q(w,u,E,H,x);else if(A=s(t),typeof A=="function")for(t=A.call(t),A=0;!(w=t.next()).done;)w=w.value,H=re+G(w,A++),C+=Q(w,u,E,H,x);else if(H==="object"){if(typeof t.then=="function")return Q(oe(t),u,E,w,x);throw u=String(t),Error("Objects are not valid as a React child (found: "+(u==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":u)+"). If you meant to render a collection of children, use an array instead.")}return C}function k(t,u,E){if(t==null)return t;var w=[],x=0;return Q(t,w,"","",function(H){return u.call(E,H,x++)}),w}function V(t){if(t._status===-1){var u=t._result;u=u(),u.then(function(E){(t._status===0||t._status===-1)&&(t._status=1,t._result=E)},function(E){(t._status===0||t._status===-1)&&(t._status=2,t._result=E)}),t._status===-1&&(t._status=0,t._result=u)}if(t._status===1)return t._result.default;throw t._result}var B=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function le(){}return j.Children={map:k,forEach:function(t,u,E){k(t,function(){u.apply(this,arguments)},E)},count:function(t){var u=0;return k(t,function(){u++}),u},toArray:function(t){return k(t,function(u){return u})||[]},only:function(t){if(!K(t))throw Error("React.Children.only expected to receive a single React element child.");return t}},j.Component=$,j.Fragment=l,j.Profiler=m,j.PureComponent=q,j.StrictMode=a,j.Suspense=p,j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,j.__COMPILER_RUNTIME={__proto__:null,c:function(t){return M.H.useMemoCache(t)}},j.cache=function(t){return function(){return t.apply(null,arguments)}},j.cloneElement=function(t,u,E){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var w=S({},t.props),x=t.key,H=void 0;if(u!=null)for(C in u.ref!==void 0&&(H=void 0),u.key!==void 0&&(x=""+u.key),u)!ne.call(u,C)||C==="key"||C==="__self"||C==="__source"||C==="ref"&&u.ref===void 0||(w[C]=u[C]);var C=arguments.length-2;if(C===1)w.children=E;else if(1<C){for(var re=Array(C),A=0;A<C;A++)re[A]=arguments[A+2];w.children=re}return ie(t.type,x,void 0,void 0,H,w)},j.createContext=function(t){return t={$$typeof:v,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:f,_context:t},t},j.createElement=function(t,u,E){var w,x={},H=null;if(u!=null)for(w in u.key!==void 0&&(H=""+u.key),u)ne.call(u,w)&&w!=="key"&&w!=="__self"&&w!=="__source"&&(x[w]=u[w]);var C=arguments.length-2;if(C===1)x.children=E;else if(1<C){for(var re=Array(C),A=0;A<C;A++)re[A]=arguments[A+2];x.children=re}if(t&&t.defaultProps)for(w in C=t.defaultProps,C)x[w]===void 0&&(x[w]=C[w]);return ie(t,H,void 0,void 0,null,x)},j.createRef=function(){return{current:null}},j.forwardRef=function(t){return{$$typeof:O,render:t}},j.isValidElement=K,j.lazy=function(t){return{$$typeof:_,_payload:{_status:-1,_result:t},_init:V}},j.memo=function(t,u){return{$$typeof:i,type:t,compare:u===void 0?null:u}},j.startTransition=function(t){var u=M.T,E={};M.T=E;try{var w=t(),x=M.S;x!==null&&x(E,w),typeof w=="object"&&w!==null&&typeof w.then=="function"&&w.then(le,B)}catch(H){B(H)}finally{M.T=u}},j.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},j.use=function(t){return M.H.use(t)},j.useActionState=function(t,u,E){return M.H.useActionState(t,u,E)},j.useCallback=function(t,u){return M.H.useCallback(t,u)},j.useContext=function(t){return M.H.useContext(t)},j.useDebugValue=function(){},j.useDeferredValue=function(t,u){return M.H.useDeferredValue(t,u)},j.useEffect=function(t,u,E){var w=M.H;if(typeof E=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return w.useEffect(t,u)},j.useId=function(){return M.H.useId()},j.useImperativeHandle=function(t,u,E){return M.H.useImperativeHandle(t,u,E)},j.useInsertionEffect=function(t,u){return M.H.useInsertionEffect(t,u)},j.useLayoutEffect=function(t,u){return M.H.useLayoutEffect(t,u)},j.useMemo=function(t,u){return M.H.useMemo(t,u)},j.useOptimistic=function(t,u){return M.H.useOptimistic(t,u)},j.useReducer=function(t,u,E){return M.H.useReducer(t,u,E)},j.useRef=function(t){return M.H.useRef(t)},j.useState=function(t){return M.H.useState(t)},j.useSyncExternalStore=function(t,u,E){return M.H.useSyncExternalStore(t,u,E)},j.useTransition=function(){return M.H.useTransition()},j.version="19.1.1",j}var he={exports:{}};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* react.development.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/he.exports;var Xe;function Rt(){return Xe||(Xe=1,function(o,r){process.env.NODE_ENV!=="production"&&function(){function l(e,n){Object.defineProperty(f.prototype,e,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",n[0],n[1])}})}function a(e){return e===null||typeof e!="object"?null:(e=ve&&e[ve]||e["@@iterator"],typeof e=="function"?e:null)}function m(e,n){e=(e=e.constructor)&&(e.displayName||e.name)||"ReactClass";var g=e+"."+n;Me[g]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",n,e),Me[g]=!0)}function f(e,n,g){this.props=e,this.context=n,this.refs=je,this.updater=g||De}function v(){}function O(e,n,g){this.props=e,this.context=n,this.refs=je,this.updater=g||De}function p(e){return""+e}function i(e){try{p(e);var n=!1}catch{n=!0}if(n){n=console;var g=n.error,h=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return g.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",h),p(e)}}function _(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===gt?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case t:return"Fragment";case E:return"Profiler";case u:return"StrictMode";case C:return"Suspense";case re:return"SuspenseList";case me:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case le:return"Portal";case x:return(e.displayName||"Context")+".Provider";case w:return(e._context.displayName||"Context")+".Consumer";case H:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case A:return n=e.displayName||null,n!==null?n:_(e.type)||"Memo";case se:n=e._payload,e=e._init;try{return _(e(n))}catch{}}return null}function c(e){if(e===t)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===se)return"<...>";try{var n=_(e);return n?"<"+n+">":"<...>"}catch{return"<...>"}}function s(){var e=I.A;return e===null?null:e.getOwner()}function b(){return Error("react-stack-top-frame")}function S(e){if(_e.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function R(e,n){function g(){Ye||(Ye=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",n))}g.isReactWarning=!0,Object.defineProperty(e,"key",{get:g,configurable:!0})}function $(){var e=_(this.type);return Ue[e]||(Ue[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function U(e,n,g,h,T,L,P,W){return g=L.ref,e={$$typeof:B,type:e,key:n,props:L,_owner:T},(g!==void 0?g:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:$}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:P}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:W}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function q(e,n){return n=U(e.type,n,void 0,void 0,e._owner,e.props,e._debugStack,e._debugTask),e._store&&(n._store.validated=e._store.validated),n}function Y(e){return typeof e=="object"&&e!==null&&e.$$typeof===B}function te(e){var n={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(g){return n[g]})}function M(e,n){return typeof e=="object"&&e!==null&&e.key!=null?(i(e.key),te(""+e.key)):n.toString(36)}function ne(){}function ie(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(ne,ne):(e.status="pending",e.then(function(n){e.status==="pending"&&(e.status="fulfilled",e.value=n)},function(n){e.status==="pending"&&(e.status="rejected",e.reason=n)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function X(e,n,g,h,T){var L=typeof e;(L==="undefined"||L==="boolean")&&(e=null);var P=!1;if(e===null)P=!0;else switch(L){case"bigint":case"string":case"number":P=!0;break;case"object":switch(e.$$typeof){case B:case le:P=!0;break;case se:return P=e._init,X(P(e._payload),n,g,h,T)}}if(P){P=e,T=T(P);var W=h===""?"."+M(P,0):h;return Le(T)?(g="",W!=null&&(g=W.replace(qe,"$&/")+"/"),X(T,n,g,"",function(fe){return fe})):T!=null&&(Y(T)&&(T.key!=null&&(P&&P.key===T.key||i(T.key)),g=q(T,g+(T.key==null||P&&P.key===T.key?"":(""+T.key).replace(qe,"$&/")+"/")+W),h!==""&&P!=null&&Y(P)&&P.key==null&&P._store&&!P._store.validated&&(g._store.validated=2),T=g),n.push(T)),1}if(P=0,W=h===""?".":h+":",Le(e))for(var D=0;D<e.length;D++)h=e[D],L=W+M(h,D),P+=X(h,n,g,L,T);else if(D=a(e),typeof D=="function")for(D===e.entries&&(Fe||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Fe=!0),e=D.call(e),D=0;!(h=e.next()).done;)h=h.value,L=W+M(h,D++),P+=X(h,n,g,L,T);else if(L==="object"){if(typeof e.then=="function")return X(ie(e),n,g,h,T);throw n=String(e),Error("Objects are not valid as a React child (found: "+(n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead.")}return P}function K(e,n,g){if(e==null)return e;var h=[],T=0;return X(e,h,"","",function(L){return n.call(g,L,T++)}),h}function ae(e){if(e._status===-1){var n=e._result;n=n(),n.then(function(g){(e._status===0||e._status===-1)&&(e._status=1,e._result=g)},function(g){(e._status===0||e._status===-1)&&(e._status=2,e._result=g)}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return n=e._result,n===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
26
|
+
|
|
27
|
+
Your code should look like:
|
|
28
|
+
const MyComponent = lazy(() => import('./MyComponent'))
|
|
29
|
+
|
|
30
|
+
Did you accidentally put curly braces around the import?`,n),"default"in n||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
31
|
+
|
|
32
|
+
Your code should look like:
|
|
33
|
+
const MyComponent = lazy(() => import('./MyComponent'))`,n),n.default;throw e._result}function N(){var e=I.H;return e===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
34
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
35
|
+
2. You might be breaking the Rules of Hooks
|
|
36
|
+
3. You might have more than one copy of React in the same app
|
|
37
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),e}function G(){}function ce(e){if(Ee===null)try{var n=("require"+Math.random()).slice(0,7);Ee=(o&&o[n]).call(o,"timers").setImmediate}catch{Ee=function(h){ze===!1&&(ze=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var T=new MessageChannel;T.port1.onmessage=h,T.port2.postMessage(void 0)}}return Ee(e)}function oe(e){return 1<e.length&&typeof AggregateError=="function"?new AggregateError(e):e[0]}function Q(e,n){n!==we-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),we=n}function k(e,n,g){var h=I.actQueue;if(h!==null)if(h.length!==0)try{V(h),ce(function(){return k(e,n,g)});return}catch(T){I.thrownErrors.push(T)}else I.actQueue=null;0<I.thrownErrors.length?(h=oe(I.thrownErrors),I.thrownErrors.length=0,g(h)):n(e)}function V(e){if(!ke){ke=!0;var n=0;try{for(;n<e.length;n++){var g=e[n];do{I.didUsePromise=!1;var h=g(!1);if(h!==null){if(I.didUsePromise){e[n]=g,e.splice(0,n);return}g=h}else break}while(!0)}e.length=0}catch(T){e.splice(0,n+1),I.thrownErrors.push(T)}finally{ke=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var B=Symbol.for("react.transitional.element"),le=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),x=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),re=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),se=Symbol.for("react.lazy"),me=Symbol.for("react.activity"),ve=Symbol.iterator,Me={},De={isMounted:function(){return!1},enqueueForceUpdate:function(e){m(e,"forceUpdate")},enqueueReplaceState:function(e){m(e,"replaceState")},enqueueSetState:function(e){m(e,"setState")}},Ie=Object.assign,je={};Object.freeze(je),f.prototype.isReactComponent={},f.prototype.setState=function(e,n){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,n,"setState")},f.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var ue={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},be;for(be in ue)ue.hasOwnProperty(be)&&l(be,ue[be]);v.prototype=f.prototype,ue=O.prototype=new v,ue.constructor=O,Ie(ue,f.prototype),ue.isPureReactComponent=!0;var Le=Array.isArray,gt=Symbol.for("react.client.reference"),I={H:null,A:null,T:null,S:null,V:null,actQueue:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},_e=Object.prototype.hasOwnProperty,$e=console.createTask?console.createTask:function(){return null};ue={react_stack_bottom_frame:function(e){return e()}};var Ye,He,Ue={},yt=ue.react_stack_bottom_frame.bind(ue,b)(),ht=$e(c(b)),Fe=!1,qe=/\/+/g,We=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ze=!1,Ee=null,we=0,Re=!1,ke=!1,Be=typeof queueMicrotask=="function"?function(e){queueMicrotask(function(){return queueMicrotask(e)})}:ce;ue=Object.freeze({__proto__:null,c:function(e){return N().useMemoCache(e)}}),r.Children={map:K,forEach:function(e,n,g){K(e,function(){n.apply(this,arguments)},g)},count:function(e){var n=0;return K(e,function(){n++}),n},toArray:function(e){return K(e,function(n){return n})||[]},only:function(e){if(!Y(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},r.Component=f,r.Fragment=t,r.Profiler=E,r.PureComponent=O,r.StrictMode=u,r.Suspense=C,r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,r.__COMPILER_RUNTIME=ue,r.act=function(e){var n=I.actQueue,g=we;we++;var h=I.actQueue=n!==null?n:[],T=!1;try{var L=e()}catch(D){I.thrownErrors.push(D)}if(0<I.thrownErrors.length)throw Q(n,g),e=oe(I.thrownErrors),I.thrownErrors.length=0,e;if(L!==null&&typeof L=="object"&&typeof L.then=="function"){var P=L;return Be(function(){T||Re||(Re=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(D,fe){T=!0,P.then(function(de){if(Q(n,g),g===0){try{V(h),ce(function(){return k(de,D,fe)})}catch(bt){I.thrownErrors.push(bt)}if(0<I.thrownErrors.length){var vt=oe(I.thrownErrors);I.thrownErrors.length=0,fe(vt)}}else D(de)},function(de){Q(n,g),0<I.thrownErrors.length&&(de=oe(I.thrownErrors),I.thrownErrors.length=0),fe(de)})}}}var W=L;if(Q(n,g),g===0&&(V(h),h.length!==0&&Be(function(){T||Re||(Re=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),I.actQueue=null),0<I.thrownErrors.length)throw e=oe(I.thrownErrors),I.thrownErrors.length=0,e;return{then:function(D,fe){T=!0,g===0?(I.actQueue=h,ce(function(){return k(W,D,fe)})):D(W)}}},r.cache=function(e){return function(){return e.apply(null,arguments)}},r.captureOwnerStack=function(){var e=I.getCurrentStack;return e===null?null:e()},r.cloneElement=function(e,n,g){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var h=Ie({},e.props),T=e.key,L=e._owner;if(n!=null){var P;e:{if(_e.call(n,"ref")&&(P=Object.getOwnPropertyDescriptor(n,"ref").get)&&P.isReactWarning){P=!1;break e}P=n.ref!==void 0}P&&(L=s()),S(n)&&(i(n.key),T=""+n.key);for(W in n)!_e.call(n,W)||W==="key"||W==="__self"||W==="__source"||W==="ref"&&n.ref===void 0||(h[W]=n[W])}var W=arguments.length-2;if(W===1)h.children=g;else if(1<W){P=Array(W);for(var D=0;D<W;D++)P[D]=arguments[D+2];h.children=P}for(h=U(e.type,T,void 0,void 0,L,h,e._debugStack,e._debugTask),T=2;T<arguments.length;T++)L=arguments[T],Y(L)&&L._store&&(L._store.validated=1);return h},r.createContext=function(e){return e={$$typeof:x,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:w,_context:e},e._currentRenderer=null,e._currentRenderer2=null,e},r.createElement=function(e,n,g){for(var h=2;h<arguments.length;h++){var T=arguments[h];Y(T)&&T._store&&(T._store.validated=1)}if(h={},T=null,n!=null)for(D in He||!("__self"in n)||"key"in n||(He=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),S(n)&&(i(n.key),T=""+n.key),n)_e.call(n,D)&&D!=="key"&&D!=="__self"&&D!=="__source"&&(h[D]=n[D]);var L=arguments.length-2;if(L===1)h.children=g;else if(1<L){for(var P=Array(L),W=0;W<L;W++)P[W]=arguments[W+2];Object.freeze&&Object.freeze(P),h.children=P}if(e&&e.defaultProps)for(D in L=e.defaultProps,L)h[D]===void 0&&(h[D]=L[D]);T&&R(h,typeof e=="function"?e.displayName||e.name||"Unknown":e);var D=1e4>I.recentlyCreatedOwnerStacks++;return U(e,T,void 0,void 0,s(),h,D?Error("react-stack-top-frame"):yt,D?$e(c(e)):ht)},r.createRef=function(){var e={current:null};return Object.seal(e),e},r.forwardRef=function(e){e!=null&&e.$$typeof===A?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof e!="function"?console.error("forwardRef requires a render function but was given %s.",e===null?"null":typeof e):e.length!==0&&e.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",e.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),e!=null&&e.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var n={$$typeof:H,render:e},g;return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return g},set:function(h){g=h,e.name||e.displayName||(Object.defineProperty(e,"name",{value:h}),e.displayName=h)}}),n},r.isValidElement=Y,r.lazy=function(e){return{$$typeof:se,_payload:{_status:-1,_result:e},_init:ae}},r.memo=function(e,n){e==null&&console.error("memo: The first argument must be a component. Instead received: %s",e===null?"null":typeof e),n={$$typeof:A,type:e,compare:n===void 0?null:n};var g;return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return g},set:function(h){g=h,e.name||e.displayName||(Object.defineProperty(e,"name",{value:h}),e.displayName=h)}}),n},r.startTransition=function(e){var n=I.T,g={};I.T=g,g._updatedFibers=new Set;try{var h=e(),T=I.S;T!==null&&T(g,h),typeof h=="object"&&h!==null&&typeof h.then=="function"&&h.then(G,We)}catch(L){We(L)}finally{n===null&&g._updatedFibers&&(e=g._updatedFibers.size,g._updatedFibers.clear(),10<e&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),I.T=n}},r.unstable_useCacheRefresh=function(){return N().useCacheRefresh()},r.use=function(e){return N().use(e)},r.useActionState=function(e,n,g){return N().useActionState(e,n,g)},r.useCallback=function(e,n){return N().useCallback(e,n)},r.useContext=function(e){var n=N();return e.$$typeof===w&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),n.useContext(e)},r.useDebugValue=function(e,n){return N().useDebugValue(e,n)},r.useDeferredValue=function(e,n){return N().useDeferredValue(e,n)},r.useEffect=function(e,n,g){e==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?");var h=N();if(typeof g=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return h.useEffect(e,n)},r.useId=function(){return N().useId()},r.useImperativeHandle=function(e,n,g){return N().useImperativeHandle(e,n,g)},r.useInsertionEffect=function(e,n){return e==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),N().useInsertionEffect(e,n)},r.useLayoutEffect=function(e,n){return e==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),N().useLayoutEffect(e,n)},r.useMemo=function(e,n){return N().useMemo(e,n)},r.useOptimistic=function(e,n){return N().useOptimistic(e,n)},r.useReducer=function(e,n,g){return N().useReducer(e,n,g)},r.useRef=function(e){return N().useRef(e)},r.useState=function(e){return N().useState(e)},r.useSyncExternalStore=function(e,n,g){return N().useSyncExternalStore(e,n,g)},r.useTransition=function(){return N().useTransition()},r.version="19.1.1",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()}(he,he.exports)),he.exports}var Ke;function Ce(){return Ke||(Ke=1,process.env.NODE_ENV==="production"?Oe.exports=wt():Oe.exports=Rt()),Oe.exports}/**
|
|
38
|
+
* @license React
|
|
39
|
+
* react-jsx-runtime.development.js
|
|
40
|
+
*
|
|
41
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the MIT license found in the
|
|
44
|
+
* LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/var Qe;function Tt(){return Qe||(Qe=1,process.env.NODE_ENV!=="production"&&function(){function o(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===ae?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case R:return"Fragment";case U:return"Profiler";case $:return"StrictMode";case M:return"Suspense";case ne:return"SuspenseList";case K:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case S:return"Portal";case Y:return(t.displayName||"Context")+".Provider";case q:return(t._context.displayName||"Context")+".Consumer";case te:var u=t.render;return t=t.displayName,t||(t=u.displayName||u.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ie:return u=t.displayName||null,u!==null?u:o(t.type)||"Memo";case X:u=t._payload,t=t._init;try{return o(t(u))}catch{}}return null}function r(t){return""+t}function l(t){try{r(t);var u=!1}catch{u=!0}if(u){u=console;var E=u.error,w=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return E.call(u,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",w),r(t)}}function a(t){if(t===R)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===X)return"<...>";try{var u=o(t);return u?"<"+u+">":"<...>"}catch{return"<...>"}}function m(){var t=N.A;return t===null?null:t.getOwner()}function f(){return Error("react-stack-top-frame")}function v(t){if(G.call(t,"key")){var u=Object.getOwnPropertyDescriptor(t,"key").get;if(u&&u.isReactWarning)return!1}return t.key!==void 0}function O(t,u){function E(){Q||(Q=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",u))}E.isReactWarning=!0,Object.defineProperty(t,"key",{get:E,configurable:!0})}function p(){var t=o(this.type);return k[t]||(k[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function i(t,u,E,w,x,H,C,re){return E=H.ref,t={$$typeof:b,type:t,key:u,props:H,_owner:x},(E!==void 0?E:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:p}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:C}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function _(t,u,E,w,x,H,C,re){var A=u.children;if(A!==void 0)if(w)if(ce(A)){for(w=0;w<A.length;w++)c(A[w]);Object.freeze&&Object.freeze(A)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else c(A);if(G.call(u,"key")){A=o(t);var se=Object.keys(u).filter(function(ve){return ve!=="key"});w=0<se.length?"{key: someKey, "+se.join(": ..., ")+": ...}":"{key: someKey}",le[A+w]||(se=0<se.length?"{"+se.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
46
|
+
let props = %s;
|
|
47
|
+
<%s {...props} />
|
|
48
|
+
React keys must be passed directly to JSX without using spread:
|
|
49
|
+
let props = %s;
|
|
50
|
+
<%s key={someKey} {...props} />`,w,A,se,A),le[A+w]=!0)}if(A=null,E!==void 0&&(l(E),A=""+E),v(u)&&(l(u.key),A=""+u.key),"key"in u){E={};for(var me in u)me!=="key"&&(E[me]=u[me])}else E=u;return A&&O(E,typeof t=="function"?t.displayName||t.name||"Unknown":t),i(t,A,H,x,m(),E,C,re)}function c(t){typeof t=="object"&&t!==null&&t.$$typeof===b&&t._store&&(t._store.validated=1)}var s=Ce(),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),q=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),te=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),ae=Symbol.for("react.client.reference"),N=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=Object.prototype.hasOwnProperty,ce=Array.isArray,oe=console.createTask?console.createTask:function(){return null};s={react_stack_bottom_frame:function(t){return t()}};var Q,k={},V=s.react_stack_bottom_frame.bind(s,f)(),B=oe(a(f)),le={};ye.Fragment=R,ye.jsx=function(t,u,E,w,x){var H=1e4>N.recentlyCreatedOwnerStacks++;return _(t,u,E,!1,w,x,H?Error("react-stack-top-frame"):V,H?oe(a(t)):B)},ye.jsxs=function(t,u,E,w,x){var H=1e4>N.recentlyCreatedOwnerStacks++;return _(t,u,E,!0,w,x,H?Error("react-stack-top-frame"):V,H?oe(a(t)):B)}}()),ye}var Ze;function Ot(){return Ze||(Ze=1,process.env.NODE_ENV==="production"?Te.exports=Et():Te.exports=Tt()),Te.exports}var y=Ot(),d=Ce();function nt({className:o,...r}){const l=d.useMemo(()=>z("leading-none peer-disabled:opacity-70",o),[o]);return y.jsx("label",{className:l,...r})}function St({label:o,children:r,required:l,htmlFor:a,error:m,help:f,helpBefore:v,className:O,innerClass:p,...i}){const _=d.useMemo(()=>z("font-medium",l?'after:content-["*"] after:text-danger after:text-sm after:pl-0.5':""),[l]),c=d.useMemo(()=>ee("flex flex-col space-y-2",O),[O]);return y.jsxs("div",{className:c,...i,children:[o?y.jsx(nt,{className:_,htmlFor:a,children:o}):null,f&&v?y.jsx("p",{className:"text-xs text-muted pb-2",children:f}):null,y.jsx("div",{className:p,children:xt(r,!!m)}),f&&!v&&!m?y.jsx("p",{className:"text-xs text-muted",children:f}):null,m?y.jsx("p",{className:"text-xs text-danger",children:m}):null]})}function xt(o,r){const l=d.Children.count(o);if(!l)return null;if(l===1)return d.cloneElement(o,{error:r});const a=d.Children.toArray(o);return a[0]=d.cloneElement(a[0],{error:r}),a}function Ct({error:o,unstyled:r,className:l,...a}){const m=d.useMemo(()=>r?l:ee(z("flex rounded-md border bg-background px-3 py-2 w-full [&_input]:placeholder:text-muted","[&_input]:disabled:opacity-50 [&_input]:focus-visible:outline-none",o?"border-danger hover:border-danger-fore":"border-input"),l),[l,o,r]);return y.jsx("div",{className:m,...a})}const ot=d.forwardRef(({className:o,type:r,error:l,unstyled:a,...m},f)=>{const v=d.useMemo(()=>a?o:ee(z("flex rounded-md border bg-background px-3 py-2 w-full placeholder:text-muted","disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",l?"border-danger hover:border-danger-fore":"border-input not-disabled:hover:border-input-fore",r==="file"?"file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground":null),o),[o,r,l,a]);return y.jsx("input",{ref:f,type:r,className:v,...m})});ot.displayName="Input";const st=d.forwardRef(({className:o,error:r,unstyled:l,...a},m)=>{const f=d.useMemo(()=>l?o:ee(z("flex rounded-md border bg-background px-3 py-2 w-full","disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",r?"border-danger hover:border-danger-fore":"border-input not-disabled:hover:border-input-fore"),o),[o,r,l]);return y.jsx("textarea",{ref:m,className:f,...a})});st.displayName="Textarea";function jt(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",children:y.jsx("rect",{width:"20",height:"3",y:"13.5",x:"4.5",fill:"currentColor",stroke:"none",rx:"2"})})}function kt({checked:o,indeterminate:r,className:l,id:a,name:m,onChange:f,value:v,checkIcon:O,...p}){const i=d.useMemo(()=>ee(z("inline-flex justify-center items-center border w-4.5 h-4.5 rounded","cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",o||r?"bg-primary text-inverted disabled:text-text disabled:bg-input disabled:border-input":"border-input not-disabled:hover:border-input-fore"),l),[o,r,l]),_=()=>{p.disabled||f?.(!o)};return y.jsxs("button",{type:"button",role:"checkbox",id:a||m,className:i,onClick:_,"aria-checked":o,...p,children:[o?O:null,r&&!o?y.jsx(jt,{}):null,y.jsx("input",{type:"checkbox","aria-hidden":"true",name:m,checked:o,value:v,onChange:_,disabled:p.disabled,style:{position:"absolute",pointerEvents:"none",top:0,left:0,width:1,height:1,opacity:0}})]})}var Se={exports:{}},Z={};/**
|
|
51
|
+
* @license React
|
|
52
|
+
* react-dom.production.js
|
|
53
|
+
*
|
|
54
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
55
|
+
*
|
|
56
|
+
* This source code is licensed under the MIT license found in the
|
|
57
|
+
* LICENSE file in the root directory of this source tree.
|
|
58
|
+
*/var Je;function At(){if(Je)return Z;Je=1;var o=Ce();function r(p){var i="https://react.dev/errors/"+p;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)i+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+p+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(){}var a={d:{f:l,r:function(){throw Error(r(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},m=Symbol.for("react.portal");function f(p,i,_){var c=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m,key:c==null?null:""+c,children:p,containerInfo:i,implementation:_}}var v=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function O(p,i){if(p==="font")return"";if(typeof i=="string")return i==="use-credentials"?i:""}return Z.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Z.createPortal=function(p,i){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)throw Error(r(299));return f(p,i,null,_)},Z.flushSync=function(p){var i=v.T,_=a.p;try{if(v.T=null,a.p=2,p)return p()}finally{v.T=i,a.p=_,a.d.f()}},Z.preconnect=function(p,i){typeof p=="string"&&(i?(i=i.crossOrigin,i=typeof i=="string"?i==="use-credentials"?i:"":void 0):i=null,a.d.C(p,i))},Z.prefetchDNS=function(p){typeof p=="string"&&a.d.D(p)},Z.preinit=function(p,i){if(typeof p=="string"&&i&&typeof i.as=="string"){var _=i.as,c=O(_,i.crossOrigin),s=typeof i.integrity=="string"?i.integrity:void 0,b=typeof i.fetchPriority=="string"?i.fetchPriority:void 0;_==="style"?a.d.S(p,typeof i.precedence=="string"?i.precedence:void 0,{crossOrigin:c,integrity:s,fetchPriority:b}):_==="script"&&a.d.X(p,{crossOrigin:c,integrity:s,fetchPriority:b,nonce:typeof i.nonce=="string"?i.nonce:void 0})}},Z.preinitModule=function(p,i){if(typeof p=="string")if(typeof i=="object"&&i!==null){if(i.as==null||i.as==="script"){var _=O(i.as,i.crossOrigin);a.d.M(p,{crossOrigin:_,integrity:typeof i.integrity=="string"?i.integrity:void 0,nonce:typeof i.nonce=="string"?i.nonce:void 0})}}else i==null&&a.d.M(p)},Z.preload=function(p,i){if(typeof p=="string"&&typeof i=="object"&&i!==null&&typeof i.as=="string"){var _=i.as,c=O(_,i.crossOrigin);a.d.L(p,_,{crossOrigin:c,integrity:typeof i.integrity=="string"?i.integrity:void 0,nonce:typeof i.nonce=="string"?i.nonce:void 0,type:typeof i.type=="string"?i.type:void 0,fetchPriority:typeof i.fetchPriority=="string"?i.fetchPriority:void 0,referrerPolicy:typeof i.referrerPolicy=="string"?i.referrerPolicy:void 0,imageSrcSet:typeof i.imageSrcSet=="string"?i.imageSrcSet:void 0,imageSizes:typeof i.imageSizes=="string"?i.imageSizes:void 0,media:typeof i.media=="string"?i.media:void 0})}},Z.preloadModule=function(p,i){if(typeof p=="string")if(i){var _=O(i.as,i.crossOrigin);a.d.m(p,{as:typeof i.as=="string"&&i.as!=="script"?i.as:void 0,crossOrigin:_,integrity:typeof i.integrity=="string"?i.integrity:void 0})}else a.d.m(p)},Z.requestFormReset=function(p){a.d.r(p)},Z.unstable_batchedUpdates=function(p,i){return p(i)},Z.useFormState=function(p,i,_){return v.H.useFormState(p,i,_)},Z.useFormStatus=function(){return v.H.useHostTransitionStatus()},Z.version="19.1.1",Z}var J={};/**
|
|
59
|
+
* @license React
|
|
60
|
+
* react-dom.development.js
|
|
61
|
+
*
|
|
62
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the MIT license found in the
|
|
65
|
+
* LICENSE file in the root directory of this source tree.
|
|
66
|
+
*/var et;function Nt(){return et||(et=1,process.env.NODE_ENV!=="production"&&function(){function o(){}function r(c){return""+c}function l(c,s,b){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{r(S);var R=!1}catch{R=!0}return R&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol=="function"&&Symbol.toStringTag&&S[Symbol.toStringTag]||S.constructor.name||"Object"),r(S)),{$$typeof:i,key:S==null?null:""+S,children:c,containerInfo:s,implementation:b}}function a(c,s){if(c==="font")return"";if(typeof s=="string")return s==="use-credentials"?s:""}function m(c){return c===null?"`null`":c===void 0?"`undefined`":c===""?"an empty string":'something with type "'+typeof c+'"'}function f(c){return c===null?"`null`":c===void 0?"`undefined`":c===""?"an empty string":typeof c=="string"?JSON.stringify(c):typeof c=="number"?"`"+c+"`":'something with type "'+typeof c+'"'}function v(){var c=_.H;return c===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
67
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
68
|
+
2. You might be breaking the Rules of Hooks
|
|
69
|
+
3. You might have more than one copy of React in the same app
|
|
70
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var O=Ce(),p={d:{f:o,r:function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},i=Symbol.for("react.portal"),_=O.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;typeof Map=="function"&&Map.prototype!=null&&typeof Map.prototype.forEach=="function"&&typeof Set=="function"&&Set.prototype!=null&&typeof Set.prototype.clear=="function"&&typeof Set.prototype.forEach=="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),J.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=p,J.createPortal=function(c,s){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)throw Error("Target container is not a DOM element.");return l(c,s,null,b)},J.flushSync=function(c){var s=_.T,b=p.p;try{if(_.T=null,p.p=2,c)return c()}finally{_.T=s,p.p=b,p.d.f()&&console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.")}},J.preconnect=function(c,s){typeof c=="string"&&c?s!=null&&typeof s!="object"?console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",f(s)):s!=null&&typeof s.crossOrigin!="string"&&console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",m(s.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",m(c)),typeof c=="string"&&(s?(s=s.crossOrigin,s=typeof s=="string"?s==="use-credentials"?s:"":void 0):s=null,p.d.C(c,s))},J.prefetchDNS=function(c){if(typeof c!="string"||!c)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",m(c));else if(1<arguments.length){var s=arguments[1];typeof s=="object"&&s.hasOwnProperty("crossOrigin")?console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",f(s)):console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",f(s))}typeof c=="string"&&p.d.D(c)},J.preinit=function(c,s){if(typeof c=="string"&&c?s==null||typeof s!="object"?console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",f(s)):s.as!=="style"&&s.as!=="script"&&console.error('ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',f(s.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",m(c)),typeof c=="string"&&s&&typeof s.as=="string"){var b=s.as,S=a(b,s.crossOrigin),R=typeof s.integrity=="string"?s.integrity:void 0,$=typeof s.fetchPriority=="string"?s.fetchPriority:void 0;b==="style"?p.d.S(c,typeof s.precedence=="string"?s.precedence:void 0,{crossOrigin:S,integrity:R,fetchPriority:$}):b==="script"&&p.d.X(c,{crossOrigin:S,integrity:R,fetchPriority:$,nonce:typeof s.nonce=="string"?s.nonce:void 0})}},J.preinitModule=function(c,s){var b="";if(typeof c=="string"&&c||(b+=" The `href` argument encountered was "+m(c)+"."),s!==void 0&&typeof s!="object"?b+=" The `options` argument encountered was "+m(s)+".":s&&"as"in s&&s.as!=="script"&&(b+=" The `as` option encountered was "+f(s.as)+"."),b)console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",b);else switch(b=s&&typeof s.as=="string"?s.as:"script",b){case"script":break;default:b=f(b),console.error('ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',b,c)}typeof c=="string"&&(typeof s=="object"&&s!==null?(s.as==null||s.as==="script")&&(b=a(s.as,s.crossOrigin),p.d.M(c,{crossOrigin:b,integrity:typeof s.integrity=="string"?s.integrity:void 0,nonce:typeof s.nonce=="string"?s.nonce:void 0})):s==null&&p.d.M(c))},J.preload=function(c,s){var b="";if(typeof c=="string"&&c||(b+=" The `href` argument encountered was "+m(c)+"."),s==null||typeof s!="object"?b+=" The `options` argument encountered was "+m(s)+".":typeof s.as=="string"&&s.as||(b+=" The `as` option encountered was "+m(s.as)+"."),b&&console.error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',b),typeof c=="string"&&typeof s=="object"&&s!==null&&typeof s.as=="string"){b=s.as;var S=a(b,s.crossOrigin);p.d.L(c,b,{crossOrigin:S,integrity:typeof s.integrity=="string"?s.integrity:void 0,nonce:typeof s.nonce=="string"?s.nonce:void 0,type:typeof s.type=="string"?s.type:void 0,fetchPriority:typeof s.fetchPriority=="string"?s.fetchPriority:void 0,referrerPolicy:typeof s.referrerPolicy=="string"?s.referrerPolicy:void 0,imageSrcSet:typeof s.imageSrcSet=="string"?s.imageSrcSet:void 0,imageSizes:typeof s.imageSizes=="string"?s.imageSizes:void 0,media:typeof s.media=="string"?s.media:void 0})}},J.preloadModule=function(c,s){var b="";typeof c=="string"&&c||(b+=" The `href` argument encountered was "+m(c)+"."),s!==void 0&&typeof s!="object"?b+=" The `options` argument encountered was "+m(s)+".":s&&"as"in s&&typeof s.as!="string"&&(b+=" The `as` option encountered was "+m(s.as)+"."),b&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',b),typeof c=="string"&&(s?(b=a(s.as,s.crossOrigin),p.d.m(c,{as:typeof s.as=="string"&&s.as!=="script"?s.as:void 0,crossOrigin:b,integrity:typeof s.integrity=="string"?s.integrity:void 0})):p.d.m(c))},J.requestFormReset=function(c){p.d.r(c)},J.unstable_batchedUpdates=function(c,s){return c(s)},J.useFormState=function(c,s,b){return v().useFormState(c,s,b)},J.useFormStatus=function(){return v().useHostTransitionStatus()},J.version="19.1.1",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),J}var tt;function Pt(){if(tt)return Se.exports;tt=1;function o(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(process.env.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(r){console.error(r)}}}return process.env.NODE_ENV==="production"?(o(),Se.exports=At()):Se.exports=Nt(),Se.exports}var Mt=Pt();const Dt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Ae=Dt?d.useLayoutEffect:d.useEffect;function pe({children:o,container:r,disabled:l}){const[a,m]=d.useState(null);return Ae(()=>{if(!r){let f=document.getElementById("visits-style-portals");return f||(f=document.createElement("div"),f.id="visits-style-portals",document.body.appendChild(f)),m(f)}m(r)},[r]),l||!a?null:Mt.createPortal(o,a)}function xe(o){o&&(o.stopPropagation(),o.preventDefault())}const It={open:150,close:75},Ne=d.forwardRef(({position:o,label:r,children:l,disabled:a,offset:m={x:0,y:6},onOpen:f,onClose:v,onManualClose:O,timeout:p=It,unstyled:i,zIndex:_=9996,role:c,...s},b)=>{const[S,R]=d.useState(!1),$=F.useId(),U=d.useRef(f),q=d.useRef(v),{refs:Y,floatingStyles:te,context:M}=F.useFloating({nodeId:$,placement:o,middleware:[F.shift(),F.flip({fallbackAxisSideDirection:"end"}),F.offset({mainAxis:m.y,crossAxis:m.x})],open:S,onOpenChange:N=>{N?U.current?.(Y.reference.current,Y.floating.current):q.current?.(Y.reference.current,Y.floating.current),R(N)},whileElementsMounted:F.autoUpdate}),{isMounted:ne,styles:ie}=F.useTransitionStyles(M,{duration:p,initial({side:N}){let G="";return N==="top"?G="translateY(5%) scale(0.95)":N==="bottom"?G="translateY(-5%) scale(0.95)":N==="left"?G="translateX(5%) scale(0.95)":G="translateX(-5%) scale(0.95)",{opacity:0,transform:G}}}),X=d.useCallback(N=>{if(xe(N),O)return O();R(!1),q.current?.(Y.reference.current,Y.floating.current)},[O]);d.useEffect(()=>{if(a&&S)return R(!1)},[a,S]),d.useImperativeHandle(b,()=>({open:()=>{R(!0),U.current?.(Y.reference.current,Y.floating.current)},close:()=>{R(!1),q.current?.(Y.reference.current,Y.floating.current)}}),[]);const{getFloatingProps:K,getReferenceProps:ae}=F.useInteractions([F.useClick(M,{enabled:!a})]);return U.current=f,q.current=v,y.jsxs(y.Fragment,{children:[d.cloneElement(d.Children.only(r),ae({ref:Y.setReference,tabIndex:0,role:"button","aria-expanded":S,disabled:a,onClick:xe})),y.jsx(pe,{disabled:a||!ne,children:y.jsx(F.FloatingOverlay,{"data-testid":"vs-popover-shadow",onClick:X,style:{zIndex:_},autoFocus:!0,children:y.jsx("div",{role:c||"region",ref:Y.setFloating,style:te,children:y.jsx(it,{unstyled:i,styles:ie,...K({...s,onClick:xe}),children:l})})})})]})});Ne.displayName="Popover";const it=d.forwardRef(({className:o,unstyled:r,styles:l,style:a={},...m},f)=>{const v=d.useMemo(()=>ee(z("z-20 w-auto h-auto outline-none transition-transform ease-in-out",r?null:"border border-accent rounded-md shadow-lg p-1 bg-background"),o),[o,r]);return y.jsx("div",{ref:f,className:v,style:{...l,...a},...m})});it.displayName="PopoverContent";function Lt({className:o,placeholder:r="",options:l=[],error:a,unstyled:m,disabled:f,value:v,maxHeight:O=408,arrowIcon:p,closeIcon:i,checkIcon:_,onChange:c,onClear:s,renderItem:b,sectionLabelStyle:S,buttonAreaStyle:R,clearLabelText:$,optionStyle:U,...q}){const Y=d.useRef(null),[te,M]=d.useState(0),ne=d.useMemo(()=>m?o:ee(z("flex items-center justify-between rounded-md border bg-background px-3 py-2 w-full overflow-hidden cursor-pointer","disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",a?"border-danger hover:border-danger-fore":"border-input not-disabled:hover:border-input-fore"),o),[o,a,m]),ie=d.useMemo(()=>Array.isArray(v),[]),X=d.useCallback(k=>{c?.(k),ie||Y.current?.close()},[c,ie]),K=d.useCallback(k=>Array.isArray(v)?v.indexOf(k)>-1:v===k,[v]),ae=d.useMemo(()=>{const k={},V=l.filter(B=>typeof B!="string");for(let B=0,le=V.length;B<le;B+=1){const t=V[B];k[`${t.value}`]=t.label}return k},[l]),N=d.useMemo(()=>{if(!v)return r;if(Array.isArray(v)){if(!v.length)return r;const k=[...v].sort(),V=[];for(let B=0,le=k.length;B<le;B+=1)V[B]=ae[`${k[B]}`]||"";return V.filter(Boolean).join(",")||r}return ae[`${v}`]||r},[r,v,ae]),G=N===r,ce=d.useMemo(()=>z("overflow-hidden overflow-ellipsis whitespace-nowrap",G?"text-muted":"text-text"),[G]),oe=d.useCallback((k,V)=>b?typeof k=="string"?b(k,{index:V,selected:!1,onChange:()=>{}}):b(k,{index:V,selected:K(k.value),onChange:()=>X(k.value)}):typeof k=="string"?y.jsx("h5",{className:z("font-normal py-1 px-2 text-muted",S),children:k},`optionheader-${V}`):y.jsx($t,{selected:K(k.value),onChange:X,checkIcon:_,className:U,...k},k.label),[b,X,K,S,U,_]),Q=d.useMemo(()=>z("relative flex items-center pr-4 space-x-2",R),[R]);return y.jsx(Ne,{label:y.jsxs("button",{type:"button",className:ne,disabled:f,...q,children:[y.jsx("span",{className:ce,children:N}),y.jsxs("div",{className:Q,children:[s&&!G?y.jsx("div",{tabIndex:-1,role:"button",className:"size-6 p-1.5 rounded hover:bg-accent cursor-pointer","aria-label":$,onKeyDown:k=>{k.key!=="Enter"&&k.key!=="Space"||s()},onClick:k=>{k.stopPropagation(),s()},children:i}):null,p]})]}),ref:Y,onOpen:k=>M(k?.getBoundingClientRect().width||0),disabled:f,children:y.jsx("ul",{className:"overflow-y-auto flex flex-col",role:"listbox",style:{minWidth:te,maxWidth:"calc(100vw - 3rem)",maxHeight:O},children:l.map(oe)})})}function $t({className:o,value:r,label:l,selected:a,checkIcon:m,onChange:f}){const v=d.useMemo(()=>z("flex items-center w-full hover:bg-accent rounded p-1 cursor-pointer",o),[o]);return y.jsxs("button",{type:"button",role:"option",className:v,"aria-selected":a,onClick:()=>f?.(r),children:[a&&m?m:y.jsx("div",{className:"w-5 h-1 mr-1"}),l]})}function Yt({checked:o,className:r,id:l,name:a,onChange:m,value:f,...v}){const O=d.useMemo(()=>z("relative inline-flex justify-center items-center border border-input w-4.5 h-4.5 rounded-full","cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed not-disabled:hover:border-input-fore",o?"[&_i]:bg-primary disabled:[&_i]:bg-text disabled:border-input":"",r),[r,o]),p=()=>{v.disabled||m?.(!o)};return y.jsxs("button",{type:"button",role:"radio",id:l||a,className:O,onClick:p,"aria-checked":o,...v,children:[y.jsx("i",{className:"block w-2.5 h-2.5 rounded-full transition-transform",style:{transform:o?"":"scale(0.8)",opacity:o?1:0}}),y.jsx("input",{type:"radio","aria-hidden":"true",name:a,checked:o,value:f,onChange:p,disabled:v.disabled,style:{position:"absolute",pointerEvents:"none",top:0,left:0,width:1,height:1,opacity:0}})]})}const ut=d.forwardRef(({className:o,checked:r,onChange:l,value:a,id:m,name:f,...v},O)=>{const p=d.useMemo(()=>ee(z("inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50","w-11",r?"bg-primary":"bg-input"),o),[o,r]),i=d.useMemo(()=>ee("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",o),[o]),_=()=>{v.disabled||l?.(!r)};return y.jsxs("button",{type:"button",role:"switch",id:m||f,className:p,onClick:_,"aria-checked":r,...v,children:[y.jsx("span",{className:i,style:{transform:r?"translateX(100%)":""}}),y.jsx("input",{ref:O,type:"checkbox","aria-hidden":"true",name:f,checked:r,value:a,onChange:_,disabled:v.disabled,style:{position:"absolute",pointerEvents:"none",top:0,left:0,width:1,height:1,opacity:0}})]})});ut.displayName="Switch";function Ht({header:o,show:r,children:l,timeout:a=300,...m}){const f=d.useRef(null),v=d.useRef(0),O=d.useRef(0),p=d.useRef(!0);return d.useEffect(()=>{O.current=a},[a]),Ae(()=>{if(!f.current)return;if(f.current.style.overflow="hidden",f.current.style.opacity="1",p.current){p.current=!1,f.current.style.height=r?"auto":"0px",r?window.requestAnimationFrame(()=>{f.current&&(v.current=f.current.offsetHeight)}):(window.requestAnimationFrame(()=>{f.current&&(f.current.style.height="auto",v.current=f.current.offsetHeight,f.current.style.height="0px")}),f.current.style.opacity="0");return}r||(f.current.style.height=`${v.current}px`);const i=[];i[0]=window.requestAnimationFrame(()=>{i[1]=window.requestAnimationFrame(()=>{f.current&&(f.current.style.height=`${r?v.current:0}px`,f.current.style.opacity=r?"1":"0")})});let _;const c=()=>{f.current&&(r?(f.current.style.height="auto",f.current.style.overflow="",f.current.style.opacity="",window.requestAnimationFrame(()=>{f.current&&(v.current=f.current.offsetHeight)})):f.current.style.height="0px")};return O.current===0?c():_=window.setTimeout(c,O.current),()=>{i.forEach(window.cancelAnimationFrame),_&&window.clearTimeout(_)}},[r]),y.jsxs("div",{...m,children:[o,y.jsx("div",{className:"transition-all ease-in-out overflow-hidden",role:"region","aria-hidden":!r,ref:f,style:{transitionDuration:`${a}ms`},children:l})]})}const at=d.forwardRef(({children:o,position:r="bottom",label:l,className:a,timeout:m=150,offset:f={x:0,y:6},clientPoint:v=!1,disabled:O},p)=>{const[i,_]=d.useState(!1),c=F.useId(),{refs:s,floatingStyles:b,context:S}=F.useFloating({nodeId:c,open:i,placement:r,middleware:[F.shift(),F.flip(),F.offset({mainAxis:f.y,crossAxis:f.x})],whileElementsMounted:O?void 0:F.autoUpdate,onOpenChange:_}),{getReferenceProps:R,getFloatingProps:$}=F.useInteractions([F.useHover(S,{enabled:!O}),F.useClientPoint(S,{enabled:v})]),{isMounted:U,styles:q}=F.useTransitionStyles(S,{duration:m,initial:{opacity:0,transform:"scale(0.8)"}});d.useImperativeHandle(p,()=>({floating:s.floating,reference:s.reference,open:()=>_(!0),close:()=>_(!1)})),d.useEffect(()=>{O&&_(!1)},[O]);const Y=typeof o=="string"?y.jsx("span",{children:o}):o;return y.jsxs(y.Fragment,{children:[d.cloneElement(d.Children.only(Y),{ref:s.setReference,...R()}),y.jsx(pe,{disabled:O||!U,children:y.jsx("div",{role:"tooltip",className:"z-[9999]",ref:s.setFloating,...$({style:b}),children:y.jsx(ct,{className:a,style:q,children:l})})})]})});at.displayName="Tooltip";const ct=d.forwardRef(({className:o,custom:r,...l},a)=>{const m=d.useMemo(()=>ee(z("relative w-auto h-auto outline-none transition-transform ease-in-out whitespace-pre",r?null:"border border-accent rounded shadow-md px-3 py-1 bg-background"),o),[o,r]);return y.jsx("div",{ref:a,className:m,...l})});ct.displayName="TooltipContent";function lt({variant:o,size:r}){return z("inline-flex items-center justify-center whitespace-nowrap transition-colors rounded-md cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-auto",{"bg-primary text-inverted hover:bg-primary-fore":!o||o==="primary","bg-info text-inverted hover:bg-info-fore":o==="info","bg-warn text-inverted hover:bg-warn-fore":o==="warn","bg-danger text-inverted hover:bg-danger-fore":o==="danger","hover:bg-accent":o==="ghost","hover:underline":o==="link","border border-input hover:bg-accent":o==="outline"},{"px-2 py-1":!r,"p-1.5":r==="icon"})}function Ut({size:o,variant:r,className:l,...a}){const m=d.useMemo(()=>z(lt({size:o,variant:r}),l),[o,r,l]);return y.jsx("button",{className:m,type:"button",...a})}function Ft({open:o,children:r,timeout:l=150,padding:a="0.85rem",verticalAlign:m="center",closeOnOverlay:f,closeOnEsc:v,onExited:O,className:p,onOpenChange:i,size:_,...c}){const s=d.useRef(O),b=d.useRef(!1),S=F.useId(),{refs:R,context:$}=F.useFloating({open:o,onOpenChange:i,nodeId:S}),{getFloatingProps:U}=F.useInteractions([F.useDismiss($,{enabled:v,escapeKey:v,outsidePress:!1})]),{isMounted:q,styles:Y}=F.useTransitionStyles($,{duration:l,initial:{opacity:0,transform:"scale(0.8)"}});d.useEffect(()=>{b.current!==q&&(b.current=q,!q&&s.current?.())},[q]);const te=d.useCallback(()=>{f&&i?.(!1)},[i,f]);s.current=O;const M=d.useMemo(()=>z("grid bg-backdrop z-40 justify-items-center",{"place-items-start items-start":m==="start","place-items-end":m==="end","place-items-center":m==="center"||!m}),[m]),ne=d.useMemo(()=>ee("transition ease-in-out",p),[p]);return y.jsx(pe,{disabled:!q,children:y.jsx(F.FloatingOverlay,{className:M,"data-testid":"vs-dialog-overlay",onClick:te,style:{padding:a,opacity:Y.opacity},lockScroll:!0,children:y.jsx(ft,{ref:R.setFloating,className:ne,role:"dialog",size:_,style:Y,onClick:xe,...U({...c}),children:r})})})}const ft=d.forwardRef(({size:o,className:r,...l},a)=>{const m=d.useMemo(()=>z(o?"flex flex-col bg-background shadow-lg p-5 rounded":null,{"w-full max-w-dialog-sm":o==="small","w-full max-w-dialog-md":o==="medium","w-full max-w-dialog-lg":o==="large"},r),[o,r]);return y.jsx("div",{ref:a,className:m,...l})});ft.displayName="DialogContent";const qt={open:250,close:150};function Wt({open:o,timeout:r=qt,onOpenChange:l,position:a="right",overlay:m,onExited:f,onOpen:v,...O}){const p=F.useId(),i=d.useRef(!1),_=d.useRef(v),c=d.useRef(f),{refs:s,context:b}=F.useFloating({open:o,onOpenChange:l,nodeId:p}),{isMounted:S,styles:R}=F.useTransitionStyles(b,{duration:r,initial(){let U="translateX(75%)";return a==="left"?U="translateX(-75%)":a==="top"?U="translateY(-75%)":a==="bottom"&&(U="translateY(75%)"),{opacity:0,transform:U}}});d.useEffect(()=>{if(i.current!==S){if(i.current=S,S){_.current?.();return}c.current?.()}},[S]);const $=d.useMemo(()=>z("fixed transition-transform z-30",{"top-0 right-0 h-full max-h-screen":a==="right","top-0 left-0 h-full max-h-screen":a==="left","top-0 left-0 right-0 w-full max-w-screen":a==="top","bottom-0 left-0 right-0 w-full max-w-screen":a==="bottom"}),[a]);return c.current=f,_.current=v,y.jsxs(pe,{disabled:!S,children:[m?y.jsx(F.FloatingOverlay,{className:"bg-backdrop",style:{opacity:R.opacity},onClick:()=>l?.(!1)}):null,y.jsx("div",{ref:s.setFloating,className:$,role:"dialog",style:R,children:y.jsx(zt,{...O})})]})}function zt({className:o,unstyled:r,...l}){const a=d.useMemo(()=>r?o:ee(z("relative bg-background min-w-full min-h-full border border-input shadow-lg"),o),[r,o]);return y.jsx("div",{className:a,...l})}function dt({size:o=20,label:r="Loading...",...l}){return y.jsxs("div",{role:"status",...l,children:[y.jsxs("svg",{"aria-hidden":"true",className:"text-accent animate-spin fill-primary",width:o,height:o,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[y.jsx("path",{d:"M100 50.6a50 50 0 1 1-100 0 50 50 0 0 1 100 0Zm-91 0a41 41 0 1 0 82 0 41 41 0 0 0-82 0Z",fill:"currentColor"}),y.jsx("path",{d:"M94 39a4.2 4.2 0 0 0 3-5.4A50 50 0 0 0 41.7 1.3c-2.4.4-3.9 2.9-3.2 5.3a5 5 0 0 0 5.6 3.5A41 41 0 0 1 88 36 5 5 0 0 0 94 39Z",fill:"currentFill"})]}),y.jsx("span",{className:"sr-only",children:r})]})}function pt({type:o,label:r,message:l}){const{icons:a}=Vt();return y.jsxs("div",{className:"flex items-center px-4 py-3 w-80 text-sm bg-background border border-input rounded-lg shadow-md m-2",children:[o?y.jsxs("figure",{className:"mr-2",children:[o==="success"&&a?.success?a.success:null,o==="info"&&a?.info?a.info:null,o==="error"&&a?.error?a.error:null,o==="warn"&&a?.warn?a.warn:null,o==="loading"?y.jsx(dt,{size:20}):null]}):null,y.jsxs("div",{className:"space-y-2",children:[y.jsx("p",{className:"font-medium leading-none",children:r}),l?y.jsx("p",{children:l}):null]})]})}function rt(){}class Bt{notify=rt;lastId=0;subscribe=r=>(this.notify=r,()=>{this.notify=rt});add=(r,l={})=>{this.lastId+=1;const a=`${this.lastId}`;return this.notify({id:a,type:"add",config:{id:a,label:r,...l}}),a};update=(r,l)=>{this.notify({id:r,type:"update",config:l})};remove=r=>{this.notify({id:r,type:"remove"})};clear=()=>{this.lastId=0}}const Pe=new Bt;function Gt({id:o,type:r,index:l,duration:a=5e3,className:m,children:f,inverted:v,timeout:O=250,max:p=3}){const i=d.useRef(!1),[_,c]=d.useState(!1),{context:s,refs:b}=F.useFloating({open:_,onOpenChange:c,nodeId:o}),{isMounted:S,styles:R}=F.useTransitionStyles(s,{duration:O,initial:{opacity:0,transform:`translateY(${v?"":"-"}50%)`}});d.useLayoutEffect(()=>{c(l<=p)},[l,p]),d.useEffect(()=>{i.current!==S&&(S||Pe.remove(o),i.current=S)},[S,o]),d.useEffect(()=>{if(!a)return;const q=window.setTimeout(()=>c(!1),a);return()=>window.clearTimeout(q)},[a,o]);const $=d.useCallback(()=>{r!=="loading"&&c(!1)},[r]),U=d.useMemo(()=>z("relative flex w-fit transition-transform ease-in-out cursor-pointer",m),[m]);return S?y.jsx("li",{role:"log",tabIndex:-1,ref:b.setFloating,className:U,style:R,onClick:$,children:f}):null}const mt=d.createContext({});function Vt(){return d.useContext(mt)}function Xt({className:o,margin:r=16,position:l="top-left",max:a,ListItem:m=pt,icons:f}){const v=d.useMemo(()=>{const R={position:"fixed"};return l.indexOf("top")>-1?R.top=r:l.indexOf("bottom")>-1&&(R.bottom=r),l.indexOf("left")>-1?(R.left=r,R.alignItems="flex-start"):l.indexOf("right")>-1?(R.right=r,R.alignItems="flex-end"):(R.left="50%",R.alignItems="center",R.transform="translateX(-50%)"),R},[r,l]),O=d.useMemo(()=>z("flex flex-col z-40 overflow-hidden",o),[o]),p=d.useMemo(()=>l?.startsWith("bottom")||!1,[l]),i=d.useRef(new Map),[_,c]=d.useState([]),s=d.useState(0)[1];Ae(()=>Pe.subscribe(R=>{d.startTransition(()=>{if(R.type==="add")i.current.set(R.id,R.config),c($=>[...$,R.id]);else if(R.type==="remove"){if(!i.current.delete(R.id))return;c(U=>{const q=new Set(U);return q.has(R.id)?(q.delete(R.id),Array.from(q)):U})}else if(R.type==="update"){const $=i.current.get(R.id);if(!$)return;i.current.set(R.id,{...$,...R.config}),s(U=>U+1)}})}),[]);const b=d.useMemo(()=>({icons:f}),[f]),S=_.length;return y.jsx(pe,{children:y.jsx("ol",{className:O,style:v,"aria-live":"polite",children:y.jsx(mt.Provider,{value:b,children:_.map((R,$)=>{const U=i.current.get(R);if(!U)return null;const{className:q,duration:Y,...te}=U;return y.jsx(Gt,{id:R,index:S-$,className:q,duration:Y,inverted:p,max:a,children:d.createElement(m,te)},R)})})})})}function Kt({className:o,...r}){const l=d.useMemo(()=>ee("inline-block animate-pulse rounded-md bg-accent",o),[o]);return y.jsx("div",{className:l,...r})}function Qt({className:o,...r}){const l=d.useMemo(()=>z("flex items-center justify-center","[&_button]:rounded-none [&_:first-child]:rounded-bl [&_:first-child]:rounded-tl [&_:last-child]:rounded-br [&_:last-child]:rounded-tr","[&_:first-child]:border-r-0 [&_:last-child]:border-l-0",o),[o]);return y.jsx("div",{role:"group",className:l,...r})}function Zt({value:o,max:r,className:l,...a}){const m=d.useMemo(()=>o?Math.round(o/r*100):0,[o,r]),f=d.useMemo(()=>ee("relative overflow-hidden rounded-full bg-primary",l),[l]);return y.jsx("div",{role:"progressbar",className:f,"aria-valuemax":r,"aria-valuemin":0,...a,children:y.jsx("div",{className:"h-full w-full flex-1 bg-input transition-all origin-right",style:{transform:`translateX(${m>100?100:m}%)`}})})}function Jt({className:o,orientation:r="horizontal",...l}){const a=d.useMemo(()=>ee(z("border-0 p-0 shrink-0 bg-input",r==="horizontal"?"h-[1px] w-full":"w-[1px] h-full"),o),[o,r]);return y.jsx("hr",{className:a,role:"none",...l})}exports.clsx=z;exports.Accordion=Ht;exports.Button=Ut;exports.ButtonGroup=Qt;exports.Checkbox=kt;exports.Dialog=Ft;exports.Divider=Jt;exports.FormField=St;exports.FormLabel=nt;exports.Input=ot;exports.InputField=Ct;exports.Popover=Ne;exports.Portal=pe;exports.Progress=Zt;exports.Radio=Yt;exports.Select=Lt;exports.Sheet=Wt;exports.Skeleton=Kt;exports.Spinner=dt;exports.Switch=ut;exports.Textarea=st;exports.Toast=Xt;exports.ToastItem=pt;exports.Tooltip=at;exports.merge=ee;exports.toast=Pe;exports.varientButton=lt;
|
package/dist/index.d.ts
CHANGED
|
@@ -278,7 +278,7 @@ export declare interface SelectProps<T> extends Omit<ButtonHTMLAttributes<HTMLBu
|
|
|
278
278
|
clearLabelText?: string;
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
export declare function Sheet({ open, timeout, onOpenChange, position, overlay, onExited, ...rest }: SheetProps): JSX.Element;
|
|
281
|
+
export declare function Sheet({ open, timeout, onOpenChange, position, overlay, onExited, onOpen, ...rest }: SheetProps): JSX.Element;
|
|
282
282
|
|
|
283
283
|
export declare interface SheetProps extends HTMLAttributes<HTMLDivElement> {
|
|
284
284
|
/** trueの場合、モーダルを表示します。 */
|
|
@@ -291,8 +291,9 @@ export declare interface SheetProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
291
291
|
open: number;
|
|
292
292
|
close: number;
|
|
293
293
|
};
|
|
294
|
-
/** モーダルのtransition exitが完了した時に発火されるcallback */
|
|
295
294
|
onOpenChange?: (open: boolean) => void;
|
|
295
|
+
/** 開けた場合のコールバック */
|
|
296
|
+
onOpen?: () => void;
|
|
296
297
|
/** モーダルのtransition exitが完了した時に発火されるcallback */
|
|
297
298
|
onExited?: () => void;
|
|
298
299
|
overlay?: boolean;
|