sodtrack-web-ui 0.98.2 → 0.99.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/{chunk-RUXFKJLX.js → chunk-25S7MIRW.js} +1 -1
  2. package/dist/chunk-2DJU37L3.js +1 -0
  3. package/dist/{chunk-OPWX6EBA.js → chunk-2OJ2LRZA.js} +1 -1
  4. package/dist/{chunk-SB2JBFW6.js → chunk-3TBZ7FGN.js} +1 -1
  5. package/dist/chunk-5DHKKW3D.js +1 -0
  6. package/dist/{chunk-YHQAFR3D.js → chunk-64JCYMY5.js} +1 -1
  7. package/dist/{chunk-VFP3D5WF.js → chunk-A2VW62QH.js} +1 -1
  8. package/dist/chunk-BJ5MXTGP.js +1 -0
  9. package/dist/{chunk-SXTK4LA4.js → chunk-BUM5T6I7.js} +1 -1
  10. package/dist/{chunk-F3ZDZSCG.js → chunk-E23TVVWA.js} +1 -1
  11. package/dist/{chunk-2IBP2IXU.js → chunk-F5EHWT6X.js} +1 -1
  12. package/dist/{chunk-HHJM6SWF.js → chunk-GYLE3EGC.js} +1 -1
  13. package/dist/chunk-GZ7UH57N.js +1 -0
  14. package/dist/{chunk-OAW3XWAG.js → chunk-JX5TSRNT.js} +1 -1
  15. package/dist/{chunk-HT7JENHZ.js → chunk-PAVCJDAL.js} +1 -1
  16. package/dist/chunk-T2GZMGRZ.js +1 -0
  17. package/dist/{chunk-5BEBJ46Z.js → chunk-TIYCBFYY.js} +1 -1
  18. package/dist/{chunk-ASGV5EOD.js → chunk-TSSZIHGO.js} +1 -1
  19. package/dist/{chunk-UGSIXJ7I.js → chunk-VCBJUVN5.js} +1 -1
  20. package/dist/{chunk-NYGSJ2OJ.js → chunk-ZDWTWZ36.js} +1 -1
  21. package/dist/{chunk-XYILEUFO.js → chunk-ZIT34AYM.js} +1 -1
  22. package/dist/components/autocomplete-new.js +1 -1
  23. package/dist/components/button-active.js +1 -1
  24. package/dist/components/button-menu.js +1 -1
  25. package/dist/components/card-expandable.js +1 -1
  26. package/dist/components/country-text-field.js +1 -1
  27. package/dist/components/data-table.js +1 -1
  28. package/dist/components/date-picker.js +1 -1
  29. package/dist/components/dropzone.js +1 -1
  30. package/dist/components/index.d.ts +41 -4
  31. package/dist/components/index.js +1 -1
  32. package/dist/components/list-item-arrow.js +1 -1
  33. package/dist/components/list-item-button.js +1 -1
  34. package/dist/components/list-item-checkbox-left.js +1 -1
  35. package/dist/components/list-item-checkbox.js +1 -1
  36. package/dist/components/list-item.js +1 -1
  37. package/dist/components/phone-input-new-skeleton.d.ts +8 -0
  38. package/dist/components/phone-input-new-skeleton.js +1 -0
  39. package/dist/components/phone-input.js +1 -1
  40. package/dist/components/popover.d.ts +3 -1
  41. package/dist/components/popover.js +1 -1
  42. package/dist/components/radio.js +1 -1
  43. package/dist/components/search-bar.d.ts +53 -2
  44. package/dist/components/search-bar.js +1 -1
  45. package/dist/components/select-new.js +1 -1
  46. package/dist/components/select.js +1 -1
  47. package/dist/components/signature-pad.js +1 -1
  48. package/dist/components/text-field-new.js +1 -1
  49. package/dist/components/text-field.js +1 -1
  50. package/dist/components/textarea-new.js +1 -1
  51. package/dist/components/time-picker-new.js +1 -1
  52. package/dist/components/time-picker.js +1 -1
  53. package/dist/components/tracker-item.js +1 -1
  54. package/dist/phone.d.ts +1 -0
  55. package/dist/phone.js +1 -0
  56. package/dist/styles/index.css +1 -1
  57. package/package.json +12 -6
  58. package/dist/chunk-LY2YQ6ZB.js +0 -1
  59. package/dist/chunk-PLA5QILP.js +0 -1
  60. package/dist/chunk-UZ3SBSKA.js +0 -1
  61. package/dist/chunk-XGQTQ2DK.js +0 -1
