sodtrack-web-ui 0.109.23 → 0.109.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-XFS2MG6B.js → chunk-2MCKR6KX.js} +1 -1
- package/dist/{chunk-WDD6G7AK.js → chunk-3EMC2WVC.js} +1 -1
- package/dist/{chunk-IZVYL53R.js → chunk-3G64XQGO.js} +1 -1
- package/dist/{chunk-7QFMZUHO.js → chunk-A6APVBGY.js} +1 -1
- package/dist/{chunk-WQXTACDW.js → chunk-AGR3KR24.js} +1 -1
- package/dist/{chunk-D7IVBSXD.js → chunk-DB2FUUF5.js} +1 -1
- package/dist/{chunk-NLEQIR6A.js → chunk-EJNWHQVT.js} +1 -1
- package/dist/{chunk-TYMUP3LR.js → chunk-HWYJLM4O.js} +1 -1
- package/dist/{chunk-MU7XAC5W.js → chunk-LHUPLORK.js} +1 -1
- package/dist/{chunk-2BOGDWLR.js → chunk-LUQQ6CGZ.js} +1 -1
- package/dist/{chunk-7XQYCW4L.js → chunk-MFVBB7LJ.js} +1 -1
- package/dist/{chunk-SGQFEQJJ.js → chunk-NETNR3VC.js} +1 -1
- package/dist/{chunk-C45CFY6D.js → chunk-PKH2WC3V.js} +1 -1
- package/dist/{chunk-UTBWDSL3.js → chunk-QAFHVJD5.js} +1 -1
- package/dist/{chunk-IZFPW7SS.js → chunk-QLPFU42W.js} +1 -1
- package/dist/{chunk-JD5OCWIV.js → chunk-RBPNFUWP.js} +1 -1
- package/dist/{chunk-DUBQPI4Q.js → chunk-RVEUW4QG.js} +1 -1
- package/dist/{chunk-QGEOF4DM.js → chunk-SNVP243V.js} +1 -1
- package/dist/{chunk-NKD2N5ZT.js → chunk-TZNMKBEU.js} +1 -1
- package/dist/{chunk-2D52XBAM.js → chunk-UHFTMWEK.js} +1 -1
- package/dist/{chunk-W2MX3SEP.js → chunk-WJS7UII5.js} +1 -1
- package/dist/{chunk-FOKLET3V.js → chunk-XWBK5NU6.js} +1 -1
- package/dist/{chunk-OB7PQC3A.js → chunk-Y3GITC4K.js} +1 -1
- package/dist/{chunk-7Q5GDQ2X.js → chunk-YUWN3BIR.js} +1 -1
- package/dist/{chunk-QGHYQUQ5.js → chunk-ZUAYZB2L.js} +1 -1
- package/dist/components/alert-dialog.js +1 -1
- package/dist/components/alert-message.js +1 -1
- package/dist/components/autocomplete-multiple.js +1 -1
- package/dist/components/autocomplete-skeleton.js +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/button-active.js +1 -1
- package/dist/components/button-menu.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/card-basic.js +1 -1
- package/dist/components/card-expandable.js +1 -1
- package/dist/components/card-form.js +1 -1
- package/dist/components/data-table.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer-bar.js +1 -1
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropzone.js +1 -1
- package/dist/components/empty-state.js +1 -1
- package/dist/components/error-screen.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/list-item-arrow.js +1 -1
- package/dist/components/list-item-button.js +1 -1
- package/dist/components/list-item-checkbox-left.js +1 -1
- package/dist/components/list-item-checkbox.js +1 -1
- package/dist/components/list-item.js +1 -1
- package/dist/components/list-item_old.js +1 -1
- package/dist/components/menu.js +1 -1
- package/dist/components/select-skeleton.js +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/snackbar.js +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tracker-item.js +1 -1
- package/dist/locale.d.ts +138 -0
- package/dist/locale.js +2 -0
- package/dist/styles/index.css +1 -1
- package/package.json +5 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {e as e$2}from'./chunk-PI7DECIN.js';import {e,c,b,f,d}from'./chunk-Q4CWL65C.js';import {e as e$1}from'./chunk-
|
|
1
|
+
import {e as e$2}from'./chunk-PI7DECIN.js';import {e,c,b,f,d}from'./chunk-Q4CWL65C.js';import {e as e$1}from'./chunk-RVEUW4QG.js';import {a}from'./chunk-OBZIYJO7.js';import {useState,useCallback}from'react';import {tv}from'tailwind-variants';import {jsxs,jsx}from'react/jsx-runtime';var w=tv({slots:{container:"flex shrink-0 rounded-lg p-3 pr-2 ring ring-inset",icon:"mr-3 size-6 shrink-0",closeIcon:"ml-3 shrink-0",title:"font-inter my-auto text-sm leading-[143%] text-neutral-900",description:"font-inter mt-1 line-clamp-3 text-xs leading-[130%] text-neutral-900"},variants:{hasCloseButton:{true:{}},variant:{warning:{container:"bg-warning-100 ring-warning-600",icon:"text-warning-800"},success:{container:"bg-success-100 ring-success-600",icon:"text-success-800"},error:{container:"bg-danger-100 ring-danger-600",icon:"text-danger-800"},info:{container:"bg-info-100 ring-info-600",icon:"text-info-800"}}},defaultVariants:{variant:"info",size:"md",hasCloseButton:true}}),S={warning:f,success:b,error:c,info:e},O=({variant:r="info",className:p,description:t,title:d$1,hasCloseButton:a$1=true,actionButton:n})=>{let[x,N]=useState(true),{container:v,icon:h,closeIcon:C,title:I,description:y}=w({variant:r,hasCloseButton:a$1}),b=useCallback(()=>{N(false);},[]),M=S[r||"info"];return jsxs("div",{role:"alert",className:a(v(),p,!x&&"hidden"),children:[jsxs("div",{className:"flex flex-1",children:[jsx(M,{className:h({className:!t&&"my-auto"}),"aria-hidden":"true"}),jsxs("div",{className:"flex flex-col",children:[jsx("h6",{className:I({className:t&&"font-semibold"}),children:d$1}),t&&jsx("p",{className:y(),children:t})]})]}),n&&jsx(e$1,{...n,variant:"secondary",tone:"neutral",className:a("my-auto ml-4.5",n.className),size:"lg"}),a$1&&jsx(e$2,{Icon:d,className:C(),size:"sm",variant:"ghost",tone:"neutral",onClick:b,"aria-label":"Close alert"})]})};export{O as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-LUQQ6CGZ.js';import {g}from'./chunk-Q4CWL65C.js';import {d}from'./chunk-RVEUW4QG.js';import {useCallback}from'react';import {tv}from'tailwind-variants';import {jsxs,jsx}from'react/jsx-runtime';var S=["sm","md","lg"],I=["primary","secondary","ghost"],N=["primary","neutral"],B=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:{}}}}),R=({label:l,options:c,onSelect:o,variant:u="primary",size:p="md",disabled:s=false,className:m,tone:d="primary",...v})=>{let g$1=useCallback(t=>{o?.(t);},[o]),{root:b,icon:y}=B({variant:u,size:p,tone:d,disabled:s});return jsxs(a.Root,{onSelect:g$1,...v,children:[jsxs(a.Trigger,{disabled:s,className:b({className:m}),children:[l,jsx(g,{className:y({className:"transition-transform duration-150 group-data-[state=open]:rotate-180"})})]}),jsx(a.Content,{children:c.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{S as a,I as b,N as c,R as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {e,i,f,a as a$1,b,c,g,h,d,j as j$1}from'./chunk-MU7XAC5W.js';import {a as a$5,b as b$1,c as c$2}from'./chunk-GTVHYHF4.js';import {c as c$1}from'./chunk-E3WJNVAZ.js';import {a as a$3}from'./chunk-KTD2GEB6.js';import {a as a$2}from'./chunk-HIULYFIC.js';import {e as e$1,B,I,H,r,G,F,E,D,y,z,A,f as f$1,C}from'./chunk-Q4CWL65C.js';import {a as a$4}from'./chunk-ICF6RQIW.js';import {e as e$2}from'./chunk-DUBQPI4Q.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-LHUPLORK.js';import {a as a$5,b as b$1,c as c$2}from'./chunk-GTVHYHF4.js';import {c as c$1}from'./chunk-E3WJNVAZ.js';import {a as a$2}from'./chunk-HIULYFIC.js';import {e as e$1,B,I,H,r,G,F,E,D,y,z,A,f as f$1,C}from'./chunk-Q4CWL65C.js';import {a as a$4}from'./chunk-ICF6RQIW.js';import {e as e$2}from'./chunk-RVEUW4QG.js';import {a as a$3}from'./chunk-KTD2GEB6.js';import {a}from'./chunk-OBZIYJO7.js';import {memo,useMemo,useState,useCallback,useRef,useEffect}from'react';import {flexRender,useReactTable,getCoreRowModel}from'@tanstack/react-table';import {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 {a as a$1}from'./chunk-AWRP67K4.js';import {e}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-AWRP67K4.js';import {e}from'./chunk-RVEUW4QG.js';import {a}from'./chunk-OBZIYJO7.js';import {jsx,jsxs}from'react/jsx-runtime';var v=({children:e,className:r,...o})=>jsx("div",{...o,className:a("bg-neutral-80 @container rounded-lg border border-neutral-200",r),children:e}),u=({title:e$1,buttons:r,...o})=>jsxs("div",{...o,children:[jsxs("div",{className:"flex items-center justify-between gap-2.5 px-3 py-2 empty:hidden",children:[!!e$1&&jsx("h2",{className:"text-lg font-medium",children:e$1}),!!r&&r?.length>0&&jsx("div",{className:"ml-auto flex gap-2",children:r?.map((i,p)=>jsx(e,{...i,size:"md"},p))})]}),jsx(a$1,{})]}),P=({children:e,className:r,...o})=>jsx("div",{...o,className:a("px-3 py-4",r),children:e}),y=({children:e,ignorePadding:r=false,innerClassName:o,...i})=>jsxs("div",{...i,children:[jsx(a$1,{}),jsx("div",{className:a(o,!r&&"px-3 py-4"),children:e})]});export{v as a,u as b,P as c,y as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c as c$2}from'./chunk-JYNJHAGL.js';import {c as c$1}from'./chunk-E3WJNVAZ.js';import {a as a$
|
|
1
|
+
import {c as c$2}from'./chunk-JYNJHAGL.js';import {c as c$1}from'./chunk-E3WJNVAZ.js';import {a as a$1}from'./chunk-HIULYFIC.js';import {a as a$2}from'./chunk-JW7HS6NX.js';import {d}from'./chunk-MP4CHZ2K.js';import {e as e$1}from'./chunk-PI7DECIN.js';import {e,t,u}from'./chunk-Q4CWL65C.js';import {e as e$2}from'./chunk-RVEUW4QG.js';import {a as a$3}from'./chunk-P6B33GL6.js';import {a}from'./chunk-OBZIYJO7.js';import {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 c=tv({slots:{root:"ring-expandable-card-border group/expandable-card flex h-fit flex-col rounded-lg ring transition-all duration-200 ease-in-out ring-inset",header:"flex pt-3 pr-1 pb-2 pl-3",headerLabel:"text-sm leading-[130%] font-semibold 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 border-expandable-card-border overflow-hidden group-data-[state=open]/expandable-card:border-t",contentInner:"px-3 pt-4 pb-6",fixedContent:"border-expandable-card-border border-t px-3 pt-6 pb-4"},variants:{background:{white:{root:"bg-neutral-50"},gray:{root:"bg-neutral-100"}}},defaultVariants:{background:"white"}}),G=(a,e)=>e?.startsWith("es")?a?"Contraer":"Expandir":e?.startsWith("pt")?a?"Recolher":"Expandir":a?"Collapse":"Expand",gt=({headerLabel:a$4,complementaryText:e$3,subtitle:o,headerTooltip:n,className:m,action:i,chipStatus:l,badgeExpandable:p,chipExpandable:h,badgeNumber:b,Icon:v,iconButtons:w,checkbox:x,...D})=>{let{header:M,headerLabel:O,complementaryText:F,subtitle:A}=c(),E=useCollapsibleContext(),{locale:R}=getDefaultOptions(),S=G(E.open,R?.code);return jsxs("div",{...D,className:a(M(),m),children:[x&&jsx(c$1,{...x,className:a("mt-0.25 mr-1",x.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-2",children:[v&&jsx(v,{className:"h-3.5 w-3.5 shrink-0"}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("b",{className:O(),children:a$4}),e$3&&jsx("span",{className:F(),children:e$3}),n&&jsx(a$1,{content:n,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:[l&&jsx(d,{...l,size:"xs",type:"light"}),h&&jsx(c$2,{...h,type:"light"}),p&&jsx(a$2,{...p,size:"md"}),b&&jsx(a$3,{text:b.text,affix:b.affix,size:"md",variant:"primary",type:"square"}),w?.map((d,C)=>{let{tooltipContent:N,...U}=d;return jsx(a$1,{content:N,disabled:!N,children:jsx(e$1,{...U,variant:"ghost",tone:"neutral",size:"sm"})},C)}),i&&(()=>{let{tooltipContent:d,...C}=i;return jsx(a$1,{content:d,disabled:!d,children:jsx(e$2,{...C,size:"sm",variant:"ghost",tone:"neutral"})})})(),jsx(a$1,{content:S,asChild:true,children:jsx(Collapsible.Trigger,{asChild:true,children:jsx(e$1,{Icon:E.open?t:u,variant:"ghost",size:"sm",tone:"neutral"})})})]})]}),o&&jsx("p",{className:A(),children:o})]})]})},ft=({className:a,...e})=>{let{contentInner:o,content:n}=c();return jsx(Collapsible.Content,{className:n(),children:jsx("div",{...e,className:o({className:a})})})},ht=({className:a,...e})=>{let{fixedContent:o}=c();return jsx("div",{...e,className:o({className:a})})},vt=({className:a,onOpenChange:e,children:o,background:n="white",...m})=>{let{root:i}=c({background:n}),l=useCallback(p=>{e?.(p);},[e]);return jsx(Collapsible.Root,{onOpenChange:l,className:i({className:a}),...m,children:o})};export{gt as a,ft as b,ht as c,vt as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$8}from'./chunk-
|
|
1
|
+
import {a as a$8}from'./chunk-Y3GITC4K.js';import {a as a$7}from'./chunk-FHABUQAH.js';import {a as a$4}from'./chunk-76J4QR6W.js';import {a as a$3}from'./chunk-ZMMNEYEQ.js';import {a,b,c,d}from'./chunk-QJOYOR4B.js';import {a as a$5}from'./chunk-VIMWKUML.js';import {a as a$1}from'./chunk-6MK7NLF5.js';import {a as a$6}from'./chunk-JW7HS6NX.js';import {a as a$2}from'./chunk-OBZIYJO7.js';import {createListCollection,useCombobox,Combobox,useComboboxContext}from'@ark-ui/react/combobox';import {useFilter}from'@ark-ui/react/locale';import {Portal}from'@ark-ui/react/portal';import {useMemo,useRef,useState,useCallback,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';function me(){let n=useComboboxContext(),r=useRef(n);r.current=n;let i=n.value.join("|"),m=n.inputValue.length>0,d=n.collection.size;return useEffect(()=>{if(!i||m||!d)return;let s=r.current.collection.stringify(r.current.value[0]);s&&r.current.setInputValue(s);},[i,m,d]),null}var De=a,de=b,be=n=>{let{label:r,error:i,required:m,tooltip:d$1,disabled:s,readOnly:S,options:u,onInputValueChange:y,onSelect:b,defaultValue:A,helperText:K,noResultsTitle:O,noResultsDescription:U,noResultsIcon:_,noResultsTitleLines:J,noResultsDescriptionLines:Q,value:l,size:W=de,className:X,emptyState:Y,...Z}=n,$=Object.getOwnPropertyNames(n),R=typeof l=="object"&&l!==null?l.value:l,f=useMemo(()=>typeof l!="object"||l===null||u.some(e=>e.value===l.value)?u:[l,...u],[u,l]),g=useRef(null),ee=useMemo(()=>({sensitivity:"base"}),[]),{contains:I}=useFilter(ee),[x,te]=useState(""),V=useMemo(()=>createListCollection({items:f,itemToString:e=>e.label,itemToValue:e=>String(e.value)}),[f]),a=useMemo(()=>x?V.filter((e,w,v)=>I(e,x)||!!v.description&&I(v.description,x)):V,[V,x,I]),c$1=useCallback(e=>{te(e??"");},[]),oe=useCallback(e=>{let w=f.find(v=>String(v.value)===e.itemValue);w&&b?.(w);},[b,f]),ne=useCallback(e=>{if(e.reason==="input-change"){c$1(e.inputValue),y?.(e.inputValue??"");return}c$1(""),e.reason==="clear-trigger"&&y?.("");},[c$1,y]),le=useCombobox({collection:a,defaultValue:A!=null?[String(A)]:void 0,placeholder:n.placeholder,inputValue:n.inputValue,onInputValueChange:ne,value:$.includes("value")?R!=null?[String(R)]:[]:void 0,onSelect:oe,inputBehavior:"autocomplete",openOnClick:true,disabled:s,readOnly:S,...Z}),re=useCallback(()=>{b?.(null);},[b]);useEffect(()=>{g.current&&g.current.value===""&&c$1("");},[c$1,g.current?.value]);let N=c({error:i,disabled:s,readOnly:S,size:W});return jsxs(Combobox.RootProvider,{value:le,"data-error":i||void 0,className:N.root({className:X}),children:[jsx(a$1,{as:Combobox.Label,label:r,required:m,tooltip:d$1}),jsx(me,{}),jsxs(Combobox.Control,{className:a$2(N.control(),"group/control items-center justify-between gap-2 overflow-hidden px-3",s&&"cursor-not-allowed"),children:[jsx(Combobox.Input,{ref:g,className:a$2(N.input(),"data-placeholder-shown:text-input-placeholder px-0 text-left disabled:cursor-not-allowed")}),i&&jsx(d,{}),!S&&jsx(a$3,{as:Combobox.ClearTrigger,className:"group-data-disabled/control:hidden",onClick:re}),jsx(Combobox.Trigger,{className:"group/chevron-host cursor-pointer group-data-disabled/control:cursor-not-allowed",children:jsx(a$4,{})})]}),jsx(a$5,{children:K}),jsx(Portal,{children:jsx(Combobox.Positioner,{children:jsx(Combobox.Content,{className:"elevation-9 z-layer bg-input-bg max-h-67.5 min-w-27.5 overflow-auto rounded-lg",children:jsxs(Combobox.ItemGroup,{className:a$2({"flex flex-col items-center justify-center":a.items.length===0}),children:[a.items.length>0&&a.items.map(e=>jsx(Combobox.Item,{item:e,className:"font-inter data-highlighted:bg-primary-100 block w-full cursor-pointer p-3 data-disabled:cursor-not-allowed data-disabled:text-neutral-400",children:jsx(Combobox.ItemText,{className:"flex w-full min-w-0 flex-col gap-1",asChild:true,children:jsxs("div",{className:"w-full min-w-0",children:[jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[jsx("p",{className:"min-w-0 flex-1 truncate text-sm leading-[130%] font-medium",children:e.label}),e.badgeExpandable&&jsx("div",{className:"flex shrink-0 justify-end overflow-visible",children:jsx(a$6,{size:"sm",...e.badgeExpandable})})]}),e.description&&jsx("p",{className:"text-xs leading-[130%]",children:e.description})]})})},e.value)),a.items.length===0&&O&&jsx(a$7,{title:O,description:U,Icon:_,descriptionLines:Q,titleLines:J}),a.items.length===0&&jsx(a$8,{size:"sm",variant:"not-found",...Y})]})})})})]})};be.displayName="Autocomplete";export{De as a,de as b,be as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d}from'./chunk-7JM2X4UD.js';import {c as c$1}from'./chunk-E3WJNVAZ.js';import {a as a$1}from'./chunk-JW7HS6NX.js';import {e as e$1}from'./chunk-PI7DECIN.js';import {e}from'./chunk-Q4CWL65C.js';import {e as e$2}from'./chunk-
|
|
1
|
+
import {d}from'./chunk-7JM2X4UD.js';import {c as c$1}from'./chunk-E3WJNVAZ.js';import {a as a$1}from'./chunk-JW7HS6NX.js';import {e as e$1}from'./chunk-PI7DECIN.js';import {e}from'./chunk-Q4CWL65C.js';import {e as e$2}from'./chunk-RVEUW4QG.js';import {a}from'./chunk-OBZIYJO7.js';import {createContext,useContext,useState}from'react';import {tv}from'tailwind-variants';import {ImageIcon}from'lucide-react';import {jsx,jsxs}from'react/jsx-runtime';var c={tone:"neutral",variant:"fill",disabled:false},p=tv({slots:{root:"flex flex-col rounded-lg border",headerIcon:"size-3.5 shrink-0",headerTitle:"min-w-0 flex-1 truncate text-sm font-medium",infoIcon:"size-3.5 shrink-0",headerInfo:"flex min-w-0 shrink items-center gap-1 overflow-hidden",headerInfoText:"text-2xs min-w-0 truncate text-neutral-800",description:"text-xs text-neutral-700",separator:"border-t first:border-t-0"},variants:{tone:{neutral:{headerIcon:"text-neutral-900",headerTitle:"text-neutral-900",infoIcon:"text-neutral-900"},primary:{headerIcon:"text-primary-700",headerTitle:"text-primary-700",infoIcon:"text-primary-700"}},variant:{outline:{},fill:{}},disabled:{true:{headerIcon:"text-neutral-600",headerTitle:"text-neutral-600",infoIcon:"text-neutral-600",headerInfoText:"text-neutral-600",description:"text-neutral-600"},false:{}}},compoundVariants:[{tone:"neutral",variant:"outline",class:{root:"border-neutral-400 bg-neutral-50",separator:"border-neutral-400"}},{tone:"neutral",variant:"fill",class:{root:"border-neutral-300 bg-neutral-100",separator:"border-neutral-300"}},{tone:"primary",variant:"outline",class:{root:"border-primary-600 bg-neutral-50",separator:"border-primary-600"}},{tone:"primary",variant:"fill",class:{root:"bg-primary-50 border-primary-400",separator:"border-primary-400"}},{disabled:true,variant:"outline",class:{root:"border-neutral-400",separator:"border-neutral-400"}},{disabled:true,variant:"fill",class:{root:"border-neutral-300 bg-neutral-100",separator:"border-neutral-300"}}],defaultVariants:c}),k=createContext(c),C=()=>useContext(k),O=({src:e,alt:n})=>{let[r,a]=useState(false);return !e||r?jsx("div",{className:"flex size-4 shrink-0 items-center justify-center rounded-sm bg-neutral-200",children:jsx(ImageIcon,{className:"size-3 text-neutral-400","aria-hidden":true})}):jsx("img",{src:e,alt:n??"",onError:()=>a(true),className:"size-4 shrink-0 rounded-sm object-cover"})},_=(e,n,r)=>{switch(e.type){case "icon":{let a=e.Icon;return jsx(a,{className:n,"aria-hidden":true})}case "checkbox":return jsx(c$1,{checked:e.checked,defaultChecked:e.defaultChecked,onCheckedChange:e.onCheckedChange,disabled:r||e.disabled});case "switch":return jsx(d,{checked:e.checked,defaultChecked:e.defaultChecked,onCheckedChange:e.onCheckedChange,disabled:r||e.disabled,size:"sm",variant:"primary",type:"base"});case "image":return jsx(O,{src:e.src,alt:e.alt});default:return e}},g=({title:e$3,leading:n,description:r,info:a$2,actions:o,className:s,...i})=>{let{tone:u,variant:m,disabled:b}=C(),{headerIcon:P,headerTitle:E,infoIcon:L,headerInfo:S,headerInfoText:H,description:w}=p({tone:u,variant:m,disabled:b});return jsxs("div",{className:a("flex flex-col gap-1 px-3 py-2",s),...i,children:[jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[n&&_(n,P(),b),jsx("div",{className:E(),children:e$3}),typeof a$2=="string"||typeof a$2=="number"?String(a$2).trim()!==""&&jsxs("div",{className:S(),children:[jsx(e,{className:L(),"aria-hidden":true}),jsx("span",{className:H(),children:a$2})]}):a$2]}),o&&jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[o.badgeExpandable&&jsx(a$1,{...o.badgeExpandable}),o.iconButtons?.map((z,F)=>jsx(e$1,{variant:"ghost",tone:"neutral",size:"sm",...z},F)),o.button&&jsx(e$2,{...o.button,size:"sm"})]})]}),r&&jsx("div",{className:w(),children:r})]})};g.displayName="CardBasicHeader";var I=({children:e,className:n,...r})=>{let{tone:a$1,variant:o,disabled:s}=C(),{separator:i}=p({tone:a$1,variant:o,disabled:s});return jsx("div",{className:a("flex flex-col gap-4 px-3 py-4.5",i(),n),...r,children:e})};I.displayName="CardBasicBody";var T=({children:e,className:n,...r})=>{let{tone:a$1,variant:o,disabled:s}=C(),{separator:i}=p({tone:a$1,variant:o,disabled:s});return jsx("div",{className:a("px-3 py-4.5",i(),n),...r,children:e})};T.displayName="CardBasicFooter";var N=({as:e,children:n,className:r,tone:a=c.tone,variant:o=c.variant,disabled:s=c.disabled,...i})=>{let u=e??"div",{root:m}=p({tone:a,variant:o,disabled:s});return jsx(k.Provider,{value:{tone:a,variant:o,disabled:s},children:jsx(u,{className:m({className:r}),...i,children:n})})};N.displayName="CardBasic";var de=Object.assign(N,{Header:g,Body:I,Footer:T});export{g as a,I as b,T as c,de as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-LUQQ6CGZ.js';import {g}from'./chunk-Q4CWL65C.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 +1 @@
|
|
|
1
|
-
import {d}from'./chunk-3HZUH4JJ.js';import {e as e$1}from'./chunk-PI7DECIN.js';import {i,h as h$1}from'./chunk-Q4CWL65C.js';import {e}from'./chunk-
|
|
1
|
+
import {d}from'./chunk-3HZUH4JJ.js';import {e as e$1}from'./chunk-PI7DECIN.js';import {i,h as h$1}from'./chunk-Q4CWL65C.js';import {e}from'./chunk-RVEUW4QG.js';import {a}from'./chunk-OBZIYJO7.js';import*as r from'react';import {Pagination}from'@ark-ui/react/pagination';import {getDefaultOptions}from'date-fns';import {jsx,jsxs}from'react/jsx-runtime';var H={es:{paginationSummary:(a,e,n)=>`${a}-${e} de ${n}`,rowsPerPage:"Filas por p\xE1gina"},pt:{paginationSummary:(a,e,n)=>`${a}-${e} de ${n}`,rowsPerPage:"Linhas por p\xE1gina"}},h={paginationSummary:(a,e,n)=>`${a}-${e} of ${n}`,rowsPerPage:"Rows per page"},L=a=>{let e=a?.slice(0,2);return e&&H[e]||h},S=r.forwardRef(({className:a$1,...e},n)=>jsx("div",{ref:n,className:a("ring-primary-200 flex flex-col overflow-hidden rounded-lg bg-neutral-50 ring-1",a$1),...e}));S.displayName="TableContainer";var M=r.forwardRef(({className:a$1,...e},n)=>jsx("div",{className:a("relative w-full overflow-x-auto",a$1),children:jsx("table",{ref:n,className:"w-full table-auto overflow-hidden text-neutral-900",...e})}));M.displayName="Table";var E=r.forwardRef(({className:a,...e},n)=>jsx("thead",{ref:n,className:a,...e}));E.displayName="TableHeader";var z=r.forwardRef(({className:a,...e},n)=>jsx("tbody",{ref:n,className:a,...e}));z.displayName="TableBody";var A=r.forwardRef(({className:a$1,...e},n)=>jsx("tr",{ref:n,className:a("text-sm leading-[130%] font-normal",a$1),...e}));A.displayName="TableBodyRow";var I=r.forwardRef(({Icon:a$1,icon:e$1,title:n,description:l,className:i,button:m,...b},T)=>jsxs("div",{ref:T,...b,className:a("flex flex-col items-center justify-center py-10 text-neutral-500",i),children:[e$1&&r.cloneElement(e$1,{className:"text-neutral-300 w-6 h-6"}),a$1&&jsx(a$1,{className:"h-6 w-6 text-neutral-300"}),jsx("span",{className:"mt-2 text-sm leading-[130%] font-semibold",children:n}),l&&jsx("span",{className:"mt-0.5 text-sm leading-[130%]",children:l}),m&&jsx(e,{size:"sm",...m,className:a("mt-3",m.className)})]}));I.displayName="TableNoResults";var $=r.forwardRef(({className:a$1,...e},n)=>jsx("tr",{ref:n,className:a("bg-primary-100",a$1),...e}));$.displayName="TableHeaderRow";var k=r.forwardRef(({className:a$1,...e},n)=>jsx("th",{ref:n,className:a("font-inter h-10 px-3 py-1.5 text-left text-xs leading-[133%] text-neutral-900 uppercase",a$1),...e}));k.displayName="TableHead";var B=r.forwardRef(({className:a$1,...e},n)=>jsx("td",{ref:n,className:a("h-22 px-4 py-3.5 wrap-break-word",a$1),...e}));B.displayName="TableCell";var y=({pageSize:a,rowsPerPageOptions:e,onPageSizeChange:n,label:l})=>jsxs("div",{className:"flex items-center justify-end",children:[jsx("select",{className:"mr-4 text-sm leading-[130%]",value:a,id:"rows_per_page",onChange:i=>{n?.(Number(i.target.value));},children:e.map(i=>jsx("option",{children:i},i))}),jsx("span",{className:"mr-2 text-sm leading-[130%] text-neutral-700",children:l})]}),J=({isDisableNextPageButton:a,isDisablePreviousPageButton:e,onNextPageClick:n,onPreviousPageClick:l,pagination:i$1,rowsCount:m,onPageSizeChange:b,onPageChange:T,rowsPerPageOptions:N=[10,20,50]})=>{let{locale:x}=getDefaultOptions(),f=L(x?.code);return m==null?jsxs("div",{className:"border-t-primary-200 grid min-h-12 flex-1 grid-cols-3 items-center justify-between gap-6 border-t px-4.5",children:[jsx("div",{}),jsxs("div",{className:"flex items-center justify-center gap-2",children:[jsx(e$1,{Icon:i,size:"md",variant:"ghost",onClick:l,disabled:e}),jsx(e$1,{Icon:h$1,size:"md",variant:"ghost",onClick:n,disabled:a})]}),jsx(y,{pageSize:i$1.pageSize,rowsPerPageOptions:N,onPageSizeChange:b,label:f.rowsPerPage})]}):jsx(Pagination.Root,{count:m,page:i$1.pageIndex+1,pageSize:i$1.pageSize,siblingCount:2,onPageSizeChange:s=>{b?.(s.pageSize);},onPageChange:s=>{T?.(s.page);},children:jsx(Pagination.Context,{children:s=>jsxs("div",{className:"border-t-primary-200 grid min-h-12 flex-1 grid-cols-3 items-center justify-between gap-6 border-t px-4.5",children:[jsx("span",{className:"text-sm leading-[130%] font-normal text-neutral-700",children:f.paginationSummary(s.pageRange.start+1,s.pageRange.end,s.count)}),jsxs("div",{className:"flex items-center justify-center gap-2",children:[jsx(Pagination.PrevTrigger,{asChild:true,onClick:l,disabled:e,children:jsx(e$1,{Icon:i,size:"md",variant:"ghost"})}),s.pages.map((c,u)=>c.type==="page"?jsx(Pagination.Item,{...c,asChild:true,children:jsx(d,{variant:"standard",type:"ghost",size:"xs",selected:s.page===c.value,className:"cursor-pointer",children:c.value})},u):jsx(Pagination.Ellipsis,{index:u,children:"\u2026"},u)),jsx(Pagination.NextTrigger,{asChild:true,onClick:n,disabled:a,children:jsx(e$1,{Icon:h$1,size:"md",variant:"ghost"})})]}),jsx(y,{pageSize:i$1.pageSize,rowsPerPageOptions:N,onPageSizeChange:c=>{s.setPageSize(c);},label:f.rowsPerPage})]})})})};export{S as a,M as b,E as c,z as d,A as e,I as f,$ as g,k as h,B as i,J as j};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b as b$1}from'./chunk-
|
|
1
|
+
import {b as b$1}from'./chunk-NETNR3VC.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:i=true,positioning:a=b,onSelect:o,...s})=>jsx(MenuRoot,{lazyMount:n,unmountOnExit:i,positioning:a,...s,onSelect:o?r=>o(r.value):void 0}),k=MenuTrigger,v=MenuItem,L=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:i,...a$1},o)=>jsx(Portal,{children:jsx(MenuPositioner,{children:jsx(MenuContent,{ref:o,className:a(L,n),...a$1,children:i})})}));g.displayName="MenuContent";var x="data-highlighted:bg-primary-100 outline-none [&_p]:break-normal",h=({value:n,label:i,description:a,startIcon:o,endIcon:s,hasDivider:r,disabled:p,onSelect:l})=>jsxs(Fragment,{children:[jsx(MenuItem,{value:n,disabled:p,onSelect:l?()=>l(n):void 0,asChild:true,children:jsxs(b$1.Root,{disabled:p,className:x,children:[o&&jsx(b$1.Leading,{children:jsx(b$1.Icon,{children:o})}),jsxs(b$1.Content,{children:[jsx(b$1.Headline,{children:i}),a&&jsx(b$1.Description,{children:a})]}),s&&jsx(b$1.Trailing,{children:jsx(b$1.Icon,{children:s})})]})}),r&&jsx(a$1,{})]}),z={Root:A,Trigger:k,Content:g,Item:v,Option:h};export{z as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c as c$2,j}from'./chunk-3X2MEX7P.js';import {a as a$9,b as b$3,c as c$4}from'./chunk-GTVHYHF4.js';import {a as a$b}from'./chunk-GFVJRSZI.js';import {a as a$4}from'./chunk-CA5XNVS5.js';import {b as b$2}from'./chunk-ZE64BJO4.js';import {c as c$6}from'./chunk-JYNJHAGL.js';import {b}from'./chunk-SGQFEQJJ.js';import {c as c$5}from'./chunk-E3WJNVAZ.js';import {a as a$a}from'./chunk-OB7PQC3A.js';import {a as a$6,b as b$1,c as c$3,d as d$2}from'./chunk-U4NJK7JM.js';import {d as d$4}from'./chunk-MP4CHZ2K.js';import {a as a$3}from'./chunk-R6NIURLZ.js';import {e as e$1}from'./chunk-PI7DECIN.js';import {d as d$1}from'./chunk-HPIKGJQV.js';import {a}from'./chunk-FHABUQAH.js';import {a as a$5}from'./chunk-ZMMNEYEQ.js';import {d,c as c$1}from'./chunk-QJOYOR4B.js';import {a as a$8}from'./chunk-VIMWKUML.js';import {a as a$7}from'./chunk-6MK7NLF5.js';import {a as a$1}from'./chunk-AWRP67K4.js';import {c,d as d$3,q,k as k$1,h}from'./chunk-Q4CWL65C.js';import {e}from'./chunk-DUBQPI4Q.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 En from'react-phone-number-input/flags';import {getDefaultOptions}from'date-fns';import wn from'react-phone-number-input/locale/en.json';import Hn from'react-phone-number-input/locale/es.json';import Sn 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 Fl,{parsePhoneNumber,getCountryCallingCode}from'react-phone-number-input';import {getExampleNumber}from'libphonenumber-js/mobile';import Cl from'libphonenumber-js/mobile/examples';var Wo=k__default.memo(({handleSelect:e$1,NoResultsIcon:o,noResultsLabel:t,noResultsDescription:n,noResultsDescriptionLines:r,noResultsAsColumn:l,noResultsButtonOnClick:i,optionDescriptionLines:p,noResultsButtonLabel:c,filteredOptions:m,inputRect:u,inputRef:b$1,popoverPosition:g,optionsListRef:d,selectedOption:C,options:R,setFilteredOptions:y})=>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:u?{width:`${u.width}px`,left:u.left,top:g==="bottom"?`${u.bottom}px`:void 0,bottom:g==="top"?`${window.innerHeight-u.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",b$1.current.value="",y(R),i();},children:c})]})]}),m.map(v=>jsx(b.Root,{disabled:v.disabled,selected:C?.value===v.value,onClick:()=>e$1(v),children:jsxs(b.Content,{children:[jsx(b.Headline,{children:v.label}),v.description&&jsx(b.Description,{className:a$2({"line-clamp-1":p===1,"line-clamp-2":p===2,"line-clamp-3":p===3,"line-clamp-4":p===4}),children:v.description})]})},v.key??v.value))]})})),Ut=Wo;var Ko=336,ei=({options:e,defaultSelectedOption:o,onSelect:t,onClick:n,onInputChange:r,error:l,helperText:i,label:p,placeholder:c,value:m,size:u="md",optionDescriptionLines:b=1,noResultsLabel:g,noResultsIcon:d,noResultsDescription:C,noResultsDescriptionLines:R,noResultsAsColumn:y,noResultsButtonOnClick:v,noResultsButtonLabel:A,className:L,disabled:T})=>{let[h,P]=useState(o??null),E=useRef(null),x=useRef(null),[M,w]=useState(),[U,H]=useState([]),[s,a]=useState("bottom"),[N,D]=useState(),S=Ko,j=useCallback(_=>{E.current.style.display="none",x.current.value=_.label,P(_),t?.(_);},[t]),V=useCallback(()=>{if(!x?.current)return;let _=x.current.getBoundingClientRect();w(_);let Y=N?N.height:S,Q=window.innerHeight-_.bottom>Y,Me=_.top>Y;a(Q?"bottom":Me?"top":"bottom");},[N?.height]),ye=useCallback(()=>{let _=e.filter(Y=>Y.label.toLowerCase().includes(x?.current?.value.toLowerCase()??""));if(H(_),E?.current){let Y=E.current.getBoundingClientRect();D(Y);}},[e]);return useEffect(()=>{H(e);},[e]),useEffect(()=>{if(!m){P(null),x.current&&(x.current.value="");return}(!x.current?.value||h?.value!==m.value)&&(P(m),x.current.value=m.label);},[m]),a$b(E,()=>{E.current.style.display="none",h&&x.current&&(x.current.value=h.label);}),useEffect(()=>{if(x?.current)return V(),x.current.addEventListener("mousedown",V),x.current.addEventListener("input",ye),window.addEventListener("scroll",V,true),window.addEventListener("resize",V),()=>{x.current?.removeEventListener("mousedown",V),x.current?.removeEventListener("input",ye),window.removeEventListener("scroll",V,true),window.removeEventListener("resize",V);}},[V,ye]),jsxs("div",{className:a$2("relative",L),children:[jsx(a$4,{ref:x,autoComplete:"off",list:"",selectMode:true,onChange:_=>{_.target.value||(P(null),t?.(null)),r?.(_);},onClean:()=>{P(null),H(e),t?.(null);},onClick:_=>{E.current.style.display="flex",n?.(_);},onBlur:()=>{h&&x.current&&(x.current.value=h.label);},label:p,helperText:i,placeholder:c,size:u,error:l,disabled:T}),jsx(Ut,{handleSelect:j,noResultsLabel:g,NoResultsIcon:d,optionDescriptionLines:b,noResultsAsColumn:y,noResultsButtonLabel:A,noResultsButtonOnClick:v,noResultsDescription:C,noResultsDescriptionLines:R,filteredOptions:U,inputRect:M,inputRef:x,popoverPosition:s,optionsListRef:E,selectedOption:h,options:e,setFilteredOptions:H})]})};var jo=({children:e,title:o,titleLines:t,description:n="",descriptionLines:r,disabled:l=false,className:i,...p})=>jsxs("div",{className:a$2("flex w-full flex-col gap-1",i),...p,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})]}),ie=jo;var mi=({children:e,title:o,titleLines:t,description:n="",descriptionLines:r,startIcon:l,badgeContent:i,hasDivider:p=false,disabled:c=false,onSelect:m,className:u,...b})=>jsxs(J,{hasDescription:!!n,disabled:c,onClick:m,hasDivider:p,className:a$2(!c&&"cursor-pointer",u),...b,children:[l&&k__default.cloneElement(l,{className:"shrink-0 mr-2 h-4.5 w-4.5"}),jsx(ie,{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,{className:"h-4.5 w-4.5 self-center"})]})]});var yi=({children:e,title:o,titleLines:t=1,description:n="",descriptionLines:r,startIcon:l,hasDivider:i=false,disabled:p=false,checked:c,onCheckedChange:m,className:u,...b})=>jsxs(J,{hasDescription:!!n,disabled:p,hasDivider:i,...b,className:a$2("pr-6",u),children:[l&&k__default.cloneElement(l,{className:"shrink-0 w-4.5 h-4.5 mr-2"}),jsx(ie,{title:o,titleLines:t,description:n,descriptionLines:r,disabled:p}),jsx(c$5,{checked:c,onCheckedChange:m,className:"ml-4 self-center",disabled:p})]});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,p]=useState(true),[c,m]=useState([]),[u,b]=useState(-1),[g,d]=useState("bottom"),[C,R]=useState(),[y,v]=useState(oe);return jsx(jt.Provider,{value:{optionsListRef:o,inputRef:t,autocompleteId:n,inputRect:r,showChips:i,filteredOptions:c,currentFocus:u,popoverPosition:g,setFilteredOptions:m,setCurrentFocus:b,setShowChips:p,setPopoverPosition:d,setInputRect:l,optionsListHeight:y,optionsListRect:C,setOptionsListRect:R,setOptionsListHeight:v},children:e})};var sn=({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=sn;var un=150,mn=k__default.memo(({selectedOptions:e,error:o,onCleanSelectedOptions:t,disabled:n,size:r})=>{let{autocompleteId:l,inputRect:i,inputRef:p,optionsListRef:c$1}=ee(),m=k__default.useRef(null),[u,b]=k__default.useState(new Map),g=useMemo(()=>{if(!i?.width)return [];let C=0,R=i.width-un,y=0;for(let v=0;v<e.length&&(y+=u.get(v)??0,!(y>R));v++)C++;return e.slice(0,C)},[i?.width,e,u]),d=useCallback(()=>{n||(p?.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:g.map((C,R)=>jsx(Xt,{option:C,onMountWidth:y=>b(v=>new Map(v).set(R,y))},`chip-input-${l}-${C.value}`))}),e.length>g.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=mn;var hn=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:p=>{e.disabled||(i?.current?.value&&p.preventDefault(),t?.(e,p));},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})})]})}),rt=hn;var xn=k__default.memo(({selectedOptions:e$1,handleSelect:o,NoResultsIcon:t,noResultsLabel:n,noResultsDescription:r,noResultsDescriptionLines:l,noResultsAsColumn:i,noResultsButtonOnClick:p,optionDescriptionLines:c,noResultsButtonLabel:m})=>{let{popoverPosition:u,optionsListRef:b,filteredOptions:g,inputRect:d,autocompleteId:C,inputRef:R,optionsListHeight:y}=ee(),v=useCallback(L=>e$1.some(T=>T.value===L.value),[e$1]),A=useMemo(()=>e$1.filter(L=>L.label.toLowerCase().includes(R?.current?.value.toLowerCase()??"")),[e$1,R?.current?.value]);return jsx(Vt.Root,{asChild:true,children:jsxs("div",{ref:b,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:u==="bottom"?`${d.bottom}px`:void 0,bottom:u==="top"?`${window.innerHeight-d.top}px`:void 0,maxHeight:y+"px"}:void 0,children:[g.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}),p&&jsxs(Fragment,{children:[jsx(a$1,{}),jsx(e,{variant:"ghost",className:"my-3 w-fit self-center",onClick:()=>{b.current.style.display="none",R.current.value="",p();},children:m})]})]}),A.map((L,T)=>jsx(rt,{option:L,index:T,onPressOption:h=>o(h),isSelected:v(L),optionDescriptionLines:c},`autocomplete-option-${C}-${L.key??L.value}`)),g.map((L,T)=>!e$1.some(h=>h.value===L.value)&&jsx(rt,{option:L,index:T,onPressOption:h=>o(h),isSelected:v(L),optionDescriptionLines:c},`autocomplete-option-${C}-${L.key??L.value}`))]})})}),to=xn;var In=k__default.memo(({selectedOptions:e,onSelect:o,error:t,helperText:n,label:r,placeholder:l,options:i,onInputChange:p,size:c,disabled:m})=>{let{setCurrentFocus:u,setFilteredOptions:b,optionsListRef:g,inputRef:d}=ee();return jsx(a$4,{ref:d,autoComplete:"off",list:"",disabled:m,selectMode:true,onChange:C=>{u(-1),p?.(C.target.value);},onClean:()=>{u(-1),b(i),o?.(null,e);},onClick:()=>{m||(g.current.style.display="flex");},error:t,helperText:n,label:r,placeholder:l,fixedTopLabel:e.length>0,size:c})}),oo=In;var no=({options:e,defaultSelectedOptions:o,onSelect:t,error:n,helperText:r,label:l,placeholder:i,noResultsLabel:p,noResultsIcon:c,noResultsDescription:m,noResultsDescriptionLines:u,noResultsAsColumn:b,noResultsButtonOnClick:g,noResultsButtonLabel:d,className:C,onInputChange:R,value:y,loading:v,size:A="md",optionDescriptionLines:L=1,disabled:T})=>{let{inputRef:h,optionsListRef:P,setFilteredOptions:E,setShowChips:x,setInputRect:M,setPopoverPosition:w,setCurrentFocus:U,showChips:H,setOptionsListRect:s,optionsListRect:a,setOptionsListHeight:N}=ee(),D=useRef(false),[S,j]=useState(o??[]),V=useCallback(W=>{j(X=>{let le,Ie=X.findIndex($o=>$o.value===W.value);return Ie===-1?(le=X.concat(W),t?.(W,le),le):(le=X.toSpliced(Ie,1),t?.(W,le),le)});},[t]),ye=useCallback(()=>{j([]),E(e),t?.(null,[]);},[]),_=useCallback(()=>{x(false);},[]),Y=useCallback(()=>{x(true);},[]),Q=useCallback(()=>{if(!h?.current)return;let W=h.current.getBoundingClientRect();M(W);let X=a?a.height>oe?oe:a.height:oe,le=window.innerHeight-W.bottom>X,Ie=W.top>X;w(le?"bottom":Ie?"top":"bottom"),N(Ie?oe:window.innerHeight-W.bottom>oe?oe:window.innerHeight-W.bottom);},[a?.height]),Me=useCallback(()=>{let W=e.filter(X=>X.label.toLowerCase().includes(h?.current?.value.toLowerCase()??""));if(E(W),P?.current){let X=P.current.getBoundingClientRect();s(X);}},[e,P?.current]);return useEffect(()=>{E(e);},[e]),a$b(P,()=>{P.current.style.display="none",U(-1);}),useEffect(()=>{if(h?.current)return Q(),h.current.addEventListener("mousedown",Q),h.current.addEventListener("input",Me),h.current.addEventListener("focusin",_),h.current.addEventListener("focusout",Y),window.addEventListener("scroll",Q,true),window.addEventListener("resize",Q),()=>{h.current?.removeEventListener("mousedown",Q),h.current?.removeEventListener("input",Q),h.current?.removeEventListener("focusout",Y),h.current?.removeEventListener("focusin",_),window.removeEventListener("scroll",Q,true),window.removeEventListener("resize",Q);}},[Q,Y,_,Me]),useEffect(()=>{y&&(j(y),x(true));},[y]),useEffect(()=>{v||o&&o.length&&!D.current&&(j(o),D.current=true,x(true));},[o,v]),jsxs("div",{className:a$2("relative",C),children:[jsx(oo,{selectedOptions:S,onSelect:t,error:n,helperText:r,label:l,placeholder:i,handleSelect:V,options:e,onInputChange:R,size:A,disabled:T}),H&&jsx(Zt,{selectedOptions:S,disabled:T,error:n,onCleanSelectedOptions:ye,size:A}),jsx(to,{handleSelect:V,selectedOptions:S,noResultsLabel:p,NoResultsIcon:c,optionDescriptionLines:L,noResultsAsColumn:b,noResultsButtonLabel:d,noResultsButtonOnClick:g,noResultsDescription:m,noResultsDescriptionLines:u})]})};var As=e=>jsx(Yt,{children:jsx(no,{...e})});var je=({children:e,className:o,disabled:t,error:n,helperText:r,htmlFor:l,label:i,readOnly:p,required:c,tooltip:m})=>{let{root:u}=c$1({error:n,disabled:t,readOnly:p});return jsxs("div",{className:u({className:o}),"data-error":n||void 0,"data-disabled":t||void 0,"data-readonly":p||void 0,children:[i&&jsx(a$7,{as:"label",htmlFor:l,label:i,required:c,tooltip:m}),e,jsx(a$8,{children:r})]})};var st=({className:e,country:o,countryName:t})=>{let n=En[o];return jsx("span",{className:a$2("flex size-4.5 shrink-0 items-center justify-center overflow-hidden rounded-full border border-white [&_svg:not([class*='size-'])]:h-full [&_svg:not([class*='size-'])]:w-auto [&_svg:not([class*='size-'])]:max-w-none [&_svg:not([class*='size-'])]:shrink-0",e),children:n&&jsx(n,{title:t})})};var Fn=({code:e,codeClassName:o,label:t})=>jsxs("div",{className:"flex justify-center gap-2",children:[jsx(st,{country:e,countryName:t}),jsx("span",{className:a$2("text-sm leading-[143%] font-medium text-neutral-800",o),children:e})]}),so=({className:e,disabled:o,error:t,onChange:n,onOpenChange:r,options:l,readOnly:i,translations:p,value:c})=>{let m=k.useRef(null),[u,b]=k.useState(""),[g,d]=k.useState(false),{wrapper:C,input:R,clearIcon:y,searchIcon:v}=b$2({size:"md"}),{contains:A}=useFilter({sensitivity:"base"}),L=k.useMemo(()=>l.map(s=>({...s,key:s.code})),[l]),T=k.useMemo(()=>L.find(s=>s.key===c),[L,c]),{collection:h,filter:P,set:E}=useListCollection({initialItems:L,itemToString:s=>`${s.label} ${s.code}`,itemToValue:s=>s.key,filter:(s,a,N)=>A(s,a)||A(N.code,a.toUpperCase())});k.useEffect(()=>{E(L);},[L,E]);let x=k.useCallback(s=>{d(s),r?.(s);},[r]),M=k.useCallback(({inputValue:s})=>{let a=s??"";b(a),P(a),m.current?.scrollTo({top:0});},[P]),w=k.useCallback(s=>{x(s),s&&(b(""),P(""));},[P,x]),U=k.useCallback(({itemValue:s})=>{if(!s)return;let a=L.find(N=>N.key===s)?.code;a&&(n(a),x(false));},[L,x,n]),H=useCombobox({collection:h,inputBehavior:"autohighlight",inputValue:u,open:g,openOnChange:false,openOnClick:false,selectionBehavior:"preserve",value:T?[T.key]:[],onInputValueChange:M,onOpenChange:({open:s})=>{s||x(false);},onSelect:U});return jsx(Combobox.RootProvider,{value:H,children:jsxs(a$9,{open:g,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&&g&&"after:bg-input-ring-focus after:w-0.5",e),disabled:o||i,children:T&&jsx(Fn,{code:T.code,label:T.label,codeClassName:a$2(t?"text-danger-600":void 0,o&&"text-input-text-disabled",i&&"text-input-text-disabled")})})}),jsx(c$4,{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:p.searchCountryPlaceholder,className:R()}),!o&&u.length>0&&jsx("button",{type:"button",className:y(),onClick:()=>{H.setInputValue("","clear-trigger");},children:jsx(d$3,{className:"size-4.5"})}),jsx(q,{className:v()})]}),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(st,{country:s.code,countryName:s.label}),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:p,...c},m)=>{let u=k.useRef(null),b=`${p??""}`.length>0,g=!t&&!l&&b,d$1=g||n;k.useImperativeHandle(m,()=>u.current,[]);let C=k.useCallback(y=>{r?.(y.target.value);},[r]),R=k.useCallback(()=>{r?.(""),u.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",g&&n&&"pr-14",n&&!g&&"pr-10.5",t&&"text-input-text-disabled",e),...c,disabled:t,readOnly:l,value:p,onChange:C,ref:u}),(g||n)&&jsxs("div",{className:"absolute inset-y-0 right-3 z-10 flex items-center gap-1",children:[g&&jsx(a$5,{ariaLabel:o,onClick:R}),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"},co={en:wn,es:Hn,pt:Sn},_n=pt.en,Dn=co.en,Bn={es:{clearIdLabel:pt.es,searchCountryPlaceholder:"Buscar..."},pt:{clearIdLabel:pt.pt,searchCountryPlaceholder:"Pesquisar..."}},zn={clearIdLabel:_n,searchCountryPlaceholder:"Search..."},po=()=>getDefaultOptions().locale?.code,uo=e=>Bn[e]??zn,Vn=(e,o)=>(co[o]??Dn)[e]??e,mo=({localeCode:e})=>c$2.map(o=>({code:o,label:Vn(o,e)})).sort((o,t)=>o.label.localeCompare(t.label)),fo=a$6,ho=b$1,go=(e,o)=>{let t=o.trim();return !t||!c$3(e,t).isValid?t:d$2(e,t)};var bo=()=>{},Co=k.forwardRef(({autoComplete:e,className:o,country:t,disabled:n,error:r,helperText:l,id:i,label:p,name:c,onBlur:m,onChange:u=bo,onCountryChange:b=bo,placeholder:g,readOnly:d,required:C,tooltip:R,value:y},v)=>{let[A,L]=k.useState(false),[T,h]=k.useState(y??""),P=k.useId(),E=i??P,x=po(),M=k.useRef(y??"");k.useEffect(()=>{(y??"")!==M.current&&h(y??"");},[y]);let w=k.useMemo(()=>uo(x),[x]),U=k.useMemo(()=>mo({localeCode:x}),[x]),H=k.useMemo(()=>ho(t??"")||g||fo,[t,g]),s=c$1({error:r,disabled:n,readOnly:d}),a=k.useCallback((S,j)=>{let V=go(S,j);M.current=V,u(V);},[u]),N=k.useCallback(S=>{h(S),a(t??"",S);},[t,a]),D=k.useCallback(S=>{b(S),a(S,T);},[T,b,a]);return jsx(je,{disabled:n,error:r,helperText:l,htmlFor:E,label:p,readOnly:d,required:C,tooltip:R,children:jsxs("div",{className:a$2(s.control(),"group/id-field",!r&&!n&&!d&&A&&"after:ring-input-ring-focus after:ring-2",o),children:[jsx(so,{disabled:n,error:r,onChange:D,onOpenChange:L,options:U,readOnly:d,translations:w,value:t}),jsx(ct,{autoComplete:e,clearLabel:w.clearIdLabel,disabled:n,error:r,id:E,name:c,onBlur:m,onChange:N,placeholder:H,readOnly:d,required:C,value:T,ref:v})]})})});Co.displayName="IdField";var Ta=({children:e$2,title:o,titleLines:t=1,description:n,descriptionLines:r=1,StartIcon:l,hasDivider:i=false,disabled:p=false,actionButton:c,isSelected:m=false,className:u,...b})=>jsxs(J,{hasDescription:!!n,disabled:p,hasDivider:i,isSelected:m,...b,className:u,children:[l&&jsx(l,{className:"mr-2 h-4.5 w-4.5 shrink-0 grow-0"}),jsx(ie,{title:o,titleLines:t,description:n,descriptionLines:r,disabled:p}),c&&jsx(Fragment,{children:c.isIcon?jsx(e$1,{...c,className:"ml-4 self-center",variant:"ghost",size:"sm",disabled:p??c.disabled}):jsx(e,{...c,className:"ml-4 self-center",size:"sm",variant:"ghost",disabled:p??c.disabled})})]});var _a=({title:e,description:o="",descriptionLines:t,hasDivider:n=false,disabled:r=false,checked:l,onCheckedChange:i,className:p,chipStatus:c,chipExpandable:m,...u})=>jsxs(J,{hasDescription:!!o,disabled:r,hasDivider:n,...u,className:a$2("pr-6",p),children:[jsx(c$5,{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$6,{...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 gt=({editorRef:e})=>{let[o]=useLexicalComposerContext();return useEffect(()=>(e.current=o,()=>{e.current===o&&(e.current=null);}),[o,e]),null};var jn={"ql-align-left":"left","ql-align-center":"center","ql-align-right":"right","ql-align-justify":"justify"},Yn={center:"ql-align-center",right:"ql-align-right",justify:"ql-align-justify"},Xn=()=>typeof window<"u"&&typeof window.DOMParser<"u",xo=e=>Xn()?new DOMParser().parseFromString(e,"text/html"):null,Zn=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=jn[n];r&&(r!=="left"&&(t.style.textAlign=r),t.classList.remove(n));}},er=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`);}},tr=(e,o)=>{let t=e.getAttribute("data-list");return t==="bullet"?"ul":t==="ordered"?"ol":o},or=e=>{let o=e.cloneNode(true);return o.removeAttribute("data-list"),o.removeAttribute("data-checked"),o.removeAttribute("data-indent"),Ct(o),o},bt=(e,o)=>e.createElement(o),nr=(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),u=tr(c,i),b=or(c);for(;l.length>0&&l[l.length-1].level>m;)l.pop();if(l.length===0){let d=bt(o,u);r.push(d),l.push({level:0,kind:u,listElement:d});}let g=l[l.length-1];for(;g.level<m;){let d=g.listElement.lastElementChild;if(!d||d.tagName!=="LI")break;let C=bt(o,u);d.appendChild(C),g={level:g.level+1,kind:u,listElement:C},l.push(g);}if(g=l[l.length-1],g.kind!==u){let d=bt(o,u);if(l.length===1)r.push(d),l[0]={level:0,kind:u,listElement:d};else {let R=l[l.length-2].listElement.lastElementChild;R&&R.tagName==="LI"?(R.appendChild(d),l[l.length-1]={level:g.level,kind:u,listElement:d}):(r.push(d),l.length=1,l[0]={level:0,kind:u,listElement:d});}g=l[l.length-1];}g.listElement.appendChild(b);}if(r.length===0)return;let p=o.createDocumentFragment();for(let c of r)p.appendChild(c);e.replaceWith(p);},rr=(e,o)=>{let t=Array.from(e.querySelectorAll("ol, ul"));for(let n of t)nr(n,o);},Lo=(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)Lo(i,o+1);}},lr=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=Yn[r];l&&n.classList.add(l);}},be=e=>Zn(e).replace(/>\s+</g,"><").replace(/ /g," "),xt=e=>{let o=e??"";if(!o.trim())return "";let t=xo(o);if(!t)return o;let{body:n}=t;return Jn(n),er(n),rr(n,t),n.innerHTML},Lt=e=>{if(!e.trim())return "";let o=xo(e);if(!o)return e;let{body:t}=o,n=Array.from(t.querySelectorAll("ul, ol"));for(let r of n)Lo(r,0);return lr(t),t.innerHTML};var Ye=e=>{let o="";return e.getEditorState().read(()=>{o=$generateHtmlFromNodes(e,null);}),Lt(o)},dr=(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&&be(r)===be(n.current))return;let l=Ye(t);be(l)!==be(r)&&(o.current=true,dr(t,r),queueMicrotask(()=>{o.current=false;})),n.current=r;},[t,o,e]),null};var Io=["left","center","right","justify"];var vo=["bold","italic","underline","strikethrough","code"];var jr={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikethrough",code:"code"},Yr={left:jsx(AlignLeftIcon,{className:"size-4"}),center:jsx(AlignCenterIcon,{className:"size-4"}),right:jsx(AlignRightIcon,{className:"size-4"}),justify:jsx(AlignJustifyIcon,{className:"size-4"})},Xr={left:"Align left",center:"Align center",right:"Align right",justify:"Align justify"},Ne={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:"</>"})},Ee={bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",code:"Inline code"},Zr=e=>{let o=e.textFormat;return o===false?[]:Array.isArray(o)?vo.filter(t=>o.includes(t)):["bold","italic","underline"]},Jr=e=>{let o=e.alignment;return o===false?[]:Array.isArray(o)?Io.filter(t=>o.includes(t)):["left","center","right","justify"]},el=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()}))]},Ae=()=>jsx("div",{className:"mx-1 h-5 w-px bg-neutral-300"}),K=({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}),Rt=({config:e,className:o})=>{let[t]=useLexicalComposerContext(),n=useId(),[r,l]=useState(false),[i,p]=useState(false),[c,m]=useState(false),[u,b]=useState(false),[g,d]=useState(false),[C,R]=useState(false),[y,v]=useState(false),[A,L]=useState("paragraph"),[T,h]=useState("left"),P=useMemo(()=>Zr(e),[e]),E=useMemo(()=>Jr(e),[e]),x=useMemo(()=>el(e),[e]),M=useCallback(()=>{let s=$getSelection();if(!$isRangeSelection(s))return;m(s.hasFormat("bold")),b(s.hasFormat("italic")),d(s.hasFormat("underline")),R(s.hasFormat("strikethrough")),v(s.hasFormat("code"));let a=s.anchor.getNode(),N=a.getKey()==="root"?a:a.getTopLevelElementOrThrow();if($isListNode(N))L(N.getListType()==="number"?"ol":"ul");else {let S=$findMatchingParent(N,j=>$isListNode(j));$isListNode(S)?L(S.getListType()==="number"?"ol":"ul"):L($isHeadingNode(N)?N.getTag():N.getType());}let D=$isElementNode(N)?N.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=>(p(s),false),1)),[t,M]);let w=s=>{t.dispatchCommand(FORMAT_TEXT_COMMAND,jr[s]);},U=s=>{t.update(()=>{let a=$getSelection();if($isRangeSelection(a)){if(s==="paragraph"){$setBlocksType(a,()=>$createParagraphNode());return}$setBlocksType(a,()=>$createHeadingNode(s));}});},H=s=>{if(A===(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(K,{label:"Undo",onClick:()=>t.dispatchCommand(UNDO_COMMAND,void 0),disabled:!r,icon:jsx(UndoIcon,{className:"size-4"})}),jsx(K,{label:"Redo",onClick:()=>t.dispatchCommand(REDO_COMMAND,void 0),disabled:!i,icon:jsx(RedoIcon,{className:"size-4"})}),jsx(Ae,{})]}),x.length>0&&jsxs(Fragment,{children:[jsx("label",{className:"sr-only",htmlFor:n,children:"Text style"}),jsx("select",{id:n,value:A.startsWith("h")?A:"paragraph",onChange:s=>U(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:x.map(s=>jsx("option",{value:s.value,children:s.label},s.value))}),jsx(Ae,{})]}),P.length>0&&jsxs(Fragment,{children:[P.includes("bold")&&jsx(K,{label:Ee.bold,onClick:()=>w("bold"),icon:Ne.bold,active:c}),P.includes("italic")&&jsx(K,{label:Ee.italic,onClick:()=>w("italic"),icon:Ne.italic,active:u}),P.includes("underline")&&jsx(K,{label:Ee.underline,onClick:()=>w("underline"),icon:Ne.underline,active:g}),P.includes("strikethrough")&&jsx(K,{label:Ee.strikethrough,onClick:()=>w("strikethrough"),icon:Ne.strikethrough,active:C}),P.includes("code")&&jsx(K,{label:Ee.code,onClick:()=>w("code"),icon:Ne.code,active:y}),jsx(Ae,{})]}),e.lists!==false&&jsxs(Fragment,{children:[jsx(K,{label:"Bulleted list",onClick:()=>H("bullet"),icon:jsx(ListIcon,{className:"size-4"}),active:A==="ul"}),jsx(K,{label:"Numbered list",onClick:()=>H("number"),icon:jsx(ListOrderedIcon,{className:"size-4"}),active:A==="ol"}),jsx(Ae,{})]}),e.indent!==false&&jsxs(Fragment,{children:[jsx(K,{label:"Decrease indent",onClick:()=>t.dispatchCommand(OUTDENT_CONTENT_COMMAND,void 0),icon:jsx(IndentDecreaseIcon,{className:"size-4"})}),jsx(K,{label:"Increase indent",onClick:()=>t.dispatchCommand(INDENT_CONTENT_COMMAND,void 0),icon:jsx(IndentIncreaseIcon,{className:"size-4"})}),jsx(Ae,{})]}),E.length>0&&jsx(Fragment,{children:E.map(s=>jsx(K,{label:Xr[s],onClick:()=>t.dispatchCommand(FORMAT_ELEMENT_COMMAND,s),icon:Yr[s],active:T===s},s))})]})};var No=e=>{if(e!==void 0)return typeof e=="number"?`${e}px`:e},hl=forwardRef(({value:e,onChange:o,onBlur:t,onError:n,placeholder:r="Write your content...",readOnly:l=false,showToolbar:i=true,toolbarConfig:p=ft,className:c,editorClassName:m,toolbarClassName:u,autoFocus:b=false,minHeight:g=160,maxHeight:d,error:C=false,errorMessage:R,editorRef:y},v)=>{let A=useRef(false),L=useMemo(()=>({namespace:"SodtrackRichTextEditor",theme:dt,onError:(h,P)=>{if(n){n(h,P);return}console.error("RichTextEditor error",h);},nodes:[HeadingNode,ListNode,ListItemNode]}),[n]),T={minHeight:No(g),maxHeight:No(d),overflowY:d?"auto":void 0};return jsx(LexicalComposer,{initialConfig:L,children:jsxs("div",{className:"w-full",children:[jsxs("div",{ref:v,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(Rt,{config:p,className:u}),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:T,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:A}),b&&!l&&jsx(AutoFocusPlugin,{}),y&&jsx(gt,{editorRef:y}),jsx(OnChangePlugin,{ignoreSelectionChange:true,onChange:(h,P)=>{!o||A.current||o(Ye(P),h);}})]}),C&&R&&jsx("p",{className:"text-error-500 mt-1 text-xs leading-[133%]",children:R})]})})});hl.displayName="RichTextEditor";var Ao={en:wn,es:Hn,pt:Sn},vl={es:{clearPhoneNumberLabel:"Eliminar n\xFAmero de tel\xE9fono",searchCountryPlaceholder:"Buscar..."},pt:{clearPhoneNumberLabel:"Limpar n\xFAmero de telefone",searchCountryPlaceholder:"Pesquisar..."}},Rl={clearPhoneNumberLabel:"Clear phone number",searchCountryPlaceholder:"Search..."},Pl=Ao.en,Mo="9 1234 5678",Pt="ZZ",Oo=()=>{},Xe=e=>vl[e]??Rl,Fo=e=>Ao[e]??Pl,ko=e=>{if(e)try{let o=parsePhoneNumber(e)?.country;return !o||!j(o)?void 0:o}catch{return}},wo=e=>{if(e)return getExampleNumber(e,Cl)?.formatNational()},Ze=e=>e??Pt,Je=()=>getDefaultOptions().locale?.code;var Ml=({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}`})]}),Ho=({className:e,disabled:o,error:t,iconComponent:n,onChange:r,onOpenChange:l,options:i,readOnly:p,translations:c,value:m})=>{let u=k.useRef(null),[b,g]=k.useState(""),[d,C]=k.useState(false),{wrapper:R,input:y,clearIcon:v,searchIcon:A}=b$2({size:"md"}),{contains:L}=useFilter({sensitivity:"base"}),T=k.useMemo(()=>i.filter(a=>a.value!==void 0&&j(a.value)).map(a=>({callingCode:a.value?getCountryCallingCode(a.value):void 0,country:a.value,key:Ze(a.value),label:a.label})),[i]),h=k.useMemo(()=>T.find(a=>a.key===Ze(m)),[T,m]),{collection:P,filter:E,set:x}=useListCollection({initialItems:T,itemToString:a=>a.callingCode?`${a.label} +${a.callingCode}`:a.label,itemToValue:a=>a.key,filter:(a,N,D)=>{let S=N.trim().replace(/^\+/,"");return L(a,N)||(D.country?L(D.country,N.toUpperCase()):false)||(D.callingCode?L(D.callingCode,S)||L(`+${D.callingCode}`,N):false)}});k.useEffect(()=>{x(T);},[T,x]);let M=k.useCallback(a=>{C(a),l?.(a);},[l]),w=k.useCallback(({inputValue:a})=>{let N=a??"";g(N),E(N),u.current?.scrollTo({top:0});},[E]),U=k.useCallback(a=>{M(a),a&&(g(""),E(""));},[E,M]),H=k.useCallback(({itemValue:a})=>{if(!a||a===Pt){r(void 0),M(false);return}j(a)&&(r(a),M(false));},[M,r]),s=useCombobox({collection:P,inputBehavior:"autohighlight",inputValue:b,open:d,openOnChange:false,openOnClick:false,selectionBehavior:"preserve",value:h?[h.key]:[],onInputValueChange:w,onOpenChange:({open:a})=>{a||M(false);},onSelect:H});return jsx(Combobox.RootProvider,{value:s,children:jsxs(a$9,{open:d,onOpenChange:U,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||p?"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||p,children:h&&jsx(Ml,{Icon:n,callingCode:h.callingCode,country:h.country,countryName:h.label,callingCodeClassName:a$2(t?"text-danger-600":void 0,o&&"text-input-text-disabled",p&&"text-input-text-disabled")})})}),jsx(c$4,{portalled:false,className:"w-75 p-0",children:jsxs(Combobox.Content,{children:[jsxs(Combobox.Control,{className:"pb-0",children:[jsxs("div",{className:R({className:"m-1 mb-0"}),children:[jsx(Combobox.Input,{autoComplete:"off","data-1p-ignore":true,"data-lpignore":"true",placeholder:c.searchCountryPlaceholder,className:y()}),!o&&b.length>0&&jsx("button",{type:"button",className:v(),onClick:()=>{s.setInputValue("","clear-trigger");},children:jsx(d$3,{className:"size-4.5"})}),jsx(q,{className:A()})]}),jsx(a$1,{className:"mt-2"})]}),jsx(Combobox.List,{ref:u,className:a$2("h-72 overflow-auto outline-none",{"flex flex-col items-center justify-center":P.items.length===0}),children:P.items.length===0?jsx(a$a,{size:"sm",variant:"not-found"}):jsx(Combobox.ItemGroup,{children:P.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===Ze(m)?"opacity-100":"opacity-0")})]},a.key))})})]})})]})})};var _o=({className:e,country:o,countryName:t})=>{let n=En[o];return jsx("span",{className:a$2("flex size-4.5 shrink-0 items-center justify-center overflow-hidden rounded-full border border-white [&_svg:not([class*='size-'])]:h-full [&_svg:not([class*='size-'])]:w-auto [&_svg:not([class*='size-'])]:max-w-none [&_svg:not([class*='size-'])]:shrink-0",e),children:n&&jsx(n,{title:t})})};var Nt=k.forwardRef(({className:e,disabled:o,error:t,onChange:n,readOnly:r,type:l,value:i,...p},c)=>{let m=Je(),u=k.useMemo(()=>Xe(m),[m]),b=k.useRef(null),d$1=!o&&!r&&!!i,C=d$1||t;k.useImperativeHandle(c,()=>b.current,[]);let R=k.useCallback(()=>{let y=b.current;if(!y){n?.({target:{value:""}});return}y.value="",n?.({target:y}),y.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),...p,disabled:o,readOnly:r,value:i,onChange:n,ref:b}),(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:u.clearPhoneNumberLabel,onClick:R}),t&&jsx(d,{})]})]})});Nt.displayName="PhoneNumberInputComponent";var kl=Fl,zo=k.forwardRef(({className:e,defaultCountry:o,disabled:t,error:n,helperText:r,id:l,label:i,onChange:p=Oo,placeholder:c,readOnly:m,required:u,tooltip:b,value:g,...d},C)=>{let[R,y]=k.useState(false),[v,A]=k.useState(()=>ko(g)??o),L=k.useId(),T=l??L,h=Je(),P=k.useMemo(()=>Xe(h),[h]),E=k.useMemo(()=>Fo(h),[h]),x=k.useMemo(()=>wo(v)??c??Mo,[c,v]),M=c$1({error:n,disabled:t,readOnly:m}),w=a$2(M.control(),"group/phone",!n&&!t&&!m&&R&&"after:ring-input-ring-focus after:ring-2",e),U=k.useCallback(H=>{A(H);},[]);return jsx(je,{disabled:t,error:n,helperText:r,htmlFor:T,label:i,readOnly:m,required:u,tooltip:b,children:jsx(kl,{...d,className:w,ref:C,countrySelectComponent:Ho,countrySelectProps:{error:n,onOpenChange:y,translations:P},defaultCountry:o,disabled:t,flagComponent:_o,id:T,initialValueFormat:"national",inputComponent:Nt,labels:E,numberInputProps:{error:n,placeholder:x},readOnly:m,required:u,value:g,onChange:p,onCountryChange:U})})});zo.displayName="PhoneInput";var wl=({children:e,hasDescription:o=false,disabled:t=false,hasDivider:n=false,className:r,isSelected:l,onClick:i,...p})=>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);},...p,children:e}),n&&jsx(a$1,{})]}),J=wl;var ym=({children:e,title:o,titleLines:t,description:n="",descriptionLines:r,startIcon:l,endIcon:i,hasDivider:p=false,disabled:c=false,isSelected:m=false,className:u,...b})=>jsxs(J,{hasDescription:!!n,disabled:c,hasDivider:p,className:u,isSelected:m,...b,children:[l&&k__default.cloneElement(l,{className:"shrink-0 mr-2 h-4.5 w-4.5"}),jsx(ie,{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{ei as a,ym as b,mi as c,yi as d,As as e,Co as f,Ta as g,_a as h,dt as i,ft as j,be as k,xt as l,Lt as m,hl as n,zo as o};
|
|
1
|
+
import {b as b$2}from'./chunk-ZE64BJO4.js';import {c as c$2,j}from'./chunk-3X2MEX7P.js';import {a as a$9,b as b$3,c as c$4}from'./chunk-GTVHYHF4.js';import {a as a$b}from'./chunk-GFVJRSZI.js';import {a as a$4}from'./chunk-CA5XNVS5.js';import {c as c$6}from'./chunk-JYNJHAGL.js';import {b}from'./chunk-NETNR3VC.js';import {c as c$5}from'./chunk-E3WJNVAZ.js';import {d as d$1}from'./chunk-HPIKGJQV.js';import {a as a$a}from'./chunk-Y3GITC4K.js';import {a}from'./chunk-FHABUQAH.js';import {a as a$5}from'./chunk-ZMMNEYEQ.js';import {d,c as c$1}from'./chunk-QJOYOR4B.js';import {a as a$8}from'./chunk-VIMWKUML.js';import {a as a$7}from'./chunk-6MK7NLF5.js';import {a as a$6,b as b$1,c as c$3,d as d$2}from'./chunk-U4NJK7JM.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}from'./chunk-Q4CWL65C.js';import {e}from'./chunk-RVEUW4QG.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 En from'react-phone-number-input/flags';import {getDefaultOptions}from'date-fns';import wn from'react-phone-number-input/locale/en.json';import Hn from'react-phone-number-input/locale/es.json';import Sn 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 Fl,{parsePhoneNumber,getCountryCallingCode}from'react-phone-number-input';import {getExampleNumber}from'libphonenumber-js/mobile';import Cl from'libphonenumber-js/mobile/examples';var Wo=k__default.memo(({handleSelect:e$1,NoResultsIcon:o,noResultsLabel:t,noResultsDescription:n,noResultsDescriptionLines:r,noResultsAsColumn:l,noResultsButtonOnClick:i,optionDescriptionLines:p,noResultsButtonLabel:c,filteredOptions:m,inputRect:u,inputRef:b$1,popoverPosition:g,optionsListRef:d,selectedOption:C,options:R,setFilteredOptions:y})=>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:u?{width:`${u.width}px`,left:u.left,top:g==="bottom"?`${u.bottom}px`:void 0,bottom:g==="top"?`${window.innerHeight-u.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",b$1.current.value="",y(R),i();},children:c})]})]}),m.map(v=>jsx(b.Root,{disabled:v.disabled,selected:C?.value===v.value,onClick:()=>e$1(v),children:jsxs(b.Content,{children:[jsx(b.Headline,{children:v.label}),v.description&&jsx(b.Description,{className:a$2({"line-clamp-1":p===1,"line-clamp-2":p===2,"line-clamp-3":p===3,"line-clamp-4":p===4}),children:v.description})]})},v.key??v.value))]})})),Ut=Wo;var Ko=336,ei=({options:e,defaultSelectedOption:o,onSelect:t,onClick:n,onInputChange:r,error:l,helperText:i,label:p,placeholder:c,value:m,size:u="md",optionDescriptionLines:b=1,noResultsLabel:g,noResultsIcon:d,noResultsDescription:C,noResultsDescriptionLines:R,noResultsAsColumn:y,noResultsButtonOnClick:v,noResultsButtonLabel:A,className:L,disabled:T})=>{let[h,P]=useState(o??null),E=useRef(null),x=useRef(null),[M,w]=useState(),[U,H]=useState([]),[s,a]=useState("bottom"),[N,D]=useState(),S=Ko,j=useCallback(_=>{E.current.style.display="none",x.current.value=_.label,P(_),t?.(_);},[t]),V=useCallback(()=>{if(!x?.current)return;let _=x.current.getBoundingClientRect();w(_);let Y=N?N.height:S,Q=window.innerHeight-_.bottom>Y,Me=_.top>Y;a(Q?"bottom":Me?"top":"bottom");},[N?.height]),ye=useCallback(()=>{let _=e.filter(Y=>Y.label.toLowerCase().includes(x?.current?.value.toLowerCase()??""));if(H(_),E?.current){let Y=E.current.getBoundingClientRect();D(Y);}},[e]);return useEffect(()=>{H(e);},[e]),useEffect(()=>{if(!m){P(null),x.current&&(x.current.value="");return}(!x.current?.value||h?.value!==m.value)&&(P(m),x.current.value=m.label);},[m]),a$b(E,()=>{E.current.style.display="none",h&&x.current&&(x.current.value=h.label);}),useEffect(()=>{if(x?.current)return V(),x.current.addEventListener("mousedown",V),x.current.addEventListener("input",ye),window.addEventListener("scroll",V,true),window.addEventListener("resize",V),()=>{x.current?.removeEventListener("mousedown",V),x.current?.removeEventListener("input",ye),window.removeEventListener("scroll",V,true),window.removeEventListener("resize",V);}},[V,ye]),jsxs("div",{className:a$2("relative",L),children:[jsx(a$4,{ref:x,autoComplete:"off",list:"",selectMode:true,onChange:_=>{_.target.value||(P(null),t?.(null)),r?.(_);},onClean:()=>{P(null),H(e),t?.(null);},onClick:_=>{E.current.style.display="flex",n?.(_);},onBlur:()=>{h&&x.current&&(x.current.value=h.label);},label:p,helperText:i,placeholder:c,size:u,error:l,disabled:T}),jsx(Ut,{handleSelect:j,noResultsLabel:g,NoResultsIcon:d,optionDescriptionLines:b,noResultsAsColumn:y,noResultsButtonLabel:A,noResultsButtonOnClick:v,noResultsDescription:C,noResultsDescriptionLines:R,filteredOptions:U,inputRect:M,inputRef:x,popoverPosition:s,optionsListRef:E,selectedOption:h,options:e,setFilteredOptions:H})]})};var jo=({children:e,title:o,titleLines:t,description:n="",descriptionLines:r,disabled:l=false,className:i,...p})=>jsxs("div",{className:a$2("flex w-full flex-col gap-1",i),...p,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})]}),ie=jo;var mi=({children:e,title:o,titleLines:t,description:n="",descriptionLines:r,startIcon:l,badgeContent:i,hasDivider:p=false,disabled:c=false,onSelect:m,className:u,...b})=>jsxs(J,{hasDescription:!!n,disabled:c,onClick:m,hasDivider:p,className:a$2(!c&&"cursor-pointer",u),...b,children:[l&&k__default.cloneElement(l,{className:"shrink-0 mr-2 h-4.5 w-4.5"}),jsx(ie,{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,{className:"h-4.5 w-4.5 self-center"})]})]});var yi=({children:e,title:o,titleLines:t=1,description:n="",descriptionLines:r,startIcon:l,hasDivider:i=false,disabled:p=false,checked:c,onCheckedChange:m,className:u,...b})=>jsxs(J,{hasDescription:!!n,disabled:p,hasDivider:i,...b,className:a$2("pr-6",u),children:[l&&k__default.cloneElement(l,{className:"shrink-0 w-4.5 h-4.5 mr-2"}),jsx(ie,{title:o,titleLines:t,description:n,descriptionLines:r,disabled:p}),jsx(c$5,{checked:c,onCheckedChange:m,className:"ml-4 self-center",disabled:p})]});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,p]=useState(true),[c,m]=useState([]),[u,b]=useState(-1),[g,d]=useState("bottom"),[C,R]=useState(),[y,v]=useState(oe);return jsx(jt.Provider,{value:{optionsListRef:o,inputRef:t,autocompleteId:n,inputRect:r,showChips:i,filteredOptions:c,currentFocus:u,popoverPosition:g,setFilteredOptions:m,setCurrentFocus:b,setShowChips:p,setPopoverPosition:d,setInputRect:l,optionsListHeight:y,optionsListRect:C,setOptionsListRect:R,setOptionsListHeight:v},children:e})};var sn=({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=sn;var un=150,mn=k__default.memo(({selectedOptions:e,error:o,onCleanSelectedOptions:t,disabled:n,size:r})=>{let{autocompleteId:l,inputRect:i,inputRef:p,optionsListRef:c$1}=ee(),m=k__default.useRef(null),[u,b]=k__default.useState(new Map),g=useMemo(()=>{if(!i?.width)return [];let C=0,R=i.width-un,y=0;for(let v=0;v<e.length&&(y+=u.get(v)??0,!(y>R));v++)C++;return e.slice(0,C)},[i?.width,e,u]),d=useCallback(()=>{n||(p?.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:g.map((C,R)=>jsx(Xt,{option:C,onMountWidth:y=>b(v=>new Map(v).set(R,y))},`chip-input-${l}-${C.value}`))}),e.length>g.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=mn;var hn=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:p=>{e.disabled||(i?.current?.value&&p.preventDefault(),t?.(e,p));},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})})]})}),rt=hn;var xn=k__default.memo(({selectedOptions:e$1,handleSelect:o,NoResultsIcon:t,noResultsLabel:n,noResultsDescription:r,noResultsDescriptionLines:l,noResultsAsColumn:i,noResultsButtonOnClick:p,optionDescriptionLines:c,noResultsButtonLabel:m})=>{let{popoverPosition:u,optionsListRef:b,filteredOptions:g,inputRect:d,autocompleteId:C,inputRef:R,optionsListHeight:y}=ee(),v=useCallback(L=>e$1.some(T=>T.value===L.value),[e$1]),A=useMemo(()=>e$1.filter(L=>L.label.toLowerCase().includes(R?.current?.value.toLowerCase()??"")),[e$1,R?.current?.value]);return jsx(Vt.Root,{asChild:true,children:jsxs("div",{ref:b,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:u==="bottom"?`${d.bottom}px`:void 0,bottom:u==="top"?`${window.innerHeight-d.top}px`:void 0,maxHeight:y+"px"}:void 0,children:[g.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}),p&&jsxs(Fragment,{children:[jsx(a$1,{}),jsx(e,{variant:"ghost",className:"my-3 w-fit self-center",onClick:()=>{b.current.style.display="none",R.current.value="",p();},children:m})]})]}),A.map((L,T)=>jsx(rt,{option:L,index:T,onPressOption:h=>o(h),isSelected:v(L),optionDescriptionLines:c},`autocomplete-option-${C}-${L.key??L.value}`)),g.map((L,T)=>!e$1.some(h=>h.value===L.value)&&jsx(rt,{option:L,index:T,onPressOption:h=>o(h),isSelected:v(L),optionDescriptionLines:c},`autocomplete-option-${C}-${L.key??L.value}`))]})})}),to=xn;var In=k__default.memo(({selectedOptions:e,onSelect:o,error:t,helperText:n,label:r,placeholder:l,options:i,onInputChange:p,size:c,disabled:m})=>{let{setCurrentFocus:u,setFilteredOptions:b,optionsListRef:g,inputRef:d}=ee();return jsx(a$4,{ref:d,autoComplete:"off",list:"",disabled:m,selectMode:true,onChange:C=>{u(-1),p?.(C.target.value);},onClean:()=>{u(-1),b(i),o?.(null,e);},onClick:()=>{m||(g.current.style.display="flex");},error:t,helperText:n,label:r,placeholder:l,fixedTopLabel:e.length>0,size:c})}),oo=In;var no=({options:e,defaultSelectedOptions:o,onSelect:t,error:n,helperText:r,label:l,placeholder:i,noResultsLabel:p,noResultsIcon:c,noResultsDescription:m,noResultsDescriptionLines:u,noResultsAsColumn:b,noResultsButtonOnClick:g,noResultsButtonLabel:d,className:C,onInputChange:R,value:y,loading:v,size:A="md",optionDescriptionLines:L=1,disabled:T})=>{let{inputRef:h,optionsListRef:P,setFilteredOptions:E,setShowChips:x,setInputRect:M,setPopoverPosition:w,setCurrentFocus:U,showChips:H,setOptionsListRect:s,optionsListRect:a,setOptionsListHeight:N}=ee(),D=useRef(false),[S,j]=useState(o??[]),V=useCallback(W=>{j(X=>{let le,Ie=X.findIndex($o=>$o.value===W.value);return Ie===-1?(le=X.concat(W),t?.(W,le),le):(le=X.toSpliced(Ie,1),t?.(W,le),le)});},[t]),ye=useCallback(()=>{j([]),E(e),t?.(null,[]);},[]),_=useCallback(()=>{x(false);},[]),Y=useCallback(()=>{x(true);},[]),Q=useCallback(()=>{if(!h?.current)return;let W=h.current.getBoundingClientRect();M(W);let X=a?a.height>oe?oe:a.height:oe,le=window.innerHeight-W.bottom>X,Ie=W.top>X;w(le?"bottom":Ie?"top":"bottom"),N(Ie?oe:window.innerHeight-W.bottom>oe?oe:window.innerHeight-W.bottom);},[a?.height]),Me=useCallback(()=>{let W=e.filter(X=>X.label.toLowerCase().includes(h?.current?.value.toLowerCase()??""));if(E(W),P?.current){let X=P.current.getBoundingClientRect();s(X);}},[e,P?.current]);return useEffect(()=>{E(e);},[e]),a$b(P,()=>{P.current.style.display="none",U(-1);}),useEffect(()=>{if(h?.current)return Q(),h.current.addEventListener("mousedown",Q),h.current.addEventListener("input",Me),h.current.addEventListener("focusin",_),h.current.addEventListener("focusout",Y),window.addEventListener("scroll",Q,true),window.addEventListener("resize",Q),()=>{h.current?.removeEventListener("mousedown",Q),h.current?.removeEventListener("input",Q),h.current?.removeEventListener("focusout",Y),h.current?.removeEventListener("focusin",_),window.removeEventListener("scroll",Q,true),window.removeEventListener("resize",Q);}},[Q,Y,_,Me]),useEffect(()=>{y&&(j(y),x(true));},[y]),useEffect(()=>{v||o&&o.length&&!D.current&&(j(o),D.current=true,x(true));},[o,v]),jsxs("div",{className:a$2("relative",C),children:[jsx(oo,{selectedOptions:S,onSelect:t,error:n,helperText:r,label:l,placeholder:i,handleSelect:V,options:e,onInputChange:R,size:A,disabled:T}),H&&jsx(Zt,{selectedOptions:S,disabled:T,error:n,onCleanSelectedOptions:ye,size:A}),jsx(to,{handleSelect:V,selectedOptions:S,noResultsLabel:p,NoResultsIcon:c,optionDescriptionLines:L,noResultsAsColumn:b,noResultsButtonLabel:d,noResultsButtonOnClick:g,noResultsDescription:m,noResultsDescriptionLines:u})]})};var As=e=>jsx(Yt,{children:jsx(no,{...e})});var je=({children:e,className:o,disabled:t,error:n,helperText:r,htmlFor:l,label:i,readOnly:p,required:c,tooltip:m})=>{let{root:u}=c$1({error:n,disabled:t,readOnly:p});return jsxs("div",{className:u({className:o}),"data-error":n||void 0,"data-disabled":t||void 0,"data-readonly":p||void 0,children:[i&&jsx(a$7,{as:"label",htmlFor:l,label:i,required:c,tooltip:m}),e,jsx(a$8,{children:r})]})};var st=({className:e,country:o,countryName:t})=>{let n=En[o];return jsx("span",{className:a$2("flex size-4.5 shrink-0 items-center justify-center overflow-hidden rounded-full border border-white [&_svg:not([class*='size-'])]:h-full [&_svg:not([class*='size-'])]:w-auto [&_svg:not([class*='size-'])]:max-w-none [&_svg:not([class*='size-'])]:shrink-0",e),children:n&&jsx(n,{title:t})})};var Fn=({code:e,codeClassName:o,label:t})=>jsxs("div",{className:"flex justify-center gap-2",children:[jsx(st,{country:e,countryName:t}),jsx("span",{className:a$2("text-sm leading-[143%] font-medium text-neutral-800",o),children:e})]}),so=({className:e,disabled:o,error:t,onChange:n,onOpenChange:r,options:l,readOnly:i,translations:p,value:c})=>{let m=k.useRef(null),[u,b]=k.useState(""),[g,d]=k.useState(false),{wrapper:C,input:R,clearIcon:y,searchIcon:v}=b$2({size:"md"}),{contains:A}=useFilter({sensitivity:"base"}),L=k.useMemo(()=>l.map(s=>({...s,key:s.code})),[l]),T=k.useMemo(()=>L.find(s=>s.key===c),[L,c]),{collection:h,filter:P,set:E}=useListCollection({initialItems:L,itemToString:s=>`${s.label} ${s.code}`,itemToValue:s=>s.key,filter:(s,a,N)=>A(s,a)||A(N.code,a.toUpperCase())});k.useEffect(()=>{E(L);},[L,E]);let x=k.useCallback(s=>{d(s),r?.(s);},[r]),M=k.useCallback(({inputValue:s})=>{let a=s??"";b(a),P(a),m.current?.scrollTo({top:0});},[P]),w=k.useCallback(s=>{x(s),s&&(b(""),P(""));},[P,x]),U=k.useCallback(({itemValue:s})=>{if(!s)return;let a=L.find(N=>N.key===s)?.code;a&&(n(a),x(false));},[L,x,n]),H=useCombobox({collection:h,inputBehavior:"autohighlight",inputValue:u,open:g,openOnChange:false,openOnClick:false,selectionBehavior:"preserve",value:T?[T.key]:[],onInputValueChange:M,onOpenChange:({open:s})=>{s||x(false);},onSelect:U});return jsx(Combobox.RootProvider,{value:H,children:jsxs(a$9,{open:g,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&&g&&"after:bg-input-ring-focus after:w-0.5",e),disabled:o||i,children:T&&jsx(Fn,{code:T.code,label:T.label,codeClassName:a$2(t?"text-danger-600":void 0,o&&"text-input-text-disabled",i&&"text-input-text-disabled")})})}),jsx(c$4,{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:p.searchCountryPlaceholder,className:R()}),!o&&u.length>0&&jsx("button",{type:"button",className:y(),onClick:()=>{H.setInputValue("","clear-trigger");},children:jsx(d$3,{className:"size-4.5"})}),jsx(q,{className:v()})]}),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(st,{country:s.code,countryName:s.label}),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:p,...c},m)=>{let u=k.useRef(null),b=`${p??""}`.length>0,g=!t&&!l&&b,d$1=g||n;k.useImperativeHandle(m,()=>u.current,[]);let C=k.useCallback(y=>{r?.(y.target.value);},[r]),R=k.useCallback(()=>{r?.(""),u.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",g&&n&&"pr-14",n&&!g&&"pr-10.5",t&&"text-input-text-disabled",e),...c,disabled:t,readOnly:l,value:p,onChange:C,ref:u}),(g||n)&&jsxs("div",{className:"absolute inset-y-0 right-3 z-10 flex items-center gap-1",children:[g&&jsx(a$5,{ariaLabel:o,onClick:R}),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"},co={en:wn,es:Hn,pt:Sn},_n=pt.en,Dn=co.en,Bn={es:{clearIdLabel:pt.es,searchCountryPlaceholder:"Buscar..."},pt:{clearIdLabel:pt.pt,searchCountryPlaceholder:"Pesquisar..."}},zn={clearIdLabel:_n,searchCountryPlaceholder:"Search..."},po=()=>getDefaultOptions().locale?.code,uo=e=>Bn[e]??zn,Vn=(e,o)=>(co[o]??Dn)[e]??e,mo=({localeCode:e})=>c$2.map(o=>({code:o,label:Vn(o,e)})).sort((o,t)=>o.label.localeCompare(t.label)),fo=a$6,ho=b$1,go=(e,o)=>{let t=o.trim();return !t||!c$3(e,t).isValid?t:d$2(e,t)};var bo=()=>{},Co=k.forwardRef(({autoComplete:e,className:o,country:t,disabled:n,error:r,helperText:l,id:i,label:p,name:c,onBlur:m,onChange:u=bo,onCountryChange:b=bo,placeholder:g,readOnly:d,required:C,tooltip:R,value:y},v)=>{let[A,L]=k.useState(false),[T,h]=k.useState(y??""),P=k.useId(),E=i??P,x=po(),M=k.useRef(y??"");k.useEffect(()=>{(y??"")!==M.current&&h(y??"");},[y]);let w=k.useMemo(()=>uo(x),[x]),U=k.useMemo(()=>mo({localeCode:x}),[x]),H=k.useMemo(()=>ho(t??"")||g||fo,[t,g]),s=c$1({error:r,disabled:n,readOnly:d}),a=k.useCallback((S,j)=>{let V=go(S,j);M.current=V,u(V);},[u]),N=k.useCallback(S=>{h(S),a(t??"",S);},[t,a]),D=k.useCallback(S=>{b(S),a(S,T);},[T,b,a]);return jsx(je,{disabled:n,error:r,helperText:l,htmlFor:E,label:p,readOnly:d,required:C,tooltip:R,children:jsxs("div",{className:a$2(s.control(),"group/id-field",!r&&!n&&!d&&A&&"after:ring-input-ring-focus after:ring-2",o),children:[jsx(so,{disabled:n,error:r,onChange:D,onOpenChange:L,options:U,readOnly:d,translations:w,value:t}),jsx(ct,{autoComplete:e,clearLabel:w.clearIdLabel,disabled:n,error:r,id:E,name:c,onBlur:m,onChange:N,placeholder:H,readOnly:d,required:C,value:T,ref:v})]})})});Co.displayName="IdField";var Ta=({children:e$2,title:o,titleLines:t=1,description:n,descriptionLines:r=1,StartIcon:l,hasDivider:i=false,disabled:p=false,actionButton:c,isSelected:m=false,className:u,...b})=>jsxs(J,{hasDescription:!!n,disabled:p,hasDivider:i,isSelected:m,...b,className:u,children:[l&&jsx(l,{className:"mr-2 h-4.5 w-4.5 shrink-0 grow-0"}),jsx(ie,{title:o,titleLines:t,description:n,descriptionLines:r,disabled:p}),c&&jsx(Fragment,{children:c.isIcon?jsx(e$1,{...c,className:"ml-4 self-center",variant:"ghost",size:"sm",disabled:p??c.disabled}):jsx(e,{...c,className:"ml-4 self-center",size:"sm",variant:"ghost",disabled:p??c.disabled})})]});var _a=({title:e,description:o="",descriptionLines:t,hasDivider:n=false,disabled:r=false,checked:l,onCheckedChange:i,className:p,chipStatus:c,chipExpandable:m,...u})=>jsxs(J,{hasDescription:!!o,disabled:r,hasDivider:n,...u,className:a$2("pr-6",p),children:[jsx(c$5,{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$6,{...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 gt=({editorRef:e})=>{let[o]=useLexicalComposerContext();return useEffect(()=>(e.current=o,()=>{e.current===o&&(e.current=null);}),[o,e]),null};var jn={"ql-align-left":"left","ql-align-center":"center","ql-align-right":"right","ql-align-justify":"justify"},Yn={center:"ql-align-center",right:"ql-align-right",justify:"ql-align-justify"},Xn=()=>typeof window<"u"&&typeof window.DOMParser<"u",xo=e=>Xn()?new DOMParser().parseFromString(e,"text/html"):null,Zn=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=jn[n];r&&(r!=="left"&&(t.style.textAlign=r),t.classList.remove(n));}},er=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`);}},tr=(e,o)=>{let t=e.getAttribute("data-list");return t==="bullet"?"ul":t==="ordered"?"ol":o},or=e=>{let o=e.cloneNode(true);return o.removeAttribute("data-list"),o.removeAttribute("data-checked"),o.removeAttribute("data-indent"),Ct(o),o},bt=(e,o)=>e.createElement(o),nr=(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),u=tr(c,i),b=or(c);for(;l.length>0&&l[l.length-1].level>m;)l.pop();if(l.length===0){let d=bt(o,u);r.push(d),l.push({level:0,kind:u,listElement:d});}let g=l[l.length-1];for(;g.level<m;){let d=g.listElement.lastElementChild;if(!d||d.tagName!=="LI")break;let C=bt(o,u);d.appendChild(C),g={level:g.level+1,kind:u,listElement:C},l.push(g);}if(g=l[l.length-1],g.kind!==u){let d=bt(o,u);if(l.length===1)r.push(d),l[0]={level:0,kind:u,listElement:d};else {let R=l[l.length-2].listElement.lastElementChild;R&&R.tagName==="LI"?(R.appendChild(d),l[l.length-1]={level:g.level,kind:u,listElement:d}):(r.push(d),l.length=1,l[0]={level:0,kind:u,listElement:d});}g=l[l.length-1];}g.listElement.appendChild(b);}if(r.length===0)return;let p=o.createDocumentFragment();for(let c of r)p.appendChild(c);e.replaceWith(p);},rr=(e,o)=>{let t=Array.from(e.querySelectorAll("ol, ul"));for(let n of t)nr(n,o);},Lo=(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)Lo(i,o+1);}},lr=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=Yn[r];l&&n.classList.add(l);}},be=e=>Zn(e).replace(/>\s+</g,"><").replace(/ /g," "),xt=e=>{let o=e??"";if(!o.trim())return "";let t=xo(o);if(!t)return o;let{body:n}=t;return Jn(n),er(n),rr(n,t),n.innerHTML},Lt=e=>{if(!e.trim())return "";let o=xo(e);if(!o)return e;let{body:t}=o,n=Array.from(t.querySelectorAll("ul, ol"));for(let r of n)Lo(r,0);return lr(t),t.innerHTML};var Ye=e=>{let o="";return e.getEditorState().read(()=>{o=$generateHtmlFromNodes(e,null);}),Lt(o)},dr=(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&&be(r)===be(n.current))return;let l=Ye(t);be(l)!==be(r)&&(o.current=true,dr(t,r),queueMicrotask(()=>{o.current=false;})),n.current=r;},[t,o,e]),null};var Io=["left","center","right","justify"];var vo=["bold","italic","underline","strikethrough","code"];var jr={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikethrough",code:"code"},Yr={left:jsx(AlignLeftIcon,{className:"size-4"}),center:jsx(AlignCenterIcon,{className:"size-4"}),right:jsx(AlignRightIcon,{className:"size-4"}),justify:jsx(AlignJustifyIcon,{className:"size-4"})},Xr={left:"Align left",center:"Align center",right:"Align right",justify:"Align justify"},Ne={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:"</>"})},Ee={bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",code:"Inline code"},Zr=e=>{let o=e.textFormat;return o===false?[]:Array.isArray(o)?vo.filter(t=>o.includes(t)):["bold","italic","underline"]},Jr=e=>{let o=e.alignment;return o===false?[]:Array.isArray(o)?Io.filter(t=>o.includes(t)):["left","center","right","justify"]},el=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()}))]},Ae=()=>jsx("div",{className:"mx-1 h-5 w-px bg-neutral-300"}),K=({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}),Rt=({config:e,className:o})=>{let[t]=useLexicalComposerContext(),n=useId(),[r,l]=useState(false),[i,p]=useState(false),[c,m]=useState(false),[u,b]=useState(false),[g,d]=useState(false),[C,R]=useState(false),[y,v]=useState(false),[A,L]=useState("paragraph"),[T,h]=useState("left"),P=useMemo(()=>Zr(e),[e]),E=useMemo(()=>Jr(e),[e]),x=useMemo(()=>el(e),[e]),M=useCallback(()=>{let s=$getSelection();if(!$isRangeSelection(s))return;m(s.hasFormat("bold")),b(s.hasFormat("italic")),d(s.hasFormat("underline")),R(s.hasFormat("strikethrough")),v(s.hasFormat("code"));let a=s.anchor.getNode(),N=a.getKey()==="root"?a:a.getTopLevelElementOrThrow();if($isListNode(N))L(N.getListType()==="number"?"ol":"ul");else {let S=$findMatchingParent(N,j=>$isListNode(j));$isListNode(S)?L(S.getListType()==="number"?"ol":"ul"):L($isHeadingNode(N)?N.getTag():N.getType());}let D=$isElementNode(N)?N.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=>(p(s),false),1)),[t,M]);let w=s=>{t.dispatchCommand(FORMAT_TEXT_COMMAND,jr[s]);},U=s=>{t.update(()=>{let a=$getSelection();if($isRangeSelection(a)){if(s==="paragraph"){$setBlocksType(a,()=>$createParagraphNode());return}$setBlocksType(a,()=>$createHeadingNode(s));}});},H=s=>{if(A===(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(K,{label:"Undo",onClick:()=>t.dispatchCommand(UNDO_COMMAND,void 0),disabled:!r,icon:jsx(UndoIcon,{className:"size-4"})}),jsx(K,{label:"Redo",onClick:()=>t.dispatchCommand(REDO_COMMAND,void 0),disabled:!i,icon:jsx(RedoIcon,{className:"size-4"})}),jsx(Ae,{})]}),x.length>0&&jsxs(Fragment,{children:[jsx("label",{className:"sr-only",htmlFor:n,children:"Text style"}),jsx("select",{id:n,value:A.startsWith("h")?A:"paragraph",onChange:s=>U(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:x.map(s=>jsx("option",{value:s.value,children:s.label},s.value))}),jsx(Ae,{})]}),P.length>0&&jsxs(Fragment,{children:[P.includes("bold")&&jsx(K,{label:Ee.bold,onClick:()=>w("bold"),icon:Ne.bold,active:c}),P.includes("italic")&&jsx(K,{label:Ee.italic,onClick:()=>w("italic"),icon:Ne.italic,active:u}),P.includes("underline")&&jsx(K,{label:Ee.underline,onClick:()=>w("underline"),icon:Ne.underline,active:g}),P.includes("strikethrough")&&jsx(K,{label:Ee.strikethrough,onClick:()=>w("strikethrough"),icon:Ne.strikethrough,active:C}),P.includes("code")&&jsx(K,{label:Ee.code,onClick:()=>w("code"),icon:Ne.code,active:y}),jsx(Ae,{})]}),e.lists!==false&&jsxs(Fragment,{children:[jsx(K,{label:"Bulleted list",onClick:()=>H("bullet"),icon:jsx(ListIcon,{className:"size-4"}),active:A==="ul"}),jsx(K,{label:"Numbered list",onClick:()=>H("number"),icon:jsx(ListOrderedIcon,{className:"size-4"}),active:A==="ol"}),jsx(Ae,{})]}),e.indent!==false&&jsxs(Fragment,{children:[jsx(K,{label:"Decrease indent",onClick:()=>t.dispatchCommand(OUTDENT_CONTENT_COMMAND,void 0),icon:jsx(IndentDecreaseIcon,{className:"size-4"})}),jsx(K,{label:"Increase indent",onClick:()=>t.dispatchCommand(INDENT_CONTENT_COMMAND,void 0),icon:jsx(IndentIncreaseIcon,{className:"size-4"})}),jsx(Ae,{})]}),E.length>0&&jsx(Fragment,{children:E.map(s=>jsx(K,{label:Xr[s],onClick:()=>t.dispatchCommand(FORMAT_ELEMENT_COMMAND,s),icon:Yr[s],active:T===s},s))})]})};var No=e=>{if(e!==void 0)return typeof e=="number"?`${e}px`:e},hl=forwardRef(({value:e,onChange:o,onBlur:t,onError:n,placeholder:r="Write your content...",readOnly:l=false,showToolbar:i=true,toolbarConfig:p=ft,className:c,editorClassName:m,toolbarClassName:u,autoFocus:b=false,minHeight:g=160,maxHeight:d,error:C=false,errorMessage:R,editorRef:y},v)=>{let A=useRef(false),L=useMemo(()=>({namespace:"SodtrackRichTextEditor",theme:dt,onError:(h,P)=>{if(n){n(h,P);return}console.error("RichTextEditor error",h);},nodes:[HeadingNode,ListNode,ListItemNode]}),[n]),T={minHeight:No(g),maxHeight:No(d),overflowY:d?"auto":void 0};return jsx(LexicalComposer,{initialConfig:L,children:jsxs("div",{className:"w-full",children:[jsxs("div",{ref:v,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(Rt,{config:p,className:u}),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:T,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:A}),b&&!l&&jsx(AutoFocusPlugin,{}),y&&jsx(gt,{editorRef:y}),jsx(OnChangePlugin,{ignoreSelectionChange:true,onChange:(h,P)=>{!o||A.current||o(Ye(P),h);}})]}),C&&R&&jsx("p",{className:"text-error-500 mt-1 text-xs leading-[133%]",children:R})]})})});hl.displayName="RichTextEditor";var Ao={en:wn,es:Hn,pt:Sn},vl={es:{clearPhoneNumberLabel:"Eliminar n\xFAmero de tel\xE9fono",searchCountryPlaceholder:"Buscar..."},pt:{clearPhoneNumberLabel:"Limpar n\xFAmero de telefone",searchCountryPlaceholder:"Pesquisar..."}},Rl={clearPhoneNumberLabel:"Clear phone number",searchCountryPlaceholder:"Search..."},Pl=Ao.en,Mo="9 1234 5678",Pt="ZZ",Oo=()=>{},Xe=e=>vl[e]??Rl,Fo=e=>Ao[e]??Pl,ko=e=>{if(e)try{let o=parsePhoneNumber(e)?.country;return !o||!j(o)?void 0:o}catch{return}},wo=e=>{if(e)return getExampleNumber(e,Cl)?.formatNational()},Ze=e=>e??Pt,Je=()=>getDefaultOptions().locale?.code;var Ml=({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}`})]}),Ho=({className:e,disabled:o,error:t,iconComponent:n,onChange:r,onOpenChange:l,options:i,readOnly:p,translations:c,value:m})=>{let u=k.useRef(null),[b,g]=k.useState(""),[d,C]=k.useState(false),{wrapper:R,input:y,clearIcon:v,searchIcon:A}=b$2({size:"md"}),{contains:L}=useFilter({sensitivity:"base"}),T=k.useMemo(()=>i.filter(a=>a.value!==void 0&&j(a.value)).map(a=>({callingCode:a.value?getCountryCallingCode(a.value):void 0,country:a.value,key:Ze(a.value),label:a.label})),[i]),h=k.useMemo(()=>T.find(a=>a.key===Ze(m)),[T,m]),{collection:P,filter:E,set:x}=useListCollection({initialItems:T,itemToString:a=>a.callingCode?`${a.label} +${a.callingCode}`:a.label,itemToValue:a=>a.key,filter:(a,N,D)=>{let S=N.trim().replace(/^\+/,"");return L(a,N)||(D.country?L(D.country,N.toUpperCase()):false)||(D.callingCode?L(D.callingCode,S)||L(`+${D.callingCode}`,N):false)}});k.useEffect(()=>{x(T);},[T,x]);let M=k.useCallback(a=>{C(a),l?.(a);},[l]),w=k.useCallback(({inputValue:a})=>{let N=a??"";g(N),E(N),u.current?.scrollTo({top:0});},[E]),U=k.useCallback(a=>{M(a),a&&(g(""),E(""));},[E,M]),H=k.useCallback(({itemValue:a})=>{if(!a||a===Pt){r(void 0),M(false);return}j(a)&&(r(a),M(false));},[M,r]),s=useCombobox({collection:P,inputBehavior:"autohighlight",inputValue:b,open:d,openOnChange:false,openOnClick:false,selectionBehavior:"preserve",value:h?[h.key]:[],onInputValueChange:w,onOpenChange:({open:a})=>{a||M(false);},onSelect:H});return jsx(Combobox.RootProvider,{value:s,children:jsxs(a$9,{open:d,onOpenChange:U,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||p?"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||p,children:h&&jsx(Ml,{Icon:n,callingCode:h.callingCode,country:h.country,countryName:h.label,callingCodeClassName:a$2(t?"text-danger-600":void 0,o&&"text-input-text-disabled",p&&"text-input-text-disabled")})})}),jsx(c$4,{portalled:false,className:"w-75 p-0",children:jsxs(Combobox.Content,{children:[jsxs(Combobox.Control,{className:"pb-0",children:[jsxs("div",{className:R({className:"m-1 mb-0"}),children:[jsx(Combobox.Input,{autoComplete:"off","data-1p-ignore":true,"data-lpignore":"true",placeholder:c.searchCountryPlaceholder,className:y()}),!o&&b.length>0&&jsx("button",{type:"button",className:v(),onClick:()=>{s.setInputValue("","clear-trigger");},children:jsx(d$3,{className:"size-4.5"})}),jsx(q,{className:A()})]}),jsx(a$1,{className:"mt-2"})]}),jsx(Combobox.List,{ref:u,className:a$2("h-72 overflow-auto outline-none",{"flex flex-col items-center justify-center":P.items.length===0}),children:P.items.length===0?jsx(a$a,{size:"sm",variant:"not-found"}):jsx(Combobox.ItemGroup,{children:P.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===Ze(m)?"opacity-100":"opacity-0")})]},a.key))})})]})})]})})};var _o=({className:e,country:o,countryName:t})=>{let n=En[o];return jsx("span",{className:a$2("flex size-4.5 shrink-0 items-center justify-center overflow-hidden rounded-full border border-white [&_svg:not([class*='size-'])]:h-full [&_svg:not([class*='size-'])]:w-auto [&_svg:not([class*='size-'])]:max-w-none [&_svg:not([class*='size-'])]:shrink-0",e),children:n&&jsx(n,{title:t})})};var Nt=k.forwardRef(({className:e,disabled:o,error:t,onChange:n,readOnly:r,type:l,value:i,...p},c)=>{let m=Je(),u=k.useMemo(()=>Xe(m),[m]),b=k.useRef(null),d$1=!o&&!r&&!!i,C=d$1||t;k.useImperativeHandle(c,()=>b.current,[]);let R=k.useCallback(()=>{let y=b.current;if(!y){n?.({target:{value:""}});return}y.value="",n?.({target:y}),y.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),...p,disabled:o,readOnly:r,value:i,onChange:n,ref:b}),(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:u.clearPhoneNumberLabel,onClick:R}),t&&jsx(d,{})]})]})});Nt.displayName="PhoneNumberInputComponent";var kl=Fl,zo=k.forwardRef(({className:e,defaultCountry:o,disabled:t,error:n,helperText:r,id:l,label:i,onChange:p=Oo,placeholder:c,readOnly:m,required:u,tooltip:b,value:g,...d},C)=>{let[R,y]=k.useState(false),[v,A]=k.useState(()=>ko(g)??o),L=k.useId(),T=l??L,h=Je(),P=k.useMemo(()=>Xe(h),[h]),E=k.useMemo(()=>Fo(h),[h]),x=k.useMemo(()=>wo(v)??c??Mo,[c,v]),M=c$1({error:n,disabled:t,readOnly:m}),w=a$2(M.control(),"group/phone",!n&&!t&&!m&&R&&"after:ring-input-ring-focus after:ring-2",e),U=k.useCallback(H=>{A(H);},[]);return jsx(je,{disabled:t,error:n,helperText:r,htmlFor:T,label:i,readOnly:m,required:u,tooltip:b,children:jsx(kl,{...d,className:w,ref:C,countrySelectComponent:Ho,countrySelectProps:{error:n,onOpenChange:y,translations:P},defaultCountry:o,disabled:t,flagComponent:_o,id:T,initialValueFormat:"national",inputComponent:Nt,labels:E,numberInputProps:{error:n,placeholder:x},readOnly:m,required:u,value:g,onChange:p,onCountryChange:U})})});zo.displayName="PhoneInput";var wl=({children:e,hasDescription:o=false,disabled:t=false,hasDivider:n=false,className:r,isSelected:l,onClick:i,...p})=>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);},...p,children:e}),n&&jsx(a$1,{})]}),J=wl;var ym=({children:e,title:o,titleLines:t,description:n="",descriptionLines:r,startIcon:l,endIcon:i,hasDivider:p=false,disabled:c=false,isSelected:m=false,className:u,...b})=>jsxs(J,{hasDescription:!!n,disabled:c,hasDivider:p,className:u,isSelected:m,...b,children:[l&&k__default.cloneElement(l,{className:"shrink-0 mr-2 h-4.5 w-4.5"}),jsx(ie,{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{ei as a,ym as b,mi as c,yi as d,As as e,Co as f,Ta as g,_a as h,dt as i,ft as j,be as k,xt as l,Lt as m,hl as n,zo as o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-ORVJ7EFO.js';import {b as b$2}from'./chunk-6QOM3R5H.js';import {b as b$1}from'./chunk-E3WJNVAZ.js';import {a as a$1}from'./chunk-UIZFLYFP.js';import {a as a$2}from'./chunk-JW7HS6NX.js';import {k,l}from'./chunk-Q4CWL65C.js';import {e}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-ORVJ7EFO.js';import {b as b$2}from'./chunk-6QOM3R5H.js';import {b as b$1}from'./chunk-E3WJNVAZ.js';import {a as a$1}from'./chunk-UIZFLYFP.js';import {a as a$2}from'./chunk-JW7HS6NX.js';import {k,l}from'./chunk-Q4CWL65C.js';import {e}from'./chunk-RVEUW4QG.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};
|