sodtrack-web-ui 0.116.6 → 0.116.7

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 (50) hide show
  1. package/dist/{chunk-FCRCSXGX.js → chunk-3ASA7S5Y.js} +1 -1
  2. package/dist/{chunk-VFONTYLU.js → chunk-5S7M3M2C.js} +1 -1
  3. package/dist/{chunk-JTLKG23S.js → chunk-F2W4ZYYU.js} +1 -1
  4. package/dist/{chunk-RVKNHIQ2.js → chunk-F47QUFRU.js} +1 -1
  5. package/dist/{chunk-5237FG7A.js → chunk-HE3NBF5N.js} +1 -1
  6. package/dist/{chunk-GVSX3HGR.js → chunk-IQLMY7FP.js} +1 -1
  7. package/dist/{chunk-4MRD22TC.js → chunk-IS6VA6SN.js} +1 -1
  8. package/dist/chunk-JFNJPH6Q.js +1 -0
  9. package/dist/{chunk-35DVM6TF.js → chunk-OANSRWH2.js} +1 -1
  10. package/dist/{chunk-KRATZQ5F.js → chunk-OEC63AET.js} +1 -1
  11. package/dist/chunk-PF4MVOF5.js +1 -0
  12. package/dist/{chunk-I2DHBGRM.js → chunk-PLR3W3BS.js} +1 -1
  13. package/dist/{chunk-NLOA5PDS.js → chunk-PYOR6KYW.js} +1 -1
  14. package/dist/{chunk-FWNRSQND.js → chunk-YZ2TZLJZ.js} +1 -1
  15. package/dist/components/attachment-card.d.ts +0 -1
  16. package/dist/components/attachment-card.js +1 -1
  17. package/dist/components/button-active.js +1 -1
  18. package/dist/components/button-menu.js +1 -1
  19. package/dist/components/card-basic.d.ts +0 -1
  20. package/dist/components/card-basic.js +1 -1
  21. package/dist/components/card-expandable.d.ts +0 -1
  22. package/dist/components/card-expandable.js +1 -1
  23. package/dist/components/checkbox.d.ts +39 -23
  24. package/dist/components/checkbox.js +1 -1
  25. package/dist/components/data-table.d.ts +0 -1
  26. package/dist/components/data-table.js +1 -1
  27. package/dist/components/drawer.js +1 -1
  28. package/dist/components/index.d.ts +1 -2
  29. package/dist/components/index.js +1 -1
  30. package/dist/components/list-item-arrow.js +1 -1
  31. package/dist/components/list-item-button.js +1 -1
  32. package/dist/components/list-item-checkbox-left.d.ts +0 -1
  33. package/dist/components/list-item-checkbox-left.js +1 -1
  34. package/dist/components/list-item-checkbox.d.ts +0 -1
  35. package/dist/components/list-item-checkbox.js +1 -1
  36. package/dist/components/list-item.d.ts +0 -1
  37. package/dist/components/list-item.js +1 -1
  38. package/dist/components/list-item_old.js +1 -1
  39. package/dist/components/menu.js +1 -1
  40. package/dist/components/note-card.d.ts +0 -1
  41. package/dist/components/note-card.js +1 -1
  42. package/dist/components/radio.d.ts +27 -22
  43. package/dist/components/radio.js +1 -1
  44. package/dist/components/table.d.ts +0 -1
  45. package/dist/components/tracker-item.js +1 -1
  46. package/dist/preferences.js +1 -1
  47. package/dist/styles/index.css +1 -1
  48. package/package.json +1 -1
  49. package/dist/chunk-XJ2YYVZX.js +0 -1
  50. package/dist/chunk-ZCMXCZC2.js +0 -1