@@ -1 +1 @@
1
- import {e,i,f,a as a$1,b,c,g,h,d,j}from'./chunk-NVYSWZZC.js';import {a as a$4,b as b$2,c as c$2}from'./chunk-PLA5QILP.js';import {b as b$1}from'./chunk-JB6QLQCK.js';import {a as a$2}from'./chunk-CM6ALMTT.js';import {a as a$3}from'./chunk-KTD2GEB6.js';import {c as c$1}from'./chunk-WQPZV6HK.js';import {c as c$3}from'./chunk-55Z77FLU.js';import {e as e$1}from'./chunk-QNQELNVU.js';import {a}from'./chunk-OBZIYJO7.js';import {memo,useMemo,useState,useCallback,useRef,useEffect}from'react';import {flexRender,useReactTable,getCoreRowModel}from'@tanstack/react-table';import {Component,KeyRound,MailWarning,MapPinOff,TriangleAlert,Siren,Plus}from'lucide-react';import {jsx,jsxs}from'react/jsx-runtime';var ke=["siren","warning","map-pin-off","email-alert","key-round","component"],ie={siren:{Icon:Siren,bgClassName:"bg-orange-50",iconClassName:"text-orange-700"},warning:{Icon:TriangleAlert,bgClassName:"bg-warning-100",iconClassName:"text-warning-900"},"map-pin-off":{Icon:MapPinOff,bgClassName:"bg-coral-50",iconClassName:"text-coral-700"},"email-alert":{Icon:MailWarning,bgClassName:"bg-danger-100",iconClassName:"text-danger-700"},"key-round":{Icon:KeyRound,bgClassName:"bg-orchid-100",iconClassName:"text-orchid-700"},component:{Icon:Component,bgClassName:"bg-aqua-100",iconClassName:"text-aqua-800"}},dt=o=>({id:"__select__",size:54,enableResizing:false,header:({table:i})=>{let u=i.getRowModel().rows.some(s=>s.getCanSelect()),r=i.getIsAllPageRowsSelected()?true:i.getIsSomePageRowsSelected()?"indeterminate":false;return jsx(b$1,{checked:r,disabled:!u,className:"ml-1",onCheckedChange:s=>i.toggleAllPageRowsSelected(s===true)})},cell:({row:i})=>{let u=i.getCanSelect(),r=u?i.getIsSelected():typeof o.setDisabledRowState=="function"?o.setDisabledRowState(i.original):o.setDisabledRowState??false,s=jsx(b$1,{checked:r,onCheckedChange:R=>i.toggleSelected(R===true),disabled:!u}),c=o.rowSelectionTooltip?.content(i.original);return c?jsx(a$2,{className:"w-fit",content:c,positioning:o.rowSelectionTooltip?.positioning??{placement:"right"},children:s}):s},enableSorting:false}),q=["w-3/4","w-1/2","w-2/3","w-5/6","w-3/5"],Me=({columns:o,rows:i$1,hasSelection:u,hasRowActions:r,hasPagination:s,className:c$1,...R})=>jsxs(a$1,{className:c$1,...R,children:[jsxs(b,{children:[jsx(c,{children:jsxs(g,{children:[u&&jsx(h,{className:"w-13.5",children:jsx(a$3,{className:"bg-primary-300 m-0.5 ml-1.5 size-4.5 rounded-sm"})}),r&&jsx(h,{className:"w-[30px] max-w-[30px] min-w-[30px] p-0 px-0",style:{width:"30px",minWidth:"30px",maxWidth:"30px"}}),Array.from({length:o},(b,y)=>jsx(h,{children:jsx(a$3,{className:"bg-primary-300 h-3 w-16"})},y))]})}),jsx(d,{className:"[&>tr:not(:last-child)>td]:shadow-[inset_0_-1px_0_0_var(--color-primary-200)]",children:Array.from({length:i$1},(b,y)=>jsxs(e,{children:[u&&jsx(i,{className:"align-middle",children:jsx(a$3,{className:"m-0.5 size-4.5 rounded-sm"})}),r&&jsx(i,{className:"!bg-primary-50 w-[30px] max-w-[30px] min-w-[30px] p-0 align-middle",style:{width:"30px",minWidth:"30px",maxWidth:"30px"},children:jsxs("div",{className:"grid h-full w-full grid-rows-3",children:[jsx(a$3,{className:"h-full w-full rounded-none"}),jsx(a$3,{className:"h-full w-full rounded-none"}),jsx(a$3,{className:"h-full w-full rounded-none"})]})}),Array.from({length:o},(x,d)=>jsx(i,{children:jsx(a$3,{className:a("h-4",q[(y+d)%q.length])})},d))]},y))})]}),s&&jsxs("div",{className:"border-t-primary-200 grid min-h-12 grid-cols-3 items-center gap-6 border-t px-4.5",children:[jsx(a$3,{className:"h-3.5 w-20"}),jsxs("div",{className:"flex items-center justify-center gap-2",children:[jsx(a$3,{className:"size-8 rounded-lg"}),jsx(a$3,{className:"size-8 rounded-lg"})]}),jsx("div",{className:"flex justify-end",children:jsx(a$3,{className:"h-3.5 w-28"})})]})]});Me.displayName="DataTableFullSkeleton";var ut={neutral:"bg-neutral-100",success:"bg-success-20",orange:"bg-orange-20",warning:"bg-warning-20",danger:"bg-danger-20",default:"bg-neutral-50"},N="__row_actions__",_e="!bg-transparent hover:!bg-transparent focus:!bg-transparent active:!bg-transparent !h-[30px] !max-h-[30px] !min-h-[30px] !w-[30px] !max-w-[30px] !min-w-[30px] !rounded-none",mt=(o,i)=>typeof o=="function"?o(i):o??false,gt=({row:o,rowActions:i})=>{let[u,r]=useState(false),s=o.original,c=i(s).filter(d=>d.isActive===void 0?true:mt(d.isActive,s)).sort((d,h)=>ke.indexOf(d.name)-ke.indexOf(h.name));if(c.length===0)return null;let R=c.length>3,b=R?c.slice(0,2):c,y=(d,h)=>{let l=ie[d.name];return jsx(c$1,{Icon:l.Icon,"aria-label":d.label,variant:"ghost",size:"sm",iconClassName:l.iconClassName,className:_e,onClick:m=>{m.stopPropagation(),d.onClick(s);},type:"button"},`${d.name}-${h}`)},x=R?3:b.length;return jsxs("div",{className:"grid h-full w-full justify-start overflow-hidden",style:{gridTemplateRows:`repeat(${x}, minmax(0, 1fr))`},children:[b.map((d,h)=>jsx("div",{className:a("flex h-full w-full items-center justify-center",ie[d.name].bgClassName),children:y(d,h)},`${d.name}-${h}`)),R&&jsx("div",{className:"bg-primary-300 flex h-full w-full items-center justify-center",children:jsxs(a$4,{open:u,onOpenChange:r,modal:false,positioning:{placement:"right-start"},children:[jsx(b$2,{asChild:true,children:jsx(c$1,{Icon:Plus,"aria-label":"More actions",variant:"ghost",size:"sm",iconClassName:"text-primary-700",className:_e,type:"button",onClick:d=>{d.stopPropagation();}})}),jsx(c$2,{className:"min-w-48 overflow-hidden rounded-sm p-0",children:jsx("div",{className:"flex flex-col",children:c.map((d,h)=>{let l=ie[d.name];return jsx(c$3,{variant:"ghost",size:"md",StartIcon:l.Icon,className:"!h-auto !min-h-0 w-full justify-start !gap-2 !px-3 !py-4 !text-neutral-900 hover:!text-neutral-900 disabled:!text-neutral-900",onClick:m=>{m.stopPropagation(),d.onClick(s),r(false);},type:"button",children:d.label},`${d.name}-${h}`)})})})]})})]})},ft=({rowActions:o})=>({id:N,header:()=>jsx("span",{className:"sr-only",children:"Actions"}),size:30,minSize:30,maxSize:30,enableResizing:false,cell:({row:i})=>o?jsx(gt,{row:i,rowActions:o}):null}),We=memo(({row:o,isSelected:i$1,resizable:u,type:r})=>jsx(e,{"data-state":i$1&&"selected",className:a(r&&r!=="default"&&ut[r]),style:r&&r!=="default"?{"--color-primary-200":`var(--color-${r}-100)`}:void 0,children:o.getVisibleCells().map(s=>jsx(i,{className:s.column.id===N?"p-0 align-middle":void 0,style:s.column.id===N?{width:"30px",minWidth:"30px",maxWidth:"30px"}:u?{width:`calc(var(--col-${s.column.id}-size) * 1px)`,minWidth:`calc(var(--col-${s.column.id}-size) * 1px)`,maxWidth:`calc(var(--col-${s.column.id}-size) * 1px)`}:void 0,children:flexRender(s.column.columnDef.cell,s.getContext())},s.id))}),(o,i)=>o.isSelected===i.isSelected&&o.row.original===i.row.original&&o.resizable===i.resizable&&o.type===i.type);We.displayName="DataTableRow";var $e="dt-col-ratios-",pt=o=>{try{let i=localStorage.getItem(`${$e}${o}`);return i?JSON.parse(i):{}}catch{return {}}},bt=(o,i)=>{try{localStorage.setItem(`${$e}${o}`,JSON.stringify(i));}catch{}},Oe=(o,i,u)=>{let r={},s=i,c=[];for(let l of o)l.canResize?c.push(l):(r[l.id]=l.defaultSize,s-=l.defaultSize);if(c.length===0||s<=0)return r;let R=new Set(c.map(l=>l.id)),b={};for(let[l,m]of Object.entries(u))R.has(l)&&(b[l]=m);let y=c.filter(l=>!(l.id in b)),x={};if(Object.keys(b).length===0){let l=c.reduce((m,P)=>m+P.defaultSize,0);for(let m of c)x[m.id]=m.defaultSize/l;}else if(y.length===0){let l=Object.values(b).reduce((m,P)=>m+P,0);for(let m of c)x[m.id]=b[m.id]/l;}else {let l=c.reduce((S,v)=>S+v.defaultSize,0),P=y.reduce((S,v)=>S+v.defaultSize,0)/l,k=Object.values(b).reduce((S,v)=>S+v,0),B=(1-P)/k;for(let S of c)S.id in b?x[S.id]=b[S.id]*B:x[S.id]=S.defaultSize/l;}for(let l of c)r[l.id]=Math.max(Math.round(x[l.id]*s),l.defaultSize);let h=c.reduce((l,m)=>l+r[m.id],0)-s;if(h!==0&&c.length>0){let l=c[c.length-1];r[l.id]=Math.max(r[l.id]-h,l.defaultSize);}return r},Ie=(o,i)=>{let u=0;for(let s of i)u+=o[s]??0;if(u===0)return {};let r={};for(let s of i)o[s]!=null&&(r[s]=o[s]/u);return r};function Vt({columns:o,data:i$1,rowsCount:u,pagination:r,onPaginationChange:s,noResults:c$1,onNextPageClick:R,onPreviousPageClick:b$1,disableNextPage:y,disablePreviousPage:x,className:d$1,onRowsPerPageChange:h$1,columnOrder:l,columnVisibility:m,rowsPerPageOptions:P,enableRowSelection:k=false,rowSelection:B,onRowSelectionChange:S,getRowId:v,rowSelectionTooltip:se,setDisabledRowState:re,tableId:w,isLoading:H,isInitialLoading:ce,skeletonRowCount:He,skeletonColumns:Le=6,getRowType:de,rowActions:O,...ue}){let I=typeof k=="function"||k===true,me=useMemo(()=>{if(!l)return;let t=[I?"__select__":null,O?N:null].filter(a=>a!=null),n=new Set(t);return [...t,...l.filter(a=>!n.has(a))]},[l,I,O]),Ee=useMemo(()=>{let t=I?[dt({rowSelectionTooltip:se,setDisabledRowState:re}),...o]:o;if(!O)return t;let n=ft({rowActions:O});return I?[t[0],n,...t.slice(1)]:[n,...t]},[I,o,se,re,O]),[j$1,Be]=useState(null),je=useCallback(t=>Be(t),[]),L=useRef({}),J=useRef(null),[V,X]=useState({}),Ve=t=>{X(n=>{let a=typeof t=="function"?t(n):t,p=J.current;if(!p)return a;let C=p.getState().columnSizingInfo.isResizingColumn;if(!C)return a;let z=p.getVisibleLeafColumns(),D=z.findIndex(A=>A.id===C);if(D===-1)return a;let _=null;for(let A=D+1;A<z.length;A++)if(z[A].getCanResize()){_=z[A];break}if(!_)return a;let F=z[D].columnDef,Ue=F.size??150,qe=F.minSize??80,Y=n[C]??Ue,Je=a[C]??Y,be=Math.max(Je,qe),Ce=be-Y;if(Ce===0)return {...a,[C]:be};let Te=_.id,Xe=_.columnDef.size??150,Ye=_.columnDef.minSize??80,he=n[Te]??Xe,Se=Math.max(he-Ce,Ye),Ge=he-Se,Qe=Y+Ge;return {...a,[C]:Qe,[Te]:Se}});},g$1=useReactTable({data:i$1,columns:Ee,rowCount:u,state:{pagination:r,...me!==void 0&&{columnOrder:me},columnVisibility:m,...B!==void 0&&{rowSelection:B},...w&&{columnSizing:V}},onPaginationChange:s,onRowSelectionChange:S,...w&&{columnResizeMode:"onChange",onColumnSizingChange:Ve,defaultColumn:{minSize:80}},manualPagination:true,getCoreRowModel:getCoreRowModel(),enableRowSelection:typeof k=="function"?t=>k(t.original):k,getRowId:v?t=>v(t):void 0});J.current=g$1;let Fe=g$1.getVisibleLeafColumns().map(t=>t.id).join(","),Ke=()=>g$1.getVisibleLeafColumns().map(t=>({id:t.id,defaultSize:t.columnDef.size??150,canResize:t.getCanResize()})),ge=()=>new Set(g$1.getVisibleLeafColumns().filter(t=>t.getCanResize()).map(t=>t.id));useEffect(()=>{if(!w||!j$1)return;(a=>{let p=Object.keys(L.current).length>0?L.current:pt(w),C=Ke(),z=Oe(C,a,p);L.current=Ie(z,ge()),X(z);})(j$1.clientWidth);let n=new ResizeObserver(([a])=>{if(!a)return;let p=J.current;if(!p||p.getState().columnSizingInfo.isResizingColumn)return;let C=p.getVisibleLeafColumns().map(D=>({id:D.id,defaultSize:D.columnDef.size??150,canResize:D.getCanResize()})),z=Oe(C,a.contentRect.width,L.current);X(z);});return n.observe(j$1),()=>n.disconnect()},[w,Fe,j$1]);let E=useMemo(()=>{if(!w||Object.keys(V).length===0)return;let t=g$1.getFlatHeaders(),n={};for(let a of t)n[`--header-${a.id}-size`]=a.getSize(),n[`--col-${a.column.id}-size`]=a.column.getSize();return n},[w,g$1.getState().columnSizingInfo,g$1.getState().columnSizing]),fe=g$1.getState().columnSizingInfo.isResizingColumn;useEffect(()=>{if(w&&!fe&&Object.keys(V).length>0){let t=ge(),n=Ie(V,t);L.current=n,bt(w,n);}},[w,fe]);let pe=He??r?.pageSize??10;return ce?jsx(Me,{columns:Le,rows:pe,hasSelection:I,hasRowActions:!!O,hasPagination:!!r,className:d$1,...ue}):!H&&!ce&&!g$1.getRowModel().rows?.length?jsx(f,{...c$1}):jsxs(a$1,{ref:je,className:d$1,...ue,children:[jsxs(b,{style:E?{...E,width:g$1.getTotalSize(),tableLayout:"fixed"}:{tableLayout:"fixed"},children:[!E&&jsx("colgroup",{children:(()=>{let t=g$1.getHeaderGroups()[0].headers,n=t.reduce((a,p)=>a+p.getSize(),0);return t.map(a=>jsx("col",{span:1,style:{width:`${a.column.getSize()/n*100}%`,minWidth:`${a.column.getSize()}px`}},a.id))})()}),jsx(c,{children:g$1.getHeaderGroups().map(t=>jsx(g,{children:t.headers.map(n=>{if(n.isPlaceholder)return jsx(h,{style:E?{width:`calc(var(--header-${n.id}-size) * 1px)`,minWidth:`calc(var(--header-${n.id}-size) * 1px)`,maxWidth:`calc(var(--header-${n.id}-size) * 1px)`}:void 0},n.id);let a$1=n.column.columnDef,p=flexRender(a$1.header,n.getContext()),C=n.column.id!=="__select__"&&a$1.headerTooltip!==false,z=a$1.headerTooltip&&typeof a$1.headerTooltip!="boolean"?a$1.headerTooltip:p,D=jsx("span",{className:"font-inter line-clamp-1 text-xs leading-[133%] text-neutral-900 uppercase",children:p});return jsxs(h,{className:n.column.id===N?"p-0 px-0":w?"group/resize relative overflow-clip":void 0,style:n.column.id===N?{width:"30px",minWidth:"30px",maxWidth:"30px"}:E?{width:`calc(var(--header-${n.id}-size) * 1px)`,minWidth:`calc(var(--header-${n.id}-size) * 1px)`,maxWidth:`calc(var(--header-${n.id}-size) * 1px)`}:void 0,children:[jsxs("div",{className:"flex items-center",children:[C?jsx(a$2,{content:z,contentClassName:"font-normal normal-case",children:D}):D,a$1.headerInfoTooltip&&jsx(a$2,{content:a$1.headerInfoTooltip,contentClassName:"font-normal normal-case",children:jsx(e$1,{className:"ml-1 w-[0.875rem] shrink-0"})})]}),w&&n.column.getCanResize()&&t.headers.some((_,F)=>F>t.headers.indexOf(n)&&_.column.getCanResize())&&jsx("div",{onMouseDown:n.getResizeHandler(),onTouchStart:n.getResizeHandler(),className:a("absolute top-0 right-0 h-full w-1 cursor-col-resize touch-none select-none","bg-primary-400 opacity-0 transition-opacity group-hover/resize:opacity-100",n.column.getIsResizing()&&"bg-primary-600 opacity-100")})]},n.id)})},t.id))}),jsx(d,{className:"[&>tr:not(:last-child)>td]:shadow-[inset_0_-1px_0_0_var(--color-primary-200)]",children:H?Array.from({length:pe},(t,n)=>jsx(e,{children:g$1.getVisibleLeafColumns().map((a$1,p)=>{let C=a$1.columnDef;return jsx(i,{className:a$1.id==="__select__"?"align-middle":a$1.id===N?"!bg-primary-50 p-0 align-middle":void 0,style:a$1.id===N?{width:"30px",minWidth:"30px",maxWidth:"30px"}:void 0,children:a$1.id==="__select__"?jsx(a$3,{className:"m-0.5 size-4.5 rounded-sm"}):a$1.id===N?jsxs("div",{className:"grid h-full w-full grid-rows-3",children:[jsx(a$3,{className:"h-full w-full rounded-none"}),jsx(a$3,{className:"h-full w-full rounded-none"}),jsx(a$3,{className:"h-full w-full rounded-none"})]}):C.skeleton!=null?C.skeleton:jsx(a$3,{className:a("h-4",q[(n+p)%q.length])})},a$1.id)})},n)):g$1.getRowModel().rows.map(t=>jsx(We,{row:t,isSelected:t.getIsSelected(),resizable:!!w,type:de?de(t.original):"default"},t.id))})]}),r&&s&&(i$1.length>0||H)&&jsx(j,{rowsPerPageOptions:P,rowsCount:u,pagination:r,onPageSizeChange:t=>{g$1.setPagination({pageIndex:0,pageSize:t}),h$1?.(t);},onPreviousPageClick:b$1,onNextPageClick:R,isDisableNextPageButton:H||y||!!u&&!g$1.getCanNextPage(),isDisablePreviousPageButton:H||x||!!u&&!g$1.getCanPreviousPage(),onPageChange:t=>{g$1.setPageIndex(t-1);}})]})}export{Vt as a};
1
+ import {e,i,f,a as a$1,b,c,g,h,d,j}from'./chunk-NVYSWZZC.js';import {a as a$4,b as b$2,c as c$2}from'./chunk-T2GZMGRZ.js';import {b as b$1}from'./chunk-JB6QLQCK.js';import {c as c$1}from'./chunk-WQPZV6HK.js';import {c as c$3}from'./chunk-55Z77FLU.js';import {a as a$2}from'./chunk-CM6ALMTT.js';import {e as e$1}from'./chunk-QNQELNVU.js';import {a as a$3}from'./chunk-KTD2GEB6.js';import {a}from'./chunk-OBZIYJO7.js';import {memo,useMemo,useState,useCallback,useRef,useEffect}from'react';import {flexRender,useReactTable,getCoreRowModel}from'@tanstack/react-table';import {Component,KeyRound,MailWarning,MapPinOff,TriangleAlert,Siren,Plus}from'lucide-react';import {jsx,jsxs}from'react/jsx-runtime';var ke=["siren","warning","map-pin-off","email-alert","key-round","component"],ie={siren:{Icon:Siren,bgClassName:"bg-orange-50",iconClassName:"text-orange-700"},warning:{Icon:TriangleAlert,bgClassName:"bg-warning-100",iconClassName:"text-warning-900"},"map-pin-off":{Icon:MapPinOff,bgClassName:"bg-coral-50",iconClassName:"text-coral-700"},"email-alert":{Icon:MailWarning,bgClassName:"bg-danger-100",iconClassName:"text-danger-700"},"key-round":{Icon:KeyRound,bgClassName:"bg-orchid-100",iconClassName:"text-orchid-700"},component:{Icon:Component,bgClassName:"bg-aqua-100",iconClassName:"text-aqua-800"}},dt=o=>({id:"__select__",size:54,enableResizing:false,header:({table:i})=>{let u=i.getRowModel().rows.some(s=>s.getCanSelect()),r=i.getIsAllPageRowsSelected()?true:i.getIsSomePageRowsSelected()?"indeterminate":false;return jsx(b$1,{checked:r,disabled:!u,className:"ml-1",onCheckedChange:s=>i.toggleAllPageRowsSelected(s===true)})},cell:({row:i})=>{let u=i.getCanSelect(),r=u?i.getIsSelected():typeof o.setDisabledRowState=="function"?o.setDisabledRowState(i.original):o.setDisabledRowState??false,s=jsx(b$1,{checked:r,onCheckedChange:R=>i.toggleSelected(R===true),disabled:!u}),c=o.rowSelectionTooltip?.content(i.original);return c?jsx(a$2,{className:"w-fit",content:c,positioning:o.rowSelectionTooltip?.positioning??{placement:"right"},children:s}):s},enableSorting:false}),q=["w-3/4","w-1/2","w-2/3","w-5/6","w-3/5"],Me=({columns:o,rows:i$1,hasSelection:u,hasRowActions:r,hasPagination:s,className:c$1,...R})=>jsxs(a$1,{className:c$1,...R,children:[jsxs(b,{children:[jsx(c,{children:jsxs(g,{children:[u&&jsx(h,{className:"w-13.5",children:jsx(a$3,{className:"bg-primary-300 m-0.5 ml-1.5 size-4.5 rounded-sm"})}),r&&jsx(h,{className:"w-[30px] max-w-[30px] min-w-[30px] p-0 px-0",style:{width:"30px",minWidth:"30px",maxWidth:"30px"}}),Array.from({length:o},(b,y)=>jsx(h,{children:jsx(a$3,{className:"bg-primary-300 h-3 w-16"})},y))]})}),jsx(d,{className:"[&>tr:not(:last-child)>td]:shadow-[inset_0_-1px_0_0_var(--color-primary-200)]",children:Array.from({length:i$1},(b,y)=>jsxs(e,{children:[u&&jsx(i,{className:"align-middle",children:jsx(a$3,{className:"m-0.5 size-4.5 rounded-sm"})}),r&&jsx(i,{className:"!bg-primary-50 w-[30px] max-w-[30px] min-w-[30px] p-0 align-middle",style:{width:"30px",minWidth:"30px",maxWidth:"30px"},children:jsxs("div",{className:"grid h-full w-full grid-rows-3",children:[jsx(a$3,{className:"h-full w-full rounded-none"}),jsx(a$3,{className:"h-full w-full rounded-none"}),jsx(a$3,{className:"h-full w-full rounded-none"})]})}),Array.from({length:o},(x,d)=>jsx(i,{children:jsx(a$3,{className:a("h-4",q[(y+d)%q.length])})},d))]},y))})]}),s&&jsxs("div",{className:"border-t-primary-200 grid min-h-12 grid-cols-3 items-center gap-6 border-t px-4.5",children:[jsx(a$3,{className:"h-3.5 w-20"}),jsxs("div",{className:"flex items-center justify-center gap-2",children:[jsx(a$3,{className:"size-8 rounded-lg"}),jsx(a$3,{className:"size-8 rounded-lg"})]}),jsx("div",{className:"flex justify-end",children:jsx(a$3,{className:"h-3.5 w-28"})})]})]});Me.displayName="DataTableFullSkeleton";var ut={neutral:"bg-neutral-100",success:"bg-success-20",orange:"bg-orange-20",warning:"bg-warning-20",danger:"bg-danger-20",default:"bg-neutral-50"},N="__row_actions__",_e="!bg-transparent hover:!bg-transparent focus:!bg-transparent active:!bg-transparent !h-[30px] !max-h-[30px] !min-h-[30px] !w-[30px] !max-w-[30px] !min-w-[30px] !rounded-none",mt=(o,i)=>typeof o=="function"?o(i):o??false,gt=({row:o,rowActions:i})=>{let[u,r]=useState(false),s=o.original,c=i(s).filter(d=>d.isActive===void 0?true:mt(d.isActive,s)).sort((d,h)=>ke.indexOf(d.name)-ke.indexOf(h.name));if(c.length===0)return null;let R=c.length>3,b=R?c.slice(0,2):c,y=(d,h)=>{let l=ie[d.name];return jsx(c$1,{Icon:l.Icon,"aria-label":d.label,variant:"ghost",size:"sm",iconClassName:l.iconClassName,className:_e,onClick:m=>{m.stopPropagation(),d.onClick(s);},type:"button"},`${d.name}-${h}`)},x=R?3:b.length;return jsxs("div",{className:"grid h-full w-full justify-start overflow-hidden",style:{gridTemplateRows:`repeat(${x}, minmax(0, 1fr))`},children:[b.map((d,h)=>jsx("div",{className:a("flex h-full w-full items-center justify-center",ie[d.name].bgClassName),children:y(d,h)},`${d.name}-${h}`)),R&&jsx("div",{className:"bg-primary-300 flex h-full w-full items-center justify-center",children:jsxs(a$4,{open:u,onOpenChange:r,modal:false,positioning:{placement:"right-start"},children:[jsx(b$2,{asChild:true,children:jsx(c$1,{Icon:Plus,"aria-label":"More actions",variant:"ghost",size:"sm",iconClassName:"text-primary-700",className:_e,type:"button",onClick:d=>{d.stopPropagation();}})}),jsx(c$2,{className:"min-w-48 overflow-hidden rounded-sm p-0",children:jsx("div",{className:"flex flex-col",children:c.map((d,h)=>{let l=ie[d.name];return jsx(c$3,{variant:"ghost",size:"md",StartIcon:l.Icon,className:"!h-auto !min-h-0 w-full justify-start !gap-2 !px-3 !py-4 !text-neutral-900 hover:!text-neutral-900 disabled:!text-neutral-900",onClick:m=>{m.stopPropagation(),d.onClick(s),r(false);},type:"button",children:d.label},`${d.name}-${h}`)})})})]})})]})},ft=({rowActions:o})=>({id:N,header:()=>jsx("span",{className:"sr-only",children:"Actions"}),size:30,minSize:30,maxSize:30,enableResizing:false,cell:({row:i})=>o?jsx(gt,{row:i,rowActions:o}):null}),We=memo(({row:o,isSelected:i$1,resizable:u,type:r})=>jsx(e,{"data-state":i$1&&"selected",className:a(r&&r!=="default"&&ut[r]),style:r&&r!=="default"?{"--color-primary-200":`var(--color-${r}-100)`}:void 0,children:o.getVisibleCells().map(s=>jsx(i,{className:s.column.id===N?"p-0 align-middle":void 0,style:s.column.id===N?{width:"30px",minWidth:"30px",maxWidth:"30px"}:u?{width:`calc(var(--col-${s.column.id}-size) * 1px)`,minWidth:`calc(var(--col-${s.column.id}-size) * 1px)`,maxWidth:`calc(var(--col-${s.column.id}-size) * 1px)`}:void 0,children:flexRender(s.column.columnDef.cell,s.getContext())},s.id))}),(o,i)=>o.isSelected===i.isSelected&&o.row.original===i.row.original&&o.resizable===i.resizable&&o.type===i.type);We.displayName="DataTableRow";var $e="dt-col-ratios-",pt=o=>{try{let i=localStorage.getItem(`${$e}${o}`);return i?JSON.parse(i):{}}catch{return {}}},bt=(o,i)=>{try{localStorage.setItem(`${$e}${o}`,JSON.stringify(i));}catch{}},Oe=(o,i,u)=>{let r={},s=i,c=[];for(let l of o)l.canResize?c.push(l):(r[l.id]=l.defaultSize,s-=l.defaultSize);if(c.length===0||s<=0)return r;let R=new Set(c.map(l=>l.id)),b={};for(let[l,m]of Object.entries(u))R.has(l)&&(b[l]=m);let y=c.filter(l=>!(l.id in b)),x={};if(Object.keys(b).length===0){let l=c.reduce((m,P)=>m+P.defaultSize,0);for(let m of c)x[m.id]=m.defaultSize/l;}else if(y.length===0){let l=Object.values(b).reduce((m,P)=>m+P,0);for(let m of c)x[m.id]=b[m.id]/l;}else {let l=c.reduce((S,v)=>S+v.defaultSize,0),P=y.reduce((S,v)=>S+v.defaultSize,0)/l,k=Object.values(b).reduce((S,v)=>S+v,0),B=(1-P)/k;for(let S of c)S.id in b?x[S.id]=b[S.id]*B:x[S.id]=S.defaultSize/l;}for(let l of c)r[l.id]=Math.max(Math.round(x[l.id]*s),l.defaultSize);let h=c.reduce((l,m)=>l+r[m.id],0)-s;if(h!==0&&c.length>0){let l=c[c.length-1];r[l.id]=Math.max(r[l.id]-h,l.defaultSize);}return r},Ie=(o,i)=>{let u=0;for(let s of i)u+=o[s]??0;if(u===0)return {};let r={};for(let s of i)o[s]!=null&&(r[s]=o[s]/u);return r};function Vt({columns:o,data:i$1,rowsCount:u,pagination:r,onPaginationChange:s,noResults:c$1,onNextPageClick:R,onPreviousPageClick:b$1,disableNextPage:y,disablePreviousPage:x,className:d$1,onRowsPerPageChange:h$1,columnOrder:l,columnVisibility:m,rowsPerPageOptions:P,enableRowSelection:k=false,rowSelection:B,onRowSelectionChange:S,getRowId:v,rowSelectionTooltip:se,setDisabledRowState:re,tableId:w,isLoading:H,isInitialLoading:ce,skeletonRowCount:He,skeletonColumns:Le=6,getRowType:de,rowActions:O,...ue}){let I=typeof k=="function"||k===true,me=useMemo(()=>{if(!l)return;let t=[I?"__select__":null,O?N:null].filter(a=>a!=null),n=new Set(t);return [...t,...l.filter(a=>!n.has(a))]},[l,I,O]),Ee=useMemo(()=>{let t=I?[dt({rowSelectionTooltip:se,setDisabledRowState:re}),...o]:o;if(!O)return t;let n=ft({rowActions:O});return I?[t[0],n,...t.slice(1)]:[n,...t]},[I,o,se,re,O]),[j$1,Be]=useState(null),je=useCallback(t=>Be(t),[]),L=useRef({}),J=useRef(null),[V,X]=useState({}),Ve=t=>{X(n=>{let a=typeof t=="function"?t(n):t,p=J.current;if(!p)return a;let C=p.getState().columnSizingInfo.isResizingColumn;if(!C)return a;let z=p.getVisibleLeafColumns(),D=z.findIndex(A=>A.id===C);if(D===-1)return a;let _=null;for(let A=D+1;A<z.length;A++)if(z[A].getCanResize()){_=z[A];break}if(!_)return a;let F=z[D].columnDef,Ue=F.size??150,qe=F.minSize??80,Y=n[C]??Ue,Je=a[C]??Y,be=Math.max(Je,qe),Ce=be-Y;if(Ce===0)return {...a,[C]:be};let Te=_.id,Xe=_.columnDef.size??150,Ye=_.columnDef.minSize??80,he=n[Te]??Xe,Se=Math.max(he-Ce,Ye),Ge=he-Se,Qe=Y+Ge;return {...a,[C]:Qe,[Te]:Se}});},g$1=useReactTable({data:i$1,columns:Ee,rowCount:u,state:{pagination:r,...me!==void 0&&{columnOrder:me},columnVisibility:m,...B!==void 0&&{rowSelection:B},...w&&{columnSizing:V}},onPaginationChange:s,onRowSelectionChange:S,...w&&{columnResizeMode:"onChange",onColumnSizingChange:Ve,defaultColumn:{minSize:80}},manualPagination:true,getCoreRowModel:getCoreRowModel(),enableRowSelection:typeof k=="function"?t=>k(t.original):k,getRowId:v?t=>v(t):void 0});J.current=g$1;let Fe=g$1.getVisibleLeafColumns().map(t=>t.id).join(","),Ke=()=>g$1.getVisibleLeafColumns().map(t=>({id:t.id,defaultSize:t.columnDef.size??150,canResize:t.getCanResize()})),ge=()=>new Set(g$1.getVisibleLeafColumns().filter(t=>t.getCanResize()).map(t=>t.id));useEffect(()=>{if(!w||!j$1)return;(a=>{let p=Object.keys(L.current).length>0?L.current:pt(w),C=Ke(),z=Oe(C,a,p);L.current=Ie(z,ge()),X(z);})(j$1.clientWidth);let n=new ResizeObserver(([a])=>{if(!a)return;let p=J.current;if(!p||p.getState().columnSizingInfo.isResizingColumn)return;let C=p.getVisibleLeafColumns().map(D=>({id:D.id,defaultSize:D.columnDef.size??150,canResize:D.getCanResize()})),z=Oe(C,a.contentRect.width,L.current);X(z);});return n.observe(j$1),()=>n.disconnect()},[w,Fe,j$1]);let E=useMemo(()=>{if(!w||Object.keys(V).length===0)return;let t=g$1.getFlatHeaders(),n={};for(let a of t)n[`--header-${a.id}-size`]=a.getSize(),n[`--col-${a.column.id}-size`]=a.column.getSize();return n},[w,g$1.getState().columnSizingInfo,g$1.getState().columnSizing]),fe=g$1.getState().columnSizingInfo.isResizingColumn;useEffect(()=>{if(w&&!fe&&Object.keys(V).length>0){let t=ge(),n=Ie(V,t);L.current=n,bt(w,n);}},[w,fe]);let pe=He??r?.pageSize??10;return ce?jsx(Me,{columns:Le,rows:pe,hasSelection:I,hasRowActions:!!O,hasPagination:!!r,className:d$1,...ue}):!H&&!ce&&!g$1.getRowModel().rows?.length?jsx(f,{...c$1}):jsxs(a$1,{ref:je,className:d$1,...ue,children:[jsxs(b,{style:E?{...E,width:g$1.getTotalSize(),tableLayout:"fixed"}:{tableLayout:"fixed"},children:[!E&&jsx("colgroup",{children:(()=>{let t=g$1.getHeaderGroups()[0].headers,n=t.reduce((a,p)=>a+p.getSize(),0);return t.map(a=>jsx("col",{span:1,style:{width:`${a.column.getSize()/n*100}%`,minWidth:`${a.column.getSize()}px`}},a.id))})()}),jsx(c,{children:g$1.getHeaderGroups().map(t=>jsx(g,{children:t.headers.map(n=>{if(n.isPlaceholder)return jsx(h,{style:E?{width:`calc(var(--header-${n.id}-size) * 1px)`,minWidth:`calc(var(--header-${n.id}-size) * 1px)`,maxWidth:`calc(var(--header-${n.id}-size) * 1px)`}:void 0},n.id);let a$1=n.column.columnDef,p=flexRender(a$1.header,n.getContext()),C=n.column.id!=="__select__"&&a$1.headerTooltip!==false,z=a$1.headerTooltip&&typeof a$1.headerTooltip!="boolean"?a$1.headerTooltip:p,D=jsx("span",{className:"font-inter line-clamp-1 text-xs leading-[133%] text-neutral-900 uppercase",children:p});return jsxs(h,{className:n.column.id===N?"p-0 px-0":w?"group/resize relative overflow-clip":void 0,style:n.column.id===N?{width:"30px",minWidth:"30px",maxWidth:"30px"}:E?{width:`calc(var(--header-${n.id}-size) * 1px)`,minWidth:`calc(var(--header-${n.id}-size) * 1px)`,maxWidth:`calc(var(--header-${n.id}-size) * 1px)`}:void 0,children:[jsxs("div",{className:"flex items-center",children:[C?jsx(a$2,{content:z,contentClassName:"font-normal normal-case",children:D}):D,a$1.headerInfoTooltip&&jsx(a$2,{content:a$1.headerInfoTooltip,contentClassName:"font-normal normal-case",children:jsx(e$1,{className:"ml-1 w-[0.875rem] shrink-0"})})]}),w&&n.column.getCanResize()&&t.headers.some((_,F)=>F>t.headers.indexOf(n)&&_.column.getCanResize())&&jsx("div",{onMouseDown:n.getResizeHandler(),onTouchStart:n.getResizeHandler(),className:a("absolute top-0 right-0 h-full w-1 cursor-col-resize touch-none select-none","bg-primary-400 opacity-0 transition-opacity group-hover/resize:opacity-100",n.column.getIsResizing()&&"bg-primary-600 opacity-100")})]},n.id)})},t.id))}),jsx(d,{className:"[&>tr:not(:last-child)>td]:shadow-[inset_0_-1px_0_0_var(--color-primary-200)]",children:H?Array.from({length:pe},(t,n)=>jsx(e,{children:g$1.getVisibleLeafColumns().map((a$1,p)=>{let C=a$1.columnDef;return jsx(i,{className:a$1.id==="__select__"?"align-middle":a$1.id===N?"!bg-primary-50 p-0 align-middle":void 0,style:a$1.id===N?{width:"30px",minWidth:"30px",maxWidth:"30px"}:void 0,children:a$1.id==="__select__"?jsx(a$3,{className:"m-0.5 size-4.5 rounded-sm"}):a$1.id===N?jsxs("div",{className:"grid h-full w-full grid-rows-3",children:[jsx(a$3,{className:"h-full w-full rounded-none"}),jsx(a$3,{className:"h-full w-full rounded-none"}),jsx(a$3,{className:"h-full w-full rounded-none"})]}):C.skeleton!=null?C.skeleton:jsx(a$3,{className:a("h-4",q[(n+p)%q.length])})},a$1.id)})},n)):g$1.getRowModel().rows.map(t=>jsx(We,{row:t,isSelected:t.getIsSelected(),resizable:!!w,type:de?de(t.original):"default"},t.id))})]}),r&&s&&(i$1.length>0||H)&&jsx(j,{rowsPerPageOptions:P,rowsCount:u,pagination:r,onPageSizeChange:t=>{g$1.setPagination({pageIndex:0,pageSize:t}),h$1?.(t);},onPreviousPageClick:b$1,onNextPageClick:R,isDisableNextPageButton:H||y||!!u&&!g$1.getCanNextPage(),isDisablePreviousPageButton:H||x||!!u&&!g$1.getCanPreviousPage(),onPageChange:t=>{g$1.setPageIndex(t-1);}})]})}export{Vt as a};
@@ -0,0 +1 @@
1
+ import {a as a$5}from'./chunk-LU2N5UJD.js';import {b as b$1}from'./chunk-5DHKKW3D.js';import {a as a$8,b as b$2,c as c$4}from'./chunk-T2GZMGRZ.js';import {a as a$a}from'./chunk-GFVJRSZI.js';import {a as a$4}from'./chunk-A2VW62QH.js';import {c as c$6}from'./chunk-XPR5NR6A.js';import {d as d$1}from'./chunk-3Q4SUKIS.js';import {b}from'./chunk-JB6QLQCK.js';import {c as c$5}from'./chunk-JYNJHAGL.js';import {a as a$b}from'./chunk-SKMTTF6M.js';import {a as a$6}from'./chunk-UIZFLYFP.js';import {d as d$2}from'./chunk-MP4CHZ2K.js';import {a as a$3}from'./chunk-R6NIURLZ.js';import {a as a$1}from'./chunk-4CM257A2.js';import {c as c$2}from'./chunk-WQPZV6HK.js';import {c}from'./chunk-55Z77FLU.js';import {c as c$3,a as a$9}from'./chunk-5EP3PIED.js';import {a}from'./chunk-F5EHWT6X.js';import {a as a$7}from'./chunk-BJ5MXTGP.js';import {c as c$1,s,t,h,d,q,g,p,j}from'./chunk-QNQELNVU.js';import {a as a$2}from'./chunk-OBZIYJO7.js';import*as F from'react';import F__default,{createContext,useMemo,useCallback,forwardRef,useRef,useContext,useEffect,useId,useState}from'react';import*as St from'@radix-ui/react-portal';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {LexicalComposer}from'@lexical/react/LexicalComposer';import {RichTextPlugin}from'@lexical/react/LexicalRichTextPlugin';import {ContentEditable}from'@lexical/react/LexicalContentEditable';import {HistoryPlugin}from'@lexical/react/LexicalHistoryPlugin';import {ListPlugin}from'@lexical/react/LexicalListPlugin';import {AutoFocusPlugin}from'@lexical/react/LexicalAutoFocusPlugin';import {OnChangePlugin}from'@lexical/react/LexicalOnChangePlugin';import {LexicalErrorBoundary}from'@lexical/react/LexicalErrorBoundary';import {HeadingNode,$isHeadingNode,$createHeadingNode}from'@lexical/rich-text';import {ListNode,ListItemNode,$isListNode,REMOVE_LIST_COMMAND,INSERT_UNORDERED_LIST_COMMAND,INSERT_ORDERED_LIST_COMMAND}from'@lexical/list';import {useLexicalComposerContext}from'@lexical/react/LexicalComposerContext';import {$generateHtmlFromNodes,$generateNodesFromDOM}from'@lexical/html';import {$getSelection,$isRangeSelection,$isElementNode,SELECTION_CHANGE_COMMAND,CAN_UNDO_COMMAND,CAN_REDO_COMMAND,UNDO_COMMAND,REDO_COMMAND,OUTDENT_CONTENT_COMMAND,INDENT_CONTENT_COMMAND,FORMAT_ELEMENT_COMMAND,$createParagraphNode,FORMAT_TEXT_COMMAND,$getRoot,$insertNodes}from'lexical';import {$setBlocksType}from'@lexical/selection';import {$findMatchingParent,mergeRegister}from'@lexical/utils';import {AlignJustifyIcon,AlignRightIcon,AlignCenterIcon,AlignLeftIcon,UnderlineIcon,ItalicIcon,BoldIcon,UndoIcon,RedoIcon,ListIcon,ListOrderedIcon,IndentDecreaseIcon,IndentIncreaseIcon}from'lucide-react';import {Collapsible}from'@ark-ui/react/collapsible';import {MenuRoot,MenuTrigger,MenuPositioner,MenuContent,MenuItem}from'@ark-ui/react/menu';import {Portal}from'@ark-ui/react/portal';import {tv,cn}from'tailwind-variants';import wi,{parsePhoneNumber,getCountryCallingCode}from'react-phone-number-input';import {useListCollection,useCombobox,Combobox}from'@ark-ui/react/combobox';import {useFilter}from'@ark-ui/react/locale';import {getDefaultOptions}from'date-fns';import {getExampleNumber}from'libphonenumber-js/mobile';import Ci from'libphonenumber-js/mobile/examples';import Li from'react-phone-number-input/locale/en.json';import yi from'react-phone-number-input/locale/es.json';import Ri from'react-phone-number-input/locale/pt.json';import ki from'react-phone-number-input/flags';var Oo=F__default.memo(({handleSelect:e,NoResultsIcon:t,noResultsLabel:o,noResultsDescription:n,noResultsDescriptionLines:i,noResultsAsColumn:r,noResultsButtonOnClick:s,optionDescriptionLines:a$3,noResultsButtonLabel:l,filteredOptions:p,inputRect:c$1,inputRef:f,popoverPosition:h,optionsListRef:d,selectedOption:x,options:L,setFilteredOptions:R})=>jsx(St.Root,{asChild:true,children:jsxs("div",{ref:d,className:"elevation-8 pointer-events-auto fixed z-50 mb-2 hidden max-h-[336px] w-full flex-col overflow-y-auto rounded-lg bg-neutral-50",style:c$1?{width:`${c$1.width}px`,left:c$1.left,top:h==="bottom"?`${c$1.bottom}px`:void 0,bottom:h==="top"?`${window.innerHeight-c$1.top}px`:void 0}:void 0,children:[p.length===0&&jsxs("div",{className:"elevation-8 flex max-h-88 flex-1 flex-col justify-center rounded-lg bg-neutral-50",children:[jsx(a,{title:o,description:n,Icon:t,iconAsColumn:r,descriptionLines:i}),s&&jsxs(Fragment,{children:[jsx(a$1,{}),jsx(c,{variant:"ghost",className:"my-3 w-fit self-center",onClick:()=>{d.current.style.display="none",f.current.value="",R(L),s();},children:l})]})]}),p.map(g=>jsx(ce,{title:g.label,disabled:g.disabled,description:g.description,descriptionLines:a$3,onClick:()=>e(g),className:a$2(x?.value===g.value&&"bg-primary-200")},g.key??g.value))]})})),Ft=Oo;var wo=336,ts=({options:e,defaultSelectedOption:t,onSelect:o,onClick:n,onInputChange:i,error:r,helperText:s,label:a,placeholder:l,value:p,size:c="md",optionDescriptionLines:f=1,noResultsLabel:h,noResultsIcon:d,noResultsDescription:x,noResultsDescriptionLines:L,noResultsAsColumn:R,noResultsButtonOnClick:g,noResultsButtonLabel:M,className:I,disabled:P})=>{let[b,N]=useState(t??null),E=useRef(null),y=useRef(null),[w,S]=useState(),[q,D]=useState([]),[C,m]=useState("bottom"),[T,H]=useState(),V=wo,Q=useCallback(O=>{E.current.style.display="none",y.current.value=O.label,N(O),o?.(O);},[o]),B=useCallback(()=>{if(!y?.current)return;let O=y.current.getBoundingClientRect();S(O);let j=T?T.height:V,G=window.innerHeight-O.bottom>j,Pe=O.top>j;m(G?"bottom":Pe?"top":"bottom");},[T?.height]),te=useCallback(()=>{let O=e.filter(j=>j.label.toLowerCase().includes(y?.current?.value.toLowerCase()??""));if(D(O),E?.current){let j=E.current.getBoundingClientRect();H(j);}},[e]);return useEffect(()=>{D(e);},[e]),useEffect(()=>{if(!p){N(null),y.current&&(y.current.value="");return}(!y.current?.value||b?.value!==p.value)&&(N(p),y.current.value=p.label);},[p]),a$a(E,()=>{E.current.style.display="none",b&&y.current&&(y.current.value=b.label);}),useEffect(()=>{if(y?.current)return B(),y.current.addEventListener("mousedown",B),y.current.addEventListener("input",te),window.addEventListener("scroll",B,true),window.addEventListener("resize",B),()=>{y.current?.removeEventListener("mousedown",B),y.current?.removeEventListener("input",te),window.removeEventListener("scroll",B,true),window.removeEventListener("resize",B);}},[B,te]),jsxs("div",{className:a$2("relative",I),children:[jsx(a$4,{ref:y,autoComplete:"off",list:"",selectMode:true,onChange:O=>{O.target.value||(N(null),o?.(null)),i?.(O);},onClean:()=>{N(null),D(e),o?.(null);},onClick:O=>{E.current.style.display="flex",n?.(O);},onBlur:()=>{b&&y.current&&(y.current.value=b.label);},label:a,helperText:s,placeholder:l,size:c,error:r,disabled:P}),jsx(Ft,{handleSelect:Q,noResultsLabel:h,NoResultsIcon:d,optionDescriptionLines:f,noResultsAsColumn:R,noResultsButtonLabel:M,noResultsButtonOnClick:g,noResultsDescription:x,noResultsDescriptionLines:L,filteredOptions:q,inputRect:w,inputRef:y,popoverPosition:C,optionsListRef:E,selectedOption:b,options:e,setFilteredOptions:D})]})};var So=({children:e,title:t,titleLines:o,description:n="",descriptionLines:i,disabled:r=false,className:s,...a})=>jsxs("div",{className:a$2("flex w-full flex-col gap-1",s),...a,children:[jsx("p",{className:a$2("text-sm leading-[130%] break-all",!!n&&"font-medium"),style:o?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:o}:void 0,children:t}),n&&jsx("p",{className:a$2("text-xs leading-[130%]",r?"text-neutral-400":"text-neutral-700"),style:i?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:i}:void 0,children:n})]}),re=So;var ce=({children:e,title:t,titleLines:o,description:n="",descriptionLines:i,startIcon:r,endIcon:s,hasDivider:a=false,disabled:l=false,isSelected:p=false,className:c,...f})=>jsxs(Y,{hasDescription:!!n,disabled:l,hasDivider:a,className:c,isSelected:p,...f,children:[r&&F__default.cloneElement(r,{className:"shrink-0 mr-2 h-4.5 w-4.5"}),jsx(re,{title:t,titleLines:o,description:n,descriptionLines:i,disabled:l}),s&&F__default.cloneElement(s,{className:"min-h-4.5 min-w-4.5 self-center ml-4"})]});var Ut=({children:e,title:t,titleLines:o=1,description:n="",descriptionLines:i,startIcon:r,hasDivider:s=false,disabled:a=false,checked:l,onCheckedChange:p,className:c,...f})=>jsxs(Y,{hasDescription:!!n,disabled:a,hasDivider:s,...f,className:a$2("pr-6",c),children:[r&&F__default.cloneElement(r,{className:"shrink-0 w-4.5 h-4.5 mr-2"}),jsx(re,{title:t,titleLines:o,description:n,descriptionLines:i,disabled:a}),jsx(b,{checked:l,onCheckedChange:p,className:"ml-4 self-center",disabled:a})]});var J=336,Wt=createContext({inputRef:null,optionsListRef:null,autocompleteId:"",inputRect:void 0,showChips:false,filteredOptions:[],currentFocus:-1,popoverPosition:"bottom",setFilteredOptions:()=>{},setCurrentFocus:()=>{},setShowChips:()=>{},setPopoverPosition:()=>{},setInputRect:()=>{},optionsListHeight:J,setOptionsListHeight:()=>{},optionsListRect:void 0,setOptionsListRect:()=>{}}),Z=()=>{let e=useContext(Wt);if(e===null)throw new Error("useAutocompleteMultipleContext must be used within a AutocompleteMultipleProvider");return e},qt=({children:e})=>{let t=useRef(null),o=useRef(null),n=useId(),[i,r]=useState(),[s,a]=useState(true),[l,p]=useState([]),[c,f]=useState(-1),[h,d]=useState("bottom"),[x,L]=useState(),[R,g]=useState(J);return jsx(Wt.Provider,{value:{optionsListRef:t,inputRef:o,autocompleteId:n,inputRect:i,showChips:s,filteredOptions:l,currentFocus:c,popoverPosition:h,setFilteredOptions:p,setCurrentFocus:f,setShowChips:a,setPopoverPosition:d,setInputRect:r,optionsListHeight:R,optionsListRect:x,setOptionsListRect:L,setOptionsListHeight:g},children:e})};var Ko=({option:e,onMountWidth:t,size:o})=>{let n=useRef(null);return useEffect(()=>{n.current&&t?.(n.current.clientWidth);},[]),jsx(d$1,{type:"fill",variant:"standard",ref:n,className:"shrink-0",size:o==="md"?"xs":"sm",hasCloseIcon:false,children:e.label})},Gt=Ko;var Yo=150,Zo=F__default.memo(({selectedOptions:e,error:t,onCleanSelectedOptions:o,disabled:n,size:i})=>{let{autocompleteId:r,inputRect:s,inputRef:a,optionsListRef:l}=Z(),p=F__default.useRef(null),[c,f]=F__default.useState(new Map),h=useMemo(()=>{if(!s?.width)return [];let x=0,L=s.width-Yo,R=0;for(let g=0;g<e.length&&(R+=c.get(g)??0,!(R>L));g++)x++;return e.slice(0,x)},[s?.width,e,c]),d=useCallback(()=>{n||(a?.current?.focus(),l.current.style.display="flex");},[n]);return jsxs("div",{onClick:d,className:a$2("absolute top-0 z-30 flex w-full cursor-pointer flex-nowrap items-center gap-2 pr-12 pl-3",n&&"cursor-not-allowed"),style:{maxWidth:s?.width?s?.width:void 0,height:s?.height?s?.height:void 0},children:[jsx("div",{className:"flex flex-1 gap-1 overflow-hidden",ref:p,children:h.map((x,L)=>jsx(Gt,{option:x,onMountWidth:R=>f(g=>new Map(g).set(L,R)),size:i},`chip-input-${r}-${x.value}`))}),e.length>h.length&&jsx("span",{className:"text-base",children:"..."}),e.length>0&&!t&&jsx(a$3,{content:String(e.length),size:i}),t&&e.length>0&&jsx(c$1,{className:"text-error-700 h-6 w-6",onClick:x=>{x.stopPropagation(),o();}})]})}),Kt=Zo;var tn=F__default.memo(({option:e,index:t,onPressOption:o,isSelected:n,optionDescriptionLines:i})=>{let{currentFocus:r,inputRef:s}=Z();return jsx(Ut,{title:e.label,checked:n,disabled:e.disabled,className:r===t?"bg-primary-200":void 0,onMouseDown:a=>{e.disabled||(s?.current?.value&&a.preventDefault(),o?.(e,a));},description:e.description,descriptionLines:i})}),je=tn;var ln=F__default.memo(({selectedOptions:e,handleSelect:t,NoResultsIcon:o,noResultsLabel:n,noResultsDescription:i,noResultsDescriptionLines:r,noResultsAsColumn:s,noResultsButtonOnClick:a$2,optionDescriptionLines:l,noResultsButtonLabel:p})=>{let{popoverPosition:c$1,optionsListRef:f,filteredOptions:h,inputRect:d,autocompleteId:x,inputRef:L,optionsListHeight:R}=Z(),g=useCallback(I=>e.some(P=>P.value===I.value),[e]),M=useMemo(()=>e.filter(I=>I.label.toLowerCase().includes(L?.current?.value.toLowerCase()??"")),[e,L?.current?.value]);return jsx(St.Root,{asChild:true,children:jsxs("div",{ref:f,className:"elevation-8 pointer-events-auto fixed z-50 mb-2 hidden w-full flex-col overflow-y-auto rounded-lg bg-neutral-50",style:d?{width:`${d.width}px`,left:d.left,top:c$1==="bottom"?`${d.bottom}px`:void 0,bottom:c$1==="top"?`${window.innerHeight-d.top}px`:void 0,maxHeight:R+"px"}:void 0,children:[h.length===0&&jsxs("div",{className:"elevation-8 flex max-h-88 flex-1 flex-col justify-center rounded-lg bg-neutral-50",children:[jsx(a,{title:n,description:i,Icon:o,iconAsColumn:s,descriptionLines:r}),a$2&&jsxs(Fragment,{children:[jsx(a$1,{}),jsx(c,{variant:"ghost",className:"my-3 w-fit self-center",onClick:()=>{f.current.style.display="none",L.current.value="",a$2();},children:p})]})]}),M.map((I,P)=>jsx(je,{option:I,index:P,onPressOption:b=>t(b),isSelected:g(I),optionDescriptionLines:l},`autocomplete-option-${x}-${I.key??I.value}`)),h.map((I,P)=>!e.some(b=>b.value===I.value)&&jsx(je,{option:I,index:P,onPressOption:b=>t(b),isSelected:g(I),optionDescriptionLines:l},`autocomplete-option-${x}-${I.key??I.value}`))]})})}),jt=ln;var pn=F__default.memo(({selectedOptions:e,onSelect:t,error:o,helperText:n,label:i,placeholder:r,options:s,onInputChange:a,size:l,disabled:p})=>{let{setCurrentFocus:c,setFilteredOptions:f,optionsListRef:h,inputRef:d}=Z();return jsx(a$4,{ref:d,autoComplete:"off",list:"",disabled:p,selectMode:true,onChange:x=>{c(-1),a?.(x.target.value);},onClean:()=>{c(-1),f(s),t?.(null,e);},onClick:()=>{p||(h.current.style.display="flex");},error:o,helperText:n,label:i,placeholder:r,fixedTopLabel:e.length>0,size:l})}),Xt=pn;var Yt=({options:e,defaultSelectedOptions:t,onSelect:o,error:n,helperText:i,label:r,placeholder:s,noResultsLabel:a,noResultsIcon:l,noResultsDescription:p,noResultsDescriptionLines:c,noResultsAsColumn:f,noResultsButtonOnClick:h,noResultsButtonLabel:d,className:x,onInputChange:L,value:R,loading:g,size:M="md",optionDescriptionLines:I=1,disabled:P})=>{let{inputRef:b,optionsListRef:N,setFilteredOptions:E,setShowChips:y,setInputRect:w,setPopoverPosition:S,setCurrentFocus:q,showChips:D,setOptionsListRect:C,optionsListRect:m,setOptionsListHeight:T}=Z(),H=useRef(false),[V,Q]=useState(t??[]),B=useCallback(U=>{Q(X=>{let oe,he=X.findIndex(Eo=>Eo.value===U.value);return he===-1?(oe=X.concat(U),o?.(U,oe),oe):(oe=X.toSpliced(he,1),o?.(U,oe),oe)});},[o]),te=useCallback(()=>{Q([]),E(e),o?.(null,[]);},[]),O=useCallback(()=>{y(false);},[]),j=useCallback(()=>{y(true);},[]),G=useCallback(()=>{if(!b?.current)return;let U=b.current.getBoundingClientRect();w(U);let X=m?m.height>J?J:m.height:J,oe=window.innerHeight-U.bottom>X,he=U.top>X;S(oe?"bottom":he?"top":"bottom"),T(he?J:window.innerHeight-U.bottom>J?J:window.innerHeight-U.bottom);},[m?.height]),Pe=useCallback(()=>{let U=e.filter(X=>X.label.toLowerCase().includes(b?.current?.value.toLowerCase()??""));if(E(U),N?.current){let X=N.current.getBoundingClientRect();C(X);}},[e,N?.current]);return useEffect(()=>{E(e);},[e]),a$a(N,()=>{N.current.style.display="none",q(-1);}),useEffect(()=>{if(b?.current)return G(),b.current.addEventListener("mousedown",G),b.current.addEventListener("input",Pe),b.current.addEventListener("focusin",O),b.current.addEventListener("focusout",j),window.addEventListener("scroll",G,true),window.addEventListener("resize",G),()=>{b.current?.removeEventListener("mousedown",G),b.current?.removeEventListener("input",G),b.current?.removeEventListener("focusout",j),b.current?.removeEventListener("focusin",O),window.removeEventListener("scroll",G,true),window.removeEventListener("resize",G);}},[G,j,O,Pe]),useEffect(()=>{R&&(Q(R),y(true));},[R]),useEffect(()=>{g||t&&t.length&&!H.current&&(Q(t),H.current=true,y(true));},[t,g]),jsxs("div",{className:a$2("relative",x),children:[jsx(Xt,{selectedOptions:V,onSelect:o,error:n,helperText:i,label:r,placeholder:s,handleSelect:B,options:e,onInputChange:L,size:M,disabled:P}),D&&jsx(Kt,{selectedOptions:V,disabled:P,error:n,onCleanSelectedOptions:te,size:M}),jsx(jt,{handleSelect:B,selectedOptions:V,noResultsLabel:a,NoResultsIcon:l,optionDescriptionLines:I,noResultsAsColumn:f,noResultsButtonLabel:d,noResultsButtonOnClick:h,noResultsDescription:p,noResultsDescriptionLines:c})]})};var Rl=e=>jsx(qt,{children:jsx(Yt,{...e})});var kl=({children:e,title:t,titleLines:o=1,description:n,descriptionLines:i=1,StartIcon:r,hasDivider:s=false,disabled:a=false,actionButton:l,isSelected:p=false,className:c$1,...f})=>jsxs(Y,{hasDescription:!!n,disabled:a,hasDivider:s,isSelected:p,...f,className:c$1,children:[r&&jsx(r,{className:"mr-2 h-4.5 w-4.5 shrink-0 grow-0"}),jsx(re,{title:t,titleLines:o,description:n,descriptionLines:i,disabled:a}),l&&jsx(Fragment,{children:l.isIcon?jsx(c$2,{...l,className:"ml-4 self-center",variant:"ghost",size:"sm",disabled:a??l.disabled}):jsx(c,{...l,className:"ml-4 self-center",size:"sm",variant:"ghost",disabled:a??l.disabled})})]});var $l=({title:e,description:t="",descriptionLines:o,hasDivider:n=false,disabled:i=false,checked:r,onCheckedChange:s,className:a,chipStatus:l,chipExpandable:p,...c})=>jsxs(Y,{hasDescription:!!t,disabled:i,hasDivider:n,...c,className:a$2("pr-6",a),children:[jsx(b,{checked:r,onCheckedChange:s,className:"mr-4 self-center",disabled:i}),jsxs("div",{className:"flex-1",children:[jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsx("p",{className:a$2("line-clamp-1 text-sm leading-[130%] break-all",!!t&&"font-medium"),children:e}),p&&jsx("div",{className:"ml-auto flex min-w-0 flex-shrink-0 items-center justify-end",children:jsx(c$5,{...p})}),l&&jsx("div",{className:"ml-4 flex shrink-0 items-center gap-1",children:jsx(d$2,{...l,size:"xs",className:"shrink-0"})})]}),t&&jsx("p",{className:a$2("text-xs leading-[130%]",i?"text-neutral-400":"text-neutral-700",{"line-clamp-1":o===1,"line-clamp-2":o===2,"line-clamp-3":o===3,"line-clamp-4":o===4}),children:t})]})]});var Je={paragraph:"m-0",ltr:"text-left",rtl:"text-right",heading:{h1:"mb-2 text-2xl leading-[130%] font-semibold text-neutral-900",h2:"mb-2 text-xl leading-[130%] font-semibold text-neutral-900",h3:"mb-2 text-lg leading-[130%] font-semibold text-neutral-900",h4:"mb-2 text-base leading-[130%] font-semibold text-neutral-900",h5:"mb-2 text-sm leading-[130%] font-semibold text-neutral-900",h6:"mb-2 text-xs leading-[130%] font-semibold text-neutral-900"},list:{ul:"my-2 list-disc pl-5",ol:"my-2 list-decimal pl-5",listitem:"my-1",nested:{listitem:"my-1"}},text:{bold:"font-semibold",italic:"italic",underline:"underline",strikethrough:"line-through",code:"rounded bg-neutral-100 px-1 py-0.5 font-mono text-xs"},code:"rounded bg-neutral-100 p-2 font-mono text-xs",quote:"border-l-2 border-neutral-300 pl-3 italic text-neutral-700",link:"text-primary-700 underline hover:text-primary-800"},et={headings:["h1","h2","h3"],textFormat:["bold","italic","underline"],lists:true,indent:true,alignment:["left","center","right","justify"],undoRedo:true};var tt=({readOnly:e})=>{let[t]=useLexicalComposerContext();return useEffect(()=>{t.setEditable(!e);},[t,e]),null};var ot=({editorRef:e})=>{let[t]=useLexicalComposerContext();return useEffect(()=>(e.current=t,()=>{e.current===t&&(e.current=null);}),[t,e]),null};var Ln={"ql-align-left":"left","ql-align-center":"center","ql-align-right":"right","ql-align-justify":"justify"},yn={center:"ql-align-center",right:"ql-align-right",justify:"ql-align-justify"},Rn=()=>typeof window<"u"&&typeof window.DOMParser<"u",Jt=e=>Rn()?new DOMParser().parseFromString(e,"text/html"):null,In=e=>(e??"").replace(/\s+/g," ").trim(),rt=e=>{let t=0;for(let o of Array.from(e.classList)){let n=o.match(/^ql-indent-(\d+)$/);if(!n)continue;let i=Number.parseInt(n[1],10);Number.isFinite(i)&&(t=Math.max(t,i)),e.classList.remove(o);}return t},Tn=e=>{let t=e.querySelectorAll("[class*='ql-align-']");for(let o of Array.from(t))for(let n of Array.from(o.classList)){let i=Ln[n];i&&(i!=="left"&&(o.style.textAlign=i),o.classList.remove(n));}},Nn=e=>{let t=e.querySelectorAll("[class*='ql-indent-']");for(let o of Array.from(t)){if(o.tagName==="LI")continue;let n=rt(o);n>0&&(o.style.paddingInlineStart=`${n*3}em`);}},Pn=(e,t)=>{let o=e.getAttribute("data-list");return o==="bullet"?"ul":o==="ordered"?"ol":t},Mn=e=>{let t=e.cloneNode(true);return t.removeAttribute("data-list"),t.removeAttribute("data-checked"),t.removeAttribute("data-indent"),rt(t),t},nt=(e,t)=>e.createElement(t),En=(e,t)=>{let o=Array.from(e.children).filter(l=>l.tagName==="LI");if(o.length===0||!o.some(l=>l.hasAttribute("data-list")?true:Array.from(l.classList).some(p=>/^ql-indent-\d+$/.test(p))))return;let i=[],r=[],s=e.tagName==="UL"?"ul":"ol";for(let l of o){let p=rt(l),c=Pn(l,s),f=Mn(l);for(;r.length>0&&r[r.length-1].level>p;)r.pop();if(r.length===0){let d=nt(t,c);i.push(d),r.push({level:0,kind:c,listElement:d});}let h=r[r.length-1];for(;h.level<p;){let d=h.listElement.lastElementChild;if(!d||d.tagName!=="LI")break;let x=nt(t,c);d.appendChild(x),h={level:h.level+1,kind:c,listElement:x},r.push(h);}if(h=r[r.length-1],h.kind!==c){let d=nt(t,c);if(r.length===1)i.push(d),r[0]={level:0,kind:c,listElement:d};else {let L=r[r.length-2].listElement.lastElementChild;L&&L.tagName==="LI"?(L.appendChild(d),r[r.length-1]={level:h.level,kind:c,listElement:d}):(i.push(d),r.length=1,r[0]={level:0,kind:c,listElement:d});}h=r[r.length-1];}h.listElement.appendChild(f);}if(i.length===0)return;let a=t.createDocumentFragment();for(let l of i)a.appendChild(l);e.replaceWith(a);},An=(e,t)=>{let o=Array.from(e.querySelectorAll("ol, ul"));for(let n of o)En(n,t);},eo=(e,t)=>{let o=e.tagName==="UL"?"bullet":"ordered",n=Array.from(e.children).filter(i=>i.tagName==="LI");for(let i of n){i.setAttribute("data-list",o);for(let s of Array.from(i.classList))/^ql-indent-\d+$/.test(s)&&i.classList.remove(s);t>0&&i.classList.add(`ql-indent-${t}`);let r=Array.from(i.children).filter(s=>s.tagName==="UL"||s.tagName==="OL");for(let s of r)eo(s,t+1);}},On=e=>{let t=e.querySelectorAll("p, h1, h2, h3, h4, h5, h6, li");for(let o of Array.from(t)){let n=o;for(let s of Array.from(n.classList))s.startsWith("ql-align-")&&n.classList.remove(s);let i=n.style.textAlign.trim().toLowerCase(),r=yn[i];r&&n.classList.add(r);}},ue=e=>In(e).replace(/>\s+</g,"><").replace(/&nbsp;/g," "),it=e=>{let t=e??"";if(!t.trim())return "";let o=Jt(t);if(!o)return t;let{body:n}=o;return Tn(n),Nn(n),An(n,o),n.innerHTML},st=e=>{if(!e.trim())return "";let t=Jt(e);if(!t)return e;let{body:o}=t,n=Array.from(o.querySelectorAll("ul, ol"));for(let i of n)eo(i,0);return On(o),o.innerHTML};var De=e=>{let t="";return e.getEditorState().read(()=>{t=$generateHtmlFromNodes(e,null);}),st(t)},zn=(e,t)=>{let o=it(t);e.update(()=>{let n=$getRoot();if(n.clear(),!o.trim()){n.append($createParagraphNode());return}let r=new DOMParser().parseFromString(o,"text/html"),s=$generateNodesFromDOM(e,r);if(s.length===0){n.append($createParagraphNode());return}n.select(),$insertNodes(s);});},lt=({value:e,isSyncingRef:t})=>{let[o]=useLexicalComposerContext(),n=useRef(null);return useEffect(()=>{let i=e??"";if(n.current!==null&&ue(i)===ue(n.current))return;let r=De(o);ue(r)!==ue(i)&&(t.current=true,zn(o,i),queueMicrotask(()=>{t.current=false;})),n.current=i;},[o,t,e]),null};var oo=["left","center","right","justify"];var no=["bold","italic","underline","strikethrough","code"];var Lr={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikethrough",code:"code"},yr={left:jsx(AlignLeftIcon,{className:"size-4"}),center:jsx(AlignCenterIcon,{className:"size-4"}),right:jsx(AlignRightIcon,{className:"size-4"}),justify:jsx(AlignJustifyIcon,{className:"size-4"})},Rr={left:"Align left",center:"Align center",right:"Align right",justify:"Align justify"},ye={bold:jsx(BoldIcon,{className:"size-4"}),italic:jsx(ItalicIcon,{className:"size-4"}),underline:jsx(UnderlineIcon,{className:"size-4"}),strikethrough:jsx("span",{className:"text-xs font-semibold",children:"S"}),code:jsx("span",{className:"font-mono text-xs",children:"</>"})},Re={bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",code:"Inline code"},Ir=e=>{let t=e.textFormat;return t===false?[]:Array.isArray(t)?no.filter(o=>t.includes(o)):["bold","italic","underline"]},Tr=e=>{let t=e.alignment;return t===false?[]:Array.isArray(t)?oo.filter(o=>t.includes(o)):["left","center","right","justify"]},Nr=e=>{if(e.headings===false)return [];let t=Array.isArray(e.headings)?e.headings:["h1","h2","h3"];return [{value:"paragraph",label:"Normal"},...t.map(o=>({value:o,label:o.toUpperCase()}))]},Ie=()=>jsx("div",{className:"mx-1 h-5 w-px bg-neutral-300"}),$=({label:e,onClick:t,icon:o,active:n=false,disabled:i=false})=>jsx("button",{type:"button","aria-label":e,title:e,disabled:i,onClick:t,className:a$2("inline-flex size-8 items-center justify-center rounded-md border border-transparent text-neutral-700 transition-colors","focus-visible:ring-primary-800 hover:bg-neutral-200 focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:outline-none","disabled:cursor-not-allowed disabled:opacity-40",n&&"border-neutral-300 bg-neutral-200 text-neutral-900"),children:o}),pt=({config:e,className:t})=>{let[o]=useLexicalComposerContext(),n=useId(),[i,r]=useState(false),[s,a]=useState(false),[l,p]=useState(false),[c,f]=useState(false),[h,d]=useState(false),[x,L]=useState(false),[R,g]=useState(false),[M,I]=useState("paragraph"),[P,b]=useState("left"),N=useMemo(()=>Ir(e),[e]),E=useMemo(()=>Tr(e),[e]),y=useMemo(()=>Nr(e),[e]),w=useCallback(()=>{let C=$getSelection();if(!$isRangeSelection(C))return;p(C.hasFormat("bold")),f(C.hasFormat("italic")),d(C.hasFormat("underline")),L(C.hasFormat("strikethrough")),g(C.hasFormat("code"));let m=C.anchor.getNode(),T=m.getKey()==="root"?m:m.getTopLevelElementOrThrow();if($isListNode(T))I(T.getListType()==="number"?"ol":"ul");else {let V=$findMatchingParent(T,Q=>$isListNode(Q));$isListNode(V)?I(V.getListType()==="number"?"ol":"ul"):I($isHeadingNode(T)?T.getTag():T.getType());}let H=$isElementNode(T)?T.getFormatType():"";b(H==="center"||H==="right"||H==="justify"?H:"left");},[]);useEffect(()=>mergeRegister(o.registerUpdateListener(({editorState:C})=>{C.read(()=>{w();});}),o.registerCommand(SELECTION_CHANGE_COMMAND,()=>(w(),false),1),o.registerCommand(CAN_UNDO_COMMAND,C=>(r(C),false),1),o.registerCommand(CAN_REDO_COMMAND,C=>(a(C),false),1)),[o,w]);let S=C=>{o.dispatchCommand(FORMAT_TEXT_COMMAND,Lr[C]);},q=C=>{o.update(()=>{let m=$getSelection();if($isRangeSelection(m)){if(C==="paragraph"){$setBlocksType(m,()=>$createParagraphNode());return}$setBlocksType(m,()=>$createHeadingNode(C));}});},D=C=>{if(M===(C==="bullet"?"ul":"ol")){o.dispatchCommand(REMOVE_LIST_COMMAND,void 0);return}o.dispatchCommand(C==="bullet"?INSERT_UNORDERED_LIST_COMMAND:INSERT_ORDERED_LIST_COMMAND,void 0);};return jsxs("div",{className:a$2("flex flex-wrap items-center gap-1 border-b border-neutral-300 bg-neutral-100 px-2 py-1.5",t),children:[e.undoRedo!==false&&jsxs(Fragment,{children:[jsx($,{label:"Undo",onClick:()=>o.dispatchCommand(UNDO_COMMAND,void 0),disabled:!i,icon:jsx(UndoIcon,{className:"size-4"})}),jsx($,{label:"Redo",onClick:()=>o.dispatchCommand(REDO_COMMAND,void 0),disabled:!s,icon:jsx(RedoIcon,{className:"size-4"})}),jsx(Ie,{})]}),y.length>0&&jsxs(Fragment,{children:[jsx("label",{className:"sr-only",htmlFor:n,children:"Text style"}),jsx("select",{id:n,value:M.startsWith("h")?M:"paragraph",onChange:C=>q(C.target.value),className:a$2("h-8 rounded-md border border-neutral-300 bg-white px-2 text-xs font-medium text-neutral-800","focus-visible:ring-primary-800 focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:outline-none"),children:y.map(C=>jsx("option",{value:C.value,children:C.label},C.value))}),jsx(Ie,{})]}),N.length>0&&jsxs(Fragment,{children:[N.includes("bold")&&jsx($,{label:Re.bold,onClick:()=>S("bold"),icon:ye.bold,active:l}),N.includes("italic")&&jsx($,{label:Re.italic,onClick:()=>S("italic"),icon:ye.italic,active:c}),N.includes("underline")&&jsx($,{label:Re.underline,onClick:()=>S("underline"),icon:ye.underline,active:h}),N.includes("strikethrough")&&jsx($,{label:Re.strikethrough,onClick:()=>S("strikethrough"),icon:ye.strikethrough,active:x}),N.includes("code")&&jsx($,{label:Re.code,onClick:()=>S("code"),icon:ye.code,active:R}),jsx(Ie,{})]}),e.lists!==false&&jsxs(Fragment,{children:[jsx($,{label:"Bulleted list",onClick:()=>D("bullet"),icon:jsx(ListIcon,{className:"size-4"}),active:M==="ul"}),jsx($,{label:"Numbered list",onClick:()=>D("number"),icon:jsx(ListOrderedIcon,{className:"size-4"}),active:M==="ol"}),jsx(Ie,{})]}),e.indent!==false&&jsxs(Fragment,{children:[jsx($,{label:"Decrease indent",onClick:()=>o.dispatchCommand(OUTDENT_CONTENT_COMMAND,void 0),icon:jsx(IndentDecreaseIcon,{className:"size-4"})}),jsx($,{label:"Increase indent",onClick:()=>o.dispatchCommand(INDENT_CONTENT_COMMAND,void 0),icon:jsx(IndentIncreaseIcon,{className:"size-4"})}),jsx(Ie,{})]}),E.length>0&&jsx(Fragment,{children:E.map(C=>jsx($,{label:Rr[C],onClick:()=>o.dispatchCommand(FORMAT_ELEMENT_COMMAND,C),icon:yr[C],active:P===C},C))})]})};var lo=e=>{if(e!==void 0)return typeof e=="number"?`${e}px`:e},Vr=forwardRef(({value:e,onChange:t,onBlur:o,onError:n,placeholder:i="Write your content...",readOnly:r=false,showToolbar:s=true,toolbarConfig:a=et,className:l,editorClassName:p,toolbarClassName:c,autoFocus:f=false,minHeight:h=160,maxHeight:d,error:x=false,errorMessage:L,editorRef:R},g)=>{let M=useRef(false),I=useMemo(()=>({namespace:"SodtrackRichTextEditor",theme:Je,onError:(b,N)=>{if(n){n(b,N);return}console.error("RichTextEditor error",b);},nodes:[HeadingNode,ListNode,ListItemNode]}),[n]),P={minHeight:lo(h),maxHeight:lo(d),overflowY:d?"auto":void 0};return jsx(LexicalComposer,{initialConfig:I,children:jsxs("div",{className:"w-full",children:[jsxs("div",{ref:g,className:a$2("group flex w-full flex-col overflow-hidden rounded-lg border bg-white transition-colors","focus-within:ring-primary-800 focus-within:ring-2 focus-within:ring-offset-0",x?"border-error-500 focus-within:border-error-500 focus-within:ring-error-500":"border-neutral-500",r&&"border-neutral-300 bg-neutral-50 focus-within:ring-0",l),"data-error":x,"data-readonly":r,children:[s&&!r&&jsx(pt,{config:a,className:c}),jsx(RichTextPlugin,{contentEditable:jsx(ContentEditable,{className:a$2("relative w-full px-4 py-3 text-sm leading-[142%] text-neutral-900 outline-none","[&_h1]:mt-2 [&_h1]:mb-2 [&_h2]:mt-2 [&_h2]:mb-2 [&_h3]:mt-2 [&_h3]:mb-2","[&_li]:my-1 [&_ol]:my-2 [&_ul]:my-2","[&_a]:text-primary-700 [&_a]:underline",r&&"cursor-default",p),style:P,onBlur:o,"aria-invalid":x}),placeholder:r?null:jsx("div",{className:"pointer-events-none absolute top-3 left-4 text-sm text-neutral-500",children:i}),ErrorBoundary:LexicalErrorBoundary}),jsx(HistoryPlugin,{}),jsx(ListPlugin,{}),jsx(tt,{readOnly:r}),jsx(lt,{value:e,isSyncingRef:M}),f&&!r&&jsx(AutoFocusPlugin,{}),R&&jsx(ot,{editorRef:R}),jsx(OnChangePlugin,{ignoreSelectionChange:true,onChange:(b,N)=>{!t||M.current||t(De(N),b);}})]}),x&&L&&jsx("p",{className:"text-error-500 mt-1 text-xs leading-[133%]",children:L})]})})});Vr.displayName="RichTextEditor";var Be="data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:duration-150 data-[state=closed]:duration-100 data-[state=open]:ease-out data-[state=closed]:ease-in data-[state=open]:data-[side=bottom]:slide-in-from-top-1 data-[state=closed]:data-[side=bottom]:slide-out-to-top-1 data-[state=open]:data-[side=top]:slide-in-from-bottom-1 data-[state=closed]:data-[side=top]:slide-out-to-bottom-1 data-[state=open]:data-[side=left]:slide-in-from-right-1 data-[state=closed]:data-[side=left]:slide-out-to-right-1 data-[state=open]:data-[side=right]:slide-in-from-left-1 data-[state=closed]:data-[side=right]:slide-out-to-left-1 motion-reduce:data-[state=open]:animate-none motion-reduce:data-[state=closed]:animate-none";var Za=["sm","md","lg"],Ja=a$9,jr={lg:"h-10 gap-2 px-4 text-sm leading-[142%] rounded-md",md:"h-8 gap-1 px-3 text-sm leading-[142%] rounded-md",sm:"h-6 gap-1 px-3 text-xs leading-[142%] rounded-sm"},Xr={lg:"size-4.5",md:"size-3.5",sm:"size-3"},po=({label:e,options:t,onSelect:o,variant:n="contained",size:i="md",disabled:r=false,className:s,...a})=>{let l=useCallback(c=>{o?.(c.value);},[o]),{root:p}=c$3({variant:n,disabled:r});return jsxs(MenuRoot,{unmountOnExit:true,lazyMount:true,onSelect:l,positioning:{placement:"bottom-start",flip:["bottom-end"]},...a,children:[jsxs(MenuTrigger,{disabled:r,className:a$2(p(),"group data-[state=open]:ring-primary-800 ease-linear outline-none data-[state=open]:ring-3 data-[state=open]:ring-inset",jr[i],s),children:[e,jsx(g,{className:a$2(Xr[i],"transition-transform duration-150 group-data-[state=open]:rotate-180")})]}),jsx(Portal,{children:jsx(MenuPositioner,{className:"z-(--z-button-active-options)",children:jsx(MenuContent,{className:a$2("elevation-9 max-h-67.5 max-w-[calc(100vw-1rem)] min-w-max overflow-y-auto rounded-lg bg-neutral-50 py-1 outline-none",Be),children:t.map(({label:c,value:f,description:h,startIcon:d,endIcon:x,hasDivider:L,disabled:R,onClick:g})=>jsx(MenuItem,{value:f,disabled:R,onSelect:g,asChild:true,children:jsx(ce,{title:c,description:h,startIcon:d,endIcon:x,disabled:R,hasDivider:L,className:"data-highlighted:bg-primary-100 outline-none [&_p]:break-normal"})},f))})})})]})};var uo=createContext(null),ti=()=>{let e=useContext(uo);if(!e)throw new Error("TrackerItem components must be used within TrackerItem");return e},oi=({state:e,children:t})=>jsxs("div",{className:"relative",children:[jsx("div",{className:a$2("absolute top-1/2 z-10 h-[70%] w-0.5 -translate-y-1/2 rounded-sm",e==="active"&&"bg-primary-400",e==="success"&&"bg-success-500",e==="wait"&&"bg-neutral-400")}),t]}),ni=forwardRef(({label:e,badgeStatus:t$1,details:o,className:n,...i},r)=>{let{state:s$1,stepNumber:a,expandable:l,onHeaderButtonClick:p}=ti();return jsxs("div",{ref:r,className:a$2("flex min-h-10 items-center gap-3 py-2 pr-1 pl-3",n),...i,children:[jsxs("div",{className:a$2("flex flex-1 gap-2",!t$1&&(!o||o.length===0)&&"self-center"),children:[jsx(a$5,{state:s$1,stepNumber:a}),jsxs("div",{className:"mt-0.5 flex min-w-0 flex-1 flex-col gap-1",children:[jsx("span",{className:a$2("font-jakarta text-xs leading-snug font-medium",s$1==="wait"?"text-neutral-500":"text-neutral-900"),children:e}),t$1&&t$1.visible!==false&&(()=>{let{visible:c,...f}=t$1;return jsx(a$6,{...f})})(),o&&jsx("div",{className:"text-2xs flex flex-col gap-1.5 text-neutral-700",children:o.map(({Icon:c,text:f},h)=>jsxs("div",{className:"flex items-center gap-1.5",children:[jsx(c,{className:"size-3 shrink-0"}),jsx("span",{className:"font-inter",children:f})]},h))})]})]}),l&&jsx(Collapsible.Context,{children:({open:c})=>jsx(Collapsible.Trigger,{asChild:true,children:jsx(c$2,{Icon:c?s:t,size:"sm",variant:"standard"})})}),!l&&p&&jsx(c$2,{Icon:h,size:"sm",variant:"standard",onClick:p})]})});ni.displayName="TrackerItemHeader";var ri=forwardRef(({children:e,className:t,...o},n)=>jsx(Collapsible.Content,{className:"data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up overflow-hidden",children:jsx("div",{ref:n,className:a$2("border-t border-neutral-300 px-3 py-2",t),...o,children:e})}));ri.displayName="TrackerItemExpandableContent";var ii=forwardRef(({buttons:e=[],className:t,...o},n)=>jsx("div",{ref:n,className:a$2("flex justify-end gap-2 border-t border-neutral-300 px-3 py-2",t),...o,children:e.map((i,r)=>{if(i.visible===false)return null;let{visible:s,...a}=i;return "options"in a?jsx(po,{...a,size:"sm"},r):jsx(c,{...a,size:"sm"},r)})}));ii.displayName="TrackerItemFooter";var mo="overflow-hidden rounded-sm border border-neutral-300 bg-neutral-50",si=forwardRef(({state:e,stepNumber:t,expandable:o=false,defaultExpanded:n,onExpandedChange:i,onHeaderButtonClick:r,className:s,children:a,...l},p)=>{let c=useMemo(()=>({state:e,stepNumber:t,expandable:o,onHeaderButtonClick:r}),[e,t,o,r]),f=useCallback(h=>{i?.(h.open);},[i]);return jsx(uo.Provider,{value:c,children:jsx(oi,{state:e,children:o?jsx(Collapsible.Root,{ref:p,defaultOpen:n??false,onOpenChange:f,className:a$2(mo,s),...l,children:a}):jsx("div",{ref:p,className:a$2(mo,s),...l,children:a})})})});si.displayName="TrackerItem";var Oc=["sm","md","lg"],kc=["semibold","medium"],wc=["primary","neutral"],bi=tv({slots:{root:"group relative inline-flex cursor-pointer items-center justify-center overflow-clip border border-solid bg-transparent transition-colors outline-none",label:"font-inter relative overflow-hidden text-center leading-[0] text-ellipsis whitespace-nowrap",icon:"mr-1.5 shrink-0",chevron:"ml-1.5 shrink-0 transition-transform duration-150 group-data-[state=open]:rotate-180",trailing:"ml-2 flex shrink-0 items-center justify-center"},variants:{size:{lg:{root:"h-10 min-h-10 rounded-md px-2 py-2",label:"text-sm leading-[142%]",icon:"size-4",chevron:"size-4"},md:{root:"h-8 min-h-8 rounded-md px-2 py-1",label:"text-sm leading-[142%]",icon:"size-4",chevron:"size-4"},sm:{root:"h-6 max-h-6 rounded-sm px-2 py-1",label:"text-xs leading-[134%]",icon:"size-3",chevron:"size-3"}},weight:{semibold:{label:"font-semibold"},medium:{label:"font-medium"}},tone:{primary:{root:"border-primary-600 text-primary-600 hover:bg-primary-100 focus-visible:ring-primary-800 aria-[pressed=true]:border-primary-700 aria-[pressed=true]:bg-primary-200 aria-[pressed=true]:text-primary-700 data-[state=open]:border-primary-700 data-[state=open]:bg-primary-200 data-[state=open]:text-primary-700 focus-visible:ring-3 focus-visible:ring-inset disabled:cursor-not-allowed disabled:border-neutral-600 disabled:bg-transparent disabled:text-neutral-600"},neutral:{root:"hover:bg-primary-100 aria-[pressed=true]:border-primary-700 aria-[pressed=true]:bg-primary-200 data-[state=open]:border-primary-700 data-[state=open]:bg-primary-200 border-neutral-800 text-neutral-800 focus-visible:ring-3 focus-visible:ring-neutral-800 focus-visible:ring-inset disabled:cursor-not-allowed disabled:border-neutral-500 disabled:bg-transparent disabled:text-neutral-500"}},loading:{true:{root:"!cursor-wait !border-neutral-600 !text-neutral-600"},false:{}}},defaultVariants:{size:"lg",weight:"semibold",tone:"primary",loading:false}}),Hc=({className:e,label:t,badgeText:o="00",StartIcon:n,options:i,onSelect:r,isSelected:s=false,isLoading:a=false,isDisabled:l=false,hasTrailingBadge:p=false,size:c="lg",weight:f="semibold",tone:h="primary",type:d="button",...x})=>{let L=l||a,R=i.filter(({isHidden:T})=>!T),g$1=R.length>0,M=a,I=!!n&&!a,P=!a&&p,b=g$1&&!L,N=useCallback(T=>{r?.(T.value);},[r]),E=useCallback(T=>{T?.();},[]),{root:y,label:w,icon:S,chevron:q,trailing:D}=bi({size:c,weight:f,tone:h,loading:M}),C=c,m=jsxs(Fragment,{children:[M&&jsx(c$6,{size:"sm",variant:"black",className:S()}),I&&n&&jsx(n,{className:S()}),jsx("span",{className:w(),children:t}),P&&jsx(a$b,{type:"square",variant:"primary",size:C,text:o,className:D()}),b&&jsx(g,{className:q()})]});return g$1?jsxs(MenuRoot,{onSelect:N,lazyMount:true,positioning:{placement:"bottom-start",flip:["bottom-end"]},children:[jsx(MenuTrigger,{...x,type:d,disabled:L,"aria-pressed":s,className:y({className:e}),children:m}),jsx(Portal,{children:jsx(MenuPositioner,{className:"z-(--z-button-active-options)",children:jsx(MenuContent,{className:cn("elevation-9 max-h-67.5 max-w-[calc(100vw-1rem)] min-w-max overflow-y-auto rounded-lg bg-neutral-50 py-1 outline-none",Be),children:R.map(({label:T,description:H,startIcon:V,endIcon:Q,hasDivider:B,isDisabled:te,onClick:O})=>jsx(MenuItem,{value:T,disabled:te,onSelect:()=>E(O),asChild:true,className:"flex items-center",children:jsx(ce,{title:T,description:H,startIcon:V,endIcon:Q,disabled:te,hasDivider:B,className:"data-highlighted:bg-primary-100 outline-none [&_p]:break-normal"})},T))})})})]}):jsx("button",{...x,type:d,disabled:L,"aria-pressed":s,className:y({className:e}),children:m})};var ho={en:Li,es:yi,pt:Ri},Ii={es:{clearPhoneNumberLabel:"Borrar n\xFAmero de tel\xE9fono",noCountryFound:"No se encontr\xF3 ning\xFAn pa\xEDs.",searchCountryPlaceholder:"Buscar pa\xEDs"},pt:{clearPhoneNumberLabel:"Limpar n\xFAmero de telefone",noCountryFound:"Nenhum pa\xEDs encontrado.",searchCountryPlaceholder:"Pesquisar pa\xEDs"}},Ti={clearPhoneNumberLabel:"Clear phone number",noCountryFound:"No country found.",searchCountryPlaceholder:"Search country"},Ni=ho.en,go="9 1234 5678",mt="ZZ",xo=()=>{},Ve=e=>Ii[e]??Ti,Co=e=>ho[e]??Ni,vo=e=>{if(e)try{return parsePhoneNumber(e)?.country}catch{return}},Lo=e=>{if(e)return getExampleNumber(e,Ci)?.formatNational()},Ue=e=>e??mt,$e=()=>getDefaultOptions().locale?.code;var Oi=({Icon:e,callingCode:t,country:o,countryName:n,callingCodeClassName:i})=>jsxs("div",{className:"flex justify-center gap-2",children:[jsx("span",{className:"flex size-4.5 shrink-0 items-center justify-center",children:jsx(e,{"aria-hidden":true,country:o,label:n})}),t&&jsx("span",{className:a$2("text-sm leading-[143%] font-medium text-neutral-800",i),children:`+${t}`})]}),yo=({className:e,disabled:t,error:o,iconComponent:n,onChange:i,onOpenChange:r,options:s,readOnly:a,translations:l,value:p$1})=>{let c=F.useRef(null),[f,h]=F.useState(""),[d$1,x]=F.useState(false),{wrapper:L,input:R,clearIcon:g,searchIcon:M}=b$1({size:"md"}),{contains:I}=useFilter({sensitivity:"base"}),P=F.useMemo(()=>s.map(m=>({callingCode:m.value?getCountryCallingCode(m.value):void 0,country:m.value,key:Ue(m.value),label:m.label})),[s]),b=F.useMemo(()=>P.find(m=>m.key===Ue(p$1)),[P,p$1]),{collection:N,filter:E,set:y}=useListCollection({initialItems:P,itemToString:m=>m.callingCode?`${m.label} +${m.callingCode}`:m.label,itemToValue:m=>m.key,filter:(m,T,H)=>{let V=T.trim().replace(/^\+/,"");return I(m,T)||(H.country?I(H.country,T.toUpperCase()):false)||(H.callingCode?I(H.callingCode,V)||I(`+${H.callingCode}`,T):false)}});F.useEffect(()=>{y(P);},[P,y]);let w=F.useCallback(m=>{x(m),r?.(m);},[r]),S=F.useCallback(({inputValue:m})=>{let T=m??"";h(T),E(T),c.current?.scrollTo({top:0});},[E]),q=F.useCallback(m=>{w(m),m&&(h(""),E(""));},[E,w]),D=F.useCallback(({itemValue:m})=>{i(m===mt?void 0:m),w(false);},[w,i]),C=useCombobox({collection:N,inputBehavior:"autohighlight",inputValue:f,open:d$1,openOnChange:false,openOnClick:false,selectionBehavior:"preserve",value:b?[b.key]:[],onInputValueChange:S,onOpenChange:({open:m})=>{m||w(false);},onSelect:D});return jsx(Combobox.RootProvider,{value:C,children:jsxs(a$8,{open:d$1,positioning:{placement:"bottom"},onOpenChange:q,children:[jsx(b$2,{asChild:true,children:jsx("button",{type:"button",className:a$2("relative flex h-full w-19.5 shrink-0 items-center justify-center rounded-l after:pointer-events-none after:absolute after:top-0 after:right-0 after:h-full after:w-px after:content-['']",o?"bg-danger-20 after:bg-danger-500 after:w-0.5":t||a?"bg-neutral-200 after:bg-neutral-300":"group-focus-within/phone:after:bg-primary-800 bg-neutral-200 after:bg-neutral-600 group-focus-within/phone:after:w-0.5",!o&&d$1&&"after:bg-primary-800 after:w-0.5",e),disabled:t||a,children:b&&jsx(Oi,{Icon:n,callingCode:b.callingCode,country:b.country,countryName:b.label,callingCodeClassName:a$2(o?"text-danger-600":void 0,t&&"text-neutral-600",a&&"text-neutral-600")})})}),jsx(c$4,{portalled:false,className:"w-75 p-0",children:jsxs(Combobox.Content,{children:[jsx(Combobox.Control,{className:"p-1 pb-0",children:jsxs("div",{className:L(),children:[jsx(Combobox.Input,{autoComplete:"off","data-1p-ignore":true,"data-lpignore":"true",placeholder:l.searchCountryPlaceholder,className:R()}),!t&&f.length>0&&jsx("button",{type:"button",className:g(),onClick:()=>{C.setInputValue("","clear-trigger");},children:jsx(d,{className:"size-4.5"})}),jsx(p,{className:M()})]})}),jsx(Combobox.List,{ref:c,className:"h-72 overflow-auto p-1 outline-none",children:N.items.length===0?jsx("div",{className:"py-6 text-center text-sm text-neutral-700",children:l.noCountryFound}):jsx(Combobox.ItemGroup,{children:N.items.map(m=>jsxs(Combobox.Item,{item:m,className:"data-highlighted:bg-primary-100 relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-neutral-900 outline-none select-none data-disabled:pointer-events-none data-disabled:opacity-50",children:[jsx("span",{className:"flex size-4.5 shrink-0 items-center justify-center",children:jsx(n,{"aria-hidden":true,country:m.country,label:m.label})}),jsx(Combobox.ItemText,{className:"min-w-0 flex-1 truncate text-sm leading-[143%] font-medium",children:m.label}),m.callingCode&&jsx("span",{className:"shrink-0 text-sm text-neutral-600",children:`+${m.callingCode}`}),jsx(j,{className:a$2("ml-auto size-4 shrink-0",m.key===Ue(p$1)?"opacity-100":"opacity-0")})]},m.key))})})]})})]})})};var Io=({className:e,country:t,countryName:o})=>{let n=ki[t];return jsx("span",{className:a$2("flex size-4.5 shrink-0 items-center justify-center overflow-hidden rounded-full border border-white [&_svg:not([class*='size-'])]:h-full [&_svg:not([class*='size-'])]:w-auto [&_svg:not([class*='size-'])]:max-w-none [&_svg:not([class*='size-'])]:shrink-0",e),children:n&&jsx(n,{title:o})})};var ut=F.forwardRef(({className:e,disabled:t,error:o,onChange:n,readOnly:i,type:r,value:s,...a},l)=>{let p=$e(),c=F.useMemo(()=>Ve(p),[p]),f=F.useRef(null),d$1=!t&&!i&&!!s,x=d$1||o;F.useImperativeHandle(l,()=>f.current,[]);let L=F.useCallback(g=>{g.preventDefault();},[]),R=F.useCallback(()=>{let g=f.current;if(!g){n?.({target:{value:""}});return}g.value="",n?.({target:g}),g.focus();},[n]);return jsxs("div",{className:a$2("relative flex h-full min-w-0 flex-1 rounded-r bg-neutral-50",t&&"bg-neutral-100"),children:[jsx("input",{type:r,"data-slot":"input",className:a$2("h-full min-w-0 flex-1 rounded-r bg-transparent px-3 text-sm leading-[143%] text-neutral-900 placeholder-neutral-600 focus-visible:outline-0",x&&!o&&"pr-10.5",d$1&&o&&"pr-14",o&&!d$1&&"pr-10.5",t&&"text-neutral-600",e),...a,disabled:t,readOnly:i,value:s,onChange:n,ref:f}),(d$1||o)&&jsxs("div",{className:"absolute inset-y-0 right-3 z-10 flex items-center gap-1",children:[d$1&&jsx("button",{type:"button","aria-label":c.clearPhoneNumberLabel,className:"flex items-center justify-center text-neutral-900",onMouseDown:L,onClick:R,children:jsx(d,{className:"size-4.5"})}),o&&jsx(q,{className:"text-danger-500 pointer-events-none size-4.5 shrink-0"})]})]})});ut.displayName="PhoneNumberInputComponent";var Hi=wi,No=F.forwardRef(({className:e,defaultCountry:t,disabled:o,error:n,helperText:i,id:r,label:s,onChange:a=xo,placeholder:l,readOnly:p,required:c,tooltip:f,value:h,...d},x)=>{let[L,R]=F.useState(false),[g,M]=F.useState(()=>vo(h)??t),I=F.useId(),P=r??I,b=$e(),N=F.useMemo(()=>Ve(b),[b]),E=F.useMemo(()=>Co(b),[b]),y=F.useMemo(()=>Lo(g)??l??go,[l,g]),w=a$2("relative flex h-10 rounded after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-[inherit] after:ring-1 after:content-[''] after:ring-inset",n?"after:ring-danger-500 after:ring-2":o||p?"after:ring-neutral-300":"focus-within:after:ring-primary-800 after:ring-neutral-600 focus-within:after:ring-2",!n&&!o&&!p&&L&&"after:ring-primary-800 after:ring-2",e),S=F.useCallback(q=>{M(q);},[]);return jsxs("div",{className:"group flex flex-col","data-disabled":o||void 0,"data-error":n||void 0,"data-readonly":p||void 0,children:[s&&jsx(a$7,{as:"label",htmlFor:P,label:s,required:c,tooltip:f}),jsx(Hi,{...d,className:w,ref:x,countrySelectComponent:yo,countrySelectProps:{error:n,onOpenChange:R,translations:N},defaultCountry:t,disabled:o,flagComponent:Io,id:P,initialValueFormat:"national",inputComponent:ut,labels:E,numberInputProps:{error:n,placeholder:y},readOnly:p,required:c,value:h,onChange:a,onCountryChange:S}),jsx("p",{className:"font-inter text-2xs group-data-[error=true]:text-error-500 mt-1 leading-[133.33%] font-normal text-neutral-700 group-data-disabled:text-neutral-400 empty:hidden",children:i})]})});No.displayName="PhoneInputNew";var Fi=({children:e,hasDescription:t=false,disabled:o=false,hasDivider:n=false,className:i,isSelected:r,onClick:s,...a})=>jsxs(Fragment,{children:[jsx("div",{className:a$2("flex flex-row px-3 py-4 text-neutral-900 transition-colors",t?"py-3":"py-3.5",o?"cursor-not-allowed text-neutral-400":a$2("hover:bg-primary-100 focus:bg-primary-200",!!s?"cursor-pointer":"cursor-default"),r&&"bg-primary-200",i),onClick:p=>{o||s?.(p);},...a,children:e}),n&&jsx(a$1,{})]}),Y=Fi;var tu=({children:e,title:t,titleLines:o,description:n="",descriptionLines:i,startIcon:r,badgeContent:s,hasDivider:a=false,disabled:l=false,onSelect:p,className:c,...f})=>jsxs(Y,{hasDescription:!!n,disabled:l,onClick:p,hasDivider:a,className:a$2(!l&&"cursor-pointer",c),...f,children:[r&&F__default.cloneElement(r,{className:"shrink-0 mr-2 h-4.5 w-4.5"}),jsx(re,{title:t,titleLines:o,description:n,descriptionLines:i,disabled:l}),jsxs("div",{className:"ml-4 flex gap-2",children:[s&&jsx(a$3,{content:s,size:"lg",variant:"alert",className:a$2("self-center",l&&"bg-neutral-400")}),jsx(h,{className:"h-4.5 w-4.5 self-center"})]})]});export{ts as a,tu as b,Ut as c,Rl as d,kl as e,$l as f,Je as g,et as h,ue as i,it as j,st as k,Vr as l,ti as m,ni as n,ri as o,ii as p,si as q,Oc as r,kc as s,wc as t,Hc as u,No as v,ce as w,Za as x,Ja as y,po as z};
@@ -1 +1 @@
1
- import {a}from'./chunk-UZ3SBSKA.js';import {q}from'./chunk-QNQELNVU.js';import {a as a$1}from'./chunk-OBZIYJO7.js';import {Field}from'@ark-ui/react/field';import {forwardRef,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var I=forwardRef(({className:p,label:m,required:n,tooltip:g,helperText:c,error:l,...f},x)=>(useEffect(()=>{let a=r=>{let o=document.activeElement;o&&o.type==="number"&&document.elementFromPoint(r.clientX,r.clientY)===o&&r.preventDefault();};return document.addEventListener("wheel",a,{passive:false}),()=>{document.removeEventListener("wheel",a);}},[]),jsxs(Field.Root,{"data-error":l,className:a$1("group flex flex-col data-[readonly]:pointer-events-none",p),children:[jsx(a,{as:Field.Label,label:m,required:n,tooltip:g}),jsxs("div",{className:"relative",children:[jsx(Field.Input,{ref:x,required:n,className:"focus:ring-primary-800 group-data-[error=true]:ring-error-500 font-inter h-10 w-full rounded-lg bg-neutral-50 px-3 text-sm leading-[142.86%] font-normal text-neutral-900 ring ring-neutral-500 transition-all ring-inset group-data-[disabled]:text-neutral-400 group-data-[disabled]:ring-neutral-400 group-data-[error=true]:pr-10.5 group-data-[error=true]:ring-2 group-data-[readonly]:bg-neutral-100 group-data-[readonly]:ring-neutral-300 placeholder:text-neutral-500 group-data-[disabled]:placeholder:text-neutral-400 focus:ring-2 focus:outline-none",...f}),l&&jsx(q,{className:"text-error-500 absolute top-1/2 right-3 size-4.5 -translate-y-1/2 cursor-text"})]}),jsx(Field.HelperText,{className:"text-2xs group-data-[error=true]:text-error-500 font-inter mt-1 leading-[133.33%] font-normal text-neutral-700 group-data-[disabled]:text-neutral-400 empty:hidden",children:c})]})));export{I as a};
1
+ import {a}from'./chunk-BJ5MXTGP.js';import {q}from'./chunk-QNQELNVU.js';import {a as a$1}from'./chunk-OBZIYJO7.js';import {Field}from'@ark-ui/react/field';import {forwardRef,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var I=forwardRef(({className:p,label:m,required:n,tooltip:g,helperText:c,error:l,...f},x)=>(useEffect(()=>{let a=r=>{let o=document.activeElement;o&&o.type==="number"&&document.elementFromPoint(r.clientX,r.clientY)===o&&r.preventDefault();};return document.addEventListener("wheel",a,{passive:false}),()=>{document.removeEventListener("wheel",a);}},[]),jsxs(Field.Root,{"data-error":l,className:a$1("group flex flex-col data-[readonly]:pointer-events-none",p),children:[jsx(a,{as:Field.Label,label:m,required:n,tooltip:g}),jsxs("div",{className:"relative",children:[jsx(Field.Input,{ref:x,required:n,className:"focus:ring-primary-800 group-data-[error=true]:ring-error-500 font-inter h-10 w-full rounded-lg bg-neutral-50 px-3 text-sm leading-[142.86%] font-normal text-neutral-900 ring ring-neutral-500 transition-all ring-inset group-data-[disabled]:text-neutral-400 group-data-[disabled]:ring-neutral-400 group-data-[error=true]:pr-10.5 group-data-[error=true]:ring-2 group-data-[readonly]:bg-neutral-100 group-data-[readonly]:ring-neutral-300 placeholder:text-neutral-500 group-data-[disabled]:placeholder:text-neutral-400 focus:ring-2 focus:outline-none",...f}),l&&jsx(q,{className:"text-error-500 absolute top-1/2 right-3 size-4.5 -translate-y-1/2 cursor-text"})]}),jsx(Field.HelperText,{className:"text-2xs group-data-[error=true]:text-error-500 font-inter mt-1 leading-[133.33%] font-normal text-neutral-700 group-data-[disabled]:text-neutral-400 empty:hidden",children:c})]})));export{I as a};
@@ -1 +1 @@
1
- import {a}from'./chunk-UZ3SBSKA.js';import {d}from'./chunk-QNQELNVU.js';import {a as a$1}from'./chunk-OBZIYJO7.js';import {SignaturePad}from'@ark-ui/react/signature-pad';import {forwardRef,useState,useCallback}from'react';import {jsxs,jsx}from'react/jsx-runtime';var z=forwardRef((N,D)=>{let{rootClassName:v,className:V,label:m,required:k,tooltip:A,helperText:f,error:u,hasValue:b,onChange:h,readOnly:n,disabled:e,...E}=N,[F,T]=useState(false),d$1=b!==void 0,H=d$1?b:F,P=useCallback(async a=>{let[l,g]=a.split(","),w=l.match(/:(.*?);/),q=w?w[1]:"image/png",c=atob(g),S=new Uint8Array(c.length);for(let i=0;i<c.length;i++)S[i]=c.charCodeAt(i);return new File([S],"signature.png",{type:q})},[]),o=useCallback(a=>{d$1||T(!!a),h?.(a);},[d$1,h]),R=useCallback(async a=>{if(n||e)return;let l=await a.getDataUrl("image/png");if(!l){o(null);return}let g=await P(l);o(g);},[o,P,n,e]),U=H&&!n&&!e;return jsxs(SignaturePad.Root,{ref:D,"data-error":u,className:a$1("group flex flex-col",v),onDrawEnd:R,readOnly:n,disabled:e,...E,children:[m&&jsx(a,{as:SignaturePad.Label,label:m,required:k,tooltip:A}),jsxs(SignaturePad.Control,{className:a$1("group/control","relative h-40 w-full overflow-hidden","rounded-lg bg-white p-4","border border-dashed border-neutral-300",u&&"border-error-500",n&&"pointer-events-none border-neutral-300 bg-neutral-100",e&&"pointer-events-none opacity-60",V),children:[jsx(SignaturePad.Segment,{className:"h-full w-full"}),jsx(SignaturePad.Guide,{className:"absolute inset-0 opacity-20"}),U&&jsx(SignaturePad.ClearTrigger,{className:"absolute top-2 right-2 z-20 cursor-pointer rounded-lg bg-neutral-100 p-1 ring-1 ring-neutral-500",onClick:()=>o(null),children:jsx(d,{className:"size-4 text-neutral-700"})})]}),f&&jsx("p",{className:a$1("font-inter text-2xs mt-1 leading-[133.33%] font-normal",u?"text-error-500":"text-neutral-700",e&&"text-neutral-400"),children:f})]})});z.displayName="SignaturePad";export{z as a};
1
+ import {a}from'./chunk-BJ5MXTGP.js';import {d}from'./chunk-QNQELNVU.js';import {a as a$1}from'./chunk-OBZIYJO7.js';import {SignaturePad}from'@ark-ui/react/signature-pad';import {forwardRef,useState,useCallback}from'react';import {jsxs,jsx}from'react/jsx-runtime';var z=forwardRef((N,D)=>{let{rootClassName:v,className:V,label:m,required:k,tooltip:A,helperText:f,error:u,hasValue:b,onChange:h,readOnly:n,disabled:e,...E}=N,[F,T]=useState(false),d$1=b!==void 0,H=d$1?b:F,P=useCallback(async a=>{let[l,g]=a.split(","),w=l.match(/:(.*?);/),q=w?w[1]:"image/png",c=atob(g),S=new Uint8Array(c.length);for(let i=0;i<c.length;i++)S[i]=c.charCodeAt(i);return new File([S],"signature.png",{type:q})},[]),o=useCallback(a=>{d$1||T(!!a),h?.(a);},[d$1,h]),R=useCallback(async a=>{if(n||e)return;let l=await a.getDataUrl("image/png");if(!l){o(null);return}let g=await P(l);o(g);},[o,P,n,e]),U=H&&!n&&!e;return jsxs(SignaturePad.Root,{ref:D,"data-error":u,className:a$1("group flex flex-col",v),onDrawEnd:R,readOnly:n,disabled:e,...E,children:[m&&jsx(a,{as:SignaturePad.Label,label:m,required:k,tooltip:A}),jsxs(SignaturePad.Control,{className:a$1("group/control","relative h-40 w-full overflow-hidden","rounded-lg bg-white p-4","border border-dashed border-neutral-300",u&&"border-error-500",n&&"pointer-events-none border-neutral-300 bg-neutral-100",e&&"pointer-events-none opacity-60",V),children:[jsx(SignaturePad.Segment,{className:"h-full w-full"}),jsx(SignaturePad.Guide,{className:"absolute inset-0 opacity-20"}),U&&jsx(SignaturePad.ClearTrigger,{className:"absolute top-2 right-2 z-20 cursor-pointer rounded-lg bg-neutral-100 p-1 ring-1 ring-neutral-500",onClick:()=>o(null),children:jsx(d,{className:"size-4 text-neutral-700"})})]}),f&&jsx("p",{className:a$1("font-inter text-2xs mt-1 leading-[133.33%] font-normal",u?"text-error-500":"text-neutral-700",e&&"text-neutral-400"),children:f})]})});z.displayName="SignaturePad";export{z as a};
@@ -0,0 +1 @@
1
+ import {d,p}from'./chunk-QNQELNVU.js';import {forwardRef,useRef,useState,useCallback,useEffect}from'react';import {tv}from'tailwind-variants';import {jsxs,jsx}from'react/jsx-runtime';var A=["md","lg"],B=tv({slots:{wrapper:"relative flex flex-1 flex-col bg-neutral-50",input:"peer focus:ring-primary-800 absolute z-20 h-full w-full bg-neutral-50/0 px-4 text-left text-sm tracking-normal text-neutral-900 placeholder-neutral-600 ring-1 ring-neutral-600 outline-0 transition-all ring-inset focus:text-neutral-900 focus:ring-2 disabled:text-neutral-400 disabled:ring-neutral-300 disabled:placeholder:text-neutral-400",clearIcon:"absolute top-1/2 right-9.5 z-20 hidden size-4.5 -translate-y-1/2 cursor-pointer text-neutral-900 peer-focus:flex",searchIcon:"absolute top-1/2 right-3 z-20 flex size-4.5 -translate-y-1/2 items-center rounded-full text-neutral-800 peer-disabled:text-neutral-400"},variants:{size:{lg:{wrapper:"h-10 rounded-md",input:"rounded-md"},md:{wrapper:"h-8 rounded-sm",input:"rounded-sm"}}},defaultVariants:{size:"lg"}}),E=forwardRef(({placeholder:c,className:d$1,size:f="lg",onClean:s,onChange:m,disabled:n,value:t,defaultValue:u,...h},r)=>{let a=useRef(null),{wrapper:g,input:b,clearIcon:x,searchIcon:I}=B({size:f}),[S,l]=useState(t!==void 0?!!t:!!u),w=useCallback(()=>{if(a.current&&!n){let e=a.current;Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value")?.set?.call(e,"");let y=new Event("input",{bubbles:true});e.dispatchEvent(y),l(false),s?.();}},[n,s]);return useEffect(()=>{t!==void 0&&l(String(t).length>0);},[t]),jsxs("div",{className:g({className:d$1}),children:[jsx("input",{disabled:n,type:"search",autoComplete:"off","data-1p-ignore":true,"data-lpignore":"true",className:b(),placeholder:c??"",ref:e=>{typeof r=="function"?r(e):r&&(r.current=e),a.current=e;},value:t,defaultValue:u,onChange:e=>{l(e.target.value.length>0),m?.(e);},...h}),!n&&S&&jsx(d,{onMouseDown:w,className:x()}),jsx(p,{className:I()})]})});E.displayName="SearchBar";export{A as a,B as b,E as c};
@@ -1 +1 @@
1
- import {a}from'./chunk-VFP3D5WF.js';import {a as a$1}from'./chunk-OBZIYJO7.js';import H,{useId,useRef,useState,useEffect}from'react';import*as h from'@radix-ui/react-portal';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var b=56,s=6,D=({options:l,noResults:m,selectedOption:x,onSelect:y,onChange:O,onClick:E,className:S,...P})=>{let R=useId(),n=useRef(null),t=useRef(null),[L,C]=useState("bottom"),[o,N]=useState(),[p,f]=useState(x??null),I=e=>{n.current.style.display="none",t.current.value=e.label,f(e),y?.(e);};return useEffect(()=>{if(!t.current)return;let e=()=>{if(!t.current)return;let r=b*(l.length<s?l.length:s)+16,i=t.current.getBoundingClientRect();N(i);let T=window.innerHeight-i.bottom>r,k=i.top>r;C(T?"bottom":k?"top":"bottom");};return e(),t.current.addEventListener("mousedown",e),window.addEventListener("scroll",e,true),window.addEventListener("resize",e),()=>{t.current?.removeEventListener("mousedown",e),window.removeEventListener("scroll",e,true),window.removeEventListener("resize",e);}},[t.current]),useEffect(()=>{function e(r){n.current&&!n.current.contains(r.target)&&(n.current.style.display="none");}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e);}},[n.current]),jsxs(Fragment,{children:[jsx(a,{className:a$1("w-full cursor-pointer!",S),readOnly:true,ref:t,autoComplete:"off",list:"",selectMode:true,value:p?.label,showClearButton:false,onClick:e=>{n.current.style.display="flex",E?.(e);},onChange:e=>{f(null),O?.(e);},...P}),jsx(h.Root,{asChild:true,children:jsxs("ul",{ref:n,className:"elevation-8 pointer-events-auto absolute z-10000 my-2 hidden max-h-[336px] w-full flex-col overflow-y-auto rounded-lg bg-neutral-50",style:o?{width:`${o.width}px`,left:o.left,top:L==="bottom"?`${o.height+o.top+window.scrollY}px`:window.scrollY+o.top-(l.length<s?l.length:s)*b-16}:void 0,children:[l.length===0&&jsxs("div",{className:"elevation-8 flex max-h-88 flex-1 flex-col items-center justify-center rounded-lg bg-neutral-50 px-8 py-6",children:[H.cloneElement(m.icon,{className:"mb-2 h-8 w-8 text-neutral-300"}),jsx("p",{className:"text-center text-sm leading-[120%] text-neutral-500",children:m.message})]}),l.map(e=>jsx("li",{onClick:()=>{e.disabled||I(e);},className:a$1("w-full shrink-0 py-4 pr-6 pl-4 text-left",p?.value===e.value&&"bg-primary-200",e.disabled?"cursor-not-allowed text-neutral-400":"hover:bg-primary-100 cursor-pointer"),children:e.label},`select-option-${R}-${e.key??e.value}`))]})})]})};export{D as a};
1
+ import {a}from'./chunk-A2VW62QH.js';import {a as a$1}from'./chunk-OBZIYJO7.js';import H,{useId,useRef,useState,useEffect}from'react';import*as h from'@radix-ui/react-portal';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var b=56,s=6,D=({options:l,noResults:m,selectedOption:x,onSelect:y,onChange:O,onClick:E,className:S,...P})=>{let R=useId(),n=useRef(null),t=useRef(null),[L,C]=useState("bottom"),[o,N]=useState(),[p,f]=useState(x??null),I=e=>{n.current.style.display="none",t.current.value=e.label,f(e),y?.(e);};return useEffect(()=>{if(!t.current)return;let e=()=>{if(!t.current)return;let r=b*(l.length<s?l.length:s)+16,i=t.current.getBoundingClientRect();N(i);let T=window.innerHeight-i.bottom>r,k=i.top>r;C(T?"bottom":k?"top":"bottom");};return e(),t.current.addEventListener("mousedown",e),window.addEventListener("scroll",e,true),window.addEventListener("resize",e),()=>{t.current?.removeEventListener("mousedown",e),window.removeEventListener("scroll",e,true),window.removeEventListener("resize",e);}},[t.current]),useEffect(()=>{function e(r){n.current&&!n.current.contains(r.target)&&(n.current.style.display="none");}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e);}},[n.current]),jsxs(Fragment,{children:[jsx(a,{className:a$1("w-full cursor-pointer!",S),readOnly:true,ref:t,autoComplete:"off",list:"",selectMode:true,value:p?.label,showClearButton:false,onClick:e=>{n.current.style.display="flex",E?.(e);},onChange:e=>{f(null),O?.(e);},...P}),jsx(h.Root,{asChild:true,children:jsxs("ul",{ref:n,className:"elevation-8 pointer-events-auto absolute z-10000 my-2 hidden max-h-[336px] w-full flex-col overflow-y-auto rounded-lg bg-neutral-50",style:o?{width:`${o.width}px`,left:o.left,top:L==="bottom"?`${o.height+o.top+window.scrollY}px`:window.scrollY+o.top-(l.length<s?l.length:s)*b-16}:void 0,children:[l.length===0&&jsxs("div",{className:"elevation-8 flex max-h-88 flex-1 flex-col items-center justify-center rounded-lg bg-neutral-50 px-8 py-6",children:[H.cloneElement(m.icon,{className:"mb-2 h-8 w-8 text-neutral-300"}),jsx("p",{className:"text-center text-sm leading-[120%] text-neutral-500",children:m.message})]}),l.map(e=>jsx("li",{onClick:()=>{e.disabled||I(e);},className:a$1("w-full shrink-0 py-4 pr-6 pl-4 text-left",p?.value===e.value&&"bg-primary-200",e.disabled?"cursor-not-allowed text-neutral-400":"hover:bg-primary-100 cursor-pointer"),children:e.label},`select-option-${R}-${e.key??e.value}`))]})})]})};export{D as a};
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-T2Q6B32U.js';import {q,d,g as g$1}from'./chunk-QNQELNVU.js';import {a}from'./chunk-OBZIYJO7.js';import g,{forwardRef,useId,useRef,useState,useCallback,useEffect}from'react';import {Label}from'@radix-ui/react-label';import {jsxs,jsx}from'react/jsx-runtime';var U=forwardRef(({label:x,placeholder:y,error:t,selectMode:b=false,showClearButton:H=true,helperText:M,className:I,size:e="md",onClean:P,onChange:f,startIcon:u,endIcon:p,startComponent:c,fixedTopLabel:C,startText:i,disabled:o,required:v,...D},m)=>{let w=useId(),l=useRef(null),[s,h]=useState(false),T=!l.current?.value,F=useCallback(()=>{if(l.current&&!o){l.current.value="",h(false),P?.();let a={target:l.current,currentTarget:l.current,type:"change",bubbles:true,cancelable:false,defaultPrevented:false,eventPhase:0,isTrusted:true,preventDefault:()=>{},stopPropagation:()=>{},persist:()=>{},isDefaultPrevented:()=>false,isPropagationStopped:()=>false,timeStamp:Date.now(),nativeEvent:new Event("change")};f?.(a);}},[o,f,l.current]);return useEffect(()=>{l.current&&h(l.current.value.length>0);},[]),jsxs("div",{className:a("flex flex-col",I),children:[jsxs("div",{className:a("relative flex flex-col rounded-lg bg-neutral-50",e==="lg"&&"h-12",e==="md"&&"h-10",e==="sm"&&"h-8"),children:[jsx("input",{id:w,disabled:o,required:v,className:a("hover:caret-neutral-text-neutral-600 hover:ring-neutral-text-neutral-600 hover:text-neutral no-spinner peer focus:placeholder-opacity-100 focus:caret-primary-800 focus:ring-primary-800 disabled:bg-neutral-80 absolute z-20 h-full w-full rounded-lg bg-neutral-50/0 text-left tracking-normal text-neutral-900 placeholder-neutral-500 caret-neutral-900 ring-1 ring-neutral-400 outline-0 transition-all ease-linear ring-inset not-placeholder-shown:z-10 focus:text-neutral-900 focus:placeholder-neutral-500 focus:ring-2 disabled:text-neutral-400 disabled:ring-neutral-100",x&&"placeholder-neutral-500/0",t&&"placeholder-error-700/0 ring-error-700 hover:ring-error-700 focus:ring-error-700 hover:text-neutral-900",e==="lg"&&"text-base",e==="md"&&"text-sm",e==="sm"&&"text-sm",u?e==="lg"?"pl-[2.75rem]":"pl-[2.38rem]":c?"pl-[6.5rem]":"pl-4",i&&"pl-[1.94rem]",p?e==="lg"?"pr-[2.75rem]":"pr-[2.38rem]":"pr-4"),placeholder:y??"",ref:a=>{typeof m=="function"?m(a):m&&(m.current=a),l.current=a;},onChange:a=>{h(a.target.value.length>0),f?.(a);},...D}),c&&g.cloneElement(c,{className:a("absolute z-20 flex left-3 top-1/2 transform -translate-y-1/2 items-center rounded-full peer-disabled:text-neutral-400",t&&!s&&"text-error-700 peer-hover:text-error-700 peer-focus:text-error-700")}),u&&g.cloneElement(u,{size:18,className:a("absolute flex peer-focus:text-neutral-900 z-20 text-neutral-500 left-3 h-full items-center rounded-full peer-disabled:text-neutral-400",t&&!s&&"text-error-700 peer-hover:text-error-700 peer-focus:text-error-700")}),i&&jsx("div",{className:"flex h-full items-center pl-3",children:jsx("p",{className:a("text-neutral-700",t&&"text-error-700"),children:i})}),x&&jsxs(Label,{htmlFor:w,className:a("peer-hover:text-primary-800 absolute -top-[0.5625rem] z-10 ml-3 bg-neutral-50 px-1 tracking-normal text-neutral-50 transition-all duration-75 ease-linear peer-disabled:z-20 peer-disabled:text-neutral-400","peer-focus:text-primary-800 peer-disabled:peer-not-focus:peer-placeholder-shown:bg-neutral-80 peer-focus:-top-[0.5625rem] peer-focus:z-20 peer-focus:ml-3 peer-focus:text-xs",!t&&"peer-not-disabled:peer-not-focus:text-neutral-400 peer-not-disabled:peer-not-focus:peer-not-placeholder-shown:text-neutral-900",s&&"peer-disabled:bg-neutral-80",e==="lg"?"text-base peer-placeholder-shown:top-3 placeholder-shown:text-xs":e==="md"?"text-sm peer-placeholder-shown:top-2.5 placeholder-shown:text-xs":"text-sm peer-placeholder-shown:top-1.5 placeholder-shown:text-xs",!T&&"text-xs",t&&"text-error-700 peer-hover:text-error-700 peer-focus:text-error-700",u?e==="lg"?"peer-placeholder-shown:ml-[2.75rem]":"peer-placeholder-shown:ml-[2.38rem]":c?"peer-placeholder-shown:ml-[6rem]":"ml-3",C&&"-top-[0.375rem]! z-20 ml-3 text-xs! transition-none!",i&&"peer-placeholder-shown:ml-[1.94rem]"),children:[v&&"*",x]}),(H&&(!T||s)||t)&&jsxs("div",{className:a("absolute z-10 hidden h-full items-center peer-focus:flex",t&&!o&&"flex",b||p?e==="lg"?"right-[2.81rem]":e==="md"?"right-[2.125rem]":"right-[1.875rem]":"right-4"),children:[t&&jsx(q,{size:e==="sm"?14:18,className:"text-error-700"}),!t&&jsx(d,{onMouseDown:F,size:e==="sm"?14:18,className:"cursor-pointer text-neutral-900"})]}),p&&g.cloneElement(p,{size:e==="sm"?14:18,className:a("absolute peer-focus:text-neutral-900 z-20 text-neutral-500 flex right-3 h-full items-center rounded-full peer-disabled:text-neutral-400",t&&!s&&"text-error-700 peer-hover:text-error-700 peer-focus:text-error-700")}),b&&jsx("div",{className:a("peer-hover:text-neutral peer-focus:text-primary-900 absolute right-4 z-20 flex h-full items-center rounded-full transition-all ease-linear peer-focus:rotate-180 peer-disabled:text-neutral-400"),children:jsx(g$1,{className:e==="lg"?"h-6 w-6":"h-4.5 w-4.5"})})]}),jsx(a$1,{helperText:M,error:t,disabled:o})]})});export{U as a};
1
+ import {a as a$1}from'./chunk-T2Q6B32U.js';import {q,d,g as g$1}from'./chunk-QNQELNVU.js';import {a}from'./chunk-OBZIYJO7.js';import g,{forwardRef,useId,useRef,useState,useCallback,useEffect}from'react';import {Label}from'@radix-ui/react-label';import {jsxs,jsx}from'react/jsx-runtime';var W=forwardRef(({label:x,placeholder:R,error:t,selectMode:b=false,showClearButton:H=true,helperText:M,className:I,size:e="md",onClean:P,onChange:f,startIcon:u,endIcon:p,startComponent:c,fixedTopLabel:C,startText:i,disabled:o,required:v,...D},m)=>{let w=useId(),l=useRef(null),[s,h]=useState(false),T=!l.current?.value,F=useCallback(()=>{if(l.current&&!o){l.current.value="",h(false),P?.();let a={target:l.current,currentTarget:l.current,type:"change",bubbles:true,cancelable:false,defaultPrevented:false,eventPhase:0,isTrusted:true,preventDefault:()=>{},stopPropagation:()=>{},persist:()=>{},isDefaultPrevented:()=>false,isPropagationStopped:()=>false,timeStamp:Date.now(),nativeEvent:new Event("change")};f?.(a);}},[o,f,l.current]);return useEffect(()=>{l.current&&h(l.current.value.length>0);},[]),jsxs("div",{className:a("flex flex-col",I),children:[jsxs("div",{className:a("relative flex flex-col rounded-lg bg-neutral-50",e==="lg"&&"h-12",e==="md"&&"h-10",e==="sm"&&"h-8"),children:[jsx("input",{id:w,disabled:o,required:v,className:a("hover:caret-neutral-text-neutral-600 hover:ring-neutral-text-neutral-600 hover:text-neutral no-spinner peer focus:placeholder-opacity-100 focus:caret-primary-800 focus:ring-primary-800 disabled:bg-neutral-80 absolute z-20 h-full w-full rounded-lg bg-neutral-50/0 text-left tracking-normal text-neutral-900 placeholder-neutral-500 caret-neutral-900 ring-1 ring-neutral-400 outline-0 transition-all ease-linear ring-inset not-placeholder-shown:z-10 focus:text-neutral-900 focus:placeholder-neutral-500 focus:ring-2 disabled:text-neutral-400 disabled:ring-neutral-100",x&&"placeholder-neutral-500/0",t&&"placeholder-error-700/0 ring-error-700 hover:ring-error-700 focus:ring-error-700 hover:text-neutral-900",e==="lg"&&"text-base",e==="md"&&"text-sm",e==="sm"&&"text-sm",u?e==="lg"?"pl-[2.75rem]":"pl-[2.38rem]":c?"pl-[6.5rem]":"pl-4",i&&"pl-[1.94rem]",p?e==="lg"?"pr-[2.75rem]":"pr-[2.38rem]":"pr-4"),placeholder:R??"",ref:a=>{typeof m=="function"?m(a):m&&(m.current=a),l.current=a;},onChange:a=>{h(a.target.value.length>0),f?.(a);},...D}),c&&g.cloneElement(c,{className:a("absolute z-20 flex left-3 top-1/2 transform -translate-y-1/2 items-center rounded-full peer-disabled:text-neutral-400",t&&!s&&"text-error-700 peer-hover:text-error-700 peer-focus:text-error-700")}),u&&g.cloneElement(u,{size:18,className:a("absolute flex peer-focus:text-neutral-900 z-20 text-neutral-500 left-3 h-full items-center rounded-full peer-disabled:text-neutral-400",t&&!s&&"text-error-700 peer-hover:text-error-700 peer-focus:text-error-700")}),i&&jsx("div",{className:"flex h-full items-center pl-3",children:jsx("p",{className:a("text-neutral-700",t&&"text-error-700"),children:i})}),x&&jsxs(Label,{htmlFor:w,className:a("peer-hover:text-primary-800 absolute -top-[0.5625rem] z-10 ml-3 bg-neutral-50 px-1 tracking-normal text-neutral-50 transition-all duration-75 ease-linear peer-disabled:z-20 peer-disabled:text-neutral-400","peer-focus:text-primary-800 peer-disabled:peer-not-focus:peer-placeholder-shown:bg-neutral-80 peer-focus:-top-[0.5625rem] peer-focus:z-20 peer-focus:ml-3 peer-focus:text-xs",!t&&"peer-not-disabled:peer-not-focus:text-neutral-400 peer-not-disabled:peer-not-focus:peer-not-placeholder-shown:text-neutral-900",s&&"peer-disabled:bg-neutral-80",e==="lg"?"text-base peer-placeholder-shown:top-3 placeholder-shown:text-xs":e==="md"?"text-sm peer-placeholder-shown:top-2.5 placeholder-shown:text-xs":"text-sm peer-placeholder-shown:top-1.5 placeholder-shown:text-xs",!T&&"text-xs",t&&"text-error-700 peer-hover:text-error-700 peer-focus:text-error-700",u?e==="lg"?"peer-placeholder-shown:ml-[2.75rem]":"peer-placeholder-shown:ml-[2.38rem]":c?"peer-placeholder-shown:ml-[6rem]":"ml-3",C&&"-top-[0.375rem]! z-20 ml-3 text-xs! transition-none!",i&&"peer-placeholder-shown:ml-[1.94rem]"),children:[v&&"*",x]}),(H&&(!T||s)||t)&&jsxs("div",{className:a("absolute z-10 hidden h-full items-center peer-focus:flex",t&&!o&&"flex",b||p?e==="lg"?"right-[2.81rem]":e==="md"?"right-[2.125rem]":"right-[1.875rem]":"right-4"),children:[t&&jsx(q,{size:e==="sm"?14:18,className:"text-error-700"}),!t&&jsx(d,{onMouseDown:F,size:e==="sm"?14:18,className:"cursor-pointer text-neutral-900"})]}),p&&g.cloneElement(p,{size:e==="sm"?14:18,className:a("absolute peer-focus:text-neutral-900 z-20 text-neutral-500 flex right-3 h-full items-center rounded-full peer-disabled:text-neutral-400",t&&!s&&"text-error-700 peer-hover:text-error-700 peer-focus:text-error-700")}),b&&jsx("div",{className:a("peer-hover:text-neutral peer-focus:text-primary-900 absolute right-4 z-20 flex h-full items-center rounded-full transition-all ease-linear peer-focus:rotate-180 peer-disabled:text-neutral-400"),children:jsx(g$1,{className:e==="lg"?"h-6 w-6":"h-4.5 w-4.5"})})]}),jsx(a$1,{helperText:M,error:t,disabled:o})]})});export{W as a};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-CM6ALMTT.js';import {q}from'./chunk-QNQELNVU.js';import {a as a$1}from'./chunk-OBZIYJO7.js';import {jsxs,jsx}from'react/jsx-runtime';var d=({as:m,label:t,required:l,tooltip:o,className:p,htmlFor:c})=>jsxs(m,{className:a$1("font-inter mb-2 flex items-center text-xs leading-[133.33%] font-medium text-neutral-900",p),htmlFor:c,children:[l?jsxs("span",{className:"flex items-center gap-1",children:[jsx("span",{className:"text-danger-500",children:"*"}),t]}):t,o&&jsx(a,{content:o,className:"ml-2",children:jsx(q,{className:"size-3.5"})})]});export{d as a};
@@ -1 +1 @@
1
- import {a,b,c,d,e,f,g,h,i as i$1}from'./chunk-EU3IUSBX.js';import {a as a$1}from'./chunk-GFVJRSZI.js';import {a as a$2}from'./chunk-VFP3D5WF.js';import {g as g$1}from'./chunk-QNQELNVU.js';import {a as a$3}from'./chunk-OBZIYJO7.js';import _,{useId,useRef,useState,useEffect,useMemo}from'react';import*as I from'@radix-ui/react-portal';import {jsx,jsxs}from'react/jsx-runtime';var L=56,p=6,q=(t=>(t.CL="CL",t.AR="AR",t.CO="CO",t.GT="GT",t.MX="MX",t.PE="PE",t.BR="BR",t.UY="UY",t.US="US",t))(q||{}),M=new Map([["CL",{name:"Chile",flag:a}],["AR",{name:"Argentina",flag:b}],["CO",{name:"Colombia",flag:c}],["GT",{name:"Guatemala",flag:d}],["MX",{name:"Mexico",flag:e}],["PE",{name:"Per\xFA",flag:f}],["BR",{name:"Brasil",flag:g}],["UY",{name:"Uruguay",flag:h}],["US",{name:"Estados Unidos",flag:i$1}]]),i=Array.from(M.entries()),de=({noResults:g,selectedCountry:d,onSelect:S,className:U,size:B="md",...m})=>{let A=useId(),l=useRef(null),r=useRef(null),[t,G]=useState("bottom"),[s,H]=useState(),[Y,$]=useState(-1),k=e=>{l.current.style.display="none",S?.(e);};useEffect(()=>{if(!r.current)return;let e=()=>{if(!r.current)return;let a=L*(i.length<p?i.length:p)+16,c=r.current.getBoundingClientRect();H(c);let z=window.innerHeight-c.bottom>a,X=c.top>a;G(z?"bottom":X?"top":"bottom");};return e(),r.current.addEventListener("mousedown",e),window.addEventListener("scroll",e,true),window.addEventListener("resize",e),()=>{r.current?.removeEventListener("mousedown",e),window.removeEventListener("scroll",e,true),window.removeEventListener("resize",e);}},[r.current]),a$1(l,()=>{l.current&&(l.current.style.display="none",$(-1));});let x=useMemo(()=>M.get(d),[d]);return jsx("div",{className:a$3("flex flex-col",U),children:jsxs("div",{className:a$3("relative flex flex-col"),children:[jsx(a$2,{ref:r,startComponent:jsxs("div",{className:"z-100000 ml-3 flex h-2 w-[7.5rem] cursor-pointer items-center",onClick:()=>{m.disabled||(l.current.style.display="flex");},children:[jsx("img",{src:x?.flag,alt:x?.name,className:a$3("h-6 w-6 cursor-pointer",m.disabled&&"cursor-not-allowed text-neutral-400")}),jsx("span",{className:a$3("ml-1",m.disabled&&"cursor-not-allowed text-neutral-400"),children:d}),jsx(g$1,{className:a$3(B==="md"?"h-6 w-6":"h-4.5 w-4.5","cursor-pointer",m.disabled&&"cursor-not-allowed text-neutral-400")})]}),...m}),jsx(I.Root,{asChild:true,children:jsxs("ul",{ref:l,className:"elevation-8 pointer-events-auto absolute z-10000 my-2 hidden max-h-[336px] w-full flex-col overflow-y-auto rounded-lg bg-neutral-50",style:s?{width:`${s.width}px`,left:s.left,top:t==="bottom"?`${s.height+s.top+window.scrollY}px`:window.scrollY+s.top-(i.length<p?i.length:p)*L-16}:void 0,children:[i.length===0&&jsxs("div",{className:"elevation-8 flex max-h-88 flex-1 flex-col items-center justify-center rounded-lg bg-neutral-50 px-8 py-6",children:[_.cloneElement(g.icon,{className:"mb-2 h-8 w-8 text-neutral-300"}),jsx("p",{className:"text-center text-sm leading-[120%] text-neutral-500",children:g.message})]}),i.map(([e,a],c)=>jsx("li",{onClick:()=>{k(e);},className:a$3("hover:bg-primary-100 shrink-0 cursor-pointer py-4 pr-6 pl-4 text-left",d===e&&"bg-primary-200",Y===c&&"bg-primary-200"),children:jsxs("div",{className:a$3("flex items-center space-x-3"),children:[jsx("img",{src:a.flag,alt:a.name,className:"h-6 w-6"}),jsx("p",{children:a.name}),jsx("p",{className:"text-primary-500",children:`(${e})`})]})},`select-option-${A}-${e}`))]})})]})})};export{q as a,de as b};
1
+ import {a,b,c,d,e,f,g,h,i as i$1}from'./chunk-EU3IUSBX.js';import {a as a$1}from'./chunk-GFVJRSZI.js';import {a as a$2}from'./chunk-A2VW62QH.js';import {g as g$1}from'./chunk-QNQELNVU.js';import {a as a$3}from'./chunk-OBZIYJO7.js';import _,{useId,useRef,useState,useEffect,useMemo}from'react';import*as I from'@radix-ui/react-portal';import {jsx,jsxs}from'react/jsx-runtime';var L=56,p=6,q=(t=>(t.CL="CL",t.AR="AR",t.CO="CO",t.GT="GT",t.MX="MX",t.PE="PE",t.BR="BR",t.UY="UY",t.US="US",t))(q||{}),M=new Map([["CL",{name:"Chile",flag:a}],["AR",{name:"Argentina",flag:b}],["CO",{name:"Colombia",flag:c}],["GT",{name:"Guatemala",flag:d}],["MX",{name:"Mexico",flag:e}],["PE",{name:"Per\xFA",flag:f}],["BR",{name:"Brasil",flag:g}],["UY",{name:"Uruguay",flag:h}],["US",{name:"Estados Unidos",flag:i$1}]]),i=Array.from(M.entries()),de=({noResults:g,selectedCountry:d,onSelect:S,className:U,size:B="md",...m})=>{let A=useId(),l=useRef(null),r=useRef(null),[t,G]=useState("bottom"),[s,H]=useState(),[Y,$]=useState(-1),k=e=>{l.current.style.display="none",S?.(e);};useEffect(()=>{if(!r.current)return;let e=()=>{if(!r.current)return;let a=L*(i.length<p?i.length:p)+16,c=r.current.getBoundingClientRect();H(c);let z=window.innerHeight-c.bottom>a,X=c.top>a;G(z?"bottom":X?"top":"bottom");};return e(),r.current.addEventListener("mousedown",e),window.addEventListener("scroll",e,true),window.addEventListener("resize",e),()=>{r.current?.removeEventListener("mousedown",e),window.removeEventListener("scroll",e,true),window.removeEventListener("resize",e);}},[r.current]),a$1(l,()=>{l.current&&(l.current.style.display="none",$(-1));});let x=useMemo(()=>M.get(d),[d]);return jsx("div",{className:a$3("flex flex-col",U),children:jsxs("div",{className:a$3("relative flex flex-col"),children:[jsx(a$2,{ref:r,startComponent:jsxs("div",{className:"z-100000 ml-3 flex h-2 w-[7.5rem] cursor-pointer items-center",onClick:()=>{m.disabled||(l.current.style.display="flex");},children:[jsx("img",{src:x?.flag,alt:x?.name,className:a$3("h-6 w-6 cursor-pointer",m.disabled&&"cursor-not-allowed text-neutral-400")}),jsx("span",{className:a$3("ml-1",m.disabled&&"cursor-not-allowed text-neutral-400"),children:d}),jsx(g$1,{className:a$3(B==="md"?"h-6 w-6":"h-4.5 w-4.5","cursor-pointer",m.disabled&&"cursor-not-allowed text-neutral-400")})]}),...m}),jsx(I.Root,{asChild:true,children:jsxs("ul",{ref:l,className:"elevation-8 pointer-events-auto absolute z-10000 my-2 hidden max-h-[336px] w-full flex-col overflow-y-auto rounded-lg bg-neutral-50",style:s?{width:`${s.width}px`,left:s.left,top:t==="bottom"?`${s.height+s.top+window.scrollY}px`:window.scrollY+s.top-(i.length<p?i.length:p)*L-16}:void 0,children:[i.length===0&&jsxs("div",{className:"elevation-8 flex max-h-88 flex-1 flex-col items-center justify-center rounded-lg bg-neutral-50 px-8 py-6",children:[_.cloneElement(g.icon,{className:"mb-2 h-8 w-8 text-neutral-300"}),jsx("p",{className:"text-center text-sm leading-[120%] text-neutral-500",children:g.message})]}),i.map(([e,a],c)=>jsx("li",{onClick:()=>{k(e);},className:a$3("hover:bg-primary-100 shrink-0 cursor-pointer py-4 pr-6 pl-4 text-left",d===e&&"bg-primary-200",Y===c&&"bg-primary-200"),children:jsxs("div",{className:a$3("flex items-center space-x-3"),children:[jsx("img",{src:a.flag,alt:a.name,className:"h-6 w-6"}),jsx("p",{children:a.name}),jsx("p",{className:"text-primary-500",children:`(${e})`})]})},`select-option-${A}-${e}`))]})})]})})};export{q as a,de as b};
@@ -1 +1 @@
1
- import {a}from'./chunk-UZ3SBSKA.js';import {q}from'./chunk-QNQELNVU.js';import {a as a$1}from'./chunk-OBZIYJO7.js';import {Field}from'@ark-ui/react/field';import {forwardRef}from'react';import {jsx,jsxs}from'react/jsx-runtime';var v=forwardRef(({className:u,label:s,required:o,tooltip:p,helperText:g,error:r,placeholder:x,...a$2},m)=>jsx("div",{className:"w-full",children:jsxs(Field.Root,{"data-error":r,"data-readonly":a$2.readOnly,"data-disabled":a$2.disabled,className:a$1("group flex w-full flex-col data-[readonly]:pointer-events-none",u),children:[jsx(a,{as:Field.Label,label:s,required:o,tooltip:p}),jsxs("div",{className:"relative flex flex-col rounded-lg bg-neutral-50",children:[jsx(Field.Textarea,{ref:m,required:o,className:"no-scrollbar focus:ring-primary-800 group-data-[error=true]:ring-error-500 font-inter group-dta-[readony]:bg-neutral-100 h-20 w-full rounded-lg bg-neutral-50 p-3 text-sm leading-[142.86%] font-normal text-neutral-900 ring ring-neutral-500 transition-all ring-inset group-data-[disabled]:text-neutral-400 group-data-[disabled]:ring-neutral-400 group-data-[error=true]:pr-10.5 group-data-[error=true]:ring-2 group-data-[readonly]:bg-neutral-100 group-data-[readonly]:ring-neutral-300 placeholder:text-neutral-500 group-data-[disabled]:placeholder:text-neutral-400 focus:ring-2 focus:outline-none",placeholder:x,"aria-invalid":r,...a$2}),r&&jsx(q,{className:"text-error-500 absolute top-1/2 right-3 size-4.5 -translate-y-1/2 cursor-text"})]}),jsx(Field.HelperText,{className:a$1("text-2xs font-inter group-data-[error=true]:text-error-500 mx-2 mt-1 text-start text-xs leading-[133.33%] font-normal text-neutral-700 group-data-[disabled]:text-neutral-400 empty:hidden",r&&"text-error-500"),children:g})]})}));export{v as a};
1
+ import {a}from'./chunk-BJ5MXTGP.js';import {q}from'./chunk-QNQELNVU.js';import {a as a$1}from'./chunk-OBZIYJO7.js';import {Field}from'@ark-ui/react/field';import {forwardRef}from'react';import {jsx,jsxs}from'react/jsx-runtime';var v=forwardRef(({className:u,label:s,required:o,tooltip:p,helperText:g,error:r,placeholder:x,...a$2},m)=>jsx("div",{className:"w-full",children:jsxs(Field.Root,{"data-error":r,"data-readonly":a$2.readOnly,"data-disabled":a$2.disabled,className:a$1("group flex w-full flex-col data-[readonly]:pointer-events-none",u),children:[jsx(a,{as:Field.Label,label:s,required:o,tooltip:p}),jsxs("div",{className:"relative flex flex-col rounded-lg bg-neutral-50",children:[jsx(Field.Textarea,{ref:m,required:o,className:"no-scrollbar focus:ring-primary-800 group-data-[error=true]:ring-error-500 font-inter group-dta-[readony]:bg-neutral-100 h-20 w-full rounded-lg bg-neutral-50 p-3 text-sm leading-[142.86%] font-normal text-neutral-900 ring ring-neutral-500 transition-all ring-inset group-data-[disabled]:text-neutral-400 group-data-[disabled]:ring-neutral-400 group-data-[error=true]:pr-10.5 group-data-[error=true]:ring-2 group-data-[readonly]:bg-neutral-100 group-data-[readonly]:ring-neutral-300 placeholder:text-neutral-500 group-data-[disabled]:placeholder:text-neutral-400 focus:ring-2 focus:outline-none",placeholder:x,"aria-invalid":r,...a$2}),r&&jsx(q,{className:"text-error-500 absolute top-1/2 right-3 size-4.5 -translate-y-1/2 cursor-text"})]}),jsx(Field.HelperText,{className:a$1("text-2xs font-inter group-data-[error=true]:text-error-500 mx-2 mt-1 text-start text-xs leading-[133.33%] font-normal text-neutral-700 group-data-[disabled]:text-neutral-400 empty:hidden",r&&"text-error-500"),children:g})]})}));export{v as a};
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-UZ3SBSKA.js';import {a as a$2}from'./chunk-JW7HS6NX.js';import {q,d,g}from'./chunk-QNQELNVU.js';import {a}from'./chunk-OBZIYJO7.js';import {useListCollection,useCombobox,Combobox,useComboboxContext}from'@ark-ui/react/combobox';import {useFilter}from'@ark-ui/react/locale';import {Portal}from'@ark-ui/react/portal';import {useRef,useCallback,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var X=({title:n,titleLines:a$1=2,description:r,descriptionLines:p=1,Icon:m,iconAsColumn:i=true,className:s,...u})=>jsxs("div",{className:a("flex gap-2 py-4 pr-6 pl-4",i&&"flex-col items-center gap-1",!i&&!r&&"items-center",s),...u,children:[m&&jsx(m,{className:a("shrink-0 text-neutral-300"),size:24}),jsxs("div",{className:a("flex flex-col gap-1",i&&"text-center"),children:[jsx("p",{className:a("leading-[130%] text-neutral-500",!!r&&"font-medium"),style:a$1?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:a$1}:void 0,children:n}),r&&jsx("p",{className:"text-sm leading-[130%] text-neutral-500",style:p?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:p}:void 0,children:r})]})]}),V=X;function $(){let n=useComboboxContext(),a=useRef(false);return n.value.length&&n.collection.size&&!a.current&&(n.syncSelectedItems(),a.current=true),null}var fe=n=>{let{label:a$3,error:r,required:p,tooltip:m,readOnly:i,options:s,onInputValueChange:u,onSelect:d$1,defaultValue:C,helperText:k,noResultsTitle:A,noResultsDescription:E,noResultsIcon:D,noResultsTitleLines:M,noResultsDescriptionLines:z,value:N,className:B,...F}=n,H=Object.getOwnPropertyNames(n),b=useRef(null),{contains:G}=useFilter({sensitivity:"base"}),{collection:g$1,filter:f,set:W}=useListCollection({initialItems:[],itemToString:t=>t.label,itemToValue:t=>String(t.value),filter:G}),j=useCallback(t=>{let w=s.find(K=>String(K.value)===t.itemValue);w&&d$1?.(w);},[d$1,s]),h=useCallback(t=>{f(t.inputValue),t.reason!==void 0&&u?.(t.inputValue??"");},[f,u]),q$1=useCombobox({collection:g$1,defaultValue:C?[String(C)]:void 0,placeholder:n.placeholder,inputValue:n.inputValue,onInputValueChange:h,value:H.includes("value")?N?[String(N)]:[]:void 0,onSelect:j,inputBehavior:"autocomplete",openOnClick:true,...F}),U=useCallback(()=>{d$1?.(null),h?.({inputValue:"",reason:"clear-trigger"});},[d$1,u]);return useEffect(()=>{W(s);},[s]),useEffect(()=>{b.current&&b.current.value===""&&f("");},[f,b.current?.value]),jsxs(Combobox.RootProvider,{value:q$1,"data-error":r,className:a("group flex flex-col",B),children:[jsx(a$1,{as:Combobox.Label,label:a$3,required:p,tooltip:m}),jsx($,{}),jsxs(Combobox.Control,{className:a("group/control data-focus:ring-primary-800 group-data-[error=true]:ring-error-500 relative flex h-10 w-full items-center justify-between gap-2 overflow-hidden rounded-lg bg-neutral-50 px-3 ring ring-neutral-500 transition-shadow ring-inset group-data-readonly:bg-neutral-100 group-data-readonly:ring-neutral-300 group-data-[error=true]:ring-2 has-focus:ring-2 data-disabled:ring-neutral-400",i&&"pointer-events-none"),children:[jsx(Combobox.Input,{className:a("font-inter flex w-full justify-between text-left text-sm text-neutral-900 outline-0 group-data-disabled/control:text-neutral-400 disabled:cursor-not-allowed data-placeholder-shown:text-neutral-500",i&&"pointer-events-none",r&&"pr-16"),ref:b}),r&&jsx(q,{className:"text-error-500 size-4.5 shrink-0"}),!i&&jsx(Combobox.ClearTrigger,{className:"cursor-pointer",onClick:U,children:jsx(d,{className:"size-4.5"})}),jsx(Combobox.Trigger,{className:"cursor-pointer group-data-disabled/control:cursor-not-allowed group-data-disabled/control:text-neutral-400",children:jsx(g,{className:"size-4.5 transition-transform will-change-transform group-data-[state=open]/control:rotate-180"})})]}),jsx("p",{className:"font-inter text-2xs group-data-[error=true]:text-error-500 mt-1 leading-[133.33%] font-normal text-neutral-700 peer-data-disabled:text-neutral-400 empty:hidden",children:k}),jsx(Portal,{children:jsx(Combobox.Positioner,{className:"z-10000!",children:jsx(Combobox.Content,{className:"elevation-9 max-h-67.5 min-w-27.5 overflow-auto rounded-lg bg-neutral-50",children:jsxs(Combobox.ItemGroup,{children:[g$1.items.length>0&&g$1.items.map(t=>jsx(Combobox.Item,{item:t,className:"font-inter data-highlighted:bg-primary-100 block w-full cursor-pointer p-3 data-disabled:cursor-not-allowed data-disabled:text-neutral-400",children:jsx(Combobox.ItemText,{className:"flex w-full min-w-0 flex-col gap-1",asChild:true,children:jsxs("div",{className:"w-full min-w-0",children:[jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[jsx("p",{className:"min-w-0 flex-1 truncate text-sm leading-[130%] font-medium",children:t.label}),t.badgeExpandable&&jsx("div",{className:"flex shrink-0 justify-end overflow-visible",children:jsx(a$2,{size:"sm",...t.badgeExpandable})})]}),t.description&&jsx("p",{className:"text-xs leading-[130%]",children:t.description})]})})},t.value)),g$1.items.length===0&&jsx(V,{title:A,description:E,Icon:D,descriptionLines:z,titleLines:M})]})})})})]})};export{V as a,fe as b};
1
+ import {a as a$1}from'./chunk-BJ5MXTGP.js';import {a as a$2}from'./chunk-JW7HS6NX.js';import {q,d,g}from'./chunk-QNQELNVU.js';import {a}from'./chunk-OBZIYJO7.js';import {useListCollection,useCombobox,Combobox,useComboboxContext}from'@ark-ui/react/combobox';import {useFilter}from'@ark-ui/react/locale';import {Portal}from'@ark-ui/react/portal';import {useRef,useCallback,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var X=({title:n,titleLines:a$1=2,description:r,descriptionLines:p=1,Icon:m,iconAsColumn:i=true,className:s,...u})=>jsxs("div",{className:a("flex gap-2 py-4 pr-6 pl-4",i&&"flex-col items-center gap-1",!i&&!r&&"items-center",s),...u,children:[m&&jsx(m,{className:a("shrink-0 text-neutral-300"),size:24}),jsxs("div",{className:a("flex flex-col gap-1",i&&"text-center"),children:[jsx("p",{className:a("leading-[130%] text-neutral-500",!!r&&"font-medium"),style:a$1?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:a$1}:void 0,children:n}),r&&jsx("p",{className:"text-sm leading-[130%] text-neutral-500",style:p?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:p}:void 0,children:r})]})]}),V=X;function $(){let n=useComboboxContext(),a=useRef(false);return n.value.length&&n.collection.size&&!a.current&&(n.syncSelectedItems(),a.current=true),null}var fe=n=>{let{label:a$3,error:r,required:p,tooltip:m,readOnly:i,options:s,onInputValueChange:u,onSelect:d$1,defaultValue:C,helperText:k,noResultsTitle:A,noResultsDescription:E,noResultsIcon:D,noResultsTitleLines:M,noResultsDescriptionLines:z,value:N,className:B,...F}=n,H=Object.getOwnPropertyNames(n),b=useRef(null),{contains:G}=useFilter({sensitivity:"base"}),{collection:g$1,filter:f,set:W}=useListCollection({initialItems:[],itemToString:t=>t.label,itemToValue:t=>String(t.value),filter:G}),j=useCallback(t=>{let w=s.find(K=>String(K.value)===t.itemValue);w&&d$1?.(w);},[d$1,s]),h=useCallback(t=>{f(t.inputValue),t.reason!==void 0&&u?.(t.inputValue??"");},[f,u]),q$1=useCombobox({collection:g$1,defaultValue:C?[String(C)]:void 0,placeholder:n.placeholder,inputValue:n.inputValue,onInputValueChange:h,value:H.includes("value")?N?[String(N)]:[]:void 0,onSelect:j,inputBehavior:"autocomplete",openOnClick:true,...F}),U=useCallback(()=>{d$1?.(null),h?.({inputValue:"",reason:"clear-trigger"});},[d$1,u]);return useEffect(()=>{W(s);},[s]),useEffect(()=>{b.current&&b.current.value===""&&f("");},[f,b.current?.value]),jsxs(Combobox.RootProvider,{value:q$1,"data-error":r,className:a("group flex flex-col",B),children:[jsx(a$1,{as:Combobox.Label,label:a$3,required:p,tooltip:m}),jsx($,{}),jsxs(Combobox.Control,{className:a("group/control data-focus:ring-primary-800 group-data-[error=true]:ring-error-500 relative flex h-10 w-full items-center justify-between gap-2 overflow-hidden rounded-lg bg-neutral-50 px-3 ring ring-neutral-500 transition-shadow ring-inset group-data-readonly:bg-neutral-100 group-data-readonly:ring-neutral-300 group-data-[error=true]:ring-2 has-focus:ring-2 data-disabled:ring-neutral-400",i&&"pointer-events-none"),children:[jsx(Combobox.Input,{className:a("font-inter flex w-full justify-between text-left text-sm text-neutral-900 outline-0 group-data-disabled/control:text-neutral-400 disabled:cursor-not-allowed data-placeholder-shown:text-neutral-500",i&&"pointer-events-none",r&&"pr-16"),ref:b}),r&&jsx(q,{className:"text-error-500 size-4.5 shrink-0"}),!i&&jsx(Combobox.ClearTrigger,{className:"cursor-pointer",onClick:U,children:jsx(d,{className:"size-4.5"})}),jsx(Combobox.Trigger,{className:"cursor-pointer group-data-disabled/control:cursor-not-allowed group-data-disabled/control:text-neutral-400",children:jsx(g,{className:"size-4.5 transition-transform will-change-transform group-data-[state=open]/control:rotate-180"})})]}),jsx("p",{className:"font-inter text-2xs group-data-[error=true]:text-error-500 mt-1 leading-[133.33%] font-normal text-neutral-700 peer-data-disabled:text-neutral-400 empty:hidden",children:k}),jsx(Portal,{children:jsx(Combobox.Positioner,{className:"z-10000!",children:jsx(Combobox.Content,{className:"elevation-9 max-h-67.5 min-w-27.5 overflow-auto rounded-lg bg-neutral-50",children:jsxs(Combobox.ItemGroup,{children:[g$1.items.length>0&&g$1.items.map(t=>jsx(Combobox.Item,{item:t,className:"font-inter data-highlighted:bg-primary-100 block w-full cursor-pointer p-3 data-disabled:cursor-not-allowed data-disabled:text-neutral-400",children:jsx(Combobox.ItemText,{className:"flex w-full min-w-0 flex-col gap-1",asChild:true,children:jsxs("div",{className:"w-full min-w-0",children:[jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[jsx("p",{className:"min-w-0 flex-1 truncate text-sm leading-[130%] font-medium",children:t.label}),t.badgeExpandable&&jsx("div",{className:"flex shrink-0 justify-end overflow-visible",children:jsx(a$2,{size:"sm",...t.badgeExpandable})})]}),t.description&&jsx("p",{className:"text-xs leading-[130%]",children:t.description})]})})},t.value)),g$1.items.length===0&&jsx(V,{title:A,description:E,Icon:D,descriptionLines:z,titleLines:M})]})})})})]})};export{V as a,fe as b};
@@ -1 +1 @@
1
- import {a}from'./chunk-UZ3SBSKA.js';import {RadioGroupRoot,RadioGroupLabel,RadioGroupItem,RadioGroupItemControl,RadioGroupItemText,RadioGroupItemHiddenInput}from'@ark-ui/react/radio-group';import {forwardRef,useCallback}from'react';import {tv}from'tailwind-variants';import {jsxs,jsx}from'react/jsx-runtime';var E=["horizontal","vertical"];var N=tv({slots:{item:["group/item flex items-center gap-1.5","data-disabled:cursor-not-allowed"],control:["relative size-4.5 rounded-full border ring-inset","before:absolute before:h-full before:w-full before:rounded-full before:border-3 before:border-transparent","border-neutral-700 bg-neutral-50","data-[state=unchecked]:group-hover/item:[&:not([data-disabled])]:border-primary-700","data-[state=unchecked]:group-hover/item:[&:not([data-disabled])]:bg-primary-200","data-[state=checked]:border-primary-600","data-[state=checked]:bg-primary-600","data-[state=checked]:before:border-neutral-50","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:border-primary-700","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:bg-primary-700","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:before:ring-transparent-primary-400-40","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:before:ring-3","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:after:absolute","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:after:h-full","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:after:w-full","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:after:rounded-full","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:after:border-3","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:after:border-transparent-primary-400-40","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:after:bg-transparent","focus:border-2","focus:border-primary-800","data-[state=checked]:focus:before:bg-primary-800","data-disabled:border-neutral-300","data-disabled:bg-neutral-100","data-disabled:data-[state=checked]:border-neutral-300","data-disabled:data-[state=checked]:bg-neutral-100","data-disabled:data-[state=checked]:before:bg-neutral-300"],text:["font-inter text-sm leading-[143%]","text-neutral-900","group-data-[error=true]:text-error-500","data-disabled:text-neutral-400"]}}),C=tv({base:"group",variants:{labelOrientation:{horizontal:"flex gap-4.5",vertical:"flex flex-col gap-4.5"}}}),L=tv({base:"flex",variants:{orientation:{horizontal:"flex-wrap gap-8.5",vertical:"flex-col gap-5"}}}),z=forwardRef(({className:d,innerClassName:a$1,orientation:t="horizontal",labelOrientation:i="vertical",onValueChange:r,error:l,label:o,required:s,tooltip:c,children:b,...h},f)=>{let g=useCallback(R=>{r?.(R.value);},[r]);return jsxs(RadioGroupRoot,{"data-error":l,className:C({className:d,labelOrientation:i}),orientation:t,ref:f,onValueChange:g,...h,children:[o&&jsx(a,{as:RadioGroupLabel,label:o,required:s,tooltip:c,className:"mb-0"}),jsx("div",{className:L({orientation:t,className:a$1}),children:b})]})});z.displayName="RadioGroup";var O=forwardRef(({value:d,label:a,className:t,...i},r)=>{let{item:l,control:o,text:s}=N();return jsxs(RadioGroupItem,{value:d,className:l({className:t}),ref:r,...i,children:[jsx(RadioGroupItemControl,{className:o()}),a&&jsx(RadioGroupItemText,{className:s(),children:a}),jsx(RadioGroupItemHiddenInput,{})]})});O.displayName="RadioGroupItem";export{E as a,z as b,O as c};
1
+ import {a}from'./chunk-BJ5MXTGP.js';import {RadioGroupRoot,RadioGroupLabel,RadioGroupItem,RadioGroupItemControl,RadioGroupItemText,RadioGroupItemHiddenInput}from'@ark-ui/react/radio-group';import {forwardRef,useCallback}from'react';import {tv}from'tailwind-variants';import {jsxs,jsx}from'react/jsx-runtime';var E=["horizontal","vertical"];var N=tv({slots:{item:["group/item flex items-center gap-1.5","data-disabled:cursor-not-allowed"],control:["relative size-4.5 rounded-full border ring-inset","before:absolute before:h-full before:w-full before:rounded-full before:border-3 before:border-transparent","border-neutral-700 bg-neutral-50","data-[state=unchecked]:group-hover/item:[&:not([data-disabled])]:border-primary-700","data-[state=unchecked]:group-hover/item:[&:not([data-disabled])]:bg-primary-200","data-[state=checked]:border-primary-600","data-[state=checked]:bg-primary-600","data-[state=checked]:before:border-neutral-50","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:border-primary-700","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:bg-primary-700","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:before:ring-transparent-primary-400-40","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:before:ring-3","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:after:absolute","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:after:h-full","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:after:w-full","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:after:rounded-full","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:after:border-3","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:after:border-transparent-primary-400-40","data-[state=checked]:group-hover/item:[&:not([data-disabled])]:after:bg-transparent","focus:border-2","focus:border-primary-800","data-[state=checked]:focus:before:bg-primary-800","data-disabled:border-neutral-300","data-disabled:bg-neutral-100","data-disabled:data-[state=checked]:border-neutral-300","data-disabled:data-[state=checked]:bg-neutral-100","data-disabled:data-[state=checked]:before:bg-neutral-300"],text:["font-inter text-sm leading-[143%]","text-neutral-900","group-data-[error=true]:text-error-500","data-disabled:text-neutral-400"]}}),C=tv({base:"group",variants:{labelOrientation:{horizontal:"flex gap-4.5",vertical:"flex flex-col gap-4.5"}}}),L=tv({base:"flex",variants:{orientation:{horizontal:"flex-wrap gap-8.5",vertical:"flex-col gap-5"}}}),z=forwardRef(({className:d,innerClassName:a$1,orientation:t="horizontal",labelOrientation:i="vertical",onValueChange:r,error:l,label:o,required:s,tooltip:c,children:b,...h},f)=>{let g=useCallback(R=>{r?.(R.value);},[r]);return jsxs(RadioGroupRoot,{"data-error":l,className:C({className:d,labelOrientation:i}),orientation:t,ref:f,onValueChange:g,...h,children:[o&&jsx(a,{as:RadioGroupLabel,label:o,required:s,tooltip:c,className:"mb-0"}),jsx("div",{className:L({orientation:t,className:a$1}),children:b})]})});z.displayName="RadioGroup";var O=forwardRef(({value:d,label:a,className:t,...i},r)=>{let{item:l,control:o,text:s}=N();return jsxs(RadioGroupItem,{value:d,className:l({className:t}),ref:r,...i,children:[jsx(RadioGroupItemControl,{className:o()}),a&&jsx(RadioGroupItemText,{className:s(),children:a}),jsx(RadioGroupItemHiddenInput,{})]})});O.displayName="RadioGroupItem";export{E as a,z as b,O as c};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-KTD2GEB6.js';import {a as a$1}from'./chunk-OBZIYJO7.js';import {jsxs,jsx}from'react/jsx-runtime';var m=({className:l})=>jsxs("div",{className:a$1("flex w-full flex-col gap-2",l),children:[jsx(a,{className:"h-4 w-15 rounded-sm"}),jsx(a,{className:"h-10 w-full rounded-lg"})]});export{m as a};
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-GFVJRSZI.js';import {a as a$2}from'./chunk-VFP3D5WF.js';import {o}from'./chunk-QNQELNVU.js';import {a as a$3}from'./chunk-OBZIYJO7.js';import {useState,useRef,useMemo,useEffect}from'react';import*as k from'@radix-ui/react-portal';import {format}from'date-fns';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var D=["00:00:00","00:30:00","01:00:00","01:30:00","02:00:00","02:30:00","03:00:00","03:30:00","04:00:00","04:30:00","05:00:00","05:30:00","06:00:00","06:30:00","07:00:00","07:30:00","08:00:00","08:30:00","09:00:00","09:30:00","10:00:00","10:30:00","11:00:00","11:30:00","12:00:00","12:30:00","13:00:00","13:30:00","14:00:00","14:30:00","15:00:00","15:30:00","16:00:00","16:30:00","17:00:00","17:30:00","18:00:00","18:30:00","19:00:00","19:30:00","20:00:00","20:30:00","21:00:00","21:30:00","22:00:00","22:30:00","23:00:00","23:30:00"],v=56,a=6,_=({value:c,onChange:h,locale:b,minTime:p,maxTime:u,...R})=>{let[F,m]=useState(false),[i,f]=useState(c),[o$1,P]=useState(),[O,M]=useState("bottom"),w=useRef(null),t=useRef(null),N=e=>{f(e),h?.(e),m(false);},z=useMemo(()=>i?format(new Date("2024-01-01T"+i),"p"):"",[i,b]),H=()=>{f(void 0),h?.(void 0);},n=useMemo(()=>D.map(e=>({value:e,label:format(new Date("2024-01-01T"+e),"p"),disabled:p&&e<p||u&&e>u})),[b,p,u]);return useEffect(()=>{f(c);},[c]),a$1(w,()=>{m(false);}),useEffect(()=>{if(!t.current)return;let e=()=>{if(!t.current)return;let l=v*(n.length<a?n.length:a)+16,s=t.current.getBoundingClientRect();P(s);let S=window.innerHeight-s.bottom>l,B=s.top+s.height>l;M(S?"bottom":B?"top":"bottom");};return e(),t.current.addEventListener("mousedown",e),window.addEventListener("scroll",e,true),window.addEventListener("resize",e),()=>{t.current?.removeEventListener("mousedown",e),window.removeEventListener("scroll",e,true),window.removeEventListener("resize",e);}},[t.current]),jsxs(Fragment,{children:[jsx(a$2,{ref:t,autoComplete:"off",startIcon:jsx(o,{}),onClean:H,readOnly:true,value:z,onClick:e=>{P(e.currentTarget.getBoundingClientRect()),m(l=>!l);},...R}),jsx(k.Root,{children:jsx("div",{ref:w,className:a$3("elevation-8 pointer-events-auto fixed z-50 my-2 hidden max-h-84 w-full flex-col overflow-y-auto rounded-lg bg-neutral-50",F&&"block"),style:o$1?{width:`${o$1.width}px`,top:O==="bottom"?`${o$1.height+o$1.top}px`:o$1.top-(n.length<a?n.length:a)*v-16,left:o$1?.left}:void 0,children:n.map(e=>jsx("div",{onClick:()=>!e.disabled&&N(e.value),className:a$3("flex w-full items-center px-2 hover:cursor-pointer",!e.disabled&&"hover:bg-primary-100",i===e.value&&"bg-primary-200",e.disabled&&"text-neutral-500 hover:cursor-not-allowed"),style:{height:v},children:e.label},e.value))})})]})};_.displayName="TimePicker";export{_ as a};
1
+ import {a as a$1}from'./chunk-GFVJRSZI.js';import {a as a$2}from'./chunk-A2VW62QH.js';import {o}from'./chunk-QNQELNVU.js';import {a as a$3}from'./chunk-OBZIYJO7.js';import {useState,useRef,useMemo,useEffect}from'react';import*as k from'@radix-ui/react-portal';import {format}from'date-fns';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var D=["00:00:00","00:30:00","01:00:00","01:30:00","02:00:00","02:30:00","03:00:00","03:30:00","04:00:00","04:30:00","05:00:00","05:30:00","06:00:00","06:30:00","07:00:00","07:30:00","08:00:00","08:30:00","09:00:00","09:30:00","10:00:00","10:30:00","11:00:00","11:30:00","12:00:00","12:30:00","13:00:00","13:30:00","14:00:00","14:30:00","15:00:00","15:30:00","16:00:00","16:30:00","17:00:00","17:30:00","18:00:00","18:30:00","19:00:00","19:30:00","20:00:00","20:30:00","21:00:00","21:30:00","22:00:00","22:30:00","23:00:00","23:30:00"],v=56,a=6,_=({value:c,onChange:h,locale:b,minTime:p,maxTime:u,...R})=>{let[F,m]=useState(false),[i,f]=useState(c),[o$1,P]=useState(),[O,M]=useState("bottom"),w=useRef(null),t=useRef(null),N=e=>{f(e),h?.(e),m(false);},z=useMemo(()=>i?format(new Date("2024-01-01T"+i),"p"):"",[i,b]),H=()=>{f(void 0),h?.(void 0);},n=useMemo(()=>D.map(e=>({value:e,label:format(new Date("2024-01-01T"+e),"p"),disabled:p&&e<p||u&&e>u})),[b,p,u]);return useEffect(()=>{f(c);},[c]),a$1(w,()=>{m(false);}),useEffect(()=>{if(!t.current)return;let e=()=>{if(!t.current)return;let l=v*(n.length<a?n.length:a)+16,s=t.current.getBoundingClientRect();P(s);let S=window.innerHeight-s.bottom>l,B=s.top+s.height>l;M(S?"bottom":B?"top":"bottom");};return e(),t.current.addEventListener("mousedown",e),window.addEventListener("scroll",e,true),window.addEventListener("resize",e),()=>{t.current?.removeEventListener("mousedown",e),window.removeEventListener("scroll",e,true),window.removeEventListener("resize",e);}},[t.current]),jsxs(Fragment,{children:[jsx(a$2,{ref:t,autoComplete:"off",startIcon:jsx(o,{}),onClean:H,readOnly:true,value:z,onClick:e=>{P(e.currentTarget.getBoundingClientRect()),m(l=>!l);},...R}),jsx(k.Root,{children:jsx("div",{ref:w,className:a$3("elevation-8 pointer-events-auto fixed z-50 my-2 hidden max-h-84 w-full flex-col overflow-y-auto rounded-lg bg-neutral-50",F&&"block"),style:o$1?{width:`${o$1.width}px`,top:O==="bottom"?`${o$1.height+o$1.top}px`:o$1.top-(n.length<a?n.length:a)*v-16,left:o$1?.left}:void 0,children:n.map(e=>jsx("div",{onClick:()=>!e.disabled&&N(e.value),className:a$3("flex w-full items-center px-2 hover:cursor-pointer",!e.disabled&&"hover:bg-primary-100",i===e.value&&"bg-primary-200",e.disabled&&"text-neutral-500 hover:cursor-not-allowed"),style:{height:v},children:e.label},e.value))})})]})};_.displayName="TimePicker";export{_ as a};
@@ -1 +1 @@
1
- import {a}from'./chunk-GFVJRSZI.js';import {a as a$1}from'./chunk-VFP3D5WF.js';import {a as a$2}from'./chunk-CYV6IFY6.js';import {n}from'./chunk-QNQELNVU.js';import {a as a$3}from'./chunk-OBZIYJO7.js';import {useState,useRef,useMemo,useCallback,useEffect}from'react';import*as x from'@radix-ui/react-portal';import {format}from'date-fns';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var $=({value:d,onChange:m,locale:w,disabledDates:D,disabled:E,...L})=>{let[c,f]=useState(false),[a$4,u]=useState(d),[n$1,P]=useState(),[R,F]=useState("bottom"),[k,y]=useState(0),o=useRef(null),r=useRef(null);a(o,()=>{f(false);});let H=t=>{u(t),m?.(t);},z=useMemo(()=>a$4?format(a$4,"P"):"",[a$4]),I=()=>{u(void 0),m?.(void 0);},e=useCallback(()=>{if(!r.current)return;let t=r.current.getBoundingClientRect();if(!o.current)return;let i=o.current.getBoundingClientRect().height;y(i),P(t);let N=window.innerHeight-t.bottom>i,B=t.top+t.height>i;F(N?"bottom":B?"top":"bottom");},[r.current,o.current]);return useEffect(()=>{u(d);},[d]),useEffect(()=>{if(r?.current)return e(),r.current.addEventListener("mousedown",e),r.current.addEventListener("input",e),window.addEventListener("scroll",e,true),window.addEventListener("resize",e),()=>{r.current?.removeEventListener("mousedown",e),r.current?.removeEventListener("input",e),window.removeEventListener("scroll",e,true),window.removeEventListener("resize",e);}},[r.current,e]),useEffect(()=>{if(c&&o.current){let t=setTimeout(()=>{e();},0);return ()=>clearTimeout(t)}},[c,e]),jsxs(Fragment,{children:[jsx(a$1,{disabled:E,ref:r,startIcon:jsx(n,{}),onClean:I,readOnly:true,value:z,onClick:t=>{P(t.currentTarget.getBoundingClientRect()),f(i=>!i);},...L}),jsx(x.Root,{asChild:true,children:jsx("div",{ref:o,className:a$3("pointer-events-auto fixed z-50 hidden",c&&"block"),style:n$1?{top:R==="bottom"?`${n$1.height+n$1.y}px`:n$1.top-k,left:n$1?.left}:void 0,children:jsx(a$2,{className:"w-[20rem] max-w-full",mode:"single",selected:a$4,onSelect:H,locale:w,disabled:D})})})]})};$.displayName="DatePicker";export{$ as a};
1
+ import {a}from'./chunk-GFVJRSZI.js';import {a as a$1}from'./chunk-A2VW62QH.js';import {a as a$2}from'./chunk-CYV6IFY6.js';import {n}from'./chunk-QNQELNVU.js';import {a as a$3}from'./chunk-OBZIYJO7.js';import {useState,useRef,useMemo,useCallback,useEffect}from'react';import*as x from'@radix-ui/react-portal';import {format}from'date-fns';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var $=({value:d,onChange:m,locale:w,disabledDates:D,disabled:E,...L})=>{let[c,f]=useState(false),[a$4,u]=useState(d),[n$1,P]=useState(),[R,F]=useState("bottom"),[k,y]=useState(0),o=useRef(null),r=useRef(null);a(o,()=>{f(false);});let H=t=>{u(t),m?.(t);},z=useMemo(()=>a$4?format(a$4,"P"):"",[a$4]),I=()=>{u(void 0),m?.(void 0);},e=useCallback(()=>{if(!r.current)return;let t=r.current.getBoundingClientRect();if(!o.current)return;let i=o.current.getBoundingClientRect().height;y(i),P(t);let N=window.innerHeight-t.bottom>i,B=t.top+t.height>i;F(N?"bottom":B?"top":"bottom");},[r.current,o.current]);return useEffect(()=>{u(d);},[d]),useEffect(()=>{if(r?.current)return e(),r.current.addEventListener("mousedown",e),r.current.addEventListener("input",e),window.addEventListener("scroll",e,true),window.addEventListener("resize",e),()=>{r.current?.removeEventListener("mousedown",e),r.current?.removeEventListener("input",e),window.removeEventListener("scroll",e,true),window.removeEventListener("resize",e);}},[r.current,e]),useEffect(()=>{if(c&&o.current){let t=setTimeout(()=>{e();},0);return ()=>clearTimeout(t)}},[c,e]),jsxs(Fragment,{children:[jsx(a$1,{disabled:E,ref:r,startIcon:jsx(n,{}),onClean:I,readOnly:true,value:z,onClick:t=>{P(t.currentTarget.getBoundingClientRect()),f(i=>!i);},...L}),jsx(x.Root,{asChild:true,children:jsx("div",{ref:o,className:a$3("pointer-events-auto fixed z-50 hidden",c&&"block"),style:n$1?{top:R==="bottom"?`${n$1.height+n$1.y}px`:n$1.top-k,left:n$1?.left}:void 0,children:jsx(a$2,{className:"w-[20rem] max-w-full",mode:"single",selected:a$4,onSelect:H,locale:w,disabled:D})})})]})};$.displayName="DatePicker";export{$ as a};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-OBZIYJO7.js';import {forwardRef,useCallback}from'react';import {Popover}from'@ark-ui/react/popover';import {Portal}from'@ark-ui/react/portal';import {jsx}from'react/jsx-runtime';var F=({portalled:n,lazyMount:r=true,autoFocus:i=false,onOpenChange:o,unmountOnExit:e=true,modal:l=true,positioning:d={placement:"bottom-end"},...m})=>{let s=useCallback(g=>{o?.(g.open);},[o]);return jsx(Popover.Root,{portalled:n,positioning:d,lazyMount:r,autoFocus:i,modal:l,onOpenChange:s,unmountOnExit:e,...m})},N=Popover.Trigger,v=forwardRef(({className:n,portalled:r=true,...i},o)=>{let e=jsx(Popover.Positioner,{children:jsx(Popover.Content,{ref:o,className:a("elevation-9 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-sm bg-neutral-50","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[placement=bottom]:origin-top data-[placement=bottom-end]:origin-top-right data-[placement=bottom-start]:origin-top-left","data-[placement=top]:origin-bottom data-[placement=top-end]:origin-bottom-right data-[placement=top-start]:origin-bottom-left","data-[placement=right]:origin-left data-[placement=right-end]:origin-bottom-left data-[placement=right-start]:origin-top-left","data-[placement=left]:origin-right data-[placement=left-end]:origin-bottom-right data-[placement=left-start]:origin-top-right",n),...i})});return r?jsx(Portal,{children:e}):e});v.displayName=Popover.Content.displayName;export{F as a,N as b,v as c};
@@ -1 +1 @@
1
- import {a}from'./chunk-UZ3SBSKA.js';import {d,q,v}from'./chunk-QNQELNVU.js';import {a as a$1}from'./chunk-OBZIYJO7.js';import {Portal}from'@ark-ui/react/portal';import {createListCollection,Select}from'@ark-ui/react/select';import {forwardRef,useMemo,useCallback}from'react';import {jsxs,jsx}from'react/jsx-runtime';var z=["00:00","00:30","01:00","01:30","02:00","02:30","03:00","03:30","04:00","04:30","05:00","05:30","06:00","06:30","07:00","07:30","08:00","08:30","09:00","09:30","10:00","10:30","11:00","11:30","12:00","12:30","13:00","13:30","14:00","14:30","15:00","15:30","16:00","16:30","17:00","17:30","18:00","18:30","19:00","19:30","20:00","20:30","21:00","21:30","22:00","22:30","23:00","23:30"],D="00:00",F=forwardRef((r,x)=>{let{className:b,label:y,required:w,tooltip:C,error:o,isItemDisabled:i,value:s,helperText:v$1,placeholder:N=D,onValueChange:u,defaultValue:d$1,...P}=r,n=Object.getOwnPropertyNames(r),c=useMemo(()=>createListCollection({items:z,isItemDisabled:i}),[i]),S=useCallback(l=>{u?.(l.value.at(0)??null);},[u]);if(n.includes("defaultValue")&&n.includes("value"))throw new Error("Cannot set both defaultValue and value props on TimePickerNew. Use one or the other.");return jsxs(Select.Root,{ref:x,"data-error":o,collection:c,className:a$1("group flex flex-col",b),positioning:{placement:"bottom-end"},onValueChange:S,value:n.includes("value")?s?[s]:[]:void 0,defaultValue:d$1?[d$1]:void 0,...P,children:[jsx(a,{as:Select.Label,label:y,required:w,tooltip:C}),jsx(Select.Control,{className:a$1("group/control data-[focus]:ring-primary-800 group-data-[error=true]:ring-error-500 relative flex h-10 w-full justify-between overflow-hidden rounded-lg bg-neutral-50 ring ring-neutral-500 transition-shadow group-data-[error=true]:ring-2 group-data-[readonly]:bg-neutral-100 group-data-[readonly]:ring-neutral-300 has-focus:ring-2 data-[disabled]:ring-neutral-400",r.readOnly&&"pointer-events-none"),children:jsxs(Select.Trigger,{className:"flex w-full cursor-pointer items-center gap-1 text-neutral-900 group-data-[disabled]/control:text-neutral-400 disabled:cursor-not-allowed data-[placeholder-shown]:text-neutral-500",children:[jsx(Select.ValueText,{className:a$1("font-inter min-w-0 flex-1 py-2.5 pl-3 text-left text-sm",r.readOnly&&"pointer-events-none"),placeholder:N}),!r.readOnly&&jsx(Select.ClearTrigger,{asChild:true,className:a$1("z-10 cursor-pointer",r.readOnly&&"pointer-events-none"),tabIndex:r.readOnly?-1:void 0,children:jsx(d,{className:"size-4.5 text-neutral-700"})}),o&&jsx(q,{className:"text-error-500 z-10 size-4.5 cursor-pointer"}),jsx(Select.Indicator,{className:a$1("group-data-[focus]/control:ring-primary-800 group-data-[error=true]:ring-error-500 ml-2 flex h-full w-10 shrink-0 items-center justify-center bg-neutral-100 text-neutral-700 ring ring-neutral-500 transition-shadow group-data-[disabled]/control:text-neutral-400 group-data-[disabled]/control:ring-neutral-400 group-data-[error=true]:ring-2 group-data-[focus]/control:ring-2 group-data-[readonly]:text-neutral-400 group-data-[readonly]:ring-neutral-300",r.readOnly&&"pointer-events-none"),tabIndex:r.readOnly?-1:void 0,children:jsx(v,{className:"size-4.5"})})]})}),jsx("p",{className:"font-inter text-2xs group-data-[error=true]:text-error-500 mt-1 leading-[133.33%] font-normal text-neutral-700 peer-data-[disabled]:text-neutral-400 empty:hidden",children:v$1}),jsx(Portal,{children:jsx(Select.Positioner,{className:"!z-10000",children:jsx(Select.Content,{className:"elevation-9 max-h-67.5 min-w-27.5 overflow-auto rounded-lg bg-neutral-50",children:c.items.map(l=>jsx(Select.Item,{item:l,className:"font-inter data-[highlighted]:bg-primary-100 cursor-pointer py-3 pr-2.5 pl-3 text-sm font-medium data-[disabled]:cursor-not-allowed data-[disabled]:text-neutral-400",children:jsx(Select.ItemText,{children:l})},l))})})}),jsx(Select.HiddenSelect,{})]})});export{F as a};
1
+ import {a}from'./chunk-BJ5MXTGP.js';import {d,q,v}from'./chunk-QNQELNVU.js';import {a as a$1}from'./chunk-OBZIYJO7.js';import {Portal}from'@ark-ui/react/portal';import {createListCollection,Select}from'@ark-ui/react/select';import {forwardRef,useMemo,useCallback}from'react';import {jsxs,jsx}from'react/jsx-runtime';var z=["00:00","00:30","01:00","01:30","02:00","02:30","03:00","03:30","04:00","04:30","05:00","05:30","06:00","06:30","07:00","07:30","08:00","08:30","09:00","09:30","10:00","10:30","11:00","11:30","12:00","12:30","13:00","13:30","14:00","14:30","15:00","15:30","16:00","16:30","17:00","17:30","18:00","18:30","19:00","19:30","20:00","20:30","21:00","21:30","22:00","22:30","23:00","23:30"],D="00:00",F=forwardRef((r,x)=>{let{className:b,label:y,required:w,tooltip:C,error:o,isItemDisabled:i,value:s,helperText:v$1,placeholder:N=D,onValueChange:u,defaultValue:d$1,...P}=r,n=Object.getOwnPropertyNames(r),c=useMemo(()=>createListCollection({items:z,isItemDisabled:i}),[i]),S=useCallback(l=>{u?.(l.value.at(0)??null);},[u]);if(n.includes("defaultValue")&&n.includes("value"))throw new Error("Cannot set both defaultValue and value props on TimePickerNew. Use one or the other.");return jsxs(Select.Root,{ref:x,"data-error":o,collection:c,className:a$1("group flex flex-col",b),positioning:{placement:"bottom-end"},onValueChange:S,value:n.includes("value")?s?[s]:[]:void 0,defaultValue:d$1?[d$1]:void 0,...P,children:[jsx(a,{as:Select.Label,label:y,required:w,tooltip:C}),jsx(Select.Control,{className:a$1("group/control data-[focus]:ring-primary-800 group-data-[error=true]:ring-error-500 relative flex h-10 w-full justify-between overflow-hidden rounded-lg bg-neutral-50 ring ring-neutral-500 transition-shadow group-data-[error=true]:ring-2 group-data-[readonly]:bg-neutral-100 group-data-[readonly]:ring-neutral-300 has-focus:ring-2 data-[disabled]:ring-neutral-400",r.readOnly&&"pointer-events-none"),children:jsxs(Select.Trigger,{className:"flex w-full cursor-pointer items-center gap-1 text-neutral-900 group-data-[disabled]/control:text-neutral-400 disabled:cursor-not-allowed data-[placeholder-shown]:text-neutral-500",children:[jsx(Select.ValueText,{className:a$1("font-inter min-w-0 flex-1 py-2.5 pl-3 text-left text-sm",r.readOnly&&"pointer-events-none"),placeholder:N}),!r.readOnly&&jsx(Select.ClearTrigger,{asChild:true,className:a$1("z-10 cursor-pointer",r.readOnly&&"pointer-events-none"),tabIndex:r.readOnly?-1:void 0,children:jsx(d,{className:"size-4.5 text-neutral-700"})}),o&&jsx(q,{className:"text-error-500 z-10 size-4.5 cursor-pointer"}),jsx(Select.Indicator,{className:a$1("group-data-[focus]/control:ring-primary-800 group-data-[error=true]:ring-error-500 ml-2 flex h-full w-10 shrink-0 items-center justify-center bg-neutral-100 text-neutral-700 ring ring-neutral-500 transition-shadow group-data-[disabled]/control:text-neutral-400 group-data-[disabled]/control:ring-neutral-400 group-data-[error=true]:ring-2 group-data-[focus]/control:ring-2 group-data-[readonly]:text-neutral-400 group-data-[readonly]:ring-neutral-300",r.readOnly&&"pointer-events-none"),tabIndex:r.readOnly?-1:void 0,children:jsx(v,{className:"size-4.5"})})]})}),jsx("p",{className:"font-inter text-2xs group-data-[error=true]:text-error-500 mt-1 leading-[133.33%] font-normal text-neutral-700 peer-data-[disabled]:text-neutral-400 empty:hidden",children:v$1}),jsx(Portal,{children:jsx(Select.Positioner,{className:"!z-10000",children:jsx(Select.Content,{className:"elevation-9 max-h-67.5 min-w-27.5 overflow-auto rounded-lg bg-neutral-50",children:c.items.map(l=>jsx(Select.Item,{item:l,className:"font-inter data-[highlighted]:bg-primary-100 cursor-pointer py-3 pr-2.5 pl-3 text-sm font-medium data-[disabled]:cursor-not-allowed data-[disabled]:text-neutral-400",children:jsx(Select.ItemText,{children:l})},l))})})}),jsx(Select.HiddenSelect,{})]})});export{F as a};