@firecms/ui 3.0.0-canary.41 → 3.0.0-canary.43
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.es.js +3 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/styles.d.ts +3 -3
- package/package.json +13 -13
- package/src/components/Markdown.tsx +2 -2
- package/src/styles.ts +3 -3
package/dist/index.umd.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
(function(e,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("react"),require("@radix-ui/react-collapsible"),require("clsx"),require("tailwind-merge"),require("date-fns/locale"),require("react-datepicker"),require("@radix-ui/react-checkbox"),require("@material-design-icons/font/filled.css"),require("@radix-ui/react-label"),require("@radix-ui/react-dialog"),require("react-dropzone"),require("react-fast-compare"),require("markdown-it"),require("@radix-ui/react-dropdown-menu"),require("cmdk"),require("@radix-ui/react-radio-group"),require("@radix-ui/react-select"),require("@radix-ui/react-separator"),require("react-dom"),require("@radix-ui/react-tooltip"),require("@radix-ui/react-tabs"),require("@radix-ui/react-popover")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","@radix-ui/react-collapsible","clsx","tailwind-merge","date-fns/locale","react-datepicker","@radix-ui/react-checkbox","@material-design-icons/font/filled.css","@radix-ui/react-label","@radix-ui/react-dialog","react-dropzone","react-fast-compare","markdown-it","@radix-ui/react-dropdown-menu","cmdk","@radix-ui/react-radio-group","@radix-ui/react-select","@radix-ui/react-separator","react-dom","@radix-ui/react-tooltip","@radix-ui/react-tabs","@radix-ui/react-popover"],o):(e=typeof globalThis<"u"?globalThis:e||self,o(e["FireCMS UI"]={},e.jsxRuntime,e.React,e.Collapsible,e.clsx,e.tailwindMerge,e.locales,e.DatePicker,e.CheckboxPrimitive,null,e.LabelPrimitive,e.DialogPrimitive,e.reactDropzone,e.equal,e.MarkdownIt,e.DropdownMenu,e.cmdk,e.RadioGroupPrimitive,e.SelectPrimitive,e.SeparatorPrimitive,e.ReactDOM,e.TooltipPrimitive,e.TabsPrimitive,e.PopoverPrimitive))})(this,function(e,o,f,Jn,Zn,Yn,$n,an,Xn,Yen,xn,Rn,no,oo,eo,co,on,ro,to,io,ao,lo,uo,_o){"use strict";function T(n){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>n[t]})}}return r.default=n,Object.freeze(r)}const w=T(f),Z=T(Jn),Io=T($n),kn=T(Xn),wn=T(xn),N=T(Rn),Y=T(co),$=T(ro),E=T(to),pn=T(io),fo=T(ao),X=T(lo),ln=T(uo),x=T(_o),P="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-opacity-75 focus-visible:ring-offset-2 focus-visible:ring-offset-transparent",un="focus:bg-opacity-70 focus:bg-slate-100 focus:dark:bg-gray-800 focus:dark:bg-opacity-60",_n="z-30 outline-none ring-2 ring-primary ring-opacity-75 ring-offset-2 ring-offset-transparent ",W="bg-opacity-50 bg-slate-200 dark:bg-gray-700 dark:bg-opacity-40 transition duration-
|
1
|
+
(function(e,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("react"),require("@radix-ui/react-collapsible"),require("clsx"),require("tailwind-merge"),require("date-fns/locale"),require("react-datepicker"),require("@radix-ui/react-checkbox"),require("@material-design-icons/font/filled.css"),require("@radix-ui/react-label"),require("@radix-ui/react-dialog"),require("react-dropzone"),require("react-fast-compare"),require("markdown-it"),require("@radix-ui/react-dropdown-menu"),require("cmdk"),require("@radix-ui/react-radio-group"),require("@radix-ui/react-select"),require("@radix-ui/react-separator"),require("react-dom"),require("@radix-ui/react-tooltip"),require("@radix-ui/react-tabs"),require("@radix-ui/react-popover")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","@radix-ui/react-collapsible","clsx","tailwind-merge","date-fns/locale","react-datepicker","@radix-ui/react-checkbox","@material-design-icons/font/filled.css","@radix-ui/react-label","@radix-ui/react-dialog","react-dropzone","react-fast-compare","markdown-it","@radix-ui/react-dropdown-menu","cmdk","@radix-ui/react-radio-group","@radix-ui/react-select","@radix-ui/react-separator","react-dom","@radix-ui/react-tooltip","@radix-ui/react-tabs","@radix-ui/react-popover"],o):(e=typeof globalThis<"u"?globalThis:e||self,o(e["FireCMS UI"]={},e.jsxRuntime,e.React,e.Collapsible,e.clsx,e.tailwindMerge,e.locales,e.DatePicker,e.CheckboxPrimitive,null,e.LabelPrimitive,e.DialogPrimitive,e.reactDropzone,e.equal,e.MarkdownIt,e.DropdownMenu,e.cmdk,e.RadioGroupPrimitive,e.SelectPrimitive,e.SeparatorPrimitive,e.ReactDOM,e.TooltipPrimitive,e.TabsPrimitive,e.PopoverPrimitive))})(this,function(e,o,f,Jn,Zn,Yn,$n,an,Xn,Yen,xn,Rn,no,oo,eo,co,on,ro,to,io,ao,lo,uo,_o){"use strict";function T(n){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>n[t]})}}return r.default=n,Object.freeze(r)}const w=T(f),Z=T(Jn),Io=T($n),kn=T(Xn),wn=T(xn),N=T(Rn),Y=T(co),$=T(ro),E=T(to),pn=T(io),fo=T(ao),X=T(lo),ln=T(uo),x=T(_o),P="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-opacity-75 focus-visible:ring-offset-2 focus-visible:ring-offset-transparent",un="focus:bg-opacity-70 focus:bg-slate-100 focus:dark:bg-gray-800 focus:dark:bg-opacity-60",_n="z-30 outline-none ring-2 ring-primary ring-opacity-75 ring-offset-2 ring-offset-transparent ",W="bg-opacity-50 bg-slate-200 dark:bg-gray-700 dark:bg-opacity-40 transition duration-100 ease-in-out",dn="bg-opacity-0 bg-slate-100 dark:bg-gray-800 dark:bg-opacity-0 transition duration-100 ease-in-out",q="dark:bg-gray-800 bg-opacity-80 dark:bg-opacity-90",V="hover:bg-opacity-70 dark:hover:bg-opacity-60",j="border-gray-100 dark:border-gray-800 dark:border-opacity-80",Q="bg-white rounded-md dark:bg-gray-950 border dark:border-gray-800 dark:border-opacity-80 border-gray-100",vn="bg-white border border-gray-100 dark:border-transparent rounded-md dark:bg-gray-950 dark:border-gray-800 dark:border-opacity-50 transition duration-100 ease-in-out m-1 -p-1",Sn="hover:bg-primary-bg dark:hover:bg-primary-bg hover:bg-opacity-20 dark:hover:bg-opacity-20 hover:ring-2 hover:ring-primary cursor-pointer",yo="bg-primary-bg dark:bg-primary-bg bg-opacity-30 dark:bg-opacity-10 ring-1 ring-primary ring-opacity-75";function u(...n){return Yn.twMerge(Zn.clsx(n))}function Cn(n,r=166){let t;function i(...l){const a=()=>{n.apply(this,l)};clearTimeout(t),t=setTimeout(a,r)}return i.clear=()=>{clearTimeout(t)},i}function so(n){let r=0,t,i;for(t=0;t<n.length;t++)i=n.charCodeAt(t),r=(r<<5)-r+i,r|=0;return Math.abs(r)}const en={blueLighter:{color:"#cfdfff",text:"#102046"},cyanLighter:{color:"#d0f0fd",text:"#04283f"},tealLighter:{color:"#c2f5e9",text:"#012524"},greenLighter:{color:"#d1f7c4",text:"#0b1d05"},yellowLighter:{color:"#ffeab6",text:"#3b2501"},orangeLighter:{color:"#fee2d5",text:"#6b2613"},redLighter:{color:"#ffdce5",text:"#4c0c1c"},pinkLighter:{color:"#ffdaf6",text:"#400832"},purpleLighter:{color:"#ede2fe",text:"#280b42"},grayLighter:{color:"#eee",text:"#040404"},blueLight:{color:"#9cc7ff",text:"#102046"},cyanLight:{color:"#77d1f3",text:"#04283f"},tealLight:{color:"#72ddc3",text:"#012524"},greenLight:{color:"#93e088",text:"#0b1d05"},yellowLight:{color:"#ffd66e",text:"#3b2501"},orangeLight:{color:"#ffa981",text:"#6b2613"},redLight:{color:"#ff9eb7",text:"#4c0c1c"},pinkLight:{color:"#f99de2",text:"#400832"},purpleLight:{color:"#cdb0ff",text:"#280b42"},grayLight:{color:"#ccc",text:"#040404"},blueDark:{color:"#2d7ff9",text:"#fff"},cyanDark:{color:"#18bfff",text:"#fff"},tealDark:{color:"#20d9d2",text:"#fff"},greenDark:{color:"#20c933",text:"#fff"},yellowDark:{color:"#fcb400",text:"#fff"},orangeDark:{color:"#ff6f2c",text:"#fff"},redDark:{color:"#f82b60",text:"#fff"},pinkDark:{color:"#ff08c2",text:"#fff"},purpleDark:{color:"#8b46ff",text:"#fff"},grayDark:{color:"#666",text:"#fff"},blueDarker:{color:"#2750ae",text:"#cfdfff"},cyanDarker:{color:"#0b76b7",text:"#d0f0fd"},tealDarker:{color:"#06a09b",text:"#daf3e9"},greenDarker:{color:"#338a17",text:"#d1f7c4"},yellowDarker:{color:"#b87503",text:"#ffeab6"},orangeDarker:{color:"#d74d26",text:"#fee2d5"},redDarker:{color:"#ba1e45",text:"#ffdce5"},pinkDarker:{color:"#b2158b",text:"#ffdaf6"},purpleDarker:{color:"#6b1cb0",text:"#ede2fe"},grayDarker:{color:"#444",text:"#eee"}};function An(n){return en[n]}function go(n){const r=so(n),t=Object.keys(en),i=r%t.length;return en[t[i]]}function ho(n){return(n.match(/^\d/)?"_":"")+n.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join("")+"Icon"}function Ko(n){f.useEffect(()=>{if(!n)return;const r=Io[n];r&&(an.registerLocale(n,r),an.setDefaultLocale(n))},[n])}function J(n,r){f.useEffect(()=>{if(!document.getElementById(n)){const i=document.createElement("style");i.id=n,i.innerHTML=r,document.head.appendChild(i)}},[])}function In(n,r,t=!0){f.useEffect(()=>{if(!t)return;function i(l){mn(l.target)||n.current&&!n.current.contains(l.target)&&r()}return document.addEventListener("mousedown",i),()=>{document.removeEventListener("mousedown",i)}},[n,t,r])}function mn(n){return n instanceof HTMLElement?n.getAttribute("role")==="presentation"?!0:mn(n.parentNode):!1}function Pn(n,r=300){const[t,i]=f.useState(n);return f.useEffect(()=>{const l=setTimeout(()=>{i(n)},r);return()=>{clearTimeout(l)}},[n,r]),t}function Dn({children:n,className:r,in:t=!1,duration:i=220}){return J(`Collapse-${i}`,`
|
2
2
|
.CollapseContent-${i} {
|
3
3
|
overflow: hidden;
|
4
4
|
}
|
@@ -887,7 +887,7 @@
|
|
887
887
|
to {
|
888
888
|
height: 0;
|
889
889
|
}
|
890
|
-
}`);const[y,h]=f.useState(i!==void 0?i:a),[K,s]=f.useState(y);return f.useEffect(()=>{y?setTimeout(()=>{s(!0)},220):s(!1)},[y]),f.useEffect(()=>{i!==void 0&&h(i)},[i]),o.jsx(o.Fragment,{children:o.jsxs(Z.Root,{className:u(!t&&j+" border","rounded-md","w-full"),open:y,onOpenChange:k=>{l?.(k),h(k)},children:[o.jsxs(Z.Trigger,{className:u(P,"rounded flex items-center justify-between w-full min-h-[52px]","hover:bg-slate-50 dark:hover:bg-gray-800 dark:hover:bg-opacity-10",t?"border-b px-2":"p-4",t&&j,d&&W,_),children:[n,o.jsx(cn,{className:u("transition",y?"rotate-180":"")})]}),o.jsx(Z.Content,{className:u("CollapsibleContent"),style:{overflow:K?"visible":"hidden"},children:o.jsx("div",{className:I,children:r})})]})})}function ten({accept:n,onFilesAdded:r,onFilesRejected:t,maxSize:i,disabled:l,maxFiles:a,title:_,uploadDescription:d,children:I,preventDropOnDocument:y=!0,size:h}){const{getRootProps:K,getInputProps:s,isDragActive:k,isDragAccept:p,isDragReject:S}=no.useDropzone({accept:n,noDragEventsBubbling:!0,maxSize:i,onDrop:r,onDropRejected:t,disabled:l,maxFiles:a,preventDropOnDocument:y});return o.jsxs("div",{...K(),className:u(W,V,P,"flex gap-2","p-4 box-border relative items-center border-2 border-solid border-transparent outline-none rounded-md duration-200 ease-[cubic-bezier(0.4,0,0.2,1)] focus:border-primary-solid",{"h-44":h==="medium","h-28":h==="small","cursor-pointer":!l,"hover:bg-field-hover dark:hover:bg-field-hover-dark":!k,"transition-colors duration-200 ease-[cubic-bezier(0,0,0.2,1)] border-red-500":S,"transition-colors duration-200 ease-[cubic-bezier(0,0,0.2,1)] border-green-500":p}),children:[o.jsx(R,{variant:"caption",color:"secondary",className:"absolute top-2 left-3.5 cursor-inherit",children:_}),o.jsx("input",{...s()}),I,o.jsx("div",{className:"flex-grow h-28 box-border flex flex-col items-center justify-center text-center",children:o.jsx(R,{align:"center",variant:"label",children:d})})]})}const ien={info:"bg-sky-200 dark:bg-teal-900",warn:"bg-orange-200 dark:bg-yellow-950"};function aen({children:n,mode:r="info"}){return o.jsx("div",{className:u("my-3 py-2 px-4 rounded",ien[r]),children:n})}function len({children:n,loading:r,disabled:t,onClick:i,startIcon:l,...a}){return o.jsxs(Tn,{disabled:r||t,onClick:i,component:a.component,...a,children:[r&&o.jsx(fn,{size:"small"}),!r&&l,n]})}const uen={small:"prose-sm",medium:"prose",large:"prose-lg",xl:"prose-xl","2xl":"prose-2xl"},_en=new eo({html:!0}),den=f.memo(function({source:r,className:t,size:i="medium"}){const l=f.useMemo(()=>_en.render(typeof r=="string"?r:""),[r]);return o.jsx("div",{className:u(uen[i],"dark:prose-invert prose-headings:font-title",t),dangerouslySetInnerHTML:{__html:l}})},oo);function Ien({children:n,trigger:r,open:t,defaultOpen:i,onOpenChange:l,portalContainer:a}){return o.jsxs(Y.Root,{open:t,defaultOpen:i,onOpenChange:l,children:[o.jsx(Y.Trigger,{asChild:!0,children:r}),o.jsx(Y.Portal,{container:a,children:o.jsx(Y.Content,{className:u(Q,"shadow py-2 z-30"),children:n})})]})}function fen({children:n,dense:r=!1,onClick:t}){const i=u(P,t&&"cursor-pointer","rounded-md text-sm font-medium text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-900 flex items-center gap-4",r?"px-3 py-1.5":"px-4 py-2");return o.jsx(Y.Item,{className:i,onClick:t,children:n})}function Vn({children:n,error:r}){return o.jsx("div",{className:u("text-sm font-medium ml-3.5 mb-1",r?"text-red-500 dark:text-red-600":"text-slate-500 dark:text-slate-300"),children:n})}const Kn=w.createContext({});function yen({value:n,open:r,onMultiValueChange:t,size:i="medium",label:l,disabled:a,renderValue:_,renderValues:d,includeFocusOutline:I=!0,containerClassName:y,className:h,children:K,error:s}){const k=w.useRef(null),p=w.useRef(null),S=w.useRef(null);In(S,()=>v(!1));const[m,v]=w.useState(!1);f.useEffect(()=>{v(r??!1)},[r]);const D=w.useCallback(g=>{Array.isArray(n)&&n.includes(g)?t?.(n.filter(A=>A!==g)):t?.([...n??[],g])},[n,t]),[C,B]=w.useState(""),[M,O]=w.useState(null),z=w.useCallback(g=>{const A=p.current;if(A){if((g.key==="Delete"||g.key==="Backspace")&&A.value===""){const b=[...n??[]];b.pop(),t?.(b)}g.key==="Escape"&&(A.blur(),v(!1),g.stopPropagation())}},[t,n]),H=w.useCallback(()=>{O(k.current?.getBoundingClientRect()??null),v(!0)},[]),F=M??k.current?.getBoundingClientRect(),G=window.innerHeight-(F?.top??0)-(F?.height??0)-16;return o.jsxs(o.Fragment,{children:[typeof l=="string"?o.jsx(Vn,{error:s,children:l}):l,o.jsxs(on.Command,{onKeyDown:z,onClick:()=>{p.current?.focus(),H()},className:u("relative overflow-visible bg-transparent",y),children:[o.jsxs("div",{ref:k,className:u("flex flex-row",i==="small"?"min-h-[42px]":"min-h-[64px]","select-none rounded-md text-sm",W,a?q:V,"relative flex items-center","p-4",s?"text-red-500 dark:text-red-600":"focus:text-text-primary dark:focus:text-text-primary-dark",s?"border border-red-500 dark:border-red-600":"",I?P:"",h),children:[o.jsxs("div",{className:u("flex-grow flex gap-1.5 flex-wrap items-center"),children:[_&&(n??[]).map((g,A)=>_(g,A)),d&&d(n??[]),o.jsx(on.Command.Input,{ref:p,value:C,onValueChange:B,onFocus:H,className:"ml-2 bg-transparent outline-none flex-1 h-full w-full "})]}),o.jsx("div",{className:"px-2 h-full flex items-center",children:o.jsx(cn,{size:"small",className:u("transition ",m?"rotate-180":"")})})]}),o.jsx(N.Root,{open:m,onOpenChange:v,children:o.jsx(N.Portal,{children:o.jsx(Kn.Provider,{value:{fieldValue:n,setInputValue:B,onValueChangeInternal:D},children:o.jsx("div",{ref:S,className:"z-50 absolute overflow-auto outline-none",style:{pointerEvents:m?"auto":"none",top:(F?.top??0)+(F?.height??0),left:F?.left,width:F?.width,maxHeight:G},children:o.jsx(on.Command.Group,{className:"mt-2 text-slate-900 dark:text-white animate-in z-50 border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-800 p-2 rounded-lg shadow-lg flex flex-col outline-none w-full",children:K})})})})})]})]})}function sen({children:n,value:r,className:t}){const i=w.useContext(Kn);if(!i)throw new Error("MultiSelectItem must be used inside a MultiSelect");const{fieldValue:l,setInputValue:a,onValueChangeInternal:_}=i;return o.jsx(on.Command.Item,{onMouseDown:d=>{d.preventDefault(),d.stopPropagation()},onSelect:d=>{a(""),_(r)},className:u((l??[]).includes(r)?"bg-slate-200 dark:bg-slate-950":"","cursor-pointer","m-1","ring-offset-transparent","p-2 rounded aria-[selected=true]:outline-none aria-[selected=true]:ring-2 aria-[selected=true]:ring-primary aria-[selected=true]:ring-opacity-75 aria-[selected=true]:ring-offset-2","aria-[selected=true]:bg-slate-100 aria-[selected=true]:dark:bg-slate-900","cursor-pointer p-2 rounded aria-[selected=true]:bg-slate-100 aria-[selected=true]:dark:bg-slate-900",t),children:n})}function gen({children:n,style:r,className:t}){return o.jsx("div",{className:u(Q,t),style:r,children:n})}const zn=w.forwardRef(({className:n,...r},t)=>o.jsx($.Root,{className:u("grid gap-2",n),...r,ref:t}));zn.displayName=$.Root.displayName;const Gn=w.forwardRef(({className:n,...r},t)=>o.jsx($.Item,{ref:t,className:u("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),...r,children:o.jsx($.Indicator,{className:"flex items-center justify-center",children:o.jsx("div",{className:"h-2.5 w-2.5 fill-current text-current bg-primary rounded-lg"})})}));Gn.displayName=$.Item.displayName;function hen({onClick:n,onTextSearch:r,placeholder:t="Search",expandable:i=!1,large:l=!1,innerClassName:a,className:_,autoFocus:d,disabled:I,loading:y,inputRef:h}){const[K,s]=f.useState(""),[k,p]=f.useState(!1),S=Pn(K,200);f.useEffect(()=>{r&&r(S||void 0)},[S]);const m=f.useCallback(()=>{r&&(s(""),r(void 0))},[r]);return o.jsxs("div",{onClick:n,className:u("relative",l?"h-14":"h-[42px]","bg-slate-50 dark:bg-gray-800 transition duration-150 ease-in-out border",j,"rounded",_),children:[o.jsx("div",{className:"absolute p-0 px-4 h-full absolute pointer-events-none flex items-center justify-center top-0",children:y?o.jsx(fn,{size:"small"}):o.jsx(Hn,{className:"text-slate-500 dark:text-gray-500"})}),o.jsx("input",{value:K??"",ref:h,onClick:n,placeholder:t,readOnly:!r,onChange:r?v=>{s(v.target.value)}:void 0,autoFocus:d,onFocus:()=>p(!0),onBlur:()=>p(!1),className:u((I||y)&&"pointer-events-none","relative flex items-center rounded transition-all bg-transparent outline-none appearance-none border-none","pl-12 h-full text-current ",i?k?"w-[220px]":"w-[180px]":"",P,a)}),K?o.jsx(rn,{className:`${l?"mr-2 top-1":"mr-1 top-0"} absolute right-0 z-10`,onClick:m,children:o.jsx(yn,{size:"small"})}):o.jsx("div",{style:{width:26}})]})}function Ken({inputRef:n,open:r,name:t,id:i,onOpenChange:l,value:a,onChange:_,onValueChange:d,onMultiValueChange:I,className:y,inputClassName:h,placeholder:K,renderValue:s,renderValues:k,label:p,size:S="medium",includeFocusOutline:m=!0,error:v,disabled:D,padding:C=!0,position:B="item-aligned",endAdornment:M,multiple:O,invisible:z,children:H,...F}){const[G,g]=f.useState(!1);f.useEffect(()=>{g(r??!1)},[r]);const A=f.useCallback(b=>{O?Array.isArray(a)&&a.includes(b)?I?.(a.filter(L=>L!==b)):I?.([...a??[],b]):d?.(b),!O&&_&&_({target:{name:t,value:b}})},[O,_,a,I,d]);return o.jsxs(E.Root,{name:t,value:Array.isArray(a)?void 0:a,defaultOpen:r,open:G,disabled:D,onValueChange:A,onOpenChange:b=>{l?.(b),g(b)},...F,children:[typeof p=="string"?o.jsx(Vn,{error:v,children:p}):p,o.jsxs("div",{className:u(S==="small"?"min-h-[42px]":"min-h-[64px]","select-none rounded-md text-sm",z?dn:W,D?q:V,"relative flex items-center",y),children:[o.jsxs(E.Trigger,{ref:n,id:i,className:u("w-full h-full",S==="small"?"h-[42px]":"h-[64px]",C?"px-4 ":"","outline-none focus:outline-none","select-none rounded-md text-sm",v?"text-red-500 dark:text-red-600":"focus:text-text-primary dark:focus:text-text-primary-dark",v?"border border-red-500 dark:border-red-600":"",D?"text-slate-600 dark:text-slate-400":"text-slate-800 dark:text-white","relative flex items-center",m?P:"",h),children:[o.jsx("div",{className:u("flex-grow w-full max-w-full flex flex-row gap-2 items-center","overflow-visible",S==="small"?"h-[42px]":"h-[64px]"),children:o.jsxs(E.Value,{placeholder:K,children:[s&&(a&&Array.isArray(a)?a.map((b,L)=>o.jsx("div",{className:"flex items-center gap-1 max-w-full",children:s?s(b,L):b},b)):typeof a=="string"?s?s(a,0):a:K),k&&(!a||Array.isArray(a))?k(a??[]):null,!s&&!k&&a]})}),o.jsx(E.Icon,{className:u("px-2 h-full flex items-center"),children:o.jsx(cn,{size:"small",className:u("transition",r?"rotate-180":"")})})]}),M&&o.jsx("div",{className:u("absolute h-full flex items-center",S==="small"?"right-10":"right-14"),onClick:b=>b.stopPropagation(),children:M})]}),o.jsx(E.Portal,{children:o.jsx(E.Content,{position:B,className:"z-50 relative overflow-hidden border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-800 p-2 rounded-lg shadow-lg",children:o.jsx(E.Viewport,{className:"p-1",style:{maxHeight:"var(--radix-select-content-available-height)"},children:H})})})]})}function ben({value:n,children:r,disabled:t,className:i}){return o.jsxs(E.Item,{value:n,disabled:t,onClick:l=>{l.preventDefault(),l.stopPropagation()},className:u("w-full","relative relative flex items-center p-2 rounded-md text-sm text-slate-700 dark:text-slate-300",P,"focus:z-10","data-[state=checked]:bg-slate-100 data-[state=checked]:dark:bg-slate-900 focus:bg-slate-100 dark:focus:bg-slate-950","data-[state=checked]:focus:bg-slate-200 data-[state=checked]:dark:focus:bg-slate-950",t?"opacity-50 cursor-not-allowed":"cursor-pointer","[&>*]:w-full","overflow-visible",i),children:[o.jsx(E.ItemText,{children:r}),o.jsx("div",{className:"absolute left-1 data-[state=checked]:block hidden",children:o.jsx(Nn,{size:16})})]},n)}function ken({label:n,children:r,className:t}){return o.jsxs(o.Fragment,{children:[o.jsx(E.Group,{className:u("text-xs text-slate-900 dark:text-white uppercase tracking-wider font-bold mt-6 first:mt-2","px-2 py-2",t),children:n}),r]})}function wen({orientation:n,decorative:r}){return n==="horizontal"?o.jsx(pn.Root,{decorative:r,orientation:"horizontal",className:"dark:bg-opacity-50 bg-opacity-50 dark:bg-gray-600 bg-gray-300 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px my-[8px]"}):o.jsx(pn.Root,{className:"dark:bg-opacity-50 bg-opacity-50 dark:bg-gray-600 bg-gray-300 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px mx-[8px]",decorative:r,orientation:"vertical"})}const pen=({children:n,side:r="right",open:t,onOpenChange:i,transparent:l,...a})=>{const[_,d]=f.useState(!1);f.useEffect(()=>{if(t)return d(!0),()=>{};{const y=setTimeout(()=>{d(!1)},250);return()=>clearTimeout(y)}},[t]);const I={top:"-translate-y-full",bottom:"translate-y-full",left:"-translate-x-full",right:"translate-x-full"};return o.jsx(N.Root,{open:_||t,onOpenChange:i,children:o.jsxs(N.Portal,{children:[o.jsx(N.Overlay,{className:u("fixed inset-0 transition-opacity z-20 ease-in-out duration-200 backdrop-blur-sm",l?"bg-white bg-opacity-80":"bg-black bg-opacity-50","dark:bg-black dark:bg-opacity-60",_&&t?"opacity-100":"opacity-0"),style:{pointerEvents:_?"auto":"none"}}),o.jsx(N.Content,{...a,className:u("will-change-transform","text-slate-900 dark:text-white","fixed transform z-20 transition-all duration-[240ms] ease-in-out","outline-none focus:outline-none",l?"":"shadow-md",r==="top"||r==="bottom"?"w-full":"h-full",r==="left"||r==="top"?"left-0 top-0":"right-0 bottom-0",_&&t?"opacity-100":"opacity-0",!_||!t?I[r]:""),children:n})]})})};function ven(){return o.jsxs("div",{role:"status",children:[o.jsxs("svg",{"aria-hidden":"true",className:"w-8 h-8 mr-2 text-slate-200 animate-spin dark:text-slate-600 fill-primary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),o.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),o.jsx("span",{className:"sr-only",children:"Loading..."})]})}function nn(n){return parseInt(n,10)||0}const Sen={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function Un(n){return n==null||Object.keys(n).length===0||n.outerHeightStyle===0&&!n.overflow}const qn=w.forwardRef(function(r,t){const{onChange:i,onScroll:l,onResize:a,maxRows:_,minRows:d=1,style:I,value:y,onFocus:h,onBlur:K,sizeRef:s,ignoreBoxSizing:k,...p}=r,{current:S}=w.useRef(y!=null),m=w.useRef(null),v=Cen(t,m),D=w.useRef(null),C=w.useRef(0),[B,M]=w.useState({outerHeightStyle:0}),O=w.useCallback(()=>{const g=m.current;if(typeof window>"u")return{outerHeightStyle:0};const b=window.getComputedStyle(g);if(b.width==="0px")return{outerHeightStyle:0};const L=s?.current??D.current,tn=D.current;L.style.width=b.width,tn.value=g.value||r.placeholder||"x",tn.value.slice(-1)===`
|
890
|
+
}`);const[y,h]=f.useState(i!==void 0?i:a),[K,s]=f.useState(y);return f.useEffect(()=>{y?setTimeout(()=>{s(!0)},220):s(!1)},[y]),f.useEffect(()=>{i!==void 0&&h(i)},[i]),o.jsx(o.Fragment,{children:o.jsxs(Z.Root,{className:u(!t&&j+" border","rounded-md","w-full"),open:y,onOpenChange:k=>{l?.(k),h(k)},children:[o.jsxs(Z.Trigger,{className:u(P,"rounded flex items-center justify-between w-full min-h-[52px]","hover:bg-slate-50 dark:hover:bg-gray-800 dark:hover:bg-opacity-10",t?"border-b px-2":"p-4",t&&j,d&&W,_),children:[n,o.jsx(cn,{className:u("transition",y?"rotate-180":"")})]}),o.jsx(Z.Content,{className:u("CollapsibleContent"),style:{overflow:K?"visible":"hidden"},children:o.jsx("div",{className:I,children:r})})]})})}function ten({accept:n,onFilesAdded:r,onFilesRejected:t,maxSize:i,disabled:l,maxFiles:a,title:_,uploadDescription:d,children:I,preventDropOnDocument:y=!0,size:h}){const{getRootProps:K,getInputProps:s,isDragActive:k,isDragAccept:p,isDragReject:S}=no.useDropzone({accept:n,noDragEventsBubbling:!0,maxSize:i,onDrop:r,onDropRejected:t,disabled:l,maxFiles:a,preventDropOnDocument:y});return o.jsxs("div",{...K(),className:u(W,V,P,"flex gap-2","p-4 box-border relative items-center border-2 border-solid border-transparent outline-none rounded-md duration-200 ease-[cubic-bezier(0.4,0,0.2,1)] focus:border-primary-solid",{"h-44":h==="medium","h-28":h==="small","cursor-pointer":!l,"hover:bg-field-hover dark:hover:bg-field-hover-dark":!k,"transition-colors duration-200 ease-[cubic-bezier(0,0,0.2,1)] border-red-500":S,"transition-colors duration-200 ease-[cubic-bezier(0,0,0.2,1)] border-green-500":p}),children:[o.jsx(R,{variant:"caption",color:"secondary",className:"absolute top-2 left-3.5 cursor-inherit",children:_}),o.jsx("input",{...s()}),I,o.jsx("div",{className:"flex-grow h-28 box-border flex flex-col items-center justify-center text-center",children:o.jsx(R,{align:"center",variant:"label",children:d})})]})}const ien={info:"bg-sky-200 dark:bg-teal-900",warn:"bg-orange-200 dark:bg-yellow-950"};function aen({children:n,mode:r="info"}){return o.jsx("div",{className:u("my-3 py-2 px-4 rounded",ien[r]),children:n})}function len({children:n,loading:r,disabled:t,onClick:i,startIcon:l,...a}){return o.jsxs(Tn,{disabled:r||t,onClick:i,component:a.component,...a,children:[r&&o.jsx(fn,{size:"small"}),!r&&l,n]})}const uen={small:"prose-sm text-sm",medium:"prose text-base",large:"prose-lg",xl:"prose-xl","2xl":"prose-2xl"},_en=new eo({html:!0}),den=f.memo(function({source:r,className:t,size:i="medium"}){const l=f.useMemo(()=>_en.render(typeof r=="string"?r:""),[r]);return o.jsx("div",{className:u(uen[i],"dark:prose-invert prose-headings:font-title",t),dangerouslySetInnerHTML:{__html:l}})},oo);function Ien({children:n,trigger:r,open:t,defaultOpen:i,onOpenChange:l,portalContainer:a}){return o.jsxs(Y.Root,{open:t,defaultOpen:i,onOpenChange:l,children:[o.jsx(Y.Trigger,{asChild:!0,children:r}),o.jsx(Y.Portal,{container:a,children:o.jsx(Y.Content,{className:u(Q,"shadow py-2 z-30"),children:n})})]})}function fen({children:n,dense:r=!1,onClick:t}){const i=u(P,t&&"cursor-pointer","rounded-md text-sm font-medium text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-900 flex items-center gap-4",r?"px-3 py-1.5":"px-4 py-2");return o.jsx(Y.Item,{className:i,onClick:t,children:n})}function Vn({children:n,error:r}){return o.jsx("div",{className:u("text-sm font-medium ml-3.5 mb-1",r?"text-red-500 dark:text-red-600":"text-slate-500 dark:text-slate-300"),children:n})}const Kn=w.createContext({});function yen({value:n,open:r,onMultiValueChange:t,size:i="medium",label:l,disabled:a,renderValue:_,renderValues:d,includeFocusOutline:I=!0,containerClassName:y,className:h,children:K,error:s}){const k=w.useRef(null),p=w.useRef(null),S=w.useRef(null);In(S,()=>v(!1));const[m,v]=w.useState(!1);f.useEffect(()=>{v(r??!1)},[r]);const D=w.useCallback(g=>{Array.isArray(n)&&n.includes(g)?t?.(n.filter(A=>A!==g)):t?.([...n??[],g])},[n,t]),[C,B]=w.useState(""),[M,O]=w.useState(null),z=w.useCallback(g=>{const A=p.current;if(A){if((g.key==="Delete"||g.key==="Backspace")&&A.value===""){const b=[...n??[]];b.pop(),t?.(b)}g.key==="Escape"&&(A.blur(),v(!1),g.stopPropagation())}},[t,n]),H=w.useCallback(()=>{O(k.current?.getBoundingClientRect()??null),v(!0)},[]),F=M??k.current?.getBoundingClientRect(),G=window.innerHeight-(F?.top??0)-(F?.height??0)-16;return o.jsxs(o.Fragment,{children:[typeof l=="string"?o.jsx(Vn,{error:s,children:l}):l,o.jsxs(on.Command,{onKeyDown:z,onClick:()=>{p.current?.focus(),H()},className:u("relative overflow-visible bg-transparent",y),children:[o.jsxs("div",{ref:k,className:u("flex flex-row",i==="small"?"min-h-[42px]":"min-h-[64px]","select-none rounded-md text-sm",W,a?q:V,"relative flex items-center","p-4",s?"text-red-500 dark:text-red-600":"focus:text-text-primary dark:focus:text-text-primary-dark",s?"border border-red-500 dark:border-red-600":"",I?P:"",h),children:[o.jsxs("div",{className:u("flex-grow flex gap-1.5 flex-wrap items-center"),children:[_&&(n??[]).map((g,A)=>_(g,A)),d&&d(n??[]),o.jsx(on.Command.Input,{ref:p,value:C,onValueChange:B,onFocus:H,className:"ml-2 bg-transparent outline-none flex-1 h-full w-full "})]}),o.jsx("div",{className:"px-2 h-full flex items-center",children:o.jsx(cn,{size:"small",className:u("transition ",m?"rotate-180":"")})})]}),o.jsx(N.Root,{open:m,onOpenChange:v,children:o.jsx(N.Portal,{children:o.jsx(Kn.Provider,{value:{fieldValue:n,setInputValue:B,onValueChangeInternal:D},children:o.jsx("div",{ref:S,className:"z-50 absolute overflow-auto outline-none",style:{pointerEvents:m?"auto":"none",top:(F?.top??0)+(F?.height??0),left:F?.left,width:F?.width,maxHeight:G},children:o.jsx(on.Command.Group,{className:"mt-2 text-slate-900 dark:text-white animate-in z-50 border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-800 p-2 rounded-lg shadow-lg flex flex-col outline-none w-full",children:K})})})})})]})]})}function sen({children:n,value:r,className:t}){const i=w.useContext(Kn);if(!i)throw new Error("MultiSelectItem must be used inside a MultiSelect");const{fieldValue:l,setInputValue:a,onValueChangeInternal:_}=i;return o.jsx(on.Command.Item,{onMouseDown:d=>{d.preventDefault(),d.stopPropagation()},onSelect:d=>{a(""),_(r)},className:u((l??[]).includes(r)?"bg-slate-200 dark:bg-slate-950":"","cursor-pointer","m-1","ring-offset-transparent","p-2 rounded aria-[selected=true]:outline-none aria-[selected=true]:ring-2 aria-[selected=true]:ring-primary aria-[selected=true]:ring-opacity-75 aria-[selected=true]:ring-offset-2","aria-[selected=true]:bg-slate-100 aria-[selected=true]:dark:bg-slate-900","cursor-pointer p-2 rounded aria-[selected=true]:bg-slate-100 aria-[selected=true]:dark:bg-slate-900",t),children:n})}function gen({children:n,style:r,className:t}){return o.jsx("div",{className:u(Q,t),style:r,children:n})}const zn=w.forwardRef(({className:n,...r},t)=>o.jsx($.Root,{className:u("grid gap-2",n),...r,ref:t}));zn.displayName=$.Root.displayName;const Gn=w.forwardRef(({className:n,...r},t)=>o.jsx($.Item,{ref:t,className:u("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),...r,children:o.jsx($.Indicator,{className:"flex items-center justify-center",children:o.jsx("div",{className:"h-2.5 w-2.5 fill-current text-current bg-primary rounded-lg"})})}));Gn.displayName=$.Item.displayName;function hen({onClick:n,onTextSearch:r,placeholder:t="Search",expandable:i=!1,large:l=!1,innerClassName:a,className:_,autoFocus:d,disabled:I,loading:y,inputRef:h}){const[K,s]=f.useState(""),[k,p]=f.useState(!1),S=Pn(K,200);f.useEffect(()=>{r&&r(S||void 0)},[S]);const m=f.useCallback(()=>{r&&(s(""),r(void 0))},[r]);return o.jsxs("div",{onClick:n,className:u("relative",l?"h-14":"h-[42px]","bg-slate-50 dark:bg-gray-800 transition duration-150 ease-in-out border",j,"rounded",_),children:[o.jsx("div",{className:"absolute p-0 px-4 h-full absolute pointer-events-none flex items-center justify-center top-0",children:y?o.jsx(fn,{size:"small"}):o.jsx(Hn,{className:"text-slate-500 dark:text-gray-500"})}),o.jsx("input",{value:K??"",ref:h,onClick:n,placeholder:t,readOnly:!r,onChange:r?v=>{s(v.target.value)}:void 0,autoFocus:d,onFocus:()=>p(!0),onBlur:()=>p(!1),className:u((I||y)&&"pointer-events-none","relative flex items-center rounded transition-all bg-transparent outline-none appearance-none border-none","pl-12 h-full text-current ",i?k?"w-[220px]":"w-[180px]":"",P,a)}),K?o.jsx(rn,{className:`${l?"mr-2 top-1":"mr-1 top-0"} absolute right-0 z-10`,onClick:m,children:o.jsx(yn,{size:"small"})}):o.jsx("div",{style:{width:26}})]})}function Ken({inputRef:n,open:r,name:t,id:i,onOpenChange:l,value:a,onChange:_,onValueChange:d,onMultiValueChange:I,className:y,inputClassName:h,placeholder:K,renderValue:s,renderValues:k,label:p,size:S="medium",includeFocusOutline:m=!0,error:v,disabled:D,padding:C=!0,position:B="item-aligned",endAdornment:M,multiple:O,invisible:z,children:H,...F}){const[G,g]=f.useState(!1);f.useEffect(()=>{g(r??!1)},[r]);const A=f.useCallback(b=>{O?Array.isArray(a)&&a.includes(b)?I?.(a.filter(L=>L!==b)):I?.([...a??[],b]):d?.(b),!O&&_&&_({target:{name:t,value:b}})},[O,_,a,I,d]);return o.jsxs(E.Root,{name:t,value:Array.isArray(a)?void 0:a,defaultOpen:r,open:G,disabled:D,onValueChange:A,onOpenChange:b=>{l?.(b),g(b)},...F,children:[typeof p=="string"?o.jsx(Vn,{error:v,children:p}):p,o.jsxs("div",{className:u(S==="small"?"min-h-[42px]":"min-h-[64px]","select-none rounded-md text-sm",z?dn:W,D?q:V,"relative flex items-center",y),children:[o.jsxs(E.Trigger,{ref:n,id:i,className:u("w-full h-full",S==="small"?"h-[42px]":"h-[64px]",C?"px-4 ":"","outline-none focus:outline-none","select-none rounded-md text-sm",v?"text-red-500 dark:text-red-600":"focus:text-text-primary dark:focus:text-text-primary-dark",v?"border border-red-500 dark:border-red-600":"",D?"text-slate-600 dark:text-slate-400":"text-slate-800 dark:text-white","relative flex items-center",m?P:"",h),children:[o.jsx("div",{className:u("flex-grow w-full max-w-full flex flex-row gap-2 items-center","overflow-visible",S==="small"?"h-[42px]":"h-[64px]"),children:o.jsxs(E.Value,{placeholder:K,children:[s&&(a&&Array.isArray(a)?a.map((b,L)=>o.jsx("div",{className:"flex items-center gap-1 max-w-full",children:s?s(b,L):b},b)):typeof a=="string"?s?s(a,0):a:K),k&&(!a||Array.isArray(a))?k(a??[]):null,!s&&!k&&a]})}),o.jsx(E.Icon,{className:u("px-2 h-full flex items-center"),children:o.jsx(cn,{size:"small",className:u("transition",r?"rotate-180":"")})})]}),M&&o.jsx("div",{className:u("absolute h-full flex items-center",S==="small"?"right-10":"right-14"),onClick:b=>b.stopPropagation(),children:M})]}),o.jsx(E.Portal,{children:o.jsx(E.Content,{position:B,className:"z-50 relative overflow-hidden border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-800 p-2 rounded-lg shadow-lg",children:o.jsx(E.Viewport,{className:"p-1",style:{maxHeight:"var(--radix-select-content-available-height)"},children:H})})})]})}function ben({value:n,children:r,disabled:t,className:i}){return o.jsxs(E.Item,{value:n,disabled:t,onClick:l=>{l.preventDefault(),l.stopPropagation()},className:u("w-full","relative relative flex items-center p-2 rounded-md text-sm text-slate-700 dark:text-slate-300",P,"focus:z-10","data-[state=checked]:bg-slate-100 data-[state=checked]:dark:bg-slate-900 focus:bg-slate-100 dark:focus:bg-slate-950","data-[state=checked]:focus:bg-slate-200 data-[state=checked]:dark:focus:bg-slate-950",t?"opacity-50 cursor-not-allowed":"cursor-pointer","[&>*]:w-full","overflow-visible",i),children:[o.jsx(E.ItemText,{children:r}),o.jsx("div",{className:"absolute left-1 data-[state=checked]:block hidden",children:o.jsx(Nn,{size:16})})]},n)}function ken({label:n,children:r,className:t}){return o.jsxs(o.Fragment,{children:[o.jsx(E.Group,{className:u("text-xs text-slate-900 dark:text-white uppercase tracking-wider font-bold mt-6 first:mt-2","px-2 py-2",t),children:n}),r]})}function wen({orientation:n,decorative:r}){return n==="horizontal"?o.jsx(pn.Root,{decorative:r,orientation:"horizontal",className:"dark:bg-opacity-50 bg-opacity-50 dark:bg-gray-600 bg-gray-300 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px my-[8px]"}):o.jsx(pn.Root,{className:"dark:bg-opacity-50 bg-opacity-50 dark:bg-gray-600 bg-gray-300 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px mx-[8px]",decorative:r,orientation:"vertical"})}const pen=({children:n,side:r="right",open:t,onOpenChange:i,transparent:l,...a})=>{const[_,d]=f.useState(!1);f.useEffect(()=>{if(t)return d(!0),()=>{};{const y=setTimeout(()=>{d(!1)},250);return()=>clearTimeout(y)}},[t]);const I={top:"-translate-y-full",bottom:"translate-y-full",left:"-translate-x-full",right:"translate-x-full"};return o.jsx(N.Root,{open:_||t,onOpenChange:i,children:o.jsxs(N.Portal,{children:[o.jsx(N.Overlay,{className:u("fixed inset-0 transition-opacity z-20 ease-in-out duration-200 backdrop-blur-sm",l?"bg-white bg-opacity-80":"bg-black bg-opacity-50","dark:bg-black dark:bg-opacity-60",_&&t?"opacity-100":"opacity-0"),style:{pointerEvents:_?"auto":"none"}}),o.jsx(N.Content,{...a,className:u("will-change-transform","text-slate-900 dark:text-white","fixed transform z-20 transition-all duration-[240ms] ease-in-out","outline-none focus:outline-none",l?"":"shadow-md",r==="top"||r==="bottom"?"w-full":"h-full",r==="left"||r==="top"?"left-0 top-0":"right-0 bottom-0",_&&t?"opacity-100":"opacity-0",!_||!t?I[r]:""),children:n})]})})};function ven(){return o.jsxs("div",{role:"status",children:[o.jsxs("svg",{"aria-hidden":"true",className:"w-8 h-8 mr-2 text-slate-200 animate-spin dark:text-slate-600 fill-primary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),o.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),o.jsx("span",{className:"sr-only",children:"Loading..."})]})}function nn(n){return parseInt(n,10)||0}const Sen={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function Un(n){return n==null||Object.keys(n).length===0||n.outerHeightStyle===0&&!n.overflow}const qn=w.forwardRef(function(r,t){const{onChange:i,onScroll:l,onResize:a,maxRows:_,minRows:d=1,style:I,value:y,onFocus:h,onBlur:K,sizeRef:s,ignoreBoxSizing:k,...p}=r,{current:S}=w.useRef(y!=null),m=w.useRef(null),v=Cen(t,m),D=w.useRef(null),C=w.useRef(0),[B,M]=w.useState({outerHeightStyle:0}),O=w.useCallback(()=>{const g=m.current;if(typeof window>"u")return{outerHeightStyle:0};const b=window.getComputedStyle(g);if(b.width==="0px")return{outerHeightStyle:0};const L=s?.current??D.current,tn=D.current;L.style.width=b.width,tn.value=g.value||r.placeholder||"x",tn.value.slice(-1)===`
|
891
891
|
`&&(tn.value+=" ");const Uen=b.boxSizing,qen=nn(b.paddingBottom)+nn(b.paddingTop),jen=nn(b.borderBottomWidth)+nn(b.borderTopWidth),Qen=nn(b.minHeight),Qn=L.scrollHeight;tn.value="x";const bn=L.scrollHeight;let U=Qn;d&&(U=Math.max(Number(d)*bn,U)),_&&(U=Math.min(Number(_)*bn,U)),U=Math.max(U,bn,Qen);const Jen=U+(!k&&Uen==="border-box"?qen+jen:0),Zen=Math.abs(U-Qn)<=1;return{outerHeightStyle:Jen,overflow:Zen}},[_,d,r.placeholder]),z=(g,A)=>{const{outerHeightStyle:b,overflow:L}=A;return C.current<20&&(b>0&&Math.abs((g.outerHeightStyle||0)-b)>1||g.overflow!==L)?(C.current+=1,{overflow:L,outerHeightStyle:b}):(process.env.NODE_ENV!=="production"&&C.current===20&&console.error(["MUI: Too many re-renders. The layout is unstable.","TextareaAutosize limits the number of renders to prevent an infinite loop."].join(`
|
892
892
|
`)),g)},H=w.useCallback(()=>{const g=O();Un(g)||(a&&a(g),M(A=>z(A,g)))},[O,a]),F=()=>{const g=O();Un(g)||fo.flushSync(()=>{M(A=>z(A,g))})};w.useEffect(()=>{const g=Cn(()=>{C.current=0,m.current&&F()});let A;const b=m.current,L=window;if(!(typeof window>"u"))return L.addEventListener("resize",g),typeof ResizeObserver<"u"&&(A=new ResizeObserver(g),A.observe(b)),()=>{g.clear(),L.removeEventListener("resize",g),A&&A.disconnect()}}),f.useLayoutEffect(()=>{H()}),w.useEffect(()=>{C.current=0},[y]);const G=g=>{C.current=0,S||H(),i&&i(g)};return o.jsxs(w.Fragment,{children:[o.jsx("textarea",{value:y,onChange:G,className:r.className,ref:v,onFocus:h,onBlur:K,rows:d,style:{height:B.outerHeightStyle,overflow:B.overflow?"hidden":void 0,...I},onScroll:l,...p}),o.jsx("textarea",{"aria-hidden":!0,className:u(r.className,r.shadowClassName),readOnly:!0,ref:D,tabIndex:-1,style:{...Sen.shadow,...I,padding:0}})]})});function Cen(...n){return w.useMemo(()=>n.every(r=>r==null)?null:r=>{n.forEach(t=>{Aen(t,r)})},n)}function Aen(n,r){typeof n=="function"?n(r):n&&(n.current=r)}function jn({value:n,onChange:r,label:t,type:i="text",multiline:l=!1,invisible:a,rows:_,disabled:d,error:I,endAdornment:y,autoFocus:h,placeholder:K,size:s="medium",className:k,style:p,inputClassName:S,inputStyle:m,inputRef:v,...D}){const C=v??f.useRef(null),[B,M]=f.useState(document.activeElement===C.current),O=n!=null&&n!=="";f.useEffect(()=>{if(i!=="number")return;const F=g=>{g.preventDefault()},G="current"in C?C.current:C;return G.addEventListener("wheel",F),()=>{G.removeEventListener("wheel",F)}},[C,i]);const z=f.useCallback(F=>{F.preventDefault()},[]),H=l?o.jsx(qn,{...D,ref:C,placeholder:B||O||!t?K:void 0,autoFocus:h,rows:_,value:n??"",onChange:r,style:m,className:u(a?un:P,"rounded-md resize-none w-full outline-none p-[32px] text-base bg-transparent min-h-[64px] px-3 pt-[28px]",d&&"border border-transparent outline-none opacity-50 text-slate-600 dark:text-slate-500")}):o.jsx("input",{...D,ref:C,onWheel:i==="number"?z:void 0,disabled:d,style:m,className:u("w-full outline-none bg-transparent leading-normal px-3","rounded-md",a?un:P,d?q:V,s==="small"?"min-h-[48px]":"min-h-[64px]",t?s==="medium"?"pt-[28px] pb-2":"pt-4 pb-2":"py-2",B?"text-text-primary dark:text-text-primary-dark":"",y?"pr-10":"pr-3",d&&"border border-transparent outline-none opacity-50 dark:opacity-50 text-slate-800 dark:text-white",S),placeholder:B||O||!t?K:void 0,autoFocus:h,onFocus:()=>M(!0),onBlur:()=>M(!1),type:i,value:Number.isNaN(n)?"":n??"",onChange:r});return o.jsxs("div",{className:u("rounded-md relative max-w-full",a?dn:W,d?q:V,I?"border border-red-500 dark:border-red-600":"",{"min-h-[48px]":!a&&s==="small","min-h-[64px]":!a&&s==="medium"},k),style:p,children:[t&&o.jsx(hn,{className:u("pointer-events-none absolute",s==="medium"?"top-1":"-top-1",I?"text-red-500 dark:text-red-600":B?"text-primary dark:text-primary":"text-text-secondary dark:text-text-secondary-dark",d?"opacity-50":""),shrink:O||B,children:t}),H,y&&o.jsx("div",{className:"flex flex-row justify-center items-center absolute h-full right-0 top-0 mr-4 ",children:y})]})}const men=({open:n,side:r="bottom",delayDuration:t=250,sideOffset:i,align:l,onOpenChange:a,title:_,className:d,style:I,tooltipClassName:y,children:h})=>(J("Tooltip",Pen),_?o.jsx(X.Provider,{delayDuration:t,children:o.jsxs(X.Root,{open:n,onOpenChange:a,children:[o.jsx(X.Trigger,{asChild:!0,children:o.jsx("div",{className:d,style:I,children:h})}),o.jsx(X.Portal,{children:o.jsx(X.Content,{className:u("TooltipContent","max-w-lg leading-relaxed","z-50 rounded px-3 py-2 text-xs leading-none bg-slate-700 dark:bg-slate-800 bg-opacity-90 font-medium text-slate-50 shadow-2xl select-none duration-400 ease-in transform opacity-100",y),sideOffset:i===void 0?4:i,align:l,side:r,children:_})})]})}):o.jsx(o.Fragment,{children:h})),Pen=`
|
893
893
|
|