@@ -1 +1 @@
1
- import {d as d$1}from'./chunk-YFDUDY6Y.js';import {e as e$1}from'./chunk-PI7DECIN.js';import {d}from'./chunk-QMPBFFFC.js';import {e}from'./chunk-QYA5ZUUN.js';import {a}from'./chunk-OBZIYJO7.js';import {Dialog}from'@ark-ui/react/dialog';import {Portal}from'@ark-ui/react/portal';import {forwardRef,useCallback}from'react';import {jsxs,jsx}from'react/jsx-runtime';var X=({onOpenChange:a,...o})=>{let t=useCallback(r=>{a?.(r.open);},[a]);return jsx(Dialog.Root,{unmountOnExit:true,lazyMount:true,onOpenChange:t,...o})},q=Dialog.Trigger,G=["sm","md","lg","xl"],P=forwardRef(({children:a$1,className:o,size:t="sm",...r},l)=>jsxs(Portal,{children:[jsx(Dialog.Backdrop,{className:"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-layer fixed inset-0 bg-neutral-900/60"}),jsx(Dialog.Positioner,{className:"z-layer fixed top-0 left-0 flex h-dvh w-dvw items-center justify-end",children:jsx(Dialog.Content,{ref:l,className:a("elevation-10 z-layer data-[state=closed]:animate-swipe-out data-[state=open]:animate-slide-in h-full bg-neutral-50",t==="sm"&&"w-117.5",t==="md"&&"w-187",t==="lg"&&"w-235",t==="xl"&&"w-312",o),...r,children:jsx("div",{className:"flex h-full flex-1 flex-col",children:a$1})})})]}));P.displayName="DrawerContent";var T=forwardRef(({children:a$1,className:o,title:t,buttons:r=[],Icon:l,description:d$2,overline:c,...v},y)=>jsxs("div",{className:a("border-b border-neutral-200 pt-2 pb-2.75 pl-4",o),ref:y,...v,children:[jsx(Dialog.CloseTrigger,{asChild:true,children:jsx(d,{className:"mr-2 ml-auto size-4.5 cursor-pointer"})}),c&&jsx("p",{className:"mt-1 line-clamp-1 text-xs leading-[133.33%] text-neutral-700 uppercase",children:c}),jsxs("div",{className:"mt-1 mr-4 flex items-center justify-between gap-3",children:[l&&jsx(d$1,{icon:l,size:"md",variant:"light",color:"primary"}),jsx(Dialog.Title,{className:"font-jakarta line-clamp-1 flex-1 text-xl leading-[140%] font-semibold break-all text-neutral-900",children:t}),!Array.isArray(r)&&r.visible!==false&&jsx(e,{size:"md",variant:"ghost",...(({visible:g,...m})=>m)(r)}),Array.isArray(r)&&jsx("div",{className:"flex gap-1",children:r.map(({visible:g=true,...m},C)=>g?jsx(e$1,{variant:"ghost",size:"md",...m},C):null)})]}),d$2&&jsx(Dialog.Description,{className:"font-inter mt-1 mr-4 line-clamp-2 text-sm leading-[143%] text-neutral-800",children:d$2})]}));T.displayName="DrawerHeader";var H=forwardRef(({children:a$1,className:o,...t},r)=>jsx("div",{className:a("flex justify-end gap-3 border-t border-neutral-200 p-4.5",o),ref:r,...t,children:a$1}));H.displayName="DrawerFooter";var h=forwardRef(({children:a$1,className:o,...t},r)=>jsx("div",{className:a("h-full overflow-y-auto p-4",o),ref:r,...t,children:a$1}));h.displayName="DrawerBody";var J=Dialog.CloseTrigger;export{X as a,q as b,G as c,P as d,T as e,H as f,h as g,J as h};
1
+ import {d as d$1}from'./chunk-YFDUDY6Y.js';import {e as e$1}from'./chunk-PI7DECIN.js';import {d}from'./chunk-QMPBFFFC.js';import {e}from'./chunk-QYA5ZUUN.js';import {a}from'./chunk-OBZIYJO7.js';import {Dialog}from'@ark-ui/react/dialog';import {Portal}from'@ark-ui/react/portal';import {forwardRef,useCallback}from'react';import {jsxs,jsx}from'react/jsx-runtime';var X=({onOpenChange:a,...o})=>{let t=useCallback(r=>{a?.(r.open);},[a]);return jsx(Dialog.Root,{unmountOnExit:true,lazyMount:true,onOpenChange:t,...o})},q=Dialog.Trigger,G=["sm","md","lg","xl"],P=forwardRef(({children:a$1,className:o,size:t="sm",...r},l)=>jsxs(Portal,{children:[jsx(Dialog.Backdrop,{className:"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-layer fixed inset-0 bg-neutral-900/60"}),jsx(Dialog.Positioner,{className:"z-layer fixed top-0 left-0 flex h-dvh w-dvw items-center justify-end",children:jsx(Dialog.Content,{ref:l,className:a("elevation-10 z-layer data-[state=closed]:animate-swipe-out data-[state=open]:animate-slide-in h-full bg-neutral-50",t==="sm"&&"w-117.5",t==="md"&&"w-187",t==="lg"&&"w-235",t==="xl"&&"w-312",o),...r,children:jsx("div",{className:"flex h-full flex-1 flex-col",children:a$1})})})]}));P.displayName="DrawerContent";var T=forwardRef(({children:a$1,className:o,title:t,buttons:r=[],Icon:l,description:d$2,overline:c,...v},y)=>jsxs("div",{className:a("border-b border-neutral-200 pt-2 pb-2.75 pl-4",o),ref:y,...v,children:[jsx(Dialog.CloseTrigger,{asChild:true,children:jsx(d,{className:"mr-2 ml-auto size-4.5 cursor-pointer"})}),c&&jsx("p",{className:"mt-1 line-clamp-1 text-xs leading-[133.33%] text-neutral-700 uppercase",children:c}),jsxs("div",{className:"mt-1 mr-4 flex items-center justify-between gap-3",children:[l&&jsx(d$1,{icon:l,size:"md",variant:"light",color:"primary"}),jsx(Dialog.Title,{className:"font-jakarta line-clamp-1 flex-1 text-xl leading-[140%] font-semibold break-all text-neutral-900",children:t}),!Array.isArray(r)&&r.visible!==false&&jsx(e,{size:"md",variant:"ghost",...(({visible:g,...m})=>m)(r)}),Array.isArray(r)&&jsx("div",{className:"flex gap-1",children:r.map(({visible:g=true,...m},b)=>g?jsx(e$1,{variant:"ghost",size:"md",...m},b):null)})]}),d$2&&jsx(Dialog.Description,{className:"font-inter mt-1 mr-4 line-clamp-2 text-sm leading-[143%] text-neutral-800",children:d$2})]}));T.displayName="DrawerHeader";var H=forwardRef(({children:a$1,className:o,...t},r)=>jsx("div",{className:a("flex justify-end gap-3 border-t border-neutral-200 p-4.5",o),ref:r,...t,children:a$1}));H.displayName="DrawerFooter";var h=forwardRef(({children:a$1,className:o,...t},r)=>jsx("div",{className:a("h-full overflow-y-auto p-4 [scrollbar-gutter:stable]",o),ref:r,...t,children:a$1}));h.displayName="DrawerBody";var J=Dialog.CloseTrigger;export{X as a,q as b,G as c,P as d,T as e,H as f,h as g,J as h};
@@ -1 +1 @@
1
- import {e,i,f,a as a$1,b,c,g,h,d,j as j$1}from'./chunk-6M7NDF3Y.js';import {a as a$5,b as b$1,c as c$2}from'./chunk-GTVHYHF4.js';import {a as a$3}from'./chunk-KTD2GEB6.js';import {c as c$1}from'./chunk-ZCMXCZC2.js';import {a as a$2}from'./chunk-3RNV3YTB.js';import {e as e$1,B,I,H,r,G,F,E,D,y,z,A,f as f$1,C}from'./chunk-QMPBFFFC.js';import {a as a$4}from'./chunk-ICF6RQIW.js';import {e as e$2}from'./chunk-QYA5ZUUN.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 {jsx,jsxs}from'react/jsx-runtime';var X={alert:{Icon:C,bgClassName:"bg-orange-50 hover:bg-orange-100",iconClassName:"text-orange-700"},incident:{Icon:f$1,bgClassName:"bg-warning-100 hover:bg-warning-200",iconClassName:"text-warning-900"},"no-address":{Icon:A,bgClassName:"bg-coral-50 hover:bg-coral-100",iconClassName:"text-coral-700"},"email-alert":{Icon:z,bgClassName:"bg-danger-100 hover:bg-danger-200",iconClassName:"text-danger-700"},superadmin:{Icon:y,bgClassName:"bg-orchid-100 hover:bg-orchid-200",iconClassName:"text-orchid-700"},bundle:{Icon:D,bgClassName:"bg-aqua-100 hover:bg-aqua-200",iconClassName:"text-aqua-800"},variants:{Icon:a$4,bgClassName:"bg-bubblegum-50 hover:bg-bubblegum-100",iconClassName:"text-bubblegum-700"},providers:{Icon:E,bgClassName:"bg-pink-50 hover:bg-pink-200",iconClassName:"text-pink-700"},"transaction-request":{Icon:F,bgClassName:"bg-green-100 hover:bg-green-200",iconClassName:"text-green-800"},design:{Icon:G,bgClassName:"bg-orange-50 hover:bg-orange-100",iconClassName:"text-orange-700"},error:{Icon:r,bgClassName:"bg-danger-100 hover:bg-danger-200",iconClassName:"text-danger-700"},draft:{Icon:H,bgClassName:"bg-new-50 hover:bg-new-200",iconClassName:"text-new-700 group-hover/preset:text-new-800"},products:{Icon:I,bgClassName:"bg-bubblegum-200 hover:bg-bubblegum-300",iconClassName:"text-bubblegum-700"},more:{Icon:B,bgClassName:"bg-primary-300 hover:bg-primary-400",iconClassName:"text-primary-700"},empty:{bgClassName:"bg-primary-50 border-b border-b-primary-200 hover:bg-primary-100 data-disabled:border-b-neutral-300"}},Qe=["alert","incident"],Cn=n=>{let a=Qe.map(r=>n.find(c=>c.name===r)).filter(r=>r!==void 0),l=n.filter(r=>!Qe.includes(r.name));return [...a,...l]},Tn=n=>({id:Z,size:54,enableResizing:false,header:({table:a})=>{let l=a.getRowModel().rows.some(c=>c.getCanSelect()),r=a.getIsAllPageRowsSelected()?true:a.getIsSomePageRowsSelected()?"indeterminate":false;return jsx(c$1,{checked:r,disabled:!l,className:"ml-1",onCheckedChange:c=>a.toggleAllPageRowsSelected(c===true)})},cell:({row:a})=>{let l=a.getCanSelect(),r=l?a.getIsSelected():typeof n.setDisabledRowState=="function"?n.setDisabledRowState(a.original):n.setDisabledRowState??false,c=jsx(c$1,{checked:r,onCheckedChange:f=>a.toggleSelected(f===true),disabled:!l}),u=n.rowSelectionTooltip?.content(a.original);return u?jsx(a$2,{className:"w-fit",content:u,positioning:n.rowSelectionTooltip?.positioning??{placement:"right"},children:c}):c},enableSorting:false}),ee=["w-3/4","w-1/2","w-2/3","w-5/6","w-3/5"],tn=({columns:n,rows:a$2,hasSelection:l,hasRowActions:r,hasPagination:c$1,className:u,...f})=>jsxs(a$1,{className:u,...f,children:[jsxs(b,{children:[jsx(c,{children:jsxs(g,{children:[r&&jsx(h,{className:a("p-0",j)}),l&&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"})}),Array.from({length:n},(x,S)=>jsx(h,{children:jsx(a$3,{className:"bg-primary-300 h-3 w-16"})},S))]})}),jsx(d,{className:"[&>tr:not(:last-child)>td]:shadow-[inset_0_-1px_0_0_var(--row-divider-color,var(--color-primary-200))]",children:Array.from({length:a$2},(x,S)=>jsxs(e,{children:[r&&jsx(i,{className:a("bg-primary-50 p-0 align-middle",j),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"})]})}),l&&jsx(i,{className:"align-middle",children:jsx(a$3,{className:"m-0.5 size-4.5 rounded-sm"})}),Array.from({length:n},(i$1,m)=>jsx(i,{children:jsx(a$3,{className:a("h-4",ee[(S+m)%ee.length])})},m))]},S))})]}),c$1&&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"})})]})]});tn.displayName="DataTableFullSkeleton";var Sn={neutral:"bg-neutral-100",success:"bg-success-20",orange:"bg-orange-20",warning:"bg-warning-20",danger:"bg-danger-20",default:"bg-neutral-50"},O="__row_actions__",Z="__select__",j="w-7.5 min-w-7.5 max-w-7.5",en="grid grid-cols-1 h-full w-full cursor-pointer overflow-hidden border-0 p-0 focus:outline-2 focus:-outline-offset-2 focus:outline-primary-800 focus:rounded-xs disabled:cursor-not-allowed",Y=(n,a$1)=>{let l=n.Icon;return jsx(a$2,{content:a$1?.tooltip??"",disabled:!a$1?.tooltip,className:"h-full w-full",positioning:{placement:"right"},children:jsx("div",{"data-disabled":a$1?.disabled||void 0,className:a("group/preset flex h-full w-full items-center justify-center",n.bgClassName,"data-disabled:cursor-not-allowed data-disabled:bg-neutral-200"),children:l&&jsx(l,{className:a("size-3.5 shrink-0",n.iconClassName,"group-data-disabled/preset:text-neutral-600"),"aria-hidden":true})})},a$1?.key)},be=(n,a)=>typeof n=="function"?n(a):n??false,hn=({row:n,rowActions:a})=>{let[l,r]=useState(false),c=n.original,u=Cn(a(c));if(u.length===0)return Y(X.empty);let f=u.length>3,x=f?u.slice(0,2):u,S=f?3:x.length;if(u.length===1){let i=u[0],m=be(i.isDisabled,c);return jsx("button",{type:"button","aria-label":i.label,disabled:m,className:en,style:{gridTemplateRows:"repeat(1, minmax(0, 1fr))"},onClick:N=>{N.stopPropagation(),i.onClick(c);},children:Y(X[i.name],{disabled:m,tooltip:i.tooltip})})}return jsxs(a$5,{open:l,onOpenChange:r,modal:false,positioning:{placement:"right-start",gutter:0},children:[jsx(b$1,{asChild:true,children:jsxs("button",{type:"button","aria-label":"Row actions",className:en,style:{gridTemplateRows:`repeat(${S}, minmax(0, 1fr))`},onClick:i=>{i.stopPropagation();},children:[x.map((i,m)=>Y(X[i.name],{key:`${i.name}-${m}`,disabled:be(i.isDisabled,c),tooltip:i.tooltip})),f&&Y(X.more)]})}),jsx(c$2,{className:"min-w-48 overflow-hidden rounded-sm p-0",children:jsx("div",{className:"flex flex-col",children:u.map((i,m)=>{let N=X[i.name];if(!N.Icon)return null;let z=be(i.isDisabled,c);return jsx(e$2,{variant:"ghost",size:"md",disabled:z,StartIcon:N.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:v=>{v.stopPropagation(),i.onClick(c),r(false);},type:"button",children:i.label},`${i.name}-${m}`)})})})]})},wn=({rowActions:n})=>({id:O,header:()=>jsx("span",{className:"sr-only",children:"Actions"}),size:30,minSize:30,maxSize:30,enableResizing:false,cell:({row:a})=>n?jsx(hn,{row:a,rowActions:n}):null}),on=memo(({row:n,isSelected:a$1,type:l})=>jsx(e,{"data-state":a$1&&"selected",className:a(l&&l!=="default"&&Sn[l]),style:l&&l!=="default"?{"--row-divider-color":`var(--color-${l}-100)`}:void 0,children:n.getVisibleCells().map(r=>jsx(i,{className:r.column.id===O?a("p-0 align-middle",j):void 0,children:flexRender(r.column.columnDef.cell,r.getContext())},r.id))}),(n,a)=>n.isSelected===a.isSelected&&n.row.original===a.row.original&&n.type===a.type&&n.columns===a.columns);on.displayName="DataTableRow";var Nn=150,Dn=Number.POSITIVE_INFINITY,yn=140,Q=(n,a,l)=>Math.min(Math.max(n,a),l),Rn=20,xn=Number.MAX_SAFE_INTEGER,J=n=>{let a=n.size??Nn,l=n.minSize===void 0||n.minSize===Rn?void 0:n.minSize,r=n.maxSize===void 0||n.maxSize===xn?void 0:n.maxSize;return {size:a,minSize:l??Math.min(a,yn),maxSize:r??Dn}},an="dt-col-sizes-",zn="dt-col-ratios-",Pn=n=>{try{localStorage.removeItem(`${zn}${n}`);let a=localStorage.getItem(`${an}${n}`);if(!a)return {};let l=JSON.parse(a),r={};for(let[c,u]of Object.entries(l))typeof u=="number"&&Number.isFinite(u)&&u>0&&(r[c]=u);return r}catch{return {}}},vn=(n,a)=>{try{localStorage.setItem(`${an}${n}`,JSON.stringify(a));}catch{}},In=(n,a)=>{let l={},r=0,c=[];for(let i of n)if(i.isFixed)l[i.id]=i.weight,r+=i.weight;else if(i.isPinned){let m=Q(i.pinnedPx,i.minSize,i.maxSize);l[i.id]=m,r+=m;}else c.push(i);if(c.length===0)return l;let u=Math.max(a-r,0),f=c.map(i=>({column:i,px:i.minSize,frozen:false})),x=f.length+1;for(;x-- >0;){let i=f.filter(d=>!d.frozen);if(i.length===0)break;let m=f.filter(d=>d.frozen).reduce((d,h)=>d+h.px,0),N=u-m,z=i.reduce((d,h)=>d+h.column.weight,0);if(z<=0)break;let v=false;for(let d of i){let h=d.column.weight/z*N;h<d.column.minSize?(d.px=d.column.minSize,d.frozen=true,v=true):h>d.column.maxSize?(d.px=d.column.maxSize,d.frozen=true,v=true):d.px=h;}if(!v)break}for(let i of f)l[i.column.id]=i.px;let S=f.find(i=>i.column.isFill);if(S){let i=f.filter(m=>m.column.id!==S.column.id).reduce((m,N)=>m+N.px,0);l[S.column.id]=Math.max(u-i,S.column.minSize);}return l};function at({columns:n,data:a$4,rowsCount:l,pagination:r,onPaginationChange:c$1,noResults:u,onNextPageClick:f$1,onPreviousPageClick:x,disableNextPage:S,disablePreviousPage:i$1,className:m,onRowsPerPageChange:N,columnOrder:z,columnVisibility:v,rowsPerPageOptions:d$1,enableRowSelection:h$1=false,rowSelection:pe,onRowSelectionChange:ln,getRowId:fe,rowSelectionTooltip:Ce,setDisabledRowState:Te,tableId:D,isLoading:L,isInitialLoading:Se,skeletonRowCount:sn,skeletonColumns:rn=6,getRowType:he,rowActions:k,...we}){let F=typeof h$1=="function"||h$1,Ne=useMemo(()=>{if(!z)return;let t=[k?O:null,F?Z:null].filter(s=>s!=null),o=new Set(t);return [...t,...z.filter(s=>!o.has(s))]},[z,F,k]),H=useMemo(()=>{let t=[...n];if(F&&t.unshift(Tn({rowSelectionTooltip:Ce,setDisabledRowState:Te})),k){let o=wn({rowActions:k});t.unshift(o);}return t},[F,n,Ce,Te,k]),[I,cn]=useState(null),un=useCallback(t=>cn(t),[]),[ne,De]=useState(0),ye=useRef(false),[y,te]=useState({}),[Re,xe]=useState(null),oe=useRef(null),ae=useRef(null),C=useReactTable({data:a$4,columns:H,rowCount:l,state:{pagination:r,...Ne!==void 0&&{columnOrder:Ne},columnVisibility:v,...pe!==void 0&&{rowSelection:pe},...D&&{columnSizing:y}},onPaginationChange:c$1,onRowSelectionChange:ln,...D&&{onColumnSizingChange:te},manualPagination:true,getCoreRowModel:getCoreRowModel(),enableRowSelection:typeof h$1=="function"?t=>h$1(t.original):h$1,getRowId:fe?t=>fe(t):void 0}),ie=C.getVisibleLeafColumns().map(t=>t.id).join(","),ze=Re!==null,A=useMemo(()=>{let t=C.getVisibleLeafColumns().filter(s=>s.getCanResize());return t.length===0?void 0:(t.find(s=>s.columnDef.isFillColumn)??t[t.length-1]).id},[C,ie,H]),Pe=useMemo(()=>{if(!ne)return {};let t=C.getVisibleLeafColumns().map(o=>{let{size:s,minSize:g,maxSize:b}=J(o.columnDef),P=o.getCanResize(),R=o.id===A;return {id:o.id,isFixed:!P,isPinned:P&&!R&&o.id in y,pinnedPx:y[o.id]??s,weight:s,minSize:g,maxSize:b,isFill:R}});return In(t,ne)},[C,ie,H,ne,y,A]),mn=useMemo(()=>C.getVisibleLeafColumns().reduce((t,o)=>{let{size:s,minSize:g,maxSize:b}=J(o.columnDef);return o.getCanResize()?o.id!==A&&o.id in y?t+Q(y[o.id]??s,g,b):t+g:t+s},0),[C,ie,H,y,A]),ve=(t,o)=>{let s=t.column.id,{size:g,minSize:b,maxSize:P}=J(t.column.columnDef),R=Pe[s]??g,_="touches"in o?o.touches[0]?.clientX??0:o.clientX;o.preventDefault(),o.stopPropagation(),oe.current=s,xe(s),document.body.style.userSelect="none";let q=B=>{"touches"in B&&B.preventDefault();let dn="touches"in B?B.touches[0]?.clientX??_:B.clientX,ke=Q(R+(dn-_),b,P);te(le=>le[s]===ke?le:{...le,[s]:ke});},W=()=>{oe.current=null,xe(null),document.body.style.userSelect="",document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",W),document.removeEventListener("touchmove",q),document.removeEventListener("touchend",W),ae.current=null,I&&De(I.clientWidth);};ae.current=W,document.addEventListener("mousemove",q),document.addEventListener("mouseup",W),document.addEventListener("touchmove",q,{passive:false}),document.addEventListener("touchend",W);};useEffect(()=>()=>ae.current?.(),[]),useEffect(()=>{D&&te(Pn(D));},[D]),useEffect(()=>{if(!I)return;let t=g=>{g>0&&De(g);};t(I.clientWidth);let o=0,s=new ResizeObserver(([g])=>{if(!g||oe.current!==null)return;cancelAnimationFrame(o);let b=I.clientWidth;o=requestAnimationFrame(()=>t(b));});return s.observe(I),()=>{cancelAnimationFrame(o),s.disconnect();}},[I]),useEffect(()=>{if(D){if(!ye.current){ye.current=true;return}ze||vn(D,y);}},[D,ze,y]);let Ie=sn??r?.pageSize??10;return Se?jsx(tn,{columns:rn,rows:Ie,hasSelection:F,hasRowActions:!!k,hasPagination:!!r,className:m,...we}):!L&&!Se&&!C.getRowModel().rows?.length?jsx(f,{...u}):jsxs(a$1,{ref:un,className:m,...we,children:[jsxs(b,{style:{width:"100%",minWidth:mn,tableLayout:"fixed"},children:[jsx("colgroup",{children:C.getHeaderGroups()[0].headers.map(t=>{let o=t.column,s=o.getCanResize(),{size:g,minSize:b,maxSize:P}=J(o.columnDef);if(o.id===A)return jsx("col",{span:1,style:{width:"auto",minWidth:b}},t.id);let R=Pe[o.id]??Q(y[o.id]??g,b,P);return jsx("col",{span:1,style:{width:R,minWidth:s?b:R}},t.id)})}),jsx(c,{children:C.getHeaderGroups().map(t=>jsx(g,{children:t.headers.map(o=>{if(o.isPlaceholder)return jsx(h,{},o.id);let s=o.column.columnDef,g=flexRender(s.header,o.getContext()),b=typeof s.headerTooltip=="string"?s.headerTooltip:typeof g=="string"?g:void 0,P=o.column.id!==Z&&s.headerTooltip!==false&&b!=null,R=jsx("span",{className:"line-clamp-1",children:g});return jsxs(h,{className:o.column.id===O?a("p-0",j):D?"group/resize relative overflow-clip":void 0,children:[jsxs("div",{className:"flex items-center",children:[P?jsx(a$2,{content:b,contentClassName:"font-normal normal-case",children:R}):R,s.headerInfoTooltip&&jsx(a$2,{content:s.headerInfoTooltip,contentClassName:"font-normal normal-case",children:jsx(e$1,{className:"ml-1 w-[0.875rem] shrink-0"})})]}),D&&o.column.getCanResize()&&o.column.id!==A&&jsx("div",{onMouseDown:_=>ve(o,_),onTouchStart:_=>ve(o,_),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",Re===o.column.id&&"bg-primary-600 opacity-100")})]},o.id)})},t.id))}),jsx(d,{className:"[&>tr:not(:last-child)>td]:shadow-[inset_0_-1px_0_0_var(--row-divider-color,var(--color-primary-200))]",children:L?Array.from({length:Ie},(t,o)=>jsx(e,{children:C.getVisibleLeafColumns().map((s,g)=>{let b=s.columnDef;return jsx(i,{className:s.id===Z?"align-middle":s.id===O?a("bg-primary-50 p-0 align-middle",j):void 0,children:s.id===Z?jsx(a$3,{className:"m-0.5 size-4.5 rounded-sm"}):s.id===O?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"})]}):b.skeleton!=null?b.skeleton:jsx(a$3,{className:a("h-4",ee[(o+g)%ee.length])})},s.id)})},o)):C.getRowModel().rows.map(t=>jsx(on,{row:t,isSelected:t.getIsSelected(),type:he?he(t.original):"default",columns:H},t.id))})]}),r&&c$1&&(a$4.length>0||L)&&jsx(j$1,{rowsPerPageOptions:d$1,rowsCount:l,pagination:r,onPageSizeChange:t=>{C.setPagination({pageIndex:0,pageSize:t}),N?.(t);},onPreviousPageClick:x,onNextPageClick:f$1,isDisableNextPageButton:L||S||!!l&&!C.getCanNextPage(),isDisablePreviousPageButton:L||i$1||!!l&&!C.getCanPreviousPage(),onPageChange:t=>{C.setPageIndex(t-1);}})]})}export{at as a};
1
+ import {e,i,f,a as a$1,b,c,g,h,d,j as j$1}from'./chunk-6M7NDF3Y.js';import {a as a$5,b as b$1,c as c$2}from'./chunk-GTVHYHF4.js';import {a as a$3}from'./chunk-KTD2GEB6.js';import {c as c$1}from'./chunk-PF4MVOF5.js';import {a as a$2}from'./chunk-3RNV3YTB.js';import {e as e$1,B,I,H,r,G,F,E,D,y,z,A,f as f$1,C}from'./chunk-QMPBFFFC.js';import {a as a$4}from'./chunk-ICF6RQIW.js';import {e as e$2}from'./chunk-QYA5ZUUN.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 {jsx,jsxs}from'react/jsx-runtime';var X={alert:{Icon:C,bgClassName:"bg-orange-50 hover:bg-orange-100",iconClassName:"text-orange-700"},incident:{Icon:f$1,bgClassName:"bg-warning-100 hover:bg-warning-200",iconClassName:"text-warning-900"},"no-address":{Icon:A,bgClassName:"bg-coral-50 hover:bg-coral-100",iconClassName:"text-coral-700"},"email-alert":{Icon:z,bgClassName:"bg-danger-100 hover:bg-danger-200",iconClassName:"text-danger-700"},superadmin:{Icon:y,bgClassName:"bg-orchid-100 hover:bg-orchid-200",iconClassName:"text-orchid-700"},bundle:{Icon:D,bgClassName:"bg-aqua-100 hover:bg-aqua-200",iconClassName:"text-aqua-800"},variants:{Icon:a$4,bgClassName:"bg-bubblegum-50 hover:bg-bubblegum-100",iconClassName:"text-bubblegum-700"},providers:{Icon:E,bgClassName:"bg-pink-50 hover:bg-pink-200",iconClassName:"text-pink-700"},"transaction-request":{Icon:F,bgClassName:"bg-green-100 hover:bg-green-200",iconClassName:"text-green-800"},design:{Icon:G,bgClassName:"bg-orange-50 hover:bg-orange-100",iconClassName:"text-orange-700"},error:{Icon:r,bgClassName:"bg-danger-100 hover:bg-danger-200",iconClassName:"text-danger-700"},draft:{Icon:H,bgClassName:"bg-new-50 hover:bg-new-200",iconClassName:"text-new-700 group-hover/preset:text-new-800"},products:{Icon:I,bgClassName:"bg-bubblegum-200 hover:bg-bubblegum-300",iconClassName:"text-bubblegum-700"},more:{Icon:B,bgClassName:"bg-primary-300 hover:bg-primary-400",iconClassName:"text-primary-700"},empty:{bgClassName:"bg-primary-50 border-b border-b-primary-200 hover:bg-primary-100 data-disabled:border-b-neutral-300"}},Qe=["alert","incident"],Cn=n=>{let a=Qe.map(r=>n.find(c=>c.name===r)).filter(r=>r!==void 0),l=n.filter(r=>!Qe.includes(r.name));return [...a,...l]},Tn=n=>({id:Z,size:54,enableResizing:false,header:({table:a})=>{let l=a.getRowModel().rows.some(c=>c.getCanSelect()),r=a.getIsAllPageRowsSelected()?true:a.getIsSomePageRowsSelected()?"indeterminate":false;return jsx(c$1,{checked:r,disabled:!l,className:"ml-1",onCheckedChange:c=>a.toggleAllPageRowsSelected(c===true)})},cell:({row:a})=>{let l=a.getCanSelect(),r=l?a.getIsSelected():typeof n.setDisabledRowState=="function"?n.setDisabledRowState(a.original):n.setDisabledRowState??false,c=jsx(c$1,{checked:r,onCheckedChange:f=>a.toggleSelected(f===true),disabled:!l}),u=n.rowSelectionTooltip?.content(a.original);return u?jsx(a$2,{className:"w-fit",content:u,positioning:n.rowSelectionTooltip?.positioning??{placement:"right"},children:c}):c},enableSorting:false}),ee=["w-3/4","w-1/2","w-2/3","w-5/6","w-3/5"],tn=({columns:n,rows:a$2,hasSelection:l,hasRowActions:r,hasPagination:c$1,className:u,...f})=>jsxs(a$1,{className:u,...f,children:[jsxs(b,{children:[jsx(c,{children:jsxs(g,{children:[r&&jsx(h,{className:a("p-0",j)}),l&&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"})}),Array.from({length:n},(x,S)=>jsx(h,{children:jsx(a$3,{className:"bg-primary-300 h-3 w-16"})},S))]})}),jsx(d,{className:"[&>tr:not(:last-child)>td]:shadow-[inset_0_-1px_0_0_var(--row-divider-color,var(--color-primary-200))]",children:Array.from({length:a$2},(x,S)=>jsxs(e,{children:[r&&jsx(i,{className:a("bg-primary-50 p-0 align-middle",j),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"})]})}),l&&jsx(i,{className:"align-middle",children:jsx(a$3,{className:"m-0.5 size-4.5 rounded-sm"})}),Array.from({length:n},(i$1,m)=>jsx(i,{children:jsx(a$3,{className:a("h-4",ee[(S+m)%ee.length])})},m))]},S))})]}),c$1&&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"})})]})]});tn.displayName="DataTableFullSkeleton";var Sn={neutral:"bg-neutral-100",success:"bg-success-20",orange:"bg-orange-20",warning:"bg-warning-20",danger:"bg-danger-20",default:"bg-neutral-50"},O="__row_actions__",Z="__select__",j="w-7.5 min-w-7.5 max-w-7.5",en="grid grid-cols-1 h-full w-full cursor-pointer overflow-hidden border-0 p-0 focus:outline-2 focus:-outline-offset-2 focus:outline-primary-800 focus:rounded-xs disabled:cursor-not-allowed",Y=(n,a$1)=>{let l=n.Icon;return jsx(a$2,{content:a$1?.tooltip??"",disabled:!a$1?.tooltip,className:"h-full w-full",positioning:{placement:"right"},children:jsx("div",{"data-disabled":a$1?.disabled||void 0,className:a("group/preset flex h-full w-full items-center justify-center",n.bgClassName,"data-disabled:cursor-not-allowed data-disabled:bg-neutral-200"),children:l&&jsx(l,{className:a("size-3.5 shrink-0",n.iconClassName,"group-data-disabled/preset:text-neutral-600"),"aria-hidden":true})})},a$1?.key)},be=(n,a)=>typeof n=="function"?n(a):n??false,hn=({row:n,rowActions:a})=>{let[l,r]=useState(false),c=n.original,u=Cn(a(c));if(u.length===0)return Y(X.empty);let f=u.length>3,x=f?u.slice(0,2):u,S=f?3:x.length;if(u.length===1){let i=u[0],m=be(i.isDisabled,c);return jsx("button",{type:"button","aria-label":i.label,disabled:m,className:en,style:{gridTemplateRows:"repeat(1, minmax(0, 1fr))"},onClick:N=>{N.stopPropagation(),i.onClick(c);},children:Y(X[i.name],{disabled:m,tooltip:i.tooltip})})}return jsxs(a$5,{open:l,onOpenChange:r,modal:false,positioning:{placement:"right-start",gutter:0},children:[jsx(b$1,{asChild:true,children:jsxs("button",{type:"button","aria-label":"Row actions",className:en,style:{gridTemplateRows:`repeat(${S}, minmax(0, 1fr))`},onClick:i=>{i.stopPropagation();},children:[x.map((i,m)=>Y(X[i.name],{key:`${i.name}-${m}`,disabled:be(i.isDisabled,c),tooltip:i.tooltip})),f&&Y(X.more)]})}),jsx(c$2,{className:"min-w-48 overflow-hidden rounded-sm p-0",children:jsx("div",{className:"flex flex-col",children:u.map((i,m)=>{let N=X[i.name];if(!N.Icon)return null;let z=be(i.isDisabled,c);return jsx(e$2,{variant:"ghost",size:"md",disabled:z,StartIcon:N.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:v=>{v.stopPropagation(),i.onClick(c),r(false);},type:"button",children:i.label},`${i.name}-${m}`)})})})]})},wn=({rowActions:n})=>({id:O,header:()=>jsx("span",{className:"sr-only",children:"Actions"}),size:30,minSize:30,maxSize:30,enableResizing:false,cell:({row:a})=>n?jsx(hn,{row:a,rowActions:n}):null}),on=memo(({row:n,isSelected:a$1,type:l})=>jsx(e,{"data-state":a$1&&"selected",className:a(l&&l!=="default"&&Sn[l]),style:l&&l!=="default"?{"--row-divider-color":`var(--color-${l}-100)`}:void 0,children:n.getVisibleCells().map(r=>jsx(i,{className:r.column.id===O?a("p-0 align-middle",j):void 0,children:flexRender(r.column.columnDef.cell,r.getContext())},r.id))}),(n,a)=>n.isSelected===a.isSelected&&n.row.original===a.row.original&&n.type===a.type&&n.columns===a.columns);on.displayName="DataTableRow";var Nn=150,Dn=Number.POSITIVE_INFINITY,yn=140,Q=(n,a,l)=>Math.min(Math.max(n,a),l),Rn=20,xn=Number.MAX_SAFE_INTEGER,J=n=>{let a=n.size??Nn,l=n.minSize===void 0||n.minSize===Rn?void 0:n.minSize,r=n.maxSize===void 0||n.maxSize===xn?void 0:n.maxSize;return {size:a,minSize:l??Math.min(a,yn),maxSize:r??Dn}},an="dt-col-sizes-",zn="dt-col-ratios-",Pn=n=>{try{localStorage.removeItem(`${zn}${n}`);let a=localStorage.getItem(`${an}${n}`);if(!a)return {};let l=JSON.parse(a),r={};for(let[c,u]of Object.entries(l))typeof u=="number"&&Number.isFinite(u)&&u>0&&(r[c]=u);return r}catch{return {}}},vn=(n,a)=>{try{localStorage.setItem(`${an}${n}`,JSON.stringify(a));}catch{}},In=(n,a)=>{let l={},r=0,c=[];for(let i of n)if(i.isFixed)l[i.id]=i.weight,r+=i.weight;else if(i.isPinned){let m=Q(i.pinnedPx,i.minSize,i.maxSize);l[i.id]=m,r+=m;}else c.push(i);if(c.length===0)return l;let u=Math.max(a-r,0),f=c.map(i=>({column:i,px:i.minSize,frozen:false})),x=f.length+1;for(;x-- >0;){let i=f.filter(d=>!d.frozen);if(i.length===0)break;let m=f.filter(d=>d.frozen).reduce((d,h)=>d+h.px,0),N=u-m,z=i.reduce((d,h)=>d+h.column.weight,0);if(z<=0)break;let v=false;for(let d of i){let h=d.column.weight/z*N;h<d.column.minSize?(d.px=d.column.minSize,d.frozen=true,v=true):h>d.column.maxSize?(d.px=d.column.maxSize,d.frozen=true,v=true):d.px=h;}if(!v)break}for(let i of f)l[i.column.id]=i.px;let S=f.find(i=>i.column.isFill);if(S){let i=f.filter(m=>m.column.id!==S.column.id).reduce((m,N)=>m+N.px,0);l[S.column.id]=Math.max(u-i,S.column.minSize);}return l};function at({columns:n,data:a$4,rowsCount:l,pagination:r,onPaginationChange:c$1,noResults:u,onNextPageClick:f$1,onPreviousPageClick:x,disableNextPage:S,disablePreviousPage:i$1,className:m,onRowsPerPageChange:N,columnOrder:z,columnVisibility:v,rowsPerPageOptions:d$1,enableRowSelection:h$1=false,rowSelection:pe,onRowSelectionChange:ln,getRowId:fe,rowSelectionTooltip:Ce,setDisabledRowState:Te,tableId:D,isLoading:L,isInitialLoading:Se,skeletonRowCount:sn,skeletonColumns:rn=6,getRowType:he,rowActions:k,...we}){let F=typeof h$1=="function"||h$1,Ne=useMemo(()=>{if(!z)return;let t=[k?O:null,F?Z:null].filter(s=>s!=null),o=new Set(t);return [...t,...z.filter(s=>!o.has(s))]},[z,F,k]),H=useMemo(()=>{let t=[...n];if(F&&t.unshift(Tn({rowSelectionTooltip:Ce,setDisabledRowState:Te})),k){let o=wn({rowActions:k});t.unshift(o);}return t},[F,n,Ce,Te,k]),[I,cn]=useState(null),un=useCallback(t=>cn(t),[]),[ne,De]=useState(0),ye=useRef(false),[y,te]=useState({}),[Re,xe]=useState(null),oe=useRef(null),ae=useRef(null),C=useReactTable({data:a$4,columns:H,rowCount:l,state:{pagination:r,...Ne!==void 0&&{columnOrder:Ne},columnVisibility:v,...pe!==void 0&&{rowSelection:pe},...D&&{columnSizing:y}},onPaginationChange:c$1,onRowSelectionChange:ln,...D&&{onColumnSizingChange:te},manualPagination:true,getCoreRowModel:getCoreRowModel(),enableRowSelection:typeof h$1=="function"?t=>h$1(t.original):h$1,getRowId:fe?t=>fe(t):void 0}),ie=C.getVisibleLeafColumns().map(t=>t.id).join(","),ze=Re!==null,A=useMemo(()=>{let t=C.getVisibleLeafColumns().filter(s=>s.getCanResize());return t.length===0?void 0:(t.find(s=>s.columnDef.isFillColumn)??t[t.length-1]).id},[C,ie,H]),Pe=useMemo(()=>{if(!ne)return {};let t=C.getVisibleLeafColumns().map(o=>{let{size:s,minSize:g,maxSize:b}=J(o.columnDef),P=o.getCanResize(),R=o.id===A;return {id:o.id,isFixed:!P,isPinned:P&&!R&&o.id in y,pinnedPx:y[o.id]??s,weight:s,minSize:g,maxSize:b,isFill:R}});return In(t,ne)},[C,ie,H,ne,y,A]),mn=useMemo(()=>C.getVisibleLeafColumns().reduce((t,o)=>{let{size:s,minSize:g,maxSize:b}=J(o.columnDef);return o.getCanResize()?o.id!==A&&o.id in y?t+Q(y[o.id]??s,g,b):t+g:t+s},0),[C,ie,H,y,A]),ve=(t,o)=>{let s=t.column.id,{size:g,minSize:b,maxSize:P}=J(t.column.columnDef),R=Pe[s]??g,_="touches"in o?o.touches[0]?.clientX??0:o.clientX;o.preventDefault(),o.stopPropagation(),oe.current=s,xe(s),document.body.style.userSelect="none";let q=B=>{"touches"in B&&B.preventDefault();let dn="touches"in B?B.touches[0]?.clientX??_:B.clientX,ke=Q(R+(dn-_),b,P);te(le=>le[s]===ke?le:{...le,[s]:ke});},W=()=>{oe.current=null,xe(null),document.body.style.userSelect="",document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",W),document.removeEventListener("touchmove",q),document.removeEventListener("touchend",W),ae.current=null,I&&De(I.clientWidth);};ae.current=W,document.addEventListener("mousemove",q),document.addEventListener("mouseup",W),document.addEventListener("touchmove",q,{passive:false}),document.addEventListener("touchend",W);};useEffect(()=>()=>ae.current?.(),[]),useEffect(()=>{D&&te(Pn(D));},[D]),useEffect(()=>{if(!I)return;let t=g=>{g>0&&De(g);};t(I.clientWidth);let o=0,s=new ResizeObserver(([g])=>{if(!g||oe.current!==null)return;cancelAnimationFrame(o);let b=I.clientWidth;o=requestAnimationFrame(()=>t(b));});return s.observe(I),()=>{cancelAnimationFrame(o),s.disconnect();}},[I]),useEffect(()=>{if(D){if(!ye.current){ye.current=true;return}ze||vn(D,y);}},[D,ze,y]);let Ie=sn??r?.pageSize??10;return Se?jsx(tn,{columns:rn,rows:Ie,hasSelection:F,hasRowActions:!!k,hasPagination:!!r,className:m,...we}):!L&&!Se&&!C.getRowModel().rows?.length?jsx(f,{...u}):jsxs(a$1,{ref:un,className:m,...we,children:[jsxs(b,{style:{width:"100%",minWidth:mn,tableLayout:"fixed"},children:[jsx("colgroup",{children:C.getHeaderGroups()[0].headers.map(t=>{let o=t.column,s=o.getCanResize(),{size:g,minSize:b,maxSize:P}=J(o.columnDef);if(o.id===A)return jsx("col",{span:1,style:{width:"auto",minWidth:b}},t.id);let R=Pe[o.id]??Q(y[o.id]??g,b,P);return jsx("col",{span:1,style:{width:R,minWidth:s?b:R}},t.id)})}),jsx(c,{children:C.getHeaderGroups().map(t=>jsx(g,{children:t.headers.map(o=>{if(o.isPlaceholder)return jsx(h,{},o.id);let s=o.column.columnDef,g=flexRender(s.header,o.getContext()),b=typeof s.headerTooltip=="string"?s.headerTooltip:typeof g=="string"?g:void 0,P=o.column.id!==Z&&s.headerTooltip!==false&&b!=null,R=jsx("span",{className:"line-clamp-1",children:g});return jsxs(h,{className:o.column.id===O?a("p-0",j):D?"group/resize relative overflow-clip":void 0,children:[jsxs("div",{className:"flex items-center",children:[P?jsx(a$2,{content:b,contentClassName:"font-normal normal-case",children:R}):R,s.headerInfoTooltip&&jsx(a$2,{content:s.headerInfoTooltip,contentClassName:"font-normal normal-case",children:jsx(e$1,{className:"ml-1 w-[0.875rem] shrink-0"})})]}),D&&o.column.getCanResize()&&o.column.id!==A&&jsx("div",{onMouseDown:_=>ve(o,_),onTouchStart:_=>ve(o,_),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",Re===o.column.id&&"bg-primary-600 opacity-100")})]},o.id)})},t.id))}),jsx(d,{className:"[&>tr:not(:last-child)>td]:shadow-[inset_0_-1px_0_0_var(--row-divider-color,var(--color-primary-200))]",children:L?Array.from({length:Ie},(t,o)=>jsx(e,{children:C.getVisibleLeafColumns().map((s,g)=>{let b=s.columnDef;return jsx(i,{className:s.id===Z?"align-middle":s.id===O?a("bg-primary-50 p-0 align-middle",j):void 0,children:s.id===Z?jsx(a$3,{className:"m-0.5 size-4.5 rounded-sm"}):s.id===O?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"})]}):b.skeleton!=null?b.skeleton:jsx(a$3,{className:a("h-4",ee[(o+g)%ee.length])})},s.id)})},o)):C.getRowModel().rows.map(t=>jsx(on,{row:t,isSelected:t.getIsSelected(),type:he?he(t.original):"default",columns:H},t.id))})]}),r&&c$1&&(a$4.length>0||L)&&jsx(j$1,{rowsPerPageOptions:d$1,rowsCount:l,pagination:r,onPageSizeChange:t=>{C.setPagination({pageIndex:0,pageSize:t}),N?.(t);},onPreviousPageClick:x,onNextPageClick:f$1,isDisableNextPageButton:L||S||!!l&&!C.getCanNextPage(),isDisablePreviousPageButton:L||i$1||!!l&&!C.getCanPreviousPage(),onPageChange:t=>{C.setPageIndex(t-1);}})]})}export{at as a};
@@ -1 +1 @@
1
- import {b}from'./chunk-LJNEBCBI.js';import {a as a$1}from'./chunk-UIZFLYFP.js';import {b as b$2}from'./chunk-XJ2YYVZX.js';import {b as b$1}from'./chunk-ZCMXCZC2.js';import {a as a$2}from'./chunk-JW7HS6NX.js';import {k,l}from'./chunk-QMPBFFFC.js';import {e}from'./chunk-QYA5ZUUN.js';import {a}from'./chunk-OBZIYJO7.js';import {Checkbox}from'@ark-ui/react/checkbox';import {RadioGroupRoot,RadioGroupItem,RadioGroupItemText,RadioGroupItemControl,RadioGroupItemHiddenInput}from'@ark-ui/react/radio-group';import {createContext,useContext,isValidElement,cloneElement,useCallback}from'react';import {tv}from'tailwind-variants';import {jsx,jsxs}from'react/jsx-runtime';var m=createContext(false),vt=()=>useContext(m),x=createContext(void 0),c=tv({slots:{root:["group/list-item flex flex-row px-3 py-4 text-neutral-900 transition-colors","not-data-disabled:hover:bg-primary-100 not-data-disabled:focus:bg-primary-200","not-data-disabled:data-focus-visible:bg-primary-200","data-disabled:cursor-not-allowed data-disabled:text-neutral-600","[&:has([data-part=list-item-headline]:only-child)]:items-center"],leading:"mr-2 flex shrink-0 items-start gap-2",content:"flex w-full min-w-0 flex-col gap-1",headline:["font-inter text-sm leading-[143%] break-all","line-clamp-1"],description:["text-xs leading-[133%] text-neutral-700","line-clamp-2 group-data-disabled/list-item:text-neutral-600"],characteristics:"flex min-w-0 flex-col gap-1",characteristic:["text-xs leading-[133%] text-neutral-700","line-clamp-1 group-data-disabled/list-item:text-neutral-600"],trailing:"ml-4 flex shrink-0 items-center gap-2 self-center",icon:"size-4.5 shrink-0 group-data-disabled/list-item:text-neutral-600",control:"self-center"},variants:{selected:{true:{root:"bg-primary-200"},false:{}},interactive:{true:{root:"not-data-disabled:cursor-pointer"},false:{root:"not-data-disabled:cursor-default"}},status:{default:{},success:{root:["bg-success-20 text-success-800","not-data-disabled:hover:bg-success-50","not-data-disabled:focus:bg-success-100 not-data-disabled:data-focus-visible:bg-success-100"],description:"text-success-800",characteristic:"text-success-800"},warning:{root:["bg-warning-20 text-warning-800","not-data-disabled:hover:bg-warning-50","not-data-disabled:focus:bg-warning-100 not-data-disabled:data-focus-visible:bg-warning-100"],description:"text-warning-800",characteristic:"text-warning-800"},danger:{root:["bg-danger-20 text-danger-800","not-data-disabled:hover:bg-danger-50","not-data-disabled:focus:bg-danger-100 not-data-disabled:data-focus-visible:bg-danger-100"],description:"text-danger-800",characteristic:"text-danger-800"}}},compoundVariants:[{status:"success",selected:true,class:{root:"bg-success-100"}},{status:"warning",selected:true,class:{root:"bg-warning-100"}},{status:"danger",selected:true,class:{root:"bg-danger-100"}}],defaultVariants:{selected:false,interactive:false,status:"default"}}),V=({disabled:t=false,selected:o=false,status:s,className:a,onClick:i,children:p,...d})=>{let l=c({selected:o,interactive:!!i,status:s});return jsx("div",{className:l.root({className:a}),"data-disabled":t||void 0,onClick:C=>{t||i?.(C);},...d,children:jsx(m.Provider,{value:t,children:jsx(x.Provider,{value:s,children:p})})})},O=({className:t,...o})=>jsx("div",{className:c().leading({className:t}),...o}),M=({className:t,...o})=>jsx("div",{className:c().content({className:t}),...o}),z=({icon:t,className:o,children:s})=>{let a$1=c().icon({className:o});return t?jsx(t,{className:a$1}):isValidElement(s)?cloneElement(s,{className:a(a$1,s.props.className)}):null},A=({className:t,...o})=>jsx("div",{className:c().characteristics({className:t}),...o}),q=({className:t,...o})=>jsx("div",{className:c().trailing({className:t}),...o}),J=({disabled:t,className:o,...s})=>{let a$1=useContext(m);return jsx(e,{size:"sm",variant:"ghost",tone:"primary",disabled:t??a$1,className:a("self-center",o),...s})},K=({disabled:t,className:o,...s})=>{let a$1=useContext(m);return jsx(b,{disabled:t??a$1,className:a("w-35 self-center",o),...s})},Q=t=>jsx(a$1,{...t,type:"fill",size:"md"}),U=t=>jsx(a$2,{...t,size:"md"}),W=({className:t,...o})=>jsx("p",{"data-part":"list-item-headline",className:c().headline({className:t}),...o}),X=({className:t,...o})=>{let s=useContext(x);return jsx("p",{"data-part":"list-item-description",className:c({status:s}).description({className:t}),...o})},Y=({className:t,...o})=>{let s=useContext(x);return jsx("p",{"data-part":"list-item-characteristic",className:c({status:s}).characteristic({className:t}),...o})},Z=({disabled:t=false,selected:o=false,status:s,className:a$1,onCheckedChange:i,children:p,...d})=>{let l$1=c({selected:o,interactive:true,status:s}),C=b$1(),S=useCallback(B=>{i?.(B.checked);},[i]);return jsxs(Checkbox.Root,{className:a(l$1.root(),"group",a$1),disabled:t,onCheckedChange:S,...d,children:[jsx(Checkbox.Label,{className:"contents",children:jsx(m.Provider,{value:t,children:jsx(x.Provider,{value:s,children:p})})}),jsxs(Checkbox.Control,{className:C.control({className:a(l$1.control(),"ml-4.5 shrink-0")}),children:[jsx(Checkbox.Indicator,{children:jsx(k,{className:C.icon()})}),jsx(Checkbox.Indicator,{indeterminate:true,children:jsx(l,{className:C.icon()})})]}),jsx(Checkbox.HiddenInput,{})]})},_=({className:t,onValueChange:o,...s})=>{let a$1=useCallback(i=>{o?.(i.value);},[o]);return jsx(RadioGroupRoot,{className:a("flex flex-col",t),onValueChange:a$1,...s})},$=({disabled:t=false,selected:o=false,status:s,className:a$1,children:i,...p})=>{let d=c({selected:o,interactive:true,status:s}),l=b$2();return jsxs(RadioGroupItem,{className:a(d.root(),"group/item",a$1),disabled:t,...p,children:[jsx(RadioGroupItemText,{className:"contents",children:jsx(m.Provider,{value:t,children:jsx(x.Provider,{value:s,children:i})})}),jsx(RadioGroupItemControl,{className:l.control({className:a(d.control(),"ml-4 shrink-0")})}),jsx(RadioGroupItemHiddenInput,{})]})},j=({disabled:t,className:o,...s})=>{let a$1=b$2(),i=useContext(m);return jsxs(RadioGroupItem,{disabled:t??i,className:a$1.item({className:a("shrink-0",o)}),...s,children:[jsx(RadioGroupItemControl,{className:a$1.control()}),jsx(RadioGroupItemHiddenInput,{})]})},tt=({className:t,disabled:o,onCheckedChange:s,...a$1})=>{let i=b$1(),p=useContext(m),d=useCallback(l=>{s?.(l.checked);},[s]);return jsxs(Checkbox.Root,{className:i.root({className:a("shrink-0",t)}),disabled:o??p,onCheckedChange:d,...a$1,children:[jsxs(Checkbox.Control,{className:i.control(),children:[jsx(Checkbox.Indicator,{children:jsx(k,{className:i.icon()})}),jsx(Checkbox.Indicator,{indeterminate:true,children:jsx(l,{className:i.icon()})})]}),jsx(Checkbox.HiddenInput,{})]})},kt={Root:V,Leading:O,Icon:z,Content:M,Headline:W,Description:X,Characteristics:A,Characteristic:Y,Trailing:q,Button:J,NumberField:K,BadgeStatus:Q,BadgeExpandable:U,Checkbox:Z,RadioGroup:_,RadioItem:$,RadioControl:j,CheckboxControl:tt};export{vt as a,kt as b};
1
+ import {b}from'./chunk-LJNEBCBI.js';import {a as a$1}from'./chunk-UIZFLYFP.js';import {b as b$2}from'./chunk-JFNJPH6Q.js';import {b as b$1}from'./chunk-PF4MVOF5.js';import {a as a$2}from'./chunk-JW7HS6NX.js';import {k,l}from'./chunk-QMPBFFFC.js';import {e}from'./chunk-QYA5ZUUN.js';import {a}from'./chunk-OBZIYJO7.js';import {Checkbox}from'@ark-ui/react/checkbox';import {RadioGroupRoot,RadioGroupItem,RadioGroupItemText,RadioGroupItemControl,RadioGroupItemHiddenInput}from'@ark-ui/react/radio-group';import {createContext,useContext,isValidElement,cloneElement,useCallback}from'react';import {tv}from'tailwind-variants';import {jsx,jsxs}from'react/jsx-runtime';var m=createContext(false),vt=()=>useContext(m),x=createContext(void 0),c=tv({slots:{root:["group/list-item flex flex-row px-3 py-4 text-neutral-900 transition-colors","not-data-disabled:hover:bg-primary-100 not-data-disabled:focus:bg-primary-200","not-data-disabled:data-focus-visible:bg-primary-200","data-disabled:cursor-not-allowed data-disabled:text-neutral-600","[&:has([data-part=list-item-headline]:only-child)]:items-center"],leading:"mr-2 flex shrink-0 items-start gap-2",content:"flex w-full min-w-0 flex-col gap-1",headline:["font-inter text-sm leading-[143%] break-all","line-clamp-1"],description:["text-xs leading-[133%] text-neutral-700","line-clamp-2 group-data-disabled/list-item:text-neutral-600"],characteristics:"flex min-w-0 flex-col gap-1",characteristic:["text-xs leading-[133%] text-neutral-700","line-clamp-1 group-data-disabled/list-item:text-neutral-600"],trailing:"ml-4 flex shrink-0 items-center gap-2 self-center",icon:"size-4.5 shrink-0 group-data-disabled/list-item:text-neutral-600",control:"self-center"},variants:{selected:{true:{root:"bg-primary-200"},false:{}},interactive:{true:{root:"not-data-disabled:cursor-pointer"},false:{root:"not-data-disabled:cursor-default"}},status:{default:{},success:{root:["bg-success-20 text-success-800","not-data-disabled:hover:bg-success-50","not-data-disabled:focus:bg-success-100 not-data-disabled:data-focus-visible:bg-success-100"],description:"text-success-800",characteristic:"text-success-800"},warning:{root:["bg-warning-20 text-warning-800","not-data-disabled:hover:bg-warning-50","not-data-disabled:focus:bg-warning-100 not-data-disabled:data-focus-visible:bg-warning-100"],description:"text-warning-800",characteristic:"text-warning-800"},danger:{root:["bg-danger-20 text-danger-800","not-data-disabled:hover:bg-danger-50","not-data-disabled:focus:bg-danger-100 not-data-disabled:data-focus-visible:bg-danger-100"],description:"text-danger-800",characteristic:"text-danger-800"}}},compoundVariants:[{status:"success",selected:true,class:{root:"bg-success-100"}},{status:"warning",selected:true,class:{root:"bg-warning-100"}},{status:"danger",selected:true,class:{root:"bg-danger-100"}}],defaultVariants:{selected:false,interactive:false,status:"default"}}),V=({disabled:t=false,selected:o=false,status:s,className:a,onClick:i,children:p,...d})=>{let l=c({selected:o,interactive:!!i,status:s});return jsx("div",{className:l.root({className:a}),"data-disabled":t||void 0,onClick:C=>{t||i?.(C);},...d,children:jsx(m.Provider,{value:t,children:jsx(x.Provider,{value:s,children:p})})})},O=({className:t,...o})=>jsx("div",{className:c().leading({className:t}),...o}),M=({className:t,...o})=>jsx("div",{className:c().content({className:t}),...o}),z=({icon:t,className:o,children:s})=>{let a$1=c().icon({className:o});return t?jsx(t,{className:a$1}):isValidElement(s)?cloneElement(s,{className:a(a$1,s.props.className)}):null},A=({className:t,...o})=>jsx("div",{className:c().characteristics({className:t}),...o}),q=({className:t,...o})=>jsx("div",{className:c().trailing({className:t}),...o}),J=({disabled:t,className:o,...s})=>{let a$1=useContext(m);return jsx(e,{size:"sm",variant:"ghost",tone:"primary",disabled:t??a$1,className:a("self-center",o),...s})},K=({disabled:t,className:o,...s})=>{let a$1=useContext(m);return jsx(b,{disabled:t??a$1,className:a("w-35 self-center",o),...s})},Q=t=>jsx(a$1,{...t,type:"fill",size:"md"}),U=t=>jsx(a$2,{...t,size:"md"}),W=({className:t,...o})=>jsx("p",{"data-part":"list-item-headline",className:c().headline({className:t}),...o}),X=({className:t,...o})=>{let s=useContext(x);return jsx("p",{"data-part":"list-item-description",className:c({status:s}).description({className:t}),...o})},Y=({className:t,...o})=>{let s=useContext(x);return jsx("p",{"data-part":"list-item-characteristic",className:c({status:s}).characteristic({className:t}),...o})},Z=({disabled:t=false,selected:o=false,status:s,className:a$1,onCheckedChange:i,children:p,...d})=>{let l$1=c({selected:o,interactive:true,status:s}),C=b$1(),S=useCallback(B=>{i?.(B.checked);},[i]);return jsxs(Checkbox.Root,{className:a(l$1.root(),"group",a$1),disabled:t,onCheckedChange:S,...d,children:[jsx(Checkbox.Label,{className:"contents",children:jsx(m.Provider,{value:t,children:jsx(x.Provider,{value:s,children:p})})}),jsxs(Checkbox.Control,{className:C.control({className:a(l$1.control(),"ml-4.5 shrink-0")}),children:[jsx(Checkbox.Indicator,{children:jsx(k,{className:C.icon()})}),jsx(Checkbox.Indicator,{indeterminate:true,children:jsx(l,{className:C.icon()})})]}),jsx(Checkbox.HiddenInput,{})]})},_=({className:t,onValueChange:o,...s})=>{let a$1=useCallback(i=>{o?.(i.value);},[o]);return jsx(RadioGroupRoot,{className:a("flex flex-col",t),onValueChange:a$1,...s})},$=({disabled:t=false,selected:o=false,status:s,className:a$1,children:i,...p})=>{let d=c({selected:o,interactive:true,status:s}),l=b$2();return jsxs(RadioGroupItem,{className:a(d.root(),"group/item",a$1),disabled:t,...p,children:[jsx(RadioGroupItemText,{className:"contents",children:jsx(m.Provider,{value:t,children:jsx(x.Provider,{value:s,children:i})})}),jsx(RadioGroupItemControl,{className:l.control({className:a(d.control(),"ml-4 shrink-0")})}),jsx(RadioGroupItemHiddenInput,{})]})},j=({disabled:t,className:o,...s})=>{let a$1=b$2(),i=useContext(m);return jsxs(RadioGroupItem,{disabled:t??i,className:a$1.item({className:a("shrink-0",o)}),...s,children:[jsx(RadioGroupItemControl,{className:a$1.control()}),jsx(RadioGroupItemHiddenInput,{})]})},tt=({className:t,disabled:o,onCheckedChange:s,...a$1})=>{let i=b$1(),p=useContext(m),d=useCallback(l=>{s?.(l.checked);},[s]);return jsxs(Checkbox.Root,{className:i.root({className:a("shrink-0",t)}),disabled:o??p,onCheckedChange:d,...a$1,children:[jsxs(Checkbox.Control,{className:i.control(),children:[jsx(Checkbox.Indicator,{children:jsx(k,{className:i.icon()})}),jsx(Checkbox.Indicator,{indeterminate:true,children:jsx(l,{className:i.icon()})})]}),jsx(Checkbox.HiddenInput,{})]})},kt={Root:V,Leading:O,Icon:z,Content:M,Headline:W,Description:X,Characteristics:A,Characteristic:Y,Trailing:q,Button:J,NumberField:K,BadgeStatus:Q,BadgeExpandable:U,Checkbox:Z,RadioGroup:_,RadioItem:$,RadioControl:j,CheckboxControl:tt};export{vt as a,kt as b};
@@ -1 +1 @@
1
- import {c as c$1}from'./chunk-JYNJHAGL.js';import {c}from'./chunk-ZCMXCZC2.js';import {a as a$2}from'./chunk-JW7HS6NX.js';import {a as a$1}from'./chunk-3RNV3YTB.js';import {d}from'./chunk-MP4CHZ2K.js';import {e as e$1}from'./chunk-PI7DECIN.js';import {e,t,u}from'./chunk-QMPBFFFC.js';import {e as e$2}from'./chunk-QYA5ZUUN.js';import {a as a$3}from'./chunk-P6B33GL6.js';import {a}from'./chunk-OBZIYJO7.js';import {createContext,useContext,useCallback}from'react';import {tv}from'tailwind-variants';import {useCollapsibleContext,Collapsible}from'@ark-ui/react/collapsible';import {getDefaultOptions}from'date-fns';import {jsxs,jsx}from'react/jsx-runtime';var v=createContext("white"),x=tv({slots:{root:"group/expandable-card flex h-fit flex-col rounded-lg ring transition-all duration-200 ease-in-out ring-inset",header:"flex min-h-14 items-center py-3 pr-1 pl-3",headerLabel:"text-sm leading-[130%] font-medium empty:hidden",complementaryText:"line-clamp-1 text-xs leading-[130%] text-neutral-900",subtitle:"line-clamp-1 text-xs leading-[130%] text-neutral-700",content:"data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up overflow-hidden group-data-[state=open]/expandable-card:border-t",contentInner:"px-3 py-4",fixedContent:"border-t px-3 pt-6 pb-4"},variants:{background:{white:{root:"ring-expandable-card-white-border bg-neutral-50",content:"border-expandable-card-white-border",fixedContent:"border-expandable-card-white-border"},gray:{root:"ring-expandable-card-neutral-border bg-neutral-100",content:"border-expandable-card-neutral-border",fixedContent:"border-expandable-card-neutral-border"}}},defaultVariants:{background:"white"}}),X=(o,e)=>e?.startsWith("es")?o?"Contraer":"Expandir":e?.startsWith("pt")?o?"Recolher":"Expandir":o?"Collapse":"Expand",Et=({headerLabel:o,complementaryText:e$3,subtitle:n,headerTooltip:a$4,className:i,action:p,chipStatus:d$1,badgeExpandable:c$2,chipExpandable:E,badgeNumber:l,Icon:P,iconButtons:O,checkbox:b,...M})=>{let{header:F,headerLabel:R,complementaryText:A,subtitle:S}=x(),C=useCollapsibleContext(),{locale:U}=getDefaultOptions(),W=X(C.open,U?.code);return jsxs("div",{...M,className:a(F(),i),children:[b&&jsx(c,{...b,className:a("mt-0.25 mr-1.5",b.className)}),jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[jsxs("div",{className:"flex items-center justify-between gap-3",children:[jsxs("div",{className:"flex items-center gap-1.5",children:[P&&jsx(P,{className:"size-3.5 shrink-0"}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("b",{className:R(),children:o}),e$3&&jsx("span",{className:A(),children:e$3}),a$4&&jsx(a$1,{content:a$4,contentClassName:"font-normal normal-case",children:jsx(e,{className:"h-3.5 w-3.5 shrink-0"})})]})]}),jsxs("div",{className:"flex items-center gap-2",children:[d$1&&jsx(d,{...d$1,size:"xs",type:"light"}),E&&jsx(c$1,{...E,type:"light"}),c$2&&jsx(a$2,{...c$2,size:"md"}),l&&jsx(a$1,{content:l.tooltipContent,disabled:!l.tooltipContent,children:jsx(a$3,{text:l.text,affix:l.affix,size:"md",variant:"primary",type:"square"})}),O?.map((m,u)=>{let{tooltipContent:y,variant:q="ghost",...V}=m;return jsx(a$1,{content:y,disabled:!y,children:jsx(e$1,{...V,variant:q,tone:"neutral",size:"sm"})},u)}),p&&(()=>{let{tooltipContent:m,...u}=p;return jsx(a$1,{content:m,disabled:!m,children:jsx(e$2,{...u,size:"sm",variant:"ghost",tone:"neutral"})})})(),jsx(a$1,{content:W,asChild:true,children:jsx(Collapsible.Trigger,{asChild:true,children:jsx(e$1,{disabled:C.disabled,Icon:C.open?t:u,variant:"ghost",size:"sm",tone:"neutral"})})})]})]}),n&&jsx("p",{className:S(),children:n})]})]})},Pt=({className:o,...e})=>{let n=useContext(v),{contentInner:a,content:i}=x({background:n});return jsx(Collapsible.Content,{className:i(),children:jsx("div",{...e,className:a({className:o})})})},yt=({className:o,...e})=>{let n=useContext(v),{fixedContent:a}=x({background:n});return jsx("div",{...e,className:a({className:o})})},Tt=({className:o,onOpenChange:e,children:n,background:a="white",...i})=>{let{root:p}=x({background:a}),d=useCallback(c=>{e?.(c);},[e]);return jsx(v.Provider,{value:a,children:jsx(Collapsible.Root,{onOpenChange:d,className:p({className:o}),...i,children:n})})};export{Et as a,Pt as b,yt as c,Tt as d};
1
+ import {c as c$1}from'./chunk-JYNJHAGL.js';import {c}from'./chunk-PF4MVOF5.js';import {a as a$2}from'./chunk-JW7HS6NX.js';import {a as a$1}from'./chunk-3RNV3YTB.js';import {d}from'./chunk-MP4CHZ2K.js';import {e as e$1}from'./chunk-PI7DECIN.js';import {e,t,u}from'./chunk-QMPBFFFC.js';import {e as e$2}from'./chunk-QYA5ZUUN.js';import {a as a$3}from'./chunk-P6B33GL6.js';import {a}from'./chunk-OBZIYJO7.js';import {createContext,useContext,useCallback}from'react';import {tv}from'tailwind-variants';import {useCollapsibleContext,Collapsible}from'@ark-ui/react/collapsible';import {getDefaultOptions}from'date-fns';import {jsxs,jsx}from'react/jsx-runtime';var v=createContext("white"),x=tv({slots:{root:"group/expandable-card flex h-fit flex-col rounded-lg ring transition-all duration-200 ease-in-out ring-inset",header:"flex min-h-14 items-center py-3 pr-1 pl-3",headerLabel:"text-sm leading-[130%] font-medium empty:hidden",complementaryText:"line-clamp-1 text-xs leading-[130%] text-neutral-900",subtitle:"line-clamp-1 text-xs leading-[130%] text-neutral-700",content:"data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up overflow-hidden group-data-[state=open]/expandable-card:border-t",contentInner:"px-3 py-4",fixedContent:"border-t px-3 pt-6 pb-4"},variants:{background:{white:{root:"ring-expandable-card-white-border bg-neutral-50",content:"border-expandable-card-white-border",fixedContent:"border-expandable-card-white-border"},gray:{root:"ring-expandable-card-neutral-border bg-neutral-100",content:"border-expandable-card-neutral-border",fixedContent:"border-expandable-card-neutral-border"}}},defaultVariants:{background:"white"}}),X=(o,e)=>e?.startsWith("es")?o?"Contraer":"Expandir":e?.startsWith("pt")?o?"Recolher":"Expandir":o?"Collapse":"Expand",Et=({headerLabel:o,complementaryText:e$3,subtitle:n,headerTooltip:a$4,className:i,action:p,chipStatus:d$1,badgeExpandable:c$2,chipExpandable:E,badgeNumber:l,Icon:P,iconButtons:O,checkbox:b,...M})=>{let{header:F,headerLabel:R,complementaryText:A,subtitle:S}=x(),C=useCollapsibleContext(),{locale:U}=getDefaultOptions(),W=X(C.open,U?.code);return jsxs("div",{...M,className:a(F(),i),children:[b&&jsx(c,{...b,className:a("mt-0.25 mr-1.5",b.className)}),jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[jsxs("div",{className:"flex items-center justify-between gap-3",children:[jsxs("div",{className:"flex items-center gap-1.5",children:[P&&jsx(P,{className:"size-3.5 shrink-0"}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("b",{className:R(),children:o}),e$3&&jsx("span",{className:A(),children:e$3}),a$4&&jsx(a$1,{content:a$4,contentClassName:"font-normal normal-case",children:jsx(e,{className:"h-3.5 w-3.5 shrink-0"})})]})]}),jsxs("div",{className:"flex items-center gap-2",children:[d$1&&jsx(d,{...d$1,size:"xs",type:"light"}),E&&jsx(c$1,{...E,type:"light"}),c$2&&jsx(a$2,{...c$2,size:"md"}),l&&jsx(a$1,{content:l.tooltipContent,disabled:!l.tooltipContent,children:jsx(a$3,{text:l.text,affix:l.affix,size:"md",variant:"primary",type:"square"})}),O?.map((m,u)=>{let{tooltipContent:y,variant:q="ghost",...V}=m;return jsx(a$1,{content:y,disabled:!y,children:jsx(e$1,{...V,variant:q,tone:"neutral",size:"sm"})},u)}),p&&(()=>{let{tooltipContent:m,...u}=p;return jsx(a$1,{content:m,disabled:!m,children:jsx(e$2,{...u,size:"sm",variant:"ghost",tone:"neutral"})})})(),jsx(a$1,{content:W,asChild:true,children:jsx(Collapsible.Trigger,{asChild:true,children:jsx(e$1,{disabled:C.disabled,Icon:C.open?t:u,variant:"ghost",size:"sm",tone:"neutral"})})})]})]}),n&&jsx("p",{className:S(),children:n})]})]})},Pt=({className:o,...e})=>{let n=useContext(v),{contentInner:a,content:i}=x({background:n});return jsx(Collapsible.Content,{className:i(),children:jsx("div",{...e,className:a({className:o})})})},yt=({className:o,...e})=>{let n=useContext(v),{fixedContent:a}=x({background:n});return jsx("div",{...e,className:a({className:o})})},Tt=({className:o,onOpenChange:e,children:n,background:a="white",...i})=>{let{root:p}=x({background:a}),d=useCallback(c=>{e?.(c);},[e]);return jsx(v.Provider,{value:a,children:jsx(Collapsible.Root,{onOpenChange:d,className:p({className:o}),...i,children:n})})};export{Et as a,Pt as b,yt as c,Tt as d};
@@ -1 +1 @@
1
- import {a as a$b}from'./chunk-QX4D2CU2.js';import {a as a$4}from'./chunk-ORDWXBDZ.js';import {b as b$2}from'./chunk-3J3A5ETC.js';import {c as c$2,h}from'./chunk-XRFPQJ5P.js';import {a as a$7}from'./chunk-B5KKVXLE.js';import {a as a$9,b as b$3,c as c$5}from'./chunk-GTVHYHF4.js';import {b}from'./chunk-JTLKG23S.js';import {c as c$7}from'./chunk-JYNJHAGL.js';import {d as d$1}from'./chunk-WAUY2MS6.js';import {a as a$a}from'./chunk-NLCRET6U.js';import {a}from'./chunk-FHABUQAH.js';import {a as a$6,b as b$1,c as c$3,d as d$2}from'./chunk-NYURVOJI.js';import {c as c$6}from'./chunk-ZCMXCZC2.js';import {a as a$5}from'./chunk-NGC5DGW6.js';import {d,c as c$1}from'./chunk-TW4CJXQY.js';import {a as a$8}from'./chunk-VIMWKUML.js';import {c as c$4}from'./chunk-23G2RUJ6.js';import {d as d$4}from'./chunk-MP4CHZ2K.js';import {a as a$3}from'./chunk-R6NIURLZ.js';import {a as a$1}from'./chunk-AWRP67K4.js';import {e as e$1}from'./chunk-PI7DECIN.js';import {c,d as d$3,q,k as k$1,h as h$1}from'./chunk-QMPBFFFC.js';import {e}from'./chunk-QYA5ZUUN.js';import {a as a$2}from'./chunk-OBZIYJO7.js';import*as k from'react';import k__default,{createContext,useMemo,useCallback,forwardRef,useRef,useContext,useEffect,useId,useState}from'react';import*as Vt from'@radix-ui/react-portal';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useListCollection,useCombobox,Combobox}from'@ark-ui/react/combobox';import {useFilter}from'@ark-ui/react/locale';import {getDefaultOptions}from'date-fns';import Mn from'react-phone-number-input/locale/en.json';import On from'react-phone-number-input/locale/es.json';import Fn from'react-phone-number-input/locale/pt.json';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 Nl,{parsePhoneNumber,getCountryCallingCode}from'react-phone-number-input';import {getExampleNumber}from'libphonenumber-js/mobile';import fl from'libphonenumber-js/mobile/examples';var Uo=k__default.memo(({handleSelect:e$1,NoResultsIcon:o,noResultsLabel:t,noResultsDescription:n,noResultsDescriptionLines:r,noResultsAsColumn:l,noResultsButtonOnClick:i,optionDescriptionLines:u,noResultsButtonLabel:c,filteredOptions:m,inputRect:p,inputRef:g,popoverPosition:b$1,optionsListRef:d,selectedOption:C,options:v,setFilteredOptions:P})=>jsx(Vt.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:p?{width:`${p.width}px`,left:p.left,top:b$1==="bottom"?`${p.bottom}px`:void 0,bottom:b$1==="top"?`${window.innerHeight-p.top}px`:void 0}:void 0,children:[m.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:t,description:n,Icon:o,iconAsColumn:l,descriptionLines:r}),i&&jsxs(Fragment,{children:[jsx(a$1,{}),jsx(e,{variant:"ghost",className:"my-3 w-fit self-center",onClick:()=>{d.current.style.display="none",g.current.value="",P(v),i();},children:c})]})]}),m.map(y=>jsx(b.Root,{disabled:y.disabled,selected:C?.value===y.value,onClick:()=>e$1(y),children:jsxs(b.Content,{children:[jsx(b.Headline,{children:y.label}),y.description&&jsx(b.Description,{className:a$2({"line-clamp-1":u===1,"line-clamp-2":u===2,"line-clamp-3":u===3,"line-clamp-4":u===4}),children:y.description})]})},y.key??y.value))]})})),Ut=Uo;var qo=336,jl=({options:e,defaultSelectedOption:o,onSelect:t,onClick:n,onInputChange:r,error:l,helperText:i,label:u,placeholder:c,value:m,size:p="md",optionDescriptionLines:g=1,noResultsLabel:b,noResultsIcon:d,noResultsDescription:C,noResultsDescriptionLines:v,noResultsAsColumn:P,noResultsButtonOnClick:y,noResultsButtonLabel:E,className:x,disabled:N})=>{let[h,I]=useState(o??null),A=useRef(null),L=useRef(null),[M,w]=useState(),[V,H]=useState([]),[s,a]=useState("bottom"),[T,D]=useState(),W=qo,_=useCallback(S=>{A.current.style.display="none",L.current.value=S.label,I(S),t?.(S);},[t]),U=useCallback(()=>{if(!L?.current)return;let S=L.current.getBoundingClientRect();w(S);let Y=T?T.height:W,j=window.innerHeight-S.bottom>Y,Oe=S.top>Y;a(j?"bottom":Oe?"top":"bottom");},[T?.height]),le=useCallback(()=>{let S=e.filter(Y=>Y.label.toLowerCase().includes(L?.current?.value.toLowerCase()??""));if(H(S),A?.current){let Y=A.current.getBoundingClientRect();D(Y);}},[e]);return useEffect(()=>{H(e);},[e]),useEffect(()=>{if(!m){I(null),L.current&&(L.current.value="");return}(!L.current?.value||h?.value!==m.value)&&(I(m),L.current.value=m.label);},[m]),a$b(A,()=>{A.current.style.display="none",h&&L.current&&(L.current.value=h.label);}),useEffect(()=>{if(L?.current)return U(),L.current.addEventListener("mousedown",U),L.current.addEventListener("input",le),window.addEventListener("scroll",U,true),window.addEventListener("resize",U),()=>{L.current?.removeEventListener("mousedown",U),L.current?.removeEventListener("input",le),window.removeEventListener("scroll",U,true),window.removeEventListener("resize",U);}},[U,le]),jsxs("div",{className:a$2("relative",x),children:[jsx(a$4,{ref:L,autoComplete:"off",list:"",selectMode:true,onChange:S=>{S.target.value||(I(null),t?.(null)),r?.(S);},onClean:()=>{I(null),H(e),t?.(null);},onClick:S=>{A.current.style.display="flex",n?.(S);},onBlur:()=>{h&&L.current&&(L.current.value=h.label);},label:u,helperText:i,placeholder:c,size:p,error:l,disabled:N}),jsx(Ut,{handleSelect:_,noResultsLabel:b,NoResultsIcon:d,optionDescriptionLines:g,noResultsAsColumn:P,noResultsButtonLabel:E,noResultsButtonOnClick:y,noResultsDescription:C,noResultsDescriptionLines:v,filteredOptions:V,inputRect:M,inputRef:L,popoverPosition:s,optionsListRef:A,selectedOption:h,options:e,setFilteredOptions:H})]})};var Go=({children:e,title:o,titleLines:t,description:n="",descriptionLines:r,disabled:l=false,className:i,...u})=>jsxs("div",{className:a$2("flex w-full flex-col gap-1",i),...u,children:[jsx("p",{className:a$2("text-sm leading-[130%] break-all",!!n&&"font-medium"),style:t?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:t}:void 0,children:o}),n&&jsx("p",{className:a$2("text-xs leading-[130%]",l?"text-neutral-400":"text-neutral-700"),style:r?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:r}:void 0,children:n})]}),se=Go;var si=({children:e,title:o,titleLines:t,description:n="",descriptionLines:r,startIcon:l,badgeContent:i,hasDivider:u=false,disabled:c=false,onSelect:m,className:p,...g})=>jsxs(J,{hasDescription:!!n,disabled:c,onClick:m,hasDivider:u,className:a$2(!c&&"cursor-pointer",p),...g,children:[l&&k__default.cloneElement(l,{className:"shrink-0 mr-2 h-4.5 w-4.5"}),jsx(se,{title:o,titleLines:t,description:n,descriptionLines:r,disabled:c}),jsxs("div",{className:"ml-4 flex gap-2",children:[i&&jsx(a$3,{content:i,size:"lg",variant:"alert",className:a$2("self-center",c&&"bg-neutral-400")}),jsx(h$1,{className:"h-4.5 w-4.5 self-center"})]})]});var bi=({children:e,title:o,titleLines:t=1,description:n="",descriptionLines:r,startIcon:l,hasDivider:i=false,disabled:u=false,checked:c,onCheckedChange:m,className:p,...g})=>jsxs(J,{hasDescription:!!n,disabled:u,hasDivider:i,...g,className:a$2("pr-6",p),children:[l&&k__default.cloneElement(l,{className:"shrink-0 w-4.5 h-4.5 mr-2"}),jsx(se,{title:o,titleLines:t,description:n,descriptionLines:r,disabled:u}),jsx(c$6,{checked:c,onCheckedChange:m,className:"ml-4 self-center",disabled:u})]});var oe=336,jt=createContext({inputRef:null,optionsListRef:null,autocompleteId:"",inputRect:void 0,showChips:false,filteredOptions:[],currentFocus:-1,popoverPosition:"bottom",setFilteredOptions:()=>{},setCurrentFocus:()=>{},setShowChips:()=>{},setPopoverPosition:()=>{},setInputRect:()=>{},optionsListHeight:oe,setOptionsListHeight:()=>{},optionsListRect:void 0,setOptionsListRect:()=>{}}),ee=()=>{let e=useContext(jt);if(e===null)throw new Error("useAutocompleteMultipleContext must be used within a AutocompleteMultipleProvider");return e},Yt=({children:e})=>{let o=useRef(null),t=useRef(null),n=useId(),[r,l]=useState(),[i,u]=useState(true),[c,m]=useState([]),[p,g]=useState(-1),[b,d]=useState("bottom"),[C,v]=useState(),[P,y]=useState(oe);return jsx(jt.Provider,{value:{optionsListRef:o,inputRef:t,autocompleteId:n,inputRect:r,showChips:i,filteredOptions:c,currentFocus:p,popoverPosition:b,setFilteredOptions:m,setCurrentFocus:g,setShowChips:u,setPopoverPosition:d,setInputRect:l,optionsListHeight:P,optionsListRect:C,setOptionsListRect:v,setOptionsListHeight:y},children:e})};var nn=({option:e,onMountWidth:o})=>{let t=useRef(null);return useEffect(()=>{t.current&&o?.(t.current.clientWidth);},[]),jsx(d$1,{variant:"fill",color:"neutral",ref:t,className:"shrink-0",size:"md",hasCloseIcon:false,children:e.label})},Xt=nn;var an=150,cn=k__default.memo(({selectedOptions:e,error:o,onCleanSelectedOptions:t,disabled:n,size:r})=>{let{autocompleteId:l,inputRect:i,inputRef:u,optionsListRef:c$1}=ee(),m=k__default.useRef(null),[p,g]=k__default.useState(new Map),b=useMemo(()=>{if(!i?.width)return [];let C=0,v=i.width-an,P=0;for(let y=0;y<e.length&&(P+=p.get(y)??0,!(P>v));y++)C++;return e.slice(0,C)},[i?.width,e,p]),d=useCallback(()=>{n||(u?.current?.focus(),c$1.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:i?.width?i?.width:void 0,height:i?.height?i?.height:void 0},children:[jsx("div",{className:"flex flex-1 gap-1 overflow-hidden",ref:m,children:b.map((C,v)=>jsx(Xt,{option:C,onMountWidth:P=>g(y=>new Map(y).set(v,P))},`chip-input-${l}-${C.value}`))}),e.length>b.length&&jsx("span",{className:"text-base",children:"..."}),e.length>0&&!o&&jsx(a$3,{content:String(e.length),size:r}),o&&e.length>0&&jsx(c,{className:"text-error-700 h-6 w-6",onClick:C=>{C.stopPropagation(),t();}})]})}),Zt=cn;var mn=k__default.memo(({option:e,index:o,onPressOption:t,isSelected:n,optionDescriptionLines:r})=>{let{currentFocus:l,inputRef:i}=ee();return jsxs(b.Root,{selected:l===o,disabled:e.disabled,onMouseDown:u=>{e.disabled||(i?.current?.value&&u.preventDefault(),t?.(e,u));},children:[jsxs(b.Content,{children:[jsx(b.Headline,{children:e.label}),e.description&&jsx(b.Description,{className:a$2({"line-clamp-1":r===1,"line-clamp-2":r===2,"line-clamp-3":r===3,"line-clamp-4":r===4}),children:e.description})]}),jsx(b.Trailing,{children:jsx(b.CheckboxControl,{checked:n})})]})}),lt=mn;var bn=k__default.memo(({selectedOptions:e$1,handleSelect:o,NoResultsIcon:t,noResultsLabel:n,noResultsDescription:r,noResultsDescriptionLines:l,noResultsAsColumn:i,noResultsButtonOnClick:u,optionDescriptionLines:c,noResultsButtonLabel:m})=>{let{popoverPosition:p,optionsListRef:g,filteredOptions:b,inputRect:d,autocompleteId:C,inputRef:v,optionsListHeight:P}=ee(),y=useCallback(x=>e$1.some(N=>N.value===x.value),[e$1]),E=useMemo(()=>e$1.filter(x=>x.label.toLowerCase().includes(v?.current?.value.toLowerCase()??"")),[e$1,v?.current?.value]);return jsx(Vt.Root,{asChild:true,children:jsxs("div",{ref:g,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:p==="bottom"?`${d.bottom}px`:void 0,bottom:p==="top"?`${window.innerHeight-d.top}px`:void 0,maxHeight:P+"px"}:void 0,children:[b.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:r,Icon:t,iconAsColumn:i,descriptionLines:l}),u&&jsxs(Fragment,{children:[jsx(a$1,{}),jsx(e,{variant:"ghost",className:"my-3 w-fit self-center",onClick:()=>{g.current.style.display="none",v.current.value="",u();},children:m})]})]}),E.map((x,N)=>jsx(lt,{option:x,index:N,onPressOption:h=>o(h),isSelected:y(x),optionDescriptionLines:c},`autocomplete-option-${C}-${x.key??x.value}`)),b.map((x,N)=>!e$1.some(h=>h.value===x.value)&&jsx(lt,{option:x,index:N,onPressOption:h=>o(h),isSelected:y(x),optionDescriptionLines:c},`autocomplete-option-${C}-${x.key??x.value}`))]})})}),to=bn;var xn=k__default.memo(({selectedOptions:e,onSelect:o,error:t,helperText:n,label:r,placeholder:l,options:i,onInputChange:u,size:c,disabled:m})=>{let{setCurrentFocus:p,setFilteredOptions:g,optionsListRef:b,inputRef:d}=ee();return jsx(a$4,{ref:d,autoComplete:"off",list:"",disabled:m,selectMode:true,onChange:C=>{p(-1),u?.(C.target.value);},onClean:()=>{p(-1),g(i),o?.(null,e);},onClick:()=>{m||(b.current.style.display="flex");},error:t,helperText:n,label:r,placeholder:l,fixedTopLabel:e.length>0,size:c})}),oo=xn;var no=({options:e,defaultSelectedOptions:o,onSelect:t,error:n,helperText:r,label:l,placeholder:i,noResultsLabel:u,noResultsIcon:c,noResultsDescription:m,noResultsDescriptionLines:p,noResultsAsColumn:g,noResultsButtonOnClick:b,noResultsButtonLabel:d,className:C,onInputChange:v,value:P,loading:y,size:E="md",optionDescriptionLines:x=1,disabled:N})=>{let{inputRef:h,optionsListRef:I,setFilteredOptions:A,setShowChips:L,setInputRect:M,setPopoverPosition:w,setCurrentFocus:V,showChips:H,setOptionsListRect:s,optionsListRect:a,setOptionsListHeight:T}=ee(),D=useRef(false),[W,_]=useState(o??[]),U=useCallback(G=>{_(X=>{let ie,Ie=X.findIndex(zo=>zo.value===G.value);return Ie===-1?(ie=X.concat(G),t?.(G,ie),ie):(ie=X.toSpliced(Ie,1),t?.(G,ie),ie)});},[t]),le=useCallback(()=>{_([]),A(e),t?.(null,[]);},[]),S=useCallback(()=>{L(false);},[]),Y=useCallback(()=>{L(true);},[]),j=useCallback(()=>{if(!h?.current)return;let G=h.current.getBoundingClientRect();M(G);let X=a?a.height>oe?oe:a.height:oe,ie=window.innerHeight-G.bottom>X,Ie=G.top>X;w(ie?"bottom":Ie?"top":"bottom"),T(Ie?oe:window.innerHeight-G.bottom>oe?oe:window.innerHeight-G.bottom);},[a?.height]),Oe=useCallback(()=>{let G=e.filter(X=>X.label.toLowerCase().includes(h?.current?.value.toLowerCase()??""));if(A(G),I?.current){let X=I.current.getBoundingClientRect();s(X);}},[e,I?.current]);return useEffect(()=>{A(e);},[e]),a$b(I,()=>{I.current.style.display="none",V(-1);}),useEffect(()=>{if(h?.current)return j(),h.current.addEventListener("mousedown",j),h.current.addEventListener("input",Oe),h.current.addEventListener("focusin",S),h.current.addEventListener("focusout",Y),window.addEventListener("scroll",j,true),window.addEventListener("resize",j),()=>{h.current?.removeEventListener("mousedown",j),h.current?.removeEventListener("input",j),h.current?.removeEventListener("focusout",Y),h.current?.removeEventListener("focusin",S),window.removeEventListener("scroll",j,true),window.removeEventListener("resize",j);}},[j,Y,S,Oe]),useEffect(()=>{P&&(_(P),L(true));},[P]),useEffect(()=>{y||o&&o.length&&!D.current&&(_(o),D.current=true,L(true));},[o,y]),jsxs("div",{className:a$2("relative",C),children:[jsx(oo,{selectedOptions:W,onSelect:t,error:n,helperText:r,label:l,placeholder:i,handleSelect:U,options:e,onInputChange:v,size:E,disabled:N}),H&&jsx(Zt,{selectedOptions:W,disabled:N,error:n,onCleanSelectedOptions:le,size:E}),jsx(to,{handleSelect:U,selectedOptions:W,noResultsLabel:u,NoResultsIcon:c,optionDescriptionLines:x,noResultsAsColumn:g,noResultsButtonLabel:d,noResultsButtonOnClick:b,noResultsDescription:m,noResultsDescriptionLines:p})]})};var vs=e=>jsx(Yt,{children:jsx(no,{...e})});var Ye=({children:e,className:o,disabled:t,error:n,helperText:r,htmlFor:l,label:i,labelProps:u,readOnly:c,required:m,tooltip:p})=>{let{root:g}=c$1({error:n,disabled:t,readOnly:c});return jsxs("div",{className:g({className:o}),"data-error":n||void 0,"data-disabled":t||void 0,"data-readonly":c||void 0,children:[i&&jsx(c$4,{...u,as:"label",htmlFor:l,label:i,required:m,tooltip:u?.tooltip??p}),e,jsx(a$8,{children:r})]})};var En=({code:e,codeClassName:o})=>jsxs("div",{className:"flex justify-center gap-2",children:[jsx(a$7,{country:e,className:"size-4.5"}),jsx("span",{className:a$2("text-sm leading-[143%] font-medium text-neutral-800",o),children:e})]}),io=({className:e,disabled:o,error:t,onChange:n,onOpenChange:r,options:l,readOnly:i,translations:u,value:c})=>{let m=k.useRef(null),[p,g]=k.useState(""),[b,d]=k.useState(false),{wrapper:C,input:v,clearIcon:P,searchIcon:y}=b$2({size:"md"}),{contains:E}=useFilter({sensitivity:"base"}),x=k.useMemo(()=>l.map(s=>({...s,key:s.code})),[l]),N=k.useMemo(()=>x.find(s=>s.key===c),[x,c]),{collection:h,filter:I,set:A}=useListCollection({initialItems:x,itemToString:s=>`${s.label} ${s.code}`,itemToValue:s=>s.key,filter:(s,a,T)=>E(s,a)||E(T.code,a.toUpperCase())});k.useEffect(()=>{A(x);},[x,A]);let L=k.useCallback(s=>{d(s),r?.(s);},[r]),M=k.useCallback(({inputValue:s})=>{let a=s??"";g(a),I(a),m.current?.scrollTo({top:0});},[I]),w=k.useCallback(s=>{L(s),s&&(g(""),I(""));},[I,L]),V=k.useCallback(({itemValue:s})=>{if(!s)return;let a=x.find(T=>T.key===s)?.code;a&&(n(a),L(false));},[x,L,n]),H=useCombobox({collection:h,inputBehavior:"autohighlight",inputValue:p,open:b,openOnChange:false,openOnClick:false,selectionBehavior:"preserve",value:N?[N.key]:[],onInputValueChange:M,onOpenChange:({open:s})=>{s||L(false);},onSelect:V});return jsx(Combobox.RootProvider,{value:H,children:jsxs(a$9,{open:b,onOpenChange:w,children:[jsx(b$3,{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-['']",t?"bg-danger-20 after:bg-input-ring-error after:w-0.5":o||i?"after:bg-input-ring-disabled bg-neutral-200":"group-focus-within/id-field:after:bg-input-ring-focus after:bg-input-ring bg-neutral-200 group-focus-within/id-field:after:w-0.5",!t&&b&&"after:bg-input-ring-focus after:w-0.5",e),disabled:o||i,children:N&&jsx(En,{code:N.code,codeClassName:a$2(t?"text-danger-600":void 0,o&&"text-input-text-disabled",i&&"text-input-text-disabled")})})}),jsx(c$5,{portalled:false,className:"w-75 p-0",children:jsxs(Combobox.Content,{children:[jsxs(Combobox.Control,{className:"pb-0",children:[jsxs("div",{className:C({className:"m-1 mb-0"}),children:[jsx(Combobox.Input,{autoComplete:"off","data-1p-ignore":true,"data-lpignore":"true",placeholder:u.searchCountryPlaceholder,className:v()}),!o&&p.length>0&&jsx("button",{type:"button",className:P(),onClick:()=>{H.setInputValue("","clear-trigger");},children:jsx(d$3,{className:"size-4.5"})}),jsx(q,{className:y()})]}),jsx(a$1,{className:"mt-2"})]}),jsx(Combobox.List,{ref:m,className:a$2("h-72 overflow-auto outline-none",{"flex flex-col items-center justify-center":h.items.length===0}),children:h.items.length===0?jsx(a$a,{size:"sm",variant:"not-found"}):jsx(Combobox.ItemGroup,{children:h.items.map(s=>jsxs(Combobox.Item,{item:s,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(a$7,{country:s.code,className:"size-4.5"}),jsx(Combobox.ItemText,{className:"min-w-0 flex-1 truncate text-sm leading-[143%] font-medium",children:s.label}),jsx("span",{className:"shrink-0 text-sm text-neutral-600",children:s.code}),jsx(k$1,{className:a$2("ml-auto size-4 shrink-0",s.key===c?"opacity-100":"opacity-0")})]},s.key))})})]})})]})})};var ct=k.forwardRef(({className:e,clearLabel:o,disabled:t,error:n,onChange:r,readOnly:l,type:i="text",value:u,...c},m)=>{let p=k.useRef(null),g=`${u??""}`.length>0,b=!t&&!l&&g,d$1=b||n;k.useImperativeHandle(m,()=>p.current,[]);let C=k.useCallback(P=>{r?.(P.target.value);},[r]),v=k.useCallback(()=>{r?.(""),p.current?.focus();},[r]);return jsxs("div",{className:a$2("bg-input-bg relative flex h-full min-w-0 flex-1 rounded-r",t&&"bg-input-bg-disabled"),children:[jsx("input",{type:i,"data-slot":"input",className:a$2("text-input-text placeholder:text-input-placeholder h-full min-w-0 flex-1 rounded-r bg-transparent px-3 text-sm leading-[143%] focus-visible:outline-0",d$1&&!n&&"pr-10.5",b&&n&&"pr-14",n&&!b&&"pr-10.5",t&&"text-input-text-disabled",e),...c,disabled:t,readOnly:l,value:u,onChange:C,ref:p}),(b||n)&&jsxs("div",{className:"absolute inset-y-0 right-3 z-10 flex items-center gap-1",children:[b&&jsx(a$5,{ariaLabel:o,onClick:v}),n&&jsx(d,{})]})]})});ct.displayName="IdInput";var pt={en:"Clear identification number",es:"Limpiar n\xFAmero de identificaci\xF3n",pt:"Limpar n\xFAmero de identifica\xE7\xE3o"},ao={en:Mn,es:On,pt:Fn},kn=pt.en,wn=ao.en,Hn={es:{clearIdLabel:pt.es,searchCountryPlaceholder:"Buscar..."},pt:{clearIdLabel:pt.pt,searchCountryPlaceholder:"Pesquisar..."}},Sn={clearIdLabel:kn,searchCountryPlaceholder:"Search..."},co=()=>getDefaultOptions().locale?.code,po=e=>Hn[e]??Sn,Dn=(e,o)=>(ao[o]??wn)[e]??e,uo=({localeCode:e})=>c$2.map(o=>({code:o,label:Dn(o,e)})).sort((o,t)=>o.label.localeCompare(t.label)),mo=a$6,fo=b$1,ho=(e,o)=>{let t=o.trim();return !t||!c$3(e,t).isValid?t:d$2(e,t)};var bo=()=>{},go=k.forwardRef(({autoComplete:e,className:o,country:t,disabled:n,error:r,helperText:l,id:i,label:u,labelProps:c,name:m,onBlur:p,onChange:g=bo,onCountryChange:b=bo,placeholder:d,readOnly:C,required:v,tooltip:P,value:y},E)=>{let[x,N]=k.useState(false),[h,I]=k.useState(y??""),A=k.useId(),L=i??A,M=co(),w=k.useRef(y??"");k.useEffect(()=>{(y??"")!==w.current&&I(y??"");},[y]);let V=k.useMemo(()=>po(M),[M]),H=k.useMemo(()=>uo({localeCode:M}),[M]),s=k.useMemo(()=>fo(t??"")||d||mo,[t,d]),a=c$1({error:r,disabled:n,readOnly:C}),T=k.useCallback((_,U)=>{let le=ho(_,U);w.current=le,g(le);},[g]),D=k.useCallback(_=>{I(_),T(t??"",_);},[t,T]),W=k.useCallback(_=>{b(_),T(_,h);},[h,b,T]);return jsx(Ye,{className:o,disabled:n,error:r,helperText:l,htmlFor:L,label:u,labelProps:c,readOnly:C,required:v,tooltip:P,children:jsxs("div",{className:a$2(a.control(),"group/id-field",!r&&!n&&!C&&x&&"after:ring-input-ring-focus after:ring-2"),children:[jsx(io,{disabled:n,error:r,onChange:W,onOpenChange:N,options:H,readOnly:C,translations:V,value:t}),jsx(ct,{autoComplete:e,clearLabel:V.clearIdLabel,disabled:n,error:r,id:L,name:m,onBlur:p,onChange:D,placeholder:s,readOnly:C,required:v,value:h,ref:E})]})})});go.displayName="IdField";var ga=({children:e$2,title:o,titleLines:t=1,description:n,descriptionLines:r=1,StartIcon:l,hasDivider:i=false,disabled:u=false,actionButton:c,isSelected:m=false,className:p,...g})=>jsxs(J,{hasDescription:!!n,disabled:u,hasDivider:i,isSelected:m,...g,className:p,children:[l&&jsx(l,{className:"mr-2 h-4.5 w-4.5 shrink-0 grow-0"}),jsx(se,{title:o,titleLines:t,description:n,descriptionLines:r,disabled:u}),c&&jsx(Fragment,{children:c.isIcon?jsx(e$1,{...c,className:"ml-4 self-center",variant:"ghost",size:"sm",disabled:u??c.disabled}):jsx(e,{...c,className:"ml-4 self-center",size:"sm",variant:"ghost",disabled:u??c.disabled})})]});var Ea=({title:e,description:o="",descriptionLines:t,hasDivider:n=false,disabled:r=false,checked:l,onCheckedChange:i,className:u,chipStatus:c,chipExpandable:m,...p})=>jsxs(J,{hasDescription:!!o,disabled:r,hasDivider:n,...p,className:a$2("pr-6",u),children:[jsx(c$6,{checked:l,onCheckedChange:i,className:"mr-4 self-center",disabled:r}),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",!!o&&"font-medium"),children:e}),m&&jsx("div",{className:"ml-auto flex min-w-0 flex-shrink-0 items-center justify-end",children:jsx(c$7,{...m})}),c&&jsx("div",{className:"ml-4 flex shrink-0 items-center gap-1",children:jsx(d$4,{...c,size:"xs",className:"shrink-0"})})]}),o&&jsx("p",{className:a$2("text-xs leading-[130%]",r?"text-neutral-400":"text-neutral-700",{"line-clamp-1":t===1,"line-clamp-2":t===2,"line-clamp-3":t===3,"line-clamp-4":t===4}),children:o})]})]});var dt={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"},ft={headings:["h1","h2","h3"],textFormat:["bold","italic","underline"],lists:true,indent:true,alignment:["left","center","right","justify"],undoRedo:true};var ht=({readOnly:e})=>{let[o]=useLexicalComposerContext();return useEffect(()=>{o.setEditable(!e);},[o,e]),null};var bt=({editorRef:e})=>{let[o]=useLexicalComposerContext();return useEffect(()=>(e.current=o,()=>{e.current===o&&(e.current=null);}),[o,e]),null};var Wn={"ql-align-left":"left","ql-align-center":"center","ql-align-right":"right","ql-align-justify":"justify"},Gn={center:"ql-align-center",right:"ql-align-right",justify:"ql-align-justify"},Kn=()=>typeof window<"u"&&typeof window.DOMParser<"u",Co=e=>Kn()?new DOMParser().parseFromString(e,"text/html"):null,Qn=e=>(e??"").replace(/\s+/g," ").trim(),Ct=e=>{let o=0;for(let t of Array.from(e.classList)){let n=t.match(/^ql-indent-(\d+)$/);if(!n)continue;let r=Number.parseInt(n[1],10);Number.isFinite(r)&&(o=Math.max(o,r)),e.classList.remove(t);}return o},jn=e=>{let o=e.querySelectorAll("[class*='ql-align-']");for(let t of Array.from(o))for(let n of Array.from(t.classList)){let r=Wn[n];r&&(r!=="left"&&(t.style.textAlign=r),t.classList.remove(n));}},Yn=e=>{let o=e.querySelectorAll("[class*='ql-indent-']");for(let t of Array.from(o)){if(t.tagName==="LI")continue;let n=Ct(t);n>0&&(t.style.paddingInlineStart=`${n*3}em`);}},Xn=(e,o)=>{let t=e.getAttribute("data-list");return t==="bullet"?"ul":t==="ordered"?"ol":o},Zn=e=>{let o=e.cloneNode(true);return o.removeAttribute("data-list"),o.removeAttribute("data-checked"),o.removeAttribute("data-indent"),Ct(o),o},gt=(e,o)=>e.createElement(o),Jn=(e,o)=>{let t=Array.from(e.children).filter(c=>c.tagName==="LI");if(t.length===0||!t.some(c=>c.hasAttribute("data-list")?true:Array.from(c.classList).some(m=>/^ql-indent-\d+$/.test(m))))return;let r=[],l=[],i=e.tagName==="UL"?"ul":"ol";for(let c of t){let m=Ct(c),p=Xn(c,i),g=Zn(c);for(;l.length>0&&l[l.length-1].level>m;)l.pop();if(l.length===0){let d=gt(o,p);r.push(d),l.push({level:0,kind:p,listElement:d});}let b=l[l.length-1];for(;b.level<m;){let d=b.listElement.lastElementChild;if(!d||d.tagName!=="LI")break;let C=gt(o,p);d.appendChild(C),b={level:b.level+1,kind:p,listElement:C},l.push(b);}if(b=l[l.length-1],b.kind!==p){let d=gt(o,p);if(l.length===1)r.push(d),l[0]={level:0,kind:p,listElement:d};else {let v=l[l.length-2].listElement.lastElementChild;v&&v.tagName==="LI"?(v.appendChild(d),l[l.length-1]={level:b.level,kind:p,listElement:d}):(r.push(d),l.length=1,l[0]={level:0,kind:p,listElement:d});}b=l[l.length-1];}b.listElement.appendChild(g);}if(r.length===0)return;let u=o.createDocumentFragment();for(let c of r)u.appendChild(c);e.replaceWith(u);},er=(e,o)=>{let t=Array.from(e.querySelectorAll("ol, ul"));for(let n of t)Jn(n,o);},xo=(e,o)=>{let t=e.tagName==="UL"?"bullet":"ordered",n=Array.from(e.children).filter(r=>r.tagName==="LI");for(let r of n){r.setAttribute("data-list",t);for(let i of Array.from(r.classList))/^ql-indent-\d+$/.test(i)&&r.classList.remove(i);o>0&&r.classList.add(`ql-indent-${o}`);let l=Array.from(r.children).filter(i=>i.tagName==="UL"||i.tagName==="OL");for(let i of l)xo(i,o+1);}},tr=e=>{let o=e.querySelectorAll("p, h1, h2, h3, h4, h5, h6, li");for(let t of Array.from(o)){let n=t;for(let i of Array.from(n.classList))i.startsWith("ql-align-")&&n.classList.remove(i);let r=n.style.textAlign.trim().toLowerCase(),l=Gn[r];l&&n.classList.add(l);}},Ce=e=>Qn(e).replace(/>\s+</g,"><").replace(/&nbsp;/g," "),xt=e=>{let o=e??"";if(!o.trim())return "";let t=Co(o);if(!t)return o;let{body:n}=t;return jn(n),Yn(n),er(n,t),n.innerHTML},Lt=e=>{if(!e.trim())return "";let o=Co(e);if(!o)return e;let{body:t}=o,n=Array.from(t.querySelectorAll("ul, ol"));for(let r of n)xo(r,0);return tr(t),t.innerHTML};var Xe=e=>{let o="";return e.getEditorState().read(()=>{o=$generateHtmlFromNodes(e,null);}),Lt(o)},cr=(e,o)=>{let t=xt(o);e.update(()=>{let n=$getRoot();if(n.clear(),!t.trim()){n.append($createParagraphNode());return}let l=new DOMParser().parseFromString(t,"text/html"),i=$generateNodesFromDOM(e,l);if(i.length===0){n.append($createParagraphNode());return}n.select(),$insertNodes(i);});},yt=({value:e,isSyncingRef:o})=>{let[t]=useLexicalComposerContext(),n=useRef(null);return useEffect(()=>{let r=e??"";if(n.current!==null&&Ce(r)===Ce(n.current))return;let l=Xe(t);Ce(l)!==Ce(r)&&(o.current=true,cr(t,r),queueMicrotask(()=>{o.current=false;})),n.current=r;},[t,o,e]),null};var yo=["left","center","right","justify"];var Io=["bold","italic","underline","strikethrough","code"];var Wr={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikethrough",code:"code"},Gr={left:jsx(AlignLeftIcon,{className:"size-4"}),center:jsx(AlignCenterIcon,{className:"size-4"}),right:jsx(AlignRightIcon,{className:"size-4"}),justify:jsx(AlignJustifyIcon,{className:"size-4"})},Kr={left:"Align left",center:"Align center",right:"Align right",justify:"Align justify"},Ee={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:"</>"})},Ae={bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",code:"Inline code"},Qr=e=>{let o=e.textFormat;return o===false?[]:Array.isArray(o)?Io.filter(t=>o.includes(t)):["bold","italic","underline"]},jr=e=>{let o=e.alignment;return o===false?[]:Array.isArray(o)?yo.filter(t=>o.includes(t)):["left","center","right","justify"]},Yr=e=>{if(e.headings===false)return [];let o=Array.isArray(e.headings)?e.headings:["h1","h2","h3"];return [{value:"paragraph",label:"Normal"},...o.map(t=>({value:t,label:t.toUpperCase()}))]},Me=()=>jsx("div",{className:"mx-1 h-5 w-px bg-neutral-300"}),Q=({label:e,onClick:o,icon:t,active:n=false,disabled:r=false})=>jsx("button",{type:"button","aria-label":e,title:e,disabled:r,onClick:o,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:t}),vt=({config:e,className:o})=>{let[t]=useLexicalComposerContext(),n=useId(),[r,l]=useState(false),[i,u]=useState(false),[c,m]=useState(false),[p,g]=useState(false),[b,d]=useState(false),[C,v]=useState(false),[P,y]=useState(false),[E,x]=useState("paragraph"),[N,h]=useState("left"),I=useMemo(()=>Qr(e),[e]),A=useMemo(()=>jr(e),[e]),L=useMemo(()=>Yr(e),[e]),M=useCallback(()=>{let s=$getSelection();if(!$isRangeSelection(s))return;m(s.hasFormat("bold")),g(s.hasFormat("italic")),d(s.hasFormat("underline")),v(s.hasFormat("strikethrough")),y(s.hasFormat("code"));let a=s.anchor.getNode(),T=a.getKey()==="root"?a:a.getTopLevelElementOrThrow();if($isListNode(T))x(T.getListType()==="number"?"ol":"ul");else {let W=$findMatchingParent(T,_=>$isListNode(_));$isListNode(W)?x(W.getListType()==="number"?"ol":"ul"):x($isHeadingNode(T)?T.getTag():T.getType());}let D=$isElementNode(T)?T.getFormatType():"";h(D==="center"||D==="right"||D==="justify"?D:"left");},[]);useEffect(()=>mergeRegister(t.registerUpdateListener(({editorState:s})=>{s.read(()=>{M();});}),t.registerCommand(SELECTION_CHANGE_COMMAND,()=>(M(),false),1),t.registerCommand(CAN_UNDO_COMMAND,s=>(l(s),false),1),t.registerCommand(CAN_REDO_COMMAND,s=>(u(s),false),1)),[t,M]);let w=s=>{t.dispatchCommand(FORMAT_TEXT_COMMAND,Wr[s]);},V=s=>{t.update(()=>{let a=$getSelection();if($isRangeSelection(a)){if(s==="paragraph"){$setBlocksType(a,()=>$createParagraphNode());return}$setBlocksType(a,()=>$createHeadingNode(s));}});},H=s=>{if(E===(s==="bullet"?"ul":"ol")){t.dispatchCommand(REMOVE_LIST_COMMAND,void 0);return}t.dispatchCommand(s==="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",o),children:[e.undoRedo!==false&&jsxs(Fragment,{children:[jsx(Q,{label:"Undo",onClick:()=>t.dispatchCommand(UNDO_COMMAND,void 0),disabled:!r,icon:jsx(UndoIcon,{className:"size-4"})}),jsx(Q,{label:"Redo",onClick:()=>t.dispatchCommand(REDO_COMMAND,void 0),disabled:!i,icon:jsx(RedoIcon,{className:"size-4"})}),jsx(Me,{})]}),L.length>0&&jsxs(Fragment,{children:[jsx("label",{className:"sr-only",htmlFor:n,children:"Text style"}),jsx("select",{id:n,value:E.startsWith("h")?E:"paragraph",onChange:s=>V(s.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:L.map(s=>jsx("option",{value:s.value,children:s.label},s.value))}),jsx(Me,{})]}),I.length>0&&jsxs(Fragment,{children:[I.includes("bold")&&jsx(Q,{label:Ae.bold,onClick:()=>w("bold"),icon:Ee.bold,active:c}),I.includes("italic")&&jsx(Q,{label:Ae.italic,onClick:()=>w("italic"),icon:Ee.italic,active:p}),I.includes("underline")&&jsx(Q,{label:Ae.underline,onClick:()=>w("underline"),icon:Ee.underline,active:b}),I.includes("strikethrough")&&jsx(Q,{label:Ae.strikethrough,onClick:()=>w("strikethrough"),icon:Ee.strikethrough,active:C}),I.includes("code")&&jsx(Q,{label:Ae.code,onClick:()=>w("code"),icon:Ee.code,active:P}),jsx(Me,{})]}),e.lists!==false&&jsxs(Fragment,{children:[jsx(Q,{label:"Bulleted list",onClick:()=>H("bullet"),icon:jsx(ListIcon,{className:"size-4"}),active:E==="ul"}),jsx(Q,{label:"Numbered list",onClick:()=>H("number"),icon:jsx(ListOrderedIcon,{className:"size-4"}),active:E==="ol"}),jsx(Me,{})]}),e.indent!==false&&jsxs(Fragment,{children:[jsx(Q,{label:"Decrease indent",onClick:()=>t.dispatchCommand(OUTDENT_CONTENT_COMMAND,void 0),icon:jsx(IndentDecreaseIcon,{className:"size-4"})}),jsx(Q,{label:"Increase indent",onClick:()=>t.dispatchCommand(INDENT_CONTENT_COMMAND,void 0),icon:jsx(IndentIncreaseIcon,{className:"size-4"})}),jsx(Me,{})]}),A.length>0&&jsx(Fragment,{children:A.map(s=>jsx(Q,{label:Kr[s],onClick:()=>t.dispatchCommand(FORMAT_ELEMENT_COMMAND,s),icon:Gr[s],active:N===s},s))})]})};var To=e=>{if(e!==void 0)return typeof e=="number"?`${e}px`:e},ul=forwardRef(({value:e,onChange:o,onBlur:t,onError:n,placeholder:r="Write your content...",readOnly:l=false,showToolbar:i=true,toolbarConfig:u=ft,className:c,editorClassName:m,toolbarClassName:p,autoFocus:g=false,minHeight:b=160,maxHeight:d,error:C=false,errorMessage:v,editorRef:P},y)=>{let E=useRef(false),x=useMemo(()=>({namespace:"SodtrackRichTextEditor",theme:dt,onError:(h,I)=>{if(n){n(h,I);return}console.error("RichTextEditor error",h);},nodes:[HeadingNode,ListNode,ListItemNode]}),[n]),N={minHeight:To(b),maxHeight:To(d),overflowY:d?"auto":void 0};return jsx(LexicalComposer,{initialConfig:x,children:jsxs("div",{className:"w-full",children:[jsxs("div",{ref:y,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",C?"border-error-500 focus-within:border-error-500 focus-within:ring-error-500":"border-neutral-500",l&&"border-neutral-300 bg-neutral-50 focus-within:ring-0",c),"data-error":C,"data-readonly":l,children:[i&&!l&&jsx(vt,{config:u,className:p}),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",l&&"cursor-default",m),style:N,onBlur:t,"aria-invalid":C}),placeholder:l?null:jsx("div",{className:"pointer-events-none absolute top-3 left-4 text-sm text-neutral-500",children:r}),ErrorBoundary:LexicalErrorBoundary}),jsx(HistoryPlugin,{}),jsx(ListPlugin,{}),jsx(ht,{readOnly:l}),jsx(yt,{value:e,isSyncingRef:E}),g&&!l&&jsx(AutoFocusPlugin,{}),P&&jsx(bt,{editorRef:P}),jsx(OnChangePlugin,{ignoreSelectionChange:true,onChange:(h,I)=>{!o||E.current||o(Xe(I),h);}})]}),C&&v&&jsx("p",{className:"text-error-500 mt-1 text-xs leading-[133%]",children:v})]})})});ul.displayName="RichTextEditor";var Eo={en:Mn,es:On,pt:Fn},xl={es:{clearPhoneNumberLabel:"Eliminar n\xFAmero de tel\xE9fono",searchCountryPlaceholder:"Buscar..."},pt:{clearPhoneNumberLabel:"Limpar n\xFAmero de telefone",searchCountryPlaceholder:"Pesquisar..."}},Ll={clearPhoneNumberLabel:"Clear phone number",searchCountryPlaceholder:"Search..."},yl=Eo.en,Ao="9 1234 5678",Pt="ZZ",Mo=()=>{},Ze=e=>xl[e]??Ll,Oo=e=>Eo[e]??yl,Fo=e=>{if(e)try{let o=parsePhoneNumber(e)?.country;return !o||!h(o)?void 0:o}catch{return}},ko=e=>{if(e)return getExampleNumber(e,fl)?.formatNational()},Je=e=>e??Pt,et=()=>getDefaultOptions().locale?.code;var Tl=({Icon:e,callingCode:o,country:t,countryName:n,callingCodeClassName:r})=>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:t,label:n})}),o&&jsx("span",{className:a$2("text-sm leading-[143%] font-medium text-neutral-800",r),children:`+${o}`})]}),wo=({className:e,disabled:o,error:t,iconComponent:n,onChange:r,onOpenChange:l,options:i,readOnly:u,translations:c,value:m})=>{let p=k.useRef(null),[g,b]=k.useState(""),[d,C]=k.useState(false),{wrapper:v,input:P,clearIcon:y,searchIcon:E}=b$2({size:"md"}),{contains:x}=useFilter({sensitivity:"base"}),N=k.useMemo(()=>i.filter(a=>a.value!==void 0&&h(a.value)).map(a=>({callingCode:a.value?getCountryCallingCode(a.value):void 0,country:a.value,key:Je(a.value),label:a.label})),[i]),h$1=k.useMemo(()=>N.find(a=>a.key===Je(m)),[N,m]),{collection:I,filter:A,set:L}=useListCollection({initialItems:N,itemToString:a=>a.callingCode?`${a.label} +${a.callingCode}`:a.label,itemToValue:a=>a.key,filter:(a,T,D)=>{let W=T.trim().replace(/^\+/,"");return x(a,T)||(D.country?x(D.country,T.toUpperCase()):false)||(D.callingCode?x(D.callingCode,W)||x(`+${D.callingCode}`,T):false)}});k.useEffect(()=>{L(N);},[N,L]);let M=k.useCallback(a=>{C(a),l?.(a);},[l]),w=k.useCallback(({inputValue:a})=>{let T=a??"";b(T),A(T),p.current?.scrollTo({top:0});},[A]),V=k.useCallback(a=>{M(a),a&&(b(""),A(""));},[A,M]),H=k.useCallback(({itemValue:a})=>{if(!a||a===Pt){r(void 0),M(false);return}h(a)&&(r(a),M(false));},[M,r]),s=useCombobox({collection:I,inputBehavior:"autohighlight",inputValue:g,open:d,openOnChange:false,openOnClick:false,selectionBehavior:"preserve",value:h$1?[h$1.key]:[],onInputValueChange:w,onOpenChange:({open:a})=>{a||M(false);},onSelect:H});return jsx(Combobox.RootProvider,{value:s,children:jsxs(a$9,{open:d,onOpenChange:V,children:[jsx(b$3,{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-['']",t?"bg-danger-20 after:bg-input-ring-error after:w-0.5":o||u?"after:bg-input-ring-disabled bg-neutral-200":"group-focus-within/phone:after:bg-input-ring-focus after:bg-input-ring bg-neutral-200 group-focus-within/phone:after:w-0.5",!t&&d&&"after:bg-input-ring-focus after:w-0.5",e),disabled:o||u,children:h$1&&jsx(Tl,{Icon:n,callingCode:h$1.callingCode,country:h$1.country,countryName:h$1.label,callingCodeClassName:a$2(t?"text-danger-600":void 0,o&&"text-input-text-disabled",u&&"text-input-text-disabled")})})}),jsx(c$5,{portalled:false,className:"w-75 p-0",children:jsxs(Combobox.Content,{children:[jsxs(Combobox.Control,{className:"pb-0",children:[jsxs("div",{className:v({className:"m-1 mb-0"}),children:[jsx(Combobox.Input,{autoComplete:"off","data-1p-ignore":true,"data-lpignore":"true",placeholder:c.searchCountryPlaceholder,className:P()}),!o&&g.length>0&&jsx("button",{type:"button",className:y(),onClick:()=>{s.setInputValue("","clear-trigger");},children:jsx(d$3,{className:"size-4.5"})}),jsx(q,{className:E()})]}),jsx(a$1,{className:"mt-2"})]}),jsx(Combobox.List,{ref:p,className:a$2("h-72 overflow-auto outline-none",{"flex flex-col items-center justify-center":I.items.length===0}),children:I.items.length===0?jsx(a$a,{size:"sm",variant:"not-found"}):jsx(Combobox.ItemGroup,{children:I.items.map(a=>jsxs(Combobox.Item,{item:a,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:a.country,label:a.label})}),jsx(Combobox.ItemText,{className:"min-w-0 flex-1 truncate text-sm leading-[143%] font-medium",children:a.label}),a.callingCode&&jsx("span",{className:"shrink-0 text-sm text-neutral-600",children:`+${a.callingCode}`}),jsx(k$1,{className:a$2("ml-auto size-4 shrink-0",a.key===Je(m)?"opacity-100":"opacity-0")})]},a.key))})})]})})]})})};var Nt=k.forwardRef(({className:e,disabled:o,error:t,onChange:n,readOnly:r,type:l,value:i,...u},c)=>{let m=et(),p=k.useMemo(()=>Ze(m),[m]),g=k.useRef(null),d$1=!o&&!r&&!!i,C=d$1||t;k.useImperativeHandle(c,()=>g.current,[]);let v=k.useCallback(()=>{let P=g.current;if(!P){n?.({target:{value:""}});return}P.value="",n?.({target:P}),P.focus();},[n]);return jsxs("div",{className:a$2("bg-input-bg relative flex h-full min-w-0 flex-1 rounded-r",o&&"bg-input-bg-disabled"),children:[jsx("input",{type:l,"data-slot":"input",className:a$2("text-input-text placeholder:text-input-placeholder h-full min-w-0 flex-1 rounded-r bg-transparent px-3 text-sm leading-[143%] focus-visible:outline-0",C&&!t&&"pr-10.5",d$1&&t&&"pr-14",t&&!d$1&&"pr-10.5",o&&"text-input-text-disabled",e),...u,disabled:o,readOnly:r,value:i,onChange:n,ref:g}),(d$1||t)&&jsxs("div",{className:"absolute inset-y-0 right-3 z-10 flex items-center gap-1",children:[d$1&&jsx(a$5,{ariaLabel:p.clearPhoneNumberLabel,onClick:v}),t&&jsx(d,{})]})]})});Nt.displayName="PhoneNumberInputComponent";var El=Nl,Do=k.forwardRef(({className:e,defaultCountry:o,disabled:t,error:n,helperText:r,id:l,label:i,labelProps:u,onChange:c=Mo,placeholder:m,readOnly:p,required:g,tooltip:b,value:d,...C},v)=>{let[P,y]=k.useState(false),[E,x]=k.useState(()=>Fo(d)??o),N=k.useId(),h=l??N,I=et(),A=k.useMemo(()=>Ze(I),[I]),L=k.useMemo(()=>Oo(I),[I]),M=k.useMemo(()=>ko(E)??m??Ao,[m,E]),w=c$1({error:n,disabled:t,readOnly:p}),V=a$2(w.control(),"group/phone [&_.PhoneInputCountryIconImg]:size-4.5!",!n&&!t&&!p&&P&&"after:ring-input-ring-focus after:ring-2"),H=k.useCallback(s=>{x(s);},[]);return jsx(Ye,{className:e,disabled:t,error:n,helperText:r,htmlFor:h,label:i,labelProps:u,readOnly:p,required:g,tooltip:b,children:jsx(El,{...C,className:V,ref:v,countrySelectComponent:wo,countrySelectProps:{error:n,onOpenChange:y,translations:A},defaultCountry:o,disabled:t,flagComponent:a$7,id:h,initialValueFormat:"national",inputComponent:Nt,labels:L,numberInputProps:{error:n,placeholder:M},readOnly:p,required:g,value:d,onChange:c,onCountryChange:H})})});Do.displayName="PhoneInput";var Al=({children:e,hasDescription:o=false,disabled:t=false,hasDivider:n=false,className:r,isSelected:l,onClick:i,...u})=>jsxs(Fragment,{children:[jsx("div",{className:a$2("flex flex-row px-3 py-4 text-neutral-900 transition-colors",o?"py-3":"py-3.5",t?"cursor-not-allowed text-neutral-400":a$2("hover:bg-primary-100 focus:bg-primary-200",!!i?"cursor-pointer":"cursor-default"),l&&"bg-primary-200",r),onClick:m=>{t||i?.(m);},...u,children:e}),n&&jsx(a$1,{})]}),J=Al;var um=({children:e,title:o,titleLines:t,description:n="",descriptionLines:r,startIcon:l,endIcon:i,hasDivider:u=false,disabled:c=false,isSelected:m=false,className:p,...g})=>jsxs(J,{hasDescription:!!n,disabled:c,hasDivider:u,className:p,isSelected:m,...g,children:[l&&k__default.cloneElement(l,{className:"shrink-0 mr-2 h-4.5 w-4.5"}),jsx(se,{title:o,titleLines:t,description:n,descriptionLines:r,disabled:c}),i&&k__default.cloneElement(i,{className:"min-h-4.5 min-w-4.5 self-center ml-4"})]});export{jl as a,um as b,si as c,bi as d,vs as e,go as f,ga as g,Ea as h,dt as i,ft as j,Ce as k,xt as l,Lt as m,ul as n,Do as o};
1
+ import {a as a$b}from'./chunk-QX4D2CU2.js';import {a as a$4}from'./chunk-ORDWXBDZ.js';import {b as b$2}from'./chunk-3J3A5ETC.js';import {c as c$2,h}from'./chunk-XRFPQJ5P.js';import {a as a$7}from'./chunk-B5KKVXLE.js';import {a as a$9,b as b$3,c as c$5}from'./chunk-GTVHYHF4.js';import {b}from'./chunk-F2W4ZYYU.js';import {c as c$7}from'./chunk-JYNJHAGL.js';import {d as d$1}from'./chunk-WAUY2MS6.js';import {a as a$a}from'./chunk-NLCRET6U.js';import {a}from'./chunk-FHABUQAH.js';import {a as a$6,b as b$1,c as c$3,d as d$2}from'./chunk-NYURVOJI.js';import {c as c$6}from'./chunk-PF4MVOF5.js';import {a as a$5}from'./chunk-NGC5DGW6.js';import {d,c as c$1}from'./chunk-TW4CJXQY.js';import {a as a$8}from'./chunk-VIMWKUML.js';import {c as c$4}from'./chunk-23G2RUJ6.js';import {d as d$4}from'./chunk-MP4CHZ2K.js';import {a as a$3}from'./chunk-R6NIURLZ.js';import {a as a$1}from'./chunk-AWRP67K4.js';import {e as e$1}from'./chunk-PI7DECIN.js';import {c,d as d$3,q,k as k$1,h as h$1}from'./chunk-QMPBFFFC.js';import {e}from'./chunk-QYA5ZUUN.js';import {a as a$2}from'./chunk-OBZIYJO7.js';import*as k from'react';import k__default,{createContext,useMemo,useCallback,forwardRef,useRef,useContext,useEffect,useId,useState}from'react';import*as Vt from'@radix-ui/react-portal';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useListCollection,useCombobox,Combobox}from'@ark-ui/react/combobox';import {useFilter}from'@ark-ui/react/locale';import {getDefaultOptions}from'date-fns';import Mn from'react-phone-number-input/locale/en.json';import On from'react-phone-number-input/locale/es.json';import Fn from'react-phone-number-input/locale/pt.json';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 Nl,{parsePhoneNumber,getCountryCallingCode}from'react-phone-number-input';import {getExampleNumber}from'libphonenumber-js/mobile';import fl from'libphonenumber-js/mobile/examples';var Uo=k__default.memo(({handleSelect:e$1,NoResultsIcon:o,noResultsLabel:t,noResultsDescription:n,noResultsDescriptionLines:r,noResultsAsColumn:l,noResultsButtonOnClick:i,optionDescriptionLines:u,noResultsButtonLabel:c,filteredOptions:m,inputRect:p,inputRef:g,popoverPosition:b$1,optionsListRef:d,selectedOption:C,options:v,setFilteredOptions:P})=>jsx(Vt.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:p?{width:`${p.width}px`,left:p.left,top:b$1==="bottom"?`${p.bottom}px`:void 0,bottom:b$1==="top"?`${window.innerHeight-p.top}px`:void 0}:void 0,children:[m.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:t,description:n,Icon:o,iconAsColumn:l,descriptionLines:r}),i&&jsxs(Fragment,{children:[jsx(a$1,{}),jsx(e,{variant:"ghost",className:"my-3 w-fit self-center",onClick:()=>{d.current.style.display="none",g.current.value="",P(v),i();},children:c})]})]}),m.map(y=>jsx(b.Root,{disabled:y.disabled,selected:C?.value===y.value,onClick:()=>e$1(y),children:jsxs(b.Content,{children:[jsx(b.Headline,{children:y.label}),y.description&&jsx(b.Description,{className:a$2({"line-clamp-1":u===1,"line-clamp-2":u===2,"line-clamp-3":u===3,"line-clamp-4":u===4}),children:y.description})]})},y.key??y.value))]})})),Ut=Uo;var qo=336,jl=({options:e,defaultSelectedOption:o,onSelect:t,onClick:n,onInputChange:r,error:l,helperText:i,label:u,placeholder:c,value:m,size:p="md",optionDescriptionLines:g=1,noResultsLabel:b,noResultsIcon:d,noResultsDescription:C,noResultsDescriptionLines:v,noResultsAsColumn:P,noResultsButtonOnClick:y,noResultsButtonLabel:E,className:x,disabled:N})=>{let[h,I]=useState(o??null),A=useRef(null),L=useRef(null),[M,w]=useState(),[V,H]=useState([]),[s,a]=useState("bottom"),[T,D]=useState(),W=qo,_=useCallback(S=>{A.current.style.display="none",L.current.value=S.label,I(S),t?.(S);},[t]),U=useCallback(()=>{if(!L?.current)return;let S=L.current.getBoundingClientRect();w(S);let Y=T?T.height:W,j=window.innerHeight-S.bottom>Y,Oe=S.top>Y;a(j?"bottom":Oe?"top":"bottom");},[T?.height]),le=useCallback(()=>{let S=e.filter(Y=>Y.label.toLowerCase().includes(L?.current?.value.toLowerCase()??""));if(H(S),A?.current){let Y=A.current.getBoundingClientRect();D(Y);}},[e]);return useEffect(()=>{H(e);},[e]),useEffect(()=>{if(!m){I(null),L.current&&(L.current.value="");return}(!L.current?.value||h?.value!==m.value)&&(I(m),L.current.value=m.label);},[m]),a$b(A,()=>{A.current.style.display="none",h&&L.current&&(L.current.value=h.label);}),useEffect(()=>{if(L?.current)return U(),L.current.addEventListener("mousedown",U),L.current.addEventListener("input",le),window.addEventListener("scroll",U,true),window.addEventListener("resize",U),()=>{L.current?.removeEventListener("mousedown",U),L.current?.removeEventListener("input",le),window.removeEventListener("scroll",U,true),window.removeEventListener("resize",U);}},[U,le]),jsxs("div",{className:a$2("relative",x),children:[jsx(a$4,{ref:L,autoComplete:"off",list:"",selectMode:true,onChange:S=>{S.target.value||(I(null),t?.(null)),r?.(S);},onClean:()=>{I(null),H(e),t?.(null);},onClick:S=>{A.current.style.display="flex",n?.(S);},onBlur:()=>{h&&L.current&&(L.current.value=h.label);},label:u,helperText:i,placeholder:c,size:p,error:l,disabled:N}),jsx(Ut,{handleSelect:_,noResultsLabel:b,NoResultsIcon:d,optionDescriptionLines:g,noResultsAsColumn:P,noResultsButtonLabel:E,noResultsButtonOnClick:y,noResultsDescription:C,noResultsDescriptionLines:v,filteredOptions:V,inputRect:M,inputRef:L,popoverPosition:s,optionsListRef:A,selectedOption:h,options:e,setFilteredOptions:H})]})};var Go=({children:e,title:o,titleLines:t,description:n="",descriptionLines:r,disabled:l=false,className:i,...u})=>jsxs("div",{className:a$2("flex w-full flex-col gap-1",i),...u,children:[jsx("p",{className:a$2("text-sm leading-[130%] break-all",!!n&&"font-medium"),style:t?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:t}:void 0,children:o}),n&&jsx("p",{className:a$2("text-xs leading-[130%]",l?"text-neutral-400":"text-neutral-700"),style:r?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:r}:void 0,children:n})]}),se=Go;var si=({children:e,title:o,titleLines:t,description:n="",descriptionLines:r,startIcon:l,badgeContent:i,hasDivider:u=false,disabled:c=false,onSelect:m,className:p,...g})=>jsxs(J,{hasDescription:!!n,disabled:c,onClick:m,hasDivider:u,className:a$2(!c&&"cursor-pointer",p),...g,children:[l&&k__default.cloneElement(l,{className:"shrink-0 mr-2 h-4.5 w-4.5"}),jsx(se,{title:o,titleLines:t,description:n,descriptionLines:r,disabled:c}),jsxs("div",{className:"ml-4 flex gap-2",children:[i&&jsx(a$3,{content:i,size:"lg",variant:"alert",className:a$2("self-center",c&&"bg-neutral-400")}),jsx(h$1,{className:"h-4.5 w-4.5 self-center"})]})]});var bi=({children:e,title:o,titleLines:t=1,description:n="",descriptionLines:r,startIcon:l,hasDivider:i=false,disabled:u=false,checked:c,onCheckedChange:m,className:p,...g})=>jsxs(J,{hasDescription:!!n,disabled:u,hasDivider:i,...g,className:a$2("pr-6",p),children:[l&&k__default.cloneElement(l,{className:"shrink-0 w-4.5 h-4.5 mr-2"}),jsx(se,{title:o,titleLines:t,description:n,descriptionLines:r,disabled:u}),jsx(c$6,{checked:c,onCheckedChange:m,className:"ml-4 self-center",disabled:u})]});var oe=336,jt=createContext({inputRef:null,optionsListRef:null,autocompleteId:"",inputRect:void 0,showChips:false,filteredOptions:[],currentFocus:-1,popoverPosition:"bottom",setFilteredOptions:()=>{},setCurrentFocus:()=>{},setShowChips:()=>{},setPopoverPosition:()=>{},setInputRect:()=>{},optionsListHeight:oe,setOptionsListHeight:()=>{},optionsListRect:void 0,setOptionsListRect:()=>{}}),ee=()=>{let e=useContext(jt);if(e===null)throw new Error("useAutocompleteMultipleContext must be used within a AutocompleteMultipleProvider");return e},Yt=({children:e})=>{let o=useRef(null),t=useRef(null),n=useId(),[r,l]=useState(),[i,u]=useState(true),[c,m]=useState([]),[p,g]=useState(-1),[b,d]=useState("bottom"),[C,v]=useState(),[P,y]=useState(oe);return jsx(jt.Provider,{value:{optionsListRef:o,inputRef:t,autocompleteId:n,inputRect:r,showChips:i,filteredOptions:c,currentFocus:p,popoverPosition:b,setFilteredOptions:m,setCurrentFocus:g,setShowChips:u,setPopoverPosition:d,setInputRect:l,optionsListHeight:P,optionsListRect:C,setOptionsListRect:v,setOptionsListHeight:y},children:e})};var nn=({option:e,onMountWidth:o})=>{let t=useRef(null);return useEffect(()=>{t.current&&o?.(t.current.clientWidth);},[]),jsx(d$1,{variant:"fill",color:"neutral",ref:t,className:"shrink-0",size:"md",hasCloseIcon:false,children:e.label})},Xt=nn;var an=150,cn=k__default.memo(({selectedOptions:e,error:o,onCleanSelectedOptions:t,disabled:n,size:r})=>{let{autocompleteId:l,inputRect:i,inputRef:u,optionsListRef:c$1}=ee(),m=k__default.useRef(null),[p,g]=k__default.useState(new Map),b=useMemo(()=>{if(!i?.width)return [];let C=0,v=i.width-an,P=0;for(let y=0;y<e.length&&(P+=p.get(y)??0,!(P>v));y++)C++;return e.slice(0,C)},[i?.width,e,p]),d=useCallback(()=>{n||(u?.current?.focus(),c$1.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:i?.width?i?.width:void 0,height:i?.height?i?.height:void 0},children:[jsx("div",{className:"flex flex-1 gap-1 overflow-hidden",ref:m,children:b.map((C,v)=>jsx(Xt,{option:C,onMountWidth:P=>g(y=>new Map(y).set(v,P))},`chip-input-${l}-${C.value}`))}),e.length>b.length&&jsx("span",{className:"text-base",children:"..."}),e.length>0&&!o&&jsx(a$3,{content:String(e.length),size:r}),o&&e.length>0&&jsx(c,{className:"text-error-700 h-6 w-6",onClick:C=>{C.stopPropagation(),t();}})]})}),Zt=cn;var mn=k__default.memo(({option:e,index:o,onPressOption:t,isSelected:n,optionDescriptionLines:r})=>{let{currentFocus:l,inputRef:i}=ee();return jsxs(b.Root,{selected:l===o,disabled:e.disabled,onMouseDown:u=>{e.disabled||(i?.current?.value&&u.preventDefault(),t?.(e,u));},children:[jsxs(b.Content,{children:[jsx(b.Headline,{children:e.label}),e.description&&jsx(b.Description,{className:a$2({"line-clamp-1":r===1,"line-clamp-2":r===2,"line-clamp-3":r===3,"line-clamp-4":r===4}),children:e.description})]}),jsx(b.Trailing,{children:jsx(b.CheckboxControl,{checked:n})})]})}),lt=mn;var bn=k__default.memo(({selectedOptions:e$1,handleSelect:o,NoResultsIcon:t,noResultsLabel:n,noResultsDescription:r,noResultsDescriptionLines:l,noResultsAsColumn:i,noResultsButtonOnClick:u,optionDescriptionLines:c,noResultsButtonLabel:m})=>{let{popoverPosition:p,optionsListRef:g,filteredOptions:b,inputRect:d,autocompleteId:C,inputRef:v,optionsListHeight:P}=ee(),y=useCallback(x=>e$1.some(N=>N.value===x.value),[e$1]),E=useMemo(()=>e$1.filter(x=>x.label.toLowerCase().includes(v?.current?.value.toLowerCase()??"")),[e$1,v?.current?.value]);return jsx(Vt.Root,{asChild:true,children:jsxs("div",{ref:g,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:p==="bottom"?`${d.bottom}px`:void 0,bottom:p==="top"?`${window.innerHeight-d.top}px`:void 0,maxHeight:P+"px"}:void 0,children:[b.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:r,Icon:t,iconAsColumn:i,descriptionLines:l}),u&&jsxs(Fragment,{children:[jsx(a$1,{}),jsx(e,{variant:"ghost",className:"my-3 w-fit self-center",onClick:()=>{g.current.style.display="none",v.current.value="",u();},children:m})]})]}),E.map((x,N)=>jsx(lt,{option:x,index:N,onPressOption:h=>o(h),isSelected:y(x),optionDescriptionLines:c},`autocomplete-option-${C}-${x.key??x.value}`)),b.map((x,N)=>!e$1.some(h=>h.value===x.value)&&jsx(lt,{option:x,index:N,onPressOption:h=>o(h),isSelected:y(x),optionDescriptionLines:c},`autocomplete-option-${C}-${x.key??x.value}`))]})})}),to=bn;var xn=k__default.memo(({selectedOptions:e,onSelect:o,error:t,helperText:n,label:r,placeholder:l,options:i,onInputChange:u,size:c,disabled:m})=>{let{setCurrentFocus:p,setFilteredOptions:g,optionsListRef:b,inputRef:d}=ee();return jsx(a$4,{ref:d,autoComplete:"off",list:"",disabled:m,selectMode:true,onChange:C=>{p(-1),u?.(C.target.value);},onClean:()=>{p(-1),g(i),o?.(null,e);},onClick:()=>{m||(b.current.style.display="flex");},error:t,helperText:n,label:r,placeholder:l,fixedTopLabel:e.length>0,size:c})}),oo=xn;var no=({options:e,defaultSelectedOptions:o,onSelect:t,error:n,helperText:r,label:l,placeholder:i,noResultsLabel:u,noResultsIcon:c,noResultsDescription:m,noResultsDescriptionLines:p,noResultsAsColumn:g,noResultsButtonOnClick:b,noResultsButtonLabel:d,className:C,onInputChange:v,value:P,loading:y,size:E="md",optionDescriptionLines:x=1,disabled:N})=>{let{inputRef:h,optionsListRef:I,setFilteredOptions:A,setShowChips:L,setInputRect:M,setPopoverPosition:w,setCurrentFocus:V,showChips:H,setOptionsListRect:s,optionsListRect:a,setOptionsListHeight:T}=ee(),D=useRef(false),[W,_]=useState(o??[]),U=useCallback(G=>{_(X=>{let ie,Ie=X.findIndex(zo=>zo.value===G.value);return Ie===-1?(ie=X.concat(G),t?.(G,ie),ie):(ie=X.toSpliced(Ie,1),t?.(G,ie),ie)});},[t]),le=useCallback(()=>{_([]),A(e),t?.(null,[]);},[]),S=useCallback(()=>{L(false);},[]),Y=useCallback(()=>{L(true);},[]),j=useCallback(()=>{if(!h?.current)return;let G=h.current.getBoundingClientRect();M(G);let X=a?a.height>oe?oe:a.height:oe,ie=window.innerHeight-G.bottom>X,Ie=G.top>X;w(ie?"bottom":Ie?"top":"bottom"),T(Ie?oe:window.innerHeight-G.bottom>oe?oe:window.innerHeight-G.bottom);},[a?.height]),Oe=useCallback(()=>{let G=e.filter(X=>X.label.toLowerCase().includes(h?.current?.value.toLowerCase()??""));if(A(G),I?.current){let X=I.current.getBoundingClientRect();s(X);}},[e,I?.current]);return useEffect(()=>{A(e);},[e]),a$b(I,()=>{I.current.style.display="none",V(-1);}),useEffect(()=>{if(h?.current)return j(),h.current.addEventListener("mousedown",j),h.current.addEventListener("input",Oe),h.current.addEventListener("focusin",S),h.current.addEventListener("focusout",Y),window.addEventListener("scroll",j,true),window.addEventListener("resize",j),()=>{h.current?.removeEventListener("mousedown",j),h.current?.removeEventListener("input",j),h.current?.removeEventListener("focusout",Y),h.current?.removeEventListener("focusin",S),window.removeEventListener("scroll",j,true),window.removeEventListener("resize",j);}},[j,Y,S,Oe]),useEffect(()=>{P&&(_(P),L(true));},[P]),useEffect(()=>{y||o&&o.length&&!D.current&&(_(o),D.current=true,L(true));},[o,y]),jsxs("div",{className:a$2("relative",C),children:[jsx(oo,{selectedOptions:W,onSelect:t,error:n,helperText:r,label:l,placeholder:i,handleSelect:U,options:e,onInputChange:v,size:E,disabled:N}),H&&jsx(Zt,{selectedOptions:W,disabled:N,error:n,onCleanSelectedOptions:le,size:E}),jsx(to,{handleSelect:U,selectedOptions:W,noResultsLabel:u,NoResultsIcon:c,optionDescriptionLines:x,noResultsAsColumn:g,noResultsButtonLabel:d,noResultsButtonOnClick:b,noResultsDescription:m,noResultsDescriptionLines:p})]})};var vs=e=>jsx(Yt,{children:jsx(no,{...e})});var Ye=({children:e,className:o,disabled:t,error:n,helperText:r,htmlFor:l,label:i,labelProps:u,readOnly:c,required:m,tooltip:p})=>{let{root:g}=c$1({error:n,disabled:t,readOnly:c});return jsxs("div",{className:g({className:o}),"data-error":n||void 0,"data-disabled":t||void 0,"data-readonly":c||void 0,children:[i&&jsx(c$4,{...u,as:"label",htmlFor:l,label:i,required:m,tooltip:u?.tooltip??p}),e,jsx(a$8,{children:r})]})};var En=({code:e,codeClassName:o})=>jsxs("div",{className:"flex justify-center gap-2",children:[jsx(a$7,{country:e,className:"size-4.5"}),jsx("span",{className:a$2("text-sm leading-[143%] font-medium text-neutral-800",o),children:e})]}),io=({className:e,disabled:o,error:t,onChange:n,onOpenChange:r,options:l,readOnly:i,translations:u,value:c})=>{let m=k.useRef(null),[p,g]=k.useState(""),[b,d]=k.useState(false),{wrapper:C,input:v,clearIcon:P,searchIcon:y}=b$2({size:"md"}),{contains:E}=useFilter({sensitivity:"base"}),x=k.useMemo(()=>l.map(s=>({...s,key:s.code})),[l]),N=k.useMemo(()=>x.find(s=>s.key===c),[x,c]),{collection:h,filter:I,set:A}=useListCollection({initialItems:x,itemToString:s=>`${s.label} ${s.code}`,itemToValue:s=>s.key,filter:(s,a,T)=>E(s,a)||E(T.code,a.toUpperCase())});k.useEffect(()=>{A(x);},[x,A]);let L=k.useCallback(s=>{d(s),r?.(s);},[r]),M=k.useCallback(({inputValue:s})=>{let a=s??"";g(a),I(a),m.current?.scrollTo({top:0});},[I]),w=k.useCallback(s=>{L(s),s&&(g(""),I(""));},[I,L]),V=k.useCallback(({itemValue:s})=>{if(!s)return;let a=x.find(T=>T.key===s)?.code;a&&(n(a),L(false));},[x,L,n]),H=useCombobox({collection:h,inputBehavior:"autohighlight",inputValue:p,open:b,openOnChange:false,openOnClick:false,selectionBehavior:"preserve",value:N?[N.key]:[],onInputValueChange:M,onOpenChange:({open:s})=>{s||L(false);},onSelect:V});return jsx(Combobox.RootProvider,{value:H,children:jsxs(a$9,{open:b,onOpenChange:w,children:[jsx(b$3,{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-['']",t?"bg-danger-20 after:bg-input-ring-error after:w-0.5":o||i?"after:bg-input-ring-disabled bg-neutral-200":"group-focus-within/id-field:after:bg-input-ring-focus after:bg-input-ring bg-neutral-200 group-focus-within/id-field:after:w-0.5",!t&&b&&"after:bg-input-ring-focus after:w-0.5",e),disabled:o||i,children:N&&jsx(En,{code:N.code,codeClassName:a$2(t?"text-danger-600":void 0,o&&"text-input-text-disabled",i&&"text-input-text-disabled")})})}),jsx(c$5,{portalled:false,className:"w-75 p-0",children:jsxs(Combobox.Content,{children:[jsxs(Combobox.Control,{className:"pb-0",children:[jsxs("div",{className:C({className:"m-1 mb-0"}),children:[jsx(Combobox.Input,{autoComplete:"off","data-1p-ignore":true,"data-lpignore":"true",placeholder:u.searchCountryPlaceholder,className:v()}),!o&&p.length>0&&jsx("button",{type:"button",className:P(),onClick:()=>{H.setInputValue("","clear-trigger");},children:jsx(d$3,{className:"size-4.5"})}),jsx(q,{className:y()})]}),jsx(a$1,{className:"mt-2"})]}),jsx(Combobox.List,{ref:m,className:a$2("h-72 overflow-auto outline-none",{"flex flex-col items-center justify-center":h.items.length===0}),children:h.items.length===0?jsx(a$a,{size:"sm",variant:"not-found"}):jsx(Combobox.ItemGroup,{children:h.items.map(s=>jsxs(Combobox.Item,{item:s,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(a$7,{country:s.code,className:"size-4.5"}),jsx(Combobox.ItemText,{className:"min-w-0 flex-1 truncate text-sm leading-[143%] font-medium",children:s.label}),jsx("span",{className:"shrink-0 text-sm text-neutral-600",children:s.code}),jsx(k$1,{className:a$2("ml-auto size-4 shrink-0",s.key===c?"opacity-100":"opacity-0")})]},s.key))})})]})})]})})};var ct=k.forwardRef(({className:e,clearLabel:o,disabled:t,error:n,onChange:r,readOnly:l,type:i="text",value:u,...c},m)=>{let p=k.useRef(null),g=`${u??""}`.length>0,b=!t&&!l&&g,d$1=b||n;k.useImperativeHandle(m,()=>p.current,[]);let C=k.useCallback(P=>{r?.(P.target.value);},[r]),v=k.useCallback(()=>{r?.(""),p.current?.focus();},[r]);return jsxs("div",{className:a$2("bg-input-bg relative flex h-full min-w-0 flex-1 rounded-r",t&&"bg-input-bg-disabled"),children:[jsx("input",{type:i,"data-slot":"input",className:a$2("text-input-text placeholder:text-input-placeholder h-full min-w-0 flex-1 rounded-r bg-transparent px-3 text-sm leading-[143%] focus-visible:outline-0",d$1&&!n&&"pr-10.5",b&&n&&"pr-14",n&&!b&&"pr-10.5",t&&"text-input-text-disabled",e),...c,disabled:t,readOnly:l,value:u,onChange:C,ref:p}),(b||n)&&jsxs("div",{className:"absolute inset-y-0 right-3 z-10 flex items-center gap-1",children:[b&&jsx(a$5,{ariaLabel:o,onClick:v}),n&&jsx(d,{})]})]})});ct.displayName="IdInput";var pt={en:"Clear identification number",es:"Limpiar n\xFAmero de identificaci\xF3n",pt:"Limpar n\xFAmero de identifica\xE7\xE3o"},ao={en:Mn,es:On,pt:Fn},kn=pt.en,wn=ao.en,Hn={es:{clearIdLabel:pt.es,searchCountryPlaceholder:"Buscar..."},pt:{clearIdLabel:pt.pt,searchCountryPlaceholder:"Pesquisar..."}},Sn={clearIdLabel:kn,searchCountryPlaceholder:"Search..."},co=()=>getDefaultOptions().locale?.code,po=e=>Hn[e]??Sn,Dn=(e,o)=>(ao[o]??wn)[e]??e,uo=({localeCode:e})=>c$2.map(o=>({code:o,label:Dn(o,e)})).sort((o,t)=>o.label.localeCompare(t.label)),mo=a$6,fo=b$1,ho=(e,o)=>{let t=o.trim();return !t||!c$3(e,t).isValid?t:d$2(e,t)};var bo=()=>{},go=k.forwardRef(({autoComplete:e,className:o,country:t,disabled:n,error:r,helperText:l,id:i,label:u,labelProps:c,name:m,onBlur:p,onChange:g=bo,onCountryChange:b=bo,placeholder:d,readOnly:C,required:v,tooltip:P,value:y},E)=>{let[x,N]=k.useState(false),[h,I]=k.useState(y??""),A=k.useId(),L=i??A,M=co(),w=k.useRef(y??"");k.useEffect(()=>{(y??"")!==w.current&&I(y??"");},[y]);let V=k.useMemo(()=>po(M),[M]),H=k.useMemo(()=>uo({localeCode:M}),[M]),s=k.useMemo(()=>fo(t??"")||d||mo,[t,d]),a=c$1({error:r,disabled:n,readOnly:C}),T=k.useCallback((_,U)=>{let le=ho(_,U);w.current=le,g(le);},[g]),D=k.useCallback(_=>{I(_),T(t??"",_);},[t,T]),W=k.useCallback(_=>{b(_),T(_,h);},[h,b,T]);return jsx(Ye,{className:o,disabled:n,error:r,helperText:l,htmlFor:L,label:u,labelProps:c,readOnly:C,required:v,tooltip:P,children:jsxs("div",{className:a$2(a.control(),"group/id-field",!r&&!n&&!C&&x&&"after:ring-input-ring-focus after:ring-2"),children:[jsx(io,{disabled:n,error:r,onChange:W,onOpenChange:N,options:H,readOnly:C,translations:V,value:t}),jsx(ct,{autoComplete:e,clearLabel:V.clearIdLabel,disabled:n,error:r,id:L,name:m,onBlur:p,onChange:D,placeholder:s,readOnly:C,required:v,value:h,ref:E})]})})});go.displayName="IdField";var ga=({children:e$2,title:o,titleLines:t=1,description:n,descriptionLines:r=1,StartIcon:l,hasDivider:i=false,disabled:u=false,actionButton:c,isSelected:m=false,className:p,...g})=>jsxs(J,{hasDescription:!!n,disabled:u,hasDivider:i,isSelected:m,...g,className:p,children:[l&&jsx(l,{className:"mr-2 h-4.5 w-4.5 shrink-0 grow-0"}),jsx(se,{title:o,titleLines:t,description:n,descriptionLines:r,disabled:u}),c&&jsx(Fragment,{children:c.isIcon?jsx(e$1,{...c,className:"ml-4 self-center",variant:"ghost",size:"sm",disabled:u??c.disabled}):jsx(e,{...c,className:"ml-4 self-center",size:"sm",variant:"ghost",disabled:u??c.disabled})})]});var Ea=({title:e,description:o="",descriptionLines:t,hasDivider:n=false,disabled:r=false,checked:l,onCheckedChange:i,className:u,chipStatus:c,chipExpandable:m,...p})=>jsxs(J,{hasDescription:!!o,disabled:r,hasDivider:n,...p,className:a$2("pr-6",u),children:[jsx(c$6,{checked:l,onCheckedChange:i,className:"mr-4 self-center",disabled:r}),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",!!o&&"font-medium"),children:e}),m&&jsx("div",{className:"ml-auto flex min-w-0 flex-shrink-0 items-center justify-end",children:jsx(c$7,{...m})}),c&&jsx("div",{className:"ml-4 flex shrink-0 items-center gap-1",children:jsx(d$4,{...c,size:"xs",className:"shrink-0"})})]}),o&&jsx("p",{className:a$2("text-xs leading-[130%]",r?"text-neutral-400":"text-neutral-700",{"line-clamp-1":t===1,"line-clamp-2":t===2,"line-clamp-3":t===3,"line-clamp-4":t===4}),children:o})]})]});var dt={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"},ft={headings:["h1","h2","h3"],textFormat:["bold","italic","underline"],lists:true,indent:true,alignment:["left","center","right","justify"],undoRedo:true};var ht=({readOnly:e})=>{let[o]=useLexicalComposerContext();return useEffect(()=>{o.setEditable(!e);},[o,e]),null};var bt=({editorRef:e})=>{let[o]=useLexicalComposerContext();return useEffect(()=>(e.current=o,()=>{e.current===o&&(e.current=null);}),[o,e]),null};var Wn={"ql-align-left":"left","ql-align-center":"center","ql-align-right":"right","ql-align-justify":"justify"},Gn={center:"ql-align-center",right:"ql-align-right",justify:"ql-align-justify"},Kn=()=>typeof window<"u"&&typeof window.DOMParser<"u",Co=e=>Kn()?new DOMParser().parseFromString(e,"text/html"):null,Qn=e=>(e??"").replace(/\s+/g," ").trim(),Ct=e=>{let o=0;for(let t of Array.from(e.classList)){let n=t.match(/^ql-indent-(\d+)$/);if(!n)continue;let r=Number.parseInt(n[1],10);Number.isFinite(r)&&(o=Math.max(o,r)),e.classList.remove(t);}return o},jn=e=>{let o=e.querySelectorAll("[class*='ql-align-']");for(let t of Array.from(o))for(let n of Array.from(t.classList)){let r=Wn[n];r&&(r!=="left"&&(t.style.textAlign=r),t.classList.remove(n));}},Yn=e=>{let o=e.querySelectorAll("[class*='ql-indent-']");for(let t of Array.from(o)){if(t.tagName==="LI")continue;let n=Ct(t);n>0&&(t.style.paddingInlineStart=`${n*3}em`);}},Xn=(e,o)=>{let t=e.getAttribute("data-list");return t==="bullet"?"ul":t==="ordered"?"ol":o},Zn=e=>{let o=e.cloneNode(true);return o.removeAttribute("data-list"),o.removeAttribute("data-checked"),o.removeAttribute("data-indent"),Ct(o),o},gt=(e,o)=>e.createElement(o),Jn=(e,o)=>{let t=Array.from(e.children).filter(c=>c.tagName==="LI");if(t.length===0||!t.some(c=>c.hasAttribute("data-list")?true:Array.from(c.classList).some(m=>/^ql-indent-\d+$/.test(m))))return;let r=[],l=[],i=e.tagName==="UL"?"ul":"ol";for(let c of t){let m=Ct(c),p=Xn(c,i),g=Zn(c);for(;l.length>0&&l[l.length-1].level>m;)l.pop();if(l.length===0){let d=gt(o,p);r.push(d),l.push({level:0,kind:p,listElement:d});}let b=l[l.length-1];for(;b.level<m;){let d=b.listElement.lastElementChild;if(!d||d.tagName!=="LI")break;let C=gt(o,p);d.appendChild(C),b={level:b.level+1,kind:p,listElement:C},l.push(b);}if(b=l[l.length-1],b.kind!==p){let d=gt(o,p);if(l.length===1)r.push(d),l[0]={level:0,kind:p,listElement:d};else {let v=l[l.length-2].listElement.lastElementChild;v&&v.tagName==="LI"?(v.appendChild(d),l[l.length-1]={level:b.level,kind:p,listElement:d}):(r.push(d),l.length=1,l[0]={level:0,kind:p,listElement:d});}b=l[l.length-1];}b.listElement.appendChild(g);}if(r.length===0)return;let u=o.createDocumentFragment();for(let c of r)u.appendChild(c);e.replaceWith(u);},er=(e,o)=>{let t=Array.from(e.querySelectorAll("ol, ul"));for(let n of t)Jn(n,o);},xo=(e,o)=>{let t=e.tagName==="UL"?"bullet":"ordered",n=Array.from(e.children).filter(r=>r.tagName==="LI");for(let r of n){r.setAttribute("data-list",t);for(let i of Array.from(r.classList))/^ql-indent-\d+$/.test(i)&&r.classList.remove(i);o>0&&r.classList.add(`ql-indent-${o}`);let l=Array.from(r.children).filter(i=>i.tagName==="UL"||i.tagName==="OL");for(let i of l)xo(i,o+1);}},tr=e=>{let o=e.querySelectorAll("p, h1, h2, h3, h4, h5, h6, li");for(let t of Array.from(o)){let n=t;for(let i of Array.from(n.classList))i.startsWith("ql-align-")&&n.classList.remove(i);let r=n.style.textAlign.trim().toLowerCase(),l=Gn[r];l&&n.classList.add(l);}},Ce=e=>Qn(e).replace(/>\s+</g,"><").replace(/&nbsp;/g," "),xt=e=>{let o=e??"";if(!o.trim())return "";let t=Co(o);if(!t)return o;let{body:n}=t;return jn(n),Yn(n),er(n,t),n.innerHTML},Lt=e=>{if(!e.trim())return "";let o=Co(e);if(!o)return e;let{body:t}=o,n=Array.from(t.querySelectorAll("ul, ol"));for(let r of n)xo(r,0);return tr(t),t.innerHTML};var Xe=e=>{let o="";return e.getEditorState().read(()=>{o=$generateHtmlFromNodes(e,null);}),Lt(o)},cr=(e,o)=>{let t=xt(o);e.update(()=>{let n=$getRoot();if(n.clear(),!t.trim()){n.append($createParagraphNode());return}let l=new DOMParser().parseFromString(t,"text/html"),i=$generateNodesFromDOM(e,l);if(i.length===0){n.append($createParagraphNode());return}n.select(),$insertNodes(i);});},yt=({value:e,isSyncingRef:o})=>{let[t]=useLexicalComposerContext(),n=useRef(null);return useEffect(()=>{let r=e??"";if(n.current!==null&&Ce(r)===Ce(n.current))return;let l=Xe(t);Ce(l)!==Ce(r)&&(o.current=true,cr(t,r),queueMicrotask(()=>{o.current=false;})),n.current=r;},[t,o,e]),null};var yo=["left","center","right","justify"];var Io=["bold","italic","underline","strikethrough","code"];var Wr={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikethrough",code:"code"},Gr={left:jsx(AlignLeftIcon,{className:"size-4"}),center:jsx(AlignCenterIcon,{className:"size-4"}),right:jsx(AlignRightIcon,{className:"size-4"}),justify:jsx(AlignJustifyIcon,{className:"size-4"})},Kr={left:"Align left",center:"Align center",right:"Align right",justify:"Align justify"},Ee={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:"</>"})},Ae={bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",code:"Inline code"},Qr=e=>{let o=e.textFormat;return o===false?[]:Array.isArray(o)?Io.filter(t=>o.includes(t)):["bold","italic","underline"]},jr=e=>{let o=e.alignment;return o===false?[]:Array.isArray(o)?yo.filter(t=>o.includes(t)):["left","center","right","justify"]},Yr=e=>{if(e.headings===false)return [];let o=Array.isArray(e.headings)?e.headings:["h1","h2","h3"];return [{value:"paragraph",label:"Normal"},...o.map(t=>({value:t,label:t.toUpperCase()}))]},Me=()=>jsx("div",{className:"mx-1 h-5 w-px bg-neutral-300"}),Q=({label:e,onClick:o,icon:t,active:n=false,disabled:r=false})=>jsx("button",{type:"button","aria-label":e,title:e,disabled:r,onClick:o,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:t}),vt=({config:e,className:o})=>{let[t]=useLexicalComposerContext(),n=useId(),[r,l]=useState(false),[i,u]=useState(false),[c,m]=useState(false),[p,g]=useState(false),[b,d]=useState(false),[C,v]=useState(false),[P,y]=useState(false),[E,x]=useState("paragraph"),[N,h]=useState("left"),I=useMemo(()=>Qr(e),[e]),A=useMemo(()=>jr(e),[e]),L=useMemo(()=>Yr(e),[e]),M=useCallback(()=>{let s=$getSelection();if(!$isRangeSelection(s))return;m(s.hasFormat("bold")),g(s.hasFormat("italic")),d(s.hasFormat("underline")),v(s.hasFormat("strikethrough")),y(s.hasFormat("code"));let a=s.anchor.getNode(),T=a.getKey()==="root"?a:a.getTopLevelElementOrThrow();if($isListNode(T))x(T.getListType()==="number"?"ol":"ul");else {let W=$findMatchingParent(T,_=>$isListNode(_));$isListNode(W)?x(W.getListType()==="number"?"ol":"ul"):x($isHeadingNode(T)?T.getTag():T.getType());}let D=$isElementNode(T)?T.getFormatType():"";h(D==="center"||D==="right"||D==="justify"?D:"left");},[]);useEffect(()=>mergeRegister(t.registerUpdateListener(({editorState:s})=>{s.read(()=>{M();});}),t.registerCommand(SELECTION_CHANGE_COMMAND,()=>(M(),false),1),t.registerCommand(CAN_UNDO_COMMAND,s=>(l(s),false),1),t.registerCommand(CAN_REDO_COMMAND,s=>(u(s),false),1)),[t,M]);let w=s=>{t.dispatchCommand(FORMAT_TEXT_COMMAND,Wr[s]);},V=s=>{t.update(()=>{let a=$getSelection();if($isRangeSelection(a)){if(s==="paragraph"){$setBlocksType(a,()=>$createParagraphNode());return}$setBlocksType(a,()=>$createHeadingNode(s));}});},H=s=>{if(E===(s==="bullet"?"ul":"ol")){t.dispatchCommand(REMOVE_LIST_COMMAND,void 0);return}t.dispatchCommand(s==="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",o),children:[e.undoRedo!==false&&jsxs(Fragment,{children:[jsx(Q,{label:"Undo",onClick:()=>t.dispatchCommand(UNDO_COMMAND,void 0),disabled:!r,icon:jsx(UndoIcon,{className:"size-4"})}),jsx(Q,{label:"Redo",onClick:()=>t.dispatchCommand(REDO_COMMAND,void 0),disabled:!i,icon:jsx(RedoIcon,{className:"size-4"})}),jsx(Me,{})]}),L.length>0&&jsxs(Fragment,{children:[jsx("label",{className:"sr-only",htmlFor:n,children:"Text style"}),jsx("select",{id:n,value:E.startsWith("h")?E:"paragraph",onChange:s=>V(s.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:L.map(s=>jsx("option",{value:s.value,children:s.label},s.value))}),jsx(Me,{})]}),I.length>0&&jsxs(Fragment,{children:[I.includes("bold")&&jsx(Q,{label:Ae.bold,onClick:()=>w("bold"),icon:Ee.bold,active:c}),I.includes("italic")&&jsx(Q,{label:Ae.italic,onClick:()=>w("italic"),icon:Ee.italic,active:p}),I.includes("underline")&&jsx(Q,{label:Ae.underline,onClick:()=>w("underline"),icon:Ee.underline,active:b}),I.includes("strikethrough")&&jsx(Q,{label:Ae.strikethrough,onClick:()=>w("strikethrough"),icon:Ee.strikethrough,active:C}),I.includes("code")&&jsx(Q,{label:Ae.code,onClick:()=>w("code"),icon:Ee.code,active:P}),jsx(Me,{})]}),e.lists!==false&&jsxs(Fragment,{children:[jsx(Q,{label:"Bulleted list",onClick:()=>H("bullet"),icon:jsx(ListIcon,{className:"size-4"}),active:E==="ul"}),jsx(Q,{label:"Numbered list",onClick:()=>H("number"),icon:jsx(ListOrderedIcon,{className:"size-4"}),active:E==="ol"}),jsx(Me,{})]}),e.indent!==false&&jsxs(Fragment,{children:[jsx(Q,{label:"Decrease indent",onClick:()=>t.dispatchCommand(OUTDENT_CONTENT_COMMAND,void 0),icon:jsx(IndentDecreaseIcon,{className:"size-4"})}),jsx(Q,{label:"Increase indent",onClick:()=>t.dispatchCommand(INDENT_CONTENT_COMMAND,void 0),icon:jsx(IndentIncreaseIcon,{className:"size-4"})}),jsx(Me,{})]}),A.length>0&&jsx(Fragment,{children:A.map(s=>jsx(Q,{label:Kr[s],onClick:()=>t.dispatchCommand(FORMAT_ELEMENT_COMMAND,s),icon:Gr[s],active:N===s},s))})]})};var To=e=>{if(e!==void 0)return typeof e=="number"?`${e}px`:e},ul=forwardRef(({value:e,onChange:o,onBlur:t,onError:n,placeholder:r="Write your content...",readOnly:l=false,showToolbar:i=true,toolbarConfig:u=ft,className:c,editorClassName:m,toolbarClassName:p,autoFocus:g=false,minHeight:b=160,maxHeight:d,error:C=false,errorMessage:v,editorRef:P},y)=>{let E=useRef(false),x=useMemo(()=>({namespace:"SodtrackRichTextEditor",theme:dt,onError:(h,I)=>{if(n){n(h,I);return}console.error("RichTextEditor error",h);},nodes:[HeadingNode,ListNode,ListItemNode]}),[n]),N={minHeight:To(b),maxHeight:To(d),overflowY:d?"auto":void 0};return jsx(LexicalComposer,{initialConfig:x,children:jsxs("div",{className:"w-full",children:[jsxs("div",{ref:y,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",C?"border-error-500 focus-within:border-error-500 focus-within:ring-error-500":"border-neutral-500",l&&"border-neutral-300 bg-neutral-50 focus-within:ring-0",c),"data-error":C,"data-readonly":l,children:[i&&!l&&jsx(vt,{config:u,className:p}),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",l&&"cursor-default",m),style:N,onBlur:t,"aria-invalid":C}),placeholder:l?null:jsx("div",{className:"pointer-events-none absolute top-3 left-4 text-sm text-neutral-500",children:r}),ErrorBoundary:LexicalErrorBoundary}),jsx(HistoryPlugin,{}),jsx(ListPlugin,{}),jsx(ht,{readOnly:l}),jsx(yt,{value:e,isSyncingRef:E}),g&&!l&&jsx(AutoFocusPlugin,{}),P&&jsx(bt,{editorRef:P}),jsx(OnChangePlugin,{ignoreSelectionChange:true,onChange:(h,I)=>{!o||E.current||o(Xe(I),h);}})]}),C&&v&&jsx("p",{className:"text-error-500 mt-1 text-xs leading-[133%]",children:v})]})})});ul.displayName="RichTextEditor";var Eo={en:Mn,es:On,pt:Fn},xl={es:{clearPhoneNumberLabel:"Eliminar n\xFAmero de tel\xE9fono",searchCountryPlaceholder:"Buscar..."},pt:{clearPhoneNumberLabel:"Limpar n\xFAmero de telefone",searchCountryPlaceholder:"Pesquisar..."}},Ll={clearPhoneNumberLabel:"Clear phone number",searchCountryPlaceholder:"Search..."},yl=Eo.en,Ao="9 1234 5678",Pt="ZZ",Mo=()=>{},Ze=e=>xl[e]??Ll,Oo=e=>Eo[e]??yl,Fo=e=>{if(e)try{let o=parsePhoneNumber(e)?.country;return !o||!h(o)?void 0:o}catch{return}},ko=e=>{if(e)return getExampleNumber(e,fl)?.formatNational()},Je=e=>e??Pt,et=()=>getDefaultOptions().locale?.code;var Tl=({Icon:e,callingCode:o,country:t,countryName:n,callingCodeClassName:r})=>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:t,label:n})}),o&&jsx("span",{className:a$2("text-sm leading-[143%] font-medium text-neutral-800",r),children:`+${o}`})]}),wo=({className:e,disabled:o,error:t,iconComponent:n,onChange:r,onOpenChange:l,options:i,readOnly:u,translations:c,value:m})=>{let p=k.useRef(null),[g,b]=k.useState(""),[d,C]=k.useState(false),{wrapper:v,input:P,clearIcon:y,searchIcon:E}=b$2({size:"md"}),{contains:x}=useFilter({sensitivity:"base"}),N=k.useMemo(()=>i.filter(a=>a.value!==void 0&&h(a.value)).map(a=>({callingCode:a.value?getCountryCallingCode(a.value):void 0,country:a.value,key:Je(a.value),label:a.label})),[i]),h$1=k.useMemo(()=>N.find(a=>a.key===Je(m)),[N,m]),{collection:I,filter:A,set:L}=useListCollection({initialItems:N,itemToString:a=>a.callingCode?`${a.label} +${a.callingCode}`:a.label,itemToValue:a=>a.key,filter:(a,T,D)=>{let W=T.trim().replace(/^\+/,"");return x(a,T)||(D.country?x(D.country,T.toUpperCase()):false)||(D.callingCode?x(D.callingCode,W)||x(`+${D.callingCode}`,T):false)}});k.useEffect(()=>{L(N);},[N,L]);let M=k.useCallback(a=>{C(a),l?.(a);},[l]),w=k.useCallback(({inputValue:a})=>{let T=a??"";b(T),A(T),p.current?.scrollTo({top:0});},[A]),V=k.useCallback(a=>{M(a),a&&(b(""),A(""));},[A,M]),H=k.useCallback(({itemValue:a})=>{if(!a||a===Pt){r(void 0),M(false);return}h(a)&&(r(a),M(false));},[M,r]),s=useCombobox({collection:I,inputBehavior:"autohighlight",inputValue:g,open:d,openOnChange:false,openOnClick:false,selectionBehavior:"preserve",value:h$1?[h$1.key]:[],onInputValueChange:w,onOpenChange:({open:a})=>{a||M(false);},onSelect:H});return jsx(Combobox.RootProvider,{value:s,children:jsxs(a$9,{open:d,onOpenChange:V,children:[jsx(b$3,{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-['']",t?"bg-danger-20 after:bg-input-ring-error after:w-0.5":o||u?"after:bg-input-ring-disabled bg-neutral-200":"group-focus-within/phone:after:bg-input-ring-focus after:bg-input-ring bg-neutral-200 group-focus-within/phone:after:w-0.5",!t&&d&&"after:bg-input-ring-focus after:w-0.5",e),disabled:o||u,children:h$1&&jsx(Tl,{Icon:n,callingCode:h$1.callingCode,country:h$1.country,countryName:h$1.label,callingCodeClassName:a$2(t?"text-danger-600":void 0,o&&"text-input-text-disabled",u&&"text-input-text-disabled")})})}),jsx(c$5,{portalled:false,className:"w-75 p-0",children:jsxs(Combobox.Content,{children:[jsxs(Combobox.Control,{className:"pb-0",children:[jsxs("div",{className:v({className:"m-1 mb-0"}),children:[jsx(Combobox.Input,{autoComplete:"off","data-1p-ignore":true,"data-lpignore":"true",placeholder:c.searchCountryPlaceholder,className:P()}),!o&&g.length>0&&jsx("button",{type:"button",className:y(),onClick:()=>{s.setInputValue("","clear-trigger");},children:jsx(d$3,{className:"size-4.5"})}),jsx(q,{className:E()})]}),jsx(a$1,{className:"mt-2"})]}),jsx(Combobox.List,{ref:p,className:a$2("h-72 overflow-auto outline-none",{"flex flex-col items-center justify-center":I.items.length===0}),children:I.items.length===0?jsx(a$a,{size:"sm",variant:"not-found"}):jsx(Combobox.ItemGroup,{children:I.items.map(a=>jsxs(Combobox.Item,{item:a,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:a.country,label:a.label})}),jsx(Combobox.ItemText,{className:"min-w-0 flex-1 truncate text-sm leading-[143%] font-medium",children:a.label}),a.callingCode&&jsx("span",{className:"shrink-0 text-sm text-neutral-600",children:`+${a.callingCode}`}),jsx(k$1,{className:a$2("ml-auto size-4 shrink-0",a.key===Je(m)?"opacity-100":"opacity-0")})]},a.key))})})]})})]})})};var Nt=k.forwardRef(({className:e,disabled:o,error:t,onChange:n,readOnly:r,type:l,value:i,...u},c)=>{let m=et(),p=k.useMemo(()=>Ze(m),[m]),g=k.useRef(null),d$1=!o&&!r&&!!i,C=d$1||t;k.useImperativeHandle(c,()=>g.current,[]);let v=k.useCallback(()=>{let P=g.current;if(!P){n?.({target:{value:""}});return}P.value="",n?.({target:P}),P.focus();},[n]);return jsxs("div",{className:a$2("bg-input-bg relative flex h-full min-w-0 flex-1 rounded-r",o&&"bg-input-bg-disabled"),children:[jsx("input",{type:l,"data-slot":"input",className:a$2("text-input-text placeholder:text-input-placeholder h-full min-w-0 flex-1 rounded-r bg-transparent px-3 text-sm leading-[143%] focus-visible:outline-0",C&&!t&&"pr-10.5",d$1&&t&&"pr-14",t&&!d$1&&"pr-10.5",o&&"text-input-text-disabled",e),...u,disabled:o,readOnly:r,value:i,onChange:n,ref:g}),(d$1||t)&&jsxs("div",{className:"absolute inset-y-0 right-3 z-10 flex items-center gap-1",children:[d$1&&jsx(a$5,{ariaLabel:p.clearPhoneNumberLabel,onClick:v}),t&&jsx(d,{})]})]})});Nt.displayName="PhoneNumberInputComponent";var El=Nl,Do=k.forwardRef(({className:e,defaultCountry:o,disabled:t,error:n,helperText:r,id:l,label:i,labelProps:u,onChange:c=Mo,placeholder:m,readOnly:p,required:g,tooltip:b,value:d,...C},v)=>{let[P,y]=k.useState(false),[E,x]=k.useState(()=>Fo(d)??o),N=k.useId(),h=l??N,I=et(),A=k.useMemo(()=>Ze(I),[I]),L=k.useMemo(()=>Oo(I),[I]),M=k.useMemo(()=>ko(E)??m??Ao,[m,E]),w=c$1({error:n,disabled:t,readOnly:p}),V=a$2(w.control(),"group/phone [&_.PhoneInputCountryIconImg]:size-4.5!",!n&&!t&&!p&&P&&"after:ring-input-ring-focus after:ring-2"),H=k.useCallback(s=>{x(s);},[]);return jsx(Ye,{className:e,disabled:t,error:n,helperText:r,htmlFor:h,label:i,labelProps:u,readOnly:p,required:g,tooltip:b,children:jsx(El,{...C,className:V,ref:v,countrySelectComponent:wo,countrySelectProps:{error:n,onOpenChange:y,translations:A},defaultCountry:o,disabled:t,flagComponent:a$7,id:h,initialValueFormat:"national",inputComponent:Nt,labels:L,numberInputProps:{error:n,placeholder:M},readOnly:p,required:g,value:d,onChange:c,onCountryChange:H})})});Do.displayName="PhoneInput";var Al=({children:e,hasDescription:o=false,disabled:t=false,hasDivider:n=false,className:r,isSelected:l,onClick:i,...u})=>jsxs(Fragment,{children:[jsx("div",{className:a$2("flex flex-row px-3 py-4 text-neutral-900 transition-colors",o?"py-3":"py-3.5",t?"cursor-not-allowed text-neutral-400":a$2("hover:bg-primary-100 focus:bg-primary-200",!!i?"cursor-pointer":"cursor-default"),l&&"bg-primary-200",r),onClick:m=>{t||i?.(m);},...u,children:e}),n&&jsx(a$1,{})]}),J=Al;var um=({children:e,title:o,titleLines:t,description:n="",descriptionLines:r,startIcon:l,endIcon:i,hasDivider:u=false,disabled:c=false,isSelected:m=false,className:p,...g})=>jsxs(J,{hasDescription:!!n,disabled:c,hasDivider:u,className:p,isSelected:m,...g,children:[l&&k__default.cloneElement(l,{className:"shrink-0 mr-2 h-4.5 w-4.5"}),jsx(se,{title:o,titleLines:t,description:n,descriptionLines:r,disabled:c}),i&&k__default.cloneElement(i,{className:"min-h-4.5 min-w-4.5 self-center ml-4"})]});export{jl as a,um as b,si as c,bi as d,vs as e,go as f,ga as g,Ea as h,dt as i,ft as j,Ce as k,xt as l,Lt as m,ul as n,Do as o};
@@ -1 +1 @@
1
- import {a}from'./chunk-35DVM6TF.js';import {g}from'./chunk-QMPBFFFC.js';import {d}from'./chunk-QYA5ZUUN.js';import {useCallback}from'react';import {tv}from'tailwind-variants';import {jsxs,jsx}from'react/jsx-runtime';var O=["sm","md","lg"],S=["primary","secondary","ghost"],R=["primary","neutral"],A=tv({extend:d,slots:{root:"group data-[state=open]:ring-primary-800 gap-2 outline-none data-[state=open]:ring-3 data-[state=open]:ring-inset"},variants:{disabled:{true:{},false:{}}}}),h=({label:u,StartIcon:o,options:p,onSelect:s,variant:m="primary",size:d="md",disabled:a$1=false,className:v,tone:g$1="primary",...b})=>{let y=useCallback(t=>{s?.(t);},[s]),{root:f,icon:r}=A({variant:m,size:d,tone:g$1,disabled:a$1});return jsxs(a.Root,{onSelect:y,...b,children:[jsxs(a.Trigger,{disabled:a$1,className:f({className:v}),children:[o&&jsx(o,{className:r()}),u,jsx(g,{className:r({className:"transition-transform duration-150 group-data-[state=open]:rotate-180"})})]}),jsx(a.Content,{children:p.map(t=>jsx(a.Option,{value:t.value,label:t.label,description:t.description,startIcon:t.startIcon,endIcon:t.endIcon,hasDivider:t.hasDivider,disabled:t.disabled,onSelect:t.onClick},t.value))})]})};export{O as a,S as b,R as c,h as d};
1
+ import {a}from'./chunk-OANSRWH2.js';import {g}from'./chunk-QMPBFFFC.js';import {d}from'./chunk-QYA5ZUUN.js';import {useCallback}from'react';import {tv}from'tailwind-variants';import {jsxs,jsx}from'react/jsx-runtime';var O=["sm","md","lg"],S=["primary","secondary","ghost"],R=["primary","neutral"],A=tv({extend:d,slots:{root:"group data-[state=open]:ring-primary-800 gap-2 outline-none data-[state=open]:ring-3 data-[state=open]:ring-inset"},variants:{disabled:{true:{},false:{}}}}),h=({label:u,StartIcon:o,options:p,onSelect:s,variant:m="primary",size:d="md",disabled:a$1=false,className:v,tone:g$1="primary",...b})=>{let y=useCallback(t=>{s?.(t);},[s]),{root:f,icon:r}=A({variant:m,size:d,tone:g$1,disabled:a$1});return jsxs(a.Root,{onSelect:y,...b,children:[jsxs(a.Trigger,{disabled:a$1,className:f({className:v}),children:[o&&jsx(o,{className:r()}),u,jsx(g,{className:r({className:"transition-transform duration-150 group-data-[state=open]:rotate-180"})})]}),jsx(a.Content,{children:p.map(t=>jsx(a.Option,{value:t.value,label:t.label,description:t.description,startIcon:t.startIcon,endIcon:t.endIcon,hasDivider:t.hasDivider,disabled:t.disabled,onSelect:t.onClick},t.value))})]})};export{O as a,S as b,R as c,h as d};
@@ -1 +1 @@
1
- import {c,b,a as a$3}from'./chunk-U6RH2BZO.js';import {d}from'./chunk-GVSX3HGR.js';import {a}from'./chunk-35DVM6TF.js';import {a as a$2}from'./chunk-UIZFLYFP.js';import {e as e$1}from'./chunk-PI7DECIN.js';import {J as J$1,t,u,h}from'./chunk-QMPBFFFC.js';import {e}from'./chunk-QYA5ZUUN.js';import {a as a$1}from'./chunk-OBZIYJO7.js';import {createContext,forwardRef,useMemo,useCallback,useContext}from'react';import {Collapsible}from'@ark-ui/react/collapsible';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var j=(e,n,a,o)=>{if(n==="icon"){if(e==="success")return {state:"success",variant:"icon"};if(!a$3(a))throw new Error('TrackerItem: `content` (LucideIcon) is required when `variant` is "icon" and `state` is not "success".');return {state:e,variant:"icon",content:a}}if(n==="number"){if(typeof a!="number")throw new Error('TrackerItem: `content` (number) is required when `variant` is "number".');return {state:e,variant:"number",content:a}}if(o===void 0)throw new Error("TrackerItem: `stepNumber` is required when `variant` is omitted (legacy API).");return {state:e,stepNumber:o}},G=e=>e.variant==="icon"?e.state==="success"?{variant:"icon",content:b("success")}:{variant:"icon",content:b(e.state,e.content)}:e.variant==="number"?{variant:"number",content:e.content}:{variant:"number",content:e.stepNumber},R=createContext(null),J=()=>{let e=useContext(R);if(!e)throw new Error("TrackerItem components must be used within TrackerItem");return e},K=({state:e,children:n})=>jsxs("div",{className:"relative",children:[jsx("div",{className:a$1("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",e==="current"&&"bg-primary-500",e==="complete"&&"bg-primary-600")}),n]}),O="flex min-h-10 w-full items-center gap-3 py-2 pr-1 pl-3",Q=forwardRef((e,n)=>{let{state:a$3,indicator:o,expandable:m,isClickable:c$1,headerMenu:d,onHeaderButtonClick:s}=J(),{label:f,badgeStatus:u$1,details:p,className:v,...b}=e,k=()=>jsxs(Fragment,{children:[jsxs("div",{className:a$1("flex flex-1 gap-2",!u$1&&(!p||p.length===0)&&"self-center"),children:[o.variant==="icon"?a$3==="success"?jsx(c,{state:"success",variant:"icon"}):jsx(c,{state:a$3,variant:"icon",content:o.content}):jsx(c,{state:a$3,variant:"number",content:o.content}),jsxs("div",{className:"mt-0.5 flex min-w-0 flex-1 flex-col gap-1",children:[jsx("span",{className:a$1("font-jakarta text-xs leading-snug font-medium",a$3==="wait"?"text-neutral-500":"text-neutral-900"),children:f}),u$1&&u$1.visible!==false&&(()=>{let{visible:r,...l}=u$1;return jsx(a$2,{...l})})(),p&&jsx("div",{className:"text-2xs flex flex-col gap-1.5 text-neutral-700",children:p.map(({Icon:r,text:l},C)=>jsxs("div",{className:"flex items-center gap-1.5",children:[jsx(r,{className:"size-3 shrink-0"}),jsx("span",{className:"font-inter",children:l})]},C))})]})]}),c$1&&d&&jsx(J$1,{className:"size-3.5 shrink-0 text-neutral-800"}),!c$1&&m&&jsx(Collapsible.Context,{children:({open:r})=>jsx(Collapsible.Trigger,{asChild:true,children:jsx(e$1,{Icon:r?t:u,size:"sm",variant:"ghost",tone:"neutral"})})}),!c$1&&!m&&s&&jsx(e$1,{Icon:h,size:"sm",variant:"ghost",tone:"neutral",onClick:s})]});return c$1&&d?jsxs(a.Root,{positioning:{placement:"bottom-end",flip:["bottom-start"]},children:[jsx(a.Trigger,{asChild:true,children:jsx("div",{ref:n,className:a$1(O,"group cursor-pointer outline-none hover:bg-neutral-100 focus-visible:ring-3 focus-visible:ring-neutral-800 focus-visible:ring-inset",v),...b,children:k()})}),jsx(a.Content,{children:d.options.map(r=>jsx(a.Option,{value:r.value,label:r.label,description:r.description,startIcon:r.startIcon,endIcon:r.endIcon,hasDivider:r.hasDivider,disabled:r.disabled,onSelect:r.onClick},r.value))})]}):jsx("div",{ref:n,className:a$1(O,v),...b,children:k()})});Q.displayName="TrackerItemHeader";var W=forwardRef(({children:e,className:n,...a},o)=>jsx(Collapsible.Content,{className:"data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up overflow-hidden",children:jsx("div",{ref:o,className:a$1("border-t border-neutral-300 px-3 py-2",n),...a,children:e})}));W.displayName="TrackerItemExpandableContent";var X=forwardRef(({buttons:e$1=[],className:n,...a},o)=>jsx("div",{ref:o,className:a$1("flex justify-end gap-2 border-t border-neutral-300 px-3 py-2",n),...a,children:e$1.map((m,c)=>{if(m.visible===false)return null;let{visible:d$1,...s}=m;return "options"in s?jsx(d,{...s,size:"sm"},c):jsx(e,{...s,size:"sm"},c)})}));X.displayName="TrackerItemFooter";var A="overflow-hidden rounded-sm border border-neutral-300 bg-neutral-50",Y=forwardRef(({state:e,variant:n,content:a,stepNumber:o,expandable:m,isClickable:c,headerMenu:d,defaultExpanded:s,onExpandedChange:f,onHeaderButtonClick:u,className:p,children:v,...b},k)=>{let r=m===true,l=c===true,C=useMemo(()=>G(j(e,n,a,o)),[e,n,a,o]),z=useMemo(()=>({state:e,indicator:C,expandable:r,isClickable:l,headerMenu:l?d:void 0,onHeaderButtonClick:l?void 0:u}),[e,C,r,l,d,u]),V=useCallback(F=>{f?.(F.open);},[f]);return jsx(R.Provider,{value:z,children:jsx(K,{state:e,children:r?jsx(Collapsible.Root,{ref:k,defaultOpen:s??false,onOpenChange:V,className:a$1(A,p),...b,children:v}):jsx("div",{ref:k,className:a$1(A,p),...b,children:v})})})});Y.displayName="TrackerItem";export{J as a,Q as b,W as c,X as d,Y as e};
1
+ import {c,b,a as a$3}from'./chunk-U6RH2BZO.js';import {d}from'./chunk-IQLMY7FP.js';import {a}from'./chunk-OANSRWH2.js';import {a as a$2}from'./chunk-UIZFLYFP.js';import {e as e$1}from'./chunk-PI7DECIN.js';import {J as J$1,t,u,h}from'./chunk-QMPBFFFC.js';import {e}from'./chunk-QYA5ZUUN.js';import {a as a$1}from'./chunk-OBZIYJO7.js';import {createContext,forwardRef,useMemo,useCallback,useContext}from'react';import {Collapsible}from'@ark-ui/react/collapsible';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var j=(e,n,a,o)=>{if(n==="icon"){if(e==="success")return {state:"success",variant:"icon"};if(!a$3(a))throw new Error('TrackerItem: `content` (LucideIcon) is required when `variant` is "icon" and `state` is not "success".');return {state:e,variant:"icon",content:a}}if(n==="number"){if(typeof a!="number")throw new Error('TrackerItem: `content` (number) is required when `variant` is "number".');return {state:e,variant:"number",content:a}}if(o===void 0)throw new Error("TrackerItem: `stepNumber` is required when `variant` is omitted (legacy API).");return {state:e,stepNumber:o}},G=e=>e.variant==="icon"?e.state==="success"?{variant:"icon",content:b("success")}:{variant:"icon",content:b(e.state,e.content)}:e.variant==="number"?{variant:"number",content:e.content}:{variant:"number",content:e.stepNumber},R=createContext(null),J=()=>{let e=useContext(R);if(!e)throw new Error("TrackerItem components must be used within TrackerItem");return e},K=({state:e,children:n})=>jsxs("div",{className:"relative",children:[jsx("div",{className:a$1("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",e==="current"&&"bg-primary-500",e==="complete"&&"bg-primary-600")}),n]}),O="flex min-h-10 w-full items-center gap-3 py-2 pr-1 pl-3",Q=forwardRef((e,n)=>{let{state:a$3,indicator:o,expandable:m,isClickable:c$1,headerMenu:d,onHeaderButtonClick:s}=J(),{label:f,badgeStatus:u$1,details:p,className:v,...b}=e,k=()=>jsxs(Fragment,{children:[jsxs("div",{className:a$1("flex flex-1 gap-2",!u$1&&(!p||p.length===0)&&"self-center"),children:[o.variant==="icon"?a$3==="success"?jsx(c,{state:"success",variant:"icon"}):jsx(c,{state:a$3,variant:"icon",content:o.content}):jsx(c,{state:a$3,variant:"number",content:o.content}),jsxs("div",{className:"mt-0.5 flex min-w-0 flex-1 flex-col gap-1",children:[jsx("span",{className:a$1("font-jakarta text-xs leading-snug font-medium",a$3==="wait"?"text-neutral-500":"text-neutral-900"),children:f}),u$1&&u$1.visible!==false&&(()=>{let{visible:r,...l}=u$1;return jsx(a$2,{...l})})(),p&&jsx("div",{className:"text-2xs flex flex-col gap-1.5 text-neutral-700",children:p.map(({Icon:r,text:l},C)=>jsxs("div",{className:"flex items-center gap-1.5",children:[jsx(r,{className:"size-3 shrink-0"}),jsx("span",{className:"font-inter",children:l})]},C))})]})]}),c$1&&d&&jsx(J$1,{className:"size-3.5 shrink-0 text-neutral-800"}),!c$1&&m&&jsx(Collapsible.Context,{children:({open:r})=>jsx(Collapsible.Trigger,{asChild:true,children:jsx(e$1,{Icon:r?t:u,size:"sm",variant:"ghost",tone:"neutral"})})}),!c$1&&!m&&s&&jsx(e$1,{Icon:h,size:"sm",variant:"ghost",tone:"neutral",onClick:s})]});return c$1&&d?jsxs(a.Root,{positioning:{placement:"bottom-end",flip:["bottom-start"]},children:[jsx(a.Trigger,{asChild:true,children:jsx("div",{ref:n,className:a$1(O,"group cursor-pointer outline-none hover:bg-neutral-100 focus-visible:ring-3 focus-visible:ring-neutral-800 focus-visible:ring-inset",v),...b,children:k()})}),jsx(a.Content,{children:d.options.map(r=>jsx(a.Option,{value:r.value,label:r.label,description:r.description,startIcon:r.startIcon,endIcon:r.endIcon,hasDivider:r.hasDivider,disabled:r.disabled,onSelect:r.onClick},r.value))})]}):jsx("div",{ref:n,className:a$1(O,v),...b,children:k()})});Q.displayName="TrackerItemHeader";var W=forwardRef(({children:e,className:n,...a},o)=>jsx(Collapsible.Content,{className:"data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up overflow-hidden",children:jsx("div",{ref:o,className:a$1("border-t border-neutral-300 px-3 py-2",n),...a,children:e})}));W.displayName="TrackerItemExpandableContent";var X=forwardRef(({buttons:e$1=[],className:n,...a},o)=>jsx("div",{ref:o,className:a$1("flex justify-end gap-2 border-t border-neutral-300 px-3 py-2",n),...a,children:e$1.map((m,c)=>{if(m.visible===false)return null;let{visible:d$1,...s}=m;return "options"in s?jsx(d,{...s,size:"sm"},c):jsx(e,{...s,size:"sm"},c)})}));X.displayName="TrackerItemFooter";var A="overflow-hidden rounded-sm border border-neutral-300 bg-neutral-50",Y=forwardRef(({state:e,variant:n,content:a,stepNumber:o,expandable:m,isClickable:c,headerMenu:d,defaultExpanded:s,onExpandedChange:f,onHeaderButtonClick:u,className:p,children:v,...b},k)=>{let r=m===true,l=c===true,C=useMemo(()=>G(j(e,n,a,o)),[e,n,a,o]),z=useMemo(()=>({state:e,indicator:C,expandable:r,isClickable:l,headerMenu:l?d:void 0,onHeaderButtonClick:l?void 0:u}),[e,C,r,l,d,u]),V=useCallback(F=>{f?.(F.open);},[f]);return jsx(R.Provider,{value:z,children:jsx(K,{state:e,children:r?jsx(Collapsible.Root,{ref:k,defaultOpen:s??false,onOpenChange:V,className:a$1(A,p),...b,children:v}):jsx("div",{ref:k,className:a$1(A,p),...b,children:v})})})});Y.displayName="TrackerItem";export{J as a,Q as b,W as c,X as d,Y as e};
@@ -0,0 +1 @@
1
+ import {c}from'./chunk-23G2RUJ6.js';import {a}from'./chunk-3RNV3YTB.js';import {e}from'./chunk-QMPBFFFC.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 J=["horizontal","vertical"];var O=tv({slots:{item:["group/item my-0.5 flex w-fit items-center gap-1","data-disabled:cursor-not-allowed"],control:["relative m-0.5 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-600 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:data-[state=unchecked]:border-neutral-400","data-disabled:data-[state=unchecked]:bg-neutral-200","data-disabled:data-[state=checked]:border-neutral-400","data-disabled:data-[state=checked]:bg-neutral-200","data-disabled:data-[state=checked]:before:border-neutral-200","data-disabled:data-[state=checked]:before:bg-neutral-600","group-data-[error=true]:data-[state=unchecked]:border-0","group-data-[error=true]:data-[state=unchecked]:ring-2","group-data-[error=true]:data-[state=unchecked]:ring-danger-500","group-data-[error=true]:data-[state=unchecked]:focus:border-0"],text:["font-inter text-sm leading-[143%]","text-neutral-900","data-disabled:text-neutral-600"],tooltipContainer:"flex items-center gap-2",tooltipIcon:"size-3.5"},variants:{disabled:{true:{tooltipIcon:"text-neutral-600"}}}}),T=tv({base:"group",variants:{labelOrientation:{horizontal:"flex gap-4",vertical:"flex flex-col gap-3"}}}),z=tv({base:"flex",variants:{orientation:{horizontal:"flex-wrap gap-8",vertical:"flex-col gap-4"}}}),w=forwardRef(({className:n,innerClassName:a,orientation:t="horizontal",labelOrientation:o="vertical",onValueChange:r,error:d,label:i,labelProps:s,required:p,tooltip:u,children:c$1,...m},b)=>{let l=useCallback(k=>{r?.(k.value);},[r]);return jsxs(RadioGroupRoot,{"data-error":d,className:T({className:n,labelOrientation:o}),orientation:t,ref:b,onValueChange:l,...m,children:[i&&jsx(c,{...s,as:RadioGroupLabel,label:i,required:p,tooltip:s?.tooltip??u,className:"mb-0"}),jsx("div",{className:z({orientation:t,className:a}),children:c$1})]})});w.displayName="RadioGroup";var V=forwardRef(({value:n,label:a$1,className:t,tooltip:o,tooltipProps:r,disabled:d,...i},s)=>{let{item:p,control:u,text:c,tooltipContainer:m,tooltipIcon:b}=O({disabled:d}),l=jsxs(RadioGroupItem,{value:n,className:p({className:t}),disabled:d,ref:s,...i,children:[jsx(RadioGroupItemControl,{className:u()}),a$1&&jsx(RadioGroupItemText,{className:c(),children:a$1}),jsx(RadioGroupItemHiddenInput,{})]});return o?jsxs("div",{className:m(),children:[l,jsx(a,{...r,content:o,children:jsx(e,{className:b()})})]}):l});V.displayName="RadioGroupItem";export{J as a,O as b,w as c,V as d};
@@ -1 +1 @@
1
- import {b as b$1}from'./chunk-JTLKG23S.js';import {a as a$1}from'./chunk-AWRP67K4.js';import {a}from'./chunk-OBZIYJO7.js';import {MenuPositioner,MenuContent,MenuItem,MenuTrigger,MenuRoot}from'@ark-ui/react/menu';import {Portal}from'@ark-ui/react/portal';import {forwardRef}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var c="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 b={placement:"bottom-start",flip:["bottom-end"]},A=({lazyMount:n=true,unmountOnExit:s=true,positioning:a=b,onSelect:o,...i})=>jsx(MenuRoot,{lazyMount:n,unmountOnExit:s,positioning:a,...i,onSelect:o?r=>o(r.value):void 0}),k=MenuTrigger,v=MenuItem,x=a("elevation-9 z-layer max-h-67.5 max-w-[calc(100vw-1rem)] min-w-max overflow-y-auto rounded-lg bg-neutral-50 py-1 outline-none",c),g=forwardRef(({className:n,children:s,...a$1},o)=>jsx(Portal,{children:jsx(MenuPositioner,{children:jsx(MenuContent,{ref:o,className:a(x,n),...a$1,children:s})})}));g.displayName="MenuContent";var L="data-highlighted:bg-primary-100 outline-none [&_p]:break-normal",T=({value:n,label:s,description:a,startIcon:o,endIcon:i,hasDivider:r,disabled:l,onSelect:u})=>jsxs(Fragment,{children:[jsx(MenuItem,{value:n,disabled:l,onSelect:u?()=>u(n):void 0,asChild:true,children:jsxs(b$1.Root,{disabled:l,className:L,children:[o&&jsx(b$1.Leading,{children:jsx(b$1.Icon,{children:o})}),jsxs(b$1.Content,{children:[jsx(b$1.Headline,{children:s}),a&&jsx(b$1.Description,{children:a})]}),i&&jsx(b$1.Trailing,{children:jsx(b$1.Icon,{children:i})})]})}),r&&jsx(a$1,{})]}),S={Root:A,Trigger:k,Content:g,Item:v,Option:T};export{S as a};
1
+ import {b as b$1}from'./chunk-F2W4ZYYU.js';import {a as a$1}from'./chunk-AWRP67K4.js';import {a}from'./chunk-OBZIYJO7.js';import {MenuPositioner,MenuContent,MenuItem,MenuTrigger,MenuRoot}from'@ark-ui/react/menu';import {Portal}from'@ark-ui/react/portal';import {forwardRef}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var c="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 b={placement:"bottom-start",flip:["bottom-end"]},A=({lazyMount:n=true,unmountOnExit:s=true,positioning:a=b,onSelect:o,...i})=>jsx(MenuRoot,{lazyMount:n,unmountOnExit:s,positioning:a,...i,onSelect:o?r=>o(r.value):void 0}),k=MenuTrigger,v=MenuItem,x=a("elevation-9 z-layer max-h-67.5 max-w-[calc(100vw-1rem)] min-w-max overflow-y-auto rounded-lg bg-neutral-50 py-1 outline-none",c),g=forwardRef(({className:n,children:s,...a$1},o)=>jsx(Portal,{children:jsx(MenuPositioner,{children:jsx(MenuContent,{ref:o,className:a(x,n),...a$1,children:s})})}));g.displayName="MenuContent";var L="data-highlighted:bg-primary-100 outline-none [&_p]:break-normal",T=({value:n,label:s,description:a,startIcon:o,endIcon:i,hasDivider:r,disabled:l,onSelect:u})=>jsxs(Fragment,{children:[jsx(MenuItem,{value:n,disabled:l,onSelect:u?()=>u(n):void 0,asChild:true,children:jsxs(b$1.Root,{disabled:l,className:L,children:[o&&jsx(b$1.Leading,{children:jsx(b$1.Icon,{children:o})}),jsxs(b$1.Content,{children:[jsx(b$1.Headline,{children:s}),a&&jsx(b$1.Description,{children:a})]}),i&&jsx(b$1.Trailing,{children:jsx(b$1.Icon,{children:i})})]})}),r&&jsx(a$1,{})]}),S={Root:A,Trigger:k,Content:g,Item:v,Option:T};export{S as a};
@@ -1 +1 @@
1
- import {d,c,b as b$1}from'./chunk-FWNRSQND.js';import {d as d$1}from'./chunk-YFDUDY6Y.js';import {a as a$2}from'./chunk-3RNV3YTB.js';import {B,h}from'./chunk-QMPBFFFC.js';import {a as a$1}from'./chunk-HZYZAFW3.js';import {e}from'./chunk-QYA5ZUUN.js';import {a}from'./chunk-OBZIYJO7.js';import {useLocaleContext}from'@ark-ui/react/locale';import {getDefaultOptions}from'date-fns';import {tv}from'tailwind-variants';import {jsx,jsxs}from'react/jsx-runtime';var n=tv({slots:{header:"flex w-full flex-col gap-3 px-3 py-2 font-normal",author:"min-w-0",authorLabel:"text-xs text-neutral-700 uppercase",authorRow:"mt-0.5 flex items-center justify-between gap-3",authorName:"min-w-0 text-sm font-semibold break-words",authorSecondary:"mt-0.5 text-xs break-words text-neutral-800",bodyFile:"flex min-w-0 items-center gap-3",fileIcon:"size-12 shrink-0",fileText:"flex min-w-0 flex-1 flex-col gap-0.5",fileName:"text-sm font-semibold break-words text-neutral-900",fileDescription:"line-clamp-1 text-xs text-neutral-800",meta:"flex min-w-0 flex-wrap items-center gap-2 empty:hidden",footer:"flex items-center gap-3",date:"min-w-0 text-sm text-neutral-700",footerActions:"ml-auto flex shrink-0 items-center gap-3"}}),u=()=>{let{locale:t}=useLocaleContext();return t??getDefaultOptions().locale?.code},C={en:{author:"Creator",externalReference:"Ext. ref.",addExternalReference:"Add ext. ref."},es:{author:"Creador/a",externalReference:"Ref. ext.",addExternalReference:"Agregar ref. ext."},pt:{author:"Criador",externalReference:"Ref. ext.",addExternalReference:"Adicionar ref. ext."}},A=t=>t?.startsWith("es")?C.es:t?.startsWith("pt")?C.pt:C.en,b=({children:t,className:e,...r})=>{let{header:o}=n();return jsx("div",{className:o({className:e}),...r,children:t})};b.displayName="AttachmentCardHeader";var L=()=>{let t=u(),{authorLabel:e}=n();return jsx("p",{className:e(),children:A(t).author})};L.displayName="AttachmentCardAuthorLocalizedLabel";var v=({label:t,name:e,secondary:r,actions:o,className:d})=>{let{author:i,authorLabel:l,authorRow:m,authorName:$,authorSecondary:K}=n();return jsxs("div",{className:i({className:d}),children:[t?jsx("p",{className:l(),children:t}):jsx(L,{}),jsxs("div",{className:m(),children:[jsx("p",{className:$(),children:e}),o]}),r&&jsx("p",{className:K(),children:r})]})};v.displayName="AttachmentCardAuthor";var w=({children:t,className:e,...r})=>jsx(b$1,{className:a("min-w-0",e),...r,children:t});w.displayName="AttachmentCardBody";var W=({name:t,description:e,className:r})=>{let{bodyFile:o,fileIcon:d,fileText:i,fileName:l,fileDescription:m}=n();return jsxs("div",{className:o({className:r}),children:[jsxs("div",{className:i(),children:[jsx("p",{className:l(),children:t}),e&&jsx("p",{className:m(),children:e})]}),jsx(a$1,{className:d(),"aria-hidden":true})]})};W.displayName="AttachmentCardBodyFile";var I=({children:t,className:e})=>{let{meta:r}=n();return jsx("div",{className:r({className:e}),children:t})};I.displayName="AttachmentCardMeta";var E=({children:t,className:e,...r})=>{let{footer:o}=n();return jsx(c,{className:o({className:e}),...r,children:t})};E.displayName="AttachmentCardFooter";var S=({children:t,className:e})=>{let{date:r}=n();return jsx("span",{className:r({className:e}),children:t})};S.displayName="AttachmentCardDate";var T=({children:t,className:e})=>{let{footerActions:r}=n();return jsx("div",{className:r({className:e}),children:t})};T.displayName="AttachmentCardFooterActions";var z=t=>jsx(e,{...t,variant:"ghost",tone:"neutral",size:"md",EndIcon:h});z.displayName="AttachmentCardActionButton";var f=({badgeText:t})=>jsx(a$2,{content:t,children:jsx(d$1,{variant:"light",size:"sm",color:"neutral",className:"max-w-full",text:t})});f.displayName="AttachmentCardReferenceBadgeContent";var D=({value:t})=>{let e=u(),r=`${A(e).externalReference}: ${t}`;return jsx(f,{badgeText:r})};D.displayName="AttachmentCardReferenceBadgeWithLocale";var y=({label:t,value:e})=>e==null||e===""?null:t?jsx(f,{badgeText:`${t}: ${e}`}):jsx(D,{value:e});y.displayName="AttachmentCardReferenceBadge";var k=t=>{let e$1=u();return jsx(e,{...t,variant:"secondary",size:"sm",StartIcon:B,children:A(e$1).addExternalReference})};k.displayName="AttachmentCardReferenceAddButtonWithLocale";var H=({children:t,...e$1})=>t?jsx(e,{...e$1,variant:"secondary",size:"sm",StartIcon:B,children:t}):jsx(k,{...e$1});H.displayName="AttachmentCardReferenceAddButton";var M=({label:t,value:e,addAction:r})=>e!=null&&e!==""?jsx(y,{label:t,value:e}):r??null;M.displayName="AttachmentCardReference";var O=({children:t,className:e,...r})=>jsx(d,{variant:"outline",tone:"neutral",className:a("elevation-8 w-full border-0",e),...r,children:t});O.displayName="AttachmentCard";var et=Object.assign(O,{Header:b,Author:v,Body:w,BodyFile:W,Meta:I,Footer:E,Date:S,FooterActions:T,ActionButton:z,Reference:M,ReferenceBadge:y,ReferenceAddButton:H});export{et as a};
1
+ import {d,c,b as b$1}from'./chunk-YZ2TZLJZ.js';import {d as d$1}from'./chunk-YFDUDY6Y.js';import {a as a$2}from'./chunk-3RNV3YTB.js';import {B,h}from'./chunk-QMPBFFFC.js';import {a as a$1}from'./chunk-HZYZAFW3.js';import {e}from'./chunk-QYA5ZUUN.js';import {a}from'./chunk-OBZIYJO7.js';import {useLocaleContext}from'@ark-ui/react/locale';import {getDefaultOptions}from'date-fns';import {tv}from'tailwind-variants';import {jsx,jsxs}from'react/jsx-runtime';var n=tv({slots:{header:"flex w-full flex-col gap-3 px-3 py-2 font-normal",author:"min-w-0",authorLabel:"text-xs text-neutral-700 uppercase",authorRow:"mt-0.5 flex items-center justify-between gap-3",authorName:"min-w-0 text-sm font-semibold break-words",authorSecondary:"mt-0.5 text-xs break-words text-neutral-800",bodyFile:"flex min-w-0 items-center gap-3",fileIcon:"size-12 shrink-0",fileText:"flex min-w-0 flex-1 flex-col gap-0.5",fileName:"text-sm font-semibold break-words text-neutral-900",fileDescription:"line-clamp-1 text-xs text-neutral-800",meta:"flex min-w-0 flex-wrap items-center gap-2 empty:hidden",footer:"flex items-center gap-3",date:"min-w-0 text-sm text-neutral-700",footerActions:"ml-auto flex shrink-0 items-center gap-3"}}),u=()=>{let{locale:t}=useLocaleContext();return t??getDefaultOptions().locale?.code},C={en:{author:"Creator",externalReference:"Ext. ref.",addExternalReference:"Add ext. ref."},es:{author:"Creador/a",externalReference:"Ref. ext.",addExternalReference:"Agregar ref. ext."},pt:{author:"Criador",externalReference:"Ref. ext.",addExternalReference:"Adicionar ref. ext."}},A=t=>t?.startsWith("es")?C.es:t?.startsWith("pt")?C.pt:C.en,b=({children:t,className:e,...r})=>{let{header:o}=n();return jsx("div",{className:o({className:e}),...r,children:t})};b.displayName="AttachmentCardHeader";var L=()=>{let t=u(),{authorLabel:e}=n();return jsx("p",{className:e(),children:A(t).author})};L.displayName="AttachmentCardAuthorLocalizedLabel";var v=({label:t,name:e,secondary:r,actions:o,className:d})=>{let{author:i,authorLabel:l,authorRow:m,authorName:$,authorSecondary:K}=n();return jsxs("div",{className:i({className:d}),children:[t?jsx("p",{className:l(),children:t}):jsx(L,{}),jsxs("div",{className:m(),children:[jsx("p",{className:$(),children:e}),o]}),r&&jsx("p",{className:K(),children:r})]})};v.displayName="AttachmentCardAuthor";var w=({children:t,className:e,...r})=>jsx(b$1,{className:a("min-w-0",e),...r,children:t});w.displayName="AttachmentCardBody";var W=({name:t,description:e,className:r})=>{let{bodyFile:o,fileIcon:d,fileText:i,fileName:l,fileDescription:m}=n();return jsxs("div",{className:o({className:r}),children:[jsxs("div",{className:i(),children:[jsx("p",{className:l(),children:t}),e&&jsx("p",{className:m(),children:e})]}),jsx(a$1,{className:d(),"aria-hidden":true})]})};W.displayName="AttachmentCardBodyFile";var I=({children:t,className:e})=>{let{meta:r}=n();return jsx("div",{className:r({className:e}),children:t})};I.displayName="AttachmentCardMeta";var E=({children:t,className:e,...r})=>{let{footer:o}=n();return jsx(c,{className:o({className:e}),...r,children:t})};E.displayName="AttachmentCardFooter";var S=({children:t,className:e})=>{let{date:r}=n();return jsx("span",{className:r({className:e}),children:t})};S.displayName="AttachmentCardDate";var T=({children:t,className:e})=>{let{footerActions:r}=n();return jsx("div",{className:r({className:e}),children:t})};T.displayName="AttachmentCardFooterActions";var z=t=>jsx(e,{...t,variant:"ghost",tone:"neutral",size:"md",EndIcon:h});z.displayName="AttachmentCardActionButton";var f=({badgeText:t})=>jsx(a$2,{content:t,children:jsx(d$1,{variant:"light",size:"sm",color:"neutral",className:"max-w-full",text:t})});f.displayName="AttachmentCardReferenceBadgeContent";var D=({value:t})=>{let e=u(),r=`${A(e).externalReference}: ${t}`;return jsx(f,{badgeText:r})};D.displayName="AttachmentCardReferenceBadgeWithLocale";var y=({label:t,value:e})=>e==null||e===""?null:t?jsx(f,{badgeText:`${t}: ${e}`}):jsx(D,{value:e});y.displayName="AttachmentCardReferenceBadge";var k=t=>{let e$1=u();return jsx(e,{...t,variant:"secondary",size:"sm",StartIcon:B,children:A(e$1).addExternalReference})};k.displayName="AttachmentCardReferenceAddButtonWithLocale";var H=({children:t,...e$1})=>t?jsx(e,{...e$1,variant:"secondary",size:"sm",StartIcon:B,children:t}):jsx(k,{...e$1});H.displayName="AttachmentCardReferenceAddButton";var M=({label:t,value:e,addAction:r})=>e!=null&&e!==""?jsx(y,{label:t,value:e}):r??null;M.displayName="AttachmentCardReference";var O=({children:t,className:e,...r})=>jsx(d,{variant:"outline",tone:"neutral",className:a("elevation-8 w-full border-0",e),...r,children:t});O.displayName="AttachmentCard";var et=Object.assign(O,{Header:b,Author:v,Body:w,BodyFile:W,Meta:I,Footer:E,Date:S,FooterActions:T,ActionButton:z,Reference:M,ReferenceBadge:y,ReferenceAddButton:H});export{et as a};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-3RNV3YTB.js';import {k,l,e}from'./chunk-QMPBFFFC.js';import {CheckboxRoot,CheckboxControl,CheckboxIndicator,CheckboxLabel,CheckboxHiddenInput}from'@ark-ui/react';import {useCallback}from'react';import {tv}from'tailwind-variants';import {jsxs,jsx}from'react/jsx-runtime';var B=[true,"indeterminate",false],D=tv({slots:{root:"group relative flex h-fit w-fit items-center gap-2 transition-all data-disabled:cursor-not-allowed",control:["m-0.5 flex size-4.5 items-center justify-center rounded-sm transition-all ring-inset [&:not([data-disabled])]:cursor-pointer","focus:ring-primary-800 focus:ring-2","data-[state=unchecked]:bg-neutral-50 data-[state=unchecked]:ring-1 data-[state=unchecked]:ring-neutral-600","group-data-[state=unchecked]:group-hover:bg-primary-100 group-data-[state=unchecked]:group-hover:ring-primary-700","data-[state=unchecked]:data-disabled:bg-neutral-100 data-[state=unchecked]:data-disabled:ring-neutral-300","data-[state=checked]:bg-primary-600 data-[state=checked]:data-disabled:bg-neutral-600","group-data-[state=checked]:group-hover:bg-primary-700","data-[state=indeterminate]:bg-primary-600 data-[state=indeterminate]:data-disabled:bg-neutral-600","group-data-[state=indeterminate]:group-hover:bg-primary-700"],icon:"size-3.5 text-neutral-50",label:"font-inter text-sm leading-[143%] text-neutral-900 transition-colors group-data-disabled:text-neutral-600",tooltipContainer:"flex items-center gap-2",tooltipContent:"max-w-96",tooltipIcon:"size-3.5"},variants:{error:{true:{control:["data-[state=unchecked]:ring-danger-500 data-[state=unchecked]:ring-2","group-data-[state=unchecked]:group-hover:ring-danger-500","data-[state=unchecked]:focus:ring-danger-500"]}},disabled:{true:{tooltipIcon:"text-neutral-600"}}}}),E=({className:C,error:b=false,label:a$1,tooltip:o,disabled:r=false,onCheckedChange:n,...p})=>{let{root:u,control:g,icon:c,label:m,tooltipContainer:x,tooltipContent:f,tooltipIcon:v}=D({disabled:r,error:b}),y=useCallback(I=>{n?.(I.checked);},[n]),i=jsxs(CheckboxRoot,{className:u({className:C}),disabled:r,onCheckedChange:y,...p,children:[jsxs(CheckboxControl,{className:g(),children:[jsx(CheckboxIndicator,{children:jsx(k,{className:c()})}),jsx(CheckboxIndicator,{indeterminate:true,children:jsx(l,{className:c()})})]}),a$1&&jsx(CheckboxLabel,{className:m(),children:a$1}),jsx(CheckboxHiddenInput,{})]});return o?jsxs("div",{className:x(),children:[i,jsx(a,{content:o,contentClassName:f(),children:jsx(e,{className:v()})})]}):i};export{B as a,D as b,E as c};
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-35DVM6TF.js';import {g}from'./chunk-QMPBFFFC.js';import {c}from'./chunk-C7TLKKPT.js';import {a}from'./chunk-P6B33GL6.js';import {useCallback}from'react';import {tv}from'tailwind-variants';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var Y=["sm","md","lg"],Z=["semibold","medium"],_=["primary","neutral"],W=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}}),$=({className:s,label:B,badgeText:S="00",StartIcon:o,options:z,onSelect:i,isSelected:l=false,isLoading:n=false,isDisabled:R=false,hasTrailingBadge:T=false,size:d="lg",weight:N="semibold",tone:w="primary",type:u="button",...p})=>{let a$2=R||n,m=z.filter(({isHidden:e})=>!e),b=m.length>0,c$1=n,C=!!o&&!n,I=!n&&T,D=b&&!a$2,k=useCallback(e=>{i?.(e);},[i]),{root:g$1,label:O,icon:y,chevron:E,trailing:H}=W({size:d,weight:N,tone:w,loading:c$1}),P=d,h=jsxs(Fragment,{children:[c$1&&jsx(c,{size:"sm",tone:"neutral",className:y()}),C&&o&&jsx(o,{className:y()}),jsx("span",{className:O(),children:B}),I&&jsx(a,{type:"square",variant:"primary",size:P,text:S,className:H()}),D&&jsx(g,{className:E()})]});return b?jsxs(a$1.Root,{onSelect:k,children:[jsx(a$1.Trigger,{...p,type:u,disabled:a$2,"aria-pressed":l,className:g$1({className:s}),children:h}),jsx(a$1.Content,{children:m.map(e=>jsx(a$1.Option,{value:e.label,label:e.label,description:e.description,startIcon:e.startIcon,endIcon:e.endIcon,hasDivider:e.hasDivider,disabled:e.isDisabled,onSelect:e.onClick},e.label))})]}):jsx("button",{...p,type:u,disabled:a$2,"aria-pressed":l,className:g$1({className:s}),children:h})};export{Y as a,Z as b,_ as c,$ as d};
1
+ import {a as a$1}from'./chunk-OANSRWH2.js';import {g}from'./chunk-QMPBFFFC.js';import {c}from'./chunk-C7TLKKPT.js';import {a}from'./chunk-P6B33GL6.js';import {useCallback}from'react';import {tv}from'tailwind-variants';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var Y=["sm","md","lg"],Z=["semibold","medium"],_=["primary","neutral"],W=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}}),$=({className:s,label:B,badgeText:S="00",StartIcon:o,options:z,onSelect:i,isSelected:l=false,isLoading:n=false,isDisabled:R=false,hasTrailingBadge:T=false,size:d="lg",weight:N="semibold",tone:w="primary",type:u="button",...p})=>{let a$2=R||n,m=z.filter(({isHidden:e})=>!e),b=m.length>0,c$1=n,C=!!o&&!n,I=!n&&T,D=b&&!a$2,k=useCallback(e=>{i?.(e);},[i]),{root:g$1,label:O,icon:y,chevron:E,trailing:H}=W({size:d,weight:N,tone:w,loading:c$1}),P=d,h=jsxs(Fragment,{children:[c$1&&jsx(c,{size:"sm",tone:"neutral",className:y()}),C&&o&&jsx(o,{className:y()}),jsx("span",{className:O(),children:B}),I&&jsx(a,{type:"square",variant:"primary",size:P,text:S,className:H()}),D&&jsx(g,{className:E()})]});return b?jsxs(a$1.Root,{onSelect:k,children:[jsx(a$1.Trigger,{...p,type:u,disabled:a$2,"aria-pressed":l,className:g$1({className:s}),children:h}),jsx(a$1.Content,{children:m.map(e=>jsx(a$1.Option,{value:e.label,label:e.label,description:e.description,startIcon:e.startIcon,endIcon:e.endIcon,hasDivider:e.hasDivider,disabled:e.isDisabled,onSelect:e.onClick},e.label))})]}):jsx("button",{...p,type:u,disabled:a$2,"aria-pressed":l,className:g$1({className:s}),children:h})};export{Y as a,Z as b,_ as c,$ as d};