sodtrack-web-ui 0.109.22 → 0.109.24
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-PLS23Q6O.js → chunk-2D52XBAM.js} +1 -1
- package/dist/{chunk-X4AI3XPY.js → chunk-2GUQSPB3.js} +1 -1
- package/dist/{chunk-H2W4DMI2.js → chunk-6YF5WBHX.js} +1 -1
- package/dist/{chunk-USAH5LKL.js → chunk-7PAWIFZL.js} +1 -1
- package/dist/{chunk-5COF6T5O.js → chunk-7Q5GDQ2X.js} +1 -1
- package/dist/{chunk-DIECYP75.js → chunk-7QFMZUHO.js} +1 -1
- package/dist/chunk-AL7LDS5W.js +2 -0
- package/dist/{chunk-CMW3RKDM.js → chunk-C45CFY6D.js} +1 -1
- package/dist/chunk-CBE4O5PE.js +1 -0
- package/dist/{chunk-LOMBLDZW.js → chunk-D7IVBSXD.js} +1 -1
- package/dist/{chunk-WXXXUETS.js → chunk-DDCIEO4X.js} +1 -1
- package/dist/chunk-DUBQPI4Q.js +1 -0
- package/dist/chunk-EIBJ3H3Y.js +1 -0
- package/dist/{chunk-MZAOBPTZ.js → chunk-FOKLET3V.js} +1 -1
- package/dist/chunk-HWWZ4EBE.js +1 -0
- package/dist/{chunk-XSXVFXUV.js → chunk-IZFPW7SS.js} +1 -1
- package/dist/{chunk-UH2U3OJH.js → chunk-IZVYL53R.js} +1 -1
- package/dist/{chunk-ZX6P36LZ.js → chunk-JD5OCWIV.js} +1 -1
- package/dist/{chunk-5S7CEVEK.js → chunk-MU7XAC5W.js} +1 -1
- package/dist/{chunk-ZDMBCRIA.js → chunk-NKD2N5ZT.js} +1 -1
- package/dist/{chunk-WKPHDQE7.js → chunk-NLEQIR6A.js} +1 -1
- package/dist/{chunk-XMXLUNEU.js → chunk-OB7PQC3A.js} +1 -1
- package/dist/{chunk-GZCQIMHV.js → chunk-QGEOF4DM.js} +1 -1
- package/dist/{chunk-QX2NMWPS.js → chunk-QGHYQUQ5.js} +1 -1
- package/dist/{chunk-XMMVCTDS.js → chunk-UTBWDSL3.js} +1 -1
- package/dist/{chunk-USHOFETH.js → chunk-WQXTACDW.js} +1 -1
- package/dist/{chunk-5P3NEWSI.js → chunk-XFS2MG6B.js} +1 -1
- package/dist/chunk-ZS746KCM.js +1 -0
- package/dist/{chunk-TQ6DGZQE.js → chunk-ZVQ3Z6AW.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.d.ts +6 -1
- package/dist/components/index.js +1 -1
- package/dist/components/intl-formatters.d.ts +15 -0
- package/dist/components/intl-formatters.js +1 -0
- 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.d.ts +4 -1
- package/dist/components/list-item.js +1 -1
- package/dist/components/list-item_old.js +1 -1
- package/dist/components/locale-config.d.ts +82 -0
- package/dist/components/locale-config.js +1 -0
- package/dist/components/locale-flag.d.ts +18 -0
- package/dist/components/locale-flag.js +1 -0
- package/dist/components/menu.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/components/use-number.d.ts +16 -0
- package/dist/components/use-number.js +1 -0
- package/dist/styles/index.css +1 -1
- package/package.json +1 -1
- package/dist/chunk-4LTLOLAM.js +0 -1
- package/dist/chunk-6V4ZY7YY.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {e}from'./chunk-PI7DECIN.js';import {e as e$1}from'./chunk-
|
|
1
|
+
import {e}from'./chunk-PI7DECIN.js';import {e as e$1}from'./chunk-DUBQPI4Q.js';import {a}from'./chunk-OBZIYJO7.js';import {createContext,forwardRef,useState,useEffect,useContext,useCallback,useMemo}from'react';import {PanelRightCloseIcon,PanelRightOpenIcon,PanelLeftCloseIcon,PanelLeftOpenIcon}from'lucide-react';import {jsxs,jsx}from'react/jsx-runtime';var h=createContext(null),f=()=>{let t=useContext(h);if(!t)throw new Error("useSidebar must be used within a SidebarProvider");return t},E=({open:t,defaultOpen:i=false,onOpenChange:a,storageKey:r,children:s})=>{let e=t!==void 0,[l,d]=useState(()=>{if(!e&&r&&typeof window<"u"){let u=localStorage.getItem(r);if(u!==null)return u==="true"}return i}),o=e?t:l;useEffect(()=>{!r||typeof window>"u"||localStorage.setItem(r,String(o));},[o,r]);let p=useCallback(()=>{let u=!o;e||d(u),a?.(u);},[e,o,a]),m=useMemo(()=>({isOpen:o,toggle:p}),[o,p]);return jsx(h.Provider,{value:m,children:s})};E.displayName="SidebarProvider";var y={left:{open:PanelLeftOpenIcon,close:PanelLeftCloseIcon},right:{open:PanelRightOpenIcon,close:PanelRightCloseIcon}},M=forwardRef(({side:t="left",className:i,children:a$1,...r},s)=>{let{isOpen:e$1,toggle:l}=f(),[d,o]=useState(e$1);useEffect(()=>{e$1&&o(true);},[e$1]);let p=e$1?y[t].close:y[t].open;return jsxs("aside",{ref:s,className:a("flex min-h-0 shrink-0 flex-col overflow-hidden border-neutral-400 bg-neutral-100 transition-[width] duration-300 ease-[cubic-bezier(0.165,0.84,0.44,1)]",t==="left"?"order-first border-r":"order-last border-l",e$1?"w-75":"w-13",i),...r,children:[jsx("div",{className:a("flex shrink-0 pt-2 pb-1",e$1?t==="left"?"justify-end px-2":"justify-start px-2":"justify-center"),children:jsx(e,{variant:"ghost",size:"md",Icon:p,onClick:l,"aria-expanded":e$1,"aria-label":e$1?"Collapse sidebar":"Expand sidebar"})}),d&&a$1]})});M.displayName="Sidebar";var k=forwardRef(({title:t,subtitle:i,Icon:a$1,buttons:r=[],className:s,...e$1},l)=>{let{isOpen:d}=f();return jsxs("div",{ref:l,className:a("flex min-w-75 shrink-0 flex-col border-b border-neutral-200 px-4 pb-3 transition-opacity duration-200",d?"opacity-100 delay-100":"pointer-events-none opacity-0",s),...e$1,children:[jsxs("div",{className:"flex items-center justify-between gap-2",children:[a$1&&jsx(a$1,{className:"size-4.5 shrink-0 text-neutral-900"}),jsx("p",{className:"font-jakarta line-clamp-1 flex-1 leading-[130%] font-semibold break-all text-neutral-900",children:t}),r.length>0&&jsx("div",{className:"flex gap-2",children:r.map(({visible:o=true,...p},m)=>o?jsx(e,{variant:"ghost",tone:"neutral",size:"sm",...p},m):null)})]}),i&&jsx("p",{className:"font-inter mt-1 line-clamp-2 text-xs leading-[130%] text-neutral-800",children:i})]})});k.displayName="SidebarHeader";var B=forwardRef(({className:t,children:i,...a$1},r)=>{let{isOpen:s}=f();return jsx("div",{ref:r,className:a("min-h-0 min-w-75 flex-1 shrink-0 overflow-y-auto px-4 py-2 transition-opacity duration-200",s?"opacity-100 delay-100":"pointer-events-none opacity-0",t),...a$1,children:i})});B.displayName="SidebarBody";var D=forwardRef(({className:t,buttons:i=[],children:a$1,...r},s)=>{let{isOpen:e}=f();return jsx("div",{ref:s,className:a("min-w-75 shrink-0 border-t border-neutral-200 px-4.5 pt-3 pb-4.5 transition-opacity duration-200",e?"opacity-100 delay-100":"pointer-events-none opacity-0",t),...r,children:i.length>0?jsx("div",{className:"flex gap-3",children:i.map(({visible:l=true,...d},o)=>l?jsx("div",{className:"flex-1",children:jsx(e$1,{size:"lg",className:"w-full",...d})},o):null)}):a$1})});D.displayName="SidebarFooter";export{f as a,E as b,M as c,k as d,B as e,D as f};
|
|
@@ -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-4LTLOLAM.js';import {c as c$5}from'./chunk-E3WJNVAZ.js';import {a as a$a}from'./chunk-XMXLUNEU.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-6V4ZY7YY.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 {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-ZS746KCM.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 Pm=({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,Pm 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 as b$1}from'./chunk-
|
|
1
|
+
import {b as b$1}from'./chunk-ZS746KCM.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 {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-6YF5WBHX.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};
|